import { ContentType, IndexStats, KnowledgeOrigin, KnowledgeRecord, SearchResult, SourceType } from "../../core/dist/index.js";
import BetterSqlite3 from "better-sqlite3";

//#region packages/store/src/graph-store.interface.d.ts
/**
 * Knowledge graph store abstraction — typed nodes + edges for entity-relationship storage.
 * Complements the vector store: vector search finds similar content,
 * graph traversal finds connected concepts.
 */
/** A node in the knowledge graph (entity, concept, service, etc.) */
interface GraphNode {
  /** Unique identifier */
  id: string;
  /** Node type (e.g., 'entity', 'service', 'api', 'concept', 'decision') */
  type: string;
  /** Display name */
  name: string;
  /** Arbitrary properties */
  properties: Record<string, unknown>;
  /** Back-link to KnowledgeRecord.id that produced this node */
  sourceRecordId?: string;
  /** Source file path (for cleanup on re-index) */
  sourcePath?: string;
  /** ISO timestamp */
  createdAt?: string;
  /** Community/cluster label from community detection */
  community?: string;
}
/** An edge connecting two nodes */
interface GraphEdge {
  /** Unique identifier */
  id: string;
  /** Source node ID */
  fromId: string;
  /** Target node ID */
  toId: string;
  /** Relationship type (e.g., 'depends-on', 'implements', 'calls', 'affects') */
  type: string;
  /** Optional weight (0-1) */
  weight?: number;
  /** Optional confidence score (0-1) for relationship certainty */
  confidence?: number;
  /** Arbitrary properties */
  properties?: Record<string, unknown>;
}
/** Options for graph traversal */
interface GraphTraversalOptions {
  /** Relationship type filter */
  edgeType?: string;
  /** Max traversal depth (default: 2) */
  maxDepth?: number;
  /** Direction: outgoing from start, incoming to start, or both */
  direction?: 'outgoing' | 'incoming' | 'both';
  /** Max total nodes returned (default: 50) */
  limit?: number;
}
/** Result of a graph traversal */
interface GraphTraversalResult {
  nodes: GraphNode[];
  edges: GraphEdge[];
}
/** Graph statistics */
interface GraphStats {
  nodeCount: number;
  edgeCount: number;
  nodeTypes: Record<string, number>;
  edgeTypes: Record<string, number>;
}
/** Result of graph validation */
interface GraphValidationResult {
  valid: boolean;
  orphanNodes: string[];
  danglingEdges: Array<{
    edgeId: string;
    missingNodeId: string;
  }>;
  stats: GraphStats;
}
/** Depth-grouped traversal result — nodes bucketed by distance from start */
interface DepthGroupedResult {
  [depth: number]: GraphNode[];
}
/** Execution flow / process info */
interface ProcessInfo {
  id: string;
  entryNodeId: string;
  label: string;
  properties: Record<string, unknown>;
  steps: string[];
  createdAt?: string;
}
/** 360-degree symbol view — full context around a node */
interface Symbol360 {
  node: GraphNode;
  incoming: GraphEdge[];
  outgoing: GraphEdge[];
  community: string | null;
  processes: ProcessInfo[];
}
/** Knowledge graph store interface */
interface IGraphStore {
  /** Initialize the store (create tables, indices) */
  initialize(): Promise<void>;
  /** Add or update a single node */
  upsertNode(node: GraphNode): Promise<void>;
  /** Add or update a single edge */
  upsertEdge(edge: GraphEdge): Promise<void>;
  /** Batch add/update nodes */
  upsertNodes(nodes: GraphNode[]): Promise<void>;
  /** Batch add/update edges */
  upsertEdges(edges: GraphEdge[]): Promise<void>;
  /** Get a node by ID */
  getNode(id: string): Promise<GraphNode | null>;
  /** Get direct neighbors of a node */
  getNeighbors(nodeId: string, options?: GraphTraversalOptions): Promise<GraphTraversalResult>;
  /** Multi-hop traversal from a starting node */
  traverse(startId: string, options?: GraphTraversalOptions): Promise<GraphTraversalResult>;
  /** Find nodes by type and/or name pattern */
  findNodes(filter: {
    type?: string;
    namePattern?: string;
    sourcePath?: string;
    limit?: number;
  }): Promise<GraphNode[]>;
  /** Find edges by type between optional node filters */
  findEdges(filter: {
    type?: string;
    fromId?: string;
    toId?: string;
    limit?: number;
  }): Promise<GraphEdge[]>;
  /** Delete a node and all its edges */
  deleteNode(id: string): Promise<void>;
  /** Delete all nodes/edges originating from a source path */
  deleteBySourcePath(sourcePath: string): Promise<number>;
  /** Delete all nodes and edges (full reset) */
  clear(): Promise<void>;
  /** Get graph statistics */
  getStats(): Promise<GraphStats>;
  /** Validate graph integrity — check for orphan nodes and dangling edges */
  validate(): Promise<GraphValidationResult>;
  /** Set community label on a node */
  setNodeCommunity(nodeId: string, community: string): Promise<void>;
  /** Run label-propagation community detection, returns community -> nodeId[] map */
  detectCommunities(): Promise<Record<string, string[]>>;
  /** Trace execution flow from entry node via outgoing 'calls' edges, store as process */
  traceProcess(entryNodeId: string, label: string): Promise<ProcessInfo>;
  /** List processes, optionally filtered to those containing a specific node */
  getProcesses(nodeId?: string): Promise<ProcessInfo[]>;
  /** Delete a process and its steps */
  deleteProcess(processId: string): Promise<void>;
  /** Traverse with results grouped by depth: { 1: [...], 2: [...], 3: [...] } */
  depthGroupedTraversal(startId: string, maxDepth?: number, options?: GraphTraversalOptions): Promise<DepthGroupedResult>;
  /** Cohesion score for a community: internal edges / (internal + external edges) */
  getCohesionScore(community: string): Promise<number>;
  /** 360-degree view of a node: incoming, outgoing, community, processes */
  getSymbol360(nodeId: string): Promise<Symbol360>;
  /** Release cached memory without closing the connection (lightweight idle cleanup). */
  releaseMemory?(): void;
  /** Close the store */
  close(): Promise<void>;
}
//#endregion
//#region packages/store/src/sqlite-adapter.d.ts
type SqliteAdapterType = 'better-sqlite3' | 'sql.js';
interface ISqliteAdapter {
  /** Which adapter implementation is active */
  readonly type: SqliteAdapterType;
  /**
   * True when the underlying engine can execute vector-search queries
   * (better-sqlite3 with the sqlite-vec extension loaded). False on sql.js
   * or when extension loading failed.
   */
  readonly vectorCapable: boolean;
  /** Open or create the database at the given file path */
  open(dbPath: string): Promise<void>;
  /** Execute DDL or multi-statement SQL (CREATE TABLE, BEGIN, COMMIT, etc.) */
  exec(sql: string): void;
  /** Set a PRAGMA value */
  pragma(pragma: string): void;
  /** Run a parameterized SELECT, return all rows */
  queryAll<T = Record<string, unknown>>(sql: string, params?: unknown[]): T[];
  /** Run a parameterized INSERT/UPDATE/DELETE */
  run(sql: string, params?: unknown[]): void;
  /** Flush to disk — no-op for file-backed engines, required for in-memory engines */
  flush(): void;
  /** Close the database connection */
  close(): void;
}
/**
 * Create the project's SQLite adapter.
 *
 * Prefers better-sqlite3 (native, mmap-backed, supports sqlite-vec). Falls
 * back to sql.js (WASM, vector search disabled) if the native binary cannot
 * be loaded — typically because the platform has no prebuild and the native
 * compile failed during install. In that case the consumer should disable
 * vector-dependent code paths via `adapter.vectorCapable`.
 *
 * ## Auto-healing (ABI mismatch)
 *
 * When the Node.js version changes (e.g., Node 24 → Node 22), the native
 * .node binary is incompatible. This adapter detects the mismatch BEFORE
 * loading the module in-process (via a child process probe) so the file
 * remains unlocked and can be deleted + rebuilt cleanly.
 */
declare function createSqliteAdapter(dbPath: string): Promise<ISqliteAdapter>;
/**
 * Force-create a sql.js adapter (used by tests that need to assert fallback
 * behavior without monkey-patching `require`).
 */
declare function createSqlJsAdapter(dbPath: string): Promise<ISqliteAdapter>;
//#endregion
//#region packages/store/src/migrations.d.ts
type MigrationDb = Pick<ISqliteAdapter, 'exec' | 'queryAll' | 'run'>;
interface Migration {
  version: number;
  name: string;
  up: (db: MigrationDb) => void;
}
declare function runMigrations(db: MigrationDb, migrations: readonly Migration[]): void;
declare const allMigrations: readonly Migration[];
//#endregion
//#region packages/store/src/state-partition.d.ts
type PartitionKind = 'content' | 'control';
interface StatePartitionConfig {
  /** When true, control-state data can be routed to a separate database. */
  splitEnabled: boolean;
  /** Path for content DB (knowledge, vectors, graph). Defaults to the main DB path. */
  contentDbPath?: string;
  /**
   * Path for control DB (sessions, stash, checkpoints, signals).
   * Defaults to the main DB path unless split mode derives a sibling control DB.
   */
  controlDbPath?: string;
}
interface ResolvedStatePartitionConfig {
  splitEnabled: boolean;
  contentDbPath: string;
  controlDbPath: string;
}
declare const CONTROL_TABLES: Set<string>;
/**
 * Determines which partition a table belongs to.
 */
declare function getTablePartition(tableName: string): PartitionKind;
declare function resolveStatePartitionConfig(mainDbPath: string, config?: Partial<StatePartitionConfig>): ResolvedStatePartitionConfig;
declare function readStatePartitionConfigFromEnv(mainDbPath: string, env?: NodeJS.ProcessEnv): ResolvedStatePartitionConfig;
//#endregion
//#region packages/store/src/partition-migrator.d.ts
/**
 * Migrates from single-DB to split-DB mode.
 * Copies control tables to a new database.
 * Safe to run multiple times (idempotent).
 */
declare function migrateToSplitState(config: StatePartitionConfig): Promise<void>;
//#endregion
//#region packages/store/src/sqlite-graph-store.d.ts
declare class SqliteGraphStore implements IGraphStore {
  private adapter;
  private reopenPromise;
  private readonly dbPath;
  private readonly externalAdapter;
  /**
   * Create a graph store backed by SQLite.
   *
   * Two construction modes:
   *  - `{ path }` — creates and owns its own adapter at `<path>/graph.db`.
   *    Used standalone (legacy).
   *  - `{ adapter }` — uses an externally-managed adapter that is shared with
   *    other stores (e.g. `SqliteVecStore`). The caller owns the adapter
   *    lifecycle and must have already configured pragmas.
   */
  constructor(options?: {
    path?: string;
    adapter?: ISqliteAdapter;
  });
  initialize(): Promise<void>;
  private configureAdapter;
  private createTables;
  private migrateSchema;
  private getAdapter;
  /**
   * Ensure the adapter is open, lazily re-opening after close().
   * Must be called from any public async method that may be invoked after close().
   */
  private ensureOpen;
  private reopenAdapter;
  private query;
  private run;
  upsertNode(node: GraphNode): Promise<void>;
  upsertEdge(edge: GraphEdge): Promise<void>;
  upsertNodes(nodes: GraphNode[]): Promise<void>;
  upsertEdges(edges: GraphEdge[]): Promise<void>;
  getNode(id: string): Promise<GraphNode | null>;
  getNeighbors(nodeId: string, options?: GraphTraversalOptions): Promise<GraphTraversalResult>;
  traverse(startId: string, options?: GraphTraversalOptions): Promise<GraphTraversalResult>;
  findNodes(filter: {
    type?: string;
    namePattern?: string;
    sourcePath?: string;
    limit?: number;
  }): Promise<GraphNode[]>;
  findEdges(filter: {
    type?: string;
    fromId?: string;
    toId?: string;
    limit?: number;
  }): Promise<GraphEdge[]>;
  deleteNode(id: string): Promise<void>;
  deleteBySourcePath(sourcePath: string): Promise<number>;
  clear(): Promise<void>;
  getStats(): Promise<GraphStats>;
  validate(): Promise<GraphValidationResult>;
  setNodeCommunity(nodeId: string, community: string): Promise<void>;
  detectCommunities(): Promise<Record<string, string[]>>;
  traceProcess(entryNodeId: string, label: string): Promise<ProcessInfo>;
  getProcesses(nodeId?: string): Promise<ProcessInfo[]>;
  deleteProcess(processId: string): Promise<void>;
  depthGroupedTraversal(startId: string, maxDepth?: number, options?: GraphTraversalOptions): Promise<DepthGroupedResult>;
  getCohesionScore(community: string): Promise<number>;
  getSymbol360(nodeId: string): Promise<Symbol360>;
  /**
   * Release cached memory without closing the connection.
   * Called during idle periods to reduce memory footprint while keeping the store usable.
   */
  releaseMemory(): void;
  close(): Promise<void>;
}
//#endregion
//#region packages/store/src/store.interface.d.ts
/** Options for searching the store */
interface SearchOptions {
  /** Maximum number of results to return */
  limit?: number;
  /** Minimum similarity score (0-1) */
  minScore?: number;
  /** Filter by content type */
  contentType?: ContentType;
  /** Filter by coarse source type (source, documentation, test, config, generated) */
  sourceType?: SourceType;
  /** Filter by origin */
  origin?: KnowledgeOrigin;
  /** Filter by category */
  category?: string;
  /** Filter by exact tag membership (any supplied tag may match) */
  tags?: string[];
}
interface IKnowledgeStore {
  /** Initialize the store (create tables, etc.) */
  initialize(): Promise<void>;
  /** Add or update records with their embedding vectors */
  upsert(records: KnowledgeRecord[], vectors: Float32Array[]): Promise<void>;
  /** Add or update records with priority over bulk indexing writes */
  upsertInteractive(records: KnowledgeRecord[], vectors: Float32Array[]): Promise<void>;
  /** Add or update a record by reusing an existing vector instead of embedding again */
  upsertWithoutVector?(record: KnowledgeRecord, sourceRecordId: string): Promise<void>;
  /** Search by vector similarity */
  search(queryVector: Float32Array, options?: SearchOptions): Promise<SearchResult[]>;
  /** Coarse vector search using reduced-dimension embeddings (multi-resolution matryoshka) */
  coarseSearch?(queryVector: Float32Array, options?: SearchOptions): Promise<SearchResult[]>;
  /** Get a specific record by ID */
  getById(id: string): Promise<KnowledgeRecord | null>;
  /** Delete records by source path (used during re-indexing) */
  deleteBySourcePath(sourcePath: string): Promise<number>;
  /** Delete a specific record by ID */
  deleteById(id: string): Promise<boolean>;
  /** Delete a specific record by ID with priority over bulk indexing writes */
  deleteByIdInteractive(id: string): Promise<boolean>;
  /** Get all records for a source path */
  getBySourcePath(sourcePath: string): Promise<KnowledgeRecord[]>;
  /** Get index statistics */
  getStats(): Promise<IndexStats>;
  /** List all unique source paths in the store */
  listSourcePaths(): Promise<string[]>;
  /** Create a full-text search index on the content column for keyword search */
  createFtsIndex(): Promise<void>;
  /** Full-text keyword search (requires FTS index) */
  ftsSearch(query: string, options?: SearchOptions): Promise<SearchResult[]>;
  /** Drop the backing table entirely — used for hard resets (e.g. dimension changes) */
  dropTable(): Promise<void>;
  /** Release cached memory without closing the connection (lightweight idle cleanup). */
  releaseMemory?(): void;
  /** Register a callback invoked synchronously before the store closes. */
  onBeforeClose?(fn: () => void): void;
  /** Close the store connection */
  close(): Promise<void>;
}
//#endregion
//#region packages/store/src/sqlite-vec-store.d.ts
interface EmbeddingProfile$1 {
  model: string;
  nativeDim: number;
  dimensions: number;
  queryPrefix: string;
}
interface SqliteVecStoreOptions {
  /** Path to the .db file (file is created if missing) */
  path?: string;
  /** Full embedding profile from runtime; takes precedence over embeddingDim. */
  embeddingProfile?: EmbeddingProfile$1;
  /** Embedding dimension — must match the embedder configuration */
  embeddingDim?: number;
  /** Externally-managed adapter (shared with graph store). When omitted, the store creates its own. */
  adapter?: ISqliteAdapter;
  /** Optional state-partition config for future split-db deployments. */
  partition?: StatePartitionConfig;
}
declare class SqliteVecStore implements IKnowledgeStore {
  private adapter;
  private readonly externalAdapter;
  private readonly dbPath;
  private readonly embeddingDim;
  private readonly embeddingProfile;
  /** Coarse embedding dimension for multi-resolution search (matryoshka). */
  private readonly coarseDim;
  private vectorEnabled;
  private ftsEnabled;
  private warnedVectorDisabled;
  private _draining;
  private _priorityQueue;
  private _normalQueue;
  private _closeWaiter;
  private _onCloseHooks;
  constructor(options?: SqliteVecStoreOptions);
  initialize(): Promise<void>;
  private configureConnectionPragmas;
  /**
   * Diagnostics for the status tool. Returns runtime info about the underlying
   * adapter and DB file (read-only; safe to call after initialize()).
   */
  getDiagnostics(): {
    adapterType: string;
    vectorSearchEnabled: boolean;
    ftsEnabled: boolean;
    degradedMode: boolean;
    dbPath: string;
    dbSizeBytes: number | null;
    embeddingDim: number;
    vectorDtype: string;
    embeddingModel: string;
    embeddingProfile: EmbeddingProfile$1;
  };
  private createKnowledgeTable;
  private createKnowledgeTagsTable;
  private createFtsTable;
  private createEmbeddingProfileTable;
  private getStoredEmbeddingProfile;
  private saveEmbeddingProfile;
  private dropVectorTables;
  private ensureVecTable;
  private enqueueWrite;
  private _drain;
  upsert(records: KnowledgeRecord[], vectors: Float32Array[]): Promise<void>;
  upsertInteractive(records: KnowledgeRecord[], vectors: Float32Array[]): Promise<void>;
  /**
   * Insert a knowledge record and copy the vector from an existing record.
   * Used for chunk dedup — when content hash matches, skip re-embedding.
   */
  upsertWithoutVector(record: KnowledgeRecord, sourceRecordId: string): Promise<void>;
  private upsertKnowledgeRow;
  private replaceKnowledgeTags;
  private _upsertImpl;
  search(queryVector: Float32Array, options?: SearchOptions): Promise<SearchResult[]>;
  coarseSearch(queryVector: Float32Array, options?: SearchOptions): Promise<SearchResult[]>;
  ftsSearch(query: string, options?: SearchOptions): Promise<SearchResult[]>;
  getById(id: string): Promise<KnowledgeRecord | null>;
  deleteBySourcePath(sourcePath: string): Promise<number>;
  private _deleteBySourcePathImpl;
  deleteById(id: string): Promise<boolean>;
  deleteByIdInteractive(id: string): Promise<boolean>;
  private _deleteByIdImpl;
  getBySourcePath(sourcePath: string): Promise<KnowledgeRecord[]>;
  getStats(): Promise<IndexStats>;
  listSourcePaths(): Promise<string[]>;
  createFtsIndex(): Promise<void>;
  dropTable(): Promise<void>;
  private _dropTableImpl;
  /**
   * Release cached memory without closing the connection.
   * Called during idle periods to reduce memory footprint while keeping the store usable.
   */
  releaseMemory(): void;
  /** Register a callback invoked synchronously before the store closes. */
  onBeforeClose(fn: () => void): void;
  close(timeoutMs?: number): Promise<void>;
  private getAdapter;
  private runAdaptiveVectorSearch;
  private queryVectorRows;
  private buildVectorSearchPlan;
  private rowsToSearchResults;
  /**
   * Build a SQL filter suffix from SearchOptions.
   * @param whereOnly when true the caller already has a WHERE clause and we emit `AND ...`
   *                  otherwise we emit `WHERE ...`.
   */
  private buildFilterSqlSuffix;
  private fromRow;
}
//#endregion
//#region packages/store/src/state-store.d.ts
interface MemoryMeta {
  entryId: string;
  tier: string;
  retentionScore: number;
  accessCount: number;
  lastAccessedAt: string | null;
  createdAt: string;
  promotedAt: string | null;
  supersededBy: string | null;
  confidence: number;
}
interface MemoryMetaListOptions {
  tier?: string;
  belowScore?: number;
  limit?: number;
}
interface StateStore {
  stashGet(key: string): string | undefined;
  stashSet(key: string, value: string): void;
  stashList(): Array<{
    key: string;
    value: string;
    updatedAt: string;
  }>;
  stashDelete(key: string): boolean;
  stashClear(): void;
  signalPost(workspace: string, key: string, value: string, agent?: string, ttlSeconds?: number): number;
  signalGet(workspace: string, key: string): Array<{
    id: number;
    value: string;
    agent?: string;
    createdAt: string;
    expiresAt: string;
  }>;
  signalList(workspace: string): Array<{
    id: number;
    key: string;
    value: string;
    agent?: string;
    createdAt: string;
  }>;
  signalClear(workspace: string, key?: string): number;
  signalCleanExpired(): number;
  leaseAcquire(resource: string, holder: string, workspace: string, intent?: string, ttlMinutes?: number): boolean;
  leaseRelease(resource: string, holder: string, workspace: string): boolean;
  leaseGet(resource: string, workspace: string): {
    resource: string;
    holder: string;
    intent?: string;
    workspace: string;
    acquiredAt: string;
    expiresAt: string;
  } | undefined;
  leaseList(workspace: string): Array<{
    resource: string;
    holder: string;
    intent?: string;
    acquiredAt: string;
    expiresAt: string;
  }>;
  leaseCleanExpired(): number;
  sessionCreate(sessionId: string, metadata?: Record<string, unknown>): void;
  sessionTouch(sessionId: string): void;
  sessionGet(sessionId: string): {
    sessionId: string;
    createdAt: string;
    lastActivity: string;
    metadata?: string;
  } | undefined;
  sessionList(): Array<{
    sessionId: string;
    createdAt: string;
    lastActivity: string;
  }>;
  sessionDelete(sessionId: string): boolean;
  sessionDeleteStale(maxInactiveMinutes: number): number;
  checkpointSave(id: string, label: string, data: string, notes?: string): void;
  checkpointLoad(id: string): {
    id: string;
    label: string;
    data: string;
    notes?: string;
    createdAt: string;
  } | undefined;
  checkpointList(label?: string, limit?: number): Array<{
    id: string;
    label: string;
    createdAt: string;
    notes?: string;
  }>;
  checkpointLatest(label?: string): {
    id: string;
    label: string;
    data: string;
    notes?: string;
    createdAt: string;
  } | undefined;
  checkpointDelete(id: string): boolean;
  checkpointDiff(fromId: string, toId: string): {
    from: string;
    to: string;
  } | undefined;
  checkpointHistory(label?: string, limit?: number): Array<{
    id: string;
    label: string;
    createdAt: string;
    notes?: string;
  }>;
  checkpointGc(keepLast?: number, maxAgeDays?: number): number;
  memoryMetaCreate(entryId: string, tier?: string): void;
  memoryMetaGet(entryId: string): MemoryMeta | undefined;
  memoryMetaTouch(entryId: string): void;
  memoryMetaUpdateScore(entryId: string, score: number): void;
  memoryMetaUpdateConfidence(entryId: string, confidence: number): void;
  memoryMetaUpdateTier(entryId: string, tier: string): void;
  memoryMetaSetSuperseded(entryId: string, supersededBy: string): void;
  memoryMetaList(options?: MemoryMetaListOptions): MemoryMeta[];
}
declare function createStateStore(db: BetterSqlite3.Database): StateStore;
declare function createStateStore(db: ISqliteAdapter): StateStore;
//#endregion
//#region packages/store/src/store-factory.d.ts
type StoreBackend = 'lancedb' | 'sqlite-vec';
interface EmbeddingProfile {
  model: string;
  nativeDim: number;
  dimensions: number;
  queryPrefix: string;
}
interface StoreConfig {
  backend: StoreBackend;
  path: string;
  options?: Record<string, unknown>;
  /** Optional shared adapter (only used by the sqlite-vec backend) */
  adapter?: ISqliteAdapter;
  /** Embedding dimension (only used by the sqlite-vec backend) */
  embeddingDim?: number;
  /** Full embedding profile (only used by the sqlite-vec backend). */
  embeddingProfile?: EmbeddingProfile;
  /** Optional control/content partition config for sqlite-backed stores. */
  partition?: StatePartitionConfig;
}
declare function createStore(config: StoreConfig): Promise<IKnowledgeStore>;
//#endregion
export { CONTROL_TABLES, type DepthGroupedResult, type GraphEdge, type GraphNode, type GraphStats, type GraphTraversalOptions, type GraphTraversalResult, type GraphValidationResult, type IGraphStore, type IKnowledgeStore, type ISqliteAdapter, type MemoryMeta, type Migration, type MigrationDb, type PartitionKind, type ProcessInfo, type ResolvedStatePartitionConfig, type SearchOptions, type SqliteAdapterType, SqliteGraphStore, SqliteVecStore, type SqliteVecStoreOptions, type StatePartitionConfig, type StateStore, type StoreBackend, type StoreConfig, type Symbol360, allMigrations, createSqlJsAdapter, createSqliteAdapter, createStateStore, createStore, getTablePartition, migrateToSplitState, readStatePartitionConfigFromEnv, resolveStatePartitionConfig, runMigrations };