jinzd-ai-cli 0.4.292 → 0.4.294

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.
Files changed (34) hide show
  1. package/dist/{batch-CE6UCXLZ.js → batch-6YCLYEII.js} +2 -2
  2. package/dist/{chunk-622UJ463.js → chunk-3H7TVTAE.js} +1 -1
  3. package/dist/{chunk-RJ2UG2AE.js → chunk-7KYONZUN.js} +1 -1
  4. package/dist/{chunk-CNLTYENQ.js → chunk-AIQMQCVF.js} +5 -5
  5. package/dist/{chunk-F4ZNXA2R.js → chunk-BOG6LVIC.js} +1 -1
  6. package/dist/{chunk-MQPP52TH.js → chunk-CUMSLQKQ.js} +1 -1
  7. package/dist/{chunk-UPMEREEO.js → chunk-FARHJ42Q.js} +4 -4
  8. package/dist/{chunk-QE24GSD3.js → chunk-HBFES3RR.js} +4 -4
  9. package/dist/{chunk-J6S2AHVT.js → chunk-MMP6SIB7.js} +1 -1
  10. package/dist/{chunk-3YOMCCFP.js → chunk-OMA6DEAR.js} +1 -1
  11. package/dist/{chunk-FFXTGDPY.js → chunk-P3BJAJ34.js} +1 -1
  12. package/dist/{chunk-QMQFTZ7H.js → chunk-QKZUWT3S.js} +1 -1
  13. package/dist/{chunk-XTZ5CYQ7.js → chunk-SM7VOJ3B.js} +10 -9
  14. package/dist/{chunk-GKIKDPQW.js → chunk-UPJMIP5S.js} +1 -1
  15. package/dist/{chunk-TEXT4DAT.js → chunk-Y56UGZPX.js} +68 -68
  16. package/dist/{chunk-XMCIDG4I.js → chunk-ZBHRTOWC.js} +1 -1
  17. package/dist/{ci-3W2GIZTH.js → ci-SIS77LEG.js} +6 -6
  18. package/dist/{ci-format-Z5N4I2I7.js → ci-format-LRMGY4ND.js} +2 -2
  19. package/dist/{constants-7UM6N43C.js → constants-C7LOS6F4.js} +1 -1
  20. package/dist/{constants-PTLZWL6L.js → constants-QRUMNMCK.js} +1 -1
  21. package/dist/{doctor-cli-NUUXNPPD.js → doctor-cli-UB5KUBVI.js} +6 -6
  22. package/dist/electron-server.js +12 -11
  23. package/dist/{hub-TQ2KT3ET.js → hub-UWBNCMD4.js} +1 -1
  24. package/dist/index.js +55 -30
  25. package/dist/{persistent-memory-NX5TEFQ5.js → persistent-memory-GQPXSWDK.js} +2 -2
  26. package/dist/{persistent-memory-XFACQWXQ.js → persistent-memory-TUCWY6O3.js} +2 -2
  27. package/dist/{pr-5I7Y7542.js → pr-MVUT6IOA.js} +6 -6
  28. package/dist/{run-tests-G5E6LLD4.js → run-tests-BNKQT42K.js} +2 -2
  29. package/dist/{run-tests-QXIZ743O.js → run-tests-RSIXZR3O.js} +2 -2
  30. package/dist/{server-7EX7ACXC.js → server-ILSFJUK5.js} +15 -15
  31. package/dist/{server-YU3BZM73.js → server-YNVHKFGZ.js} +6 -6
  32. package/dist/{task-orchestrator-QXLUSBYZ.js → task-orchestrator-7YEWEKS6.js} +6 -6
  33. package/dist/{usage-PMS676RM.js → usage-DXX4VHOQ.js} +2 -2
  34. package/package.json +1 -1
@@ -4,12 +4,12 @@ import {
4
4
  } from "./chunk-RS7SKYTS.js";
5
5
  import {
6
6
  ConfigManager
7
- } from "./chunk-XMCIDG4I.js";
7
+ } from "./chunk-ZBHRTOWC.js";
8
8
  import "./chunk-TU3L3PW7.js";
9
9
  import {
10
10
  atomicWriteFileSync
11
11
  } from "./chunk-IW3Q7AE5.js";
12
- import "./chunk-MQPP52TH.js";
12
+ import "./chunk-CUMSLQKQ.js";
13
13
 
14
14
  // src/cli/batch.ts
15
15
  import Anthropic from "@anthropic-ai/sdk";
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  VERSION
4
- } from "./chunk-MQPP52TH.js";
4
+ } from "./chunk-CUMSLQKQ.js";
5
5
 
6
6
  // src/cli/ci-format.ts
7
7
  var DEFAULT_CI_THRESHOLDS = {
@@ -13,7 +13,7 @@ import {
13
13
  MEMORY_FILE_NAME,
14
14
  MEMORY_MAX_CHARS,
15
15
  MEMORY_STORE_FILE_NAME
16
- } from "./chunk-MQPP52TH.js";
16
+ } from "./chunk-CUMSLQKQ.js";
17
17
 
18
18
  // src/memory/persistent-memory.ts
19
19
  import { copyFileSync, existsSync, mkdirSync, readFileSync, statSync } from "fs";
@@ -11,7 +11,7 @@ import {
11
11
  searchPersistentMemories,
12
12
  touchMemoryReferences,
13
13
  updateMemoryEntry
14
- } from "./chunk-RJ2UG2AE.js";
14
+ } from "./chunk-7KYONZUN.js";
15
15
  import {
16
16
  indexProject
17
17
  } from "./chunk-4DEMGCK4.js";
@@ -30,13 +30,13 @@ import {
30
30
  runHook,
31
31
  runLifecycleHooks,
32
32
  runTool
33
- } from "./chunk-F4ZNXA2R.js";
33
+ } from "./chunk-BOG6LVIC.js";
34
34
  import {
35
35
  buildTruncatedArgumentsError,
36
36
  getDangerLevel,
37
37
  isFileWriteTool,
38
38
  runLeanAgentLoop
39
- } from "./chunk-TEXT4DAT.js";
39
+ } from "./chunk-Y56UGZPX.js";
40
40
  import {
41
41
  EnvLoader,
42
42
  NetworkError,
@@ -50,7 +50,7 @@ import {
50
50
  } from "./chunk-4BKXL7SM.js";
51
51
  import {
52
52
  runTestsTool
53
- } from "./chunk-J6S2AHVT.js";
53
+ } from "./chunk-MMP6SIB7.js";
54
54
  import {
55
55
  CONFIG_DIR_NAME,
56
56
  DEFAULT_MAX_TOOL_OUTPUT_CHARS_CAP,
@@ -58,7 +58,7 @@ import {
58
58
  SUBAGENT_ALLOWED_TOOLS,
59
59
  SUBAGENT_DEFAULT_MAX_ROUNDS,
60
60
  SUBAGENT_MAX_ROUNDS_LIMIT
61
- } from "./chunk-MQPP52TH.js";
61
+ } from "./chunk-CUMSLQKQ.js";
62
62
 
63
63
  // src/tools/shell-pool.ts
64
64
  import { spawn as spawn2 } from "child_process";
@@ -8,7 +8,7 @@ import {
8
8
  import {
9
9
  CONFIG_DIR_NAME,
10
10
  PLUGINS_DIR_NAME
11
- } from "./chunk-MQPP52TH.js";
11
+ } from "./chunk-CUMSLQKQ.js";
12
12
 
13
13
  // src/diagnostics/tool-stats.ts
14
14
  import { mkdirSync } from "fs";
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
 
3
3
  // src/core/constants.ts
4
- var VERSION = "0.4.292";
4
+ var VERSION = "0.4.294";
5
5
  var APP_NAME = "ai-cli";
6
6
  var CONFIG_DIR_NAME = ".aicli";
7
7
  var CONFIG_FILE_NAME = "config.json";
@@ -8,13 +8,13 @@ import {
8
8
  listHooks,
9
9
  listInstalledPlugins,
10
10
  resetStats
11
- } from "./chunk-F4ZNXA2R.js";
11
+ } from "./chunk-BOG6LVIC.js";
12
12
  import {
13
13
  ProviderRegistry
14
- } from "./chunk-QMQFTZ7H.js";
14
+ } from "./chunk-QKZUWT3S.js";
15
15
  import {
16
16
  ConfigManager
17
- } from "./chunk-XMCIDG4I.js";
17
+ } from "./chunk-ZBHRTOWC.js";
18
18
  import {
19
19
  getGitRoot
20
20
  } from "./chunk-HOSJZMQS.js";
@@ -26,7 +26,7 @@ import {
26
26
  MCP_PROJECT_CONFIG_NAME,
27
27
  MEMORY_FILE_NAME,
28
28
  VERSION
29
- } from "./chunk-MQPP52TH.js";
29
+ } from "./chunk-CUMSLQKQ.js";
30
30
 
31
31
  // src/diagnostics/doctor-report.ts
32
32
  import { existsSync as existsSync3, statSync as statSync2 } from "fs";
@@ -2,7 +2,7 @@
2
2
  import {
3
3
  evaluateCiGate,
4
4
  normalizeCiThresholds
5
- } from "./chunk-622UJ463.js";
5
+ } from "./chunk-3H7TVTAE.js";
6
6
  import {
7
7
  buildReviewPrompt,
8
8
  buildSecurityReviewPrompt,
@@ -13,13 +13,13 @@ import {
13
13
  } from "./chunk-6YZEZFX5.js";
14
14
  import {
15
15
  ProviderRegistry
16
- } from "./chunk-QMQFTZ7H.js";
16
+ } from "./chunk-QKZUWT3S.js";
17
17
  import {
18
18
  ConfigManager
19
- } from "./chunk-XMCIDG4I.js";
19
+ } from "./chunk-ZBHRTOWC.js";
20
20
  import {
21
21
  VERSION
22
- } from "./chunk-MQPP52TH.js";
22
+ } from "./chunk-CUMSLQKQ.js";
23
23
 
24
24
  // src/cli/ci.ts
25
25
  import { execFileSync } from "child_process";
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  TEST_TIMEOUT
4
- } from "./chunk-MQPP52TH.js";
4
+ } from "./chunk-CUMSLQKQ.js";
5
5
 
6
6
  // src/tools/builtin/run-tests.ts
7
7
  import { execSync, spawnSync } from "child_process";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  TEST_TIMEOUT
3
- } from "./chunk-GKIKDPQW.js";
3
+ } from "./chunk-UPJMIP5S.js";
4
4
 
5
5
  // src/tools/builtin/run-tests.ts
6
6
  import { execSync, spawnSync } from "child_process";
@@ -12,7 +12,7 @@ import {
12
12
  MEMORY_FILE_NAME,
13
13
  MEMORY_MAX_CHARS,
14
14
  MEMORY_STORE_FILE_NAME
15
- } from "./chunk-GKIKDPQW.js";
15
+ } from "./chunk-UPJMIP5S.js";
16
16
 
17
17
  // src/memory/persistent-memory.ts
18
18
  import { copyFileSync, existsSync, mkdirSync, readFileSync, statSync } from "fs";
@@ -3,7 +3,7 @@ import {
3
3
  detectsHallucinatedFileOp,
4
4
  parseToolCallArguments,
5
5
  schemaToJsonSchema
6
- } from "./chunk-TEXT4DAT.js";
6
+ } from "./chunk-Y56UGZPX.js";
7
7
  import {
8
8
  AuthError,
9
9
  ProviderError,
@@ -16,7 +16,7 @@ import {
16
16
  setPreferredAgentName,
17
17
  truncateForPersist,
18
18
  undoStack
19
- } from "./chunk-CNLTYENQ.js";
19
+ } from "./chunk-AIQMQCVF.js";
20
20
  import {
21
21
  buildReviewPrompt,
22
22
  buildSecurityReviewPrompt
@@ -51,7 +51,7 @@ import {
51
51
  touchMemoryReferences,
52
52
  updateMemoryApproval,
53
53
  updateMemoryEntry
54
- } from "./chunk-RJ2UG2AE.js";
54
+ } from "./chunk-7KYONZUN.js";
55
55
  import {
56
56
  theme
57
57
  } from "./chunk-5C76XDDF.js";
@@ -65,7 +65,7 @@ import {
65
65
  import {
66
66
  buildDoctorReport,
67
67
  formatDoctorReport
68
- } from "./chunk-UPMEREEO.js";
68
+ } from "./chunk-FARHJ42Q.js";
69
69
  import {
70
70
  describePlugin,
71
71
  getActivePluginAssets,
@@ -80,11 +80,11 @@ import {
80
80
  trustHook,
81
81
  trustPlugin,
82
82
  untrustHook
83
- } from "./chunk-F4ZNXA2R.js";
83
+ } from "./chunk-BOG6LVIC.js";
84
84
  import {
85
85
  isCleanDocumentBody,
86
86
  stripOuterCodeFence
87
- } from "./chunk-TEXT4DAT.js";
87
+ } from "./chunk-Y56UGZPX.js";
88
88
  import {
89
89
  formatGitContextForPrompt,
90
90
  getGitContext
@@ -109,7 +109,7 @@ import {
109
109
  MCP_TOOL_PREFIX,
110
110
  REPO_URL,
111
111
  VERSION
112
- } from "./chunk-MQPP52TH.js";
112
+ } from "./chunk-CUMSLQKQ.js";
113
113
 
114
114
  // src/mcp/client.ts
115
115
  import { spawn } from "child_process";
@@ -2393,7 +2393,7 @@ No tools match "${filter}".
2393
2393
  const { join: join6 } = await import("path");
2394
2394
  const { existsSync: existsSync6 } = await import("fs");
2395
2395
  const { getGitRoot } = await import("./git-context-EXOEHQSF.js");
2396
- const { MCP_PROJECT_CONFIG_NAME } = await import("./constants-7UM6N43C.js");
2396
+ const { MCP_PROJECT_CONFIG_NAME } = await import("./constants-C7LOS6F4.js");
2397
2397
  const { approveProject, hashMcpFile } = await import("./project-trust-NKYHL3VZ.js");
2398
2398
  const cwd = process.cwd();
2399
2399
  const projectRoot = getGitRoot(cwd) ?? cwd;
@@ -3497,7 +3497,7 @@ function createReviewCommands() {
3497
3497
  usage: "/test [command|filter]",
3498
3498
  async execute(args, ctx) {
3499
3499
  try {
3500
- const { executeTests } = await import("./run-tests-G5E6LLD4.js");
3500
+ const { executeTests } = await import("./run-tests-BNKQT42K.js");
3501
3501
  const argStr = args.join(" ").trim();
3502
3502
  let testArgs = {};
3503
3503
  if (argStr) {
@@ -4920,7 +4920,8 @@ function createMiscCommands() {
4920
4920
  title: "Clipboard & I/O",
4921
4921
  rows: [
4922
4922
  ["/copy", "Copy last AI response to clipboard"],
4923
- ["/paste [description]", "Read image from clipboard and send to AI"]
4923
+ ["/paste [description]", "Read image from clipboard and send to AI"],
4924
+ ["Alt+V", "Paste clipboard image inline (Ctrl+V if your terminal passes it)"]
4924
4925
  ]
4925
4926
  },
4926
4927
  {
@@ -1,5 +1,5 @@
1
1
  // src/core/constants.ts
2
- var VERSION = "0.4.292";
2
+ var VERSION = "0.4.294";
3
3
  var APP_NAME = "ai-cli";
4
4
  var CONFIG_DIR_NAME = ".aicli";
5
5
  var CONFIG_FILE_NAME = "config.json";
@@ -1,69 +1,5 @@
1
1
  #!/usr/bin/env node
2
2
 
3
- // src/tools/types.ts
4
- function isFileWriteTool(name) {
5
- return name === "write_file" || name === "edit_file" || name === "notebook_edit";
6
- }
7
- function getDangerLevel(toolName, args) {
8
- if (toolName.startsWith("mcp__")) {
9
- const rawName = toolName.split("__").pop() ?? "";
10
- const normalized = rawName.toLowerCase().replace(/[^a-z0-9]+/g, "_");
11
- if (/^(read|get|list|search|find|query|fetch|status|describe|inspect|show|lookup)(?:_|$)/.test(normalized)) {
12
- return "safe";
13
- }
14
- return "write";
15
- }
16
- if (toolName === "bash") {
17
- const cmd = String(args["command"] ?? "");
18
- if (/\brm\s+[^\n]*(?:-\w*[rRfF]\w*|--recursive|--force)\b/.test(cmd)) return "destructive";
19
- if (/\brm\s+\S/.test(cmd)) return "destructive";
20
- if (/\brmdir\b|\bformat\b|\bmkfs\b|\bdd\s+if=|\bshred\b|\bfdisk\b|\bparted\b/.test(cmd)) return "destructive";
21
- if (/\bshutdown\b|\breboot\b|\bhalt\b|\bpoweroff\b/.test(cmd)) return "destructive";
22
- if (/\bkill\s+-9\b|\bkillall\b/.test(cmd)) return "destructive";
23
- if (/\bRemove-Item\b|\bri\s+\S/i.test(cmd)) return "destructive";
24
- if (/\brd\s+\/s\b|\brmdir\s+\/s\b/i.test(cmd)) return "destructive";
25
- if (/\bdel\s+\S/.test(cmd)) return "destructive";
26
- if (/\bShutdown(-Computer)?\b|\bRestart-Computer\b/i.test(cmd)) return "destructive";
27
- if (/(?:^|[\s|;&])>>?\s*\S/.test(cmd)) return "write";
28
- if (/\btee\b|\bcp\b|\bmv\b|\bln\s+-s/.test(cmd)) return "write";
29
- if (/\bchmod\b|\bchown\b/.test(cmd)) return "write";
30
- if (/\bSet-Content\b|\bOut-File\b|\bAdd-Content\b|\bCopy-Item\b|\bMove-Item\b|\bSet-ItemProperty\b|\bNew-ItemProperty\b/i.test(cmd)) return "write";
31
- if (/\b(python3?|node|deno|bun|perl|ruby|php|bash|sh|zsh|pwsh|powershell)(\.exe)?\b[^\n]*?\s-(?:Command|EncodedCommand|c|e|p|r)\b/i.test(cmd)) return "write";
32
- if (/\bcmd(\.exe)?\s+\/[ck]\b/i.test(cmd)) return "write";
33
- return "safe";
34
- }
35
- if (toolName === "write_file") return "write";
36
- if (toolName === "edit_file") return "write";
37
- if (toolName === "save_last_response") return "write";
38
- if (toolName === "run_interactive") {
39
- const exe = String(args["executable"] ?? "").toLowerCase();
40
- if (/\b(rm|rmdir|del|format|mkfs|Remove-Item)\b/i.test(exe)) return "destructive";
41
- if (/\b(bash|sh|zsh|cmd|powershell|pwsh|python|node|ruby|perl)\b/i.test(exe)) return "write";
42
- return "write";
43
- }
44
- if (toolName === "task_create" || toolName === "task_stop") return "write";
45
- if (toolName === "task_list") return "safe";
46
- if (toolName === "git_commit") return "write";
47
- if (toolName === "git_status" || toolName === "git_diff" || toolName === "git_log") return "safe";
48
- if (toolName === "notebook_edit") return "write";
49
- if (toolName === "read_file" || toolName === "list_dir" || toolName === "grep_files" || toolName === "glob_files" || toolName === "web_fetch" || toolName === "save_memory" || toolName === "ask_user" || toolName === "write_todos" || toolName === "google_search" || toolName === "spawn_agent" || toolName === "run_tests") return "safe";
50
- return "write";
51
- }
52
- function schemaToJsonSchema(schema) {
53
- const result = {
54
- type: schema.type,
55
- description: schema.description
56
- };
57
- if (schema.enum) result["enum"] = schema.enum;
58
- if (schema.items) result["items"] = schemaToJsonSchema(schema.items);
59
- if (schema.properties) {
60
- result["properties"] = Object.fromEntries(
61
- Object.entries(schema.properties).map(([k, v]) => [k, schemaToJsonSchema(v)])
62
- );
63
- }
64
- return result;
65
- }
66
-
67
3
  // src/tools/hallucination.ts
68
4
  var HALLUCINATION_PATTERNS = [
69
5
  /文件路径[::]\s*`?[^\s`]+\.\w{1,5}/,
@@ -1193,10 +1129,71 @@ async function runLeanAgentLoop(opts) {
1193
1129
  return { content, usage, roundsUsed, toolCallCount };
1194
1130
  }
1195
1131
 
1132
+ // src/tools/types.ts
1133
+ function isFileWriteTool(name) {
1134
+ return name === "write_file" || name === "edit_file" || name === "notebook_edit";
1135
+ }
1136
+ function getDangerLevel(toolName, args) {
1137
+ if (toolName.startsWith("mcp__")) {
1138
+ const rawName = toolName.split("__").pop() ?? "";
1139
+ const normalized = rawName.toLowerCase().replace(/[^a-z0-9]+/g, "_");
1140
+ if (/^(read|get|list|search|find|query|fetch|status|describe|inspect|show|lookup)(?:_|$)/.test(normalized)) {
1141
+ return "safe";
1142
+ }
1143
+ return "write";
1144
+ }
1145
+ if (toolName === "bash") {
1146
+ const cmd = String(args["command"] ?? "");
1147
+ if (/\brm\s+[^\n]*(?:-\w*[rRfF]\w*|--recursive|--force)\b/.test(cmd)) return "destructive";
1148
+ if (/\brm\s+\S/.test(cmd)) return "destructive";
1149
+ if (/\brmdir\b|\bformat\b|\bmkfs\b|\bdd\s+if=|\bshred\b|\bfdisk\b|\bparted\b/.test(cmd)) return "destructive";
1150
+ if (/\bshutdown\b|\breboot\b|\bhalt\b|\bpoweroff\b/.test(cmd)) return "destructive";
1151
+ if (/\bkill\s+-9\b|\bkillall\b/.test(cmd)) return "destructive";
1152
+ if (/\bRemove-Item\b|\bri\s+\S/i.test(cmd)) return "destructive";
1153
+ if (/\brd\s+\/s\b|\brmdir\s+\/s\b/i.test(cmd)) return "destructive";
1154
+ if (/\bdel\s+\S/.test(cmd)) return "destructive";
1155
+ if (/\bShutdown(-Computer)?\b|\bRestart-Computer\b/i.test(cmd)) return "destructive";
1156
+ if (/(?:^|[\s|;&])>>?\s*\S/.test(cmd)) return "write";
1157
+ if (/\btee\b|\bcp\b|\bmv\b|\bln\s+-s/.test(cmd)) return "write";
1158
+ if (/\bchmod\b|\bchown\b/.test(cmd)) return "write";
1159
+ if (/\bSet-Content\b|\bOut-File\b|\bAdd-Content\b|\bCopy-Item\b|\bMove-Item\b|\bSet-ItemProperty\b|\bNew-ItemProperty\b/i.test(cmd)) return "write";
1160
+ if (/\b(python3?|node|deno|bun|perl|ruby|php|bash|sh|zsh|pwsh|powershell)(\.exe)?\b[^\n]*?\s-(?:Command|EncodedCommand|c|e|p|r)\b/i.test(cmd)) return "write";
1161
+ if (/\bcmd(\.exe)?\s+\/[ck]\b/i.test(cmd)) return "write";
1162
+ return "safe";
1163
+ }
1164
+ if (toolName === "write_file") return "write";
1165
+ if (toolName === "edit_file") return "write";
1166
+ if (toolName === "save_last_response") return "write";
1167
+ if (toolName === "run_interactive") {
1168
+ const exe = String(args["executable"] ?? "").toLowerCase();
1169
+ if (/\b(rm|rmdir|del|format|mkfs|Remove-Item)\b/i.test(exe)) return "destructive";
1170
+ if (/\b(bash|sh|zsh|cmd|powershell|pwsh|python|node|ruby|perl)\b/i.test(exe)) return "write";
1171
+ return "write";
1172
+ }
1173
+ if (toolName === "task_create" || toolName === "task_stop") return "write";
1174
+ if (toolName === "task_list") return "safe";
1175
+ if (toolName === "git_commit") return "write";
1176
+ if (toolName === "git_status" || toolName === "git_diff" || toolName === "git_log") return "safe";
1177
+ if (toolName === "notebook_edit") return "write";
1178
+ if (toolName === "read_file" || toolName === "list_dir" || toolName === "grep_files" || toolName === "glob_files" || toolName === "web_fetch" || toolName === "save_memory" || toolName === "ask_user" || toolName === "write_todos" || toolName === "google_search" || toolName === "spawn_agent" || toolName === "run_tests") return "safe";
1179
+ return "write";
1180
+ }
1181
+ function schemaToJsonSchema(schema) {
1182
+ const result = {
1183
+ type: schema.type,
1184
+ description: schema.description
1185
+ };
1186
+ if (schema.enum) result["enum"] = schema.enum;
1187
+ if (schema.items) result["items"] = schemaToJsonSchema(schema.items);
1188
+ if (schema.properties) {
1189
+ result["properties"] = Object.fromEntries(
1190
+ Object.entries(schema.properties).map(([k, v]) => [k, schemaToJsonSchema(v)])
1191
+ );
1192
+ }
1193
+ return result;
1194
+ }
1195
+
1196
1196
  export {
1197
- isFileWriteTool,
1198
- getDangerLevel,
1199
- schemaToJsonSchema,
1200
1197
  detectsHallucinatedFileOp,
1201
1198
  TOOL_CALL_REMINDER,
1202
1199
  buildWriteRoundReminder,
@@ -1218,5 +1215,8 @@ export {
1218
1215
  accumulateUsage,
1219
1216
  buildRoundBudgetHint,
1220
1217
  runAgentLoop,
1221
- runLeanAgentLoop
1218
+ runLeanAgentLoop,
1219
+ isFileWriteTool,
1220
+ getDangerLevel,
1221
+ schemaToJsonSchema
1222
1222
  };
@@ -11,7 +11,7 @@ import {
11
11
  CONFIG_FILE_NAME,
12
12
  HISTORY_DIR_NAME,
13
13
  PLUGINS_DIR_NAME
14
- } from "./chunk-MQPP52TH.js";
14
+ } from "./chunk-CUMSLQKQ.js";
15
15
 
16
16
  // src/config/config-manager.ts
17
17
  import { readFileSync, existsSync, mkdirSync } from "fs";
@@ -3,16 +3,16 @@ import {
3
3
  CI_COMMENT_MARKER,
4
4
  countSeverity,
5
5
  runCi
6
- } from "./chunk-QE24GSD3.js";
7
- import "./chunk-622UJ463.js";
6
+ } from "./chunk-HBFES3RR.js";
7
+ import "./chunk-3H7TVTAE.js";
8
8
  import "./chunk-HLWUDRBO.js";
9
9
  import "./chunk-6YZEZFX5.js";
10
- import "./chunk-QMQFTZ7H.js";
11
- import "./chunk-XMCIDG4I.js";
12
- import "./chunk-TEXT4DAT.js";
10
+ import "./chunk-QKZUWT3S.js";
11
+ import "./chunk-ZBHRTOWC.js";
12
+ import "./chunk-Y56UGZPX.js";
13
13
  import "./chunk-TU3L3PW7.js";
14
14
  import "./chunk-IW3Q7AE5.js";
15
- import "./chunk-MQPP52TH.js";
15
+ import "./chunk-CUMSLQKQ.js";
16
16
  export {
17
17
  CI_COMMENT_MARKER,
18
18
  countSeverity,
@@ -6,8 +6,8 @@ import {
6
6
  formatCiResult,
7
7
  formatCiSarif,
8
8
  normalizeCiThresholds
9
- } from "./chunk-622UJ463.js";
10
- import "./chunk-MQPP52TH.js";
9
+ } from "./chunk-3H7TVTAE.js";
10
+ import "./chunk-CUMSLQKQ.js";
11
11
  export {
12
12
  DEFAULT_CI_THRESHOLDS,
13
13
  detectCiGateSignals,
@@ -38,7 +38,7 @@ import {
38
38
  TEST_TIMEOUT,
39
39
  VERSION,
40
40
  buildUserIdentityPrompt
41
- } from "./chunk-MQPP52TH.js";
41
+ } from "./chunk-CUMSLQKQ.js";
42
42
  export {
43
43
  AGENTIC_BEHAVIOR_GUIDELINE,
44
44
  APP_NAME,
@@ -37,7 +37,7 @@ import {
37
37
  TEST_TIMEOUT,
38
38
  VERSION,
39
39
  buildUserIdentityPrompt
40
- } from "./chunk-GKIKDPQW.js";
40
+ } from "./chunk-UPJMIP5S.js";
41
41
  export {
42
42
  AGENTIC_BEHAVIOR_GUIDELINE,
43
43
  APP_NAME,
@@ -2,16 +2,16 @@
2
2
  import {
3
3
  formatDoctorReport,
4
4
  runDoctorCli
5
- } from "./chunk-UPMEREEO.js";
6
- import "./chunk-F4ZNXA2R.js";
5
+ } from "./chunk-FARHJ42Q.js";
6
+ import "./chunk-BOG6LVIC.js";
7
7
  import "./chunk-RS7SKYTS.js";
8
- import "./chunk-QMQFTZ7H.js";
9
- import "./chunk-XMCIDG4I.js";
10
- import "./chunk-TEXT4DAT.js";
8
+ import "./chunk-QKZUWT3S.js";
9
+ import "./chunk-ZBHRTOWC.js";
10
+ import "./chunk-Y56UGZPX.js";
11
11
  import "./chunk-TU3L3PW7.js";
12
12
  import "./chunk-HOSJZMQS.js";
13
13
  import "./chunk-IW3Q7AE5.js";
14
- import "./chunk-MQPP52TH.js";
14
+ import "./chunk-CUMSLQKQ.js";
15
15
  export {
16
16
  formatDoctorReport,
17
17
  runDoctorCli
@@ -50,7 +50,7 @@ import {
50
50
  touchMemoryReferences,
51
51
  updateMemoryApproval,
52
52
  updateMemoryEntry
53
- } from "./chunk-FFXTGDPY.js";
53
+ } from "./chunk-P3BJAJ34.js";
54
54
  import {
55
55
  DEFAULT_PATTERNS,
56
56
  redactJson,
@@ -66,7 +66,7 @@ import {
66
66
  } from "./chunk-CGLYJRFA.js";
67
67
  import {
68
68
  runTestsTool
69
- } from "./chunk-3YOMCCFP.js";
69
+ } from "./chunk-OMA6DEAR.js";
70
70
  import {
71
71
  AGENTIC_BEHAVIOR_GUIDELINE,
72
72
  APP_NAME,
@@ -100,7 +100,7 @@ import {
100
100
  SUBAGENT_MAX_ROUNDS_LIMIT,
101
101
  VERSION,
102
102
  buildUserIdentityPrompt
103
- } from "./chunk-GKIKDPQW.js";
103
+ } from "./chunk-UPJMIP5S.js";
104
104
 
105
105
  // src/web/server.ts
106
106
  import express from "express";
@@ -16921,7 +16921,7 @@ Cache: write=${cacheCreate} read=${cacheRead}` : "";
16921
16921
  Cost: ${formatCost(cost)}` : "";
16922
16922
  let memoryLine = "";
16923
16923
  try {
16924
- const { countPendingMemories: countPendingMemories2 } = await import("./persistent-memory-XFACQWXQ.js");
16924
+ const { countPendingMemories: countPendingMemories2 } = await import("./persistent-memory-TUCWY6O3.js");
16925
16925
  const pending = countPendingMemories2(ctx.config.getConfigDir());
16926
16926
  if (pending > 0) memoryLine = `
16927
16927
  Memory: \u26A0 ${pending} pending approval \u2014 see the Memory panel or /memory`;
@@ -17904,7 +17904,7 @@ async function handleTest(args, ctx) {
17904
17904
  const isCommand = argStr.includes(" ") || /^(mvn|gradle|npm|pytest|cargo|go)\b/.test(argStr);
17905
17905
  testArgs = isCommand ? { command: argStr } : { filter: argStr };
17906
17906
  }
17907
- const runTests = ctx.runTests ?? (await import("./run-tests-QXIZ743O.js")).executeTests;
17907
+ const runTests = ctx.runTests ?? (await import("./run-tests-RSIXZR3O.js")).executeTests;
17908
17908
  const report = await runTests(testArgs);
17909
17909
  ctx.send({ type: "info", message: report });
17910
17910
  } catch (err) {
@@ -18294,7 +18294,7 @@ async function handleMemory(args, ctx) {
18294
18294
  }
18295
18295
  if (intent.kind === "status") {
18296
18296
  const { getChatIndexStatus: getChatIndexStatus2 } = await import("./chat-index-DGUOUUQW.js");
18297
- const { listMemoryEntries: listMemoryEntries2, isMemoryExpired: isMemoryExpired2, formatMemoryForPrompt: formatMemoryForPrompt2 } = await import("./persistent-memory-XFACQWXQ.js");
18297
+ const { listMemoryEntries: listMemoryEntries2, isMemoryExpired: isMemoryExpired2, formatMemoryForPrompt: formatMemoryForPrompt2 } = await import("./persistent-memory-TUCWY6O3.js");
18298
18298
  const memories = listMemoryEntries2(configDir, { includeExpired: true, includeRejected: true });
18299
18299
  const injected = formatMemoryForPrompt2(configDir, process.cwd(), ctx.config.get("memory")?.maxChars);
18300
18300
  const view = buildMemoryStatusView({
@@ -18317,7 +18317,7 @@ async function handleMemory(args, ctx) {
18317
18317
  return;
18318
18318
  }
18319
18319
  if (intent.kind === "recall") {
18320
- const { searchPersistentMemories: searchPersistentMemories2, touchMemoryReferences: touchMemoryReferences2 } = await import("./persistent-memory-XFACQWXQ.js");
18320
+ const { searchPersistentMemories: searchPersistentMemories2, touchMemoryReferences: touchMemoryReferences2 } = await import("./persistent-memory-TUCWY6O3.js");
18321
18321
  const { searchChatMemory: searchChatMemory2 } = await import("./chat-index-DGUOUUQW.js");
18322
18322
  const persistentHits = searchPersistentMemories2(configDir, intent.query, process.cwd(), 3);
18323
18323
  if (persistentHits.length > 0) {
@@ -18438,7 +18438,7 @@ async function handleMemory(args, ctx) {
18438
18438
  ctx.handleMemoryManage(intent.action, args[1], intent.action === "expire" ? args[2] : void 0);
18439
18439
  } else if (intent.kind === "export") {
18440
18440
  if (args[1] === "md") {
18441
- const { exportMemoryEntries: exportMemoryEntries2 } = await import("./persistent-memory-XFACQWXQ.js");
18441
+ const { exportMemoryEntries: exportMemoryEntries2 } = await import("./persistent-memory-TUCWY6O3.js");
18442
18442
  ctx.send({
18443
18443
  type: "export_data",
18444
18444
  format: "md",
@@ -19443,7 +19443,7 @@ No tools match "${filter}".
19443
19443
  const { join: join29 } = await import("path");
19444
19444
  const { existsSync: existsSync33 } = await import("fs");
19445
19445
  const { getGitRoot: getGitRoot2 } = await import("./git-context-VNCA2GU7.js");
19446
- const { MCP_PROJECT_CONFIG_NAME: MCP_PROJECT_CONFIG_NAME2 } = await import("./constants-PTLZWL6L.js");
19446
+ const { MCP_PROJECT_CONFIG_NAME: MCP_PROJECT_CONFIG_NAME2 } = await import("./constants-QRUMNMCK.js");
19447
19447
  const { approveProject, hashMcpFile } = await import("./project-trust-MUG325AW.js");
19448
19448
  const cwd = process.cwd();
19449
19449
  const projectRoot = getGitRoot2(cwd) ?? cwd;
@@ -20358,7 +20358,7 @@ function createReviewCommands() {
20358
20358
  usage: "/test [command|filter]",
20359
20359
  async execute(args, ctx) {
20360
20360
  try {
20361
- const { executeTests } = await import("./run-tests-QXIZ743O.js");
20361
+ const { executeTests } = await import("./run-tests-RSIXZR3O.js");
20362
20362
  const argStr = args.join(" ").trim();
20363
20363
  let testArgs = {};
20364
20364
  if (argStr) {
@@ -21718,7 +21718,8 @@ function createMiscCommands() {
21718
21718
  title: "Clipboard & I/O",
21719
21719
  rows: [
21720
21720
  ["/copy", "Copy last AI response to clipboard"],
21721
- ["/paste [description]", "Read image from clipboard and send to AI"]
21721
+ ["/paste [description]", "Read image from clipboard and send to AI"],
21722
+ ["Alt+V", "Paste clipboard image inline (Ctrl+V if your terminal passes it)"]
21722
21723
  ]
21723
21724
  },
21724
21725
  {
@@ -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-QXLUSBYZ.js");
161
+ const { TaskOrchestrator } = await import("./task-orchestrator-7YEWEKS6.js");
162
162
  const orchestrator = new TaskOrchestrator(config, providers, configManager);
163
163
  let interrupted = false;
164
164
  const onSigint = () => {
package/dist/index.js CHANGED
@@ -24,7 +24,7 @@ import {
24
24
  setupProxy,
25
25
  snapshotFile,
26
26
  stripRoutingTags
27
- } from "./chunk-XTZ5CYQ7.js";
27
+ } from "./chunk-SM7VOJ3B.js";
28
28
  import {
29
29
  CostTracker,
30
30
  getPricing,
@@ -49,7 +49,7 @@ import {
49
49
  setMaxOutputCap,
50
50
  spawnAgentContext,
51
51
  undoStack
52
- } from "./chunk-CNLTYENQ.js";
52
+ } from "./chunk-AIQMQCVF.js";
53
53
  import "./chunk-HLWUDRBO.js";
54
54
  import {
55
55
  NO_THINKING,
@@ -62,7 +62,7 @@ import {
62
62
  countPendingMemories,
63
63
  detectStaleLegacyMarkdownEdit,
64
64
  formatMemoryForPrompt
65
- } from "./chunk-RJ2UG2AE.js";
65
+ } from "./chunk-7KYONZUN.js";
66
66
  import "./chunk-4DEMGCK4.js";
67
67
  import "./chunk-UUSRWSSX.js";
68
68
  import "./chunk-CKH4KQ4E.js";
@@ -83,22 +83,22 @@ import {
83
83
  import {
84
84
  loadContextFiles,
85
85
  writeCrashLog
86
- } from "./chunk-UPMEREEO.js";
86
+ } from "./chunk-FARHJ42Q.js";
87
87
  import {
88
88
  getActivePluginAssets,
89
89
  getPendingHookTrust,
90
90
  installFlushOnExit,
91
91
  mergePluginHooks,
92
92
  runLifecycleHooks
93
- } from "./chunk-F4ZNXA2R.js";
93
+ } from "./chunk-BOG6LVIC.js";
94
94
  import "./chunk-RS7SKYTS.js";
95
95
  import {
96
96
  ProviderRegistry,
97
97
  listBuiltInProviderMetadata
98
- } from "./chunk-QMQFTZ7H.js";
98
+ } from "./chunk-QKZUWT3S.js";
99
99
  import {
100
100
  ConfigManager
101
- } from "./chunk-XMCIDG4I.js";
101
+ } from "./chunk-ZBHRTOWC.js";
102
102
  import {
103
103
  CONTENT_ONLY_STREAM_REMINDER,
104
104
  TEE_FINAL_USER_NUDGE,
@@ -116,7 +116,7 @@ import {
116
116
  runAgentLoop,
117
117
  stripToolCallReminder,
118
118
  teeStreamErrorSummary
119
- } from "./chunk-TEXT4DAT.js";
119
+ } from "./chunk-Y56UGZPX.js";
120
120
  import {
121
121
  AuthError,
122
122
  ProviderError,
@@ -132,7 +132,7 @@ import {
132
132
  } from "./chunk-IW3Q7AE5.js";
133
133
  import "./chunk-XNFIYS7G.js";
134
134
  import "./chunk-4BKXL7SM.js";
135
- import "./chunk-J6S2AHVT.js";
135
+ import "./chunk-MMP6SIB7.js";
136
136
  import {
137
137
  AGENTIC_BEHAVIOR_GUIDELINE,
138
138
  AUTHOR,
@@ -149,7 +149,7 @@ import {
149
149
  SKILLS_DIR_NAME,
150
150
  VERSION,
151
151
  buildUserIdentityPrompt
152
- } from "./chunk-MQPP52TH.js";
152
+ } from "./chunk-CUMSLQKQ.js";
153
153
 
154
154
  // src/index.ts
155
155
  import { program } from "commander";
@@ -2839,7 +2839,18 @@ Session '${this.resumeSessionId}' not found.
2839
2839
  this._interjectionActive = false;
2840
2840
  }
2841
2841
  /**
2842
- * 注册 Ctrl+V 剪贴板图片粘贴快捷键。
2842
+ * 注册剪贴板图片粘贴快捷键:**Alt+V(主)/ Ctrl+V(备)**。
2843
+ *
2844
+ * 为什么主键是 Alt+V:**Ctrl+V 在多数终端上根本传不到进程**。终端自己把它绑成
2845
+ * 「粘贴」动作后就消费掉了,转而按 bracketed paste 把剪贴板**文本**送进来;
2846
+ * 剪贴板里是图片时没有文本可送,于是表现为**按了完全没反应**——而这恰恰是截图后
2847
+ * 最想按的那个键(Win+Shift+S → Ctrl+V)。东叔 2026-08-29 在真实终端用按键探针
2848
+ * 实测坐实:按 Ctrl+V 收到的是 `ESC[200~ …剪贴板文本… ESC[201~`,**没有任何
2849
+ * ctrl+v 按键事件**;同一次探测里 `alt+v`(`ESC v`)、`ctrl+g`、`ctrl+o`、`f2`
2850
+ * 均能原样传入,故取 alt+v。
2851
+ *
2852
+ * Ctrl+V 分支**刻意保留**——终端若没抢这个键(部分终端,或用户自行解绑),
2853
+ * 老习惯照样能用;抢了的话它本来也进不来,留着零代价。
2843
2854
  *
2844
2855
  * 使用 prependListener 先于 readline 的 quotedInsert 处理器运行:
2845
2856
  * 1. 我们的 handler 在 setImmediate 中调用 rl.write('@imgPath ')
@@ -2882,7 +2893,8 @@ Session '${this.resumeSessionId}' not found.
2882
2893
  }
2883
2894
  setupClipboardPaste() {
2884
2895
  process.stdin.prependListener("keypress", (_ch, key) => {
2885
- if (!key?.ctrl || key?.name !== "v") return;
2896
+ if (key?.name !== "v") return;
2897
+ if (!key.meta && !key.ctrl) return;
2886
2898
  if (this.streamAbortController || this.toolExecutor.confirming || askUserContext.prompting || this.selecting) return;
2887
2899
  const imgPath = readClipboardImage();
2888
2900
  if (imgPath) {
@@ -2898,7 +2910,7 @@ Session '${this.resumeSessionId}' not found.
2898
2910
  const hint = getClipboardHint();
2899
2911
  process.stdout.write(
2900
2912
  theme.dim(`
2901
- \u2139 No image found in clipboard. Use @path to reference a local image file.`) + (hint ? theme.dim(`
2913
+ \u2139 No image found in clipboard. Use @path to reference a local image file, or /paste.`) + (hint ? theme.dim(`
2902
2914
  ${hint}`) : "") + "\n"
2903
2915
  );
2904
2916
  this.showPrompt();
@@ -3930,7 +3942,7 @@ process.on("unhandledRejection", (reason) => {
3930
3942
  });
3931
3943
  var builtInProviderIds = listBuiltInProviderMetadata().map(({ id }) => id).join("/");
3932
3944
  program.name("aicli").description("Cross-platform REPL-style AI CLI with multi-provider support").version(VERSION);
3933
- program.option("--provider <name>", `AI provider to use (${builtInProviderIds}, or any custom provider)`).option("-m, --model <name>", "Model to use").option("-p, --prompt <text>", "Headless mode: send a single prompt and exit (reads stdin as context if piped)").option("--system <prompt>", "System prompt override (headless mode)").option("--json", "Output result as JSON object (headless mode only)").option("--output-format <format>", "Output format: text (default) | streaming-json (NDJSON per-chunk, headless only)").option("--no-stream", "Disable streaming output").option("--allowed-tools <tools>", "Comma-separated whitelist of tools (e.g. bash,read_file)").option("--blocked-tools <tools>", "Comma-separated blacklist of tools (e.g. bash,write_file)").option("--resume <id>", "Resume a previous session by ID (prefix match supported)").option("--max-tool-rounds <n>", "Max agentic tool-call rounds per conversation (default: 200)").option("--think <mode>", "Thinking for this run: off | on | low | high | max (default: follow config)").action(async (options) => {
3945
+ program.option("--provider <name>", `AI provider to use (${builtInProviderIds}, or any custom provider)`).option("-m, --model <name>", "Model to use").option("-p, --prompt <text>", "Headless mode: send a single prompt and exit (reads stdin as context if piped)").option("--system <prompt>", "System prompt override (headless mode)").option("--json", "Output result as JSON object (headless mode only)").option("--output-format <format>", "Output format: text (default) | streaming-json (NDJSON per-chunk, headless only)").option("--include-thinking", "Keep inline <think> blocks in headless output (default: stripped)").option("--no-stream", "Disable streaming output").option("--allowed-tools <tools>", "Comma-separated whitelist of tools (e.g. bash,read_file)").option("--blocked-tools <tools>", "Comma-separated blacklist of tools (e.g. bash,write_file)").option("--resume <id>", "Resume a previous session by ID (prefix match supported)").option("--max-tool-rounds <n>", "Max agentic tool-call rounds per conversation (default: 200)").option("--think <mode>", "Thinking for this run: off | on | low | high | max (default: follow config)").action(async (options) => {
3934
3946
  if (options.prompt !== void 0) {
3935
3947
  await runHeadless(options);
3936
3948
  } else {
@@ -3992,7 +4004,7 @@ program.command("web").description("Start Web UI server with browser-based chat
3992
4004
  console.error("Error: Invalid port number. Must be between 1 and 65535.");
3993
4005
  process.exit(1);
3994
4006
  }
3995
- const { startWebServer } = await import("./server-7EX7ACXC.js");
4007
+ const { startWebServer } = await import("./server-ILSFJUK5.js");
3996
4008
  await startWebServer({ port, host: options.host });
3997
4009
  });
3998
4010
  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) => {
@@ -4159,11 +4171,11 @@ program.command("sessions").description("List recent conversation sessions").opt
4159
4171
  console.log(footer + "\n");
4160
4172
  });
4161
4173
  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) => {
4162
- const { runUsageCli } = await import("./usage-PMS676RM.js");
4174
+ const { runUsageCli } = await import("./usage-DXX4VHOQ.js");
4163
4175
  await runUsageCli(options);
4164
4176
  });
4165
4177
  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) => {
4166
- const { runDoctorCli } = await import("./doctor-cli-NUUXNPPD.js");
4178
+ const { runDoctorCli } = await import("./doctor-cli-UB5KUBVI.js");
4167
4179
  const argv = process.argv.slice(2);
4168
4180
  await runDoctorCli({
4169
4181
  json: !!options.json || argv.includes("--json"),
@@ -4172,7 +4184,7 @@ program.command("doctor").description("Health check: API keys, config, MCP, rece
4172
4184
  });
4173
4185
  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) => {
4174
4186
  try {
4175
- const batch = await import("./batch-CE6UCXLZ.js");
4187
+ const batch = await import("./batch-6YCLYEII.js");
4176
4188
  switch (action) {
4177
4189
  case "submit":
4178
4190
  if (!arg) {
@@ -4215,7 +4227,7 @@ program.command("batch <action> [arg] [arg2]").description("Anthropic Message Ba
4215
4227
  }
4216
4228
  });
4217
4229
  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) => {
4218
- const { startMcpServer } = await import("./server-YU3BZM73.js");
4230
+ const { startMcpServer } = await import("./server-YNVHKFGZ.js");
4219
4231
  await startMcpServer({
4220
4232
  allowDestructive: !!options.allowDestructive,
4221
4233
  allowOutsideCwd: !!options.allowOutsideCwd,
@@ -4228,7 +4240,7 @@ program.command("pr <action> [target]").description("PR review helpers: review |
4228
4240
  console.error(`Unknown pr action: ${action}. Use review | security-review | summarize.`);
4229
4241
  process.exit(1);
4230
4242
  }
4231
- const { runPrCli } = await import("./pr-5I7Y7542.js");
4243
+ const { runPrCli } = await import("./pr-MVUT6IOA.js");
4232
4244
  const result = await runPrCli({
4233
4245
  action,
4234
4246
  target,
@@ -4248,8 +4260,8 @@ program.command("pr <action> [target]").description("PR review helpers: review |
4248
4260
  process.exit(result.exitCode);
4249
4261
  });
4250
4262
  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) => {
4251
- const { runCi } = await import("./ci-3W2GIZTH.js");
4252
- const { formatCiResult } = await import("./ci-format-Z5N4I2I7.js");
4263
+ const { runCi } = await import("./ci-SIS77LEG.js");
4264
+ const { formatCiResult } = await import("./ci-format-LRMGY4ND.js");
4253
4265
  const formats = [options.json, options.markdown, options.sarif].filter(Boolean).length;
4254
4266
  if (formats > 1) {
4255
4267
  console.error("Choose only one output format: --json, --markdown, or --sarif.");
@@ -4324,6 +4336,7 @@ program.command("help").description("Show a comprehensive guide to all aicli fea
4324
4336
  ` ${Y}--system <prompt>${R} Override system prompt`,
4325
4337
  ` ${Y}--json${R} Output as JSON`,
4326
4338
  ` ${Y}--output-format <fmt>${R} text | streaming-json (NDJSON)`,
4339
+ ` ${Y}--include-thinking${R} Keep <think> blocks (default: stripped)`,
4327
4340
  ` ${D}echo "code" | aicli -p "explain" \u2190 pipe stdin as context${R}`,
4328
4341
  "",
4329
4342
  `${B}${C} \u25A0 WEB UI OPTIONS${R}`,
@@ -4407,7 +4420,7 @@ program.command("hub [topic]").description("Start multi-agent hub (discuss / bra
4407
4420
  config.get("customProviders"),
4408
4421
  config.getConfigDir()
4409
4422
  );
4410
- const { startHub } = await import("./hub-TQ2KT3ET.js");
4423
+ const { startHub } = await import("./hub-UWBNCMD4.js");
4411
4424
  await startHub(
4412
4425
  {
4413
4426
  topic: topic ?? "",
@@ -4542,6 +4555,12 @@ ${loaded.mergedContent}` : void 0
4542
4555
  if (u.inputTokens === 0 && u.outputTokens === 0) return;
4543
4556
  costTracker.addCost(providerId, model, u);
4544
4557
  };
4558
+ const keepThinking = options.includeThinking === true;
4559
+ const stripThinking = (text) => {
4560
+ if (keepThinking) return text;
4561
+ const f = new ThinkTagFilter();
4562
+ return f.push(text) + f.flush();
4563
+ };
4545
4564
  try {
4546
4565
  if (isStreamingJson) {
4547
4566
  const stream = provider.chatStream({
@@ -4556,16 +4575,20 @@ ${loaded.mergedContent}` : void 0
4556
4575
  });
4557
4576
  let fullContent = "";
4558
4577
  let finalUsage;
4578
+ const jsonFilter = new ThinkTagFilter();
4579
+ const emitDelta = (text) => {
4580
+ if (!text) return;
4581
+ fullContent += text;
4582
+ process.stdout.write(JSON.stringify({ type: "delta", text }) + "\n");
4583
+ };
4559
4584
  for await (const chunk of stream) {
4560
4585
  if (chunk.done) {
4561
4586
  finalUsage = chunk.usage;
4562
4587
  break;
4563
4588
  }
4564
- if (chunk.delta) {
4565
- fullContent += chunk.delta;
4566
- process.stdout.write(JSON.stringify({ type: "delta", text: chunk.delta }) + "\n");
4567
- }
4589
+ if (chunk.delta) emitDelta(keepThinking ? chunk.delta : jsonFilter.push(chunk.delta));
4568
4590
  }
4591
+ if (!keepThinking) emitDelta(jsonFilter.flush());
4569
4592
  const doneOut = {
4570
4593
  type: "done",
4571
4594
  content: fullContent,
@@ -4587,7 +4610,7 @@ ${loaded.mergedContent}` : void 0
4587
4610
  ...thinkingParams
4588
4611
  });
4589
4612
  const out = {
4590
- content: response.content,
4613
+ content: stripThinking(response.content),
4591
4614
  provider: providerId,
4592
4615
  model: response.model ?? model,
4593
4616
  usage: response.usage ?? null
@@ -4605,11 +4628,13 @@ ${loaded.mergedContent}` : void 0
4605
4628
  timeout,
4606
4629
  ...thinkingParams
4607
4630
  });
4631
+ const textFilter = new ThinkTagFilter();
4608
4632
  let streamUsage;
4609
4633
  for await (const chunk of stream) {
4610
4634
  if (chunk.usage) streamUsage = chunk.usage;
4611
- if (chunk.delta) process.stdout.write(chunk.delta);
4635
+ if (chunk.delta) process.stdout.write(keepThinking ? chunk.delta : textFilter.push(chunk.delta));
4612
4636
  }
4637
+ if (!keepThinking) process.stdout.write(textFilter.flush());
4613
4638
  recordUsage(streamUsage);
4614
4639
  process.stdout.write("\n");
4615
4640
  } else {
@@ -4624,7 +4649,7 @@ ${loaded.mergedContent}` : void 0
4624
4649
  ...thinkingParams
4625
4650
  });
4626
4651
  recordUsage(response.usage);
4627
- process.stdout.write(response.content + "\n");
4652
+ process.stdout.write(stripThinking(response.content) + "\n");
4628
4653
  }
4629
4654
  costTracker.flush();
4630
4655
  process.exit(0);
@@ -28,11 +28,11 @@ import {
28
28
  touchMemoryReferences,
29
29
  updateMemoryApproval,
30
30
  updateMemoryEntry
31
- } from "./chunk-RJ2UG2AE.js";
31
+ } from "./chunk-7KYONZUN.js";
32
32
  import "./chunk-3FEZSLGI.js";
33
33
  import "./chunk-HOSJZMQS.js";
34
34
  import "./chunk-IW3Q7AE5.js";
35
- import "./chunk-MQPP52TH.js";
35
+ import "./chunk-CUMSLQKQ.js";
36
36
  export {
37
37
  addMemoryEntry,
38
38
  backupMemoryStore,
@@ -27,11 +27,11 @@ import {
27
27
  touchMemoryReferences,
28
28
  updateMemoryApproval,
29
29
  updateMemoryEntry
30
- } from "./chunk-FFXTGDPY.js";
30
+ } from "./chunk-P3BJAJ34.js";
31
31
  import "./chunk-FSC6KEWU.js";
32
32
  import "./chunk-6BUTA5VW.js";
33
33
  import "./chunk-CGLYJRFA.js";
34
- import "./chunk-GKIKDPQW.js";
34
+ import "./chunk-UPJMIP5S.js";
35
35
  export {
36
36
  addMemoryEntry,
37
37
  backupMemoryStore,
@@ -2,8 +2,8 @@
2
2
  import {
3
3
  countSeverity,
4
4
  runCi
5
- } from "./chunk-QE24GSD3.js";
6
- import "./chunk-622UJ463.js";
5
+ } from "./chunk-HBFES3RR.js";
6
+ import "./chunk-3H7TVTAE.js";
7
7
  import {
8
8
  buildReviewPrompt,
9
9
  buildSecurityReviewPrompt,
@@ -14,16 +14,16 @@ import {
14
14
  } from "./chunk-6YZEZFX5.js";
15
15
  import {
16
16
  ProviderRegistry
17
- } from "./chunk-QMQFTZ7H.js";
17
+ } from "./chunk-QKZUWT3S.js";
18
18
  import {
19
19
  ConfigManager
20
- } from "./chunk-XMCIDG4I.js";
21
- import "./chunk-TEXT4DAT.js";
20
+ } from "./chunk-ZBHRTOWC.js";
21
+ import "./chunk-Y56UGZPX.js";
22
22
  import "./chunk-TU3L3PW7.js";
23
23
  import "./chunk-IW3Q7AE5.js";
24
24
  import {
25
25
  VERSION
26
- } from "./chunk-MQPP52TH.js";
26
+ } from "./chunk-CUMSLQKQ.js";
27
27
 
28
28
  // src/cli/pr.ts
29
29
  import { execFileSync } from "child_process";
@@ -2,8 +2,8 @@
2
2
  import {
3
3
  executeTests,
4
4
  runTestsTool
5
- } from "./chunk-J6S2AHVT.js";
6
- import "./chunk-MQPP52TH.js";
5
+ } from "./chunk-MMP6SIB7.js";
6
+ import "./chunk-CUMSLQKQ.js";
7
7
  export {
8
8
  executeTests,
9
9
  runTestsTool
@@ -1,8 +1,8 @@
1
1
  import {
2
2
  executeTests,
3
3
  runTestsTool
4
- } from "./chunk-3YOMCCFP.js";
5
- import "./chunk-GKIKDPQW.js";
4
+ } from "./chunk-OMA6DEAR.js";
5
+ import "./chunk-UPJMIP5S.js";
6
6
  export {
7
7
  executeTests,
8
8
  runTestsTool
@@ -81,7 +81,7 @@ import {
81
81
  skillHistoryNote,
82
82
  snapshotFile,
83
83
  stripRoutingTags
84
- } from "./chunk-XTZ5CYQ7.js";
84
+ } from "./chunk-SM7VOJ3B.js";
85
85
  import {
86
86
  CNY_PER_USD,
87
87
  CostTracker,
@@ -126,7 +126,7 @@ import {
126
126
  spawnAgentContext,
127
127
  truncateOutput,
128
128
  undoStack
129
- } from "./chunk-CNLTYENQ.js";
129
+ } from "./chunk-AIQMQCVF.js";
130
130
  import {
131
131
  buildReviewPrompt,
132
132
  buildSecurityReviewPrompt
@@ -153,7 +153,7 @@ import {
153
153
  restoreMemoryEntries,
154
154
  updateMemoryApproval,
155
155
  updateMemoryEntry
156
- } from "./chunk-RJ2UG2AE.js";
156
+ } from "./chunk-7KYONZUN.js";
157
157
  import "./chunk-4DEMGCK4.js";
158
158
  import "./chunk-UUSRWSSX.js";
159
159
  import "./chunk-CKH4KQ4E.js";
@@ -172,7 +172,7 @@ import {
172
172
  buildDoctorReport,
173
173
  formatDoctorReport,
174
174
  loadContextFiles
175
- } from "./chunk-UPMEREEO.js";
175
+ } from "./chunk-FARHJ42Q.js";
176
176
  import {
177
177
  describePlugin,
178
178
  getActivePluginAssets,
@@ -187,14 +187,14 @@ import {
187
187
  runTool,
188
188
  setPluginEnabled,
189
189
  trustPlugin
190
- } from "./chunk-F4ZNXA2R.js";
190
+ } from "./chunk-BOG6LVIC.js";
191
191
  import "./chunk-RS7SKYTS.js";
192
192
  import {
193
193
  ProviderRegistry
194
- } from "./chunk-QMQFTZ7H.js";
194
+ } from "./chunk-QKZUWT3S.js";
195
195
  import {
196
196
  ConfigManager
197
- } from "./chunk-XMCIDG4I.js";
197
+ } from "./chunk-ZBHRTOWC.js";
198
198
  import {
199
199
  CONTENT_ONLY_STREAM_REMINDER,
200
200
  TEE_FINAL_USER_NUDGE,
@@ -210,7 +210,7 @@ import {
210
210
  runAgentLoop,
211
211
  stripToolCallReminder,
212
212
  teeStreamErrorSummary
213
- } from "./chunk-TEXT4DAT.js";
213
+ } from "./chunk-Y56UGZPX.js";
214
214
  import "./chunk-TU3L3PW7.js";
215
215
  import {
216
216
  formatGitContextForPrompt,
@@ -225,7 +225,7 @@ import {
225
225
  maskConfigSecrets
226
226
  } from "./chunk-XNFIYS7G.js";
227
227
  import "./chunk-4BKXL7SM.js";
228
- import "./chunk-J6S2AHVT.js";
228
+ import "./chunk-MMP6SIB7.js";
229
229
  import {
230
230
  AGENTIC_BEHAVIOR_GUIDELINE,
231
231
  AUTHOR,
@@ -241,7 +241,7 @@ import {
241
241
  SKILLS_DIR_NAME,
242
242
  VERSION,
243
243
  buildUserIdentityPrompt
244
- } from "./chunk-MQPP52TH.js";
244
+ } from "./chunk-CUMSLQKQ.js";
245
245
 
246
246
  // src/web/server.ts
247
247
  import express from "express";
@@ -930,7 +930,7 @@ Cache: write=${cacheCreate} read=${cacheRead}` : "";
930
930
  Cost: ${formatCost(cost)}` : "";
931
931
  let memoryLine = "";
932
932
  try {
933
- const { countPendingMemories: countPendingMemories2 } = await import("./persistent-memory-NX5TEFQ5.js");
933
+ const { countPendingMemories: countPendingMemories2 } = await import("./persistent-memory-GQPXSWDK.js");
934
934
  const pending = countPendingMemories2(ctx.config.getConfigDir());
935
935
  if (pending > 0) memoryLine = `
936
936
  Memory: \u26A0 ${pending} pending approval \u2014 see the Memory panel or /memory`;
@@ -1854,7 +1854,7 @@ async function handleTest(args, ctx) {
1854
1854
  const isCommand = argStr.includes(" ") || /^(mvn|gradle|npm|pytest|cargo|go)\b/.test(argStr);
1855
1855
  testArgs = isCommand ? { command: argStr } : { filter: argStr };
1856
1856
  }
1857
- const runTests = ctx.runTests ?? (await import("./run-tests-G5E6LLD4.js")).executeTests;
1857
+ const runTests = ctx.runTests ?? (await import("./run-tests-BNKQT42K.js")).executeTests;
1858
1858
  const report = await runTests(testArgs);
1859
1859
  ctx.send({ type: "info", message: report });
1860
1860
  } catch (err) {
@@ -2129,7 +2129,7 @@ async function handleMemory(args, ctx) {
2129
2129
  }
2130
2130
  if (intent.kind === "status") {
2131
2131
  const { getChatIndexStatus } = await import("./chat-index-2D5GK2DB.js");
2132
- const { listMemoryEntries: listMemoryEntries2, isMemoryExpired: isMemoryExpired2, formatMemoryForPrompt: formatMemoryForPrompt2 } = await import("./persistent-memory-NX5TEFQ5.js");
2132
+ const { listMemoryEntries: listMemoryEntries2, isMemoryExpired: isMemoryExpired2, formatMemoryForPrompt: formatMemoryForPrompt2 } = await import("./persistent-memory-GQPXSWDK.js");
2133
2133
  const memories = listMemoryEntries2(configDir, { includeExpired: true, includeRejected: true });
2134
2134
  const injected = formatMemoryForPrompt2(configDir, process.cwd(), ctx.config.get("memory")?.maxChars);
2135
2135
  const view = buildMemoryStatusView({
@@ -2152,7 +2152,7 @@ async function handleMemory(args, ctx) {
2152
2152
  return;
2153
2153
  }
2154
2154
  if (intent.kind === "recall") {
2155
- const { searchPersistentMemories, touchMemoryReferences } = await import("./persistent-memory-NX5TEFQ5.js");
2155
+ const { searchPersistentMemories, touchMemoryReferences } = await import("./persistent-memory-GQPXSWDK.js");
2156
2156
  const { searchChatMemory } = await import("./chat-index-2D5GK2DB.js");
2157
2157
  const persistentHits = searchPersistentMemories(configDir, intent.query, process.cwd(), 3);
2158
2158
  if (persistentHits.length > 0) {
@@ -2273,7 +2273,7 @@ async function handleMemory(args, ctx) {
2273
2273
  ctx.handleMemoryManage(intent.action, args[1], intent.action === "expire" ? args[2] : void 0);
2274
2274
  } else if (intent.kind === "export") {
2275
2275
  if (args[1] === "md") {
2276
- const { exportMemoryEntries: exportMemoryEntries2 } = await import("./persistent-memory-NX5TEFQ5.js");
2276
+ const { exportMemoryEntries: exportMemoryEntries2 } = await import("./persistent-memory-GQPXSWDK.js");
2277
2277
  ctx.send({
2278
2278
  type: "export_data",
2279
2279
  format: "md",
@@ -1,9 +1,9 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  ToolRegistry
4
- } from "./chunk-CNLTYENQ.js";
4
+ } from "./chunk-AIQMQCVF.js";
5
5
  import "./chunk-GHWZVPUV.js";
6
- import "./chunk-RJ2UG2AE.js";
6
+ import "./chunk-7KYONZUN.js";
7
7
  import "./chunk-4DEMGCK4.js";
8
8
  import "./chunk-UUSRWSSX.js";
9
9
  import "./chunk-CKH4KQ4E.js";
@@ -14,20 +14,20 @@ import "./chunk-NYNSYLFY.js";
14
14
  import "./chunk-3FEZSLGI.js";
15
15
  import {
16
16
  runTool
17
- } from "./chunk-F4ZNXA2R.js";
17
+ } from "./chunk-BOG6LVIC.js";
18
18
  import "./chunk-RS7SKYTS.js";
19
19
  import {
20
20
  getDangerLevel,
21
21
  schemaToJsonSchema
22
- } from "./chunk-TEXT4DAT.js";
22
+ } from "./chunk-Y56UGZPX.js";
23
23
  import "./chunk-TU3L3PW7.js";
24
24
  import "./chunk-HOSJZMQS.js";
25
25
  import "./chunk-IW3Q7AE5.js";
26
26
  import "./chunk-4BKXL7SM.js";
27
- import "./chunk-J6S2AHVT.js";
27
+ import "./chunk-MMP6SIB7.js";
28
28
  import {
29
29
  VERSION
30
- } from "./chunk-MQPP52TH.js";
30
+ } from "./chunk-CUMSLQKQ.js";
31
31
 
32
32
  // src/mcp/server.ts
33
33
  import { createInterface } from "readline";
@@ -4,9 +4,9 @@ import {
4
4
  googleSearchContext,
5
5
  isToolCapableProvider,
6
6
  truncateOutput
7
- } from "./chunk-CNLTYENQ.js";
7
+ } from "./chunk-AIQMQCVF.js";
8
8
  import "./chunk-GHWZVPUV.js";
9
- import "./chunk-RJ2UG2AE.js";
9
+ import "./chunk-7KYONZUN.js";
10
10
  import "./chunk-4DEMGCK4.js";
11
11
  import "./chunk-UUSRWSSX.js";
12
12
  import "./chunk-CKH4KQ4E.js";
@@ -17,22 +17,22 @@ import "./chunk-NYNSYLFY.js";
17
17
  import "./chunk-3FEZSLGI.js";
18
18
  import {
19
19
  runTool
20
- } from "./chunk-F4ZNXA2R.js";
20
+ } from "./chunk-BOG6LVIC.js";
21
21
  import "./chunk-RS7SKYTS.js";
22
22
  import {
23
23
  getDangerLevel,
24
24
  runLeanAgentLoop
25
- } from "./chunk-TEXT4DAT.js";
25
+ } from "./chunk-Y56UGZPX.js";
26
26
  import "./chunk-TU3L3PW7.js";
27
27
  import "./chunk-HOSJZMQS.js";
28
28
  import {
29
29
  atomicWriteFileSync
30
30
  } from "./chunk-IW3Q7AE5.js";
31
31
  import "./chunk-4BKXL7SM.js";
32
- import "./chunk-J6S2AHVT.js";
32
+ import "./chunk-MMP6SIB7.js";
33
33
  import {
34
34
  SUBAGENT_ALLOWED_TOOLS
35
- } from "./chunk-MQPP52TH.js";
35
+ } from "./chunk-CUMSLQKQ.js";
36
36
 
37
37
  // src/hub/task-orchestrator.ts
38
38
  import { createInterface } from "readline";
@@ -9,10 +9,10 @@ import {
9
9
  import "./chunk-RS7SKYTS.js";
10
10
  import {
11
11
  ConfigManager
12
- } from "./chunk-XMCIDG4I.js";
12
+ } from "./chunk-ZBHRTOWC.js";
13
13
  import "./chunk-TU3L3PW7.js";
14
14
  import "./chunk-IW3Q7AE5.js";
15
- import "./chunk-MQPP52TH.js";
15
+ import "./chunk-CUMSLQKQ.js";
16
16
 
17
17
  // src/cli/usage.ts
18
18
  function classifyRowCost(row) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "jinzd-ai-cli",
3
- "version": "0.4.292",
3
+ "version": "0.4.294",
4
4
  "description": "Cross-platform REPL-style AI CLI with multi-provider support",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",