jinzd-ai-cli 0.4.210 → 0.4.212
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 +122 -1
- package/README.zh-CN.md +63 -0
- package/dist/{batch-MFPYHOIL.js → batch-WIKFEOAZ.js} +2 -2
- package/dist/{chat-index-UBCWHBLR.js → chat-index-R2E27VXN.js} +1 -1
- package/dist/{chunk-GRJNQJA5.js → chunk-GBBVCZ4W.js} +1 -1
- package/dist/{chunk-7JWT3KXO.js → chunk-HW2ALWQJ.js} +2 -2
- package/dist/{chunk-E2ZWWE6Q.js → chunk-HX6N6QEY.js} +1 -1
- package/dist/{chunk-DJ35G5VO.js → chunk-IFZX26K7.js} +1 -1
- package/dist/{chunk-HZQVX7VF.js → chunk-KE4B3NOQ.js} +1 -1
- package/dist/{chunk-NWP7C6CC.js → chunk-LU6FBJQ5.js} +1 -1
- package/dist/{chunk-NEPFADHX.js → chunk-N5LB3PPL.js} +567 -87
- package/dist/{chunk-P6MTFCXB.js → chunk-NYCBOVNF.js} +62 -5
- package/dist/{chunk-W7UKO3PS.js → chunk-OQGVGPEK.js} +5 -0
- package/dist/{ci-QLJUDLMY.js → ci-X3LNUFZV.js} +2 -2
- package/dist/{constants-47OR72MV.js → constants-KDWG4KR4.js} +1 -1
- package/dist/{doctor-cli-32COMA5K.js → doctor-cli-TJTWIW7U.js} +4 -4
- package/dist/electron-server.js +947 -280
- package/dist/{hub-3NWJUCLK.js → hub-JWSV4MKC.js} +1 -1
- package/dist/index.js +160 -18
- package/dist/{run-tests-NT2UIUVB.js → run-tests-D7YBY4XB.js} +1 -1
- package/dist/{run-tests-UT7RZ7Y3.js → run-tests-H4Q2PRX6.js} +2 -2
- package/dist/{server-AIHVMLNU.js → server-OFKGDRYI.js} +4 -4
- package/dist/{server-E5D54DIZ.js → server-VNCN7AY5.js} +187 -29
- package/dist/{task-orchestrator-BFDSTSOH.js → task-orchestrator-AL2E642M.js} +4 -4
- package/dist/{usage-P4B2RZKL.js → usage-LB6REWPO.js} +2 -2
- package/dist/web/client/app.js +1 -1
- package/package.json +1 -1
|
@@ -154,7 +154,7 @@ ${content}`);
|
|
|
154
154
|
}
|
|
155
155
|
}
|
|
156
156
|
async function runTaskMode(config, providers, configManager, topic) {
|
|
157
|
-
const { TaskOrchestrator } = await import("./task-orchestrator-
|
|
157
|
+
const { TaskOrchestrator } = await import("./task-orchestrator-AL2E642M.js");
|
|
158
158
|
const orchestrator = new TaskOrchestrator(config, providers, configManager);
|
|
159
159
|
let interrupted = false;
|
|
160
160
|
const onSigint = () => {
|
package/dist/index.js
CHANGED
|
@@ -15,7 +15,7 @@ import {
|
|
|
15
15
|
scanProject,
|
|
16
16
|
sessionHasMeaningfulContent,
|
|
17
17
|
setupProxy
|
|
18
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-HW2ALWQJ.js";
|
|
19
19
|
import {
|
|
20
20
|
buildReviewPrompt,
|
|
21
21
|
buildSecurityReviewPrompt
|
|
@@ -26,23 +26,29 @@ import {
|
|
|
26
26
|
askUserContext,
|
|
27
27
|
cleanupRejectedTeeFile,
|
|
28
28
|
estimateTokens,
|
|
29
|
+
formatPermissionProfileWarning,
|
|
30
|
+
getPendingHookTrust,
|
|
29
31
|
googleSearchContext,
|
|
30
32
|
initTheme,
|
|
31
33
|
isInterrupted,
|
|
32
34
|
lastResponseStore,
|
|
35
|
+
listHooks,
|
|
33
36
|
renderDiff,
|
|
34
37
|
requestInterrupt,
|
|
35
38
|
resetInterrupt,
|
|
36
39
|
rlInternal,
|
|
40
|
+
runLifecycleHooks,
|
|
37
41
|
setContextWindow,
|
|
38
42
|
setMaxOutputCap,
|
|
39
43
|
spawnAgentContext,
|
|
40
44
|
theme,
|
|
41
|
-
|
|
42
|
-
|
|
45
|
+
trustHook,
|
|
46
|
+
undoStack,
|
|
47
|
+
untrustHook
|
|
48
|
+
} from "./chunk-N5LB3PPL.js";
|
|
43
49
|
import "./chunk-T2NL5ZIA.js";
|
|
44
50
|
import "./chunk-BXP6YZ2P.js";
|
|
45
|
-
import "./chunk-
|
|
51
|
+
import "./chunk-HX6N6QEY.js";
|
|
46
52
|
import {
|
|
47
53
|
SessionManager,
|
|
48
54
|
getContentText
|
|
@@ -59,7 +65,7 @@ import {
|
|
|
59
65
|
getConfigDirUsage,
|
|
60
66
|
listRecentCrashes,
|
|
61
67
|
writeCrashLog
|
|
62
|
-
} from "./chunk-
|
|
68
|
+
} from "./chunk-LU6FBJQ5.js";
|
|
63
69
|
import {
|
|
64
70
|
ProviderRegistry
|
|
65
71
|
} from "./chunk-QMXC327F.js";
|
|
@@ -68,7 +74,7 @@ import {
|
|
|
68
74
|
getTopFailingTools,
|
|
69
75
|
getTopUsedTools,
|
|
70
76
|
installFlushOnExit
|
|
71
|
-
} from "./chunk-
|
|
77
|
+
} from "./chunk-IFZX26K7.js";
|
|
72
78
|
import {
|
|
73
79
|
CONTENT_ONLY_STREAM_REMINDER,
|
|
74
80
|
TEE_FINAL_USER_NUDGE,
|
|
@@ -90,7 +96,7 @@ import {
|
|
|
90
96
|
} from "./chunk-XPBEJB27.js";
|
|
91
97
|
import {
|
|
92
98
|
ConfigManager
|
|
93
|
-
} from "./chunk-
|
|
99
|
+
} from "./chunk-NYCBOVNF.js";
|
|
94
100
|
import {
|
|
95
101
|
AuthError,
|
|
96
102
|
ProviderError,
|
|
@@ -116,7 +122,7 @@ import {
|
|
|
116
122
|
SKILLS_DIR_NAME,
|
|
117
123
|
VERSION,
|
|
118
124
|
buildUserIdentityPrompt
|
|
119
|
-
} from "./chunk-
|
|
125
|
+
} from "./chunk-GBBVCZ4W.js";
|
|
120
126
|
import {
|
|
121
127
|
formatGitContextForPrompt,
|
|
122
128
|
getGitContext,
|
|
@@ -933,6 +939,7 @@ function createDefaultCommands() {
|
|
|
933
939
|
["/config [set|get|show]", "Config wizard / get / set / show all"],
|
|
934
940
|
["/profile [show|set|clear]", "View or edit your identity"],
|
|
935
941
|
["/security [status|scan|on|off]", "Sensitive-data redaction"],
|
|
942
|
+
["/hooks [list|trust|untrust]", "Lifecycle hooks and project hook trust"],
|
|
936
943
|
["/doctor", "Health check (API keys, config, MCP, crashes, tool stats)"],
|
|
937
944
|
["/bug [--copy]", "Generate bug report template"],
|
|
938
945
|
["/about", "About ai-cli & author info"],
|
|
@@ -1353,6 +1360,9 @@ No commands match "${filter}".
|
|
|
1353
1360
|
console.log(` Provider : ${ctx.getCurrentProvider()}`);
|
|
1354
1361
|
console.log(` Model : ${currentModel}`);
|
|
1355
1362
|
console.log(` Ctx Win : ${ctxStr}`);
|
|
1363
|
+
console.log(" PermProf : " + (ctx.config.get("defaultPermissionProfile") ?? "legacy"));
|
|
1364
|
+
console.log(" Network : " + (ctx.config.get("networkPolicy")?.enabled ?? false ? "on" : "off"));
|
|
1365
|
+
console.log(" Hooks : " + getPendingHookTrust(ctx.config.get("hooks") ?? void 0, ctx.config.getConfigDir()).length + " pending trust");
|
|
1356
1366
|
console.log(` Messages : ${session?.messages.length ?? 0}`);
|
|
1357
1367
|
console.log(` Session : ${session?.id.slice(0, 8) ?? "none"}`);
|
|
1358
1368
|
if (layers.length > 0) {
|
|
@@ -1646,7 +1656,7 @@ No tools match "${filter}".
|
|
|
1646
1656
|
const { join: join5 } = await import("path");
|
|
1647
1657
|
const { existsSync: existsSync5 } = await import("fs");
|
|
1648
1658
|
const { getGitRoot: getGitRoot2 } = await import("./git-context-EXOEHQSF.js");
|
|
1649
|
-
const { MCP_PROJECT_CONFIG_NAME: MCP_PROJECT_CONFIG_NAME2 } = await import("./constants-
|
|
1659
|
+
const { MCP_PROJECT_CONFIG_NAME: MCP_PROJECT_CONFIG_NAME2 } = await import("./constants-KDWG4KR4.js");
|
|
1650
1660
|
const { approveProject, hashMcpFile } = await import("./project-trust-NKYHL3VZ.js");
|
|
1651
1661
|
const cwd = process.cwd();
|
|
1652
1662
|
const projectRoot = getGitRoot2(cwd) ?? cwd;
|
|
@@ -2705,7 +2715,7 @@ ${hint}` : "")
|
|
|
2705
2715
|
usage: "/test [command|filter]",
|
|
2706
2716
|
async execute(args, ctx) {
|
|
2707
2717
|
try {
|
|
2708
|
-
const { executeTests } = await import("./run-tests-
|
|
2718
|
+
const { executeTests } = await import("./run-tests-H4Q2PRX6.js");
|
|
2709
2719
|
const argStr = args.join(" ").trim();
|
|
2710
2720
|
let testArgs = {};
|
|
2711
2721
|
if (argStr) {
|
|
@@ -3284,6 +3294,71 @@ Summary: ${fileMap.size} file(s) \u2014 ${newFiles} new, ${modifiedFiles} modifi
|
|
|
3284
3294
|
}
|
|
3285
3295
|
}
|
|
3286
3296
|
},
|
|
3297
|
+
{
|
|
3298
|
+
name: "hooks",
|
|
3299
|
+
description: "Manage lifecycle hooks and project hook trust",
|
|
3300
|
+
usage: "/hooks [list|inspect <id>|trust <id>|untrust <id>|disable]",
|
|
3301
|
+
execute(args, ctx) {
|
|
3302
|
+
const sub = (args[0] || "list").toLowerCase();
|
|
3303
|
+
const hooks = listHooks(ctx.config.get("hooks") ?? void 0, ctx.config.getConfigDir());
|
|
3304
|
+
const findHook = (id) => hooks.find((h) => h.id === id || h.hash.startsWith(id ?? ""));
|
|
3305
|
+
if (sub === "list") {
|
|
3306
|
+
console.log(theme.heading(" Hooks"));
|
|
3307
|
+
if (hooks.length === 0) {
|
|
3308
|
+
console.log(theme.dim(" No hooks configured."));
|
|
3309
|
+
} else {
|
|
3310
|
+
for (const h of hooks) {
|
|
3311
|
+
const trust = h.disabled ? theme.dim("disabled") : h.trusted ? theme.success("trusted") : theme.warning("pending");
|
|
3312
|
+
console.log(` ${h.id.padEnd(18)} ${h.source.padEnd(7)} ${trust} ${h.hash.slice(0, 12)} ${theme.dim(h.command.slice(0, 80))}`);
|
|
3313
|
+
}
|
|
3314
|
+
}
|
|
3315
|
+
console.log();
|
|
3316
|
+
return;
|
|
3317
|
+
}
|
|
3318
|
+
if (sub === "inspect") {
|
|
3319
|
+
const h = findHook(args[1]);
|
|
3320
|
+
if (!h) {
|
|
3321
|
+
console.log(theme.warning(" Hook not found. Use /hooks list."));
|
|
3322
|
+
return;
|
|
3323
|
+
}
|
|
3324
|
+
console.log(theme.heading(" Hook"));
|
|
3325
|
+
console.log(` id : ${h.id}`);
|
|
3326
|
+
console.log(` event : ${h.event}`);
|
|
3327
|
+
console.log(` source : ${h.source}`);
|
|
3328
|
+
console.log(` hash : ${h.hash}`);
|
|
3329
|
+
console.log(` trusted : ${h.trusted ? "yes" : "no"}`);
|
|
3330
|
+
console.log(` disabled: ${h.disabled ? "yes" : "no"}`);
|
|
3331
|
+
console.log(` command : ${h.command}`);
|
|
3332
|
+
console.log();
|
|
3333
|
+
return;
|
|
3334
|
+
}
|
|
3335
|
+
if (sub === "trust" || sub === "untrust") {
|
|
3336
|
+
const h = findHook(args[1]);
|
|
3337
|
+
if (!h) {
|
|
3338
|
+
console.log(theme.warning(" Hook not found. Use /hooks list."));
|
|
3339
|
+
return;
|
|
3340
|
+
}
|
|
3341
|
+
if (sub === "trust") {
|
|
3342
|
+
trustHook(ctx.config.getConfigDir(), h);
|
|
3343
|
+
console.log(theme.success(` \u2713 trusted ${h.id} (${h.hash.slice(0, 12)})`));
|
|
3344
|
+
} else {
|
|
3345
|
+
untrustHook(ctx.config.getConfigDir(), h);
|
|
3346
|
+
console.log(theme.success(` \u2713 untrusted ${h.id}`));
|
|
3347
|
+
}
|
|
3348
|
+
console.log();
|
|
3349
|
+
return;
|
|
3350
|
+
}
|
|
3351
|
+
if (sub === "disable") {
|
|
3352
|
+
const cfg = ctx.config.get("hooks") ?? {};
|
|
3353
|
+
ctx.config.set("hooks", { ...cfg, enabled: false });
|
|
3354
|
+
console.log(theme.success(" \u2713 hooks disabled in user config"));
|
|
3355
|
+
console.log();
|
|
3356
|
+
return;
|
|
3357
|
+
}
|
|
3358
|
+
console.log(theme.warning(" Usage: /hooks [list|inspect <id>|trust <id>|untrust <id>|disable]"));
|
|
3359
|
+
console.log();
|
|
3360
|
+
}
|
|
3361
|
+
},
|
|
3287
3362
|
{
|
|
3288
3363
|
name: "security",
|
|
3289
3364
|
description: "Sensitive-data redaction \u2014 status, scan sessions, toggle on/off",
|
|
@@ -3301,6 +3376,9 @@ Summary: ${fileMap.size} file(s) \u2014 ${newFiles} new, ${modifiedFiles} modifi
|
|
|
3301
3376
|
console.log(` redactOnSave : ${security.redactOnSave ? theme.success("on") : theme.warning("off")}`);
|
|
3302
3377
|
console.log(` redactOnSend : ${security.redactOnSend ? theme.success("on") : theme.dim("off")}`);
|
|
3303
3378
|
console.log(` mode : ${security.mode}`);
|
|
3379
|
+
console.log(" profile : " + (ctx.config.get("defaultPermissionProfile") ?? "legacy"));
|
|
3380
|
+
console.log(" network : " + (ctx.config.get("networkPolicy")?.enabled ?? false ? "on" : "off"));
|
|
3381
|
+
console.log(" hooks : " + getPendingHookTrust(ctx.config.get("hooks") ?? void 0, ctx.config.getConfigDir()).length + " pending trust");
|
|
3304
3382
|
console.log(` patterns : ${DEFAULT_PATTERNS.length} built-in + ${security.customPatterns?.length ?? 0} custom`);
|
|
3305
3383
|
console.log(` last save : ${ctx.sessions.lastRedactionHits} hit(s) redacted`);
|
|
3306
3384
|
console.log();
|
|
@@ -4456,11 +4534,24 @@ var Repl = class {
|
|
|
4456
4534
|
this.toolRegistry = new ToolRegistry();
|
|
4457
4535
|
this.toolExecutor = new ToolExecutor(this.toolRegistry);
|
|
4458
4536
|
this.toolExecutor.setReadline(this.rl);
|
|
4537
|
+
const permissionProfileName = this.config.get("defaultPermissionProfile") ?? "legacy";
|
|
4538
|
+
const permissionProfiles = this.config.get("permissionProfiles") ?? {};
|
|
4459
4539
|
this.toolExecutor.setConfig({
|
|
4460
4540
|
hookConfig: this.config.get("hooks") ?? void 0,
|
|
4541
|
+
hookConfigDir: this.config.getConfigDir(),
|
|
4461
4542
|
permissionRules: this.config.get("permissionRules") ?? [],
|
|
4462
|
-
defaultPermission: this.config.get("defaultPermission") ?? "confirm"
|
|
4543
|
+
defaultPermission: this.config.get("defaultPermission") ?? "confirm",
|
|
4544
|
+
permissionProfileName,
|
|
4545
|
+
permissionProfile: permissionProfiles[permissionProfileName],
|
|
4546
|
+
allowedPermissionProfiles: this.config.get("allowedPermissionProfiles") ?? [],
|
|
4547
|
+
workspaceRoot: process.cwd(),
|
|
4548
|
+
networkPolicy: this.config.get("networkPolicy")
|
|
4463
4549
|
});
|
|
4550
|
+
const pendingHooks = getPendingHookTrust(this.config.get("hooks") ?? void 0, this.config.getConfigDir());
|
|
4551
|
+
if (pendingHooks.length > 0) {
|
|
4552
|
+
process.stderr.write(theme.warning(" \u26A0 " + pendingHooks.length + " project hook(s) require trust. Run /hooks list and /hooks trust <id>.\n"));
|
|
4553
|
+
}
|
|
4554
|
+
runLifecycleHooks(this.config.get("hooks") ?? void 0, "SessionStart", { source: "repl" }, { configDir: this.config.getConfigDir() });
|
|
4464
4555
|
if (this.config.get("alwaysYolo") === true) {
|
|
4465
4556
|
this.toolExecutor.sessionAutoApprove = true;
|
|
4466
4557
|
}
|
|
@@ -4932,6 +5023,21 @@ ${skillContent}`);
|
|
|
4932
5023
|
);
|
|
4933
5024
|
return false;
|
|
4934
5025
|
}
|
|
5026
|
+
const preDecisions = runLifecycleHooks(
|
|
5027
|
+
this.config.get("hooks") ?? void 0,
|
|
5028
|
+
"PreCompact",
|
|
5029
|
+
{ sessionId: session.id, messageCount: session.messages.length, instruction },
|
|
5030
|
+
{ configDir: this.config.getConfigDir(), onSummary: (msg) => process.stdout.write(theme.dim(" [hook] " + msg) + "\n") }
|
|
5031
|
+
);
|
|
5032
|
+
const preDeny = preDecisions.find((d) => d.action === "deny");
|
|
5033
|
+
if (preDeny) {
|
|
5034
|
+
process.stdout.write(theme.warning(" \u26A0 Compact blocked by hook: " + (preDeny.reason ?? "PreCompact denied") + "\n"));
|
|
5035
|
+
return false;
|
|
5036
|
+
}
|
|
5037
|
+
for (const d of preDecisions) {
|
|
5038
|
+
const warnings = [d.warning, ...d.warnings ?? []].filter(Boolean);
|
|
5039
|
+
for (const w of warnings) process.stdout.write(theme.warning(" \u26A0 Hook warning: " + w + "\n"));
|
|
5040
|
+
}
|
|
4935
5041
|
const provider = this.providers.get(this.currentProvider);
|
|
4936
5042
|
const modelParams = this.getModelParams();
|
|
4937
5043
|
const spinner = this.renderer.showSpinner("Compacting session...");
|
|
@@ -4993,6 +5099,12 @@ ${response.content.trim()}
|
|
|
4993
5099
|
const tokensBefore = ctxWindow > 0 ? this.estimateConversationTokens() : 0;
|
|
4994
5100
|
const removedCount = session.compact(summaryMsg, ackMsg, COMPACT_KEEP_LAST);
|
|
4995
5101
|
const afterCount = session.messages.length;
|
|
5102
|
+
runLifecycleHooks(
|
|
5103
|
+
this.config.get("hooks") ?? void 0,
|
|
5104
|
+
"PostCompact",
|
|
5105
|
+
{ sessionId: session.id, beforeCount, afterCount, removedCount, keepLast: COMPACT_KEEP_LAST, instruction },
|
|
5106
|
+
{ configDir: this.config.getConfigDir(), onSummary: (msg) => process.stdout.write(theme.dim(" [hook] " + msg) + "\n") }
|
|
5107
|
+
);
|
|
4996
5108
|
const tokensAfter = ctxWindow > 0 ? this.estimateConversationTokens() : 0;
|
|
4997
5109
|
const pctBefore = ctxWindow > 0 ? Math.round(tokensBefore / ctxWindow * 100) : 0;
|
|
4998
5110
|
const pctAfter = ctxWindow > 0 ? Math.round(tokensAfter / ctxWindow * 100) : 0;
|
|
@@ -5130,6 +5242,11 @@ Session '${this.resumeSessionId}' not found.
|
|
|
5130
5242
|
theme.warning(" \u26A1 YOLO mode ON (alwaysYolo=true in config) \u2014 write tools auto-approved; destructive tools still require confirmation.\n")
|
|
5131
5243
|
);
|
|
5132
5244
|
}
|
|
5245
|
+
const permissionProfileWarning = formatPermissionProfileWarning(this.config.get("defaultPermissionProfile") ?? "legacy");
|
|
5246
|
+
if (permissionProfileWarning) {
|
|
5247
|
+
process.stdout.write(theme.warning(` ${permissionProfileWarning}
|
|
5248
|
+
`));
|
|
5249
|
+
}
|
|
5133
5250
|
const cfgOutputCap = this.config.get("maxToolOutputChars");
|
|
5134
5251
|
if (typeof cfgOutputCap === "number" && cfgOutputCap > 0) setMaxOutputCap(cfgOutputCap);
|
|
5135
5252
|
if (welcomeModelInfo?.contextWindow) setContextWindow(welcomeModelInfo.contextWindow);
|
|
@@ -5423,8 +5540,32 @@ Session '${this.resumeSessionId}' not found.
|
|
|
5423
5540
|
});
|
|
5424
5541
|
});
|
|
5425
5542
|
}
|
|
5543
|
+
runUserPromptHooks(sessionId, userInput) {
|
|
5544
|
+
const promptDecisions = runLifecycleHooks(
|
|
5545
|
+
this.config.get("hooks") ?? void 0,
|
|
5546
|
+
"UserPromptSubmit",
|
|
5547
|
+
{ sessionId, prompt: userInput },
|
|
5548
|
+
{ configDir: this.config.getConfigDir(), onSummary: (msg) => process.stdout.write(theme.dim(" [hook] " + msg) + "\n") }
|
|
5549
|
+
);
|
|
5550
|
+
const promptDeny = promptDecisions.find((d) => d.action === "deny");
|
|
5551
|
+
if (promptDeny) {
|
|
5552
|
+
process.stdout.write(theme.warning(" \u26A0 Prompt blocked by hook: " + (promptDeny.reason ?? "UserPromptSubmit denied") + "\n"));
|
|
5553
|
+
return false;
|
|
5554
|
+
}
|
|
5555
|
+
for (const d of promptDecisions) {
|
|
5556
|
+
const warnings = [d.warning, ...d.warnings ?? []].filter(Boolean);
|
|
5557
|
+
for (const w of warnings) process.stdout.write(theme.warning(" \u26A0 Hook warning: " + w + "\n"));
|
|
5558
|
+
}
|
|
5559
|
+
const secretHits = scanString(userInput, { customRegexes: [] });
|
|
5560
|
+
if (secretHits.length > 0) {
|
|
5561
|
+
const kinds = [...new Set(secretHits.map((h) => h.kind))].join(", ");
|
|
5562
|
+
process.stdout.write(theme.warning(" \u26A0 Possible secret in prompt (" + kinds + "). It will be sent unless you interrupt now.\n"));
|
|
5563
|
+
}
|
|
5564
|
+
return true;
|
|
5565
|
+
}
|
|
5426
5566
|
async handleChat(userInput) {
|
|
5427
5567
|
const session = this.sessions.current;
|
|
5568
|
+
if (!this.runUserPromptHooks(session.id, userInput)) return;
|
|
5428
5569
|
const { parts, hasImage, refs } = parseAtReferences(userInput, process.cwd());
|
|
5429
5570
|
for (const ref of refs) {
|
|
5430
5571
|
if (ref.type === "notfound") {
|
|
@@ -6889,6 +7030,7 @@ Tip: You can continue the conversation by asking the AI to proceed.`
|
|
|
6889
7030
|
void this.shutdownAsync();
|
|
6890
7031
|
}
|
|
6891
7032
|
async shutdownAsync() {
|
|
7033
|
+
runLifecycleHooks(this.config.get("hooks") ?? void 0, "Stop", { sessionId: this.sessions.current?.id }, { configDir: this.config.getConfigDir() });
|
|
6892
7034
|
this.running = false;
|
|
6893
7035
|
const sessionId = this.sessions.current?.id;
|
|
6894
7036
|
if (sessionId) {
|
|
@@ -7003,7 +7145,7 @@ program.command("web").description("Start Web UI server with browser-based chat
|
|
|
7003
7145
|
console.error("Error: Invalid port number. Must be between 1 and 65535.");
|
|
7004
7146
|
process.exit(1);
|
|
7005
7147
|
}
|
|
7006
|
-
const { startWebServer } = await import("./server-
|
|
7148
|
+
const { startWebServer } = await import("./server-VNCN7AY5.js");
|
|
7007
7149
|
await startWebServer({ port, host: options.host });
|
|
7008
7150
|
});
|
|
7009
7151
|
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) => {
|
|
@@ -7170,16 +7312,16 @@ program.command("sessions").description("List recent conversation sessions").opt
|
|
|
7170
7312
|
console.log(footer + "\n");
|
|
7171
7313
|
});
|
|
7172
7314
|
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) => {
|
|
7173
|
-
const { runUsageCli } = await import("./usage-
|
|
7315
|
+
const { runUsageCli } = await import("./usage-LB6REWPO.js");
|
|
7174
7316
|
await runUsageCli(options);
|
|
7175
7317
|
});
|
|
7176
7318
|
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) => {
|
|
7177
|
-
const { runDoctorCli } = await import("./doctor-cli-
|
|
7319
|
+
const { runDoctorCli } = await import("./doctor-cli-TJTWIW7U.js");
|
|
7178
7320
|
await runDoctorCli({ json: !!options.json, resetStats: !!options.resetStats });
|
|
7179
7321
|
});
|
|
7180
7322
|
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) => {
|
|
7181
7323
|
try {
|
|
7182
|
-
const batch = await import("./batch-
|
|
7324
|
+
const batch = await import("./batch-WIKFEOAZ.js");
|
|
7183
7325
|
switch (action) {
|
|
7184
7326
|
case "submit":
|
|
7185
7327
|
if (!arg) {
|
|
@@ -7222,7 +7364,7 @@ program.command("batch <action> [arg] [arg2]").description("Anthropic Message Ba
|
|
|
7222
7364
|
}
|
|
7223
7365
|
});
|
|
7224
7366
|
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) => {
|
|
7225
|
-
const { startMcpServer } = await import("./server-
|
|
7367
|
+
const { startMcpServer } = await import("./server-OFKGDRYI.js");
|
|
7226
7368
|
await startMcpServer({
|
|
7227
7369
|
allowDestructive: !!options.allowDestructive,
|
|
7228
7370
|
allowOutsideCwd: !!options.allowOutsideCwd,
|
|
@@ -7231,7 +7373,7 @@ program.command("mcp-serve").description("Start an MCP server over STDIO, exposi
|
|
|
7231
7373
|
});
|
|
7232
7374
|
});
|
|
7233
7375
|
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; diff fetched via `gh pr diff <num>`", (v) => parseInt(v, 10)).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)").action(async (options) => {
|
|
7234
|
-
const { runCi } = await import("./ci-
|
|
7376
|
+
const { runCi } = await import("./ci-X3LNUFZV.js");
|
|
7235
7377
|
const result = await runCi({
|
|
7236
7378
|
pr: options.pr,
|
|
7237
7379
|
base: options.base,
|
|
@@ -7377,7 +7519,7 @@ program.command("hub [topic]").description("Start multi-agent hub (discuss / bra
|
|
|
7377
7519
|
}),
|
|
7378
7520
|
config.get("customProviders")
|
|
7379
7521
|
);
|
|
7380
|
-
const { startHub } = await import("./hub-
|
|
7522
|
+
const { startHub } = await import("./hub-JWSV4MKC.js");
|
|
7381
7523
|
await startHub(
|
|
7382
7524
|
{
|
|
7383
7525
|
topic: topic ?? "",
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import {
|
|
3
3
|
ToolRegistry
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-N5LB3PPL.js";
|
|
5
5
|
import "./chunk-T2NL5ZIA.js";
|
|
6
6
|
import "./chunk-BXP6YZ2P.js";
|
|
7
|
-
import "./chunk-
|
|
7
|
+
import "./chunk-HX6N6QEY.js";
|
|
8
8
|
import {
|
|
9
9
|
runTool
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-IFZX26K7.js";
|
|
11
11
|
import {
|
|
12
12
|
getDangerLevel,
|
|
13
13
|
schemaToJsonSchema
|
|
@@ -15,7 +15,7 @@ import {
|
|
|
15
15
|
import "./chunk-TZQHYZKT.js";
|
|
16
16
|
import {
|
|
17
17
|
VERSION
|
|
18
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-GBBVCZ4W.js";
|
|
19
19
|
import "./chunk-4BKXL7SM.js";
|
|
20
20
|
import "./chunk-TB4W4Y4T.js";
|
|
21
21
|
import "./chunk-KHYD3WXE.js";
|