export { createMemory, type Memory } from './memory.js';
export { registerMemoryCommand } from './cli.js';
export {
  createPreferencesRepo,
  type PreferencesRepo,
  type Preference,
  type NewPreference,
} from './preferences.js';
export {
  createInsightsRepo,
  type InsightsRepo,
  type Insight,
  type NewInsight,
  type SearchResult,
} from './insights.js';
export type { VectorStore, VectorSearchResult, EmbeddingProvider } from './vector-store.js';
export type {
  MemoryAdapter,
  MemoryConfig,
  NewInsight as AdapterNewInsight,
  Insight as AdapterInsight,
  InsightSearchResult,
} from './types.js';
export { createMemoryAdapter, registerMemoryAdapter } from './factory.js';
export {
  createOperatorMemoryPlugin,
  type OperatorMemoryPlugin,
  type OperatorMemoryScope,
  type OperatorMemoryConfig,
  type OperatorMemoryResult,
} from './operator-memory-plugin.js';
export { PgVectorAdapter } from './adapters/pgvector.js';
export { KeywordAdapter } from './adapters/keyword.js';

// Auto-register adapters at module load time
import { registerMemoryAdapter } from './factory.js';
import { PgVectorAdapter } from './adapters/pgvector.js';
import { KeywordAdapter } from './adapters/keyword.js';
import type { MemoryConfig } from './types.js';

registerMemoryAdapter('pgvector', (config: MemoryConfig) => {
  return new PgVectorAdapter(config as Extract<MemoryConfig, { type: 'pgvector' }>);
});

registerMemoryAdapter('keyword', (config: MemoryConfig) => {
  return new KeywordAdapter(config as Extract<MemoryConfig, { type: 'keyword' }>);
});
