jinzd-ai-cli 0.4.4 → 0.4.6

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.
@@ -2,7 +2,7 @@
2
2
  import {
3
3
  EnvLoader,
4
4
  schemaToJsonSchema
5
- } from "./chunk-FUPDFYHI.js";
5
+ } from "./chunk-ZYBG5J2G.js";
6
6
  import {
7
7
  APP_NAME,
8
8
  CONFIG_DIR_NAME,
@@ -15,7 +15,7 @@ import {
15
15
  MCP_TOOL_PREFIX,
16
16
  PLUGINS_DIR_NAME,
17
17
  VERSION
18
- } from "./chunk-QAYMV7WE.js";
18
+ } from "./chunk-O7LPT4AB.js";
19
19
 
20
20
  // src/config/config-manager.ts
21
21
  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.4";
9
+ var VERSION = "0.4.6";
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.4";
11
+ var VERSION = "0.4.6";
12
12
  var APP_NAME = "ai-cli";
13
13
  var CONFIG_DIR_NAME = ".aicli";
14
14
  var CONFIG_FILE_NAME = "config.json";
@@ -6,7 +6,7 @@ import {
6
6
  SUBAGENT_DEFAULT_MAX_ROUNDS,
7
7
  SUBAGENT_MAX_ROUNDS_LIMIT,
8
8
  runTestsTool
9
- } from "./chunk-QAYMV7WE.js";
9
+ } from "./chunk-O7LPT4AB.js";
10
10
 
11
11
  // src/tools/builtin/bash.ts
12
12
  import { execSync } from "child_process";
@@ -381,7 +381,7 @@ ${content}`);
381
381
  }
382
382
  }
383
383
  async function runTaskMode(config, providers, configManager, topic) {
384
- const { TaskOrchestrator } = await import("./task-orchestrator-XUMAUKLC.js");
384
+ const { TaskOrchestrator } = await import("./task-orchestrator-GTJM7A5U.js");
385
385
  const orchestrator = new TaskOrchestrator(config, providers, configManager);
386
386
  let interrupted = false;
387
387
  const onSigint = () => {
package/dist/index.js CHANGED
@@ -23,7 +23,7 @@ import {
23
23
  saveDevState,
24
24
  sessionHasMeaningfulContent,
25
25
  setupProxy
26
- } from "./chunk-DGH7SQCZ.js";
26
+ } from "./chunk-5YPF2PO4.js";
27
27
  import {
28
28
  ToolRegistry,
29
29
  askUserContext,
@@ -38,7 +38,7 @@ import {
38
38
  theme,
39
39
  truncateOutput,
40
40
  undoStack
41
- } from "./chunk-FUPDFYHI.js";
41
+ } from "./chunk-ZYBG5J2G.js";
42
42
  import {
43
43
  AGENTIC_BEHAVIOR_GUIDELINE,
44
44
  AUTHOR,
@@ -58,7 +58,7 @@ import {
58
58
  REPO_URL,
59
59
  SKILLS_DIR_NAME,
60
60
  VERSION
61
- } from "./chunk-QAYMV7WE.js";
61
+ } from "./chunk-O7LPT4AB.js";
62
62
 
63
63
  // src/index.ts
64
64
  import { program } from "commander";
@@ -1914,7 +1914,7 @@ ${hint}` : "")
1914
1914
  description: "Run project tests and show structured report",
1915
1915
  usage: "/test [command|filter]",
1916
1916
  async execute(args, _ctx) {
1917
- const { executeTests } = await import("./run-tests-KPWEEJKA.js");
1917
+ const { executeTests } = await import("./run-tests-S2UMAJWI.js");
1918
1918
  const argStr = args.join(" ").trim();
1919
1919
  let testArgs = {};
1920
1920
  if (argStr) {
@@ -5524,7 +5524,7 @@ program.command("web").description("Start Web UI server with browser-based chat
5524
5524
  console.error("Error: Invalid port number. Must be between 1 and 65535.");
5525
5525
  process.exit(1);
5526
5526
  }
5527
- const { startWebServer } = await import("./server-USQZD3PU.js");
5527
+ const { startWebServer } = await import("./server-EEOYG2EH.js");
5528
5528
  await startWebServer({ port, host: options.host });
5529
5529
  });
5530
5530
  program.command("user [action] [username]").description("Manage Web UI users (list | create <name> | delete <name> | reset-password <name> | migrate <name>)").action(async (action, username) => {
@@ -5757,7 +5757,7 @@ program.command("hub [topic]").description("Start multi-agent hub (discuss / bra
5757
5757
  }),
5758
5758
  config.get("customProviders")
5759
5759
  );
5760
- const { startHub } = await import("./hub-ZP7OZJMH.js");
5760
+ const { startHub } = await import("./hub-FWC6KHT4.js");
5761
5761
  await startHub(
5762
5762
  {
5763
5763
  topic: topic ?? "",
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  executeTests,
3
3
  runTestsTool
4
- } from "./chunk-GGIRUPT6.js";
4
+ } from "./chunk-N5NLOKMR.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-QAYMV7WE.js";
5
+ } from "./chunk-O7LPT4AB.js";
6
6
  export {
7
7
  executeTests,
8
8
  runTestsTool
@@ -18,7 +18,7 @@ import {
18
18
  renderDiff,
19
19
  runHook,
20
20
  setupProxy
21
- } from "./chunk-DGH7SQCZ.js";
21
+ } from "./chunk-5YPF2PO4.js";
22
22
  import {
23
23
  AuthManager
24
24
  } from "./chunk-CPLT6CD3.js";
@@ -32,7 +32,7 @@ import {
32
32
  spawnAgentContext,
33
33
  truncateOutput,
34
34
  undoStack
35
- } from "./chunk-FUPDFYHI.js";
35
+ } from "./chunk-ZYBG5J2G.js";
36
36
  import {
37
37
  AGENTIC_BEHAVIOR_GUIDELINE,
38
38
  CONTEXT_FILE_CANDIDATES,
@@ -44,7 +44,7 @@ import {
44
44
  PLAN_MODE_SYSTEM_ADDON,
45
45
  SKILLS_DIR_NAME,
46
46
  VERSION
47
- } from "./chunk-QAYMV7WE.js";
47
+ } from "./chunk-O7LPT4AB.js";
48
48
 
49
49
  // src/web/server.ts
50
50
  import express from "express";
@@ -1440,7 +1440,7 @@ ${undoResults.map((r) => ` \u2022 ${r}`).join("\n")}` });
1440
1440
  case "test": {
1441
1441
  this.send({ type: "info", message: "\u{1F9EA} Running tests..." });
1442
1442
  try {
1443
- const { executeTests } = await import("./run-tests-KPWEEJKA.js");
1443
+ const { executeTests } = await import("./run-tests-S2UMAJWI.js");
1444
1444
  const argStr = args.join(" ").trim();
1445
1445
  let testArgs = {};
1446
1446
  if (argStr) {
@@ -4,10 +4,10 @@ import {
4
4
  getDangerLevel,
5
5
  googleSearchContext,
6
6
  truncateOutput
7
- } from "./chunk-FUPDFYHI.js";
7
+ } from "./chunk-ZYBG5J2G.js";
8
8
  import {
9
9
  SUBAGENT_ALLOWED_TOOLS
10
- } from "./chunk-QAYMV7WE.js";
10
+ } from "./chunk-O7LPT4AB.js";
11
11
 
12
12
  // src/hub/task-orchestrator.ts
13
13
  import { createInterface } from "readline";
@@ -29,9 +29,10 @@ async function executeTask(options) {
29
29
  onToolResult,
30
30
  onRound
31
31
  } = options;
32
+ const TASK_EXCLUDED_TOOLS = /* @__PURE__ */ new Set(["write_todos", "save_memory", "ask_user", "spawn_agent"]);
32
33
  const registry = new ToolRegistry();
33
34
  for (const tool of registry.listAll()) {
34
- if (!SUBAGENT_ALLOWED_TOOLS.has(tool.definition.name)) {
35
+ if (!SUBAGENT_ALLOWED_TOOLS.has(tool.definition.name) || TASK_EXCLUDED_TOOLS.has(tool.definition.name)) {
35
36
  registry.unregister(tool.definition.name);
36
37
  }
37
38
  }
@@ -50,11 +51,17 @@ ${task}
50
51
  ## Rules
51
52
  1. Focus exclusively on completing the task described above.
52
53
  2. Use tools to read, create, and modify files as needed.
53
- 3. When done, provide a clear summary: what was done, which files were created/modified, and the result.
54
- 4. Be efficient \u2014 minimize unnecessary tool calls.
55
- 5. Destructive operations (rm -rf, etc.) will be automatically blocked.
56
- 6. You cannot interact with users \u2014 work independently based on the task description.
57
- 7. Use the same language as the task description.${contextSection}`;
54
+ 3. Be efficient \u2014 minimize unnecessary tool calls. Do NOT use write_todos.
55
+ 4. Destructive operations (rm -rf, etc.) will be automatically blocked.
56
+ 5. You cannot interact with users \u2014 work independently based on the task description.
57
+ 6. Use the same language as the task description.
58
+
59
+ ## CRITICAL \u2014 When to Stop
60
+ Once you have completed the task (files created/modified, code written, tests passing), you MUST immediately respond with a plain text summary. Do NOT call any more tools after the work is done. Your text summary should include:
61
+ - What was accomplished
62
+ - Files created or modified
63
+ - Current state / any issues
64
+ If you keep calling tools after the task is done, you are wasting rounds. STOP and write your summary.${contextSection}`;
58
65
  const messages = [
59
66
  { role: "user", content: `Please execute the following task:
60
67
 
@@ -75,9 +82,12 @@ ${task}`, timestamp: /* @__PURE__ */ new Date() }
75
82
  googleSearchContext.configManager = configManager;
76
83
  }
77
84
  let activeSystemPrompt = systemPrompt;
78
- if (round === maxRounds - 2) {
79
- activeSystemPrompt += "\n\n\u26A0\uFE0F You have 2 rounds remaining. Start wrapping up \u2014 finish current work and prepare your summary.";
80
- } else if (round === maxRounds - 1) {
85
+ const remaining = maxRounds - round;
86
+ if (remaining <= 3 && remaining > 1) {
87
+ activeSystemPrompt += `
88
+
89
+ \u26A0\uFE0F You have ${remaining} rounds remaining. Finish your current work NOW and respond with a text summary on the next turn. Do NOT start new sub-tasks.`;
90
+ } else if (remaining === 1) {
81
91
  activeSystemPrompt += "\n\n\u{1F6D1} LAST ROUND. Do NOT call any more tools. You MUST respond with a text summary of what you accomplished. List files created/modified and the current state.";
82
92
  }
83
93
  const result = await provider.chatWithTools(
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "jinzd-ai-cli",
3
- "version": "0.4.4",
3
+ "version": "0.4.6",
4
4
  "description": "Cross-platform REPL-style AI CLI with multi-provider support",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",