@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.
Files changed (108) hide show
  1. package/dist/bin/main.js +137 -15
  2. package/dist/bin/main.js.map +1 -1
  3. package/dist/host/agents/orchestration.md +5 -3
  4. package/dist/host/agents/platforms/windows.md +1 -0
  5. package/dist/host/agents/skills/orkestrel-align/references/integration.md +1 -1
  6. package/dist/host/agents/skills/orkestrel-debrief/SKILL.md +4 -4
  7. package/dist/host/agents/skills/orkestrel-dispatch/SKILL.md +4 -1
  8. package/dist/host/agents/skills/orkestrel-falsify/SKILL.md +8 -2
  9. package/dist/host/agents/skills/orkestrel-harden/references/equivalence.md +1 -0
  10. package/dist/host/agents/skills/orkestrel-harden/references/hardening.md +1 -1
  11. package/dist/host/agents/skills/orkestrel-parallel/SKILL.md +1 -1
  12. package/dist/host/agents/skills/orkestrel-parallel/references/codex.md +1 -0
  13. package/dist/host/agents/skills/orkestrel-publish/references/wave.md +9 -3
  14. package/dist/host/claude/agents/analyst.md +1 -1
  15. package/dist/host/claude/agents/astra.md +2 -2
  16. package/dist/host/claude/agents/builder.md +4 -4
  17. package/dist/host/claude/agents/opus.md +3 -3
  18. package/dist/host/claude/agents/orkestrel.md +5 -7
  19. package/dist/host/claude/agents/planner.md +8 -2
  20. package/dist/host/claude/rules/campaign.md +2 -1
  21. package/dist/host/claude/rules/documentation.md +1 -0
  22. package/dist/host/claude/rules/names.md +3 -1
  23. package/dist/host/claude/rules/tests.md +7 -4
  24. package/dist/host/claude/rules/writing.md +1 -0
  25. package/dist/host/claude/skills/enterprise-bootstrap/SKILL.md +1 -2
  26. package/dist/host/claude/skills/orkestrel-align/SKILL.md +1 -1
  27. package/dist/host/claude/skills/orkestrel-build/SKILL.md +1 -2
  28. package/dist/host/claude/skills/orkestrel-debrief/SKILL.md +1 -2
  29. package/dist/host/claude/skills/orkestrel-dispatch/SKILL.md +1 -1
  30. package/dist/host/claude/skills/orkestrel-falsify/SKILL.md +1 -1
  31. package/dist/host/claude/skills/orkestrel-harden/SKILL.md +1 -1
  32. package/dist/host/claude/skills/orkestrel-journey/SKILL.md +1 -1
  33. package/dist/host/claude/skills/orkestrel-parallel/SKILL.md +1 -1
  34. package/dist/host/claude/skills/orkestrel-polish/SKILL.md +1 -2
  35. package/dist/host/claude/skills/orkestrel-publish/SKILL.md +1 -2
  36. package/dist/host/claude/skills/orkestrel-scout/SKILL.md +1 -1
  37. package/dist/host/codex/agents/analyst.toml +8 -5
  38. package/dist/host/codex/agents/astra.toml +4 -5
  39. package/dist/host/codex/agents/builder.toml +5 -5
  40. package/dist/host/codex/agents/opus.toml +3 -4
  41. package/dist/host/codex/agents/orkestrel.toml +2 -1
  42. package/dist/host/codex/agents/planner.toml +8 -5
  43. package/dist/host/codex/agents/reviewer.toml +5 -4
  44. package/dist/host/guides/abort.md +17 -17
  45. package/dist/host/guides/agent.md +445 -445
  46. package/dist/host/guides/brief.md +143 -143
  47. package/dist/host/guides/browser.md +731 -731
  48. package/dist/host/guides/budget.md +39 -39
  49. package/dist/host/guides/capture.md +298 -298
  50. package/dist/host/guides/console.md +109 -109
  51. package/dist/host/guides/contract.md +335 -335
  52. package/dist/host/guides/csv.md +30 -30
  53. package/dist/host/guides/database.md +163 -163
  54. package/dist/host/guides/emitter.md +17 -17
  55. package/dist/host/guides/form.md +99 -99
  56. package/dist/host/guides/guide.md +361 -183
  57. package/dist/host/guides/html.md +49 -49
  58. package/dist/host/guides/indexeddb.md +40 -40
  59. package/dist/host/guides/interpret.md +139 -139
  60. package/dist/host/guides/lsp.md +114 -114
  61. package/dist/host/guides/markdown.md +68 -68
  62. package/dist/host/guides/mcp.md +3745 -3745
  63. package/dist/host/guides/middleware.md +170 -170
  64. package/dist/host/guides/msg.md +95 -95
  65. package/dist/host/guides/ndjson.md +8 -8
  66. package/dist/host/guides/ollama.md +56 -56
  67. package/dist/host/guides/pool.md +21 -21
  68. package/dist/host/guides/probe.md +82 -82
  69. package/dist/host/guides/process.md +99 -99
  70. package/dist/host/guides/program.md +98 -96
  71. package/dist/host/guides/qualifier.md +70 -70
  72. package/dist/host/guides/queue.md +37 -37
  73. package/dist/host/guides/rater.md +38 -38
  74. package/dist/host/guides/reason.md +308 -308
  75. package/dist/host/guides/relation.md +50 -50
  76. package/dist/host/guides/router.md +58 -58
  77. package/dist/host/guides/scaffold.md +554 -419
  78. package/dist/host/guides/sea.md +128 -128
  79. package/dist/host/guides/server.md +100 -100
  80. package/dist/host/guides/sqlite.md +28 -28
  81. package/dist/host/guides/sse.md +20 -20
  82. package/dist/host/guides/study.md +444 -444
  83. package/dist/host/guides/table.md +82 -82
  84. package/dist/host/guides/template.md +41 -41
  85. package/dist/host/guides/terminal.md +121 -121
  86. package/dist/host/guides/test.md +273 -273
  87. package/dist/host/guides/timeout.md +18 -18
  88. package/dist/host/guides/tool.md +27 -27
  89. package/dist/host/guides/toolbox.md +166 -166
  90. package/dist/host/guides/websocket.md +54 -54
  91. package/dist/host/guides/worker.md +24 -24
  92. package/dist/host/guides/workflow.md +187 -187
  93. package/dist/host/guides/workspace.md +55 -55
  94. package/dist/host/manifest.json +93 -93
  95. package/dist/host/tests/setupPolicy.ts +5 -3
  96. package/dist/src/core/index.cjs +89 -3
  97. package/dist/src/core/index.cjs.map +1 -1
  98. package/dist/src/core/index.d.cts +229 -144
  99. package/dist/src/core/index.d.ts +229 -144
  100. package/dist/src/core/index.js +87 -4
  101. package/dist/src/core/index.js.map +1 -1
  102. package/dist/src/server/index.cjs +292 -66
  103. package/dist/src/server/index.cjs.map +1 -1
  104. package/dist/src/server/index.d.cts +188 -6
  105. package/dist/src/server/index.d.ts +188 -6
  106. package/dist/src/server/index.js +287 -69
  107. package/dist/src/server/index.js.map +1 -1
  108. package/package.json +4 -3
@@ -35,36 +35,36 @@ documented under [`## Methods`](#methods), and its readonly data members stay he
35
35
 
36
36
  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 `\|`.
37
37
 
38
- | Name | Kind | Shape | Summary |
39
- | --------------------------- | --------- | ------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
40
- | `BinaryMIME` | type | `'image/png' \| 'image/jpeg' \| 'image/gif' \| 'image/webp'` | Names the MIME labels a binary `FileContent` arm supports. |
41
- | `FileContent` | type | `TextContent \| BinaryContent` | Holds a file's immutable content: either text with a language tag or a base64 string with a MIME. The union carries no discriminant field, so a caller narrows it with a guard. |
42
- | `TextContent` | interface | `{ text, language }` | Holds the text arm of a file's immutable content: a body and its language tag. |
43
- | `BinaryContent` | interface | `{ base64, mime }` | Holds the binary arm of a file's immutable content: a base64 payload and its MIME. |
44
- | `FileState` | type | `'created' \| 'modified'` | Names the edit state of an immutable file value: `created` for the first write to a path and `modified` for every later edit of that path. |
45
- | `FileInput` | interface | `{ path, content, state? }` | Carries the caller-supplied values used to create an immutable file. The byte size and the line count are derived rather than supplied. |
46
- | `FileInterface` | interface | `{ path, content, state, size, lines }` | Represents an immutable path-addressed file with derived byte and line counts. |
47
- | `Position` | interface | `{ line, column }` | Locates a 1-based caret inside text. |
48
- | `Range` | interface | `{ start, end }` | Represents a half-open text span whose start is inclusive and end is exclusive. |
49
- | `ReadResult` | interface | `{ content, range }` | Carries the content and clamped span returned by a ranged read. |
50
- | `SearchOptions` | interface | `{ regex?, sensitive?, limit? }` | Configures search and replacement behavior. |
51
- | `SearchMatch` | interface | `{ path, line, column, length, content }` | Reports one 1-based search hit and the full line that contains it. |
52
- | `ReplaceResult` | interface | `{ occurrences, files }` | Carries the tallies a replacement produced: the occurrences replaced and the files changed. |
53
- | `WorkspaceEventMap` | type | `{ write, remove, move, clear }` | Names the events emitted after workspace mutations complete. |
54
- | `WorkspaceOptions` | interface | `{ id?, on?, error?, seed? }` | Configures a workspace at construction. |
55
- | `WorkspaceSnapshot` | interface | `{ id, files }` | Represents a workspace's stored state in JSON-serializable form. |
56
- | `WorkspaceStoreInterface` | interface | `{} plus get, set, delete` | Persists workspace snapshots through an asynchronous point-access contract. |
57
- | `WorkspaceSnapshotRow` | interface | `{ id, snapshot }` | Represents the database row used to persist one opaque workspace snapshot. |
58
- | `WorkspaceErrorCode` | type | `'MISSING' \| 'MODALITY' \| 'PATTERN' \| 'RANGE'` | Names the machine-readable failure codes raised by the workspace edit surface. |
59
- | `WorkspaceInterface` | interface | `{ id, emitter, count } plus file, files, read, has, search, replace, write, prepend, append, move, remove, clear, snapshot, destroy` | Represents a mutable path-keyed editing surface over immutable file values. |
60
- | `WorkspaceManagerOptions` | interface | `{ on?, error?, store? }` | Configures a workspace registry at construction. |
61
- | `WorkspaceManagerInterface` | interface | `{ count, active } plus workspace, workspaces, add, switch, open, save, remove, clear` | Represents an insertion-ordered workspace registry with an active selection and optional durability. |
38
+ | Name | Kind | Signature | Summary |
39
+ | --------------------------- | --------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
40
+ | `BinaryMIME` | type | `'image/png' \| 'image/jpeg' \| 'image/gif' \| 'image/webp'` | Names the MIME labels a binary `FileContent` arm supports. |
41
+ | `FileContent` | type | `TextContent \| BinaryContent` | Holds a file's immutable content: either text with a language tag or a base64 string with a MIME. The union carries no discriminant field, so a caller narrows it with a guard. |
42
+ | `TextContent` | interface | `{ text, language }` | Holds the text arm of a file's immutable content: a body and its language tag. |
43
+ | `BinaryContent` | interface | `{ base64, mime }` | Holds the binary arm of a file's immutable content: a base64 payload and its MIME. |
44
+ | `FileState` | type | `'created' \| 'modified'` | Names the edit state of an immutable file value: `created` for the first write to a path and `modified` for every later edit of that path. |
45
+ | `FileInput` | interface | `{ path, content, state? }` | Carries the caller-supplied values used to create an immutable file. The byte size and the line count are derived rather than supplied. |
46
+ | `FileInterface` | interface | `{ path, content, state, size, lines }` | Represents an immutable path-addressed file with derived byte and line counts. |
47
+ | `Position` | interface | `{ line, column }` | Locates a 1-based caret inside text. |
48
+ | `Range` | interface | `{ start, end }` | Represents a half-open text span whose start is inclusive and end is exclusive. |
49
+ | `ReadResult` | interface | `{ content, range }` | Carries the content and clamped span returned by a ranged read. |
50
+ | `SearchOptions` | interface | `{ regex?, sensitive?, limit? }` | Configures search and replacement behavior. |
51
+ | `SearchMatch` | interface | `{ path, line, column, length, content }` | Reports one 1-based search hit and the full line that contains it. |
52
+ | `ReplaceResult` | interface | `{ occurrences, files }` | Carries the tallies a replacement produced: the occurrences replaced and the files changed. |
53
+ | `WorkspaceEventMap` | type | `{ readonly write: readonly [file: FileInterface]; readonly remove: readonly [path: string]; readonly move: readonly [from: string, to: string]; readonly clear: readonly []; }` | Names the events emitted after workspace mutations complete. |
54
+ | `WorkspaceOptions` | interface | `{ id?, on?, error?, seed? }` | Configures a workspace at construction. |
55
+ | `WorkspaceSnapshot` | interface | `{ id, files }` | Represents a workspace's stored state in JSON-serializable form. |
56
+ | `WorkspaceStoreInterface` | interface | `{ get(), set(), delete() }` | Persists workspace snapshots through an asynchronous point-access contract. |
57
+ | `WorkspaceSnapshotRow` | interface | `{ id, snapshot }` | Represents the database row used to persist one opaque workspace snapshot. |
58
+ | `WorkspaceErrorCode` | type | `'MISSING' \| 'MODALITY' \| 'PATTERN' \| 'RANGE'` | Names the machine-readable failure codes raised by the workspace edit surface. |
59
+ | `WorkspaceInterface` | interface | `{ id, emitter, count, file(), files(), read(), has(), search(), replace(), write(), prepend(), append(), move(), remove(), clear(), snapshot(), destroy() }` | Represents a mutable path-keyed editing surface over immutable file values. |
60
+ | `WorkspaceManagerOptions` | interface | `{ on?, error?, store? }` | Configures a workspace registry at construction. |
61
+ | `WorkspaceManagerInterface` | interface | `{ count, active, workspace(), workspaces(), add(), switch(), open(), save(), remove(), clear() }` | Represents an insertion-ordered workspace registry with an active selection and optional durability. |
62
62
 
63
63
  ### Constants
64
64
 
65
65
  A `Shape` cell holds the constant's declared type.
66
66
 
67
- | Name | Kind | Shape | Summary |
67
+ | Name | Kind | Signature | Summary |
68
68
  | --------------------- | ----- | ---------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- |
69
69
  | `EXTENSION_LANGUAGES` | const | `Readonly<Record<string, string>>` | Maps file extensions to language tags for text content. The table is frozen, and an extension it does not list falls back to `text` in `inferLanguage`. |
70
70
 
@@ -73,32 +73,32 @@ A `Shape` cell holds the constant's declared type.
73
73
  From [`errors.ts`](../src/core/errors.ts). A refusal is an exception; everything else this
74
74
  package can answer, it answers with a value.
75
75
 
76
- | Name | Kind | Signature | Summary |
77
- | ------------------ | -------- | --------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- |
78
- | `WorkspaceError` | class | `new (code, message, context?)` | Reports an invalid workspace edit or search operation, carrying a `WorkspaceErrorCode` and, when the operation had one, the context it ran under. |
79
- | `isWorkspaceError` | function | `(value: unknown) => value is WorkspaceError` | Narrows a caught value to a `WorkspaceError`. |
76
+ | Name | Kind | Signature | Summary |
77
+ | ------------------ | -------- | ---------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- |
78
+ | `WorkspaceError` | class | `new (code: WorkspaceErrorCode, message: string, context?: Readonly<Record<string, unknown>>) => WorkspaceError` | Reports an invalid workspace edit or search operation, carrying a `WorkspaceErrorCode` and, when the operation had one, the context it ran under. |
79
+ | `isWorkspaceError` | function | `(value: unknown) => value is WorkspaceError` | Narrows a caught value to a `WorkspaceError`. |
80
80
 
81
81
  ### Helpers
82
82
 
83
83
  The pure leaves, from [`helpers.ts`](../src/core/helpers.ts). Each one is exported and tested
84
84
  on its own, and the classes compose them rather than hiding them.
85
85
 
86
- | Name | Kind | Signature | Summary |
87
- | -------------------- | -------- | ------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- |
88
- | `inferLanguage` | function | `(path: string) => string` | Infers a language tag from the final file extension. |
89
- | `isText` | function | `(content: FileContent) => content is TextContent` | Determines whether content is the text arm. |
90
- | `isBinary` | function | `(content: FileContent) => content is BinaryContent` | Determines whether content is the binary arm. |
91
- | `computeSize` | function | `(content: FileContent) => number` | Computes the byte size of file content. |
92
- | `countLines` | function | `(content: FileContent) => number` | Counts the lines in file content. |
93
- | `computeDecodedSize` | function | `(base64: string) => number` | Computes the decoded byte length of a base64 string, arithmetically rather than by decoding it. |
94
- | `isValidRange` | function | `(range: Range) => boolean` | Determines whether a 1-based range is structurally valid. |
95
- | `clampPosition` | function | `(text: string, position: Position) => Position` | Clamps a position to text bounds. |
96
- | `clampRange` | function | `(text: string, range: Range) => Range` | Clamps both positions in a range to text bounds. |
97
- | `offsetAt` | function | `(text: string, position: Position) => number` | Converts a 1-based position to a zero-based string offset. |
98
- | `sliceRange` | function | `(text: string, range: Range) => string` | Slices a clamped half-open text range. |
99
- | `spliceRange` | function | `(text: string, range: Range, replacement: string) => string` | Replaces a clamped half-open text range. |
100
- | `rangeOf` | function | `(fromLine, fromColumn, toLine, toColumn) => Range` | Assembles a nested range from four 1-based coordinates. |
101
- | `escapeRegExp` | function | `(value: string) => string` | Escapes regular-expression metacharacters for literal matching. |
86
+ | Name | Kind | Signature | Summary |
87
+ | -------------------- | -------- | ----------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- |
88
+ | `inferLanguage` | function | `(path: string) => string` | Infers a language tag from the final file extension. |
89
+ | `isText` | function | `(content: FileContent) => content is TextContent` | Determines whether content is the text arm. |
90
+ | `isBinary` | function | `(content: FileContent) => content is BinaryContent` | Determines whether content is the binary arm. |
91
+ | `computeSize` | function | `(content: FileContent) => number` | Computes the byte size of file content. |
92
+ | `countLines` | function | `(content: FileContent) => number` | Counts the lines in file content. |
93
+ | `computeDecodedSize` | function | `(base64: string) => number` | Computes the decoded byte length of a base64 string, arithmetically rather than by decoding it. |
94
+ | `isValidRange` | function | `(range: Range) => boolean` | Determines whether a 1-based range is structurally valid. |
95
+ | `clampPosition` | function | `(text: string, position: Position) => Position` | Clamps a position to text bounds. |
96
+ | `clampRange` | function | `(text: string, range: Range) => Range` | Clamps both positions in a range to text bounds. |
97
+ | `offsetAt` | function | `(text: string, position: Position) => number` | Converts a 1-based position to a zero-based string offset. |
98
+ | `sliceRange` | function | `(text: string, range: Range) => string` | Slices a clamped half-open text range. |
99
+ | `spliceRange` | function | `(text: string, range: Range, replacement: string) => string` | Replaces a clamped half-open text range. |
100
+ | `rangeOf` | function | `(fromLine: number, fromColumn: number, toLine: number, toColumn: number) => Range` | Assembles a nested range from four 1-based coordinates. |
101
+ | `escapeRegExp` | function | `(value: string) => string` | Escapes regular-expression metacharacters for literal matching. |
102
102
 
103
103
  ### Validators
104
104
 
@@ -107,10 +107,10 @@ value arriving from outside the process without throwing on a hostile property a
107
107
 
108
108
  In a guard table a `Shape` cell holds the type the guard narrows to.
109
109
 
110
- | Name | Kind | Shape | Summary |
111
- | --------------------- | -------- | ------------------- | ----------------------------------------------------- |
112
- | `isFile` | function | `FileInterface` | Narrows an unknown value to an immutable file record. |
113
- | `isWorkspaceSnapshot` | function | `WorkspaceSnapshot` | Narrows an unknown value to a workspace snapshot. |
110
+ | Name | Kind | Signature | Summary |
111
+ | --------------------- | -------- | ------------------------------------------------ | ----------------------------------------------------- |
112
+ | `isFile` | function | `(value: unknown) => value is FileInterface` | Narrows an unknown value to an immutable file record. |
113
+ | `isWorkspaceSnapshot` | function | `(value: unknown) => value is WorkspaceSnapshot` | Narrows an unknown value to a workspace snapshot. |
114
114
 
115
115
  ### Factories
116
116
 
@@ -135,12 +135,12 @@ The implementing classes, from [`Workspace.ts`](../src/core/workspaces/Workspace
135
135
  [`DatabaseWorkspaceStore.ts`](../src/core/workspaces/stores/DatabaseWorkspaceStore.ts) — each
136
136
  documented in full under its own heading following this table.
137
137
 
138
- | Name | Kind | Summary |
139
- | ------------------------ | ----- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
140
- | `Workspace` | class | Implements `WorkspaceInterface` over one insertion-ordered path map the instance owns, projecting fresh arrays on every read. Whole-file edits create text files, ranged edits operate only on existing text files, and binary files remain available through construction-time hydration. Mutations emit after the file map has changed. |
141
- | `WorkspaceManager` | class | Implements `WorkspaceManagerInterface` over an insertion-ordered id map and one active id the instance owns, resolving `active` through that map on every read and holding no emitter. A supplied store adds lenient snapshot `open` and `save` operations. Event defaults flow into workspaces created through the registry, while observability remains owned by each workspace. |
142
- | `MemoryWorkspaceStore` | class | Holds workspace snapshots in the current process. |
143
- | `DatabaseWorkspaceStore` | class | Persists workspace snapshots in a database table. Snapshots occupy one opaque column and are narrowed when read back from the storage boundary. |
138
+ | Name | Kind | Signature | Summary |
139
+ | ------------------------ | ----- | ------------------------------------------------------------------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
140
+ | `Workspace` | class | `new (options?: WorkspaceOptions) => WorkspaceInterface` | Implements `WorkspaceInterface` over one insertion-ordered path map the instance owns, projecting fresh arrays on every read. Whole-file edits create text files, ranged edits operate only on existing text files, and binary files remain available through construction-time hydration. Mutations emit after the file map has changed. |
141
+ | `WorkspaceManager` | class | `new (options?: WorkspaceManagerOptions) => WorkspaceManagerInterface` | Implements `WorkspaceManagerInterface` over an insertion-ordered id map and one active id the instance owns, resolving `active` through that map on every read and holding no emitter. A supplied store adds lenient snapshot `open` and `save` operations. Event defaults flow into workspaces created through the registry, while observability remains owned by each workspace. |
142
+ | `MemoryWorkspaceStore` | class | `new () => WorkspaceStoreInterface` | Holds workspace snapshots in the current process. |
143
+ | `DatabaseWorkspaceStore` | class | `new (table: TableInterface<WorkspaceSnapshotRow>) => WorkspaceStoreInterface` | Persists workspace snapshots in a database table. Snapshots occupy one opaque column and are narrowed when read back from the storage boundary. |
144
144
 
145
145
  ### `Workspace`
146
146