jinzd-ai-cli 0.2.24 → 0.2.25

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.
@@ -16,7 +16,7 @@ import {
16
16
  SUBAGENT_MAX_ROUNDS_LIMIT,
17
17
  VERSION,
18
18
  runTestsTool
19
- } from "./chunk-I5PCIFFK.js";
19
+ } from "./chunk-SVYDE375.js";
20
20
 
21
21
  // src/config/config-manager.ts
22
22
  import { readFileSync, writeFileSync, existsSync, mkdirSync } from "fs";
@@ -8,7 +8,7 @@ import { platform } from "os";
8
8
  import chalk from "chalk";
9
9
 
10
10
  // src/core/constants.ts
11
- var VERSION = "0.2.24";
11
+ var VERSION = "0.2.25";
12
12
  var APP_NAME = "ai-cli";
13
13
  var CONFIG_DIR_NAME = ".aicli";
14
14
  var CONFIG_FILE_NAME = "config.json";
package/dist/index.js CHANGED
@@ -36,7 +36,7 @@ import {
36
36
  theme,
37
37
  truncateOutput,
38
38
  undoStack
39
- } from "./chunk-FGZU7XNQ.js";
39
+ } from "./chunk-Q7YDWBRA.js";
40
40
  import {
41
41
  AGENTIC_BEHAVIOR_GUIDELINE,
42
42
  AUTHOR,
@@ -56,7 +56,7 @@ import {
56
56
  REPO_URL,
57
57
  SKILLS_DIR_NAME,
58
58
  VERSION
59
- } from "./chunk-I5PCIFFK.js";
59
+ } from "./chunk-SVYDE375.js";
60
60
 
61
61
  // src/index.ts
62
62
  import { program } from "commander";
@@ -1905,7 +1905,7 @@ ${hint}` : "")
1905
1905
  description: "Run project tests and show structured report",
1906
1906
  usage: "/test [command|filter]",
1907
1907
  async execute(args, _ctx) {
1908
- const { executeTests } = await import("./run-tests-MIUBHRXG.js");
1908
+ const { executeTests } = await import("./run-tests-XBOM5EGQ.js");
1909
1909
  const argStr = args.join(" ").trim();
1910
1910
  let testArgs = {};
1911
1911
  if (argStr) {
@@ -2283,6 +2283,24 @@ Summary: ${fileMap.size} file(s) \u2014 ${newFiles} new, ${modifiedFiles} modifi
2283
2283
  }
2284
2284
  }
2285
2285
  },
2286
+ {
2287
+ name: "yolo",
2288
+ description: "Toggle session auto-approve (skip all confirmations)",
2289
+ usage: "/yolo [on|off]",
2290
+ execute(args, ctx) {
2291
+ const sub = args[0]?.toLowerCase();
2292
+ const executor = ctx.getToolExecutor();
2293
+ if (sub === "off") {
2294
+ executor.sessionAutoApprove = false;
2295
+ console.log(theme.info(" \u{1F512} Auto-approve disabled \u2014 confirmations restored for this session."));
2296
+ } else {
2297
+ executor.sessionAutoApprove = true;
2298
+ console.log(theme.warning(" \u26A1 YOLO mode ON \u2014 all write/destructive tools auto-approved for this session."));
2299
+ console.log(theme.dim(" Use /yolo off to re-enable confirmations."));
2300
+ }
2301
+ console.log();
2302
+ }
2303
+ },
2286
2304
  {
2287
2305
  name: "exit",
2288
2306
  description: "Exit the REPL",
@@ -2479,6 +2497,11 @@ var ToolExecutor = class {
2479
2497
  pendingSlashCommand = null;
2480
2498
  /** confirm() 的取消回调,由 SIGINT handler 调用 */
2481
2499
  cancelConfirmFn = null;
2500
+ /**
2501
+ * 会话级 auto-approve:跳过所有 write/destructive 确认(仅当前会话有效)。
2502
+ * 通过 /yolo 命令切换。destructive 操作仍会显示警告但不阻塞。
2503
+ */
2504
+ sessionAutoApprove = false;
2482
2505
  /**
2483
2506
  * 由外部(repl.ts SIGINT handler)调用,将当前 confirm() 等待视为用户按 N 取消。
2484
2507
  * 若当前没有 confirm() 进行中,无操作。
@@ -2547,6 +2570,24 @@ var ToolExecutor = class {
2547
2570
  }
2548
2571
  }
2549
2572
  }
2573
+ if (this.sessionAutoApprove && dangerLevel !== "safe") {
2574
+ this.printToolCall(call);
2575
+ if (dangerLevel === "write") this.printDiffPreview(call);
2576
+ console.log(theme.warning(" \u26A1 Auto-approved (session /yolo mode)"));
2577
+ try {
2578
+ const rawContent = await tool.execute(call.arguments);
2579
+ const content = truncateOutput(rawContent, call.name);
2580
+ const wasTruncated = content !== rawContent;
2581
+ this.printToolResult(call.name, rawContent, false, wasTruncated);
2582
+ runHook(this.hookConfig?.postToolExecution, { tool: call.name, status: "ok" });
2583
+ return { callId: call.id, content, isError: false };
2584
+ } catch (err) {
2585
+ const message = err instanceof Error ? err.message : String(err);
2586
+ this.printToolResult(call.name, message, true, false);
2587
+ runHook(this.hookConfig?.postToolExecution, { tool: call.name, status: "error" });
2588
+ return { callId: call.id, content: message, isError: true };
2589
+ }
2590
+ }
2550
2591
  if (dangerLevel === "write") {
2551
2592
  this.printToolCall(call);
2552
2593
  this.printDiffPreview(call);
@@ -2635,7 +2676,10 @@ var ToolExecutor = class {
2635
2676
  this.printDiffPreview(call);
2636
2677
  }
2637
2678
  console.log(theme.dim("\u2500".repeat(50)));
2638
- const decision = await this.batchConfirm(calls.length);
2679
+ const decision = this.sessionAutoApprove ? "all" : await this.batchConfirm(calls.length);
2680
+ if (this.sessionAutoApprove) {
2681
+ console.log(theme.warning(" \u26A1 All auto-approved (session /yolo mode)"));
2682
+ }
2639
2683
  const results = [];
2640
2684
  for (let i = 0; i < calls.length; i++) {
2641
2685
  const call = calls[i];
@@ -5368,6 +5412,7 @@ Tip: You can continue the conversation by asking the AI to proceed.`
5368
5412
  removeContextDir: (dirPath) => this.removeExtraContextDir(dirPath),
5369
5413
  listContextDirs: () => [...this.extraContextDirs],
5370
5414
  forkSession: (messageCount, title) => this.sessions.forkSession(messageCount, title),
5415
+ getToolExecutor: () => this.toolExecutor,
5371
5416
  exit: () => this.handleExit()
5372
5417
  };
5373
5418
  await cmd.execute(args, ctx);
@@ -5470,7 +5515,7 @@ program.command("web").description("Start Web UI server with browser-based chat
5470
5515
  console.error("Error: Invalid port number. Must be between 1 and 65535.");
5471
5516
  process.exit(1);
5472
5517
  }
5473
- const { startWebServer } = await import("./server-E2TJNNYH.js");
5518
+ const { startWebServer } = await import("./server-XFUSRZEO.js");
5474
5519
  await startWebServer({ port, host: options.host });
5475
5520
  });
5476
5521
  program.command("user [action] [username]").description("Manage Web UI users (list | create <name> | delete <name> | reset-password <name> | migrate <name>)").action(async (action, username) => {
@@ -2,7 +2,7 @@
2
2
  import {
3
3
  executeTests,
4
4
  runTestsTool
5
- } from "./chunk-I5PCIFFK.js";
5
+ } from "./chunk-SVYDE375.js";
6
6
  export {
7
7
  executeTests,
8
8
  runTestsTool
@@ -24,7 +24,7 @@ import {
24
24
  setupProxy,
25
25
  spawnAgentContext,
26
26
  truncateOutput
27
- } from "./chunk-FGZU7XNQ.js";
27
+ } from "./chunk-Q7YDWBRA.js";
28
28
  import {
29
29
  AGENTIC_BEHAVIOR_GUIDELINE,
30
30
  CONTEXT_FILE_CANDIDATES,
@@ -36,7 +36,7 @@ import {
36
36
  PLAN_MODE_SYSTEM_ADDON,
37
37
  SKILLS_DIR_NAME,
38
38
  VERSION
39
- } from "./chunk-I5PCIFFK.js";
39
+ } from "./chunk-SVYDE375.js";
40
40
  import {
41
41
  AuthManager
42
42
  } from "./chunk-CPLT6CD3.js";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "jinzd-ai-cli",
3
- "version": "0.2.24",
3
+ "version": "0.2.25",
4
4
  "description": "Cross-platform REPL-style AI CLI with multi-provider support",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",