@sctg/cline-shared 3.84.0-beta.20260524130712
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +47 -0
- package/dist/agent.d.ts +388 -0
- package/dist/agents/index.d.ts +1 -0
- package/dist/agents/types.d.ts +967 -0
- package/dist/automation/index.d.ts +3 -0
- package/dist/automation/index.js +65 -0
- package/dist/automation/schemas.d.ts +89 -0
- package/dist/automation/types.d.ts +151 -0
- package/dist/connectors/events.d.ts +93 -0
- package/dist/connectors/options.d.ts +174 -0
- package/dist/cron/cron-spec-types.d.ts +94 -0
- package/dist/cron/index.d.ts +1 -0
- package/dist/db/index.d.ts +2 -0
- package/dist/db/index.js +80 -0
- package/dist/db/sqlite-db.d.ts +24 -0
- package/dist/dispose.d.ts +13 -0
- package/dist/extensions/context.d.ts +76 -0
- package/dist/extensions/contribution-registry.d.ts +195 -0
- package/dist/extensions/plugin.d.ts +1 -0
- package/dist/hooks/contracts.d.ts +9 -0
- package/dist/hooks/events.d.ts +194 -0
- package/dist/hub.d.ts +470 -0
- package/dist/index.browser.d.ts +61 -0
- package/dist/index.browser.js +76 -0
- package/dist/index.d.ts +69 -0
- package/dist/index.js +163 -0
- package/dist/llms/ai-sdk-format.d.ts +55 -0
- package/dist/llms/gateway.d.ts +145 -0
- package/dist/llms/messages.d.ts +149 -0
- package/dist/llms/model-info.d.ts +120 -0
- package/dist/llms/reasoning-effort.d.ts +21 -0
- package/dist/llms/requests.d.ts +2 -0
- package/dist/llms/tokens.d.ts +7 -0
- package/dist/llms/tools.d.ts +86 -0
- package/dist/logging/logger.d.ts +37 -0
- package/dist/parse/error.d.ts +2 -0
- package/dist/parse/headers/utils.d.ts +1 -0
- package/dist/parse/json.d.ts +3 -0
- package/dist/parse/shell.d.ts +2 -0
- package/dist/parse/string.d.ts +4 -0
- package/dist/parse/time.d.ts +9 -0
- package/dist/parse/zod.d.ts +12 -0
- package/dist/prompt/cline.d.ts +24 -0
- package/dist/prompt/format.d.ts +11 -0
- package/dist/prompt/system.d.ts +2 -0
- package/dist/remote-config/artifact-store.d.ts +13 -0
- package/dist/remote-config/blob-storage.d.ts +47 -0
- package/dist/remote-config/bundle.d.ts +136 -0
- package/dist/remote-config/constants.d.ts +5 -0
- package/dist/remote-config/index.d.ts +9 -0
- package/dist/remote-config/index.js +76 -0
- package/dist/remote-config/materializer.d.ts +4 -0
- package/dist/remote-config/paths.d.ts +10 -0
- package/dist/remote-config/runtime.d.ts +20 -0
- package/dist/remote-config/schema.d.ts +408 -0
- package/dist/remote-config/telemetry.d.ts +9 -0
- package/dist/rpc/index.d.ts +5 -0
- package/dist/rpc/runtime.d.ts +322 -0
- package/dist/rpc/team-progress.d.ts +53 -0
- package/dist/runtime/build-env.d.ts +13 -0
- package/dist/runtime/cline-environment.d.ts +17 -0
- package/dist/runtime/hub-daemon-env.d.ts +2 -0
- package/dist/services/telemetry-config.d.ts +6 -0
- package/dist/services/telemetry.d.ts +133 -0
- package/dist/session/hook-context.d.ts +12 -0
- package/dist/session/index.d.ts +1 -0
- package/dist/session/records.d.ts +31 -0
- package/dist/session/runtime-config.d.ts +26 -0
- package/dist/session/runtime-env.d.ts +8 -0
- package/dist/session/workspace.d.ts +28 -0
- package/dist/storage/index.d.ts +2 -0
- package/dist/storage/index.js +1 -0
- package/dist/storage/path-resolution.d.ts +11 -0
- package/dist/storage/paths.d.ts +86 -0
- package/dist/team/index.d.ts +2 -0
- package/dist/team/schema.d.ts +411 -0
- package/dist/team/types.d.ts +196 -0
- package/dist/tools/create.d.ts +22 -0
- package/dist/types/auth.d.ts +20 -0
- package/dist/types/index.d.ts +2 -0
- package/dist/types/vcr.d.ts +14 -0
- package/dist/vcr.d.ts +41 -0
- package/package.json +63 -0
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import{z as w}from"zod";import{z as Y}from"zod";var Zn=Y.enum(["default","openai-responses","r1"]),ef={DEFAULT:"default",OPENAI_RESPONSES:"openai-responses",R1:"r1"},bn=Y.enum(["images","tools","streaming","prompt-cache","reasoning","reasoning-effort","computer-use","global-endpoint","structured_output","temperature","files"]),Jn=Y.enum(["active","preview","deprecated","legacy"]),Bn=Y.object({input:Y.number().optional(),output:Y.number().optional(),cacheWrite:Y.number().optional(),cacheRead:Y.number().optional()}),Qn=Y.object({maxBudget:Y.number().optional(),outputPrice:Y.number().optional(),thinkingLevel:Y.enum(["low","high"]).optional()}),Vn=Y.object({reasoningDefaultOn:Y.boolean().optional()}).catchall(Y.unknown()),v=Y.object({id:Y.string(),name:Y.string().optional(),description:Y.string().optional(),maxTokens:Y.number().optional(),contextWindow:Y.number().optional(),maxInputTokens:Y.number().optional(),capabilities:Y.array(bn).optional(),apiFormat:Zn.optional(),systemRole:Y.enum(["system","developer"]).optional(),temperature:Y.number().optional(),pricing:Bn.optional(),thinkingConfig:Qn.optional(),status:Jn.optional(),deprecationNotice:Y.string().optional(),replacedBy:Y.string().optional(),releaseDate:Y.string().optional(),deprecationDate:Y.string().optional(),family:Y.string().optional(),metadata:Vn.optional()});import{z as Z}from"zod";var nn=Z.object({id:Z.string(),name:Z.string(),input:Z.unknown(),output:Z.unknown(),error:Z.string().optional(),durationMs:Z.number(),startedAt:Z.date(),endedAt:Z.date()});var af=w.enum(["completed","max_iterations","aborted","mistake_limit","error"]),zf=w.object({inputTokens:w.number(),outputTokens:w.number(),cacheReadTokens:w.number().optional(),cacheWriteTokens:w.number().optional(),totalCost:w.number().optional()}),fg=w.object({text:w.string(),usage:zf,messages:w.array(w.custom()),toolCalls:w.array(nn),iterations:w.number(),finishReason:af,model:w.object({id:w.string(),provider:w.string(),info:v.optional()}),startedAt:w.date(),endedAt:w.date(),durationMs:w.number()}),no=w.enum(["low","medium","high","xhigh"]),og=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:no.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 Wn=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"]),jn=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()}),fo=H.object({actor:jn,context:Tn,payload:H.record(H.string(),H.unknown()).optional()}),oo=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()}),ro=H.object({adapter:H.string(),botUserName:H.string().optional(),event:Wn,payload:H.record(H.string(),H.unknown()),ts:H.string()});var go=["hooks","tools","commands","rules","messageBuilders","providers","automationEvents"],wo=new Set(go);function Cn(n,f){return n.name||`extension_${String(f).padStart(4,"0")}`}function Kn(n){return Array.isArray(n)&&n.every((f)=>typeof f==="string")}function Nn(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 Mn(n){let f=Nn(n.providerIds),o=Nn(n.modelIds);return{...n,...f?{providerIds:f}:{},...o?{modelIds:o}:{}}}function $o(n,f){let o=Cn(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 F of d.capabilities){if(!wo.has(F))throw Error(`Invalid manifest for extension "${o}": unsupported capability "${String(F)}"`);$.add(F)}if(Object.hasOwn(d,"providerIds")&&!Kn(d.providerIds))throw Error(`Invalid manifest for extension "${o}": providerIds must be a string array when provided`);if(Object.hasOwn(d,"modelIds")&&!Kn(d.modelIds))throw Error(`Invalid manifest for extension "${o}": modelIds must be a string array when provided`);let _=$.has("hooks");if(n.hooks!==void 0&&!_)throw Error(`Invalid manifest for extension "${o}": runtime hooks require the "hooks" capability`);return{capabilities:$,raw:Mn(d)}}function Eo(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:$o(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=Cn(f,n.order),d={registerTool:(_)=>this.registry.tools.push(_),registerCommand:(_)=>this.registry.commands.push(_),registerRule:(_)=>{if(!n.manifest.capabilities.has("rules"))throw Error(`Invalid setup for extension "${o}": registerRule requires the "rules" capability`);this.registry.rules.push(_)},registerMessageBuilder:(_)=>this.registry.messageBuilder.push(_),registerProvider:(_)=>this.registry.providers.push(_),registerAutomationEventType:(_)=>{if(!n.manifest.capabilities.has("automationEvents"))throw Error(`Invalid setup for extension "${o}": registerAutomationEventType requires the "automationEvents" capability`);this.registry.automationEventTypes.push(Eo(_,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 yo=[".js",".ts"];import{z as E}from"zod";var On=E.enum(["agent_start","agent_resume","agent_abort","agent_end","agent_error","tool_call","tool_result","prompt_submit","pre_compact","session_shutdown"]),j=E.record(E.string(),E.string()),Ro=E.object({toolName:E.string(),parameters:j}),Ho=E.object({toolName:E.string(),parameters:j,result:E.string(),success:E.boolean(),executionTimeMs:E.number()}),qo=E.object({prompt:E.string(),attachments:E.array(E.string())}),ko=E.object({taskMetadata:j}),Uo=E.object({taskMetadata:j,previousState:j}),Yo=E.object({taskMetadata:j}),Fo=E.object({taskMetadata:j}),Io=E.object({taskId:E.string(),ulid:E.string(),contextSize:E.number(),compactionStrategy:E.string(),previousApiReqIndex:E.number(),tokensIn:E.number(),tokensOut:E.number(),tokensInCache:E.number(),tokensOutCache:E.number(),deletedRangeStart:E.number(),deletedRangeEnd:E.number(),contextJsonPath:E.string(),contextRawPath:E.string()}),cn=E.object({clineVersion:E.string(),hookName:On,timestamp:E.string(),taskId:E.string(),sessionContext:E.object({rootSessionId:E.string().optional(),hookLogPath:E.string().optional()}).optional(),workspaceRoots:E.array(E.string()),workspaceInfo:E.custom().optional(),userId:E.string(),agent_id:E.string(),parent_agent_id:E.string().nullable(),iteration:E.number().optional(),reason:E.string().optional(),tool_call:E.object({id:E.string(),name:E.string(),input:E.unknown()}).optional(),tool_result:E.custom().optional(),turn:E.unknown().optional(),error:E.object({name:E.string(),message:E.string(),stack:E.string().optional()}).optional(),preToolUse:Ro.optional(),postToolUse:Ho.optional(),userPromptSubmit:qo.optional(),taskStart:ko.optional(),taskResume:Uo.optional(),taskCancel:Yo.optional(),taskComplete:Fo.optional(),preCompact:Io.optional()}).passthrough();function Lo(n){let f=cn.safeParse(n);if(!f.success)return;return f.data}var Hg=30000,qg=5000;function lo(n){switch(n){case"run.start":case"session.send_input":return null;default:return 30000}}function kg(n,f){return f===void 0?lo(n):f}var so=["readFile","search","bash","webFetch","editor","applyPatch","skills","askQuestion","submit"],Po=new Set(so);function Ug(n){return typeof n==="string"&&Po.has(n)}var Yg="tool_executor.",Fg="custom_tool.",Ig="hook.",Lg="compaction.compact",lg="checkpoint.create",sg="mistake_limit.decide",Pg="user_instructions.snapshot";function on(n,f){return`<file_content path="${n}">
|
|
2
|
+
${f}
|
|
3
|
+
</file_content>`}function Do(n,f="act"){return`<user_input mode="${f}">${n}</user_input>`}function Go(n,f){return`<user_command slash="${f}">${n}</user_command>`}function Ao(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 Xo(n,f){return new RegExp(`${f}="([^"]+)"`,"i").exec(n)?.[1]?.trim()||void 0}function hn(n){if(!n?.trim())return;let f=Ao(n,"user_command");if(!f)return;let o=Xo(f.attrs,"slash");if(!o)return;return{slash:o,content:f.content.trim()}}function Sn(n){if(!n?.trim())return"";let f=n.trim();for(let o of["user_input","user_command"]){let d=un(f,o);f=(d!==f?d:f.replace(new RegExp(`<${o}[^>]*>`,"g"),"")).trim()}return f}function Zo(n){let f=Sn(n),o=hn(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 un(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,"�")}function xn(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 bo(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 rn(n,f){if(n==null||typeof n!=="object")return n;if(Array.isArray(n)){let $=[];for(let _ of n){if(_&&typeof _==="object"){let R=_;if(R.type==="image"&&typeof R.data==="string"&&typeof R.mediaType==="string"){f.push({type:"image",data:R.data,mediaType:R.mediaType});continue}if(R.type==="text"&&typeof R.text==="string"){$.push(R.text);continue}}$.push(rn(_,f))}return $}let o=n,d={};for(let[$,_]of Object.entries(o))d[$]=rn(_,f);return d}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[d,$]of Object.entries(f))o[d]=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&&bo(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=[],d=rn(n,o);if(o.length>0)return{type:"content",value:[{type:"text",text:typeof d==="string"?G(d):JSON.stringify(p(d))},...o.map((_)=>({type:"image-data",data:_.data,mediaType:_.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 Jo(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"?G(n):n});for(let _ of f){let R=_.content;if(typeof R==="string"){$.push({role:_.role,content:G(R)});continue}let F=[],P=[];for(let k of R)switch(k.type){case"text":F.push({type:"text",text:G(k.text),...k.providerOptions?{providerOptions:k.providerOptions}:{}});break;case"reasoning":F.push({type:"reasoning",text:G(k.text),...k.providerOptions?{providerOptions:k.providerOptions}:{}});break;case"image":F.push({type:"image",image:k.image,mediaType:k.mediaType});break;case"file":F.push({type:"text",text:on(k.path,G(k.content))});break;case"tool-call":if(_.role==="assistant")F.push({type:"tool-call",toolCallId:k.toolCallId,toolName:k.toolName,[d]:k.input,...k.providerOptions?{providerOptions:k.providerOptions}:{}});break;case"tool-result":{P.push({type:"tool-result",toolCallId:k.toolCallId,toolName:k.toolName,output:mn(k.output,k.isError??!1)});break}}if(F.length>0)xn($,{role:_.role,content:F});if(P.length>0)xn($,{role:"tool",content:P})}return $}var c={xhigh:0.95,high:0.8,medium:0.5,low:0.2,minimal:0.1,none:0},Bo=void 0;function Qo(n,f){if(typeof n==="string"&&n.toLowerCase()in c)return n.toLowerCase();return f?void 0:void 0}function vn(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 Vo(n){let f=vn(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 Wo={"HTTP-Referer":"https://cline.bot","X-Title":"Cline","X-IS-MULTIROOT":"false","X-CLIENT-TYPE":"cline-sdk"};function jo(n){return n instanceof Error?{name:n.name,message:n.message}:n}function To(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 pn(n){return/^[0-9A-Fa-f]$/.test(n)}function V(n){return n>="0"&&n<="9"}function tn(n){return n>=" "}function h(n){return`,:[]/{}()
|
|
4
|
+
+`.includes(n)}function gn(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 dn=/^(http|https|ftp|mailto|file|data|irc):\/\/$/,$n=/^[A-Za-z0-9-._~:/?#@!$&'()*+;=]$/;function En(n){return`,[]/{}
|
|
5
|
+
+`.includes(n)}function _n(n){return S(n)||No.test(n)}var No=/^[[{\w-]$/;function en(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 an(n,f){let o=n.charCodeAt(f);return o===32||o===9||o===13}function zn(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 yn(n)||i(n)}function yn(n){return n==='"'||n==="“"||n==="”"}function Rn(n){return n==='"'}function i(n){return n==="'"||n==="‘"||n==="’"||n==="`"||n==="´"}function Hn(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 D(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 nf(n,f,o){return n.substring(0,f)+n.substring(f+o)}function ff(n){return/[,\n][ \t\r]*$/.test(n)}var Co={"\b":"\\b","\f":"\\f","\n":"\\n","\r":"\\r","\t":"\\t"},Mo={'"':'"',"\\":"\\","/":"/",b:"\b",f:"\f",n:`
|
|
7
|
+
`,r:"\r",t:"\t"};function qn(n){let f=0,o="";if(k(["```","[```","{```"]),!_())vf();k(["```","```]","```}"]);let $=T(",");if($)R();if(_n(n[f])&&ff(o)){if(!$)o=D(o,",");hf()}else if($)o=C(o,",");while(n[f]==="}"||n[f]==="]")f++,R();if(f>=n.length)return o;mf();function _(){R();let y=Of()||cf()||K()||l()||Sf()||Dn(!1)||uf();return R(),y}function R(){let y=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0,q=f,U=F(y);do if(U=P(),U)U=F(y);while(U);return f>q}function F(y){let q=y?Q:an,U="";while(!0)if(q(n,f))U+=n[f],f++;else if(zn(n,f))U+=" ",f++;else break;if(U.length>0)return o+=U,!0;return!1}function P(){if(n[f]==="/"&&n[f+1]==="*"){while(f<n.length&&!Oo(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(y){if(u(y)){if(gn(n[f]))while(f<n.length&&wn(n[f]))f++;return R(),!0}return!1}function u(y){F(!0);for(let q of y){let U=f+q.length;if(n.slice(f,U)===q)return f=U,!0}return!1}function T(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 Mf(){return b("\\")}function sn(){if(R(),n[f]==="."&&n[f+1]==="."&&n[f+2]===".")return f+=3,R(),b(","),!0;return!1}function Of(){if(n[f]==="{"){if(o+="{",f++,R(),b(","))R();let y=!0;while(f<n.length&&n[f]!=="}"){let q;if(!y){if(q=T(","),!q)o=D(o,",");R()}else q=!0,y=!1;if(sn(),!(K()||Dn(!0))){if(n[f]==="}"||n[f]==="{"||n[f]==="]"||n[f]==="["||n[f]===void 0)o=C(o,",");else pf();break}R();let m=T(":"),W=f>=n.length;if(!m)if(_n(n[f])||W)o=D(o,":");else An();if(!_())if(m||W)o+="null";else An()}if(n[f]==="}")o+="}",f++;else o=D(o,"}");return!0}return!1}function cf(){if(n[f]==="["){if(o+="[",f++,R(),b(","))R();let y=!0;while(f<n.length&&n[f]!=="]"){if(!y){if(!T(","))o=D(o,",")}else y=!1;if(sn(),!_()){o=C(o,",");break}}if(n[f]==="]")o+="]",f++;else o=D(o,"]");return!0}return!1}function hf(){let y=!0,q=!0;while(q){if(!y){if(!T(","))o=D(o,",")}else y=!1;q=_()}if(!q)o=C(o,",");o=`[
|
|
9
|
+
${o}
|
|
10
|
+
]`}function K(){let y=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=Rn(n[f])?Rn:Hn(n[f])?Hn:i(n[f])?i:yn,W=f,O=o.length,L='"';f++;while(!0){if(f>=n.length){let s=Gn(f-1);if(!y&&h(n.charAt(s)))return f=W,o=o.substring(0,O),K(!0);return L=D(L,'"'),o+=L,!0}if(f===q)return L=D(L,'"'),o+=L,!0;if(m(n[f])){let s=f,z=L.length;if(L+='"',f++,o+=L,R(!1),y||f>=n.length||h(n[f])||S(n[f])||V(n[f]))return Pn(),!0;let J=Gn(s-1),Xn=n.charAt(J);if(Xn===",")return f=W,o=o.substring(0,O),K(!1,J);if(h(Xn))return f=W,o=o.substring(0,O),K(!0);o=o.substring(0,O),f=s+1,L=`${L.substring(0,z)}\\${L.substring(z)}`}else if(y&&En(n[f])){if(n[f-1]===":"&&dn.test(n.substring(W+1,f+2)))while(f<n.length&&$n.test(n[f]))L+=n[f],f++;return L=D(L,'"'),o+=L,Pn(),!0}else if(n[f]==="\\"){let s=n.charAt(f+1);if(Mo[s]!==void 0)L+=n.slice(f,f+2),f+=2;else if(s==="u"){let J=2;while(J<6&&pn(n[f+J]))J++;if(J===6)L+=n.slice(f,f+6),f+=6;else if(f+J>=n.length)f=n.length;else tf()}else if(s===`
|
|
11
|
+
`)L+="\\n",f+=2;else L+=s,f+=2}else{let s=n.charAt(f);if(s==='"'&&n[f-1]!=="\\")L+=`\\${s}`,f++;else if(en(s))L+=Co[s],f++;else{if(!tn(s))xf(s);L+=s,f++}}if(U)Mf()}}return!1}function Pn(){let y=!1;R();while(n[f]==="+"){y=!0,f++,R(),o=C(o,'"',!0);let q=o.length;if(K())o=nf(o,q,1);else o=D(o,'"')}return y}function l(){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 q=n.slice(y,f),U=/^0\d/.test(q);return o+=U?`"${q}"`:q,!0}return!1}function Sf(){return N("true","true")||N("false","false")||N("null","null")||N("True","true")||N("False","false")||N("None","null")}function N(y,q){if(n.slice(f,f+y.length)===y)return o+=q,f+=y.length,!0;return!1}function Dn(y){let q=f;if(gn(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,_(),n[f]===")"){if(f++,n[f]===";")f++}return!0}}while(f<n.length&&!En(n[f])&&!S(n[f])&&(!y||n[f]!==":"))f++;if(n[f-1]===":"&&dn.test(n.substring(q,f+2)))while(f<n.length&&$n.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 uf(){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 Gn(y){let q=y;while(q>0&&Q(n,q))q--;return q}function x(){return f>=n.length||h(n[f])||Q(n,f)}function a(y){o+=`${n.slice(y,f)}0`}function xf(y){throw new B(`Invalid character ${JSON.stringify(y)}`,f)}function mf(){throw new B(`Unexpected character ${JSON.stringify(n[f])}`,f)}function vf(){throw new B("Unexpected end of json string",n.length)}function pf(){throw new B("Object key expected",f)}function An(){throw new B("Colon expected",f)}function tf(){let y=n.slice(f,f+6);throw new B(`Invalid unicode character "${y}"`,f)}}function Oo(n,f){return n[f]==="*"&&n[f+1]==="/"}var co=/^\{\s*"([A-Za-z0-9_.$-]+)"\s*:\s*([\s\S]+?)\s*\}$/;function ho(n){let f=n.match(co);if(!f)return;let[,o,d]=f,$=d.trim();if(!$)return;let _=$[0];if(_==='"'||_==="{"||_==="["||$==="true"||$==="false"||$==="null"||Number.isFinite(Number($)))return;return JSON.parse(`{"${o}":${JSON.stringify($)}}`)}var So=[(n)=>JSON.parse(n),(n)=>JSON.parse(qn(n)),ho];function uo(n){if(typeof n!=="string")return n;let f=n.trimStart();if(f[0]!=="{"&&f[0]!=="[")return n;for(let o of So)try{let d=o(f);if(d!==void 0)return d}catch{}return n}function xo(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 mo(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 po(n){return n==="win32"?"powershell":"/bin/bash"}function io(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 to(n){return n.toLowerCase().replace(/[^\w.-]+/g,"_")}function of(n,f){if(n.length<=f)return n;return`${n.slice(0,f-1)}…`}function eo(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}…`:of(n,o)}function ao(n){if(n.length<=8)return"****";return`${n.slice(0,4)}...${n.slice(-4)}`}function zo(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 nr(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),_=f%60;if(o>0)return`${o}d ${d}h`;if(d>0)return`${d}h ${$}m`;if($>0)return`${$}m ${_}s`;return`${_}s`}import{z as rf}from"zod";function fr(n,f){let o=n.safeParse(f);if(!o.success)throw Error(rf.prettifyError(o.error));return o.data}function kn(n){return rf.toJSONSchema(n)}var gf=`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
|
+
|
|
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
|
+
Review each question carefully and answer it with detailed, accurate information.
|
|
15
|
+
If you need more information, use one of the available tools or ask for clarification instead of making assumptions or lies.
|
|
16
|
+
|
|
17
|
+
Environment you are running in:
|
|
18
|
+
<env>
|
|
19
|
+
1. Platform: {{PLATFORM_NAME}}
|
|
20
|
+
2. Date: {{CURRENT_DATE}}
|
|
21
|
+
3. IDE: {{IDE_NAME}}
|
|
22
|
+
4. Working Directory: {{CWD}}
|
|
23
|
+
</env>
|
|
24
|
+
|
|
25
|
+
Remember:
|
|
26
|
+
- Always adhere to existing code conventions and patterns.
|
|
27
|
+
- Use only libraries and frameworks that are confirmed to be in use in the current codebase.
|
|
28
|
+
- Provide complete and functional code without omissions or placeholders.
|
|
29
|
+
- Be explicit about any assumptions or limitations in your solution.
|
|
30
|
+
- Always show your planning process before executing any task. This will help ensure that you have a clear understanding of the requirements and that your approach aligns with the user's needs.
|
|
31
|
+
- Always use absolute paths when referring to files.
|
|
32
|
+
- Always verify the files you have edited or created at the end of the task to ensure they are completed and working as expected.
|
|
33
|
+
|
|
34
|
+
Begin by analyzing the user's input and gathering any necessary additional context. Then, present your plan at the start of your response along with tool calls before proceeding with the task. It's OK for this section to be quite long.
|
|
35
|
+
|
|
36
|
+
REMEMBER, be helpful and proactive! Don't ask for permission to do something when you can do it! Do not indicates you will be using a tool unless you are actually going to use it.
|
|
37
|
+
|
|
38
|
+
IMPORTANT: Always includes tool calls in your response until the task is completed. Response without tool calls will considered as completed with final answer.
|
|
39
|
+
|
|
40
|
+
When you have completed the task, please provide a summary of what you did and any relevant information that the user should know. This will help ensure that the user understands the changes made and can easily follow up if they have any questions or need further assistance. Do not indicate that you will perform an action without actually doing it. Always provide the final result in your response. Always validate your answer with checking the code and running it if possible.
|
|
41
|
+
|
|
42
|
+
If user asked a simple question without any coding context, answer it directly without using any tools.
|
|
43
|
+
{{CLINE_RULES}}
|
|
44
|
+
{{CLINE_METADATA}}`,wf=`You are Cline, a careful and helpful coding agent that works in the background.
|
|
45
|
+
You are tasked to solve an issue reported by the user who you cannot communicate with directly.
|
|
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
|
+
|
|
48
|
+
RULES:
|
|
49
|
+
- Always match output format exactly as shown in examples or existing files.
|
|
50
|
+
- Use only libraries and frameworks that are confirmed and compatible to be in use in the current codebase.
|
|
51
|
+
- Provide complete and functional code without omissions or placeholders.
|
|
52
|
+
- Always show your planning process without repeating yourself before executing any task. This will help ensure that you have a clear understanding of the requirements and that your approach aligns with the user's request.
|
|
53
|
+
- Always use absolute paths when referring to files.
|
|
54
|
+
- Always verify the files you have edited or created at the end of the task to ensure they are completed and working as expected.
|
|
55
|
+
|
|
56
|
+
Environment you are running in:
|
|
57
|
+
<env>
|
|
58
|
+
1. Platform: {{PLATFORM_NAME}}
|
|
59
|
+
2. Date: {{CURRENT_DATE}}
|
|
60
|
+
3. IDE: {{IDE_NAME}}
|
|
61
|
+
4. Working Directory: {{CWD}}
|
|
62
|
+
</env>
|
|
63
|
+
|
|
64
|
+
IMPORTANT:
|
|
65
|
+
- When the user describes a bug, unexpected behavior, or provides a bug report, your primary goal is to produce a correct fix in the source code that resolves the issue.
|
|
66
|
+
- A correct fix means the underlying behavior is fixed — not just the symptoms addressed superficially.
|
|
67
|
+
- After applying your fix, you must run the relevant test suite to confirm your changes actually resolve the problem. If tests fail, analyze the failures, revise your fix, and re-run until tests pass.
|
|
68
|
+
- Do not consider the task complete until the test suite related to the files you have touched passes.
|
|
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
|
+
- Response without the submit_and_exit tool call will considered not completed and the task will continue.
|
|
71
|
+
{{CLINE_RULES}}
|
|
72
|
+
{{CLINE_METADATA}}`;var Un="# Workspace Configuration";function df(n,f,o){if(o?.trim()?.includes(Un))return o.trim();let d=o||JSON.stringify({workspaces:{[n]:{hint:f||n.split("/").at(-1)||n}}},null,2);return`
|
|
73
|
+
${Un}
|
|
74
|
+
${d}`}function or(n){let{ide:f="Terminal Shell",mode:o,platform:d="unknown",workspaceName:$,metadata:_,rules:R,overridePrompt:F,providerId:P}=n,k=n.workspaceRoot??n.rootPath??"",u=P==="cline";if(F?.trim()){let b=F.trim();if(u&&_?.trim()&&!b.includes(Un))return`${b}
|
|
75
|
+
|
|
76
|
+
${df(k,$,_)}`.trim();return b}return(o==="yolo"?wf:gf).replace("{{PLATFORM_NAME}}",d).replace("{{CWD}}",k).replace("{{CURRENT_DATE}}",new Date().toLocaleDateString()).replace("{{IDE_NAME}}",f).replace("{{CLINE_METADATA}}",u?df(k,$,_):"").replace("{{CLINE_RULES}}",R||"").trim()}var rr="remote://";import{z as g}from"zod";var $f=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()}),Ef=g.object({models:g.array($f).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()}),yf=g.object({name:g.string(),baseModelId:g.string(),thinkingBudgetTokens:g.number().optional()}),Rf=g.object({models:g.array(_f).optional(),customModels:g.array(yf).optional(),awsRegion:g.string().optional(),awsUseCrossRegionInference:g.boolean().optional(),awsUseGlobalInference:g.boolean().optional(),awsBedrockUsePromptCache:g.boolean().optional(),awsBedrockEndpoint:g.string().optional()}),Hf=g.object({id:g.string()}),qf=g.object({models:g.array(Hf).optional()}),kf=g.object({id:g.string(),thinkingBudgetTokens:g.number().optional()}),Uf=g.object({models:g.array(kf).optional(),vertexProjectId:g.string().optional(),vertexRegion:g.string().optional()}),Yf=g.object({id:g.string(),thinkingBudgetTokens:g.number().optional(),promptCachingEnabled:g.boolean().optional()}),Ff=g.object({models:g.array(Yf).optional(),baseUrl:g.string().optional()}),If=g.object({id:g.string(),thinkingBudgetTokens:g.number().optional()}),Lf=g.object({models:g.array(If).optional(),baseUrl:g.string().optional()}),gr=g.object({OpenAiCompatible:Ef.optional(),AwsBedrock:Rf.optional(),Cline:qf.optional(),Vertex:Uf.optional(),LiteLLM:Ff.optional(),Anthropic:Lf.optional()}),lf=g.object({id:g.string()}),sf=g.object({name:g.string(),url:g.string(),alwaysEnabled:g.boolean().optional(),headers:g.record(g.string(),g.string()).optional()}),Yn=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()}),Df=g.object({promptUploading:Pf.optional()}),wr=g.object({version:g.string(),providerSettings:gr.optional(),telemetryEnabled:g.boolean().optional(),kanbanEnabled:g.boolean().optional(),mcpMarketplaceEnabled:g.boolean().optional(),allowedMCPServers:g.array(lf).optional(),remoteMCPServers:g.array(sf).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:Df.optional(),globalRules:g.array(Yn).optional(),globalWorkflows:g.array(Yn).optional()}),dr=g.record(g.string(),g.string());var $r=4317;var Er="127.0.0.1:4317";import Fn from"zod";var _r=Fn.enum(["reasoning","prompt-cache","tools","provider-tools","oauth","temperature","files","streaming","vision","computer-use","local-auth","popular"]),yr=Fn.enum(["anthropic","gemini","openai-chat","openai-responses","openai-r1","ai-sdk"]),Rr=Fn.enum(["anthropic","ai-sdk","ai-sdk-community","openai","openai-compatible","openai-r1","gemini","bedrock","custom","fetch","vertex"]);var Hr="runtime.team.progress.v1",qr="runtime.team.lifecycle.v1";var kr="CLINE_ENVIRONMENT",Ur="CLINE_ENVIRONMENT_OVERRIDE",In={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"}},Yr="production";function Gf(n){let f=n?.trim().toLowerCase();if(f==="production"||f==="staging"||f==="local")return f;return}function Fr(){if(typeof process>"u"||!process?.env)return{};return process.env}function Af(n={}){let f=n.env??Fr();return Gf(f.CLINE_ENVIRONMENT_OVERRIDE)??Gf(f.CLINE_ENVIRONMENT)??"production"}function Ir(n){if(typeof n==="string")return In[n];return In[Af(n)]}var Lr="sdk.error";function lr(n,f){if(!n)return;n.capture({event:f.event??"sdk.error",properties:Zf(f)})}function Zf(n){return{...n.context??{},component:n.component,operation:n.operation,severity:n.severity??"error",handled:n.handled??!0,...bf(n.error,n.messageLimit)}}function bf(n,f=500){let o=Dr(n)?n:void 0,d=n instanceof Error?n:void 0,$=d?.message??Xf(o?.message)??(typeof n==="string"?n:String(n)),_=Gr(o?.code),R=Ln(o?.status)??Ln(o?.statusCode)??Ln(o?.responseStatus);return{error_type:d?.name?.trim()||Xf(o?.name)||d?.constructor?.name||"Error",error_message:Pr(sr($),f),..._!==void 0?{error_code:_}:{},...R!==void 0?{error_status:R}:{}}}function sr(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 Pr(n,f){let o=Math.max(1,Math.floor(f));return n.length>o?n.substring(0,o):n}function Dr(n){return typeof n==="object"&&n!==null}function Xf(n){return typeof n==="string"&&n.trim().length>0?n:void 0}function Gr(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 Jf(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()),_=decodeURIComponent(o.substring(d+1).trim());if(!$||!_)return;f[$]=_})}catch{}return f}function Ar(){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?Jf(process?.env?.OTEL_EXPORTER_OTLP_HEADERS):void 0}}function Bf(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 Xr(n={}){return{...Ar(),...n,metadata:Bf(n.metadata)}}function Qf(n){let f=n?.trim();return f?f:void 0}function Zr(n,f){if(!n)return;let o=typeof n==="function"?n(f):n;if(!o)return;let d=Qf(o.rootSessionId);if(!d)return;return{rootSessionId:d}}function br(n){return Qf(n?.rootSessionId)}var Jr=(n)=>crypto.getRandomValues(new Uint8Array(n)),Br=(n,f,o)=>{let d=256-256%n.length;if(d===256){let _=n.length-1;return(R=f)=>{if(!R)return"";let F="";while(!0){let P=o(R),k=R;while(k--)if(F+=n[P[k]&_],F.length>=R)return F}}}let $=Math.ceil(409.6*f/d);return(_=f)=>{if(!_)return"";let R="";while(!0){let F=o($),P=$;while(P--)if(F[P]<d){if(R+=n[F[P]%n.length],R.length>=_)return R}}}},Vf=(n,f=21)=>Br(n,f|0,Jr);function Qr(n="",f=""){let o=Vf("1234567890abcdefghijklmnopqrstuvwxyz",10);return`${n}${Date.now()}_${o(5)}${f}`}var Vr=["idle","running","pending","completed","failed","cancelled"];var ln=["rules","skills","workflows","plugins"],Wf=ln,Wr=new Set(ln);function jf(n){return typeof n==="string"&&Wr.has(n)}function jr(n){if(!Array.isArray(n))return;let f=n.map((o)=>typeof o==="string"?o.trim():"").filter(jf);return[...new Set(f)]}function Tr(n,f){return new Set(n??Wf).has(f)}import{z as A}from"zod";var Kr=A.object({rootPath:A.string().min(1),hint:A.string().min(1).optional(),associatedRemoteUrls:A.array(A.string().min(1)).optional(),latestGitCommitHash:A.string().min(1).optional(),latestGitBranchName:A.string().min(1).optional()}),Nr=A.object({currentWorkspacePath:A.string().min(1).optional(),workspaces:A.record(A.string().min(1),Kr)});function Uw(){return{workspaces:{}}}function Yw(n,f){let o={...n,workspaces:{...n.workspaces,[f.rootPath]:f}};if(!o.currentWorkspacePath)o.currentWorkspacePath=f.rootPath;return Nr.parse(o)}import{z as r}from"zod";var Cr=["current_state","boundary_analysis","interface_proposal"],Lw=3600000,lw=240,sw=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"]),Mr=r.object({agentId:r.string(),role:r.enum(["lead","teammate"]),description:r.string().optional(),status:r.enum(["idle","running","stopped"])}),Pw=r.object({agentId:r.string(),rolePrompt:r.string(),modelId:r.string().optional(),maxIterations:r.number().optional()});function I(n){return r.preprocess((f)=>f===null?void 0:f,n.optional())}var Dw=r.object({agentId:r.string().min(1).describe("Teammate identifier"),rolePrompt:r.string().min(1).describe("System prompt describing teammate role")}).strict(),Gw=r.object({agentId:r.string().min(1).describe("Teammate identifier"),reason:I(r.string().min(1)).describe("Optional shutdown reason")}),Aw=r.object({}),Or={create:["title","description"],list:[],claim:["taskId"],complete:["taskId","summary"],block:["taskId","reason"]},Xw={create:["status","taskId","summary","reason"]},Zw=r.object({action:r.enum(["create","list","claim","complete","block"]),title:I(r.string().min(1)).describe("Task title"),description:I(r.string().min(1)).describe("Task details"),dependsOn:I(r.array(r.string().describe("Dependency task ID"))).describe("Array of dependency task IDs"),assignee:I(r.string().min(1)).describe("Optional assignee"),status:I(r.enum(["pending","in_progress","blocked","completed"])).describe("Optional task status filter"),taskId:I(r.string()).describe("Task ID"),summary:I(r.string().min(1)).describe("Completion summary"),reason:I(r.string().min(1)).describe("Blocking reason")}).superRefine((n,f)=>{for(let o of Or[n.action]){if(n[o]!==void 0)continue;f.addIssue({code:"custom",path:[o],message:`Field "${o}" is required when action=${n.action}`})}}),bw=r.object({agentId:r.string().describe("Teammate agent ID"),task:r.string().min(1).describe("Task instructions for the teammate"),taskId:I(r.string()).describe("Optional shared task list ID"),runMode:I(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:I(r.boolean()).describe("If true, continue the teammate conversation; otherwise start fresh")}),Jw=r.object({status:I(r.enum(["queued","running","completed","failed","cancelled","interrupted"])).describe("Optional run status filter. Omit to include all statuses."),agentId:I(r.string().min(1)).describe("Optional teammate ID filter. Omit to include all teammates."),includeCompleted:I(r.boolean()).describe("Include completed/failed runs (default true)")}),Bw=r.object({runId:r.string().min(1).describe("Run ID"),reason:I(r.string().min(1)).describe("Optional cancellation reason")}),Qw=r.object({runId:I(r.string().min(1)).describe("Optional async run ID to await. Omit to wait for all active async runs.")}).strict(),Vw=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:I(r.string().min(1)).describe("Optional task ID context")}),Ww=r.object({subject:r.string().min(1).describe("Message subject"),body:r.string().min(1).describe("Message body"),taskId:I(r.string().min(1)).describe("Optional task ID context")}),jw=r.object({unreadOnly:I(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:I(r.string().min(1)).describe("Optional task ID context"),evidence:I(r.array(r.string().min(1))).describe("Optional evidence links/snippets"),nextAction:I(r.string().min(1)).describe("Planned next step")}),Kw=r.object({}),Nw=r.object({title:r.string().describe("Outcome title"),requiredSections:r.array(r.string()).default(Cr).describe("Required sections for finalization gate (defaults to current_state,boundary_analysis,interface_proposal)")}),Cw=r.object({outcomeId:r.string().describe("Outcome ID"),section:r.string().describe("Section name"),sourceRunId:I(r.string()).describe("Optional source run ID"),content:r.string().describe("Section fragment content")}),Mw=r.object({fragmentId:r.string().describe("Fragment ID"),approved:r.boolean().describe("Review decision")}),Ow=r.object({outcomeId:r.string().describe("Outcome ID")}),cw=r.object({}),hw=r.object({teamId:r.string(),teamName:r.string(),members:r.array(Mr),taskCounts:r.record(M,r.number()),unreadMessages:r.number(),missionLogEntries:r.number(),activeRuns:r.number(),queuedRuns:r.number(),outcomeCounts:r.record(e,r.number())}),cr=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())}),Sw=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(cr)}),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})]),uw=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()}),hr=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()})}),xw=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:hr.optional()}),mw=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()}),vw=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()}),pw=r.object({outcomeId:r.string(),status:e,requiredSections:r.array(r.string())}),iw=r.object({agentId:r.string(),status:r.string()}),tw=r.object({runId:r.string(),status:Tf}),ew=r.object({id:r.string(),toAgentId:r.string()}),aw=r.object({delivered:r.number()}),zw=r.object({id:r.string()}),nd=r.object({status:r.string()}),fd=r.object({fragmentId:r.string(),status:r.string()}),od=r.object({outcomeId:r.string(),status:e});var Sr;((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"})(Sr||={});import{z as ur}from"zod";function xr(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((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((R)=>R&&typeof R==="object"&&R.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 mr(n){let f=xr(n.inputSchema instanceof ur.ZodType?kn(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 Kf=["cline","oca","openai-codex"];function Nf(n){return Kf.includes(n)}var Cf=["401","403","unauthorized","forbidden","invalid token","expired token","authentication"];function vr(n,f){if(!Nf(f))return!1;let o=n instanceof Error?n.message.toLowerCase():String(n);return Cf.some((d)=>o.includes(d))}export{kn as zodToJsonSchema,un as xmlTagsRemoval,fr as validateWithZod,Yw as upsertWorkspaceInfo,of as truncateStr,eo as truncateSplit,mn as toAiSdkToolResultOutput,jo as serializeAbortReason,G as sanitizeSurrogates,to as sanitizeFileName,xo as safeJsonStringify,mo as safeJsonParse,br as resolveRootSessionId,vn as resolveReasoningEffortRatio,Vo as resolveReasoningBudgetFromRatio,kg as resolveHubCommandTimeoutMs,Zr as resolveHookSessionContext,Qo as resolveEffectiveReasoningEffort,Af as resolveClineEnvironment,hn as parseUserCommandEnvelope,jr as parseRuntimeConfigExtensions,uo as parseJsonStream,Lo as parseHookEventPayload,Sn as normalizeUserInput,bf as normalizeSdkError,Mn as normalizePluginManifest,Ko as noopBasicLogger,ao as maskSecret,jf as isRuntimeConfigExtensionKind,Nf as isOAuthProviderId,vr as isLikelyAuthError,Ug as isHubToolExecutorName,Tr as hasRuntimeConfigExtension,io as getShellArgs,po as getDefaultShell,lo as getDefaultHubCommandTimeoutMs,Ir as getClineEnvironmentConfig,Do as formatUserInputBlock,Go as formatUserCommandBlock,nr as formatUptime,Jo as formatMessagesForAiSdk,zo as formatHumanReadableDate,on as formatFileContentBlock,Zo as formatDisplayUserInput,To as estimateTokens,Uw as emptyWorkspaceManifest,mr as createTool,Qr as createSessionId,_o as createContributionRegistry,Bf as createClineTelemetryServiceMetadata,Xr as createClineTelemetryServiceConfig,lr as captureSdkError,Zf as buildSdkErrorProperties,or as buildClineSystemPrompt,Nr as WorkspaceManifestSchema,Kr as WorkspaceInfoSchema,Uf as VertexSettingsSchema,kf as VertexModelSchema,nn as ToolCallRecordSchema,Qn as ThinkingConfigSchema,Pw as TeamTeammateSpecSchema,Sw as TeamTaskToolResultSchema,cr as TeamTaskListItemToolResultSchema,Zw as TeamTaskInputSchema,hw as TeamStatusToolResultSchema,Aw as TeamStatusInputSchema,Dw as TeamSpawnTeammateInputSchema,iw as TeamSimpleAgentStatusToolResultSchema,Gw as TeamShutdownTeammateInputSchema,ew as TeamSendMessageToolResultSchema,Vw as TeamSendMessageInputSchema,xw as TeamRunToolSummarySchema,uw as TeamRunTaskToolResultSchema,bw as TeamRunTaskInputSchema,hr as TeamRunResultSummarySchema,Mw as TeamReviewOutcomeFragmentInputSchema,jw as TeamReadMailboxInputSchema,vw as TeamOutcomeToolResultSchema,fd as TeamOutcomeFragmentToolResultSchema,zw as TeamMissionLogToolResultSchema,Tw as TeamMissionLogInputSchema,Sr as TeamMessageType,mw as TeamMailboxMessageToolResultSchema,Jw as TeamListRunsInputSchema,cw as TeamListOutcomesInputSchema,od as TeamFinalizeOutcomeToolResultSchema,Ow as TeamFinalizeOutcomeInputSchema,pw as TeamCreateOutcomeToolResultSchema,Nw as TeamCreateOutcomeInputSchema,nd as TeamCleanupToolResultSchema,Kw as TeamCleanupInputSchema,tw as TeamCancelRunToolResultSchema,Bw as TeamCancelRunInputSchema,aw as TeamBroadcastToolResultSchema,Ww as TeamBroadcastInputSchema,Qw as TeamAwaitRunsInputSchema,Cw as TeamAttachOutcomeFragmentInputSchema,Xw as TEAM_TASK_IGNORED_FIELDS_BY_ACTION,sw as TEAM_RUN_TEXT_PREVIEW_LIMIT,lw as TEAM_RUN_MESSAGE_PREVIEW_LIMIT,Hr as TEAM_PROGRESS_EVENT_TYPE,qr as TEAM_LIFECYCLE_EVENT_TYPE,Lw as TEAM_AWAIT_TIMEOUT_MS,Vr as SESSION_STATUS_VALUES,Lr as SDK_ERROR_TELEMETRY_EVENT,t as S3AccessKeySettingsSchema,sf as RemoteMCPServerSchema,wr as RemoteConfigSchema,no as ReasoningEffortSchema,ln as RUNTIME_CONFIG_EXTENSION_KINDS,rr as REMOTE_URI_SCHEME,c as REASONING_EFFORT_RATIOS,yr as ProviderProtocolSchema,Rr as ProviderClientSchema,_r as ProviderCapabilitySchema,Pf as PromptUploadingSchema,yo as PLUGIN_FILE_EXTENSIONS,Ef as OpenAiCompatibleSchema,$f as OpenAiCompatibleModelSchema,Kf as OAUTH_PROVIDER_IDS,Jn as ModelStatusSchema,Bn as ModelPricingSchema,Vn as ModelMetadataSchema,v as ModelInfoSchema,bn as ModelCapabilitySchema,Ff as LiteLLMSchema,Yf as LiteLLMModelSchema,cn as HookEventPayloadSchema,On as HookEventNameSchema,Pg as HUB_USER_INSTRUCTIONS_SNAPSHOT_CAPABILITY,so as HUB_TOOL_EXECUTOR_NAMES,Yg as HUB_TOOL_EXECUTOR_CAPABILITY_PREFIX,sg as HUB_MISTAKE_LIMIT_CAPABILITY,Ig as HUB_HOOK_CAPABILITY_PREFIX,Hg as HUB_DEFAULT_COMMAND_TIMEOUT_MS,Fg as HUB_CUSTOM_TOOL_CAPABILITY_PREFIX,Lg as HUB_COMPACTION_CAPABILITY,qg as HUB_COMMAND_SLOW_LOG_MS,lg as HUB_CHECKPOINT_CAPABILITY,Yn as GlobalInstructionsFileSchema,Df as EnterpriseTelemetrySchema,Wf as DEFAULT_RUNTIME_CONFIG_EXTENSIONS,Wo as DEFAULT_REQUEST_HEADERS,Bo as DEFAULT_REASONING_EFFORT,Cr as DEFAULT_OUTCOME_REQUIRED_SECTIONS,Yr as DEFAULT_CLINE_ENVIRONMENT,fn as ContributionRegistry,ro as ConnectorHookEventSchema,Wn as ConnectorHookEventNameSchema,Tn as ConnectorEventContextSchema,jn as ConnectorEventActorSchema,fo as ConnectorAuthorizationRequestSchema,oo as ConnectorAuthorizationDecisionSchema,qf as ClineSettingsSchema,Hf as ClineModelSchema,Ur as CLINE_ENVIRONMENT_OVERRIDE_ENV,kr as CLINE_ENVIRONMENT_ENV,In as CLINE_ENVIRONMENTS,$r as CLINE_DEFAULT_RPC_PORT,Er as CLINE_DEFAULT_RPC_ADDRESS,Rf as AwsBedrockSettingsSchema,_f as AwsBedrockModelSchema,yf as AwsBedrockCustomModelSchema,Zn as ApiFormatSchema,ef as ApiFormat,Lf as AnthropicSchema,If as AnthropicModelSchema,lf as AllowedMCPServerSchema,zf as AgentUsageSchema,fg as AgentResultSchema,af as AgentFinishReasonSchema,og as AgentConfigSchema,Cf as AUTH_ERROR_PATTERNS,dr as APIKeySchema};
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
export * from "./agent";
|
|
2
|
+
export * from "./agents";
|
|
3
|
+
export type { ConnectorAuthorizationDecision, ConnectorAuthorizationRequest, ConnectorEventActor, ConnectorEventContext, ConnectorHookEvent, ConnectorHookEventName, } from "./connectors/events";
|
|
4
|
+
export { ConnectorAuthorizationDecisionSchema, ConnectorAuthorizationRequestSchema, ConnectorEventActorSchema, ConnectorEventContextSchema, ConnectorHookEventNameSchema, ConnectorHookEventSchema, } from "./connectors/events";
|
|
5
|
+
export type * from "./connectors/options";
|
|
6
|
+
export type { AutomationEventEnvelope, CronEventSpec, CronOneOffSpec, CronScheduleSpec, CronSpec, CronSpecCommonFields, CronSpecExtensionKind, CronSpecMode, CronSpecModelSelection, CronSpecParseResult, CronTriggerKind, } from "./cron";
|
|
7
|
+
export type { Disposable } from "./dispose";
|
|
8
|
+
export { disposeAll, registerDisposable } from "./dispose";
|
|
9
|
+
export type { ClientContext, ClientName, ExtensionContext, UserContext, WorkspaceContext, } from "./extensions/context";
|
|
10
|
+
export type { AgentExtensionApi, AgentExtensionAutomationContext, AgentExtensionAutomationEventType, AgentExtensionCapability, AgentExtensionCommand, AgentExtensionHooks, AgentExtensionMessageBuilder, AgentExtensionProvider, AgentExtensionRegistry, AgentExtensionRule, AgentExtensionSessionContext, ContributionRegistryExtension, ContributionRegistryOptions, PluginManifest, PluginSetupContext, } from "./extensions/contribution-registry";
|
|
11
|
+
export { ContributionRegistry, createContributionRegistry, normalizePluginManifest, } from "./extensions/contribution-registry";
|
|
12
|
+
export { PLUGIN_FILE_EXTENSIONS } from "./extensions/plugin";
|
|
13
|
+
export type { HookControl } from "./hooks/contracts";
|
|
14
|
+
export type { AgentAbortHookPayload, AgentEndHookPayload, AgentErrorHookPayload, AgentResumeHookPayload, AgentStartHookPayload, HookEventName, HookEventPayload, HookEventPayloadBase, PostToolUseData, PreCompactData, PreCompactHookPayload, PreToolUseData, PromptSubmitHookPayload, SessionShutdownHookPayload, TaskCancelData, TaskCompleteData, TaskResumeData, TaskStartData, ToolCallHookPayload, ToolResultHookPayload, UserPromptSubmitData, } from "./hooks/events";
|
|
15
|
+
export { HookEventNameSchema, HookEventPayloadSchema, parseHookEventPayload, } from "./hooks/events";
|
|
16
|
+
export * from "./hub";
|
|
17
|
+
export type { AiSdkFormatterMessage, AiSdkFormatterMessageRole, AiSdkFormatterPart, AiSdkMessage, AiSdkMessagePart, } from "./llms/ai-sdk-format";
|
|
18
|
+
export { formatMessagesForAiSdk, sanitizeSurrogates, toAiSdkToolResultOutput, } from "./llms/ai-sdk-format";
|
|
19
|
+
export type * from "./llms/gateway";
|
|
20
|
+
export type { ContentBlock, FileContent, ImageContent, Message, MessageRole, MessageWithMetadata, RedactedThinkingContent, TextContent, ThinkingContent, ToolDefinition, ToolResultContent, ToolUseContent, } from "./llms/messages";
|
|
21
|
+
export { ApiFormat, ApiFormatSchema, type ModelCapability, ModelCapabilitySchema, type ModelInfo, ModelInfoSchema, type ModelMetadata, ModelMetadataSchema, type ModelPricing, ModelPricingSchema, type ModelStatus, ModelStatusSchema, type ThinkingConfig, ThinkingConfigSchema, } from "./llms/model-info";
|
|
22
|
+
export { DEFAULT_REASONING_EFFORT, REASONING_EFFORT_RATIOS, resolveEffectiveReasoningEffort, resolveReasoningBudgetFromRatio, resolveReasoningEffortRatio, } from "./llms/reasoning-effort";
|
|
23
|
+
export { DEFAULT_REQUEST_HEADERS, serializeAbortReason } from "./llms/requests";
|
|
24
|
+
export { estimateTokens } from "./llms/tokens";
|
|
25
|
+
export type { ToolApprovalRequest, ToolApprovalResult, ToolCallRecord, ToolPolicy, } from "./llms/tools";
|
|
26
|
+
export { ToolCallRecordSchema } from "./llms/tools";
|
|
27
|
+
export { type BasicLogger, type BasicLogMetadata, noopBasicLogger, } from "./logging/logger";
|
|
28
|
+
export { parseJsonStream, safeJsonParse, safeJsonStringify, } from "./parse/json";
|
|
29
|
+
export { getDefaultShell, getShellArgs } from "./parse/shell";
|
|
30
|
+
export { maskSecret, sanitizeFileName, truncateSplit, truncateStr, } from "./parse/string";
|
|
31
|
+
export { formatHumanReadableDate, formatUptime } from "./parse/time";
|
|
32
|
+
export { validateWithZod, zodToJsonSchema } from "./parse/zod";
|
|
33
|
+
export type { ClineSystemPromptOptions } from "./prompt/cline";
|
|
34
|
+
export { buildClineSystemPrompt, processWorkspaceInfo } from "./prompt/cline";
|
|
35
|
+
export { formatDisplayUserInput, formatFileContentBlock, formatUserCommandBlock, formatUserInputBlock, normalizeUserInput, parseUserCommandEnvelope, xmlTagsRemoval, } from "./prompt/format";
|
|
36
|
+
export { buildRemoteConfigSessionBlobUploadMetadata, clearRemoteConfigSessionBlobUpload, createRemoteConfigSessionMessagesArtifactUploader, prepareRemoteConfigRuntime, REMOTE_CONFIG_SESSION_BLOB_UPLOAD_METADATA_KEY, readRemoteConfigSessionBlobUploadMetadata, registerRemoteConfigSessionBlobUpload, } from "./remote-config";
|
|
37
|
+
export type { PreparedRemoteConfigRuntime, PrepareRemoteConfigRuntimeOptions, RemoteConfigBundle, } from "./remote-config/bundle";
|
|
38
|
+
export { REMOTE_URI_SCHEME } from "./remote-config/constants";
|
|
39
|
+
export type { AnthropicModel, AnthropicSettings, APIKeySettings, AwsBedrockCustomModel, AwsBedrockModel, AwsBedrockSettings, EnterpriseTelemetry, GlobalInstructionsFile, LiteLLMModel, LiteLLMSettings, MCPServer, OpenAiCompatible, OpenAiCompatibleModel, PromptUploading, ProviderSettings, RemoteConfig, RemoteMCPServer, S3AccessKeySettings, VertexModel, VertexSettings, } from "./remote-config/schema";
|
|
40
|
+
export { AllowedMCPServerSchema, AnthropicModelSchema, AnthropicSchema, APIKeySchema, AwsBedrockCustomModelSchema, AwsBedrockModelSchema, AwsBedrockSettingsSchema, ClineModelSchema, ClineSettingsSchema, EnterpriseTelemetrySchema, GlobalInstructionsFileSchema, LiteLLMModelSchema, LiteLLMSchema, OpenAiCompatibleModelSchema, OpenAiCompatibleSchema, PromptUploadingSchema, RemoteConfigSchema, RemoteMCPServerSchema, S3AccessKeySettingsSchema, VertexModelSchema, VertexSettingsSchema, } from "./remote-config/schema";
|
|
41
|
+
export { CLINE_DEFAULT_RPC_ADDRESS, CLINE_DEFAULT_RPC_PORT, CLINE_HUB_DEV_PORT, CLINE_HUB_PORT, } from "./rpc";
|
|
42
|
+
export type { AddProviderActionRequest, ChatAttachmentFile, ChatAttachments, ChatRunTurnRequest, ChatRuntimeConfig, ChatStartSessionArtifacts, ChatStartSessionRequest, ChatStartSessionResponse, ChatToolCallResult, ChatTurnResult, ClineAccountActionRequest, EnterpriseAuthenticateRequest, EnterpriseAuthenticateResponse, EnterpriseStatusRequest, EnterpriseStatusResponse, EnterpriseSyncRequest, EnterpriseSyncResponse, GetProviderModelsActionRequest, ListProvidersActionRequest, ProviderActionRequest, ProviderCapability, ProviderCatalogResponse, ProviderClient, ProviderListItem, ProviderModel, ProviderModelsResponse, ProviderOAuthLoginResponse, ProviderProtocol, ProviderSettingsActionRequest, RuntimeLoggerConfig, SaveProviderSettingsActionRequest, } from "./rpc/runtime";
|
|
43
|
+
export { ProviderCapabilitySchema, ProviderClientSchema, ProviderProtocolSchema, } from "./rpc/runtime";
|
|
44
|
+
export type { TeamProgressCounts, TeamProgressLifecycleEvent, TeamProgressMemberRole, TeamProgressMemberStatus, TeamProgressOutcomeFragmentStatus, TeamProgressOutcomeStatus, TeamProgressProjectionEvent, TeamProgressRunStatus, TeamProgressSummary, TeamProgressTaskStatus, } from "./rpc/team-progress";
|
|
45
|
+
export { TEAM_LIFECYCLE_EVENT_TYPE, TEAM_PROGRESS_EVENT_TYPE, } from "./rpc/team-progress";
|
|
46
|
+
export type { ClineBuildEnv, ClineDebugRole, ResolveClineBuildEnvOptions, } from "./runtime/build-env";
|
|
47
|
+
export { augmentNodeCommandForDebug, CLINE_BUILD_ENV_ENV, CLINE_DEBUG_HOST_ENV, CLINE_DEBUG_PORT_BASE_ENV, resolveClineBuildEnv, withResolvedClineBuildEnv, } from "./runtime/build-env";
|
|
48
|
+
export type { ClineEnvironment, ClineEnvironmentConfig, ResolveClineEnvironmentOptions, } from "./runtime/cline-environment";
|
|
49
|
+
export { CLINE_ENVIRONMENT_ENV, CLINE_ENVIRONMENT_OVERRIDE_ENV, CLINE_ENVIRONMENTS, DEFAULT_CLINE_ENVIRONMENT, getClineEnvironmentConfig, resolveClineEnvironment, } from "./runtime/cline-environment";
|
|
50
|
+
export { CLINE_RUN_AS_HUB_DAEMON_ENV, isHubDaemonProcess, } from "./runtime/hub-daemon-env";
|
|
51
|
+
export type { CaptureSdkErrorInput, ITelemetryService, OpenTelemetryClientConfig, SdkTelemetryErrorComponent, SdkTelemetryErrorSeverity, TelemetryArray, TelemetryMetadata, TelemetryObject, TelemetryPrimitive, TelemetryProperties, TelemetryValue, } from "./services/telemetry";
|
|
52
|
+
export { buildSdkErrorProperties, captureSdkError, normalizeSdkError, SDK_ERROR_TELEMETRY_EVENT, } from "./services/telemetry";
|
|
53
|
+
export type { ClineTelemetryServiceConfig } from "./services/telemetry-config";
|
|
54
|
+
export { createClineTelemetryServiceConfig, createClineTelemetryServiceMetadata, } from "./services/telemetry-config";
|
|
55
|
+
export type { HookSessionContext, HookSessionContextLookup, HookSessionContextProvider, } from "./session/hook-context";
|
|
56
|
+
export { resolveHookSessionContext, resolveRootSessionId, } from "./session/hook-context";
|
|
57
|
+
export { createSessionId } from "./session/index";
|
|
58
|
+
export type { SessionLineage, SessionRuntimeRecordShape, SharedSessionStatus, } from "./session/records";
|
|
59
|
+
export { SESSION_STATUS_VALUES } from "./session/records";
|
|
60
|
+
export type { AgentMode, RuntimeConfigExtensionKind, SessionExecutionConfig, SessionPromptConfig, SessionWorkspaceConfig, } from "./session/runtime-config";
|
|
61
|
+
export { DEFAULT_RUNTIME_CONFIG_EXTENSIONS, hasRuntimeConfigExtension, isRuntimeConfigExtensionKind, parseRuntimeConfigExtensions, RUNTIME_CONFIG_EXTENSION_KINDS, } from "./session/runtime-config";
|
|
62
|
+
export type { RuntimeEnv } from "./session/runtime-env";
|
|
63
|
+
export * from "./session/workspace";
|
|
64
|
+
export * from "./team";
|
|
65
|
+
export { createTool } from "./tools/create";
|
|
66
|
+
export * from "./types";
|
|
67
|
+
export type { OAuthProviderId } from "./types/auth";
|
|
68
|
+
export { AUTH_ERROR_PATTERNS, isLikelyAuthError, isOAuthProviderId, OAUTH_PROVIDER_IDS, } from "./types/auth";
|
|
69
|
+
export { initVcr } from "./vcr";
|