@kernlang/agon 0.1.6 → 0.1.7
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/dist/{chunk-XWHC6VAH.js → chunk-45YTXJWJ.js} +1 -1
- package/dist/chunk-45YTXJWJ.js.map +1 -0
- package/dist/{chunk-6IF2AV4Y.js → chunk-6WWOJXG4.js} +104 -47
- package/dist/chunk-6WWOJXG4.js.map +1 -0
- package/dist/{chunk-3PDYVGRS.js → chunk-AONHRJRW.js} +172 -14
- package/dist/chunk-AONHRJRW.js.map +1 -0
- package/dist/{chunk-TMNHJOKU.js → chunk-BPKY4OF2.js} +74 -3
- package/dist/chunk-BPKY4OF2.js.map +1 -0
- package/dist/{chunk-NBV37VMW.js → chunk-I2PMSXJ3.js} +2 -2
- package/dist/chunk-I2PMSXJ3.js.map +1 -0
- package/dist/{chunk-PUNBDLQO.js → chunk-RKXVKX25.js} +42 -8
- package/dist/chunk-RKXVKX25.js.map +1 -0
- package/dist/{chunk-HSPQEDHX.js → chunk-SUT2HDOY.js} +1 -1
- package/dist/chunk-SUT2HDOY.js.map +1 -0
- package/dist/{chunk-7WZ2O5WZ.js → chunk-WDT5NJOA.js} +4 -4
- package/dist/chunk-WDT5NJOA.js.map +1 -0
- package/dist/{dispatch-S3CR5HKX.js → dispatch-J4RSWLXM.js} +2 -2
- package/dist/dispatch-J4RSWLXM.js.map +1 -0
- package/dist/{forge-GUOEJ5DJ.js → forge-O2SJ5JIQ.js} +6 -6
- package/dist/forge-O2SJ5JIQ.js.map +1 -0
- package/dist/index.js +385 -53
- package/dist/index.js.map +1 -1
- package/dist/mcp/engines/agy.json +43 -0
- package/dist/mcp/engines/aider.json +40 -0
- package/dist/mcp/engines/claude.json +79 -0
- package/dist/mcp/engines/codex.json +77 -0
- package/dist/mcp/engines/minimax-coding-plan-minimax-m3.json +27 -0
- package/dist/mcp/engines/mistral.json +44 -0
- package/dist/mcp/engines/ollama.json +35 -0
- package/dist/mcp/engines/opencode.json +55 -0
- package/dist/mcp/engines/openrouter.json +54 -0
- package/dist/mcp/engines/qwen.json +40 -0
- package/dist/mcp/index.js +464 -0
- package/dist/mcp/index.js.map +1 -0
- package/dist/plan-mode-PFLUPGSY.js +17 -0
- package/dist/plan-mode-PFLUPGSY.js.map +1 -0
- package/dist/{src-3NWTITZM.js → src-253BUXEF.js} +5 -3
- package/dist/src-253BUXEF.js.map +1 -0
- package/dist/{update-H3LE4ZSI.js → update-ODAAXWOD.js} +6 -6
- package/dist/update-ODAAXWOD.js.map +1 -0
- package/package.json +2 -3
- package/dist/chunk-3PDYVGRS.js.map +0 -1
- package/dist/chunk-6IF2AV4Y.js.map +0 -1
- package/dist/chunk-7WZ2O5WZ.js.map +0 -1
- package/dist/chunk-HSPQEDHX.js.map +0 -1
- package/dist/chunk-NBV37VMW.js.map +0 -1
- package/dist/chunk-PUNBDLQO.js.map +0 -1
- package/dist/chunk-TMNHJOKU.js.map +0 -1
- package/dist/chunk-XWHC6VAH.js.map +0 -1
- package/dist/dispatch-S3CR5HKX.js.map +0 -1
- package/dist/forge-GUOEJ5DJ.js.map +0 -1
- package/dist/plan-mode-35BONR7S.js +0 -17
- package/dist/plan-mode-35BONR7S.js.map +0 -1
- package/dist/src-3NWTITZM.js.map +0 -1
- package/dist/update-H3LE4ZSI.js.map +0 -1
package/dist/index.js
CHANGED
|
@@ -26,7 +26,7 @@ import {
|
|
|
26
26
|
parseProseToRichLines,
|
|
27
27
|
saveDismissedVersion,
|
|
28
28
|
updateCommand
|
|
29
|
-
} from "./chunk-
|
|
29
|
+
} from "./chunk-6WWOJXG4.js";
|
|
30
30
|
import {
|
|
31
31
|
buildAgentApprovalCallback,
|
|
32
32
|
buildConsensus,
|
|
@@ -38,10 +38,10 @@ import {
|
|
|
38
38
|
runAgentTeam,
|
|
39
39
|
runReviewCore,
|
|
40
40
|
selectReviewEngine
|
|
41
|
-
} from "./chunk-
|
|
41
|
+
} from "./chunk-RKXVKX25.js";
|
|
42
42
|
import {
|
|
43
43
|
parsePatchPreview
|
|
44
|
-
} from "./chunk-
|
|
44
|
+
} from "./chunk-SUT2HDOY.js";
|
|
45
45
|
import {
|
|
46
46
|
buildCheckpoint,
|
|
47
47
|
createScoreboard,
|
|
@@ -54,7 +54,7 @@ import {
|
|
|
54
54
|
renderScoreboard,
|
|
55
55
|
scoreboardFailEngine,
|
|
56
56
|
scoreboardFinishEngine
|
|
57
|
-
} from "./chunk-
|
|
57
|
+
} from "./chunk-WDT5NJOA.js";
|
|
58
58
|
import {
|
|
59
59
|
buildCesarSystemPrompt,
|
|
60
60
|
buildOracleCheatPrompt,
|
|
@@ -65,8 +65,11 @@ import {
|
|
|
65
65
|
codeBlockBuffer,
|
|
66
66
|
deriveRoutingHints,
|
|
67
67
|
filterDefaultOrchestrationEngines,
|
|
68
|
+
foldNarrationLines,
|
|
68
69
|
formatCesarReliabilityLine,
|
|
69
70
|
formatModeRationale,
|
|
71
|
+
getFoldedRaw,
|
|
72
|
+
getFoldedRawCount,
|
|
70
73
|
goalDir,
|
|
71
74
|
handleCesarBrain,
|
|
72
75
|
handleOutputEvent,
|
|
@@ -105,7 +108,7 @@ import {
|
|
|
105
108
|
synthesisRoutingAdvice,
|
|
106
109
|
todosFromPlanSteps,
|
|
107
110
|
yieldToInk
|
|
108
|
-
} from "./chunk-
|
|
111
|
+
} from "./chunk-AONHRJRW.js";
|
|
109
112
|
import {
|
|
110
113
|
ENGINE_COLORS,
|
|
111
114
|
bold,
|
|
@@ -127,7 +130,7 @@ import {
|
|
|
127
130
|
truncateCodeLine,
|
|
128
131
|
warn,
|
|
129
132
|
yellow
|
|
130
|
-
} from "./chunk-
|
|
133
|
+
} from "./chunk-I2PMSXJ3.js";
|
|
131
134
|
import {
|
|
132
135
|
AGON_HOME,
|
|
133
136
|
CommandRegistry,
|
|
@@ -275,14 +278,16 @@ import {
|
|
|
275
278
|
undoPatch,
|
|
276
279
|
updateChatSummary,
|
|
277
280
|
worktreeCreate,
|
|
281
|
+
worktreePruneAll,
|
|
282
|
+
worktreePruneOrphaned,
|
|
278
283
|
worktreeRemoveBestEffort,
|
|
279
284
|
writeProvenanceReport,
|
|
280
285
|
writeRunStatus
|
|
281
|
-
} from "./chunk-
|
|
286
|
+
} from "./chunk-BPKY4OF2.js";
|
|
282
287
|
import {
|
|
283
288
|
apiDispatch,
|
|
284
289
|
apiStreamDispatch
|
|
285
|
-
} from "./chunk-
|
|
290
|
+
} from "./chunk-45YTXJWJ.js";
|
|
286
291
|
|
|
287
292
|
// src/index.ts
|
|
288
293
|
import { defineCommand as defineCommand31, runMain } from "citty";
|
|
@@ -488,8 +493,8 @@ function buildCommand(engine, mode, prompt2, cwd, timeout, binaryPath, images) {
|
|
|
488
493
|
}
|
|
489
494
|
return { command: binaryPath, args };
|
|
490
495
|
}
|
|
491
|
-
function stripStreamJson(
|
|
492
|
-
const lines =
|
|
496
|
+
function stripStreamJson(stdout2) {
|
|
497
|
+
const lines = stdout2.split("\n");
|
|
493
498
|
const textParts = [];
|
|
494
499
|
for (const line of lines) {
|
|
495
500
|
const trimmed = line.trim();
|
|
@@ -4359,6 +4364,7 @@ var reviewCommand = defineCommand18({
|
|
|
4359
4364
|
const concurrencyNote = requested.length > 1 ? maxParallel >= requested.length ? "all in parallel" : `${maxParallel} at a time` : "single engine";
|
|
4360
4365
|
if (!quiet) {
|
|
4361
4366
|
header(`Review: ${target.label}`);
|
|
4367
|
+
info(`Repo: ${cwd}`);
|
|
4362
4368
|
info(`Engines: ${requested.join(", ")} (${concurrencyNote})`);
|
|
4363
4369
|
info(`Per-engine timeout: ${timeoutSec}s (auto-cancel, others unaffected)`);
|
|
4364
4370
|
}
|
|
@@ -4399,7 +4405,7 @@ var reviewCommand = defineCommand18({
|
|
|
4399
4405
|
${body.join("\n")}`);
|
|
4400
4406
|
};
|
|
4401
4407
|
try {
|
|
4402
|
-
const result = await runReviewCore(target.diff, target.label, engineId, ctx, controller.signal);
|
|
4408
|
+
const result = await runReviewCore(target.diff, target.label, engineId, ctx, controller.signal, void 0, cwd);
|
|
4403
4409
|
const rawResponse = result.response ?? "";
|
|
4404
4410
|
writeOutput(rawResponse);
|
|
4405
4411
|
if (timedOut) {
|
|
@@ -5859,6 +5865,10 @@ judge ${judge} errored (${e instanceof Error ? e.message : String(e)}); ${consen
|
|
|
5859
5865
|
}
|
|
5860
5866
|
} finally {
|
|
5861
5867
|
process.removeListener("SIGINT", onSig);
|
|
5868
|
+
try {
|
|
5869
|
+
worktreePruneOrphaned(repoRoot2);
|
|
5870
|
+
} catch (e) {
|
|
5871
|
+
}
|
|
5862
5872
|
}
|
|
5863
5873
|
}
|
|
5864
5874
|
});
|
|
@@ -7019,9 +7029,20 @@ var worktreeCommand = defineCommand29({
|
|
|
7019
7029
|
if (removed.length === 0) {
|
|
7020
7030
|
info(`No session worktrees older than ${olderThan} (dirty worktrees are skipped unless --force).`);
|
|
7021
7031
|
} else if (dryRun) {
|
|
7022
|
-
info(`Would prune ${removed.length}: ${removed.join(", ")}`);
|
|
7032
|
+
info(`Would prune ${removed.length} session worktree(s): ${removed.join(", ")}`);
|
|
7023
7033
|
} else {
|
|
7024
|
-
success(`Pruned ${removed.length}: ${removed.join(", ")}`);
|
|
7034
|
+
success(`Pruned ${removed.length} session worktree(s): ${removed.join(", ")}`);
|
|
7035
|
+
}
|
|
7036
|
+
if (!dryRun) {
|
|
7037
|
+
try {
|
|
7038
|
+
worktreePruneAll(root, ms);
|
|
7039
|
+
worktreePruneOrphaned(root);
|
|
7040
|
+
success(`Pruned stale agent/competition worktrees and cleaned up registry.`);
|
|
7041
|
+
} catch (e) {
|
|
7042
|
+
warn(`Failed to prune agent/competition worktrees: ${e instanceof Error ? e.message : String(e)}`);
|
|
7043
|
+
}
|
|
7044
|
+
} else {
|
|
7045
|
+
info(`Would prune stale agent/competition worktrees older than ${olderThan}`);
|
|
7025
7046
|
}
|
|
7026
7047
|
break;
|
|
7027
7048
|
}
|
|
@@ -7165,7 +7186,7 @@ import { Box as Box9, Static, Text as Text9, render } from "ink";
|
|
|
7165
7186
|
import { ScrollBox, AlternateScreen } from "@kernlang/terminal/runtime";
|
|
7166
7187
|
|
|
7167
7188
|
// src/generated/signals/intent.ts
|
|
7168
|
-
var SLASH_COMMANDS = [{ cmd: "/forge", desc: "<task> test with <cmd> [--hardened] \u2014 competitive code generation" }, { cmd: "/brainstorm", desc: "<question> \u2014 confidence-bidding answers" }, { cmd: "/tribunal", desc: "[mode] <question> \u2014 debate (adversarial|socratic|red-team|steelman|synthesis|postmortem)" }, { cmd: "/campfire", desc: "<topic> \u2014 think together, no competition" }, { cmd: "/think", desc: "<problem> [--strategy reflexion] [--steps 8] \u2014 sequential thinking, one engine" }, { cmd: "/council", desc: "<decision> \u2014 roundtable: every engine a role, top-rated chairs" }, { cmd: "/synthesis", desc: "<task> [--swaps 2] \u2014 engines draft, swap, improve; judge picks winner" }, { cmd: "/workspace", desc: "add|remove|list|switch \u2014 manage project repos" }, { cmd: "/ws", desc: " \u2014 list workspaces (shortcut)" }, { cmd: "/cesar", desc: "<engine> \u2014 set Cesar brain engine (e.g. /cesar codex)" }, { cmd: "/models", desc: " \u2014 browse & add provider models + CLI models" }, { cmd: "/tokens", desc: " \u2014 show token usage & costs" }, { cmd: "/engines", desc: " \u2014 select active engines" }, { cmd: "/leaderboard", desc: " \u2014 Glicko rankings" }, { cmd: "/cesar-report", desc: " \u2014 Cesar routing calibration report" }, { cmd: "/cesar-hints", desc: "<task> \u2014 inspect Cesar routing hints for a prompt" }, { cmd: "/history", desc: "[id] \u2014 past forge runs" }, { cmd: "/config", desc: "[list|get|set] \u2014 settings" }, { cmd: "/plan", desc: "<task> or no args \u2014 plan mode or show plan" }, { cmd: "/auto", desc: "[on|off|toggle|status] or <task> \u2014 autonomous mode control" }, { cmd: "/plans", desc: " \u2014 list recent plans" }, { cmd: "/approve", desc: " \u2014 approve current plan" }, { cmd: "/retry", desc: " \u2014 retry failed plan step" }, { cmd: "/cancel", desc: " \u2014 cancel current plan" }, { cmd: "/apply", desc: "[path] [--force] \u2014 apply winning forge patch" }, { cmd: "/cp", desc: "[N] \u2014 copy code block N to clipboard" }, { cmd: "/img", desc: "<path> \u2014 attach image to next prompt" }, { cmd: "/flow", desc: " \u2014 log this session" }, { cmd: "/flows", desc: " \u2014 flow analytics dashboard" }, { cmd: "/chats", desc: "[id|resume <id>] \u2014 chat history or resume session" }, { cmd: "/build", desc: "<task> \u2014 agent builds in cwd (reads/edits/tests)" }, { cmd: "/goal", desc: '<intent> --queue <dir> --gate "<cmd>" [--push] \u2014 autonomous queue: build\u2192review(all)\u2192judge\u2192fix\u2192commit\u2192push per task (background job)' }, { cmd: "/conquer", desc: '<task> --gate "<cmd>" [--builder X] [-e a,b] \u2014 supervised-autonomous build: Cesar drives a builder CLI, convenes nero/tribunal/council on forks, stops at a human merge gate (background job)' }, { cmd: "/agent", desc: "<task> \u2014 autonomous agent loop (solo or shadow, auto-routed)" }, { cmd: "/agent-solo", desc: "<task> \u2014 force solo agent mode, no shadow worker" }, { cmd: "/speculate", desc: "<task> \u2014 parallel speculation: N engines race in worktrees, winner applied" }, { cmd: "/team-forge", desc: "[2v2|3v3] <task> test with <cmd> \u2014 team code competition" }, { cmd: "/team-tribunal", desc: "[2v2|3v3] [mode] <question> \u2014 team debate" }, { cmd: "/team-brainstorm", desc: "[2v2|3v3] <question> \u2014 team ideation" }, { cmd: "/pipeline", desc: "<task> [test with <cmd>] \u2014 build\u2192review\u2192fix loop" }, { cmd: "/review", desc: "[with <engine>] [<target>] \u2014 code review (uncommitted|branch:NAME|commit:SHA)" }, { cmd: "/provider", desc: "add|remove|list|key \u2014 providers & keys (key set/clear/list)" }, { cmd: "/run", desc: "<cmd> \u2014 run shell command inline" }, { cmd: "/commit", desc: "[message] \u2014 stage & commit with auto-generated message" }, { cmd: "/status", desc: " \u2014 live engine telemetry snapshot" }, { cmd: "/doctor", desc: "[engines|harness] \u2014 diagnose engines, worktree, or Cesar harness" }, { cmd: "/harness-replay", desc: "[turnId] \u2014 replay Cesar tool timeline + approval ledger" }, { cmd: "/undo", desc: " \u2014 revert last patch or Cesar checkpoint" }, { cmd: "/checkpoints", desc: " \u2014 list recent file checkpoints" }, { cmd: "/jobs", desc: " \u2014 list running/completed jobs" }, { cmd: "/focus", desc: "<id> \u2014 switch to background job output" }, { cmd: "/explore", desc: " \u2014 toggle exploration mode (read-only)" }, { cmd: "/nero", desc: "[<decision>] \u2014 toggle Nero mode, or challenge a decision (top-rated critic)" }, { cmd: "/btw", desc: "<question> \u2014 ask something while engines work (side-channel)" }, { cmd: "/compact", desc: " \u2014 shrink Cesar context without clearing transcript" }, { cmd: "/mcp", desc: "connect <name|url> | disconnect <name> | list \u2014 manage session MCP servers" }, { cmd: "/init", desc: " \u2014 create AGON.md config wizard" }, { cmd: "/create-skill", desc: "<name> \u2014 scaffold a new skill (.agon/skills/)" }, { cmd: "/clear", desc: " \u2014 reset session (saves chat, clears brain)" }, { cmd: "/clean", desc: " \u2014 alias for /clear" }, { cmd: "/extensions", desc: " \u2014 list installed extensions" }, { cmd: "/help", desc: " \u2014 show this help" }, { cmd: "/exit", desc: " \u2014 quit" }];
|
|
7189
|
+
var SLASH_COMMANDS = [{ cmd: "/forge", desc: "<task> test with <cmd> [--hardened] \u2014 competitive code generation" }, { cmd: "/brainstorm", desc: "<question> \u2014 confidence-bidding answers" }, { cmd: "/tribunal", desc: "[mode] <question> \u2014 debate (adversarial|socratic|red-team|steelman|synthesis|postmortem)" }, { cmd: "/campfire", desc: "<topic> \u2014 think together, no competition" }, { cmd: "/think", desc: "<problem> [--strategy reflexion] [--steps 8] \u2014 sequential thinking, one engine" }, { cmd: "/council", desc: "<decision> \u2014 roundtable: every engine a role, top-rated chairs" }, { cmd: "/synthesis", desc: "<task> [--swaps 2] \u2014 engines draft, swap, improve; judge picks winner" }, { cmd: "/workspace", desc: "add|remove|list|switch \u2014 manage project repos" }, { cmd: "/ws", desc: " \u2014 list workspaces (shortcut)" }, { cmd: "/cesar", desc: "<engine> \u2014 set Cesar brain engine (e.g. /cesar codex)" }, { cmd: "/models", desc: " \u2014 browse & add provider models + CLI models" }, { cmd: "/tokens", desc: " \u2014 show token usage & costs" }, { cmd: "/raw", desc: " \u2014 reprint last folded engine output (unfolded)" }, { cmd: "/engines", desc: " \u2014 select active engines" }, { cmd: "/leaderboard", desc: " \u2014 Glicko rankings" }, { cmd: "/cesar-report", desc: " \u2014 Cesar routing calibration report" }, { cmd: "/cesar-hints", desc: "<task> \u2014 inspect Cesar routing hints for a prompt" }, { cmd: "/history", desc: "[id] \u2014 past forge runs" }, { cmd: "/config", desc: "[list|get|set] \u2014 settings" }, { cmd: "/plan", desc: "<task> or no args \u2014 plan mode or show plan" }, { cmd: "/auto", desc: "[on|off|toggle|status] or <task> \u2014 autonomous mode control" }, { cmd: "/plans", desc: " \u2014 list recent plans" }, { cmd: "/approve", desc: " \u2014 approve current plan" }, { cmd: "/retry", desc: " \u2014 retry failed plan step" }, { cmd: "/cancel", desc: " \u2014 cancel current plan" }, { cmd: "/apply", desc: "[path] [--force] \u2014 apply winning forge patch" }, { cmd: "/cp", desc: "[N] \u2014 copy code block N to clipboard" }, { cmd: "/img", desc: "<path> \u2014 attach image to next prompt" }, { cmd: "/flow", desc: " \u2014 log this session" }, { cmd: "/flows", desc: " \u2014 flow analytics dashboard" }, { cmd: "/chats", desc: "[id|resume <id>] \u2014 chat history or resume session" }, { cmd: "/build", desc: "<task> \u2014 agent builds in cwd (reads/edits/tests)" }, { cmd: "/goal", desc: '<intent> --queue <dir> --gate "<cmd>" [--push] \u2014 autonomous queue: build\u2192review(all)\u2192judge\u2192fix\u2192commit\u2192push per task (background job)' }, { cmd: "/conquer", desc: '<task> --gate "<cmd>" [--builder X] [-e a,b] \u2014 supervised-autonomous build: Cesar drives a builder CLI, convenes nero/tribunal/council on forks, stops at a human merge gate (background job)' }, { cmd: "/agent", desc: "<task> \u2014 autonomous agent loop (solo or shadow, auto-routed)" }, { cmd: "/agent-solo", desc: "<task> \u2014 force solo agent mode, no shadow worker" }, { cmd: "/speculate", desc: "<task> \u2014 parallel speculation: N engines race in worktrees, winner applied" }, { cmd: "/team-forge", desc: "[2v2|3v3] <task> test with <cmd> \u2014 team code competition" }, { cmd: "/team-tribunal", desc: "[2v2|3v3] [mode] <question> \u2014 team debate" }, { cmd: "/team-brainstorm", desc: "[2v2|3v3] <question> \u2014 team ideation" }, { cmd: "/pipeline", desc: "<task> [test with <cmd>] \u2014 build\u2192review\u2192fix loop" }, { cmd: "/review", desc: "[with <engine>] [<target>] \u2014 code review (uncommitted|branch:NAME|commit:SHA)" }, { cmd: "/provider", desc: "add|remove|list|key \u2014 providers & keys (key set/clear/list)" }, { cmd: "/run", desc: "<cmd> \u2014 run shell command inline" }, { cmd: "/commit", desc: "[message] \u2014 stage & commit with auto-generated message" }, { cmd: "/status", desc: " \u2014 live engine telemetry snapshot" }, { cmd: "/doctor", desc: "[engines|harness] \u2014 diagnose engines, worktree, or Cesar harness" }, { cmd: "/harness-replay", desc: "[turnId] \u2014 replay Cesar tool timeline + approval ledger" }, { cmd: "/undo", desc: " \u2014 revert last patch or Cesar checkpoint" }, { cmd: "/checkpoints", desc: " \u2014 list recent file checkpoints" }, { cmd: "/jobs", desc: " \u2014 list running/completed jobs" }, { cmd: "/focus", desc: "<id> \u2014 switch to background job output" }, { cmd: "/explore", desc: " \u2014 toggle exploration mode (read-only)" }, { cmd: "/nero", desc: "[<decision>] \u2014 toggle Nero mode, or challenge a decision (top-rated critic)" }, { cmd: "/btw", desc: "<question> \u2014 ask something while engines work (side-channel)" }, { cmd: "/compact", desc: " \u2014 shrink Cesar context without clearing transcript" }, { cmd: "/mcp", desc: "connect <name|url> | disconnect <name> | list \u2014 manage session MCP servers" }, { cmd: "/init", desc: " \u2014 create AGON.md config wizard" }, { cmd: "/create-skill", desc: "<name> \u2014 scaffold a new skill (.agon/skills/)" }, { cmd: "/clear", desc: " \u2014 reset session (saves chat, clears brain)" }, { cmd: "/clean", desc: " \u2014 alias for /clear" }, { cmd: "/extensions", desc: " \u2014 list installed extensions" }, { cmd: "/help", desc: " \u2014 show this help" }, { cmd: "/exit", desc: " \u2014 quit" }];
|
|
7169
7190
|
var FITNESS_PATTERN = /\b(?:test with|test:|--test|fitness:)\s+(.+)/i;
|
|
7170
7191
|
var LEADERBOARD_KEYWORDS = /\b(leaderboard|elo|rankings?)\b/i;
|
|
7171
7192
|
var HISTORY_KEYWORDS = /\b(history|last runs?|recent)\b/i;
|
|
@@ -7180,6 +7201,7 @@ var CODE_ARTIFACT_PATTERN = /(?:at \w+.*:\d+|\.[tj]sx?\b|\.[a-z]{2,4}:\d+|^[+-]{
|
|
|
7180
7201
|
var AGENT_TRIGGER_PATTERN = /^(?:agent(?:\s+mode)?|autonomous(?:\s+agent)?|run\s+agent)\s+([\s\S]+)$/i;
|
|
7181
7202
|
var AUTOCREDIT_OFF_KEYWORDS = /\b(?:schalt(?:e|)?\s+(?:das|es|autoCredit)\s+ab|mach(?:e|)?\s+(?:das|es|autoCredit)\s+(?:aus|weg)|das\s+nervt|(?:autoCredit|co[\s-]?authored?|contributor)\s+(?:aus|ab|weg|nervt))\b/i;
|
|
7182
7203
|
var AUTOCREDIT_ON_KEYWORDS = /\b(?:schalt(?:e|)?\s+(?:das|es|autoCredit)\s+an|mach(?:e|)?\s+(?:das|es|autoCredit)\s+an|(?:autoCredit|co[\s-]?authored?|contributor)\s+an)\b/i;
|
|
7204
|
+
var KNOWN_COLLAB_ENGINE_IDS = /* @__PURE__ */ new Set(["claude", "codex", "agy", "antigravity", "qwen", "kimi", "opencode", "open-code", "minimax", "zai", "aider", "cursor", "gpt", "openai"]);
|
|
7183
7205
|
function classifyTask(input) {
|
|
7184
7206
|
if (QUESTION_PATTERN.test(input)) {
|
|
7185
7207
|
return "question";
|
|
@@ -7212,6 +7234,62 @@ function parseAgentShortcut(input) {
|
|
|
7212
7234
|
}
|
|
7213
7235
|
return { type: "agent", input: task };
|
|
7214
7236
|
}
|
|
7237
|
+
function normalizeEngineToken(part) {
|
|
7238
|
+
const cleaned = part.trim().toLowerCase().replace(/^@+/, "").replace(/^[^\w-]+|[^\w-]+$/g, "");
|
|
7239
|
+
if (!cleaned) {
|
|
7240
|
+
return null;
|
|
7241
|
+
}
|
|
7242
|
+
if (cleaned === "antigravity") {
|
|
7243
|
+
return "agy";
|
|
7244
|
+
}
|
|
7245
|
+
if (KNOWN_COLLAB_ENGINE_IDS.has(cleaned)) {
|
|
7246
|
+
return cleaned;
|
|
7247
|
+
}
|
|
7248
|
+
if (/^(?:claude|codex|agy|antigravity|qwen|kimi|opencode|open-code|minimax|zai|aider|cursor|gpt|openai)[\w.-]*$/i.test(cleaned)) {
|
|
7249
|
+
return cleaned;
|
|
7250
|
+
}
|
|
7251
|
+
return null;
|
|
7252
|
+
}
|
|
7253
|
+
function parseExplicitEngineIds(input) {
|
|
7254
|
+
const engineIds = [];
|
|
7255
|
+
const add = (value) => {
|
|
7256
|
+
if (value && !engineIds.includes(value)) engineIds.push(value);
|
|
7257
|
+
};
|
|
7258
|
+
const collect = (segment) => {
|
|
7259
|
+
segment.split(/(?:,|\s+and\s+|\s+or\s+|\s+plus\s+|\s+with\s+|\s+)/i).map((part) => normalizeEngineToken(part)).forEach(add);
|
|
7260
|
+
};
|
|
7261
|
+
const withMatch = input.match(/\bwith\s+([a-z0-9@_.-]+(?:(?:\s*,\s*|\s+and\s+|\s+or\s+|\s+plus\s+|\s+)[a-z0-9@_.-]+)*)/i);
|
|
7262
|
+
if (withMatch) collect(withMatch[1]);
|
|
7263
|
+
const askMatch = input.match(/\b(?:ask|have|get)\s+([a-z0-9@_.-]+(?:\s*(?:,|and|or|plus)\s*[a-z0-9@_.-]+)*)\s+(?:to\s+)?(?:review|check|audit|look|inspect|compare|weigh|think|debate)\b/i);
|
|
7264
|
+
if (askMatch) collect(askMatch[1]);
|
|
7265
|
+
return engineIds;
|
|
7266
|
+
}
|
|
7267
|
+
function parseSemanticReviewShortcut(input) {
|
|
7268
|
+
const lower = input.toLowerCase();
|
|
7269
|
+
const reviewVerb = /\b(?:review|check|audit|inspect|look\s+over)\b/i.test(input);
|
|
7270
|
+
if (!reviewVerb) {
|
|
7271
|
+
return null;
|
|
7272
|
+
}
|
|
7273
|
+
const hasDelegationShape = /\bwith\s+[a-z0-9@_.-]+/i.test(input) || /\b(?:ask|have|get)\s+[a-z0-9@_.-]+(?:\s*(?:,|and|or|plus)\s*[a-z0-9@_.-]+)*\s+(?:to\s+)?(?:review|check|audit|look|inspect)\b/i.test(input);
|
|
7274
|
+
if (!hasDelegationShape) {
|
|
7275
|
+
return null;
|
|
7276
|
+
}
|
|
7277
|
+
if (/\breview\b[\s\S]*\b(?:fix|address|resolve|apply|patch)\b/i.test(input) || /\b(?:fix|address|resolve|apply|patch)\b[\s\S]*\b(?:review|findings?|issues?)\b/i.test(input)) {
|
|
7278
|
+
return null;
|
|
7279
|
+
}
|
|
7280
|
+
const IMPLEMENTATION_LEAD_RE = /^(?:fix(?:e[sd]|ing)?|add(?:ed|ing|s)?|implement(?:ed|ing|s)?|build(?:ing|s)?|built|creat(?:e[sd]?|ing)|refactor(?:ed|ing|s)?|rewrit(?:e|es|ing|ten)|migrat(?:e[sd]?|ing)|wir(?:e[sd]?|ing)|chang(?:e[sd]?|ing)|updat(?:e[sd]?|ing)|optimi[sz](?:e[sd]?|ing)|remov(?:e[sd]?|ing)|delet(?:e[sd]?|ing)|patch(?:ed|ing|es)?)\b/i;
|
|
7281
|
+
const normalized = input.trim().replace(/^(?:can\s+you\s+|could\s+you\s+|please\s+)?/i, "");
|
|
7282
|
+
if (IMPLEMENTATION_LEAD_RE.test(normalized)) {
|
|
7283
|
+
return null;
|
|
7284
|
+
}
|
|
7285
|
+
const engineIds = parseExplicitEngineIds(input);
|
|
7286
|
+
if (engineIds.length === 0) {
|
|
7287
|
+
return null;
|
|
7288
|
+
}
|
|
7289
|
+
const targetMatch = lower.match(/\b(uncommitted|branch:[\w./-]+|commit:[a-f0-9]{4,40})\b/i);
|
|
7290
|
+
const target = targetMatch ? targetMatch[1] : void 0;
|
|
7291
|
+
return { type: "review", engineId: engineIds[0], engineIds, target };
|
|
7292
|
+
}
|
|
7215
7293
|
function parseSemanticDelegationShortcut(input) {
|
|
7216
7294
|
return null;
|
|
7217
7295
|
}
|
|
@@ -7456,6 +7534,10 @@ function parseSlashCommand(input, commandRegistry) {
|
|
|
7456
7534
|
case "usage":
|
|
7457
7535
|
case "cost":
|
|
7458
7536
|
return { type: "tokens" };
|
|
7537
|
+
case "raw": {
|
|
7538
|
+
const rawN = parseInt(rest.trim(), 10);
|
|
7539
|
+
return { type: "raw", index: Number.isFinite(rawN) && rawN > 0 ? rawN : void 0 };
|
|
7540
|
+
}
|
|
7459
7541
|
case "doctor":
|
|
7460
7542
|
return { type: "doctor", scope: rest || "engines" };
|
|
7461
7543
|
case "harness-replay":
|
|
@@ -7655,6 +7737,10 @@ function detectIntent(raw, commandRegistry) {
|
|
|
7655
7737
|
if (delegationShortcut) {
|
|
7656
7738
|
return delegationShortcut;
|
|
7657
7739
|
}
|
|
7740
|
+
const reviewShortcut = parseSemanticReviewShortcut(input);
|
|
7741
|
+
if (reviewShortcut) {
|
|
7742
|
+
return reviewShortcut;
|
|
7743
|
+
}
|
|
7658
7744
|
if (AUTOCREDIT_OFF_KEYWORDS.test(input)) {
|
|
7659
7745
|
return { type: "toggleAutoCredit", autoCredit: false, input };
|
|
7660
7746
|
}
|
|
@@ -9714,6 +9800,21 @@ function handleCesar(engineId, dispatch, ctx) {
|
|
|
9714
9800
|
dispatch({ type: "success", message: `Cesar brain set to: ${id} (backend: ${backend})` });
|
|
9715
9801
|
dispatch({ type: "info", message: "Conversation context + memory preserved. Forge/tribunal engines unchanged \u2014 use /use to change those." });
|
|
9716
9802
|
}
|
|
9803
|
+
function handleRaw(dispatch, index) {
|
|
9804
|
+
const count = getFoldedRawCount();
|
|
9805
|
+
if (count === 0) {
|
|
9806
|
+
dispatch({ type: "info", message: "Nothing folded yet \u2014 /raw reprints the full text of a recently folded engine block." });
|
|
9807
|
+
return;
|
|
9808
|
+
}
|
|
9809
|
+
const n = index && index > 0 ? Math.floor(index) : 1;
|
|
9810
|
+
const raw = getFoldedRaw(n) ?? "";
|
|
9811
|
+
if (!raw.trim()) {
|
|
9812
|
+
dispatch({ type: "info", message: `No folded block #${n} \u2014 ${count} recent fold${count === 1 ? "" : "s"} kept (try /raw 1..${count}).` });
|
|
9813
|
+
return;
|
|
9814
|
+
}
|
|
9815
|
+
dispatch({ type: "header", title: count > 1 ? `Raw engine output (unfolded) \u2014 ${n} of ${count} recent` : "Raw engine output (unfolded)" });
|
|
9816
|
+
dispatch({ type: "engine-block", engineId: "raw", color: 244, content: raw, foldedSteps: 0 });
|
|
9817
|
+
}
|
|
9717
9818
|
function handleTokens(dispatch) {
|
|
9718
9819
|
const stats = tracker.getStats();
|
|
9719
9820
|
dispatch({ type: "header", title: "Token Usage \u2014 This Session" });
|
|
@@ -9882,7 +9983,7 @@ async function handlePlanShow(dispatch, ctx, planId) {
|
|
|
9882
9983
|
savePlan(approved);
|
|
9883
9984
|
dispatch({ type: "success", message: "Plan approved." });
|
|
9884
9985
|
if (approved.action.type === "forge") {
|
|
9885
|
-
const { handleForge: handleForge2 } = await import("./forge-
|
|
9986
|
+
const { handleForge: handleForge2 } = await import("./forge-O2SJ5JIQ.js");
|
|
9886
9987
|
await handleForge2(approved.action.task, approved.action.fitnessCmd ?? null, dispatch, ctx, approved, approved.action.hardened);
|
|
9887
9988
|
} else {
|
|
9888
9989
|
dispatch({ type: "info", message: "Run the build again to execute." });
|
|
@@ -9908,7 +10009,7 @@ async function handleApprove(dispatch, ctx) {
|
|
|
9908
10009
|
savePlan(plan);
|
|
9909
10010
|
dispatch({ type: "success", message: "Plan approved." });
|
|
9910
10011
|
if (plan.action.type === "forge") {
|
|
9911
|
-
const { handleForge: handleForge2 } = await import("./forge-
|
|
10012
|
+
const { handleForge: handleForge2 } = await import("./forge-O2SJ5JIQ.js");
|
|
9912
10013
|
await handleForge2(plan.action.task, plan.action.fitnessCmd ?? null, dispatch, ctx, plan, plan.action.hardened);
|
|
9913
10014
|
} else {
|
|
9914
10015
|
dispatch({ type: "info", message: "Run the build again to execute." });
|
|
@@ -9936,7 +10037,7 @@ async function handleRetry(dispatch, ctx) {
|
|
|
9936
10037
|
plan = startPlan(plan);
|
|
9937
10038
|
ctx.setCurrentPlan(plan);
|
|
9938
10039
|
savePlan(plan);
|
|
9939
|
-
const { handleForge: handleForge2 } = await import("./forge-
|
|
10040
|
+
const { handleForge: handleForge2 } = await import("./forge-O2SJ5JIQ.js");
|
|
9940
10041
|
await handleForge2(plan.action.task, plan.action.fitnessCmd ?? null, dispatch, ctx, plan, plan.action.hardened);
|
|
9941
10042
|
} else {
|
|
9942
10043
|
dispatch({ type: "info", message: "Plan reset to approved. Run the build again to execute." });
|
|
@@ -10679,7 +10780,7 @@ ${diffStat}
|
|
|
10679
10780
|
return;
|
|
10680
10781
|
}
|
|
10681
10782
|
for (const f of modifiedFiles) {
|
|
10682
|
-
|
|
10783
|
+
execFileSync2("git", ["add", f], { cwd, encoding: "utf-8", timeout: 1e4, stdio: ["ignore", "pipe", "pipe"] });
|
|
10683
10784
|
}
|
|
10684
10785
|
dispatch({ type: "success", message: `Staged ${modifiedFiles.length} file(s)` });
|
|
10685
10786
|
}
|
|
@@ -12909,7 +13010,7 @@ async function runCesarBrainFallback(input, cb, crashDel, priorDeterministic) {
|
|
|
12909
13010
|
const cesarEngine = cesarEngineDef ?? cb.ctx.registry.get(cesarId);
|
|
12910
13011
|
const { join: join47 } = await import("path");
|
|
12911
13012
|
const { mkdirSync: mkdirSync30 } = await import("fs");
|
|
12912
|
-
const { resolveWorkingDir: resolveWorkingDir3, RUNS_DIR: RUNS_DIR3, appendMessage: appendMessage3 } = await import("./src-
|
|
13013
|
+
const { resolveWorkingDir: resolveWorkingDir3, RUNS_DIR: RUNS_DIR3, appendMessage: appendMessage3 } = await import("./src-253BUXEF.js");
|
|
12913
13014
|
const outDir = join47(RUNS_DIR3, `cesar-fallback-${Date.now()}`);
|
|
12914
13015
|
mkdirSync30(outDir, { recursive: true });
|
|
12915
13016
|
if (!_silentMode) cb.dispatch({ type: "warning", message: formatCesarRecoveryStatus("retry", cesarId, `log: ${outDir}`) });
|
|
@@ -13090,18 +13191,19 @@ ${historyContext}
|
|
|
13090
13191
|
` : ""}## USER MESSAGE
|
|
13091
13192
|
${input}`;
|
|
13092
13193
|
try {
|
|
13093
|
-
const { resolveWorkingDir: resolveWorkingDir3, RUNS_DIR: RUNS_DIR3, appendMessage: appendMessage3 } = await import("./src-
|
|
13194
|
+
const { resolveWorkingDir: resolveWorkingDir3, RUNS_DIR: RUNS_DIR3, appendMessage: appendMessage3 } = await import("./src-253BUXEF.js");
|
|
13094
13195
|
const { join: join47 } = await import("path");
|
|
13095
13196
|
const { mkdirSync: mkdirSync30 } = await import("fs");
|
|
13096
13197
|
const actingEngine = cb.ctx.registry.get(actingCesar);
|
|
13097
13198
|
const outDir = join47(RUNS_DIR3, `acting-cesar-${Date.now()}`);
|
|
13098
13199
|
mkdirSync30(outDir, { recursive: true });
|
|
13099
13200
|
if (!_silentMode) cb.dispatch({ type: "info", message: formatCesarRecoveryStatus("acting", actingCesar, `log: ${outDir}`) });
|
|
13201
|
+
const actingMode = actingEngine?.agent ? "agent" : "exec";
|
|
13100
13202
|
const actingResult = await cb.ctx.adapter.dispatch({
|
|
13101
13203
|
engine: actingEngine,
|
|
13102
13204
|
prompt: actingPrompt,
|
|
13103
13205
|
cwd: resolveWorkingDir3(),
|
|
13104
|
-
mode:
|
|
13206
|
+
mode: actingMode,
|
|
13105
13207
|
timeout: cesarConfig.timeout ?? 120,
|
|
13106
13208
|
outputDir: outDir,
|
|
13107
13209
|
systemPrompt: buildCesarSystemPrompt(cb.ctx)
|
|
@@ -14016,13 +14118,16 @@ async function dispatchSessionInfoIntent(intent, input, cb) {
|
|
|
14016
14118
|
case "tokens":
|
|
14017
14119
|
handleTokens(cb.dispatch);
|
|
14018
14120
|
break;
|
|
14121
|
+
case "raw":
|
|
14122
|
+
handleRaw(cb.dispatch, intent.index);
|
|
14123
|
+
break;
|
|
14019
14124
|
case "models": {
|
|
14020
14125
|
cb.setModelPickerTargetEngine?.(null);
|
|
14021
14126
|
cb.setModelPickerInitialFilter?.("");
|
|
14022
14127
|
cb.setModelPickerTitle?.("Select model");
|
|
14023
14128
|
cb.setModelPickerLoading(true);
|
|
14024
14129
|
cb.setModelPickerOpen(true);
|
|
14025
|
-
import("./src-
|
|
14130
|
+
import("./src-253BUXEF.js").then(({ fetchModelsRegistry: fetchModelsRegistry2, buildModelEntries: buildModelEntries2, buildCliGroupsImmediate, refreshCliGroup, refreshCliGroupVersion }) => {
|
|
14026
14131
|
let cliGroups = buildCliGroupsImmediate();
|
|
14027
14132
|
cb.setModelPickerCliGroups?.(cliGroups);
|
|
14028
14133
|
for (const g of cliGroups) {
|
|
@@ -14080,7 +14185,7 @@ async function dispatchSessionInfoIntent(intent, input, cb) {
|
|
|
14080
14185
|
await handlePlanShow(cb.dispatch, cb.ctx, intent.planId);
|
|
14081
14186
|
break;
|
|
14082
14187
|
case "plan-task": {
|
|
14083
|
-
const { createCesarPlan } = await import("./src-
|
|
14188
|
+
const { createCesarPlan } = await import("./src-253BUXEF.js");
|
|
14084
14189
|
const cesarPlan = createCesarPlan(intent.task, []);
|
|
14085
14190
|
cb.setActivePlan(cesarPlan);
|
|
14086
14191
|
if (!cb.ctx.cesar) {
|
|
@@ -15517,15 +15622,20 @@ function resolveKeyboardInput(ctx) {
|
|
|
15517
15622
|
}
|
|
15518
15623
|
if (hasCtrlSignal && normalizedCtrlInput === "l") return { type: "submit", value: "/clear" };
|
|
15519
15624
|
if (ctx.activePlanState === "awaiting_approval" && ctx.inputValue === "" && !hasCtrlSignal && !key.escape && !key.tab && !ctx.slashPickerOpen && !ctx.enginePickerOpen && !ctx.reviewEventOpen && !ctx.toolDetailOpen && !ctx.questionState) {
|
|
15520
|
-
const pcur = (ctx.planApprovalIndex ?? 0)
|
|
15521
|
-
|
|
15625
|
+
const pcur = Math.max(0, Math.min(2, ctx.planApprovalIndex ?? 0));
|
|
15626
|
+
const next = pcur === 2 ? 0 : pcur + 1;
|
|
15627
|
+
const prev = pcur === 0 ? 2 : pcur - 1;
|
|
15628
|
+
if (key.downArrow) return { type: "movePlanApproval", index: next };
|
|
15629
|
+
if (key.upArrow) return { type: "movePlanApproval", index: prev };
|
|
15522
15630
|
if (key.return || input === "\r" || input === "\n") {
|
|
15523
|
-
|
|
15631
|
+
const action = pcur === 1 ? "revise" : pcur === 2 ? "cancel" : "approve";
|
|
15632
|
+
return { type: "planControl", action };
|
|
15524
15633
|
}
|
|
15525
15634
|
if (typeof input === "string" && input.length === 1) {
|
|
15526
15635
|
const lowered = input.toLowerCase();
|
|
15527
15636
|
if (lowered === "y" || lowered === "1") return { type: "movePlanApproval", index: 0 };
|
|
15528
|
-
if (lowered === "
|
|
15637
|
+
if (lowered === "o" || lowered === "2") return { type: "movePlanApproval", index: 1 };
|
|
15638
|
+
if (lowered === "n" || lowered === "3") return { type: "movePlanApproval", index: 2 };
|
|
15529
15639
|
}
|
|
15530
15640
|
}
|
|
15531
15641
|
if (ctx.fileRailFocused) {
|
|
@@ -18404,8 +18514,98 @@ function ToolDetailBlock({ title, subtitle, accentColor, rows, maxVisibleRows, o
|
|
|
18404
18514
|
] });
|
|
18405
18515
|
}
|
|
18406
18516
|
var StreamingView = React7.memo(function StreamingView2({ streamingText, mode, liveProgress, liveToolStreams, liveToolTailFrozen }) {
|
|
18407
|
-
const toolStreams = Object.values(liveToolStreams ?? {});
|
|
18408
18517
|
const frozenToolOutputRef = useRef3({});
|
|
18518
|
+
const narrationPolicy = useMemo4(() => {
|
|
18519
|
+
try {
|
|
18520
|
+
return String(loadConfig().narrationFold ?? "safe");
|
|
18521
|
+
} catch {
|
|
18522
|
+
return "safe";
|
|
18523
|
+
}
|
|
18524
|
+
}, []);
|
|
18525
|
+
const [renderedText, setRenderedText] = useState4(null);
|
|
18526
|
+
const textRef = useRef3(null);
|
|
18527
|
+
textRef.current = streamingText;
|
|
18528
|
+
useEffect5(() => {
|
|
18529
|
+
if (!streamingText) {
|
|
18530
|
+
setRenderedText(null);
|
|
18531
|
+
return;
|
|
18532
|
+
}
|
|
18533
|
+
let lastHash = "";
|
|
18534
|
+
let frameTimer = null;
|
|
18535
|
+
const updateTick = () => {
|
|
18536
|
+
const current = textRef.current;
|
|
18537
|
+
if (!current) {
|
|
18538
|
+
setRenderedText(null);
|
|
18539
|
+
return;
|
|
18540
|
+
}
|
|
18541
|
+
const content = current.content;
|
|
18542
|
+
const hash = `${current.engineId}:${content.length}:${content.slice(-20)}`;
|
|
18543
|
+
if (hash !== lastHash) {
|
|
18544
|
+
lastHash = hash;
|
|
18545
|
+
if (process.stdout.cork) {
|
|
18546
|
+
process.stdout.cork();
|
|
18547
|
+
}
|
|
18548
|
+
setRenderedText(current);
|
|
18549
|
+
if (process.stdout.uncork) {
|
|
18550
|
+
process.nextTick(() => {
|
|
18551
|
+
process.stdout.uncork();
|
|
18552
|
+
});
|
|
18553
|
+
}
|
|
18554
|
+
}
|
|
18555
|
+
frameTimer = setTimeout(updateTick, 42);
|
|
18556
|
+
};
|
|
18557
|
+
updateTick();
|
|
18558
|
+
return () => {
|
|
18559
|
+
if (frameTimer) {
|
|
18560
|
+
clearTimeout(frameTimer);
|
|
18561
|
+
}
|
|
18562
|
+
};
|
|
18563
|
+
}, [streamingText ? streamingText.engineId : null]);
|
|
18564
|
+
const [renderedToolStreams, setRenderedToolStreams] = useState4({});
|
|
18565
|
+
const toolRef = useRef3({});
|
|
18566
|
+
toolRef.current = liveToolStreams ?? {};
|
|
18567
|
+
useEffect5(() => {
|
|
18568
|
+
if (!liveToolStreams || Object.keys(liveToolStreams).length === 0) {
|
|
18569
|
+
setRenderedToolStreams({});
|
|
18570
|
+
return;
|
|
18571
|
+
}
|
|
18572
|
+
let lastHash = "";
|
|
18573
|
+
let frameTimer = null;
|
|
18574
|
+
const updateTick = () => {
|
|
18575
|
+
const current = toolRef.current;
|
|
18576
|
+
if (!current || Object.keys(current).length === 0) {
|
|
18577
|
+
setRenderedToolStreams({});
|
|
18578
|
+
return;
|
|
18579
|
+
}
|
|
18580
|
+
let hash = "";
|
|
18581
|
+
const keys = Object.keys(current).sort();
|
|
18582
|
+
for (const key of keys) {
|
|
18583
|
+
const entry = current[key];
|
|
18584
|
+
const output = String(entry.output ?? "");
|
|
18585
|
+
hash += `|${key}:${entry.engineId}:${entry.tool}:${output.length}:${output.slice(-20)}`;
|
|
18586
|
+
}
|
|
18587
|
+
if (hash !== lastHash) {
|
|
18588
|
+
lastHash = hash;
|
|
18589
|
+
if (process.stdout.cork) {
|
|
18590
|
+
process.stdout.cork();
|
|
18591
|
+
}
|
|
18592
|
+
setRenderedToolStreams(current);
|
|
18593
|
+
if (process.stdout.uncork) {
|
|
18594
|
+
process.nextTick(() => {
|
|
18595
|
+
process.stdout.uncork();
|
|
18596
|
+
});
|
|
18597
|
+
}
|
|
18598
|
+
}
|
|
18599
|
+
frameTimer = setTimeout(updateTick, 50);
|
|
18600
|
+
};
|
|
18601
|
+
updateTick();
|
|
18602
|
+
return () => {
|
|
18603
|
+
if (frameTimer) {
|
|
18604
|
+
clearTimeout(frameTimer);
|
|
18605
|
+
}
|
|
18606
|
+
};
|
|
18607
|
+
}, [liveToolStreams ? Object.keys(liveToolStreams).join(",") : null]);
|
|
18608
|
+
const toolStreams = Object.values(renderedToolStreams ?? {});
|
|
18409
18609
|
useEffect5(() => {
|
|
18410
18610
|
const activeIds = new Set(Object.keys(liveToolStreams ?? {}));
|
|
18411
18611
|
for (const id of Object.keys(frozenToolOutputRef.current)) {
|
|
@@ -18415,37 +18615,54 @@ var StreamingView = React7.memo(function StreamingView2({ streamingText, mode, l
|
|
|
18415
18615
|
}
|
|
18416
18616
|
}, [liveToolStreams, liveToolTailFrozen]);
|
|
18417
18617
|
return /* @__PURE__ */ jsxs7(Fragment3, { children: [
|
|
18418
|
-
|
|
18419
|
-
const c = engineColor(
|
|
18420
|
-
const rawStream =
|
|
18421
|
-
const
|
|
18422
|
-
const
|
|
18618
|
+
renderedText && (() => {
|
|
18619
|
+
const c = engineColor(renderedText.engineId);
|
|
18620
|
+
const rawStream = renderedText.content;
|
|
18621
|
+
const rawTailLen = 6e3;
|
|
18622
|
+
const slicedStream = rawStream.length > rawTailLen ? rawStream.slice(-rawTailLen) : rawStream;
|
|
18623
|
+
const firstNl = rawStream.length > rawTailLen ? slicedStream.indexOf("\n") : -1;
|
|
18423
18624
|
const windowed = firstNl >= 0 ? slicedStream.slice(firstNl + 1) : slicedStream;
|
|
18424
18625
|
const cleaned = cleanEngineOutput(windowed);
|
|
18425
18626
|
const wrapWidth = contentWidth(mode === "chat" ? 6 : 8);
|
|
18426
18627
|
if (mode === "chat") {
|
|
18427
18628
|
const lines = cleaned.split("\n").filter((line) => line.trim());
|
|
18428
18629
|
const lastLine = lines.length > 0 ? lines[lines.length - 1].trim() : "";
|
|
18429
|
-
const previewLimit = Math.max(24, wrapWidth -
|
|
18630
|
+
const previewLimit = Math.max(24, wrapWidth - renderedText.engineId.length - 6);
|
|
18430
18631
|
const preview = lastLine.length > previewLimit ? lastLine.slice(0, previewLimit - 1) + "\u2026" : lastLine;
|
|
18431
18632
|
return /* @__PURE__ */ jsxs7(Box7, { marginY: 1, paddingLeft: 1, children: [
|
|
18432
18633
|
/* @__PURE__ */ jsxs7(Text7, { color: c, bold: true, children: [
|
|
18433
18634
|
icons().dotOn + " ",
|
|
18434
|
-
|
|
18635
|
+
renderedText.engineId
|
|
18435
18636
|
] }),
|
|
18436
18637
|
/* @__PURE__ */ jsx7(Text7, { dimColor: true, children: preview ? ` ${preview}` : " thinking\u2026" })
|
|
18437
18638
|
] });
|
|
18438
18639
|
}
|
|
18439
18640
|
const allLines = cleaned.split("\n");
|
|
18440
18641
|
const tailLines = allLines.length > 24 ? allLines.slice(-24).join("\n") : cleaned;
|
|
18441
|
-
const
|
|
18642
|
+
const live = foldNarrationLines(tailLines, narrationPolicy);
|
|
18643
|
+
const foldedTail = live.visible;
|
|
18644
|
+
const cleanedPrefix = allLines.length > 24 ? allLines.slice(0, -24).join("\n") + "\n" : "";
|
|
18645
|
+
const contextualized = contextualizeSlicedMarkdown(cleanedPrefix, foldedTail);
|
|
18646
|
+
const segments = parseMarkdownBlocks(contextualized);
|
|
18647
|
+
const stepLimit = Math.max(16, wrapWidth - 14);
|
|
18648
|
+
const stepHint = live.lastStep.length > stepLimit ? live.lastStep.slice(0, stepLimit - 1) + "\u2026" : live.lastStep;
|
|
18442
18649
|
return /* @__PURE__ */ jsxs7(Box7, { flexDirection: "column", marginY: 1, paddingLeft: 2, children: [
|
|
18443
18650
|
/* @__PURE__ */ jsxs7(Text7, { color: c, bold: true, children: [
|
|
18444
18651
|
"\u250C\u2500\u2500 ",
|
|
18445
|
-
|
|
18652
|
+
renderedText.engineId
|
|
18446
18653
|
] }),
|
|
18654
|
+
live.foldedSteps > 0 ? /* @__PURE__ */ jsxs7(Text7, { color: c, children: [
|
|
18655
|
+
"\u2502 ",
|
|
18656
|
+
/* @__PURE__ */ jsxs7(Text7, { dimColor: true, children: [
|
|
18657
|
+
"\u25B8 ",
|
|
18658
|
+
String(live.foldedSteps),
|
|
18659
|
+
" step",
|
|
18660
|
+
live.foldedSteps === 1 ? "" : "s",
|
|
18661
|
+
stepHint ? ` \xB7 ${stepHint}` : ""
|
|
18662
|
+
] })
|
|
18663
|
+
] }) : null,
|
|
18447
18664
|
/* @__PURE__ */ jsx7(Text7, { color: c, children: "\u2502" }),
|
|
18448
|
-
/* @__PURE__ */ jsx7(RenderedSegments, { segments, borderColor: c, wrapWidth })
|
|
18665
|
+
foldedTail.trim() ? /* @__PURE__ */ jsx7(RenderedSegments, { segments, borderColor: c, wrapWidth }) : null
|
|
18449
18666
|
] });
|
|
18450
18667
|
})(),
|
|
18451
18668
|
toolStreams.length > 0 && /* @__PURE__ */ jsx7(Box7, { flexDirection: "column", paddingLeft: mode === "chat" ? 1 : 2, children: toolStreams.map((entry) => {
|
|
@@ -18462,13 +18679,16 @@ var StreamingView = React7.memo(function StreamingView2({ streamingText, mode, l
|
|
|
18462
18679
|
const nonEmptyLines = displayOutput.split("\n").filter((line) => line.trim());
|
|
18463
18680
|
const previewOutput = nonEmptyLines.slice(-2).join(" ");
|
|
18464
18681
|
const preview = previewOutput.length > 96 ? previewOutput.slice(0, 95) + "\u2026" : previewOutput;
|
|
18465
|
-
const
|
|
18466
|
-
const
|
|
18682
|
+
const rawTailLen = 6e3;
|
|
18683
|
+
const rawTail = displayOutput.length > rawTailLen ? displayOutput.slice(-rawTailLen) : displayOutput;
|
|
18684
|
+
const firstNl = displayOutput.length > rawTailLen ? rawTail.indexOf("\n") : -1;
|
|
18467
18685
|
const windowedTail = firstNl >= 0 ? rawTail.slice(firstNl + 1) : rawTail;
|
|
18468
18686
|
const cleanedTail = cleanEngineOutput(windowedTail);
|
|
18469
18687
|
const tailLines = cleanedTail.split("\n");
|
|
18470
18688
|
const boundedTail = tailLines.length > 12 ? tailLines.slice(-12).join("\n") : cleanedTail;
|
|
18471
|
-
const
|
|
18689
|
+
const cleanedPrefix = tailLines.length > 12 ? tailLines.slice(0, -12).join("\n") + "\n" : "";
|
|
18690
|
+
const contextualized = contextualizeSlicedMarkdown(cleanedPrefix, boundedTail);
|
|
18691
|
+
const segments = parseMarkdownBlocks(contextualized);
|
|
18472
18692
|
const wrapWidth = contentWidth(mode === "chat" ? 8 : 10);
|
|
18473
18693
|
return /* @__PURE__ */ jsxs7(Box7, { flexDirection: "column", marginBottom: 1, children: [
|
|
18474
18694
|
/* @__PURE__ */ jsxs7(Text7, { children: [
|
|
@@ -18544,6 +18764,17 @@ function buildPlanChromeSummary(activePlan, activePlanState, planModeQueued, aut
|
|
|
18544
18764
|
const failed = Number(gauge.failed ?? 0);
|
|
18545
18765
|
return { visible: true, label, color: gauge.visible ? gauge.color : "#c084fc", shortId: gauge.shortId ?? "", bar: gauge.bar ?? "", pct: Number(gauge.pct ?? 0), stepLabel: gauge.label ?? "", current: gauge.current ?? "", failed, action };
|
|
18546
18766
|
}
|
|
18767
|
+
function contextualizeSlicedMarkdown(prefix, slicedText) {
|
|
18768
|
+
const parts = prefix.split("```");
|
|
18769
|
+
if (parts.length % 2 === 0) {
|
|
18770
|
+
const lastPart = parts[parts.length - 1];
|
|
18771
|
+
const firstLine = lastPart.split("\n")[0].trim();
|
|
18772
|
+
const lang = /^[a-zA-Z0-9_\-]+$/.test(firstLine) ? firstLine : "";
|
|
18773
|
+
return `\`\`\`${lang}
|
|
18774
|
+
${slicedText}`;
|
|
18775
|
+
}
|
|
18776
|
+
return slicedText;
|
|
18777
|
+
}
|
|
18547
18778
|
|
|
18548
18779
|
// src/generated/blocks/file-rail.tsx
|
|
18549
18780
|
import React8 from "react";
|
|
@@ -18948,6 +19179,27 @@ function formatSessionResults(results) {
|
|
|
18948
19179
|
return sections.join("\n");
|
|
18949
19180
|
}
|
|
18950
19181
|
|
|
19182
|
+
// src/generated/lib/terminal-notify.ts
|
|
19183
|
+
import { stdout } from "process";
|
|
19184
|
+
function bell() {
|
|
19185
|
+
if (!stdout.isTTY) {
|
|
19186
|
+
return;
|
|
19187
|
+
}
|
|
19188
|
+
if (process.env.AGON_NO_BELL) {
|
|
19189
|
+
return;
|
|
19190
|
+
}
|
|
19191
|
+
stdout.write("\x07");
|
|
19192
|
+
}
|
|
19193
|
+
function setWindowTitle(label) {
|
|
19194
|
+
if (!stdout.isTTY) {
|
|
19195
|
+
return;
|
|
19196
|
+
}
|
|
19197
|
+
if (process.env.AGON_NO_TITLE) {
|
|
19198
|
+
return;
|
|
19199
|
+
}
|
|
19200
|
+
stdout.write("\x1B]0;" + label + "\x07");
|
|
19201
|
+
}
|
|
19202
|
+
|
|
18951
19203
|
// src/generated/surfaces/app-composer.ts
|
|
18952
19204
|
import { join as join45 } from "path";
|
|
18953
19205
|
import { readFileSync as readFileSync14, writeFileSync as writeFileSync12 } from "fs";
|
|
@@ -19603,8 +19855,27 @@ function parseMarkdownToRows(baseKey, text, wrapWidth, paddingLeft, borderColor)
|
|
|
19603
19855
|
if (segment.type === "table") {
|
|
19604
19856
|
const headers = segment.headers ?? [];
|
|
19605
19857
|
const tableRows = segment.rows ?? [];
|
|
19606
|
-
const
|
|
19607
|
-
const
|
|
19858
|
+
const alignments = segment.alignments ?? [];
|
|
19859
|
+
const colWidths = headers.map((h, i) => {
|
|
19860
|
+
let max = h.length;
|
|
19861
|
+
for (const row of tableRows) {
|
|
19862
|
+
if (row[i] && row[i].length > max) max = row[i].length;
|
|
19863
|
+
}
|
|
19864
|
+
return max;
|
|
19865
|
+
});
|
|
19866
|
+
const padCell = (text2, colIdx) => {
|
|
19867
|
+
const w = colWidths[colIdx] ?? text2.length;
|
|
19868
|
+
const align = alignments[colIdx] ?? "left";
|
|
19869
|
+
if (align === "right") return text2.padStart(w);
|
|
19870
|
+
if (align === "center") {
|
|
19871
|
+
const pad = w - text2.length;
|
|
19872
|
+
const left = Math.floor(pad / 2);
|
|
19873
|
+
return " ".repeat(left) + text2 + " ".repeat(pad - left);
|
|
19874
|
+
}
|
|
19875
|
+
return text2.padEnd(w);
|
|
19876
|
+
};
|
|
19877
|
+
const headerLine = headers.map((h, i) => padCell(h, i)).join(" \u2502 ");
|
|
19878
|
+
const sepLine = colWidths.map((w) => "\u2500".repeat(w)).join("\u2500\u253C\u2500");
|
|
19608
19879
|
rows.push({
|
|
19609
19880
|
key: `${baseKey}-table-head-${rowIndex++}`,
|
|
19610
19881
|
kind: "segments",
|
|
@@ -19617,15 +19888,16 @@ function parseMarkdownToRows(baseKey, text, wrapWidth, paddingLeft, borderColor)
|
|
|
19617
19888
|
kind: "segments",
|
|
19618
19889
|
paddingLeft,
|
|
19619
19890
|
borderColor,
|
|
19620
|
-
segments: [{ text:
|
|
19891
|
+
segments: [{ text: sepLine, dimColor: true }]
|
|
19621
19892
|
});
|
|
19622
19893
|
tableRows.forEach((tableRow, index) => {
|
|
19894
|
+
const rowLine = tableRow.map((cell, i) => padCell(cell, i)).join(" \u2502 ");
|
|
19623
19895
|
rows.push({
|
|
19624
19896
|
key: `${baseKey}-table-row-${rowIndex++}-${index}`,
|
|
19625
19897
|
kind: "segments",
|
|
19626
19898
|
paddingLeft,
|
|
19627
19899
|
borderColor,
|
|
19628
|
-
segments: [{ text:
|
|
19900
|
+
segments: [{ text: rowLine }]
|
|
19629
19901
|
});
|
|
19630
19902
|
});
|
|
19631
19903
|
}
|
|
@@ -20122,8 +20394,10 @@ function buildTranscriptRows(blocks, mode, toolOutputExpanded, thinkingExpanded)
|
|
|
20122
20394
|
if (!cleaned.trim()) return;
|
|
20123
20395
|
const accentColor = color256toHex(event.color ?? (ENGINE_COLORS[event.engineId] ?? 124));
|
|
20124
20396
|
if (rows.length > 0) pushSpacer(`${baseKey}-gap`);
|
|
20397
|
+
const foldNote = event.foldedSteps && event.foldedSteps > 0 ? `\u25B8 ${event.foldedSteps} reasoning steps folded \xB7 /raw to inspect` : "";
|
|
20125
20398
|
if (mode === "chat") {
|
|
20126
20399
|
pushSegmentsRow(`${baseKey}-chat-head`, 1, [{ text: `${icons().dotOn} ${event.engineId}`, color: accentColor, bold: true }]);
|
|
20400
|
+
if (foldNote) pushSegmentsRow(`${baseKey}-chat-fold`, 1, [{ text: foldNote, dimColor: true }]);
|
|
20127
20401
|
pushSpacer(`${baseKey}-chat-space`);
|
|
20128
20402
|
rows.push(...cachedMarkdownRows(baseKey, cleaned, chatWidth, 1, ""));
|
|
20129
20403
|
return;
|
|
@@ -20132,6 +20406,12 @@ function buildTranscriptRows(blocks, mode, toolOutputExpanded, thinkingExpanded)
|
|
|
20132
20406
|
{ text: "\u250C\u2500\u2500 ", color: accentColor },
|
|
20133
20407
|
{ text: event.engineId, color: accentColor, bold: true }
|
|
20134
20408
|
]);
|
|
20409
|
+
if (foldNote) {
|
|
20410
|
+
pushSegmentsRow(`${baseKey}-engine-fold`, 2, [
|
|
20411
|
+
{ text: "\u2502 ", color: accentColor },
|
|
20412
|
+
{ text: foldNote, dimColor: true }
|
|
20413
|
+
]);
|
|
20414
|
+
}
|
|
20135
20415
|
pushSegmentsRow(`${baseKey}-engine-rule`, 2, [{ text: "\u2502", color: accentColor }]);
|
|
20136
20416
|
rows.push(...cachedMarkdownRows(baseKey, cleaned, engineWidth, 2, accentColor));
|
|
20137
20417
|
pushSegmentsRow(`${baseKey}-engine-foot`, 2, [{ text: "\u2514\u2500\u2500", color: accentColor }]);
|
|
@@ -21446,6 +21726,8 @@ function App() {
|
|
|
21446
21726
|
const activeAbortRef = useRef4(null);
|
|
21447
21727
|
const activeTurnRef = useRef4(null);
|
|
21448
21728
|
const lastActivityTimeRef = useRef4(Date.now());
|
|
21729
|
+
const pendingBellRef = useRef4(false);
|
|
21730
|
+
const awaitingPlanAnnouncedRef = useRef4("");
|
|
21449
21731
|
const blockArchivePathRef = useRef4(makeBlockArchivePath(Date.now()));
|
|
21450
21732
|
const nestedCtrlShortcutRef = useRef4({ key: "", at: 0 });
|
|
21451
21733
|
const displayRowCountRef = useRef4(0);
|
|
@@ -21698,12 +21980,20 @@ function App() {
|
|
|
21698
21980
|
const transition = useCallback((fn) => {
|
|
21699
21981
|
setReplState((prev) => {
|
|
21700
21982
|
try {
|
|
21701
|
-
|
|
21983
|
+
const next = fn({ state: prev }).state;
|
|
21984
|
+
if (next === "idle" && prev !== "idle") {
|
|
21985
|
+
if (!pendingBellRef.current) {
|
|
21986
|
+
bell();
|
|
21987
|
+
pendingBellRef.current = true;
|
|
21988
|
+
}
|
|
21989
|
+
setWindowTitle("agon");
|
|
21990
|
+
}
|
|
21991
|
+
return next;
|
|
21702
21992
|
} catch {
|
|
21703
21993
|
return prev;
|
|
21704
21994
|
}
|
|
21705
21995
|
});
|
|
21706
|
-
}, []);
|
|
21996
|
+
}, [bell, setWindowTitle, pendingBellRef]);
|
|
21707
21997
|
const trackAbort = useCallback((abort) => {
|
|
21708
21998
|
if (activeAbortRef.current) {
|
|
21709
21999
|
_activeAborts.delete(activeAbortRef.current);
|
|
@@ -21825,6 +22115,11 @@ function App() {
|
|
|
21825
22115
|
dispatch({ type: "warning", message });
|
|
21826
22116
|
}
|
|
21827
22117
|
setReplState((prev) => prev === "idle" ? prev : cancelReplState({ state: prev }).state);
|
|
22118
|
+
if (!pendingBellRef.current) {
|
|
22119
|
+
bell();
|
|
22120
|
+
pendingBellRef.current = true;
|
|
22121
|
+
}
|
|
22122
|
+
setWindowTitle("agon");
|
|
21828
22123
|
}
|
|
21829
22124
|
if (clearChat) {
|
|
21830
22125
|
dispatch({ type: "clear" });
|
|
@@ -21885,6 +22180,8 @@ function App() {
|
|
|
21885
22180
|
}, []);
|
|
21886
22181
|
const handleInputChange = useCallback((value) => {
|
|
21887
22182
|
keyT0Ref.current = perfNow();
|
|
22183
|
+
pendingBellRef.current = false;
|
|
22184
|
+
awaitingPlanAnnouncedRef.current = "";
|
|
21888
22185
|
if (questionState && questionState.choices) {
|
|
21889
22186
|
return;
|
|
21890
22187
|
}
|
|
@@ -21931,7 +22228,7 @@ function App() {
|
|
|
21931
22228
|
const updatedValue = nextValue.slice(0, change.start) + replacement + nextValue.slice(change.start + change.inserted.length);
|
|
21932
22229
|
inputValueRef.current = updatedValue;
|
|
21933
22230
|
setInputValue(updatedValue);
|
|
21934
|
-
}, [slashPickerOpen, enginePickerOpen, modelPickerOpen, questionState, planModeQueued, autoModeQueued, livePaneVisible]);
|
|
22231
|
+
}, [slashPickerOpen, enginePickerOpen, modelPickerOpen, questionState, planModeQueued, autoModeQueued, livePaneVisible, pendingBellRef]);
|
|
21935
22232
|
const sendBtwMessage = useCallback((question) => {
|
|
21936
22233
|
const q = (question ?? "").trim();
|
|
21937
22234
|
if (!q) return;
|
|
@@ -22017,6 +22314,8 @@ function App() {
|
|
|
22017
22314
|
const handleSubmit = useCallback(async (value) => {
|
|
22018
22315
|
inputEpochRef.current += 1;
|
|
22019
22316
|
let input = cleanSubmitValue(value);
|
|
22317
|
+
pendingBellRef.current = false;
|
|
22318
|
+
awaitingPlanAnnouncedRef.current = "";
|
|
22020
22319
|
if (!input) return;
|
|
22021
22320
|
if (input === "/") {
|
|
22022
22321
|
if (planModeQueued) setPlanModeQueued(false);
|
|
@@ -22102,6 +22401,8 @@ function App() {
|
|
|
22102
22401
|
const autoModeForTurn = autoModeQueued && input.trim() && !input.startsWith("/");
|
|
22103
22402
|
if (planModeQueued) setPlanModeQueued(false);
|
|
22104
22403
|
transition(startCommandReplState);
|
|
22404
|
+
pendingBellRef.current = false;
|
|
22405
|
+
setWindowTitle("\u25CF agon \u2014 running");
|
|
22105
22406
|
dispatch({ type: "separator" });
|
|
22106
22407
|
dispatch({ type: "user-message", content: input });
|
|
22107
22408
|
const { text: cleanInput, images: detectedImages } = extractImagesFromInput(input, resolveWorkingDir());
|
|
@@ -22133,10 +22434,14 @@ function App() {
|
|
|
22133
22434
|
fn().then(() => {
|
|
22134
22435
|
jobManager.complete(job.id);
|
|
22135
22436
|
setJobList([...jobManager.list()]);
|
|
22437
|
+
bell();
|
|
22438
|
+
setWindowTitle("agon");
|
|
22136
22439
|
}).catch((err) => {
|
|
22137
22440
|
jobManager.fail(job.id, err instanceof Error ? err.message : String(err));
|
|
22138
22441
|
setJobList([...jobManager.list()]);
|
|
22139
22442
|
dispatch({ type: "error", message: err instanceof Error ? err.message : String(err) });
|
|
22443
|
+
bell();
|
|
22444
|
+
setWindowTitle("agon");
|
|
22140
22445
|
});
|
|
22141
22446
|
},
|
|
22142
22447
|
setMode,
|
|
@@ -22194,9 +22499,9 @@ function App() {
|
|
|
22194
22499
|
dispatch({ type: "error", message: err instanceof Error ? err.message : String(err) });
|
|
22195
22500
|
} finally {
|
|
22196
22501
|
if (activeTurnRef.current?.input === input) activeTurnRef.current = null;
|
|
22197
|
-
|
|
22502
|
+
transition(finishReplState);
|
|
22198
22503
|
}
|
|
22199
|
-
}, [replState, dispatch, buildContext, mode, pendingImages, jobManager, loadedExtensions, extensionSkills, commandRegistry, eventBus, planModeQueued, autoModeQueued, setPersistentAutoMode, setActivePlanWrapped, outputBlocks, btwPanel, sendBtwMessage]);
|
|
22504
|
+
}, [replState, dispatch, buildContext, mode, pendingImages, jobManager, loadedExtensions, extensionSkills, commandRegistry, eventBus, planModeQueued, autoModeQueued, setPersistentAutoMode, setActivePlanWrapped, outputBlocks, btwPanel, sendBtwMessage, pendingBellRef, awaitingPlanAnnouncedRef]);
|
|
22200
22505
|
const handleReviewActionCb = useCallback((action) => {
|
|
22201
22506
|
if (!reviewEvent) {
|
|
22202
22507
|
return;
|
|
@@ -22235,7 +22540,7 @@ function App() {
|
|
|
22235
22540
|
setEnginePickerOpen(false);
|
|
22236
22541
|
setModelPickerOpen(true);
|
|
22237
22542
|
setModelPickerCliGroups([]);
|
|
22238
|
-
import("./src-
|
|
22543
|
+
import("./src-253BUXEF.js").then(({ fetchModelsRegistry: fetchModelsRegistry2, buildModelEntries: buildModelEntries2, buildCliGroupsImmediate, refreshCliGroup, refreshCliGroupVersion }) => {
|
|
22239
22544
|
let cliGroups = buildCliGroupsImmediate();
|
|
22240
22545
|
setModelPickerCliGroups(cliGroups);
|
|
22241
22546
|
for (const g of cliGroups) {
|
|
@@ -22396,7 +22701,7 @@ function App() {
|
|
|
22396
22701
|
if (ans === "later") return;
|
|
22397
22702
|
if (ans === "update") {
|
|
22398
22703
|
setUpdateInfo(null);
|
|
22399
|
-
import("./update-
|
|
22704
|
+
import("./update-ODAAXWOD.js").then((m) => m.runUpdate(latest)).catch((err) => {
|
|
22400
22705
|
console.error("[agon] failed to launch update:", err && err.message ? err.message : String(err));
|
|
22401
22706
|
});
|
|
22402
22707
|
return;
|
|
@@ -22678,6 +22983,12 @@ function App() {
|
|
|
22678
22983
|
case "planControl":
|
|
22679
22984
|
ctrlKeyHandledRef.current = true;
|
|
22680
22985
|
setPlanApprovalIndex(0);
|
|
22986
|
+
if (action.action === "revise") {
|
|
22987
|
+
setPendingPlanProposal(null);
|
|
22988
|
+
setInputValue("Revise the plan: ");
|
|
22989
|
+
dispatch({ type: "info", message: "Type your revision and press Enter (Esc clears)." });
|
|
22990
|
+
return;
|
|
22991
|
+
}
|
|
22681
22992
|
handleSubmit(action.action === "approve" ? "/approve" : "/cancel");
|
|
22682
22993
|
return;
|
|
22683
22994
|
case "movePlanApproval":
|
|
@@ -22814,6 +23125,27 @@ function App() {
|
|
|
22814
23125
|
useEffect6(() => {
|
|
22815
23126
|
modeRef.current = mode;
|
|
22816
23127
|
}, [mode]);
|
|
23128
|
+
useEffect6(() => {
|
|
23129
|
+
const planState = String(activePlan?.state ?? "");
|
|
23130
|
+
const planAwaiting = planState === "awaiting_approval";
|
|
23131
|
+
const planId = String(activePlan?.id ?? "");
|
|
23132
|
+
if (questionState || planAwaiting) {
|
|
23133
|
+
const freshPlan = planAwaiting && planId && planId !== awaitingPlanAnnouncedRef.current;
|
|
23134
|
+
if (!pendingBellRef.current || freshPlan) {
|
|
23135
|
+
bell();
|
|
23136
|
+
pendingBellRef.current = true;
|
|
23137
|
+
}
|
|
23138
|
+
if (freshPlan) awaitingPlanAnnouncedRef.current = planId;
|
|
23139
|
+
setWindowTitle("\u25CF agon \u2014 input needed");
|
|
23140
|
+
} else if (replState === "idle") {
|
|
23141
|
+
setWindowTitle("agon");
|
|
23142
|
+
} else {
|
|
23143
|
+
setWindowTitle("\u25CF agon \u2014 running");
|
|
23144
|
+
}
|
|
23145
|
+
if (!planAwaiting) {
|
|
23146
|
+
awaitingPlanAnnouncedRef.current = "";
|
|
23147
|
+
}
|
|
23148
|
+
}, [questionState, activePlan, replState, bell, setWindowTitle, pendingBellRef, awaitingPlanAnnouncedRef]);
|
|
22817
23149
|
useEffect6(() => {
|
|
22818
23150
|
mouseSelectionRef.current = mouseSelection;
|
|
22819
23151
|
}, [mouseSelection]);
|
|
@@ -23902,7 +24234,7 @@ maybeNotifyIsolationMigration();
|
|
|
23902
24234
|
var main = defineCommand31({
|
|
23903
24235
|
meta: {
|
|
23904
24236
|
name: "agon",
|
|
23905
|
-
version: "0.1.
|
|
24237
|
+
version: "0.1.7",
|
|
23906
24238
|
description: "Any AI can join. They compete. You ship."
|
|
23907
24239
|
},
|
|
23908
24240
|
subCommands: {
|