jinzd-ai-cli 0.4.171 → 0.4.173

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.
@@ -1,9 +1,9 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  ConfigManager
4
- } from "./chunk-6JTVUGSF.js";
4
+ } from "./chunk-Z5HW5NA4.js";
5
5
  import "./chunk-TZQHYZKT.js";
6
- import "./chunk-RSZWLQU4.js";
6
+ import "./chunk-KPUE4DLX.js";
7
7
  import "./chunk-PDX44BCA.js";
8
8
 
9
9
  // src/cli/batch.ts
@@ -1801,6 +1801,7 @@ function buildPhantomCorrectionMessage(phantoms) {
1801
1801
  const list = phantoms.map((p) => ` - ${p}`).join("\n");
1802
1802
  return "You claimed to have written the following file(s), but no matching write_file tool call was actually made in this turn:\n" + list + '\n\nEach of these files does NOT exist on disk. You MUST now invoke write_file (via the function calling API) for every missing file listed above. Do NOT output another "completion summary" until the tool calls have actually been made.';
1803
1803
  }
1804
+ var DSML_PIPE_CLASS = "[|\\uFF5C\\u2502\\u2503\\u01C0]";
1804
1805
  var PSEUDO_TOOL_CALL_PATTERNS = [
1805
1806
  // <tool_call name="..."> ... </tool_call> (DeepSeek V4 thinking, GLM)
1806
1807
  /<tool_call\s+name\s*=\s*["'][\w._-]+["']/,
@@ -1823,7 +1824,15 @@ var PSEUDO_TOOL_CALL_PATTERNS = [
1823
1824
  // v0.4.112: leading ```markdown / ```md fence wrapping the entire document.
1824
1825
  // DeepSeek V4 Pro Thinking sometimes "politely" wraps its document output
1825
1826
  // in a markdown fence. The fence ends up literally in the saved file.
1826
- /^\s*```\s*(?:markdown|md|gfm)\b/im
1827
+ /^\s*```\s*(?:markdown|md|gfm)\b/im,
1828
+ // v0.4.173: DeepSeek V4 DSML pseudo-tool-call markup leaked as text. DeepSeek
1829
+ // emits a fake tool call using its native special-token markup
1830
+ // <||DSML||tool_calls> <||DSML||invoke name="write"> <||DSML||parameter …>
1831
+ // where the "pipe" is U+FF5C FULLWIDTH VERTICAL LINE (the same token family as
1832
+ // <|User|>/<|Assistant|>). We saw an exam paper saved via save_last_response
1833
+ // whose tee stream was preamble + this DSML wrapper + the real document body.
1834
+ // The earlier <invoke …> pattern uses ASCII < > and does NOT match these.
1835
+ new RegExp(`<\\/?\\s*${DSML_PIPE_CLASS}+\\s*DSML\\s*${DSML_PIPE_CLASS}+`, "i")
1827
1836
  ];
1828
1837
  function detectPseudoToolCalls(content) {
1829
1838
  if (!content || content.length === 0) return null;
@@ -1835,6 +1844,12 @@ function detectPseudoToolCalls(content) {
1835
1844
  function stripPseudoToolCalls(content) {
1836
1845
  if (!content) return content;
1837
1846
  let out = content;
1847
+ const dsmlBody = extractDsmlContent(out);
1848
+ if (dsmlBody !== null) {
1849
+ out = dsmlBody;
1850
+ } else {
1851
+ out = stripDsmlTags(out);
1852
+ }
1838
1853
  out = out.replace(/<tool_call\b[^>]*>[\s\S]*?<\/tool_call>/gi, "");
1839
1854
  out = out.replace(/<tool_call\b[^>]*\/>/gi, "");
1840
1855
  out = out.replace(/<function_calls\b[^>]*>[\s\S]*?<\/function_calls>/gi, "");
@@ -1850,6 +1865,33 @@ function stripPseudoToolCalls(content) {
1850
1865
  out = out.replace(/\n{3,}/g, "\n\n").trim();
1851
1866
  return out;
1852
1867
  }
1868
+ function extractDsmlContent(content) {
1869
+ if (!content) return null;
1870
+ const P = DSML_PIPE_CLASS;
1871
+ const re = new RegExp(
1872
+ `<\\s*${P}+\\s*DSML\\s*${P}+\\s*parameter\\b[^>]*\\bname\\s*=\\s*["']content["'][^>]*>([\\s\\S]*?)<\\s*/\\s*${P}+\\s*DSML\\s*${P}+\\s*parameter\\s*>`,
1873
+ "i"
1874
+ );
1875
+ const m = content.match(re);
1876
+ if (m && typeof m[1] === "string") {
1877
+ const body = m[1].trim();
1878
+ return body.length > 0 ? body : null;
1879
+ }
1880
+ return null;
1881
+ }
1882
+ function stripDsmlTags(content) {
1883
+ const P = DSML_PIPE_CLASS;
1884
+ let out = content;
1885
+ out = out.replace(
1886
+ new RegExp(
1887
+ `<\\s*${P}+\\s*DSML\\s*${P}+\\s*tool_calls\\b[\\s\\S]*?<\\s*/\\s*${P}+\\s*DSML\\s*${P}+\\s*tool_calls\\s*>`,
1888
+ "gi"
1889
+ ),
1890
+ ""
1891
+ );
1892
+ out = out.replace(new RegExp(`<\\s*/?\\s*${P}+\\s*DSML\\s*${P}+[^>]*>`, "gi"), "");
1893
+ return out;
1894
+ }
1853
1895
  function unwrapDocumentFence(content) {
1854
1896
  const trimmed = content.trim();
1855
1897
  const open = trimmed.match(/^```\s*(markdown|md|gfm)?\s*\n/i);
@@ -5,10 +5,10 @@ import {
5
5
  } from "./chunk-HDSKW7Q3.js";
6
6
  import {
7
7
  runTestsTool
8
- } from "./chunk-MELFYYS7.js";
8
+ } from "./chunk-ORSIBDWI.js";
9
9
  import {
10
10
  runTool
11
- } from "./chunk-H53UCPFF.js";
11
+ } from "./chunk-WC6QXBBW.js";
12
12
  import {
13
13
  getDangerLevel,
14
14
  isFileWriteTool
@@ -25,7 +25,7 @@ import {
25
25
  SUBAGENT_ALLOWED_TOOLS,
26
26
  SUBAGENT_DEFAULT_MAX_ROUNDS,
27
27
  SUBAGENT_MAX_ROUNDS_LIMIT
28
- } from "./chunk-RSZWLQU4.js";
28
+ } from "./chunk-KPUE4DLX.js";
29
29
  import {
30
30
  fileCheckpoints
31
31
  } from "./chunk-4BKXL7SM.js";
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
 
3
3
  // src/core/constants.ts
4
- var VERSION = "0.4.171";
4
+ var VERSION = "0.4.173";
5
5
  var APP_NAME = "ai-cli";
6
6
  var CONFIG_DIR_NAME = ".aicli";
7
7
  var CONFIG_FILE_NAME = "config.json";
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  TEST_TIMEOUT
4
- } from "./chunk-RSZWLQU4.js";
4
+ } from "./chunk-KPUE4DLX.js";
5
5
 
6
6
  // src/tools/builtin/run-tests.ts
7
7
  import { execSync, spawnSync } from "child_process";
@@ -6,7 +6,7 @@ import { platform } from "os";
6
6
  import chalk from "chalk";
7
7
 
8
8
  // src/core/constants.ts
9
- var VERSION = "0.4.171";
9
+ var VERSION = "0.4.173";
10
10
  var APP_NAME = "ai-cli";
11
11
  var CONFIG_DIR_NAME = ".aicli";
12
12
  var CONFIG_FILE_NAME = "config.json";
@@ -2,7 +2,7 @@
2
2
  import {
3
3
  CONFIG_DIR_NAME,
4
4
  VERSION
5
- } from "./chunk-RSZWLQU4.js";
5
+ } from "./chunk-KPUE4DLX.js";
6
6
 
7
7
  // src/diagnostics/crash-log.ts
8
8
  import {
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  truncateForPersist
4
- } from "./chunk-WG4THOHH.js";
4
+ } from "./chunk-HHWZXSSF.js";
5
5
  import {
6
6
  APP_NAME,
7
7
  CONFIG_DIR_NAME,
@@ -11,7 +11,7 @@ import {
11
11
  MCP_PROTOCOL_VERSION,
12
12
  MCP_TOOL_PREFIX,
13
13
  VERSION
14
- } from "./chunk-RSZWLQU4.js";
14
+ } from "./chunk-KPUE4DLX.js";
15
15
 
16
16
  // src/mcp/client.ts
17
17
  import { spawn } from "child_process";
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  CONFIG_DIR_NAME
4
- } from "./chunk-RSZWLQU4.js";
4
+ } from "./chunk-KPUE4DLX.js";
5
5
 
6
6
  // src/diagnostics/tool-stats.ts
7
7
  import { existsSync, readFileSync, writeFileSync, mkdirSync, renameSync } from "fs";
@@ -8,7 +8,7 @@ import {
8
8
  CONFIG_FILE_NAME,
9
9
  HISTORY_DIR_NAME,
10
10
  PLUGINS_DIR_NAME
11
- } from "./chunk-RSZWLQU4.js";
11
+ } from "./chunk-KPUE4DLX.js";
12
12
 
13
13
  // src/config/config-manager.ts
14
14
  import { readFileSync, writeFileSync, existsSync, mkdirSync } from "fs";
@@ -6,15 +6,15 @@ import {
6
6
  } from "./chunk-HLWUDRBO.js";
7
7
  import {
8
8
  ProviderRegistry
9
- } from "./chunk-GNJOC6ZN.js";
9
+ } from "./chunk-BFFVAX6T.js";
10
10
  import "./chunk-NXXNLLSG.js";
11
11
  import {
12
12
  ConfigManager
13
- } from "./chunk-6JTVUGSF.js";
13
+ } from "./chunk-Z5HW5NA4.js";
14
14
  import "./chunk-TZQHYZKT.js";
15
15
  import {
16
16
  VERSION
17
- } from "./chunk-RSZWLQU4.js";
17
+ } from "./chunk-KPUE4DLX.js";
18
18
  import "./chunk-PDX44BCA.js";
19
19
 
20
20
  // src/cli/ci.ts
@@ -36,7 +36,7 @@ import {
36
36
  TEST_TIMEOUT,
37
37
  VERSION,
38
38
  buildUserIdentityPrompt
39
- } from "./chunk-RSZWLQU4.js";
39
+ } from "./chunk-KPUE4DLX.js";
40
40
  import "./chunk-PDX44BCA.js";
41
41
  export {
42
42
  AGENTIC_BEHAVIOR_GUIDELINE,
@@ -2,26 +2,26 @@
2
2
  import {
3
3
  getConfigDirUsage,
4
4
  listRecentCrashes
5
- } from "./chunk-IZY4MCKG.js";
5
+ } from "./chunk-SJICV5XL.js";
6
6
  import {
7
7
  ProviderRegistry
8
- } from "./chunk-GNJOC6ZN.js";
8
+ } from "./chunk-BFFVAX6T.js";
9
9
  import {
10
10
  getStatsSnapshot,
11
11
  getTopFailingTools,
12
12
  getTopUsedTools,
13
13
  resetStats
14
- } from "./chunk-H53UCPFF.js";
14
+ } from "./chunk-WC6QXBBW.js";
15
15
  import "./chunk-NXXNLLSG.js";
16
16
  import {
17
17
  ConfigManager
18
- } from "./chunk-6JTVUGSF.js";
18
+ } from "./chunk-Z5HW5NA4.js";
19
19
  import "./chunk-TZQHYZKT.js";
20
20
  import {
21
21
  DEV_STATE_FILE_NAME,
22
22
  MEMORY_FILE_NAME,
23
23
  VERSION
24
- } from "./chunk-RSZWLQU4.js";
24
+ } from "./chunk-KPUE4DLX.js";
25
25
  import "./chunk-PDX44BCA.js";
26
26
 
27
27
  // src/diagnostics/doctor-cli.ts
@@ -36,7 +36,7 @@ import {
36
36
  VERSION,
37
37
  buildUserIdentityPrompt,
38
38
  runTestsTool
39
- } from "./chunk-YMH6BKAE.js";
39
+ } from "./chunk-QM6O4HZS.js";
40
40
  import {
41
41
  hasSemanticIndex,
42
42
  semanticSearch
@@ -2328,6 +2328,7 @@ function extractBashCommands(extraMessages) {
2328
2328
  }
2329
2329
  return cmds;
2330
2330
  }
2331
+ var DSML_PIPE_CLASS = "[|\\uFF5C\\u2502\\u2503\\u01C0]";
2331
2332
  var PSEUDO_TOOL_CALL_PATTERNS = [
2332
2333
  // <tool_call name="..."> ... </tool_call> (DeepSeek V4 thinking, GLM)
2333
2334
  /<tool_call\s+name\s*=\s*["'][\w._-]+["']/,
@@ -2350,7 +2351,15 @@ var PSEUDO_TOOL_CALL_PATTERNS = [
2350
2351
  // v0.4.112: leading ```markdown / ```md fence wrapping the entire document.
2351
2352
  // DeepSeek V4 Pro Thinking sometimes "politely" wraps its document output
2352
2353
  // in a markdown fence. The fence ends up literally in the saved file.
2353
- /^\s*```\s*(?:markdown|md|gfm)\b/im
2354
+ /^\s*```\s*(?:markdown|md|gfm)\b/im,
2355
+ // v0.4.173: DeepSeek V4 DSML pseudo-tool-call markup leaked as text. DeepSeek
2356
+ // emits a fake tool call using its native special-token markup
2357
+ // <||DSML||tool_calls> <||DSML||invoke name="write"> <||DSML||parameter …>
2358
+ // where the "pipe" is U+FF5C FULLWIDTH VERTICAL LINE (the same token family as
2359
+ // <|User|>/<|Assistant|>). We saw an exam paper saved via save_last_response
2360
+ // whose tee stream was preamble + this DSML wrapper + the real document body.
2361
+ // The earlier <invoke …> pattern uses ASCII < > and does NOT match these.
2362
+ new RegExp(`<\\/?\\s*${DSML_PIPE_CLASS}+\\s*DSML\\s*${DSML_PIPE_CLASS}+`, "i")
2354
2363
  ];
2355
2364
  function detectPseudoToolCalls(content) {
2356
2365
  if (!content || content.length === 0) return null;
@@ -2362,6 +2371,12 @@ function detectPseudoToolCalls(content) {
2362
2371
  function stripPseudoToolCalls(content) {
2363
2372
  if (!content) return content;
2364
2373
  let out = content;
2374
+ const dsmlBody = extractDsmlContent(out);
2375
+ if (dsmlBody !== null) {
2376
+ out = dsmlBody;
2377
+ } else {
2378
+ out = stripDsmlTags(out);
2379
+ }
2365
2380
  out = out.replace(/<tool_call\b[^>]*>[\s\S]*?<\/tool_call>/gi, "");
2366
2381
  out = out.replace(/<tool_call\b[^>]*\/>/gi, "");
2367
2382
  out = out.replace(/<function_calls\b[^>]*>[\s\S]*?<\/function_calls>/gi, "");
@@ -2377,6 +2392,33 @@ function stripPseudoToolCalls(content) {
2377
2392
  out = out.replace(/\n{3,}/g, "\n\n").trim();
2378
2393
  return out;
2379
2394
  }
2395
+ function extractDsmlContent(content) {
2396
+ if (!content) return null;
2397
+ const P = DSML_PIPE_CLASS;
2398
+ const re = new RegExp(
2399
+ `<\\s*${P}+\\s*DSML\\s*${P}+\\s*parameter\\b[^>]*\\bname\\s*=\\s*["']content["'][^>]*>([\\s\\S]*?)<\\s*/\\s*${P}+\\s*DSML\\s*${P}+\\s*parameter\\s*>`,
2400
+ "i"
2401
+ );
2402
+ const m = content.match(re);
2403
+ if (m && typeof m[1] === "string") {
2404
+ const body = m[1].trim();
2405
+ return body.length > 0 ? body : null;
2406
+ }
2407
+ return null;
2408
+ }
2409
+ function stripDsmlTags(content) {
2410
+ const P = DSML_PIPE_CLASS;
2411
+ let out = content;
2412
+ out = out.replace(
2413
+ new RegExp(
2414
+ `<\\s*${P}+\\s*DSML\\s*${P}+\\s*tool_calls\\b[\\s\\S]*?<\\s*/\\s*${P}+\\s*DSML\\s*${P}+\\s*tool_calls\\s*>`,
2415
+ "gi"
2416
+ ),
2417
+ ""
2418
+ );
2419
+ out = out.replace(new RegExp(`<\\s*/?\\s*${P}+\\s*DSML\\s*${P}+[^>]*>`, "gi"), "");
2420
+ return out;
2421
+ }
2380
2422
  function unwrapDocumentFence(content) {
2381
2423
  const trimmed = content.trim();
2382
2424
  const open = trimmed.match(/^```\s*(markdown|md|gfm)?\s*\n/i);
@@ -13548,7 +13590,7 @@ ${undoResults.map((r) => ` \u2022 ${r}`).join("\n")}` });
13548
13590
  case "test": {
13549
13591
  this.send({ type: "info", message: "\u{1F9EA} Running tests..." });
13550
13592
  try {
13551
- const { executeTests } = await import("./run-tests-A2Q5VMHF.js");
13593
+ const { executeTests } = await import("./run-tests-F35PM2HT.js");
13552
13594
  const argStr = args.join(" ").trim();
13553
13595
  let testArgs = {};
13554
13596
  if (argStr) {
@@ -155,7 +155,7 @@ ${content}`);
155
155
  }
156
156
  }
157
157
  async function runTaskMode(config, providers, configManager, topic) {
158
- const { TaskOrchestrator } = await import("./task-orchestrator-U7KU4SOS.js");
158
+ const { TaskOrchestrator } = await import("./task-orchestrator-ANDRKQ25.js");
159
159
  const orchestrator = new TaskOrchestrator(config, providers, configManager);
160
160
  let interrupted = false;
161
161
  const onSigint = () => {
package/dist/index.js CHANGED
@@ -18,7 +18,7 @@ import {
18
18
  saveDevState,
19
19
  sessionHasMeaningfulContent,
20
20
  setupProxy
21
- } from "./chunk-57H6YNXY.js";
21
+ } from "./chunk-T2M4KWEG.js";
22
22
  import {
23
23
  ToolExecutor,
24
24
  ToolRegistry,
@@ -37,10 +37,10 @@ import {
37
37
  spawnAgentContext,
38
38
  theme,
39
39
  undoStack
40
- } from "./chunk-WG4THOHH.js";
40
+ } from "./chunk-HHWZXSSF.js";
41
41
  import "./chunk-HDSKW7Q3.js";
42
42
  import "./chunk-ZWVIDFGY.js";
43
- import "./chunk-MELFYYS7.js";
43
+ import "./chunk-ORSIBDWI.js";
44
44
  import {
45
45
  SessionManager,
46
46
  getContentText
@@ -49,7 +49,7 @@ import {
49
49
  getConfigDirUsage,
50
50
  listRecentCrashes,
51
51
  writeCrashLog
52
- } from "./chunk-IZY4MCKG.js";
52
+ } from "./chunk-SJICV5XL.js";
53
53
  import {
54
54
  CONTENT_ONLY_STREAM_REMINDER,
55
55
  HALLUCINATION_CORRECTION_MESSAGE,
@@ -68,17 +68,17 @@ import {
68
68
  looksLikeDocumentBody,
69
69
  stripPseudoToolCalls,
70
70
  stripToolCallReminder
71
- } from "./chunk-GNJOC6ZN.js";
71
+ } from "./chunk-BFFVAX6T.js";
72
72
  import {
73
73
  getStatsSnapshot,
74
74
  getTopFailingTools,
75
75
  getTopUsedTools,
76
76
  installFlushOnExit
77
- } from "./chunk-H53UCPFF.js";
77
+ } from "./chunk-WC6QXBBW.js";
78
78
  import "./chunk-NXXNLLSG.js";
79
79
  import {
80
80
  ConfigManager
81
- } from "./chunk-6JTVUGSF.js";
81
+ } from "./chunk-Z5HW5NA4.js";
82
82
  import {
83
83
  AuthError,
84
84
  ProviderError,
@@ -105,7 +105,7 @@ import {
105
105
  SKILLS_DIR_NAME,
106
106
  VERSION,
107
107
  buildUserIdentityPrompt
108
- } from "./chunk-RSZWLQU4.js";
108
+ } from "./chunk-KPUE4DLX.js";
109
109
  import {
110
110
  formatGitContextForPrompt,
111
111
  getGitContext,
@@ -1786,7 +1786,7 @@ No tools match "${filter}".
1786
1786
  const { join: join6 } = await import("path");
1787
1787
  const { existsSync: existsSync6 } = await import("fs");
1788
1788
  const { getGitRoot: getGitRoot2 } = await import("./git-context-7KIP4X2V.js");
1789
- const { MCP_PROJECT_CONFIG_NAME: MCP_PROJECT_CONFIG_NAME2 } = await import("./constants-OMTUJRKU.js");
1789
+ const { MCP_PROJECT_CONFIG_NAME: MCP_PROJECT_CONFIG_NAME2 } = await import("./constants-HD73ZEMX.js");
1790
1790
  const { approveProject, hashMcpFile } = await import("./project-trust-IFM7FXEV.js");
1791
1791
  const cwd = process.cwd();
1792
1792
  const projectRoot = getGitRoot2(cwd) ?? cwd;
@@ -2847,7 +2847,7 @@ ${hint}` : "")
2847
2847
  usage: "/test [command|filter]",
2848
2848
  async execute(args, ctx) {
2849
2849
  try {
2850
- const { executeTests } = await import("./run-tests-AYADOMOF.js");
2850
+ const { executeTests } = await import("./run-tests-U6GFM77T.js");
2851
2851
  const argStr = args.join(" ").trim();
2852
2852
  let testArgs = {};
2853
2853
  if (argStr) {
@@ -4761,6 +4761,8 @@ var Repl = class {
4761
4761
  currentProvider;
4762
4762
  currentModel;
4763
4763
  running = false;
4764
+ /** 是否已注册 bracketed-paste 的 process.exit 还原钩子(只注册一次) */
4765
+ bracketedPasteRestoreHooked = false;
4764
4766
  renderer;
4765
4767
  commands;
4766
4768
  toolRegistry;
@@ -5692,6 +5694,7 @@ Session '${this.resumeSessionId}' not found.
5692
5694
  }
5693
5695
  }
5694
5696
  this.setupClipboardPaste();
5697
+ this.enableBracketedPaste();
5695
5698
  this.rl.on("SIGINT", () => {
5696
5699
  if (this.streamAbortController) {
5697
5700
  this.streamAbortController.abort();
@@ -6268,6 +6271,39 @@ Session '${this.resumeSessionId}' not found.
6268
6271
  * 3. 后续字符正常插入
6269
6272
  * 最终 readline 缓冲区包含完整的 @路径,用户可继续追加描述文字后回车发送。
6270
6273
  */
6274
+ /**
6275
+ * 开启终端 bracketed paste 模式(ESC[?2004h)。
6276
+ *
6277
+ * 粘贴时终端把内容包进 `ESC[200~ … ESC[201~`,Node readline 原生识别这对标记,
6278
+ * 把整段粘贴当作**一次**插入渲染——而不是逐字符触发 `_refreshLine()` 整行重绘。
6279
+ * 这消除了长中文(双宽字符)输入折行时多帧重绘叠加产生的“鬼影”
6280
+ * (prompt `[provider] >` 串进正文、文字错位重复)。markers 由 readline 自动剥离,
6281
+ * 不会进入 `rl.line`,多行粘贴的逐行 `line` 事件也保持不变。
6282
+ *
6283
+ * 仅在 TTY 下启用;并注册一次性 `process.exit` 钩子,确保异常退出时也还原终端
6284
+ * (否则之后运行的其它程序会收到带 200~/201~ 标记的粘贴)。
6285
+ */
6286
+ enableBracketedPaste() {
6287
+ if (!process.stdout.isTTY) return;
6288
+ process.stdout.write("\x1B[?2004h");
6289
+ if (!this.bracketedPasteRestoreHooked) {
6290
+ this.bracketedPasteRestoreHooked = true;
6291
+ process.once("exit", () => {
6292
+ try {
6293
+ if (process.stdout.isTTY) process.stdout.write("\x1B[?2004l");
6294
+ } catch {
6295
+ }
6296
+ });
6297
+ }
6298
+ }
6299
+ /** 关闭 bracketed paste 模式(ESC[?2004l),还原终端,供正常退出路径调用。 */
6300
+ disableBracketedPaste() {
6301
+ if (!process.stdout.isTTY) return;
6302
+ try {
6303
+ process.stdout.write("\x1B[?2004l");
6304
+ } catch {
6305
+ }
6306
+ }
6271
6307
  setupClipboardPaste() {
6272
6308
  process.stdin.prependListener("keypress", (_ch, key) => {
6273
6309
  if (!key?.ctrl || key?.name !== "v") return;
@@ -7499,6 +7535,7 @@ Tip: You can continue the conversation by asking the AI to proceed.`
7499
7535
  process.stderr.write(`[mcp] cleanup error: ${err instanceof Error ? err.message : err}
7500
7536
  `);
7501
7537
  });
7538
+ this.disableBracketedPaste();
7502
7539
  this.rl.close();
7503
7540
  console.log(theme.dim("\nGoodbye!"));
7504
7541
  process.exit(0);
@@ -7596,7 +7633,7 @@ program.command("web").description("Start Web UI server with browser-based chat
7596
7633
  console.error("Error: Invalid port number. Must be between 1 and 65535.");
7597
7634
  process.exit(1);
7598
7635
  }
7599
- const { startWebServer } = await import("./server-7B7HTSLE.js");
7636
+ const { startWebServer } = await import("./server-D2QROP6U.js");
7600
7637
  await startWebServer({ port, host: options.host });
7601
7638
  });
7602
7639
  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) => {
@@ -7763,12 +7800,12 @@ program.command("sessions").description("List recent conversation sessions").opt
7763
7800
  console.log(footer + "\n");
7764
7801
  });
7765
7802
  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) => {
7766
- const { runDoctorCli } = await import("./doctor-cli-OZJZKETL.js");
7803
+ const { runDoctorCli } = await import("./doctor-cli-RH6DBULV.js");
7767
7804
  await runDoctorCli({ json: !!options.json, resetStats: !!options.resetStats });
7768
7805
  });
7769
7806
  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) => {
7770
7807
  try {
7771
- const batch = await import("./batch-6WDD57ZG.js");
7808
+ const batch = await import("./batch-5YHCBZZA.js");
7772
7809
  switch (action) {
7773
7810
  case "submit":
7774
7811
  if (!arg) {
@@ -7811,7 +7848,7 @@ program.command("batch <action> [arg] [arg2]").description("Anthropic Message Ba
7811
7848
  }
7812
7849
  });
7813
7850
  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) => {
7814
- const { startMcpServer } = await import("./server-RXWYMDAH.js");
7851
+ const { startMcpServer } = await import("./server-LYANKLNG.js");
7815
7852
  await startMcpServer({
7816
7853
  allowDestructive: !!options.allowDestructive,
7817
7854
  allowOutsideCwd: !!options.allowOutsideCwd,
@@ -7820,7 +7857,7 @@ program.command("mcp-serve").description("Start an MCP server over STDIO, exposi
7820
7857
  });
7821
7858
  });
7822
7859
  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) => {
7823
- const { runCi } = await import("./ci-Y4FEHLDL.js");
7860
+ const { runCi } = await import("./ci-VYCFNXZ3.js");
7824
7861
  const result = await runCi({
7825
7862
  pr: options.pr,
7826
7863
  base: options.base,
@@ -7965,7 +8002,7 @@ program.command("hub [topic]").description("Start multi-agent hub (discuss / bra
7965
8002
  }),
7966
8003
  config.get("customProviders")
7967
8004
  );
7968
- const { startHub } = await import("./hub-IVVW7BTJ.js");
8005
+ const { startHub } = await import("./hub-N3WJ3IB5.js");
7969
8006
  await startHub(
7970
8007
  {
7971
8008
  topic: topic ?? "",
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  executeTests,
3
3
  runTestsTool
4
- } from "./chunk-YMH6BKAE.js";
4
+ } from "./chunk-QM6O4HZS.js";
5
5
  import "./chunk-3RG5ZIWI.js";
6
6
  export {
7
7
  executeTests,
@@ -2,8 +2,8 @@
2
2
  import {
3
3
  executeTests,
4
4
  runTestsTool
5
- } from "./chunk-MELFYYS7.js";
6
- import "./chunk-RSZWLQU4.js";
5
+ } from "./chunk-ORSIBDWI.js";
6
+ import "./chunk-KPUE4DLX.js";
7
7
  import "./chunk-PDX44BCA.js";
8
8
  export {
9
9
  executeTests,
@@ -21,7 +21,7 @@ import {
21
21
  loadDevState,
22
22
  persistToolRound,
23
23
  setupProxy
24
- } from "./chunk-57H6YNXY.js";
24
+ } from "./chunk-T2M4KWEG.js";
25
25
  import {
26
26
  ToolExecutor,
27
27
  ToolRegistry,
@@ -39,10 +39,10 @@ import {
39
39
  spawnAgentContext,
40
40
  truncateOutput,
41
41
  undoStack
42
- } from "./chunk-WG4THOHH.js";
42
+ } from "./chunk-HHWZXSSF.js";
43
43
  import "./chunk-HDSKW7Q3.js";
44
44
  import "./chunk-ZWVIDFGY.js";
45
- import "./chunk-MELFYYS7.js";
45
+ import "./chunk-ORSIBDWI.js";
46
46
  import {
47
47
  SessionManager,
48
48
  getContentText
@@ -61,16 +61,16 @@ import {
61
61
  looksLikeDocumentBody,
62
62
  stripPseudoToolCalls,
63
63
  stripToolCallReminder
64
- } from "./chunk-GNJOC6ZN.js";
64
+ } from "./chunk-BFFVAX6T.js";
65
65
  import {
66
66
  runTool
67
- } from "./chunk-H53UCPFF.js";
67
+ } from "./chunk-WC6QXBBW.js";
68
68
  import {
69
69
  getDangerLevel
70
70
  } from "./chunk-NXXNLLSG.js";
71
71
  import {
72
72
  ConfigManager
73
- } from "./chunk-6JTVUGSF.js";
73
+ } from "./chunk-Z5HW5NA4.js";
74
74
  import "./chunk-TZQHYZKT.js";
75
75
  import {
76
76
  AGENTIC_BEHAVIOR_GUIDELINE,
@@ -90,7 +90,7 @@ import {
90
90
  SKILLS_DIR_NAME,
91
91
  VERSION,
92
92
  buildUserIdentityPrompt
93
- } from "./chunk-RSZWLQU4.js";
93
+ } from "./chunk-KPUE4DLX.js";
94
94
  import {
95
95
  formatGitContextForPrompt,
96
96
  getGitContext,
@@ -2577,7 +2577,7 @@ ${undoResults.map((r) => ` \u2022 ${r}`).join("\n")}` });
2577
2577
  case "test": {
2578
2578
  this.send({ type: "info", message: "\u{1F9EA} Running tests..." });
2579
2579
  try {
2580
- const { executeTests } = await import("./run-tests-AYADOMOF.js");
2580
+ const { executeTests } = await import("./run-tests-U6GFM77T.js");
2581
2581
  const argStr = args.join(" ").trim();
2582
2582
  let testArgs = {};
2583
2583
  if (argStr) {
@@ -1,13 +1,13 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  ToolRegistry
4
- } from "./chunk-WG4THOHH.js";
4
+ } from "./chunk-HHWZXSSF.js";
5
5
  import "./chunk-HDSKW7Q3.js";
6
6
  import "./chunk-ZWVIDFGY.js";
7
- import "./chunk-MELFYYS7.js";
7
+ import "./chunk-ORSIBDWI.js";
8
8
  import {
9
9
  runTool
10
- } from "./chunk-H53UCPFF.js";
10
+ } from "./chunk-WC6QXBBW.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-RSZWLQU4.js";
18
+ } from "./chunk-KPUE4DLX.js";
19
19
  import "./chunk-4BKXL7SM.js";
20
20
  import "./chunk-MM3F43H6.js";
21
21
  import "./chunk-KHYD3WXE.js";
@@ -3,20 +3,20 @@ import {
3
3
  ToolRegistry,
4
4
  googleSearchContext,
5
5
  truncateOutput
6
- } from "./chunk-WG4THOHH.js";
6
+ } from "./chunk-HHWZXSSF.js";
7
7
  import "./chunk-HDSKW7Q3.js";
8
8
  import "./chunk-ZWVIDFGY.js";
9
- import "./chunk-MELFYYS7.js";
9
+ import "./chunk-ORSIBDWI.js";
10
10
  import {
11
11
  runTool
12
- } from "./chunk-H53UCPFF.js";
12
+ } from "./chunk-WC6QXBBW.js";
13
13
  import {
14
14
  getDangerLevel
15
15
  } from "./chunk-NXXNLLSG.js";
16
16
  import "./chunk-TZQHYZKT.js";
17
17
  import {
18
18
  SUBAGENT_ALLOWED_TOOLS
19
- } from "./chunk-RSZWLQU4.js";
19
+ } from "./chunk-KPUE4DLX.js";
20
20
  import "./chunk-4BKXL7SM.js";
21
21
  import "./chunk-MM3F43H6.js";
22
22
  import "./chunk-KHYD3WXE.js";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "jinzd-ai-cli",
3
- "version": "0.4.171",
3
+ "version": "0.4.173",
4
4
  "description": "Cross-platform REPL-style AI CLI with multi-provider support",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",