@llmist/cli 15.6.0 → 15.7.1

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
@@ -98,7 +98,7 @@ import { Command, InvalidArgumentError as InvalidArgumentError2 } from "commande
98
98
  // package.json
99
99
  var package_default = {
100
100
  name: "@llmist/cli",
101
- version: "15.6.0",
101
+ version: "15.7.1",
102
102
  description: "CLI for llmist - run LLM agents from the command line",
103
103
  type: "module",
104
104
  main: "dist/cli.js",
@@ -154,7 +154,7 @@ var package_default = {
154
154
  node: ">=22.0.0"
155
155
  },
156
156
  dependencies: {
157
- llmist: "^15.6.0",
157
+ llmist: "^15.7.1",
158
158
  "@unblessed/node": "^1.0.0-alpha.23",
159
159
  chalk: "^5.6.2",
160
160
  commander: "^12.1.0",
@@ -168,7 +168,7 @@ var package_default = {
168
168
  zod: "^4.1.12"
169
169
  },
170
170
  devDependencies: {
171
- "@llmist/testing": "^15.6.0",
171
+ "@llmist/testing": "^15.7.1",
172
172
  "@types/diff": "^8.0.0",
173
173
  "@types/js-yaml": "^4.0.9",
174
174
  "@types/marked-terminal": "^6.1.1",
@@ -5187,16 +5187,16 @@ var BlockRenderer = class _BlockRenderer {
5187
5187
  }
5188
5188
  /**
5189
5189
  * Check if a gadget should render as plain text in focused mode.
5190
- * TellUser and AskUser render as text for a chat-like experience.
5190
+ * TellUser, AskUser, and Finish render as text for a chat-like experience.
5191
5191
  */
5192
5192
  shouldRenderAsText(node) {
5193
5193
  if (this.contentFilterMode !== "focused") return false;
5194
5194
  if (node.type !== "gadget") return false;
5195
5195
  const name = node.name;
5196
- return name === "TellUser" || name === "AskUser";
5196
+ return name === "TellUser" || name === "AskUser" || name === "Finish";
5197
5197
  }
5198
5198
  /**
5199
- * Create a text-like block for TellUser/AskUser gadgets in focused mode.
5199
+ * Create a text-like block for TellUser/AskUser/Finish gadgets in focused mode.
5200
5200
  * Renders just the content without the gadget header.
5201
5201
  */
5202
5202
  createTextLikeBlock(node, top) {
@@ -5213,6 +5213,13 @@ ${renderMarkdown(message)}
5213
5213
  if (typeof question === "string") {
5214
5214
  content = `
5215
5215
  ? ${question}
5216
+ `;
5217
+ }
5218
+ } else if (node.name === "Finish") {
5219
+ const message = node.parameters?.message;
5220
+ if (typeof message === "string" && message.trim()) {
5221
+ content = `
5222
+ \x1B[32m\u2713\x1B[0m ${renderMarkdown(message)}
5216
5223
  `;
5217
5224
  }
5218
5225
  }
@@ -5635,7 +5642,7 @@ ${indicator}`;
5635
5642
  return false;
5636
5643
  case "gadget": {
5637
5644
  const name = node.name;
5638
- return name === "TellUser" || name === "AskUser";
5645
+ return name === "TellUser" || name === "AskUser" || name === "Finish";
5639
5646
  }
5640
5647
  default:
5641
5648
  return false;
@@ -6219,10 +6226,16 @@ var InputHandler = class {
6219
6226
  ctrlJCallback = null;
6220
6227
  /** Callback when Ctrl+P is pressed (cycle profiles) */
6221
6228
  ctrlPCallback = null;
6229
+ /** Callback when Arrow Up is pressed (scroll up in focused mode) */
6230
+ arrowUpCallback = null;
6231
+ /** Callback when Arrow Down is pressed (scroll down in focused mode) */
6232
+ arrowDownCallback = null;
6222
6233
  /** Callback for mid-session input (user submits while agent is running) */
6223
6234
  midSessionHandler = null;
6224
6235
  /** Callback to check current focus mode (to avoid conflicts with browse mode) */
6225
6236
  getFocusModeCallback = null;
6237
+ /** Callback to check current content filter mode */
6238
+ getContentFilterModeCallback = null;
6226
6239
  /** Body height when input bar is visible */
6227
6240
  bodyHeightWithInput;
6228
6241
  /** Body height when input bar is hidden (browse mode) */
@@ -6273,6 +6286,16 @@ var InputHandler = class {
6273
6286
  this.ctrlPCallback();
6274
6287
  }
6275
6288
  });
6289
+ this.inputBar.key(["up"], () => {
6290
+ if (this.getContentFilterModeCallback?.() === "focused" && this.arrowUpCallback) {
6291
+ this.arrowUpCallback();
6292
+ }
6293
+ });
6294
+ this.inputBar.key(["down"], () => {
6295
+ if (this.getContentFilterModeCallback?.() === "focused" && this.arrowDownCallback) {
6296
+ this.arrowDownCallback();
6297
+ }
6298
+ });
6276
6299
  this.inputBar.key(["C-s"], () => {
6277
6300
  const currentValue = this.inputBar.getValue();
6278
6301
  this.openEditorForInput(currentValue);
@@ -6323,6 +6346,26 @@ var InputHandler = class {
6323
6346
  onCtrlP(callback) {
6324
6347
  this.ctrlPCallback = callback;
6325
6348
  }
6349
+ /**
6350
+ * Set callback for Arrow Up events (scroll up in focused mode).
6351
+ */
6352
+ onArrowUp(callback) {
6353
+ this.arrowUpCallback = callback;
6354
+ }
6355
+ /**
6356
+ * Set callback for Arrow Down events (scroll down in focused mode).
6357
+ */
6358
+ onArrowDown(callback) {
6359
+ this.arrowDownCallback = callback;
6360
+ }
6361
+ /**
6362
+ * Set callback to check content filter mode.
6363
+ * Used to determine if arrow keys should scroll (focused mode)
6364
+ * or move cursor (full mode).
6365
+ */
6366
+ setGetContentFilterMode(callback) {
6367
+ this.getContentFilterModeCallback = callback;
6368
+ }
6326
6369
  /**
6327
6370
  * Set handler for mid-session input.
6328
6371
  * Called when user submits input while an agent session is running
@@ -6674,10 +6717,18 @@ var KeyboardManager = class {
6674
6717
  onAction({ type: "scroll_page", direction: 1 });
6675
6718
  });
6676
6719
  screen.key(["up", "k"], () => {
6720
+ if (this.config.getContentFilterMode() === "focused") {
6721
+ onAction({ type: "scroll_line", direction: -1 });
6722
+ return;
6723
+ }
6677
6724
  if (this.config.getFocusMode() !== "browse") return;
6678
6725
  onAction({ type: "navigation", action: "select_previous" });
6679
6726
  });
6680
6727
  screen.key(["down", "j"], () => {
6728
+ if (this.config.getContentFilterMode() === "focused") {
6729
+ onAction({ type: "scroll_line", direction: 1 });
6730
+ return;
6731
+ }
6681
6732
  if (this.config.getFocusMode() !== "browse") return;
6682
6733
  onAction({ type: "navigation", action: "select_next" });
6683
6734
  });
@@ -7917,6 +7968,7 @@ var TUIApp = class _TUIApp {
7917
7968
  const keyboardManager = new KeyboardManager({
7918
7969
  screen,
7919
7970
  getFocusMode: () => controller.getFocusMode(),
7971
+ getContentFilterMode: () => controller.getContentFilterMode(),
7920
7972
  isWaitingForREPLPrompt: () => inputHandler.isWaitingForREPLPrompt(),
7921
7973
  hasPendingInput: () => inputHandler.hasPendingInput(),
7922
7974
  isBlockExpanded: () => blockRenderer.getSelectedBlock()?.expanded ?? false,
@@ -7947,7 +7999,30 @@ var TUIApp = class _TUIApp {
7947
7999
  inputHandler.onCtrlI(() => keyboardManager.handleForwardedKey("C-i"));
7948
8000
  inputHandler.onCtrlJ(() => keyboardManager.handleForwardedKey("C-j"));
7949
8001
  inputHandler.onCtrlP(() => keyboardManager.handleForwardedKey("C-p"));
8002
+ inputHandler.onArrowUp(() => {
8003
+ handleKeyAction(
8004
+ { type: "scroll_line", direction: -1 },
8005
+ controller,
8006
+ blockRenderer,
8007
+ statusBar,
8008
+ screenCtx,
8009
+ modalManager,
8010
+ layout
8011
+ );
8012
+ });
8013
+ inputHandler.onArrowDown(() => {
8014
+ handleKeyAction(
8015
+ { type: "scroll_line", direction: 1 },
8016
+ controller,
8017
+ blockRenderer,
8018
+ statusBar,
8019
+ screenCtx,
8020
+ modalManager,
8021
+ layout
8022
+ );
8023
+ });
7950
8024
  inputHandler.setGetFocusMode(() => controller.getFocusMode());
8025
+ inputHandler.setGetContentFilterMode(() => controller.getContentFilterMode());
7951
8026
  layout.body.on("scroll", () => {
7952
8027
  blockRenderer.handleUserScroll();
7953
8028
  });
@@ -8338,6 +8413,14 @@ function handleKeyAction(action, controller, blockRenderer, statusBar, screenCtx
8338
8413
  screenCtx.renderNow();
8339
8414
  break;
8340
8415
  }
8416
+ case "scroll_line": {
8417
+ const body = layout.body;
8418
+ if (!body.scroll) return;
8419
+ body.scroll(action.direction);
8420
+ blockRenderer.handleUserScroll();
8421
+ screenCtx.renderNow();
8422
+ break;
8423
+ }
8341
8424
  case "navigation":
8342
8425
  switch (action.action) {
8343
8426
  case "select_next":