@sublang/playbook 17.2.0 → 17.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +5 -2
- package/docs/cli.md +6 -5
- package/docs/configuration.md +72 -18
- package/docs/embedding.md +94 -0
- package/package.json +34 -5
- package/reference/sdlc/captain.md +6 -4
- package/reference/sdlc/captain.playbook/captain.fsm.d.ts +5 -0
- package/reference/sdlc/captain.playbook/captain.fsm.js +4 -3
- package/reference/sdlc/captain.playbook/captain.fsm.ts +9 -4
- package/reference/sdlc/captain.playbook/captain.gears.md +6 -3
- package/reference/sdlc/captain.playbook/captain.playbook.d.ts +2 -0
- package/reference/sdlc/captain.playbook/captain.playbook.js +7 -3
- package/reference/sdlc/captain.playbook/captain.playbook.ts +8 -4
- package/reference/sdlc/code.playbook/asset-types.d.ts +32 -0
- package/reference/sdlc/code.playbook/bin/launch-config.js +84 -31
- package/reference/sdlc/code.playbook/bin/playbook.js +5 -3
- package/reference/sdlc/code.playbook/bin/portable-codec.js +12 -5
- package/reference/sdlc/code.playbook/bin/run.js +74 -7
- package/reference/sdlc/code.playbook/bin/session-host.js +16 -4
- package/reference/sdlc/code.playbook/bin/session-media.js +46 -0
- package/reference/sdlc/code.playbook/bin/session-store.js +164 -25
- package/reference/sdlc/code.playbook/playbook-captain.d.ts +23 -4
- package/reference/sdlc/code.playbook/playbook-captain.js +188 -23
- package/reference/sdlc/code.playbook/playbook-captain.ts +223 -31
- package/reference/sdlc/code.playbook/playbook.config.template.yaml +22 -5
- package/reference/sdlc/code.playbook/session-assets.d.ts +53 -0
- package/reference/sdlc/code.playbook/session-assets.js +302 -0
- package/reference/sdlc/code.playbook/session-host.d.ts +9 -1
- package/reference/sdlc/code.playbook/session-store.d.ts +26 -2
- package/reference/sdlc/code.playbook/worker-evidence.d.ts +8 -0
- package/reference/sdlc/code.playbook/worker-evidence.js +51 -0
- package/reference/sdlc/inspect.md +40 -0
- package/reference/sdlc/inspect.playbook/inspect.fsm.d.ts +168 -0
- package/reference/sdlc/inspect.playbook/inspect.fsm.js +354 -0
- package/reference/sdlc/inspect.playbook/inspect.fsm.ts +455 -0
- package/reference/sdlc/inspect.playbook/inspect.gears.md +36 -0
- package/reference/sdlc/inspect.playbook/inspect.playbook.d.ts +17 -0
- package/reference/sdlc/inspect.playbook/inspect.playbook.js +142 -0
- package/reference/sdlc/inspect.playbook/inspect.playbook.ts +184 -0
- package/reference/sdlc/inspect.playbook/inspect.registry.d.ts +41 -0
- package/reference/sdlc/inspect.playbook/inspect.registry.js +51 -0
- package/reference/sdlc/inspect.playbook/inspect.registry.ts +110 -0
- package/slc/workflow-contracts.json +43 -1
package/README.md
CHANGED
|
@@ -29,7 +29,7 @@ Run `playbook` for an interactive tmux UI powered by [cligent](https://github.co
|
|
|
29
29
|
|
|
30
30
|
## Quick start
|
|
31
31
|
|
|
32
|
-
Out of the box, Playbook includes **CODE** for implementation, **REVIEW** for commit-based review and fixes, **DECIDE** for independently proposed and reviewed specification decisions, **DEV** for repository-aware planning of a development request, **BRANCH** for checking out a new branch for a GitHub issue,
|
|
32
|
+
Out of the box, Playbook includes **CODE** for implementation, **REVIEW** for commit-based review and fixes, **DECIDE** for independently proposed and reviewed specification decisions, **DEV** for repository-aware planning of a development request, **BRANCH** for checking out a new branch for a GitHub issue, **PR** for publishing, checking, and merging that branch through a pull request, and **INSPECT** for explaining supplied material or a running interface without changing the repository.
|
|
33
33
|
CODE and DECIDE call REVIEW as a nested playbook; DEV calls CODE, or DECIDE and then CODE, and wraps them in BRANCH and PR when the request names a GitHub issue or asks for a pull request.
|
|
34
34
|
|
|
35
35
|
The shared starter config selects one adapter for the Captain and all players
|
|
@@ -37,7 +37,8 @@ from locally visible credentials: Claude first, then Codex. If neither is
|
|
|
37
37
|
configured, it seeds Claude and prints a notice. CODE, REVIEW, DECIDE, BRANCH, and PR bind
|
|
38
38
|
their local roles explicitly to `dev.coder` and `dev.reviewer`, so nested and later
|
|
39
39
|
engagements share a conversation only where their bindings name the same
|
|
40
|
-
player ID; DEV's Analyst binds a distinct `dev.analyst` player
|
|
40
|
+
player ID; DEV's Analyst binds a distinct `dev.analyst` player and INSPECT's
|
|
41
|
+
Inspector binds `inspect.inspector`.
|
|
41
42
|
|
|
42
43
|
```sh
|
|
43
44
|
npm install -g @sublang/playbook
|
|
@@ -85,6 +86,8 @@ playbook run --session 4f2c0000-0000-4000-8000-000000009ab1 "continue"
|
|
|
85
86
|
|
|
86
87
|
If a step fails or needs preparation before your answer, ask Captain to fix the prerequisite and resume; see [Preparing a stopped step](docs/cli.md#preparing-a-stopped-step).
|
|
87
88
|
|
|
89
|
+
Use `/inspect` to analyze existing material or explain a running interface. Browser access requires explicitly enabling the Inspector’s [browser capability](docs/configuration.md#browser-capability). Embedded hosts can submit portable attachments and display saved native figures through the [asset and session APIs](docs/embedding.md#attachments-and-captured-evidence).
|
|
90
|
+
|
|
88
91
|
See [Using the CLI](docs/cli.md) for flags and durable continuation, [Configuring agents](docs/configuration.md) for the shared lineup, [Embedding](docs/embedding.md) for custom hosts, and the [changelog](https://github.com/sublang-ai/playbook/blob/main/CHANGELOG.md) for releases.
|
|
89
92
|
|
|
90
93
|
## Create your own playbook
|
package/docs/cli.md
CHANGED
|
@@ -202,8 +202,8 @@ The former positional `<from>`, `resume`, `--player`, `--captain`,
|
|
|
202
202
|
`--option`, `--cwd`, `--last`, run-only `--config`, and top-level `run:`
|
|
203
203
|
config are removed from `playbook run`. Enable a registry under `playbooks`,
|
|
204
204
|
declare provider agents once under top-level `players`, bind every local role
|
|
205
|
-
under `playbooks.<id>.roles`, tune compatible model, effort, fast mode,
|
|
206
|
-
subagent model in a `--with` overlay, invoke the effective `/command`, and run from the working directory
|
|
205
|
+
under `playbooks.<id>.roles`, tune compatible model, effort, fast mode,
|
|
206
|
+
subagent model, and subagent effort in a `--with` overlay, invoke the effective `/command`, and run from the working directory
|
|
207
207
|
you want agents to use. Legacy `playbooks.<id>.players` blocks are rejected and
|
|
208
208
|
are not auto-migrated because choosing equal or distinct new player IDs chooses
|
|
209
209
|
conversation sharing or isolation; see [Migrating per-playbook
|
|
@@ -280,9 +280,10 @@ competing front end fails closed instead of forking the history.
|
|
|
280
280
|
An ordinary reopen reads current config and any opening `--with` fragments,
|
|
281
281
|
projects them to the stored catalog and player roster, and requires the stored
|
|
282
282
|
role bindings plus every structural setting to remain exact. Compatible
|
|
283
|
-
current `model`, `effort`, and optional `fastMode
|
|
284
|
-
apply to the next call. Boolean `false` explicitly
|
|
285
|
-
|
|
283
|
+
current `model`, `effort`, and optional `fastMode`, `subagentModel`, and
|
|
284
|
+
`subagentEffort` settings apply to the next call. Boolean `false` explicitly
|
|
285
|
+
resets model, effort, subagent model, or subagent effort to the provider
|
|
286
|
+
default, but `fastMode: false` is a literal
|
|
286
287
|
disabled request; omission selects the provider default or inherits the player
|
|
287
288
|
value at a role binding.
|
|
288
289
|
Provider conversations are local hints. Missing hints start fresh from stored
|
package/docs/configuration.md
CHANGED
|
@@ -48,8 +48,8 @@ names, nesting, and ancestry never infer a binding.
|
|
|
48
48
|
|
|
49
49
|
Each `captain` or `players.<player-id>` value is either an adapter shorthand
|
|
50
50
|
(`claude`, `codex`) or a block carrying that agent's own `adapter`, `model`,
|
|
51
|
-
`effort`, `fastMode`, `subagentModel`, `instruction`, and
|
|
52
|
-
Settings are inline per stable agent
|
|
51
|
+
`effort`, `fastMode`, `subagentModel`, `subagentEffort`, `instruction`, and
|
|
52
|
+
`permissions`. Settings are inline per stable agent
|
|
53
53
|
([DR-021](https://github.com/sublang-ai/playbook/blob/main/specs/decisions/021-inline-agent-settings.md)).
|
|
54
54
|
Dots in a player ID are literal characters, not YAML hierarchy. Other adapter
|
|
55
55
|
IDs pass through to `tmux-play` with a warning because `playbook` cannot
|
|
@@ -102,6 +102,13 @@ players:
|
|
|
102
102
|
permissions:
|
|
103
103
|
mode: auto # protected auto mode for the Claude Analyst
|
|
104
104
|
|
|
105
|
+
inspect.inspector:
|
|
106
|
+
adapter: claude
|
|
107
|
+
model: claude-opus-5-5
|
|
108
|
+
effort: high
|
|
109
|
+
permissions:
|
|
110
|
+
mode: auto
|
|
111
|
+
|
|
105
112
|
playbooks:
|
|
106
113
|
code:
|
|
107
114
|
from: '@sublang/playbook/code/registry'
|
|
@@ -138,6 +145,11 @@ playbooks:
|
|
|
138
145
|
from: '@sublang/playbook/pr/registry'
|
|
139
146
|
roles:
|
|
140
147
|
coder: dev.coder
|
|
148
|
+
|
|
149
|
+
inspect:
|
|
150
|
+
from: '@sublang/playbook/inspect/registry'
|
|
151
|
+
roles:
|
|
152
|
+
inspector: inspect.inspector
|
|
141
153
|
```
|
|
142
154
|
|
|
143
155
|
The current bundled workflows accept no workflow-specific options.
|
|
@@ -157,7 +169,7 @@ roles:
|
|
|
157
169
|
```
|
|
158
170
|
|
|
159
171
|
Use a block to override only that role invocation's model, effort, fast mode,
|
|
160
|
-
or subagent
|
|
172
|
+
subagent model, or subagent effort:
|
|
161
173
|
|
|
162
174
|
```yaml
|
|
163
175
|
roles:
|
|
@@ -168,25 +180,41 @@ roles:
|
|
|
168
180
|
fastMode: false # literal disabled request, not a default sentinel
|
|
169
181
|
reviewer:
|
|
170
182
|
player: dev.reviewer
|
|
171
|
-
subagentModel:
|
|
183
|
+
subagentModel: inherit # inherit | <model> | false
|
|
184
|
+
subagentEffort: medium # <effort> | false
|
|
172
185
|
```
|
|
173
186
|
|
|
174
187
|
Omitting any override inherits that player's top-level default. For `model`,
|
|
175
|
-
`effort`, and `
|
|
176
|
-
explicitly, so a resumed conversation cannot accidentally
|
|
177
|
-
selection. For `fastMode`, `false` is a literal request to
|
|
178
|
-
omitting the top-level setting selects the provider default.
|
|
179
|
-
fast-mode boolean or subagent
|
|
180
|
-
reports as supporting it. A role binding cannot override adapter, instruction,
|
|
188
|
+
`effort`, `subagentModel`, and `subagentEffort`, boolean `false` selects the
|
|
189
|
+
provider default explicitly, so a resumed conversation cannot accidentally
|
|
190
|
+
retain an earlier selection. For `fastMode`, `false` is a literal request to
|
|
191
|
+
disable fast mode; omitting the top-level setting selects the provider default.
|
|
192
|
+
A present fast-mode boolean, subagent model, or subagent effort is accepted
|
|
193
|
+
only for adapters Cligent reports as supporting it. A role binding cannot override adapter, instruction,
|
|
181
194
|
permissions, workspace, or tool posture; those define the stable player
|
|
182
195
|
envelope, so an overriding model must be one that player's adapter serves.
|
|
183
196
|
|
|
184
|
-
|
|
185
|
-
|
|
197
|
+
`subagentModel` makes every subagent the agent starts run on one model —
|
|
198
|
+
`inherit` names the agent's own, a model name pins another, and `false` on a
|
|
199
|
+
`captain` or `players.<player-id>` block switches delegation off — and tells
|
|
200
|
+
the agent to hand well-defined, fine-grained tasks to its subagents while
|
|
186
201
|
keeping the deep thinking, reasoning, and design work itself, without lowering
|
|
187
202
|
the quality of what it delivers
|
|
188
203
|
([DR-075](https://github.com/sublang-ai/playbook/blob/main/specs/decisions/075-subagent-model-is-tuning.md)).
|
|
189
|
-
|
|
204
|
+
`subagentEffort`, any effort the adapter accepts other than `ultracode`, pins
|
|
205
|
+
the effort the agent's delegated work runs at; left unset, the agent chooses an
|
|
206
|
+
effort per task. On Claude, a pinned effort governs Cligent's `delegate`
|
|
207
|
+
subagent and the `general-purpose` one it replaces, while an unpinned agent's
|
|
208
|
+
choice runs through `delegate-<effort>` subagents and a call naming no type
|
|
209
|
+
runs `general-purpose` at `medium`; `Explore` and `Plan` are never replaced and
|
|
210
|
+
keep the agent's own effort
|
|
211
|
+
([Cligent DR-029](https://github.com/sublang-ai/cligent/blob/main/specs/decisions/029-subagent-effort.md)).
|
|
212
|
+
An agent whose adapter serves a subagent model (Claude today) and whose block
|
|
213
|
+
leaves `subagentModel` unset resolves to `inherit`: it delegates by default.
|
|
214
|
+
The launcher resolves this on its own copy and never rewrites your config, and
|
|
215
|
+
the starter config names neither field
|
|
216
|
+
([DR-076](https://github.com/sublang-ai/playbook/blob/main/specs/decisions/076-subagents-delegate-by-default.md)).
|
|
217
|
+
|
|
190
218
|
|
|
191
219
|
## Sharing, isolation, and concurrency
|
|
192
220
|
|
|
@@ -246,6 +274,30 @@ Claude Code auth or `ANTHROPIC_API_KEY`; `codex` with local Codex CLI
|
|
|
246
274
|
auth or `OPENAI_API_KEY`. A known adapter that is not ready blocks the
|
|
247
275
|
launch and prints the help text.
|
|
248
276
|
|
|
277
|
+
## Browser capability
|
|
278
|
+
|
|
279
|
+
A Captain or player agent block may set `browser: true` to make Cligent's managed
|
|
280
|
+
browser tools available to working calls. Existing configurations default to
|
|
281
|
+
false. This is an execution capability: reopening the same settled session with a
|
|
282
|
+
changed value applies it to the next accepted turn. Recovery of an uncertain turn
|
|
283
|
+
uses that attempt's recorded value. Agent permissions remain fixed and retain
|
|
284
|
+
their native precedence.
|
|
285
|
+
|
|
286
|
+
Ordinary Captain decisions, replies, question checks and judges always receive
|
|
287
|
+
`browser: false` and an empty MCP configuration. Enabling Browser does not turn
|
|
288
|
+
them into working actors. A working player, or bounded recovery preparation when
|
|
289
|
+
needed, can use the capability explicitly configured for its agent. An embedding
|
|
290
|
+
application should use Cligent's capability and browser-preparation APIs before
|
|
291
|
+
enabling its Browser control and report setup failures; Playbook does not invent a
|
|
292
|
+
successful setup or change permissions to make it succeed.
|
|
293
|
+
|
|
294
|
+
For browser inspection, enable `browser: true` on `players.inspect.inspector`
|
|
295
|
+
and ask `/inspect Open http://localhost:3000, capture a screenshot, and explain
|
|
296
|
+
the navigation.` Keep the application running and give its exact address. The
|
|
297
|
+
Inspector uses actual tool results and native images, asks about missing targets,
|
|
298
|
+
and reports unavailable evidence explicitly. Browser capture supports web pages;
|
|
299
|
+
it does not grant arbitrary operating-system desktop control.
|
|
300
|
+
|
|
249
301
|
## Per-launch overlays
|
|
250
302
|
|
|
251
303
|
To retune one launch without editing the file, overlay a fragment in
|
|
@@ -279,6 +331,7 @@ playbooks:
|
|
|
279
331
|
coder:
|
|
280
332
|
player: dev.coder
|
|
281
333
|
effort: low
|
|
334
|
+
subagentEffort: high # its delegates still run at high effort
|
|
282
335
|
```
|
|
283
336
|
|
|
284
337
|
The global file is never modified, and `--with` is not forwarded to
|
|
@@ -286,9 +339,10 @@ The global file is never modified, and `--with` is not forwarded to
|
|
|
286
339
|
Overlays apply when creating a fresh session and as current-config input for a
|
|
287
340
|
compatible ordinary reopen. A selected session keeps its stored catalog,
|
|
288
341
|
player roster, role bindings, adapter, instruction, permissions, and working
|
|
289
|
-
directory; only model, effort, fast mode,
|
|
290
|
-
next call reapplies both complete model and effort selections,
|
|
291
|
-
effective fast-mode boolean, and the optional effective subagent
|
|
342
|
+
directory; only model, effort, fast mode, subagent model, and subagent effort
|
|
343
|
+
may change. The next call reapplies both complete model and effort selections,
|
|
344
|
+
the optional effective fast-mode boolean, and the optional effective subagent
|
|
345
|
+
model and subagent effort. An uncertain retry accepts no tuning overlay and only restores and reports the recorded attempt. Later turns use the current compatible settings.
|
|
292
346
|
|
|
293
347
|
## Session storage
|
|
294
348
|
|
|
@@ -329,8 +383,8 @@ public UUID. Presentation-only fields are inert headlessly.
|
|
|
329
383
|
An ordinary reopen reads current config and opening overlays, but first
|
|
330
384
|
projects them to the stored playbooks and referenced players. An unrelated new
|
|
331
385
|
entry cannot enter or invalidate the session. Structural drift fails closed;
|
|
332
|
-
compatible model, effort, fast-mode,
|
|
333
|
-
next provider call. Legacy record, shell, runtime-snapshot, and trace schemas are rejected
|
|
386
|
+
compatible model, effort, fast-mode, subagent-model, or subagent-effort
|
|
387
|
+
changes apply on the next provider call. Legacy record, shell, runtime-snapshot, and trace schemas are rejected
|
|
334
388
|
rather than having role or player identity guessed.
|
|
335
389
|
|
|
336
390
|
## External playbooks
|
package/docs/embedding.md
CHANGED
|
@@ -492,3 +492,97 @@ contracts. Their JavaScript module exports are internal implementation details
|
|
|
492
492
|
and carry no SemVer compatibility guarantee.
|
|
493
493
|
The initializer requires further semantic compilation and verification
|
|
494
494
|
before its output is runnable.
|
|
495
|
+
|
|
496
|
+
## Attachments and captured evidence
|
|
497
|
+
|
|
498
|
+
The shared host accepts `handleBossTurn({ text, attachments })` as well as a plain
|
|
499
|
+
string. Keep the user's text exact. Import uploads through the controller's
|
|
500
|
+
existing lease before submitting the turn; portable references contain a content
|
|
501
|
+
hash, MIME type, byte count and optional display name, never a machine path.
|
|
502
|
+
|
|
503
|
+
```ts
|
|
504
|
+
const reference = await controller.lease.importAsset({
|
|
505
|
+
path: stagedUploadPath,
|
|
506
|
+
mimeType: 'image/png',
|
|
507
|
+
name: 'Reference screen.png',
|
|
508
|
+
});
|
|
509
|
+
await controller.handleBossTurn({
|
|
510
|
+
text: 'Compare the running interface with this reference.',
|
|
511
|
+
attachments: [reference],
|
|
512
|
+
});
|
|
513
|
+
```
|
|
514
|
+
|
|
515
|
+
An empty text with attachments is accepted, recorded and answered with a host-owned
|
|
516
|
+
clarification. It makes no model call and fabricates no instruction. Captain can
|
|
517
|
+
then explicitly select the pending attachment IDs for the clarified request.
|
|
518
|
+
Omitted selection means only uploads from the current turn. Working engagements
|
|
519
|
+
retain selected references, and nested calls inherit their parent's snapshot;
|
|
520
|
+
finishing, dismissing or starting unrelated work does not implicitly reuse them.
|
|
521
|
+
Captain decisions, judges and closing replies see metadata only. A capable worker
|
|
522
|
+
receives the actual selected files; unavailable required evidence fails that call
|
|
523
|
+
explicitly, without requiring the controller's provider to support the same media.
|
|
524
|
+
|
|
525
|
+
Observe the `SessionRecord` union from `@sublang/playbook/session-assets` or
|
|
526
|
+
`@sublang/playbook/session-host`. `turn_started.turn.attachments` preserves input
|
|
527
|
+
references. A `playbook_evidence` record carries a saved output asset with its turn,
|
|
528
|
+
call and player or preparation origin; present it in the main conversation.
|
|
529
|
+
Duplicate content is promoted once per call. Native worker `media` events remain
|
|
530
|
+
in the worker lane, using `playbook-asset:<assetId>` URIs after persistence. Hidden
|
|
531
|
+
controller traffic is never promoted as visible evidence. URI-only native media
|
|
532
|
+
is preserved without fetching remote URLs or reading arbitrary local files.
|
|
533
|
+
|
|
534
|
+
Tool-result output JSON larger than 4096 UTF-8 bytes becomes
|
|
535
|
+
`{ type: 'asset_reference', asset }`; retrieve and decode the original JSON when a
|
|
536
|
+
user opens its details. Base64 media is stored outside replay lines. An unavailable
|
|
537
|
+
or oversized output is reported explicitly instead of being replayed inline.
|
|
538
|
+
These host projections do not alter the native agent's own tool-result reasoning.
|
|
539
|
+
|
|
540
|
+
Use `shared.openAsset(sessionId, reference)` for verified bounded reads and close
|
|
541
|
+
the returned reader in `finally`. `shared.readAsset()` reads a whole asset, and
|
|
542
|
+
`describeAsset()` looks up a descriptor by ID. The default per-asset maximum is
|
|
543
|
+
100 MiB; hosts may impose smaller upload or turn limits. `exportBundle()` returns
|
|
544
|
+
exact manifest bytes, the checkpoint's exact replay prefix and verified relative
|
|
545
|
+
asset entries. Copy all of them together. Session deletion removes only that
|
|
546
|
+
session's asset owner; copies in other owners remain independent. All hosts sharing
|
|
547
|
+
the store must support the optional asset inventory before writing it.
|
|
548
|
+
|
|
549
|
+
For uploads awaiting a session, draft work or direct authoring calls, use
|
|
550
|
+
`createAssetStore({ directory })` from `@sublang/playbook/session-assets` under your
|
|
551
|
+
own owner lifetime and writer coordination. Its `prepare()` validates ownership
|
|
552
|
+
and tightens Git-restored permissions without changing bytes. `copyAsset()` imports
|
|
553
|
+
verified content into another owner. `externalizeAgentEvent(store, event)` shares
|
|
554
|
+
the same native-media and large-tool-result ingestion boundary with authoring;
|
|
555
|
+
it returns the projected event and, for native media, its asset reference. Handle
|
|
556
|
+
persistence failures explicitly, and never save the original large payload as a
|
|
557
|
+
fallback.
|
|
558
|
+
|
|
559
|
+
Captured native media also becomes evidence for still-active parent workflows in the same engagement, so a parent can continue reasoning about a child's figure. Newly submitted Boss attachments stay scoped to the addressed worker; neither kind is implicitly inherited by unrelated later work.
|
|
560
|
+
|
|
561
|
+
Before adopting asset-bearing sessions, upgrade every Playbook CLI and embedded SDK that shares the store and stop all older writers. Older readers tolerating unknown replay records does not make older writers compatible: they may discard additive asset metadata on save.
|
|
562
|
+
|
|
563
|
+
Accepted visible worker prose also reaches Captain as attributed, quoted observations, separately from effect and completion facts. Reports keep up to 8192 rendered characters each and 24576 across the latest accepted observations, labeling truncated or omitted content; full text stays in the durable ledger. Interrupted reporting uses an exact producing-boundary reference saved with the player result. Older progress without that reference contributes no inferred report, and recovery never reruns a worker merely to recreate its prose.
|
|
564
|
+
|
|
565
|
+
## Live tool approvals
|
|
566
|
+
|
|
567
|
+
`openSessionHost` and `createCaptainSessionHost` accept an ephemeral
|
|
568
|
+
`approvalHandler(envelope, { signal })` callback. Its exported
|
|
569
|
+
`TmuxPlayApprovalRequest` envelope contains the original native `request`, the
|
|
570
|
+
persisted `turnId`, the concrete `actorId`, and a fresh `invocationId` for that
|
|
571
|
+
working call. Return `allow_once` or `deny`; an application should bind its own
|
|
572
|
+
session or draft identity in the callback closure and stop showing a request
|
|
573
|
+
when its signal aborts. Hidden control and tool-free calls receive no callback.
|
|
574
|
+
|
|
575
|
+
The callback is never configuration or model input. Native request/response
|
|
576
|
+
events remain historical actor records, and reopening does not make an old
|
|
577
|
+
request actionable. Native provider limits and OS dialogs still apply; a tool
|
|
578
|
+
approval cannot grant an operating-system permission. Controller disposal denies
|
|
579
|
+
pending requests before draining work and releasing the session lease. Without a
|
|
580
|
+
handler, adapters retain their native fail-closed behavior.
|
|
581
|
+
|
|
582
|
+
This callback handles tool consent independently of tool or application names.
|
|
583
|
+
Native questions, forms, and URL authentication require separate typed response
|
|
584
|
+
transports; a later Boss reply cannot answer a native callback still waiting
|
|
585
|
+
inside the current call. A workflow can instead return its declared Boss-question
|
|
586
|
+
outcome and resume after a reply, including a request to perform an external
|
|
587
|
+
prerequisite. The reply is an acknowledgement; the working agent must check the
|
|
588
|
+
prerequisite before claiming that it is satisfied.
|
package/package.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sublang/playbook",
|
|
3
|
-
"version": "17.
|
|
3
|
+
"version": "17.4.0",
|
|
4
4
|
"type": "module",
|
|
5
|
-
"description": "Composable XState v5 playbook runtime with compiled Captain, CODE, REVIEW, DECIDE, DEV, BRANCH, and
|
|
5
|
+
"description": "Composable XState v5 playbook runtime with compiled Captain, CODE, REVIEW, DECIDE, DEV, BRANCH, PR, and INSPECT workflows driven by GEARS specs.",
|
|
6
6
|
"license": "Apache-2.0",
|
|
7
7
|
"homepage": "https://github.com/sublang-ai/playbook#readme",
|
|
8
8
|
"repository": {
|
|
@@ -146,7 +146,24 @@
|
|
|
146
146
|
"reference/sdlc/code.playbook/session-host.js",
|
|
147
147
|
"reference/sdlc/code.playbook/session-host.d.ts",
|
|
148
148
|
"reference/sdlc/code.playbook/bin/portable-codec.js",
|
|
149
|
-
"reference/sdlc/code.playbook/bin/session-host.js"
|
|
149
|
+
"reference/sdlc/code.playbook/bin/session-host.js",
|
|
150
|
+
"reference/sdlc/code.playbook/session-assets.js",
|
|
151
|
+
"reference/sdlc/code.playbook/session-assets.d.ts",
|
|
152
|
+
"reference/sdlc/code.playbook/bin/session-media.js",
|
|
153
|
+
"reference/sdlc/code.playbook/asset-types.d.ts",
|
|
154
|
+
"reference/sdlc/code.playbook/worker-evidence.js",
|
|
155
|
+
"reference/sdlc/code.playbook/worker-evidence.d.ts",
|
|
156
|
+
"reference/sdlc/inspect.md",
|
|
157
|
+
"reference/sdlc/inspect.playbook/inspect.gears.md",
|
|
158
|
+
"reference/sdlc/inspect.playbook/inspect.fsm.ts",
|
|
159
|
+
"reference/sdlc/inspect.playbook/inspect.fsm.js",
|
|
160
|
+
"reference/sdlc/inspect.playbook/inspect.fsm.d.ts",
|
|
161
|
+
"reference/sdlc/inspect.playbook/inspect.playbook.ts",
|
|
162
|
+
"reference/sdlc/inspect.playbook/inspect.playbook.js",
|
|
163
|
+
"reference/sdlc/inspect.playbook/inspect.playbook.d.ts",
|
|
164
|
+
"reference/sdlc/inspect.playbook/inspect.registry.ts",
|
|
165
|
+
"reference/sdlc/inspect.playbook/inspect.registry.js",
|
|
166
|
+
"reference/sdlc/inspect.playbook/inspect.registry.d.ts"
|
|
150
167
|
],
|
|
151
168
|
"bin": {
|
|
152
169
|
"playbook": "reference/sdlc/code.playbook/bin/playbook.js"
|
|
@@ -228,12 +245,24 @@
|
|
|
228
245
|
"./session-host": {
|
|
229
246
|
"types": "./reference/sdlc/code.playbook/session-host.d.ts",
|
|
230
247
|
"default": "./reference/sdlc/code.playbook/session-host.js"
|
|
248
|
+
},
|
|
249
|
+
"./session-assets": {
|
|
250
|
+
"types": "./reference/sdlc/code.playbook/session-assets.d.ts",
|
|
251
|
+
"default": "./reference/sdlc/code.playbook/session-assets.js"
|
|
252
|
+
},
|
|
253
|
+
"./inspect/playbook": {
|
|
254
|
+
"types": "./reference/sdlc/inspect.playbook/inspect.playbook.d.ts",
|
|
255
|
+
"default": "./reference/sdlc/inspect.playbook/inspect.playbook.js"
|
|
256
|
+
},
|
|
257
|
+
"./inspect/registry": {
|
|
258
|
+
"types": "./reference/sdlc/inspect.playbook/inspect.registry.d.ts",
|
|
259
|
+
"default": "./reference/sdlc/inspect.playbook/inspect.registry.js"
|
|
231
260
|
}
|
|
232
261
|
},
|
|
233
262
|
"scripts": {
|
|
234
263
|
"build": "tsc",
|
|
235
264
|
"test": "spex lint && vitest run --exclude src/cligent-release-capabilities.test.ts && vitest run src/cligent-release-capabilities.test.ts",
|
|
236
|
-
"test:acceptance": "
|
|
265
|
+
"test:acceptance": "node scripts/run-live-acceptance.mjs",
|
|
237
266
|
"smoke:release": "node scripts/release-smoke.mjs",
|
|
238
267
|
"check:links": "node scripts/check-links.mjs",
|
|
239
268
|
"playbook": "node reference/sdlc/code.playbook/bin/playbook.js"
|
|
@@ -243,7 +272,7 @@
|
|
|
243
272
|
"provenance": true
|
|
244
273
|
},
|
|
245
274
|
"dependencies": {
|
|
246
|
-
"@sublang/cligent": "^0.
|
|
275
|
+
"@sublang/cligent": "^0.33.1",
|
|
247
276
|
"@sublang/spex": "^3.0.0",
|
|
248
277
|
"p-queue": "^9.3.1",
|
|
249
278
|
"xstate": "^5.19.4",
|
|
@@ -8,7 +8,7 @@ It has no players beyond Boss and Captain.
|
|
|
8
8
|
It declares the session-scoped controller policy: a session Captain that runs for the whole host session, receives every Boss turn, and operates the working playbooks from outside the engagement stack.
|
|
9
9
|
Captain is the controller, not the specialist that performs the requested work.
|
|
10
10
|
A `recover` action authorizes a separate host-owned Captain preparation call to repair prerequisites within Boss's instructions before the runtime continues the interrupted leaf; this controller's own calls remain tool-free.
|
|
11
|
-
Captain shall decide each turn only from the exact Boss text, the supplied ControlView and catalog digests, and its remembered session conversation, without investigating the task, inspecting the workspace, using tools, or relying on ambient project evidence.
|
|
11
|
+
Captain shall decide each turn only from the exact Boss text, the supplied ControlView and catalog digests, supplied attachment and evidence metadata, and its remembered session conversation, without investigating the task, inspecting the workspace, using tools, or relying on ambient project evidence.
|
|
12
12
|
|
|
13
13
|
At runtime the host supplies an immutable catalog of enabled callable playbooks; each entry contains only a stable playbook id, its command, and its intent.
|
|
14
14
|
The catalog is immutable host input for the session; Boss events and Captain decisions cannot replace it.
|
|
@@ -57,6 +57,7 @@ When Boss submits a turn that the host's command parse did not resolve, Captain
|
|
|
57
57
|
> `{ "action": "runtime", "actionId": … }` — apply the runtime action `actionId` names, only when the ControlView digest currently advertises it and only on Boss's explicit recovery or resume request.
|
|
58
58
|
> `{ "action": "recover" }` — prepare the interrupted leaf and continue it when recovery preparation is advertised and the task should continue. Task authorization includes necessary cleanup and preparation. Ask Boss only for missing decisions, authority, or an incomplete or contradictory playbook. Ordinary answers use `deliver`; a retry requiring no preparation uses `runtime`.
|
|
59
59
|
> Honor explicit Boss intent first. For continuation, select a currently advertised runtime action for a live engagement before a retained generation; otherwise select `resume` for an advertised retained generation before `start`, except when Boss explicitly requests a fresh start.
|
|
60
|
+
> For `start`, `switch`, or `deliver`, optionally include `attachmentIds: [...]` selecting only supplied opaque asset identifiers relevant to the agreed request. Omission selects only attachments submitted in the current Boss turn. Select earlier pending attachments explicitly when Boss clarifies or says to proceed; never include unrelated prior material. Attachment metadata is not evidence that you viewed its bytes.
|
|
60
61
|
> Preserve Boss's intended outcome and constraints; give `start` and `switch` a complete standalone request containing only the context the target needs.
|
|
61
62
|
> For an intent needing several workflows, plan conversationally across turns: select at most one action now and propose or revise later steps in your replies as outcomes arrive.
|
|
62
63
|
> Keep the reply to 60 words unless extra words are essential to preserve choices, constraints, or result evidence.
|
|
@@ -66,13 +67,14 @@ When Boss submits a turn that the host's command parse did not resolve, Captain
|
|
|
66
67
|
Results:
|
|
67
68
|
- `respond`: Captain settled the turn in this decision call; the validated text is the turn's captain speech. Output shall include `text: <the complete captain reply>`.
|
|
68
69
|
- `resume`: Captain selected resuming an advertised retained generation. Output shall include `playbookId: <stable catalog id>`.
|
|
69
|
-
- `start`: Captain selected starting an enabled playbook. Output shall include `playbookId: <stable catalog id>` and `input: <one nonempty complete standalone request>`.
|
|
70
|
-
- `switch`: Captain selected replacing the active engagement. Output shall include `playbookId: <stable catalog id>` and `input: <one nonempty complete standalone request>`.
|
|
70
|
+
- `start`: Captain selected starting an enabled playbook. Output shall include `playbookId: <stable catalog id>` and `input: <one nonempty complete standalone request>`, and may include `attachmentIds: <unique array of supplied opaque asset identifiers>`.
|
|
71
|
+
- `switch`: Captain selected replacing the active engagement. Output shall include `playbookId: <stable catalog id>` and `input: <one nonempty complete standalone request>`, and may include `attachmentIds: <unique array of supplied opaque asset identifiers>`.
|
|
71
72
|
- `dismiss`: Captain selected stopping the active engagement; the selection carries no payload field.
|
|
72
|
-
- `deliver`: Captain selected handing the turn to the working playbook; the host is authoritative for the delivered text, so the selection carries no
|
|
73
|
+
- `deliver`: Captain selected handing the turn to the working playbook; the host is authoritative for the delivered text, so the selection carries no text field and may include only `attachmentIds: <unique array of supplied opaque asset identifiers>`.
|
|
73
74
|
- `runtime`: Captain selected one advertised runtime action. Output shall include `actionId: <advertised action id>`.
|
|
74
75
|
- `recover`: Captain selected preparing the interrupted leaf and continuing it; the selection carries no payload field.
|
|
75
76
|
|
|
77
|
+
An `attachmentIds` value must be an array of unique strings, each exactly `sha256:` followed by 64 lowercase hexadecimal digits; the host independently validates availability and scope.
|
|
76
78
|
The compiled decision result guards are exactly `respond`, `resume`, `start`, `switch`, `dismiss`, `deliver`, `runtime`, and `recover`, respectively, with those payload fields; these names are part of this default playbook's stable machine contract.
|
|
77
79
|
As decision and reply evidence the machine retains only a settlement's status, its canonical outcome-report facts, its exact bounded `unresolvedEffects` list, its optional rejection reason, the receipt disposition with its reason or a compact `{ name, message }` error, and the leaf-state summary; it never retains a playbook session id, call id, child state, stack ledger, resume token, repository path or projection, internal effect-envelope data, aggregate conversation or recovery transcript, or opaque runtime result.
|
|
78
80
|
|
|
@@ -22,8 +22,10 @@ export type ParsedActingDecision = {
|
|
|
22
22
|
readonly action: 'start' | 'switch';
|
|
23
23
|
readonly playbookId: string;
|
|
24
24
|
readonly input: string;
|
|
25
|
+
readonly attachmentIds?: readonly string[];
|
|
25
26
|
} | {
|
|
26
27
|
readonly action: 'deliver';
|
|
28
|
+
readonly attachmentIds?: readonly string[];
|
|
27
29
|
};
|
|
28
30
|
/** Compact `{ name, message }` error evidence (never a raw Error). */
|
|
29
31
|
export type CompactError = {
|
|
@@ -96,17 +98,20 @@ export type CaptainOutput = {
|
|
|
96
98
|
readonly guard: 'start';
|
|
97
99
|
readonly playbookId: string;
|
|
98
100
|
readonly input: string;
|
|
101
|
+
readonly attachmentIds?: readonly string[];
|
|
99
102
|
readonly settlement: SettlementEvidence;
|
|
100
103
|
} | {
|
|
101
104
|
readonly guard: 'switch';
|
|
102
105
|
readonly playbookId: string;
|
|
103
106
|
readonly input: string;
|
|
107
|
+
readonly attachmentIds?: readonly string[];
|
|
104
108
|
readonly settlement: SettlementEvidence;
|
|
105
109
|
} | {
|
|
106
110
|
readonly guard: 'dismiss' | 'recover';
|
|
107
111
|
readonly settlement: SettlementEvidence;
|
|
108
112
|
} | {
|
|
109
113
|
readonly guard: 'deliver';
|
|
114
|
+
readonly attachmentIds?: readonly string[];
|
|
110
115
|
readonly settlement: SettlementEvidence;
|
|
111
116
|
} | {
|
|
112
117
|
readonly guard: 'runtime';
|
|
@@ -30,6 +30,7 @@ const DECISION_PROMPT = [
|
|
|
30
30
|
"`{ \"action\": \"runtime\", \"actionId\": … }` — apply the runtime action `actionId` names, only when the ControlView digest currently advertises it and only on Boss's explicit recovery or resume request.",
|
|
31
31
|
'`{ "action": "recover" }` — prepare the interrupted leaf and continue it when recovery preparation is advertised and the task should continue. Task authorization includes necessary cleanup and preparation. Ask Boss only for missing decisions, authority, or an incomplete or contradictory playbook. Ordinary answers use `deliver`; a retry requiring no preparation uses `runtime`.',
|
|
32
32
|
'Honor explicit Boss intent first. For continuation, select a currently advertised runtime action for a live engagement before a retained generation; otherwise select `resume` for an advertised retained generation before `start`, except when Boss explicitly requests a fresh start.',
|
|
33
|
+
"For `start`, `switch`, or `deliver`, optionally include `attachmentIds: [...]` selecting only supplied opaque asset identifiers relevant to the agreed request. Omission selects only attachments submitted in the current Boss turn. Select earlier pending attachments explicitly when Boss clarifies or says to proceed; never include unrelated prior material. Attachment metadata is not evidence that you viewed its bytes.",
|
|
33
34
|
"Preserve Boss's intended outcome and constraints; give `start` and `switch` a complete standalone request containing only the context the target needs.",
|
|
34
35
|
'For an intent needing several workflows, plan conversationally across turns: select at most one action now and propose or revise later steps in your replies as outcomes arrive.',
|
|
35
36
|
'Keep the reply to 60 words unless extra words are essential to preserve choices, constraints, or result evidence.',
|
|
@@ -65,10 +66,10 @@ const CLOSING_REPLY_PROMPT = [
|
|
|
65
66
|
const DECISION_RESULTS = {
|
|
66
67
|
respond: "Captain settled the turn in this decision call; the validated text is the turn's captain speech. Output shall include `text: <the complete captain reply>`.",
|
|
67
68
|
resume: 'Captain selected resuming an advertised retained generation. Output shall include `playbookId: <stable catalog id>`.',
|
|
68
|
-
start:
|
|
69
|
-
switch:
|
|
69
|
+
start: "Captain selected starting an enabled playbook. Output shall include `playbookId: <stable catalog id>` and `input: <one nonempty complete standalone request>`, and may include `attachmentIds: <unique array of supplied opaque asset identifiers>`.",
|
|
70
|
+
switch: "Captain selected replacing the active engagement. Output shall include `playbookId: <stable catalog id>` and `input: <one nonempty complete standalone request>`, and may include `attachmentIds: <unique array of supplied opaque asset identifiers>`.",
|
|
70
71
|
dismiss: 'Captain selected stopping the active engagement; the selection carries no payload field.',
|
|
71
|
-
deliver:
|
|
72
|
+
deliver: "Captain selected handing the turn to the working playbook; the host is authoritative for the delivered text, so the selection carries no text field and may include only `attachmentIds: <unique array of supplied opaque asset identifiers>`.",
|
|
72
73
|
runtime: 'Captain selected one advertised runtime action. Output shall include `actionId: <advertised action id>`.',
|
|
73
74
|
recover: 'Captain selected preparing the interrupted leaf and continuing it; the selection carries no payload field.',
|
|
74
75
|
};
|
|
@@ -55,8 +55,9 @@ export type ParsedActingDecision =
|
|
|
55
55
|
readonly action: 'start' | 'switch';
|
|
56
56
|
readonly playbookId: string;
|
|
57
57
|
readonly input: string;
|
|
58
|
+
readonly attachmentIds?: readonly string[];
|
|
58
59
|
}
|
|
59
|
-
| { readonly action: 'deliver' };
|
|
60
|
+
| { readonly action: 'deliver'; readonly attachmentIds?: readonly string[] };
|
|
60
61
|
|
|
61
62
|
/** Compact `{ name, message }` error evidence (never a raw Error). */
|
|
62
63
|
export type CompactError = {
|
|
@@ -147,12 +148,14 @@ export type CaptainOutput =
|
|
|
147
148
|
readonly guard: 'start';
|
|
148
149
|
readonly playbookId: string;
|
|
149
150
|
readonly input: string;
|
|
151
|
+
readonly attachmentIds?: readonly string[];
|
|
150
152
|
readonly settlement: SettlementEvidence;
|
|
151
153
|
}
|
|
152
154
|
| {
|
|
153
155
|
readonly guard: 'switch';
|
|
154
156
|
readonly playbookId: string;
|
|
155
157
|
readonly input: string;
|
|
158
|
+
readonly attachmentIds?: readonly string[];
|
|
156
159
|
readonly settlement: SettlementEvidence;
|
|
157
160
|
}
|
|
158
161
|
| {
|
|
@@ -161,6 +164,7 @@ export type CaptainOutput =
|
|
|
161
164
|
}
|
|
162
165
|
| {
|
|
163
166
|
readonly guard: 'deliver';
|
|
167
|
+
readonly attachmentIds?: readonly string[];
|
|
164
168
|
readonly settlement: SettlementEvidence;
|
|
165
169
|
}
|
|
166
170
|
| {
|
|
@@ -238,6 +242,7 @@ const DECISION_PROMPT = [
|
|
|
238
242
|
"`{ \"action\": \"runtime\", \"actionId\": … }` — apply the runtime action `actionId` names, only when the ControlView digest currently advertises it and only on Boss's explicit recovery or resume request.",
|
|
239
243
|
'`{ "action": "recover" }` — prepare the interrupted leaf and continue it when recovery preparation is advertised and the task should continue. Task authorization includes necessary cleanup and preparation. Ask Boss only for missing decisions, authority, or an incomplete or contradictory playbook. Ordinary answers use `deliver`; a retry requiring no preparation uses `runtime`.',
|
|
240
244
|
'Honor explicit Boss intent first. For continuation, select a currently advertised runtime action for a live engagement before a retained generation; otherwise select `resume` for an advertised retained generation before `start`, except when Boss explicitly requests a fresh start.',
|
|
245
|
+
"For `start`, `switch`, or `deliver`, optionally include `attachmentIds: [...]` selecting only supplied opaque asset identifiers relevant to the agreed request. Omission selects only attachments submitted in the current Boss turn. Select earlier pending attachments explicitly when Boss clarifies or says to proceed; never include unrelated prior material. Attachment metadata is not evidence that you viewed its bytes.",
|
|
241
246
|
"Preserve Boss's intended outcome and constraints; give `start` and `switch` a complete standalone request containing only the context the target needs.",
|
|
242
247
|
'For an intent needing several workflows, plan conversationally across turns: select at most one action now and propose or revise later steps in your replies as outcomes arrive.',
|
|
243
248
|
'Keep the reply to 60 words unless extra words are essential to preserve choices, constraints, or result evidence.',
|
|
@@ -279,13 +284,13 @@ const DECISION_RESULTS = {
|
|
|
279
284
|
resume:
|
|
280
285
|
'Captain selected resuming an advertised retained generation. Output shall include `playbookId: <stable catalog id>`.',
|
|
281
286
|
start:
|
|
282
|
-
|
|
287
|
+
"Captain selected starting an enabled playbook. Output shall include `playbookId: <stable catalog id>` and `input: <one nonempty complete standalone request>`, and may include `attachmentIds: <unique array of supplied opaque asset identifiers>`.",
|
|
283
288
|
switch:
|
|
284
|
-
|
|
289
|
+
"Captain selected replacing the active engagement. Output shall include `playbookId: <stable catalog id>` and `input: <one nonempty complete standalone request>`, and may include `attachmentIds: <unique array of supplied opaque asset identifiers>`.",
|
|
285
290
|
dismiss:
|
|
286
291
|
'Captain selected stopping the active engagement; the selection carries no payload field.',
|
|
287
292
|
deliver:
|
|
288
|
-
|
|
293
|
+
"Captain selected handing the turn to the working playbook; the host is authoritative for the delivered text, so the selection carries no text field and may include only `attachmentIds: <unique array of supplied opaque asset identifiers>`.",
|
|
289
294
|
runtime:
|
|
290
295
|
'Captain selected one advertised runtime action. Output shall include `actionId: <advertised action id>`.',
|
|
291
296
|
recover:
|
|
@@ -3,6 +3,8 @@
|
|
|
3
3
|
|
|
4
4
|
# Captain GEARS
|
|
5
5
|
|
|
6
|
+
An `attachmentIds` value must be an array of unique strings, each exactly `sha256:` followed by 64 lowercase hexadecimal digits; the host independently validates availability and scope.
|
|
7
|
+
|
|
6
8
|
### CAPTAIN-1
|
|
7
9
|
|
|
8
10
|
Where this is the default generic Captain playbook — the session Captain, with no players beyond Boss and Captain — declaring the session-scoped controller policy of a session Captain that runs for the whole host session, receives every Boss turn, and operates the working playbooks from outside the engagement stack without performing the requested work itself, where the host supplies an immutable catalog of enabled callable playbooks whose entries contain only a stable playbook id, its command, and its intent and which Boss events and Captain decisions cannot replace, where a `start`, `resume`, or `switch` selection shall name only an id in that catalog and never this Captain playbook itself, where Captain shall decide each turn only from the exact Boss text, the supplied ControlView and catalog digests, and its remembered session conversation, without investigating the task, inspecting the workspace, using tools, or relying on ambient project evidence, where this call runs hidden on the host's one durable session conversation whose resume token the host pins and rotates, where the host composes and appends the labeled Boss-message, ControlView digest, and catalog digest blocks this prompt references and this playbook composes no digest itself, where Source deliberately places the one `{ action, … }` JSON reply contract in this hidden controller call's acting prompt, where the linked runtime validates the decision reply against the declared result contract — known action, required payload fields, catalog membership, never this Captain playbook itself as a target — and issues exactly one corrective re-ask for a malformed reply, where a second malformed reply settles the turn as a Boss-appropriate failure reply with no action executed and the engagement stack untouched and the machine returns to its hub for the next turn, where per Boss turn the linked runtime submits at most one validated selection through the host-supplied controller port and treats the returned settlement — status, outcome-report facts, optional rejection reason, optional receipt, and leaf-state summary — as the only evidence of effects while the host supplies its separately counted activity only to the result-phase prompt, where the host owns validation and execution of effects and a rejected selection executes no action, where every settlement is final for its turn so an action is never submitted again after the controller returns `ok`, `rejected`, or `failed`, where a turn the host's deterministic command parse resolved enters with its decision already made — the injected parse-resolved decision object is that turn's decision, no decision call occurs, and an acting parse-resolved decision follows the same validation, execution, outcome report, and closing reply as a model-decided acting turn — and where as decision and reply evidence the machine retains only a settlement's status, its outcome-report facts, its optional rejection reason, the receipt disposition with its reason or a compact `{ name, message }` error, and the leaf-state summary and never retains a playbook session id, call id, child state, stack ledger, resume token, or opaque runtime result, when Boss submits a turn that the host's command parse did not resolve, Captain shall decide the turn by selecting exactly one action:
|
|
@@ -24,6 +26,7 @@ Where this is the default generic Captain playbook — the session Captain, with
|
|
|
24
26
|
> `{ "action": "runtime", "actionId": … }` — apply the runtime action `actionId` names, only when the ControlView digest currently advertises it and only on Boss's explicit recovery or resume request.
|
|
25
27
|
> `{ "action": "recover" }` — prepare the interrupted leaf and continue it when recovery preparation is advertised and the task should continue. Task authorization includes necessary cleanup and preparation. Ask Boss only for missing decisions, authority, or an incomplete or contradictory playbook. Ordinary answers use `deliver`; a retry requiring no preparation uses `runtime`.
|
|
26
28
|
> Honor explicit Boss intent first. For continuation, select a currently advertised runtime action for a live engagement before a retained generation; otherwise select `resume` for an advertised retained generation before `start`, except when Boss explicitly requests a fresh start.
|
|
29
|
+
> For `start`, `switch`, or `deliver`, optionally include `attachmentIds: [...]` selecting only supplied opaque asset identifiers relevant to the agreed request. Omission selects only attachments submitted in the current Boss turn. Select earlier pending attachments explicitly when Boss clarifies or says to proceed; never include unrelated prior material. Attachment metadata is not evidence that you viewed its bytes.
|
|
27
30
|
> Preserve Boss's intended outcome and constraints; give `start` and `switch` a complete standalone request containing only the context the target needs.
|
|
28
31
|
> For an intent needing several workflows, plan conversationally across turns: select at most one action now and propose or revise later steps in your replies as outcomes arrive.
|
|
29
32
|
> Keep the reply to 60 words unless extra words are essential to preserve choices, constraints, or result evidence.
|
|
@@ -33,10 +36,10 @@ Where this is the default generic Captain playbook — the session Captain, with
|
|
|
33
36
|
Results:
|
|
34
37
|
- `respond`: Captain settled the turn in this decision call; the validated text is the turn's captain speech. Output shall include `text: <the complete captain reply>`.
|
|
35
38
|
- `resume`: Captain selected resuming an advertised retained generation. Output shall include `playbookId: <stable catalog id>`.
|
|
36
|
-
- `start`: Captain selected starting an enabled playbook. Output shall include `playbookId: <stable catalog id>` and `input: <one nonempty complete standalone request>`.
|
|
37
|
-
- `switch`: Captain selected replacing the active engagement. Output shall include `playbookId: <stable catalog id>` and `input: <one nonempty complete standalone request>`.
|
|
39
|
+
- `start`: Captain selected starting an enabled playbook. Output shall include `playbookId: <stable catalog id>` and `input: <one nonempty complete standalone request>`, and may include `attachmentIds: <unique array of supplied opaque asset identifiers>`.
|
|
40
|
+
- `switch`: Captain selected replacing the active engagement. Output shall include `playbookId: <stable catalog id>` and `input: <one nonempty complete standalone request>`, and may include `attachmentIds: <unique array of supplied opaque asset identifiers>`.
|
|
38
41
|
- `dismiss`: Captain selected stopping the active engagement; the selection carries no payload field.
|
|
39
|
-
- `deliver`: Captain selected handing the turn to the working playbook; the host is authoritative for the delivered text, so the selection carries no
|
|
42
|
+
- `deliver`: Captain selected handing the turn to the working playbook; the host is authoritative for the delivered text, so the selection carries no text field and may include only `attachmentIds: <unique array of supplied opaque asset identifiers>`.
|
|
40
43
|
- `runtime`: Captain selected one advertised runtime action. Output shall include `actionId: <advertised action id>`.
|
|
41
44
|
- `recover`: Captain selected preparing the interrupted leaf and continuing it; the selection carries no payload field.
|
|
42
45
|
|
|
@@ -17,10 +17,12 @@ export type CaptainControllerSelection = {
|
|
|
17
17
|
readonly playbookId: string;
|
|
18
18
|
/** Complete standalone request synthesized from the remembered Boss conversation. */
|
|
19
19
|
readonly input: CaptainControllerInput;
|
|
20
|
+
readonly attachmentIds?: readonly string[];
|
|
20
21
|
} | {
|
|
21
22
|
readonly action: 'dismiss' | 'recover';
|
|
22
23
|
} | {
|
|
23
24
|
readonly action: 'deliver';
|
|
25
|
+
readonly attachmentIds?: readonly string[];
|
|
24
26
|
} | {
|
|
25
27
|
readonly action: 'runtime';
|
|
26
28
|
readonly actionId: string;
|