@axiom-lattice/pg-stores 1.0.89 → 1.0.91
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 +17 -0
- package/dist/index.d.mts +7 -2
- package/dist/index.d.ts +7 -2
- package/dist/index.js +69 -1
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +68 -1
- package/dist/index.mjs.map +1 -1
- package/package.json +6 -3
- package/src/__tests__/PostgreSQLWorkflowTrackingStore.test.ts +72 -2
- package/src/createPgStoreConfig.ts +2 -1
- package/src/migrations/workflow_tracking_migrations.ts +18 -0
- package/src/stores/PostgreSQLConnectionStore.ts +8 -0
- package/src/stores/PostgreSQLEvalStore.ts +12 -0
- package/src/stores/PostgreSQLWorkflowTrackingStore.ts +42 -2
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.91 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
|
-
[
|
|
12
|
-
[
|
|
13
|
-
[
|
|
14
|
-
[
|
|
15
|
-
[
|
|
16
|
-
[
|
|
11
|
+
[32mCJS[39m [1mdist/index.js [22m[32m264.35 KB[39m
|
|
12
|
+
[32mCJS[39m [1mdist/index.js.map [22m[32m494.59 KB[39m
|
|
13
|
+
[32mCJS[39m ⚡️ Build success in 649ms
|
|
14
|
+
[32mESM[39m [1mdist/index.mjs [22m[32m258.06 KB[39m
|
|
15
|
+
[32mESM[39m [1mdist/index.mjs.map [22m[32m494.34 KB[39m
|
|
16
|
+
[32mESM[39m ⚡️ Build success in 652ms
|
|
17
17
|
[34mDTS[39m Build start
|
|
18
|
-
[32mDTS[39m ⚡️ Build success in
|
|
19
|
-
[32mDTS[39m [1mdist/index.d.ts [22m[32m60.
|
|
20
|
-
[32mDTS[39m [1mdist/index.d.mts [22m[32m60.
|
|
18
|
+
[32mDTS[39m ⚡️ Build success in 15828ms
|
|
19
|
+
[32mDTS[39m [1mdist/index.d.ts [22m[32m60.77 KB[39m
|
|
20
|
+
[32mDTS[39m [1mdist/index.d.mts [22m[32m60.77 KB[39m
|
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,22 @@
|
|
|
1
1
|
# @axiom-lattice/pg-stores
|
|
2
2
|
|
|
3
|
+
## 1.0.91
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 2feab5c: add sse enhance
|
|
8
|
+
- Updated dependencies [2feab5c]
|
|
9
|
+
- @axiom-lattice/core@2.1.100
|
|
10
|
+
|
|
11
|
+
## 1.0.90
|
|
12
|
+
|
|
13
|
+
### Patch Changes
|
|
14
|
+
|
|
15
|
+
- 2d1c9f4: enhance core
|
|
16
|
+
- Updated dependencies [2d1c9f4]
|
|
17
|
+
- @axiom-lattice/core@2.1.99
|
|
18
|
+
- @axiom-lattice/protocols@2.1.51
|
|
19
|
+
|
|
3
20
|
## 1.0.89
|
|
4
21
|
|
|
5
22
|
### Patch Changes
|
package/dist/index.d.mts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Pool, PoolConfig, PoolClient } from 'pg';
|
|
2
2
|
export { Pool, PoolConfig } from 'pg';
|
|
3
|
-
import { ThreadStore, Thread, CreateThreadRequest, AssistantStore, Assistant, CreateAssistantRequest, DatabaseConfigStore, DatabaseConfigEntry, CreateDatabaseConfigRequest, UpdateDatabaseConfigRequest, ConnectionStore, ConnectionEntry, 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, WorkflowTrackingStore, CreateWorkflowRunRequest, WorkflowRun, UpdateWorkflowRunRequest, CreateRunStepRequest, RunStep, UpdateRunStepRequest, StepType, EvalStore, EvalProject, CreateEvalProjectRequest, EvalSuite, CreateEvalSuiteRequest, EvalCase, CreateEvalCaseRequest, EvalRun, CreateEvalRunRequest, EvalRunResult, EvalProjectReport, BindingRegistry, Binding, CreateBindingInput, ChannelInstallationStore, ChannelInstallation, ChannelInstallationType, CreateChannelInstallationRequest, UpdateChannelInstallationRequest, A2AApiKeyStore, A2AApiKeyRecord, CreateA2AApiKeyInput, A2AApiKeyEntry, ScheduleStorage, ScheduledTaskDefinition, ScheduledTaskStatus, ScheduleExecutionType, TaskStore, CreateTaskRequest, TaskItem, TaskListFilter, UpdateTaskRequest, MenuRegistry, MenuItem, CreateMenuItemInput, UpdateMenuItemInput, SharedResourceStore, ShareRecord, CollectionStore, Collection, CreateCollectionRequest, UpdateCollectionRequest, VectorStoreProvider, VectorStoreCreateParams, SkillStore, Skill, CreateSkillRequest } from '@axiom-lattice/protocols';
|
|
3
|
+
import { ThreadStore, Thread, CreateThreadRequest, AssistantStore, Assistant, CreateAssistantRequest, DatabaseConfigStore, DatabaseConfigEntry, CreateDatabaseConfigRequest, UpdateDatabaseConfigRequest, ConnectionStore, ConnectionEntry, 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, WorkflowTrackingStore, CreateWorkflowRunRequest, WorkflowRun, UpdateWorkflowRunRequest, QueryWorkflowRunsOptions, QueryWorkflowRunsResult, CreateRunStepRequest, RunStep, UpdateRunStepRequest, StepType, EvalStore, EvalProject, CreateEvalProjectRequest, EvalSuite, CreateEvalSuiteRequest, EvalCase, CreateEvalCaseRequest, EvalRun, CreateEvalRunRequest, EvalRunResult, EvalProjectReport, BindingRegistry, Binding, CreateBindingInput, ChannelInstallationStore, ChannelInstallation, ChannelInstallationType, CreateChannelInstallationRequest, UpdateChannelInstallationRequest, A2AApiKeyStore, A2AApiKeyRecord, CreateA2AApiKeyInput, A2AApiKeyEntry, ScheduleStorage, ScheduledTaskDefinition, ScheduledTaskStatus, ScheduleExecutionType, TaskStore, CreateTaskRequest, TaskItem, TaskListFilter, UpdateTaskRequest, MenuRegistry, MenuItem, CreateMenuItemInput, UpdateMenuItemInput, SharedResourceStore, ShareRecord, CollectionStore, Collection, CreateCollectionRequest, UpdateCollectionRequest, VectorStoreProvider, VectorStoreCreateParams, SkillStore, Skill, CreateSkillRequest } from '@axiom-lattice/protocols';
|
|
4
4
|
export { Assistant, AssistantStore, Binding, BindingRegistry, ChannelInstallation, ChannelInstallationStore, ConnectionEntry, ConnectionStore, CreateAssistantRequest, CreateBindingInput, CreateChannelInstallationRequest, CreateDatabaseConfigRequest, CreateEvalCaseRequest, CreateEvalProjectRequest, CreateEvalRunRequest, CreateEvalSuiteRequest, CreateMcpServerConfigRequest, CreateMenuItemInput, CreateMetricsServerConfigRequest, CreateProjectRequest, CreateRunStepRequest, CreateShareRequest, CreateSkillRequest, CreateTenantRequest, CreateThreadRequest, CreateUserRequest, CreateUserTenantLinkRequest, CreateWorkflowRunRequest, CreateWorkspaceRequest, DatabaseConfig, DatabaseConfigEntry, DatabaseConfigStore, DatabaseType, EvalCase, EvalProject, EvalProjectReport, EvalRun, EvalRunResult, EvalStore, EvalSuite, LarkChannelInstallationConfig, McpServerConfigEntry, McpServerConfigStore, MenuItem, MenuRegistry, MetricsServerConfig, MetricsServerConfigEntry, MetricsServerConfigStore, Project, ProjectStore, ResourceAddress, RunStep, ScheduleExecutionType, ScheduleStorage, ScheduledTaskDefinition, ScheduledTaskStatus, ShareRecord, ShareResult, ShareVisibility, SharedResourceStore, 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';
|
|
@@ -275,6 +275,7 @@ declare class PostgreSQLDatabaseConfigStore implements DatabaseConfigStore {
|
|
|
275
275
|
declare class PostgreSQLConnectionStore implements ConnectionStore {
|
|
276
276
|
private db;
|
|
277
277
|
constructor(db: Pool);
|
|
278
|
+
listByTenant(tenantId: string): Promise<ConnectionEntry[]>;
|
|
278
279
|
listByType(tenantId: string, type: string): Promise<ConnectionEntry[]>;
|
|
279
280
|
getByKey(tenantId: string, type: string, key: string): Promise<ConnectionEntry | null>;
|
|
280
281
|
create(entry: Omit<ConnectionEntry, "id" | "createdAt" | "updatedAt">): Promise<ConnectionEntry>;
|
|
@@ -767,6 +768,7 @@ declare class PostgreSQLWorkflowTrackingStore implements WorkflowTrackingStore {
|
|
|
767
768
|
getWorkflowRunsByThreadId(tenantId: string, threadId: string): Promise<WorkflowRun[]>;
|
|
768
769
|
getWorkflowRunsByAssistantId(tenantId: string, assistantId: string): Promise<WorkflowRun[]>;
|
|
769
770
|
getWorkflowRunsByTenantId(tenantId: string): Promise<WorkflowRun[]>;
|
|
771
|
+
queryWorkflowRuns(tenantId: string, options?: QueryWorkflowRunsOptions): Promise<QueryWorkflowRunsResult>;
|
|
770
772
|
createRunStep(request: CreateRunStepRequest): Promise<RunStep>;
|
|
771
773
|
upsertRunStep(request: CreateRunStepRequest): Promise<RunStep>;
|
|
772
774
|
updateRunStep(runId: string, stepId: string, updates: UpdateRunStepRequest): Promise<RunStep | null>;
|
|
@@ -878,6 +880,8 @@ declare class PostgreSQLEvalStore implements EvalStore {
|
|
|
878
880
|
createRunResult(tenantId: string, runId: string, id: string, data: Omit<EvalRunResult, "id" | "runId" | "createdAt">): Promise<EvalRunResult>;
|
|
879
881
|
/** Update a run result with tenant isolation via the parent run */
|
|
880
882
|
updateRunResult(tenantId: string, id: string, updates: Partial<EvalRunResult>): Promise<EvalRunResult | null>;
|
|
883
|
+
/** Delete a run result by ID */
|
|
884
|
+
deleteRunResult(tenantId: string, id: string): Promise<boolean>;
|
|
881
885
|
/** Get a single run result by ID with tenant isolation */
|
|
882
886
|
private getRunResultById;
|
|
883
887
|
/** Aggregate report for a project including all runs */
|
|
@@ -1687,6 +1691,7 @@ declare const createA2AApiKeysTable: Migration;
|
|
|
1687
1691
|
|
|
1688
1692
|
declare const createWorkflowTrackingTables: Migration;
|
|
1689
1693
|
declare const addStepThreadId: Migration;
|
|
1694
|
+
declare const addWorkflowRunsTenantStatusUpdatedIndex: Migration;
|
|
1690
1695
|
|
|
1691
1696
|
interface ChannelIdentityMappingStoreOptions {
|
|
1692
1697
|
pool?: Pool;
|
|
@@ -1792,4 +1797,4 @@ declare const addFileContentType: Migration;
|
|
|
1792
1797
|
|
|
1793
1798
|
declare const createCollectionsTable: Migration;
|
|
1794
1799
|
|
|
1795
|
-
export { ChannelBindingStore, type ChannelBindingStoreOptions, type ChannelIdentityMapping, ChannelIdentityMappingStore, type ChannelIdentityMappingStoreOptions, type CreateChannelIdentityMappingInput, MenuStore, type MenuStoreOptions, type Migration, MigrationManager, PGVectorStoreProvider, PostgreSQLA2AApiKeyStore, type PostgreSQLA2AApiKeyStoreOptions, PostgreSQLAssistantStore, type PostgreSQLAssistantStoreOptions, PostgreSQLChannelInstallationStore, type PostgreSQLChannelInstallationStoreOptions, PostgreSQLCollectionStore, type PostgreSQLCollectionStoreOptions, PostgreSQLConnectionStore, PostgreSQLDatabaseConfigStore, type PostgreSQLDatabaseConfigStoreOptions, PostgreSQLEvalStore, type PostgreSQLEvalStoreOptions, PostgreSQLMcpServerConfigStore, type PostgreSQLMcpServerConfigStoreOptions, PostgreSQLMetricsServerConfigStore, type PostgreSQLMetricsServerConfigStoreOptions, PostgreSQLProjectStore, type PostgreSQLProjectStoreOptions, PostgreSQLScheduleStorage, type PostgreSQLScheduleStorageOptions, PostgreSQLSkillStore, type PostgreSQLSkillStoreOptions, PostgreSQLTenantStore, type PostgreSQLTenantStoreOptions, type PostgreSQLThreadMessageQueueStoreOptions, PostgreSQLThreadStore, type PostgreSQLThreadStoreOptions, PostgreSQLUserStore, type PostgreSQLUserStoreOptions, PostgreSQLUserTenantLinkStore, type PostgreSQLUserTenantLinkStoreOptions, PostgreSQLWorkflowTrackingStore, type PostgreSQLWorkflowTrackingStoreOptions, PostgreSQLWorkspaceStore, type PostgreSQLWorkspaceStoreOptions, PostgresSharedResourceStore, type PostgresSharedResourceStoreOptions, ThreadMessageQueueStore, addAssistantTenantId, addFileContentType, addProjectConfigColumn, addScheduleTenantId, addSkillTenantId, addStepThreadId, addThreadTenantId, alterChannelInstallationsTable, changeAssistantPrimaryKey, changeSkillPrimaryKey, changeThreadPrimaryKey, createA2AApiKeysTable, createAssistantsTable, createChannelBindingsTable, createChannelIdentityMappingTables, createChannelInstallationsTable, createCollectionsTable, createDatabaseConfigsTable, createEvalCasesTable, createEvalProjectsTable, createEvalRunResultsTable, createEvalRunsTable, createEvalSuitesTable, createMcpServerConfigsTable, createMenuItemsTable, createMetricsConfigsTable, createPGVectorStoreProvider, createPgStoreConfig, createProjectsTable, createScheduledTasksTable, createSharedResourcesTable, createSkillsTable, createTenantsTable, createThreadMessageQueueTable, createThreadsTable, createUsersTable, createWorkflowTrackingTables, createWorkspacesTable, evalMigrations, mapRowToRunStep, mapRowToWorkflowRun, safeParse };
|
|
1800
|
+
export { ChannelBindingStore, type ChannelBindingStoreOptions, type ChannelIdentityMapping, ChannelIdentityMappingStore, type ChannelIdentityMappingStoreOptions, type CreateChannelIdentityMappingInput, MenuStore, type MenuStoreOptions, type Migration, MigrationManager, PGVectorStoreProvider, PostgreSQLA2AApiKeyStore, type PostgreSQLA2AApiKeyStoreOptions, PostgreSQLAssistantStore, type PostgreSQLAssistantStoreOptions, PostgreSQLChannelInstallationStore, type PostgreSQLChannelInstallationStoreOptions, PostgreSQLCollectionStore, type PostgreSQLCollectionStoreOptions, PostgreSQLConnectionStore, PostgreSQLDatabaseConfigStore, type PostgreSQLDatabaseConfigStoreOptions, PostgreSQLEvalStore, type PostgreSQLEvalStoreOptions, PostgreSQLMcpServerConfigStore, type PostgreSQLMcpServerConfigStoreOptions, PostgreSQLMetricsServerConfigStore, type PostgreSQLMetricsServerConfigStoreOptions, PostgreSQLProjectStore, type PostgreSQLProjectStoreOptions, PostgreSQLScheduleStorage, type PostgreSQLScheduleStorageOptions, PostgreSQLSkillStore, type PostgreSQLSkillStoreOptions, PostgreSQLTenantStore, type PostgreSQLTenantStoreOptions, type PostgreSQLThreadMessageQueueStoreOptions, PostgreSQLThreadStore, type PostgreSQLThreadStoreOptions, PostgreSQLUserStore, type PostgreSQLUserStoreOptions, PostgreSQLUserTenantLinkStore, type PostgreSQLUserTenantLinkStoreOptions, PostgreSQLWorkflowTrackingStore, type PostgreSQLWorkflowTrackingStoreOptions, PostgreSQLWorkspaceStore, type PostgreSQLWorkspaceStoreOptions, PostgresSharedResourceStore, type PostgresSharedResourceStoreOptions, ThreadMessageQueueStore, addAssistantTenantId, addFileContentType, addProjectConfigColumn, addScheduleTenantId, addSkillTenantId, addStepThreadId, addThreadTenantId, addWorkflowRunsTenantStatusUpdatedIndex, alterChannelInstallationsTable, changeAssistantPrimaryKey, changeSkillPrimaryKey, changeThreadPrimaryKey, createA2AApiKeysTable, createAssistantsTable, createChannelBindingsTable, createChannelIdentityMappingTables, createChannelInstallationsTable, createCollectionsTable, createDatabaseConfigsTable, createEvalCasesTable, createEvalProjectsTable, createEvalRunResultsTable, createEvalRunsTable, createEvalSuitesTable, createMcpServerConfigsTable, createMenuItemsTable, createMetricsConfigsTable, createPGVectorStoreProvider, createPgStoreConfig, createProjectsTable, createScheduledTasksTable, createSharedResourcesTable, createSkillsTable, createTenantsTable, createThreadMessageQueueTable, createThreadsTable, createUsersTable, createWorkflowTrackingTables, createWorkspacesTable, evalMigrations, mapRowToRunStep, mapRowToWorkflowRun, safeParse };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Pool, PoolConfig, PoolClient } from 'pg';
|
|
2
2
|
export { Pool, PoolConfig } from 'pg';
|
|
3
|
-
import { ThreadStore, Thread, CreateThreadRequest, AssistantStore, Assistant, CreateAssistantRequest, DatabaseConfigStore, DatabaseConfigEntry, CreateDatabaseConfigRequest, UpdateDatabaseConfigRequest, ConnectionStore, ConnectionEntry, 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, WorkflowTrackingStore, CreateWorkflowRunRequest, WorkflowRun, UpdateWorkflowRunRequest, CreateRunStepRequest, RunStep, UpdateRunStepRequest, StepType, EvalStore, EvalProject, CreateEvalProjectRequest, EvalSuite, CreateEvalSuiteRequest, EvalCase, CreateEvalCaseRequest, EvalRun, CreateEvalRunRequest, EvalRunResult, EvalProjectReport, BindingRegistry, Binding, CreateBindingInput, ChannelInstallationStore, ChannelInstallation, ChannelInstallationType, CreateChannelInstallationRequest, UpdateChannelInstallationRequest, A2AApiKeyStore, A2AApiKeyRecord, CreateA2AApiKeyInput, A2AApiKeyEntry, ScheduleStorage, ScheduledTaskDefinition, ScheduledTaskStatus, ScheduleExecutionType, TaskStore, CreateTaskRequest, TaskItem, TaskListFilter, UpdateTaskRequest, MenuRegistry, MenuItem, CreateMenuItemInput, UpdateMenuItemInput, SharedResourceStore, ShareRecord, CollectionStore, Collection, CreateCollectionRequest, UpdateCollectionRequest, VectorStoreProvider, VectorStoreCreateParams, SkillStore, Skill, CreateSkillRequest } from '@axiom-lattice/protocols';
|
|
3
|
+
import { ThreadStore, Thread, CreateThreadRequest, AssistantStore, Assistant, CreateAssistantRequest, DatabaseConfigStore, DatabaseConfigEntry, CreateDatabaseConfigRequest, UpdateDatabaseConfigRequest, ConnectionStore, ConnectionEntry, 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, WorkflowTrackingStore, CreateWorkflowRunRequest, WorkflowRun, UpdateWorkflowRunRequest, QueryWorkflowRunsOptions, QueryWorkflowRunsResult, CreateRunStepRequest, RunStep, UpdateRunStepRequest, StepType, EvalStore, EvalProject, CreateEvalProjectRequest, EvalSuite, CreateEvalSuiteRequest, EvalCase, CreateEvalCaseRequest, EvalRun, CreateEvalRunRequest, EvalRunResult, EvalProjectReport, BindingRegistry, Binding, CreateBindingInput, ChannelInstallationStore, ChannelInstallation, ChannelInstallationType, CreateChannelInstallationRequest, UpdateChannelInstallationRequest, A2AApiKeyStore, A2AApiKeyRecord, CreateA2AApiKeyInput, A2AApiKeyEntry, ScheduleStorage, ScheduledTaskDefinition, ScheduledTaskStatus, ScheduleExecutionType, TaskStore, CreateTaskRequest, TaskItem, TaskListFilter, UpdateTaskRequest, MenuRegistry, MenuItem, CreateMenuItemInput, UpdateMenuItemInput, SharedResourceStore, ShareRecord, CollectionStore, Collection, CreateCollectionRequest, UpdateCollectionRequest, VectorStoreProvider, VectorStoreCreateParams, SkillStore, Skill, CreateSkillRequest } from '@axiom-lattice/protocols';
|
|
4
4
|
export { Assistant, AssistantStore, Binding, BindingRegistry, ChannelInstallation, ChannelInstallationStore, ConnectionEntry, ConnectionStore, CreateAssistantRequest, CreateBindingInput, CreateChannelInstallationRequest, CreateDatabaseConfigRequest, CreateEvalCaseRequest, CreateEvalProjectRequest, CreateEvalRunRequest, CreateEvalSuiteRequest, CreateMcpServerConfigRequest, CreateMenuItemInput, CreateMetricsServerConfigRequest, CreateProjectRequest, CreateRunStepRequest, CreateShareRequest, CreateSkillRequest, CreateTenantRequest, CreateThreadRequest, CreateUserRequest, CreateUserTenantLinkRequest, CreateWorkflowRunRequest, CreateWorkspaceRequest, DatabaseConfig, DatabaseConfigEntry, DatabaseConfigStore, DatabaseType, EvalCase, EvalProject, EvalProjectReport, EvalRun, EvalRunResult, EvalStore, EvalSuite, LarkChannelInstallationConfig, McpServerConfigEntry, McpServerConfigStore, MenuItem, MenuRegistry, MetricsServerConfig, MetricsServerConfigEntry, MetricsServerConfigStore, Project, ProjectStore, ResourceAddress, RunStep, ScheduleExecutionType, ScheduleStorage, ScheduledTaskDefinition, ScheduledTaskStatus, ShareRecord, ShareResult, ShareVisibility, SharedResourceStore, 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';
|
|
@@ -275,6 +275,7 @@ declare class PostgreSQLDatabaseConfigStore implements DatabaseConfigStore {
|
|
|
275
275
|
declare class PostgreSQLConnectionStore implements ConnectionStore {
|
|
276
276
|
private db;
|
|
277
277
|
constructor(db: Pool);
|
|
278
|
+
listByTenant(tenantId: string): Promise<ConnectionEntry[]>;
|
|
278
279
|
listByType(tenantId: string, type: string): Promise<ConnectionEntry[]>;
|
|
279
280
|
getByKey(tenantId: string, type: string, key: string): Promise<ConnectionEntry | null>;
|
|
280
281
|
create(entry: Omit<ConnectionEntry, "id" | "createdAt" | "updatedAt">): Promise<ConnectionEntry>;
|
|
@@ -767,6 +768,7 @@ declare class PostgreSQLWorkflowTrackingStore implements WorkflowTrackingStore {
|
|
|
767
768
|
getWorkflowRunsByThreadId(tenantId: string, threadId: string): Promise<WorkflowRun[]>;
|
|
768
769
|
getWorkflowRunsByAssistantId(tenantId: string, assistantId: string): Promise<WorkflowRun[]>;
|
|
769
770
|
getWorkflowRunsByTenantId(tenantId: string): Promise<WorkflowRun[]>;
|
|
771
|
+
queryWorkflowRuns(tenantId: string, options?: QueryWorkflowRunsOptions): Promise<QueryWorkflowRunsResult>;
|
|
770
772
|
createRunStep(request: CreateRunStepRequest): Promise<RunStep>;
|
|
771
773
|
upsertRunStep(request: CreateRunStepRequest): Promise<RunStep>;
|
|
772
774
|
updateRunStep(runId: string, stepId: string, updates: UpdateRunStepRequest): Promise<RunStep | null>;
|
|
@@ -878,6 +880,8 @@ declare class PostgreSQLEvalStore implements EvalStore {
|
|
|
878
880
|
createRunResult(tenantId: string, runId: string, id: string, data: Omit<EvalRunResult, "id" | "runId" | "createdAt">): Promise<EvalRunResult>;
|
|
879
881
|
/** Update a run result with tenant isolation via the parent run */
|
|
880
882
|
updateRunResult(tenantId: string, id: string, updates: Partial<EvalRunResult>): Promise<EvalRunResult | null>;
|
|
883
|
+
/** Delete a run result by ID */
|
|
884
|
+
deleteRunResult(tenantId: string, id: string): Promise<boolean>;
|
|
881
885
|
/** Get a single run result by ID with tenant isolation */
|
|
882
886
|
private getRunResultById;
|
|
883
887
|
/** Aggregate report for a project including all runs */
|
|
@@ -1687,6 +1691,7 @@ declare const createA2AApiKeysTable: Migration;
|
|
|
1687
1691
|
|
|
1688
1692
|
declare const createWorkflowTrackingTables: Migration;
|
|
1689
1693
|
declare const addStepThreadId: Migration;
|
|
1694
|
+
declare const addWorkflowRunsTenantStatusUpdatedIndex: Migration;
|
|
1690
1695
|
|
|
1691
1696
|
interface ChannelIdentityMappingStoreOptions {
|
|
1692
1697
|
pool?: Pool;
|
|
@@ -1792,4 +1797,4 @@ declare const addFileContentType: Migration;
|
|
|
1792
1797
|
|
|
1793
1798
|
declare const createCollectionsTable: Migration;
|
|
1794
1799
|
|
|
1795
|
-
export { ChannelBindingStore, type ChannelBindingStoreOptions, type ChannelIdentityMapping, ChannelIdentityMappingStore, type ChannelIdentityMappingStoreOptions, type CreateChannelIdentityMappingInput, MenuStore, type MenuStoreOptions, type Migration, MigrationManager, PGVectorStoreProvider, PostgreSQLA2AApiKeyStore, type PostgreSQLA2AApiKeyStoreOptions, PostgreSQLAssistantStore, type PostgreSQLAssistantStoreOptions, PostgreSQLChannelInstallationStore, type PostgreSQLChannelInstallationStoreOptions, PostgreSQLCollectionStore, type PostgreSQLCollectionStoreOptions, PostgreSQLConnectionStore, PostgreSQLDatabaseConfigStore, type PostgreSQLDatabaseConfigStoreOptions, PostgreSQLEvalStore, type PostgreSQLEvalStoreOptions, PostgreSQLMcpServerConfigStore, type PostgreSQLMcpServerConfigStoreOptions, PostgreSQLMetricsServerConfigStore, type PostgreSQLMetricsServerConfigStoreOptions, PostgreSQLProjectStore, type PostgreSQLProjectStoreOptions, PostgreSQLScheduleStorage, type PostgreSQLScheduleStorageOptions, PostgreSQLSkillStore, type PostgreSQLSkillStoreOptions, PostgreSQLTenantStore, type PostgreSQLTenantStoreOptions, type PostgreSQLThreadMessageQueueStoreOptions, PostgreSQLThreadStore, type PostgreSQLThreadStoreOptions, PostgreSQLUserStore, type PostgreSQLUserStoreOptions, PostgreSQLUserTenantLinkStore, type PostgreSQLUserTenantLinkStoreOptions, PostgreSQLWorkflowTrackingStore, type PostgreSQLWorkflowTrackingStoreOptions, PostgreSQLWorkspaceStore, type PostgreSQLWorkspaceStoreOptions, PostgresSharedResourceStore, type PostgresSharedResourceStoreOptions, ThreadMessageQueueStore, addAssistantTenantId, addFileContentType, addProjectConfigColumn, addScheduleTenantId, addSkillTenantId, addStepThreadId, addThreadTenantId, alterChannelInstallationsTable, changeAssistantPrimaryKey, changeSkillPrimaryKey, changeThreadPrimaryKey, createA2AApiKeysTable, createAssistantsTable, createChannelBindingsTable, createChannelIdentityMappingTables, createChannelInstallationsTable, createCollectionsTable, createDatabaseConfigsTable, createEvalCasesTable, createEvalProjectsTable, createEvalRunResultsTable, createEvalRunsTable, createEvalSuitesTable, createMcpServerConfigsTable, createMenuItemsTable, createMetricsConfigsTable, createPGVectorStoreProvider, createPgStoreConfig, createProjectsTable, createScheduledTasksTable, createSharedResourcesTable, createSkillsTable, createTenantsTable, createThreadMessageQueueTable, createThreadsTable, createUsersTable, createWorkflowTrackingTables, createWorkspacesTable, evalMigrations, mapRowToRunStep, mapRowToWorkflowRun, safeParse };
|
|
1800
|
+
export { ChannelBindingStore, type ChannelBindingStoreOptions, type ChannelIdentityMapping, ChannelIdentityMappingStore, type ChannelIdentityMappingStoreOptions, type CreateChannelIdentityMappingInput, MenuStore, type MenuStoreOptions, type Migration, MigrationManager, PGVectorStoreProvider, PostgreSQLA2AApiKeyStore, type PostgreSQLA2AApiKeyStoreOptions, PostgreSQLAssistantStore, type PostgreSQLAssistantStoreOptions, PostgreSQLChannelInstallationStore, type PostgreSQLChannelInstallationStoreOptions, PostgreSQLCollectionStore, type PostgreSQLCollectionStoreOptions, PostgreSQLConnectionStore, PostgreSQLDatabaseConfigStore, type PostgreSQLDatabaseConfigStoreOptions, PostgreSQLEvalStore, type PostgreSQLEvalStoreOptions, PostgreSQLMcpServerConfigStore, type PostgreSQLMcpServerConfigStoreOptions, PostgreSQLMetricsServerConfigStore, type PostgreSQLMetricsServerConfigStoreOptions, PostgreSQLProjectStore, type PostgreSQLProjectStoreOptions, PostgreSQLScheduleStorage, type PostgreSQLScheduleStorageOptions, PostgreSQLSkillStore, type PostgreSQLSkillStoreOptions, PostgreSQLTenantStore, type PostgreSQLTenantStoreOptions, type PostgreSQLThreadMessageQueueStoreOptions, PostgreSQLThreadStore, type PostgreSQLThreadStoreOptions, PostgreSQLUserStore, type PostgreSQLUserStoreOptions, PostgreSQLUserTenantLinkStore, type PostgreSQLUserTenantLinkStoreOptions, PostgreSQLWorkflowTrackingStore, type PostgreSQLWorkflowTrackingStoreOptions, PostgreSQLWorkspaceStore, type PostgreSQLWorkspaceStoreOptions, PostgresSharedResourceStore, type PostgresSharedResourceStoreOptions, ThreadMessageQueueStore, addAssistantTenantId, addFileContentType, addProjectConfigColumn, addScheduleTenantId, addSkillTenantId, addStepThreadId, addThreadTenantId, addWorkflowRunsTenantStatusUpdatedIndex, alterChannelInstallationsTable, changeAssistantPrimaryKey, changeSkillPrimaryKey, changeThreadPrimaryKey, createA2AApiKeysTable, createAssistantsTable, createChannelBindingsTable, createChannelIdentityMappingTables, createChannelInstallationsTable, createCollectionsTable, createDatabaseConfigsTable, createEvalCasesTable, createEvalProjectsTable, createEvalRunResultsTable, createEvalRunsTable, createEvalSuitesTable, createMcpServerConfigsTable, createMenuItemsTable, createMetricsConfigsTable, createPGVectorStoreProvider, createPgStoreConfig, createProjectsTable, createScheduledTasksTable, createSharedResourcesTable, createSkillsTable, createTenantsTable, createThreadMessageQueueTable, createThreadsTable, createUsersTable, createWorkflowTrackingTables, createWorkspacesTable, evalMigrations, mapRowToRunStep, mapRowToWorkflowRun, safeParse };
|
package/dist/index.js
CHANGED
|
@@ -63,6 +63,7 @@ __export(index_exports, {
|
|
|
63
63
|
addSkillTenantId: () => addSkillTenantId,
|
|
64
64
|
addStepThreadId: () => addStepThreadId,
|
|
65
65
|
addThreadTenantId: () => addThreadTenantId,
|
|
66
|
+
addWorkflowRunsTenantStatusUpdatedIndex: () => addWorkflowRunsTenantStatusUpdatedIndex,
|
|
66
67
|
alterChannelInstallationsTable: () => alterChannelInstallationsTable,
|
|
67
68
|
changeAssistantPrimaryKey: () => changeAssistantPrimaryKey,
|
|
68
69
|
changeSkillPrimaryKey: () => changeSkillPrimaryKey,
|
|
@@ -1355,6 +1356,13 @@ var PostgreSQLConnectionStore = class {
|
|
|
1355
1356
|
constructor(db) {
|
|
1356
1357
|
this.db = db;
|
|
1357
1358
|
}
|
|
1359
|
+
async listByTenant(tenantId) {
|
|
1360
|
+
const result = await this.db.query(
|
|
1361
|
+
`SELECT * FROM ${TABLE} WHERE tenant_id = $1 ORDER BY created_at`,
|
|
1362
|
+
[tenantId]
|
|
1363
|
+
);
|
|
1364
|
+
return result.rows.map((row) => this.mapRow(row));
|
|
1365
|
+
}
|
|
1358
1366
|
async listByType(tenantId, type) {
|
|
1359
1367
|
const result = await this.db.query(
|
|
1360
1368
|
`SELECT * FROM ${TABLE} WHERE tenant_id = $1 AND type = $2 ORDER BY created_at`,
|
|
@@ -3403,6 +3411,21 @@ var addStepThreadId = {
|
|
|
3403
3411
|
`);
|
|
3404
3412
|
}
|
|
3405
3413
|
};
|
|
3414
|
+
var addWorkflowRunsTenantStatusUpdatedIndex = {
|
|
3415
|
+
name: "add_workflow_runs_tenant_status_updated_index",
|
|
3416
|
+
version: 161,
|
|
3417
|
+
up: async (client) => {
|
|
3418
|
+
await client.query(`
|
|
3419
|
+
CREATE INDEX IF NOT EXISTS idx_workflow_runs_tenant_status
|
|
3420
|
+
ON lattice_workflow_runs (tenant_id, status, updated_at DESC);
|
|
3421
|
+
`);
|
|
3422
|
+
},
|
|
3423
|
+
down: async (client) => {
|
|
3424
|
+
await client.query(`
|
|
3425
|
+
DROP INDEX IF EXISTS idx_workflow_runs_tenant_status;
|
|
3426
|
+
`);
|
|
3427
|
+
}
|
|
3428
|
+
};
|
|
3406
3429
|
|
|
3407
3430
|
// src/stores/PostgreSQLWorkflowTrackingStore.ts
|
|
3408
3431
|
var PostgreSQLWorkflowTrackingStore = class {
|
|
@@ -3426,6 +3449,7 @@ var PostgreSQLWorkflowTrackingStore = class {
|
|
|
3426
3449
|
this.migrationManager = new MigrationManager(this.pool);
|
|
3427
3450
|
this.migrationManager.register(createWorkflowTrackingTables);
|
|
3428
3451
|
this.migrationManager.register(addStepThreadId);
|
|
3452
|
+
this.migrationManager.register(addWorkflowRunsTenantStatusUpdatedIndex);
|
|
3429
3453
|
if (options.autoMigrate !== false) {
|
|
3430
3454
|
this.initialize().catch((error) => {
|
|
3431
3455
|
console.error("Failed to initialize PostgreSQLWorkflowTrackingStore:", error);
|
|
@@ -3555,6 +3579,37 @@ var PostgreSQLWorkflowTrackingStore = class {
|
|
|
3555
3579
|
);
|
|
3556
3580
|
return result.rows.map(mapRowToWorkflowRun);
|
|
3557
3581
|
}
|
|
3582
|
+
async queryWorkflowRuns(tenantId, options = {}) {
|
|
3583
|
+
await this.ensureInitialized();
|
|
3584
|
+
const conditions = ["tenant_id = $1"];
|
|
3585
|
+
const whereParams = [tenantId];
|
|
3586
|
+
if (options.status) {
|
|
3587
|
+
whereParams.push(options.status);
|
|
3588
|
+
conditions.push(`status = $${whereParams.length}`);
|
|
3589
|
+
}
|
|
3590
|
+
if (options.assistantId) {
|
|
3591
|
+
whereParams.push(options.assistantId);
|
|
3592
|
+
conditions.push(`assistant_id = $${whereParams.length}`);
|
|
3593
|
+
}
|
|
3594
|
+
const where = conditions.join(" AND ");
|
|
3595
|
+
const countResult = await this.pool.query(
|
|
3596
|
+
`SELECT COUNT(*) AS count FROM lattice_workflow_runs WHERE ${where}`,
|
|
3597
|
+
whereParams
|
|
3598
|
+
);
|
|
3599
|
+
const total = parseInt(countResult.rows[0].count, 10);
|
|
3600
|
+
const selectParams = [...whereParams];
|
|
3601
|
+
let sql = `SELECT * FROM lattice_workflow_runs WHERE ${where} ORDER BY updated_at DESC, id DESC`;
|
|
3602
|
+
if (options.limit !== void 0) {
|
|
3603
|
+
selectParams.push(options.limit);
|
|
3604
|
+
sql += ` LIMIT $${selectParams.length}`;
|
|
3605
|
+
}
|
|
3606
|
+
if (options.offset !== void 0) {
|
|
3607
|
+
selectParams.push(options.offset);
|
|
3608
|
+
sql += ` OFFSET $${selectParams.length}`;
|
|
3609
|
+
}
|
|
3610
|
+
const result = await this.pool.query(sql, selectParams);
|
|
3611
|
+
return { records: result.rows.map(mapRowToWorkflowRun), total };
|
|
3612
|
+
}
|
|
3558
3613
|
async createRunStep(request) {
|
|
3559
3614
|
await this.ensureInitialized();
|
|
3560
3615
|
const now = /* @__PURE__ */ new Date();
|
|
@@ -3714,7 +3769,7 @@ function mapRowToRunStep(row) {
|
|
|
3714
3769
|
edgeTo: row.edge_to,
|
|
3715
3770
|
edgePurpose: row.edge_purpose,
|
|
3716
3771
|
input: safeParse(row.input, void 0),
|
|
3717
|
-
output: safeParse(row.output, void 0
|
|
3772
|
+
output: typeof row.output === "string" ? safeParse(row.output, row.output) : row.output ?? void 0,
|
|
3718
3773
|
status: row.status,
|
|
3719
3774
|
errorMessage: row.error_message,
|
|
3720
3775
|
startedAt: row.started_at,
|
|
@@ -4609,6 +4664,17 @@ var PostgreSQLEvalStore = class {
|
|
|
4609
4664
|
);
|
|
4610
4665
|
return rows.length ? this.mapRowToRunResult(rows[0]) : null;
|
|
4611
4666
|
}
|
|
4667
|
+
/** Delete a run result by ID */
|
|
4668
|
+
async deleteRunResult(tenantId, id) {
|
|
4669
|
+
await this.ensureInitialized();
|
|
4670
|
+
const result = await this.pool.query(
|
|
4671
|
+
`DELETE FROM lattice_eval_run_results
|
|
4672
|
+
WHERE id = $1
|
|
4673
|
+
AND run_id IN (SELECT id FROM lattice_eval_runs WHERE tenant_id = $2)`,
|
|
4674
|
+
[id, tenantId]
|
|
4675
|
+
);
|
|
4676
|
+
return (result.rowCount ?? 0) > 0;
|
|
4677
|
+
}
|
|
4612
4678
|
/** Get a single run result by ID with tenant isolation */
|
|
4613
4679
|
async getRunResultById(tenantId, id) {
|
|
4614
4680
|
await this.ensureInitialized();
|
|
@@ -7625,6 +7691,7 @@ async function createPgStoreConfig(connectionString) {
|
|
|
7625
7691
|
mm.register(addFileContentType);
|
|
7626
7692
|
mm.register(createCollectionsTable);
|
|
7627
7693
|
mm.register(createConnectionConfigsTable);
|
|
7694
|
+
mm.register(addWorkflowRunsTenantStatusUpdatedIndex);
|
|
7628
7695
|
await mm.migrate();
|
|
7629
7696
|
const checkpoint = import_langgraph_checkpoint_postgres.PostgresSaver.fromConnString(connectionString);
|
|
7630
7697
|
checkpoint.setup().catch((err) => {
|
|
@@ -8241,6 +8308,7 @@ function mapRowToChannelIdentityMapping(row) {
|
|
|
8241
8308
|
addSkillTenantId,
|
|
8242
8309
|
addStepThreadId,
|
|
8243
8310
|
addThreadTenantId,
|
|
8311
|
+
addWorkflowRunsTenantStatusUpdatedIndex,
|
|
8244
8312
|
alterChannelInstallationsTable,
|
|
8245
8313
|
changeAssistantPrimaryKey,
|
|
8246
8314
|
changeSkillPrimaryKey,
|