@livx.cc/agentx 0.99.137 → 0.99.139

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.
package/dist/cli.js CHANGED
@@ -18773,6 +18773,7 @@ function createLineEditor(out, input = keyInput) {
18773
18773
  return {
18774
18774
  readLine,
18775
18775
  redrawNow: () => activeRedraw?.(),
18776
+ isReading: () => !!activeRedraw,
18776
18777
  suspend: () => {
18777
18778
  if (suspended) return;
18778
18779
  suspended = true;
@@ -22765,8 +22766,9 @@ ${task}`;
22765
22766
  keyInput.on("keypress", (_s, key) => {
22766
22767
  if (isMenuActive()) return;
22767
22768
  if (!activeTurn && !dispatchPending) return;
22769
+ const editorOwnsKeys = editor.isReading();
22768
22770
  if (key?.ctrl && key?.name === "o") {
22769
- toggleVerbose();
22771
+ if (!editorOwnsKeys) toggleVerbose();
22770
22772
  return;
22771
22773
  }
22772
22774
  const k = key?.name;
@@ -22788,6 +22790,7 @@ ${task}`;
22788
22790
  }
22789
22791
  return;
22790
22792
  }
22793
+ if (editorOwnsKeys) return;
22791
22794
  const action = applyKey2(sEd, key ?? {}, _s);
22792
22795
  if (action === "submit") {
22793
22796
  const text = sEd.expand().trim();
@@ -23210,49 +23213,52 @@ ${out}
23210
23213
  const q2 = ask.question.replace(/\s+/g, " ").slice(0, 64);
23211
23214
  return bold(yellow(`? ${q2}${ask.question.length > 64 ? "\u2026" : ""} \u2039yes/no\u203A `));
23212
23215
  };
23213
- const result = await readMultiline((cont) => editor.readLine({
23214
- prompt: cont ? contPrompt : livePrompt,
23215
- suggest,
23216
- history,
23217
- classifyPaste,
23218
- onEmptyPaste: grabClipboardAttachment,
23219
- onSubmit: () => {
23220
- dispatchPending = true;
23221
- },
23222
- // claim keys buffered behind the Enter (turn isn't active yet)
23223
- initial: cont ? void 0 : initial,
23224
- status: computeFooter,
23225
- vimMode: cfg.editorMode === "vim",
23226
- statusTickMs: dx ? 1e3 : void 0,
23227
- // duplex: animate the running-task footer while idle at the prompt
23228
- // Esc at the idle prompt with workers running → cancel them (CC-style: Esc stops the work).
23229
- onEscapeIdle: dx ? () => {
23230
- const running = [...dx.tasks.values()].filter((t) => t.status === "running");
23231
- if (!running.length) return false;
23232
- for (const t of running) err("\r\x1B[0J" + yellow(` \u2298 ${dx.cancelTask(t.id)}`) + "\n");
23233
- return true;
23234
- } : void 0,
23235
- onCyclePosture: cyclePosture,
23236
- onToggleThinking: toggleReasoning,
23237
- onToggleVerbose: toggleVerbose,
23238
- onPickModel: async () => {
23239
- const picked = await pickModel(work.model);
23240
- if (picked) setModel(picked);
23241
- return picked;
23242
- },
23243
- onStash: (text) => {
23244
- inputStash.push(text);
23245
- err(`${green(" \u2713 stashed")} ${dim(`#${inputStash.length}: ${text.slice(0, 50)}${text.length > 50 ? "\u2026" : ""}`)}
23216
+ const result = await readMultiline((cont) => {
23217
+ dispatchPending = false;
23218
+ return editor.readLine({
23219
+ prompt: cont ? contPrompt : livePrompt,
23220
+ suggest,
23221
+ history,
23222
+ classifyPaste,
23223
+ onEmptyPaste: grabClipboardAttachment,
23224
+ onSubmit: () => {
23225
+ dispatchPending = true;
23226
+ },
23227
+ // claim keys buffered behind the Enter (turn isn't active yet)
23228
+ initial: cont ? void 0 : initial,
23229
+ status: computeFooter,
23230
+ vimMode: cfg.editorMode === "vim",
23231
+ statusTickMs: dx ? 1e3 : void 0,
23232
+ // duplex: animate the running-task footer while idle at the prompt
23233
+ // Esc at the idle prompt with workers running → cancel them (CC-style: Esc stops the work).
23234
+ onEscapeIdle: dx ? () => {
23235
+ const running = [...dx.tasks.values()].filter((t) => t.status === "running");
23236
+ if (!running.length) return false;
23237
+ for (const t of running) err("\r\x1B[0J" + yellow(` \u2298 ${dx.cancelTask(t.id)}`) + "\n");
23238
+ return true;
23239
+ } : void 0,
23240
+ onCyclePosture: cyclePosture,
23241
+ onToggleThinking: toggleReasoning,
23242
+ onToggleVerbose: toggleVerbose,
23243
+ onPickModel: async () => {
23244
+ const picked = await pickModel(work.model);
23245
+ if (picked) setModel(picked);
23246
+ return picked;
23247
+ },
23248
+ onStash: (text) => {
23249
+ inputStash.push(text);
23250
+ err(`${green(" \u2713 stashed")} ${dim(`#${inputStash.length}: ${text.slice(0, 50)}${text.length > 50 ? "\u2026" : ""}`)}
23246
23251
  `);
23247
- },
23248
- onUnstash: () => {
23249
- if (!inputStash.length) return void 0;
23250
- const t = inputStash.pop();
23251
- err(dim(` \u2191 unstashed${inputStash.length ? ` (${inputStash.length} left)` : ""}
23252
+ },
23253
+ onUnstash: () => {
23254
+ if (!inputStash.length) return void 0;
23255
+ const t = inputStash.pop();
23256
+ err(dim(` \u2191 unstashed${inputStash.length ? ` (${inputStash.length} left)` : ""}
23252
23257
  `));
23253
- return t;
23254
- }
23255
- }));
23258
+ return t;
23259
+ }
23260
+ });
23261
+ });
23256
23262
  if (result === null) break;
23257
23263
  if (result === REWIND) {
23258
23264
  prefill = await rewindToMessage();