@dev.fast/whiteboard 0.0.0-stage → 0.2.1-preview.20261005.98

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 (247) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +146 -2
  3. package/THIRD_PARTY_NOTICES.md +93 -0
  4. package/dist/account-alias-DOHN1RSH.js +973 -0
  5. package/dist/agent-cli-ChOq0ZuO.js +117 -0
  6. package/dist/agent-cli-DzWfZr6G.js +2 -0
  7. package/dist/agent-client-CPQo7iTI.js +305 -0
  8. package/dist/authoring-tools-Cr6Kpjsx.js +234 -0
  9. package/dist/build-info.json +1 -0
  10. package/dist/cli-hVgHcdsv.js +47 -0
  11. package/dist/cli-runner-D8y2_luU.js +5095 -0
  12. package/dist/cli.d.ts +1 -0
  13. package/dist/cli.js +128 -0
  14. package/dist/client-DFoh50W3.js +950 -0
  15. package/dist/desktop-discovery-DBO-PM2V.js +164 -0
  16. package/dist/error-message-OtiDonty.js +6 -0
  17. package/dist/fs-utils-BMPLt0cr.js +22 -0
  18. package/dist/fuzzy-match-BoAmcyak.js +30 -0
  19. package/dist/headless-host-BJxf4dUU.js +94 -0
  20. package/dist/input-error-OLgB_h31.js +11 -0
  21. package/dist/local-data-CxLk75rx.js +4491 -0
  22. package/dist/mcp-QeF8vkdf.js +140 -0
  23. package/dist/package-paths-B6-zxvIO.js +47 -0
  24. package/dist/process-error-telemetry-v9e5h6D7.js +3952 -0
  25. package/dist/profile-4ry2f3AM.js +76 -0
  26. package/dist/profile-Bh5FIrmf.js +2 -0
  27. package/dist/request-origin-D_4QIdoN.js +811 -0
  28. package/dist/review-agent-traces-DNJFYzc8.js +3866 -0
  29. package/dist/review-home-paths-6zZH-1c9.js +2560 -0
  30. package/dist/review-telemetry-DEFnQsQ2.js +1195 -0
  31. package/dist/runtime-CKiWhGrf.js +52 -0
  32. package/dist/runtime.d.ts +9 -0
  33. package/dist/runtime.js +2 -0
  34. package/dist/s3-SzLpeCG6.js +345 -0
  35. package/dist/s3-config-BgxkSoOy.js +2 -0
  36. package/dist/s3-config-CAxhO9u_.js +676 -0
  37. package/dist/server/desktop-host.d.ts +4 -0
  38. package/dist/server/desktop-host.js +1702 -0
  39. package/dist/server-discovery-Dbzn3w6Z.js +66 -0
  40. package/dist/sharing/index.d.ts +1977 -0
  41. package/dist/sharing/index.js +2 -0
  42. package/dist/src-CGP5ytbV.js +283 -0
  43. package/dist/src-CmdiBL20.js +3676 -0
  44. package/dist/src-DnwdaQ2r.js +865 -0
  45. package/dist/src-X9phtB2j.js +68 -0
  46. package/dist/stored-document-migration-DHeMpLMb.js +2671 -0
  47. package/dist/tool-failure-C8zB73HV.js +98 -0
  48. package/dist/tutorial-trace-DrBvkaeL.js +43 -0
  49. package/instructions/authoring.md +36 -0
  50. package/instructions/file-lenses.md +13 -0
  51. package/instructions/scratchpad.md +23 -0
  52. package/instructions/trace-archaeology.md +113 -0
  53. package/onboarding.md +8 -0
  54. package/package.json +106 -3
  55. package/src/agent-selection.ts +100 -0
  56. package/src/agent-session-ref.ts +80 -0
  57. package/src/ask/agents.ts +351 -0
  58. package/src/ask/checkout-files.ts +47 -0
  59. package/src/ask/file-refs.ts +111 -0
  60. package/src/ask/pi-mcp.ts +154 -0
  61. package/src/ask/protocol.ts +244 -0
  62. package/src/ask/thread-state.ts +350 -0
  63. package/src/ask/thread.ts +1400 -0
  64. package/src/ask/threads.ts +219 -0
  65. package/src/ask/watch.ts +79 -0
  66. package/src/cli-install.ts +1041 -0
  67. package/src/cli-runner.ts +1461 -0
  68. package/src/cli-runtime-info.ts +35 -0
  69. package/src/cli.ts +222 -0
  70. package/src/connect-prompts.ts +248 -0
  71. package/src/cursor-deeplink.ts +11 -0
  72. package/src/desktop-discovery.ts +355 -0
  73. package/src/diff-selection-migration.ts +63 -0
  74. package/src/embedded-posthog-key.ts +6 -0
  75. package/src/error-telemetry.ts +247 -0
  76. package/src/evidence.ts +14 -0
  77. package/src/exception-telemetry.ts +126 -0
  78. package/src/fixtures/blocks/call_stack_diff.json +27 -0
  79. package/src/fixtures/blocks/callout.json +11 -0
  80. package/src/fixtures/blocks/code.json +9 -0
  81. package/src/fixtures/blocks/code_peek.json +8 -0
  82. package/src/fixtures/blocks/database_lens.json +51 -0
  83. package/src/fixtures/blocks/divider.json +1 -0
  84. package/src/fixtures/blocks/fixtures.ts +33 -0
  85. package/src/fixtures/blocks/flow_diagram.json +36 -0
  86. package/src/fixtures/blocks/ids.ts +8 -0
  87. package/src/fixtures/blocks/image.json +9 -0
  88. package/src/fixtures/blocks/markdown.json +7 -0
  89. package/src/fixtures/blocks/section.json +11 -0
  90. package/src/fixtures/blocks/sequence.json +31 -0
  91. package/src/fixtures/blocks/software_map.json +7 -0
  92. package/src/fixtures/blocks/trace_quote.json +9 -0
  93. package/src/fixtures/blocks/tutorial.json +51 -0
  94. package/src/fs-utils.ts +32 -0
  95. package/src/fuzzy-match.ts +94 -0
  96. package/src/install.ts +29 -0
  97. package/src/legacy-skills.ts +133 -0
  98. package/src/lens-selection.ts +230 -0
  99. package/src/markdown-latex-math.ts +230 -0
  100. package/src/markdown.ts +81 -0
  101. package/src/package-paths.ts +53 -0
  102. package/src/posthog-capture-client.ts +610 -0
  103. package/src/review-api/README.md +295 -0
  104. package/src/review-api/activity.ts +340 -0
  105. package/src/review-api/agent-cli.ts +219 -0
  106. package/src/review-api/agent-client.ts +188 -0
  107. package/src/review-api/anchor-quotes.ts +88 -0
  108. package/src/review-api/ask-history.ts +242 -0
  109. package/src/review-api/authoring-tools.ts +211 -0
  110. package/src/review-api/blocks/call_stack_diff.ts +75 -0
  111. package/src/review-api/blocks/callout.ts +24 -0
  112. package/src/review-api/blocks/code.ts +9 -0
  113. package/src/review-api/blocks/code_peek.ts +13 -0
  114. package/src/review-api/blocks/database_lens.ts +150 -0
  115. package/src/review-api/blocks/definition.ts +40 -0
  116. package/src/review-api/blocks/divider.ts +6 -0
  117. package/src/review-api/blocks/flow_diagram.ts +111 -0
  118. package/src/review-api/blocks/image.ts +10 -0
  119. package/src/review-api/blocks/index.ts +90 -0
  120. package/src/review-api/blocks/markdown.ts +17 -0
  121. package/src/review-api/blocks/section.ts +24 -0
  122. package/src/review-api/blocks/sequence.ts +56 -0
  123. package/src/review-api/blocks/software_map.ts +9 -0
  124. package/src/review-api/blocks/trace_quote.ts +10 -0
  125. package/src/review-api/blocks/tutorial.ts +39 -0
  126. package/src/review-api/checkout-fs.ts +14 -0
  127. package/src/review-api/client.ts +1 -0
  128. package/src/review-api/comparison-coverage.ts +304 -0
  129. package/src/review-api/component-reference.ts +30 -0
  130. package/src/review-api/diff-lenses.ts +175 -0
  131. package/src/review-api/document-headings.ts +51 -0
  132. package/src/review-api/document-text.ts +200 -0
  133. package/src/review-api/document.ts +906 -0
  134. package/src/review-api/file-lenses.ts +100 -0
  135. package/src/review-api/http.ts +1877 -0
  136. package/src/review-api/image-decode.ts +29 -0
  137. package/src/review-api/input-error.ts +9 -0
  138. package/src/review-api/instructions.ts +89 -0
  139. package/src/review-api/lens-alignment.ts +52 -0
  140. package/src/review-api/local-data.ts +1837 -0
  141. package/src/review-api/map-input.ts +154 -0
  142. package/src/review-api/mcp-client-agent.ts +32 -0
  143. package/src/review-api/mcp.ts +240 -0
  144. package/src/review-api/origin.ts +43 -0
  145. package/src/review-api/profile.ts +146 -0
  146. package/src/review-api/public-tools.ts +102 -0
  147. package/src/review-api/pull-request.ts +389 -0
  148. package/src/review-api/read-schemas.ts +85 -0
  149. package/src/review-api/recovery.ts +2 -0
  150. package/src/review-api/request-origin.ts +33 -0
  151. package/src/review-api/review-progress.ts +382 -0
  152. package/src/review-api/status-tool.ts +10 -0
  153. package/src/review-api/store-schema.ts +22 -0
  154. package/src/review-api/store.ts +1647 -0
  155. package/src/review-api/tool-failure.ts +64 -0
  156. package/src/review-api/trace-schema.ts +13 -0
  157. package/src/review-api/traces.ts +119 -0
  158. package/src/review-api/unsupported-files.integration.ts +91 -0
  159. package/src/review-api/workspaces.ts +692 -0
  160. package/src/review-api/worktree-source.ts +170 -0
  161. package/src/review-api/worktree-structural.integration.ts +320 -0
  162. package/src/review-app-launcher.ts +432 -0
  163. package/src/review-app-picker.ts +168 -0
  164. package/src/review-app.ts +134 -0
  165. package/src/review-bundled-tools.ts +249 -0
  166. package/src/review-checkout-paths.ts +37 -0
  167. package/src/review-diff-files.ts +89 -0
  168. package/src/review-head-checkout.ts +300 -0
  169. package/src/review-home-paths.ts +73 -0
  170. package/src/review-info.ts +59 -0
  171. package/src/review-instances.ts +113 -0
  172. package/src/review-logger.ts +183 -0
  173. package/src/review-preferences.ts +88 -0
  174. package/src/review-prepare.ts +291 -0
  175. package/src/review-stack.ts +112 -0
  176. package/src/review-telemetry.ts +1066 -0
  177. package/src/runtime.ts +74 -0
  178. package/src/server/account-alias.ts +30 -0
  179. package/src/server/bounded-stream.ts +34 -0
  180. package/src/server/bug-report.ts +301 -0
  181. package/src/server/client-error-budget.ts +45 -0
  182. package/src/server/crash-report.ts +273 -0
  183. package/src/server/desktop-host-shutdown.ts +64 -0
  184. package/src/server/desktop-host.ts +190 -0
  185. package/src/server/desktop-server.ts +703 -0
  186. package/src/server/diffr-config.ts +509 -0
  187. package/src/server/diffr-languages.ts +97 -0
  188. package/src/server/global-verb-relay.ts +190 -0
  189. package/src/server/headless-host.ts +149 -0
  190. package/src/server/hono-http.ts +162 -0
  191. package/src/server/http-json.ts +24 -0
  192. package/src/server/json-review-reporting.ts +174 -0
  193. package/src/server/process-error-telemetry.ts +174 -0
  194. package/src/server/review-api-parsers.ts +90 -0
  195. package/src/server/review-lifecycle-telemetry.ts +73 -0
  196. package/src/server/review-open-watchdog.ts +46 -0
  197. package/src/server/review-server-core.ts +290 -0
  198. package/src/server/structural-comparisons.ts +153 -0
  199. package/src/server/structural-diff.ts +186 -0
  200. package/src/server/tutorial-service.ts +241 -0
  201. package/src/server/ui-telemetry.ts +198 -0
  202. package/src/server-discovery.ts +95 -0
  203. package/src/session-markers.ts +132 -0
  204. package/src/sharing/auth.ts +41 -0
  205. package/src/sharing/cli.ts +83 -0
  206. package/src/sharing/client.ts +334 -0
  207. package/src/sharing/export.ts +195 -0
  208. package/src/sharing/host.ts +316 -0
  209. package/src/sharing/import.ts +787 -0
  210. package/src/sharing/index.ts +16 -0
  211. package/src/sharing/repository.ts +145 -0
  212. package/src/sharing/routes.ts +34 -0
  213. package/src/slug.ts +23 -0
  214. package/src/software-map-diff-counts.ts +517 -0
  215. package/src/software-map-model.ts +1147 -0
  216. package/src/software-map-topology-diff.ts +260 -0
  217. package/src/source.ts +92 -0
  218. package/src/startup-trace.ts +232 -0
  219. package/src/stored-document-migration.ts +151 -0
  220. package/src/telemetry-clean-text.ts +257 -0
  221. package/src/telemetry-config.ts +298 -0
  222. package/src/telemetry-debug-sink.ts +38 -0
  223. package/src/telemetry.ts +13 -0
  224. package/src/trace-cli.ts +156 -0
  225. package/src/trace-storage-cli.ts +509 -0
  226. package/src/tutorial-conversation.ts +18 -0
  227. package/src/ui-telemetry-events.ts +765 -0
  228. package/src/unified-diff.ts +71 -0
  229. package/src/viewed-coverage.ts +259 -0
  230. package/src/windows-cli.ts +125 -0
  231. package/tutorial/document.json +275 -0
  232. package/tutorial/runtime-manifest.json +12 -0
  233. package/tutorial/sample-service/package.json +9 -0
  234. package/tutorial/sample-service/src/api/checkout-api.ts +17 -0
  235. package/tutorial/sample-service/src/app.ts +26 -0
  236. package/tutorial/sample-service/src/database/schema.ts +10 -0
  237. package/tutorial/sample-service/src/fulfillment/fulfillment-queue.ts +15 -0
  238. package/tutorial/sample-service/src/fulfillment/fulfillment-worker.ts +24 -0
  239. package/tutorial/sample-service/src/inventory/inventory-service.ts +11 -0
  240. package/tutorial/sample-service/src/orders/order-service.ts +34 -0
  241. package/tutorial/sample-service/src/orders/order.ts +21 -0
  242. package/tutorial/sample-service/src/orders/orders-repository.ts +24 -0
  243. package/tutorial/sample-service/src/payments/payment-gateway.ts +12 -0
  244. package/tutorial/sample-service/src/shipping/shipping-gateway.ts +15 -0
  245. package/tutorial/sample-service/tsconfig.json +12 -0
  246. package/tutorial/software-map.json +139 -0
  247. package/tutorial/trace.json +20 -0
@@ -0,0 +1,1977 @@
1
+ import { z } from "zod";
2
+ import { watch } from "node:fs";
3
+ import { DatabaseSync } from "node:sqlite";
4
+ //#region ../json/src/json.d.ts
5
+ /**
6
+ * JSON values as they come off the wire or out of a file. Parse into one of
7
+ * these at the I/O boundary, then narrow into a domain type; never carry an
8
+ * `unknown`-valued dictionary past the boundary.
9
+ */
10
+ type JsonPrimitive = string | number | boolean | null;
11
+ type JsonValue = JsonPrimitive | JsonArray | JsonObject;
12
+ type JsonArray = JsonValue[];
13
+ type JsonObject = {
14
+ [key: string]: JsonValue;
15
+ };
16
+ //#endregion
17
+ //#region ../review-share-protocol/src/index.d.ts
18
+ declare const shareManifestSchema: z.ZodObject<{
19
+ format: z.ZodLiteral<"review-share/1">;
20
+ reviewId: z.ZodString;
21
+ version: z.ZodNumber;
22
+ title: z.ZodString;
23
+ snapshot: z.ZodString;
24
+ presentation: z.ZodString;
25
+ objects: z.ZodArray<z.ZodObject<{
26
+ id: z.ZodString;
27
+ size: z.ZodNumber;
28
+ sha256: z.ZodString;
29
+ }, z.core.$strict>>;
30
+ resources: z.ZodArray<z.ZodObject<{
31
+ id: z.ZodString;
32
+ kind: z.ZodEnum<{
33
+ map: "map";
34
+ image: "image";
35
+ trace: "trace";
36
+ }>;
37
+ mimeType: z.ZodEnum<{
38
+ "image/png": "image/png";
39
+ "application/json": "application/json";
40
+ }>;
41
+ object: z.ZodString;
42
+ }, z.core.$strict>>;
43
+ repository: z.ZodOptional<z.ZodObject<{
44
+ cloneUrl: z.ZodString;
45
+ }, z.core.$strict>>;
46
+ }, z.core.$strict>;
47
+ type ShareManifest = z.infer<typeof shareManifestSchema>;
48
+ //#endregion
49
+ //#region ../local-vcs/src/vcs.d.ts
50
+ interface LocalVcsDiffFileSummary {
51
+ path: string;
52
+ previousPath?: string;
53
+ status: "added" | "modified" | "deleted" | "renamed";
54
+ additions: number;
55
+ deletions: number;
56
+ /** Git reports no line counts for this file's contents. */
57
+ binary?: true;
58
+ }
59
+ interface LocalVcsCommitSummary {
60
+ commit: string;
61
+ parentCommit: string;
62
+ subject: string;
63
+ author: string;
64
+ authoredAt: string;
65
+ fileCount: number;
66
+ additions: number;
67
+ deletions: number;
68
+ }
69
+ //#endregion
70
+ //#region ../../node_modules/@dev.fast/diffr/dist/contract.d.ts
71
+ /** A pairing always has at least one side; additions/deletions omit the other. */
72
+ type StructuralPairing<T> = {
73
+ lhs: T;
74
+ rhs: T;
75
+ } | {
76
+ lhs: T;
77
+ rhs?: never;
78
+ } | {
79
+ rhs: T;
80
+ lhs?: never;
81
+ };
82
+ type StructuralDiffEvent = {
83
+ type: "start";
84
+ version: number;
85
+ lhs: StructuralSnapshot;
86
+ rhs: StructuralSnapshot;
87
+ files: StructuralFileChange[];
88
+ } | ({
89
+ type: "file";
90
+ file: StructuralPairing<StructuralFileRef>;
91
+ visibility?: StructuralVisibility;
92
+ } & StructuralOutcome) | {
93
+ type: "annotations";
94
+ file: StructuralPairing<StructuralFileRef>;
95
+ annotations: {
96
+ region_id: number;
97
+ label: string;
98
+ }[];
99
+ error?: StructuralProblem;
100
+ } | {
101
+ type: "complete";
102
+ succeeded: number;
103
+ failed: number;
104
+ aborted?: StructuralProblem;
105
+ };
106
+ /** A file record contains exactly one result or error. */
107
+ type StructuralOutcome = {
108
+ diff: StructuralDiff;
109
+ error?: never;
110
+ } | {
111
+ error: StructuralProblem;
112
+ diff?: never;
113
+ };
114
+ type StructuralSnapshot = {
115
+ type: "revision";
116
+ rev: string;
117
+ } | {
118
+ type: "index";
119
+ } | {
120
+ type: "working_tree";
121
+ } | {
122
+ type: "empty_tree";
123
+ } | {
124
+ type: "path";
125
+ path: string;
126
+ };
127
+ type StructuralProblem = {
128
+ code: string;
129
+ message: string;
130
+ };
131
+ type StructuralFileChange = {
132
+ file: StructuralPairing<StructuralFileRef>;
133
+ status: StructuralFileStatus;
134
+ tags?: string[];
135
+ };
136
+ type StructuralFileStatus = "added" | "deleted" | "modified" | "renamed" | "copied" | "type_changed";
137
+ type StructuralFileRef = {
138
+ path: string;
139
+ oid: string;
140
+ mode: string;
141
+ };
142
+ type StructuralVisibility = {
143
+ collapsed?: boolean;
144
+ label?: string;
145
+ };
146
+ /** Structural changed lines, independent of presentation and fold state. */
147
+ type StructuralChanges = {
148
+ base: [number, number][];
149
+ head: [number, number][];
150
+ };
151
+ type StructuralDiff = ({
152
+ type: "text";
153
+ stats: StructuralStats;
154
+ structural_changes: StructuralChanges;
155
+ } & StructuralPairing<StructuralSource>) | ({
156
+ type: "binary";
157
+ } & StructuralPairing<StructuralBinaryRef>);
158
+ type StructuralSource = {
159
+ text: string;
160
+ syntax?: StructuralSyntaxSpan[];
161
+ regions?: StructuralRegion[];
162
+ };
163
+ type StructuralBinaryRef = {
164
+ size: number;
165
+ };
166
+ type StructuralSyntaxSpan = {
167
+ line: number;
168
+ start_column: number;
169
+ end_column: number;
170
+ capture: string;
171
+ };
172
+ /** Region identity, collapse identity, and leaf alignment identity are distinct. */
173
+ type StructuralRegion = {
174
+ id: number;
175
+ fold_state_id: number;
176
+ tags?: string[];
177
+ visibility?: StructuralVisibility;
178
+ } & StructuralSourceRange & StructuralNode;
179
+ type StructuralNode = {
180
+ kind: "leaf";
181
+ alignment_id: number;
182
+ changed?: StructuralSpan[];
183
+ } | {
184
+ kind: "fold";
185
+ children: StructuralRegion[];
186
+ };
187
+ type StructuralSpan = {
188
+ line: number;
189
+ start_column: number;
190
+ end_column: number;
191
+ };
192
+ type StructuralSourceRange = {
193
+ start: StructuralPos;
194
+ end: StructuralPos;
195
+ };
196
+ type StructuralPos = {
197
+ line: number;
198
+ column: number;
199
+ };
200
+ type StructuralStats = {
201
+ textual: StructuralLineCounts;
202
+ visible: StructuralLineCounts;
203
+ fallback?: StructuralProblem;
204
+ };
205
+ type StructuralLineCounts = {
206
+ added: number;
207
+ removed: number;
208
+ };
209
+ //#endregion
210
+ //#region ../review-protocol/src/review-api-client.d.ts
211
+ /** List metadata for the authenticated local catalog; document contents stay in snapshots. */
212
+ interface ReviewApiSummary {
213
+ reviewId: string;
214
+ version: number;
215
+ title: string;
216
+ /** Absent for a review. The one scratchpad has no pins or lifecycle. */
217
+ kind?: "scratchpad";
218
+ /** What is on the scratchpad, for its Home card; absent for a review. */
219
+ contents?: {
220
+ blocks: number;
221
+ diagrams: number;
222
+ };
223
+ /** Absent for a document whose references all carry their own pins. */
224
+ pins?: {
225
+ repositoryId: string;
226
+ base: string;
227
+ head: string;
228
+ worktreeRevision?: string;
229
+ };
230
+ target?: {
231
+ kind: "worktree";
232
+ repositoryId: string;
233
+ base?: string;
234
+ } | {
235
+ kind: "commits";
236
+ repositoryId: string;
237
+ head: string;
238
+ base?: string;
239
+ };
240
+ createdAt: string;
241
+ /** Timestamp of the earliest retained review version, when known. */
242
+ firstCreatedAt?: string;
243
+ /** Present on reviews imported from the legacy MDX store. */
244
+ origin?: {
245
+ branch?: string;
246
+ baseRef?: string;
247
+ pullRequestNumber?: number;
248
+ pullRequestUrl?: string;
249
+ revision?: string;
250
+ };
251
+ /** Shared imports have separate local checkouts but retain their remote identity. */
252
+ shared?: {
253
+ cloneUrl?: string;
254
+ };
255
+ /** Display grouping only; source pins remain bound to their own checkout. */
256
+ repositoryGroup?: {
257
+ key: string;
258
+ label: string;
259
+ };
260
+ repositoryName: string;
261
+ repositoryPath?: string;
262
+ diffStats?: {
263
+ fileCount: number;
264
+ additions: number;
265
+ deletions: number;
266
+ } | null;
267
+ viewedAt: string | null;
268
+ dismissedAt: string | null;
269
+ /** An agent holds a live lease; absent on shared reviews. */
270
+ working?: boolean;
271
+ }
272
+ interface ReviewSourceEntry {
273
+ path: string;
274
+ kind: "file" | "directory";
275
+ }
276
+ //#endregion
277
+ //#region ../review-protocol/src/contracts.d.ts
278
+ /** Workspace attachment identity is independent of the displayed source generation. */
279
+ interface ReviewLanguageEnvironment {
280
+ /** Absent for a caller on another machine. */
281
+ readonly rootPath?: string | null;
282
+ readonly identity: string;
283
+ /** Present only when the language checkout is unavailable, not while preparing. */
284
+ readonly issue?: string;
285
+ }
286
+ //#endregion
287
+ //#region src/source.d.ts
288
+ /** The repository and commits one source reference was read from. A
289
+ * reference without pins resolves against its document's pins; one with
290
+ * pins names them itself, so a document can quote several repositories or
291
+ * commits. `base` is only needed by references to the base side. */
292
+ declare const sourcePinsSchema: z.ZodObject<{
293
+ repositoryId: z.ZodString;
294
+ head: z.ZodString;
295
+ base: z.ZodOptional<z.ZodString>;
296
+ }, z.core.$strict>;
297
+ type SourcePins = z.infer<typeof sourcePinsSchema>;
298
+ /** Internal coordinates for reading one revision or storing resolved coverage.
299
+ * Authored document attachments use DiffSelection instead. */
300
+ declare const fileLineRangeSchema: z.ZodObject<{
301
+ side: z.ZodDefault<z.ZodEnum<{
302
+ head: "head";
303
+ base: "base";
304
+ }>>;
305
+ file: z.ZodString;
306
+ fromLine: z.ZodNumber;
307
+ toLine: z.ZodNumber;
308
+ pins: z.ZodOptional<z.ZodObject<{
309
+ repositoryId: z.ZodString;
310
+ head: z.ZodString;
311
+ base: z.ZodOptional<z.ZodString>;
312
+ }, z.core.$strict>>;
313
+ }, z.core.$strict>;
314
+ type FileLineRange = z.infer<typeof fileLineRangeSchema>;
315
+ //#endregion
316
+ //#region src/lens-selection.d.ts
317
+ type AlignmentRow$1 = readonly [number | null, number | null];
318
+ //#endregion
319
+ //#region src/viewed-coverage.d.ts
320
+ /** Zero-based, half-open intervals; always normalized at the storage boundary. */
321
+ type LineInterval = [number, number];
322
+ interface Coverage {
323
+ base: LineInterval[];
324
+ head: LineInterval[];
325
+ }
326
+ interface CoverageFile$1 {
327
+ path: string;
328
+ previousPath?: string;
329
+ fingerprint: string;
330
+ changed: Coverage;
331
+ /** The changed lines diffr folds by default: every changed line of a file
332
+ * it hides, or those under a region that starts collapsed. Absent without
333
+ * structural data, where every changed line is left to read. */
334
+ folded?: Coverage;
335
+ viewed: Coverage;
336
+ }
337
+ //#endregion
338
+ //#region src/review-api/blocks/flow_diagram.d.ts
339
+ /** Nodes and edges are the diagram's children: each is its own edit target,
340
+ * so an agent can draw a diagram one unit at a time. Edges still name nodes
341
+ * by their diagram-local key. */
342
+ declare const flowNodeSchema: z.ZodObject<{
343
+ type: z.ZodDefault<z.ZodLiteral<"flow_node">>;
344
+ key: z.ZodString;
345
+ label: z.ZodString;
346
+ description: z.ZodOptional<z.ZodString>;
347
+ kind: z.ZodOptional<z.ZodEnum<{
348
+ process: "process";
349
+ decision: "decision";
350
+ terminal: "terminal";
351
+ }>>;
352
+ attachments: z.ZodDefault<z.ZodArray<z.ZodObject<{
353
+ label: z.ZodString;
354
+ sources: z.ZodArray<any>;
355
+ pins: any;
356
+ }, z.core.$strict>>>;
357
+ id: z.ZodOptional<z.ZodString>;
358
+ }, z.core.$strict>;
359
+ declare const flowEdgeSchema: z.ZodObject<{
360
+ type: z.ZodDefault<z.ZodLiteral<"flow_edge">>;
361
+ from: z.ZodString;
362
+ to: z.ZodString;
363
+ label: z.ZodOptional<z.ZodString>;
364
+ style: z.ZodOptional<z.ZodEnum<{
365
+ solid: "solid";
366
+ dashed: "dashed";
367
+ }>>;
368
+ id: z.ZodOptional<z.ZodString>;
369
+ }, z.core.$strict>;
370
+ type FlowDiagramNode = z.infer<typeof flowNodeSchema>;
371
+ type FlowDiagramEdge = z.infer<typeof flowEdgeSchema>;
372
+ //#endregion
373
+ //#region src/review-api/blocks/database_lens.d.ts
374
+ interface DatabaseField {
375
+ label: string;
376
+ dataType: string;
377
+ nullable?: boolean;
378
+ primaryKey?: boolean;
379
+ references?: {
380
+ store: string;
381
+ collection: string;
382
+ field: string;
383
+ };
384
+ /** An illustrative value shown beside the field. */
385
+ example?: JsonValue;
386
+ /** Nested fields of a document-store object field. */
387
+ fields?: Record<string, DatabaseField>;
388
+ }
389
+ //#endregion
390
+ //#region src/review-api/blocks/sequence.d.ts
391
+ declare const stepSchema: z.ZodObject<{
392
+ type: z.ZodDefault<z.ZodLiteral<"step">>;
393
+ from: z.ZodString;
394
+ to: z.ZodString;
395
+ label: z.ZodString;
396
+ style: z.ZodDefault<z.ZodEnum<{
397
+ call: "call";
398
+ return: "return";
399
+ async: "async";
400
+ }>>;
401
+ source: any;
402
+ pins: any;
403
+ explanation: z.ZodOptional<z.ZodString>;
404
+ code: z.ZodOptional<z.ZodObject<{
405
+ language: z.ZodDefault<z.ZodString>;
406
+ text: z.ZodString;
407
+ }, z.core.$strict>>;
408
+ id: z.ZodOptional<z.ZodString>;
409
+ }, z.core.$strict>;
410
+ type Step = z.infer<typeof stepSchema>;
411
+ //#endregion
412
+ //#region src/review-api/blocks/callout.d.ts
413
+ interface CalloutBlock {
414
+ id?: string;
415
+ type: "callout";
416
+ title?: string;
417
+ tone: "info" | "warning" | "danger" | "success";
418
+ children: Block[];
419
+ }
420
+ //#endregion
421
+ //#region src/review-api/blocks/section.d.ts
422
+ interface SectionBlock {
423
+ id?: string;
424
+ type: "section";
425
+ title: string;
426
+ defaultCollapsed?: boolean;
427
+ children: Block[];
428
+ }
429
+ //#endregion
430
+ //#region src/tutorial-conversation.d.ts
431
+ declare const tutorialAuthoringConversationSchema: z.ZodObject<{
432
+ version: z.ZodLiteral<1>;
433
+ title: z.ZodString;
434
+ messages: z.ZodArray<z.ZodObject<{
435
+ role: z.ZodEnum<{
436
+ user: "user";
437
+ assistant: "assistant";
438
+ }>;
439
+ body: z.ZodString;
440
+ }, z.core.$strict>>;
441
+ }, z.core.$strict>;
442
+ type TutorialAuthoringConversation = z.infer<typeof tutorialAuthoringConversationSchema>;
443
+ //#endregion
444
+ //#region src/review-api/blocks/tutorial.d.ts
445
+ type TutorialContent = {
446
+ kind: "keymap";
447
+ } | {
448
+ kind: "conversation";
449
+ conversation: TutorialAuthoringConversation;
450
+ } | {
451
+ kind: "view";
452
+ view: "review" | "commits" | "diff" | "map";
453
+ label: string;
454
+ } | {
455
+ kind: "feature";
456
+ feature: "softwareMap";
457
+ children: Block[];
458
+ };
459
+ type TutorialBlock = {
460
+ id?: string;
461
+ type: "tutorial";
462
+ } & TutorialContent;
463
+ //#endregion
464
+ //#region src/review-api/blocks/index.d.ts
465
+ /** Leaf kinds share one discriminated union so unknown types read as they always have. */
466
+ declare const leafSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
467
+ type: z.ZodLiteral<"markdown">;
468
+ id: z.ZodOptional<z.ZodString>;
469
+ markdown: z.ZodString;
470
+ pins: any;
471
+ }, z.core.$strict>, z.ZodObject<{
472
+ type: z.ZodLiteral<"code">;
473
+ id: z.ZodOptional<z.ZodString>;
474
+ caption: z.ZodOptional<z.ZodString>;
475
+ language: z.ZodDefault<z.ZodString>;
476
+ text: z.ZodString;
477
+ }, z.core.$strict>, z.ZodObject<{
478
+ type: z.ZodLiteral<"divider">;
479
+ id: z.ZodOptional<z.ZodString>;
480
+ }, z.core.$strict>, z.ZodObject<{
481
+ type: z.ZodLiteral<"code_peek">;
482
+ id: z.ZodOptional<z.ZodString>;
483
+ source: any;
484
+ pins: any;
485
+ caption: z.ZodOptional<z.ZodString>;
486
+ }, z.core.$strict>, z.ZodObject<{
487
+ type: z.ZodLiteral<"sequence">;
488
+ id: z.ZodOptional<z.ZodString>;
489
+ title: z.ZodString;
490
+ actors: z.ZodRecord<z.ZodString, z.ZodString>;
491
+ steps: z.ZodArray<z.ZodObject<{
492
+ type: z.ZodDefault<z.ZodLiteral<"step">>;
493
+ from: z.ZodString;
494
+ to: z.ZodString;
495
+ label: z.ZodString;
496
+ style: z.ZodDefault<z.ZodEnum<{
497
+ call: "call";
498
+ return: "return";
499
+ async: "async";
500
+ }>>;
501
+ source: any;
502
+ pins: any;
503
+ explanation: z.ZodOptional<z.ZodString>;
504
+ code: z.ZodOptional<z.ZodObject<{
505
+ language: z.ZodDefault<z.ZodString>;
506
+ text: z.ZodString;
507
+ }, z.core.$strict>>;
508
+ id: z.ZodOptional<z.ZodString>;
509
+ }, z.core.$strict>>;
510
+ pins: any;
511
+ }, z.core.$strict>, z.ZodObject<{
512
+ type: z.ZodLiteral<"call_stack_diff">;
513
+ id: z.ZodOptional<z.ZodString>;
514
+ title: z.ZodString;
515
+ base: z.ZodArray<z.ZodObject<{
516
+ key: z.ZodOptional<z.ZodString>;
517
+ parentKey: z.ZodOptional<z.ZodNullable<z.ZodString>>;
518
+ callSite: any;
519
+ source: any;
520
+ contextSources: z.ZodOptional<z.ZodArray<any>>;
521
+ label: z.ZodOptional<z.ZodString>;
522
+ pins: any;
523
+ via: z.ZodOptional<z.ZodObject<{
524
+ kind: z.ZodEnum<{
525
+ call: "call";
526
+ queue: "queue";
527
+ callback: "callback";
528
+ rpc: "rpc";
529
+ }>;
530
+ reason: z.ZodString;
531
+ }, z.core.$strict>>;
532
+ id: z.ZodOptional<z.ZodString>;
533
+ }, z.core.$strict>>;
534
+ head: z.ZodArray<z.ZodObject<{
535
+ key: z.ZodOptional<z.ZodString>;
536
+ parentKey: z.ZodOptional<z.ZodNullable<z.ZodString>>;
537
+ callSite: any;
538
+ source: any;
539
+ contextSources: z.ZodOptional<z.ZodArray<any>>;
540
+ label: z.ZodOptional<z.ZodString>;
541
+ pins: any;
542
+ via: z.ZodOptional<z.ZodObject<{
543
+ kind: z.ZodEnum<{
544
+ call: "call";
545
+ queue: "queue";
546
+ callback: "callback";
547
+ rpc: "rpc";
548
+ }>;
549
+ reason: z.ZodString;
550
+ }, z.core.$strict>>;
551
+ id: z.ZodOptional<z.ZodString>;
552
+ }, z.core.$strict>>;
553
+ pins: any;
554
+ }, z.core.$strict>, z.ZodObject<{
555
+ type: z.ZodLiteral<"database_lens">;
556
+ id: z.ZodOptional<z.ZodString>;
557
+ title: z.ZodString;
558
+ actors: z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
559
+ label: z.ZodString;
560
+ softwareMapPath: z.ZodOptional<z.ZodString>;
561
+ }, z.core.$strict>]>>;
562
+ stores: z.ZodRecord<z.ZodString, z.ZodObject<{
563
+ label: z.ZodString;
564
+ storage: z.ZodEnum<{
565
+ document: "document";
566
+ relational: "relational";
567
+ }>;
568
+ dataStoreKind: z.ZodOptional<z.ZodEnum<{
569
+ database: "database";
570
+ objectStore: "objectStore";
571
+ bucket: "bucket";
572
+ artifactStore: "artifactStore";
573
+ fileStore: "fileStore";
574
+ }>>;
575
+ softwareMapPath: z.ZodOptional<z.ZodString>;
576
+ collections: z.ZodRecord<z.ZodString, z.ZodObject<{
577
+ label: z.ZodString;
578
+ key: z.ZodOptional<z.ZodString>;
579
+ fields: z.ZodRecord<z.ZodString, z.ZodType<DatabaseField, unknown, z.core.$ZodTypeInternals<DatabaseField, unknown>>>;
580
+ }, z.core.$strict>>;
581
+ }, z.core.$strict>>;
582
+ useCases: z.ZodArray<z.ZodObject<{
583
+ label: z.ZodString;
584
+ summary: z.ZodOptional<z.ZodString>;
585
+ operations: z.ZodArray<z.ZodObject<{
586
+ kind: z.ZodEnum<{
587
+ read: "read";
588
+ write: "write";
589
+ }>;
590
+ store: z.ZodString;
591
+ collection: z.ZodString;
592
+ field: z.ZodOptional<z.ZodString>;
593
+ actor: z.ZodString;
594
+ label: z.ZodString;
595
+ detail: z.ZodOptional<z.ZodString>;
596
+ source: any;
597
+ pins: any;
598
+ id: z.ZodOptional<z.ZodString>;
599
+ }, z.core.$strict>>;
600
+ id: z.ZodOptional<z.ZodString>;
601
+ }, z.core.$strict>>;
602
+ pins: any;
603
+ }, z.core.$strict>, z.ZodObject<{
604
+ type: z.ZodLiteral<"image">;
605
+ id: z.ZodOptional<z.ZodString>;
606
+ assetId: z.ZodString;
607
+ alt: z.ZodString;
608
+ caption: z.ZodOptional<z.ZodString>;
609
+ }, z.core.$strict>, z.ZodObject<{
610
+ type: z.ZodLiteral<"trace_quote">;
611
+ id: z.ZodOptional<z.ZodString>;
612
+ traceId: z.ZodString;
613
+ eventId: z.ZodString;
614
+ text: z.ZodString;
615
+ }, z.core.$strict>, z.ZodObject<{
616
+ type: z.ZodLiteral<"software_map">;
617
+ id: z.ZodOptional<z.ZodString>;
618
+ mapVersionId: z.ZodString;
619
+ focusElementId: z.ZodOptional<z.ZodString>;
620
+ }, z.core.$strict>, z.ZodObject<{
621
+ type: z.ZodLiteral<"flow_diagram">;
622
+ id: z.ZodOptional<z.ZodString>;
623
+ title: z.ZodString;
624
+ description: z.ZodOptional<z.ZodString>;
625
+ direction: z.ZodOptional<z.ZodEnum<{
626
+ right: "right";
627
+ down: "down";
628
+ }>>;
629
+ nodes: z.ZodArray<z.ZodObject<{
630
+ type: z.ZodDefault<z.ZodLiteral<"flow_node">>;
631
+ key: z.ZodString;
632
+ label: z.ZodString;
633
+ description: z.ZodOptional<z.ZodString>;
634
+ kind: z.ZodOptional<z.ZodEnum<{
635
+ process: "process";
636
+ decision: "decision";
637
+ terminal: "terminal";
638
+ }>>;
639
+ attachments: z.ZodDefault<z.ZodArray<z.ZodObject<{
640
+ label: z.ZodString;
641
+ sources: z.ZodArray<any>;
642
+ pins: any;
643
+ }, z.core.$strict>>>;
644
+ id: z.ZodOptional<z.ZodString>;
645
+ }, z.core.$strict>>;
646
+ edges: z.ZodArray<z.ZodObject<{
647
+ type: z.ZodDefault<z.ZodLiteral<"flow_edge">>;
648
+ from: z.ZodString;
649
+ to: z.ZodString;
650
+ label: z.ZodOptional<z.ZodString>;
651
+ style: z.ZodOptional<z.ZodEnum<{
652
+ solid: "solid";
653
+ dashed: "dashed";
654
+ }>>;
655
+ id: z.ZodOptional<z.ZodString>;
656
+ }, z.core.$strict>>;
657
+ pins: any;
658
+ }, z.core.$strict>], "type">;
659
+ type LeafBlock = z.infer<typeof leafSchema>;
660
+ type Block = LeafBlock | SectionBlock | CalloutBlock | TutorialBlock;
661
+ //#endregion
662
+ //#region src/review-api/diff-lenses.d.ts
663
+ declare const lensSchema: z.ZodObject<{
664
+ id: z.ZodString;
665
+ title: z.ZodString;
666
+ targets: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
667
+ kind: z.ZodLiteral<"files">;
668
+ patterns: z.ZodArray<z.ZodString>;
669
+ }, z.core.$strict>, z.ZodObject<{
670
+ kind: z.ZodLiteral<"ranges">;
671
+ sources: z.ZodArray<any>;
672
+ }, z.core.$strict>], "kind">>;
673
+ }, z.core.$strict>;
674
+ type Lens = z.infer<typeof lensSchema>;
675
+ //#endregion
676
+ //#region src/review-api/document.d.ts
677
+ declare const pinsSchema: z.ZodObject<{
678
+ repositoryId: z.ZodString;
679
+ base: z.ZodString;
680
+ head: z.ZodString;
681
+ }, z.core.$strict>;
682
+ /** Source identity retained internally for a saved worktree generation. */
683
+ /** worktreeRevision is a refresh token, never an address for stored source. */
684
+ type Pins = z.infer<typeof pinsSchema> & {
685
+ worktreeRevision?: string;
686
+ };
687
+ declare const reviewTargetSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
688
+ kind: z.ZodLiteral<"worktree">;
689
+ repositoryId: z.ZodString;
690
+ base: z.ZodOptional<z.ZodString>;
691
+ }, z.core.$strict>, z.ZodObject<{
692
+ kind: z.ZodLiteral<"commits">;
693
+ repositoryId: z.ZodString;
694
+ head: z.ZodString;
695
+ base: z.ZodOptional<z.ZodString>;
696
+ }, z.core.$strict>], "kind">;
697
+ type ReviewTarget = z.infer<typeof reviewTargetSchema>;
698
+ /** Everything with an id: blocks, and the units diagrams are drawn from. */
699
+ type Element = Block | Step | FlowDiagramNode | FlowDiagramEdge;
700
+ /** A diagram unit: addressed on its own, but only ever inside its diagram. */
701
+ type Unit = Step | FlowDiagramNode | FlowDiagramEdge;
702
+ declare const editSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
703
+ parentId: z.ZodOptional<z.ZodString>;
704
+ afterId: z.ZodOptional<z.ZodString>;
705
+ type: z.ZodLiteral<"insert">;
706
+ content: z.ZodDiscriminatedUnion<[z.ZodDiscriminatedUnion<[z.ZodObject<{
707
+ type: z.ZodLiteral<"markdown">;
708
+ id: z.ZodOptional<z.ZodString>;
709
+ markdown: z.ZodString;
710
+ pins: any;
711
+ }, z.core.$strict>, z.ZodObject<{
712
+ type: z.ZodLiteral<"code">;
713
+ id: z.ZodOptional<z.ZodString>;
714
+ caption: z.ZodOptional<z.ZodString>;
715
+ language: z.ZodDefault<z.ZodString>;
716
+ text: z.ZodString;
717
+ }, z.core.$strict>, z.ZodObject<{
718
+ type: z.ZodLiteral<"divider">;
719
+ id: z.ZodOptional<z.ZodString>;
720
+ }, z.core.$strict>, z.ZodObject<{
721
+ type: z.ZodLiteral<"code_peek">;
722
+ id: z.ZodOptional<z.ZodString>;
723
+ source: any;
724
+ pins: any;
725
+ caption: z.ZodOptional<z.ZodString>;
726
+ }, z.core.$strict>, z.ZodObject<{
727
+ type: z.ZodLiteral<"sequence">;
728
+ id: z.ZodOptional<z.ZodString>;
729
+ title: z.ZodString;
730
+ actors: z.ZodRecord<z.ZodString, z.ZodString>;
731
+ steps: z.ZodArray<z.ZodObject<{
732
+ type: z.ZodDefault<z.ZodLiteral<"step">>;
733
+ from: z.ZodString;
734
+ to: z.ZodString;
735
+ label: z.ZodString;
736
+ style: z.ZodDefault<z.ZodEnum<{
737
+ call: "call";
738
+ return: "return";
739
+ async: "async";
740
+ }>>;
741
+ source: any;
742
+ pins: any;
743
+ explanation: z.ZodOptional<z.ZodString>;
744
+ code: z.ZodOptional<z.ZodObject<{
745
+ language: z.ZodDefault<z.ZodString>;
746
+ text: z.ZodString;
747
+ }, z.core.$strict>>;
748
+ id: z.ZodOptional<z.ZodString>;
749
+ }, z.core.$strict>>;
750
+ pins: any;
751
+ }, z.core.$strict>, z.ZodObject<{
752
+ type: z.ZodLiteral<"call_stack_diff">;
753
+ id: z.ZodOptional<z.ZodString>;
754
+ title: z.ZodString;
755
+ base: z.ZodArray<z.ZodObject<{
756
+ key: z.ZodOptional<z.ZodString>;
757
+ parentKey: z.ZodOptional<z.ZodNullable<z.ZodString>>;
758
+ callSite: any;
759
+ source: any;
760
+ contextSources: z.ZodOptional<z.ZodArray<any>>;
761
+ label: z.ZodOptional<z.ZodString>;
762
+ pins: any;
763
+ via: z.ZodOptional<z.ZodObject<{
764
+ kind: z.ZodEnum<{
765
+ call: "call";
766
+ queue: "queue";
767
+ callback: "callback";
768
+ rpc: "rpc";
769
+ }>;
770
+ reason: z.ZodString;
771
+ }, z.core.$strict>>;
772
+ id: z.ZodOptional<z.ZodString>;
773
+ }, z.core.$strict>>;
774
+ head: z.ZodArray<z.ZodObject<{
775
+ key: z.ZodOptional<z.ZodString>;
776
+ parentKey: z.ZodOptional<z.ZodNullable<z.ZodString>>;
777
+ callSite: any;
778
+ source: any;
779
+ contextSources: z.ZodOptional<z.ZodArray<any>>;
780
+ label: z.ZodOptional<z.ZodString>;
781
+ pins: any;
782
+ via: z.ZodOptional<z.ZodObject<{
783
+ kind: z.ZodEnum<{
784
+ call: "call";
785
+ queue: "queue";
786
+ callback: "callback";
787
+ rpc: "rpc";
788
+ }>;
789
+ reason: z.ZodString;
790
+ }, z.core.$strict>>;
791
+ id: z.ZodOptional<z.ZodString>;
792
+ }, z.core.$strict>>;
793
+ pins: any;
794
+ }, z.core.$strict>, z.ZodObject<{
795
+ type: z.ZodLiteral<"database_lens">;
796
+ id: z.ZodOptional<z.ZodString>;
797
+ title: z.ZodString;
798
+ actors: z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
799
+ label: z.ZodString;
800
+ softwareMapPath: z.ZodOptional<z.ZodString>;
801
+ }, z.core.$strict>]>>;
802
+ stores: z.ZodRecord<z.ZodString, z.ZodObject<{
803
+ label: z.ZodString;
804
+ storage: z.ZodEnum<{
805
+ document: "document";
806
+ relational: "relational";
807
+ }>;
808
+ dataStoreKind: z.ZodOptional<z.ZodEnum<{
809
+ database: "database";
810
+ objectStore: "objectStore";
811
+ bucket: "bucket";
812
+ artifactStore: "artifactStore";
813
+ fileStore: "fileStore";
814
+ }>>;
815
+ softwareMapPath: z.ZodOptional<z.ZodString>;
816
+ collections: z.ZodRecord<z.ZodString, z.ZodObject<{
817
+ label: z.ZodString;
818
+ key: z.ZodOptional<z.ZodString>;
819
+ fields: z.ZodRecord<z.ZodString, z.ZodType<DatabaseField, unknown, z.core.$ZodTypeInternals<DatabaseField, unknown>>>;
820
+ }, z.core.$strict>>;
821
+ }, z.core.$strict>>;
822
+ useCases: z.ZodArray<z.ZodObject<{
823
+ label: z.ZodString;
824
+ summary: z.ZodOptional<z.ZodString>;
825
+ operations: z.ZodArray<z.ZodObject<{
826
+ kind: z.ZodEnum<{
827
+ read: "read";
828
+ write: "write";
829
+ }>;
830
+ store: z.ZodString;
831
+ collection: z.ZodString;
832
+ field: z.ZodOptional<z.ZodString>;
833
+ actor: z.ZodString;
834
+ label: z.ZodString;
835
+ detail: z.ZodOptional<z.ZodString>;
836
+ source: any;
837
+ pins: any;
838
+ id: z.ZodOptional<z.ZodString>;
839
+ }, z.core.$strict>>;
840
+ id: z.ZodOptional<z.ZodString>;
841
+ }, z.core.$strict>>;
842
+ pins: any;
843
+ }, z.core.$strict>, z.ZodObject<{
844
+ type: z.ZodLiteral<"image">;
845
+ id: z.ZodOptional<z.ZodString>;
846
+ assetId: z.ZodString;
847
+ alt: z.ZodString;
848
+ caption: z.ZodOptional<z.ZodString>;
849
+ }, z.core.$strict>, z.ZodObject<{
850
+ type: z.ZodLiteral<"trace_quote">;
851
+ id: z.ZodOptional<z.ZodString>;
852
+ traceId: z.ZodString;
853
+ eventId: z.ZodString;
854
+ text: z.ZodString;
855
+ }, z.core.$strict>, z.ZodObject<{
856
+ type: z.ZodLiteral<"software_map">;
857
+ id: z.ZodOptional<z.ZodString>;
858
+ mapVersionId: z.ZodString;
859
+ focusElementId: z.ZodOptional<z.ZodString>;
860
+ }, z.core.$strict>, z.ZodObject<{
861
+ type: z.ZodLiteral<"flow_diagram">;
862
+ id: z.ZodOptional<z.ZodString>;
863
+ title: z.ZodString;
864
+ description: z.ZodOptional<z.ZodString>;
865
+ direction: z.ZodOptional<z.ZodEnum<{
866
+ right: "right";
867
+ down: "down";
868
+ }>>;
869
+ nodes: z.ZodArray<z.ZodObject<{
870
+ type: z.ZodDefault<z.ZodLiteral<"flow_node">>;
871
+ key: z.ZodString;
872
+ label: z.ZodString;
873
+ description: z.ZodOptional<z.ZodString>;
874
+ kind: z.ZodOptional<z.ZodEnum<{
875
+ process: "process";
876
+ decision: "decision";
877
+ terminal: "terminal";
878
+ }>>;
879
+ attachments: z.ZodDefault<z.ZodArray<z.ZodObject<{
880
+ label: z.ZodString;
881
+ sources: z.ZodArray<any>;
882
+ pins: any;
883
+ }, z.core.$strict>>>;
884
+ id: z.ZodOptional<z.ZodString>;
885
+ }, z.core.$strict>>;
886
+ edges: z.ZodArray<z.ZodObject<{
887
+ type: z.ZodDefault<z.ZodLiteral<"flow_edge">>;
888
+ from: z.ZodString;
889
+ to: z.ZodString;
890
+ label: z.ZodOptional<z.ZodString>;
891
+ style: z.ZodOptional<z.ZodEnum<{
892
+ solid: "solid";
893
+ dashed: "dashed";
894
+ }>>;
895
+ id: z.ZodOptional<z.ZodString>;
896
+ }, z.core.$strict>>;
897
+ pins: any;
898
+ }, z.core.$strict>], "type">, z.ZodObject<{
899
+ type: z.ZodLiteral<"section">;
900
+ id: z.ZodOptional<z.ZodString>;
901
+ title: z.ZodString;
902
+ defaultCollapsed: z.ZodOptional<z.ZodBoolean>;
903
+ children: z.ZodArray<z.ZodLazy<z.ZodType<Block, unknown, z.core.$ZodTypeInternals<Block, unknown>>>>;
904
+ }, z.core.$strict>, z.ZodObject<{
905
+ type: z.ZodLiteral<"callout">;
906
+ id: z.ZodOptional<z.ZodString>;
907
+ title: z.ZodOptional<z.ZodString>;
908
+ tone: z.ZodDefault<z.ZodEnum<{
909
+ success: "success";
910
+ info: "info";
911
+ warning: "warning";
912
+ danger: "danger";
913
+ }>>;
914
+ children: z.ZodArray<z.ZodLazy<z.ZodType<Block, unknown, z.core.$ZodTypeInternals<Block, unknown>>>>;
915
+ }, z.core.$strict>, z.ZodDiscriminatedUnion<[z.ZodObject<{
916
+ type: z.ZodLiteral<"tutorial">;
917
+ id: z.ZodOptional<z.ZodString>;
918
+ kind: z.ZodLiteral<"keymap">;
919
+ }, z.core.$strict>, z.ZodObject<{
920
+ type: z.ZodLiteral<"tutorial">;
921
+ id: z.ZodOptional<z.ZodString>;
922
+ kind: z.ZodLiteral<"conversation">;
923
+ conversation: any;
924
+ }, z.core.$strict>, z.ZodObject<{
925
+ type: z.ZodLiteral<"tutorial">;
926
+ id: z.ZodOptional<z.ZodString>;
927
+ kind: z.ZodLiteral<"view">;
928
+ view: z.ZodEnum<{
929
+ map: "map";
930
+ commits: "commits";
931
+ review: "review";
932
+ diff: "diff";
933
+ }>;
934
+ label: z.ZodString;
935
+ }, z.core.$strict>, z.ZodObject<{
936
+ type: z.ZodLiteral<"tutorial">;
937
+ id: z.ZodOptional<z.ZodString>;
938
+ kind: z.ZodLiteral<"feature">;
939
+ feature: z.ZodLiteral<"softwareMap">;
940
+ children: z.ZodArray<z.ZodLazy<z.ZodType<Block, unknown, z.core.$ZodTypeInternals<Block, unknown>>>>;
941
+ }, z.core.$strict>], "kind">, z.ZodObject<{
942
+ type: z.ZodDefault<z.ZodLiteral<"step">>;
943
+ from: z.ZodString;
944
+ to: z.ZodString;
945
+ label: z.ZodString;
946
+ style: z.ZodDefault<z.ZodEnum<{
947
+ call: "call";
948
+ return: "return";
949
+ async: "async";
950
+ }>>;
951
+ source: any;
952
+ pins: any;
953
+ explanation: z.ZodOptional<z.ZodString>;
954
+ code: z.ZodOptional<z.ZodObject<{
955
+ language: z.ZodDefault<z.ZodString>;
956
+ text: z.ZodString;
957
+ }, z.core.$strict>>;
958
+ id: z.ZodOptional<z.ZodString>;
959
+ }, z.core.$strict>, z.ZodObject<{
960
+ type: z.ZodDefault<z.ZodLiteral<"flow_node">>;
961
+ key: z.ZodString;
962
+ label: z.ZodString;
963
+ description: z.ZodOptional<z.ZodString>;
964
+ kind: z.ZodOptional<z.ZodEnum<{
965
+ process: "process";
966
+ decision: "decision";
967
+ terminal: "terminal";
968
+ }>>;
969
+ attachments: z.ZodDefault<z.ZodArray<z.ZodObject<{
970
+ label: z.ZodString;
971
+ sources: z.ZodArray<any>;
972
+ pins: any;
973
+ }, z.core.$strict>>>;
974
+ id: z.ZodOptional<z.ZodString>;
975
+ link: z.ZodOptional<z.ZodObject<{
976
+ from: z.ZodOptional<z.ZodString>;
977
+ to: z.ZodOptional<z.ZodString>;
978
+ label: z.ZodOptional<z.ZodString>;
979
+ style: z.ZodOptional<z.ZodEnum<{
980
+ solid: "solid";
981
+ dashed: "dashed";
982
+ }>>;
983
+ }, z.core.$strict>>;
984
+ }, z.core.$strict>, z.ZodObject<{
985
+ type: z.ZodDefault<z.ZodLiteral<"flow_edge">>;
986
+ from: z.ZodString;
987
+ to: z.ZodString;
988
+ label: z.ZodOptional<z.ZodString>;
989
+ style: z.ZodOptional<z.ZodEnum<{
990
+ solid: "solid";
991
+ dashed: "dashed";
992
+ }>>;
993
+ id: z.ZodOptional<z.ZodString>;
994
+ }, z.core.$strict>], "type">;
995
+ }, z.core.$strict>, z.ZodObject<{
996
+ type: z.ZodLiteral<"replace">;
997
+ targetId: z.ZodString;
998
+ content: z.ZodType<Block, unknown, z.core.$ZodTypeInternals<Block, unknown>>;
999
+ }, z.core.$strict>, z.ZodObject<{
1000
+ type: z.ZodLiteral<"update">;
1001
+ targetId: z.ZodString;
1002
+ changes: z.ZodRecord<z.ZodString, z.ZodJSONSchema>;
1003
+ }, z.core.$strict>, z.ZodObject<{
1004
+ parentId: z.ZodOptional<z.ZodString>;
1005
+ afterId: z.ZodOptional<z.ZodString>;
1006
+ type: z.ZodLiteral<"move">;
1007
+ targetId: z.ZodString;
1008
+ }, z.core.$strict>, z.ZodObject<{
1009
+ type: z.ZodLiteral<"remove">;
1010
+ targetId: z.ZodString;
1011
+ }, z.core.$strict>], "type">;
1012
+ type Edit = z.infer<typeof editSchema>;
1013
+ /**
1014
+ * What one saved version did, for a canvas drawing the document as the
1015
+ * agent writes it: the edit's kind, the element it landed on, and the block
1016
+ * that element belongs to (itself, for a block; its diagram, for a unit).
1017
+ */
1018
+ interface EditSummary {
1019
+ type: Edit["type"];
1020
+ targetId: string;
1021
+ /** For a lens, the lens itself. */
1022
+ blockId: string;
1023
+ /** What the target is: a block type, a unit type, or a Diff-view lens. */
1024
+ kind: Element["type"] | "lens";
1025
+ unit?: Unit["type"];
1026
+ /** The edge a new flow node arrived with, drawn right after the node. */
1027
+ linkId?: string;
1028
+ /** An update's patched fields, so the canvas can draw only what changed. */
1029
+ fields?: string[];
1030
+ /** A diagram written whole: its units in the order a hand would draw
1031
+ * them, so the canvas can trace the whole diagram in one quick pass. */
1032
+ units?: string[];
1033
+ /** The agent whose courier draws this edit, when the host could tell. */
1034
+ activityId?: string;
1035
+ }
1036
+ /** A component an edit wrote, named so the author can address it. */
1037
+ interface WrittenComponent {
1038
+ id: string;
1039
+ type: Element["type"];
1040
+ }
1041
+ //#endregion
1042
+ //#region src/review-api/comparison-coverage.d.ts
1043
+ type CoverageMode = "structural" | "textual";
1044
+ interface ComparisonCoverage {
1045
+ files: CoverageFile$1[];
1046
+ fileSources: Map<string, FileLineRange[]>;
1047
+ alignments: Map<string, readonly AlignmentRow$1[]>;
1048
+ }
1049
+ //#endregion
1050
+ //#region src/review-api/pull-request.d.ts
1051
+ /** Runs one subprocess and resolves its stdout; rejects on failure or timeout. */
1052
+ type RunCommand = (file: string, args: string[], options: {
1053
+ cwd?: string;
1054
+ timeoutMs: number;
1055
+ }) => Promise<string>;
1056
+ interface PullRequestDeps {
1057
+ run: RunCommand;
1058
+ fetch: typeof fetch;
1059
+ }
1060
+ //#endregion
1061
+ //#region src/review-api/activity.d.ts
1062
+ declare const focusSchema: z.ZodObject<{
1063
+ description: z.ZodString;
1064
+ targetId: z.ZodOptional<z.ZodString>;
1065
+ }, z.core.$strict>;
1066
+ /** Which page an agent last wrote on, so the app knows where its courier is. */
1067
+ type ActivitySurface = "document" | "lenses";
1068
+ type ActivityFocus = z.infer<typeof focusSchema>;
1069
+ /** One agent working on a review. */
1070
+ interface ActivityPresence {
1071
+ activityId: string;
1072
+ /** The agent's color: the lowest slot free when it began, kept until it ends. */
1073
+ slot: number;
1074
+ focus?: ActivityFocus;
1075
+ /** Where it last wrote; absent until its first attributed write. */
1076
+ surface?: ActivitySurface;
1077
+ }
1078
+ interface ActivitySnapshot {
1079
+ /** Live presences. */
1080
+ workingCount: number;
1081
+ /** The latest expiry among live presences. */
1082
+ expiresAt: number | null;
1083
+ /** Each live presence, in the order they began. */
1084
+ activities?: ActivityPresence[];
1085
+ }
1086
+ declare class ReviewActivity {
1087
+ private readonly db;
1088
+ private readonly assertReview?;
1089
+ private readonly timers;
1090
+ private readonly listeners;
1091
+ private readonly working;
1092
+ private readonly workingListeners;
1093
+ constructor(db: DatabaseSync, assertReview?: ((reviewId: string) => void) | undefined);
1094
+ subscribe(listener: (reviewId: string) => void): () => void;
1095
+ /** Fires only when a review starts or stops being authored, never on
1096
+ * renewals or focus changes. */
1097
+ subscribeWorking(listener: () => void): () => void;
1098
+ isWorking(reviewId: string): boolean;
1099
+ private changed;
1100
+ private live;
1101
+ read(reviewId: string): ActivitySnapshot;
1102
+ /** Inside the caller's write transaction: the presence a write belongs to,
1103
+ * renewed and moved to the write's surface. The named one if it is live;
1104
+ * otherwise, with none named, the review's only presence. A write is never
1105
+ * refused for this. Call `extended` once the transaction commits. */
1106
+ attribute(reviewId: string, surface: ActivitySurface, activityId?: string): string | undefined;
1107
+ /** Move the expiry timer after a committed `attribute`. */
1108
+ extended(reviewId: string): void;
1109
+ update(reviewId: string, value: unknown): ActivitySnapshot & {
1110
+ activityId?: string;
1111
+ };
1112
+ /** One timer per review, for its soonest-expiring presence. */
1113
+ private scheduleExpiry;
1114
+ /** Called when another database connection commits session changes. */
1115
+ refresh(): void;
1116
+ /** The store deletes the session atomically with its review before notifying. */
1117
+ deleted(reviewId: string): void;
1118
+ close(): void;
1119
+ }
1120
+ //#endregion
1121
+ //#region src/ask/thread-state.d.ts
1122
+ declare const askAgentIds: readonly ["claude", "codex", "cursor", "opencode", "pi"];
1123
+ type AskAgentId = (typeof askAgentIds)[number];
1124
+ declare const askEntrySchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
1125
+ kind: z.ZodLiteral<"user">;
1126
+ id: z.ZodString;
1127
+ text: z.ZodString;
1128
+ at: z.ZodOptional<z.ZodNumber>;
1129
+ attachments: z.ZodOptional<z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
1130
+ kind: z.ZodLiteral<"file">;
1131
+ path: z.ZodString;
1132
+ }, z.core.$strip>, z.ZodObject<{
1133
+ kind: z.ZodLiteral<"image">;
1134
+ name: z.ZodString;
1135
+ }, z.core.$strip>], "kind">>>;
1136
+ }, z.core.$strip>, z.ZodObject<{
1137
+ kind: z.ZodLiteral<"agent">;
1138
+ id: z.ZodString;
1139
+ text: z.ZodString;
1140
+ }, z.core.$strip>, z.ZodObject<{
1141
+ kind: z.ZodLiteral<"tool">;
1142
+ id: z.ZodString;
1143
+ title: z.ZodString;
1144
+ toolKind: z.ZodString;
1145
+ status: z.ZodEnum<{
1146
+ pending: "pending";
1147
+ in_progress: "in_progress";
1148
+ completed: "completed";
1149
+ failed: "failed";
1150
+ }>;
1151
+ input: z.ZodOptional<z.ZodString>;
1152
+ summary: z.ZodOptional<z.ZodString>;
1153
+ output: z.ZodOptional<z.ZodString>;
1154
+ }, z.core.$strip>, z.ZodObject<{
1155
+ kind: z.ZodLiteral<"permission">;
1156
+ id: z.ZodString;
1157
+ title: z.ZodString;
1158
+ toolKind: z.ZodString;
1159
+ input: z.ZodOptional<z.ZodString>;
1160
+ options: z.ZodArray<z.ZodObject<{
1161
+ optionId: z.ZodString;
1162
+ name: z.ZodString;
1163
+ kind: z.ZodEnum<{
1164
+ allow_once: "allow_once";
1165
+ allow_always: "allow_always";
1166
+ reject_once: "reject_once";
1167
+ reject_always: "reject_always";
1168
+ }>;
1169
+ }, z.core.$strip>>;
1170
+ outcome: z.ZodOptional<z.ZodString>;
1171
+ automatic: z.ZodOptional<z.ZodBoolean>;
1172
+ }, z.core.$strip>, z.ZodObject<{
1173
+ kind: z.ZodLiteral<"notice">;
1174
+ id: z.ZodString;
1175
+ severity: z.ZodString;
1176
+ title: z.ZodString;
1177
+ description: z.ZodOptional<z.ZodString>;
1178
+ }, z.core.$strip>], "kind">;
1179
+ /** What an agent offers before anything is asked of it, as it last said. */
1180
+ declare const askOfferSchema: z.ZodObject<{
1181
+ choices: z.ZodObject<{
1182
+ model: z.ZodOptional<z.ZodObject<{
1183
+ current: z.ZodString;
1184
+ options: z.ZodArray<z.ZodObject<{
1185
+ value: z.ZodString;
1186
+ name: z.ZodString;
1187
+ description: z.ZodOptional<z.ZodString>;
1188
+ }, z.core.$strip>>;
1189
+ }, z.core.$strip>>;
1190
+ effort: z.ZodOptional<z.ZodObject<{
1191
+ current: z.ZodString;
1192
+ options: z.ZodArray<z.ZodObject<{
1193
+ value: z.ZodString;
1194
+ name: z.ZodString;
1195
+ description: z.ZodOptional<z.ZodString>;
1196
+ }, z.core.$strip>>;
1197
+ }, z.core.$strip>>;
1198
+ }, z.core.$strip>;
1199
+ commands: z.ZodOptional<z.ZodArray<z.ZodObject<{
1200
+ name: z.ZodString;
1201
+ description: z.ZodString;
1202
+ hint: z.ZodOptional<z.ZodString>;
1203
+ }, z.core.$strip>>>;
1204
+ accepts: z.ZodOptional<z.ZodObject<{
1205
+ image: z.ZodBoolean;
1206
+ }, z.core.$strip>>;
1207
+ }, z.core.$strip>;
1208
+ type AskOffer = z.infer<typeof askOfferSchema>;
1209
+ type AskEntry = z.infer<typeof askEntrySchema>;
1210
+ /** A saved conversation, as the history list shows it. The transcript stays
1211
+ * with the agent; Whiteboard keeps what it needs to find and reopen it. */
1212
+ declare const askHistoryEntrySchema: z.ZodObject<{
1213
+ id: z.ZodString;
1214
+ agent: z.ZodEnum<{
1215
+ claude: "claude";
1216
+ codex: "codex";
1217
+ cursor: "cursor";
1218
+ opencode: "opencode";
1219
+ pi: "pi";
1220
+ }>;
1221
+ title: z.ZodString;
1222
+ question: z.ZodOptional<z.ZodString>;
1223
+ selection: any;
1224
+ head: z.ZodString;
1225
+ createdAt: z.ZodString;
1226
+ updatedAt: z.ZodString;
1227
+ }, z.core.$strip>;
1228
+ type AskHistoryEntry = z.infer<typeof askHistoryEntrySchema>;
1229
+ //#endregion
1230
+ //#region src/review-api/ask-history.d.ts
1231
+ /** A saved Ask conversation: its history entry, and how to reopen it. */
1232
+ declare const askRecordSchema: any;
1233
+ type AskRecord = z.infer<typeof askRecordSchema>;
1234
+ /** Saved Ask conversations, per review. Shared reviews are not in
1235
+ * `reviews`, so there is no foreign key; deleting a review deletes its rows. */
1236
+ declare class AskHistory {
1237
+ private readonly db;
1238
+ constructor(db: DatabaseSync);
1239
+ save(record: AskRecord): void;
1240
+ /** Whether reopening the conversation bypasses permissions. */
1241
+ setBypass(id: string, bypass: boolean): void;
1242
+ /** Points a conversation at a new session, when its agent could not
1243
+ * reopen the one it had. */
1244
+ updateSession(id: string, sessionId: string): void;
1245
+ /** Keeps what the panel shows, so a reopen need not wait on the agent. */
1246
+ saveEntries(id: string, entries: AskEntry[]): void;
1247
+ /** The agent's name for the conversation, which the list shows. */
1248
+ rename(id: string, title: string): void;
1249
+ saveOffer(agent: AskAgentId, offer: AskOffer): void;
1250
+ /** Keeps what the agent offers with the offer's model, without making
1251
+ * it what the agent offered last. */
1252
+ saveModelOffer(agent: AskAgentId, offer: AskOffer): void;
1253
+ /** What the agent offered last, or last with the model given. */
1254
+ offer(agent: AskAgentId, model?: string): AskOffer | undefined;
1255
+ touch(id: string, at?: string): void;
1256
+ /** Newest first. */
1257
+ list(reviewId: string): AskHistoryEntry[];
1258
+ get(id: string): AskRecord | undefined;
1259
+ delete(id: string): void;
1260
+ }
1261
+ //#endregion
1262
+ //#region src/review-api/store.d.ts
1263
+ /** Source identity displayed in the review header and Home, alongside immutable pins. */
1264
+ interface SnapshotOrigin {
1265
+ /** Managed tutorial; readable by ID but excluded from the user catalog. */
1266
+ tutorial?: boolean;
1267
+ branch?: string;
1268
+ baseRef?: string;
1269
+ pullRequestNumber?: number;
1270
+ pullRequestUrl?: string;
1271
+ /** The legacy review revision this version was imported from. */
1272
+ revision?: string;
1273
+ }
1274
+ interface Snapshot {
1275
+ shared?: {
1276
+ login?: string;
1277
+ sharedAt?: number;
1278
+ cloneUrl?: string;
1279
+ };
1280
+ reviewId: string;
1281
+ version: number;
1282
+ title: string;
1283
+ /** Absent for a review. The scratchpad has no pins, target or lifecycle. */
1284
+ kind?: "scratchpad";
1285
+ /** The default pins for references that name none. A document whose
1286
+ * references all carry their own pins has neither pins nor target. */
1287
+ pins?: Pins;
1288
+ target?: ReviewTarget;
1289
+ staleSources?: string[];
1290
+ sourceUnavailable?: boolean;
1291
+ document: Block[];
1292
+ /** The Diff view's lenses, beside the document and versioned with it.
1293
+ * Absent on a version with none. */
1294
+ lenses?: Lens[];
1295
+ createdAt: string;
1296
+ origin?: SnapshotOrigin;
1297
+ /** The edit that produced this version, when one did; absent for a
1298
+ * rename, set_target, restore or import, which the canvas does not draw. */
1299
+ lastEdit?: EditSummary;
1300
+ }
1301
+ interface Result {
1302
+ /** Create only: false when an existing review for the same PR came back. */
1303
+ created?: boolean;
1304
+ /** Why an existing review came back, and what to do next, in words. */
1305
+ note?: string;
1306
+ reviewId: string;
1307
+ version: number;
1308
+ /** The existing review's stored target; the requested one is not applied. */
1309
+ target?: ReviewTarget;
1310
+ /** The requested head differs from the existing review's. */
1311
+ headMoved?: boolean;
1312
+ /** An agent is working on the existing review. */
1313
+ working?: boolean;
1314
+ /** Older reviews that also name the PR, newest first. */
1315
+ otherReviewIds?: string[];
1316
+ /** The component an edit landed on, its type, and — for an insert or
1317
+ * replace — its first-level children with their fresh IDs. */
1318
+ targetId?: string;
1319
+ type?: Element["type"] | "lens";
1320
+ children?: WrittenComponent[];
1321
+ attention?: true;
1322
+ deleted?: true;
1323
+ warnings?: string[];
1324
+ }
1325
+ /** A PR's current comparison: GitHub's head and diff base, fetched locally. */
1326
+ interface ResolvedPullRequest {
1327
+ target: ReviewTarget;
1328
+ pins: Pins;
1329
+ title: string;
1330
+ }
1331
+ interface ReviewProviders {
1332
+ headBranch?(pins: Pins, headRef?: string): Promise<string | undefined>;
1333
+ projectSource?(snapshot: Snapshot, pins: Pins): Promise<Snapshot>;
1334
+ /** Fetch a PR into a registered checkout: the named one, else the first
1335
+ * preferred one that still matches, else any whose remote is the PR's. */
1336
+ resolvePullRequest?(url: string, repository: {
1337
+ id?: string;
1338
+ preferred?: string;
1339
+ }): Promise<ResolvedPullRequest>;
1340
+ resolveTarget?(target: ReviewTarget, pinned?: Pins): Promise<{
1341
+ target: ReviewTarget;
1342
+ pins: Pins;
1343
+ }>;
1344
+ /** Rejects with a 404 ReviewInputError when the snapshot's checkout is gone.
1345
+ * Resolves undefined for a document without default pins. */
1346
+ sourcePins?(snapshot: Snapshot): Promise<Pins | undefined>;
1347
+ /** Ids of references whose own pins no longer name a usable checkout. */
1348
+ unavailableAnchors?(snapshot: Snapshot): Promise<string[]>;
1349
+ validatePins(pins: Pins): Promise<void>;
1350
+ /** The files each side's commit changed from one set of pins to another,
1351
+ * or undefined when they can't be diffed commit to commit. */
1352
+ filesChangedBetween?(from: Pins, to: Pins): Promise<{
1353
+ base: Set<string>;
1354
+ head: Set<string>;
1355
+ } | undefined>;
1356
+ validateSource(pins: Pins, source: FileLineRange, options: {
1357
+ peek: boolean;
1358
+ }): Promise<void>;
1359
+ validateResource(pins: Pins | undefined, block: Block): Promise<void>;
1360
+ }
1361
+ /** One instance owned by the desktop server. All writers go through execute().
1362
+ * The queue includes async validation; SQLite transactions contain only writes.
1363
+ * This prototype uses a new, explicitly supplied database, never an existing profile.
1364
+ */
1365
+ declare class ReviewStore {
1366
+ private readonly providers;
1367
+ readonly activity: ReviewActivity;
1368
+ readonly askHistory: AskHistory;
1369
+ private readonly db;
1370
+ private pending;
1371
+ private closing;
1372
+ private readonly liveSources;
1373
+ private refreshTimer?;
1374
+ private refreshSubscribers;
1375
+ watchWorktrees(): () => void;
1376
+ private projectLiveSource;
1377
+ private refreshPending;
1378
+ /** Refresh source state without writing authored document versions. Serialized with edits. */
1379
+ refreshWorktrees(): Promise<void>;
1380
+ private readonly listeners;
1381
+ private readonly catalogListeners;
1382
+ private readonly externalChanges;
1383
+ private observedDataVersion;
1384
+ private observedVersions;
1385
+ subscribeCatalog(listener: () => void): () => void;
1386
+ /** For a host whose listing changed without the store: a preference flip. */
1387
+ invalidateCatalog(): void;
1388
+ subscribe(listener: (result: Result) => void): () => void;
1389
+ constructor(databasePath: string, providers: ReviewProviders);
1390
+ private dataVersion;
1391
+ private currentVersions;
1392
+ private refreshExternalChanges;
1393
+ /** Reader progress never creates a document version or authoring event. */
1394
+ viewedCoverage(reviewId: string): Map<string, {
1395
+ fingerprint: string;
1396
+ coverage: Coverage;
1397
+ }>;
1398
+ updateViewedCoverage(reviewId: string, files: {
1399
+ path: string;
1400
+ fingerprint: string;
1401
+ scope: Coverage;
1402
+ }[], viewed: boolean): void;
1403
+ private readonly repositoryGroups;
1404
+ private repositoryGroup;
1405
+ registerRepository(root: string): {
1406
+ id: string;
1407
+ name: string;
1408
+ };
1409
+ unregisterRepository(id: string): void;
1410
+ /** Registered checkouts, oldest registration first. */
1411
+ repositories(): {
1412
+ id: string;
1413
+ path: string;
1414
+ }[];
1415
+ repositoryPath(id: string): string;
1416
+ putResource(id: string, repositoryId: string, kind: string, mimeType: string, data: Uint8Array): {
1417
+ id: string;
1418
+ kind: string;
1419
+ mimeType: string;
1420
+ };
1421
+ resource(id: string): {
1422
+ id: string;
1423
+ repositoryId: string;
1424
+ kind: string;
1425
+ mimeType: string;
1426
+ data: Uint8Array;
1427
+ };
1428
+ close(): Promise<void>;
1429
+ /** Stable across restarts; the first host on a new store chooses it. */
1430
+ serverId(): string;
1431
+ resetServerId(): string;
1432
+ /** The 404 check alone, without loading a snapshot. */
1433
+ assertExists(id: string): void;
1434
+ read(id: string, version?: number): Snapshot;
1435
+ setDiffStats(pins: Pins, stats: NonNullable<ReviewApiSummary["diffStats"]>, mode?: "structural" | "textual"): void;
1436
+ /** Managed records are discoverable even if their preparation stamp was lost. */
1437
+ tutorialIds(): string[];
1438
+ list(mode?: "structural" | "textual"): ReviewApiSummary[];
1439
+ /** One review's catalog entry, as review_list shows it. */
1440
+ summary(id: string): ReviewApiSummary | undefined;
1441
+ private summaries;
1442
+ /** Local and imported summaries use the same persisted, mode-specific counts. */
1443
+ withDiffStats<T extends ReviewApiSummary>(reviews: T[], mode?: "structural" | "textual"): T[];
1444
+ /** What the pad holds, for its Home card: blocks, and the diagrams among them. */
1445
+ private scratchpadContents;
1446
+ /** The one scratchpad, made on first use. A host that loses the race to
1447
+ * another on the same home finds it made. */
1448
+ ensureScratchpad(): Promise<void>;
1449
+ history(id: string): {
1450
+ version: number;
1451
+ title: string;
1452
+ createdAt: string;
1453
+ }[];
1454
+ inspect(id: string, targetId?: string, version?: number): Element | {
1455
+ id: string | undefined;
1456
+ type: "image" | "code" | "markdown" | "divider" | "code_peek" | "sequence" | "step" | "call_stack_diff" | "database_lens" | "trace_quote" | "software_map" | "flow_diagram" | "flow_node" | "flow_edge" | "section" | "callout" | "tutorial";
1457
+ label: any;
1458
+ }[];
1459
+ /** The host can seed a managed document; transport callers only supply a command. */
1460
+ execute(input: unknown, initial?: {
1461
+ document: Block[];
1462
+ origin: SnapshotOrigin;
1463
+ }): Promise<Result>;
1464
+ /** Resolve a target-less PR create before it queues, when it will need it. */
1465
+ private startPullRequest;
1466
+ /** Reviews whose PR is this one, newest version first. Summaries only. */
1467
+ private reviewsForPullRequest;
1468
+ /** The answer to a create that found its PR's review. Its target stays:
1469
+ * moving it would silently point existing links at different code. */
1470
+ private existingReview;
1471
+ private commitCommand;
1472
+ private assertMutation;
1473
+ private notify;
1474
+ /** Dismissed reviews, as Home lists them; only a restore clears it, not a view. */
1475
+ dismissedIds(): string[];
1476
+ has(reviewId: string): boolean;
1477
+ private validateExternal;
1478
+ }
1479
+ //#endregion
1480
+ //#region src/review-api/workspaces.d.ts
1481
+ interface WorkspaceStatus {
1482
+ id: string;
1483
+ commit: string;
1484
+ rootPath: string | null;
1485
+ generation: string;
1486
+ state: "pending" | "preparing" | "ready" | "unconfigured" | "failed" | "cleanup-failed";
1487
+ log: string;
1488
+ /** Acquisition failed; this can be transient. Optional setup failures are not issues. */
1489
+ issue?: string;
1490
+ }
1491
+ /** Local lifecycle only: source and authored history never depend on preparation.
1492
+ * Status/queue/process lifecycle follows #334, retaining the legacy prepare config
1493
+ * and per-review managed checkout layout instead of a new settings system.
1494
+ */
1495
+ declare class ReviewWorkspaces {
1496
+ private readonly store;
1497
+ private readonly db;
1498
+ private readonly requests;
1499
+ private readonly jobs;
1500
+ private readonly stop;
1501
+ private cleanup;
1502
+ private closed;
1503
+ private readonly ownerId;
1504
+ constructor(databasePath: string, store: ReviewStore);
1505
+ private dismissed?;
1506
+ private readonly releasing;
1507
+ /**
1508
+ * Frees a newly dismissed review's checkouts to save disk. The review itself
1509
+ * stays; reopening it rebuilds them. Checkouts rebuilt by peeking at a
1510
+ * dismissed review are kept until the next startup or dismissal, since
1511
+ * the Desktop's canvas tabs and source windows may still show them.
1512
+ */
1513
+ private releaseDismissed;
1514
+ private repositoryDirs;
1515
+ /** Resolves once no release of the review is pending, so an ensure cannot race it. */
1516
+ released(reviewId: string): Promise<void>;
1517
+ private release;
1518
+ private releaseCheckouts;
1519
+ private external?;
1520
+ private stopExternal?;
1521
+ attachExternalReviews(source: {
1522
+ has(id: string): boolean;
1523
+ subscribe(listener: () => void): () => void;
1524
+ }): void;
1525
+ private hasReview;
1526
+ private assertReview;
1527
+ remove(reviewId: string): Promise<void>;
1528
+ private lease;
1529
+ private leasedElsewhere;
1530
+ /** Takes the review's lease unless another live Desktop holds it. */
1531
+ private claim;
1532
+ private all;
1533
+ private get;
1534
+ private save;
1535
+ private status;
1536
+ list(reviewId: string): WorkspaceStatus[];
1537
+ failures(): WorkspaceStatus[];
1538
+ retryCleanup(id: string): Promise<void>;
1539
+ open(reviewId: string, pins: Pins): Promise<void>;
1540
+ source(reviewId: string, pins: Pins, side: "base" | "head", retryFailed?: boolean): Promise<WorkspaceStatus>;
1541
+ private acquire;
1542
+ private prepare;
1543
+ retry(reviewId: string, id: string): Promise<WorkspaceStatus>;
1544
+ private collect;
1545
+ idle(): Promise<void>;
1546
+ private closing?;
1547
+ close(): Promise<void>;
1548
+ private closeAll;
1549
+ }
1550
+ //#endregion
1551
+ //#region src/review-api/local-data.d.ts
1552
+ /** Local source/resource boundary, including Desktop-only local language context. */
1553
+ declare class LocalReviewData {
1554
+ private readonly store;
1555
+ private readonly options;
1556
+ private readonly workspaceManager?;
1557
+ get workspaces(): ReviewWorkspaces;
1558
+ currentEnvironmentIssues(snapshot: Snapshot): {
1559
+ side: string;
1560
+ message: string;
1561
+ }[];
1562
+ environmentIssues(snapshot: Snapshot, retryFailed?: boolean): Promise<{
1563
+ side: "base" | "head";
1564
+ message: string;
1565
+ }[]>;
1566
+ private readonly untrackedCounts;
1567
+ /**
1568
+ * Untracked files a live worktree review leaves out; undefined otherwise.
1569
+ * Counted once per worktree revision, never by the revision poll, so a
1570
+ * checkout with many untracked files pays for the walk only when read.
1571
+ */
1572
+ untrackedFiles(pins: Pins): Promise<number | undefined>;
1573
+ /** Local checkout context for live worktree targets only. */
1574
+ /** Desktop language services borrow the registered checkout, never create one. */
1575
+ liveFile(repositoryId: string, file: string, text: string): Promise<{
1576
+ localPath: string;
1577
+ localRoot: string;
1578
+ } | undefined>;
1579
+ /** Source bytes and the language workspace have independent lifetimes. */
1580
+ languageEnvironment(snapshot: Snapshot, side: "base" | "head", commit?: string, retryFailed?: boolean, anchor?: SourcePins): Promise<ReviewLanguageEnvironment>;
1581
+ /** Resolve source coordinates after selecting a local or imported snapshot.
1582
+ * `anchor` reads at a reference's own pins instead of the document's;
1583
+ * `commit` narrows the document comparison to one of its commits. */
1584
+ resolveSource(snapshot: Snapshot, commit?: string, anchor?: SourcePins): Promise<{
1585
+ snapshot: Snapshot;
1586
+ pins: Pins;
1587
+ }>;
1588
+ /** Where an Ask agent reads source: the Review's own head checkout, or the
1589
+ * registered checkout for a live worktree target, as the navigator does. */
1590
+ agentCheckout(snapshot: Snapshot): Promise<{
1591
+ rootPath: string;
1592
+ head: string;
1593
+ live: boolean;
1594
+ }>;
1595
+ /** Resolve a native workspace without replacing the selected source with today's HEAD. */
1596
+ navigatorWorkspace(snapshot: Snapshot, source?: {
1597
+ side?: "base" | "head";
1598
+ file?: string;
1599
+ empty?: boolean;
1600
+ commit?: string;
1601
+ anchor?: SourcePins;
1602
+ }): Promise<{
1603
+ workspacePath: string;
1604
+ filePath?: string;
1605
+ }>;
1606
+ /** A document read that needs default pins; 409 when the document has none. */
1607
+ documentPins(snapshot: Snapshot): Promise<Pins>;
1608
+ /** Pins a reference names itself, checked against the registered checkout. */
1609
+ anchorSourcePins(anchor: SourcePins): Promise<Pins>;
1610
+ /** References whose own repository is unregistered or gone from disk. */
1611
+ unavailableAnchors(snapshot: Snapshot): Promise<string[]>;
1612
+ private readonly trackedFiles;
1613
+ private readonly repositories;
1614
+ private readonly readers;
1615
+ private readonly commitRanges;
1616
+ constructor(store: ReviewStore, options?: {
1617
+ blobReaderIdleTimeoutMs?: number;
1618
+ workspaceDatabase?: string;
1619
+ manageWorkspaces?: boolean;
1620
+ watch?: typeof watch;
1621
+ /** gh, git and GitHub API access for pull request targets. */
1622
+ pullRequests?: PullRequestDeps;
1623
+ });
1624
+ structuralChanges({ reviewId, pins, signal, file }: {
1625
+ reviewId: string;
1626
+ pins: Pins;
1627
+ signal: AbortSignal;
1628
+ file?: string;
1629
+ }): AsyncGenerator<StructuralDiffEvent>;
1630
+ private readonly structuralComparisons;
1631
+ private closed;
1632
+ private readonly worktrees;
1633
+ private forgetWorktree;
1634
+ private worktreeState;
1635
+ close(): Promise<void>;
1636
+ /** Detected once; dropped when the root vanishes or detection found nothing. */
1637
+ private vcs;
1638
+ /** None once closed: a read suspended across close() gets its own process. */
1639
+ private reader;
1640
+ private closeReader;
1641
+ forgetRepository(repositoryId: string): Promise<void>;
1642
+ private vcsTarget;
1643
+ register(root: string): Promise<{
1644
+ id: string;
1645
+ name: string;
1646
+ }>;
1647
+ projectSource(snapshot: Snapshot, pins: Pins): Promise<Snapshot>;
1648
+ /** Throws 404 when the checkout behind the snapshot is gone. Undefined
1649
+ * for a document without default pins. */
1650
+ sourcePins(snapshot: Snapshot): Promise<Pins | undefined>;
1651
+ /** Capture a label only when its ref still resolves to these exact pins. */
1652
+ headBranch(pins: Pins, headRef?: string): Promise<string | undefined>;
1653
+ /** `pinned` refreshes a stored target: a worktree base ref resolves to its
1654
+ * current fork point, and keeps the pinned one if the ref is gone. */
1655
+ resolveTarget(target: ReviewTarget, pinned?: Pins): Promise<{
1656
+ target: ReviewTarget;
1657
+ pins: Pins;
1658
+ }>;
1659
+ /** The fork point from `ref`, by default the repository's default branch. */
1660
+ private worktreeBase;
1661
+ /** The PR's current comparison, fetched into a registered checkout of its repository. */
1662
+ resolvePullRequest(url: string, repository: {
1663
+ id?: string;
1664
+ preferred?: string;
1665
+ }): Promise<ResolvedPullRequest>;
1666
+ /** A registered checkout with a remote for host/owner/repo, and that remote. */
1667
+ private pullRequestCheckout;
1668
+ resolvePins(repositoryId: string, base: string, head: string): Promise<Pins>;
1669
+ /** Files each side's commit changed from one set of pins to another, under
1670
+ * both names for a rename. A worktree has no commit to diff from. */
1671
+ filesChangedBetween(from: Pins, to: Pins): Promise<{
1672
+ base: Set<string>;
1673
+ head: Set<string>;
1674
+ } | undefined>;
1675
+ validatePins(pins: Pins): Promise<void>;
1676
+ file(pins: Pins, side: "base" | "head", file: string, allowBinary?: boolean): Promise<{
1677
+ file: string;
1678
+ side: "base" | "head";
1679
+ commit: string;
1680
+ text: string;
1681
+ }>;
1682
+ tree(pins: Pins, side: "base" | "head", directory: string): Promise<ReviewSourceEntry[]>;
1683
+ private trackedFilesAt;
1684
+ validateSources(pins: Pins, sources: FileLineRange[]): Promise<void>;
1685
+ quote(pins: Pins, source: FileLineRange): Promise<any>;
1686
+ /** Every source reference must exist at the pins; only code peeks must also
1687
+ * show something. */
1688
+ validateSource(pins: Pins, source: FileLineRange, options: {
1689
+ peek: boolean;
1690
+ }): Promise<void>;
1691
+ private readonly coverageCache;
1692
+ private readonly coverageAbort;
1693
+ private readonly coverageListeners;
1694
+ coverageRevision: number;
1695
+ subscribeCoverage(listener: () => void): () => void;
1696
+ /** Start shared coverage work without occupying an HTTP request until it completes. */
1697
+ coveragePending(reviewId: string, pins: Pins, mode: CoverageMode): boolean;
1698
+ coverageSnapshot(reviewId: string, pins: Pins, mode: CoverageMode): {
1699
+ pending: boolean;
1700
+ comparison: ComparisonCoverage | {
1701
+ files: never[];
1702
+ fileSources: Map<any, any>;
1703
+ alignments: Map<any, any>;
1704
+ };
1705
+ };
1706
+ private coverageNotification;
1707
+ private notifyCoverage;
1708
+ coverage(reviewId: string, pins: Pins, mode: CoverageMode): Promise<{
1709
+ files: CoverageFile[];
1710
+ fileSources: Map<string, FileLineRange[]>;
1711
+ alignments: Map<string, readonly AlignmentRow[]>;
1712
+ }>;
1713
+ changes(pins: Pins): Promise<LocalVcsDiffFileSummary[]>;
1714
+ changes(pins: Pins, file: string): Promise<string>;
1715
+ changes(pins: Pins, file?: string): Promise<LocalVcsDiffFileSummary[] | string>;
1716
+ private summaries;
1717
+ /** Raw Git patch text for exact filenames, or every change. */
1718
+ private rawPatch;
1719
+ private worktreeInput;
1720
+ commits(pins: Pins): Promise<LocalVcsCommitSummary[]>;
1721
+ private readCommitRange;
1722
+ comparison(pins: Pins, commit?: string): Promise<Pins>;
1723
+ map(documentPins: Pins | undefined, resourceId: string): Promise<{
1724
+ countsByElementPath: any;
1725
+ unmappedByElementPath: any;
1726
+ elements: NormalizedSoftwareModel;
1727
+ relationships: NormalizedSoftwareModel;
1728
+ side: "base" | "head";
1729
+ commit: string;
1730
+ }>;
1731
+ upload(value: unknown): Promise<{
1732
+ id: string;
1733
+ kind: string;
1734
+ mimeType: string;
1735
+ }>;
1736
+ /** A resource must belong to the document's repository when it has one;
1737
+ * a document without pins may use any registered repository's resources. */
1738
+ validateResource(pins: Pins | undefined, block: Block): Promise<void>;
1739
+ }
1740
+ //#endregion
1741
+ //#region src/sharing/export.d.ts
1742
+ interface ShareBundle {
1743
+ manifest: ShareManifest;
1744
+ objects: Map<string, Uint8Array>;
1745
+ attribution?: {
1746
+ login: string;
1747
+ sharedAt: number;
1748
+ };
1749
+ }
1750
+ type ShareExportStore = Pick<ReviewStore, "read" | "resource">;
1751
+ type ShareExportData = Pick<LocalReviewData, "map" | "validateResource" | "validateSource">;
1752
+ /** Freeze one stored version before any asynchronous source reads. */
1753
+ declare function exportShare(input: {
1754
+ store: ShareExportStore;
1755
+ data: ShareExportData;
1756
+ reviewId: string;
1757
+ version?: number;
1758
+ repository?: ShareManifest["repository"];
1759
+ }): Promise<ShareBundle>;
1760
+ //#endregion
1761
+ //#region src/sharing/client.d.ts
1762
+ /** Account tokens go only to the configured API origin, never to object storage. */
1763
+ declare class ShareClient {
1764
+ private readonly token?;
1765
+ private readonly send;
1766
+ private readonly origin;
1767
+ constructor(origin: string, token?: string | undefined, send?: typeof fetch);
1768
+ private api;
1769
+ private upload;
1770
+ create(bundle: ShareBundle, requestId?: string, beforeUpload?: () => Promise<void>): Promise<{
1771
+ shareId: string;
1772
+ url: string;
1773
+ }>;
1774
+ list(cursor?: string): Promise<JsonValue>;
1775
+ recoverLink(shareId: string): Promise<{
1776
+ shareId: string;
1777
+ url: string;
1778
+ }>;
1779
+ revoke(shareId: string): Promise<JsonValue>;
1780
+ download(shareId: string, capability: string): Promise<ShareBundle>;
1781
+ }
1782
+ //#endregion
1783
+ //#region src/sharing/repository.d.ts
1784
+ /** Recipients need complete history; publication only checks that the commits exist. */
1785
+ declare function fetchPinnedRepository(root: string, url: string, pins: Pick<Pins, "base" | "head">, publishing?: boolean): Promise<void>;
1786
+ declare function verifyShareRepository(root: string, pins: Pins, repository?: {
1787
+ cloneUrl: string;
1788
+ }): Promise<{
1789
+ cloneUrl: string;
1790
+ }>;
1791
+ //#endregion
1792
+ //#region src/sharing/import.d.ts
1793
+ declare function validateShareBundle(bundle: ShareBundle): {
1794
+ manifest: {
1795
+ format: "review-share/1";
1796
+ reviewId: string;
1797
+ version: number;
1798
+ title: string;
1799
+ snapshot: string;
1800
+ presentation: string;
1801
+ objects: {
1802
+ id: string;
1803
+ size: number;
1804
+ sha256: string;
1805
+ }[];
1806
+ resources: {
1807
+ id: string;
1808
+ kind: "map" | "image" | "trace";
1809
+ mimeType: "application/json" | "image/png";
1810
+ object: string;
1811
+ }[];
1812
+ repository?: {
1813
+ cloneUrl: string;
1814
+ } | undefined;
1815
+ };
1816
+ snapshot: {
1817
+ [x: string]: any;
1818
+ reviewId: string;
1819
+ version: number;
1820
+ title: string;
1821
+ createdAt: string;
1822
+ lenses?: any[] | undefined;
1823
+ origin?: {
1824
+ branch?: string | undefined;
1825
+ baseRef?: string | undefined;
1826
+ pullRequestNumber?: number | undefined;
1827
+ pullRequestUrl?: string | undefined;
1828
+ revision?: string | undefined;
1829
+ } | undefined;
1830
+ };
1831
+ presentation: {
1832
+ maps: Record<string, {
1833
+ commit: string;
1834
+ side: "base" | "head";
1835
+ elements: any[];
1836
+ relationships: any[];
1837
+ countsByElementPath: Record<string, {
1838
+ additions: number;
1839
+ deletions: number;
1840
+ }>;
1841
+ unmappedByElementPath: Record<string, {
1842
+ additions: number;
1843
+ deletions: number;
1844
+ files: {
1845
+ additions: number;
1846
+ deletions: number;
1847
+ file: string;
1848
+ hunks: {
1849
+ startLine: number;
1850
+ lines: {
1851
+ kind: "add" | "remove";
1852
+ oldLine: number | null;
1853
+ newLine: number | null;
1854
+ text: string;
1855
+ }[];
1856
+ }[];
1857
+ }[];
1858
+ }>;
1859
+ }>;
1860
+ };
1861
+ };
1862
+ declare function sharedReviewId(origin: string, shareId: string): string;
1863
+ /** Separate immutable directory tree; authoring mutation handlers cannot write it. */
1864
+ declare class SharedReviewStore {
1865
+ readonly root: string;
1866
+ private readonly fetchRepository;
1867
+ private readonly loaded;
1868
+ private readonly validated;
1869
+ private readonly attention;
1870
+ private readonly listeners;
1871
+ private catalogLoaded;
1872
+ private readonly downloads;
1873
+ trackImport(job: Promise<void>): void;
1874
+ close(): Promise<void>;
1875
+ private local?;
1876
+ private readonly repositories;
1877
+ private readonly jobs;
1878
+ private readonly states;
1879
+ constructor(root: string, fetchRepository?: typeof fetchPinnedRepository);
1880
+ connect(store: ReviewStore, data: LocalReviewData): void;
1881
+ has(id: string): boolean;
1882
+ status(id: string): {
1883
+ stage: "downloading" | "fetching" | "validating" | "ready" | "error";
1884
+ error?: string;
1885
+ };
1886
+ setStatus(id: string, stage: "downloading" | "fetching" | "validating" | "ready" | "error", error?: string): void;
1887
+ repositoryRoot(id: string): string;
1888
+ prepare(id: string): Promise<void>;
1889
+ private prepareRepository;
1890
+ assertReady(id: string): Promise<void>;
1891
+ subscribe(listener: () => void): () => void;
1892
+ load(): Promise<void>;
1893
+ get(id: string): {
1894
+ snapshot: {
1895
+ reviewId: string;
1896
+ pins: any;
1897
+ target: any;
1898
+ shared: {
1899
+ cloneUrl: string | undefined;
1900
+ login?: string | undefined;
1901
+ sharedAt?: number | undefined;
1902
+ };
1903
+ version: number;
1904
+ title: string;
1905
+ createdAt: string;
1906
+ lenses?: any[] | undefined;
1907
+ origin?: {
1908
+ branch?: string | undefined;
1909
+ baseRef?: string | undefined;
1910
+ pullRequestNumber?: number | undefined;
1911
+ pullRequestUrl?: string | undefined;
1912
+ revision?: string | undefined;
1913
+ } | undefined;
1914
+ };
1915
+ manifest: {
1916
+ format: "review-share/1";
1917
+ reviewId: string;
1918
+ version: number;
1919
+ title: string;
1920
+ snapshot: string;
1921
+ presentation: string;
1922
+ objects: {
1923
+ id: string;
1924
+ size: number;
1925
+ sha256: string;
1926
+ }[];
1927
+ resources: {
1928
+ id: string;
1929
+ kind: "map" | "image" | "trace";
1930
+ mimeType: "application/json" | "image/png";
1931
+ object: string;
1932
+ }[];
1933
+ repository?: {
1934
+ cloneUrl: string;
1935
+ } | undefined;
1936
+ };
1937
+ presentation: {
1938
+ maps: Record<string, {
1939
+ commit: string;
1940
+ side: "base" | "head";
1941
+ elements: any[];
1942
+ relationships: any[];
1943
+ countsByElementPath: Record<string, {
1944
+ additions: number;
1945
+ deletions: number;
1946
+ }>;
1947
+ unmappedByElementPath: Record<string, {
1948
+ additions: number;
1949
+ deletions: number;
1950
+ files: {
1951
+ additions: number;
1952
+ deletions: number;
1953
+ file: string;
1954
+ hunks: {
1955
+ startLine: number;
1956
+ lines: {
1957
+ kind: "add" | "remove";
1958
+ oldLine: number | null;
1959
+ newLine: number | null;
1960
+ text: string;
1961
+ }[];
1962
+ }[];
1963
+ }[];
1964
+ }>;
1965
+ }>;
1966
+ };
1967
+ };
1968
+ list(mode?: "structural" | "textual"): any;
1969
+ readObject(id: string, objectId: string): Promise<NonSharedBuffer>;
1970
+ removeLocal(id: string): Promise<void>;
1971
+ setAttention(id: string, action: "view" | "dismiss" | "restore"): Promise<void>;
1972
+ import(origin: string, shareId: string, bundle: ShareBundle): Promise<string>;
1973
+ read(id: string): Promise<ShareBundle>;
1974
+ private readValidated;
1975
+ }
1976
+ //#endregion
1977
+ export { type ShareBundle, ShareClient, type ShareExportData, type ShareExportStore, SharedReviewStore, exportShare, sharedReviewId, validateShareBundle, verifyShareRepository };