@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/reference/sdlc/decide.md
CHANGED
|
@@ -36,7 +36,6 @@ Do not change code or implement the proposal.
|
|
|
36
36
|
|
|
37
37
|
Commit the result as one new commit, following @specs/packages/git.md.
|
|
38
38
|
Make the commit message explain concisely what changed and why.
|
|
39
|
-
Include exactly one final-response line beginning `Commit: `, followed only by the exact commit identity; other final-response content may appear on other lines.
|
|
40
39
|
Coder is <coder-llm>; format the model token in conventional human form.
|
|
41
40
|
```
|
|
42
41
|
|
|
@@ -127,6 +127,13 @@ export declare const decideMachine: import("xstate").StateMachine<DecideContext,
|
|
|
127
127
|
logic: import("xstate").PromiseActorLogic<PlayerOutput, PlayerInput, import("xstate").EventObject>;
|
|
128
128
|
id: string | undefined;
|
|
129
129
|
}, {
|
|
130
|
+
type: "playbook.acceptedOutcome";
|
|
131
|
+
params: {
|
|
132
|
+
readonly source: string;
|
|
133
|
+
readonly target: string;
|
|
134
|
+
readonly acceptedOutcome: string;
|
|
135
|
+
};
|
|
136
|
+
} | {
|
|
130
137
|
type: "rememberActorError";
|
|
131
138
|
params: import("xstate").NonReducibleUnknown;
|
|
132
139
|
} | {
|
|
@@ -23,7 +23,6 @@ const COMMIT_CODER_PROMPT = [
|
|
|
23
23
|
'',
|
|
24
24
|
'Commit the result as one new commit, following @specs/packages/git.md.',
|
|
25
25
|
'Make the commit message explain concisely what changed and why.',
|
|
26
|
-
'Include exactly one final-response line beginning `Commit: `, followed only by the exact commit identity; other final-response content may appear on other lines.',
|
|
27
26
|
'Coder is <coder-llm>; format the model token in conventional human form.',
|
|
28
27
|
].join('\n');
|
|
29
28
|
const REVIEW_INPUT_TEMPLATE = [
|
|
@@ -59,13 +58,6 @@ function commitOutput(event) {
|
|
|
59
58
|
!isNonEmptyString(output.latestCommit)) {
|
|
60
59
|
return undefined;
|
|
61
60
|
}
|
|
62
|
-
const commitLines = output.coderOutput
|
|
63
|
-
.split('\n')
|
|
64
|
-
.filter((line) => line.startsWith('Commit: '));
|
|
65
|
-
if (commitLines.length !== 1 ||
|
|
66
|
-
commitLines[0] !== `Commit: ${output.latestCommit}`) {
|
|
67
|
-
return undefined;
|
|
68
|
-
}
|
|
69
61
|
return {
|
|
70
62
|
coderOutput: output.coderOutput,
|
|
71
63
|
latestCommit: output.latestCommit,
|
|
@@ -305,6 +297,7 @@ export const decideMachine = setup({
|
|
|
305
297
|
}),
|
|
306
298
|
},
|
|
307
299
|
actions: {
|
|
300
|
+
'playbook.acceptedOutcome': (_args, _params) => undefined,
|
|
308
301
|
copyStartTopic: assign({
|
|
309
302
|
callerTopic: ({ event }) => event.type === 'START_DECIDE' ? event.callerTopic : undefined,
|
|
310
303
|
coderProposal: undefined,
|
|
@@ -514,14 +507,24 @@ export const decideMachine = setup({
|
|
|
514
507
|
{
|
|
515
508
|
guard: 'needsBossReplyWithQuestion',
|
|
516
509
|
target: 'waiting',
|
|
517
|
-
actions:
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
510
|
+
actions: [
|
|
511
|
+
{
|
|
512
|
+
type: 'playbook.acceptedOutcome',
|
|
513
|
+
params: {
|
|
514
|
+
source: 'askCoderProposal',
|
|
515
|
+
target: 'waitCoderProposalReply',
|
|
516
|
+
acceptedOutcome: 'needsBossReply',
|
|
517
|
+
},
|
|
523
518
|
},
|
|
524
|
-
|
|
519
|
+
{
|
|
520
|
+
type: 'setPendingBossQuestion',
|
|
521
|
+
params: {
|
|
522
|
+
...stateMetadata.askCoderProposal,
|
|
523
|
+
resumeStateId: 'askCoderProposal',
|
|
524
|
+
question: '',
|
|
525
|
+
},
|
|
526
|
+
},
|
|
527
|
+
],
|
|
525
528
|
},
|
|
526
529
|
{
|
|
527
530
|
guard: 'needsBossReplyWithoutQuestion',
|
|
@@ -535,6 +538,16 @@ export const decideMachine = setup({
|
|
|
535
538
|
guard: 'coderProposed',
|
|
536
539
|
target: 'complete',
|
|
537
540
|
actions: [
|
|
541
|
+
{
|
|
542
|
+
type: 'playbook.acceptedOutcome',
|
|
543
|
+
params: ({ context }) => ({
|
|
544
|
+
source: 'askCoderProposal',
|
|
545
|
+
target: context.stagedReviewerResult === undefined
|
|
546
|
+
? 'coderProposalComplete'
|
|
547
|
+
: 'commitCoderProposal',
|
|
548
|
+
acceptedOutcome: 'proposed',
|
|
549
|
+
}),
|
|
550
|
+
},
|
|
538
551
|
'stageCoderProposal',
|
|
539
552
|
{
|
|
540
553
|
type: 'clearBranchBossReplyContext',
|
|
@@ -630,14 +643,24 @@ export const decideMachine = setup({
|
|
|
630
643
|
{
|
|
631
644
|
guard: 'needsBossReplyWithQuestion',
|
|
632
645
|
target: 'waiting',
|
|
633
|
-
actions:
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
646
|
+
actions: [
|
|
647
|
+
{
|
|
648
|
+
type: 'playbook.acceptedOutcome',
|
|
649
|
+
params: {
|
|
650
|
+
source: 'askReviewerProposal',
|
|
651
|
+
target: 'waitReviewerProposalReply',
|
|
652
|
+
acceptedOutcome: 'needsBossReply',
|
|
653
|
+
},
|
|
639
654
|
},
|
|
640
|
-
|
|
655
|
+
{
|
|
656
|
+
type: 'setPendingBossQuestion',
|
|
657
|
+
params: {
|
|
658
|
+
...stateMetadata.askReviewerProposal,
|
|
659
|
+
resumeStateId: 'askReviewerProposal',
|
|
660
|
+
question: '',
|
|
661
|
+
},
|
|
662
|
+
},
|
|
663
|
+
],
|
|
641
664
|
},
|
|
642
665
|
{
|
|
643
666
|
guard: 'needsBossReplyWithoutQuestion',
|
|
@@ -651,6 +674,16 @@ export const decideMachine = setup({
|
|
|
651
674
|
guard: 'reviewerProposed',
|
|
652
675
|
target: 'complete',
|
|
653
676
|
actions: [
|
|
677
|
+
{
|
|
678
|
+
type: 'playbook.acceptedOutcome',
|
|
679
|
+
params: ({ context }) => ({
|
|
680
|
+
source: 'askReviewerProposal',
|
|
681
|
+
target: context.stagedCoderResult === undefined
|
|
682
|
+
? 'reviewerProposalComplete'
|
|
683
|
+
: 'commitCoderProposal',
|
|
684
|
+
acceptedOutcome: 'proposed',
|
|
685
|
+
}),
|
|
686
|
+
},
|
|
654
687
|
'stageReviewerProposal',
|
|
655
688
|
{
|
|
656
689
|
type: 'clearBranchBossReplyContext',
|
|
@@ -748,14 +781,24 @@ export const decideMachine = setup({
|
|
|
748
781
|
{
|
|
749
782
|
guard: 'needsBossReplyWithQuestion',
|
|
750
783
|
target: 'awaitBossReply',
|
|
751
|
-
actions:
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
784
|
+
actions: [
|
|
785
|
+
{
|
|
786
|
+
type: 'playbook.acceptedOutcome',
|
|
787
|
+
params: {
|
|
788
|
+
source: 'commitCoderProposal',
|
|
789
|
+
target: 'awaitBossReply',
|
|
790
|
+
acceptedOutcome: 'needsBossReply',
|
|
791
|
+
},
|
|
757
792
|
},
|
|
758
|
-
|
|
793
|
+
{
|
|
794
|
+
type: 'setPendingBossQuestion',
|
|
795
|
+
params: {
|
|
796
|
+
...stateMetadata.commitCoderProposal,
|
|
797
|
+
resumeStateId: 'commitCoderProposal',
|
|
798
|
+
question: '',
|
|
799
|
+
},
|
|
800
|
+
},
|
|
801
|
+
],
|
|
759
802
|
},
|
|
760
803
|
{
|
|
761
804
|
guard: 'needsBossReplyWithoutQuestion',
|
|
@@ -769,6 +812,14 @@ export const decideMachine = setup({
|
|
|
769
812
|
guard: 'committed',
|
|
770
813
|
target: 'reviewCommit',
|
|
771
814
|
actions: [
|
|
815
|
+
{
|
|
816
|
+
type: 'playbook.acceptedOutcome',
|
|
817
|
+
params: {
|
|
818
|
+
source: 'commitCoderProposal',
|
|
819
|
+
target: 'reviewCommit',
|
|
820
|
+
acceptedOutcome: 'committed',
|
|
821
|
+
},
|
|
822
|
+
},
|
|
772
823
|
'rememberCommit',
|
|
773
824
|
{
|
|
774
825
|
type: 'clearBranchBossReplyContext',
|
|
@@ -157,7 +157,6 @@ const COMMIT_CODER_PROMPT = [
|
|
|
157
157
|
'',
|
|
158
158
|
'Commit the result as one new commit, following @specs/packages/git.md.',
|
|
159
159
|
'Make the commit message explain concisely what changed and why.',
|
|
160
|
-
'Include exactly one final-response line beginning `Commit: `, followed only by the exact commit identity; other final-response content may appear on other lines.',
|
|
161
160
|
'Coder is <coder-llm>; format the model token in conventional human form.',
|
|
162
161
|
].join('\n');
|
|
163
162
|
|
|
@@ -216,15 +215,6 @@ function commitOutput(
|
|
|
216
215
|
) {
|
|
217
216
|
return undefined;
|
|
218
217
|
}
|
|
219
|
-
const commitLines = output.coderOutput
|
|
220
|
-
.split('\n')
|
|
221
|
-
.filter((line) => line.startsWith('Commit: '));
|
|
222
|
-
if (
|
|
223
|
-
commitLines.length !== 1 ||
|
|
224
|
-
commitLines[0] !== `Commit: ${output.latestCommit}`
|
|
225
|
-
) {
|
|
226
|
-
return undefined;
|
|
227
|
-
}
|
|
228
218
|
return {
|
|
229
219
|
coderOutput: output.coderOutput,
|
|
230
220
|
latestCommit: output.latestCommit,
|
|
@@ -533,6 +523,14 @@ export const decideMachine = setup({
|
|
|
533
523
|
}),
|
|
534
524
|
},
|
|
535
525
|
actions: {
|
|
526
|
+
'playbook.acceptedOutcome': (
|
|
527
|
+
_args,
|
|
528
|
+
_params: {
|
|
529
|
+
readonly source: string;
|
|
530
|
+
readonly target: string;
|
|
531
|
+
readonly acceptedOutcome: string;
|
|
532
|
+
},
|
|
533
|
+
) => undefined,
|
|
536
534
|
copyStartTopic: assign({
|
|
537
535
|
callerTopic: ({ event }) =>
|
|
538
536
|
event.type === 'START_DECIDE' ? event.callerTopic : undefined,
|
|
@@ -758,14 +756,24 @@ export const decideMachine = setup({
|
|
|
758
756
|
{
|
|
759
757
|
guard: 'needsBossReplyWithQuestion',
|
|
760
758
|
target: 'waiting',
|
|
761
|
-
actions:
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
759
|
+
actions: [
|
|
760
|
+
{
|
|
761
|
+
type: 'playbook.acceptedOutcome',
|
|
762
|
+
params: {
|
|
763
|
+
source: 'askCoderProposal',
|
|
764
|
+
target: 'waitCoderProposalReply',
|
|
765
|
+
acceptedOutcome: 'needsBossReply',
|
|
766
|
+
},
|
|
767
767
|
},
|
|
768
|
-
|
|
768
|
+
{
|
|
769
|
+
type: 'setPendingBossQuestion',
|
|
770
|
+
params: {
|
|
771
|
+
...stateMetadata.askCoderProposal,
|
|
772
|
+
resumeStateId: 'askCoderProposal',
|
|
773
|
+
question: '',
|
|
774
|
+
},
|
|
775
|
+
},
|
|
776
|
+
],
|
|
769
777
|
},
|
|
770
778
|
{
|
|
771
779
|
guard: 'needsBossReplyWithoutQuestion',
|
|
@@ -779,6 +787,17 @@ export const decideMachine = setup({
|
|
|
779
787
|
guard: 'coderProposed',
|
|
780
788
|
target: 'complete',
|
|
781
789
|
actions: [
|
|
790
|
+
{
|
|
791
|
+
type: 'playbook.acceptedOutcome',
|
|
792
|
+
params: ({ context }) => ({
|
|
793
|
+
source: 'askCoderProposal',
|
|
794
|
+
target:
|
|
795
|
+
context.stagedReviewerResult === undefined
|
|
796
|
+
? 'coderProposalComplete'
|
|
797
|
+
: 'commitCoderProposal',
|
|
798
|
+
acceptedOutcome: 'proposed',
|
|
799
|
+
}),
|
|
800
|
+
},
|
|
782
801
|
'stageCoderProposal',
|
|
783
802
|
{
|
|
784
803
|
type: 'clearBranchBossReplyContext',
|
|
@@ -877,14 +896,24 @@ export const decideMachine = setup({
|
|
|
877
896
|
{
|
|
878
897
|
guard: 'needsBossReplyWithQuestion',
|
|
879
898
|
target: 'waiting',
|
|
880
|
-
actions:
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
899
|
+
actions: [
|
|
900
|
+
{
|
|
901
|
+
type: 'playbook.acceptedOutcome',
|
|
902
|
+
params: {
|
|
903
|
+
source: 'askReviewerProposal',
|
|
904
|
+
target: 'waitReviewerProposalReply',
|
|
905
|
+
acceptedOutcome: 'needsBossReply',
|
|
906
|
+
},
|
|
907
|
+
},
|
|
908
|
+
{
|
|
909
|
+
type: 'setPendingBossQuestion',
|
|
910
|
+
params: {
|
|
911
|
+
...stateMetadata.askReviewerProposal,
|
|
912
|
+
resumeStateId: 'askReviewerProposal',
|
|
913
|
+
question: '',
|
|
914
|
+
},
|
|
886
915
|
},
|
|
887
|
-
|
|
916
|
+
],
|
|
888
917
|
},
|
|
889
918
|
{
|
|
890
919
|
guard: 'needsBossReplyWithoutQuestion',
|
|
@@ -898,6 +927,17 @@ export const decideMachine = setup({
|
|
|
898
927
|
guard: 'reviewerProposed',
|
|
899
928
|
target: 'complete',
|
|
900
929
|
actions: [
|
|
930
|
+
{
|
|
931
|
+
type: 'playbook.acceptedOutcome',
|
|
932
|
+
params: ({ context }) => ({
|
|
933
|
+
source: 'askReviewerProposal',
|
|
934
|
+
target:
|
|
935
|
+
context.stagedCoderResult === undefined
|
|
936
|
+
? 'reviewerProposalComplete'
|
|
937
|
+
: 'commitCoderProposal',
|
|
938
|
+
acceptedOutcome: 'proposed',
|
|
939
|
+
}),
|
|
940
|
+
},
|
|
901
941
|
'stageReviewerProposal',
|
|
902
942
|
{
|
|
903
943
|
type: 'clearBranchBossReplyContext',
|
|
@@ -999,14 +1039,24 @@ export const decideMachine = setup({
|
|
|
999
1039
|
{
|
|
1000
1040
|
guard: 'needsBossReplyWithQuestion',
|
|
1001
1041
|
target: 'awaitBossReply',
|
|
1002
|
-
actions:
|
|
1003
|
-
|
|
1004
|
-
|
|
1005
|
-
|
|
1006
|
-
|
|
1007
|
-
|
|
1042
|
+
actions: [
|
|
1043
|
+
{
|
|
1044
|
+
type: 'playbook.acceptedOutcome',
|
|
1045
|
+
params: {
|
|
1046
|
+
source: 'commitCoderProposal',
|
|
1047
|
+
target: 'awaitBossReply',
|
|
1048
|
+
acceptedOutcome: 'needsBossReply',
|
|
1049
|
+
},
|
|
1008
1050
|
},
|
|
1009
|
-
|
|
1051
|
+
{
|
|
1052
|
+
type: 'setPendingBossQuestion',
|
|
1053
|
+
params: {
|
|
1054
|
+
...stateMetadata.commitCoderProposal,
|
|
1055
|
+
resumeStateId: 'commitCoderProposal',
|
|
1056
|
+
question: '',
|
|
1057
|
+
},
|
|
1058
|
+
},
|
|
1059
|
+
],
|
|
1010
1060
|
},
|
|
1011
1061
|
{
|
|
1012
1062
|
guard: 'needsBossReplyWithoutQuestion',
|
|
@@ -1020,6 +1070,14 @@ export const decideMachine = setup({
|
|
|
1020
1070
|
guard: 'committed',
|
|
1021
1071
|
target: 'reviewCommit',
|
|
1022
1072
|
actions: [
|
|
1073
|
+
{
|
|
1074
|
+
type: 'playbook.acceptedOutcome',
|
|
1075
|
+
params: {
|
|
1076
|
+
source: 'commitCoderProposal',
|
|
1077
|
+
target: 'reviewCommit',
|
|
1078
|
+
acceptedOutcome: 'committed',
|
|
1079
|
+
},
|
|
1080
|
+
},
|
|
1023
1081
|
'rememberCommit',
|
|
1024
1082
|
{
|
|
1025
1083
|
type: 'clearBranchBossReplyContext',
|
|
@@ -62,7 +62,6 @@ When both independent proposals are complete, Captain shall prompt Coder:
|
|
|
62
62
|
>
|
|
63
63
|
> Commit the result as one new commit, following @specs/packages/git.md.
|
|
64
64
|
> Make the commit message explain concisely what changed and why.
|
|
65
|
-
> Include exactly one final-response line beginning `Commit: `, followed only by the exact commit identity; other final-response content may appear on other lines.
|
|
66
65
|
> Coder is <coder-llm>; format the model token in conventional human form.
|
|
67
66
|
|
|
68
67
|
Results:
|
|
@@ -1,8 +1,14 @@
|
|
|
1
|
-
import { type PlayerInput, type
|
|
1
|
+
import { type PlayerInput, type DecideEvent, type DecideInput, type PendingBossQuestion } from './decide.fsm.js';
|
|
2
|
+
import type { PlaybookHostConstructionCapabilities } from '../code.playbook/playbook-captain.js';
|
|
2
3
|
import type { CaptainCallOptions, CaptainResult, JsonValue, NormalizedError, PlayerCallOptions, PlayerResult, PlayerSessionStore, PlaybookCallRequest, PlaybookCallResult, PlaybookCallStart, PlaybookControlAction, PlaybookControlReceipt, PlaybookControlView, PlaybookPendingCall, PlaybookPorts, PlaybookRunResult, PlaybookRuntime, PlaybookRuntimeFactory, PlaybookRuntimeSnapshot, PlaybookSession, PlaybookState, PlaybookStateValue, PlaybookTraceEvent, PlaybookTraceType } from '@sublang/playbook/runtime';
|
|
3
4
|
export type { CaptainCallOptions, CaptainResult, JsonValue, NormalizedError, PlayerCallOptions, PlayerResult, PlayerSessionStore, PlaybookCallRequest, PlaybookCallResult, PlaybookCallStart, PlaybookControlAction, PlaybookControlReceipt, PlaybookControlView, PlaybookPendingCall, PlaybookPorts, PlaybookRunResult, PlaybookRuntime, PlaybookRuntimeFactory, PlaybookRuntimeSnapshot, PlaybookSession, PlaybookState, PlaybookStateValue, PlaybookTraceEvent, PlaybookTraceType, };
|
|
4
5
|
type RoleId = 'coder' | 'reviewer';
|
|
5
6
|
export type PlaybookRuntimeOptions = DecideInput;
|
|
7
|
+
export type DecidePlaybookHostCapabilities = PlaybookHostConstructionCapabilities;
|
|
8
|
+
export interface DecidePlaybookRuntimeConstruction {
|
|
9
|
+
readonly configuredOptions: PlaybookRuntimeOptions;
|
|
10
|
+
readonly hostCapabilities: DecidePlaybookHostCapabilities;
|
|
11
|
+
}
|
|
6
12
|
type PromptIdentity = (roleId: RoleId) => string;
|
|
7
13
|
declare function composePlayerPrompt(input: PlayerInput, promptIdentity: PromptIdentity): string;
|
|
8
14
|
declare function requiredFieldsFor(description: string): string[];
|
|
@@ -14,8 +20,10 @@ declare function buildClassifierPrompt(text: string, ctx: {
|
|
|
14
20
|
declare function parseClassification(raw: string, text: string, pendingQuestionIds?: readonly string[]): DecideEvent | {
|
|
15
21
|
type: 'NO_ACTION';
|
|
16
22
|
} | null;
|
|
17
|
-
declare function buildAdjudicatorPrompt(input: PlayerInput, playerOutput: string
|
|
18
|
-
|
|
23
|
+
declare function buildAdjudicatorPrompt(input: PlayerInput, playerOutput: string, correction?: {
|
|
24
|
+
readonly reply: string;
|
|
25
|
+
readonly error: string;
|
|
26
|
+
}): string;
|
|
19
27
|
declare function combineSignals(a: AbortSignal | undefined, b: AbortSignal | undefined): AbortSignal;
|
|
20
28
|
declare function normalizeErrorCompact(err: unknown): {
|
|
21
29
|
name: string;
|
|
@@ -28,7 +36,7 @@ declare function normalizeErrorFull(err: unknown): {
|
|
|
28
36
|
} | undefined;
|
|
29
37
|
declare function pendingQuestionsFromContext(context: Record<string, unknown>): PendingBossQuestion[];
|
|
30
38
|
declare function pendingQuestionsForState(state: PlaybookState, context: Record<string, unknown>): PendingBossQuestion[];
|
|
31
|
-
export declare const createPlaybookRuntime: PlaybookRuntimeFactory<
|
|
39
|
+
export declare const createPlaybookRuntime: PlaybookRuntimeFactory<DecidePlaybookRuntimeConstruction>;
|
|
32
40
|
export declare const _internal: {
|
|
33
41
|
composePlayerPrompt: typeof composePlayerPrompt;
|
|
34
42
|
requiredFieldsFor: typeof requiredFieldsFor;
|
|
@@ -36,7 +44,6 @@ export declare const _internal: {
|
|
|
36
44
|
buildClassifierPrompt: typeof buildClassifierPrompt;
|
|
37
45
|
parseClassification: typeof parseClassification;
|
|
38
46
|
buildAdjudicatorPrompt: typeof buildAdjudicatorPrompt;
|
|
39
|
-
parseAdjudication: typeof parseAdjudication;
|
|
40
47
|
combineSignals: typeof combineSignals;
|
|
41
48
|
pendingQuestionsFromContext: typeof pendingQuestionsFromContext;
|
|
42
49
|
pendingQuestionsForState: typeof pendingQuestionsForState;
|
|
@@ -59,6 +66,7 @@ export declare const _internal: {
|
|
|
59
66
|
ROLE_STATE_IDS: ReadonlySet<string>;
|
|
60
67
|
VERBATIM_PAYLOAD_FIELDS: ReadonlySet<string>;
|
|
61
68
|
BOSS_INTERRUPT_TARGETS: readonly ["independentProposals"];
|
|
69
|
+
UNFINISHED_FINAL_STATE_IDS: ReadonlySet<string>;
|
|
62
70
|
CONTINUATION_PREAMBLE: string;
|
|
63
71
|
TELEMETRY_TOPIC: string;
|
|
64
72
|
};
|