@kernlang/agon 0.1.5 → 0.1.6

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 (32) hide show
  1. package/dist/{chunk-4NTH3EAR.js → chunk-3PDYVGRS.js} +77 -22
  2. package/dist/chunk-3PDYVGRS.js.map +1 -0
  3. package/dist/{chunk-GPYWJO2Q.js → chunk-6IF2AV4Y.js} +8 -7
  4. package/dist/{chunk-GPYWJO2Q.js.map → chunk-6IF2AV4Y.js.map} +1 -1
  5. package/dist/{chunk-73ETZFDH.js → chunk-7WZ2O5WZ.js} +4 -4
  6. package/dist/{chunk-DGTU4UWQ.js → chunk-NBV37VMW.js} +2 -2
  7. package/dist/{chunk-46WNYE4R.js → chunk-PUNBDLQO.js} +31 -31
  8. package/dist/chunk-PUNBDLQO.js.map +1 -0
  9. package/dist/{chunk-HAJIKZGU.js → chunk-TMNHJOKU.js} +408 -68
  10. package/dist/chunk-TMNHJOKU.js.map +1 -0
  11. package/dist/{chunk-SOUF7XTW.js → chunk-XWHC6VAH.js} +3 -2
  12. package/dist/chunk-XWHC6VAH.js.map +1 -0
  13. package/dist/{dispatch-XHLJ44TF.js → dispatch-S3CR5HKX.js} +2 -2
  14. package/dist/engines/codex.json +3 -0
  15. package/dist/{forge-ZI7NE73F.js → forge-GUOEJ5DJ.js} +6 -6
  16. package/dist/index.js +28 -24
  17. package/dist/index.js.map +1 -1
  18. package/dist/{plan-mode-KIXDKD63.js → plan-mode-35BONR7S.js} +6 -6
  19. package/dist/{src-4A5FVACG.js → src-3NWTITZM.js} +9 -3
  20. package/dist/{update-DLPMYTF3.js → update-H3LE4ZSI.js} +5 -5
  21. package/package.json +3 -2
  22. package/dist/chunk-46WNYE4R.js.map +0 -1
  23. package/dist/chunk-4NTH3EAR.js.map +0 -1
  24. package/dist/chunk-HAJIKZGU.js.map +0 -1
  25. package/dist/chunk-SOUF7XTW.js.map +0 -1
  26. /package/dist/{chunk-73ETZFDH.js.map → chunk-7WZ2O5WZ.js.map} +0 -0
  27. /package/dist/{chunk-DGTU4UWQ.js.map → chunk-NBV37VMW.js.map} +0 -0
  28. /package/dist/{dispatch-XHLJ44TF.js.map → dispatch-S3CR5HKX.js.map} +0 -0
  29. /package/dist/{forge-ZI7NE73F.js.map → forge-GUOEJ5DJ.js.map} +0 -0
  30. /package/dist/{plan-mode-KIXDKD63.js.map → plan-mode-35BONR7S.js.map} +0 -0
  31. /package/dist/{src-4A5FVACG.js.map → src-3NWTITZM.js.map} +0 -0
  32. /package/dist/{update-DLPMYTF3.js.map → update-H3LE4ZSI.js.map} +0 -0
@@ -6,10 +6,10 @@ import {
6
6
  parseConfidence,
7
7
  runForge,
8
8
  sessionResultStore
9
- } from "./chunk-4NTH3EAR.js";
9
+ } from "./chunk-3PDYVGRS.js";
10
10
  import {
11
11
  ENGINE_COLORS
12
- } from "./chunk-DGTU4UWQ.js";
12
+ } from "./chunk-NBV37VMW.js";
13
13
  import {
14
14
  RUNS_DIR,
15
15
  acquireApplyLock,
@@ -37,7 +37,7 @@ import {
37
37
  snapshotWorkspace,
38
38
  startPlan,
39
39
  tracker
40
- } from "./chunk-HAJIKZGU.js";
40
+ } from "./chunk-TMNHJOKU.js";
41
41
 
42
42
  // src/generated/handlers/forge.ts
43
43
  import { join as join4 } from "path";
@@ -1571,4 +1571,4 @@ export {
1571
1571
  inferProjectFitnessCommand,
1572
1572
  handleForge
1573
1573
  };
1574
- //# sourceMappingURL=chunk-73ETZFDH.js.map
1574
+ //# sourceMappingURL=chunk-7WZ2O5WZ.js.map
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  loadConfig
4
- } from "./chunk-HAJIKZGU.js";
4
+ } from "./chunk-TMNHJOKU.js";
5
5
 
6
6
  // src/generated/signals/icons.ts
7
7
  var ROMAN_ICONS = { read: "\u039E", edit: "\u270E", write: "\u2712", bash: "\u03DF", search: "\u2609", find: "\u2295", tool: "\u2692", campfire: "\u2632", brainstorm: "\u2609", tribunal: "\u2696", image: "\u229E", queue: "\u231B", prompt: "\u25BB", winner: "\u2605", success: "\u2714", fail: "\u2718", warning: "\u26A0", header: "\u25B8", nero: "\u2020", dotOn: "\u25C6", dotOff: "\u25C7", play: "\u25B6", refresh: "\u21BB", flag: "\u2691", check: "\u2714", cross: "\u2718", spinner: "\u25D0" };
@@ -486,4 +486,4 @@ export {
486
486
  truncateCodeLine,
487
487
  cleanEngineOutput
488
488
  };
489
- //# sourceMappingURL=chunk-DGTU4UWQ.js.map
489
+ //# sourceMappingURL=chunk-NBV37VMW.js.map
@@ -13,11 +13,11 @@ import {
13
13
  runForge,
14
14
  runTribunal,
15
15
  sessionResultStore
16
- } from "./chunk-4NTH3EAR.js";
16
+ } from "./chunk-3PDYVGRS.js";
17
17
  import {
18
18
  ENGINE_COLORS,
19
19
  icons
20
- } from "./chunk-DGTU4UWQ.js";
20
+ } from "./chunk-NBV37VMW.js";
21
21
  import {
22
22
  AgentSession,
23
23
  AgentTeam,
@@ -44,20 +44,20 @@ import {
44
44
  formatCesarPlanMarkdown,
45
45
  isReadOnlyCommand,
46
46
  loadOrCreateActiveThread,
47
- planCostEstimator,
48
47
  rankByTaskClass,
49
48
  readPatchFromPath,
50
49
  resolveWorkingDir,
51
50
  runAgentInvestigateSynthesis,
52
51
  runAgentTeamSynthesis,
53
52
  runPostSynthesisFitnessCheck,
53
+ sanitizePlanSteps,
54
54
  saveCesarPlan,
55
55
  scanProjectContext,
56
56
  scoreAgentTeamResult,
57
57
  spawnWithTimeout,
58
58
  tracker,
59
59
  worktreeChangedDiff
60
- } from "./chunk-HAJIKZGU.js";
60
+ } from "./chunk-TMNHJOKU.js";
61
61
 
62
62
  // src/generated/handlers/plan-mode.ts
63
63
  import { writeFileSync as writeFileSync2, mkdirSync as mkdirSync3 } from "fs";
@@ -2014,31 +2014,10 @@ ${clipAgentText(winnerAnalysis, 4e3)}`);
2014
2014
 
2015
2015
  // src/generated/handlers/plan-mode.ts
2016
2016
  async function handleProposePlan(args, dispatch, ctx) {
2017
- const SAFE_ID = /^[a-z0-9_-]{1,64}$/;
2018
- const sanitizeId = (raw, fallback) => {
2019
- if (typeof raw === "string" && SAFE_ID.test(raw)) return raw;
2020
- return fallback;
2021
- };
2022
- const steps = (args.steps ?? []).map((s, i) => {
2023
- const est = planCostEstimator.estimate(s.type, s.engines ?? []);
2024
- return {
2025
- id: sanitizeId(s.id, `step-${i}-${Math.random().toString(36).slice(2, 8)}`),
2026
- type: s.type,
2027
- description: s.description,
2028
- engines: s.engines,
2029
- engine: s.engine,
2030
- fitnessCmd: s.fitnessCmd,
2031
- tribunalMode: s.tribunalMode,
2032
- parallel: s.parallel ?? false,
2033
- dependsOn: s.dependsOn,
2034
- exports: typeof s.exports === "string" ? [s.exports] : s.exports,
2035
- imports: typeof s.imports === "string" ? [s.imports] : s.imports,
2036
- estimatedTokens: est.tokens,
2037
- estimatedCostUsd: est.costUsd,
2038
- rationale: s.rationale,
2039
- verifyCmd: s.verifyCmd
2040
- };
2041
- });
2017
+ const { steps, dropped } = sanitizePlanSteps(args.steps);
2018
+ if (dropped > 0 && dispatch) {
2019
+ dispatch({ type: "info", message: `Dropped ${dropped} malformed plan step${dropped === 1 ? "" : "s"} from the proposal.` });
2020
+ }
2042
2021
  let plan = createCesarPlan(args.intent, steps);
2043
2022
  plan = {
2044
2023
  ...plan,
@@ -2258,11 +2237,32 @@ ${tail}` };
2258
2237
  "",
2259
2238
  "When the step is complete, finish with a concise recap of what changed and what remains."
2260
2239
  ].join("\n");
2261
- const outcome = await handleCesarBrain(prompt, stepDispatch, ctx, []);
2240
+ let outcome = await handleCesarBrain(prompt, stepDispatch, ctx, []);
2241
+ let retryOutputStart = captured.length;
2242
+ if (outcome.awaitingUserInput && !signal?.aborted) {
2243
+ stepDispatch({ type: "warning", message: "Cesar stalled awaiting input on a pre-approved step \u2014 forcing one retry." });
2244
+ const overridePrompt = [
2245
+ "[EXECUTOR OVERRIDE] This plan step is ALREADY APPROVED by the user. Proceed and DO IT NOW.",
2246
+ "Do NOT ask for approval, a greenlight, or confirmation. Do NOT say you are holding or waiting.",
2247
+ "Use the available tools to complete the step. If you are TRULY blocked, end with one concrete question.",
2248
+ `Step ${step.id}: ${task}`
2249
+ ].join("\n");
2250
+ retryOutputStart = captured.length;
2251
+ outcome = await handleCesarBrain(overridePrompt, stepDispatch, ctx, []);
2252
+ }
2262
2253
  const after2 = snapshotTokens();
2263
2254
  if (signal?.aborted || outcome.decisionReason === "aborted") {
2264
2255
  return { result: { status: "failure", actualTokens: after2.tokens - before.tokens, actualCostUsd: after2.cost - before.cost, durationMs: Date.now() - startTime, output: captured.join("\n").trim(), error: "cancelled" } };
2265
2256
  }
2257
+ if (outcome.awaitingUserInput) {
2258
+ const retryLines = captured.slice(retryOutputStart);
2259
+ const ask = (retryLines.length ? retryLines : captured).join("\n").trim().split("\n").filter((l) => l.trim()).slice(-4).join("\n");
2260
+ stepDispatch({ type: "warning", message: `\u23F8 Plan paused \u2014 Cesar is waiting on you before continuing:
2261
+ ${ask}
2262
+
2263
+ Type your answer, then /plan resume to continue (or /cancel).` });
2264
+ return { result: { status: "paused", actualTokens: after2.tokens - before.tokens, actualCostUsd: after2.cost - before.cost, durationMs: Date.now() - startTime, output: captured.join("\n").trim(), error: "Cesar is awaiting your input on this approved step" } };
2265
+ }
2266
2266
  const output = captured.join("\n").trim() || `Cesar completed step ${step.id}.`;
2267
2267
  if (step.verifyCmd) stepDispatch({ type: "info", message: `Verifying step ${step.id}: ${step.verifyCmd}` });
2268
2268
  const verified = await runVerifyGate();
@@ -2680,4 +2680,4 @@ export {
2680
2680
  handleExitPlanMode,
2681
2681
  buildStepExecutors
2682
2682
  };
2683
- //# sourceMappingURL=chunk-46WNYE4R.js.map
2683
+ //# sourceMappingURL=chunk-PUNBDLQO.js.map