@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.
Files changed (81) hide show
  1. package/README.md +1 -1
  2. package/docs/embedding.md +9 -7
  3. package/package.json +3 -1
  4. package/reference/sdlc/branch.playbook/branch.fsm.d.ts +63 -33
  5. package/reference/sdlc/branch.playbook/branch.fsm.js +190 -108
  6. package/reference/sdlc/branch.playbook/branch.fsm.ts +269 -147
  7. package/reference/sdlc/branch.playbook/branch.gears.md +7 -17
  8. package/reference/sdlc/branch.playbook/branch.playbook.d.ts +12 -16
  9. package/reference/sdlc/branch.playbook/branch.playbook.js +112 -101
  10. package/reference/sdlc/branch.playbook/branch.playbook.ts +128 -171
  11. package/reference/sdlc/branch.playbook/branch.registry.d.ts +3 -2
  12. package/reference/sdlc/branch.playbook/branch.registry.ts +6 -2
  13. package/reference/sdlc/code.playbook/bin/repository-effects.js +54 -13
  14. package/reference/sdlc/code.playbook/code.fsm.d.ts +143 -90
  15. package/reference/sdlc/code.playbook/code.fsm.introspect.d.ts +8 -8
  16. package/reference/sdlc/code.playbook/code.fsm.introspect.ts +13 -13
  17. package/reference/sdlc/code.playbook/code.fsm.js +609 -649
  18. package/reference/sdlc/code.playbook/code.fsm.ts +890 -821
  19. package/reference/sdlc/code.playbook/code.gears.md +39 -29
  20. package/reference/sdlc/code.playbook/code.playbook.d.ts +13 -16
  21. package/reference/sdlc/code.playbook/code.playbook.js +166 -147
  22. package/reference/sdlc/code.playbook/code.playbook.ts +180 -229
  23. package/reference/sdlc/code.playbook/code.registry.d.ts +3 -2
  24. package/reference/sdlc/code.playbook/code.registry.ts +6 -2
  25. package/reference/sdlc/code.playbook/playbook-captain.d.ts +42 -0
  26. package/reference/sdlc/code.playbook/playbook-captain.js +829 -194
  27. package/reference/sdlc/code.playbook/playbook-captain.ts +1227 -220
  28. package/reference/sdlc/decide.md +1 -0
  29. package/reference/sdlc/decide.playbook/decide.fsm.d.ts +270 -154
  30. package/reference/sdlc/decide.playbook/decide.fsm.js +765 -732
  31. package/reference/sdlc/decide.playbook/decide.fsm.ts +1167 -945
  32. package/reference/sdlc/decide.playbook/decide.gears.md +28 -21
  33. package/reference/sdlc/decide.playbook/decide.playbook.d.ts +11 -67
  34. package/reference/sdlc/decide.playbook/decide.playbook.js +155 -3570
  35. package/reference/sdlc/decide.playbook/decide.playbook.ts +186 -5061
  36. package/reference/sdlc/decide.playbook/decide.registry.d.ts +8 -4
  37. package/reference/sdlc/decide.playbook/decide.registry.js +2 -2
  38. package/reference/sdlc/decide.playbook/decide.registry.ts +13 -6
  39. package/reference/sdlc/dev.playbook/dev.fsm.d.ts +113 -131
  40. package/reference/sdlc/dev.playbook/dev.fsm.js +517 -575
  41. package/reference/sdlc/dev.playbook/dev.fsm.ts +667 -787
  42. package/reference/sdlc/dev.playbook/dev.gears.md +52 -54
  43. package/reference/sdlc/dev.playbook/dev.playbook.d.ts +13 -10
  44. package/reference/sdlc/dev.playbook/dev.playbook.js +128 -120
  45. package/reference/sdlc/dev.playbook/dev.playbook.ts +143 -193
  46. package/reference/sdlc/dev.playbook/dev.registry.d.ts +3 -2
  47. package/reference/sdlc/dev.playbook/dev.registry.ts +6 -2
  48. package/reference/sdlc/pr.playbook/pr.fsm.d.ts +92 -85
  49. package/reference/sdlc/pr.playbook/pr.fsm.js +461 -518
  50. package/reference/sdlc/pr.playbook/pr.fsm.ts +533 -663
  51. package/reference/sdlc/pr.playbook/pr.gears.md +47 -63
  52. package/reference/sdlc/pr.playbook/pr.playbook.d.ts +13 -23
  53. package/reference/sdlc/pr.playbook/pr.playbook.js +118 -112
  54. package/reference/sdlc/pr.playbook/pr.playbook.ts +136 -190
  55. package/reference/sdlc/pr.playbook/pr.registry.d.ts +3 -2
  56. package/reference/sdlc/pr.playbook/pr.registry.ts +4 -2
  57. package/reference/sdlc/review.md +3 -3
  58. package/reference/sdlc/review.playbook/review.fsm.d.ts +150 -116
  59. package/reference/sdlc/review.playbook/review.fsm.js +479 -550
  60. package/reference/sdlc/review.playbook/review.fsm.ts +717 -662
  61. package/reference/sdlc/review.playbook/review.gears.md +32 -29
  62. package/reference/sdlc/review.playbook/review.playbook.d.ts +12 -12
  63. package/reference/sdlc/review.playbook/review.playbook.js +180 -155
  64. package/reference/sdlc/review.playbook/review.playbook.ts +190 -230
  65. package/reference/sdlc/review.playbook/review.registry.d.ts +6 -5
  66. package/reference/sdlc/review.playbook/review.registry.js +3 -3
  67. package/reference/sdlc/review.playbook/review.registry.ts +9 -5
  68. package/slc/gears2fsm.md +72 -3
  69. package/slc/link.md +50 -27
  70. package/slc/materialize-link.mjs +51 -13
  71. package/slc/optimize.md +4 -1
  72. package/slc/prefix-prompts.mjs +191 -0
  73. package/slc/prefix.md +203 -0
  74. package/slc/slc.pin-inputs.json +11 -1
  75. package/slc/text2gears.md +71 -11
  76. package/src/xstate-playbook-runtime.d.ts +82 -9
  77. package/src/xstate-playbook-runtime.js +1224 -283
  78. package/src/xstate-playbook-runtime.ts +1671 -338
  79. package/src/xstate-runtime.d.ts +3 -1
  80. package/src/xstate-runtime.js +9 -2
  81. package/src/xstate-runtime.ts +12 -2
@@ -1,7 +1,7 @@
1
1
  <!-- SPDX-License-Identifier: Apache-2.0 -->
2
2
  <!-- SPDX-FileCopyrightText: 2026 SubLang International <https://sublang.ai> -->
3
3
 
4
- # BRANCH: Pull-Request Branch Preparation Workflow
4
+ # Branch
5
5
 
6
6
  Roles:
7
7
 
@@ -11,16 +11,13 @@ The caller supplies a development request that names a GitHub issue (number or U
11
11
 
12
12
  `branch` prepares pull-request delivery of one development request: it creates and checks out a new branch at the current commit.
13
13
  It changes no files and owns no repository commit.
14
- Captain takes the base revision from repository authority, not from Coder's prose: the `unchanged` repository-effect receipt of the branching call proves the observed HEAD the branch was created from.
15
14
 
16
- ## Coder
15
+ ## Workflow
17
16
 
18
17
  ### BRANCH-1
19
18
 
20
- When the caller gives the request, Captain shall relay the complete caller input in quotes (`>`) to Coder, along with the branching instruction:
19
+ Where every outcome keeps the repository exact, so that a new branch at the current commit changes neither HEAD's commit nor the working tree, where Captain takes the base revision from repository authority rather than from Coder's prose, where each outcome requires affirmative support in Coder's result and depends on no fixed presentation format of Coder's reply, and where Boss's answer to Coder's question about which issue or work the request means resumes this same behavior with that answer as continuation context, when the caller gives the request, Captain shall relay the complete caller input in quotes (`>`) to Coder, along with the following instruction:
21
20
 
22
- > > Original request: <caller-input>
23
- >
24
21
  > Prepare a new branch for this work without changing any file or making any commit.
25
22
  > Identify the GitHub issue the request names, if any, and read it with its comments (`gh issue view --comments` with the issue number).
26
23
  > If the request could refer to more than one issue, or does not say which work to branch for, ask Boss before creating anything.
@@ -29,16 +26,9 @@ When the caller gives the request, Captain shall relay the complete caller input
29
26
  > Create the branch from the current commit and check it out; do not pull, reset, stash, or move HEAD to another commit.
30
27
  > Report the exact branch name, the commit it was created from, and a concise summary of the issue and its comments, or of the request when no issue is named.
31
28
  > If the working tree is not clean, `gh` is not authenticated, the named issue does not exist or cannot be read, or a branch with that name already exists locally or on the remote, create nothing and report the failure with its reason.
29
+ >
30
+ > > Original request: <caller-input>
32
31
 
33
32
  Results:
34
- - `branched`: Coder created the new branch from the current commit and checked it out, reporting its exact name and a concise summary of the issue and its comments, or of the request when no issue is named; the absence of a reported obstacle is not support. Output shall include `branch: <exact branch name>`, `baseRevision: <repository revision>`, and `issueSummary: <concise summary>`.
35
- - `refused`: Coder created nothing and reported the failure with its reason: the working tree is not clean, `gh` is not authenticated, the named issue does not exist or cannot be read, or a branch with that name already exists locally or on the remote. Output shall include `coderOutput: <verbatim final text>`.
36
-
37
- Workflow outcomes:
38
- - The result has two semantic outcomes: branched and refused, plus the Boss question when the request is ambiguous about the issue or work it means.
39
- - Each outcome requires affirmative support in Coder's result; the absence of a reported obstacle is not support for branched, and no outcome depends on a fixed presentation format of Coder's reply.
40
- - Every outcome keeps the repository exact: a new branch at the current commit changes neither HEAD's commit nor the working tree.
41
- - Captain takes the base revision from repository authority, not from Coder's prose.
42
- - The Boss question uses the standard Boss-question suspension with Coder's complete response; after Boss replies, `branch` resumes with the answer in the same Coder conversation, and the previous question is included only when that conversation must start fresh.
43
- - For branched, `branch` is complete and returns the exact branch name, the exact base revision, and the issue summary to its caller.
44
- - For refused, `branch` fails and reports Coder's complete result with its reason to its caller; no branch was created.
33
+ - `branched`: Coder affirmatively reported that it created the new branch from the current commit and checked it out, with the exact branch name and a concise summary of the issue and its comments, or of the request when no issue is named; the absence of a reported obstacle is not support. The branch workflow is then complete and returns the exact branch name, the exact base revision taken from repository authority, and the issue summary to its caller. Output shall include `branch: <exact branch name>`, `baseRevision: <exact base revision from repository authority, not from Coder's prose>`, and `issueSummary: <concise summary of the issue and its comments, or of the request when no issue is named>`.
34
+ - `refused`: Coder affirmatively reported that it created no branch and gave the failure with its reason, such as a working tree that is not clean, gh not being authenticated, a named issue that does not exist or cannot be read, or a branch with that name already existing locally or on the remote. The branch workflow then fails and reports Coder's complete result with its reason to its caller; no branch was created. Output shall include `coderOutput: <verbatim final text>`.
@@ -1,20 +1,16 @@
1
- import { type XStatePlaybookRuntimeFactory, type XStatePlaybookRuntimeConstruction } from '@sublang/playbook/xstate-runtime';
2
- import { type BranchInput, type PlayerInput } from './branch.fsm.js';
3
- import type { PlaybookHostConstructionCapabilities } from '../code.playbook/playbook-captain.js';
4
- import type { CaptainCallOptions, CaptainResult, JsonValue, NormalizedError, PlayerCallOptions, PlaybookCallRequest, PlaybookCallResult, PlaybookCallStart, PlaybookControlReceipt, PlaybookControlView, PlaybookPendingCall, PlaybookPorts, PlaybookRunResult, PlaybookRuntime, PlaybookRuntimeFactory, PlaybookRuntimeSnapshot, PlaybookSession, PlaybookState, PlaybookStateValue, PlaybookTraceEvent, PlaybookTraceType, PlayerResult, PlayerSessionStore } from '@sublang/playbook/runtime';
5
- export type { CaptainCallOptions, CaptainResult, JsonValue, NormalizedError, PlayerCallOptions, PlaybookCallRequest, PlaybookCallResult, PlaybookCallStart, PlaybookControlReceipt, PlaybookControlView, PlaybookPendingCall, PlaybookPorts, PlaybookRunResult, PlaybookRuntime, PlaybookRuntimeFactory, PlaybookRuntimeSnapshot, PlaybookSession, PlaybookState, PlaybookStateValue, PlaybookTraceEvent, PlaybookTraceType, PlayerResult, PlayerSessionStore, };
6
- export type BranchPlaybookOptions = BranchInput;
7
- export type BranchPlaybookHostCapabilities = PlaybookHostConstructionCapabilities & XStatePlaybookRuntimeConstruction<BranchPlaybookOptions, object>['hostCapabilities'];
8
- /**
9
- * Preserve authored Markdown quote markers around every line of relayed
10
- * runtime text. The generic composer preserves the marker itself; BRANCH's
11
- * override additionally keeps a multiline caller input inside that quote.
12
- */
13
- declare function composePlayerPrompt(input: PlayerInput, resuming?: boolean): string;
1
+ import { type XStatePromptIdentity, type PlaybookPlayerInput, type XStatePlaybookRuntimeConstruction, type XStatePlaybookRuntimeFactory } from '@sublang/playbook/xstate-runtime';
2
+ export type { PlayerResult, PlayerCallOptions, PlayerSessionStore, CaptainResult, CaptainCallOptions, JsonValue, NormalizedError, PlaybookCallRequest, PlaybookCallResult, PlaybookCallStart, PlaybookStateValue, PlaybookState, PlaybookPendingCall, PlaybookRunResult, PlaybookRuntime, PlaybookRuntimeFactory, PlaybookRuntimeSnapshot, PlaybookSession, PlaybookPorts, PlaybookTraceEvent, PlaybookTraceType, PlaybookControlReceipt, PlaybookControlView, } from '@sublang/playbook/runtime';
3
+ export interface PlaybookRuntimeOptions {
4
+ }
5
+ export type PlaybookHostCapabilities = XStatePlaybookRuntimeConstruction<PlaybookRuntimeOptions, {
6
+ readonly authority: object;
7
+ }>['hostCapabilities'];
8
+ export declare function validateOptions(value: unknown): PlaybookRuntimeOptions;
14
9
  export declare const _internal: {
15
- composePlayerPrompt: typeof composePlayerPrompt;
16
- VERBATIM_PAYLOAD_FIELDS: ReadonlySet<string>;
10
+ composePlayerPrompt: (input: PlaybookPlayerInput, promptIdentity: XStatePromptIdentity, resuming?: boolean) => string;
11
+ RESUMABLE_STATE_IDS: ReadonlySet<string>;
17
12
  UNFINISHED_FINAL_STATE_IDS: ReadonlySet<string>;
13
+ VERBATIM_PAYLOAD_FIELDS: ReadonlySet<string>;
18
14
  };
19
- declare const createPlaybookRuntime: XStatePlaybookRuntimeFactory<XStatePlaybookRuntimeConstruction<BranchPlaybookOptions, BranchPlaybookHostCapabilities>, 3>;
15
+ declare const createPlaybookRuntime: XStatePlaybookRuntimeFactory<XStatePlaybookRuntimeConstruction<PlaybookRuntimeOptions, PlaybookHostCapabilities>, 3>;
20
16
  export default createPlaybookRuntime;
@@ -1,121 +1,132 @@
1
1
  // SPDX-License-Identifier: Apache-2.0
2
2
  // SPDX-FileCopyrightText: 2026 SubLang International <https://sublang.ai>
3
- //
4
- // Generated by slc/link.md (FSM-to-Runtime linker).
5
- // Source FSM: ./branch.fsm.ts
6
- // Role metadata: Coder→coder (canonical local role)
7
- // Boss event: deterministic START_BRANCH entry; exact Boss text becomes
8
- // callerInput; pending Coder questions retain BOSS_REPLY
9
- // Adjudication: LLM judge for the one Coder state; coderOutput is carried
10
- // verbatim; baseRevision is receipt-owned effect evidence —
11
- // the unchanged receipt's observed HEAD — never taken from
12
- // Coder's prose
13
- // Compat: artifact schema 3 / runtime ABI 1
14
- import { createXStatePlaybookRuntime, composePlayerContinuation, snapshotJsonValue, } from '@sublang/playbook/xstate-runtime';
15
- import { branchMachine, } from './branch.fsm.js';
16
- const PLACEHOLDER = /<(#|[A-Za-z_$][A-Za-z0-9_$-]*)>/g;
3
+ // Generated by slc/materialize-link.mjs; governed by the complete slc/link.md.
4
+ // FSM: "./branch.fsm.js"; export: branchMachine; strategies: shared defaults with labelled string relays and nested actors.
5
+ import { branchMachine as machine } from "./branch.fsm.js";
6
+ import { createXStatePlaybookRuntime, snapshotJsonValue, composePlayerContinuation, } from '@sublang/playbook/xstate-runtime';
7
+ const OPTION_SCHEMA = {};
8
+ const INPUT_MAPPING = {};
9
+ const RESUMABLE_STATE_IDS = new Set([
10
+ "createBranch"
11
+ ]);
12
+ const UNFINISHED_FINAL_STATE_IDS = new Set([
13
+ "refused"
14
+ ]);
17
15
  const VERBATIM_PAYLOAD_FIELDS = new Set([
18
- 'coderOutput',
16
+ "coderOutput"
19
17
  ]);
20
- const UNFINISHED_FINAL_STATE_IDS = new Set(['refused']);
21
- function snapshotBranchOptions(value) {
22
- const captured = snapshotJsonValue(value, 'BRANCH runtime options');
23
- if (captured === null ||
24
- typeof captured !== 'object' ||
25
- Array.isArray(captured)) {
26
- throw new TypeError('BRANCH runtime options must be an object');
18
+ export function validateOptions(value) {
19
+ const captured = snapshotJsonValue(value === undefined ? {} : value, "BRANCH runtime options");
20
+ if (captured === null || typeof captured !== 'object' || Array.isArray(captured)) {
21
+ throw new TypeError("BRANCH runtime options must be an object");
22
+ }
23
+ const fields = captured;
24
+ for (const key of Object.keys(captured)) {
25
+ if (!Object.hasOwn(OPTION_SCHEMA, key))
26
+ throw new TypeError("BRANCH runtime options." + key + ' is not declared');
27
27
  }
28
- const record = captured;
29
- for (const key of Object.keys(record)) {
30
- throw new TypeError(`BRANCH runtime options.${key} is not declared`);
28
+ for (const [key, schema] of Object.entries(OPTION_SCHEMA)) {
29
+ if (!Object.hasOwn(captured, key)) {
30
+ if (schema.required)
31
+ throw new TypeError("BRANCH runtime options." + key + ' is required');
32
+ }
33
+ else if (typeof fields[key] !== schema.type || (schema.type === 'number' && !Number.isFinite(fields[key]))) {
34
+ throw new TypeError("BRANCH runtime options." + key + ' must be a ' + schema.type);
35
+ }
31
36
  }
32
37
  return captured;
33
38
  }
34
- function placeholderField(token) {
35
- if (token === '#')
36
- return 'irNumber';
37
- return token.replace(/-([A-Za-z0-9_$])/g, (_match, next) => next.toUpperCase());
38
- }
39
- function quotedContinuation(value) {
40
- return value.replaceAll('\n', '\n> ');
41
- }
42
- /**
43
- * Preserve authored Markdown quote markers around every line of relayed
44
- * runtime text. The generic composer preserves the marker itself; BRANCH's
45
- * override additionally keeps a multiline caller input inside that quote.
46
- */
47
- function composePlayerPrompt(input, resuming = false) {
39
+ function renderPlayerPrompt(input, promptIdentity, resuming = false) {
48
40
  const fields = input;
49
- const body = input.prompt.replace(PLACEHOLDER, (match, token, offset, source) => {
50
- const value = fields[placeholderField(token)];
51
- if (typeof value !== 'string')
52
- return match;
53
- const lineStart = source.lastIndexOf('\n', offset - 1) + 1;
54
- const literal = source.slice(lineStart, offset);
55
- return literal.startsWith('> ') ? quotedContinuation(value) : value;
56
- });
41
+ const mapping = {};
42
+ const identities = {};
43
+ const omitted = new Set([]);
44
+ const fieldFor = (token) => Object.hasOwn(mapping, token) ? mapping[token] : (token === '#' ? 'irNumber' : token.replace(/-([A-Za-z0-9_$])/g, (_match, next) => next.toUpperCase()));
45
+ const parts = input.prompt.split(/(\r?\n)/);
46
+ let body = '';
47
+ for (let index = 0; index < parts.length; index += 2) {
48
+ const line = parts[index];
49
+ if (omitted.has(line)) {
50
+ const token = /<(#|[A-Za-z_$][A-Za-z0-9_$-]*)>$/.exec(line)[1];
51
+ if (fields[fieldFor(token)] === '')
52
+ continue;
53
+ }
54
+ body += line.replace(/<(#|[A-Za-z_$][A-Za-z0-9_$-]*)>/g, (match, token) => {
55
+ const value = Object.hasOwn(identities, token) ? promptIdentity(identities[token]) : fields[fieldFor(token)];
56
+ if (typeof value !== 'string')
57
+ return match;
58
+ return line.startsWith('> ') ? value.replace(/\r?\n/g, (ending) => ending + '> ') : value;
59
+ }) + (parts[index + 1] ?? '');
60
+ }
57
61
  return composePlayerContinuation(input, body, resuming);
58
62
  }
59
- export const _internal = {
60
- composePlayerPrompt,
61
- VERBATIM_PAYLOAD_FIELDS,
62
- UNFINISHED_FINAL_STATE_IDS,
63
- };
63
+ const composePlayerPrompt = (input, promptIdentity, resuming) => renderPlayerPrompt(input, promptIdentity, resuming);
64
64
  const runtimeSpec = {
65
- label: 'BRANCH',
66
- // DR-022 / slc/link.md: the declaration carries the value current at link
67
- // time — a literal, never the loading engine's RUNTIME_ABI self-report,
68
- // which would follow whatever engine loads the module and make the
69
- // factory's skew check compare that engine with itself.
70
- compat: { artifactSchema: 3, runtimeAbi: 1 },
71
- snapshotOptions: snapshotBranchOptions,
72
- entryEvent: {
73
- type: 'START_BRANCH',
74
- textField: 'callerInput',
75
- // `startBranch` copies the entry text here, so the failure-state retry
76
- // reads it back from the persisted machine snapshot and survives a
77
- // continued session (DR-034).
78
- contextField: 'callerInput',
79
- },
80
- roleStates: {
81
- createBranch: {
82
- role: 'coder',
83
- label: 'Coder is reading the named issue and creating and checking out a new branch at the current commit.',
65
+ composePlayerPrompt,
66
+ ...{
67
+ "label": "BRANCH",
68
+ "compat": {
69
+ "artifactSchema": 3,
70
+ "runtimeAbi": 1
84
71
  },
85
- },
86
- // DR-050: BRANCH owns no repository commit — every Coder outcome, including
87
- // the Boss question for an ambiguous request, is governed with the
88
- // `unchanged` repository disposition, because a new branch at the current
89
- // commit changes neither HEAD's OID nor the worktree projection.
90
- outcomeAuthority: {
91
- governedPlayerStates: {
92
- createBranch: {
93
- branched: {
94
- fields: {
95
- branch: 'semantic',
96
- // DR-045: the unchanged receipt observes the commit the branch
97
- // was created from as HEAD; the reconciler injects it here.
98
- baseRevision: 'effect',
99
- issueSummary: 'semantic',
72
+ "entryEvent": {
73
+ "type": "START_BRANCH",
74
+ "textField": "callerInput",
75
+ "contextField": "callerInput"
76
+ },
77
+ "bossEvents": [],
78
+ "roleStates": {
79
+ "createBranch": {
80
+ "role": "coder",
81
+ "label": "Coder is identifying the request's issue and creating and checking out a new branch at the current commit."
82
+ }
83
+ },
84
+ "outcomeAuthority": {
85
+ "governedPlayerStates": {
86
+ "createBranch": {
87
+ "branched": {
88
+ "fields": {
89
+ "branch": "semantic",
90
+ "baseRevision": "effect",
91
+ "issueSummary": "semantic"
92
+ },
93
+ "repositoryDisposition": "unchanged"
94
+ },
95
+ "refused": {
96
+ "fields": {
97
+ "coderOutput": "presentation"
98
+ },
99
+ "repositoryDisposition": "unchanged"
100
100
  },
101
- repositoryDisposition: 'unchanged',
102
- },
103
- refused: {
104
- fields: { coderOutput: 'presentation' },
105
- repositoryDisposition: 'unchanged',
106
- },
107
- needsBossReply: {
108
- fields: { question: 'presentation' },
109
- repositoryDisposition: 'unchanged',
110
- },
111
- },
101
+ "needsBossReply": {
102
+ "fields": {
103
+ "question": "presentation"
104
+ },
105
+ "repositoryDisposition": "unchanged"
106
+ }
107
+ }
108
+ }
112
109
  },
110
+ "placeholderFields": {},
111
+ "transitionEventFields": [
112
+ "callerInput",
113
+ "answer",
114
+ "questionId"
115
+ ],
116
+ "controlContextFields": []
113
117
  },
114
- composePlayerPrompt: (input, _identity, resuming) => composePlayerPrompt(input, resuming),
118
+ snapshotOptions: validateOptions,
119
+ machineInput: (options) => Object.fromEntries(Object.entries(INPUT_MAPPING).filter(([, key]) => options[key] !== undefined)
120
+ .map(([field, key]) => [field, options[key]])),
115
121
  verbatimPayloadFields: VERBATIM_PAYLOAD_FIELDS,
116
- controlContextFields: [],
122
+ resumableStateIds: RESUMABLE_STATE_IDS,
117
123
  unfinishedFinalStateIds: UNFINISHED_FINAL_STATE_IDS,
118
- transitionEventFields: ['callerInput', 'answer', 'questionId'],
119
124
  };
120
- const createPlaybookRuntime = createXStatePlaybookRuntime(branchMachine, runtimeSpec);
125
+ export const _internal = {
126
+ composePlayerPrompt,
127
+ RESUMABLE_STATE_IDS,
128
+ UNFINISHED_FINAL_STATE_IDS,
129
+ VERBATIM_PAYLOAD_FIELDS,
130
+ };
131
+ const createPlaybookRuntime = createXStatePlaybookRuntime(machine, runtimeSpec);
121
132
  export default createPlaybookRuntime;