@dev.fast/whiteboard 0.3.5-preview.20261021.131 → 0.3.5-preview.20261022.134

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 (56) hide show
  1. package/dist/{account-alias-CisiYUZT.js → account-alias-2yTAxoBx.js} +6 -7
  2. package/dist/{agent-cli-TJ7_5_B3.js → agent-cli-DpSj5jCW.js} +9 -8
  3. package/dist/agent-cli-a7X9Th1U.js +2 -0
  4. package/dist/{agent-client-H53ajvrm.js → agent-client-Dc0vHFJt.js} +3 -3
  5. package/dist/{authoring-tools-BCquUsB3.js → authoring-tools-BBksBplC.js} +3 -3
  6. package/dist/{background-server-Xom8cA_u.js → background-server-DHWHzpo5.js} +4 -4
  7. package/dist/{background-server-BSYXD9au.js → background-server-DyWnPJyZ.js} +1 -1
  8. package/dist/build-info.json +1 -1
  9. package/dist/{cli-BOnV4cCh.js → cli-qZomwJmK.js} +1 -1
  10. package/dist/{cli-runner-cRY5NOno.js → cli-runner-D1PRTICL.js} +25 -24
  11. package/dist/cli.js +2 -2
  12. package/dist/{client-UH1bEG7Z.js → client-CiB4MRlo.js} +11 -9
  13. package/dist/{fuzzy-match-D_x3wumC.js → fuzzy-match-CfSxqzBF.js} +4 -4
  14. package/dist/{headless-host-BEe-aFtB.js → headless-host-Ck5-JjGV.js} +1 -1
  15. package/dist/{headless-host-CEb5d-A0.js → headless-host-D9y2sBIj.js} +55 -20
  16. package/dist/{lens-selection-BxPk53c8.js → lens-selection-9byzEgvU.js} +1 -1
  17. package/dist/{local-data-mbCb1HDH.js → local-data-m4BCbtSA.js} +20 -465
  18. package/dist/{mcp-cBtzXsmN.js → mcp-IkZ0jBxU.js} +3 -3
  19. package/dist/{package-paths-BkeQsdaw.js → package-paths-BeYHYjeR.js} +1 -1
  20. package/dist/profile-BfY9lECc.js +2 -0
  21. package/dist/{profile-duqp5uPa.js → profile-BfvRNmRc.js} +2 -2
  22. package/dist/{remote-attach-BeKuMm_x.js → remote-attach-DSGpTOJ4.js} +4 -4
  23. package/dist/{remote-extensions-CYWNTVSf.js → remote-extensions-CsI_BJ_f.js} +3 -3
  24. package/dist/{remote-extensions-CX2fAec1.js → remote-extensions-WtJO7pkb.js} +1 -1
  25. package/dist/{remote-language-server-DLWluAeR.js → remote-language-server-Dx13Mg2m.js} +4 -4
  26. package/dist/{remote-uninstall-Y3S0YmJs.js → remote-uninstall-Dp2o3qz0.js} +5 -5
  27. package/dist/{request-origin-icXPv6jh.js → request-origin-CNSLVn7x.js} +7 -3
  28. package/dist/{review-app-launcher-DZvG5ZAh.js → review-app-launcher-BZAnR8Vp.js} +2 -2
  29. package/dist/review-home-paths-CG-sb9Cw.js +39 -0
  30. package/dist/{review-telemetry-AZ0imsmJ.js → review-telemetry-BM-_KdLi.js} +5 -4
  31. package/dist/{runtime-CF4JXdb8.js → runtime-C6_1K-3Z.js} +1 -1
  32. package/dist/runtime.js +1 -1
  33. package/dist/server/desktop-host.js +128 -32
  34. package/dist/{server-discovery-DeVTdcqK.js → server-discovery-DKLIOgg3.js} +3 -2
  35. package/dist/sharing/index.d.ts +4 -58
  36. package/dist/sharing/index.js +1 -1
  37. package/dist/{src-DYZLCUP_.js → src-DYHVzX3b.js} +0 -11
  38. package/dist/{review-home-paths-BwH08ihj.js → src-Z1x4-Qmb.js} +5 -39
  39. package/dist/{stored-document-migration-B29lve9-.js → stored-document-migration-B-lTO-_P.js} +479 -6
  40. package/dist/{thread-state-BPpvKFwQ.js → thread-state-CO97FUqK.js} +1 -1
  41. package/dist/{tool-failure-CQhyLht3.js → tool-failure-C1L1vJyz.js} +2 -2
  42. package/package.json +5 -5
  43. package/src/cli-install.ts +1 -6
  44. package/src/review-api/local-data.ts +23 -1
  45. package/src/review-stack.ts +58 -8
  46. package/src/server/desktop-host.ts +14 -1
  47. package/src/server/desktop-server.ts +12 -17
  48. package/src/server/hono-http.ts +31 -5
  49. package/src/server/loopback-server.ts +146 -0
  50. package/src/sharing/client.ts +11 -1
  51. package/src/sharing/import.ts +4 -8
  52. package/src/software-map-model.ts +30 -1
  53. package/src/ui-telemetry-events.ts +4 -0
  54. package/dist/agent-cli-BglNRDZN.js +0 -2
  55. package/dist/profile-Dbyidrcr.js +0 -2
  56. package/dist/{src-DtfSndqS.js → src-X9ZebeOD.js} +1 -1
@@ -1,10 +1,11 @@
1
1
  import { n as isJsonObject } from "./src-X9phtB2j.js";
2
- import { E as ReviewCliInstallStampSchema } from "./src-DYZLCUP_.js";
3
- import { C as disableTraceMachine, E as traceMachineStatus, G as listTraceRepositoryRoots, K as traceRepositoryStatus, Q as removeAgentTraceHook, S as configureTraceMachine, T as traceMachineEnabled, U as disableAllTraceRepositories, W as enableTraceRepository, X as describeTraceHookOwners, Y as AGENT_TRACE_HOOK_AGENTS, Z as installHarnessHooks, at as readStoreAuth, n as reviewDesktopStateDir, nt as traceScope, ut as StoreClient } from "./review-home-paths-BwH08ihj.js";
2
+ import { E as ReviewCliInstallStampSchema } from "./src-DYHVzX3b.js";
3
+ import { G as removeAgentTraceHook, H as AGENT_TRACE_HOOK_AGENTS, I as disableAllTraceRepositories, L as enableTraceRepository, Q as readStoreAuth, R as listTraceRepositoryRoots, U as describeTraceHookOwners, W as installHarnessHooks, Y as traceScope, g as disableTraceMachine, h as configureTraceMachine, rt as StoreClient, v as traceMachineEnabled, y as traceMachineStatus, z as traceRepositoryStatus } from "./src-Z1x4-Qmb.js";
4
4
  import { I as writeFileAtomicAsync, L as writePrivateJsonAtomic, N as devReviewHome, j as withFileLock } from "./s3-config-CjcLyFV5.js";
5
- import { i as readReviewPackageVersion } from "./package-paths-BkeQsdaw.js";
5
+ import { i as readReviewPackageVersion } from "./package-paths-BeYHYjeR.js";
6
+ import { n as reviewDesktopStateDir } from "./review-home-paths-CG-sb9Cw.js";
6
7
  import { n as isFile, t as isDirectory } from "./fs-utils-BMPLt0cr.js";
7
- import { c as findExecutable, s as executableCommand } from "./fuzzy-match-D_x3wumC.js";
8
+ import { c as findExecutable, s as executableCommand } from "./fuzzy-match-CfSxqzBF.js";
8
9
  import { createHash } from "node:crypto";
9
10
  import { constants } from "node:fs";
10
11
  import { access, chmod, lstat, mkdir, readFile, rm, stat, writeFile } from "node:fs/promises";
@@ -821,7 +822,7 @@ async function resyncCliInstallUnlocked(input) {
821
822
  const chunks = [];
822
823
  let shimPath;
823
824
  let userPath = stamp.userPath;
824
- if (stamp.shimPath && !stamp.commandDisabled) {
825
+ if (stamp.shimPath) {
825
826
  const installed = await installShim(input, chunks);
826
827
  if (installed.code !== 0) return installed;
827
828
  shimPath = installed.shimPath;
@@ -886,7 +887,6 @@ async function applyCliInstallUnlocked(input) {
886
887
  };
887
888
  const stampShimPath = shimPath ?? (granted ? previous.shimPath : void 0);
888
889
  if (stampShimPath) stamp.shimPath = stampShimPath;
889
- if (granted && previous.commandDisabled && input.shim !== true) stamp.commandDisabled = true;
890
890
  if (input.trace !== void 0 || granted && previous.traceManaged) stamp.traceManaged = true;
891
891
  const stampUserPath = userPath ?? (granted && !shimPath ? previous.userPath : void 0);
892
892
  if (stampUserPath) stamp.userPath = stampUserPath;
@@ -1053,7 +1053,6 @@ async function removeCliInstallUnlocked(input) {
1053
1053
  };
1054
1054
  if (previous.fingerprint) stamp.fingerprint = previous.fingerprint;
1055
1055
  if (!input.shim && previous.shimPath) stamp.shimPath = previous.shimPath;
1056
- if (input.shim || previous.commandDisabled) stamp.commandDisabled = true;
1057
1056
  if (!input.trace && previous.traceManaged) stamp.traceManaged = true;
1058
1057
  if (!input.shim && previous.userPath) stamp.userPath = previous.userPath;
1059
1058
  await writeCurrentStamp(env, stamp);
@@ -1,12 +1,13 @@
1
1
  import { n as isJsonObject, u as parseJsonText } from "./src-X9phtB2j.js";
2
- import { T as traceMachineEnabled } from "./review-home-paths-BwH08ihj.js";
3
- import { a as toolResultText, i as connectReviewInstance, s as ReviewApiError } from "./agent-client-H53ajvrm.js";
2
+ import { v as traceMachineEnabled } from "./src-Z1x4-Qmb.js";
3
+ import { a as toolResultText, i as connectReviewInstance, s as ReviewApiError } from "./agent-client-Dc0vHFJt.js";
4
4
  import { N as devReviewHome } from "./s3-config-CjcLyFV5.js";
5
- import { n as readBuildCommit } from "./package-paths-BkeQsdaw.js";
6
- import { b as selectReviewInstance, u as REVIEW_INSTANCE_ENV } from "./server-discovery-DeVTdcqK.js";
7
- import { n as reviewSessionAgent } from "./review-telemetry-AZ0imsmJ.js";
8
- import { a as REVIEW_VIA_HEADER, i as REVIEW_THREAD_HEADER, n as REVIEW_AGENT_HEADER, t as ASK_THREAD_ENV } from "./request-origin-icXPv6jh.js";
9
- import { i as publicTool, n as RECOVERY, r as callPublicTool, t as toolFailure } from "./tool-failure-CQhyLht3.js";
5
+ import { n as readBuildCommit } from "./package-paths-BeYHYjeR.js";
6
+ import "./review-home-paths-CG-sb9Cw.js";
7
+ import { b as selectReviewInstance, u as REVIEW_INSTANCE_ENV } from "./server-discovery-DKLIOgg3.js";
8
+ import { n as reviewSessionAgent } from "./review-telemetry-BM-_KdLi.js";
9
+ import { a as REVIEW_VIA_HEADER, i as REVIEW_THREAD_HEADER, n as REVIEW_AGENT_HEADER, t as ASK_THREAD_ENV } from "./request-origin-CNSLVn7x.js";
10
+ import { i as publicTool, n as RECOVERY, r as callPublicTool, t as toolFailure } from "./tool-failure-C1L1vJyz.js";
10
11
  import { existsSync } from "node:fs";
11
12
  import path from "node:path";
12
13
  //#region src/review-api/install-update.ts
@@ -43,7 +44,7 @@ async function runReviewAgentCli(input) {
43
44
  [REVIEW_THREAD_HEADER, thread ?? ""]
44
45
  ]);
45
46
  if (mode === "mcp") {
46
- const { serveReviewMcp } = await import("./mcp-cBtzXsmN.js");
47
+ const { serveReviewMcp } = await import("./mcp-IkZ0jBxU.js");
47
48
  exitOnInstallUpdate(input.stderr);
48
49
  await serveReviewMcp(async (key, agentKind) => {
49
50
  const connected = await connectReviewInstance(key ? {
@@ -0,0 +1,2 @@
1
+ import { n as runReviewAgentCli } from "./agent-cli-DpSj5jCW.js";
2
+ export { runReviewAgentCli };
@@ -1,7 +1,7 @@
1
1
  import { d as isBooleanValue, f as isNumberValue, m as isStringValue, u as parseJsonText } from "./src-X9phtB2j.js";
2
- import "./src-DYZLCUP_.js";
2
+ import "./src-DYHVzX3b.js";
3
3
  import { t as ReviewInputError } from "./input-error-OLgB_h31.js";
4
- import { b as selectReviewInstance, c as reviewServerStateDir, d as ReviewInstanceUnavailableError, i as readReviewServerDiscovery, l as serverNotReady, m as healthyReviewInstance, s as reviewServerIsHealthy, y as reviewInstanceUnavailable } from "./server-discovery-DeVTdcqK.js";
4
+ import { b as selectReviewInstance, c as reviewServerStateDir, d as ReviewInstanceUnavailableError, i as readReviewServerDiscovery, l as serverNotReady, m as healthyReviewInstance, s as reviewServerIsHealthy, y as reviewInstanceUnavailable } from "./server-discovery-DKLIOgg3.js";
5
5
  //#region ../review-protocol/src/review-api-client.ts
6
6
  const defaultRequest = (url, init) => fetch(url, init);
7
7
  /** A non-2xx reply; the status tells a caller whether retrying can help. */
@@ -259,7 +259,7 @@ async function connectReviewInstance(env = process.env, headers = {}, options =
259
259
  const selection = await selectReviewInstance({ env });
260
260
  const discovery = healthyReviewInstance(selection);
261
261
  if (!discovery) {
262
- const { ensureServerWithoutDesktop } = await import("./background-server-BSYXD9au.js");
262
+ const { ensureServerWithoutDesktop } = await import("./background-server-DyWnPJyZ.js");
263
263
  const server = await ensureServerWithoutDesktop({
264
264
  selection,
265
265
  env,
@@ -1,8 +1,8 @@
1
1
  import { n as isJsonObject } from "./src-X9phtB2j.js";
2
- import { c as activityBeginSchema, l as activityEndSchema, n as uploadSchema, r as commandSchema, u as activityUpdateSchema } from "./local-data-mbCb1HDH.js";
3
- import { C as pathTargetSchema, D as publishedEditSchema } from "./stored-document-migration-B29lve9-.js";
2
+ import { c as activityBeginSchema, l as activityEndSchema, n as uploadSchema, r as commandSchema, u as activityUpdateSchema } from "./local-data-m4BCbtSA.js";
3
+ import { I as publishedEditSchema, M as pathTargetSchema } from "./stored-document-migration-B-lTO-_P.js";
4
4
  import { t as ReviewInputError } from "./input-error-OLgB_h31.js";
5
- import { t as findReviewPackageRoot } from "./package-paths-BkeQsdaw.js";
5
+ import { t as findReviewPackageRoot } from "./package-paths-BeYHYjeR.js";
6
6
  import { z } from "zod";
7
7
  import { readFile } from "node:fs/promises";
8
8
  import path from "node:path";
@@ -1,8 +1,8 @@
1
- import "./review-home-paths-BwH08ihj.js";
1
+ import "./src-Z1x4-Qmb.js";
2
2
  import { D as liveLockOwner, k as processIsAlive } from "./s3-config-CjcLyFV5.js";
3
- import { t as findReviewPackageRoot } from "./package-paths-BkeQsdaw.js";
4
- import { a as readReviewServerHealth, c as reviewServerStateDir, i as readReviewServerDiscovery, n as desktopOwnsHome, p as desktopUsesHome, r as headlessServerLockPath } from "./server-discovery-DeVTdcqK.js";
5
- import { t as desktopApplicationInstalled } from "./review-app-launcher-DZvG5ZAh.js";
3
+ import { t as findReviewPackageRoot } from "./package-paths-BeYHYjeR.js";
4
+ import { a as readReviewServerHealth, c as reviewServerStateDir, i as readReviewServerDiscovery, n as desktopOwnsHome, p as desktopUsesHome, r as headlessServerLockPath } from "./server-discovery-DKLIOgg3.js";
5
+ import { t as desktopApplicationInstalled } from "./review-app-launcher-BZAnR8Vp.js";
6
6
  import { mkdir, open, readFile, realpath, stat } from "node:fs/promises";
7
7
  import path from "node:path";
8
8
  import { spawn } from "node:child_process";
@@ -1,2 +1,2 @@
1
- import { a as headlessServerOwner, c as stopBackgroundServer, i as ensureServerWithoutDesktop, r as ensureBackgroundServer } from "./background-server-Xom8cA_u.js";
1
+ import { a as headlessServerOwner, c as stopBackgroundServer, i as ensureServerWithoutDesktop, r as ensureBackgroundServer } from "./background-server-DHWHzpo5.js";
2
2
  export { ensureBackgroundServer, ensureServerWithoutDesktop, headlessServerOwner, stopBackgroundServer };
@@ -1 +1 @@
1
- {"version":"0.3.5-preview.20261021.131","commit":"6bf7b672e0c4d566b582d555044a624620c6311f","dirty":true,"builtAt":"2026-10-21T16:51:06.481Z"}
1
+ {"version":"0.3.5-preview.20261022.134","commit":"e6b58d262b3ad613be4acc3a53b79c8720ba6a0b","dirty":true,"builtAt":"2026-10-22T19:59:15.711Z"}
@@ -1,4 +1,4 @@
1
- import { r as connectReviewApi } from "./agent-client-H53ajvrm.js";
1
+ import { r as connectReviewApi } from "./agent-client-Dc0vHFJt.js";
2
2
  import { randomUUID } from "node:crypto";
3
3
  import { z } from "zod";
4
4
  //#region src/sharing/cli.ts
@@ -1,26 +1,27 @@
1
- import { D as __commonJSMin, E as setLocalVcsCommandObserver, O as __require, k as __toESM } from "./src-DtfSndqS.js";
1
+ import { D as __commonJSMin, E as setLocalVcsCommandObserver, O as __require, k as __toESM } from "./src-X9ZebeOD.js";
2
2
  import { c as jsonString, n as isJsonObject, u as parseJsonText } from "./src-X9phtB2j.js";
3
- import { S as REVIEW_REMOTE_ATTACH_END, b as REVIEW_REMOTE_AGENT_IDS, h as REVIEW_CLI_INSTALL_TARGET_LABELS, l as boardTitle, x as REVIEW_REMOTE_ATTACH_BEGIN } from "./src-DYZLCUP_.js";
4
- import { $ as resolveTraceCommand, A as runTraceDeny, E as traceMachineStatus, F as describeSelection, H as resolveTraceRepositoryTarget, J as HOSTED_CAPTURE_SCOPE_DESCRIPTION, K as traceRepositoryStatus, L as loadS3TraceStorage, M as runTraceSessions, N as runTraceStoreDelete, P as runTraceStoreInfo, T as traceMachineEnabled, V as requireTraceConsent, _ as runTraceRepair, at as readStoreAuth, b as runTraceGitHook, c as registerTraceCommands, ct as runStoreWhoami, d as runTraceList$1, dt as withStoreAuthorization, f as runTracePull$1, ft as emitJsonEvent, g as runTraceInstallMachine, h as runTraceEnable, ht as jsonRequestedInArgv, j as runTraceOnboard, k as runTraceAllow, l as resolveTraceReadStorage, lt as StoreApiError, m as runTraceDisable, mt as humanStream, nt as traceScope, ot as runStoreLogin, p as runTraceShow, pt as failWithJsonError, q as readTraceUserConfig, rt as DEFAULT_STORE_ORIGIN, st as runStoreLogout, tt as traceHomeDir, u as runTraceBlame, ut as StoreClient, v as runTraceStatus, w as readLegacyCaptureSettings, x as runTraceHook, y as runTraceSync, z as selectTraceStorage } from "./review-home-paths-BwH08ihj.js";
5
- import { o as ReviewApiClient, s as ReviewApiError } from "./agent-client-H53ajvrm.js";
6
- import { t as resolveReviewRoot } from "./runtime-CF4JXdb8.js";
3
+ import { S as REVIEW_REMOTE_ATTACH_END, b as REVIEW_REMOTE_AGENT_IDS, h as REVIEW_CLI_INSTALL_TARGET_LABELS, l as boardTitle, x as REVIEW_REMOTE_ATTACH_BEGIN } from "./src-DYHVzX3b.js";
4
+ import { $ as runStoreLogin, A as loadS3TraceStorage, B as readTraceUserConfig, C as runTraceDeny, D as runTraceStoreInfo, E as runTraceStoreDelete, F as resolveTraceRepositoryTarget, J as traceHomeDir, K as resolveTraceCommand, M as selectTraceStorage, O as describeSelection, P as requireTraceConsent, Q as readStoreAuth, S as runTraceAllow, T as runTraceSessions, V as HOSTED_CAPTURE_SCOPE_DESCRIPTION, X as DEFAULT_STORE_ORIGIN, Y as traceScope, _ as readLegacyCaptureSettings, a as runTracePull$1, at as emitJsonEvent, c as runTraceEnable, ct as jsonRequestedInArgv, d as runTraceStatus, et as runStoreLogout, f as runTraceSync, i as runTraceList$1, it as withStoreAuthorization, l as runTraceInstallMachine, m as runTraceHook, n as resolveTraceReadStorage, nt as StoreApiError, o as runTraceShow, ot as failWithJsonError, p as runTraceGitHook, r as runTraceBlame, rt as StoreClient, s as runTraceDisable, st as humanStream, t as registerTraceCommands, tt as runStoreWhoami, u as runTraceRepair, v as traceMachineEnabled, w as runTraceOnboard, y as traceMachineStatus, z as traceRepositoryStatus } from "./src-Z1x4-Qmb.js";
5
+ import { o as ReviewApiClient, s as ReviewApiError } from "./agent-client-Dc0vHFJt.js";
7
6
  import { C as s3ProfileSchema, E as writeTraceConfigFile, N as devReviewHome, P as normalizeStoreOrigin, S as readTraceConfigFile, T as sameS3Profile, _ as emptyTraceConfig, c as resolveS3Setup, g as currentStore, h as TraceConfigurationError, i as isS3MockMode, n as clearTraceEnvCache, o as readTraceEnvFile, p as traceSettingsPath, w as s3Store } from "./s3-config-CjcLyFV5.js";
8
7
  import { t as errorMessage } from "./error-message-OtiDonty.js";
9
- import { i as readReviewPackageVersion, r as readBuildInfo, t as findReviewPackageRoot } from "./package-paths-BkeQsdaw.js";
10
- import { a as readReviewServerHealth, b as selectReviewInstance, c as reviewServerStateDir, d as ReviewInstanceUnavailableError, f as clearDefaultReviewInstance, g as requireHealthyReviewDesktop, h as readDefaultReviewInstance, i as readReviewServerDiscovery, l as serverNotReady, m as healthyReviewInstance, p as desktopUsesHome, t as DESKTOP_TAKEOVER_SIGNAL, u as REVIEW_INSTANCE_ENV, x as writeDefaultReviewInstance, y as reviewInstanceUnavailable } from "./server-discovery-DeVTdcqK.js";
11
- import { t as ReviewTelemetry } from "./review-telemetry-AZ0imsmJ.js";
12
- import { t as fuzzyRank } from "./fuzzy-match-D_x3wumC.js";
13
- import { _ as isInstallTarget, a as isOwnedShim, f as windowsInstallerCommand, g as ALL_INSTALL_TARGETS, h as detectConnectAgents, m as connectAgent, o as pathShimPath, p as scanLegacySkills, t as aliasInstallationToAccount, v as connectPrompts } from "./account-alias-CisiYUZT.js";
14
- import { n as focusReviewDesktop, r as runReviewAppLaunch } from "./review-app-launcher-DZvG5ZAh.js";
15
- import { t as reviewAgentCliHelp } from "./agent-cli-TJ7_5_B3.js";
8
+ import { i as readReviewPackageVersion, r as readBuildInfo, t as findReviewPackageRoot } from "./package-paths-BeYHYjeR.js";
9
+ import { t as resolveReviewRoot } from "./runtime-C6_1K-3Z.js";
10
+ import "./review-home-paths-CG-sb9Cw.js";
11
+ import { a as readReviewServerHealth, b as selectReviewInstance, c as reviewServerStateDir, d as ReviewInstanceUnavailableError, f as clearDefaultReviewInstance, g as requireHealthyReviewDesktop, h as readDefaultReviewInstance, i as readReviewServerDiscovery, l as serverNotReady, m as healthyReviewInstance, p as desktopUsesHome, t as DESKTOP_TAKEOVER_SIGNAL, u as REVIEW_INSTANCE_ENV, x as writeDefaultReviewInstance, y as reviewInstanceUnavailable } from "./server-discovery-DKLIOgg3.js";
12
+ import { t as ReviewTelemetry } from "./review-telemetry-BM-_KdLi.js";
13
+ import { t as fuzzyRank } from "./fuzzy-match-CfSxqzBF.js";
14
+ import { _ as isInstallTarget, a as isOwnedShim, f as windowsInstallerCommand, g as ALL_INSTALL_TARGETS, h as detectConnectAgents, m as connectAgent, o as pathShimPath, p as scanLegacySkills, t as aliasInstallationToAccount, v as connectPrompts } from "./account-alias-2yTAxoBx.js";
15
+ import { n as focusReviewDesktop, r as runReviewAppLaunch } from "./review-app-launcher-BZAnR8Vp.js";
16
+ import { t as reviewAgentCliHelp } from "./agent-cli-DpSj5jCW.js";
16
17
  import { existsSync, mkdirSync, renameSync, writeFileSync } from "node:fs";
17
18
  import { realpath } from "node:fs/promises";
18
19
  import path from "node:path";
19
- import os from "node:os";
20
- import { fileURLToPath } from "node:url";
21
20
  import { Writable } from "node:stream";
22
21
  import { AsyncLocalStorage } from "node:async_hooks";
22
+ import os from "node:os";
23
23
  import { Argument, Command, CommanderError, Option } from "commander";
24
+ import { fileURLToPath } from "node:url";
24
25
  import { emitKeypressEvents } from "node:readline";
25
26
  import { createInterface as createInterface$1 } from "node:readline/promises";
26
27
  import pino from "pino";
@@ -4333,7 +4334,7 @@ async function runReviewCli(input) {
4333
4334
  if (!Number.isInteger(port) || port < 0 || port > 65535) throw new ReviewCliUsageError("--port must be an integer between 0 and 65535.");
4334
4335
  const stateDir = reviewServerStateDir(authoringEnv(options.stateDir));
4335
4336
  if (options.detach) {
4336
- const { ensureBackgroundServer } = await import("./background-server-BSYXD9au.js");
4337
+ const { ensureBackgroundServer } = await import("./background-server-DyWnPJyZ.js");
4337
4338
  const { discovery, started } = await ensureBackgroundServer({
4338
4339
  stateDir,
4339
4340
  env,
@@ -4355,7 +4356,7 @@ async function runReviewCli(input) {
4355
4356
  process.once("SIGINT", stop);
4356
4357
  process.once("SIGTERM", stop);
4357
4358
  process.once(DESKTOP_TAKEOVER_SIGNAL, takeover);
4358
- const { HeadlessServerBusyError, runHeadlessServer } = await import("./headless-host-BEe-aFtB.js");
4359
+ const { HeadlessServerBusyError, runHeadlessServer } = await import("./headless-host-Ck5-JjGV.js");
4359
4360
  try {
4360
4361
  await runHeadlessServer({
4361
4362
  stateDir,
@@ -4392,7 +4393,7 @@ async function runReviewCli(input) {
4392
4393
  configureJsonOutput(serverCommand.command("stop").description("Stop a background server started by --detach, the CLI, or Desktop").option("--state-dir <path>", "directory selected when starting the server"), "plain").action(async (_options, command) => {
4393
4394
  const options = command.optsWithGlobals();
4394
4395
  const stateDir = reviewServerStateDir(authoringEnv(options.stateDir));
4395
- const { headlessServerOwner, stopBackgroundServer } = await import("./background-server-BSYXD9au.js");
4396
+ const { headlessServerOwner, stopBackgroundServer } = await import("./background-server-DyWnPJyZ.js");
4396
4397
  const owner = await headlessServerOwner(stateDir);
4397
4398
  const discovery = await readReviewServerDiscovery(stateDir);
4398
4399
  if (owner === void 0) {
@@ -4420,7 +4421,7 @@ async function runReviewCli(input) {
4420
4421
  if (!existsSync(path.join(stateDir, "review-api.db"))) throw new Error(`No saved reviews in ${stateDir}, so there is no server id to reset. Check --state-dir.`);
4421
4422
  const inUse = `A Whiteboard server is using ${stateDir}. Stop it first, then run whiteboard server reset-id again.`;
4422
4423
  if (await desktopUsesHome(stateDir, env)) return refuse(inUse, options.json);
4423
- const [{ openReviewProfile }, { withHeadlessServerLock }] = await Promise.all([import("./profile-Dbyidrcr.js"), import("./headless-host-BEe-aFtB.js")]);
4424
+ const [{ openReviewProfile }, { withHeadlessServerLock }] = await Promise.all([import("./profile-BfY9lECc.js"), import("./headless-host-Ck5-JjGV.js")]);
4424
4425
  const reset = await withHeadlessServerLock(await realpath(stateDir), async () => {
4425
4426
  const local = await openReviewProfile(stateDir, { manageWorkspaces: false });
4426
4427
  try {
@@ -4442,7 +4443,7 @@ async function runReviewCli(input) {
4442
4443
  configureJsonOutput(remote.command("attach").description("Start a background server if none is healthy and report how to reach it").option("--state-dir <path>", "directory for saved reviews and server discovery").option("--groups <groups>", "comma-separated optional extension groups the Desktop has enabled, such as go").option("--replace", "stop a running server of another version that the CLI or Desktop started, and start this one"), "plain").action(async (_options, command) => {
4443
4444
  const options = command.optsWithGlobals();
4444
4445
  const stateDir = reviewServerStateDir(authoringEnv(options.stateDir));
4445
- const { remoteAttach } = await import("./remote-attach-BeKuMm_x.js");
4446
+ const { remoteAttach } = await import("./remote-attach-DSGpTOJ4.js");
4446
4447
  let attach;
4447
4448
  try {
4448
4449
  attach = await remoteAttach({
@@ -4469,7 +4470,7 @@ async function runReviewCli(input) {
4469
4470
  });
4470
4471
  configureJsonOutput(remote.command("extensions").description("Language extensions for the language server on a remote").command("ensure").description("Download the curated extensions for this machine and list them for the language server").option("--groups <groups>", "comma-separated optional extension groups the Desktop has enabled, such as go"), "plain").action(async (_options, command) => {
4471
4472
  const { json, groups } = command.optsWithGlobals();
4472
- const { ensureRemoteExtensions } = await import("./remote-extensions-CX2fAec1.js");
4473
+ const { ensureRemoteExtensions } = await import("./remote-extensions-WtJO7pkb.js");
4473
4474
  const result = await ensureRemoteExtensions({
4474
4475
  env,
4475
4476
  groups: groups?.split(",").map((group) => group.trim())
@@ -4484,7 +4485,7 @@ async function runReviewCli(input) {
4484
4485
  configureJsonOutput(remote.command("uninstall").description("Remove what Whiteboard Desktop installed on this host, stopping a server it started").addOption(new Option("--keep-reviews", "leave the saved reviews in place").conflicts("deleteReviews")).addOption(new Option("--delete-reviews", "also delete the saved reviews")).option("--state-dir <path>", "directory for saved reviews and server discovery"), "plain").action(async (_options, command) => {
4485
4486
  const options = command.optsWithGlobals();
4486
4487
  const stateDir = reviewServerStateDir(authoringEnv(options.stateDir));
4487
- const { remoteUninstall } = await import("./remote-uninstall-Y3S0YmJs.js");
4488
+ const { remoteUninstall } = await import("./remote-uninstall-Dp2o3qz0.js");
4488
4489
  let deleteReviews = options.deleteReviews ? true : options.keepReviews ? false : void 0;
4489
4490
  if (deleteReviews === void 0 && !options.json && input.stdin?.isTTY) {
4490
4491
  const prompt = createInterface$1({
@@ -4706,14 +4707,14 @@ async function runReviewCli(input) {
4706
4707
  command.showHelpAfterError(false).error("Markdown review migration is no longer supported. Ask your agent to migrate your old Whiteboard reviews.");
4707
4708
  });
4708
4709
  configureJsonOutput(configureJsonOutput(program.command("share").description("Upload an immutable review snapshot and return its share link"), "plain").option("--review <id>", "review ID").option("--version <number>", "Saved version to share").option("--preview", "Open the share link in Whiteboard Preview by default").option("--request-id <uuid>", "Reuse this ID when retrying the same immutable upload").action(async (options) => {
4709
- const { runShareCli } = await import("./cli-BOnV4cCh.js");
4710
+ const { runShareCli } = await import("./cli-qZomwJmK.js");
4710
4711
  state.exitCode = await runShareCli({
4711
4712
  ...input,
4712
4713
  ...options,
4713
4714
  env: authoringEnv()
4714
4715
  });
4715
4716
  }).command("revoke <share-id>").description("Revoke future downloads of a share"), "plain").action(async (shareId, options) => {
4716
- const { runShareCli } = await import("./cli-BOnV4cCh.js");
4717
+ const { runShareCli } = await import("./cli-qZomwJmK.js");
4717
4718
  state.exitCode = await runShareCli({
4718
4719
  ...input,
4719
4720
  ...options,
@@ -4794,7 +4795,7 @@ async function runReviewCli(input) {
4794
4795
  return commands;
4795
4796
  } });
4796
4797
  for (const [name, description] of [["api", "Call a JSON review authoring tool on the running server"], ["mcp", "Serve the JSON review authoring tools over stdio MCP"]]) configureOutput(program.command(name).description(description).argument("[args...]", "tool name and JSON input").allowUnknownOption().allowExcessArguments().helpOption(false).passThroughOptions().addHelpText("after", `\n${reviewAgentCliHelp}`), "plain").action(async (args) => {
4797
- const { runReviewAgentCli } = await import("./agent-cli-BglNRDZN.js");
4798
+ const { runReviewAgentCli } = await import("./agent-cli-a7X9Th1U.js");
4798
4799
  state.exitCode = await runReviewAgentCli({
4799
4800
  ...input,
4800
4801
  env: authoringEnv(),
package/dist/cli.js CHANGED
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env node
2
2
  import { a as jsonNumber, c as jsonString, o as jsonObject, u as parseJsonText } from "./src-X9phtB2j.js";
3
- import "./src-DYZLCUP_.js";
3
+ import "./src-DYHVzX3b.js";
4
4
  import { existsSync, readFileSync, readdirSync, realpathSync } from "node:fs";
5
5
  import path from "node:path";
6
6
  import os from "node:os";
@@ -17,7 +17,7 @@ async function runCli(effectivePath) {
17
17
  `);
18
18
  return 1;
19
19
  }
20
- const { runReviewCli } = await import("./cli-runner-cRY5NOno.js");
20
+ const { runReviewCli } = await import("./cli-runner-D1PRTICL.js");
21
21
  return runReviewCli({
22
22
  argv,
23
23
  cliPaths: {
@@ -1,8 +1,8 @@
1
- import { f as gitAt } from "./src-DtfSndqS.js";
1
+ import { f as gitAt } from "./src-X9ZebeOD.js";
2
2
  import { n as isJsonObject, u as parseJsonText } from "./src-X9phtB2j.js";
3
- import "./src-DYZLCUP_.js";
4
- import { f as sourceAnchors } from "./lens-selection-BxPk53c8.js";
5
- import { $ as parseMarkdown, A as resourceReferences, E as pinsSchema, G as lensSelections, I as sourceReferences, O as readsAtBoardPins, R as checkReferences, W as lensSchema, Z as markdownNodes, _ as boardRepositoryId, c as normalizedSoftwareRelationshipSchema, f as anchorPins, k as resourceReference, l as traceSchema, n as migrateStoredDocument, r as migrateStoredLenses, s as normalizedSoftwareElementSchema, t as liftFileLenses, u as textIncludesQuote, x as elements, y as documentSchema } from "./stored-document-migration-B29lve9-.js";
3
+ import "./src-DYHVzX3b.js";
4
+ import { f as sourceAnchors } from "./lens-selection-9byzEgvU.js";
5
+ import { $ as lensSchema, A as elements, E as boardRepositoryId, F as pinsSchema, G as sourceReferences, L as readsAtBoardPins, O as documentSchema, R as resourceReference, c as traceSchema, ct as parseMarkdown, et as lensSelections, n as migrateStoredDocument, ot as markdownNodes, q as checkReferences, r as migrateStoredLenses, s as softwareModelDataSchema, t as liftFileLenses, u as pullRequestUrl, x as anchorPins, y as textIncludesQuote, z as resourceReferences } from "./stored-document-migration-B-lTO-_P.js";
6
6
  import { t as ReviewInputError } from "./input-error-OLgB_h31.js";
7
7
  import { createHash, randomUUID } from "node:crypto";
8
8
  import { z } from "zod";
@@ -484,7 +484,7 @@ const sharedSnapshotSchema = z.strictObject({
484
484
  branch: z.string().optional(),
485
485
  baseRef: z.string().optional(),
486
486
  pullRequestNumber: z.number().int().positive().optional(),
487
- pullRequestUrl: z.string().optional(),
487
+ pullRequestUrl: pullRequestUrl.optional(),
488
488
  pullRequestTitle: z.string().optional(),
489
489
  revision: z.string().optional()
490
490
  }).optional()
@@ -494,11 +494,9 @@ const counts = z.strictObject({
494
494
  additions: count,
495
495
  deletions: count
496
496
  });
497
- const mapSchema = z.strictObject({
497
+ const mapSchema = softwareModelDataSchema.extend({
498
498
  commit: z.string().regex(COMMIT_ID),
499
499
  side: z.enum(["base", "head"]),
500
- elements: z.array(normalizedSoftwareElementSchema),
501
- relationships: z.array(normalizedSoftwareRelationshipSchema),
502
500
  countsByElementPath: z.record(z.string(), counts),
503
501
  unmappedByElementPath: z.record(z.string(), counts.extend({ files: z.array(counts.extend({
504
502
  file: z.string(),
@@ -1139,7 +1137,11 @@ var ShareClient = class {
1139
1137
  if (!response.ok && response.status !== 412) throw new Error(`Object upload failed (${response.status}).`);
1140
1138
  }
1141
1139
  async create(bundle, requestId = randomUUID(), beforeUpload) {
1142
- validateShareBundle(bundle);
1140
+ try {
1141
+ validateShareBundle(bundle);
1142
+ } catch (cause) {
1143
+ throw new SharePreflightError(new Error("Whiteboard could not prepare this review for sharing. Please report this issue.", { cause }));
1144
+ }
1143
1145
  const manifestBytes = Buffer.from(JSON.stringify(bundle.manifest));
1144
1146
  const created = createdSchema.parse(await this.api("/api/shares", "POST", {
1145
1147
  requestId,
@@ -1,15 +1,15 @@
1
- import "./review-home-paths-BwH08ihj.js";
1
+ import "./src-Z1x4-Qmb.js";
2
2
  import { N as devReviewHome } from "./s3-config-CjcLyFV5.js";
3
- import { n as askAgentIds } from "./thread-state-BPpvKFwQ.js";
4
- import { t as ASK_THREAD_ENV } from "./request-origin-icXPv6jh.js";
3
+ import { n as askAgentIds } from "./thread-state-CO97FUqK.js";
4
+ import { t as ASK_THREAD_ENV } from "./request-origin-CNSLVn7x.js";
5
5
  import { createRequire } from "node:module";
6
6
  import { constants } from "node:fs";
7
7
  import { access, chmod, mkdir, readFile, rename, stat, writeFile } from "node:fs/promises";
8
8
  import path from "node:path";
9
+ import { Readable, Writable } from "node:stream";
9
10
  import { homedir } from "node:os";
10
11
  import { execFile, spawn } from "node:child_process";
11
12
  import { promisify } from "node:util";
12
- import { Readable, Writable } from "node:stream";
13
13
  import { ndJsonStream } from "@agentclientprotocol/sdk";
14
14
  import fuzzysort from "fuzzysort";
15
15
  //#region src/ask/pi-mcp.ts
@@ -1,2 +1,2 @@
1
- import { i as withHeadlessServerLock, n as runHeadlessServer, r as takeOverServerHome, t as HeadlessServerBusyError } from "./headless-host-CEb5d-A0.js";
1
+ import { i as withHeadlessServerLock, n as runHeadlessServer, r as takeOverServerHome, t as HeadlessServerBusyError } from "./headless-host-D9y2sBIj.js";
2
2
  export { HeadlessServerBusyError, runHeadlessServer, takeOverServerHome, withHeadlessServerLock };
@@ -1,38 +1,39 @@
1
- import { b as resolveRepoContext, d as git, r as defaultBranch, w as runVcs } from "./src-DtfSndqS.js";
1
+ import { b as resolveRepoContext, d as git, r as defaultBranch, w as runVcs } from "./src-X9ZebeOD.js";
2
2
  import { c as jsonString, m as isStringValue, n as isJsonObject, p as isObjectValue, u as parseJsonText } from "./src-X9phtB2j.js";
3
- import { a as sharedReviewId, c as verifyShareRepository, d as validateShareSources, f as StreamLimitError, h as shareIdSchema, l as exportShare, m as parseShareLink, n as ShareClient, p as readBoundedStream, r as SharePreflightError, s as readShareRepository, t as ShareAuthError, u as referenceCommits } from "./client-UH1bEG7Z.js";
4
- import { f as textualRows, h as diffrMissingError, i as inspectSnapshot, m as diffrExecutable, p as invalidateStructuralComparisons, r as commandSchema } from "./local-data-mbCb1HDH.js";
5
- import { N as reviewDiffrSummarizerInputSchema, O as ReviewFeedbackContactSchema, P as decodeStructuralDiffEvent, a as parseReviewVerbRequest, c as boardIconKind, i as parseReviewDesktopVerbResult, j as ReviewOnboardingRunRequestSchema, k as ReviewFeedbackSchema, l as boardTitle, m as REVIEW_CLIENT_REMOTE, p as REVIEW_CLIENT_HEADER, y as REVIEW_HOST_HEADER } from "./src-DYZLCUP_.js";
6
- import { B as TraceStorageDeniedError, D as listReviewTraceSessions, I as isTraceStorageConfigured, O as loadReviewAgentTrace, R as resolveTraceStorage, T as traceMachineEnabled, at as readStoreAuth, et as shellQuote, it as clearStoreAuth, ot as runStoreLogin, rt as DEFAULT_STORE_ORIGIN, z as selectTraceStorage } from "./review-home-paths-BwH08ihj.js";
7
- import { _ as scopedCoverage, h as emptyCoverage, i as anchorSelection, l as resolveDiffSelection, m as coverageSources, n as SelectionUnavailableError, o as comparisonKey, s as formatAnchor, u as selectionKey, v as subtractIntervals, y as unionIntervals } from "./lens-selection-BxPk53c8.js";
8
- import { B as stepSources, F as selectionReferences, G as lensSelections, J as fileLineRangeSchema, V as UNCATEGORIZED_LENS_ID, _ as boardRepositoryId, f as anchorPins, g as boardLinks, x as elements } from "./stored-document-migration-B29lve9-.js";
3
+ import { a as sharedReviewId, c as verifyShareRepository, d as validateShareSources, f as StreamLimitError, h as shareIdSchema, l as exportShare, m as parseShareLink, n as ShareClient, p as readBoundedStream, r as SharePreflightError, s as readShareRepository, t as ShareAuthError, u as referenceCommits } from "./client-CiB4MRlo.js";
4
+ import { d as textualRows, f as invalidateStructuralComparisons, i as inspectSnapshot, m as diffrMissingError, p as diffrExecutable, r as commandSchema } from "./local-data-m4BCbtSA.js";
5
+ import { N as reviewDiffrSummarizerInputSchema, O as ReviewFeedbackContactSchema, P as decodeStructuralDiffEvent, a as parseReviewVerbRequest, c as boardIconKind, i as parseReviewDesktopVerbResult, j as ReviewOnboardingRunRequestSchema, k as ReviewFeedbackSchema, l as boardTitle, m as REVIEW_CLIENT_REMOTE, p as REVIEW_CLIENT_HEADER, y as REVIEW_HOST_HEADER } from "./src-DYHVzX3b.js";
6
+ import { $ as runStoreLogin, M as selectTraceStorage, N as TraceStorageDeniedError, Q as readStoreAuth, X as DEFAULT_STORE_ORIGIN, Z as clearStoreAuth, b as listReviewTraceSessions, j as resolveTraceStorage, k as isTraceStorageConfigured, q as shellQuote, v as traceMachineEnabled, x as loadReviewAgentTrace } from "./src-Z1x4-Qmb.js";
7
+ import { _ as scopedCoverage, h as emptyCoverage, i as anchorSelection, l as resolveDiffSelection, m as coverageSources, n as SelectionUnavailableError, o as comparisonKey, s as formatAnchor, u as selectionKey, v as subtractIntervals, y as unionIntervals } from "./lens-selection-9byzEgvU.js";
8
+ import { A as elements, E as boardRepositoryId, T as boardLinks, W as selectionReferences, X as UNCATEGORIZED_LENS_ID, Y as stepSources, et as lensSelections, rt as fileLineRangeSchema, x as anchorPins } from "./stored-document-migration-B-lTO-_P.js";
9
9
  import { t as ReviewInputError } from "./input-error-OLgB_h31.js";
10
10
  import { A as processStartIdentity, L as writePrivateJsonAtomic, N as devReviewHome, h as TraceConfigurationError, i as isS3MockMode, j as withFileLock } from "./s3-config-CjcLyFV5.js";
11
11
  import { t as errorMessage } from "./error-message-OtiDonty.js";
12
- import { i as readReviewPackageVersion, n as readBuildCommit, t as findReviewPackageRoot } from "./package-paths-BkeQsdaw.js";
13
- import { _ as reviewInstanceIdentity, n as desktopOwnsHome, o as reviewServerDiscoveryPath, p as desktopUsesHome, r as headlessServerLockPath, t as DESKTOP_TAKEOVER_SIGNAL } from "./server-discovery-DeVTdcqK.js";
14
- import { c as askPicksSchema, d as selectionMarkdown, l as askQuestionSchema, n as askAgentIds, r as askChoiceKinds, s as askPermissionsSchema, t as applyAskChange, u as AgentSelectionSchema } from "./thread-state-BPpvKFwQ.js";
15
- import { t as openReviewProfile } from "./profile-duqp5uPa.js";
16
- import { c as REVIEW_APP_SESSION_ID_HEADER, d as sanitizeUiTelemetryEvent, f as cleanTelemetryText, o as reviewRequestOrigin, r as REVIEW_PERSON_HEADER, s as BUNDLE_FRAME_PATTERN, t as ASK_THREAD_ENV, u as isReportableCleanedMessage } from "./request-origin-icXPv6jh.js";
17
- import { a as defaultAskPermissions, i as askAgents, l as launchAskAgent, n as askAgentSettings, o as detectAskAgents, r as askAgentTakesMcp, t as fuzzyRank } from "./fuzzy-match-D_x3wumC.js";
18
- import { a as inspectQuerySchema, i as renderInstructions, o as queryAnchor, r as instructionsQuerySchema, s as readQuerySchemas, t as authoringTools } from "./authoring-tools-BCquUsB3.js";
19
- import { a as headlessServerOwner, c as stopBackgroundServer, o as recordedBackgroundServer } from "./background-server-Xom8cA_u.js";
12
+ import { i as readReviewPackageVersion, n as readBuildCommit, t as findReviewPackageRoot } from "./package-paths-BeYHYjeR.js";
13
+ import "./review-home-paths-CG-sb9Cw.js";
14
+ import { _ as reviewInstanceIdentity, n as desktopOwnsHome, o as reviewServerDiscoveryPath, p as desktopUsesHome, r as headlessServerLockPath, t as DESKTOP_TAKEOVER_SIGNAL } from "./server-discovery-DKLIOgg3.js";
15
+ import { c as askPicksSchema, d as selectionMarkdown, l as askQuestionSchema, n as askAgentIds, r as askChoiceKinds, s as askPermissionsSchema, t as applyAskChange, u as AgentSelectionSchema } from "./thread-state-CO97FUqK.js";
16
+ import { t as openReviewProfile } from "./profile-BfvRNmRc.js";
17
+ import { c as REVIEW_APP_SESSION_ID_HEADER, d as sanitizeUiTelemetryEvent, f as cleanTelemetryText, o as reviewRequestOrigin, r as REVIEW_PERSON_HEADER, s as BUNDLE_FRAME_PATTERN, t as ASK_THREAD_ENV, u as isReportableCleanedMessage } from "./request-origin-CNSLVn7x.js";
18
+ import { a as defaultAskPermissions, i as askAgents, l as launchAskAgent, n as askAgentSettings, o as detectAskAgents, r as askAgentTakesMcp, t as fuzzyRank } from "./fuzzy-match-CfSxqzBF.js";
19
+ import { a as inspectQuerySchema, i as renderInstructions, o as queryAnchor, r as instructionsQuerySchema, s as readQuerySchemas, t as authoringTools } from "./authoring-tools-BBksBplC.js";
20
+ import { a as headlessServerOwner, c as stopBackgroundServer, o as recordedBackgroundServer } from "./background-server-DHWHzpo5.js";
20
21
  import crypto$1, { createHash, randomBytes, randomUUID } from "node:crypto";
21
22
  import { z } from "zod";
22
23
  import { existsSync, mkdirSync, writeFileSync } from "node:fs";
23
24
  import { mkdir, mkdtemp, readFile, realpath, rm, stat, writeFile } from "node:fs/promises";
24
25
  import path, { join, posix } from "node:path";
26
+ import { Writable } from "node:stream";
25
27
  import os, { tmpdir } from "node:os";
26
28
  import { execFile, spawn } from "node:child_process";
27
- import { promisify } from "node:util";
28
29
  import { setTimeout as setTimeout$1 } from "node:timers/promises";
30
+ import { promisify } from "node:util";
29
31
  import { fileURLToPath, pathToFileURL } from "node:url";
30
- import { Writable } from "node:stream";
31
- import { createServer } from "node:http";
32
32
  import { PROTOCOL_VERSION, RequestError, client, methods } from "@agentclientprotocol/sdk";
33
33
  import { Hono } from "hono";
34
34
  import { stringify } from "smol-toml";
35
35
  import { getRequestListener } from "@hono/node-server";
36
+ import { createServer } from "node:http";
36
37
  import { streamSSE } from "hono/streaming";
37
38
  import { once } from "node:events";
38
39
  //#region src/ask/protocol.ts
@@ -1857,8 +1858,21 @@ var ReviewServerError = class extends Error {
1857
1858
  };
1858
1859
  //#endregion
1859
1860
  //#region src/server/hono-http.ts
1861
+ const H2_FORBIDDEN_HEADERS = [
1862
+ "connection",
1863
+ "keep-alive",
1864
+ "proxy-connection",
1865
+ "transfer-encoding",
1866
+ "upgrade"
1867
+ ];
1860
1868
  function createNodeRequestListener(app) {
1861
- return getRequestListener(app.fetch);
1869
+ return getRequestListener(async (request, env) => {
1870
+ const response = await app.fetch(request, env);
1871
+ if (env.incoming.httpVersionMajor !== 2 || !H2_FORBIDDEN_HEADERS.some((name) => response.headers.has(name))) return response;
1872
+ const stripped = new Response(response.body, response);
1873
+ for (const name of H2_FORBIDDEN_HEADERS) stripped.headers.delete(name);
1874
+ return stripped;
1875
+ });
1862
1876
  }
1863
1877
  function jsonResponse(body, status, options = {}) {
1864
1878
  const headers = new Headers({ "content-type": options.contentType ?? "application/json; charset=utf-8" });
@@ -2623,6 +2637,27 @@ async function resolveReviewStackLayers(subject, reviews, options = {}) {
2623
2637
  };
2624
2638
  });
2625
2639
  }
2640
+ const STACKS_FRESH_MS = 6e4;
2641
+ const stackReads = /* @__PURE__ */ new WeakMap();
2642
+ function readGitHubStacks(runGitHubApi, host, repository, pullRequestNumber) {
2643
+ const reads = stackReads.get(runGitHubApi) ?? /* @__PURE__ */ new Map();
2644
+ stackReads.set(runGitHubApi, reads);
2645
+ const keyOf = (number) => `${host}/${repository}#${number}`;
2646
+ const cached = reads.get(keyOf(pullRequestNumber));
2647
+ if (cached && Date.now() - cached.at < STACKS_FRESH_MS) return cached.stacks;
2648
+ const read = {
2649
+ at: Date.now(),
2650
+ stacks: runGitHubApi(host, `repos/${repository}/stacks?pull_request=${pullRequestNumber}`).then((text) => GitHubStacksSchema.parse(JSON.parse(text)))
2651
+ };
2652
+ reads.set(keyOf(pullRequestNumber), read);
2653
+ read.stacks.then((stacks) => {
2654
+ const stack = stacks.find((candidate) => candidate.pull_requests.some((pr) => pr.number === pullRequestNumber));
2655
+ for (const pr of stack?.pull_requests ?? []) reads.set(keyOf(pr.number), read);
2656
+ }, () => {
2657
+ if (reads.get(keyOf(pullRequestNumber)) === read) reads.delete(keyOf(pullRequestNumber));
2658
+ });
2659
+ return read.stacks;
2660
+ }
2626
2661
  async function gitHubStack(subject, reviews, runGitHubApi) {
2627
2662
  const binding = subject.origin?.pullRequestUrl?.match(/^https:\/\/([a-z0-9.-]+)\/([A-Za-z0-9_.-]+)\/([A-Za-z0-9_.-]+)\/pull\/([1-9]\d*)$/);
2628
2663
  if (!binding) return [];
@@ -2631,7 +2666,7 @@ async function gitHubStack(subject, reviews, runGitHubApi) {
2631
2666
  const repoKey = `https://${host}/${owner}/${repository}`;
2632
2667
  let stacks;
2633
2668
  try {
2634
- stacks = GitHubStacksSchema.parse(JSON.parse(await runGitHubApi(host, `repos/${owner}/${repository}/stacks?pull_request=${number}`)));
2669
+ stacks = await readGitHubStacks(runGitHubApi, host, `${owner}/${repository}`, pullRequestNumber);
2635
2670
  } catch {
2636
2671
  return [];
2637
2672
  }
@@ -1,4 +1,4 @@
1
- import "./src-DYZLCUP_.js";
1
+ import "./src-DYHVzX3b.js";
2
2
  import { z } from "zod";
3
3
  //#region src/viewed-coverage.ts
4
4
  const coverageSchema = z.object({