jinzd-ai-cli 0.2.4 → 0.2.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.
@@ -16,7 +16,7 @@ import {
16
16
  SUBAGENT_MAX_ROUNDS_LIMIT,
17
17
  VERSION,
18
18
  runTestsTool
19
- } from "./chunk-2WCLXWAH.js";
19
+ } from "./chunk-6JLWYCWR.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.4";
11
+ var VERSION = "0.2.6";
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
@@ -35,7 +35,7 @@ import {
35
35
  theme,
36
36
  truncateOutput,
37
37
  undoStack
38
- } from "./chunk-HTXJ23TX.js";
38
+ } from "./chunk-3E6X7EOS.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-2WCLXWAH.js";
58
+ } from "./chunk-6JLWYCWR.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-L5G4W7EB.js");
1907
+ const { executeTests } = await import("./run-tests-GTUISJ4G.js");
1908
1908
  const argStr = args.join(" ").trim();
1909
1909
  let testArgs = {};
1910
1910
  if (argStr) {
@@ -2474,6 +2474,8 @@ var ToolExecutor = class {
2474
2474
  * 防止用户输入 "y"+Enter 被同时触发 once('line') 和主循环 on('line')。
2475
2475
  */
2476
2476
  confirming = false;
2477
+ /** 在 confirm 期间用户输入的 slash 命令,由 repl.ts 主循环消费 */
2478
+ pendingSlashCommand = null;
2477
2479
  /** confirm() 的取消回调,由 SIGINT handler 调用 */
2478
2480
  cancelConfirmFn = null;
2479
2481
  /**
@@ -2691,7 +2693,16 @@ var ToolExecutor = class {
2691
2693
  resolve3(result);
2692
2694
  };
2693
2695
  const onLine = (line) => {
2694
- const input2 = line.trim().toLowerCase();
2696
+ const trimmed = line.trim();
2697
+ if (trimmed.startsWith("/")) {
2698
+ this.pendingSlashCommand = trimmed;
2699
+ process.stdout.write(theme.dim(`
2700
+ (command "${trimmed}" queued, will execute after current operation)
2701
+ `));
2702
+ cleanup("none");
2703
+ return;
2704
+ }
2705
+ const input2 = trimmed.toLowerCase();
2695
2706
  if (input2 === "a" || input2 === "all" || input2 === "y") {
2696
2707
  cleanup("all");
2697
2708
  } else if (input2 === "r" || input2 === "reject" || input2 === "n" || input2 === "") {
@@ -2862,7 +2873,16 @@ var ToolExecutor = class {
2862
2873
  resolve3(answer === "y");
2863
2874
  };
2864
2875
  const onLine = (line) => {
2865
- cleanup(line.trim().toLowerCase());
2876
+ const trimmed = line.trim();
2877
+ if (trimmed.startsWith("/")) {
2878
+ this.pendingSlashCommand = trimmed;
2879
+ process.stdout.write(theme.dim(`
2880
+ (command "${trimmed}" queued, will execute after current operation)
2881
+ `));
2882
+ cleanup("n");
2883
+ return;
2884
+ }
2885
+ cleanup(trimmed.toLowerCase());
2866
2886
  };
2867
2887
  this.cancelConfirmFn = () => {
2868
2888
  process.stdout.write(theme.dim("\n(cancelled)\n"));
@@ -3375,6 +3395,8 @@ var Repl = class {
3375
3395
  _interjectionBuf = "";
3376
3396
  /** User interjection: stdin data handler reference */
3377
3397
  _interjectionHandler = null;
3398
+ /** Multi-line input buffer: accumulates lines ending with \ */
3399
+ _multilineBuf = [];
3378
3400
  /** 运行时动态添加的额外上下文目录(/add-dir 命令) */
3379
3401
  extraContextDirs = [];
3380
3402
  /** 启动时允许的工具名集合(--allowed-tools 限制) */
@@ -4112,7 +4134,20 @@ Session '${this.resumeSessionId}' not found.
4112
4134
  if (this.toolExecutor.confirming) return;
4113
4135
  if (this.selecting) return;
4114
4136
  if (askUserContext.prompting) return;
4115
- const input2 = line.trim();
4137
+ const rawTrimmed = line.trimEnd();
4138
+ if (rawTrimmed.endsWith("\\")) {
4139
+ this._multilineBuf.push(rawTrimmed.slice(0, -1));
4140
+ process.stdout.write(theme.dim("... > "));
4141
+ return;
4142
+ }
4143
+ let input2;
4144
+ if (this._multilineBuf.length > 0) {
4145
+ this._multilineBuf.push(line);
4146
+ input2 = this._multilineBuf.join("\n").trim();
4147
+ this._multilineBuf = [];
4148
+ } else {
4149
+ input2 = line.trim();
4150
+ }
4116
4151
  if (!input2) {
4117
4152
  this.showPrompt();
4118
4153
  return;
@@ -4490,9 +4525,16 @@ Session '${this.resumeSessionId}' not found.
4490
4525
  const byte = data[i];
4491
4526
  if (byte === 13 || byte === 10) {
4492
4527
  if (this._interjectionBuf.length > 0) {
4493
- this._userInterjection = this._interjectionBuf;
4528
+ const line = this._interjectionBuf;
4494
4529
  this._interjectionBuf = "";
4495
4530
  process.stdout.write("\n");
4531
+ if (line.startsWith("/")) {
4532
+ this.toolExecutor.pendingSlashCommand = line;
4533
+ process.stdout.write(theme.dim(` (command "${line}" queued)
4534
+ `));
4535
+ } else {
4536
+ this._userInterjection = line;
4537
+ }
4496
4538
  }
4497
4539
  } else if (byte === 127 || byte === 8) {
4498
4540
  if (this._interjectionBuf.length > 0) {
@@ -4761,6 +4803,20 @@ Session '${this.resumeSessionId}' not found.
4761
4803
  try {
4762
4804
  for (let round = 0; round < MAX_TOOL_ROUNDS; round++) {
4763
4805
  this.toolExecutor.setRoundInfo(round + 1, MAX_TOOL_ROUNDS);
4806
+ if (this.toolExecutor.pendingSlashCommand) {
4807
+ const cmd = this.toolExecutor.pendingSlashCommand;
4808
+ this.toolExecutor.pendingSlashCommand = null;
4809
+ if (cmd === "/exit" || cmd === "/quit" || cmd === "/q") {
4810
+ spinner.stop();
4811
+ process.stdout.write(theme.warning(`\u26A1 ${cmd} \u2014 stopping agentic loop
4812
+ `));
4813
+ this.teardownInterjectionListener();
4814
+ return;
4815
+ }
4816
+ process.stdout.write(theme.warning(`\u26A1 Command "${cmd}" \u2014 injected as message
4817
+ `));
4818
+ extraMessages.push({ role: "user", content: cmd });
4819
+ }
4764
4820
  if (this._userInterjection) {
4765
4821
  const msg = this._userInterjection;
4766
4822
  this._userInterjection = null;
@@ -5292,7 +5348,7 @@ program.command("web").description("Start Web UI server with browser-based chat
5292
5348
  console.error("Error: Invalid port number. Must be between 1 and 65535.");
5293
5349
  process.exit(1);
5294
5350
  }
5295
- const { startWebServer } = await import("./server-N2LG3A4M.js");
5351
+ const { startWebServer } = await import("./server-F2YMKUJ7.js");
5296
5352
  await startWebServer({ port, host: options.host });
5297
5353
  });
5298
5354
  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-2WCLXWAH.js";
5
+ } from "./chunk-6JLWYCWR.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-HTXJ23TX.js";
26
+ } from "./chunk-3E6X7EOS.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-2WCLXWAH.js";
38
+ } from "./chunk-6JLWYCWR.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.4",
3
+ "version": "0.2.6",
4
4
  "description": "Cross-platform REPL-style AI CLI with multi-provider support",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",