@sublang/playbook 13.0.0 → 13.2.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 +7 -5
- package/docs/cli.md +28 -9
- package/docs/configuration.md +21 -5
- package/docs/embedding.md +1 -1
- package/package.json +41 -3
- package/reference/sdlc/branch.md +37 -0
- package/reference/sdlc/branch.playbook/branch.fsm.d.ts +169 -0
- package/reference/sdlc/branch.playbook/branch.fsm.js +325 -0
- package/reference/sdlc/branch.playbook/branch.fsm.ts +458 -0
- package/reference/sdlc/branch.playbook/branch.gears.md +44 -0
- package/reference/sdlc/branch.playbook/branch.playbook.d.ts +20 -0
- package/reference/sdlc/branch.playbook/branch.playbook.js +121 -0
- package/reference/sdlc/branch.playbook/branch.playbook.ts +217 -0
- package/reference/sdlc/branch.playbook/branch.registry.d.ts +40 -0
- package/reference/sdlc/branch.playbook/branch.registry.js +63 -0
- package/reference/sdlc/branch.playbook/branch.registry.ts +121 -0
- package/reference/sdlc/code.md +7 -0
- package/reference/sdlc/code.playbook/code.fsm.js +5 -5
- package/reference/sdlc/code.playbook/code.fsm.ts +5 -5
- package/reference/sdlc/code.playbook/code.gears.md +5 -5
- package/reference/sdlc/code.playbook/code.playbook.d.ts +1 -1
- package/reference/sdlc/code.playbook/code.playbook.js +6 -16
- package/reference/sdlc/code.playbook/code.playbook.ts +7 -17
- package/reference/sdlc/code.playbook/playbook-captain.js +4 -1
- package/reference/sdlc/code.playbook/playbook-captain.ts +4 -1
- package/reference/sdlc/code.playbook/playbook.config.template.yaml +16 -2
- package/reference/sdlc/decide.md +2 -0
- package/reference/sdlc/decide.playbook/decide.fsm.js +1 -1
- package/reference/sdlc/decide.playbook/decide.fsm.ts +1 -1
- package/reference/sdlc/decide.playbook/decide.gears.md +2 -2
- package/reference/sdlc/decide.playbook/decide.playbook.d.ts +1 -2
- package/reference/sdlc/decide.playbook/decide.playbook.js +8 -22
- package/reference/sdlc/decide.playbook/decide.playbook.ts +8 -25
- package/reference/sdlc/dev.md +45 -4
- package/reference/sdlc/dev.playbook/dev.fsm.d.ts +100 -9
- package/reference/sdlc/dev.playbook/dev.fsm.js +245 -28
- package/reference/sdlc/dev.playbook/dev.fsm.ts +381 -37
- package/reference/sdlc/dev.playbook/dev.gears.md +60 -22
- package/reference/sdlc/dev.playbook/dev.playbook.d.ts +1 -1
- package/reference/sdlc/dev.playbook/dev.playbook.js +20 -18
- package/reference/sdlc/dev.playbook/dev.playbook.ts +21 -21
- package/reference/sdlc/dev.playbook/dev.registry.d.ts +1 -1
- package/reference/sdlc/dev.playbook/dev.registry.js +7 -2
- package/reference/sdlc/dev.playbook/dev.registry.ts +7 -2
- package/reference/sdlc/pr.md +108 -0
- package/reference/sdlc/pr.playbook/pr.fsm.d.ts +352 -0
- package/reference/sdlc/pr.playbook/pr.fsm.js +902 -0
- package/reference/sdlc/pr.playbook/pr.fsm.ts +1251 -0
- package/reference/sdlc/pr.playbook/pr.gears.md +155 -0
- package/reference/sdlc/pr.playbook/pr.playbook.d.ts +27 -0
- package/reference/sdlc/pr.playbook/pr.playbook.js +133 -0
- package/reference/sdlc/pr.playbook/pr.playbook.ts +235 -0
- package/reference/sdlc/pr.playbook/pr.registry.d.ts +40 -0
- package/reference/sdlc/pr.playbook/pr.registry.js +68 -0
- package/reference/sdlc/pr.playbook/pr.registry.ts +124 -0
- package/reference/sdlc/review.md +18 -0
- package/reference/sdlc/review.playbook/review.fsm.js +8 -8
- package/reference/sdlc/review.playbook/review.fsm.ts +8 -8
- package/reference/sdlc/review.playbook/review.gears.md +8 -8
- package/reference/sdlc/review.playbook/review.playbook.d.ts +1 -1
- package/reference/sdlc/review.playbook/review.playbook.js +5 -15
- package/reference/sdlc/review.playbook/review.playbook.ts +6 -16
- package/slc/link.md +12 -24
- package/src/runtime.d.ts +2 -0
- package/src/runtime.ts +2 -0
- package/src/xstate-playbook-runtime.d.ts +4 -2
- package/src/xstate-playbook-runtime.js +18 -13
- package/src/xstate-playbook-runtime.ts +26 -14
package/README.md
CHANGED
|
@@ -29,13 +29,14 @@ 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,
|
|
33
|
-
CODE and DECIDE call REVIEW as a nested playbook.
|
|
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, and **PR** for publishing, checking, and merging that branch through a pull request.
|
|
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 uses Claude as both Captain and the `dev.coder`
|
|
36
|
-
player, and Codex as `dev.reviewer`. CODE, REVIEW, and
|
|
37
|
-
roles explicitly to those two stable players, so nested and later
|
|
38
|
-
share a conversation only where their bindings name the same
|
|
36
|
+
player, and Codex as `dev.reviewer`. CODE, REVIEW, DECIDE, BRANCH, and PR bind
|
|
37
|
+
their local roles explicitly to those two stable players, so nested and later
|
|
38
|
+
engagements share a conversation only where their bindings name the same
|
|
39
|
+
player ID; DEV's Analyst binds a distinct `dev.analyst` player.
|
|
39
40
|
|
|
40
41
|
```sh
|
|
41
42
|
npm install -g @sublang/playbook
|
|
@@ -50,6 +51,7 @@ Prerequisites:
|
|
|
50
51
|
- Node.js >= 20.6.0
|
|
51
52
|
- Authenticated [Claude Code](https://docs.anthropic.com/en/docs/claude-code/overview) or `ANTHROPIC_API_KEY`
|
|
52
53
|
- Authenticated [Codex CLI](https://github.com/openai/codex) or `OPENAI_API_KEY`
|
|
54
|
+
- [GitHub CLI](https://cli.github.com/) (`gh`) authenticated for the repository's GitHub remote, for `/branch`, `/pr`, and `/dev` requests that name an issue or ask for a pull request
|
|
53
55
|
|
|
54
56
|
Interactive `playbook` additionally needs tmux 3.3 or newer and [`glow`](https://github.com/charmbracelet/glow#installation) on `PATH`; headless `playbook run` does not.
|
|
55
57
|
|
package/docs/cli.md
CHANGED
|
@@ -105,8 +105,8 @@ its exit status or signal and exit `127` when it cannot be spawned
|
|
|
105
105
|
|
|
106
106
|
The Boss pane starts at the Playbook Captain shell, where the session
|
|
107
107
|
Captain runs for the whole session and sees every turn. Use `/code`,
|
|
108
|
-
`/review`, `/decide`, or `/
|
|
109
|
-
bundled playbooks explicitly. A registered command resolves deterministically,
|
|
108
|
+
`/review`, `/decide`, `/dev`, `/branch`, or `/pr` followed by a task to
|
|
109
|
+
select one of the bundled playbooks explicitly. A registered command resolves deterministically,
|
|
110
110
|
with no model call parsing it: at idle it starts that playbook, at its
|
|
111
111
|
own leaf it delivers the rest of the line, an enabled command absent
|
|
112
112
|
from the active path switches to it, and a bare command answers with
|
|
@@ -121,11 +121,25 @@ untouched
|
|
|
121
121
|
([[playbook-captain-1](https://github.com/sublang-ai/playbook/blob/main/specs/packages/playbook-captain.md#playbook-captain-1)],
|
|
122
122
|
[[playbook-captain-2](https://github.com/sublang-ai/playbook/blob/main/specs/packages/playbook-captain.md#playbook-captain-2)]).
|
|
123
123
|
|
|
124
|
-
The current CODE, REVIEW, DECIDE, and
|
|
125
|
-
initial event from the selecting Boss turn. CODE and DECIDE then
|
|
126
|
-
as a nested playbook, while DEV — the repository-aware planner
|
|
127
|
-
`/dev` — analyzes a development request and itself calls CODE, or
|
|
128
|
-
then CODE, as nested playbooks.
|
|
124
|
+
The current CODE, REVIEW, DECIDE, DEV, BRANCH, and PR workflows take their
|
|
125
|
+
deterministic initial event from the selecting Boss turn. CODE and DECIDE then
|
|
126
|
+
call REVIEW as a nested playbook, while DEV — the repository-aware planner
|
|
127
|
+
behind `/dev` — analyzes a development request and itself calls CODE, or
|
|
128
|
+
DECIDE and then CODE, as nested playbooks. When the request names a GitHub
|
|
129
|
+
issue or asks for pull-request delivery, DEV reads the issue and its comments
|
|
130
|
+
while planning, calls BRANCH before that path and PR after CODE succeeds, and
|
|
131
|
+
ends with a merged pull request and a closed issue — or with a named failure
|
|
132
|
+
that leaves the pull request open for a later `/pr`. Both are usable on their
|
|
133
|
+
own: `/branch <issue or request>` creates and checks out `issue-N-slug` (or a
|
|
134
|
+
request slug) at the current commit, changing nothing else; `/pr` pushes the
|
|
135
|
+
checked-out branch, opens or reuses its pull request against the default
|
|
136
|
+
branch, waits for the checks, fixes red checks through one nested CODE call,
|
|
137
|
+
merges with a merge commit, and fast-forwards the local default branch. A
|
|
138
|
+
repository without checks merges on CODE's nested review alone. BRANCH, PR,
|
|
139
|
+
and issue-aware DEV planning require the GitHub CLI `gh`, authenticated for
|
|
140
|
+
the repository's GitHub remote
|
|
141
|
+
([DR-050](https://github.com/sublang-ai/playbook/blob/main/specs/decisions/050-pull-request-delivery.md)).
|
|
142
|
+
Local role names do not imply continuity: each frame
|
|
129
143
|
uses the exact stable player IDs configured under its `roles` map. Equal IDs
|
|
130
144
|
share one pane and provider conversation across nested and later root
|
|
131
145
|
engagements; distinct IDs remain isolated even when their agent settings are
|
|
@@ -333,8 +347,13 @@ For each governed player call, Playbook records a Git baseline before the call
|
|
|
333
347
|
and a durable receipt afterward. CODE and DECIDE commit arms, and REVIEW's
|
|
334
348
|
Coder commit arm, accept a commit only when the receipt proves exactly one
|
|
335
349
|
descendant commit with no residual repository change; REVIEW's Reviewer calls,
|
|
336
|
-
DECIDE's proposal calls,
|
|
337
|
-
repository to remain exact
|
|
350
|
+
DECIDE's proposal calls, every DEV Analyst planning call, BRANCH's Coder call,
|
|
351
|
+
and PR's Coder call require the repository to remain exact — a new branch at
|
|
352
|
+
the current commit, a push, and an opened pull request change neither HEAD's
|
|
353
|
+
commit nor the working tree, and BRANCH takes its base revision from that
|
|
354
|
+
receipt rather than from the Coder. PR's check waits, fix publication, merge,
|
|
355
|
+
and fast-forward are agent-free script steps outside governance; the merge is
|
|
356
|
+
the one step that moves HEAD, onto the default branch. The
|
|
338
357
|
player's prose, including any `Commit:` line, is presentation rather than
|
|
339
358
|
proof.
|
|
340
359
|
|
package/docs/configuration.md
CHANGED
|
@@ -113,6 +113,20 @@ playbooks:
|
|
|
113
113
|
from: '@sublang/playbook/dev/registry'
|
|
114
114
|
roles:
|
|
115
115
|
analyst: dev.analyst
|
|
116
|
+
|
|
117
|
+
# Pull-request delivery for DEV. BRANCH and PR bind Coder to the same
|
|
118
|
+
# dev.coder player as CODE and REVIEW on purpose: the Coder that read the
|
|
119
|
+
# issue and named the branch makes the commits and then describes them in
|
|
120
|
+
# the pull request. Change an id to isolate its conversation.
|
|
121
|
+
branch:
|
|
122
|
+
from: '@sublang/playbook/branch/registry'
|
|
123
|
+
roles:
|
|
124
|
+
coder: dev.coder
|
|
125
|
+
|
|
126
|
+
pr:
|
|
127
|
+
from: '@sublang/playbook/pr/registry'
|
|
128
|
+
roles:
|
|
129
|
+
coder: dev.coder
|
|
116
130
|
```
|
|
117
131
|
|
|
118
132
|
The current bundled workflows accept no workflow-specific options.
|
|
@@ -156,11 +170,13 @@ those define the stable player envelope.
|
|
|
156
170
|
|
|
157
171
|
Two bindings that name the same player ID deliberately share one sequential
|
|
158
172
|
provider conversation throughout the logical Captain session — across nested
|
|
159
|
-
calls, returns, and later root engagements. CODE's
|
|
160
|
-
therefore share `dev.coder` in the starter
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
173
|
+
calls, returns, and later root engagements. CODE's, REVIEW's, BRANCH's, and
|
|
174
|
+
PR's `coder` roles therefore share `dev.coder` in the starter — so on a `/dev`
|
|
175
|
+
pull-request path the Coder that read the issue and named the branch makes the
|
|
176
|
+
commits and then describes them in the pull request — and DECIDE and its
|
|
177
|
+
nested REVIEW share both starter players. DEV's `analyst` instead binds the
|
|
178
|
+
distinct `dev.analyst` player, so planning context does not bleed into the
|
|
179
|
+
shared review conversation. Disposal of one playbook frame does not clear that
|
|
164
180
|
session ledger.
|
|
165
181
|
|
|
166
182
|
Two distinct player IDs stay isolated even when their agent blocks are
|
package/docs/embedding.md
CHANGED
|
@@ -20,7 +20,7 @@ semver-stable surface (`PlayerResult`, `PlaybookPorts`,
|
|
|
20
20
|
`PlayerCallOptions`, `PlayerSessionStore`, `CaptainCallOptions`, `CaptainResult`,
|
|
21
21
|
`PlaybookTraceEvent`, and `PlaybookRuntimeFactory`) that imports no CODE
|
|
22
22
|
or FSM types, so a host satisfies it once and inherits every playbook.
|
|
23
|
-
The generated CODE, REVIEW, and
|
|
23
|
+
The generated CODE, REVIEW, DECIDE, DEV, BRANCH, and PR modules re-export their shared
|
|
24
24
|
runtime contract types from their public `playbook` subpaths;
|
|
25
25
|
`PlaybookRuntimeFactory` is available from `@sublang/playbook/runtime`.
|
|
26
26
|
|
package/package.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sublang/playbook",
|
|
3
|
-
"version": "13.
|
|
3
|
+
"version": "13.2.0",
|
|
4
4
|
"type": "module",
|
|
5
|
-
"description": "Composable XState v5 playbook runtime with compiled Captain, CODE, REVIEW, DECIDE, and
|
|
5
|
+
"description": "Composable XState v5 playbook runtime with compiled Captain, CODE, REVIEW, DECIDE, DEV, BRANCH, and PR workflows driven by GEARS specs.",
|
|
6
6
|
"license": "Apache-2.0",
|
|
7
7
|
"homepage": "https://github.com/sublang-ai/playbook#readme",
|
|
8
8
|
"repository": {
|
|
@@ -46,6 +46,8 @@
|
|
|
46
46
|
"reference/sdlc/review.md",
|
|
47
47
|
"reference/sdlc/decide.md",
|
|
48
48
|
"reference/sdlc/dev.md",
|
|
49
|
+
"reference/sdlc/branch.md",
|
|
50
|
+
"reference/sdlc/pr.md",
|
|
49
51
|
"reference/sdlc/captain.playbook/captain.gears.md",
|
|
50
52
|
"reference/sdlc/captain.playbook/captain.fsm.ts",
|
|
51
53
|
"reference/sdlc/captain.playbook/captain.fsm.js",
|
|
@@ -113,6 +115,26 @@
|
|
|
113
115
|
"reference/sdlc/dev.playbook/dev.registry.ts",
|
|
114
116
|
"reference/sdlc/dev.playbook/dev.registry.js",
|
|
115
117
|
"reference/sdlc/dev.playbook/dev.registry.d.ts",
|
|
118
|
+
"reference/sdlc/branch.playbook/branch.gears.md",
|
|
119
|
+
"reference/sdlc/branch.playbook/branch.fsm.ts",
|
|
120
|
+
"reference/sdlc/branch.playbook/branch.fsm.js",
|
|
121
|
+
"reference/sdlc/branch.playbook/branch.fsm.d.ts",
|
|
122
|
+
"reference/sdlc/branch.playbook/branch.playbook.ts",
|
|
123
|
+
"reference/sdlc/branch.playbook/branch.playbook.js",
|
|
124
|
+
"reference/sdlc/branch.playbook/branch.playbook.d.ts",
|
|
125
|
+
"reference/sdlc/branch.playbook/branch.registry.ts",
|
|
126
|
+
"reference/sdlc/branch.playbook/branch.registry.js",
|
|
127
|
+
"reference/sdlc/branch.playbook/branch.registry.d.ts",
|
|
128
|
+
"reference/sdlc/pr.playbook/pr.gears.md",
|
|
129
|
+
"reference/sdlc/pr.playbook/pr.fsm.ts",
|
|
130
|
+
"reference/sdlc/pr.playbook/pr.fsm.js",
|
|
131
|
+
"reference/sdlc/pr.playbook/pr.fsm.d.ts",
|
|
132
|
+
"reference/sdlc/pr.playbook/pr.playbook.ts",
|
|
133
|
+
"reference/sdlc/pr.playbook/pr.playbook.js",
|
|
134
|
+
"reference/sdlc/pr.playbook/pr.playbook.d.ts",
|
|
135
|
+
"reference/sdlc/pr.playbook/pr.registry.ts",
|
|
136
|
+
"reference/sdlc/pr.playbook/pr.registry.js",
|
|
137
|
+
"reference/sdlc/pr.playbook/pr.registry.d.ts",
|
|
116
138
|
"docs",
|
|
117
139
|
"reference/sdlc/code.playbook/session-host.js",
|
|
118
140
|
"reference/sdlc/code.playbook/session-host.d.ts",
|
|
@@ -180,6 +202,22 @@
|
|
|
180
202
|
"types": "./reference/sdlc/dev.playbook/dev.registry.d.ts",
|
|
181
203
|
"default": "./reference/sdlc/dev.playbook/dev.registry.js"
|
|
182
204
|
},
|
|
205
|
+
"./branch/playbook": {
|
|
206
|
+
"types": "./reference/sdlc/branch.playbook/branch.playbook.d.ts",
|
|
207
|
+
"default": "./reference/sdlc/branch.playbook/branch.playbook.js"
|
|
208
|
+
},
|
|
209
|
+
"./branch/registry": {
|
|
210
|
+
"types": "./reference/sdlc/branch.playbook/branch.registry.d.ts",
|
|
211
|
+
"default": "./reference/sdlc/branch.playbook/branch.registry.js"
|
|
212
|
+
},
|
|
213
|
+
"./pr/playbook": {
|
|
214
|
+
"types": "./reference/sdlc/pr.playbook/pr.playbook.d.ts",
|
|
215
|
+
"default": "./reference/sdlc/pr.playbook/pr.playbook.js"
|
|
216
|
+
},
|
|
217
|
+
"./pr/registry": {
|
|
218
|
+
"types": "./reference/sdlc/pr.playbook/pr.registry.d.ts",
|
|
219
|
+
"default": "./reference/sdlc/pr.playbook/pr.registry.js"
|
|
220
|
+
},
|
|
183
221
|
"./session-host": {
|
|
184
222
|
"types": "./reference/sdlc/code.playbook/session-host.d.ts",
|
|
185
223
|
"default": "./reference/sdlc/code.playbook/session-host.js"
|
|
@@ -198,7 +236,7 @@
|
|
|
198
236
|
"provenance": true
|
|
199
237
|
},
|
|
200
238
|
"dependencies": {
|
|
201
|
-
"@sublang/cligent": "^0.
|
|
239
|
+
"@sublang/cligent": "^0.26.0",
|
|
202
240
|
"@sublang/spex": "^3.0.0",
|
|
203
241
|
"p-queue": "^9.3.1",
|
|
204
242
|
"xstate": "^5.19.4",
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
<!-- SPDX-License-Identifier: Apache-2.0 -->
|
|
2
|
+
<!-- SPDX-FileCopyrightText: 2026 SubLang International <https://sublang.ai> -->
|
|
3
|
+
<!-- AI agents: do not edit this file without human approval. -->
|
|
4
|
+
|
|
5
|
+
# Branch
|
|
6
|
+
|
|
7
|
+
Roles:
|
|
8
|
+
|
|
9
|
+
- Coder
|
|
10
|
+
|
|
11
|
+
The caller supplies a development request that names a GitHub issue (number or URL) or, when no issue is named, describes the work, together with any relevant context.
|
|
12
|
+
|
|
13
|
+
`branch` prepares pull-request delivery of one development request: it creates and checks out a new branch at the current commit.
|
|
14
|
+
It changes no files and owns no repository commit.
|
|
15
|
+
|
|
16
|
+
When the caller gives the request, Captain shall relay the complete caller input in quotes (`>`) to Coder, along with the following instruction:
|
|
17
|
+
|
|
18
|
+
> Original request: <caller-input>
|
|
19
|
+
|
|
20
|
+
```markdown
|
|
21
|
+
Prepare a new branch for this work without changing any file or making any commit.
|
|
22
|
+
Identify the GitHub issue the request names, if any, and read it with its comments (`gh issue view --comments` with the issue number).
|
|
23
|
+
If the request could refer to more than one issue, or does not say which work to branch for, ask Boss before creating anything.
|
|
24
|
+
Confirm that the working tree is clean and that `gh` is authenticated for the repository's GitHub remote.
|
|
25
|
+
Name the branch `issue-N-short-kebab-slug` for issue number N, otherwise a short kebab-case slug of the request.
|
|
26
|
+
Create the branch from the current commit and check it out; do not pull, reset, stash, or move HEAD to another commit.
|
|
27
|
+
Report the exact branch name, the commit it was created from, and a concise summary of the issue and its comments, or of the request when no issue is named.
|
|
28
|
+
If the working tree is not clean, `gh` is not authenticated, the named issue does not exist or cannot be read, or a branch with that name already exists locally or on the remote, create nothing and report the failure with its reason.
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
The result has two semantic outcomes: branched and refused, plus the Boss question when the request is ambiguous about the issue or work it means.
|
|
32
|
+
Each outcome requires affirmative support in Coder's result; the absence of a reported obstacle is not support for branched, and no outcome depends on a fixed presentation format of Coder's reply.
|
|
33
|
+
Every outcome keeps the repository exact: a new branch at the current commit changes neither HEAD's commit nor the working tree.
|
|
34
|
+
Captain shall take the base revision from repository authority, not from Coder's prose.
|
|
35
|
+
|
|
36
|
+
For branched, `branch` is complete and returns the exact branch name, the exact base revision, and the issue summary to its caller.
|
|
37
|
+
For refused, `branch` fails and reports Coder's complete result with its reason to its caller; no branch was created.
|
|
@@ -0,0 +1,169 @@
|
|
|
1
|
+
export type BranchStateId = 'createBranch';
|
|
2
|
+
export type BranchSourceItem = 'BRANCH-1';
|
|
3
|
+
export type PendingBossQuestion = {
|
|
4
|
+
readonly questionId: 'createBranch';
|
|
5
|
+
readonly resumeStateId: 'createBranch';
|
|
6
|
+
readonly sourceItem: 'BRANCH-1';
|
|
7
|
+
readonly asker: {
|
|
8
|
+
readonly kind: 'role';
|
|
9
|
+
readonly roleId: 'coder';
|
|
10
|
+
};
|
|
11
|
+
readonly question: string;
|
|
12
|
+
};
|
|
13
|
+
export type PlayerInput = {
|
|
14
|
+
readonly stateId: 'createBranch';
|
|
15
|
+
readonly role: 'coder';
|
|
16
|
+
readonly sourceItem: 'BRANCH-1';
|
|
17
|
+
readonly prompt: string;
|
|
18
|
+
readonly result: Readonly<Record<string, string>>;
|
|
19
|
+
readonly callerInput: string;
|
|
20
|
+
readonly pendingBossQuestion?: PendingBossQuestion;
|
|
21
|
+
readonly bossReply?: string;
|
|
22
|
+
};
|
|
23
|
+
export type PlayerOutput = {
|
|
24
|
+
readonly guard: 'branched';
|
|
25
|
+
readonly branch: string;
|
|
26
|
+
/**
|
|
27
|
+
* Receipt-owned effect evidence (DR-045): the branching call's
|
|
28
|
+
* `unchanged` receipt observes the commit the branch was created from
|
|
29
|
+
* as HEAD, so the linked runtime injects it and never takes it from
|
|
30
|
+
* Coder's prose.
|
|
31
|
+
*/
|
|
32
|
+
readonly baseRevision: string;
|
|
33
|
+
readonly issueSummary: string;
|
|
34
|
+
} | {
|
|
35
|
+
readonly guard: 'refused';
|
|
36
|
+
readonly coderOutput: string;
|
|
37
|
+
} | {
|
|
38
|
+
readonly guard: 'needsBossReply';
|
|
39
|
+
readonly question: string;
|
|
40
|
+
};
|
|
41
|
+
export type BranchPlaybookOutput = {
|
|
42
|
+
readonly status: 'branched';
|
|
43
|
+
/** Exact name of the new branch now checked out. */
|
|
44
|
+
readonly branch: string;
|
|
45
|
+
/** Exact receipt-observed revision the branch was created from. */
|
|
46
|
+
readonly baseRevision: string;
|
|
47
|
+
/** Coder's concise summary of the issue and its comments, or of the request. */
|
|
48
|
+
readonly issueSummary: string;
|
|
49
|
+
} | {
|
|
50
|
+
readonly status: 'refused';
|
|
51
|
+
/** Coder's complete report carrying the reason no branch was created. */
|
|
52
|
+
readonly coderOutput: string;
|
|
53
|
+
};
|
|
54
|
+
export type BranchInput = Readonly<Record<string, never>>;
|
|
55
|
+
export type BranchContext = {
|
|
56
|
+
readonly callerInput?: string;
|
|
57
|
+
readonly branch?: string;
|
|
58
|
+
/** Observed HEAD of the branching call's unchanged receipt (DR-045). */
|
|
59
|
+
readonly baseRevision?: string;
|
|
60
|
+
readonly issueSummary?: string;
|
|
61
|
+
readonly coderOutput?: string;
|
|
62
|
+
readonly completion?: 'branched' | 'refused';
|
|
63
|
+
readonly lastError?: unknown;
|
|
64
|
+
readonly pendingBossQuestion?: PendingBossQuestion;
|
|
65
|
+
readonly bossReply?: string;
|
|
66
|
+
};
|
|
67
|
+
export type BranchEvent = {
|
|
68
|
+
readonly type: 'START_BRANCH';
|
|
69
|
+
readonly callerInput: string;
|
|
70
|
+
} | {
|
|
71
|
+
readonly type: 'BOSS_REPLY';
|
|
72
|
+
readonly answer: string;
|
|
73
|
+
readonly questionId?: 'createBranch';
|
|
74
|
+
};
|
|
75
|
+
export declare const branchMachine: import("xstate").StateMachine<BranchContext, {
|
|
76
|
+
readonly type: "START_BRANCH";
|
|
77
|
+
readonly callerInput: string;
|
|
78
|
+
} | {
|
|
79
|
+
readonly type: "BOSS_REPLY";
|
|
80
|
+
readonly answer: string;
|
|
81
|
+
readonly questionId?: "createBranch";
|
|
82
|
+
}, {
|
|
83
|
+
[x: string]: import("xstate").ActorRefFromLogic<import("xstate").PromiseActorLogic<PlayerOutput, PlayerInput, import("xstate").EventObject>> | undefined;
|
|
84
|
+
}, {
|
|
85
|
+
src: "player";
|
|
86
|
+
logic: import("xstate").PromiseActorLogic<PlayerOutput, PlayerInput, import("xstate").EventObject>;
|
|
87
|
+
id: string | undefined;
|
|
88
|
+
}, {
|
|
89
|
+
type: "playbook.acceptedOutcome";
|
|
90
|
+
params: {
|
|
91
|
+
readonly source: string;
|
|
92
|
+
readonly target: string;
|
|
93
|
+
readonly acceptedOutcome: string;
|
|
94
|
+
};
|
|
95
|
+
} | {
|
|
96
|
+
type: "rememberActorError";
|
|
97
|
+
params: import("xstate").NonReducibleUnknown;
|
|
98
|
+
} | {
|
|
99
|
+
type: "rememberPendingQuestion";
|
|
100
|
+
params: import("xstate").NonReducibleUnknown;
|
|
101
|
+
} | {
|
|
102
|
+
type: "rememberBossReply";
|
|
103
|
+
params: import("xstate").NonReducibleUnknown;
|
|
104
|
+
} | {
|
|
105
|
+
type: "rememberEmptyBossReplyError";
|
|
106
|
+
params: import("xstate").NonReducibleUnknown;
|
|
107
|
+
} | {
|
|
108
|
+
type: "rememberMalformedPlayerOutput";
|
|
109
|
+
params: import("xstate").NonReducibleUnknown;
|
|
110
|
+
} | {
|
|
111
|
+
type: "startBranch";
|
|
112
|
+
params: import("xstate").NonReducibleUnknown;
|
|
113
|
+
} | {
|
|
114
|
+
type: "rememberBranched";
|
|
115
|
+
params: import("xstate").NonReducibleUnknown;
|
|
116
|
+
} | {
|
|
117
|
+
type: "rememberRefused";
|
|
118
|
+
params: import("xstate").NonReducibleUnknown;
|
|
119
|
+
}, {
|
|
120
|
+
type: "needsBossReply";
|
|
121
|
+
params: unknown;
|
|
122
|
+
} | {
|
|
123
|
+
type: "emptyBossReply";
|
|
124
|
+
params: unknown;
|
|
125
|
+
} | {
|
|
126
|
+
type: "isBranched";
|
|
127
|
+
params: unknown;
|
|
128
|
+
} | {
|
|
129
|
+
type: "isRefused";
|
|
130
|
+
params: unknown;
|
|
131
|
+
} | {
|
|
132
|
+
type: "resumesCreateBranch";
|
|
133
|
+
params: unknown;
|
|
134
|
+
}, never, "failed" | "awaitBossReply" | "ready" | "refused" | "createBranch" | "branched", string, Readonly<Record<string, never>>, {
|
|
135
|
+
readonly status: "branched";
|
|
136
|
+
/** Exact name of the new branch now checked out. */
|
|
137
|
+
readonly branch: string;
|
|
138
|
+
/** Exact receipt-observed revision the branch was created from. */
|
|
139
|
+
readonly baseRevision: string;
|
|
140
|
+
/** Coder's concise summary of the issue and its comments, or of the request. */
|
|
141
|
+
readonly issueSummary: string;
|
|
142
|
+
} | {
|
|
143
|
+
readonly status: "refused";
|
|
144
|
+
/** Coder's complete report carrying the reason no branch was created. */
|
|
145
|
+
readonly coderOutput: string;
|
|
146
|
+
}, import("xstate").EventObject, import("xstate").MetaObject, {
|
|
147
|
+
id: "branch";
|
|
148
|
+
states: {
|
|
149
|
+
readonly ready: {
|
|
150
|
+
id: "ready";
|
|
151
|
+
};
|
|
152
|
+
readonly createBranch: {
|
|
153
|
+
id: "createBranch";
|
|
154
|
+
};
|
|
155
|
+
readonly awaitBossReply: {
|
|
156
|
+
id: "awaitBossReply";
|
|
157
|
+
};
|
|
158
|
+
readonly failed: {
|
|
159
|
+
id: "failed";
|
|
160
|
+
};
|
|
161
|
+
readonly branched: {
|
|
162
|
+
id: "branched";
|
|
163
|
+
};
|
|
164
|
+
readonly refused: {
|
|
165
|
+
id: "refused";
|
|
166
|
+
};
|
|
167
|
+
};
|
|
168
|
+
}>;
|
|
169
|
+
export default branchMachine;
|