jinzd-ai-cli 0.2.13 → 0.2.15

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.
@@ -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.2.13";
11
+ var VERSION = "0.2.15";
12
12
  var APP_NAME = "ai-cli";
13
13
  var CONFIG_DIR_NAME = ".aicli";
14
14
  var CONFIG_FILE_NAME = "config.json";
@@ -16,7 +16,7 @@ import {
16
16
  SUBAGENT_MAX_ROUNDS_LIMIT,
17
17
  VERSION,
18
18
  runTestsTool
19
- } from "./chunk-2VKCVDHP.js";
19
+ } from "./chunk-MD3RCGWS.js";
20
20
 
21
21
  // src/config/config-manager.ts
22
22
  import { readFileSync, writeFileSync, existsSync, mkdirSync } from "fs";
package/dist/index.js CHANGED
@@ -35,7 +35,7 @@ import {
35
35
  theme,
36
36
  truncateOutput,
37
37
  undoStack
38
- } from "./chunk-64ORNJVC.js";
38
+ } from "./chunk-O6CGIXLJ.js";
39
39
  import {
40
40
  AGENTIC_BEHAVIOR_GUIDELINE,
41
41
  AUTHOR,
@@ -55,7 +55,7 @@ import {
55
55
  REPO_URL,
56
56
  SKILLS_DIR_NAME,
57
57
  VERSION
58
- } from "./chunk-2VKCVDHP.js";
58
+ } from "./chunk-MD3RCGWS.js";
59
59
 
60
60
  // src/index.ts
61
61
  import { program } from "commander";
@@ -1904,7 +1904,7 @@ ${hint}` : "")
1904
1904
  description: "Run project tests and show structured report",
1905
1905
  usage: "/test [command|filter]",
1906
1906
  async execute(args, _ctx) {
1907
- const { executeTests } = await import("./run-tests-7L33QJHM.js");
1907
+ const { executeTests } = await import("./run-tests-MEMEB3J5.js");
1908
1908
  const argStr = args.join(" ").trim();
1909
1909
  let testArgs = {};
1910
1910
  if (argStr) {
@@ -4812,11 +4812,22 @@ Session '${this.resumeSessionId}' not found.
4812
4812
  const apiMessages = [...messages];
4813
4813
  const extraMessages = [];
4814
4814
  const baseSystemPrompt = (this.buildCurrentSystemPrompt() ?? "") + TOOL_CALL_REMINDER;
4815
- const roundBudgetHint = `
4815
+ const roundBudgetHint = this.planMode ? `
4816
+
4817
+ [Tool Round Budget \u2014 Plan Mode]
4818
+ You have a maximum of ${MAX_TOOL_ROUNDS} tool call rounds. You are in READ-ONLY Plan Mode:
4819
+ - Only use: read_file, list_dir, grep_files, glob_files, ask_user, write_todos
4820
+ - Do NOT attempt to call bash, write_file, edit_file \u2014 they are disabled
4821
+ - Do NOT write shell commands or code blocks as a substitute for tool calls
4822
+ - Do NOT read the same file more than once
4823
+ - Call write_todos ONCE to present your plan, then give a text summary
4824
+ - If the user asks you to execute anything, respond: "Please type /plan execute to switch to execute mode."
4825
+ - Every ${AUTO_PAUSE_INTERVAL} rounds the user will be asked whether to continue.` : `
4816
4826
 
4817
4827
  [Tool Round Budget]
4818
4828
  You have a maximum of ${MAX_TOOL_ROUNDS} tool call rounds for this task. Plan efficiently:
4819
4829
  - Prefer batch operations (e.g. global find-and-replace) over repetitive single edits.
4830
+ - Do NOT read the same file more than once \u2014 use the content from previous reads.
4820
4831
  - Prioritize the most critical tasks first in case rounds run out.
4821
4832
  - When remaining rounds are low (\u22645), focus on completing the current task and summarizing.
4822
4833
  - Every ${AUTO_PAUSE_INTERVAL} rounds the user will be asked whether to continue \u2014 use this as a natural checkpoint to report progress.`;
@@ -5052,10 +5063,32 @@ You have a maximum of ${MAX_TOOL_ROUNDS} tool call rounds for this task. Plan ef
5052
5063
  process.stdin.removeListener("data", this._interjectionHandler);
5053
5064
  }
5054
5065
  const toolResults = await this.toolExecutor.executeAll(result.toolCalls);
5055
- roundToolHistory.push({
5056
- round: round + 1,
5057
- tools: result.toolCalls.map((tc) => tc.name)
5058
- });
5066
+ const thisRoundTools = result.toolCalls.map((tc) => tc.name);
5067
+ roundToolHistory.push({ round: round + 1, tools: thisRoundTools });
5068
+ const readFileCalls = result.toolCalls.filter((tc) => tc.name === "read_file");
5069
+ for (const rfc of readFileCalls) {
5070
+ const filePath = rfc.arguments?.path;
5071
+ if (filePath) {
5072
+ const key = `read_file:${filePath}`;
5073
+ const prevCount = roundToolHistory.flat().length > 0 ? roundToolHistory.filter((rh) => rh.tools.includes("read_file")).length : 0;
5074
+ const fileReadCount = extraMessages.filter((msg) => {
5075
+ const m = msg;
5076
+ if (m.role !== "assistant") return false;
5077
+ const tcs = m.tool_calls;
5078
+ if (!Array.isArray(tcs)) return false;
5079
+ return tcs.some((tc) => {
5080
+ const fn = tc.function;
5081
+ return fn?.name === "read_file" && JSON.stringify(fn?.arguments ?? "").includes(filePath);
5082
+ });
5083
+ }).length;
5084
+ if (fileReadCount >= 2) {
5085
+ extraMessages.push({
5086
+ role: "user",
5087
+ content: `\u26A0\uFE0F You have read the file "${filePath}" ${fileReadCount + 1} times already. The content hasn't changed \u2014 do NOT read it again. Use the information you already have.`
5088
+ });
5089
+ }
5090
+ }
5091
+ }
5059
5092
  if (this._interjectionHandler) {
5060
5093
  process.stdin.on("data", this._interjectionHandler);
5061
5094
  process.stdin.resume();
@@ -5277,6 +5310,9 @@ Tip: You can continue the conversation by asking the AI to proceed.`
5277
5310
  setProvider: (id, model) => {
5278
5311
  this.currentProvider = id;
5279
5312
  this.currentModel = model ?? this.config.get("defaultModels")[id] ?? this.providers.get(id).info.defaultModel;
5313
+ this.config.set("defaultProvider", id);
5314
+ const defaultModels = { ...this.config.get("defaultModels"), [id]: this.currentModel };
5315
+ this.config.set("defaultModels", defaultModels);
5280
5316
  this.refreshPrompt();
5281
5317
  this.events.emit("provider.switch", {
5282
5318
  providerId: id,
@@ -5474,7 +5510,7 @@ program.command("web").description("Start Web UI server with browser-based chat
5474
5510
  console.error("Error: Invalid port number. Must be between 1 and 65535.");
5475
5511
  process.exit(1);
5476
5512
  }
5477
- const { startWebServer } = await import("./server-SZVS3S42.js");
5513
+ const { startWebServer } = await import("./server-7UMR6ODJ.js");
5478
5514
  await startWebServer({ port, host: options.host });
5479
5515
  });
5480
5516
  program.command("user [action] [username]").description("Manage Web UI users (list | create <name> | delete <name> | reset-password <name> | migrate <name>)").action(async (action, username) => {
@@ -2,7 +2,7 @@
2
2
  import {
3
3
  executeTests,
4
4
  runTestsTool
5
- } from "./chunk-2VKCVDHP.js";
5
+ } from "./chunk-MD3RCGWS.js";
6
6
  export {
7
7
  executeTests,
8
8
  runTestsTool
@@ -23,7 +23,7 @@ import {
23
23
  setupProxy,
24
24
  spawnAgentContext,
25
25
  truncateOutput
26
- } from "./chunk-64ORNJVC.js";
26
+ } from "./chunk-O6CGIXLJ.js";
27
27
  import {
28
28
  AGENTIC_BEHAVIOR_GUIDELINE,
29
29
  CONTEXT_FILE_CANDIDATES,
@@ -35,7 +35,7 @@ import {
35
35
  PLAN_MODE_SYSTEM_ADDON,
36
36
  SKILLS_DIR_NAME,
37
37
  VERSION
38
- } from "./chunk-2VKCVDHP.js";
38
+ } from "./chunk-MD3RCGWS.js";
39
39
  import {
40
40
  AuthManager
41
41
  } from "./chunk-CPLT6CD3.js";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "jinzd-ai-cli",
3
- "version": "0.2.13",
3
+ "version": "0.2.15",
4
4
  "description": "Cross-platform REPL-style AI CLI with multi-provider support",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",