@orkestrel/scaffold 0.0.114 → 0.0.116
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/bin/main.js +137 -15
- package/dist/bin/main.js.map +1 -1
- package/dist/host/agents/orchestration.md +5 -3
- package/dist/host/agents/platforms/windows.md +1 -0
- package/dist/host/agents/skills/orkestrel-align/references/integration.md +1 -1
- package/dist/host/agents/skills/orkestrel-debrief/SKILL.md +4 -4
- package/dist/host/agents/skills/orkestrel-dispatch/SKILL.md +4 -1
- package/dist/host/agents/skills/orkestrel-falsify/SKILL.md +8 -2
- package/dist/host/agents/skills/orkestrel-harden/references/equivalence.md +1 -0
- package/dist/host/agents/skills/orkestrel-harden/references/hardening.md +1 -1
- package/dist/host/agents/skills/orkestrel-parallel/SKILL.md +1 -1
- package/dist/host/agents/skills/orkestrel-parallel/references/codex.md +1 -0
- package/dist/host/agents/skills/orkestrel-publish/references/wave.md +9 -3
- package/dist/host/claude/agents/analyst.md +1 -1
- package/dist/host/claude/agents/astra.md +2 -2
- package/dist/host/claude/agents/builder.md +4 -4
- package/dist/host/claude/agents/opus.md +3 -3
- package/dist/host/claude/agents/orkestrel.md +5 -7
- package/dist/host/claude/agents/planner.md +8 -2
- package/dist/host/claude/rules/campaign.md +2 -1
- package/dist/host/claude/rules/documentation.md +1 -0
- package/dist/host/claude/rules/names.md +3 -1
- package/dist/host/claude/rules/tests.md +7 -4
- package/dist/host/claude/rules/writing.md +1 -0
- package/dist/host/claude/skills/enterprise-bootstrap/SKILL.md +1 -2
- package/dist/host/claude/skills/orkestrel-align/SKILL.md +1 -1
- package/dist/host/claude/skills/orkestrel-build/SKILL.md +1 -2
- package/dist/host/claude/skills/orkestrel-debrief/SKILL.md +1 -2
- package/dist/host/claude/skills/orkestrel-dispatch/SKILL.md +1 -1
- package/dist/host/claude/skills/orkestrel-falsify/SKILL.md +1 -1
- package/dist/host/claude/skills/orkestrel-harden/SKILL.md +1 -1
- package/dist/host/claude/skills/orkestrel-journey/SKILL.md +1 -1
- package/dist/host/claude/skills/orkestrel-parallel/SKILL.md +1 -1
- package/dist/host/claude/skills/orkestrel-polish/SKILL.md +1 -2
- package/dist/host/claude/skills/orkestrel-publish/SKILL.md +1 -2
- package/dist/host/claude/skills/orkestrel-scout/SKILL.md +1 -1
- package/dist/host/codex/agents/analyst.toml +8 -5
- package/dist/host/codex/agents/astra.toml +4 -5
- package/dist/host/codex/agents/builder.toml +5 -5
- package/dist/host/codex/agents/opus.toml +3 -4
- package/dist/host/codex/agents/orkestrel.toml +2 -1
- package/dist/host/codex/agents/planner.toml +8 -5
- package/dist/host/codex/agents/reviewer.toml +5 -4
- package/dist/host/guides/abort.md +17 -17
- package/dist/host/guides/agent.md +445 -445
- package/dist/host/guides/brief.md +143 -143
- package/dist/host/guides/browser.md +731 -731
- package/dist/host/guides/budget.md +39 -39
- package/dist/host/guides/capture.md +298 -298
- package/dist/host/guides/console.md +109 -109
- package/dist/host/guides/contract.md +335 -335
- package/dist/host/guides/csv.md +30 -30
- package/dist/host/guides/database.md +163 -163
- package/dist/host/guides/emitter.md +17 -17
- package/dist/host/guides/form.md +99 -99
- package/dist/host/guides/guide.md +361 -183
- package/dist/host/guides/html.md +49 -49
- package/dist/host/guides/indexeddb.md +40 -40
- package/dist/host/guides/interpret.md +139 -139
- package/dist/host/guides/lsp.md +114 -114
- package/dist/host/guides/markdown.md +68 -68
- package/dist/host/guides/mcp.md +3745 -3745
- package/dist/host/guides/middleware.md +170 -170
- package/dist/host/guides/msg.md +95 -95
- package/dist/host/guides/ndjson.md +8 -8
- package/dist/host/guides/ollama.md +56 -56
- package/dist/host/guides/pool.md +21 -21
- package/dist/host/guides/probe.md +82 -82
- package/dist/host/guides/process.md +99 -99
- package/dist/host/guides/program.md +98 -96
- package/dist/host/guides/qualifier.md +70 -70
- package/dist/host/guides/queue.md +37 -37
- package/dist/host/guides/rater.md +38 -38
- package/dist/host/guides/reason.md +308 -308
- package/dist/host/guides/relation.md +50 -50
- package/dist/host/guides/router.md +58 -58
- package/dist/host/guides/scaffold.md +554 -419
- package/dist/host/guides/sea.md +128 -128
- package/dist/host/guides/server.md +100 -100
- package/dist/host/guides/sqlite.md +28 -28
- package/dist/host/guides/sse.md +20 -20
- package/dist/host/guides/study.md +444 -444
- package/dist/host/guides/table.md +82 -82
- package/dist/host/guides/template.md +41 -41
- package/dist/host/guides/terminal.md +121 -121
- package/dist/host/guides/test.md +273 -273
- package/dist/host/guides/timeout.md +18 -18
- package/dist/host/guides/tool.md +27 -27
- package/dist/host/guides/toolbox.md +166 -166
- package/dist/host/guides/websocket.md +54 -54
- package/dist/host/guides/worker.md +24 -24
- package/dist/host/guides/workflow.md +187 -187
- package/dist/host/guides/workspace.md +55 -55
- package/dist/host/manifest.json +93 -93
- package/dist/host/tests/setupPolicy.ts +5 -3
- package/dist/src/core/index.cjs +89 -3
- package/dist/src/core/index.cjs.map +1 -1
- package/dist/src/core/index.d.cts +229 -144
- package/dist/src/core/index.d.ts +229 -144
- package/dist/src/core/index.js +87 -4
- package/dist/src/core/index.js.map +1 -1
- package/dist/src/server/index.cjs +292 -66
- package/dist/src/server/index.cjs.map +1 -1
- package/dist/src/server/index.d.cts +188 -6
- package/dist/src/server/index.d.ts +188 -6
- package/dist/src/server/index.js +287 -69
- package/dist/src/server/index.js.map +1 -1
- package/package.json +4 -3
package/dist/host/guides/html.md
CHANGED
|
@@ -15,41 +15,41 @@ That totality statement governs document parsing. `parseStartTag` is the separat
|
|
|
15
15
|
|
|
16
16
|
The full node shape and handle contract, from [`types.ts`](../src/core/types.ts). `category` is the discriminant every node carries; absence is always `undefined`, never a sentinel. A `Shape` cell holds an interface's data members as bare names in braces, `?` marking an optional member and `plus` introducing its call-signature members, and a type alias's own type literal with a union's arms escaped as `\|`. A member's type never appears in a cell, because the declaration carries it and the row's name reaches it. A generic declaration carries its parameter binding beside its literal, so a `TNode` or a `T` in a cell is that declaration's own parameter. The node categories are worked through in § [The AST model](#the-ast-model), and the option interfaces in § [The sanitize floor](#the-sanitize-floor) and § [The distill pass](#the-distill-pass).
|
|
17
17
|
|
|
18
|
-
| Name | Kind |
|
|
19
|
-
| --------------------- | --------- |
|
|
20
|
-
| `HTMLAttribute` | interface | `{ name, value? }`
|
|
21
|
-
| `HTMLAttributeValue` | type | `readonly [value: string, next: number]`
|
|
22
|
-
| `HTMLOrigin` | type | `readonly [node: HTMLNode, source: HTMLNode \| undefined]`
|
|
23
|
-
| `HTMLStartTag` | interface | `{ name, attributes, slashed, next }`
|
|
24
|
-
| `HTMLTag` | interface | `{ name, attributes, final, next }`
|
|
25
|
-
| `ElementNode` | interface | `{ category, name, attributes, children }`
|
|
26
|
-
| `TextNode` | interface | `{ category, value }`
|
|
27
|
-
| `CommentNode` | interface | `{ category, value }`
|
|
28
|
-
| `DoctypeNode` | interface | `{ category, name, public?, system? }`
|
|
29
|
-
| `HTMLDocument` | interface | `{ category, children }`
|
|
30
|
-
| `HTMLNode` | type | `HTMLDocument \| ElementNode \| TextNode \| CommentNode \| DoctypeNode`
|
|
31
|
-
| `HTMLSpan` | interface | `{ start, end }`
|
|
32
|
-
| `HTMLSource` | type | `readonly [source: string, offsets: readonly number[]]`
|
|
33
|
-
| `HTMLOpenPosition` | interface | `{ overflow, position }`
|
|
34
|
-
| `HTMLScan` | interface | `
|
|
35
|
-
| `HTMLParseResult` | type | `readonly [document: HTMLDocument, spans: ReadonlyMap<HTMLNode, HTMLSpan>]`
|
|
36
|
-
| `HTMLDerivation` | type | `
|
|
37
|
-
| `HTMLRawText` | interface | `{ node, span, next, closed }`
|
|
38
|
-
| `HTMLHandler` | type | `
|
|
39
|
-
| `HTMLHandlerMap` | interface | `
|
|
40
|
-
| `HTMLRewriteHandler` | type | `(node: HTMLNode) => HTMLNode`
|
|
41
|
-
| `HTMLPruneHandler` | type | `(node: HTMLNode) => readonly HTMLNode[]`
|
|
42
|
-
| `HTMLSanitizeOptions` | interface | `{ elements?, attributes?, schemes?, comments? }`
|
|
43
|
-
| `HTMLDistillOptions` | interface | `{ base?, elements?, boilerplate? }`
|
|
44
|
-
| `HTMLInterface` | interface | `{ document
|
|
18
|
+
| Name | Kind | Signature | Summary |
|
|
19
|
+
| --------------------- | --------- | ---------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
20
|
+
| `HTMLAttribute` | interface | `{ name, value? }` | Represents one attribute of an `ElementNode` - its `name` and, when the source wrote one, its `value`. |
|
|
21
|
+
| `HTMLAttributeValue` | type | `readonly [value: string, next: number]` | Carries one decoded attribute value and its exclusive source boundary. |
|
|
22
|
+
| `HTMLOrigin` | type | `readonly [node: HTMLNode, source: HTMLNode \| undefined]` | Carries one derived node and its recorded source identity. |
|
|
23
|
+
| `HTMLStartTag` | interface | `{ name, attributes, slashed, next }` | Represents one unambiguous start tag parsed directly from source without recovery. |
|
|
24
|
+
| `HTMLTag` | interface | `{ name, attributes, final, next }` | Represents one start or close tag returned by the total, recovering `scanTag` scanner. |
|
|
25
|
+
| `ElementNode` | interface | `{ category, name, attributes, children }` | Represents an element - `<p>`, `<table>`, `<my-widget>`, or any other tag, known or custom. |
|
|
26
|
+
| `TextNode` | interface | `{ category, value }` | Represents a run of character data - the leaf node, whose `value` is already-decoded text. |
|
|
27
|
+
| `CommentNode` | interface | `{ category, value }` | Represents a comment - `<!-- … -->` - whose `value` is verbatim inner text, never decoded and never parsed as markup. |
|
|
28
|
+
| `DoctypeNode` | interface | `{ category, name, public?, system? }` | Represents a document type declaration - `<!DOCTYPE html>` and its legacy public/system forms. |
|
|
29
|
+
| `HTMLDocument` | interface | `{ category, children }` | Represents the root of a parsed AST - the ordered children of the whole input, whether that input was a full page or one fragment. The value `HTMLInterface.document` holds. |
|
|
30
|
+
| `HTMLNode` | type | `HTMLDocument \| ElementNode \| TextNode \| CommentNode \| DoctypeNode` | Represents any node in an HTML AST - the `HTMLDocument` root or one of its descendants. The exhaustive set every guard, traversal, fold table, and renderer covers, discriminated by `category`. |
|
|
31
|
+
| `HTMLSpan` | interface | `{ start, end }` | Represents a half-open region of the original HTML input, measured in UTF-16 code units. |
|
|
32
|
+
| `HTMLSource` | type | `readonly [source: string, offsets: readonly number[]]` | Carries a normalized HTML source beside the boundary map back to its original input. |
|
|
33
|
+
| `HTMLOpenPosition` | interface | `{ overflow, position }` | Describes one open element occurrence located across the parser's represented and depth-overflow stacks. |
|
|
34
|
+
| `HTMLScan` | interface | `{ node, next }` | Describes the node and close boundary returned by a scanner that produces one leaf node. |
|
|
35
|
+
| `HTMLParseResult` | type | `readonly [ document: HTMLDocument, spans: ReadonlyMap<HTMLNode, HTMLSpan> ]` | Carries the parsed document and its original-input node regions. |
|
|
36
|
+
| `HTMLDerivation` | type | `readonly [ value: T, derivations: ReadonlyMap<HTMLNode, HTMLNode \| undefined> ]` | Carries a derived value and the source of each rebuilt node. |
|
|
37
|
+
| `HTMLRawText` | interface | `{ node, span, next, closed }` | Describes the text, source region, and close boundary returned by a raw-text scan. |
|
|
38
|
+
| `HTMLHandler` | type | `(node: TNode, children: readonly T[]) => T` | Represents a fold handler for one node category - receives the node and its children already folded to `T`, and produces the node's own `T`. The building block of an `HTMLHandlerMap` table. |
|
|
39
|
+
| `HTMLHandlerMap` | interface | `{ document, element, text, comment, doctype }` | Represents the total fold table for `HTMLInterface.fold` - one `HTMLHandler` per node category, keyed by that category. Every key is required, because a fold is total over the AST: there is no node it may skip. |
|
|
40
|
+
| `HTMLRewriteHandler` | type | `(node: HTMLNode) => HTMLNode` | Represents a copy-on-write node rewrite applied bottom-up by `HTMLInterface.map` - receives one node whose children have already been rewritten and returns its replacement: the same node unchanged, or a new one. |
|
|
41
|
+
| `HTMLPruneHandler` | type | `(node: HTMLNode) => readonly HTMLNode[]` | Represents a bottom-up pruning handler applied by `pruneDocument` - receives one node whose children have already been pruned and returns the nodes that replace it. |
|
|
42
|
+
| `HTMLSanitizeOptions` | interface | `{ elements?, attributes?, schemes?, comments? }` | Describes the options for `HTMLInterface.sanitize`. Each allowlist key replaces its default rather than extending it, so a caller who passes one narrows or redirects that one axis and leaves the others alone. |
|
|
43
|
+
| `HTMLDistillOptions` | interface | `{ base?, elements?, boilerplate? }` | Describes the options for `HTMLInterface.distill` - the content-extraction pass that reduces a page to the prose a reader (or a language model) actually wants. |
|
|
44
|
+
| `HTMLInterface` | interface | `{ document, span(), walk(), find(), filter(), map(), reduce(), fold(), stream(), sanitize(), distill() }` | Represents a parsed HTML document: the typed `HTMLDocument` AST plus the query (`walk` / `find` / `filter` / `reduce`), rewrite (`map`), fold, streaming, and document-shaping (`sanitize` / `distill`) operations over it. |
|
|
45
45
|
|
|
46
46
|
### Constants
|
|
47
47
|
|
|
48
48
|
The element vocabularies, allowlists, entity table, and depth bound every engine reads, from [`constants.ts`](../src/core/constants.ts). Every collection is a frozen array, or — for the keyed tables — a frozen record read through `Object.hasOwn`, so nothing a consumer can reach changes what an engine sees (§ [The sanitize floor](#the-sanitize-floor)). A `Shape` cell holds the constant's declared type. The depth bound's degrade behavior is § [Depth degrade semantics](#depth-degrade-semantics).
|
|
49
49
|
|
|
50
|
-
| Name | Kind |
|
|
50
|
+
| Name | Kind | Signature | Summary |
|
|
51
51
|
| ---------------------- | ----- | --------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
52
|
-
| `HTML_WHITESPACE` | const | `
|
|
52
|
+
| `HTML_WHITESPACE` | const | `" \t\n\f\r"` | Lists the code points HTML treats as syntax whitespace, `' \t\n\f\r'`. |
|
|
53
53
|
| `VOID_ELEMENTS` | const | `readonly string[]` | Lists the elements that cannot have children - a start tag is the whole element, and a close tag for one is discarded. |
|
|
54
54
|
| `RAW_ELEMENTS` | const | `readonly string[]` | Lists the elements whose content is raw text - everything up to the case-insensitive matching close tag becomes one verbatim text node, with no tag scanning and no character-reference decoding inside. |
|
|
55
55
|
| `LITERAL_ELEMENTS` | const | `readonly string[]` | Lists the elements whose content is literal text - one text node up to the matching close tag, with character references decoded but no markup parsed. |
|
|
@@ -67,7 +67,7 @@ The element vocabularies, allowlists, entity table, and depth bound every engine
|
|
|
67
67
|
| `BOILERPLATE_ELEMENTS` | const | `readonly string[]` | Lists the default regions `distill` removes whole - the navigation, banner, and margin furniture that surrounds an article rather than belonging to it. |
|
|
68
68
|
| `REGION_ELEMENTS` | const | `readonly string[]` | Lists the content regions `distill` tries in priority order when re-rooting a document. A region qualifies only when it occurs exactly once. |
|
|
69
69
|
| `NAMED_ENTITIES` | const | `Readonly<Record<string, string>>` | Holds the semicolon-terminated named character references from the WHATWG HTML set, keyed by name without the leading `&` or trailing `;`. |
|
|
70
|
-
| `MAX_DEPTH` | const | `
|
|
70
|
+
| `MAX_DEPTH` | const | `64` | Names the recursion depth the parser, the guards, the traversals, the renderers, and the sanitize and distill engines honor before they stop descending, `64`. |
|
|
71
71
|
|
|
72
72
|
### Validators
|
|
73
73
|
|
|
@@ -75,16 +75,16 @@ The from-unknown guards, from [`validators.ts`](../src/core/validators.ts). A gu
|
|
|
75
75
|
|
|
76
76
|
In a guard table a `Shape` cell holds the type the guard narrows to.
|
|
77
77
|
|
|
78
|
-
| Name | Kind |
|
|
79
|
-
| ----------------- | -------- |
|
|
80
|
-
| `isHTMLAttribute` | const | `HTMLAttribute
|
|
81
|
-
| `isHTMLCodePoint` | function | `number`
|
|
82
|
-
| `isTextNode` | const | `TextNode
|
|
83
|
-
| `isCommentNode` | const | `CommentNode
|
|
84
|
-
| `isDoctypeNode` | const | `DoctypeNode
|
|
85
|
-
| `isHTMLNode` | function | `HTMLNode`
|
|
86
|
-
| `isHTMLDocument` | function | `HTMLDocument`
|
|
87
|
-
| `isElementNode` | function | `ElementNode`
|
|
78
|
+
| Name | Kind | Signature | Summary |
|
|
79
|
+
| ----------------- | -------- | ------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
80
|
+
| `isHTMLAttribute` | const | `Guard<HTMLAttribute>` | Determines whether an arbitrary value is a structurally valid HTML attribute - exactly a string name, optionally a string value, and nothing else. |
|
|
81
|
+
| `isHTMLCodePoint` | function | `(value: unknown) => value is number` | Determines whether a code point may appear in an unambiguous HTML source token. |
|
|
82
|
+
| `isTextNode` | const | `Guard<TextNode>` | Determines whether an arbitrary value is a structurally valid text node - a closed `{ category: 'text', value: string }` record. |
|
|
83
|
+
| `isCommentNode` | const | `Guard<CommentNode>` | Determines whether an arbitrary value is a structurally valid comment node - a closed `{ category: 'comment', value: string }` record. |
|
|
84
|
+
| `isDoctypeNode` | const | `Guard<DoctypeNode>` | Determines whether an arbitrary value is a structurally valid doctype node - a declared name plus optional public and system identifiers, closed. |
|
|
85
|
+
| `isHTMLNode` | function | `(value: unknown) => value is HTMLNode` | Determines whether an arbitrary value is a valid HTML node - the value and every descendant, walked iteratively, cycle-checked, capped at `MAX_DEPTH`, and held to the void-element empty-children invariant. |
|
|
86
|
+
| `isHTMLDocument` | function | `(value: unknown) => value is HTMLDocument` | Determines whether an arbitrary value is a valid HTML document - the whole-node check narrowed to the root category, and the gate to run before adopting an untrusted document. |
|
|
87
|
+
| `isElementNode` | function | `(value: unknown) => value is ElementNode` | Determines whether an arbitrary value is a valid element node - the whole-node check narrowed to an element, and the natural predicate to pass to `find` or `filter`. |
|
|
88
88
|
|
|
89
89
|
### Parsers
|
|
90
90
|
|
|
@@ -165,12 +165,12 @@ Declarative `ContractShape` values (from `@orkestrel/contract`) in [`shapers.ts`
|
|
|
165
165
|
|
|
166
166
|
A `Shape` cell holds the constant's declared type.
|
|
167
167
|
|
|
168
|
-
| Name | Kind |
|
|
169
|
-
| ---------------- | ----- |
|
|
170
|
-
| `attributeShape` | const | `ObjectShape<{ name
|
|
171
|
-
| `textShape` | const | `ObjectShape<{ category
|
|
172
|
-
| `commentShape` | const | `ObjectShape<{ category
|
|
173
|
-
| `doctypeShape` | const | `ObjectShape<{ category
|
|
168
|
+
| Name | Kind | Signature | Summary |
|
|
169
|
+
| ---------------- | ----- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
170
|
+
| `attributeShape` | const | `import("@orkestrel/contract").ObjectShape<{ name: import("@orkestrel/contract").StringShape; value: import("@orkestrel/contract").OptionalShape<import("@orkestrel/contract").StringShape>; }, false>` | Describes the shape of an `HTMLAttribute` - an element attribute's name and, when the source wrote one, its value. `value` is optional: its absence is what distinguishes `<input disabled>` from `<input disabled="">`. |
|
|
171
|
+
| `textShape` | const | `import("@orkestrel/contract").ObjectShape<{ category: import("@orkestrel/contract").LiteralShape<readonly ["text"]>; value: import("@orkestrel/contract").StringShape; }, false>` | Describes the shape of a `TextNode` - the decoded character-data leaf. |
|
|
172
|
+
| `commentShape` | const | `import("@orkestrel/contract").ObjectShape<{ category: import("@orkestrel/contract").LiteralShape<readonly ["comment"]>; value: import("@orkestrel/contract").StringShape; }, false>` | Describes the shape of a `CommentNode` - the verbatim, never-decoded comment leaf a bogus comment also recovers to. |
|
|
173
|
+
| `doctypeShape` | const | `import("@orkestrel/contract").ObjectShape<{ category: import("@orkestrel/contract").LiteralShape<readonly ["doctype"]>; name: import("@orkestrel/contract").StringShape; public: import("@orkestrel/contract").OptionalShape<import("@orkestrel/contract").StringShape>; system: import("@orkestrel/contract").OptionalShape<import("@orkestrel/contract").StringShape>; }, false>` | Describes the shape of a `DoctypeNode` - the declared root name plus the optional public and system identifiers of a legacy declaration. |
|
|
174
174
|
|
|
175
175
|
### Factories
|
|
176
176
|
|
|
@@ -185,9 +185,9 @@ From [`factories.ts`](../src/core/factories.ts).
|
|
|
185
185
|
The implementing class, from [`HTML.ts`](../src/core/HTML.ts) — documented in full under its own
|
|
186
186
|
heading following this table.
|
|
187
187
|
|
|
188
|
-
| Name | Kind | Summary |
|
|
189
|
-
| ------ | ----- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
190
|
-
| `HTML` | class | Represents a parsed document - the typed `HTMLDocument` AST plus the query (`walk` / `find` / `filter` / `reduce`), rewrite (`map`), fold, streaming, and document-shaping (`sanitize` / `distill`) operations `HTMLInterface` declares. |
|
|
188
|
+
| Name | Kind | Signature | Summary |
|
|
189
|
+
| ------ | ----- | ------------------------------------------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
190
|
+
| `HTML` | class | `new (input: string \| HTMLDocument) => HTMLInterface` | Represents a parsed document - the typed `HTMLDocument` AST plus the query (`walk` / `find` / `filter` / `reduce`), rewrite (`map`), fold, streaming, and document-shaping (`sanitize` / `distill`) operations `HTMLInterface` declares. |
|
|
191
191
|
|
|
192
192
|
### `HTML`
|
|
193
193
|
|
|
@@ -38,20 +38,20 @@ await users.index('byAge').records(rangeFromKey(18)) // adults, index-backed (O(
|
|
|
38
38
|
|
|
39
39
|
### Database and factory
|
|
40
40
|
|
|
41
|
-
|
|
|
42
|
-
| ------------------------- | -------- | ------------------------------------------------------------------------------- |
|
|
43
|
-
| `createIndexedDBDatabase` | function | Creates a typed, lazily-connecting IndexedDB database over a store schema. |
|
|
44
|
-
| `IndexedDBDatabase` | class | Represents a browser-native IndexedDB database — a typed, Promise-based handle. |
|
|
41
|
+
| Name | Kind | Signature | Summary |
|
|
42
|
+
| ------------------------- | -------- | ----------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------- |
|
|
43
|
+
| `createIndexedDBDatabase` | function | `<const Stores extends IndexedDBSchema>(options: IndexedDBDatabaseOptions<Stores>) => IndexedDBDatabaseInterface<Stores>` | Creates a typed, lazily-connecting IndexedDB database over a store schema. |
|
|
44
|
+
| `IndexedDBDatabase` | class | `new <Stores extends IndexedDBSchema = IndexedDBSchema>(options: IndexedDBDatabaseOptions<Stores>) => IndexedDBDatabaseInterface<Stores>` | Represents a browser-native IndexedDB database — a typed, Promise-based handle. |
|
|
45
45
|
|
|
46
46
|
### Stores, indexes, cursors, transactions
|
|
47
47
|
|
|
48
|
-
|
|
|
49
|
-
| --------------------------- | ----- | ------------------------------------------------------------------------------------------------ |
|
|
50
|
-
| `IndexedDBStore` | class | Represents an object store — the full keyed CRUD surface plus index, count, and cursor access. |
|
|
51
|
-
| `IndexedDBIndex` | class | Represents a secondary index on a store — a read-only view keyed by an indexed path. |
|
|
52
|
-
| `IndexedDBCursor` | class | Represents a promisified value cursor over an object store or index. |
|
|
53
|
-
| `IndexedDBTransaction` | class | Represents an explicit transaction over one or more stores, with typed scope-bound store access. |
|
|
54
|
-
| `IndexedDBTransactionStore` | class | Represents an object store bound to an explicit transaction, with no implicit per-call commit. |
|
|
48
|
+
| Name | Kind | Signature | Summary |
|
|
49
|
+
| --------------------------- | ----- | -------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------ |
|
|
50
|
+
| `IndexedDBStore` | class | `new (name: string, definition: StoreDefinition, connect: () => Promise<IDBDatabase>) => IndexedDBStoreInterface` | Represents an object store — the full keyed CRUD surface plus index, count, and cursor access. |
|
|
51
|
+
| `IndexedDBIndex` | class | `new (store: string, name: string, definition: IndexDefinition, connect: () => Promise<IDBDatabase>) => IndexedDBIndexInterface` | Represents a secondary index on a store — a read-only view keyed by an indexed path. |
|
|
52
|
+
| `IndexedDBCursor` | class | `new (cursor: IDBCursorWithValue, request: IDBRequest<IDBCursorWithValue \| null>) => IndexedDBCursorInterface` | Represents a promisified value cursor over an object store or index. |
|
|
53
|
+
| `IndexedDBTransaction` | class | `new <Stores extends IndexedDBSchema = IndexedDBSchema>(transaction: IDBTransaction) => IndexedDBTransactionInterface<Stores>` | Represents an explicit transaction over one or more stores, with typed scope-bound store access. |
|
|
54
|
+
| `IndexedDBTransactionStore` | class | `new (store: IDBObjectStore) => IndexedDBTransactionStoreInterface` | Represents an object store bound to an explicit transaction, with no implicit per-call commit. |
|
|
55
55
|
|
|
56
56
|
### Helpers and errors
|
|
57
57
|
|
|
@@ -59,24 +59,24 @@ await users.index('byAge').records(rangeFromKey(18)) // adults, index-backed (O(
|
|
|
59
59
|
context across package copies. Subclass instances pass without an exact name;
|
|
60
60
|
transparent proxies, unbranded look-alikes, and plain branded objects fail.
|
|
61
61
|
|
|
62
|
-
|
|
|
63
|
-
| ---------------------- | -------- | ------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
64
|
-
| `supportsIndexedDB` | function | Checks whether IndexedDB is available in this environment. |
|
|
65
|
-
| `promisifyRequest` | function | Resolves an `IDBRequest` to its result, rejecting with an `IndexedDBError`. |
|
|
66
|
-
| `promisifyTransaction` | function | Resolves after an `IDBTransaction` commits, rejecting if it errors or aborts. |
|
|
67
|
-
| `readRecord` | function | Reads one record by key from a store or index, narrowing it to a `Row`. |
|
|
68
|
-
| `readRecords` | function | Reads many records from a store or index over an optional key range, narrowing each to a `Row`. |
|
|
69
|
-
| `hasKey` | function | Checks whether a key is present in a store or index. |
|
|
70
|
-
| `createIndex` | function | Creates a secondary index on a store from its `IndexDefinition`. |
|
|
71
|
-
| `wrapCall` | function | Runs a synchronous native IndexedDB call, wrapping a thrown `DOMException` into a typed `IndexedDBError`. |
|
|
72
|
-
| `rangeAboveKey` | function | Builds a key range strictly above one key. |
|
|
73
|
-
| `rangeFromKey` | function | Builds a key range starting at and including one key. |
|
|
74
|
-
| `rangeBelowKey` | function | Builds a key range strictly below one key. |
|
|
75
|
-
| `rangeToKey` | function | Builds a key range ending at and including one key. |
|
|
76
|
-
| `rangePrefix` | function | Builds a key range containing every string with one prefix. |
|
|
77
|
-
| `wrapError` | function | Maps a native IndexedDB `DOMException` to a typed `IndexedDBError`. |
|
|
78
|
-
| `IndexedDBError` | class | Represents an error thrown by the IndexedDB wrapper, carrying a machine-readable `code` and an optional `context` beside the native cause. |
|
|
79
|
-
| `isIndexedDBError` | function | Checks whether a value is an `IndexedDBError`. |
|
|
62
|
+
| Name | Kind | Signature | Summary |
|
|
63
|
+
| ---------------------- | -------- | --------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
64
|
+
| `supportsIndexedDB` | function | `() => boolean` | Checks whether IndexedDB is available in this environment. |
|
|
65
|
+
| `promisifyRequest` | function | `<T>(request: IDBRequest<T>) => Promise<T>` | Resolves an `IDBRequest` to its result, rejecting with an `IndexedDBError`. |
|
|
66
|
+
| `promisifyTransaction` | function | `(transaction: IDBTransaction) => Promise<void>` | Resolves after an `IDBTransaction` commits, rejecting if it errors or aborts. |
|
|
67
|
+
| `readRecord` | function | `(source: IDBObjectStore \| IDBIndex, key: IDBValidKey) => Promise<Row \| undefined>` | Reads one record by key from a store or index, narrowing it to a `Row`. |
|
|
68
|
+
| `readRecords` | function | `(source: IDBObjectStore \| IDBIndex, query?: IDBKeyRange \| IDBValidKey, count?: number) => Promise<readonly Row[]>` | Reads many records from a store or index over an optional key range, narrowing each to a `Row`. |
|
|
69
|
+
| `hasKey` | function | `(source: IDBObjectStore \| IDBIndex, key: IDBValidKey) => Promise<boolean>` | Checks whether a key is present in a store or index. |
|
|
70
|
+
| `createIndex` | function | `(store: IDBObjectStore, definition: IndexDefinition) => void` | Creates a secondary index on a store from its `IndexDefinition`. |
|
|
71
|
+
| `wrapCall` | function | `<T>(action: () => T) => T` | Runs a synchronous native IndexedDB call, wrapping a thrown `DOMException` into a typed `IndexedDBError`. |
|
|
72
|
+
| `rangeAboveKey` | function | `(value: IDBValidKey) => IDBKeyRange` | Builds a key range strictly above one key. |
|
|
73
|
+
| `rangeFromKey` | function | `(value: IDBValidKey) => IDBKeyRange` | Builds a key range starting at and including one key. |
|
|
74
|
+
| `rangeBelowKey` | function | `(value: IDBValidKey) => IDBKeyRange` | Builds a key range strictly below one key. |
|
|
75
|
+
| `rangeToKey` | function | `(value: IDBValidKey) => IDBKeyRange` | Builds a key range ending at and including one key. |
|
|
76
|
+
| `rangePrefix` | function | `(value: string) => IDBKeyRange` | Builds a key range containing every string with one prefix. |
|
|
77
|
+
| `wrapError` | function | `(error: DOMException \| null) => IndexedDBError` | Maps a native IndexedDB `DOMException` to a typed `IndexedDBError`. |
|
|
78
|
+
| `IndexedDBError` | class | `new (code: IndexedDBErrorCode, message: string, cause?: unknown, context?: Readonly<Record<string, unknown>>) => IndexedDBError` | Represents an error thrown by the IndexedDB wrapper, carrying a machine-readable `code` and an optional `context` beside the native cause. |
|
|
79
|
+
| `isIndexedDBError` | function | `(value: unknown) => value is IndexedDBError` | Checks whether a value is an `IndexedDBError`. |
|
|
80
80
|
|
|
81
81
|
`supportsIndexedDB` reads `globalThis.indexedDB`, and `hasKey` is a native `count` greater than 0. `createIndex` is the shared index-DDL leaf both the built-in schema pass and `context.indexes.create` run. `wrapError` is the request boundary every bridge maps a native `DOMException` through.
|
|
82
82
|
|
|
@@ -84,7 +84,7 @@ transparent proxies, unbranded look-alikes, and plain branded objects fail.
|
|
|
84
84
|
|
|
85
85
|
A `Shape` cell holds the constant's declared type.
|
|
86
86
|
|
|
87
|
-
|
|
|
87
|
+
| Name | Kind | Signature | Summary |
|
|
88
88
|
| ------------- | ----- | ---------------------------------------------- | --------------------------------------------------------------------- |
|
|
89
89
|
| `ERROR_CODES` | const | `Readonly<Record<string, IndexedDBErrorCode>>` | Maps native `DOMException.name` → the wrapper's `IndexedDBErrorCode`. |
|
|
90
90
|
|
|
@@ -94,7 +94,7 @@ A `Shape` cell holds the constant's declared type.
|
|
|
94
94
|
|
|
95
95
|
A `Shape` cell holds an interface's data members as bare names in braces, `?` marking an optional member and `plus` introducing its call-signature members, and a type alias's own type literal with a union's arms escaped as `\|`. An extended interface's name comes before `plus`, with the members it adds after.
|
|
96
96
|
|
|
97
|
-
|
|
|
97
|
+
| Name | Kind | Signature | Summary |
|
|
98
98
|
| --------------------------------------- | --------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------- |
|
|
99
99
|
| `Row` | type | `Record<string, unknown>` | Represents a record stored in, and read from, an object store. |
|
|
100
100
|
| `KeyPath` | type | `string \| readonly string[]` | Represents a key path — one field, or several for a compound key. |
|
|
@@ -102,18 +102,18 @@ A `Shape` cell holds an interface's data members as bare names in braces, `?` ma
|
|
|
102
102
|
| `StoreDefinition` | interface | `{ path?, increment?, indexes? }` | Represents the declaration of one object store — its key path, key generation, and secondary indexes. |
|
|
103
103
|
| `IndexedDBSchema` | type | `Readonly<Record<string, StoreDefinition>>` | Represents a database's schema — a map of store name to its `StoreDefinition`. |
|
|
104
104
|
| `IndexedDBUpgradeContext` | interface | `{ transaction, old, version, stores, indexes }` | Represents the escape hatch into a version-change upgrade, passed to `IndexedDBDatabaseOptions.upgrade`. |
|
|
105
|
-
| `IndexedDBUpgradeStoreManagerInterface` | interface | `{ names
|
|
106
|
-
| `IndexedDBUpgradeIndexManagerInterface` | interface | `{
|
|
105
|
+
| `IndexedDBUpgradeStoreManagerInterface` | interface | `{ names, create(), drop(), store() }` | Represents the store manager of a version-change upgrade. |
|
|
106
|
+
| `IndexedDBUpgradeIndexManagerInterface` | interface | `{ create(), drop() }` | Represents the secondary-index manager of a version-change upgrade. |
|
|
107
107
|
| `IndexedDBDatabaseOptions` | interface | `{ name, version?, stores, upgrade? }` | Represents the options for `createIndexedDBDatabase`. |
|
|
108
108
|
| `IndexedDBCursorOptions` | interface | `{ query?, direction? }` | Represents the options for opening a cursor. |
|
|
109
109
|
| `IndexedDBErrorCode` | type | `'NOT_OPEN' \| 'CLOSED' \| 'NOT_FOUND' \| 'CONSTRAINT' \| 'QUOTA' \| 'ABORTED' \| 'DATA' \| 'OPEN' \| 'UPGRADE' \| 'INACTIVE' \| 'READONLY' \| 'INVALID' \| 'UNKNOWN'` | Represents a machine-readable `IndexedDBError` code. |
|
|
110
|
-
| `IndexedDBDatabaseInterface` | interface | `{ database, name, version, stores, open
|
|
111
|
-
| `IndexedDBRecordStoreInterface` | interface | `{
|
|
112
|
-
| `IndexedDBStoreInterface` | interface | `
|
|
113
|
-
| `IndexedDBIndexInterface` | interface | `{ name, path, unique, multiple
|
|
114
|
-
| `IndexedDBCursorInterface` | interface | `{ cursor, source, key, primary, value, direction
|
|
115
|
-
| `IndexedDBTransactionInterface` | interface | `{ transaction, mode, stores, active, finished, error
|
|
116
|
-
| `IndexedDBTransactionStoreInterface` | interface | `
|
|
110
|
+
| `IndexedDBDatabaseInterface` | interface | `{ database, name, version, stores, open, connect(), store(), read(), write(), close(), drop() }` | Represents the contract of a typed, lazily-connecting IndexedDB database. |
|
|
111
|
+
| `IndexedDBRecordStoreInterface` | interface | `{ get(), resolve(), records(), keys(), has(), count(), set(), add(), remove(), clear(), cursor() }` | Represents the contract the object-store surfaces share — the keyed record verbs, in or out of an explicit transaction. |
|
|
112
|
+
| `IndexedDBStoreInterface` | interface | `{ name, path, indexes, increment, index() }` | Represents the contract of an object store — the keyed record surface plus the store's own schema metadata and `index` accessor. |
|
|
113
|
+
| `IndexedDBIndexInterface` | interface | `{ name, path, unique, multiple, get(), resolve(), records(), keys(), primary(), has(), count(), cursor() }` | Represents the contract of a secondary index — read access by an indexed key path. |
|
|
114
|
+
| `IndexedDBCursorInterface` | interface | `{ cursor, source, key, primary, value, direction, continue(), seek(), advance(), update(), remove() }` | Represents the contract of a promisified value cursor for streaming and in-place mutation. |
|
|
115
|
+
| `IndexedDBTransactionInterface` | interface | `{ transaction, mode, stores, active, finished, error, store(), abort(), commit() }` | Represents the contract of an explicit transaction over one or more stores. |
|
|
116
|
+
| `IndexedDBTransactionStoreInterface` | interface | `{ store }` | Represents the contract of an object store bound to an explicit transaction. |
|
|
117
117
|
|
|
118
118
|
Values are this package's own `Row` (a record), narrowed from IndexedDB's structured clone with `isRecord` (from `@orkestrel/contract`) at the read boundary — an `as`-free bridge. Keys are the full native `IDBValidKey`, so the wrapper speaks IndexedDB's whole key space.
|
|
119
119
|
|