@cydm/pie 2.7.15 → 2.7.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.
package/dist/cli.js CHANGED
@@ -29,7 +29,7 @@ import {
29
29
  migrateConfigFromAgentDir,
30
30
  setYoloGrantListener,
31
31
  truncateHeadTail
32
- } from "./chunks/chunk-CLEPSTWH.js";
32
+ } from "./chunks/chunk-TGCI5M6R.js";
33
33
  import {
34
34
  AGENTS_CONTEXT_FILE_NAME,
35
35
  AgentSessionController,
@@ -91,8 +91,8 @@ import {
91
91
  shouldPreserveExecutionStateForUserText,
92
92
  supersedeExecutionState,
93
93
  verifyPreparedCompactionCommit
94
- } from "./chunks/chunk-C5UTDL3S.js";
95
- import "./chunks/chunk-TDHVB2FH.js";
94
+ } from "./chunks/chunk-UDCGB3LZ.js";
95
+ import "./chunks/chunk-2H2DD22Z.js";
96
96
  import {
97
97
  Deref,
98
98
  Errors,
@@ -115,7 +115,7 @@ import {
115
115
  sortToolModelCandidatesByCapability,
116
116
  streamSimple,
117
117
  type_exports
118
- } from "./chunks/chunk-NM2JLPJ6.js";
118
+ } from "./chunks/chunk-X7UO6BA6.js";
119
119
  import {
120
120
  IsArray,
121
121
  IsBigInt,
@@ -59349,6 +59349,12 @@ var TUI = class extends Container {
59349
59349
  // Logical cursor row (end of rendered content)
59350
59350
  hardwareCursorRow = 0;
59351
59351
  // Actual terminal cursor row (may differ due to IME positioning)
59352
+ /** Last column the hardware cursor was moved to (0-based). Unchanged
59353
+ * positions must emit no bytes — see positionHardwareCursor. */
59354
+ hardwareCursorCol = 0;
59355
+ /** Last cursor-visibility escape actually emitted; suppresses per-frame
59356
+ * show/hide writes (transition-only, like lastTitle). */
59357
+ hardwareCursorVisible = null;
59352
59358
  showHardwareCursor = process.env.PIE_HARDWARE_CURSOR === "1";
59353
59359
  clearOnShrink = process.env.PIE_CLEAR_ON_SHRINK === "1";
59354
59360
  // Clear empty rows when content shrinks (default: off)
@@ -59449,7 +59455,8 @@ var TUI = class extends Container {
59449
59455
  }
59450
59456
  this.terminal.write("\r\n");
59451
59457
  }
59452
- this.terminal.showCursor();
59458
+ this.hardwareCursorVisible = null;
59459
+ this.setHardwareCursorVisible(true);
59453
59460
  this.terminal.stop();
59454
59461
  }
59455
59462
  requestRender(force = false) {
@@ -59459,6 +59466,8 @@ var TUI = class extends Container {
59459
59466
  this.previousWidth = -1;
59460
59467
  this.cursorRow = 0;
59461
59468
  this.hardwareCursorRow = 0;
59469
+ this.hardwareCursorCol = 0;
59470
+ this.hardwareCursorVisible = null;
59462
59471
  this.maxLinesRendered = 0;
59463
59472
  this.previousViewportTop = 0;
59464
59473
  }
@@ -59719,7 +59728,7 @@ var TUI = class extends Container {
59719
59728
  */
59720
59729
  positionHardwareCursor(cursorPos, totalLines) {
59721
59730
  if (!cursorPos || totalLines <= 0) {
59722
- this.terminal.hideCursor();
59731
+ this.setHardwareCursorVisible(false);
59723
59732
  return;
59724
59733
  }
59725
59734
  const targetRow = Math.max(0, Math.min(cursorPos.row, totalLines - 1));
@@ -59731,16 +59740,23 @@ var TUI = class extends Container {
59731
59740
  } else if (rowDelta < 0) {
59732
59741
  buffer += `\x1B[${-rowDelta}A`;
59733
59742
  }
59734
- buffer += `\x1B[${targetCol + 1}G`;
59743
+ if (targetCol !== this.hardwareCursorCol) {
59744
+ buffer += `\x1B[${targetCol + 1}G`;
59745
+ }
59735
59746
  if (buffer) {
59736
59747
  this.terminal.write(buffer);
59737
59748
  }
59738
59749
  this.hardwareCursorRow = targetRow;
59739
- if (this.showHardwareCursor) {
59740
- this.terminal.showCursor();
59741
- } else {
59742
- this.terminal.hideCursor();
59743
- }
59750
+ this.hardwareCursorCol = targetCol;
59751
+ this.setHardwareCursorVisible(this.showHardwareCursor);
59752
+ }
59753
+ /** Cursor visibility with byte-suppression: the show/hide escape is only
59754
+ * written on an actual transition, never per frame. */
59755
+ setHardwareCursorVisible(visible) {
59756
+ if (this.hardwareCursorVisible === visible) return;
59757
+ this.hardwareCursorVisible = visible;
59758
+ if (visible) this.terminal.showCursor();
59759
+ else this.terminal.hideCursor();
59744
59760
  }
59745
59761
  };
59746
59762
 
@@ -64319,6 +64335,10 @@ var ProcessTerminal = class {
64319
64335
  stdinBuffer;
64320
64336
  stdinDataHandler;
64321
64337
  writeLogPath = process.env.PIE_TUI_WRITE_LOG || "";
64338
+ /** Last title actually written. An identical setTitle must produce zero
64339
+ * bytes: terminals derive their activity indicator from ANY output, so a
64340
+ * repeated OSC makes a fully idle session look busy (iTerm2 tab spinner). */
64341
+ lastTitle = null;
64322
64342
  get kittyProtocolActive() {
64323
64343
  return this._kittyProtocolActive;
64324
64344
  }
@@ -64447,6 +64467,7 @@ var ProcessTerminal = class {
64447
64467
  }
64448
64468
  stop() {
64449
64469
  process.stdout.write("\x1B[?2004l");
64470
+ this.lastTitle = null;
64450
64471
  process.stdout.write("\x1B[?7h");
64451
64472
  if (this._kittyProtocolActive && !process.env.PIE_DISABLE_KITTY_PROTOCOL) {
64452
64473
  process.stdout.write("\x1B[<u");
@@ -64509,6 +64530,8 @@ var ProcessTerminal = class {
64509
64530
  process.stdout.write("\x1B[2J\x1B[H");
64510
64531
  }
64511
64532
  setTitle(title) {
64533
+ if (title === this.lastTitle) return;
64534
+ this.lastTitle = title;
64512
64535
  process.stdout.write(`\x1B]0;${title}\x07`);
64513
64536
  }
64514
64537
  notify(title, body) {
@@ -64937,7 +64960,7 @@ var ExtensionRunner = class {
64937
64960
  /**
64938
64961
  * Emit terminal:input to all extensions. Transforms chain through handlers
64939
64962
  * in registration order (each handler sees the previous transform); a
64940
- * consume result stops the chain and wins. Default: continue unchanged.
64963
+ * consume/reject result stops the chain and wins. Default: continue unchanged.
64941
64964
  */
64942
64965
  async emitTerminalInput(event) {
64943
64966
  const ctx = this.createContext();
@@ -64951,6 +64974,7 @@ var ExtensionRunner = class {
64951
64974
  const result = await handler({ ...event, text }, ctx);
64952
64975
  if (!result || typeof result !== "object" || !("action" in result)) continue;
64953
64976
  if (result.action === "consume") return { action: "consume" };
64977
+ if (result.action === "reject") return { action: "reject" };
64954
64978
  if (result.action === "transform" && typeof result.text === "string") {
64955
64979
  text = result.text;
64956
64980
  current = { action: "transform", text };
@@ -65102,6 +65126,7 @@ function wrapToolsWithExtensions(tools, runner) {
65102
65126
 
65103
65127
  // src/core/defaults.ts
65104
65128
  var DEFAULT_THINKING_LEVEL = "medium";
65129
+ var DEFAULT_YOLO_MODE = true;
65105
65130
 
65106
65131
  // src/core/model-resolver.ts
65107
65132
  function normalizeProviderName(provider) {
@@ -65377,6 +65402,7 @@ var DEFAULT_APP_KEYBINDINGS = {
65377
65402
  selectModel: "ctrl+l",
65378
65403
  expandTools: "ctrl+o",
65379
65404
  toggleThinking: "ctrl+t",
65405
+ toggleYolo: "alt+o",
65380
65406
  toggleSessionNamedFilter: "ctrl+n",
65381
65407
  externalEditor: "ctrl+g",
65382
65408
  steer: "alt+enter",
@@ -65403,6 +65429,7 @@ var APP_ACTIONS = [
65403
65429
  "selectModel",
65404
65430
  "expandTools",
65405
65431
  "toggleThinking",
65432
+ "toggleYolo",
65406
65433
  "toggleSessionNamedFilter",
65407
65434
  "externalEditor",
65408
65435
  "steer",
@@ -73371,8 +73398,31 @@ async function loadSession(host, sessionId) {
73371
73398
  }
73372
73399
  var TITLE_SPINNER_FRAMES = ["\u280B", "\u2819", "\u2839", "\u2838", "\u283C", "\u2834", "\u2826", "\u2827", "\u2807", "\u280F"];
73373
73400
  var TITLE_SPINNER_INTERVAL_MS = 80;
73401
+ var TITLE_BUSY_STALL_MS = 3e4;
73374
73402
  var TITLE_WAITING_PREFIX = "\u23F8";
73375
73403
  var titleSpinnerTimers = /* @__PURE__ */ new WeakMap();
73404
+ var titleActivityStamps = /* @__PURE__ */ new WeakMap();
73405
+ var runningToolExecutions = /* @__PURE__ */ new WeakMap();
73406
+ function noteToolExecutionStart(host, toolCallId) {
73407
+ if (!toolCallId) return;
73408
+ let set = runningToolExecutions.get(host);
73409
+ if (!set) {
73410
+ set = /* @__PURE__ */ new Set();
73411
+ runningToolExecutions.set(host, set);
73412
+ }
73413
+ set.add(toolCallId);
73414
+ }
73415
+ function noteToolExecutionEnd(host, toolCallId) {
73416
+ if (!toolCallId) return;
73417
+ runningToolExecutions.get(host)?.delete(toolCallId);
73418
+ }
73419
+ function clearRunningToolExecutions(host) {
73420
+ runningToolExecutions.get(host)?.clear();
73421
+ }
73422
+ function hasRunningToolWork(host) {
73423
+ const set = runningToolExecutions.get(host);
73424
+ return set !== void 0 && set.size > 0;
73425
+ }
73376
73426
  var explicitSubmitLockHosts = /* @__PURE__ */ new WeakSet();
73377
73427
  var controllerBusyHosts = /* @__PURE__ */ new WeakSet();
73378
73428
  var waitingForUserHosts = /* @__PURE__ */ new WeakSet();
@@ -73383,6 +73433,7 @@ function isWaitingForUser(host) {
73383
73433
  return waitingForUserHosts.has(host);
73384
73434
  }
73385
73435
  function updateTerminalTitle(host, spinnerFrame) {
73436
+ if (spinnerFrame === void 0) titleActivityStamps.set(host, Date.now());
73386
73437
  const activeSession = host.sessionManager.getActiveSession();
73387
73438
  if (!activeSession) {
73388
73439
  host.ui.terminal.setTitle("Pie");
@@ -73405,10 +73456,35 @@ function stopTitleSpinner(host) {
73405
73456
  titleSpinnerTimers.delete(host);
73406
73457
  }
73407
73458
  }
73459
+ function writeTitleStatic(host) {
73460
+ const activeSession = host.sessionManager.getActiveSession();
73461
+ if (!activeSession) {
73462
+ host.ui.terminal.setTitle("Pie");
73463
+ return;
73464
+ }
73465
+ const sessionLabel = deriveSessionTitle({
73466
+ activeSession,
73467
+ messages: host.sessionManager.getMessages()
73468
+ });
73469
+ const activityState = isWaitingForUser(host) ? "waiting" : isHostBusy(host) ? "busy" : "ready";
73470
+ host.ui.terminal.setTitle(`${isWaitingForUser(host) ? `${TITLE_WAITING_PREFIX} ` : ""}Pie \xB7 ${sessionLabel} [ms:session=${activeSession.id};state=${activityState}]`);
73471
+ }
73408
73472
  function startTitleSpinner(host) {
73409
73473
  stopTitleSpinner(host);
73410
73474
  let frameIndex = 0;
73475
+ let stalled = false;
73476
+ titleActivityStamps.set(host, Date.now());
73411
73477
  const timer = setInterval(() => {
73478
+ if (hasRunningToolWork(host)) titleActivityStamps.set(host, Date.now());
73479
+ const lastActivity = titleActivityStamps.get(host);
73480
+ if (lastActivity !== void 0 && Date.now() - lastActivity > TITLE_BUSY_STALL_MS) {
73481
+ if (!stalled) {
73482
+ stalled = true;
73483
+ writeTitleStatic(host);
73484
+ }
73485
+ return;
73486
+ }
73487
+ stalled = false;
73412
73488
  const frame = TITLE_SPINNER_FRAMES[frameIndex % TITLE_SPINNER_FRAMES.length];
73413
73489
  updateTerminalTitle(host, frame);
73414
73490
  frameIndex++;
@@ -74437,6 +74513,7 @@ function bindInteractiveRuntimeEvents(host) {
74437
74513
  host.sessionTrace.abortTurn(String(lastMessage?.errorMessage || "agent_end"));
74438
74514
  }
74439
74515
  host.isProcessing = false;
74516
+ clearRunningToolExecutions(host);
74440
74517
  revealHeldCalmStreamingComponent(host);
74441
74518
  host.streamingComponent?.finalizeStreaming?.();
74442
74519
  host.streamingComponent = void 0;
@@ -74703,6 +74780,7 @@ function removeCalmToolLines(chatContainer, pendingTools) {
74703
74780
  }
74704
74781
  function handleToolStart(host, event) {
74705
74782
  host.logDebug("tool:start", { toolName: event.toolName, toolCallId: event.toolCallId });
74783
+ noteToolExecutionStart(host, event.toolCallId);
74706
74784
  host.sessionTrace.startTool(event.toolCallId, event.toolName, event.args);
74707
74785
  if (event.toolCallId) {
74708
74786
  const toolComponent = host.pendingTools.get(event.toolCallId);
@@ -74766,6 +74844,7 @@ function handleToolUpdate(host, event) {
74766
74844
  }
74767
74845
  function handleToolEnd(host, event) {
74768
74846
  host.logDebug("tool:end", { toolName: event.toolName, toolCallId: event.toolCallId, isError: event.isError });
74847
+ noteToolExecutionEnd(host, event.toolCallId);
74769
74848
  host.sessionTrace.finishTool(event.toolCallId, event.toolName, event.result, event.isError || false);
74770
74849
  const toolComponent = event.toolCallId ? host.pendingTools.get(event.toolCallId) : void 0;
74771
74850
  if (toolComponent?.calm) {
@@ -76764,6 +76843,7 @@ function handleInterrupt(host) {
76764
76843
  await host.refreshTodoWidget();
76765
76844
  removeCalmToolLines(host.chatContainer, host.pendingTools);
76766
76845
  host.pendingTools.clear();
76846
+ clearRunningToolExecutions(host);
76767
76847
  host.ui.setFocus(host.editor);
76768
76848
  host.appendWarningSummary("\u26A0 Interrupted by user");
76769
76849
  if (abortOutcome.terminalSummary) {
@@ -76794,12 +76874,18 @@ function handleInterrupt(host) {
76794
76874
  }
76795
76875
  function handleHotkeysCommand(host) {
76796
76876
  const kb = host.keybindings;
76877
+ const extensionShortcutLines = host.extensions.flatMap(
76878
+ (ext) => Array.from(ext.shortcuts.values()).map(
76879
+ (shortcut) => ` ${shortcut.key.padEnd(12)} ${theme.fg("muted", shortcut.description)}${theme.fg("dim", " [ext]")}`
76880
+ )
76881
+ );
76797
76882
  const lines = [
76798
76883
  theme.bold(theme.fg("accent", "Keyboard Shortcuts")),
76799
76884
  "",
76800
76885
  `${theme.fg("dim", kb.getKeys("exit").join(" / "))} ${theme.fg("muted", "Exit")}`,
76801
76886
  `${theme.fg("dim", kb.getKeys("interrupt").join(" / "))} ${theme.fg("muted", "Interrupt")}`,
76802
76887
  `${theme.fg("dim", kb.getKeys("expandTools").join(" / "))} ${theme.fg("muted", "Expand/collapse tools")}`,
76888
+ `${theme.fg("dim", kb.getKeys("toggleYolo").join(" / "))} ${theme.fg("muted", "Toggle YOLO mode")}`,
76803
76889
  "",
76804
76890
  theme.fg("muted", "Editor shortcuts:"),
76805
76891
  " Enter Submit message",
@@ -76807,6 +76893,7 @@ function handleHotkeysCommand(host) {
76807
76893
  " Ctrl+J New line (fallback)",
76808
76894
  ` ${theme.fg("dim", kb.getKeys("steer").join(" / "))} ${theme.fg("muted", "Queue steering message for the active turn")}`,
76809
76895
  ` ${theme.fg("dim", kb.getKeys("dequeue").join(" / "))} ${theme.fg("muted", "Restore queued messages")}`,
76896
+ ...extensionShortcutLines.length > 0 ? ["", theme.fg("muted", "Extension shortcuts:"), ...extensionShortcutLines] : [],
76810
76897
  " / Show slash commands",
76811
76898
  " Esc Cancel autocomplete",
76812
76899
  "",
@@ -77019,6 +77106,7 @@ async function handleClearCommand(host) {
77019
77106
  host.chatContainer.clear();
77020
77107
  host.streamingComponent = void 0;
77021
77108
  host.pendingTools.clear();
77109
+ clearRunningToolExecutions(host);
77022
77110
  host.lastStatusSpacer = void 0;
77023
77111
  host.lastStatusText = void 0;
77024
77112
  host.agentSessionController?.drainQueuedInputsForEditor();
@@ -77825,6 +77913,7 @@ async function handleCompactCommand(host) {
77825
77913
  host.resetRuntimeModeBlocks?.();
77826
77914
  host.streamingComponent = void 0;
77827
77915
  host.pendingTools.clear();
77916
+ clearRunningToolExecutions(host);
77828
77917
  host.chatContainer.clear();
77829
77918
  host.lastStatusSpacer = void 0;
77830
77919
  host.lastStatusText = void 0;
@@ -77892,6 +77981,9 @@ function setupInteractiveEditorSubmitHandler(host) {
77892
77981
  if (!text) return;
77893
77982
  if (host.extensionRunner) {
77894
77983
  const decision = await host.extensionRunner.emitTerminalInput({ type: "terminal:input", text });
77984
+ if (decision.action === "reject") {
77985
+ return;
77986
+ }
77895
77987
  if (decision.action === "consume") {
77896
77988
  host.editor.setText("");
77897
77989
  return;
@@ -79960,6 +80052,10 @@ function setupInteractiveKeybindings(host) {
79960
80052
  host.toggleToolsExpansion();
79961
80053
  return { consume: true };
79962
80054
  }
80055
+ if (host.keybindings.matches(data, "toggleYolo") && mainEditorOwnsInput(host)) {
80056
+ host.toggleYoloMode?.();
80057
+ return { consume: true };
80058
+ }
79963
80059
  if (host.keybindings.matches(data, "dequeue")) {
79964
80060
  host.dequeueMessages();
79965
80061
  return { consume: true };
@@ -79972,8 +80068,9 @@ function setupInteractiveKeybindings(host) {
79972
80068
  host.handleFollowUp();
79973
80069
  return { consume: true };
79974
80070
  }
80071
+ if (!mainEditorOwnsInput(host)) return { consume: false };
79975
80072
  const shortcuts = host.getExtensionShortcuts?.();
79976
- if (shortcuts && shortcuts.size > 0 && mainEditorOwnsInput(host)) {
80073
+ if (shortcuts && shortcuts.size > 0) {
79977
80074
  for (const shortcut of shortcuts.values()) {
79978
80075
  if (matchesKey(data, shortcut.key)) {
79979
80076
  void shortcut.handler();
@@ -81732,6 +81829,7 @@ async function recoverHardStalledTurn(host, stalledMs) {
81732
81829
  host.streamingComponent = void 0;
81733
81830
  removeCalmToolLines(host.chatContainer, host.pendingTools);
81734
81831
  host.pendingTools.clear();
81832
+ clearRunningToolExecutions(host);
81735
81833
  const abortOutcome = host.executionState.abort();
81736
81834
  host.persistExecutionState();
81737
81835
  void host.refreshTodoWidget();
@@ -82139,6 +82237,7 @@ function createInteractiveAgentSessionController(host) {
82139
82237
  if (!event.result?.aborted) {
82140
82238
  host.streamingComponent = void 0;
82141
82239
  host.pendingTools.clear();
82240
+ clearRunningToolExecutions(host);
82142
82241
  host.chatContainer.clear();
82143
82242
  host.lastStatusSpacer = void 0;
82144
82243
  host.lastStatusText = void 0;
@@ -83022,7 +83121,7 @@ function beginUserInput(host, extensionIsCurrent = () => true) {
83022
83121
  }
83023
83122
  let content = [text.trim(), ...mentions].filter(Boolean).join("\n");
83024
83123
  const decision = await runner.emitTerminalInput({ type: "terminal:input", text: content });
83025
- if (!isCurrent() || decision.action === "consume") return false;
83124
+ if (!isCurrent() || decision.action === "consume" || decision.action === "reject") return false;
83026
83125
  if (decision.action === "transform") content = decision.text.trim();
83027
83126
  if (!content || mentions.some((mention) => !content.includes(mention))) return false;
83028
83127
  host.queueMessage(content, "followUp", { clearEditor: false, deliverWhileStreaming: false });
@@ -83329,6 +83428,7 @@ var InteractiveMode = class {
83329
83428
  knowledgeSection = "";
83330
83429
  extensions = [];
83331
83430
  extensionRunner;
83431
+ extensionShortcutsCache;
83332
83432
  extensionUIContext;
83333
83433
  allTools = [];
83334
83434
  streamingComponent;
@@ -83355,7 +83455,7 @@ var InteractiveMode = class {
83355
83455
  mentionPickerComponent;
83356
83456
  mentionPickerOptions = [];
83357
83457
  attachmentResolver;
83358
- yoloMode = false;
83458
+ yoloMode = DEFAULT_YOLO_MODE;
83359
83459
  yoloGrant = new YoloGrantTracker();
83360
83460
  // time-boxed confirm-dialog grant ("Yolo (5 min)")
83361
83461
  pristineTools = [];
@@ -83672,7 +83772,7 @@ var InteractiveMode = class {
83672
83772
  async init() {
83673
83773
  const activeSession = this.sessionManager.getActiveSession();
83674
83774
  this.thinkingLevel = resolveInitialThinkingLevel({ session: activeSession, settingsManager: this.options.settingsManager });
83675
- const { Agent } = await import("./chunks/src-IY6TEIL7.js");
83775
+ const { Agent } = await import("./chunks/src-GX4UBAYF.js");
83676
83776
  this.agent = new Agent({
83677
83777
  initialState: {
83678
83778
  systemPrompt: this.buildSystemPrompt(),
@@ -83709,6 +83809,7 @@ var InteractiveMode = class {
83709
83809
  this.setupKeybindings();
83710
83810
  this.registerBuiltinCommands();
83711
83811
  await this.loadExtensions();
83812
+ if (this.yoloMode) this.applyRuntimeToolMode();
83712
83813
  await this.syncSessionScopedState();
83713
83814
  void this.emitExtensionEvent({ type: "agent:start" });
83714
83815
  this.setupAutocomplete();
@@ -83998,6 +84099,9 @@ var InteractiveMode = class {
83998
84099
  ];
83999
84100
  return interactiveCommands.some((cmd) => commandPath.startsWith(cmd));
84000
84101
  }
84102
+ toggleYoloMode() {
84103
+ void this.handleYoloCommand();
84104
+ }
84001
84105
  toggleToolsExpansion() {
84002
84106
  if (this.calmMode) {
84003
84107
  this.setCalmMode(false);
@@ -84016,17 +84120,22 @@ var InteractiveMode = class {
84016
84120
  * dispatcher (duck-typed onto InteractiveKeybindingsHost). Handlers are
84017
84121
  * bound to the extension runner context here. */
84018
84122
  getExtensionShortcuts() {
84123
+ const cached = this.extensionShortcutsCache;
84124
+ if (cached && cached.extensions === this.extensions && cached.runner === this.extensionRunner) {
84125
+ return cached.shortcuts;
84126
+ }
84019
84127
  const merged = /* @__PURE__ */ new Map();
84128
+ const context = this.extensionRunner?.createContext();
84020
84129
  for (const extension of this.extensions) {
84021
84130
  for (const [key, shortcut] of extension.shortcuts) {
84022
84131
  if (merged.has(key)) continue;
84023
- const context = this.extensionRunner?.createContext();
84024
84132
  merged.set(key, {
84025
84133
  key,
84026
84134
  handler: () => shortcut.handler(context)
84027
84135
  });
84028
84136
  }
84029
84137
  }
84138
+ this.extensionShortcutsCache = { extensions: this.extensions, runner: this.extensionRunner, shortcuts: merged };
84030
84139
  return merged;
84031
84140
  }
84032
84141
  /** Live mention handler for extension-driven attachments (duck-typed onto
@@ -84556,7 +84665,7 @@ async function runPrintMode(params) {
84556
84665
  `);
84557
84666
  console.log("Assistant: ");
84558
84667
  }
84559
- const { Agent: AgentClass } = await import("./chunks/src-IY6TEIL7.js");
84668
+ const { Agent: AgentClass } = await import("./chunks/src-GX4UBAYF.js");
84560
84669
  let agent;
84561
84670
  const printModeExtensions = await loadPrintModeExtensions({
84562
84671
  cwd: runtime.cwd,
@@ -85451,7 +85560,7 @@ async function runJsonEventsMode(params) {
85451
85560
  const sideTrace = trace;
85452
85561
  const sideApiKey = runtime.apiKey;
85453
85562
  const snapshot = structuredClone(parent.state.messages);
85454
- const { Agent: AgentClass } = await import("./chunks/src-IY6TEIL7.js");
85563
+ const { Agent: AgentClass } = await import("./chunks/src-GX4UBAYF.js");
85455
85564
  const sideAgent = new AgentClass({
85456
85565
  initialState: {
85457
85566
  systemPrompt: parent.state.systemPrompt,
@@ -85815,7 +85924,7 @@ async function runJsonEventsMode(params) {
85815
85924
  if (runtime.initialModel.unconfigured || controller) {
85816
85925
  return;
85817
85926
  }
85818
- const { Agent: AgentClass } = await import("./chunks/src-IY6TEIL7.js");
85927
+ const { Agent: AgentClass } = await import("./chunks/src-GX4UBAYF.js");
85819
85928
  if (runtimeClosing) return;
85820
85929
  const compositionRegistry = createCliHostEnvelopeRegistry();
85821
85930
  const jsonModeExtensions = await loadJsonModeExtensions({ runtime, envelopeRegistry: compositionRegistry, getAgent: () => agent });
@@ -86503,7 +86612,7 @@ async function runWithJsonEventsConsoleIsolation(fn) {
86503
86612
  }
86504
86613
  async function createCliTestStreamFnFromEnv() {
86505
86614
  if (!process.env.PIE_TEST_MOCK_STREAM_SEQUENCE) return void 0;
86506
- return (await import("./chunks/test-stream-EXSL5TIO.js")).createTestStreamFnFromSequenceEnv();
86615
+ return (await import("./chunks/test-stream-AKIZNFCM.js")).createTestStreamFnFromSequenceEnv();
86507
86616
  }
86508
86617
  function resolveJsonEventsDetailFlag() {
86509
86618
  for (let index = 0; index < process.argv.length; index += 1) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cydm/pie",
3
- "version": "2.7.15",
3
+ "version": "2.7.17",
4
4
  "description": "Pie AI Agent CLI",
5
5
  "type": "module",
6
6
  "bin": {