@dev.fast/whiteboard 0.3.3 → 0.3.4-preview.20261019.126

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 (118) hide show
  1. package/dist/{account-alias-xOdmMnDH.js → account-alias-B5-HYi1D.js} +16 -9
  2. package/dist/{agent-cli-DT7MdaqL.js → agent-cli-CohHf6Ua.js} +15 -10
  3. package/dist/agent-cli-_YyMIMRY.js +2 -0
  4. package/dist/{agent-client-BRBzv3AV.js → agent-client-Dtc-Kn_w.js} +13 -3
  5. package/dist/{authoring-tools-DGSEag8y.js → authoring-tools-B7KU04f7.js} +34 -27
  6. package/dist/{background-server-WKzI_a98.js → background-server-C03RKxKS.js} +5 -5
  7. package/dist/{background-server-C_REWFkG.js → background-server-CB9C4uoc.js} +1 -1
  8. package/dist/build-info.json +1 -1
  9. package/dist/{cli-BBSDi_dX.js → cli-CJaEb7zC.js} +1 -1
  10. package/dist/{cli-runner-DshTBske.js → cli-runner-DGDIqh3V.js} +26 -26
  11. package/dist/cli.js +4 -3
  12. package/dist/{client-BN_FDxFr.js → client-lKVF_Elo.js} +253 -47
  13. package/dist/{fuzzy-match-bFX6wm8j.js → fuzzy-match-BmVJJm9I.js} +42 -14
  14. package/dist/{headless-host-CzvYpKOX.js → headless-host-DRtjf9WA.js} +1 -1
  15. package/dist/{headless-host-CS4Gv0c5.js → headless-host-XhL1X4vX.js} +523 -146
  16. package/dist/lens-selection-CyJapcsl.js +214 -0
  17. package/dist/{local-data-DtQTIzHX.js → local-data-Cpl4ENbJ.js} +2434 -328
  18. package/dist/{mcp-DpKnnmHH.js → mcp-ovmiUE_x.js} +5 -9
  19. package/dist/{package-paths-jMg6JxDP.js → package-paths-BWxO-UEL.js} +1 -1
  20. package/dist/{profile-DaqmODhc.js → profile-BadSkCkI.js} +20 -8
  21. package/dist/profile-DJvkBJNQ.js +2 -0
  22. package/dist/{remote-attach-DCngg8cl.js → remote-attach-Dd-YobM6.js} +4 -4
  23. package/dist/{remote-extensions-BCAbQZTv.js → remote-extensions-CNXwqK0D.js} +3 -3
  24. package/dist/{remote-extensions-Cf3L-ZGG.js → remote-extensions-VP-kfq0C.js} +1 -1
  25. package/dist/{remote-language-server-UWQgpoh-.js → remote-language-server-BXk87KCr.js} +5 -5
  26. package/dist/{remote-uninstall-CcDOcGyi.js → remote-uninstall-DuOzsvaD.js} +6 -6
  27. package/dist/{request-origin-Zcn_CjX4.js → request-origin-B9qCPiVB.js} +45 -12
  28. package/dist/{review-app-launcher-tqSQPlbu.js → review-app-launcher-C7el2Uoy.js} +2 -2
  29. package/dist/{review-home-paths-Lc02WFuX.js → review-home-paths-D8AoCdd2.js} +19 -17
  30. package/dist/{review-telemetry-BHWJsnoD.js → review-telemetry-BsoRMC2w.js} +5 -5
  31. package/dist/runtime-Bj2tD33R.js +27 -0
  32. package/dist/runtime.d.ts +1 -1
  33. package/dist/runtime.js +1 -1
  34. package/dist/{s3-77-qkEhs.js → s3-CsG2EWED.js} +1 -1
  35. package/dist/{s3-config-DDWWMh5x.js → s3-config-CjcLyFV5.js} +5 -3
  36. package/dist/{s3-config-0xuCh-F_.js → s3-config-zz4GWh2T.js} +1 -1
  37. package/dist/server/desktop-host.js +29 -76
  38. package/dist/{server-discovery-BVqrE1_-.js → server-discovery-CKjw3-6h.js} +6 -5
  39. package/dist/sharing/index.d.ts +486 -70
  40. package/dist/sharing/index.js +1 -1
  41. package/dist/{src-DsM3jO8G.js → src-BiWNbcF_.js} +89 -12
  42. package/dist/{src-BMPuxWv4.js → src-WPaQn75m.js} +208 -73
  43. package/dist/{stored-document-migration-CChxtFAy.js → stored-document-migration-dFbewRTG.js} +270 -269
  44. package/dist/{thread-state-5pYr6_zM.js → thread-state-Do5LX10I.js} +7 -2
  45. package/dist/{tool-failure-BFt2xj9i.js → tool-failure-DvI-gys2.js} +10 -3
  46. package/instructions/authoring.md +3 -2
  47. package/package.json +4 -4
  48. package/src/agent-connect.ts +8 -2
  49. package/src/ask/agents.ts +51 -9
  50. package/src/ask/checkout-files.ts +2 -5
  51. package/src/ask/thread-state.ts +4 -0
  52. package/src/ask/thread.ts +16 -0
  53. package/src/ask/threads.ts +24 -3
  54. package/src/cli-install.ts +13 -2
  55. package/src/cli-runner.ts +4 -1
  56. package/src/cli.ts +4 -1
  57. package/src/diff-selection-migration.ts +48 -34
  58. package/src/heading-anchors.ts +42 -0
  59. package/src/lens-selection.ts +38 -2
  60. package/src/review-api/README.md +52 -13
  61. package/src/review-api/activity.ts +1 -4
  62. package/src/review-api/agent-cli.ts +9 -1
  63. package/src/review-api/anchor-quotes.ts +14 -7
  64. package/src/review-api/ask-history.ts +137 -51
  65. package/src/review-api/authoring-tools.ts +45 -30
  66. package/src/review-api/blocks/definition.ts +1 -1
  67. package/src/review-api/blocks/markdown.ts +2 -2
  68. package/src/review-api/board-order.ts +144 -0
  69. package/src/review-api/checkout-groups.ts +560 -0
  70. package/src/review-api/document-headings.ts +58 -27
  71. package/src/review-api/document-text.ts +31 -2
  72. package/src/review-api/document.ts +281 -34
  73. package/src/review-api/foreign-references.ts +328 -0
  74. package/src/review-api/github-provider.ts +51 -13
  75. package/src/review-api/http.ts +702 -123
  76. package/src/review-api/instructions.ts +0 -19
  77. package/src/review-api/link-preview.ts +113 -0
  78. package/src/review-api/local-data.ts +310 -46
  79. package/src/review-api/mcp.ts +3 -11
  80. package/src/review-api/onboarding.ts +1 -1
  81. package/src/review-api/profile.ts +37 -6
  82. package/src/review-api/public-tools.ts +24 -2
  83. package/src/review-api/pull-request.ts +82 -49
  84. package/src/review-api/request-origin.ts +10 -0
  85. package/src/review-api/review-progress.ts +61 -27
  86. package/src/review-api/scratchpad-plan-upgrade.ts +250 -0
  87. package/src/review-api/store-migrations.ts +357 -0
  88. package/src/review-api/store-schema.ts +38 -29
  89. package/src/review-api/store.ts +2144 -480
  90. package/src/review-api/workspaces.ts +52 -13
  91. package/src/review-api/worktree-events.ts +3 -5
  92. package/src/review-api/worktree-source.ts +3 -7
  93. package/src/review-api/worktree-structural.integration.ts +72 -0
  94. package/src/review-stack.ts +15 -23
  95. package/src/runtime.ts +4 -30
  96. package/src/server/desktop-host.ts +6 -1
  97. package/src/server/desktop-server.ts +1 -31
  98. package/src/server/headless-host.ts +21 -14
  99. package/src/server/hono-http.ts +2 -1
  100. package/src/server/legacy-tutorial-cleanup.ts +2 -3
  101. package/src/server/review-gateway-list.ts +3 -5
  102. package/src/server/review-gateway-memory.ts +1 -1
  103. package/src/server/review-lifecycle-telemetry.ts +2 -2
  104. package/src/server/review-server-core.ts +1 -5
  105. package/src/server/structural-comparisons.ts +47 -0
  106. package/src/server-discovery.ts +4 -2
  107. package/src/sharing/export.ts +36 -7
  108. package/src/sharing/host.ts +34 -14
  109. package/src/sharing/import.ts +156 -24
  110. package/src/sharing/repository.ts +128 -20
  111. package/src/startup-trace.ts +3 -3
  112. package/src/stored-document-migration.ts +110 -19
  113. package/src/ui-telemetry-events.ts +33 -11
  114. package/dist/agent-cli-DeCrUC2s.js +0 -2
  115. package/dist/profile-Cz7L781D.js +0 -2
  116. package/dist/runtime-CKiWhGrf.js +0 -52
  117. package/instructions/scratchpad.md +0 -23
  118. package/src/review-preferences.ts +0 -88
@@ -1,22 +1,22 @@
1
1
  #!/usr/bin/env node
2
- import { S as splitGitPatchFiles, a as diff, o as diffFileSummaries } from "../src-BMPuxWv4.js";
2
+ import { a as diff, o as diffFileSummaries, w as splitGitPatchFiles } from "../src-WPaQn75m.js";
3
3
  import { c as jsonString, i as jsonBoolean, n as isJsonObject, p as isObjectValue, s as jsonProperty, u as parseJsonText } from "../src-X9phtB2j.js";
4
- import { d as StreamLimitError, f as readBoundedStream, i as SharedReviewStore } from "../client-BN_FDxFr.js";
5
- import { u as pullRequestProvider } from "../local-data-DtQTIzHX.js";
6
- import { M as reviewDiffrSummarizerInputSchema, O as ReviewGatewayHostSchema, T as ReviewConnectRequestSchema, c as ReviewBugReportMetaV2Schema, d as REVIEW_CLIENT_HEADER, f as REVIEW_CLIENT_REMOTE, g as REVIEW_HOST_HEADER, l as ReviewBugReportRequestSchema, r as parseReviewDesktopVerbFrame, s as parseZod, t as parseReviewCliInstallApplyRequest, u as parseReviewBugReportResponse } from "../src-DsM3jO8G.js";
7
- import { i as reviewInstanceDiscoveryPath, o as reviewLegacyDiscoveryPath } from "../review-home-paths-Lc02WFuX.js";
8
- import { w as resourceReferences } from "../stored-document-migration-CChxtFAy.js";
4
+ import { f as StreamLimitError, i as SharedReviewStore, p as readBoundedStream } from "../client-lKVF_Elo.js";
5
+ import { d as pullRequestProvider } from "../local-data-Cpl4ENbJ.js";
6
+ import { A as ReviewGatewayHostSchema, D as ReviewConnectRequestSchema, N as reviewDiffrSummarizerInputSchema, d as ReviewBugReportRequestSchema, f as parseReviewBugReportResponse, m as REVIEW_CLIENT_REMOTE, p as REVIEW_CLIENT_HEADER, r as parseReviewDesktopVerbFrame, s as parseZod, t as parseReviewCliInstallApplyRequest, u as ReviewBugReportMetaV2Schema, v as REVIEW_HOST_HEADER } from "../src-BiWNbcF_.js";
7
+ import { i as reviewInstanceDiscoveryPath, o as reviewLegacyDiscoveryPath } from "../review-home-paths-D8AoCdd2.js";
8
+ import { A as resourceReferences } from "../stored-document-migration-dFbewRTG.js";
9
9
  import { t as ReviewInputError } from "../input-error-OLgB_h31.js";
10
- import { I as writePrivateJsonAtomic, M as devReviewHome } from "../s3-config-DDWWMh5x.js";
10
+ import { L as writePrivateJsonAtomic, N as devReviewHome } from "../s3-config-CjcLyFV5.js";
11
11
  import { t as errorMessage } from "../error-message-OtiDonty.js";
12
- import { i as readReviewPackageVersion, t as findReviewPackageRoot } from "../package-paths-jMg6JxDP.js";
13
- import { _ as reviewInstanceIdentity, u as REVIEW_INSTANCE_ENV } from "../server-discovery-BVqrE1_-.js";
14
- import { t as openReviewProfile } from "../profile-DaqmODhc.js";
15
- import { r as reviewTelemetryChannel, t as ReviewTelemetry } from "../review-telemetry-BHWJsnoD.js";
16
- import { o as REVIEW_TELEMETRY_TABS } from "../request-origin-Zcn_CjX4.js";
17
- import { c as removeLegacyReviewSkills, d as skipCliInstall, h as detectConnectAgents, i as finishCliInstallUpdate, l as resetCliInstall, m as connectAgent, n as applyCliInstall, o as pathShimPath, r as declineCliInstall, s as removeCliInstall, t as aliasInstallationToAccount, u as resolveCliInstallStatus } from "../account-alias-xOdmMnDH.js";
18
- import { C as saveDiffrSummarizer, E as cliAskTools, S as readDiffrConfig, T as testDiffrSummarizer, _ as DEFAULT_MAX_REQUEST_BYTES, a as drainServerCrashReport, b as GlobalReviewDesktopVerbRelay, c as answerErrorsAsJson, d as legacyModeSchema, f as captureSanitizedUiTelemetry, g as readBoundedRequestJson, h as createNodeRequestListener, l as createWhiteboardCore, m as recordClientError, o as installProcessErrorTelemetry, p as clientErrorsForSession, r as takeOverServerHome, s as serverCrashReportPath, u as serverJson, v as HttpJsonError, w as setDiffrConfigValue, x as migrateDiffrConfig, y as ReviewServerError } from "../headless-host-CS4Gv0c5.js";
19
- import { c as readQuerySchemas } from "../authoring-tools-DGSEag8y.js";
12
+ import { i as readReviewPackageVersion, t as findReviewPackageRoot } from "../package-paths-BWxO-UEL.js";
13
+ import { _ as reviewInstanceIdentity, u as REVIEW_INSTANCE_ENV } from "../server-discovery-CKjw3-6h.js";
14
+ import { t as openReviewProfile } from "../profile-BadSkCkI.js";
15
+ import { r as reviewTelemetryChannel, t as ReviewTelemetry } from "../review-telemetry-BsoRMC2w.js";
16
+ import { l as REVIEW_TELEMETRY_TABS } from "../request-origin-B9qCPiVB.js";
17
+ import { c as removeLegacyReviewSkills, d as skipCliInstall, h as detectConnectAgents, i as finishCliInstallUpdate, l as resetCliInstall, m as connectAgent, n as applyCliInstall, o as pathShimPath, r as declineCliInstall, s as removeCliInstall, t as aliasInstallationToAccount, u as resolveCliInstallStatus } from "../account-alias-B5-HYi1D.js";
18
+ import { C as saveDiffrSummarizer, E as cliAskTools, S as readDiffrConfig, T as testDiffrSummarizer, _ as DEFAULT_MAX_REQUEST_BYTES, a as drainServerCrashReport, b as GlobalReviewDesktopVerbRelay, c as answerErrorsAsJson, d as legacyModeSchema, f as captureSanitizedUiTelemetry, g as readBoundedRequestJson, h as createNodeRequestListener, l as createWhiteboardCore, m as recordClientError, o as installProcessErrorTelemetry, p as clientErrorsForSession, r as takeOverServerHome, s as serverCrashReportPath, u as serverJson, v as HttpJsonError, w as setDiffrConfigValue, x as migrateDiffrConfig, y as ReviewServerError } from "../headless-host-XhL1X4vX.js";
19
+ import { s as readQuerySchemas } from "../authoring-tools-B7KU04f7.js";
20
20
  import crypto, { createHash, randomBytes } from "node:crypto";
21
21
  import { z } from "zod";
22
22
  import fs, { existsSync, readFileSync } from "node:fs";
@@ -263,39 +263,6 @@ function listenForDesktopHostShutdown(hostProcess, onShutdown, onTelemetrySettin
263
263
  return () => hostProcess.off("message", handleMessage);
264
264
  }
265
265
  //#endregion
266
- //#region src/review-preferences.ts
267
- const DEFAULT_REVIEW_PREFERENCES = { scratchpadEnabled: false };
268
- function reviewPreferencesPath(devHome = devReviewHome()) {
269
- return path.join(devHome, "preferences.json");
270
- }
271
- /** A missing or unreadable file falls back to the defaults; it never throws. */
272
- async function readReviewPreferences(devHome) {
273
- try {
274
- return { scratchpadEnabled: parseScratchpadEnabled(parseJsonText(await readFile(reviewPreferencesPath(devHome), "utf8"))) };
275
- } catch {
276
- return { ...DEFAULT_REVIEW_PREFERENCES };
277
- }
278
- }
279
- async function writeReviewPreferences(preferences, devHome) {
280
- const next = { scratchpadEnabled: preferences.scratchpadEnabled === true };
281
- await writePrivateJsonAtomic(reviewPreferencesPath(devHome), next);
282
- return next;
283
- }
284
- /** Reads the scratchpad preference; a missing file means off. */
285
- async function readScratchpadEnabled(devHome) {
286
- return (await readReviewPreferences(devHome)).scratchpadEnabled;
287
- }
288
- /** Sets the scratchpad preference, keeping the other preferences as they are. */
289
- async function writeScratchpadEnabled(enabled, devHome) {
290
- return (await writeReviewPreferences({
291
- ...await readReviewPreferences(devHome),
292
- scratchpadEnabled: enabled
293
- }, devHome)).scratchpadEnabled;
294
- }
295
- function parseScratchpadEnabled(raw) {
296
- return isJsonObject(raw) && raw.scratchpadEnabled === true;
297
- }
298
- //#endregion
299
266
  //#region src/server/crash-report.ts
300
267
  const CRASH_REPORT_URL = "https://bug.dev.fast/api/v2/crashes";
301
268
  const gzipAsync = promisify(gzip);
@@ -810,10 +777,7 @@ function createJsonReviewReporting(store, telemetry, options = {}) {
810
777
  async function removeLegacyTutorial(input) {
811
778
  const tutorialRoot = input.root ?? path.join(devReviewHome(), "tutorial");
812
779
  try {
813
- for (const reviewId of input.store.legacyTutorialIds()) await input.store.execute({ operation: {
814
- type: "delete",
815
- reviewId
816
- } });
780
+ await input.store.removeLegacyTutorials();
817
781
  for (const repository of input.store.repositories()) {
818
782
  const relative = path.relative(tutorialRoot, repository.path);
819
783
  if (relative && !relative.startsWith("..") && !path.isAbsolute(relative)) await input.data.forgetRepository(repository.id);
@@ -1170,9 +1134,9 @@ function decorate(entry, state, hostState) {
1170
1134
  }).sentence;
1171
1135
  return {
1172
1136
  ...entry,
1173
- ...entry.repositoryGroup && { repositoryGroup: {
1174
- key: `${alias}:${entry.repositoryGroup.key}`,
1175
- label: entry.repositoryGroup.label
1137
+ ...entry.project && { project: {
1138
+ id: `${alias}:${entry.project.id}`,
1139
+ name: entry.project.name
1176
1140
  } },
1177
1141
  host: alias,
1178
1142
  hostState,
@@ -1225,9 +1189,9 @@ const listEntrySchema = z.looseObject({
1225
1189
  repositoryName: z.string(),
1226
1190
  viewedAt: z.string().nullable(),
1227
1191
  trashedAt: z.string().nullable(),
1228
- repositoryGroup: z.object({
1229
- key: z.string(),
1230
- label: z.string()
1192
+ project: z.object({
1193
+ id: z.string(),
1194
+ name: z.string()
1231
1195
  }).optional()
1232
1196
  });
1233
1197
  const listEntriesSchema = z.array(z.unknown()).transform((entries) => entries.filter((entry) => listEntrySchema.safeParse(entry).success));
@@ -1981,12 +1945,11 @@ function reviewLifecycleTelemetry(telemetry, firstCreatedAt, onLoggedIn, now = D
1981
1945
  const authoring = /* @__PURE__ */ new Map();
1982
1946
  const capture = (event, properties, reviewUuid) => void telemetry.captureEvent(event, properties, reviewUuid ? { reviewUuid } : void 0);
1983
1947
  return {
1984
- onReviewCreated: ({ reviewId, kind, blocks, via, agentKind }) => {
1948
+ onReviewCreated: ({ reviewId, blocks, via, agentKind }) => {
1985
1949
  if (reported.has(reviewId)) return;
1986
1950
  reported.add(reviewId);
1987
1951
  if (via === "api" || via === "mcp") authoring.set(reviewId, agentKind);
1988
1952
  const properties = {
1989
- kind,
1990
1953
  blocks,
1991
1954
  via
1992
1955
  };
@@ -2071,7 +2034,6 @@ function createGlobalReviewServer(input) {
2071
2034
  const openWatchdog = new ReviewOpenWatchdog({ onTimeout: (context, elapsedMs) => void telemetry.captureEvent("review_open_timeout", { elapsed_ms: elapsedMs }, context) });
2072
2035
  let closing = false;
2073
2036
  const cliPath = path.join(input.packageRoot, "dist", "cli.js");
2074
- let scratchpadEnabled = false;
2075
2037
  const discovery = {
2076
2038
  version: 3,
2077
2039
  instanceId,
@@ -2096,7 +2058,6 @@ function createGlobalReviewServer(input) {
2096
2058
  relay,
2097
2059
  token,
2098
2060
  instanceId,
2099
- scratchpad: () => scratchpadEnabled,
2100
2061
  status: () => {
2101
2062
  const { key, channel, checkout, appVersion, cliVersion, instanceId } = discovery;
2102
2063
  return {
@@ -2131,15 +2092,6 @@ function createGlobalReviewServer(input) {
2131
2092
  app.all("/reviews-api", (context) => gateway.fetch(context.req.raw));
2132
2093
  app.all("/reviews-api/*", (context) => gateway.fetch(context.req.raw));
2133
2094
  app.get("/remote-hosts", () => serverJson(200, gateway.hosts()));
2134
- app.get("/preferences/scratchpad", () => serverJson(200, { enabled: scratchpadEnabled }));
2135
- app.put("/preferences/scratchpad", async (context) => {
2136
- const request = z.object({ enabled: z.boolean() }).safeParse(await readBoundedRequestJson(context.req.raw));
2137
- if (!request.success) throw new ReviewServerError("enabled must be a boolean.", 400);
2138
- scratchpadEnabled = await writeScratchpadEnabled(request.data.enabled);
2139
- if (scratchpadEnabled) await reviewStore.ensureScratchpad();
2140
- reviewStore.invalidateCatalog();
2141
- return serverJson(200, { enabled: scratchpadEnabled });
2142
- });
2143
2095
  app.post("/app/focus", async () => {
2144
2096
  const result = await relay.dispatch({
2145
2097
  name: "focusWindow",
@@ -2268,7 +2220,6 @@ function createGlobalReviewServer(input) {
2268
2220
  store: reviewStore,
2269
2221
  data: input.reviewData
2270
2222
  });
2271
- scratchpadEnabled = await readScratchpadEnabled();
2272
2223
  boundPort = await listen(httpServer, input.port);
2273
2224
  discovery.url = urlForBoundPort();
2274
2225
  for (const discoveryPath of discoveryPaths) await writePrivateJsonAtomic(discoveryPath, discovery);
@@ -2306,7 +2257,7 @@ function sessionStartedSource(reviewStore, reviewUuid) {
2306
2257
  if (!reviewUuid) return {};
2307
2258
  try {
2308
2259
  const snapshot = reviewStore.read(reviewUuid);
2309
- const sourceKind = snapshot.kind === "scratchpad" ? snapshot.kind : snapshot.target?.kind;
2260
+ const sourceKind = snapshot.target?.kind;
2310
2261
  const pullRequestUrl = snapshot.origin?.pullRequestUrl;
2311
2262
  const prProvider = pullRequestUrl && prProviderOf(pullRequestUrl);
2312
2263
  return {
@@ -2393,7 +2344,10 @@ async function runDesktopHost(env = process.env) {
2393
2344
  await mkdir(home, { recursive: true });
2394
2345
  const log = (message) => process.stdout.write(`[Whiteboard gateway] ${message}\n`);
2395
2346
  const { local, shared, server } = await takeOverServerHome(home, async () => {
2396
- const local = await openReviewProfile(home, { manageWorkspaces: true });
2347
+ const local = await openReviewProfile(home, {
2348
+ manageWorkspaces: true,
2349
+ pullRequestStates: true
2350
+ });
2397
2351
  const shared = new SharedReviewStore(path.join(home, "shared-reviews"));
2398
2352
  shared.connect(local.store, local.data);
2399
2353
  await shared.load();
@@ -2467,8 +2421,7 @@ function requiredPositiveInteger(value, name) {
2467
2421
  return parsed;
2468
2422
  }
2469
2423
  if (process.env.DEV_FAST_REVIEW_DESKTOP_HOST_AUTOSTART !== "0") runDesktopHost().catch((error) => {
2470
- process.stderr.write(`${error instanceof Error ? error.stack ?? error.message : String(error)}\n`);
2471
- process.exitCode = 1;
2424
+ process.stderr.write(`${error instanceof Error ? error.stack ?? error.message : String(error)}\n`, () => process.exit(1));
2472
2425
  });
2473
2426
  //#endregion
2474
2427
  export { runDesktopHost };
@@ -1,7 +1,7 @@
1
1
  import { a as jsonNumber, n as isJsonObject, s as jsonProperty, u as parseJsonText } from "./src-X9phtB2j.js";
2
- import { n as parseReviewDesktopDiscovery } from "./src-DsM3jO8G.js";
3
- import { a as reviewInstancesDir, o as reviewLegacyDiscoveryPath, r as reviewDevInstanceKey, t as reviewDefaultInstancePath } from "./review-home-paths-Lc02WFuX.js";
4
- import { M as devReviewHome, O as processIsAlive, j as DEV_REVIEW_HOME_ENV } from "./s3-config-DDWWMh5x.js";
2
+ import { n as parseReviewDesktopDiscovery } from "./src-BiWNbcF_.js";
3
+ import { a as reviewInstancesDir, o as reviewLegacyDiscoveryPath, r as reviewDevInstanceKey, t as reviewDefaultInstancePath } from "./review-home-paths-D8AoCdd2.js";
4
+ import { M as DEV_REVIEW_HOME_ENV, N as devReviewHome, k as processIsAlive } from "./s3-config-CjcLyFV5.js";
5
5
  import { z } from "zod";
6
6
  import { mkdir, readFile, readdir, rm, writeFile } from "node:fs/promises";
7
7
  import path from "node:path";
@@ -196,8 +196,9 @@ function reviewServerStateDir(env = process.env) {
196
196
  function reviewServerDiscoveryPath(stateDir) {
197
197
  return path.join(stateDir, "review-server", "server.json");
198
198
  }
199
- /** Sent by a Desktop taking over the server's state directory. */
200
- const DESKTOP_TAKEOVER_SIGNAL = "SIGUSR2";
199
+ /** Sent by a Desktop taking over the server's state directory. Windows has no
200
+ * SIGUSR2. */
201
+ const DESKTOP_TAKEOVER_SIGNAL = process.platform === "win32" ? "SIGTERM" : "SIGUSR2";
201
202
  function headlessServerLockPath(stateDir) {
202
203
  return path.join(stateDir, "headless-server.lock");
203
204
  }