@axiom-lattice/pg-stores 3.4.0 → 4.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,5 +1,5 @@
1
1
 
2
- > @axiom-lattice/pg-stores@3.4.0 build /home/runner/work/agentic/agentic/packages/pg-stores
2
+ > @axiom-lattice/pg-stores@4.0.0 build /home/runner/work/agentic/agentic/packages/pg-stores
3
3
  > tsup src/index.ts --format cjs,esm --dts --sourcemap
4
4
 
5
5
  CLI Building entry: src/index.ts
@@ -8,13 +8,13 @@
8
8
  CLI Target: es2020
9
9
  CJS Build start
10
10
  ESM Build start
11
- ESM dist/index.mjs 516.90 KB
12
- ESM dist/index.mjs.map 957.25 KB
13
- ESM ⚡️ Build success in 704ms
14
- CJS dist/index.js 526.27 KB
15
- CJS dist/index.js.map 957.52 KB
16
- CJS ⚡️ Build success in 709ms
11
+ CJS dist/index.js 528.09 KB
12
+ CJS dist/index.js.map 960.67 KB
13
+ CJS ⚡️ Build success in 969ms
14
+ ESM dist/index.mjs 518.65 KB
15
+ ESM dist/index.mjs.map 960.39 KB
16
+ ESM ⚡️ Build success in 1032ms
17
17
  DTS Build start
18
- DTS ⚡️ Build success in 9826ms
19
- DTS dist/index.d.ts 110.40 KB
20
- DTS dist/index.d.mts 110.40 KB
18
+ DTS ⚡️ Build success in 11614ms
19
+ DTS dist/index.d.ts 110.68 KB
20
+ DTS dist/index.d.mts 110.68 KB
package/CHANGELOG.md CHANGED
@@ -1,5 +1,43 @@
1
1
  # @axiom-lattice/pg-stores
2
2
 
3
+ ## 4.0.0
4
+
5
+ ### Major Changes
6
+
7
+ - 80c8dca: Release the chat, task, store, and sandbox updates together.
8
+
9
+ - Chat: frosted-glass user-message navigator, breathing run status bar, streaming auto-follow that stops when the reader scrolls away, and stop notices routed through the status bar.
10
+ - Crons: workspace/project-scoped crons, tenant-validated scope, Console project selector/card/filter.
11
+ - Store: long-term Store rebuilt as a toolbar + master-detail drawer with namespace editor, JSON validation, and TTL presets.
12
+ - Workspace menu: optional `requiredTenantRoles` gating; Store, Audit Log, API Keys, Observability, and System Info are owner/admin-only.
13
+ - Execution: durable runs re-pin the shared agent to the authoritative scope, absent scheduled scope stays unscoped, subagent breaker state is isolated, first run of a locally-constructed thread is admitted, and `TaskListFilter.threadId` authorizes isolated task threads.
14
+ - Recursion: default budget 500 with `AGENT_RECURSION_LIMIT` override.
15
+ - Uploads: default request body and upload limit raised to 500 MB.
16
+ - Sandbox: default memory aligned to 1024 MiB and service body limit raised to 500 MB.
17
+ - PostgreSQL: run availability defaults to the database clock, so clock drift cannot make fresh runs briefly unclaimable.
18
+
19
+ Breaking: default recursion budget (1000 -> 500), request/upload limit (100 MB -> 500 MB), sandbox memory (512/2048 -> 1024 MiB), and durable-run scope authority change observable behavior without extra configuration.
20
+
21
+ ### Minor Changes
22
+
23
+ - ae1535e: Make eval safe on the existing worker pool: a global `eval:execution` lease
24
+ allows any replica to run one eval at a time, cancellation is a durable
25
+ `cancel_requested` flag polled by the executing worker, and aborted runs settle
26
+ as `aborted`. The compatibility progress stream now polls the shared EvalStore
27
+ instead of the owner's process-local EventEmitter.
28
+
29
+ ### Patch Changes
30
+
31
+ - Updated dependencies [c5a4a88]
32
+ - Updated dependencies [ae1535e]
33
+ - Updated dependencies [e71979f]
34
+ - Updated dependencies [80c8dca]
35
+ - Updated dependencies [c650a59]
36
+ - Updated dependencies [ae1535e]
37
+ - Updated dependencies [ae1535e]
38
+ - @axiom-lattice/core@10.0.0
39
+ - @axiom-lattice/protocols@6.0.0
40
+
3
41
  ## 3.4.0
4
42
 
5
43
  ### Minor Changes
package/dist/index.d.mts CHANGED
@@ -879,6 +879,8 @@ declare class PostgreSQLEvalStore implements EvalStore {
879
879
  error?: string;
880
880
  completedAt?: Date;
881
881
  }): Promise<EvalRun | null>;
882
+ /** Request cooperative cancellation for a running evaluation. */
883
+ requestCancel(tenantId: string, id: string): Promise<boolean>;
882
884
  /** Delete a run and its results */
883
885
  deleteRun(tenantId: string, id: string): Promise<boolean>;
884
886
  /** Get all results belonging to a run */
@@ -2766,6 +2768,8 @@ declare const addInterruptPolicyToEvalCases: Migration;
2766
2768
  declare const enforceUniqueEvalProjectName: Migration;
2767
2769
  /** Add task_id to eval runs (training round association, 1 task : N runs) */
2768
2770
  declare const addTaskIdToEvalRuns: Migration;
2771
+ /** Cooperative cancellation flag for running eval runs. */
2772
+ declare const addCancelRequestedToEvalRuns: Migration;
2769
2773
  /** All eval migrations in version order */
2770
2774
  declare const evalMigrations: Migration[];
2771
2775
 
@@ -2831,4 +2835,4 @@ declare const createChannelReplyJobsTable: Migration;
2831
2835
  */
2832
2836
  declare const createStoreItemsTable: Migration;
2833
2837
 
2834
- export { ChannelBindingStore, type ChannelBindingStoreOptions, type ChannelIdentityMapping, ChannelIdentityMappingStore, type ChannelIdentityMappingStoreOptions, CheckpointBaseNotFoundError, CheckpointTargetNotEmptyError, type CreateChannelIdentityMappingInput, DuplicateProjectMembershipError, DuplicateProjectRoomMessageIdempotencyKeyError, MenuStore, type MenuStoreOptions, type Migration, MigrationManager, PGVectorStoreProvider, PostgreSQLA2AApiKeyStore, type PostgreSQLA2AApiKeyStoreOptions, PostgreSQLAgentRunLedger, type PostgreSQLAgentRunLedgerOptions, PostgreSQLAgentWebAppStore, type PostgreSQLAgentWebAppStoreOptions, PostgreSQLAssistantStore, type PostgreSQLAssistantStoreOptions, PostgreSQLCapabilityBundleStore, type PostgreSQLCapabilityBundleStoreOptions, PostgreSQLChannelInstallationStore, type PostgreSQLChannelInstallationStoreOptions, PostgreSQLChannelReplyJobStore, type PostgreSQLChannelReplyJobStoreOptions, PostgreSQLCheckpointStorage, PostgreSQLCollectionStore, type PostgreSQLCollectionStoreOptions, PostgreSQLConnectionStore, PostgreSQLDatabaseConfigStore, type PostgreSQLDatabaseConfigStoreOptions, PostgreSQLEvalStore, type PostgreSQLEvalStoreOptions, PostgreSQLMcpServerConfigStore, type PostgreSQLMcpServerConfigStoreOptions, PostgreSQLMetricsServerConfigStore, type PostgreSQLMetricsServerConfigStoreOptions, PostgreSQLModelProviderStore, type PostgreSQLModelProviderStoreOptions, PostgreSQLOpenAuditStore, type PostgreSQLOpenAuditStoreOptions, PostgreSQLPluginDeploymentStore, PostgreSQLProjectBotMembershipStore, PostgreSQLProjectMembershipStore, PostgreSQLProjectRoomMessageStore, PostgreSQLProjectRoomReadStateStore, PostgreSQLProjectRoomStore, PostgreSQLProjectStore, type PostgreSQLProjectStoreOptions, PostgreSQLScheduleStorage, type PostgreSQLScheduleStorageOptions, PostgreSQLSkillStore, type PostgreSQLSkillStoreOptions, PostgreSQLStore, 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, addMcpAppContentType, addProjectConfigColumn, addScheduleTenantId, addSkillTenantId, addStepThreadId, addTaskIdToEvalRuns, addThreadExpiresAt, addThreadTenantId, addWorkflowRunsTenantStatusUpdatedIndex, alterChannelInstallationsTable, changeAssistantPrimaryKey, changeSkillPrimaryKey, changeThreadPrimaryKey, createA2AApiKeysTable, createAgentRunLedgerTable, createAgentWebAppsTable, createAssistantsTable, createCapabilityBundlesTable, createChannelBindingsTable, createChannelIdentityMappingTables, createChannelInstallationsTable, createChannelReplyJobsTable, createCollectionsTable, createDatabaseConfigsTable, createEvalCasesTable, createEvalProjectsTable, createEvalRunResultsTable, createEvalRunsTable, createEvalSuitesTable, createMcpServerConfigsTable, createMenuItemsTable, createMetricsConfigsTable, createPGVectorStoreProvider, createPgStoreConfig, createPluginDeployments, createProjectRoomReadStates, createProjectRoomTables, createProjectsTable, createScheduledTasksTable, createSharedResourcesTable, createSkillsTable, createStoreItemsTable, createTenantsTable, createThreadMessageQueueTable, createThreadsTable, createUsersTable, createWorkflowTrackingTables, createWorkspacesTable, dropPluginDeploymentAuthToken, enforceUniqueEvalProjectName, evalMigrations, mapRowToRunStep, mapRowToWorkflowRun, safeParse };
2838
+ export { ChannelBindingStore, type ChannelBindingStoreOptions, type ChannelIdentityMapping, ChannelIdentityMappingStore, type ChannelIdentityMappingStoreOptions, CheckpointBaseNotFoundError, CheckpointTargetNotEmptyError, type CreateChannelIdentityMappingInput, DuplicateProjectMembershipError, DuplicateProjectRoomMessageIdempotencyKeyError, MenuStore, type MenuStoreOptions, type Migration, MigrationManager, PGVectorStoreProvider, PostgreSQLA2AApiKeyStore, type PostgreSQLA2AApiKeyStoreOptions, PostgreSQLAgentRunLedger, type PostgreSQLAgentRunLedgerOptions, PostgreSQLAgentWebAppStore, type PostgreSQLAgentWebAppStoreOptions, PostgreSQLAssistantStore, type PostgreSQLAssistantStoreOptions, PostgreSQLCapabilityBundleStore, type PostgreSQLCapabilityBundleStoreOptions, PostgreSQLChannelInstallationStore, type PostgreSQLChannelInstallationStoreOptions, PostgreSQLChannelReplyJobStore, type PostgreSQLChannelReplyJobStoreOptions, PostgreSQLCheckpointStorage, PostgreSQLCollectionStore, type PostgreSQLCollectionStoreOptions, PostgreSQLConnectionStore, PostgreSQLDatabaseConfigStore, type PostgreSQLDatabaseConfigStoreOptions, PostgreSQLEvalStore, type PostgreSQLEvalStoreOptions, PostgreSQLMcpServerConfigStore, type PostgreSQLMcpServerConfigStoreOptions, PostgreSQLMetricsServerConfigStore, type PostgreSQLMetricsServerConfigStoreOptions, PostgreSQLModelProviderStore, type PostgreSQLModelProviderStoreOptions, PostgreSQLOpenAuditStore, type PostgreSQLOpenAuditStoreOptions, PostgreSQLPluginDeploymentStore, PostgreSQLProjectBotMembershipStore, PostgreSQLProjectMembershipStore, PostgreSQLProjectRoomMessageStore, PostgreSQLProjectRoomReadStateStore, PostgreSQLProjectRoomStore, PostgreSQLProjectStore, type PostgreSQLProjectStoreOptions, PostgreSQLScheduleStorage, type PostgreSQLScheduleStorageOptions, PostgreSQLSkillStore, type PostgreSQLSkillStoreOptions, PostgreSQLStore, 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, addCancelRequestedToEvalRuns, addEnvToEvalRuns, addFileContentType, addHoldoutToEvalRuns, addInterruptColumnsToEval, addInterruptPolicyToEvalCases, addMcpAppContentType, addProjectConfigColumn, addScheduleTenantId, addSkillTenantId, addStepThreadId, addTaskIdToEvalRuns, addThreadExpiresAt, addThreadTenantId, addWorkflowRunsTenantStatusUpdatedIndex, alterChannelInstallationsTable, changeAssistantPrimaryKey, changeSkillPrimaryKey, changeThreadPrimaryKey, createA2AApiKeysTable, createAgentRunLedgerTable, createAgentWebAppsTable, createAssistantsTable, createCapabilityBundlesTable, createChannelBindingsTable, createChannelIdentityMappingTables, createChannelInstallationsTable, createChannelReplyJobsTable, createCollectionsTable, createDatabaseConfigsTable, createEvalCasesTable, createEvalProjectsTable, createEvalRunResultsTable, createEvalRunsTable, createEvalSuitesTable, createMcpServerConfigsTable, createMenuItemsTable, createMetricsConfigsTable, createPGVectorStoreProvider, createPgStoreConfig, createPluginDeployments, createProjectRoomReadStates, createProjectRoomTables, createProjectsTable, createScheduledTasksTable, createSharedResourcesTable, createSkillsTable, createStoreItemsTable, createTenantsTable, createThreadMessageQueueTable, createThreadsTable, createUsersTable, createWorkflowTrackingTables, createWorkspacesTable, dropPluginDeploymentAuthToken, enforceUniqueEvalProjectName, evalMigrations, mapRowToRunStep, mapRowToWorkflowRun, safeParse };
package/dist/index.d.ts CHANGED
@@ -879,6 +879,8 @@ declare class PostgreSQLEvalStore implements EvalStore {
879
879
  error?: string;
880
880
  completedAt?: Date;
881
881
  }): Promise<EvalRun | null>;
882
+ /** Request cooperative cancellation for a running evaluation. */
883
+ requestCancel(tenantId: string, id: string): Promise<boolean>;
882
884
  /** Delete a run and its results */
883
885
  deleteRun(tenantId: string, id: string): Promise<boolean>;
884
886
  /** Get all results belonging to a run */
@@ -2766,6 +2768,8 @@ declare const addInterruptPolicyToEvalCases: Migration;
2766
2768
  declare const enforceUniqueEvalProjectName: Migration;
2767
2769
  /** Add task_id to eval runs (training round association, 1 task : N runs) */
2768
2770
  declare const addTaskIdToEvalRuns: Migration;
2771
+ /** Cooperative cancellation flag for running eval runs. */
2772
+ declare const addCancelRequestedToEvalRuns: Migration;
2769
2773
  /** All eval migrations in version order */
2770
2774
  declare const evalMigrations: Migration[];
2771
2775
 
@@ -2831,4 +2835,4 @@ declare const createChannelReplyJobsTable: Migration;
2831
2835
  */
2832
2836
  declare const createStoreItemsTable: Migration;
2833
2837
 
2834
- export { ChannelBindingStore, type ChannelBindingStoreOptions, type ChannelIdentityMapping, ChannelIdentityMappingStore, type ChannelIdentityMappingStoreOptions, CheckpointBaseNotFoundError, CheckpointTargetNotEmptyError, type CreateChannelIdentityMappingInput, DuplicateProjectMembershipError, DuplicateProjectRoomMessageIdempotencyKeyError, MenuStore, type MenuStoreOptions, type Migration, MigrationManager, PGVectorStoreProvider, PostgreSQLA2AApiKeyStore, type PostgreSQLA2AApiKeyStoreOptions, PostgreSQLAgentRunLedger, type PostgreSQLAgentRunLedgerOptions, PostgreSQLAgentWebAppStore, type PostgreSQLAgentWebAppStoreOptions, PostgreSQLAssistantStore, type PostgreSQLAssistantStoreOptions, PostgreSQLCapabilityBundleStore, type PostgreSQLCapabilityBundleStoreOptions, PostgreSQLChannelInstallationStore, type PostgreSQLChannelInstallationStoreOptions, PostgreSQLChannelReplyJobStore, type PostgreSQLChannelReplyJobStoreOptions, PostgreSQLCheckpointStorage, PostgreSQLCollectionStore, type PostgreSQLCollectionStoreOptions, PostgreSQLConnectionStore, PostgreSQLDatabaseConfigStore, type PostgreSQLDatabaseConfigStoreOptions, PostgreSQLEvalStore, type PostgreSQLEvalStoreOptions, PostgreSQLMcpServerConfigStore, type PostgreSQLMcpServerConfigStoreOptions, PostgreSQLMetricsServerConfigStore, type PostgreSQLMetricsServerConfigStoreOptions, PostgreSQLModelProviderStore, type PostgreSQLModelProviderStoreOptions, PostgreSQLOpenAuditStore, type PostgreSQLOpenAuditStoreOptions, PostgreSQLPluginDeploymentStore, PostgreSQLProjectBotMembershipStore, PostgreSQLProjectMembershipStore, PostgreSQLProjectRoomMessageStore, PostgreSQLProjectRoomReadStateStore, PostgreSQLProjectRoomStore, PostgreSQLProjectStore, type PostgreSQLProjectStoreOptions, PostgreSQLScheduleStorage, type PostgreSQLScheduleStorageOptions, PostgreSQLSkillStore, type PostgreSQLSkillStoreOptions, PostgreSQLStore, 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, addMcpAppContentType, addProjectConfigColumn, addScheduleTenantId, addSkillTenantId, addStepThreadId, addTaskIdToEvalRuns, addThreadExpiresAt, addThreadTenantId, addWorkflowRunsTenantStatusUpdatedIndex, alterChannelInstallationsTable, changeAssistantPrimaryKey, changeSkillPrimaryKey, changeThreadPrimaryKey, createA2AApiKeysTable, createAgentRunLedgerTable, createAgentWebAppsTable, createAssistantsTable, createCapabilityBundlesTable, createChannelBindingsTable, createChannelIdentityMappingTables, createChannelInstallationsTable, createChannelReplyJobsTable, createCollectionsTable, createDatabaseConfigsTable, createEvalCasesTable, createEvalProjectsTable, createEvalRunResultsTable, createEvalRunsTable, createEvalSuitesTable, createMcpServerConfigsTable, createMenuItemsTable, createMetricsConfigsTable, createPGVectorStoreProvider, createPgStoreConfig, createPluginDeployments, createProjectRoomReadStates, createProjectRoomTables, createProjectsTable, createScheduledTasksTable, createSharedResourcesTable, createSkillsTable, createStoreItemsTable, createTenantsTable, createThreadMessageQueueTable, createThreadsTable, createUsersTable, createWorkflowTrackingTables, createWorkspacesTable, dropPluginDeploymentAuthToken, enforceUniqueEvalProjectName, evalMigrations, mapRowToRunStep, mapRowToWorkflowRun, safeParse };
2838
+ export { ChannelBindingStore, type ChannelBindingStoreOptions, type ChannelIdentityMapping, ChannelIdentityMappingStore, type ChannelIdentityMappingStoreOptions, CheckpointBaseNotFoundError, CheckpointTargetNotEmptyError, type CreateChannelIdentityMappingInput, DuplicateProjectMembershipError, DuplicateProjectRoomMessageIdempotencyKeyError, MenuStore, type MenuStoreOptions, type Migration, MigrationManager, PGVectorStoreProvider, PostgreSQLA2AApiKeyStore, type PostgreSQLA2AApiKeyStoreOptions, PostgreSQLAgentRunLedger, type PostgreSQLAgentRunLedgerOptions, PostgreSQLAgentWebAppStore, type PostgreSQLAgentWebAppStoreOptions, PostgreSQLAssistantStore, type PostgreSQLAssistantStoreOptions, PostgreSQLCapabilityBundleStore, type PostgreSQLCapabilityBundleStoreOptions, PostgreSQLChannelInstallationStore, type PostgreSQLChannelInstallationStoreOptions, PostgreSQLChannelReplyJobStore, type PostgreSQLChannelReplyJobStoreOptions, PostgreSQLCheckpointStorage, PostgreSQLCollectionStore, type PostgreSQLCollectionStoreOptions, PostgreSQLConnectionStore, PostgreSQLDatabaseConfigStore, type PostgreSQLDatabaseConfigStoreOptions, PostgreSQLEvalStore, type PostgreSQLEvalStoreOptions, PostgreSQLMcpServerConfigStore, type PostgreSQLMcpServerConfigStoreOptions, PostgreSQLMetricsServerConfigStore, type PostgreSQLMetricsServerConfigStoreOptions, PostgreSQLModelProviderStore, type PostgreSQLModelProviderStoreOptions, PostgreSQLOpenAuditStore, type PostgreSQLOpenAuditStoreOptions, PostgreSQLPluginDeploymentStore, PostgreSQLProjectBotMembershipStore, PostgreSQLProjectMembershipStore, PostgreSQLProjectRoomMessageStore, PostgreSQLProjectRoomReadStateStore, PostgreSQLProjectRoomStore, PostgreSQLProjectStore, type PostgreSQLProjectStoreOptions, PostgreSQLScheduleStorage, type PostgreSQLScheduleStorageOptions, PostgreSQLSkillStore, type PostgreSQLSkillStoreOptions, PostgreSQLStore, 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, addCancelRequestedToEvalRuns, addEnvToEvalRuns, addFileContentType, addHoldoutToEvalRuns, addInterruptColumnsToEval, addInterruptPolicyToEvalCases, addMcpAppContentType, addProjectConfigColumn, addScheduleTenantId, addSkillTenantId, addStepThreadId, addTaskIdToEvalRuns, addThreadExpiresAt, addThreadTenantId, addWorkflowRunsTenantStatusUpdatedIndex, alterChannelInstallationsTable, changeAssistantPrimaryKey, changeSkillPrimaryKey, changeThreadPrimaryKey, createA2AApiKeysTable, createAgentRunLedgerTable, createAgentWebAppsTable, createAssistantsTable, createCapabilityBundlesTable, createChannelBindingsTable, createChannelIdentityMappingTables, createChannelInstallationsTable, createChannelReplyJobsTable, createCollectionsTable, createDatabaseConfigsTable, createEvalCasesTable, createEvalProjectsTable, createEvalRunResultsTable, createEvalRunsTable, createEvalSuitesTable, createMcpServerConfigsTable, createMenuItemsTable, createMetricsConfigsTable, createPGVectorStoreProvider, createPgStoreConfig, createPluginDeployments, createProjectRoomReadStates, createProjectRoomTables, createProjectsTable, createScheduledTasksTable, createSharedResourcesTable, createSkillsTable, createStoreItemsTable, createTenantsTable, createThreadMessageQueueTable, createThreadsTable, createUsersTable, createWorkflowTrackingTables, createWorkspacesTable, dropPluginDeploymentAuthToken, enforceUniqueEvalProjectName, evalMigrations, mapRowToRunStep, mapRowToWorkflowRun, safeParse };
package/dist/index.js CHANGED
@@ -79,6 +79,7 @@ __export(index_exports, {
79
79
  ProjectRoomMessageIdConflictError: () => ProjectRoomMessageIdConflictError,
80
80
  ThreadMessageQueueStore: () => ThreadMessageQueueStore,
81
81
  addAssistantTenantId: () => addAssistantTenantId,
82
+ addCancelRequestedToEvalRuns: () => addCancelRequestedToEvalRuns,
82
83
  addEnvToEvalRuns: () => addEnvToEvalRuns,
83
84
  addFileContentType: () => addFileContentType,
84
85
  addHoldoutToEvalRuns: () => addHoldoutToEvalRuns,
@@ -4430,6 +4431,21 @@ var addTaskIdToEvalRuns = {
4430
4431
  `);
4431
4432
  }
4432
4433
  };
4434
+ var addCancelRequestedToEvalRuns = {
4435
+ version: 205,
4436
+ name: "add_cancel_requested_to_eval_runs",
4437
+ up: async (client) => {
4438
+ await client.query(`
4439
+ ALTER TABLE lattice_eval_runs
4440
+ ADD COLUMN IF NOT EXISTS cancel_requested BOOLEAN NOT NULL DEFAULT FALSE
4441
+ `);
4442
+ },
4443
+ down: async (client) => {
4444
+ await client.query(`
4445
+ ALTER TABLE lattice_eval_runs DROP COLUMN IF EXISTS cancel_requested
4446
+ `);
4447
+ }
4448
+ };
4433
4449
  var evalMigrations = [
4434
4450
  createEvalProjectsTable,
4435
4451
  createEvalSuitesTable,
@@ -4441,7 +4457,8 @@ var evalMigrations = [
4441
4457
  addInterruptColumnsToEval,
4442
4458
  addInterruptPolicyToEvalCases,
4443
4459
  enforceUniqueEvalProjectName,
4444
- addTaskIdToEvalRuns
4460
+ addTaskIdToEvalRuns,
4461
+ addCancelRequestedToEvalRuns
4445
4462
  ];
4446
4463
 
4447
4464
  // src/stores/PostgreSQLEvalStore.ts
@@ -4566,6 +4583,7 @@ var PostgreSQLEvalStore = class {
4566
4583
  interruptedCases: row.interrupted_cases ?? 0,
4567
4584
  avgScore: row.avg_score ?? 0,
4568
4585
  error: row.error,
4586
+ cancelRequested: row.cancel_requested ?? false,
4569
4587
  holdout: row.holdout,
4570
4588
  envProjectId: row.env_project_id,
4571
4589
  envWorkspaceId: row.env_workspace_id,
@@ -4937,7 +4955,7 @@ var PostgreSQLEvalStore = class {
4937
4955
  `SELECT id, project_id, tenant_id,
4938
4956
  status, concurrency, total_cases,
4939
4957
  passed_cases, failed_cases, interrupted_cases, avg_score,
4940
- error, holdout, env_project_id, env_workspace_id, task_id, created_at, started_at, completed_at
4958
+ error, holdout, env_project_id, env_workspace_id, task_id, cancel_requested, created_at, started_at, completed_at
4941
4959
  FROM lattice_eval_runs
4942
4960
  WHERE ${conditions.join(" AND ")}
4943
4961
  ORDER BY created_at DESC`,
@@ -4952,7 +4970,7 @@ var PostgreSQLEvalStore = class {
4952
4970
  `SELECT id, project_id, tenant_id,
4953
4971
  status, concurrency, total_cases,
4954
4972
  passed_cases, failed_cases, interrupted_cases, avg_score,
4955
- error, holdout, env_project_id, env_workspace_id, task_id, created_at, started_at, completed_at
4973
+ error, holdout, env_project_id, env_workspace_id, task_id, cancel_requested, created_at, started_at, completed_at
4956
4974
  FROM lattice_eval_runs
4957
4975
  WHERE id = $1 AND tenant_id = $2`,
4958
4976
  [id, tenantId]
@@ -4970,7 +4988,7 @@ var PostgreSQLEvalStore = class {
4970
4988
  RETURNING id, project_id, tenant_id,
4971
4989
  status, concurrency, total_cases,
4972
4990
  passed_cases, failed_cases, interrupted_cases, avg_score,
4973
- error, holdout, env_project_id, env_workspace_id, task_id, created_at, started_at, completed_at`,
4991
+ error, holdout, env_project_id, env_workspace_id, task_id, cancel_requested, created_at, started_at, completed_at`,
4974
4992
  [
4975
4993
  actualId,
4976
4994
  projectId,
@@ -5032,11 +5050,22 @@ var PostgreSQLEvalStore = class {
5032
5050
  RETURNING id, project_id, tenant_id,
5033
5051
  status, concurrency, total_cases,
5034
5052
  passed_cases, failed_cases, interrupted_cases, avg_score,
5035
- error, holdout, env_project_id, env_workspace_id, task_id, created_at, started_at, completed_at`,
5053
+ error, holdout, env_project_id, env_workspace_id, task_id, cancel_requested, created_at, started_at, completed_at`,
5036
5054
  vals
5037
5055
  );
5038
5056
  return rows.length ? this.mapRowToRun(rows[0]) : null;
5039
5057
  }
5058
+ /** Request cooperative cancellation for a running evaluation. */
5059
+ async requestCancel(tenantId, id) {
5060
+ await this.ensureInitialized();
5061
+ const { rowCount } = await this.pool.query(
5062
+ `UPDATE lattice_eval_runs
5063
+ SET cancel_requested = TRUE
5064
+ WHERE tenant_id = $1 AND id = $2 AND status = 'running'`,
5065
+ [tenantId, id]
5066
+ );
5067
+ return (rowCount ?? 0) > 0;
5068
+ }
5040
5069
  /** Delete a run and its results */
5041
5070
  async deleteRun(tenantId, id) {
5042
5071
  await this.ensureInitialized();
@@ -7782,12 +7811,27 @@ var addTaskDependenciesGinIndex = {
7782
7811
  await client.query("DROP INDEX IF EXISTS idx_lattice_tasks_dependencies_gin");
7783
7812
  }
7784
7813
  };
7814
+ var addTaskContextThreadIndex = {
7815
+ version: 206,
7816
+ name: "add_task_context_thread_index",
7817
+ up: async (client) => {
7818
+ await client.query(`
7819
+ CREATE INDEX IF NOT EXISTS idx_lattice_tasks_context_thread
7820
+ ON lattice_tasks (tenant_id, (context->>'thread_id'))
7821
+ WHERE context->>'thread_id' IS NOT NULL
7822
+ `);
7823
+ },
7824
+ down: async (client) => {
7825
+ await client.query("DROP INDEX IF EXISTS idx_lattice_tasks_context_thread");
7826
+ }
7827
+ };
7785
7828
  var taskMigrations = [
7786
7829
  createTasksTable,
7787
7830
  addTaskFieldsMigration,
7788
7831
  addTaskProjectFieldsMigration,
7789
7832
  addFilesToTasks,
7790
- addTaskDependenciesGinIndex
7833
+ addTaskDependenciesGinIndex,
7834
+ addTaskContextThreadIndex
7791
7835
  ];
7792
7836
 
7793
7837
  // src/stores/PostgreSQLTaskStore.ts
@@ -7998,6 +8042,10 @@ var PostgreSQLTaskStore = class {
7998
8042
  conditions.push(`priority = $${paramIndex++}`);
7999
8043
  params.push(filter.priority);
8000
8044
  }
8045
+ if (filter.threadId) {
8046
+ conditions.push(`context->>'thread_id' = $${paramIndex++}`);
8047
+ params.push(filter.threadId);
8048
+ }
8001
8049
  if (filter.workspaceId) {
8002
8050
  conditions.push(`workspace_id = $${paramIndex++}`);
8003
8051
  params.push(filter.workspaceId);
@@ -12864,7 +12912,7 @@ var PostgreSQLAgentRunLedger = class {
12864
12912
  throw new import_core10.AgentRunInputCommandConflictError();
12865
12913
  }
12866
12914
  const inputMessageIds = input.inputMessageIds ? (0, import_core10.normalizeAgentRunMessageIds)(input.inputMessageIds) : (0, import_core10.extractAgentRunInputMessageIds)(input.input);
12867
- const availableAt = input.availableAt ?? Date.now();
12915
+ const availableAt = input.availableAt ?? null;
12868
12916
  const limit = input.maxActiveRunsForTenant;
12869
12917
  const client = await this.pool.connect();
12870
12918
  try {
@@ -12914,7 +12962,10 @@ var PostgreSQLAgentRunLedger = class {
12914
12962
  available_at, created_at, updated_at, task_id)
12915
12963
  VALUES ($1, $2, $3, $4, $5, $6, 'pending', $7, NULL, NULL, $8, 0,
12916
12964
  $9::jsonb, $10::jsonb, $11::jsonb, $12::jsonb, $13,
12917
- to_timestamp($14::double precision / 1000.0),
12965
+ COALESCE(
12966
+ to_timestamp($14::double precision / 1000.0),
12967
+ date_trunc('milliseconds', now())
12968
+ ),
12918
12969
  date_trunc('milliseconds', now()),
12919
12970
  date_trunc('milliseconds', now()), $15)
12920
12971
  RETURNING *`,
@@ -13433,14 +13484,17 @@ var PostgreSQLAgentRunLedger = class {
13433
13484
  /** Atomically requeues or interrupts an expired run-queue row. */
13434
13485
  async settleExpiredRun(runId, outcome, options) {
13435
13486
  if (outcome === "pending") {
13436
- const availableAt = options?.availableAt ?? Date.now();
13487
+ const availableAt = options?.availableAt ?? null;
13437
13488
  const result2 = await this.pool.query(
13438
13489
  `UPDATE lattice_agent_runs
13439
13490
  SET status = 'pending',
13440
13491
  owner = NULL,
13441
13492
  lease_expires_at = NULL,
13442
13493
  started_at = NULL,
13443
- available_at = to_timestamp($2::double precision / 1000.0),
13494
+ available_at = COALESCE(
13495
+ to_timestamp($2::double precision / 1000.0),
13496
+ date_trunc('milliseconds', now())
13497
+ ),
13444
13498
  finished_at = NULL,
13445
13499
  updated_at = now()
13446
13500
  WHERE run_id = $1
@@ -15273,6 +15327,7 @@ function mapRowToChannelIdentityMapping(row) {
15273
15327
  ProjectRoomMessageIdConflictError,
15274
15328
  ThreadMessageQueueStore,
15275
15329
  addAssistantTenantId,
15330
+ addCancelRequestedToEvalRuns,
15276
15331
  addEnvToEvalRuns,
15277
15332
  addFileContentType,
15278
15333
  addHoldoutToEvalRuns,