@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.
- package/.turbo/turbo-build.log +10 -10
- package/CHANGELOG.md +9 -0
- package/dist/index.d.mts +124 -3
- package/dist/index.d.ts +124 -3
- package/dist/index.js +937 -2
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +930 -2
- package/dist/index.mjs.map +1 -1
- package/package.json +5 -3
- package/src/index.ts +14 -0
- package/src/migrations/eval_migrations.ts +218 -0
- package/src/stores/PostgreSQLEvalStore.ts +880 -0
package/.turbo/turbo-build.log
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
|
|
2
|
-
> @axiom-lattice/pg-stores@1.0.
|
|
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
|
[34mCLI[39m Building entry: src/index.ts
|
|
@@ -8,13 +8,13 @@
|
|
|
8
8
|
[34mCLI[39m Target: es2020
|
|
9
9
|
[34mCJS[39m Build start
|
|
10
10
|
[34mESM[39m Build start
|
|
11
|
-
[32mESM[39m [1mdist/index.mjs [22m[
|
|
12
|
-
[32mESM[39m [1mdist/index.mjs.map [22m[
|
|
13
|
-
[32mESM[39m ⚡️ Build success in
|
|
14
|
-
[32mCJS[39m [1mdist/index.js [22m[
|
|
15
|
-
[32mCJS[39m [1mdist/index.js.map [22m[
|
|
16
|
-
[32mCJS[39m ⚡️ Build success in
|
|
11
|
+
[32mESM[39m [1mdist/index.mjs [22m[32m188.71 KB[39m
|
|
12
|
+
[32mESM[39m [1mdist/index.mjs.map [22m[32m357.23 KB[39m
|
|
13
|
+
[32mESM[39m ⚡️ Build success in 461ms
|
|
14
|
+
[32mCJS[39m [1mdist/index.js [22m[32m193.53 KB[39m
|
|
15
|
+
[32mCJS[39m [1mdist/index.js.map [22m[32m357.39 KB[39m
|
|
16
|
+
[32mCJS[39m ⚡️ Build success in 518ms
|
|
17
17
|
[34mDTS[39m Build start
|
|
18
|
-
[32mDTS[39m ⚡️ Build success in
|
|
19
|
-
[32mDTS[39m [1mdist/index.d.ts [22m[
|
|
20
|
-
[32mDTS[39m [1mdist/index.d.mts [22m[
|
|
18
|
+
[32mDTS[39m ⚡️ Build success in 12296ms
|
|
19
|
+
[32mDTS[39m [1mdist/index.d.ts [22m[32m46.06 KB[39m
|
|
20
|
+
[32mDTS[39m [1mdist/index.d.mts [22m[32m46.06 KB[39m
|
package/CHANGELOG.md
CHANGED
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
|
-
|
|
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
|
-
|
|
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 };
|