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.
- package/dist/cli.js +2 -1
- package/dist/lsd-settings-manager.d.ts +2 -0
- package/dist/lsd-settings-manager.js +5 -0
- package/dist/resource-loader.js +33 -3
- package/dist/resources/extensions/cache-timer/index.js +3 -2
- package/dist/welcome-screen.js +2 -2
- package/package.json +1 -1
- package/packages/pi-coding-agent/dist/core/settings-manager.collapse-tool-calls.test.d.ts +2 -0
- package/packages/pi-coding-agent/dist/core/settings-manager.collapse-tool-calls.test.d.ts.map +1 -0
- package/packages/pi-coding-agent/dist/core/settings-manager.collapse-tool-calls.test.js +35 -0
- package/packages/pi-coding-agent/dist/core/settings-manager.collapse-tool-calls.test.js.map +1 -0
- package/packages/pi-coding-agent/dist/core/settings-manager.d.ts +6 -0
- package/packages/pi-coding-agent/dist/core/settings-manager.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/core/settings-manager.js +12 -0
- package/packages/pi-coding-agent/dist/core/settings-manager.js.map +1 -1
- package/packages/pi-coding-agent/dist/core/tools/edit-diff.d.ts +5 -0
- package/packages/pi-coding-agent/dist/core/tools/edit-diff.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/core/tools/edit-diff.js +21 -0
- package/packages/pi-coding-agent/dist/core/tools/edit-diff.js.map +1 -1
- package/packages/pi-coding-agent/dist/core/tools/edit-diff.test.js +16 -1
- package/packages/pi-coding-agent/dist/core/tools/edit-diff.test.js.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/components/__tests__/tool-summary-line.test.js +12 -4
- package/packages/pi-coding-agent/dist/modes/interactive/components/__tests__/tool-summary-line.test.js.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/components/diff.d.ts +7 -5
- package/packages/pi-coding-agent/dist/modes/interactive/components/diff.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/components/diff.js +86 -28
- package/packages/pi-coding-agent/dist/modes/interactive/components/diff.js.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/components/footer.d.ts +2 -0
- package/packages/pi-coding-agent/dist/modes/interactive/components/footer.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/components/footer.js +16 -10
- package/packages/pi-coding-agent/dist/modes/interactive/components/footer.js.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/components/settings-selector.d.ts +4 -0
- package/packages/pi-coding-agent/dist/modes/interactive/components/settings-selector.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/components/settings-selector.js +26 -4
- package/packages/pi-coding-agent/dist/modes/interactive/components/settings-selector.js.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/components/tool-execution.d.ts +14 -1
- package/packages/pi-coding-agent/dist/modes/interactive/components/tool-execution.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/components/tool-execution.js +111 -12
- package/packages/pi-coding-agent/dist/modes/interactive/components/tool-execution.js.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/components/tool-summary-line.d.ts +1 -0
- package/packages/pi-coding-agent/dist/modes/interactive/components/tool-summary-line.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/components/tool-summary-line.js +47 -3
- package/packages/pi-coding-agent/dist/modes/interactive/components/tool-summary-line.js.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/controllers/__tests__/chat-controller.collapsed-tool-summary.test.js +137 -6
- package/packages/pi-coding-agent/dist/modes/interactive/controllers/__tests__/chat-controller.collapsed-tool-summary.test.js.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/controllers/chat-controller.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/controllers/chat-controller.js +40 -14
- package/packages/pi-coding-agent/dist/modes/interactive/controllers/chat-controller.js.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/controllers/extension-ui-controller.js +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/controllers/extension-ui-controller.js.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/interactive-mode-state.d.ts +1 -0
- package/packages/pi-coding-agent/dist/modes/interactive/interactive-mode-state.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/interactive-mode-state.js.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/interactive-mode.d.ts +5 -1
- package/packages/pi-coding-agent/dist/modes/interactive/interactive-mode.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/interactive-mode.js +70 -25
- package/packages/pi-coding-agent/dist/modes/interactive/interactive-mode.js.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/theme/themes.js +4 -4
- package/packages/pi-coding-agent/dist/modes/interactive/theme/themes.js.map +1 -1
- package/packages/pi-coding-agent/package.json +1 -1
- package/packages/pi-coding-agent/src/core/settings-manager.collapse-tool-calls.test.ts +46 -0
- package/packages/pi-coding-agent/src/core/settings-manager.ts +18 -0
- package/packages/pi-coding-agent/src/core/tools/edit-diff.test.ts +20 -0
- package/packages/pi-coding-agent/src/core/tools/edit-diff.ts +26 -0
- package/packages/pi-coding-agent/src/modes/interactive/components/__tests__/tool-summary-line.test.ts +14 -4
- package/packages/pi-coding-agent/src/modes/interactive/components/diff.ts +105 -28
- package/packages/pi-coding-agent/src/modes/interactive/components/footer.ts +13 -6
- package/packages/pi-coding-agent/src/modes/interactive/components/settings-selector.ts +31 -4
- package/packages/pi-coding-agent/src/modes/interactive/components/tool-execution.ts +119 -13
- package/packages/pi-coding-agent/src/modes/interactive/components/tool-summary-line.ts +59 -3
- package/packages/pi-coding-agent/src/modes/interactive/controllers/__tests__/chat-controller.collapsed-tool-summary.test.ts +174 -6
- package/packages/pi-coding-agent/src/modes/interactive/controllers/chat-controller.ts +50 -14
- package/packages/pi-coding-agent/src/modes/interactive/controllers/extension-ui-controller.ts +1 -1
- package/packages/pi-coding-agent/src/modes/interactive/interactive-mode-state.ts +1 -0
- package/packages/pi-coding-agent/src/modes/interactive/interactive-mode.ts +73 -25
- package/packages/pi-coding-agent/src/modes/interactive/theme/themes.ts +4 -4
- package/packages/pi-tui/dist/components/editor.js +3 -3
- package/packages/pi-tui/dist/components/editor.js.map +1 -1
- package/packages/pi-tui/src/components/editor.ts +3 -3
- package/pkg/dist/modes/interactive/theme/themes.js +4 -4
- package/pkg/dist/modes/interactive/theme/themes.js.map +1 -1
- package/pkg/package.json +1 -1
- package/src/resources/extensions/cache-timer/index.ts +3 -2
package/packages/pi-coding-agent/src/modes/interactive/controllers/extension-ui-controller.ts
CHANGED
|
@@ -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
|
-
|
|
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.
|
|
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(
|
|
3109
|
+
child.setExpanded(toolOutputExpanded);
|
|
3084
3110
|
}
|
|
3085
3111
|
if (child instanceof ToolExecutionComponent) {
|
|
3086
|
-
child.setHidden(!
|
|
3112
|
+
child.setHidden(!showCollapsedToolCalls && child.shouldHideWhenCollapsed(collapseToolCalls));
|
|
3087
3113
|
}
|
|
3088
3114
|
if (child instanceof ToolSummaryLine) {
|
|
3089
|
-
child.setHidden(
|
|
3115
|
+
child.setHidden(!collapseToolCalls || showCollapsedToolCalls);
|
|
3090
3116
|
}
|
|
3091
3117
|
}
|
|
3092
3118
|
if (this.bashComponent) {
|
|
3093
|
-
this.bashComponent.setExpanded(
|
|
3119
|
+
this.bashComponent.setExpanded(toolOutputExpanded);
|
|
3094
3120
|
}
|
|
3095
3121
|
for (const component of this.pendingBashComponents) {
|
|
3096
|
-
component.setExpanded(
|
|
3122
|
+
component.setExpanded(toolOutputExpanded);
|
|
3097
3123
|
}
|
|
3098
3124
|
this.updateEditorExpandHint();
|
|
3099
3125
|
this.ui.requestRender();
|
|
3100
3126
|
}
|
|
3101
3127
|
|
|
3102
|
-
/** Append/remove
|
|
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
|
|
3107
|
-
|
|
3108
|
-
const
|
|
3109
|
-
const
|
|
3110
|
-
|
|
3111
|
-
|
|
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
|
-
|
|
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
|
-
|
|
3123
|
-
|
|
3124
|
-
|
|
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
|
-
|
|
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: "
|
|
82
|
-
toolDiffRemoved: "
|
|
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: "
|
|
178
|
-
toolDiffRemoved: "
|
|
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
|
|
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
|
|
354
|
-
const
|
|
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 +
|