@sublang/playbook 1.0.0 → 2.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 +8 -1
- package/package.json +6 -2
- package/reference/sdlc/captain.playbook/captain.fsm.d.ts +1 -1
- package/reference/sdlc/code.playbook/bin/playbook.js +6 -2
- package/reference/sdlc/code.playbook/bin/run.js +110 -4
- package/reference/sdlc/code.playbook/code.playbook.d.ts +4 -16
- package/reference/sdlc/code.playbook/code.playbook.js +88 -1272
- package/reference/sdlc/code.playbook/code.playbook.ts +127 -1547
- package/reference/sdlc/code.playbook/playbook.config.template.yaml +11 -0
- package/reference/sdlc/discuss.playbook/discuss.fsm.d.ts +1 -1
- package/slc/link.md +122 -47
- package/slc/optimize.md +7 -3
- package/slc/text2gears.md +8 -2
- package/src/runtime.d.ts +1 -0
- package/src/runtime.ts +1 -0
- package/src/xstate-playbook-runtime.d.ts +201 -0
- package/src/xstate-playbook-runtime.js +2099 -0
- package/src/xstate-playbook-runtime.ts +2849 -0
- package/src/xstate-runtime.d.ts +1 -0
- package/src/xstate-runtime.js +11 -0
- package/src/xstate-runtime.ts +14 -0
package/src/xstate-runtime.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { type AnyActorRef, type PromiseActorLogic, type SnapshotFrom } from 'xstate';
|
|
2
2
|
import type { CaptainResult, JsonValue, NormalizedError, PlaybookCallRequest, PlaybookCallResult, PlaybookCallStart, PlaybookPendingCall, PlaybookRuntimeSnapshot, PlaybookSession, PlaybookState, PlayerResult } from './runtime.js';
|
|
3
|
+
export * from './xstate-playbook-runtime.js';
|
|
3
4
|
/**
|
|
4
5
|
* Compose invocation-lifetime and imperative-boundary cancellation without
|
|
5
6
|
* installing a second forwarding listener in each generated runtime.
|
package/src/xstate-runtime.js
CHANGED
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
// SPDX-License-Identifier: Apache-2.0
|
|
2
2
|
// SPDX-FileCopyrightText: 2026 SubLang International <https://sublang.ai>
|
|
3
3
|
import { fromPromise, waitFor, } from 'xstate';
|
|
4
|
+
// DR-019: the generic linked-runtime factory and its strategy helpers live
|
|
5
|
+
// in the sibling module and are re-exported here so linked artifacts import
|
|
6
|
+
// one shared engine surface.
|
|
7
|
+
export * from './xstate-playbook-runtime.js';
|
|
4
8
|
const BUSY_TAG = 'playbook.busy';
|
|
5
9
|
const SUSPENDED_TAG = 'playbook.suspended';
|
|
6
10
|
function deferred() {
|
|
@@ -514,6 +518,13 @@ export function assertPlaybookRuntimeSnapshot(value, expectedPlaybookId) {
|
|
|
514
518
|
}
|
|
515
519
|
sequences[key] = sequence;
|
|
516
520
|
}
|
|
521
|
+
const captainCall = value.sequences.captainCall;
|
|
522
|
+
if (captainCall !== undefined) {
|
|
523
|
+
if (!Number.isSafeInteger(captainCall) || captainCall < 0) {
|
|
524
|
+
throw new TypeError('runtime snapshot sequences.captainCall must be a non-negative integer');
|
|
525
|
+
}
|
|
526
|
+
sequences.captainCall = captainCall;
|
|
527
|
+
}
|
|
517
528
|
validateState(value.state, 'runtime snapshot state');
|
|
518
529
|
const state = snapshotJsonValue(value.state, 'runtime snapshot state');
|
|
519
530
|
if (!Array.isArray(value.pendingBossQuestions)) {
|
package/src/xstate-runtime.ts
CHANGED
|
@@ -25,6 +25,11 @@ import type {
|
|
|
25
25
|
PlayerResult,
|
|
26
26
|
} from './runtime.js';
|
|
27
27
|
|
|
28
|
+
// DR-019: the generic linked-runtime factory and its strategy helpers live
|
|
29
|
+
// in the sibling module and are re-exported here so linked artifacts import
|
|
30
|
+
// one shared engine surface.
|
|
31
|
+
export * from './xstate-playbook-runtime.js';
|
|
32
|
+
|
|
28
33
|
const BUSY_TAG = 'playbook.busy';
|
|
29
34
|
const SUSPENDED_TAG = 'playbook.suspended';
|
|
30
35
|
|
|
@@ -738,6 +743,15 @@ export function assertPlaybookRuntimeSnapshot(
|
|
|
738
743
|
}
|
|
739
744
|
sequences[key] = sequence as number;
|
|
740
745
|
}
|
|
746
|
+
const captainCall = value.sequences.captainCall;
|
|
747
|
+
if (captainCall !== undefined) {
|
|
748
|
+
if (!Number.isSafeInteger(captainCall) || (captainCall as number) < 0) {
|
|
749
|
+
throw new TypeError(
|
|
750
|
+
'runtime snapshot sequences.captainCall must be a non-negative integer',
|
|
751
|
+
);
|
|
752
|
+
}
|
|
753
|
+
sequences.captainCall = captainCall as number;
|
|
754
|
+
}
|
|
741
755
|
validateState(value.state, 'runtime snapshot state');
|
|
742
756
|
const state = snapshotJsonValue(
|
|
743
757
|
value.state,
|