@cline/shared 0.0.83 → 0.0.84-nightly.1790044161

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,16 +1,16 @@
1
- import{z as J}from"zod";import{z as U}from"zod";import{z as T}from"zod";var k0=["none","minimal","low","medium","high","xhigh","max"],T0=T.enum(k0),W0=T0.exclude(["none"]),B6=T.enum([...k0,"default"]).nullable(),E0=T.discriminatedUnion("type",[T.object({type:T.literal("toggle")}).strict(),T.object({type:T.literal("effort"),values:T.array(B6)}).strict(),T.object({type:T.literal("budget_tokens"),min:T.number().min(-1).optional(),max:T.number().min(0).optional()}).strict().refine((f)=>f.min===void 0||f.max===void 0||f.min<=f.max,{message:"Minimum reasoning budget cannot exceed maximum",path:["min"]})]);var bf=U.enum(["default","openai-responses","r1"]),I6={DEFAULT:"default",OPENAI_RESPONSES:"openai-responses",R1:"r1"},Mf=U.enum(["images","video","tools","streaming","prompt-cache","reasoning","reasoning-effort","computer-use","global-endpoint","structured_output","temperature","files"]),Tf=U.enum(["active","preview","deprecated","legacy"]),Ef=U.object({input:U.number().optional(),output:U.number().optional(),cacheWrite:U.number().optional(),cacheRead:U.number().optional()}),Cf=U.object({maxBudget:U.number().optional(),outputPrice:U.number().optional(),thinkingLevel:U.enum(["low","high"]).optional()}),yf=U.object({reasoningDefaultOn:U.boolean().optional(),apiProtocol:U.enum(["openai-chat","openai-responses","anthropic","gemini"]).optional()}).catchall(U.unknown()),C0=U.enum(["text","image","audio","video","pdf"]),Sf=U.object({input:U.array(C0),output:U.array(C0)});function gf(f){return(f?.input===void 0||f.input.includes("text"))&&(f?.output===void 0||f.output.includes("text"))}var vf=U.enum(["language","image-generation","speech-generation","video-generation","transcription"]);function A6(f){return(f.operation===void 0||f.operation==="language")&&gf(f.modalities)}var nf=U.enum(["batch","streaming"]);function N6(f){return f.modalities?.input.includes("text")===!0&&f.modalities.output.includes("image")}function b6(f){return f.operation==="image-generation"}function y0(f,$,w){let Y=f.capabilities;if(Y===void 0||Y.length===0)return w?.assumeWhenUnspecified??!1;return Y.includes($)}function M6(f){return y0(f,"tools",{assumeWhenUnspecified:!0})}function T6(f){return y0(f,"images",{assumeWhenUnspecified:!0})}var _0=U.object({id:U.string(),name:U.string().optional(),description:U.string().optional(),maxTokens:U.number().optional(),contextWindow:U.number().optional(),maxInputTokens:U.number().optional(),capabilities:U.array(Mf).optional(),operation:vf.optional(),operationModes:U.array(nf).optional(),modalities:Sf.optional(),reasoningOptions:U.array(E0).optional(),apiFormat:bf.optional(),systemRole:U.enum(["system","developer"]).optional(),temperature:U.number().optional(),pricing:Ef.optional(),thinkingConfig:Cf.optional(),status:Tf.optional(),deprecationNotice:U.string().optional(),replacedBy:U.string().optional(),releaseDate:U.string().optional(),deprecationDate:U.string().optional(),family:U.string().optional(),metadata:yf.optional()});import{z as g}from"zod";var E6="This tool call was rejected by the user and not executed.",C6="NOT a tool or system failure. Clarify with user before proceeding.",S0=g.object({id:g.string(),name:g.string(),execution:g.enum(["client","provider"]).optional(),input:g.unknown(),output:g.unknown(),error:g.string().optional(),durationMs:g.number(),startedAt:g.date(),endedAt:g.date()});var y6=J.enum(["completed","max_iterations","aborted","mistake_limit","error"]),S6=J.object({inputTokens:J.number(),outputTokens:J.number(),cacheReadTokens:J.number().optional(),cacheWriteTokens:J.number().optional(),totalCost:J.number().optional()}),l4=J.object({text:J.string(),usage:S6,messages:J.array(J.custom()),toolCalls:J.array(S0),iterations:J.number(),finishReason:y6,model:J.object({id:J.string(),provider:J.string(),info:_0.optional()}),startedAt:J.date(),endedAt:J.date(),durationMs:J.number()}),m4=J.object({distinctId:J.string().optional(),sessionId:J.string().optional(),providerId:J.string(),modelId:J.string(),apiKey:J.string().optional(),baseUrl:J.string().url().optional(),headers:J.record(J.string(),J.string()).optional(),knownModels:J.record(J.string(),_0).optional(),providerConfig:J.unknown().optional(),initialMessages:J.array(J.custom()).optional(),systemPrompt:J.string(),tools:J.array(J.custom()),modelTools:J.array(J.custom()).optional(),maxIterations:J.number().positive().optional(),maxParallelToolCalls:J.number().int().positive().default(8),maxTokensPerTurn:J.number().positive().optional(),temperature:J.number().nonnegative().optional(),apiTimeoutMs:J.number().positive().default(180000),userFileContentLoader:J.function().input([J.string()]).output(J.promise(J.string())).optional(),toolContextMetadata:J.record(J.string(),J.unknown()).optional(),execution:J.object({maxConsecutiveMistakes:J.number().int().positive().optional(),reminderAfterIterations:J.number().nonnegative().optional(),reminderText:J.string().optional(),loopDetection:J.union([J.literal(!1),J.object({softThreshold:J.number().int().positive().optional(),hardThreshold:J.number().int().positive().optional()})]).optional()}).optional(),reasoningEffort:W0.optional(),thinkingBudgetTokens:J.number().positive().optional(),thinking:J.boolean().optional(),onEvent:J.function().input([J.custom()]).output(J.void()).optional(),hooks:J.custom().optional(),parentAgentId:J.string().optional(),extensions:J.array(J.custom()).optional(),hookErrorMode:J.enum(["ignore","throw"]).default("ignore"),toolPolicies:J.record(J.string(),J.object({enabled:J.boolean().optional(),autoApprove:J.boolean().optional()})).optional(),requestToolApproval:J.function().input([J.object({sessionId:J.string(),agentId:J.string(),conversationId:J.string(),iteration:J.number(),toolCallId:J.string(),toolName:J.string(),input:J.unknown(),policy:J.object({enabled:J.boolean().optional(),autoApprove:J.boolean().optional()}).default({})})]).output(J.union([J.object({approved:J.boolean(),reason:J.string().optional()}),J.promise(J.object({approved:J.boolean(),reason:J.string().optional()}))])).optional(),onConsecutiveMistakeLimitReached:J.function().input([J.object({iteration:J.number().int().positive(),consecutiveMistakes:J.number().int().positive(),maxConsecutiveMistakes:J.number().int().positive(),reason:J.enum(["api_error","invalid_tool_call","tool_execution_failed"]),details:J.string().optional()})]).output(J.union([J.object({action:J.literal("continue"),guidance:J.string().optional()}),J.object({action:J.literal("stop"),reason:J.string().optional()}),J.promise(J.union([J.object({action:J.literal("continue"),guidance:J.string().optional()}),J.object({action:J.literal("stop"),reason:J.string().optional()})]))])).optional(),logger:J.custom().optional(),extensionContext:J.custom().optional(),abortSignal:J.custom().optional()});import{z as _}from"zod";var hf=_.enum(["connector.started","connector.stopping","session.authorize","message.received","message.denied","message.completed","message.failed","session.started","session.reused","session.reset","schedule.delivery.started","schedule.delivery.sent","schedule.delivery.failed"]),xf=_.object({id:_.string().optional(),label:_.string().optional(),role:_.string().optional(),participantKey:_.string().optional(),participantLabel:_.string().optional(),platformUserId:_.string().optional(),metadata:_.record(_.string(),_.unknown()).optional()}),zf=_.object({source:_.string(),sourceEvent:_.string(),threadId:_.string(),channelId:_.string(),isDM:_.boolean(),sessionId:_.string().optional(),workspaceRoot:_.string().optional(),metadata:_.record(_.string(),_.unknown()).optional()}),g6=_.object({actor:xf,context:zf,payload:_.record(_.string(),_.unknown()).optional()}),v6=_.object({action:_.enum(["allow","deny"]).default("allow"),message:_.string().optional(),reason:_.string().optional(),metadata:_.record(_.string(),_.unknown()).optional()}),n6=_.object({adapter:_.string(),botUserName:_.string().optional(),event:hf,payload:_.record(_.string(),_.unknown()),ts:_.string()});var cf=[{name:"discord",description:"Discord interactions and gateway bridge backed by RPC runtime sessions"},{name:"gchat",description:"Google Chat webhook bridge backed by RPC runtime sessions"},{name:"linear",description:"Linear webhook bridge backed by RPC runtime sessions"},{name:"slack",description:"Slack webhook/socket bridge backed by RPC runtime sessions"},{name:"telegram",description:"Bridge Telegram bot messages into RPC chat sessions"},{name:"whatsapp",description:"Bridge WhatsApp webhook messages into RPC chat sessions"}];function uf(){return cf.map((f)=>({...f}))}function h6(f,$){let w=f.includeWhen;if(!w)return!0;let Y=$[w.flag]??"";if(w.equals!==void 0&&Y!==w.equals)return!1;if(w.notEquals!==void 0&&Y===w.notEquals)return!1;return!0}function x6(f=of){let $=new Set(uf().map((w)=>w.name));return f.filter((w)=>$.has(w.id)).map((w)=>({id:w.id,name:w.name,type:w.type,hint:w.hint,fields:w.fields.map((Y)=>({flag:Y.flag,label:Y.label,placeholder:Y.placeholder,required:Y.required,help:Y.help,initialValue:Y.initialValue,options:Y.options,includeWhen:Y.includeWhen})),security:w.security?{prompt:w.security.prompt,fields:w.security.fields.map((Y)=>({key:Y.key,label:Y.label,placeholder:Y.placeholder,help:Y.help,requiredMessage:Y.requiredMessage}))}:void 0}))}function z6(f){return/^\d+$/.test(f)?void 0:"Telegram user ID must contain digits only"}function c6(f){return/^T[A-Z0-9]+$/.test(f)?void 0:"Slack workspace ID must start with T and contain uppercase letters or digits only"}function u6(f){return/^[UW][A-Z0-9]+$/.test(f)?void 0:"Slack member ID must start with U or W and contain uppercase letters or digits only"}var of=[{id:"telegram",name:"Telegram",type:"polling",hint:"Easiest to set up. No public URL needed.",derivedReconnectFlags:["-m","--bot-username"],fields:[{flag:"-k",aliases:["--bot-token"],label:"Bot token",placeholder:"7123456789:AAH...",required:!0,help:["Open Telegram and start a chat with @BotFather","Send /newbot and follow the prompts","BotFather gives you this after creating the bot","It looks like 7123456789:AAHxxx..."]}],security:{prompt:"By default, anyone who finds your bot can message it and run tasks on your machine. Restrict access to your Telegram user ID?",fields:[{key:"userId",label:"Your Telegram user ID",placeholder:"123456789",help:["Message @userinfobot on Telegram","It will reply with your numeric user ID"],requiredMessage:"User ID is required to restrict access",validate:z6}],argumentFlags:["--allowed-user-id","--hook-command"],buildArgs:({userId:f})=>["--allowed-user-id",f??""]}},{id:"slack",name:"Slack",type:"hybrid",hint:"Public URL for webhook mode; leave blank for socket mode.",fields:[{flag:"--bot-token",label:"Bot token",placeholder:"xoxb-...",required:!0,help:["Go to api.slack.com/apps and create a new app","Add Bot Token Scopes: chat:write, app_mentions:read, channels:history, channels:read, im:history, im:read, im:write, users:read","Install to workspace and copy the Bot Token"]},{flag:"--base-url",label:"Public base URL",placeholder:"leave blank for socket mode",help:["Enter a publicly accessible URL for webhook mode","Leave blank to use Slack socket mode instead"]},{flag:"--signing-secret",label:"Signing secret",required:!0,help:["Found in your app's Basic Information page"],includeWhen:{flag:"--base-url",notEquals:""}},{flag:"--app-token",label:"App-level token",placeholder:"xapp-...",required:!0,help:["Enable Socket Mode in the Slack app","Generate an app-level token with the connections:write scope"],includeWhen:{flag:"--base-url",equals:""}}],security:{prompt:"Restrict which Slack users can interact with the bot?",fields:[{key:"teamId",label:"Allowed Slack workspace ID",placeholder:"T01ABC123",help:["Open your Slack workspace URL in a browser","The workspace ID is the segment after /client/, for example T01ABC123"],requiredMessage:"Workspace ID is required to restrict access",validate:c6},{key:"userId",label:"Allowed Slack member ID",placeholder:"U01ABC123",help:["Click a user's name in Slack, then View full profile","Click ... and Copy member ID"],requiredMessage:"Member ID is required to restrict access",validate:u6}],argumentFlags:["--hook-command"],buildArgs:({teamId:f,userId:$})=>["--hook-command",`jq -r ".payload.actor.participantKey" | grep -qx "slack:team:${f}:user:${$}" && echo '{"action":"allow"}' || echo '{"action":"deny"}'`]}},{id:"discord",name:"Discord",type:"webhook",hint:"Requires a Discord app and public URL.",fields:[{flag:"--application-id",aliases:["--app-id"],label:"Application ID",required:!0,help:["Go to discord.com/developers/applications","Create a new app, copy the Application ID"]},{flag:"--bot-token",aliases:["--token"],label:"Bot token",required:!0,help:["Go to Bot section, create a bot, copy the token"]},{flag:"--public-key",label:"Public key",required:!0,help:["Found in General Information of your app"]},{flag:"--base-url",label:"Public base URL",placeholder:"https://example.com",required:!0,help:["Base URL for the connector","For Discord, set the Interactions Endpoint URL to <base-url>/api/webhooks/discord"]}]},{id:"whatsapp",name:"WhatsApp",type:"webhook",hint:"Requires Meta developer account and public URL.",fields:[{flag:"--phone-number-id",label:"Phone number ID",required:!0,help:["From your WhatsApp Business account in Meta Developer portal"]},{flag:"--access-token",label:"Access token",required:!0,help:["Generate a permanent token in Meta Developer portal"]},{flag:"--app-secret",label:"App secret",required:!0,help:["Found in App Settings > Basic"]},{flag:"--verify-token",label:"Webhook verify token",placeholder:"my-verify-token",required:!0,help:["Any string you choose, used to verify webhook setup"]},{flag:"--base-url",label:"Public base URL",placeholder:"https://example.com",required:!0}]},{id:"gchat",name:"Google Chat",type:"webhook",hint:"Requires Google Cloud project and public URL.",fields:[{flag:"--credentials-json",label:"Service account credentials JSON",required:!0,help:["Create a service account in Google Cloud Console","Download the credentials JSON file","Paste the JSON content here"]},{flag:"--base-url",label:"Public base URL",placeholder:"https://example.com",required:!0}]},{id:"linear",name:"Linear",type:"webhook",hint:"React to Linear issues and comments.",fields:[{flag:"--api-key",label:"API key",required:!0,help:["Go to Linear Settings > API > Personal API keys"]},{flag:"--webhook-secret",label:"Webhook signing secret",required:!0,help:["Go to Settings > API > Webhooks, create one","Copy the signing secret"]},{flag:"--base-url",label:"Public base URL",placeholder:"https://example.com",required:!0}]}];var o6=["hooks","tools","commands","rules","skills","messageBuilders","providers","automationEvents","mcp"],l6=new Set(o6);function pf(f,$){return f.name||`extension_${String($).padStart(4,"0")}`}function lf(f){return Array.isArray(f)&&f.every(($)=>typeof $==="string")}function mf(f){if(!Array.isArray(f))return;let $=f.filter((w)=>typeof w==="string").map((w)=>w.trim()).filter((w)=>w.length>0);return $.length>0?$:void 0}function df(f){let $=mf(f.providerIds),w=mf(f.modelIds);return{...f,...$?{providerIds:$}:{},...w?{modelIds:w}:{}}}function m6(f,$){let w=pf(f,$),Y=f.manifest;if(!Y||typeof Y!=="object")throw Error(`Invalid manifest for extension "${w}": manifest is required`);if(!Array.isArray(Y.capabilities)||Y.capabilities.length===0)throw Error(`Invalid manifest for extension "${w}": capabilities must be a non-empty array`);let q=new Set;for(let G of Y.capabilities){if(!l6.has(G))throw Error(`Invalid manifest for extension "${w}": unsupported capability "${String(G)}"`);q.add(G)}if(Object.hasOwn(Y,"providerIds")&&!lf(Y.providerIds))throw Error(`Invalid manifest for extension "${w}": providerIds must be a string array when provided`);if(Object.hasOwn(Y,"modelIds")&&!lf(Y.modelIds))throw Error(`Invalid manifest for extension "${w}": modelIds must be a string array when provided`);let K=q.has("hooks");if(f.hooks!==void 0&&!K)throw Error(`Invalid manifest for extension "${w}": runtime hooks require the "hooks" capability`);return{capabilities:q,raw:df(Y)}}function p6(f,$){if(!f||typeof f!=="object")throw Error(`Invalid automation event contribution for extension "${$}": expected object`);let w=typeof f.eventType==="string"?f.eventType.trim():"",Y=typeof f.source==="string"?f.source.trim():"";if(!w)throw Error(`Invalid automation event contribution for extension "${$}": eventType is required`);if(!Y)throw Error(`Invalid automation event contribution for extension "${$}": source is required`);return{...f,eventType:w,source:Y,examples:f.examples?[...f.examples]:void 0,metadata:f.metadata?{...f.metadata}:void 0}}class g0{extensions;registry={tools:[],commands:[],rules:[],messageBuilder:[],providers:[],automationEventTypes:[],mcpServers:[]};normalized=[];phase="resolve";setupContext;constructor(f={}){this.extensions=f.extensions??[],this.setupContext=f.setupContext??{}}resolve(){if(this.phase!=="resolve")return;this.normalized=this.extensions.map((f,$)=>({extension:f,order:$,manifest:{capabilities:new Set,raw:f.manifest}})),this.phase="validate"}validate(){if(this.phase==="resolve")this.resolve();if(this.phase!=="validate")return;this.normalized=this.normalized.map((f)=>({...f,manifest:m6(f.extension,f.order)})),this.phase="setup"}async setup(f={}){if(this.phase==="resolve")this.resolve();if(this.phase==="validate")this.validate();if(this.phase!=="setup")return;let $,w=[];for(let Y of this.normalized){let{extension:q}=Y;if(q.disabled)continue;let K=pf(q,Y.order),H={tools:[],commands:[],rules:[],messageBuilder:[],providers:[],automationEventTypes:[],mcpServers:[]},G={registerTool:(k)=>H.tools.push(k),registerCommand:(k)=>H.commands.push(k),registerRule:(k)=>{if(!Y.manifest.capabilities.has("rules"))throw Error(`Invalid setup for extension "${K}": registerRule requires the "rules" capability`);H.rules.push(k)},registerMessageBuilder:(k)=>H.messageBuilder.push(k),registerProvider:(k)=>H.providers.push(k),registerAutomationEventType:(k)=>{if(!Y.manifest.capabilities.has("automationEvents"))throw Error(`Invalid setup for extension "${K}": registerAutomationEventType requires the "automationEvents" capability`);H.automationEventTypes.push(p6(k,K))},registerMcpServer:(k)=>{if(!Y.manifest.capabilities.has("mcp"))throw Error(`Invalid setup for extension "${K}": registerMcpServer requires the "mcp" capability`);H.mcpServers.push({...k,metadata:{...k.metadata??{},source:"plugin",plugin:K}})}},j=Y.manifest.capabilities.has("automationEvents")?this.setupContext:{...this.setupContext,automation:void 0};try{await q.setup?.(G,j),w.push(H)}catch(k){if(f.tolerateSetupErrors!==!0)throw k;$??=k}}if($&&f.tolerateSetupErrors!==!0)throw $;for(let Y of w)this.registry.tools.push(...Y.tools),this.registry.commands.push(...Y.commands),this.registry.rules.push(...Y.rules),this.registry.messageBuilder.push(...Y.messageBuilder),this.registry.providers.push(...Y.providers),this.registry.automationEventTypes.push(...Y.automationEventTypes),this.registry.mcpServers.push(...Y.mcpServers);if(this.phase="activate",$)throw $}activate(){if(this.phase==="resolve")this.resolve();if(this.phase==="validate")this.validate();if(this.phase==="setup")throw Error("Contribution registry setup must complete before activation");if(this.phase!=="activate")return;this.phase="run"}async initialize(f={}){this.resolve(),this.validate();try{await this.setup(f)}finally{if(this.phase==="activate")this.activate()}}isActivated(){return this.phase==="run"}getRegistrySnapshot(){return{tools:[...this.registry.tools],commands:[...this.registry.commands],rules:[...this.registry.rules],messageBuilder:[...this.registry.messageBuilder],providers:[...this.registry.providers],automationEventTypes:[...this.registry.automationEventTypes],mcpServers:[...this.registry.mcpServers]}}getRegisteredTools(){return[...this.registry.tools]}getRegisteredRules(){return[...this.registry.rules]}getRegisteredAutomationEventTypes(){return[...this.registry.automationEventTypes]}getRegisteredMcpServers(){return[...this.registry.mcpServers]}getValidatedExtensions(){if(this.phase==="resolve")this.resolve();if(this.phase==="validate")this.validate();return this.normalized.slice().sort((f,$)=>f.order-$.order).map(({extension:f})=>f)}}function d6(f={}){return new g0(f)}var r6=[".js",".ts"];var J0={CLINE_PASS:"ext-cline-pass",CODE_CLOUD_AGENTS:"code-cloud-agents",CODE_ONBOARDING_GITHUB:"code-onboarding-github"},s6={[J0.CLINE_PASS]:!1,[J0.CODE_CLOUD_AGENTS]:!1,[J0.CODE_ONBOARDING_GITHUB]:!1},i6=Object.values(J0);import{z as Q}from"zod";var rf=Q.enum(["agent_start","agent_resume","agent_abort","agent_end","agent_error","tool_call","tool_result","prompt_submit","pre_compact","session_shutdown"]),l=Q.record(Q.string(),Q.string()),a6=Q.object({toolName:Q.string(),parameters:l}),t6=Q.object({toolName:Q.string(),parameters:l,result:Q.string(),success:Q.boolean(),executionTimeMs:Q.number()}),e6=Q.object({prompt:Q.string(),attachments:Q.array(Q.string())}),f$=Q.object({taskMetadata:l}),$$=Q.object({taskMetadata:l,previousState:l}),w$=Q.object({taskMetadata:l}),Y$=Q.object({taskMetadata:l}),Z$=Q.object({taskId:Q.string(),ulid:Q.string(),contextSize:Q.number(),compactionStrategy:Q.string(),previousApiReqIndex:Q.number(),tokensIn:Q.number(),tokensOut:Q.number(),tokensInCache:Q.number(),tokensOutCache:Q.number(),deletedRangeStart:Q.number(),deletedRangeEnd:Q.number(),contextJsonPath:Q.string(),contextRawPath:Q.string()}),sf=Q.object({clineVersion:Q.string(),hookName:rf,timestamp:Q.string(),taskId:Q.string(),sessionContext:Q.object({rootSessionId:Q.string().optional(),hookLogPath:Q.string().optional()}).optional(),workspaceRoots:Q.array(Q.string()),workspaceInfo:Q.custom().optional(),userId:Q.string(),agent_id:Q.string(),parent_agent_id:Q.string().nullable(),iteration:Q.number().optional(),reason:Q.string().optional(),tool_call:Q.object({id:Q.string(),name:Q.string(),input:Q.unknown()}).optional(),tool_result:Q.custom().optional(),turn:Q.unknown().optional(),error:Q.object({name:Q.string(),message:Q.string(),stack:Q.string().optional()}).optional(),preToolUse:a6.optional(),postToolUse:t6.optional(),userPromptSubmit:e6.optional(),taskStart:f$.optional(),taskResume:$$.optional(),taskCancel:w$.optional(),taskComplete:Y$.optional(),preCompact:Z$.optional()}).passthrough();function q$(f){let $=sf.safeParse(f);if(!$.success)return;return $.data}var Z3="v1",q3="v1",J3="v1",X3=["client.register","client.list","session.create","session.list","session.get","session.run","session.abort","schedule.create","schedule.list","task.create","task.list","task.get","task.update","task.approve","task.cancel","task.run","task.automation.get","task.automation.set","settings.get","settings.set","connector.start","connector.stop","connector.supervised","run.enqueue","run.list","hub.drain","hub.status","stream.replay"];function F0(f){let $=/^v(\d+)$/.exec(f?.trim()??"");if(!$)return;return Number.parseInt($[1]??"",10)}function K3(f,$="v1"){let w=F0(f.protocolVersion),Y=F0($);if(w===void 0||Y===void 0)return{compatible:!1,reason:"missing_protocol"};let q=F0(f.minClientProtocolVersion)??w,K=F0(f.maxClientProtocolVersion)??w;return Y>=q&&Y<=K?{compatible:!0}:{compatible:!1,reason:"unsupported_protocol"}}var H3="approval.respond",G3="0",Q3="__hubScheduleRunAt",af=["act","plan","yolo"];function J$(f){return af.some(($)=>$===f)}function R3(f,$){if(!f||!Object.hasOwn(f,"mode"))return $;let w=f.mode;if(J$(w))return w;throw Error(`mode must be one of: ${af.join(", ")}`)}var X$=30000,V3=5000;function K$(f){switch(f){case"run.start":case"session.send_input":return null;default:return X$}}function j3(f,$){return $===void 0?K$(f):$}var H$=["readFile","search","bash","webFetch","editor","applyPatch","skills","askQuestion","submit"],G$=new Set(H$);function k3(f){return typeof f==="string"&&G$.has(f)}var W3="tool_executor.",_3="custom_tool.",F3="hook.",L3="compaction.compact",U3="checkpoint.create",D3="mistake_limit.decide",P3="user_instructions.snapshot";function O3(f){let $=f.activeSessionCount;if(typeof $!=="number"||$<=0)return"active sessions from other Cline clients";let w=`${$} active session${$===1?"":"s"}`,Y=f.participantClientCount;if(typeof Y!=="number"||Y<=0)return w;return`${w} from ${Y} connected Cline client${Y===1?"":"s"}`}function v0(f,$){return`<file_content path="${f}">
1
+ import{z as J}from"zod";import{z as U}from"zod";import{z as M}from"zod";var k0=["none","minimal","low","medium","high","xhigh","max"],M0=M.enum(k0),_0=M0.exclude(["none"]),B6=M.enum([...k0,"default"]).nullable(),T0=M.discriminatedUnion("type",[M.object({type:M.literal("toggle")}).strict(),M.object({type:M.literal("effort"),values:M.array(B6)}).strict(),M.object({type:M.literal("budget_tokens"),min:M.number().min(-1).optional(),max:M.number().min(0).optional()}).strict().refine((f)=>f.min===void 0||f.max===void 0||f.min<=f.max,{message:"Minimum reasoning budget cannot exceed maximum",path:["min"]})]);var bf=U.enum(["default","openai-responses","r1"]),A6={DEFAULT:"default",OPENAI_RESPONSES:"openai-responses",R1:"r1"},Cf=U.enum(["images","video","tools","streaming","prompt-cache","reasoning","reasoning-effort","computer-use","global-endpoint","structured_output","temperature","files"]),Mf=U.enum(["active","preview","deprecated","legacy"]),Tf=U.object({input:U.number().optional(),output:U.number().optional(),cacheWrite:U.number().optional(),cacheRead:U.number().optional()}),yf=U.object({maxBudget:U.number().optional(),outputPrice:U.number().optional(),thinkingLevel:U.enum(["low","high"]).optional()}),Ef=U.object({reasoningDefaultOn:U.boolean().optional(),apiProtocol:U.enum(["openai-chat","openai-responses","anthropic","gemini"]).optional()}).catchall(U.unknown()),y0=U.enum(["text","image","audio","video","pdf"]),Sf=U.object({input:U.array(y0),output:U.array(y0)});function gf(f){return(f?.input===void 0||f.input.includes("text"))&&(f?.output===void 0||f.output.includes("text"))}var nf=U.enum(["language","image-generation","speech-generation","video-generation","transcription"]);function N6(f){return(f.operation===void 0||f.operation==="language")&&gf(f.modalities)}var vf=U.enum(["batch","streaming"]);function b6(f){return f.modalities?.input.includes("text")===!0&&f.modalities.output.includes("image")}function C6(f){return f.operation==="image-generation"}function E0(f,$,w){let Y=f.capabilities;if(Y===void 0||Y.length===0)return w?.assumeWhenUnspecified??!1;return Y.includes($)}function M6(f){return E0(f,"tools",{assumeWhenUnspecified:!0})}function T6(f){return E0(f,"images",{assumeWhenUnspecified:!0})}var W0=U.object({id:U.string(),name:U.string().optional(),description:U.string().optional(),maxTokens:U.number().optional(),contextWindow:U.number().optional(),maxInputTokens:U.number().optional(),capabilities:U.array(Cf).optional(),operation:nf.optional(),operationModes:U.array(vf).optional(),modalities:Sf.optional(),reasoningOptions:U.array(T0).optional(),apiFormat:bf.optional(),systemRole:U.enum(["system","developer"]).optional(),temperature:U.number().optional(),pricing:Tf.optional(),thinkingConfig:yf.optional(),status:Mf.optional(),deprecationNotice:U.string().optional(),replacedBy:U.string().optional(),releaseDate:U.string().optional(),deprecationDate:U.string().optional(),family:U.string().optional(),metadata:Ef.optional()});import{z as g}from"zod";var y6="This tool call was rejected by the user and not executed.",E6="NOT a tool or system failure. Clarify with user before proceeding.",S0=g.object({id:g.string(),name:g.string(),execution:g.enum(["client","provider"]).optional(),input:g.unknown(),output:g.unknown(),error:g.string().optional(),durationMs:g.number(),startedAt:g.date(),endedAt:g.date()});var S6=J.enum(["completed","max_iterations","aborted","mistake_limit","error"]),g6=J.object({inputTokens:J.number(),outputTokens:J.number(),cacheReadTokens:J.number().optional(),cacheWriteTokens:J.number().optional(),totalCost:J.number().optional()}),p4=J.object({text:J.string(),usage:g6,messages:J.array(J.custom()),toolCalls:J.array(S0),iterations:J.number(),finishReason:S6,model:J.object({id:J.string(),provider:J.string(),info:W0.optional()}),startedAt:J.date(),endedAt:J.date(),durationMs:J.number()}),r4=J.object({distinctId:J.string().optional(),sessionId:J.string().optional(),providerId:J.string(),modelId:J.string(),apiKey:J.string().optional(),baseUrl:J.string().url().optional(),headers:J.record(J.string(),J.string()).optional(),knownModels:J.record(J.string(),W0).optional(),providerConfig:J.unknown().optional(),initialMessages:J.array(J.custom()).optional(),systemPrompt:J.string(),tools:J.array(J.custom()),modelTools:J.array(J.custom()).optional(),maxIterations:J.number().positive().optional(),maxParallelToolCalls:J.number().int().positive().default(8),maxTokensPerTurn:J.number().positive().optional(),temperature:J.number().nonnegative().optional(),apiTimeoutMs:J.number().positive().default(180000),userFileContentLoader:J.function().input([J.string()]).output(J.promise(J.string())).optional(),toolContextMetadata:J.record(J.string(),J.unknown()).optional(),execution:J.object({maxConsecutiveMistakes:J.number().int().positive().optional(),reminderAfterIterations:J.number().nonnegative().optional(),reminderText:J.string().optional(),loopDetection:J.union([J.literal(!1),J.object({softThreshold:J.number().int().positive().optional(),hardThreshold:J.number().int().positive().optional()})]).optional()}).optional(),reasoningEffort:_0.optional(),thinkingBudgetTokens:J.number().positive().optional(),thinking:J.boolean().optional(),onEvent:J.function().input([J.custom()]).output(J.void()).optional(),hooks:J.custom().optional(),parentAgentId:J.string().optional(),extensions:J.array(J.custom()).optional(),hookErrorMode:J.enum(["ignore","throw"]).default("ignore"),toolPolicies:J.record(J.string(),J.object({enabled:J.boolean().optional(),autoApprove:J.boolean().optional()})).optional(),requestToolApproval:J.function().input([J.object({sessionId:J.string(),agentId:J.string(),conversationId:J.string(),iteration:J.number(),toolCallId:J.string(),toolName:J.string(),input:J.unknown(),policy:J.object({enabled:J.boolean().optional(),autoApprove:J.boolean().optional()}).default({})})]).output(J.union([J.object({approved:J.boolean(),reason:J.string().optional()}),J.promise(J.object({approved:J.boolean(),reason:J.string().optional()}))])).optional(),onConsecutiveMistakeLimitReached:J.function().input([J.object({iteration:J.number().int().positive(),consecutiveMistakes:J.number().int().positive(),maxConsecutiveMistakes:J.number().int().positive(),reason:J.enum(["api_error","invalid_tool_call","tool_execution_failed"]),details:J.string().optional()})]).output(J.union([J.object({action:J.literal("continue"),guidance:J.string().optional()}),J.object({action:J.literal("stop"),reason:J.string().optional()}),J.promise(J.union([J.object({action:J.literal("continue"),guidance:J.string().optional()}),J.object({action:J.literal("stop"),reason:J.string().optional()})]))])).optional(),logger:J.custom().optional(),extensionContext:J.custom().optional(),abortSignal:J.custom().optional()});import{z as W}from"zod";var hf=W.enum(["connector.started","connector.stopping","session.authorize","message.received","message.denied","message.completed","message.failed","session.started","session.reused","session.reset","schedule.delivery.started","schedule.delivery.sent","schedule.delivery.failed"]),xf=W.object({id:W.string().optional(),label:W.string().optional(),role:W.string().optional(),participantKey:W.string().optional(),participantLabel:W.string().optional(),platformUserId:W.string().optional(),metadata:W.record(W.string(),W.unknown()).optional()}),zf=W.object({source:W.string(),sourceEvent:W.string(),threadId:W.string(),channelId:W.string(),isDM:W.boolean(),sessionId:W.string().optional(),workspaceRoot:W.string().optional(),metadata:W.record(W.string(),W.unknown()).optional()}),n6=W.object({actor:xf,context:zf,payload:W.record(W.string(),W.unknown()).optional()}),v6=W.object({action:W.enum(["allow","deny"]).default("allow"),message:W.string().optional(),reason:W.string().optional(),metadata:W.record(W.string(),W.unknown()).optional()}),h6=W.object({adapter:W.string(),botUserName:W.string().optional(),event:hf,payload:W.record(W.string(),W.unknown()),ts:W.string()});var cf=[{name:"discord",description:"Discord interactions and gateway bridge backed by RPC runtime sessions"},{name:"gchat",description:"Google Chat webhook bridge backed by RPC runtime sessions"},{name:"linear",description:"Linear webhook bridge backed by RPC runtime sessions"},{name:"slack",description:"Slack webhook/socket bridge backed by RPC runtime sessions"},{name:"telegram",description:"Bridge Telegram bot messages into RPC chat sessions"},{name:"whatsapp",description:"Bridge WhatsApp webhook messages into RPC chat sessions"}];function uf(){return cf.map((f)=>({...f}))}function x6(f,$){let w=f.includeWhen;if(!w)return!0;let Y=$[w.flag]??"";if(w.equals!==void 0&&Y!==w.equals)return!1;if(w.notEquals!==void 0&&Y===w.notEquals)return!1;return!0}function z6(f=of){let $=new Set(uf().map((w)=>w.name));return f.filter((w)=>$.has(w.id)).map((w)=>({id:w.id,name:w.name,type:w.type,hint:w.hint,fields:w.fields.map((Y)=>({flag:Y.flag,label:Y.label,placeholder:Y.placeholder,required:Y.required,help:Y.help,initialValue:Y.initialValue,options:Y.options,includeWhen:Y.includeWhen})),security:w.security?{prompt:w.security.prompt,fields:w.security.fields.map((Y)=>({key:Y.key,label:Y.label,placeholder:Y.placeholder,help:Y.help,requiredMessage:Y.requiredMessage}))}:void 0}))}function c6(f){return/^\d+$/.test(f)?void 0:"Telegram user ID must contain digits only"}function u6(f){return/^T[A-Z0-9]+$/.test(f)?void 0:"Slack workspace ID must start with T and contain uppercase letters or digits only"}function o6(f){return/^[UW][A-Z0-9]+$/.test(f)?void 0:"Slack member ID must start with U or W and contain uppercase letters or digits only"}var of=[{id:"telegram",name:"Telegram",type:"polling",hint:"Easiest to set up. No public URL needed.",derivedReconnectFlags:["-m","--bot-username"],fields:[{flag:"-k",aliases:["--bot-token"],label:"Bot token",placeholder:"7123456789:AAH...",required:!0,help:["Open Telegram and start a chat with @BotFather","Send /newbot and follow the prompts","BotFather gives you this after creating the bot","It looks like 7123456789:AAHxxx..."]}],security:{prompt:"By default, anyone who finds your bot can message it and run tasks on your machine. Restrict access to your Telegram user ID?",fields:[{key:"userId",label:"Your Telegram user ID",placeholder:"123456789",help:["Message @userinfobot on Telegram","It will reply with your numeric user ID"],requiredMessage:"User ID is required to restrict access",validate:c6}],argumentFlags:["--allowed-user-id","--hook-command"],buildArgs:({userId:f})=>["--allowed-user-id",f??""]}},{id:"slack",name:"Slack",type:"hybrid",hint:"Public URL for webhook mode; leave blank for socket mode.",fields:[{flag:"--bot-token",label:"Bot token",placeholder:"xoxb-...",required:!0,help:["Go to api.slack.com/apps and create a new app","Add Bot Token Scopes: chat:write, app_mentions:read, channels:history, channels:read, im:history, im:read, im:write, users:read","Install to workspace and copy the Bot Token"]},{flag:"--base-url",label:"Public base URL",placeholder:"leave blank for socket mode",help:["Enter a publicly accessible URL for webhook mode","Leave blank to use Slack socket mode instead"]},{flag:"--signing-secret",label:"Signing secret",required:!0,help:["Found in your app's Basic Information page"],includeWhen:{flag:"--base-url",notEquals:""}},{flag:"--app-token",label:"App-level token",placeholder:"xapp-...",required:!0,help:["Enable Socket Mode in the Slack app","Generate an app-level token with the connections:write scope"],includeWhen:{flag:"--base-url",equals:""}}],security:{prompt:"Restrict which Slack users can interact with the bot?",fields:[{key:"teamId",label:"Allowed Slack workspace ID",placeholder:"T01ABC123",help:["Open your Slack workspace URL in a browser","The workspace ID is the segment after /client/, for example T01ABC123"],requiredMessage:"Workspace ID is required to restrict access",validate:u6},{key:"userId",label:"Allowed Slack member ID",placeholder:"U01ABC123",help:["Click a user's name in Slack, then View full profile","Click ... and Copy member ID"],requiredMessage:"Member ID is required to restrict access",validate:o6}],argumentFlags:["--hook-command"],buildArgs:({teamId:f,userId:$})=>["--hook-command",`jq -r ".payload.actor.participantKey" | grep -qx "slack:team:${f}:user:${$}" && echo '{"action":"allow"}' || echo '{"action":"deny"}'`]}},{id:"discord",name:"Discord",type:"webhook",hint:"Requires a Discord app and public URL.",fields:[{flag:"--application-id",aliases:["--app-id"],label:"Application ID",required:!0,help:["Go to discord.com/developers/applications","Create a new app, copy the Application ID"]},{flag:"--bot-token",aliases:["--token"],label:"Bot token",required:!0,help:["Go to Bot section, create a bot, copy the token"]},{flag:"--public-key",label:"Public key",required:!0,help:["Found in General Information of your app"]},{flag:"--base-url",label:"Public base URL",placeholder:"https://example.com",required:!0,help:["Base URL for the connector","For Discord, set the Interactions Endpoint URL to <base-url>/api/webhooks/discord"]}]},{id:"whatsapp",name:"WhatsApp",type:"webhook",hint:"Requires Meta developer account and public URL.",fields:[{flag:"--phone-number-id",label:"Phone number ID",required:!0,help:["From your WhatsApp Business account in Meta Developer portal"]},{flag:"--access-token",label:"Access token",required:!0,help:["Generate a permanent token in Meta Developer portal"]},{flag:"--app-secret",label:"App secret",required:!0,help:["Found in App Settings > Basic"]},{flag:"--verify-token",label:"Webhook verify token",placeholder:"my-verify-token",required:!0,help:["Any string you choose, used to verify webhook setup"]},{flag:"--base-url",label:"Public base URL",placeholder:"https://example.com",required:!0}]},{id:"gchat",name:"Google Chat",type:"webhook",hint:"Requires Google Cloud project and public URL.",fields:[{flag:"--credentials-json",label:"Service account credentials JSON",required:!0,help:["Create a service account in Google Cloud Console","Download the credentials JSON file","Paste the JSON content here"]},{flag:"--base-url",label:"Public base URL",placeholder:"https://example.com",required:!0}]},{id:"linear",name:"Linear",type:"webhook",hint:"React to Linear issues and comments.",fields:[{flag:"--api-key",label:"API key",required:!0,help:["Go to Linear Settings > API > Personal API keys"]},{flag:"--webhook-secret",label:"Webhook signing secret",required:!0,help:["Go to Settings > API > Webhooks, create one","Copy the signing secret"]},{flag:"--base-url",label:"Public base URL",placeholder:"https://example.com",required:!0}]}];var l6=["hooks","tools","commands","rules","skills","messageBuilders","providers","automationEvents","mcp"],m6=new Set(l6);function df(f,$){return f.name||`extension_${String($).padStart(4,"0")}`}function lf(f){return Array.isArray(f)&&f.every(($)=>typeof $==="string")}function mf(f){if(!Array.isArray(f))return;let $=f.filter((w)=>typeof w==="string").map((w)=>w.trim()).filter((w)=>w.length>0);return $.length>0?$:void 0}function pf(f){let $=mf(f.providerIds),w=mf(f.modelIds);return{...f,...$?{providerIds:$}:{},...w?{modelIds:w}:{}}}function d6(f,$){let w=df(f,$),Y=f.manifest;if(!Y||typeof Y!=="object")throw Error(`Invalid manifest for extension "${w}": manifest is required`);if(!Array.isArray(Y.capabilities)||Y.capabilities.length===0)throw Error(`Invalid manifest for extension "${w}": capabilities must be a non-empty array`);let q=new Set;for(let K of Y.capabilities){if(!m6.has(K))throw Error(`Invalid manifest for extension "${w}": unsupported capability "${String(K)}"`);q.add(K)}if(Object.hasOwn(Y,"providerIds")&&!lf(Y.providerIds))throw Error(`Invalid manifest for extension "${w}": providerIds must be a string array when provided`);if(Object.hasOwn(Y,"modelIds")&&!lf(Y.modelIds))throw Error(`Invalid manifest for extension "${w}": modelIds must be a string array when provided`);let G=q.has("hooks");if(f.hooks!==void 0&&!G)throw Error(`Invalid manifest for extension "${w}": runtime hooks require the "hooks" capability`);return{capabilities:q,raw:pf(Y)}}function p6(f,$){if(!f||typeof f!=="object")throw Error(`Invalid automation event contribution for extension "${$}": expected object`);let w=typeof f.eventType==="string"?f.eventType.trim():"",Y=typeof f.source==="string"?f.source.trim():"";if(!w)throw Error(`Invalid automation event contribution for extension "${$}": eventType is required`);if(!Y)throw Error(`Invalid automation event contribution for extension "${$}": source is required`);return{...f,eventType:w,source:Y,examples:f.examples?[...f.examples]:void 0,metadata:f.metadata?{...f.metadata}:void 0}}class g0{extensions;registry={tools:[],commands:[],rules:[],messageBuilder:[],providers:[],automationEventTypes:[],mcpServers:[]};normalized=[];phase="resolve";setupContext;constructor(f={}){this.extensions=f.extensions??[],this.setupContext=f.setupContext??{}}resolve(){if(this.phase!=="resolve")return;this.normalized=this.extensions.map((f,$)=>({extension:f,order:$,manifest:{capabilities:new Set,raw:f.manifest}})),this.phase="validate"}validate(){if(this.phase==="resolve")this.resolve();if(this.phase!=="validate")return;this.normalized=this.normalized.map((f)=>({...f,manifest:d6(f.extension,f.order)})),this.phase="setup"}async setup(f={}){if(this.phase==="resolve")this.resolve();if(this.phase==="validate")this.validate();if(this.phase!=="setup")return;let $,w=[];for(let Y of this.normalized){let{extension:q}=Y;if(q.disabled)continue;let G=df(q,Y.order),H={tools:[],commands:[],rules:[],messageBuilder:[],providers:[],automationEventTypes:[],mcpServers:[]},K={registerTool:(k)=>H.tools.push(k),registerCommand:(k)=>H.commands.push(k),registerRule:(k)=>{if(!Y.manifest.capabilities.has("rules"))throw Error(`Invalid setup for extension "${G}": registerRule requires the "rules" capability`);H.rules.push(k)},registerMessageBuilder:(k)=>H.messageBuilder.push(k),registerProvider:(k)=>H.providers.push(k),registerAutomationEventType:(k)=>{if(!Y.manifest.capabilities.has("automationEvents"))throw Error(`Invalid setup for extension "${G}": registerAutomationEventType requires the "automationEvents" capability`);H.automationEventTypes.push(p6(k,G))},registerMcpServer:(k)=>{if(!Y.manifest.capabilities.has("mcp"))throw Error(`Invalid setup for extension "${G}": registerMcpServer requires the "mcp" capability`);H.mcpServers.push({...k,metadata:{...k.metadata??{},source:"plugin",plugin:G}})}},j=Y.manifest.capabilities.has("automationEvents")?this.setupContext:{...this.setupContext,automation:void 0};try{await q.setup?.(K,j),w.push(H)}catch(k){if(f.tolerateSetupErrors!==!0)throw k;$??=k}}if($&&f.tolerateSetupErrors!==!0)throw $;for(let Y of w)this.registry.tools.push(...Y.tools),this.registry.commands.push(...Y.commands),this.registry.rules.push(...Y.rules),this.registry.messageBuilder.push(...Y.messageBuilder),this.registry.providers.push(...Y.providers),this.registry.automationEventTypes.push(...Y.automationEventTypes),this.registry.mcpServers.push(...Y.mcpServers);if(this.phase="activate",$)throw $}activate(){if(this.phase==="resolve")this.resolve();if(this.phase==="validate")this.validate();if(this.phase==="setup")throw Error("Contribution registry setup must complete before activation");if(this.phase!=="activate")return;this.phase="run"}async initialize(f={}){this.resolve(),this.validate();try{await this.setup(f)}finally{if(this.phase==="activate")this.activate()}}isActivated(){return this.phase==="run"}getRegistrySnapshot(){return{tools:[...this.registry.tools],commands:[...this.registry.commands],rules:[...this.registry.rules],messageBuilder:[...this.registry.messageBuilder],providers:[...this.registry.providers],automationEventTypes:[...this.registry.automationEventTypes],mcpServers:[...this.registry.mcpServers]}}getRegisteredTools(){return[...this.registry.tools]}getRegisteredRules(){return[...this.registry.rules]}getRegisteredAutomationEventTypes(){return[...this.registry.automationEventTypes]}getRegisteredMcpServers(){return[...this.registry.mcpServers]}getValidatedExtensions(){if(this.phase==="resolve")this.resolve();if(this.phase==="validate")this.validate();return this.normalized.slice().sort((f,$)=>f.order-$.order).map(({extension:f})=>f)}}function r6(f={}){return new g0(f)}var s6=[".js",".ts"];var a={CLINE_PASS:"ext-cline-pass",CODE_CLOUD_AGENTS:"code-cloud-agents",CODE_ONBOARDING_GITHUB:"code-onboarding-github",CLINE_COMPOSIO_BETA:"CLINE_COMPOSIO_BETA"},i6={[a.CLINE_PASS]:!1,[a.CODE_CLOUD_AGENTS]:!1,[a.CODE_ONBOARDING_GITHUB]:!1,[a.CLINE_COMPOSIO_BETA]:!1},a6=Object.values(a);import{z as Q}from"zod";var rf=Q.enum(["agent_start","agent_resume","agent_abort","agent_end","agent_error","tool_call","tool_result","prompt_submit","pre_compact","session_shutdown"]),l=Q.record(Q.string(),Q.string()),t6=Q.object({toolName:Q.string(),parameters:l}),e6=Q.object({toolName:Q.string(),parameters:l,result:Q.string(),success:Q.boolean(),executionTimeMs:Q.number()}),f$=Q.object({prompt:Q.string(),attachments:Q.array(Q.string())}),$$=Q.object({taskMetadata:l}),w$=Q.object({taskMetadata:l,previousState:l}),Y$=Q.object({taskMetadata:l}),Z$=Q.object({taskMetadata:l}),q$=Q.object({taskId:Q.string(),ulid:Q.string(),contextSize:Q.number(),compactionStrategy:Q.string(),previousApiReqIndex:Q.number(),tokensIn:Q.number(),tokensOut:Q.number(),tokensInCache:Q.number(),tokensOutCache:Q.number(),deletedRangeStart:Q.number(),deletedRangeEnd:Q.number(),contextJsonPath:Q.string(),contextRawPath:Q.string()}),sf=Q.object({clineVersion:Q.string(),hookName:rf,timestamp:Q.string(),taskId:Q.string(),sessionContext:Q.object({rootSessionId:Q.string().optional(),hookLogPath:Q.string().optional()}).optional(),workspaceRoots:Q.array(Q.string()),workspaceInfo:Q.custom().optional(),userId:Q.string(),agent_id:Q.string(),parent_agent_id:Q.string().nullable(),iteration:Q.number().optional(),reason:Q.string().optional(),tool_call:Q.object({id:Q.string(),name:Q.string(),input:Q.unknown()}).optional(),tool_result:Q.custom().optional(),turn:Q.unknown().optional(),error:Q.object({name:Q.string(),message:Q.string(),stack:Q.string().optional()}).optional(),preToolUse:t6.optional(),postToolUse:e6.optional(),userPromptSubmit:f$.optional(),taskStart:$$.optional(),taskResume:w$.optional(),taskCancel:Y$.optional(),taskComplete:Z$.optional(),preCompact:q$.optional()}).passthrough();function J$(f){let $=sf.safeParse(f);if(!$.success)return;return $.data}var X3="v1",G3="v1",H3="v1",K3=["client.register","client.list","session.create","session.list","session.get","session.run","session.abort","schedule.create","schedule.list","task.create","task.list","task.get","task.update","task.approve","task.cancel","task.run","task.automation.get","task.automation.set","settings.get","settings.set","connector.start","connector.stop","connector.supervised","run.enqueue","run.list","hub.drain","hub.status","stream.replay"];function F0(f){let $=/^v(\d+)$/.exec(f?.trim()??"");if(!$)return;return Number.parseInt($[1]??"",10)}function Q3(f,$="v1"){let w=F0(f.protocolVersion),Y=F0($);if(w===void 0||Y===void 0)return{compatible:!1,reason:"missing_protocol"};let q=F0(f.minClientProtocolVersion)??w,G=F0(f.maxClientProtocolVersion)??w;return Y>=q&&Y<=G?{compatible:!0}:{compatible:!1,reason:"unsupported_protocol"}}var R3="approval.respond",V3="0",j3="__hubScheduleRunAt",af=["act","plan","yolo"];function X$(f){return af.some(($)=>$===f)}function k3(f,$){if(!f||!Object.hasOwn(f,"mode"))return $;let w=f.mode;if(X$(w))return w;throw Error(`mode must be one of: ${af.join(", ")}`)}var G$=30000,_3=5000;function H$(f){switch(f){case"run.start":case"session.send_input":return null;default:return G$}}function W3(f,$){return $===void 0?H$(f):$}var K$=["readFile","search","bash","webFetch","editor","applyPatch","skills","askQuestion","submit"],Q$=new Set(K$);function F3(f){return typeof f==="string"&&Q$.has(f)}var L3="tool_executor.",U3="custom_tool.",D3="hook.",I3="compaction.compact",P3="checkpoint.create",O3="mistake_limit.decide",B3="user_instructions.snapshot";function A3(f){let $=f.activeSessionCount;if(typeof $!=="number"||$<=0)return"active sessions from other Cline clients";let w=`${$} active session${$===1?"":"s"}`,Y=f.participantClientCount;if(typeof Y!=="number"||Y<=0)return w;return`${w} from ${Y} connected Cline client${Y===1?"":"s"}`}function n0(f,$){return`<file_content path="${f}">
2
2
  ${$}
3
- </file_content>`}function Q$(f,$="act"){return`<user_input mode="${$}">${f}</user_input>`}function R$(f,$){return`<user_command slash="${$}">${f}</user_command>`}function V$(f,$){return`<mode_notice>The user switched from ${f} mode to ${$} mode before sending this message.</mode_notice>`}function j$(){let f=null;return{record($,w){if($===w)return;if(f){f=f.from===w?null:{from:f.from,to:w};return}f={from:$,to:w}},consume(){let $=f;return f=null,$}}}function k$(f,$){let w=f.trim(),Y=new RegExp(`^<${$}\\b([^>]*)>([\\s\\S]*?)<\\/${$}>$`,"i").exec(w);if(!Y)return;return{attrs:Y[1]??"",content:Y[2]??""}}function W$(f,$){return new RegExp(`${$}="([^"]+)"`,"i").exec(f)?.[1]?.trim()||void 0}function tf(f){if(!f?.trim())return;let $=k$(f,"user_command");if(!$)return;let w=W$($.attrs,"slash");if(!w)return;return{slash:w,content:$.content.trim()}}function ef(f){if(!f?.trim())return"";let $=f.trim();for(let w of["user_input","user_command"]){let Y=Z1($,w);$=(Y!==$?Y:$.replace(new RegExp(`<${w}[^>]*>`,"g"),"")).trim()}return $}function f1(f){if(!f?.trim())return"";return _$(f,"mode_notice").trim()}function _$(f,$){let w=`<${$}>`,Y=`</${$}>`,q=f,K=q.indexOf(w);while(K!==-1){let H=q.indexOf(Y,K+w.length);if(H===-1)break;q=q.slice(0,K)+q.slice(H+Y.length),K=q.indexOf(w,K)}return q}function n0(f){let $=f1(ef(f)),w=tf(f);if(!w)return $;if(w.slash.toLowerCase()==="team"){let q=$.toLowerCase().startsWith("spawn a team of agents for the following task:")?$.slice(46).trim():$;return q?`/team ${q}`:"/team"}return $?`/${w.slash} ${$}`:`/${w.slash}`}var $1=240,w1=480;function Y1(f,$){let w=f.replace(/\s+/gu," ").trim();if(w.length<=$)return w;return`${w.slice(0,$-1).trimEnd()}…`}function F$(f){return Y1(n0(f),$1)}function L$(f,$){let w=$?.trim()??"",Y=f.toLowerCase(),q=Y==="user"||Y==="session"?n0(w):w;return Y1(q,w1)}function Z1(f,$){if(!f?.trim())return"";if(!$)return f;let w=new RegExp(`<${$}\\b[^>]*>([\\s\\S]*?)</${$}>`,"g");return f.replace(w,"$1")}import{z as N}from"zod";var a="[media omitted: invalid or exceeds size limit]",t="[Image attached — this model cannot view images]",q1=N.enum(["image","audio","video","file"]),J1=N.discriminatedUnion("type",[N.object({type:N.literal("base64"),data:N.string().min(1)}),N.object({type:N.literal("url"),url:N.string().url().refine((f)=>{let $=new URL(f).protocol;return $==="http:"||$==="https:"},"Generated media URLs must use HTTP or HTTPS")}),N.object({type:N.literal("artifact"),artifactId:N.string().min(1)})]);function X1(f){if(f.startsWith("image/"))return"image";if(f.startsWith("audio/"))return"audio";if(f.startsWith("video/"))return"video";return"file"}var K1=N.object({id:N.string().min(1),modality:q1,mediaType:N.string().min(1),source:J1,name:N.string().min(1).optional(),sizeBytes:N.number().int().nonnegative().optional()}).refine((f)=>X1(f.mediaType)===f.modality,{message:"Generated media modality must match its media type",path:["modality"]});function U$(f){return K1.safeParse(f).success}function D$(f){return X1(f)}var U0=["image/png","image/jpeg","image/gif","image/webp"],h0=5242880,v=h0,x=6291456,H1=8388608;function P$(f){return f.length}function x0(f){let $=f.endsWith("==")?2:f.endsWith("=")?1:0;return Math.floor(f.length*3/4)-$}function O$(f=h0){return Math.floor(f*3/4)}function z0(f){return Math.ceil(f/3)*4}function c0(f={}){return{maxImageEncodedBytes:f.maxImageEncodedBytes??v,maxImageDecodedBytes:f.maxImageDecodedBytes??x,maxTotalMediaBytes:f.maxTotalMediaBytes??H1}}function D0(){return{totalEncodedBytes:0,keptImages:0,omittedImages:0,omittedReasons:{}}}function L0(f,$){f.omittedImages+=1,f.omittedReasons[$]=(f.omittedReasons[$]??0)+1}function X0(f,$,w,Y){let q=c0(w);if(f>q.maxImageEncodedBytes){let K={ok:!1,reason:"encoded_limit",message:`Image media exceeds the ${q.maxImageEncodedBytes} byte encoded limit`};return L0(Y,K.reason),K}if($>q.maxImageDecodedBytes){let K={ok:!1,reason:"decoded_limit",message:`Image media exceeds the ${q.maxImageDecodedBytes} byte decoded limit`};return L0(Y,K.reason),K}if(Y.totalEncodedBytes+f>q.maxTotalMediaBytes){let K={ok:!1,reason:"total_limit",message:`Image media exceeds the ${q.maxTotalMediaBytes} byte total media limit`};return L0(Y,K.reason),K}return Y.totalEncodedBytes+=f,Y.keptImages+=1,null}function G1(f){return f>=65&&f<=90||f>=97&&f<=122||f>=48&&f<=57||f===43||f===47}function B$(f){return f.length>0&&u0(f,0,f.length)}function I$(f,$,w){let Y=Q1(f),q=Y.end-Y.start;if(q===0)return{ok:!1,reason:"invalid_base64",message:"Generated media must contain valid base64"};let K=c0($);if(w.totalEncodedBytes+q>K.maxTotalMediaBytes)return{ok:!1,reason:"total_limit",message:`Generated media exceeds the ${K.maxTotalMediaBytes} byte total media limit`};if(!u0(f,Y.start,Y.end))return{ok:!1,reason:"invalid_base64",message:"Generated media must contain valid base64"};let H=f.slice(Y.start,Y.end);return w.totalEncodedBytes+=q,{ok:!0,base64:H,encodedBytes:q,decodedBytes:x0(H)}}function u0(f,$,w){let Y=w-$;if(Y%4!==0)return!1;let q=w;if(Y>=2&&f.charCodeAt(w-2)===61&&f.charCodeAt(w-1)===61)q-=2;else if(Y>=1&&f.charCodeAt(w-1)===61)q-=1;for(let K=$;K<q;K++)if(!G1(f.charCodeAt(K)))return!1;for(let K=q;K<w;K++)if(f.charCodeAt(K)!==61)return!1;return!0}function A$(f,$,w){return w-$>=5&&(f.charCodeAt($)|32)===100&&(f.charCodeAt($+1)|32)===97&&(f.charCodeAt($+2)|32)===116&&(f.charCodeAt($+3)|32)===97&&f.charCodeAt($+4)===58}function Q1(f){let $=0,w=f.length;while($<w&&/\s/.test(f[$]??""))$+=1;while(w>$&&/\s/.test(f[w-1]??""))w-=1;return{start:$,end:w}}function N$(f,$,w){if(!A$(f,$,w))return;let Y=$+5,q=f.indexOf(",",Y);if(q===-1||q>=w)return;if(q-Y>128)return;let K=f.slice(Y,q).toLowerCase(),H=";base64";if(!K.endsWith(H))return;let G=K.slice(0,-H.length);if(!G||G.includes(";"))return;return{mediaType:G,base64Start:q+1,base64End:w}}function R1(f,$,w={}){let Y=w.maxEncodedBytes??v,q=w.maxDecodedBytes??x,K=new Set(w.supportedMediaTypes??U0),H=f?.toLowerCase(),G=Q1($),j=G.start,k=G.end,F=N$($,G.start,G.end);if(F){if(H&&H!==F.mediaType)return{ok:!1,reason:"media_type_mismatch",message:`Image media type ${f} does not match data URL type ${F.mediaType}`};H=F.mediaType,j=F.base64Start,k=F.base64End}if(!H||!K.has(H))return{ok:!1,reason:"unsupported_media_type",message:`Unsupported image media type: ${f??"unknown"}`};let L=k-j;if(L===0)return{ok:!1,reason:"invalid_base64",message:"Image media must contain valid base64"};if(L>Y)return{ok:!1,reason:"encoded_limit",message:`Image media exceeds the ${Y} byte encoded limit`};if(!u0($,j,k))return{ok:!1,reason:"invalid_base64",message:"Image media must contain valid base64"};let D=$.slice(j,k),b=x0(D);if(b>q)return{ok:!1,reason:"decoded_limit",message:`Image media exceeds the ${q} byte decoded limit`};return{ok:!0,mediaType:H,base64:D,encodedBytes:L,decodedBytes:b}}function K0(f,$,w,Y){let q=R1(f,$,{maxEncodedBytes:w.maxImageEncodedBytes,maxDecodedBytes:w.maxImageDecodedBytes});if(!q.ok)return L0(Y,q.reason),q;let K=X0(q.encodedBytes,q.decodedBytes,w,Y);if(K)return K;return q}function E(f){return f.replace(/[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?<![\uD800-\uDBFF])[\uDC00-\uDFFF]/g,"�")}var H0="ERROR: EMPTY CONTENT",b$="[image attached]",M$="[generated image]";function T$(f){return`[generated ${f}]`}function P0(f){return{type:"text",text:`[generated ${f.modality} unavailable to this model]`}}function o0(f,$){let w=f[f.length-1];if($.role==="tool"&&w?.role==="tool"&&Array.isArray(w.content)&&Array.isArray($.content)){w.content.push(...$.content);return}f.push($)}function E$(f){if(!Array.isArray(f)||f.length===0)return!1;return f.every(($)=>{if(!$||typeof $!=="object")return!1;let w=$;if(w.type==="text")return typeof w.text==="string";if(w.type==="image")return typeof w.data==="string"&&typeof w.mediaType==="string";return!1})}function m(){return{type:"text",text:a}}function V1(f){return X0(v,0,{maxImageEncodedBytes:v,maxImageDecodedBytes:x},f)===null}function k1(f){try{return new URL(f).protocol}catch{return}}function l0(f,$){let w=K0(f.mediaType,f.data,{maxImageEncodedBytes:v,maxImageDecodedBytes:x},$);if(!w.ok)return m();return W1(w.base64,w.mediaType)}function W1(f,$){return{type:"file",data:{type:"data",data:f},mediaType:$}}function e(f,$){return{type:"file",data:f,mediaType:$??"image"}}function m0(f,$){if(f.image instanceof URL){if(f.image.protocol==="data:"){let H=K0(f.mediaType,f.image.href,{maxImageEncodedBytes:v,maxImageDecodedBytes:x},$);if(!H.ok)return m();return e(`data:${H.mediaType};base64,${H.base64}`,H.mediaType)}if(f.image.protocol!=="http:"&&f.image.protocol!=="https:")return m();if(!V1($))return m();return e(f.image,f.mediaType)}if(typeof f.image==="string"){let H=k1(f.image);if(H==="http:"||H==="https:"){if(!V1($))return m();return e(f.image,f.mediaType)}let G=H==="data:",j=K0(f.mediaType??(G?void 0:"image/png"),f.image,{maxImageEncodedBytes:v,maxImageDecodedBytes:x},$);if(!j.ok)return m();return e(G?`data:${j.mediaType};base64,${j.base64}`:j.base64,j.mediaType)}let w=f.image.byteLength,Y=z0(w),q=f.mediaType?.toLowerCase()??"image/png";if(!U0.includes(q)||X0(Y,w,{maxImageEncodedBytes:v,maxImageDecodedBytes:x},$))return m();return e(f.image,q)}function C$(f,$){if(!$)return!0;if(f.modality==="file")return f.mediaType==="application/pdf"&&$.includes("pdf");return $.includes(f.modality)}function j1(f,$,w){if(!C$(f,w))return P0(f);if(f.modality==="image"){if(f.source.type==="artifact")return P0(f);return m0({type:"image",image:f.source.type==="url"?f.source.url:f.source.data,mediaType:f.mediaType},$)}if(f.source.type==="artifact")return P0(f);if(f.source.type==="url"){let Y=k1(f.source.url);if(Y!=="http:"&&Y!=="https:"&&Y!=="data:")return P0(f)}return e(f.source.type==="url"?f.source.url:f.source.data,f.mediaType)}function p0(f,$,w,Y){let{hoistImages:q,inlineImagePlaceholder:K}=Y;if(f==null||typeof f!=="object")return{value:f,changed:!1,mediaChanged:!1};if(Array.isArray(f)){let F=[],L=!1,D=!1;for(let b of f){if(b&&typeof b==="object"){let W=b;if(W.type==="image"&&typeof W.data==="string"&&typeof W.mediaType==="string"){if(!q){F.push(K),L=!0,D=!0;continue}let N0={type:"image",data:W.data,mediaType:W.mediaType},d=l0(N0,w);if(d.type==="file")$.push({type:"image",data:d.data.data,mediaType:d.mediaType});else F.push(d.text);L=!0,D=!0;continue}if(W.type==="image"){F.push(a),L=!0,D=!0;continue}if(W.type==="text"&&typeof W.text==="string"){F.push(W.text),L=!0;continue}}let M=p0(b,$,w,Y);F.push(M.value),L||=M.changed,D||=M.mediaChanged}return{value:L?F:f,changed:L,mediaChanged:D}}let H=f;if(H.type==="image"){if(typeof H.data==="string"&&typeof H.mediaType==="string"){if(!q)return{value:K,changed:!0,mediaChanged:!0};let F={type:"image",data:H.data,mediaType:H.mediaType},L=l0(F,w);if(L.type==="file")return $.push({type:"image",data:L.data.data,mediaType:L.mediaType}),{value:b$,changed:!0,mediaChanged:!0};return{value:L.text,changed:!0,mediaChanged:!0}}return{value:a,changed:!0,mediaChanged:!0}}let G={},j=!1,k=!1;for(let[F,L]of Object.entries(H)){let D=p0(L,$,w,Y);G[F]=D.value,j||=D.changed,k||=D.mediaChanged}return{value:j?G:f,changed:j,mediaChanged:k}}function G0(f){if(typeof f==="string")return E(f);if(Array.isArray(f))return f.map(($)=>G0($));if(f!==null&&typeof f==="object"){let $=f,w={};for(let[Y,q]of Object.entries($))w[Y]=G0(q);return w}return f}function _1(f,$=!1,w=D0(),Y){let q=Y?.supportsImages??!0;if(typeof f==="string")return{type:$?"error-text":"text",value:E(f)};if(!$&&E$(f))return{type:"content",value:f.map((K)=>K.type==="image"?q?l0(K,w):{type:"text",text:t}:{type:"text",text:E(K.text)})};if(f!==null&&typeof f==="object"){let K=[],H=p0(f,K,w,{hoistImages:!$&&q,inlineImagePlaceholder:q?a:t});if(!$&&K.length>0)return{type:"content",value:[{type:"text",text:typeof H.value==="string"?E(H.value):JSON.stringify(G0(H.value))},...K.map((j)=>W1(j.data,j.mediaType))]};if(H.mediaChanged)return{type:$?"error-json":"json",value:G0(H.value)}}if(f===null||typeof f==="boolean"||typeof f==="number"||typeof f==="object")return{type:$?"error-json":"json",value:G0(f)};return{type:$?"error-text":"text",value:E(String(f))}}function y$(f,$,w){let Y=w?.assistantToolCallArgKey??"input",q=w?.supportedInputModalities,K=!q||q.includes("image"),H=[],G=D0(),j=[],k=()=>{return j.splice(0).map((L)=>L.type==="image"?K?m0(L,G):{type:"text",text:t}:j1(L.media,G,q))};if(typeof f==="string"&&f.trim().length>0||Array.isArray(f)&&f.length>0)H.push({role:"system",content:typeof f==="string"?E(f):f});for(let F of $){let L=F.content;if(typeof L==="string"){let W=F.role==="user"&&j.length>0?k():[];if(W.length>0){H.push({role:F.role,content:[{type:"text",text:L.trim().length>0?E(L):H0},...W]});continue}if(L.trim().length===0){H.push({role:F.role,content:[{type:"text",text:H0}]});continue}H.push({role:F.role,content:E(L)});continue}let D=[],b=[];if(L.length===0){H.push({role:F.role,content:[{type:"text",text:H0}]});continue}for(let W of L)switch(W.type){case"text":D.push({type:"text",text:E(W.text),...W.providerOptions?{providerOptions:W.providerOptions}:{}});break;case"reasoning":D.push({type:"reasoning",text:E(W.text),...W.providerOptions?{providerOptions:W.providerOptions}:{}});break;case"image":if(F.role==="assistant")j.push(W),D.push({type:"text",text:M$});else D.push(K?m0(W,G):{type:"text",text:t});break;case"media":if(F.role==="assistant")j.push(W),D.push({type:"text",text:T$(W.media.modality)});else D.push(j1(W.media,G,q));break;case"file":D.push({type:"text",text:v0(W.path,E(W.content))});break;case"tool-call":if(F.role==="assistant")D.push({type:"tool-call",toolCallId:W.toolCallId,toolName:W.toolName,[Y]:W.input,...W.providerOptions?{providerOptions:W.providerOptions}:{}});break;case"tool-result":{b.push({type:"tool-result",toolCallId:W.toolCallId,toolName:W.toolName,output:_1(W.output,W.isError??!1,G,{supportsImages:K})});break}}let M=b.length>0;if(F.role==="user"&&!M&&j.length>0)D.push(...k());if(D.length>0&&D.every((W)=>W.type==="text"&&typeof W.text==="string"&&W.text.trim().length===0))D.splice(0,D.length,{type:"text",text:H0});if(D.length>0)o0(H,{role:F.role,content:D});if(M)o0(H,{role:"tool",content:b})}if(j.length>0)o0(H,{role:"user",content:k()});return H}var E3=["show","hide","subscription"];function F1(f){return typeof f==="object"&&f!==null&&!Array.isArray(f)}function S$(f,$){if(!f&&!$)return;let w=f?.metadata,Y=$?.metadata,q={...f??{},...$??{}};if(F1(w)&&F1(Y))q.metadata={...w,...Y};return q}var S3=["web_search","image_generation"],g3=["web_search"];var Q0={max:1,xhigh:0.95,high:0.8,medium:0.5,low:0.2,minimal:0.1,none:0},g$=void 0;function v$(f,$){if(typeof f==="string"&&f.toLowerCase()in Q0)return f.toLowerCase();return $?void 0:void 0}function L1(f,$){let w=typeof f==="string"?f.toLowerCase():void 0;if(w&&w in Q0)return Q0[w];if($?.fallbackEffort)return Q0[$.fallbackEffort];return}function n$(f){let $=L1(f.effort,{fallbackEffort:f.fallbackEffort});if($===void 0)return;if($<=0)return 0;let w=f.minimumBudget??1;if(f.maxBudget<w)return;let Y=f.scaleTokens??f.maxBudget;return Math.min(Math.max(Math.floor(Y*$),w),f.maxBudget)}function h$(f){return f instanceof Error?{name:f.name,message:f.message}:f}var x$=3;function U1(f){return Math.max(1,Math.ceil(f/3))}function d0(f){let $=new WeakSet;try{return JSON.stringify(f,(w,Y)=>{if(typeof Y==="bigint")return Y.toString();if(typeof Y!=="object"||Y===null)return Y;if($.has(Y))return"[Circular]";return $.add(Y),Y})??""}catch{return String(f??"")}}function z$(f){let $;try{$=JSON.stringify({systemPrompt:f.systemPrompt,messages:f.messages,tools:f.tools})}catch{$=[d0(f.systemPrompt),d0(f.messages),d0(f.tools)].join(`
4
- `)}return U1($.length)}var c$={debug:()=>{},log:()=>{},error:()=>{}};var c3=60,u3=1,o3=3600;function u$(f){return typeof f==="number"&&Number.isFinite(f)}function o$(f){return Math.min(Math.max(f,1),3600)}function l3(f){if(!u$(f))return 60;return o$(f)}function m3(f,$,w){let Y=w?` (${w})`:"",q=Math.round($/100)/10;return`MCP request to "${f}"${Y} timed out after ${q}s. Increase the "timeout" field (in seconds) for this server in cline_mcp_settings.json.`}function l$(f){if(f instanceof Error)return f.message;return String(f)}function m$(f){if(f&&typeof f==="object"&&"code"in f&&typeof f.code==="string")return f.code;return""}class o extends Error{constructor(f,$){super(`${f} at position ${$}`);this.position=$}}function D1(f){return/^[0-9A-Fa-f]$/.test(f)}function c(f){return f>="0"&&f<="9"}function P1(f){return f>=" "}function $0(f){return`,:[]/{}()
5
- +`.includes(f)}function r0(f){return f>="a"&&f<="z"||f>="A"&&f<="Z"||f==="_"||f==="$"}function O0(f){return f>="a"&&f<="z"||f>="A"&&f<="Z"||f==="_"||f==="$"||f>="0"&&f<="9"}var s0=/^(http|https|ftp|mailto|file|data|irc):\/\/$/,i0=/^[A-Za-z0-9-._~:/?#@!$&'()*+;=]$/;function a0(f){return`,[]/{}
6
- +`.includes(f)}function t0(f){return w0(f)||p$.test(f)}var p$=/^[[{\w-]$/;function e0(f){return f===`
7
- `||f==="\r"||f==="\t"||f==="\b"||f==="\f"}function z(f,$){let w=f.charCodeAt($);return w===32||w===10||w===9||w===13}function O1(f,$){let w=f.charCodeAt($);return w===32||w===9||w===13}function B1(f,$){let w=f.charCodeAt($);return w===160||w===6158||w>=8192&&w<=8203||w===8239||w===8287||w===12288||w===65279}function w0(f){return ff(f)||B0(f)}function ff(f){return f==='"'||f==="“"||f==="”"}function $f(f){return f==='"'}function B0(f){return f==="'"||f==="‘"||f==="’"||f==="`"||f==="´"}function wf(f){return f==="'"}function Y0(f,$){let w=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,Y=f.lastIndexOf($);return Y!==-1?f.substring(0,Y)+(w?"":f.substring(Y+1)):f}function C(f,$){let w=f.length;if(!z(f,w-1))return f+$;while(z(f,w-1))w--;return f.substring(0,w)+$+f.substring(w)}function I1(f,$,w){return f.substring(0,$)+f.substring($+w)}function A1(f){return/[,\n][ \t\r]*$/.test(f)}var d$={"&quot;":'"',"&amp;":"&","&lt;":"<","&gt;":">","&apos;":"'"},Yf=12;function Zf(f){if(f.charAt(0)!=="&")return null;let $=f.indexOf(";");if($===-1)return null;let w=f.substring(0,$+1),Y=d$[w];if(Y!==void 0)return{char:Y,length:w.length};if(f.charAt(1)==="#"){let q=f.substring(2,$),K=q.charAt(0)==="x"||q.charAt(0)==="X",H=K?q.substring(1):q;if(H.length>0){let G=Number.parseInt(H,K?16:10);if(!Number.isNaN(G)&&G>=0&&G<=1114111)return{char:String.fromCodePoint(G),length:w.length}}}return null}function N1(f){return f!==null&&f.char==='"'}function b1(f){return f!==null&&f.char==="'"}function f0(f,$){let w=0;for(let Y=0;Y<f.length;Y++)if(f.charAt(Y)===$)w++;return w}function M1(f,$){switch($){case")":return f0(f,"(")>f0(f,")");case"]":return f0(f,"[")>f0(f,"]");case"}":return f0(f,"{")>f0(f,"}");default:return!1}}var T1={"\b":"\\b","\f":"\\f","\n":"\\n","\r":"\\r","\t":"\\t"},r$={'"':'"',"\\":"\\","/":"/",b:"\b",f:"\f",n:`
8
- `,r:"\r",t:"\t"};function qf(f){let $=0,w="";if(k(["```","[```","{```"]),!K())D6();k(["```","```]","```}"]);let q=L(",");if(q)H();if(t0(f[$])&&A1(w)){if(!q)w=C(w,",");d()}else if(q)w=Y0(w,",");while(f[$]==="}"||f[$]==="]")$++,H();if($>=f.length)return w;b0();function K(){H();let R=W()||N0()||r()||I()||_6()||Pf(!1)||F6();return H(),R}function H(){let R=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0,V=$,P=G(R);do if(P=j(),P)P=G(R);while(P);return $>V}function G(R){let V=R?z:O1,P="";while(!0)if(V(f,$))P+=f[$],$++;else if(B1(f,$))P+=" ",$++;else break;if(P.length>0)return w+=P,!0;return!1}function j(){if(f[$]==="/"&&f[$+1]==="*"){while($<f.length&&!s$(f,$))$++;return $+=2,!0}if(f[$]==="/"&&f[$+1]==="/"){while($<f.length&&f[$]!==`
9
- `)$++;return!0}return!1}function k(R){if(F(R)){if(r0(f[$]))while($<f.length&&O0(f[$]))$++;return H(),!0}return!1}function F(R){G(!0);for(let V of R){let P=$+V.length;if(f.slice($,P)===V)return $=P,!0}return!1}function L(R){if(f[$]===R)return w+=f[$],$++,!0;return!1}function D(R){if(f[$]===R)return $++,!0;return!1}function b(){return D("\\")}function M(){if(H(),f[$]==="."&&f[$+1]==="."&&f[$+2]===".")return $+=3,H(),D(","),!0;return!1}function W(){if(f[$]==="{"){if(w+="{",$++,H(),D(","))H();let R=!0;while($<f.length&&f[$]!=="}"){let V;if(!R){if(V=L(","),!V)w=C(w,",");H()}else V=!0;if(M(),!(r()||Pf(!0))){if(f[$]==="}"||f[$]==="{"||f[$]==="]"||f[$]==="["||f[$]===void 0){if(!R)w=Y0(w,",")}else P6();break}H();let n=L(":"),i=$>=f.length;if(!n)if(t0(f[$])||i)w=C(w,":");else If();if(!K())if(n||i)w+="null";else If();R=!1}if(f[$]==="}")w+="}",$++;else w=C(w,"}");return!0}return!1}function N0(){if(f[$]==="["){if(w+="[",$++,H(),D(","))H();let R=!0;while($<f.length&&f[$]!=="]"){if(!R){if(!L(","))w=C(w,",")}if(M(),!K()){if(!R)w=Y0(w,",");break}R=!1}if(f[$]==="]")w+="]",$++;else w=C(w,"]");return!0}return!1}function d(){let R=!0,V=!0;while(V){if(!R){if(!L(","))w=C(w,",")}else R=!1;V=K()}if(!V)w=Y0(w,",");w=`[
3
+ </file_content>`}function R$(f,$="act"){return`<user_input mode="${$}">${f}</user_input>`}function V$(f,$){return`<user_command slash="${$}">${f}</user_command>`}function j$(f,$){return`<mode_notice>The user switched from ${f} mode to ${$} mode before sending this message.</mode_notice>`}function k$(){let f=null;return{record($,w){if($===w)return;if(f){f=f.from===w?null:{from:f.from,to:w};return}f={from:$,to:w}},consume(){let $=f;return f=null,$}}}function _$(f,$){let w=f.trim(),Y=new RegExp(`^<${$}\\b([^>]*)>([\\s\\S]*?)<\\/${$}>$`,"i").exec(w);if(!Y)return;return{attrs:Y[1]??"",content:Y[2]??""}}function W$(f,$){return new RegExp(`${$}="([^"]+)"`,"i").exec(f)?.[1]?.trim()||void 0}function tf(f){if(!f?.trim())return;let $=_$(f,"user_command");if(!$)return;let w=W$($.attrs,"slash");if(!w)return;return{slash:w,content:$.content.trim()}}function ef(f){if(!f?.trim())return"";let $=f.trim();for(let w of["user_input","user_command"]){let Y=Z1($,w);$=(Y!==$?Y:$.replace(new RegExp(`<${w}[^>]*>`,"g"),"")).trim()}return $}function f1(f){if(!f?.trim())return"";return F$(f,"mode_notice").trim()}function F$(f,$){let w=`<${$}>`,Y=`</${$}>`,q=f,G=q.indexOf(w);while(G!==-1){let H=q.indexOf(Y,G+w.length);if(H===-1)break;q=q.slice(0,G)+q.slice(H+Y.length),G=q.indexOf(w,G)}return q}function v0(f){let $=f1(ef(f)),w=tf(f);if(!w)return $;if(w.slash.toLowerCase()==="team"){let q=$.toLowerCase().startsWith("spawn a team of agents for the following task:")?$.slice(46).trim():$;return q?`/team ${q}`:"/team"}return $?`/${w.slash} ${$}`:`/${w.slash}`}var $1=240,w1=480;function Y1(f,$){let w=f.replace(/\s+/gu," ").trim();if(w.length<=$)return w;return`${w.slice(0,$-1).trimEnd()}…`}function L$(f){return Y1(v0(f),$1)}function U$(f,$){let w=$?.trim()??"",Y=f.toLowerCase(),q=Y==="user"||Y==="session"?v0(w):w;return Y1(q,w1)}function Z1(f,$){if(!f?.trim())return"";if(!$)return f;let w=new RegExp(`<${$}\\b[^>]*>([\\s\\S]*?)</${$}>`,"g");return f.replace(w,"$1")}import{z as N}from"zod";var t="[media omitted: invalid or exceeds size limit]",e="[Image attached — this model cannot view images]",q1=N.enum(["image","audio","video","file"]),J1=N.discriminatedUnion("type",[N.object({type:N.literal("base64"),data:N.string().min(1)}),N.object({type:N.literal("url"),url:N.string().url().refine((f)=>{let $=new URL(f).protocol;return $==="http:"||$==="https:"},"Generated media URLs must use HTTP or HTTPS")}),N.object({type:N.literal("artifact"),artifactId:N.string().min(1)})]);function X1(f){if(f.startsWith("image/"))return"image";if(f.startsWith("audio/"))return"audio";if(f.startsWith("video/"))return"video";return"file"}var G1=N.object({id:N.string().min(1),modality:q1,mediaType:N.string().min(1),source:J1,name:N.string().min(1).optional(),sizeBytes:N.number().int().nonnegative().optional()}).refine((f)=>X1(f.mediaType)===f.modality,{message:"Generated media modality must match its media type",path:["modality"]});function D$(f){return G1.safeParse(f).success}function I$(f){return X1(f)}var U0=["image/png","image/jpeg","image/gif","image/webp"],h0=5242880,n=h0,x=6291456,H1=8388608;function P$(f){return f.length}function x0(f){let $=f.endsWith("==")?2:f.endsWith("=")?1:0;return Math.floor(f.length*3/4)-$}function O$(f=h0){return Math.floor(f*3/4)}function z0(f){return Math.ceil(f/3)*4}function c0(f={}){return{maxImageEncodedBytes:f.maxImageEncodedBytes??n,maxImageDecodedBytes:f.maxImageDecodedBytes??x,maxTotalMediaBytes:f.maxTotalMediaBytes??H1}}function D0(){return{totalEncodedBytes:0,keptImages:0,omittedImages:0,omittedReasons:{}}}function L0(f,$){f.omittedImages+=1,f.omittedReasons[$]=(f.omittedReasons[$]??0)+1}function X0(f,$,w,Y){let q=c0(w);if(f>q.maxImageEncodedBytes){let G={ok:!1,reason:"encoded_limit",message:`Image media exceeds the ${q.maxImageEncodedBytes} byte encoded limit`};return L0(Y,G.reason),G}if($>q.maxImageDecodedBytes){let G={ok:!1,reason:"decoded_limit",message:`Image media exceeds the ${q.maxImageDecodedBytes} byte decoded limit`};return L0(Y,G.reason),G}if(Y.totalEncodedBytes+f>q.maxTotalMediaBytes){let G={ok:!1,reason:"total_limit",message:`Image media exceeds the ${q.maxTotalMediaBytes} byte total media limit`};return L0(Y,G.reason),G}return Y.totalEncodedBytes+=f,Y.keptImages+=1,null}function K1(f){return f>=65&&f<=90||f>=97&&f<=122||f>=48&&f<=57||f===43||f===47}function B$(f){return f.length>0&&u0(f,0,f.length)}function A$(f,$,w){let Y=Q1(f),q=Y.end-Y.start;if(q===0)return{ok:!1,reason:"invalid_base64",message:"Generated media must contain valid base64"};let G=c0($);if(w.totalEncodedBytes+q>G.maxTotalMediaBytes)return{ok:!1,reason:"total_limit",message:`Generated media exceeds the ${G.maxTotalMediaBytes} byte total media limit`};if(!u0(f,Y.start,Y.end))return{ok:!1,reason:"invalid_base64",message:"Generated media must contain valid base64"};let H=f.slice(Y.start,Y.end);return w.totalEncodedBytes+=q,{ok:!0,base64:H,encodedBytes:q,decodedBytes:x0(H)}}function u0(f,$,w){let Y=w-$;if(Y%4!==0)return!1;let q=w;if(Y>=2&&f.charCodeAt(w-2)===61&&f.charCodeAt(w-1)===61)q-=2;else if(Y>=1&&f.charCodeAt(w-1)===61)q-=1;for(let G=$;G<q;G++)if(!K1(f.charCodeAt(G)))return!1;for(let G=q;G<w;G++)if(f.charCodeAt(G)!==61)return!1;return!0}function N$(f,$,w){return w-$>=5&&(f.charCodeAt($)|32)===100&&(f.charCodeAt($+1)|32)===97&&(f.charCodeAt($+2)|32)===116&&(f.charCodeAt($+3)|32)===97&&f.charCodeAt($+4)===58}function Q1(f){let $=0,w=f.length;while($<w&&/\s/.test(f[$]??""))$+=1;while(w>$&&/\s/.test(f[w-1]??""))w-=1;return{start:$,end:w}}function b$(f,$,w){if(!N$(f,$,w))return;let Y=$+5,q=f.indexOf(",",Y);if(q===-1||q>=w)return;if(q-Y>128)return;let G=f.slice(Y,q).toLowerCase(),H=";base64";if(!G.endsWith(H))return;let K=G.slice(0,-H.length);if(!K||K.includes(";"))return;return{mediaType:K,base64Start:q+1,base64End:w}}function R1(f,$,w={}){let Y=w.maxEncodedBytes??n,q=w.maxDecodedBytes??x,G=new Set(w.supportedMediaTypes??U0),H=f?.toLowerCase(),K=Q1($),j=K.start,k=K.end,F=b$($,K.start,K.end);if(F){if(H&&H!==F.mediaType)return{ok:!1,reason:"media_type_mismatch",message:`Image media type ${f} does not match data URL type ${F.mediaType}`};H=F.mediaType,j=F.base64Start,k=F.base64End}if(!H||!G.has(H))return{ok:!1,reason:"unsupported_media_type",message:`Unsupported image media type: ${f??"unknown"}`};let L=k-j;if(L===0)return{ok:!1,reason:"invalid_base64",message:"Image media must contain valid base64"};if(L>Y)return{ok:!1,reason:"encoded_limit",message:`Image media exceeds the ${Y} byte encoded limit`};if(!u0($,j,k))return{ok:!1,reason:"invalid_base64",message:"Image media must contain valid base64"};let D=$.slice(j,k),b=x0(D);if(b>q)return{ok:!1,reason:"decoded_limit",message:`Image media exceeds the ${q} byte decoded limit`};return{ok:!0,mediaType:H,base64:D,encodedBytes:L,decodedBytes:b}}function G0(f,$,w,Y){let q=R1(f,$,{maxEncodedBytes:w.maxImageEncodedBytes,maxDecodedBytes:w.maxImageDecodedBytes});if(!q.ok)return L0(Y,q.reason),q;let G=X0(q.encodedBytes,q.decodedBytes,w,Y);if(G)return G;return q}function T(f){return f.replace(/[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?<![\uD800-\uDBFF])[\uDC00-\uDFFF]/g,"�")}var H0="ERROR: EMPTY CONTENT",C$="[image attached]",M$="[generated image]";function T$(f){return`[generated ${f}]`}function I0(f){return{type:"text",text:`[generated ${f.modality} unavailable to this model]`}}function o0(f,$){let w=f[f.length-1];if($.role==="tool"&&w?.role==="tool"&&Array.isArray(w.content)&&Array.isArray($.content)){w.content.push(...$.content);return}f.push($)}function y$(f){if(!Array.isArray(f)||f.length===0)return!1;return f.every(($)=>{if(!$||typeof $!=="object")return!1;let w=$;if(w.type==="text")return typeof w.text==="string";if(w.type==="image")return typeof w.data==="string"&&typeof w.mediaType==="string";return!1})}function m(){return{type:"text",text:t}}function V1(f){return X0(n,0,{maxImageEncodedBytes:n,maxImageDecodedBytes:x},f)===null}function k1(f){try{return new URL(f).protocol}catch{return}}function l0(f,$){let w=G0(f.mediaType,f.data,{maxImageEncodedBytes:n,maxImageDecodedBytes:x},$);if(!w.ok)return m();return _1(w.base64,w.mediaType)}function _1(f,$){return{type:"file",data:{type:"data",data:f},mediaType:$}}function f0(f,$){return{type:"file",data:f,mediaType:$??"image"}}function m0(f,$){if(f.image instanceof URL){if(f.image.protocol==="data:"){let H=G0(f.mediaType,f.image.href,{maxImageEncodedBytes:n,maxImageDecodedBytes:x},$);if(!H.ok)return m();return f0(`data:${H.mediaType};base64,${H.base64}`,H.mediaType)}if(f.image.protocol!=="http:"&&f.image.protocol!=="https:")return m();if(!V1($))return m();return f0(f.image,f.mediaType)}if(typeof f.image==="string"){let H=k1(f.image);if(H==="http:"||H==="https:"){if(!V1($))return m();return f0(f.image,f.mediaType)}let K=H==="data:",j=G0(f.mediaType??(K?void 0:"image/png"),f.image,{maxImageEncodedBytes:n,maxImageDecodedBytes:x},$);if(!j.ok)return m();return f0(K?`data:${j.mediaType};base64,${j.base64}`:j.base64,j.mediaType)}let w=f.image.byteLength,Y=z0(w),q=f.mediaType?.toLowerCase()??"image/png";if(!U0.includes(q)||X0(Y,w,{maxImageEncodedBytes:n,maxImageDecodedBytes:x},$))return m();return f0(f.image,q)}function E$(f,$){if(!$)return!0;if(f.modality==="file")return f.mediaType==="application/pdf"&&$.includes("pdf");return $.includes(f.modality)}function j1(f,$,w){if(!E$(f,w))return I0(f);if(f.modality==="image"){if(f.source.type==="artifact")return I0(f);return m0({type:"image",image:f.source.type==="url"?f.source.url:f.source.data,mediaType:f.mediaType},$)}if(f.source.type==="artifact")return I0(f);if(f.source.type==="url"){let Y=k1(f.source.url);if(Y!=="http:"&&Y!=="https:"&&Y!=="data:")return I0(f)}return f0(f.source.type==="url"?f.source.url:f.source.data,f.mediaType)}function d0(f,$,w,Y){let{hoistImages:q,inlineImagePlaceholder:G}=Y;if(f==null||typeof f!=="object")return{value:f,changed:!1,mediaChanged:!1};if(Array.isArray(f)){let F=[],L=!1,D=!1;for(let b of f){if(b&&typeof b==="object"){let _=b;if(_.type==="image"&&typeof _.data==="string"&&typeof _.mediaType==="string"){if(!q){F.push(G),L=!0,D=!0;continue}let N0={type:"image",data:_.data,mediaType:_.mediaType},p=l0(N0,w);if(p.type==="file")$.push({type:"image",data:p.data.data,mediaType:p.mediaType});else F.push(p.text);L=!0,D=!0;continue}if(_.type==="image"){F.push(t),L=!0,D=!0;continue}if(_.type==="text"&&typeof _.text==="string"){F.push(_.text),L=!0;continue}}let C=d0(b,$,w,Y);F.push(C.value),L||=C.changed,D||=C.mediaChanged}return{value:L?F:f,changed:L,mediaChanged:D}}let H=f;if(H.type==="image"){if(typeof H.data==="string"&&typeof H.mediaType==="string"){if(!q)return{value:G,changed:!0,mediaChanged:!0};let F={type:"image",data:H.data,mediaType:H.mediaType},L=l0(F,w);if(L.type==="file")return $.push({type:"image",data:L.data.data,mediaType:L.mediaType}),{value:C$,changed:!0,mediaChanged:!0};return{value:L.text,changed:!0,mediaChanged:!0}}return{value:t,changed:!0,mediaChanged:!0}}let K={},j=!1,k=!1;for(let[F,L]of Object.entries(H)){let D=d0(L,$,w,Y);K[F]=D.value,j||=D.changed,k||=D.mediaChanged}return{value:j?K:f,changed:j,mediaChanged:k}}function K0(f){if(typeof f==="string")return T(f);if(Array.isArray(f))return f.map(($)=>K0($));if(f!==null&&typeof f==="object"){let $=f,w={};for(let[Y,q]of Object.entries($))w[Y]=K0(q);return w}return f}function W1(f,$=!1,w=D0(),Y){let q=Y?.supportsImages??!0;if(typeof f==="string")return{type:$?"error-text":"text",value:T(f)};if(!$&&y$(f))return{type:"content",value:f.map((G)=>G.type==="image"?q?l0(G,w):{type:"text",text:e}:{type:"text",text:T(G.text)})};if(f!==null&&typeof f==="object"){let G=[],H=d0(f,G,w,{hoistImages:!$&&q,inlineImagePlaceholder:q?t:e});if(!$&&G.length>0)return{type:"content",value:[{type:"text",text:typeof H.value==="string"?T(H.value):JSON.stringify(K0(H.value))},...G.map((j)=>_1(j.data,j.mediaType))]};if(H.mediaChanged)return{type:$?"error-json":"json",value:K0(H.value)}}if(f===null||typeof f==="boolean"||typeof f==="number"||typeof f==="object")return{type:$?"error-json":"json",value:K0(f)};return{type:$?"error-text":"text",value:T(String(f))}}function S$(f,$,w){let Y=w?.assistantToolCallArgKey??"input",q=w?.supportedInputModalities,G=!q||q.includes("image"),H=[],K=D0(),j=[],k=()=>{return j.splice(0).map((L)=>L.type==="image"?G?m0(L,K):{type:"text",text:e}:j1(L.media,K,q))};if(typeof f==="string"&&f.trim().length>0||Array.isArray(f)&&f.length>0)H.push({role:"system",content:typeof f==="string"?T(f):f});for(let F of $){let L=F.content;if(typeof L==="string"){let _=F.role==="user"&&j.length>0?k():[];if(_.length>0){H.push({role:F.role,content:[{type:"text",text:L.trim().length>0?T(L):H0},..._]});continue}if(L.trim().length===0){H.push({role:F.role,content:[{type:"text",text:H0}]});continue}H.push({role:F.role,content:T(L)});continue}let D=[],b=[];if(L.length===0){H.push({role:F.role,content:[{type:"text",text:H0}]});continue}for(let _ of L)switch(_.type){case"text":D.push({type:"text",text:T(_.text),..._.providerOptions?{providerOptions:_.providerOptions}:{}});break;case"reasoning":D.push({type:"reasoning",text:T(_.text),..._.providerOptions?{providerOptions:_.providerOptions}:{}});break;case"image":if(F.role==="assistant")j.push(_),D.push({type:"text",text:M$});else D.push(G?m0(_,K):{type:"text",text:e});break;case"media":if(F.role==="assistant")j.push(_),D.push({type:"text",text:T$(_.media.modality)});else D.push(j1(_.media,K,q));break;case"file":D.push({type:"text",text:n0(_.path,T(_.content))});break;case"tool-call":if(F.role==="assistant")D.push({type:"tool-call",toolCallId:_.toolCallId,toolName:_.toolName,[Y]:_.input,..._.providerOptions?{providerOptions:_.providerOptions}:{}});break;case"tool-result":{b.push({type:"tool-result",toolCallId:_.toolCallId,toolName:_.toolName,output:W1(_.output,_.isError??!1,K,{supportsImages:G})});break}}let C=b.length>0;if(F.role==="user"&&!C&&j.length>0)D.push(...k());if(D.length>0&&D.every((_)=>_.type==="text"&&typeof _.text==="string"&&_.text.trim().length===0))D.splice(0,D.length,{type:"text",text:H0});if(D.length>0)o0(H,{role:F.role,content:D});if(C)o0(H,{role:"tool",content:b})}if(j.length>0)o0(H,{role:"user",content:k()});return H}var S3=["show","hide","subscription"];function F1(f){return typeof f==="object"&&f!==null&&!Array.isArray(f)}function g$(f,$){if(!f&&!$)return;let w=f?.metadata,Y=$?.metadata,q={...f??{},...$??{}};if(F1(w)&&F1(Y))q.metadata={...w,...Y};return q}var v3=["web_search","image_generation"],h3=["web_search"];var Q0={max:1,xhigh:0.95,high:0.8,medium:0.5,low:0.2,minimal:0.1,none:0},n$=void 0;function v$(f,$){if(typeof f==="string"&&f.toLowerCase()in Q0)return f.toLowerCase();return $?void 0:void 0}function L1(f,$){let w=typeof f==="string"?f.toLowerCase():void 0;if(w&&w in Q0)return Q0[w];if($?.fallbackEffort)return Q0[$.fallbackEffort];return}function h$(f){let $=L1(f.effort,{fallbackEffort:f.fallbackEffort});if($===void 0)return;if($<=0)return 0;let w=f.minimumBudget??1;if(f.maxBudget<w)return;let Y=f.scaleTokens??f.maxBudget;return Math.min(Math.max(Math.floor(Y*$),w),f.maxBudget)}function x$(f){return f instanceof Error?{name:f.name,message:f.message}:f}var z$=3;function U1(f){return Math.max(1,Math.ceil(f/3))}function p0(f){let $=new WeakSet;try{return JSON.stringify(f,(w,Y)=>{if(typeof Y==="bigint")return Y.toString();if(typeof Y!=="object"||Y===null)return Y;if($.has(Y))return"[Circular]";return $.add(Y),Y})??""}catch{return String(f??"")}}function c$(f){let $;try{$=JSON.stringify({systemPrompt:f.systemPrompt,messages:f.messages,tools:f.tools})}catch{$=[p0(f.systemPrompt),p0(f.messages),p0(f.tools)].join(`
4
+ `)}return U1($.length)}var u$={debug:()=>{},log:()=>{},error:()=>{}};var l3=60,m3=1,d3=3600;function o$(f){return typeof f==="number"&&Number.isFinite(f)}function l$(f){return Math.min(Math.max(f,1),3600)}function p3(f){if(!o$(f))return 60;return l$(f)}function r3(f,$,w){let Y=w?` (${w})`:"",q=Math.round($/100)/10;return`MCP request to "${f}"${Y} timed out after ${q}s. Increase the "timeout" field (in seconds) for this server in cline_mcp_settings.json.`}function m$(f){if(f instanceof Error)return f.message;return String(f)}function d$(f){if(f&&typeof f==="object"&&"code"in f&&typeof f.code==="string")return f.code;return""}class o extends Error{constructor(f,$){super(`${f} at position ${$}`);this.position=$}}function D1(f){return/^[0-9A-Fa-f]$/.test(f)}function c(f){return f>="0"&&f<="9"}function I1(f){return f>=" "}function w0(f){return`,:[]/{}()
5
+ +`.includes(f)}function r0(f){return f>="a"&&f<="z"||f>="A"&&f<="Z"||f==="_"||f==="$"}function P0(f){return f>="a"&&f<="z"||f>="A"&&f<="Z"||f==="_"||f==="$"||f>="0"&&f<="9"}var s0=/^(http|https|ftp|mailto|file|data|irc):\/\/$/,i0=/^[A-Za-z0-9-._~:/?#@!$&'()*+;=]$/;function a0(f){return`,[]/{}
6
+ +`.includes(f)}function t0(f){return Y0(f)||p$.test(f)}var p$=/^[[{\w-]$/;function e0(f){return f===`
7
+ `||f==="\r"||f==="\t"||f==="\b"||f==="\f"}function z(f,$){let w=f.charCodeAt($);return w===32||w===10||w===9||w===13}function P1(f,$){let w=f.charCodeAt($);return w===32||w===9||w===13}function O1(f,$){let w=f.charCodeAt($);return w===160||w===6158||w>=8192&&w<=8203||w===8239||w===8287||w===12288||w===65279}function Y0(f){return ff(f)||O0(f)}function ff(f){return f==='"'||f==="“"||f==="”"}function $f(f){return f==='"'}function O0(f){return f==="'"||f==="‘"||f==="’"||f==="`"||f==="´"}function wf(f){return f==="'"}function Z0(f,$){let w=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,Y=f.lastIndexOf($);return Y!==-1?f.substring(0,Y)+(w?"":f.substring(Y+1)):f}function y(f,$){let w=f.length;if(!z(f,w-1))return f+$;while(z(f,w-1))w--;return f.substring(0,w)+$+f.substring(w)}function B1(f,$,w){return f.substring(0,$)+f.substring($+w)}function A1(f){return/[,\n][ \t\r]*$/.test(f)}var r$={"&quot;":'"',"&amp;":"&","&lt;":"<","&gt;":">","&apos;":"'"},Yf=12;function Zf(f){if(f.charAt(0)!=="&")return null;let $=f.indexOf(";");if($===-1)return null;let w=f.substring(0,$+1),Y=r$[w];if(Y!==void 0)return{char:Y,length:w.length};if(f.charAt(1)==="#"){let q=f.substring(2,$),G=q.charAt(0)==="x"||q.charAt(0)==="X",H=G?q.substring(1):q;if(H.length>0){let K=Number.parseInt(H,G?16:10);if(!Number.isNaN(K)&&K>=0&&K<=1114111)return{char:String.fromCodePoint(K),length:w.length}}}return null}function N1(f){return f!==null&&f.char==='"'}function b1(f){return f!==null&&f.char==="'"}function $0(f,$){let w=0;for(let Y=0;Y<f.length;Y++)if(f.charAt(Y)===$)w++;return w}function C1(f,$){switch($){case")":return $0(f,"(")>$0(f,")");case"]":return $0(f,"[")>$0(f,"]");case"}":return $0(f,"{")>$0(f,"}");default:return!1}}var M1={"\b":"\\b","\f":"\\f","\n":"\\n","\r":"\\r","\t":"\\t"},s$={'"':'"',"\\":"\\","/":"/",b:"\b",f:"\f",n:`
8
+ `,r:"\r",t:"\t"};function qf(f){let $=0,w="";if(k(["```","[```","{```"]),!G())I6();k(["```","```]","```}"]);let q=L(",");if(q)H();if(t0(f[$])&&A1(w)){if(!q)w=y(w,",");p()}else if(q)w=Z0(w,",");while(f[$]==="}"||f[$]==="]")$++,H();if($>=f.length)return w;b0();function G(){H();let R=_()||N0()||r()||B()||F6()||If(!1)||L6();return H(),R}function H(){let R=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0,V=$,I=K(R);do if(I=j(),I)I=K(R);while(I);return $>V}function K(R){let V=R?z:P1,I="";while(!0)if(V(f,$))I+=f[$],$++;else if(O1(f,$))I+=" ",$++;else break;if(I.length>0)return w+=I,!0;return!1}function j(){if(f[$]==="/"&&f[$+1]==="*"){while($<f.length&&!i$(f,$))$++;return $+=2,!0}if(f[$]==="/"&&f[$+1]==="/"){while($<f.length&&f[$]!==`
9
+ `)$++;return!0}return!1}function k(R){if(F(R)){if(r0(f[$]))while($<f.length&&P0(f[$]))$++;return H(),!0}return!1}function F(R){K(!0);for(let V of R){let I=$+V.length;if(f.slice($,I)===V)return $=I,!0}return!1}function L(R){if(f[$]===R)return w+=f[$],$++,!0;return!1}function D(R){if(f[$]===R)return $++,!0;return!1}function b(){return D("\\")}function C(){if(H(),f[$]==="."&&f[$+1]==="."&&f[$+2]===".")return $+=3,H(),D(","),!0;return!1}function _(){if(f[$]==="{"){if(w+="{",$++,H(),D(","))H();let R=!0;while($<f.length&&f[$]!=="}"){let V;if(!R){if(V=L(","),!V)w=y(w,",");H()}else V=!0;if(C(),!(r()||If(!0))){if(f[$]==="}"||f[$]==="{"||f[$]==="]"||f[$]==="["||f[$]===void 0){if(!R)w=Z0(w,",")}else P6();break}H();let v=L(":"),i=$>=f.length;if(!v)if(t0(f[$])||i)w=y(w,":");else Bf();if(!G())if(v||i)w+="null";else Bf();R=!1}if(f[$]==="}")w+="}",$++;else w=y(w,"}");return!0}return!1}function N0(){if(f[$]==="["){if(w+="[",$++,H(),D(","))H();let R=!0;while($<f.length&&f[$]!=="]"){if(!R){if(!L(","))w=y(w,",")}if(C(),!G()){if(!R)w=Z0(w,",");break}R=!1}if(f[$]==="]")w+="]",$++;else w=y(w,"]");return!0}return!1}function p(){let R=!0,V=!0;while(V){if(!R){if(!L(","))w=y(w,",")}else R=!1;V=G()}if(!V)w=Z0(w,",");w=`[
10
10
  ${w}
11
- ]`}function r(){let R=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,V=arguments.length>1&&arguments[1]!==void 0?arguments[1]:-1,P=f[$]==="\\";if(P){if($++,!w0(f[$]))b0()}let n=f[$]==="&"?Zf(f.slice($,$+Yf)):null,i=N1(n)||b1(n);if(w0(f[$])||i){let Af=$f(f[$])?$f:wf(f[$])?wf:B0(f[$])?B0:ff,V0=$,j0=w.length,O='"';$+=i&&n?n.length:1;while(!0){if($>=f.length){let A=Of($-1);if(!R&&$0(f.charAt(A)))return $=V0,w=w.substring(0,j0),r(!0);return O=C(O,'"'),w+=O,!0}if($===V)return O=C(O,'"'),w+=O,!0;let h=i&&f[$]==="&"?Zf(f.slice($,$+Yf)):null;if(h&&n?h.char===n.char:Af(f[$])){let A=$,M0=O.length;if(O+='"',$+=h?h.length:1,w+=O,H(!1),R||$>=f.length||$0(f[$])&&!M1(O,f[$])||w0(f[$])&&!L6($)||c(f[$]))return Df(),!0;if(f[$]==="\\")b0();let u=Of(A-1),Nf=f.charAt(u);if(Nf===",")return $=V0,w=w.substring(0,j0),r(!1,u);if($0(Nf))return $=V0,w=w.substring(0,j0),r(!0);w=w.substring(0,j0),$=A+(h?h.length:1),O=`${O.substring(0,M0)}\\${O.substring(M0)}`}else if(R&&a0(f[$])){if(f[$-1]===":"&&s0.test(f.substring(V0+1,$+2)))while($<f.length&&i0.test(f[$]))O+=f[$],$++;return O=C(O,'"'),w+=O,Df(),!0}else if(h){let A=h.char;if(A==='"')O+="\\\"";else if(e0(A))O+=T1[A];else O+=A;$+=h.length}else if(f[$]==="\\"){let A=f.charAt($+1);if(r$[A]!==void 0)O+=f.slice($,$+2),$+=2;else if(A==="u"){let u=2;while(u<6&&D1(f[$+u]))u++;if(u===6)O+=f.slice($,$+6),$+=6;else if($+u>=f.length)$=f.length;else O6()}else if(A===`
12
- `)O+="\\n",$+=2;else O+=A,$+=2}else{let A=f.charAt($);if(A==='"'&&f[$-1]!=="\\")O+=`\\${A}`,$++;else if(e0(A))O+=T1[A],$++;else{if(!P1(A))U6(A);O+=A,$++}}if(P)b()}}return!1}function Df(){let R=!1;H();while(f[$]==="+"){R=!0,$++,H(),w=Y0(w,'"',!0);let V=w.length;if(r())w=I1(w,V,1);else w=C(w,'"')}return R}function I(){let R=$,V="",P=!1;if(f[$]==="-"){if(V+=f[$],$++,!c(f[$])&&Bf())V+="0"}if(f[$]==="0"&&c(f[$+1]))P=!0;while(c(f[$]))V+=f[$],$++;if(f[$]==="."){if(V===""||V==="-")V+="0";if(V+=f[$],$++,!c(f[$]))V+="0";while(c(f[$]))V+=f[$],$++}if($>R){if(f[$]==="e"||f[$]==="E"){if(V==="-")P=!0;if(V+=f[$],$++,f[$]==="-"||f[$]==="+")V+=f[$],$++;if(!c(f[$]))V+="0";while(c(f[$]))V+=f[$],$++}if(!Bf())return $=R,!1;return w+=P?`"${f.substring(R,$)}"`:V,!0}return!1}function _6(){return s("true","true")||s("false","false")||s("null","null")||s("True","true")||s("False","false")||s("None","null")}function s(R,V){if(f.slice($,$+R.length)===R&&!O0(f[$+R.length]))return w+=V,$+=R.length,!0;return!1}function Pf(R){let V=$;if(r0(f[$])){while($<f.length&&O0(f[$]))$++;let P=$;while(z(f,P))P++;if(f[P]==="("){if($=P+1,K(),f[$]===")"){if($++,f[$]===";")$++}return!0}}while($<f.length&&!a0(f[$])&&!w0(f[$])&&(!R||f[$]!==":"))$++;if(f[$-1]===":"&&s0.test(f.substring(V,$+2)))while($<f.length&&i0.test(f[$]))$++;if($>V){while(z(f,$-1)&&$>0)$--;let P=f.slice(V,$);if(w+=P==="undefined"?"null":JSON.stringify(P),f[$]==='"')$++;return!0}}function F6(){if(f[$]==="/"){let R=$;$++;while($<f.length&&(f[$]!=="/"||f[$-1]==="\\"))$++;return $++,w+=JSON.stringify(f.substring(R,$)),!0}}function Of(R){let V=R;while(V>0&&z(f,V))V--;return V}function L6(R){let V=R+1;while(V<f.length&&z(f,V))V++;return V>=f.length||$0(f[V])}function Bf(){return $>=f.length||$0(f[$])||z(f,$)}function U6(R){throw new o(`Invalid character ${JSON.stringify(R)}`,$)}function b0(){throw new o(`Unexpected character ${JSON.stringify(f[$])}`,$)}function D6(){throw new o("Unexpected end of json string",f.length)}function P6(){throw new o("Object key expected",$)}function If(){throw new o("Colon expected",$)}function O6(){let R=f.slice($,$+6);throw new o(`Invalid unicode character "${R}"`,$)}}function s$(f,$){return f[$]==="*"&&f[$+1]==="/"}function i$(f){let $=!1,w=!1,Y=!1;for(let q=0;q<f.length;q+=1){let K=f[q];if(Y){Y=!1;continue}if(K==="\\"){Y=!0;continue}if(!w&&K==='"')$=!$;else if(!$&&K==="'")w=!w}return $||w}var a$=/^\{\s*"([A-Za-z0-9_.$-]+)"\s*:\s*([\s\S]+?)\s*\}$/;function t$(f){let $=f.match(a$);if(!$)return;let[,w,Y]=$,q=Y.trim();if(!q)return;let K=q[0];if(K==='"'||K==="{"||K==="["||q==="true"||q==="false"||q==="null"||Number.isFinite(Number(q)))return;return JSON.parse(`{"${w}":${JSON.stringify(q)}}`)}function e$(f){if(typeof f!=="string")return f;let $=f.trimStart();if($[0]!=="{"&&$[0]!=="[")return f;try{return JSON.parse($)}catch{}if(!i$($))try{return JSON.parse(qf($))}catch{}return t$($)??f}function f2(f){let $=new WeakSet;try{return JSON.stringify(f,(Y,q)=>{if(typeof q==="bigint")return q.toString();if(q&&typeof q==="object"){if($.has(q))return"[Circular]";$.add(q)}return q})??"null"}catch{return String(f)}}function $2(f){try{return JSON.parse(f)}catch{return}}function Z0(f){return typeof f==="object"&&f!==null&&!Array.isArray(f)}function w2(f){let $=f.type;if(typeof $==="string")return[$];return Array.isArray($)?$.filter((w)=>typeof w==="string"):[]}function Jf(f,$){if(w2(f).includes($))return!0;for(let Y of["anyOf","oneOf","allOf"]){let q=f[Y];if(Array.isArray(q)&&q.some((K)=>Z0(K)&&Jf(K,$)))return!0}return!1}function Y2(f,$){if(typeof f!=="string")return f;let w=f.trim(),Y=Jf($,"array"),q=Jf($,"object");if((!Y||!w.startsWith("["))&&(!q||!w.startsWith("{")))return f;try{let K=JSON.parse(w);if(Array.isArray(K))return Y?K:f;if(Z0(K))return q?K:f;return f}catch{return f}}function Xf(f,$){let w=Y2(f,$);if(Array.isArray(w)){let H=$.items;if(!Z0(H))return w;let G=!1,j=w.map((k)=>{let F=Xf(k,H);return G||=F!==k,F});return G?j:w}if(!Z0(w))return w;let Y=$.properties;if(!Z0(Y))return w;let q=!1,K={...w};for(let[H,G]of Object.entries(Y)){if(!(H in w)||!Z0(G))continue;let j=Xf(w[H],G);if(j!==w[H])K[H]=j,q=!0}return q?K:w}function Z2(f){if(typeof globalThis.atob==="function")try{let $=globalThis.atob(f),w=Uint8Array.from($,(Y)=>Y.charCodeAt(0));return new TextDecoder().decode(w)}catch{return null}if(typeof Buffer<"u")try{return Buffer.from(f,"base64").toString("utf8")}catch{return null}return null}function q2(f){let $=f?.trim();if(!$)return null;try{let w=$.split(".");if(w.length!==3)return null;let Y=w[1];if(!Y)return null;let q=Y.replace(/-/g,"+").replace(/_/g,"/"),K=q.padEnd(q.length+(4-q.length%4)%4,"="),H=Z2(K);return H?JSON.parse(H):null}catch{return null}}function J2(f){return Object.fromEntries(Object.entries(f).filter(([,$])=>$!==void 0))}function E1(f){let $=f.replaceAll("\\","/"),w=$.lastIndexOf("/");return(w>=0?$.slice(w+1):$).toLowerCase()}function X2(f){return f==="win32"?"powershell":"/bin/bash"}function Hf(f){let $=E1(f);if(Kf(f)!==void 0)return"powershell";if($==="cmd"||$==="cmd.exe")return"cmd";if($==="wsl"||$==="wsl.exe")return"wsl";return"posix"}var K2=new Set(["-nologo","-noninteractive","-noprofile"]),H2="-noprofile";function G2(f,$){let w="";for(let Y=0;Y<f.length;Y++){let q=f[Y];if(q==="`"&&Y+1<f.length){let K=f[Y+1];if(K==="u"&&$==="core"&&f[Y+2]==="{"){let H=f.indexOf("}",Y+3),G=H>Y+3?f.slice(Y+3,H):"",j=Number.parseInt(G,16);if(G.length<=6&&/^[0-9a-fA-F]+$/.test(G)&&j<=1114111){w+=String.fromCodePoint(j),Y=H;continue}}switch(K){case"n":w+=`
13
- `;break;case"r":w+="\r";break;case"t":w+="\t";break;case"b":w+="\b";break;case"f":w+="\f";break;case"v":w+="\v";break;case"0":w+="\x00";break;case"a":w+="\x07";break;case"e":w+=$==="core"?"\x1B":"e";break;default:w+=K}Y++;continue}if(q==='"'&&f[Y+1]==='"'){w+='"',Y++;continue}w+=q}return w}function Q2(f){let $=f[0];if($!=="'"&&$!=='"')return;for(let w=1;w<f.length;w++){let Y=f[w];if($==='"'&&Y==="`"){w++;continue}if(Y===$){if(f[w+1]===$){w++;continue}if(f.slice(w+1).trim()!=="")return;return{quote:$,body:f.slice(1,w)}}}return}function Kf(f){let $=E1(f);if($==="powershell"||$==="powershell.exe")return"windows";if($==="pwsh"||$==="pwsh.exe")return"core";return}function R2(f,$){let w=Q2(f);if(!w)return;let Y=(w.quote==="'"?w.body.replaceAll("''","'"):G2(w.body,$)).trim();return Y.length>0?Y:void 0}function V2(f,$){let w=/^[ \t]*(?:&[ \t]+(?:"([^"$`]*)"|'((?:[^']|'')*)')|(?:&[ \t]+)?([^\s$`"';&|<>(){}#@,]+))[ \t]+([\S\s]*)$/.exec(f);if(!w)return;let Y=w[1]??w[2]?.replaceAll("''","'")??w[3],q=Kf($);if(!q||!Kf(Y))return;let K=w[4],H=!1;for(;;){let G=/^(-[^\s=]+)[ \t]*([\S\s]*)$/.exec(K);if(!G)return;let j=G[1].toLowerCase();if(j==="-command"){let k=H?R2(G[2],q):void 0;return k===void 0?void 0:{executable:Y,script:k}}if(!K2.has(j))return;if(j===H2)H=!0;K=G[2]}}function C1(f,$){switch(Hf(f)){case"powershell":{let w={executable:f,script:$};for(;;){let Y=V2(w.script,w.executable);if(!Y)break;w=Y}return{executable:w.executable,args:["-NoProfile","-NonInteractive","-Command","[Console]::InputEncoding=[Text.UTF8Encoding]::new();[Console]::OutputEncoding=[Text.UTF8Encoding]::new();$ErrorActionPreference='Stop';$c=[Console]::In.ReadToEnd();$c+=[Environment]::NewLine+'if(-not $?){exit 1}';& ([ScriptBlock]::Create($c))"],input:w.script}}case"cmd":return{executable:f,args:["/d","/s","/c",$]};case"wsl":return{executable:f,args:["bash","-c",$]};case"posix":return{executable:f,args:["-c",$]}}}function j2(f,$){if(Hf(f)==="powershell")return["-NoProfile","-NonInteractive","-Command",$];return C1(f,$).args}function k2(f){return f.toLowerCase().replace(/[^\w.-]+/g,"_")}function W2(f){let $=f?.trim();return $?$:void 0}function y1(f,$){if(f.length<=$)return f;return`${f.slice(0,$-1)}…`}function _2(f,$="/",w=100){if(!f||f.length<=w)return f||"";let Y=f.split($)?.shift()?.trim()?.slice(0,w-1);return Y?`${Y}…`:y1(f,w)}function F2(f){if(f.length<=8)return"****";return`${f.slice(0,4)}...${f.slice(-4)}`}function L2(f){return f.charCodeAt(0)===65279?f.slice(1):f}function U2(f){if(!f)return"(unknown-date)";let $=new Date(f);if(Number.isNaN($.getTime()))return f;return $.toLocaleString("en-US",{year:"numeric",month:"numeric",day:"numeric",hour:"numeric",minute:"numeric",second:"numeric",hour12:!0})}function D2(f){let $=Math.max(0,Math.floor(f/1000)),w=Math.floor($/86400),Y=Math.floor($%86400/3600),q=Math.floor($%3600/60),K=$%60;if(w>0)return`${w}d ${Y}h`;if(Y>0)return`${Y}h ${q}m`;if(q>0)return`${q}m ${K}s`;return`${K}s`}import{z as S1}from"zod";function P2(f,$){let w=f.safeParse($);if(!w.success)throw Error(S1.prettifyError(w.error));return w.data}function Gf(f){return S1.toJSONSchema(f)}function Qf(f){return f==="cline"||f==="cline-pass"}var g1=`You are Cline, an AI coding agent. Your primary goal is to assist users with various coding tasks by leveraging your knowledge and the tools at your disposal. Given the user's prompt, you should use the tools available to you to answer user's question.
11
+ ]`}function r(){let R=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,V=arguments.length>1&&arguments[1]!==void 0?arguments[1]:-1,I=f[$]==="\\";if(I){if($++,!Y0(f[$]))b0()}let v=f[$]==="&"?Zf(f.slice($,$+Yf)):null,i=N1(v)||b1(v);if(Y0(f[$])||i){let Af=$f(f[$])?$f:wf(f[$])?wf:O0(f[$])?O0:ff,V0=$,j0=w.length,P='"';$+=i&&v?v.length:1;while(!0){if($>=f.length){let A=Pf($-1);if(!R&&w0(f.charAt(A)))return $=V0,w=w.substring(0,j0),r(!0);return P=y(P,'"'),w+=P,!0}if($===V)return P=y(P,'"'),w+=P,!0;let h=i&&f[$]==="&"?Zf(f.slice($,$+Yf)):null;if(h&&v?h.char===v.char:Af(f[$])){let A=$,C0=P.length;if(P+='"',$+=h?h.length:1,w+=P,H(!1),R||$>=f.length||w0(f[$])&&!C1(P,f[$])||Y0(f[$])&&!U6($)||c(f[$]))return Df(),!0;if(f[$]==="\\")b0();let u=Pf(A-1),Nf=f.charAt(u);if(Nf===",")return $=V0,w=w.substring(0,j0),r(!1,u);if(w0(Nf))return $=V0,w=w.substring(0,j0),r(!0);w=w.substring(0,j0),$=A+(h?h.length:1),P=`${P.substring(0,C0)}\\${P.substring(C0)}`}else if(R&&a0(f[$])){if(f[$-1]===":"&&s0.test(f.substring(V0+1,$+2)))while($<f.length&&i0.test(f[$]))P+=f[$],$++;return P=y(P,'"'),w+=P,Df(),!0}else if(h){let A=h.char;if(A==='"')P+="\\\"";else if(e0(A))P+=M1[A];else P+=A;$+=h.length}else if(f[$]==="\\"){let A=f.charAt($+1);if(s$[A]!==void 0)P+=f.slice($,$+2),$+=2;else if(A==="u"){let u=2;while(u<6&&D1(f[$+u]))u++;if(u===6)P+=f.slice($,$+6),$+=6;else if($+u>=f.length)$=f.length;else O6()}else if(A===`
12
+ `)P+="\\n",$+=2;else P+=A,$+=2}else{let A=f.charAt($);if(A==='"'&&f[$-1]!=="\\")P+=`\\${A}`,$++;else if(e0(A))P+=M1[A],$++;else{if(!I1(A))D6(A);P+=A,$++}}if(I)b()}}return!1}function Df(){let R=!1;H();while(f[$]==="+"){R=!0,$++,H(),w=Z0(w,'"',!0);let V=w.length;if(r())w=B1(w,V,1);else w=y(w,'"')}return R}function B(){let R=$,V="",I=!1;if(f[$]==="-"){if(V+=f[$],$++,!c(f[$])&&Of())V+="0"}if(f[$]==="0"&&c(f[$+1]))I=!0;while(c(f[$]))V+=f[$],$++;if(f[$]==="."){if(V===""||V==="-")V+="0";if(V+=f[$],$++,!c(f[$]))V+="0";while(c(f[$]))V+=f[$],$++}if($>R){if(f[$]==="e"||f[$]==="E"){if(V==="-")I=!0;if(V+=f[$],$++,f[$]==="-"||f[$]==="+")V+=f[$],$++;if(!c(f[$]))V+="0";while(c(f[$]))V+=f[$],$++}if(!Of())return $=R,!1;return w+=I?`"${f.substring(R,$)}"`:V,!0}return!1}function F6(){return s("true","true")||s("false","false")||s("null","null")||s("True","true")||s("False","false")||s("None","null")}function s(R,V){if(f.slice($,$+R.length)===R&&!P0(f[$+R.length]))return w+=V,$+=R.length,!0;return!1}function If(R){let V=$;if(r0(f[$])){while($<f.length&&P0(f[$]))$++;let I=$;while(z(f,I))I++;if(f[I]==="("){if($=I+1,G(),f[$]===")"){if($++,f[$]===";")$++}return!0}}while($<f.length&&!a0(f[$])&&!Y0(f[$])&&(!R||f[$]!==":"))$++;if(f[$-1]===":"&&s0.test(f.substring(V,$+2)))while($<f.length&&i0.test(f[$]))$++;if($>V){while(z(f,$-1)&&$>0)$--;let I=f.slice(V,$);if(w+=I==="undefined"?"null":JSON.stringify(I),f[$]==='"')$++;return!0}}function L6(){if(f[$]==="/"){let R=$;$++;while($<f.length&&(f[$]!=="/"||f[$-1]==="\\"))$++;return $++,w+=JSON.stringify(f.substring(R,$)),!0}}function Pf(R){let V=R;while(V>0&&z(f,V))V--;return V}function U6(R){let V=R+1;while(V<f.length&&z(f,V))V++;return V>=f.length||w0(f[V])}function Of(){return $>=f.length||w0(f[$])||z(f,$)}function D6(R){throw new o(`Invalid character ${JSON.stringify(R)}`,$)}function b0(){throw new o(`Unexpected character ${JSON.stringify(f[$])}`,$)}function I6(){throw new o("Unexpected end of json string",f.length)}function P6(){throw new o("Object key expected",$)}function Bf(){throw new o("Colon expected",$)}function O6(){let R=f.slice($,$+6);throw new o(`Invalid unicode character "${R}"`,$)}}function i$(f,$){return f[$]==="*"&&f[$+1]==="/"}function a$(f){let $=!1,w=!1,Y=!1;for(let q=0;q<f.length;q+=1){let G=f[q];if(Y){Y=!1;continue}if(G==="\\"){Y=!0;continue}if(!w&&G==='"')$=!$;else if(!$&&G==="'")w=!w}return $||w}var t$=/^\{\s*"([A-Za-z0-9_.$-]+)"\s*:\s*([\s\S]+?)\s*\}$/;function e$(f){let $=f.match(t$);if(!$)return;let[,w,Y]=$,q=Y.trim();if(!q)return;let G=q[0];if(G==='"'||G==="{"||G==="["||q==="true"||q==="false"||q==="null"||Number.isFinite(Number(q)))return;return JSON.parse(`{"${w}":${JSON.stringify(q)}}`)}function f2(f){if(typeof f!=="string")return f;let $=f.trimStart();if($[0]!=="{"&&$[0]!=="[")return f;try{return JSON.parse($)}catch{}if(!a$($))try{return JSON.parse(qf($))}catch{}return e$($)??f}function $2(f){let $=new WeakSet;try{return JSON.stringify(f,(Y,q)=>{if(typeof q==="bigint")return q.toString();if(q&&typeof q==="object"){if($.has(q))return"[Circular]";$.add(q)}return q})??"null"}catch{return String(f)}}function w2(f){try{return JSON.parse(f)}catch{return}}function q0(f){return typeof f==="object"&&f!==null&&!Array.isArray(f)}function Y2(f){let $=f.type;if(typeof $==="string")return[$];return Array.isArray($)?$.filter((w)=>typeof w==="string"):[]}function Jf(f,$){if(Y2(f).includes($))return!0;for(let Y of["anyOf","oneOf","allOf"]){let q=f[Y];if(Array.isArray(q)&&q.some((G)=>q0(G)&&Jf(G,$)))return!0}return!1}function Z2(f,$){if(typeof f!=="string")return f;let w=f.trim(),Y=Jf($,"array"),q=Jf($,"object");if((!Y||!w.startsWith("["))&&(!q||!w.startsWith("{")))return f;try{let G=JSON.parse(w);if(Array.isArray(G))return Y?G:f;if(q0(G))return q?G:f;return f}catch{return f}}function Xf(f,$){let w=Z2(f,$);if(Array.isArray(w)){let H=$.items;if(!q0(H))return w;let K=!1,j=w.map((k)=>{let F=Xf(k,H);return K||=F!==k,F});return K?j:w}if(!q0(w))return w;let Y=$.properties;if(!q0(Y))return w;let q=!1,G={...w};for(let[H,K]of Object.entries(Y)){if(!(H in w)||!q0(K))continue;let j=Xf(w[H],K);if(j!==w[H])G[H]=j,q=!0}return q?G:w}function q2(f){if(typeof globalThis.atob==="function")try{let $=globalThis.atob(f),w=Uint8Array.from($,(Y)=>Y.charCodeAt(0));return new TextDecoder().decode(w)}catch{return null}if(typeof Buffer<"u")try{return Buffer.from(f,"base64").toString("utf8")}catch{return null}return null}function J2(f){let $=f?.trim();if(!$)return null;try{let w=$.split(".");if(w.length!==3)return null;let Y=w[1];if(!Y)return null;let q=Y.replace(/-/g,"+").replace(/_/g,"/"),G=q.padEnd(q.length+(4-q.length%4)%4,"="),H=q2(G);return H?JSON.parse(H):null}catch{return null}}function X2(f){return Object.fromEntries(Object.entries(f).filter(([,$])=>$!==void 0))}function T1(f){let $=f.replaceAll("\\","/"),w=$.lastIndexOf("/");return(w>=0?$.slice(w+1):$).toLowerCase()}function G2(f){return f==="win32"?"powershell":"/bin/bash"}function Hf(f){let $=T1(f);if(Gf(f)!==void 0)return"powershell";if($==="cmd"||$==="cmd.exe")return"cmd";if($==="wsl"||$==="wsl.exe")return"wsl";return"posix"}var H2=new Set(["-nologo","-noninteractive","-noprofile"]),K2="-noprofile";function Q2(f,$){let w="";for(let Y=0;Y<f.length;Y++){let q=f[Y];if(q==="`"&&Y+1<f.length){let G=f[Y+1];if(G==="u"&&$==="core"&&f[Y+2]==="{"){let H=f.indexOf("}",Y+3),K=H>Y+3?f.slice(Y+3,H):"",j=Number.parseInt(K,16);if(K.length<=6&&/^[0-9a-fA-F]+$/.test(K)&&j<=1114111){w+=String.fromCodePoint(j),Y=H;continue}}switch(G){case"n":w+=`
13
+ `;break;case"r":w+="\r";break;case"t":w+="\t";break;case"b":w+="\b";break;case"f":w+="\f";break;case"v":w+="\v";break;case"0":w+="\x00";break;case"a":w+="\x07";break;case"e":w+=$==="core"?"\x1B":"e";break;default:w+=G}Y++;continue}if(q==='"'&&f[Y+1]==='"'){w+='"',Y++;continue}w+=q}return w}function R2(f){let $=f[0];if($!=="'"&&$!=='"')return;for(let w=1;w<f.length;w++){let Y=f[w];if($==='"'&&Y==="`"){w++;continue}if(Y===$){if(f[w+1]===$){w++;continue}if(f.slice(w+1).trim()!=="")return;return{quote:$,body:f.slice(1,w)}}}return}function Gf(f){let $=T1(f);if($==="powershell"||$==="powershell.exe")return"windows";if($==="pwsh"||$==="pwsh.exe")return"core";return}function V2(f,$){let w=R2(f);if(!w)return;let Y=(w.quote==="'"?w.body.replaceAll("''","'"):Q2(w.body,$)).trim();return Y.length>0?Y:void 0}function j2(f,$){let w=/^[ \t]*(?:&[ \t]+(?:"([^"$`]*)"|'((?:[^']|'')*)')|(?:&[ \t]+)?([^\s$`"';&|<>(){}#@,]+))[ \t]+([\S\s]*)$/.exec(f);if(!w)return;let Y=w[1]??w[2]?.replaceAll("''","'")??w[3],q=Gf($);if(!q||!Gf(Y))return;let G=w[4],H=!1;for(;;){let K=/^(-[^\s=]+)[ \t]*([\S\s]*)$/.exec(G);if(!K)return;let j=K[1].toLowerCase();if(j==="-command"){let k=H?V2(K[2],q):void 0;return k===void 0?void 0:{executable:Y,script:k}}if(!H2.has(j))return;if(j===K2)H=!0;G=K[2]}}function y1(f,$){switch(Hf(f)){case"powershell":{let w={executable:f,script:$};for(;;){let Y=j2(w.script,w.executable);if(!Y)break;w=Y}return{executable:w.executable,args:["-NoProfile","-NonInteractive","-Command","[Console]::InputEncoding=[Text.UTF8Encoding]::new();[Console]::OutputEncoding=[Text.UTF8Encoding]::new();$ErrorActionPreference='Stop';$c=[Console]::In.ReadToEnd();$c+=[Environment]::NewLine+'if(-not $?){exit 1}';& ([ScriptBlock]::Create($c))"],input:w.script}}case"cmd":return{executable:f,args:["/d","/s","/c",$]};case"wsl":return{executable:f,args:["bash","-c",$]};case"posix":return{executable:f,args:["-c",$]}}}function k2(f,$){if(Hf(f)==="powershell")return["-NoProfile","-NonInteractive","-Command",$];return y1(f,$).args}function _2(f){return f.toLowerCase().replace(/[^\w.-]+/g,"_")}function W2(f){let $=f?.trim();return $?$:void 0}function E1(f,$){if(f.length<=$)return f;return`${f.slice(0,$-1)}…`}function F2(f,$="/",w=100){if(!f||f.length<=w)return f||"";let Y=f.split($)?.shift()?.trim()?.slice(0,w-1);return Y?`${Y}…`:E1(f,w)}function L2(f){if(f.length<=8)return"****";return`${f.slice(0,4)}...${f.slice(-4)}`}function U2(f){return f.charCodeAt(0)===65279?f.slice(1):f}function D2(f){if(!f)return"(unknown-date)";let $=new Date(f);if(Number.isNaN($.getTime()))return f;return $.toLocaleString("en-US",{year:"numeric",month:"numeric",day:"numeric",hour:"numeric",minute:"numeric",second:"numeric",hour12:!0})}function I2(f){let $=Math.max(0,Math.floor(f/1000)),w=Math.floor($/86400),Y=Math.floor($%86400/3600),q=Math.floor($%3600/60),G=$%60;if(w>0)return`${w}d ${Y}h`;if(Y>0)return`${Y}h ${q}m`;if(q>0)return`${q}m ${G}s`;return`${G}s`}import{z as S1}from"zod";function P2(f,$){let w=f.safeParse($);if(!w.success)throw Error(S1.prettifyError(w.error));return w.data}function Kf(f){return S1.toJSONSchema(f)}function Qf(f){return f==="cline"||f==="cline-pass"}var g1=`You are Cline, an AI coding agent. Your primary goal is to assist users with various coding tasks by leveraging your knowledge and the tools at your disposal. Given the user's prompt, you should use the tools available to you to answer user's question.
14
14
 
15
15
  Always gather all the necessary context before starting to work on a task. For example, if you are generating a unit test or new code, make sure you understand the requirement, the naming conventions, frameworks and libraries used and aligned in the current codebase, and the environment and commands used to run and test the code etc. Always validate the new unit test at the end including running the code if possible for live feedback.
16
16
  Review each question carefully and answer it with detailed, accurate information.
@@ -45,7 +45,7 @@ When you have completed the task, please provide a summary of what you did and a
45
45
 
46
46
  If user asked a simple question without any coding context, answer it directly without using any tools.
47
47
  {{CLINE_RULES}}
48
- {{CLINE_METADATA}}`;var v1=`You are Cline, a careful and helpful coding agent that works in the background.
48
+ {{CLINE_METADATA}}`;var n1=`You are Cline, a careful and helpful coding agent that works in the background.
49
49
  You are tasked to solve an issue reported by the user who you cannot communicate with directly.
50
50
  Your goal is to utilize the tools at your disposal to investigate and answer the question according to user's instructions with the aim to verify that the issue is resolved.
51
51
 
@@ -79,7 +79,7 @@ IMPORTANT:
79
79
  - When you call 'submit_and_exit', set 'verified' to true only if your tool output shows the requirements are met; otherwise set it to false.
80
80
  - Response without the submit_and_exit tool call will considered not completed and the task will continue.
81
81
  {{CLINE_RULES}}
82
- {{CLINE_METADATA}}`;var Rf={ACT:g1,YOLO:v1};var Vf="# Workspace Configuration",h1=`# Plan / Act Modes
82
+ {{CLINE_METADATA}}`;var Rf={ACT:g1,YOLO:n1};var Vf="# Workspace Configuration",h1=`# Plan / Act Modes
83
83
 
84
84
  User messages arrive wrapped in a <user_input mode="..."> tag. The mode attribute is the interaction mode the user was in when they sent that message: "plan" means plan-mode constraints applied (explore, analyze, and align on a plan -- no edits or state-changing commands), while "act" (or "yolo") means implementation was allowed. If the mode attribute changes between messages, the user switched modes -- the newest message's mode is what governs right now, regardless of what earlier messages allowed. A <mode_notice> block inside a message marks exactly when such a switch happened.`,x1=`# Plan Mode
85
85
 
@@ -96,10 +96,10 @@ The run_commands tool remains available in plan mode strictly for read-only insp
96
96
 
97
97
  Once the user has reviewed your plan and explicitly approved it in a follow-up message, use the switch_to_act_mode tool to switch to act mode and begin implementation. Calling switch_to_act_mode immediately starts execution, so never call it in the same turn you present a plan and never treat the original task request as approval -- end your turn after presenting the plan and wait for the user's response.`,c1=`${x1}
98
98
 
99
- Once you have presented your plan, end your turn and wait for the user's response. You do NOT have the ability to switch to act mode yourself -- the user must do it manually with the Plan/Act toggle once they are satisfied with the plan. If the task requires tools that are only available in act mode, ask the user to "toggle to Act mode" (use those words).`;function n1(f,$,w){if(w?.trim()?.includes(Vf))return w.trim();let Y=w||JSON.stringify({workspaces:{[f]:{hint:$||f.split("/").at(-1)||f}}},null,2);return`
99
+ Once you have presented your plan, end your turn and wait for the user's response. You do NOT have the ability to switch to act mode yourself -- the user must do it manually with the Plan/Act toggle once they are satisfied with the plan. If the task requires tools that are only available in act mode, ask the user to "toggle to Act mode" (use those words).`;function v1(f,$,w){if(w?.trim()?.includes(Vf))return w.trim();let Y=w||JSON.stringify({workspaces:{[f]:{hint:$||f.split("/").at(-1)||f}}},null,2);return`
100
100
  ${Vf}
101
- ${Y}`}function O2(f){let{ide:$="Terminal Shell",mode:w,platform:Y="unknown",workspaceName:q,metadata:K,rules:H,overridePrompt:G,providerId:j,planModeSwitchTool:k=!0}=f,F=f.workspaceRoot??f.rootPath??"",L=Qf(j||"");if(G?.trim()){let M=G.trim();if(L&&K?.trim()&&!M.includes(Vf))return`${M}
101
+ ${Y}`}function O2(f){let{ide:$="Terminal Shell",mode:w,platform:Y="unknown",workspaceName:q,metadata:G,rules:H,overridePrompt:K,providerId:j,planModeSwitchTool:k=!0}=f,F=f.workspaceRoot??f.rootPath??"",L=Qf(j||"");if(K?.trim()){let C=K.trim();if(L&&G?.trim()&&!C.includes(Vf))return`${C}
102
102
 
103
- ${n1(F,q,K)}`.trim();return M}let D=w==="yolo"?Rf.YOLO:Rf.ACT,b=[H,h1,w==="plan"?k?z1:c1:void 0].filter(Boolean).join(`
103
+ ${v1(F,q,G)}`.trim();return C}let D=w==="yolo"?Rf.YOLO:Rf.ACT,b=[H,h1,w==="plan"?k?z1:c1:void 0].filter(Boolean).join(`
104
104
 
105
- `);return D.replace("{{PLATFORM_NAME}}",Y).replace("{{CWD}}",F).replace("{{CURRENT_DATE}}",new Date().toLocaleDateString()).replace("{{IDE_NAME}}",$).replace("{{CLINE_METADATA}}",L?n1(F,q,K):"").replace("{{CLINE_RULES}}",b).trim()}var B2="anthropic/claude-sonnet-5";var I2="remote://";import{z as X}from"zod";var u1=X.object({id:X.string(),temperature:X.number().optional(),maxTokens:X.number().optional(),contextWindow:X.number().optional(),inputPrice:X.number().optional(),outputPrice:X.number().optional(),supportsImages:X.boolean().optional()}),o1=X.object({models:X.array(u1).optional(),openAiBaseUrl:X.string().optional(),openAiHeaders:X.record(X.string(),X.string()).optional(),azureApiVersion:X.string().optional(),azureIdentity:X.boolean().optional()}),l1=X.object({id:X.string(),thinkingBudgetTokens:X.number().optional()}),m1=X.object({name:X.string(),baseModelId:X.string(),thinkingBudgetTokens:X.number().optional()}),p1=X.object({models:X.array(l1).optional(),customModels:X.array(m1).optional(),awsRegion:X.string().optional(),awsUseCrossRegionInference:X.boolean().optional(),awsUseGlobalInference:X.boolean().optional(),awsBedrockUsePromptCache:X.boolean().optional(),awsBedrockEndpoint:X.string().optional()}),d1=X.object({id:X.string()}),r1=X.object({models:X.array(d1).optional()}),s1=X.object({id:X.string(),thinkingBudgetTokens:X.number().optional()}),i1=X.object({models:X.array(s1).optional(),vertexProjectId:X.string().optional(),vertexRegion:X.string().optional()}),a1=X.object({id:X.string(),thinkingBudgetTokens:X.number().optional(),promptCachingEnabled:X.boolean().optional()}),t1=X.object({models:X.array(a1).optional(),baseUrl:X.string().optional()}),e1=X.object({id:X.string(),thinkingBudgetTokens:X.number().optional()}),f6=X.object({models:X.array(e1).optional(),baseUrl:X.string().optional()}),A2=X.object({OpenAiCompatible:o1.optional(),AwsBedrock:p1.optional(),Cline:r1.optional(),Vertex:i1.optional(),LiteLLM:t1.optional(),Anthropic:f6.optional()}),$6=X.object({id:X.string()}),w6=X.object({name:X.string(),url:X.string(),alwaysEnabled:X.boolean().optional(),headers:X.record(X.string(),X.string()).optional()}),jf=X.object({alwaysEnabled:X.boolean(),name:X.string(),contents:X.string()}),I0=X.object({bucket:X.string(),accessKeyId:X.string(),secretAccessKey:X.string(),region:X.string().optional(),endpoint:X.string().optional(),accountId:X.string().optional()}),Y6=X.object({enabled:X.boolean().optional(),type:X.union([X.literal("s3_access_keys"),X.literal("r2_access_keys"),X.literal("azure_access_keys")]).optional(),s3AccessSettings:I0.optional(),r2AccessSettings:I0.optional(),azureAccessSettings:I0.optional()}),Z6=X.object({promptUploading:Y6.optional()}),N2=X.object({version:X.string(),providerSettings:A2.optional(),telemetryEnabled:X.boolean().optional(),kanbanEnabled:X.boolean().optional(),mcpMarketplaceEnabled:X.boolean().optional(),allowedMCPServers:X.array($6).optional(),remoteMCPServers:X.array(w6).optional(),blockPersonalRemoteMCPServers:X.boolean().optional(),yoloModeAllowed:X.boolean().optional(),openTelemetryEnabled:X.boolean().optional(),openTelemetryMetricsExporter:X.string().optional(),openTelemetryLogsExporter:X.string().optional(),openTelemetryOtlpProtocol:X.string().optional(),openTelemetryOtlpEndpoint:X.string().optional(),openTelemetryOtlpHeaders:X.record(X.string(),X.string()).optional(),openTelemetryOtlpMetricsProtocol:X.string().optional(),openTelemetryOtlpMetricsEndpoint:X.string().optional(),openTelemetryOtlpMetricsHeaders:X.record(X.string(),X.string()).optional(),openTelemetryOtlpLogsProtocol:X.string().optional(),openTelemetryOtlpLogsEndpoint:X.string().optional(),openTelemetryOtlpLogsHeaders:X.record(X.string(),X.string()).optional(),openTelemetryMetricExportInterval:X.number().optional(),openTelemetryOtlpInsecure:X.boolean().optional(),openTelemetryLogBatchSize:X.number().optional(),openTelemetryLogBatchTimeout:X.number().optional(),openTelemetryLogMaxQueueSize:X.number().optional(),enterpriseTelemetry:Z6.optional(),globalRules:X.array(jf).optional(),globalWorkflows:X.array(jf).optional()}),b2=X.record(X.string(),X.string());var M2=4317;var T2="127.0.0.1:4317";import kf from"zod";var E2=kf.enum(["reasoning","prompt-cache","tools","provider-tools","oauth","temperature","files","streaming","vision","computer-use","local-auth","popular"]),C2=kf.enum(["anthropic","gemini","openai-chat","openai-responses","openai-r1","ai-sdk"]),y2=kf.enum(["anthropic","ai-sdk","ai-sdk-community","openai","openai-compatible","openai-r1","gemini","bedrock","custom","fetch","vertex"]);var S2="runtime.team.progress.v1",g2="runtime.team.lifecycle.v1";var v2="CLINE_ENVIRONMENT",n2="CLINE_ENVIRONMENT_OVERRIDE",Wf={production:{environment:"production",appBaseUrl:"https://app.cline.bot",apiBaseUrl:"https://api.cline.bot",mcpBaseUrl:"https://api.cline.bot/v1/mcp",workOsClientId:"client_01K3A541FN8TA3EPPHTD2325AR"},staging:{environment:"staging",appBaseUrl:"https://staging-app.cline.bot",apiBaseUrl:"https://core-api.staging.int.cline.bot",mcpBaseUrl:"https://core-api.staging.int.cline.bot/v1/mcp",workOsClientId:"client_01K3A5415VF6QBQBG3XYCW91G6"},local:{environment:"local",appBaseUrl:"http://localhost:3000",apiBaseUrl:"http://localhost:7777",mcpBaseUrl:"http://localhost:7777/v1/mcp",workOsClientId:"client_01K6XQAY7JK6T5HXVSZW2S5VYK"}},h2="production";function q6(f){let $=f?.trim().toLowerCase();if($==="production"||$==="staging"||$==="local")return $;return}function J6(){if(typeof process>"u"||!process?.env)return{};return process.env}function X6(){let f=J6();return q6(f.CLINE_ENVIRONMENT_OVERRIDE)??q6(f.CLINE_ENVIRONMENT)??"production"}function x2(f){if(typeof f==="string")return Wf[f];return Wf[X6()]}function z2(f,$){if($.CLINE_API_BASE_URL)f={...f,apiBaseUrl:$.CLINE_API_BASE_URL,mcpBaseUrl:`${$.CLINE_API_BASE_URL}/v1/mcp`};return f}function c2(f){let $=x2(f);return z2($,J6())}var u2="agent.reasoning.unexpected_tokens",o2="task.provider_request_started",l2="task.provider_stream_started",m2="task.first_chunk_received",p2="task.provider_stream_failed",d2="task.cancelled",r2="sdk.error";var p=new Map;function s2(){p.clear()}function i2(f,$){let w=typeof $.error_message==="string"?$.error_message:"";return[f,$.component,$.operation,$.error_type,$.error_code??"",$.error_status??"",w.replace(/\d+/g,"#").replace(/\s+/g," ").trim().toLowerCase().slice(0,256)].join("\x00")}function a2(f){let $=Date.now(),w=p.get(f);if(w&&$-w.startMs<3600000){if(w.emitted<5)return w.emitted+=1,{emit:!0,suppressed:0};return w.suppressed+=1,{emit:!1,suppressed:w.suppressed}}let Y=w?.suppressed??0;if(p.delete(f),p.size>=512){let q=p.keys().next();if(!q.done)p.delete(q.value)}return p.set(f,{startMs:$,emitted:1,suppressed:0}),{emit:!0,suppressed:Y}}function t2(f,$){f?.capture({event:"agent.reasoning.unexpected_tokens",properties:Ff({sessionId:$.sessionId,agentId:$.agentId,runId:$.runId,iteration:$.iteration,providerId:$.providerId,modelId:$.modelId,requestedThinking:$.requestedThinking,reasoningTokenCount:$.reasoningTokenCount})})}function e2(f,$){if(!f)return;f.capture({event:$.event,properties:Ff({sessionId:$.sessionId,ulid:$.ulid??$.sessionId,agentId:$.agentId,conversationId:$.conversationId,runId:$.runId,iteration:$.iteration,provider:$.providerId,providerId:$.providerId,model:$.modelId,modelId:$.modelId,phase:$.phase,durationMs:$.durationMs,eventType:$.eventType,...$.error===void 0?{}:Lf($.error,$.messageLimit),error_class:$.errorClass})})}function f4(f,$){if(!f)return!1;let w=$.event??"sdk.error",Y=K6($),q=0;try{let K=a2(i2(w,Y));if(!K.emit)return!0;q=K.suppressed}catch{}return f.capture({event:w,properties:q>0?{...Y,suppressed_count:q}:Y}),!0}function K6(f){return Ff({...f.context??{},component:f.component,operation:f.operation,severity:f.severity??"error",handled:f.handled??!0,...Lf(f.error,f.messageLimit,f.errorMessage)})}function Ff(f){let $={};for(let[w,Y]of Object.entries(f))if(Y!==void 0)$[w]=Y;return $}function Lf(f,$=500,w){let Y=Y4(f)?f:void 0,q=f instanceof Error?f:void 0,K=R0(w)??R0(q?.message)??R0(Y?.message)??Z4(f)??"Unknown error",H=q4(Y?.code),G=_f(Y?.status)??_f(Y?.statusCode)??_f(Y?.responseStatus);return{error_type:q?.name?.trim()||R0(Y?.name)||q?.constructor?.name||"Error",error_message:w4($4(K),$),...H!==void 0?{error_code:H}:{},...G!==void 0?{error_status:G}:{}}}function $4(f){return f.replace(/(authorization=Bearer\s+)[^&\s]+/gi,"$1[redacted]").replace(/(api[_-]?key|access[_-]?token|refresh[_-]?token|authorization|password|secret)=([^&\s]+)/gi,"$1=[redacted]").replace(/(Bearer\s+)[A-Za-z0-9._~+/-]+=*/gi,"$1[redacted]").replace(/\/Users\/[^/\s]+/g,"/Users/[redacted]").replace(/\/home\/[^/\s]+/g,"/home/[redacted]").replace(/([A-Za-z]:[\\/]+Users[\\/]+)[^\\/\s]+/g,"$1[redacted]")}function w4(f,$){let w=Math.max(1,Math.floor($));return f.length>w?f.substring(0,w):f}function Y4(f){return typeof f==="object"&&f!==null}function R0(f){return typeof f==="string"&&f.trim().length>0?f:void 0}function Z4(f){if(f instanceof Error)return;let $=typeof f==="string"?f:String(f);return $==="[object Object]"?void 0:R0($)}function q4(f){if(typeof f==="string"&&f.trim().length>0)return f;if(typeof f==="number"&&Number.isFinite(f))return f;return}function _f(f){return typeof f==="number"&&Number.isFinite(f)?f:void 0}function H6(f){let $={};if(!f)return $;return f.split(",").forEach((w)=>{let Y=w.indexOf("=");if(Y<=0)return;try{let q=decodeURIComponent(w.substring(0,Y).trim()),K=decodeURIComponent(w.substring(Y+1).trim());if(!q||!K)return;$[q]=K}catch{}}),$}function J4(){if(!process.env)return{enabled:!1};return{enabled:process.env.OTEL_TELEMETRY_ENABLED==="1"||process.env.OTEL_TELEMETRY_ENABLED==="true",metricsExporter:process.env.OTEL_METRICS_EXPORTER||"otlp",logsExporter:process.env.OTEL_LOGS_EXPORTER||"otlp",tracesExporter:process.env.OTEL_TRACES_EXPORTER,otlpProtocol:process.env.OTEL_EXPORTER_OTLP_PROTOCOL||"http/json",otlpEndpoint:process.env.OTEL_EXPORTER_OTLP_ENDPOINT,metricExportInterval:process.env.OTEL_METRIC_EXPORT_INTERVAL?Number.parseInt(process.env.OTEL_METRIC_EXPORT_INTERVAL,10):void 0,otlpHeaders:process.env.OTEL_EXPORTER_OTLP_HEADERS?H6(process.env.OTEL_EXPORTER_OTLP_HEADERS):void 0}}function G6(f={}){return{extension_version:"unknown",cline_type:"unknown",platform:"terminal",platform_version:process?.version||"unknown",os_type:process?.platform||"unknown",os_version:process?.platform==="win32"?process?.env?.OS??"unknown":"unknown",...f}}function X4(f={}){return{...J4(),...f,metadata:G6(f.metadata)}}function Q6(f){let $=f?.trim();return $?$:void 0}function K4(f,$){if(!f)return;let w=typeof f==="function"?f($):f;if(!w)return;let Y=Q6(w.rootSessionId);if(!Y)return;return{rootSessionId:Y}}function H4(f){return Q6(f?.rootSessionId)}var G4=(f)=>crypto.getRandomValues(new Uint8Array(f)),Q4=(f,$,w)=>{let Y=256-256%f.length;if(Y===256){let K=f.length-1;return(H=$)=>{if(!H)return"";let G="";while(!0){let j=w(H),k=H;while(k--)if(G+=f[j[k]&K],G.length>=H)return G}}}let q=Math.ceil(409.6*$/Y);return(K=$)=>{if(!K)return"";let H="";while(!0){let G=w(q),j=q;while(j--)if(G[j]<Y){if(H+=f[G[j]%f.length],H.length>=K)return H}}}},R6=(f,$=21)=>Q4(f,$|0,G4);function R4(f="",$=""){let w=R6("1234567890abcdefghijklmnopqrstuvwxyz",10);return`${f}${Date.now()}_${w(5)}${$}`}var V4=["idle","running","pending","completed","failed","cancelled"];var Uf=["rules","skills","workflows","plugins","hooks"],V6=Uf,j4=new Set(Uf);function j6(f){return typeof f==="string"&&j4.has(f)}function k4(f){if(!Array.isArray(f))return;let $=f.map((w)=>typeof w==="string"?w.trim():"").filter(j6);return[...new Set($)]}function W4(f,$){return new Set(f??V6).has($)}import{z as y}from"zod";var _4=y.object({rootPath:y.string().min(1),hint:y.string().min(1).optional(),associatedRemoteUrls:y.array(y.string().min(1)).optional(),latestGitCommitHash:y.string().min(1).optional(),latestGitBranchName:y.string().min(1).optional()}),F4=y.object({currentWorkspacePath:y.string().min(1).optional(),workspaces:y.record(y.string().min(1),_4)});function c8(){return{workspaces:{}}}function u8(f,$){let w={...f,workspaces:{...f.workspaces,[$.rootPath]:$}};if(!w.currentWorkspacePath)w.currentWorkspacePath=$.rootPath;return F4.parse(w)}var L4="workspaces",U4="chat";function D4(f){let $=f.trim(),w=/^[A-Za-z]:[\\/]/.test($)||$.startsWith("\\\\"),Y=$.startsWith("/");if(!w&&!Y)return!1;let q=$.split(w?/[\\/]+/:/\/+/).filter(Boolean),K=q.at(-1)??"",H=q.at(-2)??"",G=q.at(-3)??"";return(q.at(-4)??"")===".cline"&&G==="data"&&H==="workspaces"&&K==="chat"}import{z as Z}from"zod";var P4=["current_state","boundary_analysis","interface_proposal"],p8=3600000,d8=240,r8=400,S=Z.preprocess((f)=>f instanceof Date?f.toISOString():f,Z.string().datetime()),q0=Z.enum(["pending","in_progress","blocked","completed"]),k6=Z.enum(["queued","running","completed","failed","cancelled","interrupted"]),A0=Z.enum(["draft","in_review","finalized"]),O4=Z.object({agentId:Z.string(),role:Z.enum(["lead","teammate"]),description:Z.string().optional(),status:Z.enum(["idle","running","stopped"])}),s8=Z.object({agentId:Z.string(),rolePrompt:Z.string(),modelId:Z.string().optional(),maxIterations:Z.number().optional()});function B(f){return Z.preprocess(($)=>$===null?void 0:$,f.optional())}var i8=Z.object({agentId:Z.string().min(1).describe("Teammate identifier"),rolePrompt:Z.string().min(1).describe("System prompt describing teammate role")}).strict(),a8=Z.object({agentId:Z.string().min(1).describe("Teammate identifier"),reason:B(Z.string().min(1)).describe("Optional shutdown reason")}),t8=Z.object({}),B4={create:["title","description"],list:[],claim:["taskId"],complete:["taskId","summary"],block:["taskId","reason"]},e8={create:["status","taskId","summary","reason"]},fw=Z.object({action:Z.enum(["create","list","claim","complete","block"]),title:B(Z.string().min(1)).describe("Task title"),description:B(Z.string().min(1)).describe("Task details"),dependsOn:B(Z.array(Z.string().describe("Dependency task ID"))).describe("Array of dependency task IDs"),assignee:B(Z.string().min(1)).describe("Optional assignee"),status:B(Z.enum(["pending","in_progress","blocked","completed"])).describe("Optional task status filter"),taskId:B(Z.string()).describe("Task ID"),summary:B(Z.string().min(1)).describe("Completion summary"),reason:B(Z.string().min(1)).describe("Blocking reason")}).superRefine((f,$)=>{for(let w of B4[f.action]){if(f[w]!==void 0)continue;$.addIssue({code:"custom",path:[w],message:`Field "${w}" is required when action=${f.action}`})}}),$w=Z.object({agentId:Z.string().describe("Teammate agent ID"),task:Z.string().min(1).describe("Task instructions for the teammate"),taskId:B(Z.string()).describe("Optional shared task list ID"),runMode:B(Z.enum(["sync","async"])).describe("Execution mode: 'sync' blocks until the teammate finishes and returns the result (default if omitted); 'async' queues the run and returns a runId immediately — use team_await_runs to collect results later."),continueConversation:B(Z.boolean()).describe("If true, continue the teammate conversation; otherwise start fresh")}),ww=Z.object({status:B(Z.enum(["queued","running","completed","failed","cancelled","interrupted"])).describe("Optional run status filter. Omit to include all statuses."),agentId:B(Z.string().min(1)).describe("Optional teammate ID filter. Omit to include all teammates."),includeCompleted:B(Z.boolean()).describe("Include completed/failed runs (default true)")}),Yw=Z.object({runId:Z.string().min(1).describe("Run ID"),reason:B(Z.string().min(1)).describe("Optional cancellation reason")}),Zw=Z.object({runId:B(Z.string().min(1)).describe("Optional async run ID to await. Omit to wait for all active async runs.")}).strict(),qw=Z.object({toAgentId:Z.string().min(1).describe("Recipient agent ID"),subject:Z.string().min(1).describe("Message subject"),body:Z.string().min(1).describe("Message body"),taskId:B(Z.string().min(1)).describe("Optional task ID context")}),Jw=Z.object({subject:Z.string().min(1).describe("Message subject"),body:Z.string().min(1).describe("Message body"),taskId:B(Z.string().min(1)).describe("Optional task ID context")}),Xw=Z.object({unreadOnly:B(Z.boolean()).describe("Only unread messages for read action (default true)")}),Kw=Z.object({kind:Z.enum(["progress","handoff","blocked","decision","done","error"]),summary:Z.string().min(1).describe("Update summary"),taskId:B(Z.string().min(1)).describe("Optional task ID context"),evidence:B(Z.array(Z.string().min(1))).describe("Optional evidence links/snippets"),nextAction:B(Z.string().min(1)).describe("Planned next step")}),Hw=Z.object({}),Gw=Z.object({title:Z.string().describe("Outcome title"),requiredSections:Z.array(Z.string()).default(P4).describe("Required sections for finalization gate (defaults to current_state,boundary_analysis,interface_proposal)")}),Qw=Z.object({outcomeId:Z.string().describe("Outcome ID"),section:Z.string().describe("Section name"),sourceRunId:B(Z.string()).describe("Optional source run ID"),content:Z.string().describe("Section fragment content")}),Rw=Z.object({fragmentId:Z.string().describe("Fragment ID"),approved:Z.boolean().describe("Review decision")}),Vw=Z.object({outcomeId:Z.string().describe("Outcome ID")}),jw=Z.object({}),kw=Z.object({teamId:Z.string(),teamName:Z.string(),members:Z.array(O4),taskCounts:Z.record(q0,Z.number()),unreadMessages:Z.number(),missionLogEntries:Z.number(),activeRuns:Z.number(),queuedRuns:Z.number(),outcomeCounts:Z.record(A0,Z.number())}),I4=Z.object({id:Z.string(),title:Z.string(),description:Z.string(),status:q0,createdAt:S,updatedAt:S,createdBy:Z.string(),assignee:Z.string().optional(),dependsOn:Z.array(Z.string()),summary:Z.string().optional(),isReady:Z.boolean(),blockedBy:Z.array(Z.string())}),Ww=Z.discriminatedUnion("action",[Z.object({action:Z.literal("create"),taskId:Z.string(),status:q0,ignoredFields:Z.array(Z.string()).optional(),note:Z.string().optional()}),Z.object({action:Z.literal("list"),tasks:Z.array(I4)}),Z.object({action:Z.literal("claim"),taskId:Z.string(),status:q0,nextStep:Z.string()}),Z.object({action:Z.literal("complete"),taskId:Z.string(),status:q0}),Z.object({action:Z.literal("block"),taskId:Z.string(),status:q0})]),_w=Z.object({agentId:Z.string(),mode:Z.enum(["sync","async"]),status:Z.enum(["dispatched","running","queued","joined"]),dispatched:Z.boolean(),message:Z.string(),deduped:Z.boolean().optional(),runId:Z.string().optional(),text:Z.string().optional(),iterations:Z.number().optional()}),A4=Z.object({textPreview:Z.string(),iterations:Z.number(),finishReason:Z.string(),durationMs:Z.number(),usage:Z.object({inputTokens:Z.number(),outputTokens:Z.number(),cacheReadTokens:Z.number().optional(),cacheWriteTokens:Z.number().optional(),totalCost:Z.number().optional()})}),Fw=Z.object({id:Z.string(),agentId:Z.string(),taskId:Z.string().optional(),status:k6,messagePreview:Z.string(),priority:Z.number(),retryCount:Z.number(),maxRetries:Z.number(),nextAttemptAt:S.optional(),continueConversation:Z.boolean().optional(),startedAt:S,endedAt:S.optional(),leaseOwner:Z.string().optional(),heartbeatAt:S.optional(),lastProgressAt:S.optional(),lastProgressMessage:Z.string().optional(),currentActivity:Z.string().optional(),error:Z.string().optional(),resultSummary:A4.optional()}),Lw=Z.object({id:Z.string(),teamId:Z.string(),fromAgentId:Z.string(),toAgentId:Z.string(),subject:Z.string(),body:Z.string(),taskId:Z.string().optional(),sentAt:S,readAt:S.optional()}),Uw=Z.object({id:Z.string(),teamId:Z.string(),title:Z.string(),status:A0,requiredSections:Z.array(Z.string()),createdBy:Z.string(),createdAt:S,finalizedAt:S.optional()}),Dw=Z.object({outcomeId:Z.string(),status:A0,requiredSections:Z.array(Z.string())}),Pw=Z.object({agentId:Z.string(),status:Z.string()}),Ow=Z.object({runId:Z.string(),status:k6}),Bw=Z.object({id:Z.string(),toAgentId:Z.string()}),Iw=Z.object({delivered:Z.number()}),Aw=Z.object({id:Z.string()}),Nw=Z.object({status:Z.string()}),bw=Z.object({fragmentId:Z.string(),status:Z.string()}),Mw=Z.object({outcomeId:Z.string(),status:A0});var N4;((I)=>{I.TaskStart="task_start";I.TaskEnd="task_end";I.AgentEvent="agent_event";I.TeammateSpawned="teammate_spawned";I.TeammateShutdown="teammate_shutdown";I.TeamTaskUpdated="team_task_updated";I.TeamMessage="team_message";I.TeamMissionLog="team_mission_log";I.TeamTaskCompleted="team_task_completed";I.RunStarted="run_started";I.RunQueued="run_queued";I.RunProgress="run_progress";I.RunCompleted="run_completed";I.RunFailed="run_failed";I.RunCancelled="run_cancelled";I.RunInterrupted="run_interrupted";I.OutcomeCreated="outcome_created";I.OutcomeFragmentAttached="outcome_fragment_attached";I.OutcomeFragmentReviewed="outcome_fragment_reviewed";I.OutcomeFinalized="outcome_finalized"})(N4||={});import{z as b4}from"zod";function M4(f){let{$schema:$,...w}=f;if(typeof w.type==="string")return w;if("properties"in w||"required"in w||"additionalProperties"in w)return{type:"object",...w};for(let Y of["oneOf","anyOf","allOf"]){let q=w[Y];if(!Array.isArray(q)||q.length===0)continue;if(Y==="allOf"){if(q.some((G)=>G&&typeof G==="object"&&G.type==="object"))return{type:"object",...w};throw Error('Tool inputSchema must describe an object at the top level, but the schema has a top-level "allOf" with no branch that asserts type: "object". Add type: "object" to at least one allOf branch to make the object constraint explicit.')}if(q.every((H)=>H&&typeof H==="object"&&H.type==="object"))return{type:"object",...w};throw Error(`Tool inputSchema must describe an object at the top level, but the schema has a top-level "${Y}" whose branches include non-object types. Pass the strict object schema as inputSchema and reserve union/coercion schemas for use inside execute().`)}return w}function T4(f){let $=M4(f.inputSchema instanceof b4.ZodType?Gf(f.inputSchema):f.inputSchema);return{name:f.name,description:f.description,inputSchema:$,lifecycle:f.lifecycle,timeoutMs:f.timeoutMs??30000,retryable:f.retryable??!0,maxRetries:f.maxRetries??3,execute:f.execute}}var W6=["401","403","unauthorized","forbidden","invalid token","expired token","authentication"];function E4(f){let $=(f instanceof Error?f.message:String(f)).toLowerCase();return W6.some((w)=>$.includes(w))}export{Gf as zodToJsonSchema,Z1 as xmlTagsRemoval,P2 as validateWithZod,R1 as validateImageMedia,K0 as validateAndReserveImageMedia,I$ as validateAndReserveBase64Media,b6 as usesImageGenerationOperation,u8 as upsertWorkspaceInfo,y1 as truncateStr,_2 as truncateSplit,W2 as trimNonEmpty,_1 as toAiSdkToolResultOutput,gf as supportsChatModalities,L2 as stripUtf8Bom,f1 as stripModeNotices,h6 as shouldIncludeConnectorField,h$ as serializeAbortReason,E as sanitizeSurrogates,k2 as sanitizeFileName,f2 as safeJsonStringify,$2 as safeJsonParse,H4 as resolveRootSessionId,L1 as resolveReasoningEffortRatio,n$ as resolveReasoningBudgetFromRatio,c0 as resolveMediaBudget,l3 as resolveMcpTimeoutSeconds,j3 as resolveHubCommandTimeoutMs,K4 as resolveHookSessionContext,v$ as resolveEffectiveReasoningEffort,X6 as resolveClineEnvironment,s2 as resetSdkErrorRateLimiterForTests,X0 as reserveImageMediaBytes,R3 as readHubScheduleMode,tf as parseUserCommandEnvelope,k4 as parseRuntimeConfigExtensions,e$ as parseJsonStream,q$ as parseHookEventPayload,J2 as omitUndefinedValues,ef as normalizeUserInput,Lf as normalizeSdkError,df as normalizePluginManifest,Xf as normalizeJsonLikeStringsForSchema,c$ as noopBasicLogger,M6 as modelSupportsToolCalling,T6 as modelSupportsImageInput,N6 as modelProducesImages,y0 as modelHasCapability,S$ as mergeModelOptions,F2 as maskSecret,uf as listConnectorCatalog,j6 as isRuntimeConfigExtensionKind,u$ as isMcpTimeoutConfigured,E4 as isLikelyAuthError,k3 as isHubToolExecutorName,J$ as isHubScheduleMode,K3 as isHubProtocolCompatible,U$ as isGeneratedMedia,Qf as isClineProvider,D4 as isChatWorkspacePath,A6 as isChatCompatibleModel,B$ as isCanonicalBase64,G1 as isBase64Char,O$ as imageFileMaxDecodedBytesForBase64Limit,z0 as imageBase64LengthForDecodedBytes,P$ as imageBase64EncodedByteLength,x0 as imageBase64DecodedByteLength,W4 as hasRuntimeConfigExtension,Hf as getShellKind,C1 as getShellInvocation,j2 as getShellArgs,l$ as getErrorMessage,m$ as getErrorCode,X2 as getDefaultShell,K$ as getDefaultHubCommandTimeoutMs,c2 as getClineEnvironmentConfig,D$ as generatedMediaModalityFromMediaType,Q$ as formatUserInputBlock,R$ as formatUserCommandBlock,D2 as formatUptime,F$ as formatSessionSearchTitle,L$ as formatSessionSearchPreview,V$ as formatModeSwitchNotice,y$ as formatMessagesForAiSdk,m3 as formatMcpTimeoutErrorMessage,U2 as formatHumanReadableDate,v0 as formatFileContentBlock,n0 as formatDisplayUserInput,U1 as estimateTokens,z$ as estimateRequestInputTokens,c8 as emptyWorkspaceManifest,O3 as describeOutdatedHubSessions,q2 as decodeJwtPayload,T4 as createTool,R4 as createSessionId,j$ as createModeSwitchNoticeTracker,D0 as createMediaBudgetState,d6 as createContributionRegistry,G6 as createClineTelemetryServiceMetadata,X4 as createClineTelemetryServiceConfig,x6 as connectorChannelsFromPlatforms,o$ as clampMcpTimeoutSeconds,e2 as captureTaskLifecycleEvent,f4 as captureSdkError,t2 as captureAgentUnexpectedReasoningTokens,K6 as buildSdkErrorProperties,O2 as buildClineSystemPrompt,F4 as WorkspaceManifestSchema,_4 as WorkspaceInfoSchema,i1 as VertexSettingsSchema,s1 as VertexModelSchema,E6 as USER_REJECTED_TOOL_REASON,E3 as USAGE_COST_DISPLAYS,S0 as ToolCallRecordSchema,Cf as ThinkingConfigSchema,s8 as TeamTeammateSpecSchema,Ww as TeamTaskToolResultSchema,I4 as TeamTaskListItemToolResultSchema,fw as TeamTaskInputSchema,kw as TeamStatusToolResultSchema,t8 as TeamStatusInputSchema,i8 as TeamSpawnTeammateInputSchema,Pw as TeamSimpleAgentStatusToolResultSchema,a8 as TeamShutdownTeammateInputSchema,Bw as TeamSendMessageToolResultSchema,qw as TeamSendMessageInputSchema,Fw as TeamRunToolSummarySchema,_w as TeamRunTaskToolResultSchema,$w as TeamRunTaskInputSchema,A4 as TeamRunResultSummarySchema,Rw as TeamReviewOutcomeFragmentInputSchema,Xw as TeamReadMailboxInputSchema,Uw as TeamOutcomeToolResultSchema,bw as TeamOutcomeFragmentToolResultSchema,Aw as TeamMissionLogToolResultSchema,Kw as TeamMissionLogInputSchema,N4 as TeamMessageType,Lw as TeamMailboxMessageToolResultSchema,ww as TeamListRunsInputSchema,jw as TeamListOutcomesInputSchema,Mw as TeamFinalizeOutcomeToolResultSchema,Vw as TeamFinalizeOutcomeInputSchema,Dw as TeamCreateOutcomeToolResultSchema,Gw as TeamCreateOutcomeInputSchema,Nw as TeamCleanupToolResultSchema,Hw as TeamCleanupInputSchema,Ow as TeamCancelRunToolResultSchema,Yw as TeamCancelRunInputSchema,Iw as TeamBroadcastToolResultSchema,Jw as TeamBroadcastInputSchema,Zw as TeamAwaitRunsInputSchema,Qw as TeamAttachOutcomeFragmentInputSchema,C6 as TOOL_REJECTION_SUFFIX,e8 as TEAM_TASK_IGNORED_FIELDS_BY_ACTION,r8 as TEAM_RUN_TEXT_PREVIEW_LIMIT,d8 as TEAM_RUN_MESSAGE_PREVIEW_LIMIT,S2 as TEAM_PROGRESS_EVENT_TYPE,g2 as TEAM_LIFECYCLE_EVENT_TYPE,p8 as TEAM_AWAIT_TIMEOUT_MS,l2 as TASK_PROVIDER_STREAM_STARTED_EVENT,p2 as TASK_PROVIDER_STREAM_FAILED_EVENT,o2 as TASK_PROVIDER_REQUEST_STARTED_EVENT,m2 as TASK_FIRST_CHUNK_RECEIVED_EVENT,d2 as TASK_CANCELLED_EVENT,U0 as SUPPORTED_IMAGE_MEDIA_TYPES,V4 as SESSION_STATUS_VALUES,$1 as SESSION_SEARCH_TITLE_MAX_LENGTH,w1 as SESSION_SEARCH_PREVIEW_MAX_LENGTH,r2 as SDK_ERROR_TELEMETRY_EVENT,I0 as S3AccessKeySettingsSchema,w6 as RemoteMCPServerSchema,N2 as RemoteConfigSchema,T0 as ReasoningLevelSchema,W0 as ReasoningEffortSchema,Uf as RUNTIME_CONFIG_EXTENSION_KINDS,I2 as REMOTE_URI_SCHEME,k0 as REASONING_LEVELS,Q0 as REASONING_EFFORT_RATIOS,C2 as ProviderProtocolSchema,y2 as ProviderClientSchema,E2 as ProviderCapabilitySchema,Y6 as PromptUploadingSchema,r6 as PLUGIN_FILE_EXTENSIONS,c1 as PLAN_MODE_INSTRUCTIONS_MANUAL_SWITCH,z1 as PLAN_MODE_INSTRUCTIONS,o1 as OpenAiCompatibleSchema,u1 as OpenAiCompatibleModelSchema,Q3 as ONE_TIME_SCHEDULE_RUN_AT_METADATA_KEY,G3 as ONE_TIME_SCHEDULE_CRON_PATTERN,Tf as ModelStatusSchema,E0 as ModelReasoningOptionSchema,Ef as ModelPricingSchema,vf as ModelOperationSchema,nf as ModelOperationModeSchema,C0 as ModelModalitySchema,Sf as ModelModalitiesSchema,yf as ModelMetadataSchema,_0 as ModelInfoSchema,Mf as ModelCapabilitySchema,h1 as MODE_TAG_INSTRUCTIONS,S3 as MODEL_TOOL_NAMES,u3 as MIN_MCP_TIMEOUT_SECONDS,q3 as MIN_CLIENT_HUB_PROTOCOL_VERSION,o3 as MAX_MCP_TIMEOUT_SECONDS,J3 as MAX_CLIENT_HUB_PROTOCOL_VERSION,t1 as LiteLLMSchema,a1 as LiteLLMModelSchema,t as IMAGE_UNSUPPORTED_PLACEHOLDER,a as IMAGE_OMITTED_PLACEHOLDER,sf as HookEventPayloadSchema,rf as HookEventNameSchema,P3 as HUB_USER_INSTRUCTIONS_SNAPSHOT_CAPABILITY,H$ as HUB_TOOL_EXECUTOR_NAMES,W3 as HUB_TOOL_EXECUTOR_CAPABILITY_PREFIX,af as HUB_SCHEDULE_MODES,D3 as HUB_MISTAKE_LIMIT_CAPABILITY,F3 as HUB_HOOK_CAPABILITY_PREFIX,X$ as HUB_DEFAULT_COMMAND_TIMEOUT_MS,_3 as HUB_CUSTOM_TOOL_CAPABILITY_PREFIX,L3 as HUB_COMPACTION_CAPABILITY,V3 as HUB_COMMAND_SLOW_LOG_MS,H3 as HUB_CLIENT_TOOL_APPROVAL_CAPABILITY,U3 as HUB_CHECKPOINT_CAPABILITY,X3 as HUB_CAPABILITIES,jf as GlobalInstructionsFileSchema,J1 as GeneratedMediaSourceSchema,K1 as GeneratedMediaSchema,q1 as GeneratedMediaModalitySchema,s6 as FeatureFlagDefaultValue,J0 as FeatureFlag,i6 as FEATURE_FLAGS,Z6 as EnterpriseTelemetrySchema,H0 as EMPTY_CONTENT_TEXT,V6 as DEFAULT_RUNTIME_CONFIG_EXTENSIONS,g$ as DEFAULT_REASONING_EFFORT,P4 as DEFAULT_OUTCOME_REQUIRED_SECTIONS,c3 as DEFAULT_MCP_TIMEOUT_SECONDS,H1 as DEFAULT_MAX_TOTAL_MEDIA_BYTES,v as DEFAULT_MAX_IMAGE_ENCODED_BYTES,x as DEFAULT_MAX_IMAGE_DECODED_BYTES,h0 as DEFAULT_MAX_IMAGE_BASE64_BYTES,h2 as DEFAULT_CLINE_ENVIRONMENT,g0 as ContributionRegistry,n6 as ConnectorHookEventSchema,hf as ConnectorHookEventNameSchema,zf as ConnectorEventContextSchema,xf as ConnectorEventActorSchema,g6 as ConnectorAuthorizationRequestSchema,v6 as ConnectorAuthorizationDecisionSchema,r1 as ClineSettingsSchema,d1 as ClineModelSchema,Z3 as CURRENT_HUB_PROTOCOL_VERSION,of as CONNECTOR_PLATFORMS,cf as CONNECTOR_CATALOG,g3 as CONFIGURABLE_MODEL_TOOL_NAMES,L4 as CLINE_WORKSPACES_DIRECTORY_NAME,n2 as CLINE_ENVIRONMENT_OVERRIDE_ENV,v2 as CLINE_ENVIRONMENT_ENV,Wf as CLINE_ENVIRONMENTS,M2 as CLINE_DEFAULT_RPC_PORT,T2 as CLINE_DEFAULT_RPC_ADDRESS,B2 as CLINE_DEFAULT_MODEL_ID,U4 as CLINE_CHAT_WORKSPACE_DIRECTORY_NAME,x$ as CHARS_PER_TOKEN,p1 as AwsBedrockSettingsSchema,l1 as AwsBedrockModelSchema,m1 as AwsBedrockCustomModelSchema,bf as ApiFormatSchema,I6 as ApiFormat,f6 as AnthropicSchema,e1 as AnthropicModelSchema,$6 as AllowedMCPServerSchema,S6 as AgentUsageSchema,l4 as AgentResultSchema,y6 as AgentFinishReasonSchema,m4 as AgentConfigSchema,W6 as AUTH_ERROR_PATTERNS,b2 as APIKeySchema,u2 as AGENT_UNEXPECTED_REASONING_TOKENS_EVENT};
105
+ `);return D.replace("{{PLATFORM_NAME}}",Y).replace("{{CWD}}",F).replace("{{CURRENT_DATE}}",new Date().toLocaleDateString()).replace("{{IDE_NAME}}",$).replace("{{CLINE_METADATA}}",L?v1(F,q,G):"").replace("{{CLINE_RULES}}",b).trim()}var B2="anthropic/claude-sonnet-5";var A2="remote://";import{z as X}from"zod";var u1=X.object({id:X.string(),temperature:X.number().optional(),maxTokens:X.number().optional(),contextWindow:X.number().optional(),inputPrice:X.number().optional(),outputPrice:X.number().optional(),supportsImages:X.boolean().optional()}),o1=X.object({models:X.array(u1).optional(),openAiBaseUrl:X.string().optional(),openAiHeaders:X.record(X.string(),X.string()).optional(),azureApiVersion:X.string().optional(),azureIdentity:X.boolean().optional()}),l1=X.object({id:X.string(),thinkingBudgetTokens:X.number().optional()}),m1=X.object({name:X.string(),baseModelId:X.string(),thinkingBudgetTokens:X.number().optional()}),d1=X.object({models:X.array(l1).optional(),customModels:X.array(m1).optional(),awsRegion:X.string().optional(),awsUseCrossRegionInference:X.boolean().optional(),awsUseGlobalInference:X.boolean().optional(),awsBedrockUsePromptCache:X.boolean().optional(),awsBedrockEndpoint:X.string().optional()}),p1=X.object({id:X.string()}),r1=X.object({models:X.array(p1).optional()}),s1=X.object({id:X.string(),thinkingBudgetTokens:X.number().optional()}),i1=X.object({models:X.array(s1).optional(),vertexProjectId:X.string().optional(),vertexRegion:X.string().optional()}),a1=X.object({id:X.string(),thinkingBudgetTokens:X.number().optional(),promptCachingEnabled:X.boolean().optional()}),t1=X.object({models:X.array(a1).optional(),baseUrl:X.string().optional()}),e1=X.object({id:X.string(),thinkingBudgetTokens:X.number().optional()}),f6=X.object({models:X.array(e1).optional(),baseUrl:X.string().optional()}),N2=X.object({OpenAiCompatible:o1.optional(),AwsBedrock:d1.optional(),Cline:r1.optional(),Vertex:i1.optional(),LiteLLM:t1.optional(),Anthropic:f6.optional()}),$6=X.object({id:X.string()}),w6=X.object({name:X.string(),url:X.string(),alwaysEnabled:X.boolean().optional(),headers:X.record(X.string(),X.string()).optional()}),jf=X.object({alwaysEnabled:X.boolean(),name:X.string(),contents:X.string()}),B0=X.object({bucket:X.string(),accessKeyId:X.string(),secretAccessKey:X.string(),region:X.string().optional(),endpoint:X.string().optional(),accountId:X.string().optional()}),Y6=X.object({enabled:X.boolean().optional(),type:X.union([X.literal("s3_access_keys"),X.literal("r2_access_keys"),X.literal("azure_access_keys")]).optional(),s3AccessSettings:B0.optional(),r2AccessSettings:B0.optional(),azureAccessSettings:B0.optional()}),Z6=X.object({promptUploading:Y6.optional()}),b2=X.object({version:X.string(),providerSettings:N2.optional(),telemetryEnabled:X.boolean().optional(),kanbanEnabled:X.boolean().optional(),mcpMarketplaceEnabled:X.boolean().optional(),allowedMCPServers:X.array($6).optional(),remoteMCPServers:X.array(w6).optional(),blockPersonalRemoteMCPServers:X.boolean().optional(),yoloModeAllowed:X.boolean().optional(),openTelemetryEnabled:X.boolean().optional(),openTelemetryMetricsExporter:X.string().optional(),openTelemetryLogsExporter:X.string().optional(),openTelemetryOtlpProtocol:X.string().optional(),openTelemetryOtlpEndpoint:X.string().optional(),openTelemetryOtlpHeaders:X.record(X.string(),X.string()).optional(),openTelemetryOtlpMetricsProtocol:X.string().optional(),openTelemetryOtlpMetricsEndpoint:X.string().optional(),openTelemetryOtlpMetricsHeaders:X.record(X.string(),X.string()).optional(),openTelemetryOtlpLogsProtocol:X.string().optional(),openTelemetryOtlpLogsEndpoint:X.string().optional(),openTelemetryOtlpLogsHeaders:X.record(X.string(),X.string()).optional(),openTelemetryMetricExportInterval:X.number().optional(),openTelemetryOtlpInsecure:X.boolean().optional(),openTelemetryLogBatchSize:X.number().optional(),openTelemetryLogBatchTimeout:X.number().optional(),openTelemetryLogMaxQueueSize:X.number().optional(),enterpriseTelemetry:Z6.optional(),globalRules:X.array(jf).optional(),globalWorkflows:X.array(jf).optional()}),C2=X.record(X.string(),X.string());var M2=4317;var T2="127.0.0.1:4317";import kf from"zod";var y2=kf.enum(["reasoning","prompt-cache","tools","provider-tools","oauth","temperature","files","streaming","vision","computer-use","local-auth","popular"]),E2=kf.enum(["anthropic","gemini","openai-chat","openai-responses","openai-r1","ai-sdk"]),S2=kf.enum(["anthropic","ai-sdk","ai-sdk-community","openai","openai-compatible","openai-r1","gemini","bedrock","custom","fetch","vertex"]);var g2="runtime.team.progress.v1",n2="runtime.team.lifecycle.v1";function q6(){return globalThis}function v2(f){q6().__clineClientIdentity=f}function h2(){return q6().__clineClientIdentity}var x2="CLINE_ENVIRONMENT",z2="CLINE_ENVIRONMENT_OVERRIDE",_f={production:{environment:"production",appBaseUrl:"https://app.cline.bot",apiBaseUrl:"https://api.cline.bot",mcpBaseUrl:"https://api.cline.bot/v1/mcp",workOsClientId:"client_01K3A541FN8TA3EPPHTD2325AR"},staging:{environment:"staging",appBaseUrl:"https://staging-app.cline.bot",apiBaseUrl:"https://core-api.staging.int.cline.bot",mcpBaseUrl:"https://core-api.staging.int.cline.bot/v1/mcp",workOsClientId:"client_01K3A5415VF6QBQBG3XYCW91G6"},local:{environment:"local",appBaseUrl:"http://localhost:3000",apiBaseUrl:"http://localhost:7777",mcpBaseUrl:"http://localhost:7777/v1/mcp",workOsClientId:"client_01K6XQAY7JK6T5HXVSZW2S5VYK"}},c2="production";function J6(f){let $=f?.trim().toLowerCase();if($==="production"||$==="staging"||$==="local")return $;return}function X6(){if(typeof process>"u"||!process?.env)return{};return process.env}function G6(){let f=X6();return J6(f.CLINE_ENVIRONMENT_OVERRIDE)??J6(f.CLINE_ENVIRONMENT)??"production"}function u2(f){if(typeof f==="string")return _f[f];return _f[G6()]}function o2(f,$){if($.CLINE_API_BASE_URL)f={...f,apiBaseUrl:$.CLINE_API_BASE_URL,mcpBaseUrl:`${$.CLINE_API_BASE_URL}/v1/mcp`};return f}function l2(f){let $=u2(f);return o2($,X6())}var m2="agent.reasoning.unexpected_tokens",d2="task.provider_request_started",p2="task.provider_stream_started",r2="task.first_chunk_received",s2="task.provider_stream_failed",i2="task.cancelled";var a2="sdk.error";var d=new Map;function t2(){d.clear()}function e2(f,$){let w=typeof $.error_message==="string"?$.error_message:"";return[f,$.component,$.operation,$.error_type,$.error_code??"",$.error_status??"",w.replace(/\d+/g,"#").replace(/\s+/g," ").trim().toLowerCase().slice(0,256)].join("\x00")}function f4(f){let $=Date.now(),w=d.get(f);if(w&&$-w.startMs<3600000){if(w.emitted<5)return w.emitted+=1,{emit:!0,suppressed:0};return w.suppressed+=1,{emit:!1,suppressed:w.suppressed}}let Y=w?.suppressed??0;if(d.delete(f),d.size>=512){let q=d.keys().next();if(!q.done)d.delete(q.value)}return d.set(f,{startMs:$,emitted:1,suppressed:0}),{emit:!0,suppressed:Y}}function $4(f,$){f?.capture({event:"agent.reasoning.unexpected_tokens",properties:Ff({sessionId:$.sessionId,agentId:$.agentId,runId:$.runId,iteration:$.iteration,providerId:$.providerId,modelId:$.modelId,requestedThinking:$.requestedThinking,reasoningTokenCount:$.reasoningTokenCount})})}function w4(f,$){if(!f)return;f.capture({event:$.event,properties:Ff({sessionId:$.sessionId,ulid:$.ulid??$.sessionId,agentId:$.agentId,conversationId:$.conversationId,runId:$.runId,iteration:$.iteration,provider:$.providerId,providerId:$.providerId,model:$.modelId,modelId:$.modelId,phase:$.phase,durationMs:$.durationMs,eventType:$.eventType,...$.error===void 0?{}:Lf($.error,$.messageLimit),error_class:$.errorClass})})}function Y4(f,$){if(!f)return!1;let w=$.event??"sdk.error",Y=H6($),q=0;try{let G=f4(e2(w,Y));if(!G.emit)return!0;q=G.suppressed}catch{}return f.capture({event:w,properties:q>0?{...Y,suppressed_count:q}:Y}),!0}function H6(f){return Ff({...f.context??{},component:f.component,operation:f.operation,severity:f.severity??"error",handled:f.handled??!0,...Lf(f.error,f.messageLimit,f.errorMessage)})}function Ff(f){let $={};for(let[w,Y]of Object.entries(f))if(Y!==void 0)$[w]=Y;return $}function Lf(f,$=500,w){let Y=J4(f)?f:void 0,q=f instanceof Error?f:void 0,G=R0(w)??R0(q?.message)??R0(Y?.message)??X4(f)??"Unknown error",H=G4(Y?.code),K=Wf(Y?.status)??Wf(Y?.statusCode)??Wf(Y?.responseStatus);return{error_type:q?.name?.trim()||R0(Y?.name)||q?.constructor?.name||"Error",error_message:q4(Z4(G),$),...H!==void 0?{error_code:H}:{},...K!==void 0?{error_status:K}:{}}}function Z4(f){return f.replace(/(authorization=Bearer\s+)[^&\s]+/gi,"$1[redacted]").replace(/(api[_-]?key|access[_-]?token|refresh[_-]?token|authorization|password|secret)=([^&\s]+)/gi,"$1=[redacted]").replace(/(Bearer\s+)[A-Za-z0-9._~+/-]+=*/gi,"$1[redacted]").replace(/\/Users\/[^/\s]+/g,"/Users/[redacted]").replace(/\/home\/[^/\s]+/g,"/home/[redacted]").replace(/([A-Za-z]:[\\/]+Users[\\/]+)[^\\/\s]+/g,"$1[redacted]")}function q4(f,$){let w=Math.max(1,Math.floor($));return f.length>w?f.substring(0,w):f}function J4(f){return typeof f==="object"&&f!==null}function R0(f){return typeof f==="string"&&f.trim().length>0?f:void 0}function X4(f){if(f instanceof Error)return;let $=typeof f==="string"?f:String(f);return $==="[object Object]"?void 0:R0($)}function G4(f){if(typeof f==="string"&&f.trim().length>0)return f;if(typeof f==="number"&&Number.isFinite(f))return f;return}function Wf(f){return typeof f==="number"&&Number.isFinite(f)?f:void 0}function K6(f){let $={};if(!f)return $;return f.split(",").forEach((w)=>{let Y=w.indexOf("=");if(Y<=0)return;try{let q=decodeURIComponent(w.substring(0,Y).trim()),G=decodeURIComponent(w.substring(Y+1).trim());if(!q||!G)return;$[q]=G}catch{}}),$}function H4(){if(!process.env)return{enabled:!1};return{enabled:process.env.OTEL_TELEMETRY_ENABLED==="1"||process.env.OTEL_TELEMETRY_ENABLED==="true",metricsExporter:process.env.OTEL_METRICS_EXPORTER||"otlp",logsExporter:process.env.OTEL_LOGS_EXPORTER||"otlp",tracesExporter:process.env.OTEL_TRACES_EXPORTER,otlpProtocol:process.env.OTEL_EXPORTER_OTLP_PROTOCOL||"http/json",otlpEndpoint:process.env.OTEL_EXPORTER_OTLP_ENDPOINT,metricExportInterval:process.env.OTEL_METRIC_EXPORT_INTERVAL?Number.parseInt(process.env.OTEL_METRIC_EXPORT_INTERVAL,10):void 0,otlpHeaders:process.env.OTEL_EXPORTER_OTLP_HEADERS?K6(process.env.OTEL_EXPORTER_OTLP_HEADERS):void 0}}function Q6(f={}){return{extension_version:"unknown",cline_type:"unknown",platform:"terminal",platform_version:process?.version||"unknown",os_type:process?.platform||"unknown",os_version:process?.platform==="win32"?process?.env?.OS??"unknown":"unknown",...f}}function K4(f={}){return{...H4(),...f,metadata:Q6(f.metadata)}}function R6(f){let $=f?.trim();return $?$:void 0}function Q4(f,$){if(!f)return;let w=typeof f==="function"?f($):f;if(!w)return;let Y=R6(w.rootSessionId);if(!Y)return;return{rootSessionId:Y}}function R4(f){return R6(f?.rootSessionId)}var V4=(f)=>crypto.getRandomValues(new Uint8Array(f)),j4=(f,$,w)=>{let Y=256-256%f.length;if(Y===256){let G=f.length-1;return(H=$)=>{if(!H)return"";let K="";while(!0){let j=w(H),k=H;while(k--)if(K+=f[j[k]&G],K.length>=H)return K}}}let q=Math.ceil(409.6*$/Y);return(G=$)=>{if(!G)return"";let H="";while(!0){let K=w(q),j=q;while(j--)if(K[j]<Y){if(H+=f[K[j]%f.length],H.length>=G)return H}}}},V6=(f,$=21)=>j4(f,$|0,V4);function k4(f="",$=""){let w=V6("1234567890abcdefghijklmnopqrstuvwxyz",10);return`${f}${Date.now()}_${w(5)}${$}`}var _4=["idle","running","pending","completed","failed","cancelled"];var Uf=["rules","skills","workflows","plugins","hooks"],j6=Uf,W4=new Set(Uf);function k6(f){return typeof f==="string"&&W4.has(f)}function F4(f){if(!Array.isArray(f))return;let $=f.map((w)=>typeof w==="string"?w.trim():"").filter(k6);return[...new Set($)]}function L4(f,$){return new Set(f??j6).has($)}import{z as E}from"zod";var U4=E.object({rootPath:E.string().min(1),hint:E.string().min(1).optional(),associatedRemoteUrls:E.array(E.string().min(1)).optional(),latestGitCommitHash:E.string().min(1).optional(),latestGitBranchName:E.string().min(1).optional()}),D4=E.object({currentWorkspacePath:E.string().min(1).optional(),workspaces:E.record(E.string().min(1),U4)});function m8(){return{workspaces:{}}}function d8(f,$){let w={...f,workspaces:{...f.workspaces,[$.rootPath]:$}};if(!w.currentWorkspacePath)w.currentWorkspacePath=$.rootPath;return D4.parse(w)}var I4="workspaces",P4="chat";function O4(f){let $=f.trim(),w=/^[A-Za-z]:[\\/]/.test($)||$.startsWith("\\\\"),Y=$.startsWith("/");if(!w&&!Y)return!1;let q=$.split(w?/[\\/]+/:/\/+/).filter(Boolean),G=q.at(-1)??"",H=q.at(-2)??"",K=q.at(-3)??"";return(q.at(-4)??"")===".cline"&&K==="data"&&H==="workspaces"&&G==="chat"}import{z as Z}from"zod";var B4=["current_state","boundary_analysis","interface_proposal"],i8=3600000,a8=240,t8=400,S=Z.preprocess((f)=>f instanceof Date?f.toISOString():f,Z.string().datetime()),J0=Z.enum(["pending","in_progress","blocked","completed"]),_6=Z.enum(["queued","running","completed","failed","cancelled","interrupted"]),A0=Z.enum(["draft","in_review","finalized"]),A4=Z.object({agentId:Z.string(),role:Z.enum(["lead","teammate"]),description:Z.string().optional(),status:Z.enum(["idle","running","stopped"])}),e8=Z.object({agentId:Z.string(),rolePrompt:Z.string(),modelId:Z.string().optional(),maxIterations:Z.number().optional()});function O(f){return Z.preprocess(($)=>$===null?void 0:$,f.optional())}var fw=Z.object({agentId:Z.string().min(1).describe("Teammate identifier"),rolePrompt:Z.string().min(1).describe("System prompt describing teammate role")}).strict(),$w=Z.object({agentId:Z.string().min(1).describe("Teammate identifier"),reason:O(Z.string().min(1)).describe("Optional shutdown reason")}),ww=Z.object({}),N4={create:["title","description"],list:[],claim:["taskId"],complete:["taskId","summary"],block:["taskId","reason"]},Yw={create:["status","taskId","summary","reason"]},Zw=Z.object({action:Z.enum(["create","list","claim","complete","block"]),title:O(Z.string().min(1)).describe("Task title"),description:O(Z.string().min(1)).describe("Task details"),dependsOn:O(Z.array(Z.string().describe("Dependency task ID"))).describe("Array of dependency task IDs"),assignee:O(Z.string().min(1)).describe("Optional assignee"),status:O(Z.enum(["pending","in_progress","blocked","completed"])).describe("Optional task status filter"),taskId:O(Z.string()).describe("Task ID"),summary:O(Z.string().min(1)).describe("Completion summary"),reason:O(Z.string().min(1)).describe("Blocking reason")}).superRefine((f,$)=>{for(let w of N4[f.action]){if(f[w]!==void 0)continue;$.addIssue({code:"custom",path:[w],message:`Field "${w}" is required when action=${f.action}`})}}),qw=Z.object({agentId:Z.string().describe("Teammate agent ID"),task:Z.string().min(1).describe("Task instructions for the teammate"),taskId:O(Z.string()).describe("Optional shared task list ID"),runMode:O(Z.enum(["sync","async"])).describe("Execution mode: 'sync' blocks until the teammate finishes and returns the result (default if omitted); 'async' queues the run and returns a runId immediately — use team_await_runs to collect results later."),continueConversation:O(Z.boolean()).describe("If true, continue the teammate conversation; otherwise start fresh")}),Jw=Z.object({status:O(Z.enum(["queued","running","completed","failed","cancelled","interrupted"])).describe("Optional run status filter. Omit to include all statuses."),agentId:O(Z.string().min(1)).describe("Optional teammate ID filter. Omit to include all teammates."),includeCompleted:O(Z.boolean()).describe("Include completed/failed runs (default true)")}),Xw=Z.object({runId:Z.string().min(1).describe("Run ID"),reason:O(Z.string().min(1)).describe("Optional cancellation reason")}),Gw=Z.object({runId:O(Z.string().min(1)).describe("Optional async run ID to await. Omit to wait for all active async runs.")}).strict(),Hw=Z.object({toAgentId:Z.string().min(1).describe("Recipient agent ID"),subject:Z.string().min(1).describe("Message subject"),body:Z.string().min(1).describe("Message body"),taskId:O(Z.string().min(1)).describe("Optional task ID context")}),Kw=Z.object({subject:Z.string().min(1).describe("Message subject"),body:Z.string().min(1).describe("Message body"),taskId:O(Z.string().min(1)).describe("Optional task ID context")}),Qw=Z.object({unreadOnly:O(Z.boolean()).describe("Only unread messages for read action (default true)")}),Rw=Z.object({kind:Z.enum(["progress","handoff","blocked","decision","done","error"]),summary:Z.string().min(1).describe("Update summary"),taskId:O(Z.string().min(1)).describe("Optional task ID context"),evidence:O(Z.array(Z.string().min(1))).describe("Optional evidence links/snippets"),nextAction:O(Z.string().min(1)).describe("Planned next step")}),Vw=Z.object({}),jw=Z.object({title:Z.string().describe("Outcome title"),requiredSections:Z.array(Z.string()).default(B4).describe("Required sections for finalization gate (defaults to current_state,boundary_analysis,interface_proposal)")}),kw=Z.object({outcomeId:Z.string().describe("Outcome ID"),section:Z.string().describe("Section name"),sourceRunId:O(Z.string()).describe("Optional source run ID"),content:Z.string().describe("Section fragment content")}),_w=Z.object({fragmentId:Z.string().describe("Fragment ID"),approved:Z.boolean().describe("Review decision")}),Ww=Z.object({outcomeId:Z.string().describe("Outcome ID")}),Fw=Z.object({}),Lw=Z.object({teamId:Z.string(),teamName:Z.string(),members:Z.array(A4),taskCounts:Z.record(J0,Z.number()),unreadMessages:Z.number(),missionLogEntries:Z.number(),activeRuns:Z.number(),queuedRuns:Z.number(),outcomeCounts:Z.record(A0,Z.number())}),b4=Z.object({id:Z.string(),title:Z.string(),description:Z.string(),status:J0,createdAt:S,updatedAt:S,createdBy:Z.string(),assignee:Z.string().optional(),dependsOn:Z.array(Z.string()),summary:Z.string().optional(),isReady:Z.boolean(),blockedBy:Z.array(Z.string())}),Uw=Z.discriminatedUnion("action",[Z.object({action:Z.literal("create"),taskId:Z.string(),status:J0,ignoredFields:Z.array(Z.string()).optional(),note:Z.string().optional()}),Z.object({action:Z.literal("list"),tasks:Z.array(b4)}),Z.object({action:Z.literal("claim"),taskId:Z.string(),status:J0,nextStep:Z.string()}),Z.object({action:Z.literal("complete"),taskId:Z.string(),status:J0}),Z.object({action:Z.literal("block"),taskId:Z.string(),status:J0})]),Dw=Z.object({agentId:Z.string(),mode:Z.enum(["sync","async"]),status:Z.enum(["dispatched","running","queued","joined"]),dispatched:Z.boolean(),message:Z.string(),deduped:Z.boolean().optional(),runId:Z.string().optional(),text:Z.string().optional(),iterations:Z.number().optional()}),C4=Z.object({textPreview:Z.string(),iterations:Z.number(),finishReason:Z.string(),durationMs:Z.number(),usage:Z.object({inputTokens:Z.number(),outputTokens:Z.number(),cacheReadTokens:Z.number().optional(),cacheWriteTokens:Z.number().optional(),totalCost:Z.number().optional()})}),Iw=Z.object({id:Z.string(),agentId:Z.string(),taskId:Z.string().optional(),status:_6,messagePreview:Z.string(),priority:Z.number(),retryCount:Z.number(),maxRetries:Z.number(),nextAttemptAt:S.optional(),continueConversation:Z.boolean().optional(),startedAt:S,endedAt:S.optional(),leaseOwner:Z.string().optional(),heartbeatAt:S.optional(),lastProgressAt:S.optional(),lastProgressMessage:Z.string().optional(),currentActivity:Z.string().optional(),error:Z.string().optional(),resultSummary:C4.optional()}),Pw=Z.object({id:Z.string(),teamId:Z.string(),fromAgentId:Z.string(),toAgentId:Z.string(),subject:Z.string(),body:Z.string(),taskId:Z.string().optional(),sentAt:S,readAt:S.optional()}),Ow=Z.object({id:Z.string(),teamId:Z.string(),title:Z.string(),status:A0,requiredSections:Z.array(Z.string()),createdBy:Z.string(),createdAt:S,finalizedAt:S.optional()}),Bw=Z.object({outcomeId:Z.string(),status:A0,requiredSections:Z.array(Z.string())}),Aw=Z.object({agentId:Z.string(),status:Z.string()}),Nw=Z.object({runId:Z.string(),status:_6}),bw=Z.object({id:Z.string(),toAgentId:Z.string()}),Cw=Z.object({delivered:Z.number()}),Mw=Z.object({id:Z.string()}),Tw=Z.object({status:Z.string()}),yw=Z.object({fragmentId:Z.string(),status:Z.string()}),Ew=Z.object({outcomeId:Z.string(),status:A0});var M4;((B)=>{B.TaskStart="task_start";B.TaskEnd="task_end";B.AgentEvent="agent_event";B.TeammateSpawned="teammate_spawned";B.TeammateShutdown="teammate_shutdown";B.TeamTaskUpdated="team_task_updated";B.TeamMessage="team_message";B.TeamMissionLog="team_mission_log";B.TeamTaskCompleted="team_task_completed";B.RunStarted="run_started";B.RunQueued="run_queued";B.RunProgress="run_progress";B.RunCompleted="run_completed";B.RunFailed="run_failed";B.RunCancelled="run_cancelled";B.RunInterrupted="run_interrupted";B.OutcomeCreated="outcome_created";B.OutcomeFragmentAttached="outcome_fragment_attached";B.OutcomeFragmentReviewed="outcome_fragment_reviewed";B.OutcomeFinalized="outcome_finalized"})(M4||={});import{z as T4}from"zod";function y4(f){let{$schema:$,...w}=f;if(typeof w.type==="string")return w;if("properties"in w||"required"in w||"additionalProperties"in w)return{type:"object",...w};for(let Y of["oneOf","anyOf","allOf"]){let q=w[Y];if(!Array.isArray(q)||q.length===0)continue;if(Y==="allOf"){if(q.some((K)=>K&&typeof K==="object"&&K.type==="object"))return{type:"object",...w};throw Error('Tool inputSchema must describe an object at the top level, but the schema has a top-level "allOf" with no branch that asserts type: "object". Add type: "object" to at least one allOf branch to make the object constraint explicit.')}if(q.every((H)=>H&&typeof H==="object"&&H.type==="object"))return{type:"object",...w};throw Error(`Tool inputSchema must describe an object at the top level, but the schema has a top-level "${Y}" whose branches include non-object types. Pass the strict object schema as inputSchema and reserve union/coercion schemas for use inside execute().`)}return w}function E4(f){let $=y4(f.inputSchema instanceof T4.ZodType?Kf(f.inputSchema):f.inputSchema);return{name:f.name,description:f.description,inputSchema:$,lifecycle:f.lifecycle,executionMode:f.executionMode,timeoutMs:f.timeoutMs??30000,retryable:f.retryable??!0,maxRetries:f.maxRetries??3,execute:f.execute}}var W6=["401","403","unauthorized","forbidden","invalid token","expired token","authentication"];function S4(f){let $=(f instanceof Error?f.message:String(f)).toLowerCase();return W6.some((w)=>$.includes(w))}export{Kf as zodToJsonSchema,Z1 as xmlTagsRemoval,P2 as validateWithZod,R1 as validateImageMedia,G0 as validateAndReserveImageMedia,A$ as validateAndReserveBase64Media,C6 as usesImageGenerationOperation,d8 as upsertWorkspaceInfo,E1 as truncateStr,F2 as truncateSplit,W2 as trimNonEmpty,W1 as toAiSdkToolResultOutput,gf as supportsChatModalities,U2 as stripUtf8Bom,f1 as stripModeNotices,x6 as shouldIncludeConnectorField,v2 as setClineClientIdentity,x$ as serializeAbortReason,T as sanitizeSurrogates,_2 as sanitizeFileName,$2 as safeJsonStringify,w2 as safeJsonParse,R4 as resolveRootSessionId,L1 as resolveReasoningEffortRatio,h$ as resolveReasoningBudgetFromRatio,c0 as resolveMediaBudget,p3 as resolveMcpTimeoutSeconds,W3 as resolveHubCommandTimeoutMs,Q4 as resolveHookSessionContext,v$ as resolveEffectiveReasoningEffort,G6 as resolveClineEnvironment,t2 as resetSdkErrorRateLimiterForTests,X0 as reserveImageMediaBytes,k3 as readHubScheduleMode,tf as parseUserCommandEnvelope,F4 as parseRuntimeConfigExtensions,f2 as parseJsonStream,J$ as parseHookEventPayload,X2 as omitUndefinedValues,ef as normalizeUserInput,Lf as normalizeSdkError,pf as normalizePluginManifest,Xf as normalizeJsonLikeStringsForSchema,u$ as noopBasicLogger,M6 as modelSupportsToolCalling,T6 as modelSupportsImageInput,b6 as modelProducesImages,E0 as modelHasCapability,g$ as mergeModelOptions,L2 as maskSecret,uf as listConnectorCatalog,k6 as isRuntimeConfigExtensionKind,o$ as isMcpTimeoutConfigured,S4 as isLikelyAuthError,F3 as isHubToolExecutorName,X$ as isHubScheduleMode,Q3 as isHubProtocolCompatible,D$ as isGeneratedMedia,Qf as isClineProvider,O4 as isChatWorkspacePath,N6 as isChatCompatibleModel,B$ as isCanonicalBase64,K1 as isBase64Char,O$ as imageFileMaxDecodedBytesForBase64Limit,z0 as imageBase64LengthForDecodedBytes,P$ as imageBase64EncodedByteLength,x0 as imageBase64DecodedByteLength,L4 as hasRuntimeConfigExtension,Hf as getShellKind,y1 as getShellInvocation,k2 as getShellArgs,m$ as getErrorMessage,d$ as getErrorCode,G2 as getDefaultShell,H$ as getDefaultHubCommandTimeoutMs,l2 as getClineEnvironmentConfig,h2 as getClineClientIdentity,I$ as generatedMediaModalityFromMediaType,R$ as formatUserInputBlock,V$ as formatUserCommandBlock,I2 as formatUptime,L$ as formatSessionSearchTitle,U$ as formatSessionSearchPreview,j$ as formatModeSwitchNotice,S$ as formatMessagesForAiSdk,r3 as formatMcpTimeoutErrorMessage,D2 as formatHumanReadableDate,n0 as formatFileContentBlock,v0 as formatDisplayUserInput,U1 as estimateTokens,c$ as estimateRequestInputTokens,m8 as emptyWorkspaceManifest,A3 as describeOutdatedHubSessions,J2 as decodeJwtPayload,E4 as createTool,k4 as createSessionId,k$ as createModeSwitchNoticeTracker,D0 as createMediaBudgetState,r6 as createContributionRegistry,Q6 as createClineTelemetryServiceMetadata,K4 as createClineTelemetryServiceConfig,z6 as connectorChannelsFromPlatforms,l$ as clampMcpTimeoutSeconds,w4 as captureTaskLifecycleEvent,Y4 as captureSdkError,$4 as captureAgentUnexpectedReasoningTokens,H6 as buildSdkErrorProperties,O2 as buildClineSystemPrompt,D4 as WorkspaceManifestSchema,U4 as WorkspaceInfoSchema,i1 as VertexSettingsSchema,s1 as VertexModelSchema,y6 as USER_REJECTED_TOOL_REASON,S3 as USAGE_COST_DISPLAYS,S0 as ToolCallRecordSchema,yf as ThinkingConfigSchema,e8 as TeamTeammateSpecSchema,Uw as TeamTaskToolResultSchema,b4 as TeamTaskListItemToolResultSchema,Zw as TeamTaskInputSchema,Lw as TeamStatusToolResultSchema,ww as TeamStatusInputSchema,fw as TeamSpawnTeammateInputSchema,Aw as TeamSimpleAgentStatusToolResultSchema,$w as TeamShutdownTeammateInputSchema,bw as TeamSendMessageToolResultSchema,Hw as TeamSendMessageInputSchema,Iw as TeamRunToolSummarySchema,Dw as TeamRunTaskToolResultSchema,qw as TeamRunTaskInputSchema,C4 as TeamRunResultSummarySchema,_w as TeamReviewOutcomeFragmentInputSchema,Qw as TeamReadMailboxInputSchema,Ow as TeamOutcomeToolResultSchema,yw as TeamOutcomeFragmentToolResultSchema,Mw as TeamMissionLogToolResultSchema,Rw as TeamMissionLogInputSchema,M4 as TeamMessageType,Pw as TeamMailboxMessageToolResultSchema,Jw as TeamListRunsInputSchema,Fw as TeamListOutcomesInputSchema,Ew as TeamFinalizeOutcomeToolResultSchema,Ww as TeamFinalizeOutcomeInputSchema,Bw as TeamCreateOutcomeToolResultSchema,jw as TeamCreateOutcomeInputSchema,Tw as TeamCleanupToolResultSchema,Vw as TeamCleanupInputSchema,Nw as TeamCancelRunToolResultSchema,Xw as TeamCancelRunInputSchema,Cw as TeamBroadcastToolResultSchema,Kw as TeamBroadcastInputSchema,Gw as TeamAwaitRunsInputSchema,kw as TeamAttachOutcomeFragmentInputSchema,E6 as TOOL_REJECTION_SUFFIX,Yw as TEAM_TASK_IGNORED_FIELDS_BY_ACTION,t8 as TEAM_RUN_TEXT_PREVIEW_LIMIT,a8 as TEAM_RUN_MESSAGE_PREVIEW_LIMIT,g2 as TEAM_PROGRESS_EVENT_TYPE,n2 as TEAM_LIFECYCLE_EVENT_TYPE,i8 as TEAM_AWAIT_TIMEOUT_MS,p2 as TASK_PROVIDER_STREAM_STARTED_EVENT,s2 as TASK_PROVIDER_STREAM_FAILED_EVENT,d2 as TASK_PROVIDER_REQUEST_STARTED_EVENT,r2 as TASK_FIRST_CHUNK_RECEIVED_EVENT,i2 as TASK_CANCELLED_EVENT,U0 as SUPPORTED_IMAGE_MEDIA_TYPES,_4 as SESSION_STATUS_VALUES,$1 as SESSION_SEARCH_TITLE_MAX_LENGTH,w1 as SESSION_SEARCH_PREVIEW_MAX_LENGTH,a2 as SDK_ERROR_TELEMETRY_EVENT,B0 as S3AccessKeySettingsSchema,w6 as RemoteMCPServerSchema,b2 as RemoteConfigSchema,M0 as ReasoningLevelSchema,_0 as ReasoningEffortSchema,Uf as RUNTIME_CONFIG_EXTENSION_KINDS,A2 as REMOTE_URI_SCHEME,k0 as REASONING_LEVELS,Q0 as REASONING_EFFORT_RATIOS,E2 as ProviderProtocolSchema,S2 as ProviderClientSchema,y2 as ProviderCapabilitySchema,Y6 as PromptUploadingSchema,s6 as PLUGIN_FILE_EXTENSIONS,c1 as PLAN_MODE_INSTRUCTIONS_MANUAL_SWITCH,z1 as PLAN_MODE_INSTRUCTIONS,o1 as OpenAiCompatibleSchema,u1 as OpenAiCompatibleModelSchema,j3 as ONE_TIME_SCHEDULE_RUN_AT_METADATA_KEY,V3 as ONE_TIME_SCHEDULE_CRON_PATTERN,Mf as ModelStatusSchema,T0 as ModelReasoningOptionSchema,Tf as ModelPricingSchema,nf as ModelOperationSchema,vf as ModelOperationModeSchema,y0 as ModelModalitySchema,Sf as ModelModalitiesSchema,Ef as ModelMetadataSchema,W0 as ModelInfoSchema,Cf as ModelCapabilitySchema,h1 as MODE_TAG_INSTRUCTIONS,v3 as MODEL_TOOL_NAMES,m3 as MIN_MCP_TIMEOUT_SECONDS,G3 as MIN_CLIENT_HUB_PROTOCOL_VERSION,d3 as MAX_MCP_TIMEOUT_SECONDS,H3 as MAX_CLIENT_HUB_PROTOCOL_VERSION,t1 as LiteLLMSchema,a1 as LiteLLMModelSchema,e as IMAGE_UNSUPPORTED_PLACEHOLDER,t as IMAGE_OMITTED_PLACEHOLDER,sf as HookEventPayloadSchema,rf as HookEventNameSchema,B3 as HUB_USER_INSTRUCTIONS_SNAPSHOT_CAPABILITY,K$ as HUB_TOOL_EXECUTOR_NAMES,L3 as HUB_TOOL_EXECUTOR_CAPABILITY_PREFIX,af as HUB_SCHEDULE_MODES,O3 as HUB_MISTAKE_LIMIT_CAPABILITY,D3 as HUB_HOOK_CAPABILITY_PREFIX,G$ as HUB_DEFAULT_COMMAND_TIMEOUT_MS,U3 as HUB_CUSTOM_TOOL_CAPABILITY_PREFIX,I3 as HUB_COMPACTION_CAPABILITY,_3 as HUB_COMMAND_SLOW_LOG_MS,R3 as HUB_CLIENT_TOOL_APPROVAL_CAPABILITY,P3 as HUB_CHECKPOINT_CAPABILITY,K3 as HUB_CAPABILITIES,jf as GlobalInstructionsFileSchema,J1 as GeneratedMediaSourceSchema,G1 as GeneratedMediaSchema,q1 as GeneratedMediaModalitySchema,i6 as FeatureFlagDefaultValue,a as FeatureFlag,a6 as FEATURE_FLAGS,Z6 as EnterpriseTelemetrySchema,H0 as EMPTY_CONTENT_TEXT,j6 as DEFAULT_RUNTIME_CONFIG_EXTENSIONS,n$ as DEFAULT_REASONING_EFFORT,B4 as DEFAULT_OUTCOME_REQUIRED_SECTIONS,l3 as DEFAULT_MCP_TIMEOUT_SECONDS,H1 as DEFAULT_MAX_TOTAL_MEDIA_BYTES,n as DEFAULT_MAX_IMAGE_ENCODED_BYTES,x as DEFAULT_MAX_IMAGE_DECODED_BYTES,h0 as DEFAULT_MAX_IMAGE_BASE64_BYTES,c2 as DEFAULT_CLINE_ENVIRONMENT,g0 as ContributionRegistry,h6 as ConnectorHookEventSchema,hf as ConnectorHookEventNameSchema,zf as ConnectorEventContextSchema,xf as ConnectorEventActorSchema,n6 as ConnectorAuthorizationRequestSchema,v6 as ConnectorAuthorizationDecisionSchema,r1 as ClineSettingsSchema,p1 as ClineModelSchema,X3 as CURRENT_HUB_PROTOCOL_VERSION,of as CONNECTOR_PLATFORMS,cf as CONNECTOR_CATALOG,h3 as CONFIGURABLE_MODEL_TOOL_NAMES,I4 as CLINE_WORKSPACES_DIRECTORY_NAME,z2 as CLINE_ENVIRONMENT_OVERRIDE_ENV,x2 as CLINE_ENVIRONMENT_ENV,_f as CLINE_ENVIRONMENTS,M2 as CLINE_DEFAULT_RPC_PORT,T2 as CLINE_DEFAULT_RPC_ADDRESS,B2 as CLINE_DEFAULT_MODEL_ID,P4 as CLINE_CHAT_WORKSPACE_DIRECTORY_NAME,z$ as CHARS_PER_TOKEN,d1 as AwsBedrockSettingsSchema,l1 as AwsBedrockModelSchema,m1 as AwsBedrockCustomModelSchema,bf as ApiFormatSchema,A6 as ApiFormat,f6 as AnthropicSchema,e1 as AnthropicModelSchema,$6 as AllowedMCPServerSchema,g6 as AgentUsageSchema,p4 as AgentResultSchema,S6 as AgentFinishReasonSchema,r4 as AgentConfigSchema,W6 as AUTH_ERROR_PATTERNS,C2 as APIKeySchema,m2 as AGENT_UNEXPECTED_REASONING_TOKENS_EVENT};
package/dist/index.d.ts CHANGED
@@ -60,12 +60,15 @@ export type { TeamProgressCounts, TeamProgressLifecycleEvent, TeamProgressMember
60
60
  export { TEAM_LIFECYCLE_EVENT_TYPE, TEAM_PROGRESS_EVENT_TYPE, } from "./rpc/team-progress";
61
61
  export type { ClineBuildEnv, ClineDebugRole, ResolveClineBuildEnvOptions, } from "./runtime/build-env";
62
62
  export { augmentNodeCommandForDebug, CLINE_BUILD_ENV_ENV, CLINE_DEBUG_HOST_ENV, CLINE_DEBUG_PORT_BASE_ENV, resolveClineBuildEnv, withResolvedClineBuildEnv, } from "./runtime/build-env";
63
+ export type { ClineClientIdentity } from "./runtime/cline-client-identity";
64
+ export { getClineClientIdentity, setClineClientIdentity, } from "./runtime/cline-client-identity";
63
65
  export type { ClineEnvironment, ClineEnvironmentConfig, ResolveClineEnvironmentOptions, } from "./runtime/cline-environment";
64
66
  export { CLINE_ENVIRONMENT_ENV, CLINE_ENVIRONMENT_OVERRIDE_ENV, CLINE_ENVIRONMENTS, DEFAULT_CLINE_ENVIRONMENT, getClineEnvironmentConfig, resolveClineEnvironment, } from "./runtime/cline-environment";
65
67
  export type { ConnectorCliLaunchSpec, ConnectorInstanceRef, } from "./runtime/hub-daemon-env";
66
68
  export { CLINE_CONNECTOR_CLI_LAUNCH_ENV, CLINE_CONNECTOR_STARTING_INSTANCE_ENV, CLINE_CONNECTOR_SUPERVISED_ENV, CLINE_RUN_AS_HUB_DAEMON_ENV, claimHubDaemonProcess, claimSupervisedConnectorProcess, isHubDaemonProcess, isSupervisedConnectorProcess, readConnectorCliLaunchSpec, readStartingConnectorInstance, setConnectorCliLaunchSpec, setStartingConnectorInstance, } from "./runtime/hub-daemon-env";
67
- export type { CaptureAgentUnexpectedReasoningTokensInput, CaptureSdkErrorInput, CaptureTaskLifecycleEventInput, ITelemetryService, OpenTelemetryClientConfig, SdkTelemetryErrorComponent, SdkTelemetryErrorSeverity, TelemetryArray, TelemetryMetadata, TelemetryObject, TelemetryPrimitive, TelemetryProperties, TelemetryValue, } from "./services/telemetry";
68
- export { AGENT_UNEXPECTED_REASONING_TOKENS_EVENT, buildSdkErrorProperties, captureAgentUnexpectedReasoningTokens, captureSdkError, captureTaskLifecycleEvent, isOtlpTraceRelayProvider, markOtlpTraceRelayProvider, normalizeSdkError, OTLP_TRACE_RELAY_MARKER, resetSdkErrorRateLimiterForTests, SDK_ERROR_TELEMETRY_EVENT, TASK_CANCELLED_EVENT, TASK_FIRST_CHUNK_RECEIVED_EVENT, TASK_PROVIDER_REQUEST_STARTED_EVENT, TASK_PROVIDER_STREAM_FAILED_EVENT, TASK_PROVIDER_STREAM_STARTED_EVENT, } from "./services/telemetry";
69
+ export { disableCurrentDirectoryExecutableSearch, NO_DEFAULT_CURRENT_DIRECTORY_IN_EXE_PATH_ENV, } from "./runtime/windows-exe-path";
70
+ export type { CaptureAgentUnexpectedReasoningTokensInput, CaptureSdkErrorInput, CaptureTaskLifecycleEventInput, CoreSpawnReason, ITelemetryService, OpenTelemetryClientConfig, SdkTelemetryErrorComponent, SdkTelemetryErrorSeverity, TelemetryArray, TelemetryMetadata, TelemetryObject, TelemetryPrimitive, TelemetryProperties, TelemetryValue, } from "./services/telemetry";
71
+ export { AGENT_UNEXPECTED_REASONING_TOKENS_EVENT, buildSdkErrorProperties, CORE_SPAWN_REASONS, captureAgentUnexpectedReasoningTokens, captureSdkError, captureTaskLifecycleEvent, isOtlpTraceRelayProvider, markOtlpTraceRelayProvider, normalizeSdkError, OTLP_TRACE_RELAY_MARKER, resetSdkErrorRateLimiterForTests, SDK_ERROR_TELEMETRY_EVENT, TASK_CANCELLED_EVENT, TASK_FIRST_CHUNK_RECEIVED_EVENT, TASK_PROVIDER_REQUEST_STARTED_EVENT, TASK_PROVIDER_STREAM_FAILED_EVENT, TASK_PROVIDER_STREAM_STARTED_EVENT, } from "./services/telemetry";
69
72
  export type { ClineTelemetryServiceConfig } from "./services/telemetry-config";
70
73
  export { createClineTelemetryServiceConfig, createClineTelemetryServiceMetadata, } from "./services/telemetry-config";
71
74
  export type { HookSessionContext, HookSessionContextLookup, HookSessionContextProvider, } from "./session/hook-context";