@cline/core 0.0.95 → 0.2.0-nightly.1793312794
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/ClineCore.d.ts +6 -1
- package/dist/account/rpc.d.ts +3 -1
- package/dist/account/types.d.ts +2 -0
- package/dist/artifacts/cloud/fetch.d.ts +8 -0
- package/dist/artifacts/cloud/publish.d.ts +6 -0
- package/dist/artifacts/publish.d.ts +30 -0
- package/dist/cline-core/runtime-services.d.ts +4 -2
- package/dist/cloud/computer-use-prompt.d.ts +9 -0
- package/dist/cloud/controller.d.ts +26 -4
- package/dist/cloud/hub-client.d.ts +53 -0
- package/dist/cloud/hub-protocol.d.ts +32 -0
- package/dist/cloud/index.d.ts +5 -0
- package/dist/cloud/index.js +34 -17
- package/dist/cloud/types.d.ts +4 -1
- package/dist/extensions/context/compaction-shared.d.ts +1 -0
- package/dist/extensions/context/compaction.d.ts +7 -0
- package/dist/extensions/context/summarize-conversation.d.ts +7 -0
- package/dist/extensions/context/summary-generation.d.ts +14 -0
- package/dist/extensions/mcp/apps.d.ts +16 -0
- package/dist/extensions/mcp/client.d.ts +1 -0
- package/dist/extensions/mcp/index.d.ts +5 -1
- package/dist/extensions/mcp/manager.d.ts +2 -1
- package/dist/extensions/mcp/session-apps.d.ts +28 -0
- package/dist/extensions/mcp/types.d.ts +22 -0
- package/dist/extensions/plugin/plugin-command-origin.d.ts +8 -0
- package/dist/extensions/plugin/plugin-registry.d.ts +1 -0
- package/dist/extensions/plugin/plugin-runtime.d.ts +7 -0
- package/dist/hub/client/index.d.ts +6 -0
- package/dist/hub/client/managed-hub-build-watcher.d.ts +2 -0
- package/dist/hub/client/plugin-commands.d.ts +4 -0
- package/dist/hub/client/session-client.d.ts +2 -0
- package/dist/hub/daemon/entry.js +248 -229
- package/dist/hub/daemon/index.d.ts +2 -0
- package/dist/hub/index.d.ts +1 -0
- package/dist/hub/index.js +238 -219
- package/dist/hub/runtime-host/hub-runtime-host.d.ts +6 -0
- package/dist/hub/server/cloud-session-service.d.ts +52 -0
- package/dist/hub/server/handlers/capability-handlers.d.ts +18 -1
- package/dist/hub/server/handlers/context.d.ts +13 -2
- package/dist/hub/server/handlers/mcp-apps-handlers.d.ts +5 -0
- package/dist/hub/server/handlers/session-handlers.d.ts +4 -0
- package/dist/hub/server/hub-server-options.d.ts +3 -0
- package/dist/hub/server/hub-server-transport.d.ts +2 -0
- package/dist/index.d.ts +10 -5
- package/dist/index.js +284 -258
- package/dist/plugin-runtime/node_modules/@cline/agents/dist/index.js +76 -0
- package/dist/plugin-runtime/node_modules/@cline/agents/package.json +1 -0
- package/dist/plugin-runtime/node_modules/@cline/core/dist/ai-sdk-bdvd54cj.js +1 -0
- package/dist/plugin-runtime/node_modules/@cline/core/dist/anthropic-d88t4w67.js +1 -0
- package/dist/plugin-runtime/node_modules/@cline/core/dist/bedrock-4rh6dw0e.js +1 -0
- package/dist/plugin-runtime/node_modules/@cline/core/dist/cline-dex049wz.js +1 -0
- package/dist/plugin-runtime/node_modules/@cline/core/dist/cloud/index.js +38 -0
- package/dist/plugin-runtime/node_modules/@cline/core/dist/community-adrseffv.js +1 -0
- package/dist/plugin-runtime/node_modules/@cline/core/dist/foundation-models-embedding-model-strategy-SAVQFBF4-vf44v1q1.js +1 -0
- package/dist/plugin-runtime/node_modules/@cline/core/dist/foundation-models-language-model-strategy-BPQO66W7-np6pavev.js +1 -0
- package/dist/plugin-runtime/node_modules/@cline/core/dist/getMachineId-bsd-1xg0n8py.js +1 -0
- package/dist/plugin-runtime/node_modules/@cline/core/dist/getMachineId-bsd-2h2811k3.js +1 -0
- package/dist/plugin-runtime/node_modules/@cline/core/dist/getMachineId-darwin-918h9zb6.js +2 -0
- package/dist/plugin-runtime/node_modules/@cline/core/dist/getMachineId-darwin-9g9qz8kw.js +2 -0
- package/dist/plugin-runtime/node_modules/@cline/core/dist/getMachineId-linux-8p52y0t4.js +1 -0
- package/dist/plugin-runtime/node_modules/@cline/core/dist/getMachineId-linux-cr4wnstr.js +1 -0
- package/dist/plugin-runtime/node_modules/@cline/core/dist/getMachineId-unsupported-aa72jh2v.js +1 -0
- package/dist/plugin-runtime/node_modules/@cline/core/dist/getMachineId-unsupported-k2y10eep.js +1 -0
- package/dist/plugin-runtime/node_modules/@cline/core/dist/getMachineId-win-1hvm2h6v.js +1 -0
- package/dist/plugin-runtime/node_modules/@cline/core/dist/getMachineId-win-7nqbajdc.js +1 -0
- package/dist/plugin-runtime/node_modules/@cline/core/dist/google-nqn5r579.js +1 -0
- package/dist/plugin-runtime/node_modules/@cline/core/dist/hub/daemon/entry.js +1166 -0
- package/dist/plugin-runtime/node_modules/@cline/core/dist/hub/index.js +1153 -0
- package/dist/plugin-runtime/node_modules/@cline/core/dist/index-0ahmqye5.js +2 -0
- package/dist/plugin-runtime/node_modules/@cline/core/dist/index-1jwj53tz.js +2 -0
- package/dist/plugin-runtime/node_modules/@cline/core/dist/index-3qy7846d.js +14 -0
- package/dist/plugin-runtime/node_modules/@cline/core/dist/index-418gvd4a.js +2 -0
- package/dist/plugin-runtime/node_modules/@cline/core/dist/index-4etvmc8g.js +2 -0
- package/dist/plugin-runtime/node_modules/@cline/core/dist/index-4pm9q9we.js +1 -0
- package/dist/plugin-runtime/node_modules/@cline/core/dist/index-4tgv599k.js +2 -0
- package/dist/plugin-runtime/node_modules/@cline/core/dist/index-5hwscy9s.js +15 -0
- package/dist/plugin-runtime/node_modules/@cline/core/dist/index-6dpcn5cw.js +9 -0
- package/dist/plugin-runtime/node_modules/@cline/core/dist/index-7ycwqbm0.js +1 -0
- package/dist/plugin-runtime/node_modules/@cline/core/dist/index-8qjtgvqw.js +9 -0
- package/dist/plugin-runtime/node_modules/@cline/core/dist/index-8zb5grad.js +1210 -0
- package/dist/plugin-runtime/node_modules/@cline/core/dist/index-94jdgxt6.js +2 -0
- package/dist/plugin-runtime/node_modules/@cline/core/dist/index-9g67p34k.js +2 -0
- package/dist/plugin-runtime/node_modules/@cline/core/dist/index-a9d2sjh0.js +85 -0
- package/dist/plugin-runtime/node_modules/@cline/core/dist/index-agemt17a.js +3 -0
- package/dist/plugin-runtime/node_modules/@cline/core/dist/index-bhf7enwn.js +1 -0
- package/dist/plugin-runtime/node_modules/@cline/core/dist/index-bnwxdgvg.js +1 -0
- package/dist/plugin-runtime/node_modules/@cline/core/dist/index-brjxtvsh.js +4 -0
- package/dist/plugin-runtime/node_modules/@cline/core/dist/index-bvb7f701.js +1 -0
- package/dist/plugin-runtime/node_modules/@cline/core/dist/index-bwet95hr.js +2 -0
- package/dist/plugin-runtime/node_modules/@cline/core/dist/index-cadyf2yp.js +14 -0
- package/dist/plugin-runtime/node_modules/@cline/core/dist/index-cxfnnrmh.js +9 -0
- package/dist/plugin-runtime/node_modules/@cline/core/dist/index-cyyvppz9.js +6 -0
- package/dist/plugin-runtime/node_modules/@cline/core/dist/index-d4pbedxj.js +137 -0
- package/dist/plugin-runtime/node_modules/@cline/core/dist/index-ddwn220p.js +12 -0
- package/dist/plugin-runtime/node_modules/@cline/core/dist/index-edf1hmcw.js +62 -0
- package/dist/plugin-runtime/node_modules/@cline/core/dist/index-ejyd73x5.js +1 -0
- package/dist/plugin-runtime/node_modules/@cline/core/dist/index-f25bf131.js +4 -0
- package/dist/plugin-runtime/node_modules/@cline/core/dist/index-f4rfmj6q.js +3 -0
- package/dist/plugin-runtime/node_modules/@cline/core/dist/index-fet3kwk6.js +1 -0
- package/dist/plugin-runtime/node_modules/@cline/core/dist/index-ffna8yzn.js +121 -0
- package/dist/plugin-runtime/node_modules/@cline/core/dist/index-g2y6ptdc.js +213 -0
- package/dist/plugin-runtime/node_modules/@cline/core/dist/index-ge184xvn.js +6 -0
- package/dist/plugin-runtime/node_modules/@cline/core/dist/index-gevnedsc.js +13 -0
- package/dist/plugin-runtime/node_modules/@cline/core/dist/index-hkmarmve.js +190 -0
- package/dist/plugin-runtime/node_modules/@cline/core/dist/index-kqacxn3s.js +39 -0
- package/dist/plugin-runtime/node_modules/@cline/core/dist/index-m3gtj35r.js +14 -0
- package/dist/plugin-runtime/node_modules/@cline/core/dist/index-neczvge6.js +21 -0
- package/dist/plugin-runtime/node_modules/@cline/core/dist/index-p5k5hnam.js +75 -0
- package/dist/plugin-runtime/node_modules/@cline/core/dist/index-sdvqs19c.js +20 -0
- package/dist/plugin-runtime/node_modules/@cline/core/dist/index-t75m2pgm.js +146 -0
- package/dist/plugin-runtime/node_modules/@cline/core/dist/index-v4-qqb2kabr.js +1 -0
- package/dist/plugin-runtime/node_modules/@cline/core/dist/index-v6mehmme.js +12 -0
- package/dist/plugin-runtime/node_modules/@cline/core/dist/index-v80fh3x3.js +16 -0
- package/dist/plugin-runtime/node_modules/@cline/core/dist/index-vd605jwp.js +2 -0
- package/dist/plugin-runtime/node_modules/@cline/core/dist/index-vryppqt1.js +1 -0
- package/dist/plugin-runtime/node_modules/@cline/core/dist/index-w55v4n1n.js +2 -0
- package/dist/plugin-runtime/node_modules/@cline/core/dist/index-w9n2kgjk.js +140 -0
- package/dist/plugin-runtime/node_modules/@cline/core/dist/index-yjbp9r76.js +142 -0
- package/dist/plugin-runtime/node_modules/@cline/core/dist/index-ztb3cjfh.js +3 -0
- package/dist/plugin-runtime/node_modules/@cline/core/dist/index.js +1 -0
- package/dist/plugin-runtime/node_modules/@cline/core/dist/jiti-static-kj4rdeey.js +473 -0
- package/dist/plugin-runtime/node_modules/@cline/core/dist/jiti-y9tt7gmq.js +1 -0
- package/dist/plugin-runtime/node_modules/@cline/core/dist/langfuse-stream-telemetry-bg81k3qh.js +1 -0
- package/dist/plugin-runtime/node_modules/@cline/core/dist/langfuse-telemetry-tkbfbx5w.js +1 -0
- package/dist/plugin-runtime/node_modules/@cline/core/dist/mistral-mkw95amh.js +1 -0
- package/dist/plugin-runtime/node_modules/@cline/core/dist/multipart-parser-9z19cm6q.js +2 -0
- package/dist/plugin-runtime/node_modules/@cline/core/dist/ollama-sjp09b7p.js +1 -0
- package/dist/plugin-runtime/node_modules/@cline/core/dist/openai-1eyn4hw0.js +1 -0
- package/dist/plugin-runtime/node_modules/@cline/core/dist/openai-compatible-f99c7syq.js +1 -0
- package/dist/plugin-runtime/node_modules/@cline/core/dist/orchestration-embedding-model-strategy-GT27AFII-19936r1a.js +1 -0
- package/dist/plugin-runtime/node_modules/@cline/core/dist/orchestration-language-model-strategy-YEQPUCOT-eavx3zc3.js +1 -0
- package/dist/plugin-runtime/node_modules/@cline/core/dist/services/feature-flags/posthog.js +2 -0
- package/dist/plugin-runtime/node_modules/@cline/core/dist/services/telemetry/index.js +1 -0
- package/dist/plugin-runtime/node_modules/@cline/core/dist/token-04d0mwe8.js +1 -0
- package/dist/plugin-runtime/node_modules/@cline/core/dist/token-util-mt7pvm61.js +1 -0
- package/dist/plugin-runtime/node_modules/@cline/core/dist/vertex-6armtc3s.js +1 -0
- package/dist/plugin-runtime/node_modules/@cline/core/package.json +1 -0
- package/dist/plugin-runtime/node_modules/@cline/llms/dist/index.browser.js +16 -0
- package/dist/plugin-runtime/node_modules/@cline/llms/dist/index.js +1 -0
- package/dist/plugin-runtime/node_modules/@cline/llms/package.json +1 -0
- package/dist/plugin-runtime/node_modules/@cline/sdk/dist/index.js +1 -0
- package/dist/plugin-runtime/node_modules/@cline/sdk/package.json +1 -0
- package/dist/plugin-runtime/node_modules/@cline/shared/dist/automation/index.js +57 -0
- package/dist/plugin-runtime/node_modules/@cline/shared/dist/db/index.js +127 -0
- package/dist/plugin-runtime/node_modules/@cline/shared/dist/index.browser.js +110 -0
- package/dist/plugin-runtime/node_modules/@cline/shared/dist/index.js +1 -0
- package/dist/plugin-runtime/node_modules/@cline/shared/dist/node.js +1 -0
- package/dist/plugin-runtime/node_modules/@cline/shared/dist/remote-config/index.js +68 -0
- package/dist/plugin-runtime/node_modules/@cline/shared/dist/storage/index.js +1 -0
- package/dist/plugin-runtime/node_modules/@cline/shared/dist/types/index.js +1 -0
- package/dist/plugin-runtime/node_modules/@cline/shared/package.json +1 -0
- package/dist/plugin-runtime/package.json +1 -0
- package/dist/{extensions → plugin-runtime}/plugin-sandbox-bootstrap.js +129 -129
- package/dist/remote/remote-environments.d.ts +1 -0
- package/dist/runtime/config/agent-runtime-config-builder.d.ts +2 -0
- package/dist/runtime/host/local-runtime-host.d.ts +10 -0
- package/dist/runtime/host/runtime-host.d.ts +6 -0
- package/dist/runtime/orchestration/runtime-oauth-token-manager.d.ts +3 -0
- package/dist/runtime/orchestration/session-runtime-orchestrator.d.ts +10 -1
- package/dist/runtime/orchestration/session-runtime.d.ts +2 -0
- package/dist/runtime/tools/subprocess-sandbox.d.ts +22 -0
- package/dist/services/cloud-handoff/git-preparation.d.ts +22 -0
- package/dist/services/global-settings.d.ts +6 -0
- package/dist/services/llms/cline-recommended-models.d.ts +2 -0
- package/dist/services/local-runtime-bootstrap.d.ts +1 -0
- package/dist/services/plugin-command-api.d.ts +47 -0
- package/dist/services/plugin-commands.d.ts +25 -27
- package/dist/services/skills-cli.d.ts +2 -0
- package/dist/services/telemetry/core-events.d.ts +26 -0
- package/dist/services/telemetry/index.js +1 -1
- package/dist/services/telemetry/run-health.d.ts +40 -0
- package/dist/services/telemetry/stall-signals.d.ts +12 -0
- package/dist/types/config.d.ts +1 -0
- package/dist/types/session.d.ts +7 -0
- package/package.json +6 -5
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import{N,F,ve,b,H,Q,I,ke,j,Vt,Kt,bc,fe,C,Mo,Oe,Pe,ut,nn,Qe,u,l,z,De,T,O,Re,G,M,ee,qe,oe,ze,E,te,No}from"./index-w9n2kgjk.js";import{e,n,r,m,le,o,t,ae,p,w,W,d,sn,s,a,Fe}from"./index-edf1hmcw.js";var zt=u(()=>l(t({type:a("error"),error:t({type:e(),message:e()})}))),ct=oe({errorSchema:zt,errorToMessage:(i)=>i.error.message}),zn=u(()=>l(t({id:e(),type:a("file"),filename:e(),mime_type:e(),size_bytes:n(),created_at:e(),downloadable:r().nullish()})));function pt(i,_){if(i.type==="web_search_result_location"||i.type==="search_result_location"){let S=i.type==="web_search_result_location"?i.url:i.source;return{source:{type:"source",sourceType:"url",id:S,url:S,title:i.title??void 0,providerMetadata:{anthropic:{...i}}},citedText:i.cited_text}}let g=_[i.document_index];return{source:{type:"source",sourceType:"document",id:i.file_id??String(i.document_index),mediaType:g?.mediaType??"text/plain",title:i.document_title??g?.title??`Document ${i.document_index}`,filename:g?.filename,providerMetadata:{anthropic:{...i}}},citedText:i.cited_text}}var nt=()=>t({type:a("fallback"),from:t({model:e()}),to:t({model:e()})}),Wt=u(()=>l(nt())),Tt=()=>t({type:e(),category:e().nullish(),explanation:e().nullish(),recommended_model:e().nullish()}),Ct=()=>t({type:e(),status:t({type:e(),tool_uses:d(e(),t({type:e(),outcome:e().nullish(),explanation:e().nullish()})).nullish()})}),Me=()=>p([t({type:a("code_execution_20250825"),tool_id:e()}),t({type:a("code_execution_20260120"),tool_id:e()}),t({type:a("direct")})]),St=()=>w("type",[t({type:a("web_search_result_location"),cited_text:e(),url:e(),title:e().nullable(),encrypted_index:e()}),t({type:a("page_location"),cited_text:e(),document_index:n(),document_title:e().nullable(),start_page_number:n(),end_page_number:n(),file_id:e().nullish()}),t({type:a("char_location"),cited_text:e(),document_index:n(),document_title:e().nullable(),start_char_index:n(),end_char_index:n(),file_id:e().nullish()}),t({type:a("content_block_location"),cited_text:e(),document_index:n(),document_title:e().nullable(),start_block_index:n(),end_block_index:n(),file_id:e().nullable()}),t({type:a("search_result_location"),cited_text:e(),search_result_index:n(),source:e(),title:e().nullable(),start_block_index:n(),end_block_index:n()})]),Nt=()=>p([e(),o(p([e(),t({type:a("text"),text:e(),citations:o(Fe()).nullable().optional()})]))]),ot=()=>t({type:e(),path:e(),reason:e()}),Xt=u(()=>l(t({type:a("message"),id:e().nullish(),model:e().nullish(),content:o(w("type",[t({type:a("text"),text:e(),citations:o(St()).nullable().optional()}),t({type:a("thinking"),thinking:e(),signature:e()}),t({type:a("redacted_thinking"),data:e()}),t({type:a("compaction"),content:e().nullish(),signature:e().nullish()}),t({type:a("tool_use"),id:e(),name:e(),input:m(),caller:Me().optional(),toolset_name:e().nullish()}),t({type:a("server_tool_use"),id:e(),name:e(),input:d(e(),m()).nullish(),caller:Me().optional()}),t({type:a("mcp_tool_use"),id:e(),name:e(),input:m(),server_name:e()}),t({type:a("mcp_tool_result"),tool_use_id:e(),is_error:r(),content:Nt()}),t({type:a("web_fetch_tool_result"),tool_use_id:e(),caller:Me().optional(),content:p([t({type:a("web_fetch_result"),url:e(),retrieved_at:e().nullable(),content:t({type:a("document"),title:e().nullable(),citations:t({enabled:r()}).optional(),source:p([t({type:a("base64"),media_type:a("application/pdf"),data:e()}),t({type:a("text"),media_type:a("text/plain"),data:e()})])})}),t({type:a("web_fetch_tool_result_error"),error_code:e()})])}),t({type:a("web_search_tool_result"),tool_use_id:e(),caller:Me().optional(),content:p([o(t({type:a("web_search_result"),url:e(),title:e().nullable(),encrypted_content:e(),page_age:e().nullish()})),t({type:a("web_search_tool_result_error"),error_code:e()})])}),t({type:a("code_execution_tool_result"),tool_use_id:e(),content:p([t({type:a("code_execution_result"),stdout:e(),stderr:e(),return_code:n(),content:o(t({type:a("code_execution_output"),file_id:e()})).optional().default([])}),t({type:a("encrypted_code_execution_result"),encrypted_stdout:e(),stderr:e(),return_code:n(),content:o(t({type:a("code_execution_output"),file_id:e()})).optional().default([])}),t({type:a("code_execution_tool_result_error"),error_code:e()})])}),t({type:a("bash_code_execution_tool_result"),tool_use_id:e(),content:w("type",[t({type:a("bash_code_execution_result"),content:o(t({type:a("bash_code_execution_output"),file_id:e()})),stdout:e(),stderr:e(),return_code:n()}),t({type:a("bash_code_execution_tool_result_error"),error_code:e()})])}),t({type:a("text_editor_code_execution_tool_result"),tool_use_id:e(),content:w("type",[t({type:a("text_editor_code_execution_tool_result_error"),error_code:e()}),t({type:a("text_editor_code_execution_view_result"),content:e(),file_type:e(),num_lines:n().nullable(),start_line:n().nullable(),total_lines:n().nullable()}),t({type:a("text_editor_code_execution_create_result"),is_file_update:r()}),t({type:a("text_editor_code_execution_str_replace_result"),lines:o(e()).nullable(),new_lines:n().nullable(),new_start:n().nullable(),old_lines:n().nullable(),old_start:n().nullable()})])}),t({type:a("tool_search_tool_result"),tool_use_id:e(),content:p([t({type:a("tool_search_tool_search_result"),tool_references:o(t({type:a("tool_reference"),tool_name:e()}))}),t({type:a("tool_search_tool_result_error"),error_code:e()})])}),t({type:a("container_upload"),file_id:e()}),t({type:a("advisor_tool_result"),tool_use_id:e(),content:w("type",[t({type:a("advisor_result"),text:e(),stop_reason:e().nullish()}),t({type:a("advisor_redacted_result"),encrypted_content:e(),stop_reason:e().nullish()}),t({type:a("advisor_tool_result_error"),error_code:e()})])}),nt()])),stop_reason:e().nullish(),stop_sequence:e().nullish(),stop_details:Tt().nullish(),input_transformations:o(ot()).nullish(),safeguard_results:o(Ct()).nullish(),usage:ae({input_tokens:n(),output_tokens:n(),output_tokens_details:t({thinking_tokens:n().nullish()}).nullish(),cache_creation_input_tokens:n().nullish(),cache_read_input_tokens:n().nullish(),iterations:o(t({type:p([a("compaction"),a("message"),a("advisor_message"),a("fallback_message")]),model:e().nullish(),input_tokens:n(),output_tokens:n(),cache_creation_input_tokens:n().nullish(),cache_read_input_tokens:n().nullish()})).nullish()}),container:t({expires_at:e(),id:e(),skills:o(t({type:p([a("anthropic"),a("custom")]),skill_id:e(),version:e()})).nullish()}).nullish(),context_management:t({applied_edits:o(p([t({type:a("clear_tool_uses_20250919"),cleared_tool_uses:n(),cleared_input_tokens:n()}),t({type:a("clear_thinking_20251015"),cleared_thinking_turns:n(),cleared_input_tokens:n()}),t({type:a("compact_20260112")})]))}).nullish()}))),Gt=u(()=>l(w("type",[t({type:a("message_start"),message:t({id:e().nullish(),model:e().nullish(),role:e().nullish(),usage:ae({input_tokens:n(),cache_creation_input_tokens:n().nullish(),cache_read_input_tokens:n().nullish()}),content:o(w("type",[t({type:a("tool_use"),id:e(),name:e(),input:m(),caller:Me().optional(),toolset_name:e().nullish()})])).nullish(),stop_reason:e().nullish(),input_transformations:o(ot()).nullish(),container:t({expires_at:e(),id:e()}).nullish()})}),t({type:a("content_block_start"),index:n(),content_block:w("type",[t({type:a("text"),text:e()}),t({type:a("thinking"),thinking:e()}),t({type:a("tool_use"),id:e(),name:e(),input:d(e(),m()).optional(),caller:Me().optional(),toolset_name:e().nullish()}),t({type:a("redacted_thinking"),data:e()}),t({type:a("compaction"),content:e().nullish(),signature:e().nullish()}),t({type:a("server_tool_use"),id:e(),name:e(),input:d(e(),m()).nullish(),caller:Me().optional()}),t({type:a("mcp_tool_use"),id:e(),name:e(),input:m(),server_name:e()}),t({type:a("mcp_tool_result"),tool_use_id:e(),is_error:r(),content:Nt()}),t({type:a("web_fetch_tool_result"),tool_use_id:e(),caller:Me().optional(),content:p([t({type:a("web_fetch_result"),url:e(),retrieved_at:e().nullable(),content:t({type:a("document"),title:e().nullable(),citations:t({enabled:r()}).optional(),source:p([t({type:a("base64"),media_type:a("application/pdf"),data:e()}),t({type:a("text"),media_type:a("text/plain"),data:e()})])})}),t({type:a("web_fetch_tool_result_error"),error_code:e()})])}),t({type:a("web_search_tool_result"),tool_use_id:e(),caller:Me().optional(),content:p([o(t({type:a("web_search_result"),url:e(),title:e().nullable(),encrypted_content:e(),page_age:e().nullish()})),t({type:a("web_search_tool_result_error"),error_code:e()})])}),t({type:a("code_execution_tool_result"),tool_use_id:e(),content:p([t({type:a("code_execution_result"),stdout:e(),stderr:e(),return_code:n(),content:o(t({type:a("code_execution_output"),file_id:e()})).optional().default([])}),t({type:a("encrypted_code_execution_result"),encrypted_stdout:e(),stderr:e(),return_code:n(),content:o(t({type:a("code_execution_output"),file_id:e()})).optional().default([])}),t({type:a("code_execution_tool_result_error"),error_code:e()})])}),t({type:a("bash_code_execution_tool_result"),tool_use_id:e(),content:w("type",[t({type:a("bash_code_execution_result"),content:o(t({type:a("bash_code_execution_output"),file_id:e()})),stdout:e(),stderr:e(),return_code:n()}),t({type:a("bash_code_execution_tool_result_error"),error_code:e()})])}),t({type:a("text_editor_code_execution_tool_result"),tool_use_id:e(),content:w("type",[t({type:a("text_editor_code_execution_tool_result_error"),error_code:e()}),t({type:a("text_editor_code_execution_view_result"),content:e(),file_type:e(),num_lines:n().nullable(),start_line:n().nullable(),total_lines:n().nullable()}),t({type:a("text_editor_code_execution_create_result"),is_file_update:r()}),t({type:a("text_editor_code_execution_str_replace_result"),lines:o(e()).nullable(),new_lines:n().nullable(),new_start:n().nullable(),old_lines:n().nullable(),old_start:n().nullable()})])}),t({type:a("tool_search_tool_result"),tool_use_id:e(),content:p([t({type:a("tool_search_tool_search_result"),tool_references:o(t({type:a("tool_reference"),tool_name:e()}))}),t({type:a("tool_search_tool_result_error"),error_code:e()})])}),t({type:a("advisor_tool_result"),tool_use_id:e(),content:w("type",[t({type:a("advisor_result"),text:e(),stop_reason:e().nullish()}),t({type:a("advisor_redacted_result"),encrypted_content:e(),stop_reason:e().nullish()}),t({type:a("advisor_tool_result_error"),error_code:e()})])}),nt()])}),t({type:a("content_block_delta"),index:n(),delta:w("type",[t({type:a("input_json_delta"),partial_json:e()}),t({type:a("text_delta"),text:e()}),t({type:a("thinking_delta"),thinking:e()}),t({type:a("signature_delta"),signature:e()}),t({type:a("compaction_delta"),content:e().nullish()}),t({type:a("citations_delta"),citation:St()})])}),t({type:a("content_block_stop"),index:n()}),t({type:a("error"),error:t({type:e(),message:e(),code:p([e(),n()]).nullish(),statusCode:n().nullish(),isRetryable:r().nullish(),data:m().nullish()})}),t({type:a("message_delta"),delta:t({stop_reason:e().nullish(),stop_sequence:e().nullish(),stop_details:Tt().nullish(),safeguard_results:o(Ct()).nullish(),container:t({expires_at:e(),id:e(),skills:o(t({type:p([a("anthropic"),a("custom")]),skill_id:e(),version:e()})).nullish()}).nullish()}),usage:ae({input_tokens:n().nullish(),output_tokens:n(),output_tokens_details:t({thinking_tokens:n().nullish()}).nullish(),cache_creation_input_tokens:n().nullish(),cache_read_input_tokens:n().nullish(),iterations:o(t({type:p([a("compaction"),a("message"),a("advisor_message"),a("fallback_message")]),model:e().nullish(),input_tokens:n(),output_tokens:n(),cache_creation_input_tokens:n().nullish(),cache_read_input_tokens:n().nullish()})).nullish()}),input_transformations:o(ot()).nullish(),context_management:t({applied_edits:o(p([t({type:a("clear_tool_uses_20250919"),cleared_tool_uses:n(),cleared_input_tokens:n()}),t({type:a("clear_thinking_20251015"),cleared_thinking_turns:n(),cleared_input_tokens:n()}),t({type:a("compact_20260112")})]))}).nullish()}),t({type:a("message_stop")}),t({type:a("ping")})]))),Zt=u(()=>l(t({signature:e().optional(),redactedData:e().optional()}))),Ze=u(()=>l(t({containerUpload:r().optional(),citations:t({enabled:r()}).optional(),title:e().optional(),context:e().optional()}))),Yt=u(()=>l(t({clearAt:a("next_user_message").optional(),effort:s(["low","medium","high","xhigh","max"]).optional(),toolChanges:o(w("type",[t({type:a("tool_addition"),toolName:e()}),t({type:a("tool_removal"),toolName:e()})])).optional()}))),dt=u(()=>l(t({sendReasoning:r().optional(),structuredOutputMode:s(["outputFormat","jsonTool","auto"]).optional(),thinking:p([w("type",[t({type:a("adaptive"),display:s(["omitted","summarized","updates"]).optional(),blockBinding:t({prefixMismatchBehavior:s(["error","drop_block"])}).optional()}),t({type:a("enabled"),budgetTokens:n().optional()}),t({type:a("disabled")}),t({type:a("between_tools")})]),t({type:le().optional(),blockBinding:t({prefixMismatchBehavior:s(["error","drop_block"])})})]).optional(),disableParallelToolUse:r().optional(),cacheControl:t({type:a("ephemeral"),ttl:p([a("5m"),a("1h")]).optional()}).optional(),metadata:t({userId:e().optional()}).optional(),mcpServers:o(t({type:a("url"),name:e(),url:e(),authorizationToken:e().nullish(),toolConfiguration:t({enabled:r().nullish(),allowedTools:o(e()).nullish()}).nullish()})).optional(),container:t({id:e().optional(),skills:o(w("type",[t({type:a("anthropic"),skillId:e(),version:e().optional()}),t({type:a("custom"),providerReference:d(e(),e()),version:e().optional()})])).optional()}).optional(),toolStreaming:r().optional(),effort:s(["low","medium","high","xhigh","max"]).optional(),taskBudget:t({type:a("tokens"),total:n().int().min(20000),remaining:n().int().min(0).optional()}).optional(),speed:s(["fast","standard"]).optional(),serviceTier:s(["auto","standard_only"]).optional(),inferenceGeo:s(["us","global"]).optional(),fallbacks:p([a("default"),o(t({model:e(),max_tokens:n().int().optional(),thinking:d(e(),m()).optional(),output_config:d(e(),m()).optional(),speed:s(["fast","standard"]).optional()}))]).optional(),anthropicBeta:o(e()).optional(),safeguards:o(t({type:a("dangerous_tool_use"),classifierContext:d(e(),m()).optional()})).optional(),compaction:t({type:a("summarize"),instructions:e().optional()}).optional(),contextManagement:t({edits:o(w("type",[t({type:a("clear_tool_uses_20250919"),trigger:w("type",[t({type:a("input_tokens"),value:n()}),t({type:a("tool_uses"),value:n()})]).optional(),keep:t({type:a("tool_uses"),value:n()}).optional(),clearAtLeast:t({type:a("input_tokens"),value:n()}).optional(),clearToolInputs:r().optional(),excludeTools:o(e()).optional()}),t({type:a("clear_thinking_20251015"),keep:p([a("all"),t({type:a("thinking_turns"),value:n()})]).optional()}),t({type:a("compact_20260112"),trigger:t({type:a("input_tokens"),value:n()}).optional(),pauseAfterCompaction:r().optional(),instructions:e().optional()})]))}).optional()}))),_t=4;function Qt(i,_){let g=i?.[_],S=i?.anthropic;return g?.cacheControl??g?.cache_control??S?.cacheControl??S?.cache_control}var rt=class{constructor(i="anthropic"){this.providerOptionsName=i,this.breakpointCount=0,this.warnings=[]}getCacheControl(i,_){let g=Qt(i,this.providerOptionsName);if(!g)return;if(!_.canCache){this.warnings.push({type:"unsupported",feature:"cache_control on non-cacheable context",details:`cache_control cannot be set on ${_.type}. It will be ignored.`});return}if(this.breakpointCount++,this.breakpointCount>_t){this.warnings.push({type:"unsupported",feature:"cacheControl breakpoint limit",details:`Maximum ${_t} cache breakpoints exceeded (found ${this.breakpointCount}). This breakpoint will be ignored.`});return}return g}getWarnings(){return this.warnings}},eo=u(()=>l(t({model:e(),maxUses:n().optional(),maxTokens:n().int().min(1024).optional(),caching:t({type:a("ephemeral"),ttl:p([a("5m"),a("1h")])}).optional()}))),Ot=u(()=>l(w("type",[t({type:a("advisor_result"),text:e(),stopReason:e().optional()}),t({type:a("advisor_redacted_result"),encryptedContent:e(),stopReason:e().optional()}),t({type:a("advisor_tool_result_error"),errorCode:e()})]))),to=u(()=>l(t({}).strict())),oo=G({id:"anthropic.advisor_20260301",inputSchema:to,outputSchema:Ot,supportsDeferredResults:!0}),no=(i)=>oo(i),It=["screenshot","zoom","left_click","right_click","middle_click","double_click","triple_click","left_click_drag","mouse_move","left_mouse_down","left_mouse_up","cursor_position","scroll","type","key","hold_key","wait"],ro=u(()=>l(t({action:s(It),coordinate:W([n().int(),n().int()]).optional(),duration:n().optional(),region:W([n().int(),n().int(),n().int(),n().int()]).optional(),repeat:n().int().optional(),scroll_amount:n().optional(),scroll_direction:s(["up","down","left","right"]).optional(),start_coordinate:W([n().int(),n().int()]).optional(),text:e().optional()}))),io=u(()=>l(t({configs:sn(s(It),t({enabled:r().optional(),deferLoading:r().optional()})).optional()}))),ao=Re({id:"anthropic.computer_toolset_20260801",inputSchema:ro}),so=u(()=>l(t({maxCharacters:n().optional()}))),lo=u(()=>l(t({command:s(["view","create","str_replace","insert"]),path:e(),file_text:e().optional(),insert_line:n().int().optional(),new_str:e().optional(),insert_text:e().optional(),old_str:e().optional(),view_range:o(n().int()).optional()}))),co=Re({id:"anthropic.text_editor_20250728",inputSchema:lo}),uo=(i={})=>co(i),po=u(()=>l(t({maxUses:n().optional(),allowedDomains:o(e()).optional(),blockedDomains:o(e()).optional(),userLocation:t({type:a("approximate"),city:e().optional(),region:e().optional(),country:e().optional(),timezone:e().optional()}).optional(),responseInclusion:s(["full","excluded"]).optional()}))),_o=u(()=>l(o(t({url:e(),title:e().nullable(),pageAge:e().nullable(),encryptedContent:e(),type:a("web_search_result")})))),ho=u(()=>l(t({query:e()}))),mo=G({id:"anthropic.web_search_20260318",inputSchema:ho,outputSchema:_o,supportsDeferredResults:!0}),go=(i={})=>mo(i),fo=u(()=>l(t({maxUses:n().optional(),allowedDomains:o(e()).optional(),blockedDomains:o(e()).optional(),userLocation:t({type:a("approximate"),city:e().optional(),region:e().optional(),country:e().optional(),timezone:e().optional()}).optional()}))),yo=u(()=>l(o(t({url:e(),title:e().nullable(),pageAge:e().nullable(),encryptedContent:e(),type:a("web_search_result")})))),bo=u(()=>l(t({query:e()}))),xo=G({id:"anthropic.web_search_20260209",inputSchema:bo,outputSchema:yo,supportsDeferredResults:!0}),ko=(i={})=>xo(i),vo=u(()=>l(t({maxUses:n().optional(),allowedDomains:o(e()).optional(),blockedDomains:o(e()).optional(),userLocation:t({type:a("approximate"),city:e().optional(),region:e().optional(),country:e().optional(),timezone:e().optional()}).optional()}))),At=u(()=>l(o(t({url:e(),title:e().nullable(),pageAge:e().nullable(),encryptedContent:e(),type:a("web_search_result")})))),wo=u(()=>l(t({query:e()}))),jo=G({id:"anthropic.web_search_20250305",inputSchema:wo,outputSchema:At,supportsDeferredResults:!0}),To=(i={})=>jo(i),Co=u(()=>l(t({maxUses:n().optional(),allowedDomains:o(e()).optional(),blockedDomains:o(e()).optional(),citations:t({enabled:r()}).optional(),maxContentTokens:n().optional(),useCache:r().optional(),responseInclusion:s(["full","excluded"]).optional()}))),So=u(()=>l(t({type:a("web_fetch_result"),url:e(),content:t({type:a("document"),title:e().nullable(),citations:t({enabled:r()}).optional(),source:p([t({type:a("base64"),mediaType:a("application/pdf"),data:e()}),t({type:a("text"),mediaType:a("text/plain"),data:e()})])}),retrievedAt:e().nullable()}))),Oo=u(()=>l(t({url:e()}))),Io=G({id:"anthropic.web_fetch_20260318",inputSchema:Oo,outputSchema:So,supportsDeferredResults:!0}),Ao=(i={})=>Io(i),Eo=u(()=>l(t({maxUses:n().optional(),allowedDomains:o(e()).optional(),blockedDomains:o(e()).optional(),citations:t({enabled:r()}).optional(),maxContentTokens:n().optional()}))),Ro=u(()=>l(t({type:a("web_fetch_result"),url:e(),content:t({type:a("document"),title:e().nullable(),citations:t({enabled:r()}).optional(),source:p([t({type:a("base64"),mediaType:a("application/pdf"),data:e()}),t({type:a("text"),mediaType:a("text/plain"),data:e()})])}),retrievedAt:e().nullable()}))),Do=u(()=>l(t({url:e()}))),$o=G({id:"anthropic.web_fetch_20260209",inputSchema:Do,outputSchema:Ro,supportsDeferredResults:!0}),Uo=(i={})=>$o(i),qo=u(()=>l(t({maxUses:n().optional(),allowedDomains:o(e()).optional(),blockedDomains:o(e()).optional(),citations:t({enabled:r()}).optional(),maxContentTokens:n().optional()}))),Et=u(()=>l(t({type:a("web_fetch_result"),url:e(),content:t({type:a("document"),title:e().nullable(),citations:t({enabled:r()}).optional(),source:p([t({type:a("base64"),mediaType:a("application/pdf"),data:e()}),t({type:a("text"),mediaType:a("text/plain"),data:e()})])}),retrievedAt:e().nullable()}))),Bo=u(()=>l(t({url:e()}))),Po=G({id:"anthropic.web_fetch_20250910",inputSchema:Bo,outputSchema:Et,supportsDeferredResults:!0}),Fo=(i={})=>Po(i);async function wy({tools:i,toolChoice:_,disableParallelToolUse:g,cacheControlValidator:S,supportsStructuredOutput:X,supportsStrictTools:se,defaultEagerInputStreaming:ue=!1,rejectsForcedToolUse:U=!1}){i=i?.length?i:void 0;let de=[],Y=new Set,Te=S||new rt;if(i==null)return{tools:void 0,toolChoice:void 0,toolWarnings:de,betas:Y};let K=[];for(let D of i)switch(D.type){case"function":{let P=Te.getCacheControl(D.providerOptions,{type:"tool definition",canCache:!0}),ne=D.providerOptions?.anthropic,ye=ne?.eagerInputStreaming??ue,he=ne?.deferLoading,_e=ne?.allowedCallers;if(!se&&D.strict===!0)de.push({type:"unsupported",feature:"strict",details:`Tool '${D.name}' has strict: ${D.strict}, but strict mode is not supported by this provider. The strict property will be ignored.`});if(K.push({name:D.name,description:D.description,input_schema:D.inputSchema,cache_control:P,...ye?{eager_input_streaming:!0}:{},...se===!0&&D.strict!=null?{strict:D.strict}:{},...he!=null?{defer_loading:he}:{},..._e!=null?{allowed_callers:_e}:{},...D.inputExamples!=null?{input_examples:D.inputExamples.map((V)=>V.input)}:{}}),X===!0)Y.add("structured-outputs-2025-11-13");if(D.inputExamples!=null||_e!=null)Y.add("advanced-tool-use-2025-11-20");break}case"provider":switch(D.id){case"anthropic.code_execution_20250522":Y.add("code-execution-2025-05-22"),K.push({type:"code_execution_20250522",name:"code_execution",cache_control:void 0});break;case"anthropic.code_execution_20250825":Y.add("code-execution-2025-08-25"),K.push({type:"code_execution_20250825",name:"code_execution"});break;case"anthropic.code_execution_20260120":K.push({type:"code_execution_20260120",name:"code_execution"});break;case"anthropic.computer_20250124":Y.add("computer-use-2025-01-24"),K.push({name:"computer",type:"computer_20250124",display_width_px:D.args.displayWidthPx,display_height_px:D.args.displayHeightPx,display_number:D.args.displayNumber,cache_control:void 0});break;case"anthropic.computer_20251124":Y.add("computer-use-2025-11-24"),K.push({name:"computer",type:"computer_20251124",display_width_px:D.args.displayWidthPx,display_height_px:D.args.displayHeightPx,display_number:D.args.displayNumber,enable_zoom:D.args.enableZoom,cache_control:void 0});break;case"anthropic.computer_toolset_20260801":{let P=await z({value:D.args,schema:io}),ne=P.configs!=null?Object.fromEntries(Object.entries(P.configs).map(([ye,he])=>[ye,{...he?.enabled!=null&&{enabled:he.enabled},...he?.deferLoading!=null&&{defer_loading:he.deferLoading}}])):void 0;K.push({type:"computer_toolset_20260801",...ne!=null&&{configs:ne},cache_control:void 0});break}case"anthropic.computer_20241022":Y.add("computer-use-2024-10-22"),K.push({name:"computer",type:"computer_20241022",display_width_px:D.args.displayWidthPx,display_height_px:D.args.displayHeightPx,display_number:D.args.displayNumber,cache_control:void 0});break;case"anthropic.text_editor_20250124":Y.add("computer-use-2025-01-24"),K.push({name:"str_replace_editor",type:"text_editor_20250124",cache_control:void 0});break;case"anthropic.text_editor_20241022":Y.add("computer-use-2024-10-22"),K.push({name:"str_replace_editor",type:"text_editor_20241022",cache_control:void 0});break;case"anthropic.text_editor_20250429":Y.add("computer-use-2025-01-24"),K.push({name:"str_replace_based_edit_tool",type:"text_editor_20250429",cache_control:void 0});break;case"anthropic.text_editor_20250728":{let P=await z({value:D.args,schema:so});K.push({name:"str_replace_based_edit_tool",type:"text_editor_20250728",max_characters:P.maxCharacters,cache_control:void 0});break}case"anthropic.bash_20250124":Y.add("computer-use-2025-01-24"),K.push({name:"bash",type:"bash_20250124",cache_control:void 0});break;case"anthropic.bash_20241022":Y.add("computer-use-2024-10-22"),K.push({name:"bash",type:"bash_20241022",cache_control:void 0});break;case"anthropic.memory_20250818":Y.add("context-management-2025-06-27"),K.push({name:"memory",type:"memory_20250818"});break;case"anthropic.web_fetch_20250910":{Y.add("web-fetch-2025-09-10");let P=await z({value:D.args,schema:qo});K.push({type:"web_fetch_20250910",name:"web_fetch",max_uses:P.maxUses,allowed_domains:P.allowedDomains,blocked_domains:P.blockedDomains,citations:P.citations,max_content_tokens:P.maxContentTokens,cache_control:void 0});break}case"anthropic.web_fetch_20260209":{Y.add("code-execution-web-tools-2026-02-09");let P=await z({value:D.args,schema:Eo});K.push({type:"web_fetch_20260209",name:"web_fetch",max_uses:P.maxUses,allowed_domains:P.allowedDomains,blocked_domains:P.blockedDomains,citations:P.citations,max_content_tokens:P.maxContentTokens,cache_control:void 0});break}case"anthropic.web_fetch_20260318":{let P=await z({value:D.args,schema:Co});K.push({type:"web_fetch_20260318",name:"web_fetch",max_uses:P.maxUses,allowed_domains:P.allowedDomains,blocked_domains:P.blockedDomains,citations:P.citations,max_content_tokens:P.maxContentTokens,use_cache:P.useCache,response_inclusion:P.responseInclusion,cache_control:void 0});break}case"anthropic.web_search_20250305":{let P=await z({value:D.args,schema:vo});K.push({type:"web_search_20250305",name:"web_search",max_uses:P.maxUses,allowed_domains:P.allowedDomains,blocked_domains:P.blockedDomains,user_location:P.userLocation,cache_control:void 0});break}case"anthropic.web_search_20260209":{Y.add("code-execution-web-tools-2026-02-09");let P=await z({value:D.args,schema:fo});K.push({type:"web_search_20260209",name:"web_search",max_uses:P.maxUses,allowed_domains:P.allowedDomains,blocked_domains:P.blockedDomains,user_location:P.userLocation,cache_control:void 0});break}case"anthropic.web_search_20260318":{let P=await z({value:D.args,schema:po});K.push({type:"web_search_20260318",name:"web_search",max_uses:P.maxUses,allowed_domains:P.allowedDomains,blocked_domains:P.blockedDomains,user_location:P.userLocation,response_inclusion:P.responseInclusion,cache_control:void 0});break}case"anthropic.tool_search_regex_20251119":K.push({type:"tool_search_tool_regex_20251119",name:"tool_search_tool_regex"});break;case"anthropic.tool_search_bm25_20251119":K.push({type:"tool_search_tool_bm25_20251119",name:"tool_search_tool_bm25"});break;case"anthropic.advisor_20260301":{Y.add("advisor-tool-2026-03-01");let P=await z({value:D.args,schema:eo});K.push({type:"advisor_20260301",name:"advisor",model:P.model,...P.maxUses!==void 0&&{max_uses:P.maxUses},...P.maxTokens!==void 0&&{max_tokens:P.maxTokens},...P.caching!==void 0&&{caching:P.caching}});break}default:de.push({type:"unsupported",feature:`provider-defined tool ${D.id}`})}break;default:de.push({type:"unsupported",feature:`tool ${D}`})}if(_==null)return{tools:K,toolChoice:g?{type:"auto",disable_parallel_tool_use:g}:void 0,toolWarnings:de,betas:Y};let je=_.type;switch(je){case"auto":return{tools:K,toolChoice:{type:"auto",disable_parallel_tool_use:g},toolWarnings:de,betas:Y};case"required":if(U)return de.push({type:"unsupported",feature:"toolChoice",details:"toolChoice 'required' is not supported with this model or thinking configuration. Using 'auto' instead. Instruct the model to use a tool in the prompt and verify that a tool call was made."}),{tools:K,toolChoice:{type:"auto",disable_parallel_tool_use:g},toolWarnings:de,betas:Y};return{tools:K,toolChoice:{type:"any",disable_parallel_tool_use:g},toolWarnings:de,betas:Y};case"none":return{tools:K,toolChoice:{type:"none"},toolWarnings:de,betas:Y};case"tool":if(U)return de.push({type:"unsupported",feature:"toolChoice",details:`toolChoice 'tool' is not supported with this model or thinking configuration. Only the '${_.toolName}' tool is sent with 'auto' tool choice. Instruct the model to use the tool in the prompt and verify that a tool call was made.`}),{tools:K.filter((D)=>("name"in D)&&D.name===_.toolName),toolChoice:{type:"auto",disable_parallel_tool_use:g},toolWarnings:de,betas:Y};return{tools:K,toolChoice:{type:"tool",name:_.toolName,disable_parallel_tool_use:g},toolWarnings:de,betas:Y};default:throw new b({functionality:`tool choice type: ${je}`})}}function ht({usage:i,rawUsage:_}){let g=i.cache_creation_input_tokens??0,S=i.cache_read_input_tokens??0,X=i.output_tokens_details?.thinking_tokens??void 0,se,ue,U=i.iterations?.some((de)=>de.type==="fallback_message");if(i.iterations&&i.iterations.length>0&&!U){let de=i.iterations.filter((Y)=>Y.type==="compaction"||Y.type==="message");if(de.length>0){let Y=de.reduce((Te,K)=>({input:Te.input+K.input_tokens,output:Te.output+K.output_tokens}),{input:0,output:0});se=Y.input,ue=Y.output}else se=i.input_tokens,ue=i.output_tokens}else se=i.input_tokens,ue=i.output_tokens;return{inputTokens:{total:se+g+S,noCache:se,cacheRead:S,cacheWrite:g},outputTokens:{total:ue,text:X==null?void 0:ue-X,reasoning:X},raw:_??i}}var Rt=u(()=>l(t({type:a("code_execution_result"),stdout:e(),stderr:e(),return_code:n(),content:o(t({type:a("code_execution_output"),file_id:e()})).optional().default([])}))),Ho=u(()=>l(t({code:e()}))),Lo=G({id:"anthropic.code_execution_20250522",inputSchema:Ho,outputSchema:Rt}),Jo=(i={})=>Lo(i),Mt=u(()=>l(w("type",[t({type:a("code_execution_result"),stdout:e(),stderr:e(),return_code:n(),content:o(t({type:a("code_execution_output"),file_id:e()})).optional().default([])}),t({type:a("bash_code_execution_result"),content:o(t({type:a("bash_code_execution_output"),file_id:e()})),stdout:e(),stderr:e(),return_code:n()}),t({type:a("bash_code_execution_tool_result_error"),error_code:e()}),t({type:a("text_editor_code_execution_tool_result_error"),error_code:e()}),t({type:a("text_editor_code_execution_view_result"),content:e(),file_type:e(),num_lines:n().nullable(),start_line:n().nullable(),total_lines:n().nullable()}),t({type:a("text_editor_code_execution_create_result"),is_file_update:r()}),t({type:a("text_editor_code_execution_str_replace_result"),lines:o(e()).nullable(),new_lines:n().nullable(),new_start:n().nullable(),old_lines:n().nullable(),old_start:n().nullable()})]))),zo=u(()=>l(w("type",[t({type:a("programmatic-tool-call"),code:e()}),t({type:a("bash_code_execution"),command:e()}),w("command",[t({type:a("text_editor_code_execution"),command:a("view"),path:e()}),t({type:a("text_editor_code_execution"),command:a("create"),path:e(),file_text:e().nullish()}),t({type:a("text_editor_code_execution"),command:a("str_replace"),path:e(),old_str:e(),new_str:e()})])]))),Wo=G({id:"anthropic.code_execution_20250825",inputSchema:zo,outputSchema:Mt,supportsDeferredResults:!0}),Ko=(i={})=>No(Wo(i),{type:"provider",prepareProviderOptions:(_)=>{let g=_?.anthropic;return{..._,anthropic:{...g,allowedCallers:[...new Set([...g?.allowedCallers??[],"code_execution_20250825"])]}}}}),Dt=u(()=>l(w("type",[t({type:a("code_execution_result"),stdout:e(),stderr:e(),return_code:n(),content:o(t({type:a("code_execution_output"),file_id:e()})).optional().default([])}),t({type:a("encrypted_code_execution_result"),encrypted_stdout:e(),stderr:e(),return_code:n(),content:o(t({type:a("code_execution_output"),file_id:e()})).optional().default([])}),t({type:a("bash_code_execution_result"),content:o(t({type:a("bash_code_execution_output"),file_id:e()})),stdout:e(),stderr:e(),return_code:n()}),t({type:a("bash_code_execution_tool_result_error"),error_code:e()}),t({type:a("text_editor_code_execution_tool_result_error"),error_code:e()}),t({type:a("text_editor_code_execution_view_result"),content:e(),file_type:e(),num_lines:n().nullable(),start_line:n().nullable(),total_lines:n().nullable()}),t({type:a("text_editor_code_execution_create_result"),is_file_update:r()}),t({type:a("text_editor_code_execution_str_replace_result"),lines:o(e()).nullable(),new_lines:n().nullable(),new_start:n().nullable(),old_lines:n().nullable(),old_start:n().nullable()})]))),Vo=u(()=>l(w("type",[t({type:a("programmatic-tool-call"),code:e()}),t({type:a("bash_code_execution"),command:e()}),w("command",[t({type:a("text_editor_code_execution"),command:a("view"),path:e()}),t({type:a("text_editor_code_execution"),command:a("create"),path:e(),file_text:e().nullish()}),t({type:a("text_editor_code_execution"),command:a("str_replace"),path:e(),old_str:e(),new_str:e()})])]))),Xo=G({id:"anthropic.code_execution_20260120",inputSchema:Vo,outputSchema:Dt,supportsDeferredResults:!0}),Go=(i={})=>No(Xo(i),{type:"provider",prepareProviderOptions:(_)=>{let g=_?.anthropic;return{..._,anthropic:{...g,allowedCallers:[...new Set([...g?.allowedCallers??[],"code_execution_20260120"])]}}}}),$t=u(()=>l(o(t({type:a("tool_reference"),toolName:e()})))),Zo=u(()=>l(t({pattern:e(),limit:n().optional()}))),Yo=G({id:"anthropic.tool_search_regex_20251119",inputSchema:Zo,outputSchema:$t,supportsDeferredResults:!0}),Qo=(i={})=>Yo(i);function en(i){if(typeof i==="string")return new TextDecoder().decode(ke(i));return new TextDecoder().decode(i)}function Ye(i){try{if(typeof i==="string")return Qe(i);else if(typeof i==="object"&&i!==null)return i}catch{let _=i?.errorCode;return{errorCode:typeof _==="string"?_:"unavailable"}}return{}}async function tn({prompt:i,sendReasoning:_,warnings:g,cacheControlValidator:S,toolNameMapping:X,toolsetNames:se={},convertMediaPart:ue}){let U=new Set,de=on(i),Y=S||new rt,Te=void 0,K=[],je=-1;async function D(_e){return(await T({provider:"anthropic",providerOptions:_e,schema:Ze}))?.citations?.enabled??!1}async function P(_e){return(await T({provider:"anthropic",providerOptions:_e,schema:Ze}))?.containerUpload??!1}async function ne(_e){let V=await T({provider:"anthropic",providerOptions:_e,schema:Ze});return{title:V?.title,context:V?.context}}for(let _e=0;_e<de.length;_e++){let V=de[_e],h=_e===de.length-1,Z=V.type;switch(Z){case"system":{let A=[];for(let{content:ce,providerOptions:f}of V.messages){let B=await T({provider:"anthropic",providerOptions:f,schema:Yt}),be=B?.toolChanges??[],y=[];if(ce!==""||be.length===0&&B?.clearAt==null&&B?.effort==null)y.push({type:"text",text:ce,cache_control:Y.getCacheControl(f,{type:"system message",canCache:!0})});for(let Ne of be)y.push({type:Ne.type,tool:{type:"tool_reference",name:X.toProviderToolName(Ne.toolName)}});A.push({content:y,clearAt:B?.clearAt,effort:B?.effort,toolChangeCount:be.length})}let pe=A.reduce((ce,f)=>ce+f.toolChangeCount,0),Se=A.some((ce)=>ce.clearAt!=null||ce.effort!=null);if(_e===0||Te==null&&pe===0&&!Se){if(pe>0)g.push({type:"other",message:"tool changes on the initial system message are not supported by Anthropic. Configure the initial tool set via the tools option instead. The tool changes have been ignored."});for(let ce of A)if(ce.content.length===0&&ce.clearAt==null&&ce.effort!=null)K.push({role:"system",content:[],output_config:{effort:ce.effort}}),U.add("mid-conversation-output-config-2026-07-01");else if(ce.clearAt!=null||ce.effort!=null)g.push({type:"other",message:"clearAt and effort on this initial system message are not supported by Anthropic. Use a separate effort-only system message with empty content to set effort. These options have been ignored."});Te=A.flatMap((ce)=>ce.content.filter((f)=>f.type==="text"))}else{U.add("mid-conversation-system-2026-04-07");for(let ce of A){if(K.push({role:"system",content:ce.content,...ce.clearAt!=null&&{clear_at:ce.clearAt},...ce.effort!=null&&{output_config:{effort:ce.effort}}}),ce.toolChangeCount>0)U.add("mid-conversation-tool-changes-2026-07-01");if(ce.clearAt!=null)U.add("mid-conversation-system-clear-at-2026-08-21");if(ce.effort!=null)U.add("mid-conversation-output-config-2026-07-01")}}break}case"user":{let A=[];for(let pe of V.messages){let{role:Se,content:ce}=pe;switch(Se){case"user":if(ce.length>0)je=K.length;for(let f=0;f<ce.length;f++){let B=ce[f],be=f===ce.length-1,y=Y.getCacheControl(B.providerOptions,{type:"user message part",canCache:!0})??(be?Y.getCacheControl(pe.providerOptions,{type:"user message",canCache:!0}):void 0);switch(B.type){case"text":A.push({type:"text",text:B.text,cache_control:y});break;case"file":{let Ne=await ue?.(B);if(Ne!=null){A.push({...Ne,cache_control:y});break}switch(B.data.type){case"reference":{let re=qe({reference:B.data.reference,provider:"anthropic"});if(U.add("files-api-2025-04-14"),await P(B.providerOptions))A.push({type:"container_upload",file_id:re});else if(fe(B.mediaType)==="image")A.push({type:"image",source:{type:"file",file_id:re},cache_control:y});else A.push({type:"document",source:{type:"file",file_id:re},cache_control:y});break}case"text":{let re=await D(B.providerOptions),L=await ne(B.providerOptions);A.push({type:"document",source:{type:"text",media_type:"text/plain",data:B.data.text},title:L.title??B.filename,...L.context&&{context:L.context},...re&&{citations:{enabled:!0}},cache_control:y});break}case"url":case"data":{let re=fe(B.mediaType);if(re==="image")A.push({type:"image",source:B.data.type==="url"?{type:"url",url:B.data.url.toString()}:{type:"base64",media_type:ee({part:B}),data:j(B.data.data)},cache_control:y});else if(re==="application"&&(B.data.type==="url"?B.mediaType==="application/pdf":ee({part:B})==="application/pdf")){U.add("pdfs-2024-09-25");let L=await D(B.providerOptions),ge=await ne(B.providerOptions);A.push({type:"document",source:B.data.type==="url"?{type:"url",url:B.data.url.toString()}:{type:"base64",media_type:"application/pdf",data:j(B.data.data)},title:ge.title??B.filename,...ge.context&&{context:ge.context},...L&&{citations:{enabled:!0}},cache_control:y})}else if(B.mediaType==="text/plain"){let L=await D(B.providerOptions),ge=await ne(B.providerOptions);A.push({type:"document",source:B.data.type==="url"?{type:"url",url:B.data.url.toString()}:{type:"text",media_type:"text/plain",data:en(B.data.data)},title:ge.title??B.filename,...ge.context&&{context:ge.context},...L&&{citations:{enabled:!0}},cache_control:y})}else throw new b({functionality:`media type: ${B.mediaType}`});break}}break}}}break;case"tool":for(let f=0;f<ce.length;f++){let B=ce[f];if(B.type==="tool-approval-response")continue;let be=B.output,y="providerOptions"in be?be.providerOptions:be.type==="content"?be.value.find((k)=>k.providerOptions!=null)?.providerOptions:void 0,Ne=f===ce.length-1,re=Y.getCacheControl(B.providerOptions,{type:"tool result part",canCache:!0})??Y.getCacheControl(y,{type:"tool result output",canCache:!0})??(Ne?Y.getCacheControl(pe.providerOptions,{type:"tool result message",canCache:!0}):void 0),L;switch(be.type){case"content":L=be.value.map((k)=>{switch(k.type){case"text":return{type:"text",text:k.text};case"file":{let v=fe(k.mediaType);if(k.data.type==="reference"){let xe=qe({reference:k.data.reference,provider:"anthropic"});if(U.add("files-api-2025-04-14"),v==="image")return{type:"image",source:{type:"file",file_id:xe}};return{type:"document",source:{type:"file",file_id:xe}}}if(k.data.type==="url"){if(v==="image")return{type:"image",source:{type:"url",url:k.data.url.toString()}};return{type:"document",source:{type:"url",url:k.data.url.toString()}}}if(k.data.type==="data"){if(v==="image")return{type:"image",source:{type:"base64",media_type:ee({part:k}),data:j(k.data.data)}};if(ee({part:k})==="application/pdf")return U.add("pdfs-2024-09-25"),{type:"document",source:{type:"base64",media_type:"application/pdf",data:j(k.data.data)}};g.push({type:"other",message:`unsupported tool content part type: ${k.type} with media type: ${k.mediaType}`});return}g.push({type:"other",message:`unsupported tool content part type: ${k.type} with data type: ${k.data.type}`});return}case"custom":{let v=k.providerOptions?.anthropic;if(v?.type==="tool-reference")return{type:"tool_reference",tool_name:v.toolName};g.push({type:"other",message:"unsupported custom tool content part"});return}default:g.push({type:"other",message:`unsupported tool content part type: ${k.type}`});return}}).filter(Mo);break;case"text":case"error-text":L=be.value;break;case"execution-denied":L=be.reason??"Tool call execution denied.";break;default:L=JSON.stringify(be.value)}let ge=mt({toolName:B.toolName,providerOptions:B.providerOptions,toolsetNames:se});A.push({type:"tool_result",tool_use_id:B.toolCallId,...ge!=null&&{toolset_name:ge},content:L,is_error:be.type==="error-text"||be.type==="error-json"?!0:void 0,cache_control:re})}break;default:throw Error(`Unsupported role: ${Se}`)}}K.push({role:"user",content:A});break}case"assistant":{let A=[],pe=new Set;for(let Se=0;Se<V.messages.length;Se++){let ce=V.messages[Se],f=Se===V.messages.length-1,{content:B}=ce;for(let be=0;be<B.length;be++){let y=B[be],Ne=be===B.length-1,re=Y.getCacheControl(y.providerOptions,{type:"assistant message part",canCache:!0})??(Ne?Y.getCacheControl(ce.providerOptions,{type:"assistant message",canCache:!0}):void 0);switch(y.type){case"text":{let L=y.providerOptions?.anthropic;if(L?.type==="compaction"){if(y.text==="")break;if(typeof L.signature==="string")U.add("compact-2026-09-04");A.push({type:"compaction",content:y.text,...typeof L.signature==="string"&&{signature:L.signature},cache_control:re})}else A.push({type:"text",text:h&&f&&Ne?y.text.trim():y.text,...L?.citations!=null&&{citations:L.citations},cache_control:re});break}case"reasoning":if(_){let L=await T({provider:"anthropic",providerOptions:y.providerOptions,schema:Zt});if(L!=null)if(L.signature!=null)Y.getCacheControl(y.providerOptions,{type:"thinking block",canCache:!1}),A.push({type:"thinking",thinking:y.text,signature:L.signature});else if(L.redactedData!=null)Y.getCacheControl(y.providerOptions,{type:"redacted thinking block",canCache:!1}),A.push({type:"redacted_thinking",data:L.redactedData});else g.push({type:"other",message:"unsupported reasoning metadata"});else g.push({type:"other",message:"unsupported reasoning metadata"})}else g.push({type:"other",message:"sending reasoning content is disabled for this model"});break;case"custom":{if(y.kind!=="anthropic.fallback")break;let L=await De({value:y.providerOptions?.anthropic,schema:Wt});if(!L.success){g.push({type:"other",message:"anthropic fallback metadata must include from.model and to.model"});break}U.add("server-side-fallback-2026-06-01"),A.push({type:"fallback",from:L.value.from,to:L.value.to});break}case"tool-call":{let L=gt(y.providerOptions);if(y.providerExecuted){let k=X.toProviderToolName(y.toolName);if(y.providerOptions?.anthropic?.type==="mcp-tool-use"){pe.add(y.toolCallId);let v=y.providerOptions?.anthropic?.serverName;if(v==null||typeof v!=="string"){g.push({type:"other",message:"mcp tool use server name is required and must be a string"});break}A.push({type:"mcp_tool_use",id:y.toolCallId,name:y.toolName,input:y.input,server_name:v,cache_control:re})}else if(k==="code_execution"&&y.input!=null&&typeof y.input==="object"&&"type"in y.input&&typeof y.input.type==="string"&&(y.input.type==="bash_code_execution"||y.input.type==="text_editor_code_execution")){let{type:v,...xe}=y.input;A.push({type:"server_tool_use",id:y.toolCallId,name:v,input:xe,...L&&{caller:L},cache_control:re})}else if(k==="code_execution"&&y.input!=null&&typeof y.input==="object"&&"type"in y.input&&y.input.type==="programmatic-tool-call"){let{type:v,...xe}=y.input;A.push({type:"server_tool_use",id:y.toolCallId,name:"code_execution",input:xe,...L&&{caller:L},cache_control:re})}else if(k==="code_execution"||k==="web_fetch"||k==="web_search")A.push({type:"server_tool_use",id:y.toolCallId,name:k,input:y.input,...L&&{caller:L},cache_control:re});else if(k==="tool_search_tool_regex"||k==="tool_search_tool_bm25")A.push({type:"server_tool_use",id:y.toolCallId,name:k,input:y.input,...L&&{caller:L},cache_control:re});else if(k==="advisor")A.push({type:"server_tool_use",id:y.toolCallId,name:"advisor",input:{},...L&&{caller:L},cache_control:re});else g.push({type:"other",message:`provider executed tool call for tool ${y.toolName} is not supported`});break}let ge=mt({toolName:y.toolName,providerOptions:y.providerOptions,toolsetNames:se});if(ge!=null){let k=ft(y.input),{action:v}=k,xe=typeof v==="string";if(!xe)g.push({type:"other",message:`toolset tool call for tool ${y.toolName} is missing the action`});A.push({type:"tool_use",id:y.toolCallId,name:xe?v:ge,toolset_name:ge,input:k,...L&&{caller:L},cache_control:re});break}A.push({type:"tool_use",id:y.toolCallId,name:y.toolName,input:ft(y.input),...L&&{caller:L},cache_control:re});break}case"tool-result":{let L=X.toProviderToolName(y.toolName),ge=gt(y.providerOptions);if(pe.has(y.toolCallId)){let k=y.output;if(k.type!=="json"&&k.type!=="error-json"){g.push({type:"other",message:`provider executed tool result output type ${k.type} for tool ${y.toolName} is not supported`});break}A.push({type:"mcp_tool_result",tool_use_id:y.toolCallId,is_error:k.type==="error-json",content:k.value,cache_control:re})}else if(L==="code_execution"){let k=y.output;if(k.type==="error-text"||k.type==="error-json"){let v={};try{if(typeof k.value==="string")v=Qe(k.value);else if(typeof k.value==="object"&&k.value!==null)v=k.value}catch{}if(v.type==="code_execution_tool_result_error")A.push({type:"code_execution_tool_result",tool_use_id:y.toolCallId,content:{type:"code_execution_tool_result_error",error_code:v.errorCode??"unknown"},cache_control:re});else A.push({type:"bash_code_execution_tool_result",tool_use_id:y.toolCallId,cache_control:re,content:{type:"bash_code_execution_tool_result_error",error_code:v.errorCode??"unknown"}});break}if(k.type!=="json"){g.push({type:"other",message:`provider executed tool result output type ${k.type} for tool ${y.toolName} is not supported`});break}if(k.value==null||typeof k.value!=="object"||!("type"in k.value)||typeof k.value.type!=="string"){g.push({type:"other",message:`provider executed tool result output value is not a valid code execution result for tool ${y.toolName}`});break}if(k.value.type==="code_execution_result"){let v=await z({value:k.value,schema:Rt});A.push({type:"code_execution_tool_result",tool_use_id:y.toolCallId,content:{type:v.type,stdout:v.stdout,stderr:v.stderr,return_code:v.return_code,content:v.content??[]},cache_control:re})}else if(k.value.type==="encrypted_code_execution_result"){let v=await z({value:k.value,schema:Dt});if(v.type==="encrypted_code_execution_result")A.push({type:"code_execution_tool_result",tool_use_id:y.toolCallId,content:{type:v.type,encrypted_stdout:v.encrypted_stdout,stderr:v.stderr,return_code:v.return_code,content:v.content??[]},cache_control:re})}else{let v=await z({value:k.value,schema:Mt});if(v.type==="code_execution_result")A.push({type:"code_execution_tool_result",tool_use_id:y.toolCallId,content:{type:v.type,stdout:v.stdout,stderr:v.stderr,return_code:v.return_code,content:v.content??[]},cache_control:re});else if(v.type==="bash_code_execution_result"||v.type==="bash_code_execution_tool_result_error")A.push({type:"bash_code_execution_tool_result",tool_use_id:y.toolCallId,cache_control:re,content:v.type==="bash_code_execution_result"?{type:v.type,stdout:v.stdout,stderr:v.stderr,return_code:v.return_code,content:v.content}:v});else A.push({type:"text_editor_code_execution_tool_result",tool_use_id:y.toolCallId,cache_control:re,content:v})}break}if(L==="web_fetch"){let k=y.output;if(k.type==="error-json"){A.push({type:"web_fetch_tool_result",tool_use_id:y.toolCallId,content:{type:"web_fetch_tool_result_error",error_code:Ye(k.value).errorCode??"unavailable"},...ge&&{caller:ge},cache_control:re});break}if(k.type!=="json"){g.push({type:"other",message:`provider executed tool result output type ${k.type} for tool ${y.toolName} is not supported`});break}let v=await z({value:k.value,schema:Et});A.push({type:"web_fetch_tool_result",tool_use_id:y.toolCallId,content:{type:"web_fetch_result",url:v.url,retrieved_at:v.retrievedAt,content:{type:"document",title:v.content.title,citations:v.content.citations,source:{type:v.content.source.type,media_type:v.content.source.mediaType,data:v.content.source.data}}},...ge&&{caller:ge},cache_control:re});break}if(L==="web_search"){let k=y.output;if(k.type==="error-json"){A.push({type:"web_search_tool_result",tool_use_id:y.toolCallId,content:{type:"web_search_tool_result_error",error_code:Ye(k.value).errorCode??"unavailable"},...ge&&{caller:ge},cache_control:re});break}if(k.type!=="json"){g.push({type:"other",message:`provider executed tool result output type ${k.type} for tool ${y.toolName} is not supported`});break}let v=await z({value:k.value,schema:At});A.push({type:"web_search_tool_result",tool_use_id:y.toolCallId,content:v.map((xe)=>({url:xe.url,title:xe.title,page_age:xe.pageAge,encrypted_content:xe.encryptedContent,type:xe.type})),...ge&&{caller:ge},cache_control:re});break}if(L==="tool_search_tool_regex"||L==="tool_search_tool_bm25"){let k=y.output;if(k.type==="error-json"||k.type==="json"&&k.value!=null&&typeof k.value==="object"&&!Array.isArray(k.value)&&"type"in k.value&&k.value.type==="tool_search_tool_result_error"){A.push({type:"tool_search_tool_result",tool_use_id:y.toolCallId,content:{type:"tool_search_tool_result_error",error_code:Ye(k.value).errorCode??"unavailable"},cache_control:re});break}if(k.type!=="json"){g.push({type:"other",message:`provider executed tool result output type ${k.type} for tool ${y.toolName} is not supported`});break}let v=(await z({value:k.value,schema:$t})).map((xe)=>({type:"tool_reference",tool_name:xe.toolName}));A.push({type:"tool_search_tool_result",tool_use_id:y.toolCallId,content:{type:"tool_search_tool_search_result",tool_references:v},cache_control:re});break}if(L==="advisor"){let k=y.output;if(k.type!=="json"&&k.type!=="error-json"){g.push({type:"other",message:`provider executed tool result output type ${k.type} for tool ${y.toolName} is not supported`});break}let v=await z({value:k.value,schema:Ot});if(v.type==="advisor_result")A.push({type:"advisor_tool_result",tool_use_id:y.toolCallId,content:{type:"advisor_result",text:v.text,...v.stopReason!==void 0&&{stop_reason:v.stopReason}},cache_control:re});else if(v.type==="advisor_redacted_result")A.push({type:"advisor_tool_result",tool_use_id:y.toolCallId,content:{type:"advisor_redacted_result",encrypted_content:v.encryptedContent,...v.stopReason!==void 0&&{stop_reason:v.stopReason}},cache_control:re});else A.push({type:"advisor_tool_result",tool_use_id:y.toolCallId,content:{type:"advisor_tool_result_error",error_code:v.errorCode},cache_control:re});break}g.push({type:"other",message:`provider executed tool result for tool ${y.toolName} is not supported`});break}}}}if(A.length>0)K.push({role:"assistant",content:rn(A)});break}default:throw Error(`content type: ${Z}`)}}let ye=new Set;for(let _e of K){if(_e.role!=="assistant")continue;for(let V of _e.content)if(V.type==="server_tool_use"&&V.name==="code_execution")ye.add(V.id)}let he=new Set;for(let _e=0;_e<je;_e++){let V=K[_e];if(V.role!=="assistant")continue;for(let h of V.content){if(!("caller"in h))continue;let Z=h.caller;if(Z==null||Z.type==="direct"||ye.has(Z.tool_id))continue;let A="id"in h?h.id:h.tool_use_id;if(delete h.caller,!he.has(A))he.add(A),g.push({type:"other",message:`Omitted caller metadata for tool ${A} because source code execution tool ${Z.tool_id} is missing from the conversation history.`})}}return{prompt:{system:Te,messages:K},betas:U}}function on(i){let _=[],g=void 0;for(let S of i){let{role:X}=S;switch(X){case"system":if(g?.type!=="system")g={type:"system",messages:[]},_.push(g);g.messages.push(S);break;case"assistant":if(g?.type!=="assistant")g={type:"assistant",messages:[]},_.push(g);g.messages.push(S);break;case"user":if(g?.type!=="user")g={type:"user",messages:[]},_.push(g);g.messages.push(S);break;case"tool":if(g?.type!=="user")g={type:"user",messages:[]},_.push(g);g.messages.push(S);break;default:throw Error(`Unsupported role: ${X}`)}}return _}function rn(i){let _=[],g=[];function S(){_.push(...g.filter((X)=>X.type!=="tool_use"),...g.filter((X)=>X.type==="tool_use")),g=[]}for(let X of i)if(X.type==="thinking"||X.type==="redacted_thinking"||X.type==="fallback")S(),_.push(X);else g.push(X);return S(),_}function mt({toolName:i,providerOptions:_,toolsetNames:g}){let S=g[i];if(S!=null)return S;let X=_?.anthropic?.toolsetName;return typeof X==="string"?X:void 0}function gt(i){let _=i?.anthropic?.caller;if((_?.type==="code_execution_20250825"||_?.type==="code_execution_20260120")&&_.toolId)return{type:_.type,tool_id:_.toolId};return _?.type==="direct"?{type:"direct"}:void 0}function ft(i){return typeof i==="object"&&i!==null&&!Array.isArray(i)?i:{rawInvalidInput:i}}function et({finishReason:i,isJsonResponseFromTool:_}){switch(i){case"pause_turn":case"end_turn":case"stop_sequence":return"stop";case"refusal":return"content-filter";case"tool_use":return _?"stop":"tool-calls";case"max_tokens":case"model_context_window_exceeded":return"length";case"compaction":return"other";default:return"other"}}var Ut=new Set(["date-time","time","date","duration","email","hostname","uri","ipv4","ipv6","uuid"]),an=["minimum","maximum","exclusiveMinimum","exclusiveMaximum","multipleOf","minLength","maxLength","pattern","minItems","maxItems","uniqueItems","minProperties","maxProperties","not"];function Ty(i){return qt(i)}function Be(i){if(typeof i==="boolean"||!Oe(i))return i;return qt(i)}function qt(i){let _={},g=i;if(i.$ref!=null)return{$ref:i.$ref};if(i.$schema!=null)_.$schema=i.$schema;if(i.$id!=null)_.$id=i.$id;if(i.title!=null)_.title=i.title;if(i.description!=null)_.description=i.description;if(i.default!==void 0)_.default=i.default;if(i.const!==void 0)_.const=i.const;if(i.enum!=null)_.enum=i.enum;if(i.type!=null)_.type=i.type;if(i.anyOf!=null)_.anyOf=i.anyOf.map(Be);else if(i.oneOf!=null)_.anyOf=i.oneOf.map(Be);if(i.allOf!=null)_.allOf=i.allOf.map(Be);if(i.definitions!=null)_.definitions=Object.fromEntries(Object.entries(i.definitions).map(([X,se])=>[X,Be(se)]));if(g.$defs!=null){let X=_;X.$defs=Object.fromEntries(Object.entries(g.$defs).map(([se,ue])=>[se,Be(ue)]))}if(i.type==="object"||i.properties!=null){if(i.properties!=null)_.properties=Object.fromEntries(Object.entries(i.properties).map(([X,se])=>[X,Be(se)]));if(_.additionalProperties=!1,i.required!=null)_.required=i.required}if(i.items!=null)_.items=Array.isArray(i.items)?i.items.map(Be):Be(i.items);if(typeof i.format==="string"&&Ut.has(i.format))_.format=i.format;let S=ln(i);if(S!=null)_.description=_.description==null?S:`${_.description}
|
|
2
|
+
${S}`;return _}function ln(i){let _=an.flatMap((g)=>{let S=i[g];if(S==null||S===!1)return[];return`${cn(g)}: ${un(S)}`});if(typeof i.format==="string"&&!Ut.has(i.format))_.push(`format: ${i.format}`);return _.length===0?void 0:`${_.join("; ")}.`}function cn(i){return i.replace(/[A-Z]/g,(_)=>` ${_.toLowerCase()}`)}function un(i){if(typeof i==="string")return i;return JSON.stringify(i)}function pn(i){let _=dn(i.type);return Kt({message:i.message,type:i.type,code:i.code??void 0,statusCode:i.statusCode??_.statusCode,isRetryable:i.isRetryable??_.isRetryable,data:"data"in i?i.data:i})}function dn(i){switch(i){case"api_error":return{statusCode:500,isRetryable:!0};case"overloaded_error":return{statusCode:529,isRetryable:!0};case"rate_limit_error":return{statusCode:429,isRetryable:!0};case"request_too_large":return{statusCode:413,isRetryable:!1};case"authentication_error":return{statusCode:401,isRetryable:!1};case"permission_error":return{statusCode:403,isRetryable:!1};case"not_found_error":return{statusCode:404,isRetryable:!1};case"billing_error":case"invalid_request_error":return{statusCode:400,isRetryable:!1};default:return{}}}function tt(i,_,g){if(i.type==="web_search_result_location")return{type:"source",sourceType:"url",id:g(),url:i.url,title:i.title??void 0,providerMetadata:{anthropic:{citedText:i.cited_text,encryptedIndex:i.encrypted_index}}};if(i.type!=="page_location"&&i.type!=="char_location")return;let S=_[i.document_index];if(!S)return;return{type:"source",sourceType:"document",id:g(),mediaType:S.mediaType,title:i.document_title??S.title,filename:S.filename,providerMetadata:{anthropic:i.type==="page_location"?{citedText:i.cited_text,startPageNumber:i.start_page_number,endPageNumber:i.end_page_number}:{citedText:i.cited_text,startCharIndex:i.start_char_index,endCharIndex:i.end_char_index}}}}function Ke(i){return i==null?void 0:{type:i.type,toolId:"tool_id"in i?i.tool_id:void 0}}function Ae(i){let _=Ke(i);return _==null?{}:{providerMetadata:{anthropic:{caller:_}}}}function _n(i){let _={};for(let g of i??[])if(g.type==="provider"&&g.id==="anthropic.computer_toolset_20260801")_[g.name]="computer";return _}function yt({memberName:i,input:_}){return{action:i,...typeof _==="object"&&_!==null&&!Array.isArray(_)?_:{}}}function bt(i){let _=i.indexOf(".");return _===-1?i:i.substring(0,_)}var Bw=class i{static[H](_){return te({modelId:_.modelId,config:_.config})}static[Q](_){return new i(_.modelId,_.config)}constructor(_,g){this.specificationVersion="v4",this.modelId=_,this.config=g,this.generateId=g.generateId??C}supportsUrl(_){return _.protocol==="https:"}get provider(){return this.config.provider}get supportedUrls(){return this.config.supportedUrls?.()??{}}static async prepareRequest({modelId:_,config:g,options:{userSuppliedBetas:S,prompt:X,maxOutputTokens:se,temperature:ue,topP:U,topK:de,frequencyPenalty:Y,presencePenalty:Te,stopSequences:K,responseFormat:je,seed:D,tools:P,toolChoice:ne,reasoning:ye,providerOptions:he,stream:_e}}){let V=[];if(Y!=null)V.push({type:"unsupported",feature:"frequencyPenalty"});if(Te!=null)V.push({type:"unsupported",feature:"presencePenalty"});if(D!=null)V.push({type:"unsupported",feature:"seed"});let h=g.maxTemperature??1,Z=g.maxTemperature==null?"anthropic":bt(g.provider);if(ue!=null&&ue>h)V.push({type:"unsupported",feature:"temperature",details:`${ue} exceeds ${Z} maximum of ${h.toFixed(1)}. clamped to ${h.toFixed(1)}`}),ue=h;else if(ue!=null&&ue<0)V.push({type:"unsupported",feature:"temperature",details:`${ue} is below ${Z} minimum of 0. clamped to 0`}),ue=0;if(je?.type==="json"){if(je.schema==null)V.push({type:"unsupported",feature:"responseFormat",details:"JSON response format requires a schema. The response format is ignored."})}let A=bt(g.provider),pe=await T({provider:"anthropic",providerOptions:he,schema:dt}),Se=A!=="anthropic"?await T({provider:A,providerOptions:he,schema:dt}):null,ce=Se!=null,f=Object.assign({},pe??{},Se??{}),{maxOutputTokens:B,supportsStructuredOutput:be,supportsAdaptiveThinking:y,rejectsSamplingParameters:Ne,supportsXhighEffort:re,rejectsThinkingDisabledAboveHighEffort:L,rejectsThinkingDisabled:ge,rejectsBudgetThinking:k,rejectsForcedToolUse:v,supportsBetweenToolsThinking:xe,isKnownModel:He}=Hm(_);if(!He&&se==null)V.push({type:"compatibility",feature:"maxOutputTokens",details:`The model "${_}" is unknown. The max output tokens have been limited to ${B}. Set maxOutputTokens explicitly to override this limit.`});if(Ne){if(ue!=null)V.push({type:"unsupported",feature:"temperature",details:`temperature is not supported by ${_} and will be ignored`}),ue=void 0;if(de!=null)V.push({type:"unsupported",feature:"topK",details:`topK is not supported by ${_} and will be ignored`}),de=void 0;if(U!=null)V.push({type:"unsupported",feature:"topP",details:`topP is not supported by ${_} and will be ignored`}),U=void 0}let Le=He||_.includes("claude-"),Je=(g.supportsNativeStructuredOutput??!0)&&be,Ve=(g.supportsStrictTools??!0)&&be,$e=f?.structuredOutputMode??"auto",we=$e==="outputFormat"||$e==="auto"&&Je;if(!we&&v&&Je&&je?.type==="json"&&je.schema!=null)V.push({type:"unsupported",feature:"providerOptions.anthropic.structuredOutputMode",details:`structuredOutputMode 'jsonTool' is not supported by ${_} because it rejects forced tool use. Using 'outputFormat' instead.`}),we=!0;let q=je?.type==="json"&&je.schema!=null&&!we?{type:"function",name:"json",description:"Respond with a JSON object.",inputSchema:je.schema}:void 0;if(q!=null&&f?.disableParallelToolUse===!1)V.push({type:"unsupported",feature:"providerOptions.anthropic.disableParallelToolUse",details:"`disableParallelToolUse: false` is ignored when using the JSON response tool. Parallel tool use is disabled to ensure a single coherent JSON tool call."});let x=f?.contextManagement,c=f?.compaction;if(x!=null&&c!=null)throw new F({argument:"providerOptions",message:"Anthropic provider options `compaction` and `contextManagement` cannot be used together."});let ie=new rt(g.cacheControlProviderOptionsName),R=Vt({tools:P,providerToolNames:{"anthropic.code_execution_20250522":"code_execution","anthropic.code_execution_20250825":"code_execution","anthropic.code_execution_20260120":"code_execution","anthropic.computer_20241022":"computer","anthropic.computer_20250124":"computer","anthropic.computer_20251124":"computer","anthropic.computer_toolset_20260801":"computer","anthropic.text_editor_20241022":"str_replace_editor","anthropic.text_editor_20250124":"str_replace_editor","anthropic.text_editor_20250429":"str_replace_based_edit_tool","anthropic.text_editor_20250728":"str_replace_based_edit_tool","anthropic.bash_20241022":"bash","anthropic.bash_20250124":"bash","anthropic.memory_20250818":"memory","anthropic.web_search_20250305":"web_search","anthropic.web_search_20260209":"web_search","anthropic.web_search_20260318":"web_search","anthropic.web_fetch_20250910":"web_fetch","anthropic.web_fetch_20260209":"web_fetch","anthropic.web_fetch_20260318":"web_fetch","anthropic.tool_search_regex_20251119":"tool_search_tool_regex","anthropic.tool_search_bm25_20251119":"tool_search_tool_bm25","anthropic.advisor_20260301":"advisor"}}),me=_n(P),{prompt:Ue,betas:Ce}=await tn({prompt:X,sendReasoning:f?.sendReasoning??!0,warnings:V,cacheControlValidator:ie,toolNameMapping:R,toolsetNames:me,convertMediaPart:g.convertMediaPart});if(Pe(ye)&&f?.effort==null){let J=hn({reasoning:ye,modelId:_,supportsAdaptiveThinking:y,supportsXhighEffort:re,rejectsThinkingDisabled:ge,supportsBetweenToolsThinking:xe,maxOutputTokensForModel:B,warnings:V});if(J!=null){if(f.thinking==null)f.thinking=J.thinking;if(J.effort!=null&&f.thinking?.type!=="disabled")f.effort=J.effort}}if(ge&&f?.thinking!=null){let J=f.thinking;if(J.type==="disabled"&&xe)V.push({type:"unsupported",feature:"providerOptions.anthropic.thinking",details:`thinking cannot be disabled for ${_}. Using 'between_tools' thinking, the lowest thinking setting, instead.`}),f.thinking={type:"between_tools"};else if(J.type==="disabled")V.push({type:"unsupported",feature:"providerOptions.anthropic.thinking",details:`thinking cannot be disabled for ${_}; it always uses adaptive thinking. The thinking setting has been removed. Lower 'effort' to reduce thinking.`}),f.thinking=void 0}if(k&&f?.thinking?.type==="enabled")V.push({type:"unsupported",feature:"providerOptions.anthropic.thinking",details:ge?`budget-based thinking is not supported by ${_}; it always uses adaptive thinking. Using adaptive thinking instead. Use 'effort' to control how much the model thinks.`:`budget-based thinking is not supported by ${_}. Using adaptive thinking instead. Use 'effort' to control how much the model thinks.`}),f.thinking={type:"adaptive"};if(L&&f?.thinking?.type==="disabled"&&(f.effort==="xhigh"||f.effort==="max"))V.push({type:"unsupported",feature:"providerOptions.anthropic.effort",details:`effort '${f.effort}' is not supported by ${_} when thinking is disabled. The effort has been lowered to 'high'.`}),f.effort="high";if(f?.thinking?.type==="between_tools"&&(f.effort==="xhigh"||f.effort==="max"))V.push({type:"unsupported",feature:"providerOptions.anthropic.effort",details:`effort '${f.effort}' is not supported with 'between_tools' thinking. The effort has been lowered to 'high'.`}),f.effort="high";let Ie=f?.thinking?.type,it=Ie==="enabled"||Ie==="adaptive"||Ie==="between_tools",Xe=f?.thinking!=null&&"blockBinding"in f.thinking?f.thinking.blockBinding:void 0,Bt=it||Ie==="disabled"||Xe!=null,We=Ie==="enabled"?f?.thinking?.budgetTokens:void 0,Ge=Ie==="adaptive"?f?.thinking?.display:void 0,at=se??B,Ee={model:_,max_tokens:at,temperature:ue,top_k:de,top_p:U,stop_sequences:K,...Bt&&{thinking:{...Ie!=null&&{type:Ie},...We!=null&&{budget_tokens:We},...Ge!=null&&{display:Ge},...Xe!=null&&{block_binding:{prefix_mismatch_behavior:Xe.prefixMismatchBehavior}}}},...(f?.effort||f?.taskBudget||we&&je?.type==="json"&&je.schema!=null)&&{output_config:{...f?.effort&&{effort:f.effort},...f?.taskBudget&&{task_budget:{type:f.taskBudget.type,total:f.taskBudget.total,...f.taskBudget.remaining!=null&&{remaining:f.taskBudget.remaining}}},...we&&je?.type==="json"&&je.schema!=null&&{format:{type:"json_schema",schema:Ty(je.schema)}}}},...f?.speed&&{speed:f.speed},...f?.serviceTier&&{service_tier:f.serviceTier},...f?.inferenceGeo&&{inference_geo:f.inferenceGeo},...f?.fallbacks!=null&&(f.fallbacks==="default"||f.fallbacks.length>0)&&{fallbacks:f.fallbacks},...f?.cacheControl&&{cache_control:f.cacheControl},...f?.metadata?.userId!=null&&{metadata:{user_id:f.metadata.userId}},...f?.mcpServers&&f.mcpServers.length>0&&{mcp_servers:f.mcpServers.map((J)=>({type:J.type,name:J.name,url:J.url,authorization_token:J.authorizationToken,tool_configuration:J.toolConfiguration?{allowed_tools:J.toolConfiguration.allowedTools,enabled:J.toolConfiguration.enabled}:void 0}))},...f?.container&&{container:f.container.skills&&f.container.skills.length>0?{id:f.container.id,skills:f.container.skills.map((J)=>({type:J.type,skill_id:J.type==="custom"?qe({reference:J.providerReference,provider:"anthropic"}):J.skillId,version:J.version}))}:f.container.id},system:Ue.system,messages:Ue.messages,...f?.safeguards&&f.safeguards.length>0&&{safeguards:f.safeguards.map((J)=>({type:J.type,...J.classifierContext!==void 0&&{classifier_context:J.classifierContext}}))},...c&&{compaction:{type:c.type,...c.instructions!==void 0&&{instructions:c.instructions}}},...x&&{context_management:{edits:x.edits.map((J)=>{let lt=J.type;switch(lt){case"clear_tool_uses_20250919":return{type:J.type,...J.trigger!==void 0&&{trigger:J.trigger},...J.keep!==void 0&&{keep:J.keep},...J.clearAtLeast!==void 0&&{clear_at_least:J.clearAtLeast},...J.clearToolInputs!==void 0&&{clear_tool_inputs:J.clearToolInputs},...J.excludeTools!==void 0&&{exclude_tools:J.excludeTools}};case"clear_thinking_20251015":return{type:J.type,...J.keep!==void 0&&{keep:J.keep}};case"compact_20260112":return{type:J.type,...J.trigger!==void 0&&{trigger:J.trigger},...J.pauseAfterCompaction!==void 0&&{pause_after_compaction:J.pauseAfterCompaction},...J.instructions!==void 0&&{instructions:J.instructions}};default:V.push({type:"other",message:`Unknown context management strategy: ${lt}`});return}}).filter((J)=>J!==void 0)}}};if(it){if(Ie==="enabled"&&We==null)V.push({type:"compatibility",feature:"extended thinking",details:"thinking budget is required when thinking is enabled. using default budget of 1024 tokens."}),Ee.thinking={type:"enabled",budget_tokens:1024},We=1024;if(Ee.temperature!=null&&!g.supportsTemperatureAndTopPWithThinking)Ee.temperature=void 0,V.push({type:"unsupported",feature:"temperature",details:"temperature is not supported when thinking is enabled"});if(de!=null)Ee.top_k=void 0,V.push({type:"unsupported",feature:"topK",details:"topK is not supported when thinking is enabled"});if(U!=null&&!g.supportsTemperatureAndTopPWithThinking)Ee.top_p=void 0,V.push({type:"unsupported",feature:"topP",details:"topP is not supported when thinking is enabled"});Ee.max_tokens=at+(We??0)}else if(Le&&U!=null&&ue!=null)V.push({type:"unsupported",feature:"topP",details:"topP is not supported when temperature is set. topP is ignored."}),Ee.top_p=void 0;if(He&&Ee.max_tokens>B){if(se!=null)V.push({type:"unsupported",feature:"maxOutputTokens",details:`${Ee.max_tokens} (maxOutputTokens + thinkingBudget) is greater than ${_} ${B} max output tokens. The max output tokens have been limited to ${B}.`});Ee.max_tokens=B}if(f?.mcpServers&&f.mcpServers.length>0)Ce.add("mcp-client-2025-04-04");if(f?.safeguards&&f.safeguards.length>0)Ce.add("dangerous-tool-use-2026-09-03");if(c)Ce.add("compact-2026-09-04");if(x){if(Ce.add("context-management-2025-06-27"),x.edits.some((J)=>J.type==="compact_20260112"))Ce.add("compact-2026-01-12")}if(f?.container&&f.container.skills&&f.container.skills.length>0){if(Ce.add("code-execution-2025-08-25"),Ce.add("skills-2025-10-02"),Ce.add("files-api-2025-04-14"),!P?.some((J)=>J.type==="provider"&&(J.id==="anthropic.code_execution_20250825"||J.id==="anthropic.code_execution_20260120")))V.push({type:"other",message:"code execution tool is required when using skills"})}if(f?.taskBudget)Ce.add("task-budgets-2026-03-13");if(f?.speed==="fast")Ce.add("fast-mode-2026-02-01");if(Ge==="updates")Ce.add("thinking-display-updates-2026-08-18");if(Xe!=null)Ce.add("thinking-binding-controls-2026-08-01");if(f?.fallbacks==="default")Ce.add("server-side-fallback-2026-07-01");else if(f?.fallbacks&&f.fallbacks.length>0)Ce.add("server-side-fallback-2026-06-01");let st=_e&&(f?.toolStreaming??!0),{tools:Pt,toolChoice:Ft,toolWarnings:Ht,betas:Lt}=await wy(q!=null?{tools:[...P??[],q],toolChoice:{type:"required"},disableParallelToolUse:!0,cacheControlValidator:ie,supportsStructuredOutput:!1,supportsStrictTools:Ve,defaultEagerInputStreaming:st,rejectsForcedToolUse:v||Ie==="enabled"}:{tools:P??[],toolChoice:ne,disableParallelToolUse:f?.disableParallelToolUse,cacheControlValidator:ie,supportsStructuredOutput:Je,supportsStrictTools:Ve,defaultEagerInputStreaming:st,rejectsForcedToolUse:v||Ie==="enabled"}),Jt=ie.getWarnings();return{args:{...Ee,tools:Pt,tool_choice:Ft,stream:_e===!0?!0:void 0},warnings:[...V,...Ht,...Jt],betas:new Set([...Ce,...Lt,...S,...f?.anthropicBeta??[]]),usesJsonResponseTool:q!=null,toolNameMapping:R,providerOptionsName:A,usedCustomProviderKey:ce}}getArgs(_){return i.prepareRequest({modelId:this.modelId,config:this.config,options:_})}async getHeaders({betas:_,configHeaders:g,headers:S,providerOptions:X}){let se=I(g,S,_.size>0?{"anthropic-beta":Array.from(_).join(",")}:{});return this.config.transformRequestHeaders?this.config.transformRequestHeaders(se,X):se}getBetasFromHeaders(_,g){let S=_?.["anthropic-beta"]??"",X=g?.["anthropic-beta"]??"";return new Set([...S.toLowerCase().split(","),...X.toLowerCase().split(",")].map((se)=>se.trim()).filter((se)=>se!==""))}buildRequestUrl(_){return this.config.buildRequestUrl?.(this.config.baseURL,_)??`${this.config.baseURL}/messages`}transformRequestBody(_,g){return this.config.transformRequestBody?.(_,g)??_}extractCitationDocuments(_){let g=(S)=>{if(S.type!=="file")return!1;if(S.mediaType!=="application/pdf"&&S.mediaType!=="text/plain")return!1;return S.providerOptions?.anthropic?.citations?.enabled??!1};return _.filter((S)=>S.role==="user").flatMap((S)=>S.content).filter(g).map((S)=>{let X=S;return{title:X.filename??"Untitled Document",filename:X.filename,mediaType:X.mediaType}})}async doGenerate(_){let g=this.config.headers?await M(this.config.headers):void 0,{args:S,warnings:X,betas:se,usesJsonResponseTool:ue,toolNameMapping:U,providerOptionsName:de,usedCustomProviderKey:Y}=await this.getArgs({..._,stream:!1,userSuppliedBetas:this.getBetasFromHeaders(g,_.headers)}),Te=[...this.extractCitationDocuments(_.prompt)],K=xt(S.tools),{responseHeaders:je,value:D,rawValue:P}=await O({url:this.buildRequestUrl(!1),headers:await this.getHeaders({betas:se,configHeaders:g,headers:_.headers,providerOptions:_.providerOptions}),body:this.transformRequestBody(S,se),failedResponseHandler:ct,successfulResponseHandler:E(Xt),abortSignal:_.abortSignal,fetch:this.config.fetch}),ne=[],ye={},he={},_e=!1,V=D.content.some((h)=>h.type==="web_search_tool_result"&&Array.isArray(h.content)&&h.content.length>0);for(let h of D.content)switch(h.type){case"text":if(!ue){let Z=h.citations??[];if(ne.push({type:"text",text:h.text,...Z.length>0&&{citations:Z.map((A)=>pt(A,Te))},...Z.length>0&&{providerMetadata:{anthropic:{citations:Z}}}}),h.citations)for(let A of h.citations){if(A.type==="web_search_result_location"&&V)continue;let pe=tt(A,Te,this.generateId);if(pe)ne.push(pe)}}break;case"thinking":ne.push({type:"reasoning",text:h.thinking,providerMetadata:{anthropic:{signature:h.signature}}});break;case"redacted_thinking":ne.push({type:"reasoning",text:"",providerMetadata:{anthropic:{redactedData:h.data}}});break;case"container_upload":ne.push({type:"custom",kind:"anthropic.container_upload",providerMetadata:{anthropic:{fileId:h.file_id}}});break;case"compaction":if(!h.content)break;ne.push({type:"text",text:h.content,providerMetadata:{anthropic:{type:"compaction",...h.signature!=null&&{signature:h.signature}}}});break;case"tool_use":if(ue&&h.name==="json")_e=!0,ne.push({type:"text",text:JSON.stringify(h.input)});else if(h.toolset_name!=null)ne.push({type:"tool-call",toolCallId:h.id,toolName:U.toCustomToolName(h.toolset_name),input:JSON.stringify(yt({memberName:h.name,input:h.input})),providerMetadata:{anthropic:{toolsetName:h.toolset_name,...Ae(h.caller).providerMetadata?.anthropic}}});else ne.push({type:"tool-call",toolCallId:h.id,toolName:h.name,input:JSON.stringify(h.input),...Ae(h.caller)});break;case"server_tool_use":if(h.name==="text_editor_code_execution"||h.name==="bash_code_execution")ne.push({type:"tool-call",toolCallId:h.id,toolName:U.toCustomToolName("code_execution"),input:JSON.stringify({type:h.name,...h.input}),providerExecuted:!0,...K?{dynamic:!0}:{},...Ae(h.caller)});else if(h.name==="web_search"||h.name==="code_execution"||h.name==="web_fetch"){let Z=h.name==="code_execution"&&h.input!=null&&typeof h.input==="object"&&"code"in h.input&&!("type"in h.input)?{type:"programmatic-tool-call",...h.input}:h.input;ne.push({type:"tool-call",toolCallId:h.id,toolName:U.toCustomToolName(h.name),input:JSON.stringify(Z),providerExecuted:!0,...K&&h.name==="code_execution"?{dynamic:!0}:{},...Ae(h.caller)})}else if(h.name==="tool_search_tool_regex"||h.name==="tool_search_tool_bm25")he[h.id]=h.name,ne.push({type:"tool-call",toolCallId:h.id,toolName:U.toCustomToolName(h.name),input:JSON.stringify(h.input),providerExecuted:!0,...Ae(h.caller)});else if(h.name==="advisor")ne.push({type:"tool-call",toolCallId:h.id,toolName:U.toCustomToolName("advisor"),input:JSON.stringify(h.input),providerExecuted:!0,...Ae(h.caller)});break;case"mcp_tool_use":ye[h.id]={type:"tool-call",toolCallId:h.id,toolName:h.name,input:JSON.stringify(h.input),providerExecuted:!0,dynamic:!0,providerMetadata:{anthropic:{type:"mcp-tool-use",serverName:h.server_name}}},ne.push(ye[h.id]);break;case"mcp_tool_result":ne.push({type:"tool-result",toolCallId:h.tool_use_id,toolName:ye[h.tool_use_id].toolName,isError:h.is_error,result:h.content,dynamic:!0,providerMetadata:ye[h.tool_use_id].providerMetadata});break;case"web_fetch_tool_result":if(h.content.type==="web_fetch_result")Te.push({title:h.content.content.title??h.content.url,mediaType:h.content.content.source.media_type}),ne.push({type:"tool-result",toolCallId:h.tool_use_id,toolName:U.toCustomToolName("web_fetch"),result:{type:"web_fetch_result",url:h.content.url,retrievedAt:h.content.retrieved_at,content:{type:h.content.content.type,title:h.content.content.title,citations:h.content.content.citations,source:{type:h.content.content.source.type,mediaType:h.content.content.source.media_type,data:h.content.content.source.data}}},...Ae(h.caller)});else if(h.content.type==="web_fetch_tool_result_error")ne.push({type:"tool-result",toolCallId:h.tool_use_id,toolName:U.toCustomToolName("web_fetch"),isError:!0,result:{type:"web_fetch_tool_result_error",errorCode:h.content.error_code},...Ae(h.caller)});break;case"web_search_tool_result":if(Array.isArray(h.content)){ne.push({type:"tool-result",toolCallId:h.tool_use_id,toolName:U.toCustomToolName("web_search"),result:h.content.map((Z)=>({url:Z.url,...Z.title!=null?{title:Z.title}:{},pageAge:Z.page_age??null,encryptedContent:Z.encrypted_content,type:Z.type})),...Ae(h.caller)});for(let Z of h.content)ne.push({type:"source",sourceType:"url",id:this.generateId(),url:Z.url,...Z.title!=null?{title:Z.title}:{},providerMetadata:{anthropic:{pageAge:Z.page_age??null}}})}else ne.push({type:"tool-result",toolCallId:h.tool_use_id,toolName:U.toCustomToolName("web_search"),isError:!0,result:{type:"web_search_tool_result_error",errorCode:h.content.error_code},...Ae(h.caller)});break;case"code_execution_tool_result":if(h.content.type==="code_execution_result")ne.push({type:"tool-result",toolCallId:h.tool_use_id,toolName:U.toCustomToolName("code_execution"),result:{type:h.content.type,stdout:h.content.stdout,stderr:h.content.stderr,return_code:h.content.return_code,content:h.content.content??[]}});else if(h.content.type==="encrypted_code_execution_result")ne.push({type:"tool-result",toolCallId:h.tool_use_id,toolName:U.toCustomToolName("code_execution"),result:{type:h.content.type,encrypted_stdout:h.content.encrypted_stdout,stderr:h.content.stderr,return_code:h.content.return_code,content:h.content.content??[]}});else if(h.content.type==="code_execution_tool_result_error")ne.push({type:"tool-result",toolCallId:h.tool_use_id,toolName:U.toCustomToolName("code_execution"),isError:!0,result:{type:"code_execution_tool_result_error",errorCode:h.content.error_code}});break;case"bash_code_execution_tool_result":case"text_editor_code_execution_tool_result":ne.push({type:"tool-result",toolCallId:h.tool_use_id,toolName:U.toCustomToolName("code_execution"),result:h.content});break;case"tool_search_tool_result":{let Z=he[h.tool_use_id];if(Z==null){let A=U.toCustomToolName("tool_search_tool_bm25"),pe=U.toCustomToolName("tool_search_tool_regex");if(A!=="tool_search_tool_bm25")Z="tool_search_tool_bm25";else if(pe!=="tool_search_tool_regex")Z="tool_search_tool_regex";else Z="tool_search_tool_regex"}if(h.content.type==="tool_search_tool_search_result")ne.push({type:"tool-result",toolCallId:h.tool_use_id,toolName:U.toCustomToolName(Z),result:h.content.tool_references.map((A)=>({type:A.type,toolName:A.tool_name}))});else ne.push({type:"tool-result",toolCallId:h.tool_use_id,toolName:U.toCustomToolName(Z),isError:!0,result:{type:"tool_search_tool_result_error",errorCode:h.content.error_code}});break}case"advisor_tool_result":{let Z=U.toCustomToolName("advisor");if(h.content.type==="advisor_result")ne.push({type:"tool-result",toolCallId:h.tool_use_id,toolName:Z,result:{type:"advisor_result",text:h.content.text,...h.content.stop_reason!=null&&{stopReason:h.content.stop_reason}}});else if(h.content.type==="advisor_redacted_result")ne.push({type:"tool-result",toolCallId:h.tool_use_id,toolName:Z,result:{type:"advisor_redacted_result",encryptedContent:h.content.encrypted_content,...h.content.stop_reason!=null&&{stopReason:h.content.stop_reason}}});else ne.push({type:"tool-result",toolCallId:h.tool_use_id,toolName:Z,isError:!0,result:{type:"advisor_tool_result_error",errorCode:h.content.error_code}});break}case"fallback":ne.push({type:"custom",kind:"anthropic.fallback",providerMetadata:{anthropic:{type:"fallback",from:h.from,to:h.to}}})}return{content:ne,finishReason:{unified:et({finishReason:D.stop_reason,isJsonResponseFromTool:_e}),raw:D.stop_reason??void 0},usage:ht({usage:D.usage}),request:{body:S},response:{id:D.id??void 0,modelId:D.model??void 0,headers:je,body:P},warnings:X,providerMetadata:(()=>{let h=vt(D.stop_details),Z={usage:D.usage,stopSequence:D.stop_sequence??null,...h!=null?{stopDetails:h}:{},...D.input_transformations!=null?{inputTransformations:D.input_transformations}:{},...D.safeguard_results!=null?{safeguardResults:D.safeguard_results}:{},iterations:D.usage.iterations?D.usage.iterations.map((pe)=>({type:pe.type,...pe.model!=null?{model:pe.model}:{},inputTokens:pe.input_tokens,outputTokens:pe.output_tokens,...pe.cache_creation_input_tokens?{cacheCreationInputTokens:pe.cache_creation_input_tokens}:{},...pe.cache_read_input_tokens?{cacheReadInputTokens:pe.cache_read_input_tokens}:{}})):null,container:D.container?{expiresAt:D.container.expires_at,id:D.container.id,skills:D.container.skills?.map((pe)=>({type:pe.type,skillId:pe.skill_id,version:pe.version}))??null}:null,contextManagement:kt(D.context_management)??null},A={anthropic:Z};if(Y&&de!=="anthropic")A[de]=Z;return A})()}}async doStream(_){let g=this.config.headers?await M(this.config.headers):void 0,{args:S,warnings:X,betas:se,usesJsonResponseTool:ue,toolNameMapping:U,providerOptionsName:de,usedCustomProviderKey:Y}=await this.getArgs({..._,stream:!0,userSuppliedBetas:this.getBetasFromHeaders(g,_.headers)}),Te=[...this.extractCitationDocuments(_.prompt)],K=xt(S.tools),je=this.buildRequestUrl(!0),{responseHeaders:D,value:P}=await O({url:je,headers:await this.getHeaders({betas:se,configHeaders:g,headers:_.headers,providerOptions:_.providerOptions}),body:this.transformRequestBody(S,se),failedResponseHandler:ct,successfulResponseHandler:ze(Gt),abortSignal:_.abortSignal,fetch:this.config.fetch}),ne={unified:"other",raw:void 0},ye={input_tokens:0,output_tokens:0,cache_creation_input_tokens:0,cache_read_input_tokens:0,iterations:null},he={},_e={},V={},h=null,Z=void 0,A=null,pe=void 0,Se,ce,f=null,B=!1,be=!1,y=[],Ne=!1,re,L=!1,ge=void 0,k=this.generateId,v=P.pipeThrough(new TransformStream({start(we){we.enqueue({type:"stream-start",warnings:X})},transform(we,q){if(L)return;if(_.includeRawChunks)q.enqueue({type:"raw",rawValue:we.rawValue});if(!we.success){q.enqueue({type:"error",error:we.error});return}let x=we.value;switch(x.type){case"ping":return;case"content_block_start":{let c=x.content_block,ie=c.type;if(ie==="fallback"){q.enqueue({type:"custom",kind:"anthropic.fallback",providerMetadata:{anthropic:{type:"fallback",from:c.from,to:c.to}}});return}switch(ge=ie,ie){case"text":if(ue)return;he[x.index]={type:"text",citations:[]},q.enqueue({type:"text-start",id:String(x.index)});return;case"thinking":he[x.index]={type:"reasoning"},q.enqueue({type:"reasoning-start",id:String(x.index)});return;case"redacted_thinking":he[x.index]={type:"reasoning"},q.enqueue({type:"reasoning-start",id:String(x.index),providerMetadata:{anthropic:{redactedData:c.data}}});return;case"compaction":if(he[x.index]={type:"text",citations:[]},q.enqueue({type:"text-start",id:String(x.index),providerMetadata:{anthropic:{type:"compaction",...c.signature!=null&&{signature:c.signature}}}}),c.signature!=null&&c.content!=null&&c.content!=="")q.enqueue({type:"text-delta",id:String(x.index),delta:c.content});return;case"tool_use":if(ue&&c.name==="json")B=!0,he[x.index]={type:"text",citations:[]},q.enqueue({type:"text-start",id:String(x.index)});else if(c.toolset_name!=null){let R=Ke(c.caller),me=U.toCustomToolName(c.toolset_name),Ue=c.input&&Object.keys(c.input).length>0;he[x.index]={type:"tool-call",toolCallId:c.id,toolName:me,input:Ue?JSON.stringify(c.input):"",firstDelta:!0,toolset:{name:c.toolset_name,memberName:c.name},...R&&{caller:R}},q.enqueue({type:"tool-input-start",id:c.id,toolName:me})}else{let R=Ke(c.caller),me=c.input&&Object.keys(c.input).length>0?JSON.stringify(c.input):"";he[x.index]={type:"tool-call",toolCallId:c.id,toolName:c.name,input:me,firstDelta:me.length===0,...R&&{caller:R}},q.enqueue({type:"tool-input-start",id:c.id,toolName:c.name})}return;case"server_tool_use":{let R=Ke(c.caller);if(["web_fetch","web_search","code_execution","text_editor_code_execution","bash_code_execution"].includes(c.name)){let me=c.name==="text_editor_code_execution"||c.name==="bash_code_execution"?"code_execution":c.name,Ue=c.name==="text_editor_code_execution"||c.name==="bash_code_execution"?c.name:c.name==="code_execution"?"programmatic-tool-call":void 0,Ce=U.toCustomToolName(me),Ie=c.input!=null&&typeof c.input==="object"&&Object.keys(c.input).length>0?JSON.stringify(c.input):"";he[x.index]={type:"tool-call",toolCallId:c.id,toolName:Ce,input:Ie,providerExecuted:!0,...K&&me==="code_execution"?{dynamic:!0}:{},firstDelta:Ie.length===0,providerToolName:me,providerToolInputType:Ue,...R&&{caller:R}},q.enqueue({type:"tool-input-start",id:c.id,toolName:Ce,providerExecuted:!0,...K&&me==="code_execution"?{dynamic:!0}:{}})}else if(c.name==="tool_search_tool_regex"||c.name==="tool_search_tool_bm25"){V[c.id]=c.name;let me=U.toCustomToolName(c.name);he[x.index]={type:"tool-call",toolCallId:c.id,toolName:me,input:"",providerExecuted:!0,firstDelta:!0,providerToolName:c.name,...R&&{caller:R}},q.enqueue({type:"tool-input-start",id:c.id,toolName:me,providerExecuted:!0})}else if(c.name==="advisor"){let me=U.toCustomToolName("advisor");he[x.index]={type:"tool-call",toolCallId:c.id,toolName:me,input:"{}",providerExecuted:!0,firstDelta:!0,providerToolName:c.name,...R&&{caller:R}},q.enqueue({type:"tool-input-start",id:c.id,toolName:me,providerExecuted:!0})}return}case"web_fetch_tool_result":if(c.content.type==="web_fetch_result")Te.push({title:c.content.content.title??c.content.url,mediaType:c.content.content.source.media_type}),q.enqueue({type:"tool-result",toolCallId:c.tool_use_id,toolName:U.toCustomToolName("web_fetch"),result:{type:"web_fetch_result",url:c.content.url,retrievedAt:c.content.retrieved_at,content:{type:c.content.content.type,title:c.content.content.title,citations:c.content.content.citations,source:{type:c.content.content.source.type,mediaType:c.content.content.source.media_type,data:c.content.content.source.data}}},...Ae(c.caller)});else if(c.content.type==="web_fetch_tool_result_error")q.enqueue({type:"tool-result",toolCallId:c.tool_use_id,toolName:U.toCustomToolName("web_fetch"),isError:!0,result:{type:"web_fetch_tool_result_error",errorCode:c.content.error_code},...Ae(c.caller)});return;case"web_search_tool_result":if(Array.isArray(c.content)){q.enqueue({type:"tool-result",toolCallId:c.tool_use_id,toolName:U.toCustomToolName("web_search"),result:c.content.map((R)=>({url:R.url,...R.title!=null?{title:R.title}:{},pageAge:R.page_age??null,encryptedContent:R.encrypted_content,type:R.type})),...Ae(c.caller)});for(let R of c.content)be=!0,q.enqueue({type:"source",sourceType:"url",id:k(),url:R.url,...R.title!=null?{title:R.title}:{},providerMetadata:{anthropic:{pageAge:R.page_age??null}}})}else q.enqueue({type:"tool-result",toolCallId:c.tool_use_id,toolName:U.toCustomToolName("web_search"),isError:!0,result:{type:"web_search_tool_result_error",errorCode:c.content.error_code},...Ae(c.caller)});return;case"code_execution_tool_result":if(c.content.type==="code_execution_result")q.enqueue({type:"tool-result",toolCallId:c.tool_use_id,toolName:U.toCustomToolName("code_execution"),result:{type:c.content.type,stdout:c.content.stdout,stderr:c.content.stderr,return_code:c.content.return_code,content:c.content.content??[]}});else if(c.content.type==="encrypted_code_execution_result")q.enqueue({type:"tool-result",toolCallId:c.tool_use_id,toolName:U.toCustomToolName("code_execution"),result:{type:c.content.type,encrypted_stdout:c.content.encrypted_stdout,stderr:c.content.stderr,return_code:c.content.return_code,content:c.content.content??[]}});else if(c.content.type==="code_execution_tool_result_error")q.enqueue({type:"tool-result",toolCallId:c.tool_use_id,toolName:U.toCustomToolName("code_execution"),isError:!0,result:{type:"code_execution_tool_result_error",errorCode:c.content.error_code}});return;case"bash_code_execution_tool_result":case"text_editor_code_execution_tool_result":q.enqueue({type:"tool-result",toolCallId:c.tool_use_id,toolName:U.toCustomToolName("code_execution"),result:c.content});return;case"tool_search_tool_result":{let R=V[c.tool_use_id];if(R==null){let me=U.toCustomToolName("tool_search_tool_bm25"),Ue=U.toCustomToolName("tool_search_tool_regex");if(me!=="tool_search_tool_bm25")R="tool_search_tool_bm25";else if(Ue!=="tool_search_tool_regex")R="tool_search_tool_regex";else R="tool_search_tool_regex"}if(c.content.type==="tool_search_tool_search_result")q.enqueue({type:"tool-result",toolCallId:c.tool_use_id,toolName:U.toCustomToolName(R),result:c.content.tool_references.map((me)=>({type:me.type,toolName:me.tool_name}))});else q.enqueue({type:"tool-result",toolCallId:c.tool_use_id,toolName:U.toCustomToolName(R),isError:!0,result:{type:"tool_search_tool_result_error",errorCode:c.content.error_code}});return}case"advisor_tool_result":{let R=U.toCustomToolName("advisor");if(c.content.type==="advisor_result")q.enqueue({type:"tool-result",toolCallId:c.tool_use_id,toolName:R,result:{type:"advisor_result",text:c.content.text,...c.content.stop_reason!=null&&{stopReason:c.content.stop_reason}}});else if(c.content.type==="advisor_redacted_result")q.enqueue({type:"tool-result",toolCallId:c.tool_use_id,toolName:R,result:{type:"advisor_redacted_result",encryptedContent:c.content.encrypted_content,...c.content.stop_reason!=null&&{stopReason:c.content.stop_reason}}});else q.enqueue({type:"tool-result",toolCallId:c.tool_use_id,toolName:R,isError:!0,result:{type:"advisor_tool_result_error",errorCode:c.content.error_code}});return}case"mcp_tool_use":_e[c.id]={type:"tool-call",toolCallId:c.id,toolName:c.name,input:JSON.stringify(c.input),providerExecuted:!0,dynamic:!0,providerMetadata:{anthropic:{type:"mcp-tool-use",serverName:c.server_name}}},q.enqueue(_e[c.id]);return;case"mcp_tool_result":q.enqueue({type:"tool-result",toolCallId:c.tool_use_id,toolName:_e[c.tool_use_id].toolName,isError:c.is_error,result:c.content,dynamic:!0,providerMetadata:_e[c.tool_use_id].providerMetadata});return;default:throw Error(`Unsupported content block type: ${ie}`)}}case"content_block_stop":if(he[x.index]!=null){let c=he[x.index];switch(c.type){case"text":q.enqueue({type:"text-end",id:String(x.index),...c.citations.length>0&&{citations:c.citations.map((ie)=>pt(ie,Te)),providerMetadata:{anthropic:{citations:c.citations}}}});break;case"reasoning":q.enqueue({type:"reasoning-end",id:String(x.index)});break;case"tool-call":if(!(ue&&c.toolName==="json")){if(c.toolset!=null){let R={};try{R=c.input===""?{}:Qe(c.input)}catch{R=void 0}c.input=R===void 0?c.input:JSON.stringify(yt({memberName:c.toolset.memberName,input:R})),q.enqueue({type:"tool-input-delta",id:c.toolCallId,delta:c.input})}q.enqueue({type:"tool-input-end",id:c.toolCallId});let ie=c.input===""?"{}":c.input;if(c.providerToolName==="code_execution")try{let R=Qe(ie);if(R!=null&&typeof R==="object"&&"code"in R&&!("type"in R))ie=JSON.stringify({type:"programmatic-tool-call",...R})}catch{}q.enqueue({type:"tool-call",toolCallId:c.toolCallId,toolName:c.toolName,input:ie,providerExecuted:c.providerExecuted,...K&&c.providerToolName==="code_execution"?{dynamic:!0}:{},...(c.caller||c.toolset)&&{providerMetadata:{anthropic:{...c.toolset&&{toolsetName:c.toolset.name},...c.caller&&{caller:c.caller}}}}})}}delete he[x.index]}ge=void 0;return;case"content_block_delta":{let c=x.delta.type;switch(c){case"text_delta":if(ue)return;q.enqueue({type:"text-delta",id:String(x.index),delta:x.delta.text});return;case"thinking_delta":q.enqueue({type:"reasoning-delta",id:String(x.index),delta:x.delta.thinking});return;case"signature_delta":if(ge==="thinking")q.enqueue({type:"reasoning-delta",id:String(x.index),delta:"",providerMetadata:{anthropic:{signature:x.delta.signature}}});return;case"compaction_delta":if(x.delta.content!=null)q.enqueue({type:"text-delta",id:String(x.index),delta:x.delta.content});return;case"input_json_delta":{let ie=he[x.index],R=x.delta.partial_json;if(R.length===0)return;if(B){if(ie?.type!=="text")return;q.enqueue({type:"text-delta",id:String(x.index),delta:R})}else{if(ie?.type!=="tool-call")return;if(ie.toolset!=null){ie.input+=R;return}if(ie.firstDelta&&ie.providerToolInputType!=null)R=`{"type": "${ie.providerToolInputType}",${R.substring(1)}`;q.enqueue({type:"tool-input-delta",id:ie.toolCallId,delta:R}),ie.input+=R,ie.firstDelta=!1}return}case"citations_delta":{let ie=x.delta.citation,R=he[x.index];if(R?.type==="text")R.citations.push(ie);if(ie.type==="web_search_result_location")y.push(ie);else{let me=tt(ie,Te,k);if(me)q.enqueue(me)}return}default:throw Error(`Unsupported delta type: ${c}`)}}case"message_start":if(Ne){if(re===x.message.id)return;L=!0,q.enqueue({type:"error",error:new ve({data:x,message:`Received message_start for message ${JSON.stringify(x.message.id)} while message ${JSON.stringify(re)} is still open.`})});return}if(Ne=!0,re=x.message.id,ye.input_tokens=x.message.usage.input_tokens,ye.cache_read_input_tokens=x.message.usage.cache_read_input_tokens??0,ye.cache_creation_input_tokens=x.message.usage.cache_creation_input_tokens??0,Z={...x.message.usage},x.message.input_transformations!=null)Se=x.message.input_transformations;if(x.message.container!=null)f={expiresAt:x.message.container.expires_at,id:x.message.container.id,skills:null};if(x.message.stop_reason!=null)ne={unified:et({finishReason:x.message.stop_reason,isJsonResponseFromTool:B}),raw:x.message.stop_reason};if(q.enqueue({type:"response-metadata",id:x.message.id??void 0,modelId:x.message.model??void 0}),q.enqueue({type:"custom",kind:"anthropic.message_start",providerMetadata:{anthropic:{id:x.message.id??null,model:x.message.model??null,usage:Z}}}),x.message.content!=null)for(let c=0;c<x.message.content.length;c++){let ie=x.message.content[c];if(ie.type==="tool_use"){let R=Ke(ie.caller);q.enqueue({type:"tool-input-start",id:ie.id,toolName:ie.name});let me=JSON.stringify(ie.input??{});q.enqueue({type:"tool-input-delta",id:ie.id,delta:me}),q.enqueue({type:"tool-input-end",id:ie.id}),q.enqueue({type:"tool-call",toolCallId:ie.id,toolName:ie.name,input:me,...R&&{providerMetadata:{anthropic:{caller:R}}}})}}return;case"message_delta":if(x.usage.input_tokens!=null&&ye.input_tokens!==x.usage.input_tokens)ye.input_tokens=x.usage.input_tokens;if(ye.output_tokens=x.usage.output_tokens,x.usage.output_tokens_details!=null)ye.output_tokens_details=x.usage.output_tokens_details;if(x.usage.cache_read_input_tokens!=null)ye.cache_read_input_tokens=x.usage.cache_read_input_tokens;if(x.usage.cache_creation_input_tokens!=null)ye.cache_creation_input_tokens=x.usage.cache_creation_input_tokens;if(x.usage.iterations!=null)ye.iterations=x.usage.iterations;if(ne={unified:et({finishReason:x.delta.stop_reason,isJsonResponseFromTool:B}),raw:x.delta.stop_reason??void 0},A=x.delta.stop_sequence??null,pe=vt(x.delta.stop_details),f=x.delta.container!=null?{expiresAt:x.delta.container.expires_at,id:x.delta.container.id,skills:x.delta.container.skills?.map((c)=>({type:c.type,skillId:c.skill_id,version:c.version}))??null}:null,x.context_management)h=kt(x.context_management);if(x.input_transformations!=null)Se=x.input_transformations;if(x.delta.safeguard_results!=null)ce=x.delta.safeguard_results;Z={...Z,...x.usage};return;case"message_stop":{Ne=!1,re=void 0;let c={usage:Z??null,stopSequence:A,...pe!=null?{stopDetails:pe}:{},...Se!=null?{inputTransformations:Se}:{},...ce!=null?{safeguardResults:ce}:{},iterations:ye.iterations?ye.iterations.map((R)=>({type:R.type,...R.model!=null?{model:R.model}:{},inputTokens:R.input_tokens,outputTokens:R.output_tokens,...R.cache_creation_input_tokens?{cacheCreationInputTokens:R.cache_creation_input_tokens}:{},...R.cache_read_input_tokens?{cacheReadInputTokens:R.cache_read_input_tokens}:{}})):null,container:f,contextManagement:h},ie={anthropic:c};if(Y&&de!=="anthropic")ie[de]=c;if(!be)for(let R of y){let me=tt(R,Te,k);if(me)q.enqueue(me)}y.length=0,q.enqueue({type:"finish",finishReason:ne,usage:ht({usage:ye,rawUsage:Z}),providerMetadata:ie});return}case"error":q.enqueue({type:"error",error:pn(x.error)});return;default:throw Error(`Unsupported chunk type: ${x}`)}}})),xe=!1,He=!1,Le,[Je,Ve]=v.pipeThrough(new TransformStream({transform(we,q){switch(we.type){case"response-metadata":xe=!1;break;case"finish":xe=!1,Le=we;break;case"error":He=!0;break;case"text-delta":case"reasoning-delta":case"tool-input-delta":xe||=we.delta.length>0;break;case"tool-call":xe=!0}q.enqueue(we)},flush(we){if(xe&&!He)we.enqueue({type:"finish",finishReason:{unified:"interrupted",raw:void 0},usage:Le?.usage??{inputTokens:{total:void 0,noCache:void 0,cacheRead:void 0,cacheWrite:void 0},outputTokens:{total:void 0,text:void 0,reasoning:void 0}},...Le?.providerMetadata!=null?{providerMetadata:Le.providerMetadata}:{}})}})).tee(),$e=Je.getReader();try{await $e.read();let we=await $e.read();if(we.value?.type==="raw")we=await $e.read();if(we.value?.type==="error"){let q=we.value.error;if(!bc(q))throw Error("Expected a normalized Anthropic stream error");throw new N({message:q.message,url:je,requestBodyValues:S,statusCode:q.statusCode??500,responseHeaders:D,responseBody:JSON.stringify(q.data),isRetryable:q.isRetryable??!1})}}finally{$e.cancel().catch(()=>{}),$e.releaseLock()}return{stream:Ve,request:{body:S},response:{headers:D}}}};function Hm(i){if(i.includes("claude-sonnet-5-5"))return{maxOutputTokens:128000,supportsStructuredOutput:!0,supportsAdaptiveThinking:!0,rejectsSamplingParameters:!0,supportsXhighEffort:!0,rejectsThinkingDisabledAboveHighEffort:!0,rejectsThinkingDisabled:!0,rejectsBudgetThinking:!0,rejectsForcedToolUse:!0,supportsBetweenToolsThinking:!0,isKnownModel:!0};else if(i.includes("claude-opus-5-5"))return{maxOutputTokens:128000,supportsStructuredOutput:!0,supportsAdaptiveThinking:!0,rejectsSamplingParameters:!0,supportsXhighEffort:!0,rejectsThinkingDisabledAboveHighEffort:!0,rejectsThinkingDisabled:!0,rejectsBudgetThinking:!0,rejectsForcedToolUse:!0,supportsBetweenToolsThinking:!1,isKnownModel:!0};else if(i.includes("claude-haiku-5-5"))return{maxOutputTokens:128000,supportsStructuredOutput:!0,supportsAdaptiveThinking:!0,rejectsSamplingParameters:!0,supportsXhighEffort:!0,rejectsThinkingDisabledAboveHighEffort:!0,rejectsThinkingDisabled:!1,rejectsBudgetThinking:!0,rejectsForcedToolUse:!1,supportsBetweenToolsThinking:!1,isKnownModel:!0};else if(i.includes("claude-opus-5"))return{maxOutputTokens:128000,supportsStructuredOutput:!0,supportsAdaptiveThinking:!0,rejectsSamplingParameters:!0,supportsXhighEffort:!0,rejectsThinkingDisabledAboveHighEffort:!0,rejectsThinkingDisabled:!1,rejectsBudgetThinking:!1,rejectsForcedToolUse:!1,supportsBetweenToolsThinking:!1,isKnownModel:!0};else if(i.includes("claude-fable-5-1"))return{maxOutputTokens:128000,supportsStructuredOutput:!0,supportsAdaptiveThinking:!0,rejectsSamplingParameters:!0,supportsXhighEffort:!0,rejectsThinkingDisabledAboveHighEffort:!1,rejectsThinkingDisabled:!0,rejectsBudgetThinking:!0,rejectsForcedToolUse:!0,supportsBetweenToolsThinking:!1,isKnownModel:!0};else if(i.includes("claude-fable-5"))return{maxOutputTokens:128000,supportsStructuredOutput:!0,supportsAdaptiveThinking:!0,rejectsSamplingParameters:!0,supportsXhighEffort:!0,rejectsThinkingDisabledAboveHighEffort:!1,rejectsThinkingDisabled:!0,rejectsBudgetThinking:!0,rejectsForcedToolUse:!1,supportsBetweenToolsThinking:!1,isKnownModel:!0};else if(i.includes("claude-opus-4-8")||i.includes("claude-opus-4-7")||i.includes("claude-sonnet-5"))return{maxOutputTokens:128000,supportsStructuredOutput:!0,supportsAdaptiveThinking:!0,rejectsSamplingParameters:!0,supportsXhighEffort:!0,rejectsThinkingDisabledAboveHighEffort:!1,rejectsThinkingDisabled:!1,rejectsBudgetThinking:!1,rejectsForcedToolUse:!1,supportsBetweenToolsThinking:!1,isKnownModel:!0};else if(i.includes("claude-sonnet-4-6")||i.includes("claude-opus-4-6"))return{maxOutputTokens:128000,supportsStructuredOutput:!0,supportsAdaptiveThinking:!0,rejectsSamplingParameters:!1,supportsXhighEffort:!1,rejectsThinkingDisabledAboveHighEffort:!1,rejectsThinkingDisabled:!1,rejectsBudgetThinking:!1,rejectsForcedToolUse:!1,supportsBetweenToolsThinking:!1,isKnownModel:!0};else if(i.includes("claude-sonnet-4-5")||i.includes("claude-opus-4-5")||i.includes("claude-haiku-4-5"))return{maxOutputTokens:64000,supportsStructuredOutput:!0,supportsAdaptiveThinking:!1,rejectsSamplingParameters:!1,supportsXhighEffort:!1,rejectsThinkingDisabledAboveHighEffort:!1,rejectsThinkingDisabled:!1,rejectsBudgetThinking:!1,rejectsForcedToolUse:!1,supportsBetweenToolsThinking:!1,isKnownModel:!0};else if(i.includes("claude-opus-4-1"))return{maxOutputTokens:32000,supportsStructuredOutput:!0,supportsAdaptiveThinking:!1,rejectsSamplingParameters:!1,supportsXhighEffort:!1,rejectsThinkingDisabledAboveHighEffort:!1,rejectsThinkingDisabled:!1,rejectsBudgetThinking:!1,rejectsForcedToolUse:!1,supportsBetweenToolsThinking:!1,isKnownModel:!0};else if(/claude-sonnet-4(?:-|@)/.test(i))return{maxOutputTokens:64000,supportsStructuredOutput:!1,supportsAdaptiveThinking:!1,rejectsSamplingParameters:!1,supportsXhighEffort:!1,rejectsThinkingDisabledAboveHighEffort:!1,rejectsThinkingDisabled:!1,rejectsBudgetThinking:!1,rejectsForcedToolUse:!1,supportsBetweenToolsThinking:!1,isKnownModel:!0};else if(/claude-opus-4(?:-|@)/.test(i))return{maxOutputTokens:32000,supportsStructuredOutput:!1,supportsAdaptiveThinking:!1,rejectsSamplingParameters:!1,supportsXhighEffort:!1,rejectsThinkingDisabledAboveHighEffort:!1,rejectsThinkingDisabled:!1,rejectsBudgetThinking:!1,rejectsForcedToolUse:!1,supportsBetweenToolsThinking:!1,isKnownModel:!0};else if(i.includes("claude-3-haiku"))return{maxOutputTokens:4096,supportsStructuredOutput:!1,supportsAdaptiveThinking:!1,rejectsSamplingParameters:!1,supportsXhighEffort:!1,rejectsThinkingDisabledAboveHighEffort:!1,rejectsThinkingDisabled:!1,rejectsBudgetThinking:!1,rejectsForcedToolUse:!1,supportsBetweenToolsThinking:!1,isKnownModel:!0};else if(/claude-(?:instant(?:-|$)|v?2(?=$|[-.:])|3(?=$|[-.]))/.test(i))return{maxOutputTokens:4096,supportsStructuredOutput:!1,supportsAdaptiveThinking:!1,rejectsSamplingParameters:!1,supportsXhighEffort:!1,rejectsThinkingDisabledAboveHighEffort:!1,rejectsThinkingDisabled:!1,rejectsBudgetThinking:!1,rejectsForcedToolUse:!1,supportsBetweenToolsThinking:!1,isKnownModel:!1};else if(i.includes("claude-"))return{maxOutputTokens:128000,supportsStructuredOutput:!0,supportsAdaptiveThinking:!0,rejectsSamplingParameters:!0,supportsXhighEffort:!0,rejectsThinkingDisabledAboveHighEffort:!0,rejectsThinkingDisabled:!1,rejectsBudgetThinking:!1,rejectsForcedToolUse:!1,supportsBetweenToolsThinking:!1,isKnownModel:!1};else return{maxOutputTokens:4096,supportsStructuredOutput:!1,supportsAdaptiveThinking:!1,rejectsSamplingParameters:!1,supportsXhighEffort:!1,rejectsThinkingDisabledAboveHighEffort:!1,rejectsThinkingDisabled:!1,rejectsBudgetThinking:!1,rejectsForcedToolUse:!1,supportsBetweenToolsThinking:!1,isKnownModel:!1}}function xt(i){if(!i)return!1;let _=!1,g=!1;for(let S of i){if("type"in S&&(S.type==="web_fetch_20260209"||S.type==="web_fetch_20260318"||S.type==="web_search_20260209"||S.type==="web_search_20260318")){_=!0;continue}if("type"in S&&(S.type==="code_execution_20250522"||S.type==="code_execution_20250825"||S.type==="code_execution_20260120")){g=!0;break}}return _&&!g}function hn({reasoning:i,modelId:_,supportsAdaptiveThinking:g,supportsXhighEffort:S,rejectsThinkingDisabled:X,supportsBetweenToolsThinking:se,maxOutputTokensForModel:ue,warnings:U}){if(!Pe(i))return;if(i==="none"){if(se)return U.push({type:"compatibility",feature:"reasoning",details:`reasoning 'none' is not supported by ${_}; thinking cannot be disabled. Using 'between_tools' thinking, the lowest thinking setting, instead.`}),{thinking:{type:"between_tools"}};if(X)return U.push({type:"compatibility",feature:"reasoning",details:`reasoning 'none' is not supported by ${_}; it always uses adaptive thinking. Using effort 'low' to minimize thinking instead.`}),{effort:"low"};return{thinking:{type:"disabled"}}}if(g)return{thinking:{type:"adaptive",display:"summarized"},effort:ut({reasoning:i,effortMap:{low:"low",medium:"medium",high:"high",...S&&{xhigh:"xhigh"},max:"max"},warnings:U})};return{thinking:{type:"enabled",budgetTokens:nn({reasoning:i,maxOutputTokens:ue,maxReasoningBudget:ue,warnings:U})}}}function kt(i){return i?{appliedEdits:i.applied_edits.map((_)=>{switch(_.type){case"clear_tool_uses_20250919":return{type:_.type,clearedToolUses:_.cleared_tool_uses,clearedInputTokens:_.cleared_input_tokens};case"clear_thinking_20251015":return{type:_.type,clearedThinkingTurns:_.cleared_thinking_turns,clearedInputTokens:_.cleared_input_tokens};case"compact_20260112":return{type:_.type}}}).filter((_)=>_!==void 0)}:null}function vt(i){if(i==null)return;return{type:i.type,...i.category!=null?{category:i.category}:{},...i.explanation!=null?{explanation:i.explanation}:{},...i.recommended_model!=null?{recommendedModel:i.recommended_model}:{}}}var mn=u(()=>l(t({command:e(),restart:r().optional()}))),wt=Re({id:"anthropic.bash_20241022",inputSchema:mn});function gn(i={}){let{execute:_,...g}=i;if(_===void 0)return wt({...g,execute:async({command:S},{abortSignal:X,experimental_sandbox:se})=>{if(!se)throw Error("Sandbox session is not available");return await se.run({command:S,abortSignal:X})}});return wt({...g,..._===null?{}:{execute:_}})}var fn=u(()=>l(t({command:e(),restart:r().optional()}))),jt=Re({id:"anthropic.bash_20250124",inputSchema:fn});function yn(i={}){let{execute:_,...g}=i;if(_===void 0)return jt({...g,execute:async({command:S},{abortSignal:X,experimental_sandbox:se})=>{if(!se)throw Error("Sandbox session is not available");return await se.run({command:S,abortSignal:X})}});return jt({...g,..._===null?{}:{execute:_}})}var bn=u(()=>l(t({action:s(["key","type","mouse_move","left_click","left_click_drag","right_click","middle_click","double_click","screenshot","cursor_position"]),coordinate:o(n().int()).optional(),text:e().optional()}))),xn=Re({id:"anthropic.computer_20241022",inputSchema:bn}),kn=u(()=>l(t({action:s(["key","hold_key","type","cursor_position","mouse_move","left_mouse_down","left_mouse_up","left_click","left_click_drag","right_click","middle_click","double_click","triple_click","scroll","wait","screenshot"]),coordinate:W([n().int(),n().int()]).optional(),duration:n().optional(),scroll_amount:n().optional(),scroll_direction:s(["up","down","left","right"]).optional(),start_coordinate:W([n().int(),n().int()]).optional(),text:e().optional()}))),vn=Re({id:"anthropic.computer_20250124",inputSchema:kn}),wn=u(()=>l(t({action:s(["key","hold_key","type","cursor_position","mouse_move","left_mouse_down","left_mouse_up","left_click","left_click_drag","right_click","middle_click","double_click","triple_click","scroll","wait","screenshot","zoom"]),coordinate:W([n().int(),n().int()]).optional(),duration:n().optional(),region:W([n().int(),n().int(),n().int(),n().int()]).optional(),scroll_amount:n().optional(),scroll_direction:s(["up","down","left","right"]).optional(),start_coordinate:W([n().int(),n().int()]).optional(),text:e().optional()}))),jn=Re({id:"anthropic.computer_20251124",inputSchema:wn}),Tn=u(()=>l(w("command",[t({command:a("view"),path:e(),view_range:W([n(),n()]).optional()}),t({command:a("create"),path:e(),file_text:e()}),t({command:a("str_replace"),path:e(),old_str:e(),new_str:e()}),t({command:a("insert"),path:e(),insert_line:n(),insert_text:e()}),t({command:a("delete"),path:e()}),t({command:a("rename"),old_path:e(),new_path:e()})]))),Cn=Re({id:"anthropic.memory_20250818",inputSchema:Tn}),Sn=u(()=>l(t({command:s(["view","create","str_replace","insert","undo_edit"]),path:e(),file_text:e().optional(),insert_line:n().int().optional(),new_str:e().optional(),insert_text:e().optional(),old_str:e().optional(),view_range:o(n().int()).optional()}))),Nn=Re({id:"anthropic.text_editor_20241022",inputSchema:Sn}),On=u(()=>l(t({command:s(["view","create","str_replace","insert","undo_edit"]),path:e(),file_text:e().optional(),insert_line:n().int().optional(),new_str:e().optional(),insert_text:e().optional(),old_str:e().optional(),view_range:o(n().int()).optional()}))),In=Re({id:"anthropic.text_editor_20250124",inputSchema:On}),An=u(()=>l(t({command:s(["view","create","str_replace","insert"]),path:e(),file_text:e().optional(),insert_line:n().int().optional(),new_str:e().optional(),insert_text:e().optional(),old_str:e().optional(),view_range:o(n().int()).optional()}))),En=Re({id:"anthropic.text_editor_20250429",inputSchema:An}),Rn=u(()=>l(o(t({type:a("tool_reference"),toolName:e()})))),Mn=u(()=>l(t({query:e(),limit:n().optional()}))),Dn=G({id:"anthropic.tool_search_bm25_20251119",inputSchema:Mn,outputSchema:Rn,supportsDeferredResults:!0}),$n=(i={})=>Dn(i),Oi={advisor_20260301:no,bash_20241022:gn,bash_20250124:yn,codeExecution_20250522:Jo,codeExecution_20250825:Ko,codeExecution_20260120:Go,computer_20241022:xn,computer_20250124:vn,computer_20251124:jn,computerToolset_20260801:ao,memory_20250818:Cn,textEditor_20241022:Nn,textEditor_20250124:In,textEditor_20250429:En,textEditor_20250728:uo,webFetch_20250910:Fo,webFetch_20260209:Uo,webFetch_20260318:Ao,webSearch_20250305:To,webSearch_20260209:ko,webSearch_20260318:go,toolSearchRegex_20251119:Qo,toolSearchBm25_20251119:$n},Wn=u(()=>l(t({id:e(),display_title:e().nullish(),name:e().nullish(),description:e().nullish(),latest_version:e().nullish(),source:e(),created_at:e(),updated_at:e()})));u(()=>l(t({data:o(t({version:e()}))})));var Kn=u(()=>l(t({type:e(),skill_id:e(),name:e().nullish(),description:e().nullish()})));
|
|
3
|
+
export{wy,Ty,Bw,Hm,Oi};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{JT,XT,J2,X2,ZT,su,cu,Dc,fd,Mc,e_,lu,t_,Z2,ex,Gh,Vh,tx,ix,tc,nx,ax,i_,ox,rx,sx,cx,yd,lx,Kh,ux,px,dx,ue,Hh,mt,$e,ci,mx,n_,a_,o_,r_,s_,c_,l_,u_,p_,d_,m_,h_,g_,f_,y_,ic,bd,uu,x_,hx,wd,gx,fx,yx,b_,xx,v_,bx,Qh,pu,vx,du,Qt,Wc,wx,Yh,Jh,Nc,Tx,Td,_x,kx,w_,Ix,T_,Xh,Sx,Ex,mu,_d,kd,Zh,nc,e0,Id,t0,i0,Sd,Ed,n0,Rd,Rx,a0,__,k_,Ax,I_,S_,o0,E_,da,ht,hu,Ox,R_,A_,Cx,Px,Dx,Mx,Wx,Nx,Lx,Ux,li,gu,O_,C_,Bx,r0,s0,fu,P_,Fx,c0,D_,yu,M_,W_,jx,$x,qx,l0,N_,L_,u0,p0,zx,Gx,Vx,Kx,Hx,Qx,Yx,Jx,Xx,Zx,xu,e1,t1,ac,U_,B_,d0,Ad,m0,h0,g0,f0,Od,F_,y0,x0,b0,Cd,Pd,i1,bu,v0,w0,T0,Dd,vu,_0,n1,a1,o1,r1,s1,c1,l1,u1,p1,d1,k0,I0,S0,vi,E0,Md,m1,j_,wu,$_,Lc,R0,Wd,Nd,A0,h1,g1,O0,Se,f1,y1,x1,b1,C0,Ld,q_,v1,w1,T1,Uc,z_,G_,V_,P0,D0,M0,W0,_1,k1,Ud,K_,I1,N0,Tu,H_,Q_,Y_,S1,J_,L0,E1,Bd,X_,Z_,U0,B0,Fd,F0,R1,jd,ek,A1,$d,tk,j0,O1,ik,C1,P1,$0,nk,qd,q0,Qr,zd,_u,Yr,ak,D1,M1,Bc,z0,G0,W1,ku,V0,N1,L1,ok,U1,oc,K0,Iu,Gd,Vd,Kd,Fc,rk,Ui,H0,rc,B1,Q0,jc,sc,Y0,F1,sk,j1,$1,q1,z1,Hd,G1,Su,ck,cc,$c,lk,V1,qc,J0,uk,K1,H1,Q1,Eu,pk,Yt,Y1,lc,J1,Ru,Jr,zc,ma,X0,dk,Au,Z0,eg,Ou,uc,Qd,X1,Z1,tg,Yd,Gc,Cu,ig,Pu,ng,Du,mk,Vc,eb,Jd,tb,ib,nb,ab,ob,rb,sb,cb,ag,Mu,og,lb,ln,Bi,rg,hk,ub,pb,sg,Xd,Go,cg,db,gk,mb,fk,hb,Vo,Kc,Wu,Zd,em,lg,gb,fb,yb,yk,ug,xb,bb,vb,Nu,xk,bk,vk,wk,Tk,_k,tm,wb,kk,Ik,Sk,Ek,Rk,Ak,Ok,Ck,Pk,Tb,Dk,_b,kb,pg,Ib,Sb,dg,im,Lu,Mk,Eb,Rb,Ab,mg,hg,nm,Ob,Wk,Nk,gg,am,fg,Lk,Cb,yg,Pb,om,Db,xg,Mb,ha,rm,bg,Wb,vg,Uu,Uk,Nb,wg,Lb,Ub,Bb,Fb,Tg,jb,Bk,$b,_g,kg,Bu,qb,sm,zb,cm,Gb,Vb,Kb,Hb,Qb,Yb,Ig,Fk,jk,Jb,$k,Xb,Zb,qk,ev,Sg,Hc,Eg,tv,iv,Rg,nv,Fu,Ag,Og,Fi,Qc,zk,av,Gk,Vk,Kk,Hk,Qk,Cg,Pg,Dg,Mg,Yk,ov,Wg,Jk,Xk,Ng,rv,sv,cv,lv,Lg,uv,pv,dv,Zk,mv,lm,hv,Ug,gv,Bg,Fg,eI,jg,fv,yv,Yc,$g,qg,um,zg,xv,Gg,bv,tI,iI,nI,aI,oI,rI,vv,wv,Tv,sI,cI,_v,lI,kv,Iv,uI,Sv,pI,Vg,Ev,Kg,Hg,Qg,Rv,Av,Ov,dI,Cv,Pv,Dv,mI,hI,Mv,Wv,Nv,Lv,Uv,Bv,Fv,gI,fI,yI,xI,jv,$v,qv,bI,vI,wI,Yg,TI,_I}from"./index-8zb5grad.js";import{Cn,zv}from"./index-yjbp9r76.js";import"./index-d4pbedxj.js";import"./index-9g67p34k.js";import"./index-418gvd4a.js";import"./index-3qy7846d.js";import"./index-6dpcn5cw.js";import{hm,fm,Nt,Ge,Lt,Ti,nf,af,va,of,xe,me,Un,he,Ke,Jc,$u,qu,df,Gn,Vv,U,vf,wf,Tf,Tr,kI,el,tl,mn,k,za,Im,zu,et,Sm,Hi,gt,$t,Ga,If,Sf,Kv,Va,Hv,Qv,Rt,Ef,Si,Z,He,hn,Qn,Ts,Gu,be,Vu,Ka,Ha,Qa,Rf,Af,Ya,Of,Em,Dt,Ja,Yv,Xa,ei,gn,Cf,Za,Yn,Pf,Df,to,Ku,Jn,il,Qi,ti,Rr,Jv,tt,Ar,Qu,Yu,ks,Ju,Is,Ss,Es,Am,Om,Cm,Pm,nl,al,Dm,ol,rl,Mm,Wm,sw}from"./index-ffna8yzn.js";import"./index-hkmarmve.js";import"./index-a9d2sjh0.js";import"./index-sdvqs19c.js";import"./index-gevnedsc.js";import"./index-f25bf131.js";import"./index-f4rfmj6q.js";import"./index-5hwscy9s.js";import"./index-cyyvppz9.js";import"./index-kqacxn3s.js";import"./index-p5k5hnam.js";import"./index-ztb3cjfh.js";import"./index-ddwn220p.js";import"./index-w9n2kgjk.js";export{Lg as ADOPTED_POLL_INTERVAL_MS,gt as AGENTS_RULES_FILE_NAME,Im as AGENT_CONFIG_DIRECTORY_NAME,Ad as AGENT_PLUGINS_V1_MANIFEST_SCHEMA,m0 as AGENT_PLUGINS_V1_MCP_SCHEMA,$t as AGENT_PLUGIN_MANIFEST_FILE_NAME,E0 as ALL_DEFAULT_TOOL_NAMES,Og as AgendaTaskManager,Fu as AgendaTaskRevisionConflictError,Rg as AgendaTaskSpecFileStore,zv as Agent,cb as AgentTeam,ag as AgentTeamsRuntime,Vx as AuthSettingsSchema,Hx as AwsSettingsSchema,Yx as AzureSettingsSchema,l0 as BUILT_IN_PROVIDER,N_ as BUILT_IN_PROVIDER_IDS,$g as BrowserWebSocketHubAdapter,tl as CLINE_CHAT_WORKSPACE_DIRECTORY_NAME,Sf as CLINE_CONNECTOR_SETTINGS_FILE_NAME,If as CLINE_MCP_SETTINGS_FILE_NAME,b0 as CLINE_PLUGIN_BOOTSTRAP_PATH_ENV,f0 as CLINE_PLUGIN_RUNTIME_DIR_ENV,el as CLINE_WORKSPACES_DIRECTORY_NAME,fI as CORE_BUILD_VERSION,ue as CORE_TELEMETRY_EVENTS,Uv as ChatMessageImageSchema,Lv as ChatMessageRoleSchema,Bv as ChatMessageSchema,Wv as ChatSessionConfigSchema,Nv as ChatSessionStatusSchema,Fv as ChatSummarySchema,gI as ChatViewStateSchema,gg as ClaudeCodeImportAdapter,a0 as ClineAccountService,Tg as ClineCore,Es as ClineFreeModelLimitError,ks as ClineNotSubscribedError,Is as ClineOrgIndividualInferenceSubscriptionError,Ss as ClinePassLimitError,Fi as CloudHandoffGitPreflightError,Pg as CloudHandoffTranscriptMismatchError,am as CodexImportAdapter,Wd as CommandExitError,A0 as CommandSpawnError,Nd as CommandTerminationError,dv as ConnectorSupervisor,fm as ContributionRegistry,Mu as CoreSessionService,qd as CoreSettingsService,j1 as DEFAULT_HUB_HOST,q1 as DEFAULT_HUB_PATHNAME,$1 as DEFAULT_HUB_PORT,A1 as DEFAULT_MCP_CONNECT_TIMEOUT_MS,Fx as DEFAULT_MODELS_CATALOG_URL,Yg as DefaultLlmsSdk,vg as DefaultRuntimeBuilder,vi as DefaultToolNames,lg as FALLBACK_CLINE_RECOMMENDED_MODELS,Ti as FEATURE_FLAGS,Ge as FeatureFlag,Lt as FeatureFlagDefaultValue,Zd as FeatureFlagsService,Mv as FileTeamPersistenceStore,Qx as GcpSettingsSchema,du as GlobalSettingsSchema,zu as HOOKS_CONFIG_DIRECTORY_NAME,Ib as HOOK_CONFIG_FILE_EVENT_MAP,eI as HUB_LOCK_HELD_EXIT_CODE,pg as HookConfigFileName,nf as HookEventNameSchema,af as HookEventPayloadSchema,Dg as HubCloudSessionService,lc as HubCommandError,Bg as HubEventLogStore,Yc as HubInstanceLock,jg as HubLockHeldError,lm as HubRunAdmissionRejectedError,Ug as HubRunQueue,Pu as HubRuntimeHost,_g as HubScheduleCommandService,kg as HubScheduleService,Fg as HubServerTransport,Xb as HubSessionClient,Yt as HubTransportError,Zb as HubUIClient,Lk as IMPORT_MISSING_TOOL_RESULT_TEXT,j0 as InMemoryMcpManager,hg as InMemoryWorkspaceManager,sw as Llms,Uu as LocalRuntimeHost,Lc as MAX_COMMAND_OUTPUT_CHARS,X_ as MCP_APPS_EXTENSION_ID,Z_ as MCP_APP_MIME_TYPE,mu as McpOAuthClientChangedError,_d as McpSettingsLockTimeoutError,kd as McpSettingsMutatorPurityError,Ex as McpSettingsUpdateSkippedError,Zx as ModelCatalogSettingsSchema,qg as NativeHubTransportAdapter,wg as NoOpFeatureFlagsProvider,Jr as NodeHubClient,Kc as OAuthReauthRequiredError,jx as OPENAI_COMPATIBLE_PROVIDERS,Xx as OcaSettingsSchema,Ed as OpenTelemetryProvider,fg as OpencodeImportAdapter,Se as PATCH_MARKERS,f1 as PatchActionType,Cd as PluginCallTimeoutError,Pd as PluginRegistry,Gx as ProviderClientSchema,p0 as ProviderIdSchema,zx as ProviderProtocolSchema,Vo as ProviderSettingsManager,xu as ProviderSettingsSchema,Jc as REMOTE_CONFIG_SESSION_BLOB_UPLOAD_METADATA_KEY,rv as RESTART_BASE_DELAY_MS,lv as RESTART_COUNTER_RESET_MS,cv as RESTART_GIVE_UP_AFTER,sv as RESTART_MAX_DELAY_MS,Sm as RULES_CONFIG_DIRECTORY_NAME,Kx as ReasoningSettingsSchema,jv as RemoteEnvironmentService,ng as RemoteRuntimeHost,Ax as RpcClineAccountService,Wu as RuntimeOAuthTokenManager,Vb as SCHEDULED_TASKS_SYSTEM_PROMPT_RULE,Gn as SDK_ERROR_TELEMETRY_EVENT,Wk as SESSION_IMPORT_TOOLS,Nk as SESSION_IMPORT_TOOL_LABELS,zd as SESSION_NOT_FOUND_ERROR_CODE,Hh as SESSION_STATUSES,Sv as SKILLS_CLI_PACKAGE,uI as SKILLS_CLI_VERSION,et as SKILLS_CONFIG_DIRECTORY_NAME,pv as STOP_SIGKILL_TIMEOUT_MS,uv as STOP_SIGTERM_TIMEOUT_MS,Jx as SapSettingsSchema,Bu as ScheduledTaskInputSchema,Sg as SessionHistorySearchService,Pb as SessionImportService,_u as SessionNotFoundError,mt as SessionSource,ha as SessionVersioningError,rm as SessionVersioningService,Ag as SqliteAgendaTaskStore,Du as SqliteSessionStore,bg as SqliteTeamStore,ub as StoredProviderModesSchema,pb as StoredProviderSettingsEntrySchema,sg as StoredProviderSettingsSchema,Md as StructuredCommandInputSchema,y0 as SubprocessSandbox,Gb as TASKS_SYSTEM_PROMPT_RULE,cm as TASKS_TOOL_NAME,_1 as TEAM_TOOL_NAMES,Kb as TasksToolInputSchema,i0 as TelemetryLoggerSink,Sd as TelemetryService,sm as TodoTaskInputSchema,Uc as ToolPresets,g0 as UnifiedConfigFileWatcher,Hi as WORKFLOWS_CONFIG_DIRECTORY_NAME,x0 as WorkerSandbox,lk as __test__,Bi as accumulateUsageTotals,xk as addLocalProvider,iv as agendaTaskSpecToCreateInput,ug as applyClineFeaturedModels,jd as augmentMcpTimeoutError,ek as authorizeMcpServerOAuth,k1 as bootstrapAgentTeams,Ub as buildCheckpointWorkspaceDiff,Ar as buildClineClientHeaders,Qk as buildCloudHandoffDashboardUrl,ab as buildConfiguredAgentToolDescriptors,nb as buildConfiguredAgentToolName,V_ as buildConnectionUpdate,Ng as buildConnectorChildEnv,D0 as buildDelegatedAgentConfig,wv as buildMcpInstallTransport,$u as buildRemoteConfigSessionBlobUploadMetadata,vf as buildSdkErrorProperties,rb as buildTeamProgressSummary,W1 as buildWorkspaceMetadata,yd as captureAgentCreated,lx as captureAgentTeamCreated,Vv as captureAgentUnexpectedReasoningTokens,Dc as captureAuthFailed,fd as captureAuthLoggedOut,Mc as captureAuthRefreshSoftFailure,su as captureAuthStarted,cu as captureAuthSucceeded,px as captureCompactionExecuted,dx as captureCompactionSkipped,Vh as captureConversationTurnEvent,ax as captureDiffEditFailure,XT as captureExtensionActivated,JT as captureGitSnapshot,ux as captureHookDiscovery,sx as captureMentionFailed,cx as captureMentionSearchResults,rx as captureMentionUsed,ox as captureMistakeLimitReached,ix as captureModeSwitch,i_ as captureProviderApiError,e_ as captureProviderConfigured,U as captureSdkError,nx as captureSkillUsed,Kh as captureSubagentExecution,Gh as captureTaskCompleted,Z2 as captureTaskCreated,ex as captureTaskRestarted,tx as captureTokenUsage,tc as captureToolUsage,X2 as captureWorkspaceInitError,J2 as captureWorkspaceInitialized,ZT as captureWorkspacePathResolved,Jb as checkManagedHubBuildMismatch,rI as cleanupConnectorInstanceViaCli,t_ as clearAccountTelemetryIdentity,Hk as clearCloudHandoffMetadata,rc as clearHubDiscovery,B1 as clearHubDiscoveryIfOwned,M_ as clearLiveModelsCatalogCache,W_ as clearPrivateModelsCatalogCache,D_ as clearPublicModelsCatalogCache,Gk as cloudHandoffFingerprintsEqual,Cg as cloudHandoffTranscriptsEqual,Dv as collectPluginMcpOAuthCandidates,E1 as combineUserInstructionConfigServices,Bb as compareCheckpointToWorkspace,Gd as compareHubBuilds,A_ as completeClineDeviceAuth,y1 as computePatchChanges,Ig as connectToHub,Jd as countUserRunMessages,_b as createAgentHooksExtension,Cn as createAgentRuntime,Ud as createAgentTeamsTools,x1 as createApplyPatchExecutor,L0 as createBuiltinTools,Lb as createCheckpointComparePlan,t0 as createClientScopedTelemetryService,Tr as createClineTelemetryServiceConfig,Tf as createClineTelemetryServiceMetadata,av as createCloudHandoffFingerprint,lb as createCompactionStateAwarePrepareTurn,ob as createConfiguredAgentTools,Sk as createConfiguredStreamingTranscriptionSession,Rx as createConfiguredTelemetryHandle,Rd as createConfiguredTelemetryService,og as createContextCompactionPrepareTurn,Nt as createContributionRegistry,Cu as createCoreSessionSnapshot,q0 as createCoreSettingsService,T1 as createDefaultExecutors,$d as createDefaultMcpServerClientFactory,w1 as createDefaultShellExecutor,O0 as createDefaultTools,G_ as createDefaultToolsWithPreset,M0 as createDelegatedAgent,P0 as createDelegatedAgentConfigProvider,ik as createDisabledMcpToolPolicies,O1 as createDisabledMcpToolPolicy,b1 as createEditorExecutor,hI as createForkSessionMetadata,Eb as createHookAuditHooks,Ab as createHookConfigFileExtension,Rb as createHookConfigFileHooks,U1 as createHubAuthToken,ig as createHubPluginCommandsApi,sc as createHubServerUrl,rk as createInMemoryHubOwnerContext,ln as createInitialAccumulatedUsage,TI as createLlmsSdk,qk as createLocalHubScheduleRuntimeHandlers,U0 as createMcpAppsClientCapabilities,C1 as createMcpAppsRuntime,P1 as createMcpTools,o0 as createOAuthClientCallbacks,n0 as createOpenTelemetryTelemetryService,U_ as createProviderConfig,yI as createPublishArtifactsTool,nI as createRemoteConfigSessionMessagesArtifactUploader,Db as createRestoredCheckpointMetadata,u1 as createRulesConfigDefinition,Nb as createRuntimeHost,Id as createScopedTelemetryService,tg as createSessionCompactionState,Nb as createSessionHost,h1 as createShellExecutor,g1 as createShellTool,l1 as createSkillsConfigDefinition,W0 as createSpawnAgentTool,Mk as createSubprocessHooks,Qb as createTasksPromptExtension,Hb as createTasksTool,Wb as createTeamName,k as createTool,z_ as createToolPoliciesWithPreset,Bd as createUserInstructionConfigService,p1 as createWorkflowsConfigDefinition,vI as defineLlmsConfig,vk as deleteLocalProvider,L1 as deriveSubsessionStatus,ov as disableConnectorAutostart,lI as disablePluginMcpServersInSettings,w0 as discoverPluginModulePaths,Xd as emptyStoredProviderSettings,kI as emptyWorkspaceManifest,v1 as enrichPromptWithMentions,nv as ensureAgendaTaskSchema,C0 as ensureChatWorkspace,Ou as ensureCompatibleLocalHubUrl,fk as ensureCustomProvidersLoaded,mb as ensureCustomProvidersLoadedSync,Eu as ensureDetachedHubServer,Jv as ensureFileExists,tt as ensureHookLogDir,iI as ensureHubServer,bv as ensureHubWebSocketServer,bI as ensureLoginShellPath,Rr as ensureParentDir,k_ as executeClineAccountAction,qb as executeScheduleOperation,zb as executeTodoTaskOperation,Wm as extractClineFreeModelLimitResetTime,ol as extractClinePassLimitMessage,gb as fetchClineRecommendedModels,Qh as filterDisabledPluginPaths,pu as filterDisabledTools,vx as filterExtensionToolRegistrations,xg as findCheckpointForRun,Qg as findInstalledGlobalMarketplaceSkillName,me as formatDisplayUserInput,P_ as formatProviderOAuthApiKey,k0 as formatRulesForSystemPrompt,i1 as formatSessionPluginIssue,z0 as generateWorkspaceInfo,G0 as generateWorkspaceInfoWithDiagnostics,mv as getActiveConnectorSupervisor,fb as getCachedClineRecommendedModels,Ke as getClineDefaultSystemPrompt,Yu as getClineNotSubscribedMessage,Ju as getClineOrgIndividualInferenceSubscriptionMessage,Qu as getClinePassSubscriptionUrl,J_ as getCoreAcpToolNames,Tu as getCoreBuiltinToolCatalog,Q_ as getCoreDefaultEnabledToolIds,S1 as getCoreHeadlessToolNames,hk as getCurrentContextSize,Ld as getFileIndex,Hg as getGlobalMarketplaceSkillPaths,yu as getLiveModelsCatalog,_k as getLocalProviderModels,tm as getLocalTranscriptionModels,Iu as getManagedHubCompatibility,Kg as getMarketplaceSkillCandidates,Fd as getMcpAppToolMeta,kx as getMcpServerOAuthState,Xh as getMcpServerOAuthStatus,Wg as getPersistedConnectorConnection,fu as getPersistedProviderApiKey,Qi as getPluginDisplayName,bu as getProcessPluginRegistry,j_ as getProcessStartToken,$_ as getProcessStartTokenAsync,li as getProviderAuthHandler,O_ as getProviderAuthStorageId,$x as getProviderConfig,bb as getProviderConfigFields,r0 as getProviderOAuthCredentialsFromSettings,Vc as getUserRunSpan,Px as getValidClineCredentials,Ux as getValidOcaCredentials,Wx as getValidOpenAICodexCredentials,dk as hasActiveHubSessions,Jh as hasMcpSettingsFile,da as hashSecret,J0 as hubHasLiveSessions,lu as identifyAccount,sI as installMcpServer,mI as installPlugin,Ku as isAgentPluginDirectory,v_ as isAgentPluginDisabledGlobally,a_ as isAutoUpdateEnabledGlobally,L_ as isBuiltInProviderId,mn as isChatWorkspacePath,__ as isClineAccountActionRequest,em as isClineAccountFeatureEnabled,Pm as isClineFreeModelLimitError,rl as isClineFreeModelLimitMessage,Mm as isClineModelNotFoundMessage,Am as isClineNotSubscribedError,nl as isClineNotSubscribedMessage,Om as isClineOrgIndividualInferenceSubscriptionError,al as isClineOrgIndividualInferenceSubscriptionMessage,Cm as isClinePassLimitError,Dm as isClinePassLimitMessage,N0 as isCoreBuiltinToolAvailable,Nu as isDedicatedTranscriptionModel,sk as isDiscoveryFilePresent,J1 as isHubCommandTimeoutError,fv as isHubLockHeldError,Y1 as isHubReconnectableTransportError,xb as isLocalAuthProvider,zg as isLocalHubHostName,xv as isLocalHubOrigin,Kd as isManagedHubReusable,Rv as isMarketplaceSkillInstalled,B0 as isMcpAppResourceUri,R1 as isMcpToolVisibleToApp,F0 as isMcpToolVisibleToModel,wd as isModelToolEnabledGlobally,gu as isOAuthProvider,Cv as isOfficialPluginSlug,b_ as isPluginDisabledGlobally,Jn as isPluginModulePath,c0 as isPrivateModelCatalogProvider,vb as isProviderSettingsUsable,d1 as isRuleEnabled,Yr as isSessionNotFoundError,H_ as isSkillsToolAvailable,mx as isTelemetryOptedOutGlobally,x_ as isToolDisabledGlobally,ak as isUnusableSessionError,eb as isUserRunMessage,Mg as listActiveConnectors,dg as listHookConfigFiles,Tk as listLocalProviders,T_ as listMcpServerOAuthStatuses,nk as listPluginTools,$0 as listPluginToolsWithDiagnostics,ok as listSessionHistoryFromBackend,jb as loadAgentPluginFromPath,h0 as loadAgentPluginPackages,Bk as loadAgentPluginsFromPaths,$b as loadAgentPluginsFromPathsWithDiagnostics,ib as loadConfiguredAgentConfigs,wI as loadLlmsConfigFromFile,Yh as loadMcpSettingsFile,_I as loadOpenTelemetryAdapter,S0 as loadRulesForSystemPromptFromRecords,Z0 as localHubHasNoActiveSessions,Pk as loginAndSaveLocalProviderOAuthCredentials,Bx as loginAndSaveProviderOAuthCredentials,Ox as loginClineOAuth,Ok as loginLocalProvider,Nx as loginOcaOAuth,Dx as loginOpenAICodex,V0 as makeSubSessionId,N1 as makeTeamTaskSubSessionId,wk as markLocalProviderEnabled,pI as marketplaceEntryKey,mg as mergeAgentHooks,Kk as mergeCloudHandoffMetadata,I0 as mergeRulesForSystemPrompt,hb as migrateLegacyProviderSettings,Un as noopBasicLogger,Hc as normalizeAgendaTaskLocation,Qc as normalizeGitHubRemoteUrl,zc as normalizeHubWebSocketUrl,Ak as normalizeOAuthProvider,nm as normalizePluginCommandName,u0 as normalizeProviderId,Qr as normalizeRuntimeCapabilities,wf as normalizeSdkError,xe as normalizeUserInput,Bc as normalizeWorkspacePath,Eg as parseAgendaTaskSpec,d0 as parseAgentSkillMarkdown,tb as parseConfiguredAgentConfig,va as parseHookEventPayload,vv as parseMcpHeaders,Tv as parseMcpInstallArgs,Tx as parseMcpServerRegistration,Ob as parsePluginCommand,Pv as parsePluginSource,a1 as parseRuleConfigFromMarkdown,Gc as parseSessionCompactionState,e1 as parseSettings,n1 as parseSkillConfigFromMarkdown,of as parseUserCommandEnvelope,o1 as parseWorkflowConfigFromMarkdown,yb as peekClineRecommendedModels,S_ as persistClineAccountTelemetryIdentity,Yk as persistConnectorConnection,zk as preflightCloudHandoffGit,aI as prepareRemoteConfigCoreIntegration,Q1 as prewarmDetachedHubServer,q_ as prewarmFileIndex,Fk as probeHubConnection,jc as probeHubServer,tk as probeMcpServerConnection,m1 as probeProcessStartToken,wu as probeProcessStartTokenAsync,Yd as projectSessionCompactionState,Fb as projectSessionMessagesForDisplay,Au as queryHubSessionActivity,um as readBearerToken,Vk as readCloudHandoffMetadata,g_ as readCloudModelIdGlobally,c_ as readCompactionModeGlobally,r_ as readCompactionStrategyGlobally,$e as readGlobalSettings,Ui as readHubDiscovery,yg as readImportedFromMetadata,cg as readModelsFileSync,u_ as readPlanActModeGlobally,df as readRemoteConfigSessionBlobUploadMetadata,om as readSessionCheckpointHistory,V1 as readSupersededHubDiscovery,d_ as readToolAutoApproveGlobally,m_ as readTuiThemeGlobally,Xk as reconnectPersistedConnectors,Cx as refreshClineToken,Lx as refreshOcaToken,Mx as refreshOpenAICodexToken,Rk as refreshProviderModelsFromSource,hm as registerDisposable,Sx as registerMcpServersFromSettingsFile,qu as registerRemoteConfigSessionBlobUpload,Ru as rememberRecoverableLocalHubUrl,$v as remoteHelperBinaryFilename,Jk as removePersistedConnectorConnection,kv as removePluginMcpServersFromSettings,oI as requestDesktopToolApproval,uc as requestHubDrain,Qd as requestHubShutdown,yk as resetClineRecommendedModelsCacheForTests,Za as resolveAgentConfigSearchPaths,Dd as resolveAgentPluginPaths,T0 as resolveAgentPluginPathsWithDiagnostics,to as resolveAgentPluginSearchPaths,Qa as resolveAgentSchedulesDir,Cf as resolveAgentsConfigDirPath,_0 as resolveAndLoadAgentPlugins,Ga as resolveChatWorkspacePath,e0 as resolveClientTelemetryProperties,I_ as resolveClineAccountTelemetryIdentity,Z as resolveClineDataDir,Rt as resolveClineDir,eg as resolveCompatibleLocalHubUrl,Dk as resolveComposioConnectionStatePath,ti as resolveConfiguredPluginModulePaths,Qn as resolveConnectorDataDir,Ts as resolveConnectorLogPath,Gu as resolveConnectorSettingsPath,Vu as resolveConnectorsDbPath,Zh as resolveCoreDeviceId,nc as resolveCoreDistinctId,Y_ as resolveCoreSelectedToolIds,Ka as resolveCronDbPath,Yv as resolveCronEventsDir,Ja as resolveCronReportsDir,Dt as resolveCronSpecsDir,be as resolveDbDataDir,z1 as resolveDefaultHubHost,G1 as resolveDefaultHubPathname,Hd as resolveDefaultHubPort,Qt as resolveDefaultMcpSettingsPath,uu as resolveDisabledAgentPluginNames,bd as resolveDisabledPluginPaths,ic as resolveDisabledToolNames,Ef as resolveDocumentsClineDirectoryPath,Si as resolveDocumentsExtensionPath,za as resolveExistingFilePath,Yn as resolveGlobalAgentsRulesPath,Of as resolveGlobalCronSpecsDir,Df as resolveGlobalRulesConfigPaths,ei as resolveGlobalSettingsPath,Rf as resolveGlobalTaskSpecsDir,kb as resolveHooksConfigSearchPaths,K0 as resolveHubBuildEpochMs,oc as resolveHubBuildId,Vd as resolveHubBuildIdentity,Su as resolveHubEndpointOptions,gv as resolveHubEventLogPath,yv as resolveHubInstanceLockPath,Fc as resolveHubOwnerContext,hv as resolveHubRunQueuePath,Yb as resolveHubUrl,Tb as resolveLocalClineAuthToken,Vg as resolveMarketplaceMcpServerName,Td as resolveMcpServerRegistration,Nc as resolveMcpServerRegistrations,gn as resolveMcpSettingsPath,mk as resolveMessageDisplayRole,hx as resolveModelToolSettings,Go as resolveModelsRegistryPath,v0 as resolvePluginConfigSearchPaths,il as resolvePluginModuleEntries,Od as resolvePluginRuntimeDirectory,vu as resolvePluginSkillDirectoriesFromPaths,$c as resolveProductionHubOwnerContext,C_ as resolveProviderApiKeyFromSettings,qx as resolveProviderConfig,Xa as resolveProviderSettingsPath,s1 as resolveRulesConfigSearchPaths,Uk as resolveSessionBackend,He as resolveSessionDataDir,cc as resolveSharedHubOwnerContext,r1 as resolveSkillsConfigSearchPaths,Ya as resolveTaskSpecsDir,Ha as resolveTasksDbPath,hn as resolveTeamDataDir,I1 as resolveToolClientType,c1 as resolveWorkflowsConfigSearchPaths,Em as resolveWorkspaceCronSpecsDir,ck as resolveWorkspaceHubOwnerContext,Pf as resolveWorkspaceRulesConfigPaths,Af as resolveWorkspaceTaskSpecsDir,Z1 as restartLocalHubIfIdleAfterStartupTimeout,qc as retireDiscoveredHub,K_ as reviveTeamStateDates,Lu as runHook,qv as runRemoteProcess,im as runSubprocessEvent,B_ as safeCreateProviderConfig,t1 as safeParseSettings,Cb as sanitizeImportedMessages,ku as sanitizeSessionToken,Ck as saveLocalProviderOAuthCredentials,Ek as saveLocalProviderSettings,s0 as saveProviderOAuthCredentials,kk as saveVoiceInputSettings,ht as sdkDebug,jk as sendHubCommand,tv as serializeAgendaTaskSpec,Zk as setActiveConnectorSupervisor,o_ as setAutoUpdateEnabledGlobally,Hv as setClineDir,Qv as setClineDirIfUnset,f_ as setCloudModelIdGlobally,l_ as setCompactionModeGlobally,s_ as setCompactionStrategyGlobally,bx as setDisabledAgentPlugin,xx as setDisabledPlugin,yx as setDisabledTools,Kv as setHomeDir,Va as setHomeDirIfUnset,uk as setHubDaemonLauncher,_x as setMcpServerDisabled,gx as setModelToolEnabledGlobally,p_ as setPlanActModeGlobally,F_ as setPluginSandboxLauncher,E_ as setSdkLogger,n_ as setTelemetryOptOutGlobally,y_ as setToolAutoApproveGlobally,h_ as setTuiThemeGlobally,K1 as spawnDetachedHubServer,H1 as spawnDetachedHubServerWithRetry,D1 as splitCoreSessionConfig,R_ as startClineDeviceAuth,tI as startHubServer,Gg as startHubWebSocketServer,hu as startLocalOAuthServer,X1 as stopLocalHubServerGracefully,he as stripUtf8Bom,xI as summarizeConversation,X0 as summarizeHubSessionActivity,rg as summarizeUsageFromMessages,_v as syncPluginMcpServersToSettings,gk as syncStoredProviderRegistration,M1 as toClineCoreStartInput,Sb as toHookConfigFileName,Y0 as toHubHealthUrl,F1 as toHubStatusUrl,ac as toProviderConfig,sb as toTeamProgressLifecycleEvent,fx as toggleDisabledTool,Ik as transcribeConfiguredVoiceInput,wb as transcribeLocalAudio,Mb as trimMessagesBeforeUserRun,R0 as truncateCommandOutput,ev as truncateNotificationBody,dI as uninstallMarketplaceEntry,Ev as uninstallMarketplaceMcpServerFromSettings,Ov as uninstallMarketplacePlugin,Av as uninstallMarketplaceSkill,cI as uninstallMcpServer,Iv as uninstallPlugin,bk as updateLocalProvider,w_ as updateMcpServerOAuthState,Ix as updateMcpServerOAuthStateAsync,wx as updateMcpSettingsFile,Wc as updateMcpSettingsFileSync,pk as upgradeManagedHub,ma as verifyHubConnection,$k as watchManagedHubBuildMismatch,Q0 as withHubStartupLock,ci as writeGlobalSettings,H0 as writeHubDiscovery,db as writeModelsFileSync};
|