@mariozechner/pi-coding-agent 0.55.3 → 0.56.0
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 +64 -0
- package/README.md +1 -8
- 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/cli.d.ts.map +1 -1
- package/dist/cli.js +5 -0
- package/dist/cli.js.map +1 -1
- package/dist/core/agent-session.d.ts +14 -4
- package/dist/core/agent-session.d.ts.map +1 -1
- package/dist/core/agent-session.js +167 -49
- package/dist/core/agent-session.js.map +1 -1
- package/dist/core/auth-storage.d.ts +1 -1
- package/dist/core/auth-storage.d.ts.map +1 -1
- package/dist/core/auth-storage.js +2 -1
- package/dist/core/auth-storage.js.map +1 -1
- package/dist/core/compaction/compaction.d.ts.map +1 -1
- package/dist/core/compaction/compaction.js +4 -1
- package/dist/core/compaction/compaction.js.map +1 -1
- package/dist/core/export-html/tool-renderer.d.ts.map +1 -1
- package/dist/core/export-html/tool-renderer.js +6 -0
- package/dist/core/export-html/tool-renderer.js.map +1 -1
- package/dist/core/extensions/loader.d.ts.map +1 -1
- package/dist/core/extensions/loader.js +17 -3
- package/dist/core/extensions/loader.js.map +1 -1
- package/dist/core/extensions/runner.d.ts.map +1 -1
- package/dist/core/extensions/runner.js +1 -0
- package/dist/core/extensions/runner.js.map +1 -1
- package/dist/core/extensions/types.d.ts +8 -2
- package/dist/core/extensions/types.d.ts.map +1 -1
- package/dist/core/extensions/types.js.map +1 -1
- package/dist/core/model-registry.d.ts +1 -0
- package/dist/core/model-registry.d.ts.map +1 -1
- package/dist/core/model-registry.js +9 -6
- package/dist/core/model-registry.js.map +1 -1
- package/dist/core/model-resolver.d.ts.map +1 -1
- package/dist/core/model-resolver.js +35 -5
- package/dist/core/model-resolver.js.map +1 -1
- package/dist/core/sdk.d.ts +1 -1
- package/dist/core/sdk.d.ts.map +1 -1
- package/dist/core/sdk.js.map +1 -1
- package/dist/core/settings-manager.d.ts +3 -0
- package/dist/core/settings-manager.d.ts.map +1 -1
- package/dist/core/settings-manager.js +4 -0
- package/dist/core/settings-manager.js.map +1 -1
- package/dist/core/system-prompt.d.ts +4 -0
- package/dist/core/system-prompt.d.ts.map +1 -1
- package/dist/core/system-prompt.js +34 -12
- package/dist/core/system-prompt.js.map +1 -1
- package/dist/main.d.ts.map +1 -1
- package/dist/main.js +4 -4
- package/dist/main.js.map +1 -1
- package/dist/modes/interactive/components/extension-editor.d.ts +5 -2
- package/dist/modes/interactive/components/extension-editor.d.ts.map +1 -1
- package/dist/modes/interactive/components/extension-editor.js +8 -0
- package/dist/modes/interactive/components/extension-editor.js.map +1 -1
- package/dist/modes/interactive/components/login-dialog.d.ts.map +1 -1
- package/dist/modes/interactive/components/login-dialog.js +1 -1
- package/dist/modes/interactive/components/login-dialog.js.map +1 -1
- package/dist/modes/interactive/components/model-selector.d.ts +1 -1
- package/dist/modes/interactive/components/model-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/model-selector.js.map +1 -1
- package/dist/modes/interactive/components/oauth-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/oauth-selector.js +1 -1
- package/dist/modes/interactive/components/oauth-selector.js.map +1 -1
- package/dist/modes/interactive/components/session-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/session-selector.js +1 -1
- package/dist/modes/interactive/components/session-selector.js.map +1 -1
- package/dist/modes/interactive/components/tool-execution.d.ts +2 -0
- package/dist/modes/interactive/components/tool-execution.d.ts.map +1 -1
- package/dist/modes/interactive/components/tool-execution.js +28 -3
- package/dist/modes/interactive/components/tool-execution.js.map +1 -1
- package/dist/modes/interactive/components/user-message.d.ts +1 -0
- package/dist/modes/interactive/components/user-message.d.ts.map +1 -1
- package/dist/modes/interactive/components/user-message.js +11 -0
- package/dist/modes/interactive/components/user-message.js.map +1 -1
- package/dist/modes/interactive/interactive-mode.d.ts +1 -1
- package/dist/modes/interactive/interactive-mode.d.ts.map +1 -1
- package/dist/modes/interactive/interactive-mode.js +27 -26
- package/dist/modes/interactive/interactive-mode.js.map +1 -1
- package/dist/modes/interactive/theme/theme.d.ts.map +1 -1
- package/dist/modes/interactive/theme/theme.js +5 -0
- package/dist/modes/interactive/theme/theme.js.map +1 -1
- package/docs/custom-provider.md +10 -2
- package/docs/extensions.md +20 -1
- package/docs/providers.md +3 -1
- package/docs/settings.md +1 -0
- package/examples/extensions/README.md +1 -0
- package/examples/extensions/antigravity-image-gen.ts +3 -1
- 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/custom-provider-qwen-cli/package.json +1 -1
- package/examples/extensions/dynamic-tools.ts +74 -0
- package/examples/extensions/with-deps/package-lock.json +2 -2
- package/examples/extensions/with-deps/package.json +1 -1
- package/package.json +7 -5
|
@@ -6,7 +6,6 @@ import * as crypto from "node:crypto";
|
|
|
6
6
|
import * as fs from "node:fs";
|
|
7
7
|
import * as os from "node:os";
|
|
8
8
|
import * as path from "node:path";
|
|
9
|
-
import { getOAuthProviders, } from "@mariozechner/pi-ai";
|
|
10
9
|
import { CombinedAutocompleteProvider, Container, fuzzyFilter, Loader, Markdown, matchesKey, ProcessTerminal, Spacer, Text, TruncatedText, TUI, visibleWidth, } from "@mariozechner/pi-tui";
|
|
11
10
|
import { spawn, spawnSync } from "child_process";
|
|
12
11
|
import { APP_NAME, getAuthPath, getDebugLogPath, getShareViewerUrl, getUpdateInstruction, VERSION, } from "../../config.js";
|
|
@@ -1725,7 +1724,6 @@ export class InteractiveMode {
|
|
|
1725
1724
|
for (const content of this.streamingMessage.content) {
|
|
1726
1725
|
if (content.type === "toolCall") {
|
|
1727
1726
|
if (!this.pendingTools.has(content.id)) {
|
|
1728
|
-
this.chatContainer.addChild(new Text("", 0, 0));
|
|
1729
1727
|
const component = new ToolExecutionComponent(content.name, content.arguments, {
|
|
1730
1728
|
showImages: this.settingsManager.getShowImages(),
|
|
1731
1729
|
}, this.getRegisteredToolDefinition(content.name), this.ui);
|
|
@@ -2780,12 +2778,10 @@ export class InteractiveMode {
|
|
|
2780
2778
|
// Helper to update session's scoped models (session-only, no persist)
|
|
2781
2779
|
const updateSessionModels = async (enabledIds) => {
|
|
2782
2780
|
if (enabledIds.size > 0 && enabledIds.size < allModels.length) {
|
|
2783
|
-
// Use current session thinking level, not settings default
|
|
2784
|
-
const currentThinkingLevel = this.session.thinkingLevel;
|
|
2785
2781
|
const newScopedModels = await resolveModelScope(Array.from(enabledIds), this.session.modelRegistry);
|
|
2786
2782
|
this.session.setScopedModels(newScopedModels.map((sm) => ({
|
|
2787
2783
|
model: sm.model,
|
|
2788
|
-
thinkingLevel: sm.thinkingLevel
|
|
2784
|
+
thinkingLevel: sm.thinkingLevel,
|
|
2789
2785
|
})));
|
|
2790
2786
|
}
|
|
2791
2787
|
else {
|
|
@@ -2899,27 +2895,30 @@ export class InteractiveMode {
|
|
|
2899
2895
|
// Loop until user makes a complete choice or cancels to tree
|
|
2900
2896
|
let wantsSummary = false;
|
|
2901
2897
|
let customInstructions;
|
|
2902
|
-
|
|
2903
|
-
|
|
2904
|
-
|
|
2905
|
-
"Summarize",
|
|
2906
|
-
|
|
2907
|
-
|
|
2908
|
-
|
|
2909
|
-
|
|
2910
|
-
|
|
2911
|
-
|
|
2912
|
-
|
|
2913
|
-
|
|
2914
|
-
if (summaryChoice === "Summarize with custom prompt") {
|
|
2915
|
-
customInstructions = await this.showExtensionEditor("Custom summarization instructions");
|
|
2916
|
-
if (customInstructions === undefined) {
|
|
2917
|
-
// User cancelled - loop back to summary selector
|
|
2918
|
-
continue;
|
|
2898
|
+
// Check if we should skip the prompt (user preference to always default to no summary)
|
|
2899
|
+
if (!this.settingsManager.getBranchSummarySkipPrompt()) {
|
|
2900
|
+
while (true) {
|
|
2901
|
+
const summaryChoice = await this.showExtensionSelector("Summarize branch?", [
|
|
2902
|
+
"No summary",
|
|
2903
|
+
"Summarize",
|
|
2904
|
+
"Summarize with custom prompt",
|
|
2905
|
+
]);
|
|
2906
|
+
if (summaryChoice === undefined) {
|
|
2907
|
+
// User pressed escape - re-show tree selector with same selection
|
|
2908
|
+
this.showTreeSelector(entryId);
|
|
2909
|
+
return;
|
|
2919
2910
|
}
|
|
2911
|
+
wantsSummary = summaryChoice !== "No summary";
|
|
2912
|
+
if (summaryChoice === "Summarize with custom prompt") {
|
|
2913
|
+
customInstructions = await this.showExtensionEditor("Custom summarization instructions");
|
|
2914
|
+
if (customInstructions === undefined) {
|
|
2915
|
+
// User cancelled - loop back to summary selector
|
|
2916
|
+
continue;
|
|
2917
|
+
}
|
|
2918
|
+
}
|
|
2919
|
+
// User made a complete choice
|
|
2920
|
+
break;
|
|
2920
2921
|
}
|
|
2921
|
-
// User made a complete choice
|
|
2922
|
-
break;
|
|
2923
2922
|
}
|
|
2924
2923
|
// Set up escape handler and loader if summarizing
|
|
2925
2924
|
let summaryLoader;
|
|
@@ -3037,7 +3036,9 @@ export class InteractiveMode {
|
|
|
3037
3036
|
}
|
|
3038
3037
|
else {
|
|
3039
3038
|
// Logout flow
|
|
3040
|
-
const providerInfo =
|
|
3039
|
+
const providerInfo = this.session.modelRegistry.authStorage
|
|
3040
|
+
.getOAuthProviders()
|
|
3041
|
+
.find((p) => p.id === providerId);
|
|
3041
3042
|
const providerName = providerInfo?.name || providerId;
|
|
3042
3043
|
try {
|
|
3043
3044
|
this.session.modelRegistry.authStorage.logout(providerId);
|
|
@@ -3057,7 +3058,7 @@ export class InteractiveMode {
|
|
|
3057
3058
|
});
|
|
3058
3059
|
}
|
|
3059
3060
|
async showLoginDialog(providerId) {
|
|
3060
|
-
const providerInfo = getOAuthProviders().find((p) => p.id === providerId);
|
|
3061
|
+
const providerInfo = this.session.modelRegistry.authStorage.getOAuthProviders().find((p) => p.id === providerId);
|
|
3061
3062
|
const providerName = providerInfo?.name || providerId;
|
|
3062
3063
|
// Providers that use callback servers (can paste redirect URL)
|
|
3063
3064
|
const usesCallbackServer = providerInfo?.usesCallbackServer ?? false;
|