@neovate/code 0.28.0 → 0.28.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli.mjs +7 -7
- package/dist/index.d.ts +2 -0
- package/dist/index.mjs +519 -519
- package/package.json +1 -1
package/dist/cli.mjs
CHANGED
|
@@ -998,7 +998,7 @@ ${D}
|
|
|
998
998
|
|
|
999
999
|
`;break}case"tool":throw new s0({functionality:"tool messages"});default:throw Error(`Unsupported role: ${C}`)}return I+=`${B}:
|
|
1000
1000
|
`,{prompt:I,stopSequences:[`
|
|
1001
|
-
${Q}:`]}}function sCQ({id:A,model:Q,created:B}){return{id:A!=null?A:void 0,modelId:Q!=null?Q:void 0,timestamp:B!=null?new Date(B*1000):void 0}}function tCQ(A){switch(A){case"stop":return"stop";case"length":return"length";case"content_filter":return"content-filter";case"function_call":case"tool_calls":return"tool-calls";default:return"other"}}async function AEQ(A){if(A.type==="url")return PT(A.url);let Q=A.data instanceof Uint8Array?A.data:d3(A.data);return new Blob([Q],{type:A.mediaType})}function fmB(A){return A.replace(/[_-]([a-z])/g,(Q)=>Q[1].toUpperCase())}function Oq(A){let Q=b2(A.baseURL),B=A.name,I={...A.apiKey&&{Authorization:`Bearer ${A.apiKey}`},...A.headers},C=()=>m1(I,`ai-sdk/openai-compatible/${TmB}`),E=(X)=>({provider:`${B}.${X}`,url:({path:H})=>{let K=new URL(`${Q}${H}`);if(A.queryParams)K.search=new URLSearchParams(A.queryParams).toString();return K.toString()},headers:C,fetch:A.fetch}),D=(X)=>g(X),g=(X)=>new $mB(X,{...E("chat"),includeUsage:A.includeUsage,supportsStructuredOutputs:A.supportsStructuredOutputs,transformRequestBody:A.transformRequestBody,metadataExtractor:A.metadataExtractor}),_=(X)=>new MmB(X,{...E("completion"),includeUsage:A.includeUsage}),F=(X)=>new RmB(X,{...E("embedding")}),G=(X)=>new ymB(X,E("image")),U=(X)=>D(X);return U.specificationVersion="v3",U.languageModel=D,U.chatModel=g,U.completionModel=_,U.embeddingModel=F,U.textEmbeddingModel=F,U.imageModel=G,U}var UmB,vT,zl,$mB=class{constructor(A,Q){this.specificationVersion="v3";var B,I;this.modelId=A,this.config=Q;let C=(B=Q.errorStructure)!=null?B:vT;this.chunkSchema=WmB(C.errorSchema),this.failedResponseHandler=fw(C),this.supportsStructuredOutputs=(I=Q.supportsStructuredOutputs)!=null?I:!1}get provider(){return this.config.provider}get providerOptionsName(){return this.config.provider.split(".")[0].trim()}get supportedUrls(){var A,Q,B;return(B=(Q=(A=this.config).supportedUrls)==null?void 0:Q.call(A))!=null?B:{}}transformRequestBody(A){var Q,B,I;return(I=(B=(Q=this.config).transformRequestBody)==null?void 0:B.call(Q,A))!=null?I:A}async getArgs({prompt:A,maxOutputTokens:Q,temperature:B,topP:I,topK:C,frequencyPenalty:E,presencePenalty:D,providerOptions:g,stopSequences:_,responseFormat:F,seed:G,toolChoice:U,tools:X}){var H,K,Z,W,q;let V=[],M=await $0({provider:"openai-compatible",providerOptions:g,schema:zl});if(M!=null)V.push({type:"other",message:"The 'openai-compatible' key in providerOptions is deprecated. Use 'openaiCompatible' instead."});let L=Object.assign(M!=null?M:{},(H=await $0({provider:"openaiCompatible",providerOptions:g,schema:zl}))!=null?H:{},(K=await $0({provider:this.providerOptionsName,providerOptions:g,schema:zl}))!=null?K:{}),k=(Z=L==null?void 0:L.strictJsonSchema)!=null?Z:!0;if(C!=null)V.push({type:"unsupported",feature:"topK"});if((F==null?void 0:F.type)==="json"&&F.schema!=null&&!this.supportsStructuredOutputs)V.push({type:"unsupported",feature:"responseFormat",details:"JSON response format schema is only supported with structuredOutputs"});let{tools:P,toolChoice:O,toolWarnings:v}=KmB({tools:X,toolChoice:U});return{args:{model:this.modelId,user:L.user,max_tokens:Q,temperature:B,top_p:I,frequency_penalty:E,presence_penalty:D,response_format:(F==null?void 0:F.type)==="json"?this.supportsStructuredOutputs===!0&&F.schema!=null?{type:"json_schema",json_schema:{schema:F.schema,strict:k,name:(W=F.name)!=null?W:"response",description:F.description}}:{type:"json_object"}:void 0,stop:_,seed:G,...Object.fromEntries(Object.entries((q=g==null?void 0:g[this.providerOptionsName])!=null?q:{}).filter(([u])=>!Object.keys(zl.shape).includes(u))),reasoning_effort:L.reasoningEffort,verbosity:L.textVerbosity,messages:HmB(A),tools:P,tool_choice:O},warnings:[...V,...v]}}async doGenerate(A){var Q,B,I,C,E,D,g,_;let{args:F,warnings:G}=await this.getArgs({...A}),U=this.transformRequestBody(F),X=JSON.stringify(U),{responseHeaders:H,value:K,rawValue:Z}=await u0({url:this.config.url({path:"/chat/completions",modelId:this.modelId}),headers:V0(this.config.headers(),A.headers),body:U,failedResponseHandler:this.failedResponseHandler,successfulResponseHandler:wC(ZmB),abortSignal:A.abortSignal,fetch:this.config.fetch}),W=K.choices[0],q=[],V=W.message.content;if(V!=null&&V.length>0)q.push({type:"text",text:V});let M=(Q=W.message.reasoning_content)!=null?Q:W.message.reasoning;if(M!=null&&M.length>0)q.push({type:"reasoning",text:M});if(W.message.tool_calls!=null)for(let P of W.message.tool_calls){let O=(I=(B=P.extra_content)==null?void 0:B.google)==null?void 0:I.thought_signature;q.push({type:"tool-call",toolCallId:(C=P.id)!=null?C:vC(),toolName:P.function.name,input:P.function.arguments,...O?{providerMetadata:{[this.providerOptionsName]:{thoughtSignature:O}}}:{}})}let L={[this.providerOptionsName]:{},...await((D=(E=this.config.metadataExtractor)==null?void 0:E.extractMetadata)==null?void 0:D.call(E,{parsedBody:Z}))},k=(g=K.usage)==null?void 0:g.completion_tokens_details;if((k==null?void 0:k.accepted_prediction_tokens)!=null)L[this.providerOptionsName].acceptedPredictionTokens=k==null?void 0:k.accepted_prediction_tokens;if((k==null?void 0:k.rejected_prediction_tokens)!=null)L[this.providerOptionsName].rejectedPredictionTokens=k==null?void 0:k.rejected_prediction_tokens;return{content:q,finishReason:{unified:oCQ(W.finish_reason),raw:(_=W.finish_reason)!=null?_:void 0},usage:nCQ(K.usage),providerMetadata:L,request:{body:X},response:{...aCQ(K),headers:H,body:Z},warnings:G}}async doStream(A){var Q;let{args:B,warnings:I}=await this.getArgs({...A}),C=this.transformRequestBody({...B,stream:!0,stream_options:this.config.includeUsage?{include_usage:!0}:void 0}),E=(Q=this.config.metadataExtractor)==null?void 0:Q.createStreamExtractor(),{responseHeaders:D,value:g}=await u0({url:this.config.url({path:"/chat/completions",modelId:this.modelId}),headers:V0(this.config.headers(),A.headers),body:C,failedResponseHandler:this.failedResponseHandler,successfulResponseHandler:qF(this.chunkSchema),abortSignal:A.abortSignal,fetch:this.config.fetch}),_=[],F={unified:"other",raw:void 0},G=void 0,U=!0,X=this.providerOptionsName,H=!1,K=!1;return{stream:g.pipeThrough(new TransformStream({start(Z){Z.enqueue({type:"stream-start",warnings:I})},transform(Z,W){var q,V,M,L,k,P,O,v,u,l,d,n,QA,S,EA,DA,UA,_A;if(A.includeRawChunks)W.enqueue({type:"raw",rawValue:Z.rawValue});if(!Z.success){F={unified:"error",raw:void 0},W.enqueue({type:"error",error:Z.error});return}if(E==null||E.processChunk(Z.rawValue),"error"in Z.value){F={unified:"error",raw:void 0},W.enqueue({type:"error",error:Z.value.error.message});return}let PA=Z.value;if(U)U=!1,W.enqueue({type:"response-metadata",...aCQ(PA)});if(PA.usage!=null)G=PA.usage;let CA=PA.choices[0];if((CA==null?void 0:CA.finish_reason)!=null)F={unified:oCQ(CA.finish_reason),raw:(q=CA.finish_reason)!=null?q:void 0};if((CA==null?void 0:CA.delta)==null)return;let fA=CA.delta,jA=(V=fA.reasoning_content)!=null?V:fA.reasoning;if(jA){if(!H)W.enqueue({type:"reasoning-start",id:"reasoning-0"}),H=!0;W.enqueue({type:"reasoning-delta",id:"reasoning-0",delta:jA})}if(fA.content){if(H)W.enqueue({type:"reasoning-end",id:"reasoning-0"}),H=!1;if(!K)W.enqueue({type:"text-start",id:"txt-0"}),K=!0;W.enqueue({type:"text-delta",id:"txt-0",delta:fA.content})}if(fA.tool_calls!=null){if(H)W.enqueue({type:"reasoning-end",id:"reasoning-0"}),H=!1;for(let GA of fA.tool_calls){let IA=(M=GA.index)!=null?M:_.length;if(_[IA]==null){if(GA.id==null)throw new x3({data:GA,message:"Expected 'id' to be a string."});if(((L=GA.function)==null?void 0:L.name)==null)throw new x3({data:GA,message:"Expected 'function.name' to be a string."});W.enqueue({type:"tool-input-start",id:GA.id,toolName:GA.function.name}),_[IA]={id:GA.id,type:"function",function:{name:GA.function.name,arguments:(k=GA.function.arguments)!=null?k:""},hasFinished:!1,thoughtSignature:(v=(O=(P=GA.extra_content)==null?void 0:P.google)==null?void 0:O.thought_signature)!=null?v:void 0};let m=_[IA];if(((u=m.function)==null?void 0:u.name)!=null&&((l=m.function)==null?void 0:l.arguments)!=null){if(m.function.arguments.length>0)W.enqueue({type:"tool-input-delta",id:m.id,delta:m.function.arguments});if(Lq(m.function.arguments))W.enqueue({type:"tool-input-end",id:m.id}),W.enqueue({type:"tool-call",toolCallId:(d=m.id)!=null?d:vC(),toolName:m.function.name,input:m.function.arguments,...m.thoughtSignature?{providerMetadata:{[X]:{thoughtSignature:m.thoughtSignature}}}:{}}),m.hasFinished=!0}continue}let LA=_[IA];if(LA.hasFinished)continue;if(((n=GA.function)==null?void 0:n.arguments)!=null)LA.function.arguments+=(S=(QA=GA.function)==null?void 0:QA.arguments)!=null?S:"";if(W.enqueue({type:"tool-input-delta",id:LA.id,delta:(EA=GA.function.arguments)!=null?EA:""}),((DA=LA.function)==null?void 0:DA.name)!=null&&((UA=LA.function)==null?void 0:UA.arguments)!=null&&Lq(LA.function.arguments))W.enqueue({type:"tool-input-end",id:LA.id}),W.enqueue({type:"tool-call",toolCallId:(_A=LA.id)!=null?_A:vC(),toolName:LA.function.name,input:LA.function.arguments,...LA.thoughtSignature?{providerMetadata:{[X]:{thoughtSignature:LA.thoughtSignature}}}:{}}),LA.hasFinished=!0}}},flush(Z){var W,q,V,M,L;if(H)Z.enqueue({type:"reasoning-end",id:"reasoning-0"});if(K)Z.enqueue({type:"text-end",id:"txt-0"});for(let P of _.filter((O)=>!O.hasFinished))Z.enqueue({type:"tool-input-end",id:P.id}),Z.enqueue({type:"tool-call",toolCallId:(W=P.id)!=null?W:vC(),toolName:P.function.name,input:P.function.arguments,...P.thoughtSignature?{providerMetadata:{[X]:{thoughtSignature:P.thoughtSignature}}}:{}});let k={[X]:{},...E==null?void 0:E.buildMetadata()};if(((q=G==null?void 0:G.completion_tokens_details)==null?void 0:q.accepted_prediction_tokens)!=null)k[X].acceptedPredictionTokens=(V=G==null?void 0:G.completion_tokens_details)==null?void 0:V.accepted_prediction_tokens;if(((M=G==null?void 0:G.completion_tokens_details)==null?void 0:M.rejected_prediction_tokens)!=null)k[X].rejectedPredictionTokens=(L=G==null?void 0:G.completion_tokens_details)==null?void 0:L.rejected_prediction_tokens;Z.enqueue({type:"finish",finishReason:F,usage:nCQ(G),providerMetadata:k})}})),request:{body:C},response:{headers:D}}}},QEQ,ZmB,zmB,WmB=(A)=>w.union([zmB,A]),NmB,MmB=class{constructor(A,Q){this.specificationVersion="v3";var B;this.modelId=A,this.config=Q;let I=(B=Q.errorStructure)!=null?B:vT;this.chunkSchema=LmB(I.errorSchema),this.failedResponseHandler=fw(I)}get provider(){return this.config.provider}get providerOptionsName(){return this.config.provider.split(".")[0].trim()}get supportedUrls(){var A,Q,B;return(B=(Q=(A=this.config).supportedUrls)==null?void 0:Q.call(A))!=null?B:{}}async getArgs({prompt:A,maxOutputTokens:Q,temperature:B,topP:I,topK:C,frequencyPenalty:E,presencePenalty:D,stopSequences:g,responseFormat:_,seed:F,providerOptions:G,tools:U,toolChoice:X}){var H;let K=[],Z=(H=await $0({provider:this.providerOptionsName,providerOptions:G,schema:NmB}))!=null?H:{};if(C!=null)K.push({type:"unsupported",feature:"topK"});if(U==null?void 0:U.length)K.push({type:"unsupported",feature:"tools"});if(X!=null)K.push({type:"unsupported",feature:"toolChoice"});if(_!=null&&_.type!=="text")K.push({type:"unsupported",feature:"responseFormat",details:"JSON response format is not supported."});let{prompt:W,stopSequences:q}=qmB({prompt:A}),V=[...q!=null?q:[],...g!=null?g:[]];return{args:{model:this.modelId,echo:Z.echo,logit_bias:Z.logitBias,suffix:Z.suffix,user:Z.user,max_tokens:Q,temperature:B,top_p:I,frequency_penalty:E,presence_penalty:D,seed:F,...G==null?void 0:G[this.providerOptionsName],prompt:W,stop:V.length>0?V:void 0},warnings:K}}async doGenerate(A){let{args:Q,warnings:B}=await this.getArgs(A),{responseHeaders:I,value:C,rawValue:E}=await u0({url:this.config.url({path:"/completions",modelId:this.modelId}),headers:V0(this.config.headers(),A.headers),body:Q,failedResponseHandler:this.failedResponseHandler,successfulResponseHandler:wC(VmB),abortSignal:A.abortSignal,fetch:this.config.fetch}),D=C.choices[0],g=[];if(D.text!=null&&D.text.length>0)g.push({type:"text",text:D.text});return{content:g,usage:rCQ(C.usage),finishReason:{unified:tCQ(D.finish_reason),raw:D.finish_reason},request:{body:Q},response:{...sCQ(C),headers:I,body:E},warnings:B}}async doStream(A){let{args:Q,warnings:B}=await this.getArgs(A),I={...Q,stream:!0,stream_options:this.config.includeUsage?{include_usage:!0}:void 0},{responseHeaders:C,value:E}=await u0({url:this.config.url({path:"/completions",modelId:this.modelId}),headers:V0(this.config.headers(),A.headers),body:I,failedResponseHandler:this.failedResponseHandler,successfulResponseHandler:qF(this.chunkSchema),abortSignal:A.abortSignal,fetch:this.config.fetch}),D={unified:"other",raw:void 0},g=void 0,_=!0;return{stream:E.pipeThrough(new TransformStream({start(F){F.enqueue({type:"stream-start",warnings:B})},transform(F,G){var U;if(A.includeRawChunks)G.enqueue({type:"raw",rawValue:F.rawValue});if(!F.success){D={unified:"error",raw:void 0},G.enqueue({type:"error",error:F.error});return}let X=F.value;if("error"in X){D={unified:"error",raw:void 0},G.enqueue({type:"error",error:X.error});return}if(_)_=!1,G.enqueue({type:"response-metadata",...sCQ(X)}),G.enqueue({type:"text-start",id:"0"});if(X.usage!=null)g=X.usage;let H=X.choices[0];if((H==null?void 0:H.finish_reason)!=null)D={unified:tCQ(H.finish_reason),raw:(U=H.finish_reason)!=null?U:void 0};if((H==null?void 0:H.text)!=null)G.enqueue({type:"text-delta",id:"0",delta:H.text})},flush(F){if(!_)F.enqueue({type:"text-end",id:"0"});F.enqueue({type:"finish",finishReason:D,usage:rCQ(g)})}})),request:{body:I},response:{headers:C}}}},BEQ,VmB,LmB=(A)=>w.union([w.object({id:w.string().nullish(),created:w.number().nullish(),model:w.string().nullish(),choices:w.array(w.object({text:w.string(),finish_reason:w.string().nullish(),index:w.number()})),usage:BEQ.nullish()}),A]),f4A,RmB=class{constructor(A,Q){this.specificationVersion="v3",this.modelId=A,this.config=Q}get provider(){return this.config.provider}get maxEmbeddingsPerCall(){var A;return(A=this.config.maxEmbeddingsPerCall)!=null?A:2048}get supportsParallelCalls(){var A;return(A=this.config.supportsParallelCalls)!=null?A:!0}get providerOptionsName(){return this.config.provider.split(".")[0].trim()}async doEmbed({values:A,headers:Q,abortSignal:B,providerOptions:I}){var C,E,D;let g=[],_=await $0({provider:"openai-compatible",providerOptions:I,schema:f4A});if(_!=null)g.push({type:"other",message:"The 'openai-compatible' key in providerOptions is deprecated. Use 'openaiCompatible' instead."});let F=Object.assign(_!=null?_:{},(C=await $0({provider:"openaiCompatible",providerOptions:I,schema:f4A}))!=null?C:{},(E=await $0({provider:this.providerOptionsName,providerOptions:I,schema:f4A}))!=null?E:{});if(A.length>this.maxEmbeddingsPerCall)throw new Yq({provider:this.provider,modelId:this.modelId,maxEmbeddingsPerCall:this.maxEmbeddingsPerCall,values:A});let{responseHeaders:G,value:U,rawValue:X}=await u0({url:this.config.url({path:"/embeddings",modelId:this.modelId}),headers:V0(this.config.headers(),Q),body:{model:this.modelId,input:A,encoding_format:"float",dimensions:F.dimensions,user:F.user},failedResponseHandler:fw((D=this.config.errorStructure)!=null?D:vT),successfulResponseHandler:wC(OmB),abortSignal:B,fetch:this.config.fetch});return{warnings:g,embeddings:U.data.map((H)=>H.embedding),usage:U.usage?{tokens:U.usage.prompt_tokens}:void 0,providerMetadata:U.providerMetadata,response:{headers:G,body:X}}}},OmB,ymB=class{constructor(A,Q){this.modelId=A,this.config=Q,this.specificationVersion="v3",this.maxImagesPerCall=10}get provider(){return this.config.provider}get providerOptionsKey(){return this.config.provider.split(".")[0].trim()}getArgs(A){return{...A[this.providerOptionsKey],...A[fmB(this.providerOptionsKey)]}}async doGenerate({prompt:A,n:Q,size:B,aspectRatio:I,seed:C,providerOptions:E,headers:D,abortSignal:g,files:_,mask:F}){var G,U,X,H,K;let Z=[];if(I!=null)Z.push({type:"unsupported",feature:"aspectRatio",details:"This model does not support aspect ratio. Use `size` instead."});if(C!=null)Z.push({type:"unsupported",feature:"seed"});let W=(X=(U=(G=this.config._internal)==null?void 0:G.currentDate)==null?void 0:U.call(G))!=null?X:new Date,q=this.getArgs(E);if(_!=null&&_.length>0){let{value:L,responseHeaders:k}=await Rq({url:this.config.url({path:"/images/edits",modelId:this.modelId}),headers:V0(this.config.headers(),D),formData:Hl({model:this.modelId,prompt:A,image:await Promise.all(_.map((P)=>AEQ(P))),mask:F!=null?await AEQ(F):void 0,n:Q,size:B,...q}),failedResponseHandler:fw((H=this.config.errorStructure)!=null?H:vT),successfulResponseHandler:wC(eCQ),abortSignal:g,fetch:this.config.fetch});return{images:L.data.map((P)=>P.b64_json),warnings:Z,response:{timestamp:W,modelId:this.modelId,headers:k}}}let{value:V,responseHeaders:M}=await u0({url:this.config.url({path:"/images/generations",modelId:this.modelId}),headers:V0(this.config.headers(),D),body:{model:this.modelId,prompt:A,n:Q,size:B,...q,response_format:"b64_json"},failedResponseHandler:fw((K=this.config.errorStructure)!=null?K:vT),successfulResponseHandler:wC(eCQ),abortSignal:g,fetch:this.config.fetch});return{images:V.data.map((L)=>L.b64_json),warnings:Z,response:{timestamp:W,modelId:this.modelId,headers:M}}}},eCQ,TmB="2.0.26";var Wl=b(()=>{j0();gB();IB();IB();j0();gB();IB();j0();gB();IB();j0();IB();j0();gB();IB();IB();gB();IB();gB();UmB=w.object({error:w.object({message:w.string(),type:w.string().nullish(),param:w.any().nullish(),code:w.union([w.string(),w.number()]).nullish()})}),vT={errorSchema:UmB,errorToMessage:(A)=>A.error.message};zl=w.object({user:w.string().optional(),reasoningEffort:w.string().optional(),textVerbosity:w.string().optional(),strictJsonSchema:w.boolean().optional()});QEQ=w.object({prompt_tokens:w.number().nullish(),completion_tokens:w.number().nullish(),total_tokens:w.number().nullish(),prompt_tokens_details:w.object({cached_tokens:w.number().nullish()}).nullish(),completion_tokens_details:w.object({reasoning_tokens:w.number().nullish(),accepted_prediction_tokens:w.number().nullish(),rejected_prediction_tokens:w.number().nullish()}).nullish()}).nullish(),ZmB=w.looseObject({id:w.string().nullish(),created:w.number().nullish(),model:w.string().nullish(),choices:w.array(w.object({message:w.object({role:w.literal("assistant").nullish(),content:w.string().nullish(),reasoning_content:w.string().nullish(),reasoning:w.string().nullish(),tool_calls:w.array(w.object({id:w.string().nullish(),function:w.object({name:w.string(),arguments:w.string()}),extra_content:w.object({google:w.object({thought_signature:w.string().nullish()}).nullish()}).nullish()})).nullish()}),finish_reason:w.string().nullish()})),usage:QEQ}),zmB=w.looseObject({id:w.string().nullish(),created:w.number().nullish(),model:w.string().nullish(),choices:w.array(w.object({delta:w.object({role:w.enum(["assistant"]).nullish(),content:w.string().nullish(),reasoning_content:w.string().nullish(),reasoning:w.string().nullish(),tool_calls:w.array(w.object({index:w.number().nullish(),id:w.string().nullish(),function:w.object({name:w.string().nullish(),arguments:w.string().nullish()}),extra_content:w.object({google:w.object({thought_signature:w.string().nullish()}).nullish()}).nullish()})).nullish()}).nullish(),finish_reason:w.string().nullish()})),usage:QEQ});NmB=w.object({echo:w.boolean().optional(),logitBias:w.record(w.string(),w.number()).optional(),suffix:w.string().optional(),user:w.string().optional()}),BEQ=w.object({prompt_tokens:w.number(),completion_tokens:w.number(),total_tokens:w.number()}),VmB=w.object({id:w.string().nullish(),created:w.number().nullish(),model:w.string().nullish(),choices:w.array(w.object({text:w.string(),finish_reason:w.string()})),usage:BEQ.nullish()}),f4A=w.object({dimensions:w.number().optional(),user:w.string().optional()}),OmB=w.object({data:w.array(w.object({embedding:w.array(w.number())})),usage:w.object({prompt_tokens:w.number()}).nullish(),providerMetadata:w.record(w.string(),w.record(w.string(),w.any())).optional()}),eCQ=w.object({data:w.array(w.object({b64_json:w.string()}))})});import xT from"fs";import{homedir as PmB}from"os";function Nl(A,Q){let B=Q.split(".")[0];if(!A&&jmB.includes(B))throw Error(`Config key '${B}' can only be set globally`)}class aD{globalConfig;projectConfig;argvConfig;globalConfigPath;projectConfigPath;constructor(A,Q,B){let I=Q.toLowerCase(),C=MA.join(PmB(),`.${I}`,"config.json"),E=MA.join(A,`.${I}`,"config.json"),D=MA.join(A,`.${I}`,"config.local.json");this.globalConfigPath=C,this.projectConfigPath=E,this.globalConfig=T4A(C),this.projectConfig=fY(T4A(E),T4A(D)),this.argvConfig=B}get config(){let A=fY(this.argvConfig,fY(this.projectConfig,fY(this.globalConfig,p3)));return A.planModel=A.planModel||A.model,A.smallModel=A.smallModel||A.model,A.visionModel=A.visionModel||A.model,A}removeConfig(A,Q,B){Nl(A,Q);let I=A?this.globalConfig:this.projectConfig,C=A?this.globalConfigPath:this.projectConfigPath;if(Q.includes(".")){let E=Q.split("."),D=E[0];if(!i3.includes(D))throw Error(`Invalid config key: ${D}`);if(!ql.includes(D))throw Error(`Config key '${D}' does not support nested properties`);let g=I[D];if(!g)return;for(let F=1;F<E.length-1;F++){if(!g[E[F]])return;g=g[E[F]]}let _=E[E.length-1];if(B){if(Array.isArray(g[_]))g[_]=g[_].filter((F)=>!B.includes(F))}else delete g[_]}else{if(!i3.includes(Q))throw Error(`Invalid config key: ${Q}`);if(B)I[Q]=I[Q].filter((E)=>!B.includes(E));else delete I[Q]}Ml(C,I,p3)}addConfig(A,Q,B){if(Nl(A,Q),!i3.includes(Q))throw Error(`Invalid config key: ${Q}`);let I=A?this.globalConfig:this.projectConfig,C=A?this.globalConfigPath:this.projectConfigPath;if(IEQ.includes(Q))I[Q]=[...I[Q]||[],...B];else if(ql.includes(Q))I[Q]={...I[Q],...B};Ml(C,I,p3)}getConfig(A,Q){let B=A?this.globalConfig:this.projectConfig,I=(E)=>{if(!Q.includes("."))return E[Q];let D=Q.split("."),g=D[0];if(!i3.includes(g))throw Error(`Invalid config key: ${g}`);let _=E[g];for(let F=1;F<D.length;F++){if(_===void 0||_===null)return;_=_[D[F]]}return _},C=I(B);if(C!==void 0)return C;return I(p3)}setConfig(A,Q,B){Nl(A,Q);let I=A?this.globalConfig:this.projectConfig,C=A?this.globalConfigPath:this.projectConfigPath;if(Q.includes(".")){let E=Q.split("."),D=E[0];if(!i3.includes(D))throw Error(`Invalid config key: ${D}`);if(!ql.includes(D))throw Error(`Config key '${D}' does not support nested properties`);if(!I[D])I[D]={};let g=I[D];for(let F=1;F<E.length-1;F++){if(!g[E[F]])g[E[F]]={};g=g[E[F]]}let _=E[E.length-1];g[_]=B}else{if(!i3.includes(Q))throw Error(`Invalid config key: ${Q}`);let E=B;if(kmB.includes(Q))if(typeof B==="boolean")E=B;else E=B==="true";if(IEQ.includes(Q))E=JSON.parse(B);if(ql.includes(Q))E=JSON.parse(B);I[Q]=E}Ml(C,I,p3)}updateConfig(A,Q){Object.keys(Q).forEach((C)=>{if(!i3.includes(C))throw Error(`Invalid config key: ${C}`);Nl(A,C)});let B=A?this.globalConfig:this.projectConfig,I=A?this.globalConfigPath:this.projectConfigPath;if(B=fY(Q,B),A)this.globalConfig=B;else this.projectConfig=B;Ml(I,B,p3)}}function T4A(A){if(!xT.existsSync(A))return{};try{return JSON.parse(xT.readFileSync(A,"utf-8"))}catch(Q){throw Error(`Unable to read config file ${A}: ${Q}`)}}function Ml(A,Q,B){let I=Object.fromEntries(Object.entries(Q).filter(([E,D])=>JSON.stringify(D)!==JSON.stringify(B[E]))),C=MA.dirname(A);if(!xT.existsSync(C))xT.mkdirSync(C,{recursive:!0});xT.writeFileSync(A,JSON.stringify(I,null,2),"utf-8")}var p3,i3,IEQ,ql,kmB,jmB;var mY=b(()=>{om();AI();p3={language:"English",quiet:!1,approvalMode:"default",plugins:[],mcpServers:{},provider:{},todo:!0,autoCompact:!0,truncation:!0,outputFormat:"text",autoUpdate:!0,extensions:{},tools:{},agent:{},checkpoints:!0},i3=[...Object.keys(p3),"model","planModel","smallModel","visionModel","systemPrompt","todo","autoCompact","truncation","commit","outputStyle","autoUpdate","provider","temperature","httpProxy","extensions","tools","agent","notification","skills","thinkingLevel","checkpoints"],IEQ=["plugins","skills"],ql=["mcpServers","commit","provider","extensions","tools","agent"],kmB=["quiet","todo","autoCompact","autoUpdate","truncation","checkpoints"],jmB=[]});var SmB,Vl;var CEQ=b(()=>{SmB={"deepseek-v3-0324":{name:"DeepSeek-V3-0324",shortName:"DeepSeek V3",attachment:!1,reasoning:!0,temperature:!0,tool_call:!0,knowledge:"2024-06",release_date:"2025-03-24",last_updated:"2025-03-24",modalities:{input:["text"],output:["text"]},open_weights:!0,limit:{context:128000,output:8192},aliases:["deepseek-chat-v3-0324","deepseek-v3"]},"deepseek-v3-1":{name:"DeepSeek V3.1",shortName:"DeepSeek V3.1",attachment:!1,reasoning:!0,temperature:!0,tool_call:!0,knowledge:"2025-07",release_date:"2025-08-21",last_updated:"2025-08-21",modalities:{input:["text"],output:["text"]},open_weights:!0,limit:{context:163840,output:163840},aliases:["deepseek-chat-v3.1","deepseek-v3.1","deepseek-v3-1-250821"]},"deepseek-v3-1-terminus":{name:"DeepSeek V3.1 Terminus",attachment:!1,reasoning:!0,temperature:!0,tool_call:!0,knowledge:"2025-07",release_date:"2025-09-22",last_updated:"2025-09-22",modalities:{input:["text"],output:["text"]},open_weights:!0,limit:{context:131072,output:65536},aliases:["deepseek-v3.1-terminus"]},"deepseek-v3-2-exp":{name:"DeepSeek V3.2 Exp",attachment:!1,reasoning:!0,temperature:!0,tool_call:!0,knowledge:"2025-09",release_date:"2025-09-29",last_updated:"2025-09-29",modalities:{input:["text"],output:["text"]},open_weights:!0,limit:{context:131072,output:65536},aliases:["deepseek-v3.2-exp"]},"deepseek-v3.2":{name:"DeepSeek V3.2",attachment:!1,reasoning:!0,temperature:!0,tool_call:!0,knowledge:"2025-12",release_date:"2025-12-01",last_updated:"2025-12-01",modalities:{input:["text"],output:["text"]},open_weights:!0,limit:{context:131072,output:65536},aliases:["deepseek-chat","deepseek-chat-v3.2"]},"deepseek-v3.2-speciale":{name:"DeepSeek V3.2 Speciale",attachment:!1,reasoning:!0,temperature:!0,tool_call:!1,knowledge:"2025-12",release_date:"2025-12-01",last_updated:"2025-12-01",modalities:{input:["text"],output:["text"]},open_weights:!0,limit:{context:131072,output:131072}},"deepseek-r1-0528":{name:"DeepSeek-R1-0528",shortName:"DeepSeek R1",attachment:!1,reasoning:!0,temperature:!0,tool_call:!0,knowledge:"2024-06",release_date:"2025-05-28",last_updated:"2025-05-28",modalities:{input:["text"],output:["text"]},open_weights:!0,limit:{context:65536,output:8192},aliases:["deepseek-reasoner","deepseek-r1"]},"doubao-seed-1.6":{name:"Doubao Seed 1.6",attachment:!1,reasoning:!0,temperature:!0,tool_call:!0,knowledge:"2025-01",release_date:"2025-06-11",last_updated:"2025-09-23",modalities:{input:["text","image"],output:["text"]},open_weights:!0,limit:{context:163840,output:163840},aliases:["doubao-seed-1-6-250615"]},"kimi-k2":{name:"Kimi K2",attachment:!1,reasoning:!1,temperature:!0,tool_call:!0,knowledge:"2024-10",release_date:"2025-07-11",last_updated:"2025-07-11",modalities:{input:["text"],output:["text"]},open_weights:!0,limit:{context:131072,output:16384},aliases:["kimi-k2-instruct"]},"kimi-k2-turbo-preview":{name:"Kimi K2 Turbo",attachment:!1,reasoning:!1,temperature:!0,tool_call:!0,knowledge:"2024-10",release_date:"2025-07-14",last_updated:"2025-07-14",modalities:{input:["text"],output:["text"]},open_weights:!0,limit:{context:131072,output:16384}},"kimi-k2-0905":{name:"Kimi K2 Instruct 0905",shortName:"Kimi K2 0905",attachment:!1,reasoning:!1,temperature:!0,tool_call:!0,knowledge:"2024-10",release_date:"2025-09-05",last_updated:"2025-09-05",modalities:{input:["text"],output:["text"]},open_weights:!0,limit:{context:262144,output:16384},aliases:["kimi-k2-0905-preview","kimi-k2-instruct-0905","kimi-k2-250905"]},"kimi-k2-thinking":{name:"Kimi K2 Thinking",attachment:!1,reasoning:!0,temperature:!0,tool_call:!0,knowledge:"2024-08",release_date:"2025-11-06",last_updated:"2025-11-06",modalities:{input:["text"],output:["text"]},open_weights:!0,limit:{context:262144,output:262144}},"kimi-k2-thinking-turbo":{name:"Kimi K2 Thinking Turbo",attachment:!1,reasoning:!0,temperature:!0,tool_call:!0,knowledge:"2024-08",release_date:"2025-11-06",last_updated:"2025-11-06",modalities:{input:["text"],output:["text"]},open_weights:!0,limit:{context:262144,output:262144}},"kimi-k2.5":{name:"Kimi K2.5",attachment:!0,reasoning:!0,temperature:!0,tool_call:!0,knowledge:"2025-01",release_date:"2026-01-27",last_updated:"2026-01-27",modalities:{input:["text","image","video"],output:["text"]},open_weights:!0,limit:{context:262144,output:262144}},"qwen3-coder-480b-a35b-instruct":{name:"Qwen3 Coder 480B A35B Instruct",shortName:"Qwen3 Coder",attachment:!1,reasoning:!1,temperature:!0,tool_call:!0,knowledge:"2025-04",release_date:"2025-07-23",last_updated:"2025-07-23",modalities:{input:["text"],output:["text"]},open_weights:!0,limit:{context:262144,output:66536},aliases:["qwen3-coder"]},"qwen3-coder-plus":{name:"Qwen3 Coder Plus",attachment:!1,reasoning:!1,temperature:!0,tool_call:!0,knowledge:"2025-04",release_date:"2025-07-23",last_updated:"2025-07-23",modalities:{input:["text"],output:["text"]},open_weights:!0,limit:{context:1048576,output:65536},aliases:["coder-model"]},"qwen3-235b-a22b-07-25":{name:"Qwen3 235B A22B Instruct 2507",shortName:"Qwen3",attachment:!1,reasoning:!0,temperature:!0,tool_call:!0,knowledge:"2025-04",release_date:"2025-04-28",last_updated:"2025-07-21",modalities:{input:["text"],output:["text"]},open_weights:!0,limit:{context:262144,output:131072},aliases:["qwen3-235b-a22b-instruct-2507"]},"qwen3-max":{name:"Qwen3 Max",attachment:!1,reasoning:!0,temperature:!0,tool_call:!0,knowledge:"2025-09",release_date:"2025-09-05",last_updated:"2025-09-05",modalities:{input:["text"],output:["text"]},open_weights:!1,limit:{context:262144,output:32768}},"gemini-2.5-flash":{name:"Gemini 2.5 Flash",attachment:!0,reasoning:!0,temperature:!0,tool_call:!0,knowledge:"2025-01",release_date:"2025-03-20",last_updated:"2025-06-05",modalities:{input:["text","image","audio","video","pdf"],output:["text"]},open_weights:!1,limit:{context:1048576,output:65536},aliases:["gemini-2.5-flash-thinking"]},"gemini-2.5-flash-preview-09-2025":{name:"Gemini 2.5 Flash Preview 2025 09",attachment:!0,reasoning:!0,temperature:!0,tool_call:!0,knowledge:"2025-01",release_date:"2025-09-25",last_updated:"2025-09-25",modalities:{input:["text","image","audio","video","pdf"],output:["text"]},open_weights:!1,limit:{context:1048576,output:65536}},"gemini-2.5-flash-lite-preview-06-17":{name:"Gemini 2.5 Flash Lite Preview 06-17",shortName:"Gemini 2.5 Flash Lite",attachment:!0,reasoning:!0,temperature:!0,tool_call:!0,knowledge:"2025-01",release_date:"2025-06-17",last_updated:"2025-06-17",modalities:{input:["text","image","audio","video","pdf"],output:["text"]},open_weights:!1,limit:{context:65536,output:65536},aliases:["gemini-2.5-flash-lite"]},"gemini-2.5-pro":{name:"Gemini 2.5 Pro",attachment:!0,reasoning:!0,temperature:!0,tool_call:!0,knowledge:"2025-01",release_date:"2025-03-20",last_updated:"2025-06-05",modalities:{input:["text","image","audio","video","pdf"],output:["text"]},open_weights:!1,limit:{context:1048576,output:65536}},"gemini-3-pro-preview":{name:"Gemini 3 Pro Preview",attachment:!0,reasoning:!0,temperature:!0,tool_call:!0,knowledge:"2025-01",release_date:"2025-01-01",last_updated:"2025-01-01",modalities:{input:["text","image","audio","video","pdf"],output:["text"]},open_weights:!1,limit:{context:200000,output:65536},aliases:["gemini-3-pro","gemini-3-pro-low","gemini-3-pro-high"]},"gemini-3-flash-preview":{name:"Gemini 3 Flash Preview",attachment:!0,reasoning:!0,temperature:!0,tool_call:!0,knowledge:"2025-01",release_date:"2025-12-17",last_updated:"2025-12-17",modalities:{input:["text","image","video","audio","pdf"],output:["text"]},open_weights:!1,limit:{context:1048576,output:65536},aliases:["gemini-3-flash"]},"grok-4":{name:"Grok 4",attachment:!1,reasoning:!0,temperature:!0,tool_call:!0,knowledge:"2025-07",release_date:"2025-07-09",last_updated:"2025-07-09",modalities:{input:["text"],output:["text"]},open_weights:!1,limit:{context:256000,output:64000}},"grok-code-fast-1":{name:"Grok Code Fast 1",attachment:!0,reasoning:!0,temperature:!0,tool_call:!0,knowledge:"2025-08",release_date:"2025-08-20",last_updated:"2025-08-20",modalities:{input:["text","image"],output:["text"]},open_weights:!1,limit:{context:256000,output:32000}},"grok-4-fast":{name:"Grok 4 Fast",attachment:!0,reasoning:!0,temperature:!0,tool_call:!0,knowledge:"2024-11",release_date:"2025-08-19",last_updated:"2025-08-19",modalities:{input:["text","image"],output:["text"]},open_weights:!1,limit:{context:2000000,output:2000000}},"grok-4.1-fast":{name:"Grok 4.1 Fast",attachment:!0,reasoning:!0,temperature:!0,tool_call:!0,knowledge:"2025-10",release_date:"2025-11-19",last_updated:"2025-11-19",modalities:{input:["text","image"],output:["text"]},open_weights:!1,limit:{context:2000000,output:2000000},aliases:["grok-4-1-fast","grok-4-1-fast-non-reasoning"]},"claude-3-5-sonnet-20241022":{name:"Claude Sonnet 3.5 v2",shortName:"Sonnet 3.5",attachment:!0,reasoning:!1,temperature:!0,tool_call:!0,knowledge:"2024-04-30",release_date:"2024-10-22",last_updated:"2024-10-22",modalities:{input:["text","image"],output:["text"]},open_weights:!1,limit:{context:200000,output:8192},aliases:["claude-3.5-sonnet"]},"claude-3-7-sonnet":{name:"Claude Sonnet 3.7",shortName:"Sonnet 3.7",attachment:!0,reasoning:!0,temperature:!0,tool_call:!0,knowledge:"2024-10-31",release_date:"2025-02-19",last_updated:"2025-02-19",modalities:{input:["text","image"],output:["text"]},open_weights:!1,limit:{context:200000,output:64000},aliases:["claude-3.7-sonnet","claude-3.7-sonnet-thought","claude-3-7-sonnet-20250219","claude-3-7-sonnet-20250219-thinking"]},"claude-4-sonnet":{name:"Claude Sonnet 4",shortName:"Sonnet 4",attachment:!0,reasoning:!0,temperature:!0,tool_call:!0,knowledge:"2025-03-31",release_date:"2025-05-22",last_updated:"2025-05-22",modalities:{input:["text","image"],output:["text"]},open_weights:!1,limit:{context:200000,output:64000},aliases:["claude-sonnet-4","claude-sonnet-4-20250514"]},"claude-4-opus":{name:"Claude Opus 4",shortName:"Opus 4",attachment:!0,reasoning:!0,temperature:!0,tool_call:!0,knowledge:"2025-03-31",release_date:"2025-05-22",last_updated:"2025-05-22",modalities:{input:["text","image"],output:["text"]},open_weights:!1,limit:{context:200000,output:32000},aliases:["claude-opus-4","claude-opus-4-20250514"]},"gpt-oss-120b":{name:"GPT OSS 120B",shortName:"GPT OSS",attachment:!1,reasoning:!0,temperature:!0,tool_call:!0,knowledge:"2025-08",release_date:"2025-08-05",last_updated:"2025-08-05",modalities:{input:["text"],output:["text"]},open_weights:!0,limit:{context:131072,output:32768},aliases:["gpt-oss-120b-medium"]},"gpt-5.1-codex":{name:"GPT-5.1-Codex",attachment:!1,reasoning:!0,temperature:!1,tool_call:!0,knowledge:"2024-09-30",release_date:"2025-11-13",last_updated:"2025-11-13",modalities:{input:["text","image"],output:["text"]},open_weights:!1,limit:{context:400000,output:128000}},"gpt-5.1-codex-mini":{name:"GPT-5.1-Codex-mini",attachment:!1,reasoning:!0,temperature:!1,tool_call:!0,knowledge:"2024-09-30",release_date:"2025-11-13",last_updated:"2025-11-13",modalities:{input:["text","image"],output:["text"]},open_weights:!1,limit:{context:400000,output:1e5}},"gpt-5.1-codex-max":{name:"GPT 5.1 Codex Max",attachment:!0,reasoning:!0,temperature:!1,tool_call:!0,knowledge:"2024-09-30",release_date:"2025-11-13",last_updated:"2025-11-13",modalities:{input:["text","image"],output:["text"]},open_weights:!1,limit:{context:400000,output:128000}},"gpt-5.1":{name:"GPT-5.1",attachment:!0,reasoning:!0,temperature:!1,tool_call:!0,knowledge:"2024-09-30",release_date:"2025-11-13",last_updated:"2025-11-13",modalities:{input:["text","image"],output:["text"]},open_weights:!1,limit:{context:400000,output:128000}},"gpt-5":{name:"GPT-5",attachment:!0,reasoning:!0,temperature:!1,tool_call:!0,knowledge:"2024-09-30",release_date:"2025-08-07",last_updated:"2025-08-07",modalities:{input:["text","audio","image","video"],output:["text","audio","image"]},open_weights:!1,limit:{context:400000,output:128000}},"gpt-5-mini":{name:"GPT-5 Mini",attachment:!0,reasoning:!0,temperature:!1,tool_call:!0,knowledge:"2024-05-30",release_date:"2025-08-07",last_updated:"2025-08-07",modalities:{input:["text","image"],output:["text"]},open_weights:!1,limit:{context:272000,output:128000}},"gpt-5-codex":{name:"GPT-5-Codex",attachment:!1,reasoning:!0,temperature:!1,tool_call:!0,knowledge:"2024-09-30",release_date:"2025-09-15",last_updated:"2025-09-15",modalities:{input:["text","image"],output:["text"]},open_weights:!1,limit:{context:128000,output:64000}},"gpt-5.2":{name:"GPT-5.2",attachment:!0,reasoning:!0,temperature:!1,knowledge:"2025-08-31",tool_call:!0,release_date:"2025-12-11",last_updated:"2025-12-11",modalities:{input:["text","image"],output:["text","image"]},open_weights:!1,limit:{context:400000,output:128000}},"gpt-5.2-pro":{name:"GPT-5.2 Pro",attachment:!0,reasoning:!0,temperature:!1,knowledge:"2025-08-31",tool_call:!0,release_date:"2025-12-11",last_updated:"2025-12-11",modalities:{input:["text","image"],output:["text"]},open_weights:!1,limit:{context:400000,output:128000}},"gpt-5.2-codex":{name:"GPT-5.2-Codex",attachment:!0,reasoning:!0,temperature:!0,tool_call:!0,knowledge:"2025-08-31",release_date:"2026-01-14",last_updated:"2026-01-14",modalities:{input:["text","image"],output:["text"]},open_weights:!1,limit:{context:400000,output:128000}},"gpt-5.3-codex":{name:"GPT-5.3 Codex",attachment:!0,reasoning:!0,temperature:!1,tool_call:!0,knowledge:"2025-08-31",release_date:"2026-02-05",last_updated:"2026-02-05",modalities:{input:["text","image","pdf"],output:["text"]},open_weights:!1,limit:{context:400000,output:128000}},"gpt-4.1":{name:"GPT-4.1",attachment:!0,reasoning:!1,temperature:!0,tool_call:!0,knowledge:"2024-04",release_date:"2025-04-14",last_updated:"2025-04-14",modalities:{input:["text","image"],output:["text"]},open_weights:!1,limit:{context:1047576,output:32768}},"gpt-4":{name:"GPT-4",attachment:!0,reasoning:!1,temperature:!0,tool_call:!0,knowledge:"2023-11",release_date:"2023-11-06",last_updated:"2024-04-09",modalities:{input:["text"],output:["text"]},open_weights:!1,limit:{context:8192,output:8192}},"gpt-4o":{name:"GPT-4o",attachment:!0,reasoning:!1,temperature:!0,tool_call:!0,knowledge:"2023-09",release_date:"2024-05-13",last_updated:"2024-05-13",modalities:{input:["text","image"],output:["text"]},open_weights:!1,limit:{context:128000,output:16384}},o3:{name:"o3",attachment:!0,reasoning:!0,temperature:!1,tool_call:!0,knowledge:"2024-05",release_date:"2025-04-16",last_updated:"2025-04-16",modalities:{input:["text","image"],output:["text"]},open_weights:!1,limit:{context:200000,output:1e5}},"o3-pro":{name:"o3-pro",attachment:!0,reasoning:!0,temperature:!1,tool_call:!0,knowledge:"2024-05",release_date:"2025-06-10",last_updated:"2025-06-10",modalities:{input:["text","image"],output:["text"]},open_weights:!1,limit:{context:200000,output:1e5}},"o3-mini":{name:"o3-mini",attachment:!1,reasoning:!0,temperature:!1,tool_call:!0,knowledge:"2024-05",release_date:"2024-12-20",last_updated:"2025-01-29",modalities:{input:["text"],output:["text"]},open_weights:!1,limit:{context:200000,output:1e5}},"o4-mini":{name:"o4-mini",attachment:!0,reasoning:!0,temperature:!1,tool_call:!0,knowledge:"2024-05",release_date:"2025-04-16",last_updated:"2025-04-16",modalities:{input:["text","image"],output:["text"]},open_weights:!1,limit:{context:200000,output:1e5}},"glm-4.5":{name:"GLM-4.5",attachment:!1,reasoning:!0,temperature:!0,tool_call:!0,knowledge:"2025-04",release_date:"2025-07-28",last_updated:"2025-07-28",modalities:{input:["text"],output:["text"]},open_weights:!0,limit:{context:131072,output:98304},aliases:[]},"glm-4.5-air":{name:"GLM-4.5-Air",attachment:!1,reasoning:!0,temperature:!0,tool_call:!0,knowledge:"2025-04",release_date:"2025-07-28",last_updated:"2025-07-28",modalities:{input:["text"],output:["text"]},open_weights:!0,limit:{context:131072,output:98304}},"glm-4.5-flash":{name:"GLM-4.5-Flash",attachment:!1,reasoning:!0,temperature:!0,tool_call:!0,knowledge:"2025-04",release_date:"2025-07-28",last_updated:"2025-07-28",modalities:{input:["text"],output:["text"]},open_weights:!0,limit:{context:131072,output:98304}},"glm-4.5v":{name:"GLM-4.5V",attachment:!0,reasoning:!0,temperature:!0,tool_call:!0,knowledge:"2025-04",release_date:"2025-08-11",last_updated:"2025-08-11",modalities:{input:["text","image","video"],output:["text"]},open_weights:!0,limit:{context:64000,output:16384}},"glm-4.6":{name:"GLM-4.6",attachment:!1,reasoning:!0,temperature:!0,tool_call:!0,knowledge:"2025-04",release_date:"2025-09-30",last_updated:"2025-09-30",modalities:{input:["text"],output:["text"]},open_weights:!0,limit:{context:204800,output:131072}},"glm-4.6v":{name:"GLM-4.6V",attachment:!0,reasoning:!0,temperature:!0,tool_call:!0,knowledge:"2025-04",release_date:"2025-12-08",last_updated:"2025-12-08",modalities:{input:["text","image","video"],output:["text"]},open_weights:!0,limit:{context:131072,output:24000}},"glm-4.7":{name:"GLM-4.7",attachment:!1,reasoning:!0,temperature:!0,tool_call:!0,knowledge:"2025-04",release_date:"2025-12-22",last_updated:"2025-12-22",modalities:{input:["text"],output:["text"]},open_weights:!0,limit:{context:204800,output:131072},aliases:["zai-glm-4.7","glm4.7"]},"sonoma-dusk-alpha":{name:"Sonoma Dusk Alpha",attachment:!0,reasoning:!1,temperature:!1,tool_call:!0,knowledge:"2024-09",release_date:"2024-09-05",last_updated:"2024-09-05",modalities:{input:["text","image"],output:["text"]},open_weights:!1,limit:{context:2000000,output:2000000}},"sonoma-sky-alpha":{name:"Sonoma Sky Alpha",attachment:!0,reasoning:!1,temperature:!1,tool_call:!0,knowledge:"2024-09",release_date:"2024-09-05",last_updated:"2024-09-05",modalities:{input:["text","image"],output:["text"]},open_weights:!1,limit:{context:2000000,output:2000000}},"claude-4.1-opus":{name:"Claude Opus 4.1",attachment:!0,reasoning:!0,temperature:!0,tool_call:!0,knowledge:"2025-03-31",release_date:"2025-08-05",last_updated:"2025-08-05",modalities:{input:["text","image"],output:["text"]},open_weights:!1,limit:{context:200000,output:32000},aliases:["claude-opus-41","claude-opus-4-1-20250805","claude-opus-4-1","claude-opus-4.1"]},"claude-4-5-sonnet":{name:"Claude Sonnet 4.5 (Preview)",attachment:!0,reasoning:!0,temperature:!0,tool_call:!0,knowledge:"2025-03-31",release_date:"2025-09-29",last_updated:"2025-09-29",modalities:{input:["text","image"],output:["text"]},open_weights:!1,limit:{context:200000,output:32000},aliases:["claude-sonnet-4.5","claude-sonnet-4-5-20250929","claude-sonnet-4-5","claude-sonnet-4-5-thinking"]},"claude-haiku-4-5":{name:"Claude Haiku 4.5",attachment:!0,reasoning:!0,temperature:!0,tool_call:!0,knowledge:"2025-02-31",release_date:"2025-10-15",last_updated:"2025-10-15",modalities:{input:["text","image"],output:["text"]},open_weights:!1,limit:{context:200000,output:64000},aliases:["claude-haiku-4.5"]},"claude-opus-4-5":{name:"Claude Opus 4.5",attachment:!0,reasoning:!0,temperature:!0,tool_call:!0,knowledge:"2025-03-31",release_date:"2025-11-24",last_updated:"2025-11-24",modalities:{input:["text","image"],output:["text"]},open_weights:!1,limit:{context:200000,output:64000},aliases:["claude-opus-4.5","claude-opus-4-5-thinking"]},"claude-opus-4-6":{name:"Claude Opus 4.6",attachment:!0,reasoning:!0,temperature:!0,tool_call:!0,knowledge:"2025-05-31",release_date:"2026-02-05",last_updated:"2026-02-05",modalities:{input:["text","image","pdf"],output:["text"]},open_weights:!1,limit:{context:200000,output:128000},aliases:["claude-opus-4.6"]},"ling-1t":{name:"InclusionAI Ling-1T",attachment:!0,reasoning:!1,temperature:!0,tool_call:!0,knowledge:"2025-10-09",release_date:"2025-10-09",last_updated:"2025-10-09",modalities:{input:["text"],output:["text"]},open_weights:!1,limit:{context:128000,output:32000}},"ring-1t":{name:"InclusionAI Ring-1T",attachment:!0,reasoning:!0,temperature:!0,tool_call:!0,knowledge:"2025-10-14",release_date:"2025-10-14",last_updated:"2025-10-14",modalities:{input:["text"],output:["text"]},open_weights:!1,limit:{context:128000,output:32000}},"ring-flash-2.0":{name:"InclusionAI Ring-flash-2.0",attachment:!0,reasoning:!0,temperature:!0,tool_call:!0,knowledge:"2025-09-09",release_date:"2025-09-15",last_updated:"2025-09-16",modalities:{input:["text"],output:["text"]},open_weights:!1,limit:{context:128000,output:32000}},"ling-flash-2.0":{name:"InclusionAI Ling-flash-2.0",attachment:!0,reasoning:!1,temperature:!0,tool_call:!0,knowledge:"2025-09-09",release_date:"2025-09-15",last_updated:"2025-09-16",modalities:{input:["text"],output:["text"]},open_weights:!1,limit:{context:128000,output:32000}},"ring-mini-2.0":{name:"InclusionAI Ring-mini-2.0",attachment:!0,reasoning:!0,temperature:!0,tool_call:!0,knowledge:"2025-09-09",release_date:"2025-09-15",last_updated:"2025-09-16",modalities:{input:["text"],output:["text"]},open_weights:!1,limit:{context:128000,output:32000}},"ling-mini-2.0":{name:"InclusionAI Ling-mini-2.0",attachment:!0,reasoning:!1,temperature:!0,tool_call:!0,knowledge:"2025-09-09",release_date:"2025-09-15",last_updated:"2025-09-16",modalities:{input:["text"],output:["text"]},open_weights:!1,limit:{context:128000,output:32000}},"minimax-m2":{name:"Minimax-M2",attachment:!1,reasoning:!0,temperature:!0,tool_call:!0,knowledge:"",release_date:"2025-10-27",last_updated:"2025-10-27",modalities:{input:["text"],output:["text"]},open_weights:!0,limit:{context:196608,output:64000}},"mimo-v2-flash":{name:"MiMo V2 Flash",attachment:!1,reasoning:!0,temperature:!0,tool_call:!0,knowledge:"2025-12",release_date:"2025-12-17",last_updated:"2025-12-17",modalities:{input:["text"],output:["text"]},open_weights:!0,limit:{context:131072,output:32768}},"minimax-m2.1":{name:"MiniMax-M2.1",attachment:!1,reasoning:!0,temperature:!0,tool_call:!0,knowledge:"",release_date:"2025-12-23",last_updated:"2025-12-23",modalities:{input:["text"],output:["text"]},open_weights:!0,limit:{context:204800,output:131072}}},Vl=(()=>{let A={...SmB};for(let Q in A){let B=A[Q];if(B.id=Q,B.aliases)for(let I of B.aliases)A[I]=B}return A})()});var Tw=()=>{};function CdB(A){return A===void 0?[]:Array.isArray(A)?A:[A]}function HdB(A){let Q=["ROOT"],B=-1,I=null;function C(_,F,G){switch(_){case'"':{B=F,Q.pop(),Q.push(G),Q.push("INSIDE_STRING");break}case"f":case"t":case"n":{B=F,I=F,Q.pop(),Q.push(G),Q.push("INSIDE_LITERAL");break}case"-":{Q.pop(),Q.push(G),Q.push("INSIDE_NUMBER");break}case"0":case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":{B=F,Q.pop(),Q.push(G),Q.push("INSIDE_NUMBER");break}case"{":{B=F,Q.pop(),Q.push(G),Q.push("INSIDE_OBJECT_START");break}case"[":{B=F,Q.pop(),Q.push(G),Q.push("INSIDE_ARRAY_START");break}}}function E(_,F){switch(_){case",":{Q.pop(),Q.push("INSIDE_OBJECT_AFTER_COMMA");break}case"}":{B=F,Q.pop();break}}}function D(_,F){switch(_){case",":{Q.pop(),Q.push("INSIDE_ARRAY_AFTER_COMMA");break}case"]":{B=F,Q.pop();break}}}for(let _=0;_<A.length;_++){let F=A[_];switch(Q[Q.length-1]){case"ROOT":C(F,_,"FINISH");break;case"INSIDE_OBJECT_START":{switch(F){case'"':{Q.pop(),Q.push("INSIDE_OBJECT_KEY");break}case"}":{B=_,Q.pop();break}}break}case"INSIDE_OBJECT_AFTER_COMMA":{switch(F){case'"':{Q.pop(),Q.push("INSIDE_OBJECT_KEY");break}}break}case"INSIDE_OBJECT_KEY":{switch(F){case'"':{Q.pop(),Q.push("INSIDE_OBJECT_AFTER_KEY");break}}break}case"INSIDE_OBJECT_AFTER_KEY":{switch(F){case":":{Q.pop(),Q.push("INSIDE_OBJECT_BEFORE_VALUE");break}}break}case"INSIDE_OBJECT_BEFORE_VALUE":{C(F,_,"INSIDE_OBJECT_AFTER_VALUE");break}case"INSIDE_OBJECT_AFTER_VALUE":{E(F,_);break}case"INSIDE_STRING":{switch(F){case'"':{Q.pop(),B=_;break}case"\\":{Q.push("INSIDE_STRING_ESCAPE");break}default:B=_}break}case"INSIDE_ARRAY_START":{switch(F){case"]":{B=_,Q.pop();break}default:{B=_,C(F,_,"INSIDE_ARRAY_AFTER_VALUE");break}}break}case"INSIDE_ARRAY_AFTER_VALUE":{switch(F){case",":{Q.pop(),Q.push("INSIDE_ARRAY_AFTER_COMMA");break}case"]":{B=_,Q.pop();break}default:{B=_;break}}break}case"INSIDE_ARRAY_AFTER_COMMA":{C(F,_,"INSIDE_ARRAY_AFTER_VALUE");break}case"INSIDE_STRING_ESCAPE":{Q.pop(),B=_;break}case"INSIDE_NUMBER":{switch(F){case"0":case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":{B=_;break}case"e":case"E":case"-":case".":break;case",":{if(Q.pop(),Q[Q.length-1]==="INSIDE_ARRAY_AFTER_VALUE")D(F,_);if(Q[Q.length-1]==="INSIDE_OBJECT_AFTER_VALUE")E(F,_);break}case"}":{if(Q.pop(),Q[Q.length-1]==="INSIDE_OBJECT_AFTER_VALUE")E(F,_);break}case"]":{if(Q.pop(),Q[Q.length-1]==="INSIDE_ARRAY_AFTER_VALUE")D(F,_);break}default:{Q.pop();break}}break}case"INSIDE_LITERAL":{let U=A.substring(I,_+1);if(!"false".startsWith(U)&&!"true".startsWith(U)&&!"null".startsWith(U)){if(Q.pop(),Q[Q.length-1]==="INSIDE_OBJECT_AFTER_VALUE")E(F,_);else if(Q[Q.length-1]==="INSIDE_ARRAY_AFTER_VALUE")D(F,_)}else B=_;break}}}let g=A.slice(0,B+1);for(let _=Q.length-1;_>=0;_--)switch(Q[_]){case"INSIDE_STRING":{g+='"';break}case"INSIDE_OBJECT_KEY":case"INSIDE_OBJECT_AFTER_KEY":case"INSIDE_OBJECT_AFTER_COMMA":case"INSIDE_OBJECT_START":case"INSIDE_OBJECT_BEFORE_VALUE":case"INSIDE_OBJECT_AFTER_VALUE":{g+="}";break}case"INSIDE_ARRAY_START":case"INSIDE_ARRAY_AFTER_COMMA":case"INSIDE_ARRAY_AFTER_VALUE":{g+="]";break}case"INSIDE_LITERAL":{let G=A.substring(I,A.length);if("true".startsWith(G))g+="true".slice(G.length);else if("false".startsWith(G))g+="false".slice(G.length);else if("null".startsWith(G))g+="null".slice(G.length)}}return g}async function Ll(A){if(A===void 0)return{value:void 0,state:"undefined-input"};let Q=await WG({text:A});if(Q.success)return{value:Q.value,state:"successful-parse"};if(Q=await WG({text:HdB(A)}),Q.success)return{value:Q.value,state:"repaired-parse"};return{value:void 0,state:"failed-parse"}}function qdB(A,Q){if(Q.length===0)return null;let B=A.indexOf(Q);if(B!==-1)return B;for(let I=A.length-1;I>=0;I--){let C=A.substring(I);if(Q.startsWith(C))return I}return null}function GEQ({tagName:A,separator:Q=`
|
|
1001
|
+
${Q}:`]}}function sCQ({id:A,model:Q,created:B}){return{id:A!=null?A:void 0,modelId:Q!=null?Q:void 0,timestamp:B!=null?new Date(B*1000):void 0}}function tCQ(A){switch(A){case"stop":return"stop";case"length":return"length";case"content_filter":return"content-filter";case"function_call":case"tool_calls":return"tool-calls";default:return"other"}}async function AEQ(A){if(A.type==="url")return PT(A.url);let Q=A.data instanceof Uint8Array?A.data:d3(A.data);return new Blob([Q],{type:A.mediaType})}function fmB(A){return A.replace(/[_-]([a-z])/g,(Q)=>Q[1].toUpperCase())}function Oq(A){let Q=b2(A.baseURL),B=A.name,I={...A.apiKey&&{Authorization:`Bearer ${A.apiKey}`},...A.headers},C=()=>m1(I,`ai-sdk/openai-compatible/${TmB}`),E=(X)=>({provider:`${B}.${X}`,url:({path:H})=>{let K=new URL(`${Q}${H}`);if(A.queryParams)K.search=new URLSearchParams(A.queryParams).toString();return K.toString()},headers:C,fetch:A.fetch}),D=(X)=>g(X),g=(X)=>new $mB(X,{...E("chat"),includeUsage:A.includeUsage,supportsStructuredOutputs:A.supportsStructuredOutputs,transformRequestBody:A.transformRequestBody,metadataExtractor:A.metadataExtractor}),_=(X)=>new MmB(X,{...E("completion"),includeUsage:A.includeUsage}),F=(X)=>new RmB(X,{...E("embedding")}),G=(X)=>new ymB(X,E("image")),U=(X)=>D(X);return U.specificationVersion="v3",U.languageModel=D,U.chatModel=g,U.completionModel=_,U.embeddingModel=F,U.textEmbeddingModel=F,U.imageModel=G,U}var UmB,vT,zl,$mB=class{constructor(A,Q){this.specificationVersion="v3";var B,I;this.modelId=A,this.config=Q;let C=(B=Q.errorStructure)!=null?B:vT;this.chunkSchema=WmB(C.errorSchema),this.failedResponseHandler=fw(C),this.supportsStructuredOutputs=(I=Q.supportsStructuredOutputs)!=null?I:!1}get provider(){return this.config.provider}get providerOptionsName(){return this.config.provider.split(".")[0].trim()}get supportedUrls(){var A,Q,B;return(B=(Q=(A=this.config).supportedUrls)==null?void 0:Q.call(A))!=null?B:{}}transformRequestBody(A){var Q,B,I;return(I=(B=(Q=this.config).transformRequestBody)==null?void 0:B.call(Q,A))!=null?I:A}async getArgs({prompt:A,maxOutputTokens:Q,temperature:B,topP:I,topK:C,frequencyPenalty:E,presencePenalty:D,providerOptions:g,stopSequences:_,responseFormat:F,seed:G,toolChoice:U,tools:X}){var H,K,Z,W,q;let V=[],M=await $0({provider:"openai-compatible",providerOptions:g,schema:zl});if(M!=null)V.push({type:"other",message:"The 'openai-compatible' key in providerOptions is deprecated. Use 'openaiCompatible' instead."});let L=Object.assign(M!=null?M:{},(H=await $0({provider:"openaiCompatible",providerOptions:g,schema:zl}))!=null?H:{},(K=await $0({provider:this.providerOptionsName,providerOptions:g,schema:zl}))!=null?K:{}),k=(Z=L==null?void 0:L.strictJsonSchema)!=null?Z:!0;if(C!=null)V.push({type:"unsupported",feature:"topK"});if((F==null?void 0:F.type)==="json"&&F.schema!=null&&!this.supportsStructuredOutputs)V.push({type:"unsupported",feature:"responseFormat",details:"JSON response format schema is only supported with structuredOutputs"});let{tools:P,toolChoice:O,toolWarnings:v}=KmB({tools:X,toolChoice:U});return{args:{model:this.modelId,user:L.user,max_tokens:Q,temperature:B,top_p:I,frequency_penalty:E,presence_penalty:D,response_format:(F==null?void 0:F.type)==="json"?this.supportsStructuredOutputs===!0&&F.schema!=null?{type:"json_schema",json_schema:{schema:F.schema,strict:k,name:(W=F.name)!=null?W:"response",description:F.description}}:{type:"json_object"}:void 0,stop:_,seed:G,...Object.fromEntries(Object.entries((q=g==null?void 0:g[this.providerOptionsName])!=null?q:{}).filter(([u])=>!Object.keys(zl.shape).includes(u))),reasoning_effort:L.reasoningEffort,verbosity:L.textVerbosity,messages:HmB(A),tools:P,tool_choice:O},warnings:[...V,...v]}}async doGenerate(A){var Q,B,I,C,E,D,g,_;let{args:F,warnings:G}=await this.getArgs({...A}),U=this.transformRequestBody(F),X=JSON.stringify(U),{responseHeaders:H,value:K,rawValue:Z}=await u0({url:this.config.url({path:"/chat/completions",modelId:this.modelId}),headers:V0(this.config.headers(),A.headers),body:U,failedResponseHandler:this.failedResponseHandler,successfulResponseHandler:wC(ZmB),abortSignal:A.abortSignal,fetch:this.config.fetch}),W=K.choices[0],q=[],V=W.message.content;if(V!=null&&V.length>0)q.push({type:"text",text:V});let M=(Q=W.message.reasoning_content)!=null?Q:W.message.reasoning;if(M!=null&&M.length>0)q.push({type:"reasoning",text:M});if(W.message.tool_calls!=null)for(let P of W.message.tool_calls){let O=(I=(B=P.extra_content)==null?void 0:B.google)==null?void 0:I.thought_signature;q.push({type:"tool-call",toolCallId:(C=P.id)!=null?C:vC(),toolName:P.function.name,input:P.function.arguments,...O?{providerMetadata:{[this.providerOptionsName]:{thoughtSignature:O}}}:{}})}let L={[this.providerOptionsName]:{},...await((D=(E=this.config.metadataExtractor)==null?void 0:E.extractMetadata)==null?void 0:D.call(E,{parsedBody:Z}))},k=(g=K.usage)==null?void 0:g.completion_tokens_details;if((k==null?void 0:k.accepted_prediction_tokens)!=null)L[this.providerOptionsName].acceptedPredictionTokens=k==null?void 0:k.accepted_prediction_tokens;if((k==null?void 0:k.rejected_prediction_tokens)!=null)L[this.providerOptionsName].rejectedPredictionTokens=k==null?void 0:k.rejected_prediction_tokens;return{content:q,finishReason:{unified:oCQ(W.finish_reason),raw:(_=W.finish_reason)!=null?_:void 0},usage:nCQ(K.usage),providerMetadata:L,request:{body:X},response:{...aCQ(K),headers:H,body:Z},warnings:G}}async doStream(A){var Q;let{args:B,warnings:I}=await this.getArgs({...A}),C=this.transformRequestBody({...B,stream:!0,stream_options:this.config.includeUsage?{include_usage:!0}:void 0}),E=(Q=this.config.metadataExtractor)==null?void 0:Q.createStreamExtractor(),{responseHeaders:D,value:g}=await u0({url:this.config.url({path:"/chat/completions",modelId:this.modelId}),headers:V0(this.config.headers(),A.headers),body:C,failedResponseHandler:this.failedResponseHandler,successfulResponseHandler:qF(this.chunkSchema),abortSignal:A.abortSignal,fetch:this.config.fetch}),_=[],F={unified:"other",raw:void 0},G=void 0,U=!0,X=this.providerOptionsName,H=!1,K=!1;return{stream:g.pipeThrough(new TransformStream({start(Z){Z.enqueue({type:"stream-start",warnings:I})},transform(Z,W){var q,V,M,L,k,P,O,v,u,l,d,n,QA,S,EA,DA,UA,_A;if(A.includeRawChunks)W.enqueue({type:"raw",rawValue:Z.rawValue});if(!Z.success){F={unified:"error",raw:void 0},W.enqueue({type:"error",error:Z.error});return}if(E==null||E.processChunk(Z.rawValue),"error"in Z.value){F={unified:"error",raw:void 0},W.enqueue({type:"error",error:Z.value.error.message});return}let PA=Z.value;if(U)U=!1,W.enqueue({type:"response-metadata",...aCQ(PA)});if(PA.usage!=null)G=PA.usage;let CA=PA.choices[0];if((CA==null?void 0:CA.finish_reason)!=null)F={unified:oCQ(CA.finish_reason),raw:(q=CA.finish_reason)!=null?q:void 0};if((CA==null?void 0:CA.delta)==null)return;let fA=CA.delta,jA=(V=fA.reasoning_content)!=null?V:fA.reasoning;if(jA){if(!H)W.enqueue({type:"reasoning-start",id:"reasoning-0"}),H=!0;W.enqueue({type:"reasoning-delta",id:"reasoning-0",delta:jA})}if(fA.content){if(H)W.enqueue({type:"reasoning-end",id:"reasoning-0"}),H=!1;if(!K)W.enqueue({type:"text-start",id:"txt-0"}),K=!0;W.enqueue({type:"text-delta",id:"txt-0",delta:fA.content})}if(fA.tool_calls!=null){if(H)W.enqueue({type:"reasoning-end",id:"reasoning-0"}),H=!1;for(let GA of fA.tool_calls){let IA=(M=GA.index)!=null?M:_.length;if(_[IA]==null){if(GA.id==null)throw new x3({data:GA,message:"Expected 'id' to be a string."});if(((L=GA.function)==null?void 0:L.name)==null)throw new x3({data:GA,message:"Expected 'function.name' to be a string."});W.enqueue({type:"tool-input-start",id:GA.id,toolName:GA.function.name}),_[IA]={id:GA.id,type:"function",function:{name:GA.function.name,arguments:(k=GA.function.arguments)!=null?k:""},hasFinished:!1,thoughtSignature:(v=(O=(P=GA.extra_content)==null?void 0:P.google)==null?void 0:O.thought_signature)!=null?v:void 0};let m=_[IA];if(((u=m.function)==null?void 0:u.name)!=null&&((l=m.function)==null?void 0:l.arguments)!=null){if(m.function.arguments.length>0)W.enqueue({type:"tool-input-delta",id:m.id,delta:m.function.arguments});if(Lq(m.function.arguments))W.enqueue({type:"tool-input-end",id:m.id}),W.enqueue({type:"tool-call",toolCallId:(d=m.id)!=null?d:vC(),toolName:m.function.name,input:m.function.arguments,...m.thoughtSignature?{providerMetadata:{[X]:{thoughtSignature:m.thoughtSignature}}}:{}}),m.hasFinished=!0}continue}let LA=_[IA];if(LA.hasFinished)continue;if(((n=GA.function)==null?void 0:n.arguments)!=null)LA.function.arguments+=(S=(QA=GA.function)==null?void 0:QA.arguments)!=null?S:"";if(W.enqueue({type:"tool-input-delta",id:LA.id,delta:(EA=GA.function.arguments)!=null?EA:""}),((DA=LA.function)==null?void 0:DA.name)!=null&&((UA=LA.function)==null?void 0:UA.arguments)!=null&&Lq(LA.function.arguments))W.enqueue({type:"tool-input-end",id:LA.id}),W.enqueue({type:"tool-call",toolCallId:(_A=LA.id)!=null?_A:vC(),toolName:LA.function.name,input:LA.function.arguments,...LA.thoughtSignature?{providerMetadata:{[X]:{thoughtSignature:LA.thoughtSignature}}}:{}}),LA.hasFinished=!0}}},flush(Z){var W,q,V,M,L;if(H)Z.enqueue({type:"reasoning-end",id:"reasoning-0"});if(K)Z.enqueue({type:"text-end",id:"txt-0"});for(let P of _.filter((O)=>!O.hasFinished))Z.enqueue({type:"tool-input-end",id:P.id}),Z.enqueue({type:"tool-call",toolCallId:(W=P.id)!=null?W:vC(),toolName:P.function.name,input:P.function.arguments,...P.thoughtSignature?{providerMetadata:{[X]:{thoughtSignature:P.thoughtSignature}}}:{}});let k={[X]:{},...E==null?void 0:E.buildMetadata()};if(((q=G==null?void 0:G.completion_tokens_details)==null?void 0:q.accepted_prediction_tokens)!=null)k[X].acceptedPredictionTokens=(V=G==null?void 0:G.completion_tokens_details)==null?void 0:V.accepted_prediction_tokens;if(((M=G==null?void 0:G.completion_tokens_details)==null?void 0:M.rejected_prediction_tokens)!=null)k[X].rejectedPredictionTokens=(L=G==null?void 0:G.completion_tokens_details)==null?void 0:L.rejected_prediction_tokens;Z.enqueue({type:"finish",finishReason:F,usage:nCQ(G),providerMetadata:k})}})),request:{body:C},response:{headers:D}}}},QEQ,ZmB,zmB,WmB=(A)=>w.union([zmB,A]),NmB,MmB=class{constructor(A,Q){this.specificationVersion="v3";var B;this.modelId=A,this.config=Q;let I=(B=Q.errorStructure)!=null?B:vT;this.chunkSchema=LmB(I.errorSchema),this.failedResponseHandler=fw(I)}get provider(){return this.config.provider}get providerOptionsName(){return this.config.provider.split(".")[0].trim()}get supportedUrls(){var A,Q,B;return(B=(Q=(A=this.config).supportedUrls)==null?void 0:Q.call(A))!=null?B:{}}async getArgs({prompt:A,maxOutputTokens:Q,temperature:B,topP:I,topK:C,frequencyPenalty:E,presencePenalty:D,stopSequences:g,responseFormat:_,seed:F,providerOptions:G,tools:U,toolChoice:X}){var H;let K=[],Z=(H=await $0({provider:this.providerOptionsName,providerOptions:G,schema:NmB}))!=null?H:{};if(C!=null)K.push({type:"unsupported",feature:"topK"});if(U==null?void 0:U.length)K.push({type:"unsupported",feature:"tools"});if(X!=null)K.push({type:"unsupported",feature:"toolChoice"});if(_!=null&&_.type!=="text")K.push({type:"unsupported",feature:"responseFormat",details:"JSON response format is not supported."});let{prompt:W,stopSequences:q}=qmB({prompt:A}),V=[...q!=null?q:[],...g!=null?g:[]];return{args:{model:this.modelId,echo:Z.echo,logit_bias:Z.logitBias,suffix:Z.suffix,user:Z.user,max_tokens:Q,temperature:B,top_p:I,frequency_penalty:E,presence_penalty:D,seed:F,...G==null?void 0:G[this.providerOptionsName],prompt:W,stop:V.length>0?V:void 0},warnings:K}}async doGenerate(A){let{args:Q,warnings:B}=await this.getArgs(A),{responseHeaders:I,value:C,rawValue:E}=await u0({url:this.config.url({path:"/completions",modelId:this.modelId}),headers:V0(this.config.headers(),A.headers),body:Q,failedResponseHandler:this.failedResponseHandler,successfulResponseHandler:wC(VmB),abortSignal:A.abortSignal,fetch:this.config.fetch}),D=C.choices[0],g=[];if(D.text!=null&&D.text.length>0)g.push({type:"text",text:D.text});return{content:g,usage:rCQ(C.usage),finishReason:{unified:tCQ(D.finish_reason),raw:D.finish_reason},request:{body:Q},response:{...sCQ(C),headers:I,body:E},warnings:B}}async doStream(A){let{args:Q,warnings:B}=await this.getArgs(A),I={...Q,stream:!0,stream_options:this.config.includeUsage?{include_usage:!0}:void 0},{responseHeaders:C,value:E}=await u0({url:this.config.url({path:"/completions",modelId:this.modelId}),headers:V0(this.config.headers(),A.headers),body:I,failedResponseHandler:this.failedResponseHandler,successfulResponseHandler:qF(this.chunkSchema),abortSignal:A.abortSignal,fetch:this.config.fetch}),D={unified:"other",raw:void 0},g=void 0,_=!0;return{stream:E.pipeThrough(new TransformStream({start(F){F.enqueue({type:"stream-start",warnings:B})},transform(F,G){var U;if(A.includeRawChunks)G.enqueue({type:"raw",rawValue:F.rawValue});if(!F.success){D={unified:"error",raw:void 0},G.enqueue({type:"error",error:F.error});return}let X=F.value;if("error"in X){D={unified:"error",raw:void 0},G.enqueue({type:"error",error:X.error});return}if(_)_=!1,G.enqueue({type:"response-metadata",...sCQ(X)}),G.enqueue({type:"text-start",id:"0"});if(X.usage!=null)g=X.usage;let H=X.choices[0];if((H==null?void 0:H.finish_reason)!=null)D={unified:tCQ(H.finish_reason),raw:(U=H.finish_reason)!=null?U:void 0};if((H==null?void 0:H.text)!=null)G.enqueue({type:"text-delta",id:"0",delta:H.text})},flush(F){if(!_)F.enqueue({type:"text-end",id:"0"});F.enqueue({type:"finish",finishReason:D,usage:rCQ(g)})}})),request:{body:I},response:{headers:C}}}},BEQ,VmB,LmB=(A)=>w.union([w.object({id:w.string().nullish(),created:w.number().nullish(),model:w.string().nullish(),choices:w.array(w.object({text:w.string(),finish_reason:w.string().nullish(),index:w.number()})),usage:BEQ.nullish()}),A]),f4A,RmB=class{constructor(A,Q){this.specificationVersion="v3",this.modelId=A,this.config=Q}get provider(){return this.config.provider}get maxEmbeddingsPerCall(){var A;return(A=this.config.maxEmbeddingsPerCall)!=null?A:2048}get supportsParallelCalls(){var A;return(A=this.config.supportsParallelCalls)!=null?A:!0}get providerOptionsName(){return this.config.provider.split(".")[0].trim()}async doEmbed({values:A,headers:Q,abortSignal:B,providerOptions:I}){var C,E,D;let g=[],_=await $0({provider:"openai-compatible",providerOptions:I,schema:f4A});if(_!=null)g.push({type:"other",message:"The 'openai-compatible' key in providerOptions is deprecated. Use 'openaiCompatible' instead."});let F=Object.assign(_!=null?_:{},(C=await $0({provider:"openaiCompatible",providerOptions:I,schema:f4A}))!=null?C:{},(E=await $0({provider:this.providerOptionsName,providerOptions:I,schema:f4A}))!=null?E:{});if(A.length>this.maxEmbeddingsPerCall)throw new Yq({provider:this.provider,modelId:this.modelId,maxEmbeddingsPerCall:this.maxEmbeddingsPerCall,values:A});let{responseHeaders:G,value:U,rawValue:X}=await u0({url:this.config.url({path:"/embeddings",modelId:this.modelId}),headers:V0(this.config.headers(),Q),body:{model:this.modelId,input:A,encoding_format:"float",dimensions:F.dimensions,user:F.user},failedResponseHandler:fw((D=this.config.errorStructure)!=null?D:vT),successfulResponseHandler:wC(OmB),abortSignal:B,fetch:this.config.fetch});return{warnings:g,embeddings:U.data.map((H)=>H.embedding),usage:U.usage?{tokens:U.usage.prompt_tokens}:void 0,providerMetadata:U.providerMetadata,response:{headers:G,body:X}}}},OmB,ymB=class{constructor(A,Q){this.modelId=A,this.config=Q,this.specificationVersion="v3",this.maxImagesPerCall=10}get provider(){return this.config.provider}get providerOptionsKey(){return this.config.provider.split(".")[0].trim()}getArgs(A){return{...A[this.providerOptionsKey],...A[fmB(this.providerOptionsKey)]}}async doGenerate({prompt:A,n:Q,size:B,aspectRatio:I,seed:C,providerOptions:E,headers:D,abortSignal:g,files:_,mask:F}){var G,U,X,H,K;let Z=[];if(I!=null)Z.push({type:"unsupported",feature:"aspectRatio",details:"This model does not support aspect ratio. Use `size` instead."});if(C!=null)Z.push({type:"unsupported",feature:"seed"});let W=(X=(U=(G=this.config._internal)==null?void 0:G.currentDate)==null?void 0:U.call(G))!=null?X:new Date,q=this.getArgs(E);if(_!=null&&_.length>0){let{value:L,responseHeaders:k}=await Rq({url:this.config.url({path:"/images/edits",modelId:this.modelId}),headers:V0(this.config.headers(),D),formData:Hl({model:this.modelId,prompt:A,image:await Promise.all(_.map((P)=>AEQ(P))),mask:F!=null?await AEQ(F):void 0,n:Q,size:B,...q}),failedResponseHandler:fw((H=this.config.errorStructure)!=null?H:vT),successfulResponseHandler:wC(eCQ),abortSignal:g,fetch:this.config.fetch});return{images:L.data.map((P)=>P.b64_json),warnings:Z,response:{timestamp:W,modelId:this.modelId,headers:k}}}let{value:V,responseHeaders:M}=await u0({url:this.config.url({path:"/images/generations",modelId:this.modelId}),headers:V0(this.config.headers(),D),body:{model:this.modelId,prompt:A,n:Q,size:B,...q,response_format:"b64_json"},failedResponseHandler:fw((K=this.config.errorStructure)!=null?K:vT),successfulResponseHandler:wC(eCQ),abortSignal:g,fetch:this.config.fetch});return{images:V.data.map((L)=>L.b64_json),warnings:Z,response:{timestamp:W,modelId:this.modelId,headers:M}}}},eCQ,TmB="2.0.26";var Wl=b(()=>{j0();gB();IB();IB();j0();gB();IB();j0();gB();IB();j0();IB();j0();gB();IB();IB();gB();IB();gB();UmB=w.object({error:w.object({message:w.string(),type:w.string().nullish(),param:w.any().nullish(),code:w.union([w.string(),w.number()]).nullish()})}),vT={errorSchema:UmB,errorToMessage:(A)=>A.error.message};zl=w.object({user:w.string().optional(),reasoningEffort:w.string().optional(),textVerbosity:w.string().optional(),strictJsonSchema:w.boolean().optional()});QEQ=w.object({prompt_tokens:w.number().nullish(),completion_tokens:w.number().nullish(),total_tokens:w.number().nullish(),prompt_tokens_details:w.object({cached_tokens:w.number().nullish()}).nullish(),completion_tokens_details:w.object({reasoning_tokens:w.number().nullish(),accepted_prediction_tokens:w.number().nullish(),rejected_prediction_tokens:w.number().nullish()}).nullish()}).nullish(),ZmB=w.looseObject({id:w.string().nullish(),created:w.number().nullish(),model:w.string().nullish(),choices:w.array(w.object({message:w.object({role:w.literal("assistant").nullish(),content:w.string().nullish(),reasoning_content:w.string().nullish(),reasoning:w.string().nullish(),tool_calls:w.array(w.object({id:w.string().nullish(),function:w.object({name:w.string(),arguments:w.string()}),extra_content:w.object({google:w.object({thought_signature:w.string().nullish()}).nullish()}).nullish()})).nullish()}),finish_reason:w.string().nullish()})),usage:QEQ}),zmB=w.looseObject({id:w.string().nullish(),created:w.number().nullish(),model:w.string().nullish(),choices:w.array(w.object({delta:w.object({role:w.enum(["assistant"]).nullish(),content:w.string().nullish(),reasoning_content:w.string().nullish(),reasoning:w.string().nullish(),tool_calls:w.array(w.object({index:w.number().nullish(),id:w.string().nullish(),function:w.object({name:w.string().nullish(),arguments:w.string().nullish()}),extra_content:w.object({google:w.object({thought_signature:w.string().nullish()}).nullish()}).nullish()})).nullish()}).nullish(),finish_reason:w.string().nullish()})),usage:QEQ});NmB=w.object({echo:w.boolean().optional(),logitBias:w.record(w.string(),w.number()).optional(),suffix:w.string().optional(),user:w.string().optional()}),BEQ=w.object({prompt_tokens:w.number(),completion_tokens:w.number(),total_tokens:w.number()}),VmB=w.object({id:w.string().nullish(),created:w.number().nullish(),model:w.string().nullish(),choices:w.array(w.object({text:w.string(),finish_reason:w.string()})),usage:BEQ.nullish()}),f4A=w.object({dimensions:w.number().optional(),user:w.string().optional()}),OmB=w.object({data:w.array(w.object({embedding:w.array(w.number())})),usage:w.object({prompt_tokens:w.number()}).nullish(),providerMetadata:w.record(w.string(),w.record(w.string(),w.any())).optional()}),eCQ=w.object({data:w.array(w.object({b64_json:w.string()}))})});import xT from"fs";import{homedir as PmB}from"os";function Nl(A,Q){let B=Q.split(".")[0];if(!A&&jmB.includes(B))throw Error(`Config key '${B}' can only be set globally`)}class aD{globalConfig;projectConfig;argvConfig;globalConfigPath;projectConfigPath;constructor(A,Q,B){let I=Q.toLowerCase(),C=MA.join(PmB(),`.${I}`,"config.json"),E=MA.join(A,`.${I}`,"config.json"),D=MA.join(A,`.${I}`,"config.local.json");this.globalConfigPath=C,this.projectConfigPath=E,this.globalConfig=T4A(C),this.projectConfig=fY(T4A(E),T4A(D)),this.argvConfig=B}get config(){let A=fY(this.argvConfig,fY(this.projectConfig,fY(this.globalConfig,p3)));return A.planModel=A.planModel||A.model,A.smallModel=A.smallModel||A.model,A.visionModel=A.visionModel||A.model,A}removeConfig(A,Q,B){Nl(A,Q);let I=A?this.globalConfig:this.projectConfig,C=A?this.globalConfigPath:this.projectConfigPath;if(Q.includes(".")){let E=Q.split("."),D=E[0];if(!i3.includes(D))throw Error(`Invalid config key: ${D}`);if(!ql.includes(D))throw Error(`Config key '${D}' does not support nested properties`);let g=I[D];if(!g)return;for(let F=1;F<E.length-1;F++){if(!g[E[F]])return;g=g[E[F]]}let _=E[E.length-1];if(B){if(Array.isArray(g[_]))g[_]=g[_].filter((F)=>!B.includes(F))}else delete g[_]}else{if(!i3.includes(Q))throw Error(`Invalid config key: ${Q}`);if(B)I[Q]=I[Q].filter((E)=>!B.includes(E));else delete I[Q]}Ml(C,I,p3)}addConfig(A,Q,B){if(Nl(A,Q),!i3.includes(Q))throw Error(`Invalid config key: ${Q}`);let I=A?this.globalConfig:this.projectConfig,C=A?this.globalConfigPath:this.projectConfigPath;if(IEQ.includes(Q))I[Q]=[...I[Q]||[],...B];else if(ql.includes(Q))I[Q]={...I[Q],...B};Ml(C,I,p3)}getConfig(A,Q){let B=A?this.globalConfig:this.projectConfig,I=(E)=>{if(!Q.includes("."))return E[Q];let D=Q.split("."),g=D[0];if(!i3.includes(g))throw Error(`Invalid config key: ${g}`);let _=E[g];for(let F=1;F<D.length;F++){if(_===void 0||_===null)return;_=_[D[F]]}return _},C=I(B);if(C!==void 0)return C;return I(p3)}setConfig(A,Q,B){Nl(A,Q);let I=A?this.globalConfig:this.projectConfig,C=A?this.globalConfigPath:this.projectConfigPath;if(Q.includes(".")){let E=Q.split("."),D=E[0];if(!i3.includes(D))throw Error(`Invalid config key: ${D}`);if(!ql.includes(D))throw Error(`Config key '${D}' does not support nested properties`);if(!I[D])I[D]={};let g=I[D];for(let F=1;F<E.length-1;F++){if(!g[E[F]])g[E[F]]={};g=g[E[F]]}let _=E[E.length-1];g[_]=B}else{if(!i3.includes(Q))throw Error(`Invalid config key: ${Q}`);let E=B;if(kmB.includes(Q))if(typeof B==="boolean")E=B;else E=B==="true";if(IEQ.includes(Q))E=JSON.parse(B);if(ql.includes(Q))E=JSON.parse(B);I[Q]=E}Ml(C,I,p3)}updateConfig(A,Q){Object.keys(Q).forEach((C)=>{if(!i3.includes(C))throw Error(`Invalid config key: ${C}`);Nl(A,C)});let B=A?this.globalConfig:this.projectConfig,I=A?this.globalConfigPath:this.projectConfigPath;if(B=fY(Q,B),A)this.globalConfig=B;else this.projectConfig=B;Ml(I,B,p3)}}function T4A(A){if(!xT.existsSync(A))return{};try{return JSON.parse(xT.readFileSync(A,"utf-8"))}catch(Q){throw Error(`Unable to read config file ${A}: ${Q}`)}}function Ml(A,Q,B){let I=Object.fromEntries(Object.entries(Q).filter(([E,D])=>JSON.stringify(D)!==JSON.stringify(B[E]))),C=MA.dirname(A);if(!xT.existsSync(C))xT.mkdirSync(C,{recursive:!0});xT.writeFileSync(A,JSON.stringify(I,null,2),"utf-8")}var p3,i3,IEQ,ql,kmB,jmB;var mY=b(()=>{om();AI();p3={language:"English",quiet:!1,approvalMode:"default",plugins:[],mcpServers:{},provider:{},todo:!0,autoCompact:!0,truncation:!0,outputFormat:"text",autoUpdate:!0,extensions:{},tools:{},agent:{},checkpoints:!0},i3=[...Object.keys(p3),"model","planModel","smallModel","visionModel","systemPrompt","todo","autoCompact","truncation","commit","outputStyle","autoUpdate","provider","temperature","httpProxy","extensions","tools","agent","notification","skills","thinkingLevel","checkpoints"],IEQ=["plugins","skills"],ql=["mcpServers","commit","provider","extensions","tools","agent"],kmB=["quiet","todo","autoCompact","autoUpdate","truncation","checkpoints"],jmB=[]});var SmB,Vl;var CEQ=b(()=>{SmB={"deepseek-v3-0324":{name:"DeepSeek-V3-0324",shortName:"DeepSeek V3",attachment:!1,reasoning:!0,temperature:!0,tool_call:!0,knowledge:"2024-06",release_date:"2025-03-24",last_updated:"2025-03-24",modalities:{input:["text"],output:["text"]},open_weights:!0,limit:{context:128000,output:8192},aliases:["deepseek-chat-v3-0324","deepseek-v3"]},"deepseek-v3-1":{name:"DeepSeek V3.1",shortName:"DeepSeek V3.1",attachment:!1,reasoning:!0,temperature:!0,tool_call:!0,knowledge:"2025-07",release_date:"2025-08-21",last_updated:"2025-08-21",modalities:{input:["text"],output:["text"]},open_weights:!0,limit:{context:163840,output:163840},aliases:["deepseek-chat-v3.1","deepseek-v3.1","deepseek-v3-1-250821"]},"deepseek-v3-1-terminus":{name:"DeepSeek V3.1 Terminus",attachment:!1,reasoning:!0,temperature:!0,tool_call:!0,knowledge:"2025-07",release_date:"2025-09-22",last_updated:"2025-09-22",modalities:{input:["text"],output:["text"]},open_weights:!0,limit:{context:131072,output:65536},aliases:["deepseek-v3.1-terminus"]},"deepseek-v3-2-exp":{name:"DeepSeek V3.2 Exp",attachment:!1,reasoning:!0,temperature:!0,tool_call:!0,knowledge:"2025-09",release_date:"2025-09-29",last_updated:"2025-09-29",modalities:{input:["text"],output:["text"]},open_weights:!0,limit:{context:131072,output:65536},aliases:["deepseek-v3.2-exp"]},"deepseek-v3.2":{name:"DeepSeek V3.2",attachment:!1,reasoning:!0,temperature:!0,tool_call:!0,knowledge:"2025-12",release_date:"2025-12-01",last_updated:"2025-12-01",modalities:{input:["text"],output:["text"]},open_weights:!0,limit:{context:131072,output:65536},aliases:["deepseek-chat","deepseek-chat-v3.2"]},"deepseek-v3.2-speciale":{name:"DeepSeek V3.2 Speciale",attachment:!1,reasoning:!0,temperature:!0,tool_call:!1,knowledge:"2025-12",release_date:"2025-12-01",last_updated:"2025-12-01",modalities:{input:["text"],output:["text"]},open_weights:!0,limit:{context:131072,output:131072}},"deepseek-r1-0528":{name:"DeepSeek-R1-0528",shortName:"DeepSeek R1",attachment:!1,reasoning:!0,temperature:!0,tool_call:!0,knowledge:"2024-06",release_date:"2025-05-28",last_updated:"2025-05-28",modalities:{input:["text"],output:["text"]},open_weights:!0,limit:{context:65536,output:8192},aliases:["deepseek-reasoner","deepseek-r1"]},"doubao-seed-1.6":{name:"Doubao Seed 1.6",attachment:!1,reasoning:!0,temperature:!0,tool_call:!0,knowledge:"2025-01",release_date:"2025-06-11",last_updated:"2025-09-23",modalities:{input:["text","image"],output:["text"]},open_weights:!0,limit:{context:163840,output:163840},aliases:["doubao-seed-1-6-250615"]},"kimi-k2":{name:"Kimi K2",attachment:!1,reasoning:!1,temperature:!0,tool_call:!0,knowledge:"2024-10",release_date:"2025-07-11",last_updated:"2025-07-11",modalities:{input:["text"],output:["text"]},open_weights:!0,limit:{context:131072,output:16384},aliases:["kimi-k2-instruct"]},"kimi-k2-turbo-preview":{name:"Kimi K2 Turbo",attachment:!1,reasoning:!1,temperature:!0,tool_call:!0,knowledge:"2024-10",release_date:"2025-07-14",last_updated:"2025-07-14",modalities:{input:["text"],output:["text"]},open_weights:!0,limit:{context:131072,output:16384}},"kimi-k2-0905":{name:"Kimi K2 Instruct 0905",shortName:"Kimi K2 0905",attachment:!1,reasoning:!1,temperature:!0,tool_call:!0,knowledge:"2024-10",release_date:"2025-09-05",last_updated:"2025-09-05",modalities:{input:["text"],output:["text"]},open_weights:!0,limit:{context:262144,output:16384},aliases:["kimi-k2-0905-preview","kimi-k2-instruct-0905","kimi-k2-250905"]},"kimi-k2-thinking":{name:"Kimi K2 Thinking",attachment:!1,reasoning:!0,temperature:!0,tool_call:!0,knowledge:"2024-08",release_date:"2025-11-06",last_updated:"2025-11-06",modalities:{input:["text"],output:["text"]},open_weights:!0,limit:{context:262144,output:262144}},"kimi-k2-thinking-turbo":{name:"Kimi K2 Thinking Turbo",attachment:!1,reasoning:!0,temperature:!0,tool_call:!0,knowledge:"2024-08",release_date:"2025-11-06",last_updated:"2025-11-06",modalities:{input:["text"],output:["text"]},open_weights:!0,limit:{context:262144,output:262144}},"kimi-k2.5":{name:"Kimi K2.5",attachment:!0,reasoning:!0,temperature:!0,tool_call:!0,knowledge:"2025-01",release_date:"2026-01-27",last_updated:"2026-01-27",modalities:{input:["text","image","video"],output:["text"]},open_weights:!0,limit:{context:262144,output:262144}},"qwen3-coder-480b-a35b-instruct":{name:"Qwen3 Coder 480B A35B Instruct",shortName:"Qwen3 Coder",attachment:!1,reasoning:!1,temperature:!0,tool_call:!0,knowledge:"2025-04",release_date:"2025-07-23",last_updated:"2025-07-23",modalities:{input:["text"],output:["text"]},open_weights:!0,limit:{context:262144,output:66536},aliases:["qwen3-coder"]},"qwen3-coder-plus":{name:"Qwen3 Coder Plus",attachment:!1,reasoning:!1,temperature:!0,tool_call:!0,knowledge:"2025-04",release_date:"2025-07-23",last_updated:"2025-07-23",modalities:{input:["text"],output:["text"]},open_weights:!0,limit:{context:1048576,output:65536},aliases:["coder-model"]},"qwen3-235b-a22b-07-25":{name:"Qwen3 235B A22B Instruct 2507",shortName:"Qwen3",attachment:!1,reasoning:!0,temperature:!0,tool_call:!0,knowledge:"2025-04",release_date:"2025-04-28",last_updated:"2025-07-21",modalities:{input:["text"],output:["text"]},open_weights:!0,limit:{context:262144,output:131072},aliases:["qwen3-235b-a22b-instruct-2507"]},"qwen3-max":{name:"Qwen3 Max",attachment:!1,reasoning:!0,temperature:!0,tool_call:!0,knowledge:"2025-09",release_date:"2025-09-05",last_updated:"2025-09-05",modalities:{input:["text"],output:["text"]},open_weights:!1,limit:{context:262144,output:32768}},"gemini-2.5-flash":{name:"Gemini 2.5 Flash",attachment:!0,reasoning:!0,temperature:!0,tool_call:!0,knowledge:"2025-01",release_date:"2025-03-20",last_updated:"2025-06-05",modalities:{input:["text","image","audio","video","pdf"],output:["text"]},open_weights:!1,limit:{context:1048576,output:65536},aliases:["gemini-2.5-flash-thinking"]},"gemini-2.5-flash-preview-09-2025":{name:"Gemini 2.5 Flash Preview 2025 09",attachment:!0,reasoning:!0,temperature:!0,tool_call:!0,knowledge:"2025-01",release_date:"2025-09-25",last_updated:"2025-09-25",modalities:{input:["text","image","audio","video","pdf"],output:["text"]},open_weights:!1,limit:{context:1048576,output:65536}},"gemini-2.5-flash-lite-preview-06-17":{name:"Gemini 2.5 Flash Lite Preview 06-17",shortName:"Gemini 2.5 Flash Lite",attachment:!0,reasoning:!0,temperature:!0,tool_call:!0,knowledge:"2025-01",release_date:"2025-06-17",last_updated:"2025-06-17",modalities:{input:["text","image","audio","video","pdf"],output:["text"]},open_weights:!1,limit:{context:65536,output:65536},aliases:["gemini-2.5-flash-lite"]},"gemini-2.5-pro":{name:"Gemini 2.5 Pro",attachment:!0,reasoning:!0,temperature:!0,tool_call:!0,knowledge:"2025-01",release_date:"2025-03-20",last_updated:"2025-06-05",modalities:{input:["text","image","audio","video","pdf"],output:["text"]},open_weights:!1,limit:{context:1048576,output:65536}},"gemini-3-pro-preview":{name:"Gemini 3 Pro Preview",attachment:!0,reasoning:!0,temperature:!0,tool_call:!0,knowledge:"2025-01",release_date:"2025-01-01",last_updated:"2025-01-01",modalities:{input:["text","image","audio","video","pdf"],output:["text"]},open_weights:!1,limit:{context:200000,output:65536},aliases:["gemini-3-pro","gemini-3-pro-low","gemini-3-pro-high"]},"gemini-3-flash-preview":{name:"Gemini 3 Flash Preview",attachment:!0,reasoning:!0,temperature:!0,tool_call:!0,knowledge:"2025-01",release_date:"2025-12-17",last_updated:"2025-12-17",modalities:{input:["text","image","video","audio","pdf"],output:["text"]},open_weights:!1,limit:{context:1048576,output:65536},aliases:["gemini-3-flash"]},"grok-4":{name:"Grok 4",attachment:!1,reasoning:!0,temperature:!0,tool_call:!0,knowledge:"2025-07",release_date:"2025-07-09",last_updated:"2025-07-09",modalities:{input:["text"],output:["text"]},open_weights:!1,limit:{context:256000,output:64000}},"grok-code-fast-1":{name:"Grok Code Fast 1",attachment:!0,reasoning:!0,temperature:!0,tool_call:!0,knowledge:"2025-08",release_date:"2025-08-20",last_updated:"2025-08-20",modalities:{input:["text","image"],output:["text"]},open_weights:!1,limit:{context:256000,output:32000}},"grok-4-fast":{name:"Grok 4 Fast",attachment:!0,reasoning:!0,temperature:!0,tool_call:!0,knowledge:"2024-11",release_date:"2025-08-19",last_updated:"2025-08-19",modalities:{input:["text","image"],output:["text"]},open_weights:!1,limit:{context:2000000,output:2000000}},"grok-4.1-fast":{name:"Grok 4.1 Fast",attachment:!0,reasoning:!0,temperature:!0,tool_call:!0,knowledge:"2025-10",release_date:"2025-11-19",last_updated:"2025-11-19",modalities:{input:["text","image"],output:["text"]},open_weights:!1,limit:{context:2000000,output:2000000},aliases:["grok-4-1-fast","grok-4-1-fast-non-reasoning"]},"claude-3-5-sonnet-20241022":{name:"Claude Sonnet 3.5 v2",shortName:"Sonnet 3.5",attachment:!0,reasoning:!1,temperature:!0,tool_call:!0,knowledge:"2024-04-30",release_date:"2024-10-22",last_updated:"2024-10-22",modalities:{input:["text","image"],output:["text"]},open_weights:!1,limit:{context:200000,output:8192},aliases:["claude-3.5-sonnet"]},"claude-3-7-sonnet":{name:"Claude Sonnet 3.7",shortName:"Sonnet 3.7",attachment:!0,reasoning:!0,temperature:!0,tool_call:!0,knowledge:"2024-10-31",release_date:"2025-02-19",last_updated:"2025-02-19",modalities:{input:["text","image"],output:["text"]},open_weights:!1,limit:{context:200000,output:64000},aliases:["claude-3.7-sonnet","claude-3.7-sonnet-thought","claude-3-7-sonnet-20250219","claude-3-7-sonnet-20250219-thinking"]},"claude-4-sonnet":{name:"Claude Sonnet 4",shortName:"Sonnet 4",attachment:!0,reasoning:!0,temperature:!0,tool_call:!0,knowledge:"2025-03-31",release_date:"2025-05-22",last_updated:"2025-05-22",modalities:{input:["text","image"],output:["text"]},open_weights:!1,limit:{context:200000,output:64000},aliases:["claude-sonnet-4","claude-sonnet-4-20250514"]},"claude-4-opus":{name:"Claude Opus 4",shortName:"Opus 4",attachment:!0,reasoning:!0,temperature:!0,tool_call:!0,knowledge:"2025-03-31",release_date:"2025-05-22",last_updated:"2025-05-22",modalities:{input:["text","image"],output:["text"]},open_weights:!1,limit:{context:200000,output:32000},aliases:["claude-opus-4","claude-opus-4-20250514"]},"gpt-oss-120b":{name:"GPT OSS 120B",shortName:"GPT OSS",attachment:!1,reasoning:!0,temperature:!0,tool_call:!0,knowledge:"2025-08",release_date:"2025-08-05",last_updated:"2025-08-05",modalities:{input:["text"],output:["text"]},open_weights:!0,limit:{context:131072,output:32768},aliases:["gpt-oss-120b-medium"]},"gpt-5.1-codex":{name:"GPT-5.1-Codex",attachment:!1,reasoning:!0,temperature:!1,tool_call:!0,knowledge:"2024-09-30",release_date:"2025-11-13",last_updated:"2025-11-13",modalities:{input:["text","image"],output:["text"]},open_weights:!1,limit:{context:400000,output:128000}},"gpt-5.1-codex-mini":{name:"GPT-5.1-Codex-mini",attachment:!1,reasoning:!0,temperature:!1,tool_call:!0,knowledge:"2024-09-30",release_date:"2025-11-13",last_updated:"2025-11-13",modalities:{input:["text","image"],output:["text"]},open_weights:!1,limit:{context:400000,output:1e5}},"gpt-5.1-codex-max":{name:"GPT 5.1 Codex Max",attachment:!0,reasoning:!0,temperature:!1,tool_call:!0,knowledge:"2024-09-30",release_date:"2025-11-13",last_updated:"2025-11-13",modalities:{input:["text","image"],output:["text"]},open_weights:!1,limit:{context:400000,output:128000}},"gpt-5.1":{name:"GPT-5.1",attachment:!0,reasoning:!0,temperature:!1,tool_call:!0,knowledge:"2024-09-30",release_date:"2025-11-13",last_updated:"2025-11-13",modalities:{input:["text","image"],output:["text"]},open_weights:!1,limit:{context:400000,output:128000}},"gpt-5":{name:"GPT-5",attachment:!0,reasoning:!0,temperature:!1,tool_call:!0,knowledge:"2024-09-30",release_date:"2025-08-07",last_updated:"2025-08-07",modalities:{input:["text","audio","image","video"],output:["text","audio","image"]},open_weights:!1,limit:{context:400000,output:128000}},"gpt-5-mini":{name:"GPT-5 Mini",attachment:!0,reasoning:!0,temperature:!1,tool_call:!0,knowledge:"2024-05-30",release_date:"2025-08-07",last_updated:"2025-08-07",modalities:{input:["text","image"],output:["text"]},open_weights:!1,limit:{context:272000,output:128000}},"gpt-5-codex":{name:"GPT-5-Codex",attachment:!1,reasoning:!0,temperature:!1,tool_call:!0,knowledge:"2024-09-30",release_date:"2025-09-15",last_updated:"2025-09-15",modalities:{input:["text","image"],output:["text"]},open_weights:!1,limit:{context:128000,output:64000}},"gpt-5.2":{name:"GPT-5.2",attachment:!0,reasoning:!0,temperature:!1,knowledge:"2025-08-31",tool_call:!0,release_date:"2025-12-11",last_updated:"2025-12-11",modalities:{input:["text","image"],output:["text","image"]},open_weights:!1,limit:{context:400000,output:128000}},"gpt-5.2-pro":{name:"GPT-5.2 Pro",attachment:!0,reasoning:!0,temperature:!1,knowledge:"2025-08-31",tool_call:!0,release_date:"2025-12-11",last_updated:"2025-12-11",modalities:{input:["text","image"],output:["text"]},open_weights:!1,limit:{context:400000,output:128000}},"gpt-5.2-codex":{name:"GPT-5.2-Codex",attachment:!0,reasoning:!0,temperature:!0,tool_call:!0,knowledge:"2025-08-31",release_date:"2026-01-14",last_updated:"2026-01-14",modalities:{input:["text","image"],output:["text"]},open_weights:!1,limit:{context:400000,output:128000}},"gpt-5.3-codex":{name:"GPT-5.3 Codex",attachment:!0,reasoning:!0,temperature:!1,tool_call:!0,knowledge:"2025-08-31",release_date:"2026-02-05",last_updated:"2026-02-05",modalities:{input:["text","image","pdf"],output:["text"]},open_weights:!1,limit:{context:400000,output:128000}},"gpt-4.1":{name:"GPT-4.1",attachment:!0,reasoning:!1,temperature:!0,tool_call:!0,knowledge:"2024-04",release_date:"2025-04-14",last_updated:"2025-04-14",modalities:{input:["text","image"],output:["text"]},open_weights:!1,limit:{context:1047576,output:32768}},"gpt-4":{name:"GPT-4",attachment:!0,reasoning:!1,temperature:!0,tool_call:!0,knowledge:"2023-11",release_date:"2023-11-06",last_updated:"2024-04-09",modalities:{input:["text"],output:["text"]},open_weights:!1,limit:{context:8192,output:8192}},"gpt-4o":{name:"GPT-4o",attachment:!0,reasoning:!1,temperature:!0,tool_call:!0,knowledge:"2023-09",release_date:"2024-05-13",last_updated:"2024-05-13",modalities:{input:["text","image"],output:["text"]},open_weights:!1,limit:{context:128000,output:16384}},o3:{name:"o3",attachment:!0,reasoning:!0,temperature:!1,tool_call:!0,knowledge:"2024-05",release_date:"2025-04-16",last_updated:"2025-04-16",modalities:{input:["text","image"],output:["text"]},open_weights:!1,limit:{context:200000,output:1e5}},"o3-pro":{name:"o3-pro",attachment:!0,reasoning:!0,temperature:!1,tool_call:!0,knowledge:"2024-05",release_date:"2025-06-10",last_updated:"2025-06-10",modalities:{input:["text","image"],output:["text"]},open_weights:!1,limit:{context:200000,output:1e5}},"o3-mini":{name:"o3-mini",attachment:!1,reasoning:!0,temperature:!1,tool_call:!0,knowledge:"2024-05",release_date:"2024-12-20",last_updated:"2025-01-29",modalities:{input:["text"],output:["text"]},open_weights:!1,limit:{context:200000,output:1e5}},"o4-mini":{name:"o4-mini",attachment:!0,reasoning:!0,temperature:!1,tool_call:!0,knowledge:"2024-05",release_date:"2025-04-16",last_updated:"2025-04-16",modalities:{input:["text","image"],output:["text"]},open_weights:!1,limit:{context:200000,output:1e5}},"glm-4.5":{name:"GLM-4.5",attachment:!1,reasoning:!0,temperature:!0,tool_call:!0,knowledge:"2025-04",release_date:"2025-07-28",last_updated:"2025-07-28",modalities:{input:["text"],output:["text"]},open_weights:!0,limit:{context:131072,output:98304},aliases:[]},"glm-4.5-air":{name:"GLM-4.5-Air",attachment:!1,reasoning:!0,temperature:!0,tool_call:!0,knowledge:"2025-04",release_date:"2025-07-28",last_updated:"2025-07-28",modalities:{input:["text"],output:["text"]},open_weights:!0,limit:{context:131072,output:98304}},"glm-4.5-flash":{name:"GLM-4.5-Flash",attachment:!1,reasoning:!0,temperature:!0,tool_call:!0,knowledge:"2025-04",release_date:"2025-07-28",last_updated:"2025-07-28",modalities:{input:["text"],output:["text"]},open_weights:!0,limit:{context:131072,output:98304}},"glm-4.5v":{name:"GLM-4.5V",attachment:!0,reasoning:!0,temperature:!0,tool_call:!0,knowledge:"2025-04",release_date:"2025-08-11",last_updated:"2025-08-11",modalities:{input:["text","image","video"],output:["text"]},open_weights:!0,limit:{context:64000,output:16384}},"glm-4.6":{name:"GLM-4.6",attachment:!1,reasoning:!0,temperature:!0,tool_call:!0,knowledge:"2025-04",release_date:"2025-09-30",last_updated:"2025-09-30",modalities:{input:["text"],output:["text"]},open_weights:!0,limit:{context:204800,output:131072}},"glm-4.6v":{name:"GLM-4.6V",attachment:!0,reasoning:!0,temperature:!0,tool_call:!0,knowledge:"2025-04",release_date:"2025-12-08",last_updated:"2025-12-08",modalities:{input:["text","image","video"],output:["text"]},open_weights:!0,limit:{context:131072,output:24000}},"glm-4.7":{name:"GLM-4.7",attachment:!1,reasoning:!0,temperature:!0,tool_call:!0,knowledge:"2025-04",release_date:"2025-12-22",last_updated:"2025-12-22",modalities:{input:["text"],output:["text"]},open_weights:!0,limit:{context:204800,output:131072},aliases:["zai-glm-4.7","glm4.7"]},"glm-5":{name:"GLM-5",attachment:!1,reasoning:!0,temperature:!0,tool_call:!0,knowledge:"2025-06",release_date:"2026-02-10",last_updated:"2026-02-10",modalities:{input:["text"],output:["text"]},open_weights:!0,limit:{context:262144,output:131072},aliases:["zai-glm-5","glm5"]},"sonoma-dusk-alpha":{name:"Sonoma Dusk Alpha",attachment:!0,reasoning:!1,temperature:!1,tool_call:!0,knowledge:"2024-09",release_date:"2024-09-05",last_updated:"2024-09-05",modalities:{input:["text","image"],output:["text"]},open_weights:!1,limit:{context:2000000,output:2000000}},"sonoma-sky-alpha":{name:"Sonoma Sky Alpha",attachment:!0,reasoning:!1,temperature:!1,tool_call:!0,knowledge:"2024-09",release_date:"2024-09-05",last_updated:"2024-09-05",modalities:{input:["text","image"],output:["text"]},open_weights:!1,limit:{context:2000000,output:2000000}},"claude-4.1-opus":{name:"Claude Opus 4.1",attachment:!0,reasoning:!0,temperature:!0,tool_call:!0,knowledge:"2025-03-31",release_date:"2025-08-05",last_updated:"2025-08-05",modalities:{input:["text","image"],output:["text"]},open_weights:!1,limit:{context:200000,output:32000},aliases:["claude-opus-41","claude-opus-4-1-20250805","claude-opus-4-1","claude-opus-4.1"]},"claude-4-5-sonnet":{name:"Claude Sonnet 4.5 (Preview)",attachment:!0,reasoning:!0,temperature:!0,tool_call:!0,knowledge:"2025-03-31",release_date:"2025-09-29",last_updated:"2025-09-29",modalities:{input:["text","image"],output:["text"]},open_weights:!1,limit:{context:200000,output:32000},aliases:["claude-sonnet-4.5","claude-sonnet-4-5-20250929","claude-sonnet-4-5","claude-sonnet-4-5-thinking"]},"claude-haiku-4-5":{name:"Claude Haiku 4.5",attachment:!0,reasoning:!0,temperature:!0,tool_call:!0,knowledge:"2025-02-31",release_date:"2025-10-15",last_updated:"2025-10-15",modalities:{input:["text","image"],output:["text"]},open_weights:!1,limit:{context:200000,output:64000},aliases:["claude-haiku-4.5"]},"claude-opus-4-5":{name:"Claude Opus 4.5",attachment:!0,reasoning:!0,temperature:!0,tool_call:!0,knowledge:"2025-03-31",release_date:"2025-11-24",last_updated:"2025-11-24",modalities:{input:["text","image"],output:["text"]},open_weights:!1,limit:{context:200000,output:64000},aliases:["claude-opus-4.5","claude-opus-4-5-thinking"]},"claude-opus-4-6":{name:"Claude Opus 4.6",attachment:!0,reasoning:!0,temperature:!0,tool_call:!0,knowledge:"2025-05-31",release_date:"2026-02-05",last_updated:"2026-02-05",modalities:{input:["text","image","pdf"],output:["text"]},open_weights:!1,limit:{context:200000,output:128000},aliases:["claude-opus-4.6"]},"ling-1t":{name:"InclusionAI Ling-1T",attachment:!0,reasoning:!1,temperature:!0,tool_call:!0,knowledge:"2025-10-09",release_date:"2025-10-09",last_updated:"2025-10-09",modalities:{input:["text"],output:["text"]},open_weights:!1,limit:{context:128000,output:32000}},"ring-1t":{name:"InclusionAI Ring-1T",attachment:!0,reasoning:!0,temperature:!0,tool_call:!0,knowledge:"2025-10-14",release_date:"2025-10-14",last_updated:"2025-10-14",modalities:{input:["text"],output:["text"]},open_weights:!1,limit:{context:128000,output:32000}},"ring-flash-2.0":{name:"InclusionAI Ring-flash-2.0",attachment:!0,reasoning:!0,temperature:!0,tool_call:!0,knowledge:"2025-09-09",release_date:"2025-09-15",last_updated:"2025-09-16",modalities:{input:["text"],output:["text"]},open_weights:!1,limit:{context:128000,output:32000}},"ling-flash-2.0":{name:"InclusionAI Ling-flash-2.0",attachment:!0,reasoning:!1,temperature:!0,tool_call:!0,knowledge:"2025-09-09",release_date:"2025-09-15",last_updated:"2025-09-16",modalities:{input:["text"],output:["text"]},open_weights:!1,limit:{context:128000,output:32000}},"ring-mini-2.0":{name:"InclusionAI Ring-mini-2.0",attachment:!0,reasoning:!0,temperature:!0,tool_call:!0,knowledge:"2025-09-09",release_date:"2025-09-15",last_updated:"2025-09-16",modalities:{input:["text"],output:["text"]},open_weights:!1,limit:{context:128000,output:32000}},"ling-mini-2.0":{name:"InclusionAI Ling-mini-2.0",attachment:!0,reasoning:!1,temperature:!0,tool_call:!0,knowledge:"2025-09-09",release_date:"2025-09-15",last_updated:"2025-09-16",modalities:{input:["text"],output:["text"]},open_weights:!1,limit:{context:128000,output:32000}},"minimax-m2":{name:"Minimax-M2",attachment:!1,reasoning:!0,temperature:!0,tool_call:!0,knowledge:"",release_date:"2025-10-27",last_updated:"2025-10-27",modalities:{input:["text"],output:["text"]},open_weights:!0,limit:{context:196608,output:64000}},"mimo-v2-flash":{name:"MiMo V2 Flash",attachment:!1,reasoning:!0,temperature:!0,tool_call:!0,knowledge:"2025-12",release_date:"2025-12-17",last_updated:"2025-12-17",modalities:{input:["text"],output:["text"]},open_weights:!0,limit:{context:131072,output:32768}},"minimax-m2.1":{name:"MiniMax-M2.1",attachment:!1,reasoning:!0,temperature:!0,tool_call:!0,knowledge:"",release_date:"2025-12-23",last_updated:"2025-12-23",modalities:{input:["text"],output:["text"]},open_weights:!0,limit:{context:204800,output:131072}}},Vl=(()=>{let A={...SmB};for(let Q in A){let B=A[Q];if(B.id=Q,B.aliases)for(let I of B.aliases)A[I]=B}return A})()});var Tw=()=>{};function CdB(A){return A===void 0?[]:Array.isArray(A)?A:[A]}function HdB(A){let Q=["ROOT"],B=-1,I=null;function C(_,F,G){switch(_){case'"':{B=F,Q.pop(),Q.push(G),Q.push("INSIDE_STRING");break}case"f":case"t":case"n":{B=F,I=F,Q.pop(),Q.push(G),Q.push("INSIDE_LITERAL");break}case"-":{Q.pop(),Q.push(G),Q.push("INSIDE_NUMBER");break}case"0":case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":{B=F,Q.pop(),Q.push(G),Q.push("INSIDE_NUMBER");break}case"{":{B=F,Q.pop(),Q.push(G),Q.push("INSIDE_OBJECT_START");break}case"[":{B=F,Q.pop(),Q.push(G),Q.push("INSIDE_ARRAY_START");break}}}function E(_,F){switch(_){case",":{Q.pop(),Q.push("INSIDE_OBJECT_AFTER_COMMA");break}case"}":{B=F,Q.pop();break}}}function D(_,F){switch(_){case",":{Q.pop(),Q.push("INSIDE_ARRAY_AFTER_COMMA");break}case"]":{B=F,Q.pop();break}}}for(let _=0;_<A.length;_++){let F=A[_];switch(Q[Q.length-1]){case"ROOT":C(F,_,"FINISH");break;case"INSIDE_OBJECT_START":{switch(F){case'"':{Q.pop(),Q.push("INSIDE_OBJECT_KEY");break}case"}":{B=_,Q.pop();break}}break}case"INSIDE_OBJECT_AFTER_COMMA":{switch(F){case'"':{Q.pop(),Q.push("INSIDE_OBJECT_KEY");break}}break}case"INSIDE_OBJECT_KEY":{switch(F){case'"':{Q.pop(),Q.push("INSIDE_OBJECT_AFTER_KEY");break}}break}case"INSIDE_OBJECT_AFTER_KEY":{switch(F){case":":{Q.pop(),Q.push("INSIDE_OBJECT_BEFORE_VALUE");break}}break}case"INSIDE_OBJECT_BEFORE_VALUE":{C(F,_,"INSIDE_OBJECT_AFTER_VALUE");break}case"INSIDE_OBJECT_AFTER_VALUE":{E(F,_);break}case"INSIDE_STRING":{switch(F){case'"':{Q.pop(),B=_;break}case"\\":{Q.push("INSIDE_STRING_ESCAPE");break}default:B=_}break}case"INSIDE_ARRAY_START":{switch(F){case"]":{B=_,Q.pop();break}default:{B=_,C(F,_,"INSIDE_ARRAY_AFTER_VALUE");break}}break}case"INSIDE_ARRAY_AFTER_VALUE":{switch(F){case",":{Q.pop(),Q.push("INSIDE_ARRAY_AFTER_COMMA");break}case"]":{B=_,Q.pop();break}default:{B=_;break}}break}case"INSIDE_ARRAY_AFTER_COMMA":{C(F,_,"INSIDE_ARRAY_AFTER_VALUE");break}case"INSIDE_STRING_ESCAPE":{Q.pop(),B=_;break}case"INSIDE_NUMBER":{switch(F){case"0":case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":{B=_;break}case"e":case"E":case"-":case".":break;case",":{if(Q.pop(),Q[Q.length-1]==="INSIDE_ARRAY_AFTER_VALUE")D(F,_);if(Q[Q.length-1]==="INSIDE_OBJECT_AFTER_VALUE")E(F,_);break}case"}":{if(Q.pop(),Q[Q.length-1]==="INSIDE_OBJECT_AFTER_VALUE")E(F,_);break}case"]":{if(Q.pop(),Q[Q.length-1]==="INSIDE_ARRAY_AFTER_VALUE")D(F,_);break}default:{Q.pop();break}}break}case"INSIDE_LITERAL":{let U=A.substring(I,_+1);if(!"false".startsWith(U)&&!"true".startsWith(U)&&!"null".startsWith(U)){if(Q.pop(),Q[Q.length-1]==="INSIDE_OBJECT_AFTER_VALUE")E(F,_);else if(Q[Q.length-1]==="INSIDE_ARRAY_AFTER_VALUE")D(F,_)}else B=_;break}}}let g=A.slice(0,B+1);for(let _=Q.length-1;_>=0;_--)switch(Q[_]){case"INSIDE_STRING":{g+='"';break}case"INSIDE_OBJECT_KEY":case"INSIDE_OBJECT_AFTER_KEY":case"INSIDE_OBJECT_AFTER_COMMA":case"INSIDE_OBJECT_START":case"INSIDE_OBJECT_BEFORE_VALUE":case"INSIDE_OBJECT_AFTER_VALUE":{g+="}";break}case"INSIDE_ARRAY_START":case"INSIDE_ARRAY_AFTER_COMMA":case"INSIDE_ARRAY_AFTER_VALUE":{g+="]";break}case"INSIDE_LITERAL":{let G=A.substring(I,A.length);if("true".startsWith(G))g+="true".slice(G.length);else if("false".startsWith(G))g+="false".slice(G.length);else if("null".startsWith(G))g+="null".slice(G.length)}}return g}async function Ll(A){if(A===void 0)return{value:void 0,state:"undefined-input"};let Q=await WG({text:A});if(Q.success)return{value:Q.value,state:"successful-parse"};if(Q=await WG({text:HdB(A)}),Q.success)return{value:Q.value,state:"repaired-parse"};return{value:void 0,state:"failed-parse"}}function qdB(A,Q){if(Q.length===0)return null;let B=A.indexOf(Q);if(B!==-1)return B;for(let I=A.length-1;I>=0;I--){let C=A.substring(I);if(Q.startsWith(C))return I}return null}function GEQ({tagName:A,separator:Q=`
|
|
1002
1002
|
`,startWithReasoning:B=!1}){let I=`<${A}>`,C=`</${A}>`;return{specificationVersion:"v3",wrapGenerate:async({doGenerate:E})=>{let{content:D,...g}=await E(),_=[];for(let F of D){if(F.type!=="text"){_.push(F);continue}let G=B?I+F.text:F.text,U=new RegExp(`${I}(.*?)${C}`,"gs"),X=Array.from(G.matchAll(U));if(!X.length){_.push(F);continue}let H=X.map((Z)=>Z[1]).join(Q),K=G;for(let Z=X.length-1;Z>=0;Z--){let W=X[Z],q=K.slice(0,W.index),V=K.slice(W.index+W[0].length);K=q+(q.length>0&&V.length>0?Q:"")+V}_.push({type:"reasoning",text:H}),_.push({type:"text",text:K})}return{content:_,...g}},wrapStream:async({doStream:E})=>{let{stream:D,...g}=await E(),_={},F;return{stream:D.pipeThrough(new TransformStream({transform:(G,U)=>{if(G.type==="text-start"){F=G;return}if(G.type==="text-end"&&F)U.enqueue(F),F=void 0;if(G.type!=="text-delta"){U.enqueue(G);return}if(_[G.id]==null)_[G.id]={isFirstReasoning:!0,isFirstText:!0,afterSwitch:!1,isReasoning:B,buffer:"",idCounter:0,textId:G.id};let X=_[G.id];X.buffer+=G.delta;function H(K){if(K.length>0){let Z=X.afterSwitch&&(X.isReasoning?!X.isFirstReasoning:!X.isFirstText)?Q:"";if(X.isReasoning&&(X.afterSwitch||X.isFirstReasoning))U.enqueue({type:"reasoning-start",id:`reasoning-${X.idCounter}`});if(X.isReasoning)U.enqueue({type:"reasoning-delta",delta:Z+K,id:`reasoning-${X.idCounter}`});else{if(F)U.enqueue(F),F=void 0;U.enqueue({type:"text-delta",delta:Z+K,id:X.textId})}if(X.afterSwitch=!1,X.isReasoning)X.isFirstReasoning=!1;else X.isFirstText=!1}}do{let K=X.isReasoning?C:I,Z=qdB(X.buffer,K);if(Z==null){H(X.buffer),X.buffer="";break}if(H(X.buffer.slice(0,Z)),Z+K.length<=X.buffer.length){if(X.buffer=X.buffer.slice(Z+K.length),X.isReasoning){if(X.isFirstReasoning)U.enqueue({type:"reasoning-start",id:`reasoning-${X.idCounter}`});U.enqueue({type:"reasoning-end",id:`reasoning-${X.idCounter++}`})}X.isReasoning=!X.isReasoning,X.afterSwitch=!0}else{X.buffer=X.buffer.slice(Z);break}}while(!0)}})),...g}}}}var xmB,bmB=(A,Q)=>{for(var B in Q)xmB(A,B,{get:Q[B],enumerable:!0})},hmB="AI_InvalidArgumentError",umB,mmB,cmB,dmB="AI_InvalidStreamPartError",lmB,imB,pmB,nmB="AI_InvalidToolApprovalError",amB,omB,rmB,smB="AI_InvalidToolInputError",tmB,emB,AcB,QcB="AI_ToolCallNotFoundForApprovalError",BcB,IcB,CcB,EcB="AI_MissingToolResultsError",DcB,gcB,_cB,wcB="AI_NoImageGeneratedError",FcB,JcB,GcB,EEQ="AI_NoObjectGeneratedError",DEQ,YcB,gEQ,h2,UcB="AI_NoOutputGeneratedError",XcB,HcB,KcB,$cB="AI_NoSpeechGeneratedError",ZcB,zcB,WcB,qcB="AI_NoTranscriptGeneratedError",NcB,McB,VcB,LcB="AI_NoVideoGeneratedError",RcB,OcB,ycB,fcB="AI_NoSuchToolError",TcB,PcB,kcB,jcB="AI_ToolCallRepairError",ScB,vcB,xcB,bcB="AI_UIMessageStreamError",hcB,ucB,mcB,ccB="AI_InvalidDataContentError",dcB,lcB,icB,pcB="AI_InvalidMessageRoleError",ncB,acB,ocB,rcB="AI_MessageConversionError",scB,tcB,ecB,AdB="AI_RetryError",QdB,BdB,IdB,_EQ,bT,$I,wEQ,EdB,FEQ,DdB,gdB,_dB,JEQ,wdB,FdB,JdB,GdB,YdB,UdB,eV0,XdB,KdB=()=>({name:"text",responseFormat:Promise.resolve({type:"text"}),async parseCompleteOutput({text:A}){return A},async parsePartialOutput({text:A}){return{partial:A}},createElementStreamTransform(){return}}),$dB=({schema:A,name:Q,description:B})=>{let I=Vq(A);return{name:"object",responseFormat:Q1(I.jsonSchema).then((C)=>({type:"json",schema:C,...Q!=null&&{name:Q},...B!=null&&{description:B}})),async parseCompleteOutput({text:C},E){let D=await WG({text:C});if(!D.success)throw new h2({message:"No object generated: could not parse the response.",cause:D.error,text:C,response:E.response,usage:E.usage,finishReason:E.finishReason});let g=await E9({value:D.value,schema:I});if(!g.success)throw new h2({message:"No object generated: response did not match schema.",cause:g.error,text:C,response:E.response,usage:E.usage,finishReason:E.finishReason});return g.value},async parsePartialOutput({text:C}){let E=await Ll(C);switch(E.state){case"failed-parse":case"undefined-input":return;case"repaired-parse":case"successful-parse":return{partial:E.value}}},createElementStreamTransform(){return}}},ZdB=({element:A,name:Q,description:B})=>{let I=Vq(A);return{name:"array",responseFormat:Q1(I.jsonSchema).then((C)=>{let{$schema:E,...D}=C;return{type:"json",schema:{$schema:"http://json-schema.org/draft-07/schema#",type:"object",properties:{elements:{type:"array",items:D}},required:["elements"],additionalProperties:!1},...Q!=null&&{name:Q},...B!=null&&{description:B}}}),async parseCompleteOutput({text:C},E){let D=await WG({text:C});if(!D.success)throw new h2({message:"No object generated: could not parse the response.",cause:D.error,text:C,response:E.response,usage:E.usage,finishReason:E.finishReason});let g=D.value;if(g==null||typeof g!=="object"||!("elements"in g)||!Array.isArray(g.elements))throw new h2({message:"No object generated: response did not match schema.",cause:new p8({value:g,cause:"response must be an object with an elements array"}),text:C,response:E.response,usage:E.usage,finishReason:E.finishReason});for(let _ of g.elements){let F=await E9({value:_,schema:I});if(!F.success)throw new h2({message:"No object generated: response did not match schema.",cause:F.error,text:C,response:E.response,usage:E.usage,finishReason:E.finishReason})}return g.elements},async parsePartialOutput({text:C}){let E=await Ll(C);switch(E.state){case"failed-parse":case"undefined-input":return;case"repaired-parse":case"successful-parse":{let D=E.value;if(D==null||typeof D!=="object"||!("elements"in D)||!Array.isArray(D.elements))return;let g=E.state==="repaired-parse"&&D.elements.length>0?D.elements.slice(0,-1):D.elements,_=[];for(let F of g){let G=await E9({value:F,schema:I});if(G.success)_.push(G.value)}return{partial:_}}}},createElementStreamTransform(){let C=0;return new TransformStream({transform({partialOutput:E},D){if(E!=null)for(;C<E.length;C++)D.enqueue(E[C])}})}}},zdB=({options:A,name:Q,description:B})=>{return{name:"choice",responseFormat:Promise.resolve({type:"json",schema:{$schema:"http://json-schema.org/draft-07/schema#",type:"object",properties:{result:{type:"string",enum:A}},required:["result"],additionalProperties:!1},...Q!=null&&{name:Q},...B!=null&&{description:B}}),async parseCompleteOutput({text:I},C){let E=await WG({text:I});if(!E.success)throw new h2({message:"No object generated: could not parse the response.",cause:E.error,text:I,response:C.response,usage:C.usage,finishReason:C.finishReason});let D=E.value;if(D==null||typeof D!=="object"||!("result"in D)||typeof D.result!=="string"||!A.includes(D.result))throw new h2({message:"No object generated: response did not match schema.",cause:new p8({value:D,cause:"response must be an object that contains a choice value."}),text:I,response:C.response,usage:C.usage,finishReason:C.finishReason});return D.result},async parsePartialOutput({text:I}){let C=await Ll(I);switch(C.state){case"failed-parse":case"undefined-input":return;case"repaired-parse":case"successful-parse":{let E=C.value;if(E==null||typeof E!=="object"||!("result"in E)||typeof E.result!=="string")return;let D=A.filter((g)=>g.startsWith(E.result));if(C.state==="successful-parse")return D.includes(E.result)?{partial:E.result}:void 0;else return D.length===1?{partial:D[0]}:void 0}}},createElementStreamTransform(){return}}},WdB=({name:A,description:Q}={})=>{return{name:"json",responseFormat:Promise.resolve({type:"json",...A!=null&&{name:A},...Q!=null&&{description:Q}}),async parseCompleteOutput({text:B},I){let C=await WG({text:B});if(!C.success)throw new h2({message:"No object generated: could not parse the response.",cause:C.error,text:B,response:I.response,usage:I.usage,finishReason:I.finishReason});return C.value},async parsePartialOutput({text:B}){let I=await Ll(B);switch(I.state){case"failed-parse":case"undefined-input":return;case"repaired-parse":case"successful-parse":return I.value===void 0?void 0:{partial:I.value}}},createElementStreamTransform(){return}}},IL0,EL0,_L0,wL0,GL0,UL0,HL0,YEQ=({model:A,middleware:Q,modelId:B,providerId:I})=>{return[...CdB(Q)].reverse().reduce((C,E)=>{return NdB({model:C,middleware:E,modelId:B,providerId:I})},A)},NdB=({model:A,middleware:{transformParams:Q,wrapGenerate:B,wrapStream:I,overrideProvider:C,overrideModelId:E,overrideSupportedUrls:D},modelId:g,providerId:_})=>{var F,G,U;async function X({params:H,type:K}){return Q?await Q({params:H,type:K,model:A}):H}return{specificationVersion:"v3",provider:(F=_!=null?_:C==null?void 0:C({model:A}))!=null?F:A.provider,modelId:(G=g!=null?g:E==null?void 0:E({model:A}))!=null?G:A.modelId,supportedUrls:(U=D==null?void 0:D({model:A}))!=null?U:A.supportedUrls,async doGenerate(H){let K=await X({params:H,type:"generate"}),Z=async()=>A.doGenerate(K);return B?B({doGenerate:Z,doStream:async()=>A.doStream(K),params:K,model:A}):Z()},async doStream(H){let K=await X({params:H,type:"stream"}),Z=async()=>A.doGenerate(K),W=async()=>A.doStream(K);return I?I({doGenerate:Z,doStream:W,params:K,model:A}):W()}}},MdB="AI_NoSuchProviderError",VdB,LdB,RdB;var UEQ=b(()=>{gB();j0();IB();IB();IB();IB();IB();j0();gB();gB();gB();IB();gB();gB();IB();gB();gB();xmB=Object.defineProperty,umB=`vercel.ai.error.${hmB}`,mmB=Symbol.for(umB);cmB=mmB;lmB=`vercel.ai.error.${dmB}`,imB=Symbol.for(lmB);pmB=imB;amB=`vercel.ai.error.${nmB}`,omB=Symbol.for(amB);rmB=omB;tmB=`vercel.ai.error.${smB}`,emB=Symbol.for(tmB);AcB=emB;BcB=`vercel.ai.error.${QcB}`,IcB=Symbol.for(BcB);CcB=IcB;DcB=`vercel.ai.error.${EcB}`,gcB=Symbol.for(DcB);_cB=gcB;FcB=`vercel.ai.error.${wcB}`,JcB=Symbol.for(FcB);GcB=JcB;DEQ=`vercel.ai.error.${EEQ}`,YcB=Symbol.for(DEQ),h2=class extends uI{constructor({message:A="No object generated.",cause:Q,text:B,response:I,usage:C,finishReason:E}){super({name:EEQ,message:A,cause:Q});this[gEQ]=!0,this.text=B,this.response=I,this.usage=C,this.finishReason=E}static isInstance(A){return uI.hasMarker(A,DEQ)}};gEQ=YcB;XcB=`vercel.ai.error.${UcB}`,HcB=Symbol.for(XcB);KcB=HcB;ZcB=`vercel.ai.error.${$cB}`,zcB=Symbol.for(ZcB);WcB=zcB;NcB=`vercel.ai.error.${qcB}`,McB=Symbol.for(NcB);VcB=McB;RcB=`vercel.ai.error.${LcB}`,OcB=Symbol.for(RcB);ycB=OcB;TcB=`vercel.ai.error.${fcB}`,PcB=Symbol.for(TcB);kcB=PcB;ScB=`vercel.ai.error.${jcB}`,vcB=Symbol.for(ScB);xcB=vcB;hcB=`vercel.ai.error.${bcB}`,ucB=Symbol.for(hcB);mcB=ucB;dcB=`vercel.ai.error.${ccB}`,lcB=Symbol.for(dcB);icB=lcB;ncB=`vercel.ai.error.${pcB}`,acB=Symbol.for(ncB);ocB=acB;scB=`vercel.ai.error.${rcB}`,tcB=Symbol.for(scB);ecB=tcB;QdB=`vercel.ai.error.${AdB}`,BdB=Symbol.for(QdB);IdB=BdB;_EQ=w.union([w.string(),w.instanceof(Uint8Array),w.instanceof(ArrayBuffer),w.custom((A)=>{var Q,B;return(B=(Q=globalThis.Buffer)==null?void 0:Q.isBuffer(A))!=null?B:!1},{message:"Must be a Buffer"})]);bT=w.lazy(()=>w.union([w.null(),w.string(),w.number(),w.boolean(),w.record(w.string(),bT.optional()),w.array(bT)])),$I=w.record(w.string(),w.record(w.string(),bT.optional())),wEQ=w.object({type:w.literal("text"),text:w.string(),providerOptions:$I.optional()}),EdB=w.object({type:w.literal("image"),image:w.union([_EQ,w.instanceof(URL)]),mediaType:w.string().optional(),providerOptions:$I.optional()}),FEQ=w.object({type:w.literal("file"),data:w.union([_EQ,w.instanceof(URL)]),filename:w.string().optional(),mediaType:w.string(),providerOptions:$I.optional()}),DdB=w.object({type:w.literal("reasoning"),text:w.string(),providerOptions:$I.optional()}),gdB=w.object({type:w.literal("tool-call"),toolCallId:w.string(),toolName:w.string(),input:w.unknown(),providerOptions:$I.optional(),providerExecuted:w.boolean().optional()}),_dB=w.discriminatedUnion("type",[w.object({type:w.literal("text"),value:w.string(),providerOptions:$I.optional()}),w.object({type:w.literal("json"),value:bT,providerOptions:$I.optional()}),w.object({type:w.literal("execution-denied"),reason:w.string().optional(),providerOptions:$I.optional()}),w.object({type:w.literal("error-text"),value:w.string(),providerOptions:$I.optional()}),w.object({type:w.literal("error-json"),value:bT,providerOptions:$I.optional()}),w.object({type:w.literal("content"),value:w.array(w.union([w.object({type:w.literal("text"),text:w.string(),providerOptions:$I.optional()}),w.object({type:w.literal("media"),data:w.string(),mediaType:w.string()}),w.object({type:w.literal("file-data"),data:w.string(),mediaType:w.string(),filename:w.string().optional(),providerOptions:$I.optional()}),w.object({type:w.literal("file-url"),url:w.string(),providerOptions:$I.optional()}),w.object({type:w.literal("file-id"),fileId:w.union([w.string(),w.record(w.string(),w.string())]),providerOptions:$I.optional()}),w.object({type:w.literal("image-data"),data:w.string(),mediaType:w.string(),providerOptions:$I.optional()}),w.object({type:w.literal("image-url"),url:w.string(),providerOptions:$I.optional()}),w.object({type:w.literal("image-file-id"),fileId:w.union([w.string(),w.record(w.string(),w.string())]),providerOptions:$I.optional()}),w.object({type:w.literal("custom"),providerOptions:$I.optional()})]))})]),JEQ=w.object({type:w.literal("tool-result"),toolCallId:w.string(),toolName:w.string(),output:_dB,providerOptions:$I.optional()}),wdB=w.object({type:w.literal("tool-approval-request"),approvalId:w.string(),toolCallId:w.string()}),FdB=w.object({type:w.literal("tool-approval-response"),approvalId:w.string(),approved:w.boolean(),reason:w.string().optional()}),JdB=w.object({role:w.literal("system"),content:w.string(),providerOptions:$I.optional()}),GdB=w.object({role:w.literal("user"),content:w.union([w.string(),w.array(w.union([wEQ,EdB,FEQ]))]),providerOptions:$I.optional()}),YdB=w.object({role:w.literal("assistant"),content:w.union([w.string(),w.array(w.union([wEQ,FEQ,DdB,gdB,JEQ,wdB]))]),providerOptions:$I.optional()}),UdB=w.object({role:w.literal("tool"),content:w.array(w.union([JEQ,FdB])),providerOptions:$I.optional()}),eV0=w.union([JdB,GdB,YdB,UdB]),XdB={};bmB(XdB,{array:()=>ZdB,choice:()=>zdB,json:()=>WdB,object:()=>$dB,text:()=>KdB});IL0=C9({prefix:"aitxt",size:24}),EL0=class extends TransformStream{constructor(){super({transform(A,Q){Q.enqueue(`data: ${JSON.stringify(A)}
|
|
1003
1003
|
|
|
1004
1004
|
`)},flush(A){A.enqueue(`data: [DONE]
|
|
@@ -1086,11 +1086,11 @@ Error message: ${l8Q(B)}`,cause:B});this[M8Q]=!0,this.value=Q}static isInstance(
|
|
|
1086
1086
|
`;break;case"id":g=W.includes("\x00")?void 0:W;break;case"retry":/^\d+$/.test(W)?I(parseInt(W,10)):B(new G5A(`Invalid \`retry\` value: "${W}"`,{type:"invalid-retry",value:W,line:q}));break;default:B(new G5A(`Unknown field "${Z.length>20?`${Z.slice(0,20)}…`:Z}"`,{type:"unknown-field",field:Z,value:W,line:q}));break}}function H(){_.length>0&&Q({id:g,event:F||void 0,data:_.endsWith(`
|
|
1087
1087
|
`)?_.slice(0,-1):_}),g=void 0,_="",F=""}function K(Z={}){E&&Z.consume&&U(E),D=!0,g=void 0,_="",F="",E=""}return{feed:G,reset:K}}function NEI(A){let Q=[],B="",I=0;for(;I<A.length;){let C=A.indexOf("\r",I),E=A.indexOf(`
|
|
1088
1088
|
`,I),D=-1;if(C!==-1&&E!==-1?D=Math.min(C,E):C!==-1?C===A.length-1?D=-1:D=C:E!==-1&&(D=E),D===-1){B=A.slice(I);break}else{let g=A.slice(I,D);Q.push(g),I=D+1,A[I-1]==="\r"&&A[I]===`
|
|
1089
|
-
`&&I++}}return[Q,B]}var sCI,tCI,dy0,AEI="https://auth.openai.com/oauth/authorize",j4Q="https://auth.openai.com/oauth/token",U5A="app_EMoamEEZ73f0CkXaXp7hrann",mP=1455,_EI=300,v4Q="https://chat.qwen.ai",JEI,x4Q,X5A="f0304373b74a44d2b584a3fb70ca9e56",GEI="openid profile email model.completion",YEI="urn:ietf:params:oauth:grant-type:device_code",K5A=null,WEI=300,G5A,MEI,VEI=({prefix:A,size:Q=16,alphabet:B="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",separator:I="-"}={})=>{let C=()=>{let E=B.length,D=Array(Q);for(let g=0;g<Q;g++)D[g]=B[Math.random()*E|0];return D.join("")};if(A==null)return C;if(B.includes(I))throw new S2({argument:"separator",message:`The separator "${I}" must not be part of the alphabet "${B}".`});return()=>`${A}${I}${C()}`},ry0,sy0,ty0;var iP=b(()=>{j0();sCI=rCI(import.meta.url),tCI=P4Q.dirname(sCI),dy0=P4Q.join(tCI,"..","data","accounts.json");JEI=`${v4Q}/api/v1/oauth2/device/code`,x4Q=`${v4Q}/api/v1/oauth2/token`;G5A=class G5A extends Error{constructor(A,Q){super(A),this.name="ParseError",this.type=Q.type,this.field=Q.field,this.value=Q.value,this.line=Q.line}};MEI=class MEI extends TransformStream{constructor({onError:A,onRetry:Q,onComment:B}={}){let I;super({start(C){I=qEI({onEvent:(E)=>{C.enqueue(E)},onError(E){A==="terminate"?C.error(E):typeof A=="function"&&A(E)},onRetry:Q,onComment:B})},transform(C){I.feed(C)}})}};ry0=VEI(),sy0=Symbol("Let zodToJsonSchema decide on which parser to use"),ty0=new Set("ABCDEFGHIJKLMNOPQRSTUVXYZabcdefghijklmnopqrstuvxyz0123456789")});import LEI from"assert";var $5A;var Z5A=b(()=>{jT();iP();$5A={id:"github-copilot",name:"GitHub Copilot",source:"built-in",env:[],apiEnv:[],api:"https://api.githubcopilot.com",doc:"https://github.com/settings/copilot/features",models:{"claude-opus-4":{},"grok-code-fast-1":{},"claude-3.5-sonnet":{},"o3-mini":{},"gpt-5-codex":{},"gpt-4o":{},"gpt-4.1":{},"o4-mini":{},"claude-opus-41":{},"gpt-5-mini":{},"claude-3.7-sonnet":{},"gemini-2.5-pro":{},"gemini-3-pro-preview":{},o3:{},"claude-sonnet-4":{},"gpt-5.1-codex":{},"gpt-5.1-codex-mini":{},"gpt-5.1":{},"gpt-5":{},"claude-3.7-sonnet-thought":{},"claude-sonnet-4.5":{},"claude-opus-4-5":{},"gpt-5.2":{}},async createModel(A,Q,B){let I=Q.options?.apiKey;LEI(I,"Failed to get GitHub Copilot token, use /login to login first");let C=JSON.parse(I),E=new cP;if(E.setState(C),E.isTokenExpired())await E.refresh(),C=E.getState(),Q.options={...Q.options,apiKey:JSON.stringify(C)},B.setGlobalConfig("provider.github-copilot.options.apiKey",JSON.stringify(C),!0);let D=C.copilot_token;return D9({baseURL:"https://api.individual.githubcopilot.com",headers:{Authorization:`Bearer ${D}`,"User-Agent":"GitHubCopilotChat/0.26.7","Editor-Version":"vscode/1.99.3","Editor-Plugin-Version":"copilot-chat/0.26.7","Copilot-Integration-Id":"vscode-chat"},apiKey:"",fetch:B.customFetch}).chat(A)}}});var z5A;var W5A=b(()=>{Tw();z5A={id:"openai",source:"built-in",env:["OPENAI_API_KEY"],apiEnv:["OPENAI_API_BASE"],name:"OpenAI",api:"https://api.openai.com/v1",doc:"https://platform.openai.com/docs/models",models:{"gpt-4.1":{apiFormat:"openai"},"gpt-4":{apiFormat:"openai"},"gpt-4o":{apiFormat:"openai"},o3:{apiFormat:"openai"},"o3-mini":{apiFormat:"openai"},"o4-mini":{apiFormat:"openai"},"gpt-5.1":{},"gpt-5.1-codex":{},"gpt-5.1-codex-mini":{},"gpt-5.1-codex-max":{},"gpt-5":{},"gpt-5-mini":{},"gpt-5-codex":{},"gpt-5.2":{},"gpt-5.2-pro":{},"gpt-5.2-codex":{}},apiFormat:"responses"}});var q5A;var N5A=b(()=>{Tw();q5A={id:"google",source:"built-in",env:["GOOGLE_API_KEY","GOOGLE_GENERATIVE_AI_API_KEY"],apiEnv:["GOOGLE_GENERATIVE_AI_API_BASE"],name:"Google",doc:"https://ai.google.dev/gemini-api/docs/pricing",models:{"gemini-2.5-flash":{},"gemini-2.5-flash-preview-09-2025":{},"gemini-2.5-flash-lite":{},"gemini-2.5-pro":{},"gemini-3-pro-preview":{},"gemini-3-flash-preview":{}},apiFormat:"google"}});var M5A;var V5A=b(()=>{M5A={id:"deepseek",source:"built-in",env:["DEEPSEEK_API_KEY"],name:"DeepSeek",api:"https://api.deepseek.com",apiEnv:["DEEPSEEK_API_BASE"],doc:"https://platform.deepseek.com/api-docs/pricing",models:{"deepseek-chat":{},"deepseek-reasoner":{}}}});var L5A;var R5A=b(()=>{L5A={id:"xai",source:"built-in",env:["XAI_API_KEY"],apiEnv:["XAI_BASE_URL"],name:"xAI",api:"https://api.x.ai/v1",doc:"https://xai.com/docs/models",models:{"grok-4-1-fast":{},"grok-4-1-fast-non-reasoning":{reasoning:!1},"grok-4":{},"grok-4-fast":{},"grok-code-fast-1":{}}}});var O5A;var y5A=b(()=>{Tw();O5A={id:"anthropic",source:"built-in",env:["ANTHROPIC_API_KEY"],apiEnv:["ANTHROPIC_API_BASE"],name:"Anthropic",doc:"https://docs.anthropic.com/en/docs/models",models:{"claude-opus-4-20250514":{},"claude-opus-4-1-20250805":{},"claude-sonnet-4-20250514":{},"claude-sonnet-4-5-20250929":{},"claude-3-7-sonnet-20250219":{},"claude-3-7-sonnet-20250219-thinking":{},"claude-3-5-sonnet-20241022":{},"claude-haiku-4-5":{},"claude-opus-4-5":{},"claude-opus-4-6":{}},apiFormat:"anthropic"}});var f5A;var T5A=b(()=>{f5A={id:"aihubmix",source:"built-in",env:["AIHUBMIX_API_KEY"],name:"AIHubMix",api:"https://aihubmix.com/v1",doc:"https://docs.aihubmix.com/",models:{"gemini-2.5-pro":{},"gemini-2.5-flash":{},"gemini-2.5-flash-lite":{},"DeepSeek-R1":{},"DeepSeek-V3":{},"claude-opus-4-20250514":{},"claude-opus-4-1":{},"claude-sonnet-4-20250514":{},"claude-sonnet-4-5":{},"claude-3-7-sonnet-20250219":{},"claude-3-5-sonnet-20241022":{},"gpt-4.1":{},"gpt-4":{},"gpt-4o":{},o3:{},"o3-mini":{},"o4-mini":{},"gpt-5":{},"gpt-5-mini":{},"glm-4.6":{},"kimi-k2-thinking":{},"kimi-k2-turbo-preview":{}}}});var P5A;var k5A=b(()=>{Tw();P5A={id:"openrouter",source:"built-in",env:["OPENROUTER_API_KEY","OPEN_ROUTER_API_KEY"],name:"OpenRouter",api:"https://openrouter.ai/api/v1",doc:"https://openrouter.ai/docs/models",apiFormat:"_openrouter",models:{"anthropic/claude-3.5-sonnet":{apiFormat:"anthropic"},"anthropic/claude-3.7-sonnet":{apiFormat:"anthropic"},"anthropic/claude-sonnet-4":{apiFormat:"anthropic"},"anthropic/claude-sonnet-4.5":{apiFormat:"anthropic"},"anthropic/claude-haiku-4.5":{apiFormat:"anthropic"},"anthropic/claude-opus-4":{apiFormat:"anthropic"},"anthropic/claude-opus-4.1":{apiFormat:"anthropic"},"anthropic/claude-opus-4.5":{apiFormat:"anthropic"},"anthropic/claude-opus-4.6":{apiFormat:"anthropic"},"deepseek/deepseek-r1-0528":{},"deepseek/deepseek-chat-v3-0324":{},"deepseek/deepseek-chat-v3.1":{},"deepseek/deepseek-v3.1-terminus":{},"deepseek/deepseek-v3.2-exp":{},"deepseek/deepseek-v3.2":{},"deepseek/deepseek-v3.2-speciale":{},"openai/gpt-4.1":{},"openai/gpt-4":{},"openai/gpt-4o":{},"openai/o3":{},"openai/o3-pro":{},"openai/o3-mini":{},"openai/o4-mini":{},"openai/gpt-oss-120b":{},"openai/gpt-5.1-codex":{},"openai/gpt-5.1-codex-mini":{},"openai/gpt-5.1-codex-max":{},"openai/gpt-5.1":{},"openai/gpt-5":{},"openai/gpt-5-mini":{},"openai/gpt-5-codex":{},"openai/gpt-5.2":{},"openai/gpt-5.2-pro":{},"openai/gpt-5.2-codex":{},"google/gemini-3-flash-preview":{},"google/gemini-3-pro-preview":{},"moonshotai/kimi-k2":{},"moonshotai/kimi-k2-0905":{},"moonshotai/kimi-k2-thinking":{},"moonshotai/kimi-k2.5":{},"qwen/qwen3-coder":{},"qwen/qwen3-max":{},"x-ai/grok-code-fast-1":{},"x-ai/grok-4":{},"x-ai/grok-4-fast":{},"x-ai/grok-4.1-fast":{},"z-ai/glm-4.5":{},"z-ai/glm-4.5v":{},"z-ai/glm-4.6":{},"z-ai/glm-4.6v":{},"z-ai/glm-4.7":{},"minimax/minimax-m2":{}}}});var b4Q;var h4Q=b(()=>{b4Q={specificationVersion:"v3",transformParams:async({params:A})=>{let Q=[],B=[];for(let I of A.prompt)if(I.role==="system")B.push(I.content);else{if(B.length>0)Q.push({role:"system",content:B.join(`
|
|
1089
|
+
`&&I++}}return[Q,B]}var sCI,tCI,dy0,AEI="https://auth.openai.com/oauth/authorize",j4Q="https://auth.openai.com/oauth/token",U5A="app_EMoamEEZ73f0CkXaXp7hrann",mP=1455,_EI=300,v4Q="https://chat.qwen.ai",JEI,x4Q,X5A="f0304373b74a44d2b584a3fb70ca9e56",GEI="openid profile email model.completion",YEI="urn:ietf:params:oauth:grant-type:device_code",K5A=null,WEI=300,G5A,MEI,VEI=({prefix:A,size:Q=16,alphabet:B="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",separator:I="-"}={})=>{let C=()=>{let E=B.length,D=Array(Q);for(let g=0;g<Q;g++)D[g]=B[Math.random()*E|0];return D.join("")};if(A==null)return C;if(B.includes(I))throw new S2({argument:"separator",message:`The separator "${I}" must not be part of the alphabet "${B}".`});return()=>`${A}${I}${C()}`},ry0,sy0,ty0;var iP=b(()=>{j0();sCI=rCI(import.meta.url),tCI=P4Q.dirname(sCI),dy0=P4Q.join(tCI,"..","data","accounts.json");JEI=`${v4Q}/api/v1/oauth2/device/code`,x4Q=`${v4Q}/api/v1/oauth2/token`;G5A=class G5A extends Error{constructor(A,Q){super(A),this.name="ParseError",this.type=Q.type,this.field=Q.field,this.value=Q.value,this.line=Q.line}};MEI=class MEI extends TransformStream{constructor({onError:A,onRetry:Q,onComment:B}={}){let I;super({start(C){I=qEI({onEvent:(E)=>{C.enqueue(E)},onError(E){A==="terminate"?C.error(E):typeof A=="function"&&A(E)},onRetry:Q,onComment:B})},transform(C){I.feed(C)}})}};ry0=VEI(),sy0=Symbol("Let zodToJsonSchema decide on which parser to use"),ty0=new Set("ABCDEFGHIJKLMNOPQRSTUVXYZabcdefghijklmnopqrstuvxyz0123456789")});import LEI from"assert";var $5A;var Z5A=b(()=>{jT();iP();$5A={id:"github-copilot",name:"GitHub Copilot",source:"built-in",env:[],apiEnv:[],api:"https://api.githubcopilot.com",doc:"https://github.com/settings/copilot/features",models:{"claude-opus-4":{},"grok-code-fast-1":{},"claude-3.5-sonnet":{},"o3-mini":{},"gpt-5-codex":{},"gpt-4o":{},"gpt-4.1":{},"o4-mini":{},"claude-opus-41":{},"gpt-5-mini":{},"claude-3.7-sonnet":{},"gemini-2.5-pro":{},"gemini-3-pro-preview":{},o3:{},"claude-sonnet-4":{},"gpt-5.1-codex":{},"gpt-5.1-codex-mini":{},"gpt-5.1":{},"gpt-5":{},"claude-3.7-sonnet-thought":{},"claude-sonnet-4.5":{},"claude-opus-4-5":{},"gpt-5.2":{}},async createModel(A,Q,B){let I=Q.options?.apiKey;LEI(I,"Failed to get GitHub Copilot token, use /login to login first");let C=JSON.parse(I),E=new cP;if(E.setState(C),E.isTokenExpired())await E.refresh(),C=E.getState(),Q.options={...Q.options,apiKey:JSON.stringify(C)},B.setGlobalConfig("provider.github-copilot.options.apiKey",JSON.stringify(C),!0);let D=C.copilot_token;return D9({baseURL:"https://api.individual.githubcopilot.com",headers:{Authorization:`Bearer ${D}`,"User-Agent":"GitHubCopilotChat/0.26.7","Editor-Version":"vscode/1.99.3","Editor-Plugin-Version":"copilot-chat/0.26.7","Copilot-Integration-Id":"vscode-chat"},apiKey:"",fetch:B.customFetch}).chat(A)}}});var z5A;var W5A=b(()=>{Tw();z5A={id:"openai",source:"built-in",env:["OPENAI_API_KEY"],apiEnv:["OPENAI_API_BASE"],name:"OpenAI",api:"https://api.openai.com/v1",doc:"https://platform.openai.com/docs/models",models:{"gpt-4.1":{apiFormat:"openai"},"gpt-4":{apiFormat:"openai"},"gpt-4o":{apiFormat:"openai"},o3:{apiFormat:"openai"},"o3-mini":{apiFormat:"openai"},"o4-mini":{apiFormat:"openai"},"gpt-5.1":{},"gpt-5.1-codex":{},"gpt-5.1-codex-mini":{},"gpt-5.1-codex-max":{},"gpt-5":{},"gpt-5-mini":{},"gpt-5-codex":{},"gpt-5.2":{},"gpt-5.2-pro":{},"gpt-5.2-codex":{}},apiFormat:"responses"}});var q5A;var N5A=b(()=>{Tw();q5A={id:"google",source:"built-in",env:["GOOGLE_API_KEY","GOOGLE_GENERATIVE_AI_API_KEY"],apiEnv:["GOOGLE_GENERATIVE_AI_API_BASE"],name:"Google",doc:"https://ai.google.dev/gemini-api/docs/pricing",models:{"gemini-2.5-flash":{},"gemini-2.5-flash-preview-09-2025":{},"gemini-2.5-flash-lite":{},"gemini-2.5-pro":{},"gemini-3-pro-preview":{},"gemini-3-flash-preview":{}},apiFormat:"google"}});var M5A;var V5A=b(()=>{M5A={id:"deepseek",source:"built-in",env:["DEEPSEEK_API_KEY"],name:"DeepSeek",api:"https://api.deepseek.com",apiEnv:["DEEPSEEK_API_BASE"],doc:"https://platform.deepseek.com/api-docs/pricing",models:{"deepseek-chat":{},"deepseek-reasoner":{}}}});var L5A;var R5A=b(()=>{L5A={id:"xai",source:"built-in",env:["XAI_API_KEY"],apiEnv:["XAI_BASE_URL"],name:"xAI",api:"https://api.x.ai/v1",doc:"https://xai.com/docs/models",models:{"grok-4-1-fast":{},"grok-4-1-fast-non-reasoning":{reasoning:!1},"grok-4":{},"grok-4-fast":{},"grok-code-fast-1":{}}}});var O5A;var y5A=b(()=>{Tw();O5A={id:"anthropic",source:"built-in",env:["ANTHROPIC_API_KEY"],apiEnv:["ANTHROPIC_API_BASE"],name:"Anthropic",doc:"https://docs.anthropic.com/en/docs/models",models:{"claude-opus-4-20250514":{},"claude-opus-4-1-20250805":{},"claude-sonnet-4-20250514":{},"claude-sonnet-4-5-20250929":{},"claude-3-7-sonnet-20250219":{},"claude-3-7-sonnet-20250219-thinking":{},"claude-3-5-sonnet-20241022":{},"claude-haiku-4-5":{},"claude-opus-4-5":{},"claude-opus-4-6":{}},apiFormat:"anthropic"}});var f5A;var T5A=b(()=>{f5A={id:"aihubmix",source:"built-in",env:["AIHUBMIX_API_KEY"],name:"AIHubMix",api:"https://aihubmix.com/v1",doc:"https://docs.aihubmix.com/",models:{"gemini-2.5-pro":{},"gemini-2.5-flash":{},"gemini-2.5-flash-lite":{},"DeepSeek-R1":{},"DeepSeek-V3":{},"claude-opus-4-20250514":{},"claude-opus-4-1":{},"claude-sonnet-4-20250514":{},"claude-sonnet-4-5":{},"claude-3-7-sonnet-20250219":{},"claude-3-5-sonnet-20241022":{},"gpt-4.1":{},"gpt-4":{},"gpt-4o":{},o3:{},"o3-mini":{},"o4-mini":{},"gpt-5":{},"gpt-5-mini":{},"glm-4.6":{},"kimi-k2-thinking":{},"kimi-k2-turbo-preview":{}}}});var P5A;var k5A=b(()=>{Tw();P5A={id:"openrouter",source:"built-in",env:["OPENROUTER_API_KEY","OPEN_ROUTER_API_KEY"],name:"OpenRouter",api:"https://openrouter.ai/api/v1",doc:"https://openrouter.ai/docs/models",apiFormat:"_openrouter",models:{"anthropic/claude-3.5-sonnet":{apiFormat:"anthropic"},"anthropic/claude-3.7-sonnet":{apiFormat:"anthropic"},"anthropic/claude-sonnet-4":{apiFormat:"anthropic"},"anthropic/claude-sonnet-4.5":{apiFormat:"anthropic"},"anthropic/claude-haiku-4.5":{apiFormat:"anthropic"},"anthropic/claude-opus-4":{apiFormat:"anthropic"},"anthropic/claude-opus-4.1":{apiFormat:"anthropic"},"anthropic/claude-opus-4.5":{apiFormat:"anthropic"},"anthropic/claude-opus-4.6":{apiFormat:"anthropic"},"deepseek/deepseek-r1-0528":{},"deepseek/deepseek-chat-v3-0324":{},"deepseek/deepseek-chat-v3.1":{},"deepseek/deepseek-v3.1-terminus":{},"deepseek/deepseek-v3.2-exp":{},"deepseek/deepseek-v3.2":{},"deepseek/deepseek-v3.2-speciale":{},"openai/gpt-4.1":{},"openai/gpt-4":{},"openai/gpt-4o":{},"openai/o3":{},"openai/o3-pro":{},"openai/o3-mini":{},"openai/o4-mini":{},"openai/gpt-oss-120b":{},"openai/gpt-5.1-codex":{},"openai/gpt-5.1-codex-mini":{},"openai/gpt-5.1-codex-max":{},"openai/gpt-5.1":{},"openai/gpt-5":{},"openai/gpt-5-mini":{},"openai/gpt-5-codex":{},"openai/gpt-5.2":{},"openai/gpt-5.2-pro":{},"openai/gpt-5.2-codex":{},"google/gemini-3-flash-preview":{},"google/gemini-3-pro-preview":{},"moonshotai/kimi-k2":{},"moonshotai/kimi-k2-0905":{},"moonshotai/kimi-k2-thinking":{},"moonshotai/kimi-k2.5":{},"qwen/qwen3-coder":{},"qwen/qwen3-max":{},"x-ai/grok-code-fast-1":{},"x-ai/grok-4":{},"x-ai/grok-4-fast":{},"x-ai/grok-4.1-fast":{},"z-ai/glm-4.5":{},"z-ai/glm-4.5v":{},"z-ai/glm-4.6":{},"z-ai/glm-4.6v":{},"z-ai/glm-4.7":{},"z-ai/glm-5":{},"minimax/minimax-m2":{}}}});var b4Q;var h4Q=b(()=>{b4Q={specificationVersion:"v3",transformParams:async({params:A})=>{let Q=[],B=[];for(let I of A.prompt)if(I.role==="system")B.push(I.content);else{if(B.length>0)Q.push({role:"system",content:B.join(`
|
|
1090
1090
|
|
|
1091
1091
|
`)}),B=[];Q.push(I)}if(B.length>0)Q.push({role:"system",content:B.join(`
|
|
1092
1092
|
|
|
1093
|
-
`)});return{...A,prompt:Q}}}});import REI from"node:crypto";function OEI(A,Q,B,I){if(!I)return"";let C=`${A}:${Q}:${B}`;return REI.createHmac("sha256",I).update(C).digest("hex")}var u4Q="iFlow-Cli",pP;var j5A=b(()=>{$p();h4Q();pP={id:"iflow",source:"built-in",env:["IFLOW_API_KEY"],name:"iFlow",api:"https://apis.iflow.cn/v1/",doc:"https://iflow.cn/",models:{"qwen3-coder-plus":{},"kimi-k2":{},"kimi-k2-0905":{},"deepseek-v3":{},"deepseek-v3.2":{},"deepseek-r1":{},"glm-4.6":{},"glm-4.7":{},"minimax-m2.1":{},"qwen3-max":{},"kimi-k2.5":{}},createModel(A,Q,B){let I=Kp(pP),C=B.customFetch??fetch;return uP(A,pP,{...B,customFetch:async(D,g)=>{let _=new Headers(g?.headers);_.set("user-agent",u4Q);let F=`session-${TE()}`,G=Date.now();_.set("session-id",F),_.set("x-iflow-timestamp",String(G));let U=OEI(u4Q,F,G,I);if(U)_.set("x-iflow-signature",U);return C(D,{...g,headers:Object.fromEntries(_.entries())})}})},middlewares:[b4Q],interleaved:{tagName:"think"}}});var S5A;var v5A=b(()=>{Tw();S5A={id:"moonshotai",source:"built-in",env:["MOONSHOT_API_KEY"],name:"Moonshot",api:"https://api.moonshot.ai/anthropic/v1",doc:"https://platform.moonshot.ai/docs/api/chat",models:{"kimi-k2-0905-preview":{},"kimi-k2-turbo-preview":{},"kimi-k2-thinking":{},"kimi-k2-thinking-turbo":{},"kimi-k2.5":{}},apiFormat:"anthropic"}});var x5A;var b5A=b(()=>{Tw();x5A={id:"moonshotai-cn",source:"built-in",env:["MOONSHOT_API_KEY"],name:"MoonshotCN",api:"https://api.moonshot.cn/anthropic/v1",doc:"https://platform.moonshot.cn/docs/api/chat",models:{"kimi-k2-0905-preview":{},"kimi-k2-turbo-preview":{},"kimi-k2-thinking":{},"kimi-k2-thinking-turbo":{},"kimi-k2.5":{}},apiFormat:"anthropic"}});var h5A;var u5A=b(()=>{h5A={id:"groq",source:"built-in",env:["GROQ_API_KEY"],name:"Groq",api:"https://api.groq.com/openai/v1",doc:"https://console.groq.com/docs/models",models:{"openai/gpt-oss-120b":{},"moonshotai/kimi-k2-instruct-0905":{}}}});var m5A;var c5A=b(()=>{m5A={id:"siliconflow",source:"built-in",env:["SILICONFLOW_API_KEY"],name:"SiliconFlow",api:"https://api.siliconflow.com/v1",doc:"https://docs.siliconflow.com",models:{"Qwen/Qwen3-235B-A22B-Instruct-2507":{},"Qwen/Qwen3-Coder-480B-A35B-Instruct":{},"moonshotai/Kimi-K2-Instruct-0905":{},"moonshotai/Kimi-K2-Instruct":{},"deepseek-ai/DeepSeek-R1":{},"deepseek-ai/DeepSeek-V3.1":{},"deepseek-ai/DeepSeek-V3":{},"zai-org/GLM-4.5":{}}}});var d5A;var l5A=b(()=>{d5A={id:"siliconflow-cn",source:"built-in",env:["SILICONFLOW_API_KEY"],name:"SiliconFlow CN",api:"https://api.siliconflow.cn/v1",doc:"https://docs.siliconflow.cn",models:{"Qwen/Qwen3-235B-A22B-Instruct-2507":{},"Qwen/Qwen3-Coder-480B-A35B-Instruct":{},"moonshotai/Kimi-K2-Instruct-0905":{},"moonshotai/Kimi-K2-Instruct":{},"deepseek-ai/DeepSeek-R1":{},"deepseek-ai/DeepSeek-V3.1":{},"deepseek-ai/DeepSeek-V3":{},"zai-org/GLM-4.5":{}}}});var i5A;var p5A=b(()=>{i5A={id:"modelscope",source:"built-in",env:["MODELSCOPE_API_KEY"],name:"ModelScope",api:"https://api-inference.modelscope.cn/v1",doc:"https://modelscope.cn/docs/model-service/API-Inference/intro",models:{"Qwen/Qwen3-Coder-480B-A35B-Instruct":{},"Qwen/Qwen3-235B-A22B-Instruct-2507":{},"ZhipuAI/GLM-4.5":{},"ZhipuAI/GLM-4.5V":{},"ZhipuAI/GLM-4.6":{},"deepseek-ai/DeepSeek-V3.2":{},"deepseek-ai/DeepSeek-V3.2-Speciale":{}}}});var n5A;var a5A=b(()=>{n5A={id:"volcengine",source:"built-in",env:["VOLCENGINE_API_KEY"],name:"VolcEngine",api:"https://ark.cn-beijing.volces.com/api/v3",doc:"https://www.volcengine.com/docs/82379/1330310",models:{"deepseek-v3-1-250821":{},"deepseek-v3-1-terminus":{},"doubao-seed-1-6-250615":{},"kimi-k2-250905":{}}}});var o5A;var r5A=b(()=>{o5A={id:"zai-coding-plan",source:"built-in",env:["ZHIPU_API_KEY"],name:"Z.AI Coding Plan",api:"https://api.z.ai/api/coding/paas/v4",doc:"https://docs.z.ai/devpack/overview",models:{"glm-4.5-flash":{},"glm-4.5":{},"glm-4.5-air":{},"glm-4.5v":{},"glm-4.6":{},"glm-4.6v":{},"glm-4.7":{}}}});var s5A;var t5A=b(()=>{s5A={id:"zhipuai-coding-plan",source:"built-in",env:["ZHIPU_API_KEY"],name:"Zhipu AI Coding Plan",api:"https://open.bigmodel.cn/api/coding/paas/v4",doc:"https://docs.bigmodel.cn/cn/coding-plan/overview",models:{"glm-4.5v":{},"glm-4.5-air":{},"glm-4.5":{},"glm-4.5-flash":{},"glm-4.6":{},"glm-4.6v":{},"glm-4.7":{}}}});var e5A;var A9A=b(()=>{e5A={id:"zhipuai",source:"built-in",env:["ZHIPU_API_KEY"],name:"Zhipu AI",api:"https://open.bigmodel.cn/api/paas/v4",doc:"https://docs.z.ai/guides/overview/pricing",models:{"glm-4.6":{},"glm-4.5v":{},"glm-4.5-air":{},"glm-4.5":{},"glm-4.5-flash":{},"glm-4.6v":{},"glm-4.7":{}}}});var Q9A;var B9A=b(()=>{Tw();Q9A={id:"zenmux",source:"built-in",env:["ZENMUX_API_KEY"],name:"ZenMux",api:"https://zenmux.ai/api/anthropic/v1",doc:"https://docs.zenmux.ai/",models:{"google/gemini-3-flash-preview":{},"google/gemini-3-pro-preview":{},"openai/gpt-5.1":{},"openai/gpt-5.1-codex":{},"openai/gpt-5.1-codex-mini":{},"openai/gpt-5.2":{},"openai/gpt-5.2-pro":{},"anthropic/claude-sonnet-4.5":{},"anthropic/claude-opus-4.5":{},"anthropic/claude-opus-4.6":{},"z-ai/glm-4.6":{},"z-ai/glm-4.6v":{},"z-ai/glm-4.7":{},"deepseek/deepseek-chat":{},"deepseek/deepseek-reasoner":{},"moonshotai/kimi-k2.5":{}},headers:{"X-Title":"Neovate Code","HTTP-Referer":"https://neovateai.dev/"},apiFormat:"anthropic"}});var I9A;var C9A=b(()=>{Tw();I9A={id:"minimax",source:"built-in",env:["MINIMAX_API_KEY"],name:"Minimax",api:"https://api.minimaxi.io/anthropic/v1",doc:"https://platform.minimaxi.io/docs/guides/quickstart",models:{"minimax-m2":{},"minimax-m2.1":{}},apiFormat:"anthropic"}});var E9A;var D9A=b(()=>{Tw();E9A={id:"minimax-cn",source:"built-in",env:["MINIMAX_API_KEY"],name:"Minimax CN",api:"https://api.minimaxi.com/anthropic/v1",doc:"https://platform.minimaxi.com/docs/guides/quickstart",models:{"minimax-m2":{},"minimax-m2.1":{}},apiFormat:"anthropic"}});var g9A;var _9A=b(()=>{Tw();g9A={id:"xiaomi",source:"built-in",env:["MIMO_API_KEY"],name:"Xiaomi Mimo",api:"https://api.xiaomimimo.com/anthropic/v1",doc:"https://platform.xiaomimimo.com/",models:{"mimo-v2-flash":{}},apiFormat:"anthropic"}});var w9A;var F9A=b(()=>{w9A={id:"cerebras",source:"built-in",env:["CEREBRAS_API_KEY"],name:"Cerebras",api:"https://api.cerebras.ai/v1",doc:"https://cerebras.ai/docs",models:{"zai-glm-4.7":{limit:{context:64000,output:40000}},"gpt-oss-120b":{limit:{context:65000,output:32000}}},headers:{"X-Cerebras-3rd-Party-Integration":"Neovate Code"}}});var J9A;var G9A=b(()=>{J9A={id:"huggingface",source:"built-in",env:["HUGGINGFACE_API_KEY"],name:"Hugging Face",api:"https://router.huggingface.co/v1",doc:"https://huggingface.co/docs/inference-providers/index",models:{"zai-org/GLM-4.7":{},"XiaomiMiMo/MiMo-V2-Flash":{},"Qwen/Qwen3-Coder-480B-A35B-Instruct":{},"moonshotai/Kimi-K2.5":{}}}});var Y9A;var U9A=b(()=>{Y9A={id:"poe",source:"built-in",env:["POE_API_KEY"],name:"Poe",api:"https://api.poe.com/v1",doc:"https://poe.com",models:{"Claude-Opus-4.5":{},"Claude-Opus-4.6":{limit:{context:983040,output:128000}},"Claude-Sonnet-4.5":{},"Gemini-3-Pro":{},"Gemini-2.5-Pro":{},"Gemini-2.5-Flash":{},"GPT-5.1":{},"GPT-5.1-Codex":{},"Grok-4.1-Fast":{}}}});var X9A;var H9A=b(()=>{X9A={id:"nvidia",source:"built-in",env:["NVIDIA_API_KEY"],name:"NVIDIA",api:"https://integrate.api.nvidia.com/v1/",doc:"https://nvidia.com/",models:{"z-ai/glm4.7":{},"minimaxai/minimax-m2.1":{},"moonshotai/kimi-k2-thinking":{},"moonshotai/kimi-k2.5":{},"openai/gpt-oss-120b":{},"qwen/qwen3-coder-480b-a35b-instruct":{}},interleaved:{}}});var K9A;var $9A=b(()=>{K9A={id:"canopywave",source:"built-in",env:["CANOPYWAVE_API_KEY"],name:"CanopyWave",api:"https://inference.canopywave.io/v1",doc:"https://canopywave.io/",models:{"minimax/minimax-m2.1":{},"zai/glm-4.7":{},"moonshotai/kimi-k2-thinking":{},"moonshotai/kimi-k2.5":{},"deepseek/deepseek-chat-v3.2":{},"openai/gpt-oss-120b":{},"xiaomimimo/mimo-v2-flash":{}}}});var Z9A;var z9A=b(()=>{Tw();Z9A={id:"modelwatch",source:"built-in",env:["MODELWATCH_API_KEY"],name:"ModelWatch",api:"https://hub.modelwatch.dev/v1/",doc:"https://hub.modelwatch.dev/",models:{"qwen3-coder-plus":{apiFormat:"openai"},"glm-4.7":{apiFormat:"openai"},"gemini-2.5-flash":{},"gemini-3-flash":{},"gemini-3-pro-preview":{},"claude-4-5-sonnet":{},"claude-haiku-4-5":{},"claude-opus-4-5":{},"claude-opus-4-6":{},"gpt-5.1":{apiFormat:"responses"},"gpt-5.1-codex-max":{apiFormat:"responses"},"gpt-5.1-codex":{apiFormat:"responses"},"gpt-5.1-codex-mini":{apiFormat:"responses"},"gpt-5.2":{apiFormat:"responses"},"gpt-5.2-codex":{apiFormat:"responses"}},apiFormat:"anthropic"}});var yEI;var m4Q=b(()=>{Tw();yEI={id:"opencode",source:"built-in",env:["OPENCODE_API_KEY"],name:"OpenCode Zen",api:"https://opencode.ai/zen/v1",doc:"https://opencode.ai/docs/zen",models:{"glm-4.7":{},"glm-4.7-free":{},"glm-4.6":{},"qwen3-coder":{},"claude-4.1-opus":{apiFormat:"anthropic"},"kimi-k2":{},"gpt-5.2-codex":{apiFormat:"responses"},"gpt-5.1-codex":{apiFormat:"responses"},"claude-haiku-4-5":{apiFormat:"anthropic"},"claude-opus-4-5":{apiFormat:"anthropic"},"kimi-k2.5":{},"kimi-k2.5-free":{},"gemini-3-pro":{apiFormat:"google"},"claude-4-5-sonnet":{apiFormat:"anthropic"},"gpt-5.1-codex-mini":{apiFormat:"responses"},"kimi-k2-thinking":{},"gpt-5.1":{apiFormat:"responses"},"gpt-5-codex":{apiFormat:"responses"},"gemini-3-flash":{apiFormat:"google"},"gpt-5.1-codex-max":{apiFormat:"responses"},"minimax-m2.1-free":{apiFormat:"anthropic"},"claude-4-sonnet":{apiFormat:"anthropic"},"gpt-5":{apiFormat:"responses"},"minimax-m2.1":{},"gpt-5.2":{apiFormat:"responses"}},apiFormat:"openai"}});import fEI from"assert";var W9A;var q9A=b(()=>{Wl();iP();W9A={id:"qwen",source:"built-in",env:[],name:"Qwen",doc:"https://portal.qwen.ai/",models:{"coder-model":{}},async createModel(A,Q,B){let I=Q.options?.apiKey;fEI(I,"Failed to get Qwen token, use /login to login first");let C=JSON.parse(I),E=new lP;if(E.setState(C),E.isTokenExpired())await E.refresh(),C=E.getState(),Q.options={...Q.options,apiKey:JSON.stringify(C)},B.setGlobalConfig("provider.qwen.options.apiKey",JSON.stringify(C),!0);return Oq({name:"qwen",baseURL:"https://portal.qwen.ai/v1/",headers:{Authorization:`Bearer ${C.access_token}`},fetch:B.customFetch}).chatModel(A)}}});import TEI from"assert";function PEI(A){let Q=A.split(".");if(Q.length!==3)return;try{return JSON.parse(Buffer.from(Q[1],"base64url").toString())}catch{return}}function kEI(A){let Q=PEI(A);if(!Q)return;return Q.chatgpt_account_id||Q["https://api.openai.com/auth"]?.chatgpt_account_id||Q.organizations?.[0]?.id}var N9A;var M9A=b(()=>{jT();iP();N9A={id:"codex",source:"built-in",env:[],name:"Codex",api:"https://chatgpt.com/backend-api/codex",doc:"https://github.com/openai/codex",models:{"gpt-5.1-codex":{},"gpt-5.1-codex-mini":{},"gpt-5.1-codex-max":{},"gpt-5.2":{},"gpt-5.2-codex":{},"gpt-5.3-codex":{}},async createModel(A,Q,B){let I=Q.options?.apiKey;TEI(I,"Failed to get Codex token, use /login to login first");let C=JSON.parse(I),E=new dP;if(E.setState(C),E.isTokenExpired())await E.refresh(),C=E.getState(),Q.options={...Q.options,apiKey:JSON.stringify(C)},B.setGlobalConfig("provider.codex.options.apiKey",JSON.stringify(C),!0);let D="https://chatgpt.com/backend-api/codex/responses",g=kEI(C.access_token),_=B.customFetch??fetch;return D9({apiKey:C.access_token,fetch:async(F,G)=>{let U=new Headers(G?.headers);if(U.delete("authorization"),U.delete("Authorization"),U.set("authorization",`Bearer ${C.access_token}`),g)U.set("ChatGPT-Account-Id",g);let X=new URL(typeof F==="string"?F:F instanceof URL?F.href:F.url),H=X.pathname.includes("/v1/responses")||X.pathname.includes("/chat/completions")?new URL(D):X,K=G;if(G?.body&&H.href===D)try{let Z=JSON.parse(G.body);if(!Z.instructions)Z.instructions=Z.system||"You are a helpful assistant.";Z.store=!1,K={...G,body:JSON.stringify(Z)}}catch{}return _(H,{...K,headers:Object.fromEntries(U.entries())})}})(A)}}});var c4Q;var d4Q=b(()=>{c4Q={id:"kimi-coding-plan",source:"built-in",env:["KIMI_CODING_API_KEY"],name:"Kimi Coding Plan",api:"https://api.kimi.com/coding/v1",doc:"https://www.kimi.com/code/docs/more/third-party-agents.html",models:{"kimi-for-coding":"kimi-k2.5"},headers:{"user-agent":"KimiCLI/1.8.0"}}});var l4Q;var i4Q=b(()=>{Tw();$p();Z5A();W5A();N5A();V5A();R5A();y5A();T5A();k5A();j5A();v5A();b5A();u5A();c5A();l5A();p5A();a5A();r5A();t5A();A9A();B9A();C9A();D9A();_9A();F9A();G9A();U9A();H9A();$9A();z9A();m4Q();q9A();M9A();Z5A();W5A();N5A();V5A();R5A();y5A();T5A();k5A();j5A();v5A();b5A();u5A();c5A();l5A();p5A();a5A();r5A();t5A();A9A();B9A();C9A();D9A();_9A();F9A();G9A();U9A();H9A();$9A();z9A();q9A();M9A();d4Q();l4Q={"github-copilot":$5A,openai:z5A,google:q5A,deepseek:M5A,xai:L5A,anthropic:O5A,aihubmix:f5A,openrouter:P5A,iflow:pP,moonshotai:S5A,"moonshotai-cn":x5A,groq:h5A,siliconflow:m5A,"siliconflow-cn":d5A,modelscope:i5A,volcengine:n5A,"zai-coding-plan":o5A,"zhipuai-coding-plan":s5A,"kimi-coding-plan":c4Q,zhipuai:e5A,zenmux:Q9A,minimax:I9A,"minimax-cn":E9A,xiaomi:g9A,cerebras:w9A,huggingface:J9A,poe:Y9A,nvidia:X9A,canopywave:K9A,modelwatch:Z9A,qwen:W9A,codex:N9A}});import p4Q from"assert";async function jEI(A){return A.apply({hook:"provider",args:[{models:Vl,createOpenAI:D9,createOpenAICompatible:Oq,createAnthropic:kT}],memo:l4Q,type:"seriesLast"})}function SEI(A,Q){let B={...A};for(let[I,C]of Object.entries(Q)){let E=B[I]||{};B[I]=fY(C,E)}return B}function vEI(A,Q,B){let I={},C={};if(typeof Q==="string")I=Vl[Q.toLocaleLowerCase()]||{};else{let D=A.split("/").slice(-1)[0].toLocaleLowerCase().replace(/-free$/,"");I=Vl[D]||{},C={...Q}}let E={...I,...C};if(!E.variants){let D=xEI(E,B);E.variants=D}if(!E.limit)E.limit={context:256000,output:256000};if(!E.name)E.name=A;return E}function xEI(A,Q){if(!A.reasoning)return{};let B=(A.id||"").toLowerCase();if(Q.id==="zenmux"){if(B.includes("kimi")||B.includes("minimax")||B.includes("glm"))return{on:{thinking:{type:"enabled"}}}}if(Q.id==="xiaomi")return{on:{thinking:{type:"enabled"}}};if(B.includes("deepseek")||B.includes("minimax")||B.includes("glm")||B.includes("mistral")||Q.id==="iflow"&&B.includes("kimi")||B.includes("grok"))return{};let I=A.apiFormat||Q.apiFormat,C=["low","medium","high"];if(Q.id==="codex"||I==="responses"){if(B==="gpt-5-pro")return{};let E=(()=>{if(B.includes("codex")){if(B.includes("5.2")||B.includes("5.3"))return[...C,"xhigh"];return C}let D=[...C];if(B.includes("gpt-5-")||B==="gpt-5")D.unshift("minimal");if(A.release_date>="2025-12-04")D.push("xhigh");return D})();return Object.fromEntries(E.map((D)=>[D,{reasoningEffort:D,reasoningSummary:"auto",include:["reasoning.encrypted_content"]}]))}if(I==="openai")return Object.fromEntries(C.map((E)=>[E,{[Q.id]:{reasoningEffort:E}}]));if(I==="anthropic")return{high:{thinking:{type:"enabled",budgetTokens:Math.min(16000,Math.floor(A.limit.output/2-1))}},max:{thinking:{type:"enabled",budgetTokens:Math.min(31999,A.limit.output-1)}}};if(I==="google"){if(B.includes("2.5"))return{high:{thinkingConfig:{includeThoughts:!0,thinkingBudget:16000}},max:{thinkingConfig:{includeThoughts:!0,thinkingBudget:24576}}};return Object.fromEntries(["low","high"].map((E)=>[E,{thinkingConfig:{includeThoughts:!0,thinkingLevel:E}}]))}return{}}function bEI(A){let Q={};for(let[B,I]of Object.entries(A)){let C={...I};if(!C.id)C.id=B;if(!C.name)C.name=B;if(!C.apiFormat&&!C.createModel)C.apiFormat="openai";if(C.models)for(let E in C.models)C.models[E]=vEI(E,C.models[E],C);Q[B]=C}return Q}function hEI(A,Q){return Object.fromEntries(Object.entries(A).map(([B,I])=>{let C=I;if(C.options?.httpProxy)return[B,C];return[B,{...C,options:{...C.options,httpProxy:Q}}]}))}async function xg(A,Q){let B=await jEI(Q),I=Q.config.provider?SEI(B,Q.config.provider):B,C=bEI(I);if(Q.config.httpProxy)C=hEI(C,Q.config.httpProxy);let E=await Q.apply({hook:"modelAlias",args:[],memo:n4Q,type:"seriesLast"}),D=A||Q.config.model,g=null,_=null;try{g=D?await uEI(D,C,E,Q.paths.globalConfigDir,(F,G,U)=>{new aD(Q.cwd,Q.productName,{}).setConfig(U,F,G)}):null}catch(F){_=F}return{providers:C,modelAlias:n4Q,model:g,error:_}}async function uEI(A,Q,B,I,C){let E=B[A];if(E)A=E;let[D,...g]=A.split("/"),_=Q[D];p4Q(_,`Provider ${D} not found, valid providers: ${Object.keys(Q).join(", ")}`);let F=g.join("/"),G=_.models[F];return p4Q(G,`Model ${F} not found in provider ${D}, valid models: ${Object.keys(_.models).join(", ")}`),G.id=F,{provider:_,model:G,_mCreator:async(X)=>{let H=T4Q({provider:_,onRequest:X?.onRequest,onResponse:X?.onResponse}),K=(_.createModel||uP)(F,_,{globalConfigDir:I,setGlobalConfig:C,customFetch:H});if(mEI(K))K=await K;return K}}}function mEI(A){return A instanceof Promise}var n4Q;var H9=b(()=>{L4A();jT();Wl();om();mY();Mw();CEQ();i4Q();$p();n4Q={flash:"google/gemini-2.5-flash",gemini:"google/gemini-3-pro-preview",grok:"xai/grok-4-1-fast",sonnet:"anthropic/claude-sonnet-4-5-20250929",haiku:"anthropic/claude-haiku-4-5",opus:"anthropic/claude-opus-4-5"}});import cEI from"assert";async function K9(A){let Q=[...A.messages||[],{role:"user",content:A.userPrompt,type:"message",timestamp:new Date().toISOString(),uuid:TE(),parentUuid:null}];cEI(A.model||A.context,"model or context is required");let B=A.model||(await xg(null,A.context)).model;return await Al({input:Q,model:B,tools:new nP([]),cwd:"",systemPrompt:A.systemPrompt||"",onMessage:async(I)=>{await A.onMessage?.(I)},autoCompact:!1,thinking:A.thinking!==!1?A.thinking:void 0,responseFormat:A.responseFormat})}var qN=b(()=>{Q4A();H9();tg()});var a4Q={};lI(a4Q,{isEnglish:()=>NN,getLanguageInstruction:()=>$9});function NN(A){let Q=A.toLowerCase().trim();return Q==="english"||Q==="en"||Q==="en-us"||Q==="en-gb"||Q==="en-au"||Q==="en-ca"||Q.startsWith("en-")||Q.startsWith("english")}function $9(A,Q="communicate"){if(NN(A))return"";if(Q==="respond")return`- Respond in ${A}.`;return`**Language:** Please communicate in ${A}.`}function dEI(A){if(typeof A==="string")return`: ${A.length>200?`${A.substring(0,200)}...`:A}`;if(Array.isArray(A)){let Q=A.filter((I)=>I.type==="text").map((I)=>I.text).join(" "),B=Q.length>200?`${Q.substring(0,200)}...`:Q;if(B)return`: ${B}`}return""}function o4Q(A){return A.map((Q)=>{if(Q.role==="assistant"){if(Array.isArray(Q.content)){let B=Q.content.filter((C)=>C.type==="text"||C.type==="reasoning");if(B.length===0)return{...Q,content:[{type:"text",text:"[Assistant performed tool operations]"}]};if(!B.some((C)=>C.type==="text")){let C=B.filter((E)=>E.type==="reasoning").map((E)=>E.text).filter((E)=>E.trim().length>0);if(C.length>0)return{...Q,content:[{type:"text",text:C.join(`
|
|
1093
|
+
`)});return{...A,prompt:Q}}}});import REI from"node:crypto";function OEI(A,Q,B,I){if(!I)return"";let C=`${A}:${Q}:${B}`;return REI.createHmac("sha256",I).update(C).digest("hex")}var u4Q="iFlow-Cli",pP;var j5A=b(()=>{$p();h4Q();pP={id:"iflow",source:"built-in",env:["IFLOW_API_KEY"],name:"iFlow",api:"https://apis.iflow.cn/v1/",doc:"https://iflow.cn/",models:{"qwen3-coder-plus":{},"kimi-k2":{},"kimi-k2-0905":{},"deepseek-v3":{},"deepseek-v3.2":{},"deepseek-r1":{},"glm-4.6":{},"glm-4.7":{},"minimax-m2.1":{},"qwen3-max":{},"kimi-k2.5":{}},createModel(A,Q,B){let I=Kp(pP),C=B.customFetch??fetch;return uP(A,pP,{...B,customFetch:async(D,g)=>{let _=new Headers(g?.headers);_.set("user-agent",u4Q);let F=`session-${TE()}`,G=Date.now();_.set("session-id",F),_.set("x-iflow-timestamp",String(G));let U=OEI(u4Q,F,G,I);if(U)_.set("x-iflow-signature",U);return C(D,{...g,headers:Object.fromEntries(_.entries())})}})},middlewares:[b4Q],interleaved:{tagName:"think"}}});var S5A;var v5A=b(()=>{Tw();S5A={id:"moonshotai",source:"built-in",env:["MOONSHOT_API_KEY"],name:"Moonshot",api:"https://api.moonshot.ai/anthropic/v1",doc:"https://platform.moonshot.ai/docs/api/chat",models:{"kimi-k2-0905-preview":{},"kimi-k2-turbo-preview":{},"kimi-k2-thinking":{},"kimi-k2-thinking-turbo":{},"kimi-k2.5":{}},apiFormat:"anthropic"}});var x5A;var b5A=b(()=>{Tw();x5A={id:"moonshotai-cn",source:"built-in",env:["MOONSHOT_API_KEY"],name:"MoonshotCN",api:"https://api.moonshot.cn/anthropic/v1",doc:"https://platform.moonshot.cn/docs/api/chat",models:{"kimi-k2-0905-preview":{},"kimi-k2-turbo-preview":{},"kimi-k2-thinking":{},"kimi-k2-thinking-turbo":{},"kimi-k2.5":{}},apiFormat:"anthropic"}});var h5A;var u5A=b(()=>{h5A={id:"groq",source:"built-in",env:["GROQ_API_KEY"],name:"Groq",api:"https://api.groq.com/openai/v1",doc:"https://console.groq.com/docs/models",models:{"openai/gpt-oss-120b":{},"moonshotai/kimi-k2-instruct-0905":{}}}});var m5A;var c5A=b(()=>{m5A={id:"siliconflow",source:"built-in",env:["SILICONFLOW_API_KEY"],name:"SiliconFlow",api:"https://api.siliconflow.com/v1",doc:"https://docs.siliconflow.com",models:{"Qwen/Qwen3-235B-A22B-Instruct-2507":{},"Qwen/Qwen3-Coder-480B-A35B-Instruct":{},"moonshotai/Kimi-K2-Instruct-0905":{},"moonshotai/Kimi-K2-Instruct":{},"deepseek-ai/DeepSeek-R1":{},"deepseek-ai/DeepSeek-V3.1":{},"deepseek-ai/DeepSeek-V3":{},"zai-org/GLM-4.5":{}}}});var d5A;var l5A=b(()=>{d5A={id:"siliconflow-cn",source:"built-in",env:["SILICONFLOW_API_KEY"],name:"SiliconFlow CN",api:"https://api.siliconflow.cn/v1",doc:"https://docs.siliconflow.cn",models:{"Qwen/Qwen3-235B-A22B-Instruct-2507":{},"Qwen/Qwen3-Coder-480B-A35B-Instruct":{},"moonshotai/Kimi-K2-Instruct-0905":{},"moonshotai/Kimi-K2-Instruct":{},"deepseek-ai/DeepSeek-R1":{},"deepseek-ai/DeepSeek-V3.1":{},"deepseek-ai/DeepSeek-V3":{},"zai-org/GLM-4.5":{}}}});var i5A;var p5A=b(()=>{i5A={id:"modelscope",source:"built-in",env:["MODELSCOPE_API_KEY"],name:"ModelScope",api:"https://api-inference.modelscope.cn/v1",doc:"https://modelscope.cn/docs/model-service/API-Inference/intro",models:{"Qwen/Qwen3-Coder-480B-A35B-Instruct":{},"Qwen/Qwen3-235B-A22B-Instruct-2507":{},"ZhipuAI/GLM-4.5":{},"ZhipuAI/GLM-4.5V":{},"ZhipuAI/GLM-4.6":{},"deepseek-ai/DeepSeek-V3.2":{},"deepseek-ai/DeepSeek-V3.2-Speciale":{}}}});var n5A;var a5A=b(()=>{n5A={id:"volcengine",source:"built-in",env:["VOLCENGINE_API_KEY"],name:"VolcEngine",api:"https://ark.cn-beijing.volces.com/api/v3",doc:"https://www.volcengine.com/docs/82379/1330310",models:{"deepseek-v3-1-250821":{},"deepseek-v3-1-terminus":{},"doubao-seed-1-6-250615":{},"kimi-k2-250905":{}}}});var o5A;var r5A=b(()=>{o5A={id:"zai-coding-plan",source:"built-in",env:["ZHIPU_API_KEY"],name:"Z.AI Coding Plan",api:"https://api.z.ai/api/coding/paas/v4",doc:"https://docs.z.ai/devpack/overview",models:{"glm-4.5-flash":{},"glm-4.5":{},"glm-4.5-air":{},"glm-4.5v":{},"glm-4.6":{},"glm-4.6v":{},"glm-4.7":{},"glm-5":{}}}});var s5A;var t5A=b(()=>{s5A={id:"zhipuai-coding-plan",source:"built-in",env:["ZHIPU_API_KEY"],name:"Zhipu AI Coding Plan",api:"https://open.bigmodel.cn/api/coding/paas/v4",doc:"https://docs.bigmodel.cn/cn/coding-plan/overview",models:{"glm-4.5v":{},"glm-4.5-air":{},"glm-4.5":{},"glm-4.5-flash":{},"glm-4.6":{},"glm-4.6v":{},"glm-4.7":{},"glm-5":{}}}});var e5A;var A9A=b(()=>{e5A={id:"zhipuai",source:"built-in",env:["ZHIPU_API_KEY"],name:"Zhipu AI",api:"https://open.bigmodel.cn/api/paas/v4",doc:"https://docs.z.ai/guides/overview/pricing",models:{"glm-4.6":{},"glm-4.5v":{},"glm-4.5-air":{},"glm-4.5":{},"glm-4.5-flash":{},"glm-4.6v":{},"glm-4.7":{}}}});var Q9A;var B9A=b(()=>{Tw();Q9A={id:"zenmux",source:"built-in",env:["ZENMUX_API_KEY"],name:"ZenMux",api:"https://zenmux.ai/api/anthropic/v1",doc:"https://docs.zenmux.ai/",models:{"google/gemini-3-flash-preview":{},"google/gemini-3-pro-preview":{},"openai/gpt-5.1":{},"openai/gpt-5.1-codex":{},"openai/gpt-5.1-codex-mini":{},"openai/gpt-5.2":{},"openai/gpt-5.2-pro":{},"anthropic/claude-sonnet-4.5":{},"anthropic/claude-opus-4.5":{},"anthropic/claude-opus-4.6":{},"z-ai/glm-4.6":{},"z-ai/glm-4.6v":{},"z-ai/glm-4.7":{},"z-ai/glm-5":{},"deepseek/deepseek-chat":{},"deepseek/deepseek-reasoner":{},"moonshotai/kimi-k2.5":{}},headers:{"X-Title":"Neovate Code","HTTP-Referer":"https://neovateai.dev/"},apiFormat:"anthropic"}});var I9A;var C9A=b(()=>{Tw();I9A={id:"minimax",source:"built-in",env:["MINIMAX_API_KEY"],name:"Minimax",api:"https://api.minimaxi.io/anthropic/v1",doc:"https://platform.minimaxi.io/docs/guides/quickstart",models:{"minimax-m2":{},"minimax-m2.1":{}},apiFormat:"anthropic"}});var E9A;var D9A=b(()=>{Tw();E9A={id:"minimax-cn",source:"built-in",env:["MINIMAX_API_KEY"],name:"Minimax CN",api:"https://api.minimaxi.com/anthropic/v1",doc:"https://platform.minimaxi.com/docs/guides/quickstart",models:{"minimax-m2":{},"minimax-m2.1":{}},apiFormat:"anthropic"}});var g9A;var _9A=b(()=>{Tw();g9A={id:"xiaomi",source:"built-in",env:["MIMO_API_KEY"],name:"Xiaomi Mimo",api:"https://api.xiaomimimo.com/anthropic/v1",doc:"https://platform.xiaomimimo.com/",models:{"mimo-v2-flash":{}},apiFormat:"anthropic"}});var w9A;var F9A=b(()=>{w9A={id:"cerebras",source:"built-in",env:["CEREBRAS_API_KEY"],name:"Cerebras",api:"https://api.cerebras.ai/v1",doc:"https://cerebras.ai/docs",models:{"zai-glm-4.7":{limit:{context:64000,output:40000}},"gpt-oss-120b":{limit:{context:65000,output:32000}}},headers:{"X-Cerebras-3rd-Party-Integration":"Neovate Code"}}});var J9A;var G9A=b(()=>{J9A={id:"huggingface",source:"built-in",env:["HUGGINGFACE_API_KEY"],name:"Hugging Face",api:"https://router.huggingface.co/v1",doc:"https://huggingface.co/docs/inference-providers/index",models:{"zai-org/GLM-4.7":{},"XiaomiMiMo/MiMo-V2-Flash":{},"Qwen/Qwen3-Coder-480B-A35B-Instruct":{},"moonshotai/Kimi-K2.5":{}}}});var Y9A;var U9A=b(()=>{Y9A={id:"poe",source:"built-in",env:["POE_API_KEY"],name:"Poe",api:"https://api.poe.com/v1",doc:"https://poe.com",models:{"Claude-Opus-4.5":{},"Claude-Opus-4.6":{limit:{context:983040,output:128000}},"Claude-Sonnet-4.5":{},"Gemini-3-Pro":{},"Gemini-2.5-Pro":{},"Gemini-2.5-Flash":{},"GPT-5.1":{},"GPT-5.1-Codex":{},"Grok-4.1-Fast":{}}}});var X9A;var H9A=b(()=>{X9A={id:"nvidia",source:"built-in",env:["NVIDIA_API_KEY"],name:"NVIDIA",api:"https://integrate.api.nvidia.com/v1/",doc:"https://nvidia.com/",models:{"z-ai/glm4.7":{},"minimaxai/minimax-m2.1":{},"moonshotai/kimi-k2-thinking":{},"moonshotai/kimi-k2.5":{},"openai/gpt-oss-120b":{},"qwen/qwen3-coder-480b-a35b-instruct":{}},interleaved:{}}});var K9A;var $9A=b(()=>{K9A={id:"canopywave",source:"built-in",env:["CANOPYWAVE_API_KEY"],name:"CanopyWave",api:"https://inference.canopywave.io/v1",doc:"https://canopywave.io/",models:{"minimax/minimax-m2.1":{},"zai/glm-4.7":{},"moonshotai/kimi-k2-thinking":{},"moonshotai/kimi-k2.5":{},"deepseek/deepseek-chat-v3.2":{},"openai/gpt-oss-120b":{},"xiaomimimo/mimo-v2-flash":{}}}});var Z9A;var z9A=b(()=>{Tw();Z9A={id:"modelwatch",source:"built-in",env:["MODELWATCH_API_KEY"],name:"ModelWatch",api:"https://hub.modelwatch.dev/v1/",doc:"https://hub.modelwatch.dev/",models:{"qwen3-coder-plus":{apiFormat:"openai"},"glm-4.7":{apiFormat:"openai"},"gemini-2.5-flash":{},"gemini-3-flash":{},"gemini-3-pro-preview":{},"claude-4-5-sonnet":{},"claude-haiku-4-5":{},"claude-opus-4-5":{},"claude-opus-4-6":{},"gpt-5.1":{apiFormat:"responses"},"gpt-5.1-codex-max":{apiFormat:"responses"},"gpt-5.1-codex":{apiFormat:"responses"},"gpt-5.1-codex-mini":{apiFormat:"responses"},"gpt-5.2":{apiFormat:"responses"},"gpt-5.2-codex":{apiFormat:"responses"}},apiFormat:"anthropic"}});var yEI;var m4Q=b(()=>{Tw();yEI={id:"opencode",source:"built-in",env:["OPENCODE_API_KEY"],name:"OpenCode Zen",api:"https://opencode.ai/zen/v1",doc:"https://opencode.ai/docs/zen",models:{"glm-4.7":{},"glm-4.7-free":{},"glm-4.6":{},"qwen3-coder":{},"claude-4.1-opus":{apiFormat:"anthropic"},"kimi-k2":{},"gpt-5.2-codex":{apiFormat:"responses"},"gpt-5.1-codex":{apiFormat:"responses"},"claude-haiku-4-5":{apiFormat:"anthropic"},"claude-opus-4-5":{apiFormat:"anthropic"},"kimi-k2.5":{},"kimi-k2.5-free":{},"gemini-3-pro":{apiFormat:"google"},"claude-4-5-sonnet":{apiFormat:"anthropic"},"gpt-5.1-codex-mini":{apiFormat:"responses"},"kimi-k2-thinking":{},"gpt-5.1":{apiFormat:"responses"},"gpt-5-codex":{apiFormat:"responses"},"gemini-3-flash":{apiFormat:"google"},"gpt-5.1-codex-max":{apiFormat:"responses"},"minimax-m2.1-free":{apiFormat:"anthropic"},"claude-4-sonnet":{apiFormat:"anthropic"},"gpt-5":{apiFormat:"responses"},"minimax-m2.1":{},"gpt-5.2":{apiFormat:"responses"}},apiFormat:"openai"}});import fEI from"assert";var W9A;var q9A=b(()=>{Wl();iP();W9A={id:"qwen",source:"built-in",env:[],name:"Qwen",doc:"https://portal.qwen.ai/",models:{"coder-model":{}},async createModel(A,Q,B){let I=Q.options?.apiKey;fEI(I,"Failed to get Qwen token, use /login to login first");let C=JSON.parse(I),E=new lP;if(E.setState(C),E.isTokenExpired())await E.refresh(),C=E.getState(),Q.options={...Q.options,apiKey:JSON.stringify(C)},B.setGlobalConfig("provider.qwen.options.apiKey",JSON.stringify(C),!0);return Oq({name:"qwen",baseURL:"https://portal.qwen.ai/v1/",headers:{Authorization:`Bearer ${C.access_token}`},fetch:B.customFetch}).chatModel(A)}}});import TEI from"assert";function PEI(A){let Q=A.split(".");if(Q.length!==3)return;try{return JSON.parse(Buffer.from(Q[1],"base64url").toString())}catch{return}}function kEI(A){let Q=PEI(A);if(!Q)return;return Q.chatgpt_account_id||Q["https://api.openai.com/auth"]?.chatgpt_account_id||Q.organizations?.[0]?.id}var N9A;var M9A=b(()=>{jT();iP();N9A={id:"codex",source:"built-in",env:[],name:"Codex",api:"https://chatgpt.com/backend-api/codex",doc:"https://github.com/openai/codex",models:{"gpt-5.1-codex":{},"gpt-5.1-codex-mini":{},"gpt-5.1-codex-max":{},"gpt-5.2":{},"gpt-5.2-codex":{},"gpt-5.3-codex":{}},async createModel(A,Q,B){let I=Q.options?.apiKey;TEI(I,"Failed to get Codex token, use /login to login first");let C=JSON.parse(I),E=new dP;if(E.setState(C),E.isTokenExpired())await E.refresh(),C=E.getState(),Q.options={...Q.options,apiKey:JSON.stringify(C)},B.setGlobalConfig("provider.codex.options.apiKey",JSON.stringify(C),!0);let D="https://chatgpt.com/backend-api/codex/responses",g=kEI(C.access_token),_=B.customFetch??fetch;return D9({apiKey:C.access_token,fetch:async(F,G)=>{let U=new Headers(G?.headers);if(U.delete("authorization"),U.delete("Authorization"),U.set("authorization",`Bearer ${C.access_token}`),g)U.set("ChatGPT-Account-Id",g);let X=new URL(typeof F==="string"?F:F instanceof URL?F.href:F.url),H=X.pathname.includes("/v1/responses")||X.pathname.includes("/chat/completions")?new URL(D):X,K=G;if(G?.body&&H.href===D)try{let Z=JSON.parse(G.body);if(!Z.instructions)Z.instructions=Z.system||"You are a helpful assistant.";Z.store=!1,K={...G,body:JSON.stringify(Z)}}catch{}return _(H,{...K,headers:Object.fromEntries(U.entries())})}})(A)}}});var c4Q;var d4Q=b(()=>{c4Q={id:"kimi-coding-plan",source:"built-in",env:["KIMI_CODING_API_KEY"],name:"Kimi Coding Plan",api:"https://api.kimi.com/coding/v1",doc:"https://www.kimi.com/code/docs/more/third-party-agents.html",models:{"kimi-for-coding":"kimi-k2.5"},headers:{"user-agent":"KimiCLI/1.8.0"}}});var l4Q;var i4Q=b(()=>{Tw();$p();Z5A();W5A();N5A();V5A();R5A();y5A();T5A();k5A();j5A();v5A();b5A();u5A();c5A();l5A();p5A();a5A();r5A();t5A();A9A();B9A();C9A();D9A();_9A();F9A();G9A();U9A();H9A();$9A();z9A();m4Q();q9A();M9A();Z5A();W5A();N5A();V5A();R5A();y5A();T5A();k5A();j5A();v5A();b5A();u5A();c5A();l5A();p5A();a5A();r5A();t5A();A9A();B9A();C9A();D9A();_9A();F9A();G9A();U9A();H9A();$9A();z9A();q9A();M9A();d4Q();l4Q={"github-copilot":$5A,openai:z5A,google:q5A,deepseek:M5A,xai:L5A,anthropic:O5A,aihubmix:f5A,openrouter:P5A,iflow:pP,moonshotai:S5A,"moonshotai-cn":x5A,groq:h5A,siliconflow:m5A,"siliconflow-cn":d5A,modelscope:i5A,volcengine:n5A,"zai-coding-plan":o5A,"zhipuai-coding-plan":s5A,"kimi-coding-plan":c4Q,zhipuai:e5A,zenmux:Q9A,minimax:I9A,"minimax-cn":E9A,xiaomi:g9A,cerebras:w9A,huggingface:J9A,poe:Y9A,nvidia:X9A,canopywave:K9A,modelwatch:Z9A,qwen:W9A,codex:N9A}});import p4Q from"assert";async function jEI(A){return A.apply({hook:"provider",args:[{models:Vl,createOpenAI:D9,createOpenAICompatible:Oq,createAnthropic:kT}],memo:l4Q,type:"seriesLast"})}function SEI(A,Q){let B={...A};for(let[I,C]of Object.entries(Q)){let E=B[I]||{};B[I]=fY(C,E)}return B}function vEI(A,Q,B){let I={},C={};if(typeof Q==="string")I=Vl[Q.toLocaleLowerCase()]||{};else{let D=A.split("/").slice(-1)[0].toLocaleLowerCase().replace(/-free$/,"");I=Vl[D]||{},C={...Q}}let E={...I,...C};if(!E.variants){let D=xEI(E,B);E.variants=D}if(!E.limit)E.limit={context:256000,output:256000};if(!E.name)E.name=A;return E}function xEI(A,Q){if(!A.reasoning)return{};let B=(A.id||"").toLowerCase();if(Q.id==="zenmux"){if(B.includes("kimi")||B.includes("minimax")||B.includes("glm"))return{on:{thinking:{type:"enabled"}}}}if(Q.id==="xiaomi")return{on:{thinking:{type:"enabled"}}};if(B.includes("deepseek")||B.includes("minimax")||B.includes("glm")||B.includes("mistral")||Q.id==="iflow"&&B.includes("kimi")||B.includes("grok"))return{};let I=A.apiFormat||Q.apiFormat,C=["low","medium","high"];if(Q.id==="codex"||I==="responses"){if(B==="gpt-5-pro")return{};let E=(()=>{if(B.includes("codex")){if(B.includes("5.2")||B.includes("5.3"))return[...C,"xhigh"];return C}let D=[...C];if(B.includes("gpt-5-")||B==="gpt-5")D.unshift("minimal");if(A.release_date>="2025-12-04")D.push("xhigh");return D})();return Object.fromEntries(E.map((D)=>[D,{reasoningEffort:D,reasoningSummary:"auto",include:["reasoning.encrypted_content"]}]))}if(I==="openai")return Object.fromEntries(C.map((E)=>[E,{[Q.id]:{reasoningEffort:E}}]));if(I==="anthropic")return{high:{thinking:{type:"enabled",budgetTokens:Math.min(16000,Math.floor(A.limit.output/2-1))}},max:{thinking:{type:"enabled",budgetTokens:Math.min(31999,A.limit.output-1)}}};if(I==="google"){if(B.includes("2.5"))return{high:{thinkingConfig:{includeThoughts:!0,thinkingBudget:16000}},max:{thinkingConfig:{includeThoughts:!0,thinkingBudget:24576}}};return Object.fromEntries(["low","high"].map((E)=>[E,{thinkingConfig:{includeThoughts:!0,thinkingLevel:E}}]))}return{}}function bEI(A){let Q={};for(let[B,I]of Object.entries(A)){let C={...I};if(!C.id)C.id=B;if(!C.name)C.name=B;if(!C.apiFormat&&!C.createModel)C.apiFormat="openai";if(C.models)for(let E in C.models)C.models[E]=vEI(E,C.models[E],C);Q[B]=C}return Q}function hEI(A,Q){return Object.fromEntries(Object.entries(A).map(([B,I])=>{let C=I;if(C.options?.httpProxy)return[B,C];return[B,{...C,options:{...C.options,httpProxy:Q}}]}))}async function xg(A,Q){let B=await jEI(Q),I=Q.config.provider?SEI(B,Q.config.provider):B,C=bEI(I);if(Q.config.httpProxy)C=hEI(C,Q.config.httpProxy);let E=await Q.apply({hook:"modelAlias",args:[],memo:n4Q,type:"seriesLast"}),D=A||Q.config.model,g=null,_=null;try{g=D?await uEI(D,C,E,Q.paths.globalConfigDir,(F,G,U)=>{new aD(Q.cwd,Q.productName,{}).setConfig(U,F,G)}):null}catch(F){_=F}return{providers:C,modelAlias:n4Q,model:g,error:_}}async function uEI(A,Q,B,I,C){let E=B[A];if(E)A=E;let[D,...g]=A.split("/"),_=Q[D];p4Q(_,`Provider ${D} not found, valid providers: ${Object.keys(Q).join(", ")}`);let F=g.join("/"),G=_.models[F];return p4Q(G,`Model ${F} not found in provider ${D}, valid models: ${Object.keys(_.models).join(", ")}`),G.id=F,{provider:_,model:G,_mCreator:async(X)=>{let H=T4Q({provider:_,onRequest:X?.onRequest,onResponse:X?.onResponse}),K=(_.createModel||uP)(F,_,{globalConfigDir:I,setGlobalConfig:C,customFetch:H});if(mEI(K))K=await K;return K}}}function mEI(A){return A instanceof Promise}var n4Q;var H9=b(()=>{L4A();jT();Wl();om();mY();Mw();CEQ();i4Q();$p();n4Q={flash:"google/gemini-2.5-flash",gemini:"google/gemini-3-pro-preview",grok:"xai/grok-4-1-fast",sonnet:"anthropic/claude-sonnet-4-5-20250929",haiku:"anthropic/claude-haiku-4-5",opus:"anthropic/claude-opus-4-5"}});import cEI from"assert";async function K9(A){let Q=[...A.messages||[],{role:"user",content:A.userPrompt,type:"message",timestamp:new Date().toISOString(),uuid:TE(),parentUuid:null}];cEI(A.model||A.context,"model or context is required");let B=A.model||(await xg(null,A.context)).model;return await Al({input:Q,model:B,tools:new nP([]),cwd:"",systemPrompt:A.systemPrompt||"",onMessage:async(I)=>{await A.onMessage?.(I)},autoCompact:!1,thinking:A.thinking!==!1?A.thinking:void 0,responseFormat:A.responseFormat})}var qN=b(()=>{Q4A();H9();tg()});var a4Q={};lI(a4Q,{isEnglish:()=>NN,getLanguageInstruction:()=>$9});function NN(A){let Q=A.toLowerCase().trim();return Q==="english"||Q==="en"||Q==="en-us"||Q==="en-gb"||Q==="en-au"||Q==="en-ca"||Q.startsWith("en-")||Q.startsWith("english")}function $9(A,Q="communicate"){if(NN(A))return"";if(Q==="respond")return`- Respond in ${A}.`;return`**Language:** Please communicate in ${A}.`}function dEI(A){if(typeof A==="string")return`: ${A.length>200?`${A.substring(0,200)}...`:A}`;if(Array.isArray(A)){let Q=A.filter((I)=>I.type==="text").map((I)=>I.text).join(" "),B=Q.length>200?`${Q.substring(0,200)}...`:Q;if(B)return`: ${B}`}return""}function o4Q(A){return A.map((Q)=>{if(Q.role==="assistant"){if(Array.isArray(Q.content)){let B=Q.content.filter((C)=>C.type==="text"||C.type==="reasoning");if(B.length===0)return{...Q,content:[{type:"text",text:"[Assistant performed tool operations]"}]};if(!B.some((C)=>C.type==="text")){let C=B.filter((E)=>E.type==="reasoning").map((E)=>E.text).filter((E)=>E.trim().length>0);if(C.length>0)return{...Q,content:[{type:"text",text:C.join(`
|
|
1094
1094
|
`)}]};return{...Q,content:[{type:"text",text:"[Assistant performed tool operations]"}]}}return{...Q,content:B}}return Q}if(Q.role==="tool"){if(Array.isArray(Q.content)){let B=Q.content.map((I)=>{if(I.type==="tool-result"){let C=I.result,E=`Tool ${I.toolName} executed`;if(C&&typeof C==="object"&&"llmContent"in C){let D=dEI(C.llmContent);E+=D||" successfully"}else E+=" successfully";return E}return"Tool operation completed"});return{...Q,role:"user",content:`[Tool Results Summary: ${B.join("; ")}]`}}return{...Q,role:"user",content:"[Tool operations completed]"}}return Q}).filter((Q)=>{if(typeof Q.content==="string")return Q.content.trim().length>0;if(Array.isArray(Q.content))return Q.content.length>0;return!0})}function lEI(A){if(!A)return V9A;let Q=$9(A,"respond");if(!Q)return V9A;return`${V9A}
|
|
1095
1095
|
|
|
1096
1096
|
${Q}`}async function zp(A){let Q=o4Q(A.messages),B=lEI(A.language),I=await K9({messages:Q,userPrompt:iEI,systemPrompt:B,model:A.model});if(I.success){let C=I.data.text;if(!C||C.trim()==="")throw Error("Failed to compact: received empty summary from model");return C}throw Error(`Failed to compact: ${I.error.message}`)}var Zp="Chat history compacted successfully.",iEI=`
|
|
@@ -5914,7 +5914,7 @@ ${_.trim()}`;if(/\$[1-9]\d*/.test(F))F=OkQ(F,g);else if(F.includes("$ARGUMENTS")
|
|
|
5914
5914
|
|
|
5915
5915
|
Arguments: ${g}`;return[{role:"user",content:F}]}},source:C}}}function ThI(A){return A.startsWith("/")&&A.indexOf("/",1)!==-1}function W$(A){let Q=A.trim(),B=Q.indexOf(" "),I=Q.indexOf(`
|
|
5916
5916
|
`),C;if(B===-1&&I===-1)C=-1;else if(B===-1)C=I;else if(I===-1)C=B;else C=Math.min(B,I);if(C===-1)return{command:Q.slice(1),args:""};return{command:Q.slice(1,C),args:Q.slice(C+1).trim()}}function OkQ(A,Q){let B=Q.split(" "),I=A;for(let C=0;C<B.length;C++){let E=`$${C+1}`,D=new RegExp("\\"+E+"\\b","g");I=I.replace(D,B[C]||"")}return I}function q$(A){let Q=A.trim();if(!Q.startsWith("/"))return!1;if(Q==="/")return!1;if(Q.startsWith("/*"))return!1;let B=Q.match(/^\S+/),I=B?B[0]:"";return I!==""&&!ThI(I)}var nV=b(async()=>{AI();ta();Mw();czA();L6();await RkQ()});function ykQ(A,Q){A.registerHandler("slashCommand.list",async(B)=>{let{cwd:I}=B,C=await Q(I);return{success:!0,data:{slashCommands:(await q7.create(C)).getAll()}}}),A.registerHandler("slashCommand.get",async(B)=>{let{cwd:I,command:C}=B,E=await Q(I);return{success:!0,data:{commandEntry:(await q7.create(E)).get(C)}}}),A.registerHandler("slashCommand.execute",async(B)=>{let{cwd:I,command:C,args:E}=B,D=await Q(I),_=(await q7.create(D)).get(C);if(!_)return{success:!0,data:{messages:[{role:"user",content:[{type:"text",text:`Command ${C} not found`}]}]}};let F=_.command.type;if(F==="local")return{success:!0,data:{messages:[{role:"user",content:[{type:"text",text:await _.command.call(E,D)}]}]}};else if(F==="prompt"){let G=await _.command.getPromptForCommand(E);for(let U of G){if(U.role==="user")U.hidden=!0;if(U.role==="user"&&typeof U.content==="string")U.content=[{type:"text",text:U.content}]}return{success:!0,data:{messages:G}}}else return{success:!0,data:{messages:[{role:"user",content:[{type:"text",text:`Unknown slash command type: ${F}`}]}]}}})}var fkQ=b(async()=>{await nV()});function TkQ(A,Q,B){A.registerHandler("snapshot.trackFile",async(I)=>{let C=await Q(I.cwd),E=C.paths.getSessionLogPath(I.sessionId),D=C.fileHistoryManager.getOrCreate(I.sessionId,E);if(I.isNewFile)D.trackNewFile(I.filePath);else D.trackFile(I.filePath);return{success:!0}}),A.registerHandler("snapshot.create",async(I)=>{let C=await Q(I.cwd),E=C.paths.getSessionLogPath(I.sessionId),D=C.fileHistoryManager.getOrCreate(I.sessionId,E),g=D.createSnapshot(I.messageId);if(!g)return{success:!0,data:{snapshot:null}};if(Object.keys(g.trackedFileBackups).length>0)try{let{JsonlLogger:U}=await Promise.resolve().then(() => (zf(),YAQ)),X=C.paths.getSessionLogPath(I.sessionId),H=new U({filePath:X}),K={messageId:g.messageId,timestamp:g.timestamp.toISOString(),trackedFileBackups:Object.fromEntries(Object.entries(g.trackedFileBackups).map(([Z,W])=>[Z,{backupFileName:W.backupFileName,version:W.version,backupTime:W.backupTime.toISOString()}]))};H.addSnapshot(K)}catch(U){console.error("Failed to persist snapshot to session.jsonl:",U)}return{success:!0,data:{snapshot:D.getSnapshotPreviews().find((U)=>U.messageId===I.messageId)||null}}}),A.registerHandler("snapshot.list",async(I)=>{let C=await Q(I.cwd),E=C.paths.getSessionLogPath(I.sessionId);return{success:!0,data:{snapshots:C.fileHistoryManager.getOrCreate(I.sessionId,E).getSnapshotPreviews()}}}),A.registerHandler("snapshot.has",async(I)=>{let{cwd:C,sessionId:E,messageId:D}=I,g=await Q(C),_=g.paths.getSessionLogPath(E);return{success:!0,data:{hasSnapshot:g.fileHistoryManager.getOrCreate(E,_).hasSnapshot(D)}}}),A.registerHandler("snapshot.rewind",async(I)=>{let C=await Q(I.cwd),E=C.paths.getSessionLogPath(I.sessionId);return{success:!0,data:{result:C.fileHistoryManager.getOrCreate(I.sessionId,E).rewindToMessage(I.messageId)}}}),A.registerHandler("snapshot.previewRewind",async(I)=>{let C=await Q(I.cwd),E=C.paths.getSessionLogPath(I.sessionId),D=C.fileHistoryManager.getOrCreate(I.sessionId,E),g=I.cumulative!==!1;return{success:!0,data:{result:D.previewRewind(I.messageId,g)}}}),A.registerHandler("snapshot.loadFromSession",async(I)=>{let C=await Q(I.cwd),E=Q7.fromSession({cwd:C.cwd,sessionId:I.sessionId,snapshots:I.snapshots,backupRoot:C.paths.fileHistoryDir});return C.fileHistoryManager.set(I.sessionId,E),{success:!0}})}var PkQ=b(()=>{L$A()});function kkQ(A,Q){A.registerHandler("status.get",async(B)=>{let{cwd:I,sessionId:C}=B,E=await Q(I),D={[`${E.productName}`]:{description:`v${E.version}`,items:[E.paths.getSessionLogPath(C)]},"Working Directory":{items:[I]},Model:{items:[E.config.model]}};return{success:!0,data:{status:await E.apply({hook:"status",args:[],memo:D,type:"seriesMerge"})}}})}var jkQ=b(()=>{Mw()});var vkQ={};lI(vkQ,{getFiles:()=>khI});async function PhI(A,Q){let I=(await(async()=>{let{stdout:C}=await RJ(A,"git",["status","--short"],void 0,void 0,!1);return C})()).split(`
|
|
5917
|
-
`).filter((C)=>C.trim().length>0).filter((C)=>!C.startsWith("D")&&!C.startsWith("??")&&!C.startsWith("R")).map((C)=>C.slice(3)).filter((C)=>!Q||C.toLowerCase().includes(Q.toLowerCase()));return Promise.all(I.map(async(C)=>{let E=MA.join(A,C),D=MA.basename(C);return await SkQ(E,D,"file")}))}async function khI(A){let{cwd:Q,query:B,maxSize:I}=A,C=await PhI(Q,B);if(C.length<I){let E=I-C.length,g=i8(Q,Q,6000).filter((_)=>!B||_.toLowerCase().includes(B.toLowerCase())).slice(0,E).map((_)=>{let F=_.endsWith(MA.sep),G=MA.basename(_)+(F?MA.sep:"");return SkQ(_,G,F?"directory":"file")}).sort((_,F)=>{if(_.type!==F.type)return _.type==="directory"?-1:1;return _.path.localeCompare(F.path)});C=[...C,...g]}return C}function SkQ(A,Q,B){return{path:A,type:B,name:Q}}var xkQ=b(()=>{AI();iHA();S3()});var tzA={};lI(tzA,{warning:()=>bhI,success:()=>vhI,playSound:()=>QL,listSounds:()=>mhI,info:()=>hhI,error:()=>xhI,done:()=>uhI,beep:()=>hkQ,SOUND_PRESETS:()=>AL});import jhI from"fs";import{spawn as ShI}from"child_process";function hkQ(){process.stdout.write("\x07")}async function QL(A,Q=1){if(process.platform!=="darwin"){hkQ();return}let B=`${bkQ}/${A}.aiff`;return new Promise((I,C)=>{let E=["-v",String(Q),B],D=ShI("afplay",E,{stdio:"ignore"});D.on("close",(g)=>{if(g===0)I();else C(Error(`afplay exited with code ${g}`))}),D.on("error",C)})}async function mhI(){if(process.platform!=="darwin")return[];try{return jhI.readdirSync(bkQ).filter((Q)=>Q.endsWith(".aiff")).map((Q)=>Q.replace(".aiff","")).sort()}catch{return[]}}var bkQ="/System/Library/Sounds",AL,vhI=(A)=>QL(AL.success,A),xhI=(A)=>QL(AL.error,A),bhI=(A)=>QL(AL.warning,A),hhI=(A)=>QL(AL.info,A),uhI=(A)=>QL(AL.done,A);var ezA=b(()=>{AL={success:"Glass",error:"Basso",warning:"Funk",info:"Pop",done:"Hero"}});function chI(A,Q){return A.replace(/\{\{(\w+)\}\}/g,(B,I)=>Q[I]??"")}function ukQ(A,Q){A.registerHandler("utils.query",async(B)=>{let{userPrompt:I,cwd:C,systemPrompt:E}=B,D=await Q(C),{model:g}=await xg(B.model||D.config.model||null,D);return await K9({userPrompt:I,context:D,systemPrompt:E,model:g,thinking:B.thinking,responseFormat:B.responseFormat})}),A.registerHandler("utils.quickQuery",async(B)=>{let{cwd:I}=B,C=await Q(I);return await A.messageHandlers.get("utils.query")?.({userPrompt:B.userPrompt,cwd:I,systemPrompt:B.systemPrompt,model:B.model||C.config.smallModel||null,thinking:B.thinking,responseFormat:B.responseFormat})}),A.registerHandler("utils.summarizeMessage",async(B)=>{let{message:I,cwd:C,model:E}=B;return await A.messageHandlers.get("utils.quickQuery")?.({model:E,userPrompt:I,cwd:C,systemPrompt:"Extract a concise 2-5 word title that captures the main topic or intent of this message. Format your response as a JSON object with one field: 'title' (string).",responseFormat:{type:"json",schema:l8.toJSONSchema(l8.object({title:l8.string()}))}})}),A.registerHandler("utils.getPaths",async(B)=>{let{cwd:I,maxFiles:C=6000}=B,E=await Q(I);return{success:!0,data:{paths:i8(E.cwd,E.cwd,C)}}}),A.registerHandler("utils.searchPaths",async(B)=>{let{cwd:I,query:C,maxResults:E=100}=B,D=await Q(I);if(!C){let{listRootDirectory:F}=await Promise.resolve().then(() => (S3(),JIQ));return{success:!0,data:{paths:F(D.cwd),truncated:!1}}}let{searchFiles:g}=await Promise.resolve().then(() => (bHA(),IMQ));return await g(D.cwd,C,E)}),A.registerHandler("utils.telemetry",async(B)=>{let{cwd:I,name:C,payload:E}=B,D=await Q(I),{PluginHookType:g}=await Promise.resolve().then(() => (Mw(),gtA));return await D.apply({hook:"telemetry",args:[{name:C,payload:E}],type:g.Parallel}),{success:!0}}),A.registerHandler("utils.files.list",async(B)=>{let{cwd:I,query:C}=B,{getFiles:E}=await Promise.resolve().then(() => (xkQ(),vkQ));return{success:!0,data:{files:await E({cwd:I,maxSize:50,query:C||""})}}}),A.registerHandler("utils.tool.executeBash",async(B)=>{let{cwd:I,command:C}=B,{createBashTool:E}=await Promise.resolve().then(() => (EUA(),_5Q)),D=await Q(I),g=E({cwd:I,backgroundTaskManager:D.backgroundTaskManager});try{return{success:!0,data:await g.execute({command:C})}}catch(_){return{success:!1,error:{message:_ instanceof Error?_.message:String(_)}}}}),A.registerHandler("utils.open",async(B)=>{let{cwd:I,app:C}=B,{spawn:E}=await import("child_process"),g={cursor:{cmd:"cursor",args:[I]},vscode:{cmd:"code",args:[I]},"vscode-insiders":{cmd:"code-insiders",args:[I]},zed:{cmd:"zed",args:[I]},windsurf:{cmd:"windsurf",args:[I]},antigravity:{cmd:"agy",args:[I]},iterm:{cmd:"open",args:["-a","iTerm",I]},warp:{cmd:"open",args:["-a","Warp",I]},terminal:{cmd:"open",args:["-a","Terminal",I]},finder:{cmd:"open",args:[I]},sourcetree:{cmd:"open",args:["-a","SourceTree",I]},fork:{cmd:"open",args:["-a","Fork",I]}}[C];return E(g.cmd,g.args,{detached:!0,stdio:"ignore"}).unref(),{success:!0}}),A.registerHandler("utils.playSound",async(B)=>{let{sound:I,volume:C=1}=B;try{let{playSound:E,SOUND_PRESETS:D}=await Promise.resolve().then(() => (ezA(),tzA)),g=I in D?D[I]:I;return await E(g,C),{success:!0}}catch(E){return{success:!1,error:E.message||"Failed to play sound"}}}),A.registerHandler("utils.detectApps",async(B)=>{let{apps:I}=B,{existsSync:C}=await import("fs"),{execSync:E}=await import("child_process"),D=["finder","cursor","antigravity","vscode","vscode-insiders","zed","windsurf","iterm","warp","terminal","sourcetree","fork"],g={cursor:"cursor",vscode:"code","vscode-insiders":"code-insiders",zed:"zed",windsurf:"windsurf",antigravity:"agy"},_={iterm:"/Applications/iTerm.app",warp:"/Applications/Warp.app",terminal:"/System/Applications/Utilities/Terminal.app",sourcetree:"/Applications/Sourcetree.app",fork:"/Applications/Fork.app"},F=(X)=>{let H=process.platform==="darwin";if(X==="finder")return H;if(g[X])try{return E(`which ${g[X]}`,{stdio:"ignore"}),!0}catch{return!1}if(_[X])return C(_[X]);return!1};return{success:!0,data:{apps:(I||[...D]).filter(F)}}}),A.registerHandler("utils.notify",async(B)=>{let{cwd:I,config:C}=B;if(C===!1)return{success:!0};if(typeof C==="string"&&/^https?:\/\//.test(C)){let F={cwd:I,name:MA.basename(I)},G=chI(C,F);return fetch(G).catch(()=>{}),{success:!0}}let{playSound:E,beep:D,SOUND_PRESETS:g}=await Promise.resolve().then(() => (ezA(),tzA)),_=typeof C==="string"?C:g.warning;try{await E(_)}catch{D()}return{success:!0}})}var mkQ=b(()=>{AI();rg();H9();qN();S3()});class nw{messageBus;contextCreateOpts;constructor(A){this.messageBus=new t1,this.contextCreateOpts=A.contextCreateOpts,new ckQ(this.messageBus,this.contextCreateOpts)}}class ckQ{messageBus;contextCreateOpts;contexts=new Map;abortControllers=new Map;skillPreviews=new Map;constructor(A,Q){this.messageBus=A,this.contextCreateOpts=Q,this.registerHandlers()}async getContext(A){if(this.contexts.has(A))return this.contexts.get(A);let Q=await MV.create({cwd:A,...this.contextCreateOpts,messageBus:this.messageBus});return Q.mcpManager.initAsync(),this.contexts.set(A,Q),await this.applyPluginHandlers(Q),Q}async applyPluginHandlers(A){let Q=await A.apply({hook:"nodeBridgeHandler",args:[],memo:{},type:"seriesMerge"});for(let[B,I]of Object.entries(Q))this.messageBus.registerHandler(B,async(C)=>{return await I(C,A)})}async clearContext(A){if(A){let Q=this.contexts.get(A);if(Q)await Q.destroy(),this.contexts.delete(A)}else this.contexts.clear()}registerHandlers(){let A=this.getContext.bind(this),Q=this.clearContext.bind(this);OyQ(this.messageBus,A,Q),TyQ(this.messageBus,A),PyQ(this.messageBus,A),jyQ(this.messageBus,A,Q),vyQ(this.messageBus,A),hyQ(this.messageBus,A,Q),fyQ(this.messageBus,A,this.abortControllers),cyQ(this.messageBus,A),ayQ(this.messageBus,A,this.abortControllers),ryQ(this.messageBus,A,this.skillPreviews),ykQ(this.messageBus,A),TkQ(this.messageBus,A,Q),kkQ(this.messageBus,A),ukQ(this.messageBus,A)}}var L7=b(async()=>{O$A();u9();Mw();yyQ();kyQ();SyQ();xyQ();uyQ();m$A();oyQ();syQ();PkQ();jkQ();mkQ();await fkQ()});var UjQ=f(($EC,YjQ)=>{function _WA(A){if(A instanceof Map)A.clear=A.delete=A.set=function(){throw Error("map is read-only")};else if(A instanceof Set)A.add=A.clear=A.delete=function(){throw Error("set is read-only")};return Object.freeze(A),Object.getOwnPropertyNames(A).forEach(function(Q){var B=A[Q];if(typeof B=="object"&&!Object.isFrozen(B))_WA(B)}),A}var CjQ=_WA,thI=_WA;CjQ.default=thI;class DWA{constructor(A){if(A.data===void 0)A.data={};this.data=A.data,this.isMatchIgnored=!1}ignoreMatch(){this.isMatchIgnored=!0}}function BL(A){return A.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function y7(A,...Q){let B=Object.create(null);for(let I in A)B[I]=A[I];return Q.forEach(function(I){for(let C in I)B[C]=I[C]}),B}var ehI="</span>",tkQ=(A)=>{return!!A.kind};class EjQ{constructor(A,Q){this.buffer="",this.classPrefix=Q.classPrefix,A.walk(this)}addText(A){this.buffer+=BL(A)}openNode(A){if(!tkQ(A))return;let Q=A.kind;if(!A.sublanguage)Q=`${this.classPrefix}${Q}`;this.span(Q)}closeNode(A){if(!tkQ(A))return;this.buffer+=ehI}value(){return this.buffer}span(A){this.buffer+=`<span class="${A}">`}}class wWA{constructor(){this.rootNode={children:[]},this.stack=[this.rootNode]}get top(){return this.stack[this.stack.length-1]}get root(){return this.rootNode}add(A){this.top.children.push(A)}openNode(A){let Q={kind:A,children:[]};this.add(Q),this.stack.push(Q)}closeNode(){if(this.stack.length>1)return this.stack.pop();return}closeAllNodes(){while(this.closeNode());}toJSON(){return JSON.stringify(this.rootNode,null,4)}walk(A){return this.constructor._walk(A,this.rootNode)}static _walk(A,Q){if(typeof Q==="string")A.addText(Q);else if(Q.children)A.openNode(Q),Q.children.forEach((B)=>this._walk(A,B)),A.closeNode(Q);return A}static _collapse(A){if(typeof A==="string")return;if(!A.children)return;if(A.children.every((Q)=>typeof Q==="string"))A.children=[A.children.join("")];else A.children.forEach((Q)=>{wWA._collapse(Q)})}}class DjQ extends wWA{constructor(A){super();this.options=A}addKeyword(A,Q){if(A==="")return;this.openNode(Q),this.addText(A),this.closeNode()}addText(A){if(A==="")return;this.add(A)}addSublanguage(A,Q){let B=A.root;B.kind=Q,B.sublanguage=!0,this.add(B)}toHTML(){return new EjQ(this,this.options).value()}finalize(){return!0}}function AuI(A){return new RegExp(A.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&"),"m")}function qS(A){if(!A)return null;if(typeof A==="string")return A;return A.source}function QuI(...A){return A.map((B)=>qS(B)).join("")}function BuI(...A){return"("+A.map((B)=>qS(B)).join("|")+")"}function IuI(A){return new RegExp(A.toString()+"|").exec("").length-1}function CuI(A,Q){let B=A&&A.exec(Q);return B&&B.index===0}var EuI=/\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./;function DuI(A,Q="|"){let B=0;return A.map((I)=>{B+=1;let C=B,E=qS(I),D="";while(E.length>0){let g=EuI.exec(E);if(!g){D+=E;break}if(D+=E.substring(0,g.index),E=E.substring(g.index+g[0].length),g[0][0]==="\\"&&g[1])D+="\\"+String(Number(g[1])+C);else if(D+=g[0],g[0]==="(")B++}return D}).map((I)=>`(${I})`).join(Q)}var guI=/\b\B/,gjQ="[a-zA-Z]\\w*",FWA="[a-zA-Z_]\\w*",JWA="\\b\\d+(\\.\\d+)?",_jQ="(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",wjQ="\\b(0b[01]+)",_uI="!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~",wuI=(A={})=>{let Q=/^#![ ]*\//;if(A.binary)A.begin=QuI(Q,/.*\b/,A.binary,/\b.*/);return y7({className:"meta",begin:Q,end:/$/,relevance:0,"on:begin":(B,I)=>{if(B.index!==0)I.ignoreMatch()}},A)},NS={begin:"\\\\[\\s\\S]",relevance:0},FuI={className:"string",begin:"'",end:"'",illegal:"\\n",contains:[NS]},JuI={className:"string",begin:'"',end:'"',illegal:"\\n",contains:[NS]},FjQ={begin:/\b(a|an|the|are|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|such|will|you|your|they|like|more)\b/},is=function(A,Q,B={}){let I=y7({className:"comment",begin:A,end:Q,contains:[]},B);return I.contains.push(FjQ),I.contains.push({className:"doctag",begin:"(?:TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):",relevance:0}),I},GuI=is("//","$"),YuI=is("/\\*","\\*/"),UuI=is("#","$"),XuI={className:"number",begin:JWA,relevance:0},HuI={className:"number",begin:_jQ,relevance:0},KuI={className:"number",begin:wjQ,relevance:0},$uI={className:"number",begin:JWA+"(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",relevance:0},ZuI={begin:/(?=\/[^/\n]*\/)/,contains:[{className:"regexp",begin:/\//,end:/\/[gimuy]*/,illegal:/\n/,contains:[NS,{begin:/\[/,end:/\]/,relevance:0,contains:[NS]}]}]},zuI={className:"title",begin:gjQ,relevance:0},WuI={className:"title",begin:FWA,relevance:0},quI={begin:"\\.\\s*"+FWA,relevance:0},NuI=function(A){return Object.assign(A,{"on:begin":(Q,B)=>{B.data._beginMatch=Q[1]},"on:end":(Q,B)=>{if(B.data._beginMatch!==Q[1])B.ignoreMatch()}})},ls=Object.freeze({__proto__:null,MATCH_NOTHING_RE:guI,IDENT_RE:gjQ,UNDERSCORE_IDENT_RE:FWA,NUMBER_RE:JWA,C_NUMBER_RE:_jQ,BINARY_NUMBER_RE:wjQ,RE_STARTERS_RE:_uI,SHEBANG:wuI,BACKSLASH_ESCAPE:NS,APOS_STRING_MODE:FuI,QUOTE_STRING_MODE:JuI,PHRASAL_WORDS_MODE:FjQ,COMMENT:is,C_LINE_COMMENT_MODE:GuI,C_BLOCK_COMMENT_MODE:YuI,HASH_COMMENT_MODE:UuI,NUMBER_MODE:XuI,C_NUMBER_MODE:HuI,BINARY_NUMBER_MODE:KuI,CSS_NUMBER_MODE:$uI,REGEXP_MODE:ZuI,TITLE_MODE:zuI,UNDERSCORE_TITLE_MODE:WuI,METHOD_GUARD:quI,END_SAME_AS_BEGIN:NuI});function MuI(A,Q){if(A.input[A.index-1]===".")Q.ignoreMatch()}function VuI(A,Q){if(!Q)return;if(!A.beginKeywords)return;if(A.begin="\\b("+A.beginKeywords.split(" ").join("|")+")(?!\\.)(?=\\b|\\s)",A.__beforeBegin=MuI,A.keywords=A.keywords||A.beginKeywords,delete A.beginKeywords,A.relevance===void 0)A.relevance=0}function LuI(A,Q){if(!Array.isArray(A.illegal))return;A.illegal=BuI(...A.illegal)}function RuI(A,Q){if(!A.match)return;if(A.begin||A.end)throw Error("begin & end are not supported with match");A.begin=A.match,delete A.match}function OuI(A,Q){if(A.relevance===void 0)A.relevance=1}var yuI=["of","and","for","in","not","or","if","then","parent","list","value"],fuI="keyword";function JjQ(A,Q,B=fuI){let I={};if(typeof A==="string")C(B,A.split(" "));else if(Array.isArray(A))C(B,A);else Object.keys(A).forEach(function(E){Object.assign(I,JjQ(A[E],Q,E))});return I;function C(E,D){if(Q)D=D.map((g)=>g.toLowerCase());D.forEach(function(g){let _=g.split("|");I[_[0]]=[E,TuI(_[0],_[1])]})}}function TuI(A,Q){if(Q)return Number(Q);return PuI(A)?0:1}function PuI(A){return yuI.includes(A.toLowerCase())}function kuI(A,{plugins:Q}){function B(g,_){return new RegExp(qS(g),"m"+(A.case_insensitive?"i":"")+(_?"g":""))}class I{constructor(){this.matchIndexes={},this.regexes=[],this.matchAt=1,this.position=0}addRule(g,_){_.position=this.position++,this.matchIndexes[this.matchAt]=_,this.regexes.push([_,g]),this.matchAt+=IuI(g)+1}compile(){if(this.regexes.length===0)this.exec=()=>null;let g=this.regexes.map((_)=>_[1]);this.matcherRe=B(DuI(g),!0),this.lastIndex=0}exec(g){this.matcherRe.lastIndex=this.lastIndex;let _=this.matcherRe.exec(g);if(!_)return null;let F=_.findIndex((U,X)=>X>0&&U!==void 0),G=this.matchIndexes[F];return _.splice(0,F),Object.assign(_,G)}}class C{constructor(){this.rules=[],this.multiRegexes=[],this.count=0,this.lastIndex=0,this.regexIndex=0}getMatcher(g){if(this.multiRegexes[g])return this.multiRegexes[g];let _=new I;return this.rules.slice(g).forEach(([F,G])=>_.addRule(F,G)),_.compile(),this.multiRegexes[g]=_,_}resumingScanAtSamePosition(){return this.regexIndex!==0}considerAll(){this.regexIndex=0}addRule(g,_){if(this.rules.push([g,_]),_.type==="begin")this.count++}exec(g){let _=this.getMatcher(this.regexIndex);_.lastIndex=this.lastIndex;let F=_.exec(g);if(this.resumingScanAtSamePosition())if(F&&F.index===this.lastIndex);else{let G=this.getMatcher(0);G.lastIndex=this.lastIndex+1,F=G.exec(g)}if(F){if(this.regexIndex+=F.position+1,this.regexIndex===this.count)this.considerAll()}return F}}function E(g){let _=new C;if(g.contains.forEach((F)=>_.addRule(F.begin,{rule:F,type:"begin"})),g.terminatorEnd)_.addRule(g.terminatorEnd,{type:"end"});if(g.illegal)_.addRule(g.illegal,{type:"illegal"});return _}function D(g,_){let F=g;if(g.isCompiled)return F;[RuI].forEach((U)=>U(g,_)),A.compilerExtensions.forEach((U)=>U(g,_)),g.__beforeBegin=null,[VuI,LuI,OuI].forEach((U)=>U(g,_)),g.isCompiled=!0;let G=null;if(typeof g.keywords==="object")G=g.keywords.$pattern,delete g.keywords.$pattern;if(g.keywords)g.keywords=JjQ(g.keywords,A.case_insensitive);if(g.lexemes&&G)throw Error("ERR: Prefer `keywords.$pattern` to `mode.lexemes`, BOTH are not allowed. (see mode reference) ");if(G=G||g.lexemes||/\w+/,F.keywordPatternRe=B(G,!0),_){if(!g.begin)g.begin=/\B|\b/;if(F.beginRe=B(g.begin),g.endSameAsBegin)g.end=g.begin;if(!g.end&&!g.endsWithParent)g.end=/\B|\b/;if(g.end)F.endRe=B(g.end);if(F.terminatorEnd=qS(g.end)||"",g.endsWithParent&&_.terminatorEnd)F.terminatorEnd+=(g.end?"|":"")+_.terminatorEnd}if(g.illegal)F.illegalRe=B(g.illegal);if(!g.contains)g.contains=[];if(g.contains=[].concat(...g.contains.map(function(U){return juI(U==="self"?g:U)})),g.contains.forEach(function(U){D(U,F)}),g.starts)D(g.starts,_);return F.matcher=E(F),F}if(!A.compilerExtensions)A.compilerExtensions=[];if(A.contains&&A.contains.includes("self"))throw Error("ERR: contains `self` is not supported at the top-level of a language. See documentation.");return A.classNameAliases=y7(A.classNameAliases||{}),D(A)}function GjQ(A){if(!A)return!1;return A.endsWithParent||GjQ(A.starts)}function juI(A){if(A.variants&&!A.cachedVariants)A.cachedVariants=A.variants.map(function(Q){return y7(A,{variants:null},Q)});if(A.cachedVariants)return A.cachedVariants;if(GjQ(A))return y7(A,{starts:A.starts?y7(A.starts):null});if(Object.isFrozen(A))return y7(A);return A}var SuI="10.7.3";function vuI(A){return Boolean(A||A==="")}function xuI(A){let Q={props:["language","code","autodetect"],data:function(){return{detectedLanguage:"",unknownLanguage:!1}},computed:{className(){if(this.unknownLanguage)return"";return"hljs "+this.detectedLanguage},highlighted(){if(!this.autoDetect&&!A.getLanguage(this.language))return console.warn(`The language "${this.language}" you specified could not be found.`),this.unknownLanguage=!0,BL(this.code);let I={};if(this.autoDetect)I=A.highlightAuto(this.code),this.detectedLanguage=I.language;else I=A.highlight(this.language,this.code,this.ignoreIllegals),this.detectedLanguage=this.language;return I.value},autoDetect(){return!this.language||vuI(this.autodetect)},ignoreIllegals(){return!0}},render(I){return I("pre",{},[I("code",{class:this.className,domProps:{innerHTML:this.highlighted}})])}};return{Component:Q,VuePlugin:{install(I){I.component("highlightjs",Q)}}}}var buI={"after:highlightElement":({el:A,result:Q,text:B})=>{let I=ekQ(A);if(!I.length)return;let C=document.createElement("div");C.innerHTML=Q.value,Q.value=huI(I,ekQ(C),B)}};function gWA(A){return A.nodeName.toLowerCase()}function ekQ(A){let Q=[];return function B(I,C){for(let E=I.firstChild;E;E=E.nextSibling)if(E.nodeType===3)C+=E.nodeValue.length;else if(E.nodeType===1){if(Q.push({event:"start",offset:C,node:E}),C=B(E,C),!gWA(E).match(/br|hr|img|input/))Q.push({event:"stop",offset:C,node:E})}return C}(A,0),Q}function huI(A,Q,B){let I=0,C="",E=[];function D(){if(!A.length||!Q.length)return A.length?A:Q;if(A[0].offset!==Q[0].offset)return A[0].offset<Q[0].offset?A:Q;return Q[0].event==="start"?A:Q}function g(G){function U(X){return" "+X.nodeName+'="'+BL(X.value)+'"'}C+="<"+gWA(G)+[].map.call(G.attributes,U).join("")+">"}function _(G){C+="</"+gWA(G)+">"}function F(G){(G.event==="start"?g:_)(G.node)}while(A.length||Q.length){let G=D();if(C+=BL(B.substring(I,G[0].offset)),I=G[0].offset,G===A){E.reverse().forEach(_);do F(G.splice(0,1)[0]),G=D();while(G===A&&G.length&&G[0].offset===I);E.reverse().forEach(g)}else{if(G[0].event==="start")E.push(G[0].node);else E.pop();F(G.splice(0,1)[0])}}return C+BL(B.substr(I))}var AjQ={},CWA=(A)=>{console.error(A)},QjQ=(A,...Q)=>{console.log(`WARN: ${A}`,...Q)},E8=(A,Q)=>{if(AjQ[`${A}/${Q}`])return;console.log(`Deprecated as of ${A}. ${Q}`),AjQ[`${A}/${Q}`]=!0},EWA=BL,BjQ=y7,IjQ=Symbol("nomatch"),uuI=function(A){let Q=Object.create(null),B=Object.create(null),I=[],C=!0,E=/(^(<[^>]+>|\t|)+|\n)/gm,D="Could not find the language '{}', did you forget to load/include a language module?",g={disableAutodetect:!0,name:"Plain text",contains:[]},_={noHighlightRe:/^(no-?highlight)$/i,languageDetectRe:/\blang(?:uage)?-([\w-]+)\b/i,classPrefix:"hljs-",tabReplace:null,useBR:!1,languages:null,__emitter:DjQ};function F(GA){return _.noHighlightRe.test(GA)}function G(GA){let IA=GA.className+" ";IA+=GA.parentNode?GA.parentNode.className:"";let LA=_.languageDetectRe.exec(IA);if(LA){let m=EA(LA[1]);if(!m)QjQ(D.replace("{}",LA[1])),QjQ("Falling back to no-highlight mode for this block.",GA);return m?LA[1]:"no-highlight"}return IA.split(/\s+/).find((m)=>F(m)||EA(m))}function U(GA,IA,LA,m){let s="",o="";if(typeof IA==="object")s=GA,LA=IA.ignoreIllegals,o=IA.language,m=void 0;else E8("10.7.0","highlight(lang, code, ...args) has been deprecated."),E8("10.7.0",`Please use highlight(code, options) instead.
|
|
5917
|
+
`).filter((C)=>C.trim().length>0).filter((C)=>!C.startsWith("D")&&!C.startsWith("??")&&!C.startsWith("R")).map((C)=>C.slice(3)).filter((C)=>!Q||C.toLowerCase().includes(Q.toLowerCase()));return Promise.all(I.map(async(C)=>{let E=MA.join(A,C),D=MA.basename(C);return await SkQ(E,D,"file")}))}async function khI(A){let{cwd:Q,query:B,maxSize:I}=A,C=await PhI(Q,B);if(C.length<I){let E=I-C.length,g=i8(Q,Q,6000).filter((_)=>!B||_.toLowerCase().includes(B.toLowerCase())).slice(0,E).map((_)=>{let F=_.endsWith(MA.sep),G=MA.basename(_)+(F?MA.sep:"");return SkQ(_,G,F?"directory":"file")}).sort((_,F)=>{if(_.type!==F.type)return _.type==="directory"?-1:1;return _.path.localeCompare(F.path)});C=[...C,...g]}return C}function SkQ(A,Q,B){return{path:A,type:B,name:Q}}var xkQ=b(()=>{AI();iHA();S3()});var tzA={};lI(tzA,{warning:()=>bhI,success:()=>vhI,playSound:()=>QL,listSounds:()=>mhI,info:()=>hhI,error:()=>xhI,done:()=>uhI,beep:()=>hkQ,SOUND_PRESETS:()=>AL});import jhI from"fs";import{spawn as ShI}from"child_process";function hkQ(){process.stdout.write("\x07")}async function QL(A,Q=1){if(process.platform!=="darwin"){hkQ();return}let B=`${bkQ}/${A}.aiff`;return new Promise((I,C)=>{let E=["-v",String(Q),B],D=ShI("afplay",E,{stdio:"ignore"});D.on("close",(g)=>{if(g===0)I();else C(Error(`afplay exited with code ${g}`))}),D.on("error",C)})}async function mhI(){if(process.platform!=="darwin")return[];try{return jhI.readdirSync(bkQ).filter((Q)=>Q.endsWith(".aiff")).map((Q)=>Q.replace(".aiff","")).sort()}catch{return[]}}var bkQ="/System/Library/Sounds",AL,vhI=(A)=>QL(AL.success,A),xhI=(A)=>QL(AL.error,A),bhI=(A)=>QL(AL.warning,A),hhI=(A)=>QL(AL.info,A),uhI=(A)=>QL(AL.done,A);var ezA=b(()=>{AL={success:"Glass",error:"Basso",warning:"Funk",info:"Pop",done:"Hero"}});function chI(A,Q){return A.replace(/\{\{(\w+)\}\}/g,(B,I)=>Q[I]??"")}function ukQ(A,Q){A.registerHandler("utils.query",async(B)=>{let{userPrompt:I,cwd:C,systemPrompt:E}=B,D=await Q(C),{model:g}=await xg(B.model||D.config.model||null,D);return await K9({userPrompt:I,context:D,systemPrompt:E,model:g,thinking:B.thinking,responseFormat:B.responseFormat})}),A.registerHandler("utils.quickQuery",async(B)=>{let{cwd:I}=B,C=await Q(I);return await A.messageHandlers.get("utils.query")?.({userPrompt:B.userPrompt,cwd:I,systemPrompt:B.systemPrompt,model:B.model||C.config.smallModel||null,thinking:B.thinking,responseFormat:B.responseFormat})}),A.registerHandler("utils.summarizeMessage",async(B)=>{let{message:I,cwd:C,model:E}=B;return await A.messageHandlers.get("utils.quickQuery")?.({model:E,userPrompt:I,cwd:C,systemPrompt:"Extract a concise 2-5 word title that captures the main topic or intent of this message. Format your response as a JSON object with one field: 'title' (string).",responseFormat:{type:"json",schema:l8.toJSONSchema(l8.object({title:l8.string()}))}})}),A.registerHandler("utils.getPaths",async(B)=>{let{cwd:I,maxFiles:C=6000}=B,E=await Q(I);return{success:!0,data:{paths:i8(E.cwd,E.cwd,C)}}}),A.registerHandler("utils.searchPaths",async(B)=>{let{cwd:I,query:C,maxResults:E=100}=B,D=await Q(I);if(!C){let{listRootDirectory:F}=await Promise.resolve().then(() => (S3(),JIQ));return{success:!0,data:{paths:F(D.cwd),truncated:!1}}}let{searchFiles:g}=await Promise.resolve().then(() => (bHA(),IMQ));return await g(D.cwd,C,E)}),A.registerHandler("utils.telemetry",async(B)=>{let{cwd:I,name:C,payload:E}=B,D=await Q(I),{PluginHookType:g}=await Promise.resolve().then(() => (Mw(),gtA));return await D.apply({hook:"telemetry",args:[{name:C,payload:E}],type:g.Parallel}),{success:!0}}),A.registerHandler("utils.files.list",async(B)=>{let{cwd:I,query:C}=B,{getFiles:E}=await Promise.resolve().then(() => (xkQ(),vkQ));return{success:!0,data:{files:await E({cwd:I,maxSize:50,query:C||""})}}}),A.registerHandler("utils.tool.executeBash",async(B)=>{let{cwd:I,command:C}=B,{createBashTool:E}=await Promise.resolve().then(() => (EUA(),_5Q)),D=await Q(I),g=E({cwd:I,backgroundTaskManager:D.backgroundTaskManager});try{return{success:!0,data:await g.execute({command:C})}}catch(_){return{success:!1,error:{message:_ instanceof Error?_.message:String(_)}}}}),A.registerHandler("utils.open",async(B)=>{let{cwd:I,app:C}=B,{spawn:E}=await import("child_process"),g={cursor:{cmd:"cursor",args:[I]},vscode:{cmd:"code",args:[I]},"vscode-insiders":{cmd:"code-insiders",args:[I]},zed:{cmd:"zed",args:[I]},windsurf:{cmd:"windsurf",args:[I]},antigravity:{cmd:"agy",args:[I]},iterm:{cmd:"open",args:["-a","iTerm",I]},warp:{cmd:"open",args:["-a","Warp",I]},terminal:{cmd:"open",args:["-a","Terminal",I]},finder:{cmd:"open",args:[I]},sourcetree:{cmd:"open",args:["-a","SourceTree",I]},fork:{cmd:"open",args:["-a","Fork",I]}}[C];return E(g.cmd,g.args,{detached:!0,stdio:"ignore"}).unref(),{success:!0}}),A.registerHandler("utils.playSound",async(B)=>{let{sound:I,volume:C=1}=B;try{let{playSound:E,SOUND_PRESETS:D}=await Promise.resolve().then(() => (ezA(),tzA)),g=I in D?D[I]:I;return await E(g,C),{success:!0}}catch(E){return{success:!1,error:E.message||"Failed to play sound"}}}),A.registerHandler("utils.detectApps",async(B)=>{let{apps:I}=B,{existsSync:C}=await import("fs"),{execSync:E}=await import("child_process"),D=["finder","cursor","antigravity","vscode","vscode-insiders","zed","windsurf","iterm","warp","terminal","sourcetree","fork"],g={cursor:"cursor",vscode:"code","vscode-insiders":"code-insiders",zed:"zed",windsurf:"windsurf",antigravity:"agy"},_={iterm:"/Applications/iTerm.app",warp:"/Applications/Warp.app",terminal:"/System/Applications/Utilities/Terminal.app",sourcetree:"/Applications/Sourcetree.app",fork:"/Applications/Fork.app"},F=(X)=>{let H=process.platform==="darwin";if(X==="finder")return H;if(g[X])try{return E(`which ${g[X]}`,{stdio:"ignore"}),!0}catch{return!1}if(_[X])return C(_[X]);return!1};return{success:!0,data:{apps:(I||[...D]).filter(F)}}}),A.registerHandler("utils.notify",async(B)=>{let{cwd:I,config:C}=B;if(C===!1)return{success:!0};if(typeof C==="string"&&/^https?:\/\//.test(C)){let F={cwd:I,name:MA.basename(I)},G=chI(C,F);return fetch(G).catch(()=>{}),{success:!0}}let{playSound:E,beep:D,SOUND_PRESETS:g}=await Promise.resolve().then(() => (ezA(),tzA)),_=typeof C==="string"?C:g.warning;try{await E(_)}catch{D()}return{success:!0}})}var mkQ=b(()=>{AI();rg();H9();qN();S3()});class nw{messageBus;contextCreateOpts;constructor(A){this.messageBus=new t1,this.contextCreateOpts=A.contextCreateOpts,new ckQ(this.messageBus,this.contextCreateOpts)}}class ckQ{messageBus;contextCreateOpts;contexts=new Map;abortControllers=new Map;skillPreviews=new Map;constructor(A,Q){this.messageBus=A,this.contextCreateOpts=Q,this.registerHandlers()}async getContext(A){if(!this.contextCreateOpts.noContextCache&&this.contexts.has(A))return this.contexts.get(A);let Q=await MV.create({cwd:A,...this.contextCreateOpts,messageBus:this.messageBus});if(Q.mcpManager.initAsync(),!this.contextCreateOpts.noContextCache)this.contexts.set(A,Q);return await this.applyPluginHandlers(Q),Q}async applyPluginHandlers(A){let Q=await A.apply({hook:"nodeBridgeHandler",args:[],memo:{},type:"seriesMerge"});for(let[B,I]of Object.entries(Q))this.messageBus.registerHandler(B,async(C)=>{return await I(C,A)})}async clearContext(A){if(A){let Q=this.contexts.get(A);if(Q)await Q.destroy(),this.contexts.delete(A)}else this.contexts.clear()}registerHandlers(){let A=this.getContext.bind(this),Q=this.clearContext.bind(this);OyQ(this.messageBus,A,Q),TyQ(this.messageBus,A),PyQ(this.messageBus,A),jyQ(this.messageBus,A,Q),vyQ(this.messageBus,A),hyQ(this.messageBus,A,Q),fyQ(this.messageBus,A,this.abortControllers),cyQ(this.messageBus,A),ayQ(this.messageBus,A,this.abortControllers),ryQ(this.messageBus,A,this.skillPreviews),ykQ(this.messageBus,A),TkQ(this.messageBus,A,Q),kkQ(this.messageBus,A),ukQ(this.messageBus,A)}}var L7=b(async()=>{O$A();u9();Mw();yyQ();kyQ();SyQ();xyQ();uyQ();m$A();oyQ();syQ();PkQ();jkQ();mkQ();await fkQ()});var UjQ=f(($EC,YjQ)=>{function _WA(A){if(A instanceof Map)A.clear=A.delete=A.set=function(){throw Error("map is read-only")};else if(A instanceof Set)A.add=A.clear=A.delete=function(){throw Error("set is read-only")};return Object.freeze(A),Object.getOwnPropertyNames(A).forEach(function(Q){var B=A[Q];if(typeof B=="object"&&!Object.isFrozen(B))_WA(B)}),A}var CjQ=_WA,thI=_WA;CjQ.default=thI;class DWA{constructor(A){if(A.data===void 0)A.data={};this.data=A.data,this.isMatchIgnored=!1}ignoreMatch(){this.isMatchIgnored=!0}}function BL(A){return A.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function y7(A,...Q){let B=Object.create(null);for(let I in A)B[I]=A[I];return Q.forEach(function(I){for(let C in I)B[C]=I[C]}),B}var ehI="</span>",tkQ=(A)=>{return!!A.kind};class EjQ{constructor(A,Q){this.buffer="",this.classPrefix=Q.classPrefix,A.walk(this)}addText(A){this.buffer+=BL(A)}openNode(A){if(!tkQ(A))return;let Q=A.kind;if(!A.sublanguage)Q=`${this.classPrefix}${Q}`;this.span(Q)}closeNode(A){if(!tkQ(A))return;this.buffer+=ehI}value(){return this.buffer}span(A){this.buffer+=`<span class="${A}">`}}class wWA{constructor(){this.rootNode={children:[]},this.stack=[this.rootNode]}get top(){return this.stack[this.stack.length-1]}get root(){return this.rootNode}add(A){this.top.children.push(A)}openNode(A){let Q={kind:A,children:[]};this.add(Q),this.stack.push(Q)}closeNode(){if(this.stack.length>1)return this.stack.pop();return}closeAllNodes(){while(this.closeNode());}toJSON(){return JSON.stringify(this.rootNode,null,4)}walk(A){return this.constructor._walk(A,this.rootNode)}static _walk(A,Q){if(typeof Q==="string")A.addText(Q);else if(Q.children)A.openNode(Q),Q.children.forEach((B)=>this._walk(A,B)),A.closeNode(Q);return A}static _collapse(A){if(typeof A==="string")return;if(!A.children)return;if(A.children.every((Q)=>typeof Q==="string"))A.children=[A.children.join("")];else A.children.forEach((Q)=>{wWA._collapse(Q)})}}class DjQ extends wWA{constructor(A){super();this.options=A}addKeyword(A,Q){if(A==="")return;this.openNode(Q),this.addText(A),this.closeNode()}addText(A){if(A==="")return;this.add(A)}addSublanguage(A,Q){let B=A.root;B.kind=Q,B.sublanguage=!0,this.add(B)}toHTML(){return new EjQ(this,this.options).value()}finalize(){return!0}}function AuI(A){return new RegExp(A.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&"),"m")}function qS(A){if(!A)return null;if(typeof A==="string")return A;return A.source}function QuI(...A){return A.map((B)=>qS(B)).join("")}function BuI(...A){return"("+A.map((B)=>qS(B)).join("|")+")"}function IuI(A){return new RegExp(A.toString()+"|").exec("").length-1}function CuI(A,Q){let B=A&&A.exec(Q);return B&&B.index===0}var EuI=/\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./;function DuI(A,Q="|"){let B=0;return A.map((I)=>{B+=1;let C=B,E=qS(I),D="";while(E.length>0){let g=EuI.exec(E);if(!g){D+=E;break}if(D+=E.substring(0,g.index),E=E.substring(g.index+g[0].length),g[0][0]==="\\"&&g[1])D+="\\"+String(Number(g[1])+C);else if(D+=g[0],g[0]==="(")B++}return D}).map((I)=>`(${I})`).join(Q)}var guI=/\b\B/,gjQ="[a-zA-Z]\\w*",FWA="[a-zA-Z_]\\w*",JWA="\\b\\d+(\\.\\d+)?",_jQ="(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",wjQ="\\b(0b[01]+)",_uI="!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~",wuI=(A={})=>{let Q=/^#![ ]*\//;if(A.binary)A.begin=QuI(Q,/.*\b/,A.binary,/\b.*/);return y7({className:"meta",begin:Q,end:/$/,relevance:0,"on:begin":(B,I)=>{if(B.index!==0)I.ignoreMatch()}},A)},NS={begin:"\\\\[\\s\\S]",relevance:0},FuI={className:"string",begin:"'",end:"'",illegal:"\\n",contains:[NS]},JuI={className:"string",begin:'"',end:'"',illegal:"\\n",contains:[NS]},FjQ={begin:/\b(a|an|the|are|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|such|will|you|your|they|like|more)\b/},is=function(A,Q,B={}){let I=y7({className:"comment",begin:A,end:Q,contains:[]},B);return I.contains.push(FjQ),I.contains.push({className:"doctag",begin:"(?:TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):",relevance:0}),I},GuI=is("//","$"),YuI=is("/\\*","\\*/"),UuI=is("#","$"),XuI={className:"number",begin:JWA,relevance:0},HuI={className:"number",begin:_jQ,relevance:0},KuI={className:"number",begin:wjQ,relevance:0},$uI={className:"number",begin:JWA+"(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",relevance:0},ZuI={begin:/(?=\/[^/\n]*\/)/,contains:[{className:"regexp",begin:/\//,end:/\/[gimuy]*/,illegal:/\n/,contains:[NS,{begin:/\[/,end:/\]/,relevance:0,contains:[NS]}]}]},zuI={className:"title",begin:gjQ,relevance:0},WuI={className:"title",begin:FWA,relevance:0},quI={begin:"\\.\\s*"+FWA,relevance:0},NuI=function(A){return Object.assign(A,{"on:begin":(Q,B)=>{B.data._beginMatch=Q[1]},"on:end":(Q,B)=>{if(B.data._beginMatch!==Q[1])B.ignoreMatch()}})},ls=Object.freeze({__proto__:null,MATCH_NOTHING_RE:guI,IDENT_RE:gjQ,UNDERSCORE_IDENT_RE:FWA,NUMBER_RE:JWA,C_NUMBER_RE:_jQ,BINARY_NUMBER_RE:wjQ,RE_STARTERS_RE:_uI,SHEBANG:wuI,BACKSLASH_ESCAPE:NS,APOS_STRING_MODE:FuI,QUOTE_STRING_MODE:JuI,PHRASAL_WORDS_MODE:FjQ,COMMENT:is,C_LINE_COMMENT_MODE:GuI,C_BLOCK_COMMENT_MODE:YuI,HASH_COMMENT_MODE:UuI,NUMBER_MODE:XuI,C_NUMBER_MODE:HuI,BINARY_NUMBER_MODE:KuI,CSS_NUMBER_MODE:$uI,REGEXP_MODE:ZuI,TITLE_MODE:zuI,UNDERSCORE_TITLE_MODE:WuI,METHOD_GUARD:quI,END_SAME_AS_BEGIN:NuI});function MuI(A,Q){if(A.input[A.index-1]===".")Q.ignoreMatch()}function VuI(A,Q){if(!Q)return;if(!A.beginKeywords)return;if(A.begin="\\b("+A.beginKeywords.split(" ").join("|")+")(?!\\.)(?=\\b|\\s)",A.__beforeBegin=MuI,A.keywords=A.keywords||A.beginKeywords,delete A.beginKeywords,A.relevance===void 0)A.relevance=0}function LuI(A,Q){if(!Array.isArray(A.illegal))return;A.illegal=BuI(...A.illegal)}function RuI(A,Q){if(!A.match)return;if(A.begin||A.end)throw Error("begin & end are not supported with match");A.begin=A.match,delete A.match}function OuI(A,Q){if(A.relevance===void 0)A.relevance=1}var yuI=["of","and","for","in","not","or","if","then","parent","list","value"],fuI="keyword";function JjQ(A,Q,B=fuI){let I={};if(typeof A==="string")C(B,A.split(" "));else if(Array.isArray(A))C(B,A);else Object.keys(A).forEach(function(E){Object.assign(I,JjQ(A[E],Q,E))});return I;function C(E,D){if(Q)D=D.map((g)=>g.toLowerCase());D.forEach(function(g){let _=g.split("|");I[_[0]]=[E,TuI(_[0],_[1])]})}}function TuI(A,Q){if(Q)return Number(Q);return PuI(A)?0:1}function PuI(A){return yuI.includes(A.toLowerCase())}function kuI(A,{plugins:Q}){function B(g,_){return new RegExp(qS(g),"m"+(A.case_insensitive?"i":"")+(_?"g":""))}class I{constructor(){this.matchIndexes={},this.regexes=[],this.matchAt=1,this.position=0}addRule(g,_){_.position=this.position++,this.matchIndexes[this.matchAt]=_,this.regexes.push([_,g]),this.matchAt+=IuI(g)+1}compile(){if(this.regexes.length===0)this.exec=()=>null;let g=this.regexes.map((_)=>_[1]);this.matcherRe=B(DuI(g),!0),this.lastIndex=0}exec(g){this.matcherRe.lastIndex=this.lastIndex;let _=this.matcherRe.exec(g);if(!_)return null;let F=_.findIndex((U,X)=>X>0&&U!==void 0),G=this.matchIndexes[F];return _.splice(0,F),Object.assign(_,G)}}class C{constructor(){this.rules=[],this.multiRegexes=[],this.count=0,this.lastIndex=0,this.regexIndex=0}getMatcher(g){if(this.multiRegexes[g])return this.multiRegexes[g];let _=new I;return this.rules.slice(g).forEach(([F,G])=>_.addRule(F,G)),_.compile(),this.multiRegexes[g]=_,_}resumingScanAtSamePosition(){return this.regexIndex!==0}considerAll(){this.regexIndex=0}addRule(g,_){if(this.rules.push([g,_]),_.type==="begin")this.count++}exec(g){let _=this.getMatcher(this.regexIndex);_.lastIndex=this.lastIndex;let F=_.exec(g);if(this.resumingScanAtSamePosition())if(F&&F.index===this.lastIndex);else{let G=this.getMatcher(0);G.lastIndex=this.lastIndex+1,F=G.exec(g)}if(F){if(this.regexIndex+=F.position+1,this.regexIndex===this.count)this.considerAll()}return F}}function E(g){let _=new C;if(g.contains.forEach((F)=>_.addRule(F.begin,{rule:F,type:"begin"})),g.terminatorEnd)_.addRule(g.terminatorEnd,{type:"end"});if(g.illegal)_.addRule(g.illegal,{type:"illegal"});return _}function D(g,_){let F=g;if(g.isCompiled)return F;[RuI].forEach((U)=>U(g,_)),A.compilerExtensions.forEach((U)=>U(g,_)),g.__beforeBegin=null,[VuI,LuI,OuI].forEach((U)=>U(g,_)),g.isCompiled=!0;let G=null;if(typeof g.keywords==="object")G=g.keywords.$pattern,delete g.keywords.$pattern;if(g.keywords)g.keywords=JjQ(g.keywords,A.case_insensitive);if(g.lexemes&&G)throw Error("ERR: Prefer `keywords.$pattern` to `mode.lexemes`, BOTH are not allowed. (see mode reference) ");if(G=G||g.lexemes||/\w+/,F.keywordPatternRe=B(G,!0),_){if(!g.begin)g.begin=/\B|\b/;if(F.beginRe=B(g.begin),g.endSameAsBegin)g.end=g.begin;if(!g.end&&!g.endsWithParent)g.end=/\B|\b/;if(g.end)F.endRe=B(g.end);if(F.terminatorEnd=qS(g.end)||"",g.endsWithParent&&_.terminatorEnd)F.terminatorEnd+=(g.end?"|":"")+_.terminatorEnd}if(g.illegal)F.illegalRe=B(g.illegal);if(!g.contains)g.contains=[];if(g.contains=[].concat(...g.contains.map(function(U){return juI(U==="self"?g:U)})),g.contains.forEach(function(U){D(U,F)}),g.starts)D(g.starts,_);return F.matcher=E(F),F}if(!A.compilerExtensions)A.compilerExtensions=[];if(A.contains&&A.contains.includes("self"))throw Error("ERR: contains `self` is not supported at the top-level of a language. See documentation.");return A.classNameAliases=y7(A.classNameAliases||{}),D(A)}function GjQ(A){if(!A)return!1;return A.endsWithParent||GjQ(A.starts)}function juI(A){if(A.variants&&!A.cachedVariants)A.cachedVariants=A.variants.map(function(Q){return y7(A,{variants:null},Q)});if(A.cachedVariants)return A.cachedVariants;if(GjQ(A))return y7(A,{starts:A.starts?y7(A.starts):null});if(Object.isFrozen(A))return y7(A);return A}var SuI="10.7.3";function vuI(A){return Boolean(A||A==="")}function xuI(A){let Q={props:["language","code","autodetect"],data:function(){return{detectedLanguage:"",unknownLanguage:!1}},computed:{className(){if(this.unknownLanguage)return"";return"hljs "+this.detectedLanguage},highlighted(){if(!this.autoDetect&&!A.getLanguage(this.language))return console.warn(`The language "${this.language}" you specified could not be found.`),this.unknownLanguage=!0,BL(this.code);let I={};if(this.autoDetect)I=A.highlightAuto(this.code),this.detectedLanguage=I.language;else I=A.highlight(this.language,this.code,this.ignoreIllegals),this.detectedLanguage=this.language;return I.value},autoDetect(){return!this.language||vuI(this.autodetect)},ignoreIllegals(){return!0}},render(I){return I("pre",{},[I("code",{class:this.className,domProps:{innerHTML:this.highlighted}})])}};return{Component:Q,VuePlugin:{install(I){I.component("highlightjs",Q)}}}}var buI={"after:highlightElement":({el:A,result:Q,text:B})=>{let I=ekQ(A);if(!I.length)return;let C=document.createElement("div");C.innerHTML=Q.value,Q.value=huI(I,ekQ(C),B)}};function gWA(A){return A.nodeName.toLowerCase()}function ekQ(A){let Q=[];return function B(I,C){for(let E=I.firstChild;E;E=E.nextSibling)if(E.nodeType===3)C+=E.nodeValue.length;else if(E.nodeType===1){if(Q.push({event:"start",offset:C,node:E}),C=B(E,C),!gWA(E).match(/br|hr|img|input/))Q.push({event:"stop",offset:C,node:E})}return C}(A,0),Q}function huI(A,Q,B){let I=0,C="",E=[];function D(){if(!A.length||!Q.length)return A.length?A:Q;if(A[0].offset!==Q[0].offset)return A[0].offset<Q[0].offset?A:Q;return Q[0].event==="start"?A:Q}function g(G){function U(X){return" "+X.nodeName+'="'+BL(X.value)+'"'}C+="<"+gWA(G)+[].map.call(G.attributes,U).join("")+">"}function _(G){C+="</"+gWA(G)+">"}function F(G){(G.event==="start"?g:_)(G.node)}while(A.length||Q.length){let G=D();if(C+=BL(B.substring(I,G[0].offset)),I=G[0].offset,G===A){E.reverse().forEach(_);do F(G.splice(0,1)[0]),G=D();while(G===A&&G.length&&G[0].offset===I);E.reverse().forEach(g)}else{if(G[0].event==="start")E.push(G[0].node);else E.pop();F(G.splice(0,1)[0])}}return C+BL(B.substr(I))}var AjQ={},CWA=(A)=>{console.error(A)},QjQ=(A,...Q)=>{console.log(`WARN: ${A}`,...Q)},E8=(A,Q)=>{if(AjQ[`${A}/${Q}`])return;console.log(`Deprecated as of ${A}. ${Q}`),AjQ[`${A}/${Q}`]=!0},EWA=BL,BjQ=y7,IjQ=Symbol("nomatch"),uuI=function(A){let Q=Object.create(null),B=Object.create(null),I=[],C=!0,E=/(^(<[^>]+>|\t|)+|\n)/gm,D="Could not find the language '{}', did you forget to load/include a language module?",g={disableAutodetect:!0,name:"Plain text",contains:[]},_={noHighlightRe:/^(no-?highlight)$/i,languageDetectRe:/\blang(?:uage)?-([\w-]+)\b/i,classPrefix:"hljs-",tabReplace:null,useBR:!1,languages:null,__emitter:DjQ};function F(GA){return _.noHighlightRe.test(GA)}function G(GA){let IA=GA.className+" ";IA+=GA.parentNode?GA.parentNode.className:"";let LA=_.languageDetectRe.exec(IA);if(LA){let m=EA(LA[1]);if(!m)QjQ(D.replace("{}",LA[1])),QjQ("Falling back to no-highlight mode for this block.",GA);return m?LA[1]:"no-highlight"}return IA.split(/\s+/).find((m)=>F(m)||EA(m))}function U(GA,IA,LA,m){let s="",o="";if(typeof IA==="object")s=GA,LA=IA.ignoreIllegals,o=IA.language,m=void 0;else E8("10.7.0","highlight(lang, code, ...args) has been deprecated."),E8("10.7.0",`Please use highlight(code, options) instead.
|
|
5918
5918
|
https://github.com/highlightjs/highlight.js/issues/2277`),o=GA,s=IA;let FA={code:s,language:o};CA("before:highlight",FA);let JA=FA.result?FA.result:X(FA.language,FA.code,LA,m);return JA.code=FA.code,CA("after:highlight",JA),JA}function X(GA,IA,LA,m){function s(pQ,DB){let aB=NQ.case_insensitive?DB[0].toLowerCase():DB[0];return Object.prototype.hasOwnProperty.call(pQ.keywords,aB)&&pQ.keywords[aB]}function o(){if(!EB.keywords){EI.addText(xB);return}let pQ=0;EB.keywordPatternRe.lastIndex=0;let DB=EB.keywordPatternRe.exec(xB),aB="";while(DB){aB+=xB.substring(pQ,DB.index);let xQ=s(EB,DB);if(xQ){let[$B,qI]=xQ;if(EI.addText(aB),aB="",oI+=qI,$B.startsWith("_"))aB+=DB[0];else{let BA=NQ.classNameAliases[$B]||$B;EI.addKeyword(DB[0],BA)}}else aB+=DB[0];pQ=EB.keywordPatternRe.lastIndex,DB=EB.keywordPatternRe.exec(xB)}aB+=xB.substr(pQ),EI.addText(aB)}function FA(){if(xB==="")return;let pQ=null;if(typeof EB.subLanguage==="string"){if(!Q[EB.subLanguage]){EI.addText(xB);return}pQ=X(EB.subLanguage,xB,!0,yB[EB.subLanguage]),yB[EB.subLanguage]=pQ.top}else pQ=K(xB,EB.subLanguage.length?EB.subLanguage:null);if(EB.relevance>0)oI+=pQ.relevance;EI.addSublanguage(pQ.emitter,pQ.language)}function JA(){if(EB.subLanguage!=null)FA();else o();xB=""}function ZA(pQ){if(pQ.className)EI.openNode(NQ.classNameAliases[pQ.className]||pQ.className);return EB=Object.create(pQ,{parent:{value:EB}}),EB}function aA(pQ,DB,aB){let xQ=CuI(pQ.endRe,aB);if(xQ){if(pQ["on:end"]){let $B=new DWA(pQ);if(pQ["on:end"](DB,$B),$B.isMatchIgnored)xQ=!1}if(xQ){while(pQ.endsParent&&pQ.parent)pQ=pQ.parent;return pQ}}if(pQ.endsWithParent)return aA(pQ.parent,DB,aB)}function yA(pQ){if(EB.matcher.regexIndex===0)return xB+=pQ[0],1;else return bB=!0,0}function XA(pQ){let DB=pQ[0],aB=pQ.rule,xQ=new DWA(aB),$B=[aB.__beforeBegin,aB["on:begin"]];for(let qI of $B){if(!qI)continue;if(qI(pQ,xQ),xQ.isMatchIgnored)return yA(DB)}if(aB&&aB.endSameAsBegin)aB.endRe=AuI(DB);if(aB.skip)xB+=DB;else{if(aB.excludeBegin)xB+=DB;if(JA(),!aB.returnBegin&&!aB.excludeBegin)xB=DB}return ZA(aB),aB.returnBegin?0:DB.length}function TA(pQ){let DB=pQ[0],aB=IA.substr(pQ.index),xQ=aA(EB,pQ,aB);if(!xQ)return IjQ;let $B=EB;if($B.skip)xB+=DB;else{if(!($B.returnEnd||$B.excludeEnd))xB+=DB;if(JA(),$B.excludeEnd)xB=DB}do{if(EB.className)EI.closeNode();if(!EB.skip&&!EB.subLanguage)oI+=EB.relevance;EB=EB.parent}while(EB!==xQ.parent);if(xQ.starts){if(xQ.endSameAsBegin)xQ.starts.endRe=xQ.endRe;ZA(xQ.starts)}return $B.returnEnd?0:DB.length}function IQ(){let pQ=[];for(let DB=EB;DB!==NQ;DB=DB.parent)if(DB.className)pQ.unshift(DB.className);pQ.forEach((DB)=>EI.openNode(DB))}let t={};function $A(pQ,DB){let aB=DB&&DB[0];if(xB+=pQ,aB==null)return JA(),0;if(t.type==="begin"&&DB.type==="end"&&t.index===DB.index&&aB===""){if(xB+=IA.slice(DB.index,DB.index+1),!C){let xQ=Error("0 width match regex");throw xQ.languageName=GA,xQ.badRule=t.rule,xQ}return 1}if(t=DB,DB.type==="begin")return XA(DB);else if(DB.type==="illegal"&&!LA){let xQ=Error('Illegal lexeme "'+aB+'" for mode "'+(EB.className||"<unnamed>")+'"');throw xQ.mode=EB,xQ}else if(DB.type==="end"){let xQ=TA(DB);if(xQ!==IjQ)return xQ}if(DB.type==="illegal"&&aB==="")return 1;if(I0>1e5&&I0>DB.index*3)throw Error("potential infinite loop, way more iterations than matches");return xB+=aB,aB.length}let NQ=EA(GA);if(!NQ)throw CWA(D.replace("{}",GA)),Error('Unknown language: "'+GA+'"');let yQ=kuI(NQ,{plugins:I}),hQ="",EB=m||yQ,yB={},EI=new _.__emitter(_);IQ();let xB="",oI=0,fB=0,I0=0,bB=!1;try{EB.matcher.considerAll();for(;;){if(I0++,bB)bB=!1;else EB.matcher.considerAll();EB.matcher.lastIndex=fB;let pQ=EB.matcher.exec(IA);if(!pQ)break;let DB=IA.substring(fB,pQ.index),aB=$A(DB,pQ);fB=pQ.index+aB}return $A(IA.substr(fB)),EI.closeAllNodes(),EI.finalize(),hQ=EI.toHTML(),{relevance:Math.floor(oI),value:hQ,language:GA,illegal:!1,emitter:EI,top:EB}}catch(pQ){if(pQ.message&&pQ.message.includes("Illegal"))return{illegal:!0,illegalBy:{msg:pQ.message,context:IA.slice(fB-100,fB+100),mode:pQ.mode},sofar:hQ,relevance:0,value:EWA(IA),emitter:EI};else if(C)return{illegal:!1,relevance:0,value:EWA(IA),emitter:EI,language:GA,top:EB,errorRaised:pQ};else throw pQ}}function H(GA){let IA={relevance:0,emitter:new _.__emitter(_),value:EWA(GA),illegal:!1,top:g};return IA.emitter.addText(GA),IA}function K(GA,IA){IA=IA||_.languages||Object.keys(Q);let LA=H(GA),m=IA.filter(EA).filter(UA).map((ZA)=>X(ZA,GA,!1));m.unshift(LA);let s=m.sort((ZA,aA)=>{if(ZA.relevance!==aA.relevance)return aA.relevance-ZA.relevance;if(ZA.language&&aA.language){if(EA(ZA.language).supersetOf===aA.language)return 1;else if(EA(aA.language).supersetOf===ZA.language)return-1}return 0}),[o,FA]=s,JA=o;return JA.second_best=FA,JA}function Z(GA){if(!(_.tabReplace||_.useBR))return GA;return GA.replace(E,(IA)=>{if(IA===`
|
|
5919
5919
|
`)return _.useBR?"<br>":IA;else if(_.tabReplace)return IA.replace(/\t/g,_.tabReplace);return IA})}function W(GA,IA,LA){let m=IA?B[IA]:LA;if(GA.classList.add("hljs"),m)GA.classList.add(m)}let q={"before:highlightElement":({el:GA})=>{if(_.useBR)GA.innerHTML=GA.innerHTML.replace(/\n/g,"").replace(/<br[ /]*>/g,`
|
|
5920
5920
|
`)},"after:highlightElement":({result:GA})=>{if(_.useBR)GA.value=GA.value.replace(/\n/g,"<br>")}},V=/^(<[^>]+>|\t)+/gm,M={"after:highlightElement":({result:GA})=>{if(_.tabReplace)GA.value=GA.value.replace(V,(IA)=>IA.replace(/\t/g,_.tabReplace))}};function L(GA){let IA=null,LA=G(GA);if(F(LA))return;CA("before:highlightElement",{el:GA,language:LA}),IA=GA;let m=IA.textContent,s=LA?U(m,{language:LA,ignoreIllegals:!0}):K(m);if(CA("after:highlightElement",{el:GA,result:s,text:m}),GA.innerHTML=s.value,W(GA,LA,s.language),GA.result={language:s.language,re:s.relevance,relavance:s.relevance},s.second_best)GA.second_best={language:s.second_best.language,re:s.second_best.relevance,relavance:s.second_best.relevance}}function k(GA){if(GA.useBR)E8("10.3.0","'useBR' will be removed entirely in v11.0"),E8("10.3.0","Please see https://github.com/highlightjs/highlight.js/issues/2559");_=BjQ(_,GA)}let P=()=>{if(P.called)return;P.called=!0,E8("10.6.0","initHighlighting() is deprecated. Use highlightAll() instead."),document.querySelectorAll("pre code").forEach(L)};function O(){E8("10.6.0","initHighlightingOnLoad() is deprecated. Use highlightAll() instead."),v=!0}let v=!1;function u(){if(document.readyState==="loading"){v=!0;return}document.querySelectorAll("pre code").forEach(L)}function l(){if(v)u()}if(typeof window<"u"&&window.addEventListener)window.addEventListener("DOMContentLoaded",l,!1);function d(GA,IA){let LA=null;try{LA=IA(A)}catch(m){if(CWA("Language definition for '{}' could not be registered.".replace("{}",GA)),!C)throw m;else CWA(m);LA=g}if(!LA.name)LA.name=GA;if(Q[GA]=LA,LA.rawDefinition=IA.bind(null,A),LA.aliases)DA(LA.aliases,{languageName:GA})}function n(GA){delete Q[GA];for(let IA of Object.keys(B))if(B[IA]===GA)delete B[IA]}function QA(){return Object.keys(Q)}function S(GA){E8("10.4.0","requireLanguage will be removed entirely in v11."),E8("10.4.0","Please see https://github.com/highlightjs/highlight.js/pull/2844");let IA=EA(GA);if(IA)return IA;throw Error("The '{}' language is required, but not loaded.".replace("{}",GA))}function EA(GA){return GA=(GA||"").toLowerCase(),Q[GA]||Q[B[GA]]}function DA(GA,{languageName:IA}){if(typeof GA==="string")GA=[GA];GA.forEach((LA)=>{B[LA.toLowerCase()]=IA})}function UA(GA){let IA=EA(GA);return IA&&!IA.disableAutodetect}function _A(GA){if(GA["before:highlightBlock"]&&!GA["before:highlightElement"])GA["before:highlightElement"]=(IA)=>{GA["before:highlightBlock"](Object.assign({block:IA.el},IA))};if(GA["after:highlightBlock"]&&!GA["after:highlightElement"])GA["after:highlightElement"]=(IA)=>{GA["after:highlightBlock"](Object.assign({block:IA.el},IA))}}function PA(GA){_A(GA),I.push(GA)}function CA(GA,IA){let LA=GA;I.forEach(function(m){if(m[LA])m[LA](IA)})}function fA(GA){return E8("10.2.0","fixMarkup will be removed entirely in v11.0"),E8("10.2.0","Please see https://github.com/highlightjs/highlight.js/issues/2534"),Z(GA)}function jA(GA){return E8("10.7.0","highlightBlock will be removed entirely in v12.0"),E8("10.7.0","Please use highlightElement now."),L(GA)}Object.assign(A,{highlight:U,highlightAuto:K,highlightAll:u,fixMarkup:fA,highlightElement:L,highlightBlock:jA,configure:k,initHighlighting:P,initHighlightingOnLoad:O,registerLanguage:d,unregisterLanguage:n,listLanguages:QA,getLanguage:EA,registerAliases:DA,requireLanguage:S,autoDetection:UA,inherit:BjQ,addPlugin:PA,vuePlugin:xuI(A).VuePlugin}),A.debugMode=function(){C=!1},A.safeMode=function(){C=!0},A.versionString=SuI;for(let GA in ls)if(typeof ls[GA]==="object")CjQ(ls[GA]);return Object.assign(A,ls),A.addPlugin(q),A.addPlugin(buI),A.addPlugin(M),A},muI=uuI({});YjQ.exports=muI});var HjQ=f((ZEC,XjQ)=>{function cuI(A){var Q="[A-Za-zА-Яа-яёЁ_][A-Za-zА-Яа-яёЁ_0-9]+",B="далее ",I="возврат вызватьисключение выполнить для если и из или иначе иначеесли исключение каждого конецесли "+"конецпопытки конеццикла не новый перейти перем по пока попытка прервать продолжить тогда цикл экспорт ",C=B+I,E="загрузитьизфайла ",D="вебклиент вместо внешнеесоединение клиент конецобласти мобильноеприложениеклиент мобильноеприложениесервер "+"наклиенте наклиентенасервере наклиентенасерверебезконтекста насервере насерверебезконтекста область перед "+"после сервер толстыйклиентобычноеприложение толстыйклиентуправляемоеприложение тонкийклиент ",g=E+D,_="разделительстраниц разделительстрок символтабуляции ",F="ansitooem oemtoansi ввестивидсубконто ввестиперечисление ввестипериод ввестиплансчетов выбранныйплансчетов "+"датагод датамесяц датачисло заголовоксистемы значениевстроку значениеизстроки каталогиб каталогпользователя "+"кодсимв конгода конецпериодаби конецрассчитанногопериодаби конецстандартногоинтервала конквартала конмесяца "+"коннедели лог лог10 максимальноеколичествосубконто названиеинтерфейса названиенабораправ назначитьвид "+"назначитьсчет найтиссылки началопериодаби началостандартногоинтервала начгода начквартала начмесяца "+"начнедели номерднягода номерднянедели номернеделигода обработкаожидания основнойжурналрасчетов "+"основнойплансчетов основнойязык очиститьокносообщений периодстр получитьвремята получитьдатута "+"получитьдокументта получитьзначенияотбора получитьпозициюта получитьпустоезначение получитьта "+"префиксавтонумерации пропись пустоезначение разм разобратьпозициюдокумента рассчитатьрегистрына "+"рассчитатьрегистрыпо симв создатьобъект статусвозврата стрколичествострок сформироватьпозициюдокумента "+"счетпокоду текущеевремя типзначения типзначениястр установитьтана установитьтапо фиксшаблон шаблон ",G="acos asin atan base64значение base64строка cos exp log log10 pow sin sqrt tan xmlзначение xmlстрока "+"xmlтип xmlтипзнч активноеокно безопасныйрежим безопасныйрежимразделенияданных булево ввестидату ввестизначение "+"ввестистроку ввестичисло возможностьчтенияxml вопрос восстановитьзначение врег выгрузитьжурналрегистрации "+"выполнитьобработкуоповещения выполнитьпроверкуправдоступа вычислить год данныеформывзначение дата день деньгода "+"деньнедели добавитьмесяц заблокироватьданныедляредактирования заблокироватьработупользователя завершитьработусистемы "+"загрузитьвнешнююкомпоненту закрытьсправку записатьjson записатьxml записатьдатуjson записьжурналарегистрации "+"заполнитьзначениясвойств запроситьразрешениепользователя запуститьприложение запуститьсистему зафиксироватьтранзакцию "+"значениевданныеформы значениевстрокувнутр значениевфайл значениезаполнено значениеизстрокивнутр значениеизфайла "+"изxmlтипа импортмоделиxdto имякомпьютера имяпользователя инициализироватьпредопределенныеданные информацияобошибке "+"каталогбиблиотекимобильногоустройства каталогвременныхфайлов каталогдокументов каталогпрограммы кодироватьстроку "+"кодлокализацииинформационнойбазы кодсимвола командасистемы конецгода конецдня конецквартала конецмесяца конецминуты "+"конецнедели конецчаса конфигурациябазыданныхизмененадинамически конфигурацияизменена копироватьданныеформы "+"копироватьфайл краткоепредставлениеошибки лев макс местноевремя месяц мин минута монопольныйрежим найти "+"найтинедопустимыесимволыxml найтиокнопонавигационнойссылке найтипомеченныенаудаление найтипоссылкам найтифайлы "+"началогода началодня началоквартала началомесяца началоминуты началонедели началочаса начатьзапросразрешенияпользователя "+"начатьзапускприложения начатькопированиефайла начатьперемещениефайла начатьподключениевнешнейкомпоненты "+"начатьподключениерасширенияработыскриптографией начатьподключениерасширенияработысфайлами начатьпоискфайлов "+"начатьполучениекаталогавременныхфайлов начатьполучениекаталогадокументов начатьполучениерабочегокаталогаданныхпользователя "+"начатьполучениефайлов начатьпомещениефайла начатьпомещениефайлов начатьсозданиедвоичныхданныхизфайла начатьсозданиекаталога "+"начатьтранзакцию начатьудалениефайлов начатьустановкувнешнейкомпоненты начатьустановкурасширенияработыскриптографией "+"начатьустановкурасширенияработысфайлами неделягода необходимостьзавершениясоединения номерсеансаинформационнойбазы "+"номерсоединенияинформационнойбазы нрег нстр обновитьинтерфейс обновитьнумерациюобъектов обновитьповторноиспользуемыезначения "+"обработкапрерыванияпользователя объединитьфайлы окр описаниеошибки оповестить оповеститьобизменении "+"отключитьобработчикзапросанастроекклиенталицензирования отключитьобработчикожидания отключитьобработчикоповещения "+"открытьзначение открытьиндекссправки открытьсодержаниесправки открытьсправку открытьформу открытьформумодально "+"отменитьтранзакцию очиститьжурналрегистрации очиститьнастройкипользователя очиститьсообщения параметрыдоступа "+"перейтипонавигационнойссылке переместитьфайл подключитьвнешнююкомпоненту "+"подключитьобработчикзапросанастроекклиенталицензирования подключитьобработчикожидания подключитьобработчикоповещения "+"подключитьрасширениеработыскриптографией подключитьрасширениеработысфайлами подробноепредставлениеошибки "+"показатьвводдаты показатьвводзначения показатьвводстроки показатьвводчисла показатьвопрос показатьзначение "+"показатьинформациюобошибке показатьнакарте показатьоповещениепользователя показатьпредупреждение полноеимяпользователя "+"получитьcomобъект получитьxmlтип получитьадреспоместоположению получитьблокировкусеансов получитьвремязавершенияспящегосеанса "+"получитьвремязасыпанияпассивногосеанса получитьвремяожиданияблокировкиданных получитьданныевыбора "+"получитьдополнительныйпараметрклиенталицензирования получитьдопустимыекодылокализации получитьдопустимыечасовыепояса "+"получитьзаголовокклиентскогоприложения получитьзаголовоксистемы получитьзначенияотборажурналарегистрации "+"получитьидентификаторконфигурации получитьизвременногохранилища получитьимявременногофайла "+"получитьимяклиенталицензирования получитьинформациюэкрановклиента получитьиспользованиежурналарегистрации "+"получитьиспользованиесобытияжурналарегистрации получитькраткийзаголовокприложения получитьмакетоформления "+"получитьмаскувсефайлы получитьмаскувсефайлыклиента получитьмаскувсефайлысервера получитьместоположениепоадресу "+"получитьминимальнуюдлинупаролейпользователей получитьнавигационнуюссылку получитьнавигационнуюссылкуинформационнойбазы "+"получитьобновлениеконфигурациибазыданных получитьобновлениепредопределенныхданныхинформационнойбазы получитьобщиймакет "+"получитьобщуюформу получитьокна получитьоперативнуюотметкувремени получитьотключениебезопасногорежима "+"получитьпараметрыфункциональныхопцийинтерфейса получитьполноеимяпредопределенногозначения "+"получитьпредставлениянавигационныхссылок получитьпроверкусложностипаролейпользователей получитьразделительпути "+"получитьразделительпутиклиента получитьразделительпутисервера получитьсеансыинформационнойбазы "+"получитьскоростьклиентскогосоединения получитьсоединенияинформационнойбазы получитьсообщенияпользователю "+"получитьсоответствиеобъектаиформы получитьсоставстандартногоинтерфейсаodata получитьструктурухранениябазыданных "+"получитьтекущийсеансинформационнойбазы получитьфайл получитьфайлы получитьформу получитьфункциональнуюопцию "+"получитьфункциональнуюопциюинтерфейса получитьчасовойпоясинформационнойбазы пользователиос поместитьвовременноехранилище "+"поместитьфайл поместитьфайлы прав праводоступа предопределенноезначение представлениекодалокализации представлениепериода "+"представлениеправа представлениеприложения представлениесобытияжурналарегистрации представлениечасовогопояса предупреждение "+"прекратитьработусистемы привилегированныйрежим продолжитьвызов прочитатьjson прочитатьxml прочитатьдатуjson пустаястрока "+"рабочийкаталогданныхпользователя разблокироватьданныедляредактирования разделитьфайл разорватьсоединениесвнешнимисточникомданных "+"раскодироватьстроку рольдоступна секунда сигнал символ скопироватьжурналрегистрации смещениелетнеговремени "+"смещениестандартноговремени соединитьбуферыдвоичныхданных создатькаталог создатьфабрикуxdto сокрл сокрлп сокрп сообщить "+"состояние сохранитьзначение сохранитьнастройкипользователя сред стрдлина стрзаканчиваетсяна стрзаменить стрнайти стрначинаетсяс "+"строка строкасоединенияинформационнойбазы стрполучитьстроку стрразделить стрсоединить стрсравнить стрчисловхождений "+"стрчислострок стршаблон текущаядата текущаядатасеанса текущаяуниверсальнаядата текущаяуниверсальнаядатавмиллисекундах "+"текущийвариантинтерфейсаклиентскогоприложения текущийвариантосновногошрифтаклиентскогоприложения текущийкодлокализации "+"текущийрежимзапуска текущийязык текущийязыксистемы тип типзнч транзакцияактивна трег удалитьданныеинформационнойбазы "+"удалитьизвременногохранилища удалитьобъекты удалитьфайлы универсальноевремя установитьбезопасныйрежим "+"установитьбезопасныйрежимразделенияданных установитьблокировкусеансов установитьвнешнююкомпоненту "+"установитьвремязавершенияспящегосеанса установитьвремязасыпанияпассивногосеанса установитьвремяожиданияблокировкиданных "+"установитьзаголовокклиентскогоприложения установитьзаголовоксистемы установитьиспользованиежурналарегистрации "+"установитьиспользованиесобытияжурналарегистрации установитькраткийзаголовокприложения "+"установитьминимальнуюдлинупаролейпользователей установитьмонопольныйрежим установитьнастройкиклиенталицензирования "+"установитьобновлениепредопределенныхданныхинформационнойбазы установитьотключениебезопасногорежима "+"установитьпараметрыфункциональныхопцийинтерфейса установитьпривилегированныйрежим "+"установитьпроверкусложностипаролейпользователей установитьрасширениеработыскриптографией "+"установитьрасширениеработысфайлами установитьсоединениесвнешнимисточникомданных установитьсоответствиеобъектаиформы "+"установитьсоставстандартногоинтерфейсаodata установитьчасовойпоясинформационнойбазы установитьчасовойпояссеанса "+"формат цел час часовойпояс часовойпояссеанса число числопрописью этоадресвременногохранилища ",U="wsссылки библиотекакартинок библиотекамакетовоформлениякомпоновкиданных библиотекастилей бизнеспроцессы "+"внешниеисточникиданных внешниеобработки внешниеотчеты встроенныепокупки главныйинтерфейс главныйстиль "+"документы доставляемыеуведомления журналыдокументов задачи информацияобинтернетсоединении использованиерабочейдаты "+"историяработыпользователя константы критерииотбора метаданные обработки отображениерекламы отправкадоставляемыхуведомлений "+"отчеты панельзадачос параметрзапуска параметрысеанса перечисления планывидоврасчета планывидовхарактеристик "+"планыобмена планысчетов полнотекстовыйпоиск пользователиинформационнойбазы последовательности проверкавстроенныхпокупок "+"рабочаядата расширенияконфигурации регистрыбухгалтерии регистрынакопления регистрырасчета регистрысведений "+"регламентныезадания сериализаторxdto справочники средствагеопозиционирования средствакриптографии средствамультимедиа "+"средстваотображениярекламы средствапочты средствателефонии фабрикаxdto файловыепотоки фоновыезадания хранилищанастроек "+"хранилищевариантовотчетов хранилищенастроекданныхформ хранилищеобщихнастроек хранилищепользовательскихнастроекдинамическихсписков "+"хранилищепользовательскихнастроекотчетов хранилищесистемныхнастроек ",X=_+F+G+U,H="webцвета windowsцвета windowsшрифты библиотекакартинок рамкистиля символы цветастиля шрифтыстиля ",K="автоматическоесохранениеданныхформывнастройках автонумерациявформе автораздвижениесерий "+"анимациядиаграммы вариантвыравниванияэлементовизаголовков вариантуправлениявысотойтаблицы "+"вертикальнаяпрокруткаформы вертикальноеположение вертикальноеположениеэлемента видгруппыформы "+"виддекорацииформы виддополненияэлементаформы видизмененияданных видкнопкиформы видпереключателя "+"видподписейкдиаграмме видполяформы видфлажка влияниеразмеранапузырекдиаграммы горизонтальноеположение "+"горизонтальноеположениеэлемента группировкаколонок группировкаподчиненныхэлементовформы "+"группыиэлементы действиеперетаскивания дополнительныйрежимотображения допустимыедействияперетаскивания "+"интервалмеждуэлементамиформы использованиевывода использованиеполосыпрокрутки "+"используемоезначениеточкибиржевойдиаграммы историявыборапривводе источникзначенийоситочекдиаграммы "+"источникзначенияразмерапузырькадиаграммы категориягруппыкоманд максимумсерий начальноеотображениедерева "+"начальноеотображениесписка обновлениетекстаредактирования ориентациядендрограммы ориентациядиаграммы "+"ориентацияметокдиаграммы ориентацияметоксводнойдиаграммы ориентацияэлементаформы отображениевдиаграмме "+"отображениевлегендедиаграммы отображениегруппыкнопок отображениезаголовкашкалыдиаграммы "+"отображениезначенийсводнойдиаграммы отображениезначенияизмерительнойдиаграммы "+"отображениеинтерваладиаграммыганта отображениекнопки отображениекнопкивыбора отображениеобсужденийформы "+"отображениеобычнойгруппы отображениеотрицательныхзначенийпузырьковойдиаграммы отображениепанелипоиска "+"отображениеподсказки отображениепредупрежденияприредактировании отображениеразметкиполосырегулирования "+"отображениестраницформы отображениетаблицы отображениетекстазначениядиаграммыганта "+"отображениеуправленияобычнойгруппы отображениефигурыкнопки палитрацветовдиаграммы поведениеобычнойгруппы "+"поддержкамасштабадендрограммы поддержкамасштабадиаграммыганта поддержкамасштабасводнойдиаграммы "+"поисквтаблицепривводе положениезаголовкаэлементаформы положениекартинкикнопкиформы "+"положениекартинкиэлементаграфическойсхемы положениекоманднойпанелиформы положениекоманднойпанелиэлементаформы "+"положениеопорнойточкиотрисовки положениеподписейкдиаграмме положениеподписейшкалызначенийизмерительнойдиаграммы "+"положениесостоянияпросмотра положениестрокипоиска положениетекстасоединительнойлинии положениеуправленияпоиском "+"положениешкалывремени порядокотображенияточекгоризонтальнойгистограммы порядоксерийвлегендедиаграммы "+"размеркартинки расположениезаголовкашкалыдиаграммы растягиваниеповертикалидиаграммыганта "+"режимавтоотображениясостояния режимвводастроктаблицы режимвыборанезаполненного режимвыделениядаты "+"режимвыделениястрокитаблицы режимвыделениятаблицы режимизмененияразмера режимизменениясвязанногозначения "+"режимиспользованиядиалогапечати режимиспользованияпараметракоманды режиммасштабированияпросмотра "+"режимосновногоокнаклиентскогоприложения режимоткрытияокнаформы режимотображениявыделения "+"режимотображениягеографическойсхемы режимотображениязначенийсерии режимотрисовкисеткиграфическойсхемы "+"режимполупрозрачностидиаграммы режимпробеловдиаграммы режимразмещениянастранице режимредактированияколонки "+"режимсглаживаниядиаграммы режимсглаживанияиндикатора режимсписказадач сквозноевыравнивание "+"сохранениеданныхформывнастройках способзаполнениятекстазаголовкашкалыдиаграммы "+"способопределенияограничивающегозначениядиаграммы стандартнаягруппакоманд стандартноеоформление "+"статусоповещенияпользователя стильстрелки типаппроксимациилиниитрендадиаграммы типдиаграммы "+"типединицышкалывремени типимпортасерийслоягеографическойсхемы типлиниигеографическойсхемы типлиниидиаграммы "+"типмаркерагеографическойсхемы типмаркерадиаграммы типобластиоформления "+"типорганизацииисточникаданныхгеографическойсхемы типотображениясериислоягеографическойсхемы "+"типотображенияточечногообъектагеографическойсхемы типотображенияшкалыэлементалегендыгеографическойсхемы "+"типпоискаобъектовгеографическойсхемы типпроекциигеографическойсхемы типразмещенияизмерений "+"типразмещенияреквизитовизмерений типрамкиэлементауправления типсводнойдиаграммы "+"типсвязидиаграммыганта типсоединениязначенийпосериямдиаграммы типсоединенияточекдиаграммы "+"типсоединительнойлинии типстороныэлементаграфическойсхемы типформыотчета типшкалырадарнойдиаграммы "+"факторлиниитрендадиаграммы фигуракнопки фигурыграфическойсхемы фиксациявтаблице форматдняшкалывремени "+"форматкартинки ширинаподчиненныхэлементовформы ",Z="виддвижениябухгалтерии виддвижениянакопления видпериодарегистрарасчета видсчета видточкимаршрутабизнеспроцесса "+"использованиеагрегатарегистранакопления использованиегруппиэлементов использованиережимапроведения "+"использованиесреза периодичностьагрегатарегистранакопления режимавтовремя режимзаписидокумента режимпроведениядокумента ",W="авторегистрацияизменений допустимыйномерсообщения отправкаэлементаданных получениеэлементаданных ",q="использованиерасшифровкитабличногодокумента ориентациястраницы положениеитоговколоноксводнойтаблицы "+"положениеитоговстроксводнойтаблицы положениетекстаотносительнокартинки расположениезаголовкагруппировкитабличногодокумента "+"способчтениязначенийтабличногодокумента типдвустороннейпечати типзаполненияобластитабличногодокумента "+"типкурсоровтабличногодокумента типлиниирисункатабличногодокумента типлинииячейкитабличногодокумента "+"типнаправленияпереходатабличногодокумента типотображениявыделениятабличногодокумента типотображениялинийсводнойтаблицы "+"типразмещениятекстатабличногодокумента типрисункатабличногодокумента типсмещениятабличногодокумента "+"типузоратабличногодокумента типфайлатабличногодокумента точностьпечати чередованиерасположениястраниц ",V="отображениевремениэлементовпланировщика ",M="типфайлаформатированногодокумента ",L="обходрезультатазапроса типзаписизапроса ",k="видзаполнениярасшифровкипостроителяотчета типдобавленияпредставлений типизмеренияпостроителяотчета типразмещенияитогов ",P="доступкфайлу режимдиалогавыборафайла режимоткрытияфайла ",O="типизмеренияпостроителязапроса ",v="видданныханализа методкластеризации типединицыинтервалавременианализаданных типзаполнениятаблицырезультатаанализаданных "+"типиспользованиячисловыхзначенийанализаданных типисточникаданныхпоискаассоциаций типколонкианализаданныхдереворешений "+"типколонкианализаданныхкластеризация типколонкианализаданныхобщаястатистика типколонкианализаданныхпоискассоциаций "+"типколонкианализаданныхпоискпоследовательностей типколонкимоделипрогноза типмерырасстоянияанализаданных "+"типотсеченияправилассоциации типполяанализаданных типстандартизациианализаданных типупорядочиванияправилассоциациианализаданных "+"типупорядочиванияшаблоновпоследовательностейанализаданных типупрощениядереварешений ",u="wsнаправлениепараметра вариантxpathxs вариантзаписидатыjson вариантпростоготипаxs видгруппымоделиxs видфасетаxdto "+"действиепостроителяdom завершенностьпростоготипаxs завершенностьсоставноготипаxs завершенностьсхемыxs запрещенныеподстановкиxs "+"исключениягруппподстановкиxs категорияиспользованияатрибутаxs категорияограниченияидентичностиxs категорияограниченияпространствименxs "+"методнаследованияxs модельсодержимогоxs назначениетипаxml недопустимыеподстановкиxs обработкапробельныхсимволовxs обработкасодержимогоxs "+"ограничениезначенияxs параметрыотбораузловdom переносстрокjson позициявдокументеdom пробельныесимволыxml типатрибутаxml типзначенияjson "+"типканоническогоxml типкомпонентыxs типпроверкиxml типрезультатаdomxpath типузлаdom типузлаxml формаxml формапредставленияxs "+"форматдатыjson экранированиесимволовjson ",l="видсравнениякомпоновкиданных действиеобработкирасшифровкикомпоновкиданных направлениесортировкикомпоновкиданных "+"расположениевложенныхэлементоврезультатакомпоновкиданных расположениеитоговкомпоновкиданных расположениегруппировкикомпоновкиданных "+"расположениеполейгруппировкикомпоновкиданных расположениеполякомпоновкиданных расположениереквизитовкомпоновкиданных "+"расположениересурсовкомпоновкиданных типбухгалтерскогоостаткакомпоновкиданных типвыводатекстакомпоновкиданных "+"типгруппировкикомпоновкиданных типгруппыэлементовотборакомпоновкиданных типдополненияпериодакомпоновкиданных "+"типзаголовкаполейкомпоновкиданных типмакетагруппировкикомпоновкиданных типмакетаобластикомпоновкиданных типостаткакомпоновкиданных "+"типпериодакомпоновкиданных типразмещениятекстакомпоновкиданных типсвязинаборовданныхкомпоновкиданных типэлементарезультатакомпоновкиданных "+"расположениелегендыдиаграммыкомпоновкиданных типпримененияотборакомпоновкиданных режимотображенияэлементанастройкикомпоновкиданных "+"режимотображениянастроеккомпоновкиданных состояниеэлементанастройкикомпоновкиданных способвосстановлениянастроеккомпоновкиданных "+"режимкомпоновкирезультата использованиепараметракомпоновкиданных автопозицияресурсовкомпоновкиданных "+"вариантиспользованиягруппировкикомпоновкиданных расположениересурсоввдиаграммекомпоновкиданных фиксациякомпоновкиданных "+"использованиеусловногооформлениякомпоновкиданных ",d="важностьинтернетпочтовогосообщения обработкатекстаинтернетпочтовогосообщения способкодированияинтернетпочтовоговложения "+"способкодированиянеasciiсимволовинтернетпочтовогосообщения типтекстапочтовогосообщения протоколинтернетпочты "+"статусразборапочтовогосообщения ",n="режимтранзакциизаписижурналарегистрации статустранзакциизаписижурналарегистрации уровеньжурналарегистрации ",QA="расположениехранилищасертификатовкриптографии режимвключениясертификатовкриптографии режимпроверкисертификатакриптографии "+"типхранилищасертификатовкриптографии ",S="кодировкаименфайловвzipфайле методсжатияzip методшифрованияzip режимвосстановленияпутейфайловzip режимобработкиподкаталоговzip "+"режимсохраненияпутейzip уровеньсжатияzip ",EA="звуковоеоповещение направлениепереходакстроке позициявпотоке порядокбайтов режимблокировкиданных режимуправленияблокировкойданных "+"сервисвстроенныхпокупок состояниефоновогозадания типподписчикадоставляемыхуведомлений уровеньиспользованиязащищенногосоединенияftp ",DA="направлениепорядкасхемызапроса типдополненияпериодамисхемызапроса типконтрольнойточкисхемызапроса типобъединениясхемызапроса "+"типпараметрадоступнойтаблицысхемызапроса типсоединениясхемызапроса ",UA="httpметод автоиспользованиеобщегореквизита автопрефиксномеразадачи вариантвстроенногоязыка видиерархии видрегистранакопления "+"видтаблицывнешнегоисточникаданных записьдвиженийприпроведении заполнениепоследовательностей индексирование "+"использованиебазыпланавидоврасчета использованиебыстроговыбора использованиеобщегореквизита использованиеподчинения "+"использованиеполнотекстовогопоиска использованиеразделяемыхданныхобщегореквизита использованиереквизита "+"назначениеиспользованияприложения назначениерасширенияконфигурации направлениепередачи обновлениепредопределенныхданных "+"оперативноепроведение основноепредставлениевидарасчета основноепредставлениевидахарактеристики основноепредставлениезадачи "+"основноепредставлениепланаобмена основноепредставлениесправочника основноепредставлениесчета перемещениеграницыприпроведении "+"периодичностьномерабизнеспроцесса периодичностьномерадокумента периодичностьрегистрарасчета периодичностьрегистрасведений "+"повторноеиспользованиевозвращаемыхзначений полнотекстовыйпоискпривводепостроке принадлежностьобъекта проведение "+"разделениеаутентификацииобщегореквизита разделениеданныхобщегореквизита разделениерасширенийконфигурацииобщегореквизита "+"режимавтонумерацииобъектов режимзаписирегистра режимиспользованиямодальности "+"режимиспользованиясинхронныхвызововрасширенийплатформыивнешнихкомпонент режимповторногоиспользованиясеансов "+"режимполученияданныхвыборапривводепостроке режимсовместимости режимсовместимостиинтерфейса "+"режимуправленияблокировкойданныхпоумолчанию сериикодовпланавидовхарактеристик сериикодовпланасчетов "+"сериикодовсправочника созданиепривводе способвыбора способпоискастрокипривводепостроке способредактирования "+"типданныхтаблицывнешнегоисточникаданных типкодапланавидоврасчета типкодасправочника типмакета типномерабизнеспроцесса "+"типномерадокумента типномеразадачи типформы удалениедвижений ",_A="важностьпроблемыприменениярасширенияконфигурации вариантинтерфейсаклиентскогоприложения вариантмасштабаформклиентскогоприложения "+"вариантосновногошрифтаклиентскогоприложения вариантстандартногопериода вариантстандартнойдатыначала видграницы видкартинки "+"видотображенияполнотекстовогопоиска видрамки видсравнения видцвета видчисловогозначения видшрифта допустимаядлина допустимыйзнак "+"использованиеbyteordermark использованиеметаданныхполнотекстовогопоиска источникрасширенийконфигурации клавиша кодвозвратадиалога "+"кодировкаxbase кодировкатекста направлениепоиска направлениесортировки обновлениепредопределенныхданных обновлениеприизмененииданных "+"отображениепанелиразделов проверказаполнения режимдиалогавопрос режимзапускаклиентскогоприложения режимокругления режимоткрытияформприложения "+"режимполнотекстовогопоиска скоростьклиентскогосоединения состояниевнешнегоисточникаданных состояниеобновленияконфигурациибазыданных "+"способвыборасертификатаwindows способкодированиястроки статуссообщения типвнешнейкомпоненты типплатформы типповеденияклавишиenter "+"типэлементаинформацииовыполненииобновленияконфигурациибазыданных уровеньизоляциитранзакций хешфункция частидаты",PA=H+K+Z+W+q+V+M+L+k+P+O+v+u+l+d+n+QA+S+EA+DA+UA+_A,CA="comобъект ftpсоединение httpзапрос httpсервисответ httpсоединение wsопределения wsпрокси xbase анализданных аннотацияxs "+"блокировкаданных буфердвоичныхданных включениеxs выражениекомпоновкиданных генераторслучайныхчисел географическаясхема "+"географическиекоординаты графическаясхема группамоделиxs данныерасшифровкикомпоновкиданных двоичныеданные дендрограмма "+"диаграмма диаграммаганта диалогвыборафайла диалогвыборацвета диалогвыборашрифта диалограсписаниярегламентногозадания "+"диалогредактированиястандартногопериода диапазон документdom документhtml документацияxs доставляемоеуведомление "+"записьdom записьfastinfoset записьhtml записьjson записьxml записьzipфайла записьданных записьтекста записьузловdom "+"запрос защищенноесоединениеopenssl значенияполейрасшифровкикомпоновкиданных извлечениетекста импортxs интернетпочта "+"интернетпочтовоесообщение интернетпочтовыйпрофиль интернетпрокси интернетсоединение информациядляприложенияxs "+"использованиеатрибутаxs использованиесобытияжурналарегистрации источникдоступныхнастроеккомпоновкиданных "+"итераторузловdom картинка квалификаторыдаты квалификаторыдвоичныхданных квалификаторыстроки квалификаторычисла "+"компоновщикмакетакомпоновкиданных компоновщикнастроеккомпоновкиданных конструктормакетаоформлениякомпоновкиданных "+"конструкторнастроеккомпоновкиданных конструкторформатнойстроки линия макеткомпоновкиданных макетобластикомпоновкиданных "+"макетоформлениякомпоновкиданных маскаxs менеджеркриптографии наборсхемxml настройкикомпоновкиданных настройкисериализацииjson "+"обработкакартинок обработкарасшифровкикомпоновкиданных обходдереваdom объявлениеатрибутаxs объявлениенотацииxs "+"объявлениеэлементаxs описаниеиспользованиясобытиядоступжурналарегистрации "+"описаниеиспользованиясобытияотказвдоступежурналарегистрации описаниеобработкирасшифровкикомпоновкиданных "+"описаниепередаваемогофайла описаниетипов определениегруппыатрибутовxs определениегруппымоделиxs "+"определениеограниченияидентичностиxs определениепростоготипаxs определениесоставноготипаxs определениетипадокументаdom "+"определенияxpathxs отборкомпоновкиданных пакетотображаемыхдокументов параметрвыбора параметркомпоновкиданных "+"параметрызаписиjson параметрызаписиxml параметрычтенияxml переопределениеxs планировщик полеанализаданных "+"полекомпоновкиданных построительdom построительзапроса построительотчета построительотчетаанализаданных "+"построительсхемxml поток потоквпамяти почта почтовоесообщение преобразованиеxsl преобразованиекканоническомуxml "+"процессорвыводарезультатакомпоновкиданныхвколлекциюзначений процессорвыводарезультатакомпоновкиданныхвтабличныйдокумент "+"процессоркомпоновкиданных разыменовательпространствименdom рамка расписаниерегламентногозадания расширенноеимяxml "+"результатчтенияданных своднаядиаграмма связьпараметравыбора связьпотипу связьпотипукомпоновкиданных сериализаторxdto "+"сертификатклиентаwindows сертификатклиентафайл сертификаткриптографии сертификатыудостоверяющихцентровwindows "+"сертификатыудостоверяющихцентровфайл сжатиеданных системнаяинформация сообщениепользователю сочетаниеклавиш "+"сравнениезначений стандартнаядатаначала стандартныйпериод схемаxml схемакомпоновкиданных табличныйдокумент "+"текстовыйдокумент тестируемоеприложение типданныхxml уникальныйидентификатор фабрикаxdto файл файловыйпоток "+"фасетдлиныxs фасетколичестваразрядовдробнойчастиxs фасетмаксимальноговключающегозначенияxs "+"фасетмаксимальногоисключающегозначенияxs фасетмаксимальнойдлиныxs фасетминимальноговключающегозначенияxs "+"фасетминимальногоисключающегозначенияxs фасетминимальнойдлиныxs фасетобразцаxs фасетобщегоколичестваразрядовxs "+"фасетперечисленияxs фасетпробельныхсимволовxs фильтрузловdom форматированнаястрока форматированныйдокумент "+"фрагментxs хешированиеданных хранилищезначения цвет чтениеfastinfoset чтениеhtml чтениеjson чтениеxml чтениеzipфайла "+"чтениеданных чтениетекста чтениеузловdom шрифт элементрезультатакомпоновкиданных ",fA="comsafearray деревозначений массив соответствие списокзначений структура таблицазначений фиксированнаяструктура "+"фиксированноесоответствие фиксированныймассив ",jA=CA+fA,GA="null истина ложь неопределено",IA=A.inherit(A.NUMBER_MODE),LA={className:"string",begin:'"|\\|',end:'"|$',contains:[{begin:'""'}]},m={begin:"'",end:"'",excludeBegin:!0,excludeEnd:!0,contains:[{className:"number",begin:"\\d{4}([\\.\\\\/:-]?\\d{2}){0,5}"}]},s=A.inherit(A.C_LINE_COMMENT_MODE),o={className:"meta",begin:"#|&",end:"$",keywords:{$pattern:Q,"meta-keyword":C+g},contains:[s]},FA={className:"symbol",begin:"~",end:";|:",excludeEnd:!0},JA={className:"function",variants:[{begin:"процедура|функция",end:"\\)",keywords:"процедура функция"},{begin:"конецпроцедуры|конецфункции",keywords:"конецпроцедуры конецфункции"}],contains:[{begin:"\\(",end:"\\)",endsParent:!0,contains:[{className:"params",begin:Q,end:",",excludeEnd:!0,endsWithParent:!0,keywords:{$pattern:Q,keyword:"знач",literal:GA},contains:[IA,LA,m]},s]},A.inherit(A.TITLE_MODE,{begin:Q})]};return{name:"1C:Enterprise",case_insensitive:!0,keywords:{$pattern:Q,keyword:C,built_in:X,class:PA,type:jA,literal:GA},contains:[o,JA,s,FA,IA,LA,m]}}XjQ.exports=cuI});var $jQ=f((zEC,KjQ)=>{function duI(A){if(!A)return null;if(typeof A==="string")return A;return A.source}function luI(...A){return A.map((B)=>duI(B)).join("")}function iuI(A){let Q={ruleDeclaration:/^[a-zA-Z][a-zA-Z0-9-]*/,unexpectedChars:/[!@#$^&',?+~`|:]/},B=["ALPHA","BIT","CHAR","CR","CRLF","CTL","DIGIT","DQUOTE","HEXDIG","HTAB","LF","LWSP","OCTET","SP","VCHAR","WSP"],I=A.COMMENT(/;/,/$/),C={className:"symbol",begin:/%b[0-1]+(-[0-1]+|(\.[0-1]+)+){0,1}/},E={className:"symbol",begin:/%d[0-9]+(-[0-9]+|(\.[0-9]+)+){0,1}/},D={className:"symbol",begin:/%x[0-9A-F]+(-[0-9A-F]+|(\.[0-9A-F]+)+){0,1}/},g={className:"symbol",begin:/%[si]/},_={className:"attribute",begin:luI(Q.ruleDeclaration,/(?=\s*=)/)};return{name:"Augmented Backus-Naur Form",illegal:Q.unexpectedChars,keywords:B,contains:[_,I,C,E,D,g,A.QUOTE_STRING_MODE,A.NUMBER_MODE]}}KjQ.exports=iuI});var WjQ=f((WEC,zjQ)=>{function ZjQ(A){if(!A)return null;if(typeof A==="string")return A;return A.source}function puI(...A){return A.map((B)=>ZjQ(B)).join("")}function nuI(...A){return"("+A.map((B)=>ZjQ(B)).join("|")+")"}function auI(A){let Q=["GET","POST","HEAD","PUT","DELETE","CONNECT","OPTIONS","PATCH","TRACE"];return{name:"Apache Access Log",contains:[{className:"number",begin:/^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}(:\d{1,5})?\b/,relevance:5},{className:"number",begin:/\b\d+\b/,relevance:0},{className:"string",begin:puI(/"/,nuI(...Q)),end:/"/,keywords:Q,illegal:/\n/,relevance:5,contains:[{begin:/HTTP\/[12]\.\d'/,relevance:5}]},{className:"string",begin:/\[\d[^\]\n]{8,}\]/,illegal:/\n/,relevance:1},{className:"string",begin:/\[/,end:/\]/,illegal:/\n/,relevance:0},{className:"string",begin:/"Mozilla\/\d\.\d \(/,end:/"/,illegal:/\n/,relevance:3},{className:"string",begin:/"/,end:/"/,illegal:/\n/,relevance:0}]}}zjQ.exports=auI});var NjQ=f((qEC,qjQ)=>{function ouI(A){if(!A)return null;if(typeof A==="string")return A;return A.source}function ruI(...A){return A.map((B)=>ouI(B)).join("")}function suI(A){let Q=/[a-zA-Z_$][a-zA-Z0-9_$]*/,B=/([*]|[a-zA-Z_$][a-zA-Z0-9_$]*)/,I={className:"rest_arg",begin:/[.]{3}/,end:Q,relevance:10};return{name:"ActionScript",aliases:["as"],keywords:{keyword:"as break case catch class const continue default delete do dynamic each else extends final finally for function get if implements import in include instanceof interface internal is namespace native new override package private protected public return set static super switch this throw try typeof use var void while with",literal:"true false null undefined"},contains:[A.APOS_STRING_MODE,A.QUOTE_STRING_MODE,A.C_LINE_COMMENT_MODE,A.C_BLOCK_COMMENT_MODE,A.C_NUMBER_MODE,{className:"class",beginKeywords:"package",end:/\{/,contains:[A.TITLE_MODE]},{className:"class",beginKeywords:"class interface",end:/\{/,excludeEnd:!0,contains:[{beginKeywords:"extends implements"},A.TITLE_MODE]},{className:"meta",beginKeywords:"import include",end:/;/,keywords:{"meta-keyword":"import include"}},{className:"function",beginKeywords:"function",end:/[{;]/,excludeEnd:!0,illegal:/\S/,contains:[A.TITLE_MODE,{className:"params",begin:/\(/,end:/\)/,contains:[A.APOS_STRING_MODE,A.QUOTE_STRING_MODE,A.C_LINE_COMMENT_MODE,A.C_BLOCK_COMMENT_MODE,I]},{begin:ruI(/:\s*/,B)}]},A.METHOD_GUARD],illegal:/#/}}qjQ.exports=suI});var VjQ=f((NEC,MjQ)=>{function tuI(A){let B="[eE][-+]?\\d(_|\\d)*",I="\\d(_|\\d)*(\\.\\d(_|\\d)*)?("+B+")?",C="\\w+",D="\\b("+("\\d(_|\\d)*#\\w+(\\.\\w+)?#("+B+")?")+"|"+I+")",g="[A-Za-z](_?[A-Za-z0-9.])*",_=`[]\\{\\}%#'"`,F=A.COMMENT("--","$"),G={begin:"\\s+:\\s+",end:"\\s*(:=|;|\\)|=>|$)",illegal:`[]\\{\\}%#'"`,contains:[{beginKeywords:"loop for declare others",endsParent:!0},{className:"keyword",beginKeywords:"not null constant access function procedure in out aliased exception"},{className:"type",begin:"[A-Za-z](_?[A-Za-z0-9.])*",endsParent:!0,relevance:0}]};return{name:"Ada",case_insensitive:!0,keywords:{keyword:"abort else new return abs elsif not reverse abstract end accept entry select access exception of separate aliased exit or some all others subtype and for out synchronized array function overriding at tagged generic package task begin goto pragma terminate body private then if procedure type case in protected constant interface is raise use declare range delay limited record when delta loop rem while digits renames with do mod requeue xor",literal:"True False"},contains:[F,{className:"string",begin:/"/,end:/"/,contains:[{begin:/""/,relevance:0}]},{className:"string",begin:/'.'/},{className:"number",begin:D,relevance:0},{className:"symbol",begin:"'[A-Za-z](_?[A-Za-z0-9.])*"},{className:"title",begin:"(\\bwith\\s+)?(\\bprivate\\s+)?\\bpackage\\s+(\\bbody\\s+)?",end:"(is|$)",keywords:"package body",excludeBegin:!0,excludeEnd:!0,illegal:`[]\\{\\}%#'"`},{begin:"(\\b(with|overriding)\\s+)?\\b(function|procedure)\\s+",end:"(\\bis|\\bwith|\\brenames|\\)\\s*;)",keywords:"overriding function procedure with is renames return",returnBegin:!0,contains:[F,{className:"title",begin:"(\\bwith\\s+)?\\b(function|procedure)\\s+",end:"(\\(|\\s+|$)",excludeBegin:!0,excludeEnd:!0,illegal:`[]\\{\\}%#'"`},G,{className:"type",begin:"\\breturn\\s+",end:"(\\s+|;|$)",keywords:"return",excludeBegin:!0,excludeEnd:!0,endsParent:!0,illegal:`[]\\{\\}%#'"`}]},{className:"type",begin:"\\b(sub)?type\\s+",end:"\\s+",keywords:"type",excludeBegin:!0,illegal:`[]\\{\\}%#'"`},G]}}MjQ.exports=tuI});var RjQ=f((MEC,LjQ)=>{function euI(A){var Q={className:"built_in",begin:"\\b(void|bool|int|int8|int16|int32|int64|uint|uint8|uint16|uint32|uint64|string|ref|array|double|float|auto|dictionary)"},B={className:"symbol",begin:"[a-zA-Z0-9_]+@"},I={className:"keyword",begin:"<",end:">",contains:[Q,B]};return Q.contains=[I],B.contains=[I],{name:"AngelScript",aliases:["asc"],keywords:"for in|0 break continue while do|0 return if else case switch namespace is cast or and xor not get|0 in inout|10 out override set|0 private public const default|0 final shared external mixin|10 enum typedef funcdef this super import from interface abstract|0 try catch protected explicit property",illegal:"(^using\\s+[A-Za-z0-9_\\.]+;$|\\bfunction\\s*[^\\(])",contains:[{className:"string",begin:"'",end:"'",illegal:"\\n",contains:[A.BACKSLASH_ESCAPE],relevance:0},{className:"string",begin:'"""',end:'"""'},{className:"string",begin:'"',end:'"',illegal:"\\n",contains:[A.BACKSLASH_ESCAPE],relevance:0},A.C_LINE_COMMENT_MODE,A.C_BLOCK_COMMENT_MODE,{className:"string",begin:"^\\s*\\[",end:"\\]"},{beginKeywords:"interface namespace",end:/\{/,illegal:"[;.\\-]",contains:[{className:"symbol",begin:"[a-zA-Z0-9_]+"}]},{beginKeywords:"class",end:/\{/,illegal:"[;.\\-]",contains:[{className:"symbol",begin:"[a-zA-Z0-9_]+",contains:[{begin:"[:,]\\s*",contains:[{className:"symbol",begin:"[a-zA-Z0-9_]+"}]}]}]},Q,B,{className:"literal",begin:"\\b(null|true|false)"},{className:"number",relevance:0,begin:"(-?)(\\b0[xXbBoOdD][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?f?|\\.\\d+f?)([eE][-+]?\\d+f?)?)"}]}}LjQ.exports=euI});var yjQ=f((VEC,OjQ)=>{function AmI(A){let Q={className:"number",begin:/[$%]\d+/},B={className:"number",begin:/\d+/},I={className:"number",begin:/\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}(:\d{1,5})?/},C={className:"number",begin:/:\d{1,5}/};return{name:"Apache config",aliases:["apacheconf"],case_insensitive:!0,contains:[A.HASH_COMMENT_MODE,{className:"section",begin:/<\/?/,end:/>/,contains:[I,C,A.inherit(A.QUOTE_STRING_MODE,{relevance:0})]},{className:"attribute",begin:/\w+/,relevance:0,keywords:{nomarkup:"order deny allow setenv rewriterule rewriteengine rewritecond documentroot sethandler errordocument loadmodule options header listen serverroot servername"},starts:{end:/$/,relevance:0,keywords:{literal:"on off all deny allow"},contains:[{className:"meta",begin:/\s\[/,end:/\]$/},{className:"variable",begin:/[\$%]\{/,end:/\}/,contains:["self",Q]},I,B,A.QUOTE_STRING_MODE]}}],illegal:/\S/}}OjQ.exports=AmI});var jjQ=f((LEC,kjQ)=>{function PjQ(A){if(!A)return null;if(typeof A==="string")return A;return A.source}function fjQ(...A){return A.map((B)=>PjQ(B)).join("")}function TjQ(...A){return"("+A.map((B)=>PjQ(B)).join("|")+")"}function QmI(A){let Q=A.inherit(A.QUOTE_STRING_MODE,{illegal:null}),B={className:"params",begin:/\(/,end:/\)/,contains:["self",A.C_NUMBER_MODE,Q]},I=A.COMMENT(/--/,/$/),C=A.COMMENT(/\(\*/,/\*\)/,{contains:["self",I]}),E=[I,C,A.HASH_COMMENT_MODE],D=[/apart from/,/aside from/,/instead of/,/out of/,/greater than/,/isn't|(doesn't|does not) (equal|come before|come after|contain)/,/(greater|less) than( or equal)?/,/(starts?|ends|begins?) with/,/contained by/,/comes (before|after)/,/a (ref|reference)/,/POSIX (file|path)/,/(date|time) string/,/quoted form/],g=[/clipboard info/,/the clipboard/,/info for/,/list (disks|folder)/,/mount volume/,/path to/,/(close|open for) access/,/(get|set) eof/,/current date/,/do shell script/,/get volume settings/,/random number/,/set volume/,/system attribute/,/system info/,/time to GMT/,/(load|run|store) script/,/scripting components/,/ASCII (character|number)/,/localized string/,/choose (application|color|file|file name|folder|from list|remote application|URL)/,/display (alert|dialog)/];return{name:"AppleScript",aliases:["osascript"],keywords:{keyword:"about above after against and around as at back before beginning behind below beneath beside between but by considering contain contains continue copy div does eighth else end equal equals error every exit fifth first for fourth from front get given global if ignoring in into is it its last local me middle mod my ninth not of on onto or over prop property put ref reference repeat returning script second set seventh since sixth some tell tenth that the|0 then third through thru timeout times to transaction try until where while whose with without",literal:"AppleScript false linefeed return pi quote result space tab true",built_in:"alias application boolean class constant date file integer list number real record string text activate beep count delay launch log offset read round run say summarize write character characters contents day frontmost id item length month name paragraph paragraphs rest reverse running time version weekday word words year"},contains:[Q,A.C_NUMBER_MODE,{className:"built_in",begin:fjQ(/\b/,TjQ(...g),/\b/)},{className:"built_in",begin:/^\s*return\b/},{className:"literal",begin:/\b(text item delimiters|current application|missing value)\b/},{className:"keyword",begin:fjQ(/\b/,TjQ(...D),/\b/)},{beginKeywords:"on",illegal:/[${=;\n]/,contains:[A.UNDERSCORE_TITLE_MODE,B]},...E],illegal:/\/\/|->|=>|\[\[/}}kjQ.exports=QmI});var vjQ=f((REC,SjQ)=>{function BmI(A){let B={keyword:"if for while var new function do return void else break",literal:"BackSlash DoubleQuote false ForwardSlash Infinity NaN NewLine null PI SingleQuote Tab TextFormatting true undefined",built_in:"Abs Acos Angle Attachments Area AreaGeodetic Asin Atan Atan2 Average Bearing Boolean Buffer BufferGeodetic Ceil Centroid Clip Console Constrain Contains Cos Count Crosses Cut Date DateAdd DateDiff Day Decode DefaultValue Dictionary Difference Disjoint Distance DistanceGeodetic Distinct DomainCode DomainName Equals Exp Extent Feature FeatureSet FeatureSetByAssociation FeatureSetById FeatureSetByPortalItem FeatureSetByRelationshipName FeatureSetByTitle FeatureSetByUrl Filter First Floor Geometry GroupBy Guid HasKey Hour IIf IndexOf Intersection Intersects IsEmpty IsNan IsSelfIntersecting Length LengthGeodetic Log Max Mean Millisecond Min Minute Month MultiPartToSinglePart Multipoint NextSequenceValue Now Number OrderBy Overlaps Point Polygon Polyline Portal Pow Random Relate Reverse RingIsClockWise Round Second SetGeometry Sin Sort Sqrt Stdev Sum SymmetricDifference Tan Text Timestamp Today ToLocal Top Touches ToUTC TrackCurrentTime TrackGeometryWindow TrackIndex TrackStartTime TrackWindow TypeOf Union UrlEncode Variance Weekday When Within Year "},I={className:"symbol",begin:"\\$[datastore|feature|layer|map|measure|sourcefeature|sourcelayer|targetfeature|targetlayer|value|view]+"},C={className:"number",variants:[{begin:"\\b(0[bB][01]+)"},{begin:"\\b(0[oO][0-7]+)"},{begin:A.C_NUMBER_RE}],relevance:0},E={className:"subst",begin:"\\$\\{",end:"\\}",keywords:B,contains:[]},D={className:"string",begin:"`",end:"`",contains:[A.BACKSLASH_ESCAPE,E]};E.contains=[A.APOS_STRING_MODE,A.QUOTE_STRING_MODE,D,C,A.REGEXP_MODE];let g=E.contains.concat([A.C_BLOCK_COMMENT_MODE,A.C_LINE_COMMENT_MODE]);return{name:"ArcGIS Arcade",keywords:B,contains:[A.APOS_STRING_MODE,A.QUOTE_STRING_MODE,D,A.C_LINE_COMMENT_MODE,A.C_BLOCK_COMMENT_MODE,I,C,{begin:/[{,]\s*/,relevance:0,contains:[{begin:"[A-Za-z_][0-9A-Za-z_]*\\s*:",returnBegin:!0,relevance:0,contains:[{className:"attr",begin:"[A-Za-z_][0-9A-Za-z_]*",relevance:0}]}]},{begin:"("+A.RE_STARTERS_RE+"|\\b(return)\\b)\\s*",keywords:"return",contains:[A.C_LINE_COMMENT_MODE,A.C_BLOCK_COMMENT_MODE,A.REGEXP_MODE,{className:"function",begin:"(\\(.*?\\)|[A-Za-z_][0-9A-Za-z_]*)\\s*=>",returnBegin:!0,end:"\\s*=>",contains:[{className:"params",variants:[{begin:"[A-Za-z_][0-9A-Za-z_]*"},{begin:/\(\s*\)/},{begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:B,contains:g}]}]}],relevance:0},{className:"function",beginKeywords:"function",end:/\{/,excludeEnd:!0,contains:[A.inherit(A.TITLE_MODE,{begin:"[A-Za-z_][0-9A-Za-z_]*"}),{className:"params",begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,contains:g}],illegal:/\[|%/},{begin:/\$[(.]/}],illegal:/#(?!!)/}}SjQ.exports=BmI});var bjQ=f((OEC,xjQ)=>{function ImI(A){if(!A)return null;if(typeof A==="string")return A;return A.source}function CmI(A){return GWA("(?=",A,")")}function ps(A){return GWA("(",A,")?")}function GWA(...A){return A.map((B)=>ImI(B)).join("")}function EmI(A){let Q=A.COMMENT("//","$",{contains:[{begin:/\\\n/}]}),B="decltype\\(auto\\)",I="[a-zA-Z_]\\w*::",C="<[^<>]+>",E="(decltype\\(auto\\)|"+ps("[a-zA-Z_]\\w*::")+"[a-zA-Z_]\\w*"+ps("<[^<>]+>")+")",D={className:"keyword",begin:"\\b[a-z\\d_]*_t\\b"},g="\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4,8}|[0-7]{3}|\\S)",_={className:"string",variants:[{begin:'(u8?|U|L)?"',end:'"',illegal:"\\n",contains:[A.BACKSLASH_ESCAPE]},{begin:"(u8?|U|L)?'(\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4,8}|[0-7]{3}|\\S)|.)",end:"'",illegal:"."},A.END_SAME_AS_BEGIN({begin:/(?:u8?|U|L)?R"([^()\\ ]{0,16})\(/,end:/\)([^()\\ ]{0,16})"/})]},F={className:"number",variants:[{begin:"\\b(0b[01']+)"},{begin:"(-?)\\b([\\d']+(\\.[\\d']*)?|\\.[\\d']+)((ll|LL|l|L)(u|U)?|(u|U)(ll|LL|l|L)?|f|F|b|B)"},{begin:"(-?)(\\b0[xX][a-fA-F0-9']+|(\\b[\\d']+(\\.[\\d']*)?|\\.[\\d']+)([eE][-+]?[\\d']+)?)"}],relevance:0},G={className:"meta",begin:/#\s*[a-z]+\b/,end:/$/,keywords:{"meta-keyword":"if else elif endif define undef warning error line pragma _Pragma ifdef ifndef include"},contains:[{begin:/\\\n/,relevance:0},A.inherit(_,{className:"meta-string"}),{className:"meta-string",begin:/<.*?>/},Q,A.C_BLOCK_COMMENT_MODE]},U={className:"title",begin:ps("[a-zA-Z_]\\w*::")+A.IDENT_RE,relevance:0},X=ps("[a-zA-Z_]\\w*::")+A.IDENT_RE+"\\s*\\(",K={keyword:"int float while private char char8_t char16_t char32_t catch import module export virtual operator sizeof dynamic_cast|10 typedef const_cast|10 const for static_cast|10 union namespace unsigned long volatile static protected bool template mutable if public friend do goto auto void enum else break extern using asm case typeid wchar_t short reinterpret_cast|10 default double register explicit signed typename try this switch continue inline delete alignas alignof constexpr consteval constinit decltype concept co_await co_return co_yield requires noexcept static_assert thread_local restrict final override atomic_bool atomic_char atomic_schar atomic_uchar atomic_short atomic_ushort atomic_int atomic_uint atomic_long atomic_ulong atomic_llong atomic_ullong new throw return and and_eq bitand bitor compl not not_eq or or_eq xor xor_eq",built_in:"_Bool _Complex _Imaginary",_relevance_hints:["asin","atan2","atan","calloc","ceil","cosh","cos","exit","exp","fabs","floor","fmod","fprintf","fputs","free","frexp","auto_ptr","deque","list","queue","stack","vector","map","set","pair","bitset","multiset","multimap","unordered_set","fscanf","future","isalnum","isalpha","iscntrl","isdigit","isgraph","islower","isprint","ispunct","isspace","isupper","isxdigit","tolower","toupper","labs","ldexp","log10","log","malloc","realloc","memchr","memcmp","memcpy","memset","modf","pow","printf","putchar","puts","scanf","sinh","sin","snprintf","sprintf","sqrt","sscanf","strcat","strchr","strcmp","strcpy","strcspn","strlen","strncat","strncmp","strncpy","strpbrk","strrchr","strspn","strstr","tanh","tan","unordered_map","unordered_multiset","unordered_multimap","priority_queue","make_pair","array","shared_ptr","abort","terminate","abs","acos","vfprintf","vprintf","vsprintf","endl","initializer_list","unique_ptr","complex","imaginary","std","string","wstring","cin","cout","cerr","clog","stdin","stdout","stderr","stringstream","istringstream","ostringstream"],literal:"true false nullptr NULL"},Z={className:"function.dispatch",relevance:0,keywords:K,begin:GWA(/\b/,/(?!decltype)/,/(?!if)/,/(?!for)/,/(?!while)/,A.IDENT_RE,CmI(/\s*\(/))},W=[Z,G,D,Q,A.C_BLOCK_COMMENT_MODE,F,_],q={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:K,contains:W.concat([{begin:/\(/,end:/\)/,keywords:K,contains:W.concat(["self"]),relevance:0}]),relevance:0},V={className:"function",begin:"("+E+"[\\*&\\s]+)+"+X,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:K,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:"decltype\\(auto\\)",keywords:K,relevance:0},{begin:X,returnBegin:!0,contains:[U],relevance:0},{begin:/::/,relevance:0},{begin:/:/,endsWithParent:!0,contains:[_,F]},{className:"params",begin:/\(/,end:/\)/,keywords:K,relevance:0,contains:[Q,A.C_BLOCK_COMMENT_MODE,_,F,D,{begin:/\(/,end:/\)/,keywords:K,relevance:0,contains:["self",Q,A.C_BLOCK_COMMENT_MODE,_,F,D]}]},D,Q,A.C_BLOCK_COMMENT_MODE,G]};return{name:"C++",aliases:["cc","c++","h++","hpp","hh","hxx","cxx"],keywords:K,illegal:"</",classNameAliases:{"function.dispatch":"built_in"},contains:[].concat(q,V,Z,W,[G,{begin:"\\b(deque|list|queue|priority_queue|pair|stack|vector|map|set|bitset|multiset|multimap|unordered_map|unordered_set|unordered_multiset|unordered_multimap|array)\\s*<",end:">",keywords:K,contains:["self",D]},{begin:A.IDENT_RE+"::",keywords:K},{className:"class",beginKeywords:"enum class struct union",end:/[{;:<>=]/,contains:[{beginKeywords:"final class struct"},A.TITLE_MODE]}]),exports:{preprocessor:G,strings:_,keywords:K}}}function DmI(A){let Q={keyword:"boolean byte word String",built_in:"KeyboardController MouseController SoftwareSerial EthernetServer EthernetClient LiquidCrystal RobotControl GSMVoiceCall EthernetUDP EsploraTFT HttpClient RobotMotor WiFiClient GSMScanner FileSystem Scheduler GSMServer YunClient YunServer IPAddress GSMClient GSMModem Keyboard Ethernet Console GSMBand Esplora Stepper Process WiFiUDP GSM_SMS Mailbox USBHost Firmata PImage Client Server GSMPIN FileIO Bridge Serial EEPROM Stream Mouse Audio Servo File Task GPRS WiFi Wire TFT GSM SPI SD ",_:"setup loop runShellCommandAsynchronously analogWriteResolution retrieveCallingNumber printFirmwareVersion analogReadResolution sendDigitalPortPair noListenOnLocalhost readJoystickButton setFirmwareVersion readJoystickSwitch scrollDisplayRight getVoiceCallStatus scrollDisplayLeft writeMicroseconds delayMicroseconds beginTransmission getSignalStrength runAsynchronously getAsynchronously listenOnLocalhost getCurrentCarrier readAccelerometer messageAvailable sendDigitalPorts lineFollowConfig countryNameWrite runShellCommand readStringUntil rewindDirectory readTemperature setClockDivider readLightSensor endTransmission analogReference detachInterrupt countryNameRead attachInterrupt encryptionType readBytesUntil robotNameWrite readMicrophone robotNameRead cityNameWrite userNameWrite readJoystickY readJoystickX mouseReleased openNextFile scanNetworks noInterrupts digitalWrite beginSpeaker mousePressed isActionDone mouseDragged displayLogos noAutoscroll addParameter remoteNumber getModifiers keyboardRead userNameRead waitContinue processInput parseCommand printVersion readNetworks writeMessage blinkVersion cityNameRead readMessage setDataMode parsePacket isListening setBitOrder beginPacket isDirectory motorsWrite drawCompass digitalRead clearScreen serialEvent rightToLeft setTextSize leftToRight requestFrom keyReleased compassRead analogWrite interrupts WiFiServer disconnect playMelody parseFloat autoscroll getPINUsed setPINUsed setTimeout sendAnalog readSlider analogRead beginWrite createChar motorsStop keyPressed tempoWrite readButton subnetMask debugPrint macAddress writeGreen randomSeed attachGPRS readString sendString remotePort releaseAll mouseMoved background getXChange getYChange answerCall getResult voiceCall endPacket constrain getSocket writeJSON getButton available connected findUntil readBytes exitValue readGreen writeBlue startLoop IPAddress isPressed sendSysex pauseMode gatewayIP setCursor getOemKey tuneWrite noDisplay loadImage switchPIN onRequest onReceive changePIN playFile noBuffer parseInt overflow checkPIN knobRead beginTFT bitClear updateIR bitWrite position writeRGB highByte writeRed setSpeed readBlue noStroke remoteIP transfer shutdown hangCall beginSMS endWrite attached maintain noCursor checkReg checkPUK shiftOut isValid shiftIn pulseIn connect println localIP pinMode getIMEI display noBlink process getBand running beginSD drawBMP lowByte setBand release bitRead prepare pointTo readRed setMode noFill remove listen stroke detach attach noTone exists buffer height bitSet circle config cursor random IRread setDNS endSMS getKey micros millis begin print write ready flush width isPIN blink clear press mkdir rmdir close point yield image BSSID click delay read text move peek beep rect line open seek fill size turn stop home find step tone sqrt RSSI SSID end bit tan cos sin pow map abs max min get run put",literal:"DIGITAL_MESSAGE FIRMATA_STRING ANALOG_MESSAGE REPORT_DIGITAL REPORT_ANALOG INPUT_PULLUP SET_PIN_MODE INTERNAL2V56 SYSTEM_RESET LED_BUILTIN INTERNAL1V1 SYSEX_START INTERNAL EXTERNAL DEFAULT OUTPUT INPUT HIGH LOW"},B=EmI(A),I=B.keywords;return I.keyword+=" "+Q.keyword,I.literal+=" "+Q.literal,I.built_in+=" "+Q.built_in,I._+=" "+Q._,B.name="Arduino",B.aliases=["ino"],B.supersetOf="cpp",B}xjQ.exports=DmI});var ujQ=f((yEC,hjQ)=>{function gmI(A){let Q={variants:[A.COMMENT("^[ \\t]*(?=#)","$",{relevance:0,excludeBegin:!0}),A.COMMENT("[;@]","$",{relevance:0}),A.C_LINE_COMMENT_MODE,A.C_BLOCK_COMMENT_MODE]};return{name:"ARM Assembly",case_insensitive:!0,aliases:["arm"],keywords:{$pattern:"\\.?"+A.IDENT_RE,meta:".2byte .4byte .align .ascii .asciz .balign .byte .code .data .else .end .endif .endm .endr .equ .err .exitm .extern .global .hword .if .ifdef .ifndef .include .irp .long .macro .rept .req .section .set .skip .space .text .word .arm .thumb .code16 .code32 .force_thumb .thumb_func .ltorg ALIAS ALIGN ARM AREA ASSERT ATTR CN CODE CODE16 CODE32 COMMON CP DATA DCB DCD DCDU DCDO DCFD DCFDU DCI DCQ DCQU DCW DCWU DN ELIF ELSE END ENDFUNC ENDIF ENDP ENTRY EQU EXPORT EXPORTAS EXTERN FIELD FILL FUNCTION GBLA GBLL GBLS GET GLOBAL IF IMPORT INCBIN INCLUDE INFO KEEP LCLA LCLL LCLS LTORG MACRO MAP MEND MEXIT NOFP OPT PRESERVE8 PROC QN READONLY RELOC REQUIRE REQUIRE8 RLIST FN ROUT SETA SETL SETS SN SPACE SUBT THUMB THUMBX TTL WHILE WEND ",built_in:"r0 r1 r2 r3 r4 r5 r6 r7 r8 r9 r10 r11 r12 r13 r14 r15 pc lr sp ip sl sb fp a1 a2 a3 a4 v1 v2 v3 v4 v5 v6 v7 v8 f0 f1 f2 f3 f4 f5 f6 f7 p0 p1 p2 p3 p4 p5 p6 p7 p8 p9 p10 p11 p12 p13 p14 p15 c0 c1 c2 c3 c4 c5 c6 c7 c8 c9 c10 c11 c12 c13 c14 c15 q0 q1 q2 q3 q4 q5 q6 q7 q8 q9 q10 q11 q12 q13 q14 q15 cpsr_c cpsr_x cpsr_s cpsr_f cpsr_cx cpsr_cxs cpsr_xs cpsr_xsf cpsr_sf cpsr_cxsf spsr_c spsr_x spsr_s spsr_f spsr_cx spsr_cxs spsr_xs spsr_xsf spsr_sf spsr_cxsf s0 s1 s2 s3 s4 s5 s6 s7 s8 s9 s10 s11 s12 s13 s14 s15 s16 s17 s18 s19 s20 s21 s22 s23 s24 s25 s26 s27 s28 s29 s30 s31 d0 d1 d2 d3 d4 d5 d6 d7 d8 d9 d10 d11 d12 d13 d14 d15 d16 d17 d18 d19 d20 d21 d22 d23 d24 d25 d26 d27 d28 d29 d30 d31 {PC} {VAR} {TRUE} {FALSE} {OPT} {CONFIG} {ENDIAN} {CODESIZE} {CPU} {FPU} {ARCHITECTURE} {PCSTOREOFFSET} {ARMASM_VERSION} {INTER} {ROPI} {RWPI} {SWST} {NOSWST} . @"},contains:[{className:"keyword",begin:"\\b(adc|(qd?|sh?|u[qh]?)?add(8|16)?|usada?8|(q|sh?|u[qh]?)?(as|sa)x|and|adrl?|sbc|rs[bc]|asr|b[lx]?|blx|bxj|cbn?z|tb[bh]|bic|bfc|bfi|[su]bfx|bkpt|cdp2?|clz|clrex|cmp|cmn|cpsi[ed]|cps|setend|dbg|dmb|dsb|eor|isb|it[te]{0,3}|lsl|lsr|ror|rrx|ldm(([id][ab])|f[ds])?|ldr((s|ex)?[bhd])?|movt?|mvn|mra|mar|mul|[us]mull|smul[bwt][bt]|smu[as]d|smmul|smmla|mla|umlaal|smlal?([wbt][bt]|d)|mls|smlsl?[ds]|smc|svc|sev|mia([bt]{2}|ph)?|mrr?c2?|mcrr2?|mrs|msr|orr|orn|pkh(tb|bt)|rbit|rev(16|sh)?|sel|[su]sat(16)?|nop|pop|push|rfe([id][ab])?|stm([id][ab])?|str(ex)?[bhd]?|(qd?)?sub|(sh?|q|u[qh]?)?sub(8|16)|[su]xt(a?h|a?b(16)?)|srs([id][ab])?|swpb?|swi|smi|tst|teq|wfe|wfi|yield)(eq|ne|cs|cc|mi|pl|vs|vc|hi|ls|ge|lt|gt|le|al|hs|lo)?[sptrx]?(?=\\s)"},Q,A.QUOTE_STRING_MODE,{className:"string",begin:"'",end:"[^\\\\]'",relevance:0},{className:"title",begin:"\\|",end:"\\|",illegal:"\\n",relevance:0},{className:"number",variants:[{begin:"[#$=]?0x[0-9a-f]+"},{begin:"[#$=]?0b[01]+"},{begin:"[#$=]\\d+"},{begin:"\\b\\d+"}],relevance:0},{className:"symbol",variants:[{begin:"^[ \\t]*[a-z_\\.\\$][a-z0-9_\\.\\$]+:"},{begin:"^[a-z_\\.\\$][a-z0-9_\\.\\$]+"},{begin:"[=#]\\w+"}],relevance:0}]}}hjQ.exports=gmI});var ljQ=f((fEC,djQ)=>{function cjQ(A){if(!A)return null;if(typeof A==="string")return A;return A.source}function mjQ(A){return T$("(?=",A,")")}function _mI(A){return T$("(",A,")?")}function T$(...A){return A.map((B)=>cjQ(B)).join("")}function wmI(...A){return"("+A.map((B)=>cjQ(B)).join("|")+")"}function FmI(A){let Q=T$(/[A-Z_]/,_mI(/[A-Z0-9_.-]*:/),/[A-Z0-9_.-]*/),B=/[A-Za-z0-9._:-]+/,I={className:"symbol",begin:/&[a-z]+;|&#[0-9]+;|&#x[a-f0-9]+;/},C={begin:/\s/,contains:[{className:"meta-keyword",begin:/#?[a-z_][a-z1-9_-]+/,illegal:/\n/}]},E=A.inherit(C,{begin:/\(/,end:/\)/}),D=A.inherit(A.APOS_STRING_MODE,{className:"meta-string"}),g=A.inherit(A.QUOTE_STRING_MODE,{className:"meta-string"}),_={endsWithParent:!0,illegal:/</,relevance:0,contains:[{className:"attr",begin:B,relevance:0},{begin:/=\s*/,relevance:0,contains:[{className:"string",endsParent:!0,variants:[{begin:/"/,end:/"/,contains:[I]},{begin:/'/,end:/'/,contains:[I]},{begin:/[^\s"'=<>`]+/}]}]}]};return{name:"HTML, XML",aliases:["html","xhtml","rss","atom","xjb","xsd","xsl","plist","wsf","svg"],case_insensitive:!0,contains:[{className:"meta",begin:/<![a-z]/,end:/>/,relevance:10,contains:[C,g,D,E,{begin:/\[/,end:/\]/,contains:[{className:"meta",begin:/<![a-z]/,end:/>/,contains:[C,E,g,D]}]}]},A.COMMENT(/<!--/,/-->/,{relevance:10}),{begin:/<!\[CDATA\[/,end:/\]\]>/,relevance:10},I,{className:"meta",begin:/<\?xml/,end:/\?>/,relevance:10},{className:"tag",begin:/<style(?=\s|>)/,end:/>/,keywords:{name:"style"},contains:[_],starts:{end:/<\/style>/,returnEnd:!0,subLanguage:["css","xml"]}},{className:"tag",begin:/<script(?=\s|>)/,end:/>/,keywords:{name:"script"},contains:[_],starts:{end:/<\/script>/,returnEnd:!0,subLanguage:["javascript","handlebars","xml"]}},{className:"tag",begin:/<>|<\/>/},{className:"tag",begin:T$(/</,mjQ(T$(Q,wmI(/\/>/,/>/,/\s/)))),end:/\/?>/,contains:[{className:"name",begin:Q,relevance:0,starts:_}]},{className:"tag",begin:T$(/<\//,mjQ(T$(Q,/>/))),contains:[{className:"name",begin:Q,relevance:0},{begin:/>/,relevance:0,endsParent:!0}]}]}}djQ.exports=FmI});var njQ=f((TEC,pjQ)=>{function JmI(A){if(!A)return null;if(typeof A==="string")return A;return A.source}function ijQ(...A){return A.map((B)=>JmI(B)).join("")}function GmI(A){let Q={begin:"^'{3,}[ \\t]*$",relevance:10},B=[{begin:/\\[*_`]/},{begin:/\\\\\*{2}[^\n]*?\*{2}/},{begin:/\\\\_{2}[^\n]*_{2}/},{begin:/\\\\`{2}[^\n]*`{2}/},{begin:/[:;}][*_`](?![*_`])/}],I=[{className:"strong",begin:/\*{2}([^\n]+?)\*{2}/},{className:"strong",begin:ijQ(/\*\*/,/((\*(?!\*)|\\[^\n]|[^*\n\\])+\n)+/,/(\*(?!\*)|\\[^\n]|[^*\n\\])*/,/\*\*/),relevance:0},{className:"strong",begin:/\B\*(\S|\S[^\n]*?\S)\*(?!\w)/},{className:"strong",begin:/\*[^\s]([^\n]+\n)+([^\n]+)\*/}],C=[{className:"emphasis",begin:/_{2}([^\n]+?)_{2}/},{className:"emphasis",begin:ijQ(/__/,/((_(?!_)|\\[^\n]|[^_\n\\])+\n)+/,/(_(?!_)|\\[^\n]|[^_\n\\])*/,/__/),relevance:0},{className:"emphasis",begin:/\b_(\S|\S[^\n]*?\S)_(?!\w)/},{className:"emphasis",begin:/_[^\s]([^\n]+\n)+([^\n]+)_/},{className:"emphasis",begin:"\\B'(?!['\\s])",end:"(\\n{2}|')",contains:[{begin:"\\\\'\\w",relevance:0}],relevance:0}],E={className:"symbol",begin:"^(NOTE|TIP|IMPORTANT|WARNING|CAUTION):\\s+",relevance:10},D={className:"bullet",begin:"^(\\*+|-+|\\.+|[^\\n]+?::)\\s+"};return{name:"AsciiDoc",aliases:["adoc"],contains:[A.COMMENT("^/{4,}\\n","\\n/{4,}$",{relevance:10}),A.COMMENT("^//","$",{relevance:0}),{className:"title",begin:"^\\.\\w.*$"},{begin:"^[=\\*]{4,}\\n",end:"\\n^[=\\*]{4,}$",relevance:10},{className:"section",relevance:10,variants:[{begin:"^(={1,6})[ \t].+?([ \t]\\1)?$"},{begin:"^[^\\[\\]\\n]+?\\n[=\\-~\\^\\+]{2,}$"}]},{className:"meta",begin:"^:.+?:",end:"\\s",excludeEnd:!0,relevance:10},{className:"meta",begin:"^\\[.+?\\]$",relevance:0},{className:"quote",begin:"^_{4,}\\n",end:"\\n_{4,}$",relevance:10},{className:"code",begin:"^[\\-\\.]{4,}\\n",end:"\\n[\\-\\.]{4,}$",relevance:10},{begin:"^\\+{4,}\\n",end:"\\n\\+{4,}$",contains:[{begin:"<",end:">",subLanguage:"xml",relevance:0}],relevance:10},D,E,...B,...I,...C,{className:"string",variants:[{begin:"``.+?''"},{begin:"`.+?'"}]},{className:"code",begin:/`{2}/,end:/(\n{2}|`{2})/},{className:"code",begin:"(`.+?`|\\+.+?\\+)",relevance:0},{className:"code",begin:"^[ \\t]",end:"$",relevance:0},Q,{begin:"(link:)?(http|https|ftp|file|irc|image:?):\\S+?\\[[^[]*?\\]",returnBegin:!0,contains:[{begin:"(link|image:?):",relevance:0},{className:"link",begin:"\\w",end:"[^\\[]+",relevance:0},{className:"string",begin:"\\[",end:"\\]",excludeBegin:!0,excludeEnd:!0,relevance:0}],relevance:10}]}}pjQ.exports=GmI});var ojQ=f((PEC,ajQ)=>{function YmI(A){if(!A)return null;if(typeof A==="string")return A;return A.source}function YWA(...A){return A.map((B)=>YmI(B)).join("")}function UmI(A){let Q="false synchronized int abstract float private char boolean static null if const for true while long throw strictfp finally protected import native final return void enum else extends implements break transient new catch instanceof byte super volatile case assert short package default double public try this switch continue throws privileged aspectOf adviceexecution proceed cflowbelow cflow initialization preinitialization staticinitialization withincode target within execution getWithinTypeName handler thisJoinPoint thisJoinPointStaticPart thisEnclosingJoinPointStaticPart declare parents warning error soft precedence thisAspectInstance",B="get set args call";return{name:"AspectJ",keywords:Q,illegal:/<\/|#/,contains:[A.COMMENT(/\/\*\*/,/\*\//,{relevance:0,contains:[{begin:/\w+@/,relevance:0},{className:"doctag",begin:/@[A-Za-z]+/}]}),A.C_LINE_COMMENT_MODE,A.C_BLOCK_COMMENT_MODE,A.APOS_STRING_MODE,A.QUOTE_STRING_MODE,{className:"class",beginKeywords:"aspect",end:/[{;=]/,excludeEnd:!0,illegal:/[:;"\[\]]/,contains:[{beginKeywords:"extends implements pertypewithin perthis pertarget percflowbelow percflow issingleton"},A.UNDERSCORE_TITLE_MODE,{begin:/\([^\)]*/,end:/[)]+/,keywords:Q+" get set args call",excludeEnd:!1}]},{className:"class",beginKeywords:"class interface",end:/[{;=]/,excludeEnd:!0,relevance:0,keywords:"class interface",illegal:/[:"\[\]]/,contains:[{beginKeywords:"extends implements"},A.UNDERSCORE_TITLE_MODE]},{beginKeywords:"pointcut after before around throwing returning",end:/[)]/,excludeEnd:!1,illegal:/["\[\]]/,contains:[{begin:YWA(A.UNDERSCORE_IDENT_RE,/\s*\(/),returnBegin:!0,contains:[A.UNDERSCORE_TITLE_MODE]}]},{begin:/[:]/,returnBegin:!0,end:/[{;]/,relevance:0,excludeEnd:!1,keywords:Q,illegal:/["\[\]]/,contains:[{begin:YWA(A.UNDERSCORE_IDENT_RE,/\s*\(/),keywords:Q+" get set args call",relevance:0},A.QUOTE_STRING_MODE]},{beginKeywords:"new throw",relevance:0},{className:"function",begin:/\w+ +\w+(\.\w+)?\s*\([^\)]*\)\s*((throws)[\w\s,]+)?[\{;]/,returnBegin:!0,end:/[{;=]/,keywords:Q,excludeEnd:!0,contains:[{begin:YWA(A.UNDERSCORE_IDENT_RE,/\s*\(/),returnBegin:!0,relevance:0,contains:[A.UNDERSCORE_TITLE_MODE]},{className:"params",begin:/\(/,end:/\)/,relevance:0,keywords:Q,contains:[A.APOS_STRING_MODE,A.QUOTE_STRING_MODE,A.C_NUMBER_MODE,A.C_BLOCK_COMMENT_MODE]},A.C_LINE_COMMENT_MODE,A.C_BLOCK_COMMENT_MODE]},A.C_NUMBER_MODE,{className:"meta",begin:/@[A-Za-z]+/}]}}ajQ.exports=UmI});var sjQ=f((kEC,rjQ)=>{function XmI(A){let Q={begin:"`[\\s\\S]"};return{name:"AutoHotkey",case_insensitive:!0,aliases:["ahk"],keywords:{keyword:"Break Continue Critical Exit ExitApp Gosub Goto New OnExit Pause return SetBatchLines SetTimer Suspend Thread Throw Until ahk_id ahk_class ahk_pid ahk_exe ahk_group",literal:"true false NOT AND OR",built_in:"ComSpec Clipboard ClipboardAll ErrorLevel"},contains:[Q,A.inherit(A.QUOTE_STRING_MODE,{contains:[Q]}),A.COMMENT(";","$",{relevance:0}),A.C_BLOCK_COMMENT_MODE,{className:"number",begin:A.NUMBER_RE,relevance:0},{className:"variable",begin:"%[a-zA-Z0-9#_$@]+%"},{className:"built_in",begin:"^\\s*\\w+\\s*(,|%)"},{className:"title",variants:[{begin:'^[^\\n";]+::(?!=)'},{begin:'^[^\\n";]+:(?!=)',relevance:0}]},{className:"meta",begin:"^\\s*#\\w+",end:"$",relevance:0},{className:"built_in",begin:"A_[a-zA-Z0-9]+"},{begin:",\\s*,"}]}}rjQ.exports=XmI});var ejQ=f((jEC,tjQ)=>{function HmI(A){let Q="ByRef Case Const ContinueCase ContinueLoop Dim Do Else ElseIf EndFunc EndIf EndSelect EndSwitch EndWith Enum Exit ExitLoop For Func Global If In Local Next ReDim Return Select Static Step Switch Then To Until Volatile WEnd While With",B=["EndRegion","forcedef","forceref","ignorefunc","include","include-once","NoTrayIcon","OnAutoItStartRegister","pragma","Region","RequireAdmin","Tidy_Off","Tidy_On","Tidy_Parameters"],I="True False And Null Not Or Default",C="Abs ACos AdlibRegister AdlibUnRegister Asc AscW ASin Assign ATan AutoItSetOption AutoItWinGetTitle AutoItWinSetTitle Beep Binary BinaryLen BinaryMid BinaryToString BitAND BitNOT BitOR BitRotate BitShift BitXOR BlockInput Break Call CDTray Ceiling Chr ChrW ClipGet ClipPut ConsoleRead ConsoleWrite ConsoleWriteError ControlClick ControlCommand ControlDisable ControlEnable ControlFocus ControlGetFocus ControlGetHandle ControlGetPos ControlGetText ControlHide ControlListView ControlMove ControlSend ControlSetText ControlShow ControlTreeView Cos Dec DirCopy DirCreate DirGetSize DirMove DirRemove DllCall DllCallAddress DllCallbackFree DllCallbackGetPtr DllCallbackRegister DllClose DllOpen DllStructCreate DllStructGetData DllStructGetPtr DllStructGetSize DllStructSetData DriveGetDrive DriveGetFileSystem DriveGetLabel DriveGetSerial DriveGetType DriveMapAdd DriveMapDel DriveMapGet DriveSetLabel DriveSpaceFree DriveSpaceTotal DriveStatus EnvGet EnvSet EnvUpdate Eval Execute Exp FileChangeDir FileClose FileCopy FileCreateNTFSLink FileCreateShortcut FileDelete FileExists FileFindFirstFile FileFindNextFile FileFlush FileGetAttrib FileGetEncoding FileGetLongName FileGetPos FileGetShortcut FileGetShortName FileGetSize FileGetTime FileGetVersion FileInstall FileMove FileOpen FileOpenDialog FileRead FileReadLine FileReadToArray FileRecycle FileRecycleEmpty FileSaveDialog FileSelectFolder FileSetAttrib FileSetEnd FileSetPos FileSetTime FileWrite FileWriteLine Floor FtpSetProxy FuncName GUICreate GUICtrlCreateAvi GUICtrlCreateButton GUICtrlCreateCheckbox GUICtrlCreateCombo GUICtrlCreateContextMenu GUICtrlCreateDate GUICtrlCreateDummy GUICtrlCreateEdit GUICtrlCreateGraphic GUICtrlCreateGroup GUICtrlCreateIcon GUICtrlCreateInput GUICtrlCreateLabel GUICtrlCreateList GUICtrlCreateListView GUICtrlCreateListViewItem GUICtrlCreateMenu GUICtrlCreateMenuItem GUICtrlCreateMonthCal GUICtrlCreateObj GUICtrlCreatePic GUICtrlCreateProgress GUICtrlCreateRadio GUICtrlCreateSlider GUICtrlCreateTab GUICtrlCreateTabItem GUICtrlCreateTreeView GUICtrlCreateTreeViewItem GUICtrlCreateUpdown GUICtrlDelete GUICtrlGetHandle GUICtrlGetState GUICtrlRead GUICtrlRecvMsg GUICtrlRegisterListViewSort GUICtrlSendMsg GUICtrlSendToDummy GUICtrlSetBkColor GUICtrlSetColor GUICtrlSetCursor GUICtrlSetData GUICtrlSetDefBkColor GUICtrlSetDefColor GUICtrlSetFont GUICtrlSetGraphic GUICtrlSetImage GUICtrlSetLimit GUICtrlSetOnEvent GUICtrlSetPos GUICtrlSetResizing GUICtrlSetState GUICtrlSetStyle GUICtrlSetTip GUIDelete GUIGetCursorInfo GUIGetMsg GUIGetStyle GUIRegisterMsg GUISetAccelerators GUISetBkColor GUISetCoord GUISetCursor GUISetFont GUISetHelp GUISetIcon GUISetOnEvent GUISetState GUISetStyle GUIStartGroup GUISwitch Hex HotKeySet HttpSetProxy HttpSetUserAgent HWnd InetClose InetGet InetGetInfo InetGetSize InetRead IniDelete IniRead IniReadSection IniReadSectionNames IniRenameSection IniWrite IniWriteSection InputBox Int IsAdmin IsArray IsBinary IsBool IsDeclared IsDllStruct IsFloat IsFunc IsHWnd IsInt IsKeyword IsNumber IsObj IsPtr IsString Log MemGetStats Mod MouseClick MouseClickDrag MouseDown MouseGetCursor MouseGetPos MouseMove MouseUp MouseWheel MsgBox Number ObjCreate ObjCreateInterface ObjEvent ObjGet ObjName OnAutoItExitRegister OnAutoItExitUnRegister Ping PixelChecksum PixelGetColor PixelSearch ProcessClose ProcessExists ProcessGetStats ProcessList ProcessSetPriority ProcessWait ProcessWaitClose ProgressOff ProgressOn ProgressSet Ptr Random RegDelete RegEnumKey RegEnumVal RegRead RegWrite Round Run RunAs RunAsWait RunWait Send SendKeepActive SetError SetExtended ShellExecute ShellExecuteWait Shutdown Sin Sleep SoundPlay SoundSetWaveVolume SplashImageOn SplashOff SplashTextOn Sqrt SRandom StatusbarGetText StderrRead StdinWrite StdioClose StdoutRead String StringAddCR StringCompare StringFormat StringFromASCIIArray StringInStr StringIsAlNum StringIsAlpha StringIsASCII StringIsDigit StringIsFloat StringIsInt StringIsLower StringIsSpace StringIsUpper StringIsXDigit StringLeft StringLen StringLower StringMid StringRegExp StringRegExpReplace StringReplace StringReverse StringRight StringSplit StringStripCR StringStripWS StringToASCIIArray StringToBinary StringTrimLeft StringTrimRight StringUpper Tan TCPAccept TCPCloseSocket TCPConnect TCPListen TCPNameToIP TCPRecv TCPSend TCPShutdown, UDPShutdown TCPStartup, UDPStartup TimerDiff TimerInit ToolTip TrayCreateItem TrayCreateMenu TrayGetMsg TrayItemDelete TrayItemGetHandle TrayItemGetState TrayItemGetText TrayItemSetOnEvent TrayItemSetState TrayItemSetText TraySetClick TraySetIcon TraySetOnEvent TraySetPauseIcon TraySetState TraySetToolTip TrayTip UBound UDPBind UDPCloseSocket UDPOpen UDPRecv UDPSend VarGetType WinActivate WinActive WinClose WinExists WinFlash WinGetCaretPos WinGetClassList WinGetClientSize WinGetHandle WinGetPos WinGetProcess WinGetState WinGetText WinGetTitle WinKill WinList WinMenuSelectItem WinMinimizeAll WinMinimizeAllUndo WinMove WinSetOnTop WinSetState WinSetTitle WinSetTrans WinWait WinWaitActive WinWaitClose WinWaitNotActive",E={variants:[A.COMMENT(";","$",{relevance:0}),A.COMMENT("#cs","#ce"),A.COMMENT("#comments-start","#comments-end")]},D={begin:"\\$[A-z0-9_]+"},g={className:"string",variants:[{begin:/"/,end:/"/,contains:[{begin:/""/,relevance:0}]},{begin:/'/,end:/'/,contains:[{begin:/''/,relevance:0}]}]},_={variants:[A.BINARY_NUMBER_MODE,A.C_NUMBER_MODE]},F={className:"meta",begin:"#",end:"$",keywords:{"meta-keyword":B},contains:[{begin:/\\\n/,relevance:0},{beginKeywords:"include",keywords:{"meta-keyword":"include"},end:"$",contains:[g,{className:"meta-string",variants:[{begin:"<",end:">"},{begin:/"/,end:/"/,contains:[{begin:/""/,relevance:0}]},{begin:/'/,end:/'/,contains:[{begin:/''/,relevance:0}]}]}]},g,E]},G={className:"symbol",begin:"@[A-z0-9_]+"},U={className:"function",beginKeywords:"Func",end:"$",illegal:"\\$|\\[|%",contains:[A.UNDERSCORE_TITLE_MODE,{className:"params",begin:"\\(",end:"\\)",contains:[D,g,_]}]};return{name:"AutoIt",case_insensitive:!0,illegal:/\/\*/,keywords:{keyword:Q,built_in:"Abs ACos AdlibRegister AdlibUnRegister Asc AscW ASin Assign ATan AutoItSetOption AutoItWinGetTitle AutoItWinSetTitle Beep Binary BinaryLen BinaryMid BinaryToString BitAND BitNOT BitOR BitRotate BitShift BitXOR BlockInput Break Call CDTray Ceiling Chr ChrW ClipGet ClipPut ConsoleRead ConsoleWrite ConsoleWriteError ControlClick ControlCommand ControlDisable ControlEnable ControlFocus ControlGetFocus ControlGetHandle ControlGetPos ControlGetText ControlHide ControlListView ControlMove ControlSend ControlSetText ControlShow ControlTreeView Cos Dec DirCopy DirCreate DirGetSize DirMove DirRemove DllCall DllCallAddress DllCallbackFree DllCallbackGetPtr DllCallbackRegister DllClose DllOpen DllStructCreate DllStructGetData DllStructGetPtr DllStructGetSize DllStructSetData DriveGetDrive DriveGetFileSystem DriveGetLabel DriveGetSerial DriveGetType DriveMapAdd DriveMapDel DriveMapGet DriveSetLabel DriveSpaceFree DriveSpaceTotal DriveStatus EnvGet EnvSet EnvUpdate Eval Execute Exp FileChangeDir FileClose FileCopy FileCreateNTFSLink FileCreateShortcut FileDelete FileExists FileFindFirstFile FileFindNextFile FileFlush FileGetAttrib FileGetEncoding FileGetLongName FileGetPos FileGetShortcut FileGetShortName FileGetSize FileGetTime FileGetVersion FileInstall FileMove FileOpen FileOpenDialog FileRead FileReadLine FileReadToArray FileRecycle FileRecycleEmpty FileSaveDialog FileSelectFolder FileSetAttrib FileSetEnd FileSetPos FileSetTime FileWrite FileWriteLine Floor FtpSetProxy FuncName GUICreate GUICtrlCreateAvi GUICtrlCreateButton GUICtrlCreateCheckbox GUICtrlCreateCombo GUICtrlCreateContextMenu GUICtrlCreateDate GUICtrlCreateDummy GUICtrlCreateEdit GUICtrlCreateGraphic GUICtrlCreateGroup GUICtrlCreateIcon GUICtrlCreateInput GUICtrlCreateLabel GUICtrlCreateList GUICtrlCreateListView GUICtrlCreateListViewItem GUICtrlCreateMenu GUICtrlCreateMenuItem GUICtrlCreateMonthCal GUICtrlCreateObj GUICtrlCreatePic GUICtrlCreateProgress GUICtrlCreateRadio GUICtrlCreateSlider GUICtrlCreateTab GUICtrlCreateTabItem GUICtrlCreateTreeView GUICtrlCreateTreeViewItem GUICtrlCreateUpdown GUICtrlDelete GUICtrlGetHandle GUICtrlGetState GUICtrlRead GUICtrlRecvMsg GUICtrlRegisterListViewSort GUICtrlSendMsg GUICtrlSendToDummy GUICtrlSetBkColor GUICtrlSetColor GUICtrlSetCursor GUICtrlSetData GUICtrlSetDefBkColor GUICtrlSetDefColor GUICtrlSetFont GUICtrlSetGraphic GUICtrlSetImage GUICtrlSetLimit GUICtrlSetOnEvent GUICtrlSetPos GUICtrlSetResizing GUICtrlSetState GUICtrlSetStyle GUICtrlSetTip GUIDelete GUIGetCursorInfo GUIGetMsg GUIGetStyle GUIRegisterMsg GUISetAccelerators GUISetBkColor GUISetCoord GUISetCursor GUISetFont GUISetHelp GUISetIcon GUISetOnEvent GUISetState GUISetStyle GUIStartGroup GUISwitch Hex HotKeySet HttpSetProxy HttpSetUserAgent HWnd InetClose InetGet InetGetInfo InetGetSize InetRead IniDelete IniRead IniReadSection IniReadSectionNames IniRenameSection IniWrite IniWriteSection InputBox Int IsAdmin IsArray IsBinary IsBool IsDeclared IsDllStruct IsFloat IsFunc IsHWnd IsInt IsKeyword IsNumber IsObj IsPtr IsString Log MemGetStats Mod MouseClick MouseClickDrag MouseDown MouseGetCursor MouseGetPos MouseMove MouseUp MouseWheel MsgBox Number ObjCreate ObjCreateInterface ObjEvent ObjGet ObjName OnAutoItExitRegister OnAutoItExitUnRegister Ping PixelChecksum PixelGetColor PixelSearch ProcessClose ProcessExists ProcessGetStats ProcessList ProcessSetPriority ProcessWait ProcessWaitClose ProgressOff ProgressOn ProgressSet Ptr Random RegDelete RegEnumKey RegEnumVal RegRead RegWrite Round Run RunAs RunAsWait RunWait Send SendKeepActive SetError SetExtended ShellExecute ShellExecuteWait Shutdown Sin Sleep SoundPlay SoundSetWaveVolume SplashImageOn SplashOff SplashTextOn Sqrt SRandom StatusbarGetText StderrRead StdinWrite StdioClose StdoutRead String StringAddCR StringCompare StringFormat StringFromASCIIArray StringInStr StringIsAlNum StringIsAlpha StringIsASCII StringIsDigit StringIsFloat StringIsInt StringIsLower StringIsSpace StringIsUpper StringIsXDigit StringLeft StringLen StringLower StringMid StringRegExp StringRegExpReplace StringReplace StringReverse StringRight StringSplit StringStripCR StringStripWS StringToASCIIArray StringToBinary StringTrimLeft StringTrimRight StringUpper Tan TCPAccept TCPCloseSocket TCPConnect TCPListen TCPNameToIP TCPRecv TCPSend TCPShutdown, UDPShutdown TCPStartup, UDPStartup TimerDiff TimerInit ToolTip TrayCreateItem TrayCreateMenu TrayGetMsg TrayItemDelete TrayItemGetHandle TrayItemGetState TrayItemGetText TrayItemSetOnEvent TrayItemSetState TrayItemSetText TraySetClick TraySetIcon TraySetOnEvent TraySetPauseIcon TraySetState TraySetToolTip TrayTip UBound UDPBind UDPCloseSocket UDPOpen UDPRecv UDPSend VarGetType WinActivate WinActive WinClose WinExists WinFlash WinGetCaretPos WinGetClassList WinGetClientSize WinGetHandle WinGetPos WinGetProcess WinGetState WinGetText WinGetTitle WinKill WinList WinMenuSelectItem WinMinimizeAll WinMinimizeAllUndo WinMove WinSetOnTop WinSetState WinSetTitle WinSetTrans WinWait WinWaitActive WinWaitClose WinWaitNotActive",literal:"True False And Null Not Or Default"},contains:[E,D,g,_,F,G,U]}}tjQ.exports=HmI});var QSQ=f((SEC,ASQ)=>{function KmI(A){return{name:"AVR Assembly",case_insensitive:!0,keywords:{$pattern:"\\.?"+A.IDENT_RE,keyword:"adc add adiw and andi asr bclr bld brbc brbs brcc brcs break breq brge brhc brhs brid brie brlo brlt brmi brne brpl brsh brtc brts brvc brvs bset bst call cbi cbr clc clh cli cln clr cls clt clv clz com cp cpc cpi cpse dec eicall eijmp elpm eor fmul fmuls fmulsu icall ijmp in inc jmp ld ldd ldi lds lpm lsl lsr mov movw mul muls mulsu neg nop or ori out pop push rcall ret reti rjmp rol ror sbc sbr sbrc sbrs sec seh sbi sbci sbic sbis sbiw sei sen ser ses set sev sez sleep spm st std sts sub subi swap tst wdr",built_in:"r0 r1 r2 r3 r4 r5 r6 r7 r8 r9 r10 r11 r12 r13 r14 r15 r16 r17 r18 r19 r20 r21 r22 r23 r24 r25 r26 r27 r28 r29 r30 r31 x|0 xh xl y|0 yh yl z|0 zh zl ucsr1c udr1 ucsr1a ucsr1b ubrr1l ubrr1h ucsr0c ubrr0h tccr3c tccr3a tccr3b tcnt3h tcnt3l ocr3ah ocr3al ocr3bh ocr3bl ocr3ch ocr3cl icr3h icr3l etimsk etifr tccr1c ocr1ch ocr1cl twcr twdr twar twsr twbr osccal xmcra xmcrb eicra spmcsr spmcr portg ddrg ping portf ddrf sreg sph spl xdiv rampz eicrb eimsk gimsk gicr eifr gifr timsk tifr mcucr mcucsr tccr0 tcnt0 ocr0 assr tccr1a tccr1b tcnt1h tcnt1l ocr1ah ocr1al ocr1bh ocr1bl icr1h icr1l tccr2 tcnt2 ocr2 ocdr wdtcr sfior eearh eearl eedr eecr porta ddra pina portb ddrb pinb portc ddrc pinc portd ddrd pind spdr spsr spcr udr0 ucsr0a ucsr0b ubrr0l acsr admux adcsr adch adcl porte ddre pine pinf",meta:".byte .cseg .db .def .device .dseg .dw .endmacro .equ .eseg .exit .include .list .listmac .macro .nolist .org .set"},contains:[A.C_BLOCK_COMMENT_MODE,A.COMMENT(";","$",{relevance:0}),A.C_NUMBER_MODE,A.BINARY_NUMBER_MODE,{className:"number",begin:"\\b(\\$[a-zA-Z0-9]+|0o[0-7]+)"},A.QUOTE_STRING_MODE,{className:"string",begin:"'",end:"[^\\\\]'",illegal:"[^\\\\][^']"},{className:"symbol",begin:"^[A-Za-z0-9_.$]+:"},{className:"meta",begin:"#",end:"$"},{className:"subst",begin:"@[0-9]+"}]}}ASQ.exports=KmI});var ISQ=f((vEC,BSQ)=>{function $mI(A){let Q={className:"variable",variants:[{begin:/\$[\w\d#@][\w\d_]*/},{begin:/\$\{(.*?)\}/}]},B="BEGIN END if else while do for in break continue delete next nextfile function func exit|10",I={className:"string",contains:[A.BACKSLASH_ESCAPE],variants:[{begin:/(u|b)?r?'''/,end:/'''/,relevance:10},{begin:/(u|b)?r?"""/,end:/"""/,relevance:10},{begin:/(u|r|ur)'/,end:/'/,relevance:10},{begin:/(u|r|ur)"/,end:/"/,relevance:10},{begin:/(b|br)'/,end:/'/},{begin:/(b|br)"/,end:/"/},A.APOS_STRING_MODE,A.QUOTE_STRING_MODE]};return{name:"Awk",keywords:{keyword:"BEGIN END if else while do for in break continue delete next nextfile function func exit|10"},contains:[Q,I,A.REGEXP_MODE,A.HASH_COMMENT_MODE,A.NUMBER_MODE]}}BSQ.exports=$mI});var ESQ=f((xEC,CSQ)=>{function ZmI(A){return{name:"X++",aliases:["x++"],keywords:{keyword:["abstract","as","asc","avg","break","breakpoint","by","byref","case","catch","changecompany","class","client","client","common","const","continue","count","crosscompany","delegate","delete_from","desc","display","div","do","edit","else","eventhandler","exists","extends","final","finally","firstfast","firstonly","firstonly1","firstonly10","firstonly100","firstonly1000","flush","for","forceliterals","forcenestedloop","forceplaceholders","forceselectorder","forupdate","from","generateonly","group","hint","if","implements","in","index","insert_recordset","interface","internal","is","join","like","maxof","minof","mod","namespace","new","next","nofetch","notexists","optimisticlock","order","outer","pessimisticlock","print","private","protected","public","readonly","repeatableread","retry","return","reverse","select","server","setting","static","sum","super","switch","this","throw","try","ttsabort","ttsbegin","ttscommit","unchecked","update_recordset","using","validtimestate","void","where","while"],built_in:["anytype","boolean","byte","char","container","date","double","enum","guid","int","int64","long","real","short","str","utcdatetime","var"],literal:["default","false","null","true"]},contains:[A.C_LINE_COMMENT_MODE,A.C_BLOCK_COMMENT_MODE,A.APOS_STRING_MODE,A.QUOTE_STRING_MODE,A.C_NUMBER_MODE,{className:"meta",begin:"#",end:"$"},{className:"class",beginKeywords:"class interface",end:/\{/,excludeEnd:!0,illegal:":",contains:[{beginKeywords:"extends implements"},A.UNDERSCORE_TITLE_MODE]}]}}CSQ.exports=ZmI});var gSQ=f((bEC,DSQ)=>{function zmI(A){if(!A)return null;if(typeof A==="string")return A;return A.source}function WmI(...A){return A.map((B)=>zmI(B)).join("")}function qmI(A){let Q={},B={begin:/\$\{/,end:/\}/,contains:["self",{begin:/:-/,contains:[Q]}]};Object.assign(Q,{className:"variable",variants:[{begin:WmI(/\$[\w\d#@][\w\d_]*/,"(?![\\w\\d])(?![$])")},B]});let I={className:"subst",begin:/\$\(/,end:/\)/,contains:[A.BACKSLASH_ESCAPE]},C={begin:/<<-?\s*(?=\w+)/,starts:{contains:[A.END_SAME_AS_BEGIN({begin:/(\w+)/,end:/(\w+)/,className:"string"})]}},E={className:"string",begin:/"/,end:/"/,contains:[A.BACKSLASH_ESCAPE,Q,I]};I.contains.push(E);let D={className:"",begin:/\\"/},g={className:"string",begin:/'/,end:/'/},_={begin:/\$\(\(/,end:/\)\)/,contains:[{begin:/\d+#[0-9a-f]+/,className:"number"},A.NUMBER_MODE,Q]},F=["fish","bash","zsh","sh","csh","ksh","tcsh","dash","scsh"],G=A.SHEBANG({binary:`(${F.join("|")})`,relevance:10}),U={className:"function",begin:/\w[\w\d_]*\s*\(\s*\)\s*\{/,returnBegin:!0,contains:[A.inherit(A.TITLE_MODE,{begin:/\w[\w\d_]*/})],relevance:0};return{name:"Bash",aliases:["sh","zsh"],keywords:{$pattern:/\b[a-z._-]+\b/,keyword:"if then else elif fi for while in do done case esac function",literal:"true false",built_in:"break cd continue eval exec exit export getopts hash pwd readonly return shift test times trap umask unset alias bind builtin caller command declare echo enable help let local logout mapfile printf read readarray source type typeset ulimit unalias set shopt autoload bg bindkey bye cap chdir clone comparguments compcall compctl compdescribe compfiles compgroups compquote comptags comptry compvalues dirs disable disown echotc echoti emulate fc fg float functions getcap getln history integer jobs kill limit log noglob popd print pushd pushln rehash sched setcap setopt stat suspend ttyctl unfunction unhash unlimit unsetopt vared wait whence where which zcompile zformat zftp zle zmodload zparseopts zprof zpty zregexparse zsocket zstyle ztcp"},contains:[G,A.SHEBANG(),U,_,A.HASH_COMMENT_MODE,C,E,D,g,Q]}}DSQ.exports=qmI});var wSQ=f((hEC,_SQ)=>{function NmI(A){return{name:"BASIC",case_insensitive:!0,illegal:"^.",keywords:{$pattern:"[a-zA-Z][a-zA-Z0-9_$%!#]*",keyword:"ABS ASC AND ATN AUTO|0 BEEP BLOAD|10 BSAVE|10 CALL CALLS CDBL CHAIN CHDIR CHR$|10 CINT CIRCLE CLEAR CLOSE CLS COLOR COM COMMON CONT COS CSNG CSRLIN CVD CVI CVS DATA DATE$ DEFDBL DEFINT DEFSNG DEFSTR DEF|0 SEG USR DELETE DIM DRAW EDIT END ENVIRON ENVIRON$ EOF EQV ERASE ERDEV ERDEV$ ERL ERR ERROR EXP FIELD FILES FIX FOR|0 FRE GET GOSUB|10 GOTO HEX$ IF THEN ELSE|0 INKEY$ INP INPUT INPUT# INPUT$ INSTR IMP INT IOCTL IOCTL$ KEY ON OFF LIST KILL LEFT$ LEN LET LINE LLIST LOAD LOC LOCATE LOF LOG LPRINT USING LSET MERGE MID$ MKDIR MKD$ MKI$ MKS$ MOD NAME NEW NEXT NOISE NOT OCT$ ON OR PEN PLAY STRIG OPEN OPTION BASE OUT PAINT PALETTE PCOPY PEEK PMAP POINT POKE POS PRINT PRINT] PSET PRESET PUT RANDOMIZE READ REM RENUM RESET|0 RESTORE RESUME RETURN|0 RIGHT$ RMDIR RND RSET RUN SAVE SCREEN SGN SHELL SIN SOUND SPACE$ SPC SQR STEP STICK STOP STR$ STRING$ SWAP SYSTEM TAB TAN TIME$ TIMER TROFF TRON TO USR VAL VARPTR VARPTR$ VIEW WAIT WHILE WEND WIDTH WINDOW WRITE XOR"},contains:[A.QUOTE_STRING_MODE,A.COMMENT("REM","$",{relevance:10}),A.COMMENT("'","$",{relevance:0}),{className:"symbol",begin:"^[0-9]+ ",relevance:10},{className:"number",begin:"\\b\\d+(\\.\\d+)?([edED]\\d+)?[#!]?",relevance:0},{className:"number",begin:"(&[hH][0-9a-fA-F]{1,4})"},{className:"number",begin:"(&[oO][0-7]{1,6})"}]}}_SQ.exports=NmI});var JSQ=f((uEC,FSQ)=>{function MmI(A){return{name:"Backus–Naur Form",contains:[{className:"attribute",begin:/</,end:/>/},{begin:/::=/,end:/$/,contains:[{begin:/</,end:/>/},A.C_LINE_COMMENT_MODE,A.C_BLOCK_COMMENT_MODE,A.APOS_STRING_MODE,A.QUOTE_STRING_MODE]}]}}FSQ.exports=MmI});var YSQ=f((mEC,GSQ)=>{function VmI(A){let Q={className:"literal",begin:/[+-]/,relevance:0};return{name:"Brainfuck",aliases:["bf"],contains:[A.COMMENT(`[^\\[\\]\\.,\\+\\-<> \r
|
|
@@ -5945,7 +5945,7 @@ https://github.com/highlightjs/highlight.js/issues/2277`),o=GA,s=IA;let FA={code
|
|
|
5945
5945
|
`)}function caQ(A){if(A.role==="tool"&&Array.isArray(A.content))return A.content.map((Q)=>({type:"tool_result",id:Q.toolCallId,name:Q.toolName,input:Q.input,result:Q.result}));if(A.role==="user"&&Array.isArray(A.content))return A.content.filter((Q)=>Q.type==="tool_result");return[]}function M00(A){if(typeof A.returnDisplay==="string")return A.returnDisplay;if(typeof A.llmContent==="string")return A.llmContent;if(Array.isArray(A.llmContent))return A.llmContent.filter((Q)=>Q.type==="text").map((Q)=>Q.text).join(`
|
|
5946
5946
|
`);return JSON.stringify(A,null,2)}function V00(A){if(A.name==="write"||A.name==="edit"){if(A.result?.returnDisplay&&typeof A.result.returnDisplay==="object"&&A.result.returnDisplay.type==="diff_viewer"){let{newContent:Q,originalContent:B}=A.result.returnDisplay,I="",C="";if(typeof Q!=="string")I=A.input?.[Q.inputKey];else I=Q;if(typeof B!=="string")C=A.input?.[B.inputKey];else C=B;return{path:A.result.returnDisplay.absoluteFilePath||A.result.returnDisplay.filePath||"",newText:I,oldText:C}}}}function daQ(A){let Q=[{type:"content",content:{type:"text",text:M00(A.result)}}],B=V00(A);if(B)Q.push({type:"diff",...B});return Q}var laQ,iaQ;var paQ=b(async()=>{await nV();laQ=q$,iaQ=W$});class sNA{id;messageBus;connection;clientFsCapabilities;pendingPrompt=null;defaultCwd=process.cwd();permissionRules=new Map;toolCallHistory=new rNA(100);constructor(A,Q,B,I){this.id=A;this.messageBus=Q;this.connection=B;this.clientFsCapabilities=I}async init(){await this.messageBus.request("session.initialize",{cwd:this.defaultCwd,sessionId:this.id}),this.listenChunkEvent(),this.initPermission(),setTimeout(()=>{this.initSlashCommand()},0)}async initSlashCommand(){try{let B=(await this.messageBus.request("slashCommand.list",{cwd:this.defaultCwd})).data.slashCommands.filter((I)=>I.command.type!=="local-jsx"&&I.command.type!=="local").map((I)=>({name:I.command.name,description:I.command.description,input:{hint:"query to search for"}}));this.connection.sessionUpdate({sessionId:this.id,update:{sessionUpdate:"available_commands_update",availableCommands:B}})}catch(A){console.error("Failed to initialize slash commands:",A)}}getPermissionRuleKey(A,Q){return`${A}:${Q||"default"}`}async initPermission(){this.messageBus.registerHandler("toolApproval",async(A)=>{let{toolUse:Q,category:B}=A,I=this.getPermissionRuleKey(Q.name,B),C=this.permissionRules.get(I);if(C)return{approved:C.decision==="allow"};try{let E=this.toolCallHistory.get(Q.callId),D=await this.connection.requestPermission({sessionId:this.id,toolCall:{title:E?.title??Q.name,toolCallId:Q.callId,content:E?.content},options:[{kind:"allow_once",name:"Allow once",optionId:"allow_once"},{kind:"allow_always",name:"Always allow",optionId:"allow_always"},{kind:"reject_once",name:"Reject once",optionId:"reject_once"},{kind:"reject_always",name:"Always reject",optionId:"reject_always"}]});if(D.outcome.outcome==="cancelled")return{approved:!1};switch(D.outcome.optionId){case"allow_once":return{approved:!0};case"allow_always":return this.permissionRules.set(I,{decision:"allow",timestamp:Date.now()}),{approved:!0};case"reject_once":return{approved:!1};case"reject_always":return this.permissionRules.set(I,{decision:"reject",timestamp:Date.now()}),{approved:!1};default:throw Error(`Unexpected permission outcome ${D.outcome.optionId}`)}}catch(E){console.log(E)}})}async listenChunkEvent(){this.messageBus.onEvent("message",(A)=>{let{message:Q}=A,B=caQ(Q);if(B.length>0)for(let I of B){if(I.name==="todoWrite"){if(I.result?.returnDisplay&&typeof I.result.returnDisplay==="object"&&I.result.returnDisplay.type==="todo_write"){let E=I.result.returnDisplay.newTodos.map((D)=>({content:D.content,status:D.status,priority:D.priority}));this.connection.sessionUpdate({sessionId:this.id,update:{sessionUpdate:"plan",entries:E},_meta:{toolCallId:I.id}});continue}}let C=daQ(I);this.connection.sessionUpdate({sessionId:this.id,update:{sessionUpdate:"tool_call_update",toolCallId:I.id||"",status:"completed",content:C,rawInput:I.input,rawOutput:I.result}})}}),this.messageBus.onEvent("chunk",(A)=>{let{chunk:Q}=A;if(Q.type==="reasoning-delta")this.connection.sessionUpdate({sessionId:this.id,update:{sessionUpdate:"agent_thought_chunk",content:{type:"text",text:Q.delta}}});if(Q.type==="tool-call"){if(Q.toolName==="todoWrite")return;let B=v3(Q.input),I={sessionUpdate:"tool_call",toolCallId:Q.toolCallId,title:Q.toolName,status:"pending"};if(Q.toolName==="bash")I.title=`${B?.command??""}`,I.kind="execute";else if(Q.toolName==="read")I.kind="read",I.title=`read ${B?.file_path??""}`,I.locations=[{path:B?.file_path??""}];else if(Q.toolName==="fetch")I.title=`fetch ${B?.url??""}`,I.kind="fetch";else if(Q.toolName==="write")I.title=`write ${B?.file_path??""}`,I.kind="edit",I.content=[{type:"content",content:{type:"text",text:B.content}}];else if(Q.toolName==="edit")I.title=`edit ${B?.file_path??""}`,I.kind="edit",I.content=[{type:"diff",newText:B.new_string,oldText:B.old_string,path:B.file_path}];else if(Q.toolName==="glob")I.title=`glob ${B?.pattern??""}`,I.kind="search";else if(Q.toolName==="grep")I.title=`grep ${B?.pattern??""} ${B?.search_path??""}`,I.kind="search";if(this.toolCallHistory.add(Q.toolCallId,I),I.kind!=="edit")this.connection.sessionUpdate({sessionId:this.id,update:I})}if(Q.type==="text-delta")this.connection.sessionUpdate({sessionId:this.id,update:{sessionUpdate:"agent_message_chunk",content:{type:"text",text:Q.delta}}})})}async prompt(A){let{sessionId:Q,prompt:B}=A;this.pendingPrompt?.abort(),this.pendingPrompt=new AbortController;try{let I=maQ(B),C=B.filter((D)=>D.type==="image").map((D)=>{return{type:"image",source:D.source,mimeType:D.mimeType}});if(laQ(I)){let D=iaQ(I),_=(await this.messageBus.request("slashCommand.get",{cwd:this.defaultCwd,command:D.command})).data?.commandEntry;if(_){let F={role:"user",content:I},U=_.command.type;if(U==="prompt"){await this.messageBus.request("session.addMessages",{cwd:this.defaultCwd,sessionId:Q,messages:[F]});let H=await this.messageBus.request("slashCommand.execute",{cwd:this.defaultCwd,sessionId:Q,command:D.command,args:D.args});if(H.success){let Z=H.data.messages;await this.messageBus.request("session.addMessages",{cwd:this.defaultCwd,sessionId:Q,messages:Z})}if((await this.messageBus.request("session.send",{message:I||null,cwd:this.defaultCwd,sessionId:Q,planMode:!1,attachments:C.length>0?C:void 0})).success)return{stopReason:"end_turn"}}else throw Error(`Unsupported slash command type: ${U}`)}}if((await this.messageBus.request("session.send",{message:I||null,cwd:this.defaultCwd,sessionId:Q,planMode:!1,attachments:C.length>0?C:void 0})).success)return{stopReason:"end_turn"};return{stopReason:"end_turn"}}catch(I){if(this.pendingPrompt?.signal.aborted)return{stopReason:"cancelled"};throw I}finally{this.pendingPrompt=null}}async abort(){await this.messageBus.request("session.cancel",{cwd:this.defaultCwd,sessionId:this.id}),this.pendingPrompt?.abort()}}var naQ=b(async()=>{A4A();await paQ()});import tNA from"fs";function aaQ(A){return HC({name:"read",description:Sa(A.productName),parameters:ja,getDescription:({params:Q,cwd:B})=>{if(!Q.file_path||typeof Q.file_path!=="string")return"No file path provided";return MA.relative(B,Q.file_path)},execute:async({file_path:Q,offset:B,limit:I})=>{try{va(B,I);let C=MA.extname(Q).toLowerCase();ha(C,Q);let E=Ta(Q,A.cwd);if(Aj(C))return await fa(E,A.cwd);if(tNA.statSync(E).size===0)return ba(Q);let g;try{let W=await A.connection.readTextFile({path:E,sessionId:A.sessionId});if(W.content===void 0||W.content===null)throw Error("ACP returned empty content");g=W.content}catch(W){console.warn(`[ACP Read] Failed to read via ACP, falling back to fs: ${W instanceof Error?W.message:"Unknown error"}`);try{g=tNA.readFileSync(E,{encoding:"utf8"})}catch(q){throw Error(`Failed to read file via ACP and fs: ${q instanceof Error?q.message:"Unknown error"}`)}}if(g===void 0||g===null)throw Error(`Failed to read file: ${Q}`);let{content:_,totalLines:F,startLine:G,endLine:U,actualLimit:X,selectedLines:H}=Pa(g,B??1,I??jK),{processedContent:K,actualLinesRead:Z}=ka(_,H);return xa(Q,K,F,G,U,X,Z,B,I)}catch(C){return{isError:!0,llmContent:C instanceof Error?C.message:"Unknown error"}}},approval:{category:"read"}})}var oaQ=b(()=>{AI();G0();tg();mHA()});import Qe from"fs";function raQ(A){return HC({name:"write",description:ma(),parameters:ua,getDescription:({params:Q,cwd:B})=>{if(!Q.file_path||typeof Q.file_path!=="string")return"No file path provided";return MA.relative(B,Q.file_path)},execute:async({file_path:Q,content:B})=>{try{let I=da(Q,A.cwd),C=Qe.existsSync(I),E="";if(C)try{E=(await A.connection.readTextFile({path:I,sessionId:A.sessionId})).content||""}catch(_){console.warn(`[ACP Write] Failed to read old content via ACP, falling back to fs: ${_ instanceof Error?_.message:"Unknown error"}`);try{E=Qe.readFileSync(I,"utf-8")}catch(F){console.warn(`[ACP Write] Failed to read old content via fs, using empty: ${F instanceof Error?F.message:"Unknown error"}`),E=""}}let D=MA.dirname(I);Qe.mkdirSync(D,{recursive:!0});let g=ca(B);try{await A.connection.writeTextFile({path:I,content:g,sessionId:A.sessionId})}catch(_){console.warn(`[ACP Write] Failed to write via ACP, falling back to fs: ${_ instanceof Error?_.message:"Unknown error"}`);try{Qe.writeFileSync(I,g)}catch(F){throw Error(`Failed to write file via ACP and fs: ${F instanceof Error?F.message:"Unknown error"}`)}}return la(Q,I,A.cwd,E,C)}catch(I){return{isError:!0,llmContent:I instanceof Error?I.message:"Unknown error"}}},approval:ia()})}var saQ=b(()=>{AI();G0();tg();dHA()});function taQ(A){return{name:"acp",enforce:"post",tool(Q){let{sessionId:B}=Q;return[aaQ({cwd:this.cwd,productName:this.productName,connection:A.connection,sessionId:B}),raQ({cwd:this.cwd,connection:A.connection,sessionId:B})]}}}var eaQ=b(()=>{oaQ();saQ()});function m6(A,...Q){let B=new Date().toISOString();if(process.stderr.write(`[${B}] [ACP:Agent] ${A}
|
|
5947
5947
|
`),Q.length>0)process.stderr.write(`${JSON.stringify(Q,null,2)}
|
|
5948
|
-
`)}class AMA{connection;sessions=new Map;messageBus;nodeBridge;context;defaultCwd;contextCreateOpts;clientFsCapabilities;constructor(A,Q){this.connection=A,this.contextCreateOpts=Q,this.defaultCwd=Q.cwd||process.cwd()}async initialize(A){if(m6("Initializing ACP agent"),eNA("Initialize params: %O",A),A.clientCapabilities?.fs)m6("Client supports file system capabilities:",A.clientCapabilities.fs),this.clientFsCapabilities=A.clientCapabilities.fs;m6("Creating Neovate context");let Q=[...this.contextCreateOpts.plugins||[]];if(this.clientFsCapabilities){m6("Adding ACP file system plugin");let D=taQ({connection:this.connection});Q.push(D)}m6("Creating NodeBridge and MessageBus");let B=new nw({contextCreateOpts:{...this.contextCreateOpts,cwd:this.defaultCwd,plugins:Q}}),[I,C]=lw.createPair(),E=new t1;return E.setTransport(I),B.messageBus.setTransport(C),this.messageBus=E,this.nodeBridge=B,m6("Agent initialized successfully"),{protocolVersion:zaQ,agentCapabilities:{}}}async getCanUseModels(){if(!this.messageBus)return;try{let B=(await this.messageBus.request("providers.list",{cwd:this.defaultCwd})).data.providers.filter((D)=>D.hasApiKey);if(B.length===0)return;let I=await this.messageBus.request("models.list",{cwd:this.defaultCwd});return{availableModels:I.data.groupedModels.filter((D)=>B.some((g)=>g.id===D.providerId)).map((D)=>D.models).flat().map((D)=>({modelId:D.value,name:D.name})),currentModelId:`${I.data.currentModel.provider.id}/${I.data.currentModelInfo?.modelId??""}`}}catch(A){console.error("Failed to get available models:",A);return}}async newSession(A){if(!this.messageBus)throw Error("Agent not initialized");let Q=Array.from(crypto.getRandomValues(new Uint8Array(16))).map((C)=>C.toString(16).padStart(2,"0")).join("");m6("Creating new session:",Q),eNA("Session params: %O",A);let B=await this.getCanUseModels(),I=new sNA(Q,this.messageBus,this.connection,this.clientFsCapabilities);return this.sessions.set(Q,I),await I.init(),m6("Session created successfully:",Q),{sessionId:Q,models:B||void 0}}loadSession(A){throw Error("Method not implemented.")}unstable_forkSession(A){throw Error("Method not implemented.")}unstable_listSessions(A){throw Error("Method not implemented.")}unstable_resumeSession(A){throw Error("Method not implemented.")}async setSessionMode(A){throw Error("Method not implemented.")}async unstable_setSessionModel(A){if(!this.messageBus)throw Error("Agent not initialized");await this.messageBus.request("config.set",{cwd:this.defaultCwd,key:"model",value:A.modelId,isGlobal:!0}),await this.messageBus.request("project.clearContext",{})}unstable_setSessionConfigOption(A){throw Error("Method not implemented.")}authenticate(A){throw Error("Method not implemented.")}async prompt(A){let{sessionId:Q}=A;m6("Received prompt for session:",Q),eNA("Prompt params: %O",A);let B=this.sessions.get(Q);if(!B)throw Error(`Session ${Q} not found`);let I=await B.prompt(A);return m6("Prompt completed for session:",Q,"result:",I.stopReason),I}async cancel(A){let Q=this.sessions.get(A.sessionId);if(!Q)throw Error(`Session ${A.sessionId} not found`);await Q.abort()}extMethod(A,Q){throw Error("Method not implemented.")}extNotification(A,Q){throw Error("Method not implemented.")}}var AoQ,eNA;var QoQ=b(async()=>{oNA();u9();eaQ();await UE([L7(),naQ()]);AoQ=NA(a_(),1),eNA=AoQ.default("neovate:acp:agent")});var QMA=f((eYC,L00)=>{L00.exports={name:"@neovate/code",version:"0.
|
|
5948
|
+
`)}class AMA{connection;sessions=new Map;messageBus;nodeBridge;context;defaultCwd;contextCreateOpts;clientFsCapabilities;constructor(A,Q){this.connection=A,this.contextCreateOpts=Q,this.defaultCwd=Q.cwd||process.cwd()}async initialize(A){if(m6("Initializing ACP agent"),eNA("Initialize params: %O",A),A.clientCapabilities?.fs)m6("Client supports file system capabilities:",A.clientCapabilities.fs),this.clientFsCapabilities=A.clientCapabilities.fs;m6("Creating Neovate context");let Q=[...this.contextCreateOpts.plugins||[]];if(this.clientFsCapabilities){m6("Adding ACP file system plugin");let D=taQ({connection:this.connection});Q.push(D)}m6("Creating NodeBridge and MessageBus");let B=new nw({contextCreateOpts:{...this.contextCreateOpts,cwd:this.defaultCwd,plugins:Q}}),[I,C]=lw.createPair(),E=new t1;return E.setTransport(I),B.messageBus.setTransport(C),this.messageBus=E,this.nodeBridge=B,m6("Agent initialized successfully"),{protocolVersion:zaQ,agentCapabilities:{}}}async getCanUseModels(){if(!this.messageBus)return;try{let B=(await this.messageBus.request("providers.list",{cwd:this.defaultCwd})).data.providers.filter((D)=>D.hasApiKey);if(B.length===0)return;let I=await this.messageBus.request("models.list",{cwd:this.defaultCwd});return{availableModels:I.data.groupedModels.filter((D)=>B.some((g)=>g.id===D.providerId)).map((D)=>D.models).flat().map((D)=>({modelId:D.value,name:D.name})),currentModelId:`${I.data.currentModel.provider.id}/${I.data.currentModelInfo?.modelId??""}`}}catch(A){console.error("Failed to get available models:",A);return}}async newSession(A){if(!this.messageBus)throw Error("Agent not initialized");let Q=Array.from(crypto.getRandomValues(new Uint8Array(16))).map((C)=>C.toString(16).padStart(2,"0")).join("");m6("Creating new session:",Q),eNA("Session params: %O",A);let B=await this.getCanUseModels(),I=new sNA(Q,this.messageBus,this.connection,this.clientFsCapabilities);return this.sessions.set(Q,I),await I.init(),m6("Session created successfully:",Q),{sessionId:Q,models:B||void 0}}loadSession(A){throw Error("Method not implemented.")}unstable_forkSession(A){throw Error("Method not implemented.")}unstable_listSessions(A){throw Error("Method not implemented.")}unstable_resumeSession(A){throw Error("Method not implemented.")}async setSessionMode(A){throw Error("Method not implemented.")}async unstable_setSessionModel(A){if(!this.messageBus)throw Error("Agent not initialized");await this.messageBus.request("config.set",{cwd:this.defaultCwd,key:"model",value:A.modelId,isGlobal:!0}),await this.messageBus.request("project.clearContext",{})}unstable_setSessionConfigOption(A){throw Error("Method not implemented.")}authenticate(A){throw Error("Method not implemented.")}async prompt(A){let{sessionId:Q}=A;m6("Received prompt for session:",Q),eNA("Prompt params: %O",A);let B=this.sessions.get(Q);if(!B)throw Error(`Session ${Q} not found`);let I=await B.prompt(A);return m6("Prompt completed for session:",Q,"result:",I.stopReason),I}async cancel(A){let Q=this.sessions.get(A.sessionId);if(!Q)throw Error(`Session ${A.sessionId} not found`);await Q.abort()}extMethod(A,Q){throw Error("Method not implemented.")}extNotification(A,Q){throw Error("Method not implemented.")}}var AoQ,eNA;var QoQ=b(async()=>{oNA();u9();eaQ();await UE([L7(),naQ()]);AoQ=NA(a_(),1),eNA=AoQ.default("neovate:acp:agent")});var QMA=f((eYC,L00)=>{L00.exports={name:"@neovate/code",version:"0.28.0",type:"module",files:["dist","vendor"],main:"./dist/index.mjs",types:"./dist/index.d.ts",source:"./src/index.ts",bin:{neovate:"./dist/cli.mjs"},scripts:{dev:"bun ./src/cli.ts",format:"biome format .","build:type":"tsc --project tsconfig.json --emitDeclarationOnly --declarationDir dist-dts","build:cli":"bun build src/cli.ts --external react-devtools-core --minify --outfile dist/cli.mjs --target=node","build:index":"bun build src/index.ts --external react-devtools-core --minify --outfile dist/index.mjs --target=node","build:dts":"npm run build:type && api-extractor run --local --verbose","build:post":"bun scripts/post-build.ts",build:"rm -rf dist dist-dts && npm run build:cli && npm run build:index && npm run build:dts && npm run build:post",ci:"npm run typecheck && npm run format && npm run test && npm run build && npm run test:cli","detect-unused":"bun scripts/detect-unused.ts","extension:build":"pnpm --filter neovate-assistant build","extension:dev":"pnpm --filter neovate-assistant dev","extension:publish":"cd vscode-extension && npm run publish && cd ..","extension:package":"pnpm --filter neovate-assistant package","extension:bump":"pnpm --filter neovate-assistant bump",release:"npm run ci && bun scripts/release.ts","release:minor":"npm run ci && bun scripts/release.ts --minor","release:major":"npm run ci && bun scripts/release.ts --major",test:"vitest run","test:cli":"bun scripts/cli-integration-test.ts","test:watch":"vitest","test:e2e":"bun scripts/e2e.ts",typecheck:"tsc --noEmit",prepare:"husky",ready:"bun scripts/ready.ts","update:ripgrep":"bun scripts/updateRipgrep.ts"},keywords:["cli","neovate","neo","ai","coding-agent","agent"],authors:["chencheng <sorrycc@gmail.com> (https://github.com/sorrycc)"],homepage:"https://neovateai.dev",repository:{type:"git",url:"https://github.com/neovateai/neovate-code/"},bugs:{url:"https://github.com/neovateai/neovate-code/issues"},license:"MIT",description:"A coding agent to enhance your development workflow.",devDependencies:{"@agentclientprotocol/sdk":"^0.13.0","@ai-sdk/anthropic":"^3.0.35","@ai-sdk/google":"^3.0.20","@ai-sdk/mcp":"^1.0.18","@ai-sdk/openai":"^3.0.25","@ai-sdk/openai-compatible":"^2.0.26","@ai-sdk/provider":"^3.0.7","@biomejs/biome":"^2.3.13","@fastify/type-provider-typebox":"6.1.0","@microsoft/api-extractor":"^7.56.0","@modelcontextprotocol/inspector":"^0.19.0","@modelcontextprotocol/sdk":"^1.25.3","@openrouter/ai-sdk-provider":"^2.1.1","@types/bun":"^1.3.8","@types/debug":"^4.1.12","@types/degit":"^2.8.6","@types/lodash-es":"^4.17.12","@types/marked-terminal":"^6.1.1","@types/node":"^25.1.0","@types/react":"^19.2.10","@types/resolve":"^1.20.6","@types/turndown":"^5.0.6","@types/ws":"^8.18.1","@types/yargs-parser":"^21.0.3",ai:"^6.0.67",chalk:"^5.5.0",chardet:"^2.1.1","cli-highlight":"^2.1.11",clipboardy:"^5.1.0",debug:"^4.4.3",defu:"^6.1.4",degit:"^2.8.4",diff:"^8.0.3",fastify:"^5.7.2",fastmcp:"^3.31.0","front-matter":"^4.0.2",glob:"^13.0.0","gpt-tokenizer":"^3.4.0","gradient-string":"^3.0.0",husky:"^9.1.7",ink:"^6.6.0","ink-select-input":"^6.2.0","ink-spinner":"^5.0.0","is-unicode-supported":"^2.1.0",jiti:"^2.6.1",jsonrepair:"^3.13.2","lint-staged":"^16.2.7","lodash-es":"^4.17.23",marked:"^17.0.1","marked-terminal":"^7.3.0","oauth-providers":"^1.0.5",open:"^11.0.0",pathe:"^2.0.3",picocolors:"^1.1.1",portfinder:"^1.0.38",react:"^19.2.4",resolve:"^1.22.11","spawn-rx":"^5.1.2","strip-ansi":"^7.1.0",tar:"^7.5.7","terminal-link":"^5.0.0",turndown:"^7.2.2",typescript:"^5.9.3",undici:"6.13.0",vitest:"^4.0.18","wrap-ansi":"^9.0.0",ws:"^8.19.0","yargs-parser":"22.0.0",zod:"^4.3.6",zustand:"^5.0.11"},volta:{node:"22.11.0",pnpm:"10.13.1"},packageManager:"pnpm@10.13.1","lint-staged":{"*.{js,jsx,ts,tsx,json,css}":"biome format --write"},publishConfig:{access:"public"}}});var IoQ={};lI(IoQ,{runACP:()=>f00});import{Readable as R00,Writable as O00}from"stream";function c4(A,...Q){let B=new Date().toISOString();if(process.stderr.write(`[${B}] [ACP] ${A}
|
|
5949
5949
|
`),Q.length>0)process.stderr.write(`${JSON.stringify(Q,null,2)}
|
|
5950
5950
|
`)}async function f00(A){let Q=A.cwd||process.cwd();c4("Starting Neovate ACP agent"),c4("Working directory:",Q);let I=(await Promise.resolve().then(() => NA(QMA(),1))).version||"0.0.0";c4("Version:",I);let C={cwd:Q,...A.contextCreateOpts||{},productName:A.contextCreateOpts?.productName||nm,version:A.contextCreateOpts?.version||I,argvConfig:A.contextCreateOpts?.argvConfig||{quiet:!0},plugins:A.contextCreateOpts?.plugins||[],quiet:!0};C.quiet=!0,C.argvConfig=C.argvConfig||{},C.argvConfig.quiet=!0,y00("Context options: %O",C),c4("Setting up stdio streams for ACP communication");let E=O00.toWeb(process.stdout),D=R00.toWeb(process.stdin);c4("Creating ACP connection");let g=haQ(E,D),_=new nNA((F)=>{return c4("ACP connection established, creating agent"),new AMA(F,C)},g);c4("ACP agent ready, waiting for messages..."),process.on("SIGINT",()=>{c4("Received SIGINT, shutting down"),process.exit(0)}),process.on("SIGTERM",()=>{c4("Received SIGTERM, shutting down"),process.exit(0)}),process.on("uncaughtException",(F)=>{c4("Uncaught exception:",F.message),process.stderr.write(F.stack||"")}),process.on("unhandledRejection",(F)=>{c4("Unhandled rejection:",F)})}var BoQ,y00;var CoQ=b(async()=>{oNA();G0();await QoQ();BoQ=NA(a_(),1),y00=BoQ.default("neovate:acp")});var EoQ={};lI(EoQ,{runConfig:()=>P00});function T00(A){console.log(`
|
|
5951
5951
|
Usage:
|
|
@@ -6539,7 +6539,7 @@ Please report this to https://github.com/markedjs/marked.`,A){let I="<p>An error
|
|
|
6539
6539
|
`);if(!(!C&&F.length>Q))return{visibleLines:F,hiddenCount:0,shouldTruncate:!1};return{visibleLines:F.slice(0,Q),hiddenCount:F.length-Q,shouldTruncate:!0}},[A,C,Q]),_=E.join(`
|
|
6540
6540
|
`);return it.jsxDEV(e,{flexDirection:"column",children:[it.jsxDEV(c,{color:I?aQ.ERROR:B,children:[Bg.arrowDown," ",_]},void 0,!0,void 0,this),g&&it.jsxDEV(c,{color:"gray",dimColor:!0,children:["... ",D," more line",D===1?"":"s"," hidden (Press ctrl+o to expand) ..."]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)}R5();var gNA=NA(jnQ(),1),Iw=(...A)=>{let Q,B;if(A.length===0)throw Error("Missing gradient colors");if(!Array.isArray(A[0])){if(A.length===1)throw Error(`Expected an array of colors, received ${JSON.stringify(A[0])}`);Q=gNA.default(...A)}else Q=gNA.default(A[0]),B=_NA(A[1]);let I=(C,E)=>{return bQ0(C?C.toString():"",Q,E??B)};return I.multiline=(C,E)=>hQ0(C?C.toString():"",Q,E??B),I},SnQ=(A,Q,B)=>{return Q.interpolation?.toLowerCase()==="hsv"?A.hsv(B,Q.hsvSpin?.toLowerCase()||!1):A.rgb(B)};function bQ0(A,Q,B){let I=_NA(B),C=Math.max(A.replace(/\s/g,"").length,Q.stops.length),E=SnQ(Q,I,C),D="";for(let g of A)D+=g.match(/\s/g)?g:QI.hex(E.shift()?.toHex()||"#000")(g);return D}function hQ0(A,Q,B){let I=_NA(B),C=A.split(`
|
|
6541
6541
|
`),E=Math.max(...C.map((_)=>_.length),Q.stops.length),D=SnQ(Q,I,E),g=[];for(let _ of C){let F=D.slice(0),G="";for(let U of _)G+=QI.hex(F.shift()?.toHex()||"#000")(U);g.push(G)}return g.join(`
|
|
6542
|
-
`)}function _NA(A){let Q={interpolation:"rgb",hsvSpin:"short",...A};if(A!==void 0&&typeof A!=="object")throw TypeError(`Expected \`options\` to be an \`object\`, got \`${typeof A}\``);if(typeof Q.interpolation!=="string")throw TypeError(`Expected \`options.interpolation\` to be \`rgb\` or \`hsv\`, got \`${typeof Q.interpolation}\``);if(Q.interpolation.toLowerCase()==="hsv"&&typeof Q.hsvSpin!=="string")throw TypeError(`Expected \`options.hsvSpin\` to be a \`short\` or \`long\`, got \`${typeof Q.hsvSpin}\``);return Q}var xJ={atlas:{colors:["#feac5e","#c779d0","#4bc0c8"],options:{}},cristal:{colors:["#bdfff3","#4ac29a"],options:{}},teen:{colors:["#77a1d3","#79cbca","#e684ae"],options:{}},mind:{colors:["#473b7b","#3584a7","#30d2be"],options:{}},morning:{colors:["#ff5f6d","#ffc371"],options:{interpolation:"hsv"}},vice:{colors:["#5ee7df","#b490ca"],options:{interpolation:"hsv"}},passion:{colors:["#f43b47","#453a94"],options:{}},fruit:{colors:["#ff4e50","#f9d423"],options:{}},instagram:{colors:["#833ab4","#fd1d1d","#fcb045"],options:{}},retro:{colors:["#3f51b1","#5a55ae","#7b5fac","#8f6aae","#a86aa4","#cc6b8e","#f18271","#f3a469","#f7c978"],options:{}},summer:{colors:["#fdbb2d","#22c1c3"],options:{}},rainbow:{colors:["#ff0000","#ff0100"],options:{interpolation:"hsv",hsvSpin:"long"}},pastel:{colors:["#74ebd5","#74ecd5"],options:{interpolation:"hsv",hsvSpin:"long"}}};function bJ(A){let Q=(B)=>Iw(...A.colors)(B,A.options);return Q.multiline=(B="")=>Iw(...A.colors).multiline(B,A.options),Q}var vnQ=Iw,uQ0=bJ(xJ.atlas),mQ0=bJ(xJ.cristal),cQ0=bJ(xJ.teen),dQ0=bJ(xJ.mind),lQ0=bJ(xJ.morning),iQ0=bJ(xJ.vice),pQ0=bJ(xJ.passion),nQ0=bJ(xJ.fruit),aQ0=bJ(xJ.instagram),oQ0=bJ(xJ.retro),rQ0=bJ(xJ.summer),wNA=bJ(xJ.rainbow),FNA=bJ(xJ.pastel);Iw.atlas=uQ0;Iw.cristal=mQ0;Iw.teen=cQ0;Iw.mind=dQ0;Iw.morning=lQ0;Iw.vice=iQ0;Iw.passion=pQ0;Iw.fruit=nQ0;Iw.instagram=aQ0;Iw.retro=oQ0;Iw.summer=rQ0;Iw.rainbow=wNA;Iw.pastel=FNA;await II();var xnQ=NA(iQ(),1),bnQ=NA(uQ(),1);function JNA({text:A,colors:Q=["cyan","pink"],preset:B="custom",interpolation:I="rgb",hsvSpin:C="short",multiline:E=!1}){let D=xnQ.useMemo(()=>{if(!A)return"";let g;switch(B){case"rainbow":g=wNA;break;case"pastel":g=FNA;break;case"custom":default:g=vnQ(Q,{interpolation:I,hsvSpin:C});break}if(E)return g.multiline(A);return g(A)},[A,Q,B,I,C,E]);return bnQ.jsxDEV(c,{children:D},void 0,!1,void 0,this)}await iI();R$();await II();var mnQ=NA(iQ(),1),hJ=NA(uQ(),1),hnQ={completed:0,in_progress:1,pending:2},unQ={high:0,medium:1,low:2};function sQ0(A,Q){let B=hnQ[A.status]-hnQ[Q.status];if(B!==0)return B;return unQ[A.priority]-unQ[Q.priority]}function tQ0({todo:A,isCurrent:Q=!1,verbose:B,previousStatus:I}){let C=mnQ.useMemo(()=>{if(I!=="completed"&&A.status==="completed")return"green";if(I!=="in_progress"&&A.status==="in_progress")return"blue"},[A.status,I]);return hJ.jsxDEV(e,{flexDirection:"row",children:[hJ.jsxDEV(e,{minWidth:2,children:hJ.jsxDEV(c,{color:C,bold:Q,children:[A.status==="completed"?Bg.checkboxOn:Bg.checkboxOff," "]},void 0,!0,void 0,this)},void 0,!1,void 0,this),hJ.jsxDEV(e,{children:[hJ.jsxDEV(c,{bold:Q,color:C,strikethrough:A.status==="completed",children:A.content},void 0,!1,void 0,this),B&&hJ.jsxDEV(c,{dimColor:!0,children:[" ","(P",A.priority==="high"?"0":A.priority==="medium"?"1":"2",")"]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)}function eQ0({children:A,height:Q}){return hJ.jsxDEV(e,{flexDirection:"row",height:Q,overflowY:"hidden",children:[hJ.jsxDEV(c,{children:[" ",Bg.line," "]},void 0,!0,void 0,this),A]},void 0,!0,void 0,this)}function cnQ({oldTodos:A,newTodos:Q,verbose:B=!1}){if(Q.length===0)return hJ.jsxDEV(eQ0,{height:1,children:hJ.jsxDEV(c,{dimColor:!0,children:"(Empty todo list)"},void 0,!1,void 0,this)},void 0,!1,void 0,this);return hJ.jsxDEV(e,{flexDirection:"column",children:Q.sort(sQ0).map((I)=>{let C=A.find((E)=>E.id===I.id);return hJ.jsxDEV(tQ0,{todo:I,isCurrent:I.status==="in_progress",verbose:B,previousStatus:C?.status},I.id,!1,void 0,this)})},void 0,!1,void 0,this)}var QB=NA(uQ(),1);function AB0({message:A}){let Q=OL.useMemo(()=>{if(typeof A.content!=="string")return"";return A.content.replace(/<\/?bash-input>/g,"")},[A.content]);return QB.jsxDEV(e,{flexDirection:"column",marginTop:SD.MESSAGE_MARGIN_TOP,marginLeft:SD.MESSAGE_MARGIN_LEFT_USER,children:QB.jsxDEV(e,{children:[QB.jsxDEV(c,{color:aQ.CHAT_BORDER_BASH,bold:!0,children:["!"," "]},void 0,!0,void 0,this),QB.jsxDEV(c,{bold:!0,color:aQ.TOOL,children:Q},void 0,!1,void 0,this)]},void 0,!0,void 0,this)},void 0,!1,void 0,this)}function QB0({message:A}){let Q=OL.useMemo(()=>{if(typeof A.content!=="string")return!1;return A.content.startsWith("<bash-stderr>")},[A.content]),B=OL.useMemo(()=>{if(A.uiContent)return A.uiContent.replace(/^\n/,"");if(typeof A.content!=="string")return"";return A.content.replace(/<\/?bash-stdout>/g,"").replace(/<\/?bash-stderr>/g,"")},[A.content,A.uiContent]);return QB.jsxDEV(e,{flexDirection:"column",marginLeft:SD.MESSAGE_MARGIN_LEFT_USER,children:QB.jsxDEV(QNA,{content:B,isError:Q},void 0,!1,void 0,this)},void 0,!1,void 0,this)}function BB0(A){let Q=-1;for(let D=A.length-1;D>=0;D--){let g=A[D];if(g.role==="assistant"&&Array.isArray(g.content)){if(g.content.some((F)=>F.type==="tool_use")){Q=D;break}}}if(Q===-1)return{completedMessages:A,pendingMessages:[]};let B=A[Q];if(typeof B.content==="string")return{completedMessages:A,pendingMessages:[]};let I=B.content.filter((D)=>D.type==="tool_use").map((D)=>D.id),C=new Set;for(let D=Q+1;D<A.length;D++){let g=A[D];if(g.role==="tool")g.content.forEach((_)=>{if(_.toolCallId)C.add(_.toolCallId)});else if(g.role==="user"&&LW(g)){let _=g;if(_.content[0])C.add(_.content[0].id)}}if(I.every((D)=>C.has(D)))return{completedMessages:A,pendingMessages:[]};else return{completedMessages:A.slice(0,Q),pendingMessages:A.slice(Q)}}function IB0(A,Q){if(typeof A.content==="string")return[];let B=A.content.filter((C)=>C.type==="tool_use"),I=new Map;for(let C of Q)if(C.role==="tool")C.content.forEach((E)=>{I.set(E.toolCallId,u_A(E))});else if(C.role==="user"&&LW(C)){let E=C;if(E.content[0]){let D=E.content[0];I.set(D.id,D)}}return B.map((C)=>({toolUse:C,toolResult:I.get(C.id)}))}function pnQ(){let{userName:A,messages:Q,productName:B,sessionId:I,forkCounter:C}=PQ(),{completedMessages:E,pendingMessages:D}=OL.useMemo(()=>BB0(Q),[Q]);return QB.jsxDEV(e,{flexDirection:"column",children:[QB.jsxDEV(db,{items:["header",...E],children:(g,_)=>{if(g==="header")return QB.jsxDEV(_B0,{},"header",!1,void 0,this);return QB.jsxDEV(lnQ,{message:g,messages:E,productName:B,userName:A},_,!1,void 0,this)}},`${I}-${C}`,!1,void 0,this),D.map((g,_)=>QB.jsxDEV(lnQ,{message:g,messages:D,productName:B,userName:A},`pending-${g.uuid||_}`,!1,void 0,this))]},void 0,!0,void 0,this)}function CB0(){let{productASCIIArt:A}=PQ();if(!A)return null;return QB.jsxDEV(e,{children:QB.jsxDEV(JNA,{text:A,colors:["#FF3070","#FF6B9D"],multiline:!0},void 0,!1,void 0,this)},void 0,!1,void 0,this)}function EB0(){let{productName:A,version:Q}=PQ();return QB.jsxDEV(e,{marginTop:1,children:[QB.jsxDEV(JNA,{text:A.toUpperCase(),colors:["#FF3070","#FF6B9D"],multiline:!0},void 0,!1,void 0,this),QB.jsxDEV(c,{color:aQ.PRODUCT_VERSION,children:[" v",Q]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)}function DB0(){let{productName:A,initializeModelError:Q}=PQ();return QB.jsxDEV(e,{flexDirection:"column",marginTop:1,children:[QB.jsxDEV(c,{children:"Tips to getting started:"},void 0,!1,void 0,this),QB.jsxDEV(c,{children:"1. Input a task"},void 0,!1,void 0,this),QB.jsxDEV(c,{children:["2. ",QB.jsxDEV(c,{bold:!0,children:"/init"},void 0,!1,void 0,this)," to create a AGENTS.md file"]},void 0,!0,void 0,this),QB.jsxDEV(c,{children:["3. ",QB.jsxDEV(c,{bold:!0,children:"shift + tab"},void 0,!1,void 0,this)," to switch to plan mode"]},void 0,!0,void 0,this),QB.jsxDEV(c,{children:["4. ",QB.jsxDEV(c,{bold:!0,children:"/help"},void 0,!1,void 0,this)," for more information"]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)}function gB0(){let{model:A,providers:Q,initializeModelError:B}=PQ();if(A)return null;return QB.jsxDEV(e,{flexDirection:"column",children:[QB.jsxDEV(e,{flexDirection:"column",marginTop:1,borderStyle:"round",borderColor:"yellow",padding:1,children:[QB.jsxDEV(c,{bold:!0,color:"yellow",children:"! Model Configuration Required"},void 0,!1,void 0,this),QB.jsxDEV(e,{marginTop:1,flexDirection:"column",children:QB.jsxDEV(c,{children:"You haven't configured a model yet. Here are available providers:"},void 0,!1,void 0,this)},void 0,!1,void 0,this),QB.jsxDEV(e,{marginTop:1,flexDirection:"column",children:Object.values(Q).map((I)=>{let C=I,E=[];if(C.validEnvs&&C.validEnvs.length>0)E.push(`${Bg.tick} Envs: ${C.validEnvs.join(", ")}`);if(C.hasApiKey)E.push(`${Bg.tick} Logged`);let D=E.join(" | ");return QB.jsxDEV(e,{children:[QB.jsxDEV(c,{color:"cyan",children:[Bg.bullet," ",C.name]},void 0,!0,void 0,this),D&&QB.jsxDEV(c,{children:[" → ",inQ.default.gray(`(${D})`)]},void 0,!0,void 0,this)]},C.id,!0,void 0,this)})},void 0,!1,void 0,this),QB.jsxDEV(e,{marginTop:1,flexDirection:"column",children:[QB.jsxDEV(c,{children:"Suggested actions:"},void 0,!1,void 0,this),QB.jsxDEV(e,{marginTop:1,flexDirection:"column",children:[QB.jsxDEV(c,{children:[Bg.bullet," ",QB.jsxDEV(c,{bold:!0,color:"cyan",children:"/login"},void 0,!1,void 0,this)," ","- Configure API key for a provider"]},void 0,!0,void 0,this),QB.jsxDEV(c,{children:[Bg.bullet," ",QB.jsxDEV(c,{bold:!0,color:"cyan",children:"/model"},void 0,!1,void 0,this)," ","- Select a model to use"]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),B&&QB.jsxDEV(e,{marginTop:1,children:QB.jsxDEV(c,{color:"red",children:[Bg.warning," ",B]},void 0,!0,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}function _B0(){return QB.jsxDEV(e,{flexDirection:"column",paddingY:1,children:[QB.jsxDEV(CB0,{},void 0,!1,void 0,this),QB.jsxDEV(EB0,{},void 0,!1,void 0,this),QB.jsxDEV(DB0,{},void 0,!1,void 0,this),QB.jsxDEV(gB0,{},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}function wB0({message:A,userName:Q}){let B=c_A(A),I=RW(A);if(A.hidden)return null;return QB.jsxDEV(e,{flexDirection:"column",marginTop:SD.MESSAGE_MARGIN_TOP,marginLeft:SD.MESSAGE_MARGIN_LEFT_USER,children:[QB.jsxDEV(c,{bold:!0,color:aQ.USER,children:Q},void 0,!1,void 0,this),I?QB.jsxDEV(c,{color:aQ.CANCELED,children:"User canceled the request"},void 0,!1,void 0,this):QB.jsxDEV(e,{children:QB.jsxDEV(c,{backgroundColor:"#555555",color:"#cdcdcd",children:[B," "]},void 0,!0,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}function GNA({text:A,productName:Q}){return QB.jsxDEV(e,{flexDirection:"column",marginTop:SD.MESSAGE_MARGIN_TOP,children:[QB.jsxDEV(c,{bold:!0,color:"#FF3070",children:Q.toLowerCase()},void 0,!1,void 0,this),QB.jsxDEV(x7,{children:A},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}function FB0({part:A}){let{name:Q,displayName:B}=A,{transcriptMode:I}=PQ(),C=A.description,E=OL.useMemo(()=>{if(!C)return;if(I)return C;return C.length>100?`${C.substring(0,97)}...`:C},[C,I]);return QB.jsxDEV(e,{marginTop:SD.MESSAGE_MARGIN_TOP,flexDirection:"row",flexWrap:"wrap",children:[QB.jsxDEV(c,{bold:!0,color:aQ.TOOL,children:B||Q},void 0,!1,void 0,this),E&&QB.jsxDEV(c,{color:aQ.TOOL_DESCRIPTION,children:["(",E,")"]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)}function JB0({pair:A}){if(A.toolUse.name==="task")return QB.jsxDEV(qnQ,{toolUse:A.toolUse,toolResult:A.toolResult},void 0,!1,void 0,this);if(A.toolUse.name==="ExitPlanMode")return QB.jsxDEV(VnQ,{toolUse:A.toolUse,toolResult:A.toolResult},void 0,!1,void 0,this);return QB.jsxDEV(e,{flexDirection:"column",children:[QB.jsxDEV(FB0,{part:A.toolUse},void 0,!1,void 0,this),A.toolResult&&QB.jsxDEV(e,{marginTop:SD.MESSAGE_MARGIN_TOP_TOOL_RESULT,children:QB.jsxDEV(nnQ,{part:A.toolResult},void 0,!1,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}function GB0({message:A,messages:Q,productName:B}){if(typeof A.content==="string")return QB.jsxDEV(GNA,{text:A.content,productName:B},void 0,!1,void 0,this);let I=A.content.filter((_)=>_.type==="text"||_.type==="reasoning");if(A.content.filter((_)=>_.type==="tool_use").length===0)return QB.jsxDEV(QB.Fragment,{children:I.map((_,F)=>{if(_.type==="text")return QB.jsxDEV(GNA,{text:_.text,productName:B},`text-${F}`,!1,void 0,this);if(_.type==="reasoning")return QB.jsxDEV(dnQ,{text:_.text},`thinking-${F}`,!1,void 0,this);return null})},void 0,!1,void 0,this);let E=Q.findIndex((_)=>_.uuid===A.uuid),D=E>=0?Q.slice(E+1):[],g=IB0(A,D);return QB.jsxDEV(QB.Fragment,{children:[I.map((_,F)=>{if(_.type==="text")return QB.jsxDEV(GNA,{text:_.text,productName:B},`text-${F}`,!1,void 0,this);if(_.type==="reasoning")return QB.jsxDEV(dnQ,{text:_.text},`thinking-${F}`,!1,void 0,this);return null}),g.map((_)=>QB.jsxDEV(JB0,{pair:_},_.toolUse.id,!1,void 0,this))]},void 0,!0,void 0,this)}function dnQ({text:A}){return QB.jsxDEV(e,{flexDirection:"column",marginTop:SD.MESSAGE_MARGIN_TOP,children:[QB.jsxDEV(c,{bold:!0,color:"gray",children:"thinking"},void 0,!1,void 0,this),QB.jsxDEV(c,{color:"gray",italic:!0,children:A},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}function nnQ({part:A}){let{transcriptMode:Q}=PQ(),{result:B,input:I}=A;if(B.isError){let D=B.returnDisplay||B.llmContent;if(typeof D!=="string")D=JSON.stringify(D);return QB.jsxDEV(c,{color:aQ.ERROR,children:D},void 0,!1,void 0,this)}let C=["diff_viewer","todo_read","todo_write"];if(typeof B.returnDisplay==="object"&&C.includes(B.returnDisplay.type))switch(B.returnDisplay.type){case"diff_viewer":{let{originalContent:D,newContent:g,filePath:_,startLineNumber:F}=B.returnDisplay,G=typeof D==="string"?D:I[D.inputKey]??"",U=typeof g==="string"?g:I[g.inputKey]??"";return QB.jsxDEV(Vt,{originalContent:G,newContent:U,fileName:_,maxHeight:Q?1/0:10,startLineNumber:F},void 0,!1,void 0,this)}case"todo_write":return QB.jsxDEV(cnQ,{oldTodos:B.returnDisplay.oldTodos,newTodos:B.returnDisplay.newTodos,verbose:!1},void 0,!1,void 0,this);default:break}let E=B.returnDisplay||B.llmContent;if(typeof E!=="string")E=JSON.stringify(E);if(A.name==="bash")return QB.jsxDEV(QNA,{content:E},void 0,!1,void 0,this);return QB.jsxDEV(c,{color:aQ.TOOL_RESULT,children:[Bg.arrowDown," ",E]},void 0,!0,void 0,this)}function YB0({message:A}){if(A.content.length===0)return null;let Q=A.content[0];return QB.jsxDEV(e,{flexDirection:"column",marginTop:SD.MESSAGE_MARGIN_TOP_TOOL_RESULT,children:QB.jsxDEV(nnQ,{part:Q},void 0,!1,void 0,this)},void 0,!1,void 0,this)}function lnQ({message:A,messages:Q,productName:B,userName:I}){if(A.role==="user"){if(Yc(A))return QB.jsxDEV(AB0,{message:A},void 0,!1,void 0,this);else if(Uc(A))return QB.jsxDEV(QB0,{message:A},void 0,!1,void 0,this);if(LW(A))return QB.jsxDEV(YB0,{message:A},void 0,!1,void 0,this);return QB.jsxDEV(wB0,{message:A,userName:I},void 0,!1,void 0,this)}if(A.role==="tool")return null;if(A.role==="assistant")return QB.jsxDEV(GB0,{message:A,messages:Q,productName:B},void 0,!1,void 0,this);return null}A_();await UE([II(),iI()]);var u6=NA(uQ(),1);function anQ(){let{queuedMessages:A}=PQ();if(A.length===0)return null;return u6.jsxDEV(e,{flexDirection:"column",borderStyle:"round",borderColor:aQ.WARNING,paddingX:1,children:[u6.jsxDEV(e,{flexDirection:"row",justifyContent:"space-between",children:u6.jsxDEV(c,{bold:!0,color:aQ.WARNING,children:["Queued Messages (",A.length,")"]},void 0,!0,void 0,this)},void 0,!1,void 0,this),u6.jsxDEV(e,{flexDirection:"column",marginTop:1,children:A.map((Q,B)=>u6.jsxDEV(e,{flexDirection:"row",children:[u6.jsxDEV(c,{color:"gray",children:[B+1,"."]},void 0,!0,void 0,this),u6.jsxDEV(c,{color:"white",children:Q.length>80?Q.substring(0,77)+"...":Q},void 0,!1,void 0,this)]},B,!0,void 0,this))},void 0,!1,void 0,this),u6.jsxDEV(e,{marginTop:1,children:u6.jsxDEV(c,{color:"yellow",children:"Queue will execute after current task completes"},void 0,!1,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}ys();await iI();await II();var tS=NA(uQ(),1);function onQ(){return tS.jsxDEV(e,{flexDirection:"column",marginTop:1,children:[tS.jsxDEV(e,{borderStyle:"single",borderColor:"gray",borderTop:!0,borderBottom:!1,borderLeft:!1,borderRight:!1},void 0,!1,void 0,this),tS.jsxDEV(e,{children:tS.jsxDEV(c,{dimColor:!0,children:[" ","Showing detailed transcript · ctrl+o to toggle"]},void 0,!0,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}await iI();var eS=NA(iQ(),1);function rnQ(){let A=PQ((g)=>g.status),Q=PQ((g)=>g.approvalModal),B=PQ((g)=>g.isWindowFocused),I=PQ((g)=>g.bridge),C=PQ((g)=>g.cwd),E=eS.useRef(A),D=eS.useRef(Q);eS.useEffect(()=>{let g=E.current,_=D.current;if(E.current=A,D.current=Q,!I||!C)return;if(B)return;if((g==="processing"||g==="planning"||g==="tool_executing"||g==="compacting")&&A==="idle"||!_&&!!Q)I.request("config.get",{cwd:C,key:"notification"}).then((X)=>{let H=X.data?.value;if(H!==!1)I.request("utils.notify",{cwd:C,config:H})})},[A,Q,B,I,C])}var UB0=typeof global=="object"&&global&&global.Object===Object&&global,snQ=UB0;var XB0=typeof self=="object"&&self&&self.Object===Object&&self,HB0=snQ||XB0||Function("return this")(),nt=HB0;var KB0=nt.Symbol,yL=KB0;var tnQ=Object.prototype,$B0=tnQ.hasOwnProperty,ZB0=tnQ.toString,Av=yL?yL.toStringTag:void 0;function zB0(A){var Q=$B0.call(A,Av),B=A[Av];try{A[Av]=void 0;var I=!0}catch(E){}var C=ZB0.call(A);if(I)if(Q)A[Av]=B;else delete A[Av];return C}var enQ=zB0;var WB0=Object.prototype,qB0=WB0.toString;function NB0(A){return qB0.call(A)}var AaQ=NB0;var MB0="[object Null]",VB0="[object Undefined]",QaQ=yL?yL.toStringTag:void 0;function LB0(A){if(A==null)return A===void 0?VB0:MB0;return QaQ&&QaQ in Object(A)?enQ(A):AaQ(A)}var BaQ=LB0;function RB0(A){return A!=null&&typeof A=="object"}var IaQ=RB0;var OB0="[object Symbol]";function yB0(A){return typeof A=="symbol"||IaQ(A)&&BaQ(A)==OB0}var CaQ=yB0;var fB0=/\s/;function TB0(A){var Q=A.length;while(Q--&&fB0.test(A.charAt(Q)));return Q}var EaQ=TB0;var PB0=/^\s+/;function kB0(A){return A?A.slice(0,EaQ(A)+1).replace(PB0,""):A}var DaQ=kB0;function jB0(A){var Q=typeof A;return A!=null&&(Q=="object"||Q=="function")}var Qv=jB0;var gaQ=NaN,SB0=/^[-+]0x[0-9a-f]+$/i,vB0=/^0b[01]+$/i,xB0=/^0o[0-7]+$/i,bB0=parseInt;function hB0(A){if(typeof A=="number")return A;if(CaQ(A))return gaQ;if(Qv(A)){var Q=typeof A.valueOf=="function"?A.valueOf():A;A=Qv(Q)?Q+"":Q}if(typeof A!="string")return A===0?A:+A;A=DaQ(A);var B=vB0.test(A);return B||xB0.test(A)?bB0(A.slice(2),B?2:8):SB0.test(A)?gaQ:+A}var YNA=hB0;var uB0=function(){return nt.Date.now()},at=uB0;var mB0="Expected a function",cB0=Math.max,dB0=Math.min;function lB0(A,Q,B){var I,C,E,D,g,_,F=0,G=!1,U=!1,X=!0;if(typeof A!="function")throw TypeError(mB0);if(Q=YNA(Q)||0,Qv(B))G=!!B.leading,U="maxWait"in B,E=U?cB0(YNA(B.maxWait)||0,Q):E,X="trailing"in B?!!B.trailing:X;function H(P){var O=I,v=C;return I=C=void 0,F=P,D=A.apply(v,O),D}function K(P){return F=P,g=setTimeout(q,Q),G?H(P):D}function Z(P){var O=P-_,v=P-F,u=Q-O;return U?dB0(u,E-v):u}function W(P){var O=P-_,v=P-F;return _===void 0||O>=Q||O<0||U&&v>=E}function q(){var P=at();if(W(P))return V(P);g=setTimeout(q,Z(P))}function V(P){if(g=void 0,X&&I)return H(P);return I=C=void 0,D}function M(){if(g!==void 0)clearTimeout(g);F=0,I=_=C=g=void 0}function L(){return g===void 0?D:V(at())}function k(){var P=at(),O=W(P);if(I=arguments,C=this,_=P,O){if(g===void 0)return K(_);if(U)return clearTimeout(g),g=setTimeout(q,Q),H(_)}if(g===void 0)g=setTimeout(q,Q);return D}return k.cancel=M,k.flush=L,k}var UNA=lB0;var h7=NA(iQ(),1),iB0=500,pB0=1,nB0=(A)=>new Promise((Q)=>setTimeout(Q,A));function _aQ(){let[A,Q]=h7.useState(0),B=h7.useRef(process.stdout.columns||0);h7.useEffect(()=>{let C=UNA(async()=>{if(!process.stdout.isTTY)return;let E=process.stdout.columns||0,D=E-B.current;if(Math.abs(D)>pB0)B.current=E,await K7(),await nB0(20),Q((g)=>g+1)},iB0);return process.stdout.on("resize",C),()=>{process.stdout.off("resize",C),C.cancel()}},[]);let I=h7.useCallback(()=>{K7().catch((C)=>{console.error("Failed to clear terminal:",C)}),Q((C)=>C+1)},[]);return{forceRerender:A,forceUpdate:I}}var ew=NA(uQ(),1);function aB0(){let{slashCommandJSX:A}=PQ();return ew.jsxDEV(e,{children:A},void 0,!1,void 0,this)}function waQ(){let{forceRerender:A}=_aQ();rnQ();let{forkModalVisible:Q,fork:B,hideForkModal:I,forkParentUuid:C,forkCounter:E,transcriptMode:D,toggleTranscriptMode:g,bridge:_,cwd:F,sessionId:G}=PQ(),U=PQ((X)=>X.messages);return BI((X,H)=>{if(H.ctrl&&X==="o"){K7(),g();return}if(D){if(H.escape||H.ctrl&&X==="c")K7(),g();return}}),ew.jsxDEV(Os,{children:[ew.jsxDEV(e,{flexDirection:"column",children:[ew.jsxDEV(pnQ,{},void 0,!1,void 0,this),ew.jsxDEV(PpQ,{},void 0,!1,void 0,this),ew.jsxDEV(nkQ,{},void 0,!1,void 0,this),ew.jsxDEV(anQ,{},void 0,!1,void 0,this),D?ew.jsxDEV(onQ,{},void 0,!1,void 0,this):ew.jsxDEV(wnQ,{},void 0,!1,void 0,this),ew.jsxDEV(JnQ,{},void 0,!1,void 0,this),ew.jsxDEV(SpQ,{},void 0,!1,void 0,this)]},`${A}-${C}-${E}-${D}`,!0,void 0,this),Q&&G&&ew.jsxDEV(YnQ,{messages:U,onSelect:(X,H)=>{B(X,H)},onClose:()=>{I()},sessionId:G,cwd:F,bridge:_},void 0,!1,void 0,this),ew.jsxDEV(fpQ,{},void 0,!1,void 0,this),ew.jsxDEV(aB0,{},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}await iI();G0();u9();class XNA{appStore;messageBus;constructor(A){this.appStore=A.appStore,this.messageBus=new t1,new FaQ(this.messageBus,this.appStore)}request(A,Q,B={}){return this.messageBus.request(A,Q,B)}emitEvent(A,Q){return this.messageBus.emitEvent(A,Q)}onEvent(A,Q){return this.messageBus.onEvent(A,Q)}async requestMoveToBackground(A){return this.messageBus.emitEvent(p5.MOVE_TO_BACKGROUND,{taskId:A})}}class FaQ{messageBus;appStore;constructor(A,Q){this.messageBus=A,this.appStore=Q,this.registerHandlers()}registerHandlers(){this.messageBus.registerHandler("toolApproval",async({toolUse:A,category:Q,sessionId:B})=>{let I=await this.appStore.approveToolUse({toolUse:A,category:Q,sessionId:B});return{approved:I.approved,params:I.params,denyReason:I.denyReason}}),this.messageBus.onEvent(p5.PROMPT_BACKGROUND,(A)=>{this.appStore.setBashBackgroundPrompt(A)}),this.messageBus.onEvent(p5.BACKGROUND_MOVED,()=>{this.appStore.clearBashBackgroundPrompt()})}}mY();qN();u9();fF();await L7();tg();process.env.YARGS_MIN_NODE_VERSION="18";async function QIB(A){let{default:Q}=await Promise.resolve().then(() => (wU(),_U)),B=Q(A,{alias:{model:"m",help:"h",resume:"r",quiet:"q",continue:"c",version:"v"},default:{mcp:!0,mcpConfig:[]},array:["plugin","mcpConfig"],boolean:["help","mcp","quiet","continue","version"],number:["port"],string:["appendSystemPrompt","approvalMode","cwd","host","language","mcpConfig","model","outputFormat","outputStyle","planModel","smallModel","visionModel","resume","systemPrompt","tools"]});if(B.resume&&B.continue)throw Error("Cannot use --resume and --continue at the same time");if(B.model==="")throw Error("Model cannot be empty string");return B}function UJ0(A){console.log(`
|
|
6542
|
+
`)}function _NA(A){let Q={interpolation:"rgb",hsvSpin:"short",...A};if(A!==void 0&&typeof A!=="object")throw TypeError(`Expected \`options\` to be an \`object\`, got \`${typeof A}\``);if(typeof Q.interpolation!=="string")throw TypeError(`Expected \`options.interpolation\` to be \`rgb\` or \`hsv\`, got \`${typeof Q.interpolation}\``);if(Q.interpolation.toLowerCase()==="hsv"&&typeof Q.hsvSpin!=="string")throw TypeError(`Expected \`options.hsvSpin\` to be a \`short\` or \`long\`, got \`${typeof Q.hsvSpin}\``);return Q}var xJ={atlas:{colors:["#feac5e","#c779d0","#4bc0c8"],options:{}},cristal:{colors:["#bdfff3","#4ac29a"],options:{}},teen:{colors:["#77a1d3","#79cbca","#e684ae"],options:{}},mind:{colors:["#473b7b","#3584a7","#30d2be"],options:{}},morning:{colors:["#ff5f6d","#ffc371"],options:{interpolation:"hsv"}},vice:{colors:["#5ee7df","#b490ca"],options:{interpolation:"hsv"}},passion:{colors:["#f43b47","#453a94"],options:{}},fruit:{colors:["#ff4e50","#f9d423"],options:{}},instagram:{colors:["#833ab4","#fd1d1d","#fcb045"],options:{}},retro:{colors:["#3f51b1","#5a55ae","#7b5fac","#8f6aae","#a86aa4","#cc6b8e","#f18271","#f3a469","#f7c978"],options:{}},summer:{colors:["#fdbb2d","#22c1c3"],options:{}},rainbow:{colors:["#ff0000","#ff0100"],options:{interpolation:"hsv",hsvSpin:"long"}},pastel:{colors:["#74ebd5","#74ecd5"],options:{interpolation:"hsv",hsvSpin:"long"}}};function bJ(A){let Q=(B)=>Iw(...A.colors)(B,A.options);return Q.multiline=(B="")=>Iw(...A.colors).multiline(B,A.options),Q}var vnQ=Iw,uQ0=bJ(xJ.atlas),mQ0=bJ(xJ.cristal),cQ0=bJ(xJ.teen),dQ0=bJ(xJ.mind),lQ0=bJ(xJ.morning),iQ0=bJ(xJ.vice),pQ0=bJ(xJ.passion),nQ0=bJ(xJ.fruit),aQ0=bJ(xJ.instagram),oQ0=bJ(xJ.retro),rQ0=bJ(xJ.summer),wNA=bJ(xJ.rainbow),FNA=bJ(xJ.pastel);Iw.atlas=uQ0;Iw.cristal=mQ0;Iw.teen=cQ0;Iw.mind=dQ0;Iw.morning=lQ0;Iw.vice=iQ0;Iw.passion=pQ0;Iw.fruit=nQ0;Iw.instagram=aQ0;Iw.retro=oQ0;Iw.summer=rQ0;Iw.rainbow=wNA;Iw.pastel=FNA;await II();var xnQ=NA(iQ(),1),bnQ=NA(uQ(),1);function JNA({text:A,colors:Q=["cyan","pink"],preset:B="custom",interpolation:I="rgb",hsvSpin:C="short",multiline:E=!1}){let D=xnQ.useMemo(()=>{if(!A)return"";let g;switch(B){case"rainbow":g=wNA;break;case"pastel":g=FNA;break;case"custom":default:g=vnQ(Q,{interpolation:I,hsvSpin:C});break}if(E)return g.multiline(A);return g(A)},[A,Q,B,I,C,E]);return bnQ.jsxDEV(c,{children:D},void 0,!1,void 0,this)}await iI();R$();await II();var mnQ=NA(iQ(),1),hJ=NA(uQ(),1),hnQ={completed:0,in_progress:1,pending:2},unQ={high:0,medium:1,low:2};function sQ0(A,Q){let B=hnQ[A.status]-hnQ[Q.status];if(B!==0)return B;return unQ[A.priority]-unQ[Q.priority]}function tQ0({todo:A,isCurrent:Q=!1,verbose:B,previousStatus:I}){let C=mnQ.useMemo(()=>{if(I!=="completed"&&A.status==="completed")return"green";if(I!=="in_progress"&&A.status==="in_progress")return"blue"},[A.status,I]);return hJ.jsxDEV(e,{flexDirection:"row",children:[hJ.jsxDEV(e,{minWidth:2,children:hJ.jsxDEV(c,{color:C,bold:Q,children:[A.status==="completed"?Bg.checkboxOn:Bg.checkboxOff," "]},void 0,!0,void 0,this)},void 0,!1,void 0,this),hJ.jsxDEV(e,{children:[hJ.jsxDEV(c,{bold:Q,color:C,strikethrough:A.status==="completed",children:A.content},void 0,!1,void 0,this),B&&hJ.jsxDEV(c,{dimColor:!0,children:[" ","(P",A.priority==="high"?"0":A.priority==="medium"?"1":"2",")"]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)}function eQ0({children:A,height:Q}){return hJ.jsxDEV(e,{flexDirection:"row",height:Q,overflowY:"hidden",children:[hJ.jsxDEV(c,{children:[" ",Bg.line," "]},void 0,!0,void 0,this),A]},void 0,!0,void 0,this)}function cnQ({oldTodos:A,newTodos:Q,verbose:B=!1}){if(Q.length===0)return hJ.jsxDEV(eQ0,{height:1,children:hJ.jsxDEV(c,{dimColor:!0,children:"(Empty todo list)"},void 0,!1,void 0,this)},void 0,!1,void 0,this);return hJ.jsxDEV(e,{flexDirection:"column",children:Q.sort(sQ0).map((I)=>{let C=A.find((E)=>E.id===I.id);return hJ.jsxDEV(tQ0,{todo:I,isCurrent:I.status==="in_progress",verbose:B,previousStatus:C?.status},I.id,!1,void 0,this)})},void 0,!1,void 0,this)}var QB=NA(uQ(),1);function AB0({message:A}){let Q=OL.useMemo(()=>{if(typeof A.content!=="string")return"";return A.content.replace(/<\/?bash-input>/g,"")},[A.content]);return QB.jsxDEV(e,{flexDirection:"column",marginTop:SD.MESSAGE_MARGIN_TOP,marginLeft:SD.MESSAGE_MARGIN_LEFT_USER,children:QB.jsxDEV(e,{children:[QB.jsxDEV(c,{color:aQ.CHAT_BORDER_BASH,bold:!0,children:["!"," "]},void 0,!0,void 0,this),QB.jsxDEV(c,{bold:!0,color:aQ.TOOL,children:Q},void 0,!1,void 0,this)]},void 0,!0,void 0,this)},void 0,!1,void 0,this)}function QB0({message:A}){let Q=OL.useMemo(()=>{if(typeof A.content!=="string")return!1;return A.content.startsWith("<bash-stderr>")},[A.content]),B=OL.useMemo(()=>{if(A.uiContent)return A.uiContent.replace(/^\n/,"");if(typeof A.content!=="string")return"";return A.content.replace(/<\/?bash-stdout>/g,"").replace(/<\/?bash-stderr>/g,"")},[A.content,A.uiContent]);return QB.jsxDEV(e,{flexDirection:"column",marginLeft:SD.MESSAGE_MARGIN_LEFT_USER,children:QB.jsxDEV(QNA,{content:B,isError:Q},void 0,!1,void 0,this)},void 0,!1,void 0,this)}function BB0(A){let Q=-1;for(let D=A.length-1;D>=0;D--){let g=A[D];if(g.role==="assistant"&&Array.isArray(g.content)){if(g.content.some((F)=>F.type==="tool_use")){Q=D;break}}}if(Q===-1)return{completedMessages:A,pendingMessages:[]};let B=A[Q];if(typeof B.content==="string")return{completedMessages:A,pendingMessages:[]};let I=B.content.filter((D)=>D.type==="tool_use").map((D)=>D.id),C=new Set;for(let D=Q+1;D<A.length;D++){let g=A[D];if(g.role==="tool")g.content.forEach((_)=>{if(_.toolCallId)C.add(_.toolCallId)});else if(g.role==="user"&&LW(g)){let _=g;if(_.content[0])C.add(_.content[0].id)}}if(I.every((D)=>C.has(D)))return{completedMessages:A,pendingMessages:[]};else return{completedMessages:A.slice(0,Q),pendingMessages:A.slice(Q)}}function IB0(A,Q){if(typeof A.content==="string")return[];let B=A.content.filter((C)=>C.type==="tool_use"),I=new Map;for(let C of Q)if(C.role==="tool")C.content.forEach((E)=>{I.set(E.toolCallId,u_A(E))});else if(C.role==="user"&&LW(C)){let E=C;if(E.content[0]){let D=E.content[0];I.set(D.id,D)}}return B.map((C)=>({toolUse:C,toolResult:I.get(C.id)}))}function pnQ(){let{userName:A,messages:Q,productName:B,sessionId:I,forkCounter:C}=PQ(),{completedMessages:E,pendingMessages:D}=OL.useMemo(()=>BB0(Q),[Q]);return QB.jsxDEV(e,{flexDirection:"column",children:[QB.jsxDEV(db,{items:["header",...E],children:(g,_)=>{if(g==="header")return QB.jsxDEV(_B0,{},"header",!1,void 0,this);return QB.jsxDEV(lnQ,{message:g,messages:E,productName:B,userName:A},_,!1,void 0,this)}},`${I}-${C}`,!1,void 0,this),D.map((g,_)=>QB.jsxDEV(lnQ,{message:g,messages:D,productName:B,userName:A},`pending-${g.uuid||_}`,!1,void 0,this))]},void 0,!0,void 0,this)}function CB0(){let{productASCIIArt:A}=PQ();if(!A)return null;return QB.jsxDEV(e,{children:QB.jsxDEV(JNA,{text:A,colors:["#FF3070","#FF6B9D"],multiline:!0},void 0,!1,void 0,this)},void 0,!1,void 0,this)}function EB0(){let{productName:A,version:Q}=PQ();return QB.jsxDEV(e,{marginTop:1,children:[QB.jsxDEV(JNA,{text:A.toUpperCase(),colors:["#FF3070","#FF6B9D"],multiline:!0},void 0,!1,void 0,this),QB.jsxDEV(c,{color:aQ.PRODUCT_VERSION,children:[" v",Q]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)}function DB0(){let{productName:A,initializeModelError:Q}=PQ();return QB.jsxDEV(e,{flexDirection:"column",marginTop:1,children:[QB.jsxDEV(c,{children:"Tips to getting started:"},void 0,!1,void 0,this),QB.jsxDEV(c,{children:"1. Input a task"},void 0,!1,void 0,this),QB.jsxDEV(c,{children:["2. ",QB.jsxDEV(c,{bold:!0,children:"/init"},void 0,!1,void 0,this)," to create a AGENTS.md file"]},void 0,!0,void 0,this),QB.jsxDEV(c,{children:["3. ",QB.jsxDEV(c,{bold:!0,children:"shift + tab"},void 0,!1,void 0,this)," to switch to plan mode"]},void 0,!0,void 0,this),QB.jsxDEV(c,{children:["4. ",QB.jsxDEV(c,{bold:!0,children:"/help"},void 0,!1,void 0,this)," for more information"]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)}function gB0(){let{model:A,providers:Q,initializeModelError:B}=PQ();if(A)return null;return QB.jsxDEV(e,{flexDirection:"column",children:[QB.jsxDEV(e,{flexDirection:"column",marginTop:1,borderStyle:"round",borderColor:"yellow",padding:1,children:[QB.jsxDEV(c,{bold:!0,color:"yellow",children:"! Model Configuration Required"},void 0,!1,void 0,this),QB.jsxDEV(e,{marginTop:1,flexDirection:"column",children:QB.jsxDEV(c,{children:"You haven't configured a model yet. Here are available providers:"},void 0,!1,void 0,this)},void 0,!1,void 0,this),QB.jsxDEV(e,{marginTop:1,flexDirection:"column",children:Object.values(Q).map((I)=>{let C=I,E=[];if(C.validEnvs&&C.validEnvs.length>0)E.push(`${Bg.tick} Envs: ${C.validEnvs.join(", ")}`);if(C.hasApiKey)E.push(`${Bg.tick} Logged`);let D=E.join(" | ");return QB.jsxDEV(e,{children:[QB.jsxDEV(c,{color:"cyan",children:[Bg.bullet," ",C.name]},void 0,!0,void 0,this),D&&QB.jsxDEV(c,{children:[" → ",inQ.default.gray(`(${D})`)]},void 0,!0,void 0,this)]},C.id,!0,void 0,this)})},void 0,!1,void 0,this),QB.jsxDEV(e,{marginTop:1,flexDirection:"column",children:[QB.jsxDEV(c,{children:"Suggested actions:"},void 0,!1,void 0,this),QB.jsxDEV(e,{marginTop:1,flexDirection:"column",children:[QB.jsxDEV(c,{children:[Bg.bullet," ",QB.jsxDEV(c,{bold:!0,color:"cyan",children:"/login"},void 0,!1,void 0,this)," ","- Configure API key for a provider"]},void 0,!0,void 0,this),QB.jsxDEV(c,{children:[Bg.bullet," ",QB.jsxDEV(c,{bold:!0,color:"cyan",children:"/model"},void 0,!1,void 0,this)," ","- Select a model to use"]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),B&&QB.jsxDEV(e,{marginTop:1,children:QB.jsxDEV(c,{color:"red",children:[Bg.warning," ",B]},void 0,!0,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}function _B0(){return QB.jsxDEV(e,{flexDirection:"column",paddingY:1,children:[QB.jsxDEV(CB0,{},void 0,!1,void 0,this),QB.jsxDEV(EB0,{},void 0,!1,void 0,this),QB.jsxDEV(DB0,{},void 0,!1,void 0,this),QB.jsxDEV(gB0,{},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}function wB0({message:A,userName:Q}){let B=c_A(A),I=RW(A);if(A.hidden)return null;return QB.jsxDEV(e,{flexDirection:"column",marginTop:SD.MESSAGE_MARGIN_TOP,marginLeft:SD.MESSAGE_MARGIN_LEFT_USER,children:[QB.jsxDEV(c,{bold:!0,color:aQ.USER,children:Q},void 0,!1,void 0,this),I?QB.jsxDEV(c,{color:aQ.CANCELED,children:"User canceled the request"},void 0,!1,void 0,this):QB.jsxDEV(e,{children:QB.jsxDEV(c,{backgroundColor:"#555555",color:"#cdcdcd",children:[B," "]},void 0,!0,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}function GNA({text:A,productName:Q}){return QB.jsxDEV(e,{flexDirection:"column",marginTop:SD.MESSAGE_MARGIN_TOP,children:[QB.jsxDEV(c,{bold:!0,color:"#FF3070",children:Q.toLowerCase()},void 0,!1,void 0,this),QB.jsxDEV(x7,{children:A},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}function FB0({part:A}){let{name:Q,displayName:B}=A,{transcriptMode:I}=PQ(),C=A.description,E=OL.useMemo(()=>{if(!C)return;if(I)return C;return C.length>100?`${C.substring(0,97)}...`:C},[C,I]);return QB.jsxDEV(e,{marginTop:SD.MESSAGE_MARGIN_TOP,flexDirection:"row",flexWrap:"wrap",children:[QB.jsxDEV(c,{bold:!0,color:aQ.TOOL,children:B||Q},void 0,!1,void 0,this),E&&QB.jsxDEV(c,{color:aQ.TOOL_DESCRIPTION,children:["(",E,")"]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)}function JB0({pair:A}){if(A.toolUse.name==="task")return QB.jsxDEV(qnQ,{toolUse:A.toolUse,toolResult:A.toolResult},void 0,!1,void 0,this);if(A.toolUse.name==="ExitPlanMode")return QB.jsxDEV(VnQ,{toolUse:A.toolUse,toolResult:A.toolResult},void 0,!1,void 0,this);return QB.jsxDEV(e,{flexDirection:"column",children:[QB.jsxDEV(FB0,{part:A.toolUse},void 0,!1,void 0,this),A.toolResult&&QB.jsxDEV(e,{marginTop:SD.MESSAGE_MARGIN_TOP_TOOL_RESULT,children:QB.jsxDEV(nnQ,{part:A.toolResult},void 0,!1,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}function GB0({message:A,messages:Q,productName:B}){if(typeof A.content==="string")return QB.jsxDEV(GNA,{text:A.content,productName:B},void 0,!1,void 0,this);let I=A.content.filter((_)=>_.type==="text"||_.type==="reasoning");if(A.content.filter((_)=>_.type==="tool_use").length===0)return QB.jsxDEV(QB.Fragment,{children:I.map((_,F)=>{if(_.type==="text")return QB.jsxDEV(GNA,{text:_.text,productName:B},`text-${F}`,!1,void 0,this);if(_.type==="reasoning")return QB.jsxDEV(dnQ,{text:_.text},`thinking-${F}`,!1,void 0,this);return null})},void 0,!1,void 0,this);let E=Q.findIndex((_)=>_.uuid===A.uuid),D=E>=0?Q.slice(E+1):[],g=IB0(A,D);return QB.jsxDEV(QB.Fragment,{children:[I.map((_,F)=>{if(_.type==="text")return QB.jsxDEV(GNA,{text:_.text,productName:B},`text-${F}`,!1,void 0,this);if(_.type==="reasoning")return QB.jsxDEV(dnQ,{text:_.text},`thinking-${F}`,!1,void 0,this);return null}),g.map((_)=>QB.jsxDEV(JB0,{pair:_},_.toolUse.id,!1,void 0,this))]},void 0,!0,void 0,this)}function dnQ({text:A}){return QB.jsxDEV(e,{flexDirection:"column",marginTop:SD.MESSAGE_MARGIN_TOP,children:[QB.jsxDEV(c,{bold:!0,color:"gray",children:"thinking"},void 0,!1,void 0,this),QB.jsxDEV(c,{color:"gray",italic:!0,children:A},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}function nnQ({part:A}){let{transcriptMode:Q}=PQ(),{result:B,input:I}=A;if(B.isError){let D=B.returnDisplay||B.llmContent;if(typeof D!=="string")D=JSON.stringify(D);return QB.jsxDEV(c,{color:aQ.ERROR,children:D},void 0,!1,void 0,this)}let C=["diff_viewer","todo_read","todo_write"];if(typeof B.returnDisplay==="object"&&C.includes(B.returnDisplay.type))switch(B.returnDisplay.type){case"diff_viewer":{let{originalContent:D,newContent:g,filePath:_,startLineNumber:F}=B.returnDisplay,G=typeof D==="string"?D:I[D.inputKey]??"",U=typeof g==="string"?g:I[g.inputKey]??"";return QB.jsxDEV(Vt,{originalContent:G,newContent:U,fileName:_,maxHeight:Q?1/0:10,startLineNumber:F},void 0,!1,void 0,this)}case"todo_write":return QB.jsxDEV(cnQ,{oldTodos:B.returnDisplay.oldTodos,newTodos:B.returnDisplay.newTodos,verbose:!1},void 0,!1,void 0,this);default:break}let E=B.returnDisplay||B.llmContent;if(typeof E!=="string")E=JSON.stringify(E);if(A.name==="bash")return QB.jsxDEV(QNA,{content:E},void 0,!1,void 0,this);return QB.jsxDEV(c,{color:aQ.TOOL_RESULT,children:[Bg.arrowDown," ",E]},void 0,!0,void 0,this)}function YB0({message:A}){if(A.content.length===0)return null;let Q=A.content[0];return QB.jsxDEV(e,{flexDirection:"column",marginTop:SD.MESSAGE_MARGIN_TOP_TOOL_RESULT,children:QB.jsxDEV(nnQ,{part:Q},void 0,!1,void 0,this)},void 0,!1,void 0,this)}function lnQ({message:A,messages:Q,productName:B,userName:I}){if(A.role==="user"){if(Yc(A))return QB.jsxDEV(AB0,{message:A},void 0,!1,void 0,this);else if(Uc(A))return QB.jsxDEV(QB0,{message:A},void 0,!1,void 0,this);if(LW(A))return QB.jsxDEV(YB0,{message:A},void 0,!1,void 0,this);return QB.jsxDEV(wB0,{message:A,userName:I},void 0,!1,void 0,this)}if(A.role==="tool")return null;if(A.role==="assistant")return QB.jsxDEV(GB0,{message:A,messages:Q,productName:B},void 0,!1,void 0,this);return null}A_();await UE([II(),iI()]);var u6=NA(uQ(),1);function anQ(){let{queuedMessages:A}=PQ();if(A.length===0)return null;return u6.jsxDEV(e,{flexDirection:"column",borderStyle:"round",borderColor:aQ.WARNING,paddingX:1,children:[u6.jsxDEV(e,{flexDirection:"row",justifyContent:"space-between",children:u6.jsxDEV(c,{bold:!0,color:aQ.WARNING,children:["Queued Messages (",A.length,")"]},void 0,!0,void 0,this)},void 0,!1,void 0,this),u6.jsxDEV(e,{flexDirection:"column",marginTop:1,children:A.map((Q,B)=>u6.jsxDEV(e,{flexDirection:"row",children:[u6.jsxDEV(c,{color:"gray",children:[B+1,"."]},void 0,!0,void 0,this),u6.jsxDEV(c,{color:"white",children:Q.length>80?Q.substring(0,77)+"...":Q},void 0,!1,void 0,this)]},B,!0,void 0,this))},void 0,!1,void 0,this),u6.jsxDEV(e,{marginTop:1,children:u6.jsxDEV(c,{color:"yellow",children:"Queue will execute after current task completes"},void 0,!1,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}ys();await iI();await II();var tS=NA(uQ(),1);function onQ(){return tS.jsxDEV(e,{flexDirection:"column",marginTop:1,children:[tS.jsxDEV(e,{borderStyle:"single",borderColor:"gray",borderTop:!0,borderBottom:!1,borderLeft:!1,borderRight:!1},void 0,!1,void 0,this),tS.jsxDEV(e,{children:tS.jsxDEV(c,{dimColor:!0,children:[" ","Showing detailed transcript · ctrl+o to toggle"]},void 0,!0,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}await iI();var eS=NA(iQ(),1);function rnQ(){let A=PQ((g)=>g.status),Q=PQ((g)=>g.approvalModal),B=PQ((g)=>g.isWindowFocused),I=PQ((g)=>g.bridge),C=PQ((g)=>g.cwd),E=eS.useRef(A),D=eS.useRef(Q);eS.useEffect(()=>{let g=E.current,_=D.current;if(E.current=A,D.current=Q,!I||!C)return;if(B)return;if((g==="processing"||g==="planning"||g==="tool_executing"||g==="compacting")&&A==="idle"||!_&&!!Q)I.request("config.get",{cwd:C,key:"notification"}).then((X)=>{let H=X.data?.value;if(H!==!1)I.request("utils.notify",{cwd:C,config:H})})},[A,Q,B,I,C])}var UB0=typeof global=="object"&&global&&global.Object===Object&&global,snQ=UB0;var XB0=typeof self=="object"&&self&&self.Object===Object&&self,HB0=snQ||XB0||Function("return this")(),nt=HB0;var KB0=nt.Symbol,yL=KB0;var tnQ=Object.prototype,$B0=tnQ.hasOwnProperty,ZB0=tnQ.toString,Av=yL?yL.toStringTag:void 0;function zB0(A){var Q=$B0.call(A,Av),B=A[Av];try{A[Av]=void 0;var I=!0}catch(E){}var C=ZB0.call(A);if(I)if(Q)A[Av]=B;else delete A[Av];return C}var enQ=zB0;var WB0=Object.prototype,qB0=WB0.toString;function NB0(A){return qB0.call(A)}var AaQ=NB0;var MB0="[object Null]",VB0="[object Undefined]",QaQ=yL?yL.toStringTag:void 0;function LB0(A){if(A==null)return A===void 0?VB0:MB0;return QaQ&&QaQ in Object(A)?enQ(A):AaQ(A)}var BaQ=LB0;function RB0(A){return A!=null&&typeof A=="object"}var IaQ=RB0;var OB0="[object Symbol]";function yB0(A){return typeof A=="symbol"||IaQ(A)&&BaQ(A)==OB0}var CaQ=yB0;var fB0=/\s/;function TB0(A){var Q=A.length;while(Q--&&fB0.test(A.charAt(Q)));return Q}var EaQ=TB0;var PB0=/^\s+/;function kB0(A){return A?A.slice(0,EaQ(A)+1).replace(PB0,""):A}var DaQ=kB0;function jB0(A){var Q=typeof A;return A!=null&&(Q=="object"||Q=="function")}var Qv=jB0;var gaQ=NaN,SB0=/^[-+]0x[0-9a-f]+$/i,vB0=/^0b[01]+$/i,xB0=/^0o[0-7]+$/i,bB0=parseInt;function hB0(A){if(typeof A=="number")return A;if(CaQ(A))return gaQ;if(Qv(A)){var Q=typeof A.valueOf=="function"?A.valueOf():A;A=Qv(Q)?Q+"":Q}if(typeof A!="string")return A===0?A:+A;A=DaQ(A);var B=vB0.test(A);return B||xB0.test(A)?bB0(A.slice(2),B?2:8):SB0.test(A)?gaQ:+A}var YNA=hB0;var uB0=function(){return nt.Date.now()},at=uB0;var mB0="Expected a function",cB0=Math.max,dB0=Math.min;function lB0(A,Q,B){var I,C,E,D,g,_,F=0,G=!1,U=!1,X=!0;if(typeof A!="function")throw TypeError(mB0);if(Q=YNA(Q)||0,Qv(B))G=!!B.leading,U="maxWait"in B,E=U?cB0(YNA(B.maxWait)||0,Q):E,X="trailing"in B?!!B.trailing:X;function H(P){var O=I,v=C;return I=C=void 0,F=P,D=A.apply(v,O),D}function K(P){return F=P,g=setTimeout(q,Q),G?H(P):D}function Z(P){var O=P-_,v=P-F,u=Q-O;return U?dB0(u,E-v):u}function W(P){var O=P-_,v=P-F;return _===void 0||O>=Q||O<0||U&&v>=E}function q(){var P=at();if(W(P))return V(P);g=setTimeout(q,Z(P))}function V(P){if(g=void 0,X&&I)return H(P);return I=C=void 0,D}function M(){if(g!==void 0)clearTimeout(g);F=0,I=_=C=g=void 0}function L(){return g===void 0?D:V(at())}function k(){var P=at(),O=W(P);if(I=arguments,C=this,_=P,O){if(g===void 0)return K(_);if(U)return clearTimeout(g),g=setTimeout(q,Q),H(_)}if(g===void 0)g=setTimeout(q,Q);return D}return k.cancel=M,k.flush=L,k}var UNA=lB0;var h7=NA(iQ(),1),iB0=500,pB0=1,nB0=(A)=>new Promise((Q)=>setTimeout(Q,A));function _aQ(){let[A,Q]=h7.useState(0),B=h7.useRef(process.stdout.columns||0);h7.useEffect(()=>{let C=UNA(async()=>{if(!process.stdout.isTTY)return;let E=process.stdout.columns||0,D=E-B.current;if(Math.abs(D)>pB0)B.current=E,await K7(),await nB0(20),Q((g)=>g+1)},iB0);return process.stdout.on("resize",C),()=>{process.stdout.off("resize",C),C.cancel()}},[]);let I=h7.useCallback(()=>{K7().catch((C)=>{console.error("Failed to clear terminal:",C)}),Q((C)=>C+1)},[]);return{forceRerender:A,forceUpdate:I}}var ew=NA(uQ(),1);function aB0(){let{slashCommandJSX:A}=PQ();return ew.jsxDEV(e,{children:A},void 0,!1,void 0,this)}function waQ(){let{forceRerender:A}=_aQ();rnQ();let{forkModalVisible:Q,fork:B,hideForkModal:I,forkParentUuid:C,forkCounter:E,transcriptMode:D,toggleTranscriptMode:g,bridge:_,cwd:F,sessionId:G}=PQ(),U=PQ((X)=>X.messages);return BI((X,H)=>{if(H.ctrl&&X==="o"){K7(),g();return}if(D){if(H.escape||H.ctrl&&X==="c")K7(),g();return}}),ew.jsxDEV(Os,{children:[ew.jsxDEV(e,{flexDirection:"column",children:[ew.jsxDEV(pnQ,{},void 0,!1,void 0,this),ew.jsxDEV(PpQ,{},void 0,!1,void 0,this),ew.jsxDEV(nkQ,{},void 0,!1,void 0,this),ew.jsxDEV(anQ,{},void 0,!1,void 0,this),D?ew.jsxDEV(onQ,{},void 0,!1,void 0,this):ew.jsxDEV(wnQ,{},void 0,!1,void 0,this),ew.jsxDEV(JnQ,{},void 0,!1,void 0,this),ew.jsxDEV(SpQ,{},void 0,!1,void 0,this)]},`${A}-${C}-${E}-${D}`,!0,void 0,this),Q&&G&&ew.jsxDEV(YnQ,{messages:U,onSelect:(X,H)=>{B(X,H)},onClose:()=>{I()},sessionId:G,cwd:F,bridge:_},void 0,!1,void 0,this),ew.jsxDEV(fpQ,{},void 0,!1,void 0,this),ew.jsxDEV(aB0,{},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}await iI();G0();u9();class XNA{appStore;messageBus;constructor(A){this.appStore=A.appStore,this.messageBus=new t1,new FaQ(this.messageBus,this.appStore)}request(A,Q,B={}){return this.messageBus.request(A,Q,B)}emitEvent(A,Q){return this.messageBus.emitEvent(A,Q)}onEvent(A,Q){return this.messageBus.onEvent(A,Q)}async requestMoveToBackground(A){return this.messageBus.emitEvent(p5.MOVE_TO_BACKGROUND,{taskId:A})}}class FaQ{messageBus;appStore;constructor(A,Q){this.messageBus=A,this.appStore=Q,this.registerHandlers()}registerHandlers(){this.messageBus.registerHandler("toolApproval",async({toolUse:A,category:Q,sessionId:B})=>{let I=await this.appStore.approveToolUse({toolUse:A,category:Q,sessionId:B});return{approved:I.approved,params:I.params,denyReason:I.denyReason}}),this.messageBus.onEvent(p5.PROMPT_BACKGROUND,(A)=>{this.appStore.setBashBackgroundPrompt(A)}),this.messageBus.onEvent(p5.BACKGROUND_MOVED,()=>{this.appStore.clearBashBackgroundPrompt()})}}mY();qN();u9();fF();await L7();tg();process.env.YARGS_MIN_NODE_VERSION="18";async function QIB(A){let{default:Q}=await Promise.resolve().then(() => (wU(),_U)),B=Q(A,{alias:{model:"m",help:"h",resume:"r",quiet:"q",continue:"c",version:"v"},default:{mcp:!0,mcpConfig:[]},array:["plugin","mcpConfig"],boolean:["help","mcp","quiet","continue","version","disableContextCache"],number:["port"],string:["appendSystemPrompt","approvalMode","cwd","host","language","mcpConfig","model","outputFormat","outputStyle","planModel","smallModel","visionModel","resume","systemPrompt","tools"]});if(B.resume&&B.continue)throw Error("Cannot use --resume and --continue at the same time");if(B.model==="")throw Error("Model cannot be empty string");return B}function UJ0(A){console.log(`
|
|
6543
6543
|
Usage:
|
|
6544
6544
|
${A} [options] [command] <prompt>
|
|
6545
6545
|
|
|
@@ -6581,4 +6581,4 @@ Commands:
|
|
|
6581
6581
|
skill Manage skills
|
|
6582
6582
|
update Check for and apply updates
|
|
6583
6583
|
workspace Manage workspaces
|
|
6584
|
-
`.trimEnd())}async function XJ0(A,Q,B){try{let I=new nw({contextCreateOpts:Q}),[C,E]=lw.createPair(),D=new t1;D.setTransport(C),I.messageBus.setTransport(E),D.registerHandler("toolApproval",async(H)=>{return{approved:!0}});let g=new Ij({format:A.outputFormat||"stream-json",quiet:!0});D.onEvent("agent.progress",(H)=>{g.onMessage({message:{parentToolUseId:H.parentToolUseId,...H.message,timestamp:H.timestamp}})});let _=A._[0];wLA(_,"Prompt is required in quiet mode");let F=String(_),G;if(q$(F)){let H=W$(F),Z=(await D.request("slashCommand.get",{cwd:B,command:H.command})).data?.commandEntry;if(Z){let{command:W}=Z;if(W.type==="prompt"){let q=await W.getPromptForCommand(H.args);if(wLA(q,`Prompt is required for ${H.command}`),wLA(q.length===1,`Only one prompt is supported for ${H.command} in quiet mode`),F=q?.[0]?.content,W.model)G=W.model}else throw Error(`Unsupported slash command: ${H.command}`)}}let U=new N4({productName:Q.productName,cwd:B}),X=(()=>{if(A.resume)return A.resume;if(A.continue)return U.getLatestSessionId()||K_.createSessionId();return K_.createSessionId()})();await D.request("session.initialize",{cwd:B,sessionId:X}),await D.request("session.send",{message:F,cwd:B,sessionId:X,model:G}),process.exit(0)}catch(I){console.error(`Error: ${I.message}`),console.error(I.stack),process.exit(1)}}async function HJ0(A,Q,B,I){let C=PQ.getState(),E=new XNA({appStore:C}),D=new nw({contextCreateOpts:Q}),[g,_]=lw.createPair();E.messageBus.setTransport(g),D.messageBus.setTransport(_);let F=new N4({productName:Q.productName,cwd:B}),G=(()=>{if(A.resume)return A.resume;if(A.continue)return F.getLatestSessionId()||K_.createSessionId();return K_.createSessionId()})(),[U,X]=(()=>{let K=F.getSessionLogPath(G),Z=TN({logPath:K}),q=new cM({globalDataPath:F.getGlobalDataPath()}).getProjectHistory({cwd:B});return[Z,q]})(),H=A._.length>0?A._.join(" "):"";await C.initialize({bridge:E,cwd:B,initialPrompt:H,sessionId:G,logFile:F.getSessionLogPath(G),messages:U,history:X,upgrade:I}),_g(AIB.default.createElement(waQ),{patchConsole:!0,exitOnCtrlC:!1})}async function BIB(A){let Q=A.argv,B=Q.cwd||process.cwd(),I=uLQ(Q.mcpConfig||[],B),C;if(Q.tools)try{if(C=JSON.parse(Q.tools),typeof C!=="object"||Array.isArray(C))throw Error('must be a JSON object like {"write":false}');for(let[_,F]of Object.entries(C))if(typeof F!=="boolean")throw Error(`tool "${_}" must be true or false, got: ${F}`)}catch(_){let F=_ instanceof Error?_.message:String(_);console.error("Error: Invalid --tools parameter"),console.error(` ${F}`),console.error(` Example: --tools '{"write":false,"bash":false}'`),process.exit(1)}let E={productName:A.productName,productASCIIArt:A.productASCIIArt,version:A.version,fetch:A.fetch,argvConfig:{model:Q.model,planModel:Q.planModel,smallModel:Q.smallModel,visionModel:Q.visionModel,quiet:Q.quiet,outputFormat:Q.outputFormat,plugins:Q.plugin,systemPrompt:Q.systemPrompt,appendSystemPrompt:Q.appendSystemPrompt,language:Q.language,outputStyle:Q.outputStyle,approvalMode:Q.approvalMode,mcpServers:I,tools:C,extensions:Q.extensions},plugins:A.plugins},D=Q._[0];if(D==="server")return{shutdown:await pkQ({cwd:B,contextCreateOpts:E,port:Q.port,host:Q.host})};if(D==="acp"){let{runACP:_}=await CoQ().then(() => IoQ);return await _({cwd:B,contextCreateOpts:E}),{}}if(["__test","acp","config","commit","mcp","log","run","server","skill","update","workspace"].includes(D)){let _=await MV.create({cwd:B,...E});switch(D){case"config":{let{runConfig:F}=await Promise.resolve().then(() => (DoQ(),EoQ));await F(_);break}case"mcp":{let{runMCP:F}=await Promise.resolve().then(() => (woQ(),_oQ));await F(_);break}case"log":{let{runLog:F}=await ZoQ().then(() => $oQ),G=Q._[1]?String(Q._[1]):void 0;await F(_,G);break}case"run":{let{runRun:F}=await MoQ().then(() => NoQ);await F(_);break}case"skill":{let{runSkill:F}=await yoQ().then(() => OoQ);await F(_);break}case"commit":{let{runCommit:F}=await PBB().then(() => TBB);await F(_);break}case"update":{let{runUpdate:F}=await Promise.resolve().then(() => (jBB(),kBB));await F(_,A.upgrade);break}case"workspace":{let{runWorkspace:F}=await Promise.resolve().then(() => (eBB(),tBB));await F(_);break}default:throw Error(`Unsupported command: ${D}`)}return{}}if(Q.help)return UJ0(A.productName.toLowerCase()),{};if(Q.version)return console.log(A.version),{};if(Q.quiet)await XJ0(Q,E,B);else{let _=A.upgrade;if(process.env.NEOVATE_SELF_UPDATE==="none")_=void 0;if(_&&!_.installDir.includes("node_modules"))_=void 0;if(_?.version.includes("-beta.")||_?.version.includes("-alpha.")||_?.version.includes("-rc.")||_?.version.includes("-canary."))_=void 0;await HJ0(Q,E,B,_)}return{}}G0();var EIB=MA.dirname($J0(import.meta.url)),FLA=JSON.parse(KJ0.readFileSync(MA.join(EIB,"../package.json"),"utf-8")),ZJ0=MA.resolve(EIB,"../"),zJ0=await QIB(process.argv.slice(2)),{shutdown:IIB}=await BIB({productName:nm,productASCIIArt:rsA,version:FLA.version,plugins:[],upgrade:{registryBase:"https://registry.npmjs.org",name:FLA.name,version:FLA.version,installDir:ZJ0,files:["vendor","dist","package.json"]},argv:zJ0}),CIB=!1,DIB=async()=>{if(CIB)return;CIB=!0;try{if(IIB)await IIB();process.exit(0)}catch(A){console.error("Error during shutdown:",A),process.exit(1)}};process.on("SIGINT",DIB);process.on("SIGTERM",DIB);
|
|
6584
|
+
`.trimEnd())}async function XJ0(A,Q,B){try{let I=new nw({contextCreateOpts:Q}),[C,E]=lw.createPair(),D=new t1;D.setTransport(C),I.messageBus.setTransport(E),D.registerHandler("toolApproval",async(H)=>{return{approved:!0}});let g=new Ij({format:A.outputFormat||"stream-json",quiet:!0});D.onEvent("agent.progress",(H)=>{g.onMessage({message:{parentToolUseId:H.parentToolUseId,...H.message,timestamp:H.timestamp}})});let _=A._[0];wLA(_,"Prompt is required in quiet mode");let F=String(_),G;if(q$(F)){let H=W$(F),Z=(await D.request("slashCommand.get",{cwd:B,command:H.command})).data?.commandEntry;if(Z){let{command:W}=Z;if(W.type==="prompt"){let q=await W.getPromptForCommand(H.args);if(wLA(q,`Prompt is required for ${H.command}`),wLA(q.length===1,`Only one prompt is supported for ${H.command} in quiet mode`),F=q?.[0]?.content,W.model)G=W.model}else throw Error(`Unsupported slash command: ${H.command}`)}}let U=new N4({productName:Q.productName,cwd:B}),X=(()=>{if(A.resume)return A.resume;if(A.continue)return U.getLatestSessionId()||K_.createSessionId();return K_.createSessionId()})();await D.request("session.initialize",{cwd:B,sessionId:X}),await D.request("session.send",{message:F,cwd:B,sessionId:X,model:G}),process.exit(0)}catch(I){console.error(`Error: ${I.message}`),console.error(I.stack),process.exit(1)}}async function HJ0(A,Q,B,I){let C=PQ.getState(),E=new XNA({appStore:C}),D=new nw({contextCreateOpts:Q}),[g,_]=lw.createPair();E.messageBus.setTransport(g),D.messageBus.setTransport(_);let F=new N4({productName:Q.productName,cwd:B}),G=(()=>{if(A.resume)return A.resume;if(A.continue)return F.getLatestSessionId()||K_.createSessionId();return K_.createSessionId()})(),[U,X]=(()=>{let K=F.getSessionLogPath(G),Z=TN({logPath:K}),q=new cM({globalDataPath:F.getGlobalDataPath()}).getProjectHistory({cwd:B});return[Z,q]})(),H=A._.length>0?A._.join(" "):"";await C.initialize({bridge:E,cwd:B,initialPrompt:H,sessionId:G,logFile:F.getSessionLogPath(G),messages:U,history:X,upgrade:I}),_g(AIB.default.createElement(waQ),{patchConsole:!0,exitOnCtrlC:!1})}async function BIB(A){let Q=A.argv,B=Q.cwd||process.cwd(),I=uLQ(Q.mcpConfig||[],B),C;if(Q.tools)try{if(C=JSON.parse(Q.tools),typeof C!=="object"||Array.isArray(C))throw Error('must be a JSON object like {"write":false}');for(let[_,F]of Object.entries(C))if(typeof F!=="boolean")throw Error(`tool "${_}" must be true or false, got: ${F}`)}catch(_){let F=_ instanceof Error?_.message:String(_);console.error("Error: Invalid --tools parameter"),console.error(` ${F}`),console.error(` Example: --tools '{"write":false,"bash":false}'`),process.exit(1)}let E={productName:A.productName,productASCIIArt:A.productASCIIArt,version:A.version,fetch:A.fetch,noContextCache:Q.disableContextCache,argvConfig:{model:Q.model,planModel:Q.planModel,smallModel:Q.smallModel,visionModel:Q.visionModel,quiet:Q.quiet,outputFormat:Q.outputFormat,plugins:Q.plugin,systemPrompt:Q.systemPrompt,appendSystemPrompt:Q.appendSystemPrompt,language:Q.language,outputStyle:Q.outputStyle,approvalMode:Q.approvalMode,mcpServers:I,tools:C,extensions:Q.extensions},plugins:A.plugins},D=Q._[0];if(D==="server")return{shutdown:await pkQ({cwd:B,contextCreateOpts:E,port:Q.port,host:Q.host})};if(D==="acp"){let{runACP:_}=await CoQ().then(() => IoQ);return await _({cwd:B,contextCreateOpts:E}),{}}if(["__test","acp","config","commit","mcp","log","run","server","skill","update","workspace"].includes(D)){let _=await MV.create({cwd:B,...E});switch(D){case"config":{let{runConfig:F}=await Promise.resolve().then(() => (DoQ(),EoQ));await F(_);break}case"mcp":{let{runMCP:F}=await Promise.resolve().then(() => (woQ(),_oQ));await F(_);break}case"log":{let{runLog:F}=await ZoQ().then(() => $oQ),G=Q._[1]?String(Q._[1]):void 0;await F(_,G);break}case"run":{let{runRun:F}=await MoQ().then(() => NoQ);await F(_);break}case"skill":{let{runSkill:F}=await yoQ().then(() => OoQ);await F(_);break}case"commit":{let{runCommit:F}=await PBB().then(() => TBB);await F(_);break}case"update":{let{runUpdate:F}=await Promise.resolve().then(() => (jBB(),kBB));await F(_,A.upgrade);break}case"workspace":{let{runWorkspace:F}=await Promise.resolve().then(() => (eBB(),tBB));await F(_);break}default:throw Error(`Unsupported command: ${D}`)}return{}}if(Q.help)return UJ0(A.productName.toLowerCase()),{};if(Q.version)return console.log(A.version),{};if(Q.quiet)await XJ0(Q,E,B);else{let _=A.upgrade;if(process.env.NEOVATE_SELF_UPDATE==="none")_=void 0;if(_&&!_.installDir.includes("node_modules"))_=void 0;if(_?.version.includes("-beta.")||_?.version.includes("-alpha.")||_?.version.includes("-rc.")||_?.version.includes("-canary."))_=void 0;await HJ0(Q,E,B,_)}return{}}G0();var EIB=MA.dirname($J0(import.meta.url)),FLA=JSON.parse(KJ0.readFileSync(MA.join(EIB,"../package.json"),"utf-8")),ZJ0=MA.resolve(EIB,"../"),zJ0=await QIB(process.argv.slice(2)),{shutdown:IIB}=await BIB({productName:nm,productASCIIArt:rsA,version:FLA.version,plugins:[],upgrade:{registryBase:"https://registry.npmjs.org",name:FLA.name,version:FLA.version,installDir:ZJ0,files:["vendor","dist","package.json"]},argv:zJ0}),CIB=!1,DIB=async()=>{if(CIB)return;CIB=!0;try{if(IIB)await IIB();process.exit(0)}catch(A){console.error("Error during shutdown:",A),process.exit(1)}};process.on("SIGINT",DIB);process.on("SIGTERM",DIB);
|