zidane 8.2.1 → 8.2.2
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/acp-cli.js +8 -8
- package/dist/{acp-D7Pr8NGt.js → acp-oYRjlh71.js} +6 -6
- package/dist/{acp-D7Pr8NGt.js.map → acp-oYRjlh71.js.map} +1 -1
- package/dist/acp.d.ts +2 -2
- package/dist/acp.js +1 -1
- package/dist/{agent-DecDtKA_.js → agent-CBQglXtH.js} +9 -379
- package/dist/agent-CBQglXtH.js.map +1 -0
- package/dist/agent.d.ts +1 -1
- package/dist/agent.js +1 -1
- package/dist/{builtin-artifact-kinds-B_OEgf8b.js → builtin-artifact-kinds-BmorPkgz.js} +36 -9
- package/dist/builtin-artifact-kinds-BmorPkgz.js.map +1 -0
- package/dist/chat/pure.d.ts +3 -3
- package/dist/chat/pure.js +4 -4
- package/dist/chat.d.ts +4 -4
- package/dist/chat.js +14 -14
- package/dist/{cli-shared-Dx4vmif6.js → cli-shared-E5m_pI8A.js} +2 -2
- package/dist/{cli-shared-Dx4vmif6.js.map → cli-shared-E5m_pI8A.js.map} +1 -1
- package/dist/{client-core-imHuBWV3.d.ts → client-core-BdD20sOv.d.ts} +24 -5
- package/dist/{client-core-imHuBWV3.d.ts.map → client-core-BdD20sOv.d.ts.map} +1 -1
- package/dist/{connection-loop-CdHt3iQi.d.ts → connection-loop-DTk82YVl.d.ts} +3 -3
- package/dist/{connection-loop-CdHt3iQi.d.ts.map → connection-loop-DTk82YVl.d.ts.map} +1 -1
- package/dist/contexts/daytona.d.ts +1 -1
- package/dist/contexts/e2b.d.ts +1 -1
- package/dist/{credentials-Dti61yoi.js → credentials-B9DfBJP9.js} +11 -7
- package/dist/credentials-B9DfBJP9.js.map +1 -0
- package/dist/daemon-cli.js +2 -2
- package/dist/{dispatcher-vy3J6JMA.js → dispatcher-BICXFGiJ.js} +27 -13
- package/dist/dispatcher-BICXFGiJ.js.map +1 -0
- package/dist/{engine-BN6PjWAW.js → engine-QCX3GV-i.js} +5 -5
- package/dist/{engine-BN6PjWAW.js.map → engine-QCX3GV-i.js.map} +1 -1
- package/dist/{eval-BaJtxLCW.js → eval-CfQlBR81.js} +2 -2
- package/dist/{eval-BaJtxLCW.js.map → eval-CfQlBR81.js.map} +1 -1
- package/dist/eval.d.ts +1 -1
- package/dist/eval.js +1 -1
- package/dist/{executor-CT4oUkg6.js → executor-B8GoXaaE.js} +2 -2
- package/dist/{executor-CT4oUkg6.js.map → executor-B8GoXaaE.js.map} +1 -1
- package/dist/{extensions-BKt7lxxv.js → extensions-BeH3D-bq.js} +114 -113
- package/dist/extensions-BeH3D-bq.js.map +1 -0
- package/dist/extensions.d.ts +1 -1
- package/dist/extensions.js +2 -2
- package/dist/{fold-rules-BYedvsH7.d.ts → fold-rules-DSypi36k.d.ts} +2 -2
- package/dist/{fold-rules-BYedvsH7.d.ts.map → fold-rules-DSypi36k.d.ts.map} +1 -1
- package/dist/google-O6pRnddf.js +881 -0
- package/dist/google-O6pRnddf.js.map +1 -0
- package/dist/{headless-Ebd1ZEzC.js → headless-R4pbpTkm.js} +3 -3
- package/dist/{headless-Ebd1ZEzC.js.map → headless-R4pbpTkm.js.map} +1 -1
- package/dist/headless.d.ts +1 -1
- package/dist/headless.js +1 -1
- package/dist/{host-scoped-settings-Cy_zbmB_.js → host-scoped-settings-CCnaBkCV.js} +2 -2
- package/dist/{host-scoped-settings-Cy_zbmB_.js.map → host-scoped-settings-CCnaBkCV.js.map} +1 -1
- package/dist/{host-signals-Cx2IAbHh.js → host-signals-DI9JQvR9.js} +5 -5
- package/dist/{host-signals-Cx2IAbHh.js.map → host-signals-DI9JQvR9.js.map} +1 -1
- package/dist/{index-pc71ADi6.d.ts → index-BkNeiJYI.d.ts} +71 -4
- package/dist/index-BkNeiJYI.d.ts.map +1 -0
- package/dist/{index-CidMTcxS.d.ts → index-DyQyDLX1.d.ts} +167 -10
- package/dist/index-DyQyDLX1.d.ts.map +1 -0
- package/dist/{index-Bt_G2Z_2.d.ts → index-lcuvhQfF.d.ts} +5 -5
- package/dist/{index-Bt_G2Z_2.d.ts.map → index-lcuvhQfF.d.ts.map} +1 -1
- package/dist/index.d.ts +3 -3
- package/dist/index.js +15 -15
- package/dist/ipc/remote.d.ts +5 -5
- package/dist/ipc/remote.js +3 -3
- package/dist/ipc.d.ts +5 -5
- package/dist/ipc.js +6 -6
- package/dist/{links-DSZ4uQ5w.js → links-CN5JFFde.js} +9 -9
- package/dist/{links-DSZ4uQ5w.js.map → links-CN5JFFde.js.map} +1 -1
- package/dist/mcp.d.ts +1 -1
- package/dist/{oauth-BSqXgads.js → oauth-TVPPye84.js} +155 -25
- package/dist/oauth-TVPPye84.js.map +1 -0
- package/dist/{openai-dTmPxM6T.js → openai-Rh6u5NXF.js} +121 -2
- package/dist/openai-Rh6u5NXF.js.map +1 -0
- package/dist/{openrouter-CtZbQDa0.js → openrouter-Dg0yaI-o.js} +91 -2
- package/dist/openrouter-Dg0yaI-o.js.map +1 -0
- package/dist/output/stream-json.d.ts +1 -1
- package/dist/output/terminal.d.ts +1 -1
- package/dist/plugins.d.ts +1 -1
- package/dist/{presets-EzlHyFSi.js → presets-DXeHsd24.js} +3 -3
- package/dist/{presets-EzlHyFSi.js.map → presets-DXeHsd24.js.map} +1 -1
- package/dist/presets.d.ts +1 -1
- package/dist/presets.js +1 -1
- package/dist/{prompts-D2lPHLOV.d.ts → prompts-DmY13jvF.d.ts} +2 -1
- package/dist/prompts-DmY13jvF.d.ts.map +1 -0
- package/dist/protocol-BIv1Yuvl.js.map +1 -1
- package/dist/providers/anthropic.d.ts +1 -1
- package/dist/providers/arcee.d.ts +1 -1
- package/dist/providers/baseten.d.ts +1 -1
- package/dist/providers/cerebras.d.ts +1 -1
- package/dist/providers/google.d.ts +1 -1
- package/dist/providers/google.js +1 -784
- package/dist/providers/local.d.ts +1 -1
- package/dist/providers/neuralwatt.d.ts +1 -1
- package/dist/providers/openai-compat.d.ts +1 -1
- package/dist/providers/openai.d.ts +1 -1
- package/dist/providers/openai.js +1 -1
- package/dist/providers/openrouter.d.ts +1 -1
- package/dist/providers/openrouter.js +1 -1
- package/dist/providers/xai.d.ts +1 -1
- package/dist/providers/xai.js +1 -101
- package/dist/providers.d.ts +2 -2
- package/dist/providers.js +6 -5
- package/dist/{registry-BBaEgTsX.js → registry-PNi9rsGi.js} +3 -3
- package/dist/{registry-BBaEgTsX.js.map → registry-PNi9rsGi.js.map} +1 -1
- package/dist/{remote-hosts-bO7wOt44.js → remote-hosts-b6Luwdhu.js} +4 -4
- package/dist/{remote-hosts-bO7wOt44.js.map → remote-hosts-b6Luwdhu.js.map} +1 -1
- package/dist/restate.d.ts +1 -1
- package/dist/{secret-shapes-Cda65uDH.js → secret-shapes-CEoGmfEE.js} +10 -1
- package/dist/secret-shapes-CEoGmfEE.js.map +1 -0
- package/dist/session/sqlite.d.ts +1 -1
- package/dist/{session-factory-BazyVdzj.js → session-factory-CMwIXE-7.js} +5 -5
- package/dist/{session-factory-BazyVdzj.js.map → session-factory-CMwIXE-7.js.map} +1 -1
- package/dist/session.d.ts +1 -1
- package/dist/{settings-keys-zYaer8DY.js → settings-keys-DssjmqAV.js} +3 -3
- package/dist/{settings-keys-zYaer8DY.js.map → settings-keys-DssjmqAV.js.map} +1 -1
- package/dist/{shell-path-od9XHRPt.js → shell-path-BUFwqU_A.js} +3 -3
- package/dist/{shell-path-od9XHRPt.js.map → shell-path-BUFwqU_A.js.map} +1 -1
- package/dist/{skills-use-D68a1gyZ.js → skills-use-CssTEaIj.js} +375 -2
- package/dist/skills-use-CssTEaIj.js.map +1 -0
- package/dist/skills.d.ts +1 -1
- package/dist/{system-freeze-DXvJpveP.js → system-freeze-Um9ZJiPo.js} +24 -9
- package/dist/system-freeze-Um9ZJiPo.js.map +1 -0
- package/dist/{todo-edits-CmqNFvLJ.js → todo-edits-H77ROt6X.js} +2 -2
- package/dist/{todo-edits-CmqNFvLJ.js.map → todo-edits-H77ROt6X.js.map} +1 -1
- package/dist/tools/fetch-url.d.ts +1 -1
- package/dist/tools/prompts.d.ts +1 -1
- package/dist/tools/prompts.js +7 -0
- package/dist/tools/prompts.js.map +1 -1
- package/dist/tools/web-search.d.ts +1 -1
- package/dist/{tools-9Dpm8F-f.js → tools-pZVFIJ_K.js} +273 -2
- package/dist/tools-pZVFIJ_K.js.map +1 -0
- package/dist/tools.d.ts +3 -3
- package/dist/tools.js +4 -4
- package/dist/{transcript-anchors-B3TFJqr_.js → transcript-anchors-s-yxh0jt.js} +10 -10
- package/dist/{transcript-anchors-B3TFJqr_.js.map → transcript-anchors-s-yxh0jt.js.map} +1 -1
- package/dist/{transcript-reconcile-BC2DbTmp.js → transcript-reconcile-DeFLIQ14.js} +19 -2
- package/dist/{transcript-reconcile-BC2DbTmp.js.map → transcript-reconcile-DeFLIQ14.js.map} +1 -1
- package/dist/tui.d.ts +7 -7
- package/dist/tui.js +24 -22
- package/dist/tui.js.map +1 -1
- package/dist/{turn-operations-CIFoOebZ.d.ts → turn-operations-BbGJ-KSt.d.ts} +2 -2
- package/dist/{turn-operations-CIFoOebZ.d.ts.map → turn-operations-BbGJ-KSt.d.ts.map} +1 -1
- package/dist/{types-iFLlZKd0.d.ts → types-C0PJmBaO.d.ts} +2 -2
- package/dist/{types-iFLlZKd0.d.ts.map → types-C0PJmBaO.d.ts.map} +1 -1
- package/dist/types-JzccL5GE.js +24 -0
- package/dist/types-JzccL5GE.js.map +1 -0
- package/dist/types.d.ts +2 -2
- package/dist/{url-BTH-HE9Y.js → url-CLl0u4Z8.js} +2 -2
- package/dist/{url-BTH-HE9Y.js.map → url-CLl0u4Z8.js.map} +1 -1
- package/dist/{version-4T82xRxQ.js → version-v77Y4A3C.js} +2 -2
- package/dist/{version-4T82xRxQ.js.map → version-v77Y4A3C.js.map} +1 -1
- package/dist/wire-DH77Z-rr.js +80 -0
- package/dist/wire-DH77Z-rr.js.map +1 -0
- package/dist/{workspace-exec-stream-By8na6vz.js → workspace-exec-stream-kqARO8iC.js} +4 -4
- package/dist/{workspace-exec-stream-By8na6vz.js.map → workspace-exec-stream-kqARO8iC.js.map} +1 -1
- package/dist/{write-file-B4vi3SvQ.js → write-file-QYrcDdl3.js} +3 -3
- package/dist/{write-file-B4vi3SvQ.js.map → write-file-QYrcDdl3.js.map} +1 -1
- package/dist/{ws-CS312Jpx.js → ws-BD9FN98u.js} +5 -5
- package/dist/{ws-CS312Jpx.js.map → ws-BD9FN98u.js.map} +1 -1
- package/dist/{ws-client-wWka-Jku.js → ws-client-D7eb2UbH.js} +3 -3
- package/dist/{ws-client-wWka-Jku.js.map → ws-client-D7eb2UbH.js.map} +1 -1
- package/dist/xai-CStTwCV2.js +182 -0
- package/dist/xai-CStTwCV2.js.map +1 -0
- package/docs/ARCHITECTURE.md +1 -0
- package/docs/ARTIFACTS.md +1 -1
- package/docs/EXTENSIONS.md +9 -5
- package/package.json +2 -2
- package/dist/agent-DecDtKA_.js.map +0 -1
- package/dist/builtin-artifact-kinds-B_OEgf8b.js.map +0 -1
- package/dist/credentials-Dti61yoi.js.map +0 -1
- package/dist/dispatcher-vy3J6JMA.js.map +0 -1
- package/dist/extensions-BKt7lxxv.js.map +0 -1
- package/dist/index-CidMTcxS.d.ts.map +0 -1
- package/dist/index-pc71ADi6.d.ts.map +0 -1
- package/dist/oauth-BSqXgads.js.map +0 -1
- package/dist/openai-dTmPxM6T.js.map +0 -1
- package/dist/openrouter-CtZbQDa0.js.map +0 -1
- package/dist/prompts-D2lPHLOV.d.ts.map +0 -1
- package/dist/providers/google.js.map +0 -1
- package/dist/providers/xai.js.map +0 -1
- package/dist/secret-shapes-Cda65uDH.js.map +0 -1
- package/dist/skills-use-D68a1gyZ.js.map +0 -1
- package/dist/system-freeze-DXvJpveP.js.map +0 -1
- package/dist/tools-9Dpm8F-f.js.map +0 -1
package/dist/acp.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { $ as PermissionOption, A as DeleteSessionRequest, At as ToolCallContent, B as JsonRpcId, Bt as createClientDeclaredTools, C as CancelNotification, Ct as SetSessionConfigOptionResponse, D as ContentChunk, Dt as TerminalOutputResponse, E as ContentBlock, Et as TerminalExitStatus, F as ImageContent, Ft as WriteTextFileRequest, G as JsonRpcSuccess, H as JsonRpcNotification, I as InitializeRequest, It as AcpClientToolSpec, J as LoadSessionRequest, K as ListSessionsRequest, L as InitializeResponse, Lt as CLIENT_TOOL_CALL_METHOD, M as EmbeddedResourceResource, Mt as ToolCallStatus, N as EnvVariable, Nt as ToolCallUpdate, O as Cost, Ot as TextContent, P as HttpHeader, Pt as ToolKind, Q as NewSessionResponse, R as JsonRpcError, Rt as CLIENT_TOOL_CANCEL_METHOD, S as BlobResourceContents, St as SetSessionConfigOptionRequest, T as ContentAnnotations, Tt as StopReason, U as JsonRpcRequest, V as JsonRpcMessage, Vt as parseClientToolSpecs, W as JsonRpcResponse, X as McpCapabilities, Y as LoadSessionResponse, Z as NewSessionRequest, _ as AudioContent, _t as SessionInfo, a as AcpImplementationInfo, at as RequestPermissionOutcome, b as AvailableCommand, bt as SessionNotification, c as AcpModelOption, ct as ResumeSessionRequest, d as AcpPromptMapping, dt as SessionCapabilities, et as PlanEntry, f as AcpServerOptions, ft as SessionConfigOption, g as AgentCapabilities, gt as SessionConfigSelectOptions, h as AgentAuthCapabilities, ht as SessionConfigSelectOption, i as AcpErrorCode, it as ReadTextFileRequest, j as EmbeddedResource, jt as ToolCallLocation, k as CreateTerminalRequest, kt as TextResourceContents, l as AcpPeer, lt as ResumeSessionResponse, m as AcpSessionRuntime, mt as SessionConfigSelectGroup, n as AcpClientCapabilities, nt as PromptRequest, o as AcpMcpServer, ot as RequestPermissionRequest, p as AcpSessionContentMapper, pt as SessionConfigOptionCategory, q as ListSessionsResponse, r as AcpContentMapper, rt as PromptResponse, s as AcpModelChoice, st as ResourceLink, t as ACP_PROTOCOL_VERSION, tt as PromptCapabilities, u as AcpPermissionPolicy, ut as Role, v as AuthMethod, vt as SessionMode, w as CloseSessionRequest, wt as SetSessionModeRequest, x as AvailableCommandInput, xt as SessionUpdate, y as AuthenticateRequest, yt as SessionModeState, z as JsonRpcFailure, zt as ClientToolCallResponse } from "./types-
|
|
1
|
+
import { QT as ToolDef, Qw as McpServerConfig, RT as ToolResultContent, Sa as Preset, qT as TurnUsage, yT as SessionContentBlock } from "./index-DyQyDLX1.js";
|
|
2
|
+
import { $ as PermissionOption, A as DeleteSessionRequest, At as ToolCallContent, B as JsonRpcId, Bt as createClientDeclaredTools, C as CancelNotification, Ct as SetSessionConfigOptionResponse, D as ContentChunk, Dt as TerminalOutputResponse, E as ContentBlock, Et as TerminalExitStatus, F as ImageContent, Ft as WriteTextFileRequest, G as JsonRpcSuccess, H as JsonRpcNotification, I as InitializeRequest, It as AcpClientToolSpec, J as LoadSessionRequest, K as ListSessionsRequest, L as InitializeResponse, Lt as CLIENT_TOOL_CALL_METHOD, M as EmbeddedResourceResource, Mt as ToolCallStatus, N as EnvVariable, Nt as ToolCallUpdate, O as Cost, Ot as TextContent, P as HttpHeader, Pt as ToolKind, Q as NewSessionResponse, R as JsonRpcError, Rt as CLIENT_TOOL_CANCEL_METHOD, S as BlobResourceContents, St as SetSessionConfigOptionRequest, T as ContentAnnotations, Tt as StopReason, U as JsonRpcRequest, V as JsonRpcMessage, Vt as parseClientToolSpecs, W as JsonRpcResponse, X as McpCapabilities, Y as LoadSessionResponse, Z as NewSessionRequest, _ as AudioContent, _t as SessionInfo, a as AcpImplementationInfo, at as RequestPermissionOutcome, b as AvailableCommand, bt as SessionNotification, c as AcpModelOption, ct as ResumeSessionRequest, d as AcpPromptMapping, dt as SessionCapabilities, et as PlanEntry, f as AcpServerOptions, ft as SessionConfigOption, g as AgentCapabilities, gt as SessionConfigSelectOptions, h as AgentAuthCapabilities, ht as SessionConfigSelectOption, i as AcpErrorCode, it as ReadTextFileRequest, j as EmbeddedResource, jt as ToolCallLocation, k as CreateTerminalRequest, kt as TextResourceContents, l as AcpPeer, lt as ResumeSessionResponse, m as AcpSessionRuntime, mt as SessionConfigSelectGroup, n as AcpClientCapabilities, nt as PromptRequest, o as AcpMcpServer, ot as RequestPermissionRequest, p as AcpSessionContentMapper, pt as SessionConfigOptionCategory, q as ListSessionsResponse, r as AcpContentMapper, rt as PromptResponse, s as AcpModelChoice, st as ResourceLink, t as ACP_PROTOCOL_VERSION, tt as PromptCapabilities, u as AcpPermissionPolicy, ut as Role, v as AuthMethod, vt as SessionMode, w as CloseSessionRequest, wt as SetSessionModeRequest, x as AvailableCommandInput, xt as SessionUpdate, y as AuthenticateRequest, yt as SessionModeState, z as JsonRpcFailure, zt as ClientToolCallResponse } from "./types-C0PJmBaO.js";
|
|
3
3
|
import { Buffer } from "node:buffer";
|
|
4
4
|
import { Readable, Writable } from "node:stream";
|
|
5
5
|
//#region src/acp/server.d.ts
|
package/dist/acp.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { n as JsonRpcRemoteError, r as createJsonRpcConnection } from "./json-rpc-G0rBfEar.js";
|
|
2
|
-
import { a as wrapToolsForAcpClient, c as sessionBlocksToAcp, d as CLIENT_TOOL_CALL_METHOD, f as CLIENT_TOOL_CANCEL_METHOD, i as withAcpDefaultTools, l as stopReasonFromRun, m as parseClientToolSpecs, n as AcpProtocolError, o as acpMcpServersToZidane, p as createClientDeclaredTools, r as createAcpServer, s as acpPromptToPromptParts, t as runAcpStdioServer, u as toolResultToAcpContent } from "./acp-
|
|
2
|
+
import { a as wrapToolsForAcpClient, c as sessionBlocksToAcp, d as CLIENT_TOOL_CALL_METHOD, f as CLIENT_TOOL_CANCEL_METHOD, i as withAcpDefaultTools, l as stopReasonFromRun, m as parseClientToolSpecs, n as AcpProtocolError, o as acpMcpServersToZidane, p as createClientDeclaredTools, r as createAcpServer, s as acpPromptToPromptParts, t as runAcpStdioServer, u as toolResultToAcpContent } from "./acp-oYRjlh71.js";
|
|
3
3
|
export { AcpProtocolError, CLIENT_TOOL_CALL_METHOD, CLIENT_TOOL_CANCEL_METHOD, JsonRpcRemoteError, acpMcpServersToZidane, acpPromptToPromptParts, createAcpServer, createClientDeclaredTools, createJsonRpcConnection, parseClientToolSpecs, runAcpStdioServer, sessionBlocksToAcp, stopReasonFromRun, toolResultToAcpContent, withAcpDefaultTools, wrapToolsForAcpClient };
|
|
@@ -25,6 +25,7 @@ import { a as validateDecisionAnswers, o as validateDecisionRequest, t as decisi
|
|
|
25
25
|
import { n as createToolStateController } from "./tool-state-DSJnQbxP.js";
|
|
26
26
|
import { a as shell, d as middleTruncate, i as createShellTool, l as validateToolArgs, m as mediaPayloadBytes, n as waitTask, o as classifyShellCommand, p as mediaAgeoutMarker, r as shellKill, s as isReadOnlyShellCommand, u as headSlice } from "./wait-task-BZiNOAcc.js";
|
|
27
27
|
import { r as writeFileAtomicAsync } from "./atomic-write-Ijgf2Mhc.js";
|
|
28
|
+
import { a as createToolSearchTool, c as imageSizeFromBase64, i as applyToolSearchToUnlocked, n as createSkillsRunScriptTool, o as selectToolSearchMatches, r as createSkillsReadTool, s as shrinkImageBase64, t as createSkillsUseTool } from "./skills-use-CssTEaIj.js";
|
|
28
29
|
import { n as looksBinary } from "./binary-detect-Dtj5NGns.js";
|
|
29
30
|
import { n as findProjectRoot } from "./project-root-BOgUA6n5.js";
|
|
30
31
|
import { t as createNestedCallRecorder } from "./nested-call-record-DlzPeTB7.js";
|
|
@@ -32,7 +33,6 @@ import { n as createCallToolTool, r as unwrapCallTool, t as CALL_TOOL_NAME } fro
|
|
|
32
33
|
import { n as isToolFailure, r as toolErrorText } from "./failure-_rDKdaLk.js";
|
|
33
34
|
import { t as effectiveInputFromTurn } from "./stats-Bmj46D4h.js";
|
|
34
35
|
import { n as buildContextBreakdown, t as buildContextSegments } from "./context-segments-Bsjoazfi.js";
|
|
35
|
-
import { a as createToolSearchTool, i as applyToolSearchToUnlocked, n as createSkillsRunScriptTool, o as selectToolSearchMatches, r as createSkillsReadTool, t as createSkillsUseTool } from "./skills-use-D68a1gyZ.js";
|
|
36
36
|
import { c as renderToolSignature, h as toCodemodeIdentifier, m as parseCodemodeSource, o as renderToolOutputType, p as CodemodeSourceError, s as renderToolSample, t as CodemodeValue } from "./value-D6VNgBMH.js";
|
|
37
37
|
import { f as formatTaskSummary } from "./format-YgaIcuQ5.js";
|
|
38
38
|
import { Buffer } from "node:buffer";
|
|
@@ -41,7 +41,6 @@ import { dirname, isAbsolute, join, posix, relative, resolve } from "node:path";
|
|
|
41
41
|
import { copyFile, mkdir, readdir, rm, stat, unlink } from "node:fs/promises";
|
|
42
42
|
import { randomUUID } from "node:crypto";
|
|
43
43
|
import { createHooks } from "hookable";
|
|
44
|
-
import { deflateSync, inflateSync } from "node:zlib";
|
|
45
44
|
//#region src/agent-behavior.ts
|
|
46
45
|
/** Default watchdog, in ms, for the whole MCP connect step (custom `mcpConnector` and built-in connect). See `AgentBehavior.mcpConnectTimeoutMs`. */
|
|
47
46
|
const DEFAULT_CUSTOM_MCP_CONNECT_TIMEOUT_MS = 12e4;
|
|
@@ -4423,74 +4422,6 @@ function textForPersistence(output) {
|
|
|
4423
4422
|
return parts.join("\n");
|
|
4424
4423
|
}
|
|
4425
4424
|
//#endregion
|
|
4426
|
-
//#region src/media/image-size.ts
|
|
4427
|
-
/**
|
|
4428
|
-
* Pixel dimensions from an image's header bytes: PNG, JPEG, GIF, WebP.
|
|
4429
|
-
*
|
|
4430
|
-
* Header-only — nothing is decoded, so the cost is constant for PNG / GIF /
|
|
4431
|
-
* WebP and a marker walk for JPEG. Used to enforce provider dimension rules
|
|
4432
|
-
* (Anthropic's 2000 px per-image cap once a request carries more than 20
|
|
4433
|
-
* images) on media the harness cannot re-encode itself.
|
|
4434
|
-
*/
|
|
4435
|
-
/** Dimensions of a PNG / JPEG / GIF / WebP payload, or `undefined` when unknown. */
|
|
4436
|
-
function imageSize(bytes) {
|
|
4437
|
-
if (bytes.length < 10) return void 0;
|
|
4438
|
-
if (bytes[0] === 137 && bytes[1] === 80 && bytes[2] === 78 && bytes[3] === 71) {
|
|
4439
|
-
if (bytes.length < 24) return void 0;
|
|
4440
|
-
return positive(readU32BE(bytes, 16), readU32BE(bytes, 20));
|
|
4441
|
-
}
|
|
4442
|
-
if (bytes[0] === 71 && bytes[1] === 73 && bytes[2] === 70) return positive(bytes[6] | bytes[7] << 8, bytes[8] | bytes[9] << 8);
|
|
4443
|
-
if (bytes.length >= 30 && bytes[0] === 82 && bytes[1] === 73 && bytes[8] === 87 && bytes[9] === 69) return webpSize(bytes);
|
|
4444
|
-
if (bytes[0] === 255 && bytes[1] === 216) return jpegSize(bytes);
|
|
4445
|
-
}
|
|
4446
|
-
/**
|
|
4447
|
-
* {@link imageSize} over a base64 payload. Decodes a bounded prefix first and
|
|
4448
|
-
* falls back to the whole payload only for JPEGs whose frame header sits
|
|
4449
|
-
* past it (large EXIF / ICC segments).
|
|
4450
|
-
*/
|
|
4451
|
-
function imageSizeFromBase64(b64) {
|
|
4452
|
-
const small = imageSize(Buffer.from(b64.slice(0, 44), "base64"));
|
|
4453
|
-
if (small) return small;
|
|
4454
|
-
const head = Buffer.from(b64.slice(0, 87384), "base64");
|
|
4455
|
-
const size = imageSize(head);
|
|
4456
|
-
if (size || head.length < 65536 || head[0] !== 255) return size;
|
|
4457
|
-
return imageSize(Buffer.from(b64, "base64"));
|
|
4458
|
-
}
|
|
4459
|
-
function webpSize(b) {
|
|
4460
|
-
const chunk = String.fromCharCode(b[12], b[13], b[14], b[15]);
|
|
4461
|
-
if (chunk === "VP8X") return positive(1 + (b[24] | b[25] << 8 | b[26] << 16), 1 + (b[27] | b[28] << 8 | b[29] << 16));
|
|
4462
|
-
if (chunk === "VP8L") {
|
|
4463
|
-
const bits = b[21] | b[22] << 8 | b[23] << 16 | b[24] << 24;
|
|
4464
|
-
return positive((bits & 16383) + 1, (bits >>> 14 & 16383) + 1);
|
|
4465
|
-
}
|
|
4466
|
-
if (chunk === "VP8 ") return positive((b[26] | b[27] << 8) & 16383, (b[28] | b[29] << 8) & 16383);
|
|
4467
|
-
}
|
|
4468
|
-
function jpegSize(b) {
|
|
4469
|
-
let i = 2;
|
|
4470
|
-
while (i + 9 < b.length) {
|
|
4471
|
-
if (b[i] !== 255) {
|
|
4472
|
-
i++;
|
|
4473
|
-
continue;
|
|
4474
|
-
}
|
|
4475
|
-
const marker = b[i + 1];
|
|
4476
|
-
if (marker === 255 || marker === 1 || marker >= 208 && marker <= 217) {
|
|
4477
|
-
i++;
|
|
4478
|
-
continue;
|
|
4479
|
-
}
|
|
4480
|
-
if (marker >= 192 && marker <= 207 && marker !== 196 && marker !== 200 && marker !== 204) return positive(b[i + 7] << 8 | b[i + 8], b[i + 5] << 8 | b[i + 6]);
|
|
4481
|
-
i += 2 + (b[i + 2] << 8 | b[i + 3]);
|
|
4482
|
-
}
|
|
4483
|
-
}
|
|
4484
|
-
function readU32BE(b, o) {
|
|
4485
|
-
return (b[o] << 24 >>> 0) + (b[o + 1] << 16) + (b[o + 2] << 8) + b[o + 3];
|
|
4486
|
-
}
|
|
4487
|
-
function positive(width, height) {
|
|
4488
|
-
return width > 0 && height > 0 ? {
|
|
4489
|
-
width,
|
|
4490
|
-
height
|
|
4491
|
-
} : void 0;
|
|
4492
|
-
}
|
|
4493
|
-
//#endregion
|
|
4494
4425
|
//#region src/loop-compaction.ts
|
|
4495
4426
|
/**
|
|
4496
4427
|
* Recover the auto-compaction hysteresis baseline from a resumed session.
|
|
@@ -6414,309 +6345,6 @@ function sanitizeToolOutputForProvider(provider, output) {
|
|
|
6414
6345
|
return sanitized;
|
|
6415
6346
|
}
|
|
6416
6347
|
//#endregion
|
|
6417
|
-
//#region src/media/png-downscale.ts
|
|
6418
|
-
/**
|
|
6419
|
-
* Dependency-free PNG downscaling on `node:zlib`.
|
|
6420
|
-
*
|
|
6421
|
-
* Retina screenshots (2400×1600, 2960×1840) are the bulk of the oversize
|
|
6422
|
-
* images agents read. Past 2000 px they make a request carrying more than 20
|
|
6423
|
-
* images fail outright (Anthropic's many-image rule), and they cost upload
|
|
6424
|
-
* bytes and first-token latency for detail the model mostly can't use
|
|
6425
|
-
* (2576 px max on Claude 4.7+, 1568 px before). Shrinking once,
|
|
6426
|
-
* when the image enters the session, keeps the persisted bytes (and therefore
|
|
6427
|
-
* the prompt-cache prefix) identical on every later request.
|
|
6428
|
-
*
|
|
6429
|
-
* Scope is deliberately narrow: non-interlaced 8-bit PNGs (gray, RGB,
|
|
6430
|
-
* palette, gray+alpha, RGBA). Anything else returns `undefined` and the
|
|
6431
|
-
* caller keeps the original — this module never loses an image.
|
|
6432
|
-
*/
|
|
6433
|
-
/** Refuse to decode beyond this many pixels (~400 MB of RGBA float scratch). */
|
|
6434
|
-
const MAX_SOURCE_PIXELS = 25e6;
|
|
6435
|
-
const SIGNATURE = Buffer.from([
|
|
6436
|
-
137,
|
|
6437
|
-
80,
|
|
6438
|
-
78,
|
|
6439
|
-
71,
|
|
6440
|
-
13,
|
|
6441
|
-
10,
|
|
6442
|
-
26,
|
|
6443
|
-
10
|
|
6444
|
-
]);
|
|
6445
|
-
/**
|
|
6446
|
-
* Shrink a base64 image so its longest edge is at most `maxEdge`. Returns the
|
|
6447
|
-
* replacement payload, or `undefined` when the image already fits, is not a
|
|
6448
|
-
* PNG this module can decode, or anything goes wrong.
|
|
6449
|
-
*/
|
|
6450
|
-
function shrinkImageBase64(data, mediaType, maxEdge) {
|
|
6451
|
-
if (!(maxEdge > 0) || mediaType !== "image/png") return void 0;
|
|
6452
|
-
const size = imageSizeFromBase64(data);
|
|
6453
|
-
if (!size || Math.max(size.width, size.height) <= maxEdge) return void 0;
|
|
6454
|
-
const out = downscalePng(Buffer.from(data, "base64"), maxEdge);
|
|
6455
|
-
return out ? {
|
|
6456
|
-
data: out.toString("base64"),
|
|
6457
|
-
mediaType: "image/png"
|
|
6458
|
-
} : void 0;
|
|
6459
|
-
}
|
|
6460
|
-
/** Downscale PNG bytes to fit `maxEdge`; `undefined` when unsupported or already small enough. */
|
|
6461
|
-
function downscalePng(bytes, maxEdge) {
|
|
6462
|
-
try {
|
|
6463
|
-
const src = decodePng(bytes);
|
|
6464
|
-
if (!src) return void 0;
|
|
6465
|
-
const scale = maxEdge / Math.max(src.width, src.height);
|
|
6466
|
-
if (scale >= 1) return void 0;
|
|
6467
|
-
const width = Math.max(1, Math.round(src.width * scale));
|
|
6468
|
-
const height = Math.max(1, Math.round(src.height * scale));
|
|
6469
|
-
return encodePng({
|
|
6470
|
-
width,
|
|
6471
|
-
height,
|
|
6472
|
-
channels: src.channels,
|
|
6473
|
-
pixels: resizeArea(src, width, height)
|
|
6474
|
-
});
|
|
6475
|
-
} catch {
|
|
6476
|
-
return;
|
|
6477
|
-
}
|
|
6478
|
-
}
|
|
6479
|
-
function decodePng(bytes) {
|
|
6480
|
-
const buf = Buffer.from(bytes.buffer, bytes.byteOffset, bytes.byteLength);
|
|
6481
|
-
if (buf.length < 33 || !buf.subarray(0, 8).equals(SIGNATURE)) return void 0;
|
|
6482
|
-
let width = 0;
|
|
6483
|
-
let height = 0;
|
|
6484
|
-
let colorType = -1;
|
|
6485
|
-
let palette;
|
|
6486
|
-
let trns;
|
|
6487
|
-
const idat = [];
|
|
6488
|
-
for (let o = 8; o + 8 <= buf.length;) {
|
|
6489
|
-
const len = buf.readUInt32BE(o);
|
|
6490
|
-
const type = buf.toString("latin1", o + 4, o + 8);
|
|
6491
|
-
const body = buf.subarray(o + 8, o + 8 + len);
|
|
6492
|
-
if (body.length !== len) return void 0;
|
|
6493
|
-
if (type === "IHDR") {
|
|
6494
|
-
width = body.readUInt32BE(0);
|
|
6495
|
-
height = body.readUInt32BE(4);
|
|
6496
|
-
colorType = body[9];
|
|
6497
|
-
if (body[8] !== 8 || body[10] !== 0 || body[11] !== 0 || body[12] !== 0) return void 0;
|
|
6498
|
-
} else if (type === "PLTE") palette = body;
|
|
6499
|
-
else if (type === "tRNS") trns = body;
|
|
6500
|
-
else if (type === "IDAT") idat.push(body);
|
|
6501
|
-
else if (type === "IEND") break;
|
|
6502
|
-
o += 12 + len;
|
|
6503
|
-
}
|
|
6504
|
-
const srcChannels = {
|
|
6505
|
-
0: 1,
|
|
6506
|
-
2: 3,
|
|
6507
|
-
3: 1,
|
|
6508
|
-
4: 2,
|
|
6509
|
-
6: 4
|
|
6510
|
-
}[colorType];
|
|
6511
|
-
if (!srcChannels || width === 0 || height === 0 || width * height > MAX_SOURCE_PIXELS || idat.length === 0) return void 0;
|
|
6512
|
-
if (trns && colorType !== 3) return void 0;
|
|
6513
|
-
if (colorType === 3 && !palette) return void 0;
|
|
6514
|
-
const stride = width * srcChannels;
|
|
6515
|
-
const raw = inflateSync(Buffer.concat(idat), { maxOutputLength: (stride + 1) * height });
|
|
6516
|
-
if (raw.length < (stride + 1) * height) return void 0;
|
|
6517
|
-
const rows = unfilter(raw, width, height, srcChannels);
|
|
6518
|
-
if (colorType !== 3) return {
|
|
6519
|
-
width,
|
|
6520
|
-
height,
|
|
6521
|
-
channels: srcChannels,
|
|
6522
|
-
pixels: rows
|
|
6523
|
-
};
|
|
6524
|
-
const channels = trns ? 4 : 3;
|
|
6525
|
-
const pixels = new Uint8Array(width * height * channels);
|
|
6526
|
-
for (let i = 0, p = 0; i < rows.length; i++, p += channels) {
|
|
6527
|
-
const idx = rows[i];
|
|
6528
|
-
pixels[p] = palette[idx * 3] ?? 0;
|
|
6529
|
-
pixels[p + 1] = palette[idx * 3 + 1] ?? 0;
|
|
6530
|
-
pixels[p + 2] = palette[idx * 3 + 2] ?? 0;
|
|
6531
|
-
if (channels === 4) pixels[p + 3] = idx < trns.length ? trns[idx] : 255;
|
|
6532
|
-
}
|
|
6533
|
-
return {
|
|
6534
|
-
width,
|
|
6535
|
-
height,
|
|
6536
|
-
channels,
|
|
6537
|
-
pixels
|
|
6538
|
-
};
|
|
6539
|
-
}
|
|
6540
|
-
function unfilter(raw, width, height, bpp) {
|
|
6541
|
-
const stride = width * bpp;
|
|
6542
|
-
const out = new Uint8Array(stride * height);
|
|
6543
|
-
for (let y = 0; y < height; y++) {
|
|
6544
|
-
const filter = raw[y * (stride + 1)];
|
|
6545
|
-
const src = y * (stride + 1) + 1;
|
|
6546
|
-
const row = y * stride;
|
|
6547
|
-
const prev = row - stride;
|
|
6548
|
-
for (let x = 0; x < stride; x++) {
|
|
6549
|
-
const a = x >= bpp ? out[row + x - bpp] : 0;
|
|
6550
|
-
const b = y > 0 ? out[prev + x] : 0;
|
|
6551
|
-
const c = x >= bpp && y > 0 ? out[prev + x - bpp] : 0;
|
|
6552
|
-
const v = raw[src + x];
|
|
6553
|
-
switch (filter) {
|
|
6554
|
-
case 0:
|
|
6555
|
-
out[row + x] = v;
|
|
6556
|
-
break;
|
|
6557
|
-
case 1:
|
|
6558
|
-
out[row + x] = v + a;
|
|
6559
|
-
break;
|
|
6560
|
-
case 2:
|
|
6561
|
-
out[row + x] = v + b;
|
|
6562
|
-
break;
|
|
6563
|
-
case 3:
|
|
6564
|
-
out[row + x] = v + (a + b >> 1);
|
|
6565
|
-
break;
|
|
6566
|
-
case 4:
|
|
6567
|
-
out[row + x] = v + paeth(a, b, c);
|
|
6568
|
-
break;
|
|
6569
|
-
default: throw new Error(`bad PNG filter ${filter}`);
|
|
6570
|
-
}
|
|
6571
|
-
}
|
|
6572
|
-
}
|
|
6573
|
-
return out;
|
|
6574
|
-
}
|
|
6575
|
-
function paeth(a, b, c) {
|
|
6576
|
-
const p = a + b - c;
|
|
6577
|
-
const pa = Math.abs(p - a);
|
|
6578
|
-
const pb = Math.abs(p - b);
|
|
6579
|
-
const pc = Math.abs(p - c);
|
|
6580
|
-
return pa <= pb && pa <= pc ? a : pb <= pc ? b : c;
|
|
6581
|
-
}
|
|
6582
|
-
/**
|
|
6583
|
-
* Area-average (box) resample: every output pixel is the coverage-weighted
|
|
6584
|
-
* mean of the source pixels under it — the standard high-quality downscale.
|
|
6585
|
-
* Separable (horizontal then vertical). Color is alpha-weighted so
|
|
6586
|
-
* transparent pixels don't bleed their (meaningless) color into edges.
|
|
6587
|
-
*/
|
|
6588
|
-
function resizeArea(src, width, height) {
|
|
6589
|
-
const { channels: ch } = src;
|
|
6590
|
-
const alpha = ch === 2 || ch === 4 ? ch - 1 : -1;
|
|
6591
|
-
const xs = coverage(src.width, width);
|
|
6592
|
-
const ys = coverage(src.height, height);
|
|
6593
|
-
const mid = new Float32Array(src.height * width * ch);
|
|
6594
|
-
for (let y = 0; y < src.height; y++) {
|
|
6595
|
-
const srow = y * src.width * ch;
|
|
6596
|
-
const mrow = y * width * ch;
|
|
6597
|
-
for (let x = 0; x < width; x++) {
|
|
6598
|
-
const { start, weights } = xs[x];
|
|
6599
|
-
for (let k = 0; k < weights.length; k++) {
|
|
6600
|
-
const s = srow + (start + k) * ch;
|
|
6601
|
-
const w = weights[k];
|
|
6602
|
-
const aw = alpha >= 0 ? w * src.pixels[s + alpha] / 255 : w;
|
|
6603
|
-
for (let c = 0; c < ch; c++) mid[mrow + x * ch + c] += (c === alpha ? w : aw) * src.pixels[s + c];
|
|
6604
|
-
}
|
|
6605
|
-
}
|
|
6606
|
-
}
|
|
6607
|
-
const out = new Uint8Array(width * height * ch);
|
|
6608
|
-
const acc = new Float64Array(ch);
|
|
6609
|
-
for (let y = 0; y < height; y++) {
|
|
6610
|
-
const { start, weights } = ys[y];
|
|
6611
|
-
for (let x = 0; x < width; x++) {
|
|
6612
|
-
acc.fill(0);
|
|
6613
|
-
for (let k = 0; k < weights.length; k++) {
|
|
6614
|
-
const m = ((start + k) * width + x) * ch;
|
|
6615
|
-
for (let c = 0; c < ch; c++) acc[c] += weights[k] * mid[m + c];
|
|
6616
|
-
}
|
|
6617
|
-
const o = (y * width + x) * ch;
|
|
6618
|
-
const a = alpha >= 0 ? acc[alpha] : 255;
|
|
6619
|
-
for (let c = 0; c < ch; c++) {
|
|
6620
|
-
const v = c === alpha ? acc[c] : alpha >= 0 ? a > 0 ? acc[c] * 255 / a : 0 : acc[c];
|
|
6621
|
-
out[o + c] = Math.min(255, Math.max(0, Math.round(v)));
|
|
6622
|
-
}
|
|
6623
|
-
}
|
|
6624
|
-
}
|
|
6625
|
-
return out;
|
|
6626
|
-
}
|
|
6627
|
-
/** Per output index: the first source index it covers and normalized weights. */
|
|
6628
|
-
function coverage(srcLen, dstLen) {
|
|
6629
|
-
const ratio = srcLen / dstLen;
|
|
6630
|
-
const result = [];
|
|
6631
|
-
for (let i = 0; i < dstLen; i++) {
|
|
6632
|
-
const lo = i * ratio;
|
|
6633
|
-
const hi = Math.min(srcLen, (i + 1) * ratio);
|
|
6634
|
-
const start = Math.floor(lo);
|
|
6635
|
-
const end = Math.ceil(hi);
|
|
6636
|
-
const weights = new Float32Array(end - start);
|
|
6637
|
-
for (let s = start; s < end; s++) weights[s - start] = (Math.min(hi, s + 1) - Math.max(lo, s)) / ratio;
|
|
6638
|
-
result.push({
|
|
6639
|
-
start,
|
|
6640
|
-
weights
|
|
6641
|
-
});
|
|
6642
|
-
}
|
|
6643
|
-
return result;
|
|
6644
|
-
}
|
|
6645
|
-
function encodePng(img) {
|
|
6646
|
-
const { width, height, channels: ch, pixels } = img;
|
|
6647
|
-
const colorType = {
|
|
6648
|
-
1: 0,
|
|
6649
|
-
2: 4,
|
|
6650
|
-
3: 2,
|
|
6651
|
-
4: 6
|
|
6652
|
-
}[ch];
|
|
6653
|
-
const stride = width * ch;
|
|
6654
|
-
const filtered = Buffer.alloc((stride + 1) * height);
|
|
6655
|
-
const candidate = Buffer.alloc(stride);
|
|
6656
|
-
for (let y = 0; y < height; y++) {
|
|
6657
|
-
const row = y * stride;
|
|
6658
|
-
let best = Number.POSITIVE_INFINITY;
|
|
6659
|
-
let bestFilter = 0;
|
|
6660
|
-
let bestBytes = Buffer.alloc(0);
|
|
6661
|
-
for (let f = 0; f < 5; f++) {
|
|
6662
|
-
let score = 0;
|
|
6663
|
-
for (let x = 0; x < stride; x++) {
|
|
6664
|
-
const a = x >= ch ? pixels[row + x - ch] : 0;
|
|
6665
|
-
const b = y > 0 ? pixels[row - stride + x] : 0;
|
|
6666
|
-
const c = x >= ch && y > 0 ? pixels[row - stride + x - ch] : 0;
|
|
6667
|
-
const v = pixels[row + x];
|
|
6668
|
-
const r = (f === 0 ? v : f === 1 ? v - a : f === 2 ? v - b : f === 3 ? v - (a + b >> 1) : v - paeth(a, b, c)) & 255;
|
|
6669
|
-
candidate[x] = r;
|
|
6670
|
-
score += r < 128 ? r : 256 - r;
|
|
6671
|
-
}
|
|
6672
|
-
if (score < best) {
|
|
6673
|
-
best = score;
|
|
6674
|
-
bestFilter = f;
|
|
6675
|
-
bestBytes = Buffer.from(candidate);
|
|
6676
|
-
}
|
|
6677
|
-
}
|
|
6678
|
-
filtered[y * (stride + 1)] = bestFilter;
|
|
6679
|
-
bestBytes.copy(filtered, y * (stride + 1) + 1);
|
|
6680
|
-
}
|
|
6681
|
-
const ihdr = Buffer.alloc(13);
|
|
6682
|
-
ihdr.writeUInt32BE(width, 0);
|
|
6683
|
-
ihdr.writeUInt32BE(height, 4);
|
|
6684
|
-
ihdr[8] = 8;
|
|
6685
|
-
ihdr[9] = colorType;
|
|
6686
|
-
return Buffer.concat([
|
|
6687
|
-
SIGNATURE,
|
|
6688
|
-
chunk("IHDR", ihdr),
|
|
6689
|
-
chunk("IDAT", deflateSync(filtered)),
|
|
6690
|
-
chunk("IEND", Buffer.alloc(0))
|
|
6691
|
-
]);
|
|
6692
|
-
}
|
|
6693
|
-
function chunk(type, body) {
|
|
6694
|
-
const head = Buffer.alloc(8);
|
|
6695
|
-
head.writeUInt32BE(body.length, 0);
|
|
6696
|
-
head.write(type, 4, "latin1");
|
|
6697
|
-
const crc = Buffer.alloc(4);
|
|
6698
|
-
crc.writeUInt32BE(crc32(Buffer.concat([head.subarray(4), body])), 0);
|
|
6699
|
-
return Buffer.concat([
|
|
6700
|
-
head,
|
|
6701
|
-
body,
|
|
6702
|
-
crc
|
|
6703
|
-
]);
|
|
6704
|
-
}
|
|
6705
|
-
let crcTable;
|
|
6706
|
-
function crc32(bytes) {
|
|
6707
|
-
if (!crcTable) {
|
|
6708
|
-
crcTable = /* @__PURE__ */ new Uint32Array(256);
|
|
6709
|
-
for (let n = 0; n < 256; n++) {
|
|
6710
|
-
let c = n;
|
|
6711
|
-
for (let k = 0; k < 8; k++) c = c & 1 ? 3988292384 ^ c >>> 1 : c >>> 1;
|
|
6712
|
-
crcTable[n] = c >>> 0;
|
|
6713
|
-
}
|
|
6714
|
-
}
|
|
6715
|
-
let c = 4294967295;
|
|
6716
|
-
for (let i = 0; i < bytes.length; i++) c = crcTable[(c ^ bytes[i]) & 255] ^ c >>> 8;
|
|
6717
|
-
return (c ^ 4294967295) >>> 0;
|
|
6718
|
-
}
|
|
6719
|
-
//#endregion
|
|
6720
6348
|
//#region src/media/shrink.ts
|
|
6721
6349
|
/** `output` with oversize inline images shrunk; the same reference when nothing changed. */
|
|
6722
6350
|
function shrinkToolOutputImages(output, maxEdge) {
|
|
@@ -8445,6 +8073,11 @@ async function streamTurnWithRecovery(ctx, streamOptions, scope) {
|
|
|
8445
8073
|
let overflowRecoveries = 0;
|
|
8446
8074
|
while (true) {
|
|
8447
8075
|
attempt += 1;
|
|
8076
|
+
ctx.lastRequest = {
|
|
8077
|
+
options: { ...streamOptions },
|
|
8078
|
+
turnCount: ctx.turns.length,
|
|
8079
|
+
sentAt: Date.now()
|
|
8080
|
+
};
|
|
8448
8081
|
try {
|
|
8449
8082
|
result = await streamWithWatchdogs(ctx, streamOptions, obs.callbacks(), turnId, {
|
|
8450
8083
|
...attempt > 1 ? { startTimeoutCapMs: RETRY_STREAM_START_TIMEOUT_CAP_MS } : {},
|
|
@@ -8961,11 +8594,6 @@ async function executeTurn(ctx, turn, priorUsage) {
|
|
|
8961
8594
|
streamOptions.messages = await resolveContentRefsForWire(ctx, streamOptions.messages);
|
|
8962
8595
|
streamOptions.messages = applyPairingRepair(ctx, streamOptions.messages, turnId);
|
|
8963
8596
|
streamOptions.messages = ensureEndsWithUserMessage(streamOptions.messages, ctx.provider);
|
|
8964
|
-
ctx.lastRequest = {
|
|
8965
|
-
options: { ...streamOptions },
|
|
8966
|
-
turnCount: ctx.turns.length,
|
|
8967
|
-
sentAt: Date.now()
|
|
8968
|
-
};
|
|
8969
8597
|
const { result, obs } = await streamTurnWithRecovery(ctx, streamOptions, {
|
|
8970
8598
|
turn,
|
|
8971
8599
|
turnId,
|
|
@@ -9837,6 +9465,8 @@ async function reset(rt) {
|
|
|
9837
9465
|
nonInterruptingNudgeQueue.length = 0;
|
|
9838
9466
|
followUpQueue.length = 0;
|
|
9839
9467
|
rt.lastContextAssembly = null;
|
|
9468
|
+
rt.lastRunContext = null;
|
|
9469
|
+
rt.overflowRescue.cutoff = void 0;
|
|
9840
9470
|
pendingTaskNotifications.clear();
|
|
9841
9471
|
pendingStallNotifications.clear();
|
|
9842
9472
|
const cleared = skillActivationState.clear();
|
|
@@ -13693,4 +13323,4 @@ function cacheImpact(rt, change) {
|
|
|
13693
13323
|
//#endregion
|
|
13694
13324
|
export { summaryToTurn as $, installCacheBreakLogger as A, compactConversation as B, resolveMcpWarningsDir as C, diffCacheDimensions as D, resolveTasksDir as E, selectRecentFiles as F, buildFromCompactPrompt as G, NO_TOOLS_PREAMBLE as H, AUTO_COMPACT_MIN_GROWTH_FRACTION as I, buildUpToCompactPrompt as J, buildFullCompactPrompt as K, OUTPUT_RESERVE_TOKENS as L, buildPostCompactAttachments as M, selectFilesFromReadState as N, fnv1a32 as O, selectFilesFromSession as P, stripImagesFromTurns as Q, effectiveContextWindow as R, resolveLegacySessionDir as S, resolveSessionDir as T, TRAILER as U, BASE_INSTRUCTIONS as V, buildCompactPrompt as W, anchorPreviewFor as X, ANCHOR_PREVIEW_MAX_CHARS as Y, sliceForCompaction as Z, cleanupPersistedSession as _, normalizeShellCommand as a, DEFAULT_DECISION_TIMEOUT_MS as at, rehomePersistedStubs as b, SHELL_CASCADE_CANCEL_MESSAGE as c, collectNewlyStaleReadPaths as d, truncateHeadForPtlRetry as et, renderStaleReadNotice as f, buildPersistedStub as g, PERSISTENCE_PREVIEW_BYTES as h, defaultRepeatGuardTracked as i, resolveModelTargets as it, snapshotCacheDimensions as j, hashMessages as k, TOOL_USE_CANCELLED_MESSAGE as l, PERSISTED_STUB_PREFIX as m, createAgent as n, CompactPromptTooLongError as nt, stableStringify as o, createDecider as ot, applyCompactSummaryCutoff as p, buildTailCompactPrompt as q, defaultRepeatGuardNormalize as r, normalizeProviders as rt, INTERRUPT_MESSAGE_FOR_TOOL_USE as s, agent_exports as t, CompactInvalidInputError as tt, TOOL_USE_SKIPPED_MESSAGE as u, maybePersistToolResult as v, resolvePersistDir as w, resolveLegacyPersistDir as x, migrateSessionArtifactDirs as y, shouldAutoCompact as z };
|
|
13695
13325
|
|
|
13696
|
-
//# sourceMappingURL=agent-
|
|
13326
|
+
//# sourceMappingURL=agent-CBQglXtH.js.map
|