@dev.fast/whiteboard 0.3.5-preview.20261022.134 → 0.3.5-preview.20261023.136
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/{agent-cli-DpSj5jCW.js → agent-cli-CHNDd4Ga.js} +1 -1
- package/dist/agent-cli-Cn4-16XA.js +2 -0
- package/dist/{authoring-tools-BBksBplC.js → authoring-tools-D8EkIDjm.js} +2 -2
- package/dist/build-info.json +1 -1
- package/dist/{cli-runner-D1PRTICL.js → cli-runner-DFBaVGij.js} +4 -4
- package/dist/cli.js +1 -1
- package/dist/{client-CiB4MRlo.js → client-p9WB8Sj0.js} +3 -1
- package/dist/{headless-host-D9y2sBIj.js → headless-host-DJhcab6r.js} +84 -29
- package/dist/{headless-host-Ck5-JjGV.js → headless-host-dwlqhqMY.js} +1 -1
- package/dist/{local-data-m4BCbtSA.js → local-data-DHedfhxw.js} +173 -38
- package/dist/{mcp-IkZ0jBxU.js → mcp-Br-r_wwR.js} +1 -1
- package/dist/profile-BopGMZUh.js +2 -0
- package/dist/{profile-BfvRNmRc.js → profile-D9wdlPgw.js} +1 -1
- package/dist/server/desktop-host.js +5 -5
- package/dist/sharing/index.d.ts +32 -2
- package/dist/sharing/index.js +1 -1
- package/dist/{stored-document-migration-B-lTO-_P.js → stored-document-migration-DEt8iwem.js} +11 -4
- package/package.json +3 -3
- package/src/github-pr-graph.ts +97 -0
- package/src/review-api/http.ts +38 -24
- package/src/review-api/local-data.ts +101 -10
- package/src/review-api/origin.ts +13 -5
- package/src/review-api/store.ts +222 -59
- package/src/review-stack.ts +125 -22
- package/src/sharing/import.ts +2 -0
- package/dist/agent-cli-a7X9Th1U.js +0 -2
- package/dist/profile-BfY9lECc.js +0 -2
|
@@ -44,7 +44,7 @@ async function runReviewAgentCli(input) {
|
|
|
44
44
|
[REVIEW_THREAD_HEADER, thread ?? ""]
|
|
45
45
|
]);
|
|
46
46
|
if (mode === "mcp") {
|
|
47
|
-
const { serveReviewMcp } = await import("./mcp-
|
|
47
|
+
const { serveReviewMcp } = await import("./mcp-Br-r_wwR.js");
|
|
48
48
|
exitOnInstallUpdate(input.stderr);
|
|
49
49
|
await serveReviewMcp(async (key, agentKind) => {
|
|
50
50
|
const connected = await connectReviewInstance(key ? {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { n as isJsonObject } from "./src-X9phtB2j.js";
|
|
2
|
-
import { c as activityBeginSchema, l as activityEndSchema, n as uploadSchema, r as commandSchema, u as activityUpdateSchema } from "./local-data-
|
|
3
|
-
import {
|
|
2
|
+
import { c as activityBeginSchema, l as activityEndSchema, n as uploadSchema, r as commandSchema, u as activityUpdateSchema } from "./local-data-DHedfhxw.js";
|
|
3
|
+
import { L as publishedEditSchema, N as pathTargetSchema } from "./stored-document-migration-DEt8iwem.js";
|
|
4
4
|
import { t as ReviewInputError } from "./input-error-OLgB_h31.js";
|
|
5
5
|
import { t as findReviewPackageRoot } from "./package-paths-BeYHYjeR.js";
|
|
6
6
|
import { z } from "zod";
|
package/dist/build-info.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":"0.3.5-preview.
|
|
1
|
+
{"version":"0.3.5-preview.20261023.136","commit":"3fb855e33dc96595fdae83b3d4532e7a3fbeee58","dirty":true,"builtAt":"2026-10-23T16:53:05.685Z"}
|
|
@@ -13,7 +13,7 @@ import { t as ReviewTelemetry } from "./review-telemetry-BM-_KdLi.js";
|
|
|
13
13
|
import { t as fuzzyRank } from "./fuzzy-match-CfSxqzBF.js";
|
|
14
14
|
import { _ as isInstallTarget, a as isOwnedShim, f as windowsInstallerCommand, g as ALL_INSTALL_TARGETS, h as detectConnectAgents, m as connectAgent, o as pathShimPath, p as scanLegacySkills, t as aliasInstallationToAccount, v as connectPrompts } from "./account-alias-2yTAxoBx.js";
|
|
15
15
|
import { n as focusReviewDesktop, r as runReviewAppLaunch } from "./review-app-launcher-BZAnR8Vp.js";
|
|
16
|
-
import { t as reviewAgentCliHelp } from "./agent-cli-
|
|
16
|
+
import { t as reviewAgentCliHelp } from "./agent-cli-CHNDd4Ga.js";
|
|
17
17
|
import { existsSync, mkdirSync, renameSync, writeFileSync } from "node:fs";
|
|
18
18
|
import { realpath } from "node:fs/promises";
|
|
19
19
|
import path from "node:path";
|
|
@@ -4356,7 +4356,7 @@ async function runReviewCli(input) {
|
|
|
4356
4356
|
process.once("SIGINT", stop);
|
|
4357
4357
|
process.once("SIGTERM", stop);
|
|
4358
4358
|
process.once(DESKTOP_TAKEOVER_SIGNAL, takeover);
|
|
4359
|
-
const { HeadlessServerBusyError, runHeadlessServer } = await import("./headless-host-
|
|
4359
|
+
const { HeadlessServerBusyError, runHeadlessServer } = await import("./headless-host-dwlqhqMY.js");
|
|
4360
4360
|
try {
|
|
4361
4361
|
await runHeadlessServer({
|
|
4362
4362
|
stateDir,
|
|
@@ -4421,7 +4421,7 @@ async function runReviewCli(input) {
|
|
|
4421
4421
|
if (!existsSync(path.join(stateDir, "review-api.db"))) throw new Error(`No saved reviews in ${stateDir}, so there is no server id to reset. Check --state-dir.`);
|
|
4422
4422
|
const inUse = `A Whiteboard server is using ${stateDir}. Stop it first, then run whiteboard server reset-id again.`;
|
|
4423
4423
|
if (await desktopUsesHome(stateDir, env)) return refuse(inUse, options.json);
|
|
4424
|
-
const [{ openReviewProfile }, { withHeadlessServerLock }] = await Promise.all([import("./profile-
|
|
4424
|
+
const [{ openReviewProfile }, { withHeadlessServerLock }] = await Promise.all([import("./profile-BopGMZUh.js"), import("./headless-host-dwlqhqMY.js")]);
|
|
4425
4425
|
const reset = await withHeadlessServerLock(await realpath(stateDir), async () => {
|
|
4426
4426
|
const local = await openReviewProfile(stateDir, { manageWorkspaces: false });
|
|
4427
4427
|
try {
|
|
@@ -4795,7 +4795,7 @@ async function runReviewCli(input) {
|
|
|
4795
4795
|
return commands;
|
|
4796
4796
|
} });
|
|
4797
4797
|
for (const [name, description] of [["api", "Call a JSON review authoring tool on the running server"], ["mcp", "Serve the JSON review authoring tools over stdio MCP"]]) configureOutput(program.command(name).description(description).argument("[args...]", "tool name and JSON input").allowUnknownOption().allowExcessArguments().helpOption(false).passThroughOptions().addHelpText("after", `\n${reviewAgentCliHelp}`), "plain").action(async (args) => {
|
|
4798
|
-
const { runReviewAgentCli } = await import("./agent-cli-
|
|
4798
|
+
const { runReviewAgentCli } = await import("./agent-cli-Cn4-16XA.js");
|
|
4799
4799
|
state.exitCode = await runReviewAgentCli({
|
|
4800
4800
|
...input,
|
|
4801
4801
|
env: authoringEnv(),
|
package/dist/cli.js
CHANGED
|
@@ -2,7 +2,7 @@ import { f as gitAt } from "./src-X9ZebeOD.js";
|
|
|
2
2
|
import { n as isJsonObject, u as parseJsonText } from "./src-X9phtB2j.js";
|
|
3
3
|
import "./src-DYHVzX3b.js";
|
|
4
4
|
import { f as sourceAnchors } from "./lens-selection-9byzEgvU.js";
|
|
5
|
-
import {
|
|
5
|
+
import { B as resourceReferences, D as boardRepositoryId, I as pinsSchema, J as checkReferences, K as sourceReferences, R as readsAtBoardPins, S as anchorPins, b as textIncludesQuote, c as traceSchema, et as lensSchema, j as elements, k as documentSchema, lt as parseMarkdown, n as migrateStoredDocument, r as migrateStoredLenses, s as softwareModelDataSchema, st as markdownNodes, t as liftFileLenses, tt as lensSelections, u as pullRequestUrl, z as resourceReference } from "./stored-document-migration-DEt8iwem.js";
|
|
6
6
|
import { t as ReviewInputError } from "./input-error-OLgB_h31.js";
|
|
7
7
|
import { createHash, randomUUID } from "node:crypto";
|
|
8
8
|
import { z } from "zod";
|
|
@@ -483,9 +483,11 @@ const sharedSnapshotSchema = z.strictObject({
|
|
|
483
483
|
origin: z.strictObject({
|
|
484
484
|
branch: z.string().optional(),
|
|
485
485
|
baseRef: z.string().optional(),
|
|
486
|
+
baseBranch: z.string().optional(),
|
|
486
487
|
pullRequestNumber: z.number().int().positive().optional(),
|
|
487
488
|
pullRequestUrl: pullRequestUrl.optional(),
|
|
488
489
|
pullRequestTitle: z.string().optional(),
|
|
490
|
+
pullRequestBaseBranch: z.string().optional(),
|
|
489
491
|
revision: z.string().optional()
|
|
490
492
|
}).optional()
|
|
491
493
|
});
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { b as resolveRepoContext, d as git, r as defaultBranch, w as runVcs } from "./src-X9ZebeOD.js";
|
|
2
2
|
import { c as jsonString, m as isStringValue, n as isJsonObject, p as isObjectValue, u as parseJsonText } from "./src-X9phtB2j.js";
|
|
3
|
-
import { a as sharedReviewId, c as verifyShareRepository, d as validateShareSources, f as StreamLimitError, h as shareIdSchema, l as exportShare, m as parseShareLink, n as ShareClient, p as readBoundedStream, r as SharePreflightError, s as readShareRepository, t as ShareAuthError, u as referenceCommits } from "./client-
|
|
4
|
-
import { d as textualRows, f as invalidateStructuralComparisons, i as inspectSnapshot, m as diffrMissingError, p as diffrExecutable, r as commandSchema } from "./local-data-
|
|
3
|
+
import { a as sharedReviewId, c as verifyShareRepository, d as validateShareSources, f as StreamLimitError, h as shareIdSchema, l as exportShare, m as parseShareLink, n as ShareClient, p as readBoundedStream, r as SharePreflightError, s as readShareRepository, t as ShareAuthError, u as referenceCommits } from "./client-p9WB8Sj0.js";
|
|
4
|
+
import { d as textualRows, f as invalidateStructuralComparisons, h as readGitHubPullRequests, i as inspectSnapshot, m as diffrMissingError, p as diffrExecutable, r as commandSchema } from "./local-data-DHedfhxw.js";
|
|
5
5
|
import { N as reviewDiffrSummarizerInputSchema, O as ReviewFeedbackContactSchema, P as decodeStructuralDiffEvent, a as parseReviewVerbRequest, c as boardIconKind, i as parseReviewDesktopVerbResult, j as ReviewOnboardingRunRequestSchema, k as ReviewFeedbackSchema, l as boardTitle, m as REVIEW_CLIENT_REMOTE, p as REVIEW_CLIENT_HEADER, y as REVIEW_HOST_HEADER } from "./src-DYHVzX3b.js";
|
|
6
6
|
import { $ as runStoreLogin, M as selectTraceStorage, N as TraceStorageDeniedError, Q as readStoreAuth, X as DEFAULT_STORE_ORIGIN, Z as clearStoreAuth, b as listReviewTraceSessions, j as resolveTraceStorage, k as isTraceStorageConfigured, q as shellQuote, v as traceMachineEnabled, x as loadReviewAgentTrace } from "./src-Z1x4-Qmb.js";
|
|
7
7
|
import { _ as scopedCoverage, h as emptyCoverage, i as anchorSelection, l as resolveDiffSelection, m as coverageSources, n as SelectionUnavailableError, o as comparisonKey, s as formatAnchor, u as selectionKey, v as subtractIntervals, y as unionIntervals } from "./lens-selection-9byzEgvU.js";
|
|
8
|
-
import {
|
|
8
|
+
import { D as boardRepositoryId, E as boardLinks, G as selectionReferences, S as anchorPins, X as stepSources, Z as UNCATEGORIZED_LENS_ID, f as sourceBranchName, it as fileLineRangeSchema, j as elements, l as pullRequestKey, p as pullRequestProvider, tt as lensSelections } from "./stored-document-migration-DEt8iwem.js";
|
|
9
9
|
import { t as ReviewInputError } from "./input-error-OLgB_h31.js";
|
|
10
10
|
import { A as processStartIdentity, L as writePrivateJsonAtomic, N as devReviewHome, h as TraceConfigurationError, i as isS3MockMode, j as withFileLock } from "./s3-config-CjcLyFV5.js";
|
|
11
11
|
import { t as errorMessage } from "./error-message-OtiDonty.js";
|
|
@@ -13,10 +13,10 @@ import { i as readReviewPackageVersion, n as readBuildCommit, t as findReviewPac
|
|
|
13
13
|
import "./review-home-paths-CG-sb9Cw.js";
|
|
14
14
|
import { _ as reviewInstanceIdentity, n as desktopOwnsHome, o as reviewServerDiscoveryPath, p as desktopUsesHome, r as headlessServerLockPath, t as DESKTOP_TAKEOVER_SIGNAL } from "./server-discovery-DKLIOgg3.js";
|
|
15
15
|
import { c as askPicksSchema, d as selectionMarkdown, l as askQuestionSchema, n as askAgentIds, r as askChoiceKinds, s as askPermissionsSchema, t as applyAskChange, u as AgentSelectionSchema } from "./thread-state-CO97FUqK.js";
|
|
16
|
-
import { t as openReviewProfile } from "./profile-
|
|
16
|
+
import { t as openReviewProfile } from "./profile-D9wdlPgw.js";
|
|
17
17
|
import { c as REVIEW_APP_SESSION_ID_HEADER, d as sanitizeUiTelemetryEvent, f as cleanTelemetryText, o as reviewRequestOrigin, r as REVIEW_PERSON_HEADER, s as BUNDLE_FRAME_PATTERN, t as ASK_THREAD_ENV, u as isReportableCleanedMessage } from "./request-origin-CNSLVn7x.js";
|
|
18
18
|
import { a as defaultAskPermissions, i as askAgents, l as launchAskAgent, n as askAgentSettings, o as detectAskAgents, r as askAgentTakesMcp, t as fuzzyRank } from "./fuzzy-match-CfSxqzBF.js";
|
|
19
|
-
import { a as inspectQuerySchema, i as renderInstructions, o as queryAnchor, r as instructionsQuerySchema, s as readQuerySchemas, t as authoringTools } from "./authoring-tools-
|
|
19
|
+
import { a as inspectQuerySchema, i as renderInstructions, o as queryAnchor, r as instructionsQuerySchema, s as readQuerySchemas, t as authoringTools } from "./authoring-tools-D8EkIDjm.js";
|
|
20
20
|
import { a as headlessServerOwner, c as stopBackgroundServer, o as recordedBackgroundServer } from "./background-server-DHWHzpo5.js";
|
|
21
21
|
import crypto$1, { createHash, randomBytes, randomUUID } from "node:crypto";
|
|
22
22
|
import { z } from "zod";
|
|
@@ -2618,9 +2618,20 @@ const GitHubStacksSchema = z.array(z.object({ pull_requests: z.array(z.object({
|
|
|
2618
2618
|
number: z.number().int().positive(),
|
|
2619
2619
|
head: z.object({ ref: z.string().min(1) })
|
|
2620
2620
|
})) }));
|
|
2621
|
+
/** The branch a review sits on: its PR's target, else the base it names. */
|
|
2622
|
+
const baseOf = (review) => sourceBranchName(review?.origin?.pullRequestBaseBranch ?? review?.origin?.baseBranch);
|
|
2623
|
+
/** A GitHub PR URL's host, owner/repo slug and number; else undefined. */
|
|
2624
|
+
function gitHubPullRequest(url) {
|
|
2625
|
+
const resolution = url ? pullRequestProvider(url) : void 0;
|
|
2626
|
+
return resolution?.provider.id === "github" ? resolution.address : void 0;
|
|
2627
|
+
}
|
|
2621
2628
|
/** The review's GitHub stack, else the chain of reviews through its base. */
|
|
2622
2629
|
async function resolveReviewStackLayers(subject, reviews, options = {}) {
|
|
2623
2630
|
let entries = await gitHubStack(subject, reviews, options.runGitHubApi ?? defaultRunGitHubApi);
|
|
2631
|
+
if (entries.length < 2) {
|
|
2632
|
+
const discovered = await inferredGitHubStack(subject, reviews, options.runGitHubApi ?? defaultRunGitHubApi).catch(() => []);
|
|
2633
|
+
if (discovered.length > 1) entries = discovered;
|
|
2634
|
+
}
|
|
2624
2635
|
if (!entries.length && options.repositoryPath) entries = await localStack(subject, reviews, options.repositoryPath);
|
|
2625
2636
|
const currentIndex = entries.findIndex((entry) => entry.current);
|
|
2626
2637
|
return entries.map((entry, index) => {
|
|
@@ -2659,14 +2670,13 @@ function readGitHubStacks(runGitHubApi, host, repository, pullRequestNumber) {
|
|
|
2659
2670
|
return read.stacks;
|
|
2660
2671
|
}
|
|
2661
2672
|
async function gitHubStack(subject, reviews, runGitHubApi) {
|
|
2662
|
-
const binding = subject.origin?.pullRequestUrl
|
|
2673
|
+
const binding = gitHubPullRequest(subject.origin?.pullRequestUrl);
|
|
2663
2674
|
if (!binding) return [];
|
|
2664
|
-
const
|
|
2665
|
-
const
|
|
2666
|
-
const repoKey = `https://${host}/${owner}/${repository}`;
|
|
2675
|
+
const { host, slug, number: pullRequestNumber } = binding;
|
|
2676
|
+
const repoKey = `https://${host}/${slug}`;
|
|
2667
2677
|
let stacks;
|
|
2668
2678
|
try {
|
|
2669
|
-
stacks = await readGitHubStacks(runGitHubApi, host,
|
|
2679
|
+
stacks = await readGitHubStacks(runGitHubApi, host, slug, pullRequestNumber);
|
|
2670
2680
|
} catch {
|
|
2671
2681
|
return [];
|
|
2672
2682
|
}
|
|
@@ -2680,21 +2690,61 @@ async function gitHubStack(subject, reviews, runGitHubApi) {
|
|
|
2680
2690
|
reviews: reviews.filter((candidate) => (candidate.origin?.pullRequestUrl?.replace(/\/pull\/\d+.*$/, "") ?? candidate.pins?.repositoryId) === repoKey && candidate.origin?.pullRequestNumber === pr.number)
|
|
2681
2691
|
}));
|
|
2682
2692
|
}
|
|
2693
|
+
/** A stack inferred from open PRs whose bases chain through this one's, for
|
|
2694
|
+
* repositories without GitHub stacks. Whiteboards only annotate the result. */
|
|
2695
|
+
async function inferredGitHubStack(subject, reviews, run) {
|
|
2696
|
+
const binding = gitHubPullRequest(subject.origin?.pullRequestUrl);
|
|
2697
|
+
if (!binding) return [];
|
|
2698
|
+
const graph = await readGitHubPullRequests(binding.host, binding.slug, run);
|
|
2699
|
+
const current = graph.find((pr) => pr.number === binding.number);
|
|
2700
|
+
if (!current) return [];
|
|
2701
|
+
const chain = [current];
|
|
2702
|
+
const seen = /* @__PURE__ */ new Set([current.headBranch]);
|
|
2703
|
+
const extend = (direction) => {
|
|
2704
|
+
let end = current;
|
|
2705
|
+
for (;;) {
|
|
2706
|
+
const matches = graph.filter((pr) => direction === "base" ? pr.headBranch === end.baseBranch : pr.baseBranch === end.headBranch);
|
|
2707
|
+
if (matches.length !== 1 || seen.has(matches[0].headBranch)) return;
|
|
2708
|
+
end = matches[0];
|
|
2709
|
+
seen.add(end.headBranch);
|
|
2710
|
+
if (direction === "base") chain.unshift(end);
|
|
2711
|
+
else chain.push(end);
|
|
2712
|
+
}
|
|
2713
|
+
};
|
|
2714
|
+
extend("base");
|
|
2715
|
+
extend("head");
|
|
2716
|
+
if (chain.length < 2) return [];
|
|
2717
|
+
const project = reviews.find((review) => review.reviewId === subject.reviewId)?.project?.id;
|
|
2718
|
+
return chain.map((pr) => ({
|
|
2719
|
+
branch: pr.headBranch,
|
|
2720
|
+
pullRequestNumber: pr.number,
|
|
2721
|
+
pullRequestUrl: pr.url,
|
|
2722
|
+
base: null,
|
|
2723
|
+
subject: pr.title,
|
|
2724
|
+
current: pr.number === current.number,
|
|
2725
|
+
reviews: reviews.filter((review) => {
|
|
2726
|
+
const candidateUrl = review.origin?.pullRequestUrl;
|
|
2727
|
+
if (candidateUrl) return pullRequestKey(candidateUrl) === pullRequestKey(pr.url);
|
|
2728
|
+
return (subject.pins?.repositoryId ? review.pins?.repositoryId === subject.pins.repositoryId : Boolean(project && review.project?.id === project)) && sourceBranchName(review.origin?.branch) === pr.headBranch;
|
|
2729
|
+
})
|
|
2730
|
+
}));
|
|
2731
|
+
}
|
|
2683
2732
|
/** The chain of reviews through this one, linked by the base each names. */
|
|
2684
2733
|
async function localStack(subject, reviews, repositoryPath) {
|
|
2685
2734
|
const group = reviews.find((review) => review.reviewId === subject.reviewId)?.project?.id;
|
|
2686
|
-
const current = subject.origin?.branch;
|
|
2735
|
+
const current = sourceBranchName(subject.origin?.branch);
|
|
2736
|
+
const currentBase = baseOf(subject);
|
|
2687
2737
|
if (!group || !current) return [];
|
|
2688
|
-
const main =
|
|
2689
|
-
const name = (ref) => ref.replace(/^origin\//, "");
|
|
2738
|
+
const main = currentBase ? await defaultBranch(repositoryPath).catch(() => null) : null;
|
|
2690
2739
|
const inGroup = reviews.filter((review) => review.project?.id === group);
|
|
2740
|
+
const branchOf = (review) => sourceBranchName(review?.origin?.branch);
|
|
2691
2741
|
const latest = (field, branch) => {
|
|
2692
|
-
const matches = inGroup.filter((review) =>
|
|
2742
|
+
const matches = inGroup.filter((review) => (field === "branch" ? branchOf(review) : baseOf(review)) === branch);
|
|
2693
2743
|
return matches.findLast((review) => !review.trashedAt) ?? matches.at(-1);
|
|
2694
2744
|
};
|
|
2695
2745
|
const branches = [current];
|
|
2696
|
-
for (let base =
|
|
2697
|
-
for (let child = latest("baseBranch", current)
|
|
2746
|
+
for (let base = currentBase; base && base !== (main && sourceBranchName(main.ref)) && !branches.includes(base); base = baseOf(latest("branch", base))) branches.unshift(base);
|
|
2747
|
+
for (let child = branchOf(latest("baseBranch", current)); child && !branches.includes(child); child = branchOf(latest("baseBranch", child))) branches.push(child);
|
|
2698
2748
|
const bottom = branches[0];
|
|
2699
2749
|
const start = latest("branch", bottom) || !main ? null : await forkPoint(repositoryPath, main.commit, bottom);
|
|
2700
2750
|
if (!latest("branch", bottom) && !start) branches.shift();
|
|
@@ -2706,7 +2756,7 @@ async function localStack(subject, reviews, repositoryPath) {
|
|
|
2706
2756
|
base: branch === bottom && start?.base || null,
|
|
2707
2757
|
subject: branch === bottom && start?.subject || null,
|
|
2708
2758
|
current: branch === current,
|
|
2709
|
-
reviews: inGroup.filter((review) => review
|
|
2759
|
+
reviews: inGroup.filter((review) => branchOf(review) === branch)
|
|
2710
2760
|
}));
|
|
2711
2761
|
}
|
|
2712
2762
|
/** Where a local branch left `main`, and its oldest commit's subject. */
|
|
@@ -3784,8 +3834,15 @@ function createReviewApi(store, data, open, shared, capabilities = () => ({
|
|
|
3784
3834
|
return JSON.stringify([...outgoing, ...backlinks].map((link) => link.pullRequestUrl && data.pullRequestState(link.pullRequestUrl, { seen: false })));
|
|
3785
3835
|
};
|
|
3786
3836
|
const linksKeys = new Map([...reviewIds].map((reviewId) => [reviewId, linksKey(reviewId)]));
|
|
3787
|
-
const
|
|
3788
|
-
|
|
3837
|
+
const placeKey = (id) => {
|
|
3838
|
+
const project = !isShared(id) && store.summary(id)?.project;
|
|
3839
|
+
const branches = project ? store.listProject(project.id).filter(({ origin }) => origin?.branch).map(({ reviewId, origin, trashedAt }) => [
|
|
3840
|
+
reviewId,
|
|
3841
|
+
origin,
|
|
3842
|
+
trashedAt
|
|
3843
|
+
]) : [];
|
|
3844
|
+
return createHash("sha1").update(JSON.stringify([placeOf(id), branches])).digest().readUInt32BE(0);
|
|
3845
|
+
};
|
|
3789
3846
|
const placeKeys = new Map([...reviewIds].map((reviewId) => [reviewId, placeKey(reviewId)]));
|
|
3790
3847
|
const readReviewLine = (reviewId) => {
|
|
3791
3848
|
try {
|
|
@@ -3797,7 +3854,7 @@ function createReviewApi(store, data, open, shared, capabilities = () => ({
|
|
|
3797
3854
|
activity: store.activity.read(reviewId),
|
|
3798
3855
|
coverageRevision: data?.coverageRevision ?? 0,
|
|
3799
3856
|
linksRevision: linksRevision.get(reviewId) ?? 0,
|
|
3800
|
-
placeRevision:
|
|
3857
|
+
placeRevision: placeKeys.get(reviewId)
|
|
3801
3858
|
}
|
|
3802
3859
|
};
|
|
3803
3860
|
} catch (error) {
|
|
@@ -3836,7 +3893,6 @@ function createReviewApi(store, data, open, shared, capabilities = () => ({
|
|
|
3836
3893
|
const next = placeKey(id);
|
|
3837
3894
|
if (next === key) continue;
|
|
3838
3895
|
placeKeys.set(id, next);
|
|
3839
|
-
placeRevision.set(id, (placeRevision.get(id) ?? 0) + 1);
|
|
3840
3896
|
marked = markReview(id) || marked;
|
|
3841
3897
|
}
|
|
3842
3898
|
return marked;
|
|
@@ -4536,8 +4592,9 @@ function createReviewApi(store, data, open, shared, capabilities = () => ({
|
|
|
4536
4592
|
app.get("/:id/stack", async (context) => {
|
|
4537
4593
|
const query = readQuerySchemas.get.parse(context.req.query());
|
|
4538
4594
|
const id = context.req.param("id");
|
|
4539
|
-
|
|
4595
|
+
let snapshot = readReview(id, query.version);
|
|
4540
4596
|
if (isShared(id) || !snapshot.pins) return context.json({ layers: [] });
|
|
4597
|
+
if (data) snapshot = await data.discoverPullRequest(snapshot);
|
|
4541
4598
|
const repositoryPath = store.repositories().find((repository) => repository.id === snapshot.pins.repositoryId)?.path;
|
|
4542
4599
|
const layers = await resolveReviewStackLayers(snapshot, store.list(), { repositoryPath });
|
|
4543
4600
|
const trunk = layers.length > 1 && repositoryPath ? await defaultBranch(repositoryPath).catch(() => null) : null;
|
|
@@ -4637,7 +4694,8 @@ function createReviewApi(store, data, open, shared, capabilities = () => ({
|
|
|
4637
4694
|
});
|
|
4638
4695
|
app.get("/:id", async (context) => {
|
|
4639
4696
|
const query = readQuerySchemas.get.parse(context.req.query());
|
|
4640
|
-
|
|
4697
|
+
let snapshot = { ...readReview(context.req.param("id"), query.version) };
|
|
4698
|
+
if (data && query.full && query.version === void 0 && !isShared(snapshot.reviewId)) snapshot = await data.discoverPullRequest(snapshot);
|
|
4641
4699
|
if (data && query.full) try {
|
|
4642
4700
|
const pins = await data.sourcePins(snapshot);
|
|
4643
4701
|
if (pins) snapshot.pins = pins;
|
|
@@ -4661,10 +4719,7 @@ function createReviewApi(store, data, open, shared, capabilities = () => ({
|
|
|
4661
4719
|
app.post("/commands", async (context) => {
|
|
4662
4720
|
const { command: body, open: requestedOpen } = takeCreateOpen(await readBoundedRequestJson(context.req.raw));
|
|
4663
4721
|
const register = async (path) => data ? data.register(path) : store.registerRepository(path);
|
|
4664
|
-
const request = withBoardRepository(await locateRepositories(await pullRequestTargets(body, register, (
|
|
4665
|
-
if (!data) throw new ReviewInputError("Repositories are unavailable.");
|
|
4666
|
-
return data.resolvePullRequest(url, { id: repositoryId });
|
|
4667
|
-
}, (id) => store.read(id)), register), (id) => store.has(id) ? store.read(id) : void 0);
|
|
4722
|
+
const request = withBoardRepository(await locateRepositories(await pullRequestTargets(body, register, (id) => store.read(id)), register), (id) => store.has(id) ? store.read(id) : void 0);
|
|
4668
4723
|
const input = commandSchema.parse(request);
|
|
4669
4724
|
const command = sharedCommandSchema.safeParse(input);
|
|
4670
4725
|
if (command.success && command.data.operation.reviewId?.startsWith("shared-")) {
|
|
@@ -4779,7 +4834,7 @@ async function locateRepositories(body, register) {
|
|
|
4779
4834
|
}
|
|
4780
4835
|
/** Turns an agent's pullRequest target into what the store takes: a create
|
|
4781
4836
|
* from pullRequestUrl, or for set_target the PR's resolved commits. */
|
|
4782
|
-
async function pullRequestTargets(body, register,
|
|
4837
|
+
async function pullRequestTargets(body, register, board) {
|
|
4783
4838
|
const target = z.strictObject({
|
|
4784
4839
|
kind: z.literal("pullRequest"),
|
|
4785
4840
|
repositoryPath: z.string().min(1),
|
|
@@ -4810,7 +4865,7 @@ async function pullRequestTargets(body, register, resolve, board) {
|
|
|
4810
4865
|
...located.data,
|
|
4811
4866
|
operation: {
|
|
4812
4867
|
...operation,
|
|
4813
|
-
|
|
4868
|
+
repositoryId,
|
|
4814
4869
|
pullRequestUrl: url
|
|
4815
4870
|
}
|
|
4816
4871
|
};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { i as withHeadlessServerLock, n as runHeadlessServer, r as takeOverServerHome, t as HeadlessServerBusyError } from "./headless-host-
|
|
1
|
+
import { i as withHeadlessServerLock, n as runHeadlessServer, r as takeOverServerHome, t as HeadlessServerBusyError } from "./headless-host-DJhcab6r.js";
|
|
2
2
|
export { HeadlessServerBusyError, runHeadlessServer, takeOverServerHome, withHeadlessServerLock };
|