(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,348563,e=>{"use strict";var t=e.i(632339),o=e.i(56629);let i=new Map([[t.f.Exa,{modes:Object.values(o.v),defaultMode:o.v.Auto,legacyBillingMode:o.v.Auto}],[t.f.Parallel,{modes:Object.values(o.d),defaultMode:o.d.Basic,legacyBillingMode:o.d.Turbo}]]);function a(e){return void 0===e?void 0:i.get(e)}e.s(["J",0,a,"M",0,function(e,t){let o=a(e);if(o)return void 0!==t&&o.modes.includes(t)?t:o.defaultMode}])},491301,e=>{"use strict";e.i(882844);let t=e.i(635157).z.string().trim().min(1).max(64).regex(/^[a-zA-Z0-9 _-]+$/);e.s(["T",0,64,"A",0,t,"K",0,function(e){let t=[],o=0,i=new Set;for(let[a,n]of e.entries()){let e=n.name?.trim();if(!e){++o>1&&t.push({kind:"multiple_unnamed",index:a});continue}if(i.has(e)){t.push({kind:"duplicate_name",index:a,name:e});continue}i.add(e)}return t}])},708187,e=>{"use strict";var t=e.i(882844);let o=e.i(635157).z.object({upstream_inference_cost:(0,t.$)().nullish(),upstream_inference_prompt_cost:(0,t.$)(),upstream_inference_completions_cost:(0,t.$)(),server_tool_cost:(0,t.$)().nullish().openapi({description:"Metered server-tool execution cost (for example, shell sandbox time) billed for this request, in USD. Matches the billed checkpoint and settlement amounts exactly. 0 when a metered server tool ran but settled at zero dollars; absent when no metered server tool ran."})}).openapi("CostDetails",{description:"Breakdown of upstream inference costs",example:{upstream_inference_cost:null,upstream_inference_prompt_cost:8e-4,upstream_inference_completions_cost:4e-4}});e.s(["f",0,o])},51214,e=>{"use strict";e.i(882844);var t=e.i(635157);let o=t.z.object({type:t.z.literal("text"),text:t.z.string()}).openapi("PredictionContentText",{description:"Text content part for a predicted output.",example:{type:"text",text:"Expected response"}}),i=t.z.object({type:t.z.literal("image_url"),image_url:t.z.object({url:t.z.string()})}).openapi("ContentPartImage",{example:{type:"image_url",image_url:{url:"https://example.com/image.png"}}});e.s(["i",0,i,"d",0,o])},429497,919157,e=>{"use strict";var t=e.i(882844),o=e.i(635157),i=e.i(72916);let a=o.z.string().min(1).max(64).regex(/^[a-z0-9][a-z0-9_-]*$/,'rule ids are lowercase letters, digits, "-" and "_"'),n=o.z.object({id:a.openapi({description:"Stable id, unique within its source; reported as the deciding rule when it fires."}),name:o.z.string().min(1).max(120).optional().openapi({description:"Display name shown in verdict explanations; defaults to the id."}),instructions:o.z.string().min(1).max(8e3).openapi({description:"What the rule matches, written for the classifier."}),threshold:(0,t.$)().min(0).max(1).optional().openapi({description:"Probability at or above which the rule counts as matched. Defaults to 0.6 for hard-deny and soft-deny rules and 0.7 for allow rules (an exception needs stronger evidence to clear a matched soft deny)."})}).openapi("ArmorRule"),r=o.z.union([o.z.string().min(1).max(8122),n]),s=o.z.string().trim().min(1).max(120).refine(e=>!e.includes(": "),{message:'environment names cannot contain ": "'}).openapi({type:"string",minLength:1,maxLength:120}),l=o.z.object({name:s,value:o.z.string().trim().max(4e3)}).openapi("ArmorEnvironmentEntry"),p=o.z.union([o.z.string().min(1).max(4122),l]),d=o.z.object({environment:o.z.array(p).optional(),hard_deny:o.z.array(r).optional(),soft_deny:o.z.array(r).optional(),allow:o.z.array(r).optional()}).superRefine((e,t)=>{let o=function(e){let t=new Set,o=new Set;for(let i of[...e.hard_deny??[],...e.soft_deny??[],...e.allow??[]])"string"!=typeof i&&(t.has(i.id)&&o.add(i.id),t.add(i.id));return[...o]}(e);o.length>0&&t.addIssue({code:"custom",message:`rule ids must be unique within a context: ${o.join(", ")}`})}).openapi("ArmorAutoMode"),c=o.z.unknown().pipe(t.Q).openapi({description:"Carried unchanged; any JSON value."});function u(e){return e.catchall(c)}let m=u(o.z.object({cwd:o.z.string().optional(),root:o.z.string().nullish(),branch:o.z.string().nullish(),default_branch:o.z.string().nullish(),status:o.z.object({clean:o.z.boolean(),counts:o.z.record(o.z.string(),o.z.number().int().nullable()).nullish(),porcelain:o.z.string().nullish(),truncated:o.z.boolean().optional()}).nullish(),visibility:u(o.z.object({origin:o.z.object({host:o.z.string(),remote:o.z.string(),visibility:o.z.string()}).nullish(),push_remote:o.z.string().nullish()})).nullish()})),h=u(o.z.object({v:o.z.literal(1),auto_mode:d.optional(),git_state:m.optional().openapi({"x-hidden":!0}),live_cwd:o.z.string().optional().openapi({"x-hidden":!0}),platform:o.z.string().optional().openapi({"x-hidden":!0})})).openapi("ArmorContext",{description:"The Armor context (v1): `auto_mode` holds the rules and environment facts. Claude Code also sends its own ground truth (`git_state`, `live_cwd`, `platform`), which Armor reads; a custom agent states the same facts in `auto_mode.environment`. Any other key is carried unchanged.",example:{v:1,auto_mode:{environment:["Trusted repo: github.com/acme/app"],hard_deny:[],soft_deny:[{id:"secrets-in-vcs",instructions:"Staging, committing or pushing a file that holds secrets, including indirectly through git add -A when the tree shows one."}],allow:[]}}});e.s(["p",0,"dangerous_tool_use","P",0,h],919157);let g="enforce",f=o.z.enum([g,"audit"]),b="block",_=o.z.enum(["log",b]),x=o.z.enum(["text","custom_item","claude_code_compatibility"]),y=o.z.strictObject({mode:f.optional().openapi({description:`\`enforce\` withholds blocked calls; \`audit\` evaluates and reports the same verdicts without withholding any calls, regardless of \`on_error\`. Default \`${g}\`.`}),classifier_context:h.optional().openapi({description:"The Armor context: Claude Code's `classifier_context` (v1), with `auto_mode.{hard_deny,soft_deny,allow}` rules as strings or `{ id, instructions, threshold? }` objects and `auto_mode.environment` entries as `\"Name: value\"` strings or `{ name, value }` objects. `threshold` applies when Armor evaluates; when the provider evaluates natively (Anthropic dangerous-tool-use beta) rules are judged at the provider's own boundary."}),use_cc_style_default_rules:o.z.boolean().optional().openapi({description:"Prepend Claude Code's built-in auto-mode rule set (1 hard-deny, 72 soft-deny, 17 allow, 21 environment slots) ahead of every configured rule. Defaults to true on the Anthropic Messages API and false elsewhere."}),on_error:_.optional().openapi({description:`When the classifier cannot answer (timeout, upstream error, context too long) the call is reported \`unavailable\`; \`block\` rejects it and \`log\` releases it. Default \`${b}\`.`}),model:o.z.string().min(1).max(200).optional().openapi({"x-hidden":!0,description:"Ignored. Armor evaluates with its own decisions model."})}),v=y.extend({id:o.z.literal(i.f.Armor),enabled:o.z.boolean().optional().openapi({description:"Set to false to disable Armor for this request. Defaults to true."}),evaluate_native_tools:o.z.boolean().optional().openapi({description:"Run provider-native server tools (web search, code execution, ...) through the agent loop so Armor evaluates them too. Defaults to false: native passthrough stands and such calls are reported `skipped`."}),output_mode:x.optional().openapi({description:"How a blocked call reaches the caller. `text` (the default): the call is withheld and an `` marker stands in assistant text. `custom_item` (Responses API only): the call is withheld and an `openrouter:armor_blocked` output item carries its id, name, arguments and the rule that fired. `claude_code_compatibility` (Messages API only; the default when the request carries a `dangerous_tool_use` safeguard, i.e. the client speaks Claude Code's protocol): the `tool_use` stays in `content[]` and the verdict is `flagged` in `safeguard_results`, so the client withholds execution and writes the error tool result as under the native classifier. Under `text` and `custom_item` the model received a failure result in the loop and continued in the same request; under `claude_code_compatibility` the turn ends on the flagged call and the model continues on the next request, after the client's denial."})}).openapi("ArmorPlugin",{description:"Evaluates every client tool call the model emits against a rule stack (hard-deny, soft-deny, allow) before it reaches the caller. The stack merges the workspace guardrail, this plugin, and any Anthropic `safeguards`; on endpoints that support Anthropic's `dangerous-tool-use` beta the evaluation is native, elsewhere it is one decisions call per tool call. Evaluation is not billed during the beta. Verdicts are reported as `safeguard_results`.",example:{id:"armor",use_cc_style_default_rules:!0,classifier_context:{v:1,auto_mode:{environment:["Trusted repo: github.com/acme/app"],soft_deny:[{id:"no-migrations-delete",instructions:"Deleting a file under db/migrations."}]}}}});e.s(["g",0,v,"m",0,y],429497)},956822,e=>{"use strict";e.i(882844);var t=e.i(635157);let o={...e.i(347508).v,XHigh:"xhigh",Max:"max"},i=t.z.enum(o),a=o.Medium,n=[o.Low,o.Medium,o.High,o.XHigh,o.Max];e.s(["o",0,n,"a",0,{low:{lower:0,upper:20},medium:{lower:20,upper:40},high:{lower:40,upper:60},xhigh:{lower:60,upper:80},max:{lower:80,upper:100}},"B",0,o,"g",0,i,"U",0,a])},787027,888626,74543,51889,e=>{"use strict";e.i(882844);var t=e.i(635157),o=e.i(72916),i=e.i(956822);e.s(["A",0,1024,"t",0,1024,"Q",0,65536],888626);let a=t.z.array(t.z.string().max(1024)).max(1024).refine(e=>65536>=e.reduce((e,t)=>e+t.length,0),{message:"Total model pattern length must be at most 65536 characters"});e.s(["f",0,a],74543);let n=t.z.object({id:t.z.literal(o.f.AutoBetaRouter),enabled:t.z.boolean().optional().openapi({description:"Set to false to disable the auto-beta-router plugin for this request. Defaults to true."}),allowed_models:a.optional().openapi({description:'List of model patterns to filter which models the auto-beta-router can route between. Supports wildcards (e.g., "anthropic/*" matches all Anthropic models). Up to 1024 patterns, each at most 1024 characters, with 65536 total characters across all patterns. When not specified, every model ranked for the classified task type is a candidate, falling back to a default model set when rankings are unavailable.',example:["anthropic/*","openai/gpt-4o","google/*"]}),excluded_models:a.optional().openapi({description:'List of model patterns to exclude from auto-beta-router selection. Supports wildcards (e.g., "meta-llama/*" excludes all Llama models). Up to 1024 patterns, each at most 1024 characters, with 65536 total characters across all patterns. Applied after allowed_models, so an excluded pattern always wins over an allowed one.',example:["openai/gpt-4o","meta-llama/*"]}),cost_quality_tradeoff:t.z.number().int().min(0).max(10).optional().openapi({description:"Deprecated: Use cost_tier instead. Balances routing between cost and quality on a 0-10 scale. The auto-beta-router ranks models for the classified task type by community spend share, then filters candidates by their average cost per generation for that task. Higher values favor cheaper models: 10 keeps only models around the cheapest 10th percentile, while 0 permits models up to the 90th percentile for cost. Defaults to 9 when no cost setting is provided. It remains supported and retains ceiling behavior, but cost_tier takes precedence when both are provided.",example:9,deprecated:!0}),cost_tier:i.g.optional().openapi({description:"Named cost/quality setting. For auto-beta-router, tiers select cost-percentile bands: low = [0, 20), medium = [20, 40), high = [40, 60), xhigh = [60, 80), and max = [80, 100]. Takes precedence over the deprecated numeric cost_quality_tradeoff when both are provided.",example:"low"})}).openapi("AutoBetaRouterPlugin",{example:{id:"auto-beta-router",enabled:!0,allowed_models:["anthropic/*","openai/*"],excluded_models:["openai/gpt-4o"],cost_tier:"low"}});e.s(["K",0,9,"u",0,n],51889);let r=t.z.object({id:t.z.literal(o.f.AutoRouter),enabled:t.z.boolean().optional().openapi({description:"Set to false to disable the auto-router plugin for this request. Defaults to true."}),allowed_models:a.optional().openapi({description:'List of model patterns to filter which models the auto-router can route between. Supports wildcards (e.g., "anthropic/*" matches all Anthropic models). Up to 1024 patterns, each at most 1024 characters, with 65536 total characters across all patterns. When not specified, every model ranked for the classified task type is a candidate, falling back to a default model set when rankings are unavailable.',example:["anthropic/*","openai/gpt-4o","google/*"]}),excluded_models:a.optional().openapi({description:'List of model patterns to exclude from auto-router selection. Supports wildcards (e.g., "meta-llama/*" excludes all Llama models). Up to 1024 patterns, each at most 1024 characters, with 65536 total characters across all patterns. Applied after allowed_models, so an excluded pattern always wins over an allowed one.',example:["openai/gpt-4o","meta-llama/*"]}),cost_quality_tradeoff:t.z.number().int().min(0).max(10).optional().openapi({description:"Deprecated: Use cost_tier instead. Balances routing between cost and quality on a 0-10 scale. The auto-router ranks models for the classified task type by community spend share, then filters candidates by their average cost per generation for that task. Higher values favor cheaper models: 10 keeps only models around the cheapest 10th percentile, while 0 permits models up to the 90th percentile for cost. Defaults to 9 when no cost setting is provided. It remains supported and retains ceiling behavior, but cost_tier takes precedence when both are provided.",example:9,deprecated:!0}),cost_tier:i.g.optional().openapi({description:"Named cost/quality setting. Tiers select cost-percentile bands: low = [0, 20), medium = [20, 40), high = [40, 60), xhigh = [60, 80), and max = [80, 100]. Takes precedence over the deprecated numeric cost_quality_tradeoff when both are provided.",example:"low"}),pin_model:t.z.boolean().optional().openapi({description:"When true, reuses the model from the most recent assistant message's `model` attribute for subsequent turns. Defaults to false.",example:!1})}).openapi("AutoRouterPlugin",{example:{id:"auto-router",enabled:!0,allowed_models:["anthropic/*","openai/*"],excluded_models:["openai/gpt-4o"],cost_tier:"low",pin_model:!1}});e.s(["s",0,9,"d",0,r],787027)},818001,634585,e=>{"use strict";var t=e.i(882844),o=e.i(635157),i=e.i(72916),a=e.i(449964);let n="pdf-text",r=o.z.union([o.z.enum(a.f),o.z.literal(n)]).openapi("PDFParserEngine",{description:'The engine to use for parsing PDF files. "pdf-text" is deprecated and automatically redirected to "cloudflare-ai".',example:"cloudflare-ai"}),s=o.z.object({engine:r.optional()}).openapi("PDFParserOptions",{description:"Options for PDF parsing.",example:{engine:"cloudflare-ai"}}),l=o.z.object({id:o.z.literal(i.f.FileParser),enabled:o.z.boolean().optional().openapi({description:"Set to false to disable the file-parser plugin for this request. Defaults to true."}),pdf:s.optional()}).openapi("FileParserPlugin",{example:{id:"file-parser",enabled:!0,pdf:{engine:"cloudflare-ai"}}});e.s(["f",0,n,"o",0,l],818001);let p=o.z.object({id:o.z.literal(i.f.ParetoRouter),enabled:o.z.boolean().optional().openapi({description:"Set to false to disable the pareto-router plugin for this request. Defaults to true."}),min_coding_score:(0,t.$)().min(0).max(1).optional().openapi({description:"Minimum coding quality score between 0 and 1. Maps to internal quality tiers: >= 0.66 → high (top coding models), >= 0.33 → medium (strong modern flagships), < 0.33 → low (capable coders above the median). Omit to default to the highest tier (equivalent to >= 0.66). Not used when max_price is set (price-based selection takes over).",minimum:0,maximum:1,example:.8}),max_price:(0,t.$)().min(0).optional().openapi({description:"Maximum input price in USD per million tokens. When set, quality-tier selection (min_coding_score) is bypassed: the router computes the Pareto frontier over the top coding models and routes to the best-scoring frontier model priced at or below this cap, falling back through cheaper frontier models, then non-frontier models. Enforced against the price source given by price_source. Returns 404 when no candidate satisfies the cap.",minimum:0,example:5}),price_source:o.z.enum(["prompt","weighted_avg"]).optional().openapi({description:'Price source for the Pareto frontier cost axis and for enforcing max_price. "prompt" uses catalog list price (endpoint.pricing.prompt). "weighted_avg" uses traffic-weighted effective input price from ClickHouse, falling back to prompt price for models without traffic data. Defaults to "prompt".'})}).openapi("ParetoRouterPlugin",{example:{id:"pareto-router",enabled:!0,max_price:5,price_source:"prompt"}});e.s(["Y",0,0,"C",0,p],634585)},35554,e=>{"use strict";var t=e.i(882844),o=e.i(635157),i=e.i(47525),a=e.i(485913),n=e.i(834336),r=e.i(948913);let s=(0,t.z)(o.z.string()).min(1).max(a.Z).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 ${a.Z} 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"]}),l=o.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"}),p=o.z.number().int().min(1).max(a.h).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 ${a.P}. Capped at ${a.h}.`,example:12}),d=(0,t.D)().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 ${a.b} when omitted.`,example:16384}),c=o.z.object({effort:n.P.optional().openapi({description:"Reasoning effort level for panelist and analyst inner calls."}),max_tokens:(0,t.D)().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."}),u=(0,t.$)().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}),m=i.i.optional(),h=o.z.object({type:o.z.string().openapi({description:'Server tool type identifier (e.g. "openrouter:web_search", "openrouter:web_fetch").'}),parameters:o.z.record(o.z.string(),o.z.unknown()).optional().openapi({description:"Optional configuration forwarded as the tool's `parameters` object."})}),g={analysis_models:s,model:l,max_tool_calls:p,max_completion_tokens:d,reasoning:c,temperature:u,cache_control:m,tools:o.z.array(h).max(a.a).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"}]})},f=o.z.object(g).openapi("FusionServerToolConfig",{description:`Configuration for the ${r.d.OpenRouterFusion} server tool.`,example:{analysis_models:["~anthropic/claude-opus-latest","~openai/gpt-sol-latest","~google/gemini-pro-latest"]}}),b=o.z.object({model:o.z.string().openapi({description:"Slug of the analysis model that failed."}),error:o.z.string().openapi({description:"Error message describing why the model failed."}),status_code:o.z.number().int().optional().openapi({description:"HTTP status code from the upstream response, when available (e.g. 402, 429)."})});e.s(["y",0,g,"z",0,b,"G",0,f])},72916,e=>{"use strict";var t,o=((t={}).WebSearch="web",t.Moderation="moderation",t.FileParser="file-parser",t.FileResolver="file-resolver",t.Banned="banned",t.RestrictionPreflight="restriction-preflight",t.NormalizeRequest="normalize-request",t.StickySession="sticky-session",t.AdapterUsage="adapter-usage",t.Accounting="accounting",t.OutputStatistics="output-statistics",t.SecretSanitizer="secret-sanitizer",t.ResponseHealing="response-healing",t.AutoRouter="auto-router",t.JevRouter="jev-router",t.AutoBetaRouter="auto-beta-router",t.BodyBuilder="bodybuilder",t.UsageCollector="usage-collector",t.FreeRouter="free-router",t.LatestRouter="latest-router",t.AnthropicSpeedRouter="anthropic-speed-router",t.OpenAIReasoningModeRouter="openai-reasoning-mode-router",t.ContentFilter="content-filter",t.ModelArmor="model-armor",t.Lakera="lakera",t.ServerTools="server-tools",t.WebFetch="web-fetch",t.ServerToolCost="server-tool-cost",t.ContextCompression="context-compression",t.ToolFilter="tool-filter",t.ParetoRouter="pareto-router",t.RouterMetadata="router-metadata",t.Fusion="fusion",t.Phaser="phaser",t.SwitchyardRouter="switchyard-router",t.AttestationGate="attestation-gate",t.KnownCsamObservation="known-csam-observation",t.Alignment="alignment",t.Armor="armor",t);e.s(["f",()=>o])},347508,e=>{"use strict";e.i(882844);let t=e.i(635157).z.string().regex(/^[a-z][a-z0-9_-]{0,31}$/);e.s(["v",0,{Low:"low",Medium:"medium",High:"high"},"p",0,t])},632339,e=>{"use strict";var t,o=((t={}).Native="native",t.Exa="exa",t.Firecrawl="firecrawl",t.Parallel="parallel",t.Perplexity="perplexity",t);e.s(["f",()=>o])},895185,e=>{"use strict";e.i(882844);var t=e.i(635157),o=e.i(56629);let i=t.z.enum(o.f).openapi("WebSearchMode",{description:"Engine-native search mode. Exa supports instant, fast, auto (default), deep-lite, deep, and deep-reasoning. Parallel supports turbo, fast, basic (default), and advanced. Modes unsupported by the selected engine are ignored.",example:o.f.Auto});e.s(["f",0,i])},56629,e=>{"use strict";let t={Instant:"instant",Fast:"fast",Auto:"auto",DeepLite:"deep-lite",Deep:"deep",DeepReasoning:"deep-reasoning"},o={Turbo:"turbo",Fast:"fast",Basic:"basic",Advanced:"advanced"},i={...t,...o};e.s(["v",0,t,"d",0,o,"f",0,i])},121817,e=>{"use strict";e.i(882844);var t=e.i(635157);let o=t.z.object({type:t.z.literal("approximate"),city:t.z.string().nullish(),country:t.z.string().nullish(),region:t.z.string().nullish(),timezone:t.z.string().nullish()}).openapi("WebSearchUserLocation",{description:"Approximate user location for location-biased search results.",example:{type:"approximate",city:"San Francisco",region:"California",country:"US",timezone:"America/Los_Angeles"}});e.s(["f",0,o])},751899,e=>{"use strict";e.i(882844);var t=e.i(635157);let o=t.z.object({allowed_x_handles:t.z.array(t.z.string()).max(20).optional().openapi({description:"Only include posts from these X handles (max 20). Cannot be used with excluded_x_handles.",example:["OpenRouterAI"]}),excluded_x_handles:t.z.array(t.z.string()).max(20).optional().openapi({description:"Exclude posts from these X handles (max 20). Cannot be used with allowed_x_handles.",example:["spamaccount"]}),from_date:t.z.iso.date().optional().openapi({description:'Start of the post date range (ISO 8601 date, e.g. "2025-01-01").',example:"2025-01-01"}),to_date:t.z.iso.date().optional().openapi({description:'End of the post date range (ISO 8601 date, e.g. "2025-12-31").',example:"2025-12-31"}),enable_image_understanding:t.z.boolean().optional().openapi({description:"Analyze images attached to matching posts."}),enable_video_understanding:t.z.boolean().optional().openapi({description:"Analyze videos attached to matching posts."})}).strict().refine(e=>void 0===e.allowed_x_handles||void 0===e.excluded_x_handles,{message:"allowed_x_handles and excluded_x_handles are mutually exclusive"}).refine(e=>void 0===e.from_date||void 0===e.to_date||e.from_date<=e.to_date,{message:"to_date must not be earlier than from_date",path:["to_date"]}).openapi("XSearchOptions",{description:"Enable SpaceXAI X (Twitter) search alongside native web search, with optional filters. Only applies to SpaceXAI endpoints with native search; omit to search the web only. X search is billed separately by SpaceXAI, per post and per user profile fetched.",example:{allowed_x_handles:["OpenRouterAI"],from_date:"2025-01-01"}});e.s(["f",0,o])},819076,e=>{"use strict";var t,o=((t={}).Int4="int4",t.Int8="int8",t.FloatingPoint4="fp4",t.MicroscalingFloatingPoint4="mxfp4",t.NvidiaFloatingPoint4="nvfp4",t.FloatingPoint6="fp6",t.FloatingPoint8="fp8",t.MicroscalingFloatingPoint8="mxfp8",t.FloatingPoint16="fp16",t.BrainFloating16="bf16",t.FloatingPoint32="fp32",t.Unknown="unknown",t);let i={int4:["int4"],int8:["int8"],fp4:["fp4","mxfp4","nvfp4"],mxfp4:["mxfp4"],nvfp4:["nvfp4"],fp6:["fp6"],fp8:["fp8","mxfp8"],mxfp8:["mxfp8"],fp16:["fp16"],bf16:["bf16"],fp32:["fp32"],unknown:["unknown"]};e.s(["v",()=>o,"k",0,function(e,t){return i[e].includes(t)}])},368966,e=>{"use strict";let t={Max:"max",XHigh:"xhigh",High:"high",Medium:"medium",Low:"low",Minimal:"minimal"},o={...t,None:"none"},i={ReasoningEffortNone:"reasoning_effort_none",ChatTemplateKwargs:"chat_template_kwargs",ThinkingDisabled:"thinking_disabled",ReasoningEnabledFalse:"reasoning_enabled_false"};e.s(["V",0,t,"K",0,i,"E",0,o,"x",0,{ContentString:"content-string",ReasoningContent:"reasoning-content",Reasoning:"reasoning",None:"none"}])},337004,e=>{"use strict";var t=e.i(882844),o=e.i(635157);let i=o.z.union([o.z.string(),(0,t.$)(),o.z.array(o.z.unknown())]);o.z.record(o.z.string(),i).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 a={aspect_ratio:o.z.string().optional(),image_size:o.z.string().optional(),quality:o.z.string().optional(),size:o.z.string().optional(),background:o.z.string().optional(),output_format:o.z.string().optional(),output_compression:(0,t.D)().optional(),moderation:o.z.string().optional(),font_inputs:o.z.array(o.z.unknown()).optional(),super_resolution_references:o.z.array(o.z.string()).optional(),scoring_prompt:o.z.string().optional(),scoring_rubric:o.z.array(o.z.unknown()).optional(),background_mode:o.z.string().optional(),background_hex_color:o.z.string().optional()};e.s(["J",0,["auto","transparent","opaque"],"W",0,["auto","low"],"I",0,100,"Z",0,0,"_",0,["png","webp","jpeg"],"g",0,["auto","low","medium","high"],"T",0,i,"s",0,a])},793585,667172,464228,774076,e=>{"use strict";var t=e.i(988590),o=e.i(882844),i=e.i(635157),a=e.i(376904);let n=i.z.union([i.z.number(),i.z.string(),i.z.custom(e=>e instanceof a.f,{message:"Must be a BigNumber instance"})]);n.openapi("BigNumberUnion",{type:"string",description:"A number or string value representing a large number",example:1e3});let r=i.z.union([i.z.number().min(0),i.z.string().refine(e=>{let t=new a.f(e);return!t.isNaN()&&!t.isNegative()},{message:"Value must be a valid non-negative number"}),i.z.instanceof(a.f).refine(e=>!e.isNaN()&&!e.isNegative(),{message:"Value must be a valid non-negative number"})]).openapi("BigNumberUnionNonNegative",{type:"string",description:"A non-negative value in string format that is a large number",example:1e3});r.refine(e=>new a.f(e).gt(0),{message:"Value must be a valid positive number"}).openapi("BigNumberUnionPositive",{type:"string",description:"A positive value in string format that is a large number",example:1e3}),e.s(["A",0,r,"$",0,n],667172);let s=["monday","tuesday","wednesday","thursday","friday","saturday","sunday"];s.length;let l=i.z.array(i.z.enum(s)).min(1).refine(e=>new Set(e).size===e.length,{message:"utc_days must not repeat a weekday"}),p=i.z.object({min_prompt_tokens:(0,o.$)().optional().openapi({description:"Condition: the entry applies when the total prompt tokens of a request are strictly greater than this threshold"}),utc_start:(0,o.$)().optional().openapi({description:"Condition: inclusive start of a daily UTC time window as an HHMM clock number (e.g. 100 = 01:00, 1030 = 10:30). The entry applies while the current UTC time is inside the half-open window [utc_start, utc_end), which may wrap past midnight (utc_start > utc_end)."}),utc_end:(0,o.$)().optional().openapi({description:"Condition: exclusive end of a daily UTC time window as an HHMM clock number (e.g. 400 = 04:00)"}),utc_days:l.optional().openapi({description:"Condition: UTC weekdays the entry applies on, evaluated at the request instant. Scopes the utc_start/utc_end window (or, without a window, the whole UTC day) to the listed days. Absent means every day."}),prompt:n.optional().openapi({description:"Overridden price in USD per token for prompt (input) processing",type:"string"}),completion:n.optional().openapi({description:"Overridden price in USD per token for completion (output) generation",type:"string"}),audio:n.optional().openapi({description:"Overridden price in USD per audio input token",type:"string"}),input_audio_cache:n.optional().openapi({description:"Overridden price in USD per cached audio input token",type:"string"}),input_cache_read:n.optional().openapi({description:"Overridden price in USD per cached input token (read)",type:"string"}),input_cache_write:n.optional().openapi({description:"Overridden price in USD per cache-write token",type:"string"}),input_cache_write_1h:n.optional().openapi({description:"Overridden price in USD per 1-hour cache-write token",type:"string"})}).openapi("PricingOverride",{description:"A conditional override of the base pricing. An entry applies only when all of its condition fields (e.g. min_prompt_tokens, or the utc_start/utc_end time window) match the request; among applicable entries, later entries win per price key; price keys absent from an entry inherit the base price.",example:{min_prompt_tokens:2e5,prompt:"0.000005",completion:"0.00002"}});i.z.object({prompt:n.openapi({description:"Price in USD per token for prompt (input) processing",type:"string"}),completion:n.openapi({description:"Price in USD per token for completion (output) generation",type:"string"}),request:n.optional().openapi({description:"Price in USD per request",type:"string"}),image:n.optional().openapi({description:"Price in USD per input image",type:"string"}),image_token:n.optional().openapi({description:"Price in USD per image token",type:"string"}),image_output:n.optional().openapi({description:"Price in USD per output image",type:"string"}),audio:n.optional().openapi({description:"Price in USD per audio input token",type:"string"}),audio_output:n.optional().openapi({description:"Price in USD per audio output token",type:"string"}),input_audio_cache:n.optional().openapi({description:"Price in USD per cached audio input token",type:"string"}),web_search:n.optional().openapi({description:"Price in USD per web search",type:"string"}),internal_reasoning:n.optional().openapi({description:"Price in USD per internal reasoning token",type:"string"}),input_cache_read:n.optional().openapi({description:"Price in USD per cached input token (read)",type:"string"}),input_cache_write:n.optional().openapi({description:"Price per cache-write token, in USD per token. For providers with multiple cache TTLs (e.g. Anthropic), this is the default (5-minute) cache-write rate.",type:"string"}),input_cache_write_1h:n.optional().openapi({description:"Price per 1-hour cache-write token, in USD per token. Only present for providers that price an extended (1-hour) cache TTL separately, such as Anthropic.",type:"string"}),discount:(0,o.$)().optional().openapi({description:"Fractional discount applied to this endpoint's pricing; the price is multiplied by (1 - discount) (0 = no discount, 1 = free)"}),overrides:i.z.array(p).optional().openapi({description:"Conditional overrides of the base pricing (e.g. long-context or time-based pricing). An entry applies when all of its condition fields (e.g. min_prompt_tokens, or the utc_start/utc_end time window) match the request; among applicable entries, later entries win per key; price keys absent from an entry inherit the base price. The top-level pricing keys always reflect the price that applies under default conditions."})});let d=i.z.object({prompt:n.openapi({description:"Maximum price in USD per million prompt tokens",type:"string"}),completion:n.openapi({description:"Maximum price in USD per million completion tokens",type:"string"}),image:n.optional().openapi({description:"Maximum price in USD per image",type:"string"}),audio:n.optional().openapi({description:"Maximum price in USD per audio unit",type:"string"}),request:n.optional().openapi({description:"Maximum price in USD per request",type:"string"})}).partial().optional();e.s(["f",0,d],464228);var c=e.i(983739),u=e.i(983335),m=e.i(819076),h=e.i(880315);let g=i.z.enum(u.H).openapi("ProviderName",{example:u.H.OpenAI});i.z.string().openapi("ProviderName",{enum:Object.values(u.H),example:u.H.OpenAI});let f=i.z.record(i.z.string(),i.z.unknown()),b=[...Object.values(u.G),...u.u],_=i.z.object(Object.fromEntries(b.map(e=>[e,f.optional()]))).partial().catchall(f),x=i.z.preprocess((e,t)=>{var o;if(!e||"object"!=typeof e||Array.isArray(e))return e;let a=Object.entries(e).flatMap(([e,t])=>{let o=function(e){let[t,...o]=e.split("/");if(void 0!==t&&void 0!==(0,u.c)(t))return[t.toLowerCase(),...o].join("/")}(e);return void 0===o?[]:[[o,t]]}),n=(o=a.map(([e])=>e)).find((e,t)=>o.indexOf(e)!==t);return void 0!==n?(t.addIssue({code:"custom",message:`Provider options key "${n}" is given more than once with different casing`}),i.z.NEVER):Object.fromEntries(a)},_).openapi("ProviderOptions",{description:"Provider-specific options keyed by provider slug. The provider segment is case-insensitive; an endpoint tag after `/` must match the endpoint slug exactly. Only options for the matched provider are forwarded; the rest are ignored. Unrecognized keys are silently dropped.",example:{openai:{max_tokens:1e3}}});e.s(["f",0,x],774076);let y=i.z.enum(["deny","allow"]).openapi("DataCollection",{example:"allow"}),v=i.z.enum(m.v).openapi("Quantization",{example:m.v.FloatingPoint16}),w=i.z.enum(c.f).openapi("ProviderSort",{description:"The provider sorting strategy (price, throughput, latency)",example:c.f.Price}),z=i.z.enum([h.f.Model,h.f.None]).openapi("SortPartition",{description:'Partitioning strategy for sorting: "model" (default) groups endpoints by model before sorting (fallback models remain fallbacks), "none" sorts all endpoints together regardless of model.',example:h.f.Model}),k=i.z.object({by:w.nullish().openapi({description:"The provider sorting strategy (price, throughput, latency)",example:c.f.Price,enum:[...Object.values(c.f),null]}),partition:z.nullish().openapi({description:'Partitioning strategy for sorting: "model" (default) groups endpoints by model before sorting (fallback models remain fallbacks), "none" sorts all endpoints together regardless of model.',example:h.f.Model,enum:[h.f.Model,h.f.None,null]})}).openapi("ProviderSortConfig",{description:"The provider sorting strategy (price, throughput, latency)",example:{by:c.f.Price,partition:h.f.Model}}),P=i.z.union([w,k]).openapi("ProviderSortUnion",{description:"The provider sorting strategy (price, throughput, latency)",example:c.f.Price}),A=i.z.array(i.z.union([g,i.z.string()])).openapi("ProviderIdArray",{description:"An array of provider identifiers (names or slugs).",example:["openai","anthropic"]}),S=i.z.preprocess(e=>Array.isArray(e)?e.map(e=>"string"==typeof e?(0,t.q)(e,u.H)?u.G[u.U[e]??e]:(0,u.A)(e)??e:e):e,A),C=i.z.object({p50:(0,o.$)().nullish().openapi({description:"Minimum p50 throughput (tokens/sec)"}),p75:(0,o.$)().nullish().openapi({description:"Minimum p75 throughput (tokens/sec)"}),p90:(0,o.$)().nullish().openapi({description:"Minimum p90 throughput (tokens/sec)"}),p99:(0,o.$)().nullish().openapi({description:"Minimum p99 throughput (tokens/sec)"})}).openapi("PercentileThroughputCutoffs",{description:"Percentile-based throughput cutoffs. All specified cutoffs must be met for an endpoint to be preferred.",example:{p50:100,p90:50}}),M=i.z.object({p50:(0,o.$)().nullish().openapi({description:"Maximum p50 latency (seconds)"}),p75:(0,o.$)().nullish().openapi({description:"Maximum p75 latency (seconds)"}),p90:(0,o.$)().nullish().openapi({description:"Maximum p90 latency (seconds)"}),p99:(0,o.$)().nullish().openapi({description:"Maximum p99 latency (seconds)"})}).openapi("PercentileLatencyCutoffs",{description:"Percentile-based latency cutoffs. All specified cutoffs must be met for an endpoint to be preferred.",example:{p50:5,p90:10}}),D=i.z.union([(0,o.$)(),C]).nullish().openapi("PreferredMinThroughput",{description:"Preferred minimum throughput. Can be a number (applies to p50) or an object with percentile-specific cutoffs (p50, p75, p90, p99). All specified cutoffs must be met for an endpoint to be preferred.",example:100}),F=i.z.union([(0,o.$)(),M]).nullish().openapi("PreferredMaxLatency",{description:"Preferred maximum latency (in seconds). Can be a number (applies to p50) or an object with percentile-specific cutoffs (p50, p75, p90, p99). All specified cutoffs must be met for an endpoint to be preferred.",example:5}),T=i.z.object({allow_fallbacks:i.z.boolean().nullish().describe(`Whether to allow backup providers to serve requests - true: (default) when the primary provider (or your custom providers in "order") is unavailable, use the next best provider. - false: use only the primary/custom provider, and return the upstream error if it's unavailable. `),require_parameters:i.z.boolean().nullish().describe("Whether to filter providers to only those that support the parameters you've provided. If this setting is omitted or set to false, then providers will receive only the parameters they support, and ignore the rest."),data_collection:y.nullish().openapi({description:"Data collection setting. If no available model provider meets the requirement, your request will return an error.",example:"allow"}).describe("Data collection setting. If no available model provider meets the requirement, your request will return an error.\n- allow: (default) allow providers which store user data non-transiently and may train on it\n\n- deny: use only providers which do not collect user data."),zdr:i.z.boolean().nullish().openapi({description:"Whether to restrict routing to only ZDR (Zero Data Retention) endpoints. When true, only endpoints that do not retain prompts will be used.",example:!0}),enforce_distillable_text:i.z.boolean().nullish().openapi({description:"Whether to restrict routing to only models that allow text distillation. When true, only models where the author has allowed distillation will be used.",example:!0}),order:S.nullish().describe("An ordered list of provider slugs. The router will attempt to use the first provider in the subset of this list that supports your requested model, and fall back to the next if it is unavailable. If no providers are available, the request will fail with an error message."),only:S.nullish().describe("List of provider slugs to allow. If provided, this list is merged with your account-wide allowed provider settings for this request."),ignore:S.nullish().describe("List of provider slugs to ignore. If provided, this list is merged with your account-wide ignored provider settings for this request."),quantizations:i.z.array(v).nullish().describe("A list of quantization levels to filter the provider by."),sort:P.nullish().describe('The sorting strategy to use for this request, if "order" is not specified. When set, no load balancing is performed.'),max_price:d.describe("The object specifying the maximum price you want to pay for this request. USD price per million tokens, for prompt and completion."),preferred_min_throughput:D.openapi({description:"Preferred minimum throughput (in tokens per second). Can be a number (applies to p50) or an object with percentile-specific cutoffs. Endpoints below the threshold(s) may still be used, but are deprioritized in routing. When using fallback models, this may cause a fallback model to be used instead of the primary model if it meets the threshold.",example:100}).describe("Preferred minimum throughput (in tokens per second). Can be a number (applies to p50) or an object with percentile-specific cutoffs. Endpoints below the threshold(s) may still be used, but are deprioritized in routing. When using fallback models, this may cause a fallback model to be used instead of the primary model if it meets the threshold."),preferred_max_latency:F.openapi({description:"Preferred maximum latency (in seconds). Can be a number (applies to p50) or an object with percentile-specific cutoffs. Endpoints above the threshold(s) may still be used, but are deprioritized in routing. When using fallback models, this may cause a fallback model to be used instead of the primary model if it meets the threshold.",example:5}).describe("Preferred maximum latency (in seconds). Can be a number (applies to p50) or an object with percentile-specific cutoffs. Endpoints above the threshold(s) may still be used, but are deprioritized in routing. When using fallback models, this may cause a fallback model to be used instead of the primary model if it meets the threshold."),options:x.optional()}).openapi("ProviderPreferences",{description:"Provider routing preferences for the request.",example:{allow_fallbacks:!0}});e.s(["f",0,T],793585)},282823,478300,e=>{"use strict";e.i(882844);var t=e.i(635157);let o=t.z.string().max(256).optional().openapi({description:"A unique identifier for grouping related requests (e.g., a conversation or agent workflow). Used for observability grouping in Broadcast and private logging; never sent to the provider. If provided in both the request body and the x-session-id header, the body value takes precedence. Maximum of 256 characters.",example:"session-1234"});e.s(["w",0,"x-session-id","T",0,256,"p",0,o],282823);let i=t.z.object({trace_id:t.z.string().optional(),trace_name:t.z.string().optional(),span_name:t.z.string().optional(),generation_name:t.z.string().optional(),parent_span_id:t.z.string().optional()}).passthrough().openapi("TraceConfig",{example:{trace_id:"trace-abc123",trace_name:"my-app-trace"}}).optional().describe("Metadata for observability and tracing. Known keys (trace_id, trace_name, span_name, generation_name, parent_span_id) have special handling. Additional keys are passed through as custom metadata to configured broadcast destinations.");e.s(["f",0,i],478300)},276429,996116,980923,571639,66237,e=>{"use strict";e.i(882844);var t=e.i(635157);e.s(["T",0,40,"G",0,"sess_"],996116),e.s(["X",0,40,"P",0,16384],980923);let o=RegExp("^or_file_[0-9A-Za-z]+$");new TextEncoder;let i=t.z.enum(["copied","preexisting"]),a=t.z.object({fileId:t.z.string().regex(o),filename:t.z.string().min(1).max(255)}),n=t.z.array(a).max(20),r=a.extend({copyOutcome:i});t.z.array(r).max(20),e.s(["$",0,20,"X",0,n],571639);let s=/^[\w-]+$/;e.s(["f",0,s],66237);let l=t.z.array(t.z.string().min(1)).max(20).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 20 ids.",example:["or_file_011CNha8iCJcU1wXNR6q4V8w"]}),p=t.z.union([t.z.object({type:t.z.literal("disabled").openapi({description:"No outbound internet access."})}),t.z.object({type:t.z.literal("allowlist").openapi({description:"Outbound access restricted to the listed domains."}),allowed_domains:t.z.array(t.z.string().min(1).max(253).regex(/^(?![-.])(?!.*[-.]$)(?!.*(?:\.\.|\.-|-\.))(?!.*[^.]{64})[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"]}}),d=t.z.object({type:t.z.literal("container_reference"),network_policy:p.optional(),container_id:t.z.string().min(1).max(40).regex(s).openapi({description:"Canonical container id to reuse (max 40 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:l}).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"}}),c=t.z.object({type:t.z.literal("container_auto"),network_policy:p.optional(),file_ids:l}).openapi("ContainerAutoEnvironment",{description:"An OpenRouter-managed, auto-provisioned ephemeral container.",example:{type:"container_auto"}});e.s(["$",0,c,"I",0,d],276429)},69474,e=>{"use strict";e.i(882844);var t=e.i(635157);let o={timezone:t.z.string().optional().openapi({description:'IANA timezone name (e.g. "America/New_York"). Defaults to UTC.',example:"America/New_York"})},i=t.z.object(o).openapi("DatetimeServerToolConfig",{description:"Configuration for the openrouter:datetime server tool",example:{timezone:"America/New_York"}});e.s(["q",0,o,"t",0,i])},24200,e=>{"use strict";e.i(882844);var t=e.i(635157),o=e.i(337004);let i={model:t.z.string().optional().openapi({description:'Which image generation model to use (e.g. "openai/gpt-image-2.6-flare"). Defaults to "openai/gpt-image-2.6-flare".',example:"openai/gpt-image-2.6-flare"})},a=t.z.object(i).catchall(o.T).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-image-2.6-flare",quality:"high",aspect_ratio:"16:9"}});e.s(["Y",0,i,"K",0,a])},463826,e=>{"use strict";e.s(["J",0,100,"S",0,200,"T",0,5,"F",0,50,"W",0,1e5,"i",0,25])},453110,e=>{"use strict";var t=e.i(882844),o=e.i(635157);let i={max_results:(0,t.D)().min(1).max(20).optional().openapi({description:"Maximum number of models to return. Defaults to 5, max 20.",example:5})},a=o.z.object(i).openapi("SearchModelsServerToolConfig",{description:"Configuration for the openrouter:experimental__search_models server tool",example:{max_results:5}});e.s(["b",0,20,"Q",0,1,"F",0,i,"t",0,a])},114014,e=>{"use strict";var t=e.i(882844),o=e.i(635157),i=e.i(191545),a=e.i(980923),n=e.i(571639),r=e.i(276429),s=e.i(463826);let l=["auto","openrouter"],p=o.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"}),d=o.z.discriminatedUnion("type",[r.$,r.I]).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"}}),c=o.z.object({environment:d.optional(),engine:p}).openapi("ShellServerToolConfig",{description:"Configuration for the openrouter:shell server tool",example:{engine:"openrouter",environment:{type:"container_auto"}}});o.z.object({commands:o.z.array(o.z.string().max(a.P)).min(1).max(s.J).openapi({description:"Shell commands to run, each in its own invocation, in order.",example:["ls -la","cat package.json"]}),timeout_ms:(0,t.D)().positive().optional().openapi({description:"Maximum execution time in milliseconds applied to each command.",example:3e4}),max_output_length:(0,t.D)().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"]}}),o.z.object({apiToolParams:c,_attachFiles:n.X.optional(),_shellExecCompleted:o.z.boolean().optional()});let u=o.z.discriminatedUnion("type",[o.z.object({type:o.z.literal("exit"),exit_code:(0,t.D)()}),o.z.object({type:o.z.literal("timeout")})]),m=o.z.object({stdout:o.z.string(),stderr:o.z.string(),outcome:u});o.z.object({output:o.z.array(m),files:o.z.array(i.f).optional(),container_id:o.z.string().optional()}),e.s(["F",0,l,"k",0,c,"S",0,m,"g",0,u])},37956,434648,e=>{"use strict";var t=e.i(882844),o=e.i(635157),i=e.i(491301),a=e.i(834336);let n=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"}),r=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"}}),s=o.z.array(r).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."}),l=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."}),p=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}),d=(0,t.D)().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}),c=o.z.object({effort:a.P.optional().openapi({description:"Reasoning effort level for the subagent call."}),max_tokens:(0,t.D)().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(),u=(0,t.$)().min(0).max(2).optional().openapi({description:"Sampling temperature forwarded to the subagent call. When omitted, the provider's default applies.",example:.7}),m=i.A.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"}),h=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}),g=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"]}),f={name:m.optional(),model:n,tools:s,inherit_functions:h,inherited_function_names:g,instructions:l,max_tool_calls:p,max_completion_tokens:d,reasoning:c,temperature:u},b=o.z.object(f).openapi("SubagentServerToolConfig",{description:"Configuration for one openrouter:subagent server tool entry.",example:{name:"summarizer",model:"~anthropic/claude-haiku-latest"}});e.s(["$",0,25,"E",0,b],37956),e.i(647204),e.i(427150);var _=e.i(337004);let x=["1:1","2:3","3:2","3:4","4:3","4:5","5:4","9:16","16:9","21:9"],y=o.z.enum(x);(0,t.j)(y);let v=["1K","2K"],w=o.z.string().transform(e=>e.toUpperCase()).pipe(o.z.enum(v)),z=o.z.string().transform(e=>e.toLowerCase()).pipe(o.z.enum(_.J));o.z.object({aspect_ratio:y.optional(),image_size:w.optional(),background:z.optional()}).passthrough();let k=[..._.g,"xhigh","max"],P=["aspect_ratio","model","image_size","quality","size","background","output_format","output_compression","moderation"];function A(e){return P.some(t=>t===e)}let S={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:x,quality:_.g,size:["1024x1024","1024x1536","1536x1024"],background:_.J,output_format:_._,moderation:_.W}},C=[{match:e=>e.includes("gpt-image-2.5")||e.includes("gpt-image-2.6"),fields:["model","quality","aspect_ratio","size","background","output_format","output_compression"],optionValues:{aspect_ratio:x,quality:k,size:["1024x1024","1024x1536","1536x1024"],background:_.J,output_format:_._}},{match:e=>e.includes("gpt-image-2")||e.includes("image-2"),fields:["model","aspect_ratio","image_size"],optionValues:{aspect_ratio:x,image_size:v}},S,{match:e=>e.includes("gemini-3.1-flash-image-preview"),fields:["model","aspect_ratio","image_size"],optionValues:{aspect_ratio:[...x,"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:x,image_size:["1K","2K","4K"]}},{match:e=>e.startsWith("google/")&&e.includes("image"),fields:["model","aspect_ratio","image_size"],optionValues:{aspect_ratio:x,image_size:["1K","2K"]}},{match:e=>e.includes("seedream"),fields:["model","aspect_ratio","image_size"],optionValues:{aspect_ratio:x,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:x,image_size:["1K","2K","4K"]}},{match:e=>e.startsWith("sourceful/")&&e.includes("riverflow-v2"),fields:["model","aspect_ratio","image_size"],optionValues:{aspect_ratio:x,image_size:["1K","2K"]}}],M=R(["model","aspect_ratio"],{aspect_ratio:x}),D={aspect_ratio:[...new Set([...x,"1:4","1:8","4:1","8:1"])],image_size:[...new Set(["0.5K","1K","2K","4K"])],quality:k,size:["1024x1024","1024x1536","1536x1024"],background:_.J,output_format:_._,moderation:_.W};function F(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 R(S.fields,S.optionValues);let o=C.find(e=>e.match(t));return o?R(o.fields,o.optionValues):M}function T(e,t){return F(t).optionValuesByField[e]}function j(e,t){for(let o of F(t).supportedFields)if(o===e)return!0;return!1}function R(e,t){return{supportedFields:new Set(e),optionValuesByField:t}}e.s(["I",0,function(e){return D[e]},"$",0,T,"y",0,j,"t",0,function(e,t,o){if(!A(e)||!j(e,o))return!1;let i=T(e,o);return void 0===i||"string"!=typeof t||i.some(e=>e===t)},"H",0,A],434648)},948913,e=>{"use strict";e.i(882844);var t=e.i(635157),o=e.i(898820);t.z.enum([o.Q.Responses,o.Q.ChatCompletions,o.Q.AnthropicMessages]),e.s(["m",0,"openrouter:","d",0,{OpenRouterAdvisor:"openrouter:advisor",OpenRouterApplyPatch:"openrouter:apply_patch",OpenRouterBash:"openrouter:bash",OpenRouterDatetime:"openrouter:datetime",OpenRouterFiles:"openrouter:files",OpenRouterFusion:"openrouter:fusion",OpenRouterImageGeneration:"openrouter:image_generation",OpenRouterMcp:"openrouter:mcp",OpenRouterSearchModels:"openrouter:experimental__search_models",OpenRouterShell:"openrouter:shell",OpenRouterSubagent:"openrouter:subagent",OpenRouterToolSearch:"openrouter:tool_search",OpenRouterWebFetch:"openrouter:web_fetch",OpenRouterWebSearch:"openrouter:web_search"},"N",0,{Provider:"provider",OpenRouter:"openrouter",Client:"client"}])},685017,208218,e=>{"use strict";var t=e.i(882844),o=e.i(635157);let i=["auto","native","openrouter","exa","parallel","firecrawl"],a={engine:o.z.enum(i).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. "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,t.D)().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,t.D)().min(1).optional().openapi({description:"Maximum content length in approximate tokens. Content exceeding this limit is truncated.",example:1e5})},n=o.z.object(a).openapi("WebFetchServerToolConfig",{description:"Configuration for the openrouter:web_fetch server tool",example:{max_uses:10,max_content_tokens:1e5}});e.s(["k",0,i,"Q",0,1,"$",0,1,"K",0,a,"p",0,n],685017);var r=e.i(895185),s=e.i(121817),l=e.i(751899),p=e.i(463826);let d=["native","exa","parallel","firecrawl","perplexity","auto"],c=["low","medium","high"],u=o.z.enum(d).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 the Firecrawl search API. "parallel" uses the Parallel search API. "perplexity" uses the Perplexity Search API (raw ranked results).',example:"auto"}),m=r.f.optional(),h=(0,t.D)().min(1).max(p.i).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}),g=(0,t.D)().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}),f=(0,t.D)().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}),b=o.z.enum(c).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"}),_=(0,t.D)().min(1).max(p.W).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}),x=s.f.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"}}),y=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, SpaceXAI). Cannot be used with excluded_domains."}),v=o.z.array(o.z.string()).optional().openapi({description:"Exclude search results from these domains. Supported by Exa, Firecrawl, Parallel, Perplexity, Anthropic, OpenAI, and SpaceXAI. Cannot be used with allowed_domains."}),w=l.f.optional(),z={engine:u,mode:m,max_results:h,max_uses:g,max_total_results:f,search_context_size:b,max_characters:_,user_location:x,allowed_domains:y,excluded_domains:v,x_search:w},k=o.z.object(z).openapi("WebSearchConfig",{example:{max_results:5,search_context_size:"medium"}}),P=k.openapi("WebSearchServerToolConfig",{description:"Configuration for the openrouter:web_search server tool",example:{max_results:5,search_context_size:"medium"}});e.s(["E",0,c,"m",0,d,"u",0,1,"H",0,1,"F",0,1,"y",0,1,"e",0,z,"z",0,P,"V",0,u,"v",0,h,"C",0,g,"G",0,m,"i",0,k,"o",0,w],208218)},880315,e=>{"use strict";var t,o=((t={}).Model="model",t.None="none",t);e.s(["f",()=>o])},264678,e=>{"use strict";var t=e.i(348563),o=e.i(861907),i=e.i(647204),a=e.i(882844),n=e.i(485913),r=e.i(895185),s=e.i(743245),l=e.i(834336),p=e.i(337004),d=e.i(463826),c=e.i(453110),u=e.i(37956),m=e.i(685017),h=e.i(208218),g=e.i(28158),f=e.i(434648);let b={engine:"auto",mode:void 0,search_context_size:s.f.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},_={engine:"auto",max_uses:void 0,max_content_tokens:void 0,allowed_domains:[],blocked_domains:[]};function x(e){return Array.isArray(e)?e.filter(e=>"string"==typeof e&&e.length>0):[]}function y(e,t){if("number"==typeof e&&Number.isInteger(e)&&!(et.max?t.max:e}function v(e,t){if(!("number"!=typeof e||Number.isNaN(e))&&!(et.max))return e}function w(e){return h.m.some(t=>t===e)}let z=(0,a.j)(p.T),k=(0,a.j)(r.f),P="openrouter";function A(e){let t=Array.isArray(e.analysis_models)?e.analysis_models.filter(e=>"string"==typeof e&&e.length>0).slice(0,n.Z):[],o=e.model;return{analysis_models:t.length>0?t:void 0,model:"string"==typeof o&&o.length>0?o:void 0,max_tool_calls:y(e.max_tool_calls,{min:1,max:n.h})}}function S(e){let t="string"==typeof e.effort?(0,a.C)(l.P,e.effort):void 0,o=t&&(0,i.C)(t)?t.data:void 0,n=y(e.max_tokens,{min:1});if(o||n)return{effort:o,max_tokens:n}}let C=["model","tools","instructions","max_tool_calls","max_completion_tokens","reasoning","temperature"];e.s(["V",0,P,"e",0,_,"N",0,b,"l",0,function(e,t){return(0,o.d)(e)&&"boolean"==typeof e.enabled?e.enabled:t},"g",0,function(e){return(0,o.d)(e)?(0,o.d)(e.parameters)?e.parameters:e:{}},"U",0,w,"p",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}},"r",0,function(e){return"subagents"in e||!C.some(t=>void 0!==e[t])?e:{subagents:[e]}},"Z",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}},"C",0,function(e){let t=(0,o.d)(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}},"f",0,function(e){return{advisors:function(e){if(!Array.isArray(e))return;let t=e.flatMap(e=>{let t,i;return(0,o.d)(e)&&(void 0===e.name||"string"==typeof e.name)?[{name:"string"==typeof e.name?e.name:void 0,...(t=e.model,i=e.instructions,{model:"string"==typeof t&&t.length>0?t:void 0,instructions:"string"==typeof i&&i.trim().length>0?i: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:y(e.max_completion_tokens,{min:1}),reasoning:(0,o.d)(e.reasoning)?S(e.reasoning):void 0,temperature:v(e.temperature,{min:0,max:2})})}]:[]});return t.length>0?t:void 0}(e.advisors)}},"W",0,function(e){return{timezone:"string"==typeof e.timezone&&e.timezone.length>0?e.timezone:void 0}},"I",0,function(e){return{...A(e),max_completion_tokens:y(e.max_completion_tokens,{min:1}),reasoning:(0,o.d)(e.reasoning)?S(e.reasoning):void 0,temperature:v(e.temperature,{min:0,max:2})}},"a",0,A,"Q",0,function(e){return Object.fromEntries(Object.entries(e).filter(e=>{let[t,o]=e;return"model"===t?"string"==typeof o&&o.length>0:(0,f.H)(t)&&z(o)}))},"u",0,function(e){return{max_results:y(e.max_results,{min:c.Q,max:c.b})}},"t",0,function(e){return{engine:P}},"R",0,function(e){return{subagents:function(e){if(!Array.isArray(e))return;let t=e.flatMap(e=>{let t,i,a;return(0,o.d)(e)&&(void 0===e.name||"string"==typeof e.name)?[{name:"string"==typeof e.name?e.name:void 0,...(t=e.model,i=e.instructions,a=Array.isArray(e.tools)?e.tools.filter(e=>(0,o.d)(e)&&"string"==typeof e.type):void 0,{model:"string"==typeof t&&t.length>0?t:void 0,tools:a&&a.length>0?a:void 0,instructions:"string"==typeof i&&i.trim().length>0?i:void 0,max_tool_calls:y(e.max_tool_calls,{min:1,max:u.$}),max_completion_tokens:y(e.max_completion_tokens,{min:1}),reasoning:(0,o.d)(e.reasoning)?S(e.reasoning):void 0,temperature:v(e.temperature,{min:0,max:2})})}]:[]});return t.length>0?t:void 0}(e.subagents)}},"j",0,function(e){var t;return{engine:"string"==typeof e.engine&&(t=e.engine,m.k.some(e=>e===t))?e.engine:_.engine,max_uses:y(e.max_uses,{min:m.$}),max_content_tokens:y(e.max_content_tokens,{min:m.Q}),allowed_domains:x(e.allowed_domains),blocked_domains:x(e.blocked_domains)}},"S",0,function(e){var i;let a="string"==typeof e.engine&&w(e.engine)?e.engine:b.engine,n="string"==typeof e.search_context_size&&(i=e.search_context_size,h.E.some(e=>e===i))?e.search_context_size:b.search_context_size,r=k(e.mode)?e.mode:b.mode;return{engine:a,mode:void 0===r?void 0:(0,t.M)((0,g.f)(a),r),search_context_size:n,max_characters:y(e.max_characters,{min:h.u,max:d.W}),max_results:y(e.max_results,{min:h.H,max:d.i}),max_uses:y(e.max_uses,{min:h.y}),max_total_results:y(e.max_total_results,{min:h.F}),allowed_domains:x(e.allowed_domains),excluded_domains:x(e.excluded_domains),user_location:function(e){if(!(0,o.d)(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(348563),o=e.i(861907);e.i(882844);var i=e.i(635157),a=e.i(35554),n=e.i(771271),r=e.i(337004),s=e.i(69474),l=e.i(24200),p=e.i(453110),d=e.i(114014),c=e.i(685017),u=e.i(208218),m=e.i(28158),h=e.i(434648),g=e.i(264678);let f={advisors:i.z.array(i.z.looseObject({name:i.z.string().optional()})).optional()},b={subagents:i.z.array(i.z.looseObject({name:i.z.string().optional()})).optional()},_={engine:i.z.enum(d.F).optional()},x={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"]},y={[n.R.Anthropic]:["engine","max_uses","allowed_domains","excluded_domains","user_location"],[n.R.ClaudeOnAws]:["engine","max_uses","allowed_domains","excluded_domains","user_location"],[n.R.OpenAI]:["engine","allowed_domains"],[n.R.Azure]:["engine","allowed_domains"],[n.R.XAI]:["engine","allowed_domains","excluded_domains"],[n.R.Google]:["engine"],[n.R.GoogleAIStudio]:["engine"]};function v(e,o,i){var a,r;let s,l=(a=o.engine,r=i,"auto"===(s=a??"auto")||"native"===s?r?.supportsNativeWebSearch===!0&&void 0!==r.providerName?{kind:"native",providerName:r.providerName}:{kind:"sdk",engine:(0,m.f)(s)}:{kind:"sdk",engine:s});return"sdk"===l.kind?"mode"===e?void 0!==(0,t.J)(l.engine):x[l.engine].some(t=>t===e):(((0,n.Z)(l.providerName)?y[l.providerName]:void 0)??["engine"]).some(t=>t===e)}let w={...r.s,...l.Y},z={webSearch:{id:"webSearch",apiType:"openrouter:web_search",schemaShape:u.e,defaultParameters:g.N,enabledByDefault:!0,isVisibleInChatroom:!0,isAvailableForFreeModels:!1,sanitizeParameters:g.S,migrateLegacyParameters:g.C},webFetch:{id:"webFetch",apiType:"openrouter:web_fetch",schemaShape:c.K,defaultParameters:g.e,enabledByDefault:!0,isVisibleInChatroom:!0,isAvailableForFreeModels:!1,sanitizeParameters:g.j,migrateLegacyParameters:g.Z},imageGeneration:{id:"imageGeneration",apiType:"openrouter:image_generation",schemaShape:w,defaultParameters:{},enabledByDefault:!1,isVisibleInChatroom:!0,isAvailableForFreeModels:!1,sanitizeParameters:g.Q,migrateLegacyParameters:g.p},datetime:{id:"datetime",apiType:"openrouter:datetime",schemaShape:s.q,defaultParameters:{timezone:void 0},enabledByDefault:!1,isVisibleInChatroom:!0,isAvailableForFreeModels:!0,sanitizeParameters:g.W},searchModels:{id:"searchModels",apiType:"openrouter:experimental__search_models",schemaShape:p.F,defaultParameters:{max_results:void 0},enabledByDefault:!1,isVisibleInChatroom:!1,isAvailableForFreeModels:!1,sanitizeParameters:g.u},fusion:{id:"fusion",apiType:"openrouter:fusion",schemaShape:a.y,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:g.I},advisor:{id:"advisor",apiType:"openrouter:advisor",schemaShape:f,defaultParameters:{advisors:void 0},enabledByDefault:!1,isVisibleInChatroom:!0,isAvailableForFreeModels:!0,sanitizeParameters:g.f},subagent:{id:"subagent",apiType:"openrouter:subagent",schemaShape:b,defaultParameters:{subagents:void 0},enabledByDefault:!1,isVisibleInChatroom:!0,isAvailableForFreeModels:!0,sanitizeParameters:g.R,migrateLegacyParameters:g.r},shell:{id:"shell",apiType:"openrouter:shell",schemaShape:_,defaultParameters:{engine:g.V},serializationBaseline:{engine:"auto"},enabledByDefault:!1,isVisibleInChatroom:!0,isAvailableForFreeModels:!1,sanitizeParameters:g.t}},k=[z.datetime,z.webSearch,z.webFetch,z.imageGeneration,z.searchModels,z.fusion,z.advisor,z.subagent,z.shell],P={webSearch:S(z.webSearch),webFetch:S(z.webFetch),imageGeneration:S(z.imageGeneration),datetime:S(z.datetime),searchModels:S(z.searchModels),fusion:S(z.fusion),advisor:S(z.advisor),subagent:S(z.subagent),shell:S(z.shell)};function A(e,t){switch(t){case"webSearch":return C(z.webSearch,e.webSearch);case"webFetch":return C(z.webFetch,e.webFetch);case"imageGeneration":return C(z.imageGeneration,e.imageGeneration);case"datetime":return C(z.datetime,e.datetime);case"searchModels":return C(z.searchModels,e.searchModels);case"fusion":return C(z.fusion,e.fusion);case"advisor":return C(z.advisor,e.advisor);case"subagent":return C(z.subagent,e.subagent);case"shell":return C(z.shell,e.shell)}return P.datetime}function S(e){return{enabled:e.enabledByDefault,parameters:e.defaultParameters}}function C(e,t){let o=(0,g.g)(t),i=e.migrateLegacyParameters?e.migrateLegacyParameters(o):o;return{enabled:(0,g.l)(t,e.enabledByDefault),parameters:e.sanitizeParameters(i)}}e.s(["m",0,f,"_",0,P,"q",0,z,"r",0,k,"Y",0,b,"f",0,function({toolId:e,fieldKey:t,parameters:o,capabilityContext:i}){switch(e){case"imageGeneration":return(0,h.y)(t,o.model);case"webSearch":{let e=o.engine;return v(t,{engine:"string"==typeof e&&(0,g.U)(e)?e:void 0},i)}case"webFetch":case"datetime":case"searchModels":case"fusion":case"advisor":case"subagent":case"shell":return!0;default:return e}},"$",0,v,"F",0,A,"n",0,function(e){let t=(0,o.d)(e.tools)?e.tools:{};return{webSearch:A(t,"webSearch"),webFetch:A(t,"webFetch"),imageGeneration:A(t,"imageGeneration"),datetime:A(t,"datetime"),searchModels:A(t,"searchModels"),fusion:A(t,"fusion"),advisor:A(t,"advisor"),subagent:A(t,"subagent"),shell:A(t,"shell")}},"V",0,function(e){let t=(0,o.d)(e.tools)?e.tools:void 0;if(!t||!(0,o.d)(t.bash))return e;let i=t.bash,{bash:a,...n}=t;return{...e,tools:{...n,shell:{..."boolean"==typeof i.enabled&&{enabled:i.enabled},parameters:{}}}}}])},28158,e=>{"use strict";e.s(["f",0,function(e){if(void 0!==e)return"auto"===e||"native"===e?"exa":e}])}]); //# sourceMappingURL=2ca1xmgcd8-dt.js.map