@cline/shared 0.0.85 → 0.0.86-nightly.1790389788
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/agents/types.d.ts +2 -0
- package/dist/index.browser.d.ts +3 -2
- package/dist/index.browser.js +24 -19
- package/dist/index.d.ts +6 -2
- package/dist/index.js +53 -48
- package/dist/llms/gateway.d.ts +1 -1
- package/dist/llms/model-info.d.ts +10 -0
- package/dist/llms/transcription.d.ts +13 -0
- package/dist/parse/path.d.ts +14 -0
- package/dist/prompt/cline.d.ts +3 -6
- package/dist/prompt/system/yolo.d.ts +1 -1
- package/dist/runtime/bun-embedded-path.d.ts +6 -0
- package/dist/runtime/loopback-proxy-bypass.d.ts +16 -0
- package/dist/services/telemetry.d.ts +1 -0
- package/package.json +1 -1
package/dist/index.browser.js
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
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}">
|
|
1
|
+
import{z as J}from"zod";import{z as L}from"zod";import{z as M}from"zod";var Vf=["none","minimal","low","medium","high","xhigh","max"],Mf=M.enum(Vf),Wf=Mf.exclude(["none"]),B6=M.enum([...Vf,"default"]).nullable(),yf=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 b0=L.enum(["default","openai-responses","r1"]),A6={DEFAULT:"default",OPENAI_RESPONSES:"openai-responses",R1:"r1"},M0=L.enum(["images","video","tools","streaming","prompt-cache","reasoning","reasoning-effort","computer-use","global-endpoint","structured_output","temperature","files"]),y0=L.enum(["active","preview","deprecated","legacy"]),T0=L.object({input:L.number().optional(),output:L.number().optional(),cacheWrite:L.number().optional(),cacheRead:L.number().optional()}),E0=L.object({maxBudget:L.number().optional(),outputPrice:L.number().optional(),thinkingLevel:L.enum(["low","high"]).optional()}),S0=L.object({reasoningDefaultOn:L.boolean().optional(),apiProtocol:L.enum(["openai-chat","openai-responses","anthropic","gemini"]).optional()}).catchall(L.unknown()),Tf=L.enum(["text","image","audio","video","pdf"]),g0=L.object({input:L.array(Tf),output:L.array(Tf)});function v0(f){return(f?.input===void 0||f.input.includes("text"))&&(f?.output===void 0||f.output.includes("text"))}var n0=L.enum(["language","image-generation","speech-generation","video-generation","transcription","realtime"]);function N6(f){let $=f.modalities?.input,w=f.modalities?.output;return $?.length===1&&$[0]==="audio"&&w?.length===1&&w[0]==="text"}function C6(f){return(f.operation===void 0||f.operation==="language")&&v0(f.modalities)}var h0=L.enum(["batch","streaming"]);function b6(f){return f.modalities?.input.includes("text")===!0&&f.modalities.output.includes("image")}function M6(f){return f.operation==="image-generation"}function Ef(f,$,w){let Y=f.capabilities;if(Y===void 0||Y.length===0)return w?.assumeWhenUnspecified??!1;return Y.includes($)}function y6(f){return Ef(f,"tools",{assumeWhenUnspecified:!0})}function T6(f){return Ef(f,"images",{assumeWhenUnspecified:!0})}var _f=L.object({id:L.string(),name:L.string().optional(),description:L.string().optional(),maxTokens:L.number().optional(),contextWindow:L.number().optional(),maxInputTokens:L.number().optional(),capabilities:L.array(M0).optional(),operation:n0.optional(),operationModes:L.array(h0).optional(),modalities:g0.optional(),reasoningOptions:L.array(yf).optional(),apiFormat:b0.optional(),systemRole:L.enum(["system","developer"]).optional(),temperature:L.number().optional(),pricing:T0.optional(),thinkingConfig:E0.optional(),status:y0.optional(),deprecationNotice:L.string().optional(),replacedBy:L.string().optional(),releaseDate:L.string().optional(),deprecationDate:L.string().optional(),family:L.string().optional(),metadata:S0.optional()});import{z as g}from"zod";var E6="This tool call was rejected by the user and not executed.",S6="NOT a tool or system failure. Clarify with user before proceeding.",Sf=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 g6=J.enum(["completed","max_iterations","aborted","mistake_limit","error"]),v6=J.object({inputTokens:J.number(),outputTokens:J.number(),cacheReadTokens:J.number().optional(),cacheWriteTokens:J.number().optional(),totalCost:J.number().optional()}),s4=J.object({text:J.string(),usage:v6,messages:J.array(J.custom()),toolCalls:J.array(Sf),iterations:J.number(),finishReason:g6,model:J.object({id:J.string(),provider:J.string(),info:_f.optional()}),startedAt:J.date(),endedAt:J.date(),durationMs:J.number()}),i4=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(),_f).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:Wf.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 x0=_.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"]),z0=_.object({id:_.string().optional(),label:_.string().optional(),role:_.string().optional(),participantKey:_.string().optional(),participantLabel:_.string().optional(),platformUserId:_.string().optional(),metadata:_.record(_.string(),_.unknown()).optional()}),c0=_.object({source:_.string(),sourceEvent:_.string(),threadId:_.string(),channelId:_.string(),isDM:_.boolean(),sessionId:_.string().optional(),workspaceRoot:_.string().optional(),metadata:_.record(_.string(),_.unknown()).optional()}),n6=_.object({actor:z0,context:c0,payload:_.record(_.string(),_.unknown()).optional()}),h6=_.object({action:_.enum(["allow","deny"]).default("allow"),message:_.string().optional(),reason:_.string().optional(),metadata:_.record(_.string(),_.unknown()).optional()}),x6=_.object({adapter:_.string(),botUserName:_.string().optional(),event:x0,payload:_.record(_.string(),_.unknown()),ts:_.string()});var u0=[{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 o0(){return u0.map((f)=>({...f}))}function z6(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 c6(f=l0){let $=new Set(o0().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 u6(f){return/^\d+$/.test(f)?void 0:"Telegram user ID must contain digits only"}function o6(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 l6(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 l0=[{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:u6}],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:o6},{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:l6}],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 m6=["hooks","tools","commands","rules","skills","messageBuilders","providers","automationEvents","mcp"],d6=new Set(m6);function p0(f,$){return f.name||`extension_${String($).padStart(4,"0")}`}function m0(f){return Array.isArray(f)&&f.every(($)=>typeof $==="string")}function d0(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 r0(f){let $=d0(f.providerIds),w=d0(f.modelIds);return{...f,...$?{providerIds:$}:{},...w?{modelIds:w}:{}}}function p6(f,$){let w=p0(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 H of Y.capabilities){if(!d6.has(H))throw Error(`Invalid manifest for extension "${w}": unsupported capability "${String(H)}"`);q.add(H)}if(Object.hasOwn(Y,"providerIds")&&!m0(Y.providerIds))throw Error(`Invalid manifest for extension "${w}": providerIds must be a string array when provided`);if(Object.hasOwn(Y,"modelIds")&&!m0(Y.modelIds))throw Error(`Invalid manifest for extension "${w}": modelIds must be a string array when provided`);let X=q.has("hooks");if(f.hooks!==void 0&&!X)throw Error(`Invalid manifest for extension "${w}": runtime hooks require the "hooks" capability`);return{capabilities:q,raw:r0(Y)}}function r6(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 gf{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:p6(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 X=p0(q,Y.order),G={tools:[],commands:[],rules:[],messageBuilder:[],providers:[],automationEventTypes:[],mcpServers:[]},H={registerTool:(V)=>G.tools.push(V),registerCommand:(V)=>G.commands.push(V),registerRule:(V)=>{if(!Y.manifest.capabilities.has("rules"))throw Error(`Invalid setup for extension "${X}": registerRule requires the "rules" capability`);G.rules.push(V)},registerMessageBuilder:(V)=>G.messageBuilder.push(V),registerProvider:(V)=>G.providers.push(V),registerAutomationEventType:(V)=>{if(!Y.manifest.capabilities.has("automationEvents"))throw Error(`Invalid setup for extension "${X}": registerAutomationEventType requires the "automationEvents" capability`);G.automationEventTypes.push(r6(V,X))},registerMcpServer:(V)=>{if(!Y.manifest.capabilities.has("mcp"))throw Error(`Invalid setup for extension "${X}": registerMcpServer requires the "mcp" capability`);G.mcpServers.push({...V,metadata:{...V.metadata??{},source:"plugin",plugin:X}})}},R=Y.manifest.capabilities.has("automationEvents")?this.setupContext:{...this.setupContext,automation:void 0};try{await q.setup?.(H,R),w.push(G)}catch(V){if(f.tolerateSetupErrors!==!0)throw V;$??=V}}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 s6(f={}){return new gf(f)}var i6=[".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"},a6={[a.CLINE_PASS]:!1,[a.CODE_CLOUD_AGENTS]:!1,[a.CODE_ONBOARDING_GITHUB]:!1,[a.CLINE_COMPOSIO_BETA]:!1},t6=Object.values(a);import{z as Q}from"zod";var s0=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()),e6=Q.object({toolName:Q.string(),parameters:l}),f$=Q.object({toolName:Q.string(),parameters:l,result:Q.string(),success:Q.boolean(),executionTimeMs:Q.number()}),$$=Q.object({prompt:Q.string(),attachments:Q.array(Q.string())}),w$=Q.object({taskMetadata:l}),Y$=Q.object({taskMetadata:l,previousState:l}),Z$=Q.object({taskMetadata:l}),q$=Q.object({taskMetadata:l}),J$=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()}),i0=Q.object({clineVersion:Q.string(),hookName:s0,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:e6.optional(),postToolUse:f$.optional(),userPromptSubmit:$$.optional(),taskStart:w$.optional(),taskResume:Y$.optional(),taskCancel:Z$.optional(),taskComplete:q$.optional(),preCompact:J$.optional()}).passthrough();function K$(f){let $=i0.safeParse(f);if(!$.success)return;return $.data}var G3="v1",H3="v1",Q3="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 Ff(f){let $=/^v(\d+)$/.exec(f?.trim()??"");if(!$)return;return Number.parseInt($[1]??"",10)}function j3(f,$="v1"){let w=Ff(f.protocolVersion),Y=Ff($);if(w===void 0||Y===void 0)return{compatible:!1,reason:"missing_protocol"};let q=Ff(f.minClientProtocolVersion)??w,X=Ff(f.maxClientProtocolVersion)??w;return Y>=q&&Y<=X?{compatible:!0}:{compatible:!1,reason:"unsupported_protocol"}}var R3="approval.respond",V3="0",W3="__hubScheduleRunAt",a0=["act","plan","yolo"];function X$(f){return a0.some(($)=>$===f)}function _3(f,$){if(!f||!Object.hasOwn(f,"mode"))return $;let w=f.mode;if(X$(w))return w;throw Error(`mode must be one of: ${a0.join(", ")}`)}var G$=30000,F3=5000;function H$(f){switch(f){case"run.start":case"session.send_input":return null;default:return G$}}function D3(f,$){return $===void 0?H$(f):$}var Q$=["readFile","search","bash","webFetch","editor","applyPatch","skills","askQuestion","submit"],k$=new Set(Q$);function L3(f){return typeof f==="string"&&k$.has(f)}var U3="tool_executor.",I3="custom_tool.",P3="hook.",O3="compaction.compact",B3="checkpoint.create",A3="mistake_limit.decide",N3="user_instructions.snapshot";function C3(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 vf(f,$){return`<file_content path="${f}">
|
|
2
2
|
${$}
|
|
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
|
|
5
|
-
+`.includes(f)}function
|
|
6
|
-
+`.includes(f)}function
|
|
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
|
|
8
|
-
`,r:"\r",t:"\t"};function
|
|
9
|
-
`)$++;return!0}return!1}function k
|
|
3
|
+
</file_content>`}function j$(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 W$(){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 F$(f,$){return new RegExp(`${$}="([^"]+)"`,"i").exec(f)?.[1]?.trim()||void 0}function t0(f){if(!f?.trim())return;let $=_$(f,"user_command");if(!$)return;let w=F$($.attrs,"slash");if(!w)return;return{slash:w,content:$.content.trim()}}function e0(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 D$(f,"mode_notice").trim()}function D$(f,$){let w=`<${$}>`,Y=`</${$}>`,q=f,X=q.indexOf(w);while(X!==-1){let G=q.indexOf(Y,X+w.length);if(G===-1)break;q=q.slice(0,X)+q.slice(G+Y.length),X=q.indexOf(w,X)}return q}function nf(f){let $=f1(e0(f)),w=t0(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(nf(f),$1)}function U$(f,$){let w=$?.trim()??"",Y=f.toLowerCase(),q=Y==="user"||Y==="session"?nf(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 K1(f){if(f.startsWith("image/"))return"image";if(f.startsWith("audio/"))return"audio";if(f.startsWith("video/"))return"video";return"file"}var X1=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)=>K1(f.mediaType)===f.modality,{message:"Generated media modality must match its media type",path:["modality"]});function I$(f){return X1.safeParse(f).success}function P$(f){return K1(f)}var Lf=["image/png","image/jpeg","image/gif","image/webp"],hf=5242880,v=hf,x=6291456,G1=8388608;function O$(f){return f.length}function xf(f){let $=f.endsWith("==")?2:f.endsWith("=")?1:0;return Math.floor(f.length*3/4)-$}function B$(f=hf){return Math.floor(f*3/4)}function zf(f){return Math.ceil(f/3)*4}function cf(f={}){return{maxImageEncodedBytes:f.maxImageEncodedBytes??v,maxImageDecodedBytes:f.maxImageDecodedBytes??x,maxTotalMediaBytes:f.maxTotalMediaBytes??G1}}function Uf(){return{totalEncodedBytes:0,keptImages:0,omittedImages:0,omittedReasons:{}}}function Df(f,$){f.omittedImages+=1,f.omittedReasons[$]=(f.omittedReasons[$]??0)+1}function Kf(f,$,w,Y){let q=cf(w);if(f>q.maxImageEncodedBytes){let X={ok:!1,reason:"encoded_limit",message:`Image media exceeds the ${q.maxImageEncodedBytes} byte encoded limit`};return Df(Y,X.reason),X}if($>q.maxImageDecodedBytes){let X={ok:!1,reason:"decoded_limit",message:`Image media exceeds the ${q.maxImageDecodedBytes} byte decoded limit`};return Df(Y,X.reason),X}if(Y.totalEncodedBytes+f>q.maxTotalMediaBytes){let X={ok:!1,reason:"total_limit",message:`Image media exceeds the ${q.maxTotalMediaBytes} byte total media limit`};return Df(Y,X.reason),X}return Y.totalEncodedBytes+=f,Y.keptImages+=1,null}function H1(f){return f>=65&&f<=90||f>=97&&f<=122||f>=48&&f<=57||f===43||f===47}function A$(f){return f.length>0&&uf(f,0,f.length)}function N$(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 X=cf($);if(w.totalEncodedBytes+q>X.maxTotalMediaBytes)return{ok:!1,reason:"total_limit",message:`Generated media exceeds the ${X.maxTotalMediaBytes} byte total media limit`};if(!uf(f,Y.start,Y.end))return{ok:!1,reason:"invalid_base64",message:"Generated media must contain valid base64"};let G=f.slice(Y.start,Y.end);return w.totalEncodedBytes+=q,{ok:!0,base64:G,encodedBytes:q,decodedBytes:xf(G)}}function uf(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 X=$;X<q;X++)if(!H1(f.charCodeAt(X)))return!1;for(let X=q;X<w;X++)if(f.charCodeAt(X)!==61)return!1;return!0}function C$(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(!C$(f,$,w))return;let Y=$+5,q=f.indexOf(",",Y);if(q===-1||q>=w)return;if(q-Y>128)return;let X=f.slice(Y,q).toLowerCase(),G=";base64";if(!X.endsWith(G))return;let H=X.slice(0,-G.length);if(!H||H.includes(";"))return;return{mediaType:H,base64Start:q+1,base64End:w}}function k1(f,$,w={}){let Y=w.maxEncodedBytes??v,q=w.maxDecodedBytes??x,X=new Set(w.supportedMediaTypes??Lf),G=f?.toLowerCase(),H=Q1($),R=H.start,V=H.end,F=b$($,H.start,H.end);if(F){if(G&&G!==F.mediaType)return{ok:!1,reason:"media_type_mismatch",message:`Image media type ${f} does not match data URL type ${F.mediaType}`};G=F.mediaType,R=F.base64Start,V=F.base64End}if(!G||!X.has(G))return{ok:!1,reason:"unsupported_media_type",message:`Unsupported image media type: ${f??"unknown"}`};let D=V-R;if(D===0)return{ok:!1,reason:"invalid_base64",message:"Image media must contain valid base64"};if(D>Y)return{ok:!1,reason:"encoded_limit",message:`Image media exceeds the ${Y} byte encoded limit`};if(!uf($,R,V))return{ok:!1,reason:"invalid_base64",message:"Image media must contain valid base64"};let U=$.slice(R,V),C=xf(U);if(C>q)return{ok:!1,reason:"decoded_limit",message:`Image media exceeds the ${q} byte decoded limit`};return{ok:!0,mediaType:G,base64:U,encodedBytes:D,decodedBytes:C}}function Xf(f,$,w,Y){let q=k1(f,$,{maxEncodedBytes:w.maxImageEncodedBytes,maxDecodedBytes:w.maxImageDecodedBytes});if(!q.ok)return Df(Y,q.reason),q;let X=Kf(q.encodedBytes,q.decodedBytes,w,Y);if(X)return X;return q}function y(f){return f.replace(/[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?<![\uD800-\uDBFF])[\uDC00-\uDFFF]/g,"�")}var Gf="ERROR: EMPTY CONTENT",M$="[image attached]",y$="[generated image]";function T$(f){return`[generated ${f}]`}function If(f){return{type:"text",text:`[generated ${f.modality} unavailable to this model]`}}function of(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:t}}function j1(f){return Kf(v,0,{maxImageEncodedBytes:v,maxImageDecodedBytes:x},f)===null}function V1(f){try{return new URL(f).protocol}catch{return}}function lf(f,$){let w=Xf(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 ff(f,$){return{type:"file",data:f,mediaType:$??"image"}}function mf(f,$){if(f.image instanceof URL){if(f.image.protocol==="data:"){let G=Xf(f.mediaType,f.image.href,{maxImageEncodedBytes:v,maxImageDecodedBytes:x},$);if(!G.ok)return m();return ff(`data:${G.mediaType};base64,${G.base64}`,G.mediaType)}if(f.image.protocol!=="http:"&&f.image.protocol!=="https:")return m();if(!j1($))return m();return ff(f.image,f.mediaType)}if(typeof f.image==="string"){let G=V1(f.image);if(G==="http:"||G==="https:"){if(!j1($))return m();return ff(f.image,f.mediaType)}let H=G==="data:",R=Xf(f.mediaType??(H?void 0:"image/png"),f.image,{maxImageEncodedBytes:v,maxImageDecodedBytes:x},$);if(!R.ok)return m();return ff(H?`data:${R.mediaType};base64,${R.base64}`:R.base64,R.mediaType)}let w=f.image.byteLength,Y=zf(w),q=f.mediaType?.toLowerCase()??"image/png";if(!Lf.includes(q)||Kf(Y,w,{maxImageEncodedBytes:v,maxImageDecodedBytes:x},$))return m();return ff(f.image,q)}function S$(f,$){if(!$)return!0;if(f.modality==="file")return f.mediaType==="application/pdf"&&$.includes("pdf");return $.includes(f.modality)}function R1(f,$,w){if(!S$(f,w))return If(f);if(f.modality==="image"){if(f.source.type==="artifact")return If(f);return mf({type:"image",image:f.source.type==="url"?f.source.url:f.source.data,mediaType:f.mediaType},$)}if(f.source.type==="artifact")return If(f);if(f.source.type==="url"){let Y=V1(f.source.url);if(Y!=="http:"&&Y!=="https:"&&Y!=="data:")return If(f)}return ff(f.source.type==="url"?f.source.url:f.source.data,f.mediaType)}function df(f,$,w,Y){let{hoistImages:q,inlineImagePlaceholder:X}=Y;if(f==null||typeof f!=="object")return{value:f,changed:!1,mediaChanged:!1};if(Array.isArray(f)){let F=[],D=!1,U=!1;for(let C of f){if(C&&typeof C==="object"){let W=C;if(W.type==="image"&&typeof W.data==="string"&&typeof W.mediaType==="string"){if(!q){F.push(X),D=!0,U=!0;continue}let Nf={type:"image",data:W.data,mediaType:W.mediaType},p=lf(Nf,w);if(p.type==="file")$.push({type:"image",data:p.data.data,mediaType:p.mediaType});else F.push(p.text);D=!0,U=!0;continue}if(W.type==="image"){F.push(t),D=!0,U=!0;continue}if(W.type==="text"&&typeof W.text==="string"){F.push(W.text),D=!0;continue}}let b=df(C,$,w,Y);F.push(b.value),D||=b.changed,U||=b.mediaChanged}return{value:D?F:f,changed:D,mediaChanged:U}}let G=f;if(G.type==="image"){if(typeof G.data==="string"&&typeof G.mediaType==="string"){if(!q)return{value:X,changed:!0,mediaChanged:!0};let F={type:"image",data:G.data,mediaType:G.mediaType},D=lf(F,w);if(D.type==="file")return $.push({type:"image",data:D.data.data,mediaType:D.mediaType}),{value:M$,changed:!0,mediaChanged:!0};return{value:D.text,changed:!0,mediaChanged:!0}}return{value:t,changed:!0,mediaChanged:!0}}let H={},R=!1,V=!1;for(let[F,D]of Object.entries(G)){let U=df(D,$,w,Y);H[F]=U.value,R||=U.changed,V||=U.mediaChanged}return{value:R?H:f,changed:R,mediaChanged:V}}function Hf(f){if(typeof f==="string")return y(f);if(Array.isArray(f))return f.map(($)=>Hf($));if(f!==null&&typeof f==="object"){let $=f,w={};for(let[Y,q]of Object.entries($))w[Y]=Hf(q);return w}return f}function _1(f,$=!1,w=Uf(),Y){let q=Y?.supportsImages??!0;if(typeof f==="string")return{type:$?"error-text":"text",value:y(f)};if(!$&&E$(f))return{type:"content",value:f.map((X)=>X.type==="image"?q?lf(X,w):{type:"text",text:e}:{type:"text",text:y(X.text)})};if(f!==null&&typeof f==="object"){let X=[],G=df(f,X,w,{hoistImages:!$&&q,inlineImagePlaceholder:q?t:e});if(!$&&X.length>0)return{type:"content",value:[{type:"text",text:typeof G.value==="string"?y(G.value):JSON.stringify(Hf(G.value))},...X.map((R)=>W1(R.data,R.mediaType))]};if(G.mediaChanged)return{type:$?"error-json":"json",value:Hf(G.value)}}if(f===null||typeof f==="boolean"||typeof f==="number"||typeof f==="object")return{type:$?"error-json":"json",value:Hf(f)};return{type:$?"error-text":"text",value:y(String(f))}}function g$(f,$,w){let Y=w?.assistantToolCallArgKey??"input",q=w?.supportedInputModalities,X=!q||q.includes("image"),G=[],H=Uf(),R=[],V=()=>{return R.splice(0).map((D)=>D.type==="image"?X?mf(D,H):{type:"text",text:e}:R1(D.media,H,q))};if(typeof f==="string"&&f.trim().length>0||Array.isArray(f)&&f.length>0)G.push({role:"system",content:typeof f==="string"?y(f):f});for(let F of $){let D=F.content;if(typeof D==="string"){let W=F.role==="user"&&R.length>0?V():[];if(W.length>0){G.push({role:F.role,content:[{type:"text",text:D.trim().length>0?y(D):Gf},...W]});continue}if(D.trim().length===0){G.push({role:F.role,content:[{type:"text",text:Gf}]});continue}G.push({role:F.role,content:y(D)});continue}let U=[],C=[];if(D.length===0){G.push({role:F.role,content:[{type:"text",text:Gf}]});continue}for(let W of D)switch(W.type){case"text":U.push({type:"text",text:y(W.text),...W.providerOptions?{providerOptions:W.providerOptions}:{}});break;case"reasoning":U.push({type:"reasoning",text:y(W.text),...W.providerOptions?{providerOptions:W.providerOptions}:{}});break;case"image":if(F.role==="assistant")R.push(W),U.push({type:"text",text:y$});else U.push(X?mf(W,H):{type:"text",text:e});break;case"media":if(F.role==="assistant")R.push(W),U.push({type:"text",text:T$(W.media.modality)});else U.push(R1(W.media,H,q));break;case"file":U.push({type:"text",text:vf(W.path,y(W.content))});break;case"tool-call":if(F.role==="assistant")U.push({type:"tool-call",toolCallId:W.toolCallId,toolName:W.toolName,[Y]:W.input,...W.providerOptions?{providerOptions:W.providerOptions}:{}});break;case"tool-result":{C.push({type:"tool-result",toolCallId:W.toolCallId,toolName:W.toolName,output:_1(W.output,W.isError??!1,H,{supportsImages:X})});break}}let b=C.length>0;if(F.role==="user"&&!b&&R.length>0)U.push(...V());if(U.length>0&&U.every((W)=>W.type==="text"&&typeof W.text==="string"&&W.text.trim().length===0))U.splice(0,U.length,{type:"text",text:Gf});if(U.length>0)of(G,{role:F.role,content:U});if(b)of(G,{role:"tool",content:C})}if(R.length>0)of(G,{role:"user",content:V()});return G}var v3=["show","hide","subscription"];function F1(f){return typeof f==="object"&&f!==null&&!Array.isArray(f)}function v$(f,$){if(!f&&!$)return;let w=f?.metadata,Y=$?.metadata,q={...f??{},...$??{}};if(F1(w)&&F1(Y))q.metadata={...w,...Y};return q}var x3=["web_search","image_generation"],z3=["web_search"];var Qf={max:1,xhigh:0.95,high:0.8,medium:0.5,low:0.2,minimal:0.1,none:0},n$=void 0;function h$(f,$){if(typeof f==="string"&&f.toLowerCase()in Qf)return f.toLowerCase();return $?void 0:void 0}function D1(f,$){let w=typeof f==="string"?f.toLowerCase():void 0;if(w&&w in Qf)return Qf[w];if($?.fallbackEffort)return Qf[$.fallbackEffort];return}function x$(f){let $=D1(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 z$(f){return f instanceof Error?{name:f.name,message:f.message}:f}var c$=3;function L1(f){return Math.max(1,Math.ceil(f/3))}function pf(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 u$(f){let $;try{$=JSON.stringify({systemPrompt:f.systemPrompt,messages:f.messages,tools:f.tools})}catch{$=[pf(f.systemPrompt),pf(f.messages),pf(f.tools)].join(`
|
|
4
|
+
`)}return L1($.length)}var o$={debug:()=>{},log:()=>{},error:()=>{}};var d3=60,p3=1,r3=3600;function l$(f){return typeof f==="number"&&Number.isFinite(f)}function m$(f){return Math.min(Math.max(f,1),3600)}function s3(f){if(!l$(f))return 60;return m$(f)}function i3(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 d$(f){if(f instanceof Error)return f.message;return String(f)}function p$(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 U1(f){return/^[0-9A-Fa-f]$/.test(f)}function c(f){return f>="0"&&f<="9"}function I1(f){return f>=" "}function wf(f){return`,:[]/{}()
|
|
5
|
+
+`.includes(f)}function rf(f){return f>="a"&&f<="z"||f>="A"&&f<="Z"||f==="_"||f==="$"}function Pf(f){return f>="a"&&f<="z"||f>="A"&&f<="Z"||f==="_"||f==="$"||f>="0"&&f<="9"}var sf=/^(http|https|ftp|mailto|file|data|irc):\/\/$/,af=/^[A-Za-z0-9-._~:/?#@!$&'()*+;=]$/;function tf(f){return`,[]/{}
|
|
6
|
+
+`.includes(f)}function ef(f){return Yf(f)||r$.test(f)}var r$=/^[[{\w-]$/;function f0(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 Yf(f){return $0(f)||Of(f)}function $0(f){return f==='"'||f==="“"||f==="”"}function w0(f){return f==='"'}function Of(f){return f==="'"||f==="‘"||f==="’"||f==="`"||f==="´"}function Y0(f){return f==="'"}function Zf(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 T(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 s$={""":'"',"&":"&","<":"<",">":">","'":"'"},Z0=12;function q0(f){if(f.charAt(0)!=="&")return null;let $=f.indexOf(";");if($===-1)return null;let w=f.substring(0,$+1),Y=s$[w];if(Y!==void 0)return{char:Y,length:w.length};if(f.charAt(1)==="#"){let q=f.substring(2,$),X=q.charAt(0)==="x"||q.charAt(0)==="X",G=X?q.substring(1):q;if(G.length>0){let H=Number.parseInt(G,X?16:10);if(!Number.isNaN(H)&&H>=0&&H<=1114111)return{char:String.fromCodePoint(H),length:w.length}}}return null}function N1(f){return f!==null&&f.char==='"'}function C1(f){return f!==null&&f.char==="'"}function $f(f,$){let w=0;for(let Y=0;Y<f.length;Y++)if(f.charAt(Y)===$)w++;return w}function b1(f,$){switch($){case")":return $f(f,"(")>$f(f,")");case"]":return $f(f,"[")>$f(f,"]");case"}":return $f(f,"{")>$f(f,"}");default:return!1}}var M1={"\b":"\\b","\f":"\\f","\n":"\\n","\r":"\\r","\t":"\\t"},i$={'"':'"',"\\":"\\","/":"/",b:"\b",f:"\f",n:`
|
|
8
|
+
`,r:"\r",t:"\t"};function J0(f){let $=0,w="";if(V(["```","[```","{```"]),!X())I6();V(["```","```]","```}"]);let q=D(",");if(q)G();if(ef(f[$])&&A1(w)){if(!q)w=T(w,",");p()}else if(q)w=Zf(w,",");while(f[$]==="}"||f[$]==="]")$++,G();if($>=f.length)return w;Cf();function X(){G();let k=W()||Nf()||r()||B()||F6()||P0(!1)||D6();return G(),k}function G(){let k=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0,j=$,I=H(k);do if(I=R(),I)I=H(k);while(I);return $>j}function H(k){let j=k?z:P1,I="";while(!0)if(j(f,$))I+=f[$],$++;else if(O1(f,$))I+=" ",$++;else break;if(I.length>0)return w+=I,!0;return!1}function R(){if(f[$]==="/"&&f[$+1]==="*"){while($<f.length&&!a$(f,$))$++;return $+=2,!0}if(f[$]==="/"&&f[$+1]==="/"){while($<f.length&&f[$]!==`
|
|
9
|
+
`)$++;return!0}return!1}function V(k){if(F(k)){if(rf(f[$]))while($<f.length&&Pf(f[$]))$++;return G(),!0}return!1}function F(k){H(!0);for(let j of k){let I=$+j.length;if(f.slice($,I)===j)return $=I,!0}return!1}function D(k){if(f[$]===k)return w+=f[$],$++,!0;return!1}function U(k){if(f[$]===k)return $++,!0;return!1}function C(){return U("\\")}function b(){if(G(),f[$]==="."&&f[$+1]==="."&&f[$+2]===".")return $+=3,G(),U(","),!0;return!1}function W(){if(f[$]==="{"){if(w+="{",$++,G(),U(","))G();let k=!0;while($<f.length&&f[$]!=="}"){let j;if(!k){if(j=D(","),!j)w=T(w,",");G()}else j=!0;if(b(),!(r()||P0(!0))){if(f[$]==="}"||f[$]==="{"||f[$]==="]"||f[$]==="["||f[$]===void 0){if(!k)w=Zf(w,",")}else P6();break}G();let n=D(":"),i=$>=f.length;if(!n)if(ef(f[$])||i)w=T(w,":");else A0();if(!X())if(n||i)w+="null";else A0();k=!1}if(f[$]==="}")w+="}",$++;else w=T(w,"}");return!0}return!1}function Nf(){if(f[$]==="["){if(w+="[",$++,G(),U(","))G();let k=!0;while($<f.length&&f[$]!=="]"){if(!k){if(!D(","))w=T(w,",")}if(b(),!X()){if(!k)w=Zf(w,",");break}k=!1}if(f[$]==="]")w+="]",$++;else w=T(w,"]");return!0}return!1}function p(){let k=!0,j=!0;while(j){if(!k){if(!D(","))w=T(w,",")}else k=!1;j=X()}if(!j)w=Zf(w,",");w=`[
|
|
10
10
|
${w}
|
|
11
|
-
]`}function r(){let
|
|
12
|
-
`)P+="\\n",$+=2;else P+=A,$+=2}else{let A=f.charAt($);if(A==='"'&&f[$-1]!=="\\")P+=`\\${A}`,$++;else if(
|
|
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+=
|
|
11
|
+
]`}function r(){let k=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,j=arguments.length>1&&arguments[1]!==void 0?arguments[1]:-1,I=f[$]==="\\";if(I){if($++,!Yf(f[$]))Cf()}let n=f[$]==="&"?q0(f.slice($,$+Z0)):null,i=N1(n)||C1(n);if(Yf(f[$])||i){let N0=w0(f[$])?w0:Y0(f[$])?Y0:Of(f[$])?Of:$0,jf=$,Rf=w.length,P='"';$+=i&&n?n.length:1;while(!0){if($>=f.length){let A=O0($-1);if(!k&&wf(f.charAt(A)))return $=jf,w=w.substring(0,Rf),r(!0);return P=T(P,'"'),w+=P,!0}if($===j)return P=T(P,'"'),w+=P,!0;let h=i&&f[$]==="&"?q0(f.slice($,$+Z0)):null;if(h&&n?h.char===n.char:N0(f[$])){let A=$,bf=P.length;if(P+='"',$+=h?h.length:1,w+=P,G(!1),k||$>=f.length||wf(f[$])&&!b1(P,f[$])||Yf(f[$])&&!L6($)||c(f[$]))return I0(),!0;if(f[$]==="\\")Cf();let u=O0(A-1),C0=f.charAt(u);if(C0===",")return $=jf,w=w.substring(0,Rf),r(!1,u);if(wf(C0))return $=jf,w=w.substring(0,Rf),r(!0);w=w.substring(0,Rf),$=A+(h?h.length:1),P=`${P.substring(0,bf)}\\${P.substring(bf)}`}else if(k&&tf(f[$])){if(f[$-1]===":"&&sf.test(f.substring(jf+1,$+2)))while($<f.length&&af.test(f[$]))P+=f[$],$++;return P=T(P,'"'),w+=P,I0(),!0}else if(h){let A=h.char;if(A==='"')P+="\\\"";else if(f0(A))P+=M1[A];else P+=A;$+=h.length}else if(f[$]==="\\"){let A=f.charAt($+1);if(i$[A]!==void 0)P+=f.slice($,$+2),$+=2;else if(A==="u"){let u=2;while(u<6&&U1(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(f0(A))P+=M1[A],$++;else{if(!I1(A))U6(A);P+=A,$++}}if(I)C()}}return!1}function I0(){let k=!1;G();while(f[$]==="+"){k=!0,$++,G(),w=Zf(w,'"',!0);let j=w.length;if(r())w=B1(w,j,1);else w=T(w,'"')}return k}function B(){let k=$,j="",I=!1;if(f[$]==="-"){if(j+=f[$],$++,!c(f[$])&&B0())j+="0"}if(f[$]==="0"&&c(f[$+1]))I=!0;while(c(f[$]))j+=f[$],$++;if(f[$]==="."){if(j===""||j==="-")j+="0";if(j+=f[$],$++,!c(f[$]))j+="0";while(c(f[$]))j+=f[$],$++}if($>k){if(f[$]==="e"||f[$]==="E"){if(j==="-")I=!0;if(j+=f[$],$++,f[$]==="-"||f[$]==="+")j+=f[$],$++;if(!c(f[$]))j+="0";while(c(f[$]))j+=f[$],$++}if(!B0())return $=k,!1;return w+=I?`"${f.substring(k,$)}"`:j,!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(k,j){if(f.slice($,$+k.length)===k&&!Pf(f[$+k.length]))return w+=j,$+=k.length,!0;return!1}function P0(k){let j=$;if(rf(f[$])){while($<f.length&&Pf(f[$]))$++;let I=$;while(z(f,I))I++;if(f[I]==="("){if($=I+1,X(),f[$]===")"){if($++,f[$]===";")$++}return!0}}while($<f.length&&!tf(f[$])&&!Yf(f[$])&&(!k||f[$]!==":"))$++;if(f[$-1]===":"&&sf.test(f.substring(j,$+2)))while($<f.length&&af.test(f[$]))$++;if($>j){while(z(f,$-1)&&$>0)$--;let I=f.slice(j,$);if(w+=I==="undefined"?"null":JSON.stringify(I),f[$]==='"')$++;return!0}}function D6(){if(f[$]==="/"){let k=$;$++;while($<f.length&&(f[$]!=="/"||f[$-1]==="\\"))$++;return $++,w+=JSON.stringify(f.substring(k,$)),!0}}function O0(k){let j=k;while(j>0&&z(f,j))j--;return j}function L6(k){let j=k+1;while(j<f.length&&z(f,j))j++;return j>=f.length||wf(f[j])}function B0(){return $>=f.length||wf(f[$])||z(f,$)}function U6(k){throw new o(`Invalid character ${JSON.stringify(k)}`,$)}function Cf(){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 A0(){throw new o("Colon expected",$)}function O6(){let k=f.slice($,$+6);throw new o(`Invalid unicode character "${k}"`,$)}}function a$(f,$){return f[$]==="*"&&f[$+1]==="/"}function t$(f){let $=!1,w=!1,Y=!1;for(let q=0;q<f.length;q+=1){let X=f[q];if(Y){Y=!1;continue}if(X==="\\"){Y=!0;continue}if(!w&&X==='"')$=!$;else if(!$&&X==="'")w=!w}return $||w}var e$=/^\{\s*"([A-Za-z0-9_.$-]+)"\s*:\s*([\s\S]+?)\s*\}$/;function f2(f){let $=f.match(e$);if(!$)return;let[,w,Y]=$,q=Y.trim();if(!q)return;let X=q[0];if(X==='"'||X==="{"||X==="["||q==="true"||q==="false"||q==="null"||Number.isFinite(Number(q)))return;return JSON.parse(`{"${w}":${JSON.stringify(q)}}`)}function $2(f){if(typeof f!=="string")return f;let $=f.trimStart();if($[0]!=="{"&&$[0]!=="[")return f;try{return JSON.parse($)}catch{}if(!t$($))try{return JSON.parse(J0($))}catch{}return f2($)??f}function w2(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 Y2(f){try{return JSON.parse(f)}catch{return}}function qf(f){return typeof f==="object"&&f!==null&&!Array.isArray(f)}function Z2(f){let $=f.type;if(typeof $==="string")return[$];return Array.isArray($)?$.filter((w)=>typeof w==="string"):[]}function K0(f,$){if(Z2(f).includes($))return!0;for(let Y of["anyOf","oneOf","allOf"]){let q=f[Y];if(Array.isArray(q)&&q.some((X)=>qf(X)&&K0(X,$)))return!0}return!1}function q2(f,$){if(typeof f!=="string")return f;let w=f.trim(),Y=K0($,"array"),q=K0($,"object");if((!Y||!w.startsWith("["))&&(!q||!w.startsWith("{")))return f;try{let X=JSON.parse(w);if(Array.isArray(X))return Y?X:f;if(qf(X))return q?X:f;return f}catch{return f}}function X0(f,$){let w=q2(f,$);if(Array.isArray(w)){let G=$.items;if(!qf(G))return w;let H=!1,R=w.map((V)=>{let F=X0(V,G);return H||=F!==V,F});return H?R:w}if(!qf(w))return w;let Y=$.properties;if(!qf(Y))return w;let q=!1,X={...w};for(let[G,H]of Object.entries(Y)){if(!(G in w)||!qf(H))continue;let R=X0(w[G],H);if(R!==w[G])X[G]=R,q=!0}return q?X:w}function J2(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 K2(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,"/"),X=q.padEnd(q.length+(4-q.length%4)%4,"="),G=J2(X);return G?JSON.parse(G):null}catch{return null}}function X2(f){return Object.fromEntries(Object.entries(f).filter(([,$])=>$!==void 0))}function y1(f){let $=f.replaceAll("\\","/"),w=$.lastIndexOf("/");return(w>=0?$.slice(w+1):$).toLowerCase()}function G2(f){return f==="win32"?"powershell":"/bin/bash"}function H0(f){let $=y1(f);if(G0(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"]),Q2="-noprofile";function k2(f,$){let w="";for(let Y=0;Y<f.length;Y++){let q=f[Y];if(q==="`"&&Y+1<f.length){let X=f[Y+1];if(X==="u"&&$==="core"&&f[Y+2]==="{"){let G=f.indexOf("}",Y+3),H=G>Y+3?f.slice(Y+3,G):"",R=Number.parseInt(H,16);if(H.length<=6&&/^[0-9a-fA-F]+$/.test(H)&&R<=1114111){w+=String.fromCodePoint(R),Y=G;continue}}switch(X){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+=X}Y++;continue}if(q==='"'&&f[Y+1]==='"'){w+='"',Y++;continue}w+=q}return w}function j2(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 G0(f){let $=y1(f);if($==="powershell"||$==="powershell.exe")return"windows";if($==="pwsh"||$==="pwsh.exe")return"core";return}function R2(f,$){let w=j2(f);if(!w)return;let Y=(w.quote==="'"?w.body.replaceAll("''","'"):k2(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=G0($);if(!q||!G0(Y))return;let X=w[4],G=!1;for(;;){let H=/^(-[^\s=]+)[ \t]*([\S\s]*)$/.exec(X);if(!H)return;let R=H[1].toLowerCase();if(R==="-command"){let V=G?R2(H[2],q):void 0;return V===void 0?void 0:{executable:Y,script:V}}if(!H2.has(R))return;if(R===Q2)G=!0;X=H[2]}}function T1(f,$){switch(H0(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 W2(f,$){if(H0(f)==="powershell")return["-NoProfile","-NonInteractive","-Command",$];return T1(f,$).args}function _2(f){return f.toLowerCase().replace(/[^\w.-]+/g,"_")}function F2(f){let $=f?.trim();return $?$:void 0}function E1(f,$){if(f.length<=$)return f;return`${f.slice(0,$-1)}…`}function D2(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 I2(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 P2(f){let $=Math.max(0,Math.floor(f/1000)),w=Math.floor($/86400),Y=Math.floor($%86400/3600),q=Math.floor($%3600/60),X=$%60;if(w>0)return`${w}d ${Y}h`;if(Y>0)return`${Y}h ${q}m`;if(q>0)return`${q}m ${X}s`;return`${X}s`}import{z as S1}from"zod";function O2(f,$){let w=f.safeParse($);if(!w.success)throw Error(S1.prettifyError(w.error));return w.data}function Q0(f){return S1.toJSONSchema(f)}function k0(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
|
|
48
|
+
{{CLINE_METADATA}}`;var v1=`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
|
|
|
@@ -53,7 +53,12 @@ RULES:
|
|
|
53
53
|
- Always match output format exactly as shown in examples or existing files.
|
|
54
54
|
- Use only libraries and frameworks that are confirmed and compatible to be in use in the current codebase.
|
|
55
55
|
- Provide complete and functional code without omissions or placeholders.
|
|
56
|
-
-
|
|
56
|
+
- During thinking stage, show your planning process. Keep the plan to one short paragraph.
|
|
57
|
+
- Be proactive and avoid overthinking. Once the next action is clear, execute it. Do not seek perfect certainty, repeatedly compare alternatives, or revisit settled decisions without new evidence. Use focused tool calls to resolve uncertainty.
|
|
58
|
+
- If repeated fixes fail without new evidence, stop making similar edits. Test your assumptions with a focused check or minimal reproduction, then adjust your approach based on the result.
|
|
59
|
+
- Put complete code, commands, and edit payloads in the tool arguments. Do not draft them in full in your plan if you can execute them directly.
|
|
60
|
+
- Provide text response when it adds value: a brief plan summary for multi-step work, a meaningful progress update, concise task notes, a blocker, or the final result. Routine tool calls need no text preamble. Keep plan summaries and progress updates to one short paragraph, reporting decisions and new evidence rather than internal deliberation.
|
|
61
|
+
- Keep task notes focused on confirmed facts, decisions, and remaining work. Update existing notes when possible instead of repeating the task history.
|
|
57
62
|
- Always use absolute paths when referring to files.
|
|
58
63
|
- You can call multiple tools in a single response. Before using tools, identify every independent read, search, command, or edit needed for the next step and emit all of those tool calls now, either as multiple tool calls or as one batched input for tools that accept arrays. Do not wait for one independent result before requesting another. Do not split independent reads, searches, checks, or edits across separate turns.
|
|
59
64
|
- Good parallelism examples: read all known relevant files in one read_files call; run independent inspection commands in one run_commands call; emit independent read_files, search_codebase, and run_commands calls together in one response; emit multiple editor calls together when editing different files or non-overlapping regions.
|
|
@@ -79,7 +84,7 @@ IMPORTANT:
|
|
|
79
84
|
- 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
85
|
- Response without the submit_and_exit tool call will considered not completed and the task will continue.
|
|
81
86
|
{{CLINE_RULES}}
|
|
82
|
-
{{CLINE_METADATA}}`;var
|
|
87
|
+
{{CLINE_METADATA}}`;var j0={ACT:g1,YOLO:v1};var R0="# Workspace Configuration",h1=`# Plan / Act Modes
|
|
83
88
|
|
|
84
89
|
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
90
|
|
|
@@ -96,10 +101,10 @@ The run_commands tool remains available in plan mode strictly for read-only insp
|
|
|
96
101
|
|
|
97
102
|
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
103
|
|
|
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
|
|
100
|
-
${
|
|
101
|
-
${Y}`}function
|
|
104
|
+
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(R0))return w.trim();let Y=w||JSON.stringify({workspaces:{[f]:{hint:$||f.split("/").at(-1)||f}}},null,2);return`
|
|
105
|
+
${R0}
|
|
106
|
+
${Y}`}function B2(f){let{ide:$="Terminal Shell",mode:w,platform:Y="unknown",workspaceName:q,metadata:X,rules:G,overridePrompt:H,providerId:R,planModeSwitchTool:V=!0}=f,F=f.workspaceRoot??f.rootPath??"",D=k0(R||"");if(H?.trim()){let b=H.trim();if(D&&X?.trim()&&!b.includes(R0))return`${b}
|
|
102
107
|
|
|
103
|
-
${
|
|
108
|
+
${n1(F,q,X)}`.trim();return b}let U=w==="yolo"?j0.YOLO:j0.ACT,C=[G,w==="yolo"?void 0:h1,w==="plan"?V?z1:c1:void 0].filter(Boolean).join(`
|
|
104
109
|
|
|
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};
|
|
110
|
+
`);return U.replace("{{PLATFORM_NAME}}",Y).replace("{{CWD}}",F).replace("{{CURRENT_DATE}}",new Date().toLocaleDateString()).replace("{{IDE_NAME}}",$).replace("{{CLINE_METADATA}}",D?n1(F,q,X):"").replace("{{CLINE_RULES}}",C).trim()}var A2="anthropic/claude-sonnet-5";var N2="remote://";import{z as K}from"zod";var u1=K.object({id:K.string(),temperature:K.number().optional(),maxTokens:K.number().optional(),contextWindow:K.number().optional(),inputPrice:K.number().optional(),outputPrice:K.number().optional(),supportsImages:K.boolean().optional()}),o1=K.object({models:K.array(u1).optional(),openAiBaseUrl:K.string().optional(),openAiHeaders:K.record(K.string(),K.string()).optional(),azureApiVersion:K.string().optional(),azureIdentity:K.boolean().optional()}),l1=K.object({id:K.string(),thinkingBudgetTokens:K.number().optional()}),m1=K.object({name:K.string(),baseModelId:K.string(),thinkingBudgetTokens:K.number().optional()}),d1=K.object({models:K.array(l1).optional(),customModels:K.array(m1).optional(),awsRegion:K.string().optional(),awsUseCrossRegionInference:K.boolean().optional(),awsUseGlobalInference:K.boolean().optional(),awsBedrockUsePromptCache:K.boolean().optional(),awsBedrockEndpoint:K.string().optional()}),p1=K.object({id:K.string()}),r1=K.object({models:K.array(p1).optional()}),s1=K.object({id:K.string(),thinkingBudgetTokens:K.number().optional()}),i1=K.object({models:K.array(s1).optional(),vertexProjectId:K.string().optional(),vertexRegion:K.string().optional()}),a1=K.object({id:K.string(),thinkingBudgetTokens:K.number().optional(),promptCachingEnabled:K.boolean().optional()}),t1=K.object({models:K.array(a1).optional(),baseUrl:K.string().optional()}),e1=K.object({id:K.string(),thinkingBudgetTokens:K.number().optional()}),f6=K.object({models:K.array(e1).optional(),baseUrl:K.string().optional()}),C2=K.object({OpenAiCompatible:o1.optional(),AwsBedrock:d1.optional(),Cline:r1.optional(),Vertex:i1.optional(),LiteLLM:t1.optional(),Anthropic:f6.optional()}),$6=K.object({id:K.string()}),w6=K.object({name:K.string(),url:K.string(),alwaysEnabled:K.boolean().optional(),headers:K.record(K.string(),K.string()).optional()}),V0=K.object({alwaysEnabled:K.boolean(),name:K.string(),contents:K.string()}),Bf=K.object({bucket:K.string(),accessKeyId:K.string(),secretAccessKey:K.string(),region:K.string().optional(),endpoint:K.string().optional(),accountId:K.string().optional()}),Y6=K.object({enabled:K.boolean().optional(),type:K.union([K.literal("s3_access_keys"),K.literal("r2_access_keys"),K.literal("azure_access_keys")]).optional(),s3AccessSettings:Bf.optional(),r2AccessSettings:Bf.optional(),azureAccessSettings:Bf.optional()}),Z6=K.object({promptUploading:Y6.optional()}),b2=K.object({version:K.string(),providerSettings:C2.optional(),telemetryEnabled:K.boolean().optional(),kanbanEnabled:K.boolean().optional(),mcpMarketplaceEnabled:K.boolean().optional(),allowedMCPServers:K.array($6).optional(),remoteMCPServers:K.array(w6).optional(),blockPersonalRemoteMCPServers:K.boolean().optional(),yoloModeAllowed:K.boolean().optional(),openTelemetryEnabled:K.boolean().optional(),openTelemetryMetricsExporter:K.string().optional(),openTelemetryLogsExporter:K.string().optional(),openTelemetryOtlpProtocol:K.string().optional(),openTelemetryOtlpEndpoint:K.string().optional(),openTelemetryOtlpHeaders:K.record(K.string(),K.string()).optional(),openTelemetryOtlpMetricsProtocol:K.string().optional(),openTelemetryOtlpMetricsEndpoint:K.string().optional(),openTelemetryOtlpMetricsHeaders:K.record(K.string(),K.string()).optional(),openTelemetryOtlpLogsProtocol:K.string().optional(),openTelemetryOtlpLogsEndpoint:K.string().optional(),openTelemetryOtlpLogsHeaders:K.record(K.string(),K.string()).optional(),openTelemetryMetricExportInterval:K.number().optional(),openTelemetryOtlpInsecure:K.boolean().optional(),openTelemetryLogBatchSize:K.number().optional(),openTelemetryLogBatchTimeout:K.number().optional(),openTelemetryLogMaxQueueSize:K.number().optional(),enterpriseTelemetry:Z6.optional(),globalRules:K.array(V0).optional(),globalWorkflows:K.array(V0).optional()}),M2=K.record(K.string(),K.string());var y2=4317;var T2="127.0.0.1:4317";import W0 from"zod";var E2=W0.enum(["reasoning","prompt-cache","tools","provider-tools","oauth","temperature","files","streaming","vision","computer-use","local-auth","popular"]),S2=W0.enum(["anthropic","gemini","openai-chat","openai-responses","openai-r1","ai-sdk"]),g2=W0.enum(["anthropic","ai-sdk","ai-sdk-community","openai","openai-compatible","openai-r1","gemini","bedrock","custom","fetch","vertex"]);var v2="runtime.team.progress.v1",n2="runtime.team.lifecycle.v1";function q6(){return globalThis}function h2(f){q6().__clineClientIdentity=f}function x2(){return q6().__clineClientIdentity}var z2="CLINE_ENVIRONMENT",c2="CLINE_ENVIRONMENT_OVERRIDE",_0={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"}},u2="production";function J6(f){let $=f?.trim().toLowerCase();if($==="production"||$==="staging"||$==="local")return $;return}function K6(){if(typeof process>"u"||!process?.env)return{};return process.env}function X6(){let f=K6();return J6(f.CLINE_ENVIRONMENT_OVERRIDE)??J6(f.CLINE_ENVIRONMENT)??"production"}function o2(f){if(typeof f==="string")return _0[f];return _0[X6()]}function l2(f,$){if($.CLINE_API_BASE_URL)f={...f,apiBaseUrl:$.CLINE_API_BASE_URL,mcpBaseUrl:`${$.CLINE_API_BASE_URL}/v1/mcp`};return f}function m2(f){let $=o2(f);return l2($,K6())}var d2="agent.reasoning.unexpected_tokens",p2="task.provider_request_started",r2="task.provider_stream_started",s2="task.first_chunk_received",i2="task.provider_stream_failed",a2="task.cancelled",t2="task.max_tokens_recovery";var e2="sdk.error";var d=new Map;function f4(){d.clear()}function $4(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 w4(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 Y4(f,$){f?.capture({event:"agent.reasoning.unexpected_tokens",properties:D0({sessionId:$.sessionId,agentId:$.agentId,runId:$.runId,iteration:$.iteration,providerId:$.providerId,modelId:$.modelId,requestedThinking:$.requestedThinking,reasoningTokenCount:$.reasoningTokenCount})})}function Z4(f,$){if(!f)return;f.capture({event:$.event,properties:D0({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?{}:L0($.error,$.messageLimit),error_class:$.errorClass})})}function q4(f,$){if(!f)return!1;let w=$.event??"sdk.error",Y=G6($),q=0;try{let X=w4($4(w,Y));if(!X.emit)return!0;q=X.suppressed}catch{}return f.capture({event:w,properties:q>0?{...Y,suppressed_count:q}:Y}),!0}function G6(f){return D0({...f.context??{},component:f.component,operation:f.operation,severity:f.severity??"error",handled:f.handled??!0,...L0(f.error,f.messageLimit,f.errorMessage)})}function D0(f){let $={};for(let[w,Y]of Object.entries(f))if(Y!==void 0)$[w]=Y;return $}function L0(f,$=500,w){let Y=X4(f)?f:void 0,q=f instanceof Error?f:void 0,X=kf(w)??kf(q?.message)??kf(Y?.message)??G4(f)??"Unknown error",G=H4(Y?.code),H=F0(Y?.status)??F0(Y?.statusCode)??F0(Y?.responseStatus);return{error_type:q?.name?.trim()||kf(Y?.name)||q?.constructor?.name||"Error",error_message:K4(J4(X),$),...G!==void 0?{error_code:G}:{},...H!==void 0?{error_status:H}:{}}}function J4(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 K4(f,$){let w=Math.max(1,Math.floor($));return f.length>w?f.substring(0,w):f}function X4(f){return typeof f==="object"&&f!==null}function kf(f){return typeof f==="string"&&f.trim().length>0?f:void 0}function G4(f){if(f instanceof Error)return;let $=typeof f==="string"?f:String(f);return $==="[object Object]"?void 0:kf($)}function H4(f){if(typeof f==="string"&&f.trim().length>0)return f;if(typeof f==="number"&&Number.isFinite(f))return f;return}function F0(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()),X=decodeURIComponent(w.substring(Y+1).trim());if(!q||!X)return;$[q]=X}catch{}}),$}function Q4(){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 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{...Q4(),...f,metadata:Q6(f.metadata)}}function k6(f){let $=f?.trim();return $?$:void 0}function j4(f,$){if(!f)return;let w=typeof f==="function"?f($):f;if(!w)return;let Y=k6(w.rootSessionId);if(!Y)return;return{rootSessionId:Y}}function R4(f){return k6(f?.rootSessionId)}var V4=(f)=>crypto.getRandomValues(new Uint8Array(f)),W4=(f,$,w)=>{let Y=256-256%f.length;if(Y===256){let X=f.length-1;return(G=$)=>{if(!G)return"";let H="";while(!0){let R=w(G),V=G;while(V--)if(H+=f[R[V]&X],H.length>=G)return H}}}let q=Math.ceil(409.6*$/Y);return(X=$)=>{if(!X)return"";let G="";while(!0){let H=w(q),R=q;while(R--)if(H[R]<Y){if(G+=f[H[R]%f.length],G.length>=X)return G}}}},j6=(f,$=21)=>W4(f,$|0,V4);function _4(f="",$=""){let w=j6("1234567890abcdefghijklmnopqrstuvwxyz",10);return`${f}${Date.now()}_${w(5)}${$}`}var F4=["idle","running","pending","completed","failed","cancelled"];var U0=["rules","skills","workflows","plugins","hooks"],R6=U0,D4=new Set(U0);function V6(f){return typeof f==="string"&&D4.has(f)}function L4(f){if(!Array.isArray(f))return;let $=f.map((w)=>typeof w==="string"?w.trim():"").filter(V6);return[...new Set($)]}function U4(f,$){return new Set(f??R6).has($)}import{z as E}from"zod";var I4=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()}),P4=E.object({currentWorkspacePath:E.string().min(1).optional(),workspaces:E.record(E.string().min(1),I4)});function p8(){return{workspaces:{}}}function r8(f,$){let w={...f,workspaces:{...f.workspaces,[$.rootPath]:$}};if(!w.currentWorkspacePath)w.currentWorkspacePath=$.rootPath;return P4.parse(w)}var O4="workspaces",B4="chat";function A4(f){let $=f.trim(),w=/^[A-Za-z]:[\\/]/.test($)||$.startsWith("\\\\"),Y=$.startsWith("/");if(!w&&!Y)return!1;let q=$.split(w?/[\\/]+/:/\/+/).filter(Boolean),X=q.at(-1)??"",G=q.at(-2)??"",H=q.at(-3)??"";return(q.at(-4)??"")===".cline"&&H==="data"&&G==="workspaces"&&X==="chat"}import{z as Z}from"zod";var N4=["current_state","boundary_analysis","interface_proposal"],t8=3600000,e8=240,fw=400,S=Z.preprocess((f)=>f instanceof Date?f.toISOString():f,Z.string().datetime()),Jf=Z.enum(["pending","in_progress","blocked","completed"]),W6=Z.enum(["queued","running","completed","failed","cancelled","interrupted"]),Af=Z.enum(["draft","in_review","finalized"]),C4=Z.object({agentId:Z.string(),role:Z.enum(["lead","teammate"]),description:Z.string().optional(),status:Z.enum(["idle","running","stopped"])}),$w=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 ww=Z.object({agentId:Z.string().min(1).describe("Teammate identifier"),rolePrompt:Z.string().min(1).describe("System prompt describing teammate role")}).strict(),Yw=Z.object({agentId:Z.string().min(1).describe("Teammate identifier"),reason:O(Z.string().min(1)).describe("Optional shutdown reason")}),Zw=Z.object({}),b4={create:["title","description"],list:[],claim:["taskId"],complete:["taskId","summary"],block:["taskId","reason"]},qw={create:["status","taskId","summary","reason"]},Jw=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 b4[f.action]){if(f[w]!==void 0)continue;$.addIssue({code:"custom",path:[w],message:`Field "${w}" is required when action=${f.action}`})}}),Kw=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")}),Xw=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)")}),Gw=Z.object({runId:Z.string().min(1).describe("Run ID"),reason:O(Z.string().min(1)).describe("Optional cancellation reason")}),Hw=Z.object({runId:O(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: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")}),jw=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({}),Ww=Z.object({title:Z.string().describe("Outcome title"),requiredSections:Z.array(Z.string()).default(N4).describe("Required sections for finalization gate (defaults to current_state,boundary_analysis,interface_proposal)")}),_w=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")}),Fw=Z.object({fragmentId:Z.string().describe("Fragment ID"),approved:Z.boolean().describe("Review decision")}),Dw=Z.object({outcomeId:Z.string().describe("Outcome ID")}),Lw=Z.object({}),Uw=Z.object({teamId:Z.string(),teamName:Z.string(),members:Z.array(C4),taskCounts:Z.record(Jf,Z.number()),unreadMessages:Z.number(),missionLogEntries:Z.number(),activeRuns:Z.number(),queuedRuns:Z.number(),outcomeCounts:Z.record(Af,Z.number())}),M4=Z.object({id:Z.string(),title:Z.string(),description:Z.string(),status:Jf,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())}),Iw=Z.discriminatedUnion("action",[Z.object({action:Z.literal("create"),taskId:Z.string(),status:Jf,ignoredFields:Z.array(Z.string()).optional(),note:Z.string().optional()}),Z.object({action:Z.literal("list"),tasks:Z.array(M4)}),Z.object({action:Z.literal("claim"),taskId:Z.string(),status:Jf,nextStep:Z.string()}),Z.object({action:Z.literal("complete"),taskId:Z.string(),status:Jf}),Z.object({action:Z.literal("block"),taskId:Z.string(),status:Jf})]),Pw=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()}),y4=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()})}),Ow=Z.object({id:Z.string(),agentId:Z.string(),taskId:Z.string().optional(),status:W6,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:y4.optional()}),Bw=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()}),Aw=Z.object({id:Z.string(),teamId:Z.string(),title:Z.string(),status:Af,requiredSections:Z.array(Z.string()),createdBy:Z.string(),createdAt:S,finalizedAt:S.optional()}),Nw=Z.object({outcomeId:Z.string(),status:Af,requiredSections:Z.array(Z.string())}),Cw=Z.object({agentId:Z.string(),status:Z.string()}),bw=Z.object({runId:Z.string(),status:W6}),Mw=Z.object({id:Z.string(),toAgentId:Z.string()}),yw=Z.object({delivered:Z.number()}),Tw=Z.object({id:Z.string()}),Ew=Z.object({status:Z.string()}),Sw=Z.object({fragmentId:Z.string(),status:Z.string()}),gw=Z.object({outcomeId:Z.string(),status:Af});var T4;((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"})(T4||={});import{z as E4}from"zod";function S4(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((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 "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((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 "${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 g4(f){let $=S4(f.inputSchema instanceof E4.ZodType?Q0(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 _6=["401","403","unauthorized","forbidden","invalid token","expired token","authentication"];function v4(f){let $=(f instanceof Error?f.message:String(f)).toLowerCase();return _6.some((w)=>$.includes(w))}export{Q0 as zodToJsonSchema,Z1 as xmlTagsRemoval,O2 as validateWithZod,k1 as validateImageMedia,Xf as validateAndReserveImageMedia,N$ as validateAndReserveBase64Media,M6 as usesImageGenerationOperation,r8 as upsertWorkspaceInfo,E1 as truncateStr,D2 as truncateSplit,F2 as trimNonEmpty,_1 as toAiSdkToolResultOutput,v0 as supportsChatModalities,U2 as stripUtf8Bom,f1 as stripModeNotices,z6 as shouldIncludeConnectorField,h2 as setClineClientIdentity,z$ as serializeAbortReason,y as sanitizeSurrogates,_2 as sanitizeFileName,w2 as safeJsonStringify,Y2 as safeJsonParse,R4 as resolveRootSessionId,D1 as resolveReasoningEffortRatio,x$ as resolveReasoningBudgetFromRatio,cf as resolveMediaBudget,s3 as resolveMcpTimeoutSeconds,D3 as resolveHubCommandTimeoutMs,j4 as resolveHookSessionContext,h$ as resolveEffectiveReasoningEffort,X6 as resolveClineEnvironment,f4 as resetSdkErrorRateLimiterForTests,Kf as reserveImageMediaBytes,_3 as readHubScheduleMode,t0 as parseUserCommandEnvelope,L4 as parseRuntimeConfigExtensions,$2 as parseJsonStream,K$ as parseHookEventPayload,X2 as omitUndefinedValues,e0 as normalizeUserInput,L0 as normalizeSdkError,r0 as normalizePluginManifest,X0 as normalizeJsonLikeStringsForSchema,o$ as noopBasicLogger,y6 as modelSupportsToolCalling,T6 as modelSupportsImageInput,b6 as modelProducesImages,Ef as modelHasCapability,v$ as mergeModelOptions,L2 as maskSecret,o0 as listConnectorCatalog,N6 as isTranscriptionModel,V6 as isRuntimeConfigExtensionKind,l$ as isMcpTimeoutConfigured,v4 as isLikelyAuthError,L3 as isHubToolExecutorName,X$ as isHubScheduleMode,j3 as isHubProtocolCompatible,I$ as isGeneratedMedia,k0 as isClineProvider,A4 as isChatWorkspacePath,C6 as isChatCompatibleModel,A$ as isCanonicalBase64,H1 as isBase64Char,B$ as imageFileMaxDecodedBytesForBase64Limit,zf as imageBase64LengthForDecodedBytes,O$ as imageBase64EncodedByteLength,xf as imageBase64DecodedByteLength,U4 as hasRuntimeConfigExtension,H0 as getShellKind,T1 as getShellInvocation,W2 as getShellArgs,d$ as getErrorMessage,p$ as getErrorCode,G2 as getDefaultShell,H$ as getDefaultHubCommandTimeoutMs,m2 as getClineEnvironmentConfig,x2 as getClineClientIdentity,P$ as generatedMediaModalityFromMediaType,j$ as formatUserInputBlock,R$ as formatUserCommandBlock,P2 as formatUptime,L$ as formatSessionSearchTitle,U$ as formatSessionSearchPreview,V$ as formatModeSwitchNotice,g$ as formatMessagesForAiSdk,i3 as formatMcpTimeoutErrorMessage,I2 as formatHumanReadableDate,vf as formatFileContentBlock,nf as formatDisplayUserInput,L1 as estimateTokens,u$ as estimateRequestInputTokens,p8 as emptyWorkspaceManifest,C3 as describeOutdatedHubSessions,K2 as decodeJwtPayload,g4 as createTool,_4 as createSessionId,W$ as createModeSwitchNoticeTracker,Uf as createMediaBudgetState,s6 as createContributionRegistry,Q6 as createClineTelemetryServiceMetadata,k4 as createClineTelemetryServiceConfig,c6 as connectorChannelsFromPlatforms,m$ as clampMcpTimeoutSeconds,Z4 as captureTaskLifecycleEvent,q4 as captureSdkError,Y4 as captureAgentUnexpectedReasoningTokens,G6 as buildSdkErrorProperties,B2 as buildClineSystemPrompt,P4 as WorkspaceManifestSchema,I4 as WorkspaceInfoSchema,i1 as VertexSettingsSchema,s1 as VertexModelSchema,E6 as USER_REJECTED_TOOL_REASON,v3 as USAGE_COST_DISPLAYS,Sf as ToolCallRecordSchema,E0 as ThinkingConfigSchema,$w as TeamTeammateSpecSchema,Iw as TeamTaskToolResultSchema,M4 as TeamTaskListItemToolResultSchema,Jw as TeamTaskInputSchema,Uw as TeamStatusToolResultSchema,Zw as TeamStatusInputSchema,ww as TeamSpawnTeammateInputSchema,Cw as TeamSimpleAgentStatusToolResultSchema,Yw as TeamShutdownTeammateInputSchema,Mw as TeamSendMessageToolResultSchema,Qw as TeamSendMessageInputSchema,Ow as TeamRunToolSummarySchema,Pw as TeamRunTaskToolResultSchema,Kw as TeamRunTaskInputSchema,y4 as TeamRunResultSummarySchema,Fw as TeamReviewOutcomeFragmentInputSchema,jw as TeamReadMailboxInputSchema,Aw as TeamOutcomeToolResultSchema,Sw as TeamOutcomeFragmentToolResultSchema,Tw as TeamMissionLogToolResultSchema,Rw as TeamMissionLogInputSchema,T4 as TeamMessageType,Bw as TeamMailboxMessageToolResultSchema,Xw as TeamListRunsInputSchema,Lw as TeamListOutcomesInputSchema,gw as TeamFinalizeOutcomeToolResultSchema,Dw as TeamFinalizeOutcomeInputSchema,Nw as TeamCreateOutcomeToolResultSchema,Ww as TeamCreateOutcomeInputSchema,Ew as TeamCleanupToolResultSchema,Vw as TeamCleanupInputSchema,bw as TeamCancelRunToolResultSchema,Gw as TeamCancelRunInputSchema,yw as TeamBroadcastToolResultSchema,kw as TeamBroadcastInputSchema,Hw as TeamAwaitRunsInputSchema,_w as TeamAttachOutcomeFragmentInputSchema,S6 as TOOL_REJECTION_SUFFIX,qw as TEAM_TASK_IGNORED_FIELDS_BY_ACTION,fw as TEAM_RUN_TEXT_PREVIEW_LIMIT,e8 as TEAM_RUN_MESSAGE_PREVIEW_LIMIT,v2 as TEAM_PROGRESS_EVENT_TYPE,n2 as TEAM_LIFECYCLE_EVENT_TYPE,t8 as TEAM_AWAIT_TIMEOUT_MS,r2 as TASK_PROVIDER_STREAM_STARTED_EVENT,i2 as TASK_PROVIDER_STREAM_FAILED_EVENT,p2 as TASK_PROVIDER_REQUEST_STARTED_EVENT,t2 as TASK_MAX_TOKENS_RECOVERY_EVENT,s2 as TASK_FIRST_CHUNK_RECEIVED_EVENT,a2 as TASK_CANCELLED_EVENT,Lf as SUPPORTED_IMAGE_MEDIA_TYPES,F4 as SESSION_STATUS_VALUES,$1 as SESSION_SEARCH_TITLE_MAX_LENGTH,w1 as SESSION_SEARCH_PREVIEW_MAX_LENGTH,e2 as SDK_ERROR_TELEMETRY_EVENT,Bf as S3AccessKeySettingsSchema,w6 as RemoteMCPServerSchema,b2 as RemoteConfigSchema,Mf as ReasoningLevelSchema,Wf as ReasoningEffortSchema,U0 as RUNTIME_CONFIG_EXTENSION_KINDS,N2 as REMOTE_URI_SCHEME,Vf as REASONING_LEVELS,Qf as REASONING_EFFORT_RATIOS,S2 as ProviderProtocolSchema,g2 as ProviderClientSchema,E2 as ProviderCapabilitySchema,Y6 as PromptUploadingSchema,i6 as PLUGIN_FILE_EXTENSIONS,c1 as PLAN_MODE_INSTRUCTIONS_MANUAL_SWITCH,z1 as PLAN_MODE_INSTRUCTIONS,o1 as OpenAiCompatibleSchema,u1 as OpenAiCompatibleModelSchema,W3 as ONE_TIME_SCHEDULE_RUN_AT_METADATA_KEY,V3 as ONE_TIME_SCHEDULE_CRON_PATTERN,y0 as ModelStatusSchema,yf as ModelReasoningOptionSchema,T0 as ModelPricingSchema,n0 as ModelOperationSchema,h0 as ModelOperationModeSchema,Tf as ModelModalitySchema,g0 as ModelModalitiesSchema,S0 as ModelMetadataSchema,_f as ModelInfoSchema,M0 as ModelCapabilitySchema,h1 as MODE_TAG_INSTRUCTIONS,x3 as MODEL_TOOL_NAMES,p3 as MIN_MCP_TIMEOUT_SECONDS,H3 as MIN_CLIENT_HUB_PROTOCOL_VERSION,r3 as MAX_MCP_TIMEOUT_SECONDS,Q3 as MAX_CLIENT_HUB_PROTOCOL_VERSION,t1 as LiteLLMSchema,a1 as LiteLLMModelSchema,e as IMAGE_UNSUPPORTED_PLACEHOLDER,t as IMAGE_OMITTED_PLACEHOLDER,i0 as HookEventPayloadSchema,s0 as HookEventNameSchema,N3 as HUB_USER_INSTRUCTIONS_SNAPSHOT_CAPABILITY,Q$ as HUB_TOOL_EXECUTOR_NAMES,U3 as HUB_TOOL_EXECUTOR_CAPABILITY_PREFIX,a0 as HUB_SCHEDULE_MODES,A3 as HUB_MISTAKE_LIMIT_CAPABILITY,P3 as HUB_HOOK_CAPABILITY_PREFIX,G$ as HUB_DEFAULT_COMMAND_TIMEOUT_MS,I3 as HUB_CUSTOM_TOOL_CAPABILITY_PREFIX,O3 as HUB_COMPACTION_CAPABILITY,F3 as HUB_COMMAND_SLOW_LOG_MS,R3 as HUB_CLIENT_TOOL_APPROVAL_CAPABILITY,B3 as HUB_CHECKPOINT_CAPABILITY,k3 as HUB_CAPABILITIES,V0 as GlobalInstructionsFileSchema,J1 as GeneratedMediaSourceSchema,X1 as GeneratedMediaSchema,q1 as GeneratedMediaModalitySchema,a6 as FeatureFlagDefaultValue,a as FeatureFlag,t6 as FEATURE_FLAGS,Z6 as EnterpriseTelemetrySchema,Gf as EMPTY_CONTENT_TEXT,R6 as DEFAULT_RUNTIME_CONFIG_EXTENSIONS,n$ as DEFAULT_REASONING_EFFORT,N4 as DEFAULT_OUTCOME_REQUIRED_SECTIONS,d3 as DEFAULT_MCP_TIMEOUT_SECONDS,G1 as DEFAULT_MAX_TOTAL_MEDIA_BYTES,v as DEFAULT_MAX_IMAGE_ENCODED_BYTES,x as DEFAULT_MAX_IMAGE_DECODED_BYTES,hf as DEFAULT_MAX_IMAGE_BASE64_BYTES,u2 as DEFAULT_CLINE_ENVIRONMENT,gf as ContributionRegistry,x6 as ConnectorHookEventSchema,x0 as ConnectorHookEventNameSchema,c0 as ConnectorEventContextSchema,z0 as ConnectorEventActorSchema,n6 as ConnectorAuthorizationRequestSchema,h6 as ConnectorAuthorizationDecisionSchema,r1 as ClineSettingsSchema,p1 as ClineModelSchema,G3 as CURRENT_HUB_PROTOCOL_VERSION,l0 as CONNECTOR_PLATFORMS,u0 as CONNECTOR_CATALOG,z3 as CONFIGURABLE_MODEL_TOOL_NAMES,O4 as CLINE_WORKSPACES_DIRECTORY_NAME,c2 as CLINE_ENVIRONMENT_OVERRIDE_ENV,z2 as CLINE_ENVIRONMENT_ENV,_0 as CLINE_ENVIRONMENTS,y2 as CLINE_DEFAULT_RPC_PORT,T2 as CLINE_DEFAULT_RPC_ADDRESS,A2 as CLINE_DEFAULT_MODEL_ID,B4 as CLINE_CHAT_WORKSPACE_DIRECTORY_NAME,c$ as CHARS_PER_TOKEN,d1 as AwsBedrockSettingsSchema,l1 as AwsBedrockModelSchema,m1 as AwsBedrockCustomModelSchema,b0 as ApiFormatSchema,A6 as ApiFormat,f6 as AnthropicSchema,e1 as AnthropicModelSchema,$6 as AllowedMCPServerSchema,v6 as AgentUsageSchema,s4 as AgentResultSchema,g6 as AgentFinishReasonSchema,i4 as AgentConfigSchema,_6 as AUTH_ERROR_PATTERNS,M2 as APIKeySchema,d2 as AGENT_UNEXPECTED_REASONING_TOKENS_EVENT};
|