@cline/shared 0.0.45 → 0.0.46-nightly.1781061443

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.
@@ -56,6 +56,5 @@ export type { RuntimeEnv } from "./session/runtime-env";
56
56
  export * from "./session/workspace";
57
57
  export * from "./team";
58
58
  export { createTool } from "./tools/create";
59
- export type { OAuthProviderId } from "./types/auth";
60
- export { AUTH_ERROR_PATTERNS, isLikelyAuthError, isOAuthProviderId, OAUTH_PROVIDER_IDS, } from "./types/auth";
59
+ export { AUTH_ERROR_PATTERNS, isLikelyAuthError } from "./types/auth";
61
60
  export type { VcrRecording } from "./types/vcr";
@@ -1,14 +1,14 @@
1
- import{z as w}from"zod";import{z as F}from"zod";var sn=F.enum(["default","openai-responses","r1"]),af={DEFAULT:"default",OPENAI_RESPONSES:"openai-responses",R1:"r1"},Jn=F.enum(["images","tools","streaming","prompt-cache","reasoning","reasoning-effort","computer-use","global-endpoint","structured_output","temperature","files"]),Bn=F.enum(["active","preview","deprecated","legacy"]),Qn=F.object({input:F.number().optional(),output:F.number().optional(),cacheWrite:F.number().optional(),cacheRead:F.number().optional()}),Vn=F.object({maxBudget:F.number().optional(),outputPrice:F.number().optional(),thinkingLevel:F.enum(["low","high"]).optional()}),Wn=F.object({reasoningDefaultOn:F.boolean().optional()}).catchall(F.unknown()),v=F.object({id:F.string(),name:F.string().optional(),description:F.string().optional(),maxTokens:F.number().optional(),contextWindow:F.number().optional(),maxInputTokens:F.number().optional(),capabilities:F.array(Jn).optional(),apiFormat:sn.optional(),systemRole:F.enum(["system","developer"]).optional(),temperature:F.number().optional(),pricing:Qn.optional(),thinkingConfig:Vn.optional(),status:Bn.optional(),deprecationNotice:F.string().optional(),replacedBy:F.string().optional(),releaseDate:F.string().optional(),deprecationDate:F.string().optional(),family:F.string().optional(),metadata:Wn.optional()});import{z as b}from"zod";var nn=b.object({id:b.string(),name:b.string(),input:b.unknown(),output:b.unknown(),error:b.string().optional(),durationMs:b.number(),startedAt:b.date(),endedAt:b.date()});var zf=w.enum(["completed","max_iterations","aborted","mistake_limit","error"]),no=w.object({inputTokens:w.number(),outputTokens:w.number(),cacheReadTokens:w.number().optional(),cacheWriteTokens:w.number().optional(),totalCost:w.number().optional()}),og=w.object({text:w.string(),usage:no,messages:w.array(w.custom()),toolCalls:w.array(nn),iterations:w.number(),finishReason:zf,model:w.object({id:w.string(),provider:w.string(),info:v.optional()}),startedAt:w.date(),endedAt:w.date(),durationMs:w.number()}),fo=w.enum(["low","medium","high","xhigh"]),rg=w.object({sessionId:w.string().optional(),providerId:w.string(),modelId:w.string(),apiKey:w.string().optional(),baseUrl:w.string().url().optional(),headers:w.record(w.string(),w.string()).optional(),knownModels:w.record(w.string(),v).optional(),providerConfig:w.unknown().optional(),initialMessages:w.array(w.custom()).optional(),systemPrompt:w.string(),tools:w.array(w.custom()),maxIterations:w.number().positive().optional(),maxParallelToolCalls:w.number().int().positive().default(8),maxTokensPerTurn:w.number().positive().optional(),apiTimeoutMs:w.number().positive().default(180000),userFileContentLoader:w.function().input([w.string()]).output(w.promise(w.string())).optional(),toolContextMetadata:w.record(w.string(),w.unknown()).optional(),execution:w.object({maxConsecutiveMistakes:w.number().int().positive().optional(),reminderAfterIterations:w.number().nonnegative().optional(),reminderText:w.string().optional(),loopDetection:w.union([w.literal(!1),w.object({softThreshold:w.number().int().positive().optional(),hardThreshold:w.number().int().positive().optional()})]).optional()}).optional(),reasoningEffort:fo.optional(),thinkingBudgetTokens:w.number().positive().optional(),thinking:w.boolean().optional(),onEvent:w.function().input([w.custom()]).output(w.void()).optional(),hooks:w.custom().optional(),parentAgentId:w.string().optional(),extensions:w.array(w.custom()).optional(),hookErrorMode:w.enum(["ignore","throw"]).default("ignore"),toolPolicies:w.record(w.string(),w.object({enabled:w.boolean().optional(),autoApprove:w.boolean().optional()})).optional(),requestToolApproval:w.function().input([w.object({sessionId:w.string(),agentId:w.string(),conversationId:w.string(),iteration:w.number(),toolCallId:w.string(),toolName:w.string(),input:w.unknown(),policy:w.object({enabled:w.boolean().optional(),autoApprove:w.boolean().optional()}).default({})})]).output(w.union([w.object({approved:w.boolean(),reason:w.string().optional()}),w.promise(w.object({approved:w.boolean(),reason:w.string().optional()}))])).optional(),onConsecutiveMistakeLimitReached:w.function().input([w.object({iteration:w.number().int().positive(),consecutiveMistakes:w.number().int().positive(),maxConsecutiveMistakes:w.number().int().positive(),reason:w.enum(["api_error","invalid_tool_call","tool_execution_failed"]),details:w.string().optional()})]).output(w.union([w.object({action:w.literal("continue"),guidance:w.string().optional()}),w.object({action:w.literal("stop"),reason:w.string().optional()}),w.promise(w.union([w.object({action:w.literal("continue"),guidance:w.string().optional()}),w.object({action:w.literal("stop"),reason:w.string().optional()})]))])).optional(),logger:w.custom().optional(),extensionContext:w.custom().optional(),abortSignal:w.custom().optional()});import{z as H}from"zod";var jn=H.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"]),Kn=H.object({id:H.string().optional(),label:H.string().optional(),role:H.string().optional(),participantKey:H.string().optional(),participantLabel:H.string().optional(),platformUserId:H.string().optional(),metadata:H.record(H.string(),H.unknown()).optional()}),Tn=H.object({source:H.string(),sourceEvent:H.string(),threadId:H.string(),channelId:H.string(),isDM:H.boolean(),sessionId:H.string().optional(),workspaceRoot:H.string().optional(),metadata:H.record(H.string(),H.unknown()).optional()}),oo=H.object({actor:Kn,context:Tn,payload:H.record(H.string(),H.unknown()).optional()}),ro=H.object({action:H.enum(["allow","deny"]).default("allow"),message:H.string().optional(),reason:H.string().optional(),metadata:H.record(H.string(),H.unknown()).optional()}),go=H.object({adapter:H.string(),botUserName:H.string().optional(),event:jn,payload:H.record(H.string(),H.unknown()),ts:H.string()});var wo=["hooks","tools","commands","rules","skills","messageBuilders","providers","automationEvents"],$o=new Set(wo);function Mn(n,f){return n.name||`extension_${String(f).padStart(4,"0")}`}function Nn(n){return Array.isArray(n)&&n.every((f)=>typeof f==="string")}function Cn(n){if(!Array.isArray(n))return;let f=n.filter((o)=>typeof o==="string").map((o)=>o.trim()).filter((o)=>o.length>0);return f.length>0?f:void 0}function On(n){let f=Cn(n.providerIds),o=Cn(n.modelIds);return{...n,...f?{providerIds:f}:{},...o?{modelIds:o}:{}}}function yo(n,f){let o=Mn(n,f),d=n.manifest;if(!d||typeof d!=="object")throw Error(`Invalid manifest for extension "${o}": manifest is required`);if(!Array.isArray(d.capabilities)||d.capabilities.length===0)throw Error(`Invalid manifest for extension "${o}": capabilities must be a non-empty array`);let $=new Set;for(let I of d.capabilities){if(!$o.has(I))throw Error(`Invalid manifest for extension "${o}": unsupported capability "${String(I)}"`);$.add(I)}if(Object.hasOwn(d,"providerIds")&&!Nn(d.providerIds))throw Error(`Invalid manifest for extension "${o}": providerIds must be a string array when provided`);if(Object.hasOwn(d,"modelIds")&&!Nn(d.modelIds))throw Error(`Invalid manifest for extension "${o}": modelIds must be a string array when provided`);let y=$.has("hooks");if(n.hooks!==void 0&&!y)throw Error(`Invalid manifest for extension "${o}": runtime hooks require the "hooks" capability`);return{capabilities:$,raw:On(d)}}function Ro(n,f){if(!n||typeof n!=="object")throw Error(`Invalid automation event contribution for extension "${f}": expected object`);let o=typeof n.eventType==="string"?n.eventType.trim():"",d=typeof n.source==="string"?n.source.trim():"";if(!o)throw Error(`Invalid automation event contribution for extension "${f}": eventType is required`);if(!d)throw Error(`Invalid automation event contribution for extension "${f}": source is required`);return{...n,eventType:o,source:d,examples:n.examples?[...n.examples]:void 0,metadata:n.metadata?{...n.metadata}:void 0}}class fn{extensions;registry={tools:[],commands:[],rules:[],messageBuilder:[],providers:[],automationEventTypes:[]};normalized=[];phase="resolve";setupContext;constructor(n={}){this.extensions=n.extensions??[],this.setupContext=n.setupContext??{}}resolve(){if(this.phase!=="resolve")return;this.normalized=this.extensions.map((n,f)=>({extension:n,order:f,manifest:{capabilities:new Set,raw:n.manifest}})),this.phase="validate"}validate(){if(this.phase==="resolve")this.resolve();if(this.phase!=="validate")return;this.normalized=this.normalized.map((n)=>({...n,manifest:yo(n.extension,n.order)})),this.phase="setup"}async setup(){if(this.phase==="resolve")this.resolve();if(this.phase==="validate")this.validate();if(this.phase!=="setup")return;for(let n of this.normalized){let{extension:f}=n;if(f.disabled)continue;let o=Mn(f,n.order),d={registerTool:(y)=>this.registry.tools.push(y),registerCommand:(y)=>this.registry.commands.push(y),registerRule:(y)=>{if(!n.manifest.capabilities.has("rules"))throw Error(`Invalid setup for extension "${o}": registerRule requires the "rules" capability`);this.registry.rules.push(y)},registerMessageBuilder:(y)=>this.registry.messageBuilder.push(y),registerProvider:(y)=>this.registry.providers.push(y),registerAutomationEventType:(y)=>{if(!n.manifest.capabilities.has("automationEvents"))throw Error(`Invalid setup for extension "${o}": registerAutomationEventType requires the "automationEvents" capability`);this.registry.automationEventTypes.push(Ro(y,o))}},$=n.manifest.capabilities.has("automationEvents")?this.setupContext:{...this.setupContext,automation:void 0};await f.setup?.(d,$)}this.phase="activate"}activate(){if(this.phase==="resolve")this.resolve();if(this.phase==="validate")this.validate();if(this.phase==="setup")throw Error("Contribution registry setup must complete before activation");if(this.phase!=="activate")return;this.phase="run"}async initialize(){this.resolve(),this.validate(),await this.setup(),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]}}getRegisteredTools(){return[...this.registry.tools]}getRegisteredRules(){return[...this.registry.rules]}getRegisteredAutomationEventTypes(){return[...this.registry.automationEventTypes]}getValidatedExtensions(){if(this.phase==="resolve")this.resolve();if(this.phase==="validate")this.validate();return this.normalized.slice().sort((n,f)=>n.order-f.order).map(({extension:n})=>n)}}function _o(n={}){return new fn(n)}var Eo=[".js",".ts"];import{z as R}from"zod";var cn=R.enum(["agent_start","agent_resume","agent_abort","agent_end","agent_error","tool_call","tool_result","prompt_submit","pre_compact","session_shutdown"]),j=R.record(R.string(),R.string()),Ho=R.object({toolName:R.string(),parameters:j}),qo=R.object({toolName:R.string(),parameters:j,result:R.string(),success:R.boolean(),executionTimeMs:R.number()}),ko=R.object({prompt:R.string(),attachments:R.array(R.string())}),Uo=R.object({taskMetadata:j}),Fo=R.object({taskMetadata:j,previousState:j}),Io=R.object({taskMetadata:j}),Lo=R.object({taskMetadata:j}),Yo=R.object({taskId:R.string(),ulid:R.string(),contextSize:R.number(),compactionStrategy:R.string(),previousApiReqIndex:R.number(),tokensIn:R.number(),tokensOut:R.number(),tokensInCache:R.number(),tokensOutCache:R.number(),deletedRangeStart:R.number(),deletedRangeEnd:R.number(),contextJsonPath:R.string(),contextRawPath:R.string()}),hn=R.object({clineVersion:R.string(),hookName:cn,timestamp:R.string(),taskId:R.string(),sessionContext:R.object({rootSessionId:R.string().optional(),hookLogPath:R.string().optional()}).optional(),workspaceRoots:R.array(R.string()),workspaceInfo:R.custom().optional(),userId:R.string(),agent_id:R.string(),parent_agent_id:R.string().nullable(),iteration:R.number().optional(),reason:R.string().optional(),tool_call:R.object({id:R.string(),name:R.string(),input:R.unknown()}).optional(),tool_result:R.custom().optional(),turn:R.unknown().optional(),error:R.object({name:R.string(),message:R.string(),stack:R.string().optional()}).optional(),preToolUse:Ho.optional(),postToolUse:qo.optional(),userPromptSubmit:ko.optional(),taskStart:Uo.optional(),taskResume:Fo.optional(),taskCancel:Io.optional(),taskComplete:Lo.optional(),preCompact:Yo.optional()}).passthrough();function lo(n){let f=hn.safeParse(n);if(!f.success)return;return f.data}var qg=30000,kg=5000;function Do(n){switch(n){case"run.start":case"session.send_input":return null;default:return 30000}}function Ug(n,f){return f===void 0?Do(n):f}var Go=["readFile","search","bash","webFetch","editor","applyPatch","skills","askQuestion","submit"],Ao=new Set(Go);function Fg(n){return typeof n==="string"&&Ao.has(n)}var Ig="tool_executor.",Lg="custom_tool.",Yg="hook.",lg="compaction.compact",Dg="checkpoint.create",Gg="mistake_limit.decide",Ag="user_instructions.snapshot";function on(n,f){return`<file_content path="${n}">
1
+ import{z as d}from"zod";import{z as k}from"zod";var bn=k.enum(["default","openai-responses","r1"]),tf={DEFAULT:"default",OPENAI_RESPONSES:"openai-responses",R1:"r1"},Jn=k.enum(["images","tools","streaming","prompt-cache","reasoning","reasoning-effort","computer-use","global-endpoint","structured_output","temperature","files"]),Bn=k.enum(["active","preview","deprecated","legacy"]),Qn=k.object({input:k.number().optional(),output:k.number().optional(),cacheWrite:k.number().optional(),cacheRead:k.number().optional()}),Vn=k.object({maxBudget:k.number().optional(),outputPrice:k.number().optional(),thinkingLevel:k.enum(["low","high"]).optional()}),Wn=k.object({reasoningDefaultOn:k.boolean().optional()}).catchall(k.unknown()),m=k.object({id:k.string(),name:k.string().optional(),description:k.string().optional(),maxTokens:k.number().optional(),contextWindow:k.number().optional(),maxInputTokens:k.number().optional(),capabilities:k.array(Jn).optional(),apiFormat:bn.optional(),systemRole:k.enum(["system","developer"]).optional(),temperature:k.number().optional(),pricing:Qn.optional(),thinkingConfig:Vn.optional(),status:Bn.optional(),deprecationNotice:k.string().optional(),replacedBy:k.string().optional(),releaseDate:k.string().optional(),deprecationDate:k.string().optional(),family:k.string().optional(),metadata:Wn.optional()});import{z as X}from"zod";var nn=X.object({id:X.string(),name:X.string(),input:X.unknown(),output:X.unknown(),error:X.string().optional(),durationMs:X.number(),startedAt:X.date(),endedAt:X.date()});var ef=d.enum(["completed","max_iterations","aborted","mistake_limit","error"]),af=d.object({inputTokens:d.number(),outputTokens:d.number(),cacheReadTokens:d.number().optional(),cacheWriteTokens:d.number().optional(),totalCost:d.number().optional()}),ng=d.object({text:d.string(),usage:af,messages:d.array(d.custom()),toolCalls:d.array(nn),iterations:d.number(),finishReason:ef,model:d.object({id:d.string(),provider:d.string(),info:m.optional()}),startedAt:d.date(),endedAt:d.date(),durationMs:d.number()}),zf=d.enum(["low","medium","high","xhigh"]),fg=d.object({sessionId:d.string().optional(),providerId:d.string(),modelId:d.string(),apiKey:d.string().optional(),baseUrl:d.string().url().optional(),headers:d.record(d.string(),d.string()).optional(),knownModels:d.record(d.string(),m).optional(),providerConfig:d.unknown().optional(),initialMessages:d.array(d.custom()).optional(),systemPrompt:d.string(),tools:d.array(d.custom()),maxIterations:d.number().positive().optional(),maxParallelToolCalls:d.number().int().positive().default(8),maxTokensPerTurn:d.number().positive().optional(),apiTimeoutMs:d.number().positive().default(180000),userFileContentLoader:d.function().input([d.string()]).output(d.promise(d.string())).optional(),toolContextMetadata:d.record(d.string(),d.unknown()).optional(),execution:d.object({maxConsecutiveMistakes:d.number().int().positive().optional(),reminderAfterIterations:d.number().nonnegative().optional(),reminderText:d.string().optional(),loopDetection:d.union([d.literal(!1),d.object({softThreshold:d.number().int().positive().optional(),hardThreshold:d.number().int().positive().optional()})]).optional()}).optional(),reasoningEffort:zf.optional(),thinkingBudgetTokens:d.number().positive().optional(),thinking:d.boolean().optional(),onEvent:d.function().input([d.custom()]).output(d.void()).optional(),hooks:d.custom().optional(),parentAgentId:d.string().optional(),extensions:d.array(d.custom()).optional(),hookErrorMode:d.enum(["ignore","throw"]).default("ignore"),toolPolicies:d.record(d.string(),d.object({enabled:d.boolean().optional(),autoApprove:d.boolean().optional()})).optional(),requestToolApproval:d.function().input([d.object({sessionId:d.string(),agentId:d.string(),conversationId:d.string(),iteration:d.number(),toolCallId:d.string(),toolName:d.string(),input:d.unknown(),policy:d.object({enabled:d.boolean().optional(),autoApprove:d.boolean().optional()}).default({})})]).output(d.union([d.object({approved:d.boolean(),reason:d.string().optional()}),d.promise(d.object({approved:d.boolean(),reason:d.string().optional()}))])).optional(),onConsecutiveMistakeLimitReached:d.function().input([d.object({iteration:d.number().int().positive(),consecutiveMistakes:d.number().int().positive(),maxConsecutiveMistakes:d.number().int().positive(),reason:d.enum(["api_error","invalid_tool_call","tool_execution_failed"]),details:d.string().optional()})]).output(d.union([d.object({action:d.literal("continue"),guidance:d.string().optional()}),d.object({action:d.literal("stop"),reason:d.string().optional()}),d.promise(d.union([d.object({action:d.literal("continue"),guidance:d.string().optional()}),d.object({action:d.literal("stop"),reason:d.string().optional()})]))])).optional(),logger:d.custom().optional(),extensionContext:d.custom().optional(),abortSignal:d.custom().optional()});import{z as H}from"zod";var jn=H.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"]),Kn=H.object({id:H.string().optional(),label:H.string().optional(),role:H.string().optional(),participantKey:H.string().optional(),participantLabel:H.string().optional(),platformUserId:H.string().optional(),metadata:H.record(H.string(),H.unknown()).optional()}),Tn=H.object({source:H.string(),sourceEvent:H.string(),threadId:H.string(),channelId:H.string(),isDM:H.boolean(),sessionId:H.string().optional(),workspaceRoot:H.string().optional(),metadata:H.record(H.string(),H.unknown()).optional()}),no=H.object({actor:Kn,context:Tn,payload:H.record(H.string(),H.unknown()).optional()}),fo=H.object({action:H.enum(["allow","deny"]).default("allow"),message:H.string().optional(),reason:H.string().optional(),metadata:H.record(H.string(),H.unknown()).optional()}),oo=H.object({adapter:H.string(),botUserName:H.string().optional(),event:jn,payload:H.record(H.string(),H.unknown()),ts:H.string()});var ro=["hooks","tools","commands","rules","skills","messageBuilders","providers","automationEvents"],go=new Set(ro);function Mn(n,f){return n.name||`extension_${String(f).padStart(4,"0")}`}function Nn(n){return Array.isArray(n)&&n.every((f)=>typeof f==="string")}function Cn(n){if(!Array.isArray(n))return;let f=n.filter((o)=>typeof o==="string").map((o)=>o.trim()).filter((o)=>o.length>0);return f.length>0?f:void 0}function On(n){let f=Cn(n.providerIds),o=Cn(n.modelIds);return{...n,...f?{providerIds:f}:{},...o?{modelIds:o}:{}}}function wo(n,f){let o=Mn(n,f),w=n.manifest;if(!w||typeof w!=="object")throw Error(`Invalid manifest for extension "${o}": manifest is required`);if(!Array.isArray(w.capabilities)||w.capabilities.length===0)throw Error(`Invalid manifest for extension "${o}": capabilities must be a non-empty array`);let $=new Set;for(let F of w.capabilities){if(!go.has(F))throw Error(`Invalid manifest for extension "${o}": unsupported capability "${String(F)}"`);$.add(F)}if(Object.hasOwn(w,"providerIds")&&!Nn(w.providerIds))throw Error(`Invalid manifest for extension "${o}": providerIds must be a string array when provided`);if(Object.hasOwn(w,"modelIds")&&!Nn(w.modelIds))throw Error(`Invalid manifest for extension "${o}": modelIds must be a string array when provided`);let R=$.has("hooks");if(n.hooks!==void 0&&!R)throw Error(`Invalid manifest for extension "${o}": runtime hooks require the "hooks" capability`);return{capabilities:$,raw:On(w)}}function $o(n,f){if(!n||typeof n!=="object")throw Error(`Invalid automation event contribution for extension "${f}": expected object`);let o=typeof n.eventType==="string"?n.eventType.trim():"",w=typeof n.source==="string"?n.source.trim():"";if(!o)throw Error(`Invalid automation event contribution for extension "${f}": eventType is required`);if(!w)throw Error(`Invalid automation event contribution for extension "${f}": source is required`);return{...n,eventType:o,source:w,examples:n.examples?[...n.examples]:void 0,metadata:n.metadata?{...n.metadata}:void 0}}class fn{extensions;registry={tools:[],commands:[],rules:[],messageBuilder:[],providers:[],automationEventTypes:[]};normalized=[];phase="resolve";setupContext;constructor(n={}){this.extensions=n.extensions??[],this.setupContext=n.setupContext??{}}resolve(){if(this.phase!=="resolve")return;this.normalized=this.extensions.map((n,f)=>({extension:n,order:f,manifest:{capabilities:new Set,raw:n.manifest}})),this.phase="validate"}validate(){if(this.phase==="resolve")this.resolve();if(this.phase!=="validate")return;this.normalized=this.normalized.map((n)=>({...n,manifest:wo(n.extension,n.order)})),this.phase="setup"}async setup(){if(this.phase==="resolve")this.resolve();if(this.phase==="validate")this.validate();if(this.phase!=="setup")return;for(let n of this.normalized){let{extension:f}=n;if(f.disabled)continue;let o=Mn(f,n.order),w={registerTool:(R)=>this.registry.tools.push(R),registerCommand:(R)=>this.registry.commands.push(R),registerRule:(R)=>{if(!n.manifest.capabilities.has("rules"))throw Error(`Invalid setup for extension "${o}": registerRule requires the "rules" capability`);this.registry.rules.push(R)},registerMessageBuilder:(R)=>this.registry.messageBuilder.push(R),registerProvider:(R)=>this.registry.providers.push(R),registerAutomationEventType:(R)=>{if(!n.manifest.capabilities.has("automationEvents"))throw Error(`Invalid setup for extension "${o}": registerAutomationEventType requires the "automationEvents" capability`);this.registry.automationEventTypes.push($o(R,o))}},$=n.manifest.capabilities.has("automationEvents")?this.setupContext:{...this.setupContext,automation:void 0};await f.setup?.(w,$)}this.phase="activate"}activate(){if(this.phase==="resolve")this.resolve();if(this.phase==="validate")this.validate();if(this.phase==="setup")throw Error("Contribution registry setup must complete before activation");if(this.phase!=="activate")return;this.phase="run"}async initialize(){this.resolve(),this.validate(),await this.setup(),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]}}getRegisteredTools(){return[...this.registry.tools]}getRegisteredRules(){return[...this.registry.rules]}getRegisteredAutomationEventTypes(){return[...this.registry.automationEventTypes]}getValidatedExtensions(){if(this.phase==="resolve")this.resolve();if(this.phase==="validate")this.validate();return this.normalized.slice().sort((n,f)=>n.order-f.order).map(({extension:n})=>n)}}function Ro(n={}){return new fn(n)}var _o=[".js",".ts"];import{z as _}from"zod";var cn=_.enum(["agent_start","agent_resume","agent_abort","agent_end","agent_error","tool_call","tool_result","prompt_submit","pre_compact","session_shutdown"]),j=_.record(_.string(),_.string()),yo=_.object({toolName:_.string(),parameters:j}),Eo=_.object({toolName:_.string(),parameters:j,result:_.string(),success:_.boolean(),executionTimeMs:_.number()}),Ho=_.object({prompt:_.string(),attachments:_.array(_.string())}),Io=_.object({taskMetadata:j}),qo=_.object({taskMetadata:j,previousState:j}),Uo=_.object({taskMetadata:j}),ko=_.object({taskMetadata:j}),Fo=_.object({taskId:_.string(),ulid:_.string(),contextSize:_.number(),compactionStrategy:_.string(),previousApiReqIndex:_.number(),tokensIn:_.number(),tokensOut:_.number(),tokensInCache:_.number(),tokensOutCache:_.number(),deletedRangeStart:_.number(),deletedRangeEnd:_.number(),contextJsonPath:_.string(),contextRawPath:_.string()}),hn=_.object({clineVersion:_.string(),hookName:cn,timestamp:_.string(),taskId:_.string(),sessionContext:_.object({rootSessionId:_.string().optional(),hookLogPath:_.string().optional()}).optional(),workspaceRoots:_.array(_.string()),workspaceInfo:_.custom().optional(),userId:_.string(),agent_id:_.string(),parent_agent_id:_.string().nullable(),iteration:_.number().optional(),reason:_.string().optional(),tool_call:_.object({id:_.string(),name:_.string(),input:_.unknown()}).optional(),tool_result:_.custom().optional(),turn:_.unknown().optional(),error:_.object({name:_.string(),message:_.string(),stack:_.string().optional()}).optional(),preToolUse:yo.optional(),postToolUse:Eo.optional(),userPromptSubmit:Ho.optional(),taskStart:Io.optional(),taskResume:qo.optional(),taskCancel:Uo.optional(),taskComplete:ko.optional(),preCompact:Fo.optional()}).passthrough();function Lo(n){let f=hn.safeParse(n);if(!f.success)return;return f.data}var Eg=30000,Hg=5000;function Yo(n){switch(n){case"run.start":case"session.send_input":return null;default:return 30000}}function Ig(n,f){return f===void 0?Yo(n):f}var Do=["readFile","search","bash","webFetch","editor","applyPatch","skills","askQuestion","submit"],Ao=new Set(Do);function qg(n){return typeof n==="string"&&Ao.has(n)}var Ug="tool_executor.",kg="custom_tool.",Fg="hook.",Lg="compaction.compact",Yg="checkpoint.create",Dg="mistake_limit.decide",Ag="user_instructions.snapshot";function on(n,f){return`<file_content path="${n}">
2
2
  ${f}
3
- </file_content>`}function Po(n,f="act"){return`<user_input mode="${f}">${n}</user_input>`}function Zo(n,f){return`<user_command slash="${f}">${n}</user_command>`}function Xo(n,f){let o=n.trim(),d=new RegExp(`^<${f}\\b([^>]*)>([\\s\\S]*?)<\\/${f}>$`,"i").exec(o);if(!d)return;return{attrs:d[1]??"",content:d[2]??""}}function bo(n,f){return new RegExp(`${f}="([^"]+)"`,"i").exec(n)?.[1]?.trim()||void 0}function Sn(n){if(!n?.trim())return;let f=Xo(n,"user_command");if(!f)return;let o=bo(f.attrs,"slash");if(!o)return;return{slash:o,content:f.content.trim()}}function un(n){if(!n?.trim())return"";let f=n.trim();for(let o of["user_input","user_command"]){let d=xn(f,o);f=(d!==f?d:f.replace(new RegExp(`<${o}[^>]*>`,"g"),"")).trim()}return f}function so(n){let f=un(n),o=Sn(n);if(!o)return f;if(o.slash.toLowerCase()==="team"){let $=f.toLowerCase().startsWith("spawn a team of agents for the following task:")?f.slice(46).trim():f;return $?`/team ${$}`:"/team"}return f?`/${o.slash} ${f}`:`/${o.slash}`}function xn(n,f){if(!n?.trim())return"";if(!f)return n;let o=new RegExp(`<${f}\\b[^>]*>([\\s\\S]*?)</${f}>`,"g");return n.replace(o,"$1")}function P(n){return n.replace(/[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?<![\uD800-\uDBFF])[\uDC00-\uDFFF]/g,"�")}var rn="ERROR: EMPTY CONTENT";function mn(n,f){let o=n[n.length-1];if(f.role==="tool"&&o?.role==="tool"&&Array.isArray(o.content)&&Array.isArray(f.content)){o.content.push(...f.content);return}n.push(f)}function Jo(n){if(!Array.isArray(n)||n.length===0)return!1;return n.every((f)=>{if(!f||typeof f!=="object")return!1;let o=f;if(o.type==="text")return typeof o.text==="string";if(o.type==="image")return typeof o.data==="string"&&typeof o.mediaType==="string";return!1})}function gn(n,f){if(n==null||typeof n!=="object")return n;if(Array.isArray(n)){let $=[];for(let y of n){if(y&&typeof y==="object"){let E=y;if(E.type==="image"&&typeof E.data==="string"&&typeof E.mediaType==="string"){f.push({type:"image",data:E.data,mediaType:E.mediaType});continue}if(E.type==="text"&&typeof E.text==="string"){$.push(E.text);continue}}$.push(gn(y,f))}return $}let o=n,d={};for(let[$,y]of Object.entries(o))d[$]=gn(y,f);return d}function p(n){if(typeof n==="string")return P(n);if(Array.isArray(n))return n.map((f)=>p(f));if(n!==null&&typeof n==="object"){let f=n,o={};for(let[d,$]of Object.entries(f))o[d]=p($);return o}return n}function vn(n,f=!1){if(typeof n==="string")return{type:f?"error-text":"text",value:P(n)};if(!f&&Jo(n))return{type:"content",value:n.map((o)=>o.type==="image"?{type:"image-data",data:o.data,mediaType:o.mediaType}:{type:"text",text:P(o.text)})};if(!f&&n!==null&&typeof n==="object"){let o=[],d=gn(n,o);if(o.length>0)return{type:"content",value:[{type:"text",text:typeof d==="string"?P(d):JSON.stringify(p(d))},...o.map((y)=>({type:"image-data",data:y.data,mediaType:y.mediaType}))]}}if(n===null||typeof n==="boolean"||typeof n==="number"||typeof n==="object")return{type:f?"error-json":"json",value:p(n)};return{type:f?"error-text":"text",value:P(String(n))}}function Bo(n,f,o){let d=o?.assistantToolCallArgKey??"input",$=[];if(typeof n==="string"&&n.trim().length>0||Array.isArray(n)&&n.length>0)$.push({role:"system",content:typeof n==="string"?P(n):n});for(let y of f){let E=y.content;if(typeof E==="string"){if(E.trim().length===0){$.push({role:y.role,content:[{type:"text",text:rn}]});continue}$.push({role:y.role,content:P(E)});continue}let I=[],G=[];if(E.length===0){$.push({role:y.role,content:[{type:"text",text:rn}]});continue}for(let k of E)switch(k.type){case"text":I.push({type:"text",text:P(k.text),...k.providerOptions?{providerOptions:k.providerOptions}:{}});break;case"reasoning":I.push({type:"reasoning",text:P(k.text),...k.providerOptions?{providerOptions:k.providerOptions}:{}});break;case"image":I.push({type:"image",image:k.image,mediaType:k.mediaType});break;case"file":I.push({type:"text",text:on(k.path,P(k.content))});break;case"tool-call":if(y.role==="assistant")I.push({type:"tool-call",toolCallId:k.toolCallId,toolName:k.toolName,[d]:k.input,...k.providerOptions?{providerOptions:k.providerOptions}:{}});break;case"tool-result":{G.push({type:"tool-result",toolCallId:k.toolCallId,toolName:k.toolName,output:vn(k.output,k.isError??!1)});break}}if(I.length>0)mn($,{role:y.role,content:I});if(G.length>0)mn($,{role:"tool",content:G})}return $}var c={xhigh:0.95,high:0.8,medium:0.5,low:0.2,minimal:0.1,none:0},Qo=void 0;function Vo(n,f){if(typeof n==="string"&&n.toLowerCase()in c)return n.toLowerCase();return f?void 0:void 0}function pn(n,f){let o=typeof n==="string"?n.toLowerCase():void 0;if(o&&o in c)return c[o];if(f?.fallbackEffort)return c[f.fallbackEffort];return}function Wo(n){let f=pn(n.effort,{fallbackEffort:n.fallbackEffort});if(f===void 0)return;if(f<=0)return 0;let o=n.minimumBudget??1;if(n.maxBudget<o)return;let d=n.scaleTokens??n.maxBudget;return Math.min(Math.max(Math.floor(d*f),o),n.maxBudget)}var jo={"HTTP-Referer":"https://cline.bot","X-Title":"Cline","X-IS-MULTIROOT":"false","X-CLIENT-TYPE":"cline-sdk"};function Ko(n){return n instanceof Error?{name:n.name,message:n.message}:n}function To(n){return Math.max(1,Math.ceil(n/3))}var No={debug:()=>{},log:()=>{},error:()=>{}};class B extends Error{constructor(n,f){super(`${n} at position ${f}`);this.position=f}}function tn(n){return/^[0-9A-Fa-f]$/.test(n)}function V(n){return n>="0"&&n<="9"}function en(n){return n>=" "}function h(n){return`,:[]/{}()
4
- +`.includes(n)}function wn(n){return n>="a"&&n<="z"||n>="A"&&n<="Z"||n==="_"||n==="$"}function dn(n){return n>="a"&&n<="z"||n>="A"&&n<="Z"||n==="_"||n==="$"||n>="0"&&n<="9"}var $n=/^(http|https|ftp|mailto|file|data|irc):\/\/$/,yn=/^[A-Za-z0-9-._~:/?#@!$&'()*+;=]$/;function Rn(n){return`,[]/{}
5
- +`.includes(n)}function _n(n){return S(n)||Co.test(n)}var Co=/^[[{\w-]$/;function an(n){return n===`
6
- `||n==="\r"||n==="\t"||n==="\b"||n==="\f"}function Q(n,f){let o=n.charCodeAt(f);return o===32||o===10||o===9||o===13}function zn(n,f){let o=n.charCodeAt(f);return o===32||o===9||o===13}function nf(n,f){let o=n.charCodeAt(f);return o===160||o===6158||o>=8192&&o<=8203||o===8239||o===8287||o===12288||o===65279}function S(n){return En(n)||i(n)}function En(n){return n==='"'||n==="“"||n==="”"}function Hn(n){return n==='"'}function i(n){return n==="'"||n==="‘"||n==="’"||n==="`"||n==="´"}function qn(n){return n==="'"}function C(n,f){let o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,d=n.lastIndexOf(f);return d!==-1?n.substring(0,d)+(o?"":n.substring(d+1)):n}function A(n,f){let o=n.length;if(!Q(n,o-1))return n+f;while(Q(n,o-1))o--;return n.substring(0,o)+f+n.substring(o)}function ff(n,f,o){return n.substring(0,f)+n.substring(f+o)}function of(n){return/[,\n][ \t\r]*$/.test(n)}var Mo={"\b":"\\b","\f":"\\f","\n":"\\n","\r":"\\r","\t":"\\t"},Oo={'"':'"',"\\":"\\","/":"/",b:"\b",f:"\f",n:`
7
- `,r:"\r",t:"\t"};function kn(n){let f=0,o="";if(k(["```","[```","{```"]),!y())pf();k(["```","```]","```}"]);let $=K(",");if($)E();if(_n(n[f])&&of(o)){if(!$)o=A(o,",");Sf()}else if($)o=C(o,",");while(n[f]==="}"||n[f]==="]")f++,E();if(f>=n.length)return o;vf();function y(){E();let _=cf()||hf()||T()||l()||uf()||Pn(!1)||xf();return E(),_}function E(){let _=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0,q=f,U=I(_);do if(U=G(),U)U=I(_);while(U);return f>q}function I(_){let q=_?Q:zn,U="";while(!0)if(q(n,f))U+=n[f],f++;else if(nf(n,f))U+=" ",f++;else break;if(U.length>0)return o+=U,!0;return!1}function G(){if(n[f]==="/"&&n[f+1]==="*"){while(f<n.length&&!co(n,f))f++;return f+=2,!0}if(n[f]==="/"&&n[f+1]==="/"){while(f<n.length&&n[f]!==`
8
- `)f++;return!0}return!1}function k(_){if(u(_)){if(wn(n[f]))while(f<n.length&&dn(n[f]))f++;return E(),!0}return!1}function u(_){I(!0);for(let q of _){let U=f+q.length;if(n.slice(f,U)===q)return f=U,!0}return!1}function K(_){if(n[f]===_)return o+=n[f],f++,!0;return!1}function s(_){if(n[f]===_)return f++,!0;return!1}function Of(){return s("\\")}function Gn(){if(E(),n[f]==="."&&n[f+1]==="."&&n[f+2]===".")return f+=3,E(),s(","),!0;return!1}function cf(){if(n[f]==="{"){if(o+="{",f++,E(),s(","))E();let _=!0;while(f<n.length&&n[f]!=="}"){let q;if(!_){if(q=K(","),!q)o=A(o,",");E()}else q=!0,_=!1;if(Gn(),!(T()||Pn(!0))){if(n[f]==="}"||n[f]==="{"||n[f]==="]"||n[f]==="["||n[f]===void 0)o=C(o,",");else tf();break}E();let m=K(":"),W=f>=n.length;if(!m)if(_n(n[f])||W)o=A(o,":");else Xn();if(!y())if(m||W)o+="null";else Xn()}if(n[f]==="}")o+="}",f++;else o=A(o,"}");return!0}return!1}function hf(){if(n[f]==="["){if(o+="[",f++,E(),s(","))E();let _=!0;while(f<n.length&&n[f]!=="]"){if(!_){if(!K(","))o=A(o,",")}else _=!1;if(Gn(),!y()){o=C(o,",");break}}if(n[f]==="]")o+="]",f++;else o=A(o,"]");return!0}return!1}function Sf(){let _=!0,q=!0;while(q){if(!_){if(!K(","))o=A(o,",")}else _=!1;q=y()}if(!q)o=C(o,",");o=`[
3
+ </file_content>`}function lo(n,f="act"){return`<user_input mode="${f}">${n}</user_input>`}function Po(n,f){return`<user_command slash="${f}">${n}</user_command>`}function Go(n,f){let o=n.trim(),w=new RegExp(`^<${f}\\b([^>]*)>([\\s\\S]*?)<\\/${f}>$`,"i").exec(o);if(!w)return;return{attrs:w[1]??"",content:w[2]??""}}function Zo(n,f){return new RegExp(`${f}="([^"]+)"`,"i").exec(n)?.[1]?.trim()||void 0}function Sn(n){if(!n?.trim())return;let f=Go(n,"user_command");if(!f)return;let o=Zo(f.attrs,"slash");if(!o)return;return{slash:o,content:f.content.trim()}}function un(n){if(!n?.trim())return"";let f=n.trim();for(let o of["user_input","user_command"]){let w=xn(f,o);f=(w!==f?w:f.replace(new RegExp(`<${o}[^>]*>`,"g"),"")).trim()}return f}function so(n){let f=un(n),o=Sn(n);if(!o)return f;if(o.slash.toLowerCase()==="team"){let $=f.toLowerCase().startsWith("spawn a team of agents for the following task:")?f.slice(46).trim():f;return $?`/team ${$}`:"/team"}return f?`/${o.slash} ${f}`:`/${o.slash}`}function xn(n,f){if(!n?.trim())return"";if(!f)return n;let o=new RegExp(`<${f}\\b[^>]*>([\\s\\S]*?)</${f}>`,"g");return n.replace(o,"$1")}function G(n){return n.replace(/[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?<![\uD800-\uDBFF])[\uDC00-\uDFFF]/g,"�")}var rn="ERROR: EMPTY CONTENT";function vn(n,f){let o=n[n.length-1];if(f.role==="tool"&&o?.role==="tool"&&Array.isArray(o.content)&&Array.isArray(f.content)){o.content.push(...f.content);return}n.push(f)}function Xo(n){if(!Array.isArray(n)||n.length===0)return!1;return n.every((f)=>{if(!f||typeof f!=="object")return!1;let o=f;if(o.type==="text")return typeof o.text==="string";if(o.type==="image")return typeof o.data==="string"&&typeof o.mediaType==="string";return!1})}function gn(n,f){if(n==null||typeof n!=="object")return n;if(Array.isArray(n)){let $=[];for(let R of n){if(R&&typeof R==="object"){let E=R;if(E.type==="image"&&typeof E.data==="string"&&typeof E.mediaType==="string"){f.push({type:"image",data:E.data,mediaType:E.mediaType});continue}if(E.type==="text"&&typeof E.text==="string"){$.push(E.text);continue}}$.push(gn(R,f))}return $}let o=n,w={};for(let[$,R]of Object.entries(o))w[$]=gn(R,f);return w}function p(n){if(typeof n==="string")return G(n);if(Array.isArray(n))return n.map((f)=>p(f));if(n!==null&&typeof n==="object"){let f=n,o={};for(let[w,$]of Object.entries(f))o[w]=p($);return o}return n}function mn(n,f=!1){if(typeof n==="string")return{type:f?"error-text":"text",value:G(n)};if(!f&&Xo(n))return{type:"content",value:n.map((o)=>o.type==="image"?{type:"image-data",data:o.data,mediaType:o.mediaType}:{type:"text",text:G(o.text)})};if(!f&&n!==null&&typeof n==="object"){let o=[],w=gn(n,o);if(o.length>0)return{type:"content",value:[{type:"text",text:typeof w==="string"?G(w):JSON.stringify(p(w))},...o.map((R)=>({type:"image-data",data:R.data,mediaType:R.mediaType}))]}}if(n===null||typeof n==="boolean"||typeof n==="number"||typeof n==="object")return{type:f?"error-json":"json",value:p(n)};return{type:f?"error-text":"text",value:G(String(n))}}function bo(n,f,o){let w=o?.assistantToolCallArgKey??"input",$=[];if(typeof n==="string"&&n.trim().length>0||Array.isArray(n)&&n.length>0)$.push({role:"system",content:typeof n==="string"?G(n):n});for(let R of f){let E=R.content;if(typeof E==="string"){if(E.trim().length===0){$.push({role:R.role,content:[{type:"text",text:rn}]});continue}$.push({role:R.role,content:G(E)});continue}let F=[],l=[];if(E.length===0){$.push({role:R.role,content:[{type:"text",text:rn}]});continue}for(let q of E)switch(q.type){case"text":F.push({type:"text",text:G(q.text),...q.providerOptions?{providerOptions:q.providerOptions}:{}});break;case"reasoning":F.push({type:"reasoning",text:G(q.text),...q.providerOptions?{providerOptions:q.providerOptions}:{}});break;case"image":F.push({type:"image",image:q.image,mediaType:q.mediaType});break;case"file":F.push({type:"text",text:on(q.path,G(q.content))});break;case"tool-call":if(R.role==="assistant")F.push({type:"tool-call",toolCallId:q.toolCallId,toolName:q.toolName,[w]:q.input,...q.providerOptions?{providerOptions:q.providerOptions}:{}});break;case"tool-result":{l.push({type:"tool-result",toolCallId:q.toolCallId,toolName:q.toolName,output:mn(q.output,q.isError??!1)});break}}if(F.length>0)vn($,{role:R.role,content:F});if(l.length>0)vn($,{role:"tool",content:l})}return $}var c={xhigh:0.95,high:0.8,medium:0.5,low:0.2,minimal:0.1,none:0},Jo=void 0;function Bo(n,f){if(typeof n==="string"&&n.toLowerCase()in c)return n.toLowerCase();return f?void 0:void 0}function pn(n,f){let o=typeof n==="string"?n.toLowerCase():void 0;if(o&&o in c)return c[o];if(f?.fallbackEffort)return c[f.fallbackEffort];return}function Qo(n){let f=pn(n.effort,{fallbackEffort:n.fallbackEffort});if(f===void 0)return;if(f<=0)return 0;let o=n.minimumBudget??1;if(n.maxBudget<o)return;let w=n.scaleTokens??n.maxBudget;return Math.min(Math.max(Math.floor(w*f),o),n.maxBudget)}var Vo={"HTTP-Referer":"https://cline.bot","X-Title":"Cline","X-IS-MULTIROOT":"false","X-CLIENT-TYPE":"cline-sdk"};function Wo(n){return n instanceof Error?{name:n.name,message:n.message}:n}function jo(n){return Math.max(1,Math.ceil(n/3))}var Ko={debug:()=>{},log:()=>{},error:()=>{}};class B extends Error{constructor(n,f){super(`${n} at position ${f}`);this.position=f}}function tn(n){return/^[0-9A-Fa-f]$/.test(n)}function V(n){return n>="0"&&n<="9"}function en(n){return n>=" "}function h(n){return`,:[]/{}()
4
+ +`.includes(n)}function dn(n){return n>="a"&&n<="z"||n>="A"&&n<="Z"||n==="_"||n==="$"}function wn(n){return n>="a"&&n<="z"||n>="A"&&n<="Z"||n==="_"||n==="$"||n>="0"&&n<="9"}var $n=/^(http|https|ftp|mailto|file|data|irc):\/\/$/,Rn=/^[A-Za-z0-9-._~:/?#@!$&'()*+;=]$/;function _n(n){return`,[]/{}
5
+ +`.includes(n)}function yn(n){return S(n)||To.test(n)}var To=/^[[{\w-]$/;function an(n){return n===`
6
+ `||n==="\r"||n==="\t"||n==="\b"||n==="\f"}function Q(n,f){let o=n.charCodeAt(f);return o===32||o===10||o===9||o===13}function zn(n,f){let o=n.charCodeAt(f);return o===32||o===9||o===13}function nf(n,f){let o=n.charCodeAt(f);return o===160||o===6158||o>=8192&&o<=8203||o===8239||o===8287||o===12288||o===65279}function S(n){return En(n)||i(n)}function En(n){return n==='"'||n==="“"||n==="”"}function Hn(n){return n==='"'}function i(n){return n==="'"||n==="‘"||n==="’"||n==="`"||n==="´"}function In(n){return n==="'"}function C(n,f){let o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,w=n.lastIndexOf(f);return w!==-1?n.substring(0,w)+(o?"":n.substring(w+1)):n}function P(n,f){let o=n.length;if(!Q(n,o-1))return n+f;while(Q(n,o-1))o--;return n.substring(0,o)+f+n.substring(o)}function ff(n,f,o){return n.substring(0,f)+n.substring(f+o)}function of(n){return/[,\n][ \t\r]*$/.test(n)}var No={"\b":"\\b","\f":"\\f","\n":"\\n","\r":"\\r","\t":"\\t"},Co={'"':'"',"\\":"\\","/":"/",b:"\b",f:"\f",n:`
7
+ `,r:"\r",t:"\t"};function qn(n){let f=0,o="";if(q(["```","[```","{```"]),!R())vf();q(["```","```]","```}"]);let $=K(",");if($)E();if(yn(n[f])&&of(o)){if(!$)o=P(o,",");cf()}else if($)o=C(o,",");while(n[f]==="}"||n[f]==="]")f++,E();if(f>=n.length)return o;xf();function R(){E();let y=Mf()||Of()||T()||D()||hf()||Gn(!1)||Sf();return E(),y}function E(){let y=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0,I=f,U=F(y);do if(U=l(),U)U=F(y);while(U);return f>I}function F(y){let I=y?Q:zn,U="";while(!0)if(I(n,f))U+=n[f],f++;else if(nf(n,f))U+=" ",f++;else break;if(U.length>0)return o+=U,!0;return!1}function l(){if(n[f]==="/"&&n[f+1]==="*"){while(f<n.length&&!Mo(n,f))f++;return f+=2,!0}if(n[f]==="/"&&n[f+1]==="/"){while(f<n.length&&n[f]!==`
8
+ `)f++;return!0}return!1}function q(y){if(u(y)){if(dn(n[f]))while(f<n.length&&wn(n[f]))f++;return E(),!0}return!1}function u(y){F(!0);for(let I of y){let U=f+I.length;if(n.slice(f,U)===I)return f=U,!0}return!1}function K(y){if(n[f]===y)return o+=n[f],f++,!0;return!1}function b(y){if(n[f]===y)return f++,!0;return!1}function Cf(){return b("\\")}function ln(){if(E(),n[f]==="."&&n[f+1]==="."&&n[f+2]===".")return f+=3,E(),b(","),!0;return!1}function Mf(){if(n[f]==="{"){if(o+="{",f++,E(),b(","))E();let y=!0;while(f<n.length&&n[f]!=="}"){let I;if(!y){if(I=K(","),!I)o=P(o,",");E()}else I=!0,y=!1;if(ln(),!(T()||Gn(!0))){if(n[f]==="}"||n[f]==="{"||n[f]==="]"||n[f]==="["||n[f]===void 0)o=C(o,",");else mf();break}E();let v=K(":"),W=f>=n.length;if(!v)if(yn(n[f])||W)o=P(o,":");else sn();if(!R())if(v||W)o+="null";else sn()}if(n[f]==="}")o+="}",f++;else o=P(o,"}");return!0}return!1}function Of(){if(n[f]==="["){if(o+="[",f++,E(),b(","))E();let y=!0;while(f<n.length&&n[f]!=="]"){if(!y){if(!K(","))o=P(o,",")}else y=!1;if(ln(),!R()){o=C(o,",");break}}if(n[f]==="]")o+="]",f++;else o=P(o,"]");return!0}return!1}function cf(){let y=!0,I=!0;while(I){if(!y){if(!K(","))o=P(o,",")}else y=!1;I=R()}if(!I)o=C(o,",");o=`[
9
9
  ${o}
10
- ]`}function T(){let _=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,q=arguments.length>1&&arguments[1]!==void 0?arguments[1]:-1,U=n[f]==="\\";if(U)f++,U=!0;if(S(n[f])){let m=Hn(n[f])?Hn:qn(n[f])?qn:i(n[f])?i:En,W=f,O=o.length,Y='"';f++;while(!0){if(f>=n.length){let D=Zn(f-1);if(!_&&h(n.charAt(D)))return f=W,o=o.substring(0,O),T(!0);return Y=A(Y,'"'),o+=Y,!0}if(f===q)return Y=A(Y,'"'),o+=Y,!0;if(m(n[f])){let D=f,z=Y.length;if(Y+='"',f++,o+=Y,E(!1),_||f>=n.length||h(n[f])||S(n[f])||V(n[f]))return An(),!0;let J=Zn(D-1),bn=n.charAt(J);if(bn===",")return f=W,o=o.substring(0,O),T(!1,J);if(h(bn))return f=W,o=o.substring(0,O),T(!0);o=o.substring(0,O),f=D+1,Y=`${Y.substring(0,z)}\\${Y.substring(z)}`}else if(_&&Rn(n[f])){if(n[f-1]===":"&&$n.test(n.substring(W+1,f+2)))while(f<n.length&&yn.test(n[f]))Y+=n[f],f++;return Y=A(Y,'"'),o+=Y,An(),!0}else if(n[f]==="\\"){let D=n.charAt(f+1);if(Oo[D]!==void 0)Y+=n.slice(f,f+2),f+=2;else if(D==="u"){let J=2;while(J<6&&tn(n[f+J]))J++;if(J===6)Y+=n.slice(f,f+6),f+=6;else if(f+J>=n.length)f=n.length;else ef()}else if(D===`
11
- `)Y+="\\n",f+=2;else Y+=D,f+=2}else{let D=n.charAt(f);if(D==='"'&&n[f-1]!=="\\")Y+=`\\${D}`,f++;else if(an(D))Y+=Mo[D],f++;else{if(!en(D))mf(D);Y+=D,f++}}if(U)Of()}}return!1}function An(){let _=!1;E();while(n[f]==="+"){_=!0,f++,E(),o=C(o,'"',!0);let q=o.length;if(T())o=ff(o,q,1);else o=A(o,'"')}return _}function l(){let _=f;if(n[f]==="-"){if(f++,x())return a(_),!0;if(!V(n[f]))return f=_,!1}while(V(n[f]))f++;if(n[f]==="."){if(f++,x())return a(_),!0;if(!V(n[f]))return f=_,!1;while(V(n[f]))f++}if(n[f]==="e"||n[f]==="E"){if(f++,n[f]==="-"||n[f]==="+")f++;if(x())return a(_),!0;if(!V(n[f]))return f=_,!1;while(V(n[f]))f++}if(!x())return f=_,!1;if(f>_){let q=n.slice(_,f),U=/^0\d/.test(q);return o+=U?`"${q}"`:q,!0}return!1}function uf(){return N("true","true")||N("false","false")||N("null","null")||N("True","true")||N("False","false")||N("None","null")}function N(_,q){if(n.slice(f,f+_.length)===_)return o+=q,f+=_.length,!0;return!1}function Pn(_){let q=f;if(wn(n[f])){while(f<n.length&&dn(n[f]))f++;let U=f;while(Q(n,U))U++;if(n[U]==="("){if(f=U+1,y(),n[f]===")"){if(f++,n[f]===";")f++}return!0}}while(f<n.length&&!Rn(n[f])&&!S(n[f])&&(!_||n[f]!==":"))f++;if(n[f-1]===":"&&$n.test(n.substring(q,f+2)))while(f<n.length&&yn.test(n[f]))f++;if(f>q){while(Q(n,f-1)&&f>0)f--;let U=n.slice(q,f);if(o+=U==="undefined"?"null":JSON.stringify(U),n[f]==='"')f++;return!0}}function xf(){if(n[f]==="/"){let _=f;f++;while(f<n.length&&(n[f]!=="/"||n[f-1]==="\\"))f++;return f++,o+=JSON.stringify(n.substring(_,f)),!0}}function Zn(_){let q=_;while(q>0&&Q(n,q))q--;return q}function x(){return f>=n.length||h(n[f])||Q(n,f)}function a(_){o+=`${n.slice(_,f)}0`}function mf(_){throw new B(`Invalid character ${JSON.stringify(_)}`,f)}function vf(){throw new B(`Unexpected character ${JSON.stringify(n[f])}`,f)}function pf(){throw new B("Unexpected end of json string",n.length)}function tf(){throw new B("Object key expected",f)}function Xn(){throw new B("Colon expected",f)}function ef(){let _=n.slice(f,f+6);throw new B(`Invalid unicode character "${_}"`,f)}}function co(n,f){return n[f]==="*"&&n[f+1]==="/"}var ho=/^\{\s*"([A-Za-z0-9_.$-]+)"\s*:\s*([\s\S]+?)\s*\}$/;function So(n){let f=n.match(ho);if(!f)return;let[,o,d]=f,$=d.trim();if(!$)return;let y=$[0];if(y==='"'||y==="{"||y==="["||$==="true"||$==="false"||$==="null"||Number.isFinite(Number($)))return;return JSON.parse(`{"${o}":${JSON.stringify($)}}`)}var uo=[(n)=>JSON.parse(n),(n)=>JSON.parse(kn(n)),So];function xo(n){if(typeof n!=="string")return n;let f=n.trimStart();if(f[0]!=="{"&&f[0]!=="[")return n;for(let o of uo)try{let d=o(f);if(d!==void 0)return d}catch{}return n}function mo(n){let f=new WeakSet;try{return JSON.stringify(n,(d,$)=>{if(typeof $==="bigint")return $.toString();if($&&typeof $==="object"){if(f.has($))return"[Circular]";f.add($)}return $})??"null"}catch{return String(n)}}function vo(n){try{return JSON.parse(n)}catch{return}}function po(n){let f=n.replaceAll("\\","/"),o=f.lastIndexOf("/");return(o>=0?f.slice(o+1):f).toLowerCase()}function io(n){return n==="win32"?"powershell":"/bin/bash"}function to(n,f){let o=po(n);if(o==="powershell"||o==="powershell.exe"||o==="pwsh"||o==="pwsh.exe")return["-NoProfile","-NonInteractive","-Command",f];if(o==="cmd"||o==="cmd.exe")return["/d","/s","/c",f];return["-c",f]}function eo(n){return n.toLowerCase().replace(/[^\w.-]+/g,"_")}function rf(n,f){if(n.length<=f)return n;return`${n.slice(0,f-1)}…`}function ao(n,f="/",o=100){if(!n||n.length<=o)return n||"";let d=n.split(f)?.shift()?.trim()?.slice(0,o-1);return d?`${d}…`:rf(n,o)}function zo(n){if(n.length<=8)return"****";return`${n.slice(0,4)}...${n.slice(-4)}`}function nr(n){if(!n)return"(unknown-date)";let f=new Date(n);if(Number.isNaN(f.getTime()))return n;return f.toLocaleString("en-US",{year:"numeric",month:"numeric",day:"numeric",hour:"numeric",minute:"numeric",second:"numeric",hour12:!0})}function fr(n){let f=Math.max(0,Math.floor(n/1000)),o=Math.floor(f/86400),d=Math.floor(f%86400/3600),$=Math.floor(f%3600/60),y=f%60;if(o>0)return`${o}d ${d}h`;if(d>0)return`${d}h ${$}m`;if($>0)return`${$}m ${y}s`;return`${y}s`}import{z as gf}from"zod";function or(n,f){let o=n.safeParse(f);if(!o.success)throw Error(gf.prettifyError(o.error));return o.data}function Un(n){return gf.toJSONSchema(n)}var wf=`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.
10
+ ]`}function T(){let y=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,I=arguments.length>1&&arguments[1]!==void 0?arguments[1]:-1,U=n[f]==="\\";if(U)f++,U=!0;if(S(n[f])){let v=Hn(n[f])?Hn:In(n[f])?In:i(n[f])?i:En,W=f,O=o.length,Y='"';f++;while(!0){if(f>=n.length){let A=Zn(f-1);if(!y&&h(n.charAt(A)))return f=W,o=o.substring(0,O),T(!0);return Y=P(Y,'"'),o+=Y,!0}if(f===I)return Y=P(Y,'"'),o+=Y,!0;if(v(n[f])){let A=f,z=Y.length;if(Y+='"',f++,o+=Y,E(!1),y||f>=n.length||h(n[f])||S(n[f])||V(n[f]))return Pn(),!0;let J=Zn(A-1),Xn=n.charAt(J);if(Xn===",")return f=W,o=o.substring(0,O),T(!1,J);if(h(Xn))return f=W,o=o.substring(0,O),T(!0);o=o.substring(0,O),f=A+1,Y=`${Y.substring(0,z)}\\${Y.substring(z)}`}else if(y&&_n(n[f])){if(n[f-1]===":"&&$n.test(n.substring(W+1,f+2)))while(f<n.length&&Rn.test(n[f]))Y+=n[f],f++;return Y=P(Y,'"'),o+=Y,Pn(),!0}else if(n[f]==="\\"){let A=n.charAt(f+1);if(Co[A]!==void 0)Y+=n.slice(f,f+2),f+=2;else if(A==="u"){let J=2;while(J<6&&tn(n[f+J]))J++;if(J===6)Y+=n.slice(f,f+6),f+=6;else if(f+J>=n.length)f=n.length;else pf()}else if(A===`
11
+ `)Y+="\\n",f+=2;else Y+=A,f+=2}else{let A=n.charAt(f);if(A==='"'&&n[f-1]!=="\\")Y+=`\\${A}`,f++;else if(an(A))Y+=No[A],f++;else{if(!en(A))uf(A);Y+=A,f++}}if(U)Cf()}}return!1}function Pn(){let y=!1;E();while(n[f]==="+"){y=!0,f++,E(),o=C(o,'"',!0);let I=o.length;if(T())o=ff(o,I,1);else o=P(o,'"')}return y}function D(){let y=f;if(n[f]==="-"){if(f++,x())return a(y),!0;if(!V(n[f]))return f=y,!1}while(V(n[f]))f++;if(n[f]==="."){if(f++,x())return a(y),!0;if(!V(n[f]))return f=y,!1;while(V(n[f]))f++}if(n[f]==="e"||n[f]==="E"){if(f++,n[f]==="-"||n[f]==="+")f++;if(x())return a(y),!0;if(!V(n[f]))return f=y,!1;while(V(n[f]))f++}if(!x())return f=y,!1;if(f>y){let I=n.slice(y,f),U=/^0\d/.test(I);return o+=U?`"${I}"`:I,!0}return!1}function hf(){return N("true","true")||N("false","false")||N("null","null")||N("True","true")||N("False","false")||N("None","null")}function N(y,I){if(n.slice(f,f+y.length)===y)return o+=I,f+=y.length,!0;return!1}function Gn(y){let I=f;if(dn(n[f])){while(f<n.length&&wn(n[f]))f++;let U=f;while(Q(n,U))U++;if(n[U]==="("){if(f=U+1,R(),n[f]===")"){if(f++,n[f]===";")f++}return!0}}while(f<n.length&&!_n(n[f])&&!S(n[f])&&(!y||n[f]!==":"))f++;if(n[f-1]===":"&&$n.test(n.substring(I,f+2)))while(f<n.length&&Rn.test(n[f]))f++;if(f>I){while(Q(n,f-1)&&f>0)f--;let U=n.slice(I,f);if(o+=U==="undefined"?"null":JSON.stringify(U),n[f]==='"')f++;return!0}}function Sf(){if(n[f]==="/"){let y=f;f++;while(f<n.length&&(n[f]!=="/"||n[f-1]==="\\"))f++;return f++,o+=JSON.stringify(n.substring(y,f)),!0}}function Zn(y){let I=y;while(I>0&&Q(n,I))I--;return I}function x(){return f>=n.length||h(n[f])||Q(n,f)}function a(y){o+=`${n.slice(y,f)}0`}function uf(y){throw new B(`Invalid character ${JSON.stringify(y)}`,f)}function xf(){throw new B(`Unexpected character ${JSON.stringify(n[f])}`,f)}function vf(){throw new B("Unexpected end of json string",n.length)}function mf(){throw new B("Object key expected",f)}function sn(){throw new B("Colon expected",f)}function pf(){let y=n.slice(f,f+6);throw new B(`Invalid unicode character "${y}"`,f)}}function Mo(n,f){return n[f]==="*"&&n[f+1]==="/"}var Oo=/^\{\s*"([A-Za-z0-9_.$-]+)"\s*:\s*([\s\S]+?)\s*\}$/;function co(n){let f=n.match(Oo);if(!f)return;let[,o,w]=f,$=w.trim();if(!$)return;let R=$[0];if(R==='"'||R==="{"||R==="["||$==="true"||$==="false"||$==="null"||Number.isFinite(Number($)))return;return JSON.parse(`{"${o}":${JSON.stringify($)}}`)}var ho=[(n)=>JSON.parse(n),(n)=>JSON.parse(qn(n)),co];function So(n){if(typeof n!=="string")return n;let f=n.trimStart();if(f[0]!=="{"&&f[0]!=="[")return n;for(let o of ho)try{let w=o(f);if(w!==void 0)return w}catch{}return n}function uo(n){let f=new WeakSet;try{return JSON.stringify(n,(w,$)=>{if(typeof $==="bigint")return $.toString();if($&&typeof $==="object"){if(f.has($))return"[Circular]";f.add($)}return $})??"null"}catch{return String(n)}}function xo(n){try{return JSON.parse(n)}catch{return}}function vo(n){let f=n.replaceAll("\\","/"),o=f.lastIndexOf("/");return(o>=0?f.slice(o+1):f).toLowerCase()}function mo(n){return n==="win32"?"powershell":"/bin/bash"}function po(n,f){let o=vo(n);if(o==="powershell"||o==="powershell.exe"||o==="pwsh"||o==="pwsh.exe")return["-NoProfile","-NonInteractive","-Command",f];if(o==="cmd"||o==="cmd.exe")return["/d","/s","/c",f];return["-c",f]}function io(n){return n.toLowerCase().replace(/[^\w.-]+/g,"_")}function rf(n,f){if(n.length<=f)return n;return`${n.slice(0,f-1)}…`}function to(n,f="/",o=100){if(!n||n.length<=o)return n||"";let w=n.split(f)?.shift()?.trim()?.slice(0,o-1);return w?`${w}…`:rf(n,o)}function eo(n){if(n.length<=8)return"****";return`${n.slice(0,4)}...${n.slice(-4)}`}function ao(n){if(!n)return"(unknown-date)";let f=new Date(n);if(Number.isNaN(f.getTime()))return n;return f.toLocaleString("en-US",{year:"numeric",month:"numeric",day:"numeric",hour:"numeric",minute:"numeric",second:"numeric",hour12:!0})}function zo(n){let f=Math.max(0,Math.floor(n/1000)),o=Math.floor(f/86400),w=Math.floor(f%86400/3600),$=Math.floor(f%3600/60),R=f%60;if(o>0)return`${o}d ${w}h`;if(w>0)return`${w}h ${$}m`;if($>0)return`${$}m ${R}s`;return`${R}s`}import{z as gf}from"zod";function nr(n,f){let o=n.safeParse(f);if(!o.success)throw Error(gf.prettifyError(o.error));return o.data}function Un(n){return gf.toJSONSchema(n)}var df=`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.
12
12
 
13
13
  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.
14
14
  Review each question carefully and answer it with detailed, accurate information.
@@ -41,7 +41,7 @@ When you have completed the task, please provide a summary of what you did and a
41
41
 
42
42
  If user asked a simple question without any coding context, answer it directly without using any tools.
43
43
  {{CLINE_RULES}}
44
- {{CLINE_METADATA}}`,df=`You are Cline, a careful and helpful coding agent that works in the background.
44
+ {{CLINE_METADATA}}`,wf=`You are Cline, a careful and helpful coding agent that works in the background.
45
45
  You are tasked to solve an issue reported by the user who you cannot communicate with directly.
46
46
  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.
47
47
 
@@ -69,8 +69,8 @@ IMPORTANT:
69
69
  - Always includes tool calls in your response until the task is completed. You should only end the task when all the requirements are met by calling the 'submit_and_exit' tool.
70
70
  - Response without the submit_and_exit tool call will considered not completed and the task will continue.
71
71
  {{CLINE_RULES}}
72
- {{CLINE_METADATA}}`;var Fn="# Workspace Configuration";function $f(n,f,o){if(o?.trim()?.includes(Fn))return o.trim();let d=o||JSON.stringify({workspaces:{[n]:{hint:f||n.split("/").at(-1)||n}}},null,2);return`
73
- ${Fn}
74
- ${d}`}function rr(n){let{ide:f="Terminal Shell",mode:o,platform:d="unknown",workspaceName:$,metadata:y,rules:E,overridePrompt:I,providerId:G}=n,k=n.workspaceRoot??n.rootPath??"",u=G==="cline";if(I?.trim()){let s=I.trim();if(u&&y?.trim()&&!s.includes(Fn))return`${s}
72
+ {{CLINE_METADATA}}`;var kn="# Workspace Configuration";function $f(n,f,o){if(o?.trim()?.includes(kn))return o.trim();let w=o||JSON.stringify({workspaces:{[n]:{hint:f||n.split("/").at(-1)||n}}},null,2);return`
73
+ ${kn}
74
+ ${w}`}function fr(n){let{ide:f="Terminal Shell",mode:o,platform:w="unknown",workspaceName:$,metadata:R,rules:E,overridePrompt:F,providerId:l}=n,q=n.workspaceRoot??n.rootPath??"",u=l==="cline";if(F?.trim()){let b=F.trim();if(u&&R?.trim()&&!b.includes(kn))return`${b}
75
75
 
76
- ${$f(k,$,y)}`.trim();return s}return(o==="yolo"?df:wf).replace("{{PLATFORM_NAME}}",d).replace("{{CWD}}",k).replace("{{CURRENT_DATE}}",new Date().toLocaleDateString()).replace("{{IDE_NAME}}",f).replace("{{CLINE_METADATA}}",u?$f(k,$,y):"").replace("{{CLINE_RULES}}",E||"").trim()}var gr="remote://";import{z as g}from"zod";var yf=g.object({id:g.string(),temperature:g.number().optional(),isR1FormatRequired:g.boolean().optional(),maxTokens:g.number().optional(),contextWindow:g.number().optional(),inputPrice:g.number().optional(),outputPrice:g.number().optional(),supportsImages:g.boolean().optional()}),Rf=g.object({models:g.array(yf).optional(),openAiBaseUrl:g.string().optional(),openAiHeaders:g.record(g.string(),g.string()).optional(),azureApiVersion:g.string().optional(),azureIdentity:g.boolean().optional()}),_f=g.object({id:g.string(),thinkingBudgetTokens:g.number().optional()}),Ef=g.object({name:g.string(),baseModelId:g.string(),thinkingBudgetTokens:g.number().optional()}),Hf=g.object({models:g.array(_f).optional(),customModels:g.array(Ef).optional(),awsRegion:g.string().optional(),awsUseCrossRegionInference:g.boolean().optional(),awsUseGlobalInference:g.boolean().optional(),awsBedrockUsePromptCache:g.boolean().optional(),awsBedrockEndpoint:g.string().optional()}),qf=g.object({id:g.string()}),kf=g.object({models:g.array(qf).optional()}),Uf=g.object({id:g.string(),thinkingBudgetTokens:g.number().optional()}),Ff=g.object({models:g.array(Uf).optional(),vertexProjectId:g.string().optional(),vertexRegion:g.string().optional()}),If=g.object({id:g.string(),thinkingBudgetTokens:g.number().optional(),promptCachingEnabled:g.boolean().optional()}),Lf=g.object({models:g.array(If).optional(),baseUrl:g.string().optional()}),Yf=g.object({id:g.string(),thinkingBudgetTokens:g.number().optional()}),lf=g.object({models:g.array(Yf).optional(),baseUrl:g.string().optional()}),wr=g.object({OpenAiCompatible:Rf.optional(),AwsBedrock:Hf.optional(),Cline:kf.optional(),Vertex:Ff.optional(),LiteLLM:Lf.optional(),Anthropic:lf.optional()}),Df=g.object({id:g.string()}),Gf=g.object({name:g.string(),url:g.string(),alwaysEnabled:g.boolean().optional(),headers:g.record(g.string(),g.string()).optional()}),In=g.object({alwaysEnabled:g.boolean(),name:g.string(),contents:g.string()}),t=g.object({bucket:g.string(),accessKeyId:g.string(),secretAccessKey:g.string(),region:g.string().optional(),endpoint:g.string().optional(),accountId:g.string().optional()}),Af=g.object({enabled:g.boolean().optional(),type:g.union([g.literal("s3_access_keys"),g.literal("r2_access_keys"),g.literal("azure_access_keys")]).optional(),s3AccessSettings:t.optional(),r2AccessSettings:t.optional(),azureAccessSettings:t.optional()}),Pf=g.object({promptUploading:Af.optional()}),dr=g.object({version:g.string(),providerSettings:wr.optional(),telemetryEnabled:g.boolean().optional(),kanbanEnabled:g.boolean().optional(),mcpMarketplaceEnabled:g.boolean().optional(),allowedMCPServers:g.array(Df).optional(),remoteMCPServers:g.array(Gf).optional(),blockPersonalRemoteMCPServers:g.boolean().optional(),yoloModeAllowed:g.boolean().optional(),openTelemetryEnabled:g.boolean().optional(),openTelemetryMetricsExporter:g.string().optional(),openTelemetryLogsExporter:g.string().optional(),openTelemetryOtlpProtocol:g.string().optional(),openTelemetryOtlpEndpoint:g.string().optional(),openTelemetryOtlpHeaders:g.record(g.string(),g.string()).optional(),openTelemetryOtlpMetricsProtocol:g.string().optional(),openTelemetryOtlpMetricsEndpoint:g.string().optional(),openTelemetryOtlpMetricsHeaders:g.record(g.string(),g.string()).optional(),openTelemetryOtlpLogsProtocol:g.string().optional(),openTelemetryOtlpLogsEndpoint:g.string().optional(),openTelemetryOtlpLogsHeaders:g.record(g.string(),g.string()).optional(),openTelemetryMetricExportInterval:g.number().optional(),openTelemetryOtlpInsecure:g.boolean().optional(),openTelemetryLogBatchSize:g.number().optional(),openTelemetryLogBatchTimeout:g.number().optional(),openTelemetryLogMaxQueueSize:g.number().optional(),enterpriseTelemetry:Pf.optional(),globalRules:g.array(In).optional(),globalWorkflows:g.array(In).optional()}),$r=g.record(g.string(),g.string());var yr=4317;var Rr="127.0.0.1:4317";import Ln from"zod";var _r=Ln.enum(["reasoning","prompt-cache","tools","provider-tools","oauth","temperature","files","streaming","vision","computer-use","local-auth","popular"]),Er=Ln.enum(["anthropic","gemini","openai-chat","openai-responses","openai-r1","ai-sdk"]),Hr=Ln.enum(["anthropic","ai-sdk","ai-sdk-community","openai","openai-compatible","openai-r1","gemini","bedrock","custom","fetch","vertex"]);var qr="runtime.team.progress.v1",kr="runtime.team.lifecycle.v1";var Ur="CLINE_ENVIRONMENT",Fr="CLINE_ENVIRONMENT_OVERRIDE",Yn={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"}},Ir="production";function Zf(n){let f=n?.trim().toLowerCase();if(f==="production"||f==="staging"||f==="local")return f;return}function Lr(){if(typeof process>"u"||!process?.env)return{};return process.env}function Xf(n={}){let f=n.env??Lr();return Zf(f.CLINE_ENVIRONMENT_OVERRIDE)??Zf(f.CLINE_ENVIRONMENT)??"production"}function Yr(n){if(typeof n==="string")return Yn[n];return Yn[Xf(n)]}var lr="sdk.error";function Dr(n,f){if(!n)return;n.capture({event:f.event??"sdk.error",properties:sf(f)})}function sf(n){return{...n.context??{},component:n.component,operation:n.operation,severity:n.severity??"error",handled:n.handled??!0,...Jf(n.error,n.messageLimit)}}function Jf(n,f=500){let o=Pr(n)?n:void 0,d=n instanceof Error?n:void 0,$=d?.message??bf(o?.message)??(typeof n==="string"?n:String(n)),y=Zr(o?.code),E=ln(o?.status)??ln(o?.statusCode)??ln(o?.responseStatus);return{error_type:d?.name?.trim()||bf(o?.name)||d?.constructor?.name||"Error",error_message:Ar(Gr($),f),...y!==void 0?{error_code:y}:{},...E!==void 0?{error_status:E}:{}}}function Gr(n){return n.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 Ar(n,f){let o=Math.max(1,Math.floor(f));return n.length>o?n.substring(0,o):n}function Pr(n){return typeof n==="object"&&n!==null}function bf(n){return typeof n==="string"&&n.trim().length>0?n:void 0}function Zr(n){if(typeof n==="string"&&n.trim().length>0)return n;if(typeof n==="number"&&Number.isFinite(n))return n;return}function ln(n){return typeof n==="number"&&Number.isFinite(n)?n:void 0}function Bf(n){let f={};if(!n)return f;try{n.split(",").forEach((o)=>{let d=o.indexOf("=");if(d<=0)return;let $=decodeURIComponent(o.substring(0,d).trim()),y=decodeURIComponent(o.substring(d+1).trim());if(!$||!y)return;f[$]=y})}catch{}return f}function Xr(){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?Bf(process.env.OTEL_EXPORTER_OTLP_HEADERS):void 0}}function Qf(n={}){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",...n}}function br(n={}){return{...Xr(),...n,metadata:Qf(n.metadata)}}function Vf(n){let f=n?.trim();return f?f:void 0}function sr(n,f){if(!n)return;let o=typeof n==="function"?n(f):n;if(!o)return;let d=Vf(o.rootSessionId);if(!d)return;return{rootSessionId:d}}function Jr(n){return Vf(n?.rootSessionId)}var Br=(n)=>crypto.getRandomValues(new Uint8Array(n)),Qr=(n,f,o)=>{let d=256-256%n.length;if(d===256){let y=n.length-1;return(E=f)=>{if(!E)return"";let I="";while(!0){let G=o(E),k=E;while(k--)if(I+=n[G[k]&y],I.length>=E)return I}}}let $=Math.ceil(409.6*f/d);return(y=f)=>{if(!y)return"";let E="";while(!0){let I=o($),G=$;while(G--)if(I[G]<d){if(E+=n[I[G]%n.length],E.length>=y)return E}}}},Wf=(n,f=21)=>Qr(n,f|0,Br);function Vr(n="",f=""){let o=Wf("1234567890abcdefghijklmnopqrstuvwxyz",10);return`${n}${Date.now()}_${o(5)}${f}`}var Wr=["idle","running","pending","completed","failed","cancelled"];var Dn=["rules","skills","workflows","plugins"],jf=Dn,jr=new Set(Dn);function Kf(n){return typeof n==="string"&&jr.has(n)}function Kr(n){if(!Array.isArray(n))return;let f=n.map((o)=>typeof o==="string"?o.trim():"").filter(Kf);return[...new Set(f)]}function Tr(n,f){return new Set(n??jf).has(f)}import{z as Z}from"zod";var Nr=Z.object({rootPath:Z.string().min(1),hint:Z.string().min(1).optional(),associatedRemoteUrls:Z.array(Z.string().min(1)).optional(),latestGitCommitHash:Z.string().min(1).optional(),latestGitBranchName:Z.string().min(1).optional()}),Cr=Z.object({currentWorkspacePath:Z.string().min(1).optional(),workspaces:Z.record(Z.string().min(1),Nr)});function Fw(){return{workspaces:{}}}function Iw(n,f){let o={...n,workspaces:{...n.workspaces,[f.rootPath]:f}};if(!o.currentWorkspacePath)o.currentWorkspacePath=f.rootPath;return Cr.parse(o)}import{z as r}from"zod";var Mr=["current_state","boundary_analysis","interface_proposal"],lw=3600000,Dw=240,Gw=400,X=r.preprocess((n)=>n instanceof Date?n.toISOString():n,r.string().datetime()),M=r.enum(["pending","in_progress","blocked","completed"]),Tf=r.enum(["queued","running","completed","failed","cancelled","interrupted"]),e=r.enum(["draft","in_review","finalized"]),Or=r.object({agentId:r.string(),role:r.enum(["lead","teammate"]),description:r.string().optional(),status:r.enum(["idle","running","stopped"])}),Aw=r.object({agentId:r.string(),rolePrompt:r.string(),modelId:r.string().optional(),maxIterations:r.number().optional()});function L(n){return r.preprocess((f)=>f===null?void 0:f,n.optional())}var Pw=r.object({agentId:r.string().min(1).describe("Teammate identifier"),rolePrompt:r.string().min(1).describe("System prompt describing teammate role")}).strict(),Zw=r.object({agentId:r.string().min(1).describe("Teammate identifier"),reason:L(r.string().min(1)).describe("Optional shutdown reason")}),Xw=r.object({}),cr={create:["title","description"],list:[],claim:["taskId"],complete:["taskId","summary"],block:["taskId","reason"]},bw={create:["status","taskId","summary","reason"]},sw=r.object({action:r.enum(["create","list","claim","complete","block"]),title:L(r.string().min(1)).describe("Task title"),description:L(r.string().min(1)).describe("Task details"),dependsOn:L(r.array(r.string().describe("Dependency task ID"))).describe("Array of dependency task IDs"),assignee:L(r.string().min(1)).describe("Optional assignee"),status:L(r.enum(["pending","in_progress","blocked","completed"])).describe("Optional task status filter"),taskId:L(r.string()).describe("Task ID"),summary:L(r.string().min(1)).describe("Completion summary"),reason:L(r.string().min(1)).describe("Blocking reason")}).superRefine((n,f)=>{for(let o of cr[n.action]){if(n[o]!==void 0)continue;f.addIssue({code:"custom",path:[o],message:`Field "${o}" is required when action=${n.action}`})}}),Jw=r.object({agentId:r.string().describe("Teammate agent ID"),task:r.string().min(1).describe("Task instructions for the teammate"),taskId:L(r.string()).describe("Optional shared task list ID"),runMode:L(r.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:L(r.boolean()).describe("If true, continue the teammate conversation; otherwise start fresh")}),Bw=r.object({status:L(r.enum(["queued","running","completed","failed","cancelled","interrupted"])).describe("Optional run status filter. Omit to include all statuses."),agentId:L(r.string().min(1)).describe("Optional teammate ID filter. Omit to include all teammates."),includeCompleted:L(r.boolean()).describe("Include completed/failed runs (default true)")}),Qw=r.object({runId:r.string().min(1).describe("Run ID"),reason:L(r.string().min(1)).describe("Optional cancellation reason")}),Vw=r.object({runId:L(r.string().min(1)).describe("Optional async run ID to await. Omit to wait for all active async runs.")}).strict(),Ww=r.object({toAgentId:r.string().min(1).describe("Recipient agent ID"),subject:r.string().min(1).describe("Message subject"),body:r.string().min(1).describe("Message body"),taskId:L(r.string().min(1)).describe("Optional task ID context")}),jw=r.object({subject:r.string().min(1).describe("Message subject"),body:r.string().min(1).describe("Message body"),taskId:L(r.string().min(1)).describe("Optional task ID context")}),Kw=r.object({unreadOnly:L(r.boolean()).describe("Only unread messages for read action (default true)")}),Tw=r.object({kind:r.enum(["progress","handoff","blocked","decision","done","error"]),summary:r.string().min(1).describe("Update summary"),taskId:L(r.string().min(1)).describe("Optional task ID context"),evidence:L(r.array(r.string().min(1))).describe("Optional evidence links/snippets"),nextAction:L(r.string().min(1)).describe("Planned next step")}),Nw=r.object({}),Cw=r.object({title:r.string().describe("Outcome title"),requiredSections:r.array(r.string()).default(Mr).describe("Required sections for finalization gate (defaults to current_state,boundary_analysis,interface_proposal)")}),Mw=r.object({outcomeId:r.string().describe("Outcome ID"),section:r.string().describe("Section name"),sourceRunId:L(r.string()).describe("Optional source run ID"),content:r.string().describe("Section fragment content")}),Ow=r.object({fragmentId:r.string().describe("Fragment ID"),approved:r.boolean().describe("Review decision")}),cw=r.object({outcomeId:r.string().describe("Outcome ID")}),hw=r.object({}),Sw=r.object({teamId:r.string(),teamName:r.string(),members:r.array(Or),taskCounts:r.record(M,r.number()),unreadMessages:r.number(),missionLogEntries:r.number(),activeRuns:r.number(),queuedRuns:r.number(),outcomeCounts:r.record(e,r.number())}),hr=r.object({id:r.string(),title:r.string(),description:r.string(),status:M,createdAt:X,updatedAt:X,createdBy:r.string(),assignee:r.string().optional(),dependsOn:r.array(r.string()),summary:r.string().optional(),isReady:r.boolean(),blockedBy:r.array(r.string())}),uw=r.discriminatedUnion("action",[r.object({action:r.literal("create"),taskId:r.string(),status:M,ignoredFields:r.array(r.string()).optional(),note:r.string().optional()}),r.object({action:r.literal("list"),tasks:r.array(hr)}),r.object({action:r.literal("claim"),taskId:r.string(),status:M,nextStep:r.string()}),r.object({action:r.literal("complete"),taskId:r.string(),status:M}),r.object({action:r.literal("block"),taskId:r.string(),status:M})]),xw=r.object({agentId:r.string(),mode:r.enum(["sync","async"]),status:r.enum(["dispatched","running","queued","joined"]),dispatched:r.boolean(),message:r.string(),deduped:r.boolean().optional(),runId:r.string().optional(),text:r.string().optional(),iterations:r.number().optional()}),Sr=r.object({textPreview:r.string(),iterations:r.number(),finishReason:r.string(),durationMs:r.number(),usage:r.object({inputTokens:r.number(),outputTokens:r.number(),cacheReadTokens:r.number().optional(),cacheWriteTokens:r.number().optional(),totalCost:r.number().optional()})}),mw=r.object({id:r.string(),agentId:r.string(),taskId:r.string().optional(),status:Tf,messagePreview:r.string(),priority:r.number(),retryCount:r.number(),maxRetries:r.number(),nextAttemptAt:X.optional(),continueConversation:r.boolean().optional(),startedAt:X,endedAt:X.optional(),leaseOwner:r.string().optional(),heartbeatAt:X.optional(),lastProgressAt:X.optional(),lastProgressMessage:r.string().optional(),currentActivity:r.string().optional(),error:r.string().optional(),resultSummary:Sr.optional()}),vw=r.object({id:r.string(),teamId:r.string(),fromAgentId:r.string(),toAgentId:r.string(),subject:r.string(),body:r.string(),taskId:r.string().optional(),sentAt:X,readAt:X.optional()}),pw=r.object({id:r.string(),teamId:r.string(),title:r.string(),status:e,requiredSections:r.array(r.string()),createdBy:r.string(),createdAt:X,finalizedAt:X.optional()}),iw=r.object({outcomeId:r.string(),status:e,requiredSections:r.array(r.string())}),tw=r.object({agentId:r.string(),status:r.string()}),ew=r.object({runId:r.string(),status:Tf}),aw=r.object({id:r.string(),toAgentId:r.string()}),zw=r.object({delivered:r.number()}),nd=r.object({id:r.string()}),fd=r.object({status:r.string()}),od=r.object({fragmentId:r.string(),status:r.string()}),rd=r.object({outcomeId:r.string(),status:e});var ur;((l)=>{l.TaskStart="task_start";l.TaskEnd="task_end";l.AgentEvent="agent_event";l.TeammateSpawned="teammate_spawned";l.TeammateShutdown="teammate_shutdown";l.TeamTaskUpdated="team_task_updated";l.TeamMessage="team_message";l.TeamMissionLog="team_mission_log";l.TeamTaskCompleted="team_task_completed";l.RunStarted="run_started";l.RunQueued="run_queued";l.RunProgress="run_progress";l.RunCompleted="run_completed";l.RunFailed="run_failed";l.RunCancelled="run_cancelled";l.RunInterrupted="run_interrupted";l.OutcomeCreated="outcome_created";l.OutcomeFragmentAttached="outcome_fragment_attached";l.OutcomeFragmentReviewed="outcome_fragment_reviewed";l.OutcomeFinalized="outcome_finalized"})(ur||={});import{z as xr}from"zod";function mr(n){let{$schema:f,...o}=n;if(typeof o.type==="string")return o;if("properties"in o||"required"in o||"additionalProperties"in o)return{type:"object",...o};for(let d of["oneOf","anyOf","allOf"]){let $=o[d];if(!Array.isArray($)||$.length===0)continue;if(d==="allOf"){if($.some((I)=>I&&typeof I==="object"&&I.type==="object"))return{type:"object",...o};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($.every((E)=>E&&typeof E==="object"&&E.type==="object"))return{type:"object",...o};throw Error(`Tool inputSchema must describe an object at the top level, but the schema has a top-level "${d}" whose branches include non-object types. Pass the strict object schema as inputSchema and reserve union/coercion schemas for use inside execute().`)}return o}function vr(n){let f=mr(n.inputSchema instanceof xr.ZodType?Un(n.inputSchema):n.inputSchema);return{name:n.name,description:n.description,inputSchema:f,lifecycle:n.lifecycle,timeoutMs:n.timeoutMs??30000,retryable:n.retryable??!0,maxRetries:n.maxRetries??3,execute:n.execute}}var Nf=["cline","oca","openai-codex"];function Cf(n){return Nf.includes(n)}var Mf=["401","403","unauthorized","forbidden","invalid token","expired token","authentication"];function pr(n,f){if(!Cf(f))return!1;let o=n instanceof Error?n.message.toLowerCase():String(n);return Mf.some((d)=>o.includes(d))}export{Un as zodToJsonSchema,xn as xmlTagsRemoval,or as validateWithZod,Iw as upsertWorkspaceInfo,rf as truncateStr,ao as truncateSplit,vn as toAiSdkToolResultOutput,Ko as serializeAbortReason,P as sanitizeSurrogates,eo as sanitizeFileName,mo as safeJsonStringify,vo as safeJsonParse,Jr as resolveRootSessionId,pn as resolveReasoningEffortRatio,Wo as resolveReasoningBudgetFromRatio,Ug as resolveHubCommandTimeoutMs,sr as resolveHookSessionContext,Vo as resolveEffectiveReasoningEffort,Xf as resolveClineEnvironment,Sn as parseUserCommandEnvelope,Kr as parseRuntimeConfigExtensions,xo as parseJsonStream,lo as parseHookEventPayload,un as normalizeUserInput,Jf as normalizeSdkError,On as normalizePluginManifest,No as noopBasicLogger,zo as maskSecret,Kf as isRuntimeConfigExtensionKind,Cf as isOAuthProviderId,pr as isLikelyAuthError,Fg as isHubToolExecutorName,Tr as hasRuntimeConfigExtension,to as getShellArgs,io as getDefaultShell,Do as getDefaultHubCommandTimeoutMs,Yr as getClineEnvironmentConfig,Po as formatUserInputBlock,Zo as formatUserCommandBlock,fr as formatUptime,Bo as formatMessagesForAiSdk,nr as formatHumanReadableDate,on as formatFileContentBlock,so as formatDisplayUserInput,To as estimateTokens,Fw as emptyWorkspaceManifest,vr as createTool,Vr as createSessionId,_o as createContributionRegistry,Qf as createClineTelemetryServiceMetadata,br as createClineTelemetryServiceConfig,Dr as captureSdkError,sf as buildSdkErrorProperties,rr as buildClineSystemPrompt,Cr as WorkspaceManifestSchema,Nr as WorkspaceInfoSchema,Ff as VertexSettingsSchema,Uf as VertexModelSchema,nn as ToolCallRecordSchema,Vn as ThinkingConfigSchema,Aw as TeamTeammateSpecSchema,uw as TeamTaskToolResultSchema,hr as TeamTaskListItemToolResultSchema,sw as TeamTaskInputSchema,Sw as TeamStatusToolResultSchema,Xw as TeamStatusInputSchema,Pw as TeamSpawnTeammateInputSchema,tw as TeamSimpleAgentStatusToolResultSchema,Zw as TeamShutdownTeammateInputSchema,aw as TeamSendMessageToolResultSchema,Ww as TeamSendMessageInputSchema,mw as TeamRunToolSummarySchema,xw as TeamRunTaskToolResultSchema,Jw as TeamRunTaskInputSchema,Sr as TeamRunResultSummarySchema,Ow as TeamReviewOutcomeFragmentInputSchema,Kw as TeamReadMailboxInputSchema,pw as TeamOutcomeToolResultSchema,od as TeamOutcomeFragmentToolResultSchema,nd as TeamMissionLogToolResultSchema,Tw as TeamMissionLogInputSchema,ur as TeamMessageType,vw as TeamMailboxMessageToolResultSchema,Bw as TeamListRunsInputSchema,hw as TeamListOutcomesInputSchema,rd as TeamFinalizeOutcomeToolResultSchema,cw as TeamFinalizeOutcomeInputSchema,iw as TeamCreateOutcomeToolResultSchema,Cw as TeamCreateOutcomeInputSchema,fd as TeamCleanupToolResultSchema,Nw as TeamCleanupInputSchema,ew as TeamCancelRunToolResultSchema,Qw as TeamCancelRunInputSchema,zw as TeamBroadcastToolResultSchema,jw as TeamBroadcastInputSchema,Vw as TeamAwaitRunsInputSchema,Mw as TeamAttachOutcomeFragmentInputSchema,bw as TEAM_TASK_IGNORED_FIELDS_BY_ACTION,Gw as TEAM_RUN_TEXT_PREVIEW_LIMIT,Dw as TEAM_RUN_MESSAGE_PREVIEW_LIMIT,qr as TEAM_PROGRESS_EVENT_TYPE,kr as TEAM_LIFECYCLE_EVENT_TYPE,lw as TEAM_AWAIT_TIMEOUT_MS,Wr as SESSION_STATUS_VALUES,lr as SDK_ERROR_TELEMETRY_EVENT,t as S3AccessKeySettingsSchema,Gf as RemoteMCPServerSchema,dr as RemoteConfigSchema,fo as ReasoningEffortSchema,Dn as RUNTIME_CONFIG_EXTENSION_KINDS,gr as REMOTE_URI_SCHEME,c as REASONING_EFFORT_RATIOS,Er as ProviderProtocolSchema,Hr as ProviderClientSchema,_r as ProviderCapabilitySchema,Af as PromptUploadingSchema,Eo as PLUGIN_FILE_EXTENSIONS,Rf as OpenAiCompatibleSchema,yf as OpenAiCompatibleModelSchema,Nf as OAUTH_PROVIDER_IDS,Bn as ModelStatusSchema,Qn as ModelPricingSchema,Wn as ModelMetadataSchema,v as ModelInfoSchema,Jn as ModelCapabilitySchema,Lf as LiteLLMSchema,If as LiteLLMModelSchema,hn as HookEventPayloadSchema,cn as HookEventNameSchema,Ag as HUB_USER_INSTRUCTIONS_SNAPSHOT_CAPABILITY,Go as HUB_TOOL_EXECUTOR_NAMES,Ig as HUB_TOOL_EXECUTOR_CAPABILITY_PREFIX,Gg as HUB_MISTAKE_LIMIT_CAPABILITY,Yg as HUB_HOOK_CAPABILITY_PREFIX,qg as HUB_DEFAULT_COMMAND_TIMEOUT_MS,Lg as HUB_CUSTOM_TOOL_CAPABILITY_PREFIX,lg as HUB_COMPACTION_CAPABILITY,kg as HUB_COMMAND_SLOW_LOG_MS,Dg as HUB_CHECKPOINT_CAPABILITY,In as GlobalInstructionsFileSchema,Pf as EnterpriseTelemetrySchema,rn as EMPTY_CONTENT_TEXT,jf as DEFAULT_RUNTIME_CONFIG_EXTENSIONS,jo as DEFAULT_REQUEST_HEADERS,Qo as DEFAULT_REASONING_EFFORT,Mr as DEFAULT_OUTCOME_REQUIRED_SECTIONS,Ir as DEFAULT_CLINE_ENVIRONMENT,fn as ContributionRegistry,go as ConnectorHookEventSchema,jn as ConnectorHookEventNameSchema,Tn as ConnectorEventContextSchema,Kn as ConnectorEventActorSchema,oo as ConnectorAuthorizationRequestSchema,ro as ConnectorAuthorizationDecisionSchema,kf as ClineSettingsSchema,qf as ClineModelSchema,Fr as CLINE_ENVIRONMENT_OVERRIDE_ENV,Ur as CLINE_ENVIRONMENT_ENV,Yn as CLINE_ENVIRONMENTS,yr as CLINE_DEFAULT_RPC_PORT,Rr as CLINE_DEFAULT_RPC_ADDRESS,Hf as AwsBedrockSettingsSchema,_f as AwsBedrockModelSchema,Ef as AwsBedrockCustomModelSchema,sn as ApiFormatSchema,af as ApiFormat,lf as AnthropicSchema,Yf as AnthropicModelSchema,Df as AllowedMCPServerSchema,no as AgentUsageSchema,og as AgentResultSchema,zf as AgentFinishReasonSchema,rg as AgentConfigSchema,Mf as AUTH_ERROR_PATTERNS,$r as APIKeySchema};
76
+ ${$f(q,$,R)}`.trim();return b}return(o==="yolo"?wf:df).replace("{{PLATFORM_NAME}}",w).replace("{{CWD}}",q).replace("{{CURRENT_DATE}}",new Date().toLocaleDateString()).replace("{{IDE_NAME}}",f).replace("{{CLINE_METADATA}}",u?$f(q,$,R):"").replace("{{CLINE_RULES}}",E||"").trim()}var or="remote://";import{z as g}from"zod";var Rf=g.object({id:g.string(),temperature:g.number().optional(),isR1FormatRequired:g.boolean().optional(),maxTokens:g.number().optional(),contextWindow:g.number().optional(),inputPrice:g.number().optional(),outputPrice:g.number().optional(),supportsImages:g.boolean().optional()}),_f=g.object({models:g.array(Rf).optional(),openAiBaseUrl:g.string().optional(),openAiHeaders:g.record(g.string(),g.string()).optional(),azureApiVersion:g.string().optional(),azureIdentity:g.boolean().optional()}),yf=g.object({id:g.string(),thinkingBudgetTokens:g.number().optional()}),Ef=g.object({name:g.string(),baseModelId:g.string(),thinkingBudgetTokens:g.number().optional()}),Hf=g.object({models:g.array(yf).optional(),customModels:g.array(Ef).optional(),awsRegion:g.string().optional(),awsUseCrossRegionInference:g.boolean().optional(),awsUseGlobalInference:g.boolean().optional(),awsBedrockUsePromptCache:g.boolean().optional(),awsBedrockEndpoint:g.string().optional()}),If=g.object({id:g.string()}),qf=g.object({models:g.array(If).optional()}),Uf=g.object({id:g.string(),thinkingBudgetTokens:g.number().optional()}),kf=g.object({models:g.array(Uf).optional(),vertexProjectId:g.string().optional(),vertexRegion:g.string().optional()}),Ff=g.object({id:g.string(),thinkingBudgetTokens:g.number().optional(),promptCachingEnabled:g.boolean().optional()}),Lf=g.object({models:g.array(Ff).optional(),baseUrl:g.string().optional()}),Yf=g.object({id:g.string(),thinkingBudgetTokens:g.number().optional()}),Df=g.object({models:g.array(Yf).optional(),baseUrl:g.string().optional()}),rr=g.object({OpenAiCompatible:_f.optional(),AwsBedrock:Hf.optional(),Cline:qf.optional(),Vertex:kf.optional(),LiteLLM:Lf.optional(),Anthropic:Df.optional()}),Af=g.object({id:g.string()}),lf=g.object({name:g.string(),url:g.string(),alwaysEnabled:g.boolean().optional(),headers:g.record(g.string(),g.string()).optional()}),Fn=g.object({alwaysEnabled:g.boolean(),name:g.string(),contents:g.string()}),t=g.object({bucket:g.string(),accessKeyId:g.string(),secretAccessKey:g.string(),region:g.string().optional(),endpoint:g.string().optional(),accountId:g.string().optional()}),Pf=g.object({enabled:g.boolean().optional(),type:g.union([g.literal("s3_access_keys"),g.literal("r2_access_keys"),g.literal("azure_access_keys")]).optional(),s3AccessSettings:t.optional(),r2AccessSettings:t.optional(),azureAccessSettings:t.optional()}),Gf=g.object({promptUploading:Pf.optional()}),gr=g.object({version:g.string(),providerSettings:rr.optional(),telemetryEnabled:g.boolean().optional(),kanbanEnabled:g.boolean().optional(),mcpMarketplaceEnabled:g.boolean().optional(),allowedMCPServers:g.array(Af).optional(),remoteMCPServers:g.array(lf).optional(),blockPersonalRemoteMCPServers:g.boolean().optional(),yoloModeAllowed:g.boolean().optional(),openTelemetryEnabled:g.boolean().optional(),openTelemetryMetricsExporter:g.string().optional(),openTelemetryLogsExporter:g.string().optional(),openTelemetryOtlpProtocol:g.string().optional(),openTelemetryOtlpEndpoint:g.string().optional(),openTelemetryOtlpHeaders:g.record(g.string(),g.string()).optional(),openTelemetryOtlpMetricsProtocol:g.string().optional(),openTelemetryOtlpMetricsEndpoint:g.string().optional(),openTelemetryOtlpMetricsHeaders:g.record(g.string(),g.string()).optional(),openTelemetryOtlpLogsProtocol:g.string().optional(),openTelemetryOtlpLogsEndpoint:g.string().optional(),openTelemetryOtlpLogsHeaders:g.record(g.string(),g.string()).optional(),openTelemetryMetricExportInterval:g.number().optional(),openTelemetryOtlpInsecure:g.boolean().optional(),openTelemetryLogBatchSize:g.number().optional(),openTelemetryLogBatchTimeout:g.number().optional(),openTelemetryLogMaxQueueSize:g.number().optional(),enterpriseTelemetry:Gf.optional(),globalRules:g.array(Fn).optional(),globalWorkflows:g.array(Fn).optional()}),dr=g.record(g.string(),g.string());var wr=4317;var $r="127.0.0.1:4317";import Ln from"zod";var Rr=Ln.enum(["reasoning","prompt-cache","tools","provider-tools","oauth","temperature","files","streaming","vision","computer-use","local-auth","popular"]),_r=Ln.enum(["anthropic","gemini","openai-chat","openai-responses","openai-r1","ai-sdk"]),yr=Ln.enum(["anthropic","ai-sdk","ai-sdk-community","openai","openai-compatible","openai-r1","gemini","bedrock","custom","fetch","vertex"]);var Er="runtime.team.progress.v1",Hr="runtime.team.lifecycle.v1";var Ir="CLINE_ENVIRONMENT",qr="CLINE_ENVIRONMENT_OVERRIDE",Yn={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"}},Ur="production";function Zf(n){let f=n?.trim().toLowerCase();if(f==="production"||f==="staging"||f==="local")return f;return}function kr(){if(typeof process>"u"||!process?.env)return{};return process.env}function sf(n={}){let f=n.env??kr();return Zf(f.CLINE_ENVIRONMENT_OVERRIDE)??Zf(f.CLINE_ENVIRONMENT)??"production"}function Fr(n){if(typeof n==="string")return Yn[n];return Yn[sf(n)]}var Lr="sdk.error";function Yr(n,f){if(!n)return;n.capture({event:f.event??"sdk.error",properties:bf(f)})}function bf(n){return{...n.context??{},component:n.component,operation:n.operation,severity:n.severity??"error",handled:n.handled??!0,...Jf(n.error,n.messageLimit)}}function Jf(n,f=500){let o=lr(n)?n:void 0,w=n instanceof Error?n:void 0,$=w?.message??Xf(o?.message)??(typeof n==="string"?n:String(n)),R=Pr(o?.code),E=Dn(o?.status)??Dn(o?.statusCode)??Dn(o?.responseStatus);return{error_type:w?.name?.trim()||Xf(o?.name)||w?.constructor?.name||"Error",error_message:Ar(Dr($),f),...R!==void 0?{error_code:R}:{},...E!==void 0?{error_status:E}:{}}}function Dr(n){return n.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 Ar(n,f){let o=Math.max(1,Math.floor(f));return n.length>o?n.substring(0,o):n}function lr(n){return typeof n==="object"&&n!==null}function Xf(n){return typeof n==="string"&&n.trim().length>0?n:void 0}function Pr(n){if(typeof n==="string"&&n.trim().length>0)return n;if(typeof n==="number"&&Number.isFinite(n))return n;return}function Dn(n){return typeof n==="number"&&Number.isFinite(n)?n:void 0}function Bf(n){let f={};if(!n)return f;try{n.split(",").forEach((o)=>{let w=o.indexOf("=");if(w<=0)return;let $=decodeURIComponent(o.substring(0,w).trim()),R=decodeURIComponent(o.substring(w+1).trim());if(!$||!R)return;f[$]=R})}catch{}return f}function Gr(){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?Bf(process.env.OTEL_EXPORTER_OTLP_HEADERS):void 0}}function Qf(n={}){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",...n}}function Zr(n={}){return{...Gr(),...n,metadata:Qf(n.metadata)}}function Vf(n){let f=n?.trim();return f?f:void 0}function sr(n,f){if(!n)return;let o=typeof n==="function"?n(f):n;if(!o)return;let w=Vf(o.rootSessionId);if(!w)return;return{rootSessionId:w}}function Xr(n){return Vf(n?.rootSessionId)}var br=(n)=>crypto.getRandomValues(new Uint8Array(n)),Jr=(n,f,o)=>{let w=256-256%n.length;if(w===256){let R=n.length-1;return(E=f)=>{if(!E)return"";let F="";while(!0){let l=o(E),q=E;while(q--)if(F+=n[l[q]&R],F.length>=E)return F}}}let $=Math.ceil(409.6*f/w);return(R=f)=>{if(!R)return"";let E="";while(!0){let F=o($),l=$;while(l--)if(F[l]<w){if(E+=n[F[l]%n.length],E.length>=R)return E}}}},Wf=(n,f=21)=>Jr(n,f|0,br);function Br(n="",f=""){let o=Wf("1234567890abcdefghijklmnopqrstuvwxyz",10);return`${n}${Date.now()}_${o(5)}${f}`}var Qr=["idle","running","pending","completed","failed","cancelled"];var An=["rules","skills","workflows","plugins"],jf=An,Vr=new Set(An);function Kf(n){return typeof n==="string"&&Vr.has(n)}function Wr(n){if(!Array.isArray(n))return;let f=n.map((o)=>typeof o==="string"?o.trim():"").filter(Kf);return[...new Set(f)]}function jr(n,f){return new Set(n??jf).has(f)}import{z as Z}from"zod";var Kr=Z.object({rootPath:Z.string().min(1),hint:Z.string().min(1).optional(),associatedRemoteUrls:Z.array(Z.string().min(1)).optional(),latestGitCommitHash:Z.string().min(1).optional(),latestGitBranchName:Z.string().min(1).optional()}),Tr=Z.object({currentWorkspacePath:Z.string().min(1).optional(),workspaces:Z.record(Z.string().min(1),Kr)});function qd(){return{workspaces:{}}}function Ud(n,f){let o={...n,workspaces:{...n.workspaces,[f.rootPath]:f}};if(!o.currentWorkspacePath)o.currentWorkspacePath=f.rootPath;return Tr.parse(o)}import{z as r}from"zod";var Nr=["current_state","boundary_analysis","interface_proposal"],Ld=3600000,Yd=240,Dd=400,s=r.preprocess((n)=>n instanceof Date?n.toISOString():n,r.string().datetime()),M=r.enum(["pending","in_progress","blocked","completed"]),Tf=r.enum(["queued","running","completed","failed","cancelled","interrupted"]),e=r.enum(["draft","in_review","finalized"]),Cr=r.object({agentId:r.string(),role:r.enum(["lead","teammate"]),description:r.string().optional(),status:r.enum(["idle","running","stopped"])}),Ad=r.object({agentId:r.string(),rolePrompt:r.string(),modelId:r.string().optional(),maxIterations:r.number().optional()});function L(n){return r.preprocess((f)=>f===null?void 0:f,n.optional())}var ld=r.object({agentId:r.string().min(1).describe("Teammate identifier"),rolePrompt:r.string().min(1).describe("System prompt describing teammate role")}).strict(),Pd=r.object({agentId:r.string().min(1).describe("Teammate identifier"),reason:L(r.string().min(1)).describe("Optional shutdown reason")}),Gd=r.object({}),Mr={create:["title","description"],list:[],claim:["taskId"],complete:["taskId","summary"],block:["taskId","reason"]},Zd={create:["status","taskId","summary","reason"]},sd=r.object({action:r.enum(["create","list","claim","complete","block"]),title:L(r.string().min(1)).describe("Task title"),description:L(r.string().min(1)).describe("Task details"),dependsOn:L(r.array(r.string().describe("Dependency task ID"))).describe("Array of dependency task IDs"),assignee:L(r.string().min(1)).describe("Optional assignee"),status:L(r.enum(["pending","in_progress","blocked","completed"])).describe("Optional task status filter"),taskId:L(r.string()).describe("Task ID"),summary:L(r.string().min(1)).describe("Completion summary"),reason:L(r.string().min(1)).describe("Blocking reason")}).superRefine((n,f)=>{for(let o of Mr[n.action]){if(n[o]!==void 0)continue;f.addIssue({code:"custom",path:[o],message:`Field "${o}" is required when action=${n.action}`})}}),Xd=r.object({agentId:r.string().describe("Teammate agent ID"),task:r.string().min(1).describe("Task instructions for the teammate"),taskId:L(r.string()).describe("Optional shared task list ID"),runMode:L(r.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:L(r.boolean()).describe("If true, continue the teammate conversation; otherwise start fresh")}),bd=r.object({status:L(r.enum(["queued","running","completed","failed","cancelled","interrupted"])).describe("Optional run status filter. Omit to include all statuses."),agentId:L(r.string().min(1)).describe("Optional teammate ID filter. Omit to include all teammates."),includeCompleted:L(r.boolean()).describe("Include completed/failed runs (default true)")}),Jd=r.object({runId:r.string().min(1).describe("Run ID"),reason:L(r.string().min(1)).describe("Optional cancellation reason")}),Bd=r.object({runId:L(r.string().min(1)).describe("Optional async run ID to await. Omit to wait for all active async runs.")}).strict(),Qd=r.object({toAgentId:r.string().min(1).describe("Recipient agent ID"),subject:r.string().min(1).describe("Message subject"),body:r.string().min(1).describe("Message body"),taskId:L(r.string().min(1)).describe("Optional task ID context")}),Vd=r.object({subject:r.string().min(1).describe("Message subject"),body:r.string().min(1).describe("Message body"),taskId:L(r.string().min(1)).describe("Optional task ID context")}),Wd=r.object({unreadOnly:L(r.boolean()).describe("Only unread messages for read action (default true)")}),jd=r.object({kind:r.enum(["progress","handoff","blocked","decision","done","error"]),summary:r.string().min(1).describe("Update summary"),taskId:L(r.string().min(1)).describe("Optional task ID context"),evidence:L(r.array(r.string().min(1))).describe("Optional evidence links/snippets"),nextAction:L(r.string().min(1)).describe("Planned next step")}),Kd=r.object({}),Td=r.object({title:r.string().describe("Outcome title"),requiredSections:r.array(r.string()).default(Nr).describe("Required sections for finalization gate (defaults to current_state,boundary_analysis,interface_proposal)")}),Nd=r.object({outcomeId:r.string().describe("Outcome ID"),section:r.string().describe("Section name"),sourceRunId:L(r.string()).describe("Optional source run ID"),content:r.string().describe("Section fragment content")}),Cd=r.object({fragmentId:r.string().describe("Fragment ID"),approved:r.boolean().describe("Review decision")}),Md=r.object({outcomeId:r.string().describe("Outcome ID")}),Od=r.object({}),cd=r.object({teamId:r.string(),teamName:r.string(),members:r.array(Cr),taskCounts:r.record(M,r.number()),unreadMessages:r.number(),missionLogEntries:r.number(),activeRuns:r.number(),queuedRuns:r.number(),outcomeCounts:r.record(e,r.number())}),Or=r.object({id:r.string(),title:r.string(),description:r.string(),status:M,createdAt:s,updatedAt:s,createdBy:r.string(),assignee:r.string().optional(),dependsOn:r.array(r.string()),summary:r.string().optional(),isReady:r.boolean(),blockedBy:r.array(r.string())}),hd=r.discriminatedUnion("action",[r.object({action:r.literal("create"),taskId:r.string(),status:M,ignoredFields:r.array(r.string()).optional(),note:r.string().optional()}),r.object({action:r.literal("list"),tasks:r.array(Or)}),r.object({action:r.literal("claim"),taskId:r.string(),status:M,nextStep:r.string()}),r.object({action:r.literal("complete"),taskId:r.string(),status:M}),r.object({action:r.literal("block"),taskId:r.string(),status:M})]),Sd=r.object({agentId:r.string(),mode:r.enum(["sync","async"]),status:r.enum(["dispatched","running","queued","joined"]),dispatched:r.boolean(),message:r.string(),deduped:r.boolean().optional(),runId:r.string().optional(),text:r.string().optional(),iterations:r.number().optional()}),cr=r.object({textPreview:r.string(),iterations:r.number(),finishReason:r.string(),durationMs:r.number(),usage:r.object({inputTokens:r.number(),outputTokens:r.number(),cacheReadTokens:r.number().optional(),cacheWriteTokens:r.number().optional(),totalCost:r.number().optional()})}),ud=r.object({id:r.string(),agentId:r.string(),taskId:r.string().optional(),status:Tf,messagePreview:r.string(),priority:r.number(),retryCount:r.number(),maxRetries:r.number(),nextAttemptAt:s.optional(),continueConversation:r.boolean().optional(),startedAt:s,endedAt:s.optional(),leaseOwner:r.string().optional(),heartbeatAt:s.optional(),lastProgressAt:s.optional(),lastProgressMessage:r.string().optional(),currentActivity:r.string().optional(),error:r.string().optional(),resultSummary:cr.optional()}),xd=r.object({id:r.string(),teamId:r.string(),fromAgentId:r.string(),toAgentId:r.string(),subject:r.string(),body:r.string(),taskId:r.string().optional(),sentAt:s,readAt:s.optional()}),vd=r.object({id:r.string(),teamId:r.string(),title:r.string(),status:e,requiredSections:r.array(r.string()),createdBy:r.string(),createdAt:s,finalizedAt:s.optional()}),md=r.object({outcomeId:r.string(),status:e,requiredSections:r.array(r.string())}),pd=r.object({agentId:r.string(),status:r.string()}),id=r.object({runId:r.string(),status:Tf}),td=r.object({id:r.string(),toAgentId:r.string()}),ed=r.object({delivered:r.number()}),ad=r.object({id:r.string()}),zd=r.object({status:r.string()}),nw=r.object({fragmentId:r.string(),status:r.string()}),fw=r.object({outcomeId:r.string(),status:e});var hr;((D)=>{D.TaskStart="task_start";D.TaskEnd="task_end";D.AgentEvent="agent_event";D.TeammateSpawned="teammate_spawned";D.TeammateShutdown="teammate_shutdown";D.TeamTaskUpdated="team_task_updated";D.TeamMessage="team_message";D.TeamMissionLog="team_mission_log";D.TeamTaskCompleted="team_task_completed";D.RunStarted="run_started";D.RunQueued="run_queued";D.RunProgress="run_progress";D.RunCompleted="run_completed";D.RunFailed="run_failed";D.RunCancelled="run_cancelled";D.RunInterrupted="run_interrupted";D.OutcomeCreated="outcome_created";D.OutcomeFragmentAttached="outcome_fragment_attached";D.OutcomeFragmentReviewed="outcome_fragment_reviewed";D.OutcomeFinalized="outcome_finalized"})(hr||={});import{z as Sr}from"zod";function ur(n){let{$schema:f,...o}=n;if(typeof o.type==="string")return o;if("properties"in o||"required"in o||"additionalProperties"in o)return{type:"object",...o};for(let w of["oneOf","anyOf","allOf"]){let $=o[w];if(!Array.isArray($)||$.length===0)continue;if(w==="allOf"){if($.some((F)=>F&&typeof F==="object"&&F.type==="object"))return{type:"object",...o};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($.every((E)=>E&&typeof E==="object"&&E.type==="object"))return{type:"object",...o};throw Error(`Tool inputSchema must describe an object at the top level, but the schema has a top-level "${w}" whose branches include non-object types. Pass the strict object schema as inputSchema and reserve union/coercion schemas for use inside execute().`)}return o}function xr(n){let f=ur(n.inputSchema instanceof Sr.ZodType?Un(n.inputSchema):n.inputSchema);return{name:n.name,description:n.description,inputSchema:f,lifecycle:n.lifecycle,timeoutMs:n.timeoutMs??30000,retryable:n.retryable??!0,maxRetries:n.maxRetries??3,execute:n.execute}}var Nf=["401","403","unauthorized","forbidden","invalid token","expired token","authentication"];function vr(n){let f=n instanceof Error?n.message.toLowerCase():String(n);return Nf.some((o)=>f.includes(o))}export{Un as zodToJsonSchema,xn as xmlTagsRemoval,nr as validateWithZod,Ud as upsertWorkspaceInfo,rf as truncateStr,to as truncateSplit,mn as toAiSdkToolResultOutput,Wo as serializeAbortReason,G as sanitizeSurrogates,io as sanitizeFileName,uo as safeJsonStringify,xo as safeJsonParse,Xr as resolveRootSessionId,pn as resolveReasoningEffortRatio,Qo as resolveReasoningBudgetFromRatio,Ig as resolveHubCommandTimeoutMs,sr as resolveHookSessionContext,Bo as resolveEffectiveReasoningEffort,sf as resolveClineEnvironment,Sn as parseUserCommandEnvelope,Wr as parseRuntimeConfigExtensions,So as parseJsonStream,Lo as parseHookEventPayload,un as normalizeUserInput,Jf as normalizeSdkError,On as normalizePluginManifest,Ko as noopBasicLogger,eo as maskSecret,Kf as isRuntimeConfigExtensionKind,vr as isLikelyAuthError,qg as isHubToolExecutorName,jr as hasRuntimeConfigExtension,po as getShellArgs,mo as getDefaultShell,Yo as getDefaultHubCommandTimeoutMs,Fr as getClineEnvironmentConfig,lo as formatUserInputBlock,Po as formatUserCommandBlock,zo as formatUptime,bo as formatMessagesForAiSdk,ao as formatHumanReadableDate,on as formatFileContentBlock,so as formatDisplayUserInput,jo as estimateTokens,qd as emptyWorkspaceManifest,xr as createTool,Br as createSessionId,Ro as createContributionRegistry,Qf as createClineTelemetryServiceMetadata,Zr as createClineTelemetryServiceConfig,Yr as captureSdkError,bf as buildSdkErrorProperties,fr as buildClineSystemPrompt,Tr as WorkspaceManifestSchema,Kr as WorkspaceInfoSchema,kf as VertexSettingsSchema,Uf as VertexModelSchema,nn as ToolCallRecordSchema,Vn as ThinkingConfigSchema,Ad as TeamTeammateSpecSchema,hd as TeamTaskToolResultSchema,Or as TeamTaskListItemToolResultSchema,sd as TeamTaskInputSchema,cd as TeamStatusToolResultSchema,Gd as TeamStatusInputSchema,ld as TeamSpawnTeammateInputSchema,pd as TeamSimpleAgentStatusToolResultSchema,Pd as TeamShutdownTeammateInputSchema,td as TeamSendMessageToolResultSchema,Qd as TeamSendMessageInputSchema,ud as TeamRunToolSummarySchema,Sd as TeamRunTaskToolResultSchema,Xd as TeamRunTaskInputSchema,cr as TeamRunResultSummarySchema,Cd as TeamReviewOutcomeFragmentInputSchema,Wd as TeamReadMailboxInputSchema,vd as TeamOutcomeToolResultSchema,nw as TeamOutcomeFragmentToolResultSchema,ad as TeamMissionLogToolResultSchema,jd as TeamMissionLogInputSchema,hr as TeamMessageType,xd as TeamMailboxMessageToolResultSchema,bd as TeamListRunsInputSchema,Od as TeamListOutcomesInputSchema,fw as TeamFinalizeOutcomeToolResultSchema,Md as TeamFinalizeOutcomeInputSchema,md as TeamCreateOutcomeToolResultSchema,Td as TeamCreateOutcomeInputSchema,zd as TeamCleanupToolResultSchema,Kd as TeamCleanupInputSchema,id as TeamCancelRunToolResultSchema,Jd as TeamCancelRunInputSchema,ed as TeamBroadcastToolResultSchema,Vd as TeamBroadcastInputSchema,Bd as TeamAwaitRunsInputSchema,Nd as TeamAttachOutcomeFragmentInputSchema,Zd as TEAM_TASK_IGNORED_FIELDS_BY_ACTION,Dd as TEAM_RUN_TEXT_PREVIEW_LIMIT,Yd as TEAM_RUN_MESSAGE_PREVIEW_LIMIT,Er as TEAM_PROGRESS_EVENT_TYPE,Hr as TEAM_LIFECYCLE_EVENT_TYPE,Ld as TEAM_AWAIT_TIMEOUT_MS,Qr as SESSION_STATUS_VALUES,Lr as SDK_ERROR_TELEMETRY_EVENT,t as S3AccessKeySettingsSchema,lf as RemoteMCPServerSchema,gr as RemoteConfigSchema,zf as ReasoningEffortSchema,An as RUNTIME_CONFIG_EXTENSION_KINDS,or as REMOTE_URI_SCHEME,c as REASONING_EFFORT_RATIOS,_r as ProviderProtocolSchema,yr as ProviderClientSchema,Rr as ProviderCapabilitySchema,Pf as PromptUploadingSchema,_o as PLUGIN_FILE_EXTENSIONS,_f as OpenAiCompatibleSchema,Rf as OpenAiCompatibleModelSchema,Bn as ModelStatusSchema,Qn as ModelPricingSchema,Wn as ModelMetadataSchema,m as ModelInfoSchema,Jn as ModelCapabilitySchema,Lf as LiteLLMSchema,Ff as LiteLLMModelSchema,hn as HookEventPayloadSchema,cn as HookEventNameSchema,Ag as HUB_USER_INSTRUCTIONS_SNAPSHOT_CAPABILITY,Do as HUB_TOOL_EXECUTOR_NAMES,Ug as HUB_TOOL_EXECUTOR_CAPABILITY_PREFIX,Dg as HUB_MISTAKE_LIMIT_CAPABILITY,Fg as HUB_HOOK_CAPABILITY_PREFIX,Eg as HUB_DEFAULT_COMMAND_TIMEOUT_MS,kg as HUB_CUSTOM_TOOL_CAPABILITY_PREFIX,Lg as HUB_COMPACTION_CAPABILITY,Hg as HUB_COMMAND_SLOW_LOG_MS,Yg as HUB_CHECKPOINT_CAPABILITY,Fn as GlobalInstructionsFileSchema,Gf as EnterpriseTelemetrySchema,rn as EMPTY_CONTENT_TEXT,jf as DEFAULT_RUNTIME_CONFIG_EXTENSIONS,Vo as DEFAULT_REQUEST_HEADERS,Jo as DEFAULT_REASONING_EFFORT,Nr as DEFAULT_OUTCOME_REQUIRED_SECTIONS,Ur as DEFAULT_CLINE_ENVIRONMENT,fn as ContributionRegistry,oo as ConnectorHookEventSchema,jn as ConnectorHookEventNameSchema,Tn as ConnectorEventContextSchema,Kn as ConnectorEventActorSchema,no as ConnectorAuthorizationRequestSchema,fo as ConnectorAuthorizationDecisionSchema,qf as ClineSettingsSchema,If as ClineModelSchema,qr as CLINE_ENVIRONMENT_OVERRIDE_ENV,Ir as CLINE_ENVIRONMENT_ENV,Yn as CLINE_ENVIRONMENTS,wr as CLINE_DEFAULT_RPC_PORT,$r as CLINE_DEFAULT_RPC_ADDRESS,Hf as AwsBedrockSettingsSchema,yf as AwsBedrockModelSchema,Ef as AwsBedrockCustomModelSchema,bn as ApiFormatSchema,tf as ApiFormat,Df as AnthropicSchema,Yf as AnthropicModelSchema,Af as AllowedMCPServerSchema,af as AgentUsageSchema,ng as AgentResultSchema,ef as AgentFinishReasonSchema,fg as AgentConfigSchema,Nf as AUTH_ERROR_PATTERNS,dr as APIKeySchema};
package/dist/index.d.ts CHANGED
@@ -64,6 +64,5 @@ export * from "./session/workspace";
64
64
  export * from "./team";
65
65
  export { createTool } from "./tools/create";
66
66
  export * from "./types";
67
- export type { OAuthProviderId } from "./types/auth";
68
- export { AUTH_ERROR_PATTERNS, isLikelyAuthError, isOAuthProviderId, OAUTH_PROVIDER_IDS, } from "./types/auth";
67
+ export { AUTH_ERROR_PATTERNS, isLikelyAuthError } from "./types/auth";
69
68
  export { initVcr } from "./vcr";