@sublang/playbook 9.0.0 → 10.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/docs/cli.md +51 -8
- package/docs/embedding.md +38 -12
- package/package.json +7 -3
- package/reference/sdlc/captain.md +14 -10
- package/reference/sdlc/captain.playbook/captain.fsm.d.ts +33 -13
- package/reference/sdlc/captain.playbook/captain.fsm.js +80 -9
- package/reference/sdlc/captain.playbook/captain.fsm.ts +137 -18
- package/reference/sdlc/captain.playbook/captain.gears.md +10 -6
- package/reference/sdlc/captain.playbook/captain.playbook.d.ts +5 -1
- package/reference/sdlc/captain.playbook/captain.playbook.js +140 -10
- package/reference/sdlc/captain.playbook/captain.playbook.ts +188 -16
- package/reference/sdlc/code.md +0 -1
- package/reference/sdlc/code.playbook/bin/interactive-session.js +170 -17
- package/reference/sdlc/code.playbook/bin/launch-config.js +136 -4
- package/reference/sdlc/code.playbook/bin/playbook.js +81 -4
- package/reference/sdlc/code.playbook/bin/repository-effects.js +2930 -0
- package/reference/sdlc/code.playbook/bin/run.js +365 -63
- package/reference/sdlc/code.playbook/bin/session-store.js +2877 -209
- package/reference/sdlc/code.playbook/code.fsm.d.ts +7 -0
- package/reference/sdlc/code.playbook/code.fsm.js +74 -25
- package/reference/sdlc/code.playbook/code.fsm.ts +83 -29
- package/reference/sdlc/code.playbook/code.gears.md +0 -2
- package/reference/sdlc/code.playbook/code.playbook.d.ts +5 -2
- package/reference/sdlc/code.playbook/code.playbook.js +54 -2
- package/reference/sdlc/code.playbook/code.playbook.ts +75 -6
- package/reference/sdlc/code.playbook/code.registry.d.ts +10 -3
- package/reference/sdlc/code.playbook/code.registry.js +10 -3
- package/reference/sdlc/code.playbook/code.registry.ts +23 -5
- package/reference/sdlc/code.playbook/playbook-captain.d.ts +99 -7
- package/reference/sdlc/code.playbook/playbook-captain.js +1850 -72
- package/reference/sdlc/code.playbook/playbook-captain.ts +2759 -96
- package/reference/sdlc/decide.md +0 -1
- package/reference/sdlc/decide.playbook/decide.fsm.d.ts +7 -0
- package/reference/sdlc/decide.playbook/decide.fsm.js +80 -29
- package/reference/sdlc/decide.playbook/decide.fsm.ts +89 -31
- package/reference/sdlc/decide.playbook/decide.gears.md +0 -1
- package/reference/sdlc/decide.playbook/decide.playbook.d.ts +13 -5
- package/reference/sdlc/decide.playbook/decide.playbook.js +1712 -91
- package/reference/sdlc/decide.playbook/decide.playbook.ts +2677 -136
- package/reference/sdlc/decide.playbook/decide.registry.d.ts +7 -3
- package/reference/sdlc/decide.playbook/decide.registry.js +10 -3
- package/reference/sdlc/decide.playbook/decide.registry.ts +20 -5
- package/reference/sdlc/review.playbook/review.fsm.d.ts +7 -0
- package/reference/sdlc/review.playbook/review.fsm.js +133 -12
- package/reference/sdlc/review.playbook/review.fsm.ts +140 -12
- package/reference/sdlc/review.playbook/review.playbook.d.ts +5 -2
- package/reference/sdlc/review.playbook/review.playbook.js +65 -2
- package/reference/sdlc/review.playbook/review.playbook.ts +83 -6
- package/reference/sdlc/review.playbook/review.registry.d.ts +10 -3
- package/reference/sdlc/review.playbook/review.registry.js +10 -3
- package/reference/sdlc/review.playbook/review.registry.ts +23 -5
- package/slc/gears2fsm.md +6 -5
- package/slc/link.md +544 -41
- package/src/accepted-outcome.d.ts +18 -0
- package/src/accepted-outcome.js +94 -0
- package/src/accepted-outcome.ts +140 -0
- package/src/runtime.d.ts +164 -3
- package/src/runtime.ts +213 -2
- package/src/xstate-playbook-runtime.d.ts +149 -10
- package/src/xstate-playbook-runtime.js +2569 -270
- package/src/xstate-playbook-runtime.ts +4133 -490
- package/src/xstate-runtime.d.ts +59 -1
- package/src/xstate-runtime.js +866 -7
- package/src/xstate-runtime.ts +1397 -7
package/src/xstate-runtime.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type AnyActorRef, type PromiseActorLogic, type SnapshotFrom } from 'xstate';
|
|
2
|
-
import type { CaptainResult, JsonValue, NormalizedError, PlaybookCallRequest, PlaybookCallResult, PlaybookCallStart, PlaybookPendingCall, PlaybookRuntimeSnapshot, PlaybookSession, PlaybookState, PlaybookSuspendedCall, PlayerResult } from './runtime.js';
|
|
2
|
+
import type { CaptainResult, JsonValue, NormalizedError, PlaybookCallRequest, PlaybookCallResult, PlaybookCallStart, PlaybookPendingCall, PlaybookEffectLedger, PlaybookRepositoryDisposition, PlaybookRuntimeSnapshot, PlaybookSession, PlaybookState, PlaybookSuspendedCall, PlayerResult } from './runtime.js';
|
|
3
3
|
export * from './xstate-playbook-runtime.js';
|
|
4
4
|
/**
|
|
5
5
|
* Immutable cancellation provenance for one runtime operation. The captured
|
|
@@ -39,6 +39,64 @@ export interface SnapshotNormalizationOptions {
|
|
|
39
39
|
}
|
|
40
40
|
export declare function normalizePlaybookSnapshot(snapshot: unknown, options?: SnapshotNormalizationOptions): PlaybookState;
|
|
41
41
|
export declare function detachPersistedMachineSnapshot(persisted: unknown): JsonValue;
|
|
42
|
+
/** Authority for one governed delegated-player output field (DR-040 §1). */
|
|
43
|
+
export type PlaybookSemanticFieldAuthority = 'presentation' | 'semantic' | 'effect' | 'runtime';
|
|
44
|
+
/** One already-validated state-local governed outcome declaration. */
|
|
45
|
+
export interface PlaybookSemanticOutcomeSpec {
|
|
46
|
+
readonly fields: Readonly<Record<string, PlaybookSemanticFieldAuthority>>;
|
|
47
|
+
readonly repositoryDisposition: PlaybookRepositoryDisposition;
|
|
48
|
+
}
|
|
49
|
+
/** Evidence available when one governed semantic candidate is reconciled. */
|
|
50
|
+
export interface PlaybookSemanticEvidenceInput {
|
|
51
|
+
readonly outcomes: Readonly<Record<string, PlaybookSemanticOutcomeSpec>>;
|
|
52
|
+
readonly semanticCandidate: unknown;
|
|
53
|
+
readonly finalText?: unknown;
|
|
54
|
+
readonly receipt?: unknown;
|
|
55
|
+
readonly runtimeFields?: unknown;
|
|
56
|
+
}
|
|
57
|
+
/** The exact detached actor output admitted to FSM delivery. */
|
|
58
|
+
export type PlaybookReconciledSemanticOutput = Readonly<Record<string, string>> & {
|
|
59
|
+
readonly guard: string;
|
|
60
|
+
};
|
|
61
|
+
/** Retained presentation and semantic evidence, kept separate from output. */
|
|
62
|
+
export interface PlaybookRetainedSemanticEvidence {
|
|
63
|
+
readonly finalText?: string;
|
|
64
|
+
readonly semanticCandidate: Readonly<Record<string, string>> & {
|
|
65
|
+
readonly guard: string;
|
|
66
|
+
};
|
|
67
|
+
}
|
|
68
|
+
export type PlaybookSemanticReconciliationReason = 'missing-presentation-evidence' | 'missing-repository-receipt' | 'invalid-repository-receipt' | 'repository-disposition-mismatch' | 'missing-effect-evidence' | 'missing-runtime-evidence' | 'inconsistent-runtime-evidence';
|
|
69
|
+
/** A fail-closed semantic/effect reconciliation decision. */
|
|
70
|
+
export type PlaybookSemanticReconciliation = {
|
|
71
|
+
readonly status: 'resolved' | 'deferred';
|
|
72
|
+
readonly output: PlaybookReconciledSemanticOutput;
|
|
73
|
+
readonly evidence: PlaybookRetainedSemanticEvidence;
|
|
74
|
+
} | {
|
|
75
|
+
readonly status: 'unresolved';
|
|
76
|
+
readonly reason: PlaybookSemanticReconciliationReason;
|
|
77
|
+
readonly evidence: PlaybookRetainedSemanticEvidence;
|
|
78
|
+
};
|
|
79
|
+
/**
|
|
80
|
+
* A judge candidate is structurally invalid, rather than merely awaiting or
|
|
81
|
+
* conflicting with effect evidence. Callers use this distinction to spend at
|
|
82
|
+
* most one durable correction budget before asking another hidden judge.
|
|
83
|
+
*/
|
|
84
|
+
export declare class PlaybookSemanticCandidateStructureError extends TypeError {
|
|
85
|
+
constructor(message: string);
|
|
86
|
+
}
|
|
87
|
+
/**
|
|
88
|
+
* Reconcile one exact semantic candidate with host-owned effect evidence.
|
|
89
|
+
* Presentation prose remains opaque: it is retained verbatim and only its
|
|
90
|
+
* trimmed value is copied into linker-declared presentation fields. No
|
|
91
|
+
* repository fact is inferred from that prose or from the semantic candidate.
|
|
92
|
+
*/
|
|
93
|
+
export declare function reconcilePlaybookSemanticEvidence(input: PlaybookSemanticEvidenceInput): PlaybookSemanticReconciliation;
|
|
94
|
+
/** Return the canonical empty host-owned effect-ledger mirror. */
|
|
95
|
+
export declare function emptyPlaybookEffectLedger(): PlaybookEffectLedger;
|
|
96
|
+
/** Validate, detach, and recursively freeze one effect-ledger mirror. */
|
|
97
|
+
export declare function assertPlaybookEffectLedger(value: unknown, path?: string): PlaybookEffectLedger;
|
|
98
|
+
/** Whether current preserves every durable fact in baseline and only extends it. */
|
|
99
|
+
export declare function isPlaybookEffectLedgerMonotonicExtension(baselineValue: unknown, currentValue: unknown): boolean;
|
|
42
100
|
export interface PlaybookRuntimeSnapshotValidationOptions {
|
|
43
101
|
/**
|
|
44
102
|
* Opt in only when the restore path will prepare and confirm the suspended
|