@buildaharness/aielia 0.3.8 → 0.3.10

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 (103) hide show
  1. package/README.md +6 -3
  2. package/dist/_memory-core-generated.d.ts +6 -0
  3. package/dist/action-approval-service.d.ts +2 -0
  4. package/dist/ask-draft.d.ts +22 -0
  5. package/dist/assistant-options.d.ts +35 -0
  6. package/dist/assistant-session.d.ts +1 -1
  7. package/dist/assistant.d.ts +11 -0
  8. package/dist/{bin-DETwedpj.js → bin-Cz3FY6Ew.js} +144 -254
  9. package/dist/bin-Cz3FY6Ew.js.map +1 -0
  10. package/dist/claude-cli-llm-client.d.ts +2 -0
  11. package/dist/claude-cli-prompt.d.ts +7 -0
  12. package/dist/cli-config.d.ts +2 -2
  13. package/dist/cli-session.d.ts +2 -1
  14. package/dist/cli.d.ts +2 -0
  15. package/dist/cli.js +1 -1
  16. package/dist/commands.d.ts +32 -0
  17. package/dist/config-keys.d.ts +43 -0
  18. package/dist/doctor-checks.d.ts +1 -2
  19. package/dist/fact-extraction.d.ts +4 -0
  20. package/dist/fact-repository.contract.d.ts +2 -0
  21. package/dist/fact-repository.d.ts +44 -0
  22. package/dist/file-tools-mcp-server.mjs +29 -0
  23. package/dist/goal-graph-store.d.ts +6 -0
  24. package/dist/harness-bridge.d.ts +5 -5
  25. package/dist/html-to-markdown.d.ts +11 -0
  26. package/dist/index.d.ts +98 -3
  27. package/dist/index.js +5003 -150
  28. package/dist/index.js.map +1 -1
  29. package/dist/layer-settings.d.ts +16 -3
  30. package/dist/llm-client-factory.d.ts +13 -0
  31. package/dist/memory-events.d.ts +177 -0
  32. package/dist/memory-service.d.ts +17 -0
  33. package/dist/model-pricing.d.ts +15 -9
  34. package/dist/node-display-names.d.ts +1 -1
  35. package/dist/project-command.d.ts +16 -0
  36. package/dist/{provider-setup-wX2IBw2X.js → provider-setup-DG8iYm_F.js} +14471 -13032
  37. package/dist/provider-setup-DG8iYm_F.js.map +1 -0
  38. package/dist/proxy-health.d.ts +8 -0
  39. package/dist/redact-url.d.ts +2 -0
  40. package/dist/reply-audit.d.ts +2 -0
  41. package/dist/response-service.d.ts +10 -0
  42. package/dist/run-explain.d.ts +58 -0
  43. package/dist/scripted-llm-client.d.ts +1 -1
  44. package/dist/{tui-app-CcxiwZyM.js → tui-app-oWbIUcBW.js} +3 -3
  45. package/dist/{tui-app-CcxiwZyM.js.map → tui-app-oWbIUcBW.js.map} +1 -1
  46. package/dist/turn-abort.d.ts +5 -0
  47. package/dist/turn-cost.d.ts +12 -0
  48. package/dist/turn-presentation.d.ts +86 -0
  49. package/dist/undo-action-command.d.ts +12 -0
  50. package/dist/undo-plan.d.ts +13 -0
  51. package/dist/version.d.ts +1 -1
  52. package/dist/web-fetch-core.d.ts +0 -14
  53. package/dist/writer/article-autosave.d.ts +12 -0
  54. package/dist/writer/article-change-summary.d.ts +28 -0
  55. package/dist/writer/article-claims.d.ts +49 -0
  56. package/dist/writer/article-comments.d.ts +20 -0
  57. package/dist/writer/article-consistency.d.ts +27 -0
  58. package/dist/writer/article-decorations.d.ts +23 -0
  59. package/dist/writer/article-dependencies.d.ts +44 -0
  60. package/dist/writer/article-draft.d.ts +23 -0
  61. package/dist/writer/article-edit-outline.d.ts +16 -0
  62. package/dist/writer/article-edit-suggest.d.ts +30 -0
  63. package/dist/writer/article-folder.d.ts +29 -0
  64. package/dist/writer/article-history.d.ts +73 -0
  65. package/dist/writer/article-ideas.d.ts +34 -0
  66. package/dist/writer/article-issues.d.ts +47 -0
  67. package/dist/writer/article-marks.d.ts +25 -0
  68. package/dist/writer/article-memory-store.d.ts +3 -0
  69. package/dist/writer/article-model.d.ts +1337 -0
  70. package/dist/writer/article-outline.d.ts +43 -0
  71. package/dist/writer/article-resolver.d.ts +55 -0
  72. package/dist/writer/article-revisions.d.ts +30 -0
  73. package/dist/writer/article-rules.d.ts +60 -0
  74. package/dist/writer/article-sections.d.ts +26 -0
  75. package/dist/writer/article-selection.d.ts +26 -0
  76. package/dist/writer/article-service.d.ts +542 -0
  77. package/dist/writer/article-source-links.d.ts +42 -0
  78. package/dist/writer/article-sources.d.ts +82 -0
  79. package/dist/writer/article-style-derive.d.ts +26 -0
  80. package/dist/writer/article-style.d.ts +31 -0
  81. package/dist/writer/article-suggestions.d.ts +33 -0
  82. package/dist/writer/article-support.d.ts +33 -0
  83. package/dist/writer/article-verify.d.ts +42 -0
  84. package/dist/writer/local-folder.d.ts +49 -0
  85. package/dist/writer/model-failure-hint.d.ts +7 -0
  86. package/dist/writer/repo-reader.d.ts +29 -0
  87. package/dist/writer/repo-search.d.ts +33 -0
  88. package/dist/writer/repo-verify-loop.d.ts +61 -0
  89. package/dist/writer/text-tool-calls.d.ts +11 -0
  90. package/dist/writer/work-progress.d.ts +51 -0
  91. package/dist/writer/write-activity.d.ts +61 -0
  92. package/dist/writer/write-models.d.ts +12 -0
  93. package/dist/writer/write-parameters.d.ts +31 -0
  94. package/dist/writer/write-permissions.d.ts +89 -0
  95. package/dist/writer/write-spend.d.ts +16 -0
  96. package/dist/writer/writer-chat-capture.d.ts +25 -0
  97. package/dist/writer/writer-chat-history.d.ts +17 -0
  98. package/dist/writer/writer-chat-state.d.ts +358 -0
  99. package/dist/writer/writer-chat-turn.d.ts +52 -0
  100. package/dist/writer/writer-intent.d.ts +20 -0
  101. package/package.json +3 -3
  102. package/dist/bin-DETwedpj.js.map +0 -1
  103. package/dist/provider-setup-wX2IBw2X.js.map +0 -1
@@ -0,0 +1,1337 @@
1
+ import { z } from 'zod';
2
+ /**
3
+ * The article model (plans/aielia_write_article_model_plan.html, sections 2-5): everything about an article that is not
4
+ * its text. It is the content of `article.meta.json`; the text stays ordinary Markdown in `article.md`.
5
+ * Pure data, no node:* / DOM imports: the browser bundles it.
6
+ */
7
+ export declare const ARTICLE_META_VERSION = 1;
8
+ export declare const ReviewStateSchema: z.ZodEnum<["clean", "needs_review", "being_revised", "held"]>;
9
+ export type ReviewState = z.infer<typeof ReviewStateSchema>;
10
+ export declare const SectionSchema: z.ZodObject<{
11
+ id: z.ZodString;
12
+ heading: z.ZodString;
13
+ level: z.ZodNumber;
14
+ order: z.ZodNumber;
15
+ parentId: z.ZodOptional<z.ZodString>;
16
+ /** What this section is for, in a line (used by the outline). */
17
+ purpose: z.ZodOptional<z.ZodString>;
18
+ /** Character offsets into article.md: [start, end). */
19
+ span: z.ZodObject<{
20
+ start: z.ZodNumber;
21
+ end: z.ZodNumber;
22
+ }, "strip", z.ZodTypeAny, {
23
+ start: number;
24
+ end: number;
25
+ }, {
26
+ start: number;
27
+ end: number;
28
+ }>;
29
+ review: z.ZodObject<{
30
+ state: z.ZodEnum<["clean", "needs_review", "being_revised", "held"]>;
31
+ reason: z.ZodOptional<z.ZodString>;
32
+ setBy: z.ZodOptional<z.ZodEnum<["resolver", "writer", "editor"]>>;
33
+ at: z.ZodOptional<z.ZodString>;
34
+ }, "strip", z.ZodTypeAny, {
35
+ state: "clean" | "needs_review" | "being_revised" | "held";
36
+ at?: string | undefined;
37
+ reason?: string | undefined;
38
+ setBy?: "writer" | "resolver" | "editor" | undefined;
39
+ }, {
40
+ state: "clean" | "needs_review" | "being_revised" | "held";
41
+ at?: string | undefined;
42
+ reason?: string | undefined;
43
+ setBy?: "writer" | "resolver" | "editor" | undefined;
44
+ }>;
45
+ }, "strip", z.ZodTypeAny, {
46
+ id: string;
47
+ review: {
48
+ state: "clean" | "needs_review" | "being_revised" | "held";
49
+ at?: string | undefined;
50
+ reason?: string | undefined;
51
+ setBy?: "writer" | "resolver" | "editor" | undefined;
52
+ };
53
+ span: {
54
+ start: number;
55
+ end: number;
56
+ };
57
+ heading: string;
58
+ level: number;
59
+ order: number;
60
+ parentId?: string | undefined;
61
+ purpose?: string | undefined;
62
+ }, {
63
+ id: string;
64
+ review: {
65
+ state: "clean" | "needs_review" | "being_revised" | "held";
66
+ at?: string | undefined;
67
+ reason?: string | undefined;
68
+ setBy?: "writer" | "resolver" | "editor" | undefined;
69
+ };
70
+ span: {
71
+ start: number;
72
+ end: number;
73
+ };
74
+ heading: string;
75
+ level: number;
76
+ order: number;
77
+ parentId?: string | undefined;
78
+ purpose?: string | undefined;
79
+ }>;
80
+ export type Section = z.infer<typeof SectionSchema>;
81
+ export declare const SourceStatusSchema: z.ZodEnum<["none", "attached", "supported", "partly_supported", "not_supported", "contradicted", "stale", "not_checked"]>;
82
+ export type SourceStatus = z.infer<typeof SourceStatusSchema>;
83
+ export declare const ClaimSchema: z.ZodObject<{
84
+ id: z.ZodString;
85
+ sectionId: z.ZodString;
86
+ /** The text the claim came from, quoted, so it can be found again after edits. */
87
+ quote: z.ZodString;
88
+ /** Approximate offset of the quote in article.md. */
89
+ position: z.ZodNumber;
90
+ /** `opinion` and `framing` are statements the writer marked as not needing a source. */
91
+ kind: z.ZodEnum<["factual", "opinion", "framing"]>;
92
+ author: z.ZodEnum<["model", "writer", "mixed"]>;
93
+ authorAt: z.ZodString;
94
+ /** A confirmed claim is matched first on re-extraction and never dropped silently. */
95
+ confirmed: z.ZodBoolean;
96
+ /** What the last check said. Whether it still counts is decided by `effectiveSourceStatus`, never by this field alone. */
97
+ sourceStatus: z.ZodEnum<["none", "attached", "supported", "partly_supported", "not_supported", "contradicted", "stale", "not_checked"]>;
98
+ check: z.ZodOptional<z.ZodObject<{
99
+ ranAt: z.ZodString;
100
+ model: z.ZodString;
101
+ reason: z.ZodString;
102
+ /** The claim text and the source fingerprints the check ran against. */
103
+ claimText: z.ZodString;
104
+ sourceFingerprints: z.ZodRecord<z.ZodString, z.ZodString>;
105
+ }, "strip", z.ZodTypeAny, {
106
+ model: string;
107
+ reason: string;
108
+ ranAt: string;
109
+ claimText: string;
110
+ sourceFingerprints: Record<string, string>;
111
+ }, {
112
+ model: string;
113
+ reason: string;
114
+ ranAt: string;
115
+ claimText: string;
116
+ sourceFingerprints: Record<string, string>;
117
+ }>>;
118
+ /** Set when re-anchoring was unsure: "moved or changed, check". */
119
+ needsRecheck: z.ZodOptional<z.ZodBoolean>;
120
+ /** The last time a source was looked for and not found, kept so the page can say so. It only counts while `claimText` is still the claim's text. */
121
+ lookup: z.ZodOptional<z.ZodObject<{
122
+ at: z.ZodString;
123
+ claimText: z.ZodString;
124
+ outcome: z.ZodEnum<["no_results", "none_supported", "unavailable"]>;
125
+ /** Addresses of the pages read and found not to back the claim. */
126
+ tried: z.ZodArray<z.ZodString, "many">;
127
+ }, "strip", z.ZodTypeAny, {
128
+ at: string;
129
+ outcome: "unavailable" | "no_results" | "none_supported";
130
+ claimText: string;
131
+ tried: string[];
132
+ }, {
133
+ at: string;
134
+ outcome: "unavailable" | "no_results" | "none_supported";
135
+ claimText: string;
136
+ tried: string[];
137
+ }>>;
138
+ }, "strip", z.ZodTypeAny, {
139
+ id: string;
140
+ kind: "factual" | "opinion" | "framing";
141
+ author: "model" | "writer" | "mixed";
142
+ quote: string;
143
+ confirmed: boolean;
144
+ sectionId: string;
145
+ position: number;
146
+ authorAt: string;
147
+ sourceStatus: "none" | "supported" | "not_checked" | "contradicted" | "attached" | "partly_supported" | "not_supported" | "stale";
148
+ lookup?: {
149
+ at: string;
150
+ outcome: "unavailable" | "no_results" | "none_supported";
151
+ claimText: string;
152
+ tried: string[];
153
+ } | undefined;
154
+ check?: {
155
+ model: string;
156
+ reason: string;
157
+ ranAt: string;
158
+ claimText: string;
159
+ sourceFingerprints: Record<string, string>;
160
+ } | undefined;
161
+ needsRecheck?: boolean | undefined;
162
+ }, {
163
+ id: string;
164
+ kind: "factual" | "opinion" | "framing";
165
+ author: "model" | "writer" | "mixed";
166
+ quote: string;
167
+ confirmed: boolean;
168
+ sectionId: string;
169
+ position: number;
170
+ authorAt: string;
171
+ sourceStatus: "none" | "supported" | "not_checked" | "contradicted" | "attached" | "partly_supported" | "not_supported" | "stale";
172
+ lookup?: {
173
+ at: string;
174
+ outcome: "unavailable" | "no_results" | "none_supported";
175
+ claimText: string;
176
+ tried: string[];
177
+ } | undefined;
178
+ check?: {
179
+ model: string;
180
+ reason: string;
181
+ ranAt: string;
182
+ claimText: string;
183
+ sourceFingerprints: Record<string, string>;
184
+ } | undefined;
185
+ needsRecheck?: boolean | undefined;
186
+ }>;
187
+ export type Claim = z.infer<typeof ClaimSchema>;
188
+ export declare const SourceSchema: z.ZodObject<{
189
+ id: z.ZodString;
190
+ kind: z.ZodEnum<["web", "code", "document", "upload", "say_so"]>;
191
+ address: z.ZodOptional<z.ZodString>;
192
+ /** The passage as read. Source text is data, never instructions. */
193
+ passage: z.ZodOptional<z.ZodString>;
194
+ readAt: z.ZodOptional<z.ZodString>;
195
+ fingerprint: z.ZodOptional<z.ZodString>;
196
+ trust: z.ZodEnum<["normal", "lower"]>;
197
+ freshness: z.ZodEnum<["unchecked", "current", "changed", "unreachable"]>;
198
+ note: z.ZodOptional<z.ZodString>;
199
+ /** New text read from the address that differs from `passage`. Held until the writer accepts it; checks keep using `passage`. */
200
+ fetchedPassage: z.ZodOptional<z.ZodString>;
201
+ /** For a code or text file: only these lines (1-based, inclusive) are kept as the passage. */
202
+ lines: z.ZodOptional<z.ZodObject<{
203
+ from: z.ZodNumber;
204
+ to: z.ZodNumber;
205
+ }, "strip", z.ZodTypeAny, {
206
+ from: number;
207
+ to: number;
208
+ }, {
209
+ from: number;
210
+ to: number;
211
+ }>>;
212
+ }, "strip", z.ZodTypeAny, {
213
+ id: string;
214
+ freshness: "changed" | "unreachable" | "current" | "unchecked";
215
+ kind: "code" | "document" | "web" | "say_so" | "upload";
216
+ trust: "lower" | "normal";
217
+ note?: string | undefined;
218
+ address?: string | undefined;
219
+ passage?: string | undefined;
220
+ readAt?: string | undefined;
221
+ fingerprint?: string | undefined;
222
+ fetchedPassage?: string | undefined;
223
+ lines?: {
224
+ from: number;
225
+ to: number;
226
+ } | undefined;
227
+ }, {
228
+ id: string;
229
+ freshness: "changed" | "unreachable" | "current" | "unchecked";
230
+ kind: "code" | "document" | "web" | "say_so" | "upload";
231
+ trust: "lower" | "normal";
232
+ note?: string | undefined;
233
+ address?: string | undefined;
234
+ passage?: string | undefined;
235
+ readAt?: string | undefined;
236
+ fingerprint?: string | undefined;
237
+ fetchedPassage?: string | undefined;
238
+ lines?: {
239
+ from: number;
240
+ to: number;
241
+ } | undefined;
242
+ }>;
243
+ export type Source = z.infer<typeof SourceSchema>;
244
+ export declare const LinkEndSchema: z.ZodObject<{
245
+ type: z.ZodEnum<["section", "claim", "source", "comment"]>;
246
+ id: z.ZodString;
247
+ }, "strip", z.ZodTypeAny, {
248
+ id: string;
249
+ type: "source" | "section" | "claim" | "comment";
250
+ }, {
251
+ id: string;
252
+ type: "source" | "section" | "claim" | "comment";
253
+ }>;
254
+ export declare const LinkSchema: z.ZodObject<{
255
+ id: z.ZodString;
256
+ from: z.ZodObject<{
257
+ type: z.ZodEnum<["section", "claim", "source", "comment"]>;
258
+ id: z.ZodString;
259
+ }, "strip", z.ZodTypeAny, {
260
+ id: string;
261
+ type: "source" | "section" | "claim" | "comment";
262
+ }, {
263
+ id: string;
264
+ type: "source" | "section" | "claim" | "comment";
265
+ }>;
266
+ to: z.ZodObject<{
267
+ type: z.ZodEnum<["section", "claim", "source", "comment"]>;
268
+ id: z.ZodString;
269
+ }, "strip", z.ZodTypeAny, {
270
+ id: string;
271
+ type: "source" | "section" | "claim" | "comment";
272
+ }, {
273
+ id: string;
274
+ type: "source" | "section" | "claim" | "comment";
275
+ }>;
276
+ /** A recorded value, not a fixed set: the kinds are expected to grow. Starting kinds: rests_on, supported_by, repeats, about. */
277
+ kind: z.ZodString;
278
+ origin: z.ZodEnum<["proposed", "confirmed", "drawn"]>;
279
+ confidence: z.ZodOptional<z.ZodNumber>;
280
+ reason: z.ZodOptional<z.ZodString>;
281
+ at: z.ZodString;
282
+ }, "strip", z.ZodTypeAny, {
283
+ at: string;
284
+ id: string;
285
+ from: {
286
+ id: string;
287
+ type: "source" | "section" | "claim" | "comment";
288
+ };
289
+ to: {
290
+ id: string;
291
+ type: "source" | "section" | "claim" | "comment";
292
+ };
293
+ kind: string;
294
+ origin: "proposed" | "confirmed" | "drawn";
295
+ confidence?: number | undefined;
296
+ reason?: string | undefined;
297
+ }, {
298
+ at: string;
299
+ id: string;
300
+ from: {
301
+ id: string;
302
+ type: "source" | "section" | "claim" | "comment";
303
+ };
304
+ to: {
305
+ id: string;
306
+ type: "source" | "section" | "claim" | "comment";
307
+ };
308
+ kind: string;
309
+ origin: "proposed" | "confirmed" | "drawn";
310
+ confidence?: number | undefined;
311
+ reason?: string | undefined;
312
+ }>;
313
+ export type Link = z.infer<typeof LinkSchema>;
314
+ export declare const SuggestionSchema: z.ZodObject<{
315
+ id: z.ZodString;
316
+ span: z.ZodObject<{
317
+ start: z.ZodNumber;
318
+ end: z.ZodNumber;
319
+ quote: z.ZodString;
320
+ }, "strip", z.ZodTypeAny, {
321
+ quote: string;
322
+ start: number;
323
+ end: number;
324
+ }, {
325
+ quote: string;
326
+ start: number;
327
+ end: number;
328
+ }>;
329
+ replacement: z.ZodString;
330
+ reason: z.ZodString;
331
+ proposedBy: z.ZodEnum<["assistant", "writer"]>;
332
+ /** The model that proposed it, when the assistant did. */
333
+ model: z.ZodOptional<z.ZodString>;
334
+ /** Ideas that this suggestion writes into the text; they are marked used when it is accepted. */
335
+ ideaIds: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
336
+ /** Reviewer comments this suggestion was written to address; they are marked addressed when it is accepted. */
337
+ commentIds: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
338
+ /** Sections this suggestion brings in line; their review mark is cleared when it is accepted. */
339
+ sectionIds: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
340
+ state: z.ZodEnum<["pending", "accepted", "rejected", "edited_accepted", "stale"]>;
341
+ createdAt: z.ZodString;
342
+ }, "strip", z.ZodTypeAny, {
343
+ id: string;
344
+ reason: string;
345
+ createdAt: string;
346
+ span: {
347
+ quote: string;
348
+ start: number;
349
+ end: number;
350
+ };
351
+ state: "rejected" | "pending" | "stale" | "accepted" | "edited_accepted";
352
+ replacement: string;
353
+ proposedBy: "assistant" | "writer";
354
+ model?: string | undefined;
355
+ ideaIds?: string[] | undefined;
356
+ commentIds?: string[] | undefined;
357
+ sectionIds?: string[] | undefined;
358
+ }, {
359
+ id: string;
360
+ reason: string;
361
+ createdAt: string;
362
+ span: {
363
+ quote: string;
364
+ start: number;
365
+ end: number;
366
+ };
367
+ state: "rejected" | "pending" | "stale" | "accepted" | "edited_accepted";
368
+ replacement: string;
369
+ proposedBy: "assistant" | "writer";
370
+ model?: string | undefined;
371
+ ideaIds?: string[] | undefined;
372
+ commentIds?: string[] | undefined;
373
+ sectionIds?: string[] | undefined;
374
+ }>;
375
+ export type Suggestion = z.infer<typeof SuggestionSchema>;
376
+ /** The reusable brief for one article: who it is for and what it should do. Every field is optional text the writer fills in. */
377
+ export declare const BriefSchema: z.ZodObject<{
378
+ audience: z.ZodOptional<z.ZodString>;
379
+ purpose: z.ZodOptional<z.ZodString>;
380
+ tone: z.ZodOptional<z.ZodString>;
381
+ length: z.ZodOptional<z.ZodString>;
382
+ notes: z.ZodOptional<z.ZodString>;
383
+ }, "strip", z.ZodTypeAny, {
384
+ length?: string | undefined;
385
+ notes?: string | undefined;
386
+ purpose?: string | undefined;
387
+ audience?: string | undefined;
388
+ tone?: string | undefined;
389
+ }, {
390
+ length?: string | undefined;
391
+ notes?: string | undefined;
392
+ purpose?: string | undefined;
393
+ audience?: string | undefined;
394
+ tone?: string | undefined;
395
+ }>;
396
+ export type Brief = z.infer<typeof BriefSchema>;
397
+ /** A writing profile (brand voice and terminology). A copy lives in each article that uses it, so an export is self-contained. */
398
+ export declare const StyleProfileSchema: z.ZodObject<{
399
+ id: z.ZodString;
400
+ name: z.ZodString;
401
+ voice: z.ZodDefault<z.ZodString>;
402
+ /** Words the writer wants used, and the words they replace. */
403
+ terms: z.ZodDefault<z.ZodArray<z.ZodObject<{
404
+ use: z.ZodString;
405
+ instead: z.ZodOptional<z.ZodString>;
406
+ }, "strip", z.ZodTypeAny, {
407
+ use: string;
408
+ instead?: string | undefined;
409
+ }, {
410
+ use: string;
411
+ instead?: string | undefined;
412
+ }>, "many">>;
413
+ }, "strip", z.ZodTypeAny, {
414
+ id: string;
415
+ name: string;
416
+ voice: string;
417
+ terms: {
418
+ use: string;
419
+ instead?: string | undefined;
420
+ }[];
421
+ }, {
422
+ id: string;
423
+ name: string;
424
+ voice?: string | undefined;
425
+ terms?: {
426
+ use: string;
427
+ instead?: string | undefined;
428
+ }[] | undefined;
429
+ }>;
430
+ export type StyleProfile = z.infer<typeof StyleProfileSchema>;
431
+ export declare const IdeaSchema: z.ZodObject<{
432
+ id: z.ZodString;
433
+ text: z.ZodString;
434
+ /** Who added it. When the assistant did, `model` says which model. */
435
+ origin: z.ZodEnum<["writer", "assistant"]>;
436
+ model: z.ZodOptional<z.ZodString>;
437
+ /** The section it is meant for, if the writer or the assistant said so. */
438
+ sectionId: z.ZodOptional<z.ZodString>;
439
+ /** open: not in the text yet. used: written into the article. dropped: set aside. */
440
+ state: z.ZodEnum<["open", "used", "dropped"]>;
441
+ usedIn: z.ZodOptional<z.ZodString>;
442
+ createdAt: z.ZodString;
443
+ }, "strip", z.ZodTypeAny, {
444
+ id: string;
445
+ text: string;
446
+ origin: "assistant" | "writer";
447
+ createdAt: string;
448
+ state: "used" | "dropped" | "open";
449
+ model?: string | undefined;
450
+ sectionId?: string | undefined;
451
+ usedIn?: string | undefined;
452
+ }, {
453
+ id: string;
454
+ text: string;
455
+ origin: "assistant" | "writer";
456
+ createdAt: string;
457
+ state: "used" | "dropped" | "open";
458
+ model?: string | undefined;
459
+ sectionId?: string | undefined;
460
+ usedIn?: string | undefined;
461
+ }>;
462
+ export type Idea = z.infer<typeof IdeaSchema>;
463
+ export declare const ArticleMetaSchema: z.ZodObject<{
464
+ formatVersion: z.ZodNumber;
465
+ id: z.ZodString;
466
+ title: z.ZodString;
467
+ /** The short name the writer files the article under (shown in the page header). Separate from the title, which is the first heading of the text. */
468
+ name: z.ZodOptional<z.ZodString>;
469
+ status: z.ZodEnum<["drafting", "ready", "published"]>;
470
+ sections: z.ZodArray<z.ZodObject<{
471
+ id: z.ZodString;
472
+ heading: z.ZodString;
473
+ level: z.ZodNumber;
474
+ order: z.ZodNumber;
475
+ parentId: z.ZodOptional<z.ZodString>;
476
+ /** What this section is for, in a line (used by the outline). */
477
+ purpose: z.ZodOptional<z.ZodString>;
478
+ /** Character offsets into article.md: [start, end). */
479
+ span: z.ZodObject<{
480
+ start: z.ZodNumber;
481
+ end: z.ZodNumber;
482
+ }, "strip", z.ZodTypeAny, {
483
+ start: number;
484
+ end: number;
485
+ }, {
486
+ start: number;
487
+ end: number;
488
+ }>;
489
+ review: z.ZodObject<{
490
+ state: z.ZodEnum<["clean", "needs_review", "being_revised", "held"]>;
491
+ reason: z.ZodOptional<z.ZodString>;
492
+ setBy: z.ZodOptional<z.ZodEnum<["resolver", "writer", "editor"]>>;
493
+ at: z.ZodOptional<z.ZodString>;
494
+ }, "strip", z.ZodTypeAny, {
495
+ state: "clean" | "needs_review" | "being_revised" | "held";
496
+ at?: string | undefined;
497
+ reason?: string | undefined;
498
+ setBy?: "writer" | "resolver" | "editor" | undefined;
499
+ }, {
500
+ state: "clean" | "needs_review" | "being_revised" | "held";
501
+ at?: string | undefined;
502
+ reason?: string | undefined;
503
+ setBy?: "writer" | "resolver" | "editor" | undefined;
504
+ }>;
505
+ }, "strip", z.ZodTypeAny, {
506
+ id: string;
507
+ review: {
508
+ state: "clean" | "needs_review" | "being_revised" | "held";
509
+ at?: string | undefined;
510
+ reason?: string | undefined;
511
+ setBy?: "writer" | "resolver" | "editor" | undefined;
512
+ };
513
+ span: {
514
+ start: number;
515
+ end: number;
516
+ };
517
+ heading: string;
518
+ level: number;
519
+ order: number;
520
+ parentId?: string | undefined;
521
+ purpose?: string | undefined;
522
+ }, {
523
+ id: string;
524
+ review: {
525
+ state: "clean" | "needs_review" | "being_revised" | "held";
526
+ at?: string | undefined;
527
+ reason?: string | undefined;
528
+ setBy?: "writer" | "resolver" | "editor" | undefined;
529
+ };
530
+ span: {
531
+ start: number;
532
+ end: number;
533
+ };
534
+ heading: string;
535
+ level: number;
536
+ order: number;
537
+ parentId?: string | undefined;
538
+ purpose?: string | undefined;
539
+ }>, "many">;
540
+ claims: z.ZodArray<z.ZodObject<{
541
+ id: z.ZodString;
542
+ sectionId: z.ZodString;
543
+ /** The text the claim came from, quoted, so it can be found again after edits. */
544
+ quote: z.ZodString;
545
+ /** Approximate offset of the quote in article.md. */
546
+ position: z.ZodNumber;
547
+ /** `opinion` and `framing` are statements the writer marked as not needing a source. */
548
+ kind: z.ZodEnum<["factual", "opinion", "framing"]>;
549
+ author: z.ZodEnum<["model", "writer", "mixed"]>;
550
+ authorAt: z.ZodString;
551
+ /** A confirmed claim is matched first on re-extraction and never dropped silently. */
552
+ confirmed: z.ZodBoolean;
553
+ /** What the last check said. Whether it still counts is decided by `effectiveSourceStatus`, never by this field alone. */
554
+ sourceStatus: z.ZodEnum<["none", "attached", "supported", "partly_supported", "not_supported", "contradicted", "stale", "not_checked"]>;
555
+ check: z.ZodOptional<z.ZodObject<{
556
+ ranAt: z.ZodString;
557
+ model: z.ZodString;
558
+ reason: z.ZodString;
559
+ /** The claim text and the source fingerprints the check ran against. */
560
+ claimText: z.ZodString;
561
+ sourceFingerprints: z.ZodRecord<z.ZodString, z.ZodString>;
562
+ }, "strip", z.ZodTypeAny, {
563
+ model: string;
564
+ reason: string;
565
+ ranAt: string;
566
+ claimText: string;
567
+ sourceFingerprints: Record<string, string>;
568
+ }, {
569
+ model: string;
570
+ reason: string;
571
+ ranAt: string;
572
+ claimText: string;
573
+ sourceFingerprints: Record<string, string>;
574
+ }>>;
575
+ /** Set when re-anchoring was unsure: "moved or changed, check". */
576
+ needsRecheck: z.ZodOptional<z.ZodBoolean>;
577
+ /** The last time a source was looked for and not found, kept so the page can say so. It only counts while `claimText` is still the claim's text. */
578
+ lookup: z.ZodOptional<z.ZodObject<{
579
+ at: z.ZodString;
580
+ claimText: z.ZodString;
581
+ outcome: z.ZodEnum<["no_results", "none_supported", "unavailable"]>;
582
+ /** Addresses of the pages read and found not to back the claim. */
583
+ tried: z.ZodArray<z.ZodString, "many">;
584
+ }, "strip", z.ZodTypeAny, {
585
+ at: string;
586
+ outcome: "unavailable" | "no_results" | "none_supported";
587
+ claimText: string;
588
+ tried: string[];
589
+ }, {
590
+ at: string;
591
+ outcome: "unavailable" | "no_results" | "none_supported";
592
+ claimText: string;
593
+ tried: string[];
594
+ }>>;
595
+ }, "strip", z.ZodTypeAny, {
596
+ id: string;
597
+ kind: "factual" | "opinion" | "framing";
598
+ author: "model" | "writer" | "mixed";
599
+ quote: string;
600
+ confirmed: boolean;
601
+ sectionId: string;
602
+ position: number;
603
+ authorAt: string;
604
+ sourceStatus: "none" | "supported" | "not_checked" | "contradicted" | "attached" | "partly_supported" | "not_supported" | "stale";
605
+ lookup?: {
606
+ at: string;
607
+ outcome: "unavailable" | "no_results" | "none_supported";
608
+ claimText: string;
609
+ tried: string[];
610
+ } | undefined;
611
+ check?: {
612
+ model: string;
613
+ reason: string;
614
+ ranAt: string;
615
+ claimText: string;
616
+ sourceFingerprints: Record<string, string>;
617
+ } | undefined;
618
+ needsRecheck?: boolean | undefined;
619
+ }, {
620
+ id: string;
621
+ kind: "factual" | "opinion" | "framing";
622
+ author: "model" | "writer" | "mixed";
623
+ quote: string;
624
+ confirmed: boolean;
625
+ sectionId: string;
626
+ position: number;
627
+ authorAt: string;
628
+ sourceStatus: "none" | "supported" | "not_checked" | "contradicted" | "attached" | "partly_supported" | "not_supported" | "stale";
629
+ lookup?: {
630
+ at: string;
631
+ outcome: "unavailable" | "no_results" | "none_supported";
632
+ claimText: string;
633
+ tried: string[];
634
+ } | undefined;
635
+ check?: {
636
+ model: string;
637
+ reason: string;
638
+ ranAt: string;
639
+ claimText: string;
640
+ sourceFingerprints: Record<string, string>;
641
+ } | undefined;
642
+ needsRecheck?: boolean | undefined;
643
+ }>, "many">;
644
+ sources: z.ZodArray<z.ZodObject<{
645
+ id: z.ZodString;
646
+ kind: z.ZodEnum<["web", "code", "document", "upload", "say_so"]>;
647
+ address: z.ZodOptional<z.ZodString>;
648
+ /** The passage as read. Source text is data, never instructions. */
649
+ passage: z.ZodOptional<z.ZodString>;
650
+ readAt: z.ZodOptional<z.ZodString>;
651
+ fingerprint: z.ZodOptional<z.ZodString>;
652
+ trust: z.ZodEnum<["normal", "lower"]>;
653
+ freshness: z.ZodEnum<["unchecked", "current", "changed", "unreachable"]>;
654
+ note: z.ZodOptional<z.ZodString>;
655
+ /** New text read from the address that differs from `passage`. Held until the writer accepts it; checks keep using `passage`. */
656
+ fetchedPassage: z.ZodOptional<z.ZodString>;
657
+ /** For a code or text file: only these lines (1-based, inclusive) are kept as the passage. */
658
+ lines: z.ZodOptional<z.ZodObject<{
659
+ from: z.ZodNumber;
660
+ to: z.ZodNumber;
661
+ }, "strip", z.ZodTypeAny, {
662
+ from: number;
663
+ to: number;
664
+ }, {
665
+ from: number;
666
+ to: number;
667
+ }>>;
668
+ }, "strip", z.ZodTypeAny, {
669
+ id: string;
670
+ freshness: "changed" | "unreachable" | "current" | "unchecked";
671
+ kind: "code" | "document" | "web" | "say_so" | "upload";
672
+ trust: "lower" | "normal";
673
+ note?: string | undefined;
674
+ address?: string | undefined;
675
+ passage?: string | undefined;
676
+ readAt?: string | undefined;
677
+ fingerprint?: string | undefined;
678
+ fetchedPassage?: string | undefined;
679
+ lines?: {
680
+ from: number;
681
+ to: number;
682
+ } | undefined;
683
+ }, {
684
+ id: string;
685
+ freshness: "changed" | "unreachable" | "current" | "unchecked";
686
+ kind: "code" | "document" | "web" | "say_so" | "upload";
687
+ trust: "lower" | "normal";
688
+ note?: string | undefined;
689
+ address?: string | undefined;
690
+ passage?: string | undefined;
691
+ readAt?: string | undefined;
692
+ fingerprint?: string | undefined;
693
+ fetchedPassage?: string | undefined;
694
+ lines?: {
695
+ from: number;
696
+ to: number;
697
+ } | undefined;
698
+ }>, "many">;
699
+ links: z.ZodArray<z.ZodObject<{
700
+ id: z.ZodString;
701
+ from: z.ZodObject<{
702
+ type: z.ZodEnum<["section", "claim", "source", "comment"]>;
703
+ id: z.ZodString;
704
+ }, "strip", z.ZodTypeAny, {
705
+ id: string;
706
+ type: "source" | "section" | "claim" | "comment";
707
+ }, {
708
+ id: string;
709
+ type: "source" | "section" | "claim" | "comment";
710
+ }>;
711
+ to: z.ZodObject<{
712
+ type: z.ZodEnum<["section", "claim", "source", "comment"]>;
713
+ id: z.ZodString;
714
+ }, "strip", z.ZodTypeAny, {
715
+ id: string;
716
+ type: "source" | "section" | "claim" | "comment";
717
+ }, {
718
+ id: string;
719
+ type: "source" | "section" | "claim" | "comment";
720
+ }>;
721
+ /** A recorded value, not a fixed set: the kinds are expected to grow. Starting kinds: rests_on, supported_by, repeats, about. */
722
+ kind: z.ZodString;
723
+ origin: z.ZodEnum<["proposed", "confirmed", "drawn"]>;
724
+ confidence: z.ZodOptional<z.ZodNumber>;
725
+ reason: z.ZodOptional<z.ZodString>;
726
+ at: z.ZodString;
727
+ }, "strip", z.ZodTypeAny, {
728
+ at: string;
729
+ id: string;
730
+ from: {
731
+ id: string;
732
+ type: "source" | "section" | "claim" | "comment";
733
+ };
734
+ to: {
735
+ id: string;
736
+ type: "source" | "section" | "claim" | "comment";
737
+ };
738
+ kind: string;
739
+ origin: "proposed" | "confirmed" | "drawn";
740
+ confidence?: number | undefined;
741
+ reason?: string | undefined;
742
+ }, {
743
+ at: string;
744
+ id: string;
745
+ from: {
746
+ id: string;
747
+ type: "source" | "section" | "claim" | "comment";
748
+ };
749
+ to: {
750
+ id: string;
751
+ type: "source" | "section" | "claim" | "comment";
752
+ };
753
+ kind: string;
754
+ origin: "proposed" | "confirmed" | "drawn";
755
+ confidence?: number | undefined;
756
+ reason?: string | undefined;
757
+ }>, "many">;
758
+ comments: z.ZodArray<z.ZodObject<{
759
+ id: z.ZodString;
760
+ articleId: z.ZodString;
761
+ label: z.ZodOptional<z.ZodString>;
762
+ reviewer: z.ZodOptional<z.ZodString>;
763
+ text: z.ZodString;
764
+ state: z.ZodEnum<["open", "addressed", "dismissed"]>;
765
+ decision: z.ZodOptional<z.ZodString>;
766
+ conflictsWith: z.ZodArray<z.ZodString, "many">;
767
+ origin: z.ZodEnum<["reviewer", "writer", "assistant"]>;
768
+ anchor: z.ZodOptional<z.ZodObject<{
769
+ type: z.ZodEnum<["section", "claim"]>;
770
+ id: z.ZodString;
771
+ }, "strip", z.ZodTypeAny, {
772
+ id: string;
773
+ type: "section" | "claim";
774
+ }, {
775
+ id: string;
776
+ type: "section" | "claim";
777
+ }>>;
778
+ span: z.ZodOptional<z.ZodObject<{
779
+ start: z.ZodNumber;
780
+ end: z.ZodNumber;
781
+ quote: z.ZodString;
782
+ }, "strip", z.ZodTypeAny, {
783
+ quote: string;
784
+ start: number;
785
+ end: number;
786
+ }, {
787
+ quote: string;
788
+ start: number;
789
+ end: number;
790
+ }>>;
791
+ outdated: z.ZodOptional<z.ZodBoolean>;
792
+ suggestionId: z.ZodOptional<z.ZodString>;
793
+ capturedAt: z.ZodString;
794
+ }, "strip", z.ZodTypeAny, {
795
+ id: string;
796
+ text: string;
797
+ origin: "reviewer" | "assistant" | "writer";
798
+ articleId: string;
799
+ state: "open" | "addressed" | "dismissed";
800
+ conflictsWith: string[];
801
+ capturedAt: string;
802
+ reviewer?: string | undefined;
803
+ decision?: string | undefined;
804
+ label?: string | undefined;
805
+ span?: {
806
+ quote: string;
807
+ start: number;
808
+ end: number;
809
+ } | undefined;
810
+ anchor?: {
811
+ id: string;
812
+ type: "section" | "claim";
813
+ } | undefined;
814
+ outdated?: boolean | undefined;
815
+ suggestionId?: string | undefined;
816
+ }, {
817
+ id: string;
818
+ text: string;
819
+ origin: "reviewer" | "assistant" | "writer";
820
+ articleId: string;
821
+ state: "open" | "addressed" | "dismissed";
822
+ conflictsWith: string[];
823
+ capturedAt: string;
824
+ reviewer?: string | undefined;
825
+ decision?: string | undefined;
826
+ label?: string | undefined;
827
+ span?: {
828
+ quote: string;
829
+ start: number;
830
+ end: number;
831
+ } | undefined;
832
+ anchor?: {
833
+ id: string;
834
+ type: "section" | "claim";
835
+ } | undefined;
836
+ outdated?: boolean | undefined;
837
+ suggestionId?: string | undefined;
838
+ }>, "many">;
839
+ /** Corrections the writer gave in chat (author's say-so). */
840
+ corrections: z.ZodArray<z.ZodObject<{
841
+ id: z.ZodString;
842
+ articleId: z.ZodString;
843
+ kind: z.ZodLiteral<"say_so">;
844
+ trust: z.ZodLiteral<"lower">;
845
+ note: z.ZodString;
846
+ supersedes: z.ZodOptional<z.ZodString>;
847
+ capturedAt: z.ZodString;
848
+ }, "strip", z.ZodTypeAny, {
849
+ id: string;
850
+ kind: "say_so";
851
+ note: string;
852
+ articleId: string;
853
+ capturedAt: string;
854
+ trust: "lower";
855
+ supersedes?: string | undefined;
856
+ }, {
857
+ id: string;
858
+ kind: "say_so";
859
+ note: string;
860
+ articleId: string;
861
+ capturedAt: string;
862
+ trust: "lower";
863
+ supersedes?: string | undefined;
864
+ }>, "many">;
865
+ suggestions: z.ZodArray<z.ZodObject<{
866
+ id: z.ZodString;
867
+ span: z.ZodObject<{
868
+ start: z.ZodNumber;
869
+ end: z.ZodNumber;
870
+ quote: z.ZodString;
871
+ }, "strip", z.ZodTypeAny, {
872
+ quote: string;
873
+ start: number;
874
+ end: number;
875
+ }, {
876
+ quote: string;
877
+ start: number;
878
+ end: number;
879
+ }>;
880
+ replacement: z.ZodString;
881
+ reason: z.ZodString;
882
+ proposedBy: z.ZodEnum<["assistant", "writer"]>;
883
+ /** The model that proposed it, when the assistant did. */
884
+ model: z.ZodOptional<z.ZodString>;
885
+ /** Ideas that this suggestion writes into the text; they are marked used when it is accepted. */
886
+ ideaIds: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
887
+ /** Reviewer comments this suggestion was written to address; they are marked addressed when it is accepted. */
888
+ commentIds: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
889
+ /** Sections this suggestion brings in line; their review mark is cleared when it is accepted. */
890
+ sectionIds: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
891
+ state: z.ZodEnum<["pending", "accepted", "rejected", "edited_accepted", "stale"]>;
892
+ createdAt: z.ZodString;
893
+ }, "strip", z.ZodTypeAny, {
894
+ id: string;
895
+ reason: string;
896
+ createdAt: string;
897
+ span: {
898
+ quote: string;
899
+ start: number;
900
+ end: number;
901
+ };
902
+ state: "rejected" | "pending" | "stale" | "accepted" | "edited_accepted";
903
+ replacement: string;
904
+ proposedBy: "assistant" | "writer";
905
+ model?: string | undefined;
906
+ ideaIds?: string[] | undefined;
907
+ commentIds?: string[] | undefined;
908
+ sectionIds?: string[] | undefined;
909
+ }, {
910
+ id: string;
911
+ reason: string;
912
+ createdAt: string;
913
+ span: {
914
+ quote: string;
915
+ start: number;
916
+ end: number;
917
+ };
918
+ state: "rejected" | "pending" | "stale" | "accepted" | "edited_accepted";
919
+ replacement: string;
920
+ proposedBy: "assistant" | "writer";
921
+ model?: string | undefined;
922
+ ideaIds?: string[] | undefined;
923
+ commentIds?: string[] | undefined;
924
+ sectionIds?: string[] | undefined;
925
+ }>, "many">;
926
+ /** Ideas: material the writer or the assistant collected, to be written into the article. */
927
+ ideas: z.ZodDefault<z.ZodArray<z.ZodObject<{
928
+ id: z.ZodString;
929
+ text: z.ZodString;
930
+ /** Who added it. When the assistant did, `model` says which model. */
931
+ origin: z.ZodEnum<["writer", "assistant"]>;
932
+ model: z.ZodOptional<z.ZodString>;
933
+ /** The section it is meant for, if the writer or the assistant said so. */
934
+ sectionId: z.ZodOptional<z.ZodString>;
935
+ /** open: not in the text yet. used: written into the article. dropped: set aside. */
936
+ state: z.ZodEnum<["open", "used", "dropped"]>;
937
+ usedIn: z.ZodOptional<z.ZodString>;
938
+ createdAt: z.ZodString;
939
+ }, "strip", z.ZodTypeAny, {
940
+ id: string;
941
+ text: string;
942
+ origin: "assistant" | "writer";
943
+ createdAt: string;
944
+ state: "used" | "dropped" | "open";
945
+ model?: string | undefined;
946
+ sectionId?: string | undefined;
947
+ usedIn?: string | undefined;
948
+ }, {
949
+ id: string;
950
+ text: string;
951
+ origin: "assistant" | "writer";
952
+ createdAt: string;
953
+ state: "used" | "dropped" | "open";
954
+ model?: string | undefined;
955
+ sectionId?: string | undefined;
956
+ usedIn?: string | undefined;
957
+ }>, "many">>;
958
+ /** The writer's free notes for this article: one block of text to click into and edit. */
959
+ scratchpad: z.ZodOptional<z.ZodString>;
960
+ /** The brief and the writing profile the assistant follows when it proposes text. */
961
+ brief: z.ZodOptional<z.ZodObject<{
962
+ audience: z.ZodOptional<z.ZodString>;
963
+ purpose: z.ZodOptional<z.ZodString>;
964
+ tone: z.ZodOptional<z.ZodString>;
965
+ length: z.ZodOptional<z.ZodString>;
966
+ notes: z.ZodOptional<z.ZodString>;
967
+ }, "strip", z.ZodTypeAny, {
968
+ length?: string | undefined;
969
+ notes?: string | undefined;
970
+ purpose?: string | undefined;
971
+ audience?: string | undefined;
972
+ tone?: string | undefined;
973
+ }, {
974
+ length?: string | undefined;
975
+ notes?: string | undefined;
976
+ purpose?: string | undefined;
977
+ audience?: string | undefined;
978
+ tone?: string | undefined;
979
+ }>>;
980
+ style: z.ZodOptional<z.ZodObject<{
981
+ id: z.ZodString;
982
+ name: z.ZodString;
983
+ voice: z.ZodDefault<z.ZodString>;
984
+ /** Words the writer wants used, and the words they replace. */
985
+ terms: z.ZodDefault<z.ZodArray<z.ZodObject<{
986
+ use: z.ZodString;
987
+ instead: z.ZodOptional<z.ZodString>;
988
+ }, "strip", z.ZodTypeAny, {
989
+ use: string;
990
+ instead?: string | undefined;
991
+ }, {
992
+ use: string;
993
+ instead?: string | undefined;
994
+ }>, "many">>;
995
+ }, "strip", z.ZodTypeAny, {
996
+ id: string;
997
+ name: string;
998
+ voice: string;
999
+ terms: {
1000
+ use: string;
1001
+ instead?: string | undefined;
1002
+ }[];
1003
+ }, {
1004
+ id: string;
1005
+ name: string;
1006
+ voice?: string | undefined;
1007
+ terms?: {
1008
+ use: string;
1009
+ instead?: string | undefined;
1010
+ }[] | undefined;
1011
+ }>>;
1012
+ }, "strip", z.ZodTypeAny, {
1013
+ id: string;
1014
+ status: "drafting" | "ready" | "published";
1015
+ sources: {
1016
+ id: string;
1017
+ freshness: "changed" | "unreachable" | "current" | "unchecked";
1018
+ kind: "code" | "document" | "web" | "say_so" | "upload";
1019
+ trust: "lower" | "normal";
1020
+ note?: string | undefined;
1021
+ address?: string | undefined;
1022
+ passage?: string | undefined;
1023
+ readAt?: string | undefined;
1024
+ fingerprint?: string | undefined;
1025
+ fetchedPassage?: string | undefined;
1026
+ lines?: {
1027
+ from: number;
1028
+ to: number;
1029
+ } | undefined;
1030
+ }[];
1031
+ suggestions: {
1032
+ id: string;
1033
+ reason: string;
1034
+ createdAt: string;
1035
+ span: {
1036
+ quote: string;
1037
+ start: number;
1038
+ end: number;
1039
+ };
1040
+ state: "rejected" | "pending" | "stale" | "accepted" | "edited_accepted";
1041
+ replacement: string;
1042
+ proposedBy: "assistant" | "writer";
1043
+ model?: string | undefined;
1044
+ ideaIds?: string[] | undefined;
1045
+ commentIds?: string[] | undefined;
1046
+ sectionIds?: string[] | undefined;
1047
+ }[];
1048
+ comments: {
1049
+ id: string;
1050
+ text: string;
1051
+ origin: "reviewer" | "assistant" | "writer";
1052
+ articleId: string;
1053
+ state: "open" | "addressed" | "dismissed";
1054
+ conflictsWith: string[];
1055
+ capturedAt: string;
1056
+ reviewer?: string | undefined;
1057
+ decision?: string | undefined;
1058
+ label?: string | undefined;
1059
+ span?: {
1060
+ quote: string;
1061
+ start: number;
1062
+ end: number;
1063
+ } | undefined;
1064
+ anchor?: {
1065
+ id: string;
1066
+ type: "section" | "claim";
1067
+ } | undefined;
1068
+ outdated?: boolean | undefined;
1069
+ suggestionId?: string | undefined;
1070
+ }[];
1071
+ formatVersion: number;
1072
+ corrections: {
1073
+ id: string;
1074
+ kind: "say_so";
1075
+ note: string;
1076
+ articleId: string;
1077
+ capturedAt: string;
1078
+ trust: "lower";
1079
+ supersedes?: string | undefined;
1080
+ }[];
1081
+ title: string;
1082
+ sections: {
1083
+ id: string;
1084
+ review: {
1085
+ state: "clean" | "needs_review" | "being_revised" | "held";
1086
+ at?: string | undefined;
1087
+ reason?: string | undefined;
1088
+ setBy?: "writer" | "resolver" | "editor" | undefined;
1089
+ };
1090
+ span: {
1091
+ start: number;
1092
+ end: number;
1093
+ };
1094
+ heading: string;
1095
+ level: number;
1096
+ order: number;
1097
+ parentId?: string | undefined;
1098
+ purpose?: string | undefined;
1099
+ }[];
1100
+ claims: {
1101
+ id: string;
1102
+ kind: "factual" | "opinion" | "framing";
1103
+ author: "model" | "writer" | "mixed";
1104
+ quote: string;
1105
+ confirmed: boolean;
1106
+ sectionId: string;
1107
+ position: number;
1108
+ authorAt: string;
1109
+ sourceStatus: "none" | "supported" | "not_checked" | "contradicted" | "attached" | "partly_supported" | "not_supported" | "stale";
1110
+ lookup?: {
1111
+ at: string;
1112
+ outcome: "unavailable" | "no_results" | "none_supported";
1113
+ claimText: string;
1114
+ tried: string[];
1115
+ } | undefined;
1116
+ check?: {
1117
+ model: string;
1118
+ reason: string;
1119
+ ranAt: string;
1120
+ claimText: string;
1121
+ sourceFingerprints: Record<string, string>;
1122
+ } | undefined;
1123
+ needsRecheck?: boolean | undefined;
1124
+ }[];
1125
+ links: {
1126
+ at: string;
1127
+ id: string;
1128
+ from: {
1129
+ id: string;
1130
+ type: "source" | "section" | "claim" | "comment";
1131
+ };
1132
+ to: {
1133
+ id: string;
1134
+ type: "source" | "section" | "claim" | "comment";
1135
+ };
1136
+ kind: string;
1137
+ origin: "proposed" | "confirmed" | "drawn";
1138
+ confidence?: number | undefined;
1139
+ reason?: string | undefined;
1140
+ }[];
1141
+ ideas: {
1142
+ id: string;
1143
+ text: string;
1144
+ origin: "assistant" | "writer";
1145
+ createdAt: string;
1146
+ state: "used" | "dropped" | "open";
1147
+ model?: string | undefined;
1148
+ sectionId?: string | undefined;
1149
+ usedIn?: string | undefined;
1150
+ }[];
1151
+ name?: string | undefined;
1152
+ brief?: {
1153
+ length?: string | undefined;
1154
+ notes?: string | undefined;
1155
+ purpose?: string | undefined;
1156
+ audience?: string | undefined;
1157
+ tone?: string | undefined;
1158
+ } | undefined;
1159
+ style?: {
1160
+ id: string;
1161
+ name: string;
1162
+ voice: string;
1163
+ terms: {
1164
+ use: string;
1165
+ instead?: string | undefined;
1166
+ }[];
1167
+ } | undefined;
1168
+ scratchpad?: string | undefined;
1169
+ }, {
1170
+ id: string;
1171
+ status: "drafting" | "ready" | "published";
1172
+ sources: {
1173
+ id: string;
1174
+ freshness: "changed" | "unreachable" | "current" | "unchecked";
1175
+ kind: "code" | "document" | "web" | "say_so" | "upload";
1176
+ trust: "lower" | "normal";
1177
+ note?: string | undefined;
1178
+ address?: string | undefined;
1179
+ passage?: string | undefined;
1180
+ readAt?: string | undefined;
1181
+ fingerprint?: string | undefined;
1182
+ fetchedPassage?: string | undefined;
1183
+ lines?: {
1184
+ from: number;
1185
+ to: number;
1186
+ } | undefined;
1187
+ }[];
1188
+ suggestions: {
1189
+ id: string;
1190
+ reason: string;
1191
+ createdAt: string;
1192
+ span: {
1193
+ quote: string;
1194
+ start: number;
1195
+ end: number;
1196
+ };
1197
+ state: "rejected" | "pending" | "stale" | "accepted" | "edited_accepted";
1198
+ replacement: string;
1199
+ proposedBy: "assistant" | "writer";
1200
+ model?: string | undefined;
1201
+ ideaIds?: string[] | undefined;
1202
+ commentIds?: string[] | undefined;
1203
+ sectionIds?: string[] | undefined;
1204
+ }[];
1205
+ comments: {
1206
+ id: string;
1207
+ text: string;
1208
+ origin: "reviewer" | "assistant" | "writer";
1209
+ articleId: string;
1210
+ state: "open" | "addressed" | "dismissed";
1211
+ conflictsWith: string[];
1212
+ capturedAt: string;
1213
+ reviewer?: string | undefined;
1214
+ decision?: string | undefined;
1215
+ label?: string | undefined;
1216
+ span?: {
1217
+ quote: string;
1218
+ start: number;
1219
+ end: number;
1220
+ } | undefined;
1221
+ anchor?: {
1222
+ id: string;
1223
+ type: "section" | "claim";
1224
+ } | undefined;
1225
+ outdated?: boolean | undefined;
1226
+ suggestionId?: string | undefined;
1227
+ }[];
1228
+ formatVersion: number;
1229
+ corrections: {
1230
+ id: string;
1231
+ kind: "say_so";
1232
+ note: string;
1233
+ articleId: string;
1234
+ capturedAt: string;
1235
+ trust: "lower";
1236
+ supersedes?: string | undefined;
1237
+ }[];
1238
+ title: string;
1239
+ sections: {
1240
+ id: string;
1241
+ review: {
1242
+ state: "clean" | "needs_review" | "being_revised" | "held";
1243
+ at?: string | undefined;
1244
+ reason?: string | undefined;
1245
+ setBy?: "writer" | "resolver" | "editor" | undefined;
1246
+ };
1247
+ span: {
1248
+ start: number;
1249
+ end: number;
1250
+ };
1251
+ heading: string;
1252
+ level: number;
1253
+ order: number;
1254
+ parentId?: string | undefined;
1255
+ purpose?: string | undefined;
1256
+ }[];
1257
+ claims: {
1258
+ id: string;
1259
+ kind: "factual" | "opinion" | "framing";
1260
+ author: "model" | "writer" | "mixed";
1261
+ quote: string;
1262
+ confirmed: boolean;
1263
+ sectionId: string;
1264
+ position: number;
1265
+ authorAt: string;
1266
+ sourceStatus: "none" | "supported" | "not_checked" | "contradicted" | "attached" | "partly_supported" | "not_supported" | "stale";
1267
+ lookup?: {
1268
+ at: string;
1269
+ outcome: "unavailable" | "no_results" | "none_supported";
1270
+ claimText: string;
1271
+ tried: string[];
1272
+ } | undefined;
1273
+ check?: {
1274
+ model: string;
1275
+ reason: string;
1276
+ ranAt: string;
1277
+ claimText: string;
1278
+ sourceFingerprints: Record<string, string>;
1279
+ } | undefined;
1280
+ needsRecheck?: boolean | undefined;
1281
+ }[];
1282
+ links: {
1283
+ at: string;
1284
+ id: string;
1285
+ from: {
1286
+ id: string;
1287
+ type: "source" | "section" | "claim" | "comment";
1288
+ };
1289
+ to: {
1290
+ id: string;
1291
+ type: "source" | "section" | "claim" | "comment";
1292
+ };
1293
+ kind: string;
1294
+ origin: "proposed" | "confirmed" | "drawn";
1295
+ confidence?: number | undefined;
1296
+ reason?: string | undefined;
1297
+ }[];
1298
+ name?: string | undefined;
1299
+ brief?: {
1300
+ length?: string | undefined;
1301
+ notes?: string | undefined;
1302
+ purpose?: string | undefined;
1303
+ audience?: string | undefined;
1304
+ tone?: string | undefined;
1305
+ } | undefined;
1306
+ style?: {
1307
+ id: string;
1308
+ name: string;
1309
+ voice?: string | undefined;
1310
+ terms?: {
1311
+ use: string;
1312
+ instead?: string | undefined;
1313
+ }[] | undefined;
1314
+ } | undefined;
1315
+ ideas?: {
1316
+ id: string;
1317
+ text: string;
1318
+ origin: "assistant" | "writer";
1319
+ createdAt: string;
1320
+ state: "used" | "dropped" | "open";
1321
+ model?: string | undefined;
1322
+ sectionId?: string | undefined;
1323
+ usedIn?: string | undefined;
1324
+ }[] | undefined;
1325
+ scratchpad?: string | undefined;
1326
+ }>;
1327
+ export type ArticleMeta = z.infer<typeof ArticleMetaSchema>;
1328
+ export declare function createArticleMeta(id: string, title: string): ArticleMeta;
1329
+ export type LoadResult = {
1330
+ ok: true;
1331
+ meta: ArticleMeta;
1332
+ } | {
1333
+ ok: false;
1334
+ reason: string;
1335
+ };
1336
+ /** Loads a metadata file's JSON. Refuses what it cannot read completely, with a message; never loads partially. */
1337
+ export declare function parseArticleMeta(raw: unknown): LoadResult;