@averyyy/pi-coding-agent 0.82.1-piclient.8 → 0.83.0-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 +46 -0
- package/README.md +1 -1
- package/dist/cli/args.d.ts.map +1 -1
- package/dist/cli/args.js +8 -1
- package/dist/cli/args.js.map +1 -1
- package/dist/cli/credential-print.d.ts +23 -0
- package/dist/cli/credential-print.d.ts.map +1 -0
- package/dist/cli/credential-print.js +116 -0
- package/dist/cli/credential-print.js.map +1 -0
- package/dist/core/agent-session-runtime.d.ts.map +1 -1
- package/dist/core/agent-session-runtime.js +3 -0
- package/dist/core/agent-session-runtime.js.map +1 -1
- package/dist/core/agent-session.d.ts +1 -1
- package/dist/core/agent-session.d.ts.map +1 -1
- package/dist/core/agent-session.js +15 -22
- package/dist/core/agent-session.js.map +1 -1
- package/dist/core/extensions/runner.d.ts +1 -0
- package/dist/core/extensions/runner.d.ts.map +1 -1
- package/dist/core/extensions/runner.js +7 -0
- package/dist/core/extensions/runner.js.map +1 -1
- package/dist/core/extensions/types.d.ts +7 -0
- package/dist/core/extensions/types.d.ts.map +1 -1
- package/dist/core/extensions/types.js.map +1 -1
- package/dist/core/footer-data-provider.d.ts +10 -0
- package/dist/core/footer-data-provider.d.ts.map +1 -1
- package/dist/core/footer-data-provider.js +1 -1
- package/dist/core/footer-data-provider.js.map +1 -1
- package/dist/core/model-runtime.d.ts +2 -0
- package/dist/core/model-runtime.d.ts.map +1 -1
- package/dist/core/model-runtime.js.map +1 -1
- package/dist/core/package-manager.d.ts.map +1 -1
- package/dist/core/package-manager.js +13 -6
- package/dist/core/package-manager.js.map +1 -1
- package/dist/core/pi-server-client.d.ts.map +1 -1
- package/dist/core/pi-server-client.js +4 -10
- package/dist/core/pi-server-client.js.map +1 -1
- package/dist/core/resource-loader.d.ts +15 -0
- package/dist/core/resource-loader.d.ts.map +1 -1
- package/dist/core/resource-loader.js +63 -9
- package/dist/core/resource-loader.js.map +1 -1
- package/dist/core/sdk.d.ts +2 -5
- package/dist/core/sdk.d.ts.map +1 -1
- package/dist/core/sdk.js +3 -24
- package/dist/core/sdk.js.map +1 -1
- package/dist/extensions/llama/provider.d.ts.map +1 -1
- package/dist/extensions/llama/provider.js +1 -1
- package/dist/extensions/llama/provider.js.map +1 -1
- package/dist/main.d.ts.map +1 -1
- package/dist/main.js +43 -0
- package/dist/main.js.map +1 -1
- package/dist/modes/interactive/components/model-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/model-selector.js +4 -1
- package/dist/modes/interactive/components/model-selector.js.map +1 -1
- package/dist/modes/interactive/interactive-mode.d.ts.map +1 -1
- package/dist/modes/interactive/interactive-mode.js +20 -6
- package/dist/modes/interactive/interactive-mode.js.map +1 -1
- package/dist/modes/rpc/rpc-mode.d.ts.map +1 -1
- package/dist/modes/rpc/rpc-mode.js +13 -0
- package/dist/modes/rpc/rpc-mode.js.map +1 -1
- package/docs/custom-provider.md +9 -3
- package/docs/extensions.md +3 -1
- package/docs/providers.md +1 -0
- package/docs/session-format.md +2 -0
- package/examples/extensions/custom-provider-anthropic/index.ts +8 -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/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/examples/sdk/12-full-control.ts +2 -0
- package/package.json +5 -5
|
@@ -29,7 +29,7 @@ import { createToolHtmlRenderer } from "./export-html/tool-renderer.js";
|
|
|
29
29
|
import { ExtensionRunner, wrapRegisteredTools, } from "./extensions/index.js";
|
|
30
30
|
import { emitSessionShutdownEvent } from "./extensions/runner.js";
|
|
31
31
|
import { ModelRegistry } from "./model-registry.js";
|
|
32
|
-
import { compactPiServer
|
|
32
|
+
import { compactPiServer } from "./pi-server-client.js";
|
|
33
33
|
import { expandPromptTemplate } from "./prompt-templates.js";
|
|
34
34
|
import { CURRENT_SESSION_VERSION, getLatestCompactionEntry } from "./session-manager.js";
|
|
35
35
|
import { createSyntheticSourceInfo } from "./source-info.js";
|
|
@@ -182,7 +182,7 @@ export class AgentSession {
|
|
|
182
182
|
_retryAbortController = undefined;
|
|
183
183
|
_retryAttempt = 0;
|
|
184
184
|
// Bash execution state
|
|
185
|
-
|
|
185
|
+
_bashAbortControllers = new Set();
|
|
186
186
|
_pendingBashMessages = [];
|
|
187
187
|
_validationModifiedFiles = new Set();
|
|
188
188
|
_validationFailure = undefined;
|
|
@@ -491,7 +491,7 @@ export class AgentSession {
|
|
|
491
491
|
// Track last assistant message for auto-compaction check
|
|
492
492
|
_lastAssistantMessage = undefined;
|
|
493
493
|
/** Internal handler for agent events - shared by subscribe and reconnect */
|
|
494
|
-
_handleAgentEvent = async (event,
|
|
494
|
+
_handleAgentEvent = async (event, _signal) => {
|
|
495
495
|
// When a user message starts, check if it's from either queue and remove it BEFORE emitting
|
|
496
496
|
// This ensures the UI sees the updated queue state
|
|
497
497
|
if (event.type === "message_start" && event.message.role === "user") {
|
|
@@ -549,13 +549,6 @@ export class AgentSession {
|
|
|
549
549
|
});
|
|
550
550
|
this._retryAttempt = 0;
|
|
551
551
|
}
|
|
552
|
-
if (isPiServerMode() && !this._isTerminalAssistantFailure(assistantMsg)) {
|
|
553
|
-
await syncPiServerTree(this.sessionId, {
|
|
554
|
-
systemPrompt: this.systemPrompt,
|
|
555
|
-
messages: this.agent.state.messages,
|
|
556
|
-
tools: this.agent.state.tools,
|
|
557
|
-
}, { entries: this.sessionManager.getEntries(), leafId: this.sessionManager.getLeafId() }, { signal, onHistoryReconciled: (snapshot) => this.reconcilePiServerHistory(snapshot) });
|
|
558
|
-
}
|
|
559
552
|
}
|
|
560
553
|
}
|
|
561
554
|
};
|
|
@@ -2360,6 +2353,7 @@ export class AgentSession {
|
|
|
2360
2353
|
setThinkingLevel: (level) => this.setThinkingLevel(level),
|
|
2361
2354
|
}, {
|
|
2362
2355
|
getModel: () => this.model,
|
|
2356
|
+
getScopedModels: () => this._scopedModels,
|
|
2363
2357
|
isIdle: () => this.isIdle,
|
|
2364
2358
|
isProjectTrusted: () => this.settingsManager.isProjectTrusted(),
|
|
2365
2359
|
getSignal: () => this.agent.signal,
|
|
@@ -2689,7 +2683,8 @@ export class AgentSession {
|
|
|
2689
2683
|
* @param options.operations Custom BashOperations for remote execution
|
|
2690
2684
|
*/
|
|
2691
2685
|
async executeBash(command, onChunk, options) {
|
|
2692
|
-
|
|
2686
|
+
const abortController = new AbortController();
|
|
2687
|
+
this._bashAbortControllers.add(abortController);
|
|
2693
2688
|
// Apply command prefix if configured (e.g., "shopt -s expand_aliases" for alias support)
|
|
2694
2689
|
const prefix = this.settingsManager.getShellCommandPrefix();
|
|
2695
2690
|
const shellPath = this.settingsManager.getShellPath();
|
|
@@ -2700,13 +2695,13 @@ export class AgentSession {
|
|
|
2700
2695
|
onChunk?.(delta);
|
|
2701
2696
|
this._emit({ type: "bash_execution_update", id: options?.id, delta });
|
|
2702
2697
|
},
|
|
2703
|
-
signal:
|
|
2698
|
+
signal: abortController.signal,
|
|
2704
2699
|
});
|
|
2705
2700
|
this.recordBashResult(command, result, options);
|
|
2706
2701
|
return result;
|
|
2707
2702
|
}
|
|
2708
2703
|
finally {
|
|
2709
|
-
this.
|
|
2704
|
+
this._bashAbortControllers.delete(abortController);
|
|
2710
2705
|
}
|
|
2711
2706
|
}
|
|
2712
2707
|
/**
|
|
@@ -2741,11 +2736,13 @@ export class AgentSession {
|
|
|
2741
2736
|
* Cancel running bash command.
|
|
2742
2737
|
*/
|
|
2743
2738
|
abortBash() {
|
|
2744
|
-
this.
|
|
2739
|
+
for (const abortController of [...this._bashAbortControllers]) {
|
|
2740
|
+
abortController.abort();
|
|
2741
|
+
}
|
|
2745
2742
|
}
|
|
2746
2743
|
/** Whether a bash command is currently running */
|
|
2747
2744
|
get isBashRunning() {
|
|
2748
|
-
return this.
|
|
2745
|
+
return this._bashAbortControllers.size > 0;
|
|
2749
2746
|
}
|
|
2750
2747
|
/** Whether there are pending bash messages waiting to be flushed */
|
|
2751
2748
|
get hasPendingBashMessages() {
|
|
@@ -2793,6 +2790,9 @@ export class AgentSession {
|
|
|
2793
2790
|
* @returns Result with editorText (if user message) and cancelled status
|
|
2794
2791
|
*/
|
|
2795
2792
|
async navigateTree(targetId, options = {}) {
|
|
2793
|
+
if (this.isStreaming) {
|
|
2794
|
+
throw new Error("Wait for the current response to finish before navigating the session tree.");
|
|
2795
|
+
}
|
|
2796
2796
|
const oldLeafId = this.sessionManager.getLeafId();
|
|
2797
2797
|
// No-op if already at target
|
|
2798
2798
|
if (targetId === oldLeafId) {
|
|
@@ -2935,13 +2935,6 @@ export class AgentSession {
|
|
|
2935
2935
|
// Update agent state
|
|
2936
2936
|
const sessionContext = this.sessionManager.buildSessionContext();
|
|
2937
2937
|
this.agent.state.messages = sessionContext.messages;
|
|
2938
|
-
if (isPiServerMode()) {
|
|
2939
|
-
await syncPiServerTree(this.sessionId, {
|
|
2940
|
-
systemPrompt: this.systemPrompt,
|
|
2941
|
-
messages: this.agent.state.messages,
|
|
2942
|
-
tools: this.agent.state.tools,
|
|
2943
|
-
}, { entries: this.sessionManager.getEntries(), leafId: this.sessionManager.getLeafId() }, { onHistoryReconciled: (snapshot) => this.reconcilePiServerHistory(snapshot) });
|
|
2944
|
-
}
|
|
2945
2938
|
// Emit session_tree event
|
|
2946
2939
|
await this._extensionRunner.emit({
|
|
2947
2940
|
type: "session_tree",
|