@dogsbay/types 0.2.0-beta.12 → 0.2.0-beta.121

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.
@@ -0,0 +1,125 @@
1
+ /**
2
+ * Directive nodes — source-level DITA/Jinja authoring constructs.
3
+ *
4
+ * ── Corpus survey (2026-07-06) ────────────────────────────────────────
5
+ * The authoritative directive vocabulary is @dogsbay/minja's AST
6
+ * (packages/minja/src/types.ts):
7
+ * - variable `{{ name }}` → VariableNode { name }
8
+ * - if/elif/else `{% if expr %}…` → IfNode { condition, trueBranch, elif[], else }
9
+ * - include `{% include "path" %}` → IncludeNode { path }
10
+ * - set `{% set name = expr %}` → SetNode { name, value }
11
+ * - switch / leveloffset / comment → richer forms
12
+ * AsciiDoc `ifdef`/`ifndef` convert to minja `if` (adoc2md-modular);
13
+ * DITA conref/keyref map to includes/variables (format-dita). Profiling
14
+ * attributes (`@platform`/`@audience`) are plain node `props`, filtered
15
+ * at build via ditaval — no new node type needed.
16
+ *
17
+ * ── Why these types exist ─────────────────────────────────────────────
18
+ * Today these constructs are resolved to a STRING before TreeNode exists
19
+ * (standalone minja; see docs-dev/editor-framework-decision.md). TreeNode
20
+ * is the resolved-output model and has no representation of them. The
21
+ * editor edits the *unresolved source*, so it needs them as first-class,
22
+ * round-trippable nodes. The definitions below are ADDITIVE:
23
+ * - block directives ride TreeNode's open `type: string` — NO union change;
24
+ * - inline directives extend InlineNode via `InlineNodeWithDirectives`
25
+ * (below) rather than the base union, so the monorepo's ~10 exhaustive
26
+ * InlineNode consumers keep compiling. Folding them into the base
27
+ * union and updating those consumers is Phase 2 — see
28
+ * plans/editor-directive-model.md.
29
+ *
30
+ * ── Fidelity rule ─────────────────────────────────────────────────────
31
+ * Anything not modeled first-class (elif/else chains, switch, leveloffset,
32
+ * unknown directives) is preserved verbatim as a `directive-raw` node — a
33
+ * source-of-truth tool must never drop a construct it cannot fully model.
34
+ */
35
+ import type { TreeNode, InlineNode } from "./tree.js";
36
+ /** `{% if test %} … {% endif %}` — guarded flow content. elif/else: Phase 2. */
37
+ export interface ConditionalNode extends TreeNode {
38
+ type: "conditional";
39
+ /** raw expression source, e.g. `platform == "mac"` */
40
+ props: {
41
+ test: string;
42
+ };
43
+ children: TreeNode[];
44
+ }
45
+ /** `{% include "src" %}` — transclusion of another topic/fragment. */
46
+ export interface IncludeNode extends TreeNode {
47
+ type: "include";
48
+ /** `src` is the include target as written; extra keys pass through */
49
+ props: {
50
+ src: string;
51
+ [key: string]: unknown;
52
+ };
53
+ }
54
+ /** `{% set name = value %}` — in-document variable definition. */
55
+ export interface VarDefNode extends TreeNode {
56
+ type: "var-def";
57
+ /** `value` is the raw value-expression source */
58
+ props: {
59
+ name: string;
60
+ value: string;
61
+ };
62
+ }
63
+ /** Any directive not modeled first-class, preserved verbatim for round-trip. */
64
+ export interface DirectiveRawNode extends TreeNode {
65
+ type: "directive-raw";
66
+ /** `source` is the exact span; `kind` is a best-effort hint (e.g. "switch") */
67
+ props: {
68
+ source: string;
69
+ kind?: string;
70
+ };
71
+ }
72
+ export type DirectiveBlockNode = ConditionalNode | IncludeNode | VarDefNode | DirectiveRawNode;
73
+ export declare const isConditional: (n: TreeNode) => n is ConditionalNode;
74
+ export declare const isInclude: (n: TreeNode) => n is IncludeNode;
75
+ export declare const isVarDef: (n: TreeNode) => n is VarDefNode;
76
+ export declare const isDirectiveRaw: (n: TreeNode) => n is DirectiveRawNode;
77
+ export declare const isDirectiveBlock: (n: TreeNode) => n is DirectiveBlockNode;
78
+ /**
79
+ * Inline `{{ expr }}` — a variable/expression chip.
80
+ *
81
+ * The optional flags mirror InlineText's flat formatting annotations:
82
+ * a directive inside `**…**` carries its containing span's formatting
83
+ * (there is no wrapper node in the flat inline model to carry it).
84
+ */
85
+ export interface InlineVariable {
86
+ type: "variable";
87
+ /** raw source between the braces, e.g. `product.name` */
88
+ expr: string;
89
+ bold?: boolean;
90
+ italic?: boolean;
91
+ strikethrough?: boolean;
92
+ }
93
+ /** Inline conditional span: content shown only when `test` holds. */
94
+ export interface InlineConditionalSpan {
95
+ type: "conditional-span";
96
+ /** raw expression source */
97
+ test: string;
98
+ children: InlineNode[];
99
+ bold?: boolean;
100
+ italic?: boolean;
101
+ strikethrough?: boolean;
102
+ }
103
+ /** Inline directive not modeled first-class, preserved verbatim. */
104
+ export interface InlineDirectiveRaw {
105
+ type: "directive-raw-inline";
106
+ /** exact source span */
107
+ source: string;
108
+ bold?: boolean;
109
+ italic?: boolean;
110
+ strikethrough?: boolean;
111
+ }
112
+ export type InlineDirectiveNode = InlineVariable | InlineConditionalSpan | InlineDirectiveRaw;
113
+ /**
114
+ * InlineNode extended with directive members. Directive-aware code (the
115
+ * editor, the preserve-mode parser) uses this; the base `InlineNode` union
116
+ * stays unchanged so existing exhaustive consumers keep compiling. Phase 2
117
+ * folds these into the base union and updates those consumers.
118
+ */
119
+ export type InlineNodeWithDirectives = InlineNode | InlineDirectiveNode;
120
+ export declare const isInlineDirective: (n: InlineNodeWithDirectives) => n is InlineDirectiveNode;
121
+ export declare const PROFILING_ATTRS: readonly ["platform", "product", "audience", "rev", "otherprops"];
122
+ export type ProfilingAttr = (typeof PROFILING_ATTRS)[number];
123
+ /** Extract the profiling attributes present on a node's `props`. */
124
+ export declare function profilingOf(node: TreeNode): Partial<Record<ProfilingAttr, unknown>>;
125
+ //# sourceMappingURL=directives.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"directives.d.ts","sourceRoot":"","sources":["../src/directives.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AACH,OAAO,KAAK,EAAE,QAAQ,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AAQtD,gFAAgF;AAChF,MAAM,WAAW,eAAgB,SAAQ,QAAQ;IAC/C,IAAI,EAAE,aAAa,CAAC;IACpB,sDAAsD;IACtD,KAAK,EAAE;QAAE,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC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AC;IACb,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,aAAa,CAAC,EAAE,OAAO,CAAC;CACzB;AAED,qEAAqE;AACrE,MAAM,WAAW,qBAAqB;IACpC,IAAI,EAAE,kBAAkB,CAAC;IACzB,4BAA4B;IAC5B,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,UAAU,EAAE,CAAC;IACvB,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,aAAa,CAAC,EAAE,OAAO,CAAC;CACzB;AAED,oEAAoE;AACpE,MAAM,WAAW,kBAAkB;IACjC,IAAI,EAAE,sBAAsB,CAAC;IAC7B,wBAAwB;IACxB,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,aAAa,CAAC,EAAE,OAAO,CAAC;CACzB;AAED,MAAM,MAAM,mBAAmB,GAAG,cAAc,GAAG,qBAAqB,GAAG,kBAAkB,CAAC;AAE9F;;;;;GAKG;AACH,MAAM,MAAM,wBAAwB,GAAG,UAAU,GAAG,mBAAmB,CAAC;AAOxE,eAAO,MAAM,iBAAiB,GAAI,GAAG,wBAAwB,KAAG,CAAC,IAAI,mBACX,CAAC;AAO3D,eAAO,MAAM,eAAe,mEAAoE,CAAC;AACjG,MAAM,MAAM,aAAa,GAAG,CAAC,OAAO,eAAe,CAAC,CAAC,MAAM,CAAC,CAAC;AAE7D,oEAAoE;AACpE,wBAAgB,WAAW,CAAC,IAAI,EAAE,QAAQ,GAAG,OAAO,CAAC,MAAM,CAAC,aAAa,EAAE,OAAO,CAAC,CAAC,CAMnF"}
@@ -0,0 +1,27 @@
1
+ export const isConditional = (n) => n.type === "conditional";
2
+ export const isInclude = (n) => n.type === "include";
3
+ export const isVarDef = (n) => n.type === "var-def";
4
+ export const isDirectiveRaw = (n) => n.type === "directive-raw";
5
+ export const isDirectiveBlock = (n) => isConditional(n) || isInclude(n) || isVarDef(n) || isDirectiveRaw(n);
6
+ const INLINE_DIRECTIVE_TYPES = new Set([
7
+ "variable",
8
+ "conditional-span",
9
+ "directive-raw-inline",
10
+ ]);
11
+ export const isInlineDirective = (n) => INLINE_DIRECTIVE_TYPES.has(n.type);
12
+ /* ───────────────────── profiling attributes ───────────────────────────
13
+ * DITA-style profiling — the *attribute* form of a conditional (the
14
+ * *wrapper* form is ConditionalNode). Lives in plain `props`, filtered at
15
+ * build via ditaval. A reserved-key convention, not a type change.
16
+ */
17
+ export const PROFILING_ATTRS = ["platform", "product", "audience", "rev", "otherprops"];
18
+ /** Extract the profiling attributes present on a node's `props`. */
19
+ export function profilingOf(node) {
20
+ const out = {};
21
+ for (const key of PROFILING_ATTRS) {
22
+ if (node.props && key in node.props)
23
+ out[key] = node.props[key];
24
+ }
25
+ return out;
26
+ }
27
+ //# sourceMappingURL=directives.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"directives.js","sourceRoot":"","sources":["../src/directives.ts"],"names":[],"mappings":"AAyEA,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,CAAW,EAAwB,EAAE,CAAC,CAAC,CAAC,IAAI,KAAK,aAAa,CAAC;AAC7F,MAAM,CAAC,MAAM,SAAS,GAAG,CAAC,CAAW,EAAoB,EAAE,CAAC,CAAC,CAAC,IAAI,KAAK,SAAS,CAAC;AACjF,MAAM,CAAC,MAAM,QAAQ,GAAG,CAAC,CAAW,EAAmB,EAAE,CAAC,CAAC,CAAC,IAAI,KAAK,SAAS,CAAC;AAC/E,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,CAAW,EAAyB,EAAE,CAAC,CAAC,CAAC,IAAI,KAAK,eAAe,CAAC;AACjG,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,CAAW,EAA2B,EAAE,CACvE,aAAa,CAAC,CAAC,CAAC,IAAI,SAAS,CAAC,CAAC,CAAC,IAAI,QAAQ,CAAC,CAAC,CAAC,IAAI,cAAc,CAAC,CAAC,CAAC,CAAC;AAsDvE,MAAM,sBAAsB,GAAG,IAAI,GAAG,CAAC;IACrC,UAAU;IACV,kBAAkB;IAClB,sBAAsB;CACvB,CAAC,CAAC;AACH,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,CAA2B,EAA4B,EAAE,CACzF,sBAAsB,CAAC,GAAG,CAAE,CAAsB,CAAC,IAAI,CAAC,CAAC;AAE3D;;;;GAIG;AACH,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC,UAAU,EAAE,SAAS,EAAE,UAAU,EAAE,KAAK,EAAE,YAAY,CAAU,CAAC;AAGjG,oEAAoE;AACpE,MAAM,UAAU,WAAW,CAAC,IAAc;IACxC,MAAM,GAAG,GAA4C,EAAE,CAAC;IACxD,KAAK,MAAM,GAAG,IAAI,eAAe,EAAE,CAAC;QAClC,IAAI,IAAI,CAAC,KAAK,IAAI,GAAG,IAAI,IAAI,CAAC,KAAK;YAAE,GAAG,CAAC,GAAG,CAAC,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;IAClE,CAAC;IACD,OAAO,GAAG,CAAC;AACb,CAAC"}
package/dist/format.d.ts CHANGED
@@ -16,6 +16,14 @@ export interface Heading {
16
16
  export interface ExportPage {
17
17
  /** File path relative to docs root, e.g. "getting-started" or "guides/install" */
18
18
  slug: string;
19
+ /**
20
+ * The source file, relative to the content root (`agent/index.md`), for an
21
+ * importer whose pages keep the author's relative links. Relative links are
22
+ * written against the FILE, and a directory's `index.md` has the directory
23
+ * as its slug, so the slug alone cannot say where `./overview` points.
24
+ * Importers that rewrite links to root-absolute leave it unset.
25
+ */
26
+ sourcePath?: string;
19
27
  /** Page title */
20
28
  title: string;
21
29
  /** Page content as TreeNode[] */
@@ -24,6 +32,26 @@ export interface ExportPage {
24
32
  headings: Heading[];
25
33
  /** Target URL for redirect/navigation pages (no body content, just a link) */
26
34
  redirect?: string;
35
+ /**
36
+ * Marks an include fragment (not a routable page): content meant to be
37
+ * `{% include %}`'d into other pages. Exporters write it as a plain `.md`
38
+ * include target at its slug — no frontmatter, no title, no nav entry. Used
39
+ * by structural-partial import modes (Docusaurus `--partial-mode include`,
40
+ * AsciiDoc fragments).
41
+ */
42
+ fragment?: boolean;
43
+ /**
44
+ * The page uses template-page syntax (plans/page-templates.md): Dogsbay-MD
45
+ * writes `template: jinja` in its front matter so the build renders it as
46
+ * a template page. Set by importers converting partials with parameters.
47
+ */
48
+ template?: boolean;
49
+ /**
50
+ * A template partial's declared parameters (`name`, or `name?` when
51
+ * optional). Dogsbay-MD writes them as front matter `params:` on the
52
+ * fragment, and the build validates every include against them.
53
+ */
54
+ templateParams?: string[];
27
55
  /**
28
56
  * Raw frontmatter data from the source page. Includes all YAML fields that
29
57
  * were present in the original source (title, description, tags, custom
@@ -60,6 +88,26 @@ export interface ExportPage {
60
88
  * See plans/multi-source-content.md.
61
89
  */
62
90
  multiSource?: MultiSourceMeta;
91
+ /**
92
+ * Direct-from-source markdown body, when the importer can produce
93
+ * one. Bypasses the TreeNode round-trip for callers that want to
94
+ * preserve the source's line structure verbatim (most importantly,
95
+ * `migrate-asciidoc`, which would otherwise see markdown-it fold
96
+ * adjacent non-blank lines into one paragraph and the
97
+ * format-dogsbay-md serializer flatten that paragraph onto a single
98
+ * line — turning every `ifdef` / `endif` block in the original
99
+ * `.adoc` into an unreadable wall of text).
100
+ *
101
+ * Importers that produce a faithful direct-from-source markdown
102
+ * (currently `format-asciidoc`) populate this field. Importers that
103
+ * don't (most format plugins) leave it `undefined` and consumers
104
+ * fall back to the TreeNode-derived body via `treeToDogsbayMd`.
105
+ *
106
+ * The TreeNode round-trip is still the canonical path for runtime
107
+ * rendering — `bodyMarkdown` is a migration-time convenience that
108
+ * doesn't change the import contract.
109
+ */
110
+ bodyMarkdown?: string;
63
111
  }
64
112
  /**
65
113
  * Per-page axis metadata. Set by the loader's aggregator when
@@ -93,6 +141,39 @@ export interface NavItem {
93
141
  label: string;
94
142
  href?: string;
95
143
  children?: NavItem[];
144
+ /**
145
+ * Granularity book view (plans/granularity-views.md). Opt-in, per nav node:
146
+ * - "yes" — emit one rolled-up single page for this node's subtree.
147
+ * - "children" — emit a single page for each direct child (chapters); a
148
+ * child may override with its own "no".
149
+ * - "no" — no single page (the default when omitted).
150
+ */
151
+ singlePage?: "yes" | "no" | "children";
152
+ /**
153
+ * A state marker rendered beside the label — structured DATA, not text
154
+ * baked into `label`. Release comparisons use it for changed/new/removed
155
+ * pages; the same slot serves "new since your last visit", deprecation
156
+ * flags, and version badges.
157
+ *
158
+ * The renderer is responsible for making it perceivable WITHOUT colour
159
+ * (distinct glyph + visually-hidden text) — see SidebarNavTree.
160
+ *
161
+ * A branch may carry a marker for its SUBTREE: a collapsed group hides
162
+ * its children, so a change inside it must signal outward (the same
163
+ * visibility rule the diff renderer applies to tabs).
164
+ */
165
+ mark?: NavMark;
166
+ }
167
+ export type NavMarkKind = "added" | "changed" | "removed" | "moved";
168
+ export interface NavMark {
169
+ kind: NavMarkKind;
170
+ /**
171
+ * Announced to assistive tech and shown on hover. Defaults to `kind`.
172
+ * A branch aggregating its subtree says so ("3 pages changed").
173
+ */
174
+ label?: string;
175
+ /** True when this marker summarizes DESCENDANTS, not the item itself. */
176
+ subtree?: boolean;
96
177
  }
97
178
  /**
98
179
  * Standard interface for format plugins.
@@ -114,13 +195,90 @@ export interface FormatPlugin {
114
195
  /** Format-specific CLI options for export */
115
196
  exportOptions?: FormatOption[];
116
197
  /** Import: read source format, produce pages + nav */
117
- import?(source: string, opts: Record<string, unknown>): Promise<{
118
- pages: ExportPage[];
119
- nav: NavItem[];
120
- }>;
198
+ import?(source: string, opts: Record<string, unknown>): Promise<ImportResult>;
121
199
  /** Export: write pages + nav to target format */
122
200
  export?(pages: ExportPage[], nav: NavItem[], output: string, opts: Record<string, unknown>): Promise<void>;
123
201
  }
202
+ export interface ImportResult {
203
+ pages: ExportPage[];
204
+ nav: NavItem[];
205
+ /**
206
+ * Directories whose CONTENTS should be mounted at `_assets/` in the output,
207
+ * so the `/_assets/…` refs importers rewrite image paths to actually
208
+ * resolve.
209
+ *
210
+ * An importer that knows where its media lives (a Starlight `src/assets`, a
211
+ * Docusaurus `static/`) declares it here. Without this the reference
212
+ * survives the conversion and the FILE does not — a page count, a retention
213
+ * score and a clean exit all look fine while every image 404s.
214
+ *
215
+ * `into` targets an `_assets/<into>` subdir; `mediaOnly` copies only media
216
+ * files, for the case where the mounted dir is the docs tree itself and
217
+ * carries co-located images.
218
+ */
219
+ assetMounts?: {
220
+ dir: string;
221
+ into?: string;
222
+ mediaOnly?: boolean;
223
+ exclude?: string[];
224
+ /**
225
+ * Public directory the mount lands in. Defaults to `_assets` — the name
226
+ * every IMPORTER rewrites its refs to. Hand-authored content differs: an
227
+ * author who has not read docs/images.md types `/images/logo.png`, so
228
+ * `format-dogsbay-md` also recognises `images/` and `assets/` and sets
229
+ * this to whichever it found. The copy must preserve the name, or the
230
+ * reference and the file disagree — the exact failure this field's
231
+ * neighbours exist to prevent.
232
+ */
233
+ root?: string;
234
+ }[];
235
+ /**
236
+ * Directory that page slugs are relative to, when it is NOT the path the
237
+ * user passed on the command line.
238
+ *
239
+ * MkDocs keeps its pages under `docs/`, Hugo under `content/`, a Docusaurus
240
+ * instance under its own docs dir — so a page at slug `guide/install`
241
+ * writing `{% include "_snippets/note.md" %}` means
242
+ * `<source>/docs/_snippets/note.md`, not `<source>/_snippets/note.md`.
243
+ * Resolving includes against the CLI argument missed every fragment in
244
+ * those corpora, which (since unresolved includes now fail the run) turned
245
+ * a working conversion into a hard error.
246
+ *
247
+ * Omit when slugs are relative to `source` itself.
248
+ */
249
+ contentRoot?: string;
250
+ /**
251
+ * SEVERAL content roots, each mounted under a slug prefix — the Antora
252
+ * PLAYBOOK case (#067): `docs/guides/` → `guides/`, `docs/server-admin-4.9/`
253
+ * → `server-admin/server-4.9/`. Fragments (partials, examples, images)
254
+ * under each `dir` are mirrored beneath its `prefix` so a page at
255
+ * `guides/deploy/x` writing `{% include "../../modules/ROOT/partials/y.md" %}`
256
+ * finds `<content>/guides/modules/ROOT/partials/y.md`. Takes precedence
257
+ * over `contentRoot` when present. `prefix` is `""` for the root mount.
258
+ */
259
+ sourceMounts?: {
260
+ dir: string;
261
+ prefix: string;
262
+ }[];
263
+ /**
264
+ * Antora playbook mode (#067): loaded components by NAME → root dir +
265
+ * slug prefix, for the engine's cross-component resource-ID
266
+ * resolution in fragments (pages get it via the plugin's own parse).
267
+ */
268
+ antoraComponents?: Record<string, {
269
+ dir: string;
270
+ prefix: string;
271
+ }>;
272
+ /**
273
+ * Attribute values the CORPUS declares (Antora playbook + component
274
+ * `asciidoc.attributes`, an AsciiBinder distro map, …) that the site
275
+ * build must resolve — a `{{ serverversion49 }}` the migrate emitted
276
+ * shipped as literal `{serverversion49}` because nothing wrote them into
277
+ * `dogsbay.config.yml` (#067 review). Migrate persists these under the
278
+ * user's own `--attribute` values (user wins).
279
+ */
280
+ corpusAttributes?: Record<string, unknown>;
281
+ }
124
282
  export interface FormatOption {
125
283
  flags: string;
126
284
  description: string;
@@ -157,6 +315,8 @@ export interface PlausibleConfig {
157
315
  export interface SiteConfig {
158
316
  /** Site name shown in header, page title suffixes, copyright notices. */
159
317
  siteName: string;
318
+ /** The line under the site name in the sidebar header (`site.tagline`). Default "Documentation". */
319
+ tagline?: string;
160
320
  /**
161
321
  * Canonical site URL. Required for `<link rel="canonical">`,
162
322
  * sitemap.xml entries, and absolute OG meta tags. Without it, those
@@ -197,6 +357,11 @@ export interface SiteConfig {
197
357
  editUri?: string;
198
358
  /** Footer copyright text. */
199
359
  copyright?: string;
360
+ /**
361
+ * "Powered by DogsBay" footer attribution. Defaults to true for generated
362
+ * sites; `poweredBy: false` in dogsbay.config.yml removes it entirely.
363
+ */
364
+ poweredBy?: boolean;
200
365
  /**
201
366
  * Brand keywords for the site, used by the
202
367
  * `seo/h1-brand-keyword` audit rule to verify that landing
@@ -223,6 +388,12 @@ export interface SiteConfig {
223
388
  * chips with prefix-keyed colors. See plans/tag-display-config.md.
224
389
  */
225
390
  tagPrefixes?: Record<string, TagPrefixDisplay>;
391
+ /**
392
+ * Color tag chips whose prefix has no color with a palette color
393
+ * chosen by a hash of the first segment. Sourced from
394
+ * `taxonomies.tags.autoColor`. See plans/tag-auto-color.md.
395
+ */
396
+ tagAutoColor?: boolean;
226
397
  /**
227
398
  * Per-tag leaf-label overrides (slug → display string). URLs and
228
399
  * taxonomy term-page paths still use the slug; only chip text
@@ -270,6 +441,30 @@ export interface SiteConfig {
270
441
  * human-facing UI cluster.
271
442
  */
272
443
  llmActions?: LlmActionsConfig;
444
+ /**
445
+ * Resolved glyphs for the internal/external link-icon affordance.
446
+ * When present, `DocsLayout` marks links in the prose with a small
447
+ * trailing icon so readers can tell internal navigation from links
448
+ * that leave the site. Sourced from `content.linkIcons` in
449
+ * `dogsbay.config.yml` and normalized by the CLI. Omitted (whole
450
+ * object absent) when the feature is off. Either side may be absent
451
+ * to show an icon for only that link kind. A core feature — not tied
452
+ * to any importer. See plans/link-resolution-and-icons.md.
453
+ */
454
+ linkIcons?: LinkIconsConfig;
455
+ }
456
+ /**
457
+ * Resolved glyphs for the internal/external link-icon affordance
458
+ * (`SiteConfig.linkIcons`). Classification is by href shape at render
459
+ * time: external = absolute (`http(s)://`) or protocol-relative
460
+ * (`//host`); internal = root/relative. An absent side shows no icon
461
+ * for that kind.
462
+ */
463
+ export interface LinkIconsConfig {
464
+ /** Glyph appended after external links (e.g. "↗"). */
465
+ external?: string;
466
+ /** Glyph appended after internal links (e.g. "→"). */
467
+ internal?: string;
273
468
  }
274
469
  /**
275
470
  * Closed list of LLM provider deep-link targets. Each one is a
@@ -329,6 +524,27 @@ export interface TaxonomyDisplay {
329
524
  prefixes?: Record<string, TagPrefixDisplay>;
330
525
  /** Per-slug label overrides; key = full slug, value = display string. */
331
526
  labels?: Record<string, string>;
527
+ /**
528
+ * Sort weight for the facet column in the search dialog. Lower
529
+ * numbers appear first; unset facets sort alphabetically after
530
+ * any pinned ones. Use this to pin "Type" or "Audience" to the
531
+ * top of the sidebar even though they sort later by name.
532
+ */
533
+ order?: number;
534
+ /**
535
+ * Render this facet as a hierarchical tree in the search dialog
536
+ * instead of a flat checkbox list. Two render strategies depending
537
+ * on the value shape:
538
+ * - Values containing `/` are treated as slash-encoded paths
539
+ * (`concept/a11y` → `concept → a11y`). Common for tag taxonomies.
540
+ * - Values without `/` derive their tree from `nav.json` document
541
+ * order (the auto-`category` facet shape).
542
+ * Parent click auto-selects all descendant values; three-state
543
+ * checkboxes reflect partial selection. Off by default — set true
544
+ * on `category` and on slash-nested tag taxonomies.
545
+ * See plans/hierarchical-facets.md.
546
+ */
547
+ hierarchical?: boolean;
332
548
  }
333
549
  /**
334
550
  * Display config for one taxonomy prefix. Color is one of the
@@ -1 +1 @@
1
- {"version":3,"file":"format.d.ts","sourceRoot":"","sources":["../src/format.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AAC1C,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AAE1C;;;;;GAKG;AACH,MAAM,WAAW,OAAO;IACtB,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,kFAAkF;IAClF,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,UAAU;IACzB,kFAAkF;IAClF,IAAI,EAAE,MAAM,CAAC;IACb,iBAAiB;IACjB,KAAK,EAAE,MAAM,CAAC;IACd,iCAAiC;IACjC,IAAI,EAAE,QAAQ,EAAE,CAAC;IACjB,6DAA6D;IAC7D,QAAQ,EAAE,OAAO,EAAE,CAAC;IACpB,8EAA8E;IAC9E,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB;;;;;;;;;OASG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACtC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ts and the site's policy. Pure, so every surface reports
4
+ * the same findings:
5
+ *
6
+ * - `dogsbay validate` (@dogsbay/commands), which adds a one-click fix;
7
+ * - the `frontmatter/valid` rule of `@dogsbay/site-check`, run by
8
+ * `dogsbay site check` and `dogsbay-ssg check`.
9
+ */
10
+ import { type FrontmatterPolicy } from "./frontmatter-schema.js";
11
+ export interface FrontmatterFinding {
12
+ severity: "error" | "warning";
13
+ /** `frontmatter-type`, `frontmatter-required`, … (the codes `dogsbay validate` reports). */
14
+ code: string;
15
+ message: string;
16
+ /** The top-level key the finding is about, when there is one. */
17
+ key?: string;
18
+ /** 1-based line of that key, when `keyLines` has it. */
19
+ line?: number;
20
+ /** Near-miss values for a closed set. */
21
+ candidates?: string[];
22
+ /** A replacement safe to apply without asking (a case-only slip): set `key` to `value`. */
23
+ fix?: {
24
+ key: string;
25
+ value: string;
26
+ label: string;
27
+ };
28
+ }
29
+ /**
30
+ * Findings for one page. `path` is the page's source path as the policy's
31
+ * `roots` see it (the globs match its content-relative form); `keyLines`
32
+ * gives each key's line (`frontmatterKeyLines(source)`).
33
+ */
34
+ export declare function checkFrontmatter(frontmatter: Record<string, unknown> | undefined, path: string, policy: FrontmatterPolicy, keyLines?: Map<string, number>): FrontmatterFinding[];
35
+ /**
36
+ * The policy from a parsed `dogsbay.config.*` object: declared `taxonomies:`
37
+ * (their `values`/`hierarchical` ARE the check), `propSchema:`, and the
38
+ * opt-in `content.frontmatter` strictness. `roots` are the content roots
39
+ * (`content.sources[].path`). A malformed `content.frontmatter.unknown` sets
40
+ * `invalid` rather than being guessed around.
41
+ */
42
+ export declare function frontmatterPolicyFromConfig(cfg: Record<string, unknown> | null | undefined, roots: string[]): FrontmatterPolicy;
43
+ //# sourceMappingURL=frontmatter-check.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"frontmatter-check.d.ts","sourceRoot":"","sources":["../src/frontmatter-check.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,OAAO,EASL,KAAK,iBAAiB,EAEvB,MAAM,yBAAyB,CAAC;AAEjC,MAAM,WAAW,kBAAkB;IACjC,QAAQ,EAAE,OAAO,GAAG,SAAS,CAAC;IAC9B,4FAA4F;IAC5F,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,iEAAiE;IACjE,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,wDAAwD;IACxD,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,yCAAyC;IACzC,UAAU,CAAC,EAAE,MAAM,EAAE,CAAC;IACtB,2FAA2F;IAC3F,GAAG,CAAC,EAAE;QAAE,GAAG,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,CAAC;CACrD;AAED;;;;GAIG;AACH,wBAAgB,gBAAgB,CAC9B,WAAW,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,SAAS,EAChD,IAAI,EAAE,MAAM,EACZ,MAAM,EAAE,iBAAiB,EACzB,QAAQ,GAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAa,GACxC,kBAAkB,EAAE,CAsJtB;AAED;;;;;;GAMG;AACH,wBAAgB,2BAA2B,CAAC,GAAG,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI,GAAG,SAAS,EAAE,KAAK,EAAE,MAAM,EAAE,GAAG,iBAAiB,CA2C/H"}