@cline/shared 0.0.84 → 0.0.85-nightly.1790216958
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 +2 -1
- package/dist/index.browser.js +24 -19
- package/dist/index.d.ts +2 -1
- package/dist/index.js +47 -42
- 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/prompt/system/yolo.d.ts +1 -1
- 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 U}from"zod";import{z as y}from"zod";var jf=["none","minimal","low","medium","high","xhigh","max"],yf=y.enum(jf),_f=yf.exclude(["none"]),B6=y.enum([...jf,"default"]).nullable(),Mf=y.discriminatedUnion("type",[y.object({type:y.literal("toggle")}).strict(),y.object({type:y.literal("effort"),values:y.array(B6)}).strict(),y.object({type:y.literal("budget_tokens"),min:y.number().min(-1).optional(),max:y.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 C0=U.enum(["default","openai-responses","r1"]),A6={DEFAULT:"default",OPENAI_RESPONSES:"openai-responses",R1:"r1"},y0=U.enum(["images","video","tools","streaming","prompt-cache","reasoning","reasoning-effort","computer-use","global-endpoint","structured_output","temperature","files"]),M0=U.enum(["active","preview","deprecated","legacy"]),T0=U.object({input:U.number().optional(),output:U.number().optional(),cacheWrite:U.number().optional(),cacheRead:U.number().optional()}),E0=U.object({maxBudget:U.number().optional(),outputPrice:U.number().optional(),thinkingLevel:U.enum(["low","high"]).optional()}),S0=U.object({reasoningDefaultOn:U.boolean().optional(),apiProtocol:U.enum(["openai-chat","openai-responses","anthropic","gemini"]).optional()}).catchall(U.unknown()),Tf=U.enum(["text","image","audio","video","pdf"]),n0=U.object({input:U.array(Tf),output:U.array(Tf)});function g0(f){return(f?.input===void 0||f.input.includes("text"))&&(f?.output===void 0||f.output.includes("text"))}var v0=U.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 b6(f){return(f.operation===void 0||f.operation==="language")&&g0(f.modalities)}var h0=U.enum(["batch","streaming"]);function C6(f){return f.modalities?.input.includes("text")===!0&&f.modalities.output.includes("image")}function y6(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 M6(f){return Ef(f,"tools",{assumeWhenUnspecified:!0})}function T6(f){return Ef(f,"images",{assumeWhenUnspecified:!0})}var Wf=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(y0).optional(),operation:v0.optional(),operationModes:U.array(h0).optional(),modalities:n0.optional(),reasoningOptions:U.array(Mf).optional(),apiFormat:C0.optional(),systemRole:U.enum(["system","developer"]).optional(),temperature:U.number().optional(),pricing:T0.optional(),thinkingConfig:E0.optional(),status:M0.optional(),deprecationNotice:U.string().optional(),replacedBy:U.string().optional(),releaseDate:U.string().optional(),deprecationDate:U.string().optional(),family:U.string().optional(),metadata:S0.optional()});import{z as n}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=n.object({id:n.string(),name:n.string(),execution:n.enum(["client","provider"]).optional(),input:n.unknown(),output:n.unknown(),error:n.string().optional(),durationMs:n.number(),startedAt:n.date(),endedAt:n.date()});var n6=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()}),r2=J.object({text:J.string(),usage:g6,messages:J.array(J.custom()),toolCalls:J.array(Sf),iterations:J.number(),finishReason:n6,model:J.object({id:J.string(),provider:J.string(),info:Wf.optional()}),startedAt:J.date(),endedAt:J.date(),durationMs:J.number()}),s2=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(),Wf).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:_f.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 x0=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"]),z0=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()}),c0=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()}),v6=W.object({actor:z0,context:c0,payload:W.record(W.string(),W.unknown()).optional()}),h6=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()}),x6=W.object({adapter:W.string(),botUserName:W.string().optional(),event:x0,payload:W.record(W.string(),W.unknown()),ts:W.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 nf{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:(j)=>G.tools.push(j),registerCommand:(j)=>G.commands.push(j),registerRule:(j)=>{if(!Y.manifest.capabilities.has("rules"))throw Error(`Invalid setup for extension "${X}": registerRule requires the "rules" capability`);G.rules.push(j)},registerMessageBuilder:(j)=>G.messageBuilder.push(j),registerProvider:(j)=>G.providers.push(j),registerAutomationEventType:(j)=>{if(!Y.manifest.capabilities.has("automationEvents"))throw Error(`Invalid setup for extension "${X}": registerAutomationEventType requires the "automationEvents" capability`);G.automationEventTypes.push(r6(j,X))},registerMcpServer:(j)=>{if(!Y.manifest.capabilities.has("mcp"))throw Error(`Invalid setup for extension "${X}": registerMcpServer requires the "mcp" capability`);G.mcpServers.push({...j,metadata:{...j.metadata??{},source:"plugin",plugin:X}})}},V=Y.manifest.capabilities.has("automationEvents")?this.setupContext:{...this.setupContext,automation:void 0};try{await q.setup?.(H,V),w.push(G)}catch(j){if(f.tolerateSetupErrors!==!0)throw j;$??=j}}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 nf(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 k}from"zod";var s0=k.enum(["agent_start","agent_resume","agent_abort","agent_end","agent_error","tool_call","tool_result","prompt_submit","pre_compact","session_shutdown"]),l=k.record(k.string(),k.string()),e6=k.object({toolName:k.string(),parameters:l}),f$=k.object({toolName:k.string(),parameters:l,result:k.string(),success:k.boolean(),executionTimeMs:k.number()}),$$=k.object({prompt:k.string(),attachments:k.array(k.string())}),w$=k.object({taskMetadata:l}),Y$=k.object({taskMetadata:l,previousState:l}),Z$=k.object({taskMetadata:l}),q$=k.object({taskMetadata:l}),J$=k.object({taskId:k.string(),ulid:k.string(),contextSize:k.number(),compactionStrategy:k.string(),previousApiReqIndex:k.number(),tokensIn:k.number(),tokensOut:k.number(),tokensInCache:k.number(),tokensOutCache:k.number(),deletedRangeStart:k.number(),deletedRangeEnd:k.number(),contextJsonPath:k.string(),contextRawPath:k.string()}),i0=k.object({clineVersion:k.string(),hookName:s0,timestamp:k.string(),taskId:k.string(),sessionContext:k.object({rootSessionId:k.string().optional(),hookLogPath:k.string().optional()}).optional(),workspaceRoots:k.array(k.string()),workspaceInfo:k.custom().optional(),userId:k.string(),agent_id:k.string(),parent_agent_id:k.string().nullable(),iteration:k.number().optional(),reason:k.string().optional(),tool_call:k.object({id:k.string(),name:k.string(),input:k.unknown()}).optional(),tool_result:k.custom().optional(),turn:k.unknown().optional(),error:k.object({name:k.string(),message:k.string(),stack:k.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 X4="v1",G4="v1",H4="v1",k4=["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 Q4(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 R4="approval.respond",V4="0",j4="__hubScheduleRunAt",a0=["act","plan","yolo"];function X$(f){return a0.some(($)=>$===f)}function _4(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,W4=5000;function H$(f){switch(f){case"run.start":case"session.send_input":return null;default:return G$}}function F4(f,$){return $===void 0?H$(f):$}var k$=["readFile","search","bash","webFetch","editor","applyPatch","skills","askQuestion","submit"],Q$=new Set(k$);function L4(f){return typeof f==="string"&&Q$.has(f)}var U4="tool_executor.",D4="custom_tool.",I4="hook.",P4="compaction.compact",O4="checkpoint.create",B4="mistake_limit.decide",A4="user_instructions.snapshot";function N4(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 gf(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 U1($.length)}var
|
|
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
|
|
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 _$(){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 W$(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 $=W$(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 L$(f,"mode_notice").trim()}function L$(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 vf(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 U$(f){return Y1(vf(f),$1)}function D$(f,$){let w=$?.trim()??"",Y=f.toLowerCase(),q=Y==="user"||Y==="session"?vf(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 Uf=["image/png","image/jpeg","image/gif","image/webp"],hf=5242880,g=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??g,maxImageDecodedBytes:f.maxImageDecodedBytes??x,maxTotalMediaBytes:f.maxTotalMediaBytes??G1}}function Df(){return{totalEncodedBytes:0,keptImages:0,omittedImages:0,omittedReasons:{}}}function Lf(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 Lf(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 Lf(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 Lf(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=k1(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 b$(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 k1(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 C$(f,$,w){if(!b$(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 Q1(f,$,w={}){let Y=w.maxEncodedBytes??g,q=w.maxDecodedBytes??x,X=new Set(w.supportedMediaTypes??Uf),G=f?.toLowerCase(),H=k1($),V=H.start,j=H.end,F=C$($,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,V=F.base64Start,j=F.base64End}if(!G||!X.has(G))return{ok:!1,reason:"unsupported_media_type",message:`Unsupported image media type: ${f??"unknown"}`};let L=j-V;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(!uf($,V,j))return{ok:!1,reason:"invalid_base64",message:"Image media must contain valid base64"};let D=$.slice(V,j),b=xf(D);if(b>q)return{ok:!1,reason:"decoded_limit",message:`Image media exceeds the ${q} byte decoded limit`};return{ok:!0,mediaType:G,base64:D,encodedBytes:L,decodedBytes:b}}function Xf(f,$,w,Y){let q=Q1(f,$,{maxEncodedBytes:w.maxImageEncodedBytes,maxDecodedBytes:w.maxImageDecodedBytes});if(!q.ok)return Lf(Y,q.reason),q;let X=Kf(q.encodedBytes,q.decodedBytes,w,Y);if(X)return X;return q}function M(f){return f.replace(/[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?<![\uD800-\uDBFF])[\uDC00-\uDFFF]/g,"�")}var Gf="ERROR: EMPTY CONTENT",y$="[image attached]",M$="[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 R1(f){return Kf(g,0,{maxImageEncodedBytes:g,maxImageDecodedBytes:x},f)===null}function j1(f){try{return new URL(f).protocol}catch{return}}function lf(f,$){let w=Xf(f.mediaType,f.data,{maxImageEncodedBytes:g,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 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:g,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(!R1($))return m();return ff(f.image,f.mediaType)}if(typeof f.image==="string"){let G=j1(f.image);if(G==="http:"||G==="https:"){if(!R1($))return m();return ff(f.image,f.mediaType)}let H=G==="data:",V=Xf(f.mediaType??(H?void 0:"image/png"),f.image,{maxImageEncodedBytes:g,maxImageDecodedBytes:x},$);if(!V.ok)return m();return ff(H?`data:${V.mediaType};base64,${V.base64}`:V.base64,V.mediaType)}let w=f.image.byteLength,Y=zf(w),q=f.mediaType?.toLowerCase()??"image/png";if(!Uf.includes(q)||Kf(Y,w,{maxImageEncodedBytes:g,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 V1(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=j1(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=[],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(X),L=!0,D=!0;continue}let Nf={type:"image",data:_.data,mediaType:_.mediaType},p=lf(Nf,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=df(b,$,w,Y);F.push(C.value),L||=C.changed,D||=C.mediaChanged}return{value:L?F:f,changed:L,mediaChanged:D}}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},L=lf(F,w);if(L.type==="file")return $.push({type:"image",data:L.data.data,mediaType:L.mediaType}),{value:y$,changed:!0,mediaChanged:!0};return{value:L.text,changed:!0,mediaChanged:!0}}return{value:t,changed:!0,mediaChanged:!0}}let H={},V=!1,j=!1;for(let[F,L]of Object.entries(G)){let D=df(L,$,w,Y);H[F]=D.value,V||=D.changed,j||=D.mediaChanged}return{value:V?H:f,changed:V,mediaChanged:j}}function Hf(f){if(typeof f==="string")return M(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 W1(f,$=!1,w=Df(),Y){let q=Y?.supportsImages??!0;if(typeof f==="string")return{type:$?"error-text":"text",value:M(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:M(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"?M(G.value):JSON.stringify(Hf(G.value))},...X.map((V)=>_1(V.data,V.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:M(String(f))}}function n$(f,$,w){let Y=w?.assistantToolCallArgKey??"input",q=w?.supportedInputModalities,X=!q||q.includes("image"),G=[],H=Df(),V=[],j=()=>{return V.splice(0).map((L)=>L.type==="image"?X?mf(L,H):{type:"text",text:e}:V1(L.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"?M(f):f});for(let F of $){let L=F.content;if(typeof L==="string"){let _=F.role==="user"&&V.length>0?j():[];if(_.length>0){G.push({role:F.role,content:[{type:"text",text:L.trim().length>0?M(L):Gf},..._]});continue}if(L.trim().length===0){G.push({role:F.role,content:[{type:"text",text:Gf}]});continue}G.push({role:F.role,content:M(L)});continue}let D=[],b=[];if(L.length===0){G.push({role:F.role,content:[{type:"text",text:Gf}]});continue}for(let _ of L)switch(_.type){case"text":D.push({type:"text",text:M(_.text),..._.providerOptions?{providerOptions:_.providerOptions}:{}});break;case"reasoning":D.push({type:"reasoning",text:M(_.text),..._.providerOptions?{providerOptions:_.providerOptions}:{}});break;case"image":if(F.role==="assistant")V.push(_),D.push({type:"text",text:M$});else D.push(X?mf(_,H):{type:"text",text:e});break;case"media":if(F.role==="assistant")V.push(_),D.push({type:"text",text:T$(_.media.modality)});else D.push(V1(_.media,H,q));break;case"file":D.push({type:"text",text:gf(_.path,M(_.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,H,{supportsImages:X})});break}}let C=b.length>0;if(F.role==="user"&&!C&&V.length>0)D.push(...j());if(D.length>0&&D.every((_)=>_.type==="text"&&typeof _.text==="string"&&_.text.trim().length===0))D.splice(0,D.length,{type:"text",text:Gf});if(D.length>0)of(G,{role:F.role,content:D});if(C)of(G,{role:"tool",content:b})}if(V.length>0)of(G,{role:"user",content:j()});return G}var n4=["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 h4=["web_search","image_generation"],x4=["web_search"];var kf={max:1,xhigh:0.95,high:0.8,medium:0.5,low:0.2,minimal:0.1,none:0},v$=void 0;function h$(f,$){if(typeof f==="string"&&f.toLowerCase()in kf)return f.toLowerCase();return $?void 0:void 0}function L1(f,$){let w=typeof f==="string"?f.toLowerCase():void 0;if(w&&w in kf)return kf[w];if($?.fallbackEffort)return kf[$.fallbackEffort];return}function x$(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 z$(f){return f instanceof Error?{name:f.name,message:f.message}:f}var c$=3;function U1(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 U1($.length)}var o$={debug:()=>{},log:()=>{},error:()=>{}};var m4=60,d4=1,p4=3600;function l$(f){return typeof f==="number"&&Number.isFinite(f)}function m$(f){return Math.min(Math.max(f,1),3600)}function r4(f){if(!l$(f))return 60;return m$(f)}function s4(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 D1(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 b1(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 C1(f,$){switch($){case")":return $f(f,"(")>$f(f,")");case"]":return $f(f,"[")>$f(f,"]");case"}":return $f(f,"{")>$f(f,"}");default:return!1}}var y1={"\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(j(["```","[```","{```"]),!X())I6();j(["```","```]","```}"]);let q=L(",");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;bf();function X(){G();let Q=_()||Nf()||r()||B()||F6()||P0(!1)||L6();return G(),Q}function G(){let Q=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0,R=$,I=H(Q);do if(I=V(),I)I=H(Q);while(I);return $>R}function H(Q){let R=Q?z:P1,I="";while(!0)if(R(f,$))I+=f[$],$++;else if(O1(f,$))I+=" ",$++;else break;if(I.length>0)return w+=I,!0;return!1}function V(){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 j(Q){if(F(Q)){if(rf(f[$]))while($<f.length&&Pf(f[$]))$++;return G(),!0}return!1}function F(Q){H(!0);for(let R of Q){let I=$+R.length;if(f.slice($,I)===R)return $=I,!0}return!1}function L(Q){if(f[$]===Q)return w+=f[$],$++,!0;return!1}function D(Q){if(f[$]===Q)return $++,!0;return!1}function b(){return D("\\")}function C(){if(G(),f[$]==="."&&f[$+1]==="."&&f[$+2]===".")return $+=3,G(),D(","),!0;return!1}function _(){if(f[$]==="{"){if(w+="{",$++,G(),D(","))G();let Q=!0;while($<f.length&&f[$]!=="}"){let R;if(!Q){if(R=L(","),!R)w=T(w,",");G()}else R=!0;if(C(),!(r()||P0(!0))){if(f[$]==="}"||f[$]==="{"||f[$]==="]"||f[$]==="["||f[$]===void 0){if(!Q)w=Zf(w,",")}else P6();break}G();let v=L(":"),i=$>=f.length;if(!v)if(ef(f[$])||i)w=T(w,":");else A0();if(!X())if(v||i)w+="null";else A0();Q=!1}if(f[$]==="}")w+="}",$++;else w=T(w,"}");return!0}return!1}function Nf(){if(f[$]==="["){if(w+="[",$++,G(),D(","))G();let Q=!0;while($<f.length&&f[$]!=="]"){if(!Q){if(!L(","))w=T(w,",")}if(C(),!X()){if(!Q)w=Zf(w,",");break}Q=!1}if(f[$]==="]")w+="]",$++;else w=T(w,"]");return!0}return!1}function p(){let Q=!0,R=!0;while(R){if(!Q){if(!L(","))w=T(w,",")}else Q=!1;R=X()}if(!R)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 Q=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,R=arguments.length>1&&arguments[1]!==void 0?arguments[1]:-1,I=f[$]==="\\";if(I){if($++,!Yf(f[$]))bf()}let v=f[$]==="&"?q0(f.slice($,$+Z0)):null,i=N1(v)||b1(v);if(Yf(f[$])||i){let N0=w0(f[$])?w0:Y0(f[$])?Y0:Of(f[$])?Of:$0,Rf=$,Vf=w.length,P='"';$+=i&&v?v.length:1;while(!0){if($>=f.length){let A=O0($-1);if(!Q&&wf(f.charAt(A)))return $=Rf,w=w.substring(0,Vf),r(!0);return P=T(P,'"'),w+=P,!0}if($===R)return P=T(P,'"'),w+=P,!0;let h=i&&f[$]==="&"?q0(f.slice($,$+Z0)):null;if(h&&v?h.char===v.char:N0(f[$])){let A=$,Cf=P.length;if(P+='"',$+=h?h.length:1,w+=P,G(!1),Q||$>=f.length||wf(f[$])&&!C1(P,f[$])||Yf(f[$])&&!U6($)||c(f[$]))return I0(),!0;if(f[$]==="\\")bf();let u=O0(A-1),b0=f.charAt(u);if(b0===",")return $=Rf,w=w.substring(0,Vf),r(!1,u);if(wf(b0))return $=Rf,w=w.substring(0,Vf),r(!0);w=w.substring(0,Vf),$=A+(h?h.length:1),P=`${P.substring(0,Cf)}\\${P.substring(Cf)}`}else if(Q&&tf(f[$])){if(f[$-1]===":"&&sf.test(f.substring(Rf+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+=y1[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&&D1(f[$+u]))u++;if(u===6)P+=f.slice($,$+6),$+=6;else if($+u>=f.length)$=f.length;else O6()}else if(A===`
|
|
12
|
+
`)P+="\\n",$+=2;else P+=A,$+=2}else{let A=f.charAt($);if(A==='"'&&f[$-1]!=="\\")P+=`\\${A}`,$++;else if(f0(A))P+=y1[A],$++;else{if(!I1(A))D6(A);P+=A,$++}}if(I)b()}}return!1}function I0(){let Q=!1;G();while(f[$]==="+"){Q=!0,$++,G(),w=Zf(w,'"',!0);let R=w.length;if(r())w=B1(w,R,1);else w=T(w,'"')}return Q}function B(){let Q=$,R="",I=!1;if(f[$]==="-"){if(R+=f[$],$++,!c(f[$])&&B0())R+="0"}if(f[$]==="0"&&c(f[$+1]))I=!0;while(c(f[$]))R+=f[$],$++;if(f[$]==="."){if(R===""||R==="-")R+="0";if(R+=f[$],$++,!c(f[$]))R+="0";while(c(f[$]))R+=f[$],$++}if($>Q){if(f[$]==="e"||f[$]==="E"){if(R==="-")I=!0;if(R+=f[$],$++,f[$]==="-"||f[$]==="+")R+=f[$],$++;if(!c(f[$]))R+="0";while(c(f[$]))R+=f[$],$++}if(!B0())return $=Q,!1;return w+=I?`"${f.substring(Q,$)}"`:R,!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(Q,R){if(f.slice($,$+Q.length)===Q&&!Pf(f[$+Q.length]))return w+=R,$+=Q.length,!0;return!1}function P0(Q){let R=$;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[$])&&(!Q||f[$]!==":"))$++;if(f[$-1]===":"&&sf.test(f.substring(R,$+2)))while($<f.length&&af.test(f[$]))$++;if($>R){while(z(f,$-1)&&$>0)$--;let I=f.slice(R,$);if(w+=I==="undefined"?"null":JSON.stringify(I),f[$]==='"')$++;return!0}}function L6(){if(f[$]==="/"){let Q=$;$++;while($<f.length&&(f[$]!=="/"||f[$-1]==="\\"))$++;return $++,w+=JSON.stringify(f.substring(Q,$)),!0}}function O0(Q){let R=Q;while(R>0&&z(f,R))R--;return R}function U6(Q){let R=Q+1;while(R<f.length&&z(f,R))R++;return R>=f.length||wf(f[R])}function B0(){return $>=f.length||wf(f[$])||z(f,$)}function D6(Q){throw new o(`Invalid character ${JSON.stringify(Q)}`,$)}function bf(){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 Q=f.slice($,$+6);throw new o(`Invalid unicode character "${Q}"`,$)}}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 fw(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 $w(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 fw($)??f}function ww(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 Yw(f){try{return JSON.parse(f)}catch{return}}function qf(f){return typeof f==="object"&&f!==null&&!Array.isArray(f)}function Zw(f){let $=f.type;if(typeof $==="string")return[$];return Array.isArray($)?$.filter((w)=>typeof w==="string"):[]}function K0(f,$){if(Zw(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 qw(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=qw(f,$);if(Array.isArray(w)){let G=$.items;if(!qf(G))return w;let H=!1,V=w.map((j)=>{let F=X0(j,G);return H||=F!==j,F});return H?V: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 V=X0(w[G],H);if(V!==w[G])X[G]=V,q=!0}return q?X:w}function Jw(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 Kw(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=Jw(X);return G?JSON.parse(G):null}catch{return null}}function Xw(f){return Object.fromEntries(Object.entries(f).filter(([,$])=>$!==void 0))}function M1(f){let $=f.replaceAll("\\","/"),w=$.lastIndexOf("/");return(w>=0?$.slice(w+1):$).toLowerCase()}function Gw(f){return f==="win32"?"powershell":"/bin/bash"}function H0(f){let $=M1(f);if(G0(f)!==void 0)return"powershell";if($==="cmd"||$==="cmd.exe")return"cmd";if($==="wsl"||$==="wsl.exe")return"wsl";return"posix"}var Hw=new Set(["-nologo","-noninteractive","-noprofile"]),kw="-noprofile";function Qw(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):"",V=Number.parseInt(H,16);if(H.length<=6&&/^[0-9a-fA-F]+$/.test(H)&&V<=1114111){w+=String.fromCodePoint(V),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 Rw(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 $=M1(f);if($==="powershell"||$==="powershell.exe")return"windows";if($==="pwsh"||$==="pwsh.exe")return"core";return}function Vw(f,$){let w=Rw(f);if(!w)return;let Y=(w.quote==="'"?w.body.replaceAll("''","'"):Qw(w.body,$)).trim();return Y.length>0?Y:void 0}function jw(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 V=H[1].toLowerCase();if(V==="-command"){let j=G?Vw(H[2],q):void 0;return j===void 0?void 0:{executable:Y,script:j}}if(!Hw.has(V))return;if(V===kw)G=!0;X=H[2]}}function T1(f,$){switch(H0(f)){case"powershell":{let w={executable:f,script:$};for(;;){let Y=jw(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 _w(f,$){if(H0(f)==="powershell")return["-NoProfile","-NonInteractive","-Command",$];return T1(f,$).args}function Ww(f){return f.toLowerCase().replace(/[^\w.-]+/g,"_")}function Fw(f){let $=f?.trim();return $?$:void 0}function E1(f,$){if(f.length<=$)return f;return`${f.slice(0,$-1)}…`}function Lw(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 Uw(f){if(f.length<=8)return"****";return`${f.slice(0,4)}...${f.slice(-4)}`}function Dw(f){return f.charCodeAt(0)===65279?f.slice(1):f}function Iw(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 Pw(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 Ow(f,$){let w=f.safeParse($);if(!w.success)throw Error(S1.prettifyError(w.error));return w.data}function k0(f){return S1.toJSONSchema(f)}function Q0(f){return f==="cline"||f==="cline-pass"}var n1=`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 g1=`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 R0={ACT:n1,YOLO:g1};var V0="# 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 v1(f,$,w){if(w?.trim()?.includes(
|
|
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 v1(f,$,w){if(w?.trim()?.includes(V0))return w.trim();let Y=w||JSON.stringify({workspaces:{[f]:{hint:$||f.split("/").at(-1)||f}}},null,2);return`
|
|
105
|
+
${V0}
|
|
106
|
+
${Y}`}function Bw(f){let{ide:$="Terminal Shell",mode:w,platform:Y="unknown",workspaceName:q,metadata:X,rules:G,overridePrompt:H,providerId:V,planModeSwitchTool:j=!0}=f,F=f.workspaceRoot??f.rootPath??"",L=Q0(V||"");if(H?.trim()){let C=H.trim();if(L&&X?.trim()&&!C.includes(V0))return`${C}
|
|
102
107
|
|
|
103
|
-
${v1(F,q,
|
|
108
|
+
${v1(F,q,X)}`.trim();return C}let D=w==="yolo"?R0.YOLO:R0.ACT,b=[G,h1,w==="plan"?j?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 D.replace("{{PLATFORM_NAME}}",Y).replace("{{CWD}}",F).replace("{{CURRENT_DATE}}",new Date().toLocaleDateString()).replace("{{IDE_NAME}}",$).replace("{{CLINE_METADATA}}",L?v1(F,q,X):"").replace("{{CLINE_RULES}}",b).trim()}var Aw="anthropic/claude-sonnet-5";var Nw="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()}),bw=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()}),j0=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()}),Cw=K.object({version:K.string(),providerSettings:bw.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(j0).optional(),globalWorkflows:K.array(j0).optional()}),yw=K.record(K.string(),K.string());var Mw=4317;var Tw="127.0.0.1:4317";import _0 from"zod";var Ew=_0.enum(["reasoning","prompt-cache","tools","provider-tools","oauth","temperature","files","streaming","vision","computer-use","local-auth","popular"]),Sw=_0.enum(["anthropic","gemini","openai-chat","openai-responses","openai-r1","ai-sdk"]),nw=_0.enum(["anthropic","ai-sdk","ai-sdk-community","openai","openai-compatible","openai-r1","gemini","bedrock","custom","fetch","vertex"]);var gw="runtime.team.progress.v1",vw="runtime.team.lifecycle.v1";function q6(){return globalThis}function hw(f){q6().__clineClientIdentity=f}function xw(){return q6().__clineClientIdentity}var zw="CLINE_ENVIRONMENT",cw="CLINE_ENVIRONMENT_OVERRIDE",W0={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"}},uw="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 ow(f){if(typeof f==="string")return W0[f];return W0[X6()]}function lw(f,$){if($.CLINE_API_BASE_URL)f={...f,apiBaseUrl:$.CLINE_API_BASE_URL,mcpBaseUrl:`${$.CLINE_API_BASE_URL}/v1/mcp`};return f}function mw(f){let $=ow(f);return lw($,K6())}var dw="agent.reasoning.unexpected_tokens",pw="task.provider_request_started",rw="task.provider_stream_started",sw="task.first_chunk_received",iw="task.provider_stream_failed",aw="task.cancelled";var tw="sdk.error";var d=new Map;function ew(){d.clear()}function f2(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 $2(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 w2(f,$){f?.capture({event:"agent.reasoning.unexpected_tokens",properties:L0({sessionId:$.sessionId,agentId:$.agentId,runId:$.runId,iteration:$.iteration,providerId:$.providerId,modelId:$.modelId,requestedThinking:$.requestedThinking,reasoningTokenCount:$.reasoningTokenCount})})}function Y2(f,$){if(!f)return;f.capture({event:$.event,properties:L0({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?{}:U0($.error,$.messageLimit),error_class:$.errorClass})})}function Z2(f,$){if(!f)return!1;let w=$.event??"sdk.error",Y=G6($),q=0;try{let X=$2(f2(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 L0({...f.context??{},component:f.component,operation:f.operation,severity:f.severity??"error",handled:f.handled??!0,...U0(f.error,f.messageLimit,f.errorMessage)})}function L0(f){let $={};for(let[w,Y]of Object.entries(f))if(Y!==void 0)$[w]=Y;return $}function U0(f,$=500,w){let Y=K2(f)?f:void 0,q=f instanceof Error?f:void 0,X=Qf(w)??Qf(q?.message)??Qf(Y?.message)??X2(f)??"Unknown error",G=G2(Y?.code),H=F0(Y?.status)??F0(Y?.statusCode)??F0(Y?.responseStatus);return{error_type:q?.name?.trim()||Qf(Y?.name)||q?.constructor?.name||"Error",error_message:J2(q2(X),$),...G!==void 0?{error_code:G}:{},...H!==void 0?{error_status:H}:{}}}function q2(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 J2(f,$){let w=Math.max(1,Math.floor($));return f.length>w?f.substring(0,w):f}function K2(f){return typeof f==="object"&&f!==null}function Qf(f){return typeof f==="string"&&f.trim().length>0?f:void 0}function X2(f){if(f instanceof Error)return;let $=typeof f==="string"?f:String(f);return $==="[object Object]"?void 0:Qf($)}function G2(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 H2(){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 k6(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 k2(f={}){return{...H2(),...f,metadata:k6(f.metadata)}}function Q6(f){let $=f?.trim();return $?$:void 0}function Q2(f,$){if(!f)return;let w=typeof f==="function"?f($):f;if(!w)return;let Y=Q6(w.rootSessionId);if(!Y)return;return{rootSessionId:Y}}function R2(f){return Q6(f?.rootSessionId)}var V2=(f)=>crypto.getRandomValues(new Uint8Array(f)),j2=(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 V=w(G),j=G;while(j--)if(H+=f[V[j]&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),V=q;while(V--)if(H[V]<Y){if(G+=f[H[V]%f.length],G.length>=X)return G}}}},R6=(f,$=21)=>j2(f,$|0,V2);function _2(f="",$=""){let w=R6("1234567890abcdefghijklmnopqrstuvwxyz",10);return`${f}${Date.now()}_${w(5)}${$}`}var W2=["idle","running","pending","completed","failed","cancelled"];var D0=["rules","skills","workflows","plugins","hooks"],V6=D0,F2=new Set(D0);function j6(f){return typeof f==="string"&&F2.has(f)}function L2(f){if(!Array.isArray(f))return;let $=f.map((w)=>typeof w==="string"?w.trim():"").filter(j6);return[...new Set($)]}function U2(f,$){return new Set(f??V6).has($)}import{z as E}from"zod";var D2=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()}),I2=E.object({currentWorkspacePath:E.string().min(1).optional(),workspaces:E.record(E.string().min(1),D2)});function d3(){return{workspaces:{}}}function p3(f,$){let w={...f,workspaces:{...f.workspaces,[$.rootPath]:$}};if(!w.currentWorkspacePath)w.currentWorkspacePath=$.rootPath;return I2.parse(w)}var P2="workspaces",O2="chat";function B2(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 A2=["current_state","boundary_analysis","interface_proposal"],a3=3600000,t3=240,e3=400,S=Z.preprocess((f)=>f instanceof Date?f.toISOString():f,Z.string().datetime()),Jf=Z.enum(["pending","in_progress","blocked","completed"]),_6=Z.enum(["queued","running","completed","failed","cancelled","interrupted"]),Af=Z.enum(["draft","in_review","finalized"]),N2=Z.object({agentId:Z.string(),role:Z.enum(["lead","teammate"]),description:Z.string().optional(),status:Z.enum(["idle","running","stopped"])}),f8=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 $8=Z.object({agentId:Z.string().min(1).describe("Teammate identifier"),rolePrompt:Z.string().min(1).describe("System prompt describing teammate role")}).strict(),w8=Z.object({agentId:Z.string().min(1).describe("Teammate identifier"),reason:O(Z.string().min(1)).describe("Optional shutdown reason")}),Y8=Z.object({}),b2={create:["title","description"],list:[],claim:["taskId"],complete:["taskId","summary"],block:["taskId","reason"]},Z8={create:["status","taskId","summary","reason"]},q8=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 b2[f.action]){if(f[w]!==void 0)continue;$.addIssue({code:"custom",path:[w],message:`Field "${w}" is required when action=${f.action}`})}}),J8=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")}),K8=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)")}),X8=Z.object({runId:Z.string().min(1).describe("Run ID"),reason:O(Z.string().min(1)).describe("Optional cancellation reason")}),G8=Z.object({runId:O(Z.string().min(1)).describe("Optional async run ID to await. Omit to wait for all active async runs.")}).strict(),H8=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")}),k8=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")}),Q8=Z.object({unreadOnly:O(Z.boolean()).describe("Only unread messages for read action (default true)")}),R8=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")}),V8=Z.object({}),j8=Z.object({title:Z.string().describe("Outcome title"),requiredSections:Z.array(Z.string()).default(A2).describe("Required sections for finalization gate (defaults to current_state,boundary_analysis,interface_proposal)")}),_8=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")}),W8=Z.object({fragmentId:Z.string().describe("Fragment ID"),approved:Z.boolean().describe("Review decision")}),F8=Z.object({outcomeId:Z.string().describe("Outcome ID")}),L8=Z.object({}),U8=Z.object({teamId:Z.string(),teamName:Z.string(),members:Z.array(N2),taskCounts:Z.record(Jf,Z.number()),unreadMessages:Z.number(),missionLogEntries:Z.number(),activeRuns:Z.number(),queuedRuns:Z.number(),outcomeCounts:Z.record(Af,Z.number())}),C2=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())}),D8=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(C2)}),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})]),I8=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()}),y2=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()})}),P8=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:y2.optional()}),O8=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()}),B8=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()}),A8=Z.object({outcomeId:Z.string(),status:Af,requiredSections:Z.array(Z.string())}),N8=Z.object({agentId:Z.string(),status:Z.string()}),b8=Z.object({runId:Z.string(),status:_6}),C8=Z.object({id:Z.string(),toAgentId:Z.string()}),y8=Z.object({delivered:Z.number()}),M8=Z.object({id:Z.string()}),T8=Z.object({status:Z.string()}),E8=Z.object({fragmentId:Z.string(),status:Z.string()}),S8=Z.object({outcomeId:Z.string(),status:Af});var M2;((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"})(M2||={});import{z as T2}from"zod";function E2(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 S2(f){let $=E2(f.inputSchema instanceof T2.ZodType?k0(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 n2(f){let $=(f instanceof Error?f.message:String(f)).toLowerCase();return W6.some((w)=>$.includes(w))}export{k0 as zodToJsonSchema,Z1 as xmlTagsRemoval,Ow as validateWithZod,Q1 as validateImageMedia,Xf as validateAndReserveImageMedia,N$ as validateAndReserveBase64Media,y6 as usesImageGenerationOperation,p3 as upsertWorkspaceInfo,E1 as truncateStr,Lw as truncateSplit,Fw as trimNonEmpty,W1 as toAiSdkToolResultOutput,g0 as supportsChatModalities,Dw as stripUtf8Bom,f1 as stripModeNotices,z6 as shouldIncludeConnectorField,hw as setClineClientIdentity,z$ as serializeAbortReason,M as sanitizeSurrogates,Ww as sanitizeFileName,ww as safeJsonStringify,Yw as safeJsonParse,R2 as resolveRootSessionId,L1 as resolveReasoningEffortRatio,x$ as resolveReasoningBudgetFromRatio,cf as resolveMediaBudget,r4 as resolveMcpTimeoutSeconds,F4 as resolveHubCommandTimeoutMs,Q2 as resolveHookSessionContext,h$ as resolveEffectiveReasoningEffort,X6 as resolveClineEnvironment,ew as resetSdkErrorRateLimiterForTests,Kf as reserveImageMediaBytes,_4 as readHubScheduleMode,t0 as parseUserCommandEnvelope,L2 as parseRuntimeConfigExtensions,$w as parseJsonStream,K$ as parseHookEventPayload,Xw as omitUndefinedValues,e0 as normalizeUserInput,U0 as normalizeSdkError,r0 as normalizePluginManifest,X0 as normalizeJsonLikeStringsForSchema,o$ as noopBasicLogger,M6 as modelSupportsToolCalling,T6 as modelSupportsImageInput,C6 as modelProducesImages,Ef as modelHasCapability,g$ as mergeModelOptions,Uw as maskSecret,o0 as listConnectorCatalog,N6 as isTranscriptionModel,j6 as isRuntimeConfigExtensionKind,l$ as isMcpTimeoutConfigured,n2 as isLikelyAuthError,L4 as isHubToolExecutorName,X$ as isHubScheduleMode,Q4 as isHubProtocolCompatible,I$ as isGeneratedMedia,Q0 as isClineProvider,B2 as isChatWorkspacePath,b6 as isChatCompatibleModel,A$ as isCanonicalBase64,H1 as isBase64Char,B$ as imageFileMaxDecodedBytesForBase64Limit,zf as imageBase64LengthForDecodedBytes,O$ as imageBase64EncodedByteLength,xf as imageBase64DecodedByteLength,U2 as hasRuntimeConfigExtension,H0 as getShellKind,T1 as getShellInvocation,_w as getShellArgs,d$ as getErrorMessage,p$ as getErrorCode,Gw as getDefaultShell,H$ as getDefaultHubCommandTimeoutMs,mw as getClineEnvironmentConfig,xw as getClineClientIdentity,P$ as generatedMediaModalityFromMediaType,R$ as formatUserInputBlock,V$ as formatUserCommandBlock,Pw as formatUptime,U$ as formatSessionSearchTitle,D$ as formatSessionSearchPreview,j$ as formatModeSwitchNotice,n$ as formatMessagesForAiSdk,s4 as formatMcpTimeoutErrorMessage,Iw as formatHumanReadableDate,gf as formatFileContentBlock,vf as formatDisplayUserInput,U1 as estimateTokens,u$ as estimateRequestInputTokens,d3 as emptyWorkspaceManifest,N4 as describeOutdatedHubSessions,Kw as decodeJwtPayload,S2 as createTool,_2 as createSessionId,_$ as createModeSwitchNoticeTracker,Df as createMediaBudgetState,s6 as createContributionRegistry,k6 as createClineTelemetryServiceMetadata,k2 as createClineTelemetryServiceConfig,c6 as connectorChannelsFromPlatforms,m$ as clampMcpTimeoutSeconds,Y2 as captureTaskLifecycleEvent,Z2 as captureSdkError,w2 as captureAgentUnexpectedReasoningTokens,G6 as buildSdkErrorProperties,Bw as buildClineSystemPrompt,I2 as WorkspaceManifestSchema,D2 as WorkspaceInfoSchema,i1 as VertexSettingsSchema,s1 as VertexModelSchema,E6 as USER_REJECTED_TOOL_REASON,n4 as USAGE_COST_DISPLAYS,Sf as ToolCallRecordSchema,E0 as ThinkingConfigSchema,f8 as TeamTeammateSpecSchema,D8 as TeamTaskToolResultSchema,C2 as TeamTaskListItemToolResultSchema,q8 as TeamTaskInputSchema,U8 as TeamStatusToolResultSchema,Y8 as TeamStatusInputSchema,$8 as TeamSpawnTeammateInputSchema,N8 as TeamSimpleAgentStatusToolResultSchema,w8 as TeamShutdownTeammateInputSchema,C8 as TeamSendMessageToolResultSchema,H8 as TeamSendMessageInputSchema,P8 as TeamRunToolSummarySchema,I8 as TeamRunTaskToolResultSchema,J8 as TeamRunTaskInputSchema,y2 as TeamRunResultSummarySchema,W8 as TeamReviewOutcomeFragmentInputSchema,Q8 as TeamReadMailboxInputSchema,B8 as TeamOutcomeToolResultSchema,E8 as TeamOutcomeFragmentToolResultSchema,M8 as TeamMissionLogToolResultSchema,R8 as TeamMissionLogInputSchema,M2 as TeamMessageType,O8 as TeamMailboxMessageToolResultSchema,K8 as TeamListRunsInputSchema,L8 as TeamListOutcomesInputSchema,S8 as TeamFinalizeOutcomeToolResultSchema,F8 as TeamFinalizeOutcomeInputSchema,A8 as TeamCreateOutcomeToolResultSchema,j8 as TeamCreateOutcomeInputSchema,T8 as TeamCleanupToolResultSchema,V8 as TeamCleanupInputSchema,b8 as TeamCancelRunToolResultSchema,X8 as TeamCancelRunInputSchema,y8 as TeamBroadcastToolResultSchema,k8 as TeamBroadcastInputSchema,G8 as TeamAwaitRunsInputSchema,_8 as TeamAttachOutcomeFragmentInputSchema,S6 as TOOL_REJECTION_SUFFIX,Z8 as TEAM_TASK_IGNORED_FIELDS_BY_ACTION,e3 as TEAM_RUN_TEXT_PREVIEW_LIMIT,t3 as TEAM_RUN_MESSAGE_PREVIEW_LIMIT,gw as TEAM_PROGRESS_EVENT_TYPE,vw as TEAM_LIFECYCLE_EVENT_TYPE,a3 as TEAM_AWAIT_TIMEOUT_MS,rw as TASK_PROVIDER_STREAM_STARTED_EVENT,iw as TASK_PROVIDER_STREAM_FAILED_EVENT,pw as TASK_PROVIDER_REQUEST_STARTED_EVENT,sw as TASK_FIRST_CHUNK_RECEIVED_EVENT,aw as TASK_CANCELLED_EVENT,Uf as SUPPORTED_IMAGE_MEDIA_TYPES,W2 as SESSION_STATUS_VALUES,$1 as SESSION_SEARCH_TITLE_MAX_LENGTH,w1 as SESSION_SEARCH_PREVIEW_MAX_LENGTH,tw as SDK_ERROR_TELEMETRY_EVENT,Bf as S3AccessKeySettingsSchema,w6 as RemoteMCPServerSchema,Cw as RemoteConfigSchema,yf as ReasoningLevelSchema,_f as ReasoningEffortSchema,D0 as RUNTIME_CONFIG_EXTENSION_KINDS,Nw as REMOTE_URI_SCHEME,jf as REASONING_LEVELS,kf as REASONING_EFFORT_RATIOS,Sw as ProviderProtocolSchema,nw as ProviderClientSchema,Ew 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,j4 as ONE_TIME_SCHEDULE_RUN_AT_METADATA_KEY,V4 as ONE_TIME_SCHEDULE_CRON_PATTERN,M0 as ModelStatusSchema,Mf as ModelReasoningOptionSchema,T0 as ModelPricingSchema,v0 as ModelOperationSchema,h0 as ModelOperationModeSchema,Tf as ModelModalitySchema,n0 as ModelModalitiesSchema,S0 as ModelMetadataSchema,Wf as ModelInfoSchema,y0 as ModelCapabilitySchema,h1 as MODE_TAG_INSTRUCTIONS,h4 as MODEL_TOOL_NAMES,d4 as MIN_MCP_TIMEOUT_SECONDS,G4 as MIN_CLIENT_HUB_PROTOCOL_VERSION,p4 as MAX_MCP_TIMEOUT_SECONDS,H4 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,A4 as HUB_USER_INSTRUCTIONS_SNAPSHOT_CAPABILITY,k$ as HUB_TOOL_EXECUTOR_NAMES,U4 as HUB_TOOL_EXECUTOR_CAPABILITY_PREFIX,a0 as HUB_SCHEDULE_MODES,B4 as HUB_MISTAKE_LIMIT_CAPABILITY,I4 as HUB_HOOK_CAPABILITY_PREFIX,G$ as HUB_DEFAULT_COMMAND_TIMEOUT_MS,D4 as HUB_CUSTOM_TOOL_CAPABILITY_PREFIX,P4 as HUB_COMPACTION_CAPABILITY,W4 as HUB_COMMAND_SLOW_LOG_MS,R4 as HUB_CLIENT_TOOL_APPROVAL_CAPABILITY,O4 as HUB_CHECKPOINT_CAPABILITY,k4 as HUB_CAPABILITIES,j0 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,V6 as DEFAULT_RUNTIME_CONFIG_EXTENSIONS,v$ as DEFAULT_REASONING_EFFORT,A2 as DEFAULT_OUTCOME_REQUIRED_SECTIONS,m4 as DEFAULT_MCP_TIMEOUT_SECONDS,G1 as DEFAULT_MAX_TOTAL_MEDIA_BYTES,g as DEFAULT_MAX_IMAGE_ENCODED_BYTES,x as DEFAULT_MAX_IMAGE_DECODED_BYTES,hf as DEFAULT_MAX_IMAGE_BASE64_BYTES,uw as DEFAULT_CLINE_ENVIRONMENT,nf as ContributionRegistry,x6 as ConnectorHookEventSchema,x0 as ConnectorHookEventNameSchema,c0 as ConnectorEventContextSchema,z0 as ConnectorEventActorSchema,v6 as ConnectorAuthorizationRequestSchema,h6 as ConnectorAuthorizationDecisionSchema,r1 as ClineSettingsSchema,p1 as ClineModelSchema,X4 as CURRENT_HUB_PROTOCOL_VERSION,l0 as CONNECTOR_PLATFORMS,u0 as CONNECTOR_CATALOG,x4 as CONFIGURABLE_MODEL_TOOL_NAMES,P2 as CLINE_WORKSPACES_DIRECTORY_NAME,cw as CLINE_ENVIRONMENT_OVERRIDE_ENV,zw as CLINE_ENVIRONMENT_ENV,W0 as CLINE_ENVIRONMENTS,Mw as CLINE_DEFAULT_RPC_PORT,Tw as CLINE_DEFAULT_RPC_ADDRESS,Aw as CLINE_DEFAULT_MODEL_ID,O2 as CLINE_CHAT_WORKSPACE_DIRECTORY_NAME,c$ as CHARS_PER_TOKEN,d1 as AwsBedrockSettingsSchema,l1 as AwsBedrockModelSchema,m1 as AwsBedrockCustomModelSchema,C0 as ApiFormatSchema,A6 as ApiFormat,f6 as AnthropicSchema,e1 as AnthropicModelSchema,$6 as AllowedMCPServerSchema,g6 as AgentUsageSchema,r2 as AgentResultSchema,n6 as AgentFinishReasonSchema,s2 as AgentConfigSchema,W6 as AUTH_ERROR_PATTERNS,yw as APIKeySchema,dw as AGENT_UNEXPECTED_REASONING_TOKENS_EVENT};
|
package/dist/index.d.ts
CHANGED
|
@@ -23,7 +23,7 @@ export { EMPTY_CONTENT_TEXT, formatMessagesForAiSdk, sanitizeSurrogates, toAiSdk
|
|
|
23
23
|
export * from "./llms/gateway";
|
|
24
24
|
export { type Base64MediaValidationFailure, type Base64MediaValidationResult, type Base64MediaValidationSuccess, createMediaBudgetState, DEFAULT_MAX_IMAGE_BASE64_BYTES, DEFAULT_MAX_IMAGE_DECODED_BYTES, DEFAULT_MAX_IMAGE_ENCODED_BYTES, DEFAULT_MAX_TOTAL_MEDIA_BYTES, type GeneratedMedia, type GeneratedMediaModality, GeneratedMediaModalitySchema, GeneratedMediaSchema, type GeneratedMediaSource, GeneratedMediaSourceSchema, generatedMediaModalityFromMediaType, IMAGE_OMITTED_PLACEHOLDER, IMAGE_UNSUPPORTED_PLACEHOLDER, type ImageMediaLimits, type ImageMediaValidationFailure, type ImageMediaValidationResult, type ImageMediaValidationSuccess, imageBase64DecodedByteLength, imageBase64EncodedByteLength, imageBase64LengthForDecodedBytes, imageFileMaxDecodedBytesForBase64Limit, isBase64Char, isCanonicalBase64, isGeneratedMedia, type MediaBudgetOptions, type MediaBudgetState, type ResolvedMediaBudget, reserveImageMediaBytes, resolveMediaBudget, SUPPORTED_IMAGE_MEDIA_TYPES, validateAndReserveBase64Media, validateAndReserveImageMedia, validateImageMedia, } from "./llms/media";
|
|
25
25
|
export type { ContentBlock, FileContent, ImageContent, MediaContent, Message, MessageRole, MessageWithMetadata, RedactedThinkingContent, TextContent, ThinkingContent, ToolDefinition, ToolResultContent, ToolUseContent, } from "./llms/messages";
|
|
26
|
-
export { ApiFormat, ApiFormatSchema, type ChatCompatibleModelDescriptor, type ChatModelModalities, isChatCompatibleModel, type ModelCapability, ModelCapabilitySchema, type ModelInfo, ModelInfoSchema, type ModelMetadata, ModelMetadataSchema, type ModelModalities, ModelModalitiesSchema, type ModelModality, ModelModalitySchema, type ModelOperation, type ModelOperationMode, ModelOperationModeSchema, ModelOperationSchema, type ModelPricing, ModelPricingSchema, type ModelStatus, ModelStatusSchema, modelHasCapability, modelProducesImages, modelSupportsImageInput, modelSupportsToolCalling, supportsChatModalities, type ThinkingConfig, ThinkingConfigSchema, usesImageGenerationOperation, } from "./llms/model-info";
|
|
26
|
+
export { ApiFormat, ApiFormatSchema, type ChatCompatibleModelDescriptor, type ChatModelModalities, isChatCompatibleModel, isTranscriptionModel, type ModelCapability, ModelCapabilitySchema, type ModelInfo, ModelInfoSchema, type ModelMetadata, ModelMetadataSchema, type ModelModalities, ModelModalitiesSchema, type ModelModality, ModelModalitySchema, type ModelOperation, type ModelOperationMode, ModelOperationModeSchema, ModelOperationSchema, type ModelPricing, ModelPricingSchema, type ModelStatus, ModelStatusSchema, modelHasCapability, modelProducesImages, modelSupportsImageInput, modelSupportsToolCalling, supportsChatModalities, type ThinkingConfig, ThinkingConfigSchema, usesImageGenerationOperation, } from "./llms/model-info";
|
|
27
27
|
export { mergeModelOptions } from "./llms/model-options";
|
|
28
28
|
export * from "./llms/model-tools";
|
|
29
29
|
export { DEFAULT_REASONING_EFFORT, REASONING_EFFORT_RATIOS, resolveEffectiveReasoningEffort, resolveReasoningBudgetFromRatio, resolveReasoningEffortRatio, } from "./llms/reasoning-effort";
|
|
@@ -32,6 +32,7 @@ export { serializeAbortReason } from "./llms/requests";
|
|
|
32
32
|
export { CHARS_PER_TOKEN, estimateRequestInputTokens, estimateTokens, type TokenEstimatedRequest, } from "./llms/tokens";
|
|
33
33
|
export type { ToolApprovalRequest, ToolApprovalResult, ToolCallRecord, ToolPolicy, } from "./llms/tools";
|
|
34
34
|
export { TOOL_REJECTION_SUFFIX, ToolCallRecordSchema, USER_REJECTED_TOOL_REASON, } from "./llms/tools";
|
|
35
|
+
export type { StreamingAudioTranscriptionSession } from "./llms/transcription";
|
|
35
36
|
export { type BasicLogger, type BasicLogMetadata, noopBasicLogger, } from "./logging/logger";
|
|
36
37
|
export * from "./mcp";
|
|
37
38
|
export { getErrorCode, getErrorMessage } from "./parse/error";
|