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