@averyyy/pi-coding-agent 0.84.3-piclient.1 → 0.84.4-piclient.1
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 +123 -0
- package/README.md +5 -4
- package/dist/bundle/chunks/{chunk-GPPBJGBU.js → chunk-2KVJKXS2.js} +1 -1
- package/dist/bundle/chunks/{chunk-QI42RBZ4.js → chunk-AP7VCR6I.js} +73 -72
- package/dist/bundle/chunks/{google-generative-ai-XDKMGBCJ.js → google-generative-ai-YMUPJBKR.js} +1 -1
- package/dist/bundle/chunks/{google-vertex-D5FGEO3Y.js → google-vertex-MPWMV4OF.js} +1 -1
- package/dist/bundle/chunks/https-proxy-agent-2VXB7436.js +13 -0
- package/dist/bundle/chunks/{mistral-conversations-YK73UAOZ.js → mistral-conversations-Q3AWZJAZ.js} +1 -1
- package/dist/bundle/chunks/{openai-completions-JD4WAC3R.js → openai-completions-ERMU2SS7.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 +102 -19
- 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 +8 -1
- package/dist/core/compaction/branch-summarization.js.map +1 -1
- package/dist/core/compaction/compaction.d.ts +9 -4
- package/dist/core/compaction/compaction.d.ts.map +1 -1
- package/dist/core/compaction/compaction.js +42 -22
- 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 +45 -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/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/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/compaction.md +2 -0
- package/docs/custom-provider.md +7 -7
- package/docs/environment-variables.md +3 -0
- 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 +2 -2
- 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/package.json +6 -6
- package/dist/bundle/chunks/dist-RDWOYWHR.js +0 -13
|
@@ -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";
|
|
@@ -188,6 +188,7 @@ export function createInteractiveTui(options) {
|
|
|
188
188
|
searchCurrentMatchStyle: (text) => theme.bold(theme.inverse(styleSearchMatch(text))),
|
|
189
189
|
openUrl: openBrowser,
|
|
190
190
|
onRightClickPaste: options.onRightClickPaste,
|
|
191
|
+
copyOnSelect: options.fullscreenCopyOnSelect,
|
|
191
192
|
copySelection: async (text) => {
|
|
192
193
|
try {
|
|
193
194
|
await copyToClipboard(text);
|
|
@@ -351,6 +352,7 @@ export class InteractiveMode {
|
|
|
351
352
|
}
|
|
352
353
|
constructor(runtimeHost, options = {}) {
|
|
353
354
|
this.runtimeHost = runtimeHost;
|
|
355
|
+
setCapabilityOverrides(this.settingsManager.getTerminalCapabilityOverrides());
|
|
354
356
|
const tuiMode = options.tuiMode ?? this.settingsManager.getTuiMode();
|
|
355
357
|
this.options = { ...options, tuiMode };
|
|
356
358
|
this.autoTrustOnReloadCwd = options.autoTrustOnReloadCwd;
|
|
@@ -367,6 +369,7 @@ export class InteractiveMode {
|
|
|
367
369
|
showHardwareCursor: this.settingsManager.getShowHardwareCursor(),
|
|
368
370
|
logDirectory: getAgentDir(),
|
|
369
371
|
onRightClickPaste: this.onRightClickPaste,
|
|
372
|
+
fullscreenCopyOnSelect: this.settingsManager.getFullscreenCopyOnSelect(),
|
|
370
373
|
});
|
|
371
374
|
this.ui = createInteractiveTuiReference(() => this.renderer);
|
|
372
375
|
this.ui.setClearOnShrink(this.settingsManager.getClearOnShrink());
|
|
@@ -614,6 +617,7 @@ export class InteractiveMode {
|
|
|
614
617
|
logDirectory: getAgentDir(),
|
|
615
618
|
terminal,
|
|
616
619
|
onRightClickPaste: this.onRightClickPaste,
|
|
620
|
+
fullscreenCopyOnSelect: this.settingsManager.getFullscreenCopyOnSelect(),
|
|
617
621
|
});
|
|
618
622
|
nextUi.setClearOnShrink(clearOnShrink);
|
|
619
623
|
nextUi.onDebug = onDebug;
|
|
@@ -1522,8 +1526,12 @@ export class InteractiveMode {
|
|
|
1522
1526
|
this.transcriptScrollView?.setScrollbar(this.settingsManager.getFullscreenScrollbar());
|
|
1523
1527
|
}
|
|
1524
1528
|
applyRuntimeSettings() {
|
|
1529
|
+
setCapabilityOverrides(this.settingsManager.getTerminalCapabilityOverrides());
|
|
1525
1530
|
configureHttpDispatcher(this.settingsManager.getHttpIdleTimeoutMs());
|
|
1526
1531
|
this.applyFullscreenScrollbarSetting();
|
|
1532
|
+
if (this.renderer instanceof TuiAltScreen) {
|
|
1533
|
+
this.renderer.setCopyOnSelect(this.settingsManager.getFullscreenCopyOnSelect());
|
|
1534
|
+
}
|
|
1527
1535
|
this.footer.setSession(this.session);
|
|
1528
1536
|
this.footer.setAutoCompactEnabled(this.session.autoCompactionEnabled);
|
|
1529
1537
|
this.footerDataProvider.setCwd(this.sessionManager.getCwd());
|
|
@@ -1673,6 +1681,9 @@ export class InteractiveMode {
|
|
|
1673
1681
|
this.statusContainer.addChild(this.idleStatus);
|
|
1674
1682
|
}
|
|
1675
1683
|
}
|
|
1684
|
+
showWorkingStatusIndicator() {
|
|
1685
|
+
this.showStatusIndicator(new WorkingStatusIndicator(this.ui, this.workingMessage ?? this.defaultWorkingMessage, this.workingIndicatorOptions));
|
|
1686
|
+
}
|
|
1676
1687
|
setWorkingVisible(visible) {
|
|
1677
1688
|
this.workingVisible = visible;
|
|
1678
1689
|
if (!visible) {
|
|
@@ -1681,7 +1692,7 @@ export class InteractiveMode {
|
|
|
1681
1692
|
return;
|
|
1682
1693
|
}
|
|
1683
1694
|
if (this.session.isStreaming && this.activeStatusIndicator?.kind !== "working") {
|
|
1684
|
-
this.
|
|
1695
|
+
this.showWorkingStatusIndicator();
|
|
1685
1696
|
}
|
|
1686
1697
|
this.ui.requestRender();
|
|
1687
1698
|
}
|
|
@@ -2301,7 +2312,7 @@ export class InteractiveMode {
|
|
|
2301
2312
|
this.defaultEditor.onAction("app.tools.expand", () => this.toggleToolOutputExpansion());
|
|
2302
2313
|
this.defaultEditor.onAction("app.thinking.toggle", () => this.toggleThinkingBlockVisibility());
|
|
2303
2314
|
this.defaultEditor.onAction("app.editor.external", () => void this.handleOpenExternalEditor());
|
|
2304
|
-
this.defaultEditor.onAction("app.message.copy", () => void this.handleCopyCommand({ flashConfirmation: true }));
|
|
2315
|
+
this.defaultEditor.onAction("app.message.copy", () => void this.handleCopyCommand({ flashConfirmation: true, preferSelection: true }));
|
|
2305
2316
|
this.defaultEditor.onAction("app.message.followUp", () => this.handleFollowUp());
|
|
2306
2317
|
this.defaultEditor.onAction("app.message.dequeue", () => this.handleDequeue());
|
|
2307
2318
|
this.defaultEditor.onAction("app.session.new", () => this.handleClearCommand());
|
|
@@ -2568,17 +2579,21 @@ export class InteractiveMode {
|
|
|
2568
2579
|
switch (event.type) {
|
|
2569
2580
|
case "agent_start":
|
|
2570
2581
|
this.pendingTools.clear();
|
|
2571
|
-
if (this.settingsManager.getShowTerminalProgress()) {
|
|
2572
|
-
this.ui.terminal.setProgress(true);
|
|
2573
|
-
}
|
|
2574
2582
|
// Restore main escape handler if retry handler is still active
|
|
2575
2583
|
// (retry success event fires later, but we need main handler now)
|
|
2576
2584
|
if (this.retryEscapeHandler) {
|
|
2577
2585
|
this.defaultEditor.onEscape = this.retryEscapeHandler;
|
|
2578
2586
|
this.retryEscapeHandler = undefined;
|
|
2579
2587
|
}
|
|
2588
|
+
break;
|
|
2589
|
+
case "turn_start":
|
|
2590
|
+
if (this.settingsManager.getShowTerminalProgress()) {
|
|
2591
|
+
this.ui.terminal.setProgress(true);
|
|
2592
|
+
}
|
|
2580
2593
|
if (this.workingVisible) {
|
|
2581
|
-
|
|
2594
|
+
if (this.activeStatusIndicator?.kind !== "working") {
|
|
2595
|
+
this.showWorkingStatusIndicator();
|
|
2596
|
+
}
|
|
2582
2597
|
}
|
|
2583
2598
|
else {
|
|
2584
2599
|
this.clearStatusIndicator();
|
|
@@ -3448,18 +3463,19 @@ export class InteractiveMode {
|
|
|
3448
3463
|
}
|
|
3449
3464
|
this.showStatus(`Tool output: ${expanded ? "expanded" : "collapsed"}`);
|
|
3450
3465
|
}
|
|
3466
|
+
/** Update rendered assistant messages without rebuilding live tool components. */
|
|
3467
|
+
updateThinkingBlockVisibility() {
|
|
3468
|
+
for (const child of this.chatContainer.children) {
|
|
3469
|
+
if (child instanceof AssistantMessageComponent) {
|
|
3470
|
+
child.setHideThinkingBlock(this.hideThinkingBlock);
|
|
3471
|
+
}
|
|
3472
|
+
}
|
|
3473
|
+
this.ui.requestRender();
|
|
3474
|
+
}
|
|
3451
3475
|
toggleThinkingBlockVisibility() {
|
|
3452
3476
|
this.hideThinkingBlock = !this.hideThinkingBlock;
|
|
3453
3477
|
this.settingsManager.setHideThinkingBlock(this.hideThinkingBlock);
|
|
3454
|
-
|
|
3455
|
-
this.chatContainer.clear();
|
|
3456
|
-
this.rebuildChatFromMessages();
|
|
3457
|
-
// If streaming, re-add the streaming component with updated visibility and re-render
|
|
3458
|
-
if (this.streamingComponent && this.streamingMessage) {
|
|
3459
|
-
this.streamingComponent.setHideThinkingBlock(this.hideThinkingBlock);
|
|
3460
|
-
this.streamingComponent.updateContent(this.streamingMessage);
|
|
3461
|
-
this.chatContainer.addChild(this.streamingComponent);
|
|
3462
|
-
}
|
|
3478
|
+
this.updateThinkingBlockVisibility();
|
|
3463
3479
|
this.showStatus(`Thinking blocks: ${this.hideThinkingBlock ? "hidden" : "visible"}`);
|
|
3464
3480
|
}
|
|
3465
3481
|
async handleOpenExternalEditor() {
|
|
@@ -3776,6 +3792,7 @@ export class InteractiveMode {
|
|
|
3776
3792
|
tuiMode: this.ui.mode,
|
|
3777
3793
|
fullscreenExitOutput: this.settingsManager.getFullscreenExitOutput(),
|
|
3778
3794
|
fullscreenScrollbar: this.settingsManager.getFullscreenScrollbar(),
|
|
3795
|
+
fullscreenCopyOnSelect: this.settingsManager.getFullscreenCopyOnSelect(),
|
|
3779
3796
|
warnings: this.settingsManager.getWarnings(),
|
|
3780
3797
|
}, {
|
|
3781
3798
|
onAutoCompactChange: (enabled) => {
|
|
@@ -3852,13 +3869,7 @@ export class InteractiveMode {
|
|
|
3852
3869
|
onHideThinkingBlockChange: (hidden) => {
|
|
3853
3870
|
this.hideThinkingBlock = hidden;
|
|
3854
3871
|
this.settingsManager.setHideThinkingBlock(hidden);
|
|
3855
|
-
|
|
3856
|
-
if (child instanceof AssistantMessageComponent) {
|
|
3857
|
-
child.setHideThinkingBlock(hidden);
|
|
3858
|
-
}
|
|
3859
|
-
}
|
|
3860
|
-
this.chatContainer.clear();
|
|
3861
|
-
this.rebuildChatFromMessages();
|
|
3872
|
+
this.updateThinkingBlockVisibility();
|
|
3862
3873
|
},
|
|
3863
3874
|
onMermaidRenderingModeChange: (mode) => {
|
|
3864
3875
|
this.settingsManager.setMermaidRenderingMode(mode);
|
|
@@ -3952,6 +3963,11 @@ export class InteractiveMode {
|
|
|
3952
3963
|
this.settingsManager.setFullscreenScrollbar(mode);
|
|
3953
3964
|
this.applyFullscreenScrollbarSetting();
|
|
3954
3965
|
},
|
|
3966
|
+
onFullscreenCopyOnSelectChange: (enabled) => {
|
|
3967
|
+
this.settingsManager.setFullscreenCopyOnSelect(enabled);
|
|
3968
|
+
if (this.renderer instanceof TuiAltScreen)
|
|
3969
|
+
this.renderer.setCopyOnSelect(enabled);
|
|
3970
|
+
},
|
|
3955
3971
|
onWarningsChange: (warnings) => {
|
|
3956
3972
|
this.settingsManager.setWarnings(warnings);
|
|
3957
3973
|
},
|
|
@@ -4141,6 +4157,7 @@ export class InteractiveMode {
|
|
|
4141
4157
|
const selectModel = async (model, persist) => {
|
|
4142
4158
|
try {
|
|
4143
4159
|
await this.session.setModel(model, { persist });
|
|
4160
|
+
this.updateAvailableProviderCount();
|
|
4144
4161
|
this.footer.invalidate();
|
|
4145
4162
|
this.updateEditorBorderColor();
|
|
4146
4163
|
done();
|
|
@@ -4989,8 +5006,8 @@ export class InteractiveMode {
|
|
|
4989
5006
|
activeHeader.setExpanded(this.toolOutputExpanded);
|
|
4990
5007
|
}
|
|
4991
5008
|
setRegisteredThemes(this.session.resourceLoader.getThemes().themes);
|
|
4992
|
-
await this.themeController.applyFromSettings();
|
|
4993
5009
|
this.applyRuntimeSettings();
|
|
5010
|
+
await this.themeController.applyFromSettings();
|
|
4994
5011
|
this.setupAutocompleteProvider();
|
|
4995
5012
|
const runner = this.session.extensionRunner;
|
|
4996
5013
|
this.setupExtensionShortcuts(runner);
|
|
@@ -5112,6 +5129,13 @@ export class InteractiveMode {
|
|
|
5112
5129
|
});
|
|
5113
5130
|
}
|
|
5114
5131
|
async handleCopyCommand(options = {}) {
|
|
5132
|
+
if (options.preferSelection &&
|
|
5133
|
+
this.ui instanceof TuiAltScreen &&
|
|
5134
|
+
!this.ui.getCopyOnSelect() &&
|
|
5135
|
+
this.ui.hasActiveSelection()) {
|
|
5136
|
+
await this.ui.copyActiveSelectionToClipboard();
|
|
5137
|
+
return;
|
|
5138
|
+
}
|
|
5115
5139
|
const text = this.session.getLastAssistantText();
|
|
5116
5140
|
if (!text) {
|
|
5117
5141
|
this.showError("No agent messages to copy yet.");
|