@sublang/playbook 7.0.0 → 9.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 +20 -7
- package/docs/cli.md +88 -43
- package/docs/configuration.md +221 -119
- package/docs/embedding.md +78 -27
- package/package.json +4 -3
- package/reference/sdlc/captain.playbook/captain.playbook.js +16 -5
- package/reference/sdlc/captain.playbook/captain.playbook.ts +20 -6
- package/reference/sdlc/code.md +1 -1
- package/reference/sdlc/code.playbook/bin/interactive-session.js +816 -0
- package/reference/sdlc/code.playbook/bin/launch-config.js +1078 -116
- package/reference/sdlc/code.playbook/bin/playbook.js +489 -34
- package/reference/sdlc/code.playbook/bin/run.js +283 -298
- package/reference/sdlc/code.playbook/bin/session-store.js +818 -26
- package/reference/sdlc/code.playbook/code.fsm.d.ts +9 -6
- package/reference/sdlc/code.playbook/code.fsm.introspect.js +2 -2
- package/reference/sdlc/code.playbook/code.fsm.introspect.ts +2 -2
- package/reference/sdlc/code.playbook/code.fsm.js +18 -15
- package/reference/sdlc/code.playbook/code.fsm.ts +21 -21
- package/reference/sdlc/code.playbook/code.gears.md +1 -1
- package/reference/sdlc/code.playbook/code.playbook.d.ts +2 -1
- package/reference/sdlc/code.playbook/code.playbook.js +25 -15
- package/reference/sdlc/code.playbook/code.playbook.ts +34 -17
- package/reference/sdlc/code.playbook/code.registry.d.ts +5 -13
- package/reference/sdlc/code.playbook/code.registry.js +3 -10
- package/reference/sdlc/code.playbook/code.registry.ts +7 -32
- package/reference/sdlc/code.playbook/playbook-captain.d.ts +39 -14
- package/reference/sdlc/code.playbook/playbook-captain.js +1014 -299
- package/reference/sdlc/code.playbook/playbook-captain.ts +1450 -406
- package/reference/sdlc/code.playbook/playbook.config.template.yaml +41 -49
- package/reference/sdlc/decide.md +4 -4
- package/reference/sdlc/decide.playbook/decide.fsm.d.ts +10 -10
- package/reference/sdlc/decide.playbook/decide.fsm.js +21 -14
- package/reference/sdlc/decide.playbook/decide.fsm.ts +27 -23
- package/reference/sdlc/decide.playbook/decide.gears.md +3 -5
- package/reference/sdlc/decide.playbook/decide.playbook.d.ts +11 -13
- package/reference/sdlc/decide.playbook/decide.playbook.js +465 -246
- package/reference/sdlc/decide.playbook/decide.playbook.ts +623 -283
- package/reference/sdlc/decide.playbook/decide.registry.d.ts +5 -13
- package/reference/sdlc/decide.playbook/decide.registry.js +3 -9
- package/reference/sdlc/decide.playbook/decide.registry.ts +7 -31
- package/reference/sdlc/review.md +4 -5
- package/reference/sdlc/review.playbook/review.fsm.d.ts +9 -11
- package/reference/sdlc/review.playbook/review.fsm.js +30 -24
- package/reference/sdlc/review.playbook/review.fsm.ts +39 -35
- package/reference/sdlc/review.playbook/review.gears.md +6 -5
- package/reference/sdlc/review.playbook/review.playbook.d.ts +2 -1
- package/reference/sdlc/review.playbook/review.playbook.js +29 -23
- package/reference/sdlc/review.playbook/review.playbook.ts +38 -28
- package/reference/sdlc/review.playbook/review.registry.d.ts +5 -13
- package/reference/sdlc/review.playbook/review.registry.js +3 -16
- package/reference/sdlc/review.playbook/review.registry.ts +7 -38
- package/slc/gears2fsm.md +45 -24
- package/slc/link.md +297 -135
- package/slc/text2gears.md +19 -18
- package/src/runtime.d.ts +21 -16
- package/src/runtime.ts +20 -23
- package/src/xstate-playbook-runtime.d.ts +34 -20
- package/src/xstate-playbook-runtime.js +973 -400
- package/src/xstate-playbook-runtime.ts +1203 -457
- package/src/xstate-runtime.d.ts +17 -7
- package/src/xstate-runtime.js +198 -81
- package/src/xstate-runtime.ts +339 -112
|
@@ -31,9 +31,9 @@
|
|
|
31
31
|
// deterministic entry mapping, the controller captain-call
|
|
32
32
|
// strategy with its single corrective re-ask (CAPPLAY-18),
|
|
33
33
|
// controller-port submission, and status formatting.
|
|
34
|
-
// Compat: spec.compat = { artifactSchema:
|
|
34
|
+
// Compat: spec.compat = { artifactSchema: 2, runtimeAbi: 1 }
|
|
35
35
|
// (DR-022; checked at construction by the loading engine).
|
|
36
|
-
import { createXStatePlaybookRuntime, defaultComposeCaptainPrompt, normalizeError, normalizeErrorCompact, parseJudgeJson, snapshotJsonValue,
|
|
36
|
+
import { createXStatePlaybookRuntime, defaultComposeCaptainPrompt, normalizeError, normalizeErrorCompact, parseJudgeJson, snapshotJsonValue, } from '../../../src/xstate-runtime.js';
|
|
37
37
|
import { captainMachine, } from './captain.fsm.js';
|
|
38
38
|
function assertNonEmptyString(value, label) {
|
|
39
39
|
if (typeof value !== 'string' || value.trim().length === 0) {
|
|
@@ -516,11 +516,15 @@ export const _internal = {
|
|
|
516
516
|
// describe/apply control surface — lives in @sublang/playbook/xstate-runtime.
|
|
517
517
|
const runtimeSpec = {
|
|
518
518
|
label: 'CAPTAIN',
|
|
519
|
-
|
|
519
|
+
// DR-022 / slc/link.md: the declaration carries the value current at link
|
|
520
|
+
// time — a literal, never the loading engine's RUNTIME_ABI self-report,
|
|
521
|
+
// which would follow whatever engine loads the module and make the
|
|
522
|
+
// factory's skew check compare that engine with itself.
|
|
523
|
+
compat: { artifactSchema: 2, runtimeAbi: 1 },
|
|
520
524
|
snapshotOptions: snapshotCaptainOptions,
|
|
521
525
|
machineInput: (options) => ({ enabledPlaybooks: options.enabledPlaybooks }),
|
|
522
526
|
classifyBossText: (text, ports, signal, snapshotOrState, boundary, options) => classifyControllerTurn(text, ports, signal, snapshotOrState, boundary, options),
|
|
523
|
-
|
|
527
|
+
roleStates: {},
|
|
524
528
|
classificationStatus: () => undefined,
|
|
525
529
|
captainStrategy: controllerCaptainStrategy,
|
|
526
530
|
// CAPPLAY-10 / PBRT-52: the Captain's own ControlView context projection —
|
|
@@ -543,8 +547,15 @@ const runtimeSpec = {
|
|
|
543
547
|
],
|
|
544
548
|
statusesForState,
|
|
545
549
|
};
|
|
546
|
-
|
|
550
|
+
// DR-022's compat check fails fast at factory construction. The Captain is
|
|
551
|
+
// statically imported by the shell and both CLI front ends, so constructing
|
|
552
|
+
// here at module evaluation would turn a future compat mismatch into an
|
|
553
|
+
// uncaught ESM-load error that takes even `--help` down; constructing on
|
|
554
|
+
// the first runtime request keeps the failure inside the caught
|
|
555
|
+
// host-construction boundary that owes the Boss a setup diagnostic.
|
|
556
|
+
let createCaptainPlaybookRuntime;
|
|
547
557
|
export function createPlaybookRuntime(options) {
|
|
558
|
+
createCaptainPlaybookRuntime ??= createXStatePlaybookRuntime(captainMachine, runtimeSpec);
|
|
548
559
|
return createCaptainPlaybookRuntime(options);
|
|
549
560
|
}
|
|
550
561
|
const factory = createPlaybookRuntime;
|
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
// deterministic entry mapping, the controller captain-call
|
|
32
32
|
// strategy with its single corrective re-ask (CAPPLAY-18),
|
|
33
33
|
// controller-port submission, and status formatting.
|
|
34
|
-
// Compat: spec.compat = { artifactSchema:
|
|
34
|
+
// Compat: spec.compat = { artifactSchema: 2, runtimeAbi: 1 }
|
|
35
35
|
// (DR-022; checked at construction by the loading engine).
|
|
36
36
|
|
|
37
37
|
import {
|
|
@@ -41,7 +41,6 @@ import {
|
|
|
41
41
|
normalizeErrorCompact,
|
|
42
42
|
parseJudgeJson,
|
|
43
43
|
snapshotJsonValue,
|
|
44
|
-
RUNTIME_ABI,
|
|
45
44
|
type PlaybookActorOutput,
|
|
46
45
|
type PlaybookCaptainInput,
|
|
47
46
|
type ScheduledStatus,
|
|
@@ -798,7 +797,11 @@ export const _internal = {
|
|
|
798
797
|
// describe/apply control surface — lives in @sublang/playbook/xstate-runtime.
|
|
799
798
|
const runtimeSpec: XStatePlaybookRuntimeSpec<ValidatedCaptainOptions> = {
|
|
800
799
|
label: 'CAPTAIN',
|
|
801
|
-
|
|
800
|
+
// DR-022 / slc/link.md: the declaration carries the value current at link
|
|
801
|
+
// time — a literal, never the loading engine's RUNTIME_ABI self-report,
|
|
802
|
+
// which would follow whatever engine loads the module and make the
|
|
803
|
+
// factory's skew check compare that engine with itself.
|
|
804
|
+
compat: { artifactSchema: 2, runtimeAbi: 1 },
|
|
802
805
|
snapshotOptions: snapshotCaptainOptions,
|
|
803
806
|
machineInput: (options) => ({ enabledPlaybooks: options.enabledPlaybooks }),
|
|
804
807
|
classifyBossText: (text, ports, signal, snapshotOrState, boundary, options) =>
|
|
@@ -810,7 +813,7 @@ const runtimeSpec: XStatePlaybookRuntimeSpec<ValidatedCaptainOptions> = {
|
|
|
810
813
|
boundary,
|
|
811
814
|
options,
|
|
812
815
|
) as Promise<import('xstate').EventObject | undefined>,
|
|
813
|
-
|
|
816
|
+
roleStates: {},
|
|
814
817
|
classificationStatus: () => undefined,
|
|
815
818
|
captainStrategy: controllerCaptainStrategy,
|
|
816
819
|
// CAPPLAY-10 / PBRT-52: the Captain's own ControlView context projection —
|
|
@@ -834,12 +837,23 @@ const runtimeSpec: XStatePlaybookRuntimeSpec<ValidatedCaptainOptions> = {
|
|
|
834
837
|
statusesForState,
|
|
835
838
|
};
|
|
836
839
|
|
|
837
|
-
|
|
838
|
-
|
|
840
|
+
// DR-022's compat check fails fast at factory construction. The Captain is
|
|
841
|
+
// statically imported by the shell and both CLI front ends, so constructing
|
|
842
|
+
// here at module evaluation would turn a future compat mismatch into an
|
|
843
|
+
// uncaught ESM-load error that takes even `--help` down; constructing on
|
|
844
|
+
// the first runtime request keeps the failure inside the caught
|
|
845
|
+
// host-construction boundary that owes the Boss a setup diagnostic.
|
|
846
|
+
let createCaptainPlaybookRuntime:
|
|
847
|
+
| PlaybookRuntimeFactory<ValidatedCaptainOptions>
|
|
848
|
+
| undefined;
|
|
839
849
|
|
|
840
850
|
export function createPlaybookRuntime(
|
|
841
851
|
options: PlaybookRuntimeOptions,
|
|
842
852
|
): PlaybookRuntime {
|
|
853
|
+
createCaptainPlaybookRuntime ??= createXStatePlaybookRuntime(
|
|
854
|
+
captainMachine,
|
|
855
|
+
runtimeSpec,
|
|
856
|
+
);
|
|
843
857
|
return createCaptainPlaybookRuntime(options);
|
|
844
858
|
}
|
|
845
859
|
|