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