lsd-pi 1.3.6 → 1.3.7

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.
Files changed (83) hide show
  1. package/dist/cli.js +2 -1
  2. package/dist/lsd-settings-manager.d.ts +2 -0
  3. package/dist/lsd-settings-manager.js +5 -0
  4. package/dist/resource-loader.js +33 -3
  5. package/dist/resources/extensions/cache-timer/index.js +3 -2
  6. package/dist/welcome-screen.js +2 -2
  7. package/package.json +1 -1
  8. package/packages/pi-coding-agent/dist/core/settings-manager.collapse-tool-calls.test.d.ts +2 -0
  9. package/packages/pi-coding-agent/dist/core/settings-manager.collapse-tool-calls.test.d.ts.map +1 -0
  10. package/packages/pi-coding-agent/dist/core/settings-manager.collapse-tool-calls.test.js +35 -0
  11. package/packages/pi-coding-agent/dist/core/settings-manager.collapse-tool-calls.test.js.map +1 -0
  12. package/packages/pi-coding-agent/dist/core/settings-manager.d.ts +6 -0
  13. package/packages/pi-coding-agent/dist/core/settings-manager.d.ts.map +1 -1
  14. package/packages/pi-coding-agent/dist/core/settings-manager.js +12 -0
  15. package/packages/pi-coding-agent/dist/core/settings-manager.js.map +1 -1
  16. package/packages/pi-coding-agent/dist/core/tools/edit-diff.d.ts +5 -0
  17. package/packages/pi-coding-agent/dist/core/tools/edit-diff.d.ts.map +1 -1
  18. package/packages/pi-coding-agent/dist/core/tools/edit-diff.js +21 -0
  19. package/packages/pi-coding-agent/dist/core/tools/edit-diff.js.map +1 -1
  20. package/packages/pi-coding-agent/dist/core/tools/edit-diff.test.js +16 -1
  21. package/packages/pi-coding-agent/dist/core/tools/edit-diff.test.js.map +1 -1
  22. package/packages/pi-coding-agent/dist/modes/interactive/components/__tests__/tool-summary-line.test.js +12 -4
  23. package/packages/pi-coding-agent/dist/modes/interactive/components/__tests__/tool-summary-line.test.js.map +1 -1
  24. package/packages/pi-coding-agent/dist/modes/interactive/components/diff.d.ts +7 -5
  25. package/packages/pi-coding-agent/dist/modes/interactive/components/diff.d.ts.map +1 -1
  26. package/packages/pi-coding-agent/dist/modes/interactive/components/diff.js +86 -28
  27. package/packages/pi-coding-agent/dist/modes/interactive/components/diff.js.map +1 -1
  28. package/packages/pi-coding-agent/dist/modes/interactive/components/footer.d.ts +2 -0
  29. package/packages/pi-coding-agent/dist/modes/interactive/components/footer.d.ts.map +1 -1
  30. package/packages/pi-coding-agent/dist/modes/interactive/components/footer.js +16 -10
  31. package/packages/pi-coding-agent/dist/modes/interactive/components/footer.js.map +1 -1
  32. package/packages/pi-coding-agent/dist/modes/interactive/components/settings-selector.d.ts +4 -0
  33. package/packages/pi-coding-agent/dist/modes/interactive/components/settings-selector.d.ts.map +1 -1
  34. package/packages/pi-coding-agent/dist/modes/interactive/components/settings-selector.js +26 -4
  35. package/packages/pi-coding-agent/dist/modes/interactive/components/settings-selector.js.map +1 -1
  36. package/packages/pi-coding-agent/dist/modes/interactive/components/tool-execution.d.ts +14 -1
  37. package/packages/pi-coding-agent/dist/modes/interactive/components/tool-execution.d.ts.map +1 -1
  38. package/packages/pi-coding-agent/dist/modes/interactive/components/tool-execution.js +111 -12
  39. package/packages/pi-coding-agent/dist/modes/interactive/components/tool-execution.js.map +1 -1
  40. package/packages/pi-coding-agent/dist/modes/interactive/components/tool-summary-line.d.ts +1 -0
  41. package/packages/pi-coding-agent/dist/modes/interactive/components/tool-summary-line.d.ts.map +1 -1
  42. package/packages/pi-coding-agent/dist/modes/interactive/components/tool-summary-line.js +47 -3
  43. package/packages/pi-coding-agent/dist/modes/interactive/components/tool-summary-line.js.map +1 -1
  44. package/packages/pi-coding-agent/dist/modes/interactive/controllers/__tests__/chat-controller.collapsed-tool-summary.test.js +137 -6
  45. package/packages/pi-coding-agent/dist/modes/interactive/controllers/__tests__/chat-controller.collapsed-tool-summary.test.js.map +1 -1
  46. package/packages/pi-coding-agent/dist/modes/interactive/controllers/chat-controller.d.ts.map +1 -1
  47. package/packages/pi-coding-agent/dist/modes/interactive/controllers/chat-controller.js +40 -14
  48. package/packages/pi-coding-agent/dist/modes/interactive/controllers/chat-controller.js.map +1 -1
  49. package/packages/pi-coding-agent/dist/modes/interactive/controllers/extension-ui-controller.js +1 -1
  50. package/packages/pi-coding-agent/dist/modes/interactive/controllers/extension-ui-controller.js.map +1 -1
  51. package/packages/pi-coding-agent/dist/modes/interactive/interactive-mode-state.d.ts +1 -0
  52. package/packages/pi-coding-agent/dist/modes/interactive/interactive-mode-state.d.ts.map +1 -1
  53. package/packages/pi-coding-agent/dist/modes/interactive/interactive-mode-state.js.map +1 -1
  54. package/packages/pi-coding-agent/dist/modes/interactive/interactive-mode.d.ts +5 -1
  55. package/packages/pi-coding-agent/dist/modes/interactive/interactive-mode.d.ts.map +1 -1
  56. package/packages/pi-coding-agent/dist/modes/interactive/interactive-mode.js +70 -25
  57. package/packages/pi-coding-agent/dist/modes/interactive/interactive-mode.js.map +1 -1
  58. package/packages/pi-coding-agent/dist/modes/interactive/theme/themes.js +4 -4
  59. package/packages/pi-coding-agent/dist/modes/interactive/theme/themes.js.map +1 -1
  60. package/packages/pi-coding-agent/package.json +1 -1
  61. package/packages/pi-coding-agent/src/core/settings-manager.collapse-tool-calls.test.ts +46 -0
  62. package/packages/pi-coding-agent/src/core/settings-manager.ts +18 -0
  63. package/packages/pi-coding-agent/src/core/tools/edit-diff.test.ts +20 -0
  64. package/packages/pi-coding-agent/src/core/tools/edit-diff.ts +26 -0
  65. package/packages/pi-coding-agent/src/modes/interactive/components/__tests__/tool-summary-line.test.ts +14 -4
  66. package/packages/pi-coding-agent/src/modes/interactive/components/diff.ts +105 -28
  67. package/packages/pi-coding-agent/src/modes/interactive/components/footer.ts +13 -6
  68. package/packages/pi-coding-agent/src/modes/interactive/components/settings-selector.ts +31 -4
  69. package/packages/pi-coding-agent/src/modes/interactive/components/tool-execution.ts +119 -13
  70. package/packages/pi-coding-agent/src/modes/interactive/components/tool-summary-line.ts +59 -3
  71. package/packages/pi-coding-agent/src/modes/interactive/controllers/__tests__/chat-controller.collapsed-tool-summary.test.ts +174 -6
  72. package/packages/pi-coding-agent/src/modes/interactive/controllers/chat-controller.ts +50 -14
  73. package/packages/pi-coding-agent/src/modes/interactive/controllers/extension-ui-controller.ts +1 -1
  74. package/packages/pi-coding-agent/src/modes/interactive/interactive-mode-state.ts +1 -0
  75. package/packages/pi-coding-agent/src/modes/interactive/interactive-mode.ts +73 -25
  76. package/packages/pi-coding-agent/src/modes/interactive/theme/themes.ts +4 -4
  77. package/packages/pi-tui/dist/components/editor.js +3 -3
  78. package/packages/pi-tui/dist/components/editor.js.map +1 -1
  79. package/packages/pi-tui/src/components/editor.ts +3 -3
  80. package/pkg/dist/modes/interactive/theme/themes.js +4 -4
  81. package/pkg/dist/modes/interactive/theme/themes.js.map +1 -1
  82. package/pkg/package.json +1 -1
  83. package/src/resources/extensions/cache-timer/index.ts +3 -2
@@ -53,7 +53,7 @@ export function createExtensionUIContext(host: any): ExtensionUIContext {
53
53
  }
54
54
  return result;
55
55
  },
56
- getToolsExpanded: () => host.toolOutputExpanded,
56
+ getToolsExpanded: () => host.collapsedToolCallsExpanded || host.toolOutputExpanded,
57
57
  setToolsExpanded: (expanded) => host.setToolsExpanded(expanded),
58
58
  };
59
59
  }
@@ -12,6 +12,7 @@ export interface InteractiveModeStateHost {
12
12
  settingsManager: any;
13
13
  pendingTools: Map<string, any>;
14
14
  collapsedToolSummaryLine?: any;
15
+ collapsedToolCallsExpanded: boolean;
15
16
  toolOutputExpanded: boolean;
16
17
  hideThinkingBlock: boolean;
17
18
  notificationSoundEnabled: boolean;
@@ -325,6 +325,7 @@ export class InteractiveMode {
325
325
  private agentPtyComponents = new Map<string, EmbeddedTerminalComponent>();
326
326
 
327
327
  // Tool output expansion state
328
+ private collapsedToolCallsExpanded = false;
328
329
  private toolOutputExpanded = false;
329
330
 
330
331
  // Thinking block visibility state
@@ -444,6 +445,7 @@ export class InteractiveMode {
444
445
  // Load notification sound setting
445
446
  this.notificationSoundEnabled = this.settingsManager.getNotificationSound();
446
447
  this.footer.setNotificationSoundEnabled(this.notificationSoundEnabled);
448
+ this.footer.setVerboseFooterEnabled(this.settingsManager.getVerboseFooter());
447
449
 
448
450
  // Register themes from resource loader and initialize
449
451
  setRegisteredThemes(this.session.resourceLoader.getThemes().themes);
@@ -2358,6 +2360,7 @@ export class InteractiveMode {
2358
2360
  if (wasBashMode !== this.isBashMode) {
2359
2361
  this.updateEditorBorderColor();
2360
2362
  }
2363
+ this.updateEditorExpandHint();
2361
2364
  };
2362
2365
 
2363
2366
  // Handle clipboard image paste (triggered on Ctrl+V)
@@ -3072,63 +3075,92 @@ export class InteractiveMode {
3072
3075
  }
3073
3076
  }
3074
3077
 
3078
+ private hasCollapsedToolCallSummaries(): boolean {
3079
+ return this.chatContainer.children.some((child) => child instanceof ToolSummaryLine);
3080
+ }
3081
+
3082
+ private shouldUseCollapsedToolCallIntermediateState(): boolean {
3083
+ return this.settingsManager.getCollapseToolCalls() && this.hasCollapsedToolCallSummaries();
3084
+ }
3085
+
3075
3086
  private toggleToolOutputExpansion(): void {
3076
- this.setToolsExpanded(!this.toolOutputExpanded);
3087
+ if (this.toolOutputExpanded) {
3088
+ this.setToolOutputExpansionState(false, false);
3089
+ return;
3090
+ }
3091
+ if (this.shouldUseCollapsedToolCallIntermediateState() && !this.collapsedToolCallsExpanded) {
3092
+ this.setToolOutputExpansionState(true, false);
3093
+ return;
3094
+ }
3095
+ this.setToolOutputExpansionState(true, true);
3077
3096
  }
3078
3097
 
3079
3098
  private setToolsExpanded(expanded: boolean): void {
3080
- this.toolOutputExpanded = expanded;
3099
+ this.setToolOutputExpansionState(expanded, expanded);
3100
+ }
3101
+
3102
+ private setToolOutputExpansionState(collapsedToolCallsExpanded: boolean, toolOutputExpanded: boolean): void {
3103
+ this.collapsedToolCallsExpanded = collapsedToolCallsExpanded || toolOutputExpanded;
3104
+ this.toolOutputExpanded = toolOutputExpanded;
3105
+ const collapseToolCalls = this.settingsManager.getCollapseToolCalls();
3106
+ const showCollapsedToolCalls = collapseToolCalls && this.collapsedToolCallsExpanded;
3081
3107
  for (const child of this.chatContainer.children) {
3082
3108
  if (isExpandable(child)) {
3083
- child.setExpanded(expanded);
3109
+ child.setExpanded(toolOutputExpanded);
3084
3110
  }
3085
3111
  if (child instanceof ToolExecutionComponent) {
3086
- child.setHidden(!expanded && child.shouldHideWhenCollapsed());
3112
+ child.setHidden(!showCollapsedToolCalls && child.shouldHideWhenCollapsed(collapseToolCalls));
3087
3113
  }
3088
3114
  if (child instanceof ToolSummaryLine) {
3089
- child.setHidden(expanded);
3115
+ child.setHidden(!collapseToolCalls || showCollapsedToolCalls);
3090
3116
  }
3091
3117
  }
3092
3118
  if (this.bashComponent) {
3093
- this.bashComponent.setExpanded(expanded);
3119
+ this.bashComponent.setExpanded(toolOutputExpanded);
3094
3120
  }
3095
3121
  for (const component of this.pendingBashComponents) {
3096
- component.setExpanded(expanded);
3122
+ component.setExpanded(toolOutputExpanded);
3097
3123
  }
3098
3124
  this.updateEditorExpandHint();
3099
3125
  this.ui.requestRender();
3100
3126
  }
3101
3127
 
3102
- /** Append/remove the "ctrl+o to expand" hint in the editor bottom border. */
3128
+ /** Append/remove right-aligned expand and streaming hints in editor bottom border. */
3103
3129
  updateEditorExpandHint(): void {
3104
3130
  const expandKey = appKey(this.keybindings, "expandTools");
3105
3131
  const collapseHint = `${theme.fg("dim", expandKey)}${theme.fg("muted", " collapse")}`;
3106
- const expandHint = `${theme.fg("dim", expandKey)}${theme.fg("muted", " : verbose")}`;
3107
- // The base hint set during agent_start
3108
- const enterKey = theme.fg("dim", "↵");
3109
- const followUpKey = theme.fg("dim", appKey(this.keybindings, "followUp"));
3110
- const steerLabel = theme.fg("muted", " steer");
3111
- const queueLabel = theme.fg("muted", " queue");
3112
- const baseHint = `${enterKey}${steerLabel} ${followUpKey}${queueLabel}`;
3132
+ const expandToolCallsHint = `${theme.fg("dim", expandKey)}${theme.fg("muted", " : uncollapsed tools")}`;
3133
+ const expandVerboseHint = `${theme.fg("dim", expandKey)}${theme.fg("muted", " : verbose")}`;
3134
+ const editorHasText = this.defaultEditor.getText().trim().length > 0;
3135
+ const streamingHints = editorHasText
3136
+ ? `${theme.fg("dim", "↵")}${theme.fg("muted", " steer")} ${theme.fg("dim", appKey(this.keybindings, "followUp"))}${theme.fg("muted", " queue")}`
3137
+ : "";
3113
3138
 
3114
3139
  // Check if there are any expandable tool outputs in the chat
3115
3140
  const hasToolOutputs =
3116
3141
  this.chatContainer.children.some(isExpandable) ||
3117
3142
  !!this.bashComponent ||
3118
3143
  this.pendingBashComponents.length > 0;
3144
+ const canExpandCollapsedToolCalls = this.shouldUseCollapsedToolCallIntermediateState();
3119
3145
 
3120
- const activeHint = this.toolOutputExpanded ? collapseHint : expandHint;
3146
+ let activeHint = expandVerboseHint;
3147
+ if (this.toolOutputExpanded) {
3148
+ activeHint = collapseHint;
3149
+ } else if (this.collapsedToolCallsExpanded && canExpandCollapsedToolCalls) {
3150
+ activeHint = expandVerboseHint;
3151
+ } else if (canExpandCollapsedToolCalls) {
3152
+ activeHint = expandToolCallsHint;
3153
+ }
3121
3154
 
3122
- if (this.loadingAnimation) {
3123
- // Agent is running - always show expand/collapse hint when there are tool outputs
3124
- this.defaultEditor.bottomHint = hasToolOutputs
3125
- ? `${baseHint} ${activeHint}`
3126
- : baseHint;
3127
- } else if (hasToolOutputs) {
3128
- // Idle - show expand/collapse hint so user knows ctrl+o works
3129
- this.defaultEditor.bottomHint = activeHint;
3155
+ const rightHints: string[] = [];
3156
+ if (this.loadingAnimation && streamingHints) {
3157
+ rightHints.push(streamingHints);
3130
3158
  }
3131
- // If no tool outputs and idle, leave bottomHint as-is (cleared by agent_end)
3159
+ if (hasToolOutputs) {
3160
+ rightHints.push(activeHint);
3161
+ }
3162
+
3163
+ this.defaultEditor.bottomHint = rightHints.join(" ");
3132
3164
  }
3133
3165
 
3134
3166
  private toggleThinkingBlockVisibility(): void {
@@ -3481,6 +3513,7 @@ export class InteractiveMode {
3481
3513
  codexRotate: this.settingsManager.getCodexRotate(),
3482
3514
  fastMode: this.settingsManager.getFastMode(),
3483
3515
  cacheTimer: this.settingsManager.getCacheTimer(),
3516
+ verboseFooter: this.settingsManager.getVerboseFooter(),
3484
3517
  pinLastPrompt: this.settingsManager.getPinLastPrompt(),
3485
3518
  steeringMode: this.session.steeringMode,
3486
3519
  followUpMode: this.session.followUpMode,
@@ -3505,6 +3538,7 @@ export class InteractiveMode {
3505
3538
  clearOnShrink: this.settingsManager.getClearOnShrink(),
3506
3539
  timestampFormat: this.settingsManager.getTimestampFormat(),
3507
3540
  toolOutputMode: this.settingsManager.getToolOutputMode(),
3541
+ collapseToolCalls: this.settingsManager.getCollapseToolCalls(),
3508
3542
  rtk: this.settingsManager.getRtk(),
3509
3543
  editorScheme: this.settingsManager.getEditorScheme(),
3510
3544
  autoDream: this.settingsManager.getAutoDream(),
@@ -3688,6 +3722,12 @@ export class InteractiveMode {
3688
3722
  this.settingsManager.setCacheTimer(enabled);
3689
3723
  this.showStatus(`Cache timer: ${enabled ? "enabled" : "disabled"}`);
3690
3724
  },
3725
+ onVerboseFooterChange: (enabled) => {
3726
+ this.settingsManager.setVerboseFooter(enabled);
3727
+ this.footer.setVerboseFooterEnabled(enabled);
3728
+ this.ui.requestRender();
3729
+ this.showStatus(`Verbose footer: ${enabled ? "enabled" : "disabled"}`);
3730
+ },
3691
3731
  onPinLastPromptChange: (enabled) => {
3692
3732
  this.settingsManager.setPinLastPrompt(enabled);
3693
3733
  this.pinLastPromptEnabled = enabled;
@@ -3827,6 +3867,14 @@ export class InteractiveMode {
3827
3867
  this.settingsManager.setEditorScheme(scheme);
3828
3868
  this.showStatus(`Editor link scheme: ${scheme}`);
3829
3869
  },
3870
+ onCollapseToolCallsChange: (enabled) => {
3871
+ this.settingsManager.setCollapseToolCalls(enabled);
3872
+ this.setToolOutputExpansionState(enabled && (this.collapsedToolCallsExpanded || this.toolOutputExpanded), this.toolOutputExpanded);
3873
+ if (!enabled) {
3874
+ this.collapsedToolSummaryLine = undefined;
3875
+ }
3876
+ this.showStatus(`Collapse tool calls: ${enabled ? "enabled" : "disabled"}`);
3877
+ },
3830
3878
  onToolOutputModeChange: (mode) => {
3831
3879
  this.settingsManager.setToolOutputMode(mode);
3832
3880
  for (const child of this.chatContainer.children) {
@@ -78,8 +78,8 @@ const dark: ThemeJson = {
78
78
  mdHr: "gray",
79
79
  mdListBullet: "accent",
80
80
 
81
- toolDiffAdded: "green",
82
- toolDiffRemoved: "red",
81
+ toolDiffAdded: "#4ade80",
82
+ toolDiffRemoved: "#fb7185",
83
83
  toolDiffContext: "gray",
84
84
 
85
85
  syntaxComment: "#6A9955",
@@ -174,8 +174,8 @@ const light: ThemeJson = {
174
174
  mdHr: "mediumGray",
175
175
  mdListBullet: "green",
176
176
 
177
- toolDiffAdded: "green",
178
- toolDiffRemoved: "red",
177
+ toolDiffAdded: "#15803d",
178
+ toolDiffRemoved: "#b91c1c",
179
179
  toolDiffContext: "mediumGray",
180
180
 
181
181
  syntaxComment: "#008000",
@@ -343,15 +343,15 @@ export class Editor {
343
343
  result.push(this.borderColor(indicator + "─".repeat(Math.max(0, remaining))));
344
344
  }
345
345
  else if (this.bottomHint) {
346
- // Embed hint right-aligned in the bottom border: ─────── hint ─
346
+ // Embed hint at far right in bottom border: ─────────────── hint ─
347
347
  // Apply borderColor only to the dashes so the hint's own styling is preserved.
348
348
  const hintVisible = visibleWidth(this.bottomHint);
349
349
  const minDashes = 1;
350
350
  const separatorWidth = 1; // single space on each side of hint
351
351
  const totalFixed = hintVisible + separatorWidth * 2 + minDashes * 2;
352
352
  if (width >= totalFixed) {
353
- const leftDashes = Math.floor((width - hintVisible - separatorWidth * 2) * 0.75);
354
- const rightDashes = Math.max(minDashes, width - hintVisible - separatorWidth * 2 - leftDashes);
353
+ const rightDashes = minDashes;
354
+ const leftDashes = Math.max(minDashes, width - hintVisible - separatorWidth * 2 - rightDashes);
355
355
  const line = this.borderColor("─".repeat(leftDashes)) +
356
356
  " " +
357
357
  this.bottomHint +