jinzd-ai-cli 0.4.57 → 0.4.58

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.
@@ -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.57";
9
+ var VERSION = "0.4.58";
10
10
  var APP_NAME = "ai-cli";
11
11
  var CONFIG_DIR_NAME = ".aicli";
12
12
  var CONFIG_FILE_NAME = "config.json";
@@ -8,7 +8,7 @@ import { platform } from "os";
8
8
  import chalk from "chalk";
9
9
 
10
10
  // src/core/constants.ts
11
- var VERSION = "0.4.57";
11
+ var VERSION = "0.4.58";
12
12
  var APP_NAME = "ai-cli";
13
13
  var CONFIG_DIR_NAME = ".aicli";
14
14
  var CONFIG_FILE_NAME = "config.json";
@@ -10,7 +10,7 @@ import {
10
10
  SUBAGENT_DEFAULT_MAX_ROUNDS,
11
11
  SUBAGENT_MAX_ROUNDS_LIMIT,
12
12
  runTestsTool
13
- } from "./chunk-C2MNNHJ6.js";
13
+ } from "./chunk-7MQXQDVV.js";
14
14
 
15
15
  // src/tools/builtin/bash.ts
16
16
  import { execSync } from "child_process";
@@ -221,7 +221,7 @@ Important rules:
221
221
  },
222
222
  timeout: {
223
223
  type: "number",
224
- description: "Timeout in milliseconds, defaults to 30000",
224
+ description: "Timeout in milliseconds, defaults to 120000 (2 min), max 300000 (5 min). For recursive filesystem operations (e.g. Get-ChildItem -Recurse on large trees, find on deep dirs), pass a larger value explicitly (e.g. 240000) \u2014 the default may be too short.",
225
225
  required: false
226
226
  }
227
227
  },
@@ -229,8 +229,9 @@ Important rules:
229
229
  },
230
230
  async execute(args) {
231
231
  const command = String(args["command"] ?? "");
232
+ const DEFAULT_TIMEOUT = 12e4;
232
233
  const MAX_TIMEOUT = 3e5;
233
- const timeout = Math.min(Math.max(Number(args["timeout"] ?? 3e4), 1e3), MAX_TIMEOUT);
234
+ const timeout = Math.min(Math.max(Number(args["timeout"] ?? DEFAULT_TIMEOUT), 1e3), MAX_TIMEOUT);
234
235
  const cwdArg = args["cwd"] ? String(args["cwd"]) : void 0;
235
236
  if (!command.trim()) {
236
237
  throw new ToolError("bash", "command is required");
@@ -287,18 +288,38 @@ Important rules:
287
288
  return result || "(command completed with no output)";
288
289
  } catch (err) {
289
290
  pushBashUndoEntries(beforeSnapshot, parsedTargetsBefore, effectiveCwd);
290
- if (err && typeof err === "object" && "status" in err) {
291
+ if (err && typeof err === "object") {
291
292
  const execErr = err;
292
- const stderr = IS_WINDOWS && Buffer.isBuffer(execErr.stderr) ? execErr.stderr.toString("utf-8").trim() : execErr.stderr?.toString().trim() ?? "";
293
- const stdout = IS_WINDOWS && Buffer.isBuffer(execErr.stdout) ? execErr.stdout.toString("utf-8").trim() : execErr.stdout?.toString().trim() ?? "";
294
- const combined = [stdout, stderr].filter(Boolean).join("\n");
295
- throw new ToolError(
296
- "bash",
297
- `Exit code ${execErr.status}:
293
+ const isTimeout = execErr.code === "ETIMEDOUT" || execErr.status == null && execErr.signal === "SIGTERM" || /ETIMEDOUT/i.test(execErr.message ?? "");
294
+ if (isTimeout) {
295
+ const seconds = Math.round(timeout / 1e3);
296
+ throw new ToolError(
297
+ "bash",
298
+ `Command timed out after ${seconds}s.
299
+
300
+ The previous command ran for longer than the timeout limit and was killed. This usually means it is scanning a large filesystem tree (recursive Get-ChildItem / find), compressing a big archive, or waiting on a network request.
301
+
302
+ How to recover (pick ONE \u2014 do NOT retry the same command):
303
+ 1. Pass an explicit longer timeout, e.g. timeout: ${Math.min(timeout * 2, MAX_TIMEOUT)}
304
+ 2. Use a non-recursive / narrower alternative (e.g. 'Get-ChildItem -File' without -Recurse, or limit depth with -Depth 1)
305
+ 3. Split the work into smaller batches (process subdirectories one at a time)
306
+ 4. For size/count queries, use '(Get-ChildItem X).Count' per directory instead of one giant pipeline
307
+
308
+ [Do NOT retry the identical command \u2014 it will time out again.]`
309
+ );
310
+ }
311
+ if ("status" in execErr && execErr.status !== void 0) {
312
+ const stderr = IS_WINDOWS && Buffer.isBuffer(execErr.stderr) ? execErr.stderr.toString("utf-8").trim() : execErr.stderr?.toString().trim() ?? "";
313
+ const stdout = IS_WINDOWS && Buffer.isBuffer(execErr.stdout) ? execErr.stdout.toString("utf-8").trim() : execErr.stdout?.toString().trim() ?? "";
314
+ const combined = [stdout, stderr].filter(Boolean).join("\n");
315
+ throw new ToolError(
316
+ "bash",
317
+ `Exit code ${execErr.status}:
298
318
  ${combined || (execErr.message ?? "Unknown error")}
299
319
 
300
320
  [Command failed. Report this error to the user. Do not retry with variant commands.]`
301
- );
321
+ );
322
+ }
302
323
  }
303
324
  throw err;
304
325
  }
@@ -7,7 +7,7 @@ import {
7
7
  ProviderNotFoundError,
8
8
  RateLimitError,
9
9
  schemaToJsonSchema
10
- } from "./chunk-G6K64M6X.js";
10
+ } from "./chunk-HDNVCYD6.js";
11
11
  import {
12
12
  APP_NAME,
13
13
  CONFIG_DIR_NAME,
@@ -20,7 +20,7 @@ import {
20
20
  MCP_TOOL_PREFIX,
21
21
  PLUGINS_DIR_NAME,
22
22
  VERSION
23
- } from "./chunk-C2MNNHJ6.js";
23
+ } from "./chunk-7MQXQDVV.js";
24
24
 
25
25
  // src/config/config-manager.ts
26
26
  import { readFileSync, writeFileSync, existsSync, mkdirSync } from "fs";
@@ -385,7 +385,7 @@ ${content}`);
385
385
  }
386
386
  }
387
387
  async function runTaskMode(config, providers, configManager, topic) {
388
- const { TaskOrchestrator } = await import("./task-orchestrator-FRF6LTWK.js");
388
+ const { TaskOrchestrator } = await import("./task-orchestrator-BWFYT4Q5.js");
389
389
  const orchestrator = new TaskOrchestrator(config, providers, configManager);
390
390
  let interrupted = false;
391
391
  const onSigint = () => {
package/dist/index.js CHANGED
@@ -27,7 +27,7 @@ import {
27
27
  saveDevState,
28
28
  sessionHasMeaningfulContent,
29
29
  setupProxy
30
- } from "./chunk-G5REL4FK.js";
30
+ } from "./chunk-ZHURWJEW.js";
31
31
  import {
32
32
  ToolExecutor,
33
33
  ToolRegistry,
@@ -41,7 +41,7 @@ import {
41
41
  spawnAgentContext,
42
42
  theme,
43
43
  undoStack
44
- } from "./chunk-G6K64M6X.js";
44
+ } from "./chunk-HDNVCYD6.js";
45
45
  import {
46
46
  fileCheckpoints
47
47
  } from "./chunk-4BKXL7SM.js";
@@ -66,7 +66,7 @@ import {
66
66
  SKILLS_DIR_NAME,
67
67
  VERSION,
68
68
  buildUserIdentityPrompt
69
- } from "./chunk-C2MNNHJ6.js";
69
+ } from "./chunk-7MQXQDVV.js";
70
70
 
71
71
  // src/index.ts
72
72
  import { program } from "commander";
@@ -2161,7 +2161,7 @@ ${hint}` : "")
2161
2161
  usage: "/test [command|filter]",
2162
2162
  async execute(args, ctx) {
2163
2163
  try {
2164
- const { executeTests } = await import("./run-tests-NVCAP42D.js");
2164
+ const { executeTests } = await import("./run-tests-ZC6WLEE4.js");
2165
2165
  const argStr = args.join(" ").trim();
2166
2166
  let testArgs = {};
2167
2167
  if (argStr) {
@@ -5609,7 +5609,7 @@ program.command("web").description("Start Web UI server with browser-based chat
5609
5609
  console.error("Error: Invalid port number. Must be between 1 and 65535.");
5610
5610
  process.exit(1);
5611
5611
  }
5612
- const { startWebServer } = await import("./server-46J5MXHG.js");
5612
+ const { startWebServer } = await import("./server-SFDOVFUN.js");
5613
5613
  await startWebServer({ port, host: options.host });
5614
5614
  });
5615
5615
  program.command("user [action] [username]").description("Manage Web UI users (list | create <name> | delete <name> | reset-password <name> | migrate <name>)").action(async (action, username) => {
@@ -5842,7 +5842,7 @@ program.command("hub [topic]").description("Start multi-agent hub (discuss / bra
5842
5842
  }),
5843
5843
  config.get("customProviders")
5844
5844
  );
5845
- const { startHub } = await import("./hub-P3BR4JB5.js");
5845
+ const { startHub } = await import("./hub-MRK53S5O.js");
5846
5846
  await startHub(
5847
5847
  {
5848
5848
  topic: topic ?? "",
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  executeTests,
3
3
  runTestsTool
4
- } from "./chunk-H7MNK3YO.js";
4
+ } from "./chunk-5CQPX74I.js";
5
5
  export {
6
6
  executeTests,
7
7
  runTestsTool
@@ -2,7 +2,7 @@
2
2
  import {
3
3
  executeTests,
4
4
  runTestsTool
5
- } from "./chunk-C2MNNHJ6.js";
5
+ } from "./chunk-7MQXQDVV.js";
6
6
  export {
7
7
  executeTests,
8
8
  runTestsTool
@@ -17,7 +17,7 @@ import {
17
17
  hadPreviousWriteToolCalls,
18
18
  loadDevState,
19
19
  setupProxy
20
- } from "./chunk-G5REL4FK.js";
20
+ } from "./chunk-ZHURWJEW.js";
21
21
  import {
22
22
  AuthManager
23
23
  } from "./chunk-BYNY5JPB.js";
@@ -36,7 +36,7 @@ import {
36
36
  spawnAgentContext,
37
37
  truncateOutput,
38
38
  undoStack
39
- } from "./chunk-G6K64M6X.js";
39
+ } from "./chunk-HDNVCYD6.js";
40
40
  import "./chunk-4BKXL7SM.js";
41
41
  import {
42
42
  AGENTIC_BEHAVIOR_GUIDELINE,
@@ -56,7 +56,7 @@ import {
56
56
  SKILLS_DIR_NAME,
57
57
  VERSION,
58
58
  buildUserIdentityPrompt
59
- } from "./chunk-C2MNNHJ6.js";
59
+ } from "./chunk-7MQXQDVV.js";
60
60
 
61
61
  // src/web/server.ts
62
62
  import express from "express";
@@ -1816,7 +1816,7 @@ ${undoResults.map((r) => ` \u2022 ${r}`).join("\n")}` });
1816
1816
  case "test": {
1817
1817
  this.send({ type: "info", message: "\u{1F9EA} Running tests..." });
1818
1818
  try {
1819
- const { executeTests } = await import("./run-tests-NVCAP42D.js");
1819
+ const { executeTests } = await import("./run-tests-ZC6WLEE4.js");
1820
1820
  const argStr = args.join(" ").trim();
1821
1821
  let testArgs = {};
1822
1822
  if (argStr) {
@@ -4,11 +4,11 @@ import {
4
4
  getDangerLevel,
5
5
  googleSearchContext,
6
6
  truncateOutput
7
- } from "./chunk-G6K64M6X.js";
7
+ } from "./chunk-HDNVCYD6.js";
8
8
  import "./chunk-4BKXL7SM.js";
9
9
  import {
10
10
  SUBAGENT_ALLOWED_TOOLS
11
- } from "./chunk-C2MNNHJ6.js";
11
+ } from "./chunk-7MQXQDVV.js";
12
12
 
13
13
  // src/hub/task-orchestrator.ts
14
14
  import { createInterface } from "readline";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "jinzd-ai-cli",
3
- "version": "0.4.57",
3
+ "version": "0.4.58",
4
4
  "description": "Cross-platform REPL-style AI CLI with multi-provider support",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",