@dev.fast/whiteboard 0.5.2-preview.20261104.146 → 0.5.2-preview.20261104.147

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 (40) hide show
  1. package/dist/{account-alias-BlYamXAG.js → account-alias-DXpd0Px8.js} +3 -3
  2. package/dist/{agent-cli-D7fF5xmm.js → agent-cli-COrZtFks.js} +6 -6
  3. package/dist/agent-cli-x6-Eh1S-.js +2 -0
  4. package/dist/{agent-client-BCEbSPWU.js → agent-client-BFtYm3Ng.js} +4 -4
  5. package/dist/{authoring-tools-CkfxTVJm.js → authoring-tools-D1avYp8-.js} +2 -2
  6. package/dist/{background-server-BraP8pJ9.js → background-server-BiRSqjxG.js} +2 -2
  7. package/dist/{background-server-CwToVN1g.js → background-server-HOJozY99.js} +1 -1
  8. package/dist/build-info.json +1 -1
  9. package/dist/{cli-BpadBaGU.js → cli-CSlwGRvH.js} +1 -1
  10. package/dist/{cli-runner-BebYF50a.js → cli-runner-CuffXA0Q.js} +18 -18
  11. package/dist/cli.js +2 -2
  12. package/dist/{fuzzy-match-CxcsLQGx.js → fuzzy-match-DEo941za.js} +2 -2
  13. package/dist/{headless-host-cLipIufH.js → headless-host-BCkXVVpU.js} +1 -1
  14. package/dist/{headless-host-FAlbekFD.js → headless-host-CIuJJjmM.js} +12 -12
  15. package/dist/{import-CZ1958L4.js → import-CjcW7EIQ.js} +3 -3
  16. package/dist/{local-data-DdFkxFK_.js → local-data-B5PBZ0Ge.js} +64 -5
  17. package/dist/{mcp-Claiy9xE.js → mcp-Ba3WvhUh.js} +4 -4
  18. package/dist/profile-BstQkIY0.js +2 -0
  19. package/dist/{profile-Bsgzi9PA.js → profile-CNMhLUhf.js} +1 -1
  20. package/dist/{remote-attach-LGTpwpUv.js → remote-attach-DkZoYBHV.js} +3 -3
  21. package/dist/{remote-language-server-BAznkpeu.js → remote-language-server-l4ConTfj.js} +1 -1
  22. package/dist/{remote-uninstall-CLP79Cuk.js → remote-uninstall-BAQM7cU8.js} +3 -3
  23. package/dist/{request-origin-D6B-zrL8.js → request-origin-DZexKlc4.js} +4 -3
  24. package/dist/{review-app-launcher-tTe8bTwg.js → review-app-launcher-B5F10y_4.js} +2 -2
  25. package/dist/{review-telemetry-DACDMfqq.js → review-telemetry-kQ7esDRE.js} +2 -2
  26. package/dist/server/desktop-host.js +11 -11
  27. package/dist/{server-discovery-CV5qf1J8.js → server-discovery-DYY_xeG9.js} +1 -1
  28. package/dist/sharing/index.js +1 -1
  29. package/dist/{src-CrrW7lcY.js → src-B-91Rd2d.js} +1 -0
  30. package/dist/{src-BQDlJXkG.js → src-DirPN_Qh.js} +38 -1
  31. package/dist/{stored-document-migration-D1wK4yID.js → stored-document-migration-vg0NAzXG.js} +3 -88
  32. package/dist/{thread-state-WTqSborE.js → thread-state-Jxoh1hde.js} +1 -1
  33. package/dist/{tool-failure-YOFGHJCZ.js → tool-failure-BLBwcl3H.js} +4 -4
  34. package/package.json +5 -5
  35. package/src/review-api/comparison-coverage.ts +6 -7
  36. package/src/review-api/review-progress.ts +2 -3
  37. package/src/ui-telemetry-events.ts +1 -0
  38. package/dist/agent-cli-DLibAL4u.js +0 -2
  39. package/dist/profile-BxdzBxHW.js +0 -2
  40. package/src/review-api/lens-alignment.ts +0 -52
@@ -1,10 +1,10 @@
1
1
  import { n as isJsonObject } from "./src-X9phtB2j.js";
2
- import { D as ReviewCliInstallStampSchema } from "./src-CrrW7lcY.js";
2
+ import { D as ReviewCliInstallStampSchema } from "./src-B-91Rd2d.js";
3
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-BmZX2qiz.js";
4
4
  import { I as writeFileAtomicAsync, L as writePrivateJsonAtomic, N as devReviewHome, j as withFileLock } from "./s3-config-CjcLyFV5.js";
5
5
  import { i as readReviewPackageVersion } from "./package-paths-Dk7MOXxN.js";
6
- import { f as isDirectory, p as isFile } from "./thread-state-WTqSborE.js";
7
- import { c as findExecutable, s as executableCommand } from "./fuzzy-match-CxcsLQGx.js";
6
+ import { f as isDirectory, p as isFile } from "./thread-state-Jxoh1hde.js";
7
+ import { c as findExecutable, s as executableCommand } from "./fuzzy-match-DEo941za.js";
8
8
  import { createHash } from "node:crypto";
9
9
  import { constants } from "node:fs";
10
10
  import { access, chmod, lstat, mkdir, readFile, rm, stat, writeFile } from "node:fs/promises";
@@ -1,12 +1,12 @@
1
1
  import { n as isJsonObject, u as parseJsonText } from "./src-X9phtB2j.js";
2
2
  import { T as traceMachineEnabled } from "./review-home-paths-BmZX2qiz.js";
3
- import { a as toolResultText, i as connectReviewInstance, s as ReviewApiError } from "./agent-client-BCEbSPWU.js";
3
+ import { a as toolResultText, i as connectReviewInstance, s as ReviewApiError } from "./agent-client-BFtYm3Ng.js";
4
4
  import { N as devReviewHome } from "./s3-config-CjcLyFV5.js";
5
5
  import { n as readBuildCommit } from "./package-paths-Dk7MOXxN.js";
6
- import { b as selectReviewInstance, u as REVIEW_INSTANCE_ENV } from "./server-discovery-CV5qf1J8.js";
7
- import { n as reviewSessionAgent } from "./review-telemetry-DACDMfqq.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-D6B-zrL8.js";
9
- import { a as renderedImage, i as publicTool, n as RECOVERY, r as callPublicTool, t as toolFailure } from "./tool-failure-YOFGHJCZ.js";
6
+ import { b as selectReviewInstance, u as REVIEW_INSTANCE_ENV } from "./server-discovery-DYY_xeG9.js";
7
+ import { n as reviewSessionAgent } from "./review-telemetry-kQ7esDRE.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-DZexKlc4.js";
9
+ import { a as renderedImage, i as publicTool, n as RECOVERY, r as callPublicTool, t as toolFailure } from "./tool-failure-BLBwcl3H.js";
10
10
  import { existsSync } from "node:fs";
11
11
  import path from "node:path";
12
12
  //#region src/review-api/install-update.ts
@@ -43,7 +43,7 @@ async function runReviewAgentCli(input) {
43
43
  [REVIEW_THREAD_HEADER, thread ?? ""]
44
44
  ]);
45
45
  if (mode === "mcp") {
46
- const { serveReviewMcp } = await import("./mcp-Claiy9xE.js");
46
+ const { serveReviewMcp } = await import("./mcp-Ba3WvhUh.js");
47
47
  exitOnInstallUpdate(input.stderr);
48
48
  await serveReviewMcp(async (key, agentKind) => {
49
49
  const connected = await connectReviewInstance(key ? {
@@ -0,0 +1,2 @@
1
+ import { n as runReviewAgentCli } from "./agent-cli-COrZtFks.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 { ot as ReviewInputError } from "./src-BQDlJXkG.js";
3
- import "./src-CrrW7lcY.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-CV5qf1J8.js";
2
+ import { st as ReviewInputError } from "./src-DirPN_Qh.js";
3
+ import "./src-B-91Rd2d.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-DYY_xeG9.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-CwToVN1g.js");
262
+ const { ensureServerWithoutDesktop } = await import("./background-server-HOJozY99.js");
263
263
  const server = await ensureServerWithoutDesktop({
264
264
  selection,
265
265
  env,
@@ -1,6 +1,6 @@
1
1
  import { n as isJsonObject } from "./src-X9phtB2j.js";
2
- import { F as writableBlockTypes, N as componentReference, ct as activityEndSchema, f as pathTargetSchema, g as publishedEdits, lt as activityUpdateSchema, ot as ReviewInputError, st as activityBeginSchema } from "./src-BQDlJXkG.js";
3
- import { n as uploadSchema, r as commandSchema } from "./local-data-DdFkxFK_.js";
2
+ import { F as writableBlockTypes, N as componentReference, ct as activityBeginSchema, f as pathTargetSchema, g as publishedEdits, lt as activityEndSchema, st as ReviewInputError, ut as activityUpdateSchema } from "./src-DirPN_Qh.js";
3
+ import { n as uploadSchema, r as commandSchema } from "./local-data-B5PBZ0Ge.js";
4
4
  import { t as findReviewPackageRoot } from "./package-paths-Dk7MOXxN.js";
5
5
  import { z } from "zod";
6
6
  import { readFile } from "node:fs/promises";
@@ -1,8 +1,8 @@
1
1
  import "./review-home-paths-BmZX2qiz.js";
2
2
  import { D as liveLockOwner, k as processIsAlive } from "./s3-config-CjcLyFV5.js";
3
3
  import { t as findReviewPackageRoot } from "./package-paths-Dk7MOXxN.js";
4
- import { a as readReviewServerHealth, c as reviewServerStateDir, i as readReviewServerDiscovery, n as desktopOwnsHome, p as desktopUsesHome, r as headlessServerLockPath } from "./server-discovery-CV5qf1J8.js";
5
- import { t as desktopApplicationInstalled } from "./review-app-launcher-tTe8bTwg.js";
4
+ import { a as readReviewServerHealth, c as reviewServerStateDir, i as readReviewServerDiscovery, n as desktopOwnsHome, p as desktopUsesHome, r as headlessServerLockPath } from "./server-discovery-DYY_xeG9.js";
5
+ import { t as desktopApplicationInstalled } from "./review-app-launcher-B5F10y_4.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-BraP8pJ9.js";
1
+ import { a as headlessServerOwner, c as stopBackgroundServer, i as ensureServerWithoutDesktop, r as ensureBackgroundServer } from "./background-server-BiRSqjxG.js";
2
2
  export { ensureBackgroundServer, ensureServerWithoutDesktop, headlessServerOwner, stopBackgroundServer };
@@ -1 +1 @@
1
- {"version":"0.5.2-preview.20261104.146","commit":"20f4d6dcfaa9f7a40ff77fd6e6b2467fc89e64fa","dirty":true,"builtAt":"2026-11-04T14:47:42.412Z"}
1
+ {"version":"0.5.2-preview.20261104.147","commit":"07deb9e521a2e372643d2d13350f9868b41fd264","dirty":true,"builtAt":"2026-11-04T21:36:56.040Z"}
@@ -1,4 +1,4 @@
1
- import { r as connectReviewApi } from "./agent-client-BCEbSPWU.js";
1
+ import { r as connectReviewApi } from "./agent-client-BFtYm3Ng.js";
2
2
  import { randomUUID } from "node:crypto";
3
3
  import { z } from "zod";
4
4
  import { mkdir, writeFile } from "node:fs/promises";
@@ -1,18 +1,18 @@
1
1
  import { D as __commonJSMin, E as setLocalVcsCommandObserver, O as __require, k as __toESM } from "./src-Y30gweiK.js";
2
2
  import { c as jsonString, n as isJsonObject, u as parseJsonText } from "./src-X9phtB2j.js";
3
- import { C as REVIEW_REMOTE_ATTACH_END, S as REVIEW_REMOTE_ATTACH_BEGIN, h as REVIEW_CLI_INSTALL_TARGET_LABELS, l as boardTitle, x as REVIEW_REMOTE_AGENT_IDS } from "./src-CrrW7lcY.js";
3
+ import { C as REVIEW_REMOTE_ATTACH_END, S as REVIEW_REMOTE_ATTACH_BEGIN, h as REVIEW_CLI_INSTALL_TARGET_LABELS, l as boardTitle, x as REVIEW_REMOTE_AGENT_IDS } from "./src-B-91Rd2d.js";
4
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-BmZX2qiz.js";
5
- import { o as ReviewApiClient, s as ReviewApiError } from "./agent-client-BCEbSPWU.js";
5
+ import { o as ReviewApiClient, s as ReviewApiError } from "./agent-client-BFtYm3Ng.js";
6
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";
7
7
  import { t as errorMessage } from "./error-message-OtiDonty.js";
8
8
  import { i as readReviewPackageVersion, r as readBuildInfo, t as findReviewPackageRoot } from "./package-paths-Dk7MOXxN.js";
9
9
  import { t as resolveReviewRoot } from "./runtime-Bhk5L_SN.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-CV5qf1J8.js";
11
- import { t as ReviewTelemetry } from "./review-telemetry-DACDMfqq.js";
12
- import { t as fuzzyRank } from "./fuzzy-match-CxcsLQGx.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-BlYamXAG.js";
14
- import { n as focusReviewDesktop, r as runReviewAppLaunch } from "./review-app-launcher-tTe8bTwg.js";
15
- import { t as reviewAgentCliHelp } from "./agent-cli-D7fF5xmm.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-DYY_xeG9.js";
11
+ import { t as ReviewTelemetry } from "./review-telemetry-kQ7esDRE.js";
12
+ import { t as fuzzyRank } from "./fuzzy-match-DEo941za.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-DXpd0Px8.js";
14
+ import { n as focusReviewDesktop, r as runReviewAppLaunch } from "./review-app-launcher-B5F10y_4.js";
15
+ import { t as reviewAgentCliHelp } from "./agent-cli-COrZtFks.js";
16
16
  import { existsSync, mkdirSync, renameSync, writeFileSync } from "node:fs";
17
17
  import { realpath } from "node:fs/promises";
18
18
  import path from "node:path";
@@ -4333,7 +4333,7 @@ async function runReviewCli(input) {
4333
4333
  if (!Number.isInteger(port) || port < 0 || port > 65535) throw new ReviewCliUsageError("--port must be an integer between 0 and 65535.");
4334
4334
  const stateDir = reviewServerStateDir(authoringEnv(options.stateDir));
4335
4335
  if (options.detach) {
4336
- const { ensureBackgroundServer } = await import("./background-server-CwToVN1g.js");
4336
+ const { ensureBackgroundServer } = await import("./background-server-HOJozY99.js");
4337
4337
  const { discovery, started } = await ensureBackgroundServer({
4338
4338
  stateDir,
4339
4339
  env,
@@ -4355,7 +4355,7 @@ async function runReviewCli(input) {
4355
4355
  process.once("SIGINT", stop);
4356
4356
  process.once("SIGTERM", stop);
4357
4357
  process.once(DESKTOP_TAKEOVER_SIGNAL, takeover);
4358
- const { HeadlessServerBusyError, runHeadlessServer } = await import("./headless-host-cLipIufH.js");
4358
+ const { HeadlessServerBusyError, runHeadlessServer } = await import("./headless-host-BCkXVVpU.js");
4359
4359
  try {
4360
4360
  await runHeadlessServer({
4361
4361
  stateDir,
@@ -4392,7 +4392,7 @@ async function runReviewCli(input) {
4392
4392
  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
4393
  const options = command.optsWithGlobals();
4394
4394
  const stateDir = reviewServerStateDir(authoringEnv(options.stateDir));
4395
- const { headlessServerOwner, stopBackgroundServer } = await import("./background-server-CwToVN1g.js");
4395
+ const { headlessServerOwner, stopBackgroundServer } = await import("./background-server-HOJozY99.js");
4396
4396
  const owner = await headlessServerOwner(stateDir);
4397
4397
  const discovery = await readReviewServerDiscovery(stateDir);
4398
4398
  if (owner === void 0) {
@@ -4420,7 +4420,7 @@ async function runReviewCli(input) {
4420
4420
  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
4421
  const inUse = `A Whiteboard server is using ${stateDir}. Stop it first, then run whiteboard server reset-id again.`;
4422
4422
  if (await desktopUsesHome(stateDir, env)) return refuse(inUse, options.json);
4423
- const [{ openReviewProfile }, { withHeadlessServerLock }] = await Promise.all([import("./profile-BxdzBxHW.js"), import("./headless-host-cLipIufH.js")]);
4423
+ const [{ openReviewProfile }, { withHeadlessServerLock }] = await Promise.all([import("./profile-BstQkIY0.js"), import("./headless-host-BCkXVVpU.js")]);
4424
4424
  const reset = await withHeadlessServerLock(await realpath(stateDir), async () => {
4425
4425
  const local = await openReviewProfile(stateDir, { manageWorkspaces: false });
4426
4426
  try {
@@ -4442,7 +4442,7 @@ async function runReviewCli(input) {
4442
4442
  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
4443
  const options = command.optsWithGlobals();
4444
4444
  const stateDir = reviewServerStateDir(authoringEnv(options.stateDir));
4445
- const { remoteAttach } = await import("./remote-attach-LGTpwpUv.js");
4445
+ const { remoteAttach } = await import("./remote-attach-DkZoYBHV.js");
4446
4446
  let attach;
4447
4447
  try {
4448
4448
  attach = await remoteAttach({
@@ -4484,7 +4484,7 @@ async function runReviewCli(input) {
4484
4484
  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
4485
  const options = command.optsWithGlobals();
4486
4486
  const stateDir = reviewServerStateDir(authoringEnv(options.stateDir));
4487
- const { remoteUninstall } = await import("./remote-uninstall-CLP79Cuk.js");
4487
+ const { remoteUninstall } = await import("./remote-uninstall-BAQM7cU8.js");
4488
4488
  let deleteReviews = options.deleteReviews ? true : options.keepReviews ? false : void 0;
4489
4489
  if (deleteReviews === void 0 && !options.json && input.stdin?.isTTY) {
4490
4490
  const prompt = createInterface$1({
@@ -4706,14 +4706,14 @@ async function runReviewCli(input) {
4706
4706
  command.showHelpAfterError(false).error("Markdown review migration is no longer supported. Ask your agent to migrate your old Whiteboard reviews.");
4707
4707
  });
4708
4708
  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-BpadBaGU.js");
4709
+ const { runShareCli } = await import("./cli-CSlwGRvH.js");
4710
4710
  state.exitCode = await runShareCli({
4711
4711
  ...input,
4712
4712
  ...options,
4713
4713
  env: authoringEnv()
4714
4714
  });
4715
4715
  }).command("revoke <share-id>").description("Revoke future downloads of a share"), "plain").action(async (shareId, options) => {
4716
- const { runShareCli } = await import("./cli-BpadBaGU.js");
4716
+ const { runShareCli } = await import("./cli-CSlwGRvH.js");
4717
4717
  state.exitCode = await runShareCli({
4718
4718
  ...input,
4719
4719
  ...options,
@@ -4722,7 +4722,7 @@ async function runReviewCli(input) {
4722
4722
  });
4723
4723
  });
4724
4724
  configureJsonOutput(program.command("export").description("Write a review snapshot as a .whiteboard file"), "plain").option("--review <id>", "review ID").option("--version <number>", "Saved version to export").option("--out <path>", "File to write, or - for stdout; defaults to <title>.whiteboard here").action(async (options) => {
4725
- const { runExportCli } = await import("./cli-BpadBaGU.js");
4725
+ const { runExportCli } = await import("./cli-CSlwGRvH.js");
4726
4726
  state.exitCode = await runExportCli({
4727
4727
  ...input,
4728
4728
  ...options,
@@ -4803,7 +4803,7 @@ async function runReviewCli(input) {
4803
4803
  return commands;
4804
4804
  } });
4805
4805
  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) => {
4806
- const { runReviewAgentCli } = await import("./agent-cli-DLibAL4u.js");
4806
+ const { runReviewAgentCli } = await import("./agent-cli-x6-Eh1S-.js");
4807
4807
  state.exitCode = await runReviewAgentCli({
4808
4808
  ...input,
4809
4809
  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-CrrW7lcY.js";
3
+ import "./src-B-91Rd2d.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-BebYF50a.js");
20
+ const { runReviewCli } = await import("./cli-runner-CuffXA0Q.js");
21
21
  return runReviewCli({
22
22
  argv,
23
23
  cliPaths: {
@@ -1,7 +1,7 @@
1
1
  import "./review-home-paths-BmZX2qiz.js";
2
2
  import { N as devReviewHome } from "./s3-config-CjcLyFV5.js";
3
- import { n as askAgentIds } from "./thread-state-WTqSborE.js";
4
- import { t as ASK_THREAD_ENV } from "./request-origin-D6B-zrL8.js";
3
+ import { n as askAgentIds } from "./thread-state-Jxoh1hde.js";
4
+ import { t as ASK_THREAD_ENV } from "./request-origin-DZexKlc4.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";
@@ -1,2 +1,2 @@
1
- import { i as withHeadlessServerLock, n as runHeadlessServer, r as takeOverServerHome, t as HeadlessServerBusyError } from "./headless-host-FAlbekFD.js";
1
+ import { i as withHeadlessServerLock, n as runHeadlessServer, r as takeOverServerHome, t as HeadlessServerBusyError } from "./headless-host-CIuJJjmM.js";
2
2
  export { HeadlessServerBusyError, runHeadlessServer, takeOverServerHome, withHeadlessServerLock };
@@ -1,21 +1,21 @@
1
1
  import { b as resolveRepoContext, d as git, r as defaultBranch, w as runVcs } from "./src-Y30gweiK.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 { C as StreamLimitError, D as shareIdSchema, E as shareBundleSchema, S as uncategorizedReport, T as parseShareLink, _ as validateShareSources, a as shareKey, b as progressUpdateSchema, c as readShareRepository, d as ShareRequestError, f as parseWhiteboardFile, g as exportShare, h as whiteboardFileText, i as receiveShare, l as ShareAuthError, m as whiteboardFileName, n as needsRepository, p as whiteboardFileKey, r as planShareCopy, s as forgetSharedCommits, t as importShare, u as ShareClient, v as legacyModeSchema, w as readBoundedStream, x as reviewProgress, y as lensReport } from "./import-CZ1958L4.js";
4
- import { I as stepSources, T as selectionReferences, U as animationCode, et as formatAnchor, n as anchorPins, o as boardRepositoryId, ot as ReviewInputError, rt as selectionKey, u as elements } from "./src-BQDlJXkG.js";
5
- import { c as invalidateStructuralComparisons, d as readGitHubPullRequests, i as inspectSnapshot, l as diffrExecutable, r as commandSchema, u as diffrMissingError } from "./local-data-DdFkxFK_.js";
6
- import { A as ReviewFeedbackSchema, F as reviewDiffrSummarizerInputSchema, L as decodeStructuralDiffEvent, M as ReviewOnboardingRunRequestSchema, P as reviewDiffrLoginsSchema, a as parseReviewVerbRequest, c as boardIconKind, i as parseReviewDesktopVerbResult, k as ReviewFeedbackContactSchema, l as boardTitle, m as REVIEW_CLIENT_REMOTE, p as REVIEW_CLIENT_HEADER, y as REVIEW_HOST_HEADER } from "./src-CrrW7lcY.js";
3
+ import { C as StreamLimitError, D as shareIdSchema, E as shareBundleSchema, S as uncategorizedReport, T as parseShareLink, _ as validateShareSources, a as shareKey, b as progressUpdateSchema, c as readShareRepository, d as ShareRequestError, f as parseWhiteboardFile, g as exportShare, h as whiteboardFileText, i as receiveShare, l as ShareAuthError, m as whiteboardFileName, n as needsRepository, p as whiteboardFileKey, r as planShareCopy, s as forgetSharedCommits, t as importShare, u as ShareClient, v as legacyModeSchema, w as readBoundedStream, x as reviewProgress, y as lensReport } from "./import-CjcW7EIQ.js";
4
+ import { I as stepSources, T as selectionReferences, U as animationCode, et as formatAnchor, it as selectionKey, n as anchorPins, o as boardRepositoryId, st as ReviewInputError, u as elements } from "./src-DirPN_Qh.js";
5
+ import { c as invalidateStructuralComparisons, d as readGitHubPullRequests, i as inspectSnapshot, l as diffrExecutable, r as commandSchema, u as diffrMissingError } from "./local-data-B5PBZ0Ge.js";
6
+ import { A as ReviewFeedbackSchema, F as reviewDiffrSummarizerInputSchema, L as decodeStructuralDiffEvent, M as ReviewOnboardingRunRequestSchema, P as reviewDiffrLoginsSchema, a as parseReviewVerbRequest, c as boardIconKind, i as parseReviewDesktopVerbResult, k as ReviewFeedbackContactSchema, l as boardTitle, m as REVIEW_CLIENT_REMOTE, p as REVIEW_CLIENT_HEADER, y as REVIEW_HOST_HEADER } from "./src-B-91Rd2d.js";
7
7
  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-BmZX2qiz.js";
8
- import { D as scopedCoverage, f as sourceBranchName, l as pullRequestKey, p as pullRequestProvider } from "./stored-document-migration-D1wK4yID.js";
8
+ import { T as scopedCoverage, f as sourceBranchName, l as pullRequestKey, p as pullRequestProvider } from "./stored-document-migration-vg0NAzXG.js";
9
9
  import { A as processStartIdentity, L as writePrivateJsonAtomic, N as devReviewHome, h as TraceConfigurationError, i as isS3MockMode, j as withFileLock } from "./s3-config-CjcLyFV5.js";
10
10
  import { t as errorMessage } from "./error-message-OtiDonty.js";
11
11
  import { i as readReviewPackageVersion, n as readBuildCommit, t as findReviewPackageRoot } from "./package-paths-Dk7MOXxN.js";
12
- import { _ as reviewInstanceIdentity, n as desktopOwnsHome, o as reviewServerDiscoveryPath, p as desktopUsesHome, r as headlessServerLockPath, t as DESKTOP_TAKEOVER_SIGNAL } from "./server-discovery-CV5qf1J8.js";
13
- 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-WTqSborE.js";
14
- import { t as openReviewProfile } from "./profile-Bsgzi9PA.js";
15
- 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-D6B-zrL8.js";
16
- 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-CxcsLQGx.js";
17
- import { a as inspectQuerySchema, i as renderInstructions, o as queryAnchor, r as instructionsQuerySchema, s as readQuerySchemas, t as authoringTools } from "./authoring-tools-CkfxTVJm.js";
18
- import { a as headlessServerOwner, c as stopBackgroundServer, o as recordedBackgroundServer } from "./background-server-BraP8pJ9.js";
12
+ import { _ as reviewInstanceIdentity, n as desktopOwnsHome, o as reviewServerDiscoveryPath, p as desktopUsesHome, r as headlessServerLockPath, t as DESKTOP_TAKEOVER_SIGNAL } from "./server-discovery-DYY_xeG9.js";
13
+ 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-Jxoh1hde.js";
14
+ import { t as openReviewProfile } from "./profile-CNMhLUhf.js";
15
+ 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-DZexKlc4.js";
16
+ 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-DEo941za.js";
17
+ import { a as inspectQuerySchema, i as renderInstructions, o as queryAnchor, r as instructionsQuerySchema, s as readQuerySchemas, t as authoringTools } from "./authoring-tools-D1avYp8-.js";
18
+ import { a as headlessServerOwner, c as stopBackgroundServer, o as recordedBackgroundServer } from "./background-server-BiRSqjxG.js";
19
19
  import crypto$1, { createHash, randomBytes, randomUUID } from "node:crypto";
20
20
  import { z } from "zod";
21
21
  import { existsSync, mkdirSync, writeFileSync } from "node:fs";
@@ -1,8 +1,8 @@
1
1
  import { f as gitAt } from "./src-Y30gweiK.js";
2
2
  import { u as parseJsonText } from "./src-X9phtB2j.js";
3
- import { $ as comparisonKey, A as parseMarkdown, B as lensSchema, E as sourceReferences, L as UNCATEGORIZED_LENS_ID, M as checkReferences, O as markdownNodes, Q as anchorSelection, T as selectionReferences, V as lensSelections, Z as SelectionUnavailableError, _ as readsAtBoardPins, at as unionIntervals, c as documentSchema, h as pinsSchema, it as sourceAnchors, n as anchorPins, nt as resolveDiffSelection, o as boardRepositoryId, ot as ReviewInputError, q as fileLineRangeSchema, rt as selectionKey, u as elements, v as resourceReference, y as resourceReferences } from "./src-BQDlJXkG.js";
3
+ import { $ as comparisonKey, A as parseMarkdown, B as lensSchema, E as sourceReferences, L as UNCATEGORIZED_LENS_ID, M as checkReferences, O as markdownNodes, Q as anchorSelection, T as selectionReferences, V as lensSelections, Z as SelectionUnavailableError, _ as readsAtBoardPins, at as sourceAnchors, c as documentSchema, h as pinsSchema, it as selectionKey, n as anchorPins, nt as patchRows, o as boardRepositoryId, ot as unionIntervals, q as fileLineRangeSchema, rt as resolveDiffSelection, st as ReviewInputError, u as elements, v as resourceReference, y as resourceReferences } from "./src-DirPN_Qh.js";
4
4
  import { s as safeStorageSegment } from "./review-home-paths-BmZX2qiz.js";
5
- import { D as scopedCoverage, O as sourcesForFile, T as emptyCoverage, b as textIncludesQuote, c as traceSchema, k as subtractIntervals, n as migrateStoredDocument, r as migrateStoredLenses, s as softwareModelDataSchema, t as liftFileLenses, u as pullRequestUrl, w as coverageSources, x as textualRows } from "./stored-document-migration-D1wK4yID.js";
5
+ import { C as emptyCoverage, D as subtractIntervals, E as sourcesForFile, S as coverageSources, T as scopedCoverage, b as textIncludesQuote, c as traceSchema, n as migrateStoredDocument, r as migrateStoredLenses, s as softwareModelDataSchema, t as liftFileLenses, u as pullRequestUrl } from "./stored-document-migration-vg0NAzXG.js";
6
6
  import { N as devReviewHome } from "./s3-config-CjcLyFV5.js";
7
7
  import { createHash, randomUUID } from "node:crypto";
8
8
  import { z } from "zod";
@@ -299,7 +299,7 @@ async function reviewProgress(store, data, snapshot, signal = new AbortControlle
299
299
  })));
300
300
  if (base === null && head === null) throw new SelectionUnavailableError("missing_file", "File is unavailable at these pins.");
301
301
  if (base !== null && head !== null && base !== head) throw new SelectionUnavailableError("no_alignment", "Changed context file has no alignment.");
302
- rows = textualRows(source.file, "", base?.split("\n").length ?? 0, head?.split("\n").length ?? 0);
302
+ rows = patchRows("", base?.split("\n").length ?? 0, head?.split("\n").length ?? 0);
303
303
  }
304
304
  if (!rows) throw new SelectionUnavailableError("no_alignment", "File has no text alignment.");
305
305
  const result = resolveDiffSelection(source, rows, file ?? { path: source.file });
@@ -1,12 +1,12 @@
1
1
  import { S as splitGitPatchFiles, T as runVcsSync, _ as listTrackedFilesAtCommit, a as diff, b as resolveRepoContext, c as diffFileSummariesWorkingTree, d as git, f as gitAt, g as listCommitRange, h as jjRevisionIsConflicted, i as detectLocalVcs, l as diffTrees, m as gitCommonDirSync, n as createBlobBatchReader, p as gitCommonDir, s as diffFileSummariesTrees, t as LocalVcsToolsMissingError, u as diffWorkingTree, v as parseGitRemote, w as runVcs, x as resolveRevision, y as readFileAtCommit } from "./src-Y30gweiK.js";
2
2
  import { c as jsonString, m as isStringValue, n as isJsonObject, o as jsonObject, u as parseJsonText } from "./src-X9phtB2j.js";
3
- import { A as parseMarkdown, B as lensSchema, D as summarizeEdit, E as sourceReferences, G as SourceRangeError, J as requireVisibleSource, K as checkSourcePath, M as checkReferences, O as markdownNodes, P as documentAdvice, R as applyLensEdit, S as respellEditLinks, V as lensSelections, Y as sliceSourceRange, a as boardLinks, at as unionIntervals, b as respellCommitLinks, c as documentSchema, ct as activityEndSchema, d as explicitPins, h as pinsSchema, i as assignMissingIds, it as sourceAnchors, k as markdownText, l as editSchema, lt as activityUpdateSchema, m as pinnedRepositoryIds, n as anchorPins, o as boardRepositoryId, ot as ReviewInputError, p as pinDocumentReferences, q as fileLineRangeSchema, r as applyEdit, s as commitLinkCommits, st as activityBeginSchema, t as adoptFlowUnits, tt as parseAnchor, u as elements, ut as focusSchema, v as resourceReference, w as reviewTargetSchema, x as respellDocumentLinks, y as resourceReferences, z as lensEditSchema } from "./src-BQDlJXkG.js";
4
- import { I as applyStructuralUpdate, L as decodeStructuralDiffEvent, R as structuralChangeCounts, c as boardIconKind, l as boardTitle } from "./src-CrrW7lcY.js";
3
+ import { A as parseMarkdown, B as lensSchema, D as summarizeEdit, E as sourceReferences, G as SourceRangeError, J as requireVisibleSource, K as checkSourcePath, M as checkReferences, O as markdownNodes, P as documentAdvice, R as applyLensEdit, S as respellEditLinks, V as lensSelections, Y as sliceSourceRange, a as boardLinks, at as sourceAnchors, b as respellCommitLinks, c as documentSchema, ct as activityBeginSchema, d as explicitPins, dt as focusSchema, h as pinsSchema, i as assignMissingIds, k as markdownText, l as editSchema, lt as activityEndSchema, m as pinnedRepositoryIds, n as anchorPins, nt as patchRows, o as boardRepositoryId, ot as unionIntervals, p as pinDocumentReferences, q as fileLineRangeSchema, r as applyEdit, s as commitLinkCommits, st as ReviewInputError, t as adoptFlowUnits, tt as parseAnchor, u as elements, ut as activityUpdateSchema, v as resourceReference, w as reviewTargetSchema, x as respellDocumentLinks, y as resourceReferences, z as lensEditSchema } from "./src-DirPN_Qh.js";
4
+ import { I as applyStructuralUpdate, L as decodeStructuralDiffEvent, R as structuralChangeCounts, c as boardIconKind, l as boardTitle } from "./src-B-91Rd2d.js";
5
5
  import { s as safeStorageSegment } from "./review-home-paths-BmZX2qiz.js";
6
- import { A as updateCoverage, C as coverageSchema, E as intersectIntervals, S as parseUnifiedPatch, T as emptyCoverage, _ as fetchPullRequest, a as SoftwareModelValidationError, b as textIncludesQuote, c as traceSchema, d as setPullRequest, f as sourceBranchName, g as defaultPullRequestDeps, h as GitHubRefusedRead, i as readStoredDocument, k as subtractIntervals, l as pullRequestKey, m as resolvePullRequest, n as migrateStoredDocument, o as defineSoftwareMap, r as migrateStoredLenses, u as pullRequestUrl, v as remoteUrls, x as textualRows, y as azureRepositoryOf } from "./stored-document-migration-D1wK4yID.js";
6
+ import { C as emptyCoverage, D as subtractIntervals, O as updateCoverage, _ as fetchPullRequest, a as SoftwareModelValidationError, b as textIncludesQuote, c as traceSchema, d as setPullRequest, f as sourceBranchName, g as defaultPullRequestDeps, h as GitHubRefusedRead, i as readStoredDocument, l as pullRequestKey, m as resolvePullRequest, n as migrateStoredDocument, o as defineSoftwareMap, r as migrateStoredLenses, u as pullRequestUrl, v as remoteUrls, w as intersectIntervals, x as coverageSchema, y as azureRepositoryOf } from "./stored-document-migration-vg0NAzXG.js";
7
7
  import { A as processStartIdentity, L as writePrivateJsonAtomic, O as pidReused, j as withFileLock, k as processIsAlive } from "./s3-config-CjcLyFV5.js";
8
8
  import { t as errorMessage } from "./error-message-OtiDonty.js";
9
- import { a as askHistoryEntrySchema, i as askEntrySchema, m as isMissingFileError, o as askOfferSchema, s as askPermissionsSchema } from "./thread-state-WTqSborE.js";
9
+ import { a as askHistoryEntrySchema, i as askEntrySchema, m as isMissingFileError, o as askOfferSchema, s as askPermissionsSchema } from "./thread-state-Jxoh1hde.js";
10
10
  import { createRequire } from "node:module";
11
11
  import crypto, { createHash, randomUUID } from "node:crypto";
12
12
  import { z } from "zod";
@@ -1007,6 +1007,65 @@ var Comparison = class {
1007
1007
  }
1008
1008
  };
1009
1009
  //#endregion
1010
+ //#region src/unified-diff.ts
1011
+ const HUNK_HEADER = /^@@ -(?<oldStart>\d+)(?:,(?<oldLines>\d+))? \+(?<newStart>\d+)(?:,(?<newLines>\d+))? @@/;
1012
+ function parseUnifiedPatch(file, patch) {
1013
+ if (!patch) return [];
1014
+ const hunks = [];
1015
+ let current = null;
1016
+ let oldLine = 0;
1017
+ let newLine = 0;
1018
+ for (const row of patch.split(/\r?\n/)) {
1019
+ const header = HUNK_HEADER.exec(row);
1020
+ if (header?.groups) {
1021
+ current = {
1022
+ file,
1023
+ oldStart: Number(header.groups.oldStart),
1024
+ oldLines: Number(header.groups.oldLines ?? "1"),
1025
+ newStart: Number(header.groups.newStart),
1026
+ newLines: Number(header.groups.newLines ?? "1"),
1027
+ lines: []
1028
+ };
1029
+ oldLine = current.oldStart;
1030
+ newLine = current.newStart;
1031
+ hunks.push(current);
1032
+ continue;
1033
+ }
1034
+ if (!current || row.startsWith("\")) continue;
1035
+ const marker = row[0];
1036
+ const text = row.slice(1);
1037
+ let line = null;
1038
+ if (marker === " ") {
1039
+ line = {
1040
+ kind: "context",
1041
+ oldLine,
1042
+ newLine,
1043
+ text
1044
+ };
1045
+ oldLine += 1;
1046
+ newLine += 1;
1047
+ } else if (marker === "+") {
1048
+ line = {
1049
+ kind: "add",
1050
+ oldLine: null,
1051
+ newLine,
1052
+ text
1053
+ };
1054
+ newLine += 1;
1055
+ } else if (marker === "-") {
1056
+ line = {
1057
+ kind: "remove",
1058
+ oldLine,
1059
+ newLine: null,
1060
+ text
1061
+ };
1062
+ oldLine += 1;
1063
+ }
1064
+ if (line) current.lines.push(line);
1065
+ }
1066
+ return hunks;
1067
+ }
1068
+ //#endregion
1010
1069
  //#region src/software-map-diff-counts.ts
1011
1070
  async function resolveSoftwareMapDiffCounts(input) {
1012
1071
  const baseRef = input.baseRef?.trim();
@@ -1299,7 +1358,7 @@ async function comparisonCoverage(data, reviewId, pins, signal, publish) {
1299
1358
  changed.base = unionIntervals(changed.base);
1300
1359
  changed.head = unionIntervals(changed.head);
1301
1360
  const [base, head] = await Promise.all([file.status === "added" ? null : data.file(pins, "base", file.previousPath ?? file.path).then((value) => value.text).catch(() => null), file.status === "deleted" ? null : data.file(pins, "head", file.path).then((value) => value.text).catch(() => null)]);
1302
- alignments.set(file.path, textualRows(file.path, patch, base === null ? 0 : base.split("\n").length, head === null ? 0 : head.split("\n").length));
1361
+ alignments.set(file.path, patchRows(patch, base === null ? 0 : base.split("\n").length, head === null ? 0 : head.split("\n").length));
1303
1362
  const readable = (file.status === "added" || base !== null) && (file.status === "deleted" || head !== null);
1304
1363
  const fingerprint = hash([
1305
1364
  pins.repositoryId,
@@ -1,8 +1,8 @@
1
1
  import { n as isJsonObject } from "./src-X9phtB2j.js";
2
- import { ot as ReviewInputError } from "./src-BQDlJXkG.js";
3
- import { a as toolResultText, s as ReviewApiError, t as ToolText } from "./agent-client-BCEbSPWU.js";
4
- import { n as REVIEW_STATUS_TOOL, t as authoringTools } from "./authoring-tools-CkfxTVJm.js";
5
- import { a as renderedImage, i as publicTool, n as RECOVERY, r as callPublicTool, t as toolFailure } from "./tool-failure-YOFGHJCZ.js";
2
+ import { st as ReviewInputError } from "./src-DirPN_Qh.js";
3
+ import { a as toolResultText, s as ReviewApiError, t as ToolText } from "./agent-client-BFtYm3Ng.js";
4
+ import { n as REVIEW_STATUS_TOOL, t as authoringTools } from "./authoring-tools-D1avYp8-.js";
5
+ import { a as renderedImage, i as publicTool, n as RECOVERY, r as callPublicTool, t as toolFailure } from "./tool-failure-BLBwcl3H.js";
6
6
  import { Server } from "@modelcontextprotocol/server";
7
7
  import { StdioServerTransport } from "@modelcontextprotocol/server/stdio";
8
8
  //#region src/review-api/mcp-client-agent.ts
@@ -0,0 +1,2 @@
1
+ import { t as openReviewProfile } from "./profile-CNMhLUhf.js";
2
+ export { openReviewProfile };
@@ -1,4 +1,4 @@
1
- import { a as projectOfCheckout, f as CheckoutGroups, o as groupCheckoutsAhead, s as initializeReviewStoreSchema, t as openLocalReviewStore } from "./local-data-DdFkxFK_.js";
1
+ import { a as projectOfCheckout, f as CheckoutGroups, o as groupCheckoutsAhead, s as initializeReviewStoreSchema, t as openLocalReviewStore } from "./local-data-B5PBZ0Ge.js";
2
2
  import "./review-home-paths-BmZX2qiz.js";
3
3
  import { j as withFileLock } from "./s3-config-CjcLyFV5.js";
4
4
  import { access, mkdir } from "node:fs/promises";
@@ -1,7 +1,7 @@
1
1
  import { i as readReviewPackageVersion } from "./package-paths-Dk7MOXxN.js";
2
- import { a as readReviewServerHealth, l as serverNotReady } from "./server-discovery-CV5qf1J8.js";
3
- import { c as stopBackgroundServer, o as recordedBackgroundServer, r as ensureBackgroundServer } from "./background-server-BraP8pJ9.js";
4
- import { t as ensureRemoteLanguageServer } from "./remote-language-server-BAznkpeu.js";
2
+ import { a as readReviewServerHealth, l as serverNotReady } from "./server-discovery-DYY_xeG9.js";
3
+ import { c as stopBackgroundServer, o as recordedBackgroundServer, r as ensureBackgroundServer } from "./background-server-BiRSqjxG.js";
4
+ import { t as ensureRemoteLanguageServer } from "./remote-language-server-l4ConTfj.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 "./review-home-paths-BmZX2qiz.js";
2
2
  import { A as processStartIdentity, j as withFileLock } from "./s3-config-CjcLyFV5.js";
3
3
  import { t as findReviewPackageRoot } from "./package-paths-Dk7MOXxN.js";
4
- import { n as cliSpawn, s as spawnDetached } from "./background-server-BraP8pJ9.js";
4
+ import { n as cliSpawn, s as spawnDetached } from "./background-server-BiRSqjxG.js";
5
5
  import { r as remoteServerPaths, t as ensureRemoteExtensions } from "./remote-extensions-L95HNwIH.js";
6
6
  import { randomBytes } from "node:crypto";
7
7
  import { z } from "zod";
@@ -1,9 +1,9 @@
1
- import { T as REVIEW_REMOTE_WRAPPER_MARK, w as REVIEW_REMOTE_INSTALL_LOCK } from "./src-CrrW7lcY.js";
1
+ import { T as REVIEW_REMOTE_WRAPPER_MARK, w as REVIEW_REMOTE_INSTALL_LOCK } from "./src-B-91Rd2d.js";
2
2
  import "./review-home-paths-BmZX2qiz.js";
3
3
  import { M as DEV_REVIEW_HOME_ENV } from "./s3-config-CjcLyFV5.js";
4
- import { c as stopBackgroundServer, o as recordedBackgroundServer } from "./background-server-BraP8pJ9.js";
4
+ import { c as stopBackgroundServer, o as recordedBackgroundServer } from "./background-server-BiRSqjxG.js";
5
5
  import { i as whiteboardRemoteHome } from "./remote-extensions-L95HNwIH.js";
6
- import { n as remoteLanguageServerGroups, r as stopProcessGroup } from "./remote-language-server-BAznkpeu.js";
6
+ import { n as remoteLanguageServerGroups, r as stopProcessGroup } from "./remote-language-server-l4ConTfj.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,7 +1,7 @@
1
1
  import { a as jsonNumber, c as jsonString, i as jsonBoolean, n as isJsonObject } from "./src-X9phtB2j.js";
2
- import { X as SELECTION_UNAVAILABLE_REASONS } from "./src-BQDlJXkG.js";
3
- import { _ as REVIEW_DIFF_LAYOUTS, b as REVIEW_OPEN_FILES_IN_CHOICES, g as REVIEW_COLOR_THEME_KINDS, v as REVIEW_DIFF_LAYOUT_SCOPES } from "./src-CrrW7lcY.js";
4
- import { n as askAgentIds } from "./thread-state-WTqSborE.js";
2
+ import { X as SELECTION_UNAVAILABLE_REASONS } from "./src-DirPN_Qh.js";
3
+ import { _ as REVIEW_DIFF_LAYOUTS, b as REVIEW_OPEN_FILES_IN_CHOICES, g as REVIEW_COLOR_THEME_KINDS, v as REVIEW_DIFF_LAYOUT_SCOPES } from "./src-B-91Rd2d.js";
4
+ import { n as askAgentIds } from "./thread-state-Jxoh1hde.js";
5
5
  import { z } from "zod";
6
6
  //#region src/telemetry-clean-text.ts
7
7
  const USER_DATA_REGEXES = [
@@ -303,6 +303,7 @@ const SOURCE_OPENED_DESTINATION = [
303
303
  "vscode",
304
304
  "cursor",
305
305
  "zed",
306
+ "intellij",
306
307
  "application"
307
308
  ];
308
309
  const SOURCE_OPENED_KIND = [
@@ -1,5 +1,5 @@
1
- import { o as parseReviewVerbResponse } from "./src-CrrW7lcY.js";
2
- import { b as selectReviewInstance, m as healthyReviewInstance, v as reviewInstanceStartHint, y as reviewInstanceUnavailable } from "./server-discovery-CV5qf1J8.js";
1
+ import { o as parseReviewVerbResponse } from "./src-B-91Rd2d.js";
2
+ import { b as selectReviewInstance, m as healthyReviewInstance, v as reviewInstanceStartHint, y as reviewInstanceUnavailable } from "./server-discovery-DYY_xeG9.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,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-CrrW7lcY.js";
2
+ import "./src-B-91Rd2d.js";
3
3
  import "./review-home-paths-BmZX2qiz.js";
4
4
  import { F as writeFileAtomic, N as devReviewHome, j as withFileLock, k as processIsAlive } from "./s3-config-CjcLyFV5.js";
5
5
  import { i as readReviewPackageVersion, t as findReviewPackageRoot } from "./package-paths-Dk7MOXxN.js";
6
- import "./request-origin-D6B-zrL8.js";
6
+ import "./request-origin-DZexKlc4.js";
7
7
  import { createHmac, randomUUID } from "node:crypto";
8
8
  import { z } from "zod";
9
9
  import { existsSync, readFileSync, rmSync } from "node:fs";
@@ -1,21 +1,21 @@
1
1
  #!/usr/bin/env node
2
2
  import { S as splitGitPatchFiles, a as diff, o as diffFileSummaries } from "../src-Y30gweiK.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 { C as StreamLimitError, v as legacyModeSchema, w as readBoundedStream } from "../import-CZ1958L4.js";
5
- import { ot as ReviewInputError, y as resourceReferences } from "../src-BQDlJXkG.js";
6
- import { F as reviewDiffrSummarizerInputSchema, O as ReviewConnectRequestSchema, d as ReviewBugReportRequestSchema, f as parseReviewBugReportResponse, j as ReviewGatewayHostSchema, m as REVIEW_CLIENT_REMOTE, p as REVIEW_CLIENT_HEADER, r as parseReviewDesktopVerbFrame, s as parseZod, t as parseReviewCliInstallApplyRequest, u as ReviewBugReportMetaV2Schema, y as REVIEW_HOST_HEADER } from "../src-CrrW7lcY.js";
4
+ import { C as StreamLimitError, v as legacyModeSchema, w as readBoundedStream } from "../import-CjcW7EIQ.js";
5
+ import { st as ReviewInputError, y as resourceReferences } from "../src-DirPN_Qh.js";
6
+ import { F as reviewDiffrSummarizerInputSchema, O as ReviewConnectRequestSchema, d as ReviewBugReportRequestSchema, f as parseReviewBugReportResponse, j as ReviewGatewayHostSchema, m as REVIEW_CLIENT_REMOTE, p as REVIEW_CLIENT_HEADER, r as parseReviewDesktopVerbFrame, s as parseZod, t as parseReviewCliInstallApplyRequest, u as ReviewBugReportMetaV2Schema, y as REVIEW_HOST_HEADER } from "../src-B-91Rd2d.js";
7
7
  import { i as reviewInstanceDiscoveryPath, o as reviewLegacyDiscoveryPath } from "../review-home-paths-BmZX2qiz.js";
8
- import { p as pullRequestProvider } from "../stored-document-migration-D1wK4yID.js";
8
+ import { p as pullRequestProvider } from "../stored-document-migration-vg0NAzXG.js";
9
9
  import { L as writePrivateJsonAtomic, N as devReviewHome } from "../s3-config-CjcLyFV5.js";
10
10
  import { t as errorMessage } from "../error-message-OtiDonty.js";
11
11
  import { i as readReviewPackageVersion, t as findReviewPackageRoot } from "../package-paths-Dk7MOXxN.js";
12
- import { _ as reviewInstanceIdentity, u as REVIEW_INSTANCE_ENV } from "../server-discovery-CV5qf1J8.js";
13
- import { t as openReviewProfile } from "../profile-Bsgzi9PA.js";
14
- import { r as reviewTelemetryChannel, t as ReviewTelemetry } from "../review-telemetry-DACDMfqq.js";
15
- import { l as REVIEW_TELEMETRY_TABS } from "../request-origin-D6B-zrL8.js";
16
- 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-BlYamXAG.js";
17
- import { C as DEFAULT_MAX_REQUEST_BYTES, D as writeAnimationsEnabled, E as readAnimationsEnabled, O as cliAskTools, S as readBoundedRequestJson, T as ReviewServerError, _ as saveDiffrSummarizer, a as drainServerCrashReport, b as remoteShare, c as answerErrorsAsJson, d as captureSanitizedUiTelemetry, f as clientErrorsForSession, g as readDiffrConfig, h as migrateDiffrConfig, l as createWhiteboardCore, m as GlobalReviewDesktopVerbRelay, o as installProcessErrorTelemetry, p as recordClientError, r as takeOverServerHome, s as serverCrashReportPath, u as serverJson, v as setDiffrConfigValue, w as HttpJsonError, x as createNodeRequestListener, y as testDiffrSummarizer } from "../headless-host-FAlbekFD.js";
18
- import { s as readQuerySchemas } from "../authoring-tools-CkfxTVJm.js";
12
+ import { _ as reviewInstanceIdentity, u as REVIEW_INSTANCE_ENV } from "../server-discovery-DYY_xeG9.js";
13
+ import { t as openReviewProfile } from "../profile-CNMhLUhf.js";
14
+ import { r as reviewTelemetryChannel, t as ReviewTelemetry } from "../review-telemetry-kQ7esDRE.js";
15
+ import { l as REVIEW_TELEMETRY_TABS } from "../request-origin-DZexKlc4.js";
16
+ 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-DXpd0Px8.js";
17
+ import { C as DEFAULT_MAX_REQUEST_BYTES, D as writeAnimationsEnabled, E as readAnimationsEnabled, O as cliAskTools, S as readBoundedRequestJson, T as ReviewServerError, _ as saveDiffrSummarizer, a as drainServerCrashReport, b as remoteShare, c as answerErrorsAsJson, d as captureSanitizedUiTelemetry, f as clientErrorsForSession, g as readDiffrConfig, h as migrateDiffrConfig, l as createWhiteboardCore, m as GlobalReviewDesktopVerbRelay, o as installProcessErrorTelemetry, p as recordClientError, r as takeOverServerHome, s as serverCrashReportPath, u as serverJson, v as setDiffrConfigValue, w as HttpJsonError, x as createNodeRequestListener, y as testDiffrSummarizer } from "../headless-host-CIuJJjmM.js";
18
+ import { s as readQuerySchemas } from "../authoring-tools-D1avYp8-.js";
19
19
  import crypto, { createHash, randomBytes } from "node:crypto";
20
20
  import { z } from "zod";
21
21
  import { Agent, request } from "undici";
@@ -1,5 +1,5 @@
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-CrrW7lcY.js";
2
+ import { n as parseReviewDesktopDiscovery } from "./src-B-91Rd2d.js";
3
3
  import { a as reviewInstancesDir, o as reviewLegacyDiscoveryPath, r as reviewDevInstanceKey, t as reviewDefaultInstancePath } from "./review-home-paths-BmZX2qiz.js";
4
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";
@@ -1,2 +1,2 @@
1
- import { a as shareKey, g as exportShare, o as validateShareBundle, t as importShare, u as ShareClient } from "../import-CZ1958L4.js";
1
+ import { a as shareKey, g as exportShare, o as validateShareBundle, t as importShare, u as ShareClient } from "../import-CjcW7EIQ.js";
2
2
  export { ShareClient, exportShare, importShare, shareKey, validateShareBundle };
@@ -290,6 +290,7 @@ const REVIEW_OPEN_FILES_IN_CHOICES = [
290
290
  "vscode",
291
291
  "cursor",
292
292
  "zed",
293
+ "intellij",
293
294
  "application"
294
295
  ];
295
296
  const reviewDiffrLoginsSchema = z.record(z.string(), z.object({
@@ -116,6 +116,43 @@ function formatAnchor(selection) {
116
116
  const letter = (side) => side === "base" ? "L" : "R";
117
117
  return `diff/${file}#${letter(start.side)}${start.line}-${letter(end.side)}${end.line}`;
118
118
  }
119
+ const HUNK = /^@@ -(\d+)(?:,(\d+))? \+(\d+)(?:,(\d+))? @@/;
120
+ /** The 0-based line pairs a unified patch aligns, unchanged gaps included,
121
+ * for files of `baseCount` and `headCount` lines. An empty patch pairs each
122
+ * line with itself. */
123
+ function patchRows(patch, baseCount, headCount) {
124
+ const rows = [];
125
+ let base = 0;
126
+ let head = 0;
127
+ let removed = 0;
128
+ let added = 0;
129
+ let inHunk = false;
130
+ const append = (baseEnd, headEnd) => {
131
+ while (base < baseEnd || head < headEnd) rows.push([base < baseEnd ? base++ : null, head < headEnd ? head++ : null]);
132
+ };
133
+ const flush = () => {
134
+ append(base + removed, head + added);
135
+ removed = added = 0;
136
+ };
137
+ for (const line of patch.split(/\r?\n/)) {
138
+ const hunk = HUNK.exec(line);
139
+ if (hunk) {
140
+ inHunk = true;
141
+ flush();
142
+ const [, oldStart, oldLines = "1", newStart, newLines = "1"] = hunk;
143
+ append(Number(oldLines) ? Number(oldStart) - 1 : Number(oldStart), Number(newLines) ? Number(newStart) - 1 : Number(newStart));
144
+ } else if (!inHunk) continue;
145
+ else if (line.startsWith("+")) added++;
146
+ else if (line.startsWith("-")) removed++;
147
+ else if (line.startsWith(" ")) {
148
+ flush();
149
+ append(base + 1, head + 1);
150
+ }
151
+ }
152
+ flush();
153
+ append(baseCount, headCount);
154
+ return rows;
155
+ }
119
156
  /** Pins-less selections keep the key they always had. */
120
157
  function selectionKey(source) {
121
158
  return JSON.stringify([
@@ -2368,4 +2405,4 @@ function written(element) {
2368
2405
  return applied;
2369
2406
  }
2370
2407
  //#endregion
2371
- export { comparisonKey as $, parseMarkdown as A, lensSchema as B, respellLinks as C, summarizeEdit as D, sourceReferences as E, writableBlockTypes as F, SourceRangeError as G, lensTargetsSchema as H, stepSources as I, requireVisibleSource as J, checkSourcePath as K, UNCATEGORIZED_LENS_ID as L, checkReferences as M, componentReference as N, markdownNodes as O, documentAdvice as P, anchorSelection as Q, applyLensEdit as R, respellEditLinks as S, selectionReferences as T, animationCode as U, lensSelections as V, label$1 as W, SELECTION_UNAVAILABLE_REASONS as X, sliceSourceRange as Y, SelectionUnavailableError as Z, readsAtBoardPins as _, boardLinks as a, unionIntervals as at, respellCommitLinks as b, documentSchema as c, activityEndSchema as ct, explicitPins as d, formatAnchor as et, pathTargetSchema as f, publishedEdits as g, pinsSchema as h, assignMissingIds as i, sourceAnchors as it, blocks as j, markdownText as k, editSchema as l, activityUpdateSchema as lt, pinnedRepositoryIds as m, anchorPins as n, resolveDiffSelection as nt, boardRepositoryId as o, ReviewInputError as ot, pinDocumentReferences as p, fileLineRangeSchema as q, applyEdit as r, selectionKey as rt, commitLinkCommits as s, activityBeginSchema as st, adoptFlowUnits as t, parseAnchor as tt, elements as u, focusSchema as ut, resourceReference as v, reviewTargetSchema as w, respellDocumentLinks as x, resourceReferences as y, lensEditSchema as z };
2408
+ export { comparisonKey as $, parseMarkdown as A, lensSchema as B, respellLinks as C, summarizeEdit as D, sourceReferences as E, writableBlockTypes as F, SourceRangeError as G, lensTargetsSchema as H, stepSources as I, requireVisibleSource as J, checkSourcePath as K, UNCATEGORIZED_LENS_ID as L, checkReferences as M, componentReference as N, markdownNodes as O, documentAdvice as P, anchorSelection as Q, applyLensEdit as R, respellEditLinks as S, selectionReferences as T, animationCode as U, lensSelections as V, label$1 as W, SELECTION_UNAVAILABLE_REASONS as X, sliceSourceRange as Y, SelectionUnavailableError as Z, readsAtBoardPins as _, boardLinks as a, sourceAnchors as at, respellCommitLinks as b, documentSchema as c, activityBeginSchema as ct, explicitPins as d, focusSchema as dt, formatAnchor as et, pathTargetSchema as f, publishedEdits as g, pinsSchema as h, assignMissingIds as i, selectionKey as it, blocks as j, markdownText as k, editSchema as l, activityEndSchema as lt, pinnedRepositoryIds as m, anchorPins as n, patchRows as nt, boardRepositoryId as o, unionIntervals as ot, pinDocumentReferences as p, fileLineRangeSchema as q, applyEdit as r, resolveDiffSelection as rt, commitLinkCommits as s, ReviewInputError as st, adoptFlowUnits as t, parseAnchor as tt, elements as u, activityUpdateSchema as ut, resourceReference as v, reviewTargetSchema as w, respellDocumentLinks as x, resourceReferences as y, lensEditSchema as z };
@@ -1,7 +1,7 @@
1
1
  import { C as renderVcsArgs, v as parseGitRemote, w as runVcs } from "./src-Y30gweiK.js";
2
2
  import { d as isBooleanValue, f as isNumberValue, l as jsonValueSchema, m as isStringValue, n as isJsonObject } from "./src-X9phtB2j.js";
3
- import { C as respellLinks, H as lensTargetsSchema, W as label, at as unionIntervals, et as formatAnchor, ot as ReviewInputError } from "./src-BQDlJXkG.js";
4
- import "./src-CrrW7lcY.js";
3
+ import { C as respellLinks, H as lensTargetsSchema, W as label, et as formatAnchor, ot as unionIntervals, st as ReviewInputError } from "./src-DirPN_Qh.js";
4
+ import "./src-B-91Rd2d.js";
5
5
  import "./review-home-paths-BmZX2qiz.js";
6
6
  import { t as errorMessage } from "./error-message-OtiDonty.js";
7
7
  import { randomUUID } from "node:crypto";
@@ -77,91 +77,6 @@ function coverageSources(file, coverage = file.viewed) {
77
77
  })));
78
78
  }
79
79
  //#endregion
80
- //#region src/unified-diff.ts
81
- const HUNK_HEADER = /^@@ -(?<oldStart>\d+)(?:,(?<oldLines>\d+))? \+(?<newStart>\d+)(?:,(?<newLines>\d+))? @@/;
82
- function parseUnifiedPatch(file, patch) {
83
- if (!patch) return [];
84
- const hunks = [];
85
- let current = null;
86
- let oldLine = 0;
87
- let newLine = 0;
88
- for (const row of patch.split(/\r?\n/)) {
89
- const header = HUNK_HEADER.exec(row);
90
- if (header?.groups) {
91
- current = {
92
- file,
93
- oldStart: Number(header.groups.oldStart),
94
- oldLines: Number(header.groups.oldLines ?? "1"),
95
- newStart: Number(header.groups.newStart),
96
- newLines: Number(header.groups.newLines ?? "1"),
97
- lines: []
98
- };
99
- oldLine = current.oldStart;
100
- newLine = current.newStart;
101
- hunks.push(current);
102
- continue;
103
- }
104
- if (!current || row.startsWith("\")) continue;
105
- const marker = row[0];
106
- const text = row.slice(1);
107
- let line = null;
108
- if (marker === " ") {
109
- line = {
110
- kind: "context",
111
- oldLine,
112
- newLine,
113
- text
114
- };
115
- oldLine += 1;
116
- newLine += 1;
117
- } else if (marker === "+") {
118
- line = {
119
- kind: "add",
120
- oldLine: null,
121
- newLine,
122
- text
123
- };
124
- newLine += 1;
125
- } else if (marker === "-") {
126
- line = {
127
- kind: "remove",
128
- oldLine,
129
- newLine: null,
130
- text
131
- };
132
- oldLine += 1;
133
- }
134
- if (line) current.lines.push(line);
135
- }
136
- return hunks;
137
- }
138
- //#endregion
139
- //#region src/review-api/lens-alignment.ts
140
- /** Project the already-computed patch's runs, including unchanged gaps. */
141
- function textualRows(path, patch, baseCount, headCount) {
142
- const rows = [];
143
- let base = 0, head = 0;
144
- const append = (baseEnd, headEnd) => {
145
- while (base < baseEnd || head < headEnd) rows.push([base < baseEnd ? base++ : null, head < headEnd ? head++ : null]);
146
- };
147
- for (const hunk of parseUnifiedPatch(path, patch)) {
148
- append(hunk.oldLines ? hunk.oldStart - 1 : hunk.oldStart, hunk.newLines ? hunk.newStart - 1 : hunk.newStart);
149
- let removed = 0, added = 0;
150
- const flush = () => {
151
- append(base + removed, head + added);
152
- removed = added = 0;
153
- };
154
- for (const line of hunk.lines) if (line.kind === "context") {
155
- flush();
156
- append(base + 1, head + 1);
157
- } else if (line.kind === "add") added++;
158
- else removed++;
159
- flush();
160
- }
161
- append(baseCount, headCount);
162
- return rows;
163
- }
164
- //#endregion
165
80
  //#region src/evidence.ts
166
81
  /** Quote matching shared by legacy publish and JSON accept: authors paste
167
82
  * transcript text with arbitrary line wrapping, so both sides compare on
@@ -1339,4 +1254,4 @@ function liftFileLenses(document) {
1339
1254
  };
1340
1255
  }
1341
1256
  //#endregion
1342
- export { updateCoverage as A, coverageSchema as C, scopedCoverage as D, intersectIntervals as E, sourcesForFile as O, parseUnifiedPatch as S, emptyCoverage as T, fetchPullRequest as _, SoftwareModelValidationError as a, textIncludesQuote as b, traceSchema as c, setPullRequest as d, sourceBranchName as f, defaultPullRequestDeps as g, GitHubRefusedRead as h, readStoredDocument as i, subtractIntervals as k, pullRequestKey as l, resolvePullRequest as m, migrateStoredDocument as n, defineSoftwareMap as o, pullRequestProvider as p, migrateStoredLenses as r, softwareModelDataSchema as s, liftFileLenses as t, pullRequestUrl as u, remoteUrls as v, coverageSources as w, textualRows as x, azureRepositoryOf as y };
1257
+ export { emptyCoverage as C, subtractIntervals as D, sourcesForFile as E, updateCoverage as O, coverageSources as S, scopedCoverage as T, fetchPullRequest as _, SoftwareModelValidationError as a, textIncludesQuote as b, traceSchema as c, setPullRequest as d, sourceBranchName as f, defaultPullRequestDeps as g, GitHubRefusedRead as h, readStoredDocument as i, pullRequestKey as l, resolvePullRequest as m, migrateStoredDocument as n, defineSoftwareMap as o, pullRequestProvider as p, migrateStoredLenses as r, softwareModelDataSchema as s, liftFileLenses as t, pullRequestUrl as u, remoteUrls as v, intersectIntervals as w, coverageSchema as x, azureRepositoryOf as y };
@@ -1,4 +1,4 @@
1
- import { E as ReviewApiSelectionSourceSchema, N as ReviewSelectedDiffSchema } from "./src-CrrW7lcY.js";
1
+ import { E as ReviewApiSelectionSourceSchema, N as ReviewSelectedDiffSchema } from "./src-B-91Rd2d.js";
2
2
  import { z } from "zod";
3
3
  import { stat } from "node:fs/promises";
4
4
  //#region src/fs-utils.ts
@@ -1,11 +1,11 @@
1
1
  import { m as isStringValue, n as isJsonObject, u as parseJsonText } from "./src-X9phtB2j.js";
2
- import { M as checkReferences, j as blocks, ot as ReviewInputError } from "./src-BQDlJXkG.js";
3
- import { l as boardTitle } from "./src-CrrW7lcY.js";
2
+ import { M as checkReferences, j as blocks, st as ReviewInputError } from "./src-DirPN_Qh.js";
3
+ import { l as boardTitle } from "./src-B-91Rd2d.js";
4
4
  import "./review-home-paths-BmZX2qiz.js";
5
- import { n as callAuthoringTool, s as ReviewApiError, t as ToolText } from "./agent-client-BCEbSPWU.js";
5
+ import { n as callAuthoringTool, s as ReviewApiError, t as ToolText } from "./agent-client-BFtYm3Ng.js";
6
6
  import { N as devReviewHome } from "./s3-config-CjcLyFV5.js";
7
7
  import { t as findReviewPackageRoot } from "./package-paths-Dk7MOXxN.js";
8
- import { m as isMissingFileError } from "./thread-state-WTqSborE.js";
8
+ import { m as isMissingFileError } from "./thread-state-Jxoh1hde.js";
9
9
  import { createHash } from "node:crypto";
10
10
  import { z } from "zod";
11
11
  import { chmod, cp, mkdir, readFile, readdir, rm, writeFile } from "node:fs/promises";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dev.fast/whiteboard",
3
- "version": "0.5.2-preview.20261104.146",
3
+ "version": "0.5.2-preview.20261104.147",
4
4
  "private": false,
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -76,12 +76,12 @@
76
76
  "tsx": "4.21.0",
77
77
  "typescript": "6.0.3",
78
78
  "vitest": "4.1.12",
79
+ "@dev.fast/review-protocol": "0.0.0",
79
80
  "@dev.fast/json": "0.0.0",
80
81
  "@dev.fast/review-share-protocol": "0.6.0",
81
- "@dev.fast/review-protocol": "0.0.0",
82
- "@dev.fast/trace-protocol": "0.5.0",
83
82
  "@dev.fast/trace-core": "0.0.0",
84
- "@dev.fast/whiteboard-document": "0.2.1"
83
+ "@dev.fast/trace-protocol": "0.5.0",
84
+ "@dev.fast/whiteboard-document": "0.2.2"
85
85
  },
86
86
  "engines": {
87
87
  "node": ">=24 <25"
@@ -91,7 +91,7 @@
91
91
  "repo": "devdotfast/review",
92
92
  "docs": "packages/review/instructions/authoring.md"
93
93
  },
94
- "gitHead": "20f4d6dcfaa9f7a40ff77fd6e6b2467fc89e64fa",
94
+ "gitHead": "07deb9e521a2e372643d2d13350f9868b41fd264",
95
95
  "scripts": {
96
96
  "prebuild": "pnpm run build:workspace-deps",
97
97
  "build": "node --max-old-space-size=8192 node_modules/tsdown/dist/run.mjs",
@@ -7,10 +7,11 @@ import {
7
7
  applyStructuralUpdate,
8
8
  structuralRows,
9
9
  } from "@dev.fast/review-protocol";
10
- import type {
11
- AlignmentRow,
12
- FileLineRange,
13
- Pins,
10
+ import {
11
+ type AlignmentRow,
12
+ type FileLineRange,
13
+ type Pins,
14
+ patchRows,
14
15
  } from "@dev.fast/whiteboard-document";
15
16
  import { parseUnifiedPatch } from "@review/unified-diff.js";
16
17
  import {
@@ -23,7 +24,6 @@ import {
23
24
  unionIntervals,
24
25
  } from "@review/viewed-coverage.js";
25
26
 
26
- import { textualRows } from "./lens-alignment.js";
27
27
  import type { LocalReviewData } from "./local-data.js";
28
28
 
29
29
  const hash = (parts: (string | null)[]) =>
@@ -91,8 +91,7 @@ export async function comparisonCoverage(
91
91
 
92
92
  alignments.set(
93
93
  file.path,
94
- textualRows(
95
- file.path,
94
+ patchRows(
96
95
  patch,
97
96
  base === null ? 0 : base.split("\n").length,
98
97
  head === null ? 0 : head.split("\n").length,
@@ -13,6 +13,7 @@ import {
13
13
  comparisonKey,
14
14
  fileLineRangeSchema,
15
15
  lensSelections,
16
+ patchRows,
16
17
  resolveDiffSelection,
17
18
  selectionKey,
18
19
  selectionReferences,
@@ -26,7 +27,6 @@ import {
26
27
  resolveFileLens,
27
28
  uncategorizedSources,
28
29
  } from "./file-lenses.js";
29
- import { textualRows } from "./lens-alignment.js";
30
30
  import type { LocalReviewData } from "./local-data.js";
31
31
  import type { ReviewStore, Snapshot } from "./store.js";
32
32
 
@@ -208,8 +208,7 @@ export async function reviewProgress(
208
208
  "no_alignment",
209
209
  "Changed context file has no alignment.",
210
210
  );
211
- rows = textualRows(
212
- source.file,
211
+ rows = patchRows(
213
212
  "",
214
213
  base?.split("\n").length ?? 0,
215
214
  head?.split("\n").length ?? 0,
@@ -223,6 +223,7 @@ const SOURCE_OPENED_DESTINATION = [
223
223
  "vscode",
224
224
  "cursor",
225
225
  "zed",
226
+ "intellij",
226
227
  "application",
227
228
  ] as const;
228
229
 
@@ -1,2 +0,0 @@
1
- import { n as runReviewAgentCli } from "./agent-cli-D7fF5xmm.js";
2
- export { runReviewAgentCli };
@@ -1,2 +0,0 @@
1
- import { t as openReviewProfile } from "./profile-Bsgzi9PA.js";
2
- export { openReviewProfile };
@@ -1,52 +0,0 @@
1
- import type { AlignmentRow } from "@dev.fast/whiteboard-document";
2
- import { parseUnifiedPatch } from "@review/unified-diff.js";
3
-
4
- /** Project the already-computed patch's runs, including unchanged gaps. */
5
- export function textualRows(
6
- path: string,
7
- patch: string,
8
- baseCount: number,
9
- headCount: number,
10
- ): AlignmentRow[] {
11
- const rows: AlignmentRow[] = [];
12
-
13
- let base = 0,
14
- head = 0;
15
-
16
- const append = (baseEnd: number, headEnd: number) => {
17
- while (base < baseEnd || head < headEnd)
18
- rows.push([
19
- base < baseEnd ? base++ : null,
20
- head < headEnd ? head++ : null,
21
- ]);
22
- };
23
-
24
- for (const hunk of parseUnifiedPatch(path, patch)) {
25
- append(
26
- hunk.oldLines ? hunk.oldStart - 1 : hunk.oldStart,
27
- hunk.newLines ? hunk.newStart - 1 : hunk.newStart,
28
- );
29
-
30
- let removed = 0,
31
- added = 0;
32
-
33
- const flush = () => {
34
- append(base + removed, head + added);
35
- removed = added = 0;
36
- };
37
-
38
- for (const line of hunk.lines) {
39
- if (line.kind === "context") {
40
- flush();
41
- append(base + 1, head + 1);
42
- } else if (line.kind === "add") added++;
43
- else removed++;
44
- }
45
-
46
- flush();
47
- }
48
-
49
- append(baseCount, headCount);
50
-
51
- return rows;
52
- }