@ai-setting/roy-agent-cli 1.6.16 → 1.6.17

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.
@@ -904,7 +904,7 @@ var init_status_bar = __esm(() => {
904
904
  var require_package = __commonJS((exports, module) => {
905
905
  module.exports = {
906
906
  name: "@ai-setting/roy-agent-cli",
907
- version: "1.6.16",
907
+ version: "1.6.17",
908
908
  type: "module",
909
909
  description: "CLI for roy-agent - Non-interactive command execution",
910
910
  main: "./dist/index.js",
@@ -1865,8 +1865,10 @@ var init_repl_ink = __esm(() => {
1865
1865
  const [buffer, setBuffer] = React3.useState("");
1866
1866
  const [cursor, setCursor] = React3.useState(0);
1867
1867
  React3.useEffect(() => {
1868
- onChange?.(buffer);
1869
- }, [buffer, onChange]);
1868
+ if (popupActive || buffer.startsWith("/")) {
1869
+ onChange?.(buffer);
1870
+ }
1871
+ }, [buffer, onChange, popupActive]);
1870
1872
  React3.useImperativeHandle(ref, () => ({
1871
1873
  clearBuffer: () => {
1872
1874
  setBuffer("");
@@ -11974,14 +11976,18 @@ class REPL {
11974
11976
  console.clear();
11975
11977
  this.printHeader();
11976
11978
  this.redrawInputArea();
11977
- this.rl.prompt(true);
11979
+ if (this.rl) {
11980
+ this.rl.prompt(true);
11981
+ }
11978
11982
  this.sessionManager?.clearAttachments();
11979
11983
  });
11980
11984
  this.commandRegistry.set("cls", async () => {
11981
11985
  console.clear();
11982
11986
  this.printHeader();
11983
11987
  this.redrawInputArea();
11984
- this.rl.prompt(true);
11988
+ if (this.rl) {
11989
+ this.rl.prompt(true);
11990
+ }
11985
11991
  this.sessionManager?.clearAttachments();
11986
11992
  });
11987
11993
  this.commandRegistry.set("sessions", async () => {
@@ -12211,7 +12217,9 @@ ${COLORS.system("[没有正在执行的请求]")}`);
12211
12217
  }
12212
12218
  this.printHeader();
12213
12219
  this.redrawInputArea();
12214
- this.rl.prompt(true);
12220
+ if (this.rl) {
12221
+ this.rl.prompt(true);
12222
+ }
12215
12223
  readline2.emitKeypressEvents(process.stdin);
12216
12224
  if (process.stdin.isTTY) {
12217
12225
  process.stdin.setRawMode?.(true);
@@ -12295,9 +12303,13 @@ ${COLORS.system("[没有正在执行的请求]")}`);
12295
12303
  printSlotBottomBorder();
12296
12304
  }
12297
12305
  updatePrompt() {
12298
- this.rl.setPrompt(COLORS.accent("❯ "));
12299
- this.redrawInputArea();
12300
- this.rl.prompt(true);
12306
+ if (this.rl) {
12307
+ this.rl.setPrompt(COLORS.accent("❯ "));
12308
+ this.redrawInputArea();
12309
+ this.rl.prompt(true);
12310
+ } else {
12311
+ this.redrawInputArea();
12312
+ }
12301
12313
  }
12302
12314
  async handleCommand(input) {
12303
12315
  const [cmd] = input.split(/\s+/);
@@ -12445,7 +12457,9 @@ ${COLORS.error("❌ 执行失败: " + error)}
12445
12457
  this.setMode("ready");
12446
12458
  if (options.showPrompt) {
12447
12459
  this.redrawInputArea();
12448
- this.rl.prompt(true);
12460
+ if (this.rl) {
12461
+ this.rl.prompt(true);
12462
+ }
12449
12463
  }
12450
12464
  }
12451
12465
  }
@@ -12504,9 +12518,13 @@ ${COLORS.error("❌ 执行失败: " + error)}
12504
12518
  promptUser(question, options, errorInfo, opts) {
12505
12519
  const timeoutMs = opts?.timeoutMs ?? this.askUserTimeoutMs ?? ASK_USER_TIMEOUT_MS;
12506
12520
  return new Promise((resolve) => {
12507
- this.rl.setPrompt(COLORS.accent("❯ "));
12508
- this.redrawInputArea();
12509
- this.rl.prompt(true);
12521
+ if (this.rl) {
12522
+ this.rl.setPrompt(COLORS.accent("❯ "));
12523
+ this.redrawInputArea();
12524
+ this.rl.prompt(true);
12525
+ } else {
12526
+ this.redrawInputArea();
12527
+ }
12510
12528
  const finishWithUserInput = (input) => {
12511
12529
  const trimmedInput = input.trim();
12512
12530
  if (!trimmedInput) {
package/dist/index.js CHANGED
@@ -903,7 +903,7 @@ var init_status_bar = __esm(() => {
903
903
  var require_package = __commonJS((exports, module) => {
904
904
  module.exports = {
905
905
  name: "@ai-setting/roy-agent-cli",
906
- version: "1.6.16",
906
+ version: "1.6.17",
907
907
  type: "module",
908
908
  description: "CLI for roy-agent - Non-interactive command execution",
909
909
  main: "./dist/index.js",
@@ -1864,8 +1864,10 @@ var init_repl_ink = __esm(() => {
1864
1864
  const [buffer, setBuffer] = React3.useState("");
1865
1865
  const [cursor, setCursor] = React3.useState(0);
1866
1866
  React3.useEffect(() => {
1867
- onChange?.(buffer);
1868
- }, [buffer, onChange]);
1867
+ if (popupActive || buffer.startsWith("/")) {
1868
+ onChange?.(buffer);
1869
+ }
1870
+ }, [buffer, onChange, popupActive]);
1869
1871
  React3.useImperativeHandle(ref, () => ({
1870
1872
  clearBuffer: () => {
1871
1873
  setBuffer("");
@@ -11973,14 +11975,18 @@ class REPL {
11973
11975
  console.clear();
11974
11976
  this.printHeader();
11975
11977
  this.redrawInputArea();
11976
- this.rl.prompt(true);
11978
+ if (this.rl) {
11979
+ this.rl.prompt(true);
11980
+ }
11977
11981
  this.sessionManager?.clearAttachments();
11978
11982
  });
11979
11983
  this.commandRegistry.set("cls", async () => {
11980
11984
  console.clear();
11981
11985
  this.printHeader();
11982
11986
  this.redrawInputArea();
11983
- this.rl.prompt(true);
11987
+ if (this.rl) {
11988
+ this.rl.prompt(true);
11989
+ }
11984
11990
  this.sessionManager?.clearAttachments();
11985
11991
  });
11986
11992
  this.commandRegistry.set("sessions", async () => {
@@ -12210,7 +12216,9 @@ ${COLORS.system("[没有正在执行的请求]")}`);
12210
12216
  }
12211
12217
  this.printHeader();
12212
12218
  this.redrawInputArea();
12213
- this.rl.prompt(true);
12219
+ if (this.rl) {
12220
+ this.rl.prompt(true);
12221
+ }
12214
12222
  readline2.emitKeypressEvents(process.stdin);
12215
12223
  if (process.stdin.isTTY) {
12216
12224
  process.stdin.setRawMode?.(true);
@@ -12294,9 +12302,13 @@ ${COLORS.system("[没有正在执行的请求]")}`);
12294
12302
  printSlotBottomBorder();
12295
12303
  }
12296
12304
  updatePrompt() {
12297
- this.rl.setPrompt(COLORS.accent("❯ "));
12298
- this.redrawInputArea();
12299
- this.rl.prompt(true);
12305
+ if (this.rl) {
12306
+ this.rl.setPrompt(COLORS.accent("❯ "));
12307
+ this.redrawInputArea();
12308
+ this.rl.prompt(true);
12309
+ } else {
12310
+ this.redrawInputArea();
12311
+ }
12300
12312
  }
12301
12313
  async handleCommand(input) {
12302
12314
  const [cmd] = input.split(/\s+/);
@@ -12444,7 +12456,9 @@ ${COLORS.error("❌ 执行失败: " + error)}
12444
12456
  this.setMode("ready");
12445
12457
  if (options.showPrompt) {
12446
12458
  this.redrawInputArea();
12447
- this.rl.prompt(true);
12459
+ if (this.rl) {
12460
+ this.rl.prompt(true);
12461
+ }
12448
12462
  }
12449
12463
  }
12450
12464
  }
@@ -12503,9 +12517,13 @@ ${COLORS.error("❌ 执行失败: " + error)}
12503
12517
  promptUser(question, options, errorInfo, opts) {
12504
12518
  const timeoutMs = opts?.timeoutMs ?? this.askUserTimeoutMs ?? ASK_USER_TIMEOUT_MS;
12505
12519
  return new Promise((resolve) => {
12506
- this.rl.setPrompt(COLORS.accent("❯ "));
12507
- this.redrawInputArea();
12508
- this.rl.prompt(true);
12520
+ if (this.rl) {
12521
+ this.rl.setPrompt(COLORS.accent("❯ "));
12522
+ this.redrawInputArea();
12523
+ this.rl.prompt(true);
12524
+ } else {
12525
+ this.redrawInputArea();
12526
+ }
12509
12527
  const finishWithUserInput = (input) => {
12510
12528
  const trimmedInput = input.trim();
12511
12529
  if (!trimmedInput) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ai-setting/roy-agent-cli",
3
- "version": "1.6.16",
3
+ "version": "1.6.17",
4
4
  "type": "module",
5
5
  "description": "CLI for roy-agent - Non-interactive command execution",
6
6
  "main": "./dist/index.js",