@axiom-lattice/pg-stores 3.1.16 → 3.1.18

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.1.16 build /home/runner/work/agentic/agentic/packages/pg-stores
2
+ > @axiom-lattice/pg-stores@3.1.18 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 391.39 KB
12
- ESM dist/index.mjs.map 728.51 KB
13
- ESM ⚡️ Build success in 807ms
14
- CJS dist/index.js 399.60 KB
15
- CJS dist/index.js.map 728.88 KB
16
- CJS ⚡️ Build success in 848ms
11
+ CJS dist/index.js 400.85 KB
12
+ CJS dist/index.js.map 730.96 KB
13
+ CJS ⚡️ Build success in 877ms
14
+ ESM dist/index.mjs 392.59 KB
15
+ ESM dist/index.mjs.map 730.60 KB
16
+ ESM ⚡️ Build success in 918ms
17
17
  DTS Build start
18
- DTS ⚡️ Build success in 17566ms
19
- DTS dist/index.d.ts 82.14 KB
20
- DTS dist/index.d.mts 82.14 KB
18
+ DTS ⚡️ Build success in 13657ms
19
+ DTS dist/index.d.ts 82.41 KB
20
+ DTS dist/index.d.mts 82.41 KB
package/CHANGELOG.md CHANGED
@@ -1,5 +1,54 @@
1
1
  # @axiom-lattice/pg-stores
2
2
 
3
+ ## 3.1.18
4
+
5
+ ### Patch Changes
6
+
7
+ - 1cc5893: Repair the drifted test baseline, authenticate Lark webhook ingress with the verification token and request signature, require CAS revisions on capability bundle updates, and fix SandboxRegistry process-lifetime issues.
8
+ - e4a110f: mcp ui etc
9
+ - ad3ac4d: Add a first-class `mcpApp` custom-menu content type so a rendered MCP App can be
10
+ pinned to the workspace menu and re-opened as a live entry point. The protocol
11
+ gains `McpAppMenuConfig` (discriminated `mcp` / `plugin`) and `FileMenuConfig`;
12
+ react-sdk encodes/parses the item, renders it via `McpAppFullscreen`, and adds a
13
+ pin affordance to `McpAppToolbar` reusing `PinToMenuButton`. pg-stores broadens
14
+ the `lattice_menu_items.content_type` CHECK constraint to accept `mcpApp`
15
+ (migration v181, registered centrally in `createPgStoreConfig`).
16
+ - Updated dependencies [0b7cabc]
17
+ - Updated dependencies [c5cd1fe]
18
+ - Updated dependencies [ecd28e5]
19
+ - Updated dependencies [8ed0255]
20
+ - Updated dependencies [15b7181]
21
+ - Updated dependencies [1cc5893]
22
+ - Updated dependencies [e4a110f]
23
+ - Updated dependencies [2fd1187]
24
+ - Updated dependencies [015a931]
25
+ - Updated dependencies [3398474]
26
+ - Updated dependencies [a87f880]
27
+ - Updated dependencies [9de0600]
28
+ - Updated dependencies [fbc46a4]
29
+ - Updated dependencies [978699d]
30
+ - Updated dependencies [db00edc]
31
+ - Updated dependencies [4f86ed4]
32
+ - Updated dependencies [41c6ee2]
33
+ - Updated dependencies [15c92a0]
34
+ - Updated dependencies [ad3ac4d]
35
+ - Updated dependencies [4c3ddbd]
36
+ - Updated dependencies [a0a30b3]
37
+ - Updated dependencies [ac6b3de]
38
+ - Updated dependencies [2d5682c]
39
+ - Updated dependencies [cb933a7]
40
+ - Updated dependencies [7f35e3d]
41
+ - @axiom-lattice/core@4.3.0
42
+ - @axiom-lattice/protocols@4.4.0
43
+
44
+ ## 3.1.17
45
+
46
+ ### Patch Changes
47
+
48
+ - Updated dependencies [2d178cb]
49
+ - @axiom-lattice/core@4.2.17
50
+ - @axiom-lattice/protocols@4.3.2
51
+
3
52
  ## 3.1.16
4
53
 
5
54
  ### Patch Changes
package/dist/index.d.mts CHANGED
@@ -1488,6 +1488,12 @@ declare class PostgreSQLCapabilityBundleStore implements CapabilityBundleStore {
1488
1488
  update(tenantId: string, id: string, input: InternalUpdateCapabilityBundleInput): Promise<CapabilityBundle | {
1489
1489
  status: "conflict";
1490
1490
  } | null>;
1491
+ /**
1492
+ * Distinguishes a stale-revision CAS miss from a missing bundle.
1493
+ *
1494
+ * @returns `null` when no such bundle exists, otherwise a conflict marker.
1495
+ */
1496
+ private resolveCasMiss;
1491
1497
  deleteIfUnreferenced(tenantId: string, id: string): Promise<CapabilityBundleDeleteResult>;
1492
1498
  }
1493
1499
 
@@ -2195,6 +2201,8 @@ declare const createMenuItemsTable: Migration;
2195
2201
 
2196
2202
  declare const addFileContentType: Migration;
2197
2203
 
2204
+ declare const addMcpAppContentType: Migration;
2205
+
2198
2206
  /**
2199
2207
  * Collection table migrations
2200
2208
  */
@@ -2206,4 +2214,4 @@ declare const createProjectRoomTables: Migration;
2206
2214
  /** Adds per-user, per-room read markers for unread counts. */
2207
2215
  declare const createProjectRoomReadStates: Migration;
2208
2216
 
2209
- 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, PostgreSQLOpenAuditStore, type PostgreSQLOpenAuditStoreOptions, 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 };
2217
+ 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, PostgreSQLOpenAuditStore, type PostgreSQLOpenAuditStoreOptions, 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, addMcpAppContentType, 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
@@ -1488,6 +1488,12 @@ declare class PostgreSQLCapabilityBundleStore implements CapabilityBundleStore {
1488
1488
  update(tenantId: string, id: string, input: InternalUpdateCapabilityBundleInput): Promise<CapabilityBundle | {
1489
1489
  status: "conflict";
1490
1490
  } | null>;
1491
+ /**
1492
+ * Distinguishes a stale-revision CAS miss from a missing bundle.
1493
+ *
1494
+ * @returns `null` when no such bundle exists, otherwise a conflict marker.
1495
+ */
1496
+ private resolveCasMiss;
1491
1497
  deleteIfUnreferenced(tenantId: string, id: string): Promise<CapabilityBundleDeleteResult>;
1492
1498
  }
1493
1499
 
@@ -2195,6 +2201,8 @@ declare const createMenuItemsTable: Migration;
2195
2201
 
2196
2202
  declare const addFileContentType: Migration;
2197
2203
 
2204
+ declare const addMcpAppContentType: Migration;
2205
+
2198
2206
  /**
2199
2207
  * Collection table migrations
2200
2208
  */
@@ -2206,4 +2214,4 @@ declare const createProjectRoomTables: Migration;
2206
2214
  /** Adds per-user, per-room read markers for unread counts. */
2207
2215
  declare const createProjectRoomReadStates: Migration;
2208
2216
 
2209
- 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, PostgreSQLOpenAuditStore, type PostgreSQLOpenAuditStoreOptions, 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 };
2217
+ 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, PostgreSQLOpenAuditStore, type PostgreSQLOpenAuditStoreOptions, 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, addMcpAppContentType, 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
@@ -76,6 +76,7 @@ __export(index_exports, {
76
76
  addHoldoutToEvalRuns: () => addHoldoutToEvalRuns,
77
77
  addInterruptColumnsToEval: () => addInterruptColumnsToEval,
78
78
  addInterruptPolicyToEvalCases: () => addInterruptPolicyToEvalCases,
79
+ addMcpAppContentType: () => addMcpAppContentType,
79
80
  addProjectConfigColumn: () => addProjectConfigColumn,
80
81
  addScheduleTenantId: () => addScheduleTenantId,
81
82
  addSkillTenantId: () => addSkillTenantId,
@@ -8934,6 +8935,34 @@ var addFileContentType = {
8934
8935
  }
8935
8936
  };
8936
8937
 
8938
+ // src/migrations/menu_items_add_mcp_app_type.ts
8939
+ var addMcpAppContentType = {
8940
+ version: 181,
8941
+ name: "add_mcp_app_content_type_to_menu_items",
8942
+ up: async (client) => {
8943
+ await client.query(`
8944
+ ALTER TABLE lattice_menu_items
8945
+ DROP CONSTRAINT IF EXISTS lattice_menu_items_content_type_check
8946
+ `);
8947
+ await client.query(`
8948
+ ALTER TABLE lattice_menu_items
8949
+ ADD CONSTRAINT lattice_menu_items_content_type_check
8950
+ CHECK (content_type IN ('agent', 'html', 'custom', 'file', 'mcpApp'))
8951
+ `);
8952
+ },
8953
+ down: async (client) => {
8954
+ await client.query(`
8955
+ ALTER TABLE lattice_menu_items
8956
+ DROP CONSTRAINT IF EXISTS lattice_menu_items_content_type_check
8957
+ `);
8958
+ await client.query(`
8959
+ ALTER TABLE lattice_menu_items
8960
+ ADD CONSTRAINT lattice_menu_items_content_type_check
8961
+ CHECK (content_type IN ('agent', 'html', 'custom', 'file'))
8962
+ `);
8963
+ }
8964
+ };
8965
+
8937
8966
  // src/stores/MenuStore.ts
8938
8967
  var MenuStore = class {
8939
8968
  constructor(options) {
@@ -8952,6 +8981,7 @@ var MenuStore = class {
8952
8981
  this.migrationManager = new MigrationManager(this.pool);
8953
8982
  this.migrationManager.register(createMenuItemsTable);
8954
8983
  this.migrationManager.register(addFileContentType);
8984
+ this.migrationManager.register(addMcpAppContentType);
8955
8985
  if (options.autoMigrate !== false) {
8956
8986
  this.initialize().catch((error) => {
8957
8987
  console.error("Failed to initialize MenuStore:", error);
@@ -10171,6 +10201,10 @@ var PostgreSQLCapabilityBundleStore = class {
10171
10201
  }
10172
10202
  async update(tenantId, id, input) {
10173
10203
  await this.ready();
10204
+ const expectedUpdatedAt = input.expectedUpdatedAt;
10205
+ if (typeof expectedUpdatedAt !== "string" || expectedUpdatedAt.trim().length === 0) {
10206
+ return this.resolveCasMiss(tenantId, id);
10207
+ }
10174
10208
  const fields = [];
10175
10209
  const values = [];
10176
10210
  const add = (field, value) => {
@@ -10185,37 +10219,46 @@ var PostgreSQLCapabilityBundleStore = class {
10185
10219
  add("capabilities", JSON.stringify(input.capabilities));
10186
10220
  }
10187
10221
  if (fields.length === 0) {
10188
- const expectedUpdatedAt2 = input.expectedUpdatedAt;
10189
10222
  const result = await this.pool.query(
10190
10223
  `SELECT id, tenant_id, bundle_key, name, description, capabilities, created_at, updated_at::text AS updated_at
10191
10224
  FROM lattice_capability_bundles
10192
- WHERE tenant_id = $1 AND id = $2${expectedUpdatedAt2 === void 0 ? "" : " AND updated_at::text = $3"}`,
10193
- expectedUpdatedAt2 === void 0 ? [tenantId, id] : [tenantId, id, expectedUpdatedAt2]
10225
+ WHERE tenant_id = $1 AND id = $2 AND updated_at::text = $3`,
10226
+ [tenantId, id, expectedUpdatedAt]
10194
10227
  );
10195
10228
  if (result.rows[0]) return map(result.rows[0]);
10196
- return expectedUpdatedAt2 === void 0 ? null : { status: "conflict" };
10229
+ return this.resolveCasMiss(tenantId, id);
10197
10230
  }
10198
- const expectedUpdatedAt = input.expectedUpdatedAt;
10199
- values.push(tenantId, id);
10200
- if (expectedUpdatedAt !== void 0) values.push(expectedUpdatedAt);
10201
- const tenantParam = values.length - (expectedUpdatedAt === void 0 ? 1 : 2);
10231
+ values.push(tenantId, id, expectedUpdatedAt);
10232
+ const tenantParam = values.length - 2;
10202
10233
  const idParam = tenantParam + 1;
10203
- const revisionPredicate = expectedUpdatedAt === void 0 ? "" : ` AND updated_at::text = $${values.length}`;
10234
+ const revisionParam = values.length;
10204
10235
  try {
10205
10236
  const result = await this.pool.query(
10206
10237
  `UPDATE lattice_capability_bundles
10207
- SET ${fields.join(", ")}, updated_at = GREATEST(updated_at + interval '1 microsecond', clock_timestamp())
10208
- WHERE tenant_id = $${tenantParam} AND id = $${idParam}${revisionPredicate}
10238
+ SET ${fields.join(", ")}, updated_at = GREATEST(updated_at + interval '1 microsecond', clock_timestamp())
10239
+ WHERE tenant_id = $${tenantParam} AND id = $${idParam} AND updated_at::text = $${revisionParam}
10209
10240
  RETURNING id, tenant_id, bundle_key, name, description, capabilities, created_at, updated_at::text AS updated_at`,
10210
10241
  values
10211
10242
  );
10212
10243
  if (result.rows[0]) return map(result.rows[0]);
10213
- return expectedUpdatedAt === void 0 ? null : { status: "conflict" };
10244
+ return this.resolveCasMiss(tenantId, id);
10214
10245
  } catch (error) {
10215
10246
  if (isDuplicate(error)) throw new Error(duplicateMessage);
10216
10247
  throw error;
10217
10248
  }
10218
10249
  }
10250
+ /**
10251
+ * Distinguishes a stale-revision CAS miss from a missing bundle.
10252
+ *
10253
+ * @returns `null` when no such bundle exists, otherwise a conflict marker.
10254
+ */
10255
+ async resolveCasMiss(tenantId, id) {
10256
+ const result = await this.pool.query(
10257
+ "SELECT id FROM lattice_capability_bundles WHERE tenant_id = $1 AND id = $2",
10258
+ [tenantId, id]
10259
+ );
10260
+ return result.rows[0] ? { status: "conflict" } : null;
10261
+ }
10219
10262
  async deleteIfUnreferenced(tenantId, id) {
10220
10263
  await this.ready();
10221
10264
  const client = await this.pool.connect();
@@ -11045,6 +11088,7 @@ async function createPgStoreConfig(connectionString) {
11045
11088
  mm.register(createMenuItemsTable);
11046
11089
  mm.register(createSharedResourcesTable);
11047
11090
  mm.register(addFileContentType);
11091
+ mm.register(addMcpAppContentType);
11048
11092
  mm.register(createCollectionsTable);
11049
11093
  mm.register(createTaskWorkItemsMigration);
11050
11094
  mm.register(addWorkItemProjectFieldsMigration);
@@ -11706,6 +11750,7 @@ function mapRowToChannelIdentityMapping(row) {
11706
11750
  addHoldoutToEvalRuns,
11707
11751
  addInterruptColumnsToEval,
11708
11752
  addInterruptPolicyToEvalCases,
11753
+ addMcpAppContentType,
11709
11754
  addProjectConfigColumn,
11710
11755
  addScheduleTenantId,
11711
11756
  addSkillTenantId,