@axiom-lattice/pg-stores 1.0.53 → 1.0.54

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,5 +1,5 @@
1
1
 
2
- > @axiom-lattice/pg-stores@1.0.53 build /home/runner/work/agentic/agentic/packages/pg-stores
2
+ > @axiom-lattice/pg-stores@1.0.54 build /home/runner/work/agentic/agentic/packages/pg-stores
3
3
  > tsup src/index.ts --format cjs,esm --dts --sourcemap
4
4
 
5
5
  CLI Building entry: src/index.ts
@@ -8,13 +8,13 @@
8
8
  CLI Target: es2020
9
9
  CJS Build start
10
10
  ESM Build start
11
- ESM dist/index.mjs 156.69 KB
12
- ESM dist/index.mjs.map 297.04 KB
13
- ESM ⚡️ Build success in 370ms
14
- CJS dist/index.js 161.08 KB
15
- CJS dist/index.js.map 297.13 KB
16
- CJS ⚡️ Build success in 423ms
11
+ ESM dist/index.mjs 188.71 KB
12
+ ESM dist/index.mjs.map 357.23 KB
13
+ ESM ⚡️ Build success in 461ms
14
+ CJS dist/index.js 193.53 KB
15
+ CJS dist/index.js.map 357.39 KB
16
+ CJS ⚡️ Build success in 518ms
17
17
  DTS Build start
18
- DTS ⚡️ Build success in 13060ms
19
- DTS dist/index.d.ts 40.25 KB
20
- DTS dist/index.d.mts 40.25 KB
18
+ DTS ⚡️ Build success in 12296ms
19
+ DTS dist/index.d.ts 46.06 KB
20
+ DTS dist/index.d.mts 46.06 KB
package/CHANGELOG.md CHANGED
@@ -1,5 +1,14 @@
1
1
  # @axiom-lattice/pg-stores
2
2
 
3
+ ## 1.0.54
4
+
5
+ ### Patch Changes
6
+
7
+ - 8fc8bb0: add eval
8
+ - Updated dependencies [8fc8bb0]
9
+ - @axiom-lattice/protocols@2.1.33
10
+ - @axiom-lattice/core@2.1.64
11
+
3
12
  ## 1.0.53
4
13
 
5
14
  ### Patch Changes
package/dist/index.d.mts CHANGED
@@ -1,7 +1,7 @@
1
1
  import { PoolConfig, PoolClient, Pool } from 'pg';
2
2
  export { Pool, PoolConfig } from 'pg';
3
- import { ThreadStore, Thread, CreateThreadRequest, AssistantStore, Assistant, CreateAssistantRequest, ScheduleStorage, ScheduledTaskDefinition, ScheduledTaskStatus, ScheduleExecutionType, SkillStore, Skill, CreateSkillRequest, DatabaseConfigStore, DatabaseConfigEntry, CreateDatabaseConfigRequest, UpdateDatabaseConfigRequest, MetricsServerConfigStore, MetricsServerConfigEntry, CreateMetricsServerConfigRequest, UpdateMetricsServerConfigRequest, McpServerConfigStore, McpServerConfigEntry, CreateMcpServerConfigRequest, UpdateMcpServerConfigRequest, WorkspaceStore, Workspace, CreateWorkspaceRequest, UpdateWorkspaceRequest, ProjectStore, Project, CreateProjectRequest, UpdateProjectRequest, UserStore, User, CreateUserRequest, UpdateUserRequest, TenantStore, Tenant, CreateTenantRequest, UpdateTenantRequest, UserTenantLinkStore, UserTenantLink, CreateUserTenantLinkRequest, UpdateUserTenantLinkRequest, ChannelInstallationStore, ChannelInstallation, CreateChannelInstallationRequest, UpdateChannelInstallationRequest, WorkflowTrackingStore, CreateWorkflowRunRequest, WorkflowRun, UpdateWorkflowRunRequest, CreateRunStepRequest, RunStep, UpdateRunStepRequest, StepType } from '@axiom-lattice/protocols';
4
- export { Assistant, AssistantStore, ChannelInstallation, ChannelInstallationStore, CreateAssistantRequest, CreateChannelInstallationRequest, CreateDatabaseConfigRequest, CreateMcpServerConfigRequest, CreateMetricsServerConfigRequest, CreateProjectRequest, CreateRunStepRequest, CreateSkillRequest, CreateTenantRequest, CreateThreadRequest, CreateUserRequest, CreateUserTenantLinkRequest, CreateWorkflowRunRequest, CreateWorkspaceRequest, DatabaseConfig, DatabaseConfigEntry, DatabaseConfigStore, DatabaseType, LarkChannelInstallationConfig, McpServerConfigEntry, McpServerConfigStore, MetricsServerConfig, MetricsServerConfigEntry, MetricsServerConfigStore, Project, ProjectStore, RunStep, ScheduleExecutionType, ScheduleStorage, ScheduledTaskDefinition, ScheduledTaskStatus, Skill, SkillStore, StorageType, Tenant, TenantStatus, TenantStore, Thread, ThreadStore, UpdateChannelInstallationRequest, UpdateDatabaseConfigRequest, UpdateMcpServerConfigRequest, UpdateMetricsServerConfigRequest, UpdateProjectRequest, UpdateRunStepRequest, UpdateTenantRequest, UpdateUserRequest, UpdateUserTenantLinkRequest, UpdateWorkflowRunRequest, UpdateWorkspaceRequest, User, UserStore, UserTenantLink, UserTenantLinkStore, UserTenantRole, WorkflowRun, WorkflowTrackingStore, Workspace, WorkspaceStore } from '@axiom-lattice/protocols';
3
+ import { ThreadStore, Thread, CreateThreadRequest, AssistantStore, Assistant, CreateAssistantRequest, ScheduleStorage, ScheduledTaskDefinition, ScheduledTaskStatus, ScheduleExecutionType, SkillStore, Skill, CreateSkillRequest, DatabaseConfigStore, DatabaseConfigEntry, CreateDatabaseConfigRequest, UpdateDatabaseConfigRequest, MetricsServerConfigStore, MetricsServerConfigEntry, CreateMetricsServerConfigRequest, UpdateMetricsServerConfigRequest, McpServerConfigStore, McpServerConfigEntry, CreateMcpServerConfigRequest, UpdateMcpServerConfigRequest, WorkspaceStore, Workspace, CreateWorkspaceRequest, UpdateWorkspaceRequest, ProjectStore, Project, CreateProjectRequest, UpdateProjectRequest, UserStore, User, CreateUserRequest, UpdateUserRequest, TenantStore, Tenant, CreateTenantRequest, UpdateTenantRequest, UserTenantLinkStore, UserTenantLink, CreateUserTenantLinkRequest, UpdateUserTenantLinkRequest, ChannelInstallationStore, ChannelInstallation, CreateChannelInstallationRequest, UpdateChannelInstallationRequest, WorkflowTrackingStore, CreateWorkflowRunRequest, WorkflowRun, UpdateWorkflowRunRequest, CreateRunStepRequest, RunStep, UpdateRunStepRequest, StepType, EvalStore, EvalProject, CreateEvalProjectRequest, EvalSuite, CreateEvalSuiteRequest, EvalCase, CreateEvalCaseRequest, EvalRun, CreateEvalRunRequest, EvalRunResult, EvalProjectReport } from '@axiom-lattice/protocols';
4
+ export { Assistant, AssistantStore, ChannelInstallation, ChannelInstallationStore, CreateAssistantRequest, CreateChannelInstallationRequest, CreateDatabaseConfigRequest, CreateEvalCaseRequest, CreateEvalProjectRequest, CreateEvalRunRequest, CreateEvalSuiteRequest, CreateMcpServerConfigRequest, CreateMetricsServerConfigRequest, CreateProjectRequest, CreateRunStepRequest, CreateSkillRequest, CreateTenantRequest, CreateThreadRequest, CreateUserRequest, CreateUserTenantLinkRequest, CreateWorkflowRunRequest, CreateWorkspaceRequest, DatabaseConfig, DatabaseConfigEntry, DatabaseConfigStore, DatabaseType, EvalCase, EvalProject, EvalProjectReport, EvalRun, EvalRunResult, EvalStore, EvalSuite, LarkChannelInstallationConfig, McpServerConfigEntry, McpServerConfigStore, MetricsServerConfig, MetricsServerConfigEntry, MetricsServerConfigStore, Project, ProjectStore, RunStep, ScheduleExecutionType, ScheduleStorage, ScheduledTaskDefinition, ScheduledTaskStatus, Skill, SkillStore, StorageType, Tenant, TenantStatus, TenantStore, Thread, ThreadStore, UpdateChannelInstallationRequest, UpdateDatabaseConfigRequest, UpdateMcpServerConfigRequest, UpdateMetricsServerConfigRequest, UpdateProjectRequest, UpdateRunStepRequest, UpdateTenantRequest, UpdateUserRequest, UpdateUserTenantLinkRequest, UpdateWorkflowRunRequest, UpdateWorkspaceRequest, User, UserStore, UserTenantLink, UserTenantLinkStore, UserTenantRole, WorkflowRun, WorkflowTrackingStore, Workspace, WorkspaceStore } from '@axiom-lattice/protocols';
5
5
  import { IMessageQueueStore, AddMessageParams, PendingMessage, ThreadInfo } from '@axiom-lattice/core';
6
6
  export { AddMessageParams, PendingMessage, ThreadInfo } from '@axiom-lattice/core';
7
7
 
@@ -1297,4 +1297,125 @@ declare class PostgreSQLWorkflowTrackingStore implements WorkflowTrackingStore {
1297
1297
  private mapRowToRunStep;
1298
1298
  }
1299
1299
 
1300
- export { type ChannelIdentityMapping, ChannelIdentityMappingStore, type ChannelIdentityMappingStoreOptions, type CreateChannelIdentityMappingInput, type Migration, MigrationManager, PostgreSQLAssistantStore, type PostgreSQLAssistantStoreOptions, PostgreSQLChannelInstallationStore, type PostgreSQLChannelInstallationStoreOptions, PostgreSQLDatabaseConfigStore, type PostgreSQLDatabaseConfigStoreOptions, PostgreSQLMcpServerConfigStore, type PostgreSQLMcpServerConfigStoreOptions, PostgreSQLMetricsServerConfigStore, type PostgreSQLMetricsServerConfigStoreOptions, PostgreSQLProjectStore, type PostgreSQLProjectStoreOptions, PostgreSQLScheduleStorage, type PostgreSQLScheduleStorageOptions, PostgreSQLSkillStore, type PostgreSQLSkillStoreOptions, PostgreSQLTenantStore, type PostgreSQLTenantStoreOptions, PostgreSQLThreadStore, type PostgreSQLThreadStoreOptions, PostgreSQLUserStore, type PostgreSQLUserStoreOptions, PostgreSQLUserTenantLinkStore, type PostgreSQLUserTenantLinkStoreOptions, PostgreSQLWorkflowTrackingStore, type PostgreSQLWorkflowTrackingStoreOptions, PostgreSQLWorkspaceStore, type PostgreSQLWorkspaceStoreOptions, ThreadMessageQueueStore, addAssistantTenantId, addScheduleTenantId, addSkillTenantId, addThreadTenantId, changeAssistantPrimaryKey, changeSkillPrimaryKey, changeThreadPrimaryKey, createAssistantsTable, createChannelIdentityMappingTables, createChannelInstallationsTable, createDatabaseConfigsTable, createMcpServerConfigsTable, createMetricsConfigsTable, createProjectsTable, createScheduledTasksTable, createSkillsTable, createTenantsTable, createThreadMessageQueueTable, createThreadsTable, createUsersTable, createWorkflowTrackingTables, createWorkspacesTable, getThreadMessageQueueStore };
1300
+ /**
1301
+ * PostgreSQL implementation of EvalStore
1302
+ */
1303
+
1304
+ /** PostgreSQL EvalStore options */
1305
+ interface PostgreSQLEvalStoreOptions {
1306
+ /** PostgreSQL connection pool configuration */
1307
+ poolConfig: string | PoolConfig;
1308
+ /** Whether to run migrations automatically on initialization @default true */
1309
+ autoMigrate?: boolean;
1310
+ }
1311
+ /**
1312
+ * PostgreSQL implementation of EvalStore
1313
+ *
1314
+ * Features:
1315
+ * - Multi-tenant isolation via tenant_id
1316
+ * - Full CRUD for projects, suites, cases, runs, run results
1317
+ * - Project report aggregation
1318
+ */
1319
+ declare class PostgreSQLEvalStore implements EvalStore {
1320
+ private pool;
1321
+ private migrationManager;
1322
+ private initialized;
1323
+ private ownsPool;
1324
+ private initPromise;
1325
+ constructor(options: PostgreSQLEvalStoreOptions);
1326
+ /** Dispose resources and close the connection pool */
1327
+ dispose(): Promise<void>;
1328
+ /**
1329
+ * Initialize the store and run migrations
1330
+ * Uses a promise-based lock to prevent concurrent initialization
1331
+ */
1332
+ initialize(): Promise<void>;
1333
+ /** Ensure store is initialized */
1334
+ private ensureInitialized;
1335
+ private mapRowToProject;
1336
+ private mapRowToSuite;
1337
+ private mapRowToCase;
1338
+ private mapRowToRun;
1339
+ private mapRowToRunResult;
1340
+ private parseRequiredJson;
1341
+ private parseOptionalJson;
1342
+ /** Get all eval projects for a tenant */
1343
+ getProjectsByTenant(tenantId: string): Promise<EvalProject[]>;
1344
+ /** Get a single eval project by ID for a tenant */
1345
+ getProjectById(tenantId: string, id: string): Promise<EvalProject | null>;
1346
+ /** Create a new eval project */
1347
+ createProject(tenantId: string, id: string, data: CreateEvalProjectRequest): Promise<EvalProject>;
1348
+ /** Update an eval project */
1349
+ updateProject(tenantId: string, id: string, updates: Partial<CreateEvalProjectRequest>): Promise<EvalProject | null>;
1350
+ /** Delete an eval project */
1351
+ deleteProject(tenantId: string, id: string): Promise<boolean>;
1352
+ /** Get all suites in a project with case counts */
1353
+ getSuitesByProject(tenantId: string, projectId: string): Promise<EvalSuite[]>;
1354
+ /** Get a single suite by ID with case count */
1355
+ getSuiteById(tenantId: string, id: string): Promise<EvalSuite | null>;
1356
+ /** Create a new eval suite */
1357
+ createSuite(tenantId: string, projectId: string, id: string, data: CreateEvalSuiteRequest): Promise<EvalSuite>;
1358
+ /** Update a suite's name */
1359
+ updateSuite(tenantId: string, id: string, updates: Partial<CreateEvalSuiteRequest>): Promise<EvalSuite | null>;
1360
+ /** Delete a suite */
1361
+ deleteSuite(tenantId: string, id: string): Promise<boolean>;
1362
+ /** Get all test cases in a suite */
1363
+ getCasesBySuite(tenantId: string, suiteId: string): Promise<EvalCase[]>;
1364
+ /** Get a single test case by ID */
1365
+ getCaseById(tenantId: string, id: string): Promise<EvalCase | null>;
1366
+ /** Create a new test case */
1367
+ createCase(tenantId: string, suiteId: string, id: string, data: CreateEvalCaseRequest): Promise<EvalCase>;
1368
+ /** Update a test case */
1369
+ updateCase(tenantId: string, id: string, updates: Partial<CreateEvalCaseRequest>): Promise<EvalCase | null>;
1370
+ /** Delete a test case */
1371
+ deleteCase(tenantId: string, id: string): Promise<boolean>;
1372
+ /** Get all runs for a tenant, optionally filtered by project or status */
1373
+ getRunsByTenant(tenantId: string, opts?: {
1374
+ projectId?: string;
1375
+ status?: string;
1376
+ }): Promise<EvalRun[]>;
1377
+ /** Get a single run by ID */
1378
+ getRunById(tenantId: string, id: string): Promise<EvalRun | null>;
1379
+ /** Create a new eval run */
1380
+ createRun(tenantId: string, projectId: string, id: string, data: CreateEvalRunRequest): Promise<EvalRun>;
1381
+ /** Update a run's status and aggregate fields */
1382
+ updateRunStatus(tenantId: string, id: string, updates: {
1383
+ status?: EvalRun["status"];
1384
+ passedCases?: number;
1385
+ failedCases?: number;
1386
+ avgScore?: number;
1387
+ error?: string;
1388
+ completedAt?: Date;
1389
+ }): Promise<EvalRun | null>;
1390
+ /** Delete a run and its results */
1391
+ deleteRun(tenantId: string, id: string): Promise<boolean>;
1392
+ /** Get all results belonging to a run */
1393
+ getResultsByRun(tenantId: string, runId: string): Promise<EvalRunResult[]>;
1394
+ /** Create a result for a case within a run */
1395
+ createRunResult(tenantId: string, runId: string, id: string, data: Omit<EvalRunResult, "id" | "runId" | "createdAt">): Promise<EvalRunResult>;
1396
+ /** Update a run result with tenant isolation via the parent run */
1397
+ updateRunResult(tenantId: string, id: string, updates: Partial<EvalRunResult>): Promise<EvalRunResult | null>;
1398
+ /** Get a single run result by ID with tenant isolation */
1399
+ private getRunResultById;
1400
+ /** Aggregate report for a project including all runs */
1401
+ getProjectReport(tenantId: string, projectId: string): Promise<EvalProjectReport | null>;
1402
+ }
1403
+
1404
+ /**
1405
+ * Eval table migrations
1406
+ */
1407
+
1408
+ /** Create the eval projects table */
1409
+ declare const createEvalProjectsTable: Migration;
1410
+ /** Create the eval suites table */
1411
+ declare const createEvalSuitesTable: Migration;
1412
+ /** Create the eval cases table */
1413
+ declare const createEvalCasesTable: Migration;
1414
+ /** Create the eval runs table */
1415
+ declare const createEvalRunsTable: Migration;
1416
+ /** Create the eval run results table */
1417
+ declare const createEvalRunResultsTable: Migration;
1418
+ /** All eval migrations in version order */
1419
+ declare const evalMigrations: Migration[];
1420
+
1421
+ export { type ChannelIdentityMapping, ChannelIdentityMappingStore, type ChannelIdentityMappingStoreOptions, type CreateChannelIdentityMappingInput, type Migration, MigrationManager, PostgreSQLAssistantStore, type PostgreSQLAssistantStoreOptions, PostgreSQLChannelInstallationStore, type PostgreSQLChannelInstallationStoreOptions, PostgreSQLDatabaseConfigStore, type PostgreSQLDatabaseConfigStoreOptions, PostgreSQLEvalStore, type PostgreSQLEvalStoreOptions, PostgreSQLMcpServerConfigStore, type PostgreSQLMcpServerConfigStoreOptions, PostgreSQLMetricsServerConfigStore, type PostgreSQLMetricsServerConfigStoreOptions, PostgreSQLProjectStore, type PostgreSQLProjectStoreOptions, PostgreSQLScheduleStorage, type PostgreSQLScheduleStorageOptions, PostgreSQLSkillStore, type PostgreSQLSkillStoreOptions, PostgreSQLTenantStore, type PostgreSQLTenantStoreOptions, PostgreSQLThreadStore, type PostgreSQLThreadStoreOptions, PostgreSQLUserStore, type PostgreSQLUserStoreOptions, PostgreSQLUserTenantLinkStore, type PostgreSQLUserTenantLinkStoreOptions, PostgreSQLWorkflowTrackingStore, type PostgreSQLWorkflowTrackingStoreOptions, PostgreSQLWorkspaceStore, type PostgreSQLWorkspaceStoreOptions, ThreadMessageQueueStore, addAssistantTenantId, addScheduleTenantId, addSkillTenantId, addThreadTenantId, changeAssistantPrimaryKey, changeSkillPrimaryKey, changeThreadPrimaryKey, createAssistantsTable, createChannelIdentityMappingTables, createChannelInstallationsTable, createDatabaseConfigsTable, createEvalCasesTable, createEvalProjectsTable, createEvalRunResultsTable, createEvalRunsTable, createEvalSuitesTable, createMcpServerConfigsTable, createMetricsConfigsTable, createProjectsTable, createScheduledTasksTable, createSkillsTable, createTenantsTable, createThreadMessageQueueTable, createThreadsTable, createUsersTable, createWorkflowTrackingTables, createWorkspacesTable, evalMigrations, getThreadMessageQueueStore };
package/dist/index.d.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  import { PoolConfig, PoolClient, Pool } from 'pg';
2
2
  export { Pool, PoolConfig } from 'pg';
3
- import { ThreadStore, Thread, CreateThreadRequest, AssistantStore, Assistant, CreateAssistantRequest, ScheduleStorage, ScheduledTaskDefinition, ScheduledTaskStatus, ScheduleExecutionType, SkillStore, Skill, CreateSkillRequest, DatabaseConfigStore, DatabaseConfigEntry, CreateDatabaseConfigRequest, UpdateDatabaseConfigRequest, MetricsServerConfigStore, MetricsServerConfigEntry, CreateMetricsServerConfigRequest, UpdateMetricsServerConfigRequest, McpServerConfigStore, McpServerConfigEntry, CreateMcpServerConfigRequest, UpdateMcpServerConfigRequest, WorkspaceStore, Workspace, CreateWorkspaceRequest, UpdateWorkspaceRequest, ProjectStore, Project, CreateProjectRequest, UpdateProjectRequest, UserStore, User, CreateUserRequest, UpdateUserRequest, TenantStore, Tenant, CreateTenantRequest, UpdateTenantRequest, UserTenantLinkStore, UserTenantLink, CreateUserTenantLinkRequest, UpdateUserTenantLinkRequest, ChannelInstallationStore, ChannelInstallation, CreateChannelInstallationRequest, UpdateChannelInstallationRequest, WorkflowTrackingStore, CreateWorkflowRunRequest, WorkflowRun, UpdateWorkflowRunRequest, CreateRunStepRequest, RunStep, UpdateRunStepRequest, StepType } from '@axiom-lattice/protocols';
4
- export { Assistant, AssistantStore, ChannelInstallation, ChannelInstallationStore, CreateAssistantRequest, CreateChannelInstallationRequest, CreateDatabaseConfigRequest, CreateMcpServerConfigRequest, CreateMetricsServerConfigRequest, CreateProjectRequest, CreateRunStepRequest, CreateSkillRequest, CreateTenantRequest, CreateThreadRequest, CreateUserRequest, CreateUserTenantLinkRequest, CreateWorkflowRunRequest, CreateWorkspaceRequest, DatabaseConfig, DatabaseConfigEntry, DatabaseConfigStore, DatabaseType, LarkChannelInstallationConfig, McpServerConfigEntry, McpServerConfigStore, MetricsServerConfig, MetricsServerConfigEntry, MetricsServerConfigStore, Project, ProjectStore, RunStep, ScheduleExecutionType, ScheduleStorage, ScheduledTaskDefinition, ScheduledTaskStatus, Skill, SkillStore, StorageType, Tenant, TenantStatus, TenantStore, Thread, ThreadStore, UpdateChannelInstallationRequest, UpdateDatabaseConfigRequest, UpdateMcpServerConfigRequest, UpdateMetricsServerConfigRequest, UpdateProjectRequest, UpdateRunStepRequest, UpdateTenantRequest, UpdateUserRequest, UpdateUserTenantLinkRequest, UpdateWorkflowRunRequest, UpdateWorkspaceRequest, User, UserStore, UserTenantLink, UserTenantLinkStore, UserTenantRole, WorkflowRun, WorkflowTrackingStore, Workspace, WorkspaceStore } from '@axiom-lattice/protocols';
3
+ import { ThreadStore, Thread, CreateThreadRequest, AssistantStore, Assistant, CreateAssistantRequest, ScheduleStorage, ScheduledTaskDefinition, ScheduledTaskStatus, ScheduleExecutionType, SkillStore, Skill, CreateSkillRequest, DatabaseConfigStore, DatabaseConfigEntry, CreateDatabaseConfigRequest, UpdateDatabaseConfigRequest, MetricsServerConfigStore, MetricsServerConfigEntry, CreateMetricsServerConfigRequest, UpdateMetricsServerConfigRequest, McpServerConfigStore, McpServerConfigEntry, CreateMcpServerConfigRequest, UpdateMcpServerConfigRequest, WorkspaceStore, Workspace, CreateWorkspaceRequest, UpdateWorkspaceRequest, ProjectStore, Project, CreateProjectRequest, UpdateProjectRequest, UserStore, User, CreateUserRequest, UpdateUserRequest, TenantStore, Tenant, CreateTenantRequest, UpdateTenantRequest, UserTenantLinkStore, UserTenantLink, CreateUserTenantLinkRequest, UpdateUserTenantLinkRequest, ChannelInstallationStore, ChannelInstallation, CreateChannelInstallationRequest, UpdateChannelInstallationRequest, WorkflowTrackingStore, CreateWorkflowRunRequest, WorkflowRun, UpdateWorkflowRunRequest, CreateRunStepRequest, RunStep, UpdateRunStepRequest, StepType, EvalStore, EvalProject, CreateEvalProjectRequest, EvalSuite, CreateEvalSuiteRequest, EvalCase, CreateEvalCaseRequest, EvalRun, CreateEvalRunRequest, EvalRunResult, EvalProjectReport } from '@axiom-lattice/protocols';
4
+ export { Assistant, AssistantStore, ChannelInstallation, ChannelInstallationStore, CreateAssistantRequest, CreateChannelInstallationRequest, CreateDatabaseConfigRequest, CreateEvalCaseRequest, CreateEvalProjectRequest, CreateEvalRunRequest, CreateEvalSuiteRequest, CreateMcpServerConfigRequest, CreateMetricsServerConfigRequest, CreateProjectRequest, CreateRunStepRequest, CreateSkillRequest, CreateTenantRequest, CreateThreadRequest, CreateUserRequest, CreateUserTenantLinkRequest, CreateWorkflowRunRequest, CreateWorkspaceRequest, DatabaseConfig, DatabaseConfigEntry, DatabaseConfigStore, DatabaseType, EvalCase, EvalProject, EvalProjectReport, EvalRun, EvalRunResult, EvalStore, EvalSuite, LarkChannelInstallationConfig, McpServerConfigEntry, McpServerConfigStore, MetricsServerConfig, MetricsServerConfigEntry, MetricsServerConfigStore, Project, ProjectStore, RunStep, ScheduleExecutionType, ScheduleStorage, ScheduledTaskDefinition, ScheduledTaskStatus, Skill, SkillStore, StorageType, Tenant, TenantStatus, TenantStore, Thread, ThreadStore, UpdateChannelInstallationRequest, UpdateDatabaseConfigRequest, UpdateMcpServerConfigRequest, UpdateMetricsServerConfigRequest, UpdateProjectRequest, UpdateRunStepRequest, UpdateTenantRequest, UpdateUserRequest, UpdateUserTenantLinkRequest, UpdateWorkflowRunRequest, UpdateWorkspaceRequest, User, UserStore, UserTenantLink, UserTenantLinkStore, UserTenantRole, WorkflowRun, WorkflowTrackingStore, Workspace, WorkspaceStore } from '@axiom-lattice/protocols';
5
5
  import { IMessageQueueStore, AddMessageParams, PendingMessage, ThreadInfo } from '@axiom-lattice/core';
6
6
  export { AddMessageParams, PendingMessage, ThreadInfo } from '@axiom-lattice/core';
7
7
 
@@ -1297,4 +1297,125 @@ declare class PostgreSQLWorkflowTrackingStore implements WorkflowTrackingStore {
1297
1297
  private mapRowToRunStep;
1298
1298
  }
1299
1299
 
1300
- export { type ChannelIdentityMapping, ChannelIdentityMappingStore, type ChannelIdentityMappingStoreOptions, type CreateChannelIdentityMappingInput, type Migration, MigrationManager, PostgreSQLAssistantStore, type PostgreSQLAssistantStoreOptions, PostgreSQLChannelInstallationStore, type PostgreSQLChannelInstallationStoreOptions, PostgreSQLDatabaseConfigStore, type PostgreSQLDatabaseConfigStoreOptions, PostgreSQLMcpServerConfigStore, type PostgreSQLMcpServerConfigStoreOptions, PostgreSQLMetricsServerConfigStore, type PostgreSQLMetricsServerConfigStoreOptions, PostgreSQLProjectStore, type PostgreSQLProjectStoreOptions, PostgreSQLScheduleStorage, type PostgreSQLScheduleStorageOptions, PostgreSQLSkillStore, type PostgreSQLSkillStoreOptions, PostgreSQLTenantStore, type PostgreSQLTenantStoreOptions, PostgreSQLThreadStore, type PostgreSQLThreadStoreOptions, PostgreSQLUserStore, type PostgreSQLUserStoreOptions, PostgreSQLUserTenantLinkStore, type PostgreSQLUserTenantLinkStoreOptions, PostgreSQLWorkflowTrackingStore, type PostgreSQLWorkflowTrackingStoreOptions, PostgreSQLWorkspaceStore, type PostgreSQLWorkspaceStoreOptions, ThreadMessageQueueStore, addAssistantTenantId, addScheduleTenantId, addSkillTenantId, addThreadTenantId, changeAssistantPrimaryKey, changeSkillPrimaryKey, changeThreadPrimaryKey, createAssistantsTable, createChannelIdentityMappingTables, createChannelInstallationsTable, createDatabaseConfigsTable, createMcpServerConfigsTable, createMetricsConfigsTable, createProjectsTable, createScheduledTasksTable, createSkillsTable, createTenantsTable, createThreadMessageQueueTable, createThreadsTable, createUsersTable, createWorkflowTrackingTables, createWorkspacesTable, getThreadMessageQueueStore };
1300
+ /**
1301
+ * PostgreSQL implementation of EvalStore
1302
+ */
1303
+
1304
+ /** PostgreSQL EvalStore options */
1305
+ interface PostgreSQLEvalStoreOptions {
1306
+ /** PostgreSQL connection pool configuration */
1307
+ poolConfig: string | PoolConfig;
1308
+ /** Whether to run migrations automatically on initialization @default true */
1309
+ autoMigrate?: boolean;
1310
+ }
1311
+ /**
1312
+ * PostgreSQL implementation of EvalStore
1313
+ *
1314
+ * Features:
1315
+ * - Multi-tenant isolation via tenant_id
1316
+ * - Full CRUD for projects, suites, cases, runs, run results
1317
+ * - Project report aggregation
1318
+ */
1319
+ declare class PostgreSQLEvalStore implements EvalStore {
1320
+ private pool;
1321
+ private migrationManager;
1322
+ private initialized;
1323
+ private ownsPool;
1324
+ private initPromise;
1325
+ constructor(options: PostgreSQLEvalStoreOptions);
1326
+ /** Dispose resources and close the connection pool */
1327
+ dispose(): Promise<void>;
1328
+ /**
1329
+ * Initialize the store and run migrations
1330
+ * Uses a promise-based lock to prevent concurrent initialization
1331
+ */
1332
+ initialize(): Promise<void>;
1333
+ /** Ensure store is initialized */
1334
+ private ensureInitialized;
1335
+ private mapRowToProject;
1336
+ private mapRowToSuite;
1337
+ private mapRowToCase;
1338
+ private mapRowToRun;
1339
+ private mapRowToRunResult;
1340
+ private parseRequiredJson;
1341
+ private parseOptionalJson;
1342
+ /** Get all eval projects for a tenant */
1343
+ getProjectsByTenant(tenantId: string): Promise<EvalProject[]>;
1344
+ /** Get a single eval project by ID for a tenant */
1345
+ getProjectById(tenantId: string, id: string): Promise<EvalProject | null>;
1346
+ /** Create a new eval project */
1347
+ createProject(tenantId: string, id: string, data: CreateEvalProjectRequest): Promise<EvalProject>;
1348
+ /** Update an eval project */
1349
+ updateProject(tenantId: string, id: string, updates: Partial<CreateEvalProjectRequest>): Promise<EvalProject | null>;
1350
+ /** Delete an eval project */
1351
+ deleteProject(tenantId: string, id: string): Promise<boolean>;
1352
+ /** Get all suites in a project with case counts */
1353
+ getSuitesByProject(tenantId: string, projectId: string): Promise<EvalSuite[]>;
1354
+ /** Get a single suite by ID with case count */
1355
+ getSuiteById(tenantId: string, id: string): Promise<EvalSuite | null>;
1356
+ /** Create a new eval suite */
1357
+ createSuite(tenantId: string, projectId: string, id: string, data: CreateEvalSuiteRequest): Promise<EvalSuite>;
1358
+ /** Update a suite's name */
1359
+ updateSuite(tenantId: string, id: string, updates: Partial<CreateEvalSuiteRequest>): Promise<EvalSuite | null>;
1360
+ /** Delete a suite */
1361
+ deleteSuite(tenantId: string, id: string): Promise<boolean>;
1362
+ /** Get all test cases in a suite */
1363
+ getCasesBySuite(tenantId: string, suiteId: string): Promise<EvalCase[]>;
1364
+ /** Get a single test case by ID */
1365
+ getCaseById(tenantId: string, id: string): Promise<EvalCase | null>;
1366
+ /** Create a new test case */
1367
+ createCase(tenantId: string, suiteId: string, id: string, data: CreateEvalCaseRequest): Promise<EvalCase>;
1368
+ /** Update a test case */
1369
+ updateCase(tenantId: string, id: string, updates: Partial<CreateEvalCaseRequest>): Promise<EvalCase | null>;
1370
+ /** Delete a test case */
1371
+ deleteCase(tenantId: string, id: string): Promise<boolean>;
1372
+ /** Get all runs for a tenant, optionally filtered by project or status */
1373
+ getRunsByTenant(tenantId: string, opts?: {
1374
+ projectId?: string;
1375
+ status?: string;
1376
+ }): Promise<EvalRun[]>;
1377
+ /** Get a single run by ID */
1378
+ getRunById(tenantId: string, id: string): Promise<EvalRun | null>;
1379
+ /** Create a new eval run */
1380
+ createRun(tenantId: string, projectId: string, id: string, data: CreateEvalRunRequest): Promise<EvalRun>;
1381
+ /** Update a run's status and aggregate fields */
1382
+ updateRunStatus(tenantId: string, id: string, updates: {
1383
+ status?: EvalRun["status"];
1384
+ passedCases?: number;
1385
+ failedCases?: number;
1386
+ avgScore?: number;
1387
+ error?: string;
1388
+ completedAt?: Date;
1389
+ }): Promise<EvalRun | null>;
1390
+ /** Delete a run and its results */
1391
+ deleteRun(tenantId: string, id: string): Promise<boolean>;
1392
+ /** Get all results belonging to a run */
1393
+ getResultsByRun(tenantId: string, runId: string): Promise<EvalRunResult[]>;
1394
+ /** Create a result for a case within a run */
1395
+ createRunResult(tenantId: string, runId: string, id: string, data: Omit<EvalRunResult, "id" | "runId" | "createdAt">): Promise<EvalRunResult>;
1396
+ /** Update a run result with tenant isolation via the parent run */
1397
+ updateRunResult(tenantId: string, id: string, updates: Partial<EvalRunResult>): Promise<EvalRunResult | null>;
1398
+ /** Get a single run result by ID with tenant isolation */
1399
+ private getRunResultById;
1400
+ /** Aggregate report for a project including all runs */
1401
+ getProjectReport(tenantId: string, projectId: string): Promise<EvalProjectReport | null>;
1402
+ }
1403
+
1404
+ /**
1405
+ * Eval table migrations
1406
+ */
1407
+
1408
+ /** Create the eval projects table */
1409
+ declare const createEvalProjectsTable: Migration;
1410
+ /** Create the eval suites table */
1411
+ declare const createEvalSuitesTable: Migration;
1412
+ /** Create the eval cases table */
1413
+ declare const createEvalCasesTable: Migration;
1414
+ /** Create the eval runs table */
1415
+ declare const createEvalRunsTable: Migration;
1416
+ /** Create the eval run results table */
1417
+ declare const createEvalRunResultsTable: Migration;
1418
+ /** All eval migrations in version order */
1419
+ declare const evalMigrations: Migration[];
1420
+
1421
+ export { type ChannelIdentityMapping, ChannelIdentityMappingStore, type ChannelIdentityMappingStoreOptions, type CreateChannelIdentityMappingInput, type Migration, MigrationManager, PostgreSQLAssistantStore, type PostgreSQLAssistantStoreOptions, PostgreSQLChannelInstallationStore, type PostgreSQLChannelInstallationStoreOptions, PostgreSQLDatabaseConfigStore, type PostgreSQLDatabaseConfigStoreOptions, PostgreSQLEvalStore, type PostgreSQLEvalStoreOptions, PostgreSQLMcpServerConfigStore, type PostgreSQLMcpServerConfigStoreOptions, PostgreSQLMetricsServerConfigStore, type PostgreSQLMetricsServerConfigStoreOptions, PostgreSQLProjectStore, type PostgreSQLProjectStoreOptions, PostgreSQLScheduleStorage, type PostgreSQLScheduleStorageOptions, PostgreSQLSkillStore, type PostgreSQLSkillStoreOptions, PostgreSQLTenantStore, type PostgreSQLTenantStoreOptions, PostgreSQLThreadStore, type PostgreSQLThreadStoreOptions, PostgreSQLUserStore, type PostgreSQLUserStoreOptions, PostgreSQLUserTenantLinkStore, type PostgreSQLUserTenantLinkStoreOptions, PostgreSQLWorkflowTrackingStore, type PostgreSQLWorkflowTrackingStoreOptions, PostgreSQLWorkspaceStore, type PostgreSQLWorkspaceStoreOptions, ThreadMessageQueueStore, addAssistantTenantId, addScheduleTenantId, addSkillTenantId, addThreadTenantId, changeAssistantPrimaryKey, changeSkillPrimaryKey, changeThreadPrimaryKey, createAssistantsTable, createChannelIdentityMappingTables, createChannelInstallationsTable, createDatabaseConfigsTable, createEvalCasesTable, createEvalProjectsTable, createEvalRunResultsTable, createEvalRunsTable, createEvalSuitesTable, createMcpServerConfigsTable, createMetricsConfigsTable, createProjectsTable, createScheduledTasksTable, createSkillsTable, createTenantsTable, createThreadMessageQueueTable, createThreadsTable, createUsersTable, createWorkflowTrackingTables, createWorkspacesTable, evalMigrations, getThreadMessageQueueStore };