import { entities } from '../src/entities.js';
import { NetaClawAgentSessionEntity } from '../src/modules/netaclaw/entity/agent_session.js';
import { NetaClawAgentSessionEntryEntity } from '../src/modules/netaclaw/entity/agent_session_entry.js';
import { NetaClawDataSourceEntity } from '../src/modules/netaclaw/entity/data_source.js';
import { NetaClawDataSourceQueryAuditEntity } from '../src/modules/netaclaw/entity/data_source_query_audit.js';

describe('entities exports', () => {
  it('includes SubagentSession entity', () => {
    const entityNames = entities
      .map(e => (typeof e === 'function' ? e.name : ''))
      .filter(Boolean);

    expect(entityNames.some(n => n.includes('SubagentSession'))).toBe(true);
  });

  it('includes session-tree MySQL entities', () => {
    expect(entities).toContain(NetaClawAgentSessionEntity);
    expect(entities).toContain(NetaClawAgentSessionEntryEntity);
  });

  it('includes netaclaw data source entities', () => {
    expect(entities).toContain(NetaClawDataSourceEntity);
    expect(entities).toContain(NetaClawDataSourceQueryAuditEntity);
  });
});
