@axiom-lattice/pg-stores 3.1.1 → 3.1.2
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 +195 -15
- package/dist/index.d.ts +195 -15
- package/dist/index.js +1309 -199
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +1295 -191
- package/dist/index.mjs.map +1 -1
- package/package.json +3 -3
- package/src/__tests__/ChannelBindingStore.test.ts +122 -0
- package/src/__tests__/PostgreSQLChannelInstallationStore.test.ts +16 -0
- package/src/__tests__/PostgreSQLProjectBotMembershipStore.test.ts +117 -0
- package/src/__tests__/PostgreSQLProjectMembershipStore.test.ts +235 -0
- package/src/__tests__/PostgreSQLProjectRoomMessageStore.test.ts +103 -0
- package/src/__tests__/PostgreSQLProjectRoomStore.migrations.test.ts +114 -0
- package/src/__tests__/PostgreSQLProjectRoomStore.test.ts +48 -0
- package/src/__tests__/PostgreSQLTaskStore.integration.test.ts +27 -0
- package/src/__tests__/PostgreSQLTaskStore.test.ts +57 -0
- package/src/__tests__/PostgreSQLTaskWorkItemStore.integration.test.ts +74 -0
- package/src/__tests__/PostgreSQLTaskWorkItemStore.migrations.test.ts +62 -0
- package/src/__tests__/PostgreSQLTaskWorkItemStore.test.ts +96 -0
- package/src/__tests__/ThreadMessageQueueStore.migrations.test.ts +63 -0
- package/src/__tests__/ThreadMessageQueueStore.test.ts +113 -0
- package/src/__tests__/migration-name-version-compatibility.test.ts +67 -0
- package/src/__tests__/task-files.test.ts +4 -3
- package/src/createPgStoreConfig.ts +14 -0
- package/src/index.ts +7 -0
- package/src/migrations/add_trusted_run_context_column.ts +18 -0
- package/src/migrations/migration.ts +2 -1
- package/src/migrations/project_room_migration.ts +128 -0
- package/src/migrations/task_migration.ts +15 -0
- package/src/migrations/task_work_items_migration.ts +29 -1
- package/src/stores/ChannelBindingStore.ts +99 -59
- package/src/stores/PostgreSQLChannelInstallationStore.ts +12 -30
- package/src/stores/PostgreSQLProjectBotMembershipStore.ts +199 -0
- package/src/stores/PostgreSQLProjectMembershipStore.ts +140 -0
- package/src/stores/PostgreSQLProjectRoomMessageStore.ts +177 -0
- package/src/stores/PostgreSQLProjectRoomStore.ts +57 -0
- package/src/stores/PostgreSQLTaskStore.ts +89 -3
- package/src/stores/PostgreSQLTaskWorkItemStore.ts +159 -8
- package/src/stores/ThreadMessageQueueStore.ts +38 -9
package/.turbo/turbo-build.log
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
|
|
2
|
-
> @axiom-lattice/pg-stores@3.1.
|
|
2
|
+
> @axiom-lattice/pg-stores@3.1.2 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[32m372.32 KB[39m
|
|
12
|
+
[32mESM[39m [1mdist/index.mjs.map [22m[32m692.52 KB[39m
|
|
13
|
+
[32mESM[39m ⚡️ Build success in 1081ms
|
|
14
|
+
[32mCJS[39m [1mdist/index.js [22m[32m380.26 KB[39m
|
|
15
|
+
[32mCJS[39m [1mdist/index.js.map [22m[32m692.90 KB[39m
|
|
16
|
+
[32mCJS[39m ⚡️ Build success in 1137ms
|
|
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 18304ms
|
|
19
|
+
[32mDTS[39m [1mdist/index.d.ts [22m[32m78.61 KB[39m
|
|
20
|
+
[32mDTS[39m [1mdist/index.d.mts [22m[32m78.61 KB[39m
|
package/CHANGELOG.md
CHANGED
package/dist/index.d.mts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
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, ProjectFilter, Project, CreateProjectRequest, UpdateProjectRequest, UpdateProjectCapabilityBundlesResult, 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,
|
|
4
|
-
export { AgentWebApp, AgentWebAppAppearance, AgentWebAppFeatures, AgentWebAppScope, AgentWebAppStatus, AgentWebAppStore, Assistant, AssistantStore, Binding, BindingRegistry, CapabilityBundle, CapabilityBundleStore, ChannelInstallation, ChannelInstallationStore, ConnectionEntry, ConnectionStore, CreateAgentWebAppInput, CreateAssistantRequest, CreateBindingInput, CreateCapabilityBundleInput, 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, UpdateAgentWebAppInput, UpdateCapabilityBundleInput, 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, DatabaseConfigStore, DatabaseConfigEntry, CreateDatabaseConfigRequest, UpdateDatabaseConfigRequest, ConnectionStore, ConnectionEntry, MetricsServerConfigStore, MetricsServerConfigEntry, CreateMetricsServerConfigRequest, UpdateMetricsServerConfigRequest, McpServerConfigStore, McpServerConfigEntry, CreateMcpServerConfigRequest, UpdateMcpServerConfigRequest, WorkspaceStore, Workspace, CreateWorkspaceRequest, UpdateWorkspaceRequest, ProjectStore, ProjectFilter, Project, CreateProjectRequest, UpdateProjectRequest, UpdateProjectCapabilityBundlesResult, 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, BindingMutablePatch, BindingListParams, ChannelInstallationStore, ChannelInstallation, ChannelInstallationType, CreateChannelInstallationInput, UpdateChannelInstallationRequest, A2AApiKeyStore, A2AApiKeyRecord, CreateA2AApiKeyInput, A2AApiKeyEntry, AgentWebAppStore, AgentWebApp, CreateAgentWebAppInput, AgentWebAppStorePatch, AgentWebAppUpdateOptions, ScheduleStorage, ScheduledTaskDefinition, ScheduledTaskStatus, ScheduleExecutionType, TaskStore, CreateTaskRequest, TaskItem, TaskListFilter, TaskDependentListQuery, UpdateTaskRequest, TaskMutationSnapshot, TaskWorkItemStore, CreateWorkItemRequest, TaskWorkItem, CreateWorkItemIfAbsentRequest, TaskWorkItemListFilter, ProjectLifecycleEventQuery, MenuRegistry, MenuItem, CreateMenuItemInput, UpdateMenuItemInput, SharedResourceStore, ShareRecord, CollectionStore, Collection, CreateCollectionRequest, UpdateCollectionRequest, VectorStoreProvider, VectorStoreCreateParams, CapabilityBundleStore, CapabilityBundle, InternalCreateCapabilityBundleInput, InternalUpdateCapabilityBundleInput, CapabilityBundleDeleteResult, ProjectRoomStore, ProjectRoom, ProjectMembershipStore, ProjectMembership, ProjectHumanRole, ProjectMembershipMutationResult, ProjectBotMembershipStore, ProjectBotMembership, ProjectRoomMessageStore, ProjectRoomMessage, SkillStore, Skill, CreateSkillRequest } from '@axiom-lattice/protocols';
|
|
4
|
+
export { AgentWebApp, AgentWebAppAppearance, AgentWebAppFeatures, AgentWebAppScope, AgentWebAppStatus, AgentWebAppStore, Assistant, AssistantStore, Binding, BindingRegistry, CapabilityBundle, CapabilityBundleStore, ChannelInstallation, ChannelInstallationStore, ConnectionEntry, ConnectionStore, CreateAgentWebAppInput, CreateAssistantRequest, CreateBindingInput, CreateCapabilityBundleInput, CreateChannelInstallationInput, 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, UpdateAgentWebAppInput, UpdateCapabilityBundleInput, 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, QueueScope, ThreadInfo } from '@axiom-lattice/core';
|
|
6
6
|
export { AddMessageParams, PendingMessage, ThreadInfo } from '@axiom-lattice/core';
|
|
7
7
|
import { PostgresSaver } from '@langchain/langgraph-checkpoint-postgres';
|
|
@@ -977,18 +977,18 @@ declare class ChannelBindingStore implements BindingRegistry {
|
|
|
977
977
|
channelInstallationId: string;
|
|
978
978
|
tenantId: string;
|
|
979
979
|
}): Promise<Binding | null>;
|
|
980
|
-
|
|
981
|
-
|
|
982
|
-
delete(id: string): Promise<void>;
|
|
983
|
-
list(params: {
|
|
984
|
-
channel?: string;
|
|
985
|
-
agentId?: string;
|
|
980
|
+
findById(tenantId: string, id: string): Promise<Binding | null>;
|
|
981
|
+
findBySubject(params: {
|
|
986
982
|
tenantId: string;
|
|
987
|
-
|
|
988
|
-
|
|
989
|
-
|
|
990
|
-
}): Promise<Binding
|
|
991
|
-
|
|
983
|
+
channel: string;
|
|
984
|
+
channelInstallationId: string;
|
|
985
|
+
senderId: string;
|
|
986
|
+
}): Promise<Binding | null>;
|
|
987
|
+
create(input: CreateBindingInput): Promise<Binding>;
|
|
988
|
+
update(tenantId: string, id: string, patch: BindingMutablePatch): Promise<Binding>;
|
|
989
|
+
delete(tenantId: string, id: string): Promise<void>;
|
|
990
|
+
list(params: BindingListParams): Promise<Binding[]>;
|
|
991
|
+
import(tenantId: string, bindings: CreateBindingInput[]): Promise<Binding[]>;
|
|
992
992
|
export(params: {
|
|
993
993
|
tenantId: string;
|
|
994
994
|
}): Promise<Binding[]>;
|
|
@@ -1013,7 +1013,7 @@ declare class PostgreSQLChannelInstallationStore implements ChannelInstallationS
|
|
|
1013
1013
|
getInstallationById(installationId: string): Promise<ChannelInstallation | null>;
|
|
1014
1014
|
getInstallationsByTenant(tenantId: string, channel?: ChannelInstallationType): Promise<ChannelInstallation[]>;
|
|
1015
1015
|
getAllInstallations(channel?: ChannelInstallationType): Promise<ChannelInstallation[]>;
|
|
1016
|
-
createInstallation(tenantId: string, installationId: string, data:
|
|
1016
|
+
createInstallation(tenantId: string, installationId: string, data: CreateChannelInstallationInput): Promise<ChannelInstallation>;
|
|
1017
1017
|
updateInstallation(tenantId: string, installationId: string, updates: UpdateChannelInstallationRequest): Promise<ChannelInstallation | null>;
|
|
1018
1018
|
deleteInstallation(tenantId: string, installationId: string): Promise<boolean>;
|
|
1019
1019
|
private ensureInitialized;
|
|
@@ -1222,6 +1222,8 @@ declare class PostgreSQLTaskStore implements TaskStore {
|
|
|
1222
1222
|
}): Promise<TaskItem>;
|
|
1223
1223
|
getById(tenantId: string, id: string): Promise<TaskItem | null>;
|
|
1224
1224
|
list(filter: TaskListFilter): Promise<TaskItem[]>;
|
|
1225
|
+
/** Lists exact project tasks containing a JSON string dependency. */
|
|
1226
|
+
listDependents(query: TaskDependentListQuery): Promise<TaskItem[]>;
|
|
1225
1227
|
update(tenantId: string, id: string, updates: UpdateTaskRequest): Promise<TaskItem | null>;
|
|
1226
1228
|
/**
|
|
1227
1229
|
* Atomically update a task unless its current status is blocked.
|
|
@@ -1237,17 +1239,44 @@ declare class PostgreSQLTaskStore implements TaskStore {
|
|
|
1237
1239
|
updateIfStatusIn(tenantId: string, id: string, updates: UpdateTaskRequest, expectedStatuses: TaskItem["status"][]): Promise<TaskItem | null>;
|
|
1238
1240
|
/** Atomically update a task only when status and updatedAt match a read snapshot. */
|
|
1239
1241
|
updateIfStatusAndUpdatedAt(tenantId: string, id: string, updates: UpdateTaskRequest, expectedStatuses: TaskItem["status"][], expectedUpdatedAt: Date | string): Promise<TaskItem | null>;
|
|
1242
|
+
/** Atomically update only while status, timestamp, owner, and Project scope match. */
|
|
1243
|
+
updateIfSnapshot(tenantId: string, id: string, updates: UpdateTaskRequest, snapshot: TaskMutationSnapshot): Promise<TaskItem | null>;
|
|
1240
1244
|
/** Atomically update a child only when both child and parent snapshots match. */
|
|
1241
1245
|
updateIfStatusUpdatedAtAndParentUpdatedAt(tenantId: string, id: string, updates: UpdateTaskRequest, expectedStatuses: TaskItem["status"][], expectedUpdatedAt: Date | string, parentId: string, expectedParentUpdatedAt: Date | string): Promise<TaskItem | null>;
|
|
1242
1246
|
delete(tenantId: string, id: string): Promise<boolean>;
|
|
1247
|
+
/** Atomically delete only while status, timestamp, owner, and Project scope match. */
|
|
1248
|
+
deleteIfSnapshot(tenantId: string, id: string, snapshot: TaskMutationSnapshot): Promise<boolean>;
|
|
1243
1249
|
dispose(): Promise<void>;
|
|
1244
1250
|
private ensureInitialized;
|
|
1245
1251
|
}
|
|
1246
1252
|
|
|
1253
|
+
/** PostgreSQL TaskWorkItem store connection and migration options. */
|
|
1254
|
+
interface PostgreSQLTaskWorkItemStoreOptions {
|
|
1255
|
+
/** External caller-owned pool; central migrations must already be applied. */
|
|
1256
|
+
pool?: Pool;
|
|
1257
|
+
/** Connection configuration for a standalone, store-owned pool. */
|
|
1258
|
+
poolConfig?: string | PoolConfig;
|
|
1259
|
+
/** Whether a standalone store eagerly applies migrations. Defaults to true. */
|
|
1260
|
+
autoMigrate?: boolean;
|
|
1261
|
+
}
|
|
1262
|
+
/** PostgreSQL TaskWorkItem persistence with optional standalone migrations. */
|
|
1247
1263
|
declare class PostgreSQLTaskWorkItemStore implements TaskWorkItemStore {
|
|
1248
1264
|
private pool;
|
|
1265
|
+
private migrationManager;
|
|
1266
|
+
private initialized;
|
|
1267
|
+
private ownsPool;
|
|
1268
|
+
private initPromise;
|
|
1249
1269
|
constructor(pool: Pool);
|
|
1270
|
+
constructor(options: PostgreSQLTaskWorkItemStoreOptions);
|
|
1271
|
+
/** Applies the complete standalone TaskWorkItem migration chain once. */
|
|
1272
|
+
initialize(): Promise<void>;
|
|
1273
|
+
/** Closes the pool only when this store created it from connection configuration. */
|
|
1274
|
+
dispose(): Promise<void>;
|
|
1275
|
+
private startInitialization;
|
|
1276
|
+
private ensureInitialized;
|
|
1250
1277
|
create(params: CreateWorkItemRequest): Promise<TaskWorkItem>;
|
|
1278
|
+
/** Atomically inserts a work item by selecting one exact task snapshot. */
|
|
1279
|
+
createIfTaskSnapshot(params: CreateWorkItemRequest, snapshot: TaskMutationSnapshot): Promise<TaskWorkItem | null>;
|
|
1251
1280
|
/** Find an event by its tenant- and task-scoped key without pagination. */
|
|
1252
1281
|
findByEventKey(tenantId: string, taskId: string, eventKey: string): Promise<TaskWorkItem | null>;
|
|
1253
1282
|
/** Atomically return an existing event or create it once. */
|
|
@@ -1259,6 +1288,9 @@ declare class PostgreSQLTaskWorkItemStore implements TaskWorkItemStore {
|
|
|
1259
1288
|
taskId: string;
|
|
1260
1289
|
limit: number;
|
|
1261
1290
|
}): Promise<TaskWorkItem[]>;
|
|
1291
|
+
/** Lists canonical project lifecycle events with an exclusive cursor. */
|
|
1292
|
+
listProjectLifecycleEvents(query: ProjectLifecycleEventQuery): Promise<TaskWorkItem[]>;
|
|
1293
|
+
private assertProjectLifecycleEvent;
|
|
1262
1294
|
private rowToItem;
|
|
1263
1295
|
}
|
|
1264
1296
|
|
|
@@ -1436,6 +1468,147 @@ declare class PostgreSQLCapabilityBundleStore implements CapabilityBundleStore {
|
|
|
1436
1468
|
deleteIfUnreferenced(tenantId: string, id: string): Promise<CapabilityBundleDeleteResult>;
|
|
1437
1469
|
}
|
|
1438
1470
|
|
|
1471
|
+
/** Persists tenant-isolated canonical project main rooms in PostgreSQL. */
|
|
1472
|
+
declare class PostgreSQLProjectRoomStore implements ProjectRoomStore {
|
|
1473
|
+
/** Creates a store using an externally managed pool; the pool is not migrated or closed. */
|
|
1474
|
+
constructor(options: {
|
|
1475
|
+
pool: Pool;
|
|
1476
|
+
});
|
|
1477
|
+
private readonly pool;
|
|
1478
|
+
/** Creates or returns the single persisted main room for a project. */
|
|
1479
|
+
ensureMainRoom(input: {
|
|
1480
|
+
id: string;
|
|
1481
|
+
tenantId: string;
|
|
1482
|
+
workspaceId: string;
|
|
1483
|
+
projectId: string;
|
|
1484
|
+
name: string;
|
|
1485
|
+
}): Promise<ProjectRoom>;
|
|
1486
|
+
/** Finds a tenant-scoped project's main room, or returns null. */
|
|
1487
|
+
getMainRoom(tenantId: string, projectId: string): Promise<ProjectRoom | null>;
|
|
1488
|
+
}
|
|
1489
|
+
|
|
1490
|
+
/** Indicates that a tenant/project/user membership already exists. */
|
|
1491
|
+
declare class DuplicateProjectMembershipError extends Error {
|
|
1492
|
+
constructor();
|
|
1493
|
+
}
|
|
1494
|
+
/** Indicates that a membership ID already exists in the tenant. */
|
|
1495
|
+
declare class ProjectMembershipIdConflictError extends Error {
|
|
1496
|
+
constructor();
|
|
1497
|
+
}
|
|
1498
|
+
/** Persists tenant-isolated human project memberships in PostgreSQL. */
|
|
1499
|
+
declare class PostgreSQLProjectMembershipStore implements ProjectMembershipStore {
|
|
1500
|
+
/** Creates a store using an externally managed pool; the pool is not migrated or closed. */
|
|
1501
|
+
constructor(options: {
|
|
1502
|
+
pool: Pool;
|
|
1503
|
+
});
|
|
1504
|
+
private readonly pool;
|
|
1505
|
+
/** Lists memberships in stable joined-time and ID order. */
|
|
1506
|
+
list(tenantId: string, projectId: string): Promise<ProjectMembership[]>;
|
|
1507
|
+
/** Finds a membership by exact tenant, project, and user identity. */
|
|
1508
|
+
findByUser(tenantId: string, projectId: string, userId: string): Promise<ProjectMembership | null>;
|
|
1509
|
+
/** Inserts a membership and maps database uniqueness errors to stable typed errors. */
|
|
1510
|
+
create(input: Omit<ProjectMembership, "joinedAt" | "updatedAt">): Promise<ProjectMembership>;
|
|
1511
|
+
/** Atomically creates the first active owner while serializing the project scope. */
|
|
1512
|
+
createInitialOwner(input: Omit<ProjectMembership, "role" | "status" | "joinedAt" | "updatedAt">): Promise<{
|
|
1513
|
+
kind: "created" | "existing";
|
|
1514
|
+
membership: ProjectMembership;
|
|
1515
|
+
} | {
|
|
1516
|
+
kind: "already_initialized";
|
|
1517
|
+
}>;
|
|
1518
|
+
/** Updates a role under a project lock with exact timestamp and owner safeguards. */
|
|
1519
|
+
updateRole(input: {
|
|
1520
|
+
tenantId: string;
|
|
1521
|
+
id: string;
|
|
1522
|
+
role: ProjectHumanRole;
|
|
1523
|
+
expectedUpdatedAt: Date;
|
|
1524
|
+
}): Promise<ProjectMembershipMutationResult>;
|
|
1525
|
+
/** Marks a membership removed under a project lock with exact timestamp and owner safeguards. */
|
|
1526
|
+
remove(input: {
|
|
1527
|
+
tenantId: string;
|
|
1528
|
+
id: string;
|
|
1529
|
+
expectedUpdatedAt: Date;
|
|
1530
|
+
}): Promise<ProjectMembershipMutationResult>;
|
|
1531
|
+
private mutate;
|
|
1532
|
+
}
|
|
1533
|
+
|
|
1534
|
+
type ConstraintConflict = "coordinator_conflict" | "mention_conflict";
|
|
1535
|
+
/** Indicates that a new bot membership ID already exists in the tenant. */
|
|
1536
|
+
declare class ProjectBotMembershipIdConflictError extends Error {
|
|
1537
|
+
/** Creates an accurate tenant-scoped membership ID collision error. */
|
|
1538
|
+
constructor(tenantId: string, id: string);
|
|
1539
|
+
}
|
|
1540
|
+
/** Persists tenant-isolated project bot roster memberships in PostgreSQL. */
|
|
1541
|
+
declare class PostgreSQLProjectBotMembershipStore implements ProjectBotMembershipStore {
|
|
1542
|
+
/** Creates a store using an externally managed shared pool. */
|
|
1543
|
+
constructor(options: {
|
|
1544
|
+
pool: Pool;
|
|
1545
|
+
});
|
|
1546
|
+
private readonly pool;
|
|
1547
|
+
/** Lists retained memberships in stable join order. */
|
|
1548
|
+
list(tenantId: string, projectId: string): Promise<ProjectBotMembership[]>;
|
|
1549
|
+
/** Finds a membership by tenant-scoped ID. */
|
|
1550
|
+
findById(tenantId: string, id: string): Promise<ProjectBotMembership | null>;
|
|
1551
|
+
/** Finds an assistant's durable membership in a tenant-scoped project. */
|
|
1552
|
+
findByAssistant(tenantId: string, projectId: string, assistantId: string): Promise<ProjectBotMembership | null>;
|
|
1553
|
+
/** Inserts a new membership or reactivates the assistant's durable membership atomically. */
|
|
1554
|
+
save(input: Omit<ProjectBotMembership, "joinedAt" | "updatedAt">): Promise<{
|
|
1555
|
+
kind: "created" | "updated" | "reactivated";
|
|
1556
|
+
membership: ProjectBotMembership;
|
|
1557
|
+
} | {
|
|
1558
|
+
kind: ConstraintConflict;
|
|
1559
|
+
}>;
|
|
1560
|
+
/** Applies a mutable-field patch with project serialization and millisecond-safe optimistic concurrency. */
|
|
1561
|
+
update(input: {
|
|
1562
|
+
tenantId: string;
|
|
1563
|
+
id: string;
|
|
1564
|
+
patch: Partial<Pick<ProjectBotMembership, "role" | "title" | "responsibility" | "mentionName" | "status">>;
|
|
1565
|
+
expectedUpdatedAt: Date;
|
|
1566
|
+
}): Promise<{
|
|
1567
|
+
kind: "updated";
|
|
1568
|
+
membership: ProjectBotMembership;
|
|
1569
|
+
} | {
|
|
1570
|
+
kind: "not_found" | "conflict" | ConstraintConflict;
|
|
1571
|
+
}>;
|
|
1572
|
+
}
|
|
1573
|
+
|
|
1574
|
+
/** Indicates that a tenant-scoped room message ID already exists. */
|
|
1575
|
+
declare class ProjectRoomMessageIdConflictError extends Error {
|
|
1576
|
+
/** Creates an accurate tenant-scoped message ID collision error. */
|
|
1577
|
+
constructor(tenantId: string, id: string);
|
|
1578
|
+
}
|
|
1579
|
+
/** Indicates that ordinary creation reused a room-scoped idempotency key. */
|
|
1580
|
+
declare class DuplicateProjectRoomMessageIdempotencyKeyError extends Error {
|
|
1581
|
+
/** Creates an accurate tenant and room-scoped idempotency collision error. */
|
|
1582
|
+
constructor(tenantId: string, roomId: string, idempotencyKey: string);
|
|
1583
|
+
}
|
|
1584
|
+
/** Persists tenant-isolated project room messages in PostgreSQL. */
|
|
1585
|
+
declare class PostgreSQLProjectRoomMessageStore implements ProjectRoomMessageStore {
|
|
1586
|
+
/** Creates a store using an externally managed shared pool. */
|
|
1587
|
+
constructor(options: {
|
|
1588
|
+
pool: Pool;
|
|
1589
|
+
});
|
|
1590
|
+
private readonly pool;
|
|
1591
|
+
/** Creates a room message and maps known uniqueness failures to typed errors. */
|
|
1592
|
+
create(input: Omit<ProjectRoomMessage, "createdAt">): Promise<ProjectRoomMessage>;
|
|
1593
|
+
/** Atomically creates or returns the canonical message for a room-scoped idempotency key. */
|
|
1594
|
+
createIdempotent(input: Omit<ProjectRoomMessage, "createdAt"> & {
|
|
1595
|
+
idempotencyKey: string;
|
|
1596
|
+
}): Promise<ProjectRoomMessage>;
|
|
1597
|
+
/** Lists messages newest first using an exclusive stable cursor and a clamped limit. */
|
|
1598
|
+
list(input: {
|
|
1599
|
+
tenantId: string;
|
|
1600
|
+
roomId: string;
|
|
1601
|
+
before?: {
|
|
1602
|
+
createdAt: Date;
|
|
1603
|
+
id: string;
|
|
1604
|
+
};
|
|
1605
|
+
limit: number;
|
|
1606
|
+
}): Promise<ProjectRoomMessage[]>;
|
|
1607
|
+
/** Finds a message by tenant-scoped ID. */
|
|
1608
|
+
findById(tenantId: string, id: string): Promise<ProjectRoomMessage | null>;
|
|
1609
|
+
private parameters;
|
|
1610
|
+
}
|
|
1611
|
+
|
|
1439
1612
|
declare function createPgStoreConfig(connectionString: string): Promise<{
|
|
1440
1613
|
workspace: PostgreSQLWorkspaceStore;
|
|
1441
1614
|
project: PostgreSQLProjectStore;
|
|
@@ -1462,6 +1635,10 @@ declare function createPgStoreConfig(connectionString: string): Promise<{
|
|
|
1462
1635
|
menu: MenuStore;
|
|
1463
1636
|
sharedResource: PostgresSharedResourceStore;
|
|
1464
1637
|
collection: PostgreSQLCollectionStore;
|
|
1638
|
+
projectRoom: PostgreSQLProjectRoomStore;
|
|
1639
|
+
projectMembership: PostgreSQLProjectMembershipStore;
|
|
1640
|
+
projectBotMembership: PostgreSQLProjectBotMembershipStore;
|
|
1641
|
+
projectRoomMessage: PostgreSQLProjectRoomMessageStore;
|
|
1465
1642
|
vectorStoreProvider: PGVectorStoreProvider;
|
|
1466
1643
|
checkpoint: PostgresSaver;
|
|
1467
1644
|
}>;
|
|
@@ -1947,4 +2124,7 @@ declare const addFileContentType: Migration;
|
|
|
1947
2124
|
|
|
1948
2125
|
declare const createCollectionsTable: Migration;
|
|
1949
2126
|
|
|
1950
|
-
|
|
2127
|
+
/** Creates the tenant-scoped project room, roster, and message tables. */
|
|
2128
|
+
declare const createProjectRoomTables: Migration;
|
|
2129
|
+
|
|
2130
|
+
export { ChannelBindingStore, type ChannelBindingStoreOptions, type ChannelIdentityMapping, ChannelIdentityMappingStore, type ChannelIdentityMappingStoreOptions, type CreateChannelIdentityMappingInput, DuplicateProjectMembershipError, DuplicateProjectRoomMessageIdempotencyKeyError, MenuStore, type MenuStoreOptions, type Migration, MigrationManager, PGVectorStoreProvider, PostgreSQLA2AApiKeyStore, type PostgreSQLA2AApiKeyStoreOptions, PostgreSQLAgentWebAppStore, type PostgreSQLAgentWebAppStoreOptions, PostgreSQLAssistantStore, type PostgreSQLAssistantStoreOptions, PostgreSQLCapabilityBundleStore, type PostgreSQLCapabilityBundleStoreOptions, PostgreSQLChannelInstallationStore, type PostgreSQLChannelInstallationStoreOptions, PostgreSQLCollectionStore, type PostgreSQLCollectionStoreOptions, PostgreSQLConnectionStore, PostgreSQLDatabaseConfigStore, type PostgreSQLDatabaseConfigStoreOptions, PostgreSQLEvalStore, type PostgreSQLEvalStoreOptions, PostgreSQLMcpServerConfigStore, type PostgreSQLMcpServerConfigStoreOptions, PostgreSQLMetricsServerConfigStore, type PostgreSQLMetricsServerConfigStoreOptions, PostgreSQLProjectBotMembershipStore, PostgreSQLProjectMembershipStore, PostgreSQLProjectRoomMessageStore, PostgreSQLProjectRoomStore, PostgreSQLProjectStore, type PostgreSQLProjectStoreOptions, PostgreSQLScheduleStorage, type PostgreSQLScheduleStorageOptions, PostgreSQLSkillStore, type PostgreSQLSkillStoreOptions, PostgreSQLTaskWorkItemStore, type PostgreSQLTaskWorkItemStoreOptions, PostgreSQLTenantStore, type PostgreSQLTenantStoreOptions, type PostgreSQLThreadMessageQueueStoreOptions, PostgreSQLThreadStore, type PostgreSQLThreadStoreOptions, PostgreSQLUserStore, type PostgreSQLUserStoreOptions, PostgreSQLUserTenantLinkStore, type PostgreSQLUserTenantLinkStoreOptions, PostgreSQLWorkflowTrackingStore, type PostgreSQLWorkflowTrackingStoreOptions, PostgreSQLWorkspaceStore, type PostgreSQLWorkspaceStoreOptions, PostgresSharedResourceStore, type PostgresSharedResourceStoreOptions, ProjectBotMembershipIdConflictError, ProjectMembershipIdConflictError, ProjectRoomMessageIdConflictError, ThreadMessageQueueStore, addAssistantTenantId, addEnvToEvalRuns, addFileContentType, addHoldoutToEvalRuns, addInterruptColumnsToEval, addInterruptPolicyToEvalCases, addProjectConfigColumn, addScheduleTenantId, addSkillTenantId, addStepThreadId, addTaskIdToEvalRuns, addThreadTenantId, addWorkflowRunsTenantStatusUpdatedIndex, alterChannelInstallationsTable, changeAssistantPrimaryKey, changeSkillPrimaryKey, changeThreadPrimaryKey, createA2AApiKeysTable, createAgentWebAppsTable, createAssistantsTable, createCapabilityBundlesTable, createChannelBindingsTable, createChannelIdentityMappingTables, createChannelInstallationsTable, createCollectionsTable, createDatabaseConfigsTable, createEvalCasesTable, createEvalProjectsTable, createEvalRunResultsTable, createEvalRunsTable, createEvalSuitesTable, createMcpServerConfigsTable, createMenuItemsTable, createMetricsConfigsTable, createPGVectorStoreProvider, createPgStoreConfig, createProjectRoomTables, createProjectsTable, createScheduledTasksTable, createSharedResourcesTable, createSkillsTable, createTenantsTable, createThreadMessageQueueTable, createThreadsTable, createUsersTable, createWorkflowTrackingTables, createWorkspacesTable, enforceUniqueEvalProjectName, evalMigrations, mapRowToRunStep, mapRowToWorkflowRun, safeParse };
|