@sublang/playbook 5.0.0 → 7.0.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 +22 -14
- package/docs/cli.md +138 -90
- package/docs/configuration.md +113 -29
- package/docs/embedding.md +24 -16
- package/package.json +42 -21
- package/reference/sdlc/captain.playbook/captain.playbook.js +2 -0
- package/reference/sdlc/captain.playbook/captain.playbook.ts +2 -0
- package/reference/sdlc/code.md +55 -97
- package/reference/sdlc/code.playbook/bin/launch-config.js +938 -0
- package/reference/sdlc/code.playbook/bin/playbook.js +145 -562
- package/reference/sdlc/code.playbook/bin/provision.js +84 -38
- package/reference/sdlc/code.playbook/bin/run.js +1171 -983
- package/reference/sdlc/code.playbook/bin/session-store.js +1169 -0
- package/reference/sdlc/code.playbook/code.fsm.d.ts +229 -94
- package/reference/sdlc/code.playbook/code.fsm.introspect.d.ts +26 -44
- package/reference/sdlc/code.playbook/code.fsm.introspect.js +61 -66
- package/reference/sdlc/code.playbook/code.fsm.introspect.ts +100 -149
- package/reference/sdlc/code.playbook/code.fsm.js +587 -1347
- package/reference/sdlc/code.playbook/code.fsm.ts +809 -1650
- package/reference/sdlc/code.playbook/code.gears.md +51 -263
- package/reference/sdlc/code.playbook/code.playbook.d.ts +8 -47
- package/reference/sdlc/code.playbook/code.playbook.js +69 -656
- package/reference/sdlc/code.playbook/code.playbook.ts +90 -867
- package/reference/sdlc/code.playbook/code.registry.d.ts +9 -25
- package/reference/sdlc/code.playbook/code.registry.js +20 -78
- package/reference/sdlc/code.playbook/code.registry.ts +58 -122
- package/reference/sdlc/code.playbook/playbook-captain.d.ts +70 -3
- package/reference/sdlc/code.playbook/playbook-captain.js +954 -80
- package/reference/sdlc/code.playbook/playbook-captain.ts +1408 -80
- package/reference/sdlc/code.playbook/playbook.config.template.yaml +37 -36
- package/reference/sdlc/decide.md +54 -0
- package/reference/sdlc/decide.playbook/decide.fsm.d.ts +261 -0
- package/reference/sdlc/decide.playbook/decide.fsm.js +894 -0
- package/reference/sdlc/decide.playbook/decide.fsm.ts +1152 -0
- package/reference/sdlc/decide.playbook/decide.gears.md +88 -0
- package/reference/sdlc/decide.playbook/decide.playbook.d.ts +67 -0
- package/reference/sdlc/{discuss.playbook/discuss.playbook.js → decide.playbook/decide.playbook.js} +545 -372
- package/reference/sdlc/{discuss.playbook/discuss.playbook.ts → decide.playbook/decide.playbook.ts} +665 -454
- package/reference/sdlc/decide.playbook/decide.registry.d.ts +41 -0
- package/reference/sdlc/decide.playbook/decide.registry.js +60 -0
- package/reference/sdlc/decide.playbook/decide.registry.ts +125 -0
- package/reference/sdlc/review.md +81 -0
- package/reference/sdlc/review.playbook/review.fsm.d.ts +183 -0
- package/reference/sdlc/review.playbook/review.fsm.js +524 -0
- package/reference/sdlc/review.playbook/review.fsm.ts +652 -0
- package/reference/sdlc/review.playbook/review.gears.md +112 -0
- package/reference/sdlc/review.playbook/review.playbook.d.ts +12 -0
- package/reference/sdlc/review.playbook/review.playbook.js +112 -0
- package/reference/sdlc/review.playbook/review.playbook.ts +201 -0
- package/reference/sdlc/review.playbook/review.registry.d.ts +43 -0
- package/reference/sdlc/review.playbook/review.registry.js +73 -0
- package/reference/sdlc/review.playbook/review.registry.ts +138 -0
- package/slc/gears2fsm.md +13 -4
- package/slc/link.md +83 -14
- package/slc/text2gears.md +22 -2
- package/src/runtime.d.ts +21 -2
- package/src/runtime.ts +38 -6
- package/src/xstate-playbook-runtime.d.ts +9 -2
- package/src/xstate-playbook-runtime.js +319 -35
- package/src/xstate-playbook-runtime.ts +412 -41
- package/src/xstate-runtime.d.ts +19 -2
- package/src/xstate-runtime.js +384 -57
- package/src/xstate-runtime.ts +542 -71
- package/reference/sdlc/discuss.md +0 -93
- package/reference/sdlc/discuss.playbook/discuss.fsm.d.ts +0 -396
- package/reference/sdlc/discuss.playbook/discuss.fsm.js +0 -2067
- package/reference/sdlc/discuss.playbook/discuss.fsm.ts +0 -2465
- package/reference/sdlc/discuss.playbook/discuss.gears.md +0 -258
- package/reference/sdlc/discuss.playbook/discuss.playbook.d.ts +0 -113
- package/reference/sdlc/discuss.playbook/discuss.registry.d.ts +0 -58
- package/reference/sdlc/discuss.playbook/discuss.registry.js +0 -97
- package/reference/sdlc/discuss.playbook/discuss.registry.ts +0 -153
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { type PlaybookRuntime, type PlaybookRuntimeOptions } from './decide.playbook.js';
|
|
2
|
+
export interface PlaybookSummaryPolicy {
|
|
3
|
+
stateCountLabels: Readonly<Record<string, string>>;
|
|
4
|
+
copyPasteGuardNames: readonly string[];
|
|
5
|
+
savedCountsLine(counts: {
|
|
6
|
+
interruptions: number;
|
|
7
|
+
copyPastes: number;
|
|
8
|
+
}, rounds: number): string;
|
|
9
|
+
}
|
|
10
|
+
export interface RegistryPlayer {
|
|
11
|
+
id: string;
|
|
12
|
+
adapter?: string;
|
|
13
|
+
model?: string;
|
|
14
|
+
}
|
|
15
|
+
export interface CreateDecideRuntimeOptions {
|
|
16
|
+
captainOptions: unknown;
|
|
17
|
+
players: readonly RegistryPlayer[];
|
|
18
|
+
}
|
|
19
|
+
export type DecideOptions = Readonly<Record<string, never>>;
|
|
20
|
+
export interface DecidePlaybookRegistryEntry {
|
|
21
|
+
id: 'decide';
|
|
22
|
+
command: 'decide';
|
|
23
|
+
intent: string;
|
|
24
|
+
requiredRoleIds: readonly ['coder', 'reviewer'];
|
|
25
|
+
summaryPolicy: PlaybookSummaryPolicy;
|
|
26
|
+
validateOptions(captainOptions: unknown): DecideOptions;
|
|
27
|
+
createRuntime(options: CreateDecideRuntimeOptions): PlaybookRuntime;
|
|
28
|
+
}
|
|
29
|
+
export declare const decideStateCountLabels: {
|
|
30
|
+
readonly independentProposals: "proposal round";
|
|
31
|
+
};
|
|
32
|
+
export declare const decideCopyPasteGuardNames: readonly ["proposed"];
|
|
33
|
+
export declare function decideSavedCountsLine(counts: {
|
|
34
|
+
interruptions: number;
|
|
35
|
+
copyPastes: number;
|
|
36
|
+
}, rounds: number): string;
|
|
37
|
+
export declare const decideSummaryPolicy: PlaybookSummaryPolicy;
|
|
38
|
+
export declare function validateDecideOptions(optionSlice: unknown): DecideOptions;
|
|
39
|
+
export declare function createDecideRuntimeOptions({ captainOptions, players, }: CreateDecideRuntimeOptions): PlaybookRuntimeOptions;
|
|
40
|
+
export declare const decidePlaybookRegistryEntry: DecidePlaybookRegistryEntry;
|
|
41
|
+
export default decidePlaybookRegistryEntry;
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
2
|
+
// SPDX-FileCopyrightText: 2026 SubLang International <https://sublang.ai>
|
|
3
|
+
import createPlaybookRuntime from './decide.playbook.js';
|
|
4
|
+
export const decideStateCountLabels = {
|
|
5
|
+
independentProposals: 'proposal round',
|
|
6
|
+
};
|
|
7
|
+
export const decideCopyPasteGuardNames = ['proposed'];
|
|
8
|
+
function countNoun(count, singular, plural = `${singular}s`) {
|
|
9
|
+
return `${count} ${count === 1 ? singular : plural}`;
|
|
10
|
+
}
|
|
11
|
+
export function decideSavedCountsLine(counts, rounds) {
|
|
12
|
+
return [
|
|
13
|
+
'Saved you',
|
|
14
|
+
countNoun(counts.interruptions, 'interruption'),
|
|
15
|
+
'and',
|
|
16
|
+
countNoun(counts.copyPastes, 'copy-paste'),
|
|
17
|
+
'across',
|
|
18
|
+
countNoun(rounds, 'round'),
|
|
19
|
+
'of proposals/reviews.',
|
|
20
|
+
].join(' ');
|
|
21
|
+
}
|
|
22
|
+
export const decideSummaryPolicy = {
|
|
23
|
+
stateCountLabels: decideStateCountLabels,
|
|
24
|
+
copyPasteGuardNames: decideCopyPasteGuardNames,
|
|
25
|
+
savedCountsLine: decideSavedCountsLine,
|
|
26
|
+
};
|
|
27
|
+
export function validateDecideOptions(optionSlice) {
|
|
28
|
+
if (optionSlice === undefined)
|
|
29
|
+
return Object.freeze({});
|
|
30
|
+
if (optionSlice === null ||
|
|
31
|
+
typeof optionSlice !== 'object' ||
|
|
32
|
+
Array.isArray(optionSlice)) {
|
|
33
|
+
throw new Error('captain.options.playbooks.decide.options must be an object');
|
|
34
|
+
}
|
|
35
|
+
const keys = Object.keys(optionSlice);
|
|
36
|
+
if (keys.length > 0) {
|
|
37
|
+
throw new Error(`Unknown config field captain.options.playbooks.decide.options.${keys[0]}`);
|
|
38
|
+
}
|
|
39
|
+
return Object.freeze({});
|
|
40
|
+
}
|
|
41
|
+
function playerIdentity(players, id) {
|
|
42
|
+
const player = players.find((entry) => entry.id === id);
|
|
43
|
+
return player?.model ?? player?.adapter ?? id;
|
|
44
|
+
}
|
|
45
|
+
export function createDecideRuntimeOptions({ captainOptions, players, }) {
|
|
46
|
+
validateDecideOptions(captainOptions);
|
|
47
|
+
return { coderLlm: playerIdentity(players, 'coder') };
|
|
48
|
+
}
|
|
49
|
+
export const decidePlaybookRegistryEntry = {
|
|
50
|
+
id: 'decide',
|
|
51
|
+
command: 'decide',
|
|
52
|
+
intent: 'turn independent Coder and Reviewer proposals into an approved spec-design commit',
|
|
53
|
+
requiredRoleIds: ['coder', 'reviewer'],
|
|
54
|
+
summaryPolicy: decideSummaryPolicy,
|
|
55
|
+
validateOptions: validateDecideOptions,
|
|
56
|
+
createRuntime(options) {
|
|
57
|
+
return createPlaybookRuntime(createDecideRuntimeOptions(options));
|
|
58
|
+
},
|
|
59
|
+
};
|
|
60
|
+
export default decidePlaybookRegistryEntry;
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
2
|
+
// SPDX-FileCopyrightText: 2026 SubLang International <https://sublang.ai>
|
|
3
|
+
|
|
4
|
+
import createPlaybookRuntime, {
|
|
5
|
+
type PlaybookRuntime,
|
|
6
|
+
type PlaybookRuntimeOptions,
|
|
7
|
+
} from './decide.playbook.js';
|
|
8
|
+
|
|
9
|
+
export interface PlaybookSummaryPolicy {
|
|
10
|
+
stateCountLabels: Readonly<Record<string, string>>;
|
|
11
|
+
copyPasteGuardNames: readonly string[];
|
|
12
|
+
savedCountsLine(
|
|
13
|
+
counts: { interruptions: number; copyPastes: number },
|
|
14
|
+
rounds: number,
|
|
15
|
+
): string;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export interface RegistryPlayer {
|
|
19
|
+
id: string;
|
|
20
|
+
adapter?: string;
|
|
21
|
+
model?: string;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export interface CreateDecideRuntimeOptions {
|
|
25
|
+
captainOptions: unknown;
|
|
26
|
+
players: readonly RegistryPlayer[];
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export type DecideOptions = Readonly<Record<string, never>>;
|
|
30
|
+
|
|
31
|
+
export interface DecidePlaybookRegistryEntry {
|
|
32
|
+
id: 'decide';
|
|
33
|
+
command: 'decide';
|
|
34
|
+
intent: string;
|
|
35
|
+
requiredRoleIds: readonly ['coder', 'reviewer'];
|
|
36
|
+
summaryPolicy: PlaybookSummaryPolicy;
|
|
37
|
+
validateOptions(captainOptions: unknown): DecideOptions;
|
|
38
|
+
createRuntime(options: CreateDecideRuntimeOptions): PlaybookRuntime;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
export const decideStateCountLabels = {
|
|
42
|
+
independentProposals: 'proposal round',
|
|
43
|
+
} as const;
|
|
44
|
+
|
|
45
|
+
export const decideCopyPasteGuardNames = ['proposed'] as const;
|
|
46
|
+
|
|
47
|
+
function countNoun(
|
|
48
|
+
count: number,
|
|
49
|
+
singular: string,
|
|
50
|
+
plural = `${singular}s`,
|
|
51
|
+
): string {
|
|
52
|
+
return `${count} ${count === 1 ? singular : plural}`;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
export function decideSavedCountsLine(
|
|
56
|
+
counts: { interruptions: number; copyPastes: number },
|
|
57
|
+
rounds: number,
|
|
58
|
+
): string {
|
|
59
|
+
return [
|
|
60
|
+
'Saved you',
|
|
61
|
+
countNoun(counts.interruptions, 'interruption'),
|
|
62
|
+
'and',
|
|
63
|
+
countNoun(counts.copyPastes, 'copy-paste'),
|
|
64
|
+
'across',
|
|
65
|
+
countNoun(rounds, 'round'),
|
|
66
|
+
'of proposals/reviews.',
|
|
67
|
+
].join(' ');
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
export const decideSummaryPolicy: PlaybookSummaryPolicy = {
|
|
71
|
+
stateCountLabels: decideStateCountLabels,
|
|
72
|
+
copyPasteGuardNames: decideCopyPasteGuardNames,
|
|
73
|
+
savedCountsLine: decideSavedCountsLine,
|
|
74
|
+
};
|
|
75
|
+
|
|
76
|
+
export function validateDecideOptions(optionSlice: unknown): DecideOptions {
|
|
77
|
+
if (optionSlice === undefined) return Object.freeze({});
|
|
78
|
+
if (
|
|
79
|
+
optionSlice === null ||
|
|
80
|
+
typeof optionSlice !== 'object' ||
|
|
81
|
+
Array.isArray(optionSlice)
|
|
82
|
+
) {
|
|
83
|
+
throw new Error(
|
|
84
|
+
'captain.options.playbooks.decide.options must be an object',
|
|
85
|
+
);
|
|
86
|
+
}
|
|
87
|
+
const keys = Object.keys(optionSlice);
|
|
88
|
+
if (keys.length > 0) {
|
|
89
|
+
throw new Error(
|
|
90
|
+
`Unknown config field captain.options.playbooks.decide.options.${keys[0]}`,
|
|
91
|
+
);
|
|
92
|
+
}
|
|
93
|
+
return Object.freeze({});
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
function playerIdentity(
|
|
97
|
+
players: readonly RegistryPlayer[],
|
|
98
|
+
id: string,
|
|
99
|
+
): string {
|
|
100
|
+
const player = players.find((entry) => entry.id === id);
|
|
101
|
+
return player?.model ?? player?.adapter ?? id;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
export function createDecideRuntimeOptions({
|
|
105
|
+
captainOptions,
|
|
106
|
+
players,
|
|
107
|
+
}: CreateDecideRuntimeOptions): PlaybookRuntimeOptions {
|
|
108
|
+
validateDecideOptions(captainOptions);
|
|
109
|
+
return { coderLlm: playerIdentity(players, 'coder') };
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
export const decidePlaybookRegistryEntry: DecidePlaybookRegistryEntry = {
|
|
113
|
+
id: 'decide',
|
|
114
|
+
command: 'decide',
|
|
115
|
+
intent:
|
|
116
|
+
'turn independent Coder and Reviewer proposals into an approved spec-design commit',
|
|
117
|
+
requiredRoleIds: ['coder', 'reviewer'],
|
|
118
|
+
summaryPolicy: decideSummaryPolicy,
|
|
119
|
+
validateOptions: validateDecideOptions,
|
|
120
|
+
createRuntime(options) {
|
|
121
|
+
return createPlaybookRuntime(createDecideRuntimeOptions(options));
|
|
122
|
+
},
|
|
123
|
+
};
|
|
124
|
+
|
|
125
|
+
export default decidePlaybookRegistryEntry;
|
|
@@ -0,0 +1,81 @@
|
|
|
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
|
+
# Review
|
|
6
|
+
|
|
7
|
+
Players:
|
|
8
|
+
|
|
9
|
+
- Coder
|
|
10
|
+
- Reviewer
|
|
11
|
+
|
|
12
|
+
The caller supplies the initial intent or any specific context and relevant run results.
|
|
13
|
+
|
|
14
|
+
`review` examines committed work only.
|
|
15
|
+
Every review round begins with a new or existing commit.
|
|
16
|
+
|
|
17
|
+
At the first review round, Captain shall relay to Reviewer the complete initial review request in quotes (`>`).
|
|
18
|
+
|
|
19
|
+
At the first review round, Captain shall give Reviewer the following instruction:
|
|
20
|
+
|
|
21
|
+
```markdown
|
|
22
|
+
A new review begins on the latest commit.
|
|
23
|
+
Review the latest commit and resulting repository state; read the commit message first for its intent and rationale.
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
After every review-fix commit, Captain shall give Reviewer the following instruction:
|
|
27
|
+
|
|
28
|
+
```markdown
|
|
29
|
+
Review the latest commit and resulting repository state; read the commit message first for its intent and rationale.
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
When Coder rejects every finding and makes no commit, Captain shall give Reviewer the following instruction:
|
|
33
|
+
|
|
34
|
+
```markdown
|
|
35
|
+
No new commit was made because Coder rejected every finding.
|
|
36
|
+
For any rebuttal, accept or challenge it.
|
|
37
|
+
State which findings, if any, remain.
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
At the start of *every* review round, Captain shall relay to Reviewer any Coder feedback from the preceding round and any relevant run results, in quotes (`>`) after the instruction.
|
|
41
|
+
|
|
42
|
+
At the start of *every* review round, Captain shall append the following instruction to the end of the prompt:
|
|
43
|
+
|
|
44
|
+
```markdown
|
|
45
|
+
Understand the full picture and think systematically about the underlying design.
|
|
46
|
+
Continue to identify issues or improvements, if any (numbered; no duplication).
|
|
47
|
+
Treat as settled, and do not raise again, any finding in this review rejected twice with reasoning.
|
|
48
|
+
Flag only what materially affects correctness, behavior, or spec quality — not style, equally valid alternatives, or theoretical threats.
|
|
49
|
+
For specs, flag stale, missing, over-specified, or under-specified ones.
|
|
50
|
+
Avoid unnecessary complexity in code or tests, but flag any fundamental design flaw when leaving it would cost more in later patches than fixing it now.
|
|
51
|
+
|
|
52
|
+
Do not re-run tests or builds whose inputs have not changed since any previous reported run.
|
|
53
|
+
Do not edit files or commit; report findings only.
|
|
54
|
+
|
|
55
|
+
Consult @specs/map.md for context if needed; verify it remains accurate.
|
|
56
|
+
Consult @specs/meta.md for spec requirements if needed; verify affected specs follow it.
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
When Reviewer raises or keeps any finding, Captain shall relay the Reviewer's findings and any relevant run results to Coder, in quotes (`>`), along with the following prompt:
|
|
60
|
+
|
|
61
|
+
```markdown
|
|
62
|
+
For each review item, accept or reject it.
|
|
63
|
+
Before deciding, understand the full picture and think systematically about the underlying design.
|
|
64
|
+
Reject anything that is not essential or is not worth fixing now.
|
|
65
|
+
If you accept an item, fix its root cause, including any fundamental design flaw - do not patch around it.
|
|
66
|
+
If you reject an item, give the reasoning and cite code or test output that supports it.
|
|
67
|
+
Do not re-run tests or builds whose inputs have not changed since any previous reported run.
|
|
68
|
+
|
|
69
|
+
If you accept any item, make minimal changes and commit them as one new commit; never amend the reviewed commit.
|
|
70
|
+
Follow @specs/packages/git.md.
|
|
71
|
+
Make the commit message explain concisely what changed and why, including relevant verification.
|
|
72
|
+
Coder is <coder-llm>; Reviewer is <reviewer-llm>; format model tokens in conventional human form.
|
|
73
|
+
|
|
74
|
+
If you reject every item, change nothing and make no commit.
|
|
75
|
+
Report every disposition, all relevant run results, and every rebuttal.
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
When Coder makes a new commit or decides to reject all findings, Captain shall relay the above required context to Reviewer and begin the next review round.
|
|
79
|
+
Reviewer shall read the context information and follow the corresponding instructions.
|
|
80
|
+
Rounds continue until Reviewer raises no unsettled findings.
|
|
81
|
+
`review` then returns the approved latest commit and the fact that no findings remain to its caller.
|
|
@@ -0,0 +1,183 @@
|
|
|
1
|
+
type Player = 'Coder' | 'Reviewer';
|
|
2
|
+
type JumpableStateId = 'reviewInitial';
|
|
3
|
+
export type ResumableStateId = 'reviewInitial' | 'addressFindings' | 'reviewAfterCommit' | 'reviewAfterRebuttal';
|
|
4
|
+
export interface PendingBossQuestion {
|
|
5
|
+
questionId: ResumableStateId;
|
|
6
|
+
resumeStateId: ResumableStateId;
|
|
7
|
+
sourceItem: `REVIEW-${1 | 2 | 3 | 4}`;
|
|
8
|
+
player: Player;
|
|
9
|
+
question: string;
|
|
10
|
+
}
|
|
11
|
+
export interface ReviewOutput {
|
|
12
|
+
approvedCommit: 'latest';
|
|
13
|
+
noUnsettledFindings: true;
|
|
14
|
+
}
|
|
15
|
+
export interface ReviewInput {
|
|
16
|
+
coderLlm: string;
|
|
17
|
+
reviewerLlm: string;
|
|
18
|
+
}
|
|
19
|
+
export interface ReviewContext extends ReviewInput {
|
|
20
|
+
callerInput?: string;
|
|
21
|
+
reviewerOutput?: string;
|
|
22
|
+
coderOutput?: string;
|
|
23
|
+
lastError?: unknown;
|
|
24
|
+
pendingBossQuestion?: PendingBossQuestion;
|
|
25
|
+
bossReply?: string;
|
|
26
|
+
}
|
|
27
|
+
export type ReviewEvent = {
|
|
28
|
+
type: 'START_REVIEW';
|
|
29
|
+
callerInput: string;
|
|
30
|
+
} | {
|
|
31
|
+
type: 'BOSS_INTERRUPT';
|
|
32
|
+
targetId: JumpableStateId;
|
|
33
|
+
bossIntent: string;
|
|
34
|
+
} | {
|
|
35
|
+
type: 'BOSS_REPLY';
|
|
36
|
+
questionId?: ResumableStateId;
|
|
37
|
+
answer: string;
|
|
38
|
+
};
|
|
39
|
+
export interface PlayerInput {
|
|
40
|
+
stateId: ResumableStateId;
|
|
41
|
+
sourceItem: `REVIEW-${1 | 2 | 3 | 4}`;
|
|
42
|
+
player: Player;
|
|
43
|
+
prompt: string;
|
|
44
|
+
result: Readonly<Record<string, string>>;
|
|
45
|
+
callerInput?: string;
|
|
46
|
+
reviewerOutput?: string;
|
|
47
|
+
coderOutput?: string;
|
|
48
|
+
coderLlm?: string;
|
|
49
|
+
reviewerLlm?: string;
|
|
50
|
+
pendingBossQuestion?: PendingBossQuestion;
|
|
51
|
+
bossReply?: string;
|
|
52
|
+
}
|
|
53
|
+
export type PlayerOutput = {
|
|
54
|
+
guard: 'hasFindings';
|
|
55
|
+
reviewerOutput: string;
|
|
56
|
+
} | {
|
|
57
|
+
guard: 'noFindings';
|
|
58
|
+
} | {
|
|
59
|
+
guard: 'committed';
|
|
60
|
+
coderOutput: string;
|
|
61
|
+
} | {
|
|
62
|
+
guard: 'rejectedAll';
|
|
63
|
+
coderOutput: string;
|
|
64
|
+
} | {
|
|
65
|
+
guard: 'needsBossReply';
|
|
66
|
+
question: string;
|
|
67
|
+
};
|
|
68
|
+
export declare const reviewMachine: import("xstate").StateMachine<ReviewContext, {
|
|
69
|
+
type: "START_REVIEW";
|
|
70
|
+
callerInput: string;
|
|
71
|
+
} | {
|
|
72
|
+
type: "BOSS_INTERRUPT";
|
|
73
|
+
targetId: JumpableStateId;
|
|
74
|
+
bossIntent: string;
|
|
75
|
+
} | {
|
|
76
|
+
type: "BOSS_REPLY";
|
|
77
|
+
questionId?: ResumableStateId;
|
|
78
|
+
answer: string;
|
|
79
|
+
}, {
|
|
80
|
+
[x: string]: import("xstate").ActorRefFromLogic<import("xstate").PromiseActorLogic<PlayerOutput, PlayerInput, import("xstate").EventObject>> | undefined;
|
|
81
|
+
}, {
|
|
82
|
+
src: "player";
|
|
83
|
+
logic: import("xstate").PromiseActorLogic<PlayerOutput, PlayerInput, import("xstate").EventObject>;
|
|
84
|
+
id: string | undefined;
|
|
85
|
+
}, {
|
|
86
|
+
type: "rememberActorError";
|
|
87
|
+
params: import("xstate").NonReducibleUnknown;
|
|
88
|
+
} | {
|
|
89
|
+
type: "rememberBossReply";
|
|
90
|
+
params: import("xstate").NonReducibleUnknown;
|
|
91
|
+
} | {
|
|
92
|
+
type: "rememberEmptyBossReplyError";
|
|
93
|
+
params: import("xstate").NonReducibleUnknown;
|
|
94
|
+
} | {
|
|
95
|
+
type: "copyStartInput";
|
|
96
|
+
params: import("xstate").NonReducibleUnknown;
|
|
97
|
+
} | {
|
|
98
|
+
type: "copyInterruptedInput";
|
|
99
|
+
params: import("xstate").NonReducibleUnknown;
|
|
100
|
+
} | {
|
|
101
|
+
type: "rememberReviewerOutput";
|
|
102
|
+
params: import("xstate").NonReducibleUnknown;
|
|
103
|
+
} | {
|
|
104
|
+
type: "rememberCoderOutput";
|
|
105
|
+
params: import("xstate").NonReducibleUnknown;
|
|
106
|
+
} | {
|
|
107
|
+
type: "clearBossReplyContext";
|
|
108
|
+
params: import("xstate").NonReducibleUnknown;
|
|
109
|
+
} | {
|
|
110
|
+
type: "setPendingReviewInitial";
|
|
111
|
+
params: import("xstate").NonReducibleUnknown;
|
|
112
|
+
} | {
|
|
113
|
+
type: "setPendingAddressFindings";
|
|
114
|
+
params: import("xstate").NonReducibleUnknown;
|
|
115
|
+
} | {
|
|
116
|
+
type: "setPendingReviewAfterCommit";
|
|
117
|
+
params: import("xstate").NonReducibleUnknown;
|
|
118
|
+
} | {
|
|
119
|
+
type: "setPendingReviewAfterRebuttal";
|
|
120
|
+
params: import("xstate").NonReducibleUnknown;
|
|
121
|
+
}, {
|
|
122
|
+
type: "needsBossReply";
|
|
123
|
+
params: unknown;
|
|
124
|
+
} | {
|
|
125
|
+
type: "emptyBossReply";
|
|
126
|
+
params: unknown;
|
|
127
|
+
} | {
|
|
128
|
+
type: "hasFindings";
|
|
129
|
+
params: unknown;
|
|
130
|
+
} | {
|
|
131
|
+
type: "noFindings";
|
|
132
|
+
params: unknown;
|
|
133
|
+
} | {
|
|
134
|
+
type: "committed";
|
|
135
|
+
params: unknown;
|
|
136
|
+
} | {
|
|
137
|
+
type: "rejectedAll";
|
|
138
|
+
params: unknown;
|
|
139
|
+
} | {
|
|
140
|
+
type: "resumeReviewInitial";
|
|
141
|
+
params: unknown;
|
|
142
|
+
} | {
|
|
143
|
+
type: "resumeAddressFindings";
|
|
144
|
+
params: unknown;
|
|
145
|
+
} | {
|
|
146
|
+
type: "resumeReviewAfterCommit";
|
|
147
|
+
params: unknown;
|
|
148
|
+
} | {
|
|
149
|
+
type: "resumeReviewAfterRebuttal";
|
|
150
|
+
params: unknown;
|
|
151
|
+
} | {
|
|
152
|
+
type: "restartInitialReview";
|
|
153
|
+
params: unknown;
|
|
154
|
+
}, never, "done" | "failed" | "awaitBossReply" | "ready" | "reviewInitial" | "addressFindings" | "reviewAfterCommit" | "reviewAfterRebuttal", string, ReviewInput, ReviewOutput, import("xstate").EventObject, import("xstate").MetaObject, {
|
|
155
|
+
id: "review";
|
|
156
|
+
states: {
|
|
157
|
+
readonly ready: {
|
|
158
|
+
id: "ready";
|
|
159
|
+
};
|
|
160
|
+
readonly reviewInitial: {
|
|
161
|
+
id: "reviewInitial";
|
|
162
|
+
};
|
|
163
|
+
readonly addressFindings: {
|
|
164
|
+
id: "addressFindings";
|
|
165
|
+
};
|
|
166
|
+
readonly reviewAfterCommit: {
|
|
167
|
+
id: "reviewAfterCommit";
|
|
168
|
+
};
|
|
169
|
+
readonly reviewAfterRebuttal: {
|
|
170
|
+
id: "reviewAfterRebuttal";
|
|
171
|
+
};
|
|
172
|
+
readonly awaitBossReply: {
|
|
173
|
+
id: "awaitBossReply";
|
|
174
|
+
};
|
|
175
|
+
readonly failed: {
|
|
176
|
+
id: "failed";
|
|
177
|
+
};
|
|
178
|
+
readonly done: {
|
|
179
|
+
id: "done";
|
|
180
|
+
};
|
|
181
|
+
};
|
|
182
|
+
}>;
|
|
183
|
+
export {};
|