jinzd-ai-cli 0.4.252 → 0.4.253

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-UCAVB77F.js → batch-TPW2SM6G.js} +2 -2
  2. package/dist/{chunk-JWSMRAVK.js → chunk-2JHYZUQE.js} +1 -1
  3. package/dist/{chunk-KTE4BHHI.js → chunk-ABMMKA5S.js} +1 -1
  4. package/dist/{chunk-5GWGXJQN.js → chunk-BZNTSGLQ.js} +19 -8
  5. package/dist/{chunk-EEFHKKT2.js → chunk-M2QHKPRA.js} +1 -1
  6. package/dist/{chunk-7P3EP5OO.js → chunk-OWCEONX7.js} +1 -1
  7. package/dist/{chunk-AXNUGP53.js → chunk-P5JUXUBS.js} +2 -2
  8. package/dist/{chunk-O3XSFPYH.js → chunk-PSXIVQ3N.js} +14 -6
  9. package/dist/{chunk-QW6M662O.js → chunk-Q4KBR2SG.js} +1 -1
  10. package/dist/{chunk-2N3IEEY4.js → chunk-RPYNPLIE.js} +1 -1
  11. package/dist/{chunk-XINRSNNL.js → chunk-SC6FMQLH.js} +4 -4
  12. package/dist/{chunk-TQVR2URD.js → chunk-UMW33EEH.js} +1 -1
  13. package/dist/{chunk-HUV7TFOH.js → chunk-USG3ASQ2.js} +1 -1
  14. package/dist/{chunk-4BOT4YNT.js → chunk-YMHARKR6.js} +1 -1
  15. package/dist/{chunk-EPL77VAA.js → chunk-YWG5KKSL.js} +4 -4
  16. package/dist/{chunk-2QZMITSL.js → chunk-ZRBGH245.js} +5 -4
  17. package/dist/{ci-LOL5I5DP.js → ci-DYTVVEBO.js} +6 -6
  18. package/dist/{ci-format-TT5IZATX.js → ci-format-QTSA6FJJ.js} +2 -2
  19. package/dist/{constants-R57JYUHW.js → constants-7KSDW6RF.js} +1 -1
  20. package/dist/{doctor-cli-ODPYWX4T.js → doctor-cli-ZOIMXV4C.js} +6 -6
  21. package/dist/electron-server.js +43 -16
  22. package/dist/{hub-BNUQJOBO.js → hub-6L2UCZAU.js} +1 -1
  23. package/dist/index.js +21 -21
  24. package/dist/{persistent-memory-ITDGIW3Z.js → persistent-memory-HQKE5X7Z.js} +2 -2
  25. package/dist/{persistent-memory-US6A7WMA.js → persistent-memory-QOT2TQCT.js} +2 -2
  26. package/dist/{pr-6PR2OO5F.js → pr-HMOXDXWR.js} +6 -6
  27. package/dist/{run-tests-4FSTZ22Q.js → run-tests-JVQU3RAN.js} +2 -2
  28. package/dist/{run-tests-IM3GSWBM.js → run-tests-RSYTYFZF.js} +2 -2
  29. package/dist/{server-WZFZEVCQ.js → server-O2YQGG72.js} +6 -6
  30. package/dist/{server-ULAI723O.js → server-VOIG5VKM.js} +23 -13
  31. package/dist/{task-orchestrator-KWM7J4US.js → task-orchestrator-PLP3INNN.js} +6 -6
  32. package/dist/{usage-E72O4RHB.js → usage-3EQUVK37.js} +2 -2
  33. package/package.json +1 -1
@@ -1,9 +1,9 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  ConfigManager
4
- } from "./chunk-7P3EP5OO.js";
4
+ } from "./chunk-OWCEONX7.js";
5
5
  import "./chunk-5ULLIOVC.js";
6
- import "./chunk-EEFHKKT2.js";
6
+ import "./chunk-M2QHKPRA.js";
7
7
  import {
8
8
  atomicWriteFileSync
9
9
  } from "./chunk-IW3Q7AE5.js";
@@ -6,7 +6,7 @@ import {
6
6
  MEMORY_FILE_NAME,
7
7
  MEMORY_MAX_CHARS,
8
8
  MEMORY_STORE_FILE_NAME
9
- } from "./chunk-TQVR2URD.js";
9
+ } from "./chunk-UMW33EEH.js";
10
10
  import {
11
11
  atomicWriteFileSync
12
12
  } from "./chunk-6BUTA5VW.js";
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  TEST_TIMEOUT
4
- } from "./chunk-EEFHKKT2.js";
4
+ } from "./chunk-M2QHKPRA.js";
5
5
 
6
6
  // src/tools/builtin/run-tests.ts
7
7
  import { execSync, spawnSync } from "child_process";
@@ -7,7 +7,7 @@ import {
7
7
  searchPersistentMemories,
8
8
  touchMemoryReferences,
9
9
  updateMemoryEntry
10
- } from "./chunk-HUV7TFOH.js";
10
+ } from "./chunk-USG3ASQ2.js";
11
11
  import {
12
12
  indexProject
13
13
  } from "./chunk-GLSR2NR3.js";
@@ -23,12 +23,13 @@ import {
23
23
  runHook,
24
24
  runLifecycleHooks,
25
25
  runTool
26
- } from "./chunk-QW6M662O.js";
26
+ } from "./chunk-Q4KBR2SG.js";
27
27
  import {
28
+ buildTruncatedArgumentsError,
28
29
  getDangerLevel,
29
30
  isFileWriteTool,
30
31
  runLeanAgentLoop
31
- } from "./chunk-O3XSFPYH.js";
32
+ } from "./chunk-PSXIVQ3N.js";
32
33
  import {
33
34
  EnvLoader,
34
35
  NetworkError,
@@ -39,14 +40,14 @@ import {
39
40
  } from "./chunk-4BKXL7SM.js";
40
41
  import {
41
42
  runTestsTool
42
- } from "./chunk-KTE4BHHI.js";
43
+ } from "./chunk-ABMMKA5S.js";
43
44
  import {
44
45
  CONFIG_DIR_NAME,
45
46
  DEFAULT_MAX_TOOL_OUTPUT_CHARS_CAP,
46
47
  SUBAGENT_ALLOWED_TOOLS,
47
48
  SUBAGENT_DEFAULT_MAX_ROUNDS,
48
49
  SUBAGENT_MAX_ROUNDS_LIMIT
49
- } from "./chunk-EEFHKKT2.js";
50
+ } from "./chunk-M2QHKPRA.js";
50
51
  import {
51
52
  loadChatIndex,
52
53
  searchChatMemory
@@ -2273,6 +2274,15 @@ var ToolExecutor = class {
2273
2274
  isError: true
2274
2275
  };
2275
2276
  }
2277
+ if (call.argumentsTruncated) {
2278
+ const message = buildTruncatedArgumentsError(
2279
+ call.name,
2280
+ call.argumentsTruncated,
2281
+ Object.keys(call.arguments)
2282
+ );
2283
+ console.log(theme.warning(` \u26A0 ${call.name}: arguments truncated by output limit \u2014 not executed`));
2284
+ return { callId: call.id, content: message, isError: true };
2285
+ }
2276
2286
  const dangerLevel = getDangerLevel(call.name, call.arguments);
2277
2287
  let toolCallAlreadyPrinted = false;
2278
2288
  runHook(this.hookConfig?.preToolExecution, {
@@ -2963,9 +2973,10 @@ Do NOT split a long document into many write_file(append=true) calls. That patte
2963
2973
  if (appendMode) {
2964
2974
  appendFileSync(filePath, content, encoding);
2965
2975
  } else {
2966
- atomicWriteFileSync(filePath, content);
2976
+ atomicWriteFileSync(filePath, encoding === "utf-8" || encoding === "utf8" ? content : Buffer.from(content, encoding));
2967
2977
  }
2968
2978
  const lines = content.split("\n").length;
2979
+ const bytes = Buffer.byteLength(content, encoding);
2969
2980
  const mode = appendMode ? "appended" : "written";
2970
2981
  void (async () => {
2971
2982
  try {
@@ -2974,7 +2985,7 @@ Do NOT split a long document into many write_file(append=true) calls. That patte
2974
2985
  } catch {
2975
2986
  }
2976
2987
  })();
2977
- return `File ${mode}: ${filePath} (${lines} lines, ${content.length} bytes)`;
2988
+ return `File ${mode}: ${filePath} (${lines} lines, ${bytes} bytes)`;
2978
2989
  }
2979
2990
  };
2980
2991
 
@@ -4810,7 +4821,7 @@ Any of these triggers means use save_last_response, NOT write_file:
4810
4821
  mkdirSync2(dirname4(filePath), { recursive: true });
4811
4822
  atomicWriteFileSync(filePath, content);
4812
4823
  const lines = content.split("\n").length;
4813
- return `File saved: ${filePath} (${lines} lines, ${content.length} bytes)`;
4824
+ return `File saved: ${filePath} (${lines} lines, ${Buffer.byteLength(content, "utf-8")} bytes)`;
4814
4825
  }
4815
4826
  };
4816
4827
 
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
 
3
3
  // src/core/constants.ts
4
- var VERSION = "0.4.252";
4
+ var VERSION = "0.4.253";
5
5
  var APP_NAME = "ai-cli";
6
6
  var CONFIG_DIR_NAME = ".aicli";
7
7
  var CONFIG_FILE_NAME = "config.json";
@@ -8,7 +8,7 @@ import {
8
8
  CONFIG_FILE_NAME,
9
9
  HISTORY_DIR_NAME,
10
10
  PLUGINS_DIR_NAME
11
- } from "./chunk-EEFHKKT2.js";
11
+ } from "./chunk-M2QHKPRA.js";
12
12
  import {
13
13
  atomicWriteFileSync
14
14
  } from "./chunk-IW3Q7AE5.js";
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  truncateForPersist
4
- } from "./chunk-5GWGXJQN.js";
4
+ } from "./chunk-BZNTSGLQ.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-EEFHKKT2.js";
14
+ } from "./chunk-M2QHKPRA.js";
15
15
  import {
16
16
  atomicWriteFileSync
17
17
  } from "./chunk-IW3Q7AE5.js";
@@ -687,10 +687,10 @@ var ThinkTagFilter = class {
687
687
  return "";
688
688
  }
689
689
  };
690
- function repairToolCallArguments(raw, onWarn) {
690
+ function parseToolCallArguments(raw, onWarn) {
691
691
  const argStr = raw || "{}";
692
692
  try {
693
- return JSON.parse(argStr);
693
+ return { args: JSON.parse(argStr), status: "ok" };
694
694
  } catch {
695
695
  const truncated = argStr.trimEnd();
696
696
  const lastComma = truncated.lastIndexOf(",");
@@ -698,13 +698,18 @@ function repairToolCallArguments(raw, onWarn) {
698
698
  try {
699
699
  const repaired = JSON.parse(fixed);
700
700
  onWarn?.("Tool call JSON was truncated and auto-repaired. Some parameters may be missing.");
701
- return repaired;
701
+ return { args: repaired, status: "repaired" };
702
702
  } catch {
703
703
  onWarn?.("Tool call JSON could not be parsed, using empty arguments.");
704
- return {};
704
+ return { args: {}, status: "failed" };
705
705
  }
706
706
  }
707
707
  }
708
+ function buildTruncatedArgumentsError(toolName, status, parsedKeys) {
709
+ const lost = status === "failed" ? "The arguments JSON was cut off and could not be parsed at all." : `The arguments JSON was cut off mid-way; only these keys survived: ${parsedKeys.join(", ") || "(none)"}. Any remaining value is incomplete.`;
710
+ const longContentHint = toolName === "write_file" || toolName === "edit_file" ? " For long documents (300+ lines / 3 KB+), do NOT retry write_file \u2014 use `save_last_response`, which streams the document straight to disk without an argument size limit." : "";
711
+ return `[${toolName}] NOT EXECUTED \u2014 the model output hit its length limit while emitting this tool call, so the arguments were truncated. ${lost} Nothing was written or changed. Retry with a smaller payload: split the work into several calls, or shorten the arguments.${longContentHint}`;
712
+ }
708
713
  async function consumeToolCallStream(stream, hooks = {}) {
709
714
  const textParts = [];
710
715
  const accumulators = /* @__PURE__ */ new Map();
@@ -777,10 +782,12 @@ async function consumeToolCallStream(stream, hooks = {}) {
777
782
  }
778
783
  const toolCalls = [];
779
784
  for (const [, acc] of accumulators) {
785
+ const parsed = parseToolCallArguments(acc.arguments, hooks.onWarn);
780
786
  toolCalls.push({
781
787
  id: acc.id,
782
788
  name: acc.name,
783
- arguments: repairToolCallArguments(acc.arguments, hooks.onWarn)
789
+ arguments: parsed.args,
790
+ ...parsed.status === "ok" ? {} : { argumentsTruncated: parsed.status }
784
791
  });
785
792
  }
786
793
  if (toolCalls.length > 0) {
@@ -1150,7 +1157,8 @@ export {
1150
1157
  buildDeferredSaveInstruction,
1151
1158
  teeStreamErrorSummary,
1152
1159
  ThinkTagFilter,
1153
- repairToolCallArguments,
1160
+ parseToolCallArguments,
1161
+ buildTruncatedArgumentsError,
1154
1162
  consumeToolCallStream,
1155
1163
  accumulateUsage,
1156
1164
  buildRoundBudgetHint,
@@ -2,7 +2,7 @@
2
2
  import {
3
3
  CONFIG_DIR_NAME,
4
4
  PLUGINS_DIR_NAME
5
- } from "./chunk-EEFHKKT2.js";
5
+ } from "./chunk-M2QHKPRA.js";
6
6
  import {
7
7
  atomicWriteFileSync
8
8
  } from "./chunk-IW3Q7AE5.js";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  TEST_TIMEOUT
3
- } from "./chunk-TQVR2URD.js";
3
+ } from "./chunk-UMW33EEH.js";
4
4
 
5
5
  // src/tools/builtin/run-tests.ts
6
6
  import { execSync, spawnSync } from "child_process";
@@ -1,10 +1,10 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  ProviderRegistry
4
- } from "./chunk-2QZMITSL.js";
4
+ } from "./chunk-ZRBGH245.js";
5
5
  import {
6
6
  ConfigManager
7
- } from "./chunk-7P3EP5OO.js";
7
+ } from "./chunk-OWCEONX7.js";
8
8
  import {
9
9
  getActivePluginAssets,
10
10
  getPendingHookTrust,
@@ -14,7 +14,7 @@ import {
14
14
  listHooks,
15
15
  listInstalledPlugins,
16
16
  resetStats
17
- } from "./chunk-QW6M662O.js";
17
+ } from "./chunk-Q4KBR2SG.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-EEFHKKT2.js";
29
+ } from "./chunk-M2QHKPRA.js";
30
30
 
31
31
  // src/diagnostics/doctor-report.ts
32
32
  import { existsSync as existsSync3, statSync as statSync2 } from "fs";
@@ -1,5 +1,5 @@
1
1
  // src/core/constants.ts
2
- var VERSION = "0.4.252";
2
+ var VERSION = "0.4.253";
3
3
  var APP_NAME = "ai-cli";
4
4
  var CONFIG_DIR_NAME = ".aicli";
5
5
  var CONFIG_FILE_NAME = "config.json";
@@ -6,7 +6,7 @@ import {
6
6
  MEMORY_FILE_NAME,
7
7
  MEMORY_MAX_CHARS,
8
8
  MEMORY_STORE_FILE_NAME
9
- } from "./chunk-EEFHKKT2.js";
9
+ } from "./chunk-M2QHKPRA.js";
10
10
  import {
11
11
  DEFAULT_PATTERNS,
12
12
  redactString
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  VERSION
4
- } from "./chunk-EEFHKKT2.js";
4
+ } from "./chunk-M2QHKPRA.js";
5
5
 
6
6
  // src/cli/ci-format.ts
7
7
  var DEFAULT_CI_THRESHOLDS = {
@@ -2,7 +2,7 @@
2
2
  import {
3
3
  evaluateCiGate,
4
4
  normalizeCiThresholds
5
- } from "./chunk-4BOT4YNT.js";
5
+ } from "./chunk-YMHARKR6.js";
6
6
  import {
7
7
  buildReviewPrompt,
8
8
  buildSecurityReviewPrompt,
@@ -10,13 +10,13 @@ import {
10
10
  } from "./chunk-HLWUDRBO.js";
11
11
  import {
12
12
  ProviderRegistry
13
- } from "./chunk-2QZMITSL.js";
13
+ } from "./chunk-ZRBGH245.js";
14
14
  import {
15
15
  ConfigManager
16
- } from "./chunk-7P3EP5OO.js";
16
+ } from "./chunk-OWCEONX7.js";
17
17
  import {
18
18
  VERSION
19
- } from "./chunk-EEFHKKT2.js";
19
+ } from "./chunk-M2QHKPRA.js";
20
20
 
21
21
  // src/cli/ci.ts
22
22
  import { execFileSync } from "child_process";
@@ -1,9 +1,9 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  detectsHallucinatedFileOp,
4
- repairToolCallArguments,
4
+ parseToolCallArguments,
5
5
  schemaToJsonSchema
6
- } from "./chunk-O3XSFPYH.js";
6
+ } from "./chunk-PSXIVQ3N.js";
7
7
  import {
8
8
  AuthError,
9
9
  ProviderError,
@@ -1168,7 +1168,7 @@ var OpenAICompatibleProvider = class extends BaseProvider {
1168
1168
  const reasoningContent = message.reasoning_content;
1169
1169
  if (message.tool_calls && message.tool_calls.length > 0) {
1170
1170
  const toolCalls = message.tool_calls.map((tc) => {
1171
- const parsedArgs = repairToolCallArguments(
1171
+ const parsed = parseToolCallArguments(
1172
1172
  tc.function.arguments || "{}",
1173
1173
  (m) => process.stderr.write(`[warn] ${m}
1174
1174
  `)
@@ -1176,7 +1176,8 @@ var OpenAICompatibleProvider = class extends BaseProvider {
1176
1176
  return {
1177
1177
  id: tc.id,
1178
1178
  name: tc.function.name,
1179
- arguments: parsedArgs
1179
+ arguments: parsed.args,
1180
+ ...parsed.status === "ok" ? {} : { argumentsTruncated: parsed.status }
1180
1181
  };
1181
1182
  });
1182
1183
  return { toolCalls, usage, reasoningContent };
@@ -3,14 +3,14 @@ import {
3
3
  CI_COMMENT_MARKER,
4
4
  countSeverity,
5
5
  runCi
6
- } from "./chunk-EPL77VAA.js";
7
- import "./chunk-4BOT4YNT.js";
6
+ } from "./chunk-YWG5KKSL.js";
7
+ import "./chunk-YMHARKR6.js";
8
8
  import "./chunk-HLWUDRBO.js";
9
- import "./chunk-2QZMITSL.js";
10
- import "./chunk-7P3EP5OO.js";
11
- import "./chunk-O3XSFPYH.js";
9
+ import "./chunk-ZRBGH245.js";
10
+ import "./chunk-OWCEONX7.js";
11
+ import "./chunk-PSXIVQ3N.js";
12
12
  import "./chunk-5ULLIOVC.js";
13
- import "./chunk-EEFHKKT2.js";
13
+ import "./chunk-M2QHKPRA.js";
14
14
  import "./chunk-IW3Q7AE5.js";
15
15
  export {
16
16
  CI_COMMENT_MARKER,
@@ -6,8 +6,8 @@ import {
6
6
  formatCiResult,
7
7
  formatCiSarif,
8
8
  normalizeCiThresholds
9
- } from "./chunk-4BOT4YNT.js";
10
- import "./chunk-EEFHKKT2.js";
9
+ } from "./chunk-YMHARKR6.js";
10
+ import "./chunk-M2QHKPRA.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-EEFHKKT2.js";
41
+ } from "./chunk-M2QHKPRA.js";
42
42
  export {
43
43
  AGENTIC_BEHAVIOR_GUIDELINE,
44
44
  APP_NAME,
@@ -2,14 +2,14 @@
2
2
  import {
3
3
  formatDoctorReport,
4
4
  runDoctorCli
5
- } from "./chunk-XINRSNNL.js";
6
- import "./chunk-2QZMITSL.js";
7
- import "./chunk-7P3EP5OO.js";
8
- import "./chunk-QW6M662O.js";
9
- import "./chunk-O3XSFPYH.js";
5
+ } from "./chunk-SC6FMQLH.js";
6
+ import "./chunk-ZRBGH245.js";
7
+ import "./chunk-OWCEONX7.js";
8
+ import "./chunk-Q4KBR2SG.js";
9
+ import "./chunk-PSXIVQ3N.js";
10
10
  import "./chunk-5ULLIOVC.js";
11
11
  import "./chunk-HOSJZMQS.js";
12
- import "./chunk-EEFHKKT2.js";
12
+ import "./chunk-M2QHKPRA.js";
13
13
  import "./chunk-IW3Q7AE5.js";
14
14
  export {
15
15
  formatDoctorReport,
@@ -34,14 +34,14 @@ import {
34
34
  touchMemoryReferences,
35
35
  updateMemoryApproval,
36
36
  updateMemoryEntry
37
- } from "./chunk-JWSMRAVK.js";
37
+ } from "./chunk-2JHYZUQE.js";
38
38
  import {
39
39
  redactJson,
40
40
  scanString
41
41
  } from "./chunk-YVTASHS5.js";
42
42
  import {
43
43
  runTestsTool
44
- } from "./chunk-2N3IEEY4.js";
44
+ } from "./chunk-RPYNPLIE.js";
45
45
  import {
46
46
  AGENTIC_BEHAVIOR_GUIDELINE,
47
47
  APP_NAME,
@@ -73,7 +73,7 @@ import {
73
73
  SUBAGENT_MAX_ROUNDS_LIMIT,
74
74
  VERSION,
75
75
  buildUserIdentityPrompt
76
- } from "./chunk-TQVR2URD.js";
76
+ } from "./chunk-UMW33EEH.js";
77
77
  import {
78
78
  hasSemanticIndex,
79
79
  semanticSearch
@@ -2307,10 +2307,10 @@ var ThinkTagFilter = class {
2307
2307
  return "";
2308
2308
  }
2309
2309
  };
2310
- function repairToolCallArguments(raw, onWarn) {
2310
+ function parseToolCallArguments(raw, onWarn) {
2311
2311
  const argStr = raw || "{}";
2312
2312
  try {
2313
- return JSON.parse(argStr);
2313
+ return { args: JSON.parse(argStr), status: "ok" };
2314
2314
  } catch {
2315
2315
  const truncated = argStr.trimEnd();
2316
2316
  const lastComma = truncated.lastIndexOf(",");
@@ -2318,13 +2318,18 @@ function repairToolCallArguments(raw, onWarn) {
2318
2318
  try {
2319
2319
  const repaired = JSON.parse(fixed);
2320
2320
  onWarn?.("Tool call JSON was truncated and auto-repaired. Some parameters may be missing.");
2321
- return repaired;
2321
+ return { args: repaired, status: "repaired" };
2322
2322
  } catch {
2323
2323
  onWarn?.("Tool call JSON could not be parsed, using empty arguments.");
2324
- return {};
2324
+ return { args: {}, status: "failed" };
2325
2325
  }
2326
2326
  }
2327
2327
  }
2328
+ function buildTruncatedArgumentsError(toolName, status, parsedKeys) {
2329
+ const lost = status === "failed" ? "The arguments JSON was cut off and could not be parsed at all." : `The arguments JSON was cut off mid-way; only these keys survived: ${parsedKeys.join(", ") || "(none)"}. Any remaining value is incomplete.`;
2330
+ const longContentHint = toolName === "write_file" || toolName === "edit_file" ? " For long documents (300+ lines / 3 KB+), do NOT retry write_file \u2014 use `save_last_response`, which streams the document straight to disk without an argument size limit." : "";
2331
+ return `[${toolName}] NOT EXECUTED \u2014 the model output hit its length limit while emitting this tool call, so the arguments were truncated. ${lost} Nothing was written or changed. Retry with a smaller payload: split the work into several calls, or shorten the arguments.${longContentHint}`;
2332
+ }
2328
2333
  async function consumeToolCallStream(stream, hooks = {}) {
2329
2334
  const textParts = [];
2330
2335
  const accumulators = /* @__PURE__ */ new Map();
@@ -2397,10 +2402,12 @@ async function consumeToolCallStream(stream, hooks = {}) {
2397
2402
  }
2398
2403
  const toolCalls = [];
2399
2404
  for (const [, acc] of accumulators) {
2405
+ const parsed = parseToolCallArguments(acc.arguments, hooks.onWarn);
2400
2406
  toolCalls.push({
2401
2407
  id: acc.id,
2402
2408
  name: acc.name,
2403
- arguments: repairToolCallArguments(acc.arguments, hooks.onWarn)
2409
+ arguments: parsed.args,
2410
+ ...parsed.status === "ok" ? {} : { argumentsTruncated: parsed.status }
2404
2411
  });
2405
2412
  }
2406
2413
  if (toolCalls.length > 0) {
@@ -2986,7 +2993,7 @@ var OpenAICompatibleProvider = class extends BaseProvider {
2986
2993
  const reasoningContent = message.reasoning_content;
2987
2994
  if (message.tool_calls && message.tool_calls.length > 0) {
2988
2995
  const toolCalls = message.tool_calls.map((tc) => {
2989
- const parsedArgs = repairToolCallArguments(
2996
+ const parsed = parseToolCallArguments(
2990
2997
  tc.function.arguments || "{}",
2991
2998
  (m) => process.stderr.write(`[warn] ${m}
2992
2999
  `)
@@ -2994,7 +3001,8 @@ var OpenAICompatibleProvider = class extends BaseProvider {
2994
3001
  return {
2995
3002
  id: tc.id,
2996
3003
  name: tc.function.name,
2997
- arguments: parsedArgs
3004
+ arguments: parsed.args,
3005
+ ...parsed.status === "ok" ? {} : { argumentsTruncated: parsed.status }
2998
3006
  };
2999
3007
  });
3000
3008
  return { toolCalls, usage, reasoningContent };
@@ -7157,6 +7165,15 @@ var ToolExecutor = class {
7157
7165
  isError: true
7158
7166
  };
7159
7167
  }
7168
+ if (call.argumentsTruncated) {
7169
+ const message = buildTruncatedArgumentsError(
7170
+ call.name,
7171
+ call.argumentsTruncated,
7172
+ Object.keys(call.arguments)
7173
+ );
7174
+ console.log(theme.warning(` \u26A0 ${call.name}: arguments truncated by output limit \u2014 not executed`));
7175
+ return { callId: call.id, content: message, isError: true };
7176
+ }
7160
7177
  const dangerLevel = getDangerLevel(call.name, call.arguments);
7161
7178
  let toolCallAlreadyPrinted = false;
7162
7179
  runHook(this.hookConfig?.preToolExecution, {
@@ -7847,9 +7864,10 @@ Do NOT split a long document into many write_file(append=true) calls. That patte
7847
7864
  if (appendMode) {
7848
7865
  appendFileSync(filePath, content, encoding);
7849
7866
  } else {
7850
- atomicWriteFileSync(filePath, content);
7867
+ atomicWriteFileSync(filePath, encoding === "utf-8" || encoding === "utf8" ? content : Buffer.from(content, encoding));
7851
7868
  }
7852
7869
  const lines = content.split("\n").length;
7870
+ const bytes = Buffer.byteLength(content, encoding);
7853
7871
  const mode = appendMode ? "appended" : "written";
7854
7872
  void (async () => {
7855
7873
  try {
@@ -7858,7 +7876,7 @@ Do NOT split a long document into many write_file(append=true) calls. That patte
7858
7876
  } catch {
7859
7877
  }
7860
7878
  })();
7861
- return `File ${mode}: ${filePath} (${lines} lines, ${content.length} bytes)`;
7879
+ return `File ${mode}: ${filePath} (${lines} lines, ${bytes} bytes)`;
7862
7880
  }
7863
7881
  };
7864
7882
 
@@ -9694,7 +9712,7 @@ Any of these triggers means use save_last_response, NOT write_file:
9694
9712
  mkdirSync7(dirname6(filePath), { recursive: true });
9695
9713
  atomicWriteFileSync(filePath, content);
9696
9714
  const lines = content.split("\n").length;
9697
- return `File saved: ${filePath} (${lines} lines, ${content.length} bytes)`;
9715
+ return `File saved: ${filePath} (${lines} lines, ${Buffer.byteLength(content, "utf-8")} bytes)`;
9698
9716
  }
9699
9717
  };
9700
9718
 
@@ -13137,6 +13155,15 @@ var ToolExecutorWeb = class _ToolExecutorWeb {
13137
13155
  if (!tool) {
13138
13156
  return { callId: call.id, content: `Unknown tool: ${call.name}`, isError: true };
13139
13157
  }
13158
+ if (call.argumentsTruncated) {
13159
+ const message = buildTruncatedArgumentsError(
13160
+ call.name,
13161
+ call.argumentsTruncated,
13162
+ Object.keys(call.arguments)
13163
+ );
13164
+ this.send({ type: "info", message: `\u26A0 ${call.name}: arguments truncated by output limit \u2014 not executed` });
13165
+ return { callId: call.id, content: message, isError: true };
13166
+ }
13140
13167
  const dangerLevel = getDangerLevel(call.name, call.arguments);
13141
13168
  let toolCallStarted = false;
13142
13169
  runHook(this.hookConfig?.preToolExecution, {
@@ -15178,7 +15205,7 @@ Cache: write=${cacheCreate} read=${cacheRead}` : "";
15178
15205
  Cost: ${formatCost(cost)}` : "";
15179
15206
  let memoryLine = "";
15180
15207
  try {
15181
- const { countPendingMemories } = await import("./persistent-memory-US6A7WMA.js");
15208
+ const { countPendingMemories } = await import("./persistent-memory-QOT2TQCT.js");
15182
15209
  const pending = countPendingMemories(ctx.config.getConfigDir());
15183
15210
  if (pending > 0) memoryLine = `
15184
15211
  Memory: \u26A0 ${pending} pending approval \u2014 see the Memory panel or /memory`;
@@ -15987,7 +16014,7 @@ async function handleSecurityReview(args, ctx) {
15987
16014
  async function handleTest(args, ctx) {
15988
16015
  ctx.send({ type: "info", message: "\u{1F9EA} Running tests..." });
15989
16016
  try {
15990
- const { executeTests } = await import("./run-tests-4FSTZ22Q.js");
16017
+ const { executeTests } = await import("./run-tests-JVQU3RAN.js");
15991
16018
  const argStr = args.join(" ").trim();
15992
16019
  let testArgs = {};
15993
16020
  if (argStr) {
@@ -16251,7 +16278,7 @@ async function handleMemory(args, ctx) {
16251
16278
  ctx.handleMemoryManage(sub, args[1], sub === "expire" ? args[2] : void 0);
16252
16279
  } else if (sub === "export") {
16253
16280
  if (args[1] === "md") {
16254
- const { exportMemoryEntries: exportMemoryEntries2 } = await import("./persistent-memory-US6A7WMA.js");
16281
+ const { exportMemoryEntries: exportMemoryEntries2 } = await import("./persistent-memory-QOT2TQCT.js");
16255
16282
  ctx.send({
16256
16283
  type: "export_data",
16257
16284
  format: "md",
@@ -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-KWM7J4US.js");
157
+ const { TaskOrchestrator } = await import("./task-orchestrator-PLP3INNN.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-AXNUGP53.js";
20
+ } from "./chunk-P5JUXUBS.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-5GWGXJQN.js";
53
+ } from "./chunk-BZNTSGLQ.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-HUV7TFOH.js";
79
+ } from "./chunk-USG3ASQ2.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-XINRSNNL.js";
93
+ } from "./chunk-SC6FMQLH.js";
94
94
  import {
95
95
  ProviderRegistry
96
- } from "./chunk-2QZMITSL.js";
96
+ } from "./chunk-ZRBGH245.js";
97
97
  import {
98
98
  ConfigManager
99
- } from "./chunk-7P3EP5OO.js";
99
+ } from "./chunk-OWCEONX7.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-QW6M662O.js";
116
+ } from "./chunk-Q4KBR2SG.js";
117
117
  import {
118
118
  CONTENT_ONLY_STREAM_REMINDER,
119
119
  TEE_FINAL_USER_NUDGE,
@@ -132,7 +132,7 @@ import {
132
132
  stripOuterCodeFence,
133
133
  stripToolCallReminder,
134
134
  teeStreamErrorSummary
135
- } from "./chunk-O3XSFPYH.js";
135
+ } from "./chunk-PSXIVQ3N.js";
136
136
  import {
137
137
  AuthError,
138
138
  ProviderError,
@@ -146,7 +146,7 @@ import {
146
146
  import {
147
147
  fileCheckpoints
148
148
  } from "./chunk-4BKXL7SM.js";
149
- import "./chunk-KTE4BHHI.js";
149
+ import "./chunk-ABMMKA5S.js";
150
150
  import {
151
151
  AGENTIC_BEHAVIOR_GUIDELINE,
152
152
  AUTHOR,
@@ -165,7 +165,7 @@ import {
165
165
  SKILLS_DIR_NAME,
166
166
  VERSION,
167
167
  buildUserIdentityPrompt
168
- } from "./chunk-EEFHKKT2.js";
168
+ } from "./chunk-M2QHKPRA.js";
169
169
  import {
170
170
  buildChatIndex,
171
171
  clearChatIndex,
@@ -1387,7 +1387,7 @@ No tools match "${filter}".
1387
1387
  const { join: join6 } = await import("path");
1388
1388
  const { existsSync: existsSync5 } = await import("fs");
1389
1389
  const { getGitRoot: getGitRoot2 } = await import("./git-context-EXOEHQSF.js");
1390
- const { MCP_PROJECT_CONFIG_NAME: MCP_PROJECT_CONFIG_NAME2 } = await import("./constants-R57JYUHW.js");
1390
+ const { MCP_PROJECT_CONFIG_NAME: MCP_PROJECT_CONFIG_NAME2 } = await import("./constants-7KSDW6RF.js");
1391
1391
  const { approveProject, hashMcpFile } = await import("./project-trust-NKYHL3VZ.js");
1392
1392
  const cwd = process.cwd();
1393
1393
  const projectRoot = getGitRoot2(cwd) ?? cwd;
@@ -2366,7 +2366,7 @@ function createReviewCommands() {
2366
2366
  usage: "/test [command|filter]",
2367
2367
  async execute(args, ctx) {
2368
2368
  try {
2369
- const { executeTests } = await import("./run-tests-IM3GSWBM.js");
2369
+ const { executeTests } = await import("./run-tests-RSYTYFZF.js");
2370
2370
  const argStr = args.join(" ").trim();
2371
2371
  let testArgs = {};
2372
2372
  if (argStr) {
@@ -8013,7 +8013,7 @@ program.command("web").description("Start Web UI server with browser-based chat
8013
8013
  console.error("Error: Invalid port number. Must be between 1 and 65535.");
8014
8014
  process.exit(1);
8015
8015
  }
8016
- const { startWebServer } = await import("./server-ULAI723O.js");
8016
+ const { startWebServer } = await import("./server-VOIG5VKM.js");
8017
8017
  await startWebServer({ port, host: options.host });
8018
8018
  });
8019
8019
  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) => {
@@ -8180,11 +8180,11 @@ program.command("sessions").description("List recent conversation sessions").opt
8180
8180
  console.log(footer + "\n");
8181
8181
  });
8182
8182
  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) => {
8183
- const { runUsageCli } = await import("./usage-E72O4RHB.js");
8183
+ const { runUsageCli } = await import("./usage-3EQUVK37.js");
8184
8184
  await runUsageCli(options);
8185
8185
  });
8186
8186
  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) => {
8187
- const { runDoctorCli } = await import("./doctor-cli-ODPYWX4T.js");
8187
+ const { runDoctorCli } = await import("./doctor-cli-ZOIMXV4C.js");
8188
8188
  const argv = process.argv.slice(2);
8189
8189
  await runDoctorCli({
8190
8190
  json: !!options.json || argv.includes("--json"),
@@ -8193,7 +8193,7 @@ program.command("doctor").description("Health check: API keys, config, MCP, rece
8193
8193
  });
8194
8194
  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) => {
8195
8195
  try {
8196
- const batch = await import("./batch-UCAVB77F.js");
8196
+ const batch = await import("./batch-TPW2SM6G.js");
8197
8197
  switch (action) {
8198
8198
  case "submit":
8199
8199
  if (!arg) {
@@ -8236,7 +8236,7 @@ program.command("batch <action> [arg] [arg2]").description("Anthropic Message Ba
8236
8236
  }
8237
8237
  });
8238
8238
  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) => {
8239
- const { startMcpServer } = await import("./server-WZFZEVCQ.js");
8239
+ const { startMcpServer } = await import("./server-O2YQGG72.js");
8240
8240
  await startMcpServer({
8241
8241
  allowDestructive: !!options.allowDestructive,
8242
8242
  allowOutsideCwd: !!options.allowOutsideCwd,
@@ -8249,7 +8249,7 @@ program.command("pr <action> [target]").description("PR review helpers: review |
8249
8249
  console.error(`Unknown pr action: ${action}. Use review | security-review | summarize.`);
8250
8250
  process.exit(1);
8251
8251
  }
8252
- const { runPrCli } = await import("./pr-6PR2OO5F.js");
8252
+ const { runPrCli } = await import("./pr-HMOXDXWR.js");
8253
8253
  const result = await runPrCli({
8254
8254
  action,
8255
8255
  target,
@@ -8269,8 +8269,8 @@ program.command("pr <action> [target]").description("PR review helpers: review |
8269
8269
  process.exit(result.exitCode);
8270
8270
  });
8271
8271
  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) => {
8272
- const { runCi } = await import("./ci-LOL5I5DP.js");
8273
- const { formatCiResult } = await import("./ci-format-TT5IZATX.js");
8272
+ const { runCi } = await import("./ci-DYTVVEBO.js");
8273
+ const { formatCiResult } = await import("./ci-format-QTSA6FJJ.js");
8274
8274
  const formats = [options.json, options.markdown, options.sarif].filter(Boolean).length;
8275
8275
  if (formats > 1) {
8276
8276
  console.error("Choose only one output format: --json, --markdown, or --sarif.");
@@ -8428,7 +8428,7 @@ program.command("hub [topic]").description("Start multi-agent hub (discuss / bra
8428
8428
  config.get("customProviders"),
8429
8429
  config.getConfigDir()
8430
8430
  );
8431
- const { startHub } = await import("./hub-BNUQJOBO.js");
8431
+ const { startHub } = await import("./hub-6L2UCZAU.js");
8432
8432
  await startHub(
8433
8433
  {
8434
8434
  topic: topic ?? "",
@@ -28,9 +28,9 @@ import {
28
28
  touchMemoryReferences,
29
29
  updateMemoryApproval,
30
30
  updateMemoryEntry
31
- } from "./chunk-HUV7TFOH.js";
31
+ } from "./chunk-USG3ASQ2.js";
32
32
  import "./chunk-HOSJZMQS.js";
33
- import "./chunk-EEFHKKT2.js";
33
+ import "./chunk-M2QHKPRA.js";
34
34
  import "./chunk-B5TYJO7V.js";
35
35
  import "./chunk-IW3Q7AE5.js";
36
36
  export {
@@ -27,9 +27,9 @@ import {
27
27
  touchMemoryReferences,
28
28
  updateMemoryApproval,
29
29
  updateMemoryEntry
30
- } from "./chunk-JWSMRAVK.js";
30
+ } from "./chunk-2JHYZUQE.js";
31
31
  import "./chunk-YVTASHS5.js";
32
- import "./chunk-TQVR2URD.js";
32
+ import "./chunk-UMW33EEH.js";
33
33
  import "./chunk-6BUTA5VW.js";
34
34
  export {
35
35
  addMemoryEntry,
@@ -2,8 +2,8 @@
2
2
  import {
3
3
  countSeverity,
4
4
  runCi
5
- } from "./chunk-EPL77VAA.js";
6
- import "./chunk-4BOT4YNT.js";
5
+ } from "./chunk-YWG5KKSL.js";
6
+ import "./chunk-YMHARKR6.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-2QZMITSL.js";
14
+ } from "./chunk-ZRBGH245.js";
15
15
  import {
16
16
  ConfigManager
17
- } from "./chunk-7P3EP5OO.js";
18
- import "./chunk-O3XSFPYH.js";
17
+ } from "./chunk-OWCEONX7.js";
18
+ import "./chunk-PSXIVQ3N.js";
19
19
  import "./chunk-5ULLIOVC.js";
20
20
  import {
21
21
  VERSION
22
- } from "./chunk-EEFHKKT2.js";
22
+ } from "./chunk-M2QHKPRA.js";
23
23
  import "./chunk-IW3Q7AE5.js";
24
24
 
25
25
  // src/cli/pr.ts
@@ -1,8 +1,8 @@
1
1
  import {
2
2
  executeTests,
3
3
  runTestsTool
4
- } from "./chunk-2N3IEEY4.js";
5
- import "./chunk-TQVR2URD.js";
4
+ } from "./chunk-RPYNPLIE.js";
5
+ import "./chunk-UMW33EEH.js";
6
6
  export {
7
7
  executeTests,
8
8
  runTestsTool
@@ -2,8 +2,8 @@
2
2
  import {
3
3
  executeTests,
4
4
  runTestsTool
5
- } from "./chunk-KTE4BHHI.js";
6
- import "./chunk-EEFHKKT2.js";
5
+ } from "./chunk-ABMMKA5S.js";
6
+ import "./chunk-M2QHKPRA.js";
7
7
  export {
8
8
  executeTests,
9
9
  runTestsTool
@@ -1,26 +1,26 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  ToolRegistry
4
- } from "./chunk-5GWGXJQN.js";
5
- import "./chunk-HUV7TFOH.js";
4
+ } from "./chunk-BZNTSGLQ.js";
5
+ import "./chunk-USG3ASQ2.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-QW6M662O.js";
12
+ } from "./chunk-Q4KBR2SG.js";
13
13
  import {
14
14
  getDangerLevel,
15
15
  schemaToJsonSchema
16
- } from "./chunk-O3XSFPYH.js";
16
+ } from "./chunk-PSXIVQ3N.js";
17
17
  import "./chunk-5ULLIOVC.js";
18
18
  import "./chunk-HOSJZMQS.js";
19
19
  import "./chunk-4BKXL7SM.js";
20
- import "./chunk-KTE4BHHI.js";
20
+ import "./chunk-ABMMKA5S.js";
21
21
  import {
22
22
  VERSION
23
- } from "./chunk-EEFHKKT2.js";
23
+ } from "./chunk-M2QHKPRA.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-AXNUGP53.js";
26
+ } from "./chunk-P5JUXUBS.js";
27
27
  import {
28
28
  computeCost,
29
29
  formatCost,
@@ -63,7 +63,7 @@ import {
63
63
  spawnAgentContext,
64
64
  truncateOutput,
65
65
  undoStack
66
- } from "./chunk-5GWGXJQN.js";
66
+ } from "./chunk-BZNTSGLQ.js";
67
67
  import {
68
68
  addMemoryEntry,
69
69
  clearMemoryEntries,
@@ -77,7 +77,7 @@ import {
77
77
  parseWritableScope,
78
78
  updateMemoryApproval,
79
79
  updateMemoryEntry
80
- } from "./chunk-HUV7TFOH.js";
80
+ } from "./chunk-USG3ASQ2.js";
81
81
  import "./chunk-GLSR2NR3.js";
82
82
  import "./chunk-UUSRWSSX.js";
83
83
  import "./chunk-CKH4KQ4E.js";
@@ -90,13 +90,13 @@ import {
90
90
  buildDoctorReport,
91
91
  formatDoctorReport,
92
92
  loadContextFiles
93
- } from "./chunk-XINRSNNL.js";
93
+ } from "./chunk-SC6FMQLH.js";
94
94
  import {
95
95
  ProviderRegistry
96
- } from "./chunk-2QZMITSL.js";
96
+ } from "./chunk-ZRBGH245.js";
97
97
  import {
98
98
  ConfigManager
99
- } from "./chunk-7P3EP5OO.js";
99
+ } from "./chunk-OWCEONX7.js";
100
100
  import {
101
101
  describePlugin,
102
102
  getActivePluginAssets,
@@ -111,13 +111,14 @@ import {
111
111
  runTool,
112
112
  setPluginEnabled,
113
113
  trustPlugin
114
- } from "./chunk-QW6M662O.js";
114
+ } from "./chunk-Q4KBR2SG.js";
115
115
  import {
116
116
  CONTENT_ONLY_STREAM_REMINDER,
117
117
  TEE_FINAL_USER_NUDGE,
118
118
  TOOL_CALL_REMINDER,
119
119
  buildDeferredSaveInstruction,
120
120
  buildRoundBudgetHint,
121
+ buildTruncatedArgumentsError,
121
122
  consumeToolCallStream,
122
123
  evaluateTeeContent,
123
124
  freshPriorContent,
@@ -127,7 +128,7 @@ import {
127
128
  stripOuterCodeFence,
128
129
  stripToolCallReminder,
129
130
  teeStreamErrorSummary
130
- } from "./chunk-O3XSFPYH.js";
131
+ } from "./chunk-PSXIVQ3N.js";
131
132
  import "./chunk-5ULLIOVC.js";
132
133
  import {
133
134
  formatGitContextForPrompt,
@@ -135,7 +136,7 @@ import {
135
136
  getGitRoot
136
137
  } from "./chunk-HOSJZMQS.js";
137
138
  import "./chunk-4BKXL7SM.js";
138
- import "./chunk-KTE4BHHI.js";
139
+ import "./chunk-ABMMKA5S.js";
139
140
  import {
140
141
  AGENTIC_BEHAVIOR_GUIDELINE,
141
142
  AUTHOR,
@@ -151,7 +152,7 @@ import {
151
152
  SKILLS_DIR_NAME,
152
153
  VERSION,
153
154
  buildUserIdentityPrompt
154
- } from "./chunk-EEFHKKT2.js";
155
+ } from "./chunk-M2QHKPRA.js";
155
156
  import "./chunk-6RPGQ5CG.js";
156
157
  import "./chunk-KHYD3WXE.js";
157
158
  import "./chunk-NYNSYLFY.js";
@@ -387,6 +388,15 @@ var ToolExecutorWeb = class _ToolExecutorWeb {
387
388
  if (!tool) {
388
389
  return { callId: call.id, content: `Unknown tool: ${call.name}`, isError: true };
389
390
  }
391
+ if (call.argumentsTruncated) {
392
+ const message = buildTruncatedArgumentsError(
393
+ call.name,
394
+ call.argumentsTruncated,
395
+ Object.keys(call.arguments)
396
+ );
397
+ this.send({ type: "info", message: `\u26A0 ${call.name}: arguments truncated by output limit \u2014 not executed` });
398
+ return { callId: call.id, content: message, isError: true };
399
+ }
390
400
  const dangerLevel = getDangerLevel(call.name, call.arguments);
391
401
  let toolCallStarted = false;
392
402
  runHook(this.hookConfig?.preToolExecution, {
@@ -803,7 +813,7 @@ Cache: write=${cacheCreate} read=${cacheRead}` : "";
803
813
  Cost: ${formatCost(cost)}` : "";
804
814
  let memoryLine = "";
805
815
  try {
806
- const { countPendingMemories } = await import("./persistent-memory-ITDGIW3Z.js");
816
+ const { countPendingMemories } = await import("./persistent-memory-HQKE5X7Z.js");
807
817
  const pending = countPendingMemories(ctx.config.getConfigDir());
808
818
  if (pending > 0) memoryLine = `
809
819
  Memory: \u26A0 ${pending} pending approval \u2014 see the Memory panel or /memory`;
@@ -1612,7 +1622,7 @@ async function handleSecurityReview(args, ctx) {
1612
1622
  async function handleTest(args, ctx) {
1613
1623
  ctx.send({ type: "info", message: "\u{1F9EA} Running tests..." });
1614
1624
  try {
1615
- const { executeTests } = await import("./run-tests-IM3GSWBM.js");
1625
+ const { executeTests } = await import("./run-tests-RSYTYFZF.js");
1616
1626
  const argStr = args.join(" ").trim();
1617
1627
  let testArgs = {};
1618
1628
  if (argStr) {
@@ -1876,7 +1886,7 @@ async function handleMemory(args, ctx) {
1876
1886
  ctx.handleMemoryManage(sub, args[1], sub === "expire" ? args[2] : void 0);
1877
1887
  } else if (sub === "export") {
1878
1888
  if (args[1] === "md") {
1879
- const { exportMemoryEntries: exportMemoryEntries2 } = await import("./persistent-memory-ITDGIW3Z.js");
1889
+ const { exportMemoryEntries: exportMemoryEntries2 } = await import("./persistent-memory-HQKE5X7Z.js");
1880
1890
  ctx.send({
1881
1891
  type: "export_data",
1882
1892
  format: "md",
@@ -3,26 +3,26 @@ import {
3
3
  ToolRegistry,
4
4
  googleSearchContext,
5
5
  truncateOutput
6
- } from "./chunk-5GWGXJQN.js";
7
- import "./chunk-HUV7TFOH.js";
6
+ } from "./chunk-BZNTSGLQ.js";
7
+ import "./chunk-USG3ASQ2.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-QW6M662O.js";
14
+ } from "./chunk-Q4KBR2SG.js";
15
15
  import {
16
16
  getDangerLevel,
17
17
  runLeanAgentLoop
18
- } from "./chunk-O3XSFPYH.js";
18
+ } from "./chunk-PSXIVQ3N.js";
19
19
  import "./chunk-5ULLIOVC.js";
20
20
  import "./chunk-HOSJZMQS.js";
21
21
  import "./chunk-4BKXL7SM.js";
22
- import "./chunk-KTE4BHHI.js";
22
+ import "./chunk-ABMMKA5S.js";
23
23
  import {
24
24
  SUBAGENT_ALLOWED_TOOLS
25
- } from "./chunk-EEFHKKT2.js";
25
+ } from "./chunk-M2QHKPRA.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-GUOLPI33.js";
9
9
  import {
10
10
  ConfigManager
11
- } from "./chunk-7P3EP5OO.js";
11
+ } from "./chunk-OWCEONX7.js";
12
12
  import "./chunk-5ULLIOVC.js";
13
- import "./chunk-EEFHKKT2.js";
13
+ import "./chunk-M2QHKPRA.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.252",
3
+ "version": "0.4.253",
4
4
  "description": "Cross-platform REPL-style AI CLI with multi-provider support",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",