jinzd-ai-cli 0.4.96 → 0.4.98

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-JFDAONPK.js";
4
+ } from "./chunk-YNY6O5TT.js";
5
5
  import "./chunk-2ZD3YTVM.js";
6
- import "./chunk-6YHSSX6F.js";
6
+ import "./chunk-GKWKONOS.js";
7
7
 
8
8
  // src/cli/batch.ts
9
9
  import Anthropic from "@anthropic-ai/sdk";
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
 
3
3
  // src/core/constants.ts
4
- var VERSION = "0.4.96";
4
+ var VERSION = "0.4.98";
5
5
  var APP_NAME = "ai-cli";
6
6
  var CONFIG_DIR_NAME = ".aicli";
7
7
  var CONFIG_FILE_NAME = "config.json";
@@ -93,6 +93,8 @@ var AGENTIC_BEHAVIOR_GUIDELINE = `# Important Behavioral Guidelines
93
93
  - For **greetings and casual chat** (e.g., "hello", "hi", "hey", "\u4F60\u597D", "what's up"): respond naturally with a friendly greeting. Do NOT use any tools. Do NOT explore directories, read files, or start any project work. Just chat.
94
94
  - When the user asks you to "read", "understand", "review", "analyze", "examine", or "look at" files or a project, your task is only to **read and summarize**, then wait for the user's next instruction. Do not automatically start executing tasks described in the project.
95
95
  - Only begin using write/execute tools when the user **explicitly requests** an action (e.g., "generate", "create", "modify", "run", "start", etc.).
96
+ - **Stop when the explicit task is done \u2014 do NOT autonomously test, verify, or run what you just created.** If the user asks "write/create/save file X", finish writing the file and STOP. Do not run it, do not test it, do not "verify it works" with bash/run_interactive. The user will run it themselves and tell you if anything is wrong. Only run/test when the user explicitly says "run", "test", "execute", "try it", "verify", "make sure it works", etc.
97
+ - **Do NOT retry the same failing command with variants.** If a command fails (exit code non-zero), report the failure to the user with a brief diagnosis and STOP. Do not loop through alternate shells, alternate quoting, alternate paths, or alternate Python invocations. The user can decide whether to retry.
96
98
  - Project context files (CLAUDE.md, AICLI.md) provide background information about the project. They are NOT instructions to start working. Only use them as reference when the user asks a project-related question or task.
97
99
  - If you are unsure about the user's intent, use the ask_user tool to confirm with the user, rather than assuming and executing on your own.
98
100
  - **Do NOT abuse ask_user for redundant confirmations**: When the user has already given a clear, explicit instruction (e.g., "write lesson 142", "generate file X", "create the report"), execute it immediately. Do NOT ask "are you sure?" or request details that can be found in project documents. Repeatedly asking the user to confirm wastes their time and is extremely frustrating. Only use ask_user when critical information is genuinely missing and cannot be inferred from context files.`;
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  TEST_TIMEOUT
4
- } from "./chunk-6YHSSX6F.js";
4
+ } from "./chunk-GKWKONOS.js";
5
5
 
6
6
  // src/tools/builtin/run-tests.ts
7
7
  import { execSync } from "child_process";
@@ -23,7 +23,7 @@ import {
23
23
  } from "./chunk-6VRJGH25.js";
24
24
  import {
25
25
  runTestsTool
26
- } from "./chunk-USRJN2CF.js";
26
+ } from "./chunk-N2RRP2DZ.js";
27
27
  import {
28
28
  CONFIG_DIR_NAME,
29
29
  DEFAULT_MAX_TOOL_OUTPUT_CHARS_CAP,
@@ -31,7 +31,7 @@ import {
31
31
  SUBAGENT_ALLOWED_TOOLS,
32
32
  SUBAGENT_DEFAULT_MAX_ROUNDS,
33
33
  SUBAGENT_MAX_ROUNDS_LIMIT
34
- } from "./chunk-6YHSSX6F.js";
34
+ } from "./chunk-GKWKONOS.js";
35
35
 
36
36
  // src/tools/types.ts
37
37
  function isFileWriteTool(name) {
@@ -2,7 +2,7 @@
2
2
  import {
3
3
  schemaToJsonSchema,
4
4
  truncateForPersist
5
- } from "./chunk-2YXIZ3GN.js";
5
+ } from "./chunk-NAGABYKG.js";
6
6
  import {
7
7
  AuthError,
8
8
  ProviderError,
@@ -21,7 +21,7 @@ import {
21
21
  MCP_PROTOCOL_VERSION,
22
22
  MCP_TOOL_PREFIX,
23
23
  VERSION
24
- } from "./chunk-6YHSSX6F.js";
24
+ } from "./chunk-GKWKONOS.js";
25
25
 
26
26
  // src/providers/claude.ts
27
27
  import Anthropic from "@anthropic-ai/sdk";
@@ -835,8 +835,8 @@ var OpenAICompatibleProvider = class extends BaseProvider {
835
835
  const filtered = request.messages.filter((m) => m.role !== "tool" && !m.toolCalls);
836
836
  const msgs = filtered.map((m) => {
837
837
  const base = { role: m.role, content: m.content };
838
- if (m.role === "assistant" && m.reasoningContent) {
839
- base.reasoning_content = m.reasoningContent;
838
+ if (m.role === "assistant") {
839
+ base.reasoning_content = m.reasoningContent ?? "";
840
840
  }
841
841
  return base;
842
842
  });
@@ -1188,9 +1188,7 @@ var OpenAICompatibleProvider = class extends BaseProvider {
1188
1188
  }
1189
1189
  }))
1190
1190
  };
1191
- if (reasoningContent !== void 0) {
1192
- assistantMsg.reasoning_content = reasoningContent;
1193
- }
1191
+ assistantMsg.reasoning_content = reasoningContent ?? "";
1194
1192
  const resultMsgs = results.map((r) => ({
1195
1193
  role: "tool",
1196
1194
  tool_call_id: r.callId,
@@ -1310,7 +1308,8 @@ var DeepSeekProvider = class extends OpenAICompatibleProvider {
1310
1308
  ...request,
1311
1309
  _extraMessages: [
1312
1310
  ...request._extraMessages ?? [],
1313
- { role: "assistant", content: result.content },
1311
+ // DeepSeek V4 thinking 模式:assistant 消息必须含 reasoning_content(即使为空)
1312
+ { role: "assistant", content: result.content, reasoning_content: "" },
1314
1313
  { role: "user", content: DEEPSEEK_CODE_BLOCK_CORRECTION }
1315
1314
  ]
1316
1315
  };
@@ -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.96";
9
+ var VERSION = "0.4.98";
10
10
  var APP_NAME = "ai-cli";
11
11
  var CONFIG_DIR_NAME = ".aicli";
12
12
  var CONFIG_FILE_NAME = "config.json";
@@ -97,6 +97,8 @@ var AGENTIC_BEHAVIOR_GUIDELINE = `# Important Behavioral Guidelines
97
97
  - For **greetings and casual chat** (e.g., "hello", "hi", "hey", "\u4F60\u597D", "what's up"): respond naturally with a friendly greeting. Do NOT use any tools. Do NOT explore directories, read files, or start any project work. Just chat.
98
98
  - When the user asks you to "read", "understand", "review", "analyze", "examine", or "look at" files or a project, your task is only to **read and summarize**, then wait for the user's next instruction. Do not automatically start executing tasks described in the project.
99
99
  - Only begin using write/execute tools when the user **explicitly requests** an action (e.g., "generate", "create", "modify", "run", "start", etc.).
100
+ - **Stop when the explicit task is done \u2014 do NOT autonomously test, verify, or run what you just created.** If the user asks "write/create/save file X", finish writing the file and STOP. Do not run it, do not test it, do not "verify it works" with bash/run_interactive. The user will run it themselves and tell you if anything is wrong. Only run/test when the user explicitly says "run", "test", "execute", "try it", "verify", "make sure it works", etc.
101
+ - **Do NOT retry the same failing command with variants.** If a command fails (exit code non-zero), report the failure to the user with a brief diagnosis and STOP. Do not loop through alternate shells, alternate quoting, alternate paths, or alternate Python invocations. The user can decide whether to retry.
100
102
  - Project context files (CLAUDE.md, AICLI.md) provide background information about the project. They are NOT instructions to start working. Only use them as reference when the user asks a project-related question or task.
101
103
  - If you are unsure about the user's intent, use the ask_user tool to confirm with the user, rather than assuming and executing on your own.
102
104
  - **Do NOT abuse ask_user for redundant confirmations**: When the user has already given a clear, explicit instruction (e.g., "write lesson 142", "generate file X", "create the report"), execute it immediately. Do NOT ask "are you sure?" or request details that can be found in project documents. Repeatedly asking the user to confirm wastes their time and is extremely frustrating. Only use ask_user when critical information is genuinely missing and cannot be inferred from context files.`;
@@ -8,7 +8,7 @@ import {
8
8
  CONFIG_FILE_NAME,
9
9
  HISTORY_DIR_NAME,
10
10
  PLUGINS_DIR_NAME
11
- } from "./chunk-6YHSSX6F.js";
11
+ } from "./chunk-GKWKONOS.js";
12
12
 
13
13
  // src/config/config-manager.ts
14
14
  import { readFileSync, writeFileSync, existsSync, mkdirSync } from "fs";
@@ -36,7 +36,7 @@ import {
36
36
  VERSION,
37
37
  buildUserIdentityPrompt,
38
38
  runTestsTool
39
- } from "./chunk-7UE6TPAD.js";
39
+ } from "./chunk-QVHCN6RY.js";
40
40
  import {
41
41
  hasSemanticIndex,
42
42
  semanticSearch
@@ -1346,8 +1346,8 @@ var OpenAICompatibleProvider = class extends BaseProvider {
1346
1346
  const filtered = request.messages.filter((m) => m.role !== "tool" && !m.toolCalls);
1347
1347
  const msgs = filtered.map((m) => {
1348
1348
  const base = { role: m.role, content: m.content };
1349
- if (m.role === "assistant" && m.reasoningContent) {
1350
- base.reasoning_content = m.reasoningContent;
1349
+ if (m.role === "assistant") {
1350
+ base.reasoning_content = m.reasoningContent ?? "";
1351
1351
  }
1352
1352
  return base;
1353
1353
  });
@@ -1699,9 +1699,7 @@ var OpenAICompatibleProvider = class extends BaseProvider {
1699
1699
  }
1700
1700
  }))
1701
1701
  };
1702
- if (reasoningContent !== void 0) {
1703
- assistantMsg.reasoning_content = reasoningContent;
1704
- }
1702
+ assistantMsg.reasoning_content = reasoningContent ?? "";
1705
1703
  const resultMsgs = results.map((r) => ({
1706
1704
  role: "tool",
1707
1705
  tool_call_id: r.callId,
@@ -1821,7 +1819,8 @@ var DeepSeekProvider = class extends OpenAICompatibleProvider {
1821
1819
  ...request,
1822
1820
  _extraMessages: [
1823
1821
  ...request._extraMessages ?? [],
1824
- { role: "assistant", content: result.content },
1822
+ // DeepSeek V4 thinking 模式:assistant 消息必须含 reasoning_content(即使为空)
1823
+ { role: "assistant", content: result.content, reasoning_content: "" },
1825
1824
  { role: "user", content: DEEPSEEK_CODE_BLOCK_CORRECTION }
1826
1825
  ]
1827
1826
  };
@@ -11401,7 +11400,7 @@ ${undoResults.map((r) => ` \u2022 ${r}`).join("\n")}` });
11401
11400
  case "test": {
11402
11401
  this.send({ type: "info", message: "\u{1F9EA} Running tests..." });
11403
11402
  try {
11404
- const { executeTests } = await import("./run-tests-425P7SXN.js");
11403
+ const { executeTests } = await import("./run-tests-2PUCYHUK.js");
11405
11404
  const argStr = args.join(" ").trim();
11406
11405
  let testArgs = {};
11407
11406
  if (argStr) {
@@ -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-4FISZ6FY.js");
388
+ const { TaskOrchestrator } = await import("./task-orchestrator-ZCQVBAC6.js");
389
389
  const orchestrator = new TaskOrchestrator(config, providers, configManager);
390
390
  let interrupted = false;
391
391
  const onSigint = () => {
package/dist/index.js CHANGED
@@ -30,10 +30,10 @@ import {
30
30
  saveDevState,
31
31
  sessionHasMeaningfulContent,
32
32
  setupProxy
33
- } from "./chunk-SX7GCTSV.js";
33
+ } from "./chunk-QHKFBTJG.js";
34
34
  import {
35
35
  ConfigManager
36
- } from "./chunk-JFDAONPK.js";
36
+ } from "./chunk-YNY6O5TT.js";
37
37
  import {
38
38
  ToolExecutor,
39
39
  ToolRegistry,
@@ -52,7 +52,7 @@ import {
52
52
  spawnAgentContext,
53
53
  theme,
54
54
  undoStack
55
- } from "./chunk-2YXIZ3GN.js";
55
+ } from "./chunk-NAGABYKG.js";
56
56
  import "./chunk-2ZD3YTVM.js";
57
57
  import {
58
58
  fileCheckpoints
@@ -70,7 +70,7 @@ import "./chunk-KJLJPUY2.js";
70
70
  import "./chunk-6VRJGH25.js";
71
71
  import "./chunk-2DXY7UGF.js";
72
72
  import "./chunk-KHYD3WXE.js";
73
- import "./chunk-USRJN2CF.js";
73
+ import "./chunk-N2RRP2DZ.js";
74
74
  import {
75
75
  AGENTIC_BEHAVIOR_GUIDELINE,
76
76
  AUTHOR,
@@ -92,7 +92,7 @@ import {
92
92
  SKILLS_DIR_NAME,
93
93
  VERSION,
94
94
  buildUserIdentityPrompt
95
- } from "./chunk-6YHSSX6F.js";
95
+ } from "./chunk-GKWKONOS.js";
96
96
 
97
97
  // src/index.ts
98
98
  import { program } from "commander";
@@ -2612,7 +2612,7 @@ ${hint}` : "")
2612
2612
  usage: "/test [command|filter]",
2613
2613
  async execute(args, ctx) {
2614
2614
  try {
2615
- const { executeTests } = await import("./run-tests-P7DC5HZH.js");
2615
+ const { executeTests } = await import("./run-tests-ZJOWFMIN.js");
2616
2616
  const argStr = args.join(" ").trim();
2617
2617
  let testArgs = {};
2618
2618
  if (argStr) {
@@ -6752,7 +6752,7 @@ program.command("web").description("Start Web UI server with browser-based chat
6752
6752
  console.error("Error: Invalid port number. Must be between 1 and 65535.");
6753
6753
  process.exit(1);
6754
6754
  }
6755
- const { startWebServer } = await import("./server-YGSZM3DP.js");
6755
+ const { startWebServer } = await import("./server-7QMYVDIB.js");
6756
6756
  await startWebServer({ port, host: options.host });
6757
6757
  });
6758
6758
  program.command("user [action] [username]").description("Manage Web UI users (list | create <name> | delete <name> | reset-password <name> | migrate <name>)").action(async (action, username) => {
@@ -6875,7 +6875,7 @@ program.command("sessions").description("List recent conversation sessions").act
6875
6875
  });
6876
6876
  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) => {
6877
6877
  try {
6878
- const batch = await import("./batch-AP2VD7P4.js");
6878
+ const batch = await import("./batch-NWPTBWX5.js");
6879
6879
  switch (action) {
6880
6880
  case "submit":
6881
6881
  if (!arg) {
@@ -6918,7 +6918,7 @@ program.command("batch <action> [arg] [arg2]").description("Anthropic Message Ba
6918
6918
  }
6919
6919
  });
6920
6920
  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) => {
6921
- const { startMcpServer } = await import("./server-47MHFFXI.js");
6921
+ const { startMcpServer } = await import("./server-WGQAZFS7.js");
6922
6922
  await startMcpServer({
6923
6923
  allowDestructive: !!options.allowDestructive,
6924
6924
  allowOutsideCwd: !!options.allowOutsideCwd,
@@ -7045,7 +7045,7 @@ program.command("hub [topic]").description("Start multi-agent hub (discuss / bra
7045
7045
  }),
7046
7046
  config.get("customProviders")
7047
7047
  );
7048
- const { startHub } = await import("./hub-RALO5NAA.js");
7048
+ const { startHub } = await import("./hub-I5BYSUPC.js");
7049
7049
  await startHub(
7050
7050
  {
7051
7051
  topic: topic ?? "",
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  executeTests,
3
3
  runTestsTool
4
- } from "./chunk-7UE6TPAD.js";
4
+ } from "./chunk-QVHCN6RY.js";
5
5
  export {
6
6
  executeTests,
7
7
  runTestsTool
@@ -2,8 +2,8 @@
2
2
  import {
3
3
  executeTests,
4
4
  runTestsTool
5
- } from "./chunk-USRJN2CF.js";
6
- import "./chunk-6YHSSX6F.js";
5
+ } from "./chunk-N2RRP2DZ.js";
6
+ import "./chunk-GKWKONOS.js";
7
7
  export {
8
8
  executeTests,
9
9
  runTestsTool
@@ -23,10 +23,10 @@ import {
23
23
  persistToolRound,
24
24
  rebuildExtraMessages,
25
25
  setupProxy
26
- } from "./chunk-SX7GCTSV.js";
26
+ } from "./chunk-QHKFBTJG.js";
27
27
  import {
28
28
  ConfigManager
29
- } from "./chunk-JFDAONPK.js";
29
+ } from "./chunk-YNY6O5TT.js";
30
30
  import {
31
31
  ToolExecutor,
32
32
  ToolRegistry,
@@ -44,7 +44,7 @@ import {
44
44
  spawnAgentContext,
45
45
  truncateOutput,
46
46
  undoStack
47
- } from "./chunk-2YXIZ3GN.js";
47
+ } from "./chunk-NAGABYKG.js";
48
48
  import "./chunk-2ZD3YTVM.js";
49
49
  import "./chunk-4BKXL7SM.js";
50
50
  import "./chunk-ANYYM4CF.js";
@@ -53,7 +53,7 @@ import "./chunk-KJLJPUY2.js";
53
53
  import "./chunk-6VRJGH25.js";
54
54
  import "./chunk-2DXY7UGF.js";
55
55
  import "./chunk-KHYD3WXE.js";
56
- import "./chunk-USRJN2CF.js";
56
+ import "./chunk-N2RRP2DZ.js";
57
57
  import {
58
58
  AGENTIC_BEHAVIOR_GUIDELINE,
59
59
  AUTHOR,
@@ -72,7 +72,7 @@ import {
72
72
  SKILLS_DIR_NAME,
73
73
  VERSION,
74
74
  buildUserIdentityPrompt
75
- } from "./chunk-6YHSSX6F.js";
75
+ } from "./chunk-GKWKONOS.js";
76
76
 
77
77
  // src/web/server.ts
78
78
  import express from "express";
@@ -2251,7 +2251,7 @@ ${undoResults.map((r) => ` \u2022 ${r}`).join("\n")}` });
2251
2251
  case "test": {
2252
2252
  this.send({ type: "info", message: "\u{1F9EA} Running tests..." });
2253
2253
  try {
2254
- const { executeTests } = await import("./run-tests-P7DC5HZH.js");
2254
+ const { executeTests } = await import("./run-tests-ZJOWFMIN.js");
2255
2255
  const argStr = args.join(" ").trim();
2256
2256
  let testArgs = {};
2257
2257
  if (argStr) {
@@ -3,7 +3,7 @@ import {
3
3
  ToolRegistry,
4
4
  getDangerLevel,
5
5
  schemaToJsonSchema
6
- } from "./chunk-2YXIZ3GN.js";
6
+ } from "./chunk-NAGABYKG.js";
7
7
  import "./chunk-2ZD3YTVM.js";
8
8
  import "./chunk-4BKXL7SM.js";
9
9
  import "./chunk-ANYYM4CF.js";
@@ -12,10 +12,10 @@ import "./chunk-KJLJPUY2.js";
12
12
  import "./chunk-6VRJGH25.js";
13
13
  import "./chunk-2DXY7UGF.js";
14
14
  import "./chunk-KHYD3WXE.js";
15
- import "./chunk-USRJN2CF.js";
15
+ import "./chunk-N2RRP2DZ.js";
16
16
  import {
17
17
  VERSION
18
- } from "./chunk-6YHSSX6F.js";
18
+ } from "./chunk-GKWKONOS.js";
19
19
 
20
20
  // src/mcp/server.ts
21
21
  import { createInterface } from "readline";
@@ -4,7 +4,7 @@ import {
4
4
  getDangerLevel,
5
5
  googleSearchContext,
6
6
  truncateOutput
7
- } from "./chunk-2YXIZ3GN.js";
7
+ } from "./chunk-NAGABYKG.js";
8
8
  import "./chunk-2ZD3YTVM.js";
9
9
  import "./chunk-4BKXL7SM.js";
10
10
  import "./chunk-ANYYM4CF.js";
@@ -13,10 +13,10 @@ import "./chunk-KJLJPUY2.js";
13
13
  import "./chunk-6VRJGH25.js";
14
14
  import "./chunk-2DXY7UGF.js";
15
15
  import "./chunk-KHYD3WXE.js";
16
- import "./chunk-USRJN2CF.js";
16
+ import "./chunk-N2RRP2DZ.js";
17
17
  import {
18
18
  SUBAGENT_ALLOWED_TOOLS
19
- } from "./chunk-6YHSSX6F.js";
19
+ } from "./chunk-GKWKONOS.js";
20
20
 
21
21
  // src/hub/task-orchestrator.ts
22
22
  import { createInterface } from "readline";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "jinzd-ai-cli",
3
- "version": "0.4.96",
3
+ "version": "0.4.98",
4
4
  "description": "Cross-platform REPL-style AI CLI with multi-provider support",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",