jinzd-ai-cli 0.2.20 → 0.2.22

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.
@@ -16,7 +16,7 @@ import {
16
16
  SUBAGENT_MAX_ROUNDS_LIMIT,
17
17
  VERSION,
18
18
  runTestsTool
19
- } from "./chunk-4QML7RKK.js";
19
+ } from "./chunk-TYZVSHVJ.js";
20
20
 
21
21
  // src/config/config-manager.ts
22
22
  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.2.20";
11
+ var VERSION = "0.2.22";
12
12
  var APP_NAME = "ai-cli";
13
13
  var CONFIG_DIR_NAME = ".aicli";
14
14
  var CONFIG_FILE_NAME = "config.json";
package/dist/index.js CHANGED
@@ -36,7 +36,7 @@ import {
36
36
  theme,
37
37
  truncateOutput,
38
38
  undoStack
39
- } from "./chunk-MSI2PNQB.js";
39
+ } from "./chunk-FUR3Z67Z.js";
40
40
  import {
41
41
  AGENTIC_BEHAVIOR_GUIDELINE,
42
42
  AUTHOR,
@@ -56,7 +56,7 @@ import {
56
56
  REPO_URL,
57
57
  SKILLS_DIR_NAME,
58
58
  VERSION
59
- } from "./chunk-4QML7RKK.js";
59
+ } from "./chunk-TYZVSHVJ.js";
60
60
 
61
61
  // src/index.ts
62
62
  import { program } from "commander";
@@ -1905,7 +1905,7 @@ ${hint}` : "")
1905
1905
  description: "Run project tests and show structured report",
1906
1906
  usage: "/test [command|filter]",
1907
1907
  async execute(args, _ctx) {
1908
- const { executeTests } = await import("./run-tests-U7MLQNUL.js");
1908
+ const { executeTests } = await import("./run-tests-HCONBTQL.js");
1909
1909
  const argStr = args.join(" ").trim();
1910
1910
  let testArgs = {};
1911
1911
  if (argStr) {
@@ -3396,8 +3396,10 @@ var Repl = class {
3396
3396
  _userInterjection = null;
3397
3397
  /** User interjection: character accumulator (typed but not yet Enter'd) */
3398
3398
  _interjectionBuf = "";
3399
- /** User interjection: stdin data handler reference */
3399
+ /** User interjection: stdin data handler reference (echo-only) */
3400
3400
  _interjectionHandler = null;
3401
+ /** Whether interjection listener is active (agentic loop) */
3402
+ _interjectionActive = false;
3401
3403
  /** Multi-line input buffer: accumulates lines ending with \ */
3402
3404
  _multilineBuf = [];
3403
3405
  /** 运行时动态添加的额外上下文目录(/add-dir 命令) */
@@ -4182,6 +4184,18 @@ Session '${this.resumeSessionId}' not found.
4182
4184
  if (this.toolExecutor.confirming) return;
4183
4185
  if (this.selecting) return;
4184
4186
  if (askUserContext.prompting) return;
4187
+ if (processing && this._interjectionActive) {
4188
+ const trimmed = line.trim();
4189
+ if (trimmed.length === 0) return;
4190
+ if (trimmed.startsWith("/")) {
4191
+ this.toolExecutor.pendingSlashCommand = trimmed;
4192
+ process.stdout.write(theme.dim(` (command "${trimmed}" queued)
4193
+ `));
4194
+ } else {
4195
+ this._userInterjection = trimmed;
4196
+ }
4197
+ return;
4198
+ }
4185
4199
  if (processing) return;
4186
4200
  const rawTrimmed = line.trimEnd();
4187
4201
  if (rawTrimmed.endsWith("\\")) {
@@ -4532,7 +4546,7 @@ Session '${this.resumeSessionId}' not found.
4532
4546
  process.stdin.removeListener("data", this._escHandler);
4533
4547
  this._escHandler = null;
4534
4548
  }
4535
- if (!this._interjectionHandler) {
4549
+ if (!this._interjectionActive) {
4536
4550
  process.stdin.pause();
4537
4551
  }
4538
4552
  this.streamAbortController = null;
@@ -4545,30 +4559,25 @@ Session '${this.resumeSessionId}' not found.
4545
4559
  setupInterjectionListener() {
4546
4560
  this._userInterjection = null;
4547
4561
  this._interjectionBuf = "";
4562
+ this._interjectionActive = true;
4563
+ this.rl.resume();
4548
4564
  const handler = (data) => {
4549
4565
  if (this.toolExecutor.confirming || askUserContext.prompting) return;
4550
- for (let i = 0; i < data.length; i++) {
4551
- const byte = data[i];
4552
- if (byte === 13 || byte === 10) {
4566
+ const str = data.toString("utf-8");
4567
+ for (const ch of str) {
4568
+ const code = ch.codePointAt(0);
4569
+ if (code === 13 || code === 10) {
4570
+ this._interjectionBuf = "";
4571
+ } else if (code === 127 || code === 8) {
4553
4572
  if (this._interjectionBuf.length > 0) {
4554
- const line = this._interjectionBuf;
4555
- this._interjectionBuf = "";
4556
- process.stdout.write("\n");
4557
- if (line.startsWith("/")) {
4558
- this.toolExecutor.pendingSlashCommand = line;
4559
- process.stdout.write(theme.dim(` (command "${line}" queued)
4560
- `));
4561
- } else {
4562
- this._userInterjection = line;
4563
- }
4573
+ const chars = Array.from(this._interjectionBuf);
4574
+ const removed = chars.pop();
4575
+ this._interjectionBuf = chars.join("");
4576
+ const width = removed.codePointAt(0) > 255 ? 2 : 1;
4577
+ for (let w = 0; w < width; w++) process.stdout.write("\b \b");
4564
4578
  }
4565
- } else if (byte === 127 || byte === 8) {
4566
- if (this._interjectionBuf.length > 0) {
4567
- this._interjectionBuf = this._interjectionBuf.slice(0, -1);
4568
- process.stdout.write("\b \b");
4569
- }
4570
- } else if (byte >= 32 && byte <= 126) {
4571
- const ch = String.fromCharCode(byte);
4579
+ } else if (code === 3 || code === 27) {
4580
+ } else if (code >= 32) {
4572
4581
  this._interjectionBuf += ch;
4573
4582
  process.stdout.write(ch);
4574
4583
  }
@@ -4576,7 +4585,6 @@ Session '${this.resumeSessionId}' not found.
4576
4585
  };
4577
4586
  this._interjectionHandler = handler;
4578
4587
  process.stdin.on("data", handler);
4579
- process.stdin.resume();
4580
4588
  }
4581
4589
  /**
4582
4590
  * Remove the interjection listener, clean up state.
@@ -4587,6 +4595,8 @@ Session '${this.resumeSessionId}' not found.
4587
4595
  this._interjectionHandler = null;
4588
4596
  }
4589
4597
  this._interjectionBuf = "";
4598
+ this._interjectionActive = false;
4599
+ this.rl.pause();
4590
4600
  }
4591
4601
  /**
4592
4602
  * 注册 Ctrl+V 剪贴板图片粘贴快捷键。
@@ -5092,8 +5102,8 @@ You have a maximum of ${MAX_TOOL_ROUNDS} tool call rounds for this task. Plan ef
5092
5102
  }
5093
5103
  }
5094
5104
  }
5095
- if (this._interjectionHandler) {
5096
- process.stdin.resume();
5105
+ if (this._interjectionActive) {
5106
+ this.rl.resume();
5097
5107
  }
5098
5108
  const reasoningContent = "reasoningContent" in result ? result.reasoningContent : void 0;
5099
5109
  const newMsgs = provider.buildToolResultMessages(result.toolCalls, toolResults, reasoningContent);
@@ -5511,7 +5521,7 @@ program.command("web").description("Start Web UI server with browser-based chat
5511
5521
  console.error("Error: Invalid port number. Must be between 1 and 65535.");
5512
5522
  process.exit(1);
5513
5523
  }
5514
- const { startWebServer } = await import("./server-5RJZNTPH.js");
5524
+ const { startWebServer } = await import("./server-LC5U6FSV.js");
5515
5525
  await startWebServer({ port, host: options.host });
5516
5526
  });
5517
5527
  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-4QML7RKK.js";
5
+ } from "./chunk-TYZVSHVJ.js";
6
6
  export {
7
7
  executeTests,
8
8
  runTestsTool
@@ -24,7 +24,7 @@ import {
24
24
  setupProxy,
25
25
  spawnAgentContext,
26
26
  truncateOutput
27
- } from "./chunk-MSI2PNQB.js";
27
+ } from "./chunk-FUR3Z67Z.js";
28
28
  import {
29
29
  AGENTIC_BEHAVIOR_GUIDELINE,
30
30
  CONTEXT_FILE_CANDIDATES,
@@ -36,7 +36,7 @@ import {
36
36
  PLAN_MODE_SYSTEM_ADDON,
37
37
  SKILLS_DIR_NAME,
38
38
  VERSION
39
- } from "./chunk-4QML7RKK.js";
39
+ } from "./chunk-TYZVSHVJ.js";
40
40
  import {
41
41
  AuthManager
42
42
  } from "./chunk-CPLT6CD3.js";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "jinzd-ai-cli",
3
- "version": "0.2.20",
3
+ "version": "0.2.22",
4
4
  "description": "Cross-platform REPL-style AI CLI with multi-provider support",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",