@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,7 +1,7 @@
1
- import { a as toolResultText, s as ReviewApiError } from "./agent-client-BRBzv3AV.js";
1
+ import { a as toolResultText, s as ReviewApiError } from "./agent-client-Dtc-Kn_w.js";
2
2
  import { t as ReviewInputError } from "./input-error-OLgB_h31.js";
3
- import { n as REVIEW_STATUS_TOOL, t as authoringTools } from "./authoring-tools-DGSEag8y.js";
4
- import { i as publicTool, n as RECOVERY, r as callPublicTool, t as toolFailure } from "./tool-failure-BFt2xj9i.js";
3
+ import { n as REVIEW_STATUS_TOOL, t as authoringTools } from "./authoring-tools-B7KU04f7.js";
4
+ import { i as publicTool, n as RECOVERY, r as callPublicTool, t as toolFailure } from "./tool-failure-DvI-gys2.js";
5
5
  import { Server } from "@modelcontextprotocol/sdk/server/index.js";
6
6
  import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
7
7
  import { CallToolRequestSchema, ListToolsRequestSchema } from "@modelcontextprotocol/sdk/types.js";
@@ -31,14 +31,13 @@ const RELOAD_TOOLS = "Whiteboard is running now, but this session listed Whitebo
31
31
  function mcpAuthoringGuidance(context) {
32
32
  return [
33
33
  "Whiteboard explains code in documents the user reads in Whiteboard Desktop. Call session_get_instructions before creating or editing a Whiteboard and follow it. Read session_capabilities before authoring; session_create opens the new review in Desktop when it is available, so call session_open only for an existing review, and generate software maps only when softwareMapEnabled is true. When the user asks for a Whiteboard or to use Whiteboard (for example to review a branch, a change or a pull request, or to explain a system in Whiteboard), author a Whiteboard with the default topic.",
34
- ...context.scratchpadAvailable ? ["When the user asks in conversation to be shown how code works or wants a diagram, without asking for a Whiteboard, call session_capabilities; if it reports scratchpadEnabled and desktopAvailable, draw on the Whiteboard scratchpad rather than answering only in chat, starting with session_get_instructions({topic:\"scratchpad\"})."] : [],
35
34
  ...context.traceEnabled ? ["For why code exists, what an agent was thinking, or whether an agent solved something before, call session_get_instructions({topic:\"trace-archaeology\"})."] : [],
36
35
  "Never read or write Whiteboard files or SQL."
37
36
  ].join(" ");
38
37
  }
39
38
  async function serveReviewMcp(connect, stdin, stdout, stderr = process.stderr, traceEnabled = false, offlineStatus, onToolCall, environmentAgent) {
40
39
  const instructionsTool = {
41
- ...authoringTools(false, traceEnabled).find((tool) => tool.name === "review_get_instructions"),
40
+ ...authoringTools(traceEnabled).find((tool) => tool.name === "review_get_instructions"),
42
41
  name: "session_get_instructions"
43
42
  };
44
43
  const server = new Server({
@@ -76,10 +75,7 @@ async function serveReviewMcp(connect, stdin, stdout, stderr = process.stderr, t
76
75
  const always = [instructionsTool, REVIEW_STATUS_TOOL].map((fallback) => tools.find((tool) => tool.name === fallback.name) ?? fallback);
77
76
  return { tools: [...always, ...tools.filter((tool) => !always.includes(tool))].map(({ name, description, inputSchema }) => ({
78
77
  name,
79
- description: name === instructionsTool.name ? `${mcpAuthoringGuidance({
80
- scratchpadAvailable: true,
81
- traceEnabled
82
- })}\n\n${description}` : description,
78
+ description: name === instructionsTool.name ? `${mcpAuthoringGuidance({ traceEnabled })}\n\n${description}` : description,
83
79
  inputSchema
84
80
  })) };
85
81
  });
@@ -1,5 +1,5 @@
1
1
  import { c as jsonString, o as jsonObject, u as parseJsonText } from "./src-X9phtB2j.js";
2
- import "./review-home-paths-Lc02WFuX.js";
2
+ import "./review-home-paths-D8AoCdd2.js";
3
3
  import { readFileSync } from "node:fs";
4
4
  import path from "node:path";
5
5
  import { fileURLToPath } from "node:url";
@@ -1,6 +1,6 @@
1
- import { o as initializeReviewStoreSchema, t as openLocalReviewStore } from "./local-data-DtQTIzHX.js";
2
- import "./review-home-paths-Lc02WFuX.js";
3
- import { A as withFileLock } from "./s3-config-DDWWMh5x.js";
1
+ import { a as projectOfCheckout, g as CheckoutGroups, o as groupCheckoutsAhead, s as initializeReviewStoreSchema, t as openLocalReviewStore } from "./local-data-Cpl4ENbJ.js";
2
+ import "./review-home-paths-D8AoCdd2.js";
3
+ import { j as withFileLock } from "./s3-config-CjcLyFV5.js";
4
4
  import { access, mkdir } from "node:fs/promises";
5
5
  import path from "node:path";
6
6
  import { DatabaseSync } from "node:sqlite";
@@ -18,7 +18,11 @@ async function openReviewProfile(home, options) {
18
18
  });
19
19
  const outcome = await withFileLock(path.join(home, ".review-profile-startup"), lockOptions, async () => {
20
20
  for (const source of [path.join(home, "review-server", "reviews.db"), path.join(home, "reviews.db")]) await importHeadlessStore(home, source);
21
- return openLocalReviewStore(path.join(home, "review-api.db"), options);
21
+ const database = path.join(home, "review-api.db");
22
+ return openLocalReviewStore(database, {
23
+ ...options,
24
+ checkoutOwners: await groupCheckoutsAhead(database)
25
+ });
22
26
  });
23
27
  if (!outcome.acquired) throw new Error("Another Review process is initializing this profile. Retry shortly.");
24
28
  return outcome.result;
@@ -45,19 +49,27 @@ async function importHeadlessStore(home, source) {
45
49
  try {
46
50
  if (database.prepare("SELECT 1 FROM headless.reviews s JOIN reviews t ON s.id=t.id LIMIT 1").get()) throw new Error(`Cannot merge ${source}: the shared store already contains one of its review IDs. Both databases are unchanged.`);
47
51
  database.exec(`
48
- INSERT INTO repositories SELECT s.* FROM headless.repositories s WHERE NOT EXISTS (SELECT 1 FROM repositories t WHERE t.path=s.path);
52
+ INSERT INTO repositories(id,path,name) SELECT s.id,s.path,s.name FROM headless.repositories s WHERE NOT EXISTS (SELECT 1 FROM repositories t WHERE t.path=s.path);
49
53
  CREATE TEMP TABLE repository_ids AS SELECT s.id old_id,t.id new_id FROM headless.repositories s JOIN repositories t ON s.path=t.path;
50
54
  `);
51
55
  if (database.prepare(`SELECT 1 FROM headless.versions s LEFT JOIN repository_ids r ON json_extract(s.snapshot,'$.pins.repositoryId')=r.old_id WHERE r.old_id IS NULL LIMIT 1`).get()) throw new Error(`Cannot merge ${source}: a version refers to an unregistered repository. Both databases are unchanged.`);
52
56
  if (database.prepare(`SELECT 1 FROM headless.resources s JOIN resources t ON s.id=t.id JOIN repository_ids r ON s.repository_id=r.old_id
53
57
  WHERE t.repository_id!=r.new_id OR t.kind!=s.kind OR t.mime_type!=s.mime_type OR t.data IS NOT s.data LIMIT 1`).get()) throw new Error(`Cannot merge ${source}: a resource ID has different content. Both databases are unchanged.`);
58
+ if (database.prepare("SELECT 1 FROM pragma_table_info('reviews') WHERE name='project_id'").get()) {
59
+ const groups = new CheckoutGroups(database);
60
+ for (const { new_id: repositoryId } of database.prepare("SELECT new_id FROM repository_ids").all()) projectOfCheckout(database, String(repositoryId), groups);
61
+ database.exec(`INSERT INTO reviews(id,version,next_id,project_id) SELECT s.id,s.version,s.next_id,p.project_id
62
+ FROM headless.reviews s JOIN headless.versions v ON v.review_id=s.id AND v.version=s.version
63
+ JOIN repository_ids r ON json_extract(v.snapshot,'$.pins.repositoryId')=r.old_id
64
+ JOIN repositories p ON p.id=r.new_id;`);
65
+ } else database.exec("INSERT INTO reviews(id,version,next_id) SELECT id,version,next_id FROM headless.reviews;");
54
66
  database.exec(`
55
67
  INSERT OR IGNORE INTO resources SELECT s.id,r.new_id,s.kind,s.mime_type,s.data FROM headless.resources s JOIN repository_ids r ON s.repository_id=r.old_id;
56
- INSERT INTO reviews SELECT * FROM headless.reviews;
57
- INSERT INTO versions SELECT s.review_id,s.version,
68
+ INSERT INTO versions(review_id,version,snapshot,thread_id,author_kind) SELECT s.review_id,s.version,
58
69
  CASE WHEN json_type(s.snapshot,'$.target')='object'
59
70
  THEN json_set(s.snapshot,'$.pins.repositoryId',r.new_id,'$.target.repositoryId',r.new_id)
60
- ELSE json_set(s.snapshot,'$.pins.repositoryId',r.new_id) END
71
+ ELSE json_set(s.snapshot,'$.pins.repositoryId',r.new_id) END,
72
+ NULL, NULL
61
73
  FROM headless.versions s JOIN repository_ids r ON json_extract(s.snapshot,'$.pins.repositoryId')=r.old_id;
62
74
  INSERT INTO review_attention SELECT * FROM headless.review_attention;
63
75
  `);
@@ -0,0 +1,2 @@
1
+ import { t as openReviewProfile } from "./profile-BadSkCkI.js";
2
+ export { openReviewProfile };
@@ -1,7 +1,7 @@
1
- import { i as readReviewPackageVersion } from "./package-paths-jMg6JxDP.js";
2
- import { a as readReviewServerHealth, l as serverNotReady } from "./server-discovery-BVqrE1_-.js";
3
- import { c as stopBackgroundServer, o as recordedBackgroundServer, r as ensureBackgroundServer } from "./background-server-WKzI_a98.js";
4
- import { t as ensureRemoteLanguageServer } from "./remote-language-server-UWQgpoh-.js";
1
+ import { i as readReviewPackageVersion } from "./package-paths-BWxO-UEL.js";
2
+ import { a as readReviewServerHealth, l as serverNotReady } from "./server-discovery-CKjw3-6h.js";
3
+ import { c as stopBackgroundServer, o as recordedBackgroundServer, r as ensureBackgroundServer } from "./background-server-C03RKxKS.js";
4
+ import { t as ensureRemoteLanguageServer } from "./remote-language-server-BXk87KCr.js";
5
5
  import path from "node:path";
6
6
  import { spawn } from "node:child_process";
7
7
  import { gt, valid } from "semver";
@@ -1,7 +1,7 @@
1
1
  import { u as parseJsonText } from "./src-X9phtB2j.js";
2
- import "./review-home-paths-Lc02WFuX.js";
3
- import { M as devReviewHome } from "./s3-config-DDWWMh5x.js";
4
- import { t as findReviewPackageRoot } from "./package-paths-jMg6JxDP.js";
2
+ import "./review-home-paths-D8AoCdd2.js";
3
+ import { N as devReviewHome } from "./s3-config-CjcLyFV5.js";
4
+ import { t as findReviewPackageRoot } from "./package-paths-BWxO-UEL.js";
5
5
  import { createHash } from "node:crypto";
6
6
  import { z } from "zod";
7
7
  import { createReadStream, createWriteStream } from "node:fs";
@@ -1,2 +1,2 @@
1
- import { t as ensureRemoteExtensions } from "./remote-extensions-BCAbQZTv.js";
1
+ import { t as ensureRemoteExtensions } from "./remote-extensions-CNXwqK0D.js";
2
2
  export { ensureRemoteExtensions };
@@ -1,8 +1,8 @@
1
- import "./review-home-paths-Lc02WFuX.js";
2
- import { A as withFileLock, k as processStartIdentity } from "./s3-config-DDWWMh5x.js";
3
- import { t as findReviewPackageRoot } from "./package-paths-jMg6JxDP.js";
4
- import { n as cliSpawn, s as spawnDetached } from "./background-server-WKzI_a98.js";
5
- import { r as remoteServerPaths, t as ensureRemoteExtensions } from "./remote-extensions-BCAbQZTv.js";
1
+ import "./review-home-paths-D8AoCdd2.js";
2
+ import { A as processStartIdentity, j as withFileLock } from "./s3-config-CjcLyFV5.js";
3
+ import { t as findReviewPackageRoot } from "./package-paths-BWxO-UEL.js";
4
+ import { n as cliSpawn, s as spawnDetached } from "./background-server-C03RKxKS.js";
5
+ import { r as remoteServerPaths, t as ensureRemoteExtensions } from "./remote-extensions-CNXwqK0D.js";
6
6
  import { randomBytes } from "node:crypto";
7
7
  import { z } from "zod";
8
8
  import { mkdir, readFile, rename, stat, writeFile } from "node:fs/promises";
@@ -1,9 +1,9 @@
1
- import { b as REVIEW_REMOTE_INSTALL_LOCK, x as REVIEW_REMOTE_WRAPPER_MARK } from "./src-DsM3jO8G.js";
2
- import "./review-home-paths-Lc02WFuX.js";
3
- import { j as DEV_REVIEW_HOME_ENV } from "./s3-config-DDWWMh5x.js";
4
- import { c as stopBackgroundServer, o as recordedBackgroundServer } from "./background-server-WKzI_a98.js";
5
- import { i as whiteboardRemoteHome } from "./remote-extensions-BCAbQZTv.js";
6
- import { n as remoteLanguageServerGroups, r as stopProcessGroup } from "./remote-language-server-UWQgpoh-.js";
1
+ import { C as REVIEW_REMOTE_WRAPPER_MARK, S as REVIEW_REMOTE_INSTALL_LOCK } from "./src-BiWNbcF_.js";
2
+ import "./review-home-paths-D8AoCdd2.js";
3
+ import { M as DEV_REVIEW_HOME_ENV } from "./s3-config-CjcLyFV5.js";
4
+ import { c as stopBackgroundServer, o as recordedBackgroundServer } from "./background-server-C03RKxKS.js";
5
+ import { i as whiteboardRemoteHome } from "./remote-extensions-CNXwqK0D.js";
6
+ import { n as remoteLanguageServerGroups, r as stopProcessGroup } from "./remote-language-server-BXk87KCr.js";
7
7
  import { existsSync } from "node:fs";
8
8
  import { lstat, mkdir, readFile, readdir, rm, stat } from "node:fs/promises";
9
9
  import path from "node:path";
@@ -1,6 +1,7 @@
1
1
  import { a as jsonNumber, c as jsonString, i as jsonBoolean, n as isJsonObject } from "./src-X9phtB2j.js";
2
- import { S as REVIEW_THEME_CHOICES, h as REVIEW_DIFF_LAYOUT_SCOPES, m as REVIEW_DIFF_LAYOUTS } from "./src-DsM3jO8G.js";
3
- import { n as askAgentIds } from "./thread-state-5pYr6_zM.js";
2
+ import { _ as REVIEW_DIFF_LAYOUT_SCOPES, g as REVIEW_DIFF_LAYOUTS, w as REVIEW_THEME_CHOICES } from "./src-BiWNbcF_.js";
3
+ import { t as SELECTION_UNAVAILABLE_REASONS } from "./lens-selection-CyJapcsl.js";
4
+ import { n as askAgentIds } from "./thread-state-Do5LX10I.js";
4
5
  import { z } from "zod";
5
6
  //#region src/telemetry-clean-text.ts
6
7
  const USER_DATA_REGEXES = [
@@ -155,6 +156,12 @@ const PEEK_VIA = [
155
156
  "diff_definition"
156
157
  ];
157
158
  const PEEK_ROOT_KIND = ["range"];
159
+ /** `unresolved`: progress finished without this selection; `error`: progress failed. */
160
+ const PEEK_FAILURE_REASON = [
161
+ ...SELECTION_UNAVAILABLE_REASONS,
162
+ "error",
163
+ "unresolved"
164
+ ];
158
165
  const LSP_FEATURE = [
159
166
  "hover",
160
167
  "goto_definition",
@@ -224,7 +231,6 @@ const SETTING_NAME = [
224
231
  "telemetry_enabled",
225
232
  "keymap",
226
233
  "software_map_enabled",
227
- "scratchpad_enabled",
228
234
  "diffr_config",
229
235
  "theme",
230
236
  "ctrl_tab",
@@ -238,11 +244,11 @@ const REVIEW_OPENED_VIA = [
238
244
  "cli",
239
245
  "other"
240
246
  ];
241
- /** Where a review's source comes from: its target's kind, or the one scratchpad. */
247
+ /** Where a review's source comes from: its target's kind. */
242
248
  const SESSION_SOURCE_KIND = [
243
249
  "worktree",
244
250
  "commits",
245
- "scratchpad"
251
+ "project"
246
252
  ];
247
253
  /**
248
254
  * The authoring agent a review session is attributed to. This is the one
@@ -324,12 +330,21 @@ const INSTALL_LOCATION = [
324
330
  ];
325
331
  const DIFF_OPENED_VIA = [
326
332
  "topbar",
333
+ "sidebar",
327
334
  "lens",
328
335
  "locate",
329
336
  "file_picker"
330
337
  ];
331
338
  /** Which diff opened: a commit's, or a file diff drawn plain or structural. */
332
339
  const DIFF_OPENED_KIND = ["commit", "structural"];
340
+ const DIFF_FAILED_REASON = [
341
+ "missing_binary",
342
+ "process_exit",
343
+ "stream_ended",
344
+ "aborted",
345
+ "file_error",
346
+ "other"
347
+ ];
333
348
  /** GitHub Enterprise is any GitHub host but github.com. */
334
349
  const PR_PROVIDER = [
335
350
  "github",
@@ -356,7 +371,12 @@ const ONBOARDING_STEP = [
356
371
  "run"
357
372
  ];
358
373
  const RUN_MODE = ["draw", "copy"];
359
- const NEW_WHITEBOARD_VIA = ["button", "command"];
374
+ const NEW_WHITEBOARD_VIA = [
375
+ "button",
376
+ "command",
377
+ "sidebar"
378
+ ];
379
+ const NEW_WHITEBOARD_MODE = [...RUN_MODE, "empty"];
360
380
  const FIND_SURFACE = ["review", "diff"];
361
381
  const DISCORD_VIA = [
362
382
  "topbar",
@@ -677,9 +697,12 @@ const UI_TELEMETRY_EVENTS = {
677
697
  via: DIFF_OPENED_VIA
678
698
  }
679
699
  },
680
- scratchpad_opened: {
681
- event: "review_scratchpad_opened",
682
- properties: {}
700
+ diff_failed: {
701
+ event: "review_diff_failed",
702
+ properties: {
703
+ reason: DIFF_FAILED_REASON,
704
+ files: "number"
705
+ }
683
706
  },
684
707
  discord_clicked: {
685
708
  event: "review_discord_clicked",
@@ -699,7 +722,10 @@ const UI_TELEMETRY_EVENTS = {
699
722
  },
700
723
  peek_resolve_failed: {
701
724
  event: "review_peek_resolve_failed",
702
- properties: { root_kind: PEEK_ROOT_KIND }
725
+ properties: {
726
+ root_kind: PEEK_ROOT_KIND,
727
+ reason: PEEK_FAILURE_REASON
728
+ }
703
729
  },
704
730
  review_deleted: {
705
731
  event: "review_review_deleted",
@@ -744,7 +770,7 @@ const UI_TELEMETRY_EVENTS = {
744
770
  new_whiteboard_started: {
745
771
  event: "review_new_whiteboard_started",
746
772
  properties: {
747
- mode: RUN_MODE,
773
+ mode: NEW_WHITEBOARD_MODE,
748
774
  embedded: "boolean",
749
775
  agent: askAgentIds
750
776
  }
@@ -882,6 +908,13 @@ function isValidReviewAppSessionId(value) {
882
908
  */
883
909
  const REVIEW_VIA_HEADER = "x-review-via";
884
910
  const REVIEW_AGENT_HEADER = "x-review-agent";
911
+ /** The Ask thread a request comes from. The CLI reads it from ASK_THREAD_ENV,
912
+ * which Desktop sets for the thread's agent. */
913
+ const REVIEW_THREAD_HEADER = "x-review-thread";
914
+ const ASK_THREAD_ENV = "DEV_REVIEW_ASK_THREAD";
915
+ /** Set by Desktop and the canvas on a command a person gave, such as a new
916
+ * board from the sidebar; its version is credited to them. */
917
+ const REVIEW_PERSON_HEADER = "x-review-person";
885
918
  const viaSchema = z.enum([
886
919
  "api",
887
920
  "mcp",
@@ -897,4 +930,4 @@ function reviewRequestOrigin(headers) {
897
930
  } : { via };
898
931
  }
899
932
  //#endregion
900
- export { REVIEW_APP_SESSION_ID_HEADER as a, sanitizeUiTelemetryEvent as c, BUNDLE_FRAME_PATTERN as i, cleanTelemetryText as l, REVIEW_VIA_HEADER as n, REVIEW_TELEMETRY_TABS as o, reviewRequestOrigin as r, isReportableCleanedMessage as s, REVIEW_AGENT_HEADER as t };
933
+ export { REVIEW_VIA_HEADER as a, REVIEW_APP_SESSION_ID_HEADER as c, sanitizeUiTelemetryEvent as d, cleanTelemetryText as f, REVIEW_THREAD_HEADER as i, REVIEW_TELEMETRY_TABS as l, REVIEW_AGENT_HEADER as n, reviewRequestOrigin as o, REVIEW_PERSON_HEADER as r, BUNDLE_FRAME_PATTERN as s, ASK_THREAD_ENV as t, isReportableCleanedMessage as u };
@@ -1,5 +1,5 @@
1
- import { o as parseReviewVerbResponse } from "./src-DsM3jO8G.js";
2
- import { b as selectReviewInstance, m as healthyReviewInstance, v as reviewInstanceStartHint, y as reviewInstanceUnavailable } from "./server-discovery-BVqrE1_-.js";
1
+ import { o as parseReviewVerbResponse } from "./src-BiWNbcF_.js";
2
+ import { b as selectReviewInstance, m as healthyReviewInstance, v as reviewInstanceStartHint, y as reviewInstanceUnavailable } from "./server-discovery-CKjw3-6h.js";
3
3
  import { closeSync, existsSync, fstatSync, mkdtempSync, openSync, readSync } from "node:fs";
4
4
  import path from "node:path";
5
5
  import { homedir, tmpdir } from "node:os";
@@ -1,7 +1,7 @@
1
- import { d as git, f as gitAt, y as resolveRepoContext } from "./src-BMPuxWv4.js";
1
+ import { E as runVcs, d as git, f as gitAt, x as resolveRepoContext } from "./src-WPaQn75m.js";
2
2
  import { a as jsonNumber, c as jsonString, i as jsonBoolean, m as isStringValue, n as isJsonObject, o as jsonObject, r as jsonArray, t as isJsonArray, u as parseJsonText } from "./src-X9phtB2j.js";
3
3
  import { a as TRACE_STORE_CLIENT_ID, b as commitShaSchema, c as deleteStoreResponseSchema, d as listUploadsResponseSchema, f as storeErrorCodeSchema, g as uploadManifestMismatch, h as traceObjectNameSchema, i as storeRoutes, l as listSessionsResponseSchema, m as storeResponseSchema, n as DEVICE_TOKEN_PATH, o as beginUploadResponseSchema, p as storeErrorEnvelopeSchema, r as SESSION_PATH, s as completeUploadResponseSchema, t as DEVICE_CODE_PATH, u as listUploadsQuerySchema, x as sessionIdSchema } from "./src-CGP5ytbV.js";
4
- import { E as writeTraceConfigFile, F as writeFileAtomicAsync, I as writePrivateJsonAtomic, M as devReviewHome, N as normalizeStoreOrigin, P as writeFileAtomic, S as readTraceConfigFile, _ as emptyTraceConfig, b as hostedCaptureEnabled, c as resolveS3Setup, d as traceEnvPath, f as traceEnvValue$1, g as currentStore, h as TraceConfigurationError, i as isS3MockMode, l as s3CacheIdentity, m as DEFAULT_HOSTED_ORIGIN, n as clearTraceEnvCache$1, p as traceSettingsPath, u as s3MockRoot, v as enabledOriginsOf, w as s3Store, x as hostedOrigin, y as hasHostedStore } from "./s3-config-DDWWMh5x.js";
4
+ import { E as writeTraceConfigFile, F as writeFileAtomic, I as writeFileAtomicAsync, L as writePrivateJsonAtomic, N as devReviewHome, P as normalizeStoreOrigin, S as readTraceConfigFile, _ as emptyTraceConfig, b as hostedCaptureEnabled, c as resolveS3Setup, d as traceEnvPath, f as traceEnvValue$1, g as currentStore, h as TraceConfigurationError, i as isS3MockMode, l as s3CacheIdentity, m as DEFAULT_HOSTED_ORIGIN, n as clearTraceEnvCache$1, p as traceSettingsPath, u as s3MockRoot, v as enabledOriginsOf, w as s3Store, x as hostedOrigin, y as hasHostedStore } from "./s3-config-CjcLyFV5.js";
5
5
  import { t as errorMessage } from "./error-message-OtiDonty.js";
6
6
  import crypto, { createHash, randomBytes } from "node:crypto";
7
7
  import { z } from "zod";
@@ -9,8 +9,7 @@ import { accessSync, closeSync, constants, createReadStream, createWriteStream,
9
9
  import { chmod, mkdir, mkdtemp, readFile, readdir, rename, rm, stat, writeFile } from "node:fs/promises";
10
10
  import path from "node:path";
11
11
  import os, { homedir, tmpdir } from "node:os";
12
- import { execFile, spawn } from "node:child_process";
13
- import { promisify } from "node:util";
12
+ import { spawn } from "node:child_process";
14
13
  import { Readable, Transform } from "node:stream";
15
14
  import { AsyncLocalStorage } from "node:async_hooks";
16
15
  import { pipeline } from "node:stream/promises";
@@ -401,14 +400,18 @@ async function runStoreLogin(input) {
401
400
  } catch (error) {
402
401
  return failWithJsonError(output, "login", error instanceof StoreApiError ? error.message : "Could not start the login.");
403
402
  }
403
+ const pending = {
404
+ url: device.verification_uri_complete,
405
+ userCode: device.user_code
406
+ };
404
407
  humanStream(output).write(`Open ${device.verification_uri_complete}\n`);
405
408
  humanStream(output).write(`Code: ${device.user_code}\n`);
406
409
  emitJsonEvent(output, {
407
410
  event: "login",
408
411
  status: "pending",
409
- url: device.verification_uri_complete,
410
- userCode: device.user_code
412
+ ...pending
411
413
  });
414
+ input.onDeviceCode?.(pending);
412
415
  if (!input.noBrowser) await openUrl(device.verification_uri_complete);
413
416
  let intervalMs = Math.max(1, device.interval) * 1e3;
414
417
  const expiresAt = Date.now() + device.expires_in * 1e3;
@@ -2537,7 +2540,7 @@ function isTraceStorageConfigured(scope = {}) {
2537
2540
  }
2538
2541
  /** Loads the direct-store implementation on demand, without opening a store. */
2539
2542
  async function loadS3TraceStorage() {
2540
- return (await import("./s3-77-qkEhs.js")).S3TraceStorage;
2543
+ return (await import("./s3-CsG2EWED.js")).S3TraceStorage;
2541
2544
  }
2542
2545
  //#endregion
2543
2546
  //#region ../trace-core/src/trace-upload-status.ts
@@ -5263,7 +5266,7 @@ async function configureTraceMachine(input) {
5263
5266
  if (input.verify !== false) {
5264
5267
  if (env.TRACE_R2_MODE === "mock") verifiedAt = (/* @__PURE__ */ new Date()).toISOString();
5265
5268
  else {
5266
- const { S3TraceStorage } = await import("./s3-77-qkEhs.js");
5269
+ const { S3TraceStorage } = await import("./s3-CsG2EWED.js");
5267
5270
  const readiness = await S3TraceStorage.fromCredentials({
5268
5271
  endpoint: credentials.endpoint,
5269
5272
  bucket: credentials.bucket,
@@ -5397,7 +5400,6 @@ async function writeSettings(filePath, settings) {
5397
5400
  }
5398
5401
  //#endregion
5399
5402
  //#region ../trace-core/src/trace-hook-runner.ts
5400
- const execFileAsync = promisify(execFile);
5401
5403
  const SESSION_ID_REGEX = /^[A-Za-z0-9][A-Za-z0-9._-]{7,127}$/;
5402
5404
  /**
5403
5405
  * Starts `whiteboard trace sync` detached for one session. The attempt names
@@ -5479,7 +5481,7 @@ async function runTraceHook(input) {
5479
5481
  ], { allowFailure: true });
5480
5482
  let sessionFilePath = null;
5481
5483
  if (gitPathResult.ok && gitPathResult.stdout.trim()) sessionFilePath = gitPathResult.stdout.trim();
5482
- const jjRootResult = await execFileAsync("jj", ["root"], { cwd: input.cwd }).catch(() => null);
5484
+ const jjRootResult = await runVcs("jj", ["root"], { cwd: input.cwd }).catch(() => null);
5483
5485
  if (!sessionFilePath && jjRootResult?.stdout.trim()) sessionFilePath = path.join(jjRootResult.stdout.trim(), ".jj", "agent-session");
5484
5486
  let remainingSessions = [];
5485
5487
  if (sessionFilePath) {
@@ -5498,24 +5500,24 @@ async function runTraceHook(input) {
5498
5500
  if (jjRootResult?.stdout.trim()) {
5499
5501
  if ((isStart || isHeartbeat) && remainingSessions.length > 0) {
5500
5502
  const templateVal = jjCommitTrailersConfigValue(remainingSessions);
5501
- await execFileAsync("jj", [
5503
+ await runVcs("jj", [
5502
5504
  "config",
5503
5505
  "set",
5504
5506
  "--repo",
5505
5507
  "templates.commit_trailers",
5506
- templateVal
5508
+ { value: templateVal }
5507
5509
  ], { cwd: input.cwd }).catch(() => void 0);
5508
5510
  } else if (isEnd) {
5509
5511
  if (remainingSessions.length > 0) {
5510
5512
  const templateVal = jjCommitTrailersConfigValue(remainingSessions);
5511
- await execFileAsync("jj", [
5513
+ await runVcs("jj", [
5512
5514
  "config",
5513
5515
  "set",
5514
5516
  "--repo",
5515
5517
  "templates.commit_trailers",
5516
- templateVal
5518
+ { value: templateVal }
5517
5519
  ], { cwd: input.cwd }).catch(() => void 0);
5518
- } else await execFileAsync("jj", [
5520
+ } else await runVcs("jj", [
5519
5521
  "config",
5520
5522
  "unset",
5521
5523
  "--repo",
@@ -5734,7 +5736,7 @@ async function runTraceStatus(input) {
5734
5736
  input.stderr.write("Upload status filters require hosted storage.\n");
5735
5737
  return 1;
5736
5738
  }
5737
- const [{ S3TraceStorage }, { describeS3Setup, noTraceConfigurationMessage }] = await Promise.all([import("./s3-77-qkEhs.js"), import("./s3-config-0xuCh-F_.js")]);
5739
+ const [{ S3TraceStorage }, { describeS3Setup, noTraceConfigurationMessage }] = await Promise.all([import("./s3-CsG2EWED.js"), import("./s3-config-zz4GWh2T.js")]);
5738
5740
  const setup = describeS3Setup(input.scope.env);
5739
5741
  input.stdout.write(`Checking trace configuration (${setup.envPath})…\n`);
5740
5742
  for (const failure of await listTraceSyncFailures(input.scope.devHome)) input.stdout.write(describeTraceSyncFailure(failure));
@@ -6401,4 +6403,4 @@ function reviewDesktopStateDir(env = process.env) {
6401
6403
  return path.join(reviewDesktopRoot(env), "state");
6402
6404
  }
6403
6405
  //#endregion
6404
- export { resolveTraceCommand as $, runTraceDeny as A, TraceStorageDeniedError as B, disableTraceMachine as C, listReviewTraceSessions as D, traceMachineStatus as E, describeSelection as F, listTraceRepositoryRoots as G, resolveTraceRepositoryTarget as H, isTraceStorageConfigured as I, HOSTED_CAPTURE_SCOPE_DESCRIPTION as J, traceRepositoryStatus as K, loadS3TraceStorage as L, runTraceSessions as M, runTraceStoreDelete as N, loadReviewAgentTrace as O, runTraceStoreInfo as P, removeAgentTraceHook as Q, resolveTraceStorage as R, configureTraceMachine as S, traceMachineEnabled as T, disableAllTraceRepositories as U, requireTraceConsent as V, enableTraceRepository as W, describeTraceHookOwners as X, AGENT_TRACE_HOOK_AGENTS as Y, installHarnessHooks as Z, runTraceRepair as _, reviewInstancesDir as a, openUrlInBrowser as at, runTraceGitHook as b, registerTraceCommands as c, runStoreLogout as ct, runTraceList as d, StoreClient as dt, shellQuote as et, runTracePull as f, withStoreAuthorization as ft, runTraceInstallMachine as g, jsonRequestedInArgv as gt, runTraceEnable as h, humanStream as ht, reviewInstanceDiscoveryPath as i, clearStoreAuth as it, runTraceOnboard as j, runTraceAllow as k, resolveTraceReadStorage as l, runStoreWhoami as lt, runTraceDisable as m, failWithJsonError as mt, reviewDesktopStateDir as n, traceScope as nt, reviewLegacyDiscoveryPath as o, readStoreAuth as ot, runTraceShow as p, emitJsonEvent as pt, readTraceUserConfig as q, reviewDevInstanceKey as r, DEFAULT_STORE_ORIGIN as rt, safeStorageSegment as s, runStoreLogin as st, reviewDefaultInstancePath as t, traceHomeDir as tt, runTraceBlame as u, StoreApiError as ut, runTraceStatus as v, readLegacyCaptureSettings as w, runTraceHook as x, runTraceSync as y, selectTraceStorage as z };
6406
+ export { resolveTraceCommand as $, runTraceDeny as A, TraceStorageDeniedError as B, disableTraceMachine as C, listReviewTraceSessions as D, traceMachineStatus as E, describeSelection as F, listTraceRepositoryRoots as G, resolveTraceRepositoryTarget as H, isTraceStorageConfigured as I, HOSTED_CAPTURE_SCOPE_DESCRIPTION as J, traceRepositoryStatus as K, loadS3TraceStorage as L, runTraceSessions as M, runTraceStoreDelete as N, loadReviewAgentTrace as O, runTraceStoreInfo as P, removeAgentTraceHook as Q, resolveTraceStorage as R, configureTraceMachine as S, traceMachineEnabled as T, disableAllTraceRepositories as U, requireTraceConsent as V, enableTraceRepository as W, describeTraceHookOwners as X, AGENT_TRACE_HOOK_AGENTS as Y, installHarnessHooks as Z, runTraceRepair as _, reviewInstancesDir as a, readStoreAuth as at, runTraceGitHook as b, registerTraceCommands as c, runStoreWhoami as ct, runTraceList as d, withStoreAuthorization as dt, shellQuote as et, runTracePull as f, emitJsonEvent as ft, runTraceInstallMachine as g, runTraceEnable as h, jsonRequestedInArgv as ht, reviewInstanceDiscoveryPath as i, clearStoreAuth as it, runTraceOnboard as j, runTraceAllow as k, resolveTraceReadStorage as l, StoreApiError as lt, runTraceDisable as m, humanStream as mt, reviewDesktopStateDir as n, traceScope as nt, reviewLegacyDiscoveryPath as o, runStoreLogin as ot, runTraceShow as p, failWithJsonError as pt, readTraceUserConfig as q, reviewDevInstanceKey as r, DEFAULT_STORE_ORIGIN as rt, safeStorageSegment as s, runStoreLogout as st, reviewDefaultInstancePath as t, traceHomeDir as tt, runTraceBlame as u, StoreClient as ut, runTraceStatus as v, readLegacyCaptureSettings as w, runTraceHook as x, runTraceSync as y, selectTraceStorage as z };
@@ -1,9 +1,9 @@
1
1
  import { c as jsonString, l as jsonValueSchema, o as jsonObject, u as parseJsonText } from "./src-X9phtB2j.js";
2
- import "./src-DsM3jO8G.js";
3
- import "./review-home-paths-Lc02WFuX.js";
4
- import { A as withFileLock, M as devReviewHome, O as processIsAlive, P as writeFileAtomic } from "./s3-config-DDWWMh5x.js";
5
- import { i as readReviewPackageVersion, t as findReviewPackageRoot } from "./package-paths-jMg6JxDP.js";
6
- import "./request-origin-Zcn_CjX4.js";
2
+ import "./src-BiWNbcF_.js";
3
+ import "./review-home-paths-D8AoCdd2.js";
4
+ import { F as writeFileAtomic, N as devReviewHome, j as withFileLock, k as processIsAlive } from "./s3-config-CjcLyFV5.js";
5
+ import { i as readReviewPackageVersion, t as findReviewPackageRoot } from "./package-paths-BWxO-UEL.js";
6
+ import "./request-origin-B9qCPiVB.js";
7
7
  import { createHmac, randomUUID } from "node:crypto";
8
8
  import { z } from "zod";
9
9
  import { existsSync, readFileSync, rmSync } from "node:fs";
@@ -0,0 +1,27 @@
1
+ import { E as runVcs } from "./src-WPaQn75m.js";
2
+ import path from "node:path";
3
+ //#region src/runtime.ts
4
+ async function resolveReviewRoot(cwd, execFile = execFilePromise) {
5
+ const initialCwd = path.resolve(cwd);
6
+ try {
7
+ const { stdout } = await execFile("jj", ["root"], { cwd: initialCwd });
8
+ const root = stdout.trim();
9
+ if (root) return path.resolve(root);
10
+ } catch {}
11
+ try {
12
+ const { stdout } = await execFile("git", [
13
+ "-C",
14
+ initialCwd,
15
+ "rev-parse",
16
+ "--show-toplevel"
17
+ ]);
18
+ const root = stdout.trim();
19
+ if (root) return path.resolve(root);
20
+ } catch {}
21
+ return initialCwd;
22
+ }
23
+ function execFilePromise(file, args, options = {}) {
24
+ return runVcs(file, args, options);
25
+ }
26
+ //#endregion
27
+ export { resolveReviewRoot as t };
package/dist/runtime.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  //#region src/runtime.d.ts
2
2
  declare function resolveReviewRoot(cwd: string, execFile?: typeof execFilePromise): Promise<string>;
3
- declare function execFilePromise(file: string, args: string[], options?: {
3
+ declare function execFilePromise(file: "git" | "jj", args: string[], options?: {
4
4
  cwd?: string;
5
5
  }): Promise<{
6
6
  stdout: string;
package/dist/runtime.js CHANGED
@@ -1,2 +1,2 @@
1
- import { t as resolveReviewRoot } from "./runtime-CKiWhGrf.js";
1
+ import { t as resolveReviewRoot } from "./runtime-Bj2tD33R.js";
2
2
  export { resolveReviewRoot };
@@ -1,6 +1,6 @@
1
1
  import { a as jsonNumber, c as jsonString, o as jsonObject, r as jsonArray, u as parseJsonText } from "./src-X9phtB2j.js";
2
2
  import { S as sessionMetaSchema, b as commitShaSchema, y as byCommitSchema } from "./src-CGP5ytbV.js";
3
- import { i as isS3MockMode, l as s3CacheIdentity, s as resolveS3Credentials, u as s3MockRoot } from "./s3-config-DDWWMh5x.js";
3
+ import { i as isS3MockMode, l as s3CacheIdentity, s as resolveS3Credentials, u as s3MockRoot } from "./s3-config-CjcLyFV5.js";
4
4
  import { t as errorMessage } from "./error-message-OtiDonty.js";
5
5
  import { existsSync, mkdirSync, readFileSync, readdirSync, rmSync, statSync, writeFileSync } from "node:fs";
6
6
  import path from "node:path";
@@ -169,11 +169,13 @@ const DEV_REVIEW_HOME_ENV = "DEV_REVIEW_HOME";
169
169
  * The one resolver for the Review home directory. Every reader of
170
170
  * DEV_REVIEW_HOME calls this, so an untrimmed or empty value cannot make two
171
171
  * modules disagree about the directory. An empty value means "use the
172
- * default".
172
+ * default", which is ~/.dev-preview for preview.
173
173
  */
174
174
  function devReviewHome(env = process.env, homeDir = os.homedir()) {
175
175
  const override = env[DEV_REVIEW_HOME_ENV]?.trim();
176
- return override ? path.resolve(override) : path.join(homeDir, ".dev");
176
+ if (override) return path.resolve(override);
177
+ const channel = env.DEV_FAST_REVIEW_CHANNEL?.trim() || env.DEV_REVIEW_INSTANCE?.trim();
178
+ return path.join(homeDir, channel === "preview" ? ".dev-preview" : ".dev");
177
179
  }
178
180
  //#endregion
179
181
  //#region ../trace-core/src/with-file-lock.ts
@@ -677,4 +679,4 @@ function normalizeS3Endpoint(endpoint) {
677
679
  }
678
680
  }
679
681
  //#endregion
680
- export { withFileLock as A, s3ProfileSchema as C, liveLockOwner as D, writeTraceConfigFile as E, writeFileAtomicAsync as F, writePrivateJsonAtomic as I, devReviewHome as M, normalizeStoreOrigin as N, processIsAlive as O, writeFileAtomic as P, readTraceConfigFile as S, sameS3Profile as T, emptyTraceConfig as _, noTraceConfigurationMessage as a, hostedCaptureEnabled as b, resolveS3Setup as c, traceEnvPath as d, traceEnvValue as f, currentStore as g, TraceConfigurationError as h, isS3MockMode as i, DEV_REVIEW_HOME_ENV as j, processStartIdentity as k, s3CacheIdentity as l, DEFAULT_HOSTED_ORIGIN as m, clearTraceEnvCache as n, readTraceEnvFile as o, traceSettingsPath as p, describeS3Setup as r, resolveS3Credentials as s, S3_DEFAULT_REGION as t, s3MockRoot as u, enabledOriginsOf as v, s3Store as w, hostedOrigin as x, hasHostedStore as y };
682
+ export { processStartIdentity as A, s3ProfileSchema as C, liveLockOwner as D, writeTraceConfigFile as E, writeFileAtomic as F, writeFileAtomicAsync as I, writePrivateJsonAtomic as L, DEV_REVIEW_HOME_ENV as M, devReviewHome as N, pidReused as O, normalizeStoreOrigin as P, readTraceConfigFile as S, sameS3Profile as T, emptyTraceConfig as _, noTraceConfigurationMessage as a, hostedCaptureEnabled as b, resolveS3Setup as c, traceEnvPath as d, traceEnvValue as f, currentStore as g, TraceConfigurationError as h, isS3MockMode as i, withFileLock as j, processIsAlive as k, s3CacheIdentity as l, DEFAULT_HOSTED_ORIGIN as m, clearTraceEnvCache as n, readTraceEnvFile as o, traceSettingsPath as p, describeS3Setup as r, resolveS3Credentials as s, S3_DEFAULT_REGION as t, s3MockRoot as u, enabledOriginsOf as v, s3Store as w, hostedOrigin as x, hasHostedStore as y };
@@ -1,2 +1,2 @@
1
- import { a as noTraceConfigurationMessage, c as resolveS3Setup, d as traceEnvPath, f as traceEnvValue, i as isS3MockMode, l as s3CacheIdentity, n as clearTraceEnvCache, o as readTraceEnvFile, p as traceSettingsPath, r as describeS3Setup, s as resolveS3Credentials, t as S3_DEFAULT_REGION, u as s3MockRoot } from "./s3-config-DDWWMh5x.js";
1
+ import { a as noTraceConfigurationMessage, c as resolveS3Setup, d as traceEnvPath, f as traceEnvValue, i as isS3MockMode, l as s3CacheIdentity, n as clearTraceEnvCache, o as readTraceEnvFile, p as traceSettingsPath, r as describeS3Setup, s as resolveS3Credentials, t as S3_DEFAULT_REGION, u as s3MockRoot } from "./s3-config-CjcLyFV5.js";
2
2
  export { S3_DEFAULT_REGION, clearTraceEnvCache, describeS3Setup, isS3MockMode, noTraceConfigurationMessage, readTraceEnvFile, resolveS3Credentials, resolveS3Setup, s3CacheIdentity, s3MockRoot, traceEnvPath, traceEnvValue, traceSettingsPath };