@averyyy/pi-coding-agent 0.82.0-piclient.1 → 0.82.1-piclient.2
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 +33 -0
- package/dist/cli/args.d.ts.map +1 -1
- package/dist/cli/args.js +1 -0
- package/dist/cli/args.js.map +1 -1
- package/dist/core/agent-session.d.ts.map +1 -1
- package/dist/core/agent-session.js +2 -7
- package/dist/core/agent-session.js.map +1 -1
- package/dist/core/extensions/types.d.ts +2 -0
- package/dist/core/extensions/types.d.ts.map +1 -1
- package/dist/core/extensions/types.js.map +1 -1
- package/dist/core/model-resolver.d.ts +1 -0
- package/dist/core/model-resolver.d.ts.map +1 -1
- package/dist/core/model-resolver.js +13 -3
- package/dist/core/model-resolver.js.map +1 -1
- package/dist/core/remote-catalog-provider.d.ts.map +1 -1
- package/dist/core/remote-catalog-provider.js +19 -1
- package/dist/core/remote-catalog-provider.js.map +1 -1
- package/dist/core/resource-loader.d.ts.map +1 -1
- package/dist/core/resource-loader.js +3 -0
- package/dist/core/resource-loader.js.map +1 -1
- package/dist/extensions/llama/provider.d.ts.map +1 -1
- package/dist/extensions/llama/provider.js +6 -0
- package/dist/extensions/llama/provider.js.map +1 -1
- package/dist/modes/interactive/components/custom-message.d.ts +3 -1
- package/dist/modes/interactive/components/custom-message.d.ts.map +1 -1
- package/dist/modes/interactive/components/custom-message.js +10 -2
- package/dist/modes/interactive/components/custom-message.js.map +1 -1
- package/dist/modes/interactive/components/scoped-models-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/scoped-models-selector.js +22 -13
- package/dist/modes/interactive/components/scoped-models-selector.js.map +1 -1
- package/dist/modes/interactive/interactive-mode.d.ts +3 -2
- package/dist/modes/interactive/interactive-mode.d.ts.map +1 -1
- package/dist/modes/interactive/interactive-mode.js +48 -27
- package/dist/modes/interactive/interactive-mode.js.map +1 -1
- package/docs/extensions.md +2 -2
- 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/message-renderer.ts +2 -2
- 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 +4 -4
|
@@ -16,8 +16,7 @@ import { CACHE_TTL_MS, collectCacheMisses, computeCacheWaste, detectCacheMiss, }
|
|
|
16
16
|
import { FooterDataProvider } from "../../core/footer-data-provider.js";
|
|
17
17
|
import { configureHttpDispatcher, formatHttpIdleTimeoutMs } from "../../core/http-dispatcher.js";
|
|
18
18
|
import { KeybindingsManager } from "../../core/keybindings.js";
|
|
19
|
-
import {
|
|
20
|
-
import { defaultModelPerProvider, findExactModelReferenceMatch, resolveModelScope } from "../../core/model-resolver.js";
|
|
19
|
+
import { defaultModelPerProvider, findExactModelReferenceMatch, resolveModelScope, resolveModelScopeWithDiagnostics, } from "../../core/model-resolver.js";
|
|
21
20
|
import { DefaultPackageManager } from "../../core/package-manager.js";
|
|
22
21
|
import { getPiClientUpdateMarkerPath, PI_CLIENT_RUNTIME_RELOAD_EXIT_CODE, readPiClientUpdateMarker, writePiClientRuntimeReloadState, } from "../../core/pi-client-runtime-update.js";
|
|
23
22
|
import { formatMissingSessionCwdPrompt, MissingSessionCwdError } from "../../core/session-cwd.js";
|
|
@@ -1447,6 +1446,15 @@ export class InteractiveMode {
|
|
|
1447
1446
|
}
|
|
1448
1447
|
this.ui.requestRender();
|
|
1449
1448
|
}
|
|
1449
|
+
restoreWorkingIndicator() {
|
|
1450
|
+
if (!this.session.isStreaming || !this.workingVisible) {
|
|
1451
|
+
return;
|
|
1452
|
+
}
|
|
1453
|
+
if (this.settingsManager.getShowTerminalProgress()) {
|
|
1454
|
+
this.ui.terminal.setProgress(true);
|
|
1455
|
+
}
|
|
1456
|
+
this.showStatusIndicator(new WorkingStatusIndicator(this.ui, this.workingMessage ?? this.defaultWorkingMessage, this.workingIndicatorOptions));
|
|
1457
|
+
}
|
|
1450
1458
|
setHiddenThinkingLabel(label) {
|
|
1451
1459
|
this.hiddenThinkingLabel = label ?? this.defaultHiddenThinkingLabel;
|
|
1452
1460
|
for (const child of this.chatContainer.children) {
|
|
@@ -2452,10 +2460,6 @@ export class InteractiveMode {
|
|
|
2452
2460
|
break;
|
|
2453
2461
|
}
|
|
2454
2462
|
case "agent_end":
|
|
2455
|
-
if (this.settingsManager.getShowTerminalProgress()) {
|
|
2456
|
-
this.ui.terminal.setProgress(false);
|
|
2457
|
-
}
|
|
2458
|
-
this.clearStatusIndicator("working");
|
|
2459
2463
|
if (this.streamingComponent) {
|
|
2460
2464
|
this.chatContainer.removeChild(this.streamingComponent);
|
|
2461
2465
|
this.streamingComponent = undefined;
|
|
@@ -2465,7 +2469,12 @@ export class InteractiveMode {
|
|
|
2465
2469
|
this.ui.requestRender();
|
|
2466
2470
|
break;
|
|
2467
2471
|
case "agent_settled":
|
|
2472
|
+
if (this.settingsManager.getShowTerminalProgress()) {
|
|
2473
|
+
this.ui.terminal.setProgress(false);
|
|
2474
|
+
}
|
|
2475
|
+
this.clearStatusIndicator("working");
|
|
2468
2476
|
await this.checkShutdownRequested();
|
|
2477
|
+
this.ui.requestRender();
|
|
2469
2478
|
break;
|
|
2470
2479
|
case "compaction_start": {
|
|
2471
2480
|
if (this.settingsManager.getShowTerminalProgress()) {
|
|
@@ -2498,9 +2507,7 @@ export class InteractiveMode {
|
|
|
2498
2507
|
}
|
|
2499
2508
|
}
|
|
2500
2509
|
else if (event.result) {
|
|
2501
|
-
this.chatContainer.clear();
|
|
2502
2510
|
this.rebuildChatFromMessages();
|
|
2503
|
-
this.addMessageToChat(createCompactionSummaryMessage(event.result.summary, event.result.tokensBefore, new Date().toISOString()));
|
|
2504
2511
|
this.footer.invalidate();
|
|
2505
2512
|
}
|
|
2506
2513
|
else if (event.errorMessage) {
|
|
@@ -2512,6 +2519,7 @@ export class InteractiveMode {
|
|
|
2512
2519
|
this.chatContainer.addChild(new Text(theme.fg("error", event.errorMessage), 1, 0));
|
|
2513
2520
|
}
|
|
2514
2521
|
}
|
|
2522
|
+
this.restoreWorkingIndicator();
|
|
2515
2523
|
void this.flushCompactionQueue({ willRetry: event.willRetry });
|
|
2516
2524
|
this.ui.requestRender();
|
|
2517
2525
|
break;
|
|
@@ -2537,6 +2545,7 @@ export class InteractiveMode {
|
|
|
2537
2545
|
if (!event.success) {
|
|
2538
2546
|
this.showError(`Retry failed after ${event.attempt} attempts: ${event.finalError || "Unknown error"}`);
|
|
2539
2547
|
}
|
|
2548
|
+
this.restoreWorkingIndicator();
|
|
2540
2549
|
this.ui.requestRender();
|
|
2541
2550
|
break;
|
|
2542
2551
|
}
|
|
@@ -2629,7 +2638,7 @@ export class InteractiveMode {
|
|
|
2629
2638
|
case "custom": {
|
|
2630
2639
|
if (message.display) {
|
|
2631
2640
|
const renderer = this.session.extensionRunner.getMessageRenderer(message.customType);
|
|
2632
|
-
const component = new CustomMessageComponent(message, renderer, this.getMarkdownThemeWithSettings());
|
|
2641
|
+
const component = new CustomMessageComponent(message, renderer, this.getMarkdownThemeWithSettings(), this.outputPad);
|
|
2633
2642
|
component.setExpanded(this.toolOutputExpanded);
|
|
2634
2643
|
this.chatContainer.addChild(component);
|
|
2635
2644
|
}
|
|
@@ -2766,8 +2775,8 @@ export class InteractiveMode {
|
|
|
2766
2775
|
this.ui.requestRender();
|
|
2767
2776
|
}
|
|
2768
2777
|
/**
|
|
2769
|
-
* Render session entries to chat. Used for initial load and
|
|
2770
|
-
* @param entries
|
|
2778
|
+
* Render session entries to chat. Used for initial load and transcript rebuilds.
|
|
2779
|
+
* @param entries Active-branch session entries to render
|
|
2771
2780
|
* @param options.updateFooter Update footer state
|
|
2772
2781
|
* @param options.populateHistory Add user messages to editor history
|
|
2773
2782
|
*/
|
|
@@ -2810,7 +2819,7 @@ export class InteractiveMode {
|
|
|
2810
2819
|
this.chatContainer.addChild(new Text(text, 1, 0));
|
|
2811
2820
|
}
|
|
2812
2821
|
renderInitialMessages() {
|
|
2813
|
-
const entries = this.sessionManager.
|
|
2822
|
+
const entries = this.sessionManager.getBranch();
|
|
2814
2823
|
this.renderSessionEntries(entries, {
|
|
2815
2824
|
updateFooter: true,
|
|
2816
2825
|
populateHistory: true,
|
|
@@ -2847,7 +2856,7 @@ export class InteractiveMode {
|
|
|
2847
2856
|
}
|
|
2848
2857
|
rebuildChatFromMessages() {
|
|
2849
2858
|
this.chatContainer.clear();
|
|
2850
|
-
this.renderSessionEntries(this.sessionManager.
|
|
2859
|
+
this.renderSessionEntries(this.sessionManager.getBranch());
|
|
2851
2860
|
}
|
|
2852
2861
|
// =========================================================================
|
|
2853
2862
|
// Key handlers
|
|
@@ -3532,7 +3541,9 @@ export class InteractiveMode {
|
|
|
3532
3541
|
this.outputPad = padding;
|
|
3533
3542
|
if (this.streamingComponent || this.session.isStreaming) {
|
|
3534
3543
|
for (const child of this.chatContainer.children) {
|
|
3535
|
-
if (child instanceof AssistantMessageComponent ||
|
|
3544
|
+
if (child instanceof AssistantMessageComponent ||
|
|
3545
|
+
child instanceof CustomMessageComponent ||
|
|
3546
|
+
child instanceof UserMessageComponent) {
|
|
3536
3547
|
child.setOutputPad(padding);
|
|
3537
3548
|
}
|
|
3538
3549
|
}
|
|
@@ -3717,12 +3728,17 @@ export class InteractiveMode {
|
|
|
3717
3728
|
// Get all available models
|
|
3718
3729
|
await this.session.modelRuntime.refresh();
|
|
3719
3730
|
const allModels = [...(await this.session.modelRuntime.getAvailable())];
|
|
3720
|
-
|
|
3731
|
+
const allModelIds = new Set(allModels.map((model) => `${model.provider}/${model.id}`));
|
|
3732
|
+
const configuredPatterns = this.settingsManager.getEnabledModels();
|
|
3733
|
+
const sessionScopedModels = this.session.scopedModels;
|
|
3734
|
+
if (allModels.length === 0 && !configuredPatterns?.length && sessionScopedModels.length === 0) {
|
|
3721
3735
|
this.showStatus("No models available");
|
|
3722
3736
|
return;
|
|
3723
3737
|
}
|
|
3738
|
+
const configuredScope = configuredPatterns?.length
|
|
3739
|
+
? await resolveModelScopeWithDiagnostics(configuredPatterns, this.session.modelRuntime)
|
|
3740
|
+
: undefined;
|
|
3724
3741
|
// Check if session has scoped models (from previous session-only changes or CLI --models)
|
|
3725
|
-
const sessionScopedModels = this.session.scopedModels;
|
|
3726
3742
|
const hasSessionScope = sessionScopedModels.length > 0;
|
|
3727
3743
|
// Build enabled model IDs from session state or settings
|
|
3728
3744
|
let currentEnabledIds = null;
|
|
@@ -3730,18 +3746,22 @@ export class InteractiveMode {
|
|
|
3730
3746
|
// Use current session's scoped models
|
|
3731
3747
|
currentEnabledIds = sessionScopedModels.map((scoped) => `${scoped.model.provider}/${scoped.model.id}`);
|
|
3732
3748
|
}
|
|
3733
|
-
else {
|
|
3734
|
-
|
|
3735
|
-
|
|
3736
|
-
|
|
3737
|
-
|
|
3738
|
-
|
|
3739
|
-
|
|
3749
|
+
else if (configuredScope) {
|
|
3750
|
+
currentEnabledIds = configuredScope.scopedModels.map((scoped) => `${scoped.model.provider}/${scoped.model.id}`);
|
|
3751
|
+
}
|
|
3752
|
+
for (const diagnostic of configuredScope?.diagnostics ?? []) {
|
|
3753
|
+
if (diagnostic.code !== "no-match")
|
|
3754
|
+
continue;
|
|
3755
|
+
currentEnabledIds ??= [];
|
|
3756
|
+
if (!currentEnabledIds.includes(diagnostic.pattern))
|
|
3757
|
+
currentEnabledIds.push(diagnostic.pattern);
|
|
3740
3758
|
}
|
|
3741
3759
|
// Helper to update session's scoped models (session-only, no persist)
|
|
3742
3760
|
const updateSessionModels = async (enabledIds) => {
|
|
3743
3761
|
currentEnabledIds = enabledIds === null ? null : [...enabledIds];
|
|
3744
|
-
|
|
3762
|
+
const hasEnabledAvailableModel = enabledIds?.some((id) => allModelIds.has(id)) ?? false;
|
|
3763
|
+
const allAvailableModelsEnabled = enabledIds !== null && [...allModelIds].every((id) => enabledIds.includes(id));
|
|
3764
|
+
if (enabledIds && hasEnabledAvailableModel && !allAvailableModelsEnabled) {
|
|
3745
3765
|
const newScopedModels = await resolveModelScope(enabledIds, this.session.modelRuntime);
|
|
3746
3766
|
this.session.setScopedModels(newScopedModels.map((sm) => ({
|
|
3747
3767
|
model: sm.model,
|
|
@@ -3765,9 +3785,10 @@ export class InteractiveMode {
|
|
|
3765
3785
|
},
|
|
3766
3786
|
onPersist: (enabledIds) => {
|
|
3767
3787
|
// Persist to settings
|
|
3768
|
-
const
|
|
3769
|
-
|
|
3770
|
-
|
|
3788
|
+
const allEnabled = enabledIds !== null &&
|
|
3789
|
+
enabledIds.length === allModels.length &&
|
|
3790
|
+
enabledIds.every((id) => allModelIds.has(id));
|
|
3791
|
+
const newPatterns = enabledIds === null || allEnabled ? undefined : enabledIds;
|
|
3771
3792
|
this.settingsManager.setEnabledModels(newPatterns ? [...newPatterns] : undefined);
|
|
3772
3793
|
this.showStatus("Model selection saved to settings");
|
|
3773
3794
|
},
|