jinzd-ai-cli 0.4.44 → 0.4.46

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.
@@ -9,7 +9,7 @@ import {
9
9
  SUBAGENT_DEFAULT_MAX_ROUNDS,
10
10
  SUBAGENT_MAX_ROUNDS_LIMIT,
11
11
  runTestsTool
12
- } from "./chunk-ENOAIZ4K.js";
12
+ } from "./chunk-R5XH32QG.js";
13
13
 
14
14
  // src/tools/builtin/bash.ts
15
15
  import { execSync } from "child_process";
@@ -7,7 +7,7 @@ import {
7
7
  ProviderNotFoundError,
8
8
  RateLimitError,
9
9
  schemaToJsonSchema
10
- } from "./chunk-Q6SAWWSW.js";
10
+ } from "./chunk-BSO3S6AN.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-ENOAIZ4K.js";
23
+ } from "./chunk-R5XH32QG.js";
24
24
 
25
25
  // src/config/config-manager.ts
26
26
  import { readFileSync, writeFileSync, existsSync, mkdirSync } from "fs";
@@ -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.44";
11
+ var VERSION = "0.4.46";
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 { platform } from "os";
6
6
  import chalk from "chalk";
7
7
 
8
8
  // src/core/constants.ts
9
- var VERSION = "0.4.44";
9
+ var VERSION = "0.4.46";
10
10
  var APP_NAME = "ai-cli";
11
11
  var CONFIG_DIR_NAME = ".aicli";
12
12
  var CONFIG_FILE_NAME = "config.json";
@@ -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-ZO37ZGR2.js");
388
+ const { TaskOrchestrator } = await import("./task-orchestrator-ZTFNMBTW.js");
389
389
  const orchestrator = new TaskOrchestrator(config, providers, configManager);
390
390
  let interrupted = false;
391
391
  const onSigint = () => {
package/dist/index.js CHANGED
@@ -24,7 +24,7 @@ import {
24
24
  saveDevState,
25
25
  sessionHasMeaningfulContent,
26
26
  setupProxy
27
- } from "./chunk-5GC3IVW3.js";
27
+ } from "./chunk-IP7FPI3C.js";
28
28
  import {
29
29
  ToolExecutor,
30
30
  ToolRegistry,
@@ -37,7 +37,7 @@ import {
37
37
  spawnAgentContext,
38
38
  theme,
39
39
  undoStack
40
- } from "./chunk-Q6SAWWSW.js";
40
+ } from "./chunk-BSO3S6AN.js";
41
41
  import {
42
42
  fileCheckpoints
43
43
  } from "./chunk-4BKXL7SM.js";
@@ -61,7 +61,7 @@ import {
61
61
  SKILLS_DIR_NAME,
62
62
  VERSION,
63
63
  buildUserIdentityPrompt
64
- } from "./chunk-ENOAIZ4K.js";
64
+ } from "./chunk-R5XH32QG.js";
65
65
 
66
66
  // src/index.ts
67
67
  import { program } from "commander";
@@ -2099,7 +2099,7 @@ ${hint}` : "")
2099
2099
  usage: "/test [command|filter]",
2100
2100
  async execute(args, ctx) {
2101
2101
  try {
2102
- const { executeTests } = await import("./run-tests-I2EPN57R.js");
2102
+ const { executeTests } = await import("./run-tests-RZTULQ3R.js");
2103
2103
  const argStr = args.join(" ").trim();
2104
2104
  let testArgs = {};
2105
2105
  if (argStr) {
@@ -4190,45 +4190,58 @@ Session '${this.resumeSessionId}' not found.
4190
4190
  }
4191
4191
  async handleChat(userInput) {
4192
4192
  const session = this.sessions.current;
4193
- const { parts, hasImage, refs } = parseAtReferences(userInput, process.cwd());
4194
- for (const ref of refs) {
4195
- if (ref.type === "notfound") {
4196
- process.stdout.write(theme.warning(` \u26A0 File not found: ${ref.path}
4193
+ const readIntentKeywords = ["\u4E86\u89E3", "\u9605\u8BFB", "\u67E5\u770B", "\u5206\u6790", "\u6982\u62EC", "\u603B\u7ED3", "read", "understand", "analyze", "summarize", "review", "look at"];
4194
+ const writeIntentKeywords = ["\u521B\u5EFA", "\u751F\u6210", "\u7F16\u5199", "\u4FEE\u6539", "\u66F4\u65B0", "\u8FD0\u884C", "create", "generate", "write", "modify", "update", "run", "fix", "start"];
4195
+ const normalizedInput = userInput.toLowerCase();
4196
+ const isReadIntent = readIntentKeywords.some((k) => normalizedInput.includes(k));
4197
+ const isWriteIntent = writeIntentKeywords.some((k) => normalizedInput.includes(k));
4198
+ const originalBlockedTools = this.blockedTools;
4199
+ if (isReadIntent && !isWriteIntent) {
4200
+ const readOnlyBlocks = ["write_file", "edit_file", "bash", "run_interactive", "task_create", "task_stop", "git_commit"];
4201
+ const newBlocked = new Set(originalBlockedTools);
4202
+ for (const t of readOnlyBlocks) newBlocked.add(t);
4203
+ this.blockedTools = newBlocked;
4204
+ process.stdout.write(theme.dim(" \u{1F6E1}\uFE0F Read-only intent detected: restricting write tools for this turn.\n"));
4205
+ }
4206
+ const t0 = Date.now();
4207
+ try {
4208
+ const { parts, hasImage, refs } = parseAtReferences(userInput, process.cwd());
4209
+ for (const ref of refs) {
4210
+ if (ref.type === "notfound") {
4211
+ process.stdout.write(theme.warning(` \u26A0 File not found: ${ref.path}
4197
4212
  `));
4198
- } else if (ref.type === "toolarge") {
4199
- process.stdout.write(theme.warning(` \u26A0 Image too large (> 10 MB): ${ref.path}
4213
+ } else if (ref.type === "toolarge") {
4214
+ process.stdout.write(theme.warning(` \u26A0 Image too large (> 10 MB): ${ref.path}
4200
4215
  `));
4201
- } else if (ref.type === "image") {
4202
- process.stdout.write(theme.dim(` \u{1F4CE} Image: ${ref.path}
4216
+ } else if (ref.type === "image") {
4217
+ process.stdout.write(theme.dim(` \u{1F4CE} Image: ${ref.path}
4203
4218
  `));
4204
- } else {
4205
- process.stdout.write(theme.dim(` \u{1F4C4} File: ${ref.path}
4219
+ } else {
4220
+ process.stdout.write(theme.dim(` \u{1F4C4} File: ${ref.path}
4206
4221
  `));
4222
+ }
4207
4223
  }
4208
- }
4209
- const messageContent = parts.length > 0 ? parts.length === 1 && parts[0].type === "text" ? parts[0].text : parts : userInput;
4210
- if (hasImage) {
4211
- const visionHint = this.getVisionModelHint();
4212
- if (visionHint) {
4224
+ const messageContent = parts.length > 0 ? parts.length === 1 && parts[0].type === "text" ? parts[0].text : parts : userInput;
4225
+ if (hasImage) {
4226
+ const visionHint = this.getVisionModelHint();
4227
+ if (visionHint) {
4228
+ process.stdout.write(
4229
+ theme.warning(` \u2716 Vision not supported \u2013 ${visionHint}
4230
+ `)
4231
+ );
4232
+ return;
4233
+ }
4213
4234
  process.stdout.write(
4214
- theme.warning(` \u2716 Vision not supported \u2013 ${visionHint}
4235
+ theme.dim(` \u{1F5BC} Vision request \u2013 sending image to ${this.currentProvider}
4215
4236
  `)
4216
4237
  );
4217
- return;
4218
4238
  }
4219
- process.stdout.write(
4220
- theme.dim(` \u{1F5BC} Vision request \u2013 sending image to ${this.currentProvider}
4221
- `)
4222
- );
4223
- }
4224
- session.addMessage({
4225
- role: "user",
4226
- content: messageContent,
4227
- timestamp: /* @__PURE__ */ new Date()
4228
- });
4229
- this.events.emit("message.before", { input: userInput });
4230
- const t0 = Date.now();
4231
- try {
4239
+ session.addMessage({
4240
+ role: "user",
4241
+ content: messageContent,
4242
+ timestamp: /* @__PURE__ */ new Date()
4243
+ });
4244
+ this.events.emit("message.before", { input: userInput });
4232
4245
  const provider = this.providers.get(this.currentProvider);
4233
4246
  const supportsTools = "chatWithTools" in provider;
4234
4247
  if (supportsTools) {
@@ -4249,6 +4262,8 @@ Session '${this.resumeSessionId}' not found.
4249
4262
  }
4250
4263
  } catch (err) {
4251
4264
  this.renderer.renderError(err);
4265
+ } finally {
4266
+ this.blockedTools = originalBlockedTools;
4252
4267
  }
4253
4268
  }
4254
4269
  /**
@@ -5469,7 +5484,7 @@ program.command("web").description("Start Web UI server with browser-based chat
5469
5484
  console.error("Error: Invalid port number. Must be between 1 and 65535.");
5470
5485
  process.exit(1);
5471
5486
  }
5472
- const { startWebServer } = await import("./server-QWABC7FF.js");
5487
+ const { startWebServer } = await import("./server-2TZ3ZUVZ.js");
5473
5488
  await startWebServer({ port, host: options.host });
5474
5489
  });
5475
5490
  program.command("user [action] [username]").description("Manage Web UI users (list | create <name> | delete <name> | reset-password <name> | migrate <name>)").action(async (action, username) => {
@@ -5702,7 +5717,7 @@ program.command("hub [topic]").description("Start multi-agent hub (discuss / bra
5702
5717
  }),
5703
5718
  config.get("customProviders")
5704
5719
  );
5705
- const { startHub } = await import("./hub-XLTDDEB6.js");
5720
+ const { startHub } = await import("./hub-IO6QCF5C.js");
5706
5721
  await startHub(
5707
5722
  {
5708
5723
  topic: topic ?? "",
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  executeTests,
3
3
  runTestsTool
4
- } from "./chunk-L7R2LZMI.js";
4
+ } from "./chunk-TMYJUJIY.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-ENOAIZ4K.js";
5
+ } from "./chunk-R5XH32QG.js";
6
6
  export {
7
7
  executeTests,
8
8
  runTestsTool
@@ -15,7 +15,7 @@ import {
15
15
  hadPreviousWriteToolCalls,
16
16
  loadDevState,
17
17
  setupProxy
18
- } from "./chunk-5GC3IVW3.js";
18
+ } from "./chunk-IP7FPI3C.js";
19
19
  import {
20
20
  AuthManager
21
21
  } from "./chunk-BYNY5JPB.js";
@@ -33,7 +33,7 @@ import {
33
33
  spawnAgentContext,
34
34
  truncateOutput,
35
35
  undoStack
36
- } from "./chunk-Q6SAWWSW.js";
36
+ } from "./chunk-BSO3S6AN.js";
37
37
  import "./chunk-4BKXL7SM.js";
38
38
  import {
39
39
  AGENTIC_BEHAVIOR_GUIDELINE,
@@ -52,7 +52,7 @@ import {
52
52
  SKILLS_DIR_NAME,
53
53
  VERSION,
54
54
  buildUserIdentityPrompt
55
- } from "./chunk-ENOAIZ4K.js";
55
+ } from "./chunk-R5XH32QG.js";
56
56
 
57
57
  // src/web/server.ts
58
58
  import express from "express";
@@ -1606,7 +1606,7 @@ ${undoResults.map((r) => ` \u2022 ${r}`).join("\n")}` });
1606
1606
  case "test": {
1607
1607
  this.send({ type: "info", message: "\u{1F9EA} Running tests..." });
1608
1608
  try {
1609
- const { executeTests } = await import("./run-tests-I2EPN57R.js");
1609
+ const { executeTests } = await import("./run-tests-RZTULQ3R.js");
1610
1610
  const argStr = args.join(" ").trim();
1611
1611
  let testArgs = {};
1612
1612
  if (argStr) {
@@ -4,11 +4,11 @@ import {
4
4
  getDangerLevel,
5
5
  googleSearchContext,
6
6
  truncateOutput
7
- } from "./chunk-Q6SAWWSW.js";
7
+ } from "./chunk-BSO3S6AN.js";
8
8
  import "./chunk-4BKXL7SM.js";
9
9
  import {
10
10
  SUBAGENT_ALLOWED_TOOLS
11
- } from "./chunk-ENOAIZ4K.js";
11
+ } from "./chunk-R5XH32QG.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.44",
3
+ "version": "0.4.46",
4
4
  "description": "Cross-platform REPL-style AI CLI with multi-provider support",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",