@averyyy/pi-coding-agent 0.82.1-piclient.4 → 0.82.1-piclient.6
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 +2 -2
- package/dist/core/agent-session.d.ts +0 -1
- package/dist/core/agent-session.d.ts.map +1 -1
- package/dist/core/agent-session.js +4 -27
- package/dist/core/agent-session.js.map +1 -1
- package/dist/core/model-runtime.d.ts +0 -7
- package/dist/core/model-runtime.d.ts.map +1 -1
- package/dist/core/model-runtime.js +0 -66
- package/dist/core/model-runtime.js.map +1 -1
- package/dist/core/pi-server-client.d.ts +1 -3
- package/dist/core/pi-server-client.d.ts.map +1 -1
- package/dist/core/pi-server-client.js +301 -55
- package/dist/core/pi-server-client.js.map +1 -1
- package/dist/core/pi-server-compact-state.d.ts +1 -1
- package/dist/core/pi-server-compact-state.d.ts.map +1 -1
- package/dist/core/pi-server-compact-state.js +2 -1
- package/dist/core/pi-server-compact-state.js.map +1 -1
- package/dist/core/pi-server-run-state.d.ts +2 -1
- package/dist/core/pi-server-run-state.d.ts.map +1 -1
- package/dist/core/pi-server-run-state.js +5 -3
- package/dist/core/pi-server-run-state.js.map +1 -1
- package/dist/core/sdk.d.ts.map +1 -1
- package/dist/core/sdk.js +0 -5
- package/dist/core/sdk.js.map +1 -1
- package/package.json +4 -4
- package/dist/core/pi-server-provider-execution.d.ts +0 -19
- package/dist/core/pi-server-provider-execution.d.ts.map +0 -1
- package/dist/core/pi-server-provider-execution.js +0 -43
- package/dist/core/pi-server-provider-execution.js.map +0 -1
- package/dist/core/provider-execution-contract.d.ts +0 -36
- package/dist/core/provider-execution-contract.d.ts.map +0 -1
- package/dist/core/provider-execution-contract.js +0 -30
- package/dist/core/provider-execution-contract.js.map +0 -1
|
@@ -32,7 +32,6 @@ import { emitSessionShutdownEvent } from "./extensions/runner.js";
|
|
|
32
32
|
import { ModelRegistry } from "./model-registry.js";
|
|
33
33
|
import { acknowledgePiServerCompaction, acknowledgePiServerRunMessage, acquirePiServerSessionLease, compactPiServer, getPiServerRunDiagnostic, recordPiServerCompactionApplied, recoverPendingPiServerCompaction, releasePiServerRunLease, releasePiServerSessionLease, syncPiServerTree, } from "./pi-server-client.js";
|
|
34
34
|
import { getPiServerCompactStatePath, readPiServerPendingCompact } from "./pi-server-compact-state.js";
|
|
35
|
-
import { assertPiServerProviderExecution, } from "./pi-server-provider-execution.js";
|
|
36
35
|
import { getPiServerRunStatePath, readPiServerPendingRun } from "./pi-server-run-state.js";
|
|
37
36
|
import { expandPromptTemplate } from "./prompt-templates.js";
|
|
38
37
|
import { CURRENT_SESSION_VERSION, getLatestCompactionEntry } from "./session-manager.js";
|
|
@@ -377,14 +376,14 @@ export class AgentSession {
|
|
|
377
376
|
const compactStatePath = getPiServerCompactStatePath(sessionFile);
|
|
378
377
|
if (!readPiServerPendingCompact(compactStatePath))
|
|
379
378
|
return undefined;
|
|
380
|
-
const result = await recoverPendingPiServerCompaction(this.sessionId, { entries: this.sessionManager.getEntries(), leafId: this.sessionManager.getLeafId() }, compactStatePath, {
|
|
379
|
+
const result = await recoverPendingPiServerCompaction(this.sessionId, { entries: this.sessionManager.getEntries(), leafId: this.sessionManager.getLeafId() }, compactStatePath, {
|
|
380
|
+
signal,
|
|
381
|
+
onHistoryReconciled: (snapshot) => this.reconcilePiServerHistory(snapshot),
|
|
382
|
+
});
|
|
381
383
|
if (!result)
|
|
382
384
|
return undefined;
|
|
383
385
|
return this._applyPiServerCompactionResult(result, reason, willRetry);
|
|
384
386
|
}
|
|
385
|
-
_assertPiServerProviderExecution(model) {
|
|
386
|
-
return assertPiServerProviderExecution(this._modelRuntime, model, this._extensionRunner);
|
|
387
|
-
}
|
|
388
387
|
async _getRequiredRequestAuth(model) {
|
|
389
388
|
let result;
|
|
390
389
|
try {
|
|
@@ -1121,9 +1120,6 @@ export class AgentSession {
|
|
|
1121
1120
|
// Prompting
|
|
1122
1121
|
// =========================================================================
|
|
1123
1122
|
async _runAgentPrompt(messages) {
|
|
1124
|
-
if (isPiServerMode() && this.model) {
|
|
1125
|
-
this._assertPiServerProviderExecution(this.model);
|
|
1126
|
-
}
|
|
1127
1123
|
const piServerLease = this._acquirePiServerOperationLease();
|
|
1128
1124
|
this._resetValidationHintState();
|
|
1129
1125
|
this._isAgentRunActive = true;
|
|
@@ -1320,9 +1316,6 @@ export class AgentSession {
|
|
|
1320
1316
|
if (!this.model) {
|
|
1321
1317
|
throw new Error(formatNoModelSelectedMessage());
|
|
1322
1318
|
}
|
|
1323
|
-
if (isPiServerMode()) {
|
|
1324
|
-
this._assertPiServerProviderExecution(this.model);
|
|
1325
|
-
}
|
|
1326
1319
|
const hasConfiguredAuth = this._modelRuntime.hasConfiguredAuth(this.model.provider) ||
|
|
1327
1320
|
(await this._modelRuntime.checkAuth(this.model.provider)) !== undefined;
|
|
1328
1321
|
if (!hasConfiguredAuth) {
|
|
@@ -1896,7 +1889,6 @@ export class AgentSession {
|
|
|
1896
1889
|
* @param customInstructions Optional instructions for the compaction summary
|
|
1897
1890
|
*/
|
|
1898
1891
|
async compact(customInstructions) {
|
|
1899
|
-
const piServerExecution = isPiServerMode() && this.model ? this._assertPiServerProviderExecution(this.model) : undefined;
|
|
1900
1892
|
this._disconnectFromAgent();
|
|
1901
1893
|
await this.abort();
|
|
1902
1894
|
this._compactionAbortController = new AbortController();
|
|
@@ -1978,7 +1970,6 @@ export class AgentSession {
|
|
|
1978
1970
|
extensionCompaction,
|
|
1979
1971
|
retry: this.settingsManager.getRetrySettings(),
|
|
1980
1972
|
sessionTree: { entries: this.sessionManager.getEntries(), leafId: this.sessionManager.getLeafId() },
|
|
1981
|
-
providerExecutionFingerprint: piServerExecution?.providerExecutionFingerprint,
|
|
1982
1973
|
piServerCompactStatePath: getPiServerCompactStatePath(sessionFile),
|
|
1983
1974
|
signal: this._compactionAbortController.signal,
|
|
1984
1975
|
reasoning: toProviderReasoning(this.thinkingLevel),
|
|
@@ -2124,9 +2115,6 @@ export class AgentSession {
|
|
|
2124
2115
|
// but must not retry: the assistant answer already completed and agent.continue() cannot
|
|
2125
2116
|
// continue from an assistant message.
|
|
2126
2117
|
if (sameModel && isContextOverflow(assistantMessage, contextWindow)) {
|
|
2127
|
-
if (isPiServerMode() && this.model) {
|
|
2128
|
-
this._assertPiServerProviderExecution(this.model);
|
|
2129
|
-
}
|
|
2130
2118
|
const willRetry = assistantMessage.stopReason !== "stop";
|
|
2131
2119
|
if (!willRetry) {
|
|
2132
2120
|
return await this._runAutoCompaction("overflow", false);
|
|
@@ -2185,9 +2173,6 @@ export class AgentSession {
|
|
|
2185
2173
|
contextTokens = directContextTokens;
|
|
2186
2174
|
}
|
|
2187
2175
|
if (shouldCompact(contextTokens, contextWindow, settings)) {
|
|
2188
|
-
if (isPiServerMode() && this.model) {
|
|
2189
|
-
this._assertPiServerProviderExecution(this.model);
|
|
2190
|
-
}
|
|
2191
2176
|
return await this._runAutoCompaction("threshold", false);
|
|
2192
2177
|
}
|
|
2193
2178
|
return false;
|
|
@@ -2198,7 +2183,6 @@ export class AgentSession {
|
|
|
2198
2183
|
async _runAutoCompaction(reason, willRetry, preparationOverride, preparationOptions) {
|
|
2199
2184
|
const settings = this.settingsManager.getCompactionSettings();
|
|
2200
2185
|
const model = this.model;
|
|
2201
|
-
const piServerExecution = isPiServerMode() && model ? this._assertPiServerProviderExecution(model) : undefined;
|
|
2202
2186
|
let started = false;
|
|
2203
2187
|
let piServerLease = {
|
|
2204
2188
|
path: undefined,
|
|
@@ -2280,7 +2264,6 @@ export class AgentSession {
|
|
|
2280
2264
|
preparation: preparationOptions ?? { firstKeptEntryId: preparation.firstKeptEntryId },
|
|
2281
2265
|
extensionCompaction,
|
|
2282
2266
|
sessionTree: { entries: this.sessionManager.getEntries(), leafId: this.sessionManager.getLeafId() },
|
|
2283
|
-
providerExecutionFingerprint: piServerExecution?.providerExecutionFingerprint,
|
|
2284
2267
|
piServerCompactStatePath: getPiServerCompactStatePath(sessionFile),
|
|
2285
2268
|
signal,
|
|
2286
2269
|
reasoning: toProviderReasoning(this.thinkingLevel),
|
|
@@ -2428,9 +2411,6 @@ export class AgentSession {
|
|
|
2428
2411
|
}
|
|
2429
2412
|
const settings = this.settingsManager.getCompactionSettings();
|
|
2430
2413
|
const markerParentId = this.sessionManager.getLeafId();
|
|
2431
|
-
if (isPiServerMode() && this.model) {
|
|
2432
|
-
this._assertPiServerProviderExecution(this.model);
|
|
2433
|
-
}
|
|
2434
2414
|
const markerId = this._appendIntraTurnCompactionMarker();
|
|
2435
2415
|
const preparationOptions = { firstKeptEntryId: markerId };
|
|
2436
2416
|
const branchWithMarker = this.sessionManager.getBranch();
|
|
@@ -3039,9 +3019,6 @@ export class AgentSession {
|
|
|
3039
3019
|
* @returns Result with editorText (if user message) and cancelled status
|
|
3040
3020
|
*/
|
|
3041
3021
|
async navigateTree(targetId, options = {}) {
|
|
3042
|
-
if (isPiServerMode() && options.summarize && this.model) {
|
|
3043
|
-
this._assertPiServerProviderExecution(this.model);
|
|
3044
|
-
}
|
|
3045
3022
|
const oldLeafId = this.sessionManager.getLeafId();
|
|
3046
3023
|
// No-op if already at target
|
|
3047
3024
|
if (targetId === oldLeafId) {
|