jinzd-ai-cli 0.4.258 → 0.4.260

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 (33) hide show
  1. package/dist/{batch-B42DJMDJ.js → batch-LBMJWMMO.js} +2 -2
  2. package/dist/{chunk-S5YGYXAE.js → chunk-26C6YZ3A.js} +1 -1
  3. package/dist/{chunk-3ERLNXT2.js → chunk-2BGNEVS5.js} +4 -4
  4. package/dist/{chunk-HT5LC2PL.js → chunk-3TE7ZWO5.js} +1 -1
  5. package/dist/{chunk-GVLUGPIX.js → chunk-63M2ELJS.js} +4 -4
  6. package/dist/{chunk-BWZT74E3.js → chunk-AAWV4BP4.js} +2 -2
  7. package/dist/{chunk-BEER3VEB.js → chunk-CLJKNKUN.js} +1 -1
  8. package/dist/{chunk-XPNKMDBH.js → chunk-FCPYMBTA.js} +6 -1
  9. package/dist/{chunk-WLSK55ED.js → chunk-HBR33J6J.js} +1 -1
  10. package/dist/{chunk-XYNZVGUH.js → chunk-K6WMQBUP.js} +1 -1
  11. package/dist/{chunk-I7LBWY7E.js → chunk-KRENSXPC.js} +1 -1
  12. package/dist/{chunk-QJXUJFYD.js → chunk-NEYNE6UE.js} +69 -49
  13. package/dist/{chunk-GDJII6TK.js → chunk-U2HN3EW6.js} +23 -5
  14. package/dist/{chunk-PNQS67JC.js → chunk-VJP2GLW5.js} +1 -1
  15. package/dist/{chunk-GWXWAQVM.js → chunk-XTA3LSPQ.js} +1 -1
  16. package/dist/{chunk-BIXQHN77.js → chunk-Y7UZSFGS.js} +1 -1
  17. package/dist/{ci-MMXYIHYY.js → ci-PSA7F4EI.js} +6 -6
  18. package/dist/{ci-format-FG53M5V2.js → ci-format-WAHEZZMY.js} +2 -2
  19. package/dist/{constants-WROFKV3K.js → constants-C55LGUR7.js} +1 -1
  20. package/dist/{doctor-cli-USQ4HX7A.js → doctor-cli-YANDJBHC.js} +6 -6
  21. package/dist/electron-server.js +144 -104
  22. package/dist/{hub-MWEDYMK6.js → hub-CBOC3TT3.js} +1 -1
  23. package/dist/index.js +80 -47
  24. package/dist/{persistent-memory-PAHA4R7U.js → persistent-memory-DUFOZTDV.js} +2 -2
  25. package/dist/{persistent-memory-ZHYBVUGR.js → persistent-memory-KEYVKD54.js} +2 -2
  26. package/dist/{pr-4P7XC2RK.js → pr-T6KCK5DT.js} +6 -6
  27. package/dist/{run-tests-Y6CBCPFF.js → run-tests-K43DLTA3.js} +2 -2
  28. package/dist/{run-tests-WWJHCLFZ.js → run-tests-S2RLPMCR.js} +2 -2
  29. package/dist/{server-IMKKKH57.js → server-GTRCCOXN.js} +6 -6
  30. package/dist/{server-JDKLBBVN.js → server-SV3TV5BJ.js} +19 -19
  31. package/dist/{task-orchestrator-F534G7LG.js → task-orchestrator-DW5AWW7J.js} +6 -6
  32. package/dist/{usage-P4ORZDPV.js → usage-BP442V2Q.js} +2 -2
  33. 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-F534G7LG.js");
157
+ const { TaskOrchestrator } = await import("./task-orchestrator-DW5AWW7J.js");
158
158
  const orchestrator = new TaskOrchestrator(config, providers, configManager);
159
159
  let interrupted = false;
160
160
  const onSigint = () => {
package/dist/index.js CHANGED
@@ -17,7 +17,7 @@ import {
17
17
  scanProject,
18
18
  sessionHasMeaningfulContent,
19
19
  setupProxy
20
- } from "./chunk-BWZT74E3.js";
20
+ } from "./chunk-AAWV4BP4.js";
21
21
  import {
22
22
  computeCost,
23
23
  formatCost,
@@ -50,7 +50,7 @@ import {
50
50
  spawnAgentContext,
51
51
  theme,
52
52
  undoStack
53
- } from "./chunk-QJXUJFYD.js";
53
+ } from "./chunk-NEYNE6UE.js";
54
54
  import {
55
55
  addMemoryEntry,
56
56
  backupMemoryStore,
@@ -76,7 +76,7 @@ import {
76
76
  touchMemoryReferences,
77
77
  updateMemoryApproval,
78
78
  updateMemoryEntry
79
- } from "./chunk-HT5LC2PL.js";
79
+ } from "./chunk-3TE7ZWO5.js";
80
80
  import "./chunk-GLSR2NR3.js";
81
81
  import "./chunk-UUSRWSSX.js";
82
82
  import "./chunk-CKH4KQ4E.js";
@@ -90,13 +90,13 @@ import {
90
90
  formatDoctorReport,
91
91
  loadContextFiles,
92
92
  writeCrashLog
93
- } from "./chunk-GVLUGPIX.js";
93
+ } from "./chunk-63M2ELJS.js";
94
94
  import {
95
95
  ProviderRegistry
96
- } from "./chunk-GDJII6TK.js";
96
+ } from "./chunk-U2HN3EW6.js";
97
97
  import {
98
98
  ConfigManager
99
- } from "./chunk-XYNZVGUH.js";
99
+ } from "./chunk-K6WMQBUP.js";
100
100
  import {
101
101
  describePlugin,
102
102
  getActivePluginAssets,
@@ -113,7 +113,7 @@ import {
113
113
  trustHook,
114
114
  trustPlugin,
115
115
  untrustHook
116
- } from "./chunk-BIXQHN77.js";
116
+ } from "./chunk-Y7UZSFGS.js";
117
117
  import {
118
118
  CONTENT_ONLY_STREAM_REMINDER,
119
119
  TEE_FINAL_USER_NUDGE,
@@ -127,12 +127,13 @@ import {
127
127
  evaluateTeeContent,
128
128
  extractWrittenFilePaths,
129
129
  freshPriorContent,
130
+ isAbortError,
130
131
  isCleanDocumentBody,
131
132
  runAgentLoop,
132
133
  stripOuterCodeFence,
133
134
  stripToolCallReminder,
134
135
  teeStreamErrorSummary
135
- } from "./chunk-XPNKMDBH.js";
136
+ } from "./chunk-FCPYMBTA.js";
136
137
  import {
137
138
  AuthError,
138
139
  ProviderError,
@@ -146,7 +147,7 @@ import {
146
147
  import {
147
148
  fileCheckpoints
148
149
  } from "./chunk-4BKXL7SM.js";
149
- import "./chunk-WLSK55ED.js";
150
+ import "./chunk-HBR33J6J.js";
150
151
  import {
151
152
  AGENTIC_BEHAVIOR_GUIDELINE,
152
153
  AUTHOR,
@@ -165,7 +166,7 @@ import {
165
166
  SKILLS_DIR_NAME,
166
167
  VERSION,
167
168
  buildUserIdentityPrompt
168
- } from "./chunk-I7LBWY7E.js";
169
+ } from "./chunk-KRENSXPC.js";
169
170
  import {
170
171
  buildChatIndex,
171
172
  clearChatIndex,
@@ -1397,7 +1398,7 @@ No tools match "${filter}".
1397
1398
  const { join: join6 } = await import("path");
1398
1399
  const { existsSync: existsSync6 } = await import("fs");
1399
1400
  const { getGitRoot: getGitRoot2 } = await import("./git-context-EXOEHQSF.js");
1400
- const { MCP_PROJECT_CONFIG_NAME: MCP_PROJECT_CONFIG_NAME2 } = await import("./constants-WROFKV3K.js");
1401
+ const { MCP_PROJECT_CONFIG_NAME: MCP_PROJECT_CONFIG_NAME2 } = await import("./constants-C55LGUR7.js");
1401
1402
  const { approveProject, hashMcpFile } = await import("./project-trust-NKYHL3VZ.js");
1402
1403
  const cwd = process.cwd();
1403
1404
  const projectRoot = getGitRoot2(cwd) ?? cwd;
@@ -2376,7 +2377,7 @@ function createReviewCommands() {
2376
2377
  usage: "/test [command|filter]",
2377
2378
  async execute(args, ctx) {
2378
2379
  try {
2379
- const { executeTests } = await import("./run-tests-Y6CBCPFF.js");
2380
+ const { executeTests } = await import("./run-tests-K43DLTA3.js");
2380
2381
  const argStr = args.join(" ").trim();
2381
2382
  let testArgs = {};
2382
2383
  if (argStr) {
@@ -6877,6 +6878,28 @@ Session '${this.resumeSessionId}' not found.
6877
6878
  * 流式生成开始前调用:创建 AbortController,监听 ESC 键(0x1b)和 Ctrl+C(0x03)原始字节。
6878
6879
  * rl.pause() 会暂停 stdin,这里临时恢复以接收原始键盘字节。
6879
6880
  */
6881
+ /**
6882
+ * 把一次**非流式**(阻塞式)模型调用包成可中断的。
6883
+ *
6884
+ * v0.4.260:非流式分支此前既没装键盘监听器、也没把 signal 传下去——
6885
+ * DeepSeek/Kimi(`supportsStreamingTools=false`)的每一轮都走这条路,于是 Ctrl+C
6886
+ * 在整个请求期间毫无作用(实测把 timeout 提到 15 分钟后,等 11 分钟退不出去)。
6887
+ * 中断视为用户主动取消,不当错误上抛:置全局 interrupt 标记后交给 onAbort 收尾。
6888
+ */
6889
+ async withInterruptibleCall(run, onAbort) {
6890
+ const ac = this.setupStreamInterrupt();
6891
+ try {
6892
+ return await run(ac.signal);
6893
+ } catch (err) {
6894
+ if (isAbortError(err) || ac.signal.aborted) {
6895
+ requestInterrupt();
6896
+ return onAbort();
6897
+ }
6898
+ throw err;
6899
+ } finally {
6900
+ this.teardownStreamInterrupt();
6901
+ }
6902
+ }
6880
6903
  setupStreamInterrupt() {
6881
6904
  const ac = new AbortController();
6882
6905
  this.streamAbortController = ac;
@@ -7220,42 +7243,52 @@ ${mcpBudgetNote}` : "");
7220
7243
  this.teardownStreamInterrupt();
7221
7244
  }
7222
7245
  }
7223
- const result = await withFallback(
7224
- this.currentProvider,
7225
- effectiveModel,
7226
- this.providers,
7227
- fallbackOpts,
7228
- (p, m) => p.chatWithTools({ ...chatRequest, model: m }, toolDefs)
7246
+ return this.withInterruptibleCall(
7247
+ (signal) => withFallback(
7248
+ this.currentProvider,
7249
+ effectiveModel,
7250
+ this.providers,
7251
+ fallbackOpts,
7252
+ (p, m) => p.chatWithTools(
7253
+ { ...chatRequest, model: m, signal },
7254
+ toolDefs
7255
+ )
7256
+ ),
7257
+ // 中断:以 host-stop 正常收尾,不为一次主动取消喷 provider 报错
7258
+ () => ({ toolCalls: [], content: "", stopLoop: true })
7229
7259
  );
7230
- return result;
7231
7260
  },
7232
7261
  // ── 轮次耗尽总结:空工具列表强制纯文本 ──
7233
7262
  callSummary: async (summaryExtra) => {
7234
7263
  spinner.stop();
7235
7264
  spinner.start("Generating summary...");
7236
7265
  try {
7237
- const summaryResult = await provider.chatWithTools(
7238
- {
7239
- messages: apiMessages,
7240
- model: effectiveModel,
7241
- systemPrompt,
7242
- systemPromptVolatile,
7243
- stream: false,
7244
- temperature: modelParams.temperature,
7245
- maxTokens: modelParams.maxTokens,
7246
- timeout: modelParams.timeout,
7247
- thinking: modelParams.thinking,
7248
- thinkingBudget: modelParams.thinkingBudget,
7249
- _extraMessages: summaryExtra
7266
+ return await this.withInterruptibleCall(
7267
+ async (signal) => {
7268
+ const r = await provider.chatWithTools(
7269
+ {
7270
+ messages: apiMessages,
7271
+ model: effectiveModel,
7272
+ systemPrompt,
7273
+ systemPromptVolatile,
7274
+ stream: false,
7275
+ temperature: modelParams.temperature,
7276
+ maxTokens: modelParams.maxTokens,
7277
+ timeout: modelParams.timeout,
7278
+ thinking: modelParams.thinking,
7279
+ thinkingBudget: modelParams.thinkingBudget,
7280
+ signal,
7281
+ _extraMessages: summaryExtra
7282
+ },
7283
+ []
7284
+ // 不提供任何工具,强制 AI 返回纯文本
7285
+ );
7286
+ return "content" in r ? { content: r.content, usage: r.usage } : { usage: r.usage };
7250
7287
  },
7251
- []
7252
- // 不提供任何工具,强制 AI 返回纯文本
7288
+ () => ({})
7253
7289
  );
7290
+ } finally {
7254
7291
  spinner.stop();
7255
- return "content" in summaryResult ? { content: summaryResult.content, usage: summaryResult.usage } : { usage: summaryResult.usage };
7256
- } catch (err) {
7257
- spinner.stop();
7258
- throw err;
7259
7292
  }
7260
7293
  },
7261
7294
  executeTools: async (toolCalls, extraMessages) => {
@@ -8033,7 +8066,7 @@ program.command("web").description("Start Web UI server with browser-based chat
8033
8066
  console.error("Error: Invalid port number. Must be between 1 and 65535.");
8034
8067
  process.exit(1);
8035
8068
  }
8036
- const { startWebServer } = await import("./server-JDKLBBVN.js");
8069
+ const { startWebServer } = await import("./server-SV3TV5BJ.js");
8037
8070
  await startWebServer({ port, host: options.host });
8038
8071
  });
8039
8072
  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) => {
@@ -8200,11 +8233,11 @@ program.command("sessions").description("List recent conversation sessions").opt
8200
8233
  console.log(footer + "\n");
8201
8234
  });
8202
8235
  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) => {
8203
- const { runUsageCli } = await import("./usage-P4ORZDPV.js");
8236
+ const { runUsageCli } = await import("./usage-BP442V2Q.js");
8204
8237
  await runUsageCli(options);
8205
8238
  });
8206
8239
  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) => {
8207
- const { runDoctorCli } = await import("./doctor-cli-USQ4HX7A.js");
8240
+ const { runDoctorCli } = await import("./doctor-cli-YANDJBHC.js");
8208
8241
  const argv = process.argv.slice(2);
8209
8242
  await runDoctorCli({
8210
8243
  json: !!options.json || argv.includes("--json"),
@@ -8213,7 +8246,7 @@ program.command("doctor").description("Health check: API keys, config, MCP, rece
8213
8246
  });
8214
8247
  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) => {
8215
8248
  try {
8216
- const batch = await import("./batch-B42DJMDJ.js");
8249
+ const batch = await import("./batch-LBMJWMMO.js");
8217
8250
  switch (action) {
8218
8251
  case "submit":
8219
8252
  if (!arg) {
@@ -8256,7 +8289,7 @@ program.command("batch <action> [arg] [arg2]").description("Anthropic Message Ba
8256
8289
  }
8257
8290
  });
8258
8291
  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) => {
8259
- const { startMcpServer } = await import("./server-IMKKKH57.js");
8292
+ const { startMcpServer } = await import("./server-GTRCCOXN.js");
8260
8293
  await startMcpServer({
8261
8294
  allowDestructive: !!options.allowDestructive,
8262
8295
  allowOutsideCwd: !!options.allowOutsideCwd,
@@ -8269,7 +8302,7 @@ program.command("pr <action> [target]").description("PR review helpers: review |
8269
8302
  console.error(`Unknown pr action: ${action}. Use review | security-review | summarize.`);
8270
8303
  process.exit(1);
8271
8304
  }
8272
- const { runPrCli } = await import("./pr-4P7XC2RK.js");
8305
+ const { runPrCli } = await import("./pr-T6KCK5DT.js");
8273
8306
  const result = await runPrCli({
8274
8307
  action,
8275
8308
  target,
@@ -8289,8 +8322,8 @@ program.command("pr <action> [target]").description("PR review helpers: review |
8289
8322
  process.exit(result.exitCode);
8290
8323
  });
8291
8324
  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) => {
8292
- const { runCi } = await import("./ci-MMXYIHYY.js");
8293
- const { formatCiResult } = await import("./ci-format-FG53M5V2.js");
8325
+ const { runCi } = await import("./ci-PSA7F4EI.js");
8326
+ const { formatCiResult } = await import("./ci-format-WAHEZZMY.js");
8294
8327
  const formats = [options.json, options.markdown, options.sarif].filter(Boolean).length;
8295
8328
  if (formats > 1) {
8296
8329
  console.error("Choose only one output format: --json, --markdown, or --sarif.");
@@ -8448,7 +8481,7 @@ program.command("hub [topic]").description("Start multi-agent hub (discuss / bra
8448
8481
  config.get("customProviders"),
8449
8482
  config.getConfigDir()
8450
8483
  );
8451
- const { startHub } = await import("./hub-MWEDYMK6.js");
8484
+ const { startHub } = await import("./hub-CBOC3TT3.js");
8452
8485
  await startHub(
8453
8486
  {
8454
8487
  topic: topic ?? "",
@@ -27,9 +27,9 @@ import {
27
27
  touchMemoryReferences,
28
28
  updateMemoryApproval,
29
29
  updateMemoryEntry
30
- } from "./chunk-BEER3VEB.js";
30
+ } from "./chunk-CLJKNKUN.js";
31
31
  import "./chunk-YVTASHS5.js";
32
- import "./chunk-S5YGYXAE.js";
32
+ import "./chunk-26C6YZ3A.js";
33
33
  import "./chunk-6BUTA5VW.js";
34
34
  export {
35
35
  addMemoryEntry,
@@ -28,9 +28,9 @@ import {
28
28
  touchMemoryReferences,
29
29
  updateMemoryApproval,
30
30
  updateMemoryEntry
31
- } from "./chunk-HT5LC2PL.js";
31
+ } from "./chunk-3TE7ZWO5.js";
32
32
  import "./chunk-HOSJZMQS.js";
33
- import "./chunk-I7LBWY7E.js";
33
+ import "./chunk-KRENSXPC.js";
34
34
  import "./chunk-B5TYJO7V.js";
35
35
  import "./chunk-IW3Q7AE5.js";
36
36
  export {
@@ -2,8 +2,8 @@
2
2
  import {
3
3
  countSeverity,
4
4
  runCi
5
- } from "./chunk-3ERLNXT2.js";
6
- import "./chunk-PNQS67JC.js";
5
+ } from "./chunk-2BGNEVS5.js";
6
+ import "./chunk-VJP2GLW5.js";
7
7
  import {
8
8
  buildReviewPrompt,
9
9
  buildSecurityReviewPrompt,
@@ -11,15 +11,15 @@ import {
11
11
  } from "./chunk-HLWUDRBO.js";
12
12
  import {
13
13
  ProviderRegistry
14
- } from "./chunk-GDJII6TK.js";
14
+ } from "./chunk-U2HN3EW6.js";
15
15
  import {
16
16
  ConfigManager
17
- } from "./chunk-XYNZVGUH.js";
18
- import "./chunk-XPNKMDBH.js";
17
+ } from "./chunk-K6WMQBUP.js";
18
+ import "./chunk-FCPYMBTA.js";
19
19
  import "./chunk-TU3L3PW7.js";
20
20
  import {
21
21
  VERSION
22
- } from "./chunk-I7LBWY7E.js";
22
+ } from "./chunk-KRENSXPC.js";
23
23
  import "./chunk-IW3Q7AE5.js";
24
24
 
25
25
  // src/cli/pr.ts
@@ -2,8 +2,8 @@
2
2
  import {
3
3
  executeTests,
4
4
  runTestsTool
5
- } from "./chunk-WLSK55ED.js";
6
- import "./chunk-I7LBWY7E.js";
5
+ } from "./chunk-HBR33J6J.js";
6
+ import "./chunk-KRENSXPC.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-GWXWAQVM.js";
5
- import "./chunk-S5YGYXAE.js";
4
+ } from "./chunk-XTA3LSPQ.js";
5
+ import "./chunk-26C6YZ3A.js";
6
6
  export {
7
7
  executeTests,
8
8
  runTestsTool
@@ -1,26 +1,26 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  ToolRegistry
4
- } from "./chunk-QJXUJFYD.js";
5
- import "./chunk-HT5LC2PL.js";
4
+ } from "./chunk-NEYNE6UE.js";
5
+ import "./chunk-3TE7ZWO5.js";
6
6
  import "./chunk-GLSR2NR3.js";
7
7
  import "./chunk-UUSRWSSX.js";
8
8
  import "./chunk-CKH4KQ4E.js";
9
9
  import "./chunk-BXP6YZ2P.js";
10
10
  import {
11
11
  runTool
12
- } from "./chunk-BIXQHN77.js";
12
+ } from "./chunk-Y7UZSFGS.js";
13
13
  import {
14
14
  getDangerLevel,
15
15
  schemaToJsonSchema
16
- } from "./chunk-XPNKMDBH.js";
16
+ } from "./chunk-FCPYMBTA.js";
17
17
  import "./chunk-TU3L3PW7.js";
18
18
  import "./chunk-HOSJZMQS.js";
19
19
  import "./chunk-4BKXL7SM.js";
20
- import "./chunk-WLSK55ED.js";
20
+ import "./chunk-HBR33J6J.js";
21
21
  import {
22
22
  VERSION
23
- } from "./chunk-I7LBWY7E.js";
23
+ } from "./chunk-KRENSXPC.js";
24
24
  import "./chunk-6RPGQ5CG.js";
25
25
  import "./chunk-KHYD3WXE.js";
26
26
  import "./chunk-NYNSYLFY.js";
@@ -23,7 +23,7 @@ import {
23
23
  scanDirTree,
24
24
  scanProject,
25
25
  setupProxy
26
- } from "./chunk-BWZT74E3.js";
26
+ } from "./chunk-AAWV4BP4.js";
27
27
  import {
28
28
  computeCost,
29
29
  formatCost,
@@ -55,6 +55,7 @@ import {
55
55
  renderDiff,
56
56
  requestAgentStop,
57
57
  resolveAgentConfig,
58
+ resolveWriteFileArgs,
58
59
  runSafePhases,
59
60
  runWithSessionKey,
60
61
  setContextWindow,
@@ -63,7 +64,7 @@ import {
63
64
  spawnAgentContext,
64
65
  truncateOutput,
65
66
  undoStack
66
- } from "./chunk-QJXUJFYD.js";
67
+ } from "./chunk-NEYNE6UE.js";
67
68
  import {
68
69
  addMemoryEntry,
69
70
  clearMemoryEntries,
@@ -77,7 +78,7 @@ import {
77
78
  parseWritableScope,
78
79
  updateMemoryApproval,
79
80
  updateMemoryEntry
80
- } from "./chunk-HT5LC2PL.js";
81
+ } from "./chunk-3TE7ZWO5.js";
81
82
  import "./chunk-GLSR2NR3.js";
82
83
  import "./chunk-UUSRWSSX.js";
83
84
  import "./chunk-CKH4KQ4E.js";
@@ -90,13 +91,13 @@ import {
90
91
  buildDoctorReport,
91
92
  formatDoctorReport,
92
93
  loadContextFiles
93
- } from "./chunk-GVLUGPIX.js";
94
+ } from "./chunk-63M2ELJS.js";
94
95
  import {
95
96
  ProviderRegistry
96
- } from "./chunk-GDJII6TK.js";
97
+ } from "./chunk-U2HN3EW6.js";
97
98
  import {
98
99
  ConfigManager
99
- } from "./chunk-XYNZVGUH.js";
100
+ } from "./chunk-K6WMQBUP.js";
100
101
  import {
101
102
  describePlugin,
102
103
  getActivePluginAssets,
@@ -111,7 +112,7 @@ import {
111
112
  runTool,
112
113
  setPluginEnabled,
113
114
  trustPlugin
114
- } from "./chunk-BIXQHN77.js";
115
+ } from "./chunk-Y7UZSFGS.js";
115
116
  import {
116
117
  CONTENT_ONLY_STREAM_REMINDER,
117
118
  TEE_FINAL_USER_NUDGE,
@@ -128,7 +129,7 @@ import {
128
129
  stripOuterCodeFence,
129
130
  stripToolCallReminder,
130
131
  teeStreamErrorSummary
131
- } from "./chunk-XPNKMDBH.js";
132
+ } from "./chunk-FCPYMBTA.js";
132
133
  import "./chunk-TU3L3PW7.js";
133
134
  import {
134
135
  formatGitContextForPrompt,
@@ -136,7 +137,7 @@ import {
136
137
  getGitRoot
137
138
  } from "./chunk-HOSJZMQS.js";
138
139
  import "./chunk-4BKXL7SM.js";
139
- import "./chunk-WLSK55ED.js";
140
+ import "./chunk-HBR33J6J.js";
140
141
  import {
141
142
  AGENTIC_BEHAVIOR_GUIDELINE,
142
143
  AUTHOR,
@@ -152,7 +153,7 @@ import {
152
153
  SKILLS_DIR_NAME,
153
154
  VERSION,
154
155
  buildUserIdentityPrompt
155
- } from "./chunk-I7LBWY7E.js";
156
+ } from "./chunk-KRENSXPC.js";
156
157
  import "./chunk-6RPGQ5CG.js";
157
158
  import "./chunk-KHYD3WXE.js";
158
159
  import "./chunk-NYNSYLFY.js";
@@ -313,18 +314,17 @@ var ToolExecutorWeb = class _ToolExecutorWeb {
313
314
  }
314
315
  getDiffPreview(call) {
315
316
  if (call.name === "write_file") {
316
- const filePath = String(call.arguments["path"] ?? "");
317
- const newContent = String(call.arguments["content"] ?? "");
317
+ const { path: filePath, content: chunk, append } = resolveWriteFileArgs(call.arguments);
318
318
  if (filePath && existsSync(filePath)) {
319
319
  try {
320
320
  const old = readFileSync(filePath, "utf-8");
321
- return renderDiff(old, newContent, { filePath });
321
+ return renderDiff(old, append ? old + chunk : chunk, { filePath });
322
322
  } catch {
323
323
  }
324
324
  }
325
- const lines = newContent.split("\n").slice(0, 20);
326
- return lines.map((l) => `+ ${l}`).join("\n") + (newContent.split("\n").length > 20 ? `
327
- ... (+${newContent.split("\n").length - 20} more lines)` : "");
325
+ const lines = chunk.split("\n").slice(0, 20);
326
+ return lines.map((l) => `+ ${l}`).join("\n") + (chunk.split("\n").length > 20 ? `
327
+ ... (+${chunk.split("\n").length - 20} more lines)` : "");
328
328
  }
329
329
  if (call.name === "edit_file") {
330
330
  const oldStr = String(call.arguments["old_str"] ?? "");
@@ -815,7 +815,7 @@ Cache: write=${cacheCreate} read=${cacheRead}` : "";
815
815
  Cost: ${formatCost(cost)}` : "";
816
816
  let memoryLine = "";
817
817
  try {
818
- const { countPendingMemories } = await import("./persistent-memory-ZHYBVUGR.js");
818
+ const { countPendingMemories } = await import("./persistent-memory-KEYVKD54.js");
819
819
  const pending = countPendingMemories(ctx.config.getConfigDir());
820
820
  if (pending > 0) memoryLine = `
821
821
  Memory: \u26A0 ${pending} pending approval \u2014 see the Memory panel or /memory`;
@@ -1624,7 +1624,7 @@ async function handleSecurityReview(args, ctx) {
1624
1624
  async function handleTest(args, ctx) {
1625
1625
  ctx.send({ type: "info", message: "\u{1F9EA} Running tests..." });
1626
1626
  try {
1627
- const { executeTests } = await import("./run-tests-Y6CBCPFF.js");
1627
+ const { executeTests } = await import("./run-tests-K43DLTA3.js");
1628
1628
  const argStr = args.join(" ").trim();
1629
1629
  let testArgs = {};
1630
1630
  if (argStr) {
@@ -1888,7 +1888,7 @@ async function handleMemory(args, ctx) {
1888
1888
  ctx.handleMemoryManage(sub, args[1], sub === "expire" ? args[2] : void 0);
1889
1889
  } else if (sub === "export") {
1890
1890
  if (args[1] === "md") {
1891
- const { exportMemoryEntries: exportMemoryEntries2 } = await import("./persistent-memory-ZHYBVUGR.js");
1891
+ const { exportMemoryEntries: exportMemoryEntries2 } = await import("./persistent-memory-KEYVKD54.js");
1892
1892
  ctx.send({
1893
1893
  type: "export_data",
1894
1894
  format: "md",
@@ -3,26 +3,26 @@ import {
3
3
  ToolRegistry,
4
4
  googleSearchContext,
5
5
  truncateOutput
6
- } from "./chunk-QJXUJFYD.js";
7
- import "./chunk-HT5LC2PL.js";
6
+ } from "./chunk-NEYNE6UE.js";
7
+ import "./chunk-3TE7ZWO5.js";
8
8
  import "./chunk-GLSR2NR3.js";
9
9
  import "./chunk-UUSRWSSX.js";
10
10
  import "./chunk-CKH4KQ4E.js";
11
11
  import "./chunk-BXP6YZ2P.js";
12
12
  import {
13
13
  runTool
14
- } from "./chunk-BIXQHN77.js";
14
+ } from "./chunk-Y7UZSFGS.js";
15
15
  import {
16
16
  getDangerLevel,
17
17
  runLeanAgentLoop
18
- } from "./chunk-XPNKMDBH.js";
18
+ } from "./chunk-FCPYMBTA.js";
19
19
  import "./chunk-TU3L3PW7.js";
20
20
  import "./chunk-HOSJZMQS.js";
21
21
  import "./chunk-4BKXL7SM.js";
22
- import "./chunk-WLSK55ED.js";
22
+ import "./chunk-HBR33J6J.js";
23
23
  import {
24
24
  SUBAGENT_ALLOWED_TOOLS
25
- } from "./chunk-I7LBWY7E.js";
25
+ } from "./chunk-KRENSXPC.js";
26
26
  import "./chunk-6RPGQ5CG.js";
27
27
  import "./chunk-KHYD3WXE.js";
28
28
  import "./chunk-NYNSYLFY.js";
@@ -8,9 +8,9 @@ import {
8
8
  } from "./chunk-EZ6QLHOS.js";
9
9
  import {
10
10
  ConfigManager
11
- } from "./chunk-XYNZVGUH.js";
11
+ } from "./chunk-K6WMQBUP.js";
12
12
  import "./chunk-TU3L3PW7.js";
13
- import "./chunk-I7LBWY7E.js";
13
+ import "./chunk-KRENSXPC.js";
14
14
  import "./chunk-IW3Q7AE5.js";
15
15
 
16
16
  // src/cli/usage.ts
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "jinzd-ai-cli",
3
- "version": "0.4.258",
3
+ "version": "0.4.260",
4
4
  "description": "Cross-platform REPL-style AI CLI with multi-provider support",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",