@cmmd-center/forge 0.11.1 → 0.12.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.
Files changed (24) hide show
  1. package/dist/bin.cjs +119 -26
  2. package/dist/bin.mjs +119 -26
  3. package/dist/client/assets/{CanvasPanel-Cogtmutb.js → CanvasPanel-CL4T3ptl.js} +2 -2
  4. package/dist/client/assets/{CompositeItem-D6h2WFmU.js → CompositeItem-NATmsDHX.js} +2 -2
  5. package/dist/client/assets/{DiffPanel-27f3_FPs.js → DiffPanel-29UmSyE3.js} +2 -2
  6. package/dist/client/assets/{DiffPanel.logic-BuQtD_J1.js → DiffPanel.logic-D5Bn5tgT.js} +2 -2
  7. package/dist/client/assets/{DiffPanelShell-BvD0Fk5A.js → DiffPanelShell-ClKPX_Pu.js} +3 -3
  8. package/dist/client/assets/{DiffWorkerPoolProvider-K588YXmt.js → DiffWorkerPoolProvider-BMZL3CsO.js} +2 -2
  9. package/dist/client/assets/{PullRequestCodePanel-B4HbAQDj.js → PullRequestCodePanel-Cp75delh.js} +2 -2
  10. package/dist/client/assets/{Virtualizer-DMnisVCC.js → Virtualizer-uq0d5TwY.js} +2 -2
  11. package/dist/client/assets/{canvasStateStore-DUZyBLSv.js → canvasStateStore-DtidOKbV.js} +2 -2
  12. package/dist/client/assets/{cmmdAuthRedirect-Bkc6Luqb.js → cmmdAuthRedirect-CzACd5XJ.js} +2 -2
  13. package/dist/client/assets/{index-Lfu9WfF1.js → index-BOI5P7rG.js} +58 -58
  14. package/dist/client/assets/src-BlFkWEsP.js +3 -0
  15. package/dist/client/assets/{toggle-CWmPePti.js → toggle-pwklbW9N.js} +2 -2
  16. package/dist/client/assets/{useTriggerFocusGuards-O7DUCec0.js → useTriggerFocusGuards-CPLQ8_CW.js} +2 -2
  17. package/dist/client/index.html +10 -10
  18. package/dist/forge-build.json +1 -1
  19. package/dist/runtimeBootstrap.cjs +1 -1
  20. package/dist/runtimeBootstrap.mjs +1 -1
  21. package/dist/{runtimeControlAuthority-BdIovv-r.cjs → runtimeControlAuthority-B3kNmYRT.cjs} +4 -2
  22. package/dist/{runtimeControlAuthority-COHmz_WT.mjs → runtimeControlAuthority-D_zKr_eI.mjs} +4 -2
  23. package/package.json +1 -1
  24. package/dist/client/assets/src-BlF9iHm-.js +0 -3
package/dist/bin.cjs CHANGED
@@ -12,7 +12,7 @@ const require_Cache = require("./Cache-CWlxNDbC.cjs");
12
12
  const require_SqlError = require("./SqlError-Bt0Bcd5C.cjs");
13
13
  const require_Mime = require("./Mime-Bilnh8zE.cjs");
14
14
  const require_esm = require("./esm-BZhXwX5p.cjs");
15
- const require_runtimeControlAuthority = require("./runtimeControlAuthority-BdIovv-r.cjs");
15
+ const require_runtimeControlAuthority = require("./runtimeControlAuthority-B3kNmYRT.cjs");
16
16
  const require_PTY = require("./PTY-BxYDiW3h.cjs");
17
17
  let node_child_process = require("node:child_process");
18
18
  node_child_process = require_chunk.__toESM(node_child_process);
@@ -16544,7 +16544,7 @@ function makeNetServiceShape(createServer = node_net.createServer) {
16544
16544
  }
16545
16545
  //#endregion
16546
16546
  //#region ../../packages/shared/src/releaseInfo.generated.ts
16547
- const FORGE_RELEASE_VERSION = "0.11.0";
16547
+ const FORGE_RELEASE_VERSION = "0.12.0";
16548
16548
  //#endregion
16549
16549
  //#region ../../packages/shared/src/hostProcess.ts
16550
16550
  /**
@@ -19200,6 +19200,7 @@ const ORCHESTRATION_WS_METHODS = {
19200
19200
  streamTurnDiff: "orchestration.streamTurnDiff",
19201
19201
  streamFullThreadDiff: "orchestration.streamFullThreadDiff",
19202
19202
  replayEvents: "orchestration.replayEvents",
19203
+ getArchivedShellSnapshot: "orchestration.getArchivedShellSnapshot",
19203
19204
  subscribeShell: "orchestration.subscribeShell",
19204
19205
  subscribeThread: "orchestration.subscribeThread"
19205
19206
  };
@@ -20669,6 +20670,10 @@ const OrchestrationRpcSchemas = {
20669
20670
  subscribeShell: {
20670
20671
  input: require_Schema$1.Struct({}),
20671
20672
  output: OrchestrationShellStreamItem
20673
+ },
20674
+ getArchivedShellSnapshot: {
20675
+ input: require_Schema$1.Struct({}),
20676
+ output: OrchestrationShellSnapshot
20672
20677
  }
20673
20678
  };
20674
20679
  var OrchestrationGetSnapshotError = class extends require_Schema$1.TaggedErrorClass()("OrchestrationGetSnapshotError", {
@@ -26564,6 +26569,11 @@ const WsOrchestrationReplayEventsRpc = make$30(ORCHESTRATION_WS_METHODS.replayEv
26564
26569
  success: OrchestrationRpcSchemas.replayEvents.output,
26565
26570
  error: OrchestrationReplayEventsError
26566
26571
  });
26572
+ const WsOrchestrationGetArchivedShellSnapshotRpc = make$30(ORCHESTRATION_WS_METHODS.getArchivedShellSnapshot, {
26573
+ payload: OrchestrationRpcSchemas.getArchivedShellSnapshot.input,
26574
+ success: OrchestrationRpcSchemas.getArchivedShellSnapshot.output,
26575
+ error: OrchestrationGetSnapshotError
26576
+ });
26567
26577
  const WsOrchestrationSubscribeShellRpc = make$30(ORCHESTRATION_WS_METHODS.subscribeShell, {
26568
26578
  payload: OrchestrationRpcSchemas.subscribeShell.input,
26569
26579
  success: OrchestrationRpcSchemas.subscribeShell.output,
@@ -26644,7 +26654,7 @@ const WsRpcGroup = make$29(WsServerGetConfigRpc, WsServerRefreshProvidersRpc, Ws
26644
26654
  payload: UsageSummaryInput,
26645
26655
  success: UsageSummary,
26646
26656
  error: UsageReadError
26647
- }), WsPullRequestsListRpc, WsPullRequestsListStatsRpc, WsPullRequestsDetailRpc, WsPullRequestsActivityRpc, WsPullRequestsThreadCommentsRpc, WsPullRequestsDiffFileContentsRpc, WsPullRequestsRunActionRpc, WsPullRequestsUpdateRpc, WsPullRequestsCommentRpc, WsPullRequestsUpdateCommentRpc, WsPullRequestsSubmitReviewRpc, WsPullRequestsReplyToThreadRpc, WsPullRequestsSetThreadResolutionRpc, WsPullRequestsSetReactionRpc, WsPullRequestsInvalidateRpc, WsPullRequestsReviewerCandidatesRpc, WsPullRequestsRequestReviewersRpc, WsProjectsSearchEntriesRpc, WsProjectsWriteFileRpc, WsProjectCheckoutDeletionPreviewRpc, WsProjectCheckoutDeletionExecuteRpc, WsCodeGraphSummaryRpc, WsCodeGraphNeighborhoodRpc, WsCodeGraphSearchRpc, WsWorkspaceReadFileRpc, WsWorkspaceBeginWriteFileRpc, WsWorkspaceWriteFileChunkRpc, WsWorkspaceCommitWriteFileRpc, WsWorkspaceCancelWriteFileRpc, WsShellOpenInEditorRpc, WsSubscribeGitStatusRpc, WsGitPullRpc, WsGitRefreshStatusRpc, WsGitRunStackedActionRpc, WsGitResolvePullRequestRpc, WsGitPreparePullRequestThreadRpc, WsGitListBranchesRpc, WsVcsListRefsRpc, WsVcsRefreshStatusRpc, WsSubscribeVcsStatusRpc, WsVcsPullRpc, WsVcsCreateWorktreeRpc, WsVcsRemoveWorktreeRpc, WsVcsCreateRefRpc, WsVcsSwitchRefRpc, WsVcsInitRpc, WsGitCreateWorktreeRpc, WsGitRemoveWorktreeRpc, WsGitCreateBranchRpc, WsGitCheckoutRpc, WsGitInitRpc, WsFilesystemBrowseRpc, WsProjectsReadFileRpc, WsReviewGetDiffPreviewRpc, WsCloudListRuntimesRpc, WsTerminalOpenRpc, WsTerminalAttachRpc, WsTerminalWriteRpc, WsTerminalResizeRpc, WsTerminalSignalRpc, WsTerminalClearRpc, WsTerminalRestartRpc, WsTerminalCloseRpc, WsBrowserOpenSessionRpc, WsBrowserListSessionsRpc, WsBrowserCloseSessionRpc, WsBrowserGetSessionRpc, WsBrowserCommandRpc, WsBrowserClearBrowsingDataRpc, WsBrowserAttachDisplayRpc, WsBrowserAddDisplayIceCandidateRpc, WsComputerInputRpc, WsDevTunnelRegisterRpc, WsDevTunnelUnregisterRpc, WsDevTunnelListRpc, WsThreadDevRuntimeGetRpc, WsThreadDevRuntimeAllocatePortRpc, WsThreadDevRuntimeReleaseRpc, WsWorkspaceEnvironmentPreflightRpc, WsWorkspaceEnsureScratchRpc, WsSubscribeTerminalEventsRpc, WsSubscribeTerminalMetadataRpc, WsProjectsListEntriesRpc, WsServerDiscoverSourceControlRpc, WsServerReportClientActivityRpc, WsSubscribeBrowserEventsRpc, WsSubscribeServerConfigRpc, WsSubscribeServerLifecycleRpc, WsSubscribeAuthAccessRpc, WsSubscribeWorkspaceReadinessRpc, WsOrchestrationDispatchCommandRpc, WsOrchestrationGetTurnDiffRpc, WsOrchestrationGetFullThreadDiffRpc, WsOrchestrationStreamTurnDiffRpc, WsOrchestrationStreamFullThreadDiffRpc, WsOrchestrationReplayEventsRpc, WsOrchestrationSubscribeShellRpc, WsOrchestrationSubscribeThreadRpc);
26657
+ }), WsPullRequestsListRpc, WsPullRequestsListStatsRpc, WsPullRequestsDetailRpc, WsPullRequestsActivityRpc, WsPullRequestsThreadCommentsRpc, WsPullRequestsDiffFileContentsRpc, WsPullRequestsRunActionRpc, WsPullRequestsUpdateRpc, WsPullRequestsCommentRpc, WsPullRequestsUpdateCommentRpc, WsPullRequestsSubmitReviewRpc, WsPullRequestsReplyToThreadRpc, WsPullRequestsSetThreadResolutionRpc, WsPullRequestsSetReactionRpc, WsPullRequestsInvalidateRpc, WsPullRequestsReviewerCandidatesRpc, WsPullRequestsRequestReviewersRpc, WsProjectsSearchEntriesRpc, WsProjectsWriteFileRpc, WsProjectCheckoutDeletionPreviewRpc, WsProjectCheckoutDeletionExecuteRpc, WsCodeGraphSummaryRpc, WsCodeGraphNeighborhoodRpc, WsCodeGraphSearchRpc, WsWorkspaceReadFileRpc, WsWorkspaceBeginWriteFileRpc, WsWorkspaceWriteFileChunkRpc, WsWorkspaceCommitWriteFileRpc, WsWorkspaceCancelWriteFileRpc, WsShellOpenInEditorRpc, WsSubscribeGitStatusRpc, WsGitPullRpc, WsGitRefreshStatusRpc, WsGitRunStackedActionRpc, WsGitResolvePullRequestRpc, WsGitPreparePullRequestThreadRpc, WsGitListBranchesRpc, WsVcsListRefsRpc, WsVcsRefreshStatusRpc, WsSubscribeVcsStatusRpc, WsVcsPullRpc, WsVcsCreateWorktreeRpc, WsVcsRemoveWorktreeRpc, WsVcsCreateRefRpc, WsVcsSwitchRefRpc, WsVcsInitRpc, WsGitCreateWorktreeRpc, WsGitRemoveWorktreeRpc, WsGitCreateBranchRpc, WsGitCheckoutRpc, WsGitInitRpc, WsFilesystemBrowseRpc, WsProjectsReadFileRpc, WsReviewGetDiffPreviewRpc, WsCloudListRuntimesRpc, WsTerminalOpenRpc, WsTerminalAttachRpc, WsTerminalWriteRpc, WsTerminalResizeRpc, WsTerminalSignalRpc, WsTerminalClearRpc, WsTerminalRestartRpc, WsTerminalCloseRpc, WsBrowserOpenSessionRpc, WsBrowserListSessionsRpc, WsBrowserCloseSessionRpc, WsBrowserGetSessionRpc, WsBrowserCommandRpc, WsBrowserClearBrowsingDataRpc, WsBrowserAttachDisplayRpc, WsBrowserAddDisplayIceCandidateRpc, WsComputerInputRpc, WsDevTunnelRegisterRpc, WsDevTunnelUnregisterRpc, WsDevTunnelListRpc, WsThreadDevRuntimeGetRpc, WsThreadDevRuntimeAllocatePortRpc, WsThreadDevRuntimeReleaseRpc, WsWorkspaceEnvironmentPreflightRpc, WsWorkspaceEnsureScratchRpc, WsSubscribeTerminalEventsRpc, WsSubscribeTerminalMetadataRpc, WsProjectsListEntriesRpc, WsServerDiscoverSourceControlRpc, WsServerReportClientActivityRpc, WsSubscribeBrowserEventsRpc, WsSubscribeServerConfigRpc, WsSubscribeServerLifecycleRpc, WsSubscribeAuthAccessRpc, WsSubscribeWorkspaceReadinessRpc, WsOrchestrationDispatchCommandRpc, WsOrchestrationGetTurnDiffRpc, WsOrchestrationGetFullThreadDiffRpc, WsOrchestrationStreamTurnDiffRpc, WsOrchestrationStreamFullThreadDiffRpc, WsOrchestrationReplayEventsRpc, WsOrchestrationGetArchivedShellSnapshotRpc, WsOrchestrationSubscribeShellRpc, WsOrchestrationSubscribeThreadRpc);
26648
26658
  const RelayWsRpcGroup = WsRpcGroup.middleware(RelayAuthorizationMiddleware).middleware(RelayDeliveryMiddleware);
26649
26659
  /**
26650
26660
  * The direct-WebSocket mount of the same group, with per-method scope
@@ -31770,6 +31780,11 @@ const RELAY_METHOD_POLICY_BASES = [
31770
31780
  requiredScope: "thread.read",
31771
31781
  deliveryClass: "subscription"
31772
31782
  },
31783
+ {
31784
+ method: ORCHESTRATION_WS_METHODS.getArchivedShellSnapshot,
31785
+ requiredScope: "thread.read",
31786
+ deliveryClass: "read"
31787
+ },
31773
31788
  {
31774
31789
  method: ORCHESTRATION_WS_METHODS.subscribeShell,
31775
31790
  requiredScope: "thread.read",
@@ -65798,7 +65813,7 @@ function normalizeNumberish(value) {
65798
65813
  }
65799
65814
  //#endregion
65800
65815
  //#region package.json
65801
- var version$1 = "0.11.1";
65816
+ var version$1 = "0.12.0";
65802
65817
  //#endregion
65803
65818
  //#region src/sentry.ts
65804
65819
  const SERVER_APP_NAME = "forge-server";
@@ -93066,6 +93081,15 @@ async function resolveForgeGitCommit(execImpl = (command, args) => execFileAsync
93066
93081
  return cached$1;
93067
93082
  }
93068
93083
  //#endregion
93084
+ //#region src/environment/serverVersion.ts
93085
+ const installedForgeServerVersion = version$1;
93086
+ const SEMVER_NUMERIC_IDENTIFIER = "(?:0|[1-9][0-9]*)";
93087
+ const SEMVER_PRERELEASE_IDENTIFIER = "(?:0|[1-9][0-9]*|[0-9]*[A-Za-z-][0-9A-Za-z-]*)";
93088
+ const EXACT_FORGE_SERVER_VERSION_PATTERN = new RegExp(`^${SEMVER_NUMERIC_IDENTIFIER}[.]${SEMVER_NUMERIC_IDENTIFIER}[.]${SEMVER_NUMERIC_IDENTIFIER}(?:-${SEMVER_PRERELEASE_IDENTIFIER}(?:[.]${SEMVER_PRERELEASE_IDENTIFIER})*)?(?:[+][0-9A-Za-z-]+(?:[.][0-9A-Za-z-]+)*)?\$`);
93089
+ function isExactForgeServerVersion(value) {
93090
+ return typeof value === "string" && EXACT_FORGE_SERVER_VERSION_PATTERN.test(value);
93091
+ }
93092
+ //#endregion
93069
93093
  //#region src/cmmd/ownerSessionCredential.ts
93070
93094
  /**
93071
93095
  * The signed-in owner's CMMD credential, for the calls a device makes as
@@ -94709,7 +94733,8 @@ const registerCloudRuntimeForReplicaHydration = require_Schema$1.gen(function* (
94709
94733
  credentialEpoch,
94710
94734
  activeTurnCount: 0,
94711
94735
  activeSessionCount: 0,
94712
- ...forgeGitCommit !== void 0 ? { forgeGitCommit } : {}
94736
+ ...forgeGitCommit !== void 0 ? { forgeGitCommit } : {},
94737
+ forgeServerVersion: installedForgeServerVersion
94713
94738
  }),
94714
94739
  catch: (cause) => replicaHydrationFailure("runtime registration heartbeat failed", cause)
94715
94740
  })) === null) return yield* replicaHydrationFailure("runtime control authority is unavailable");
@@ -104999,6 +105024,13 @@ const makeWsRpcLayer = (currentSessionId, currentUserId) => WsRpcGroup.toLayer(r
104999
105024
  message: "Failed to replay orchestration events",
105000
105025
  cause
105001
105026
  }))), { "rpc.aggregate": "orchestration" }),
105027
+ [ORCHESTRATION_WS_METHODS.getArchivedShellSnapshot]: (_input) => observeRpcEffect(ORCHESTRATION_WS_METHODS.getArchivedShellSnapshot, require_Schema$1.gen(function* () {
105028
+ yield* startup.awaitCommandReady;
105029
+ return yield* projectionSnapshotQuery.getArchivedShellSnapshot();
105030
+ }).pipe(require_Schema$1.mapError((cause) => new OrchestrationGetSnapshotError({
105031
+ message: "Failed to load archived orchestration shell snapshot",
105032
+ cause
105033
+ }))), { "rpc.aggregate": "orchestration" }),
105002
105034
  [ORCHESTRATION_WS_METHODS.subscribeShell]: (_input) => observeRpcStreamEffect(ORCHESTRATION_WS_METHODS.subscribeShell, require_Schema$1.succeed(makeSnapshotThenLiveStream({
105003
105035
  loadSnapshot: loadInitialShellSnapshot({
105004
105036
  startup,
@@ -287567,7 +287599,8 @@ const makeRuntimeDrainReporter = require_Schema$1.gen(function* () {
287567
287599
  ...config,
287568
287600
  activeTurnCount: snapshot.activeTurnCount,
287569
287601
  activeSessionCount: snapshot.activeSessionCount,
287570
- ...forgeGitCommit !== void 0 ? { forgeGitCommit } : {}
287602
+ ...forgeGitCommit !== void 0 ? { forgeGitCommit } : {},
287603
+ forgeServerVersion: installedForgeServerVersion
287571
287604
  });
287572
287605
  });
287573
287606
  const applyControlPlaneState = (runtime) => drainState.applyControlPlaneState({
@@ -294928,7 +294961,7 @@ function resolveBuildCommitFromEnv(env) {
294928
294961
  * environment descriptor down instead of reporting an honest "unknown".
294929
294962
  */
294930
294963
  function readBakedBuildCommit() {
294931
- return "b79da36c868d5629c76dcec88a3326634a02c2c7";
294964
+ return "7695a8221bc664caedd33aa411ac7bcdbb0a3594";
294932
294965
  }
294933
294966
  async function resolveServerBuildCommit(input) {
294934
294967
  if (isFullCommitSha(input.baked)) return input.baked;
@@ -295121,7 +295154,7 @@ const makeServerEnvironment = require_Schema$1.fn("makeServerEnvironment")(funct
295121
295154
  os,
295122
295155
  arch: platformArch()
295123
295156
  },
295124
- serverVersion: version$1,
295157
+ serverVersion: installedForgeServerVersion,
295125
295158
  ...buildCommit !== void 0 ? { buildCommit } : {},
295126
295159
  ...deviceRuntimeId !== void 0 ? { deviceRuntimeId } : {},
295127
295160
  capabilities: {
@@ -301910,6 +301943,54 @@ const makeProjectionSnapshotQuery = require_Schema$1.gen(function* () {
301910
301943
  AND deleted_at IS NULL
301911
301944
  AND archived_at IS NULL
301912
301945
  ORDER BY created_at ASC, thread_id ASC
301946
+ `
301947
+ });
301948
+ /**
301949
+ * The archive's own rows.
301950
+ *
301951
+ * `listThreadRows` deliberately carries archived threads too, because the
301952
+ * active list needs `archivedAt` to know what to hide and the web archive
301953
+ * panel filters that same snapshot client side. This query is the opposite
301954
+ * selection, for the clients that ask for the archive directly.
301955
+ */
301956
+ const listArchivedThreadRows = findAll({
301957
+ Request: require_Schema$1.Void,
301958
+ Result: ProjectionThreadDbRowSchema,
301959
+ execute: () => sql`
301960
+ SELECT
301961
+ thread_id AS "threadId",
301962
+ project_id AS "projectId",
301963
+ title,
301964
+ model_selection_json AS "modelSelection",
301965
+ runtime_mode AS "runtimeMode",
301966
+ interaction_mode AS "interactionMode",
301967
+ branch,
301968
+ worktree_path AS "worktreePath",
301969
+ latest_turn_id AS "latestTurnId",
301970
+ created_at AS "createdAt",
301971
+ updated_at AS "updatedAt",
301972
+ archived_at AS "archivedAt",
301973
+ settled_at AS "settledAt",
301974
+ settled_override AS "settledOverride",
301975
+ latest_user_message_at AS "latestUserMessageAt",
301976
+ pending_approval_count AS "pendingApprovalCount",
301977
+ pending_user_input_count AS "pendingUserInputCount",
301978
+ has_actionable_proposed_plan AS "hasActionableProposedPlan",
301979
+ deleted_at AS "deletedAt",
301980
+ kind,
301981
+ parent_thread_id AS "parentThreadId",
301982
+ anchor_kind AS "anchorKind",
301983
+ anchor_cmmd_id AS "anchorCmmdId",
301984
+ linked_pull_request_json AS "linkedPullRequest",
301985
+ status,
301986
+ worker_role AS "workerRole",
301987
+ goal,
301988
+ pending_auto_create_prompt_json AS "pendingAutoCreatePrompt",
301989
+ COALESCE(rate_limit_status_json, '[]') AS "rateLimitStatus"
301990
+ FROM projection_threads
301991
+ WHERE archived_at IS NOT NULL
301992
+ AND deleted_at IS NULL
301993
+ ORDER BY archived_at DESC, thread_id ASC
301913
301994
  `
301914
301995
  });
301915
301996
  const listThreadMessageRows = findAll({
@@ -302564,13 +302645,22 @@ const makeProjectionSnapshotQuery = require_Schema$1.gen(function* () {
302564
302645
  if (isPersistenceError(error)) return error;
302565
302646
  return toPersistenceSqlError("ProjectionSnapshotQuery.getSnapshot:query")(error);
302566
302647
  }));
302567
- const getShellSnapshot = () => {
302648
+ /**
302649
+ * One snapshot assembly, two selections of threads.
302650
+ *
302651
+ * The active list and the archive differ only in which thread rows they
302652
+ * read, so they share this body. Keeping them on one mapper is the point:
302653
+ * FOR-36394 was a projected column that one path carried and another
302654
+ * dropped, and a second hand-copied assembly here would invite the same
302655
+ * failure for anyone who only remembered to update the active list.
302656
+ */
302657
+ const readShellSnapshot = (operation, listThreads) => {
302568
302658
  return sql.withTransaction(require_Schema$1.all([
302569
- listProjectRows(void 0).pipe(require_Schema$1.mapError(toPersistenceSqlOrDecodeError("ProjectionSnapshotQuery.getShellSnapshot:listProjects:query", "ProjectionSnapshotQuery.getShellSnapshot:listProjects:decodeRows"))),
302570
- listThreadRows(void 0).pipe(require_Schema$1.mapError(toPersistenceSqlOrDecodeError("ProjectionSnapshotQuery.getShellSnapshot:listThreads:query", "ProjectionSnapshotQuery.getShellSnapshot:listThreads:decodeRows"))),
302571
- listThreadSessionRows(void 0).pipe(require_Schema$1.mapError(toPersistenceSqlOrDecodeError("ProjectionSnapshotQuery.getShellSnapshot:listThreadSessions:query", "ProjectionSnapshotQuery.getShellSnapshot:listThreadSessions:decodeRows"))),
302572
- listLatestTurnRows(void 0).pipe(require_Schema$1.mapError(toPersistenceSqlOrDecodeError("ProjectionSnapshotQuery.getShellSnapshot:listLatestTurns:query", "ProjectionSnapshotQuery.getShellSnapshot:listLatestTurns:decodeRows"))),
302573
- listProjectionStateRows(void 0).pipe(require_Schema$1.mapError(toPersistenceSqlOrDecodeError("ProjectionSnapshotQuery.getShellSnapshot:listProjectionState:query", "ProjectionSnapshotQuery.getShellSnapshot:listProjectionState:decodeRows")))
302659
+ listProjectRows(void 0).pipe(require_Schema$1.mapError(toPersistenceSqlOrDecodeError(`ProjectionSnapshotQuery.${operation}:listProjects:query`, `ProjectionSnapshotQuery.${operation}:listProjects:decodeRows`))),
302660
+ listThreads(void 0).pipe(require_Schema$1.mapError(toPersistenceSqlOrDecodeError(`ProjectionSnapshotQuery.${operation}:listThreads:query`, `ProjectionSnapshotQuery.${operation}:listThreads:decodeRows`))),
302661
+ listThreadSessionRows(void 0).pipe(require_Schema$1.mapError(toPersistenceSqlOrDecodeError(`ProjectionSnapshotQuery.${operation}:listThreadSessions:query`, `ProjectionSnapshotQuery.${operation}:listThreadSessions:decodeRows`))),
302662
+ listLatestTurnRows(void 0).pipe(require_Schema$1.mapError(toPersistenceSqlOrDecodeError(`ProjectionSnapshotQuery.${operation}:listLatestTurns:query`, `ProjectionSnapshotQuery.${operation}:listLatestTurns:decodeRows`))),
302663
+ listProjectionStateRows(void 0).pipe(require_Schema$1.mapError(toPersistenceSqlOrDecodeError(`ProjectionSnapshotQuery.${operation}:listProjectionState:query`, `ProjectionSnapshotQuery.${operation}:listProjectionState:decodeRows`)))
302574
302664
  ])).pipe(require_Schema$1.flatMap(([projectRows, threadRows, sessionRows, latestTurnRows, stateRows]) => require_Schema$1.gen(function* () {
302575
302665
  let updatedAt = null;
302576
302666
  for (const row of projectRows) updatedAt = maxIso(updatedAt, row.updatedAt);
@@ -302591,12 +302681,14 @@ const makeProjectionSnapshotQuery = require_Schema$1.gen(function* () {
302591
302681
  projects: projectRows.filter((row) => row.deletedAt === null).map((row) => mapProjectShellRow(row, repositoryIdentities.get(row.projectId) ?? null, projectAvailabilities.get(row.projectId) ?? "unknown")),
302592
302682
  threads: threadShells.filter((thread) => projectIds.has(thread.projectId)),
302593
302683
  updatedAt: updatedAt ?? (/* @__PURE__ */ new Date(0)).toISOString()
302594
- }).pipe(require_Schema$1.mapError(toPersistenceDecodeError("ProjectionSnapshotQuery.getShellSnapshot:decodeShellSnapshot")));
302684
+ }).pipe(require_Schema$1.mapError(toPersistenceDecodeError(`ProjectionSnapshotQuery.${operation}:decodeShellSnapshot`)));
302595
302685
  })), require_Schema$1.mapError((error) => {
302596
302686
  if (isPersistenceError(error)) return error;
302597
- return toPersistenceSqlError("ProjectionSnapshotQuery.getShellSnapshot:query")(error);
302687
+ return toPersistenceSqlError(`ProjectionSnapshotQuery.${operation}:query`)(error);
302598
302688
  }));
302599
302689
  };
302690
+ const getShellSnapshot = () => readShellSnapshot("getShellSnapshot", listThreadRows);
302691
+ const getArchivedShellSnapshot = () => readShellSnapshot("getArchivedShellSnapshot", listArchivedThreadRows);
302600
302692
  const listActiveWorkerShells = () => sql.withTransaction(require_Schema$1.all([
302601
302693
  listActiveWorkerThreadRows(void 0).pipe(require_Schema$1.mapError(toPersistenceSqlOrDecodeError("ProjectionSnapshotQuery.listActiveWorkerShells:listThreads:query", "ProjectionSnapshotQuery.listActiveWorkerShells:listThreads:decodeRows"))),
302602
302694
  listActiveWorkerSessionRows(void 0).pipe(require_Schema$1.mapError(toPersistenceSqlOrDecodeError("ProjectionSnapshotQuery.listActiveWorkerShells:listThreadSessions:query", "ProjectionSnapshotQuery.listActiveWorkerShells:listThreadSessions:decodeRows"))),
@@ -302764,6 +302856,7 @@ const makeProjectionSnapshotQuery = require_Schema$1.gen(function* () {
302764
302856
  return {
302765
302857
  getSnapshot,
302766
302858
  getShellSnapshot,
302859
+ getArchivedShellSnapshot,
302767
302860
  listActiveWorkerShells,
302768
302861
  listStaleRunningSessionShells,
302769
302862
  getCounts,
@@ -306785,7 +306878,6 @@ const cmmdUpdateProjectAgentMemberAvatarRouteLayer = registerProxyRoute({
306785
306878
  });
306786
306879
  //#endregion
306787
306880
  //#region src/command/runtimeProviderAuthorityUpgradeModel.ts
306788
- const GIT_COMMIT = /^[0-9a-f]{40}$/u;
306789
306881
  const AUTHORITY_UPGRADE_OPERATION_KEYS = new Set([
306790
306882
  "operationId",
306791
306883
  "runtimeId",
@@ -306795,7 +306887,7 @@ const AUTHORITY_UPGRADE_OPERATION_KEYS = new Set([
306795
306887
  "attemptCount",
306796
306888
  "expectedCredentialEpoch",
306797
306889
  "resultingCredentialEpoch",
306798
- "targetForgeGitCommit",
306890
+ "targetForgeServerVersion",
306799
306891
  "retryAt",
306800
306892
  "completedAt",
306801
306893
  "failureCode"
@@ -306863,7 +306955,7 @@ function parseRuntimeAuthorityUpgradeOperation(value, expected) {
306863
306955
  Number.isSafeInteger(operation.attemptCount) && operation.attemptCount >= 0,
306864
306956
  operation.expectedCredentialEpoch === 0,
306865
306957
  operation.resultingCredentialEpoch === 1,
306866
- typeof operation.targetForgeGitCommit === "string" && GIT_COMMIT.test(operation.targetForgeGitCommit),
306958
+ isExactForgeServerVersion(operation.targetForgeServerVersion),
306867
306959
  isNullableDateTime(operation.retryAt),
306868
306960
  isNullableDateTime(operation.completedAt),
306869
306961
  operation.failureCode === null || typeof operation.failureCode === "string",
@@ -306880,6 +306972,7 @@ function isLegacyRuntimeConnection(value, expectedRuntimeId) {
306880
306972
  runtime.brokerAuthorityAttestedImageRef === null,
306881
306973
  runtime.brokerAuthorityAttestedImageVersion === null,
306882
306974
  runtime.brokerAuthorityAttestedForgeGitCommit === null,
306975
+ runtime.brokerAuthorityAttestedForgeServerVersion === null,
306883
306976
  runtime.brokerAuthorityAttestedMachineId === null,
306884
306977
  runtime.brokerAuthorityAttestedCredentialEpoch === null,
306885
306978
  runtime.brokerAuthorityAttestedAt === null
@@ -307043,13 +307136,13 @@ function hasTrustedRuntimeRoute(url, trustedBase) {
307043
307136
  const relativePath = url.pathname.slice(trustedPrefix.length);
307044
307137
  return url.origin === trustedBase.origin && url.username === "" && url.password === "" && url.port === "" && url.search === "" && url.hash === "" && url.pathname.startsWith(`${trustedPrefix}/r/`) && RUNTIME_ROUTE_PATH.test(relativePath);
307045
307138
  }
307046
- function hasExactRuntimeConnectionFields(data, runtime, expectedRuntimeId, expectedAttestedForgeGitCommit) {
307047
- return runtime.runtimeId === expectedRuntimeId && runtime.runtimeCapabilityMode === "exact_machine_v2" && isNonEmptyString(runtime.brokerAuthorityAttestedMachineId) && isSafeCredentialEpoch(runtime.brokerAuthorityAttestedCredentialEpoch) && (expectedAttestedForgeGitCommit === void 0 || runtime.brokerAuthorityAttestedForgeGitCommit === expectedAttestedForgeGitCommit) && isNonEmptyString(data.httpBaseUrl) && isNonEmptyString(data.bearerToken);
307139
+ function hasExactRuntimeConnectionFields(data, runtime, expectedRuntimeId, expectedAttestedForgeServerVersion) {
307140
+ return runtime.runtimeId === expectedRuntimeId && runtime.runtimeCapabilityMode === "exact_machine_v2" && isNonEmptyString(runtime.brokerAuthorityAttestedMachineId) && isSafeCredentialEpoch(runtime.brokerAuthorityAttestedCredentialEpoch) && (expectedAttestedForgeServerVersion === void 0 || runtime.brokerAuthorityAttestedForgeServerVersion === expectedAttestedForgeServerVersion) && isNonEmptyString(data.httpBaseUrl) && isNonEmptyString(data.bearerToken);
307048
307141
  }
307049
- function parseRuntimeConnection(value, expectedRuntimeId, trustedRuntimeRouterBaseUrl, expectedAttestedForgeGitCommit) {
307142
+ function parseRuntimeConnection(value, expectedRuntimeId, trustedRuntimeRouterBaseUrl, expectedAttestedForgeServerVersion) {
307050
307143
  const data = asRecord$1(unwrapData(value));
307051
307144
  const runtime = asRecord$1(data?.runtime);
307052
- if (!data || !runtime || !hasExactRuntimeConnectionFields(data, runtime, expectedRuntimeId, expectedAttestedForgeGitCommit)) return null;
307145
+ if (!data || !runtime || !hasExactRuntimeConnectionFields(data, runtime, expectedRuntimeId, expectedAttestedForgeServerVersion)) return null;
307053
307146
  const trustedBase = parseTrustedRuntimeRouterBaseUrl(trustedRuntimeRouterBaseUrl);
307054
307147
  if (!trustedBase) return null;
307055
307148
  let httpBaseUrl;
@@ -307229,7 +307322,7 @@ function classifyInitialConnection(outcome, runtimeId, trustedRuntimeRouterBaseU
307229
307322
  }
307230
307323
  };
307231
307324
  }
307232
- function reconnectExactRuntime(input, targetForgeGitCommit) {
307325
+ function reconnectExactRuntime(input, targetForgeServerVersion) {
307233
307326
  return require_Schema$1.gen(function* () {
307234
307327
  const connectPath = `/api/forge/context/runtimes/${encodeURIComponent(input.runtimeId)}/connect`;
307235
307328
  const reconnected = yield* postRuntimeProviderCmmd({
@@ -307246,7 +307339,7 @@ function reconnectExactRuntime(input, targetForgeGitCommit) {
307246
307339
  error: reconnected.error,
307247
307340
  stage: "reconnect"
307248
307341
  };
307249
- const exact = parseRuntimeConnection(reconnected.value, input.runtimeId, input.trustedRuntimeRouterBaseUrl, targetForgeGitCommit);
307342
+ const exact = parseRuntimeConnection(reconnected.value, input.runtimeId, input.trustedRuntimeRouterBaseUrl, targetForgeServerVersion);
307250
307343
  return exact ? {
307251
307344
  ok: true,
307252
307345
  value: exact
@@ -307257,7 +307350,7 @@ function reconnectExactRuntime(input, targetForgeGitCommit) {
307257
307350
  });
307258
307351
  }
307259
307352
  function resolveOperation(input, operation) {
307260
- return operation.status === "completed" ? reconnectExactRuntime(input, operation.targetForgeGitCommit) : require_Schema$1.succeed(pendingOperation(operation));
307353
+ return operation.status === "completed" ? reconnectExactRuntime(input, operation.targetForgeServerVersion) : require_Schema$1.succeed(pendingOperation(operation));
307261
307354
  }
307262
307355
  function beginExactRuntimeConnection(input) {
307263
307356
  return require_Schema$1.gen(function* () {