acpx 0.19.2 → 0.19.4
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/dist/{agent-registry-DWlx5BQ4.js → agent-registry-kHdpsK9F.js} +35 -21
- package/dist/agent-registry-kHdpsK9F.js.map +1 -0
- package/dist/agent-registry.d.ts.map +1 -1
- package/dist/agent-registry.js +1 -1
- package/dist/{cli-D-s_eTUy.js → cli-DCtHeMEi.js} +34 -46
- package/dist/cli-DCtHeMEi.js.map +1 -0
- package/dist/cli.d.ts +1 -1
- package/dist/cli.js +57 -40
- package/dist/cli.js.map +1 -1
- package/dist/{client-BchvQRpz.d.ts → client-DqCXdF0Q.d.ts} +6 -18
- package/dist/client-DqCXdF0Q.d.ts.map +1 -0
- package/dist/{flows-DdxEaeZo.js → flows--1zpaEh9.js} +38 -14
- package/dist/flows--1zpaEh9.js.map +1 -0
- package/dist/flows.d.ts +2 -2
- package/dist/flows.js +1 -1
- package/dist/{invocation-options-HjxSBsK0.js → invocation-options-CvkenzCc.js} +6 -12
- package/dist/invocation-options-CvkenzCc.js.map +1 -0
- package/dist/{ipc-D0ZMQ0q9.js → ipc-D7zT86b9.js} +430 -307
- package/dist/ipc-D7zT86b9.js.map +1 -0
- package/dist/{output-GQnhkJMU.js → output-lylSoEBd.js} +12 -4
- package/dist/output-lylSoEBd.js.map +1 -0
- package/dist/{queue-owner-runtime-W0lly6ap.js → queue-owner-runtime-C0wIYowh.js} +766 -547
- package/dist/queue-owner-runtime-C0wIYowh.js.map +1 -0
- package/dist/runtime.d.ts +23 -3
- package/dist/runtime.d.ts.map +1 -1
- package/dist/runtime.js +52 -22
- package/dist/runtime.js.map +1 -1
- package/dist/{session-options-Dp6mzNSy.d.ts → session-options-X7LhX9BF.d.ts} +2 -1
- package/dist/{session-options-Dp6mzNSy.d.ts.map → session-options-X7LhX9BF.d.ts.map} +1 -1
- package/dist/{session-watch-_8yxQ6ba.js → session-watch-DPOwDRf8.js} +4 -4
- package/dist/{session-watch-_8yxQ6ba.js.map → session-watch-DPOwDRf8.js.map} +1 -1
- package/dist/{watch-C0mwpJcN.js → watch-H7rNOJtv.js} +2 -2
- package/dist/{watch-C0mwpJcN.js.map → watch-H7rNOJtv.js.map} +1 -1
- package/package.json +17 -16
- package/skills/acpx/SKILL.md +13 -3
- package/dist/agent-registry-DWlx5BQ4.js.map +0 -1
- package/dist/cli-D-s_eTUy.js.map +0 -1
- package/dist/client-BchvQRpz.d.ts.map +0 -1
- package/dist/flows-DdxEaeZo.js.map +0 -1
- package/dist/invocation-options-HjxSBsK0.js.map +0 -1
- package/dist/ipc-D0ZMQ0q9.js.map +0 -1
- package/dist/output-GQnhkJMU.js.map +0 -1
- package/dist/queue-owner-runtime-W0lly6ap.js.map +0 -1
package/dist/runtime.d.ts
CHANGED
|
@@ -1,8 +1,23 @@
|
|
|
1
1
|
import { AcpAgentInspection, AcpAgentInspectionOptions, AcpAgentRegistry, AcpInspectableAgentRegistry, DEFAULT_AGENT_NAME, createAgentRegistry } from "./agent-registry.js";
|
|
2
|
-
import { C as PermissionPolicy, E as PromptInput, S as PermissionMode, T as SessionRecord, _ 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, 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 {
|
|
2
|
+
import { C as PermissionPolicy, E as PromptInput, S as PermissionMode, T as SessionRecord, _ 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, 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-X7LhX9BF.js";
|
|
3
|
+
import { n as AcpControlAuthority, t as AcpClient } from "./client-DqCXdF0Q.js";
|
|
4
4
|
import { z } from "zod";
|
|
5
5
|
import { SetSessionConfigOptionResponse, ToolCallContent, ToolCallLocation, ToolKind } from "@agentclientprotocol/sdk";
|
|
6
|
+
//#region src/acp/model-support.d.ts
|
|
7
|
+
export declare const REQUESTED_MODEL_UNSUPPORTED_ERROR_CODE: "ACP_MODEL_UNSUPPORTED";
|
|
8
|
+
type RequestedModelUnsupportedErrorCode = typeof REQUESTED_MODEL_UNSUPPORTED_ERROR_CODE;
|
|
9
|
+
export declare const REQUESTED_MODEL_UNSUPPORTED_REASONS: readonly ["missing-capability", "unadvertised-model"];
|
|
10
|
+
type RequestedModelUnsupportedReason = (typeof REQUESTED_MODEL_UNSUPPORTED_REASONS)[number];
|
|
11
|
+
export declare class RequestedModelUnsupportedError extends Error {
|
|
12
|
+
readonly code: "ACP_MODEL_UNSUPPORTED";
|
|
13
|
+
readonly reason: RequestedModelUnsupportedReason;
|
|
14
|
+
readonly ambiguous?: true;
|
|
15
|
+
constructor(message: string, reason: RequestedModelUnsupportedReason, details?: {
|
|
16
|
+
ambiguous?: true;
|
|
17
|
+
});
|
|
18
|
+
}
|
|
19
|
+
export declare function isRequestedModelUnsupportedError(value: unknown): value is RequestedModelUnsupportedError;
|
|
20
|
+
//#endregion
|
|
6
21
|
//#region src/session/journal.d.ts
|
|
7
22
|
type SessionWatchResult = {
|
|
8
23
|
status: "completed" | "cancelled";
|
|
@@ -33,6 +48,11 @@ type SessionWatchEvent = {
|
|
|
33
48
|
});
|
|
34
49
|
//#endregion
|
|
35
50
|
//#region src/runtime/public/contract.d.ts
|
|
51
|
+
/**
|
|
52
|
+
* ACP has no mid-turn steering request. In-process runtimes admit a "steer"
|
|
53
|
+
* turn like "prompt": it waits behind any active turn on the same session and
|
|
54
|
+
* does not change that turn. Shared runtimes reject "steer".
|
|
55
|
+
*/
|
|
36
56
|
type AcpRuntimePromptMode = "prompt" | "steer";
|
|
37
57
|
type AcpRuntimeSessionMode = "persistent" | "oneshot";
|
|
38
58
|
type AcpSessionUpdateTag = "agent_message_chunk" | "agent_thought_chunk" | "tool_call" | "tool_call_update" | "usage_update" | "available_commands_update" | "current_mode_update" | "config_option_update" | "session_info_update" | "plan" | (string & {});
|
|
@@ -834,5 +854,5 @@ export declare function createRuntimeStore(options: {
|
|
|
834
854
|
stateDir: string;
|
|
835
855
|
}): AcpSessionStore;
|
|
836
856
|
//#endregion
|
|
837
|
-
export { type AcpAgentInspection, type AcpAgentInspectionOptions, type AcpAgentRegistry, type AcpElicitationContext, type AcpElicitationHandler, type AcpElicitationMode, type AcpElicitationRequest, type AcpElicitationResponse, type AcpFileSessionStoreOptions, type AcpInspectableAgentRegistry, type AcpPermissionDecision, type AcpPermissionHandler, type AcpPermissionRequest, type AcpProcessExit, type AcpProcessLaunch, type AcpProcessLaunchScope, type AcpProcessLifecycle, type AcpProcessSpawnFailure, type AcpProcessStarted, type AcpRuntime, type AcpRuntimeAvailableCommand, type AcpRuntimeCapabilities, type AcpRuntimeDoctorReport, type AcpRuntimeEnsureInput, type AcpRuntimeErrorCode, type AcpRuntimeEvent, type AcpRuntimeHandle, type AcpRuntimeOptions, type AcpRuntimePlanEntry, type AcpRuntimePromptMode, type AcpRuntimeSessionContext, type AcpRuntimeSessionMode, type AcpRuntimeSessionModels, type AcpRuntimeSessionPermissions, type AcpRuntimeSessionUsage, type AcpRuntimeStatus, type AcpRuntimeTurn, type AcpRuntimeTurnAttachment, type AcpRuntimeTurnInput, type AcpRuntimeTurnResult, type AcpRuntimeTurnResultError, type AcpRuntimeUsageBreakdown, type AcpRuntimeUsageCost, type AcpSessionRecord, type AcpSessionStore, type AcpSessionUpdateTag, type AcpTextDeltaOriginMeta, DEFAULT_AGENT_NAME, type InspectAgentModelsOptions, type PermissionPolicy,
|
|
857
|
+
export { type AcpAgentInspection, type AcpAgentInspectionOptions, type AcpAgentRegistry, type AcpElicitationContext, type AcpElicitationHandler, type AcpElicitationMode, type AcpElicitationRequest, type AcpElicitationResponse, type AcpFileSessionStoreOptions, type AcpInspectableAgentRegistry, type AcpPermissionDecision, type AcpPermissionHandler, type AcpPermissionRequest, type AcpProcessExit, type AcpProcessLaunch, type AcpProcessLaunchScope, type AcpProcessLifecycle, type AcpProcessSpawnFailure, type AcpProcessStarted, type AcpRuntime, type AcpRuntimeAvailableCommand, type AcpRuntimeCapabilities, type AcpRuntimeDoctorReport, type AcpRuntimeEnsureInput, type AcpRuntimeErrorCode, type AcpRuntimeEvent, type AcpRuntimeHandle, type AcpRuntimeOptions, type AcpRuntimePlanEntry, type AcpRuntimePromptMode, type AcpRuntimeSessionContext, type AcpRuntimeSessionMode, type AcpRuntimeSessionModels, type AcpRuntimeSessionPermissions, type AcpRuntimeSessionUsage, type AcpRuntimeStatus, type AcpRuntimeTurn, type AcpRuntimeTurnAttachment, type AcpRuntimeTurnInput, type AcpRuntimeTurnResult, type AcpRuntimeTurnResultError, type AcpRuntimeUsageBreakdown, type AcpRuntimeUsageCost, type AcpSessionRecord, type AcpSessionStore, type AcpSessionUpdateTag, type AcpTextDeltaOriginMeta, DEFAULT_AGENT_NAME, type InspectAgentModelsOptions, type PermissionPolicy, type RequestedModelUnsupportedErrorCode, type RequestedModelUnsupportedReason, type SessionAgentOptions, type SessionWatchEvent, type SessionWatchResult, type SharedAcpRuntimeOptions, type SystemPromptOption, createAgentRegistry };
|
|
838
858
|
//# sourceMappingURL=runtime.d.ts.map
|
package/dist/runtime.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"runtime.d.ts","names":[],"sources":["../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/errors.ts","../src/runtime/public/shared.ts","../src/runtime/public/handle-state.ts","../src/runtime/shared.ts","../src/runtime.ts"],"mappings":";;;;;;
|
|
1
|
+
{"version":3,"file":"runtime.d.ts","names":[],"sources":["../src/acp/model-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/errors.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;;;KC5CA;EAEN;EACA;EACA,QAAQ;;EAGR;EACA;IAAS;IAAiB;IAAe;IAAqB;;;KAGxD;EAAsB;;EAC5B;EAAiB;EAA0B,SAAS;;EACpD;EAAsB;;EACtB;EAAqB;EAAmB,QAAQ;;;;;;;;;KCsB1C;KAEA;KAEA;KAaA;KAMA;EACV;EACA;EACA;EACA;EACA;EACA;EACA;;KAGU;EACV;EACA;EACA,MAAM;EACN;EACA;;;;;;;;;EASA,iBAAiB;;KAGP;;;;;EAKV;EACA;;;;;;KAOU,sBAAsB;EAChC,QAAQ;EACR;EACA,cAAc;EACd,MAAM;EACN;EACA;;;;;;EAMA,sBAAsB;;EAEtB,gBAAgB;;;KAIN;EACV,UAAU;EACV;;KAGU;EACV;EACA;;EAEA,kBAAkB;IAAQ;IAAiB;;;;;;;;KAQjC;EACV;EACA;;;;;;;KAQU;EACV;EACA;EACA;EACA;EACA;EACA;;;;;;;;KASU;EACV;EACA;;EAEA;;;;;;KAOU;EACV;EACA;EACA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,QAAQ;EAWN,cAAc,OAAO,wBAAwB,QAAQ;UAenD;EAyBR,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"}
|
package/dist/runtime.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { A as findSession, B as assertPersistedKeyPolicy,
|
|
2
|
-
import { O as normalizeAgentCommandInput, a as createAgentRegistry, i as DEFAULT_AGENT_NAME } 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
|
|
4
|
-
import { t as watchSession } from "./watch-
|
|
1
|
+
import { A as findSession, B as assertPersistedKeyPolicy, C as textPrompt, Ct as normalizeOutputError, H as serializeSessionRecordForDisk, L as readSessionRecord, R as resolveSessionRecord, Tt as isAcpResourceNotFoundError, V as parseSessionRecord, gt as writePrivateJsonFile, t as tryCancelOnRunningOwner, wt as extractAcpError } from "./ipc-D7zT86b9.js";
|
|
2
|
+
import { O as normalizeAgentCommandInput, a as createAgentRegistry, i as DEFAULT_AGENT_NAME } from "./agent-registry-kHdpsK9F.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-C0wIYowh.js";
|
|
4
|
+
import { t as watchSession } from "./watch-H7rNOJtv.js";
|
|
5
5
|
import { fileURLToPath } from "node:url";
|
|
6
6
|
import path from "node:path";
|
|
7
7
|
import fs from "node:fs/promises";
|
|
@@ -1059,14 +1059,20 @@ var AcpRuntimeManager = class {
|
|
|
1059
1059
|
...this.runtimeOperationLocks.values(),
|
|
1060
1060
|
...this.pendingTasks
|
|
1061
1061
|
]);
|
|
1062
|
-
|
|
1062
|
+
const owners = /* @__PURE__ */ new Set([...this.retainedSessionOwners.values(), ...this.retiringSessionOwners]);
|
|
1063
|
+
const stopped = await Promise.allSettled([...owners].map(async (owner) => {
|
|
1063
1064
|
this.removeRetainedSessionOwner(owner);
|
|
1064
|
-
|
|
1065
|
+
const retirement = owner.retirement;
|
|
1066
|
+
if (retirement) await retirement;
|
|
1067
|
+
else {
|
|
1068
|
+
const failure = await this.stopSessionOwner(owner);
|
|
1069
|
+
if (failure) throw failure.error;
|
|
1070
|
+
}
|
|
1071
|
+
this.retiringSessionOwners.delete(owner);
|
|
1065
1072
|
}));
|
|
1066
1073
|
const errors = [];
|
|
1067
|
-
for (const result of closed) if (result.status === "rejected") errors.push(result.reason);
|
|
1074
|
+
for (const result of [...closed, ...stopped]) if (result.status === "rejected") errors.push(result.reason);
|
|
1068
1075
|
if (errors.length) throw new AggregateError(errors, "ACP runtime shutdown failed.");
|
|
1069
|
-
this.retiringSessionOwners.clear();
|
|
1070
1076
|
}
|
|
1071
1077
|
trackTask(task) {
|
|
1072
1078
|
this.pendingTasks.add(task);
|
|
@@ -1216,14 +1222,15 @@ var AcpRuntimeManager = class {
|
|
|
1216
1222
|
await this.stopSessionOwner(owner);
|
|
1217
1223
|
}
|
|
1218
1224
|
async stopSessionOwner(owner) {
|
|
1219
|
-
await this.flushSessionOwner(owner)
|
|
1220
|
-
await this.closeClient(owner.client)
|
|
1221
|
-
|
|
1222
|
-
|
|
1223
|
-
|
|
1224
|
-
|
|
1225
|
-
owner.
|
|
1226
|
-
|
|
1225
|
+
const flushAttempt = await settleAttempt(async () => this.flushSessionOwner(owner));
|
|
1226
|
+
const closeAttempt = await settleAttempt(async () => this.closeClient(owner.client));
|
|
1227
|
+
if (!closeAttempt.ok) this.retiringSessionOwners.add(owner);
|
|
1228
|
+
return firstFailedAttempt([
|
|
1229
|
+
flushAttempt,
|
|
1230
|
+
closeAttempt,
|
|
1231
|
+
await settleAttempt(async () => owner.checkpoint.flush()),
|
|
1232
|
+
await settleAttempt(() => owner.client.clearEventHandlers())
|
|
1233
|
+
]);
|
|
1227
1234
|
}
|
|
1228
1235
|
async retrySessionCleanup(recordId) {
|
|
1229
1236
|
for (const owner of this.retiringSessionOwners) if (owner.recordId === recordId) {
|
|
@@ -1562,7 +1569,7 @@ var AcpRuntimeManager = class {
|
|
|
1562
1569
|
agentCommand,
|
|
1563
1570
|
timeoutMs: this.options.timeoutMs
|
|
1564
1571
|
});
|
|
1565
|
-
applyInitialModelSelection(record, session.sessionResult.models,
|
|
1572
|
+
applyInitialModelSelection(record, session.sessionResult.models, modelApplication);
|
|
1566
1573
|
applyLifecycleSnapshotToRecord(record, client.getAgentLifecycleSnapshot());
|
|
1567
1574
|
persistSessionOptions(record, input.sessionOptions);
|
|
1568
1575
|
return record;
|
|
@@ -1854,8 +1861,13 @@ var AcpRuntimeManager = class {
|
|
|
1854
1861
|
setSessionModel: async (modelId, authority) => {
|
|
1855
1862
|
await this.waitForRuntimeControlSession(task, turn);
|
|
1856
1863
|
const models = advertisedModelState(turn.acpxState);
|
|
1864
|
+
const resolvedModelId = resolveRequestedModelId({
|
|
1865
|
+
requestedModel: modelId,
|
|
1866
|
+
models,
|
|
1867
|
+
agentCommand: turn.record.agentCommand
|
|
1868
|
+
});
|
|
1857
1869
|
const response = await turn.client.setSessionModel(turn.activeSessionId, modelId, models, authority);
|
|
1858
|
-
turn.acpxState = applyModelSelection(turn.acpxState, modelId, response);
|
|
1870
|
+
turn.acpxState = applyModelSelection(turn.acpxState, modelId, response, resolvedModelId);
|
|
1859
1871
|
await turn.owner.checkpoint.checkpoint();
|
|
1860
1872
|
return response;
|
|
1861
1873
|
},
|
|
@@ -1882,8 +1894,14 @@ var AcpRuntimeManager = class {
|
|
|
1882
1894
|
acpx: turn.acpxState ?? void 0
|
|
1883
1895
|
}, configId);
|
|
1884
1896
|
const models = advertisedModelState(turn.acpxState);
|
|
1897
|
+
const { modelConfigId, resolvedValue } = resolveRequestedConfigOption({
|
|
1898
|
+
configId: resolvedConfigId,
|
|
1899
|
+
value,
|
|
1900
|
+
models,
|
|
1901
|
+
agentCommand: turn.record.agentCommand
|
|
1902
|
+
});
|
|
1885
1903
|
const response = await turn.client.setSessionConfigOption(turn.activeSessionId, resolvedConfigId, value, models, authority);
|
|
1886
|
-
turn.acpxState = applyConfigOptionSelection(turn.acpxState, resolvedConfigId, value, response,
|
|
1904
|
+
turn.acpxState = applyConfigOptionSelection(turn.acpxState, resolvedConfigId, value, response, modelConfigId, resolvedValue);
|
|
1887
1905
|
await turn.owner.checkpoint.checkpoint();
|
|
1888
1906
|
return {
|
|
1889
1907
|
configId: resolvedConfigId,
|
|
@@ -2073,8 +2091,14 @@ var AcpRuntimeManager = class {
|
|
|
2073
2091
|
return;
|
|
2074
2092
|
}
|
|
2075
2093
|
await this.withRuntimeControlSession(record, sessionMode, async ({ client, sessionId, record: connectedRecord }) => {
|
|
2076
|
-
const
|
|
2077
|
-
|
|
2094
|
+
const models = advertisedModelState(connectedRecord.acpx);
|
|
2095
|
+
const resolvedModelId = resolveRequestedModelId({
|
|
2096
|
+
requestedModel: model,
|
|
2097
|
+
models,
|
|
2098
|
+
agentCommand: connectedRecord.agentCommand
|
|
2099
|
+
});
|
|
2100
|
+
const response = await client.setSessionModel(sessionId, model, models, authority);
|
|
2101
|
+
connectedRecord.acpx = applyModelSelection(connectedRecord.acpx, model, response, resolvedModelId);
|
|
2078
2102
|
}, { replacingConfigOption: { key: "model" } }, authority);
|
|
2079
2103
|
}
|
|
2080
2104
|
async setConfigOption(handle, key, value, sessionMode = "persistent", authority) {
|
|
@@ -2092,8 +2116,14 @@ var AcpRuntimeManager = class {
|
|
|
2092
2116
|
return await this.withRuntimeControlSession(record, sessionMode, async ({ client, sessionId, record: connectedRecord }) => {
|
|
2093
2117
|
const configId = resolveSupportedConfigOptionId(connectedRecord, key);
|
|
2094
2118
|
const models = advertisedModelState(connectedRecord.acpx);
|
|
2119
|
+
const { modelConfigId, resolvedValue } = resolveRequestedConfigOption({
|
|
2120
|
+
configId,
|
|
2121
|
+
value,
|
|
2122
|
+
models,
|
|
2123
|
+
agentCommand: connectedRecord.agentCommand
|
|
2124
|
+
});
|
|
2095
2125
|
const response = await client.setSessionConfigOption(sessionId, configId, value, models, authority);
|
|
2096
|
-
connectedRecord.acpx = applyConfigOptionSelection(connectedRecord.acpx, configId, value, response,
|
|
2126
|
+
connectedRecord.acpx = applyConfigOptionSelection(connectedRecord.acpx, configId, value, response, modelConfigId, resolvedValue);
|
|
2097
2127
|
return response;
|
|
2098
2128
|
}, { replacingConfigOption: {
|
|
2099
2129
|
key,
|