jinzd-ai-cli 0.2.4 → 0.2.5

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-OIJT7K75.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.5";
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-EKCYEBAS.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-OIJT7K75.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-TEXIYKPE.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"));
@@ -4490,9 +4510,16 @@ Session '${this.resumeSessionId}' not found.
4490
4510
  const byte = data[i];
4491
4511
  if (byte === 13 || byte === 10) {
4492
4512
  if (this._interjectionBuf.length > 0) {
4493
- this._userInterjection = this._interjectionBuf;
4513
+ const line = this._interjectionBuf;
4494
4514
  this._interjectionBuf = "";
4495
4515
  process.stdout.write("\n");
4516
+ if (line.startsWith("/")) {
4517
+ this.toolExecutor.pendingSlashCommand = line;
4518
+ process.stdout.write(theme.dim(` (command "${line}" queued)
4519
+ `));
4520
+ } else {
4521
+ this._userInterjection = line;
4522
+ }
4496
4523
  }
4497
4524
  } else if (byte === 127 || byte === 8) {
4498
4525
  if (this._interjectionBuf.length > 0) {
@@ -4761,6 +4788,20 @@ Session '${this.resumeSessionId}' not found.
4761
4788
  try {
4762
4789
  for (let round = 0; round < MAX_TOOL_ROUNDS; round++) {
4763
4790
  this.toolExecutor.setRoundInfo(round + 1, MAX_TOOL_ROUNDS);
4791
+ if (this.toolExecutor.pendingSlashCommand) {
4792
+ const cmd = this.toolExecutor.pendingSlashCommand;
4793
+ this.toolExecutor.pendingSlashCommand = null;
4794
+ if (cmd === "/exit" || cmd === "/quit" || cmd === "/q") {
4795
+ spinner.stop();
4796
+ process.stdout.write(theme.warning(`\u26A1 ${cmd} \u2014 stopping agentic loop
4797
+ `));
4798
+ this.teardownInterjectionListener();
4799
+ return;
4800
+ }
4801
+ process.stdout.write(theme.warning(`\u26A1 Command "${cmd}" \u2014 injected as message
4802
+ `));
4803
+ extraMessages.push({ role: "user", content: cmd });
4804
+ }
4764
4805
  if (this._userInterjection) {
4765
4806
  const msg = this._userInterjection;
4766
4807
  this._userInterjection = null;
@@ -5292,7 +5333,7 @@ program.command("web").description("Start Web UI server with browser-based chat
5292
5333
  console.error("Error: Invalid port number. Must be between 1 and 65535.");
5293
5334
  process.exit(1);
5294
5335
  }
5295
- const { startWebServer } = await import("./server-N2LG3A4M.js");
5336
+ const { startWebServer } = await import("./server-IT4WXV42.js");
5296
5337
  await startWebServer({ port, host: options.host });
5297
5338
  });
5298
5339
  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-OIJT7K75.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-EKCYEBAS.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-OIJT7K75.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.5",
4
4
  "description": "Cross-platform REPL-style AI CLI with multi-provider support",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",