jinzd-ai-cli 0.4.116 → 0.4.117

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-KRTQDZMY.js";
4
+ } from "./chunk-267DHNV2.js";
5
5
  import "./chunk-2ZD3YTVM.js";
6
- import "./chunk-H3F2E4MD.js";
6
+ import "./chunk-LO4MSGGO.js";
7
7
  import "./chunk-PDX44BCA.js";
8
8
 
9
9
  // src/cli/batch.ts
@@ -8,7 +8,7 @@ import {
8
8
  CONFIG_FILE_NAME,
9
9
  HISTORY_DIR_NAME,
10
10
  PLUGINS_DIR_NAME
11
- } from "./chunk-H3F2E4MD.js";
11
+ } from "./chunk-LO4MSGGO.js";
12
12
 
13
13
  // src/config/config-manager.ts
14
14
  import { readFileSync, writeFileSync, existsSync, mkdirSync } from "fs";
@@ -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.116";
9
+ var VERSION = "0.4.117";
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
  schemaToJsonSchema,
4
4
  truncateForPersist
5
- } from "./chunk-YTP26DOV.js";
5
+ } from "./chunk-AACUEN4B.js";
6
6
  import {
7
7
  AuthError,
8
8
  ProviderError,
@@ -18,7 +18,7 @@ import {
18
18
  MCP_PROTOCOL_VERSION,
19
19
  MCP_TOOL_PREFIX,
20
20
  VERSION
21
- } from "./chunk-H3F2E4MD.js";
21
+ } from "./chunk-LO4MSGGO.js";
22
22
  import {
23
23
  redactJson
24
24
  } from "./chunk-7ZJN4KLV.js";
@@ -5,7 +5,7 @@ import {
5
5
  } from "./chunk-3BICTI5M.js";
6
6
  import {
7
7
  runTestsTool
8
- } from "./chunk-VJE5V4H2.js";
8
+ } from "./chunk-W622HYR2.js";
9
9
  import {
10
10
  EnvLoader,
11
11
  NetworkError,
@@ -18,7 +18,7 @@ import {
18
18
  SUBAGENT_ALLOWED_TOOLS,
19
19
  SUBAGENT_DEFAULT_MAX_ROUNDS,
20
20
  SUBAGENT_MAX_ROUNDS_LIMIT
21
- } from "./chunk-H3F2E4MD.js";
21
+ } from "./chunk-LO4MSGGO.js";
22
22
  import {
23
23
  fileCheckpoints
24
24
  } from "./chunk-4BKXL7SM.js";
@@ -449,6 +449,11 @@ function buildErrorHint(command, stderr) {
449
449
  `Hint: SSH + nested quotes ("...\\"...\\"") is fragile across PS \u2192 ssh \u2192 remote-shell \u2192 psql layers. Use the file-based flow: (1) write_file locally to a .sql file, (2) 'scp x.sql root@host:/tmp/', (3) 'ssh root@host "sudo -u postgres psql -d <db> -f /tmp/x.sql"'. Or for remote-only SQL: 'ssh host "cat > /tmp/x.sql << \\'SQLEOF\\'\\n...\\nSQLEOF"' then run psql -f. Avoid inline psql -c with embedded quotes.`
450
450
  );
451
451
  }
452
+ if (IS_WINDOWS && /Remove-Item/i.test(command) && /cannot find path|no such file|exit 1/i.test(stderr || command)) {
453
+ hints.push(
454
+ `Hint: Add -ErrorAction SilentlyContinue to Remove-Item so missing files don't fail the cleanup step. Example: Remove-Item tmp_*.sql,tmp_*.csv -ErrorAction SilentlyContinue`
455
+ );
456
+ }
452
457
  const colMissing = stderr.match(/column "([^"]+)" does not exist/i);
453
458
  if (colMissing) {
454
459
  hints.push(
@@ -1855,7 +1860,15 @@ var ToolExecutor = class {
1855
1860
  }
1856
1861
  printToolResult(name, content, isError, wasTruncated) {
1857
1862
  if (isError) {
1858
- console.log(theme.error(`\u26A0 ${name} error: `) + theme.dim(content.slice(0, 300)));
1863
+ const lines = content.split("\n");
1864
+ const meaningful = lines.filter(
1865
+ (l) => !/^Exit code \d+:$/.test(l.trim()) && !l.startsWith("[Command failed") && !l.startsWith("\u{1F4A1} ") && l.trim() !== ""
1866
+ );
1867
+ const preview = meaningful.slice(0, 2).join(" \xB7 ") || content.slice(0, 120);
1868
+ const isSoft = /no such file or directory|not found|no matches|exit 1\s*$|cannot find path/i.test(content);
1869
+ const renderFn = isSoft ? theme.warning : theme.error;
1870
+ const icon = isSoft ? "\u2139" : "\u26A0";
1871
+ console.log(renderFn(`${icon} ${name} error: `) + theme.dim(preview.slice(0, 200)));
1859
1872
  } else {
1860
1873
  const lines = content.split("\n");
1861
1874
  const maxLines = name === "run_interactive" ? 40 : 8;
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
 
3
3
  // src/core/constants.ts
4
- var VERSION = "0.4.116";
4
+ var VERSION = "0.4.117";
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-H3F2E4MD.js";
4
+ } from "./chunk-LO4MSGGO.js";
5
5
 
6
6
  // src/tools/builtin/run-tests.ts
7
7
  import { execSync, spawnSync } from "child_process";
@@ -36,7 +36,7 @@ import {
36
36
  TEST_TIMEOUT,
37
37
  VERSION,
38
38
  buildUserIdentityPrompt
39
- } from "./chunk-H3F2E4MD.js";
39
+ } from "./chunk-LO4MSGGO.js";
40
40
  import "./chunk-PDX44BCA.js";
41
41
  export {
42
42
  AGENTIC_BEHAVIOR_GUIDELINE,
@@ -36,7 +36,7 @@ import {
36
36
  VERSION,
37
37
  buildUserIdentityPrompt,
38
38
  runTestsTool
39
- } from "./chunk-BXDHW7JO.js";
39
+ } from "./chunk-3YUH5CCS.js";
40
40
  import {
41
41
  hasSemanticIndex,
42
42
  semanticSearch
@@ -4013,6 +4013,11 @@ function buildErrorHint(command, stderr) {
4013
4013
  `Hint: SSH + nested quotes ("...\\"...\\"") is fragile across PS \u2192 ssh \u2192 remote-shell \u2192 psql layers. Use the file-based flow: (1) write_file locally to a .sql file, (2) 'scp x.sql root@host:/tmp/', (3) 'ssh root@host "sudo -u postgres psql -d <db> -f /tmp/x.sql"'. Or for remote-only SQL: 'ssh host "cat > /tmp/x.sql << \\'SQLEOF\\'\\n...\\nSQLEOF"' then run psql -f. Avoid inline psql -c with embedded quotes.`
4014
4014
  );
4015
4015
  }
4016
+ if (IS_WINDOWS && /Remove-Item/i.test(command) && /cannot find path|no such file|exit 1/i.test(stderr || command)) {
4017
+ hints.push(
4018
+ `Hint: Add -ErrorAction SilentlyContinue to Remove-Item so missing files don't fail the cleanup step. Example: Remove-Item tmp_*.sql,tmp_*.csv -ErrorAction SilentlyContinue`
4019
+ );
4020
+ }
4016
4021
  const colMissing = stderr.match(/column "([^"]+)" does not exist/i);
4017
4022
  if (colMissing) {
4018
4023
  hints.push(
@@ -5380,7 +5385,15 @@ var ToolExecutor = class {
5380
5385
  }
5381
5386
  printToolResult(name, content, isError, wasTruncated) {
5382
5387
  if (isError) {
5383
- console.log(theme.error(`\u26A0 ${name} error: `) + theme.dim(content.slice(0, 300)));
5388
+ const lines = content.split("\n");
5389
+ const meaningful = lines.filter(
5390
+ (l) => !/^Exit code \d+:$/.test(l.trim()) && !l.startsWith("[Command failed") && !l.startsWith("\u{1F4A1} ") && l.trim() !== ""
5391
+ );
5392
+ const preview = meaningful.slice(0, 2).join(" \xB7 ") || content.slice(0, 120);
5393
+ const isSoft = /no such file or directory|not found|no matches|exit 1\s*$|cannot find path/i.test(content);
5394
+ const renderFn = isSoft ? theme.warning : theme.error;
5395
+ const icon = isSoft ? "\u2139" : "\u26A0";
5396
+ console.log(renderFn(`${icon} ${name} error: `) + theme.dim(preview.slice(0, 200)));
5384
5397
  } else {
5385
5398
  const lines = content.split("\n");
5386
5399
  const maxLines = name === "run_interactive" ? 40 : 8;
@@ -12068,7 +12081,7 @@ ${undoResults.map((r) => ` \u2022 ${r}`).join("\n")}` });
12068
12081
  case "test": {
12069
12082
  this.send({ type: "info", message: "\u{1F9EA} Running tests..." });
12070
12083
  try {
12071
- const { executeTests } = await import("./run-tests-OKQEMYZK.js");
12084
+ const { executeTests } = await import("./run-tests-CQME3NR3.js");
12072
12085
  const argStr = args.join(" ").trim();
12073
12086
  let testArgs = {};
12074
12087
  if (argStr) {
@@ -386,7 +386,7 @@ ${content}`);
386
386
  }
387
387
  }
388
388
  async function runTaskMode(config, providers, configManager, topic) {
389
- const { TaskOrchestrator } = await import("./task-orchestrator-SCH3JUKT.js");
389
+ const { TaskOrchestrator } = await import("./task-orchestrator-WH2J6Z56.js");
390
390
  const orchestrator = new TaskOrchestrator(config, providers, configManager);
391
391
  let interrupted = false;
392
392
  const onSigint = () => {
package/dist/index.js CHANGED
@@ -32,10 +32,10 @@ import {
32
32
  setupProxy,
33
33
  stripPseudoToolCalls,
34
34
  stripToolCallReminder
35
- } from "./chunk-QMT4T4PH.js";
35
+ } from "./chunk-5D4ZMOGZ.js";
36
36
  import {
37
37
  ConfigManager
38
- } from "./chunk-KRTQDZMY.js";
38
+ } from "./chunk-267DHNV2.js";
39
39
  import {
40
40
  ToolExecutor,
41
41
  ToolRegistry,
@@ -54,10 +54,10 @@ import {
54
54
  spawnAgentContext,
55
55
  theme,
56
56
  undoStack
57
- } from "./chunk-YTP26DOV.js";
57
+ } from "./chunk-AACUEN4B.js";
58
58
  import "./chunk-3BICTI5M.js";
59
59
  import "./chunk-2DXY7UGF.js";
60
- import "./chunk-VJE5V4H2.js";
60
+ import "./chunk-W622HYR2.js";
61
61
  import "./chunk-2ZD3YTVM.js";
62
62
  import {
63
63
  AGENTIC_BEHAVIOR_GUIDELINE,
@@ -80,7 +80,7 @@ import {
80
80
  SKILLS_DIR_NAME,
81
81
  VERSION,
82
82
  buildUserIdentityPrompt
83
- } from "./chunk-H3F2E4MD.js";
83
+ } from "./chunk-LO4MSGGO.js";
84
84
  import {
85
85
  formatGitContextForPrompt,
86
86
  getGitContext,
@@ -1648,7 +1648,7 @@ ${text}
1648
1648
  const { join: join6 } = await import("path");
1649
1649
  const { existsSync: existsSync6 } = await import("fs");
1650
1650
  const { getGitRoot: getGitRoot2 } = await import("./git-context-7KIP4X2V.js");
1651
- const { MCP_PROJECT_CONFIG_NAME: MCP_PROJECT_CONFIG_NAME2 } = await import("./constants-NWATGC4A.js");
1651
+ const { MCP_PROJECT_CONFIG_NAME: MCP_PROJECT_CONFIG_NAME2 } = await import("./constants-H7Q7BTHA.js");
1652
1652
  const { approveProject, hashMcpFile } = await import("./project-trust-IFM7FXEV.js");
1653
1653
  const cwd = process.cwd();
1654
1654
  const projectRoot = getGitRoot2(cwd) ?? cwd;
@@ -2709,7 +2709,7 @@ ${hint}` : "")
2709
2709
  usage: "/test [command|filter]",
2710
2710
  async execute(args, ctx) {
2711
2711
  try {
2712
- const { executeTests } = await import("./run-tests-QOZZHW4L.js");
2712
+ const { executeTests } = await import("./run-tests-G22G7UMT.js");
2713
2713
  const argStr = args.join(" ").trim();
2714
2714
  let testArgs = {};
2715
2715
  if (argStr) {
@@ -7002,7 +7002,7 @@ program.command("web").description("Start Web UI server with browser-based chat
7002
7002
  console.error("Error: Invalid port number. Must be between 1 and 65535.");
7003
7003
  process.exit(1);
7004
7004
  }
7005
- const { startWebServer } = await import("./server-IX6L4W2L.js");
7005
+ const { startWebServer } = await import("./server-LK4KEPL3.js");
7006
7006
  await startWebServer({ port, host: options.host });
7007
7007
  });
7008
7008
  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) => {
@@ -7138,7 +7138,7 @@ program.command("sessions").description("List recent conversation sessions").act
7138
7138
  });
7139
7139
  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) => {
7140
7140
  try {
7141
- const batch = await import("./batch-GRHEH3JF.js");
7141
+ const batch = await import("./batch-AZ55FS2U.js");
7142
7142
  switch (action) {
7143
7143
  case "submit":
7144
7144
  if (!arg) {
@@ -7181,7 +7181,7 @@ program.command("batch <action> [arg] [arg2]").description("Anthropic Message Ba
7181
7181
  }
7182
7182
  });
7183
7183
  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) => {
7184
- const { startMcpServer } = await import("./server-HI6GVBD3.js");
7184
+ const { startMcpServer } = await import("./server-QTBPRYAS.js");
7185
7185
  await startMcpServer({
7186
7186
  allowDestructive: !!options.allowDestructive,
7187
7187
  allowOutsideCwd: !!options.allowOutsideCwd,
@@ -7308,7 +7308,7 @@ program.command("hub [topic]").description("Start multi-agent hub (discuss / bra
7308
7308
  }),
7309
7309
  config.get("customProviders")
7310
7310
  );
7311
- const { startHub } = await import("./hub-YNP5HCTT.js");
7311
+ const { startHub } = await import("./hub-LABTSDKX.js");
7312
7312
  await startHub(
7313
7313
  {
7314
7314
  topic: topic ?? "",
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  executeTests,
3
3
  runTestsTool
4
- } from "./chunk-BXDHW7JO.js";
4
+ } from "./chunk-3YUH5CCS.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-VJE5V4H2.js";
6
- import "./chunk-H3F2E4MD.js";
5
+ } from "./chunk-W622HYR2.js";
6
+ import "./chunk-LO4MSGGO.js";
7
7
  import "./chunk-PDX44BCA.js";
8
8
  export {
9
9
  executeTests,
@@ -26,10 +26,10 @@ import {
26
26
  setupProxy,
27
27
  stripPseudoToolCalls,
28
28
  stripToolCallReminder
29
- } from "./chunk-QMT4T4PH.js";
29
+ } from "./chunk-5D4ZMOGZ.js";
30
30
  import {
31
31
  ConfigManager
32
- } from "./chunk-KRTQDZMY.js";
32
+ } from "./chunk-267DHNV2.js";
33
33
  import {
34
34
  ToolExecutor,
35
35
  ToolRegistry,
@@ -47,10 +47,10 @@ import {
47
47
  spawnAgentContext,
48
48
  truncateOutput,
49
49
  undoStack
50
- } from "./chunk-YTP26DOV.js";
50
+ } from "./chunk-AACUEN4B.js";
51
51
  import "./chunk-3BICTI5M.js";
52
52
  import "./chunk-2DXY7UGF.js";
53
- import "./chunk-VJE5V4H2.js";
53
+ import "./chunk-W622HYR2.js";
54
54
  import "./chunk-2ZD3YTVM.js";
55
55
  import {
56
56
  AGENTIC_BEHAVIOR_GUIDELINE,
@@ -70,7 +70,7 @@ import {
70
70
  SKILLS_DIR_NAME,
71
71
  VERSION,
72
72
  buildUserIdentityPrompt
73
- } from "./chunk-H3F2E4MD.js";
73
+ } from "./chunk-LO4MSGGO.js";
74
74
  import {
75
75
  formatGitContextForPrompt,
76
76
  getGitContext,
@@ -2443,7 +2443,7 @@ ${undoResults.map((r) => ` \u2022 ${r}`).join("\n")}` });
2443
2443
  case "test": {
2444
2444
  this.send({ type: "info", message: "\u{1F9EA} Running tests..." });
2445
2445
  try {
2446
- const { executeTests } = await import("./run-tests-QOZZHW4L.js");
2446
+ const { executeTests } = await import("./run-tests-G22G7UMT.js");
2447
2447
  const argStr = args.join(" ").trim();
2448
2448
  let testArgs = {};
2449
2449
  if (argStr) {
@@ -3,14 +3,14 @@ import {
3
3
  ToolRegistry,
4
4
  getDangerLevel,
5
5
  schemaToJsonSchema
6
- } from "./chunk-YTP26DOV.js";
6
+ } from "./chunk-AACUEN4B.js";
7
7
  import "./chunk-3BICTI5M.js";
8
8
  import "./chunk-2DXY7UGF.js";
9
- import "./chunk-VJE5V4H2.js";
9
+ import "./chunk-W622HYR2.js";
10
10
  import "./chunk-2ZD3YTVM.js";
11
11
  import {
12
12
  VERSION
13
- } from "./chunk-H3F2E4MD.js";
13
+ } from "./chunk-LO4MSGGO.js";
14
14
  import "./chunk-4BKXL7SM.js";
15
15
  import "./chunk-7ZJN4KLV.js";
16
16
  import "./chunk-KHYD3WXE.js";
@@ -4,14 +4,14 @@ import {
4
4
  getDangerLevel,
5
5
  googleSearchContext,
6
6
  truncateOutput
7
- } from "./chunk-YTP26DOV.js";
7
+ } from "./chunk-AACUEN4B.js";
8
8
  import "./chunk-3BICTI5M.js";
9
9
  import "./chunk-2DXY7UGF.js";
10
- import "./chunk-VJE5V4H2.js";
10
+ import "./chunk-W622HYR2.js";
11
11
  import "./chunk-2ZD3YTVM.js";
12
12
  import {
13
13
  SUBAGENT_ALLOWED_TOOLS
14
- } from "./chunk-H3F2E4MD.js";
14
+ } from "./chunk-LO4MSGGO.js";
15
15
  import "./chunk-4BKXL7SM.js";
16
16
  import "./chunk-7ZJN4KLV.js";
17
17
  import "./chunk-KHYD3WXE.js";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "jinzd-ai-cli",
3
- "version": "0.4.116",
3
+ "version": "0.4.117",
4
4
  "description": "Cross-platform REPL-style AI CLI with multi-provider support",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",