@dev.fast/whiteboard 0.2.3 → 0.2.4
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.
- package/dist/{account-alias-DLE9XZhi.js → account-alias-_1_7vROx.js} +1 -1
- package/dist/agent-cli-BR2j-2n5.js +2 -0
- package/dist/{agent-cli-DRRQfHQ-.js → agent-cli-BrFqhnzM.js} +6 -6
- package/dist/{agent-client-DoaODH6I.js → agent-client-B_b1GtUc.js} +2 -2
- package/dist/{authoring-tools-F_q8cC7J.js → authoring-tools-DvIO906l.js} +2 -2
- package/dist/build-info.json +1 -1
- package/dist/{cli-DtolttUF.js → cli-gRGxkwc0.js} +1 -1
- package/dist/{cli-runner-Cwg5PeH2.js → cli-runner-Cjl8h376.js} +11 -11
- package/dist/cli.js +2 -2
- package/dist/{client-D01H2KOV.js → client-BFClfQLO.js} +2 -2
- package/dist/{desktop-discovery-DK2HoBy5.js → desktop-discovery-C-Qz54wO.js} +1 -1
- package/dist/{headless-host-Dd_-zkC4.js → headless-host-DcWaxx9P.js} +2 -2
- package/dist/{local-data-D-EoJfPx.js → local-data-Bm84Xdck.js} +72 -78
- package/dist/{mcp-BAE5rMgB.js → mcp-BDy9Aybd.js} +3 -3
- package/dist/{process-error-telemetry-mzRG988B.js → process-error-telemetry-Dzh5a3s_.js} +23 -17
- package/dist/profile-BQGaX8aX.js +2 -0
- package/dist/{profile-WzZu7Spt.js → profile-RDEioF8b.js} +1 -1
- package/dist/{request-origin-DlHTFCrQ.js → request-origin-DA4K1qWY.js} +1 -1
- package/dist/{review-telemetry-Pp4ZsVrh.js → review-telemetry-DBy3eVCo.js} +2 -2
- package/dist/server/desktop-host.js +10 -10
- package/dist/sharing/index.d.ts +13 -12
- package/dist/sharing/index.js +1 -1
- package/dist/{src-DHiDJQDy.js → src-WCbabvdS.js} +3 -2
- package/dist/{stored-document-migration-T9Uj5MkN.js → stored-document-migration-BxZWQQjv.js} +1 -1
- package/dist/{tool-failure-Djeeax6q.js → tool-failure-DJmTieh5.js} +1 -1
- package/package.json +5 -5
- package/src/review-api/comparison-coverage.ts +192 -165
- package/src/review-api/http.ts +11 -0
- package/src/review-api/local-data.ts +9 -3
- package/src/review-api/review-progress.ts +19 -9
- package/src/server/diffr-config.ts +1 -1
- package/src/server/structural-diff.ts +10 -9
- package/dist/agent-cli-50KJgMKi.js +0 -2
- package/dist/profile-Cqztt-9-.js +0 -2
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { h as ReviewCliInstallStampSchema } from "./src-
|
|
1
|
+
import { h as ReviewCliInstallStampSchema } from "./src-WCbabvdS.js";
|
|
2
2
|
import { G as readStoreAuth, Z as StoreClient } from "./review-agent-traces-DNJFYzc8.js";
|
|
3
3
|
import { A as devReviewHome, N as writeFileAtomicAsync, O as withFileLock, P as writePrivateJsonAtomic } from "./s3-config-CAxhO9u_.js";
|
|
4
4
|
import { B as installHarnessHooks, C as disableTraceMachine, E as traceMachineStatus, F as listTraceRepositoryRoots, G as traceScope, I as traceRepositoryStatus, N as disableAllTraceRepositories, P as enableTraceRepository, R as AGENT_TRACE_HOOK_AGENTS, S as configureTraceMachine, T as traceMachineEnabled, V as removeAgentTraceHook, n as reviewDesktopStateDir, z as describeTraceHookOwners } from "./review-home-paths-6zZH-1c9.js";
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { n as isJsonObject, u as parseJsonText } from "./src-X9phtB2j.js";
|
|
2
|
-
import { a as toolResultText, i as connectReviewInstance, s as ReviewApiError } from "./agent-client-
|
|
2
|
+
import { a as toolResultText, i as connectReviewInstance, s as ReviewApiError } from "./agent-client-B_b1GtUc.js";
|
|
3
3
|
import { A as devReviewHome } from "./s3-config-CAxhO9u_.js";
|
|
4
4
|
import { T as traceMachineEnabled } from "./review-home-paths-6zZH-1c9.js";
|
|
5
|
-
import { d as selectReviewInstance, t as REVIEW_INSTANCE_ENV } from "./desktop-discovery-
|
|
6
|
-
import { n as reviewSessionAgent } from "./review-telemetry-
|
|
7
|
-
import { n as REVIEW_VIA_HEADER, t as REVIEW_AGENT_HEADER } from "./request-origin-
|
|
8
|
-
import { i as publicTool, n as RECOVERY, r as callPublicTool, t as toolFailure } from "./tool-failure-
|
|
5
|
+
import { d as selectReviewInstance, t as REVIEW_INSTANCE_ENV } from "./desktop-discovery-C-Qz54wO.js";
|
|
6
|
+
import { n as reviewSessionAgent } from "./review-telemetry-DBy3eVCo.js";
|
|
7
|
+
import { n as REVIEW_VIA_HEADER, t as REVIEW_AGENT_HEADER } from "./request-origin-DA4K1qWY.js";
|
|
8
|
+
import { i as publicTool, n as RECOVERY, r as callPublicTool, t as toolFailure } from "./tool-failure-DJmTieh5.js";
|
|
9
9
|
//#region src/review-api/agent-cli.ts
|
|
10
10
|
const reviewAgentCliHelp = "whiteboard api tools (one line per tool)\nwhiteboard api tools <tool-name> (its description and input schema)\nwhiteboard api <tool-name> '<json>'\nwhiteboard api <tool-name> - (read JSON from stdin)\nwhiteboard mcp (stdio MCP adapter; Whiteboard Desktop or whiteboard server start must be running)\nSelect headless state with DEV_REVIEW_SERVER_DIR or whiteboard --state-dir <path> api/mcp.\n";
|
|
11
11
|
async function runReviewAgentCli(input) {
|
|
@@ -23,7 +23,7 @@ async function runReviewAgentCli(input) {
|
|
|
23
23
|
[REVIEW_AGENT_HEADER]: reviewSessionAgent(env)
|
|
24
24
|
};
|
|
25
25
|
if (mode === "mcp") {
|
|
26
|
-
const { serveReviewMcp } = await import("./mcp-
|
|
26
|
+
const { serveReviewMcp } = await import("./mcp-BDy9Aybd.js");
|
|
27
27
|
await serveReviewMcp(async (key, agentKind) => {
|
|
28
28
|
const connected = await connectReviewInstance(key ? {
|
|
29
29
|
...env,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { d as isBooleanValue, f as isNumberValue, m as isStringValue, u as parseJsonText } from "./src-X9phtB2j.js";
|
|
2
|
-
import "./src-
|
|
2
|
+
import "./src-WCbabvdS.js";
|
|
3
3
|
import { t as ReviewInputError } from "./input-error-OLgB_h31.js";
|
|
4
|
-
import { d as selectReviewInstance, i as healthyReviewInstance, n as ReviewInstanceUnavailableError, u as reviewInstanceUnavailable } from "./desktop-discovery-
|
|
4
|
+
import { d as selectReviewInstance, i as healthyReviewInstance, n as ReviewInstanceUnavailableError, u as reviewInstanceUnavailable } from "./desktop-discovery-C-Qz54wO.js";
|
|
5
5
|
import { a as reviewServerIsHealthy, n as readReviewServerDiscovery, o as reviewServerStateDir, s as serverNotReady } from "./server-discovery-Dbzn3w6Z.js";
|
|
6
6
|
//#region ../review-protocol/src/review-api-client.ts
|
|
7
7
|
const defaultRequest = (url, init) => fetch(url, init);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { g as activityUpdateSchema, h as activityEndSchema, i as commandSchema, m as activityBeginSchema, n as uploadSchema } from "./local-data-
|
|
2
|
-
import { x as publishedEditSchema, y as pathTargetSchema } from "./stored-document-migration-
|
|
1
|
+
import { g as activityUpdateSchema, h as activityEndSchema, i as commandSchema, m as activityBeginSchema, n as uploadSchema } from "./local-data-Bm84Xdck.js";
|
|
2
|
+
import { x as publishedEditSchema, y as pathTargetSchema } from "./stored-document-migration-BxZWQQjv.js";
|
|
3
3
|
import { t as ReviewInputError } from "./input-error-OLgB_h31.js";
|
|
4
4
|
import { t as findReviewPackageRoot } from "./package-paths-B6-zxvIO.js";
|
|
5
5
|
import { z } from "zod";
|
package/dist/build-info.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":"0.2.
|
|
1
|
+
{"version":"0.2.4","commit":"5b00f0e66d034e187a29d270b3690a37b57ccf7b","dirty":true,"builtAt":"2026-10-09T06:23:07.418Z"}
|
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
import { C as __commonJSMin, S as setLocalVcsCommandObserver, T as __toESM, w as __require } from "./src-CmdiBL20.js";
|
|
2
2
|
import { c as jsonString, n as isJsonObject, u as parseJsonText } from "./src-X9phtB2j.js";
|
|
3
|
-
import { a as parseReviewVerbResponse } from "./src-
|
|
3
|
+
import { a as parseReviewVerbResponse } from "./src-WCbabvdS.js";
|
|
4
4
|
import { $ as emitJsonEvent, G as readStoreAuth, H as DEFAULT_STORE_ORIGIN, J as runStoreLogout, N as requireTraceConsent, P as resolveTraceRepositoryTarget, Q as withStoreAuthorization, V as readTraceUserConfig, X as StoreApiError, Y as runStoreWhoami, Z as StoreClient, b as selectTraceStorage, et as failWithJsonError, g as describeSelection, nt as jsonRequestedInArgv, q as runStoreLogin, tt as humanStream, v as loadS3TraceStorage } from "./review-agent-traces-DNJFYzc8.js";
|
|
5
|
-
import { o as ReviewApiClient, s as ReviewApiError } from "./agent-client-
|
|
5
|
+
import { o as ReviewApiClient, s as ReviewApiError } from "./agent-client-B_b1GtUc.js";
|
|
6
6
|
import { t as resolveReviewRoot } from "./runtime-CKiWhGrf.js";
|
|
7
7
|
import { A as devReviewHome, C as s3ProfileSchema, D as processIsAlive, E as writeTraceConfigFile, S as readTraceConfigFile, T as sameS3Profile, _ as emptyTraceConfig, c as resolveS3Setup, g as currentStore, h as TraceConfigurationError, i as isS3MockMode, j as normalizeStoreOrigin, k as DEV_REVIEW_HOME_ENV, n as clearTraceEnvCache, o as readTraceEnvFile, p as traceSettingsPath, w as s3Store } from "./s3-config-CAxhO9u_.js";
|
|
8
8
|
import { t as errorMessage } from "./error-message-OtiDonty.js";
|
|
9
9
|
import { A as runTraceSessions, D as runTraceAllow, E as traceMachineStatus, G as traceScope, H as resolveTraceCommand, I as traceRepositoryStatus, L as HOSTED_CAPTURE_SCOPE_DESCRIPTION, M as runTraceStoreInfo, O as runTraceDeny, T as traceMachineEnabled, W as traceHomeDir, _ as runTraceRepair, b as runTraceGitHook, c as registerTraceCommands, d as runTraceList$1, f as runTracePull$1, g as runTraceInstallMachine, h as runTraceEnable, j as runTraceStoreDelete, k as runTraceOnboard, l as resolveTraceReadStorage, m as runTraceDisable, p as runTraceShow, u as runTraceBlame, v as runTraceStatus, w as readLegacyCaptureSettings, x as runTraceHook, y as runTraceSync } from "./review-home-paths-6zZH-1c9.js";
|
|
10
10
|
import { i as readReviewPackageVersion, r as readBuildInfo, t as findReviewPackageRoot } from "./package-paths-B6-zxvIO.js";
|
|
11
|
-
import { a as readDefaultReviewInstance, d as selectReviewInstance, f as writeDefaultReviewInstance, i as healthyReviewInstance, l as reviewInstanceStartHint, n as ReviewInstanceUnavailableError, o as readReviewInstances, r as clearDefaultReviewInstance, s as requireHealthyReviewDesktop, t as REVIEW_INSTANCE_ENV, u as reviewInstanceUnavailable } from "./desktop-discovery-
|
|
12
|
-
import { t as ReviewTelemetry } from "./review-telemetry-
|
|
13
|
-
import { a as isOwnedShim, f as windowsInstallerCommand, m as connectPrompts, o as pathShimPath, p as scanLegacySkills, t as aliasInstallationToAccount } from "./account-alias-
|
|
11
|
+
import { a as readDefaultReviewInstance, d as selectReviewInstance, f as writeDefaultReviewInstance, i as healthyReviewInstance, l as reviewInstanceStartHint, n as ReviewInstanceUnavailableError, o as readReviewInstances, r as clearDefaultReviewInstance, s as requireHealthyReviewDesktop, t as REVIEW_INSTANCE_ENV, u as reviewInstanceUnavailable } from "./desktop-discovery-C-Qz54wO.js";
|
|
12
|
+
import { t as ReviewTelemetry } from "./review-telemetry-DBy3eVCo.js";
|
|
13
|
+
import { a as isOwnedShim, f as windowsInstallerCommand, m as connectPrompts, o as pathShimPath, p as scanLegacySkills, t as aliasInstallationToAccount } from "./account-alias-_1_7vROx.js";
|
|
14
14
|
import { t as fuzzyRank } from "./fuzzy-match-BoAmcyak.js";
|
|
15
15
|
import { n as readReviewServerDiscovery, o as reviewServerStateDir, r as readReviewServerHealth, s as serverNotReady } from "./server-discovery-Dbzn3w6Z.js";
|
|
16
|
-
import { t as reviewAgentCliHelp } from "./agent-cli-
|
|
16
|
+
import { t as reviewAgentCliHelp } from "./agent-cli-BrFqhnzM.js";
|
|
17
17
|
import { closeSync, existsSync, fstatSync, mkdirSync, mkdtempSync, openSync, readSync, renameSync, writeFileSync } from "node:fs";
|
|
18
18
|
import { realpath } from "node:fs/promises";
|
|
19
19
|
import path from "node:path";
|
|
@@ -4495,7 +4495,7 @@ async function runReviewCli(input) {
|
|
|
4495
4495
|
process.once("SIGINT", stop);
|
|
4496
4496
|
process.once("SIGTERM", stop);
|
|
4497
4497
|
try {
|
|
4498
|
-
const { runHeadlessServer } = await import("./headless-host-
|
|
4498
|
+
const { runHeadlessServer } = await import("./headless-host-DcWaxx9P.js");
|
|
4499
4499
|
await runHeadlessServer({
|
|
4500
4500
|
stateDir,
|
|
4501
4501
|
port,
|
|
@@ -4546,7 +4546,7 @@ async function runReviewCli(input) {
|
|
|
4546
4546
|
if (problem) throw new Error(`Cannot tell whether a Whiteboard Desktop is using ${stateDir}: ${problem.message}`);
|
|
4547
4547
|
const inUse = () => /* @__PURE__ */ new Error(`A Whiteboard server is using ${stateDir}. Stop it first, then run whiteboard server reset-id again.`);
|
|
4548
4548
|
if (desktops.instances.some(({ discovery }) => [discovery.appPid, discovery.serverPid].some((pid) => processIsAlive(pid)))) throw inUse();
|
|
4549
|
-
const [{ openReviewProfile }, { withHeadlessServerLock }] = await Promise.all([import("./profile-
|
|
4549
|
+
const [{ openReviewProfile }, { withHeadlessServerLock }] = await Promise.all([import("./profile-BQGaX8aX.js"), import("./headless-host-DcWaxx9P.js")]);
|
|
4550
4550
|
const reset = await withHeadlessServerLock(await realpath(stateDir), async () => {
|
|
4551
4551
|
const local = await openReviewProfile(stateDir, { manageWorkspaces: false });
|
|
4552
4552
|
try {
|
|
@@ -4686,14 +4686,14 @@ async function runReviewCli(input) {
|
|
|
4686
4686
|
command.showHelpAfterError(false).error("Markdown review migration is no longer supported. Ask your agent to migrate your old Whiteboard reviews.");
|
|
4687
4687
|
});
|
|
4688
4688
|
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) => {
|
|
4689
|
-
const { runShareCli } = await import("./cli-
|
|
4689
|
+
const { runShareCli } = await import("./cli-gRGxkwc0.js");
|
|
4690
4690
|
state.exitCode = await runShareCli({
|
|
4691
4691
|
...input,
|
|
4692
4692
|
...options,
|
|
4693
4693
|
env: authoringEnv()
|
|
4694
4694
|
});
|
|
4695
4695
|
}).command("revoke <share-id>").description("Revoke future downloads of a share"), "plain").action(async (shareId, options) => {
|
|
4696
|
-
const { runShareCli } = await import("./cli-
|
|
4696
|
+
const { runShareCli } = await import("./cli-gRGxkwc0.js");
|
|
4697
4697
|
state.exitCode = await runShareCli({
|
|
4698
4698
|
...input,
|
|
4699
4699
|
...options,
|
|
@@ -4774,7 +4774,7 @@ async function runReviewCli(input) {
|
|
|
4774
4774
|
return commands;
|
|
4775
4775
|
} });
|
|
4776
4776
|
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) => {
|
|
4777
|
-
const { runReviewAgentCli } = await import("./agent-cli-
|
|
4777
|
+
const { runReviewAgentCli } = await import("./agent-cli-BR2j-2n5.js");
|
|
4778
4778
|
state.exitCode = await runReviewAgentCli({
|
|
4779
4779
|
...input,
|
|
4780
4780
|
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-
|
|
3
|
+
import "./src-WCbabvdS.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-
|
|
20
|
+
const { runReviewCli } = await import("./cli-runner-Cjl8h376.js");
|
|
21
21
|
return runReviewCli({
|
|
22
22
|
argv,
|
|
23
23
|
cliPaths: {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { d as gitAt } from "./src-CmdiBL20.js";
|
|
2
2
|
import { n as isJsonObject, u as parseJsonText } from "./src-X9phtB2j.js";
|
|
3
|
-
import "./src-
|
|
4
|
-
import { B as parseMarkdown, C as resourceReferences, E as sourceReferences, K as sourceAnchors, M as lensSchema, N as lensSelections, O as checkReferences, S as resourceReference, _ as hasCodeReferences, b as pinsSchema, c as traceSchema, h as elements, l as textIncludesQuote, n as migrateStoredDocument, o as normalizedSoftwareElementSchema, p as documentSchema, r as migrateStoredLenses, s as normalizedSoftwareRelationshipSchema, t as liftFileLenses, u as anchorPins, z as markdownNodes } from "./stored-document-migration-
|
|
3
|
+
import "./src-WCbabvdS.js";
|
|
4
|
+
import { B as parseMarkdown, C as resourceReferences, E as sourceReferences, K as sourceAnchors, M as lensSchema, N as lensSelections, O as checkReferences, S as resourceReference, _ as hasCodeReferences, b as pinsSchema, c as traceSchema, h as elements, l as textIncludesQuote, n as migrateStoredDocument, o as normalizedSoftwareElementSchema, p as documentSchema, r as migrateStoredLenses, s as normalizedSoftwareRelationshipSchema, t as liftFileLenses, u as anchorPins, z as markdownNodes } from "./stored-document-migration-BxZWQQjv.js";
|
|
5
5
|
import { t as ReviewInputError } from "./input-error-OLgB_h31.js";
|
|
6
6
|
import { createHash, randomUUID } from "node:crypto";
|
|
7
7
|
import { z } from "zod";
|
|
@@ -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-
|
|
2
|
+
import { n as parseReviewDesktopDiscovery } from "./src-WCbabvdS.js";
|
|
3
3
|
import { a as reviewInstancesDir, o as reviewLegacyDiscoveryPath, r as reviewDevInstanceKey, t as reviewDefaultInstancePath } from "./review-home-paths-6zZH-1c9.js";
|
|
4
4
|
import { mkdir, readFile, readdir, rm, writeFile } from "node:fs/promises";
|
|
5
5
|
import path from "node:path";
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { p as isObjectValue } from "./src-X9phtB2j.js";
|
|
2
2
|
import { O as withFileLock, P as writePrivateJsonAtomic } from "./s3-config-CAxhO9u_.js";
|
|
3
3
|
import "./review-home-paths-6zZH-1c9.js";
|
|
4
|
-
import { t as openReviewProfile } from "./profile-
|
|
5
|
-
import { i as createWhiteboardCore, l as createNodeRequestListener, m as migrateDiffrConfig, n as installProcessErrorTelemetry, p as GlobalReviewDesktopVerbRelay, t as drainServerCrashReport } from "./process-error-telemetry-
|
|
4
|
+
import { t as openReviewProfile } from "./profile-RDEioF8b.js";
|
|
5
|
+
import { i as createWhiteboardCore, l as createNodeRequestListener, m as migrateDiffrConfig, n as installProcessErrorTelemetry, p as GlobalReviewDesktopVerbRelay, t as drainServerCrashReport } from "./process-error-telemetry-Dzh5a3s_.js";
|
|
6
6
|
import { i as reviewServerDiscoveryPath, t as headlessServerLockPath } from "./server-discovery-Dbzn3w6Z.js";
|
|
7
7
|
import { randomBytes, randomUUID } from "node:crypto";
|
|
8
8
|
import { mkdir, realpath, rm } from "node:fs/promises";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { _ as readFileAtCommit, b as resolveRevision, c as diffTrees, f as gitCommonDir, g as parseGitRemote, h as listTrackedFilesAtCommit, i as diff, l as diffWorkingTree, m as listCommitRange, n as createBlobBatchReader, o as diffFileSummariesTrees, p as jjRevisionIsConflicted, r as detectLocalVcs, s as diffFileSummariesWorkingTree, t as LocalVcsToolsMissingError, u as git, v as resolveRepoContext, y as resolveRepoContextSync } from "./src-CmdiBL20.js";
|
|
2
2
|
import { c as jsonString, o as jsonObject, u as parseJsonText } from "./src-X9phtB2j.js";
|
|
3
|
-
import { _ as SCRATCHPAD_REVIEW_ID, b as structuralChangeCounts, g as ReviewSelectedDiffSchema, m as ReviewApiSelectionSourceSchema, y as decodeStructuralDiffEvent } from "./src-
|
|
4
|
-
import { $ as unionIntervals, A as applyLensEdit, C as resourceReferences, D as summarizeEdit, E as sourceReferences, F as checkSourcePath, I as fileLineRangeSchema, K as sourceAnchors, L as requireVisibleSource, N as lensSelections, O as checkReferences, P as SourceRangeError, Q as subtractIntervals, R as sliceSourceRange, S as resourceReference, X as intersectIntervals, Y as emptyCoverage, a as defineSoftwareMap, b as pinsSchema, c as traceSchema, d as applyEdit, et as updateCoverage, f as assignFreshIds, g as explicitPins, h as elements, i as SoftwareModelValidationError, j as lensEditSchema, l as textIncludesQuote, m as editSchema, n as migrateStoredDocument, p as documentSchema, q as coverageSchema, r as migrateStoredLenses, t as liftFileLenses, u as anchorPins, v as isUnit, w as reviewTargetSchema } from "./stored-document-migration-
|
|
3
|
+
import { _ as SCRATCHPAD_REVIEW_ID, b as structuralChangeCounts, g as ReviewSelectedDiffSchema, m as ReviewApiSelectionSourceSchema, y as decodeStructuralDiffEvent } from "./src-WCbabvdS.js";
|
|
4
|
+
import { $ as unionIntervals, A as applyLensEdit, C as resourceReferences, D as summarizeEdit, E as sourceReferences, F as checkSourcePath, I as fileLineRangeSchema, K as sourceAnchors, L as requireVisibleSource, N as lensSelections, O as checkReferences, P as SourceRangeError, Q as subtractIntervals, R as sliceSourceRange, S as resourceReference, X as intersectIntervals, Y as emptyCoverage, a as defineSoftwareMap, b as pinsSchema, c as traceSchema, d as applyEdit, et as updateCoverage, f as assignFreshIds, g as explicitPins, h as elements, i as SoftwareModelValidationError, j as lensEditSchema, l as textIncludesQuote, m as editSchema, n as migrateStoredDocument, p as documentSchema, q as coverageSchema, r as migrateStoredLenses, t as liftFileLenses, u as anchorPins, v as isUnit, w as reviewTargetSchema } from "./stored-document-migration-BxZWQQjv.js";
|
|
5
5
|
import { t as ReviewInputError } from "./input-error-OLgB_h31.js";
|
|
6
6
|
import { D as processIsAlive, O as withFileLock, P as writePrivateJsonAtomic } from "./s3-config-CAxhO9u_.js";
|
|
7
7
|
import { t as errorMessage } from "./error-message-OtiDonty.js";
|
|
@@ -18,7 +18,7 @@ import { execFile, spawn } from "node:child_process";
|
|
|
18
18
|
import { promisify } from "node:util";
|
|
19
19
|
import { DatabaseSync } from "node:sqlite";
|
|
20
20
|
import { createInterface } from "node:readline";
|
|
21
|
-
//#region ../../
|
|
21
|
+
//#region ../../diffr/diffr-ts/dist/binary.js
|
|
22
22
|
/** The diffr executable from the installed platform package, if npm installed one for this machine. */
|
|
23
23
|
function diffrBinaryPath() {
|
|
24
24
|
const name = process.platform === "win32" ? "diffr.exe" : "diffr";
|
|
@@ -425,9 +425,9 @@ async function* structuralDiff(input) {
|
|
|
425
425
|
case "merge-base": args.push(`${comparison.base}...${comparison.head}`);
|
|
426
426
|
}
|
|
427
427
|
args.push("--", ...input.paths ?? []);
|
|
428
|
-
const
|
|
429
|
-
const
|
|
430
|
-
const signal = AbortSignal.any([
|
|
428
|
+
const startupAbort = new AbortController();
|
|
429
|
+
const startup = setTimeout(() => startupAbort.abort(), 12e4);
|
|
430
|
+
const signal = AbortSignal.any([startupAbort.signal, input.signal]);
|
|
431
431
|
console.info(`[Review] structural diff: ${executable} ${args.join(" ")}`);
|
|
432
432
|
const child = spawn(executable, args, {
|
|
433
433
|
cwd: input.repositoryPath,
|
|
@@ -461,14 +461,14 @@ async function* structuralDiff(input) {
|
|
|
461
461
|
});
|
|
462
462
|
try {
|
|
463
463
|
for await (const line of lines) {
|
|
464
|
-
|
|
465
|
-
if (Buffer.byteLength(line) > 67108864) throw new Error("Structural diff record exceeded 64 MiB.");
|
|
464
|
+
if (Buffer.byteLength(line) > 100663296) throw new Error("Structural diff record exceeded 96 MiB.");
|
|
466
465
|
if (!line.trim()) continue;
|
|
467
466
|
const event = decodeStructuralDiffEvent(line);
|
|
468
467
|
if (completed) throw new Error("diffr emitted data after completion.");
|
|
469
468
|
if (!started) {
|
|
470
469
|
if (event.type !== "start" || event.version !== 3) throw new Error("Unsupported diffr stream protocol.");
|
|
471
470
|
started = true;
|
|
471
|
+
clearTimeout(startup);
|
|
472
472
|
} else if (event.type === "complete") {
|
|
473
473
|
completed = true;
|
|
474
474
|
failed = event.failed;
|
|
@@ -484,7 +484,7 @@ async function* structuralDiff(input) {
|
|
|
484
484
|
const code = await exited;
|
|
485
485
|
if (code !== 0 && !(code === 2 && (failed > 0 || aborted !== void 0))) throw exitError(code);
|
|
486
486
|
} finally {
|
|
487
|
-
clearTimeout(
|
|
487
|
+
clearTimeout(startup);
|
|
488
488
|
lines.close();
|
|
489
489
|
if (child.exitCode === null) child.kill();
|
|
490
490
|
await exited.catch(() => {});
|
|
@@ -960,9 +960,9 @@ async function comparisonCoverage(data, reviewId, pins, mode, signal, publish) {
|
|
|
960
960
|
const fileSources = /* @__PURE__ */ new Map();
|
|
961
961
|
const alignments = /* @__PURE__ */ new Map();
|
|
962
962
|
const files = [];
|
|
963
|
-
|
|
963
|
+
for (const file of await data.changes(pins)) {
|
|
964
964
|
signal.throwIfAborted();
|
|
965
|
-
const patch = await data.changes(pins, file.path);
|
|
965
|
+
const patch = await data.changes(pins, file.path, file.previousPath);
|
|
966
966
|
const changed = emptyCoverage();
|
|
967
967
|
for (const hunk of parseUnifiedPatch(file.path, patch)) for (const line of hunk.lines) {
|
|
968
968
|
if (line.kind === "add") changed.head.push([line.newLine - 1, line.newLine]);
|
|
@@ -1001,80 +1001,72 @@ async function comparisonCoverage(data, reviewId, pins, mode, signal, publish) {
|
|
|
1001
1001
|
changed,
|
|
1002
1002
|
viewed: emptyCoverage()
|
|
1003
1003
|
});
|
|
1004
|
-
publish?.({
|
|
1004
|
+
if (mode === "textual") publish?.({
|
|
1005
|
+
counted: false,
|
|
1005
1006
|
files: [...files],
|
|
1006
1007
|
fileSources: new Map(fileSources),
|
|
1007
1008
|
alignments: new Map(alignments)
|
|
1008
1009
|
});
|
|
1009
1010
|
}
|
|
1010
|
-
|
|
1011
|
-
|
|
1012
|
-
|
|
1013
|
-
|
|
1014
|
-
|
|
1015
|
-
|
|
1016
|
-
|
|
1017
|
-
|
|
1018
|
-
|
|
1019
|
-
|
|
1020
|
-
|
|
1011
|
+
const coverage = {
|
|
1012
|
+
files,
|
|
1013
|
+
fileSources,
|
|
1014
|
+
alignments,
|
|
1015
|
+
counted: true
|
|
1016
|
+
};
|
|
1017
|
+
if (mode === "textual") return coverage;
|
|
1018
|
+
const publishCurrent = () => publish?.({
|
|
1019
|
+
...coverage,
|
|
1020
|
+
files: [...coverage.files]
|
|
1021
|
+
});
|
|
1022
|
+
publishCurrent();
|
|
1023
|
+
const baseFiles = new Map(coverage.files.map((file, index) => [file.previousPath ?? file.path, index]));
|
|
1024
|
+
const headFiles = new Map(coverage.files.map((file, index) => [file.path, index]));
|
|
1025
|
+
const remaining = /* @__PURE__ */ new Set();
|
|
1026
|
+
for await (const event of data.structuralChanges({
|
|
1027
|
+
reviewId,
|
|
1028
|
+
pins,
|
|
1029
|
+
signal
|
|
1030
|
+
})) {
|
|
1031
|
+
if (event.type === "start") {
|
|
1032
|
+
for (const entry of event.files) remaining.add((entry.file.rhs ?? entry.file.lhs).path);
|
|
1033
|
+
if (!remaining.size) break;
|
|
1034
|
+
continue;
|
|
1035
|
+
}
|
|
1036
|
+
if (event.type === "complete" && (event.failed || event.aborted)) throw new Error(event.aborted?.message ?? "Structural coverage is incomplete.");
|
|
1037
|
+
if (event.type !== "file") continue;
|
|
1038
|
+
const path = (event.file.rhs ?? event.file.lhs).path;
|
|
1039
|
+
if (!remaining.delete(path)) throw new Error(`Unexpected structural result: ${path}`);
|
|
1040
|
+
if (event.error) {
|
|
1041
|
+
if (event.error.code !== "unsupported_file_type" && event.error.code !== "not_utf8") throw new Error(`Cannot count ${path}: ${event.error.message}`);
|
|
1042
|
+
} else if (event.diff.type === "text") {
|
|
1043
|
+
const diff = event.diff;
|
|
1044
|
+
const folded = foldedChanges(diff);
|
|
1045
|
+
for (const side of ["base", "head"]) {
|
|
1046
|
+
const source = side === "base" ? event.file.lhs : event.file.rhs;
|
|
1047
|
+
const index = source && (side === "base" ? baseFiles : headFiles).get(source.path);
|
|
1048
|
+
if (index === void 0) continue;
|
|
1049
|
+
const file = coverage.files[index];
|
|
1050
|
+
const visible = subtractIntervals(diff.structural_changes[side], folded[side]);
|
|
1051
|
+
coverage.files[index] = {
|
|
1052
|
+
...file,
|
|
1053
|
+
folded: {
|
|
1054
|
+
...file.folded ?? emptyCoverage(),
|
|
1055
|
+
[side]: subtractIntervals(file.changed[side], visible)
|
|
1056
|
+
}
|
|
1057
|
+
};
|
|
1021
1058
|
}
|
|
1022
|
-
|
|
1023
|
-
|
|
1024
|
-
|
|
1025
|
-
|
|
1026
|
-
if (event.error) {
|
|
1027
|
-
if (event.error.code !== "unsupported_file_type") throw new Error(`Cannot count ${path}: ${event.error.message}`);
|
|
1028
|
-
if (!remaining.size) break;
|
|
1029
|
-
continue;
|
|
1059
|
+
const baseIndex = event.file.lhs && baseFiles.get(event.file.lhs.path);
|
|
1060
|
+
const index = (event.file.rhs && headFiles.get(event.file.rhs.path)) ?? baseIndex;
|
|
1061
|
+
if (index !== void 0) {
|
|
1062
|
+
if ((coverage.fileSources.get(coverage.files[index].path) ?? []).every((source) => source.file === (source.side === "base" ? event.file.lhs : event.file.rhs)?.path)) coverage.alignments = new Map(coverage.alignments).set(coverage.files[index].path, structuralRows(diff));
|
|
1030
1063
|
}
|
|
1031
|
-
|
|
1032
|
-
const previousPath = event.file.lhs?.path !== path ? event.file.lhs?.path : void 0;
|
|
1033
|
-
const base = diff.type === "text" ? diff.lhs?.text ?? null : null;
|
|
1034
|
-
const head = diff.type === "text" ? diff.rhs?.text ?? null : null;
|
|
1035
|
-
const fingerprint = hash([
|
|
1036
|
-
pins.repositoryId,
|
|
1037
|
-
base,
|
|
1038
|
-
head,
|
|
1039
|
-
...diff.type === "binary" ? [event.file.lhs?.oid ?? null, event.file.rhs?.oid ?? null] : []
|
|
1040
|
-
]);
|
|
1041
|
-
const sources = [];
|
|
1042
|
-
if (base !== null) sources.push({
|
|
1043
|
-
side: "base",
|
|
1044
|
-
file: event.file.lhs.path,
|
|
1045
|
-
fromLine: 1,
|
|
1046
|
-
toLine: base.split("\n").length
|
|
1047
|
-
});
|
|
1048
|
-
if (head !== null) sources.push({
|
|
1049
|
-
side: "head",
|
|
1050
|
-
file: path,
|
|
1051
|
-
fromLine: 1,
|
|
1052
|
-
toLine: head.split("\n").length
|
|
1053
|
-
});
|
|
1054
|
-
fileSources.set(path, sources);
|
|
1055
|
-
if (diff.type === "text") alignments.set(path, structuralRows(diff));
|
|
1056
|
-
files.push({
|
|
1057
|
-
path,
|
|
1058
|
-
previousPath,
|
|
1059
|
-
fingerprint,
|
|
1060
|
-
changed: diff.type === "text" ? diff.structural_changes : emptyCoverage(),
|
|
1061
|
-
folded: foldedChanges(diff),
|
|
1062
|
-
viewed: emptyCoverage()
|
|
1063
|
-
});
|
|
1064
|
-
publish?.({
|
|
1065
|
-
files: [...files],
|
|
1066
|
-
fileSources: new Map(fileSources),
|
|
1067
|
-
alignments: new Map(alignments)
|
|
1068
|
-
});
|
|
1069
|
-
if (!remaining.size) break;
|
|
1064
|
+
publishCurrent();
|
|
1070
1065
|
}
|
|
1071
|
-
if (remaining.size)
|
|
1066
|
+
if (!remaining.size) break;
|
|
1072
1067
|
}
|
|
1073
|
-
|
|
1074
|
-
|
|
1075
|
-
fileSources,
|
|
1076
|
-
alignments
|
|
1077
|
-
};
|
|
1068
|
+
if (remaining.size) throw new Error("Structural coverage is incomplete.");
|
|
1069
|
+
return coverage;
|
|
1078
1070
|
}
|
|
1079
1071
|
/**
|
|
1080
1072
|
* The changed lines diffr folds by default. A file it hides (lockfiles,
|
|
@@ -4221,6 +4213,7 @@ var LocalReviewData = class {
|
|
|
4221
4213
|
return {
|
|
4222
4214
|
pending: this.coveragePending(reviewId, pins, mode),
|
|
4223
4215
|
comparison: this.coverageCache.get(JSON.stringify([pins, mode])).partial ?? {
|
|
4216
|
+
counted: false,
|
|
4224
4217
|
files: [],
|
|
4225
4218
|
fileSources: /* @__PURE__ */ new Map(),
|
|
4226
4219
|
alignments: /* @__PURE__ */ new Map()
|
|
@@ -4272,10 +4265,11 @@ var LocalReviewData = class {
|
|
|
4272
4265
|
}
|
|
4273
4266
|
return entry.promise;
|
|
4274
4267
|
}
|
|
4275
|
-
async changes(pins, file) {
|
|
4268
|
+
async changes(pins, file, previousPath) {
|
|
4276
4269
|
if (file === void 0) return this.summaries(pins);
|
|
4277
4270
|
checkRelativePath(file);
|
|
4278
|
-
|
|
4271
|
+
if (previousPath) checkRelativePath(previousPath);
|
|
4272
|
+
return this.rawPatch(pins, { paths: previousPath ? [previousPath, file] : [file] });
|
|
4279
4273
|
}
|
|
4280
4274
|
async summaries(pins) {
|
|
4281
4275
|
if (pins.worktreeRevision) return diffFileSummariesWorkingTree(await this.worktreeInput(pins));
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { a as toolResultText, s as ReviewApiError } from "./agent-client-
|
|
1
|
+
import { a as toolResultText, s as ReviewApiError } from "./agent-client-B_b1GtUc.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-
|
|
4
|
-
import { i as publicTool, n as RECOVERY, r as callPublicTool, t as toolFailure } from "./tool-failure-
|
|
3
|
+
import { n as REVIEW_STATUS_TOOL, t as authoringTools } from "./authoring-tools-DvIO906l.js";
|
|
4
|
+
import { i as publicTool, n as RECOVERY, r as callPublicTool, t as toolFailure } from "./tool-failure-DJmTieh5.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";
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import { c as jsonString, m as isStringValue, n as isJsonObject, u as parseJsonText } from "./src-X9phtB2j.js";
|
|
2
|
-
import { a as sharedReviewId, c as verifyShareRepository, d as StreamLimitError, f as readBoundedStream, l as exportShare, m as shareIdSchema, n as ShareClient, p as parseShareLink, r as SharePreflightError, s as readShareRepository, t as ShareAuthError, u as validateShareSources } from "./client-
|
|
3
|
-
import { _ as invalidateStructuralComparisons, a as inspectSnapshot, c as askAgentIds, d as askQuestionSchema, f as AgentSelectionSchema, i as commandSchema, l as askChoiceKinds, p as selectionMarkdown, r as SCRATCHPAD_ID, s as applyAskChange, u as askPicksSchema, v as diffrExecutable, y as diffrMissingError } from "./local-data-
|
|
4
|
-
import { d as REVIEW_CLIENT_REMOTE, i as parseReviewVerbRequest, r as parseReviewDesktopVerbResult, u as REVIEW_CLIENT_HEADER, v as reviewDiffrSummarizerInputSchema, y as decodeStructuralDiffEvent } from "./src-
|
|
2
|
+
import { a as sharedReviewId, c as verifyShareRepository, d as StreamLimitError, f as readBoundedStream, l as exportShare, m as shareIdSchema, n as ShareClient, p as parseShareLink, r as SharePreflightError, s as readShareRepository, t as ShareAuthError, u as validateShareSources } from "./client-BFClfQLO.js";
|
|
3
|
+
import { _ as invalidateStructuralComparisons, a as inspectSnapshot, c as askAgentIds, d as askQuestionSchema, f as AgentSelectionSchema, i as commandSchema, l as askChoiceKinds, p as selectionMarkdown, r as SCRATCHPAD_ID, s as applyAskChange, u as askPicksSchema, v as diffrExecutable, y as diffrMissingError } from "./local-data-Bm84Xdck.js";
|
|
4
|
+
import { d as REVIEW_CLIENT_REMOTE, i as parseReviewVerbRequest, r as parseReviewDesktopVerbResult, u as REVIEW_CLIENT_HEADER, v as reviewDiffrSummarizerInputSchema, y as decodeStructuralDiffEvent } from "./src-WCbabvdS.js";
|
|
5
5
|
import { C as TraceStorageDeniedError, G as readStoreAuth, H as DEFAULT_STORE_ORIGIN, U as clearStoreAuth, W as openUrlInBrowser, _ as isTraceStorageConfigured, b as selectTraceStorage, o as listReviewTraceSessions, q as runStoreLogin, s as loadReviewAgentTrace, y as resolveTraceStorage } from "./review-agent-traces-DNJFYzc8.js";
|
|
6
|
-
import { $ as unionIntervals, G as selectionKey, H as comparisonKey, I as fileLineRangeSchema, J as coverageSources, N as lensSelections, Q as subtractIntervals, T as selectionReferences, U as formatAnchor, V as anchorSelection, W as resolveDiffSelection, Y as emptyCoverage, Z as scopedCoverage, h as elements, k as UNCATEGORIZED_LENS_ID, u as anchorPins } from "./stored-document-migration-
|
|
6
|
+
import { $ as unionIntervals, G as selectionKey, H as comparisonKey, I as fileLineRangeSchema, J as coverageSources, N as lensSelections, Q as subtractIntervals, T as selectionReferences, U as formatAnchor, V as anchorSelection, W as resolveDiffSelection, Y as emptyCoverage, Z as scopedCoverage, h as elements, k as UNCATEGORIZED_LENS_ID, u as anchorPins } from "./stored-document-migration-BxZWQQjv.js";
|
|
7
7
|
import { t as ReviewInputError } from "./input-error-OLgB_h31.js";
|
|
8
8
|
import { A as devReviewHome, h as TraceConfigurationError, i as isS3MockMode } from "./s3-config-CAxhO9u_.js";
|
|
9
9
|
import { t as errorMessage } from "./error-message-OtiDonty.js";
|
|
10
10
|
import { T as traceMachineEnabled } from "./review-home-paths-6zZH-1c9.js";
|
|
11
11
|
import { i as readReviewPackageVersion, n as readBuildCommit } from "./package-paths-B6-zxvIO.js";
|
|
12
|
-
import { a as REVIEW_APP_SESSION_ID_HEADER, c as sanitizeUiTelemetryEvent, i as BUNDLE_FRAME_PATTERN, l as cleanTelemetryText, r as reviewRequestOrigin, s as isReportableCleanedMessage } from "./request-origin-
|
|
13
|
-
import { a as scratchpadAvailable, c as readQuerySchemas, i as renderInstructions, o as inspectQuerySchema, r as instructionsQuerySchema, s as queryAnchor, t as authoringTools } from "./authoring-tools-
|
|
12
|
+
import { a as REVIEW_APP_SESSION_ID_HEADER, c as sanitizeUiTelemetryEvent, i as BUNDLE_FRAME_PATTERN, l as cleanTelemetryText, r as reviewRequestOrigin, s as isReportableCleanedMessage } from "./request-origin-DA4K1qWY.js";
|
|
13
|
+
import { a as scratchpadAvailable, c as readQuerySchemas, i as renderInstructions, o as inspectQuerySchema, r as instructionsQuerySchema, s as queryAnchor, t as authoringTools } from "./authoring-tools-DvIO906l.js";
|
|
14
14
|
import { t as fuzzyRank } from "./fuzzy-match-BoAmcyak.js";
|
|
15
15
|
import { createRequire } from "node:module";
|
|
16
16
|
import crypto$1, { createHash, randomUUID } from "node:crypto";
|
|
@@ -49,7 +49,7 @@ function diffrArgv(args) {
|
|
|
49
49
|
case "set": return [
|
|
50
50
|
"config",
|
|
51
51
|
"set",
|
|
52
|
-
"
|
|
52
|
+
"-",
|
|
53
53
|
"--json"
|
|
54
54
|
];
|
|
55
55
|
case "migrate": return [
|
|
@@ -2909,10 +2909,12 @@ async function reviewProgress(store, data, snapshot, signal = new AbortControlle
|
|
|
2909
2909
|
const marks = snapshot.shared ? /* @__PURE__ */ new Map() : store.viewedCoverage(snapshot.reviewId);
|
|
2910
2910
|
const pins = snapshot.pins ? (await data.resolveSource(snapshot)).pins : void 0;
|
|
2911
2911
|
const comparison = pins ? partial ?? await data.coverage(snapshot.reviewId, pins, mode) : {
|
|
2912
|
+
counted: true,
|
|
2912
2913
|
files: [],
|
|
2913
2914
|
fileSources: /* @__PURE__ */ new Map(),
|
|
2914
2915
|
alignments: /* @__PURE__ */ new Map()
|
|
2915
2916
|
};
|
|
2917
|
+
const counting = !comparison.counted;
|
|
2916
2918
|
signal.throwIfAborted();
|
|
2917
2919
|
const documentKey = JSON.stringify(pins);
|
|
2918
2920
|
const comparisons = /* @__PURE__ */ new Map();
|
|
@@ -2922,7 +2924,8 @@ async function reviewProgress(store, data, snapshot, signal = new AbortControlle
|
|
|
2922
2924
|
let loading = comparisons.get(key);
|
|
2923
2925
|
if (loading) return loading;
|
|
2924
2926
|
if (partial) {
|
|
2925
|
-
|
|
2927
|
+
const state = data.coverageSnapshot(snapshot.reviewId, own, mode);
|
|
2928
|
+
if (state.pending) return state.comparison.counted ? Promise.resolve(state.comparison) : void 0;
|
|
2926
2929
|
}
|
|
2927
2930
|
loading = data.coverage(snapshot.reviewId, own, mode);
|
|
2928
2931
|
comparisons.set(key, loading);
|
|
@@ -2962,7 +2965,7 @@ async function reviewProgress(store, data, snapshot, signal = new AbortControlle
|
|
|
2962
2965
|
if (file) group[file.path] ??= withViewed(file);
|
|
2963
2966
|
}
|
|
2964
2967
|
let rows = file && ownAlignments.get(file.path);
|
|
2965
|
-
if (!file &&
|
|
2968
|
+
if (!file && counting && !own) {
|
|
2966
2969
|
pendingSources.add(key);
|
|
2967
2970
|
return [];
|
|
2968
2971
|
}
|
|
@@ -2995,8 +2998,8 @@ async function reviewProgress(store, data, snapshot, signal = new AbortControlle
|
|
|
2995
2998
|
return {
|
|
2996
2999
|
...lens,
|
|
2997
3000
|
...resolved,
|
|
2998
|
-
pending:
|
|
2999
|
-
unavailable:
|
|
3001
|
+
pending: counting,
|
|
3002
|
+
unavailable: counting || resolved.fileCount ? void 0 : "No files match these targets"
|
|
3000
3003
|
};
|
|
3001
3004
|
} catch {
|
|
3002
3005
|
return {
|
|
@@ -3011,18 +3014,18 @@ async function reviewProgress(store, data, snapshot, signal = new AbortControlle
|
|
|
3011
3014
|
await resolveAvailable(source);
|
|
3012
3015
|
} catch {}
|
|
3013
3016
|
}));
|
|
3014
|
-
const uncategorized =
|
|
3017
|
+
const uncategorized = counting ? [] : uncategorizedSources(files, lenses.filter((lens) => !lens.unavailable).flatMap((lens) => lens.sources));
|
|
3015
3018
|
lenses.push({
|
|
3016
3019
|
id: UNCATEGORIZED_LENS_ID,
|
|
3017
3020
|
title: "Uncategorized changes",
|
|
3018
3021
|
sources: uncategorized,
|
|
3019
3022
|
wholeFiles: false,
|
|
3020
3023
|
fileCount: new Set(uncategorized.map((source) => files.find((file) => source.file === (source.side === "base" ? file.previousPath ?? file.path : file.path))?.path ?? source.file)).size,
|
|
3021
|
-
pending:
|
|
3022
|
-
unavailable:
|
|
3024
|
+
pending: counting,
|
|
3025
|
+
unavailable: counting || uncategorized.length ? void 0 : "All changed lines are covered by lenses"
|
|
3023
3026
|
});
|
|
3024
3027
|
const progress = {
|
|
3025
|
-
complete: !
|
|
3028
|
+
complete: !counting,
|
|
3026
3029
|
files,
|
|
3027
3030
|
referenceFiles,
|
|
3028
3031
|
lenses,
|
|
@@ -3294,7 +3297,10 @@ function createReviewApi(store, data, open, shared, capabilities = () => ({
|
|
|
3294
3297
|
const input = progressUpdateSchema.parse(await readBoundedRequestJson(context.req.raw));
|
|
3295
3298
|
const id = context.req.param("id");
|
|
3296
3299
|
const snapshot = store.read(id);
|
|
3297
|
-
const
|
|
3300
|
+
const pins = snapshot.pins ? (await data.resolveSource(snapshot)).pins : void 0;
|
|
3301
|
+
const coverage = pins && data.coverageSnapshot(id, pins, input.mode);
|
|
3302
|
+
const partial = coverage && coverage.pending ? coverage.comparison : void 0;
|
|
3303
|
+
const progress = await reviewProgress(store, data, snapshot, context.req.raw.signal, input.mode, partial);
|
|
3298
3304
|
const files = input.files.map((update) => {
|
|
3299
3305
|
const file = progress.files.find((file) => file.path === update.path);
|
|
3300
3306
|
if (!file || file.fingerprint !== update.fingerprint) throw new ReviewInputError("This file changed. Reload before marking it viewed.", 409);
|
|
@@ -3306,7 +3312,7 @@ function createReviewApi(store, data, open, shared, capabilities = () => ({
|
|
|
3306
3312
|
});
|
|
3307
3313
|
if (store.read(id).version !== snapshot.version) throw new ReviewInputError("Review changed during this update. Try again.", 409);
|
|
3308
3314
|
store.updateViewedCoverage(id, files, input.viewed);
|
|
3309
|
-
return context.json(await reviewProgress(store, data, store.read(id, input.version), context.req.raw.signal, input.mode));
|
|
3315
|
+
return context.json(await reviewProgress(store, data, store.read(id, input.version), context.req.raw.signal, input.mode, partial));
|
|
3310
3316
|
});
|
|
3311
3317
|
app.get("/:id/lenses", async (context) => {
|
|
3312
3318
|
if (!data) throw new ReviewInputError("Source data is unavailable.", 409);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { o as initializeReviewStoreSchema, t as openLocalReviewStore } from "./local-data-
|
|
1
|
+
import { o as initializeReviewStoreSchema, t as openLocalReviewStore } from "./local-data-Bm84Xdck.js";
|
|
2
2
|
import { O as withFileLock } from "./s3-config-CAxhO9u_.js";
|
|
3
3
|
import "./review-home-paths-6zZH-1c9.js";
|
|
4
4
|
import { access, mkdir } from "node:fs/promises";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { a as jsonNumber, c as jsonString, i as jsonBoolean, n as isJsonObject } from "./src-X9phtB2j.js";
|
|
2
|
-
import { f as REVIEW_DIFF_LAYOUTS, p as REVIEW_THEME_CHOICES } from "./src-
|
|
2
|
+
import { f as REVIEW_DIFF_LAYOUTS, p as REVIEW_THEME_CHOICES } from "./src-WCbabvdS.js";
|
|
3
3
|
import { z } from "zod";
|
|
4
4
|
//#region src/telemetry-clean-text.ts
|
|
5
5
|
const USER_DATA_REGEXES = [
|
|
@@ -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-
|
|
2
|
+
import "./src-WCbabvdS.js";
|
|
3
3
|
import { A as devReviewHome, D as processIsAlive, M as writeFileAtomic, O as withFileLock } from "./s3-config-CAxhO9u_.js";
|
|
4
4
|
import "./review-home-paths-6zZH-1c9.js";
|
|
5
5
|
import { i as readReviewPackageVersion, t as findReviewPackageRoot } from "./package-paths-B6-zxvIO.js";
|
|
6
|
-
import "./request-origin-
|
|
6
|
+
import "./request-origin-DA4K1qWY.js";
|
|
7
7
|
import { createHmac, randomUUID } from "node:crypto";
|
|
8
8
|
import { z } from "zod";
|
|
9
9
|
import { existsSync, readFileSync, rmSync } from "node:fs";
|