@earendil-works/pi-coding-agent 0.82.0 → 0.83.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 +72 -0
- package/README.md +1 -1
- package/dist/cli/args.d.ts.map +1 -1
- package/dist/cli/args.js +9 -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 -13
- 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 +9 -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-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/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/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 +15 -0
- package/dist/core/resource-loader.d.ts.map +1 -1
- package/dist/core/resource-loader.js +66 -9
- 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 +7 -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/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/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/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.map +1 -1
- package/dist/modes/interactive/interactive-mode.js +48 -22
- 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 +5 -3
- 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/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/examples/sdk/12-full-control.ts +2 -0
- package/npm-shrinkwrap.json +18 -18
- package/package.json +5 -5
|
@@ -102,7 +102,7 @@ export class AgentSession {
|
|
|
102
102
|
_retryAbortController = undefined;
|
|
103
103
|
_retryAttempt = 0;
|
|
104
104
|
// Bash execution state
|
|
105
|
-
|
|
105
|
+
_bashAbortControllers = new Set();
|
|
106
106
|
_pendingBashMessages = [];
|
|
107
107
|
// Extension system
|
|
108
108
|
_extensionRunner;
|
|
@@ -174,7 +174,7 @@ export class AgentSession {
|
|
|
174
174
|
}
|
|
175
175
|
throw error;
|
|
176
176
|
}
|
|
177
|
-
if (result
|
|
177
|
+
if (result && (result.auth.apiKey || result.auth.headers)) {
|
|
178
178
|
return {
|
|
179
179
|
apiKey: result.auth.apiKey,
|
|
180
180
|
headers: withoutDeletedHeaders(result.auth.headers),
|
|
@@ -1599,12 +1599,7 @@ export class AgentSession {
|
|
|
1599
1599
|
let headers;
|
|
1600
1600
|
let env;
|
|
1601
1601
|
if (this.agent.streamFunction === streamSimple) {
|
|
1602
|
-
|
|
1603
|
-
if (!authResult?.auth.apiKey)
|
|
1604
|
-
return false;
|
|
1605
|
-
apiKey = authResult.auth.apiKey;
|
|
1606
|
-
headers = withoutDeletedHeaders(authResult.auth.headers);
|
|
1607
|
-
env = authResult.env;
|
|
1602
|
+
({ apiKey, headers, env } = await this._getRequiredRequestAuth(this.model));
|
|
1608
1603
|
}
|
|
1609
1604
|
else {
|
|
1610
1605
|
({ apiKey, headers, env } = await this._getSummarizationRequestAuth(this.model));
|
|
@@ -1897,6 +1892,7 @@ export class AgentSession {
|
|
|
1897
1892
|
setThinkingLevel: (level) => this.setThinkingLevel(level),
|
|
1898
1893
|
}, {
|
|
1899
1894
|
getModel: () => this.model,
|
|
1895
|
+
getScopedModels: () => this._scopedModels,
|
|
1900
1896
|
isIdle: () => this.isIdle,
|
|
1901
1897
|
isProjectTrusted: () => this.settingsManager.isProjectTrusted(),
|
|
1902
1898
|
getSignal: () => this.agent.signal,
|
|
@@ -2199,7 +2195,8 @@ export class AgentSession {
|
|
|
2199
2195
|
* @param options.operations Custom BashOperations for remote execution
|
|
2200
2196
|
*/
|
|
2201
2197
|
async executeBash(command, onChunk, options) {
|
|
2202
|
-
|
|
2198
|
+
const abortController = new AbortController();
|
|
2199
|
+
this._bashAbortControllers.add(abortController);
|
|
2203
2200
|
// Apply command prefix if configured (e.g., "shopt -s expand_aliases" for alias support)
|
|
2204
2201
|
const prefix = this.settingsManager.getShellCommandPrefix();
|
|
2205
2202
|
const shellPath = this.settingsManager.getShellPath();
|
|
@@ -2210,13 +2207,13 @@ export class AgentSession {
|
|
|
2210
2207
|
onChunk?.(delta);
|
|
2211
2208
|
this._emit({ type: "bash_execution_update", id: options?.id, delta });
|
|
2212
2209
|
},
|
|
2213
|
-
signal:
|
|
2210
|
+
signal: abortController.signal,
|
|
2214
2211
|
});
|
|
2215
2212
|
this.recordBashResult(command, result, options);
|
|
2216
2213
|
return result;
|
|
2217
2214
|
}
|
|
2218
2215
|
finally {
|
|
2219
|
-
this.
|
|
2216
|
+
this._bashAbortControllers.delete(abortController);
|
|
2220
2217
|
}
|
|
2221
2218
|
}
|
|
2222
2219
|
/**
|
|
@@ -2251,11 +2248,13 @@ export class AgentSession {
|
|
|
2251
2248
|
* Cancel running bash command.
|
|
2252
2249
|
*/
|
|
2253
2250
|
abortBash() {
|
|
2254
|
-
this.
|
|
2251
|
+
for (const abortController of [...this._bashAbortControllers]) {
|
|
2252
|
+
abortController.abort();
|
|
2253
|
+
}
|
|
2255
2254
|
}
|
|
2256
2255
|
/** Whether a bash command is currently running */
|
|
2257
2256
|
get isBashRunning() {
|
|
2258
|
-
return this.
|
|
2257
|
+
return this._bashAbortControllers.size > 0;
|
|
2259
2258
|
}
|
|
2260
2259
|
/** Whether there are pending bash messages waiting to be flushed */
|
|
2261
2260
|
get hasPendingBashMessages() {
|
|
@@ -2303,6 +2302,9 @@ export class AgentSession {
|
|
|
2303
2302
|
* @returns Result with editorText (if user message) and cancelled status
|
|
2304
2303
|
*/
|
|
2305
2304
|
async navigateTree(targetId, options = {}) {
|
|
2305
|
+
if (this.isStreaming) {
|
|
2306
|
+
throw new Error("Wait for the current response to finish before navigating the session tree.");
|
|
2307
|
+
}
|
|
2306
2308
|
const oldLeafId = this.sessionManager.getLeafId();
|
|
2307
2309
|
// No-op if already at target
|
|
2308
2310
|
if (targetId === oldLeafId) {
|