@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
|
@@ -1,153 +0,0 @@
|
|
|
1
|
-
// SPDX-License-Identifier: Apache-2.0
|
|
2
|
-
// SPDX-FileCopyrightText: 2026 SubLang International <https://sublang.ai>
|
|
3
|
-
|
|
4
|
-
// Registry entry for the DISCUSS playbook — the host-side adapter the generic
|
|
5
|
-
// `playbook` launcher loads via a config block's `from:` specifier. The three
|
|
6
|
-
// core artifacts beside this file (discuss.gears.md, discuss.fsm.ts,
|
|
7
|
-
// discuss.playbook.ts) were compiled by `slc playbook reference/sdlc/discuss.md`
|
|
8
|
-
// through slc's pinned compiled meta-phase playbooks and verified by slc's
|
|
9
|
-
// generated compilation-correctness tests; this entry is hand-written host
|
|
10
|
-
// infrastructure, out of slc's compile scope (slc DR-009).
|
|
11
|
-
|
|
12
|
-
import type { PlaybookRuntime } from '@sublang/playbook/runtime';
|
|
13
|
-
|
|
14
|
-
import createPlaybookRuntime from './discuss.playbook.js';
|
|
15
|
-
import type { PlaybookRuntimeOptions } from './discuss.playbook.js';
|
|
16
|
-
|
|
17
|
-
export interface RegistryPlayer {
|
|
18
|
-
id: string;
|
|
19
|
-
adapter?: string;
|
|
20
|
-
model?: string;
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
export interface CreateDiscussRuntimeOptions {
|
|
24
|
-
captainOptions: unknown;
|
|
25
|
-
players: readonly RegistryPlayer[];
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
export interface DiscussOptions {
|
|
29
|
-
/** Which alias alternative runs `Committer` commits; defaults to `host`. */
|
|
30
|
-
committer?: 'host' | 'participant';
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
const DISCUSS_OPTION_KEYS = new Set(['committer']);
|
|
34
|
-
const COMMITTER_PLAYER_IDS = new Set(['host', 'participant']);
|
|
35
|
-
|
|
36
|
-
export function validateDiscussOptions(optionSlice: unknown): DiscussOptions {
|
|
37
|
-
if (optionSlice === undefined) return {};
|
|
38
|
-
if (
|
|
39
|
-
typeof optionSlice !== 'object' ||
|
|
40
|
-
optionSlice === null ||
|
|
41
|
-
Array.isArray(optionSlice)
|
|
42
|
-
) {
|
|
43
|
-
throw new Error(
|
|
44
|
-
'captain.options.playbooks.discuss.options must be an object',
|
|
45
|
-
);
|
|
46
|
-
}
|
|
47
|
-
const slice = optionSlice as Record<string, unknown>;
|
|
48
|
-
for (const key of Object.keys(slice)) {
|
|
49
|
-
if (!DISCUSS_OPTION_KEYS.has(key)) {
|
|
50
|
-
throw new Error(
|
|
51
|
-
`Unknown config field captain.options.playbooks.discuss.options.${key}`,
|
|
52
|
-
);
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
const options: DiscussOptions = {};
|
|
56
|
-
const committer = slice.committer;
|
|
57
|
-
if (committer !== undefined) {
|
|
58
|
-
if (typeof committer !== 'string' || !COMMITTER_PLAYER_IDS.has(committer)) {
|
|
59
|
-
throw new Error(
|
|
60
|
-
"captain.options.playbooks.discuss.options.committer must be " +
|
|
61
|
-
"'host' or 'participant'",
|
|
62
|
-
);
|
|
63
|
-
}
|
|
64
|
-
options.committer = committer as 'host' | 'participant';
|
|
65
|
-
}
|
|
66
|
-
return options;
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
function playerIdentity(
|
|
70
|
-
players: readonly RegistryPlayer[],
|
|
71
|
-
id: string,
|
|
72
|
-
): string | undefined {
|
|
73
|
-
const entry = players.find((p) => p.id === id);
|
|
74
|
-
return entry?.model ?? entry?.adapter;
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
export function createDiscussRuntimeOptions({
|
|
78
|
-
captainOptions,
|
|
79
|
-
players,
|
|
80
|
-
}: CreateDiscussRuntimeOptions): PlaybookRuntimeOptions {
|
|
81
|
-
const discussOptions = validateDiscussOptions(captainOptions);
|
|
82
|
-
const options: PlaybookRuntimeOptions = {
|
|
83
|
-
host: playerIdentity(players, 'host'),
|
|
84
|
-
participant: playerIdentity(players, 'participant'),
|
|
85
|
-
};
|
|
86
|
-
if (discussOptions.committer !== undefined) {
|
|
87
|
-
options.committer = discussOptions.committer;
|
|
88
|
-
}
|
|
89
|
-
return options;
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
// CAPTAIN-19/20: the DISCUSS turn-summary policy — counted round states,
|
|
93
|
-
// the payload-carrying guards whose content Boss would otherwise relay
|
|
94
|
-
// between the players by hand, and the saved-counts wording — so the shell
|
|
95
|
-
// reports how many interruptions a run saved.
|
|
96
|
-
const discussStateCountLabels = {
|
|
97
|
-
initialProposalRound: 'proposal round',
|
|
98
|
-
reconciliationRound: 'proposal round',
|
|
99
|
-
reviewSpecInitialCommit: 'review round',
|
|
100
|
-
reviewSpecHostChanges: 'review round',
|
|
101
|
-
reviewDrInitialCommit: 'review round',
|
|
102
|
-
reviewDrHostChanges: 'review round',
|
|
103
|
-
reviewMixedInitialCommit: 'review round',
|
|
104
|
-
reviewMixedHostChanges: 'review round',
|
|
105
|
-
} as const;
|
|
106
|
-
|
|
107
|
-
const discussCopyPasteGuardNames = [
|
|
108
|
-
'proposalMade',
|
|
109
|
-
'findingsRaised',
|
|
110
|
-
'rebuttalsRaised',
|
|
111
|
-
'rebuttalsAddressed',
|
|
112
|
-
'changesMade',
|
|
113
|
-
] as const;
|
|
114
|
-
|
|
115
|
-
function countNoun(count: number, singular: string, plural = `${singular}s`): string {
|
|
116
|
-
return `${count} ${count === 1 ? singular : plural}`;
|
|
117
|
-
}
|
|
118
|
-
|
|
119
|
-
export function discussSavedCountsLine(
|
|
120
|
-
counts: { interruptions: number; copyPastes: number },
|
|
121
|
-
rounds: number,
|
|
122
|
-
): string {
|
|
123
|
-
return [
|
|
124
|
-
'Saved you',
|
|
125
|
-
countNoun(counts.interruptions, 'interruption'),
|
|
126
|
-
'and',
|
|
127
|
-
countNoun(counts.copyPastes, 'copy-paste'),
|
|
128
|
-
'across',
|
|
129
|
-
countNoun(rounds, 'round'),
|
|
130
|
-
'of proposals/reviews.',
|
|
131
|
-
].join(' ');
|
|
132
|
-
}
|
|
133
|
-
|
|
134
|
-
export const discussSummaryPolicy = {
|
|
135
|
-
stateCountLabels: discussStateCountLabels,
|
|
136
|
-
copyPasteGuardNames: discussCopyPasteGuardNames,
|
|
137
|
-
savedCountsLine: discussSavedCountsLine,
|
|
138
|
-
};
|
|
139
|
-
|
|
140
|
-
export const discussPlaybookRegistryEntry = {
|
|
141
|
-
id: 'discuss',
|
|
142
|
-
command: 'discuss',
|
|
143
|
-
intent:
|
|
144
|
-
'design discussion: two agents converge on spec items or decision records',
|
|
145
|
-
requiredRoleIds: ['host', 'participant'],
|
|
146
|
-
summaryPolicy: discussSummaryPolicy,
|
|
147
|
-
validateOptions: validateDiscussOptions,
|
|
148
|
-
createRuntime(options: CreateDiscussRuntimeOptions): PlaybookRuntime {
|
|
149
|
-
return createPlaybookRuntime(createDiscussRuntimeOptions(options));
|
|
150
|
-
},
|
|
151
|
-
};
|
|
152
|
-
|
|
153
|
-
export default discussPlaybookRegistryEntry;
|