@astralyn/pi 0.84.10 → 0.84.12
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/CHANGELOG.md +27 -0
- package/dist/cli/startup-ui.d.ts.map +1 -1
- package/dist/cli/startup-ui.js +2 -1
- package/dist/cli/startup-ui.js.map +1 -1
- package/dist/core/agent-session.d.ts +62 -8
- package/dist/core/agent-session.d.ts.map +1 -1
- package/dist/core/agent-session.js +395 -78
- package/dist/core/agent-session.js.map +1 -1
- package/dist/core/compaction/branch-summarization.d.ts.map +1 -1
- package/dist/core/compaction/branch-summarization.js +4 -3
- package/dist/core/compaction/branch-summarization.js.map +1 -1
- package/dist/core/compaction/compaction.d.ts +5 -0
- package/dist/core/compaction/compaction.d.ts.map +1 -1
- package/dist/core/compaction/compaction.js +19 -5
- package/dist/core/compaction/compaction.js.map +1 -1
- package/dist/core/extensions/index.d.ts +1 -1
- package/dist/core/extensions/index.d.ts.map +1 -1
- package/dist/core/extensions/index.js.map +1 -1
- package/dist/core/extensions/runner.d.ts +5 -0
- package/dist/core/extensions/runner.d.ts.map +1 -1
- package/dist/core/extensions/runner.js +44 -1
- package/dist/core/extensions/runner.js.map +1 -1
- package/dist/core/extensions/types.d.ts +18 -10
- package/dist/core/extensions/types.d.ts.map +1 -1
- package/dist/core/extensions/types.js.map +1 -1
- package/dist/core/session-manager.d.ts.map +1 -1
- package/dist/core/session-manager.js +4 -2
- package/dist/core/session-manager.js.map +1 -1
- package/dist/core/settings-manager.d.ts +8 -1
- package/dist/core/settings-manager.d.ts.map +1 -1
- package/dist/core/settings-manager.js +17 -0
- package/dist/core/settings-manager.js.map +1 -1
- package/dist/core/tools/bash.d.ts +5 -0
- package/dist/core/tools/bash.d.ts.map +1 -1
- package/dist/core/tools/bash.js +5 -1
- package/dist/core/tools/bash.js.map +1 -1
- package/dist/extensions/background/actions.d.ts +21 -0
- package/dist/extensions/background/actions.d.ts.map +1 -0
- package/dist/extensions/background/actions.js +264 -0
- package/dist/extensions/background/actions.js.map +1 -0
- package/dist/extensions/background/constants.d.ts +24 -0
- package/dist/extensions/background/constants.d.ts.map +1 -0
- package/dist/extensions/background/constants.js +24 -0
- package/dist/extensions/background/constants.js.map +1 -0
- package/dist/extensions/background/index.d.ts +6 -115
- package/dist/extensions/background/index.d.ts.map +1 -1
- package/dist/extensions/background/index.js +38 -509
- package/dist/extensions/background/index.js.map +1 -1
- package/dist/extensions/background/manager.d.ts +2 -1
- package/dist/extensions/background/manager.d.ts.map +1 -1
- package/dist/extensions/background/manager.js +8 -10
- package/dist/extensions/background/manager.js.map +1 -1
- package/dist/extensions/background/notify.d.ts +16 -0
- package/dist/extensions/background/notify.d.ts.map +1 -0
- package/dist/extensions/background/notify.js +114 -0
- package/dist/extensions/background/notify.js.map +1 -0
- package/dist/extensions/background/output-file.d.ts +58 -0
- package/dist/extensions/background/output-file.d.ts.map +1 -0
- package/dist/extensions/background/output-file.js +122 -0
- package/dist/extensions/background/output-file.js.map +1 -0
- package/dist/extensions/background/registry.d.ts +40 -72
- package/dist/extensions/background/registry.d.ts.map +1 -1
- package/dist/extensions/background/registry.js +71 -184
- package/dist/extensions/background/registry.js.map +1 -1
- package/dist/extensions/background/render.d.ts +3 -10
- package/dist/extensions/background/render.d.ts.map +1 -1
- package/dist/extensions/background/render.js +20 -60
- package/dist/extensions/background/render.js.map +1 -1
- package/dist/extensions/background/schema.d.ts +34 -0
- package/dist/extensions/background/schema.d.ts.map +1 -0
- package/dist/extensions/background/schema.js +89 -0
- package/dist/extensions/background/schema.js.map +1 -0
- package/dist/extensions/background/task-view.d.ts +48 -0
- package/dist/extensions/background/task-view.d.ts.map +1 -0
- package/dist/extensions/background/task-view.js +90 -0
- package/dist/extensions/background/task-view.js.map +1 -0
- package/dist/extensions/background/text.d.ts +15 -0
- package/dist/extensions/background/text.d.ts.map +1 -0
- package/dist/extensions/background/text.js +31 -0
- package/dist/extensions/background/text.js.map +1 -0
- package/dist/extensions/background/types.d.ts +74 -0
- package/dist/extensions/background/types.d.ts.map +1 -0
- package/dist/extensions/background/types.js +17 -0
- package/dist/extensions/background/types.js.map +1 -0
- package/dist/extensions/llama/client.d.ts +6 -0
- package/dist/extensions/llama/client.d.ts.map +1 -1
- package/dist/extensions/llama/client.js +7 -0
- package/dist/extensions/llama/client.js.map +1 -1
- package/dist/extensions/llama/provider.d.ts +3 -1
- package/dist/extensions/llama/provider.d.ts.map +1 -1
- package/dist/extensions/llama/provider.js +27 -6
- package/dist/extensions/llama/provider.js.map +1 -1
- package/dist/extensions/subagent/activity.d.ts +5 -0
- package/dist/extensions/subagent/activity.d.ts.map +1 -1
- package/dist/extensions/subagent/activity.js +5 -0
- package/dist/extensions/subagent/activity.js.map +1 -1
- package/dist/extensions/subagent/agents-command.d.ts.map +1 -1
- package/dist/extensions/subagent/agents-command.js +6 -391
- package/dist/extensions/subagent/agents-command.js.map +1 -1
- package/dist/extensions/subagent/constants.d.ts +1 -1
- package/dist/extensions/subagent/constants.d.ts.map +1 -1
- package/dist/extensions/subagent/constants.js +2 -1
- package/dist/extensions/subagent/constants.js.map +1 -1
- package/dist/extensions/subagent/index.js +2 -2
- package/dist/extensions/subagent/index.js.map +1 -1
- package/dist/extensions/subagent/render.d.ts +5 -5
- package/dist/extensions/subagent/render.d.ts.map +1 -1
- package/dist/extensions/subagent/render.js +106 -36
- package/dist/extensions/subagent/render.js.map +1 -1
- package/dist/extensions/subagent/resolve.d.ts.map +1 -1
- package/dist/extensions/subagent/resolve.js +2 -4
- package/dist/extensions/subagent/resolve.js.map +1 -1
- package/dist/extensions/subagent/runner.d.ts +1 -1
- package/dist/extensions/subagent/runner.d.ts.map +1 -1
- package/dist/extensions/subagent/runner.js +8 -8
- package/dist/extensions/subagent/runner.js.map +1 -1
- package/dist/extensions/subagent/sdk-runner.d.ts +11 -0
- package/dist/extensions/subagent/sdk-runner.d.ts.map +1 -1
- package/dist/extensions/subagent/sdk-runner.js +90 -79
- package/dist/extensions/subagent/sdk-runner.js.map +1 -1
- package/dist/extensions/subagent/state.d.ts.map +1 -1
- package/dist/extensions/subagent/state.js +145 -126
- package/dist/extensions/subagent/state.js.map +1 -1
- package/dist/extensions/subagent/text.d.ts.map +1 -1
- package/dist/extensions/subagent/text.js +4 -0
- package/dist/extensions/subagent/text.js.map +1 -1
- package/dist/extensions/subagent/ui/agents-dialog.d.ts +4 -0
- package/dist/extensions/subagent/ui/agents-dialog.d.ts.map +1 -0
- package/dist/extensions/subagent/ui/agents-dialog.js +84 -0
- package/dist/extensions/subagent/ui/agents-dialog.js.map +1 -0
- package/dist/extensions/subagent/ui/choice-menu.d.ts +39 -0
- package/dist/extensions/subagent/ui/choice-menu.d.ts.map +1 -0
- package/dist/extensions/subagent/ui/choice-menu.js +93 -0
- package/dist/extensions/subagent/ui/choice-menu.js.map +1 -0
- package/dist/extensions/subagent/ui/model-picker.d.ts +47 -0
- package/dist/extensions/subagent/ui/model-picker.d.ts.map +1 -0
- package/dist/extensions/subagent/ui/model-picker.js +142 -0
- package/dist/extensions/subagent/ui/model-picker.js.map +1 -0
- package/dist/extensions/subagent/ui/profile-settings-menu.d.ts +41 -0
- package/dist/extensions/subagent/ui/profile-settings-menu.d.ts.map +1 -0
- package/dist/extensions/subagent/ui/profile-settings-menu.js +98 -0
- package/dist/extensions/subagent/ui/profile-settings-menu.js.map +1 -0
- package/dist/index.d.ts +2 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/main.d.ts.map +1 -1
- package/dist/main.js +2 -0
- package/dist/main.js.map +1 -1
- package/dist/modes/interactive/components/settings-selector.d.ts +2 -0
- package/dist/modes/interactive/components/settings-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/settings-selector.js +10 -0
- package/dist/modes/interactive/components/settings-selector.js.map +1 -1
- package/dist/modes/interactive/interactive-mode.d.ts +4 -0
- package/dist/modes/interactive/interactive-mode.d.ts.map +1 -1
- package/dist/modes/interactive/interactive-mode.js +71 -58
- package/dist/modes/interactive/interactive-mode.js.map +1 -1
- package/dist/modes/rpc/rpc-client.d.ts +7 -0
- package/dist/modes/rpc/rpc-client.d.ts.map +1 -1
- package/dist/modes/rpc/rpc-client.js +7 -0
- package/dist/modes/rpc/rpc-client.js.map +1 -1
- package/dist/modes/rpc/rpc-mode.d.ts.map +1 -1
- package/dist/modes/rpc/rpc-mode.js +3 -0
- package/dist/modes/rpc/rpc-mode.js.map +1 -1
- package/dist/modes/rpc/rpc-types.d.ts +12 -0
- package/dist/modes/rpc/rpc-types.d.ts.map +1 -1
- package/dist/modes/rpc/rpc-types.js.map +1 -1
- package/dist/utils/shell.d.ts.map +1 -1
- package/dist/utils/shell.js +6 -4
- package/dist/utils/shell.js.map +1 -1
- package/docs/bundled/extensions/subagent.md +1 -1
- package/docs/compaction.md +5 -12
- package/docs/environment-variables.md +3 -0
- package/docs/extensions.md +21 -5
- package/docs/keybindings.md +1 -1
- package/docs/quickstart.md +1 -1
- package/docs/rpc.md +23 -0
- package/docs/settings.md +7 -0
- package/docs/terminal-setup.md +12 -0
- package/docs/usage.md +4 -3
- package/npm-shrinkwrap.json +29 -29
- package/package.json +6 -6
- package/dist/core/compaction-controller.d.ts +0 -90
- package/dist/core/compaction-controller.d.ts.map +0 -1
- package/dist/core/compaction-controller.js +0 -471
- package/dist/core/compaction-controller.js.map +0 -1
|
@@ -7,7 +7,7 @@ import * as fs from "node:fs";
|
|
|
7
7
|
import * as os from "node:os";
|
|
8
8
|
import * as path from "node:path";
|
|
9
9
|
import * as TuiLayouts from "@earendil-works/pi-tui";
|
|
10
|
-
import { CombinedAutocompleteProvider, Container, fuzzyFilter, Markdown, matchesKey, ProcessTerminal, Spacer, setKeybindings, Text, TruncatedText, TuiAltScreen, TuiMainScreen, visibleWidth, } from "@earendil-works/pi-tui";
|
|
10
|
+
import { CombinedAutocompleteProvider, Container, fuzzyFilter, Markdown, matchesKey, ProcessTerminal, Spacer, setCapabilityOverrides, setKeybindings, Text, TruncatedText, TuiAltScreen, TuiMainScreen, visibleWidth, } from "@earendil-works/pi-tui";
|
|
11
11
|
import chalk from "chalk";
|
|
12
12
|
import { spawn } from "child_process";
|
|
13
13
|
import { APP_NAME, APP_TITLE, CONFIG_DIR_NAME, getAgentDir, getAuthPath, getDebugLogPath, getDocsPath, INSTALL_TELEMETRY_URL, UPDATE_CHANGELOG_HINT, VERSION, } from "../../config.js";
|
|
@@ -185,6 +185,7 @@ export function createInteractiveTui(options) {
|
|
|
185
185
|
searchCurrentMatchStyle: (text) => theme.bold(theme.inverse(styleSearchMatch(text))),
|
|
186
186
|
openUrl: openBrowser,
|
|
187
187
|
onRightClickPaste: options.onRightClickPaste,
|
|
188
|
+
copyOnSelect: options.fullscreenCopyOnSelect,
|
|
188
189
|
copySelection: async (text) => {
|
|
189
190
|
try {
|
|
190
191
|
await copyToClipboard(text);
|
|
@@ -319,6 +320,7 @@ export class InteractiveMode {
|
|
|
319
320
|
*/
|
|
320
321
|
this.isShuttingDown = false;
|
|
321
322
|
this.runtimeHost = runtimeHost;
|
|
323
|
+
setCapabilityOverrides(this.settingsManager.getTerminalCapabilityOverrides());
|
|
322
324
|
const tuiMode = options.tuiMode ?? this.settingsManager.getTuiMode();
|
|
323
325
|
this.options = { ...options, tuiMode };
|
|
324
326
|
this.autoTrustOnReloadCwd = options.autoTrustOnReloadCwd;
|
|
@@ -335,6 +337,7 @@ export class InteractiveMode {
|
|
|
335
337
|
showHardwareCursor: this.settingsManager.getShowHardwareCursor(),
|
|
336
338
|
logDirectory: getAgentDir(),
|
|
337
339
|
onRightClickPaste: this.onRightClickPaste,
|
|
340
|
+
fullscreenCopyOnSelect: this.settingsManager.getFullscreenCopyOnSelect(),
|
|
338
341
|
});
|
|
339
342
|
this.ui = createInteractiveTuiReference(() => this.renderer);
|
|
340
343
|
this.ui.setClearOnShrink(this.settingsManager.getClearOnShrink());
|
|
@@ -582,6 +585,7 @@ export class InteractiveMode {
|
|
|
582
585
|
logDirectory: getAgentDir(),
|
|
583
586
|
terminal,
|
|
584
587
|
onRightClickPaste: this.onRightClickPaste,
|
|
588
|
+
fullscreenCopyOnSelect: this.settingsManager.getFullscreenCopyOnSelect(),
|
|
585
589
|
});
|
|
586
590
|
nextUi.setClearOnShrink(clearOnShrink);
|
|
587
591
|
nextUi.onDebug = onDebug;
|
|
@@ -1485,8 +1489,12 @@ export class InteractiveMode {
|
|
|
1485
1489
|
this.transcriptScrollView?.setScrollbar(this.settingsManager.getFullscreenScrollbar());
|
|
1486
1490
|
}
|
|
1487
1491
|
applyRuntimeSettings() {
|
|
1492
|
+
setCapabilityOverrides(this.settingsManager.getTerminalCapabilityOverrides());
|
|
1488
1493
|
configureHttpDispatcher(this.settingsManager.getHttpIdleTimeoutMs());
|
|
1489
1494
|
this.applyFullscreenScrollbarSetting();
|
|
1495
|
+
if (this.renderer instanceof TuiAltScreen) {
|
|
1496
|
+
this.renderer.setCopyOnSelect(this.settingsManager.getFullscreenCopyOnSelect());
|
|
1497
|
+
}
|
|
1490
1498
|
this.footer.setSession(this.session);
|
|
1491
1499
|
this.footer.setAutoCompactEnabled(this.session.autoCompactionEnabled);
|
|
1492
1500
|
this.footerDataProvider.setCwd(this.sessionManager.getCwd());
|
|
@@ -1683,6 +1691,9 @@ export class InteractiveMode {
|
|
|
1683
1691
|
this.statusContainer.addChild(this.idleStatus);
|
|
1684
1692
|
}
|
|
1685
1693
|
}
|
|
1694
|
+
showWorkingStatusIndicator() {
|
|
1695
|
+
this.showStatusIndicator(new WorkingStatusIndicator(this.ui, this.workingMessage ?? this.defaultWorkingMessage, this.workingIndicatorOptions));
|
|
1696
|
+
}
|
|
1686
1697
|
setWorkingVisible(visible) {
|
|
1687
1698
|
this.workingVisible = visible;
|
|
1688
1699
|
if (!visible) {
|
|
@@ -1691,7 +1702,7 @@ export class InteractiveMode {
|
|
|
1691
1702
|
return;
|
|
1692
1703
|
}
|
|
1693
1704
|
if (this.session.isStreaming && this.activeStatusIndicator?.kind !== "working") {
|
|
1694
|
-
this.
|
|
1705
|
+
this.showWorkingStatusIndicator();
|
|
1695
1706
|
}
|
|
1696
1707
|
this.ui.requestRender();
|
|
1697
1708
|
}
|
|
@@ -2318,7 +2329,7 @@ export class InteractiveMode {
|
|
|
2318
2329
|
this.defaultEditor.onAction("app.tools.expand", () => this.toggleToolOutputExpansion());
|
|
2319
2330
|
this.defaultEditor.onAction("app.thinking.toggle", () => this.toggleThinkingBlockVisibility());
|
|
2320
2331
|
this.defaultEditor.onAction("app.editor.external", () => void this.handleOpenExternalEditor());
|
|
2321
|
-
this.defaultEditor.onAction("app.message.copy", () => void this.handleCopyCommand({ flashConfirmation: true }));
|
|
2332
|
+
this.defaultEditor.onAction("app.message.copy", () => void this.handleCopyCommand({ flashConfirmation: true, preferSelection: true }));
|
|
2322
2333
|
this.defaultEditor.onAction("app.message.followUp", () => this.handleFollowUp());
|
|
2323
2334
|
this.defaultEditor.onAction("app.message.dequeue", () => this.handleDequeue());
|
|
2324
2335
|
this.defaultEditor.onAction("app.session.new", () => this.handleClearCommand());
|
|
@@ -2585,31 +2596,24 @@ export class InteractiveMode {
|
|
|
2585
2596
|
switch (event.type) {
|
|
2586
2597
|
case "agent_start":
|
|
2587
2598
|
this.clearPendingTools();
|
|
2588
|
-
if (this.settingsManager.getShowTerminalProgress()) {
|
|
2589
|
-
this.ui.terminal.setProgress(true);
|
|
2590
|
-
}
|
|
2591
2599
|
// Restore main escape handler if retry handler is still active
|
|
2592
2600
|
// (retry success event fires later, but we need main handler now)
|
|
2593
2601
|
if (this.retryEscapeHandler) {
|
|
2594
2602
|
this.defaultEditor.onEscape = this.retryEscapeHandler;
|
|
2595
2603
|
this.retryEscapeHandler = undefined;
|
|
2596
2604
|
}
|
|
2597
|
-
if (this.workingVisible) {
|
|
2598
|
-
this.showStatusIndicator(new WorkingStatusIndicator(this.ui, this.workingMessage ?? this.defaultWorkingMessage, this.workingIndicatorOptions));
|
|
2599
|
-
}
|
|
2600
|
-
else {
|
|
2601
|
-
this.clearStatusIndicator();
|
|
2602
|
-
}
|
|
2603
|
-
this.ui.requestRender();
|
|
2604
2605
|
break;
|
|
2605
2606
|
case "turn_start":
|
|
2606
|
-
// A mid-run compaction replaces the working indicator. Restore it before the
|
|
2607
|
-
// next provider request without waiting for another agent_start event.
|
|
2608
2607
|
if (this.settingsManager.getShowTerminalProgress()) {
|
|
2609
2608
|
this.ui.terminal.setProgress(true);
|
|
2610
2609
|
}
|
|
2611
|
-
if (this.workingVisible
|
|
2612
|
-
|
|
2610
|
+
if (this.workingVisible) {
|
|
2611
|
+
if (this.activeStatusIndicator?.kind !== "working") {
|
|
2612
|
+
this.showWorkingStatusIndicator();
|
|
2613
|
+
}
|
|
2614
|
+
}
|
|
2615
|
+
else {
|
|
2616
|
+
this.clearStatusIndicator();
|
|
2613
2617
|
}
|
|
2614
2618
|
this.ui.requestRender();
|
|
2615
2619
|
break;
|
|
@@ -2789,33 +2793,31 @@ export class InteractiveMode {
|
|
|
2789
2793
|
this.showStatus("Auto-compaction cancelled");
|
|
2790
2794
|
}
|
|
2791
2795
|
}
|
|
2792
|
-
else {
|
|
2793
|
-
|
|
2794
|
-
|
|
2795
|
-
|
|
2796
|
-
throw new Error("Completed compaction is missing from the session context");
|
|
2797
|
-
}
|
|
2798
|
-
this.clearChat();
|
|
2799
|
-
// The latest compaction is prepended for model context; append it below at its chronological position.
|
|
2800
|
-
this.renderSessionEntries(entries.slice(1));
|
|
2801
|
-
this.addMessageToChat(createCompactionSummaryMessage(event.result.summary, event.result.tokensBefore, new Date().toISOString()));
|
|
2802
|
-
if (event.result.usage) {
|
|
2803
|
-
this.addCompactionCostNotice({
|
|
2804
|
-
type: "compaction_cost",
|
|
2805
|
-
kind: "compaction",
|
|
2806
|
-
usage: event.result.usage,
|
|
2807
|
-
});
|
|
2808
|
-
}
|
|
2809
|
-
this.footer.invalidate();
|
|
2796
|
+
else if (event.result) {
|
|
2797
|
+
const entries = this.sessionManager.buildContextEntries();
|
|
2798
|
+
if (entries[0]?.type !== "compaction") {
|
|
2799
|
+
throw new Error("Completed compaction is missing from the session context");
|
|
2810
2800
|
}
|
|
2811
|
-
|
|
2812
|
-
|
|
2813
|
-
|
|
2814
|
-
|
|
2815
|
-
|
|
2816
|
-
|
|
2817
|
-
|
|
2818
|
-
|
|
2801
|
+
this.clearChat();
|
|
2802
|
+
// The latest compaction is prepended for model context; append it below at its chronological position.
|
|
2803
|
+
this.renderSessionEntries(entries.slice(1));
|
|
2804
|
+
this.addMessageToChat(createCompactionSummaryMessage(event.result.summary, event.result.tokensBefore, new Date().toISOString()));
|
|
2805
|
+
if (event.result.usage) {
|
|
2806
|
+
this.addCompactionCostNotice({
|
|
2807
|
+
type: "compaction_cost",
|
|
2808
|
+
kind: "compaction",
|
|
2809
|
+
usage: event.result.usage,
|
|
2810
|
+
});
|
|
2811
|
+
}
|
|
2812
|
+
this.footer.invalidate();
|
|
2813
|
+
}
|
|
2814
|
+
else if (event.errorMessage) {
|
|
2815
|
+
if (event.reason === "manual") {
|
|
2816
|
+
this.showError(event.errorMessage);
|
|
2817
|
+
}
|
|
2818
|
+
else {
|
|
2819
|
+
this.chatContainer.addChild(new Spacer(1));
|
|
2820
|
+
this.chatContainer.addChild(new Text(theme.fg("error", event.errorMessage), 1, 0));
|
|
2819
2821
|
}
|
|
2820
2822
|
}
|
|
2821
2823
|
void this.flushCompactionQueue({ willRetry: event.willRetry });
|
|
@@ -3460,17 +3462,19 @@ export class InteractiveMode {
|
|
|
3460
3462
|
}
|
|
3461
3463
|
this.showStatus(`Tool output: ${expanded ? "expanded" : "collapsed"}`);
|
|
3462
3464
|
}
|
|
3465
|
+
/** Update rendered assistant messages without rebuilding live tool components. */
|
|
3466
|
+
updateThinkingBlockVisibility() {
|
|
3467
|
+
for (const child of this.chatContainer.children) {
|
|
3468
|
+
if (child instanceof AssistantMessageComponent) {
|
|
3469
|
+
child.setHideThinkingBlock(this.hideThinkingBlock);
|
|
3470
|
+
}
|
|
3471
|
+
}
|
|
3472
|
+
this.ui.requestRender();
|
|
3473
|
+
}
|
|
3463
3474
|
toggleThinkingBlockVisibility() {
|
|
3464
3475
|
this.hideThinkingBlock = !this.hideThinkingBlock;
|
|
3465
3476
|
this.settingsManager.setHideThinkingBlock(this.hideThinkingBlock);
|
|
3466
|
-
|
|
3467
|
-
this.rebuildChatFromMessages();
|
|
3468
|
-
// If streaming, re-add the streaming component with updated visibility and re-render
|
|
3469
|
-
if (this.streamingComponent && this.streamingMessage) {
|
|
3470
|
-
this.streamingComponent.setHideThinkingBlock(this.hideThinkingBlock);
|
|
3471
|
-
this.streamingComponent.updateContent(this.streamingMessage);
|
|
3472
|
-
this.chatContainer.addChild(this.streamingComponent);
|
|
3473
|
-
}
|
|
3477
|
+
this.updateThinkingBlockVisibility();
|
|
3474
3478
|
this.showStatus(`Thinking blocks: ${this.hideThinkingBlock ? "hidden" : "visible"}`);
|
|
3475
3479
|
}
|
|
3476
3480
|
async handleOpenExternalEditor() {
|
|
@@ -3790,6 +3794,7 @@ export class InteractiveMode {
|
|
|
3790
3794
|
tuiMode: this.ui.mode,
|
|
3791
3795
|
fullscreenExitOutput: this.settingsManager.getFullscreenExitOutput(),
|
|
3792
3796
|
fullscreenScrollbar: this.settingsManager.getFullscreenScrollbar(),
|
|
3797
|
+
fullscreenCopyOnSelect: this.settingsManager.getFullscreenCopyOnSelect(),
|
|
3793
3798
|
warnings: this.settingsManager.getWarnings(),
|
|
3794
3799
|
}, {
|
|
3795
3800
|
onAutoCompactChange: (enabled) => {
|
|
@@ -3866,12 +3871,7 @@ export class InteractiveMode {
|
|
|
3866
3871
|
onHideThinkingBlockChange: (hidden) => {
|
|
3867
3872
|
this.hideThinkingBlock = hidden;
|
|
3868
3873
|
this.settingsManager.setHideThinkingBlock(hidden);
|
|
3869
|
-
|
|
3870
|
-
if (child instanceof AssistantMessageComponent) {
|
|
3871
|
-
child.setHideThinkingBlock(hidden);
|
|
3872
|
-
}
|
|
3873
|
-
}
|
|
3874
|
-
this.rebuildChatFromMessages();
|
|
3874
|
+
this.updateThinkingBlockVisibility();
|
|
3875
3875
|
},
|
|
3876
3876
|
onMermaidRenderingModeChange: (mode) => {
|
|
3877
3877
|
this.settingsManager.setMermaidRenderingMode(mode);
|
|
@@ -3965,6 +3965,11 @@ export class InteractiveMode {
|
|
|
3965
3965
|
this.settingsManager.setFullscreenScrollbar(mode);
|
|
3966
3966
|
this.applyFullscreenScrollbarSetting();
|
|
3967
3967
|
},
|
|
3968
|
+
onFullscreenCopyOnSelectChange: (enabled) => {
|
|
3969
|
+
this.settingsManager.setFullscreenCopyOnSelect(enabled);
|
|
3970
|
+
if (this.renderer instanceof TuiAltScreen)
|
|
3971
|
+
this.renderer.setCopyOnSelect(enabled);
|
|
3972
|
+
},
|
|
3968
3973
|
onWarningsChange: (warnings) => {
|
|
3969
3974
|
this.settingsManager.setWarnings(warnings);
|
|
3970
3975
|
},
|
|
@@ -4154,6 +4159,7 @@ export class InteractiveMode {
|
|
|
4154
4159
|
const selectModel = async (model, persist) => {
|
|
4155
4160
|
try {
|
|
4156
4161
|
await this.session.setModel(model, { persist });
|
|
4162
|
+
this.updateAvailableProviderCount();
|
|
4157
4163
|
this.footer.invalidate();
|
|
4158
4164
|
this.updateEditorBorderColor();
|
|
4159
4165
|
done();
|
|
@@ -5002,8 +5008,8 @@ export class InteractiveMode {
|
|
|
5002
5008
|
activeHeader.setExpanded(this.toolOutputExpanded);
|
|
5003
5009
|
}
|
|
5004
5010
|
setRegisteredThemes(this.session.resourceLoader.getThemes().themes);
|
|
5005
|
-
await this.themeController.applyFromSettings();
|
|
5006
5011
|
this.applyRuntimeSettings();
|
|
5012
|
+
await this.themeController.applyFromSettings();
|
|
5007
5013
|
this.setupAutocompleteProvider();
|
|
5008
5014
|
const runner = this.session.extensionRunner;
|
|
5009
5015
|
this.setupExtensionShortcuts(runner);
|
|
@@ -5125,6 +5131,13 @@ export class InteractiveMode {
|
|
|
5125
5131
|
});
|
|
5126
5132
|
}
|
|
5127
5133
|
async handleCopyCommand(options = {}) {
|
|
5134
|
+
if (options.preferSelection &&
|
|
5135
|
+
this.ui instanceof TuiAltScreen &&
|
|
5136
|
+
!this.ui.getCopyOnSelect() &&
|
|
5137
|
+
this.ui.hasActiveSelection()) {
|
|
5138
|
+
await this.ui.copyActiveSelectionToClipboard();
|
|
5139
|
+
return;
|
|
5140
|
+
}
|
|
5128
5141
|
const text = this.session.getLastAssistantText();
|
|
5129
5142
|
if (!text) {
|
|
5130
5143
|
this.showError("No agent messages to copy yet.");
|