@sublang/playbook 15.0.0 → 16.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 +1 -1
- package/docs/embedding.md +9 -7
- package/package.json +3 -1
- package/reference/sdlc/branch.playbook/branch.fsm.d.ts +63 -33
- package/reference/sdlc/branch.playbook/branch.fsm.js +190 -108
- package/reference/sdlc/branch.playbook/branch.fsm.ts +269 -147
- package/reference/sdlc/branch.playbook/branch.gears.md +7 -17
- package/reference/sdlc/branch.playbook/branch.playbook.d.ts +12 -16
- package/reference/sdlc/branch.playbook/branch.playbook.js +112 -101
- package/reference/sdlc/branch.playbook/branch.playbook.ts +128 -171
- package/reference/sdlc/branch.playbook/branch.registry.d.ts +3 -2
- package/reference/sdlc/branch.playbook/branch.registry.ts +6 -2
- package/reference/sdlc/code.playbook/bin/repository-effects.js +54 -13
- package/reference/sdlc/code.playbook/code.fsm.d.ts +143 -90
- package/reference/sdlc/code.playbook/code.fsm.introspect.d.ts +8 -8
- package/reference/sdlc/code.playbook/code.fsm.introspect.ts +13 -13
- package/reference/sdlc/code.playbook/code.fsm.js +609 -649
- package/reference/sdlc/code.playbook/code.fsm.ts +890 -821
- package/reference/sdlc/code.playbook/code.gears.md +39 -29
- package/reference/sdlc/code.playbook/code.playbook.d.ts +13 -16
- package/reference/sdlc/code.playbook/code.playbook.js +166 -147
- package/reference/sdlc/code.playbook/code.playbook.ts +180 -229
- package/reference/sdlc/code.playbook/code.registry.d.ts +3 -2
- package/reference/sdlc/code.playbook/code.registry.ts +6 -2
- package/reference/sdlc/code.playbook/playbook-captain.d.ts +42 -0
- package/reference/sdlc/code.playbook/playbook-captain.js +829 -194
- package/reference/sdlc/code.playbook/playbook-captain.ts +1227 -220
- package/reference/sdlc/decide.md +1 -0
- package/reference/sdlc/decide.playbook/decide.fsm.d.ts +270 -154
- package/reference/sdlc/decide.playbook/decide.fsm.js +765 -732
- package/reference/sdlc/decide.playbook/decide.fsm.ts +1167 -945
- package/reference/sdlc/decide.playbook/decide.gears.md +28 -21
- package/reference/sdlc/decide.playbook/decide.playbook.d.ts +11 -67
- package/reference/sdlc/decide.playbook/decide.playbook.js +155 -3570
- package/reference/sdlc/decide.playbook/decide.playbook.ts +186 -5061
- package/reference/sdlc/decide.playbook/decide.registry.d.ts +8 -4
- package/reference/sdlc/decide.playbook/decide.registry.js +2 -2
- package/reference/sdlc/decide.playbook/decide.registry.ts +13 -6
- package/reference/sdlc/dev.playbook/dev.fsm.d.ts +113 -131
- package/reference/sdlc/dev.playbook/dev.fsm.js +517 -575
- package/reference/sdlc/dev.playbook/dev.fsm.ts +667 -787
- package/reference/sdlc/dev.playbook/dev.gears.md +52 -54
- package/reference/sdlc/dev.playbook/dev.playbook.d.ts +13 -10
- package/reference/sdlc/dev.playbook/dev.playbook.js +128 -120
- package/reference/sdlc/dev.playbook/dev.playbook.ts +143 -193
- package/reference/sdlc/dev.playbook/dev.registry.d.ts +3 -2
- package/reference/sdlc/dev.playbook/dev.registry.ts +6 -2
- package/reference/sdlc/pr.playbook/pr.fsm.d.ts +92 -85
- package/reference/sdlc/pr.playbook/pr.fsm.js +461 -518
- package/reference/sdlc/pr.playbook/pr.fsm.ts +533 -663
- package/reference/sdlc/pr.playbook/pr.gears.md +47 -63
- package/reference/sdlc/pr.playbook/pr.playbook.d.ts +13 -23
- package/reference/sdlc/pr.playbook/pr.playbook.js +118 -112
- package/reference/sdlc/pr.playbook/pr.playbook.ts +136 -190
- package/reference/sdlc/pr.playbook/pr.registry.d.ts +3 -2
- package/reference/sdlc/pr.playbook/pr.registry.ts +4 -2
- package/reference/sdlc/review.md +3 -3
- package/reference/sdlc/review.playbook/review.fsm.d.ts +150 -116
- package/reference/sdlc/review.playbook/review.fsm.js +479 -550
- package/reference/sdlc/review.playbook/review.fsm.ts +717 -662
- package/reference/sdlc/review.playbook/review.gears.md +32 -29
- package/reference/sdlc/review.playbook/review.playbook.d.ts +12 -12
- package/reference/sdlc/review.playbook/review.playbook.js +180 -155
- package/reference/sdlc/review.playbook/review.playbook.ts +190 -230
- package/reference/sdlc/review.playbook/review.registry.d.ts +6 -5
- package/reference/sdlc/review.playbook/review.registry.js +3 -3
- package/reference/sdlc/review.playbook/review.registry.ts +9 -5
- package/slc/gears2fsm.md +72 -3
- package/slc/link.md +50 -27
- package/slc/materialize-link.mjs +51 -13
- package/slc/optimize.md +4 -1
- package/slc/prefix-prompts.mjs +191 -0
- package/slc/prefix.md +203 -0
- package/slc/slc.pin-inputs.json +11 -1
- package/slc/text2gears.md +71 -11
- package/src/xstate-playbook-runtime.d.ts +82 -9
- package/src/xstate-playbook-runtime.js +1224 -283
- package/src/xstate-playbook-runtime.ts +1671 -338
- package/src/xstate-runtime.d.ts +3 -1
- package/src/xstate-runtime.js +9 -2
- package/src/xstate-runtime.ts +12 -2
package/src/xstate-runtime.d.ts
CHANGED
|
@@ -44,7 +44,9 @@ export interface SnapshotNormalizationOptions {
|
|
|
44
44
|
pendingCall?: PlaybookPendingCall;
|
|
45
45
|
}
|
|
46
46
|
export declare function normalizePlaybookSnapshot(snapshot: unknown, options?: SnapshotNormalizationOptions): PlaybookState;
|
|
47
|
-
export declare function detachPersistedMachineSnapshot(persisted: unknown
|
|
47
|
+
export declare function detachPersistedMachineSnapshot(persisted: unknown, completion?: {
|
|
48
|
+
readonly lastError?: NormalizedError;
|
|
49
|
+
}): JsonValue;
|
|
48
50
|
/** Authority for one governed delegated-player output field (DR-040 §1). */
|
|
49
51
|
export type PlaybookSemanticFieldAuthority = 'presentation' | 'semantic' | 'effect' | 'runtime';
|
|
50
52
|
/** One already-validated state-local governed outcome declaration. */
|
package/src/xstate-runtime.js
CHANGED
|
@@ -607,8 +607,15 @@ export function normalizePlaybookSnapshot(snapshot, options = {}) {
|
|
|
607
607
|
// DR-014 §1: deep-detach an XState persisted actor snapshot into strict
|
|
608
608
|
// JSON for a PlaybookRuntimeSnapshot, normalizing any raw Error value
|
|
609
609
|
// (for example FSM context `lastError`) instead of rejecting it.
|
|
610
|
-
|
|
611
|
-
|
|
610
|
+
// DR-063 §2: a runtime parked in its failure state supplies the `lastError`
|
|
611
|
+
// it publishes live — completed with the cause it decided — and that record
|
|
612
|
+
// replaces the context's own, which a thrown value may have refused to carry.
|
|
613
|
+
export function detachPersistedMachineSnapshot(persisted, completion = {}) {
|
|
614
|
+
const detached = withErrorsNormalized(persisted, new Set());
|
|
615
|
+
const lastError = completion.lastError;
|
|
616
|
+
return snapshotJsonValue(lastError !== undefined && isRecord(detached) && isRecord(detached.context)
|
|
617
|
+
? { ...detached, context: { ...detached.context, lastError } }
|
|
618
|
+
: detached, 'persisted machine snapshot');
|
|
612
619
|
}
|
|
613
620
|
function withErrorsNormalized(value, ancestors) {
|
|
614
621
|
if (value instanceof Error)
|
package/src/xstate-runtime.ts
CHANGED
|
@@ -902,9 +902,19 @@ export function normalizePlaybookSnapshot(
|
|
|
902
902
|
// DR-014 §1: deep-detach an XState persisted actor snapshot into strict
|
|
903
903
|
// JSON for a PlaybookRuntimeSnapshot, normalizing any raw Error value
|
|
904
904
|
// (for example FSM context `lastError`) instead of rejecting it.
|
|
905
|
-
|
|
905
|
+
// DR-063 §2: a runtime parked in its failure state supplies the `lastError`
|
|
906
|
+
// it publishes live — completed with the cause it decided — and that record
|
|
907
|
+
// replaces the context's own, which a thrown value may have refused to carry.
|
|
908
|
+
export function detachPersistedMachineSnapshot(
|
|
909
|
+
persisted: unknown,
|
|
910
|
+
completion: { readonly lastError?: NormalizedError } = {},
|
|
911
|
+
): JsonValue {
|
|
912
|
+
const detached = withErrorsNormalized(persisted, new Set());
|
|
913
|
+
const lastError = completion.lastError;
|
|
906
914
|
return snapshotJsonValue(
|
|
907
|
-
|
|
915
|
+
lastError !== undefined && isRecord(detached) && isRecord(detached.context)
|
|
916
|
+
? { ...detached, context: { ...detached.context, lastError } }
|
|
917
|
+
: detached,
|
|
908
918
|
'persisted machine snapshot',
|
|
909
919
|
);
|
|
910
920
|
}
|