jinzd-ai-cli 0.4.284 → 0.4.285
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/README.md +3 -3
- package/README.zh-CN.md +3 -3
- package/dist/{batch-DA7VA35X.js → batch-R563COWE.js} +2 -2
- package/dist/{chunk-OZKTHQWA.js → chunk-3LFB4YZA.js} +3 -3
- package/dist/{chunk-BXG44VIQ.js → chunk-5CC5HQFW.js} +1 -1
- package/dist/{chunk-PWLQU43X.js → chunk-6G7Y2VG4.js} +1 -1
- package/dist/{chunk-PPPSK4MA.js → chunk-AOF4K5N7.js} +1 -1
- package/dist/{chunk-XSBGCZOP.js → chunk-DV5D7RXZ.js} +1 -1
- package/dist/{chunk-Z23JYUOL.js → chunk-HBAYEVVJ.js} +69 -3
- package/dist/{chunk-I4FJGILK.js → chunk-KLBMKONV.js} +10 -10
- package/dist/{chunk-3DRSBZQ7.js → chunk-LF6SPK7I.js} +1 -1
- package/dist/{chunk-RV2YOTEQ.js → chunk-PHK7QQH3.js} +1 -1
- package/dist/{chunk-VFVN5CWA.js → chunk-UW33KJW5.js} +1 -1
- package/dist/{chunk-QKGKWCXE.js → chunk-VLM4SKKX.js} +1 -1
- package/dist/{chunk-FZ4THGUP.js → chunk-WBF4AOHJ.js} +1 -1
- package/dist/{chunk-C4CIIIDT.js → chunk-XGRZA5V6.js} +3 -3
- package/dist/{ci-HG2TPYVY.js → ci-E4CYVEOW.js} +4 -4
- package/dist/{ci-format-UB7K63UZ.js → ci-format-7XTLOAB5.js} +2 -2
- package/dist/{constants-3DDHA3LT.js → constants-L7D3IXWV.js} +1 -1
- package/dist/{doctor-cli-ISFDY7LZ.js → doctor-cli-JLROIGLO.js} +4 -4
- package/dist/electron-server.js +117 -69
- package/dist/{hub-MP2CNDMZ.js → hub-7UDPLWBI.js} +1 -1
- package/dist/index.js +76 -21
- package/dist/{persistent-memory-AMDRRB5E.js → persistent-memory-CNJOZ7U2.js} +2 -2
- package/dist/{persistent-memory-J2OVPLWI.js → persistent-memory-DRXWYBJS.js} +2 -2
- package/dist/{pr-BREZ3DJX.js → pr-3W5547IS.js} +4 -4
- package/dist/{run-tests-DPO23PKA.js → run-tests-7B7N4YAE.js} +2 -2
- package/dist/{run-tests-XHLV74GU.js → run-tests-LP2CI4MT.js} +2 -2
- package/dist/{server-KK7DIV3J.js → server-NIPB62XP.js} +5 -5
- package/dist/{server-W2VIUKTQ.js → server-YBMWBJVG.js} +70 -74
- package/dist/{task-orchestrator-YM5IMIKL.js → task-orchestrator-RYG4ZTDO.js} +5 -5
- package/dist/{usage-TXPZY7EB.js → usage-YDVLCZDU.js} +2 -2
- package/package.json +1 -1
package/dist/electron-server.js
CHANGED
|
@@ -40,14 +40,14 @@ import {
|
|
|
40
40
|
touchMemoryReferences,
|
|
41
41
|
updateMemoryApproval,
|
|
42
42
|
updateMemoryEntry
|
|
43
|
-
} from "./chunk-
|
|
43
|
+
} from "./chunk-WBF4AOHJ.js";
|
|
44
44
|
import {
|
|
45
45
|
redactJson,
|
|
46
46
|
scanString
|
|
47
47
|
} from "./chunk-FSC6KEWU.js";
|
|
48
48
|
import {
|
|
49
49
|
runTestsTool
|
|
50
|
-
} from "./chunk-
|
|
50
|
+
} from "./chunk-VLM4SKKX.js";
|
|
51
51
|
import {
|
|
52
52
|
AGENTIC_BEHAVIOR_GUIDELINE,
|
|
53
53
|
APP_NAME,
|
|
@@ -80,7 +80,7 @@ import {
|
|
|
80
80
|
SUBAGENT_MAX_ROUNDS_LIMIT,
|
|
81
81
|
VERSION,
|
|
82
82
|
buildUserIdentityPrompt
|
|
83
|
-
} from "./chunk-
|
|
83
|
+
} from "./chunk-LF6SPK7I.js";
|
|
84
84
|
import {
|
|
85
85
|
hasSemanticIndex,
|
|
86
86
|
semanticSearch
|
|
@@ -16838,7 +16838,7 @@ Cache: write=${cacheCreate} read=${cacheRead}` : "";
|
|
|
16838
16838
|
Cost: ${formatCost(cost)}` : "";
|
|
16839
16839
|
let memoryLine = "";
|
|
16840
16840
|
try {
|
|
16841
|
-
const { countPendingMemories: countPendingMemories2 } = await import("./persistent-memory-
|
|
16841
|
+
const { countPendingMemories: countPendingMemories2 } = await import("./persistent-memory-CNJOZ7U2.js");
|
|
16842
16842
|
const pending = countPendingMemories2(ctx.config.getConfigDir());
|
|
16843
16843
|
if (pending > 0) memoryLine = `
|
|
16844
16844
|
Memory: \u26A0 ${pending} pending approval \u2014 see the Memory panel or /memory`;
|
|
@@ -17491,6 +17491,65 @@ async function handleRewind(args, ctx) {
|
|
|
17491
17491
|
ctx.sendStatus();
|
|
17492
17492
|
}
|
|
17493
17493
|
|
|
17494
|
+
// src/core/agent-command.ts
|
|
17495
|
+
var AGENT_USAGE = "Usage: /agent list|switch <name>|stop <id|all>|summary";
|
|
17496
|
+
function parseAgentCommand(args) {
|
|
17497
|
+
const sub = (args[0] ?? "summary").toLowerCase();
|
|
17498
|
+
switch (sub) {
|
|
17499
|
+
case "list":
|
|
17500
|
+
return { kind: "list" };
|
|
17501
|
+
case "switch": {
|
|
17502
|
+
const name = args[1];
|
|
17503
|
+
return name ? { kind: "switch", name } : { kind: "usage", message: "Usage: /agent switch <name>" };
|
|
17504
|
+
}
|
|
17505
|
+
case "stop":
|
|
17506
|
+
return { kind: "stop", target: args[1] ?? "all" };
|
|
17507
|
+
case "summary":
|
|
17508
|
+
return { kind: "summary" };
|
|
17509
|
+
default:
|
|
17510
|
+
return { kind: "usage", message: AGENT_USAGE };
|
|
17511
|
+
}
|
|
17512
|
+
}
|
|
17513
|
+
function formatAgentList(agents, preferred) {
|
|
17514
|
+
const lines = [`Agents (${agents.length})`, ""];
|
|
17515
|
+
for (const agent of agents) {
|
|
17516
|
+
const active = agent.name === preferred ? " *" : " ";
|
|
17517
|
+
const model = [agent.provider, agent.model].filter(Boolean).join("/") || "inherit";
|
|
17518
|
+
lines.push(`${active} ${agent.name} [${agent.source ?? "builtin"}] \u2014 ${agent.description ?? ""}`);
|
|
17519
|
+
lines.push(
|
|
17520
|
+
` model: ${model} \xB7 permission: ${agent.permissionProfile ?? "workspace-write"} \xB7 maxRounds: ${agent.maxToolRounds ?? "inherit"}`
|
|
17521
|
+
);
|
|
17522
|
+
}
|
|
17523
|
+
lines.push("", "Config dirs: ~/.aicli/agents/ and .aicli/agents/");
|
|
17524
|
+
return lines;
|
|
17525
|
+
}
|
|
17526
|
+
function formatAgentRuns(runs2) {
|
|
17527
|
+
if (runs2.length === 0) return ["No sub-agent runs yet."];
|
|
17528
|
+
const lines = [`Recent agent runs (${runs2.length})`, ""];
|
|
17529
|
+
for (const run of runs2.slice(0, 20)) {
|
|
17530
|
+
lines.push(`${run.id} ${run.status} ${run.agentName} ${run.startedAt}`);
|
|
17531
|
+
lines.push(` task: ${run.task.slice(0, 120)}${run.task.length > 120 ? "..." : ""}`);
|
|
17532
|
+
if (run.toolNames.length > 0) lines.push(` tools: ${run.toolNames.join(", ")}`);
|
|
17533
|
+
if (run.summary) lines.push(` summary: ${run.summary.slice(0, 180)}${run.summary.length > 180 ? "..." : ""}`);
|
|
17534
|
+
if (run.error) lines.push(` error: ${run.error}`);
|
|
17535
|
+
}
|
|
17536
|
+
return lines;
|
|
17537
|
+
}
|
|
17538
|
+
var agentStopMessage = (count) => count > 0 ? `Stop requested for ${count} running agent(s).` : "No matching running agents.";
|
|
17539
|
+
var agentUnknownMessage = (name, available) => `Unknown agent: ${name}
|
|
17540
|
+
Available: ${available.join(", ")}`;
|
|
17541
|
+
function parseSkillCommand(args) {
|
|
17542
|
+
const sub = (args[0] ?? "list").toLowerCase();
|
|
17543
|
+
if (!args[0] || sub === "list") return { kind: "list" };
|
|
17544
|
+
if (sub === "reload") return { kind: "reload" };
|
|
17545
|
+
if (sub === "off" || sub === "none" || sub === "deactivate") return { kind: "deactivate" };
|
|
17546
|
+
return { kind: "activate", name: args.join(" ").trim() };
|
|
17547
|
+
}
|
|
17548
|
+
function skillHistoryNote(fromLabel, toLabel, messageCount) {
|
|
17549
|
+
if (messageCount <= 0) return null;
|
|
17550
|
+
return `Switching skill: ${fromLabel} \u2192 ${toLabel} with ${messageCount} message(s) still in context. The previous skill's turns can bias the new one \u2014 use /clear to start a fresh session, or /branch new 0 <title> to fork before continuing.`;
|
|
17551
|
+
}
|
|
17552
|
+
|
|
17494
17553
|
// src/web/commands/tooling-commands.ts
|
|
17495
17554
|
async function handleTools(_args, ctx) {
|
|
17496
17555
|
ctx.sendToolsList();
|
|
@@ -17592,14 +17651,14 @@ async function handleMcp(_args, ctx) {
|
|
|
17592
17651
|
ctx.send({ type: "info", message: lines.join("\n") });
|
|
17593
17652
|
}
|
|
17594
17653
|
async function handleSkill(args, ctx) {
|
|
17595
|
-
const sub = args[0];
|
|
17596
17654
|
if (!ctx.skillManager) {
|
|
17597
17655
|
ctx.send({ type: "error", message: "Skill system not available." });
|
|
17598
17656
|
return;
|
|
17599
17657
|
}
|
|
17600
|
-
|
|
17658
|
+
const intent = parseSkillCommand(args);
|
|
17659
|
+
const active = ctx.skillManager.getActive();
|
|
17660
|
+
if (intent.kind === "list") {
|
|
17601
17661
|
const skills = ctx.skillManager.listSkills();
|
|
17602
|
-
const active = ctx.skillManager.getActive();
|
|
17603
17662
|
if (skills.length === 0) {
|
|
17604
17663
|
ctx.send({ type: "info", message: "No skills available. Add .md files to ~/.aicli/skills/" });
|
|
17605
17664
|
} else {
|
|
@@ -17613,29 +17672,45 @@ ${lines.join("\n")}` });
|
|
|
17613
17672
|
}
|
|
17614
17673
|
return;
|
|
17615
17674
|
}
|
|
17616
|
-
if (
|
|
17617
|
-
ctx.skillManager.deactivate();
|
|
17618
|
-
ctx.send({ type: "info", message: "\u{1F50C} Skill deactivated." });
|
|
17619
|
-
ctx.sendToolsList();
|
|
17620
|
-
ctx.sendStatus();
|
|
17621
|
-
return;
|
|
17622
|
-
}
|
|
17623
|
-
if (sub === "reload") {
|
|
17675
|
+
if (intent.kind === "reload") {
|
|
17624
17676
|
ctx.skillManager.loadSkills(getActivePluginAssets(ctx.config.getConfigDir()).skillDirs);
|
|
17625
17677
|
ctx.send({ type: "info", message: `\u{1F504} Reloaded ${ctx.skillManager.listSkills().length} skill(s).` });
|
|
17626
17678
|
ctx.sendToolsList();
|
|
17627
17679
|
return;
|
|
17628
17680
|
}
|
|
17629
|
-
const
|
|
17630
|
-
|
|
17631
|
-
|
|
17632
|
-
|
|
17681
|
+
const note = skillHistoryNote(
|
|
17682
|
+
active?.meta.name ?? "(none)",
|
|
17683
|
+
intent.kind === "deactivate" ? "(none)" : intent.name,
|
|
17684
|
+
ctx.sessions.current?.messages.length ?? 0
|
|
17685
|
+
);
|
|
17686
|
+
if (intent.kind === "deactivate") {
|
|
17687
|
+
if (!active) {
|
|
17688
|
+
ctx.send({ type: "info", message: "No skill is currently active." });
|
|
17689
|
+
return;
|
|
17690
|
+
}
|
|
17691
|
+
ctx.skillManager.deactivate();
|
|
17692
|
+
ctx.send({ type: "info", message: note ? `\u{1F50C} Skill deactivated.
|
|
17693
|
+
${note}` : "\u{1F50C} Skill deactivated." });
|
|
17633
17694
|
ctx.sendToolsList();
|
|
17634
17695
|
ctx.sendStatus();
|
|
17635
|
-
|
|
17696
|
+
return;
|
|
17697
|
+
}
|
|
17698
|
+
if (active?.meta.name === intent.name) {
|
|
17699
|
+
ctx.send({ type: "info", message: `Skill '${intent.name}' is already active.` });
|
|
17700
|
+
return;
|
|
17701
|
+
}
|
|
17702
|
+
const activated = ctx.skillManager.activate(intent.name);
|
|
17703
|
+
if (!activated) {
|
|
17636
17704
|
const available = ctx.skillManager.listSkills().map((s) => s.meta.name).join(", ");
|
|
17637
|
-
ctx.send({ type: "error", message: `Skill "${
|
|
17705
|
+
ctx.send({ type: "error", message: `Skill "${intent.name}" not found. Available: ${available}` });
|
|
17706
|
+
return;
|
|
17638
17707
|
}
|
|
17708
|
+
const head = `\u2705 Skill activated: ${activated.meta.name}
|
|
17709
|
+
${activated.meta.description || ""}`;
|
|
17710
|
+
ctx.send({ type: "info", message: note ? `${head}
|
|
17711
|
+
${note}` : head });
|
|
17712
|
+
ctx.sendToolsList();
|
|
17713
|
+
ctx.sendStatus();
|
|
17639
17714
|
}
|
|
17640
17715
|
async function handleCommands(_args, ctx) {
|
|
17641
17716
|
const configDir = ctx.config.getConfigDir();
|
|
@@ -17746,7 +17821,7 @@ async function handleTest(args, ctx) {
|
|
|
17746
17821
|
const isCommand = argStr.includes(" ") || /^(mvn|gradle|npm|pytest|cargo|go)\b/.test(argStr);
|
|
17747
17822
|
testArgs = isCommand ? { command: argStr } : { filter: argStr };
|
|
17748
17823
|
}
|
|
17749
|
-
const runTests = ctx.runTests ?? (await import("./run-tests-
|
|
17824
|
+
const runTests = ctx.runTests ?? (await import("./run-tests-LP2CI4MT.js")).executeTests;
|
|
17750
17825
|
const report = await runTests(testArgs);
|
|
17751
17826
|
ctx.send({ type: "info", message: report });
|
|
17752
17827
|
} catch (err) {
|
|
@@ -18136,7 +18211,7 @@ async function handleMemory(args, ctx) {
|
|
|
18136
18211
|
}
|
|
18137
18212
|
if (intent.kind === "status") {
|
|
18138
18213
|
const { getChatIndexStatus } = await import("./chat-index-TDU3S2MG.js");
|
|
18139
|
-
const { listMemoryEntries: listMemoryEntries2, isMemoryExpired: isMemoryExpired2, formatMemoryForPrompt: formatMemoryForPrompt2 } = await import("./persistent-memory-
|
|
18214
|
+
const { listMemoryEntries: listMemoryEntries2, isMemoryExpired: isMemoryExpired2, formatMemoryForPrompt: formatMemoryForPrompt2 } = await import("./persistent-memory-CNJOZ7U2.js");
|
|
18140
18215
|
const memories = listMemoryEntries2(configDir, { includeExpired: true, includeRejected: true });
|
|
18141
18216
|
const injected = formatMemoryForPrompt2(configDir, process.cwd(), ctx.config.get("memory")?.maxChars);
|
|
18142
18217
|
const view = buildMemoryStatusView({
|
|
@@ -18159,7 +18234,7 @@ async function handleMemory(args, ctx) {
|
|
|
18159
18234
|
return;
|
|
18160
18235
|
}
|
|
18161
18236
|
if (intent.kind === "recall") {
|
|
18162
|
-
const { searchPersistentMemories: searchPersistentMemories2, touchMemoryReferences: touchMemoryReferences2 } = await import("./persistent-memory-
|
|
18237
|
+
const { searchPersistentMemories: searchPersistentMemories2, touchMemoryReferences: touchMemoryReferences2 } = await import("./persistent-memory-CNJOZ7U2.js");
|
|
18163
18238
|
const { searchChatMemory: searchChatMemory2 } = await import("./chat-index-TDU3S2MG.js");
|
|
18164
18239
|
const persistentHits = searchPersistentMemories2(configDir, intent.query, process.cwd(), 3);
|
|
18165
18240
|
if (persistentHits.length > 0) {
|
|
@@ -18280,7 +18355,7 @@ async function handleMemory(args, ctx) {
|
|
|
18280
18355
|
ctx.handleMemoryManage(intent.action, args[1], intent.action === "expire" ? args[2] : void 0);
|
|
18281
18356
|
} else if (intent.kind === "export") {
|
|
18282
18357
|
if (args[1] === "md") {
|
|
18283
|
-
const { exportMemoryEntries: exportMemoryEntries2 } = await import("./persistent-memory-
|
|
18358
|
+
const { exportMemoryEntries: exportMemoryEntries2 } = await import("./persistent-memory-CNJOZ7U2.js");
|
|
18284
18359
|
ctx.send({
|
|
18285
18360
|
type: "export_data",
|
|
18286
18361
|
format: "md",
|
|
@@ -18648,31 +18723,23 @@ async function handleYolo(args, ctx) {
|
|
|
18648
18723
|
}
|
|
18649
18724
|
}
|
|
18650
18725
|
async function handleAgent(args, ctx) {
|
|
18651
|
-
const
|
|
18652
|
-
|
|
18653
|
-
|
|
18654
|
-
|
|
18655
|
-
for (const agent of agents) {
|
|
18656
|
-
const active = agent.name === getPreferredAgentName() ? " *" : " ";
|
|
18657
|
-
const model = [agent.provider, agent.model].filter(Boolean).join("/") || "inherit";
|
|
18658
|
-
lines.push(`${active} ${agent.name} [${agent.source ?? "builtin"}] \u2014 ${agent.description ?? ""}`);
|
|
18659
|
-
lines.push(` model: ${model} \xB7 permission: ${agent.permissionProfile ?? "workspace-write"} \xB7 maxRounds: ${agent.maxToolRounds ?? "inherit"}`);
|
|
18660
|
-
}
|
|
18661
|
-
lines.push("", "Config dirs: ~/.aicli/agents/ and .aicli/agents/");
|
|
18662
|
-
ctx.send({ type: "info", message: lines.join("\n") });
|
|
18726
|
+
const configDir = ctx.config.getConfigDir();
|
|
18727
|
+
const intent = parseAgentCommand(args);
|
|
18728
|
+
if (intent.kind === "usage") {
|
|
18729
|
+
ctx.send({ type: "error", message: intent.message });
|
|
18663
18730
|
return;
|
|
18664
18731
|
}
|
|
18665
|
-
if (
|
|
18666
|
-
|
|
18667
|
-
|
|
18668
|
-
|
|
18669
|
-
|
|
18670
|
-
|
|
18671
|
-
const agent = resolveAgentConfig(name, ctx.config.getConfigDir());
|
|
18732
|
+
if (intent.kind === "list") {
|
|
18733
|
+
ctx.send({ type: "info", message: formatAgentList(listAgentConfigs(configDir), getPreferredAgentName()).join("\n") });
|
|
18734
|
+
return;
|
|
18735
|
+
}
|
|
18736
|
+
if (intent.kind === "switch") {
|
|
18737
|
+
const agent = resolveAgentConfig(intent.name, configDir);
|
|
18672
18738
|
if (!agent) {
|
|
18673
|
-
|
|
18674
|
-
|
|
18675
|
-
|
|
18739
|
+
ctx.send({
|
|
18740
|
+
type: "error",
|
|
18741
|
+
message: agentUnknownMessage(intent.name, listAgentConfigs(configDir).map((a) => a.name))
|
|
18742
|
+
});
|
|
18676
18743
|
return;
|
|
18677
18744
|
}
|
|
18678
18745
|
setPreferredAgentName(agent.name);
|
|
@@ -18680,31 +18747,12 @@ Available: ${available}` });
|
|
|
18680
18747
|
ctx.sendStatus();
|
|
18681
18748
|
return;
|
|
18682
18749
|
}
|
|
18683
|
-
if (
|
|
18684
|
-
|
|
18685
|
-
const count = requestAgentStop(target);
|
|
18686
|
-
ctx.send({ type: "info", message: count > 0 ? `Stop requested for ${count} running agent(s).` : "No matching running agents." });
|
|
18750
|
+
if (intent.kind === "stop") {
|
|
18751
|
+
ctx.send({ type: "info", message: agentStopMessage(requestAgentStop(intent.target)) });
|
|
18687
18752
|
ctx.sendStatus();
|
|
18688
18753
|
return;
|
|
18689
18754
|
}
|
|
18690
|
-
|
|
18691
|
-
const runs2 = listAgentRuns();
|
|
18692
|
-
if (runs2.length === 0) {
|
|
18693
|
-
ctx.send({ type: "info", message: "No sub-agent runs yet." });
|
|
18694
|
-
return;
|
|
18695
|
-
}
|
|
18696
|
-
const lines = [`Recent agent runs (${runs2.length})`, ""];
|
|
18697
|
-
for (const run of runs2.slice(0, 20)) {
|
|
18698
|
-
lines.push(`${run.id} ${run.status} ${run.agentName} ${run.startedAt}`);
|
|
18699
|
-
lines.push(` task: ${run.task.slice(0, 120)}${run.task.length > 120 ? "..." : ""}`);
|
|
18700
|
-
if (run.toolNames.length > 0) lines.push(` tools: ${run.toolNames.join(", ")}`);
|
|
18701
|
-
if (run.summary) lines.push(` summary: ${run.summary.slice(0, 180)}${run.summary.length > 180 ? "..." : ""}`);
|
|
18702
|
-
if (run.error) lines.push(` error: ${run.error}`);
|
|
18703
|
-
}
|
|
18704
|
-
ctx.send({ type: "info", message: lines.join("\n") });
|
|
18705
|
-
return;
|
|
18706
|
-
}
|
|
18707
|
-
ctx.send({ type: "error", message: "Usage: /agent list|switch <name>|stop <id|all>|summary" });
|
|
18755
|
+
ctx.send({ type: "info", message: formatAgentRuns(listAgentRuns()).join("\n") });
|
|
18708
18756
|
}
|
|
18709
18757
|
|
|
18710
18758
|
// src/web/commands/misc-commands.ts
|
|
@@ -158,7 +158,7 @@ ${content}`);
|
|
|
158
158
|
}
|
|
159
159
|
}
|
|
160
160
|
async function runTaskMode(config, providers, configManager, topic) {
|
|
161
|
-
const { TaskOrchestrator } = await import("./task-orchestrator-
|
|
161
|
+
const { TaskOrchestrator } = await import("./task-orchestrator-RYG4ZTDO.js");
|
|
162
162
|
const orchestrator = new TaskOrchestrator(config, providers, configManager);
|
|
163
163
|
let interrupted = false;
|
|
164
164
|
const onSigint = () => {
|
package/dist/index.js
CHANGED
|
@@ -5,6 +5,8 @@ import {
|
|
|
5
5
|
McpManager,
|
|
6
6
|
SNAPSHOT_PROMPT,
|
|
7
7
|
SkillManager,
|
|
8
|
+
agentStopMessage,
|
|
9
|
+
agentUnknownMessage,
|
|
8
10
|
applyPlanCommand,
|
|
9
11
|
applyProfileCommand,
|
|
10
12
|
applyThinkCommand,
|
|
@@ -29,11 +31,14 @@ import {
|
|
|
29
31
|
estimateConversationTokens,
|
|
30
32
|
evaluateContextPressure,
|
|
31
33
|
filterMemoryEntries,
|
|
34
|
+
formatAgentList,
|
|
35
|
+
formatAgentRuns,
|
|
32
36
|
formatCheckpointList,
|
|
33
37
|
formatForkReport,
|
|
34
38
|
formatRewindReport,
|
|
35
39
|
formatSessionSummaryLine,
|
|
36
40
|
loadDevState,
|
|
41
|
+
parseAgentCommand,
|
|
37
42
|
parseBatchDeleteArgs,
|
|
38
43
|
parseCheckpointCommand,
|
|
39
44
|
parseCleanArgs,
|
|
@@ -45,6 +50,7 @@ import {
|
|
|
45
50
|
parseRouteCommand,
|
|
46
51
|
parseSessionListArgs,
|
|
47
52
|
parseSimpleYaml,
|
|
53
|
+
parseSkillCommand,
|
|
48
54
|
persistToolRound,
|
|
49
55
|
readGitDiff,
|
|
50
56
|
rebuildDoneMessage,
|
|
@@ -65,7 +71,7 @@ import {
|
|
|
65
71
|
setupProxy,
|
|
66
72
|
snapshotFile,
|
|
67
73
|
stripRoutingTags
|
|
68
|
-
} from "./chunk-
|
|
74
|
+
} from "./chunk-HBAYEVVJ.js";
|
|
69
75
|
import {
|
|
70
76
|
CostTracker,
|
|
71
77
|
computeCost,
|
|
@@ -82,20 +88,26 @@ import {
|
|
|
82
88
|
clearRecentlyDeniedAutoActions,
|
|
83
89
|
estimateTokens,
|
|
84
90
|
formatPermissionProfileWarning,
|
|
91
|
+
getPreferredAgentName,
|
|
85
92
|
getRecentlyDeniedAutoActions,
|
|
86
93
|
googleSearchContext,
|
|
87
94
|
isInterrupted,
|
|
88
95
|
isToolCapableProvider,
|
|
89
96
|
lastResponseStore,
|
|
97
|
+
listAgentConfigs,
|
|
98
|
+
listAgentRuns,
|
|
90
99
|
renderDiff,
|
|
100
|
+
requestAgentStop,
|
|
91
101
|
requestInterrupt,
|
|
92
102
|
resetInterrupt,
|
|
103
|
+
resolveAgentConfig,
|
|
93
104
|
rlInternal,
|
|
94
105
|
setContextWindow,
|
|
95
106
|
setMaxOutputCap,
|
|
107
|
+
setPreferredAgentName,
|
|
96
108
|
spawnAgentContext,
|
|
97
109
|
undoStack
|
|
98
|
-
} from "./chunk-
|
|
110
|
+
} from "./chunk-KLBMKONV.js";
|
|
99
111
|
import {
|
|
100
112
|
buildReviewPrompt,
|
|
101
113
|
buildSecurityReviewPrompt
|
|
@@ -136,7 +148,7 @@ import {
|
|
|
136
148
|
touchMemoryReferences,
|
|
137
149
|
updateMemoryApproval,
|
|
138
150
|
updateMemoryEntry
|
|
139
|
-
} from "./chunk-
|
|
151
|
+
} from "./chunk-AOF4K5N7.js";
|
|
140
152
|
import "./chunk-4DEMGCK4.js";
|
|
141
153
|
import "./chunk-UUSRWSSX.js";
|
|
142
154
|
import "./chunk-CKH4KQ4E.js";
|
|
@@ -160,7 +172,7 @@ import {
|
|
|
160
172
|
formatDoctorReport,
|
|
161
173
|
loadContextFiles,
|
|
162
174
|
writeCrashLog
|
|
163
|
-
} from "./chunk-
|
|
175
|
+
} from "./chunk-XGRZA5V6.js";
|
|
164
176
|
import {
|
|
165
177
|
describePlugin,
|
|
166
178
|
getActivePluginAssets,
|
|
@@ -177,14 +189,14 @@ import {
|
|
|
177
189
|
trustHook,
|
|
178
190
|
trustPlugin,
|
|
179
191
|
untrustHook
|
|
180
|
-
} from "./chunk-
|
|
192
|
+
} from "./chunk-5CC5HQFW.js";
|
|
181
193
|
import {
|
|
182
194
|
ProviderRegistry,
|
|
183
195
|
listBuiltInProviderMetadata
|
|
184
196
|
} from "./chunk-UGY5SVNX.js";
|
|
185
197
|
import {
|
|
186
198
|
ConfigManager
|
|
187
|
-
} from "./chunk-
|
|
199
|
+
} from "./chunk-DV5D7RXZ.js";
|
|
188
200
|
import {
|
|
189
201
|
CONTENT_ONLY_STREAM_REMINDER,
|
|
190
202
|
TEE_FINAL_USER_NUDGE,
|
|
@@ -222,7 +234,7 @@ import {
|
|
|
222
234
|
import {
|
|
223
235
|
fileCheckpoints
|
|
224
236
|
} from "./chunk-4BKXL7SM.js";
|
|
225
|
-
import "./chunk-
|
|
237
|
+
import "./chunk-6G7Y2VG4.js";
|
|
226
238
|
import {
|
|
227
239
|
AGENTIC_BEHAVIOR_GUIDELINE,
|
|
228
240
|
AUTHOR,
|
|
@@ -240,7 +252,7 @@ import {
|
|
|
240
252
|
SKILLS_DIR_NAME,
|
|
241
253
|
VERSION,
|
|
242
254
|
buildUserIdentityPrompt
|
|
243
|
-
} from "./chunk-
|
|
255
|
+
} from "./chunk-PHK7QQH3.js";
|
|
244
256
|
|
|
245
257
|
// src/index.ts
|
|
246
258
|
import { program } from "commander";
|
|
@@ -1358,7 +1370,7 @@ No tools match "${filter}".
|
|
|
1358
1370
|
const { join: join6 } = await import("path");
|
|
1359
1371
|
const { existsSync: existsSync6 } = await import("fs");
|
|
1360
1372
|
const { getGitRoot: getGitRoot2 } = await import("./git-context-EXOEHQSF.js");
|
|
1361
|
-
const { MCP_PROJECT_CONFIG_NAME: MCP_PROJECT_CONFIG_NAME2 } = await import("./constants-
|
|
1373
|
+
const { MCP_PROJECT_CONFIG_NAME: MCP_PROJECT_CONFIG_NAME2 } = await import("./constants-L7D3IXWV.js");
|
|
1362
1374
|
const { approveProject, hashMcpFile } = await import("./project-trust-NKYHL3VZ.js");
|
|
1363
1375
|
const cwd = process.cwd();
|
|
1364
1376
|
const projectRoot = getGitRoot2(cwd) ?? cwd;
|
|
@@ -1489,7 +1501,7 @@ No tools match "${filter}".
|
|
|
1489
1501
|
console.log();
|
|
1490
1502
|
return;
|
|
1491
1503
|
}
|
|
1492
|
-
if (
|
|
1504
|
+
if (parseSkillCommand(args).kind === "deactivate") {
|
|
1493
1505
|
const prev2 = manager.getActive();
|
|
1494
1506
|
if (!prev2) {
|
|
1495
1507
|
ctx.renderer.printInfo("No skill is currently active.");
|
|
@@ -2273,7 +2285,7 @@ function createReviewCommands() {
|
|
|
2273
2285
|
usage: "/test [command|filter]",
|
|
2274
2286
|
async execute(args, ctx) {
|
|
2275
2287
|
try {
|
|
2276
|
-
const { executeTests } = await import("./run-tests-
|
|
2288
|
+
const { executeTests } = await import("./run-tests-7B7N4YAE.js");
|
|
2277
2289
|
const argStr = args.join(" ").trim();
|
|
2278
2290
|
let testArgs = {};
|
|
2279
2291
|
if (argStr) {
|
|
@@ -3581,7 +3593,8 @@ function createMiscCommands() {
|
|
|
3581
3593
|
["/plan [execute|exit|status]", "Enter/manage Plan Mode (read-only)"],
|
|
3582
3594
|
["/auto [on|off|status]", "Rule-based low-risk auto approval"],
|
|
3583
3595
|
["/permissions recently-denied|clear-denied", "Inspect permission and Auto Mode decisions"],
|
|
3584
|
-
["/yolo [on|off]", "Toggle write auto-approve (destructive still confirms)"]
|
|
3596
|
+
["/yolo [on|off]", "Toggle write auto-approve (destructive still confirms)"],
|
|
3597
|
+
["/agent [list|switch <name>|stop <id|all>|summary]", "Named sub-agent roles & recent runs"]
|
|
3585
3598
|
]
|
|
3586
3599
|
},
|
|
3587
3600
|
{
|
|
@@ -3915,6 +3928,48 @@ function createAgentCommands() {
|
|
|
3915
3928
|
}
|
|
3916
3929
|
console.log();
|
|
3917
3930
|
}
|
|
3931
|
+
},
|
|
3932
|
+
{
|
|
3933
|
+
name: "agent",
|
|
3934
|
+
description: "Inspect named sub-agent roles and recent sub-agent runs",
|
|
3935
|
+
usage: "/agent [list | switch <name> | stop <id|all> | summary]",
|
|
3936
|
+
execute(args, ctx) {
|
|
3937
|
+
const configDir = ctx.config.getConfigDir();
|
|
3938
|
+
const intent = parseAgentCommand(args);
|
|
3939
|
+
if (intent.kind === "usage") {
|
|
3940
|
+
ctx.renderer.renderError(intent.message);
|
|
3941
|
+
return;
|
|
3942
|
+
}
|
|
3943
|
+
if (intent.kind === "list") {
|
|
3944
|
+
const agents = listAgentConfigs(configDir);
|
|
3945
|
+
const preferred = getPreferredAgentName();
|
|
3946
|
+
console.log();
|
|
3947
|
+
for (const line of formatAgentList(agents, preferred)) {
|
|
3948
|
+
console.log(line.startsWith(" *") ? theme.success(line) : theme.dim(line));
|
|
3949
|
+
}
|
|
3950
|
+
console.log();
|
|
3951
|
+
return;
|
|
3952
|
+
}
|
|
3953
|
+
if (intent.kind === "switch") {
|
|
3954
|
+
const agent = resolveAgentConfig(intent.name, configDir);
|
|
3955
|
+
if (!agent) {
|
|
3956
|
+
ctx.renderer.renderError(
|
|
3957
|
+
agentUnknownMessage(intent.name, listAgentConfigs(configDir).map((a) => a.name))
|
|
3958
|
+
);
|
|
3959
|
+
return;
|
|
3960
|
+
}
|
|
3961
|
+
setPreferredAgentName(agent.name);
|
|
3962
|
+
ctx.renderer.printSuccess(`Preferred spawn_agent role: ${agent.name}`);
|
|
3963
|
+
return;
|
|
3964
|
+
}
|
|
3965
|
+
if (intent.kind === "stop") {
|
|
3966
|
+
ctx.renderer.printInfo(agentStopMessage(requestAgentStop(intent.target)));
|
|
3967
|
+
return;
|
|
3968
|
+
}
|
|
3969
|
+
console.log();
|
|
3970
|
+
for (const line of formatAgentRuns(listAgentRuns())) console.log(theme.dim(line));
|
|
3971
|
+
console.log();
|
|
3972
|
+
}
|
|
3918
3973
|
}
|
|
3919
3974
|
];
|
|
3920
3975
|
}
|
|
@@ -7275,7 +7330,7 @@ program.command("web").description("Start Web UI server with browser-based chat
|
|
|
7275
7330
|
console.error("Error: Invalid port number. Must be between 1 and 65535.");
|
|
7276
7331
|
process.exit(1);
|
|
7277
7332
|
}
|
|
7278
|
-
const { startWebServer } = await import("./server-
|
|
7333
|
+
const { startWebServer } = await import("./server-YBMWBJVG.js");
|
|
7279
7334
|
await startWebServer({ port, host: options.host });
|
|
7280
7335
|
});
|
|
7281
7336
|
program.command("user [action] [username]").description("Manage Web UI users (list | create <name> | delete <name> | reset-password <name> | logout-all <name> | migrate <name>)").action(async (action, username) => {
|
|
@@ -7442,11 +7497,11 @@ program.command("sessions").description("List recent conversation sessions").opt
|
|
|
7442
7497
|
console.log(footer + "\n");
|
|
7443
7498
|
});
|
|
7444
7499
|
program.command("usage").description("Show token + cost usage grouped by provider/model (cross-session)").option("--days <n>", "Only the last N days (inclusive of today)").option("--month <ym>", "Only a specific month, format YYYY-MM (e.g. 2026-06)").option("--json", "Output as JSON (for scripting)").action(async (options) => {
|
|
7445
|
-
const { runUsageCli } = await import("./usage-
|
|
7500
|
+
const { runUsageCli } = await import("./usage-YDVLCZDU.js");
|
|
7446
7501
|
await runUsageCli(options);
|
|
7447
7502
|
});
|
|
7448
7503
|
program.command("doctor").description("Health check: API keys, config, MCP, recent crashes, tool usage, disk usage").option("--json", "Output as JSON (for scripting)").option("--reset-stats", "Reset accumulated tool usage statistics").action(async (options) => {
|
|
7449
|
-
const { runDoctorCli } = await import("./doctor-cli-
|
|
7504
|
+
const { runDoctorCli } = await import("./doctor-cli-JLROIGLO.js");
|
|
7450
7505
|
const argv = process.argv.slice(2);
|
|
7451
7506
|
await runDoctorCli({
|
|
7452
7507
|
json: !!options.json || argv.includes("--json"),
|
|
@@ -7455,7 +7510,7 @@ program.command("doctor").description("Health check: API keys, config, MCP, rece
|
|
|
7455
7510
|
});
|
|
7456
7511
|
program.command("batch <action> [arg] [arg2]").description("Anthropic Message Batches: submit | list | status <id> | results <id> [out] | cancel <id>").option("--dry-run", "Parse and validate input without submitting (submit only)").action(async (action, arg, arg2, options) => {
|
|
7457
7512
|
try {
|
|
7458
|
-
const batch = await import("./batch-
|
|
7513
|
+
const batch = await import("./batch-R563COWE.js");
|
|
7459
7514
|
switch (action) {
|
|
7460
7515
|
case "submit":
|
|
7461
7516
|
if (!arg) {
|
|
@@ -7498,7 +7553,7 @@ program.command("batch <action> [arg] [arg2]").description("Anthropic Message Ba
|
|
|
7498
7553
|
}
|
|
7499
7554
|
});
|
|
7500
7555
|
program.command("mcp-serve").description("Start an MCP server over STDIO, exposing aicli's built-in tools to Claude Desktop / Cursor / other MCP clients").option("--allow-destructive", "Allow bash / run_interactive / task_create (always destructive in MCP mode)").option("--allow-outside-cwd", "Allow tool path arguments to escape the sandbox root \u2014 disabled by default").option("--tools <list>", "Comma-separated whitelist of tools to expose (default: all eligible tools)").option("--cwd <path>", "Working directory AND sandbox root (default: current directory)").action(async (options) => {
|
|
7501
|
-
const { startMcpServer } = await import("./server-
|
|
7556
|
+
const { startMcpServer } = await import("./server-NIPB62XP.js");
|
|
7502
7557
|
await startMcpServer({
|
|
7503
7558
|
allowDestructive: !!options.allowDestructive,
|
|
7504
7559
|
allowOutsideCwd: !!options.allowOutsideCwd,
|
|
@@ -7511,7 +7566,7 @@ program.command("pr <action> [target]").description("PR review helpers: review |
|
|
|
7511
7566
|
console.error(`Unknown pr action: ${action}. Use review | security-review | summarize.`);
|
|
7512
7567
|
process.exit(1);
|
|
7513
7568
|
}
|
|
7514
|
-
const { runPrCli } = await import("./pr-
|
|
7569
|
+
const { runPrCli } = await import("./pr-3W5547IS.js");
|
|
7515
7570
|
const result = await runPrCli({
|
|
7516
7571
|
action,
|
|
7517
7572
|
target,
|
|
@@ -7531,8 +7586,8 @@ program.command("pr <action> [target]").description("PR review helpers: review |
|
|
|
7531
7586
|
process.exit(result.exitCode);
|
|
7532
7587
|
});
|
|
7533
7588
|
program.command("ci").description("Headless PR review (code + security) \u2014 reads git/gh diff, optionally posts to PR. Designed for GitHub Actions.").option("--pr <num>", "PR number or URL; diff fetched via gh pr diff <value>", (v) => /^#?\d+$/.test(v) ? parseInt(v.replace(/^#/, ""), 10) : v).option("--base <ref>", "Base ref for git diff <ref>...HEAD (ignored when --pr set)").option("--post", "Post review as a PR comment (requires gh CLI + GH_TOKEN, needs --pr)").option("--no-update", "Always create a new comment instead of updating the previous aicli review").option("--skip-code", "Skip the code review section").option("--skip-security", "Skip the security review section").option("--detailed", "Use the detailed code-review prompt").option("--max-diff <n>", "Max diff chars sent to the model (default 30000)", (v) => parseInt(v, 10)).option("--provider <id>", "Override provider (default: config.defaultProvider)").option("--model <id>", "Override model").option("--dry-run", "Print result to stdout instead of posting (overrides --post)").option("--json", "Output a structured JSON report").option("--markdown", "Output Markdown report (default)").option("--sarif", "Output SARIF 2.1.0 for code scanning artifacts").option("--fail-on-security-high", "Fail when the security review contains HIGH/CRITICAL findings (default)").option("--no-fail-on-security-high", "Do not fail on security HIGH/CRITICAL findings").option("--fail-on-test-failure", "Fail when the report mentions test failures (default)").option("--no-fail-on-test-failure", "Do not fail on test failure findings").option("--fail-on-lint-failure", "Fail when the report mentions lint/typecheck failures (default)").option("--no-fail-on-lint-failure", "Do not fail on lint/typecheck failure findings").action(async (options) => {
|
|
7534
|
-
const { runCi } = await import("./ci-
|
|
7535
|
-
const { formatCiResult } = await import("./ci-format-
|
|
7589
|
+
const { runCi } = await import("./ci-E4CYVEOW.js");
|
|
7590
|
+
const { formatCiResult } = await import("./ci-format-7XTLOAB5.js");
|
|
7536
7591
|
const formats = [options.json, options.markdown, options.sarif].filter(Boolean).length;
|
|
7537
7592
|
if (formats > 1) {
|
|
7538
7593
|
console.error("Choose only one output format: --json, --markdown, or --sarif.");
|
|
@@ -7690,7 +7745,7 @@ program.command("hub [topic]").description("Start multi-agent hub (discuss / bra
|
|
|
7690
7745
|
config.get("customProviders"),
|
|
7691
7746
|
config.getConfigDir()
|
|
7692
7747
|
);
|
|
7693
|
-
const { startHub } = await import("./hub-
|
|
7748
|
+
const { startHub } = await import("./hub-7UDPLWBI.js");
|
|
7694
7749
|
await startHub(
|
|
7695
7750
|
{
|
|
7696
7751
|
topic: topic ?? "",
|
|
@@ -27,9 +27,9 @@ import {
|
|
|
27
27
|
touchMemoryReferences,
|
|
28
28
|
updateMemoryApproval,
|
|
29
29
|
updateMemoryEntry
|
|
30
|
-
} from "./chunk-
|
|
30
|
+
} from "./chunk-WBF4AOHJ.js";
|
|
31
31
|
import "./chunk-FSC6KEWU.js";
|
|
32
|
-
import "./chunk-
|
|
32
|
+
import "./chunk-LF6SPK7I.js";
|
|
33
33
|
import "./chunk-6BUTA5VW.js";
|
|
34
34
|
export {
|
|
35
35
|
addMemoryEntry,
|
|
@@ -28,11 +28,11 @@ import {
|
|
|
28
28
|
touchMemoryReferences,
|
|
29
29
|
updateMemoryApproval,
|
|
30
30
|
updateMemoryEntry
|
|
31
|
-
} from "./chunk-
|
|
31
|
+
} from "./chunk-AOF4K5N7.js";
|
|
32
32
|
import "./chunk-3FEZSLGI.js";
|
|
33
33
|
import "./chunk-HOSJZMQS.js";
|
|
34
34
|
import "./chunk-IW3Q7AE5.js";
|
|
35
|
-
import "./chunk-
|
|
35
|
+
import "./chunk-PHK7QQH3.js";
|
|
36
36
|
export {
|
|
37
37
|
addMemoryEntry,
|
|
38
38
|
backupMemoryStore,
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
import {
|
|
3
3
|
countSeverity,
|
|
4
4
|
runCi
|
|
5
|
-
} from "./chunk-
|
|
6
|
-
import "./chunk-
|
|
5
|
+
} from "./chunk-3LFB4YZA.js";
|
|
6
|
+
import "./chunk-UW33KJW5.js";
|
|
7
7
|
import {
|
|
8
8
|
buildReviewPrompt,
|
|
9
9
|
buildSecurityReviewPrompt,
|
|
@@ -17,13 +17,13 @@ import {
|
|
|
17
17
|
} from "./chunk-UGY5SVNX.js";
|
|
18
18
|
import {
|
|
19
19
|
ConfigManager
|
|
20
|
-
} from "./chunk-
|
|
20
|
+
} from "./chunk-DV5D7RXZ.js";
|
|
21
21
|
import "./chunk-TEXT4DAT.js";
|
|
22
22
|
import "./chunk-TU3L3PW7.js";
|
|
23
23
|
import "./chunk-IW3Q7AE5.js";
|
|
24
24
|
import {
|
|
25
25
|
VERSION
|
|
26
|
-
} from "./chunk-
|
|
26
|
+
} from "./chunk-PHK7QQH3.js";
|
|
27
27
|
|
|
28
28
|
// src/cli/pr.ts
|
|
29
29
|
import { execFileSync } from "child_process";
|