@earendil-works/pi-coding-agent 0.81.0 → 0.82.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 +59 -0
- package/README.md +13 -0
- package/dist/cli/config-selector.d.ts.map +1 -1
- package/dist/cli/config-selector.js +1 -1
- package/dist/cli/config-selector.js.map +1 -1
- package/dist/cli/startup-ui.d.ts.map +1 -1
- package/dist/cli/startup-ui.js +1 -1
- package/dist/cli/startup-ui.js.map +1 -1
- package/dist/core/agent-session.d.ts +33 -0
- package/dist/core/agent-session.d.ts.map +1 -1
- package/dist/core/agent-session.js +37 -3
- package/dist/core/agent-session.js.map +1 -1
- package/dist/core/compaction/branch-summarization.d.ts +5 -0
- package/dist/core/compaction/branch-summarization.d.ts.map +1 -1
- package/dist/core/compaction/branch-summarization.js +5 -7
- package/dist/core/compaction/branch-summarization.js.map +1 -1
- package/dist/core/compaction/compaction.d.ts +13 -4
- package/dist/core/compaction/compaction.d.ts.map +1 -1
- package/dist/core/compaction/compaction.js +29 -17
- package/dist/core/compaction/compaction.js.map +1 -1
- package/dist/core/extensions/runner.d.ts.map +1 -1
- package/dist/core/extensions/runner.js +4 -0
- package/dist/core/extensions/runner.js.map +1 -1
- package/dist/core/extensions/types.d.ts +5 -1
- package/dist/core/extensions/types.d.ts.map +1 -1
- package/dist/core/extensions/types.js.map +1 -1
- package/dist/core/model-config.d.ts +30 -0
- package/dist/core/model-config.d.ts.map +1 -1
- package/dist/core/model-config.js +6 -0
- package/dist/core/model-config.js.map +1 -1
- package/dist/core/model-registry.d.ts.map +1 -1
- package/dist/core/model-registry.js +2 -2
- 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 +7 -0
- package/dist/core/model-resolver.js.map +1 -1
- package/dist/core/model-runtime.d.ts +0 -1
- package/dist/core/model-runtime.d.ts.map +1 -1
- package/dist/core/model-runtime.js +3 -5
- package/dist/core/model-runtime.js.map +1 -1
- package/dist/core/remote-catalog-provider.d.ts +1 -1
- package/dist/core/remote-catalog-provider.d.ts.map +1 -1
- package/dist/core/remote-catalog-provider.js +5 -10
- package/dist/core/remote-catalog-provider.js.map +1 -1
- package/dist/core/sdk.d.ts.map +1 -1
- package/dist/core/sdk.js +7 -3
- package/dist/core/sdk.js.map +1 -1
- package/dist/core/settings-manager.d.ts +1 -1
- package/dist/core/settings-manager.d.ts.map +1 -1
- package/dist/core/settings-manager.js.map +1 -1
- package/dist/core/system-prompt.d.ts.map +1 -1
- package/dist/core/system-prompt.js +1 -1
- package/dist/core/system-prompt.js.map +1 -1
- package/dist/core/tools/bash.d.ts +2 -0
- package/dist/core/tools/bash.d.ts.map +1 -1
- package/dist/core/tools/bash.js +34 -5
- package/dist/core/tools/bash.js.map +1 -1
- package/dist/core/tools/tool-definition-wrapper.d.ts.map +1 -1
- package/dist/core/tools/tool-definition-wrapper.js +3 -1
- package/dist/core/tools/tool-definition-wrapper.js.map +1 -1
- package/dist/extensions/llama/provider.d.ts.map +1 -1
- package/dist/extensions/llama/provider.js +1 -2
- package/dist/extensions/llama/provider.js.map +1 -1
- package/dist/main.d.ts.map +1 -1
- package/dist/main.js +2 -1
- package/dist/main.js.map +1 -1
- package/dist/modes/interactive/components/extension-editor.d.ts +1 -2
- package/dist/modes/interactive/components/extension-editor.d.ts.map +1 -1
- package/dist/modes/interactive/components/extension-editor.js +16 -46
- package/dist/modes/interactive/components/extension-editor.js.map +1 -1
- package/dist/modes/interactive/external-editor.d.ts +12 -0
- package/dist/modes/interactive/external-editor.d.ts.map +1 -0
- package/dist/modes/interactive/external-editor.js +37 -0
- package/dist/modes/interactive/external-editor.js.map +1 -0
- package/dist/modes/interactive/interactive-mode.d.ts +2 -1
- package/dist/modes/interactive/interactive-mode.d.ts.map +1 -1
- package/dist/modes/interactive/interactive-mode.js +58 -46
- 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 +1 -0
- package/dist/modes/rpc/rpc-mode.js.map +1 -1
- package/dist/utils/clipboard.d.ts.map +1 -1
- package/dist/utils/clipboard.js +19 -8
- package/dist/utils/clipboard.js.map +1 -1
- package/dist/utils/version-check.d.ts.map +1 -1
- package/dist/utils/version-check.js +3 -1
- package/dist/utils/version-check.js.map +1 -1
- package/docs/compaction.md +1 -1
- package/docs/custom-provider.md +5 -2
- package/docs/environment-variables.md +88 -0
- package/docs/extensions.md +11 -3
- package/docs/index.md +1 -0
- package/docs/json.md +5 -1
- package/docs/models.md +6 -2
- package/docs/providers.md +8 -1
- package/docs/rpc.md +56 -6
- package/docs/sdk.md +3 -0
- package/docs/settings.md +1 -1
- package/docs/usage.md +0 -13
- package/examples/extensions/custom-compaction.ts +3 -0
- 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/handoff.ts +9 -1
- package/examples/extensions/sandbox/package-lock.json +2 -2
- package/examples/extensions/sandbox/package.json +1 -1
- package/examples/extensions/summarize.ts +3 -0
- package/examples/extensions/with-deps/package-lock.json +2 -2
- package/examples/extensions/with-deps/package.json +1 -1
- package/npm-shrinkwrap.json +16 -15
- package/package.json +5 -4
|
@@ -1420,7 +1420,7 @@ export class AgentSession {
|
|
|
1420
1420
|
}
|
|
1421
1421
|
else {
|
|
1422
1422
|
// Generate compaction result
|
|
1423
|
-
const result = await compact(preparation, this.model, apiKey, headers, customInstructions, this._compactionAbortController.signal, this.thinkingLevel, this.agent.streamFunction, env);
|
|
1423
|
+
const result = await compact(preparation, this.model, apiKey, headers, customInstructions, this._compactionAbortController.signal, this.thinkingLevel, this.agent.streamFunction, env, this.settingsManager.getRetrySettings(), this._summarizationRetryCallbacks({ source: "compaction", reason: "manual" }));
|
|
1424
1424
|
summary = result.summary;
|
|
1425
1425
|
firstKeptEntryId = result.firstKeptEntryId;
|
|
1426
1426
|
tokensBefore = result.tokensBefore;
|
|
@@ -1659,7 +1659,7 @@ export class AgentSession {
|
|
|
1659
1659
|
}
|
|
1660
1660
|
else {
|
|
1661
1661
|
// Generate compaction result
|
|
1662
|
-
const compactResult = await compact(preparation, this.model, apiKey, headers, undefined, this._autoCompactionAbortController.signal, this.thinkingLevel, this.agent.streamFunction, env);
|
|
1662
|
+
const compactResult = await compact(preparation, this.model, apiKey, headers, undefined, this._autoCompactionAbortController.signal, this.thinkingLevel, this.agent.streamFunction, env, this.settingsManager.getRetrySettings(), this._summarizationRetryCallbacks({ source: "compaction", reason }));
|
|
1663
1663
|
summary = compactResult.summary;
|
|
1664
1664
|
firstKeptEntryId = compactResult.firstKeptEntryId;
|
|
1665
1665
|
tokensBefore = compactResult.tokensBefore;
|
|
@@ -2088,6 +2088,34 @@ export class AgentSession {
|
|
|
2088
2088
|
return false;
|
|
2089
2089
|
return isRetryableAssistantError(message);
|
|
2090
2090
|
}
|
|
2091
|
+
/**
|
|
2092
|
+
* Retry policy + callbacks shared by compaction and branch-summary summarization calls.
|
|
2093
|
+
* Uses the same `settings.retry` budget/backoff as agent-turn retries so a single transient
|
|
2094
|
+
* stream drop no longer fails the whole operation. `source` carries the context
|
|
2095
|
+
* the TUI needs to render the retry and recreate the underlying indicator.
|
|
2096
|
+
*/
|
|
2097
|
+
_summarizationRetryCallbacks(source) {
|
|
2098
|
+
return {
|
|
2099
|
+
onRetryScheduled: (attempt, maxAttempts, delayMs, errorMessage) => {
|
|
2100
|
+
this._emit({
|
|
2101
|
+
type: "summarization_retry_scheduled",
|
|
2102
|
+
attempt,
|
|
2103
|
+
maxAttempts,
|
|
2104
|
+
delayMs,
|
|
2105
|
+
errorMessage,
|
|
2106
|
+
});
|
|
2107
|
+
},
|
|
2108
|
+
onRetryAttemptStart: () => {
|
|
2109
|
+
this._emit({
|
|
2110
|
+
type: "summarization_retry_attempt_start",
|
|
2111
|
+
...source,
|
|
2112
|
+
});
|
|
2113
|
+
},
|
|
2114
|
+
onRetryFinished: () => {
|
|
2115
|
+
this._emit({ type: "summarization_retry_finished" });
|
|
2116
|
+
},
|
|
2117
|
+
};
|
|
2118
|
+
}
|
|
2091
2119
|
/**
|
|
2092
2120
|
* Prepare a retryable error for continuation with exponential backoff.
|
|
2093
2121
|
* @returns true if the caller should continue the agent, false otherwise
|
|
@@ -2167,6 +2195,7 @@ export class AgentSession {
|
|
|
2167
2195
|
* @param command The bash command to execute
|
|
2168
2196
|
* @param onChunk Optional streaming callback for output
|
|
2169
2197
|
* @param options.excludeFromContext If true, command output won't be sent to LLM (!! prefix)
|
|
2198
|
+
* @param options.id Optional identifier included in bash execution update events
|
|
2170
2199
|
* @param options.operations Custom BashOperations for remote execution
|
|
2171
2200
|
*/
|
|
2172
2201
|
async executeBash(command, onChunk, options) {
|
|
@@ -2177,7 +2206,10 @@ export class AgentSession {
|
|
|
2177
2206
|
const resolvedCommand = prefix ? `${prefix}\n${command}` : command;
|
|
2178
2207
|
try {
|
|
2179
2208
|
const result = await executeBashWithOperations(resolvedCommand, this.sessionManager.getCwd(), options?.operations ?? createLocalBashOperations({ shellPath }), {
|
|
2180
|
-
onChunk
|
|
2209
|
+
onChunk: (delta) => {
|
|
2210
|
+
onChunk?.(delta);
|
|
2211
|
+
this._emit({ type: "bash_execution_update", id: options?.id, delta });
|
|
2212
|
+
},
|
|
2181
2213
|
signal: this._bashAbortController.signal,
|
|
2182
2214
|
});
|
|
2183
2215
|
this.recordBashResult(command, result, options);
|
|
@@ -2348,6 +2380,8 @@ export class AgentSession {
|
|
|
2348
2380
|
replaceInstructions,
|
|
2349
2381
|
reserveTokens: branchSummarySettings.reserveTokens,
|
|
2350
2382
|
streamFn: this.agent.streamFunction,
|
|
2383
|
+
retry: this.settingsManager.getRetrySettings(),
|
|
2384
|
+
callbacks: this._summarizationRetryCallbacks({ source: "branchSummary" }),
|
|
2351
2385
|
});
|
|
2352
2386
|
if (result.aborted) {
|
|
2353
2387
|
return { cancelled: true, aborted: true };
|