@humain/terminal 0.0.7 → 0.0.10
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 +24 -0
- package/README.md +7 -6
- package/dist/bundle/chunks/chunk-74NVHVNZ.js +16 -0
- package/dist/bundle/chunks/{chunk-M2GYSCCG.js → chunk-PSKDLDLZ.js} +1 -1
- package/dist/bundle/chunks/{chunk-HNVPY4LZ.js → chunk-SCJNLX2E.js} +94 -103
- package/dist/bundle/chunks/{google-generative-ai-XT7NQJ2E.js → google-generative-ai-FF7M7XHT.js} +1 -1
- package/dist/bundle/chunks/{google-vertex-IDQ6Z53W.js → google-vertex-YMUBFRBA.js} +1 -1
- package/dist/bundle/chunks/https-proxy-agent-562J2I52.js +2 -0
- package/dist/bundle/chunks/{mistral-conversations-HHDZ4FHR.js → mistral-conversations-O4M7IQML.js} +1 -1
- package/dist/bundle/chunks/{openai-completions-6QBYTBXY.js → openai-completions-L4AHDQ5D.js} +1 -1
- package/dist/bundle/cli.js +1 -1
- package/dist/bundle/index.js +1 -1
- package/dist/bundle/rpc-entry.js +1 -1
- 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 +12 -1
- package/dist/core/agent-session.d.ts.map +1 -1
- package/dist/core/agent-session.js +77 -9
- 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 -1
- 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/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/humain/agent-execution-failure.d.ts +4 -0
- package/dist/humain/agent-execution-failure.d.ts.map +1 -0
- package/dist/humain/agent-execution-failure.js +58 -0
- package/dist/humain/agent-execution-failure.js.map +1 -0
- package/dist/humain/agent-execution-runtime.d.ts +2 -2
- package/dist/humain/agent-execution-runtime.d.ts.map +1 -1
- package/dist/humain/agent-execution-runtime.js +13 -5
- package/dist/humain/agent-execution-runtime.js.map +1 -1
- package/dist/humain/mcp-adapter/vendor/package.json +2 -2
- package/dist/humain/pi-agent-execution-host.d.ts +1 -0
- package/dist/humain/pi-agent-execution-host.d.ts.map +1 -1
- package/dist/humain/pi-agent-execution-host.js +10 -3
- package/dist/humain/pi-agent-execution-host.js.map +1 -1
- 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 +48 -24
- package/dist/modes/interactive/interactive-mode.js.map +1 -1
- package/dist/modes/rpc/jsonl.d.ts +6 -1
- package/dist/modes/rpc/jsonl.d.ts.map +1 -1
- package/dist/modes/rpc/jsonl.js +38 -11
- package/dist/modes/rpc/jsonl.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 +99 -4
- 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/compaction.md +2 -0
- package/docs/custom-provider.md +7 -7
- package/docs/environment-variables.md +4 -1
- package/docs/extensions.md +18 -0
- package/docs/keybindings.md +1 -1
- package/docs/quickstart.md +1 -1
- package/docs/rpc.md +23 -0
- package/docs/settings.md +12 -4
- package/docs/terminal-setup.md +12 -0
- package/docs/usage.md +4 -3
- package/examples/extensions/custom-provider-anthropic/package-lock.json +6 -6
- package/examples/extensions/custom-provider-anthropic/package.json +1 -1
- package/examples/extensions/custom-provider-gitlab-duo/package.json +1 -1
- package/examples/extensions/gondolin/package-lock.json +2 -2
- package/examples/extensions/gondolin/package.json +1 -1
- package/examples/extensions/sandbox/package-lock.json +2 -2
- package/examples/extensions/sandbox/package.json +1 -1
- package/examples/extensions/with-deps/package-lock.json +2 -2
- package/examples/extensions/with-deps/package.json +1 -1
- package/npm-shrinkwrap.json +27 -26
- package/package.json +8 -8
- package/dist/bundle/chunks/chunk-3D3G2X5U.js +0 -6
- package/dist/bundle/chunks/dist-7DSXV2TY.js +0 -9
|
@@ -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, getCapabilities, hyperlink, Markdown, matchesKey, ProcessTerminal, Spacer, setKeybindings, Text, TruncatedText, TuiAltScreen, TuiMainScreen, visibleWidth, } from "@earendil-works/pi-tui";
|
|
10
|
+
import { CombinedAutocompleteProvider, Container, fuzzyFilter, getCapabilities, hyperlink, 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, 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);
|
|
@@ -315,6 +316,7 @@ export class InteractiveMode {
|
|
|
315
316
|
*/
|
|
316
317
|
this.isShuttingDown = false;
|
|
317
318
|
this.runtimeHost = runtimeHost;
|
|
319
|
+
setCapabilityOverrides(this.settingsManager.getTerminalCapabilityOverrides());
|
|
318
320
|
const tuiMode = options.tuiMode ?? this.settingsManager.getTuiMode();
|
|
319
321
|
this.options = { ...options, tuiMode };
|
|
320
322
|
this.autoTrustOnReloadCwd = options.autoTrustOnReloadCwd;
|
|
@@ -331,6 +333,7 @@ export class InteractiveMode {
|
|
|
331
333
|
showHardwareCursor: this.settingsManager.getShowHardwareCursor(),
|
|
332
334
|
logDirectory: getAgentDir(),
|
|
333
335
|
onRightClickPaste: this.onRightClickPaste,
|
|
336
|
+
fullscreenCopyOnSelect: this.settingsManager.getFullscreenCopyOnSelect(),
|
|
334
337
|
});
|
|
335
338
|
this.ui = createInteractiveTuiReference(() => this.renderer);
|
|
336
339
|
this.ui.setClearOnShrink(this.settingsManager.getClearOnShrink());
|
|
@@ -578,6 +581,7 @@ export class InteractiveMode {
|
|
|
578
581
|
logDirectory: getAgentDir(),
|
|
579
582
|
terminal,
|
|
580
583
|
onRightClickPaste: this.onRightClickPaste,
|
|
584
|
+
fullscreenCopyOnSelect: this.settingsManager.getFullscreenCopyOnSelect(),
|
|
581
585
|
});
|
|
582
586
|
nextUi.setClearOnShrink(clearOnShrink);
|
|
583
587
|
nextUi.onDebug = onDebug;
|
|
@@ -1486,8 +1490,12 @@ export class InteractiveMode {
|
|
|
1486
1490
|
this.transcriptScrollView?.setScrollbar(this.settingsManager.getFullscreenScrollbar());
|
|
1487
1491
|
}
|
|
1488
1492
|
applyRuntimeSettings() {
|
|
1493
|
+
setCapabilityOverrides(this.settingsManager.getTerminalCapabilityOverrides());
|
|
1489
1494
|
configureHttpDispatcher(this.settingsManager.getHttpIdleTimeoutMs());
|
|
1490
1495
|
this.applyFullscreenScrollbarSetting();
|
|
1496
|
+
if (this.renderer instanceof TuiAltScreen) {
|
|
1497
|
+
this.renderer.setCopyOnSelect(this.settingsManager.getFullscreenCopyOnSelect());
|
|
1498
|
+
}
|
|
1491
1499
|
this.footer.setSession(this.session);
|
|
1492
1500
|
this.footer.setAutoCompactEnabled(this.session.autoCompactionEnabled);
|
|
1493
1501
|
this.footerDataProvider.setCwd(this.sessionManager.getCwd());
|
|
@@ -1637,6 +1645,9 @@ export class InteractiveMode {
|
|
|
1637
1645
|
this.statusContainer.addChild(this.idleStatus);
|
|
1638
1646
|
}
|
|
1639
1647
|
}
|
|
1648
|
+
showWorkingStatusIndicator() {
|
|
1649
|
+
this.showStatusIndicator(new WorkingStatusIndicator(this.ui, this.workingMessage ?? this.defaultWorkingMessage, this.workingIndicatorOptions));
|
|
1650
|
+
}
|
|
1640
1651
|
setWorkingVisible(visible) {
|
|
1641
1652
|
this.workingVisible = visible;
|
|
1642
1653
|
if (!visible) {
|
|
@@ -1645,7 +1656,7 @@ export class InteractiveMode {
|
|
|
1645
1656
|
return;
|
|
1646
1657
|
}
|
|
1647
1658
|
if (this.session.isStreaming && this.activeStatusIndicator?.kind !== "working") {
|
|
1648
|
-
this.
|
|
1659
|
+
this.showWorkingStatusIndicator();
|
|
1649
1660
|
}
|
|
1650
1661
|
this.ui.requestRender();
|
|
1651
1662
|
}
|
|
@@ -2265,7 +2276,7 @@ export class InteractiveMode {
|
|
|
2265
2276
|
this.defaultEditor.onAction("app.tools.expand", () => this.toggleToolOutputExpansion());
|
|
2266
2277
|
this.defaultEditor.onAction("app.thinking.toggle", () => this.toggleThinkingBlockVisibility());
|
|
2267
2278
|
this.defaultEditor.onAction("app.editor.external", () => void this.handleOpenExternalEditor());
|
|
2268
|
-
this.defaultEditor.onAction("app.message.copy", () => void this.handleCopyCommand({ flashConfirmation: true }));
|
|
2279
|
+
this.defaultEditor.onAction("app.message.copy", () => void this.handleCopyCommand({ flashConfirmation: true, preferSelection: true }));
|
|
2269
2280
|
this.defaultEditor.onAction("app.message.followUp", () => this.handleFollowUp());
|
|
2270
2281
|
this.defaultEditor.onAction("app.message.dequeue", () => this.handleDequeue());
|
|
2271
2282
|
this.defaultEditor.onAction("app.session.new", () => this.handleClearCommand());
|
|
@@ -2532,17 +2543,21 @@ export class InteractiveMode {
|
|
|
2532
2543
|
switch (event.type) {
|
|
2533
2544
|
case "agent_start":
|
|
2534
2545
|
this.pendingTools.clear();
|
|
2535
|
-
if (this.settingsManager.getShowTerminalProgress()) {
|
|
2536
|
-
this.ui.terminal.setProgress(true);
|
|
2537
|
-
}
|
|
2538
2546
|
// Restore main escape handler if retry handler is still active
|
|
2539
2547
|
// (retry success event fires later, but we need main handler now)
|
|
2540
2548
|
if (this.retryEscapeHandler) {
|
|
2541
2549
|
this.defaultEditor.onEscape = this.retryEscapeHandler;
|
|
2542
2550
|
this.retryEscapeHandler = undefined;
|
|
2543
2551
|
}
|
|
2552
|
+
break;
|
|
2553
|
+
case "turn_start":
|
|
2554
|
+
if (this.settingsManager.getShowTerminalProgress()) {
|
|
2555
|
+
this.ui.terminal.setProgress(true);
|
|
2556
|
+
}
|
|
2544
2557
|
if (this.workingVisible) {
|
|
2545
|
-
|
|
2558
|
+
if (this.activeStatusIndicator?.kind !== "working") {
|
|
2559
|
+
this.showWorkingStatusIndicator();
|
|
2560
|
+
}
|
|
2546
2561
|
}
|
|
2547
2562
|
else {
|
|
2548
2563
|
this.clearStatusIndicator();
|
|
@@ -3406,18 +3421,19 @@ export class InteractiveMode {
|
|
|
3406
3421
|
}
|
|
3407
3422
|
this.showStatus(`Tool output: ${expanded ? "expanded" : "collapsed"}`);
|
|
3408
3423
|
}
|
|
3424
|
+
/** Update rendered assistant messages without rebuilding live tool components. */
|
|
3425
|
+
updateThinkingBlockVisibility() {
|
|
3426
|
+
for (const child of this.chatContainer.children) {
|
|
3427
|
+
if (child instanceof AssistantMessageComponent) {
|
|
3428
|
+
child.setHideThinkingBlock(this.hideThinkingBlock);
|
|
3429
|
+
}
|
|
3430
|
+
}
|
|
3431
|
+
this.ui.requestRender();
|
|
3432
|
+
}
|
|
3409
3433
|
toggleThinkingBlockVisibility() {
|
|
3410
3434
|
this.hideThinkingBlock = !this.hideThinkingBlock;
|
|
3411
3435
|
this.settingsManager.setHideThinkingBlock(this.hideThinkingBlock);
|
|
3412
|
-
|
|
3413
|
-
this.chatContainer.clear();
|
|
3414
|
-
this.rebuildChatFromMessages();
|
|
3415
|
-
// If streaming, re-add the streaming component with updated visibility and re-render
|
|
3416
|
-
if (this.streamingComponent && this.streamingMessage) {
|
|
3417
|
-
this.streamingComponent.setHideThinkingBlock(this.hideThinkingBlock);
|
|
3418
|
-
this.streamingComponent.updateContent(this.streamingMessage);
|
|
3419
|
-
this.chatContainer.addChild(this.streamingComponent);
|
|
3420
|
-
}
|
|
3436
|
+
this.updateThinkingBlockVisibility();
|
|
3421
3437
|
this.showStatus(`Thinking blocks: ${this.hideThinkingBlock ? "hidden" : "visible"}`);
|
|
3422
3438
|
}
|
|
3423
3439
|
async handleOpenExternalEditor() {
|
|
@@ -3734,6 +3750,7 @@ export class InteractiveMode {
|
|
|
3734
3750
|
tuiMode: this.ui.mode,
|
|
3735
3751
|
fullscreenExitOutput: this.settingsManager.getFullscreenExitOutput(),
|
|
3736
3752
|
fullscreenScrollbar: this.settingsManager.getFullscreenScrollbar(),
|
|
3753
|
+
fullscreenCopyOnSelect: this.settingsManager.getFullscreenCopyOnSelect(),
|
|
3737
3754
|
warnings: this.settingsManager.getWarnings(),
|
|
3738
3755
|
}, {
|
|
3739
3756
|
onAutoCompactChange: (enabled) => {
|
|
@@ -3810,13 +3827,7 @@ export class InteractiveMode {
|
|
|
3810
3827
|
onHideThinkingBlockChange: (hidden) => {
|
|
3811
3828
|
this.hideThinkingBlock = hidden;
|
|
3812
3829
|
this.settingsManager.setHideThinkingBlock(hidden);
|
|
3813
|
-
|
|
3814
|
-
if (child instanceof AssistantMessageComponent) {
|
|
3815
|
-
child.setHideThinkingBlock(hidden);
|
|
3816
|
-
}
|
|
3817
|
-
}
|
|
3818
|
-
this.chatContainer.clear();
|
|
3819
|
-
this.rebuildChatFromMessages();
|
|
3830
|
+
this.updateThinkingBlockVisibility();
|
|
3820
3831
|
},
|
|
3821
3832
|
onMermaidRenderingModeChange: (mode) => {
|
|
3822
3833
|
this.settingsManager.setMermaidRenderingMode(mode);
|
|
@@ -3910,6 +3921,11 @@ export class InteractiveMode {
|
|
|
3910
3921
|
this.settingsManager.setFullscreenScrollbar(mode);
|
|
3911
3922
|
this.applyFullscreenScrollbarSetting();
|
|
3912
3923
|
},
|
|
3924
|
+
onFullscreenCopyOnSelectChange: (enabled) => {
|
|
3925
|
+
this.settingsManager.setFullscreenCopyOnSelect(enabled);
|
|
3926
|
+
if (this.renderer instanceof TuiAltScreen)
|
|
3927
|
+
this.renderer.setCopyOnSelect(enabled);
|
|
3928
|
+
},
|
|
3913
3929
|
onWarningsChange: (warnings) => {
|
|
3914
3930
|
this.settingsManager.setWarnings(warnings);
|
|
3915
3931
|
},
|
|
@@ -4099,6 +4115,7 @@ export class InteractiveMode {
|
|
|
4099
4115
|
const selectModel = async (model, persist) => {
|
|
4100
4116
|
try {
|
|
4101
4117
|
await this.session.setModel(model, { persist });
|
|
4118
|
+
this.updateAvailableProviderCount();
|
|
4102
4119
|
this.footer.invalidate();
|
|
4103
4120
|
this.updateEditorBorderColor();
|
|
4104
4121
|
done();
|
|
@@ -4947,8 +4964,8 @@ export class InteractiveMode {
|
|
|
4947
4964
|
activeHeader.setExpanded(this.toolOutputExpanded);
|
|
4948
4965
|
}
|
|
4949
4966
|
setRegisteredThemes(this.session.resourceLoader.getThemes().themes);
|
|
4950
|
-
await this.themeController.applyFromSettings();
|
|
4951
4967
|
this.applyRuntimeSettings();
|
|
4968
|
+
await this.themeController.applyFromSettings();
|
|
4952
4969
|
this.setupAutocompleteProvider();
|
|
4953
4970
|
const runner = this.session.extensionRunner;
|
|
4954
4971
|
this.setupExtensionShortcuts(runner);
|
|
@@ -5070,6 +5087,13 @@ export class InteractiveMode {
|
|
|
5070
5087
|
});
|
|
5071
5088
|
}
|
|
5072
5089
|
async handleCopyCommand(options = {}) {
|
|
5090
|
+
if (options.preferSelection &&
|
|
5091
|
+
this.ui instanceof TuiAltScreen &&
|
|
5092
|
+
!this.ui.getCopyOnSelect() &&
|
|
5093
|
+
this.ui.hasActiveSelection()) {
|
|
5094
|
+
await this.ui.copyActiveSelectionToClipboard();
|
|
5095
|
+
return;
|
|
5096
|
+
}
|
|
5073
5097
|
const text = this.session.getLastAssistantText();
|
|
5074
5098
|
if (!text) {
|
|
5075
5099
|
this.showError("No agent messages to copy yet.");
|