@dev.fast/whiteboard 0.3.4 → 0.3.5-preview.20261021.131
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-CprZojXd.js → account-alias-CisiYUZT.js} +13 -8
- package/dist/agent-cli-BglNRDZN.js +2 -0
- package/dist/{agent-cli-CThN7Q59.js → agent-cli-TJ7_5_B3.js} +15 -10
- package/dist/{agent-client-BOOi7EUR.js → agent-client-H53ajvrm.js} +13 -3
- package/dist/{authoring-tools-BNwuMnz6.js → authoring-tools-BCquUsB3.js} +34 -27
- package/dist/{background-server-DLSDogkI.js → background-server-BSYXD9au.js} +1 -1
- package/dist/{background-server-CkvxA-6O.js → background-server-Xom8cA_u.js} +5 -5
- package/dist/build-info.json +1 -1
- package/dist/{cli-R4yfa5DT.js → cli-BOnV4cCh.js} +1 -1
- package/dist/{cli-runner-Cuc9FSzu.js → cli-runner-cRY5NOno.js} +70 -34
- package/dist/cli.js +4 -3
- package/dist/{client-BN_FDxFr.js → client-UH1bEG7Z.js} +260 -49
- package/dist/{fuzzy-match-BO9bK37N.js → fuzzy-match-D_x3wumC.js} +6 -4
- package/dist/{headless-host-CVBOQyRS.js → headless-host-BEe-aFtB.js} +1 -1
- package/dist/{headless-host-Cog6SpS9.js → headless-host-CEb5d-A0.js} +563 -175
- package/dist/lens-selection-BxPk53c8.js +214 -0
- package/dist/{local-data-D_9tvdsp.js → local-data-mbCb1HDH.js} +2448 -347
- package/dist/{mcp-D1hziANa.js → mcp-cBtzXsmN.js} +9 -12
- package/dist/{package-paths-C--__jEv.js → package-paths-BkeQsdaw.js} +1 -1
- package/dist/profile-Dbyidrcr.js +2 -0
- package/dist/{profile-DokFw782.js → profile-duqp5uPa.js} +20 -8
- package/dist/{remote-attach-CEJ-kvDY.js → remote-attach-BeKuMm_x.js} +4 -4
- package/dist/{remote-extensions-GN8Gf_qG.js → remote-extensions-CX2fAec1.js} +1 -1
- package/dist/{remote-extensions-Blcjr9Ze.js → remote-extensions-CYWNTVSf.js} +3 -3
- package/dist/{remote-language-server-BTKBQ7x4.js → remote-language-server-DLWluAeR.js} +5 -5
- package/dist/{remote-uninstall-DW7Gdryh.js → remote-uninstall-Y3S0YmJs.js} +6 -6
- package/dist/{request-origin-Zcn_CjX4.js → request-origin-icXPv6jh.js} +55 -18
- package/dist/{review-app-launcher-CkwLclzR.js → review-app-launcher-DZvG5ZAh.js} +2 -2
- package/dist/{review-home-paths-j2BRAaNv.js → review-home-paths-BwH08ihj.js} +19 -17
- package/dist/{review-telemetry-BLNwYnLV.js → review-telemetry-AZ0imsmJ.js} +6 -6
- package/dist/runtime-CF4JXdb8.js +27 -0
- package/dist/runtime.d.ts +1 -1
- package/dist/runtime.js +1 -1
- package/dist/{s3-DtJFWC0G.js → s3-CsG2EWED.js} +1 -1
- package/dist/{s3-config-BTO12tCC.js → s3-config-CjcLyFV5.js} +4 -2
- package/dist/{s3-config-CSy3fx8H.js → s3-config-zz4GWh2T.js} +1 -1
- package/dist/server/desktop-host.js +28 -104
- package/dist/{server-discovery-Bey8IqXH.js → server-discovery-DeVTdcqK.js} +3 -3
- package/dist/sharing/index.d.ts +484 -74
- package/dist/sharing/index.js +1 -1
- package/dist/{src-DsM3jO8G.js → src-DYZLCUP_.js} +98 -18
- package/dist/{src-BMPuxWv4.js → src-DtfSndqS.js} +269 -227
- package/dist/{stored-document-migration-CChxtFAy.js → stored-document-migration-B29lve9-.js} +318 -271
- package/dist/{thread-state-5pYr6_zM.js → thread-state-BPpvKFwQ.js} +12 -2
- package/dist/{tool-failure-C9MpbXJJ.js → tool-failure-CQhyLht3.js} +10 -3
- package/instructions/authoring.md +20 -5
- package/package.json +4 -4
- package/src/agent-selection.ts +6 -0
- package/src/ask/agents.ts +13 -1
- package/src/ask/checkout-files.ts +2 -5
- package/src/ask/thread-state.ts +4 -0
- package/src/ask/thread.ts +61 -31
- package/src/ask/threads.ts +24 -3
- package/src/cli-install.ts +13 -2
- package/src/cli-runner.ts +4 -1
- package/src/cli.ts +4 -1
- package/src/diff-selection-migration.ts +48 -34
- package/src/heading-anchors.ts +42 -0
- package/src/lens-selection.ts +38 -2
- package/src/markdown.ts +42 -0
- package/src/posthog-capture-client.ts +1 -1
- package/src/review-api/README.md +52 -13
- package/src/review-api/activity.ts +1 -4
- package/src/review-api/agent-cli.ts +9 -1
- package/src/review-api/anchor-quotes.ts +14 -7
- package/src/review-api/ask-history.ts +118 -51
- package/src/review-api/authoring-tools.ts +45 -30
- package/src/review-api/azure-devops-provider.ts +2 -20
- package/src/review-api/azure-remote.ts +21 -0
- package/src/review-api/blocks/definition.ts +1 -1
- package/src/review-api/blocks/markdown.ts +2 -2
- package/src/review-api/board-order.ts +144 -0
- package/src/review-api/checkout-groups.ts +586 -0
- package/src/review-api/document-headings.ts +58 -27
- package/src/review-api/document-text.ts +31 -2
- package/src/review-api/document.ts +362 -67
- package/src/review-api/foreign-references.ts +328 -0
- package/src/review-api/github-provider.ts +51 -13
- package/src/review-api/http.ts +734 -135
- package/src/review-api/instructions.ts +0 -19
- package/src/review-api/link-preview.ts +113 -0
- package/src/review-api/local-data.ts +310 -46
- package/src/review-api/mcp.ts +7 -13
- package/src/review-api/onboarding.ts +1 -1
- package/src/review-api/profile.ts +37 -6
- package/src/review-api/public-tools.ts +24 -2
- package/src/review-api/pull-request.ts +82 -49
- package/src/review-api/request-origin.ts +10 -0
- package/src/review-api/review-progress.ts +61 -27
- package/src/review-api/scratchpad-plan-upgrade.ts +250 -0
- package/src/review-api/store-migrations.ts +355 -0
- package/src/review-api/store-schema.ts +38 -29
- package/src/review-api/store.ts +2176 -495
- package/src/review-api/worktree-events.ts +3 -5
- package/src/review-api/worktree-source.ts +3 -7
- package/src/review-api/worktree-structural.integration.ts +72 -0
- package/src/review-stack.ts +15 -23
- package/src/runtime.ts +4 -30
- package/src/server/desktop-host.ts +6 -1
- package/src/server/desktop-server.ts +1 -36
- package/src/server/headless-host.ts +0 -2
- package/src/server/hono-http.ts +2 -1
- package/src/server/review-gateway-list.ts +3 -5
- package/src/server/review-gateway-memory.ts +1 -1
- package/src/server/review-lifecycle-telemetry.ts +2 -2
- package/src/server/review-server-core.ts +1 -5
- package/src/server/structural-comparisons.ts +47 -0
- package/src/sharing/export.ts +36 -7
- package/src/sharing/host.ts +34 -14
- package/src/sharing/import.ts +156 -24
- package/src/sharing/repository.ts +143 -24
- package/src/startup-trace.ts +3 -3
- package/src/stored-document-migration.ts +110 -19
- package/src/ui-telemetry-events.ts +44 -18
- package/dist/agent-cli-C6SPSII0.js +0 -2
- package/dist/profile-CYPmvBoA.js +0 -2
- package/dist/runtime-CKiWhGrf.js +0 -52
- package/instructions/scratchpad.md +0 -23
- package/src/review-preferences.ts +0 -88
- package/src/server/legacy-tutorial-cleanup.ts +0 -38
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
/** What sibling order reads about a board. */
|
|
2
|
+
export interface SiblingFacts {
|
|
3
|
+
id: string;
|
|
4
|
+
/** When it was made: an edit never moves it. */
|
|
5
|
+
createdAt: string;
|
|
6
|
+
/** Its pins: commits of repositoryId. Plans have none. */
|
|
7
|
+
repositoryId?: string;
|
|
8
|
+
base?: string;
|
|
9
|
+
head?: string;
|
|
10
|
+
/** A PR board's head branch, and its PR's base branch, when known. */
|
|
11
|
+
headBranch?: string;
|
|
12
|
+
baseBranch?: string;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* Siblings in reading order. A comes after B when A reaches B through
|
|
17
|
+
* depends_on, directly or through boards outside the siblings. Between two
|
|
18
|
+
* siblings with no such chain either way, commits decide: A comes after B
|
|
19
|
+
* when A's base is, or descends from, B's head, or A's PR merges into B's
|
|
20
|
+
* branch. Remaining ties go newest made first, then by id, so an edit
|
|
21
|
+
* never reorders them.
|
|
22
|
+
*/
|
|
23
|
+
export function orderSiblings(
|
|
24
|
+
siblings: readonly SiblingFacts[],
|
|
25
|
+
dependsOn: (id: string) => readonly string[],
|
|
26
|
+
isAncestor: (repositoryId: string, ancestor: string, of: string) => boolean,
|
|
27
|
+
): string[] {
|
|
28
|
+
const reach = new Map(
|
|
29
|
+
siblings.map((board) => [board.id, reachable(board.id, dependsOn)]),
|
|
30
|
+
);
|
|
31
|
+
|
|
32
|
+
const after = (a: SiblingFacts, b: SiblingFacts) => {
|
|
33
|
+
if (reach.get(a.id)!.has(b.id)) return true;
|
|
34
|
+
|
|
35
|
+
if (reach.get(b.id)!.has(a.id)) return false;
|
|
36
|
+
|
|
37
|
+
return buildsOn(a, b, isAncestor) && !buildsOn(b, a, isAncestor);
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
const before = new Map(
|
|
41
|
+
siblings.map((a) => [
|
|
42
|
+
a.id,
|
|
43
|
+
new Set(siblings.flatMap((b) => (b !== a && after(a, b) ? [b.id] : []))),
|
|
44
|
+
]),
|
|
45
|
+
);
|
|
46
|
+
|
|
47
|
+
const newestFirst = [...siblings].sort(
|
|
48
|
+
(a, b) =>
|
|
49
|
+
Date.parse(b.createdAt) - Date.parse(a.createdAt) ||
|
|
50
|
+
a.id.localeCompare(b.id),
|
|
51
|
+
);
|
|
52
|
+
|
|
53
|
+
const placed = new Set<string>();
|
|
54
|
+
const order: string[] = [];
|
|
55
|
+
|
|
56
|
+
while (order.length < siblings.length) {
|
|
57
|
+
const remaining = newestFirst.filter((board) => !placed.has(board.id));
|
|
58
|
+
|
|
59
|
+
// Inferred order can disagree with itself; then age breaks the loop.
|
|
60
|
+
const next =
|
|
61
|
+
remaining.find((board) =>
|
|
62
|
+
[...before.get(board.id)!].every((id) => placed.has(id)),
|
|
63
|
+
) ?? remaining[0]!;
|
|
64
|
+
|
|
65
|
+
placed.add(next.id);
|
|
66
|
+
order.push(next.id);
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
return order;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
function reachable(
|
|
73
|
+
id: string,
|
|
74
|
+
dependsOn: (id: string) => readonly string[],
|
|
75
|
+
): Set<string> {
|
|
76
|
+
const seen = new Set<string>();
|
|
77
|
+
const stack = [...dependsOn(id)];
|
|
78
|
+
|
|
79
|
+
while (stack.length) {
|
|
80
|
+
const next = stack.pop()!;
|
|
81
|
+
|
|
82
|
+
if (seen.has(next)) continue;
|
|
83
|
+
seen.add(next);
|
|
84
|
+
stack.push(...dependsOn(next));
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
return seen;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
/** Whether a's change sits on top of b's. */
|
|
91
|
+
function buildsOn(
|
|
92
|
+
a: SiblingFacts,
|
|
93
|
+
b: SiblingFacts,
|
|
94
|
+
isAncestor: (repositoryId: string, ancestor: string, of: string) => boolean,
|
|
95
|
+
): boolean {
|
|
96
|
+
if (a.repositoryId !== b.repositoryId) return false;
|
|
97
|
+
|
|
98
|
+
if (a.baseBranch && a.baseBranch === b.headBranch) return true;
|
|
99
|
+
|
|
100
|
+
if (!a.base || !b.head) return false;
|
|
101
|
+
|
|
102
|
+
if (a.base === b.head) return true;
|
|
103
|
+
|
|
104
|
+
// A board with no change of its own builds on nothing.
|
|
105
|
+
return a.base !== a.head && isAncestor(a.repositoryId!, b.head, a.base);
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
/**
|
|
109
|
+
* The path that adding `from → to` would close, from `from` back to itself,
|
|
110
|
+
* or undefined when it closes none.
|
|
111
|
+
*/
|
|
112
|
+
export function dependencyCycle(
|
|
113
|
+
from: string,
|
|
114
|
+
to: string,
|
|
115
|
+
dependsOn: (id: string) => readonly string[],
|
|
116
|
+
): string[] | undefined {
|
|
117
|
+
if (from === to) return [from, from];
|
|
118
|
+
|
|
119
|
+
const previous = new Map<string, string>();
|
|
120
|
+
const queue = [to];
|
|
121
|
+
const seen = new Set([to]);
|
|
122
|
+
|
|
123
|
+
while (queue.length) {
|
|
124
|
+
const current = queue.shift()!;
|
|
125
|
+
|
|
126
|
+
if (current === from) {
|
|
127
|
+
const path = [from];
|
|
128
|
+
|
|
129
|
+
for (let at = from; at !== to; at = previous.get(at)!)
|
|
130
|
+
path.unshift(previous.get(at)!);
|
|
131
|
+
|
|
132
|
+
return [from, ...path];
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
for (const next of dependsOn(current))
|
|
136
|
+
if (!seen.has(next)) {
|
|
137
|
+
seen.add(next);
|
|
138
|
+
previous.set(next, current);
|
|
139
|
+
queue.push(next);
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
return undefined;
|
|
144
|
+
}
|