@1agents/acp-service 0.8.1 → 0.8.3
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/README.md +37 -2
- package/dist/bin/a2a.js +3 -2
- package/dist/src/a2a/executor.d.ts +2 -0
- package/dist/src/a2a/executor.js +63 -10
- package/dist/src/a2a/gateway.d.ts +407 -14
- package/dist/src/a2a/gateway.js +719 -37
- package/dist/src/a2a/index.d.ts +8 -1
- package/dist/src/a2a/index.js +4 -0
- package/dist/src/a2a/notices.d.ts +24 -0
- package/dist/src/a2a/notices.js +56 -0
- package/dist/src/a2a/preflight.d.ts +52 -0
- package/dist/src/a2a/preflight.js +153 -0
- package/dist/src/a2a/result-metadata.d.ts +59 -0
- package/dist/src/a2a/result-metadata.js +156 -0
- package/dist/src/a2a/server.js +30 -0
- package/dist/src/a2a/session-delivery.d.ts +69 -0
- package/dist/src/a2a/session-delivery.js +260 -0
- package/dist/src/a2a/session-hosts.d.ts +34 -0
- package/dist/src/a2a/session-hosts.js +211 -0
- package/dist/src/a2a/store.js +3 -1
- package/dist/src/a2a/types.d.ts +33 -0
- package/dist/src/execution/delivery-progress.d.ts +108 -0
- package/dist/src/execution/delivery-progress.js +57 -0
- package/dist/src/execution/ledger.d.ts +235 -0
- package/dist/src/execution/ledger.js +396 -0
- package/dist/src/execution/ppt-delivery.d.ts +231 -0
- package/dist/src/execution/ppt-delivery.js +625 -0
- package/dist/src/execution/targets.d.ts +349 -0
- package/dist/src/execution/targets.js +428 -0
- package/package.json +11 -12
- package/skills/acp-service/SKILL.md +9 -2
- package/skills/acp-service/references/a2a.md +72 -4
- package/vendor/dsh/a2a-executor.d.ts +2 -1
- package/vendor/dsh/a2a-executor.js +28 -1
- package/vendor/dsh/a2a.js +1 -0
- package/vendor/dsh/client.js +95 -27
- package/vendor/runtime/dist/{agent-registry-CMg8LHKY.js → agent-registry-R7A3MSpr.js} +9 -1
- package/vendor/runtime/dist/agent-registry-R7A3MSpr.js.map +1 -0
- package/vendor/runtime/dist/agent-registry.d.ts +1 -0
- package/vendor/runtime/dist/agent-registry.d.ts.map +1 -1
- package/vendor/runtime/dist/agent-registry.js +1 -2
- package/vendor/runtime/dist/{cli-Bdzplbpj.js → cli-DeOpE2Xz.js} +4 -4
- package/vendor/runtime/dist/{cli-Bdzplbpj.js.map → cli-DeOpE2Xz.js.map} +1 -1
- package/vendor/runtime/dist/cli.d.ts +2 -1
- package/vendor/runtime/dist/cli.js +10 -10
- package/vendor/runtime/dist/cli.js.map +1 -1
- package/vendor/runtime/dist/{client-BXOiB0ND.d.ts → client-VQsqcIOJ.d.ts} +2 -2
- package/vendor/runtime/dist/{client-BXOiB0ND.d.ts.map → client-VQsqcIOJ.d.ts.map} +1 -1
- package/vendor/runtime/dist/docs-site/.nojekyll +0 -0
- package/vendor/runtime/dist/docs-site/CLI.html +833 -0
- package/vendor/runtime/dist/docs-site/VISION.html +415 -0
- package/vendor/runtime/dist/docs-site/agents.html +391 -0
- package/vendor/runtime/dist/docs-site/compare.html +359 -0
- package/vendor/runtime/dist/docs-site/config.html +450 -0
- package/vendor/runtime/dist/docs-site/custom-agents.html +408 -0
- package/vendor/runtime/dist/docs-site/exit-codes.html +347 -0
- package/vendor/runtime/dist/docs-site/favicon.svg +21 -0
- package/vendor/runtime/dist/docs-site/flows.html +498 -0
- package/vendor/runtime/dist/docs-site/index.html +367 -0
- package/vendor/runtime/dist/docs-site/install.html +386 -0
- package/vendor/runtime/dist/docs-site/llms.txt +36 -0
- package/vendor/runtime/dist/docs-site/output-formats.html +407 -0
- package/vendor/runtime/dist/docs-site/permissions.html +422 -0
- package/vendor/runtime/dist/docs-site/prompting.html +460 -0
- package/vendor/runtime/dist/docs-site/quickstart.html +382 -0
- package/vendor/runtime/dist/docs-site/releasing.html +341 -0
- package/vendor/runtime/dist/docs-site/runtime-environment.html +329 -0
- package/vendor/runtime/dist/docs-site/runtime-process-lifecycle.html +335 -0
- package/vendor/runtime/dist/docs-site/safe-errors.html +323 -0
- package/vendor/runtime/dist/docs-site/session-control.html +408 -0
- package/vendor/runtime/dist/docs-site/session-watch.html +354 -0
- package/vendor/runtime/dist/docs-site/sessions.html +488 -0
- package/vendor/runtime/dist/docs-site/shared-sessions.html +377 -0
- package/vendor/runtime/dist/{flows-BKlAuzM8.js → flows-oaBGn31w.js} +5 -5
- package/vendor/runtime/dist/{flows-BKlAuzM8.js.map → flows-oaBGn31w.js.map} +1 -1
- package/vendor/runtime/dist/flows.d.ts +2 -2
- package/vendor/runtime/dist/flows.d.ts.map +1 -1
- package/vendor/runtime/dist/flows.js +1 -2
- package/vendor/runtime/dist/{invocation-options-DMy77sEU.js → invocation-options-CUDEE8vW.js} +5 -5
- package/vendor/runtime/dist/{invocation-options-DMy77sEU.js.map → invocation-options-CUDEE8vW.js.map} +1 -1
- package/vendor/runtime/dist/{ipc-CLv2iL89.js → ipc-BQQpcEdP.js} +98 -20
- package/vendor/runtime/dist/ipc-BQQpcEdP.js.map +1 -0
- package/vendor/runtime/dist/{output-I-t-v55D.js → output-CFv3jcOQ.js} +86 -22
- package/vendor/runtime/dist/output-CFv3jcOQ.js.map +1 -0
- package/vendor/runtime/dist/{queue-owner-runtime-RN3uSid0.js → queue-owner-runtime-DvMJiGbP.js} +86 -27
- package/vendor/runtime/dist/queue-owner-runtime-DvMJiGbP.js.map +1 -0
- package/vendor/runtime/dist/runtime.d.ts +5 -2
- package/vendor/runtime/dist/runtime.d.ts.map +1 -1
- package/vendor/runtime/dist/runtime.js +77 -29
- package/vendor/runtime/dist/runtime.js.map +1 -1
- package/vendor/runtime/dist/{session-options-DNnDfiUt.d.ts → session-options-NjpFwf-c.d.ts} +5 -1
- package/vendor/runtime/dist/session-options-NjpFwf-c.d.ts.map +1 -0
- package/vendor/runtime/dist/{session-watch-CmHbH0jS.js → session-watch-Di-wIdCH.js} +4 -4
- package/vendor/runtime/dist/{session-watch-CmHbH0jS.js.map → session-watch-Di-wIdCH.js.map} +1 -1
- package/vendor/runtime/dist/{watch-BE-kKa7o.js → watch-CIpoMaWD.js} +2 -2
- package/vendor/runtime/dist/{watch-BE-kKa7o.js.map → watch-CIpoMaWD.js.map} +1 -1
- package/vendor/runtime/package.json +1 -1
- package/vendor/runtime/skills/acpx/SKILL.md +7 -2
- package/vendor/runtime/dist/agent-registry-CMg8LHKY.js.map +0 -1
- package/vendor/runtime/dist/ipc-CLv2iL89.js.map +0 -1
- package/vendor/runtime/dist/output-I-t-v55D.js.map +0 -1
- package/vendor/runtime/dist/queue-owner-runtime-RN3uSid0.js.map +0 -1
- package/vendor/runtime/dist/session-options-DNnDfiUt.d.ts.map +0 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { AcpAgentInspection, AcpAgentInspectionOptions, AcpAgentRegistry, AcpInspectableAgentRegistry, DEFAULT_AGENT_NAME, createAgentRegistry } from "./agent-registry.js";
|
|
2
|
-
import { A as GrokExitPlanModeRequest, C as PermissionPolicy, D as SafeErrorOrigin, E as SafeErrorCategory, F as GrokAskUserQuestionResponse, M as GrokExitPlanOutcome, N as GrokAskUserAnswers, O as SessionRecord, P as GrokAskUserQuestionRequest, S as PermissionMode, T as SafeError, _ as AcpProcessSpawnFailure, a as AcpElicitationHandler, b as McpServer$1, c as AcpElicitationResponse, d as AcpPermissionHandler, f as AcpPermissionRequest, g as AcpProcessLifecycle, h as AcpProcessLaunchScope, i as AcpElicitationContext, j as GrokExitPlanModeResponse, k as PromptInput, l as AcpJsonRpcMessage, m as AcpProcessLaunch, n as SystemPromptOption, o as AcpElicitationMode, p as AcpProcessExit, s as AcpElicitationRequest, t as SessionAgentOptions, u as AcpPermissionDecision, v as AcpProcessStarted, x as NonInteractivePermissionPolicy, y as AuthPolicy } from "./session-options-
|
|
3
|
-
import { n as AcpControlAuthority, t as AcpClient } from "./client-
|
|
2
|
+
import { A as GrokExitPlanModeRequest, C as PermissionPolicy, D as SafeErrorOrigin, E as SafeErrorCategory, F as GrokAskUserQuestionResponse, M as GrokExitPlanOutcome, N as GrokAskUserAnswers, O as SessionRecord, P as GrokAskUserQuestionRequest, S as PermissionMode, T as SafeError, _ as AcpProcessSpawnFailure, a as AcpElicitationHandler, b as McpServer$1, c as AcpElicitationResponse, d as AcpPermissionHandler, f as AcpPermissionRequest, g as AcpProcessLifecycle, h as AcpProcessLaunchScope, i as AcpElicitationContext, j as GrokExitPlanModeResponse, k as PromptInput, l as AcpJsonRpcMessage, m as AcpProcessLaunch, n as SystemPromptOption, o as AcpElicitationMode, p as AcpProcessExit, s as AcpElicitationRequest, t as SessionAgentOptions, u as AcpPermissionDecision, v as AcpProcessStarted, x as NonInteractivePermissionPolicy, y as AuthPolicy } from "./session-options-NjpFwf-c.js";
|
|
3
|
+
import { n as AcpControlAuthority, t as AcpClient } from "./client-VQsqcIOJ.js";
|
|
4
4
|
import { z } from "zod";
|
|
5
5
|
import { SetSessionConfigOptionResponse, ToolCallContent, ToolCallLocation, ToolKind } from "@1agents/acp-runtime-sdk";
|
|
6
6
|
//#region src/acp/model-support.d.ts
|
|
@@ -762,6 +762,8 @@ declare class AcpRuntimeManager {
|
|
|
762
762
|
private reuseRuntimeSession;
|
|
763
763
|
private closeConflictingPersistentSession;
|
|
764
764
|
private createOwnedRuntimeSession;
|
|
765
|
+
private abandonInitializingSessionOwner;
|
|
766
|
+
private settleRetiredSessionRecord;
|
|
765
767
|
private prepareInitialRuntimeRecord;
|
|
766
768
|
private retainInitializedSessionOwner;
|
|
767
769
|
startTurn(input: RuntimeTurnTask["input"]): AcpRuntimeTurn;
|
|
@@ -838,6 +840,7 @@ declare class AcpRuntimeManager {
|
|
|
838
840
|
discardPersistentState?: boolean;
|
|
839
841
|
}): Promise<void>;
|
|
840
842
|
private closeRuntimeSession;
|
|
843
|
+
private saveClosedRuntimeRecord;
|
|
841
844
|
adoptSession(input: {
|
|
842
845
|
handle: AcpRuntimeHandle;
|
|
843
846
|
sessionKey: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"runtime.d.ts","names":[],"sources":["../src/acp/model-support.ts","../src/acp/config-option-support.ts","../src/acp/mode-support.ts","../src/session/journal.ts","../src/runtime/public/contract.ts","../src/runtime/public/probe.ts","../src/runtime/engine/turn.ts","../src/runtime/engine/manager.ts","../src/runtime/public/file-session-store.ts","../src/runtime/public/turn-journal.ts","../src/runtime/public/errors.ts","../src/acp/error-normalization.ts","../src/runtime/public/shared.ts","../src/runtime/public/handle-state.ts","../src/runtime/shared.ts","../src/runtime.ts"],"mappings":";;;;;;qBAea;KAED,4CAA4C;qBAE3C;KAKD,0CAA0C;qBAEzC,uCAAuC;WACzC;WACA,QAAQ;WACR;EAGP,YAAA,iBACA,QAAQ,iCACR;IAAY;;;wBAoBA,iCACd,iBACC,SAAS;;;KCxDA;EACV;EACA;EACA;;KAGU;EACV;EACA;EACA;EACA;EACA,SAAS;;;;KCXC;EACV;EACA;EACA;;KAGU;EACV;EACA,gBAAgB;;;;
|
|
1
|
+
{"version":3,"file":"runtime.d.ts","names":["McpServer","_$__public_contract_js0.AcpRuntimeEvent","_$__public_contract_js0.AcpRuntimeStatus","_$___runtime_js0.SessionWatchEvent","_$__runtime_js0.AcpRuntimeTurnResult"],"sources":["../src/acp/model-support.ts","../src/acp/config-option-support.ts","../src/acp/mode-support.ts","../src/session/journal.ts","../src/runtime/public/contract.ts","../src/runtime/public/probe.ts","../src/runtime/engine/turn.ts","../src/runtime/engine/manager.ts","../src/runtime/public/file-session-store.ts","../src/runtime/public/turn-journal.ts","../src/runtime/public/errors.ts","../src/acp/error-normalization.ts","../src/runtime/public/shared.ts","../src/runtime/public/handle-state.ts","../src/runtime/shared.ts","../src/runtime.ts"],"mappings":";;;;;;qBAea;KAED,4CAA4C;qBAE3C;KAKD,0CAA0C;qBAEzC,uCAAuC;WACzC;WACA,QAAQ;WACR;EAGP,YAAA,iBACA,QAAQ,iCACR;IAAY;;;wBAoBA,iCACd,iBACC,SAAS;;;KCxDA;EACV;EACA;EACA;;KAGU;EACV;EACA;EACA;EACA;EACA,S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;IACR;IACA,cAAc;MACZ;EAME,YAAY;IAChB,QAAQ;IACR;MACE;IAAU;IAAmB;;EAM3B,cAAc;IAAS,QAAQ;IAAkB;MAAsB;EAM7E,UAAU,OAAO;;;;;;;IAkCM,OAAA;MAAE;QAAiB;IAGd,YAAA;MAAE;QAAiB;;EAMxC,QAAQ,OAAO,sBAAsB,cAAc;EAkBpD,gBAAgB;IAAU,SAAS;MAAqB,QAAQ;EAWhE,UAAU;IACd,QAAQ;IACR,SAAS;MACP,QAAQ;EAMN,QACJ,OAAO;IAAwB,QAAQ;IAAkB;MACxD;EAMG,SACJ,OAAO;IAAwB,QAAQ;IAAkB;MACxD;EAMG,gBACJ,OAAO;IACL,QAAQ;IACR;IACA;MAED,QAAQ;EAML,OAAO;IAAS,QAAQ;IAAkB;MAAoB;EAM9D,oBAAoB;IAAS,QAAQ;MAAqB;EAM1D,MAAM;IACV,QAAQ;IACR;IACA;MACE;EAQJ,YAAY;UAeE;UAkBA;UAmBN;UAcA;;wBA+BM,iBAAiB,SAAS,oBAAoB;wBAI9C,mBAAmB;EAAW;IAAqB"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { A as findSession, B as assertPersistedKeyPolicy,
|
|
2
|
-
import { a as createAgentRegistry, i as DEFAULT_AGENT_NAME, k as normalizeAgentCommandInput } from "./agent-registry-
|
|
3
|
-
import { $ as isRequestedModelUnsupportedError, A as applyInitialModelSelection, B as reconcileAgentSessionId, C as setSessionModeOnOwner, D as connectAndLoadSession, E as withConnectedSession, F as persistSessionOptions, G as recordSessionUpdate, I as sessionOptionsFromRecord, J as advertisedModelState, K as trimConversationForRuntime, L as applyConversation, M as applyRequestedModelIfAdvertised, N as setDesiredModeId, O as applyConfigOptionSelection, P as normalizeSessionOptionShape, Q as RequestedModelUnsupportedError, R as applyLifecycleSnapshotToRecord, T as setSessionModelOnOwner, U as recordClientOperation, V as cloneSessionConversation, W as recordPromptSubmission, X as REQUESTED_MODEL_UNSUPPORTED_ERROR_CODE, Y as AcpClient, Z as REQUESTED_MODEL_UNSUPPORTED_REASONS, _ as cancelSessionPrompt, c as LiveSessionCheckpoint, dt as TimeoutError, et as resolveRequestedConfigOption, ft as assertControlAuthority, h as ensureSession, j as applyModelSelection, k as applyConfigOptionsToRecord, l as runPromptTurn, mt as withTimeout, q as cloneSessionAcpxState, r as sendSession, s as DISCARD_OUTPUT_FORMATTER, tt as resolveRequestedModelId, v as closeSession, x as setSessionConfigOptionOnOwner, z as createInitialSessionRecord } from "./queue-owner-runtime-
|
|
4
|
-
import { t as watchSession } from "./watch-
|
|
1
|
+
import { A as findSession, At as extractAcpError, B as assertPersistedKeyPolicy, Bt as isAcpRuntimeError, C as textPrompt, Dt as normalizeOutputError, L as readSessionRecord, Ot as safeErrorRejection, R as resolveSessionRecord, U as serializeSessionRecordForDisk, V as parseSessionRecord, bt as writePrivateJsonFile, ft as defaultSessionEventLog, jt as isAcpResourceNotFoundError, kt as toSafeError, t as tryCancelOnRunningOwner, zt as AcpRuntimeError } from "./ipc-BQQpcEdP.js";
|
|
2
|
+
import { a as createAgentRegistry, i as DEFAULT_AGENT_NAME, k as normalizeAgentCommandInput } from "./agent-registry-R7A3MSpr.js";
|
|
3
|
+
import { $ as isRequestedModelUnsupportedError, A as applyInitialModelSelection, B as reconcileAgentSessionId, C as setSessionModeOnOwner, D as connectAndLoadSession, E as withConnectedSession, F as persistSessionOptions, G as recordSessionUpdate, I as sessionOptionsFromRecord, J as advertisedModelState, K as trimConversationForRuntime, L as applyConversation, M as applyRequestedModelIfAdvertised, N as setDesiredModeId, O as applyConfigOptionSelection, P as normalizeSessionOptionShape, Q as RequestedModelUnsupportedError, R as applyLifecycleSnapshotToRecord, T as setSessionModelOnOwner, U as recordClientOperation, V as cloneSessionConversation, W as recordPromptSubmission, X as REQUESTED_MODEL_UNSUPPORTED_ERROR_CODE, Y as AcpClient, Z as REQUESTED_MODEL_UNSUPPORTED_REASONS, _ as cancelSessionPrompt, c as LiveSessionCheckpoint, dt as TimeoutError, et as resolveRequestedConfigOption, ft as assertControlAuthority, h as ensureSession, j as applyModelSelection, k as applyConfigOptionsToRecord, l as runPromptTurn, mt as withTimeout, q as cloneSessionAcpxState, r as sendSession, s as DISCARD_OUTPUT_FORMATTER, tt as resolveRequestedModelId, v as closeSession, x as setSessionConfigOptionOnOwner, z as createInitialSessionRecord } from "./queue-owner-runtime-DvMJiGbP.js";
|
|
4
|
+
import { t as watchSession } from "./watch-CIpoMaWD.js";
|
|
5
5
|
import { fileURLToPath } from "node:url";
|
|
6
6
|
import path from "node:path";
|
|
7
7
|
import fs from "node:fs/promises";
|
|
@@ -1406,7 +1406,7 @@ var AcpRuntimeManager = class {
|
|
|
1406
1406
|
owner.client.setEventHandlers({ onSessionUpdate: (notification) => this.routeOwnedSessionUpdate(owner, notification) });
|
|
1407
1407
|
}
|
|
1408
1408
|
async saveSessionOwner(owner) {
|
|
1409
|
-
if (!owner.recordId) return;
|
|
1409
|
+
if (!owner.recordId || owner.pendingResetRecord) return;
|
|
1410
1410
|
const active = owner.activeTurn?.turn;
|
|
1411
1411
|
const target = active ?? owner.projection;
|
|
1412
1412
|
if (!target) return;
|
|
@@ -1509,11 +1509,18 @@ var AcpRuntimeManager = class {
|
|
|
1509
1509
|
const flushAttempt = await settleAttempt(async () => this.flushSessionOwner(owner));
|
|
1510
1510
|
const closeAttempt = await settleAttempt(async () => this.closeClient(owner.client));
|
|
1511
1511
|
if (!closeAttempt.ok) this.retiringSessionOwners.add(owner);
|
|
1512
|
+
const finalFlushAttempt = await settleAttempt(async () => owner.checkpoint.flush());
|
|
1513
|
+
const clearAttempt = await settleAttempt(() => owner.client.clearEventHandlers());
|
|
1514
|
+
const settleRecordAttempt = await settleAttempt(async () => {
|
|
1515
|
+
if (closeAttempt.ok) await this.settleRetiredSessionRecord(owner);
|
|
1516
|
+
});
|
|
1517
|
+
if (!settleRecordAttempt.ok) this.retiringSessionOwners.add(owner);
|
|
1512
1518
|
return firstFailedAttempt([
|
|
1513
1519
|
flushAttempt,
|
|
1514
1520
|
closeAttempt,
|
|
1515
|
-
|
|
1516
|
-
|
|
1521
|
+
finalFlushAttempt,
|
|
1522
|
+
clearAttempt,
|
|
1523
|
+
settleRecordAttempt
|
|
1517
1524
|
]);
|
|
1518
1525
|
}
|
|
1519
1526
|
async retrySessionCleanup(recordId) {
|
|
@@ -1521,7 +1528,8 @@ var AcpRuntimeManager = class {
|
|
|
1521
1528
|
owner.retirement ??= this.finalizeSessionConnection({
|
|
1522
1529
|
client: owner.client,
|
|
1523
1530
|
owner
|
|
1524
|
-
}).then(() => {
|
|
1531
|
+
}).then(async () => {
|
|
1532
|
+
await this.settleRetiredSessionRecord(owner);
|
|
1525
1533
|
this.retiringSessionOwners.delete(owner);
|
|
1526
1534
|
}).finally(() => {
|
|
1527
1535
|
owner.retirement = void 0;
|
|
@@ -1715,6 +1723,7 @@ var AcpRuntimeManager = class {
|
|
|
1715
1723
|
return await this.withManagerLock(this.runtimeOperationLocks, input.sessionKey, async () => this.acquireRuntimeSession(input, agent));
|
|
1716
1724
|
}
|
|
1717
1725
|
async reuseCompatiblePersistentSession(input, agent) {
|
|
1726
|
+
await this.retrySessionCleanup(input.sessionKey);
|
|
1718
1727
|
const controlled = this.controlSessionRecords.get(input.sessionKey);
|
|
1719
1728
|
const record = controlled ? controlled.record : await this.findSession(input.sessionKey);
|
|
1720
1729
|
if (!record || this.closingActiveRecords.has(input.sessionKey) || !shouldReuseExistingRecord(record, {
|
|
@@ -1811,7 +1820,6 @@ var AcpRuntimeManager = class {
|
|
|
1811
1820
|
sessionKey: input.sessionKey,
|
|
1812
1821
|
mode: input.mode
|
|
1813
1822
|
});
|
|
1814
|
-
let retained = false;
|
|
1815
1823
|
try {
|
|
1816
1824
|
await startRuntimeClient(client, agent, this.options.timeoutMs);
|
|
1817
1825
|
this.assertOpen();
|
|
@@ -1827,22 +1835,39 @@ var AcpRuntimeManager = class {
|
|
|
1827
1835
|
});
|
|
1828
1836
|
this.setTransientCredentials(record.acpxRecordId, input.authCredentials);
|
|
1829
1837
|
await this.retainInitializedSessionOwner(owner, record);
|
|
1830
|
-
retained = true;
|
|
1831
1838
|
return record;
|
|
1832
|
-
}
|
|
1833
|
-
|
|
1834
|
-
|
|
1835
|
-
client.clearEventHandlers();
|
|
1836
|
-
await this.closeClient(client);
|
|
1837
|
-
}
|
|
1839
|
+
} catch (error) {
|
|
1840
|
+
await settleAttempt(async () => this.abandonInitializingSessionOwner(owner));
|
|
1841
|
+
throw error;
|
|
1838
1842
|
}
|
|
1839
1843
|
}
|
|
1844
|
+
async abandonInitializingSessionOwner(owner) {
|
|
1845
|
+
const record = owner.recordId ? owner.projection?.record : void 0;
|
|
1846
|
+
owner.pendingResetRecord = record;
|
|
1847
|
+
await settleAttempt(() => owner.client.clearEventHandlers());
|
|
1848
|
+
const closeAttempt = await settleAttempt(async () => this.closeClient(owner.client));
|
|
1849
|
+
if (!record) return;
|
|
1850
|
+
this.retiringSessionOwners.add(owner);
|
|
1851
|
+
if (closeAttempt.ok) {
|
|
1852
|
+
await this.settleRetiredSessionRecord(owner);
|
|
1853
|
+
this.retiringSessionOwners.delete(owner);
|
|
1854
|
+
}
|
|
1855
|
+
}
|
|
1856
|
+
async settleRetiredSessionRecord(owner) {
|
|
1857
|
+
const record = owner.pendingResetRecord;
|
|
1858
|
+
if (!record) return;
|
|
1859
|
+
applyLifecycleSnapshotToRecord(record, owner.client.getAgentLifecycleSnapshot());
|
|
1860
|
+
await this.saveClosedRuntimeRecord(record, true);
|
|
1861
|
+
owner.pendingResetRecord = void 0;
|
|
1862
|
+
owner.recordId = void 0;
|
|
1863
|
+
}
|
|
1840
1864
|
async prepareInitialRuntimeRecord(params) {
|
|
1841
1865
|
const { input, client, owner, agentCommand, agentArgv, cwd, session } = params;
|
|
1842
1866
|
const record = createInitialSessionRecord({
|
|
1843
1867
|
recordId: createRecordId(input.sessionKey, input.mode),
|
|
1844
1868
|
name: input.sessionKey,
|
|
1845
1869
|
sessionId: session.sessionId,
|
|
1870
|
+
sessionOrigin: input.resumeSessionId ? "resume" : "new",
|
|
1846
1871
|
agentCommand,
|
|
1847
1872
|
agentArgv,
|
|
1848
1873
|
cwd,
|
|
@@ -2260,6 +2285,7 @@ var AcpRuntimeManager = class {
|
|
|
2260
2285
|
record: turn.record,
|
|
2261
2286
|
resumePolicy: resumePolicyForSessionMode(task.input.sessionMode),
|
|
2262
2287
|
timeoutMs: this.options.timeoutMs,
|
|
2288
|
+
promptRecorded: true,
|
|
2263
2289
|
activeController: task.state.activeController,
|
|
2264
2290
|
onClientAvailable: () => this.publishRuntimeTurnController(task, turn),
|
|
2265
2291
|
onConnectedRecord: (connectedRecord) => {
|
|
@@ -2554,9 +2580,22 @@ var AcpRuntimeManager = class {
|
|
|
2554
2580
|
const record = await this.resolveRuntimeRecordForClose(recordId);
|
|
2555
2581
|
this.markActiveRuntimeRecordClosing(record);
|
|
2556
2582
|
if (intent !== "prepare-fresh") await this.cancelSessionTasks(recordId);
|
|
2557
|
-
await this.closeRuntimeRecordOwnership(record, intent);
|
|
2583
|
+
const closeFailure = await this.closeRuntimeRecordOwnership(record, intent);
|
|
2584
|
+
if (intent === "discard") {
|
|
2585
|
+
if (closeFailure) throw closeFailure.error;
|
|
2586
|
+
return;
|
|
2587
|
+
}
|
|
2588
|
+
const saveAttempt = await settleAttempt(async () => this.saveClosedRuntimeRecord(record, intent !== "release"));
|
|
2589
|
+
const failure = closeFailure ?? firstFailedAttempt([saveAttempt]);
|
|
2590
|
+
if (failure) throw failure.error;
|
|
2591
|
+
}
|
|
2592
|
+
async saveClosedRuntimeRecord(record, reset) {
|
|
2558
2593
|
record.closed = true;
|
|
2559
2594
|
record.closedAt = isoNow();
|
|
2595
|
+
if (reset) record.acpx = {
|
|
2596
|
+
...record.acpx,
|
|
2597
|
+
reset_on_next_ensure: true
|
|
2598
|
+
};
|
|
2560
2599
|
await this.options.sessionStore.save(record);
|
|
2561
2600
|
this.transientCredentials.delete(record.acpxRecordId);
|
|
2562
2601
|
}
|
|
@@ -2631,7 +2670,7 @@ var AcpRuntimeManager = class {
|
|
|
2631
2670
|
if (this.activeControllers.has(record.acpxRecordId)) this.closingActiveRecords.add(record.acpxRecordId);
|
|
2632
2671
|
}
|
|
2633
2672
|
async closeRuntimeRecordOwnership(record, intent) {
|
|
2634
|
-
if (intent === "discard") await this.closeBackendSession(record);
|
|
2673
|
+
if (intent === "discard") return await this.closeBackendSession(record);
|
|
2635
2674
|
else if (intent === "prepare-fresh") {
|
|
2636
2675
|
const owner = this.retainedSessionOwners.get(record.acpxRecordId);
|
|
2637
2676
|
if (owner) {
|
|
@@ -2640,20 +2679,29 @@ var AcpRuntimeManager = class {
|
|
|
2640
2679
|
}
|
|
2641
2680
|
await this.retrySessionCleanup(record.acpxRecordId);
|
|
2642
2681
|
} else await this.closeRetainedSessionOwner(record.acpxRecordId);
|
|
2643
|
-
if (intent !== "release") record.acpx = {
|
|
2644
|
-
...record.acpx,
|
|
2645
|
-
reset_on_next_ensure: true
|
|
2646
|
-
};
|
|
2647
2682
|
}
|
|
2648
2683
|
async closeBackendSession(record) {
|
|
2649
2684
|
const connection = await this.acquireBackendCloseConnection(record);
|
|
2650
|
-
|
|
2651
|
-
|
|
2652
|
-
|
|
2653
|
-
|
|
2654
|
-
|
|
2655
|
-
|
|
2656
|
-
}
|
|
2685
|
+
const requestAttempt = await settleAttempt(async () => {
|
|
2686
|
+
try {
|
|
2687
|
+
await this.requestBackendSessionClose(record, connection);
|
|
2688
|
+
} catch (error) {
|
|
2689
|
+
this.handleBackendSessionCloseError(record, error);
|
|
2690
|
+
}
|
|
2691
|
+
});
|
|
2692
|
+
const owner = connection.owner ?? this.createSessionOwner({
|
|
2693
|
+
client: connection.client,
|
|
2694
|
+
sessionKey: record.acpxRecordId,
|
|
2695
|
+
mode: "persistent"
|
|
2696
|
+
});
|
|
2697
|
+
owner.recordId = record.acpxRecordId;
|
|
2698
|
+
const finalizeAttempt = await settleAttempt(async () => this.finalizeSessionConnection(connection));
|
|
2699
|
+
owner.pendingResetRecord = record;
|
|
2700
|
+
this.retiringSessionOwners.add(owner);
|
|
2701
|
+
if (!finalizeAttempt.ok) throw finalizeAttempt.error;
|
|
2702
|
+
const saveAttempt = await settleAttempt(async () => this.settleRetiredSessionRecord(owner));
|
|
2703
|
+
if (saveAttempt.ok) this.retiringSessionOwners.delete(owner);
|
|
2704
|
+
return firstFailedAttempt([requestAttempt, saveAttempt]);
|
|
2657
2705
|
}
|
|
2658
2706
|
async finalizeSessionConnection(connection) {
|
|
2659
2707
|
const failure = firstFailedAttempt([
|