jinzd-ai-cli 0.4.212 → 0.4.213
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 +7 -0
- package/README.zh-CN.md +7 -0
- package/dist/{batch-WIKFEOAZ.js → batch-PKY63TME.js} +2 -2
- package/dist/{chunk-IFZX26K7.js → chunk-7NTFMLJJ.js} +1 -1
- package/dist/{chunk-HW2ALWQJ.js → chunk-FGUKBIYO.js} +2 -2
- package/dist/{chunk-LU6FBJQ5.js → chunk-G3PW3AOB.js} +1 -1
- package/dist/{chunk-GBBVCZ4W.js → chunk-IWLVH32D.js} +1 -1
- package/dist/{chunk-KE4B3NOQ.js → chunk-J35V3IAH.js} +1 -1
- package/dist/{chunk-NYCBOVNF.js → chunk-MRGWPCFQ.js} +1 -1
- package/dist/{chunk-N5LB3PPL.js → chunk-THNECAAY.js} +250 -59
- package/dist/{chunk-HX6N6QEY.js → chunk-UDMU4FUF.js} +1 -1
- package/dist/{ci-X3LNUFZV.js → ci-HBZ6CIW5.js} +2 -2
- package/dist/{constants-KDWG4KR4.js → constants-CAUBTSFW.js} +1 -1
- package/dist/{doctor-cli-TJTWIW7U.js → doctor-cli-5Z5UWYW6.js} +4 -4
- package/dist/electron-server.js +473 -214
- package/dist/{hub-JWSV4MKC.js → hub-ZRADBR76.js} +1 -1
- package/dist/index.js +79 -18
- package/dist/{run-tests-D7YBY4XB.js → run-tests-7J3PNWVS.js} +1 -1
- package/dist/{run-tests-H4Q2PRX6.js → run-tests-DSOJBJWA.js} +2 -2
- package/dist/{server-OFKGDRYI.js → server-PWBWHVYB.js} +4 -4
- package/dist/{server-VNCN7AY5.js → server-U4I7RI42.js} +83 -7
- package/dist/{task-orchestrator-AL2E642M.js → task-orchestrator-RUXWRMQV.js} +4 -4
- package/dist/{usage-LB6REWPO.js → usage-2P6TIBTN.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-RUXWRMQV.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-FGUKBIYO.js";
|
|
19
19
|
import {
|
|
20
20
|
buildReviewPrompt,
|
|
21
21
|
buildSecurityReviewPrompt
|
|
@@ -25,9 +25,11 @@ import {
|
|
|
25
25
|
ToolRegistry,
|
|
26
26
|
askUserContext,
|
|
27
27
|
cleanupRejectedTeeFile,
|
|
28
|
+
clearRecentlyDeniedAutoActions,
|
|
28
29
|
estimateTokens,
|
|
29
30
|
formatPermissionProfileWarning,
|
|
30
31
|
getPendingHookTrust,
|
|
32
|
+
getRecentlyDeniedAutoActions,
|
|
31
33
|
googleSearchContext,
|
|
32
34
|
initTheme,
|
|
33
35
|
isInterrupted,
|
|
@@ -45,10 +47,10 @@ import {
|
|
|
45
47
|
trustHook,
|
|
46
48
|
undoStack,
|
|
47
49
|
untrustHook
|
|
48
|
-
} from "./chunk-
|
|
50
|
+
} from "./chunk-THNECAAY.js";
|
|
49
51
|
import "./chunk-T2NL5ZIA.js";
|
|
50
52
|
import "./chunk-BXP6YZ2P.js";
|
|
51
|
-
import "./chunk-
|
|
53
|
+
import "./chunk-UDMU4FUF.js";
|
|
52
54
|
import {
|
|
53
55
|
SessionManager,
|
|
54
56
|
getContentText
|
|
@@ -65,7 +67,7 @@ import {
|
|
|
65
67
|
getConfigDirUsage,
|
|
66
68
|
listRecentCrashes,
|
|
67
69
|
writeCrashLog
|
|
68
|
-
} from "./chunk-
|
|
70
|
+
} from "./chunk-G3PW3AOB.js";
|
|
69
71
|
import {
|
|
70
72
|
ProviderRegistry
|
|
71
73
|
} from "./chunk-QMXC327F.js";
|
|
@@ -74,7 +76,7 @@ import {
|
|
|
74
76
|
getTopFailingTools,
|
|
75
77
|
getTopUsedTools,
|
|
76
78
|
installFlushOnExit
|
|
77
|
-
} from "./chunk-
|
|
79
|
+
} from "./chunk-7NTFMLJJ.js";
|
|
78
80
|
import {
|
|
79
81
|
CONTENT_ONLY_STREAM_REMINDER,
|
|
80
82
|
TEE_FINAL_USER_NUDGE,
|
|
@@ -96,7 +98,7 @@ import {
|
|
|
96
98
|
} from "./chunk-XPBEJB27.js";
|
|
97
99
|
import {
|
|
98
100
|
ConfigManager
|
|
99
|
-
} from "./chunk-
|
|
101
|
+
} from "./chunk-MRGWPCFQ.js";
|
|
100
102
|
import {
|
|
101
103
|
AuthError,
|
|
102
104
|
ProviderError,
|
|
@@ -122,7 +124,7 @@ import {
|
|
|
122
124
|
SKILLS_DIR_NAME,
|
|
123
125
|
VERSION,
|
|
124
126
|
buildUserIdentityPrompt
|
|
125
|
-
} from "./chunk-
|
|
127
|
+
} from "./chunk-IWLVH32D.js";
|
|
126
128
|
import {
|
|
127
129
|
formatGitContextForPrompt,
|
|
128
130
|
getGitContext,
|
|
@@ -879,7 +881,9 @@ function createDefaultCommands() {
|
|
|
879
881
|
["/route [on|off|show|test <msg>]", "Smart model routing rules"],
|
|
880
882
|
["/think [on|off|status]", "Toggle Extended Thinking (deep reasoning)"],
|
|
881
883
|
["/plan [execute|exit|status]", "Enter/manage Plan Mode (read-only)"],
|
|
882
|
-
["/
|
|
884
|
+
["/auto [on|off|status]", "Rule-based low-risk auto approval"],
|
|
885
|
+
["/permissions recently-denied|clear-denied", "Inspect permission and Auto Mode decisions"],
|
|
886
|
+
["/yolo [on|off]", "Toggle write auto-approve (destructive still confirms)"]
|
|
883
887
|
]
|
|
884
888
|
},
|
|
885
889
|
{
|
|
@@ -1362,6 +1366,7 @@ No commands match "${filter}".
|
|
|
1362
1366
|
console.log(` Ctx Win : ${ctxStr}`);
|
|
1363
1367
|
console.log(" PermProf : " + (ctx.config.get("defaultPermissionProfile") ?? "legacy"));
|
|
1364
1368
|
console.log(" Network : " + (ctx.config.get("networkPolicy")?.enabled ?? false ? "on" : "off"));
|
|
1369
|
+
console.log(" AutoMode : " + (ctx.getToolExecutor().sessionAutoMode ? "on" : "off"));
|
|
1365
1370
|
console.log(" Hooks : " + getPendingHookTrust(ctx.config.get("hooks") ?? void 0, ctx.config.getConfigDir()).length + " pending trust");
|
|
1366
1371
|
console.log(` Messages : ${session?.messages.length ?? 0}`);
|
|
1367
1372
|
console.log(` Session : ${session?.id.slice(0, 8) ?? "none"}`);
|
|
@@ -1656,7 +1661,7 @@ No tools match "${filter}".
|
|
|
1656
1661
|
const { join: join5 } = await import("path");
|
|
1657
1662
|
const { existsSync: existsSync5 } = await import("fs");
|
|
1658
1663
|
const { getGitRoot: getGitRoot2 } = await import("./git-context-EXOEHQSF.js");
|
|
1659
|
-
const { MCP_PROJECT_CONFIG_NAME: MCP_PROJECT_CONFIG_NAME2 } = await import("./constants-
|
|
1664
|
+
const { MCP_PROJECT_CONFIG_NAME: MCP_PROJECT_CONFIG_NAME2 } = await import("./constants-CAUBTSFW.js");
|
|
1660
1665
|
const { approveProject, hashMcpFile } = await import("./project-trust-NKYHL3VZ.js");
|
|
1661
1666
|
const cwd = process.cwd();
|
|
1662
1667
|
const projectRoot = getGitRoot2(cwd) ?? cwd;
|
|
@@ -2715,7 +2720,7 @@ ${hint}` : "")
|
|
|
2715
2720
|
usage: "/test [command|filter]",
|
|
2716
2721
|
async execute(args, ctx) {
|
|
2717
2722
|
try {
|
|
2718
|
-
const { executeTests } = await import("./run-tests-
|
|
2723
|
+
const { executeTests } = await import("./run-tests-DSOJBJWA.js");
|
|
2719
2724
|
const argStr = args.join(" ").trim();
|
|
2720
2725
|
let testArgs = {};
|
|
2721
2726
|
if (argStr) {
|
|
@@ -3378,6 +3383,7 @@ Summary: ${fileMap.size} file(s) \u2014 ${newFiles} new, ${modifiedFiles} modifi
|
|
|
3378
3383
|
console.log(` mode : ${security.mode}`);
|
|
3379
3384
|
console.log(" profile : " + (ctx.config.get("defaultPermissionProfile") ?? "legacy"));
|
|
3380
3385
|
console.log(" network : " + (ctx.config.get("networkPolicy")?.enabled ?? false ? "on" : "off"));
|
|
3386
|
+
console.log(" autoMode : " + (ctx.getToolExecutor().sessionAutoMode ? "on" : "off"));
|
|
3381
3387
|
console.log(" hooks : " + getPendingHookTrust(ctx.config.get("hooks") ?? void 0, ctx.config.getConfigDir()).length + " pending trust");
|
|
3382
3388
|
console.log(` patterns : ${DEFAULT_PATTERNS.length} built-in + ${security.customPatterns?.length ?? 0} custom`);
|
|
3383
3389
|
console.log(` last save : ${ctx.sessions.lastRedactionHits} hit(s) redacted`);
|
|
@@ -3450,9 +3456,64 @@ Summary: ${fileMap.size} file(s) \u2014 ${newFiles} new, ${modifiedFiles} modifi
|
|
|
3450
3456
|
console.log();
|
|
3451
3457
|
}
|
|
3452
3458
|
},
|
|
3459
|
+
{
|
|
3460
|
+
name: "auto",
|
|
3461
|
+
description: "Toggle rule-based Auto Mode for low-risk actions",
|
|
3462
|
+
usage: "/auto [on|off|status]",
|
|
3463
|
+
execute(args, ctx) {
|
|
3464
|
+
const sub = args[0]?.toLowerCase() ?? "status";
|
|
3465
|
+
const executor = ctx.getToolExecutor();
|
|
3466
|
+
if (sub === "on") {
|
|
3467
|
+
executor.sessionAutoMode = true;
|
|
3468
|
+
console.log(theme.warning(" \u26A1 Auto Mode ON \u2014 low-risk actions may auto-run; high-risk actions still confirm or deny."));
|
|
3469
|
+
console.log(theme.dim(" Auto Mode is session-scoped and is not enabled by project config."));
|
|
3470
|
+
} else if (sub === "off") {
|
|
3471
|
+
executor.sessionAutoMode = false;
|
|
3472
|
+
console.log(theme.info(" Auto Mode disabled."));
|
|
3473
|
+
} else if (sub === "status") {
|
|
3474
|
+
console.log(` Auto Mode : ${executor.sessionAutoMode ? theme.warning("on") : theme.dim("off")}`);
|
|
3475
|
+
console.log(theme.dim(" Scope : current session only"));
|
|
3476
|
+
console.log(theme.dim(" Denied : /permissions recently-denied"));
|
|
3477
|
+
} else {
|
|
3478
|
+
console.log(theme.warning(" Usage: /auto [on|off|status]"));
|
|
3479
|
+
}
|
|
3480
|
+
console.log();
|
|
3481
|
+
}
|
|
3482
|
+
},
|
|
3483
|
+
{
|
|
3484
|
+
name: "permissions",
|
|
3485
|
+
description: "Inspect permission and Auto Mode decisions",
|
|
3486
|
+
usage: "/permissions recently-denied|clear-denied",
|
|
3487
|
+
execute(args) {
|
|
3488
|
+
const sub = args[0]?.toLowerCase() ?? "recently-denied";
|
|
3489
|
+
if (sub === "recently-denied") {
|
|
3490
|
+
const rows = getRecentlyDeniedAutoActions();
|
|
3491
|
+
if (rows.length === 0) {
|
|
3492
|
+
console.log(theme.success(" No recently denied Auto Mode actions."));
|
|
3493
|
+
} else {
|
|
3494
|
+
console.log(theme.warning(` Recently denied Auto Mode actions (${rows.length})`));
|
|
3495
|
+
for (const r of rows.slice(0, 20)) {
|
|
3496
|
+
console.log(` - ${r.timestamp} ${theme.error(r.tool)} ${theme.dim(r.ruleId)}`);
|
|
3497
|
+
console.log(` ${r.reason}`);
|
|
3498
|
+
console.log(theme.dim(` ${r.argsPreview}`));
|
|
3499
|
+
}
|
|
3500
|
+
}
|
|
3501
|
+
console.log();
|
|
3502
|
+
return;
|
|
3503
|
+
}
|
|
3504
|
+
if (sub === "clear-denied") {
|
|
3505
|
+
clearRecentlyDeniedAutoActions();
|
|
3506
|
+
console.log(theme.info(" Cleared recently denied Auto Mode actions."));
|
|
3507
|
+
console.log();
|
|
3508
|
+
return;
|
|
3509
|
+
}
|
|
3510
|
+
console.log(theme.warning(" Usage: /permissions recently-denied|clear-denied"));
|
|
3511
|
+
console.log();
|
|
3512
|
+
}
|
|
3513
|
+
},
|
|
3453
3514
|
{
|
|
3454
3515
|
name: "yolo",
|
|
3455
|
-
description: "Toggle session auto-approve
|
|
3516
|
+
description: "Toggle session auto-approve for write tools (/yolo)",
|
|
3456
3517
|
usage: "/yolo [on|off]",
|
|
3457
3518
|
execute(args, ctx) {
|
|
3458
3519
|
const sub = args[0]?.toLowerCase();
|
|
@@ -7145,7 +7206,7 @@ program.command("web").description("Start Web UI server with browser-based chat
|
|
|
7145
7206
|
console.error("Error: Invalid port number. Must be between 1 and 65535.");
|
|
7146
7207
|
process.exit(1);
|
|
7147
7208
|
}
|
|
7148
|
-
const { startWebServer } = await import("./server-
|
|
7209
|
+
const { startWebServer } = await import("./server-U4I7RI42.js");
|
|
7149
7210
|
await startWebServer({ port, host: options.host });
|
|
7150
7211
|
});
|
|
7151
7212
|
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) => {
|
|
@@ -7312,16 +7373,16 @@ program.command("sessions").description("List recent conversation sessions").opt
|
|
|
7312
7373
|
console.log(footer + "\n");
|
|
7313
7374
|
});
|
|
7314
7375
|
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) => {
|
|
7315
|
-
const { runUsageCli } = await import("./usage-
|
|
7376
|
+
const { runUsageCli } = await import("./usage-2P6TIBTN.js");
|
|
7316
7377
|
await runUsageCli(options);
|
|
7317
7378
|
});
|
|
7318
7379
|
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) => {
|
|
7319
|
-
const { runDoctorCli } = await import("./doctor-cli-
|
|
7380
|
+
const { runDoctorCli } = await import("./doctor-cli-5Z5UWYW6.js");
|
|
7320
7381
|
await runDoctorCli({ json: !!options.json, resetStats: !!options.resetStats });
|
|
7321
7382
|
});
|
|
7322
7383
|
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) => {
|
|
7323
7384
|
try {
|
|
7324
|
-
const batch = await import("./batch-
|
|
7385
|
+
const batch = await import("./batch-PKY63TME.js");
|
|
7325
7386
|
switch (action) {
|
|
7326
7387
|
case "submit":
|
|
7327
7388
|
if (!arg) {
|
|
@@ -7364,7 +7425,7 @@ program.command("batch <action> [arg] [arg2]").description("Anthropic Message Ba
|
|
|
7364
7425
|
}
|
|
7365
7426
|
});
|
|
7366
7427
|
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) => {
|
|
7367
|
-
const { startMcpServer } = await import("./server-
|
|
7428
|
+
const { startMcpServer } = await import("./server-PWBWHVYB.js");
|
|
7368
7429
|
await startMcpServer({
|
|
7369
7430
|
allowDestructive: !!options.allowDestructive,
|
|
7370
7431
|
allowOutsideCwd: !!options.allowOutsideCwd,
|
|
@@ -7373,7 +7434,7 @@ program.command("mcp-serve").description("Start an MCP server over STDIO, exposi
|
|
|
7373
7434
|
});
|
|
7374
7435
|
});
|
|
7375
7436
|
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) => {
|
|
7376
|
-
const { runCi } = await import("./ci-
|
|
7437
|
+
const { runCi } = await import("./ci-HBZ6CIW5.js");
|
|
7377
7438
|
const result = await runCi({
|
|
7378
7439
|
pr: options.pr,
|
|
7379
7440
|
base: options.base,
|
|
@@ -7519,7 +7580,7 @@ program.command("hub [topic]").description("Start multi-agent hub (discuss / bra
|
|
|
7519
7580
|
}),
|
|
7520
7581
|
config.get("customProviders")
|
|
7521
7582
|
);
|
|
7522
|
-
const { startHub } = await import("./hub-
|
|
7583
|
+
const { startHub } = await import("./hub-ZRADBR76.js");
|
|
7523
7584
|
await startHub(
|
|
7524
7585
|
{
|
|
7525
7586
|
topic: topic ?? "",
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import {
|
|
3
3
|
ToolRegistry
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-THNECAAY.js";
|
|
5
5
|
import "./chunk-T2NL5ZIA.js";
|
|
6
6
|
import "./chunk-BXP6YZ2P.js";
|
|
7
|
-
import "./chunk-
|
|
7
|
+
import "./chunk-UDMU4FUF.js";
|
|
8
8
|
import {
|
|
9
9
|
runTool
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-7NTFMLJJ.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-IWLVH32D.js";
|
|
19
19
|
import "./chunk-4BKXL7SM.js";
|
|
20
20
|
import "./chunk-TB4W4Y4T.js";
|
|
21
21
|
import "./chunk-KHYD3WXE.js";
|
|
@@ -24,7 +24,7 @@ import {
|
|
|
24
24
|
scanDirTree,
|
|
25
25
|
scanProject,
|
|
26
26
|
setupProxy
|
|
27
|
-
} from "./chunk-
|
|
27
|
+
} from "./chunk-FGUKBIYO.js";
|
|
28
28
|
import {
|
|
29
29
|
buildReviewPrompt,
|
|
30
30
|
buildSecurityReviewPrompt
|
|
@@ -36,11 +36,15 @@ import {
|
|
|
36
36
|
checkNetworkPolicy,
|
|
37
37
|
checkPermissionWithProfile,
|
|
38
38
|
cleanupRejectedTeeFile,
|
|
39
|
+
clearRecentlyDeniedAutoActions,
|
|
40
|
+
defaultActionClassifier,
|
|
39
41
|
estimateTokens,
|
|
40
42
|
formatPermissionProfileWarning,
|
|
41
43
|
getPendingHookTrust,
|
|
44
|
+
getRecentlyDeniedAutoActions,
|
|
42
45
|
googleSearchContext,
|
|
43
46
|
groupCallsByPhase,
|
|
47
|
+
recordRecentlyDeniedAutoAction,
|
|
44
48
|
renderDiff,
|
|
45
49
|
runHook,
|
|
46
50
|
runLifecycleHooks,
|
|
@@ -51,10 +55,10 @@ import {
|
|
|
51
55
|
spawnAgentContext,
|
|
52
56
|
truncateOutput,
|
|
53
57
|
undoStack
|
|
54
|
-
} from "./chunk-
|
|
58
|
+
} from "./chunk-THNECAAY.js";
|
|
55
59
|
import "./chunk-T2NL5ZIA.js";
|
|
56
60
|
import "./chunk-BXP6YZ2P.js";
|
|
57
|
-
import "./chunk-
|
|
61
|
+
import "./chunk-UDMU4FUF.js";
|
|
58
62
|
import {
|
|
59
63
|
SessionManager,
|
|
60
64
|
getContentText
|
|
@@ -68,7 +72,7 @@ import {
|
|
|
68
72
|
} from "./chunk-QMXC327F.js";
|
|
69
73
|
import {
|
|
70
74
|
runTool
|
|
71
|
-
} from "./chunk-
|
|
75
|
+
} from "./chunk-7NTFMLJJ.js";
|
|
72
76
|
import {
|
|
73
77
|
CONTENT_ONLY_STREAM_REMINDER,
|
|
74
78
|
TEE_FINAL_USER_NUDGE,
|
|
@@ -87,7 +91,7 @@ import {
|
|
|
87
91
|
} from "./chunk-XPBEJB27.js";
|
|
88
92
|
import {
|
|
89
93
|
ConfigManager
|
|
90
|
-
} from "./chunk-
|
|
94
|
+
} from "./chunk-MRGWPCFQ.js";
|
|
91
95
|
import "./chunk-TZQHYZKT.js";
|
|
92
96
|
import {
|
|
93
97
|
AGENTIC_BEHAVIOR_GUIDELINE,
|
|
@@ -106,7 +110,7 @@ import {
|
|
|
106
110
|
SKILLS_DIR_NAME,
|
|
107
111
|
VERSION,
|
|
108
112
|
buildUserIdentityPrompt
|
|
109
|
-
} from "./chunk-
|
|
113
|
+
} from "./chunk-IWLVH32D.js";
|
|
110
114
|
import {
|
|
111
115
|
formatGitContextForPrompt,
|
|
112
116
|
getGitContext,
|
|
@@ -164,6 +168,8 @@ var ToolExecutorWeb = class _ToolExecutorWeb {
|
|
|
164
168
|
confirming = false;
|
|
165
169
|
/** Session-level auto-approve toggle (/yolo command) */
|
|
166
170
|
sessionAutoApprove = false;
|
|
171
|
+
/** Session-level Auto Mode: rule-based low-risk auto approval. */
|
|
172
|
+
sessionAutoMode = false;
|
|
167
173
|
/** Track tool start times for duration calculation */
|
|
168
174
|
toolStartTimes = /* @__PURE__ */ new Map();
|
|
169
175
|
/**
|
|
@@ -441,6 +447,35 @@ var ToolExecutorWeb = class _ToolExecutorWeb {
|
|
|
441
447
|
}
|
|
442
448
|
}
|
|
443
449
|
this.sendToolCallStart(call);
|
|
450
|
+
if (this.sessionAutoMode && networkPermission?.action !== "confirm") {
|
|
451
|
+
const classification = defaultActionClassifier.classify(call, dangerLevel, {
|
|
452
|
+
workspaceRoot: this.workspaceRoot,
|
|
453
|
+
tempDirs: [tmpdir()]
|
|
454
|
+
});
|
|
455
|
+
if (classification.decision === "deny") {
|
|
456
|
+
recordRecentlyDeniedAutoAction(call, classification);
|
|
457
|
+
const rejectionMsg = `[Auto denied] ${classification.reason}. Do not retry without asking.`;
|
|
458
|
+
this.sendToolCallResult(call, rejectionMsg, true);
|
|
459
|
+
return { callId: call.id, content: rejectionMsg, isError: true };
|
|
460
|
+
}
|
|
461
|
+
if (classification.decision === "auto-approve") {
|
|
462
|
+
this.send({ type: "info", message: `\u26A1 Auto-approved (/auto: ${classification.ruleId})` });
|
|
463
|
+
try {
|
|
464
|
+
const rawContent = await runTool(tool, call.arguments, call.name);
|
|
465
|
+
const content = truncateOutput(rawContent, call.name);
|
|
466
|
+
this.sendToolCallResult(call, rawContent, false);
|
|
467
|
+
runHook(this.hookConfig?.postToolExecution, { tool: call.name, status: "ok" });
|
|
468
|
+
runLifecycleHooks(this.hookConfig, "PostToolUse", { tool: call.name, status: "ok" }, { configDir: this.hookConfigDir });
|
|
469
|
+
return { callId: call.id, content, isError: false };
|
|
470
|
+
} catch (err) {
|
|
471
|
+
const message = err instanceof Error ? err.message : String(err);
|
|
472
|
+
this.sendToolCallResult(call, message, true);
|
|
473
|
+
runHook(this.hookConfig?.postToolExecution, { tool: call.name, status: "error" });
|
|
474
|
+
runLifecycleHooks(this.hookConfig, "PostToolUse", { tool: call.name, status: "error", error: message }, { configDir: this.hookConfigDir });
|
|
475
|
+
return { callId: call.id, content: message, isError: true };
|
|
476
|
+
}
|
|
477
|
+
}
|
|
478
|
+
}
|
|
444
479
|
if (this.sessionAutoApprove && dangerLevel === "write") {
|
|
445
480
|
try {
|
|
446
481
|
const rawContent = await runTool(tool, call.arguments, call.name);
|
|
@@ -1981,6 +2016,47 @@ ${activated.meta.description || ""}` });
|
|
|
1981
2016
|
break;
|
|
1982
2017
|
}
|
|
1983
2018
|
// ── /yolo ──────────────────────────────────────────────────────
|
|
2019
|
+
case "auto": {
|
|
2020
|
+
const sub = args[0]?.toLowerCase() ?? "status";
|
|
2021
|
+
if (sub === "on") {
|
|
2022
|
+
this.toolExecutor.sessionAutoMode = true;
|
|
2023
|
+
this.send({ type: "info", message: "\u26A1 Auto Mode ON \u2014 low-risk actions may auto-run; high-risk actions still confirm or deny. Auto Mode is session-scoped." });
|
|
2024
|
+
} else if (sub === "off") {
|
|
2025
|
+
this.toolExecutor.sessionAutoMode = false;
|
|
2026
|
+
this.send({ type: "info", message: "Auto Mode disabled." });
|
|
2027
|
+
} else if (sub === "status") {
|
|
2028
|
+
this.send({ type: "info", message: `Auto Mode: ${this.toolExecutor.sessionAutoMode ? "on" : "off"}
|
|
2029
|
+
Scope: current session only
|
|
2030
|
+
Denied: /permissions recently-denied` });
|
|
2031
|
+
} else {
|
|
2032
|
+
this.send({ type: "error", message: "Usage: /auto [on|off|status]" });
|
|
2033
|
+
}
|
|
2034
|
+
this.sendStatus();
|
|
2035
|
+
break;
|
|
2036
|
+
}
|
|
2037
|
+
case "permissions": {
|
|
2038
|
+
const sub = args[0]?.toLowerCase() ?? "recently-denied";
|
|
2039
|
+
if (sub === "recently-denied") {
|
|
2040
|
+
const rows = getRecentlyDeniedAutoActions();
|
|
2041
|
+
if (rows.length === 0) {
|
|
2042
|
+
this.send({ type: "info", message: "No recently denied Auto Mode actions." });
|
|
2043
|
+
} else {
|
|
2044
|
+
const lines = [`Recently denied Auto Mode actions (${rows.length})`, ""];
|
|
2045
|
+
for (const r of rows.slice(0, 20)) {
|
|
2046
|
+
lines.push(`- ${r.timestamp} ${r.tool} ${r.ruleId}`);
|
|
2047
|
+
lines.push(` ${r.reason}`);
|
|
2048
|
+
lines.push(` ${r.argsPreview}`);
|
|
2049
|
+
}
|
|
2050
|
+
this.send({ type: "info", message: lines.join("\n") });
|
|
2051
|
+
}
|
|
2052
|
+
} else if (sub === "clear-denied") {
|
|
2053
|
+
clearRecentlyDeniedAutoActions();
|
|
2054
|
+
this.send({ type: "info", message: "Cleared recently denied Auto Mode actions." });
|
|
2055
|
+
} else {
|
|
2056
|
+
this.send({ type: "error", message: "Usage: /permissions recently-denied|clear-denied" });
|
|
2057
|
+
}
|
|
2058
|
+
break;
|
|
2059
|
+
}
|
|
1984
2060
|
case "yolo": {
|
|
1985
2061
|
const sub = args[0]?.toLowerCase();
|
|
1986
2062
|
if (sub === "off") {
|
|
@@ -2599,7 +2675,7 @@ ${undoResults.map((r) => ` \u2022 ${r}`).join("\n")}` });
|
|
|
2599
2675
|
case "test": {
|
|
2600
2676
|
this.send({ type: "info", message: "\u{1F9EA} Running tests..." });
|
|
2601
2677
|
try {
|
|
2602
|
-
const { executeTests } = await import("./run-tests-
|
|
2678
|
+
const { executeTests } = await import("./run-tests-DSOJBJWA.js");
|
|
2603
2679
|
const argStr = args.join(" ").trim();
|
|
2604
2680
|
let testArgs = {};
|
|
2605
2681
|
if (argStr) {
|
|
@@ -3,13 +3,13 @@ import {
|
|
|
3
3
|
ToolRegistry,
|
|
4
4
|
googleSearchContext,
|
|
5
5
|
truncateOutput
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-THNECAAY.js";
|
|
7
7
|
import "./chunk-T2NL5ZIA.js";
|
|
8
8
|
import "./chunk-BXP6YZ2P.js";
|
|
9
|
-
import "./chunk-
|
|
9
|
+
import "./chunk-UDMU4FUF.js";
|
|
10
10
|
import {
|
|
11
11
|
runTool
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-7NTFMLJJ.js";
|
|
13
13
|
import {
|
|
14
14
|
getDangerLevel,
|
|
15
15
|
runLeanAgentLoop
|
|
@@ -17,7 +17,7 @@ import {
|
|
|
17
17
|
import "./chunk-TZQHYZKT.js";
|
|
18
18
|
import {
|
|
19
19
|
SUBAGENT_ALLOWED_TOOLS
|
|
20
|
-
} from "./chunk-
|
|
20
|
+
} from "./chunk-IWLVH32D.js";
|
|
21
21
|
import "./chunk-4BKXL7SM.js";
|
|
22
22
|
import "./chunk-TB4W4Y4T.js";
|
|
23
23
|
import "./chunk-KHYD3WXE.js";
|
|
@@ -8,9 +8,9 @@ import {
|
|
|
8
8
|
} from "./chunk-E44DTERW.js";
|
|
9
9
|
import {
|
|
10
10
|
ConfigManager
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-MRGWPCFQ.js";
|
|
12
12
|
import "./chunk-TZQHYZKT.js";
|
|
13
|
-
import "./chunk-
|
|
13
|
+
import "./chunk-IWLVH32D.js";
|
|
14
14
|
import "./chunk-IW3Q7AE5.js";
|
|
15
15
|
|
|
16
16
|
// src/cli/usage.ts
|
package/dist/web/client/app.js
CHANGED
|
@@ -548,7 +548,7 @@ function handleStatus(msg) {
|
|
|
548
548
|
// Active tab: full UI reflection
|
|
549
549
|
btnThink.classList.toggle('btn-active-toggle', msg.thinkingMode);
|
|
550
550
|
btnPlan.classList.toggle('btn-active-toggle', msg.planMode);
|
|
551
|
-
statusSession.textContent = '📋 ' + (msg.sessionId?.slice(0, 8) || '—') + ' (' + msg.messageCount + ' msgs) · ' + (msg.permissionProfile || 'legacy') + (msg.networkPolicyEnabled ? ' · net:on' : '') + (msg.pendingHookTrustCount ? ' · hooks:' + msg.pendingHookTrustCount : '');
|
|
551
|
+
statusSession.textContent = '📋 ' + (msg.sessionId?.slice(0, 8) || '—') + ' (' + msg.messageCount + ' msgs) · ' + (msg.permissionProfile || 'legacy') + (msg.networkPolicyEnabled ? ' · net:on' : '') + (msg.autoMode ? ' · auto:on' : '') + (msg.pendingHookTrustCount ? ' · hooks:' + msg.pendingHookTrustCount : '');
|
|
552
552
|
if (msg.tokenUsage) {
|
|
553
553
|
const u = msg.tokenUsage;
|
|
554
554
|
const cacheRead = u.cacheReadTokens || 0;
|