@axiom-lattice/pg-stores 3.1.6 → 3.1.8
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 +20 -0
- package/dist/index.d.mts +30 -2
- package/dist/index.d.ts +30 -2
- package/dist/index.js +102 -0
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +100 -0
- package/dist/index.mjs.map +1 -1
- package/package.json +3 -3
- package/src/__tests__/PostgreSQLMcpServerConfigStore.test.ts +79 -0
- package/src/__tests__/PostgreSQLProjectRoomReadStateStore.test.ts +136 -0
- package/src/createPgStoreConfig.ts +4 -1
- package/src/index.ts +1 -0
- package/src/migrations/project_room_migration.ts +26 -0
- package/src/stores/PostgreSQLMcpServerConfigStore.ts +23 -0
- package/src/stores/PostgreSQLProjectRoomMessageStore.ts +16 -0
- package/src/stores/PostgreSQLProjectRoomReadStateStore.ts +47 -0
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.8 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
|
-
[32mCJS[39m [1mdist/index.js [22m[
|
|
12
|
-
[32mCJS[39m [1mdist/index.js.map [22m[
|
|
13
|
-
[32mCJS[39m ⚡️ Build success in
|
|
14
|
-
[32mESM[39m [1mdist/index.mjs [22m[
|
|
15
|
-
[32mESM[39m [1mdist/index.mjs.map [22m[
|
|
16
|
-
[32mESM[39m ⚡️ Build success in
|
|
11
|
+
[32mCJS[39m [1mdist/index.js [22m[32m386.24 KB[39m
|
|
12
|
+
[32mCJS[39m [1mdist/index.js.map [22m[32m703.30 KB[39m
|
|
13
|
+
[32mCJS[39m ⚡️ Build success in 1129ms
|
|
14
|
+
[32mESM[39m [1mdist/index.mjs [22m[32m378.11 KB[39m
|
|
15
|
+
[32mESM[39m [1mdist/index.mjs.map [22m[32m702.91 KB[39m
|
|
16
|
+
[32mESM[39m ⚡️ Build success in 1130ms
|
|
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 18968ms
|
|
19
|
+
[32mDTS[39m [1mdist/index.d.ts [22m[32m79.89 KB[39m
|
|
20
|
+
[32mDTS[39m [1mdist/index.d.mts [22m[32m79.89 KB[39m
|
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,25 @@
|
|
|
1
1
|
# @axiom-lattice/pg-stores
|
|
2
2
|
|
|
3
|
+
## 3.1.8
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- a2a0615: feat: MCP server connection authentication — `McpServerConfig.headers` (http/sse, encrypted at rest) plumbed through stores, gateway connections, and the config form; env-variable editor for stdio; SSE deprecation hint in the form.
|
|
8
|
+
- af3dff0: fix web app
|
|
9
|
+
- Updated dependencies [a2a0615]
|
|
10
|
+
- Updated dependencies [af3dff0]
|
|
11
|
+
- @axiom-lattice/protocols@4.2.0
|
|
12
|
+
- @axiom-lattice/core@4.2.8
|
|
13
|
+
|
|
14
|
+
## 3.1.7
|
|
15
|
+
|
|
16
|
+
### Patch Changes
|
|
17
|
+
|
|
18
|
+
- 15d2469: fix issue
|
|
19
|
+
- Updated dependencies [15d2469]
|
|
20
|
+
- @axiom-lattice/core@4.2.7
|
|
21
|
+
- @axiom-lattice/protocols@4.1.5
|
|
22
|
+
|
|
3
23
|
## 3.1.6
|
|
4
24
|
|
|
5
25
|
### 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, 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';
|
|
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, ProjectRoomReadStateStore, ProjectRoomReadState, SkillStore, Skill, CreateSkillRequest } from '@axiom-lattice/protocols';
|
|
4
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';
|
|
@@ -1606,9 +1606,34 @@ declare class PostgreSQLProjectRoomMessageStore implements ProjectRoomMessageSto
|
|
|
1606
1606
|
}): Promise<ProjectRoomMessage[]>;
|
|
1607
1607
|
/** Finds a message by tenant-scoped ID. */
|
|
1608
1608
|
findById(tenantId: string, id: string): Promise<ProjectRoomMessage | null>;
|
|
1609
|
+
/** Counts messages created strictly after a horizon, optionally excluding one human author. */
|
|
1610
|
+
countAfter(input: {
|
|
1611
|
+
tenantId: string;
|
|
1612
|
+
roomId: string;
|
|
1613
|
+
after: Date;
|
|
1614
|
+
excludeAuthorUserId?: string;
|
|
1615
|
+
}): Promise<number>;
|
|
1609
1616
|
private parameters;
|
|
1610
1617
|
}
|
|
1611
1618
|
|
|
1619
|
+
/** Persists tenant-isolated per-user project room read markers in PostgreSQL. */
|
|
1620
|
+
declare class PostgreSQLProjectRoomReadStateStore implements ProjectRoomReadStateStore {
|
|
1621
|
+
/** Creates a store using an externally managed shared pool. */
|
|
1622
|
+
constructor(options: {
|
|
1623
|
+
pool: Pool;
|
|
1624
|
+
});
|
|
1625
|
+
private readonly pool;
|
|
1626
|
+
/** Returns the user's read marker for a room, or null when never reported. */
|
|
1627
|
+
get(tenantId: string, roomId: string, userId: string): Promise<ProjectRoomReadState | null>;
|
|
1628
|
+
/** Upserts the marker monotonically using GREATEST so older reports never regress it. */
|
|
1629
|
+
markRead(input: {
|
|
1630
|
+
tenantId: string;
|
|
1631
|
+
roomId: string;
|
|
1632
|
+
userId: string;
|
|
1633
|
+
lastReadAt: Date;
|
|
1634
|
+
}): Promise<ProjectRoomReadState>;
|
|
1635
|
+
}
|
|
1636
|
+
|
|
1612
1637
|
declare function createPgStoreConfig(connectionString: string): Promise<{
|
|
1613
1638
|
workspace: PostgreSQLWorkspaceStore;
|
|
1614
1639
|
project: PostgreSQLProjectStore;
|
|
@@ -1639,6 +1664,7 @@ declare function createPgStoreConfig(connectionString: string): Promise<{
|
|
|
1639
1664
|
projectMembership: PostgreSQLProjectMembershipStore;
|
|
1640
1665
|
projectBotMembership: PostgreSQLProjectBotMembershipStore;
|
|
1641
1666
|
projectRoomMessage: PostgreSQLProjectRoomMessageStore;
|
|
1667
|
+
projectRoomReadState: PostgreSQLProjectRoomReadStateStore;
|
|
1642
1668
|
vectorStoreProvider: PGVectorStoreProvider;
|
|
1643
1669
|
checkpoint: PostgresSaver;
|
|
1644
1670
|
}>;
|
|
@@ -2126,5 +2152,7 @@ declare const createCollectionsTable: Migration;
|
|
|
2126
2152
|
|
|
2127
2153
|
/** Creates the tenant-scoped project room, roster, and message tables. */
|
|
2128
2154
|
declare const createProjectRoomTables: Migration;
|
|
2155
|
+
/** Adds per-user, per-room read markers for unread counts. */
|
|
2156
|
+
declare const createProjectRoomReadStates: Migration;
|
|
2129
2157
|
|
|
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 };
|
|
2158
|
+
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, PostgreSQLProjectRoomReadStateStore, 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, createProjectRoomReadStates, createProjectRoomTables, createProjectsTable, createScheduledTasksTable, createSharedResourcesTable, createSkillsTable, createTenantsTable, createThreadMessageQueueTable, createThreadsTable, createUsersTable, createWorkflowTrackingTables, createWorkspacesTable, enforceUniqueEvalProjectName, 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, 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';
|
|
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, ProjectRoomReadStateStore, ProjectRoomReadState, SkillStore, Skill, CreateSkillRequest } from '@axiom-lattice/protocols';
|
|
4
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';
|
|
@@ -1606,9 +1606,34 @@ declare class PostgreSQLProjectRoomMessageStore implements ProjectRoomMessageSto
|
|
|
1606
1606
|
}): Promise<ProjectRoomMessage[]>;
|
|
1607
1607
|
/** Finds a message by tenant-scoped ID. */
|
|
1608
1608
|
findById(tenantId: string, id: string): Promise<ProjectRoomMessage | null>;
|
|
1609
|
+
/** Counts messages created strictly after a horizon, optionally excluding one human author. */
|
|
1610
|
+
countAfter(input: {
|
|
1611
|
+
tenantId: string;
|
|
1612
|
+
roomId: string;
|
|
1613
|
+
after: Date;
|
|
1614
|
+
excludeAuthorUserId?: string;
|
|
1615
|
+
}): Promise<number>;
|
|
1609
1616
|
private parameters;
|
|
1610
1617
|
}
|
|
1611
1618
|
|
|
1619
|
+
/** Persists tenant-isolated per-user project room read markers in PostgreSQL. */
|
|
1620
|
+
declare class PostgreSQLProjectRoomReadStateStore implements ProjectRoomReadStateStore {
|
|
1621
|
+
/** Creates a store using an externally managed shared pool. */
|
|
1622
|
+
constructor(options: {
|
|
1623
|
+
pool: Pool;
|
|
1624
|
+
});
|
|
1625
|
+
private readonly pool;
|
|
1626
|
+
/** Returns the user's read marker for a room, or null when never reported. */
|
|
1627
|
+
get(tenantId: string, roomId: string, userId: string): Promise<ProjectRoomReadState | null>;
|
|
1628
|
+
/** Upserts the marker monotonically using GREATEST so older reports never regress it. */
|
|
1629
|
+
markRead(input: {
|
|
1630
|
+
tenantId: string;
|
|
1631
|
+
roomId: string;
|
|
1632
|
+
userId: string;
|
|
1633
|
+
lastReadAt: Date;
|
|
1634
|
+
}): Promise<ProjectRoomReadState>;
|
|
1635
|
+
}
|
|
1636
|
+
|
|
1612
1637
|
declare function createPgStoreConfig(connectionString: string): Promise<{
|
|
1613
1638
|
workspace: PostgreSQLWorkspaceStore;
|
|
1614
1639
|
project: PostgreSQLProjectStore;
|
|
@@ -1639,6 +1664,7 @@ declare function createPgStoreConfig(connectionString: string): Promise<{
|
|
|
1639
1664
|
projectMembership: PostgreSQLProjectMembershipStore;
|
|
1640
1665
|
projectBotMembership: PostgreSQLProjectBotMembershipStore;
|
|
1641
1666
|
projectRoomMessage: PostgreSQLProjectRoomMessageStore;
|
|
1667
|
+
projectRoomReadState: PostgreSQLProjectRoomReadStateStore;
|
|
1642
1668
|
vectorStoreProvider: PGVectorStoreProvider;
|
|
1643
1669
|
checkpoint: PostgresSaver;
|
|
1644
1670
|
}>;
|
|
@@ -2126,5 +2152,7 @@ declare const createCollectionsTable: Migration;
|
|
|
2126
2152
|
|
|
2127
2153
|
/** Creates the tenant-scoped project room, roster, and message tables. */
|
|
2128
2154
|
declare const createProjectRoomTables: Migration;
|
|
2155
|
+
/** Adds per-user, per-room read markers for unread counts. */
|
|
2156
|
+
declare const createProjectRoomReadStates: Migration;
|
|
2129
2157
|
|
|
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 };
|
|
2158
|
+
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, PostgreSQLProjectRoomReadStateStore, 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, createProjectRoomReadStates, createProjectRoomTables, createProjectsTable, createScheduledTasksTable, createSharedResourcesTable, createSkillsTable, createTenantsTable, createThreadMessageQueueTable, createThreadsTable, createUsersTable, createWorkflowTrackingTables, createWorkspacesTable, enforceUniqueEvalProjectName, evalMigrations, mapRowToRunStep, mapRowToWorkflowRun, safeParse };
|
package/dist/index.js
CHANGED
|
@@ -52,6 +52,7 @@ __export(index_exports, {
|
|
|
52
52
|
PostgreSQLProjectBotMembershipStore: () => PostgreSQLProjectBotMembershipStore,
|
|
53
53
|
PostgreSQLProjectMembershipStore: () => PostgreSQLProjectMembershipStore,
|
|
54
54
|
PostgreSQLProjectRoomMessageStore: () => PostgreSQLProjectRoomMessageStore,
|
|
55
|
+
PostgreSQLProjectRoomReadStateStore: () => PostgreSQLProjectRoomReadStateStore,
|
|
55
56
|
PostgreSQLProjectRoomStore: () => PostgreSQLProjectRoomStore,
|
|
56
57
|
PostgreSQLProjectStore: () => PostgreSQLProjectStore,
|
|
57
58
|
PostgreSQLScheduleStorage: () => PostgreSQLScheduleStorage,
|
|
@@ -104,6 +105,7 @@ __export(index_exports, {
|
|
|
104
105
|
createMetricsConfigsTable: () => createMetricsConfigsTable,
|
|
105
106
|
createPGVectorStoreProvider: () => createPGVectorStoreProvider,
|
|
106
107
|
createPgStoreConfig: () => createPgStoreConfig,
|
|
108
|
+
createProjectRoomReadStates: () => createProjectRoomReadStates,
|
|
107
109
|
createProjectRoomTables: () => createProjectRoomTables,
|
|
108
110
|
createProjectsTable: () => createProjectsTable,
|
|
109
111
|
createScheduledTasksTable: () => createScheduledTasksTable,
|
|
@@ -2139,6 +2141,18 @@ var PostgreSQLMcpServerConfigStore = class {
|
|
|
2139
2141
|
throw new Error("Failed to decrypt MCP server configuration");
|
|
2140
2142
|
}
|
|
2141
2143
|
}
|
|
2144
|
+
if (config.headers && row.is_env_encrypted) {
|
|
2145
|
+
try {
|
|
2146
|
+
const decryptedHeaders = {};
|
|
2147
|
+
for (const [key, value] of Object.entries(config.headers)) {
|
|
2148
|
+
decryptedHeaders[key] = (0, import_core3.decrypt)(value);
|
|
2149
|
+
}
|
|
2150
|
+
config.headers = decryptedHeaders;
|
|
2151
|
+
} catch (error) {
|
|
2152
|
+
console.error("Failed to decrypt MCP server headers:", error);
|
|
2153
|
+
throw new Error("Failed to decrypt MCP server configuration");
|
|
2154
|
+
}
|
|
2155
|
+
}
|
|
2142
2156
|
return {
|
|
2143
2157
|
id: row.id,
|
|
2144
2158
|
tenantId: row.tenant_id,
|
|
@@ -2167,6 +2181,14 @@ var PostgreSQLMcpServerConfigStore = class {
|
|
|
2167
2181
|
configCopy.env = encryptedEnv;
|
|
2168
2182
|
isEnvEncrypted = true;
|
|
2169
2183
|
}
|
|
2184
|
+
if (configCopy.headers && Object.keys(configCopy.headers).length > 0) {
|
|
2185
|
+
const encryptedHeaders = {};
|
|
2186
|
+
for (const [key, value] of Object.entries(configCopy.headers)) {
|
|
2187
|
+
encryptedHeaders[key] = (0, import_core3.encrypt)(value);
|
|
2188
|
+
}
|
|
2189
|
+
configCopy.headers = encryptedHeaders;
|
|
2190
|
+
isEnvEncrypted = true;
|
|
2191
|
+
}
|
|
2170
2192
|
return { config: configCopy, isEnvEncrypted };
|
|
2171
2193
|
}
|
|
2172
2194
|
};
|
|
@@ -9700,6 +9722,30 @@ var createProjectRoomTables = {
|
|
|
9700
9722
|
await client.query("DROP TABLE IF EXISTS lattice_project_rooms");
|
|
9701
9723
|
}
|
|
9702
9724
|
};
|
|
9725
|
+
var createProjectRoomReadStates = {
|
|
9726
|
+
version: 177,
|
|
9727
|
+
name: "create_project_room_read_states",
|
|
9728
|
+
up: async (client) => {
|
|
9729
|
+
await client.query(`
|
|
9730
|
+
CREATE TABLE IF NOT EXISTS lattice_project_room_read_states (
|
|
9731
|
+
tenant_id VARCHAR(255) NOT NULL,
|
|
9732
|
+
room_id VARCHAR(255) NOT NULL,
|
|
9733
|
+
user_id VARCHAR(255) NOT NULL,
|
|
9734
|
+
last_read_at TIMESTAMPTZ NOT NULL,
|
|
9735
|
+
updated_at TIMESTAMPTZ NOT NULL DEFAULT NOW(),
|
|
9736
|
+
PRIMARY KEY (tenant_id, room_id, user_id)
|
|
9737
|
+
)
|
|
9738
|
+
`);
|
|
9739
|
+
await client.query(`
|
|
9740
|
+
CREATE INDEX IF NOT EXISTS idx_lattice_project_room_read_states_user
|
|
9741
|
+
ON lattice_project_room_read_states (tenant_id, user_id)
|
|
9742
|
+
`);
|
|
9743
|
+
},
|
|
9744
|
+
down: async (client) => {
|
|
9745
|
+
await client.query("DROP INDEX IF EXISTS idx_lattice_project_room_read_states_user");
|
|
9746
|
+
await client.query("DROP TABLE IF EXISTS lattice_project_room_read_states");
|
|
9747
|
+
}
|
|
9748
|
+
};
|
|
9703
9749
|
|
|
9704
9750
|
// src/stores/PostgreSQLCapabilityBundleStore.ts
|
|
9705
9751
|
var import_crypto4 = require("crypto");
|
|
@@ -10487,6 +10533,19 @@ var PostgreSQLProjectRoomMessageStore = class {
|
|
|
10487
10533
|
);
|
|
10488
10534
|
return result.rows[0] ? mapRow5(result.rows[0]) : null;
|
|
10489
10535
|
}
|
|
10536
|
+
/** Counts messages created strictly after a horizon, optionally excluding one human author. */
|
|
10537
|
+
async countAfter(input) {
|
|
10538
|
+
if (!(input.after instanceof Date) || Number.isNaN(input.after.getTime())) {
|
|
10539
|
+
throw new RangeError("Project room message count horizon date is invalid");
|
|
10540
|
+
}
|
|
10541
|
+
const result = await this.pool.query(
|
|
10542
|
+
`SELECT COUNT(*)::int AS count FROM lattice_project_room_messages
|
|
10543
|
+
WHERE tenant_id = $1 AND room_id = $2 AND created_at > $3
|
|
10544
|
+
AND ($4::text IS NULL OR author->>'type' <> 'human' OR author->>'userId' <> $4)`,
|
|
10545
|
+
[input.tenantId, input.roomId, input.after, input.excludeAuthorUserId ?? null]
|
|
10546
|
+
);
|
|
10547
|
+
return result.rows[0]?.count ?? 0;
|
|
10548
|
+
}
|
|
10490
10549
|
parameters(input) {
|
|
10491
10550
|
return [
|
|
10492
10551
|
input.id,
|
|
@@ -10505,6 +10564,45 @@ var PostgreSQLProjectRoomMessageStore = class {
|
|
|
10505
10564
|
}
|
|
10506
10565
|
};
|
|
10507
10566
|
|
|
10567
|
+
// src/stores/PostgreSQLProjectRoomReadStateStore.ts
|
|
10568
|
+
function mapRow6(row) {
|
|
10569
|
+
if (typeof row.tenant_id !== "string" || typeof row.room_id !== "string" || typeof row.user_id !== "string" || !(row.last_read_at instanceof Date) || Number.isNaN(row.last_read_at.getTime()) || !(row.updated_at instanceof Date) || Number.isNaN(row.updated_at.getTime())) {
|
|
10570
|
+
throw new Error("Invalid project room read state row");
|
|
10571
|
+
}
|
|
10572
|
+
return { tenantId: row.tenant_id, roomId: row.room_id, userId: row.user_id, lastReadAt: row.last_read_at, updatedAt: row.updated_at };
|
|
10573
|
+
}
|
|
10574
|
+
var PostgreSQLProjectRoomReadStateStore = class {
|
|
10575
|
+
/** Creates a store using an externally managed shared pool. */
|
|
10576
|
+
constructor(options) {
|
|
10577
|
+
this.pool = options.pool;
|
|
10578
|
+
}
|
|
10579
|
+
/** Returns the user's read marker for a room, or null when never reported. */
|
|
10580
|
+
async get(tenantId, roomId, userId) {
|
|
10581
|
+
const result = await this.pool.query(
|
|
10582
|
+
`SELECT tenant_id, room_id, user_id, last_read_at, updated_at
|
|
10583
|
+
FROM lattice_project_room_read_states WHERE tenant_id = $1 AND room_id = $2 AND user_id = $3`,
|
|
10584
|
+
[tenantId, roomId, userId]
|
|
10585
|
+
);
|
|
10586
|
+
return result.rows[0] ? mapRow6(result.rows[0]) : null;
|
|
10587
|
+
}
|
|
10588
|
+
/** Upserts the marker monotonically using GREATEST so older reports never regress it. */
|
|
10589
|
+
async markRead(input) {
|
|
10590
|
+
if (!(input.lastReadAt instanceof Date) || Number.isNaN(input.lastReadAt.getTime())) {
|
|
10591
|
+
throw new RangeError("Project room read state lastReadAt is invalid");
|
|
10592
|
+
}
|
|
10593
|
+
const result = await this.pool.query(
|
|
10594
|
+
`INSERT INTO lattice_project_room_read_states (tenant_id, room_id, user_id, last_read_at, updated_at)
|
|
10595
|
+
VALUES ($1, $2, $3, $4, NOW())
|
|
10596
|
+
ON CONFLICT (tenant_id, room_id, user_id) DO UPDATE
|
|
10597
|
+
SET last_read_at = GREATEST(lattice_project_room_read_states.last_read_at, EXCLUDED.last_read_at),
|
|
10598
|
+
updated_at = NOW()
|
|
10599
|
+
RETURNING tenant_id, room_id, user_id, last_read_at, updated_at`,
|
|
10600
|
+
[input.tenantId, input.roomId, input.userId, input.lastReadAt]
|
|
10601
|
+
);
|
|
10602
|
+
return mapRow6(result.rows[0]);
|
|
10603
|
+
}
|
|
10604
|
+
};
|
|
10605
|
+
|
|
10508
10606
|
// src/createPgStoreConfig.ts
|
|
10509
10607
|
async function createPgStoreConfig(connectionString) {
|
|
10510
10608
|
const pool = new import_pg26.Pool({ connectionString });
|
|
@@ -10568,6 +10666,7 @@ async function createPgStoreConfig(connectionString) {
|
|
|
10568
10666
|
mm.register(addTrustedRunContextColumn);
|
|
10569
10667
|
mm.register(addProjectLifecycleEventIndex);
|
|
10570
10668
|
mm.register(addAgentWebAppsIdentity);
|
|
10669
|
+
mm.register(createProjectRoomReadStates);
|
|
10571
10670
|
await mm.migrate();
|
|
10572
10671
|
const checkpoint = import_langgraph_checkpoint_postgres.PostgresSaver.fromConnString(connectionString);
|
|
10573
10672
|
checkpoint.setup().catch((err) => {
|
|
@@ -10605,6 +10704,7 @@ async function createPgStoreConfig(connectionString) {
|
|
|
10605
10704
|
projectMembership: new PostgreSQLProjectMembershipStore(opts),
|
|
10606
10705
|
projectBotMembership: new PostgreSQLProjectBotMembershipStore(opts),
|
|
10607
10706
|
projectRoomMessage: new PostgreSQLProjectRoomMessageStore(opts),
|
|
10707
|
+
projectRoomReadState: new PostgreSQLProjectRoomReadStateStore(opts),
|
|
10608
10708
|
vectorStoreProvider: new PGVectorStoreProvider(pool, connectionString),
|
|
10609
10709
|
checkpoint
|
|
10610
10710
|
};
|
|
@@ -11181,6 +11281,7 @@ function mapRowToChannelIdentityMapping(row) {
|
|
|
11181
11281
|
PostgreSQLProjectBotMembershipStore,
|
|
11182
11282
|
PostgreSQLProjectMembershipStore,
|
|
11183
11283
|
PostgreSQLProjectRoomMessageStore,
|
|
11284
|
+
PostgreSQLProjectRoomReadStateStore,
|
|
11184
11285
|
PostgreSQLProjectRoomStore,
|
|
11185
11286
|
PostgreSQLProjectStore,
|
|
11186
11287
|
PostgreSQLScheduleStorage,
|
|
@@ -11233,6 +11334,7 @@ function mapRowToChannelIdentityMapping(row) {
|
|
|
11233
11334
|
createMetricsConfigsTable,
|
|
11234
11335
|
createPGVectorStoreProvider,
|
|
11235
11336
|
createPgStoreConfig,
|
|
11337
|
+
createProjectRoomReadStates,
|
|
11236
11338
|
createProjectRoomTables,
|
|
11237
11339
|
createProjectsTable,
|
|
11238
11340
|
createScheduledTasksTable,
|