!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._posthogChunkIds=e._posthogChunkIds||{},e._posthogChunkIds[n]="01a090e3-15a9-7da1-9ddd-7186a286c708")}catch(e){}}();(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,394359,e=>{"use strict";var t,a=((t={}).Low="low",t.Medium="medium",t.High="high",t);e.s(["SearchContextSize",()=>a])},732610,e=>{"use strict";var t=e.i(60628),a=e.i(80125);let o=t.OpenRouterServerToolType.OpenRouterFusion;a.CompletionRequestReasoningEffort.Medium,e.s(["FUSION_DEFAULT_MAX_OUTPUT_TOKENS",0,16e3,"FUSION_TOOL_NAME",0,o])},500397,e=>{"use strict";var t=e.i(317913),a=e.i(80125),o=e.i(693697),i=e.i(204067),n=e.i(796805),r=e.i(732610),s=e.i(465313);[...new Map([["~anthropic/claude-opus-latest","Frontier tier, high cost. Strong reasoning, code, and long-form synthesis."],["~openai/gpt-sol-latest","Frontier tier, high cost. Strong general reasoning and tool use."],["~google/gemini-pro-latest","Frontier tier, high cost. Strong reasoning and long-context handling."],["~google/gemini-flash-latest","Budget tier, low cost, fast. Capable generalist, weaker on hard reasoning than frontier models."]]).keys()];let l=n.z.object({model:n.z.string(),stance:n.z.string()}),c=n.z.object({topic:n.z.string(),stances:n.z.array(l)}),p=n.z.object({models:n.z.array(n.z.string()),point:n.z.string()}),m=n.z.object({model:n.z.string(),insight:n.z.string()}),d=n.z.object({consensus:n.z.array(n.z.string()),contradictions:n.z.array(c),partial_coverage:n.z.array(p),unique_insights:n.z.array(m),blind_spots:n.z.array(n.z.string())}).openapi("FusionAnalysisResult",{description:"Structured analysis produced by the fusion analyst model.",example:{consensus:["All panel models agree the request is asking for a concise summary."],contradictions:[{topic:"Recommended approach",stances:[{model:"openai/gpt-5",stance:"Favors an incremental rollout."},{model:"anthropic/claude-sonnet-4.5",stance:"Favors a single coordinated migration."}]}],partial_coverage:[{models:["openai/gpt-5"],point:"Only one model addressed the rollback strategy."}],unique_insights:[{model:"anthropic/claude-sonnet-4.5",insight:"Highlighted a backwards-compatibility risk the other models missed."}],blind_spots:["No model considered the impact on existing API consumers."]}}),u=n.z.array(n.z.string()).min(1).max(s.MAX_ANALYSIS_MODELS).optional().openapi({description:`Slugs of models to run in parallel as the analysis panel. Each model receives the user prompt with openrouter:web_search and openrouter:web_fetch enabled, then an analyst model summarizes the collective output into structured analysis JSON. Capped at ${s.MAX_ANALYSIS_MODELS} models to bound cost amplification. Defaults to the Quality preset from /labs/fusion.`,example:["~anthropic/claude-opus-latest","~openai/gpt-sol-latest","~google/gemini-pro-latest"]}),_=n.z.string().optional().openapi({description:"Slug of the analyst model that produces the structured analysis JSON. Defaults to the model used in the outer API request.",example:"~anthropic/claude-opus-latest"}),h=n.z.number().int().min(1).max(s.MAX_FUSION_AGENT_STEPS_LIMIT).optional().openapi({description:`Maximum number of tool-calling steps each panelist (analysis model) and the analyst model may take during their agentic web-research loop. Models with web_search/web_fetch enabled iterate until they produce a text response or hit this ceiling. Defaults to ${s.DEFAULT_FUSION_AGENT_STEPS}. Capped at ${s.MAX_FUSION_AGENT_STEPS_LIMIT}.`,example:12}),g=(0,i.zInt)().min(1).optional().openapi({description:`Maximum number of output tokens (including reasoning tokens) each panelist and the analyst model may produce per inner call. Controls the total output budget so reasoning-heavy models like GPT-5.5 do not exhaust their token allowance before producing visible text. Defaults to ${r.FUSION_DEFAULT_MAX_OUTPUT_TOKENS} when omitted.`,example:16384}),f=n.z.object({effort:a.CompletionRequestReasoningEffortSchema.optional().openapi({description:"Reasoning effort level for panelist and analyst inner calls."}),max_tokens:(0,i.zInt)().min(1).optional().openapi({description:"Maximum number of reasoning tokens each panelist and analyst model may use. Helps bound cost when models allocate too much budget to chain-of-thought."})}).optional().openapi({description:"Reasoning configuration forwarded to panelist and analyst inner calls. Use this to control reasoning effort and token budget for models that support extended thinking."}),b=(0,i.zDouble)().min(0).max(2).optional().openapi({description:"Temperature forwarded to panelist inner calls. The analyst always runs at temperature 0 regardless of this value. When omitted, the provider's default applies.",example:.7}),S=t.AnthropicCacheControlDirectiveSchema.optional(),x=n.z.object({type:n.z.string().openapi({description:'Server tool type identifier (e.g. "openrouter:web_search", "openrouter:web_fetch").'}),parameters:n.z.record(n.z.string(),n.z.unknown()).optional().openapi({description:"Optional configuration forwarded as the tool's `parameters` object."})}),A={analysis_models:u,model:_,max_tool_calls:h,max_completion_tokens:g,reasoning:f,temperature:b,cache_control:S,tools:n.z.array(x).max(s.MAX_FUSION_TOOLS).optional().openapi({description:'Server tools available to panelist and analyst inner calls. Each entry uses the same `{ type, parameters? }` shorthand as the outer Chat Completions request. When omitted, defaults to `[{ type: "openrouter:web_search" }, { type: "openrouter:web_fetch" }]`. Pass an empty array to disable tools entirely (panelists answer from parametric knowledge only).',example:[{type:"openrouter:web_search",parameters:{excluded_domains:["example.com"]}},{type:"openrouter:web_fetch"}]})},y=n.z.object(A).openapi("FusionServerToolConfig",{description:`Configuration for the ${r.FUSION_TOOL_NAME} server tool.`,example:{analysis_models:["~anthropic/claude-opus-latest","~openai/gpt-sol-latest","~google/gemini-pro-latest"]}}),z=n.z.object({model:n.z.string().openapi({description:"Slug of the analysis model that failed."}),error:n.z.string().openapi({description:"Error message describing why the model failed."}),status_code:n.z.number().int().optional().openapi({description:"HTTP status code from the upstream response, when available (e.g. 402, 429)."})});n.z.object({prompt:n.z.string().openapi({description:"Optimize the prompt for independent judgment. Include everything the panel needs to answer effectively while introducing as few caller-supplied priors as possible. Do not include your current answer, reasoning, preferred conclusion, interpretation, or assumptions unless they are necessary objects of evaluation. Do not remove relevant facts, user goals, constraints, or other context merely to reduce framing. State what you want Fusion to help with, the questions you most want independent perspectives on, and the necessary context. The questions are priorities and do not need to exhaust everything relevant to the goal. Fusion cannot access your tools, files, codebase, client state, conversation history, or anything else you do not provide.\n\nUse exactly this structure:\n\n## Goal\nWhat you want Fusion to help with and why.\n\n## Questions\n- The question or questions you want independent perspectives on.\n\n## Context\nOnly the context needed to understand the goal and answer the questions effectively.",example:"What are the most important arguments for and against carbon taxes?"})});let E=n.z.object({url:n.z.string().openapi({description:"URL of the web page a panel or the analyst retrieved during the run."}),title:n.z.string().openapi({description:"Title of the retrieved web page."})}).openapi("FusionSource",{description:"A web page retrieved via web search during a fusion run.",example:{url:"https://example.com/article",title:"Example article title"}}),v=n.z.array(n.z.unknown()).transform(e=>e.flatMap(e=>{let t=(0,i.parseSchema)(E,e);return(0,o.isOk)(t)?[t.data]:[]})).pipe(n.z.array(E));n.z.object({status:n.z.enum(["ok","error"]),error:n.z.string().optional(),failure_reason:n.z.string().optional(),analysis:d.optional(),responses:n.z.array(n.z.object({model:n.z.string(),content:n.z.string(),note:n.z.string().optional()})).optional(),failed_models:n.z.array(z).optional(),sources:v.optional()});let w=n.z.object({phase:n.z.literal("panel_started"),model:n.z.string()}),I=n.z.object({phase:n.z.literal("panel_delta"),model:n.z.string(),content_delta:n.z.string().optional(),reasoning_delta:n.z.string().optional()}),M=n.z.object({phase:n.z.literal("panel_complete"),model:n.z.string(),content:n.z.string()}),T=n.z.object({phase:n.z.literal("panel_error"),model:n.z.string(),error:n.z.string(),status_code:n.z.number().int().optional()}),P=n.z.object({phase:n.z.literal("analysis_started"),analyst_model:n.z.string().optional(),judge_model:n.z.string().optional()}),O=n.z.object({phase:n.z.literal("analysis_complete"),analysis:d});n.z.discriminatedUnion("phase",[w,I,M,T,P,O]),e.s(["FUSION_PARAMS_SHAPE",0,A,"FailedModelSchema",0,z,"FusionApiRequestSchema",0,y,"FusionSourceSchema",0,E,"analysisResultSchema",0,d],500397)},920969,e=>{"use strict";e.i(204067);var t=e.i(796805);let a=RegExp("^or_file_[0-9A-Za-z]+$");new TextEncoder;let o=t.z.enum(["copied","preexisting"]),i=t.z.object({fileId:t.z.string().regex(a),filename:t.z.string().min(1).max(255)}),n=t.z.array(i).max(20),r=i.extend({copyOutcome:o});t.z.array(r).max(20),e.s(["MAX_CONTAINER_ATTACH_FILES",0,20,"ResolvedAttachFilesSchema",0,n],920969)},682992,e=>{"use strict";let t=/^[\w-]+$/;e.s(["SANDBOX_KEY_PATTERN",0,t,"safeSessionKey",0,function(e){if(void 0!==e&&t.test(e))return e.length>20?e.slice(-20):e}])},504445,e=>{"use strict";var t=e.i(204067),a=e.i(796805);let o=a.z.union([a.z.string(),(0,t.zDouble)(),a.z.array(a.z.unknown())]);a.z.record(a.z.string(),o).optional().openapi("ImageConfig",{description:"Provider-specific image configuration options. Keys and values vary by model/provider. See https://openrouter.ai/docs/guides/overview/multimodal/image-generation for more details.",example:{aspect_ratio:"16:9",quality:"high"}});let i={aspect_ratio:a.z.string().optional(),image_size:a.z.string().optional(),quality:a.z.string().optional(),size:a.z.string().optional(),background:a.z.string().optional(),output_format:a.z.string().optional(),output_compression:(0,t.zInt)().optional(),moderation:a.z.string().optional(),font_inputs:a.z.array(a.z.unknown()).optional(),super_resolution_references:a.z.array(a.z.string()).optional(),scoring_prompt:a.z.string().optional(),scoring_rubric:a.z.array(a.z.unknown()).optional(),background_mode:a.z.string().optional(),background_hex_color:a.z.string().optional()};a.z.object(i),e.s(["IMAGE_CONFIG_BACKGROUND_VALUES",0,["auto","transparent","opaque"],"IMAGE_CONFIG_MODERATION_VALUES",0,["auto","low"],"IMAGE_CONFIG_OUTPUT_COMPRESSION_MAX",0,100,"IMAGE_CONFIG_OUTPUT_COMPRESSION_MIN",0,0,"IMAGE_CONFIG_OUTPUT_FORMAT_VALUES",0,["png","webp","jpeg"],"IMAGE_CONFIG_QUALITY_VALUES",0,["auto","low","medium","high"],"ImageConfigValueSchema",0,o,"KNOWN_IMAGE_CONFIG_FIELDS_SHAPE",0,i])},41163,955842,e=>{"use strict";e.s(["MAX_CANONICAL_CONTAINER_ID_LENGTH",0,40,"SESSION_CONTAINER_ID_PREFIX",0,"sess_"],955842),e.s(["MAX_CONTAINER_ID_LENGTH",0,40,"MAX_SANDBOX_COMMAND_LENGTH",0,16384],41163)},139625,e=>{"use strict";var t=e.i(920969),a=e.i(682992);e.i(204067);var o=e.i(796805),i=e.i(41163);let n=o.z.array(o.z.string().min(1)).max(t.MAX_CONTAINER_ATTACH_FILES).optional().openapi("ContainerFileIds",{description:`Workspace file ids (or_file_…) to attach into the container before the first command runs. Each file is copied to the container home as a writable copy named {last 8 characters of the file id}-{base filename} (a file stored as data/report.csv with id or_file_…NR6q4V8w attaches to ~/NR6q4V8w-report.csv), so same-named files never collide; the source document is never modified. Unknown, foreign, or malformed ids fail the request with a 400 before any command executes. Max ${t.MAX_CONTAINER_ATTACH_FILES} ids.`,example:["or_file_011CNha8iCJcU1wXNR6q4V8w"]}),r=o.z.union([o.z.object({type:o.z.literal("disabled").openapi({description:"No outbound internet access."})}),o.z.object({type:o.z.literal("allowlist").openapi({description:"Outbound access restricted to the listed domains."}),allowed_domains:o.z.array(o.z.string().min(1).max(253).regex(/^[a-z0-9*]([a-z0-9*-]{0,61}[a-z0-9*])?(\.[a-z0-9*]([a-z0-9*-]{0,61}[a-z0-9*])?)*$/,"Must be a lowercase hostname or * glob pattern (no scheme, path, or port)")).min(1).max(50).openapi({description:"Hostnames the container may reach over ports 80/443 (max 50). Entries are lowercase hostnames or glob patterns where * matches any run of characters (e.g. *.example.com). An exact hostname does not cover its subdomains — use a glob or list each hostname. pip needs both pypi.org and files.pythonhosted.org (or *.pythonhosted.org).",example:["pypi.org","files.pythonhosted.org"]})})]).openapi("ContainerNetworkPolicy",{description:'Network egress policy for the container. "disabled" blocks all outbound internet; "allowlist" permits only hosts matching the listed hostnames or * glob patterns (ports 80/443, DNS via Cloudflare resolvers). The policy is fixed when a container starts: sending a different policy to a warm container fails the request with a 409. Omitted: defaults to "disabled" (no outbound internet). For unrestricted egress, use an allowlist of ["*"].',example:{type:"allowlist",allowed_domains:["pypi.org","files.pythonhosted.org"]}}),s=o.z.object({type:o.z.literal("container_reference"),network_policy:r.optional(),container_id:o.z.string().min(1).max(i.MAX_CONTAINER_ID_LENGTH).regex(a.SANDBOX_KEY_PATTERN).openapi({description:`Canonical container id to reuse (max ${i.MAX_CONTAINER_ID_LENGTH} characters, letters/digits/underscores/hyphens). Any container_id previously returned by a bash or shell tool result works here and reattaches to the same container and files — including session-derived ids (sess_...) and generation-derived ids (gen_...). Note that a session-derived id is always sess_ + the sanitized session key, which is not necessarily the raw session id you sent. Using the same container_id from both the bash and shell tools shares the same files, with last-write-wins when both flush concurrently. A fresh name creates a new persistent container. Containers are always scoped to your account and workspace.`,example:"sess_abc123"}),file_ids:n}).openapi("ContainerReferenceEnvironment",{description:"Reference to a container by its canonical id — a previously returned container_id or a fresh name to create a persistent container.",example:{type:"container_reference",container_id:"sess_abc123"}}),l=o.z.object({type:o.z.literal("container_auto"),network_policy:r.optional(),file_ids:n}).openapi("ContainerAutoEnvironment",{description:"An OpenRouter-managed, auto-provisioned ephemeral container.",example:{type:"container_auto"}});e.s(["ContainerAutoEnvironmentSchema",0,l,"ContainerReferenceEnvironmentSchema",0,s])},621894,e=>{"use strict";e.i(204067);var t=e.i(796805);let a={timezone:t.z.string().optional().openapi({description:'IANA timezone name (e.g. "America/New_York"). Defaults to UTC.',example:"America/New_York"})},o=t.z.object(a).openapi("DatetimeServerToolConfig",{description:"Configuration for the openrouter:datetime server tool",example:{timezone:"America/New_York"}});e.s(["DATETIME_PARAMS_SHAPE",0,a,"DatetimeApiRequestSchema",0,o])},493901,e=>{"use strict";var t=e.i(504445);e.i(204067);var a=e.i(796805);let o={model:a.z.string().optional().openapi({description:'Which image generation model to use (e.g. "openai/gpt-5-image"). Defaults to "openai/gpt-5-image".',example:"openai/gpt-5-image"})},i=a.z.object(o).catchall(t.ImageConfigValueSchema).openapi("ImageGenerationServerToolConfig",{description:"Configuration for the openrouter:image_generation server tool. Accepts all image_config params (aspect_ratio, quality, size, background, output_format, output_compression, moderation, etc.) plus a model field.",example:{model:"openai/gpt-5-image",quality:"high",aspect_ratio:"16:9"}});e.s(["IMAGE_GENERATION_PARAMS_SHAPE",0,o,"ImageGenerationApiRequestSchema",0,i])},904297,e=>{"use strict";var t=e.i(204067),a=e.i(796805);let o={max_results:(0,t.zInt)().min(1).max(20).optional().openapi({description:"Maximum number of models to return. Defaults to 5, max 20.",example:5})},i=a.z.object(o).openapi("SearchModelsServerToolConfig",{description:"Configuration for the openrouter:experimental__search_models server tool",example:{max_results:5}});e.s(["SEARCH_MODELS_MAX_RESULTS_LIMIT",0,20,"SEARCH_MODELS_MAX_RESULTS_MIN",0,1,"SEARCH_MODELS_PARAMS_SHAPE",0,o,"SearchModelsApiRequestSchema",0,i])},856954,e=>{"use strict";var t=e.i(60628),a=e.i(920969),o=e.i(704985),i=e.i(204067),n=e.i(796805),r=e.i(41163),s=e.i(139625);let l=["auto","openrouter"],c=n.z.enum(l).optional().openapi("ShellServerToolEngine",{description:'Which shell engine to use. "openrouter" runs commands server-side in the OpenRouter sandbox. "auto" (default) keeps the provider\'s native hosted shell when available (OpenAI); on other providers the call is routed to the OpenRouter sandbox.',example:"openrouter"}),p=n.z.discriminatedUnion("type",[s.ContainerAutoEnvironmentSchema,s.ContainerReferenceEnvironmentSchema]).openapi("ShellServerToolEnvironment",{description:'Server-side execution environment for the shell tool. Only container-backed environments are supported; "local" shells are not.',example:{type:"container_auto"}}),m=n.z.object({environment:p.optional(),engine:c}).openapi("ShellServerToolConfig",{description:"Configuration for the openrouter:shell server tool",example:{engine:"openrouter",environment:{type:"container_auto"}}});n.z.object({commands:n.z.array(n.z.string().max(r.MAX_SANDBOX_COMMAND_LENGTH)).min(1).max(t.MAX_SANDBOX_COMMANDS).openapi({description:"Shell commands to run, each in its own invocation, in order.",example:["ls -la","cat package.json"]}),timeout_ms:(0,i.zInt)().positive().optional().openapi({description:"Maximum execution time in milliseconds applied to each command.",example:3e4}),max_output_length:(0,i.zInt)().positive().optional().openapi({description:"Maximum characters returned per stream — stdout and stderr are each capped to this value, per command.",example:16384})}).openapi("ShellServerToolAction",{description:"Shell command batch to execute.",example:{commands:["echo hello"]}}),n.z.object({apiToolParams:m,_attachFiles:a.ResolvedAttachFilesSchema.optional(),_shellExecCompleted:n.z.boolean().optional()});let d=n.z.discriminatedUnion("type",[n.z.object({type:n.z.literal("exit"),exit_code:(0,i.zInt)()}),n.z.object({type:n.z.literal("timeout")})]),u=n.z.object({stdout:n.z.string(),stderr:n.z.string(),outcome:d});n.z.object({output:n.z.array(u),files:n.z.array(o.ContainerFileCitationSchema).optional(),container_id:n.z.string().optional()}),e.s(["SHELL_ENGINE_VALUES",0,l,"ShellApiRequestSchema",0,m,"ShellCommandOutputSchema",0,u,"ShellOutcomeSchema",0,d])},472195,442712,319409,434648,e=>{"use strict";var t=e.i(80125),a=e.i(204067),o=e.i(796805);let i=o.z.string().optional().openapi({description:"Slug of the model that executes delegated tasks (any OpenRouter model). Typically a smaller, cheaper, faster model than the one delegating. When omitted, the model from the outer API request is used. The subagent tool itself cannot be the subagent model.",example:"~anthropic/claude-haiku-latest"}),n=o.z.looseObject({type:o.z.string().refine(e=>"function"!==e,{message:"Function tools are not supported in the subagent's nested `tools`; only OpenRouter server tools (e.g. `openrouter:web_search`) can be nested."}),parameters:o.z.record(o.z.string(),o.z.unknown()).optional()}).openapi("SubagentNestedTool",{description:"A tool made available to the subagent. Only OpenRouter server tools (e.g. openrouter:web_search) are supported; function tools are rejected because the worker has no way to execute them. The subagent tool may not list itself.",example:{type:"openrouter:web_search"}}),r=o.z.array(n).optional().openapi({description:"Tools the subagent may use while executing a delegated task. The subagent runs as an agentic sub-agent over these tools, then returns its outcome. Only OpenRouter server tools are supported — function tools are rejected — and the list must not include the subagent tool itself."}),s=o.z.string().optional().openapi({description:"System instructions for the subagent. When omitted, the subagent responds with no system prompt of its own.",example:"You are a fast, focused worker. Complete the task exactly as described."}),l=o.z.number().int().min(1).max(25).optional().openapi({description:"Maximum number of tool-calling steps the subagent may take during its agentic loop. Capped at 25. Only relevant when the subagent is given tools. Forwarded to the subagent call as `max_tool_calls`.",example:5}),c=(0,a.zInt)().min(1).optional().openapi({description:"Maximum number of output tokens (including reasoning) the subagent may produce. When omitted, the provider's default applies.",example:2048}),p=o.z.object({effort:t.CompletionRequestReasoningEffortSchema.optional().openapi({description:"Reasoning effort level for the subagent call."}),max_tokens:(0,a.zInt)().min(1).optional().openapi({description:"Maximum number of reasoning tokens the subagent may use. Forwarded to the subagent call as `reasoning.max_tokens`."})}).openapi("SubagentReasoning",{description:"Reasoning configuration forwarded to the subagent call. Use this to control reasoning effort and token budget for models that support extended thinking.",example:{effort:"low"}}).optional(),m=(0,a.zDouble)().min(0).max(2).optional().openapi({description:"Sampling temperature forwarded to the subagent call. When omitted, the provider's default applies.",example:.7}),d=o.z.string().trim().min(1).max(64).regex(/^[a-zA-Z0-9 _-]+$/).openapi({description:"Optional name for this subagent. The model sees one tool per named subagent (and one default for an unnamed entry). Names must be unique across subagent entries. Letters, digits, spaces, underscores, and dashes; trimmed; 1–64 chars.",example:"summarizer"}),u=o.z.boolean().optional().openapi({description:"EXPERIMENTAL — subject to change without notice. When true, the subagent inherits every client function defined in the request's top-level `tools` list. Supported on the Responses API (`/api/v1/responses`) only; other APIs reject it with a `400`.",example:!0}),_=o.z.array(o.z.string().trim().min(1)).optional().openapi({description:"EXPERIMENTAL — subject to change without notice. Names of the top-level function tools that the subagent will inherit. Any tool that matches by name will be copied fully into the tools array of the subagent. When `inherit_functions` is `true`, this list does nothing, because every client function will be inherited by default. Names are trimmed before validation, so a whitespace-only name is rejected with a `400`. Supported on the Responses API (`/api/v1/responses`) only; other APIs reject it with a `400`.",example:["lookup_order"]}),h={name:d.optional(),model:i,tools:r,inherit_functions:u,inherited_function_names:_,instructions:s,max_tool_calls:l,max_completion_tokens:c,reasoning:p,temperature:m},g=o.z.object(h).openapi("SubagentServerToolConfig",{description:"Configuration for one openrouter:subagent server tool entry.",example:{name:"summarizer",model:"~anthropic/claude-haiku-latest"}});e.s(["MAX_SUBAGENT_TOOL_CALLS",0,25,"SubagentApiRequestSchema",0,g],472195);let f=["auto","native","openrouter","exa","parallel","firecrawl"],b={engine:o.z.enum(f).optional().openapi("WebFetchEngineEnum",{description:'Which fetch engine to use. "auto" (default) uses native if the provider supports it, otherwise Exa. "native" forces the provider\'s built-in fetch. "exa" uses Exa Contents API. "openrouter" uses direct HTTP fetch. "firecrawl" uses Firecrawl scrape (requires BYOK). "parallel" uses the Parallel extract API.',example:"auto"}),allowed_domains:o.z.array(o.z.string()).optional().openapi({description:"Only fetch from these domains."}),blocked_domains:o.z.array(o.z.string()).optional().openapi({description:"Never fetch from these domains."}),max_uses:(0,a.zInt)().min(1).optional().openapi({description:"Maximum number of web fetches per request. Once exceeded, the tool returns an error.",example:10}),max_content_tokens:(0,a.zInt)().min(1).optional().openapi({description:"Maximum content length in approximate tokens. Content exceeding this limit is truncated.",example:1e5})},S=o.z.object(b).openapi("WebFetchServerToolConfig",{description:"Configuration for the openrouter:web_fetch server tool",example:{max_uses:10,max_content_tokens:1e5}});e.s(["WEB_FETCH_ENGINE_VALUES",0,f,"WEB_FETCH_MAX_CONTENT_TOKENS_MIN",0,1,"WEB_FETCH_MAX_USES_MIN",0,1,"WEB_FETCH_PARAMS_SHAPE",0,b,"WebFetchApiRequestSchema",0,S],442712);var x=e.i(60628),A=e.i(680600),y=e.i(800479);let z=["native","exa","parallel","firecrawl","perplexity","auto"],E=["low","medium","high"],v=o.z.enum(z).optional().openapi("WebSearchEngineEnum",{description:'Which search engine to use. "auto" (default) uses native if the provider supports it, otherwise Exa. "native" forces the provider\'s built-in search. "exa" forces the Exa search API. "firecrawl" uses Firecrawl (requires BYOK). "parallel" uses the Parallel search API. "perplexity" uses the Perplexity Search API (raw ranked results).',example:"auto"}),w=A.WebSearchModeSchema.optional(),I=(0,a.zInt)().min(1).max(x.WEB_SEARCH_MAX_RESULTS_MAX).optional().openapi({description:"Maximum number of search results to return per search call. Defaults to 5. Applies to Exa, Firecrawl, Parallel, and Perplexity engines; ignored with native provider search. Perplexity supports a maximum of 20; values above 20 are clamped.",example:5}),M=(0,a.zInt)().min(1).optional().openapi({description:"Maximum number of web searches the model may perform in a single request. Once reached, further search calls return an error result instead of executing. Applies to the Exa, Firecrawl, Parallel, and Perplexity engines. With native provider search, forwarded only to Anthropic (as `max_uses`); other native search providers have no equivalent parameter and ignore it.",example:3}),T={engine:v,mode:w,max_results:I,max_uses:M,max_total_results:(0,a.zInt)().min(1).optional().openapi({description:"Maximum total number of search results across all search calls in a single request. Once this limit is reached, the tool will stop returning new results. Useful for controlling cost and context size in agentic loops. Defaults to 50 when not specified.",example:50}),search_context_size:o.z.enum(E).optional().openapi("SearchQualityLevel",{description:"How much context to retrieve per result. Applies to Exa, Parallel, and Perplexity engines; ignored with native provider search and Firecrawl. For Exa, pins a fixed per-result character cap (low=5,000, medium=15,000, high=30,000); when omitted, Exa picks an adaptive size per query and document (typically ~2,000–4,000 characters per result). For Parallel, controls the total characters across all results; when omitted, Parallel uses its own default size. For Perplexity, maps directly to the Search API's native search_context_size parameter. Overridden by `max_characters` when both are set.",example:"medium"}),max_characters:(0,a.zInt)().min(1).max(x.WEB_SEARCH_MAX_CHARACTERS_MAX).optional().openapi({description:"Exact maximum number of characters of content per search result. Applies to the Exa, Parallel, and Perplexity engines; ignored with native provider search and Firecrawl. For Exa, caps highlight content per result. For Parallel, caps excerpt content per result (default 1,500 when omitted). For Perplexity, maps to the native `max_tokens_per_page` parameter (converted from characters to tokens) and trims the response to the exact character cap. When both `max_characters` and `search_context_size` are set, `max_characters` takes precedence. When omitted, falls back to `search_context_size` mapping (Exa) or engine defaults (Parallel, Perplexity).",example:2e3}),user_location:y.WebSearchUserLocationSchema.partial({type:!0}).optional().openapi("WebSearchUserLocationServerTool",{description:"Approximate user location for location-biased results.",example:{type:"approximate",city:"San Francisco",region:"California",country:"US",timezone:"America/Los_Angeles"}}),allowed_domains:o.z.array(o.z.string()).optional().openapi({description:"Limit search results to these domains. Supported by Exa, Firecrawl, Parallel, Perplexity, and most native providers (Anthropic, OpenAI, xAI). Cannot be used with excluded_domains."}),excluded_domains:o.z.array(o.z.string()).optional().openapi({description:"Exclude search results from these domains. Supported by Exa, Firecrawl, Parallel, Perplexity, Anthropic, OpenAI, and xAI. Cannot be used with allowed_domains."})},P=o.z.object(T).openapi("WebSearchConfig",{example:{max_results:5,search_context_size:"medium"}}).openapi("WebSearchServerToolConfig",{description:"Configuration for the openrouter:web_search server tool",example:{max_results:5,search_context_size:"medium"}});e.s(["SEARCH_CONTEXT_SIZE_VALUES",0,E,"WEB_SEARCH_ENGINE_VALUES",0,z,"WEB_SEARCH_MAX_CHARACTERS_MIN",0,1,"WEB_SEARCH_MAX_RESULTS_MIN",0,1,"WEB_SEARCH_MAX_TOTAL_RESULTS_MIN",0,1,"WEB_SEARCH_MAX_USES_MIN",0,1,"WEB_SEARCH_PARAMS_SHAPE",0,T,"WebSearchApiRequestSchema",0,P,"WebSearchEngineSchema",0,v,"WebSearchMaxResultsSchema",0,I,"WebSearchMaxUsesSchema",0,M,"WebSearchModeSchema",0,w],319409);var O=e.i(504445);let N=["1:1","2:3","3:2","3:4","4:3","4:5","5:4","9:16","16:9","21:9"],C=o.z.enum(N);(0,a.buildZodGuard)(C);let R=["1K","2K"],F=o.z.string().transform(e=>e.toUpperCase()).pipe(o.z.enum(R)),L=o.z.string().transform(e=>e.toLowerCase()).pipe(o.z.enum(O.IMAGE_CONFIG_BACKGROUND_VALUES));o.z.object({aspect_ratio:C.optional(),image_size:F.optional(),background:L.optional()}).passthrough();let k=[...O.IMAGE_CONFIG_QUALITY_VALUES,"xhigh","max"],U=["aspect_ratio","model","image_size","quality","size","background","output_format","output_compression","moderation"];function G(e){return U.some(t=>t===e)}let D={match:e=>"openai/gpt-5.2-image-1.5"===e||e.includes("gpt-image-1")||e.includes("gpt-5-image"),fields:["model","quality","aspect_ratio","size","background","output_format","output_compression","moderation"],optionValues:{aspect_ratio:N,quality:O.IMAGE_CONFIG_QUALITY_VALUES,size:["1024x1024","1024x1536","1536x1024"],background:O.IMAGE_CONFIG_BACKGROUND_VALUES,output_format:O.IMAGE_CONFIG_OUTPUT_FORMAT_VALUES,moderation:O.IMAGE_CONFIG_MODERATION_VALUES}},W=[{match:e=>e.includes("gpt-image-2.5"),fields:["model","quality","aspect_ratio","size","background","output_format","output_compression"],optionValues:{aspect_ratio:N,quality:k,size:["1024x1024","1024x1536","1536x1024"],background:O.IMAGE_CONFIG_BACKGROUND_VALUES,output_format:O.IMAGE_CONFIG_OUTPUT_FORMAT_VALUES}},{match:e=>e.includes("gpt-image-2")||e.includes("image-2"),fields:["model","aspect_ratio","image_size"],optionValues:{aspect_ratio:N,image_size:R}},D,{match:e=>e.includes("gemini-3.1-flash-image-preview"),fields:["model","aspect_ratio","image_size"],optionValues:{aspect_ratio:[...N,"1:4","1:8","4:1","8:1"],image_size:["0.5K","1K","2K","4K"]}},{match:e=>e.includes("gemini-3-pro-image-preview"),fields:["model","aspect_ratio","image_size"],optionValues:{aspect_ratio:N,image_size:["1K","2K","4K"]}},{match:e=>e.startsWith("google/")&&e.includes("image"),fields:["model","aspect_ratio","image_size"],optionValues:{aspect_ratio:N,image_size:["1K","2K"]}},{match:e=>e.includes("seedream"),fields:["model","aspect_ratio","image_size"],optionValues:{aspect_ratio:N,image_size:["2K","4K"]}},{match:e=>e.startsWith("sourceful/")&&e.includes("riverflow-v2")&&e.includes("pro"),fields:["model","aspect_ratio","image_size"],optionValues:{aspect_ratio:N,image_size:["1K","2K","4K"]}},{match:e=>e.startsWith("sourceful/")&&e.includes("riverflow-v2"),fields:["model","aspect_ratio","image_size"],optionValues:{aspect_ratio:N,image_size:["1K","2K"]}}],H=q(["model","aspect_ratio"],{aspect_ratio:N}),j={aspect_ratio:[...new Set([...N,"1:4","1:8","4:1","8:1"])],image_size:[...new Set(["0.5K","1K","2K","4K"])],quality:k,size:["1024x1024","1024x1536","1536x1024"],background:O.IMAGE_CONFIG_BACKGROUND_VALUES,output_format:O.IMAGE_CONFIG_OUTPUT_FORMAT_VALUES,moderation:O.IMAGE_CONFIG_MODERATION_VALUES};function B(e){let t=function(e){if("string"!=typeof e)return;let t=e.trim();if(0!==t.length)return t.toLowerCase()}(e);if(void 0===t)return q(D.fields,D.optionValues);let a=W.find(e=>e.match(t));return a?q(a.fields,a.optionValues):H}function X(e,t){return B(t).optionValuesByField[e]}function V(e,t){for(let a of B(t).supportedFields)if(a===e)return!0;return!1}function q(e,t){return{supportedFields:new Set(e),optionValuesByField:t}}e.s(["getAllImageGenerationOptionValues",0,function(e){return j[e]},"getImageGenerationOptionValues",0,X,"isImageGenerationFieldSupported",0,V,"isImageGenerationParameterSupported",0,function(e,t,a){if(!G(e)||!V(e,a))return!1;let o=X(e,a);return void 0===o||"string"!=typeof t||o.some(e=>e===t)},"isSerializableImageGenerationParameterKey",0,G],434648)},264678,e=>{"use strict";var t=e.i(394359),a=e.i(60628),o=e.i(334714);e.i(732610);var i=e.i(465313),n=e.i(591444),r=e.i(680600),s=e.i(80125),l=e.i(504445),c=e.i(904297),p=e.i(472195),m=e.i(442712),d=e.i(319409),u=e.i(693697),_=e.i(204067),h=e.i(28158),g=e.i(434648);let f={engine:"auto",mode:void 0,search_context_size:t.SearchContextSize.Medium,max_characters:void 0,max_results:void 0,max_uses:void 0,max_total_results:void 0,allowed_domains:[],excluded_domains:[],user_location:void 0},b={engine:"auto",max_uses:void 0,max_content_tokens:void 0,allowed_domains:[],blocked_domains:[]};function S(e){return Array.isArray(e)?e.filter(e=>"string"==typeof e&&e.length>0):[]}function x(e,t){if("number"==typeof e&&Number.isInteger(e)&&!(et.max?t.max:e}function A(e,t){if(!("number"!=typeof e||Number.isNaN(e))&&!(et.max))return e}function y(e){return d.WEB_SEARCH_ENGINE_VALUES.some(t=>t===e)}let z=(0,_.buildZodGuard)(l.ImageConfigValueSchema),E=(0,_.buildZodGuard)(r.WebSearchModeSchema),v="openrouter";function w(e){let t=Array.isArray(e.analysis_models)?e.analysis_models.filter(e=>"string"==typeof e&&e.length>0).slice(0,i.MAX_ANALYSIS_MODELS):[],a=e.model;return{analysis_models:t.length>0?t:void 0,model:"string"==typeof a&&a.length>0?a:void 0,max_tool_calls:x(e.max_tool_calls,{min:1,max:i.MAX_FUSION_AGENT_STEPS_LIMIT})}}function I(e){let t="string"==typeof e.effort?(0,_.parseSchema)(s.CompletionRequestReasoningEffortSchema,e.effort):void 0,a=t&&(0,u.isOk)(t)?t.data:void 0,o=x(e.max_tokens,{min:1});if(a||o)return{effort:a,max_tokens:o}}let M=["model","tools","instructions","max_tool_calls","max_completion_tokens","reasoning","temperature"];e.s(["DEFAULT_SHELL_ENGINE",0,v,"DEFAULT_WEB_FETCH_PARAMETERS",0,b,"DEFAULT_WEB_SEARCH_PARAMETERS",0,f,"getPersistedEnabled",0,function(e,t){return(0,n.isPlainObject)(e)&&"boolean"==typeof e.enabled?e.enabled:t},"getPersistedParameters",0,function(e){return(0,n.isPlainObject)(e)?(0,n.isPlainObject)(e.parameters)?e.parameters:e:{}},"isWebSearchEngine",0,y,"migrateLegacyImageGenerationParameters",0,function(e){return{...e,aspectRatio:void 0,outputFormat:void 0,outputCompression:void 0,aspect_ratio:e.aspect_ratio??(null===e.aspectRatio?void 0:e.aspectRatio),output_format:e.output_format??e.outputFormat,output_compression:e.output_compression??e.outputCompression}},"migrateLegacySubagentParameters",0,function(e){return"subagents"in e||!M.some(t=>void 0!==e[t])?e:{subagents:[e]}},"migrateLegacyWebFetchParameters",0,function(e){return{...e,max_uses:e.max_uses??e.maxUses,max_content_tokens:e.max_content_tokens??e.maxContentTokens,allowed_domains:e.allowed_domains??e.allowedDomains,blocked_domains:e.blocked_domains??e.blockedDomains}},"migrateLegacyWebSearchParameters",0,function(e){let t=(0,n.isPlainObject)(e.userLocation)?e.userLocation:e.user_location;return{...e,search_context_size:e.search_context_size??e.searchContextSize,max_results:e.max_results??e.maxResults,max_uses:e.max_uses??e.maxUses,max_total_results:e.max_total_results??e.maxTotalResults,allowed_domains:e.allowed_domains??e.allowedDomains,excluded_domains:e.excluded_domains??e.excludedDomains,user_location:t}},"sanitizeAdvisorParameters",0,function(e){return{advisors:function(e){if(!Array.isArray(e))return;let t=e.flatMap(e=>{let t,a;return(0,n.isPlainObject)(e)&&(void 0===e.name||"string"==typeof e.name)?[{name:"string"==typeof e.name?e.name:void 0,...(t=e.model,a=e.instructions,{model:"string"==typeof t&&t.length>0?t:void 0,instructions:"string"==typeof a&&a.trim().length>0?a:void 0,forward_transcript:"boolean"==typeof e.forward_transcript?e.forward_transcript:void 0,stream:"boolean"==typeof e.stream?e.stream:void 0,max_completion_tokens:x(e.max_completion_tokens,{min:1}),reasoning:(0,n.isPlainObject)(e.reasoning)?I(e.reasoning):void 0,temperature:A(e.temperature,{min:0,max:2})})}]:[]});return t.length>0?t:void 0}(e.advisors)}},"sanitizeDatetimeParameters",0,function(e){return{timezone:"string"==typeof e.timezone&&e.timezone.length>0?e.timezone:void 0}},"sanitizeFusionParameters",0,function(e){return{...w(e),max_completion_tokens:x(e.max_completion_tokens,{min:1}),reasoning:(0,n.isPlainObject)(e.reasoning)?I(e.reasoning):void 0,temperature:A(e.temperature,{min:0,max:2})}},"sanitizeFusionPluginParameters",0,w,"sanitizeImageGenerationParameters",0,function(e){return Object.fromEntries(Object.entries(e).filter(e=>{let[t,a]=e;return"model"===t?"string"==typeof a&&a.length>0:(0,g.isSerializableImageGenerationParameterKey)(t)&&z(a)}))},"sanitizeSearchModelsParameters",0,function(e){return{max_results:x(e.max_results,{min:c.SEARCH_MODELS_MAX_RESULTS_MIN,max:c.SEARCH_MODELS_MAX_RESULTS_LIMIT})}},"sanitizeShellParameters",0,function(e){return{engine:v}},"sanitizeSubagentParameters",0,function(e){return{subagents:function(e){if(!Array.isArray(e))return;let t=e.flatMap(e=>{let t,a,o;return(0,n.isPlainObject)(e)&&(void 0===e.name||"string"==typeof e.name)?[{name:"string"==typeof e.name?e.name:void 0,...(t=e.model,a=e.instructions,o=Array.isArray(e.tools)?e.tools.filter(e=>(0,n.isPlainObject)(e)&&"string"==typeof e.type):void 0,{model:"string"==typeof t&&t.length>0?t:void 0,tools:o&&o.length>0?o:void 0,instructions:"string"==typeof a&&a.trim().length>0?a:void 0,max_tool_calls:x(e.max_tool_calls,{min:1,max:p.MAX_SUBAGENT_TOOL_CALLS}),max_completion_tokens:x(e.max_completion_tokens,{min:1}),reasoning:(0,n.isPlainObject)(e.reasoning)?function(e){let t="string"==typeof e.effort?(0,_.parseSchema)(s.CompletionRequestReasoningEffortSchema,e.effort):void 0,a=t&&(0,u.isOk)(t)?t.data:void 0,o=x(e.max_tokens,{min:1});if(a||o)return{effort:a,max_tokens:o}}(e.reasoning):void 0,temperature:A(e.temperature,{min:0,max:2})})}]:[]});return t.length>0?t:void 0}(e.subagents)}},"sanitizeWebFetchParameters",0,function(e){var t;return{engine:"string"==typeof e.engine&&(t=e.engine,m.WEB_FETCH_ENGINE_VALUES.some(e=>e===t))?e.engine:b.engine,max_uses:x(e.max_uses,{min:m.WEB_FETCH_MAX_USES_MIN}),max_content_tokens:x(e.max_content_tokens,{min:m.WEB_FETCH_MAX_CONTENT_TOKENS_MIN}),allowed_domains:S(e.allowed_domains),blocked_domains:S(e.blocked_domains)}},"sanitizeWebSearchParameters",0,function(e){var t;let i="string"==typeof e.engine&&y(e.engine)?e.engine:f.engine,r="string"==typeof e.search_context_size&&(t=e.search_context_size,d.SEARCH_CONTEXT_SIZE_VALUES.some(e=>e===t))?e.search_context_size:f.search_context_size,s=E(e.mode)?e.mode:f.mode;return{engine:i,mode:void 0===s?void 0:(0,o.resolveWebSearchMode)((0,h.resolveWebSearchModeEngine)(i),s),search_context_size:r,max_characters:x(e.max_characters,{min:d.WEB_SEARCH_MAX_CHARACTERS_MIN,max:a.WEB_SEARCH_MAX_CHARACTERS_MAX}),max_results:x(e.max_results,{min:d.WEB_SEARCH_MAX_RESULTS_MIN,max:a.WEB_SEARCH_MAX_RESULTS_MAX}),max_uses:x(e.max_uses,{min:d.WEB_SEARCH_MAX_USES_MIN}),max_total_results:x(e.max_total_results,{min:d.WEB_SEARCH_MAX_TOTAL_RESULTS_MIN}),allowed_domains:S(e.allowed_domains),excluded_domains:S(e.excluded_domains),user_location:function(e){if(!(0,n.isPlainObject)(e))return;let t={type:"approximate",city:"string"==typeof e.city&&e.city.length>0?e.city:void 0,region:"string"==typeof e.region&&e.region.length>0?e.region:void 0,country:"string"==typeof e.country&&e.country.length>0?e.country:void 0,timezone:"string"==typeof e.timezone&&e.timezone.length>0?e.timezone:void 0};if(t.city||t.region||t.country||t.timezone)return t}(e.user_location)}}])},604638,e=>{"use strict";var t=e.i(687421),a=e.i(334714),o=e.i(500397),i=e.i(591444),n=e.i(504445),r=e.i(621894),s=e.i(493901),l=e.i(904297),c=e.i(856954),p=e.i(442712),m=e.i(319409);e.i(204067);var d=e.i(796805),u=e.i(28158),_=e.i(434648),h=e.i(264678);let g={advisors:d.z.array(d.z.looseObject({name:d.z.string().optional()})).optional()},f={subagents:d.z.array(d.z.looseObject({name:d.z.string().optional()})).optional()},b={engine:d.z.enum(c.SHELL_ENGINE_VALUES).optional()},S={exa:["engine","search_context_size","max_characters","max_results","max_uses","max_total_results","allowed_domains","excluded_domains"],firecrawl:["engine","max_results","max_uses","max_total_results","allowed_domains","excluded_domains"],parallel:["engine","search_context_size","max_characters","max_results","max_uses","max_total_results","allowed_domains","excluded_domains"],perplexity:["engine","search_context_size","max_characters","max_results","max_uses","max_total_results","allowed_domains","excluded_domains"]},x={[t.ProviderName.Anthropic]:["engine","max_uses","allowed_domains","excluded_domains","user_location"],[t.ProviderName.ClaudeOnAws]:["engine","max_uses","allowed_domains","excluded_domains","user_location"],[t.ProviderName.OpenAI]:["engine","allowed_domains"],[t.ProviderName.Azure]:["engine","allowed_domains"],[t.ProviderName.XAI]:["engine","allowed_domains","excluded_domains"],[t.ProviderName.Google]:["engine"],[t.ProviderName.GoogleAIStudio]:["engine"]};function A(e,t,o){var i,n;let r,s=(i=t.engine,n=o,"auto"===(r=i??"auto")||"native"===r?n?.supportsNativeWebSearch===!0&&void 0!==n.providerName?{kind:"native",providerName:n.providerName}:{kind:"sdk",engine:(0,u.resolveWebSearchModeEngine)(r)}:{kind:"sdk",engine:r});return"sdk"===s.kind?"mode"===e?void 0!==(0,a.getWebSearchModeConfig)(s.engine):S[s.engine].some(t=>t===e):(x[s.providerName]??["engine"]).some(t=>t===e)}let y={...n.KNOWN_IMAGE_CONFIG_FIELDS_SHAPE,...s.IMAGE_GENERATION_PARAMS_SHAPE},z={webSearch:{id:"webSearch",apiType:"openrouter:web_search",schemaShape:m.WEB_SEARCH_PARAMS_SHAPE,defaultParameters:h.DEFAULT_WEB_SEARCH_PARAMETERS,enabledByDefault:!0,isVisibleInChatroom:!0,isAvailableForFreeModels:!1,sanitizeParameters:h.sanitizeWebSearchParameters,migrateLegacyParameters:h.migrateLegacyWebSearchParameters},webFetch:{id:"webFetch",apiType:"openrouter:web_fetch",schemaShape:p.WEB_FETCH_PARAMS_SHAPE,defaultParameters:h.DEFAULT_WEB_FETCH_PARAMETERS,enabledByDefault:!0,isVisibleInChatroom:!0,isAvailableForFreeModels:!1,sanitizeParameters:h.sanitizeWebFetchParameters,migrateLegacyParameters:h.migrateLegacyWebFetchParameters},imageGeneration:{id:"imageGeneration",apiType:"openrouter:image_generation",schemaShape:y,defaultParameters:{},enabledByDefault:!1,isVisibleInChatroom:!0,isAvailableForFreeModels:!1,sanitizeParameters:h.sanitizeImageGenerationParameters,migrateLegacyParameters:h.migrateLegacyImageGenerationParameters},datetime:{id:"datetime",apiType:"openrouter:datetime",schemaShape:r.DATETIME_PARAMS_SHAPE,defaultParameters:{timezone:void 0},enabledByDefault:!1,isVisibleInChatroom:!0,isAvailableForFreeModels:!0,sanitizeParameters:h.sanitizeDatetimeParameters},searchModels:{id:"searchModels",apiType:"openrouter:experimental__search_models",schemaShape:l.SEARCH_MODELS_PARAMS_SHAPE,defaultParameters:{max_results:void 0},enabledByDefault:!1,isVisibleInChatroom:!1,isAvailableForFreeModels:!1,sanitizeParameters:h.sanitizeSearchModelsParameters},fusion:{id:"fusion",apiType:"openrouter:fusion",schemaShape:o.FUSION_PARAMS_SHAPE,defaultParameters:{analysis_models:void 0,model:void 0,max_tool_calls:void 0,max_completion_tokens:void 0,reasoning:void 0,temperature:void 0},enabledByDefault:!1,isVisibleInChatroom:!0,isAvailableForFreeModels:!1,sanitizeParameters:h.sanitizeFusionParameters},advisor:{id:"advisor",apiType:"openrouter:advisor",schemaShape:g,defaultParameters:{advisors:void 0},enabledByDefault:!1,isVisibleInChatroom:!0,isAvailableForFreeModels:!0,sanitizeParameters:h.sanitizeAdvisorParameters},subagent:{id:"subagent",apiType:"openrouter:subagent",schemaShape:f,defaultParameters:{subagents:void 0},enabledByDefault:!1,isVisibleInChatroom:!0,isAvailableForFreeModels:!0,sanitizeParameters:h.sanitizeSubagentParameters,migrateLegacyParameters:h.migrateLegacySubagentParameters},shell:{id:"shell",apiType:"openrouter:shell",schemaShape:b,defaultParameters:{engine:h.DEFAULT_SHELL_ENGINE},serializationBaseline:{engine:"auto"},enabledByDefault:!1,isVisibleInChatroom:!0,isAvailableForFreeModels:!1,sanitizeParameters:h.sanitizeShellParameters}},E=[z.datetime,z.webSearch,z.webFetch,z.imageGeneration,z.searchModels,z.fusion,z.advisor,z.subagent,z.shell],v={webSearch:I(z.webSearch),webFetch:I(z.webFetch),imageGeneration:I(z.imageGeneration),datetime:I(z.datetime),searchModels:I(z.searchModels),fusion:I(z.fusion),advisor:I(z.advisor),subagent:I(z.subagent),shell:I(z.shell)};function w(e,t){switch(t){case"webSearch":return M(z.webSearch,e.webSearch);case"webFetch":return M(z.webFetch,e.webFetch);case"imageGeneration":return M(z.imageGeneration,e.imageGeneration);case"datetime":return M(z.datetime,e.datetime);case"searchModels":return M(z.searchModels,e.searchModels);case"fusion":return M(z.fusion,e.fusion);case"advisor":return M(z.advisor,e.advisor);case"subagent":return M(z.subagent,e.subagent);case"shell":return M(z.shell,e.shell)}return v.datetime}function I(e){return{enabled:e.enabledByDefault,parameters:e.defaultParameters}}function M(e,t){let a=(0,h.getPersistedParameters)(t),o=e.migrateLegacyParameters?e.migrateLegacyParameters(a):a;return{enabled:(0,h.getPersistedEnabled)(t,e.enabledByDefault),parameters:e.sanitizeParameters(o)}}e.s(["ADVISOR_UI_PARAMS_SHAPE",0,g,"DEFAULT_TOOLS_CONFIG",0,v,"SERVER_TOOL_CONFIG_BY_ID",0,z,"SERVER_TOOL_CONFIG_DEFINITIONS",0,E,"SUBAGENT_UI_PARAMS_SHAPE",0,f,"isToolParameterVisible",0,function({toolId:e,fieldKey:t,parameters:a,capabilityContext:o}){switch(e){case"imageGeneration":return(0,_.isImageGenerationFieldSupported)(t,a.model);case"webSearch":{let e=a.engine;return A(t,{engine:"string"==typeof e&&(0,h.isWebSearchEngine)(e)?e:void 0},o)}case"webFetch":case"datetime":case"searchModels":case"fusion":case"advisor":case"subagent":case"shell":return!0;default:return e}},"isWebSearchFieldSupported",0,A,"mergeToolKey",0,w,"mergeToolsWithDefaults",0,function(e){let t=(0,i.isPlainObject)(e.tools)?e.tools:{};return{webSearch:w(t,"webSearch"),webFetch:w(t,"webFetch"),imageGeneration:w(t,"imageGeneration"),datetime:w(t,"datetime"),searchModels:w(t,"searchModels"),fusion:w(t,"fusion"),advisor:w(t,"advisor"),subagent:w(t,"subagent"),shell:w(t,"shell")}},"migrateLegacyShellTool",0,function(e){let t=(0,i.isPlainObject)(e.tools)?e.tools:void 0;if(!t||!(0,i.isPlainObject)(t.bash))return e;let a=t.bash,{bash:o,...n}=t;return{...e,tools:{...n,shell:{..."boolean"==typeof a.enabled&&{enabled:a.enabled},parameters:{}}}}}])}]); //# sourceMappingURL=0twu936471bix.js.map //# chunkId=01a090e3-15a9-7da1-9ddd-7186a286c708