@docs-sdk-dev/reader 0.0.0-stage → 0.4.0-next.0

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 (108) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +97 -2
  3. package/dist/annotation-projection.d.ts +35 -0
  4. package/dist/annotation-projection.js +78 -0
  5. package/dist/annotation-projection.js.map +1 -0
  6. package/dist/artifacts.d.ts +19 -0
  7. package/dist/artifacts.js +33 -0
  8. package/dist/artifacts.js.map +1 -0
  9. package/dist/ask.d.ts +41 -0
  10. package/dist/ask.js +89 -0
  11. package/dist/ask.js.map +1 -0
  12. package/dist/collection-view.d.ts +190 -0
  13. package/dist/collection-view.js +170 -0
  14. package/dist/collection-view.js.map +1 -0
  15. package/dist/composition.d.ts +199 -0
  16. package/dist/composition.js +473 -0
  17. package/dist/composition.js.map +1 -0
  18. package/dist/condition.d.ts +17 -0
  19. package/dist/condition.js +61 -0
  20. package/dist/condition.js.map +1 -0
  21. package/dist/content-schema.d.ts +182 -0
  22. package/dist/content-schema.js +288 -0
  23. package/dist/content-schema.js.map +1 -0
  24. package/dist/context-search.d.ts +168 -0
  25. package/dist/context-search.js +73 -0
  26. package/dist/context-search.js.map +1 -0
  27. package/dist/context-store.d.ts +93 -0
  28. package/dist/context-store.js +438 -0
  29. package/dist/context-store.js.map +1 -0
  30. package/dist/dimension-runtime.d.ts +203 -0
  31. package/dist/dimension-runtime.js +737 -0
  32. package/dist/dimension-runtime.js.map +1 -0
  33. package/dist/dimensions.d.ts +84 -0
  34. package/dist/dimensions.js +136 -0
  35. package/dist/dimensions.js.map +1 -0
  36. package/dist/directory-navigation.d.ts +60 -0
  37. package/dist/directory-navigation.js +41 -0
  38. package/dist/directory-navigation.js.map +1 -0
  39. package/dist/directory-sections.d.ts +9 -0
  40. package/dist/directory-sections.js +76 -0
  41. package/dist/directory-sections.js.map +1 -0
  42. package/dist/document-reader.d.ts +1017 -0
  43. package/dist/document-reader.js +396 -0
  44. package/dist/document-reader.js.map +1 -0
  45. package/dist/document-selection.d.ts +412 -0
  46. package/dist/document-selection.js +45 -0
  47. package/dist/document-selection.js.map +1 -0
  48. package/dist/evidence.d.ts +102 -0
  49. package/dist/evidence.js +104 -0
  50. package/dist/evidence.js.map +1 -0
  51. package/dist/index.d.ts +19 -0
  52. package/dist/index.js +23 -0
  53. package/dist/model.d.ts +89 -0
  54. package/dist/model.js +31 -0
  55. package/dist/model.js.map +1 -0
  56. package/dist/module.d.ts +657 -0
  57. package/dist/module.js +199 -0
  58. package/dist/module.js.map +1 -0
  59. package/dist/navigation-view.d.ts +33 -0
  60. package/dist/navigation-view.js +68 -0
  61. package/dist/navigation-view.js.map +1 -0
  62. package/dist/node.d.ts +2004 -0
  63. package/dist/node.js +210 -0
  64. package/dist/node.js.map +1 -0
  65. package/dist/open-docs.d.ts +1396 -0
  66. package/dist/open-docs.js +198 -0
  67. package/dist/open-docs.js.map +1 -0
  68. package/dist/outline.d.ts +97 -0
  69. package/dist/outline.js +171 -0
  70. package/dist/outline.js.map +1 -0
  71. package/dist/persistence.d.ts +82 -0
  72. package/dist/persistence.js +377 -0
  73. package/dist/persistence.js.map +1 -0
  74. package/dist/projection-catalog.d.ts +23 -0
  75. package/dist/projection-catalog.js +45 -0
  76. package/dist/projection-catalog.js.map +1 -0
  77. package/dist/publication.d.ts +59 -0
  78. package/dist/publication.js +11 -0
  79. package/dist/publication.js.map +1 -0
  80. package/dist/reader.d.ts +236 -0
  81. package/dist/reader.js +400 -0
  82. package/dist/reader.js.map +1 -0
  83. package/dist/references.d.ts +54 -0
  84. package/dist/references.js +70 -0
  85. package/dist/references.js.map +1 -0
  86. package/dist/retrieval.d.ts +82 -0
  87. package/dist/retrieval.js +135 -0
  88. package/dist/retrieval.js.map +1 -0
  89. package/dist/search-view.d.ts +11 -0
  90. package/dist/search-view.js +30 -0
  91. package/dist/search-view.js.map +1 -0
  92. package/dist/search.d.ts +95 -0
  93. package/dist/search.js +234 -0
  94. package/dist/search.js.map +1 -0
  95. package/dist/semantic.d.ts +177 -0
  96. package/dist/semantic.js +104 -0
  97. package/dist/semantic.js.map +1 -0
  98. package/dist/skills.d.ts +21 -0
  99. package/dist/skills.js +42 -0
  100. package/dist/skills.js.map +1 -0
  101. package/docs/index.md +10 -0
  102. package/docs/sdk/composition.md +72 -0
  103. package/docs/sdk/reader-storage.md +70 -0
  104. package/docs/sdk/reader.md +99 -0
  105. package/docs/zh-CN/sdk/composition.md +72 -0
  106. package/docs/zh-CN/sdk/reader-storage.md +70 -0
  107. package/docs/zh-CN/sdk/reader.md +99 -0
  108. package/package.json +69 -4
@@ -0,0 +1,1017 @@
1
+ import { type Identity, type MarkdownHeadingIndexes, type ProjectionLoss, type Provenance } from "./model.js";
2
+ import type { JsonValue } from "./content-schema.js";
3
+ import type { PublicationProjectionCatalog } from "./projection-catalog.js";
4
+ import type { SourceRole, SourceReceipt } from "./publication.js";
5
+ import { type Context, type Resolution, type SemanticPointer } from "./semantic.js";
6
+ import { type LocalizedText } from "./directory-navigation.js";
7
+ import { type PublishedNavigation, type NavigationPlacement } from "./navigation-view.js";
8
+ import { type OutlineContribution, type OutlineProjection, type OutlineView } from "./outline.js";
9
+ import { type DimensionDefinitions, type PreferenceChoices } from "./dimensions.js";
10
+ export { type PreferenceChoices } from "./dimensions.js";
11
+ export declare function projectReadingChoices(declarations: Manifest["dimensionDeclarations"]): PreferenceChoices;
12
+ export declare function readingContext(policy?: PreferenceChoices, requested?: Context, edition?: Context): Context;
13
+ /** Canonical route dimensions own the edition. The public pm preference selects installation examples on other pages. */
14
+ export declare function sharedPageContext(dimensions: Context, manager: string | null, parameters?: Iterable<readonly [string, string]>, policy?: PreferenceChoices): Context;
15
+ import { type DimensionDeclaration, type PublishedDimensionPolicy, type DimensionRequest, type DimensionInspection } from "./dimension-runtime.js";
16
+ export { resolveDocumentContext } from "./dimension-runtime.js";
17
+ type ManifestSection = {
18
+ id: string;
19
+ title?: string;
20
+ /** UTF-16 offset of this section in the complete published Markdown. */
21
+ documentOffset?: number;
22
+ markdown: string;
23
+ provenance: Provenance[];
24
+ /** Added in M6. Headings inside the section with their anchors, for outlines and links. */
25
+ outline?: OutlineContribution[];
26
+ headings?: {
27
+ id: string;
28
+ text: string;
29
+ depth: number;
30
+ }[];
31
+ /** Half-open UTF-16 offsets into this section’s published Markdown, in rendered-heading order. */
32
+ headingRanges?: readonly (readonly [number, number])[];
33
+ /** Exact Markdown ranges for independent semantic outline anchors. */
34
+ outlineRanges?: Record<string, readonly [number, number]>;
35
+ /** A separately inventoried artifact for a short heading in a large section. */
36
+ headingFiles?: Record<number, string>;
37
+ /** Present when the Markdown heading order differs from the rendered anchors. */
38
+ headingIndexes?: MarkdownHeadingIndexes;
39
+ };
40
+ export interface Manifest {
41
+ /** Discovery artifacts for the public documentation interface. */
42
+ agent?: {
43
+ indexes: readonly string[];
44
+ };
45
+ /** Stable project namespace for preference records, independent of publication URLs. */
46
+ persistenceId?: string;
47
+ /** Confirms that this host owns the unqualified Context storage keys on its origin. */
48
+ dimensionDeclarations?: readonly DimensionDeclaration[];
49
+ dimensionPolicy?: PublishedDimensionPolicy;
50
+ dimensionPlacements?: Readonly<Record<string, Context>>;
51
+ dimensionGraph?: readonly import("./dimension-runtime.js").RegisteredDimension[];
52
+ navigationTitles?: Record<string, LocalizedText>;
53
+ navigationViews?: PublishedNavigation[];
54
+ outlineView?: OutlineView;
55
+ outlineViews?: Readonly<Record<string, OutlineView>>;
56
+ extensions?: readonly {
57
+ id: string;
58
+ version: string;
59
+ dependencies: readonly string[];
60
+ requires?: Readonly<Record<string, string>>;
61
+ components?: readonly string[];
62
+ hooks?: readonly string[];
63
+ contentTypes: readonly {
64
+ id: string;
65
+ name: string;
66
+ version: number;
67
+ kind: string;
68
+ mdx?: string;
69
+ schema?: unknown;
70
+ outputSchema?: unknown;
71
+ }[];
72
+ entityTypes: readonly {
73
+ name: string;
74
+ version: number;
75
+ schema?: unknown;
76
+ outputSchema?: unknown;
77
+ }[];
78
+ relations: readonly {
79
+ name: string;
80
+ from: string;
81
+ to: string;
82
+ context: string;
83
+ impact: string;
84
+ cardinality?: string;
85
+ ordered?: boolean;
86
+ }[];
87
+ dimensions?: DimensionDefinitions;
88
+ operations?: readonly {
89
+ id: string;
90
+ version: number;
91
+ effect: string;
92
+ }[];
93
+ collections: readonly string[];
94
+ templates: readonly string[];
95
+ outlines?: readonly string[];
96
+ contracts: readonly string[];
97
+ }[];
98
+ /** Deployment URL prefix. Artifact paths and document routes remain local to this publication. */
99
+ basePath?: string;
100
+ schemaVersion: 1;
101
+ buildRevision: string;
102
+ /** Declared by newer static publishers. Older publications have no delivery catalog. */
103
+ projections?: PublicationProjectionCatalog;
104
+ documents: {
105
+ key: string;
106
+ identity: Identity & {
107
+ dimensions: Record<string, string>;
108
+ };
109
+ route: string;
110
+ title: string;
111
+ availability?: Context;
112
+ navigationHidden?: boolean;
113
+ outlineView?: OutlineView | null;
114
+ description?: string;
115
+ /** Validated user-defined metadata for structured consumers. */
116
+ meta?: Record<string, JsonValue>;
117
+ /** Author-selected custom metadata fields for the article header. */
118
+ showMetadata?: readonly string[];
119
+ /** Layout instructions consumed by Web hosts independently of custom metadata. */
120
+ presentation?: {
121
+ layout?: string | false;
122
+ actions?: readonly {
123
+ text: string;
124
+ href: string;
125
+ }[];
126
+ rendererProfile?: string;
127
+ };
128
+ origin?: {
129
+ kind: "generated" | "overlay" | "authored";
130
+ collection: string;
131
+ source: string;
132
+ upstreamRevision: string;
133
+ authored?: string;
134
+ };
135
+ mode: "template" | "replacement" | "markdown";
136
+ template?: {
137
+ id: string;
138
+ revision: string;
139
+ };
140
+ provenance: Provenance[];
141
+ markdown: string;
142
+ contextDefaults?: Context;
143
+ contextVariants?: {
144
+ context: Context;
145
+ markdown: string;
146
+ sections: ManifestSection[];
147
+ }[];
148
+ sections: ManifestSection[];
149
+ /** Added in M5. What each target could not express, per section. Absent when every target is complete. */
150
+ losses?: (ProjectionLoss & {
151
+ section: string;
152
+ })[];
153
+ }[];
154
+ sources?: readonly SourceReceipt[];
155
+ /** Added in M2. Absent in older builds; readers that ignore it keep working. */
156
+ semantic?: SemanticPointer;
157
+ /**
158
+ * Added in M3. The project snapshot the build was made from. `toolchain` is the lockfile revision; `roles` names
159
+ * files whose change is attributed to the whole build rather than to entities.
160
+ */
161
+ snapshot?: {
162
+ schemaVersion: 1;
163
+ revision: string;
164
+ sourceMapRevision?: string;
165
+ environmentRevision?: string;
166
+ presentationRevision?: string;
167
+ projectionInputs?: Record<string, string | null>;
168
+ toolchain?: string;
169
+ lockfiles?: Record<string, string>;
170
+ roles: Record<string, SourceRole>;
171
+ };
172
+ /** Added in M3. Source path → dependent entity variants, for impact analysis. */
173
+ dependencies?: {
174
+ path: string;
175
+ revision: string;
176
+ };
177
+ /** Added in M4. Section-edition search index, ranked with BM25 by `createSearch`. */
178
+ search?: {
179
+ path: string;
180
+ revision: string;
181
+ entries: number;
182
+ };
183
+ /** Added in M8. Old URLs and where they now live; each `from` has a static redirect page. */
184
+ redirects?: {
185
+ from: string;
186
+ to: string;
187
+ }[];
188
+ /** Added in M3. Documentation contract results for this build. */
189
+ contracts?: {
190
+ path: string;
191
+ configRevision?: string;
192
+ status: "pass" | "fail";
193
+ errors: number;
194
+ warnings: number;
195
+ waived: number;
196
+ };
197
+ }
198
+ type PublishedSection = Manifest["documents"][number]["sections"][number];
199
+ /** Published entry or section metadata with its resolved Markdown and optional heading excerpt. */
200
+ export type PublishedMarkdownRead = Manifest["documents"][number] | PublishedSection | (PublishedSection & {
201
+ heading: NonNullable<PublishedSection["headings"]>[number];
202
+ });
203
+ export declare function documentKey(identity: Identity): string;
204
+ export declare function createReader(manifest: Manifest, readText: (path: string) => Promise<string>): {
205
+ lookup: (identity: Identity) => {
206
+ key: string;
207
+ identity: Identity & {
208
+ dimensions: Record<string, string>;
209
+ };
210
+ route: string;
211
+ title: string;
212
+ availability?: Context;
213
+ navigationHidden?: boolean;
214
+ outlineView?: OutlineView | null;
215
+ description?: string;
216
+ /** Validated user-defined metadata for structured consumers. */
217
+ meta?: Record<string, JsonValue>;
218
+ /** Author-selected custom metadata fields for the article header. */
219
+ showMetadata?: readonly string[];
220
+ /** Layout instructions consumed by Web hosts independently of custom metadata. */
221
+ presentation?: {
222
+ layout?: string | false;
223
+ actions?: readonly {
224
+ text: string;
225
+ href: string;
226
+ }[];
227
+ rendererProfile?: string;
228
+ };
229
+ origin?: {
230
+ kind: "generated" | "overlay" | "authored";
231
+ collection: string;
232
+ source: string;
233
+ upstreamRevision: string;
234
+ authored?: string;
235
+ };
236
+ mode: "template" | "replacement" | "markdown";
237
+ template?: {
238
+ id: string;
239
+ revision: string;
240
+ };
241
+ provenance: Provenance[];
242
+ markdown: string;
243
+ contextDefaults?: Context;
244
+ contextVariants?: {
245
+ context: Context;
246
+ markdown: string;
247
+ sections: ManifestSection[];
248
+ }[];
249
+ sections: ManifestSection[];
250
+ /** Added in M5. What each target could not express, per section. Absent when every target is complete. */
251
+ losses?: (ProjectionLoss & {
252
+ section: string;
253
+ })[];
254
+ } | null;
255
+ /** Select a portable projection for an explicit reading Context, or open an exact edition. */
256
+ projection: (identity: Identity, requested?: Context) => {
257
+ key: string;
258
+ identity: Identity & {
259
+ dimensions: Record<string, string>;
260
+ };
261
+ route: string;
262
+ title: string;
263
+ availability?: Context;
264
+ navigationHidden?: boolean;
265
+ outlineView?: OutlineView | null;
266
+ description?: string;
267
+ /** Validated user-defined metadata for structured consumers. */
268
+ meta?: Record<string, JsonValue>;
269
+ /** Author-selected custom metadata fields for the article header. */
270
+ showMetadata?: readonly string[];
271
+ /** Layout instructions consumed by Web hosts independently of custom metadata. */
272
+ presentation?: {
273
+ layout?: string | false;
274
+ actions?: readonly {
275
+ text: string;
276
+ href: string;
277
+ }[];
278
+ rendererProfile?: string;
279
+ };
280
+ origin?: {
281
+ kind: "generated" | "overlay" | "authored";
282
+ collection: string;
283
+ source: string;
284
+ upstreamRevision: string;
285
+ authored?: string;
286
+ };
287
+ mode: "template" | "replacement" | "markdown";
288
+ template?: {
289
+ id: string;
290
+ revision: string;
291
+ };
292
+ provenance: Provenance[];
293
+ markdown: string;
294
+ contextDefaults?: Context;
295
+ contextVariants?: {
296
+ context: Context;
297
+ markdown: string;
298
+ sections: ManifestSection[];
299
+ }[];
300
+ sections: ManifestSection[];
301
+ /** Added in M5. What each target could not express, per section. Absent when every target is complete. */
302
+ losses?: (ProjectionLoss & {
303
+ section: string;
304
+ })[];
305
+ } | null;
306
+ resolveCompatible: (identity: Identity) => Resolution<{
307
+ key: string;
308
+ identity: Identity & {
309
+ dimensions: Record<string, string>;
310
+ };
311
+ route: string;
312
+ title: string;
313
+ availability?: Context;
314
+ navigationHidden?: boolean;
315
+ outlineView?: OutlineView | null;
316
+ description?: string;
317
+ /** Validated user-defined metadata for structured consumers. */
318
+ meta?: Record<string, JsonValue>;
319
+ /** Author-selected custom metadata fields for the article header. */
320
+ showMetadata?: readonly string[];
321
+ /** Layout instructions consumed by Web hosts independently of custom metadata. */
322
+ presentation?: {
323
+ layout?: string | false;
324
+ actions?: readonly {
325
+ text: string;
326
+ href: string;
327
+ }[];
328
+ rendererProfile?: string;
329
+ };
330
+ origin?: {
331
+ kind: "generated" | "overlay" | "authored";
332
+ collection: string;
333
+ source: string;
334
+ upstreamRevision: string;
335
+ authored?: string;
336
+ };
337
+ mode: "template" | "replacement" | "markdown";
338
+ template?: {
339
+ id: string;
340
+ revision: string;
341
+ };
342
+ provenance: Provenance[];
343
+ markdown: string;
344
+ contextDefaults?: Context;
345
+ contextVariants?: {
346
+ context: Context;
347
+ markdown: string;
348
+ sections: ManifestSection[];
349
+ }[];
350
+ sections: ManifestSection[];
351
+ /** Added in M5. What each target could not express, per section. Absent when every target is complete. */
352
+ losses?: (ProjectionLoss & {
353
+ section: string;
354
+ })[];
355
+ }>;
356
+ resolveEdition: (identity: Identity) => Resolution<{
357
+ key: string;
358
+ identity: Identity & {
359
+ dimensions: Record<string, string>;
360
+ };
361
+ route: string;
362
+ title: string;
363
+ availability?: Context;
364
+ navigationHidden?: boolean;
365
+ outlineView?: OutlineView | null;
366
+ description?: string;
367
+ /** Validated user-defined metadata for structured consumers. */
368
+ meta?: Record<string, JsonValue>;
369
+ /** Author-selected custom metadata fields for the article header. */
370
+ showMetadata?: readonly string[];
371
+ /** Layout instructions consumed by Web hosts independently of custom metadata. */
372
+ presentation?: {
373
+ layout?: string | false;
374
+ actions?: readonly {
375
+ text: string;
376
+ href: string;
377
+ }[];
378
+ rendererProfile?: string;
379
+ };
380
+ origin?: {
381
+ kind: "generated" | "overlay" | "authored";
382
+ collection: string;
383
+ source: string;
384
+ upstreamRevision: string;
385
+ authored?: string;
386
+ };
387
+ mode: "template" | "replacement" | "markdown";
388
+ template?: {
389
+ id: string;
390
+ revision: string;
391
+ };
392
+ provenance: Provenance[];
393
+ markdown: string;
394
+ contextDefaults?: Context;
395
+ contextVariants?: {
396
+ context: Context;
397
+ markdown: string;
398
+ sections: ManifestSection[];
399
+ }[];
400
+ sections: ManifestSection[];
401
+ /** Added in M5. What each target could not express, per section. Absent when every target is complete. */
402
+ losses?: (ProjectionLoss & {
403
+ section: string;
404
+ })[];
405
+ }> & {
406
+ resolution?: Pick<DimensionInspection<{
407
+ key: string;
408
+ identity: Identity & {
409
+ dimensions: Record<string, string>;
410
+ };
411
+ route: string;
412
+ title: string;
413
+ availability?: Context;
414
+ navigationHidden?: boolean;
415
+ outlineView?: OutlineView | null;
416
+ description?: string;
417
+ /** Validated user-defined metadata for structured consumers. */
418
+ meta?: Record<string, JsonValue>;
419
+ /** Author-selected custom metadata fields for the article header. */
420
+ showMetadata?: readonly string[];
421
+ /** Layout instructions consumed by Web hosts independently of custom metadata. */
422
+ presentation?: {
423
+ layout?: string | false;
424
+ actions?: readonly {
425
+ text: string;
426
+ href: string;
427
+ }[];
428
+ rendererProfile?: string;
429
+ };
430
+ origin?: {
431
+ kind: "generated" | "overlay" | "authored";
432
+ collection: string;
433
+ source: string;
434
+ upstreamRevision: string;
435
+ authored?: string;
436
+ };
437
+ mode: "template" | "replacement" | "markdown";
438
+ template?: {
439
+ id: string;
440
+ revision: string;
441
+ };
442
+ provenance: Provenance[];
443
+ markdown: string;
444
+ contextDefaults?: Context;
445
+ contextVariants?: {
446
+ context: Context;
447
+ markdown: string;
448
+ sections: ManifestSection[];
449
+ }[];
450
+ sections: ManifestSection[];
451
+ /** Added in M5. What each target could not express, per section. Absent when every target is complete. */
452
+ losses?: (ProjectionLoss & {
453
+ section: string;
454
+ })[];
455
+ }>, "effective" | "reasons" | "requested" | "resolved" | "status">;
456
+ };
457
+ resolve: (identity: Identity) => Resolution<Manifest["documents"][number]>;
458
+ context(identity: Identity, request?: DimensionRequest): DimensionInspection<{
459
+ key: string;
460
+ identity: Identity & {
461
+ dimensions: Record<string, string>;
462
+ };
463
+ route: string;
464
+ title: string;
465
+ availability?: Context;
466
+ navigationHidden?: boolean;
467
+ outlineView?: OutlineView | null;
468
+ description?: string;
469
+ /** Validated user-defined metadata for structured consumers. */
470
+ meta?: Record<string, JsonValue>;
471
+ /** Author-selected custom metadata fields for the article header. */
472
+ showMetadata?: readonly string[];
473
+ /** Layout instructions consumed by Web hosts independently of custom metadata. */
474
+ presentation?: {
475
+ layout?: string | false;
476
+ actions?: readonly {
477
+ text: string;
478
+ href: string;
479
+ }[];
480
+ rendererProfile?: string;
481
+ };
482
+ origin?: {
483
+ kind: "generated" | "overlay" | "authored";
484
+ collection: string;
485
+ source: string;
486
+ upstreamRevision: string;
487
+ authored?: string;
488
+ };
489
+ mode: "template" | "replacement" | "markdown";
490
+ template?: {
491
+ id: string;
492
+ revision: string;
493
+ };
494
+ provenance: Provenance[];
495
+ markdown: string;
496
+ contextDefaults?: Context;
497
+ contextVariants?: {
498
+ context: Context;
499
+ markdown: string;
500
+ sections: ManifestSection[];
501
+ }[];
502
+ sections: ManifestSection[];
503
+ /** Added in M5. What each target could not express, per section. Absent when every target is complete. */
504
+ losses?: (ProjectionLoss & {
505
+ section: string;
506
+ })[];
507
+ }>;
508
+ navigation(identity: Identity, view?: string, placement?: string, requested?: Context): {
509
+ current: NavigationPlacement | undefined;
510
+ breadcrumbs: NavigationPlacement[];
511
+ previous: NavigationPlacement | undefined;
512
+ next: NavigationPlacement | undefined;
513
+ view: PublishedNavigation;
514
+ } | null | undefined;
515
+ outline(identity: Identity, view?: OutlineProjection | string, requested?: Context): import("./outline.js").OutlineEntry[] | null;
516
+ /** Resolve an HTTP pathname using the publication's canonical routes and declared aliases. */
517
+ route(pathname: string): {
518
+ status: "redirect";
519
+ to: string;
520
+ document?: undefined;
521
+ } | {
522
+ to?: undefined;
523
+ status: "not-found";
524
+ document?: undefined;
525
+ } | {
526
+ to?: undefined;
527
+ status: "document";
528
+ document: {
529
+ key: string;
530
+ identity: Identity & {
531
+ dimensions: Record<string, string>;
532
+ };
533
+ route: string;
534
+ title: string;
535
+ availability?: Context;
536
+ navigationHidden?: boolean;
537
+ outlineView?: OutlineView | null;
538
+ description?: string;
539
+ /** Validated user-defined metadata for structured consumers. */
540
+ meta?: Record<string, JsonValue>;
541
+ /** Author-selected custom metadata fields for the article header. */
542
+ showMetadata?: readonly string[];
543
+ /** Layout instructions consumed by Web hosts independently of custom metadata. */
544
+ presentation?: {
545
+ layout?: string | false;
546
+ actions?: readonly {
547
+ text: string;
548
+ href: string;
549
+ }[];
550
+ rendererProfile?: string;
551
+ };
552
+ origin?: {
553
+ kind: "generated" | "overlay" | "authored";
554
+ collection: string;
555
+ source: string;
556
+ upstreamRevision: string;
557
+ authored?: string;
558
+ };
559
+ mode: "template" | "replacement" | "markdown";
560
+ template?: {
561
+ id: string;
562
+ revision: string;
563
+ };
564
+ provenance: Provenance[];
565
+ markdown: string;
566
+ contextDefaults?: Context;
567
+ contextVariants?: {
568
+ context: Context;
569
+ markdown: string;
570
+ sections: ManifestSection[];
571
+ }[];
572
+ sections: ManifestSection[];
573
+ /** Added in M5. What each target could not express, per section. Absent when every target is complete. */
574
+ losses?: (ProjectionLoss & {
575
+ section: string;
576
+ })[];
577
+ };
578
+ };
579
+ /**
580
+ * Read a document edition, section or rendered anchor. A heading reads its subsection and an independent
581
+ * semantic anchor reads its projected block.
582
+ */
583
+ read(identity: Identity, sectionId?: string, headingId?: string, requested?: Context): Promise<PublishedMarkdownRead | null>;
584
+ };
585
+ /** Use the applicable Dimension Context for a semantic entity request. */
586
+ export declare function factContext(reader: Pick<ReturnType<typeof createReader>, "context">, id: string, requested?: Context): Context;
587
+ export interface PublicationHost {
588
+ readBytes(path: string): Promise<Uint8Array>;
589
+ sha256(bytes: Uint8Array): string | Promise<string>;
590
+ }
591
+ /** Yield the manifest, the remaining verified files, then the exact inventory bytes as a receipt for the complete copy. */
592
+ export declare function readPublicationArtifacts(inventoryRevision: string, host: PublicationHost): AsyncGenerator<{
593
+ path: string;
594
+ bytes: Uint8Array<ArrayBufferLike>;
595
+ }, void, unknown>;
596
+ /** Open a publication by its externally retained SHA-256, verifying only the files a caller reads. */
597
+ export declare function openPinnedReader(inventoryRevision: string, host: PublicationHost): Promise<{
598
+ buildRevision: string;
599
+ manifest: Manifest;
600
+ reader: {
601
+ lookup: (identity: Identity) => {
602
+ key: string;
603
+ identity: Identity & {
604
+ dimensions: Record<string, string>;
605
+ };
606
+ route: string;
607
+ title: string;
608
+ availability?: Context;
609
+ navigationHidden?: boolean;
610
+ outlineView?: OutlineView | null;
611
+ description?: string;
612
+ /** Validated user-defined metadata for structured consumers. */
613
+ meta?: Record<string, JsonValue>;
614
+ /** Author-selected custom metadata fields for the article header. */
615
+ showMetadata?: readonly string[];
616
+ /** Layout instructions consumed by Web hosts independently of custom metadata. */
617
+ presentation?: {
618
+ layout?: string | false;
619
+ actions?: readonly {
620
+ text: string;
621
+ href: string;
622
+ }[];
623
+ rendererProfile?: string;
624
+ };
625
+ origin?: {
626
+ kind: "generated" | "overlay" | "authored";
627
+ collection: string;
628
+ source: string;
629
+ upstreamRevision: string;
630
+ authored?: string;
631
+ };
632
+ mode: "template" | "replacement" | "markdown";
633
+ template?: {
634
+ id: string;
635
+ revision: string;
636
+ };
637
+ provenance: Provenance[];
638
+ markdown: string;
639
+ contextDefaults?: Context;
640
+ contextVariants?: {
641
+ context: Context;
642
+ markdown: string;
643
+ sections: ManifestSection[];
644
+ }[];
645
+ sections: ManifestSection[];
646
+ /** Added in M5. What each target could not express, per section. Absent when every target is complete. */
647
+ losses?: (ProjectionLoss & {
648
+ section: string;
649
+ })[];
650
+ } | null;
651
+ /** Select a portable projection for an explicit reading Context, or open an exact edition. */
652
+ projection: (identity: Identity, requested?: Context) => {
653
+ key: string;
654
+ identity: Identity & {
655
+ dimensions: Record<string, string>;
656
+ };
657
+ route: string;
658
+ title: string;
659
+ availability?: Context;
660
+ navigationHidden?: boolean;
661
+ outlineView?: OutlineView | null;
662
+ description?: string;
663
+ /** Validated user-defined metadata for structured consumers. */
664
+ meta?: Record<string, JsonValue>;
665
+ /** Author-selected custom metadata fields for the article header. */
666
+ showMetadata?: readonly string[];
667
+ /** Layout instructions consumed by Web hosts independently of custom metadata. */
668
+ presentation?: {
669
+ layout?: string | false;
670
+ actions?: readonly {
671
+ text: string;
672
+ href: string;
673
+ }[];
674
+ rendererProfile?: string;
675
+ };
676
+ origin?: {
677
+ kind: "generated" | "overlay" | "authored";
678
+ collection: string;
679
+ source: string;
680
+ upstreamRevision: string;
681
+ authored?: string;
682
+ };
683
+ mode: "template" | "replacement" | "markdown";
684
+ template?: {
685
+ id: string;
686
+ revision: string;
687
+ };
688
+ provenance: Provenance[];
689
+ markdown: string;
690
+ contextDefaults?: Context;
691
+ contextVariants?: {
692
+ context: Context;
693
+ markdown: string;
694
+ sections: ManifestSection[];
695
+ }[];
696
+ sections: ManifestSection[];
697
+ /** Added in M5. What each target could not express, per section. Absent when every target is complete. */
698
+ losses?: (ProjectionLoss & {
699
+ section: string;
700
+ })[];
701
+ } | null;
702
+ resolveCompatible: (identity: Identity) => Resolution<{
703
+ key: string;
704
+ identity: Identity & {
705
+ dimensions: Record<string, string>;
706
+ };
707
+ route: string;
708
+ title: string;
709
+ availability?: Context;
710
+ navigationHidden?: boolean;
711
+ outlineView?: OutlineView | null;
712
+ description?: string;
713
+ /** Validated user-defined metadata for structured consumers. */
714
+ meta?: Record<string, JsonValue>;
715
+ /** Author-selected custom metadata fields for the article header. */
716
+ showMetadata?: readonly string[];
717
+ /** Layout instructions consumed by Web hosts independently of custom metadata. */
718
+ presentation?: {
719
+ layout?: string | false;
720
+ actions?: readonly {
721
+ text: string;
722
+ href: string;
723
+ }[];
724
+ rendererProfile?: string;
725
+ };
726
+ origin?: {
727
+ kind: "generated" | "overlay" | "authored";
728
+ collection: string;
729
+ source: string;
730
+ upstreamRevision: string;
731
+ authored?: string;
732
+ };
733
+ mode: "template" | "replacement" | "markdown";
734
+ template?: {
735
+ id: string;
736
+ revision: string;
737
+ };
738
+ provenance: Provenance[];
739
+ markdown: string;
740
+ contextDefaults?: Context;
741
+ contextVariants?: {
742
+ context: Context;
743
+ markdown: string;
744
+ sections: ManifestSection[];
745
+ }[];
746
+ sections: ManifestSection[];
747
+ /** Added in M5. What each target could not express, per section. Absent when every target is complete. */
748
+ losses?: (ProjectionLoss & {
749
+ section: string;
750
+ })[];
751
+ }>;
752
+ resolveEdition: (identity: Identity) => Resolution<{
753
+ key: string;
754
+ identity: Identity & {
755
+ dimensions: Record<string, string>;
756
+ };
757
+ route: string;
758
+ title: string;
759
+ availability?: Context;
760
+ navigationHidden?: boolean;
761
+ outlineView?: OutlineView | null;
762
+ description?: string;
763
+ /** Validated user-defined metadata for structured consumers. */
764
+ meta?: Record<string, JsonValue>;
765
+ /** Author-selected custom metadata fields for the article header. */
766
+ showMetadata?: readonly string[];
767
+ /** Layout instructions consumed by Web hosts independently of custom metadata. */
768
+ presentation?: {
769
+ layout?: string | false;
770
+ actions?: readonly {
771
+ text: string;
772
+ href: string;
773
+ }[];
774
+ rendererProfile?: string;
775
+ };
776
+ origin?: {
777
+ kind: "generated" | "overlay" | "authored";
778
+ collection: string;
779
+ source: string;
780
+ upstreamRevision: string;
781
+ authored?: string;
782
+ };
783
+ mode: "template" | "replacement" | "markdown";
784
+ template?: {
785
+ id: string;
786
+ revision: string;
787
+ };
788
+ provenance: Provenance[];
789
+ markdown: string;
790
+ contextDefaults?: Context;
791
+ contextVariants?: {
792
+ context: Context;
793
+ markdown: string;
794
+ sections: ManifestSection[];
795
+ }[];
796
+ sections: ManifestSection[];
797
+ /** Added in M5. What each target could not express, per section. Absent when every target is complete. */
798
+ losses?: (ProjectionLoss & {
799
+ section: string;
800
+ })[];
801
+ }> & {
802
+ resolution?: Pick<DimensionInspection<{
803
+ key: string;
804
+ identity: Identity & {
805
+ dimensions: Record<string, string>;
806
+ };
807
+ route: string;
808
+ title: string;
809
+ availability?: Context;
810
+ navigationHidden?: boolean;
811
+ outlineView?: OutlineView | null;
812
+ description?: string;
813
+ /** Validated user-defined metadata for structured consumers. */
814
+ meta?: Record<string, JsonValue>;
815
+ /** Author-selected custom metadata fields for the article header. */
816
+ showMetadata?: readonly string[];
817
+ /** Layout instructions consumed by Web hosts independently of custom metadata. */
818
+ presentation?: {
819
+ layout?: string | false;
820
+ actions?: readonly {
821
+ text: string;
822
+ href: string;
823
+ }[];
824
+ rendererProfile?: string;
825
+ };
826
+ origin?: {
827
+ kind: "generated" | "overlay" | "authored";
828
+ collection: string;
829
+ source: string;
830
+ upstreamRevision: string;
831
+ authored?: string;
832
+ };
833
+ mode: "template" | "replacement" | "markdown";
834
+ template?: {
835
+ id: string;
836
+ revision: string;
837
+ };
838
+ provenance: Provenance[];
839
+ markdown: string;
840
+ contextDefaults?: Context;
841
+ contextVariants?: {
842
+ context: Context;
843
+ markdown: string;
844
+ sections: ManifestSection[];
845
+ }[];
846
+ sections: ManifestSection[];
847
+ /** Added in M5. What each target could not express, per section. Absent when every target is complete. */
848
+ losses?: (ProjectionLoss & {
849
+ section: string;
850
+ })[];
851
+ }>, "effective" | "reasons" | "requested" | "resolved" | "status">;
852
+ };
853
+ resolve: (identity: Identity) => Resolution<Manifest["documents"][number]>;
854
+ context(identity: Identity, request?: DimensionRequest): DimensionInspection<{
855
+ key: string;
856
+ identity: Identity & {
857
+ dimensions: Record<string, string>;
858
+ };
859
+ route: string;
860
+ title: string;
861
+ availability?: Context;
862
+ navigationHidden?: boolean;
863
+ outlineView?: OutlineView | null;
864
+ description?: string;
865
+ /** Validated user-defined metadata for structured consumers. */
866
+ meta?: Record<string, JsonValue>;
867
+ /** Author-selected custom metadata fields for the article header. */
868
+ showMetadata?: readonly string[];
869
+ /** Layout instructions consumed by Web hosts independently of custom metadata. */
870
+ presentation?: {
871
+ layout?: string | false;
872
+ actions?: readonly {
873
+ text: string;
874
+ href: string;
875
+ }[];
876
+ rendererProfile?: string;
877
+ };
878
+ origin?: {
879
+ kind: "generated" | "overlay" | "authored";
880
+ collection: string;
881
+ source: string;
882
+ upstreamRevision: string;
883
+ authored?: string;
884
+ };
885
+ mode: "template" | "replacement" | "markdown";
886
+ template?: {
887
+ id: string;
888
+ revision: string;
889
+ };
890
+ provenance: Provenance[];
891
+ markdown: string;
892
+ contextDefaults?: Context;
893
+ contextVariants?: {
894
+ context: Context;
895
+ markdown: string;
896
+ sections: ManifestSection[];
897
+ }[];
898
+ sections: ManifestSection[];
899
+ /** Added in M5. What each target could not express, per section. Absent when every target is complete. */
900
+ losses?: (ProjectionLoss & {
901
+ section: string;
902
+ })[];
903
+ }>;
904
+ navigation(identity: Identity, view?: string, placement?: string, requested?: Context): {
905
+ current: NavigationPlacement | undefined;
906
+ breadcrumbs: NavigationPlacement[];
907
+ previous: NavigationPlacement | undefined;
908
+ next: NavigationPlacement | undefined;
909
+ view: PublishedNavigation;
910
+ } | null | undefined;
911
+ outline(identity: Identity, view?: OutlineProjection | string, requested?: Context): import("./outline.js").OutlineEntry[] | null;
912
+ /** Resolve an HTTP pathname using the publication's canonical routes and declared aliases. */
913
+ route(pathname: string): {
914
+ status: "redirect";
915
+ to: string;
916
+ document?: undefined;
917
+ } | {
918
+ to?: undefined;
919
+ status: "not-found";
920
+ document?: undefined;
921
+ } | {
922
+ to?: undefined;
923
+ status: "document";
924
+ document: {
925
+ key: string;
926
+ identity: Identity & {
927
+ dimensions: Record<string, string>;
928
+ };
929
+ route: string;
930
+ title: string;
931
+ availability?: Context;
932
+ navigationHidden?: boolean;
933
+ outlineView?: OutlineView | null;
934
+ description?: string;
935
+ /** Validated user-defined metadata for structured consumers. */
936
+ meta?: Record<string, JsonValue>;
937
+ /** Author-selected custom metadata fields for the article header. */
938
+ showMetadata?: readonly string[];
939
+ /** Layout instructions consumed by Web hosts independently of custom metadata. */
940
+ presentation?: {
941
+ layout?: string | false;
942
+ actions?: readonly {
943
+ text: string;
944
+ href: string;
945
+ }[];
946
+ rendererProfile?: string;
947
+ };
948
+ origin?: {
949
+ kind: "generated" | "overlay" | "authored";
950
+ collection: string;
951
+ source: string;
952
+ upstreamRevision: string;
953
+ authored?: string;
954
+ };
955
+ mode: "template" | "replacement" | "markdown";
956
+ template?: {
957
+ id: string;
958
+ revision: string;
959
+ };
960
+ provenance: Provenance[];
961
+ markdown: string;
962
+ contextDefaults?: Context;
963
+ contextVariants?: {
964
+ context: Context;
965
+ markdown: string;
966
+ sections: ManifestSection[];
967
+ }[];
968
+ sections: ManifestSection[];
969
+ /** Added in M5. What each target could not express, per section. Absent when every target is complete. */
970
+ losses?: (ProjectionLoss & {
971
+ section: string;
972
+ })[];
973
+ };
974
+ };
975
+ /**
976
+ * Read a document edition, section or rendered anchor. A heading reads its subsection and an independent
977
+ * semantic anchor reads its projected block.
978
+ */
979
+ read(identity: Identity, sectionId?: string, headingId?: string, requested?: Context): Promise<PublishedMarkdownRead | null>;
980
+ };
981
+ readBytes: (path: string) => Promise<Uint8Array<ArrayBufferLike>>;
982
+ readText: (path: string) => Promise<string>;
983
+ artifact: (path: string) => {
984
+ sha256: string;
985
+ bytes: number;
986
+ };
987
+ projectionCatalog(): {
988
+ buildRevision: string;
989
+ inventoryRevision: string;
990
+ catalog: PublicationProjectionCatalog | null;
991
+ };
992
+ /** Discover the emitted projections of an exact edition from the verified inventory. */
993
+ documentProjections(identity: Identity): {
994
+ identity: Identity & {
995
+ dimensions: Record<string, string>;
996
+ };
997
+ buildRevision: string;
998
+ inventoryRevision: string;
999
+ provenance: Provenance[];
1000
+ targets: {
1001
+ sha256: string;
1002
+ bytes: number;
1003
+ target: ProjectionLoss["target"];
1004
+ path: string;
1005
+ href?: string;
1006
+ losses: {
1007
+ target: "web" | "markdown";
1008
+ kind: "raw-html" | "interactive-example" | "mdx-component" | "custom-block" | "custom-mark" | "media-player" | "native-view";
1009
+ severity: "warning" | "info";
1010
+ source: string;
1011
+ line?: number;
1012
+ message: string;
1013
+ section: string;
1014
+ }[];
1015
+ }[];
1016
+ } | null;
1017
+ }>;