@sublang/playbook 0.9.0 → 1.3.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 +190 -151
- package/package.json +50 -6
- package/reference/sdlc/captain.md +102 -0
- package/reference/sdlc/captain.playbook/captain.fsm.d.ts +227 -0
- package/reference/sdlc/captain.playbook/captain.fsm.js +628 -0
- package/reference/sdlc/captain.playbook/captain.fsm.ts +851 -0
- package/reference/sdlc/captain.playbook/captain.gears.md +60 -0
- package/reference/sdlc/captain.playbook/captain.playbook.d.ts +23 -0
- package/reference/sdlc/captain.playbook/captain.playbook.js +1053 -0
- package/reference/sdlc/captain.playbook/captain.playbook.ts +1144 -0
- package/reference/sdlc/code.playbook/bin/playbook.js +158 -12
- package/reference/sdlc/code.playbook/bin/run.js +999 -0
- package/reference/sdlc/code.playbook/code.fsm.d.ts +11 -4
- package/reference/sdlc/code.playbook/code.fsm.introspect.d.ts +2 -2
- package/reference/sdlc/code.playbook/code.fsm.introspect.js +1 -1
- package/reference/sdlc/code.playbook/code.fsm.introspect.ts +6 -6
- package/reference/sdlc/code.playbook/code.fsm.js +334 -102
- package/reference/sdlc/code.playbook/code.fsm.ts +467 -180
- package/reference/sdlc/code.playbook/code.gears.md +11 -10
- package/reference/sdlc/code.playbook/code.playbook.d.ts +16 -19
- package/reference/sdlc/code.playbook/code.playbook.js +199 -488
- package/reference/sdlc/code.playbook/code.playbook.ts +327 -566
- package/reference/sdlc/code.playbook/code.registry.d.ts +0 -3
- package/reference/sdlc/code.playbook/code.registry.js +0 -3
- package/reference/sdlc/code.playbook/code.registry.ts +0 -6
- package/reference/sdlc/code.playbook/playbook-captain.d.ts +9 -4
- package/reference/sdlc/code.playbook/playbook-captain.js +889 -210
- package/reference/sdlc/code.playbook/playbook-captain.ts +1136 -257
- package/reference/sdlc/code.playbook/playbook.config.template.yaml +21 -0
- package/reference/sdlc/discuss.playbook/discuss.fsm.d.ts +396 -0
- package/reference/sdlc/discuss.playbook/discuss.fsm.js +2066 -0
- package/reference/sdlc/discuss.playbook/discuss.fsm.ts +2464 -0
- package/reference/sdlc/discuss.playbook/discuss.gears.md +251 -0
- package/reference/sdlc/discuss.playbook/discuss.playbook.d.ts +113 -0
- package/reference/sdlc/discuss.playbook/discuss.playbook.js +1514 -0
- package/reference/sdlc/discuss.playbook/discuss.playbook.ts +1926 -0
- package/reference/sdlc/discuss.playbook/discuss.registry.d.ts +58 -0
- package/reference/sdlc/discuss.playbook/discuss.registry.js +97 -0
- package/reference/sdlc/discuss.playbook/discuss.registry.ts +153 -0
- package/slc/gears2fsm.md +557 -57
- package/slc/link.md +1165 -89
- package/slc/optimize.md +92 -0
- package/slc/text2gears.md +255 -7
- package/src/runtime.d.ts +146 -3
- package/src/runtime.ts +201 -2
- package/src/xstate-playbook-runtime.d.ts +201 -0
- package/src/xstate-playbook-runtime.js +2058 -0
- package/src/xstate-playbook-runtime.ts +2792 -0
- package/src/xstate-runtime.d.ts +95 -0
- package/src/xstate-runtime.js +1258 -0
- package/src/xstate-runtime.ts +1816 -0
|
@@ -6,13 +6,14 @@ type ReviewSubject = 'commit' | 'changes';
|
|
|
6
6
|
type AfterReview = 'continueIr' | 'summarizeSpecs' | 'done';
|
|
7
7
|
type ResumableStateId = Exclude<JumpableStateId, 'ready' | 'failed'>;
|
|
8
8
|
type PendingBossQuestion = {
|
|
9
|
+
questionId: ResumableStateId;
|
|
9
10
|
resumeStateId: ResumableStateId;
|
|
10
11
|
sourceItem: string;
|
|
11
12
|
player: Player;
|
|
12
13
|
question: string;
|
|
13
14
|
};
|
|
14
15
|
export type CaptainInput = {
|
|
15
|
-
|
|
16
|
+
stateId: ResumableStateId;
|
|
16
17
|
sourceItem: string;
|
|
17
18
|
prompt: string;
|
|
18
19
|
result: Record<string, string>;
|
|
@@ -27,6 +28,9 @@ export type CaptainInput = {
|
|
|
27
28
|
pendingBossQuestion?: PendingBossQuestion;
|
|
28
29
|
bossReply?: string;
|
|
29
30
|
};
|
|
31
|
+
export type PlayerInput = CaptainInput & {
|
|
32
|
+
player: Player;
|
|
33
|
+
};
|
|
30
34
|
export type CaptainOutput = {
|
|
31
35
|
guard: string;
|
|
32
36
|
irNumber?: string;
|
|
@@ -37,6 +41,7 @@ export type CaptainOutput = {
|
|
|
37
41
|
question?: string;
|
|
38
42
|
[k: string]: unknown;
|
|
39
43
|
};
|
|
44
|
+
export type PlayerOutput = CaptainOutput;
|
|
40
45
|
export type CodingInput = {
|
|
41
46
|
intent?: string;
|
|
42
47
|
irNumber?: string;
|
|
@@ -74,6 +79,7 @@ export type CodingEvent = {
|
|
|
74
79
|
} | {
|
|
75
80
|
type: 'BOSS_REPLY';
|
|
76
81
|
answer: string;
|
|
82
|
+
questionId?: ResumableStateId;
|
|
77
83
|
};
|
|
78
84
|
export declare const codingMachine: import("xstate").StateMachine<CodingContext, {
|
|
79
85
|
type: "START_CODING";
|
|
@@ -92,11 +98,12 @@ export declare const codingMachine: import("xstate").StateMachine<CodingContext,
|
|
|
92
98
|
} | {
|
|
93
99
|
type: "BOSS_REPLY";
|
|
94
100
|
answer: string;
|
|
101
|
+
questionId?: ResumableStateId;
|
|
95
102
|
}, {
|
|
96
|
-
[x: string]: import("xstate").ActorRefFromLogic<import("xstate").PromiseActorLogic<CaptainOutput,
|
|
103
|
+
[x: string]: import("xstate").ActorRefFromLogic<import("xstate").PromiseActorLogic<CaptainOutput, PlayerInput, import("xstate").EventObject>> | undefined;
|
|
97
104
|
}, {
|
|
98
|
-
src: "
|
|
99
|
-
logic: import("xstate").PromiseActorLogic<CaptainOutput,
|
|
105
|
+
src: "player";
|
|
106
|
+
logic: import("xstate").PromiseActorLogic<CaptainOutput, PlayerInput, import("xstate").EventObject>;
|
|
100
107
|
id: string | undefined;
|
|
101
108
|
}, never, never, never, {}, string, CodingInput, import("xstate").NonReducibleUnknown, import("xstate").EventObject, import("xstate").MetaObject, {
|
|
102
109
|
states?: {} | undefined;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { CodingContext, PlayerInput, codingMachine } from './code.fsm.js';
|
|
2
2
|
export interface CaptainStateInfo {
|
|
3
3
|
readonly stateId: string;
|
|
4
4
|
readonly sourceItem: string;
|
|
5
|
-
readonly getInput: (context: Partial<CodingContext>) =>
|
|
5
|
+
readonly getInput: (context: Partial<CodingContext>) => PlayerInput;
|
|
6
6
|
readonly transitions: ReadonlyArray<CaptainTransition>;
|
|
7
7
|
}
|
|
8
8
|
export interface CaptainTransition {
|
|
@@ -5,7 +5,7 @@ export function enumerateCaptainStates(machine) {
|
|
|
5
5
|
const out = [];
|
|
6
6
|
for (const [stateId, def] of Object.entries(states)) {
|
|
7
7
|
const invoke = def.invoke;
|
|
8
|
-
if (!invoke || invoke.src !== '
|
|
8
|
+
if (!invoke || invoke.src !== 'player' || typeof invoke.input !== 'function') {
|
|
9
9
|
continue;
|
|
10
10
|
}
|
|
11
11
|
const inputFn = invoke.input;
|
|
@@ -7,19 +7,19 @@
|
|
|
7
7
|
// Tasks 3–5. Reaching into `machine.config` is internal but stable
|
|
8
8
|
// in xstate v5: it preserves the literal `createMachine` argument,
|
|
9
9
|
// so `invoke.input` is still the original `({ context }) =>
|
|
10
|
-
//
|
|
10
|
+
// PlayerInput` function and `invoke.onDone` is still the per-arm
|
|
11
11
|
// array with `guard` / `target` / `actions` keys.
|
|
12
12
|
|
|
13
13
|
import type {
|
|
14
|
-
CaptainInput,
|
|
15
14
|
CodingContext,
|
|
15
|
+
PlayerInput,
|
|
16
16
|
codingMachine,
|
|
17
17
|
} from './code.fsm.js';
|
|
18
18
|
|
|
19
19
|
export interface CaptainStateInfo {
|
|
20
20
|
readonly stateId: string;
|
|
21
21
|
readonly sourceItem: string;
|
|
22
|
-
readonly getInput: (context: Partial<CodingContext>) =>
|
|
22
|
+
readonly getInput: (context: Partial<CodingContext>) => PlayerInput;
|
|
23
23
|
readonly transitions: ReadonlyArray<CaptainTransition>;
|
|
24
24
|
}
|
|
25
25
|
|
|
@@ -76,7 +76,7 @@ export interface RootEventTable {
|
|
|
76
76
|
|
|
77
77
|
type RawInvoke = {
|
|
78
78
|
src?: unknown;
|
|
79
|
-
input?: (args: { context: Partial<CodingContext> }) =>
|
|
79
|
+
input?: (args: { context: Partial<CodingContext> }) => PlayerInput;
|
|
80
80
|
onDone?: unknown;
|
|
81
81
|
};
|
|
82
82
|
|
|
@@ -101,11 +101,11 @@ export function enumerateCaptainStates(
|
|
|
101
101
|
const out: CaptainStateInfo[] = [];
|
|
102
102
|
for (const [stateId, def] of Object.entries(states)) {
|
|
103
103
|
const invoke = def.invoke;
|
|
104
|
-
if (!invoke || invoke.src !== '
|
|
104
|
+
if (!invoke || invoke.src !== 'player' || typeof invoke.input !== 'function') {
|
|
105
105
|
continue;
|
|
106
106
|
}
|
|
107
107
|
const inputFn = invoke.input;
|
|
108
|
-
const getInput = (context: Partial<CodingContext>):
|
|
108
|
+
const getInput = (context: Partial<CodingContext>): PlayerInput =>
|
|
109
109
|
inputFn({ context });
|
|
110
110
|
const probe = getInput({});
|
|
111
111
|
const transitions = toArmArray(invoke.onDone).map(
|