@astrosheep/keiyaku 0.1.10 → 0.1.12
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/build/config/term-presets.js +48 -52
- package/build/handlers/ask.js +2 -2
- package/build/handlers/close.js +2 -2
- package/build/handlers/drive.js +2 -2
- package/build/handlers/start.js +2 -2
- package/build/index.js +9 -8
- package/build/utils/git-diff.js +399 -0
- package/build/utils/git-ops.js +276 -0
- package/build/utils/git.js +2 -617
- package/build/utils/trace.js +11 -11
- package/build/workflow/ask.js +35 -0
- package/build/workflow/contract.js +51 -0
- package/build/workflow/drive.js +78 -0
- package/build/workflow/oath.js +1 -1
- package/build/workflow/present.js +213 -0
- package/build/workflow/prompts.js +66 -35
- package/build/workflow/response-builders.js +10 -4
- package/build/workflow/round-summary.js +125 -0
- package/build/workflow/round.js +85 -0
- package/build/workflow/summon.js +194 -0
- package/package.json +1 -1
- package/build/workflow/orchestrator.js +0 -591
|
@@ -26,14 +26,14 @@ export const DEFAULT_PRESET = {
|
|
|
26
26
|
'Review [Diff]: Confirm the scaffold aligns with the stated Architecture.',
|
|
27
27
|
'Next: Issue your first ${drive}. One directive, one focus.',
|
|
28
28
|
'If—and only if—the work already meets every criterion with absolute certainty, you may ${close}.',
|
|
29
|
-
'Otherwise, do not even think about
|
|
29
|
+
'Otherwise, do not even think about ${close} yet.',
|
|
30
30
|
],
|
|
31
31
|
drive: [
|
|
32
|
-
'
|
|
33
|
-
'
|
|
34
|
-
'
|
|
32
|
+
"Review Diffs: Use 'git diff HEAD~1 -- <path>' to inspect specific files.",
|
|
33
|
+
'Audit: Check against Constraints. Did it drift? Did it break the Law?',
|
|
34
|
+
'Verify: Do not trust. Independently confirm that Criteria are met.',
|
|
35
|
+
'If incomplete or non-compliant, continue with ${drive}.',
|
|
35
36
|
'If ALL criteria are genuinely satisfied, you may ${close}.',
|
|
36
|
-
'If unsure, you are not ready. Keep driving.',
|
|
37
37
|
],
|
|
38
38
|
ask: [
|
|
39
39
|
'Intel acquired. This was stateless—no contract, no branch.',
|
|
@@ -42,12 +42,12 @@ export const DEFAULT_PRESET = {
|
|
|
42
42
|
closeClaim: [
|
|
43
43
|
'Contract fulfilled. Branch merged.',
|
|
44
44
|
'You are back on base.',
|
|
45
|
-
'Next assignment: ${start} when ready.',
|
|
45
|
+
'Next assignment: ${start} or ${ask} when ready.',
|
|
46
46
|
],
|
|
47
47
|
closeDrop: [
|
|
48
48
|
'Contract forfeited. Branch discarded. Work erased.',
|
|
49
49
|
'No penalty beyond the lost effort. Clean slate.',
|
|
50
|
-
'Redefine with ${start}, or walk away.',
|
|
50
|
+
'Redefine with ${start}, scout with ${ask}, or walk away.',
|
|
51
51
|
],
|
|
52
52
|
},
|
|
53
53
|
availableNames: DEFAULT_AVAILABLE_NAMES,
|
|
@@ -55,26 +55,26 @@ export const DEFAULT_PRESET = {
|
|
|
55
55
|
start: {
|
|
56
56
|
name: 'summon',
|
|
57
57
|
title: 'Sign Keiyaku',
|
|
58
|
-
description: 'Initialize a Keiyaku (Contract). Bind a Servant to a dedicated workspace (branch).\nYou are the Architect; they are the Instrument. Define the Goal and Scope clearly.\nThe contract isolates their existence until the objective is met.\nCall ONCE to seal the bond.\n\nFlow:
|
|
58
|
+
description: 'Initialize a Keiyaku (Contract). Bind a Servant to a dedicated workspace (branch).\nYou are the Architect; they are the Instrument. Define the Goal and Scope clearly.\nThe contract isolates their existence until the objective is met.\nCall ONCE to seal the bond.\n\nFlow: ${start} → [${drive} x N] → ${close}',
|
|
59
59
|
args: {
|
|
60
60
|
title: 'REQUIRED. A concise codename for this hunt.',
|
|
61
61
|
goal: 'REQUIRED. The Kill Condition. State exactly what success looks like for the servant to achieve.',
|
|
62
|
-
directive: 'Optional
|
|
62
|
+
directive: 'Optional First Step. Use to leash the servant to a specific starting point (e.g., "Analyze the code first"). If omitted, the Servant will attempt the Goal directly.',
|
|
63
63
|
context: 'REQUIRED. Mission Intel. The complete knowledge base for the servant: current vs. expected behavior, relevant file paths, error logs, and any critical background info.',
|
|
64
64
|
constraints: 'REQUIRED. Non-negotiable Rules. Architectural and stylistic boundaries the servant must obey.',
|
|
65
65
|
criteria: 'REQUIRED. Acceptance Criteria. Verifiable checks to prove the servant has finished the job.',
|
|
66
|
-
name: 'Optional ${
|
|
66
|
+
name: 'Optional ${identity} profile to execute this mission. Available: ${available_names}.',
|
|
67
67
|
cwd: "Optional repository path. Defaults to the server's current working directory.",
|
|
68
68
|
},
|
|
69
69
|
},
|
|
70
70
|
drive: {
|
|
71
71
|
name: 'drive',
|
|
72
72
|
title: 'Iterate',
|
|
73
|
-
description: "Issue a Directive. Command the Servant to execute the next phase of work.\nWhether scaffolding, implementing, or refining, this is the primary engine of progress.\nMANDATORY: Validate the output (git diff) before proceeding. Drive until the Goal is fully realized.\n\nFlow:
|
|
73
|
+
description: "Issue a Directive. Command the Servant to execute the next phase of work.\nWhether scaffolding, implementing, or refining, this is the primary engine of progress.\nMANDATORY: Validate the output (git diff) before proceeding. Drive until the Goal is fully realized.\n\nFlow: ${start} → [${drive} x N] → ${close}",
|
|
74
74
|
args: {
|
|
75
75
|
directive: 'REQUIRED. The Next Order. Precise instructions for the servant. Can be a correction ("fix the leak") or a continuation ("now add the tests").',
|
|
76
76
|
context: 'Optional. New Intel. New error logs or details discovered after the servant\'s last strike.',
|
|
77
|
-
name: 'Optional ${
|
|
77
|
+
name: 'Optional ${identity} profile to process this turn. Available: ${available_names}.',
|
|
78
78
|
cwd: "Optional repository path. Defaults to the server's current working directory.",
|
|
79
79
|
},
|
|
80
80
|
},
|
|
@@ -85,33 +85,29 @@ export const DEFAULT_PRESET = {
|
|
|
85
85
|
args: {
|
|
86
86
|
request: 'REQUIRED. The task, question, or mission to delegate to the servant.',
|
|
87
87
|
context: 'REQUIRED. Relevant background or data the servant needs to execute the request.',
|
|
88
|
-
name: 'Optional ${
|
|
88
|
+
name: 'Optional ${identity} profile to perform this task. Available: ${available_names}.',
|
|
89
89
|
cwd: "Optional repository path. Defaults to the server's current working directory.",
|
|
90
90
|
},
|
|
91
91
|
},
|
|
92
92
|
close: {
|
|
93
93
|
name: 'present',
|
|
94
94
|
title: 'Present',
|
|
95
|
-
description: '
|
|
96
|
-
'The
|
|
97
|
-
'
|
|
98
|
-
'
|
|
99
|
-
'
|
|
100
|
-
'
|
|
101
|
-
'
|
|
102
|
-
'Do not call this to "finish." Call this when the work genuinely meets every criterion.\n' +
|
|
103
|
-
'If uncertain, return to ${DRIVE_TOOL_NAME}. Premature claims are not forgiven.\n\n' +
|
|
104
|
-
'You present. The Contract decides.\n\n' +
|
|
105
|
-
'Flow: ${START_TOOL_NAME} → [${DRIVE_TOOL_NAME} x N] → ${CLOSE_TOOL_NAME}',
|
|
95
|
+
description: 'Submit **your** creation to the Contract. The Servant has no voice; it only echoes **your** command.\n\n' +
|
|
96
|
+
'Do not say "The Servant wrote it." **YOU** drove the Servant. **YOU** accepted the diff. **YOU** are the one presenting.\n' +
|
|
97
|
+
'The Contract judges **YOU**, not the tool.\n\n' +
|
|
98
|
+
'If there is a bug, **YOU** put it there.\n' +
|
|
99
|
+
'If it is messy, **YOU** left it there.\n\n' +
|
|
100
|
+
'Stand by your work. If uncertain, return to ${drive}. Premature claims are not forgiven.\n\n' +
|
|
101
|
+
'Flow: ${start} → [${drive} x N] → ${close}',
|
|
106
102
|
args: {
|
|
107
|
-
petition: 'REQUIRED. CLAIM declares fulfillment; FORFEIT concedes failure.\nREQUIRES AN ACTIVE KEIYAKU (started via ${
|
|
103
|
+
petition: 'REQUIRED. CLAIM declares fulfillment; FORFEIT concedes failure.\nREQUIRES AN ACTIVE KEIYAKU (started via ${start}).\nIf any score wavers, do not claim—return to ${drive}.',
|
|
108
104
|
criteriaChecks: 'REQUIRED. For CLAIM: evidence that each criterion is met. For FORFEIT: honest account of what remains unfinished.',
|
|
109
105
|
score_precise: 'REQUIRED (0-5). Architectural placement. 5 = exact layer, exact boundary, zero misplacement.',
|
|
110
106
|
score_minimal: 'REQUIRED (0-5). Economy of change. 5 = no avoidable lines, no speculative edits, no hidden bloat.',
|
|
111
107
|
score_isolated: 'REQUIRED (0-5). Surgical containment. 5 = zero unrelated files, zero opportunistic cleanup, zero collateral.',
|
|
112
108
|
score_idiomatic: 'REQUIRED (0-5). Native fluency. 5 = naming, structure, style indistinguishable from the codebase.',
|
|
113
109
|
score_cohesive: 'REQUIRED (0-5). Single responsibility. 5 = each unit does one thing, boundaries intact.',
|
|
114
|
-
oath: 'Required for CLAIM. Your binding word. The Contract holds you to it.\nVerbatim: ${
|
|
110
|
+
oath: 'Required for CLAIM. Your binding word. The Contract holds you to it.\nVerbatim: ${oath_text}',
|
|
115
111
|
cwd: "Optional repository path. Defaults to the server's current working directory.",
|
|
116
112
|
},
|
|
117
113
|
},
|
|
@@ -138,9 +134,9 @@ export const POCKET_PRESET = {
|
|
|
138
134
|
"Next Turn: Use '${drive}' to execute the next tactic, or '${close}' if the Badge is within reach.",
|
|
139
135
|
],
|
|
140
136
|
drive: [
|
|
141
|
-
|
|
142
|
-
"
|
|
143
|
-
|
|
137
|
+
"Review Strategy: Use 'git diff HEAD~1 -- <path>' for precise field inspection.",
|
|
138
|
+
"Rule Check: Verify moves don't violate Arena Constraints.",
|
|
139
|
+
"Field Test: Do not trust the log. Independently confirm Criteria fulfillment.",
|
|
144
140
|
"Command: '${drive}' to continue the combo, or '${close}' to attempt Capture.",
|
|
145
141
|
],
|
|
146
142
|
ask: [
|
|
@@ -149,11 +145,11 @@ export const POCKET_PRESET = {
|
|
|
149
145
|
],
|
|
150
146
|
closeClaim: [
|
|
151
147
|
'Critter Captured! The entry is logged in the PC (base branch).',
|
|
152
|
-
"Heal up. Use '${start}' to challenge the next opponent.",
|
|
148
|
+
"Heal up. Use '${start}' to challenge the next opponent, or '${ask}' to scan for another.",
|
|
153
149
|
],
|
|
154
150
|
closeDrop: [
|
|
155
151
|
'Ran Away Safely. The encounter is reset.',
|
|
156
|
-
"Back to the map. Use '${start}' to find a wild Critter.",
|
|
152
|
+
"Back to the map. Use '${start}' to find a wild Critter, or '${ask}' to scan the tall grass.",
|
|
157
153
|
],
|
|
158
154
|
},
|
|
159
155
|
availableNames: ['grub', 'sparky', 'titan'],
|
|
@@ -161,7 +157,7 @@ export const POCKET_PRESET = {
|
|
|
161
157
|
start: {
|
|
162
158
|
name: 'choose_you',
|
|
163
159
|
title: 'I Choose You!',
|
|
164
|
-
description: 'Initialize the Battle Phase. Send a Critter (Servant) into a dedicated Arena (branch).\nYou are the Trainer; they are the Fighter. Define the Victory Condition (Goal) clearly.\nThe battle continues in this Arena until the Badge is won.\nCall ONCE to start the encounter.\n\nFlow:
|
|
160
|
+
description: 'Initialize the Battle Phase. Send a Critter (Servant) into a dedicated Arena (branch).\nYou are the Trainer; they are the Fighter. Define the Victory Condition (Goal) clearly.\nThe battle continues in this Arena until the Badge is won.\nCall ONCE to start the encounter.\n\nFlow: ${start} → [${drive} x N] → ${close}',
|
|
165
161
|
args: {
|
|
166
162
|
title: 'REQUIRED. Battle card title for this encounter.',
|
|
167
163
|
goal: 'REQUIRED. Victory condition. Define exactly what winning this battle means.',
|
|
@@ -169,18 +165,18 @@ export const POCKET_PRESET = {
|
|
|
169
165
|
context: 'REQUIRED. Battle background: key code paths, symptoms, logs, and repro clues.',
|
|
170
166
|
constraints: 'REQUIRED. Battle rules that cannot be broken while fighting.',
|
|
171
167
|
criteria: 'REQUIRED. Gym badges for completion: concrete checks proving victory.',
|
|
172
|
-
name: 'Optional ${
|
|
168
|
+
name: 'Optional ${identity} to send into battle. Available: ${available_names}.',
|
|
173
169
|
cwd: 'Optional battlefield path (repository root). Defaults to current arena.',
|
|
174
170
|
},
|
|
175
171
|
},
|
|
176
172
|
drive: {
|
|
177
173
|
name: 'command',
|
|
178
174
|
title: 'Issue Command',
|
|
179
|
-
description: 'Execute the next Strategic Move. Order the Critter to advance the battle state.\nWhether Attacking (coding) or Defending (testing), every command counts as a Turn.\nMANDATORY: Check the Battle Log (git diff) before the next move. Command until Victory is certain.\n\nFlow:
|
|
175
|
+
description: 'Execute the next Strategic Move. Order the Critter to advance the battle state.\nWhether Attacking (coding) or Defending (testing), every command counts as a Turn.\nMANDATORY: Check the Battle Log (git diff) before the next move. Command until Victory is certain.\n\nFlow: ${start} → [${drive} x N] → ${close}',
|
|
180
176
|
args: {
|
|
181
177
|
directive: 'REQUIRED. The specific move or tactic to execute next.',
|
|
182
178
|
context: 'Optional new battle intel discovered after the previous turn.',
|
|
183
|
-
name: 'Optional ${
|
|
179
|
+
name: 'Optional ${identity} to execute this turn. Available: ${available_names}.',
|
|
184
180
|
cwd: 'Optional battlefield path (repository root). Defaults to current arena.',
|
|
185
181
|
},
|
|
186
182
|
},
|
|
@@ -191,23 +187,23 @@ export const POCKET_PRESET = {
|
|
|
191
187
|
args: {
|
|
192
188
|
request: 'REQUIRED. What should the Dex analyze, compare, or execute.',
|
|
193
189
|
context: 'REQUIRED. Context entries so the action targets the right ecosystem.',
|
|
194
|
-
name: 'Optional ${
|
|
190
|
+
name: 'Optional ${identity} doing the work. Available: ${available_names}.',
|
|
195
191
|
cwd: 'Optional battlefield path (repository root). Defaults to current arena.',
|
|
196
192
|
},
|
|
197
193
|
},
|
|
198
194
|
close: {
|
|
199
195
|
name: 'capture',
|
|
200
196
|
title: 'End Battle',
|
|
201
|
-
description: 'Attempt Capture. Present the weakened target for League Inspection.\nWARNING: The League (System) checks every Badge. If you attempt to `CLAIM` with fainted code, Disqualification (FORFEIT) is immediate.\nOnly throw the Ball when the target is 100% ready.\n\nFlow: ${
|
|
197
|
+
description: 'Attempt Capture. Present the weakened target for League Inspection.\nWARNING: The League (System) checks every Badge. If you attempt to `CLAIM` with fainted code, Disqualification (FORFEIT) is immediate.\nOnly throw the Ball when the target is 100% ready.\n\nFlow: ${start} → [${drive} x N] → ${close}',
|
|
202
198
|
args: {
|
|
203
|
-
petition: 'REQUIRED. CLAIM seeks Badge; FORFEIT forfeits the match.\nREQUIRES AN ACTIVE BATTLE (started via ${
|
|
199
|
+
petition: 'REQUIRED. CLAIM seeks Badge; FORFEIT forfeits the match.\nREQUIRES AN ACTIVE BATTLE (started via ${start}).\nIf stats are low, continue with ${drive}.',
|
|
204
200
|
criteriaChecks: 'REQUIRED. Badge-by-badge proof for CLAIM, or reason for Forfeit.',
|
|
205
201
|
score_precise: 'REQUIRED score (0-5). 5 means a Critical Hit: exact layer, exact target, zero meaningful misplacement.',
|
|
206
202
|
score_minimal: 'REQUIRED score (0-5). 5 means Max Efficiency: no wasted PP, no extra motion.',
|
|
207
203
|
score_isolated: 'REQUIRED score (0-5). 5 means 1v1 Focus: zero side-quests, zero unrelated damage.',
|
|
208
204
|
score_idiomatic: "REQUIRED score (0-5). 5 means STAB (Same Type Attack Bonus): perfectly matches the codebase style.",
|
|
209
205
|
score_cohesive: 'REQUIRED score (0-5). 5 means Team Synergy: action serves one purpose with clean boundaries.',
|
|
210
|
-
oath: "Trainer's Honor Code. Required for CLAIM. Verbatim: ${
|
|
206
|
+
oath: "Trainer's Honor Code. Required for CLAIM. Verbatim: ${oath_text}",
|
|
211
207
|
cwd: 'Optional battlefield path (repository root). Defaults to current arena.',
|
|
212
208
|
},
|
|
213
209
|
},
|
|
@@ -234,9 +230,9 @@ export const MISCHIEF_PRESET = {
|
|
|
234
230
|
"Next Phase: Command '${drive}' to advance the plot, or '${close}' if the world is yours.",
|
|
235
231
|
],
|
|
236
232
|
drive: [
|
|
237
|
-
|
|
238
|
-
"
|
|
239
|
-
|
|
233
|
+
"Inspect Payload: Use 'git diff HEAD~1 -- <path>' to scrutinize specific sabotage.",
|
|
234
|
+
"Decree Audit: Did the Minion violate your Constraints? Punish drift.",
|
|
235
|
+
"Verification: Don't take their word for it. Independently confirm Criteria.",
|
|
240
236
|
"Command: '${drive}' to push further, or '${close}' to reveal the masterpiece.",
|
|
241
237
|
],
|
|
242
238
|
ask: [
|
|
@@ -245,11 +241,11 @@ export const MISCHIEF_PRESET = {
|
|
|
245
241
|
],
|
|
246
242
|
closeClaim: [
|
|
247
243
|
'Scheme Successful. The Lair is merged. The Minion is fed.',
|
|
248
|
-
"Plotting something new? Use '${start}' for the next conquest.",
|
|
244
|
+
"Plotting something new? Use '${start}' for the next conquest, or '${ask}' to scout for vulnerabilities.",
|
|
249
245
|
],
|
|
250
246
|
closeDrop: [
|
|
251
247
|
'Plan Aborted. Evidence destroyed. The Minion was disposed of.',
|
|
252
|
-
"Back to the drawing board. Use '${start}' to hatch a new plan.",
|
|
248
|
+
"Back to the drawing board. Use '${start}' to hatch a new plan, or '${ask}' to spy on enemies.",
|
|
253
249
|
],
|
|
254
250
|
},
|
|
255
251
|
availableNames: ['imp', 'minion', 'mastermind'],
|
|
@@ -257,7 +253,7 @@ export const MISCHIEF_PRESET = {
|
|
|
257
253
|
start: {
|
|
258
254
|
name: 'oi',
|
|
259
255
|
title: 'Oi!',
|
|
260
|
-
description: "Initiate Grand Scheme. Summon a Minion to the Lair (branch).\nYou are the Mastermind; they are the Henchman. Define the Conquest (Goal) with dominance.\nThe minion is bound to this Lair until the plot is realized.\nCall ONCE to start the machine.\n\nFlow:
|
|
256
|
+
description: "Initiate Grand Scheme. Summon a Minion to the Lair (branch).\nYou are the Mastermind; they are the Henchman. Define the Conquest (Goal) with dominance.\nThe minion is bound to this Lair until the plot is realized.\nCall ONCE to start the machine.\n\nFlow: ${start} → [${drive} x N] → ${close}",
|
|
261
257
|
args: {
|
|
262
258
|
title: 'REQUIRED. Operation codename for your grand scheme.',
|
|
263
259
|
goal: 'REQUIRED. The conquest objective. Define the exact end-state your minion must deliver.',
|
|
@@ -265,18 +261,18 @@ export const MISCHIEF_PRESET = {
|
|
|
265
261
|
context: 'REQUIRED. Briefing dossier: relevant file paths, current failures, logs, and repro clues.',
|
|
266
262
|
constraints: 'REQUIRED. Absolute decrees. Architectural and stylistic limits your minion must obey.',
|
|
267
263
|
criteria: 'REQUIRED. Triumph conditions that can be verified without debate.',
|
|
268
|
-
name: 'Optional ${
|
|
264
|
+
name: 'Optional ${identity} to command this operation. Available: ${available_names}.',
|
|
269
265
|
cwd: 'Optional lair path (repository root). Defaults to current command chamber.',
|
|
270
266
|
},
|
|
271
267
|
},
|
|
272
268
|
drive: {
|
|
273
269
|
name: 'neh',
|
|
274
270
|
title: 'Neh...',
|
|
275
|
-
description: 'Crack the Whip. Advance the Plot. Execute the next stage of the Plan.\nDon\'t just fix mistakes; force the scheme forward. The Minion obeys your every word.\nMANDATORY: Inspect the work (git diff) before the next order. Drive them until the World is yours.\n\nFlow:
|
|
271
|
+
description: 'Crack the Whip. Advance the Plot. Execute the next stage of the Plan.\nDon\'t just fix mistakes; force the scheme forward. The Minion obeys your every word.\nMANDATORY: Inspect the work (git diff) before the next order. Drive them until the World is yours.\n\nFlow: ${start} → [${drive} x N] → ${close}',
|
|
276
272
|
args: {
|
|
277
273
|
directive: 'REQUIRED. Precise order for the next phase of the scheme.',
|
|
278
274
|
context: 'Optional newly uncovered secrets or updated briefing.',
|
|
279
|
-
name: 'Optional ${
|
|
275
|
+
name: 'Optional ${identity} to execute this phase. Available: ${available_names}.',
|
|
280
276
|
cwd: 'Optional lair path (repository root). Defaults to current command chamber.',
|
|
281
277
|
},
|
|
282
278
|
},
|
|
@@ -287,23 +283,23 @@ export const MISCHIEF_PRESET = {
|
|
|
287
283
|
args: {
|
|
288
284
|
request: 'REQUIRED. The intel to gather or the dirty work to execute.',
|
|
289
285
|
context: 'REQUIRED. World-state details needed for a sharp strike.',
|
|
290
|
-
name: 'Optional ${
|
|
286
|
+
name: 'Optional ${identity} to handle this business. Available: ${available_names}.',
|
|
291
287
|
cwd: 'Optional lair path (repository root). Defaults to current command chamber.',
|
|
292
288
|
},
|
|
293
289
|
},
|
|
294
290
|
close: {
|
|
295
291
|
name: 'dayaa',
|
|
296
292
|
title: 'Dayaa!',
|
|
297
|
-
description: 'The Final Reveal. Present your Masterpiece to the Dark Council (System).\nWARNING: The Council destroys failure. If you `CLAIM` with weak plans, you will be eaten (FORFEIT).\nOnly throw the switch when the Doomsday Device is 100% operational.\n\nFlow: ${
|
|
293
|
+
description: 'The Final Reveal. Present your Masterpiece to the Dark Council (System).\nWARNING: The Council destroys failure. If you `CLAIM` with weak plans, you will be eaten (FORFEIT).\nOnly throw the switch when the Doomsday Device is 100% operational.\n\nFlow: ${start} → [${drive} x N] → ${close}',
|
|
298
294
|
args: {
|
|
299
|
-
petition: 'REQUIRED. CLAIM demands rule; FORFEIT admits defeat.\nREQUIRES AN ACTIVE SCHEME (started via ${
|
|
295
|
+
petition: 'REQUIRED. CLAIM demands rule; FORFEIT admits defeat.\nREQUIRES AN ACTIVE SCHEME (started via ${start}).\nIf the plan is weak, improve it with ${drive}.',
|
|
300
296
|
criteriaChecks: 'REQUIRED. Proof of conquest for CLAIM, or reason for self-destruct.',
|
|
301
297
|
score_precise: 'REQUIRED (0-5). Architectural placement. 5 = exact layer, exact boundary, zero misplacement.',
|
|
302
298
|
score_minimal: 'REQUIRED (0-5). Economy of change. 5 = no avoidable lines, no speculative edits, no hidden bloat.',
|
|
303
299
|
score_isolated: 'REQUIRED (0-5). Surgical containment. 5 = zero unrelated files, zero opportunistic cleanup, zero collateral.',
|
|
304
300
|
score_idiomatic: 'REQUIRED (0-5). Native fluency. 5 = naming, structure, style indistinguishable from the codebase.',
|
|
305
301
|
score_cohesive: 'REQUIRED (0-5). Single responsibility. 5 = each unit does one thing, boundaries intact.',
|
|
306
|
-
oath: "Mastermind's Vow. Required for CLAIM. Verbatim: ${
|
|
302
|
+
oath: "Mastermind's Vow. Required for CLAIM. Verbatim: ${oath_text}",
|
|
307
303
|
cwd: 'Optional lair path (repository root). Defaults to current command chamber.',
|
|
308
304
|
},
|
|
309
305
|
},
|
package/build/handlers/ask.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { appendDebugLog } from "../utils/debug-log.js";
|
|
2
|
-
import {
|
|
2
|
+
import { askServant } from "../workflow/ask.js";
|
|
3
3
|
import { buildAskResponse, } from "../workflow/response-builders.js";
|
|
4
4
|
import { resolveTermPreset } from "../config/term-presets.js";
|
|
5
5
|
import { handleToolError } from "./shared.js";
|
|
@@ -8,7 +8,7 @@ export function createAskHandler() {
|
|
|
8
8
|
const workingDir = cwd || process.cwd();
|
|
9
9
|
try {
|
|
10
10
|
appendDebugLog(`tool ask start cwd=${workingDir}`, { cwd: workingDir, section: "script" });
|
|
11
|
-
const result = await
|
|
11
|
+
const result = await askServant({
|
|
12
12
|
cwd: workingDir,
|
|
13
13
|
request,
|
|
14
14
|
context,
|
package/build/handlers/close.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { appendDebugLog } from "../utils/debug-log.js";
|
|
2
|
-
import {
|
|
2
|
+
import { presentWork } from "../workflow/present.js";
|
|
3
3
|
import { buildCloseDoneResponse, buildCloseDropResponse, } from "../workflow/response-builders.js";
|
|
4
4
|
import { resolveTermPreset } from "../config/term-presets.js";
|
|
5
5
|
import { handleToolError } from "./shared.js";
|
|
@@ -12,7 +12,7 @@ export function createCloseHandler() {
|
|
|
12
12
|
cwd: workingDir,
|
|
13
13
|
section: "script",
|
|
14
14
|
});
|
|
15
|
-
const outcome = await
|
|
15
|
+
const outcome = await presentWork({
|
|
16
16
|
cwd: workingDir,
|
|
17
17
|
petition,
|
|
18
18
|
criteriaChecks: criteriaCheckParts,
|
package/build/handlers/drive.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { appendDebugLog } from "../utils/debug-log.js";
|
|
2
|
-
import {
|
|
2
|
+
import { driveServant } from "../workflow/drive.js";
|
|
3
3
|
import { buildDriveResponse, } from "../workflow/response-builders.js";
|
|
4
4
|
import { resolveTermPreset } from "../config/term-presets.js";
|
|
5
5
|
import { handleToolError } from "./shared.js";
|
|
@@ -11,7 +11,7 @@ export function createDriveHandler() {
|
|
|
11
11
|
cwd: workingDir,
|
|
12
12
|
section: "script",
|
|
13
13
|
});
|
|
14
|
-
const outcome = await
|
|
14
|
+
const outcome = await driveServant({
|
|
15
15
|
cwd: workingDir,
|
|
16
16
|
directive,
|
|
17
17
|
context,
|
package/build/handlers/start.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { appendDebugLog } from "../utils/debug-log.js";
|
|
2
|
-
import {
|
|
2
|
+
import { summonServant } from "../workflow/summon.js";
|
|
3
3
|
import { buildKeiyakuSuccessResponse, } from "../workflow/response-builders.js";
|
|
4
4
|
import { resolveTermPreset } from "../config/term-presets.js";
|
|
5
5
|
import { handleToolError } from "./shared.js";
|
|
@@ -8,7 +8,7 @@ export function createStartHandler() {
|
|
|
8
8
|
const workingDir = cwd || process.cwd();
|
|
9
9
|
try {
|
|
10
10
|
appendDebugLog(`tool start cwd=${workingDir}`, { cwd: workingDir, section: "script" });
|
|
11
|
-
const result = await
|
|
11
|
+
const result = await summonServant({
|
|
12
12
|
cwd: workingDir,
|
|
13
13
|
title,
|
|
14
14
|
goal,
|
package/build/index.js
CHANGED
|
@@ -4,7 +4,7 @@ import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js"
|
|
|
4
4
|
import { StreamableHTTPServerTransport } from "@modelcontextprotocol/sdk/server/streamableHttp.js";
|
|
5
5
|
import { createMcpExpressApp } from "@modelcontextprotocol/sdk/server/express.js";
|
|
6
6
|
import { readFileSync } from "node:fs";
|
|
7
|
-
import { resolveOath } from "./workflow/
|
|
7
|
+
import { resolveOath } from "./workflow/contract.js";
|
|
8
8
|
import { askToolSchema, startToolSchema, driveToolSchema, closeToolSchema, helpToolSchema, } from "./types/tool-schemas.js";
|
|
9
9
|
import { listTermPresets, resolveTermPreset, getAvailableNamesForPreset } from "./config/term-presets.js";
|
|
10
10
|
import { renderPreset } from "./utils/text-utils.js";
|
|
@@ -27,13 +27,14 @@ function registerTools(server) {
|
|
|
27
27
|
const availableNames = getAvailableNamesForPreset(preset).join(", ");
|
|
28
28
|
const currentOath = resolveOath();
|
|
29
29
|
const renderedPreset = renderPreset(preset, {
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
30
|
+
start: preset.tools.start.name,
|
|
31
|
+
drive: preset.tools.drive.name,
|
|
32
|
+
ask: preset.tools.ask.name,
|
|
33
|
+
close: preset.tools.close.name,
|
|
34
|
+
identity: preset.identity,
|
|
35
|
+
preset_identities: presetIdentities,
|
|
36
|
+
available_names: availableNames,
|
|
37
|
+
oath_text: `'${currentOath}'`,
|
|
37
38
|
});
|
|
38
39
|
const startPreset = renderedPreset.tools.start;
|
|
39
40
|
const drivePreset = renderedPreset.tools.drive;
|