@sublang/playbook 11.0.0 → 12.1.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/docs/cli.md +9 -6
- package/docs/configuration.md +15 -1
- package/docs/embedding.md +83 -1
- package/package.json +28 -3
- package/reference/sdlc/code.playbook/bin/repository-effects.js +501 -170
- package/reference/sdlc/code.playbook/bin/session-store.js +4 -1
- package/reference/sdlc/code.playbook/code.fsm.d.ts +22 -19
- package/reference/sdlc/code.playbook/code.fsm.js +116 -52
- package/reference/sdlc/code.playbook/code.fsm.ts +149 -64
- package/reference/sdlc/code.playbook/code.gears.md +40 -20
- package/reference/sdlc/code.playbook/code.playbook.js +23 -2
- package/reference/sdlc/code.playbook/code.playbook.ts +23 -2
- package/reference/sdlc/code.playbook/host-capabilities.d.ts +291 -0
- package/reference/sdlc/code.playbook/host-capabilities.js +40 -0
- package/reference/sdlc/code.playbook/playbook.config.template.yaml +18 -2
- package/reference/sdlc/decide.playbook/decide.fsm.d.ts +13 -6
- package/reference/sdlc/decide.playbook/decide.fsm.js +54 -27
- package/reference/sdlc/decide.playbook/decide.fsm.ts +68 -29
- package/reference/sdlc/decide.playbook/decide.gears.md +25 -19
- package/reference/sdlc/decide.playbook/decide.playbook.js +11 -3
- package/reference/sdlc/decide.playbook/decide.playbook.ts +11 -3
- package/reference/sdlc/decide.playbook/decide.registry.js +1 -1
- package/reference/sdlc/decide.playbook/decide.registry.ts +1 -1
- package/reference/sdlc/dev.md +52 -0
- package/reference/sdlc/dev.playbook/dev.fsm.d.ts +261 -0
- package/reference/sdlc/dev.playbook/dev.fsm.js +723 -0
- package/reference/sdlc/dev.playbook/dev.fsm.ts +988 -0
- package/reference/sdlc/dev.playbook/dev.gears.md +91 -0
- package/reference/sdlc/dev.playbook/dev.playbook.d.ts +21 -0
- package/reference/sdlc/dev.playbook/dev.playbook.js +143 -0
- package/reference/sdlc/dev.playbook/dev.playbook.ts +246 -0
- package/reference/sdlc/dev.playbook/dev.registry.d.ts +40 -0
- package/reference/sdlc/dev.playbook/dev.registry.js +64 -0
- package/reference/sdlc/dev.playbook/dev.registry.ts +120 -0
- package/reference/sdlc/review.playbook/review.fsm.d.ts +15 -2
- package/reference/sdlc/review.playbook/review.fsm.js +77 -27
- package/reference/sdlc/review.playbook/review.fsm.ts +96 -30
- package/reference/sdlc/review.playbook/review.gears.md +52 -26
- package/reference/sdlc/review.playbook/review.playbook.js +17 -7
- package/reference/sdlc/review.playbook/review.playbook.ts +17 -7
- package/reference/sdlc/review.playbook/review.registry.js +1 -1
- package/reference/sdlc/review.playbook/review.registry.ts +1 -1
- package/slc/gears2fsm.md +20 -0
- package/slc/link.md +28 -5
- package/slc/text2gears.md +21 -1
- package/src/xstate-playbook-runtime.js +5 -2
- package/src/xstate-playbook-runtime.ts +5 -2
- package/src/xstate-runtime.js +13 -1
- package/src/xstate-runtime.ts +13 -1
|
@@ -0,0 +1,261 @@
|
|
|
1
|
+
export type JsonValue = null | boolean | number | string | readonly JsonValue[] | {
|
|
2
|
+
readonly [key: string]: JsonValue;
|
|
3
|
+
};
|
|
4
|
+
export type DevStateId = 'planAnalysis' | 'callCode' | 'callDecide' | 'callCodeAfterDecide';
|
|
5
|
+
export type DevSourceItem = 'DEV-1' | 'DEV-2' | 'DEV-3' | 'DEV-4';
|
|
6
|
+
export type DevChildPlaybookId = 'code' | 'decide';
|
|
7
|
+
export type PendingBossQuestion = {
|
|
8
|
+
readonly questionId: 'planAnalysis';
|
|
9
|
+
readonly resumeStateId: 'planAnalysis';
|
|
10
|
+
readonly sourceItem: 'DEV-1';
|
|
11
|
+
readonly asker: {
|
|
12
|
+
readonly kind: 'role';
|
|
13
|
+
readonly roleId: 'analyst';
|
|
14
|
+
};
|
|
15
|
+
readonly question: string;
|
|
16
|
+
};
|
|
17
|
+
export type DiscussionExchange = {
|
|
18
|
+
readonly question: string;
|
|
19
|
+
readonly answer: string;
|
|
20
|
+
};
|
|
21
|
+
export type PlayerInput = {
|
|
22
|
+
readonly stateId: 'planAnalysis';
|
|
23
|
+
readonly role: 'analyst';
|
|
24
|
+
readonly sourceItem: 'DEV-1';
|
|
25
|
+
readonly prompt: string;
|
|
26
|
+
readonly result: Readonly<Record<string, string>>;
|
|
27
|
+
readonly developmentRequest: string;
|
|
28
|
+
readonly discussionContext: string;
|
|
29
|
+
readonly runResults: string;
|
|
30
|
+
readonly pendingBossQuestion?: PendingBossQuestion;
|
|
31
|
+
readonly bossReply?: string;
|
|
32
|
+
};
|
|
33
|
+
export type PlayerOutput = {
|
|
34
|
+
readonly guard: 'discussionComplete';
|
|
35
|
+
} | {
|
|
36
|
+
readonly guard: 'code';
|
|
37
|
+
readonly planningResult: string;
|
|
38
|
+
} | {
|
|
39
|
+
readonly guard: 'decideThenCode';
|
|
40
|
+
readonly planningResult: string;
|
|
41
|
+
} | {
|
|
42
|
+
readonly guard: 'needsBossReply';
|
|
43
|
+
readonly question: string;
|
|
44
|
+
};
|
|
45
|
+
export type PlaybookInput = {
|
|
46
|
+
readonly stateId: 'callCode' | 'callDecide' | 'callCodeAfterDecide';
|
|
47
|
+
readonly sourceItem: 'DEV-2' | 'DEV-3' | 'DEV-4';
|
|
48
|
+
readonly playbookId: DevChildPlaybookId;
|
|
49
|
+
readonly text: string;
|
|
50
|
+
};
|
|
51
|
+
/**
|
|
52
|
+
* The affirmative success proof DEV requires from `decide`'s canonical
|
|
53
|
+
* structured terminal output before starting the dependent `code` call:
|
|
54
|
+
* the `decide`-owned commit, the exact evaluated repository revision, and
|
|
55
|
+
* the affirmative no-unsettled-findings fact. Additional members belong to
|
|
56
|
+
* DECIDE's own contract and do not disprove success.
|
|
57
|
+
*/
|
|
58
|
+
export type DecideSuccessOutput = {
|
|
59
|
+
readonly decideCommit: string;
|
|
60
|
+
readonly evaluatedRevision: string;
|
|
61
|
+
readonly noUnsettledFindings: true;
|
|
62
|
+
};
|
|
63
|
+
export type CompactError = {
|
|
64
|
+
readonly name: string;
|
|
65
|
+
readonly message: string;
|
|
66
|
+
};
|
|
67
|
+
/** Sanitized canonical child result relayed as DEV's own failure outcome. */
|
|
68
|
+
export type CompletedChildResult = {
|
|
69
|
+
readonly playbookId: DevChildPlaybookId;
|
|
70
|
+
readonly status: 'ok';
|
|
71
|
+
readonly output?: JsonValue;
|
|
72
|
+
} | {
|
|
73
|
+
readonly playbookId: DevChildPlaybookId;
|
|
74
|
+
readonly status: 'aborted' | 'error';
|
|
75
|
+
readonly error: CompactError;
|
|
76
|
+
};
|
|
77
|
+
export type DevPlaybookOutput = {
|
|
78
|
+
readonly status: 'discussion-complete';
|
|
79
|
+
} | {
|
|
80
|
+
readonly status: 'complete';
|
|
81
|
+
readonly childPlaybookId: 'code';
|
|
82
|
+
/** The successful result of DEV's final child call, when it has one. */
|
|
83
|
+
readonly childOutput?: JsonValue;
|
|
84
|
+
} | {
|
|
85
|
+
readonly status: 'child-failed';
|
|
86
|
+
/** The relayed canonical child result that ended the selected path. */
|
|
87
|
+
readonly childResult: CompletedChildResult;
|
|
88
|
+
};
|
|
89
|
+
export type DevInput = {
|
|
90
|
+
readonly runResults?: string;
|
|
91
|
+
};
|
|
92
|
+
export type DevContext = {
|
|
93
|
+
readonly runResults: string;
|
|
94
|
+
readonly developmentRequest?: string;
|
|
95
|
+
readonly discussionExchanges: readonly DiscussionExchange[];
|
|
96
|
+
readonly planningResult?: string;
|
|
97
|
+
readonly decideCommit?: string;
|
|
98
|
+
readonly evaluatedRevision?: string;
|
|
99
|
+
readonly completion?: 'discussion-complete' | 'complete' | 'child-failed';
|
|
100
|
+
readonly childOutput?: JsonValue;
|
|
101
|
+
readonly childFailure?: CompletedChildResult;
|
|
102
|
+
readonly lastError?: unknown;
|
|
103
|
+
readonly pendingBossQuestion?: PendingBossQuestion;
|
|
104
|
+
readonly bossReply?: string;
|
|
105
|
+
};
|
|
106
|
+
export type DevEvent = {
|
|
107
|
+
readonly type: 'START_DEV';
|
|
108
|
+
readonly developmentRequest: string;
|
|
109
|
+
} | {
|
|
110
|
+
readonly type: 'BOSS_REPLY';
|
|
111
|
+
readonly answer: string;
|
|
112
|
+
readonly questionId?: 'planAnalysis';
|
|
113
|
+
};
|
|
114
|
+
/** Consumed planning Q&A rendered for later relayed discussion context. */
|
|
115
|
+
export declare function renderDiscussionContext(exchanges: readonly DiscussionExchange[]): string;
|
|
116
|
+
export declare const devMachine: import("xstate").StateMachine<DevContext, {
|
|
117
|
+
readonly type: "START_DEV";
|
|
118
|
+
readonly developmentRequest: string;
|
|
119
|
+
} | {
|
|
120
|
+
readonly type: "BOSS_REPLY";
|
|
121
|
+
readonly answer: string;
|
|
122
|
+
readonly questionId?: "planAnalysis";
|
|
123
|
+
}, {
|
|
124
|
+
[x: string]: import("xstate").ActorRefFromLogic<import("xstate").PromiseActorLogic<JsonValue | undefined, PlaybookInput, import("xstate").EventObject>> | import("xstate").ActorRefFromLogic<import("xstate").PromiseActorLogic<PlayerOutput, PlayerInput, import("xstate").EventObject>> | undefined;
|
|
125
|
+
}, {
|
|
126
|
+
src: "playbook";
|
|
127
|
+
logic: import("xstate").PromiseActorLogic<JsonValue | undefined, PlaybookInput, import("xstate").EventObject>;
|
|
128
|
+
id: string | undefined;
|
|
129
|
+
} | {
|
|
130
|
+
src: "player";
|
|
131
|
+
logic: import("xstate").PromiseActorLogic<PlayerOutput, PlayerInput, import("xstate").EventObject>;
|
|
132
|
+
id: string | undefined;
|
|
133
|
+
}, {
|
|
134
|
+
type: "playbook.acceptedOutcome";
|
|
135
|
+
params: {
|
|
136
|
+
readonly source: string;
|
|
137
|
+
readonly target: string;
|
|
138
|
+
readonly acceptedOutcome: string;
|
|
139
|
+
};
|
|
140
|
+
} | {
|
|
141
|
+
type: "rememberActorError";
|
|
142
|
+
params: import("xstate").NonReducibleUnknown;
|
|
143
|
+
} | {
|
|
144
|
+
type: "rememberPendingQuestion";
|
|
145
|
+
params: import("xstate").NonReducibleUnknown;
|
|
146
|
+
} | {
|
|
147
|
+
type: "rememberBossReply";
|
|
148
|
+
params: import("xstate").NonReducibleUnknown;
|
|
149
|
+
} | {
|
|
150
|
+
type: "rememberEmptyBossReplyError";
|
|
151
|
+
params: import("xstate").NonReducibleUnknown;
|
|
152
|
+
} | {
|
|
153
|
+
type: "rememberMalformedPlayerOutput";
|
|
154
|
+
params: import("xstate").NonReducibleUnknown;
|
|
155
|
+
} | {
|
|
156
|
+
type: "startDev";
|
|
157
|
+
params: import("xstate").NonReducibleUnknown;
|
|
158
|
+
} | {
|
|
159
|
+
type: "completeDiscussion";
|
|
160
|
+
params: import("xstate").NonReducibleUnknown;
|
|
161
|
+
} | {
|
|
162
|
+
type: "rememberCodePath";
|
|
163
|
+
params: import("xstate").NonReducibleUnknown;
|
|
164
|
+
} | {
|
|
165
|
+
type: "rememberDecidePath";
|
|
166
|
+
params: import("xstate").NonReducibleUnknown;
|
|
167
|
+
} | {
|
|
168
|
+
type: "rememberDecideResult";
|
|
169
|
+
params: import("xstate").NonReducibleUnknown;
|
|
170
|
+
} | {
|
|
171
|
+
type: "completeWithChildSuccess";
|
|
172
|
+
params: import("xstate").NonReducibleUnknown;
|
|
173
|
+
} | {
|
|
174
|
+
type: "completeWithInsufficientCodeResult";
|
|
175
|
+
params: import("xstate").NonReducibleUnknown;
|
|
176
|
+
} | {
|
|
177
|
+
type: "completeWithInsufficientDecideResult";
|
|
178
|
+
params: import("xstate").NonReducibleUnknown;
|
|
179
|
+
} | {
|
|
180
|
+
type: "completeWithCodeFailure";
|
|
181
|
+
params: import("xstate").NonReducibleUnknown;
|
|
182
|
+
} | {
|
|
183
|
+
type: "completeWithDecideFailure";
|
|
184
|
+
params: import("xstate").NonReducibleUnknown;
|
|
185
|
+
}, {
|
|
186
|
+
type: "needsBossReply";
|
|
187
|
+
params: unknown;
|
|
188
|
+
} | {
|
|
189
|
+
type: "emptyBossReply";
|
|
190
|
+
params: unknown;
|
|
191
|
+
} | {
|
|
192
|
+
type: "isDiscussionComplete";
|
|
193
|
+
params: unknown;
|
|
194
|
+
} | {
|
|
195
|
+
type: "isCodePath";
|
|
196
|
+
params: unknown;
|
|
197
|
+
} | {
|
|
198
|
+
type: "isDecideThenCode";
|
|
199
|
+
params: unknown;
|
|
200
|
+
} | {
|
|
201
|
+
type: "isCodeSuccess";
|
|
202
|
+
params: unknown;
|
|
203
|
+
} | {
|
|
204
|
+
type: "isDecideSuccess";
|
|
205
|
+
params: unknown;
|
|
206
|
+
} | {
|
|
207
|
+
type: "authoredCodeFailure";
|
|
208
|
+
params: unknown;
|
|
209
|
+
} | {
|
|
210
|
+
type: "authoredDecideFailure";
|
|
211
|
+
params: unknown;
|
|
212
|
+
} | {
|
|
213
|
+
type: "resumesPlanAnalysis";
|
|
214
|
+
params: unknown;
|
|
215
|
+
}, never, "done" | "failed" | "awaitBossReply" | "ready" | "planAnalysis" | "callCode" | "callDecide" | "callCodeAfterDecide" | "discussionComplete" | "reportedChildFailure", string, DevInput, {
|
|
216
|
+
readonly status: "discussion-complete";
|
|
217
|
+
} | {
|
|
218
|
+
readonly status: "complete";
|
|
219
|
+
readonly childPlaybookId: "code";
|
|
220
|
+
/** The successful result of DEV's final child call, when it has one. */
|
|
221
|
+
readonly childOutput?: JsonValue;
|
|
222
|
+
} | {
|
|
223
|
+
readonly status: "child-failed";
|
|
224
|
+
/** The relayed canonical child result that ended the selected path. */
|
|
225
|
+
readonly childResult: CompletedChildResult;
|
|
226
|
+
}, import("xstate").EventObject, import("xstate").MetaObject, {
|
|
227
|
+
id: "dev";
|
|
228
|
+
states: {
|
|
229
|
+
readonly ready: {
|
|
230
|
+
id: "ready";
|
|
231
|
+
};
|
|
232
|
+
readonly planAnalysis: {
|
|
233
|
+
id: "planAnalysis";
|
|
234
|
+
};
|
|
235
|
+
readonly callCode: {
|
|
236
|
+
id: "callCode";
|
|
237
|
+
};
|
|
238
|
+
readonly callDecide: {
|
|
239
|
+
id: "callDecide";
|
|
240
|
+
};
|
|
241
|
+
readonly callCodeAfterDecide: {
|
|
242
|
+
id: "callCodeAfterDecide";
|
|
243
|
+
};
|
|
244
|
+
readonly awaitBossReply: {
|
|
245
|
+
id: "awaitBossReply";
|
|
246
|
+
};
|
|
247
|
+
readonly failed: {
|
|
248
|
+
id: "failed";
|
|
249
|
+
};
|
|
250
|
+
readonly discussionComplete: {
|
|
251
|
+
id: "discussionComplete";
|
|
252
|
+
};
|
|
253
|
+
readonly done: {
|
|
254
|
+
id: "done";
|
|
255
|
+
};
|
|
256
|
+
readonly reportedChildFailure: {
|
|
257
|
+
id: "reportedChildFailure";
|
|
258
|
+
};
|
|
259
|
+
};
|
|
260
|
+
}>;
|
|
261
|
+
export default devMachine;
|