@cmmd-center/forge 0.13.82 → 0.13.84

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 (25) hide show
  1. package/dist/bin.cjs +158 -134
  2. package/dist/bin.mjs +242 -213
  3. package/dist/client/assets/{CanvasPanel-AjtGwv2H.js → CanvasPanel-Dyho_JDo.js} +2 -2
  4. package/dist/client/assets/{CompositeItem-B_Qce_Zi.js → CompositeItem-DeDhuBZB.js} +2 -2
  5. package/dist/client/assets/{DiffPanel-B47H2Ztq.js → DiffPanel-B4iZmA47.js} +3 -3
  6. package/dist/client/assets/{DiffPanel.logic-DT4FolWZ.js → DiffPanel.logic-BpahIUC5.js} +4 -4
  7. package/dist/client/assets/{DiffWorkerPoolProvider-BrgXjqS5.js → DiffWorkerPoolProvider-CZ4RyCYi.js} +30 -30
  8. package/dist/client/assets/PullRequestCodePanel-CKRAtq2X.js +5 -0
  9. package/dist/client/assets/Virtualizer-CDLGfmSn.js +2 -0
  10. package/dist/client/assets/WorkerPoolContext--cbYuhHG.js +2537 -0
  11. package/dist/client/assets/{canvasStateStore-BpKdB-dM.js → canvasStateStore-DJ_OzrrC.js} +2 -2
  12. package/dist/client/assets/cmmdAuthRedirect-Bqx90tp9.js +3 -0
  13. package/dist/client/assets/index-pi7gtd2m.js +153 -0
  14. package/dist/client/assets/{popover-RLwH5jQy.js → popover-D20eY2oM.js} +2 -2
  15. package/dist/client/assets/{src-IM0FnQax.js → src-CoTxmdk3.js} +2 -2
  16. package/dist/client/assets/{toggle-BUzYChlq.js → toggle-AqC0QUc1.js} +2 -2
  17. package/dist/client/index.html +10 -10
  18. package/dist/forge-build.json +1 -1
  19. package/dist/{open-2-reBrpv.mjs → open-yHTUkd2Y.mjs} +3 -3
  20. package/package.json +1 -1
  21. package/dist/client/assets/DiffPanelShell-DYfYdx6r.js +0 -2537
  22. package/dist/client/assets/PullRequestCodePanel-3MHkasTp.js +0 -5
  23. package/dist/client/assets/Virtualizer-BF72qd4z.js +0 -2
  24. package/dist/client/assets/cmmdAuthRedirect-lzr9SGGx.js +0 -2
  25. package/dist/client/assets/index-jjmPqZtL.js +0 -154
package/dist/bin.cjs CHANGED
@@ -19806,6 +19806,15 @@ const BrowserConsoleLogsCommand = require_Schema$1.Struct({
19806
19806
  limit: require_Schema$1.optional(require_Schema$1.Number),
19807
19807
  levels: require_Schema$1.optional(require_Schema$1.ArraySchema(BrowserConsoleLogLevel))
19808
19808
  });
19809
+ /**
19810
+ * Mute or unmute one tab's audio. A desktop-native concern: the real
19811
+ * webContents live in the desktop shell's browser view, so this command is
19812
+ * only issued over the desktop bridge, never through the server channel.
19813
+ */
19814
+ const BrowserSetAudioMutedCommand = require_Schema$1.Struct({
19815
+ type: require_Schema$1.Literal("setAudioMuted"),
19816
+ muted: require_Schema$1.Boolean
19817
+ });
19809
19818
  const BrowserCommand = require_Schema$1.Union([
19810
19819
  BrowserNavigateCommand,
19811
19820
  BrowserNewTabCommand,
@@ -19826,6 +19835,7 @@ const BrowserCommand = require_Schema$1.Union([
19826
19835
  BrowserSetViewportCommand,
19827
19836
  BrowserResetViewportCommand,
19828
19837
  BrowserSetVisibilityCommand,
19838
+ BrowserSetAudioMutedCommand,
19829
19839
  BrowserNameSessionCommand,
19830
19840
  BrowserConsoleLogsCommand
19831
19841
  ]);
@@ -66275,7 +66285,7 @@ function normalizeNumberish(value) {
66275
66285
  }
66276
66286
  //#endregion
66277
66287
  //#region package.json
66278
- var version$1 = "0.13.82";
66288
+ var version$1 = "0.13.84";
66279
66289
  //#endregion
66280
66290
  //#region src/sentry.ts
66281
66291
  const SERVER_APP_NAME = "forge-server";
@@ -80176,10 +80186,7 @@ function dedupeChecks(entries) {
80176
80186
  for (const entry of survivors) countsByName.set(entry.check.name, (countsByName.get(entry.check.name) ?? 0) + 1);
80177
80187
  return survivors.map((entry) => {
80178
80188
  const workflowName = entry.workflowName ?? "";
80179
- return workflowName.length > 0 && (countsByName.get(entry.check.name) ?? 0) > 1 ? {
80180
- ...entry.check,
80181
- name: `${workflowName} / ${entry.check.name}`
80182
- } : entry.check;
80189
+ return workflowName.length > 0 && (countsByName.get(entry.check.name) ?? 0) > 1 ? Object.assign({}, entry.check, { name: `${workflowName} / ${entry.check.name}` }) : entry.check;
80183
80190
  });
80184
80191
  }
80185
80192
  //#endregion
@@ -87555,13 +87562,8 @@ const make$21 = require_Schema$1.gen(function* () {
87555
87562
  author: withAvatar(pullRequest.author, reviewThreads.avatarsByLogin, input.host),
87556
87563
  reviewers: reviewThreads.reviewers,
87557
87564
  reactions: reviewThreads.reactions,
87558
- commits: (reviewThreads.commits.length > 0 ? reviewThreads.commits : pullRequest.commits).map((commit) => ({
87559
- ...commit,
87560
- ...reviewThreads.commitStats.get(commit.oid),
87561
- authors: commit.authors?.map((author) => withAvatar(author, reviewThreads.avatarsByLogin, input.host) ?? author)
87562
- })),
87563
- comments: [...pullRequest.comments, ...reviewThreads.comments].map((comment) => ({
87564
- ...comment,
87565
+ commits: (reviewThreads.commits.length > 0 ? reviewThreads.commits : pullRequest.commits).map((commit) => Object.assign({}, commit, reviewThreads.commitStats.get(commit.oid), { authors: commit.authors?.map((author) => withAvatar(author, reviewThreads.avatarsByLogin, input.host) ?? author) })),
87566
+ comments: [...pullRequest.comments, ...reviewThreads.comments].map((comment) => Object.assign({}, comment, {
87565
87567
  body: comment.kind === "review" && comment.reviewState?.toUpperCase() === "DISMISSED" && rendersEmpty(comment.body) ? reviewThreads.dismissalsByReviewId.get(comment.id) ?? comment.body : comment.body,
87566
87568
  author: withAvatar(comment.author, reviewThreads.avatarsByLogin, input.host),
87567
87569
  reactions: comment.reactions ?? reviewThreads.reactionsById.get(comment.id) ?? []
@@ -151788,7 +151790,7 @@ const OPENAI_PROXY_ENV_KEYS = ["OPENAI_API_KEY", "OPENAI_BASE_URL"];
151788
151790
  function personalCodexServedByControlPlane(env = process.env) {
151789
151791
  return env.FORGE_CMMD_RUNTIME_MODE === "true" && env.FORGE_PERSONAL_CODEX_VIA_EGRESS === "true";
151790
151792
  }
151791
- function resolveCodexAccessMode(input) {
151793
+ function resolveCodexAccessMode$1(input) {
151792
151794
  if (clampWorkspaceAccessMode(input.accessMode) === "workspace") return "workspace";
151793
151795
  if (personalCodexServedByControlPlane(input.env ?? process.env)) return "workspace";
151794
151796
  if (!input.hasCodexChatGptLogin()) throw personalCodexAuthError("This runtime is not signed in to ChatGPT. Open Settings > Providers and connect ChatGPT on this runtime.");
@@ -153506,7 +153508,7 @@ var CodexAppServerManager = class extends node_events.EventEmitter {
153506
153508
  cwd: resolvedCwd,
153507
153509
  ...codexHomePath ? { homePath: codexHomePath } : {}
153508
153510
  });
153509
- const accessMode = resolveCodexAccessMode({
153511
+ const accessMode = resolveCodexAccessMode$1({
153510
153512
  accessMode: input.accessMode ?? "workspace",
153511
153513
  hasCodexChatGptLogin: () => hasCodexChatGptLogin({
153512
153514
  binaryPath: codexBinaryPath,
@@ -223465,6 +223467,9 @@ const makeTerminationError = (handle) => require_Schema$1.match(handle.exitCode,
223465
223467
  });
223466
223468
  //#endregion
223467
223469
  //#region ../../packages/effect-acp/src/client.ts
223470
+ function runNotificationHandlers(registration, notification) {
223471
+ return require_Schema$1.forEach(registration.handlers, (handler) => handler(notification).pipe(require_Schema$1.catch_(() => require_Schema$1.void_)), { discard: true });
223472
+ }
223468
223473
  var AcpClient = class extends require_Schema$1.Service()("effect-acp/AcpClient") {};
223469
223474
  const make$12 = require_Schema$1.fn("effect-acp/AcpClient.make")(function* (stdio, options = {}, terminationError) {
223470
223475
  const coreHandlers = {};
@@ -223482,7 +223487,6 @@ const make$12 = require_Schema$1.fn("effect-acp/AcpClient.make")(function* (stdi
223482
223487
  const extNotificationHandlers = /* @__PURE__ */ new Map();
223483
223488
  let unknownExtRequestHandler;
223484
223489
  let unknownExtNotificationHandler;
223485
- const runNotificationHandlers = (registration, notification) => require_Schema$1.forEach(registration.handlers, (handler) => handler(notification).pipe(require_Schema$1.catch_(() => require_Schema$1.void_)), { discard: true });
223486
223490
  const flushBufferedNotifications = (registration) => require_Schema$1.suspend$1(() => {
223487
223491
  if (registration.handlers.length === 0 || registration.pending.length === 0) return require_Schema$1.void_;
223488
223492
  const pending = registration.pending.splice(0, registration.pending.length);
@@ -237727,6 +237731,34 @@ const CodexProviderLive = require_Schema$1.effect(CodexProvider, require_Schema$
237727
237731
  //#region src/git/Layers/CodexTextGeneration.ts
237728
237732
  const CODEX_GIT_TEXT_GENERATION_REASONING_EFFORT = "low";
237729
237733
  const CODEX_TIMEOUT_MS = 18e4;
237734
+ const readCodexStreamAsString = (operation, stream) => stream.pipe(require_Path.decodeText(), require_Path.runFold(() => "", (acc, chunk) => acc + chunk), require_Schema$1.mapError((cause) => normalizeCliError("codex", operation, cause, "Failed to collect process output")));
237735
+ function buildCodexExecArgs(input) {
237736
+ return [
237737
+ "exec",
237738
+ "--ephemeral",
237739
+ "--skip-git-repo-check",
237740
+ "-s",
237741
+ "read-only",
237742
+ "--model",
237743
+ input.model,
237744
+ "--config",
237745
+ `model_reasoning_effort="${input.reasoningEffort}"`,
237746
+ "--config",
237747
+ `project_doc_max_bytes=${CODEX_PROJECT_DOC_MAX_BYTES}`,
237748
+ ...input.fastMode ? ["--config", `service_tier="fast"`] : [],
237749
+ "--output-schema",
237750
+ input.schemaPath,
237751
+ "--output-last-message",
237752
+ input.outputPath,
237753
+ "--json",
237754
+ ...input.imagePaths.flatMap((imagePath) => ["--image", imagePath]),
237755
+ "-"
237756
+ ];
237757
+ }
237758
+ function resolveCodexAccessMode(configuredAccessMode) {
237759
+ const accessMode = clampWorkspaceAccessMode(configuredAccessMode);
237760
+ return accessMode === "personal" && personalCodexServedByControlPlane() ? "workspace" : accessMode;
237761
+ }
237730
237762
  /**
237731
237763
  * Byte budget Codex spends on `AGENTS.md` when it builds project instructions.
237732
237764
  * The Codex config reference defines `project_doc_max_bytes` as "Maximum bytes
@@ -237748,7 +237780,6 @@ const makeCodexTextGeneration = require_Schema$1.gen(function* () {
237748
237780
  const serverConfig = yield* require_Schema$1.service(ServerConfig);
237749
237781
  const serverSettingsService = yield* require_Schema$1.service(ServerSettingsService);
237750
237782
  const textGenerationUsage = yield* require_Schema$1.service(TextGenerationUsage);
237751
- const readStreamAsString = (operation, stream) => stream.pipe(require_Path.decodeText(), require_Path.runFold(() => "", (acc, chunk) => acc + chunk), require_Schema$1.mapError((cause) => normalizeCliError("codex", operation, cause, "Failed to collect process output")));
237752
237783
  const writeTempFile = (operation, prefix, content) => {
237753
237784
  return fileSystem.makeTempFileScoped({ prefix: `forge-${prefix}-${process.pid}-${(0, node_crypto.randomUUID)()}.tmp` }).pipe(require_Schema$1.tap((filePath) => fileSystem.writeFileString(filePath, content)), require_Schema$1.mapError((cause) => new TextGenerationError({
237754
237785
  operation,
@@ -237836,39 +237867,47 @@ const makeCodexTextGeneration = require_Schema$1.gen(function* () {
237836
237867
  const outputPath = yield* writeTempFile(operation, "codex-output", "");
237837
237868
  const workingDirectory = yield* makeNeutralWorkingDirectory(operation);
237838
237869
  const codexSettings = yield* require_Schema$1.map(serverSettingsService.getSettings, (settings) => settings.providers.codex).pipe(require_Schema$1.catch_(() => require_Schema$1.undefined_));
237839
- const runCodexCommand = require_Schema$1.fn("runCodexJson.runCodexCommand")(function* () {
237870
+ const launchCodexCommand = (command) => require_Schema$1.gen(function* () {
237871
+ const child = yield* commandSpawner.spawn(command).pipe(require_Schema$1.mapError((cause) => normalizeCliError("codex", operation, cause, "Failed to spawn Codex CLI process")));
237872
+ const [stdout, stderr, exitCode] = yield* require_Schema$1.all([
237873
+ readCodexStreamAsString(operation, child.stdout),
237874
+ readCodexStreamAsString(operation, child.stderr),
237875
+ child.exitCode.pipe(require_Schema$1.mapError((cause) => normalizeCliError("codex", operation, cause, "Failed to read Codex CLI exit code")))
237876
+ ], { concurrency: "unbounded" });
237877
+ if (exitCode === 0) return stdout;
237878
+ const detail = stderr.trim() || stdout.trim();
237879
+ return yield* new TextGenerationError({
237880
+ operation,
237881
+ detail: detail.length > 0 ? `Codex CLI command failed: ${detail}` : `Codex CLI command failed with code ${exitCode}.`
237882
+ });
237883
+ });
237884
+ const resolveCodexCommandTarget = require_Schema$1.fn("runCodexJson.resolveCommandTarget")(function* () {
237840
237885
  const normalizedOptions = normalizeCodexModelOptionsWithCapabilities(getCodexModelCapabilities(modelSelection.model), modelSelection.options);
237841
237886
  const reasoningEffort = modelSelection.options?.reasoningEffort ?? CODEX_GIT_TEXT_GENERATION_REASONING_EFFORT;
237842
- const clampedAccessMode = clampWorkspaceAccessMode(codexSettings?.accessMode ?? "workspace");
237843
- const accessMode = clampedAccessMode === "personal" && personalCodexServedByControlPlane() ? "workspace" : clampedAccessMode;
237844
- const providerProxyToken = yield* resolveCodexProviderProxyToken({
237845
- operation,
237887
+ const accessMode = resolveCodexAccessMode(codexSettings?.accessMode ?? "workspace");
237888
+ return {
237889
+ normalizedOptions,
237890
+ reasoningEffort,
237846
237891
  accessMode,
237892
+ providerProxyToken: yield* resolveCodexProviderProxyToken({
237893
+ operation,
237894
+ accessMode,
237895
+ model: modelSelection.model,
237896
+ ...threadId ? { threadId } : {},
237897
+ authSessionId
237898
+ })
237899
+ };
237900
+ });
237901
+ const runCodexCommand = require_Schema$1.fn("runCodexJson.runCodexCommand")(function* () {
237902
+ const { normalizedOptions, reasoningEffort, accessMode, providerProxyToken } = yield* resolveCodexCommandTarget();
237903
+ return yield* launchCodexCommand(require_NodeTerminal.make$2(codexSettings?.binaryPath || "codex", buildCodexExecArgs({
237847
237904
  model: modelSelection.model,
237848
- ...threadId ? { threadId } : {},
237849
- authSessionId
237850
- });
237851
- const command = require_NodeTerminal.make$2(codexSettings?.binaryPath || "codex", [
237852
- "exec",
237853
- "--ephemeral",
237854
- "--skip-git-repo-check",
237855
- "-s",
237856
- "read-only",
237857
- "--model",
237858
- modelSelection.model,
237859
- "--config",
237860
- `model_reasoning_effort="${reasoningEffort}"`,
237861
- "--config",
237862
- `project_doc_max_bytes=${CODEX_PROJECT_DOC_MAX_BYTES}`,
237863
- ...normalizedOptions?.fastMode ? ["--config", `service_tier="fast"`] : [],
237864
- "--output-schema",
237905
+ reasoningEffort,
237906
+ fastMode: normalizedOptions?.fastMode,
237865
237907
  schemaPath,
237866
- "--output-last-message",
237867
237908
  outputPath,
237868
- "--json",
237869
- ...imagePaths.flatMap((imagePath) => ["--image", imagePath]),
237870
- "-"
237871
- ], {
237909
+ imagePaths
237910
+ }), {
237872
237911
  env: scrubForgeProviderChildEnvSecrets(buildCodexProcessEnv({
237873
237912
  baseEnv: process.env,
237874
237913
  accessMode,
@@ -237881,23 +237920,7 @@ const makeCodexTextGeneration = require_Schema$1.gen(function* () {
237881
237920
  cwd: workingDirectory,
237882
237921
  shell: process.platform === "win32",
237883
237922
  stdin: { stream: require_Path.encodeText(require_Path.make$1(prompt)) }
237884
- });
237885
- const child = yield* commandSpawner.spawn(command).pipe(require_Schema$1.mapError((cause) => normalizeCliError("codex", operation, cause, "Failed to spawn Codex CLI process")));
237886
- const [stdout, stderr, exitCode] = yield* require_Schema$1.all([
237887
- readStreamAsString(operation, child.stdout),
237888
- readStreamAsString(operation, child.stderr),
237889
- child.exitCode.pipe(require_Schema$1.mapError((cause) => normalizeCliError("codex", operation, cause, "Failed to read Codex CLI exit code")))
237890
- ], { concurrency: "unbounded" });
237891
- if (exitCode !== 0) {
237892
- const stderrDetail = stderr.trim();
237893
- const stdoutDetail = stdout.trim();
237894
- const detail = stderrDetail.length > 0 ? stderrDetail : stdoutDetail;
237895
- return yield* new TextGenerationError({
237896
- operation,
237897
- detail: detail.length > 0 ? `Codex CLI command failed: ${detail}` : `Codex CLI command failed with code ${exitCode}.`
237898
- });
237899
- }
237900
- return stdout;
237923
+ }));
237901
237924
  });
237902
237925
  const cleanup = require_Schema$1.all([...[
237903
237926
  schemaPath,
@@ -238037,6 +238060,7 @@ const CodexTextGenerationLive = require_Schema$1.effect(TextGeneration, makeCode
238037
238060
  * @module ClaudeTextGeneration
238038
238061
  */
238039
238062
  const CLAUDE_TIMEOUT_MS = 18e4;
238063
+ const readClaudeStreamAsString = (operation, stream) => stream.pipe(require_Path.decodeText(), require_Path.runFold(() => "", (acc, chunk) => acc + chunk), require_Schema$1.mapError((cause) => normalizeCliError("claude", operation, cause, "Failed to collect process output")));
238040
238064
  /**
238041
238065
  * Schema for the wrapper JSON returned by `claude -p --output-format json`.
238042
238066
  * We only care about `structured_output`.
@@ -238072,7 +238096,6 @@ const makeClaudeTextGeneration = require_Schema$1.gen(function* () {
238072
238096
  ...report.providerSessionId ? { providerSessionId: report.providerSessionId } : {}
238073
238097
  });
238074
238098
  });
238075
- const readStreamAsString = (operation, stream) => stream.pipe(require_Path.decodeText(), require_Path.runFold(() => "", (acc, chunk) => acc + chunk), require_Schema$1.mapError((cause) => normalizeCliError("claude", operation, cause, "Failed to collect process output")));
238076
238099
  /**
238077
238100
  * Spawn the Claude CLI with structured JSON output and return the parsed,
238078
238101
  * schema-validated result.
@@ -238105,8 +238128,8 @@ const makeClaudeTextGeneration = require_Schema$1.gen(function* () {
238105
238128
  });
238106
238129
  const child = yield* commandSpawner.spawn(command).pipe(require_Schema$1.mapError((cause) => normalizeCliError("claude", operation, cause, "Failed to spawn Claude CLI process")));
238107
238130
  const [stdout, stderr, exitCode] = yield* require_Schema$1.all([
238108
- readStreamAsString(operation, child.stdout),
238109
- readStreamAsString(operation, child.stderr),
238131
+ readClaudeStreamAsString(operation, child.stdout),
238132
+ readClaudeStreamAsString(operation, child.stderr),
238110
238133
  child.exitCode.pipe(require_Schema$1.mapError((cause) => normalizeCliError("claude", operation, cause, "Failed to read Claude CLI exit code")))
238111
238134
  ], { concurrency: "unbounded" });
238112
238135
  if (exitCode !== 0) {
@@ -238503,6 +238526,21 @@ var TerminalProcessSignalError = class extends require_Schema$1.TaggedErrorClass
238503
238526
  cause: require_Schema$1.optional(require_Schema$1.Defect),
238504
238527
  signal: require_Schema$1.Literals(["SIGTERM", "SIGKILL"])
238505
238528
  }) {};
238529
+ function toTerminalHistoryError(operation, threadId, terminalId) {
238530
+ return (cause) => new TerminalHistoryError({
238531
+ operation,
238532
+ threadId,
238533
+ terminalId,
238534
+ cause
238535
+ });
238536
+ }
238537
+ function requireRunningProcess(session) {
238538
+ if (session.process && session.status === "running") return require_Schema$1.succeed(session.process);
238539
+ return require_Schema$1.fail(new TerminalNotRunningError({
238540
+ threadId: session.threadId,
238541
+ terminalId: session.terminalId
238542
+ }));
238543
+ }
238506
238544
  const MAX_TERMINAL_CONTROL_RECEIPTS = 256;
238507
238545
  function terminalControlPayloadHash(method, payload) {
238508
238546
  return (0, node_crypto.createHash)("sha256").update(method).update("\0").update(payload).digest("base64url");
@@ -238948,12 +238986,6 @@ const makeTerminalManagerWithOptions = require_Schema$1.fn("makeTerminalManagerW
238948
238986
  return node_path.default.join(logsDir, `${threadPart}_${toSafeTerminalId(terminalId)}.log`);
238949
238987
  };
238950
238988
  const legacyHistoryPath = (threadId) => node_path.default.join(logsDir, `${legacySafeThreadId(threadId)}.log`);
238951
- const toTerminalHistoryError = (operation, threadId, terminalId) => (cause) => new TerminalHistoryError({
238952
- operation,
238953
- threadId,
238954
- terminalId,
238955
- cause
238956
- });
238957
238989
  const readManagerState = get$2(managerStateRef);
238958
238990
  const modifyManagerState = (f) => modify$2(managerStateRef, f);
238959
238991
  const getThreadSemaphore = (threadId) => modifyEffect(threadLocksRef, (current) => {
@@ -239616,13 +239648,6 @@ const makeTerminalManagerWithOptions = require_Schema$1.fn("makeTerminalManagerW
239616
239648
  transitionReceipts.delete(oldest);
239617
239649
  }
239618
239650
  };
239619
- const requireRunningProcess = (session) => {
239620
- if (session.process && session.status === "running") return require_Schema$1.succeed(session.process);
239621
- return require_Schema$1.fail(new TerminalNotRunningError({
239622
- threadId: session.threadId,
239623
- terminalId: session.terminalId
239624
- }));
239625
- };
239626
239651
  const write = require_Schema$1.fn("terminal.write")(function* (input) {
239627
239652
  const terminalId = input.terminalId ?? "default";
239628
239653
  const session = yield* requireSession(input.threadId, terminalId);
@@ -242271,6 +242296,9 @@ const HOST_COMMAND_MAPPERS = {
242271
242296
  ...command.x !== void 0 ? { x: command.x } : {},
242272
242297
  ...command.y !== void 0 ? { y: command.y } : {}
242273
242298
  }),
242299
+ setAudioMuted: () => {
242300
+ throw new Error("setAudioMuted is only supported over the desktop native browser bridge.");
242301
+ },
242274
242302
  setViewport: (command) => ({
242275
242303
  type: "setViewport",
242276
242304
  viewport: command.viewport
@@ -292599,7 +292627,7 @@ function mapProviderSessionStatusToOrchestrationStatus(status) {
292599
292627
  }
292600
292628
  }
292601
292629
  const turnStartKeyForEvent = (event) => event.commandId !== null ? `command:${event.commandId}` : `event:${event.eventId}`;
292602
- const serverCommandId$1 = (tag) => CommandId.make(`server:${tag}:${crypto.randomUUID()}`);
292630
+ const serverCommandId$2 = (tag) => CommandId.make(`server:${tag}:${crypto.randomUUID()}`);
292603
292631
  const HANDLED_TURN_START_KEY_MAX = 1e4;
292604
292632
  const HANDLED_TURN_START_KEY_TTL = require_Schema$1.minutes(30);
292605
292633
  const DEFAULT_RUNTIME_MODE = "full-access";
@@ -293021,7 +293049,7 @@ const make$8 = require_Schema$1.gen(function* () {
293021
293049
  const threadSessionAccountIds = /* @__PURE__ */ new Map();
293022
293050
  const appendProviderFailureActivity = (input) => orchestrationEngine.dispatch({
293023
293051
  type: "thread.activity.append",
293024
- commandId: serverCommandId$1("provider-failure-activity"),
293052
+ commandId: serverCommandId$2("provider-failure-activity"),
293025
293053
  threadId: input.threadId,
293026
293054
  activity: {
293027
293055
  id: EventId.make(crypto.randomUUID()),
@@ -293039,7 +293067,7 @@ const make$8 = require_Schema$1.gen(function* () {
293039
293067
  });
293040
293068
  const setThreadSession = (input) => orchestrationEngine.dispatch({
293041
293069
  type: "thread.session.set",
293042
- commandId: serverCommandId$1("provider-session-set"),
293070
+ commandId: serverCommandId$2("provider-session-set"),
293043
293071
  threadId: input.threadId,
293044
293072
  session: input.session,
293045
293073
  createdAt: input.createdAt
@@ -293322,7 +293350,7 @@ const make$8 = require_Schema$1.gen(function* () {
293322
293350
  });
293323
293351
  yield* orchestrationEngine.dispatch({
293324
293352
  type: "thread.meta.update",
293325
- commandId: serverCommandId$1("worktree-branch-rename"),
293353
+ commandId: serverCommandId$2("worktree-branch-rename"),
293326
293354
  threadId: input.threadId,
293327
293355
  branch: renamed.branch,
293328
293356
  worktreePath: cwd
@@ -293361,7 +293389,7 @@ const make$8 = require_Schema$1.gen(function* () {
293361
293389
  if (!canReplaceThreadTitle(thread.title, input.titleSeed)) return;
293362
293390
  yield* orchestrationEngine.dispatch({
293363
293391
  type: "thread.meta.update",
293364
- commandId: serverCommandId$1("thread-title-rename"),
293392
+ commandId: serverCommandId$2("thread-title-rename"),
293365
293393
  threadId: input.threadId,
293366
293394
  title: generated.title
293367
293395
  });
@@ -293424,7 +293452,7 @@ const make$8 = require_Schema$1.gen(function* () {
293424
293452
  const dispatchThreadTitleRegenerationCompletion = require_Schema$1.fn("dispatchThreadTitleRegenerationCompletion")(function* (input) {
293425
293453
  yield* orchestrationEngine.dispatch({
293426
293454
  type: "thread.title.regeneration.complete",
293427
- commandId: serverCommandId$1("thread-title-regeneration-complete"),
293455
+ commandId: serverCommandId$2("thread-title-regeneration-complete"),
293428
293456
  threadId: input.threadId,
293429
293457
  requestId: input.requestId,
293430
293458
  ...input.title !== void 0 ? { title: input.title } : {}
@@ -293733,7 +293761,7 @@ const make$8 = require_Schema$1.gen(function* () {
293733
293761
  });
293734
293762
  const appendRecoverableTurnStartTimeout = (event) => orchestrationEngine.dispatch({
293735
293763
  type: "thread.activity.append",
293736
- commandId: serverCommandId$1("provider-turn-start-timeout"),
293764
+ commandId: serverCommandId$2("provider-turn-start-timeout"),
293737
293765
  threadId: event.payload.threadId,
293738
293766
  activity: {
293739
293767
  id: EventId.make(crypto.randomUUID()),
@@ -294567,7 +294595,13 @@ function isGitOutputLimitError(error) {
294567
294595
  const text = `${"detail" in error && typeof error.detail === "string" ? error.detail : ""}\n${"message" in error && typeof error.message === "string" ? error.message : ""}`;
294568
294596
  return text.includes("output exceeded") && text.includes("bytes and was truncated");
294569
294597
  }
294570
- const serverCommandId = (tag) => CommandId.make(`server:${tag}:${crypto.randomUUID()}`);
294598
+ const serverCommandId$1 = (tag) => CommandId.make(`server:${tag}:${crypto.randomUUID()}`);
294599
+ function findSessionWithCwd(session) {
294600
+ return session?.cwd ? require_Schema$1.some({
294601
+ threadId: session.threadId,
294602
+ cwd: session.cwd
294603
+ }) : require_Schema$1.none();
294604
+ }
294571
294605
  const make$7 = require_Schema$1.gen(function* () {
294572
294606
  const orchestrationEngine = yield* OrchestrationEngineService;
294573
294607
  const providerService = yield* ProviderService;
@@ -294577,7 +294611,7 @@ const make$7 = require_Schema$1.gen(function* () {
294577
294611
  const gitStatusBroadcaster = yield* GitStatusBroadcaster;
294578
294612
  const appendRevertFailureActivity = (input) => orchestrationEngine.dispatch({
294579
294613
  type: "thread.activity.append",
294580
- commandId: serverCommandId("checkpoint-revert-failure"),
294614
+ commandId: serverCommandId$1("checkpoint-revert-failure"),
294581
294615
  threadId: input.threadId,
294582
294616
  activity: {
294583
294617
  id: EventId.make(crypto.randomUUID()),
@@ -294595,7 +294629,7 @@ const make$7 = require_Schema$1.gen(function* () {
294595
294629
  });
294596
294630
  const appendCaptureFailureActivity = (input) => orchestrationEngine.dispatch({
294597
294631
  type: "thread.activity.append",
294598
- commandId: serverCommandId("checkpoint-capture-failure"),
294632
+ commandId: serverCommandId$1("checkpoint-capture-failure"),
294599
294633
  threadId: input.threadId,
294600
294634
  activity: {
294601
294635
  id: EventId.make(crypto.randomUUID()),
@@ -294613,7 +294647,7 @@ const make$7 = require_Schema$1.gen(function* () {
294613
294647
  });
294614
294648
  const appendDiffSummarySkippedActivity = (input) => orchestrationEngine.dispatch({
294615
294649
  type: "thread.activity.append",
294616
- commandId: serverCommandId("checkpoint-diff-summary-skipped"),
294650
+ commandId: serverCommandId$1("checkpoint-diff-summary-skipped"),
294617
294651
  threadId: input.threadId,
294618
294652
  activity: {
294619
294653
  id: EventId.make(crypto.randomUUID()),
@@ -294629,20 +294663,12 @@ const make$7 = require_Schema$1.gen(function* () {
294629
294663
  const resolveSessionRuntimeForThread = require_Schema$1.fn("resolveSessionRuntimeForThread")(function* (threadId) {
294630
294664
  const thread = (yield* orchestrationEngine.getReadModel()).threads.find((entry) => entry.id === threadId);
294631
294665
  const sessions = yield* providerService.listSessions();
294632
- const findSessionWithCwd = (session) => {
294633
- if (!session?.cwd) return require_Schema$1.none();
294634
- return require_Schema$1.some({
294635
- threadId: session.threadId,
294636
- cwd: session.cwd
294637
- });
294638
- };
294639
294666
  if (thread) {
294640
294667
  const fromProjected = findSessionWithCwd(sessions.find((session) => session.threadId === thread.id));
294641
294668
  if (require_Schema$1.isSome(fromProjected)) return fromProjected;
294642
294669
  }
294643
294670
  return require_Schema$1.none();
294644
294671
  });
294645
- const isGitWorkspace = (cwd) => isGitRepository(cwd);
294646
294672
  const resolveCheckpointCwd = require_Schema$1.fn("resolveCheckpointCwd")(function* (input) {
294647
294673
  const fromSession = yield* resolveSessionRuntimeForThread(input.threadId);
294648
294674
  const fromThread = resolveThreadWorkspaceCwd({
@@ -294657,7 +294683,7 @@ const make$7 = require_Schema$1.gen(function* () {
294657
294683
  onSome: (runtime) => runtime.cwd
294658
294684
  });
294659
294685
  if (!cwd) return;
294660
- if (!isGitWorkspace(cwd)) return;
294686
+ if (!isGitRepository(cwd)) return;
294661
294687
  return cwd;
294662
294688
  });
294663
294689
  const captureAndDispatchCheckpoint = require_Schema$1.fn("captureAndDispatchCheckpoint")(function* (input) {
@@ -294717,7 +294743,7 @@ const make$7 = require_Schema$1.gen(function* () {
294717
294743
  const assistantMessageId = input.assistantMessageId ?? input.thread.messages.toReversed().find((entry) => entry.role === "assistant" && entry.turnId === input.turnId)?.id ?? MessageId.make(`assistant:${input.turnId}`);
294718
294744
  yield* orchestrationEngine.dispatch({
294719
294745
  type: "thread.turn.diff.complete",
294720
- commandId: serverCommandId("checkpoint-turn-diff-complete"),
294746
+ commandId: serverCommandId$1("checkpoint-turn-diff-complete"),
294721
294747
  threadId: input.threadId,
294722
294748
  turnId: input.turnId,
294723
294749
  completedAt: input.createdAt,
@@ -294746,7 +294772,7 @@ const make$7 = require_Schema$1.gen(function* () {
294746
294772
  });
294747
294773
  yield* orchestrationEngine.dispatch({
294748
294774
  type: "thread.activity.append",
294749
- commandId: serverCommandId("checkpoint-captured-activity"),
294775
+ commandId: serverCommandId$1("checkpoint-captured-activity"),
294750
294776
  threadId: input.threadId,
294751
294777
  activity: {
294752
294778
  id: EventId.make(crypto.randomUUID()),
@@ -294928,7 +294954,7 @@ const make$7 = require_Schema$1.gen(function* () {
294928
294954
  }).pipe(require_Schema$1.catch_(() => require_Schema$1.void_));
294929
294955
  return;
294930
294956
  }
294931
- if (!isGitWorkspace(sessionRuntime.value.cwd)) {
294957
+ if (!isGitRepository(sessionRuntime.value.cwd)) {
294932
294958
  yield* appendRevertFailureActivity({
294933
294959
  threadId: event.payload.threadId,
294934
294960
  turnCount: event.payload.turnCount,
@@ -294984,7 +295010,7 @@ const make$7 = require_Schema$1.gen(function* () {
294984
295010
  });
294985
295011
  yield* orchestrationEngine.dispatch({
294986
295012
  type: "thread.revert.complete",
294987
- commandId: serverCommandId("checkpoint-revert-complete"),
295013
+ commandId: serverCommandId$1("checkpoint-revert-complete"),
294988
295014
  threadId: event.payload.threadId,
294989
295015
  turnCount: event.payload.turnCount,
294990
295016
  createdAt: now
@@ -299323,7 +299349,7 @@ function resolveBuildCommitFromEnv(env) {
299323
299349
  * environment descriptor down instead of reporting an honest "unknown".
299324
299350
  */
299325
299351
  function readBakedBuildCommit() {
299326
- return "ead85bde2f90454fa6699c98fddcff9d86f6de37";
299352
+ return "c9cd5df237295bb4b5d502b6d379c1b9cbd1bf8f";
299327
299353
  }
299328
299354
  async function resolveServerBuildCommit(input) {
299329
299355
  if (isFullCommitSha(input.baked)) return input.baked;
@@ -300720,6 +300746,15 @@ var AuthPairingLinkRepository = class extends require_Schema$1.Service()("forge/
300720
300746
  function toPersistenceSqlOrDecodeError$4(sqlOperation, decodeOperation) {
300721
300747
  return (cause) => require_Schema$1.isSchemaError(cause) ? toPersistenceDecodeError(decodeOperation)(cause) : toPersistenceSqlError(sqlOperation)(cause);
300722
300748
  }
300749
+ function decodeCredential(row) {
300750
+ return require_Schema$1.try_({
300751
+ try: () => ({
300752
+ ...row,
300753
+ credential: decodeSensitiveValue("auth-pairing-link", row.credential)
300754
+ }),
300755
+ catch: toPersistenceDecodeDefect("AuthPairingLinkRepository.decryptCredential")
300756
+ });
300757
+ }
300723
300758
  const makeAuthPairingLinkRepository = require_Schema$1.gen(function* () {
300724
300759
  const sql = yield* require_SqlError.SqlClient;
300725
300760
  const StoredCreateAuthPairingLinkInput = require_Schema$1.Struct({
@@ -300841,13 +300876,6 @@ const makeAuthPairingLinkRepository = require_Schema$1.gen(function* () {
300841
300876
  WHERE credential_lookup = ${credentialLookup}
300842
300877
  `
300843
300878
  });
300844
- const decodeCredential = (row) => require_Schema$1.try_({
300845
- try: () => ({
300846
- ...row,
300847
- credential: decodeSensitiveValue("auth-pairing-link", row.credential)
300848
- }),
300849
- catch: toPersistenceDecodeDefect("AuthPairingLinkRepository.decryptCredential")
300850
- });
300851
300879
  const create = (input) => createPairingLinkRow({
300852
300880
  ...input,
300853
300881
  credential: encodeSensitiveValue("auth-pairing-link", input.credential),
@@ -313778,14 +313806,8 @@ function buildRuntimeUsageRowBatch(rows, cursor, batchSize = 500) {
313778
313806
  previousHeadHash: cursor.headHash,
313779
313807
  rows: capped.map((row, index) => {
313780
313808
  const sequence = cursor.acknowledgedSequence + 1 + index;
313781
- return {
313782
- ...row,
313783
- sequence,
313784
- payloadHash: hashRuntimeUsageRow({
313785
- ...row,
313786
- sequence
313787
- })
313788
- };
313809
+ const sequencedRow = Object.assign({}, row, { sequence });
313810
+ return Object.assign(sequencedRow, { payloadHash: hashRuntimeUsageRow(sequencedRow) });
313789
313811
  })
313790
313812
  };
313791
313813
  }
@@ -316294,6 +316316,23 @@ const EXECUTABLE_STAGES = [
316294
316316
  ];
316295
316317
  const encoder = new TextEncoder();
316296
316318
  const decoder = new TextDecoder();
316319
+ function decodePersistedReport(item) {
316320
+ let value;
316321
+ try {
316322
+ value = JSON.parse(item.payloadJson);
316323
+ } catch {
316324
+ return null;
316325
+ }
316326
+ if (value === null || typeof value !== "object" || Array.isArray(value)) return null;
316327
+ const report = value;
316328
+ return [
316329
+ report.stage === item.stage,
316330
+ Number.isSafeInteger(report.attempt),
316331
+ (report.attempt ?? 0) > 0,
316332
+ Number.isSafeInteger(report.expectedLockVersion),
316333
+ (report.expectedLockVersion ?? -1) >= 0
316334
+ ].every(Boolean) ? report : null;
316335
+ }
316297
316336
  function isRecord$2(value) {
316298
316337
  return Boolean(value) && typeof value === "object" && !Array.isArray(value);
316299
316338
  }
@@ -317735,23 +317774,6 @@ const makePipelineRunCoordinator = require_Schema$1.gen(function* () {
317735
317774
  })).applied) return yield* coordinatorError("reconcileTerminalHandoff", "PIPELINE_RECONCILE_CONFLICT", "The pipeline binding changed before its terminal state could be reconciled.");
317736
317775
  yield* finalizeTerminalResources(binding, publicationGeneration);
317737
317776
  }).pipe(require_Schema$1.mapError((cause) => cause instanceof PipelineRunCoordinatorError ? cause : coordinatorError("reconcileTerminalHandoff", "PIPELINE_RECONCILE_FAILED", `Failed to reconcile terminal CMMD run ${input.runId}.`, cause)));
317738
- const decodePersistedReport = (item) => {
317739
- let value;
317740
- try {
317741
- value = JSON.parse(item.payloadJson);
317742
- } catch {
317743
- return null;
317744
- }
317745
- if (value === null || typeof value !== "object" || Array.isArray(value)) return null;
317746
- const report = value;
317747
- return [
317748
- report.stage === item.stage,
317749
- Number.isSafeInteger(report.attempt),
317750
- (report.attempt ?? 0) > 0,
317751
- Number.isSafeInteger(report.expectedLockVersion),
317752
- (report.expectedLockVersion ?? -1) >= 0
317753
- ].every(Boolean) ? report : null;
317754
- };
317755
317777
  const synchronizeNonAppliedReport = (item, binding, authority, reportEpoch, currentEpoch) => require_Schema$1.gen(function* () {
317756
317778
  const snapshot = yield* client.read({
317757
317779
  runId: item.runId,
@@ -321681,6 +321703,9 @@ function requireMergeValue(value, message) {
321681
321703
  if (value === null || value === void 0) throw new Error(message);
321682
321704
  return value;
321683
321705
  }
321706
+ function serverCommandId(tag) {
321707
+ return CommandId.make(`server:agent-protocol:${tag}:${crypto.randomUUID()}`);
321708
+ }
321684
321709
  const make = require_Schema$1.gen(function* () {
321685
321710
  const orchestration = yield* OrchestrationEngineService;
321686
321711
  const projectionSnapshotQuery = yield* ProjectionSnapshotQuery;
@@ -321692,7 +321717,6 @@ const make = require_Schema$1.gen(function* () {
321692
321717
  const dispatch = (command) => runPromise(orchestration.dispatch(command).pipe(require_Schema$1.asVoid));
321693
321718
  const readThread = (threadId) => runPromise(readDurableWorkerDetail(projectionSnapshotQuery, threadId)).then(require_Schema$1.getOrNull);
321694
321719
  const readProject = (projectId) => runPromise(projectionSnapshotQuery.getProjectShellById(projectId)).then(require_Schema$1.getOrNull);
321695
- const serverCommandId = (tag) => CommandId.make(`server:agent-protocol:${tag}:${crypto.randomUUID()}`);
321696
321720
  const appendActivity = async (input) => {
321697
321721
  const createdAt = input.createdAt ?? (/* @__PURE__ */ new Date()).toISOString();
321698
321722
  await dispatch({