@orkestrel/scaffold 0.0.119 → 0.0.120

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (49) hide show
  1. package/dist/bin/main.js +15 -15
  2. package/dist/bin/main.js.map +1 -1
  3. package/dist/host/agents/skills/orkestrel-journey/references/layer.md +10 -10
  4. package/dist/host/agents/skills/orkestrel-journey/references/statechart.md +1 -1
  5. package/dist/host/agents/skills/orkestrel-journey/references/styles.md +3 -3
  6. package/dist/host/claude/agents/orkestrel.md +27 -26
  7. package/dist/host/claude/rules/tests.md +2 -2
  8. package/dist/host/claude/rules/typescript.md +2 -3
  9. package/dist/host/guides/abort.md +0 -4
  10. package/dist/host/guides/budget.md +1 -5
  11. package/dist/host/guides/codec.md +18 -3
  12. package/dist/host/guides/contract.md +23 -44
  13. package/dist/host/guides/csv.md +86 -93
  14. package/dist/host/guides/database.md +0 -4
  15. package/dist/host/guides/emitter.md +0 -2
  16. package/dist/host/guides/form.md +26 -47
  17. package/dist/host/guides/html.md +3 -7
  18. package/dist/host/guides/indexeddb.md +28 -32
  19. package/dist/host/guides/jsonrpc.md +187 -0
  20. package/dist/host/guides/markdown.md +132 -141
  21. package/dist/host/guides/msg.md +47 -63
  22. package/dist/host/guides/ndjson.md +0 -4
  23. package/dist/host/guides/pool.md +0 -4
  24. package/dist/host/guides/process.md +71 -79
  25. package/dist/host/guides/reason.md +30 -36
  26. package/dist/host/guides/router.md +11 -18
  27. package/dist/host/guides/scaffold.md +136 -136
  28. package/dist/host/guides/sqlite.md +0 -4
  29. package/dist/host/guides/sse.md +6 -10
  30. package/dist/host/guides/table.md +481 -493
  31. package/dist/host/guides/template.md +0 -4
  32. package/dist/host/guides/test.md +46 -66
  33. package/dist/host/guides/timeout.md +0 -6
  34. package/dist/host/guides/tool.md +2 -6
  35. package/dist/host/guides/websocket.md +0 -4
  36. package/dist/host/manifest.json +39 -464
  37. package/dist/src/core/index.cjs +162 -177
  38. package/dist/src/core/index.cjs.map +1 -1
  39. package/dist/src/core/index.d.cts +213 -213
  40. package/dist/src/core/index.d.ts +213 -213
  41. package/dist/src/core/index.js +151 -166
  42. package/dist/src/core/index.js.map +1 -1
  43. package/dist/src/server/index.cjs +25 -25
  44. package/dist/src/server/index.cjs.map +1 -1
  45. package/dist/src/server/index.d.cts +50 -50
  46. package/dist/src/server/index.d.ts +50 -50
  47. package/dist/src/server/index.js +26 -26
  48. package/dist/src/server/index.js.map +1 -1
  49. package/package.json +9 -9
@@ -34,6 +34,7 @@ import {
34
34
  isRendered,
35
35
  mount,
36
36
  pressKeys,
37
+ readControlValue,
37
38
  readFocus,
38
39
  readHit,
39
40
  readName,
@@ -43,7 +44,6 @@ import {
43
44
  readRole,
44
45
  readStates,
45
46
  readText,
46
- readValue,
47
47
  removeDatabase,
48
48
  render,
49
49
  resolveAccessible,
@@ -109,12 +109,12 @@ A journey verb resolves its own target from role and accessible name, and refuse
109
109
  component instance, or a selector from the caller. A reader, a fixture builder, and a capture each
110
110
  take one, because their subject is a node the caller already holds.
111
111
 
112
- | Population | Takes an element |
113
- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------- |
114
- | `resolveAccessible`, `resolveRendered`, `clickAccessible`, `clickAccessibleWithin`, `clickDisclosure`, `typeAccessible`, `fillAccessible`, `traverseAccessible`, `pressKeys`, `waitForState`, `readRefusal`, `readPerception`, `readPage`, `readFocus`, `readValue` | No |
115
- | `readText`, `readRole`, `readName`, `readStates`, `describeTree`, `describeFocus`, `isReachable`, `isRendered`, `readHit`, `waitForAnimations` | Yes |
116
- | `readContrast`, `readRing`, `readLayers`, `readBackdrop`, `readStyle`, `readToken`, `readPixels`, `readClasses`, `readCensus`, `extractStyles`, `extractOrphans`, `readRows` | Yes |
117
- | `mount`, `typeInput`, `commitInput`, `captureFrame`, and a portfolio's `place` | Yes |
112
+ | Population | Takes an element |
113
+ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------- |
114
+ | `resolveAccessible`, `resolveRendered`, `clickAccessible`, `clickAccessibleWithin`, `clickDisclosure`, `typeAccessible`, `fillAccessible`, `traverseAccessible`, `pressKeys`, `waitForState`, `readRefusal`, `readPerception`, `readPage`, `readFocus`, `readControlValue` | No |
115
+ | `readText`, `readRole`, `readName`, `readStates`, `describeTree`, `describeFocus`, `isReachable`, `isRendered`, `readHit`, `waitForAnimations` | Yes |
116
+ | `readContrast`, `readRing`, `readLayers`, `readBackdrop`, `readStyle`, `readToken`, `readPixels`, `readClasses`, `readCensus`, `extractStyles`, `extractOrphans`, `readRows` | Yes |
117
+ | `mount`, `typeInput`, `commitInput`, `captureFrame`, and a portfolio's `place` | Yes |
118
118
 
119
119
  - Never pass an element to a verb from a journey step. Read a step that would pass one as a missing
120
120
  verb, and add the verb instead.
@@ -169,7 +169,7 @@ the capture voices in [captures.md](captures.md), and every other voice in `guid
169
169
  | Forward Tab never lands on the target | `Interactive target "<name>" is not reachable through forward Tab traversal: <trail>` | `traverseAccessible` |
170
170
  | The named region is hidden | `Named region "<name>" is not visible` | `readPerception` |
171
171
  | Several named regions carry the name | `Named region "<name>" is ambiguous across <n> elements` | `readPerception` |
172
- | The resolved control renders no value | `Interactive target "<name>" does not carry a value` | `readValue` |
172
+ | The resolved control renders no value | `Interactive target "<name>" does not carry a value` | `readControlValue` |
173
173
  | A key sequence reached nothing | `Key sequence "<keys>" was sent with nothing focused` | `pressKeys` |
174
174
  | A host withholds `getItem`, `setItem`, or `removeItem` | `Access is denied for <operation> "<key>"` | `createStorage` |
175
175
  | A host withholds `length`, `clear`, or `key` | `Access is denied for <operation>` | `createStorage` |
@@ -281,7 +281,7 @@ beside each.
281
281
  | `document.elementFromPoint` | `readHit` |
282
282
  | `element.focus()` | `traverseAccessible`, `pressKeys` |
283
283
  | A navigation a journey step performs by a router call | The visible link or control that navigates, through `clickAccessible` or `clickAccessibleWithin` |
284
- | A store or route state read standing in for a rendered assertion | `readPerception`, `readValue`, `readStates`, `waitForText` |
284
+ | A store or route state read standing in for a rendered assertion | `readPerception`, `readControlValue`, `readStates`, `waitForText` |
285
285
 
286
286
  - Admit a selector only for a population that carries no role, declared in the workspace's browser
287
287
  test setup module with the reason beside it.
@@ -318,7 +318,7 @@ dialog, table, tab panel, alert, or status. Quote that text in assertions.
318
318
  the layout hides. Descendant visually-hidden text stays in, which is what a screen reader
319
319
  perceives.
320
320
  - Reach for `readPage` for a cross-region sentence and the vocabulary sweep, `readFocus` for the
321
- active element's rendered text, and `readValue` for a resolved control's rendered value. A
321
+ active element's rendered text, and `readControlValue` for a resolved control's rendered value. A
322
322
  perception assertion may quote that value: it is a rendered fact rather than internal state.
323
323
  - Reach for `describeTree` and `describeFocus` where the subject is the accessible tree itself —
324
324
  roles, names, states, and focus order. They are the accessibility snapshot a written artifact
@@ -174,7 +174,7 @@ it('walks the disclosure statechart', async () => {
174
174
  `buildRefusal(name, cause)` from `@orkestrel/test` builds that same error, so an assertion on
175
175
  a refused build compares against what it returns rather than against a spelled string.
176
176
  - Never assert the entity's internal state in `assert` where the transition is one a person drives.
177
- Assert what the interface renders, through `readPerception`, `readValue`, or `readStates`.
177
+ Assert what the interface renders, through `readPerception`, `readControlValue`, or `readStates`.
178
178
 
179
179
  ## Drive the act the way the transition happens
180
180
 
@@ -12,9 +12,9 @@ import type {
12
12
  CaptureVariant,
13
13
  CensusFixture,
14
14
  CensusResult,
15
- Color,
16
15
  ContrastFixture,
17
16
  EscapeFixture,
17
+ RGBA,
18
18
  } from '@orkestrel/test/browser'
19
19
  import {
20
20
  CANVAS_COLOR,
@@ -25,7 +25,7 @@ import {
25
25
  extractOrphans,
26
26
  extractStyles,
27
27
  findKeyframes,
28
- findRule,
28
+ findStyleRule,
29
29
  matchesColor,
30
30
  measureContrast,
31
31
  measureLuminance,
@@ -57,7 +57,7 @@ import { inject } from 'vitest'
57
57
  - Read `readPixels` as a measured contribution rather than a parsed length. A resolved value
58
58
  carrying no leading number reads as `0`, so read the text with `readStyle` where an unparsable
59
59
  value and a genuine zero are different findings.
60
- - Never substitute `findRule` for a resolved read. It proves a declaration exists, and another rule
60
+ - Never substitute `findStyleRule` for a resolved read. It proves a declaration exists, and another rule
61
61
  may still win; reach for it where the stylesheet itself is the subject, and for `findKeyframes`
62
62
  where the animation's declaration is.
63
63
  - Compare a color through `matchesColor` or `parseCSSColor` rather than by string. A browser normalizes a color
@@ -43,54 +43,55 @@ Treat generated package identifiers, versions, layers, and dependency ranges as
43
43
 
44
44
  | Package | Version | Layer | Runtime dependencies | Peer dependencies |
45
45
  | ----------------------- | --------- | ----- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------- |
46
- | `@orkestrel/abort` | `0.0.14` | L1 | `@orkestrel/contract` `^0.0.20` | |
46
+ | `@orkestrel/abort` | `0.0.15` | L1 | `@orkestrel/contract` `^0.0.21` | |
47
47
  | `@orkestrel/agent` | `0.0.33` | L5 | `@orkestrel/tool` `^0.0.20`, `@orkestrel/abort` `^0.0.14`, `@orkestrel/queue` `^0.0.18`, `@orkestrel/budget` `^0.0.15`, `@orkestrel/emitter` `^0.0.13`, `@orkestrel/timeout` `^0.0.14`, `@orkestrel/contract` `^0.0.20`, `@orkestrel/database` `^0.0.19`, `@orkestrel/workflow` `^0.0.24`, `@orkestrel/workspace` `^0.0.13` | |
48
48
  | `@orkestrel/brief` | `0.0.13` | L4 | `@orkestrel/reason` `^0.0.15`, `@orkestrel/emitter` `^0.0.13`, `@orkestrel/contract` `^0.0.20`, `@orkestrel/interpret` `^0.0.18` | |
49
49
  | `@orkestrel/browser` | `0.0.30` | L5 | `@orkestrel/mcp` `^0.0.40`, `@orkestrel/html` `^0.0.13`, `@orkestrel/pool` `^0.0.18`, `@orkestrel/tool` `^0.0.20`, `@orkestrel/codec` `^0.0.7`, `@orkestrel/router` `^0.0.18`, `@orkestrel/server` `^0.0.24`, `@orkestrel/emitter` `^0.0.13`, `@orkestrel/process` `^0.0.16`, `@orkestrel/contract` `^0.0.20`, `@orkestrel/markdown` `^0.0.18`, `@orkestrel/websocket` `^0.0.16` | |
50
- | `@orkestrel/budget` | `0.0.15` | L1 | `@orkestrel/contract` `^0.0.20` | |
50
+ | `@orkestrel/budget` | `0.0.16` | L1 | `@orkestrel/contract` `^0.0.21` | |
51
51
  | `@orkestrel/capture` | `0.0.2` | L3 | `@orkestrel/process` `^0.0.16`, `@orkestrel/timeout` `^0.0.14`, `@orkestrel/contract` `^0.0.20` | `vite` `^8.3.5`, `vitest` `^4.1.12 \|\| ^5.0.5`, `playwright` `^1.61.0`, `@vitest/browser-playwright` `^4.1.12 \|\| ^5.0.5` |
52
- | `@orkestrel/codec` | `0.0.7` | L1 | `@orkestrel/contract` `^0.0.20` | |
52
+ | `@orkestrel/codec` | `0.0.8` | L1 | `@orkestrel/contract` `^0.0.21` | |
53
53
  | `@orkestrel/console` | `0.0.17` | L2 | `@orkestrel/emitter` `^0.0.13`, `@orkestrel/contract` `^0.0.20` | |
54
- | `@orkestrel/contract` | `0.0.20` | L0 | | |
55
- | `@orkestrel/csv` | `0.0.11` | L1 | `@orkestrel/contract` `^0.0.20` | |
56
- | `@orkestrel/database` | `0.0.19` | L2 | `@orkestrel/sqlite` `^0.0.15`, `@orkestrel/emitter` `^0.0.13`, `@orkestrel/contract` `^0.0.20`, `@orkestrel/indexeddb` `^0.0.15` | |
57
- | `@orkestrel/emitter` | `0.0.13` | L1 | `@orkestrel/contract` `^0.0.20` | |
58
- | `@orkestrel/form` | `0.0.14` | L2 | `@orkestrel/emitter` `^0.0.13`, `@orkestrel/contract` `^0.0.20` | |
54
+ | `@orkestrel/contract` | `0.0.21` | L0 | | |
55
+ | `@orkestrel/csv` | `0.0.12` | L2 | `@orkestrel/codec` `^0.0.8`, `@orkestrel/contract` `^0.0.21` | |
56
+ | `@orkestrel/database` | `0.0.20` | L2 | `@orkestrel/sqlite` `^0.0.16`, `@orkestrel/emitter` `^0.0.14`, `@orkestrel/contract` `^0.0.21`, `@orkestrel/indexeddb` `^0.0.16` | |
57
+ | `@orkestrel/emitter` | `0.0.14` | L1 | `@orkestrel/contract` `^0.0.21` | |
58
+ | `@orkestrel/form` | `0.0.15` | L2 | `@orkestrel/emitter` `^0.0.14`, `@orkestrel/contract` `^0.0.21` | |
59
59
  | `@orkestrel/guide` | `0.0.28` | L3 | `@orkestrel/contract` `^0.0.20`, `@orkestrel/markdown` `^0.0.18` | |
60
- | `@orkestrel/html` | `0.0.13` | L1 | `@orkestrel/contract` `^0.0.20` | |
61
- | `@orkestrel/indexeddb` | `0.0.15` | L1 | `@orkestrel/contract` `^0.0.20` | |
60
+ | `@orkestrel/html` | `0.0.14` | L1 | `@orkestrel/contract` `^0.0.21` | |
61
+ | `@orkestrel/indexeddb` | `0.0.16` | L1 | `@orkestrel/contract` `^0.0.21` | |
62
62
  | `@orkestrel/interpret` | `0.0.18` | L3 | `@orkestrel/reason` `^0.0.15`, `@orkestrel/emitter` `^0.0.13`, `@orkestrel/contract` `^0.0.20`, `@orkestrel/template` `^0.0.11` | |
63
+ | `@orkestrel/jsonrpc` | `0.0.1` | L1 | `@orkestrel/contract` `^0.0.21` | |
63
64
  | `@orkestrel/lsp` | `0.0.12` | L3 | `@orkestrel/emitter` `^0.0.13`, `@orkestrel/process` `^0.0.16`, `@orkestrel/contract` `^0.0.20` | |
64
- | `@orkestrel/markdown` | `0.0.18` | L2 | `@orkestrel/html` `^0.0.13`, `@orkestrel/contract` `^0.0.20` | |
65
+ | `@orkestrel/markdown` | `0.0.19` | L2 | `@orkestrel/html` `^0.0.14`, `@orkestrel/contract` `^0.0.21` | |
65
66
  | `@orkestrel/mcp` | `0.0.40` | L4 | `@orkestrel/sse` `^0.0.11`, `@orkestrel/tool` `^0.0.20`, `@orkestrel/codec` `^0.0.7`, `@orkestrel/emitter` `^0.0.13`, `@orkestrel/process` `^0.0.16`, `@orkestrel/contract` `^0.0.20`, `@orkestrel/websocket` `^0.0.16` | `@orkestrel/router` `^0.0.18`, `@orkestrel/server` `^0.0.24` |
66
67
  | `@orkestrel/middleware` | `0.0.26` | L4 | `@orkestrel/abort` `^0.0.14`, `@orkestrel/budget` `^0.0.15`, `@orkestrel/timeout` `^0.0.14`, `@orkestrel/contract` `^0.0.20` | `@orkestrel/server` `^0.0.24`, `@orkestrel/database` `^0.0.19` |
67
- | `@orkestrel/msg` | `0.0.14` | L1 | `@orkestrel/contract` `^0.0.20` | |
68
- | `@orkestrel/ndjson` | `0.0.13` | L1 | `@orkestrel/contract` `^0.0.20` | |
68
+ | `@orkestrel/msg` | `0.0.15` | L2 | `@orkestrel/codec` `^0.0.8`, `@orkestrel/contract` `^0.0.21` | |
69
+ | `@orkestrel/ndjson` | `0.0.14` | L1 | `@orkestrel/contract` `^0.0.21` | |
69
70
  | `@orkestrel/ollama` | `0.0.27` | L6 | `@orkestrel/tool` `^0.0.20`, `@orkestrel/agent` `^0.0.33`, `@orkestrel/budget` `^0.0.15`, `@orkestrel/ndjson` `^0.0.13`, `@orkestrel/emitter` `^0.0.13`, `@orkestrel/process` `^0.0.16`, `@orkestrel/contract` `^0.0.20` | |
70
- | `@orkestrel/pool` | `0.0.18` | L2 | `@orkestrel/emitter` `^0.0.13`, `@orkestrel/contract` `^0.0.20` | |
71
+ | `@orkestrel/pool` | `0.0.19` | L2 | `@orkestrel/emitter` `^0.0.14`, `@orkestrel/contract` `^0.0.21` | |
71
72
  | `@orkestrel/probe` | `0.0.26` | L5 | `@orkestrel/lsp` `^0.0.12`, `@orkestrel/mcp` `^0.0.40`, `@orkestrel/pool` `^0.0.18`, `@orkestrel/tool` `^0.0.20`, `@orkestrel/emitter` `^0.0.13`, `@orkestrel/process` `^0.0.16`, `@orkestrel/timeout` `^0.0.14`, `@orkestrel/contract` `^0.0.20` | `vitest` `^4.1.12 \|\| ^5.0.5`, `typescript` `^6.0.3 \|\| ^7.0.2` |
72
- | `@orkestrel/process` | `0.0.16` | L2 | `@orkestrel/emitter` `^0.0.13`, `@orkestrel/contract` `^0.0.20` | |
73
+ | `@orkestrel/process` | `0.0.17` | L2 | `@orkestrel/emitter` `^0.0.14`, `@orkestrel/contract` `^0.0.21` | |
73
74
  | `@orkestrel/program` | `0.0.18` | L4 | `@orkestrel/rater` `^0.0.19`, `@orkestrel/reason` `^0.0.15`, `@orkestrel/emitter` `^0.0.13`, `@orkestrel/contract` `^0.0.20`, `@orkestrel/qualifier` `^0.0.19` | |
74
75
  | `@orkestrel/qualifier` | `0.0.19` | L3 | `@orkestrel/reason` `^0.0.15`, `@orkestrel/emitter` `^0.0.13`, `@orkestrel/contract` `^0.0.20` | |
75
76
  | `@orkestrel/queue` | `0.0.18` | L3 | `@orkestrel/abort` `^0.0.14`, `@orkestrel/emitter` `^0.0.13`, `@orkestrel/timeout` `^0.0.14`, `@orkestrel/contract` `^0.0.20`, `@orkestrel/database` `^0.0.19` | |
76
77
  | `@orkestrel/rater` | `0.0.19` | L3 | `@orkestrel/reason` `^0.0.15`, `@orkestrel/emitter` `^0.0.13`, `@orkestrel/contract` `^0.0.20` | |
77
- | `@orkestrel/reason` | `0.0.15` | L2 | `@orkestrel/emitter` `^0.0.13`, `@orkestrel/contract` `^0.0.20` | |
78
+ | `@orkestrel/reason` | `0.0.16` | L2 | `@orkestrel/emitter` `^0.0.14`, `@orkestrel/contract` `^0.0.21` | |
78
79
  | `@orkestrel/relation` | `0.0.17` | L3 | `@orkestrel/emitter` `^0.0.13`, `@orkestrel/contract` `^0.0.20`, `@orkestrel/database` `^0.0.19` | |
79
- | `@orkestrel/router` | `0.0.18` | L2 | `@orkestrel/abort` `^0.0.14`, `@orkestrel/emitter` `^0.0.13`, `@orkestrel/contract` `^0.0.20` | |
80
- | `@orkestrel/scaffold` | `0.0.116` | L3 | `@orkestrel/console` `^0.0.17`, `@orkestrel/emitter` `^0.0.13`, `@orkestrel/process` `^0.0.16`, `@orkestrel/contract` `^0.0.20`, `@orkestrel/markdown` `^0.0.18`, `@orkestrel/template` `^0.0.11` | |
80
+ | `@orkestrel/router` | `0.0.19` | L2 | `@orkestrel/abort` `^0.0.15`, `@orkestrel/emitter` `^0.0.14`, `@orkestrel/contract` `^0.0.21` | |
81
+ | `@orkestrel/scaffold` | `0.0.119` | L3 | `@orkestrel/console` `^0.0.17`, `@orkestrel/emitter` `^0.0.13`, `@orkestrel/process` `^0.0.16`, `@orkestrel/contract` `^0.0.20`, `@orkestrel/markdown` `^0.0.18`, `@orkestrel/template` `^0.0.11` | |
81
82
  | `@orkestrel/sea` | `0.0.20` | L3 | `@orkestrel/emitter` `^0.0.13`, `@orkestrel/process` `^0.0.16`, `@orkestrel/contract` `^0.0.20` | |
82
83
  | `@orkestrel/server` | `0.0.24` | L3 | `@orkestrel/abort` `^0.0.14`, `@orkestrel/codec` `^0.0.7`, `@orkestrel/router` `^0.0.18`, `@orkestrel/emitter` `^0.0.13`, `@orkestrel/timeout` `^0.0.14`, `@orkestrel/contract` `^0.0.20` | |
83
- | `@orkestrel/sqlite` | `0.0.15` | L1 | `@orkestrel/contract` `^0.0.20` | |
84
- | `@orkestrel/sse` | `0.0.11` | L1 | `@orkestrel/contract` `^0.0.20` | |
84
+ | `@orkestrel/sqlite` | `0.0.16` | L1 | `@orkestrel/contract` `^0.0.21` | |
85
+ | `@orkestrel/sse` | `0.0.12` | L2 | `@orkestrel/codec` `^0.0.8`, `@orkestrel/contract` `^0.0.21` | |
85
86
  | `@orkestrel/study` | `0.0.7` | L7 | `@orkestrel/tool` `^0.0.20`, `@orkestrel/abort` `^0.0.14`, `@orkestrel/agent` `^0.0.33`, `@orkestrel/budget` `^0.0.15`, `@orkestrel/ollama` `^0.0.27`, `@orkestrel/timeout` `^0.0.14`, `@orkestrel/contract` `^0.0.20` | |
86
- | `@orkestrel/table` | `0.0.13` | L2 | `@orkestrel/emitter` `^0.0.13`, `@orkestrel/contract` `^0.0.20` | |
87
- | `@orkestrel/template` | `0.0.11` | L2 | `@orkestrel/emitter` `^0.0.13`, `@orkestrel/contract` `^0.0.20` | |
87
+ | `@orkestrel/table` | `0.0.14` | L2 | `@orkestrel/emitter` `^0.0.14`, `@orkestrel/contract` `^0.0.21` | |
88
+ | `@orkestrel/template` | `0.0.12` | L2 | `@orkestrel/emitter` `^0.0.14`, `@orkestrel/contract` `^0.0.21` | |
88
89
  | `@orkestrel/terminal` | `0.0.21` | L3 | `@orkestrel/sse` `^0.0.11`, `@orkestrel/form` `^0.0.14`, `@orkestrel/console` `^0.0.17`, `@orkestrel/emitter` `^0.0.13`, `@orkestrel/contract` `^0.0.20`, `@orkestrel/database` `^0.0.19` | |
89
- | `@orkestrel/test` | `0.0.31` | L1 | `@orkestrel/contract` `^0.0.20` | `vitest` `^4.1.12 \|\| ^5.0.5`, `playwright` `^1.64.1` |
90
- | `@orkestrel/timeout` | `0.0.14` | L1 | `@orkestrel/contract` `^0.0.20` | |
91
- | `@orkestrel/tool` | `0.0.20` | L2 | `@orkestrel/emitter` `^0.0.13`, `@orkestrel/contract` `^0.0.20` | |
90
+ | `@orkestrel/test` | `0.0.32` | L1 | `@orkestrel/contract` `^0.0.21` | `vitest` `^4.1.12 \|\| ^5.0.5`, `playwright` `^1.64.1` |
91
+ | `@orkestrel/timeout` | `0.0.15` | L1 | `@orkestrel/contract` `^0.0.21` | |
92
+ | `@orkestrel/tool` | `0.0.21` | L2 | `@orkestrel/emitter` `^0.0.14`, `@orkestrel/contract` `^0.0.21` | |
92
93
  | `@orkestrel/toolbox` | `0.0.22` | L6 | `@orkestrel/form` `^0.0.14`, `@orkestrel/tool` `^0.0.20`, `@orkestrel/agent` `^0.0.33`, `@orkestrel/server` `^0.0.24`, `@orkestrel/contract` `^0.0.20`, `@orkestrel/database` `^0.0.19`, `@orkestrel/relation` `^0.0.17`, `@orkestrel/terminal` `^0.0.21`, `@orkestrel/workflow` `^0.0.24`, `@orkestrel/workspace` `^0.0.13` | |
93
- | `@orkestrel/websocket` | `0.0.16` | L2 | `@orkestrel/emitter` `^0.0.13`, `@orkestrel/contract` `^0.0.20` | |
94
+ | `@orkestrel/websocket` | `0.0.17` | L2 | `@orkestrel/emitter` `^0.0.14`, `@orkestrel/contract` `^0.0.21` | |
94
95
  | `@orkestrel/worker` | `0.0.18` | L4 | `@orkestrel/pool` `^0.0.18`, `@orkestrel/queue` `^0.0.18`, `@orkestrel/emitter` `^0.0.13`, `@orkestrel/contract` `^0.0.20`, `@orkestrel/database` `^0.0.19` | |
95
96
  | `@orkestrel/workflow` | `0.0.24` | L4 | `@orkestrel/abort` `^0.0.14`, `@orkestrel/queue` `^0.0.18`, `@orkestrel/budget` `^0.0.15`, `@orkestrel/emitter` `^0.0.13`, `@orkestrel/timeout` `^0.0.14`, `@orkestrel/contract` `^0.0.20`, `@orkestrel/database` `^0.0.19` | |
96
97
  | `@orkestrel/workspace` | `0.0.13` | L3 | `@orkestrel/emitter` `^0.0.13`, `@orkestrel/contract` `^0.0.20`, `@orkestrel/database` `^0.0.19` | |
@@ -283,9 +283,9 @@ Import `createScratch` from `@orkestrel/test/server` when a proof needs real fil
283
283
 
284
284
  Browser/style setup exposes shared assertions/builders:
285
285
 
286
- `mount`, `render`, `build`, `readStyle`, `readToken`, `readRootToken`, `readPixels`, `parseCSSColor`, `matchesColor`, `findRule`.
286
+ `mount`, `render`, `build`, `readStyle`, `readToken`, `readRootToken`, `readPixels`, `parseCSSColor`, `matchesColor`, `findStyleRule`.
287
287
 
288
- `findRule` proves a declaration exists in the cascade; `readStyle()` reads the resolved result.
288
+ `findStyleRule` proves a declaration exists in the cascade; `readStyle()` reads the resolved result.
289
289
 
290
290
  ## Browser tests
291
291
 
@@ -210,9 +210,8 @@ type Result<T, E = Error> = Success<T> | Failure<E>
210
210
  `isInstance` function against the class.
211
211
  - Brand every public error class for that guard:
212
212
  - key the brand `Symbol.for('<package>.<ClassName>')`, where `<package>` is the manifest's `name`
213
- field and `<ClassName>` is the class identifier, and keep a key the package has published, such
214
- as `Symbol.for('@orkestrel/contract.error')`, because a changed key stops recognizing every
215
- earlier copy;
213
+ field and `<ClassName>` is the class identifier. When you rename the class, rename the key in
214
+ the same change, and keep no earlier key;
216
215
  - in the constructor, define an own non-enumerable, non-writable property under that key whose
217
216
  value is the error itself, so that a subclass instance holds its own identity there and a
218
217
  transparent `Proxy` object over the error forwards its target's;
@@ -45,8 +45,6 @@ Construction is a strict JavaScript boundary. `validateAbortOptions` normalizes
45
45
 
46
46
  ### Validators
47
47
 
48
- In a guard table a `Shape` cell holds the type the guard narrows to.
49
-
50
48
  | Name | Kind | Signature | Summary |
51
49
  | --------------- | -------- | ------------------------------------------ | ----------------------------------------------------------------------------------------------------------------------------- |
52
50
  | `isAbortSignal` | function | `(value: unknown) => value is AbortSignal` | Determines whether a value is a native `AbortSignal`, staying total for structural spoofs and for hostile or revoked proxies. |
@@ -59,8 +57,6 @@ In a guard table a `Shape` cell holds the type the guard narrows to.
59
57
 
60
58
  ### Types
61
59
 
62
- 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 `\|`.
63
-
64
60
  | Name | Kind | Signature | Summary |
65
61
  | ---------------- | --------- | ---------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
66
62
  | `AbortOptions` | interface | `{ id?, signal? }` | Represents the options for `createAbort` and `Abort` construction. |
@@ -36,8 +36,6 @@ budget.consume(7_000) // crosses 10_000 — fires `signal`
36
36
 
37
37
  ### Validators
38
38
 
39
- In a guard table a `Shape` cell holds the type the guard narrows to.
40
-
41
39
  | Name | Kind | Signature | Summary |
42
40
  | ---------------- | -------- | ------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------- |
43
41
  | `isBudget` | function | `(value: unknown) => value is BudgetInterface<unknown>` | Determines whether a value implements `BudgetInterface`, returning `false` rather than throwing on hostile input. |
@@ -72,8 +70,6 @@ In a guard table a `Shape` cell holds the type the guard narrows to.
72
70
 
73
71
  ### Types
74
72
 
75
- 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 `\|`.
76
-
77
73
  | Name | Kind | Signature | Summary |
78
74
  | -------------------- | --------- | ---------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
79
75
  | `BudgetOptions` | interface | `{ id?, max, consumer, signal? }` | Represents the options for constructing a cumulative budget, accepted by the `createBudget` function and the `Budget` constructor. |
@@ -124,7 +120,7 @@ These invariants hold across `src/core` ↔ `budget.md`:
124
120
  8. **Traceable identity.** `id` is a stable string for the handle's lifetime — caller-supplied through `options.id`, including an empty string, or a `crypto.randomUUID()` default only when `id` is omitted. `max` is the validated ceiling, exposed read-only. The abort reason on owned exhaustion is a `BudgetError` coded `'exhaust'` with the fixed message `budget reached its ceiling`, whose `context` holds the `id`, `max`, and `consumed` at the crossing; a parent abort keeps the parent's reason, including when the parent aborted before the crossing and nothing had read the composite signal. `consume` tests the composed signal, not the owned controller, before it aborts the controller, so the parent's reason survives whether or not the host's `AbortSignal.any` has propagated the parent's abort yet; on Node 24.22.0 the propagation is eager and an owned-controller test gives the same reason.
125
121
  9. **Strict once-read boundaries.** `validateBudgetOptions`, `validateTokenBudgetOptions`, `validateMeterOptions`, and `validateTokenMeterOptions` accept the typed contracts while defending their hostile JavaScript boundary: they require a plain record, read each declared property exactly once inside a contained boundary, validate with structured `ContractError` taxonomy/context, and return a fresh normalized object that omits absent optional keys. `Budget` calls the budget helper before allocating its controller; `createTokenBudget` calls the token helper before creating its consumer and public budget; `Meter` calls the meter helper before it stores anything; `createTokenMeter` calls the token-meter helper before it composes the meter.
126
122
  10. **Validated token accounting.** `TokenScope` is the public `'completion' | 'total' | 'prompt'` selector and defaults to `completion` in `createTokenBudget`. Token factories reject unsupported scopes and malformed usage; all three `TokenUsage` fields must be finite and nonnegative before the selected charge is used.
127
- 11. **Total guards and cross-copy recognition.** `isBudget`, `isBudgetAmount`, `isBudgetError`, `isBudgetSignal`, `isTokenScope`, and `isTokenUsage` return `false`, rather than throw, for off-shape, hostile, or revoked input. `isBudgetError` uses the identity brand instead of `instanceof BudgetError`, while retaining the native `Error` base check. The constructor stamps `BUDGET_ERROR_BRAND`, the registry-global `Symbol.for('@orkestrel/budget.error')`, as a non-enumerable own property whose value is the error itself. The guard requires that exact identity, the native `Error` base, a prototype other than `Error.prototype`, the code `'exhaust'`, and a `context` holding a string `id` and number `max` and `consumed`. Subclass instances and renamed errors pass without reading `name`. One rule serves every copy: a reason built by another installation, or by the CommonJS entry when the guard came from the ESM entry, narrows exactly as one built by the same copy, and the reverse holds too. A transparent proxy over a genuine error is refused, because its forwarded descriptor stores the target. An unbranded `Error` carrying `code: 'exhaust'`, and an error from a copy that stamps no brand, such as 0.0.13, stay outside the type. The brand is a recognition marker, not proof of origin: a complete forgery that stamps its own identity under the key passes.
123
+ 11. **Total guards and cross-copy recognition.** `isBudget`, `isBudgetAmount`, `isBudgetError`, `isBudgetSignal`, `isTokenScope`, and `isTokenUsage` return `false`, rather than throw, for off-shape, hostile, or revoked input. `isBudgetError` uses the identity brand instead of `instanceof BudgetError`, while retaining the native `Error` base check. The constructor stamps `BUDGET_ERROR_BRAND`, the registry-global `Symbol.for('@orkestrel/budget.BudgetError')`, as a non-enumerable own property whose value is the error itself. The guard requires that exact identity, the native `Error` base, a prototype other than `Error.prototype`, the code `'exhaust'`, and a `context` holding a string `id` and number `max` and `consumed`. Subclass instances and renamed errors pass without reading `name`. One rule serves every copy: a reason built by another installation, or by the CommonJS entry when the guard came from the ESM entry, narrows exactly as one built by the same copy, and the reverse holds too. A transparent proxy over a genuine error is refused, because its forwarded descriptor stores the target. An unbranded `Error` carrying `code: 'exhaust'`, and an error from a copy that stamps no brand, such as 0.0.13, stay outside the type. The brand is a recognition marker, not proof of origin: a complete forgery that stamps its own identity under the key passes.
128
124
  12. **Signal-only observation.** Neither `Budget` nor `Meter` has an Emitter, `EventMap`, or `on` hook. The budget's native `AbortSignal` is the observation mechanism.
129
125
  13. **DOC ↔ SOURCE method bijection.** The `## Methods` tables list exactly the public methods of `BudgetInterface` and `MeterInterface` — exhaustive, both directions — and `Budget` and `Meter` expose the same public methods as their interfaces, no more.
130
126
  14. **Growth metering.** `charge(delta)` refuses a non-string delta with a `literal`-coded `ContractError` before any state changes. It then counts the delta, estimates the whole text, refuses a nonfinite or negative estimate with a `range`-coded `ContractError`, and measures the estimate's growth over the growth the budget has accepted plus the growth of every charge still in flight. Only when that growth is positive does it consume `producer(growth)`. Each charge in flight holds a per-call claim of its growth from before the producer runs until the charge settles, so a charge that re-enters the meter synchronously, through the producer, the budget's consumer, or an abort listener the crossing fires, measures its own growth past the claims and the nested and outer charges sum to the serial result. `charged` is the total growth the budget accepted from this meter: it rises by a charge's growth only after the budget's `consume` returns, and a throw from the producer or the budget drops the claim and raises nothing. For a budget the meter alone charges and never clears, `charged` therefore equals the budget's `consumed` whenever no charge is in flight, in serial use, under re-entry through the producer or the budget's consumer, and under refusal. A nested charge an abort listener makes is added before the outer charge, which the budget added first, so with growths that are not integers the two can differ in the last digit. In serial use `charged` equals the latest accepted estimate up to floating-point rounding. A throw from the estimator, or a refused estimate, claims nothing. Every refusal leaves the delta counted, and the next charge measures the growth from the text that includes it. A meter has no reset; create one per stream.
@@ -121,6 +121,17 @@ read — is module data rather than public API, for the reason the Base64 alphab
121
121
  | `decodeUTF16LE` | function | `(bytes: Uint8Array) => string \| undefined` | Decodes little-endian UTF-16 bytes into their text, reading two bytes per code unit, low byte first. An odd length and an unpaired surrogate are `undefined`. A leading FF FE is kept as U+FEFF rather than stripped. |
122
122
  | `isUTF16LE` | function | `(value: unknown) => value is Uint8Array` | Checks whether a value is bytes that decode as UTF-16LE — true for exactly the byte sequences `decodeUTF16LE` answers text for. An odd length and an unpaired surrogate are false. Total on any value: a string, `null`, a sibling view kind, or a proxy is false rather than a throw. |
123
123
 
124
+ ### Marks
125
+
126
+ The marks module, [`marks/constants.ts`](../src/core/marks/constants.ts), holds the byte order mark a
127
+ consumer writes or strips around a coding. `BOM` is the one public constant in this package, kept
128
+ in its own module so the lookup tables behind the codings stay module data. The
129
+ [BOM stance](#the-bom-stance) states how each charset face carries it.
130
+
131
+ | Name | Kind | Signature | Summary |
132
+ | ----- | ----- | ---------- | ------------------------------------------------------------- |
133
+ | `BOM` | const | `"\uFEFF"` | Holds the byte order mark, U+FEFF, as a one-character string. |
134
+
124
135
  ## The laws
125
136
 
126
137
  Each face keeps the round-trip and canonical-form laws, and the suite drives both as sweeps rather
@@ -206,8 +217,9 @@ A byte order mark is data here, not a signal. `EF BB BF` decodes to U+FEFF on th
206
217
  `FF FE` decodes to U+FEFF on the UTF-16LE face, in leading position exactly as anywhere else, and
207
218
  each encodes back to those bytes. The round-trip law forces it: a decoder that dropped a leading BOM
208
219
  would answer a text whose re-encoding is shorter than the bytes it was given, and no amount of
209
- documentation makes that a round trip. A consumer that wants the mark removed removes it, the same
210
- way a consumer wanting lenient Base64 normalizes first.
220
+ documentation makes that a round trip. A consumer that wants the mark removed compares the leading
221
+ character against `BOM` and removes it, the same way a consumer wanting lenient Base64 normalizes
222
+ first.
211
223
 
212
224
  ### Where this package parts from WHATWG
213
225
 
@@ -377,6 +389,7 @@ to UTF-16LE.
377
389
 
378
390
  ```ts
379
391
  import {
392
+ BOM,
380
393
  decodeLatin1,
381
394
  decodeUTF8,
382
395
  decodeUTF16LE,
@@ -392,6 +405,7 @@ encodeUTF8('hi') // Uint8Array [104, 105]
392
405
  decodeUTF8(new Uint8Array([104, 105])) // 'hi'
393
406
  encodeUTF8('\ud800') // undefined — a lone surrogate has no UTF-8 spelling
394
407
  decodeUTF8(new Uint8Array([0xc0, 0x80])) // undefined — the overlong spelling of U+0000
408
+ encodeUTF8(BOM) // Uint8Array [239, 187, 191]
395
409
  decodeUTF8(new Uint8Array([0xef, 0xbb, 0xbf])) // '\ufeff' — the BOM is data, not a signal
396
410
 
397
411
  // ISO-8859-1 is the identity on a byte, so only its encode side can refuse.
@@ -461,7 +475,8 @@ measureUTF8('\ud800') // undefined — ill-formed text has no UTF-8 spelling
461
475
  round-trip law walks a well-formed text population built from characters spanning every UTF-8
462
476
  width threshold, the BOM, the Latin-1 ceiling, the Windows-1252 bands, and the code points on
463
477
  either side of the surrogate range, and pins each width threshold at the byte length the
464
- specification fixes. The canonical-form law walks the exhaustive two-byte space on every charset
478
+ specification fixes. A named case carries `BOM` through both faces, leading position included, and
479
+ pins it against `String.fromCodePoint(0xfeff)`. The canonical-form law walks the exhaustive two-byte space on every charset
465
480
  face, re-encoding every admitted pair to itself, and reads the Windows-1252 defined mapping as a
466
481
  bijection and the Latin-1 mapping as the identity bijection. Beside the sweeps sit the written-out
467
482
  refusal rows — the overlongs, the encoded surrogates, the out-of-range and truncated sequences,