diff --git a/docker/daytona-runner/Dockerfile b/docker/daytona-runner/Dockerfile index 6d544f6e02..7d573c6048 100644 --- a/docker/daytona-runner/Dockerfile +++ b/docker/daytona-runner/Dockerfile @@ -28,7 +28,7 @@ COPY cli/package.json ./cli/package.json # The complete resolved lock (including transitive integrity hashes) is reviewed. # Reject registry-time drift BEFORE installing packages or running lifecycle code. # Refresh this digest together with source/provider dependency changes. -ARG PAPERCLIP_RUNNER_LOCK_SHA256=9c163adf40fe1c6a65abda6207bd9f5acfc8196bc94f81348b8bf1b2769e050e +ARG PAPERCLIP_RUNNER_LOCK_SHA256=a9f7b2839491612675e9ec543143848e8b01343cbf8456098b3e9f4d7394eed1 RUN printf '%s pnpm-lock.yaml\n' "${PAPERCLIP_RUNNER_LOCK_SHA256}" > /tmp/provider-lock.sha256 \ && sha256sum -c /tmp/provider-lock.sha256 \ && pnpm install --frozen-lockfile --filter '@paperclipai/paperclip-runner...' diff --git a/patches/acpx@0.13.1.patch b/patches/acpx@0.13.1.patch index 3f380457b6..b61fdb87cd 100644 --- a/patches/acpx@0.13.1.patch +++ b/patches/acpx@0.13.1.patch @@ -1,7 +1,8 @@ diff --git a/dist/client-CxNllqui.d.ts b/dist/client-CxNllqui.d.ts +index 5e2113ac0..45aff03c3 100644 --- a/dist/client-CxNllqui.d.ts +++ b/dist/client-CxNllqui.d.ts -@@ -120,6 +120,8 @@ +@@ -120,6 +120,8 @@ declare class AcpClient { private initializeProtocolConnection; private handleInitializeFailure; private createTappedStream; @@ -10,7 +11,7 @@ diff --git a/dist/client-CxNllqui.d.ts b/dist/client-CxNllqui.d.ts createSession(cwd?: string): Promise; loadSession(sessionId: string, cwd?: string): Promise; loadSessionWithOptions(sessionId: string, cwd?: string, options?: LoadSessionOptions): Promise; -@@ -135,6 +137,7 @@ +@@ -135,6 +137,7 @@ declare class AcpClient { private throwPromptPermissionFailureIfPresent; setSessionMode(sessionId: string, modeId: string): Promise; setSessionConfigOption(sessionId: string, configId: string, value: string): Promise; @@ -19,9 +20,10 @@ diff --git a/dist/client-CxNllqui.d.ts b/dist/client-CxNllqui.d.ts private setSessionModelThroughConfig; private setSessionModelThroughLegacyMethod; diff --git a/dist/live-checkpoint-BSIrfgVo.js b/dist/live-checkpoint-BSIrfgVo.js +index d454fd7c5..330b80394 100644 --- a/dist/live-checkpoint-BSIrfgVo.js +++ b/dist/live-checkpoint-BSIrfgVo.js -@@ -1068,6 +1068,7 @@ +@@ -1068,6 +1068,7 @@ function serializeSessionRecordForDisk(record) { last_agent_disconnect_reason: canonical.lastAgentDisconnectReason, protocol_version: canonical.protocolVersion, agent_capabilities: canonical.agentCapabilities, @@ -29,7 +31,7 @@ diff --git a/dist/live-checkpoint-BSIrfgVo.js b/dist/live-checkpoint-BSIrfgVo.js title: canonical.title, messages: canonical.messages, updated_at: canonical.updated_at, -@@ -1239,7 +1240,8 @@ +@@ -1239,7 +1240,8 @@ function parseRequestTokenUsage(raw) { for (const [key, value] of Object.entries(record)) { const parsed = parseTokenUsage(value); if (parsed == null) return null; @@ -39,7 +41,7 @@ diff --git a/dist/live-checkpoint-BSIrfgVo.js b/dist/live-checkpoint-BSIrfgVo.js } return usage; } -@@ -1541,6 +1543,7 @@ +@@ -1541,6 +1543,7 @@ function parseSessionRecord(raw) { lastAgentDisconnectReason: optionals.lastAgentDisconnectReason, protocolVersion: typeof record.protocol_version === "number" ? record.protocol_version : void 0, agentCapabilities: asRecord$4(record.agent_capabilities), @@ -47,7 +49,7 @@ diff --git a/dist/live-checkpoint-BSIrfgVo.js b/dist/live-checkpoint-BSIrfgVo.js title: conversation.title, messages: conversation.messages, updated_at: conversation.updated_at, -@@ -1661,7 +1664,7 @@ +@@ -1661,7 +1664,7 @@ const ZED_TAG_KEYS = /* @__PURE__ */ new Set([ "RedactedThinking", "ToolUse" ]); @@ -56,7 +58,7 @@ diff --git a/dist/live-checkpoint-BSIrfgVo.js b/dist/live-checkpoint-BSIrfgVo.js const OPAQUE_VALUE_PATHS = /* @__PURE__ */ new Set([ "agent_capabilities", "messages.Agent.content.ToolUse.input", -@@ -3104,10 +3107,10 @@ +@@ -3104,10 +3107,10 @@ function authEnvKey(methodId) { authEnvKeyCache.set(methodId, key); return key; } @@ -69,7 +71,7 @@ diff --git a/dist/live-checkpoint-BSIrfgVo.js b/dist/live-checkpoint-BSIrfgVo.js if (typeof value === "string" && value.trim().length > 0) return value; } function protectedEnvKey(key) { -@@ -3135,8 +3138,21 @@ +@@ -3135,8 +3138,21 @@ function promotePrefixedAuthEnvironment(env) { } return protectedKeys; } @@ -93,7 +95,7 @@ diff --git a/dist/live-checkpoint-BSIrfgVo.js b/dist/live-checkpoint-BSIrfgVo.js const protectedAuthEnvKeys = promotePrefixedAuthEnvironment(env); if (authCredentials) for (const [methodId, credential] of Object.entries(authCredentials)) { addAuthCredentialEnvKeys(protectedAuthEnvKeys, methodId, credential); -@@ -3178,10 +3194,10 @@ +@@ -3178,10 +3194,10 @@ function resolveConfiguredAuthCredential(methodId, authCredentials) { const configCredentials = authCredentials ?? {}; return configCredentials[methodId] ?? configCredentials[toEnvToken(methodId)]; } @@ -106,7 +108,7 @@ diff --git a/dist/live-checkpoint-BSIrfgVo.js b/dist/live-checkpoint-BSIrfgVo.js stdio: [ "pipe", "pipe", -@@ -3961,10 +3977,13 @@ +@@ -3961,10 +3977,13 @@ function resolveClientCapabilities(params) { ...params.elicitationModes.includes("url") ? { url: {} } : {} } } : {} }; @@ -122,7 +124,7 @@ diff --git a/dist/live-checkpoint-BSIrfgVo.js b/dist/live-checkpoint-BSIrfgVo.js }; } function hasResponseField(response, field) { -@@ -4067,6 +4086,27 @@ +@@ -4067,6 +4086,27 @@ function createNdJsonMessageStream(agentCommand, output, input) { } }) }; } @@ -150,7 +152,7 @@ diff --git a/dist/live-checkpoint-BSIrfgVo.js b/dist/live-checkpoint-BSIrfgVo.js var AcpClient = class { options; connection; -@@ -4105,7 +4145,9 @@ +@@ -4105,7 +4145,9 @@ var AcpClient = class { cwd: asAbsoluteCwd(options.cwd), authPolicy: options.authPolicy ?? "skip", permissionPolicy: snapshotPermissionPolicy(options.permissionPolicy), @@ -161,7 +163,7 @@ diff --git a/dist/live-checkpoint-BSIrfgVo.js b/dist/live-checkpoint-BSIrfgVo.js }; this.eventHandlers = { onAcpMessage: this.options.onAcpMessage, -@@ -4216,9 +4258,21 @@ +@@ -4216,9 +4258,21 @@ var AcpClient = class { this.lastAgentExit = void 0; this.lastKnownPid = child.pid ?? void 0; this.attachAgentLifecycleObservers(child); @@ -183,7 +185,7 @@ diff --git a/dist/live-checkpoint-BSIrfgVo.js b/dist/live-checkpoint-BSIrfgVo.js if (!this.options.verbose) return; process.stderr.write(chunk); }); -@@ -4226,6 +4280,7 @@ +@@ -4226,6 +4280,7 @@ var AcpClient = class { const output = Readable.toWeb(child.stdout); const stream = this.createTappedStream(createNdJsonMessageStream(this.options.agentCommand, input, output)); const connection = this.createConnection(stream, launch); @@ -191,7 +193,7 @@ diff --git a/dist/live-checkpoint-BSIrfgVo.js b/dist/live-checkpoint-BSIrfgVo.js connection.signal.addEventListener("abort", () => { this.recordAgentExit("connection_close", child.exitCode ?? null, child.signalCode ?? null); }, { once: true }); -@@ -4253,7 +4308,12 @@ +@@ -4253,7 +4308,12 @@ var AcpClient = class { geminiAcp: isGeminiAcpCommand(spawnCommand, args), copilotAcp: isCopilotAcpCommand(spawnCommand, args), claudeAcp: isClaudeAcpCommand(spawnCommand, args), @@ -205,7 +207,7 @@ diff --git a/dist/live-checkpoint-BSIrfgVo.js b/dist/live-checkpoint-BSIrfgVo.js }; } logAgentLaunch(plan) { -@@ -4279,10 +4339,17 @@ +@@ -4279,10 +4339,17 @@ var AcpClient = class { } async spawnAgentProcess(plan) { const spawnCommand = buildAgentSpawnCommand(plan.spawnCommand, plan.args, process.platform, plan.spawnOptions.env); @@ -225,7 +227,7 @@ diff --git a/dist/live-checkpoint-BSIrfgVo.js b/dist/live-checkpoint-BSIrfgVo.js try { await waitForSpawn$1(spawnedChild); } catch (error) { -@@ -4293,10 +4360,10 @@ +@@ -4293,10 +4360,10 @@ var AcpClient = class { createConnection(stream, launch) { const app = client({ name: "acpx" }).onNotification(methods.client.session.update, async ({ params }) => { await this.handleSessionUpdate(params); @@ -239,7 +241,7 @@ diff --git a/dist/live-checkpoint-BSIrfgVo.js b/dist/live-checkpoint-BSIrfgVo.js }).onRequest(methods.client.fs.readTextFile, async ({ params }) => { return await this.handleReadTextFile(params); }).onRequest(methods.client.fs.writeTextFile, async ({ params }) => { -@@ -4312,6 +4379,11 @@ +@@ -4312,6 +4379,11 @@ var AcpClient = class { }).onRequest(methods.client.terminal.release, async ({ params }) => { return await this.handleReleaseTerminal(params); }); @@ -251,7 +253,7 @@ diff --git a/dist/live-checkpoint-BSIrfgVo.js b/dist/live-checkpoint-BSIrfgVo.js if (launch.devinAcp) app.onRequest("_cognition.ai/request_diagnostics", (params) => { return params && typeof params === "object" && !Array.isArray(params) ? params : {}; }, async () => ({})); -@@ -4333,12 +4405,12 @@ +@@ -4333,12 +4405,12 @@ var AcpClient = class { async initializeProtocolConnection(connection, launch) { const initializePromise = connection.initialize({ protocolVersion: PROTOCOL_VERSION, @@ -266,7 +268,7 @@ diff --git a/dist/live-checkpoint-BSIrfgVo.js b/dist/live-checkpoint-BSIrfgVo.js clientInfo: resolveClientInfo(launch.devinAcp) }); const initialized = launch.geminiAcp ? await withTimeout(initializePromise, resolveGeminiAcpStartupTimeoutMs()) : await initializePromise; -@@ -4358,6 +4430,36 @@ +@@ -4358,6 +4430,36 @@ var AcpClient = class { throw normalizedError; } createTappedStream(base) { @@ -303,7 +305,7 @@ diff --git a/dist/live-checkpoint-BSIrfgVo.js b/dist/live-checkpoint-BSIrfgVo.js const onAcpMessage = () => this.eventHandlers.onAcpMessage; const onAcpOutputMessage = () => this.eventHandlers.onAcpOutputMessage; const elicitationRequestIds = /* @__PURE__ */ new Set(); -@@ -4367,8 +4469,12 @@ +@@ -4367,8 +4469,12 @@ var AcpClient = class { const shouldSuppressInboundReplaySessionUpdate = (message) => { return this.suppressReplaySessionUpdateMessages && isSessionUpdateNotification(message); }; @@ -317,7 +319,7 @@ diff --git a/dist/live-checkpoint-BSIrfgVo.js b/dist/live-checkpoint-BSIrfgVo.js if (requestId !== void 0) { elicitationRequestIds.add(requestId); return; -@@ -4379,6 +4485,7 @@ +@@ -4379,6 +4485,7 @@ var AcpClient = class { } }; return { @@ -325,7 +327,7 @@ diff --git a/dist/live-checkpoint-BSIrfgVo.js b/dist/live-checkpoint-BSIrfgVo.js readable: new ReadableStream({ async start(controller) { const reader = base.readable.getReader(); try { -@@ -4387,10 +4494,17 @@ +@@ -4387,10 +4494,17 @@ var AcpClient = class { if (done) break; if (!value) continue; observeInbound(value); @@ -344,7 +346,7 @@ diff --git a/dist/live-checkpoint-BSIrfgVo.js b/dist/live-checkpoint-BSIrfgVo.js reader.releaseLock(); controller.close(); } -@@ -4403,10 +4517,20 @@ +@@ -4403,10 +4517,20 @@ var AcpClient = class { onAcpOutputMessage()?.("outbound", message); onAcpMessage()?.("outbound", message); } @@ -365,7 +367,7 @@ diff --git a/dist/live-checkpoint-BSIrfgVo.js b/dist/live-checkpoint-BSIrfgVo.js writer.releaseLock(); } } }) -@@ -4422,7 +4546,10 @@ +@@ -4422,7 +4546,10 @@ var AcpClient = class { const createPromise = this.runConnectionRequest(() => connection.newSession({ cwd: sessionCwd, mcpServers: this.options.mcpServers ?? [], @@ -377,7 +379,7 @@ diff --git a/dist/live-checkpoint-BSIrfgVo.js b/dist/live-checkpoint-BSIrfgVo.js })); result = claudeAcp ? await withTimeout(createPromise, resolveClaudeAcpSessionCreateTimeoutMs()) : await createPromise; } catch (error) { -@@ -4864,7 +4991,7 @@ +@@ -4864,7 +4991,7 @@ var AcpClient = class { } selectAuthMethod(methods) { for (const method of methods) { @@ -386,7 +388,7 @@ diff --git a/dist/live-checkpoint-BSIrfgVo.js b/dist/live-checkpoint-BSIrfgVo.js if (envCredential) return { methodId: method.id, credential: envCredential, -@@ -4890,7 +5017,7 @@ +@@ -4890,7 +5017,7 @@ var AcpClient = class { } readAgentSpecificEnvCredential(methodId) { if (!this.isGrokBuildAcpCommand() || methodId !== "xai.api_key") return; @@ -395,7 +397,7 @@ diff --git a/dist/live-checkpoint-BSIrfgVo.js b/dist/live-checkpoint-BSIrfgVo.js return typeof value === "string" && value.trim().length > 0 ? value : void 0; } selectAgentManagedAuthMethod(methodId) { -@@ -4915,9 +5042,9 @@ +@@ -4915,9 +5042,9 @@ var AcpClient = class { await connection.authenticate({ methodId: selected.methodId }); this.log(`authenticated with method ${selected.methodId} (${selected.source})`); } @@ -407,7 +409,7 @@ diff --git a/dist/live-checkpoint-BSIrfgVo.js b/dist/live-checkpoint-BSIrfgVo.js if (hostResponse) return hostResponse; const { response, recorded } = await this.resolvePermissionRequestFromMode(params); if (!recorded) { -@@ -4926,14 +5053,81 @@ +@@ -4926,14 +5053,81 @@ var AcpClient = class { } return response; } @@ -491,7 +493,7 @@ diff --git a/dist/live-checkpoint-BSIrfgVo.js b/dist/live-checkpoint-BSIrfgVo.js })).then((response) => ({ kind: "response", response -@@ -4970,7 +5164,7 @@ +@@ -4970,7 +5164,7 @@ var AcpClient = class { isElicitationSessionCancelling(sessionId) { return this.closing || this.cancellingSessionIds.has(sessionId); } @@ -500,7 +502,7 @@ diff --git a/dist/live-checkpoint-BSIrfgVo.js b/dist/live-checkpoint-BSIrfgVo.js if (!this.options.onPermissionRequest) return; const signal = this.cancellationSignalForSession(params.sessionId); try { -@@ -4978,7 +5172,7 @@ +@@ -4978,7 +5172,7 @@ var AcpClient = class { sessionId: params.sessionId, raw: params, inferredKind: inferToolKind(params) @@ -509,7 +511,7 @@ diff --git a/dist/live-checkpoint-BSIrfgVo.js b/dist/live-checkpoint-BSIrfgVo.js return this.hostPermissionDecisionResponse(params, signal, decision); } catch (error) { return this.hostPermissionErrorResponse(params, signal, error); -@@ -5028,6 +5222,12 @@ +@@ -5028,6 +5222,12 @@ var AcpClient = class { attachAgentLifecycleObservers(child) { child.once("exit", (exitCode, signal) => { this.recordAgentExit("process_exit", exitCode, signal); @@ -522,7 +524,7 @@ diff --git a/dist/live-checkpoint-BSIrfgVo.js b/dist/live-checkpoint-BSIrfgVo.js }); child.once("close", (exitCode, signal) => { this.recordAgentExit("process_close", exitCode, signal); -@@ -5771,10 +5971,20 @@ +@@ -5771,10 +5971,20 @@ function recordSessionUpdate(conversation, state, notification, timestamp = isoN trimConversationForRuntime(conversation); return acpx; } @@ -545,7 +547,7 @@ diff --git a/dist/live-checkpoint-BSIrfgVo.js b/dist/live-checkpoint-BSIrfgVo.js updateConversationTimestamp(conversation, timestamp); trimConversationForRuntime(conversation); return true; -@@ -6435,6 +6645,27 @@ +@@ -6435,6 +6645,27 @@ async function withConnectedSession(options) { //#region src/runtime/engine/prompt-turn.ts const SESSION_REPLY_IDLE_MS = 1e3; const SESSION_REPLY_DRAIN_TIMEOUT_MS = 5e3; @@ -573,7 +575,7 @@ diff --git a/dist/live-checkpoint-BSIrfgVo.js b/dist/live-checkpoint-BSIrfgVo.js async function runPromptTurn(params) { try { const promptPromise = params.client.prompt(params.sessionId, params.prompt, params.onPromptRequestStarted, params.onElicitation); -@@ -6444,7 +6675,21 @@ +@@ -6444,7 +6675,21 @@ async function runPromptTurn(params) { idleMs: SESSION_REPLY_IDLE_MS, timeoutMs: SESSION_REPLY_DRAIN_TIMEOUT_MS }).catch(() => {}); @@ -595,12 +597,15 @@ diff --git a/dist/live-checkpoint-BSIrfgVo.js b/dist/live-checkpoint-BSIrfgVo.js return { stopReason: response.stopReason, source: "rpc" -@@ -6518,4 +6763,4 @@ +@@ -6518,4 +6763,4 @@ var LiveSessionCheckpoint = class { //#endregion export { writeSessionRecord as $, PERMISSION_POLICY_ACTIONS as $t, REQUESTED_MODEL_UNSUPPORTED_ERROR_CODE as A, TimeoutError as At, getAcpxVersion as B, formatErrorMessage as Bt, mergeSessionOptions as C, PromptInputValidationError as Ct, applyLifecycleSnapshotToRecord as D, promptToDisplayText as Dt, applyConversation as E, parsePromptSource as Et, modelStateFromConfigOptions as F, normalizeAgentName$1 as Ft, findSession as G, toAcpErrorPayload as Gt, DEFAULT_HISTORY_LIMIT as H, normalizeOutputError as Ht, normalizeAgentCommandInput as I, resolveAgentArgv as It, listSessions as J, NON_INTERACTIVE_PERMISSION_POLICIES as Jt, findSessionByDirectoryWalk as K, AUTH_POLICIES as Kt, renderArgvIdentity as L, resolveAgentCommand as Lt, RequestedModelUnsupportedError as M, withTimeout as Mt, assertRequestedModelSupported as N, DEFAULT_AGENT_NAME as Nt, reconcileAgentSessionId as O, textPrompt as Ot, isRequestedModelUnsupportedError as P, listBuiltInAgents as Pt, resolveSessionRecord as Q, PERMISSION_MODES as Qt, runTimedExecFile as R, resolveCanonicalAgentName as Rt, advertisedModelState as S, parsePromptStopReason as St, sessionOptionsFromRecord as T, mergePromptSourceWithText as Tt, absolutePath as U, extractAcpError as Ut, permissionModeSatisfies as V, isRetryablePromptError as Vt, findGitRepositoryRoot as W, isAcpResourceNotFoundError as Wt, normalizeName as X, OUTPUT_ERROR_ORIGINS as Xt, listSessionsForAgent as Y, OUTPUT_ERROR_CODES as Yt, pruneSessions as Z, OUTPUT_FORMATS as Zt, createSessionConversation as _, sessionEventLockPath as _t, applyRequestedModelIfAdvertised as a, measurePerf as at, recordSessionUpdate as b, isAcpJsonRpcMessage as bt, setCurrentModelId as c, setPerfGauge as ct, setDesiredModelId as d, serializeSessionRecordForDisk as dt, SESSION_RECORD_SCHEMA as en, createAtomicWriteTempPath as et, syncAdvertisedModelState as f, normalizeRuntimeSessionId as ft, cloneSessionConversation as g, sessionEventActivePath as gt, cloneSessionAcpxState as h, sessionBaseDir$1 as ht, connectAndLoadSession as i, QueueProtocolError as in, incrementPerfCounter as it, REQUESTED_MODEL_UNSUPPORTED_REASONS as j, withInterrupt as jt, AcpClient as k, InterruptedError as kt, setDesiredConfigOption as l, startPerfTimer as lt, applyConfigOptionsToState as m, defaultSessionEventLog as mt, runPromptTurn as n, AgentSpawnError as nn, formatPerfMetric as nt, currentModelIdFromSetModelResponse as o, recordPerfDuration as ot, applyConfigOptionsToRecord as p, DEFAULT_EVENT_SEGMENT_MAX_BYTES as pt, isoNow$2 as q, EXIT_CODES as qt, withConnectedSession as r, QueueConnectionError as rn, getPerfMetricsSnapshot as rt, clearDesiredConfigOption as s, resetPerfMetrics as st, LiveSessionCheckpoint as t, AcpxOperationalError as tn, assertPersistedKeyPolicy as tt, setDesiredModeId as u, parseSessionRecord as ut, recordClientOperation as v, sessionEventSegmentPath as vt, persistSessionOptions as w, isPromptInput as wt, trimConversationForRuntime as x, parseJsonRpcErrorMessage as xt, recordPromptSubmission as y, extractSessionUpdateNotification as yt, splitCommandLine as z, exitCodeForOutputErrorCode as zt }; --//# sourceMappingURL=live-checkpoint-BSIrfgVo.js.map+//# sourceMappingURL=live-checkpoint-BSIrfgVo.js.map +-//# sourceMappingURL=live-checkpoint-BSIrfgVo.js.map +\ No newline at end of file ++//# sourceMappingURL=live-checkpoint-BSIrfgVo.js.map diff --git a/dist/runtime.d.ts b/dist/runtime.d.ts +index e8102acb0..d3a9ba626 100644 --- a/dist/runtime.d.ts +++ b/dist/runtime.d.ts @@ -1,7 +1,8 @@ @@ -613,7 +618,7 @@ diff --git a/dist/runtime.d.ts b/dist/runtime.d.ts //#region src/agent-registry.d.ts declare const DEFAULT_AGENT_NAME = "codex"; //#endregion -@@ -44,6 +45,7 @@ +@@ -44,6 +45,7 @@ type AcpRuntimeTurnAttachment = { data: string; }; type AcpRuntimeTurnInput = { @@ -621,7 +626,7 @@ diff --git a/dist/runtime.d.ts b/dist/runtime.d.ts handle: AcpRuntimeHandle; text: string; attachments?: AcpRuntimeTurnAttachment[]; -@@ -141,6 +143,11 @@ +@@ -141,6 +143,11 @@ type AcpTextDeltaOriginMeta = { kind?: string; source?: string; }; @@ -633,7 +638,7 @@ diff --git a/dist/runtime.d.ts b/dist/runtime.d.ts type AcpRuntimeEvent = { type: "text_delta"; text: string; -@@ -186,6 +193,10 @@ +@@ -186,6 +193,10 @@ type AcpRuntimeEvent = { * non-null `input` schema. */ availableCommands?: AcpRuntimeAvailableCommand[]; @@ -644,7 +649,7 @@ diff --git a/dist/runtime.d.ts b/dist/runtime.d.ts } | { type: "tool_call"; text: string; -@@ -312,7 +323,49 @@ +@@ -312,7 +323,49 @@ type AcpRuntimeOptions = { elicitationModes?: readonly AcpElicitationMode[]; onPermissionRequest?: (req: AcpPermissionRequest, ctx: { signal: AbortSignal; @@ -694,7 +699,7 @@ diff --git a/dist/runtime.d.ts b/dist/runtime.d.ts }; type AcpFileSessionStoreOptions = { stateDir: string; -@@ -369,6 +422,7 @@ +@@ -369,6 +422,7 @@ declare class AcpRuntimeManager { private createAndSaveRuntimeRecord; private retainInitializedSessionOwner; startTurn(input: { @@ -702,7 +707,7 @@ diff --git a/dist/runtime.d.ts b/dist/runtime.d.ts handle: AcpRuntimeHandle; text: string; attachments?: AcpRuntimeTurnAttachment[]; -@@ -414,6 +468,7 @@ +@@ -414,6 +468,7 @@ declare class AcpRuntimeManager { private cleanupRuntimeTurn; private finalizeRuntimeTurnRecord; runTurn(input: { @@ -711,9 +716,10 @@ diff --git a/dist/runtime.d.ts b/dist/runtime.d.ts text: string; attachments?: AcpRuntimeTurnAttachment[]; diff --git a/dist/runtime.js b/dist/runtime.js +index a1f4a70a0..fe2484de6 100644 --- a/dist/runtime.js +++ b/dist/runtime.js -@@ -371,7 +371,7 @@ +@@ -371,7 +371,7 @@ const PROMPT_EVENT_PARSERS = { current_mode_update: (payload) => statusUpdateEvent("current_mode_update", payload), config_option_update: (payload) => statusUpdateEvent("config_option_update", payload), session_info_update: (payload) => statusUpdateEvent("session_info_update", payload), @@ -722,11 +728,10 @@ diff --git a/dist/runtime.js b/dist/runtime.js client_operation: clientOperationEvent, update: updateStatusEvent, done: () => null, -@@ -423,6 +423,34 @@ - tag: "available_commands_update", +@@ -424,6 +424,34 @@ function availableCommandsUpdateEvent(payload) { availableCommands }; -+} + } +function persistedGoalCapability(goal) { + if (!isRecord(goal) || goal.version !== 1 || goal.controlMethod !== "_session/goal" || !Array.isArray(goal.actions)) return; + const actions = goal.actions.filter((action) => ["set", "pause", "resume", "clear"].includes(action)); @@ -754,10 +759,11 @@ diff --git a/dist/runtime.js b/dist/runtime.js + entries.push({ content, status, ...priority ? { priority } : {} }); + } + return { type: "plan", tag: "plan", entries }; - } ++} function normalizeUsageCost(value) { if (!isRecord(value)) return; -@@ -812,7 +840,21 @@ + const amount = asOptionalFiniteNumber(value.amount); +@@ -812,7 +840,21 @@ var AcpRuntimeManager = class { this.deps = deps; } createClient(options) { @@ -780,7 +786,7 @@ diff --git a/dist/runtime.js b/dist/runtime.js } createSessionOwner(input) { const owner = { -@@ -821,12 +863,16 @@ +@@ -821,12 +863,16 @@ var AcpRuntimeManager = class { pendingSessionUpdates: [] }; input.client.setEventHandlers({ @@ -797,7 +803,7 @@ diff --git a/dist/runtime.js b/dist/runtime.js const active = owner.activeTurn; if (active) { const { task, turn } = active; -@@ -863,6 +909,9 @@ +@@ -863,6 +909,9 @@ var AcpRuntimeManager = class { projection.checkpoint.request(); } routeOwnedClientOperation(owner, operation) { @@ -807,7 +813,7 @@ diff --git a/dist/runtime.js b/dist/runtime.js const active = owner.activeTurn; if (!active) return; const { task, turn } = active; -@@ -1008,6 +1057,8 @@ +@@ -1008,6 +1057,8 @@ var AcpRuntimeManager = class { record.closedAt = void 0; record.protocolVersion = owner.client.initializeResult?.protocolVersion; record.agentCapabilities = owner.client.initializeResult?.agentCapabilities; @@ -816,7 +822,7 @@ diff --git a/dist/runtime.js b/dist/runtime.js applyLifecycleSnapshotToRecord(record, owner.client.getAgentLifecycleSnapshot()); } async finishBufferedOwnerControl(owner, record) { -@@ -1086,6 +1137,11 @@ +@@ -1086,6 +1137,11 @@ var AcpRuntimeManager = class { record.closed = false; record.closedAt = void 0; this.closingActiveRecords.delete(record.acpxRecordId); @@ -828,7 +834,7 @@ diff --git a/dist/runtime.js b/dist/runtime.js await this.options.sessionStore.save(record); return record; } -@@ -1149,6 +1205,8 @@ +@@ -1149,6 +1205,8 @@ var AcpRuntimeManager = class { this.closingActiveRecords.delete(record.acpxRecordId); record.protocolVersion = client.initializeResult?.protocolVersion; record.agentCapabilities = client.initializeResult?.agentCapabilities; @@ -837,7 +843,7 @@ diff --git a/dist/runtime.js b/dist/runtime.js applyConfigOptionsToRecord(record, session.sessionResult); const modelApplication = await applyRequestedModelIfAdvertised({ client, -@@ -1301,6 +1359,7 @@ +@@ -1301,6 +1359,7 @@ var AcpRuntimeManager = class { client: turn.client, sessionId, prompt: task.promptInput, @@ -845,7 +851,7 @@ diff --git a/dist/runtime.js b/dist/runtime.js timeoutMs: task.input.timeoutMs ?? this.options.timeoutMs, conversation: turn.conversation, promptMessageId: turn.promptMessageId, -@@ -1469,6 +1528,10 @@ +@@ -1469,6 +1528,10 @@ var AcpRuntimeManager = class { setSessionConfigOption: async (configId, value) => { return (await task.state.activeController.setResolvedSessionConfigOption(configId, value)).response; }, @@ -856,7 +862,7 @@ diff --git a/dist/runtime.js b/dist/runtime.js setResolvedSessionConfigOption: async (configId, value) => await this.setRuntimeResolvedSessionConfigOption(task, turn, configId, value) }; } -@@ -1575,6 +1638,8 @@ +@@ -1575,6 +1638,8 @@ var AcpRuntimeManager = class { reconcileAgentSessionId(turn.record, turn.record.agentSessionId); turn.record.protocolVersion = turn.client.initializeResult?.protocolVersion; turn.record.agentCapabilities = turn.client.initializeResult?.agentCapabilities; @@ -865,11 +871,10 @@ diff --git a/dist/runtime.js b/dist/runtime.js turn.record.acpx = turn.acpxState; applyConversation(turn.record, turn.conversation); applyLifecycleSnapshotToRecord(turn.record, turn.client.getAgentLifecycleSnapshot()); -@@ -1706,6 +1771,17 @@ - applyDesiredConfigOptionToRecord(connectedRecord, configId, value); +@@ -1707,6 +1772,17 @@ var AcpRuntimeManager = class { }); await this.options.sessionStore.save(result.record); -+ } + } + async requestExtension(input) { + const recordId = input.handle.acpxRecordId ?? input.handle.sessionKey; + return await this.withManagerLock(this.runtimeOperationLocks, recordId, async () => { @@ -880,10 +885,11 @@ diff --git a/dist/runtime.js b/dist/runtime.js + return await client.requestExtension(input.method, input.params); + })).value; + }); - } ++ } async cancel(handle) { await this.activeControllers.get(handle.acpxRecordId ?? handle.sessionKey)?.requestCancelActivePrompt(); -@@ -2055,6 +2131,7 @@ + } +@@ -2055,6 +2131,7 @@ var AcpxRuntime = class { const turnPromise = this.getManager().then((manager) => manager.startTurn({ handle, text: input.text, @@ -891,7 +897,7 @@ diff --git a/dist/runtime.js b/dist/runtime.js attachments: input.attachments, mode: input.mode, sessionMode: state.mode, -@@ -2087,6 +2164,7 @@ +@@ -2087,6 +2164,7 @@ var AcpxRuntime = class { yield* (await this.getManager()).runTurn({ handle, text: input.text, @@ -899,11 +905,10 @@ diff --git a/dist/runtime.js b/dist/runtime.js attachments: input.attachments, mode: input.mode, sessionMode: state.mode, -@@ -2118,6 +2196,14 @@ - async setConfigOption(input) { +@@ -2119,6 +2197,14 @@ var AcpxRuntime = class { const { handle, state } = this.resolveManagerHandle(input.handle); await (await this.getManager()).setConfigOption(handle, input.key, input.value, state.mode); -+ } + } + async requestExtension(input) { + const { handle, state } = this.resolveManagerHandle(input.handle); + return await (await this.getManager()).requestExtension({ @@ -911,15 +916,19 @@ diff --git a/dist/runtime.js b/dist/runtime.js + handle, + sessionMode: input.sessionMode ?? state.mode + }); - } ++ } async cancel(input) { const { handle } = this.resolveManagerHandle(input.handle); -@@ -2178,4 +2264,4 @@ + await (await this.getManager()).cancel(handle); +@@ -2178,4 +2264,4 @@ function createRuntimeStore(options) { //#endregion export { ACPX_BACKEND_ID, AcpRuntimeError, AcpxRuntime, DEFAULT_AGENT_NAME, REQUESTED_MODEL_UNSUPPORTED_ERROR_CODE, REQUESTED_MODEL_UNSUPPORTED_REASONS, RequestedModelUnsupportedError, createAcpRuntime, createAgentRegistry, createFileSessionStore, createRuntimeStore, decodeAcpxRuntimeHandleState, encodeAcpxRuntimeHandleState, isAcpRuntimeError, isRequestedModelUnsupportedError }; --//# sourceMappingURL=runtime.js.map+//# sourceMappingURL=runtime.js.map +-//# sourceMappingURL=runtime.js.map +\ No newline at end of file ++//# sourceMappingURL=runtime.js.map diff --git a/dist/session-options-DwRDODlr.d.ts b/dist/session-options-DwRDODlr.d.ts +index c3da16452..5ccc8dda1 100644 --- a/dist/session-options-DwRDODlr.d.ts +++ b/dist/session-options-DwRDODlr.d.ts @@ -1,4 +1,5 @@ @@ -928,7 +937,7 @@ diff --git a/dist/session-options-DwRDODlr.d.ts b/dist/session-options-DwRDODlr. //#region src/prompt-content.d.ts type PromptInput = ContentBlock[]; //#endregion -@@ -27,6 +28,8 @@ +@@ -27,6 +28,8 @@ type AcpElicitationContext = { requestId: JsonRpcId; /** Aborts with the request itself or its owning prompt turn/session. */ signal: AbortSignal; @@ -937,7 +946,7 @@ diff --git a/dist/session-options-DwRDODlr.d.ts b/dist/session-options-DwRDODlr. }; type AcpElicitationResponseMeta = { _meta?: Record | null; -@@ -116,6 +119,35 @@ +@@ -116,6 +119,35 @@ type AcpClientOptions = { }; env?: Record; }; @@ -973,7 +982,7 @@ diff --git a/dist/session-options-DwRDODlr.d.ts b/dist/session-options-DwRDODlr. onAcpMessage?: (direction: AcpMessageDirection, message: AcpJsonRpcMessage) => void; onAcpOutputMessage?: (direction: AcpMessageDirection, message: AcpJsonRpcMessage) => void; onSessionUpdate?: (notification: SessionNotification) => void; -@@ -123,6 +155,8 @@ +@@ -123,6 +155,8 @@ type AcpClientOptions = { onPermissionEscalation?: (event: PermissionEscalationEvent) => void; onPermissionRequest?: (req: AcpPermissionRequest, ctx: { signal: AbortSignal; @@ -982,7 +991,7 @@ diff --git a/dist/session-options-DwRDODlr.d.ts b/dist/session-options-DwRDODlr. }) => Promise; }; declare const SESSION_RECORD_SCHEMA: "acpx.session.v1"; -@@ -263,12 +297,15 @@ +@@ -263,12 +297,15 @@ type SessionRecord = { lastAgentDisconnectReason?: string; protocolVersion?: number; agentCapabilities?: AgentCapabilities; @@ -999,8 +1008,10 @@ diff --git a/dist/session-options-DwRDODlr.d.ts b/dist/session-options-DwRDODlr. acpx?: SessionAcpxState; importedFrom?: SessionImportedFrom; }; -@@ -295,4 +332,4 @@ +@@ -295,4 +332,4 @@ type SessionAgentOptions = { }; //#endregion export { SessionRecord as _, AcpElicitationHandler as a, AcpElicitationResponse as c, AuthPolicy as d, McpServer$1 as f, PermissionStats as g, PermissionPolicy as h, AcpElicitationContext as i, AcpPermissionDecision as l, PermissionMode as m, SystemPromptOption as n, AcpElicitationMode as o, NonInteractivePermissionPolicy as p, AcpClientOptions as r, AcpElicitationRequest as s, SessionAgentOptions as t, AcpPermissionRequest as u, PromptInput as v }; --//# sourceMappingURL=session-options-DwRDODlr.d.ts.map+//# sourceMappingURL=session-options-DwRDODlr.d.ts.map +-//# sourceMappingURL=session-options-DwRDODlr.d.ts.map +\ No newline at end of file ++//# sourceMappingURL=session-options-DwRDODlr.d.ts.map