@hollware/core 0.0.1 → 0.1.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.
package/dist/index.d.mts CHANGED
@@ -1,3 +1,2032 @@
1
+ import * as z from "zod";
2
+ import { MarkdownDocument } from "comark";
3
+ import { StandardJSONSchemaV1, StandardSchemaV1 } from "@standard-schema/spec";
4
+ //#region src/markdown/types.d.ts
5
+ /**
6
+ * The shapes of the Markdown pipeline: Markdown in, the Comark document and what the contracts
7
+ * need out (ADR-001, ADR-020). The Markdown is the source of truth; everything here is derived
8
+ * from it and can be derived again by `reparse`.
9
+ */
10
+ /**
11
+ * The Comark document of a revision, as Hollware stores it and hands it to sites: a site renders
12
+ * it with the Comark renderer of its framework, without parsing anything.
13
+ */
14
+ type EntryDocument = MarkdownDocument;
15
+ interface Heading {
16
+ readonly depth: 1 | 2 | 3 | 4 | 5 | 6;
17
+ readonly text: string;
18
+ /** Hollware's own heading id, which keeps letters outside ASCII (ADR-020). */
19
+ readonly id: string;
20
+ readonly line?: number;
21
+ }
22
+ /** The entry an internal link names. */
23
+ interface LinkTarget {
24
+ readonly collection: string;
25
+ readonly locale: string;
26
+ readonly slug: string;
27
+ }
28
+ /**
29
+ * A link of the body, by where it points:
30
+ * - `internal`: a path that matches a route of a collection of the site, so it names an entry;
31
+ * - `site`: any other path of the site, such as `/about/`;
32
+ * - `anchor`: `#section`, within the same entry;
33
+ * - `external`: an `http:`, `https:` or `mailto:` URL.
34
+ *
35
+ * A URL with any other scheme, such as `javascript:`, is no link: it is reported in `disallowed`.
36
+ */
37
+ interface LinkRef {
38
+ readonly href: string;
39
+ readonly kind: 'internal' | 'site' | 'anchor' | 'external';
40
+ /** For an `internal` link, the entry it names. */
41
+ readonly target?: LinkTarget;
42
+ readonly line?: number;
43
+ }
44
+ interface ImageRef {
45
+ readonly src: string;
46
+ /** The alternative text; `''` when it is missing or empty, which Comark does not tell apart. */
47
+ readonly alt: string;
48
+ readonly line?: number;
49
+ }
50
+ /** A component the body uses, with the props it was given. */
51
+ interface ComponentUse {
52
+ readonly name: string;
53
+ readonly props: Readonly<Record<string, unknown>>;
54
+ readonly line?: number;
55
+ }
56
+ /**
57
+ * Something the pipeline did not let through: the parser leaves a marker in its place, and the
58
+ * content-safety contracts report it (ADR-020). Nothing is dropped silently.
59
+ */
60
+ interface DisallowedMarker {
61
+ readonly kind: 'raw-html' | 'unknown-component' | 'disallowed-attribute' | 'unsafe-url';
62
+ /** The tag, component, attribute or URL. */
63
+ readonly name: string;
64
+ readonly line?: number;
65
+ }
66
+ /** What the pipeline finds in the body, for the contracts and the derived columns. */
67
+ interface ExtractedContent {
68
+ readonly headings: readonly Heading[];
69
+ readonly links: readonly LinkRef[];
70
+ readonly images: readonly ImageRef[];
71
+ readonly components: readonly ComponentUse[];
72
+ /** The words of the body, which `word_count` stores. */
73
+ readonly words: number;
74
+ readonly disallowed: readonly DisallowedMarker[];
75
+ }
76
+ /** A Markdown file the pipeline could parse. */
77
+ interface ProcessedMarkdown {
78
+ /** The frontmatter as YAML gave it, before the collection's schema looked at it. */
79
+ readonly frontmatter: Readonly<Record<string, unknown>>;
80
+ readonly document: EntryDocument;
81
+ readonly extracted: ExtractedContent;
82
+ /** The version of Comark that parsed it, stored as `comark_version`. */
83
+ readonly comarkVersion: string;
84
+ /**
85
+ * The version of Hollware's pipeline settings (plugins, allowlists, heading ids), stored as
86
+ * `pipeline_version`. It changes whenever the same Markdown would give another document.
87
+ */
88
+ readonly pipelineVersion: string;
89
+ }
90
+ interface ProcessMarkdownOptions {
91
+ /** The components the collection allows; the pipeline marks any other. */
92
+ readonly components: readonly string[];
93
+ /** The largest file accepted, in UTF-8 bytes. */
94
+ readonly maxMarkdownBytes: number;
95
+ /** The routes of the site's collections, by collection and then by locale, to find internal links. */
96
+ readonly routes: Readonly<Record<string, Readonly<Record<string, string>>>>;
97
+ }
98
+ /**
99
+ * The pipeline's answer. A file it cannot store, because it is too large or its frontmatter or
100
+ * syntax does not parse, comes back as violations (`size-limit`, `frontmatter-syntax`,
101
+ * `comark-parse`), which make the write `refused`.
102
+ */
103
+ type ProcessResult = {
104
+ readonly ok: true;
105
+ readonly value: ProcessedMarkdown;
106
+ } | {
107
+ readonly ok: false;
108
+ readonly violations: readonly Violation[];
109
+ };
110
+ /** Processes a Markdown file. It answers for any string and never throws. */
111
+ type ProcessMarkdown = (markdown: string, options: ProcessMarkdownOptions) => Promise<ProcessResult>;
112
+ /** Renders a stored document to HTML that holds no raw HTML. */
113
+ type RenderHtml = (document: EntryDocument) => Promise<string>;
114
+ //#endregion
115
+ //#region src/contracts/types.d.ts
116
+ /**
117
+ * The shapes of the contracts (ADR-004): what a contract looks at, what it reports, and the
118
+ * verdict of a revision. Contract errors never block a draft; they block publishing.
119
+ */
120
+ type Severity = 'error' | 'warning';
121
+ /**
122
+ * When contracts run. `write`: on every `create_draft` and `update_draft`. `publish`: on
123
+ * `validate` and `publish`, where the rules that depend on other entries (links, translation
124
+ * pairs) are checked against the site as it is at that moment.
125
+ */
126
+ type Phase = 'write' | 'publish';
127
+ /** One problem a contract found. */
128
+ interface Violation {
129
+ /** The id of the contract: `schema`, `translation-pair`, `seo-title-length`… */
130
+ readonly contract: string;
131
+ readonly severity: Severity;
132
+ /**
133
+ * A JSON Pointer into the entry seen as `{ frontmatter, body }`: `/frontmatter/description`,
134
+ * or `/body` for the Markdown body (with `line`).
135
+ */
136
+ readonly path: string;
137
+ /** What is wrong, for the agent. */
138
+ readonly message: string;
139
+ /** What to change so that the problem goes away, for the agent. Never empty. */
140
+ readonly fix: string;
141
+ /** The line of the Markdown file, from 1, when the problem has one. */
142
+ readonly line?: number;
143
+ }
144
+ /** The result of running the contracts of a collection on one revision. */
145
+ interface Verdict {
146
+ /** No errors; warnings do not count. */
147
+ readonly ok: boolean;
148
+ readonly phase: Phase;
149
+ readonly errors: readonly Violation[];
150
+ readonly warnings: readonly Violation[];
151
+ /**
152
+ * A hash of what the revision was checked against: the collection's schema, its components
153
+ * and the ids, severities and phases of its contracts. A stored verdict says which rules it
154
+ * answered to.
155
+ */
156
+ readonly contractsHash: string;
157
+ }
158
+ /** A warning the caller acknowledged to publish, as `publish` takes and `publications` records. */
159
+ interface AcknowledgedWarning {
160
+ readonly contract: string;
161
+ readonly path: string;
162
+ }
163
+ /** An entry of the site, by its natural key. */
164
+ interface EntryRef {
165
+ readonly collection: string;
166
+ readonly locale: string;
167
+ readonly slug: string;
168
+ }
169
+ /** What a lookup tells about an entry. */
170
+ interface EntryFacts {
171
+ readonly id: string;
172
+ readonly status: 'draft' | 'scheduled' | 'published';
173
+ readonly translationGroup: string | null;
174
+ }
175
+ /**
176
+ * How contracts read the other entries of the same site. The server implements it on D1, in
177
+ * chunks that stay under D1's 100 bound parameters per statement.
178
+ */
179
+ interface EntryLookup {
180
+ /** The entry for each ref, in the order of `refs`; `null` where there is none. */
181
+ lookupMany(refs: readonly EntryRef[]): Promise<readonly (EntryFacts | null)[]>;
182
+ /** Every entry of a translation group of a collection, one per locale. */
183
+ translations(collection: string, translationGroup: string): Promise<readonly (EntryRef & EntryFacts)[]>;
184
+ }
185
+ /** What a contract looks at. */
186
+ interface ContractContext<Frontmatter = Record<string, unknown>> {
187
+ readonly site: string;
188
+ readonly collection: string;
189
+ readonly locale: string;
190
+ readonly slug: string;
191
+ /** The entry's id, or `null` while the entry is being created. */
192
+ readonly entryId: string | null;
193
+ readonly phase: Phase;
194
+ /**
195
+ * The frontmatter as the collection's schema returned it. A contract runs only when the
196
+ * schema accepted the frontmatter; otherwise the schema's own violations stand alone.
197
+ */
198
+ readonly frontmatter: Frontmatter;
199
+ /** What the Markdown pipeline made of the file. */
200
+ readonly markdown: ProcessedMarkdown;
201
+ /** The other entries of the site. */
202
+ readonly entries: EntryLookup;
203
+ }
204
+ /** A problem a contract reports; Hollware adds the contract's id and severity. */
205
+ interface ContractFinding {
206
+ readonly path: string;
207
+ readonly message: string;
208
+ readonly fix: string;
209
+ readonly line?: number;
210
+ }
211
+ /** A rule with an id, a severity and a fix for every problem it finds (ADR-004). */
212
+ interface Contract<Frontmatter = Record<string, unknown>> {
213
+ /** Lowercase words joined by hyphens, unique within the collection: `seo-title-length`. */
214
+ readonly id: string;
215
+ readonly severity: Severity;
216
+ /** The phases it runs in; both when absent. A rule that reads other entries runs on `publish`. */
217
+ readonly phases?: readonly Phase[];
218
+ /** What the rule asks for, as `describe_site` shows it to agents. */
219
+ readonly description: string;
220
+ /** The problems it finds; an empty list passes. */
221
+ check(context: ContractContext<Frontmatter>): readonly ContractFinding[] | Promise<readonly ContractFinding[]>;
222
+ }
223
+ //#endregion
224
+ //#region src/config/types.d.ts
225
+ /**
226
+ * The shapes of `hollware.config.ts`. The config holds the sites of the deployment, and each site
227
+ * its collections; `describe_site` shows all of it to agents.
228
+ */
229
+ /**
230
+ * A schema Hollware can validate with and show to agents: a Standard Schema that also converts to
231
+ * JSON Schema. Zod 4.2 or later is one; any other library that implements both works too.
232
+ */
233
+ type DescribedSchema<Input = unknown, Output = Input> = StandardSchemaV1<Input, Output> & StandardJSONSchemaV1<Input, Output>;
234
+ /** What a schema returns once it accepts a value. */
235
+ type SchemaOutput<Schema extends DescribedSchema> = StandardSchemaV1.InferOutput<Schema>;
236
+ /** A component an entry may use in its body, such as `::callout{type="tip"}`. */
237
+ interface ComponentDefinition {
238
+ /** Validates the props. It should reject unknown keys (ADR-020). */
239
+ readonly props: DescribedSchema;
240
+ /** What the component is for, as `describe_site` shows it. */
241
+ readonly description?: string;
242
+ /** An example of its use in Markdown, as `describe_site` shows it. */
243
+ readonly example?: string;
244
+ }
245
+ /**
246
+ * A kind of entry of a site: a blog, docs pages, talks. It is generic over its schema, so that
247
+ * its contracts see the frontmatter the schema returns.
248
+ */
249
+ interface CollectionDefinition<Schema extends DescribedSchema = DescribedSchema> {
250
+ /** The frontmatter every entry must have; `describe_site` shows it as JSON Schema. */
251
+ readonly schema: Schema;
252
+ /**
253
+ * The public path of an entry in each locale of the site, with `:slug`:
254
+ * `{ es: '/blog/:slug/', en: '/en/blog/:slug/' }`. Links that match one are internal links.
255
+ */
256
+ readonly routes: Readonly<Record<string, string>>;
257
+ /**
258
+ * Translations: the frontmatter field that holds the key the translations of an entry share.
259
+ * Without it, the entries of the collection have no translations.
260
+ */
261
+ readonly translations?: {
262
+ readonly groupBy: string;
263
+ };
264
+ /** The frontmatter field that holds the entry's tags, an array of strings. */
265
+ readonly tags?: string;
266
+ /**
267
+ * The frontmatter field, an ISO 8601 date, that orders the published entries in listings,
268
+ * newest first. Without it, they follow the date of their first publication.
269
+ */
270
+ readonly sortBy?: string;
271
+ /** The components the body may use. Any other component is an error (ADR-020). */
272
+ readonly components?: Readonly<Record<string, ComponentDefinition>>;
273
+ /**
274
+ * Rules of the collection. The schema, the components, content safety and the size limit are
275
+ * checked anyway.
276
+ */
277
+ readonly contracts?: readonly Contract<SchemaOutput<Schema>>[];
278
+ /** The largest Markdown file accepted, in UTF-8 bytes. 512 KiB when absent. */
279
+ readonly maxMarkdownBytes?: number;
280
+ /** Guidance for whoever writes in this collection, in Markdown. */
281
+ readonly styleGuide?: string;
282
+ }
283
+ /** A site of the deployment. */
284
+ interface SiteDefinition {
285
+ /** Its locales, such as `['es', 'en']`. */
286
+ readonly locales: readonly [string, ...string[]];
287
+ readonly defaultLocale: string;
288
+ readonly collections: Readonly<Record<string, CollectionDefinition>>;
289
+ /** Guidance for whoever writes anywhere in the site, in Markdown. */
290
+ readonly styleGuide?: string;
291
+ }
292
+ /** What `hollware.config.ts` exports. */
293
+ interface HollwareConfig {
294
+ /**
295
+ * The sites, by key. The key is the site's id in the database, so it never changes once
296
+ * content exists. v0.1 serves exactly one site per deployment.
297
+ */
298
+ readonly sites: Readonly<Record<string, SiteDefinition>>;
299
+ }
300
+ /** A collection once the config is resolved: checked, with every default filled in. */
301
+ interface ResolvedCollection {
302
+ readonly name: string;
303
+ readonly schema: DescribedSchema;
304
+ readonly routes: Readonly<Record<string, string>>;
305
+ readonly translationGroupField: string | null;
306
+ readonly tagsField: string | null;
307
+ readonly sortByField: string | null;
308
+ readonly components: ReadonlyMap<string, ComponentDefinition>;
309
+ /** The contracts of the collection; the built-in ones run besides them. */
310
+ readonly contracts: readonly Contract<unknown>[];
311
+ readonly maxMarkdownBytes: number;
312
+ readonly styleGuide: string | null;
313
+ }
314
+ /** A site once the config is resolved. */
315
+ interface ResolvedSite {
316
+ readonly key: string;
317
+ readonly locales: readonly string[];
318
+ readonly defaultLocale: string;
319
+ readonly styleGuide: string | null;
320
+ readonly collections: ReadonlyMap<string, ResolvedCollection>;
321
+ }
322
+ /** The config once resolved, at the start of the Worker. v0.1 holds exactly one site. */
323
+ interface ResolvedConfig {
324
+ readonly sites: ReadonlyMap<string, ResolvedSite>;
325
+ }
326
+ /**
327
+ * Checks a config and fills in its defaults. It throws one error that lists every problem, each
328
+ * with its fix, so that a broken config stops the Worker at startup with an actionable message.
329
+ */
330
+ type ResolveConfig = (config: HollwareConfig) => ResolvedConfig;
331
+ //#endregion
332
+ //#region src/config/define.d.ts
333
+ /**
334
+ * The `define*` helpers only give the config its types: the frontmatter type of a collection
335
+ * flows from its schema into its contracts. Validating the config is the job of the config
336
+ * module, when the Worker starts.
337
+ */
338
+ /** Declares the config of a deployment: what `hollware.config.ts` exports. */
339
+ export declare function defineConfig(config: HollwareConfig): HollwareConfig;
340
+ /** Declares a collection. Its contracts see the frontmatter that its schema returns. */
341
+ export declare function defineCollection<const Schema extends DescribedSchema>(collection: CollectionDefinition<Schema>): CollectionDefinition<Schema>;
342
+ /** Declares a component that entries may use in their body. */
343
+ export declare function defineComponent(component: ComponentDefinition): ComponentDefinition;
344
+ /**
345
+ * Declares a contract shared by several collections, with the frontmatter type it reads given
346
+ * explicitly: `defineContract<{ title: string }>({ … })`. Inside `defineCollection`, write a
347
+ * contract as a plain object instead: its `check` gets the frontmatter type of the schema there,
348
+ * which a generic call inside the array would lose.
349
+ */
350
+ export declare function defineContract<Frontmatter = Record<string, unknown>>(contract: Contract<Frontmatter>): Contract<Frontmatter>;
351
+ //#endregion
352
+ //#region src/config/config-error.d.ts
353
+ /** One thing wrong with the config, found by `resolveConfig`. */
354
+ interface ConfigProblem {
355
+ /** Where it is, from the root of the config: `sites.playground.collections.blog.routes`. */
356
+ readonly path: string;
357
+ /** What is wrong, as a sentence without its final period. */
358
+ readonly message: string;
359
+ /** What to change, as a sentence with its final period. */
360
+ readonly fix: string;
361
+ }
362
+ /**
363
+ * The error `resolveConfig` throws: every problem of the config at once, so that a broken
364
+ * `hollware.config.ts` stops the Worker at startup with a message that says what to change. The
365
+ * message has one line per problem, `<path>: <message>. <fix>`, and `problems` holds them as data.
366
+ */
367
+ export declare class ConfigError extends Error {
368
+ readonly name = "ConfigError";
369
+ readonly problems: readonly ConfigProblem[];
370
+ constructor(problems: readonly ConfigProblem[]);
371
+ }
372
+ //#endregion
373
+ //#region src/config/constants.d.ts
374
+ /** The largest Markdown file a collection accepts when its config does not say, 512 KiB. */
375
+ export declare const DEFAULT_MAX_MARKDOWN_BYTES = 524288;
376
+ /**
377
+ * The largest `maxMarkdownBytes` a collection may set, 768 KiB. A revision row holds the Markdown,
378
+ * the frontmatter and the Comark document, which is about 1.3 times the Markdown, so a row is
379
+ * about 2.3 times the file, and the store refuses rows over 1.9 MB: a file over about 800 KB could
380
+ * never be saved. 768 KiB keeps a margin.
381
+ */
382
+ export declare const MAX_MARKDOWN_BYTES_CEILING = 786432;
383
+ declare namespace schemas_d_exports {
384
+ export { acknowledgedWarning, collectionDescription, collectionName, componentDescription, conflict, contractDescription, document, entry, entryId, entryStatus, entrySummary, format, locale, markdown, phase, publication, revisionId, severity, siteDescription, slug, verdict, version, violation };
385
+ }
386
+ /**
387
+ * The pieces the operation schemas share. Their descriptions become the JSON Schema that agents
388
+ * read over MCP, so they are written for the agent.
389
+ */
390
+ declare const collectionName: z.ZodString;
391
+ declare const locale: z.ZodString;
392
+ declare const slug: z.ZodString;
393
+ declare const entryId: z.ZodString;
394
+ declare const revisionId: z.ZodString;
395
+ declare const version: z.ZodNumber;
396
+ declare const markdown: z.ZodString;
397
+ declare const entryStatus: z.ZodEnum<{
398
+ draft: "draft";
399
+ published: "published";
400
+ scheduled: "scheduled";
401
+ }>;
402
+ declare const severity: z.ZodEnum<{
403
+ error: "error";
404
+ warning: "warning";
405
+ }>;
406
+ declare const phase: z.ZodEnum<{
407
+ publish: "publish";
408
+ write: "write";
409
+ }>;
410
+ declare const violation: z.ZodObject<{
411
+ contract: z.ZodString;
412
+ severity: z.ZodEnum<{
413
+ error: "error";
414
+ warning: "warning";
415
+ }>;
416
+ path: z.ZodString;
417
+ message: z.ZodString;
418
+ fix: z.ZodString;
419
+ line: z.ZodOptional<z.ZodNumber>;
420
+ }, z.core.$strip>;
421
+ declare const verdict: z.ZodObject<{
422
+ ok: z.ZodBoolean;
423
+ phase: z.ZodEnum<{
424
+ publish: "publish";
425
+ write: "write";
426
+ }>;
427
+ errors: z.ZodArray<z.ZodObject<{
428
+ contract: z.ZodString;
429
+ severity: z.ZodEnum<{
430
+ error: "error";
431
+ warning: "warning";
432
+ }>;
433
+ path: z.ZodString;
434
+ message: z.ZodString;
435
+ fix: z.ZodString;
436
+ line: z.ZodOptional<z.ZodNumber>;
437
+ }, z.core.$strip>>;
438
+ warnings: z.ZodArray<z.ZodObject<{
439
+ contract: z.ZodString;
440
+ severity: z.ZodEnum<{
441
+ error: "error";
442
+ warning: "warning";
443
+ }>;
444
+ path: z.ZodString;
445
+ message: z.ZodString;
446
+ fix: z.ZodString;
447
+ line: z.ZodOptional<z.ZodNumber>;
448
+ }, z.core.$strip>>;
449
+ contractsHash: z.ZodString;
450
+ }, z.core.$strip>;
451
+ declare const acknowledgedWarning: z.ZodObject<{
452
+ contract: z.ZodString;
453
+ path: z.ZodString;
454
+ }, z.core.$strip>;
455
+ declare const entrySummary: z.ZodObject<{
456
+ id: z.ZodString;
457
+ collection: z.ZodString;
458
+ locale: z.ZodString;
459
+ slug: z.ZodString;
460
+ translationGroup: z.ZodNullable<z.ZodString>;
461
+ status: z.ZodEnum<{
462
+ draft: "draft";
463
+ published: "published";
464
+ scheduled: "scheduled";
465
+ }>;
466
+ version: z.ZodNumber;
467
+ frontmatter: z.ZodRecord<z.ZodString, z.ZodUnknown>;
468
+ tags: z.ZodArray<z.ZodString>;
469
+ hasUnpublishedChanges: z.ZodBoolean;
470
+ publishedAt: z.ZodNullable<z.ZodString>;
471
+ updatedAt: z.ZodString;
472
+ }, z.core.$strip>;
473
+ declare const publication: z.ZodObject<{
474
+ revision: z.ZodString;
475
+ verdict: z.ZodObject<{
476
+ ok: z.ZodBoolean;
477
+ phase: z.ZodEnum<{
478
+ publish: "publish";
479
+ write: "write";
480
+ }>;
481
+ errors: z.ZodArray<z.ZodObject<{
482
+ contract: z.ZodString;
483
+ severity: z.ZodEnum<{
484
+ error: "error";
485
+ warning: "warning";
486
+ }>;
487
+ path: z.ZodString;
488
+ message: z.ZodString;
489
+ fix: z.ZodString;
490
+ line: z.ZodOptional<z.ZodNumber>;
491
+ }, z.core.$strip>>;
492
+ warnings: z.ZodArray<z.ZodObject<{
493
+ contract: z.ZodString;
494
+ severity: z.ZodEnum<{
495
+ error: "error";
496
+ warning: "warning";
497
+ }>;
498
+ path: z.ZodString;
499
+ message: z.ZodString;
500
+ fix: z.ZodString;
501
+ line: z.ZodOptional<z.ZodNumber>;
502
+ }, z.core.$strip>>;
503
+ contractsHash: z.ZodString;
504
+ }, z.core.$strip>;
505
+ acknowledged: z.ZodArray<z.ZodObject<{
506
+ contract: z.ZodString;
507
+ path: z.ZodString;
508
+ }, z.core.$strip>>;
509
+ at: z.ZodString;
510
+ }, z.core.$strip>;
511
+ /** The Comark document of a revision: what a site's renderer takes. */
512
+ declare const document: z.ZodObject<{
513
+ nodes: z.ZodArray<z.ZodUnknown>;
514
+ frontmatter: z.ZodRecord<z.ZodString, z.ZodUnknown>;
515
+ meta: z.ZodRecord<z.ZodString, z.ZodUnknown>;
516
+ }, z.core.$strip>;
517
+ declare const entry: z.ZodObject<{
518
+ id: z.ZodString;
519
+ collection: z.ZodString;
520
+ locale: z.ZodString;
521
+ slug: z.ZodString;
522
+ translationGroup: z.ZodNullable<z.ZodString>;
523
+ status: z.ZodEnum<{
524
+ draft: "draft";
525
+ published: "published";
526
+ scheduled: "scheduled";
527
+ }>;
528
+ version: z.ZodNumber;
529
+ frontmatter: z.ZodRecord<z.ZodString, z.ZodUnknown>;
530
+ tags: z.ZodArray<z.ZodString>;
531
+ hasUnpublishedChanges: z.ZodBoolean;
532
+ publishedAt: z.ZodNullable<z.ZodString>;
533
+ updatedAt: z.ZodString;
534
+ revision: z.ZodString;
535
+ verdict: z.ZodObject<{
536
+ ok: z.ZodBoolean;
537
+ phase: z.ZodEnum<{
538
+ publish: "publish";
539
+ write: "write";
540
+ }>;
541
+ errors: z.ZodArray<z.ZodObject<{
542
+ contract: z.ZodString;
543
+ severity: z.ZodEnum<{
544
+ error: "error";
545
+ warning: "warning";
546
+ }>;
547
+ path: z.ZodString;
548
+ message: z.ZodString;
549
+ fix: z.ZodString;
550
+ line: z.ZodOptional<z.ZodNumber>;
551
+ }, z.core.$strip>>;
552
+ warnings: z.ZodArray<z.ZodObject<{
553
+ contract: z.ZodString;
554
+ severity: z.ZodEnum<{
555
+ error: "error";
556
+ warning: "warning";
557
+ }>;
558
+ path: z.ZodString;
559
+ message: z.ZodString;
560
+ fix: z.ZodString;
561
+ line: z.ZodOptional<z.ZodNumber>;
562
+ }, z.core.$strip>>;
563
+ contractsHash: z.ZodString;
564
+ }, z.core.$strip>;
565
+ lastPublication: z.ZodNullable<z.ZodObject<{
566
+ revision: z.ZodString;
567
+ verdict: z.ZodObject<{
568
+ ok: z.ZodBoolean;
569
+ phase: z.ZodEnum<{
570
+ publish: "publish";
571
+ write: "write";
572
+ }>;
573
+ errors: z.ZodArray<z.ZodObject<{
574
+ contract: z.ZodString;
575
+ severity: z.ZodEnum<{
576
+ error: "error";
577
+ warning: "warning";
578
+ }>;
579
+ path: z.ZodString;
580
+ message: z.ZodString;
581
+ fix: z.ZodString;
582
+ line: z.ZodOptional<z.ZodNumber>;
583
+ }, z.core.$strip>>;
584
+ warnings: z.ZodArray<z.ZodObject<{
585
+ contract: z.ZodString;
586
+ severity: z.ZodEnum<{
587
+ error: "error";
588
+ warning: "warning";
589
+ }>;
590
+ path: z.ZodString;
591
+ message: z.ZodString;
592
+ fix: z.ZodString;
593
+ line: z.ZodOptional<z.ZodNumber>;
594
+ }, z.core.$strip>>;
595
+ contractsHash: z.ZodString;
596
+ }, z.core.$strip>;
597
+ acknowledged: z.ZodArray<z.ZodObject<{
598
+ contract: z.ZodString;
599
+ path: z.ZodString;
600
+ }, z.core.$strip>>;
601
+ at: z.ZodString;
602
+ }, z.core.$strip>>;
603
+ markdown: z.ZodOptional<z.ZodString>;
604
+ document: z.ZodOptional<z.ZodObject<{
605
+ nodes: z.ZodArray<z.ZodUnknown>;
606
+ frontmatter: z.ZodRecord<z.ZodString, z.ZodUnknown>;
607
+ meta: z.ZodRecord<z.ZodString, z.ZodUnknown>;
608
+ }, z.core.$strip>>;
609
+ html: z.ZodOptional<z.ZodString>;
610
+ }, z.core.$strip>;
611
+ declare const conflict: z.ZodObject<{
612
+ currentVersion: z.ZodNumber;
613
+ headRevision: z.ZodString;
614
+ }, z.core.$strip>;
615
+ declare const format: z.ZodEnum<{
616
+ document: "document";
617
+ html: "html";
618
+ markdown: "markdown";
619
+ }>;
620
+ declare const componentDescription: z.ZodObject<{
621
+ name: z.ZodString;
622
+ description: z.ZodNullable<z.ZodString>;
623
+ example: z.ZodNullable<z.ZodString>;
624
+ props: z.ZodRecord<z.ZodString, z.ZodUnknown>;
625
+ }, z.core.$strip>;
626
+ declare const contractDescription: z.ZodObject<{
627
+ id: z.ZodString;
628
+ severity: z.ZodEnum<{
629
+ error: "error";
630
+ warning: "warning";
631
+ }>;
632
+ phases: z.ZodArray<z.ZodEnum<{
633
+ publish: "publish";
634
+ write: "write";
635
+ }>>;
636
+ description: z.ZodString;
637
+ }, z.core.$strip>;
638
+ declare const collectionDescription: z.ZodObject<{
639
+ name: z.ZodString;
640
+ schema: z.ZodRecord<z.ZodString, z.ZodUnknown>;
641
+ routes: z.ZodRecord<z.ZodString, z.ZodString>;
642
+ translationGroupField: z.ZodNullable<z.ZodString>;
643
+ tagsField: z.ZodNullable<z.ZodString>;
644
+ sortByField: z.ZodNullable<z.ZodString>;
645
+ components: z.ZodArray<z.ZodObject<{
646
+ name: z.ZodString;
647
+ description: z.ZodNullable<z.ZodString>;
648
+ example: z.ZodNullable<z.ZodString>;
649
+ props: z.ZodRecord<z.ZodString, z.ZodUnknown>;
650
+ }, z.core.$strip>>;
651
+ contracts: z.ZodArray<z.ZodObject<{
652
+ id: z.ZodString;
653
+ severity: z.ZodEnum<{
654
+ error: "error";
655
+ warning: "warning";
656
+ }>;
657
+ phases: z.ZodArray<z.ZodEnum<{
658
+ publish: "publish";
659
+ write: "write";
660
+ }>>;
661
+ description: z.ZodString;
662
+ }, z.core.$strip>>;
663
+ maxMarkdownBytes: z.ZodNumber;
664
+ styleGuide: z.ZodNullable<z.ZodString>;
665
+ }, z.core.$strip>;
666
+ declare const siteDescription: z.ZodObject<{
667
+ key: z.ZodString;
668
+ locales: z.ZodArray<z.ZodString>;
669
+ defaultLocale: z.ZodString;
670
+ styleGuide: z.ZodNullable<z.ZodString>;
671
+ collections: z.ZodArray<z.ZodObject<{
672
+ name: z.ZodString;
673
+ schema: z.ZodRecord<z.ZodString, z.ZodUnknown>;
674
+ routes: z.ZodRecord<z.ZodString, z.ZodString>;
675
+ translationGroupField: z.ZodNullable<z.ZodString>;
676
+ tagsField: z.ZodNullable<z.ZodString>;
677
+ sortByField: z.ZodNullable<z.ZodString>;
678
+ components: z.ZodArray<z.ZodObject<{
679
+ name: z.ZodString;
680
+ description: z.ZodNullable<z.ZodString>;
681
+ example: z.ZodNullable<z.ZodString>;
682
+ props: z.ZodRecord<z.ZodString, z.ZodUnknown>;
683
+ }, z.core.$strip>>;
684
+ contracts: z.ZodArray<z.ZodObject<{
685
+ id: z.ZodString;
686
+ severity: z.ZodEnum<{
687
+ error: "error";
688
+ warning: "warning";
689
+ }>;
690
+ phases: z.ZodArray<z.ZodEnum<{
691
+ publish: "publish";
692
+ write: "write";
693
+ }>>;
694
+ description: z.ZodString;
695
+ }, z.core.$strip>>;
696
+ maxMarkdownBytes: z.ZodNumber;
697
+ styleGuide: z.ZodNullable<z.ZodString>;
698
+ }, z.core.$strip>>;
699
+ }, z.core.$strip>;
700
+ //#endregion
701
+ //#region src/contracts/description.d.ts
702
+ /** What `describe_site` shows of a contract. */
703
+ type ContractDescription = z.output<typeof contractDescription>;
704
+ /** A contract as `describe_site` shows it to agents. */
705
+ export declare function describeContract(contract: Pick<Contract<unknown>, 'id' | 'severity' | 'phases' | 'description'>): ContractDescription;
706
+ //#endregion
707
+ //#region src/contracts/builtin.d.ts
708
+ /**
709
+ * Every id Hollware's own contracts use. The config module reserves them: a contract of a site
710
+ * cannot take one, except through `contracts.*`, which makes the opt-in ones.
711
+ *
712
+ * - Always on, run by `runContracts`: `schema`, `components` and the four content-safety
713
+ * contracts, `raw-html`, `unknown-component`, `disallowed-attribute` and `unsafe-url`.
714
+ * - Opt-in, listed in a collection's `contracts`: `translation-pair`, `internal-links-resolve`
715
+ * and `images-have-alt`.
716
+ * - Always on, found before the contracts run: `size-limit` (made by the pipeline for
717
+ * `maxMarkdownBytes` and by the store for the row, with `sizeLimitViolation`),
718
+ * `frontmatter-syntax` and `comark-parse` (made by the pipeline), and `unique-slug` and
719
+ * `unique-translation` (made when the store finds the slug or the translation group taken). A
720
+ * write with one of them is `refused`, so no verdict is made for it: they are
721
+ * `REFUSAL_CONTRACT_IDS`.
722
+ */
723
+ export declare const BUILT_IN_CONTRACT_IDS: readonly ['schema', 'components', 'raw-html', 'unknown-component', 'disallowed-attribute', 'unsafe-url', 'translation-pair', 'internal-links-resolve', 'images-have-alt', 'size-limit', 'frontmatter-syntax', 'comark-parse', 'unique-slug', 'unique-translation'];
724
+ type BuiltInContractId = (typeof BUILT_IN_CONTRACT_IDS)[number];
725
+ /**
726
+ * The ids of the violations that make a write `refused` instead of saving it: a file that cannot
727
+ * be stored, because it is over a size limit, its frontmatter is not YAML or its Markdown does not
728
+ * parse, or whose slug or translation group another entry holds. Every other violation is saved with the draft and only blocks publishing (ADR-004,
729
+ * ADR-020). Plain strings, so that a violation's `contract` can be looked up in the list.
730
+ */
731
+ export declare const REFUSAL_CONTRACT_IDS: readonly string[];
732
+ /**
733
+ * The always-on contracts as `describe_site` shows them, in `BUILT_IN_CONTRACT_IDS` order. The
734
+ * opt-in ones are not here: a collection that uses one lists it in its own `contracts`.
735
+ */
736
+ export declare function describeBuiltInContracts(): ContractDescription[];
737
+ //#endregion
738
+ //#region src/contracts/opt-in.d.ts
739
+ /**
740
+ * The built-in contracts a collection opts into by listing them in its `contracts`, and the
741
+ * factory for its own: `contracts.translationPair()`, `contracts.internalLinksResolve()`,
742
+ * `contracts.imagesHaveAlt()` and `contracts.custom({ … })`.
743
+ */
744
+ interface BuiltInOptions {
745
+ /** `error` unless given: an error blocks publishing, a warning has to be acknowledged. */
746
+ readonly severity?: Severity;
747
+ }
748
+ /**
749
+ * Every locale of the site has an entry in the translation group of this one. It reads the group
750
+ * from the frontmatter field the collection names in `translations.groupBy`, and counts an entry
751
+ * in any status, so the pair can be published one after the other. Checked when publishing, and
752
+ * skipped when the collection has no translations.
753
+ */
754
+ declare function translationPair(options?: BuiltInOptions): Contract<unknown>;
755
+ /**
756
+ * Every link to another entry of the site points at an entry that is published, or at the entry
757
+ * itself. All the targets are looked up in one call to `lookupMany`, and none when the body has no
758
+ * link to another entry. Checked when publishing.
759
+ */
760
+ declare function internalLinksResolve(options?: BuiltInOptions): Contract<unknown>;
761
+ /** Every image has alt text. An alt of only spaces counts as none. Checked on every write. */
762
+ declare function imagesHaveAlt(options?: BuiltInOptions): Contract<unknown>;
763
+ /** A text that may depend on the entry: `The title has ${frontmatter.title.length} characters.` */
764
+ type ContractText<Frontmatter> = string | ((context: ContractContext<Frontmatter>) => string);
765
+ interface CustomContractOptions<Frontmatter> {
766
+ /** Lowercase words joined by hyphens, unique within the collection: `seo-title-length`. */
767
+ readonly id: string;
768
+ readonly severity: Severity;
769
+ /** What the rule asks for, as `describe_site` shows it to agents. */
770
+ readonly description: string;
771
+ /** The phases it runs in; both when absent. */
772
+ readonly phases?: readonly Phase[];
773
+ /** Whether the entry follows the rule: `true` passes, `false` reports the problem. */
774
+ check(context: ContractContext<Frontmatter>): boolean | Promise<boolean>;
775
+ /** What is wrong, for the agent. */
776
+ readonly message: ContractText<Frontmatter>;
777
+ /** What to change so that the problem goes away, for the agent. Never empty. */
778
+ readonly fix: ContractText<Frontmatter>;
779
+ /** A JSON Pointer into `{ frontmatter, body }`: `/frontmatter/title`. The whole entry (`''`) when absent. */
780
+ readonly path?: string;
781
+ }
782
+ /**
783
+ * A contract of a site made of a yes or no question and the words to say when the answer is no.
784
+ * One finding at most: a rule that reports several problems, or the line they are on, is a plain
785
+ * `Contract` object, which can return as many findings as it wants.
786
+ *
787
+ * Inside `defineCollection`, TypeScript cannot infer the frontmatter type of a call like this one
788
+ * (it can for a plain object): give it, as in `contracts.custom<{ title: string }>({ … })`.
789
+ */
790
+ declare function custom<Frontmatter = Record<string, unknown>>(options: CustomContractOptions<Frontmatter>): Contract<Frontmatter>;
791
+ export declare const contracts: {
792
+ readonly custom: typeof custom;
793
+ readonly imagesHaveAlt: typeof imagesHaveAlt;
794
+ readonly internalLinksResolve: typeof internalLinksResolve;
795
+ readonly translationPair: typeof translationPair;
796
+ };
797
+ //#endregion
798
+ //#region src/contracts/registry.d.ts
799
+ /**
800
+ * Whether a contract was made by Hollware: the always-on ones and what the factories of
801
+ * `contracts` return. A site's own contract with the id of a built-in one is not.
802
+ */
803
+ export declare function isBuiltInContract(contract: Contract<unknown>): boolean;
804
+ //#endregion
805
+ //#region src/contracts/run.d.ts
806
+ interface RunContractsInput {
807
+ readonly site: ResolvedSite;
808
+ readonly collection: ResolvedCollection;
809
+ readonly locale: string;
810
+ readonly slug: string;
811
+ /** The entry's id, or `null` while the entry is being created. */
812
+ readonly entryId: string | null;
813
+ /**
814
+ * `write` runs the contracts that are declared for it. `publish` (for `validate` and `publish`)
815
+ * runs every contract, so that its verdict lists everything that blocks publishing.
816
+ */
817
+ readonly phase: Phase;
818
+ readonly markdown: ProcessedMarkdown;
819
+ /** The other entries of the site, for the contracts that look at them. */
820
+ readonly entries: EntryLookup;
821
+ }
822
+ /**
823
+ * Runs the contracts of a collection on one revision (ADR-004).
824
+ *
825
+ * The `schema` contract goes first. The collection's own contracts, which read the frontmatter,
826
+ * run only when it passed, and get what the schema returned; the built-in ones that do not need
827
+ * it run anyway, so that one verdict lists as much as it can; the context of those has no
828
+ * frontmatter (`undefined`) when the schema refused it. A contract that throws does not break
829
+ * the run: it becomes an error of that contract.
830
+ *
831
+ * The violations come in a fixed order: the built-in contracts in their own order, then the
832
+ * collection's in the order of its config, and the findings of each one by line and then by path.
833
+ */
834
+ export declare function runContracts(input: RunContractsInput): Promise<Verdict>;
835
+ //#endregion
836
+ //#region src/contracts/size.d.ts
837
+ /**
838
+ * The `size-limit` violation of the row that D1 holds, which the store checks against
839
+ * `MAX_ROW_BYTES`. It points at the entry as a whole (the empty JSON Pointer), because what
840
+ * counts is everything stored with it. The Markdown pipeline words its own `size-limit` for
841
+ * `maxMarkdownBytes`, which names the file and the collection's limit.
842
+ *
843
+ * `bytes` is the size in UTF-8 bytes and `limit` the largest size accepted. Call it when `bytes`
844
+ * is over `limit`.
845
+ */
846
+ export declare function sizeLimitViolation(bytes: number, limit: number): Violation;
847
+ //#endregion
848
+ //#region src/contracts/unique.d.ts
849
+ /**
850
+ * The violations of a write that the store refuses because another entry of the same collection
851
+ * and locale holds what has to be unique there: the slug, or the translation group. `holder` is
852
+ * the id of that entry. Like `sizeLimitViolation`, they make the write `refused`, and every such
853
+ * refusal reads the same.
854
+ */
855
+ /** Another entry of the collection and locale has the slug. The slug is no field of the file. */
856
+ export declare function uniqueSlugViolation(holder: string): Violation;
857
+ /** Another entry of the collection and locale belongs to the translation group in `field`. */
858
+ export declare function uniqueTranslationViolation(holder: string, field: string): Violation;
859
+ //#endregion
860
+ //#region src/config/describe.d.ts
861
+ /** A site as `describe_site` shows it to agents: the `site` of the operation's output. */
862
+ type SiteDescription = z.output<typeof siteDescription>;
863
+ /**
864
+ * What an agent reads before it writes: for each collection, the JSON Schema of the frontmatter
865
+ * (draft 2020-12, as the schema accepts it) and of each component's props, the routes, the
866
+ * fields (the translation group, the tags and the sorting field), the contracts and the style
867
+ * guides. `builtInContracts` are described before the collection's own ones.
868
+ *
869
+ * Converting the schemas costs about 1.4 ms for a realistic site, so the description is made once
870
+ * per site and per array of built-in contracts (pass the same array every time), and every call
871
+ * after that returns the same object, which is frozen because it is shared by every request of
872
+ * the isolate. Collections, components and contracts come in the order of the config.
873
+ */
874
+ export declare function describeResolvedSite(site: ResolvedSite, options?: {
875
+ readonly builtInContracts?: readonly ContractDescription[];
876
+ }): SiteDescription;
877
+ //#endregion
878
+ //#region src/config/resolve.d.ts
879
+ /**
880
+ * Checks the config of the deployment and fills in its defaults, or throws a `ConfigError` with
881
+ * every problem it found, so that a broken `hollware.config.ts` stops the Worker at startup with
882
+ * a message that says what to change. v0.1 serves exactly one site per deployment.
883
+ *
884
+ * The parameter is `unknown` because the config comes from user code that may be plain
885
+ * JavaScript; a `HollwareConfig` is accepted as is, so this is a `ResolveConfig`. Notes on the
886
+ * rules:
887
+ *
888
+ * - A site key is lowercase letters and digits joined by single hyphens, from 1 to 64 characters
889
+ * (`isSiteKey`, the rule of the CLI). A collection name and a component name are lowercase
890
+ * letters, digits and hyphens, starting with a letter, at most 63 characters. A contract id is
891
+ * lowercase words joined by single hyphens, and the id of a built-in contract
892
+ * (`BUILT_IN_CONTRACT_IDS`) is taken only by a contract that Hollware made (`isBuiltInContract`:
893
+ * `contracts.translationPair()` and the like), once.
894
+ * - Each locale is a language tag with an optional script and region (`es`, `pt-BR`,
895
+ * `zh-Hant-TW`). Routes are checked against the locales only when the locales are valid.
896
+ * - A route has `:slug` once. Two routes of the site are the same pattern when they differ at
897
+ * most by a trailing slash; patterns that overlap without being equal are not detected.
898
+ * - `translations.groupBy`, `tags` and `sortBy` name properties of the frontmatter's JSON Schema
899
+ * (as agents see it, so `$ref`s are followed). `groupBy` is a string, `tags` an array of
900
+ * strings and `sortBy` a string with the `date` or `date-time` format: a plain string does not
901
+ * prove that the listing sorts by time. None may be nullable, and each may be optional.
902
+ * - Collections, components and contracts keep the order of the config; each collection's routes
903
+ * come out in the order of the site's locales.
904
+ */
905
+ export declare function resolveConfig(config: unknown): ResolvedConfig;
906
+ //#endregion
907
+ //#region src/config/site-key.d.ts
908
+ /**
909
+ * The key of a site, which is the id of its row in the database: lowercase letters and digits
910
+ * joined by single hyphens (`blog`, `docs-2`, `acme-eu`), from 1 to `SITE_KEY_MAX_LENGTH`
911
+ * characters. It is the rule of the CLI, which can import it, so that a key the CLI writes is a
912
+ * key the config accepts.
913
+ */
914
+ export declare const SITE_KEY_PATTERN: RegExp;
915
+ /** The longest a site key can be. */
916
+ export declare const SITE_KEY_MAX_LENGTH = 64;
917
+ /** Whether a value is a site key: a string that fits `SITE_KEY_PATTERN` and is not too long. */
918
+ export declare function isSiteKey(value: unknown): value is string;
919
+ //#endregion
920
+ //#region src/errors.d.ts
921
+ /**
922
+ * The errors of an operation that are none of its outcomes: the caller asked for something it
923
+ * cannot have, or the server could not answer. Conflicts, missing entries and blocked publishes
924
+ * are outcomes, not errors (`operations/specs.ts`).
925
+ */
926
+ export declare const ERROR_CODES: readonly [
927
+ /** The input breaks a rule the input schema cannot express. */
928
+ 'invalid_input',
929
+ /** The input names a collection the site does not have. */
930
+ 'unknown_collection',
931
+ /** The input names a locale the site does not have. */
932
+ 'unknown_locale',
933
+ /** The token lacks a scope the operation requires; the message names every missing scope. */
934
+ 'insufficient_scope',
935
+ /** The answer would exceed the output cap. Hollware never truncates content. */
936
+ 'output_too_large',
937
+ /** The operation ran out of time. */
938
+ 'timeout',
939
+ /** Anything else. The message says nothing about the cause, which goes to the log. */
940
+ 'internal'];
941
+ type ErrorCode = (typeof ERROR_CODES)[number];
942
+ /**
943
+ * An error that the caller sees: a code, a message for the agent and a fix it can act on. The
944
+ * cause, when there is one, is for the log only and never reaches the caller.
945
+ */
946
+ export declare class HollwareError extends Error {
947
+ readonly name = "HollwareError";
948
+ readonly code: ErrorCode;
949
+ readonly fix: string;
950
+ constructor(code: ErrorCode, message: string, fix: string, options?: {
951
+ cause?: unknown;
952
+ });
953
+ }
954
+ //#endregion
955
+ //#region src/ids.d.ts
956
+ /**
957
+ * Identifiers: a prefix that names the kind of thing, an underscore, and a ULID (48 bits of
958
+ * time in milliseconds, then 80 random bits, in Crockford's base 32), so that ids of one kind
959
+ * sort by creation time. For example `ent_01JAB3XQ8ZK4M6N2P5R7S9T0VW`.
960
+ */
961
+ /** The kinds of ids and their prefixes. A new kind adds its prefix here. */
962
+ export declare const ID_PREFIXES: {
963
+ readonly entry: 'ent';
964
+ readonly publication: 'pub';
965
+ readonly revision: 'rev';
966
+ readonly revisionTag: 'tag';
967
+ readonly token: 'tok';
968
+ readonly user: 'usr';
969
+ };
970
+ type IdPrefix = (typeof ID_PREFIXES)[keyof typeof ID_PREFIXES];
971
+ /**
972
+ * A ULID for the given time and 10 random bytes. Both default to now and to fresh randomness
973
+ * from `crypto.getRandomValues`; tests pass their own.
974
+ */
975
+ export declare function ulid(time?: number, random?: Uint8Array): string;
976
+ /** A new id of the given kind: `newId('ent')` → `ent_01JAB…`. */
977
+ export declare function newId(prefix: IdPrefix): string;
978
+ /** Whether a string is an id of the given kind. */
979
+ export declare function isId(prefix: IdPrefix, value: string): boolean;
980
+ //#endregion
981
+ //#region src/markdown/process.d.ts
982
+ /**
983
+ * Processes a Markdown file for a collection (ADR-001, ADR-020): the frontmatter and the body
984
+ * are parsed once and the contracts get what they need from the result. It answers for any
985
+ * string and never throws: a file it cannot store comes back as violations.
986
+ */
987
+ export declare const processMarkdown: ProcessMarkdown;
988
+ //#endregion
989
+ //#region src/markdown/render.d.ts
990
+ /**
991
+ * Renders a stored document to HTML with `@comark/html`. `@comark/html` is imported when the
992
+ * first document is rendered, so that an isolate that never renders never loads it.
993
+ */
994
+ export declare const renderHtml: RenderHtml;
995
+ //#endregion
996
+ //#region src/markdown/versions.d.ts
997
+ /**
998
+ * The version of Comark that parses the Markdown, which every revision stores as `comark_version`.
999
+ * Comark exports no version at runtime, so this constant is the one place that names it, and
1000
+ * `tests/markdown/versions.test.ts` binds it to the package that is installed.
1001
+ */
1002
+ export declare const COMARK_VERSION = "0.7.0";
1003
+ /**
1004
+ * The version of Hollware's own pipeline settings: the plugins, the allowlists, the heading ids,
1005
+ * the markers and the line numbers (ADR-020). Bump it whenever the same Markdown would give another
1006
+ * document or other extracted data, so that `reparse` knows which revisions to rebuild.
1007
+ * `tests/markdown/versions.test.ts` pins the output for the shared fixtures, so a change that
1008
+ * forgets the bump fails there.
1009
+ */
1010
+ export declare const PIPELINE_VERSION = "1";
1011
+ //#endregion
1012
+ //#region src/scopes.d.ts
1013
+ /**
1014
+ * The scopes a token carries. An operation asks for scopes, never for a role: what a token may
1015
+ * do is its own scopes intersected with those of its user's role (ADR-019).
1016
+ */
1017
+ export declare const SCOPES: readonly ['content:read', 'content:write', 'content:publish', 'schema:admin'];
1018
+ type Scope = (typeof SCOPES)[number];
1019
+ /** Whether a string is one of the scopes. */
1020
+ export declare function isScope(value: string): value is Scope;
1021
+ //#endregion
1022
+ //#region src/operations/types.d.ts
1023
+ /**
1024
+ * The shape of an operation spec (ADR-017): its name, its input and output schemas, the scopes
1025
+ * it requires, its effect and its outcomes. A spec holds no handler and no MCP, HTTP or
1026
+ * Cloudflare vocabulary; the adapters of `packages/server` derive their protocol from it.
1027
+ */
1028
+ /**
1029
+ * What an operation does to the content. The MCP hints, the HTTP method and whether an answer
1030
+ * may be cached derive from it:
1031
+ * - `read` changes nothing;
1032
+ * - `edit` changes an entry that exists;
1033
+ * - `write` creates content or makes it public;
1034
+ * - `destructive` takes content away from the public.
1035
+ */
1036
+ type Effect = 'read' | 'edit' | 'write' | 'destructive';
1037
+ /** How the surfaces treat an outcome. */
1038
+ interface OutcomeInfo {
1039
+ /** Whether the outcome is an error for the caller: `isError` over MCP, a 4xx over HTTP. */
1040
+ readonly isError: boolean;
1041
+ }
1042
+ /** The outcomes an output schema allows: the values of its `outcome` field. */
1043
+ type OutcomeOf<Output extends z.ZodType> = z.output<Output> extends {
1044
+ outcome: infer Outcome extends string;
1045
+ } ? Outcome : never;
1046
+ interface OperationSpec<Name extends string = string, Input extends z.ZodType = z.ZodType, Output extends z.ZodType = z.ZodType> {
1047
+ /** The tool name over MCP, in snake case: `create_draft`. */
1048
+ readonly name: Name;
1049
+ /** A short human title. */
1050
+ readonly title: string;
1051
+ /** What the operation does and when to use it, written for the agent. */
1052
+ readonly description: string;
1053
+ /** An object schema; adapters reject input that does not match. */
1054
+ readonly input: Input;
1055
+ /** An object schema with an `outcome` field (MCP needs an object at the root). */
1056
+ readonly output: Output;
1057
+ /** Every scope the caller needs. */
1058
+ readonly scopes: readonly Scope[];
1059
+ readonly effect: Effect;
1060
+ /** Every outcome of the output, and whether it is an error for the caller. */
1061
+ readonly outcomes: Readonly<Record<OutcomeOf<Output>, OutcomeInfo>>;
1062
+ }
1063
+ /** Declares an operation spec, keeping the literal types of its name and schemas. */
1064
+ export declare function defineOperation<const Name extends string, Input extends z.ZodType, Output extends z.ZodType>(spec: OperationSpec<Name, Input, Output>): OperationSpec<Name, Input, Output>;
1065
+ //#endregion
1066
+ //#region src/operations/specs.d.ts
1067
+ /**
1068
+ * The operations of v0.1, specified once (ADR-017). The outcomes and the effect of each one are
1069
+ * the table of the v0.1 plan; `tests/operations.test.ts` holds it literally. Inputs are strict
1070
+ * objects, so a misspelled field is an error instead of being ignored.
1071
+ */
1072
+ export declare const describeSite: OperationSpec<"describe_site", z.ZodObject<{}, z.core.$strict>, z.ZodObject<{
1073
+ outcome: z.ZodEnum<{
1074
+ ok: "ok";
1075
+ }>;
1076
+ site: z.ZodObject<{
1077
+ key: z.ZodString;
1078
+ locales: z.ZodArray<z.ZodString>;
1079
+ defaultLocale: z.ZodString;
1080
+ styleGuide: z.ZodNullable<z.ZodString>;
1081
+ collections: z.ZodArray<z.ZodObject<{
1082
+ name: z.ZodString;
1083
+ schema: z.ZodRecord<z.ZodString, z.ZodUnknown>;
1084
+ routes: z.ZodRecord<z.ZodString, z.ZodString>;
1085
+ translationGroupField: z.ZodNullable<z.ZodString>;
1086
+ tagsField: z.ZodNullable<z.ZodString>;
1087
+ sortByField: z.ZodNullable<z.ZodString>;
1088
+ components: z.ZodArray<z.ZodObject<{
1089
+ name: z.ZodString;
1090
+ description: z.ZodNullable<z.ZodString>;
1091
+ example: z.ZodNullable<z.ZodString>;
1092
+ props: z.ZodRecord<z.ZodString, z.ZodUnknown>;
1093
+ }, z.core.$strip>>;
1094
+ contracts: z.ZodArray<z.ZodObject<{
1095
+ id: z.ZodString;
1096
+ severity: z.ZodEnum<{
1097
+ error: "error";
1098
+ warning: "warning";
1099
+ }>;
1100
+ phases: z.ZodArray<z.ZodEnum<{
1101
+ publish: "publish";
1102
+ write: "write";
1103
+ }>>;
1104
+ description: z.ZodString;
1105
+ }, z.core.$strip>>;
1106
+ maxMarkdownBytes: z.ZodNumber;
1107
+ styleGuide: z.ZodNullable<z.ZodString>;
1108
+ }, z.core.$strip>>;
1109
+ }, z.core.$strip>;
1110
+ }, z.core.$strip>>;
1111
+ export declare const listEntries: OperationSpec<"list_entries", z.ZodObject<{
1112
+ collection: z.ZodString;
1113
+ locale: z.ZodOptional<z.ZodString>;
1114
+ tag: z.ZodOptional<z.ZodString>;
1115
+ status: z.ZodOptional<z.ZodEnum<{
1116
+ draft: "draft";
1117
+ published: "published";
1118
+ scheduled: "scheduled";
1119
+ }>>;
1120
+ limit: z.ZodDefault<z.ZodNumber>;
1121
+ cursor: z.ZodOptional<z.ZodString>;
1122
+ }, z.core.$strict>, z.ZodObject<{
1123
+ outcome: z.ZodEnum<{
1124
+ ok: "ok";
1125
+ }>;
1126
+ entries: z.ZodArray<z.ZodObject<{
1127
+ id: z.ZodString;
1128
+ collection: z.ZodString;
1129
+ locale: z.ZodString;
1130
+ slug: z.ZodString;
1131
+ translationGroup: z.ZodNullable<z.ZodString>;
1132
+ status: z.ZodEnum<{
1133
+ draft: "draft";
1134
+ published: "published";
1135
+ scheduled: "scheduled";
1136
+ }>;
1137
+ version: z.ZodNumber;
1138
+ frontmatter: z.ZodRecord<z.ZodString, z.ZodUnknown>;
1139
+ tags: z.ZodArray<z.ZodString>;
1140
+ hasUnpublishedChanges: z.ZodBoolean;
1141
+ publishedAt: z.ZodNullable<z.ZodString>;
1142
+ updatedAt: z.ZodString;
1143
+ }, z.core.$strip>>;
1144
+ nextCursor: z.ZodNullable<z.ZodString>;
1145
+ }, z.core.$strip>>;
1146
+ export declare const getEntry: OperationSpec<"get_entry", z.ZodObject<{
1147
+ collection: z.ZodString;
1148
+ locale: z.ZodString;
1149
+ slug: z.ZodString;
1150
+ formats: z.ZodDefault<z.ZodArray<z.ZodEnum<{
1151
+ document: "document";
1152
+ html: "html";
1153
+ markdown: "markdown";
1154
+ }>>>;
1155
+ }, z.core.$strict>, z.ZodObject<{
1156
+ outcome: z.ZodEnum<{
1157
+ not_found: "not_found";
1158
+ ok: "ok";
1159
+ }>;
1160
+ entry: z.ZodOptional<z.ZodObject<{
1161
+ id: z.ZodString;
1162
+ collection: z.ZodString;
1163
+ locale: z.ZodString;
1164
+ slug: z.ZodString;
1165
+ translationGroup: z.ZodNullable<z.ZodString>;
1166
+ status: z.ZodEnum<{
1167
+ draft: "draft";
1168
+ published: "published";
1169
+ scheduled: "scheduled";
1170
+ }>;
1171
+ version: z.ZodNumber;
1172
+ frontmatter: z.ZodRecord<z.ZodString, z.ZodUnknown>;
1173
+ tags: z.ZodArray<z.ZodString>;
1174
+ hasUnpublishedChanges: z.ZodBoolean;
1175
+ publishedAt: z.ZodNullable<z.ZodString>;
1176
+ updatedAt: z.ZodString;
1177
+ revision: z.ZodString;
1178
+ verdict: z.ZodObject<{
1179
+ ok: z.ZodBoolean;
1180
+ phase: z.ZodEnum<{
1181
+ publish: "publish";
1182
+ write: "write";
1183
+ }>;
1184
+ errors: z.ZodArray<z.ZodObject<{
1185
+ contract: z.ZodString;
1186
+ severity: z.ZodEnum<{
1187
+ error: "error";
1188
+ warning: "warning";
1189
+ }>;
1190
+ path: z.ZodString;
1191
+ message: z.ZodString;
1192
+ fix: z.ZodString;
1193
+ line: z.ZodOptional<z.ZodNumber>;
1194
+ }, z.core.$strip>>;
1195
+ warnings: z.ZodArray<z.ZodObject<{
1196
+ contract: z.ZodString;
1197
+ severity: z.ZodEnum<{
1198
+ error: "error";
1199
+ warning: "warning";
1200
+ }>;
1201
+ path: z.ZodString;
1202
+ message: z.ZodString;
1203
+ fix: z.ZodString;
1204
+ line: z.ZodOptional<z.ZodNumber>;
1205
+ }, z.core.$strip>>;
1206
+ contractsHash: z.ZodString;
1207
+ }, z.core.$strip>;
1208
+ lastPublication: z.ZodNullable<z.ZodObject<{
1209
+ revision: z.ZodString;
1210
+ verdict: z.ZodObject<{
1211
+ ok: z.ZodBoolean;
1212
+ phase: z.ZodEnum<{
1213
+ publish: "publish";
1214
+ write: "write";
1215
+ }>;
1216
+ errors: z.ZodArray<z.ZodObject<{
1217
+ contract: z.ZodString;
1218
+ severity: z.ZodEnum<{
1219
+ error: "error";
1220
+ warning: "warning";
1221
+ }>;
1222
+ path: z.ZodString;
1223
+ message: z.ZodString;
1224
+ fix: z.ZodString;
1225
+ line: z.ZodOptional<z.ZodNumber>;
1226
+ }, z.core.$strip>>;
1227
+ warnings: z.ZodArray<z.ZodObject<{
1228
+ contract: z.ZodString;
1229
+ severity: z.ZodEnum<{
1230
+ error: "error";
1231
+ warning: "warning";
1232
+ }>;
1233
+ path: z.ZodString;
1234
+ message: z.ZodString;
1235
+ fix: z.ZodString;
1236
+ line: z.ZodOptional<z.ZodNumber>;
1237
+ }, z.core.$strip>>;
1238
+ contractsHash: z.ZodString;
1239
+ }, z.core.$strip>;
1240
+ acknowledged: z.ZodArray<z.ZodObject<{
1241
+ contract: z.ZodString;
1242
+ path: z.ZodString;
1243
+ }, z.core.$strip>>;
1244
+ at: z.ZodString;
1245
+ }, z.core.$strip>>;
1246
+ markdown: z.ZodOptional<z.ZodString>;
1247
+ document: z.ZodOptional<z.ZodObject<{
1248
+ nodes: z.ZodArray<z.ZodUnknown>;
1249
+ frontmatter: z.ZodRecord<z.ZodString, z.ZodUnknown>;
1250
+ meta: z.ZodRecord<z.ZodString, z.ZodUnknown>;
1251
+ }, z.core.$strip>>;
1252
+ html: z.ZodOptional<z.ZodString>;
1253
+ }, z.core.$strip>>;
1254
+ }, z.core.$strip>>;
1255
+ export declare const getTranslations: OperationSpec<"get_translations", z.ZodObject<{
1256
+ collection: z.ZodString;
1257
+ translationGroup: z.ZodString;
1258
+ }, z.core.$strict>, z.ZodObject<{
1259
+ outcome: z.ZodEnum<{
1260
+ not_found: "not_found";
1261
+ ok: "ok";
1262
+ }>;
1263
+ entries: z.ZodOptional<z.ZodArray<z.ZodObject<{
1264
+ id: z.ZodString;
1265
+ collection: z.ZodString;
1266
+ locale: z.ZodString;
1267
+ slug: z.ZodString;
1268
+ translationGroup: z.ZodNullable<z.ZodString>;
1269
+ status: z.ZodEnum<{
1270
+ draft: "draft";
1271
+ published: "published";
1272
+ scheduled: "scheduled";
1273
+ }>;
1274
+ version: z.ZodNumber;
1275
+ frontmatter: z.ZodRecord<z.ZodString, z.ZodUnknown>;
1276
+ tags: z.ZodArray<z.ZodString>;
1277
+ hasUnpublishedChanges: z.ZodBoolean;
1278
+ publishedAt: z.ZodNullable<z.ZodString>;
1279
+ updatedAt: z.ZodString;
1280
+ }, z.core.$strip>>>;
1281
+ }, z.core.$strip>>;
1282
+ export declare const createDraft: OperationSpec<"create_draft", z.ZodObject<{
1283
+ collection: z.ZodString;
1284
+ locale: z.ZodString;
1285
+ slug: z.ZodString;
1286
+ markdown: z.ZodString;
1287
+ }, z.core.$strict>, z.ZodObject<{
1288
+ outcome: z.ZodEnum<{
1289
+ refused: "refused";
1290
+ saved: "saved";
1291
+ }>;
1292
+ entry: z.ZodOptional<z.ZodObject<{
1293
+ id: z.ZodString;
1294
+ collection: z.ZodString;
1295
+ locale: z.ZodString;
1296
+ slug: z.ZodString;
1297
+ translationGroup: z.ZodNullable<z.ZodString>;
1298
+ status: z.ZodEnum<{
1299
+ draft: "draft";
1300
+ published: "published";
1301
+ scheduled: "scheduled";
1302
+ }>;
1303
+ version: z.ZodNumber;
1304
+ frontmatter: z.ZodRecord<z.ZodString, z.ZodUnknown>;
1305
+ tags: z.ZodArray<z.ZodString>;
1306
+ hasUnpublishedChanges: z.ZodBoolean;
1307
+ publishedAt: z.ZodNullable<z.ZodString>;
1308
+ updatedAt: z.ZodString;
1309
+ }, z.core.$strip>>;
1310
+ verdict: z.ZodOptional<z.ZodObject<{
1311
+ ok: z.ZodBoolean;
1312
+ phase: z.ZodEnum<{
1313
+ publish: "publish";
1314
+ write: "write";
1315
+ }>;
1316
+ errors: z.ZodArray<z.ZodObject<{
1317
+ contract: z.ZodString;
1318
+ severity: z.ZodEnum<{
1319
+ error: "error";
1320
+ warning: "warning";
1321
+ }>;
1322
+ path: z.ZodString;
1323
+ message: z.ZodString;
1324
+ fix: z.ZodString;
1325
+ line: z.ZodOptional<z.ZodNumber>;
1326
+ }, z.core.$strip>>;
1327
+ warnings: z.ZodArray<z.ZodObject<{
1328
+ contract: z.ZodString;
1329
+ severity: z.ZodEnum<{
1330
+ error: "error";
1331
+ warning: "warning";
1332
+ }>;
1333
+ path: z.ZodString;
1334
+ message: z.ZodString;
1335
+ fix: z.ZodString;
1336
+ line: z.ZodOptional<z.ZodNumber>;
1337
+ }, z.core.$strip>>;
1338
+ contractsHash: z.ZodString;
1339
+ }, z.core.$strip>>;
1340
+ }, z.core.$strip>>;
1341
+ export declare const updateDraft: OperationSpec<"update_draft", z.ZodObject<{
1342
+ id: z.ZodString;
1343
+ version: z.ZodNumber;
1344
+ markdown: z.ZodString;
1345
+ }, z.core.$strict>, z.ZodObject<{
1346
+ outcome: z.ZodEnum<{
1347
+ conflict: "conflict";
1348
+ not_found: "not_found";
1349
+ refused: "refused";
1350
+ saved: "saved";
1351
+ unchanged: "unchanged";
1352
+ }>;
1353
+ entry: z.ZodOptional<z.ZodObject<{
1354
+ id: z.ZodString;
1355
+ collection: z.ZodString;
1356
+ locale: z.ZodString;
1357
+ slug: z.ZodString;
1358
+ translationGroup: z.ZodNullable<z.ZodString>;
1359
+ status: z.ZodEnum<{
1360
+ draft: "draft";
1361
+ published: "published";
1362
+ scheduled: "scheduled";
1363
+ }>;
1364
+ version: z.ZodNumber;
1365
+ frontmatter: z.ZodRecord<z.ZodString, z.ZodUnknown>;
1366
+ tags: z.ZodArray<z.ZodString>;
1367
+ hasUnpublishedChanges: z.ZodBoolean;
1368
+ publishedAt: z.ZodNullable<z.ZodString>;
1369
+ updatedAt: z.ZodString;
1370
+ }, z.core.$strip>>;
1371
+ verdict: z.ZodOptional<z.ZodObject<{
1372
+ ok: z.ZodBoolean;
1373
+ phase: z.ZodEnum<{
1374
+ publish: "publish";
1375
+ write: "write";
1376
+ }>;
1377
+ errors: z.ZodArray<z.ZodObject<{
1378
+ contract: z.ZodString;
1379
+ severity: z.ZodEnum<{
1380
+ error: "error";
1381
+ warning: "warning";
1382
+ }>;
1383
+ path: z.ZodString;
1384
+ message: z.ZodString;
1385
+ fix: z.ZodString;
1386
+ line: z.ZodOptional<z.ZodNumber>;
1387
+ }, z.core.$strip>>;
1388
+ warnings: z.ZodArray<z.ZodObject<{
1389
+ contract: z.ZodString;
1390
+ severity: z.ZodEnum<{
1391
+ error: "error";
1392
+ warning: "warning";
1393
+ }>;
1394
+ path: z.ZodString;
1395
+ message: z.ZodString;
1396
+ fix: z.ZodString;
1397
+ line: z.ZodOptional<z.ZodNumber>;
1398
+ }, z.core.$strip>>;
1399
+ contractsHash: z.ZodString;
1400
+ }, z.core.$strip>>;
1401
+ conflict: z.ZodOptional<z.ZodObject<{
1402
+ currentVersion: z.ZodNumber;
1403
+ headRevision: z.ZodString;
1404
+ }, z.core.$strip>>;
1405
+ }, z.core.$strip>>;
1406
+ export declare const validate: OperationSpec<"validate", z.ZodObject<{
1407
+ collection: z.ZodString;
1408
+ locale: z.ZodString;
1409
+ slug: z.ZodString;
1410
+ markdown: z.ZodString;
1411
+ }, z.core.$strict>, z.ZodObject<{
1412
+ outcome: z.ZodEnum<{
1413
+ ok: "ok";
1414
+ }>;
1415
+ verdict: z.ZodObject<{
1416
+ ok: z.ZodBoolean;
1417
+ phase: z.ZodEnum<{
1418
+ publish: "publish";
1419
+ write: "write";
1420
+ }>;
1421
+ errors: z.ZodArray<z.ZodObject<{
1422
+ contract: z.ZodString;
1423
+ severity: z.ZodEnum<{
1424
+ error: "error";
1425
+ warning: "warning";
1426
+ }>;
1427
+ path: z.ZodString;
1428
+ message: z.ZodString;
1429
+ fix: z.ZodString;
1430
+ line: z.ZodOptional<z.ZodNumber>;
1431
+ }, z.core.$strip>>;
1432
+ warnings: z.ZodArray<z.ZodObject<{
1433
+ contract: z.ZodString;
1434
+ severity: z.ZodEnum<{
1435
+ error: "error";
1436
+ warning: "warning";
1437
+ }>;
1438
+ path: z.ZodString;
1439
+ message: z.ZodString;
1440
+ fix: z.ZodString;
1441
+ line: z.ZodOptional<z.ZodNumber>;
1442
+ }, z.core.$strip>>;
1443
+ contractsHash: z.ZodString;
1444
+ }, z.core.$strip>;
1445
+ }, z.core.$strip>>;
1446
+ export declare const publish: OperationSpec<"publish", z.ZodObject<{
1447
+ id: z.ZodString;
1448
+ version: z.ZodNumber;
1449
+ acknowledgeWarnings: z.ZodDefault<z.ZodArray<z.ZodObject<{
1450
+ contract: z.ZodString;
1451
+ path: z.ZodString;
1452
+ }, z.core.$strip>>>;
1453
+ }, z.core.$strict>, z.ZodObject<{
1454
+ outcome: z.ZodEnum<{
1455
+ blocked: "blocked";
1456
+ conflict: "conflict";
1457
+ needs_acknowledgement: "needs_acknowledgement";
1458
+ not_found: "not_found";
1459
+ published: "published";
1460
+ }>;
1461
+ entry: z.ZodOptional<z.ZodObject<{
1462
+ id: z.ZodString;
1463
+ collection: z.ZodString;
1464
+ locale: z.ZodString;
1465
+ slug: z.ZodString;
1466
+ translationGroup: z.ZodNullable<z.ZodString>;
1467
+ status: z.ZodEnum<{
1468
+ draft: "draft";
1469
+ published: "published";
1470
+ scheduled: "scheduled";
1471
+ }>;
1472
+ version: z.ZodNumber;
1473
+ frontmatter: z.ZodRecord<z.ZodString, z.ZodUnknown>;
1474
+ tags: z.ZodArray<z.ZodString>;
1475
+ hasUnpublishedChanges: z.ZodBoolean;
1476
+ publishedAt: z.ZodNullable<z.ZodString>;
1477
+ updatedAt: z.ZodString;
1478
+ }, z.core.$strip>>;
1479
+ verdict: z.ZodOptional<z.ZodObject<{
1480
+ ok: z.ZodBoolean;
1481
+ phase: z.ZodEnum<{
1482
+ publish: "publish";
1483
+ write: "write";
1484
+ }>;
1485
+ errors: z.ZodArray<z.ZodObject<{
1486
+ contract: z.ZodString;
1487
+ severity: z.ZodEnum<{
1488
+ error: "error";
1489
+ warning: "warning";
1490
+ }>;
1491
+ path: z.ZodString;
1492
+ message: z.ZodString;
1493
+ fix: z.ZodString;
1494
+ line: z.ZodOptional<z.ZodNumber>;
1495
+ }, z.core.$strip>>;
1496
+ warnings: z.ZodArray<z.ZodObject<{
1497
+ contract: z.ZodString;
1498
+ severity: z.ZodEnum<{
1499
+ error: "error";
1500
+ warning: "warning";
1501
+ }>;
1502
+ path: z.ZodString;
1503
+ message: z.ZodString;
1504
+ fix: z.ZodString;
1505
+ line: z.ZodOptional<z.ZodNumber>;
1506
+ }, z.core.$strip>>;
1507
+ contractsHash: z.ZodString;
1508
+ }, z.core.$strip>>;
1509
+ conflict: z.ZodOptional<z.ZodObject<{
1510
+ currentVersion: z.ZodNumber;
1511
+ headRevision: z.ZodString;
1512
+ }, z.core.$strip>>;
1513
+ }, z.core.$strip>>;
1514
+ export declare const unpublish: OperationSpec<"unpublish", z.ZodObject<{
1515
+ id: z.ZodString;
1516
+ }, z.core.$strict>, z.ZodObject<{
1517
+ outcome: z.ZodEnum<{
1518
+ not_found: "not_found";
1519
+ unpublished: "unpublished";
1520
+ }>;
1521
+ entry: z.ZodOptional<z.ZodObject<{
1522
+ id: z.ZodString;
1523
+ collection: z.ZodString;
1524
+ locale: z.ZodString;
1525
+ slug: z.ZodString;
1526
+ translationGroup: z.ZodNullable<z.ZodString>;
1527
+ status: z.ZodEnum<{
1528
+ draft: "draft";
1529
+ published: "published";
1530
+ scheduled: "scheduled";
1531
+ }>;
1532
+ version: z.ZodNumber;
1533
+ frontmatter: z.ZodRecord<z.ZodString, z.ZodUnknown>;
1534
+ tags: z.ZodArray<z.ZodString>;
1535
+ hasUnpublishedChanges: z.ZodBoolean;
1536
+ publishedAt: z.ZodNullable<z.ZodString>;
1537
+ updatedAt: z.ZodString;
1538
+ }, z.core.$strip>>;
1539
+ }, z.core.$strip>>;
1540
+ /** Every operation of v0.1, sorted by name: the order of `tools/list`. */
1541
+ export declare const OPERATIONS: readonly [OperationSpec<"create_draft", z.ZodObject<{
1542
+ collection: z.ZodString;
1543
+ locale: z.ZodString;
1544
+ slug: z.ZodString;
1545
+ markdown: z.ZodString;
1546
+ }, z.core.$strict>, z.ZodObject<{
1547
+ outcome: z.ZodEnum<{
1548
+ refused: "refused";
1549
+ saved: "saved";
1550
+ }>;
1551
+ entry: z.ZodOptional<z.ZodObject<{
1552
+ id: z.ZodString;
1553
+ collection: z.ZodString;
1554
+ locale: z.ZodString;
1555
+ slug: z.ZodString;
1556
+ translationGroup: z.ZodNullable<z.ZodString>;
1557
+ status: z.ZodEnum<{
1558
+ draft: "draft";
1559
+ published: "published";
1560
+ scheduled: "scheduled";
1561
+ }>;
1562
+ version: z.ZodNumber;
1563
+ frontmatter: z.ZodRecord<z.ZodString, z.ZodUnknown>;
1564
+ tags: z.ZodArray<z.ZodString>;
1565
+ hasUnpublishedChanges: z.ZodBoolean;
1566
+ publishedAt: z.ZodNullable<z.ZodString>;
1567
+ updatedAt: z.ZodString;
1568
+ }, z.core.$strip>>;
1569
+ verdict: z.ZodOptional<z.ZodObject<{
1570
+ ok: z.ZodBoolean;
1571
+ phase: z.ZodEnum<{
1572
+ publish: "publish";
1573
+ write: "write";
1574
+ }>;
1575
+ errors: z.ZodArray<z.ZodObject<{
1576
+ contract: z.ZodString;
1577
+ severity: z.ZodEnum<{
1578
+ error: "error";
1579
+ warning: "warning";
1580
+ }>;
1581
+ path: z.ZodString;
1582
+ message: z.ZodString;
1583
+ fix: z.ZodString;
1584
+ line: z.ZodOptional<z.ZodNumber>;
1585
+ }, z.core.$strip>>;
1586
+ warnings: z.ZodArray<z.ZodObject<{
1587
+ contract: z.ZodString;
1588
+ severity: z.ZodEnum<{
1589
+ error: "error";
1590
+ warning: "warning";
1591
+ }>;
1592
+ path: z.ZodString;
1593
+ message: z.ZodString;
1594
+ fix: z.ZodString;
1595
+ line: z.ZodOptional<z.ZodNumber>;
1596
+ }, z.core.$strip>>;
1597
+ contractsHash: z.ZodString;
1598
+ }, z.core.$strip>>;
1599
+ }, z.core.$strip>>, OperationSpec<"describe_site", z.ZodObject<{}, z.core.$strict>, z.ZodObject<{
1600
+ outcome: z.ZodEnum<{
1601
+ ok: "ok";
1602
+ }>;
1603
+ site: z.ZodObject<{
1604
+ key: z.ZodString;
1605
+ locales: z.ZodArray<z.ZodString>;
1606
+ defaultLocale: z.ZodString;
1607
+ styleGuide: z.ZodNullable<z.ZodString>;
1608
+ collections: z.ZodArray<z.ZodObject<{
1609
+ name: z.ZodString;
1610
+ schema: z.ZodRecord<z.ZodString, z.ZodUnknown>;
1611
+ routes: z.ZodRecord<z.ZodString, z.ZodString>;
1612
+ translationGroupField: z.ZodNullable<z.ZodString>;
1613
+ tagsField: z.ZodNullable<z.ZodString>;
1614
+ sortByField: z.ZodNullable<z.ZodString>;
1615
+ components: z.ZodArray<z.ZodObject<{
1616
+ name: z.ZodString;
1617
+ description: z.ZodNullable<z.ZodString>;
1618
+ example: z.ZodNullable<z.ZodString>;
1619
+ props: z.ZodRecord<z.ZodString, z.ZodUnknown>;
1620
+ }, z.core.$strip>>;
1621
+ contracts: z.ZodArray<z.ZodObject<{
1622
+ id: z.ZodString;
1623
+ severity: z.ZodEnum<{
1624
+ error: "error";
1625
+ warning: "warning";
1626
+ }>;
1627
+ phases: z.ZodArray<z.ZodEnum<{
1628
+ publish: "publish";
1629
+ write: "write";
1630
+ }>>;
1631
+ description: z.ZodString;
1632
+ }, z.core.$strip>>;
1633
+ maxMarkdownBytes: z.ZodNumber;
1634
+ styleGuide: z.ZodNullable<z.ZodString>;
1635
+ }, z.core.$strip>>;
1636
+ }, z.core.$strip>;
1637
+ }, z.core.$strip>>, OperationSpec<"get_entry", z.ZodObject<{
1638
+ collection: z.ZodString;
1639
+ locale: z.ZodString;
1640
+ slug: z.ZodString;
1641
+ formats: z.ZodDefault<z.ZodArray<z.ZodEnum<{
1642
+ document: "document";
1643
+ html: "html";
1644
+ markdown: "markdown";
1645
+ }>>>;
1646
+ }, z.core.$strict>, z.ZodObject<{
1647
+ outcome: z.ZodEnum<{
1648
+ not_found: "not_found";
1649
+ ok: "ok";
1650
+ }>;
1651
+ entry: z.ZodOptional<z.ZodObject<{
1652
+ id: z.ZodString;
1653
+ collection: z.ZodString;
1654
+ locale: z.ZodString;
1655
+ slug: z.ZodString;
1656
+ translationGroup: z.ZodNullable<z.ZodString>;
1657
+ status: z.ZodEnum<{
1658
+ draft: "draft";
1659
+ published: "published";
1660
+ scheduled: "scheduled";
1661
+ }>;
1662
+ version: z.ZodNumber;
1663
+ frontmatter: z.ZodRecord<z.ZodString, z.ZodUnknown>;
1664
+ tags: z.ZodArray<z.ZodString>;
1665
+ hasUnpublishedChanges: z.ZodBoolean;
1666
+ publishedAt: z.ZodNullable<z.ZodString>;
1667
+ updatedAt: z.ZodString;
1668
+ revision: z.ZodString;
1669
+ verdict: z.ZodObject<{
1670
+ ok: z.ZodBoolean;
1671
+ phase: z.ZodEnum<{
1672
+ publish: "publish";
1673
+ write: "write";
1674
+ }>;
1675
+ errors: z.ZodArray<z.ZodObject<{
1676
+ contract: z.ZodString;
1677
+ severity: z.ZodEnum<{
1678
+ error: "error";
1679
+ warning: "warning";
1680
+ }>;
1681
+ path: z.ZodString;
1682
+ message: z.ZodString;
1683
+ fix: z.ZodString;
1684
+ line: z.ZodOptional<z.ZodNumber>;
1685
+ }, z.core.$strip>>;
1686
+ warnings: z.ZodArray<z.ZodObject<{
1687
+ contract: z.ZodString;
1688
+ severity: z.ZodEnum<{
1689
+ error: "error";
1690
+ warning: "warning";
1691
+ }>;
1692
+ path: z.ZodString;
1693
+ message: z.ZodString;
1694
+ fix: z.ZodString;
1695
+ line: z.ZodOptional<z.ZodNumber>;
1696
+ }, z.core.$strip>>;
1697
+ contractsHash: z.ZodString;
1698
+ }, z.core.$strip>;
1699
+ lastPublication: z.ZodNullable<z.ZodObject<{
1700
+ revision: z.ZodString;
1701
+ verdict: z.ZodObject<{
1702
+ ok: z.ZodBoolean;
1703
+ phase: z.ZodEnum<{
1704
+ publish: "publish";
1705
+ write: "write";
1706
+ }>;
1707
+ errors: z.ZodArray<z.ZodObject<{
1708
+ contract: z.ZodString;
1709
+ severity: z.ZodEnum<{
1710
+ error: "error";
1711
+ warning: "warning";
1712
+ }>;
1713
+ path: z.ZodString;
1714
+ message: z.ZodString;
1715
+ fix: z.ZodString;
1716
+ line: z.ZodOptional<z.ZodNumber>;
1717
+ }, z.core.$strip>>;
1718
+ warnings: z.ZodArray<z.ZodObject<{
1719
+ contract: z.ZodString;
1720
+ severity: z.ZodEnum<{
1721
+ error: "error";
1722
+ warning: "warning";
1723
+ }>;
1724
+ path: z.ZodString;
1725
+ message: z.ZodString;
1726
+ fix: z.ZodString;
1727
+ line: z.ZodOptional<z.ZodNumber>;
1728
+ }, z.core.$strip>>;
1729
+ contractsHash: z.ZodString;
1730
+ }, z.core.$strip>;
1731
+ acknowledged: z.ZodArray<z.ZodObject<{
1732
+ contract: z.ZodString;
1733
+ path: z.ZodString;
1734
+ }, z.core.$strip>>;
1735
+ at: z.ZodString;
1736
+ }, z.core.$strip>>;
1737
+ markdown: z.ZodOptional<z.ZodString>;
1738
+ document: z.ZodOptional<z.ZodObject<{
1739
+ nodes: z.ZodArray<z.ZodUnknown>;
1740
+ frontmatter: z.ZodRecord<z.ZodString, z.ZodUnknown>;
1741
+ meta: z.ZodRecord<z.ZodString, z.ZodUnknown>;
1742
+ }, z.core.$strip>>;
1743
+ html: z.ZodOptional<z.ZodString>;
1744
+ }, z.core.$strip>>;
1745
+ }, z.core.$strip>>, OperationSpec<"get_translations", z.ZodObject<{
1746
+ collection: z.ZodString;
1747
+ translationGroup: z.ZodString;
1748
+ }, z.core.$strict>, z.ZodObject<{
1749
+ outcome: z.ZodEnum<{
1750
+ not_found: "not_found";
1751
+ ok: "ok";
1752
+ }>;
1753
+ entries: z.ZodOptional<z.ZodArray<z.ZodObject<{
1754
+ id: z.ZodString;
1755
+ collection: z.ZodString;
1756
+ locale: z.ZodString;
1757
+ slug: z.ZodString;
1758
+ translationGroup: z.ZodNullable<z.ZodString>;
1759
+ status: z.ZodEnum<{
1760
+ draft: "draft";
1761
+ published: "published";
1762
+ scheduled: "scheduled";
1763
+ }>;
1764
+ version: z.ZodNumber;
1765
+ frontmatter: z.ZodRecord<z.ZodString, z.ZodUnknown>;
1766
+ tags: z.ZodArray<z.ZodString>;
1767
+ hasUnpublishedChanges: z.ZodBoolean;
1768
+ publishedAt: z.ZodNullable<z.ZodString>;
1769
+ updatedAt: z.ZodString;
1770
+ }, z.core.$strip>>>;
1771
+ }, z.core.$strip>>, OperationSpec<"list_entries", z.ZodObject<{
1772
+ collection: z.ZodString;
1773
+ locale: z.ZodOptional<z.ZodString>;
1774
+ tag: z.ZodOptional<z.ZodString>;
1775
+ status: z.ZodOptional<z.ZodEnum<{
1776
+ draft: "draft";
1777
+ published: "published";
1778
+ scheduled: "scheduled";
1779
+ }>>;
1780
+ limit: z.ZodDefault<z.ZodNumber>;
1781
+ cursor: z.ZodOptional<z.ZodString>;
1782
+ }, z.core.$strict>, z.ZodObject<{
1783
+ outcome: z.ZodEnum<{
1784
+ ok: "ok";
1785
+ }>;
1786
+ entries: z.ZodArray<z.ZodObject<{
1787
+ id: z.ZodString;
1788
+ collection: z.ZodString;
1789
+ locale: z.ZodString;
1790
+ slug: z.ZodString;
1791
+ translationGroup: z.ZodNullable<z.ZodString>;
1792
+ status: z.ZodEnum<{
1793
+ draft: "draft";
1794
+ published: "published";
1795
+ scheduled: "scheduled";
1796
+ }>;
1797
+ version: z.ZodNumber;
1798
+ frontmatter: z.ZodRecord<z.ZodString, z.ZodUnknown>;
1799
+ tags: z.ZodArray<z.ZodString>;
1800
+ hasUnpublishedChanges: z.ZodBoolean;
1801
+ publishedAt: z.ZodNullable<z.ZodString>;
1802
+ updatedAt: z.ZodString;
1803
+ }, z.core.$strip>>;
1804
+ nextCursor: z.ZodNullable<z.ZodString>;
1805
+ }, z.core.$strip>>, OperationSpec<"publish", z.ZodObject<{
1806
+ id: z.ZodString;
1807
+ version: z.ZodNumber;
1808
+ acknowledgeWarnings: z.ZodDefault<z.ZodArray<z.ZodObject<{
1809
+ contract: z.ZodString;
1810
+ path: z.ZodString;
1811
+ }, z.core.$strip>>>;
1812
+ }, z.core.$strict>, z.ZodObject<{
1813
+ outcome: z.ZodEnum<{
1814
+ blocked: "blocked";
1815
+ conflict: "conflict";
1816
+ needs_acknowledgement: "needs_acknowledgement";
1817
+ not_found: "not_found";
1818
+ published: "published";
1819
+ }>;
1820
+ entry: z.ZodOptional<z.ZodObject<{
1821
+ id: z.ZodString;
1822
+ collection: z.ZodString;
1823
+ locale: z.ZodString;
1824
+ slug: z.ZodString;
1825
+ translationGroup: z.ZodNullable<z.ZodString>;
1826
+ status: z.ZodEnum<{
1827
+ draft: "draft";
1828
+ published: "published";
1829
+ scheduled: "scheduled";
1830
+ }>;
1831
+ version: z.ZodNumber;
1832
+ frontmatter: z.ZodRecord<z.ZodString, z.ZodUnknown>;
1833
+ tags: z.ZodArray<z.ZodString>;
1834
+ hasUnpublishedChanges: z.ZodBoolean;
1835
+ publishedAt: z.ZodNullable<z.ZodString>;
1836
+ updatedAt: z.ZodString;
1837
+ }, z.core.$strip>>;
1838
+ verdict: z.ZodOptional<z.ZodObject<{
1839
+ ok: z.ZodBoolean;
1840
+ phase: z.ZodEnum<{
1841
+ publish: "publish";
1842
+ write: "write";
1843
+ }>;
1844
+ errors: z.ZodArray<z.ZodObject<{
1845
+ contract: z.ZodString;
1846
+ severity: z.ZodEnum<{
1847
+ error: "error";
1848
+ warning: "warning";
1849
+ }>;
1850
+ path: z.ZodString;
1851
+ message: z.ZodString;
1852
+ fix: z.ZodString;
1853
+ line: z.ZodOptional<z.ZodNumber>;
1854
+ }, z.core.$strip>>;
1855
+ warnings: z.ZodArray<z.ZodObject<{
1856
+ contract: z.ZodString;
1857
+ severity: z.ZodEnum<{
1858
+ error: "error";
1859
+ warning: "warning";
1860
+ }>;
1861
+ path: z.ZodString;
1862
+ message: z.ZodString;
1863
+ fix: z.ZodString;
1864
+ line: z.ZodOptional<z.ZodNumber>;
1865
+ }, z.core.$strip>>;
1866
+ contractsHash: z.ZodString;
1867
+ }, z.core.$strip>>;
1868
+ conflict: z.ZodOptional<z.ZodObject<{
1869
+ currentVersion: z.ZodNumber;
1870
+ headRevision: z.ZodString;
1871
+ }, z.core.$strip>>;
1872
+ }, z.core.$strip>>, OperationSpec<"unpublish", z.ZodObject<{
1873
+ id: z.ZodString;
1874
+ }, z.core.$strict>, z.ZodObject<{
1875
+ outcome: z.ZodEnum<{
1876
+ not_found: "not_found";
1877
+ unpublished: "unpublished";
1878
+ }>;
1879
+ entry: z.ZodOptional<z.ZodObject<{
1880
+ id: z.ZodString;
1881
+ collection: z.ZodString;
1882
+ locale: z.ZodString;
1883
+ slug: z.ZodString;
1884
+ translationGroup: z.ZodNullable<z.ZodString>;
1885
+ status: z.ZodEnum<{
1886
+ draft: "draft";
1887
+ published: "published";
1888
+ scheduled: "scheduled";
1889
+ }>;
1890
+ version: z.ZodNumber;
1891
+ frontmatter: z.ZodRecord<z.ZodString, z.ZodUnknown>;
1892
+ tags: z.ZodArray<z.ZodString>;
1893
+ hasUnpublishedChanges: z.ZodBoolean;
1894
+ publishedAt: z.ZodNullable<z.ZodString>;
1895
+ updatedAt: z.ZodString;
1896
+ }, z.core.$strip>>;
1897
+ }, z.core.$strip>>, OperationSpec<"update_draft", z.ZodObject<{
1898
+ id: z.ZodString;
1899
+ version: z.ZodNumber;
1900
+ markdown: z.ZodString;
1901
+ }, z.core.$strict>, z.ZodObject<{
1902
+ outcome: z.ZodEnum<{
1903
+ conflict: "conflict";
1904
+ not_found: "not_found";
1905
+ refused: "refused";
1906
+ saved: "saved";
1907
+ unchanged: "unchanged";
1908
+ }>;
1909
+ entry: z.ZodOptional<z.ZodObject<{
1910
+ id: z.ZodString;
1911
+ collection: z.ZodString;
1912
+ locale: z.ZodString;
1913
+ slug: z.ZodString;
1914
+ translationGroup: z.ZodNullable<z.ZodString>;
1915
+ status: z.ZodEnum<{
1916
+ draft: "draft";
1917
+ published: "published";
1918
+ scheduled: "scheduled";
1919
+ }>;
1920
+ version: z.ZodNumber;
1921
+ frontmatter: z.ZodRecord<z.ZodString, z.ZodUnknown>;
1922
+ tags: z.ZodArray<z.ZodString>;
1923
+ hasUnpublishedChanges: z.ZodBoolean;
1924
+ publishedAt: z.ZodNullable<z.ZodString>;
1925
+ updatedAt: z.ZodString;
1926
+ }, z.core.$strip>>;
1927
+ verdict: z.ZodOptional<z.ZodObject<{
1928
+ ok: z.ZodBoolean;
1929
+ phase: z.ZodEnum<{
1930
+ publish: "publish";
1931
+ write: "write";
1932
+ }>;
1933
+ errors: z.ZodArray<z.ZodObject<{
1934
+ contract: z.ZodString;
1935
+ severity: z.ZodEnum<{
1936
+ error: "error";
1937
+ warning: "warning";
1938
+ }>;
1939
+ path: z.ZodString;
1940
+ message: z.ZodString;
1941
+ fix: z.ZodString;
1942
+ line: z.ZodOptional<z.ZodNumber>;
1943
+ }, z.core.$strip>>;
1944
+ warnings: z.ZodArray<z.ZodObject<{
1945
+ contract: z.ZodString;
1946
+ severity: z.ZodEnum<{
1947
+ error: "error";
1948
+ warning: "warning";
1949
+ }>;
1950
+ path: z.ZodString;
1951
+ message: z.ZodString;
1952
+ fix: z.ZodString;
1953
+ line: z.ZodOptional<z.ZodNumber>;
1954
+ }, z.core.$strip>>;
1955
+ contractsHash: z.ZodString;
1956
+ }, z.core.$strip>>;
1957
+ conflict: z.ZodOptional<z.ZodObject<{
1958
+ currentVersion: z.ZodNumber;
1959
+ headRevision: z.ZodString;
1960
+ }, z.core.$strip>>;
1961
+ }, z.core.$strip>>, OperationSpec<"validate", z.ZodObject<{
1962
+ collection: z.ZodString;
1963
+ locale: z.ZodString;
1964
+ slug: z.ZodString;
1965
+ markdown: z.ZodString;
1966
+ }, z.core.$strict>, z.ZodObject<{
1967
+ outcome: z.ZodEnum<{
1968
+ ok: "ok";
1969
+ }>;
1970
+ verdict: z.ZodObject<{
1971
+ ok: z.ZodBoolean;
1972
+ phase: z.ZodEnum<{
1973
+ publish: "publish";
1974
+ write: "write";
1975
+ }>;
1976
+ errors: z.ZodArray<z.ZodObject<{
1977
+ contract: z.ZodString;
1978
+ severity: z.ZodEnum<{
1979
+ error: "error";
1980
+ warning: "warning";
1981
+ }>;
1982
+ path: z.ZodString;
1983
+ message: z.ZodString;
1984
+ fix: z.ZodString;
1985
+ line: z.ZodOptional<z.ZodNumber>;
1986
+ }, z.core.$strip>>;
1987
+ warnings: z.ZodArray<z.ZodObject<{
1988
+ contract: z.ZodString;
1989
+ severity: z.ZodEnum<{
1990
+ error: "error";
1991
+ warning: "warning";
1992
+ }>;
1993
+ path: z.ZodString;
1994
+ message: z.ZodString;
1995
+ fix: z.ZodString;
1996
+ line: z.ZodOptional<z.ZodNumber>;
1997
+ }, z.core.$strip>>;
1998
+ contractsHash: z.ZodString;
1999
+ }, z.core.$strip>;
2000
+ }, z.core.$strip>>];
2001
+ type Operation = (typeof OPERATIONS)[number];
2002
+ type OperationName = Operation['name'];
2003
+ /** The spec of an operation, by its name. */
2004
+ type OperationByName<Name extends OperationName> = Extract<Operation, {
2005
+ name: Name;
2006
+ }>;
2007
+ //#endregion
2008
+ //#region src/tokens.d.ts
2009
+ /**
2010
+ * Personal tokens (ADR-019): `hw_pat_` and 52 characters of lowercase Crockford base 32, which
2011
+ * carry 260 random bits. The CLI makes a token and prints it once. The server never stores it:
2012
+ * it keeps the SHA-256 of the whole token, in hex, and finds a presented token by that hash. The
2013
+ * row of a token has an id of its own (`tok_…`, see `ids.ts`), its scopes and its expiry.
2014
+ */
2015
+ export declare const PERSONAL_TOKEN_PREFIX = "hw_pat_";
2016
+ /** Days until a new personal token expires, unless whoever creates it asks for another expiry. */
2017
+ export declare const PERSONAL_TOKEN_TTL_DAYS = 90;
2018
+ /**
2019
+ * A new personal token. Each of the 52 random bytes gives one character (its low 5 bits, which
2020
+ * are uniform because 256 is a multiple of 32). `random` defaults to `crypto.getRandomValues`;
2021
+ * tests pass their own bytes.
2022
+ */
2023
+ export declare function generatePersonalToken(random?: Uint8Array): string;
2024
+ /** Whether a string has the shape of a personal token. It says nothing about whether one exists. */
2025
+ export declare function isPersonalToken(value: string): boolean;
2026
+ /** The SHA-256 of a token, in lowercase hex: what the `tokens` table stores and looks up. */
2027
+ export declare function hashPersonalToken(token: string): Promise<string>;
2028
+ //#endregion
1
2029
  //#region src/index.d.ts
2
2030
  export declare const name = "@hollware/core";
3
- //#endregion
2031
+ //#endregion
2032
+ export { type AcknowledgedWarning, type BuiltInContractId, type BuiltInOptions, type CollectionDefinition, type ComponentDefinition, type ComponentUse, type ConfigProblem, type Contract, type ContractContext, type ContractDescription, type ContractFinding, type ContractText, type CustomContractOptions, type DescribedSchema, type DisallowedMarker, type Effect, type EntryDocument, type EntryFacts, type EntryLookup, type EntryRef, type ErrorCode, type ExtractedContent, type Heading, type HollwareConfig, type IdPrefix, type ImageRef, type LinkRef, type LinkTarget, type Operation, type OperationByName, type OperationName, type OperationSpec, type OutcomeInfo, type OutcomeOf, type Phase, type ProcessMarkdown, type ProcessMarkdownOptions, type ProcessResult, type ProcessedMarkdown, type RenderHtml, type ResolveConfig, type ResolvedCollection, type ResolvedConfig, type ResolvedSite, type RunContractsInput, type SchemaOutput, type Scope, type Severity, type SiteDefinition, type SiteDescription, type Verdict, type Violation, schemas_d_exports as schemas };