@sourcegraph/amp 0.0.1761768090-g22bb6d → 0.0.1761782504-g670405
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/main.js +9 -9
- package/package.json +1 -1
package/dist/main.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env -S node --no-warnings
|
|
2
2
|
import{createRequire as bz6}from"node:module";var vz6=Object.create;var{getPrototypeOf:kz6,defineProperty:EQ1,getOwnPropertyNames:_z6}=Object;var xz6=Object.prototype.hasOwnProperty;var d6=(J,Q,Z)=>{Z=J!=null?vz6(kz6(J)):{};let X=Q||!J||!J.__esModule?EQ1(Z,"default",{value:J,enumerable:!0}):Z;for(let Y of _z6(J))if(!xz6.call(X,Y))EQ1(X,Y,{get:()=>J[Y],enumerable:!0});return X};var t=(J,Q)=>()=>(Q||J((Q={exports:{}}).exports,Q),Q.exports);var E6=(J,Q)=>{for(var Z in Q)EQ1(J,Z,{get:Q[Z],enumerable:!0,configurable:!0,set:(X)=>Q[Z]=()=>X})};var B1=(J,Q)=>()=>(J&&(Q=J(J=0)),Q);var o1=bz6(import.meta.url),yz6=Symbol.dispose||Symbol.for("Symbol.dispose"),fz6=Symbol.asyncDispose||Symbol.for("Symbol.asyncDispose"),Nu1=(J,Q,Z)=>{if(Q!=null){if(typeof Q!=="object"&&typeof Q!=="function")throw TypeError('Object expected to be assigned to "using" declaration');var X;if(Z)X=Q[fz6];if(X===void 0)X=Q[yz6];if(typeof X!=="function")throw TypeError("Object not disposable");J.push([Z,X,Q])}else if(Z)J.push([Z]);return Q},Lu1=(J,Q,Z)=>{var X=typeof SuppressedError==="function"?SuppressedError:function(G,q,z,U){return U=Error(z),U.name="SuppressedError",U.error=G,U.suppressed=q,U},Y=(G)=>Q=Z?new X(G,Q,"An error was suppressed during disposal"):(Z=!0,G),K=(G)=>{while(G=J.pop())try{var q=G[1]&&G[1].call(G[2]);if(G[0])return Promise.resolve(q).then(K,(z)=>(Y(z),K()))}catch(z){Y(z)}if(Z)throw Q};return K()};function Au1(){if(typeof process==="object")return process.platform==="win32"?"windows":"posix";else if(typeof navigator==="object")return navigator.userAgent.indexOf("Windows")>=0?"windows":"posix";return"posix"}function wu1(J,Q){if(!J.scheme&&Q)throw Error(`[UriError]: Scheme is missing: {scheme: "", authority: "${J.authority}", path: "${J.path}", query: "${J.query}", fragment: "${J.fragment}"}`);if(J.scheme&&!hz6.test(J.scheme))throw Error("[UriError]: Scheme contains illegal characters.");if(J.path){if(J.authority){if(!gz6.test(J.path))throw Error('[UriError]: If a URI contains an authority component, then the path component must either be empty or begin with a slash ("/") character')}else if(mz6.test(J.path))throw Error('[UriError]: If a URI does not contain an authority component, then the path cannot begin with two slash characters ("//")')}}function uz6(J,Q){if(!J&&!Q)return"file";return J}function pz6(J,Q){switch(J){case"https":case"http":case"file":if(!Q)Q=eK;else if(Q[0]!==eK)Q=eK+Q;break}return Q}class $0{static isUri(J){if(J instanceof $0)return!0;if(!J)return!1;let Q=J;return typeof Q.authority==="string"&&typeof Q.fragment==="string"&&typeof Q.path==="string"&&typeof Q.query==="string"&&typeof Q.scheme==="string"&&typeof Q.fsPath==="string"&&typeof Q.with==="function"&&typeof Q.toString==="function"}scheme;authority;path;query;fragment;platform;constructor(J,Q,Z,X,Y,K=!1,G){if(typeof J==="object")this.scheme=J.scheme||m2,this.authority=J.authority||m2,this.path=J.path||m2,this.query=J.query||m2,this.fragment=J.fragment||m2,this.platform=J.platform;else this.scheme=uz6(J,K),this.authority=Q||m2,this.path=pz6(this.scheme,Z||m2),this.query=X||m2,this.fragment=Y||m2,this.platform=G,wu1(this,K)}get fsPath(){return Eu1(this,!1)}with(J){if(!J)return this;let{scheme:Q,authority:Z,path:X,query:Y,fragment:K,platform:G}=J;if(Q===void 0)Q=this.scheme;else if(Q===null)Q=m2;if(Z===void 0)Z=this.authority;else if(Z===null)Z=m2;if(X===void 0)X=this.path;else if(X===null)X=m2;if(Y===void 0)Y=this.query;else if(Y===null)Y=m2;if(K===void 0)K=this.fragment;else if(K===null)K=m2;if(G===void 0)G=this.platform;else if(G===null)G=void 0;if(Q===this.scheme&&Z===this.authority&&X===this.path&&Y===this.query&&K===this.fragment&&G===this.platform)return this;return new NN(Q,Z,X,Y,K,!1,G)}static parse(J,Q=!1){let Z=dz6.exec(J);if(!Z)return new NN(m2,m2,m2,m2,m2);return new NN(Z[2]||m2,Gd(Z[4]||m2),Gd(Z[5]||m2),Gd(Z[7]||m2),Gd(Z[9]||m2),Q)}static file(J,Q=Au1()){let Z=m2;if(Q==="windows")J=J.replace(/\\/g,eK);if(J[0]===eK&&J[1]===eK){let X=J.indexOf(eK,2);if(X===-1)Z=J.substring(2),J=eK;else Z=J.substring(2,X),J=J.substring(X)||eK}return new NN("file",Z,J,m2,m2,!1,Q)}static from(J){let Q=new NN(J.scheme,J.authority,J.path,J.query,J.fragment,!0,J.platform);return wu1(Q,!0),Q}toString(J=!1){return IQ1(this,J)}toJSON(){return this}static revive(J){if(!J)return J;if(J instanceof $0)return J;let Q=new NN(J),Z=J;return Q._formatted=Z.external,Q._fsPath=Z._sep===ju1(Q.platform)?Z.fsPath:null,Q}}function ju1(J){return J==="windows"?1:void 0}function Ru1(J,Q,Z){let X=void 0;for(let Y=0;Y<J.length;Y++){let K=J.charCodeAt(Y);if(K>=97&&K<=122||K>=65&&K<=90||K>=48&&K<=57||K===45||K===46||K===95||K===126||Q&&K===47||Z&&K===91||Z&&K===93||Z&&K===58){if(X!==void 0)X+=J.charAt(Y)}else{if(X===void 0)X=J.substring(0,Y);let G=$u1[K];if(G!==void 0)X+=G;else X+=encodeURIComponent(J.charAt(Y))}}return X!==void 0?X:J}function cz6(J){let Q=void 0;for(let Z=0;Z<J.length;Z++){let X=J.charCodeAt(Z);if(X===35||X===63){if(Q===void 0)Q=J.substring(0,Z);Q+=$u1[X]}else if(Q!==void 0)Q+=J[Z]}return Q!==void 0?Q:J}function Eu1(J,Q){let Z;if(J.authority&&J.path.length>1&&J.scheme==="file")Z=`//${J.authority}${J.path}`;else if(J.path.charCodeAt(0)===47&&(J.path.charCodeAt(1)>=65&&J.path.charCodeAt(1)<=90||J.path.charCodeAt(1)>=97&&J.path.charCodeAt(1)<=122)&&J.path.charCodeAt(2)===58)if(!Q)Z=J.path[1].toLowerCase()+J.path.substring(2);else Z=J.path.substring(1);else Z=J.path;if(J.platform==="windows")Z=Z.replace(/\//g,"\\");return Z}function IQ1(J,Q){let Z=!Q?Ru1:cz6,X="",{scheme:Y,authority:K,path:G,query:q,fragment:z}=J;if(Y)X+=Y,X+=":";if(K||Y==="file")X+=eK,X+=eK;if(K){let U=K.indexOf("@");if(U!==-1){let W=K.substring(0,U);if(K=K.substring(U+1),U=W.lastIndexOf(":"),U===-1)X+=Z(W,!1,!1);else X+=Z(W.substring(0,U),!1,!1),X+=":",X+=Z(W.substring(U+1),!1,!0);X+="@"}if(K=K.toLowerCase(),U=K.lastIndexOf(":"),U===-1)X+=Z(K,!1,!0);else X+=Z(K.substring(0,U),!1,!0),X+=K.substring(U)}if(G){if(G.length>=3&&G.charCodeAt(0)===47&&G.charCodeAt(2)===58){let U=G.charCodeAt(1);if(U>=65&&U<=90)G=`/${String.fromCharCode(U+32)}:${G.substring(3)}`}else if(G.length>=2&&G.charCodeAt(1)===58){let U=G.charCodeAt(0);if(U>=65&&U<=90)G=`${String.fromCharCode(U+32)}:${G.substring(2)}`}X+=Z(G,!0,!1)}if(q)X+="?",X+=Z(q,!1,!1);if(z)X+="#",X+=!Q?Ru1(z,!1,!1):z;return X}function Iu1(J){try{return decodeURIComponent(J)}catch{if(J.length>3)return J.substring(0,3)+Iu1(J.substring(3));else return J}}function Gd(J){if(!J.match(Ou1))return J;return J.replace(Ou1,(Q)=>Iu1(Q))}function GB(J){return J.scheme==="file"}function AQ(J){return $0.parse(J)}function T6(J){return J.toString()}function V8(J){if(typeof J==="string"||J instanceof URL)return $0.parse(J.toString());return J}function lC(J){if(!URL.canParse(J))throw Error(`invalid URI string: ${JSON.stringify(J)}`);return J}var hz6,gz6,mz6,m2="",eK="/",dz6,NN,$u1,Ou1;var iC=B1(()=>{hz6=/^\w[\w\d+.-]*$/,gz6=/^\//,mz6=/^\/\//;dz6=/^(([^:/?#]+?):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?/;NN=class NN extends $0{_formatted=null;_fsPath=null;get fsPath(){if(!this._fsPath)this._fsPath=Eu1(this,!1);return this._fsPath}toString(J=!1){if(!J){if(!this._formatted)this._formatted=IQ1(this,!1);return this._formatted}return IQ1(this,!0)}toJSON(){let J={};if(this._fsPath)J.fsPath=this._fsPath,J._sep=ju1(this.platform);if(this._formatted)J.external=this._formatted;if(J.scheme=this.scheme,J.authority=this.authority,J.path=this.path,J.query=this.query,J.fragment=this.fragment,this.platform)J.platform=this.platform;return J}};$u1={58:"%3A",47:"%2F",63:"%3F",35:"%23",91:"%5B",93:"%5D",64:"%40",33:"%21",36:"%24",38:"%26",39:"%27",40:"%28",41:"%29",42:"%2A",43:"%2B",44:"%2C",59:"%3B",61:"%3D",32:"%20"};Ou1=/(%[0-9A-Za-z][0-9A-Za-z])+/g});function PQ1(J){if(J==="/")return"/";if(J==="")return".";let Q=J.replace(/\/+$/,"");if(!Q)return".";let Z=Q.lastIndexOf("/");if(Z===-1)return".";if(Z===0)return"/";return Q.slice(0,Z)}function LN(J){let Q=J.replace(/\/+$/,"");if(!Q)return"";let Z=Q.lastIndexOf("/");return Z===-1?Q:Q.slice(Z+1)}function gR(...J){if(J.length===0)return".";let Q="";for(let G of J)if(G)if(Q)Q+="/"+G;else Q=G;if(!Q)return".";let Z=Q.endsWith("/"),X=Q.split("/").filter(Boolean),Y=[];for(let G of X)if(G===".."){if(Y.length>0&&Y[Y.length-1]!=="..")Y.pop();else if(!Q.startsWith("/"))Y.push("..")}else if(G!==".")Y.push(G);let K=Q.startsWith("/")?"/"+Y.join("/"):Y.join("/");if(!K)K=Q.startsWith("/")?"/":".";if(Z&&K!=="/"&&K!==".")K+="/";return K}function Pu1(J,Q,Z="/",X="/",Y=!0){function K(F,H){return Y?F===H:F.toLowerCase()===H.toLowerCase()}if(Z==="/")J=J.replaceAll(/\/{2,}/g,"/"),Q=Q.replaceAll(/\/{2,}/g,"/");else J=J.replaceAll(/\\{2,}/g,"\\"),Q=Q.replaceAll(/\\{2,}/g,"\\");if(J!==Z&&J.endsWith(Z))J=J.slice(0,-1);if(Q!==Z&&Q.endsWith(Z))Q=Q.slice(0,-1);if(K(J,Q))return"";if(!J.startsWith(Z)&&Q.startsWith(Z))return Q;let G=J===Z?[""]:J.split(Z),q=Q===Z?[""]:Q.split(Z),z=0;while(z<G.length&&z<q.length&&K(G[z],q[z]))z++;let U=G.length-z,W=[];for(let F=0;F<U;F++)W.push("..");return W.push(...q.slice(z)),W.join(X)}function qd(J){let Q=LN(J.replace(/\/+$/,"")),Z=Q.lastIndexOf(".");if(Z===0||Z===-1)return"";return Q.slice(Z)}function wQ(J){if(J=V8(J),J.scheme==="file")return J.path;return J.toString()}var mR=B1(()=>{iC()});function lz6(J,...Q){return J=V8(J),J.with({path:gR(J.path,...Q)})}function iz6(J,...Q){let Z=J.path,X=!1;if(Z[0]!==zd)Z=zd+Z,X=!0;let Y=Z;for(let K of Q)if(K.startsWith("/"))Y=gR(K);else Y=gR(Y,K);if(Y!=="/"&&Y.endsWith("/"))Y=Y.replace(/\/+$/,"");if(X&&Y[0]===zd&&!J.authority)Y=Y.substring(1);return J.with({path:Y})}function az6(J){if(J=V8(J),J.path.length===0||J.path===zd)return J;let Q=PQ1(J.path);if(Q.length===1&&Q===".")Q="";return J.with({path:Q})}function nz6(J,Q){if(Q.scheme!==J.scheme||(Q.authority??"")!==(J.authority??""))return!1;let Z=Q.scheme==="file"&&Q.path.match(/^\/[A-Za-z]:/),X=Z?Q.path.slice(0,2).toUpperCase()+Q.path.slice(2):Q.path,Y=Z?J.path.slice(0,2).toUpperCase()+J.path.slice(2):J.path;return Y===X||Y.startsWith(X.endsWith("/")?X:`${X}/`)||X.endsWith("/")&&Y===X.slice(0,-1)}function rz6(J,Q){if(J.scheme!==Q.scheme||J.authority!==Q.authority||J.query!==Q.query||J.fragment!==Q.fragment)return null;let Z=J.platform==="windows"?"\\":"/";return Pu1(J.path,Q.path,Z,Z)}function sz6(J,Q){let Z=T6(J),X=T6(Q);if(Z.startsWith("file:///")&&X.startsWith("file:///"))return Tu1(Z)===Tu1(X);return Z===X}function Tu1(J){return J.replace(/^file:\/\/\/([A-Za-z]):/,(Q)=>`file:///${Q.toLowerCase()}:`)}var zd="/",y0;var Ud=B1(()=>{mR();iC();y0={joinPath:lz6,resolvePath:iz6,dirname:az6,basename:(J)=>LN(V8(J).path),extname:(J)=>qd(V8(J).path),hasPrefix:nz6,relativePath:rz6,equalURIs:sz6}});var vu1=t((Cu1)=>{Object.defineProperty(Cu1,"__esModule",{value:!0});Cu1._globalThis=void 0;Cu1._globalThis=typeof globalThis==="object"?globalThis:global});var ku1=t((AN)=>{var oz6=AN&&AN.__createBinding||(Object.create?function(J,Q,Z,X){if(X===void 0)X=Z;Object.defineProperty(J,X,{enumerable:!0,get:function(){return Q[Z]}})}:function(J,Q,Z,X){if(X===void 0)X=Z;J[X]=Q[Z]}),tz6=AN&&AN.__exportStar||function(J,Q){for(var Z in J)if(Z!=="default"&&!Object.prototype.hasOwnProperty.call(Q,Z))oz6(Q,J,Z)};Object.defineProperty(AN,"__esModule",{value:!0});tz6(vu1(),AN)});var _u1=t((wN)=>{var ez6=wN&&wN.__createBinding||(Object.create?function(J,Q,Z,X){if(X===void 0)X=Z;Object.defineProperty(J,X,{enumerable:!0,get:function(){return Q[Z]}})}:function(J,Q,Z,X){if(X===void 0)X=Z;J[X]=Q[Z]}),JU6=wN&&wN.__exportStar||function(J,Q){for(var Z in J)if(Z!=="default"&&!Object.prototype.hasOwnProperty.call(Q,Z))ez6(Q,J,Z)};Object.defineProperty(wN,"__esModule",{value:!0});JU6(ku1(),wN)});var TQ1=t((xu1)=>{Object.defineProperty(xu1,"__esModule",{value:!0});xu1.VERSION=void 0;xu1.VERSION="1.9.0"});var mu1=t((hu1)=>{Object.defineProperty(hu1,"__esModule",{value:!0});hu1.isCompatible=hu1._makeCompatibilityCheck=void 0;var QU6=TQ1(),yu1=/^(\d+)\.(\d+)\.(\d+)(-(.+))?$/;function fu1(J){let Q=new Set([J]),Z=new Set,X=J.match(yu1);if(!X)return()=>!1;let Y={major:+X[1],minor:+X[2],patch:+X[3],prerelease:X[4]};if(Y.prerelease!=null)return function(z){return z===J};function K(q){return Z.add(q),!1}function G(q){return Q.add(q),!0}return function(z){if(Q.has(z))return!0;if(Z.has(z))return!1;let U=z.match(yu1);if(!U)return K(z);let W={major:+U[1],minor:+U[2],patch:+U[3],prerelease:U[4]};if(W.prerelease!=null)return K(z);if(Y.major!==W.major)return K(z);if(Y.major===0){if(Y.minor===W.minor&&Y.patch<=W.patch)return G(z);return K(z)}if(Y.minor<=W.minor)return G(z);return K(z)}}hu1._makeCompatibilityCheck=fu1;hu1.isCompatible=fu1(QU6.VERSION)});var RN=t((uu1)=>{Object.defineProperty(uu1,"__esModule",{value:!0});uu1.unregisterGlobal=uu1.getGlobal=uu1.registerGlobal=void 0;var XU6=_u1(),uR=TQ1(),YU6=mu1(),KU6=uR.VERSION.split(".")[0],aC=Symbol.for(`opentelemetry.js.api.${KU6}`),nC=XU6._globalThis;function GU6(J,Q,Z,X=!1){var Y;let K=nC[aC]=(Y=nC[aC])!==null&&Y!==void 0?Y:{version:uR.VERSION};if(!X&&K[J]){let G=Error(`@opentelemetry/api: Attempted duplicate registration of API: ${J}`);return Z.error(G.stack||G.message),!1}if(K.version!==uR.VERSION){let G=Error(`@opentelemetry/api: Registration of version v${K.version} for ${J} does not match previously registered API v${uR.VERSION}`);return Z.error(G.stack||G.message),!1}return K[J]=Q,Z.debug(`@opentelemetry/api: Registered a global for ${J} v${uR.VERSION}.`),!0}uu1.registerGlobal=GU6;function qU6(J){var Q,Z;let X=(Q=nC[aC])===null||Q===void 0?void 0:Q.version;if(!X||!(0,YU6.isCompatible)(X))return;return(Z=nC[aC])===null||Z===void 0?void 0:Z[J]}uu1.getGlobal=qU6;function zU6(J,Q){Q.debug(`@opentelemetry/api: Unregistering a global for ${J} v${uR.VERSION}.`);let Z=nC[aC];if(Z)delete Z[J]}uu1.unregisterGlobal=zU6});var iu1=t((cu1)=>{Object.defineProperty(cu1,"__esModule",{value:!0});cu1.DiagComponentLogger=void 0;var FU6=RN();class du1{constructor(J){this._namespace=J.namespace||"DiagComponentLogger"}debug(...J){return rC("debug",this._namespace,J)}error(...J){return rC("error",this._namespace,J)}info(...J){return rC("info",this._namespace,J)}warn(...J){return rC("warn",this._namespace,J)}verbose(...J){return rC("verbose",this._namespace,J)}}cu1.DiagComponentLogger=du1;function rC(J,Q,Z){let X=(0,FU6.getGlobal)("diag");if(!X)return;return Z.unshift(Q),X[J](...Z)}});var Wd=t((au1)=>{Object.defineProperty(au1,"__esModule",{value:!0});au1.DiagLogLevel=void 0;var HU6;(function(J){J[J.NONE=0]="NONE",J[J.ERROR=30]="ERROR",J[J.WARN=50]="WARN",J[J.INFO=60]="INFO",J[J.DEBUG=70]="DEBUG",J[J.VERBOSE=80]="VERBOSE",J[J.ALL=9999]="ALL"})(HU6=au1.DiagLogLevel||(au1.DiagLogLevel={}))});var su1=t((nu1)=>{Object.defineProperty(nu1,"__esModule",{value:!0});nu1.createLogLevelDiagLogger=void 0;var qW=Wd();function BU6(J,Q){if(J<qW.DiagLogLevel.NONE)J=qW.DiagLogLevel.NONE;else if(J>qW.DiagLogLevel.ALL)J=qW.DiagLogLevel.ALL;Q=Q||{};function Z(X,Y){let K=Q[X];if(typeof K==="function"&&J>=Y)return K.bind(Q);return function(){}}return{error:Z("error",qW.DiagLogLevel.ERROR),warn:Z("warn",qW.DiagLogLevel.WARN),info:Z("info",qW.DiagLogLevel.INFO),debug:Z("debug",qW.DiagLogLevel.DEBUG),verbose:Z("verbose",qW.DiagLogLevel.VERBOSE)}}nu1.createLogLevelDiagLogger=BU6});var ON=t((tu1)=>{Object.defineProperty(tu1,"__esModule",{value:!0});tu1.DiagAPI=void 0;var DU6=iu1(),MU6=su1(),ou1=Wd(),Fd=RN(),VU6="diag";class SQ1{constructor(){function J(X){return function(...Y){let K=(0,Fd.getGlobal)("diag");if(!K)return;return K[X](...Y)}}let Q=this,Z=(X,Y={logLevel:ou1.DiagLogLevel.INFO})=>{var K,G,q;if(X===Q){let W=Error("Cannot use diag as the logger for itself. Please use a DiagLogger implementation like ConsoleDiagLogger or a custom implementation");return Q.error((K=W.stack)!==null&&K!==void 0?K:W.message),!1}if(typeof Y==="number")Y={logLevel:Y};let z=(0,Fd.getGlobal)("diag"),U=(0,MU6.createLogLevelDiagLogger)((G=Y.logLevel)!==null&&G!==void 0?G:ou1.DiagLogLevel.INFO,X);if(z&&!Y.suppressOverrideMessage){let W=(q=Error().stack)!==null&&q!==void 0?q:"<failed to generate stacktrace>";z.warn(`Current logger will be overwritten from ${W}`),U.warn(`Current logger will overwrite one already registered from ${W}`)}return(0,Fd.registerGlobal)("diag",U,Q,!0)};Q.setLogger=Z,Q.disable=()=>{(0,Fd.unregisterGlobal)(VU6,Q)},Q.createComponentLogger=(X)=>{return new DU6.DiagComponentLogger(X)},Q.verbose=J("verbose"),Q.debug=J("debug"),Q.info=J("info"),Q.warn=J("warn"),Q.error=J("error")}static instance(){if(!this._instance)this._instance=new SQ1;return this._instance}}tu1.DiagAPI=SQ1});var Zp1=t((Jp1)=>{Object.defineProperty(Jp1,"__esModule",{value:!0});Jp1.BaggageImpl=void 0;class pR{constructor(J){this._entries=J?new Map(J):new Map}getEntry(J){let Q=this._entries.get(J);if(!Q)return;return Object.assign({},Q)}getAllEntries(){return Array.from(this._entries.entries()).map(([J,Q])=>[J,Q])}setEntry(J,Q){let Z=new pR(this._entries);return Z._entries.set(J,Q),Z}removeEntry(J){let Q=new pR(this._entries);return Q._entries.delete(J),Q}removeEntries(...J){let Q=new pR(this._entries);for(let Z of J)Q._entries.delete(Z);return Q}clear(){return new pR}}Jp1.BaggageImpl=pR});var Kp1=t((Xp1)=>{Object.defineProperty(Xp1,"__esModule",{value:!0});Xp1.baggageEntryMetadataSymbol=void 0;Xp1.baggageEntryMetadataSymbol=Symbol("BaggageEntryMetadata")});var vQ1=t((Gp1)=>{Object.defineProperty(Gp1,"__esModule",{value:!0});Gp1.baggageEntryMetadataFromString=Gp1.createBaggage=void 0;var NU6=ON(),LU6=Zp1(),AU6=Kp1(),wU6=NU6.DiagAPI.instance();function RU6(J={}){return new LU6.BaggageImpl(new Map(Object.entries(J)))}Gp1.createBaggage=RU6;function OU6(J){if(typeof J!=="string")wU6.error(`Cannot create baggage metadata from unknown type: ${typeof J}`),J="";return{__TYPE__:AU6.baggageEntryMetadataSymbol,toString(){return J}}}Gp1.baggageEntryMetadataFromString=OU6});var sC=t((zp1)=>{Object.defineProperty(zp1,"__esModule",{value:!0});zp1.ROOT_CONTEXT=zp1.createContextKey=void 0;function $U6(J){return Symbol.for(J)}zp1.createContextKey=$U6;class Hd{constructor(J){let Q=this;Q._currentContext=J?new Map(J):new Map,Q.getValue=(Z)=>Q._currentContext.get(Z),Q.setValue=(Z,X)=>{let Y=new Hd(Q._currentContext);return Y._currentContext.set(Z,X),Y},Q.deleteValue=(Z)=>{let X=new Hd(Q._currentContext);return X._currentContext.delete(Z),X}}}zp1.ROOT_CONTEXT=new Hd});var Bp1=t((Fp1)=>{Object.defineProperty(Fp1,"__esModule",{value:!0});Fp1.DiagConsoleLogger=void 0;var kQ1=[{n:"error",c:"error"},{n:"warn",c:"warn"},{n:"info",c:"info"},{n:"debug",c:"debug"},{n:"verbose",c:"trace"}];class Wp1{constructor(){function J(Q){return function(...Z){if(console){let X=console[Q];if(typeof X!=="function")X=console.log;if(typeof X==="function")return X.apply(console,Z)}}}for(let Q=0;Q<kQ1.length;Q++)this[kQ1[Q].n]=J(kQ1[Q].c)}}Fp1.DiagConsoleLogger=Wp1});var uQ1=t((Dp1)=>{Object.defineProperty(Dp1,"__esModule",{value:!0});Dp1.createNoopMeter=Dp1.NOOP_OBSERVABLE_UP_DOWN_COUNTER_METRIC=Dp1.NOOP_OBSERVABLE_GAUGE_METRIC=Dp1.NOOP_OBSERVABLE_COUNTER_METRIC=Dp1.NOOP_UP_DOWN_COUNTER_METRIC=Dp1.NOOP_HISTOGRAM_METRIC=Dp1.NOOP_GAUGE_METRIC=Dp1.NOOP_COUNTER_METRIC=Dp1.NOOP_METER=Dp1.NoopObservableUpDownCounterMetric=Dp1.NoopObservableGaugeMetric=Dp1.NoopObservableCounterMetric=Dp1.NoopObservableMetric=Dp1.NoopHistogramMetric=Dp1.NoopGaugeMetric=Dp1.NoopUpDownCounterMetric=Dp1.NoopCounterMetric=Dp1.NoopMetric=Dp1.NoopMeter=void 0;class _Q1{constructor(){}createGauge(J,Q){return Dp1.NOOP_GAUGE_METRIC}createHistogram(J,Q){return Dp1.NOOP_HISTOGRAM_METRIC}createCounter(J,Q){return Dp1.NOOP_COUNTER_METRIC}createUpDownCounter(J,Q){return Dp1.NOOP_UP_DOWN_COUNTER_METRIC}createObservableGauge(J,Q){return Dp1.NOOP_OBSERVABLE_GAUGE_METRIC}createObservableCounter(J,Q){return Dp1.NOOP_OBSERVABLE_COUNTER_METRIC}createObservableUpDownCounter(J,Q){return Dp1.NOOP_OBSERVABLE_UP_DOWN_COUNTER_METRIC}addBatchObservableCallback(J,Q){}removeBatchObservableCallback(J){}}Dp1.NoopMeter=_Q1;class dR{}Dp1.NoopMetric=dR;class xQ1 extends dR{add(J,Q){}}Dp1.NoopCounterMetric=xQ1;class bQ1 extends dR{add(J,Q){}}Dp1.NoopUpDownCounterMetric=bQ1;class yQ1 extends dR{record(J,Q){}}Dp1.NoopGaugeMetric=yQ1;class fQ1 extends dR{record(J,Q){}}Dp1.NoopHistogramMetric=fQ1;class oC{addCallback(J){}removeCallback(J){}}Dp1.NoopObservableMetric=oC;class hQ1 extends oC{}Dp1.NoopObservableCounterMetric=hQ1;class gQ1 extends oC{}Dp1.NoopObservableGaugeMetric=gQ1;class mQ1 extends oC{}Dp1.NoopObservableUpDownCounterMetric=mQ1;Dp1.NOOP_METER=new _Q1;Dp1.NOOP_COUNTER_METRIC=new xQ1;Dp1.NOOP_GAUGE_METRIC=new yQ1;Dp1.NOOP_HISTOGRAM_METRIC=new fQ1;Dp1.NOOP_UP_DOWN_COUNTER_METRIC=new bQ1;Dp1.NOOP_OBSERVABLE_COUNTER_METRIC=new hQ1;Dp1.NOOP_OBSERVABLE_GAUGE_METRIC=new gQ1;Dp1.NOOP_OBSERVABLE_UP_DOWN_COUNTER_METRIC=new mQ1;function IU6(){return Dp1.NOOP_METER}Dp1.createNoopMeter=IU6});var Ep1=t(($p1)=>{Object.defineProperty($p1,"__esModule",{value:!0});$p1.ValueType=void 0;var fU6;(function(J){J[J.INT=0]="INT",J[J.DOUBLE=1]="DOUBLE"})(fU6=$p1.ValueType||($p1.ValueType={}))});var dQ1=t((Ip1)=>{Object.defineProperty(Ip1,"__esModule",{value:!0});Ip1.defaultTextMapSetter=Ip1.defaultTextMapGetter=void 0;Ip1.defaultTextMapGetter={get(J,Q){if(J==null)return;return J[Q]},keys(J){if(J==null)return[];return Object.keys(J)}};Ip1.defaultTextMapSetter={set(J,Q,Z){if(J==null)return;J[Q]=Z}}});var vp1=t((Cp1)=>{Object.defineProperty(Cp1,"__esModule",{value:!0});Cp1.NoopContextManager=void 0;var gU6=sC();class Tp1{active(){return gU6.ROOT_CONTEXT}with(J,Q,Z,...X){return Q.call(Z,...X)}bind(J,Q){return Q}enable(){return this}disable(){return this}}Cp1.NoopContextManager=Tp1});var tC=t((_p1)=>{Object.defineProperty(_p1,"__esModule",{value:!0});_p1.ContextAPI=void 0;var mU6=vp1(),cQ1=RN(),kp1=ON(),lQ1="context",uU6=new mU6.NoopContextManager;class iQ1{constructor(){}static getInstance(){if(!this._instance)this._instance=new iQ1;return this._instance}setGlobalContextManager(J){return(0,cQ1.registerGlobal)(lQ1,J,kp1.DiagAPI.instance())}active(){return this._getContextManager().active()}with(J,Q,Z,...X){return this._getContextManager().with(J,Q,Z,...X)}bind(J,Q){return this._getContextManager().bind(J,Q)}_getContextManager(){return(0,cQ1.getGlobal)(lQ1)||uU6}disable(){this._getContextManager().disable(),(0,cQ1.unregisterGlobal)(lQ1,kp1.DiagAPI.instance())}}_p1.ContextAPI=iQ1});var nQ1=t((bp1)=>{Object.defineProperty(bp1,"__esModule",{value:!0});bp1.TraceFlags=void 0;var pU6;(function(J){J[J.NONE=0]="NONE",J[J.SAMPLED=1]="SAMPLED"})(pU6=bp1.TraceFlags||(bp1.TraceFlags={}))});var Bd=t((yp1)=>{Object.defineProperty(yp1,"__esModule",{value:!0});yp1.INVALID_SPAN_CONTEXT=yp1.INVALID_TRACEID=yp1.INVALID_SPANID=void 0;var dU6=nQ1();yp1.INVALID_SPANID="0000000000000000";yp1.INVALID_TRACEID="00000000000000000000000000000000";yp1.INVALID_SPAN_CONTEXT={traceId:yp1.INVALID_TRACEID,spanId:yp1.INVALID_SPANID,traceFlags:dU6.TraceFlags.NONE}});var Dd=t((up1)=>{Object.defineProperty(up1,"__esModule",{value:!0});up1.NonRecordingSpan=void 0;var cU6=Bd();class mp1{constructor(J=cU6.INVALID_SPAN_CONTEXT){this._spanContext=J}spanContext(){return this._spanContext}setAttribute(J,Q){return this}setAttributes(J){return this}addEvent(J,Q){return this}addLink(J){return this}addLinks(J){return this}setStatus(J){return this}updateName(J){return this}end(J){}isRecording(){return!1}recordException(J,Q){}}up1.NonRecordingSpan=mp1});var oQ1=t((cp1)=>{Object.defineProperty(cp1,"__esModule",{value:!0});cp1.getSpanContext=cp1.setSpanContext=cp1.deleteSpan=cp1.setSpan=cp1.getActiveSpan=cp1.getSpan=void 0;var lU6=sC(),iU6=Dd(),aU6=tC(),rQ1=(0,lU6.createContextKey)("OpenTelemetry Context Key SPAN");function sQ1(J){return J.getValue(rQ1)||void 0}cp1.getSpan=sQ1;function nU6(){return sQ1(aU6.ContextAPI.getInstance().active())}cp1.getActiveSpan=nU6;function dp1(J,Q){return J.setValue(rQ1,Q)}cp1.setSpan=dp1;function rU6(J){return J.deleteValue(rQ1)}cp1.deleteSpan=rU6;function sU6(J,Q){return dp1(J,new iU6.NonRecordingSpan(Q))}cp1.setSpanContext=sU6;function oU6(J){var Q;return(Q=sQ1(J))===null||Q===void 0?void 0:Q.spanContext()}cp1.getSpanContext=oU6});var Md=t((rp1)=>{Object.defineProperty(rp1,"__esModule",{value:!0});rp1.wrapSpanContext=rp1.isSpanContextValid=rp1.isValidSpanId=rp1.isValidTraceId=void 0;var ip1=Bd(),XW6=Dd(),YW6=/^([0-9a-f]{32})$/i,KW6=/^[0-9a-f]{16}$/i;function ap1(J){return YW6.test(J)&&J!==ip1.INVALID_TRACEID}rp1.isValidTraceId=ap1;function np1(J){return KW6.test(J)&&J!==ip1.INVALID_SPANID}rp1.isValidSpanId=np1;function GW6(J){return ap1(J.traceId)&&np1(J.spanId)}rp1.isSpanContextValid=GW6;function qW6(J){return new XW6.NonRecordingSpan(J)}rp1.wrapSpanContext=qW6});var JZ1=t((ep1)=>{Object.defineProperty(ep1,"__esModule",{value:!0});ep1.NoopTracer=void 0;var FW6=tC(),op1=oQ1(),tQ1=Dd(),HW6=Md(),eQ1=FW6.ContextAPI.getInstance();class tp1{startSpan(J,Q,Z=eQ1.active()){if(Boolean(Q===null||Q===void 0?void 0:Q.root))return new tQ1.NonRecordingSpan;let Y=Z&&(0,op1.getSpanContext)(Z);if(BW6(Y)&&(0,HW6.isSpanContextValid)(Y))return new tQ1.NonRecordingSpan(Y);else return new tQ1.NonRecordingSpan}startActiveSpan(J,Q,Z,X){let Y,K,G;if(arguments.length<2)return;else if(arguments.length===2)G=Q;else if(arguments.length===3)Y=Q,G=Z;else Y=Q,K=Z,G=X;let q=K!==null&&K!==void 0?K:eQ1.active(),z=this.startSpan(J,Y,q),U=(0,op1.setSpan)(q,z);return eQ1.with(U,G,void 0,z)}}ep1.NoopTracer=tp1;function BW6(J){return typeof J==="object"&&typeof J.spanId==="string"&&typeof J.traceId==="string"&&typeof J.traceFlags==="number"}});var QZ1=t((Zd1)=>{Object.defineProperty(Zd1,"__esModule",{value:!0});Zd1.ProxyTracer=void 0;var DW6=JZ1(),MW6=new DW6.NoopTracer;class Qd1{constructor(J,Q,Z,X){this._provider=J,this.name=Q,this.version=Z,this.options=X}startSpan(J,Q,Z){return this._getTracer().startSpan(J,Q,Z)}startActiveSpan(J,Q,Z,X){let Y=this._getTracer();return Reflect.apply(Y.startActiveSpan,Y,arguments)}_getTracer(){if(this._delegate)return this._delegate;let J=this._provider.getDelegateTracer(this.name,this.version,this.options);if(!J)return MW6;return this._delegate=J,this._delegate}}Zd1.ProxyTracer=Qd1});var qd1=t((Kd1)=>{Object.defineProperty(Kd1,"__esModule",{value:!0});Kd1.NoopTracerProvider=void 0;var VW6=JZ1();class Yd1{getTracer(J,Q,Z){return new VW6.NoopTracer}}Kd1.NoopTracerProvider=Yd1});var ZZ1=t((Ud1)=>{Object.defineProperty(Ud1,"__esModule",{value:!0});Ud1.ProxyTracerProvider=void 0;var NW6=QZ1(),LW6=qd1(),AW6=new LW6.NoopTracerProvider;class zd1{getTracer(J,Q,Z){var X;return(X=this.getDelegateTracer(J,Q,Z))!==null&&X!==void 0?X:new NW6.ProxyTracer(this,J,Q,Z)}getDelegate(){var J;return(J=this._delegate)!==null&&J!==void 0?J:AW6}setDelegate(J){this._delegate=J}getDelegateTracer(J,Q,Z){var X;return(X=this._delegate)===null||X===void 0?void 0:X.getTracer(J,Q,Z)}}Ud1.ProxyTracerProvider=zd1});var Hd1=t((Fd1)=>{Object.defineProperty(Fd1,"__esModule",{value:!0});Fd1.SamplingDecision=void 0;var wW6;(function(J){J[J.NOT_RECORD=0]="NOT_RECORD",J[J.RECORD=1]="RECORD",J[J.RECORD_AND_SAMPLED=2]="RECORD_AND_SAMPLED"})(wW6=Fd1.SamplingDecision||(Fd1.SamplingDecision={}))});var Dd1=t((Bd1)=>{Object.defineProperty(Bd1,"__esModule",{value:!0});Bd1.SpanKind=void 0;var RW6;(function(J){J[J.INTERNAL=0]="INTERNAL",J[J.SERVER=1]="SERVER",J[J.CLIENT=2]="CLIENT",J[J.PRODUCER=3]="PRODUCER",J[J.CONSUMER=4]="CONSUMER"})(RW6=Bd1.SpanKind||(Bd1.SpanKind={}))});var Vd1=t((Md1)=>{Object.defineProperty(Md1,"__esModule",{value:!0});Md1.SpanStatusCode=void 0;var OW6;(function(J){J[J.UNSET=0]="UNSET",J[J.OK=1]="OK",J[J.ERROR=2]="ERROR"})(OW6=Md1.SpanStatusCode||(Md1.SpanStatusCode={}))});var Ad1=t((Nd1)=>{Object.defineProperty(Nd1,"__esModule",{value:!0});Nd1.validateValue=Nd1.validateKey=void 0;var GZ1="[_0-9a-z-*/]",jW6=`[a-z]${GZ1}{0,255}`,$W6=`[a-z0-9]${GZ1}{0,240}@[a-z]${GZ1}{0,13}`,EW6=new RegExp(`^(?:${jW6}|${$W6})$`),IW6=/^[ -~]{0,255}[!-~]$/,PW6=/,|=/;function TW6(J){return EW6.test(J)}Nd1.validateKey=TW6;function CW6(J){return IW6.test(J)&&!PW6.test(J)}Nd1.validateValue=CW6});var Id1=t(($d1)=>{Object.defineProperty($d1,"__esModule",{value:!0});$d1.TraceStateImpl=void 0;var wd1=Ad1(),Rd1=32,vW6=512,Od1=",",jd1="=";class qZ1{constructor(J){if(this._internalState=new Map,J)this._parse(J)}set(J,Q){let Z=this._clone();if(Z._internalState.has(J))Z._internalState.delete(J);return Z._internalState.set(J,Q),Z}unset(J){let Q=this._clone();return Q._internalState.delete(J),Q}get(J){return this._internalState.get(J)}serialize(){return this._keys().reduce((J,Q)=>{return J.push(Q+jd1+this.get(Q)),J},[]).join(Od1)}_parse(J){if(J.length>vW6)return;if(this._internalState=J.split(Od1).reverse().reduce((Q,Z)=>{let X=Z.trim(),Y=X.indexOf(jd1);if(Y!==-1){let K=X.slice(0,Y),G=X.slice(Y+1,Z.length);if((0,wd1.validateKey)(K)&&(0,wd1.validateValue)(G))Q.set(K,G)}return Q},new Map),this._internalState.size>Rd1)this._internalState=new Map(Array.from(this._internalState.entries()).reverse().slice(0,Rd1))}_keys(){return Array.from(this._internalState.keys()).reverse()}_clone(){let J=new qZ1;return J._internalState=new Map(this._internalState),J}}$d1.TraceStateImpl=qZ1});var Cd1=t((Pd1)=>{Object.defineProperty(Pd1,"__esModule",{value:!0});Pd1.createTraceState=void 0;var kW6=Id1();function _W6(J){return new kW6.TraceStateImpl(J)}Pd1.createTraceState=_W6});var kd1=t((Sd1)=>{Object.defineProperty(Sd1,"__esModule",{value:!0});Sd1.context=void 0;var xW6=tC();Sd1.context=xW6.ContextAPI.getInstance()});var bd1=t((_d1)=>{Object.defineProperty(_d1,"__esModule",{value:!0});_d1.diag=void 0;var bW6=ON();_d1.diag=bW6.DiagAPI.instance()});var hd1=t((yd1)=>{Object.defineProperty(yd1,"__esModule",{value:!0});yd1.NOOP_METER_PROVIDER=yd1.NoopMeterProvider=void 0;var yW6=uQ1();class zZ1{getMeter(J,Q,Z){return yW6.NOOP_METER}}yd1.NoopMeterProvider=zZ1;yd1.NOOP_METER_PROVIDER=new zZ1});var pd1=t((md1)=>{Object.defineProperty(md1,"__esModule",{value:!0});md1.MetricsAPI=void 0;var hW6=hd1(),UZ1=RN(),gd1=ON(),WZ1="metrics";class FZ1{constructor(){}static getInstance(){if(!this._instance)this._instance=new FZ1;return this._instance}setGlobalMeterProvider(J){return(0,UZ1.registerGlobal)(WZ1,J,gd1.DiagAPI.instance())}getMeterProvider(){return(0,UZ1.getGlobal)(WZ1)||hW6.NOOP_METER_PROVIDER}getMeter(J,Q,Z){return this.getMeterProvider().getMeter(J,Q,Z)}disable(){(0,UZ1.unregisterGlobal)(WZ1,gd1.DiagAPI.instance())}}md1.MetricsAPI=FZ1});var ld1=t((dd1)=>{Object.defineProperty(dd1,"__esModule",{value:!0});dd1.metrics=void 0;var gW6=pd1();dd1.metrics=gW6.MetricsAPI.getInstance()});var rd1=t((ad1)=>{Object.defineProperty(ad1,"__esModule",{value:!0});ad1.NoopTextMapPropagator=void 0;class id1{inject(J,Q){}extract(J,Q){return J}fields(){return[]}}ad1.NoopTextMapPropagator=id1});var ed1=t((od1)=>{Object.defineProperty(od1,"__esModule",{value:!0});od1.deleteBaggage=od1.setBaggage=od1.getActiveBaggage=od1.getBaggage=void 0;var mW6=tC(),uW6=sC(),HZ1=(0,uW6.createContextKey)("OpenTelemetry Baggage Key");function sd1(J){return J.getValue(HZ1)||void 0}od1.getBaggage=sd1;function pW6(){return sd1(mW6.ContextAPI.getInstance().active())}od1.getActiveBaggage=pW6;function dW6(J,Q){return J.setValue(HZ1,Q)}od1.setBaggage=dW6;function cW6(J){return J.deleteValue(HZ1)}od1.deleteBaggage=cW6});var Yc1=t((Zc1)=>{Object.defineProperty(Zc1,"__esModule",{value:!0});Zc1.PropagationAPI=void 0;var BZ1=RN(),nW6=rd1(),Jc1=dQ1(),Vd=ed1(),rW6=vQ1(),Qc1=ON(),DZ1="propagation",sW6=new nW6.NoopTextMapPropagator;class MZ1{constructor(){this.createBaggage=rW6.createBaggage,this.getBaggage=Vd.getBaggage,this.getActiveBaggage=Vd.getActiveBaggage,this.setBaggage=Vd.setBaggage,this.deleteBaggage=Vd.deleteBaggage}static getInstance(){if(!this._instance)this._instance=new MZ1;return this._instance}setGlobalPropagator(J){return(0,BZ1.registerGlobal)(DZ1,J,Qc1.DiagAPI.instance())}inject(J,Q,Z=Jc1.defaultTextMapSetter){return this._getGlobalPropagator().inject(J,Q,Z)}extract(J,Q,Z=Jc1.defaultTextMapGetter){return this._getGlobalPropagator().extract(J,Q,Z)}fields(){return this._getGlobalPropagator().fields()}disable(){(0,BZ1.unregisterGlobal)(DZ1,Qc1.DiagAPI.instance())}_getGlobalPropagator(){return(0,BZ1.getGlobal)(DZ1)||sW6}}Zc1.PropagationAPI=MZ1});var qc1=t((Kc1)=>{Object.defineProperty(Kc1,"__esModule",{value:!0});Kc1.propagation=void 0;var oW6=Yc1();Kc1.propagation=oW6.PropagationAPI.getInstance()});var Bc1=t((Fc1)=>{Object.defineProperty(Fc1,"__esModule",{value:!0});Fc1.TraceAPI=void 0;var VZ1=RN(),zc1=ZZ1(),Uc1=Md(),cR=oQ1(),Wc1=ON(),NZ1="trace";class LZ1{constructor(){this._proxyTracerProvider=new zc1.ProxyTracerProvider,this.wrapSpanContext=Uc1.wrapSpanContext,this.isSpanContextValid=Uc1.isSpanContextValid,this.deleteSpan=cR.deleteSpan,this.getSpan=cR.getSpan,this.getActiveSpan=cR.getActiveSpan,this.getSpanContext=cR.getSpanContext,this.setSpan=cR.setSpan,this.setSpanContext=cR.setSpanContext}static getInstance(){if(!this._instance)this._instance=new LZ1;return this._instance}setGlobalTracerProvider(J){let Q=(0,VZ1.registerGlobal)(NZ1,this._proxyTracerProvider,Wc1.DiagAPI.instance());if(Q)this._proxyTracerProvider.setDelegate(J);return Q}getTracerProvider(){return(0,VZ1.getGlobal)(NZ1)||this._proxyTracerProvider}getTracer(J,Q){return this.getTracerProvider().getTracer(J,Q)}disable(){(0,VZ1.unregisterGlobal)(NZ1,Wc1.DiagAPI.instance()),this._proxyTracerProvider=new zc1.ProxyTracerProvider}}Fc1.TraceAPI=LZ1});var Vc1=t((Dc1)=>{Object.defineProperty(Dc1,"__esModule",{value:!0});Dc1.trace=void 0;var tW6=Bc1();Dc1.trace=tW6.TraceAPI.getInstance()});var Nd=t((C2)=>{Object.defineProperty(C2,"__esModule",{value:!0});C2.trace=C2.propagation=C2.metrics=C2.diag=C2.context=C2.INVALID_SPAN_CONTEXT=C2.INVALID_TRACEID=C2.INVALID_SPANID=C2.isValidSpanId=C2.isValidTraceId=C2.isSpanContextValid=C2.createTraceState=C2.TraceFlags=C2.SpanStatusCode=C2.SpanKind=C2.SamplingDecision=C2.ProxyTracerProvider=C2.ProxyTracer=C2.defaultTextMapSetter=C2.defaultTextMapGetter=C2.ValueType=C2.createNoopMeter=C2.DiagLogLevel=C2.DiagConsoleLogger=C2.ROOT_CONTEXT=C2.createContextKey=C2.baggageEntryMetadataFromString=void 0;var eW6=vQ1();Object.defineProperty(C2,"baggageEntryMetadataFromString",{enumerable:!0,get:function(){return eW6.baggageEntryMetadataFromString}});var Nc1=sC();Object.defineProperty(C2,"createContextKey",{enumerable:!0,get:function(){return Nc1.createContextKey}});Object.defineProperty(C2,"ROOT_CONTEXT",{enumerable:!0,get:function(){return Nc1.ROOT_CONTEXT}});var JF6=Bp1();Object.defineProperty(C2,"DiagConsoleLogger",{enumerable:!0,get:function(){return JF6.DiagConsoleLogger}});var QF6=Wd();Object.defineProperty(C2,"DiagLogLevel",{enumerable:!0,get:function(){return QF6.DiagLogLevel}});var ZF6=uQ1();Object.defineProperty(C2,"createNoopMeter",{enumerable:!0,get:function(){return ZF6.createNoopMeter}});var XF6=Ep1();Object.defineProperty(C2,"ValueType",{enumerable:!0,get:function(){return XF6.ValueType}});var Lc1=dQ1();Object.defineProperty(C2,"defaultTextMapGetter",{enumerable:!0,get:function(){return Lc1.defaultTextMapGetter}});Object.defineProperty(C2,"defaultTextMapSetter",{enumerable:!0,get:function(){return Lc1.defaultTextMapSetter}});var YF6=QZ1();Object.defineProperty(C2,"ProxyTracer",{enumerable:!0,get:function(){return YF6.ProxyTracer}});var KF6=ZZ1();Object.defineProperty(C2,"ProxyTracerProvider",{enumerable:!0,get:function(){return KF6.ProxyTracerProvider}});var GF6=Hd1();Object.defineProperty(C2,"SamplingDecision",{enumerable:!0,get:function(){return GF6.SamplingDecision}});var qF6=Dd1();Object.defineProperty(C2,"SpanKind",{enumerable:!0,get:function(){return qF6.SpanKind}});var zF6=Vd1();Object.defineProperty(C2,"SpanStatusCode",{enumerable:!0,get:function(){return zF6.SpanStatusCode}});var UF6=nQ1();Object.defineProperty(C2,"TraceFlags",{enumerable:!0,get:function(){return UF6.TraceFlags}});var WF6=Cd1();Object.defineProperty(C2,"createTraceState",{enumerable:!0,get:function(){return WF6.createTraceState}});var AZ1=Md();Object.defineProperty(C2,"isSpanContextValid",{enumerable:!0,get:function(){return AZ1.isSpanContextValid}});Object.defineProperty(C2,"isValidTraceId",{enumerable:!0,get:function(){return AZ1.isValidTraceId}});Object.defineProperty(C2,"isValidSpanId",{enumerable:!0,get:function(){return AZ1.isValidSpanId}});var wZ1=Bd();Object.defineProperty(C2,"INVALID_SPANID",{enumerable:!0,get:function(){return wZ1.INVALID_SPANID}});Object.defineProperty(C2,"INVALID_TRACEID",{enumerable:!0,get:function(){return wZ1.INVALID_TRACEID}});Object.defineProperty(C2,"INVALID_SPAN_CONTEXT",{enumerable:!0,get:function(){return wZ1.INVALID_SPAN_CONTEXT}});var Ac1=kd1();Object.defineProperty(C2,"context",{enumerable:!0,get:function(){return Ac1.context}});var wc1=bd1();Object.defineProperty(C2,"diag",{enumerable:!0,get:function(){return wc1.diag}});var Rc1=ld1();Object.defineProperty(C2,"metrics",{enumerable:!0,get:function(){return Rc1.metrics}});var Oc1=qc1();Object.defineProperty(C2,"propagation",{enumerable:!0,get:function(){return Oc1.propagation}});var jc1=Vc1();Object.defineProperty(C2,"trace",{enumerable:!0,get:function(){return jc1.trace}});C2.default={context:Ac1.context,diag:wc1.diag,metrics:Rc1.metrics,propagation:Oc1.propagation,trace:jc1.trace}});function DF6(){return BF6}function $c1(J){let Q=jN;return jN=J,Q}class rq{baseLogger;scope;context={};constructor(J=Ec1){this.baseLogger=J}with(J){let Q=new rq(this.baseLogger);return Q.scope=this.scope,Q.context={...this.context,...J},Q}scoped(J){let Q=new rq(this.baseLogger);return Q.scope=this.scope?`${this.scope}.${J}`:J,Q.context={...this.context},Q}error(J,...Q){let Z=this.mergeContextWithMeta(Q);this.baseLogger.error(this.messageWithPrefix(J),...Z)}warn(J,...Q){let Z=this.mergeContextWithMeta(Q);this.baseLogger.warn(this.messageWithPrefix(J),...Z)}info(J,...Q){let Z=this.mergeContextWithMeta(Q);this.baseLogger.info(this.messageWithPrefix(J),...Z)}debug(J,...Q){let Z=this.mergeContextWithMeta(Q);this.baseLogger.debug(this.messageWithPrefix(J),...Z)}audit(J,...Q){let Z=this.mergeContextWithMeta(Q);this.baseLogger.audit(this.messageWithPrefix(J),...Z)}messageWithPrefix(J){return this.scope?`${this.scope}: ${J}`:J}mergeContextWithMeta(J){let Q={...this.context},Z=RZ1.trace.getActiveSpan();if(Z){let Y=Z.spanContext();if(Y.traceId)Q.traceId=Y.traceId,Q.spanId=Y.spanId}if(J.length===0)return[Q];let X=J[0];if(typeof X==="object"&&X!==null)return[{...X,...Q},...J.slice(1)];else return[Q,...J]}}var RZ1,BF6=!1,MF6,jN,Ec1,u;var G0=B1(()=>{RZ1=d6(Nd(),1);MF6={error:(J,...Q)=>console.error(J,...Q),warn:(J,...Q)=>console.warn(J,...Q),info:(J,...Q)=>console.info(J,...Q),debug:(J,...Q)=>{if(DF6())console.debug(J,...Q)},audit:(J,...Q)=>{let Z=Q.length>0?Q[0]:{};if(typeof Z==="object"&&Z!==null&&!("audit"in Z))Z.audit=!0;let X=RZ1.trace.getActiveSpan();if(X){let Y=X.spanContext();if(Y.traceId)Z.traceId=Y.traceId,Z.spanId=Y.spanId}console.info(J,Z)}},jN=MF6;Ec1={error:(J,...Q)=>jN.error(J,...Q),warn:(J,...Q)=>jN.warn(J,...Q),info:(J,...Q)=>jN.info(J,...Q),debug:(J,...Q)=>jN.debug(J,...Q),audit:(J,...Q)=>jN.audit(J,...Q)};u=Ec1});function Ld(J){Promise.resolve().then(()=>{try{J()}catch(Q){console.error(Q)}})}function Ic1(J){let Q=J._cleanup;if(Q===void 0)return;if(J._cleanup=void 0,!Q)return;try{if(typeof Q==="function")Q();else if(Q&&typeof Q.unsubscribe==="function")Q.unsubscribe()}catch(Z){console.error("cleanupSubscription",Z)}}function $Z1(J){J._observer=void 0,J._queue=void 0,J._state="closed"}function NF6(J){let Q=J._queue;if(!Q)return;J._queue=void 0,J._state="ready";for(let Z of Q)if(Pc1(J,Z.type,Z.value),J._state==="closed")break}function Pc1(J,Q,Z){J._state="running";let X=J._observer;try{switch(Q){case"next":if(X&&typeof X.next==="function")X.next(Z);break;case"error":if($Z1(J),X&&typeof X.error==="function")X.error(Z);else throw Z;break;case"complete":if($Z1(J),X&&typeof X.complete==="function")X.complete();break}}catch(Y){console.error("notifySubscription",Y)}if(J._state==="closed")Ic1(J);else if(J._state==="running")J._state="ready"}function jZ1(J,Q,Z){if(J._state==="closed")return;if(J._state==="buffering"){J._queue=J._queue||[],J._queue.push({type:Q,value:Z});return}if(J._state!=="ready"){J._state="buffering",J._queue=[{type:Q,value:Z}],Ld(()=>NF6(J));return}Pc1(J,Q,Z)}class Tc1{_cleanup;_observer;_queue;_state;constructor(J,Q){this._cleanup=void 0,this._observer=J,this._queue=void 0,this._state="initializing";let Z=new Cc1(this);try{this._cleanup=Q.call(void 0,Z)}catch(X){Z.error(X)}if(this._state==="initializing")this._state="ready"}get closed(){return this._state==="closed"}unsubscribe(){if(this._state!=="closed")$Z1(this),Ic1(this)}}class Cc1{_subscription;constructor(J){this._subscription=J}get closed(){return this._subscription._state==="closed"}next(J){jZ1(this._subscription,"next",J)}error(J){jZ1(this._subscription,"error",J)}complete(){jZ1(this._subscription,"complete")}}function z4(J){if(typeof J==="function")J();else if(J&&typeof J.unsubscribe==="function")J.unsubscribe()}class lR{_baseObserver;_pendingPromises;constructor(J){this._baseObserver=J,this._pendingPromises=new Set}complete(){Promise.all(this._pendingPromises).then(()=>this._baseObserver.complete()).catch((J)=>this._baseObserver.error(J))}error(J){this._baseObserver.error(J)}schedule(J){let Q=Promise.all(this._pendingPromises),Z=[],X=(K)=>Z.push(K),Y=Promise.resolve().then(async()=>{await Q,await J(X),this._pendingPromises.delete(Y);for(let K of Z)this._baseObserver.next(K)}).catch((K)=>{this._pendingPromises.delete(Y),this._baseObserver.error(K)});this._pendingPromises.add(Y)}}function EZ1(J){return J&&typeof J.subscribe==="function"&&typeof J[Symbol.observable]==="function"}function IZ1(J){if(EZ1(J))return J;return t1.of(J)}var t1;var iR=B1(()=>{if(!Symbol.observable)Symbol.observable=Symbol("observable");t1=class t1{_subscriber;constructor(J){if(!(this instanceof t1))throw TypeError("Observable cannot be called as a function");if(typeof J!=="function")throw TypeError("Observable initializer must be a function");this._subscriber=J}subscribe(J,Q,Z){if(typeof J!=="object"||J===null)J={next:J,error:Q,complete:Z};return new Tc1(J,this._subscriber)}pipe(J,...Q){let Z=this;for(let X of[J,...Q])Z=X(Z);return Z}[Symbol.observable](){return this}static from(J){let Q=typeof this==="function"?this:t1;if(J==null)throw TypeError(J+" is not an object");let Z=J[Symbol.observable];if(typeof Z==="function"){let Y=Z.call(J);if(Object(Y)!==Y)throw TypeError(Y+" is not an object");if(Y instanceof t1)return Y;return new Q((K)=>Y.subscribe(K))}let X=J[Symbol.iterator];if(typeof X==="function")return new Q((Y)=>{Ld(()=>{if(Y.closed)return;for(let K of X.call(J))if(Y.next(K),Y.closed)return;Y.complete()})});if(Array.isArray(J))return new Q((Y)=>{Ld(()=>{if(Y.closed)return;for(let K of J)if(Y.next(K),Y.closed)return;Y.complete()})});throw TypeError(J+" is not observable")}static of(...J){return new(typeof this==="function"?this:t1)((Z)=>{Ld(()=>{if(Z.closed)return;for(let X of J)if(Z.next(X),Z.closed)return;Z.complete()})})}static get[Symbol.species](){return this}}});var k8,U4;var Ad=B1(()=>{iR();k8=class k8 extends t1{_observers=new Set;constructor(){super((J)=>{return this._observers.add(J),()=>this._observers.delete(J)})}next(J){for(let Q of this._observers)Q.next(J)}error(J){for(let Q of this._observers)Q.error(J)}complete(){for(let J of this._observers)J.complete()}};U4=class U4 extends k8{currentValue;constructor(J){super();this.currentValue=J}next(J){this.currentValue=J,super.next(J)}subscribe(J,Q,Z){if(typeof J!=="object"||J===null){let X={};if(J)X.next=J;if(Q)X.error=Q;if(Z)X.complete=Z;J=X}return J.next?.(this.currentValue),super.subscribe(J)}getValue(){return this.currentValue}}});var PZ1,eC;var Sc1=B1(()=>{iR();Ad();PZ1=class PZ1 extends Set{subject=new U4(this);add(J){return super.add(J),this.subject.next(this),this}delete(J){let Q=super.delete(J);if(Q)this.subject.next(this);return Q}clear(){super.clear(),this.subject.next(this)}get observable(){return t1.from(this.subject)}dispose(){this.subject.complete()}};eC=class eC extends Map{subject=new U4(this);set(J,Q){return super.set(J,Q),this.subject.next(this),this}delete(J){let Q=super.delete(J);if(Q)this.subject.next(this);return Q}clear(){super.clear(),this.subject.next(this)}get observable(){return t1.from(this.subject)}dispose(){this.subject.complete()}}});function wd(J,Q){if(J===Q)return!0;if(J==null||Q==null||typeof J!=="object"||typeof Q!=="object")return!1;let Z=Array.isArray(J),X=Array.isArray(Q);if(Z!==X)return!1;if(Z&&X)return J.length===Q.length&&J.every((K,G)=>wd(K,Q[G]));let Y=new Set([...Object.keys(J),...Object.keys(Q)]);for(let K of Y)if(!wd(J[K],Q[K]))return!1;return!0}function TZ1(J){return{dispose:J.unsubscribe.bind(J)}}async function q6(J,Q){return new Promise((Z,X)=>{let Y=void 0,K=()=>{Y?.unsubscribe(),X(new DOMException("Aborted","AbortError"))};Q?.addEventListener("abort",K,{once:!0}),Y=J.subscribe({next:(G)=>{Y?.unsubscribe(),Q?.removeEventListener("abort",K),Z(G)},error:(G)=>{Q?.removeEventListener("abort",K),X(G)},complete:()=>{Q?.removeEventListener("abort",K),X("Observable completed without emitting a value")}})})}async function qB(J,Q){return new Promise((Z,X)=>{let Y,K=!1,G=void 0,q=()=>{G?.unsubscribe(),X(new DOMException("Aborted","AbortError"))};Q?.addEventListener("abort",q,{once:!0}),G=J.subscribe({next:(z)=>{Y=z,K=!0},error:(z)=>{Q?.removeEventListener("abort",q),X(z)},complete:()=>{if(Q?.removeEventListener("abort",q),K)Z(Y);else X("Observable completed without emitting a value")}})})}function P7(J){return new t1((Q)=>{J.then((Z)=>{Q.next(Z),Q.complete()}).catch((Z)=>{Q.error(Z)})})}function c6(J){return new t1((Q)=>{let Z=!1,X=new AbortController,Y=X.signal;return(async()=>{try{Y?.throwIfAborted();let G=await J(Y);if(Y?.throwIfAborted(),!Z)Q.next(G),Q.complete()}catch(G){if(!Z)if(Y.aborted)Q.complete();else Q.error(G)}})(),()=>{Z=!0,X.abort()}})}function b0(J){return(Q)=>{return new t1((Z)=>{let X=new lR(Z),Y=0,K=Q.subscribe({complete(){X.complete()},error(G){X.error(G)},next(G){X.schedule(async(q)=>{let z=await J(G,Y);Y++,q(z)})}});return()=>z4(K)})}}function Rd(J){return new t1((Q)=>{let Z=0,X=setInterval(()=>{Q.next(Z++)},J);return()=>clearInterval(X)})}function $N(...J){return new t1((Q)=>{let Z=0,X=J.map((Y)=>Y.subscribe({next:(K)=>Q.next(K),error:(K)=>Q.error(K),complete:()=>{if(Z++,Z===J.length)Q.complete()}}));return()=>{kc1(X)}})}function x9(...J){if(J.length===0)return CZ1;return new t1((Q)=>{let Z=Array(J.length),X=Array(J.length).fill(0),Y=Array(J.length).fill(!1),K=0,G=[],q=new lR(Q);for(let z=0;z<J.length;z++){let U=J[z];G.push(U.subscribe({next(W){Z[z]=W,Y[z]=!0;let F=++X[z];if(Y.every(Boolean))q.schedule(async(H)=>{if(X[z]===F)H([...Z])})},error(W){q.error(W)},complete(){if(K++,K===J.length)q.complete()}}))}return()=>{kc1(G)}})}function M9(J){let Z=J?.shouldCountRefs??!0,X=LF6++,Y=(K,...G)=>{};return(K)=>{let G=new k8,q=null,z=!1,U,W=0;return new t1((F)=>{if(W++,z)Y("new subscriber, emitting buffered value",U),F.next(U);else Y("new subscriber, no buffered value to emit");if(!q)q=K.subscribe({next:(B)=>{z=!0,U=B,G.next(B)},error:(B)=>G.error(B),complete:()=>G.complete()});let H=G.subscribe(F);return()=>{if(W--,H.unsubscribe(),Z&&W===0){if(q)z4(q),q=null;z=!1}}})}}function kc1(J){for(let Q of J)if(Q)z4(Q)}function aR(J){return(Q)=>{return new t1((Z)=>{let X=Q.subscribe({next:(K)=>Z.next(K),error:(K)=>Z.error(K),complete:()=>Z.complete()}),Y=J.subscribe({next:()=>{Z.complete(),X.unsubscribe(),Y.unsubscribe()},error:(K)=>{Z.error(K),X.unsubscribe()}});return()=>{X.unsubscribe(),Y.unsubscribe()}})}}function zW(J){return(Q)=>{return new t1((Z)=>{let X,Y=Q.subscribe({next(K){X=K,Z.next(K)},error(K){Z.error(K)},complete(){Z.complete()}});return()=>{z4(Y),J(X)}})}}function e6(J=wd){return(Q)=>{return new t1((Z)=>{let X=vc1,Y=new lR(Z),K=Q.subscribe({complete(){Y.complete()},error(G){Y.error(G)},next(G){Y.schedule(async(q)=>{if(X===vc1||!J(X,G))X=G,q(G)})}});return()=>z4(K)})}}function EN(J){return AF6(typeof J==="function"?{next:J}:J)}function AF6(J){return(Q)=>new t1((Z)=>{let X=typeof J==="function"?J():J,Y=Q.subscribe({next(K){if(X.next)try{X.next(K)}catch(G){Z.error(G);return}Z.next(K)},error(K){if(X.error)try{X.error(K)}catch(G){Z.error(G);return}Z.error(K)},complete(){if(X.complete)try{X.complete()}catch(K){Z.error(K);return}Z.complete()}});return()=>z4(Y)})}function nR(J){return(Q)=>{return new t1((Z)=>{let X=!1,Y=Q.subscribe({next:(G)=>{X=!0,clearTimeout(K),Z.next(G)},error:(G)=>{clearTimeout(K),Z.error(G)},complete:()=>{clearTimeout(K),Z.complete()}}),K=setTimeout(()=>{if(!X)Y.unsubscribe(),Z.error(new _c1(`Operation timed out after ${J}ms`))},J);return()=>{clearTimeout(K),Y.unsubscribe()}})}}function u2(J){return(Q)=>new t1((Z)=>{let X;try{Z.next(J),X=Q.subscribe({next(Y){Z.next(Y)},error(Y){Z.error(Y)},complete(){Z.complete()}})}catch(Y){Z.error(Y)}return()=>{if(X)z4(X)}})}function IN(J){return(Q)=>new t1((Z)=>{let X=0,Y=Q.subscribe({next(K){if(X<J){if(Z.next(K),X++,X===J)Z.complete(),z4(Y)}},error(K){Z.error(K)},complete(){Z.complete()}});return()=>{z4(Y)}})}function xc1(J){return(Q)=>new t1((Z)=>{let X=0,Y=Q.subscribe({next(K){if(X>=J)Z.next(K);else X++},error(K){Z.error(K)},complete(){Z.complete()}});return()=>{z4(Y)}})}function q8(J){return(Q)=>{return new t1((Z)=>{let X=0,Y=null,K=!1,G=()=>{if(K&&!Y)Z.complete()},q=Q.subscribe({next(z){if(Y)z4(Y),Y=null;let U;try{U=J(z,X++)}catch(W){Z.error(W);return}Y=U.subscribe({next(W){Z.next(W)},error(W){Z.error(W)},complete(){Y=null,G()}})},error(z){Z.error(z)},complete(){K=!0,G()}});return()=>{if(z4(q),Y)z4(Y)}})}}function bc1(J){let Q={last:void 0,isSet:!1},Z=J.subscribe((X)=>{Object.assign(Q,{last:X,isSet:!0})});return{value:Q,observable:J,subscription:Z}}function JG(J){return(Q)=>new t1((Z)=>{let X=null,Y=null,K=!1,G=Q.subscribe({next:(q)=>{if(Y=q,K=!0,X===null)X=setTimeout(()=>{if(K)Z.next(Y),K=!1;X=null},J)},error:(q)=>Z.error(q),complete:()=>{if(X!==null)clearTimeout(X);if(K)Z.next(Y);Z.complete()}});return()=>{if(z4(G),X!==null)clearTimeout(X)}})}function SZ1(J,Q){if(!Q.leading||!Q.trailing)throw Error("leading and trailing must be true");return(Z)=>new t1((X)=>{let Y=0,K=null,G=null,q=!1,z=Z.subscribe({next:(U)=>{let W=Date.now();if(G=U,q=!0,W-Y>=J)X.next(U),Y=W,q=!1;else if(K===null)K=setTimeout(()=>{if(q)X.next(G),Y=Date.now(),q=!1;K=null},J-(W-Y));if(Y===0)X.next(U),Y=W,q=!1},error:(U)=>X.error(U),complete:()=>{if(K!==null)clearTimeout(K);if(q)X.next(G);X.complete()}});return()=>{if(z4(z),K!==null)clearTimeout(K)}})}function JS(...J){return new t1((Q)=>{let Z=0,X=null;function Y(){if(Z>=J.length){Q.complete();return}X=J[Z].subscribe({next:(G)=>Q.next(G),error:(G)=>Q.error(G),complete:()=>{Z++,Y()}})}return Y(),()=>{if(X)z4(X)}})}function QG(J){return(Q)=>new t1((Z)=>{let X=0,Y=!1,K=null,G=Q.subscribe({next(q){try{let z=J(q,X++);if(K)z4(K);K=z.subscribe({next(U){Z.next(U)},error(U){Z.error(U)},complete(){if(K=null,Y&&!K)Z.complete()}})}catch(z){Z.error(z)}},error(q){Z.error(q)},complete(){if(Y=!0,!K)Z.complete()}});return()=>{if(z4(G),K)z4(K)}})}function QS({onSubscribe:J,onUnsubscribe:Q}){return(Z)=>new t1((X)=>{J?.();let Y=Z.subscribe(X);return()=>{z4(Y),Q?.()}})}function UW(J){return(Q)=>t1.from(Q).pipe(q8((Z)=>c6((X)=>J(Z,X))))}function s5(J){return(Q)=>new t1((Z)=>{let X,Y=Q.subscribe({next(K){Z.next(K)},error(K){try{X=J(K).subscribe({next(q){Z.next(q)},error(q){Z.error(q)},complete(){Z.complete()}})}catch(G){Z.error(G)}},complete(){Z.complete()}});return()=>{if(z4(Y),X)z4(X)}})}function T7(J){return(Q)=>{return new t1((Z)=>{let X=Q.subscribe({next(Y){if(J(Y))Z.next(Y)},error(Y){Z.error(Y)},complete(){Z.complete()}});return()=>z4(X)})}}function yc1(J,Q){return(Z)=>{return new t1((X)=>{let Y,K=0,G=new lR(X),q=Z.subscribe({complete(){G.complete()},error(z){G.error(z)},next(z){G.schedule(async(U)=>{Y=await J(K===0?typeof Q>"u"?z:Q:Y,z,K++),U(Y)})}});return()=>z4(q)})}}var CZ1,EY,Jz9,LF6=0,vc1,_c1;var vZ1=B1(()=>{iR();Ad();CZ1=new t1((J)=>{J.complete()}),EY=new t1(()=>{});Jz9=Symbol("noInitialValue");vc1={};_c1=class _c1 extends Error{constructor(J="Timeout has occurred"){super(J);this.name="TimeoutError"}}});function PN(J,Q){return(Z)=>{return t1.from(Z).pipe(q8((X)=>X===o5?t1.of(o5):J(X).pipe(s5((Y)=>t1.of(Y instanceof Error?Y:Error(Y))),u2(o5))),M9(Q))}}function wF6(){return(J)=>t1.from(J).pipe(T7((Q)=>Q!==o5))}async function ZS(J,Q){let Z=await q6(t1.from(J).pipe(wF6()),Q);if(Z instanceof Error)throw Z;return Z}var o5;var fc1=B1(()=>{iR();vZ1();o5=Symbol.for("@@pendingOperation")});var v0=B1(()=>{Sc1();iR();fc1();vZ1();Ad()});var k6=B1(()=>{iC();Ud();mR()});import RF6 from"os";import Od from"path";var zB,TN,UB,WB,hc1,Nz9,Lz9,OF6,jF6;var rR=B1(()=>{zB=RF6.homedir(),{env:TN}=process,UB=TN.XDG_DATA_HOME||(zB?Od.join(zB,".local","share"):void 0),WB=TN.XDG_CONFIG_HOME||(zB?Od.join(zB,".config"):void 0),hc1=TN.XDG_STATE_HOME||(zB?Od.join(zB,".local","state"):void 0),Nz9=TN.XDG_CACHE_HOME||(zB?Od.join(zB,".cache"):void 0),Lz9=TN.XDG_RUNTIME_DIR||void 0,OF6=(TN.XDG_DATA_DIRS||"/usr/local/share/:/usr/share/").split(":");if(UB)OF6.unshift(UB);jF6=(TN.XDG_CONFIG_DIRS||"/etc/xdg").split(":");if(WB)jF6.unshift(WB)});import{promises as $F6}from"node:fs";import*as CN from"node:path";async function gc1(J){try{let Q=await $F6.open(J,"r");try{let Z=Buffer.alloc(128);await Q.read(Z,0,128,0);let X=Z.toString("utf-8").split(`
|
|
3
|
-
`)[0];if(!X?.startsWith("#!"))return{interpreter:null,isValid:!1};let Y=X.slice(2).trim();if(!Y)return{interpreter:null,isValid:!1};let K=Y.split(/\s+/).filter((G)=>G.length>0);if(K[0]?.endsWith("/env")&&K.length>1)return{interpreter:K.slice(1),isValid:!0};return{interpreter:K,isValid:!0}}finally{await Q.close()}}catch{return{interpreter:null,isValid:!1}}}function mc1(J,Q){let Z=(J&73)!==0;if(process.platform==="win32"){let X=CN.extname(Q).toLowerCase();return Z||[".exe",".bat",".cmd",".ps1"].includes(X)}return Z}function uc1(J){return CN.extname(J).toLowerCase()===".md"}function pc1(J){let Q=J.replace(/\\/g,"/"),Z=CN.basename(Q);return CN.basename(Z,CN.extname(Z))}function dc1(J){return/^[a-zA-Z][a-zA-Z0-9_-]*$/.test(J)&&J.length>0}var cc1=()=>{};var nc1={};E6(nc1,{CommandDiscovery:()=>ac1});import*as ic1 from"node:fs";import{promises as jd}from"node:fs";import{homedir as lc1}from"node:os";import*as EX from"node:path";function _Z1(J,Q,Z){return Promise.race([J,new Promise((X,Y)=>setTimeout(()=>Y(Error(`${Z} timed out after ${Q}ms`)),Q))])}class ac1{config;workspaceRoots;watchFactory;debounceMs;changes=new k8;watchers=new Map;debounceTimer;disposed=!1;constructor(J,Q,Z={}){this.config=J,this.workspaceRoots=Q,this.watchFactory=Z.watchFactory??EF6,this.debounceMs=Z.debounceMs??200}get commandChanges(){return this.changes}async discoverCommands(){if(this.disposed)return[];try{let[J,Q]=await Promise.all([this.discoverWorkspaceCommands(),this.discoverGlobalCommands()]),Z=new Map;for(let Y of Q)Z.set(Y.name,Y);for(let Y of J)Z.set(Y.name,Y);let X=Array.from(Z.values());if(u.debug("Discovered commands",{count:X.length,workspace:J.length,global:Q.length}),this.config.enableWatching)await this.setupWatching();return X}catch(J){return u.error("Failed to discover commands",{error:J}),[]}}async discoverWorkspaceCommands(){let J=[];for(let Q of this.workspaceRoots)for(let Z of this.config.workspacePaths){let X=y0.joinPath(Q,Z),Y=await this.discoverCommandsInDirectory(X,"workspace");J.push(...Y)}return J}async discoverGlobalCommands(){let J=[];for(let Q of this.config.globalPaths){let Z=this.resolveGlobalPath(Q),X=$0.file(Z),Y=await this.discoverCommandsInDirectory(X,"global");J.push(...Y)}return J}async discoverCommandsInDirectory(J,Q){try{let Z=J.fsPath;try{await _Z1(jd.access(Z),kZ1,"directory access")}catch{return[]}let Y=(await _Z1(jd.readdir(Z,{withFileTypes:!0}),kZ1,"directory read")).filter((G)=>G.isFile()),K=[];for(let G of Y){let q=EX.join(Z,G.name),z=await this.createCommand(q);if(z)K.push(z)}return u.debug(`Discovered ${K.length} commands in ${Q} directory`,{directory:Z,commands:K.map((G)=>G.name)}),K}catch(Z){return u.warn(`Failed to discover commands in directory: ${J.fsPath}`,{error:Z}),[]}}ignoreCommandName(J){return J.startsWith(".")||J==="README.md"}async createCommand(J){try{let Q=await jd.stat(J),Z=EX.basename(J);if(this.ignoreCommandName(Z))return null;let X=pc1(Z);if(!dc1(X))return u.warn(`Invalid command name: ${X}`,{filePath:J}),null;if(uc1(Z))return this.createMarkdownCommand(J,Q,X);else return this.createExecutableCommand(J,Q,X)}catch(Q){return u.warn(`Failed to process file: ${J}`,{error:Q}),null}}async createMarkdownCommand(J,Q,Z){return{kind:"markdown",name:Z,filePath:J,sourceDirectory:EX.dirname(J),lastModified:Q.mtimeMs,available:!0,unavailableReason:void 0}}async createExecutableCommand(J,Q,Z){let X=EX.basename(J),Y=mc1(Q.mode,X),K=await gc1(J),G=EX.extname(X);if(!Y&&!K.isValid&&!this.isNativeBinary(G))return u.debug(`Skipping non-executable file without shebang: ${J}`),null;let q=Y&&(K.isValid||this.isNativeBinary(G)),z=this.getExecutableUnavailableReason(Y,K.isValid,G);return{kind:"executable",name:Z,filePath:J,sourceDirectory:EX.dirname(J),lastModified:Q.mtimeMs,isExecutable:Y,interpreter:K.interpreter,extension:G,available:q,unavailableReason:z}}isNativeBinary(J){if(process.platform==="win32")return[".exe",".bat",".cmd",".ps1"].includes(J.toLowerCase());return J===""}getExecutableUnavailableReason(J,Q,Z){let X=this.isNativeBinary(Z);if(!J)return"File is not executable (missing execute permissions)";if(!Q&&!X)return"Missing shebang and not a recognized binary type";return}resolveGlobalPath(J){if(J.startsWith("~/"))return EX.join(lc1(),J.slice(2));if(J.startsWith("~/.config/amp/")){let Q=WB||EX.join(lc1(),".config");return EX.join(Q,J.slice(10))}return J}async setupWatching(){if(this.disposed)return;this.stopWatching();let J=new Set;for(let Q of this.workspaceRoots)for(let Z of this.config.workspacePaths){let X=y0.joinPath(Q,Z);J.add(X.fsPath)}for(let Q of this.config.globalPaths){let Z=this.resolveGlobalPath(Q);J.add(Z)}for(let Q of J)await this.watchDirectory(Q)}async watchDirectory(J){try{await _Z1(jd.access(J),kZ1,"watcher access check");try{let Q=this.watchFactory(J,(Z,X)=>{u.debug("Command directory change detected",{directory:J,eventType:Z,filename:X}),this.scheduleRefresh()});Q.on("error",(Z)=>{u.debug("transient file watcher error",{error:Z}),this.scheduleRefresh()}),this.watchers.set(J,Q),u.debug("Started watching command directory",{directory:J})}catch(Q){u.warn("Failed to setup file watcher",{directory:J,error:Q})}}catch(Q){u.debug("Skipping watch for non-existent directory",{directory:J})}}scheduleRefresh(){if(this.disposed)return;if(this.debounceTimer)clearTimeout(this.debounceTimer);this.debounceTimer=setTimeout(async()=>{try{let[J,Q]=await Promise.all([this.discoverWorkspaceCommands(),this.discoverGlobalCommands()]),Z=new Map;for(let Y of Q)Z.set(Y.name,Y);for(let Y of J)Z.set(Y.name,Y);let X=Array.from(Z.values());u.debug("Refreshed commands during file watch",{count:X.length,workspace:J.length,global:Q.length}),this.changes.next(X)}catch(J){u.warn("Failed to refresh commands during file watch",{error:J})}},this.debounceMs)}stopWatching(){try{for(let[J,Q]of this.watchers)try{Q.close(),u.debug("Stopped watching command directory",{directory:J})}catch(Z){u.warn("Failed to close watcher",{directory:J,error:Z})}this.watchers.clear()}finally{if(this.debounceTimer)clearTimeout(this.debounceTimer),this.debounceTimer=void 0}}dispose(){this.disposed=!0;try{this.stopWatching()}catch(J){u.warn("Error during command discovery cleanup",{error:J})}}}var kZ1=5000,EF6=(J,Q)=>ic1.watch(J,Q);var rc1=B1(()=>{k6();v0();rR();G0();cc1()});import{homedir as $d}from"node:os";import SN from"node:path";var oc1,SF6,tc1,vF6,Ed,kF6,sR,FB,bZ1;var WW=B1(()=>{rR();oc1=SN.join($d(),".local/share"),SF6=process.platform==="win32"||process.platform==="darwin"?oc1:UB??oc1,tc1=SN.join($d(),".config"),vF6=process.platform==="win32"||process.platform==="darwin"?tc1:WB??tc1,Ed=SN.join(SF6,"amp"),kF6=SN.join(vF6,"amp"),sR=SN.join(kF6,"tools"),FB=SN.join($d(),".cache","amp"),bZ1=SN.join($d(),".cache","amp","http-debug-logs")});function OQ(J,Q,Z=Q+"s"){return J===1?Q:Z}var JO;var pZ1=B1(()=>{JO={name:"amp",description:"The frontier coding agent, with a highly capable `smart` mode and a fast `free` mode. ",private:!0,displayName:"Amp (Research Preview)",version:"0.0.0-dev",publisher:"sourcegraph",license:"Apache-2.0",categories:["AI","Chat","Programming Languages","Machine Learning"],keywords:["sourcegraph","amp","amp code","ampcode","ai","assistant","llm","Claude","Claude Sonnet 4.5","GPT-5","agent","free","Claude Sonnet"],icon:"./resources/amp-icon.png",scripts:{dev:"pnpm run -s dev:desktop","dev:insiders":"pnpm run -s dev:desktop:insiders","start:dev:desktop":"node scripts/start-dev.js","start:dev:desktop:insiders":"node scripts/start-dev.js --insiders","start:dev:web":"vscode-test-web --extensionDevelopmentPath=. --browserOption=--disable-web-security --verbose --open-devtools --verbose --printServerLog","start:dev:debugger":"pnpm run -s build:dev:desktop && pnpm run -s ./src/autoedit/webview dev","dev:desktop":"pnpm run -s build:dev:desktop && pnpm run start:dev:desktop","dev:desktop:insiders":"pnpm run -s build:dev:desktop && pnpm run start:dev:desktop:insiders","build:dev:desktop":"vite build",build:"pnpm run -s _build:extension && concurrently -n 'debugger,web,review' 'pnpm run -s _build:debugger' 'pnpm run -s _build:web' 'pnpm run -s _build:tab:review'","build:production":"pnpm run -s _build:extension:production && concurrently -n 'debugger,web,review' 'pnpm run -s _build:debugger:production' 'pnpm run -s _build:web:production' 'pnpm run -s _build:tab:review:production'","_build:extension":"vite build","_build:extension:production":"cross-env NODE_ENV=production vite build","_build:web":"pnpm -C ../web run build && cp -R ../web/build dist/web-build","_build:web:production":"pnpm -C ../web run build:production && cp -R ../web/build dist/web-build","_build:debugger":"pnpm -C ./src/autoedit/webview run build && cp -R ./src/autoedit/webview/build dist/autoedit","_build:debugger:production":"cross-env NODE_ENV=production pnpm -C ./src/autoedit/webview run build && cp -R ./src/autoedit/webview/build dist/autoedit","_build:tab:review":"pnpm -C ./src/autoedit/review-panel-webview run build && mkdir -p dist/autoedit && cp -R ./src/autoedit/review-panel-webview/build dist/autoedit/review-panel","_build:tab:review:production":"cross-env NODE_ENV=production pnpm -C ./src/autoedit/review-panel-webview run build && mkdir -p dist/autoedit && cp -R ./src/autoedit/review-panel-webview/build dist/autoedit/review-panel","build:icon-font":"npx -y svgtofont --sources ./icon-font/svg --output ./icon-font/build && cp ./icon-font/build/amp-icons.woff ./resources","dev:forks":"pnpm dev:vsix && cursor --install-extension dist/amp-dev.vsix --force && windsurf --install-extension dist/amp-dev.vsix --force","dev:vsix":"vite build && pnpm run -s _build:web && pnpm run -s _build:debugger && pnpm run -s _build:tab:review && vsce package --no-dependencies --pre-release --out dist/amp-dev.vsix && code --install-extension dist/amp-dev.vsix --force","dev:insiders:vsix":"vite build && pnpm run -s _build:web && pnpm run -s _build:debugger && pnpm run -s _build:tab:review && vsce package --no-dependencies --pre-release --out dist/amp-dev.vsix && code-insiders --install-extension dist/amp-dev.vsix --force",test:"vitest run","test:dev":"vitest"},homepage:"https://ampcode.com",repository:{type:"git",url:"https://github.com/sourcegraph/amp",directory:"vscode"},author:{name:"The Amp Team at Sourcegraph",email:"amp-devs@sourcegraph.com"},engines:{vscode:"^1.79.0",node:">=22.0.0"},main:"./dist/extension.js",activationEvents:["onStartupFinished"],extensionDependencies:["vscode.git"],contributes:{languages:[{id:"jsonc",filenamePatterns:["**/Library/Application Support/ampcode/managed-settings.json","**/etc/ampcode/managed-settings.json","**/ProgramData/ampcode/managed-settings.json"]}],viewsContainers:{activitybar:[{id:"sourcegraph-amp",title:"Amp",icon:"./resources/amp-mark.svg"}]},views:{"sourcegraph-amp":[{type:"webview",id:"amp.sidebarView",name:"Amp",icon:"./resources/amp-mark.svg",visibility:"visible"}]},commands:[{command:"amp.agent.newThread",title:"New Thread",category:"Amp",icon:"$(add)"},{command:"amp.agent.newWindow",title:"New Agent Window",category:"Amp",icon:"$(browser)",enablement:"amp.activated"},{command:"amp.agent.toggleVisibility",title:"Toggle Agent",category:"Amp"},{command:"amp.agent.openReview",title:"Open Amp Review",category:"Amp",icon:"$(compare-changes)",enablement:"amp.activated"},{command:"amp.agent.focusPromptEditor",title:"Focus Prompt Editor",category:"Amp"},{command:"amp.agent.addSelectionToPromptEditor",title:"Add Selection to Prompt",category:"Amp",enablement:"editorHasSelection"},{command:"amp.agent.switchAgentMode",title:"Switch Agent Mode for Current Thread",category:"Amp",enablement:"amp.hasMultipleVisibleModes"},{command:"amp.agent.setPromptFromRecentActions",title:"Create Prompt from Recent Actions",category:"Amp"},{command:"amp.agent.findInThread",title:"Find in Thread",category:"Amp",enablement:"amp.agent.active"},{command:"amp.agent.collapseAllInThread",title:"Collapse All Blocks in Thread",category:"Amp"},{command:"amp.agent.expandAllInThread",title:"Expand All Blocks in Thread",category:"Amp"},{command:"amp.agent.expandToggleInThread",title:"Toggle Expand All Blocks in Thread",category:"Amp"},{command:"amp.agent.toggleThreadSwitcher",title:"Switch to Thread...",category:"Amp",enablement:"amp.agent.active"},{command:"amp.agent.toggleCostDisplay",title:"Toggle Cost Display",category:"Amp"},{command:"amp.agent.navigateThreadPrevious",title:"Navigate to Previous Thread",category:"Amp",enablement:"amp.agent.active && amp.agent.activeView == 'sidebar'"},{command:"amp.agent.navigateThreadNext",title:"Navigate to Next Thread",category:"Amp",enablement:"amp.agent.active && amp.agent.activeView == 'sidebar'"},{command:"amp.openThreadJSON",title:"Open Thread JSON",category:"Amp",enablement:"amp.isDevelopmentMode"},{command:"amp.testThreadSummary",title:"Test Thread Summary",category:"Amp",enablement:"amp.isDevelopmentMode"},{command:"amp.tab.quickPickMenu",title:"Show Tab Menu",category:"Amp",icon:"$(debug)",enablement:"amp.activated"},{command:"amp.tab.showDebugPanel",title:"Show Tab Debug Panel",category:"Amp",icon:"$(debug)",enablement:"amp.activated && config.amp.tab.enabled"},{command:"amp.tab.showDiff",title:"Tab: Show Diff",category:"Amp",icon:"$(diff)",enablement:"amp.activated && config.amp.tab.enabled && config.amp.tab.experimental.review"},{command:"amp.tab.diffPanel.acceptAll",title:"Tab Review: Accept All Changes",category:"Amp",enablement:"amp.activated && config.amp.tab.enabled && config.amp.tab.experimental.review"},{command:"amp.tab.diffPanel.instruct",title:"Tab Review: Open Instruct Mode",category:"Amp",enablement:"amp.activated && config.amp.tab.enabled && config.amp.tab.experimental.review"},{command:"amp.tab.manualTrigger",title:"Tab Manual Trigger",category:"Amp",enablement:"amp.activated && config.amp.tab.enabled"},{command:"amp.tab.enable",title:"Enable Tab",category:"Amp",enablement:"amp.activated && !config.amp.tab.enabled"},{command:"amp.tab.disable",title:"Disable Tab",category:"Amp",enablement:"amp.activated && config.amp.tab.enabled"},{command:"amp.tab.toggleForCurrentDocument",title:"Toggle Tab for Current Document",category:"Amp",enablement:"amp.activated && config.amp.tab.enabled"},{command:"amp.tab.debugInfo",title:"Open Tab Debug Info",category:"Amp",enablement:"amp.activated && config.amp.tab.enabled"},{command:"amp.tab.autoAcceptChain",title:"Accept Suggestion Chain",category:"Amp",enablement:"amp.activated && config.amp.tab.enabled"},{command:"amp.mcp.restartServers",title:"Restart MCP Servers",category:"Amp"},{command:"amp.agent.editUserPermissions",title:"Edit User Permissions",category:"Amp"},{command:"amp.agent.editWorkspacePermissions",title:"Edit Workspace Permissions",category:"Amp"},{command:"amp.commandPalette.show",title:"Show Amp Command Palette",category:"Amp",icon:"$(list-flat)"}],menus:{"editor/context":[{command:"amp.agent.addSelectionToPromptEditor",when:"editorHasSelection",group:"amp@1"}]},keybindings:[{command:"amp.agent.newThread",key:"ctrl+l",mac:"cmd+l",when:"amp.primaryShortcuts"},{command:"amp.agent.newThread",key:"ctrl+alt+j",mac:"cmd+alt+j",when:"!amp.primaryShortcuts"},{command:"amp.agent.newWindow",key:"ctrl+shift+l",mac:"cmd+shift+l"},{command:"amp.agent.toggleVisibility",key:"ctrl+i",mac:"cmd+i",when:"amp.primaryShortcuts"},{command:"amp.agent.toggleVisibility",key:"ctrl+alt+u",mac:"cmd+alt+u",when:"!amp.primaryShortcuts"},{command:"amp.agent.findInThread",key:"ctrl+f",mac:"cmd+f",when:"amp.agent.active"},{command:"amp.agent.toggleThreadSwitcher",key:"ctrl+k",mac:"cmd+k",when:"amp.agent.active"},{command:"amp.agent.toggleCostDisplay",key:"ctrl+d",mac:"cmd+d",when:"amp.agent.active && amp.isSourcegraphTeammate || isWeb"},{command:"amp.agent.navigateThreadPrevious",key:"ctrl+shift+[",mac:"cmd+shift+[",when:"amp.agent.active && amp.agent.activeView == 'sidebar'"},{command:"amp.agent.navigateThreadNext",key:"ctrl+shift+]",mac:"cmd+shift+]",when:"amp.agent.active && amp.agent.activeView == 'sidebar'"},{command:"amp.agent.savePermissions",key:"ctrl+s",mac:"cmd+s",enablement:"editorTextFocus && resourcePath =~ /[\\\\/]amp[\\\\/]permissions-.*\\.sh$/i",when:"editorTextFocus && resourcePath =~ /[\\\\/]amp[\\\\/]permissions-.*\\.sh$/i"},{command:"amp.tab.diffPanel.acceptAll",key:"ctrl+enter",mac:"cmd+enter",when:"activeWebviewPanelId == 'ampTabDiff'"},{command:"amp.tab.diffPanel.instruct",key:"ctrl+i",mac:"cmd+i",when:"activeWebviewPanelId == 'ampTabDiff'"},{command:"amp.agent.openReview",key:"ctrl+;",mac:"cmd+;"},{command:"-extension.vim_tab",key:"tab",when:"editorTextFocus && vim.active && vim.mode != 'Insert' && !inlineEditIsVisible && !inDebugRepl"},{command:"-vscode-neovim.send",key:"tab",when:"neovim.init && (editorTextFocus && neovim.mode != insert && editorLangId not in neovim.editorLangIdExclusions || neovim.recording)"},{command:"amp.tab.accept",key:"tab",when:"editorTextFocus && amp.activated && amp.tab.active && !amp.nextCursorSuggested && !amp.editorHasMultipleLineSelection"},{command:"amp.tab.showDiff",key:"shift+tab",when:"editorTextFocus && amp.activated && config.amp.tab.experimental.review && (amp.tab.active || inlineSuggestionVisible) && !amp.nextCursorSuggested && !amp.editorHasMultipleLineSelection"},{command:"amp.tab.dismiss",key:"escape",when:"editorTextFocus && amp.activated && amp.tab.active && !amp.nextCursorSuggested && !suggestWidgetVisible && !amp.editorHasMultipleLineSelection"},{command:"amp.nextCursor.accept",key:"tab",when:"editorTextFocus && amp.activated && amp.nextCursorSuggested && !amp.editorHasMultipleLineSelection"},{command:"amp.nextCursor.discard",key:"escape",when:"editorTextFocus && amp.activated && amp.nextCursorSuggested && !suggestWidgetVisible && !amp.editorHasMultipleLineSelection"},{command:"amp.tab.autoAcceptChain",key:"alt+shift+tab",when:"editorTextFocus && amp.activated && (amp.tab.active || amp.nextCursorSuggested) && !amp.editorHasMultipleLineSelection"},{command:"amp.autoImport.accept",key:"tab",when:"editorTextFocus && amp.activated && config.amp.tab.enabled && amp.autoImportSuggested && !amp.editorHasMultipleLineSelection"},{command:"amp.autoImport.discard",key:"escape",when:"editorTextFocus && amp.activated && config.amp.tab.enabled && amp.autoImportSuggested && !amp.editorHasMultipleLineSelection"},{command:"amp.commandPalette.show",key:"ctrl+shift+a",mac:"cmd+shift+a",when:"amp.activated"},{command:"amp.agent.switchAgentMode",key:"ctrl+shift+m",mac:"cmd+shift+m",when:"amp.activated && amp.hasMultipleVisibleModes"}],configuration:{type:"object",title:"Amp",properties:{"amp.url":{type:"string",examples:["https://ampcode.com/"],description:"URL to the Amp server, usually https://ampcode.com/",scope:"application"},"amp.notifications.enabled":{type:"boolean",default:!0,description:"Play notification sound when done or blocked",scope:"window"},"amp.mcpServers":{type:"object",description:"Model Context Protocol servers that expose tools",additionalProperties:{type:"object",oneOf:[{properties:{command:{type:"string"},args:{type:"array",items:{type:"string"}},env:{type:"object",additionalProperties:{type:"string"}}},required:["command"]},{properties:{url:{type:"string"},headers:{type:"object",description:"HTTP headers to send with requests to the MCP server",additionalProperties:{type:"string"}},oauth:{type:"object",description:"OAuth 2.0 configuration for MCP server authentication",properties:{clientId:{type:"string",description:"OAuth client ID"},clientSecret:{type:"string",description:"OAuth client secret (optional for public clients)"},authUrl:{type:"string",description:"OAuth authorization endpoint URL"},tokenUrl:{type:"string",description:"OAuth token endpoint URL"},scopes:{type:"array",description:"OAuth scopes to request",items:{type:"string"}},redirectUrl:{type:"string",description:"OAuth redirect URL (defaults to http://localhost:8976/oauth/callback)"}}}},required:["url"]}]}},"amp.mcpTrustedServers":{type:"array",markdownDescription:"MCP server trust decisions. **Security Note:** This setting is only read from user settings, never workspace settings, to prevent malicious repositories from auto-approving MCP servers.",scope:"application",items:{type:"object",properties:{serverName:{type:"string",description:"MCP server name"},specHash:{type:"string",description:"Hash of the server configuration"},allow:{type:"boolean",description:"Whether this server is approved"}},required:["serverName","specHash","allow"]}},"amp.workspaces":{type:"array",markdownDescription:"Workspace-level configuration. This setting is only read from user settings, never workspace settings.",scope:"application",items:{type:"object",properties:{path:{type:"string",description:"Absolute path to the workspace"},allowAllMcpServers:{type:"boolean",description:"Whether to automatically trust all MCP servers in this workspace"}},required:["path"]}},"amp.mcpPermissions":{type:"array",description:"Permissions for Model Context Protocol (MCP) servers. Controls which MCP servers can be used.",items:{type:"object",properties:{matches:{$ref:"https://static.ampcode.com/schemas/permissions.schema.json#/$defs/permissionMatchCondition"},action:{type:"string",enum:["allow","reject"],description:"Whether to allow or reject MCP servers matching the condition"}},required:["matches","action"],additionalProperties:!1},default:[],scope:"application"},"amp.permissions":{$ref:"https://static.ampcode.com/schemas/permissions.schema.json",description:"Entries checked in sequence to configure tool permissions",default:[]},"amp.experimental.promptAutocompleteMode":{type:"string",enum:["disabled","word-based","tab"],enumDescriptions:["Disabled - no prompt autocomplete","Offline word completion from workspace and thread context","AI-powered suggestions via Amp Tab"],default:"disabled",markdownDescription:"**Experimental:** Prompt autocomplete suggestions while typing.",scope:"application"},"amp.experimental.promptAutocomplete.verboseLogging":{type:"boolean",default:!1,markdownDescription:"Enable verbose logging for prompt autocomplete.",scope:"application"},"amp.experimental.tools":{type:"array",description:"Enable experimental tools by name. Available tools: chat_llm",items:{type:"string"},default:[],scope:"application"},"amp.tools.disable":{type:"array",markdownDescription:'Disable specific tools by name. Glob patterns using * are supported\n\nExamples:\n- Disable edit_file: `["builtin:edit_file"]`\n- Disable all playwright tab tools: `["mcp__playwright__browser_tab*"]`',items:{type:"string"},default:[]},"amp.dangerouslyAllowAll":{type:"boolean",description:"If true, never ask for confirmation when running commands",scope:"window",default:!1},"amp.guardedFiles.allowlist":{type:"array",description:"Glob patterns for files that should bypass guarded file protection. Files matching these patterns can be modified without user confirmation.",items:{type:"string"},default:[],scope:"window"},"amp.anthropic.thinking.enabled":{type:"boolean",default:!0,description:"Enable Claude's extended thinking capabilities",scope:"application"},"amp.tools.inactivityTimeout":{type:"number",default:300,minimum:1,maximum:3600,description:"How many seconds of no output to wait before canceling bash commands.",scope:"workspace"},"amp.tools.stopTimeout":{type:"number",default:300,description:"How many seconds to wait before canceling a running tool.",scope:"application"},"amp.terminal.commands.nodeSpawn.loadProfile":{type:"string",enum:["always","never","daily"],default:"always",description:"Before running commands (including MCP servers), whether to load environment variables from the user's profile (.bashrc, .zshrc, .envrc) as visible from the workspace root directory.",scope:"application"},"amp.todos.enabled":{type:"boolean",default:!0,description:"Enable TODOs tracking for managing tasks",scope:"application"},"amp.guidanceFiles.specs":{type:"boolean",default:!1,description:"[Experimental] Read `*.spec.md` files adjacent to `AGENT.md` files that are read",scope:"window"},"amp.security.audit.logMcpConnections":{type:"boolean",default:!1,description:"Enable telemetry logging for remote MCP server connections (for security auditing)",scope:"application"},"amp.hooks":{type:"array",scope:"window",description:"[Experimental] Hooks are event handlers that can react to specific conditions.",items:{type:"object",properties:{compatibilityDate:{type:"string",const:"2025-05-13",default:"2025-05-13",description:"The version of the hook schema that this value was written to conform to"},id:{type:"string",description:"A unique identifier for the hook",examples:["run-vitest-with-env-vars"]},description:{type:"string",description:"A description of the hook"},on:{oneOf:[{type:"object",properties:{event:{type:"string",const:"tool:pre-execute",default:"tool:pre-execute",description:"Trigger when a tool is about to be executed"},tool:{oneOf:[{type:"string",description:"Tool name to match (e.g., 'edit_file')"},{type:"array",items:{type:"string"},description:"Tool names to match"}],description:"Trigger for the given tool name(s)"},"input.contains":{oneOf:[{type:"string",description:"String pattern to match in the tool input"},{type:"array",items:{type:"string"},description:"String patterns to match in the tool input"}],description:"Trigger only when the tool input contains the given literal string or strings"}},required:["event","tool","input.contains"]},{type:"object",properties:{event:{type:"string",const:"tool:post-execute",default:"tool:post-execute",description:"Trigger after a tool has been executed"},tool:{oneOf:[{type:"string",description:"Tool name to match (e.g., 'edit_file')"},{type:"array",items:{type:"string"},description:"Tool names to match"}],description:"Trigger for the given tool name(s)"}},required:["event","tool"]}]},action:{oneOf:[{type:"object",properties:{type:{type:"string",const:"send-user-message",default:"send-user-message",description:"Send a user message to interrupt the agent and cancel the tool call in the `tool:pre-execute` trigger before it starts to run"},message:{type:"string",description:"The text of the message to send"}},required:["type","message"]},{type:"object",properties:{type:{type:"string",const:"redact-tool-input",default:"redact-tool-input",description:"Redact the tool input after execution. Only allowed with `tool:post-execute` event."},redactedInput:{type:"object",description:"The replacement input data to use instead of the original tool input (must be an object)"}},required:["type","redactedInput"]}]},if:{type:"boolean",description:"A condition that determines whether the hook should be executed",default:!0}},required:["compatibilityDate","id","on","action"]},default:[]},"amp.tab.enabled":{type:"boolean",default:!1,description:"Enable Amp Tab",scope:"application"},"amp.tab.verboseLogs":{type:"boolean",default:!1,description:"Enable verbose logging for Amp Tab",scope:"application"},"amp.debugLogs":{type:"boolean",default:!1,description:"Enable debug logging in the Amp output channel",scope:"application"},"amp.tab.disabledLanguages":{type:"array",items:{type:"string"},default:[],examples:["markdown","python"],description:"List of language IDs for which Amp Tab is disabled",scope:"application"},"amp.tab.disableOnComment":{type:"boolean",default:!1,description:"Disable Amp Tab completions on comment lines",scope:"application"},"amp.tab.autoImport.enabled":{type:"boolean",default:!0,description:"Enable auto import in Amp Tab",scope:"application"},"amp.tab.dismissCommandIds":{type:"array",items:{type:"string"},default:["extension.vim_escape","vim.escape","vscode-neovim.escape","vscode-neovim.escapeKey"],description:"Command IDs to run when Escape is pressed to dismiss an Amp Tab suggestion",scope:"application"},"amp.tab.experimental.showHotStreakProgress":{type:"boolean",default:!1,description:"Experimental: Show hot streak progress in image-rendered suggestions",scope:"window"},"amp.tab.experimental.autoAccept.delayMs":{type:"number",default:0,description:"Experimental: Delay in milliseconds before auto-accepting Amp Tab suggestions",scope:"application"},"amp.tab.experimental.unobtrusiveDiffs":{type:"boolean",default:!1,description:"Experimental: Enable unobtrusive diffs mode for Amp Tab suggestions. When enabled, suggestions are shown as image overlays to avoid layout shifts and visual interference with existing code.",scope:"application"},"amp.tab.experimental.review":{type:"boolean",default:!1,description:"Experimental: Enable review mode for Amp Tab. When enabled, adds the ability to review suggestion changes with Shift+Tab shortcut and review panel.",scope:"window"},"amp.tab.diagnosticTracking":{type:"string",enum:["disabled","same_file","multi_file"],default:"multi_file",description:"Enable diagnostic tracking for Amp Tab suggestions. 'disabled' = no tracking, 'same_file' = track diagnostics within the same file, 'multi_file' = track diagnostics across multiple files.",scope:"application"},"amp.tab.hoverDiagnosticSuggestions":{type:"boolean",default:!1,description:"Show suggestions when hovering over diagnostics.",scope:"application"},"amp.tab.experimental.displayMode":{type:"string",enum:["eager","subtle"],default:"eager",description:"Experimental: Control how Amp Tab suggestions are displayed. 'eager' = show diff immediately, 'subtle' = show 'Tab to Jump' first, then show diff after user interaction.",scope:"application"},"amp.tab.experimental.disableClientFilters":{type:"array",items:{type:"string",enum:["recentlyRejectedCodeToRewrite","recentEdits","rewriteAreaOverlap","bigModification","incompatibleWithSelectedCompletionContextItem","recentlyRejectedDiff","whiteSpaceOnlyChange","formattingOnlyChange"]},default:[],description:"Experimental: Disable specific client-side filters to observe unfiltered model behavior.",scope:"application"},"amp.ui.zoomLevel":{type:"number",default:1,description:"Zoom level for the Amp UI",scope:"application"},"amp.experimental.gitblame":{type:"boolean",default:!1,description:"Experimental: Show git blame authors when editing code.",scope:"application"},"amp.git.commit.coauthor.enabled":{type:"boolean",default:!0,description:"Enable adding Amp as co-author in git commits",scope:"window"},"amp.git.commit.ampThread.enabled":{type:"boolean",default:!0,description:"Enable adding Amp-Thread trailer in git commits",scope:"window"},"amp.gpt5":{type:"boolean",default:!1,description:"[DEPRECATED] GPT-5 is no longer available as the main model. It's now the oracle. See https://ampcode.com/news/gpt-5-oracle",scope:"window",deprecationMessage:"GPT-5 is no longer available as the main model. It's now the oracle. See https://ampcode.com/news/gpt-5-oracle"}}},icons:{"amp-agent-file":{description:"Amp agent file",default:{fontPath:"resources/amp-icons.woff",fontCharacter:"\\0041"}}}},capabilities:{untrustedWorkspaces:{supported:"limited",description:"Amp only uses MCP servers from trusted workspaces because they execute code.",restrictedConfigurations:["amp.mcpServers","amp.mcpPermissions","amp.url"]},virtualWorkspaces:{supported:!1,description:"Amp is not supported in virtual workspaces like GitHub.dev because Amp requires local file system access and terminal capabilities."}},dependencies:{"@opentelemetry/api":"^1.9.0","@opentelemetry/api-logs":"^0.57.2","@opentelemetry/core":"^1.30.1","@opentelemetry/exporter-logs-otlp-http":"^0.57.2","@opentelemetry/exporter-metrics-otlp-http":"^0.57.2","@opentelemetry/exporter-trace-otlp-http":"^0.57.2","@opentelemetry/resources":"^1.30.1","@opentelemetry/sdk-logs":"^0.57.2","@opentelemetry/sdk-metrics":"^1.30.1","@opentelemetry/sdk-node":"^0.57.2","@opentelemetry/sdk-trace-base":"^1.30.1","@opentelemetry/sdk-trace-node":"^1.30.1","@opentelemetry/semantic-conventions":"^1.34.0","@sourcegraph/amp-core":"workspace:*","@sourcegraph/amp-uri":"workspace:*","@sourcegraph/observable":"workspace:*","canvaskit-wasm":"^0.40.0","detect-indent":"^7.0.1","fast-json-stable-stringify":"^2.1.0","fast-myers-diff":"^3.2.0","fast-xml-parser":"^5.2.3",isbinaryfile:"^5.0.5","jsonc-parser":"^3.3.1",lodash:"^4.17.21","lru-cache":"^11.1.0","node-fetch":"^3.3.2",shiki:"3.8.1",systeminformation:"^5.27.7",uuid:"^11.1.0","vscode-languageserver-textdocument":"^1.0.12","wink-nlp-utils":"^2.1.0",ws:"^8.18.3"},devDependencies:{"@sourcegraph/amp-web":"workspace:*","@types/jest-image-snapshot":"^6.4.0","@types/lodash":"^4.17.15","@types/node":"catalog:","@types/uuid":"^10.0.0","@types/vscode":"^1.79.0","@types/ws":"^8.18.1","@vscode/test-electron":"^2.4.1","@vscode/test-web":"*","@vscode/vsce":"^3.2.2","cross-env":"^7.0.3","crypto-browserify":"^3.12.1","jest-image-snapshot":"^6.5.0","os-browserify":"^0.3.0","path-browserify":"^1.0.1","rollup-plugin-polyfill-node":"^0.13.0",tsx:"^4.19.4","vite-plugin-static-copy":"^3.0.0"}}});var Fl1="run_terminal_command",Cd="read_file",Hl1="write_file",t5="Task",Bl1="chat_llm",T5="finder",HB="fast_finder",sq="xai_finder",oq="kimiK2_finder",BB="gossip_finder",DB="sonoma_finder",kN="get_diagnostics",i4="Bash",e5="oracle",WS="mermaid",MB="todo_read",JJ="todo_write",tq="read_web_page",Sd="read_thread",Dl1="run_javascript",_J="create_file",VB="glob",Ml1="Glob",vd="undo_edit",kd="read_mcp_resource",t8="Read",jQ="edit_file",_d="format_file",NB="web_search",k4="Grep",FS="Check",eq="librarian",xd="read_github",bd="search_github",yd="commit_search",fd="list_directory_github",hd="list_repositories",gd="glob_github",md="diff",Vl1;var F8=B1(()=>{Vl1=["Task","chat_llm","finder","fast_finder","xai_finder","kimiK2_finder","gossip_finder","sonoma_finder","get_diagnostics","Bash","oracle","mermaid","todo_read","todo_write","read_web_page","run_javascript","create_file","glob","Glob","undo_edit","Read","edit_file","delete_file","format_file","web_search","Grep","search_documents","get_document","Check","code_review","librarian","read_thread"]});var HS=t((wU9,Ll1)=>{var Nl1={DOT_LITERAL:"\\.",PLUS_LITERAL:"\\+",QMARK_LITERAL:"\\?",SLASH_LITERAL:"\\/",ONE_CHAR:"(?=.)",QMARK:"[^/]",END_ANCHOR:"(?:\\/|$)",DOTS_SLASH:"\\.{1,2}(?:\\/|$)",NO_DOT:"(?!\\.)",NO_DOTS:"(?!(?:^|\\/)\\.{1,2}(?:\\/|$))",NO_DOT_SLASH:"(?!\\.{0,1}(?:\\/|$))",NO_DOTS_SLASH:"(?!\\.{1,2}(?:\\/|$))",QMARK_NO_DOT:"[^.\\/]",STAR:"[^/]*?",START_ANCHOR:"(?:^|\\/)",SEP:"/"},sF6={...Nl1,SLASH_LITERAL:"[\\\\/]",QMARK:"[^\\\\/]",STAR:"[^\\\\/]*?",DOTS_SLASH:"\\.{1,2}(?:[\\\\/]|$)",NO_DOT:"(?!\\.)",NO_DOTS:"(?!(?:^|[\\\\/])\\.{1,2}(?:[\\\\/]|$))",NO_DOT_SLASH:"(?!\\.{0,1}(?:[\\\\/]|$))",NO_DOTS_SLASH:"(?!\\.{1,2}(?:[\\\\/]|$))",QMARK_NO_DOT:"[^.\\\\/]",START_ANCHOR:"(?:^|[\\\\/])",END_ANCHOR:"(?:[\\\\/]|$)",SEP:"\\"},oF6={alnum:"a-zA-Z0-9",alpha:"a-zA-Z",ascii:"\\x00-\\x7F",blank:" \\t",cntrl:"\\x00-\\x1F\\x7F",digit:"0-9",graph:"\\x21-\\x7E",lower:"a-z",print:"\\x20-\\x7E ",punct:"\\-!\"#$%&'()\\*+,./:;<=>?@[\\]^_`{|}~",space:" \\t\\r\\n\\v\\f",upper:"A-Z",word:"A-Za-z0-9_",xdigit:"A-Fa-f0-9"};Ll1.exports={MAX_LENGTH:65536,POSIX_REGEX_SOURCE:oF6,REGEX_BACKSLASH:/\\(?![*+?^${}(|)[\]])/g,REGEX_NON_SPECIAL_CHARS:/^[^@![\].,$*+?^{}()|\\/]+/,REGEX_SPECIAL_CHARS:/[-*+?.^${}(|)[\]]/,REGEX_SPECIAL_CHARS_BACKREF:/(\\?)((\W)(\3*))/g,REGEX_SPECIAL_CHARS_GLOBAL:/([-*+?.^${}(|)[\]])/g,REGEX_REMOVE_BACKSLASH:/(?:\[.*?[^\\]\]|\\(?=.))/g,REPLACEMENTS:{__proto__:null,"***":"*","**/**":"**","**/**/**":"**"},CHAR_0:48,CHAR_9:57,CHAR_UPPERCASE_A:65,CHAR_LOWERCASE_A:97,CHAR_UPPERCASE_Z:90,CHAR_LOWERCASE_Z:122,CHAR_LEFT_PARENTHESES:40,CHAR_RIGHT_PARENTHESES:41,CHAR_ASTERISK:42,CHAR_AMPERSAND:38,CHAR_AT:64,CHAR_BACKWARD_SLASH:92,CHAR_CARRIAGE_RETURN:13,CHAR_CIRCUMFLEX_ACCENT:94,CHAR_COLON:58,CHAR_COMMA:44,CHAR_DOT:46,CHAR_DOUBLE_QUOTE:34,CHAR_EQUAL:61,CHAR_EXCLAMATION_MARK:33,CHAR_FORM_FEED:12,CHAR_FORWARD_SLASH:47,CHAR_GRAVE_ACCENT:96,CHAR_HASH:35,CHAR_HYPHEN_MINUS:45,CHAR_LEFT_ANGLE_BRACKET:60,CHAR_LEFT_CURLY_BRACE:123,CHAR_LEFT_SQUARE_BRACKET:91,CHAR_LINE_FEED:10,CHAR_NO_BREAK_SPACE:160,CHAR_PERCENT:37,CHAR_PLUS:43,CHAR_QUESTION_MARK:63,CHAR_RIGHT_ANGLE_BRACKET:62,CHAR_RIGHT_CURLY_BRACE:125,CHAR_RIGHT_SQUARE_BRACKET:93,CHAR_SEMICOLON:59,CHAR_SINGLE_QUOTE:39,CHAR_SPACE:32,CHAR_TAB:9,CHAR_UNDERSCORE:95,CHAR_VERTICAL_LINE:124,CHAR_ZERO_WIDTH_NOBREAK_SPACE:65279,extglobChars(J){return{"!":{type:"negate",open:"(?:(?!(?:",close:`))${J.STAR})`},"?":{type:"qmark",open:"(?:",close:")?"},"+":{type:"plus",open:"(?:",close:")+"},"*":{type:"star",open:"(?:",close:")*"},"@":{type:"at",open:"(?:",close:")"}}},globChars(J){return J===!0?sF6:Nl1}}});var BS=t((ZH6)=>{var{REGEX_BACKSLASH:tF6,REGEX_REMOVE_BACKSLASH:eF6,REGEX_SPECIAL_CHARS:JH6,REGEX_SPECIAL_CHARS_GLOBAL:QH6}=HS();ZH6.isObject=(J)=>J!==null&&typeof J==="object"&&!Array.isArray(J);ZH6.hasRegexChars=(J)=>JH6.test(J);ZH6.isRegexChar=(J)=>J.length===1&&ZH6.hasRegexChars(J);ZH6.escapeRegex=(J)=>J.replace(QH6,"\\$1");ZH6.toPosixSlashes=(J)=>J.replace(tF6,"/");ZH6.isWindows=()=>{if(typeof navigator<"u"&&navigator.platform){let J=navigator.platform.toLowerCase();return J==="win32"||J==="windows"}if(typeof process<"u"&&process.platform)return process.platform==="win32";return!1};ZH6.removeBackslashes=(J)=>{return J.replace(eF6,(Q)=>{return Q==="\\"?"":Q})};ZH6.escapeLast=(J,Q,Z)=>{let X=J.lastIndexOf(Q,Z);if(X===-1)return J;if(J[X-1]==="\\")return ZH6.escapeLast(J,Q,X-1);return`${J.slice(0,X)}\\${J.slice(X)}`};ZH6.removePrefix=(J,Q={})=>{let Z=J;if(Z.startsWith("./"))Z=Z.slice(2),Q.prefix="./";return Z};ZH6.wrapOutput=(J,Q={},Z={})=>{let X=Z.contains?"":"^",Y=Z.contains?"":"$",K=`${X}(?:${J})${Y}`;if(Q.negated===!0)K=`(?:^(?!${K}).*$)`;return K};ZH6.basename=(J,{windows:Q}={})=>{let Z=J.split(Q?/[\\/]/:"/"),X=Z[Z.length-1];if(X==="")return Z[Z.length-2];return X}});var Tl1=t((OU9,Pl1)=>{var Rl1=BS(),{CHAR_ASTERISK:dZ1,CHAR_AT:HH6,CHAR_BACKWARD_SLASH:DS,CHAR_COMMA:BH6,CHAR_DOT:cZ1,CHAR_EXCLAMATION_MARK:lZ1,CHAR_FORWARD_SLASH:Il1,CHAR_LEFT_CURLY_BRACE:iZ1,CHAR_LEFT_PARENTHESES:aZ1,CHAR_LEFT_SQUARE_BRACKET:DH6,CHAR_PLUS:MH6,CHAR_QUESTION_MARK:Ol1,CHAR_RIGHT_CURLY_BRACE:VH6,CHAR_RIGHT_PARENTHESES:jl1,CHAR_RIGHT_SQUARE_BRACKET:NH6}=HS(),$l1=(J)=>{return J===Il1||J===DS},El1=(J)=>{if(J.isPrefix!==!0)J.depth=J.isGlobstar?1/0:1},LH6=(J,Q)=>{let Z=Q||{},X=J.length-1,Y=Z.parts===!0||Z.scanToEnd===!0,K=[],G=[],q=[],z=J,U=-1,W=0,F=0,H=!1,B=!1,M=!1,V=!1,N=!1,L=!1,A=!1,w=!1,R=!1,O=!1,$=0,j,E,I={value:"",depth:0,isGlob:!1},T=()=>U>=X,S=()=>z.charCodeAt(U+1),_=()=>{return j=E,z.charCodeAt(++U)};while(U<X){E=_();let g;if(E===DS){if(A=I.backslashes=!0,E=_(),E===iZ1)L=!0;continue}if(L===!0||E===iZ1){$++;while(T()!==!0&&(E=_())){if(E===DS){A=I.backslashes=!0,_();continue}if(E===iZ1){$++;continue}if(L!==!0&&E===cZ1&&(E=_())===cZ1){if(H=I.isBrace=!0,M=I.isGlob=!0,O=!0,Y===!0)continue;break}if(L!==!0&&E===BH6){if(H=I.isBrace=!0,M=I.isGlob=!0,O=!0,Y===!0)continue;break}if(E===VH6){if($--,$===0){L=!1,H=I.isBrace=!0,O=!0;break}}}if(Y===!0)continue;break}if(E===Il1){if(K.push(U),G.push(I),I={value:"",depth:0,isGlob:!1},O===!0)continue;if(j===cZ1&&U===W+1){W+=2;continue}F=U+1;continue}if(Z.noext!==!0){if((E===MH6||E===HH6||E===dZ1||E===Ol1||E===lZ1)===!0&&S()===aZ1){if(M=I.isGlob=!0,V=I.isExtglob=!0,O=!0,E===lZ1&&U===W)R=!0;if(Y===!0){while(T()!==!0&&(E=_())){if(E===DS){A=I.backslashes=!0,E=_();continue}if(E===jl1){M=I.isGlob=!0,O=!0;break}}continue}break}}if(E===dZ1){if(j===dZ1)N=I.isGlobstar=!0;if(M=I.isGlob=!0,O=!0,Y===!0)continue;break}if(E===Ol1){if(M=I.isGlob=!0,O=!0,Y===!0)continue;break}if(E===DH6){while(T()!==!0&&(g=_())){if(g===DS){A=I.backslashes=!0,_();continue}if(g===NH6){B=I.isBracket=!0,M=I.isGlob=!0,O=!0;break}}if(Y===!0)continue;break}if(Z.nonegate!==!0&&E===lZ1&&U===W){w=I.negated=!0,W++;continue}if(Z.noparen!==!0&&E===aZ1){if(M=I.isGlob=!0,Y===!0){while(T()!==!0&&(E=_())){if(E===aZ1){A=I.backslashes=!0,E=_();continue}if(E===jl1){O=!0;break}}continue}break}if(M===!0){if(O=!0,Y===!0)continue;break}}if(Z.noext===!0)V=!1,M=!1;let h=z,v="",x="";if(W>0)v=z.slice(0,W),z=z.slice(W),F-=W;if(h&&M===!0&&F>0)h=z.slice(0,F),x=z.slice(F);else if(M===!0)h="",x=z;else h=z;if(h&&h!==""&&h!=="/"&&h!==z){if($l1(h.charCodeAt(h.length-1)))h=h.slice(0,-1)}if(Z.unescape===!0){if(x)x=Rl1.removeBackslashes(x);if(h&&A===!0)h=Rl1.removeBackslashes(h)}let y={prefix:v,input:J,start:W,base:h,glob:x,isBrace:H,isBracket:B,isGlob:M,isExtglob:V,isGlobstar:N,negated:w,negatedExtglob:R};if(Z.tokens===!0){if(y.maxDepth=0,!$l1(E))G.push(I);y.tokens=G}if(Z.parts===!0||Z.tokens===!0){let g;for(let k=0;k<K.length;k++){let f=g?g+1:W,b=K[k],m=J.slice(f,b);if(Z.tokens){if(k===0&&W!==0)G[k].isPrefix=!0,G[k].value=v;else G[k].value=m;El1(G[k]),y.maxDepth+=G[k].depth}if(k!==0||m!=="")q.push(m);g=b}if(g&&g+1<J.length){let k=J.slice(g+1);if(q.push(k),Z.tokens)G[G.length-1].value=k,El1(G[G.length-1]),y.maxDepth+=G[G.length-1].depth}y.slashes=K,y.parts=q}return y};Pl1.exports=LH6});var vl1=t((jU9,Sl1)=>{var ud=HS(),Jz=BS(),{MAX_LENGTH:pd,POSIX_REGEX_SOURCE:AH6,REGEX_NON_SPECIAL_CHARS:wH6,REGEX_SPECIAL_CHARS_BACKREF:RH6,REPLACEMENTS:Cl1}=ud,OH6=(J,Q)=>{if(typeof Q.expandRange==="function")return Q.expandRange(...J,Q);J.sort();let Z=`[${J.join("-")}]`;try{new RegExp(Z)}catch(X){return J.map((Y)=>Jz.escapeRegex(Y)).join("..")}return Z},QO=(J,Q)=>{return`Missing ${J}: "${Q}" - use "\\\\${Q}" to match literal characters`},nZ1=(J,Q)=>{if(typeof J!=="string")throw TypeError("Expected a string");J=Cl1[J]||J;let Z={...Q},X=typeof Z.maxLength==="number"?Math.min(pd,Z.maxLength):pd,Y=J.length;if(Y>X)throw SyntaxError(`Input length: ${Y}, exceeds maximum allowed length: ${X}`);let K={type:"bos",value:"",output:Z.prepend||""},G=[K],q=Z.capture?"":"?:",z=ud.globChars(Z.windows),U=ud.extglobChars(z),{DOT_LITERAL:W,PLUS_LITERAL:F,SLASH_LITERAL:H,ONE_CHAR:B,DOTS_SLASH:M,NO_DOT:V,NO_DOT_SLASH:N,NO_DOTS_SLASH:L,QMARK:A,QMARK_NO_DOT:w,STAR:R,START_ANCHOR:O}=z,$=(F1)=>{return`(${q}(?:(?!${O}${F1.dot?M:W}).)*?)`},j=Z.dot?"":V,E=Z.dot?A:w,I=Z.bash===!0?$(Z):R;if(Z.capture)I=`(${I})`;if(typeof Z.noext==="boolean")Z.noextglob=Z.noext;let T={input:J,index:-1,start:0,dot:Z.dot===!0,consumed:"",output:"",prefix:"",backtrack:!1,negated:!1,brackets:0,braces:0,parens:0,quotes:0,globstar:!1,tokens:G};J=Jz.removePrefix(J,T),Y=J.length;let S=[],_=[],h=[],v=K,x,y=()=>T.index===Y-1,g=T.peek=(F1=1)=>J[T.index+F1],k=T.advance=()=>J[++T.index]||"",f=()=>J.slice(T.index+1),b=(F1="",l=0)=>{T.consumed+=F1,T.index+=l},m=(F1)=>{T.output+=F1.output!=null?F1.output:F1.value,b(F1.value)},a=()=>{let F1=1;while(g()==="!"&&(g(2)!=="("||g(3)==="?"))k(),T.start++,F1++;if(F1%2===0)return!1;return T.negated=!0,T.start++,!0},p=(F1)=>{T[F1]++,h.push(F1)},e=(F1)=>{T[F1]--,h.pop()},G1=(F1)=>{if(v.type==="globstar"){let l=T.braces>0&&(F1.type==="comma"||F1.type==="brace"),d=F1.extglob===!0||S.length&&(F1.type==="pipe"||F1.type==="paren");if(F1.type!=="slash"&&F1.type!=="paren"&&!l&&!d)T.output=T.output.slice(0,-v.output.length),v.type="star",v.value="*",v.output=I,T.output+=v.output}if(S.length&&F1.type!=="paren")S[S.length-1].inner+=F1.value;if(F1.value||F1.output)m(F1);if(v&&v.type==="text"&&F1.type==="text"){v.output=(v.output||v.value)+F1.value,v.value+=F1.value;return}F1.prev=v,G.push(F1),v=F1},W1=(F1,l)=>{let d={...U[l],conditions:1,inner:""};d.prev=v,d.parens=T.parens,d.output=T.output;let i=(Z.capture?"(":"")+d.open;p("parens"),G1({type:F1,value:l,output:T.output?"":B}),G1({type:"paren",extglob:!0,value:k(),output:i}),S.push(d)},Z1=(F1)=>{let l=F1.close+(Z.capture?")":""),d;if(F1.type==="negate"){let i=I;if(F1.inner&&F1.inner.length>1&&F1.inner.includes("/"))i=$(Z);if(i!==I||y()||/^\)+$/.test(f()))l=F1.close=`)$))${i}`;if(F1.inner.includes("*")&&(d=f())&&/^\.[^\\/.]+$/.test(d)){let n=nZ1(d,{...Q,fastpaths:!1}).output;l=F1.close=`)${n})${i})`}if(F1.prev.type==="bos")T.negatedExtglob=!0}G1({type:"paren",extglob:!0,value:x,output:l}),e("parens")};if(Z.fastpaths!==!1&&!/(^[*!]|[/()[\]{}"])/.test(J)){let F1=!1,l=J.replace(RH6,(d,i,n,s,Y1,J1)=>{if(s==="\\")return F1=!0,d;if(s==="?"){if(i)return i+s+(Y1?A.repeat(Y1.length):"");if(J1===0)return E+(Y1?A.repeat(Y1.length):"");return A.repeat(n.length)}if(s===".")return W.repeat(n.length);if(s==="*"){if(i)return i+s+(Y1?I:"");return I}return i?d:`\\${d}`});if(F1===!0)if(Z.unescape===!0)l=l.replace(/\\/g,"");else l=l.replace(/\\+/g,(d)=>{return d.length%2===0?"\\\\":d?"\\":""});if(l===J&&Z.contains===!0)return T.output=J,T;return T.output=Jz.wrapOutput(l,T,Q),T}while(!y()){if(x=k(),x==="\x00")continue;if(x==="\\"){let d=g();if(d==="/"&&Z.bash!==!0)continue;if(d==="."||d===";")continue;if(!d){x+="\\",G1({type:"text",value:x});continue}let i=/^\\+/.exec(f()),n=0;if(i&&i[0].length>2){if(n=i[0].length,T.index+=n,n%2!==0)x+="\\"}if(Z.unescape===!0)x=k();else x+=k();if(T.brackets===0){G1({type:"text",value:x});continue}}if(T.brackets>0&&(x!=="]"||v.value==="["||v.value==="[^")){if(Z.posix!==!1&&x===":"){let d=v.value.slice(1);if(d.includes("[")){if(v.posix=!0,d.includes(":")){let i=v.value.lastIndexOf("["),n=v.value.slice(0,i),s=v.value.slice(i+2),Y1=AH6[s];if(Y1){if(v.value=n+Y1,T.backtrack=!0,k(),!K.output&&G.indexOf(v)===1)K.output=B;continue}}}}if(x==="["&&g()!==":"||x==="-"&&g()==="]")x=`\\${x}`;if(x==="]"&&(v.value==="["||v.value==="[^"))x=`\\${x}`;if(Z.posix===!0&&x==="!"&&v.value==="[")x="^";v.value+=x,m({value:x});continue}if(T.quotes===1&&x!=='"'){x=Jz.escapeRegex(x),v.value+=x,m({value:x});continue}if(x==='"'){if(T.quotes=T.quotes===1?0:1,Z.keepQuotes===!0)G1({type:"text",value:x});continue}if(x==="("){p("parens"),G1({type:"paren",value:x});continue}if(x===")"){if(T.parens===0&&Z.strictBrackets===!0)throw SyntaxError(QO("opening","("));let d=S[S.length-1];if(d&&T.parens===d.parens+1){Z1(S.pop());continue}G1({type:"paren",value:x,output:T.parens?")":"\\)"}),e("parens");continue}if(x==="["){if(Z.nobracket===!0||!f().includes("]")){if(Z.nobracket!==!0&&Z.strictBrackets===!0)throw SyntaxError(QO("closing","]"));x=`\\${x}`}else p("brackets");G1({type:"bracket",value:x});continue}if(x==="]"){if(Z.nobracket===!0||v&&v.type==="bracket"&&v.value.length===1){G1({type:"text",value:x,output:`\\${x}`});continue}if(T.brackets===0){if(Z.strictBrackets===!0)throw SyntaxError(QO("opening","["));G1({type:"text",value:x,output:`\\${x}`});continue}e("brackets");let d=v.value.slice(1);if(v.posix!==!0&&d[0]==="^"&&!d.includes("/"))x=`/${x}`;if(v.value+=x,m({value:x}),Z.literalBrackets===!1||Jz.hasRegexChars(d))continue;let i=Jz.escapeRegex(v.value);if(T.output=T.output.slice(0,-v.value.length),Z.literalBrackets===!0){T.output+=i,v.value=i;continue}v.value=`(${q}${i}|${v.value})`,T.output+=v.value;continue}if(x==="{"&&Z.nobrace!==!0){p("braces");let d={type:"brace",value:x,output:"(",outputIndex:T.output.length,tokensIndex:T.tokens.length};_.push(d),G1(d);continue}if(x==="}"){let d=_[_.length-1];if(Z.nobrace===!0||!d){G1({type:"text",value:x,output:x});continue}let i=")";if(d.dots===!0){let n=G.slice(),s=[];for(let Y1=n.length-1;Y1>=0;Y1--){if(G.pop(),n[Y1].type==="brace")break;if(n[Y1].type!=="dots")s.unshift(n[Y1].value)}i=OH6(s,Z),T.backtrack=!0}if(d.comma!==!0&&d.dots!==!0){let n=T.output.slice(0,d.outputIndex),s=T.tokens.slice(d.tokensIndex);d.value=d.output="\\{",x=i="\\}",T.output=n;for(let Y1 of s)T.output+=Y1.output||Y1.value}G1({type:"brace",value:x,output:i}),e("braces"),_.pop();continue}if(x==="|"){if(S.length>0)S[S.length-1].conditions++;G1({type:"text",value:x});continue}if(x===","){let d=x,i=_[_.length-1];if(i&&h[h.length-1]==="braces")i.comma=!0,d="|";G1({type:"comma",value:x,output:d});continue}if(x==="/"){if(v.type==="dot"&&T.index===T.start+1){T.start=T.index+1,T.consumed="",T.output="",G.pop(),v=K;continue}G1({type:"slash",value:x,output:H});continue}if(x==="."){if(T.braces>0&&v.type==="dot"){if(v.value===".")v.output=W;let d=_[_.length-1];v.type="dots",v.output+=x,v.value+=x,d.dots=!0;continue}if(T.braces+T.parens===0&&v.type!=="bos"&&v.type!=="slash"){G1({type:"text",value:x,output:W});continue}G1({type:"dot",value:x,output:W});continue}if(x==="?"){if(!(v&&v.value==="(")&&Z.noextglob!==!0&&g()==="("&&g(2)!=="?"){W1("qmark",x);continue}if(v&&v.type==="paren"){let i=g(),n=x;if(v.value==="("&&!/[!=<:]/.test(i)||i==="<"&&!/<([!=]|\w+>)/.test(f()))n=`\\${x}`;G1({type:"text",value:x,output:n});continue}if(Z.dot!==!0&&(v.type==="slash"||v.type==="bos")){G1({type:"qmark",value:x,output:w});continue}G1({type:"qmark",value:x,output:A});continue}if(x==="!"){if(Z.noextglob!==!0&&g()==="("){if(g(2)!=="?"||!/[!=<:]/.test(g(3))){W1("negate",x);continue}}if(Z.nonegate!==!0&&T.index===0){a();continue}}if(x==="+"){if(Z.noextglob!==!0&&g()==="("&&g(2)!=="?"){W1("plus",x);continue}if(v&&v.value==="("||Z.regex===!1){G1({type:"plus",value:x,output:F});continue}if(v&&(v.type==="bracket"||v.type==="paren"||v.type==="brace")||T.parens>0){G1({type:"plus",value:x});continue}G1({type:"plus",value:F});continue}if(x==="@"){if(Z.noextglob!==!0&&g()==="("&&g(2)!=="?"){G1({type:"at",extglob:!0,value:x,output:""});continue}G1({type:"text",value:x});continue}if(x!=="*"){if(x==="$"||x==="^")x=`\\${x}`;let d=wH6.exec(f());if(d)x+=d[0],T.index+=d[0].length;G1({type:"text",value:x});continue}if(v&&(v.type==="globstar"||v.star===!0)){v.type="star",v.star=!0,v.value+=x,v.output=I,T.backtrack=!0,T.globstar=!0,b(x);continue}let F1=f();if(Z.noextglob!==!0&&/^\([^?]/.test(F1)){W1("star",x);continue}if(v.type==="star"){if(Z.noglobstar===!0){b(x);continue}let d=v.prev,i=d.prev,n=d.type==="slash"||d.type==="bos",s=i&&(i.type==="star"||i.type==="globstar");if(Z.bash===!0&&(!n||F1[0]&&F1[0]!=="/")){G1({type:"star",value:x,output:""});continue}let Y1=T.braces>0&&(d.type==="comma"||d.type==="brace"),J1=S.length&&(d.type==="pipe"||d.type==="paren");if(!n&&d.type!=="paren"&&!Y1&&!J1){G1({type:"star",value:x,output:""});continue}while(F1.slice(0,3)==="/**"){let H1=J[T.index+4];if(H1&&H1!=="/")break;F1=F1.slice(3),b("/**",3)}if(d.type==="bos"&&y()){v.type="globstar",v.value+=x,v.output=$(Z),T.output=v.output,T.globstar=!0,b(x);continue}if(d.type==="slash"&&d.prev.type!=="bos"&&!s&&y()){T.output=T.output.slice(0,-(d.output+v.output).length),d.output=`(?:${d.output}`,v.type="globstar",v.output=$(Z)+(Z.strictSlashes?")":"|$)"),v.value+=x,T.globstar=!0,T.output+=d.output+v.output,b(x);continue}if(d.type==="slash"&&d.prev.type!=="bos"&&F1[0]==="/"){let H1=F1[1]!==void 0?"|$":"";T.output=T.output.slice(0,-(d.output+v.output).length),d.output=`(?:${d.output}`,v.type="globstar",v.output=`${$(Z)}${H}|${H}${H1})`,v.value+=x,T.output+=d.output+v.output,T.globstar=!0,b(x+k()),G1({type:"slash",value:"/",output:""});continue}if(d.type==="bos"&&F1[0]==="/"){v.type="globstar",v.value+=x,v.output=`(?:^|${H}|${$(Z)}${H})`,T.output=v.output,T.globstar=!0,b(x+k()),G1({type:"slash",value:"/",output:""});continue}T.output=T.output.slice(0,-v.output.length),v.type="globstar",v.output=$(Z),v.value+=x,T.output+=v.output,T.globstar=!0,b(x);continue}let l={type:"star",value:x,output:I};if(Z.bash===!0){if(l.output=".*?",v.type==="bos"||v.type==="slash")l.output=j+l.output;G1(l);continue}if(v&&(v.type==="bracket"||v.type==="paren")&&Z.regex===!0){l.output=x,G1(l);continue}if(T.index===T.start||v.type==="slash"||v.type==="dot"){if(v.type==="dot")T.output+=N,v.output+=N;else if(Z.dot===!0)T.output+=L,v.output+=L;else T.output+=j,v.output+=j;if(g()!=="*")T.output+=B,v.output+=B}G1(l)}while(T.brackets>0){if(Z.strictBrackets===!0)throw SyntaxError(QO("closing","]"));T.output=Jz.escapeLast(T.output,"["),e("brackets")}while(T.parens>0){if(Z.strictBrackets===!0)throw SyntaxError(QO("closing",")"));T.output=Jz.escapeLast(T.output,"("),e("parens")}while(T.braces>0){if(Z.strictBrackets===!0)throw SyntaxError(QO("closing","}"));T.output=Jz.escapeLast(T.output,"{"),e("braces")}if(Z.strictSlashes!==!0&&(v.type==="star"||v.type==="bracket"))G1({type:"maybe_slash",value:"",output:`${H}?`});if(T.backtrack===!0){T.output="";for(let F1 of T.tokens)if(T.output+=F1.output!=null?F1.output:F1.value,F1.suffix)T.output+=F1.suffix}return T};nZ1.fastpaths=(J,Q)=>{let Z={...Q},X=typeof Z.maxLength==="number"?Math.min(pd,Z.maxLength):pd,Y=J.length;if(Y>X)throw SyntaxError(`Input length: ${Y}, exceeds maximum allowed length: ${X}`);J=Cl1[J]||J;let{DOT_LITERAL:K,SLASH_LITERAL:G,ONE_CHAR:q,DOTS_SLASH:z,NO_DOT:U,NO_DOTS:W,NO_DOTS_SLASH:F,STAR:H,START_ANCHOR:B}=ud.globChars(Z.windows),M=Z.dot?W:U,V=Z.dot?F:U,N=Z.capture?"":"?:",L={negated:!1,prefix:""},A=Z.bash===!0?".*?":H;if(Z.capture)A=`(${A})`;let w=(j)=>{if(j.noglobstar===!0)return A;return`(${N}(?:(?!${B}${j.dot?z:K}).)*?)`},R=(j)=>{switch(j){case"*":return`${M}${q}${A}`;case".*":return`${K}${q}${A}`;case"*.*":return`${M}${A}${K}${q}${A}`;case"*/*":return`${M}${A}${G}${q}${V}${A}`;case"**":return M+w(Z);case"**/*":return`(?:${M}${w(Z)}${G})?${V}${q}${A}`;case"**/*.*":return`(?:${M}${w(Z)}${G})?${V}${A}${K}${q}${A}`;case"**/.*":return`(?:${M}${w(Z)}${G})?${K}${q}${A}`;default:{let E=/^(.*?)\.(\w+)$/.exec(j);if(!E)return;let I=R(E[1]);if(!I)return;return I+K+E[2]}}},O=Jz.removePrefix(J,L),$=R(O);if($&&Z.strictSlashes!==!0)$+=`${G}?`;return $};Sl1.exports=nZ1});var MS=t(($U9,_l1)=>{var jH6=Tl1(),rZ1=vl1(),kl1=BS(),$H6=HS(),EH6=(J)=>J&&typeof J==="object"&&!Array.isArray(J),F7=(J,Q,Z=!1)=>{if(Array.isArray(J)){let W=J.map((H)=>F7(H,Q,Z));return(H)=>{for(let B of W){let M=B(H);if(M)return M}return!1}}let X=EH6(J)&&J.tokens&&J.input;if(J===""||typeof J!=="string"&&!X)throw TypeError("Expected pattern to be a non-empty string");let Y=Q||{},K=Y.windows,G=X?F7.compileRe(J,Q):F7.makeRe(J,Q,!1,!0),q=G.state;delete G.state;let z=()=>!1;if(Y.ignore){let W={...Q,ignore:null,onMatch:null,onResult:null};z=F7(Y.ignore,W,Z)}let U=(W,F=!1)=>{let{isMatch:H,match:B,output:M}=F7.test(W,G,Q,{glob:J,posix:K}),V={glob:J,state:q,regex:G,posix:K,input:W,output:M,match:B,isMatch:H};if(typeof Y.onResult==="function")Y.onResult(V);if(H===!1)return V.isMatch=!1,F?V:!1;if(z(W)){if(typeof Y.onIgnore==="function")Y.onIgnore(V);return V.isMatch=!1,F?V:!1}if(typeof Y.onMatch==="function")Y.onMatch(V);return F?V:!0};if(Z)U.state=q;return U};F7.test=(J,Q,Z,{glob:X,posix:Y}={})=>{if(typeof J!=="string")throw TypeError("Expected input to be a string");if(J==="")return{isMatch:!1,output:""};let K=Z||{},G=K.format||(Y?kl1.toPosixSlashes:null),q=J===X,z=q&&G?G(J):J;if(q===!1)z=G?G(J):J,q=z===X;if(q===!1||K.capture===!0)if(K.matchBase===!0||K.basename===!0)q=F7.matchBase(J,Q,Z,Y);else q=Q.exec(z);return{isMatch:Boolean(q),match:q,output:z}};F7.matchBase=(J,Q,Z)=>{return(Q instanceof RegExp?Q:F7.makeRe(Q,Z)).test(kl1.basename(J))};F7.isMatch=(J,Q,Z)=>F7(Q,Z)(J);F7.parse=(J,Q)=>{if(Array.isArray(J))return J.map((Z)=>F7.parse(Z,Q));return rZ1(J,{...Q,fastpaths:!1})};F7.scan=(J,Q)=>jH6(J,Q);F7.compileRe=(J,Q,Z=!1,X=!1)=>{if(Z===!0)return J.output;let Y=Q||{},K=Y.contains?"":"^",G=Y.contains?"":"$",q=`${K}(?:${J.output})${G}`;if(J&&J.negated===!0)q=`^(?!${q}).*$`;let z=F7.toRegex(q,Q);if(X===!0)z.state=J;return z};F7.makeRe=(J,Q={},Z=!1,X=!1)=>{if(!J||typeof J!=="string")throw TypeError("Expected a non-empty string");let Y={negated:!1,fastpaths:!0};if(Q.fastpaths!==!1&&(J[0]==="."||J[0]==="*"))Y.output=rZ1.fastpaths(J,Q);if(!Y.output)Y=rZ1(J,Q);return F7.compileRe(Y,Q,Z,X)};F7.toRegex=(J,Q)=>{try{let Z=Q||{};return new RegExp(J,Z.flags||(Z.nocase?"i":""))}catch(Z){if(Q&&Q.debug===!0)throw Z;return/$^/}};F7.constants=$H6;_l1.exports=F7});var _N=t((EU9,yl1)=>{var xl1=MS(),IH6=BS();function bl1(J,Q,Z=!1){if(Q&&(Q.windows===null||Q.windows===void 0))Q={...Q,windows:IH6.isWindows()};return xl1(J,Q,Z)}Object.assign(bl1,xl1);yl1.exports=bl1});function dd(J){if(!J)return null;let Z=ld(J)?.toolAllowlist;if(!Z)return null;let X=Object.entries(VS).find(([K,G])=>G.includes(J))?.[0],Y=gl1.filter((K)=>K!==X).map((K)=>`!${K}`);if(X&&X!=="finder")Y.push("!finder");return[...Z,...Y]}function cd(J,Q){let Z=!1;for(let X of Q){if(X==="")continue;if(X.startsWith("!")){let Y=X.slice(1);if(fl1(J,Y))return!1;continue}if(fl1(J,X))Z=!0}return Z}function fl1(J,Q){if(Q==="")return!1;if(Q.length===1){if(Q==="*")return!0;return!1}if(J===Q)return!0;if(Q.includes("*")||Q.includes("?")||Q.includes("[")||Q.includes("{"))try{return hl1.default(Q,{dot:!0})(J)}catch(Z){return!1}return!1}var hl1;var sZ1=B1(()=>{q2();hl1=d6(_N(),1)});function f8(J){let Q=p2[J];return`${Q.provider}/${Q.name}`}function PX(J){let[Q,Z]=J.split("/");for(let X of Object.values(p2))if(X.provider===Q&&X.name===Z)return X;switch(Q){case"anthropic":return p2.CLAUDE_SONNET_4_5;case"openai":return p2.GPT_5;case"xai":return p2.GROK_CODE_FAST_1;case"cerebras":return p2.QWEN_3_CODER_480B;case"moonshotai":return p2.KIMI_K2_INSTRUCT;case"openrouter":return p2.SONOMA_SKY_ALPHA;case"supernova":return p2.CODE_SUPERNOVA;case"groq":return p2.GPT_OSS_120B;default:throw Error(`Unknown provider: ${Q}`)}}function ZO(J){let[,Q]=J.split("/");return Q||J}function ZG(J){let Q=PX(J);return Q.contextWindow-Q.maxOutputTokens}function DZ(J){let Q=J?.["internal.visibleModes"]??[];return Object.values(xN).filter((Z)=>{if(Q.includes(`!${Z.key}`))return!1;let Y="visible"in Z?Z.visible:!1,K=Q.includes(Z.key);return Y||K}).map((Z)=>({mode:Z.key,description:"description"in Z?Z.description:void 0})).sort((Z,X)=>Z.mode.localeCompare(X.mode))}function ld(J){return Object.values(xN).find((Q)=>Q.key===J)}function ml1(J){return ld(J)?.primaryModel??f8("CLAUDE_SONNET_4_5")}function ad(J){let Q=ld(J);if(!Q)return!1;return PX(Q.primaryModel).capabilities?.vision??!1}function NS(J,Q){return Q.find((Z)=>Z.mode===J)?.description}function nd(J,Q){let X=(Q.findIndex((K)=>K.mode===J)+1)%Q.length;return Q[X]?.mode??"smart"}var S2,p2,xN,id,VS,gl1;var q2=B1(()=>{S2={ANTHROPIC:"anthropic",OPENAI:"openai",XAI:"xai",CEREBRAS:"cerebras",GROQ:"groq",MOONSHOT:"moonshotai",OPENROUTER:"openrouter",VERTEXAI:"vertexai",SUPERNOVA:"supernova"},p2={CLAUDE_SONNET_4:{provider:S2.ANTHROPIC,name:"claude-sonnet-4-20250514",displayName:"Claude Sonnet 4",contextWindow:1e6,maxOutputTokens:32000,capabilities:{reasoning:!0,vision:!0,tools:!0}},CLAUDE_SONNET_4_5:{provider:S2.ANTHROPIC,name:"claude-sonnet-4-5-20250929",displayName:"Claude Sonnet 4.5",contextWindow:1e6,maxOutputTokens:32000,capabilities:{reasoning:!0,vision:!0,tools:!0}},CLAUDE_OPUS_4:{provider:S2.ANTHROPIC,name:"claude-opus-4-20250514",displayName:"Claude Opus 4",contextWindow:200000,maxOutputTokens:32000,capabilities:{reasoning:!0,vision:!0,tools:!0}},CLAUDE_OPUS_4_1:{provider:S2.ANTHROPIC,name:"claude-opus-4-1-20250805",displayName:"Claude Opus 4.1",contextWindow:200000,maxOutputTokens:32000,capabilities:{reasoning:!0,vision:!0,tools:!0}},CLAUDE_HAIKU_4_5:{provider:S2.ANTHROPIC,name:"claude-haiku-4-5-20251001",displayName:"Claude Haiku 4.5",contextWindow:200000,maxOutputTokens:64000,capabilities:{reasoning:!0,vision:!0,tools:!0}},CLAUDE_3_5_HAIKU:{provider:S2.ANTHROPIC,name:"claude-3-5-haiku-20241022",displayName:"Claude 3.5 Haiku",contextWindow:200000,maxOutputTokens:8000,capabilities:{reasoning:!0,vision:!0,tools:!0},freeTierEligible:!0},CLAUDE_3_5_SONNET:{provider:S2.ANTHROPIC,name:"claude-3-5-sonnet-20241022",displayName:"Claude 3.5 Sonnet",contextWindow:200000,maxOutputTokens:8000,capabilities:{reasoning:!0,vision:!0,tools:!0}},GPT_5:{provider:S2.OPENAI,name:"gpt-5",displayName:"GPT-5",contextWindow:400000,maxOutputTokens:128000,pricing:{input:1.25,output:10,cached:0.125},capabilities:{reasoning:!0,vision:!0,tools:!0}},GPT_5_CODEX:{provider:S2.OPENAI,name:"gpt-5-codex",displayName:"GPT-5 Codex",contextWindow:400000,maxOutputTokens:128000,pricing:{input:1.25,output:10,cached:0.125},capabilities:{reasoning:!0,tools:!0}},GPT_5_MINI:{provider:S2.OPENAI,name:"gpt-5-mini",displayName:"GPT-5 Mini",contextWindow:400000,maxOutputTokens:128000,pricing:{input:0.25,output:2,cached:0.025},capabilities:{reasoning:!0,vision:!0,tools:!0}},GPT_5_NANO:{provider:S2.OPENAI,name:"gpt-5-nano",displayName:"GPT-5 Nano",contextWindow:400000,maxOutputTokens:128000,pricing:{input:0.05,output:0.4,cached:0.005},capabilities:{reasoning:!0,vision:!0,tools:!0}},GPT_4_1:{provider:S2.OPENAI,name:"gpt-4.1",displayName:"GPT-4.1",contextWindow:1047576,maxOutputTokens:32768,pricing:{input:2,output:8,cached:0.5},capabilities:{vision:!0,tools:!0}},GPT_4O:{provider:S2.OPENAI,name:"gpt-4o",displayName:"GPT-4o",contextWindow:128000,maxOutputTokens:16384,pricing:{input:2.5,output:10,cached:1.25},capabilities:{vision:!0,tools:!0}},O3:{provider:S2.OPENAI,name:"o3",displayName:"o3",contextWindow:200000,maxOutputTokens:1e5,pricing:{input:2,output:8,cached:0.5},capabilities:{reasoning:!0,tools:!0}},O3_MINI:{provider:S2.OPENAI,name:"o3-mini",displayName:"o3-mini",contextWindow:200000,maxOutputTokens:1e5,pricing:{input:1.1,output:4.4,cached:0.55},capabilities:{reasoning:!0,tools:!0}},GPT_OSS_120B:{provider:S2.OPENAI,name:"openai/gpt-oss-120b",displayName:"GPT OSS 120B",contextWindow:128000,maxOutputTokens:32000,capabilities:{reasoning:!0,tools:!0}},GROK_CODE_FAST_1:{provider:S2.XAI,name:"grok-code-fast-1",displayName:"Grok Code Fast 1",contextWindow:256000,maxOutputTokens:32000,capabilities:{reasoning:!0,tools:!0},freeTierEligible:!0},GROK_CODE:{provider:S2.XAI,name:"grok-code",displayName:"Grok Code",contextWindow:256000,maxOutputTokens:32000,capabilities:{reasoning:!0,tools:!0},freeTierEligible:!0},GEMINI_2_5_PRO:{provider:S2.VERTEXAI,name:"gemini-2.5-pro",displayName:"Gemini 2.5 Pro",contextWindow:1048576,maxOutputTokens:65535,capabilities:{tools:!0,reasoning:!0,vision:!0}},GEMINI_2_5_FLASH:{provider:S2.VERTEXAI,name:"gemini-2.5-flash",displayName:"Gemini 2.5 Flash",contextWindow:1048576,maxOutputTokens:65535,capabilities:{tools:!0,reasoning:!0,vision:!0}},GEMINI_2_5_FLASH_PREVIEW_09_2025:{provider:S2.VERTEXAI,name:"gemini-2.5-flash-preview-09-2025",displayName:"Gemini 2.5 Flash (Preview)",contextWindow:1048576,maxOutputTokens:65535,capabilities:{tools:!0,reasoning:!0,vision:!0},freeTierEligible:!0},GEMINI_2_5_FLASH_LITE:{provider:S2.VERTEXAI,name:"gemini-2.5-flash-lite",displayName:"Gemini 2.5 Flash Lite",contextWindow:1048576,maxOutputTokens:65535,capabilities:{tools:!0,reasoning:!0,vision:!0}},GEMINI_2_5_FLASH_LITE_PREVIEW_09_2025:{provider:S2.VERTEXAI,name:"gemini-2.5-flash-lite-preview-09-2025",displayName:"Gemini 2.5 Flash Lite (Preview)",contextWindow:1048576,maxOutputTokens:65535,capabilities:{tools:!0,reasoning:!0,vision:!0},freeTierEligible:!0},QWEN_3_CODER_480B:{provider:S2.CEREBRAS,name:"qwen-3-coder-480b",displayName:"Qwen 3 Coder 480B",contextWindow:128000,maxOutputTokens:32000,capabilities:{tools:!0}},KIMI_K2_INSTRUCT:{provider:S2.MOONSHOT,name:"kimi-k2-instruct-0905",displayName:"Kimi K2 Instruct",contextWindow:1e6,maxOutputTokens:32000,capabilities:{tools:!0}},SONOMA_SKY_ALPHA:{provider:S2.OPENROUTER,name:"sonoma-sky-alpha",displayName:"Sonoma Sky Alpha",contextWindow:256000,maxOutputTokens:32000,capabilities:{tools:!0}},CODE_SUPERNOVA:{provider:S2.SUPERNOVA,name:"code-supernova",displayName:"Code Supernova",contextWindow:1e6,maxOutputTokens:32000,capabilities:{tools:!0},freeTierEligible:!0}};xN={SMART:{key:"smart",displayName:"Smart",description:"Smarter, but slower",primaryModel:f8("CLAUDE_SONNET_4_5"),visible:!0},FREE:{key:"free",displayName:"Free",description:"Amp Free",primaryModel:f8("GROK_CODE_FAST_1"),visible:!0,toolAllowlist:["*","!oracle","!librarian","!Task","!read_thread"]},FREE_NEXT:{key:"free-next",displayName:"Free (Next)",description:"Preview of Amp Free configuration in testing",primaryModel:f8("GEMINI_2_5_FLASH_PREVIEW_09_2025"),toolAllowlist:["*","!oracle","!librarian","!Task"]},GRONK_FAST_MAIN:{key:"gronk-fast:main",displayName:"Gronk Fast Main",primaryModel:f8("GROK_CODE_FAST_1")},GRONK_FAST_SEARCH:{key:"gronk-fast:search",displayName:"Gronk Fast Search",primaryModel:f8("CLAUDE_SONNET_4_5"),searchModel:f8("GROK_CODE_FAST_1")},GRONK_FAST_MAIN_SEARCH:{key:"gronk-fast:main+search",displayName:"Gronk Fast Main+Search",primaryModel:f8("GROK_CODE_FAST_1"),searchModel:f8("GROK_CODE_FAST_1")},BOLT_SEARCH:{key:"bolt:search",displayName:"Bolt Search",primaryModel:f8("CLAUDE_SONNET_4_5"),searchModel:f8("QWEN_3_CODER_480B")},BOLT_MAIN:{key:"bolt:main",displayName:"Bolt Main",primaryModel:f8("QWEN_3_CODER_480B")},BOLT_MAIN_SEARCH:{key:"bolt:main+search",displayName:"Bolt Main+Search",primaryModel:f8("QWEN_3_CODER_480B"),searchModel:f8("QWEN_3_CODER_480B")},GEPPETTO_MAIN:{key:"geppetto:main",displayName:"Geppetto Main",primaryModel:f8("GPT_5")},GEPPETTO_PRO_MAIN:{key:"geppetto-pro:main",displayName:"Geppetto Pro Main",primaryModel:f8("GPT_5")},PINOCCHIO_MAIN:{key:"pinocchio:main",displayName:"Pinocchio Main",primaryModel:f8("GPT_5_CODEX")},CLAUDIUS_MAIN:{key:"claudius:main",displayName:"Claudius Main",primaryModel:f8("CLAUDE_OPUS_4")},OPUS_4_1:{key:"opus4.1",displayName:"Opus 4.1",primaryModel:f8("CLAUDE_OPUS_4_1")},HYDROGEN_MAIN:{key:"hydrogen:main",displayName:"Hydrogen Main",primaryModel:f8("CODE_SUPERNOVA")},KASHMIR_MAIN:{key:"kashmir:main",displayName:"Kashmir Main",primaryModel:f8("KIMI_K2_INSTRUCT")},KASHMIR_SEARCH:{key:"kashmir:search",displayName:"Kashmir Search",primaryModel:f8("CLAUDE_SONNET_4_5"),searchModel:f8("KIMI_K2_INSTRUCT")},KASHMIR_MAIN_SEARCH:{key:"kashmir:main+search",displayName:"Kashmir Main+Search",primaryModel:f8("KIMI_K2_INSTRUCT"),searchModel:f8("KIMI_K2_INSTRUCT")},GOSSIP_MAIN:{key:"gossip:main",displayName:"Gossip Main",primaryModel:f8("GPT_OSS_120B")},GOSSIP_SEARCH:{key:"gossip:search",displayName:"Gossip Search",primaryModel:f8("CLAUDE_SONNET_4_5"),searchModel:f8("GPT_OSS_120B")},GOSSIP_MAIN_SEARCH:{key:"gossip:main+search",displayName:"Gossip Main+Search",primaryModel:f8("GPT_OSS_120B"),searchModel:f8("GPT_OSS_120B")},SONOMOON_MAIN:{key:"sonomoon:main",displayName:"Sonomoon Main",primaryModel:f8("SONOMA_SKY_ALPHA")},SONOMOON_SEARCH:{key:"sonomoon:search",displayName:"Sonomoon Search",primaryModel:f8("CLAUDE_SONNET_4_5"),searchModel:f8("SONOMA_SKY_ALPHA")},SONOMOON_MAIN_SEARCH:{key:"sonomoon:main+search",displayName:"Sonomoon Main+Search",primaryModel:f8("SONOMA_SKY_ALPHA"),searchModel:f8("SONOMA_SKY_ALPHA")}},id=Object.values(xN).map((J)=>J.key),VS={xai_finder:["free","gronk-fast:search","gronk-fast:main+search"],fast_finder:["bolt:search","bolt:main+search"],kimiK2_finder:["kashmir:search","kashmir:main+search"],gossip_finder:["gossip:search","gossip:main+search"],sonoma_finder:["sonomoon:search","sonomoon:main+search"]},gl1=Object.keys(VS)});function oZ1(J){return PH6.includes(J)}function pl1(J){let Q=J["internal.oracleModel"]?.trim();if(Q&&Q.length>0)return Q;return p2.GPT_5.name}function dl1(J){let Q=J["internal.model"]?.trim();if(!Q||Q.length===0)return null;let Z=Q.indexOf(":");if(Z===-1)return null;let X=Q.slice(0,Z).trim(),Y=Q.slice(Z+1).trim();if(!X||!Y)return null;return`${X}/${Y}`}var PH6,tZ1,ul1;var XO=B1(()=>{pZ1();q2();PH6=["guardedFiles.allowlist","mcpPermissions","tools.disable","permissions"];tZ1=JO.capabilities.untrustedWorkspaces.restrictedConfigurations.map((J)=>J.replace(/^amp\./,"")),ul1=["apiKey","buildkite-access-token","github-access-token","gitlab-access-token","gitlab-instance-url","mcp-oauth-client-secret","mcp-oauth-token"]});function LB(J){let Q=typeof J==="string"?J:J.toString();return Q===VZ||Q===VZ.slice(0,-1)}function YO(J){return LB(J)?VZ:J}var SH6,VZ,vH6,fU9;var AB=B1(()=>{SH6=new URL("https://ampcode.com/"),VZ=SH6.toString(),vH6=new URL("https://api.anthropic.com/"),fU9=vH6.toString()});var O9,eZ1,J6,Qz=(J)=>{switch(typeof J){case"undefined":return J6.undefined;case"string":return J6.string;case"number":return Number.isNaN(J)?J6.nan:J6.number;case"boolean":return J6.boolean;case"function":return J6.function;case"bigint":return J6.bigint;case"symbol":return J6.symbol;case"object":if(Array.isArray(J))return J6.array;if(J===null)return J6.null;if(J.then&&typeof J.then==="function"&&J.catch&&typeof J.catch==="function")return J6.promise;if(typeof Map<"u"&&J instanceof Map)return J6.map;if(typeof Set<"u"&&J instanceof Set)return J6.set;if(typeof Date<"u"&&J instanceof Date)return J6.date;return J6.object;default:return J6.unknown}};var AS=B1(()=>{(function(J){J.assertEqual=(Y)=>{};function Q(Y){}J.assertIs=Q;function Z(Y){throw Error()}J.assertNever=Z,J.arrayToEnum=(Y)=>{let K={};for(let G of Y)K[G]=G;return K},J.getValidEnumValues=(Y)=>{let K=J.objectKeys(Y).filter((q)=>typeof Y[Y[q]]!=="number"),G={};for(let q of K)G[q]=Y[q];return J.objectValues(G)},J.objectValues=(Y)=>{return J.objectKeys(Y).map(function(K){return Y[K]})},J.objectKeys=typeof Object.keys==="function"?(Y)=>Object.keys(Y):(Y)=>{let K=[];for(let G in Y)if(Object.prototype.hasOwnProperty.call(Y,G))K.push(G);return K},J.find=(Y,K)=>{for(let G of Y)if(K(G))return G;return},J.isInteger=typeof Number.isInteger==="function"?(Y)=>Number.isInteger(Y):(Y)=>typeof Y==="number"&&Number.isFinite(Y)&&Math.floor(Y)===Y;function X(Y,K=" | "){return Y.map((G)=>typeof G==="string"?`'${G}'`:G).join(K)}J.joinValues=X,J.jsonStringifyReplacer=(Y,K)=>{if(typeof K==="bigint")return K.toString();return K}})(O9||(O9={}));(function(J){J.mergeShapes=(Q,Z)=>{return{...Q,...Z}}})(eZ1||(eZ1={}));J6=O9.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"])});var h0,kH6=(J)=>{return JSON.stringify(J,null,2).replace(/"([^"]+)":/g,"$1:")},NZ;var sd=B1(()=>{AS();h0=O9.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]);NZ=class NZ extends Error{get errors(){return this.issues}constructor(J){super();this.issues=[],this.addIssue=(Z)=>{this.issues=[...this.issues,Z]},this.addIssues=(Z=[])=>{this.issues=[...this.issues,...Z]};let Q=new.target.prototype;if(Object.setPrototypeOf)Object.setPrototypeOf(this,Q);else this.__proto__=Q;this.name="ZodError",this.issues=J}format(J){let Q=J||function(Y){return Y.message},Z={_errors:[]},X=(Y)=>{for(let K of Y.issues)if(K.code==="invalid_union")K.unionErrors.map(X);else if(K.code==="invalid_return_type")X(K.returnTypeError);else if(K.code==="invalid_arguments")X(K.argumentsError);else if(K.path.length===0)Z._errors.push(Q(K));else{let G=Z,q=0;while(q<K.path.length){let z=K.path[q];if(q!==K.path.length-1)G[z]=G[z]||{_errors:[]};else G[z]=G[z]||{_errors:[]},G[z]._errors.push(Q(K));G=G[z],q++}}};return X(this),Z}static assert(J){if(!(J instanceof NZ))throw Error(`Not a ZodError: ${J}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,O9.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(J=(Q)=>Q.message){let Q={},Z=[];for(let X of this.issues)if(X.path.length>0){let Y=X.path[0];Q[Y]=Q[Y]||[],Q[Y].push(J(X))}else Z.push(J(X));return{formErrors:Z,fieldErrors:Q}}get formErrors(){return this.flatten()}};NZ.create=(J)=>{return new NZ(J)}});var _H6=(J,Q)=>{let Z;switch(J.code){case h0.invalid_type:if(J.received===J6.undefined)Z="Required";else Z=`Expected ${J.expected}, received ${J.received}`;break;case h0.invalid_literal:Z=`Invalid literal value, expected ${JSON.stringify(J.expected,O9.jsonStringifyReplacer)}`;break;case h0.unrecognized_keys:Z=`Unrecognized key(s) in object: ${O9.joinValues(J.keys,", ")}`;break;case h0.invalid_union:Z="Invalid input";break;case h0.invalid_union_discriminator:Z=`Invalid discriminator value. Expected ${O9.joinValues(J.options)}`;break;case h0.invalid_enum_value:Z=`Invalid enum value. Expected ${O9.joinValues(J.options)}, received '${J.received}'`;break;case h0.invalid_arguments:Z="Invalid function arguments";break;case h0.invalid_return_type:Z="Invalid function return type";break;case h0.invalid_date:Z="Invalid date";break;case h0.invalid_string:if(typeof J.validation==="object")if("includes"in J.validation){if(Z=`Invalid input: must include "${J.validation.includes}"`,typeof J.validation.position==="number")Z=`${Z} at one or more positions greater than or equal to ${J.validation.position}`}else if("startsWith"in J.validation)Z=`Invalid input: must start with "${J.validation.startsWith}"`;else if("endsWith"in J.validation)Z=`Invalid input: must end with "${J.validation.endsWith}"`;else O9.assertNever(J.validation);else if(J.validation!=="regex")Z=`Invalid ${J.validation}`;else Z="Invalid";break;case h0.too_small:if(J.type==="array")Z=`Array must contain ${J.exact?"exactly":J.inclusive?"at least":"more than"} ${J.minimum} element(s)`;else if(J.type==="string")Z=`String must contain ${J.exact?"exactly":J.inclusive?"at least":"over"} ${J.minimum} character(s)`;else if(J.type==="number")Z=`Number must be ${J.exact?"exactly equal to ":J.inclusive?"greater than or equal to ":"greater than "}${J.minimum}`;else if(J.type==="bigint")Z=`Number must be ${J.exact?"exactly equal to ":J.inclusive?"greater than or equal to ":"greater than "}${J.minimum}`;else if(J.type==="date")Z=`Date must be ${J.exact?"exactly equal to ":J.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(J.minimum))}`;else Z="Invalid input";break;case h0.too_big:if(J.type==="array")Z=`Array must contain ${J.exact?"exactly":J.inclusive?"at most":"less than"} ${J.maximum} element(s)`;else if(J.type==="string")Z=`String must contain ${J.exact?"exactly":J.inclusive?"at most":"under"} ${J.maximum} character(s)`;else if(J.type==="number")Z=`Number must be ${J.exact?"exactly":J.inclusive?"less than or equal to":"less than"} ${J.maximum}`;else if(J.type==="bigint")Z=`BigInt must be ${J.exact?"exactly":J.inclusive?"less than or equal to":"less than"} ${J.maximum}`;else if(J.type==="date")Z=`Date must be ${J.exact?"exactly":J.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(J.maximum))}`;else Z="Invalid input";break;case h0.custom:Z="Invalid input";break;case h0.invalid_intersection_types:Z="Intersection results could not be merged";break;case h0.not_multiple_of:Z=`Number must be a multiple of ${J.multipleOf}`;break;case h0.not_finite:Z="Number must be finite";break;default:Z=Q.defaultError,O9.assertNever(J)}return{message:Z}},FW;var JX1=B1(()=>{sd();AS();FW=_H6});function xH6(J){cl1=J}function KO(){return cl1}var cl1;var od=B1(()=>{JX1();cl1=FW});function F6(J,Q){let Z=KO(),X=wS({issueData:Q,data:J.data,path:J.path,errorMaps:[J.common.contextualErrorMap,J.schemaErrorMap,Z,Z===FW?void 0:FW].filter((Y)=>!!Y)});J.common.issues.push(X)}class QJ{constructor(){this.value="valid"}dirty(){if(this.value==="valid")this.value="dirty"}abort(){if(this.value!=="aborted")this.value="aborted"}static mergeArray(J,Q){let Z=[];for(let X of Q){if(X.status==="aborted")return N8;if(X.status==="dirty")J.dirty();Z.push(X.value)}return{status:J.value,value:Z}}static async mergeObjectAsync(J,Q){let Z=[];for(let X of Q){let Y=await X.key,K=await X.value;Z.push({key:Y,value:K})}return QJ.mergeObjectSync(J,Z)}static mergeObjectSync(J,Q){let Z={};for(let X of Q){let{key:Y,value:K}=X;if(Y.status==="aborted")return N8;if(K.status==="aborted")return N8;if(Y.status==="dirty")J.dirty();if(K.status==="dirty")J.dirty();if(Y.value!=="__proto__"&&(typeof K.value<"u"||X.alwaysSet))Z[Y.value]=K.value}return{status:J.value,value:Z}}}var wS=(J)=>{let{data:Q,path:Z,errorMaps:X,issueData:Y}=J,K=[...Z,...Y.path||[]],G={...Y,path:K};if(Y.message!==void 0)return{...Y,path:K,message:Y.message};let q="",z=X.filter((U)=>!!U).slice().reverse();for(let U of z)q=U(G,{data:Q,defaultError:q}).message;return{...Y,path:K,message:q}},bH6,N8,bN=(J)=>({status:"dirty",value:J}),xJ=(J)=>({status:"valid",value:J}),td=(J)=>J.status==="aborted",ed=(J)=>J.status==="dirty",wB=(J)=>J.status==="valid",GO=(J)=>typeof Promise<"u"&&J instanceof Promise;var QX1=B1(()=>{od();JX1();bH6=[];N8=Object.freeze({status:"aborted"})});var ll1=()=>{};var b6;var il1=B1(()=>{(function(J){J.errToObj=(Q)=>typeof Q==="string"?{message:Q}:Q||{},J.toString=(Q)=>typeof Q==="string"?Q:Q?.message})(b6||(b6={}))});class GG{constructor(J,Q,Z,X){this._cachedPath=[],this.parent=J,this.data=Q,this._path=Z,this._key=X}get path(){if(!this._cachedPath.length)if(Array.isArray(this._key))this._cachedPath.push(...this._path,...this._key);else this._cachedPath.push(...this._path,this._key);return this._cachedPath}}function l8(J){if(!J)return{};let{errorMap:Q,invalid_type_error:Z,required_error:X,description:Y}=J;if(Q&&(Z||X))throw Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);if(Q)return{errorMap:Q,description:Y};return{errorMap:(G,q)=>{let{message:z}=J;if(G.code==="invalid_enum_value")return{message:z??q.defaultError};if(typeof q.data>"u")return{message:z??X??q.defaultError};if(G.code!=="invalid_type")return{message:q.defaultError};return{message:z??Z??q.defaultError}},description:Y}}class z9{get description(){return this._def.description}_getType(J){return Qz(J.data)}_getOrReturnCtx(J,Q){return Q||{common:J.parent.common,data:J.data,parsedType:Qz(J.data),schemaErrorMap:this._def.errorMap,path:J.path,parent:J.parent}}_processInputParams(J){return{status:new QJ,ctx:{common:J.parent.common,data:J.data,parsedType:Qz(J.data),schemaErrorMap:this._def.errorMap,path:J.path,parent:J.parent}}}_parseSync(J){let Q=this._parse(J);if(GO(Q))throw Error("Synchronous parse encountered promise.");return Q}_parseAsync(J){let Q=this._parse(J);return Promise.resolve(Q)}parse(J,Q){let Z=this.safeParse(J,Q);if(Z.success)return Z.data;throw Z.error}safeParse(J,Q){let Z={common:{issues:[],async:Q?.async??!1,contextualErrorMap:Q?.errorMap},path:Q?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:J,parsedType:Qz(J)},X=this._parseSync({data:J,path:Z.path,parent:Z});return al1(Z,X)}"~validate"(J){let Q={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:J,parsedType:Qz(J)};if(!this["~standard"].async)try{let Z=this._parseSync({data:J,path:[],parent:Q});return wB(Z)?{value:Z.value}:{issues:Q.common.issues}}catch(Z){if(Z?.message?.toLowerCase()?.includes("encountered"))this["~standard"].async=!0;Q.common={issues:[],async:!0}}return this._parseAsync({data:J,path:[],parent:Q}).then((Z)=>wB(Z)?{value:Z.value}:{issues:Q.common.issues})}async parseAsync(J,Q){let Z=await this.safeParseAsync(J,Q);if(Z.success)return Z.data;throw Z.error}async safeParseAsync(J,Q){let Z={common:{issues:[],contextualErrorMap:Q?.errorMap,async:!0},path:Q?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:J,parsedType:Qz(J)},X=this._parse({data:J,path:Z.path,parent:Z}),Y=await(GO(X)?X:Promise.resolve(X));return al1(Z,Y)}refine(J,Q){let Z=(X)=>{if(typeof Q==="string"||typeof Q>"u")return{message:Q};else if(typeof Q==="function")return Q(X);else return Q};return this._refinement((X,Y)=>{let K=J(X),G=()=>Y.addIssue({code:h0.custom,...Z(X)});if(typeof Promise<"u"&&K instanceof Promise)return K.then((q)=>{if(!q)return G(),!1;else return!0});if(!K)return G(),!1;else return!0})}refinement(J,Q){return this._refinement((Z,X)=>{if(!J(Z))return X.addIssue(typeof Q==="function"?Q(Z,X):Q),!1;else return!0})}_refinement(J){return new qG({schema:this,typeName:R8.ZodEffects,effect:{type:"refinement",refinement:J}})}superRefine(J){return this._refinement(J)}constructor(J){this.spa=this.safeParseAsync,this._def=J,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:(Q)=>this["~validate"](Q)}}optional(){return KG.create(this,this._def)}nullable(){return BW.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return YG.create(this)}promise(){return gN.create(this,this._def)}or(J){return HO.create([this,J],this._def)}and(J){return BO.create(this,J,this._def)}transform(J){return new qG({...l8(this._def),schema:this,typeName:R8.ZodEffects,effect:{type:"transform",transform:J}})}default(J){let Q=typeof J==="function"?J:()=>J;return new NO({...l8(this._def),innerType:this,defaultValue:Q,typeName:R8.ZodDefault})}brand(){return new Qc({typeName:R8.ZodBranded,type:this,...l8(this._def)})}catch(J){let Q=typeof J==="function"?J:()=>J;return new LO({...l8(this._def),innerType:this,catchValue:Q,typeName:R8.ZodCatch})}describe(J){return new this.constructor({...this._def,description:J})}pipe(J){return IS.create(this,J)}readonly(){return AO.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}function sl1(J){let Q="[0-5]\\d";if(J.precision)Q=`${Q}\\.\\d{${J.precision}}`;else if(J.precision==null)Q=`${Q}(\\.\\d+)?`;let Z=J.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${Q})${Z}`}function tH6(J){return new RegExp(`^${sl1(J)}$`)}function ol1(J){let Q=`${rl1}T${sl1(J)}`,Z=[];if(Z.push(J.local?"Z?":"Z"),J.offset)Z.push("([+-]\\d{2}:?\\d{2})");return Q=`${Q}(${Z.join("|")})`,new RegExp(`^${Q}$`)}function eH6(J,Q){if((Q==="v4"||!Q)&&lH6.test(J))return!0;if((Q==="v6"||!Q)&&aH6.test(J))return!0;return!1}function JB6(J,Q){if(!uH6.test(J))return!1;try{let[Z]=J.split(".");if(!Z)return!1;let X=Z.replace(/-/g,"+").replace(/_/g,"/").padEnd(Z.length+(4-Z.length%4)%4,"="),Y=JSON.parse(atob(X));if(typeof Y!=="object"||Y===null)return!1;if("typ"in Y&&Y?.typ!=="JWT")return!1;if(!Y.alg)return!1;if(Q&&Y.alg!==Q)return!1;return!0}catch{return!1}}function QB6(J,Q){if((Q==="v4"||!Q)&&iH6.test(J))return!0;if((Q==="v6"||!Q)&&nH6.test(J))return!0;return!1}function ZB6(J,Q){let Z=(J.toString().split(".")[1]||"").length,X=(Q.toString().split(".")[1]||"").length,Y=Z>X?Z:X,K=Number.parseInt(J.toFixed(Y).replace(".","")),G=Number.parseInt(Q.toFixed(Y).replace(".",""));return K%G/10**Y}function qO(J){if(J instanceof _4){let Q={};for(let Z in J.shape){let X=J.shape[Z];Q[Z]=KG.create(qO(X))}return new _4({...J._def,shape:()=>Q})}else if(J instanceof YG)return new YG({...J._def,type:qO(J.element)});else if(J instanceof KG)return KG.create(qO(J.unwrap()));else if(J instanceof BW)return BW.create(qO(J.unwrap()));else if(J instanceof Xz)return Xz.create(J.items.map((Q)=>qO(Q)));else return J}function XX1(J,Q){let Z=Qz(J),X=Qz(Q);if(J===Q)return{valid:!0,data:J};else if(Z===J6.object&&X===J6.object){let Y=O9.objectKeys(Q),K=O9.objectKeys(J).filter((q)=>Y.indexOf(q)!==-1),G={...J,...Q};for(let q of K){let z=XX1(J[q],Q[q]);if(!z.valid)return{valid:!1};G[q]=z.data}return{valid:!0,data:G}}else if(Z===J6.array&&X===J6.array){if(J.length!==Q.length)return{valid:!1};let Y=[];for(let K=0;K<J.length;K++){let G=J[K],q=Q[K],z=XX1(G,q);if(!z.valid)return{valid:!1};Y.push(z.data)}return{valid:!0,data:Y}}else if(Z===J6.date&&X===J6.date&&+J===+Q)return{valid:!0,data:J};else return{valid:!1}}function tl1(J,Q){return new $B({values:J,typeName:R8.ZodEnum,...l8(Q)})}function nl1(J,Q){let Z=typeof J==="function"?J(Q):typeof J==="string"?{message:J}:J;return typeof Z==="string"?{message:Z}:Z}function el1(J,Q={},Z){if(J)return fN.create().superRefine((X,Y)=>{let K=J(X);if(K instanceof Promise)return K.then((G)=>{if(!G){let q=nl1(Q,X),z=q.fatal??Z??!0;Y.addIssue({code:"custom",...q,fatal:z})}});if(!K){let G=nl1(Q,X),q=G.fatal??Z??!0;Y.addIssue({code:"custom",...G,fatal:q})}return});return fN.create()}var al1=(J,Q)=>{if(wB(Q))return{success:!0,data:Q.value};else{if(!J.common.issues.length)throw Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;let Z=new NZ(J.common.issues);return this._error=Z,this._error}}}},yH6,fH6,hH6,gH6,mH6,uH6,pH6,dH6,cH6="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",ZX1,lH6,iH6,aH6,nH6,rH6,sH6,rl1="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",oH6,XG,OB,jB,UO,yN,RS,WO,FO,fN,RB,Zz,OS,YG,_4,HO,HW=(J)=>{if(J instanceof DO)return HW(J.schema);else if(J instanceof qG)return HW(J.innerType());else if(J instanceof MO)return[J.value];else if(J instanceof $B)return J.options;else if(J instanceof VO)return O9.objectValues(J.enum);else if(J instanceof NO)return HW(J._def.innerType);else if(J instanceof WO)return[void 0];else if(J instanceof FO)return[null];else if(J instanceof KG)return[void 0,...HW(J.unwrap())];else if(J instanceof BW)return[null,...HW(J.unwrap())];else if(J instanceof Qc)return HW(J.unwrap());else if(J instanceof AO)return HW(J.unwrap());else if(J instanceof LO)return HW(J._def.innerType);else return[]},Jc,BO,Xz,jS,$S,hN,zO,DO,MO,$B,VO,gN,qG,KG,BW,NO,LO,ES,XB6,Qc,IS,AO,YB6,R8,KB6=(J,Q={message:`Input not instance of ${J.name}`})=>el1((Z)=>Z instanceof J,Q),Ji1,Qi1,GB6,qB6,Zi1,zB6,UB6,WB6,FB6,HB6,BB6,DB6,MB6,VB6,NB6,LB6,AB6,wB6,RB6,OB6,jB6,$B6,EB6,IB6,PB6,TB6,CB6,SB6,vB6,kB6,_B6,xB6,bB6,yB6,fB6=()=>Ji1().optional(),hB6=()=>Qi1().optional(),gB6=()=>Zi1().optional(),mB6,uB6;var Xi1=B1(()=>{sd();od();il1();QX1();AS();yH6=/^c[^\s-]{8,}$/i,fH6=/^[0-9a-z]+$/,hH6=/^[0-9A-HJKMNP-TV-Z]{26}$/i,gH6=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,mH6=/^[a-z0-9_-]{21}$/i,uH6=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,pH6=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,dH6=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,lH6=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,iH6=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,aH6=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,nH6=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,rH6=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,sH6=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,oH6=new RegExp(`^${rl1}$`);XG=class XG extends z9{_parse(J){if(this._def.coerce)J.data=String(J.data);if(this._getType(J)!==J6.string){let Y=this._getOrReturnCtx(J);return F6(Y,{code:h0.invalid_type,expected:J6.string,received:Y.parsedType}),N8}let Z=new QJ,X=void 0;for(let Y of this._def.checks)if(Y.kind==="min"){if(J.data.length<Y.value)X=this._getOrReturnCtx(J,X),F6(X,{code:h0.too_small,minimum:Y.value,type:"string",inclusive:!0,exact:!1,message:Y.message}),Z.dirty()}else if(Y.kind==="max"){if(J.data.length>Y.value)X=this._getOrReturnCtx(J,X),F6(X,{code:h0.too_big,maximum:Y.value,type:"string",inclusive:!0,exact:!1,message:Y.message}),Z.dirty()}else if(Y.kind==="length"){let K=J.data.length>Y.value,G=J.data.length<Y.value;if(K||G){if(X=this._getOrReturnCtx(J,X),K)F6(X,{code:h0.too_big,maximum:Y.value,type:"string",inclusive:!0,exact:!0,message:Y.message});else if(G)F6(X,{code:h0.too_small,minimum:Y.value,type:"string",inclusive:!0,exact:!0,message:Y.message});Z.dirty()}}else if(Y.kind==="email"){if(!dH6.test(J.data))X=this._getOrReturnCtx(J,X),F6(X,{validation:"email",code:h0.invalid_string,message:Y.message}),Z.dirty()}else if(Y.kind==="emoji"){if(!ZX1)ZX1=new RegExp(cH6,"u");if(!ZX1.test(J.data))X=this._getOrReturnCtx(J,X),F6(X,{validation:"emoji",code:h0.invalid_string,message:Y.message}),Z.dirty()}else if(Y.kind==="uuid"){if(!gH6.test(J.data))X=this._getOrReturnCtx(J,X),F6(X,{validation:"uuid",code:h0.invalid_string,message:Y.message}),Z.dirty()}else if(Y.kind==="nanoid"){if(!mH6.test(J.data))X=this._getOrReturnCtx(J,X),F6(X,{validation:"nanoid",code:h0.invalid_string,message:Y.message}),Z.dirty()}else if(Y.kind==="cuid"){if(!yH6.test(J.data))X=this._getOrReturnCtx(J,X),F6(X,{validation:"cuid",code:h0.invalid_string,message:Y.message}),Z.dirty()}else if(Y.kind==="cuid2"){if(!fH6.test(J.data))X=this._getOrReturnCtx(J,X),F6(X,{validation:"cuid2",code:h0.invalid_string,message:Y.message}),Z.dirty()}else if(Y.kind==="ulid"){if(!hH6.test(J.data))X=this._getOrReturnCtx(J,X),F6(X,{validation:"ulid",code:h0.invalid_string,message:Y.message}),Z.dirty()}else if(Y.kind==="url")try{new URL(J.data)}catch{X=this._getOrReturnCtx(J,X),F6(X,{validation:"url",code:h0.invalid_string,message:Y.message}),Z.dirty()}else if(Y.kind==="regex"){if(Y.regex.lastIndex=0,!Y.regex.test(J.data))X=this._getOrReturnCtx(J,X),F6(X,{validation:"regex",code:h0.invalid_string,message:Y.message}),Z.dirty()}else if(Y.kind==="trim")J.data=J.data.trim();else if(Y.kind==="includes"){if(!J.data.includes(Y.value,Y.position))X=this._getOrReturnCtx(J,X),F6(X,{code:h0.invalid_string,validation:{includes:Y.value,position:Y.position},message:Y.message}),Z.dirty()}else if(Y.kind==="toLowerCase")J.data=J.data.toLowerCase();else if(Y.kind==="toUpperCase")J.data=J.data.toUpperCase();else if(Y.kind==="startsWith"){if(!J.data.startsWith(Y.value))X=this._getOrReturnCtx(J,X),F6(X,{code:h0.invalid_string,validation:{startsWith:Y.value},message:Y.message}),Z.dirty()}else if(Y.kind==="endsWith"){if(!J.data.endsWith(Y.value))X=this._getOrReturnCtx(J,X),F6(X,{code:h0.invalid_string,validation:{endsWith:Y.value},message:Y.message}),Z.dirty()}else if(Y.kind==="datetime"){if(!ol1(Y).test(J.data))X=this._getOrReturnCtx(J,X),F6(X,{code:h0.invalid_string,validation:"datetime",message:Y.message}),Z.dirty()}else if(Y.kind==="date"){if(!oH6.test(J.data))X=this._getOrReturnCtx(J,X),F6(X,{code:h0.invalid_string,validation:"date",message:Y.message}),Z.dirty()}else if(Y.kind==="time"){if(!tH6(Y).test(J.data))X=this._getOrReturnCtx(J,X),F6(X,{code:h0.invalid_string,validation:"time",message:Y.message}),Z.dirty()}else if(Y.kind==="duration"){if(!pH6.test(J.data))X=this._getOrReturnCtx(J,X),F6(X,{validation:"duration",code:h0.invalid_string,message:Y.message}),Z.dirty()}else if(Y.kind==="ip"){if(!eH6(J.data,Y.version))X=this._getOrReturnCtx(J,X),F6(X,{validation:"ip",code:h0.invalid_string,message:Y.message}),Z.dirty()}else if(Y.kind==="jwt"){if(!JB6(J.data,Y.alg))X=this._getOrReturnCtx(J,X),F6(X,{validation:"jwt",code:h0.invalid_string,message:Y.message}),Z.dirty()}else if(Y.kind==="cidr"){if(!QB6(J.data,Y.version))X=this._getOrReturnCtx(J,X),F6(X,{validation:"cidr",code:h0.invalid_string,message:Y.message}),Z.dirty()}else if(Y.kind==="base64"){if(!rH6.test(J.data))X=this._getOrReturnCtx(J,X),F6(X,{validation:"base64",code:h0.invalid_string,message:Y.message}),Z.dirty()}else if(Y.kind==="base64url"){if(!sH6.test(J.data))X=this._getOrReturnCtx(J,X),F6(X,{validation:"base64url",code:h0.invalid_string,message:Y.message}),Z.dirty()}else O9.assertNever(Y);return{status:Z.value,value:J.data}}_regex(J,Q,Z){return this.refinement((X)=>J.test(X),{validation:Q,code:h0.invalid_string,...b6.errToObj(Z)})}_addCheck(J){return new XG({...this._def,checks:[...this._def.checks,J]})}email(J){return this._addCheck({kind:"email",...b6.errToObj(J)})}url(J){return this._addCheck({kind:"url",...b6.errToObj(J)})}emoji(J){return this._addCheck({kind:"emoji",...b6.errToObj(J)})}uuid(J){return this._addCheck({kind:"uuid",...b6.errToObj(J)})}nanoid(J){return this._addCheck({kind:"nanoid",...b6.errToObj(J)})}cuid(J){return this._addCheck({kind:"cuid",...b6.errToObj(J)})}cuid2(J){return this._addCheck({kind:"cuid2",...b6.errToObj(J)})}ulid(J){return this._addCheck({kind:"ulid",...b6.errToObj(J)})}base64(J){return this._addCheck({kind:"base64",...b6.errToObj(J)})}base64url(J){return this._addCheck({kind:"base64url",...b6.errToObj(J)})}jwt(J){return this._addCheck({kind:"jwt",...b6.errToObj(J)})}ip(J){return this._addCheck({kind:"ip",...b6.errToObj(J)})}cidr(J){return this._addCheck({kind:"cidr",...b6.errToObj(J)})}datetime(J){if(typeof J==="string")return this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:J});return this._addCheck({kind:"datetime",precision:typeof J?.precision>"u"?null:J?.precision,offset:J?.offset??!1,local:J?.local??!1,...b6.errToObj(J?.message)})}date(J){return this._addCheck({kind:"date",message:J})}time(J){if(typeof J==="string")return this._addCheck({kind:"time",precision:null,message:J});return this._addCheck({kind:"time",precision:typeof J?.precision>"u"?null:J?.precision,...b6.errToObj(J?.message)})}duration(J){return this._addCheck({kind:"duration",...b6.errToObj(J)})}regex(J,Q){return this._addCheck({kind:"regex",regex:J,...b6.errToObj(Q)})}includes(J,Q){return this._addCheck({kind:"includes",value:J,position:Q?.position,...b6.errToObj(Q?.message)})}startsWith(J,Q){return this._addCheck({kind:"startsWith",value:J,...b6.errToObj(Q)})}endsWith(J,Q){return this._addCheck({kind:"endsWith",value:J,...b6.errToObj(Q)})}min(J,Q){return this._addCheck({kind:"min",value:J,...b6.errToObj(Q)})}max(J,Q){return this._addCheck({kind:"max",value:J,...b6.errToObj(Q)})}length(J,Q){return this._addCheck({kind:"length",value:J,...b6.errToObj(Q)})}nonempty(J){return this.min(1,b6.errToObj(J))}trim(){return new XG({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new XG({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new XG({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find((J)=>J.kind==="datetime")}get isDate(){return!!this._def.checks.find((J)=>J.kind==="date")}get isTime(){return!!this._def.checks.find((J)=>J.kind==="time")}get isDuration(){return!!this._def.checks.find((J)=>J.kind==="duration")}get isEmail(){return!!this._def.checks.find((J)=>J.kind==="email")}get isURL(){return!!this._def.checks.find((J)=>J.kind==="url")}get isEmoji(){return!!this._def.checks.find((J)=>J.kind==="emoji")}get isUUID(){return!!this._def.checks.find((J)=>J.kind==="uuid")}get isNANOID(){return!!this._def.checks.find((J)=>J.kind==="nanoid")}get isCUID(){return!!this._def.checks.find((J)=>J.kind==="cuid")}get isCUID2(){return!!this._def.checks.find((J)=>J.kind==="cuid2")}get isULID(){return!!this._def.checks.find((J)=>J.kind==="ulid")}get isIP(){return!!this._def.checks.find((J)=>J.kind==="ip")}get isCIDR(){return!!this._def.checks.find((J)=>J.kind==="cidr")}get isBase64(){return!!this._def.checks.find((J)=>J.kind==="base64")}get isBase64url(){return!!this._def.checks.find((J)=>J.kind==="base64url")}get minLength(){let J=null;for(let Q of this._def.checks)if(Q.kind==="min"){if(J===null||Q.value>J)J=Q.value}return J}get maxLength(){let J=null;for(let Q of this._def.checks)if(Q.kind==="max"){if(J===null||Q.value<J)J=Q.value}return J}};XG.create=(J)=>{return new XG({checks:[],typeName:R8.ZodString,coerce:J?.coerce??!1,...l8(J)})};OB=class OB extends z9{constructor(){super(...arguments);this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(J){if(this._def.coerce)J.data=Number(J.data);if(this._getType(J)!==J6.number){let Y=this._getOrReturnCtx(J);return F6(Y,{code:h0.invalid_type,expected:J6.number,received:Y.parsedType}),N8}let Z=void 0,X=new QJ;for(let Y of this._def.checks)if(Y.kind==="int"){if(!O9.isInteger(J.data))Z=this._getOrReturnCtx(J,Z),F6(Z,{code:h0.invalid_type,expected:"integer",received:"float",message:Y.message}),X.dirty()}else if(Y.kind==="min"){if(Y.inclusive?J.data<Y.value:J.data<=Y.value)Z=this._getOrReturnCtx(J,Z),F6(Z,{code:h0.too_small,minimum:Y.value,type:"number",inclusive:Y.inclusive,exact:!1,message:Y.message}),X.dirty()}else if(Y.kind==="max"){if(Y.inclusive?J.data>Y.value:J.data>=Y.value)Z=this._getOrReturnCtx(J,Z),F6(Z,{code:h0.too_big,maximum:Y.value,type:"number",inclusive:Y.inclusive,exact:!1,message:Y.message}),X.dirty()}else if(Y.kind==="multipleOf"){if(ZB6(J.data,Y.value)!==0)Z=this._getOrReturnCtx(J,Z),F6(Z,{code:h0.not_multiple_of,multipleOf:Y.value,message:Y.message}),X.dirty()}else if(Y.kind==="finite"){if(!Number.isFinite(J.data))Z=this._getOrReturnCtx(J,Z),F6(Z,{code:h0.not_finite,message:Y.message}),X.dirty()}else O9.assertNever(Y);return{status:X.value,value:J.data}}gte(J,Q){return this.setLimit("min",J,!0,b6.toString(Q))}gt(J,Q){return this.setLimit("min",J,!1,b6.toString(Q))}lte(J,Q){return this.setLimit("max",J,!0,b6.toString(Q))}lt(J,Q){return this.setLimit("max",J,!1,b6.toString(Q))}setLimit(J,Q,Z,X){return new OB({...this._def,checks:[...this._def.checks,{kind:J,value:Q,inclusive:Z,message:b6.toString(X)}]})}_addCheck(J){return new OB({...this._def,checks:[...this._def.checks,J]})}int(J){return this._addCheck({kind:"int",message:b6.toString(J)})}positive(J){return this._addCheck({kind:"min",value:0,inclusive:!1,message:b6.toString(J)})}negative(J){return this._addCheck({kind:"max",value:0,inclusive:!1,message:b6.toString(J)})}nonpositive(J){return this._addCheck({kind:"max",value:0,inclusive:!0,message:b6.toString(J)})}nonnegative(J){return this._addCheck({kind:"min",value:0,inclusive:!0,message:b6.toString(J)})}multipleOf(J,Q){return this._addCheck({kind:"multipleOf",value:J,message:b6.toString(Q)})}finite(J){return this._addCheck({kind:"finite",message:b6.toString(J)})}safe(J){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:b6.toString(J)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:b6.toString(J)})}get minValue(){let J=null;for(let Q of this._def.checks)if(Q.kind==="min"){if(J===null||Q.value>J)J=Q.value}return J}get maxValue(){let J=null;for(let Q of this._def.checks)if(Q.kind==="max"){if(J===null||Q.value<J)J=Q.value}return J}get isInt(){return!!this._def.checks.find((J)=>J.kind==="int"||J.kind==="multipleOf"&&O9.isInteger(J.value))}get isFinite(){let J=null,Q=null;for(let Z of this._def.checks)if(Z.kind==="finite"||Z.kind==="int"||Z.kind==="multipleOf")return!0;else if(Z.kind==="min"){if(Q===null||Z.value>Q)Q=Z.value}else if(Z.kind==="max"){if(J===null||Z.value<J)J=Z.value}return Number.isFinite(Q)&&Number.isFinite(J)}};OB.create=(J)=>{return new OB({checks:[],typeName:R8.ZodNumber,coerce:J?.coerce||!1,...l8(J)})};jB=class jB extends z9{constructor(){super(...arguments);this.min=this.gte,this.max=this.lte}_parse(J){if(this._def.coerce)try{J.data=BigInt(J.data)}catch{return this._getInvalidInput(J)}if(this._getType(J)!==J6.bigint)return this._getInvalidInput(J);let Z=void 0,X=new QJ;for(let Y of this._def.checks)if(Y.kind==="min"){if(Y.inclusive?J.data<Y.value:J.data<=Y.value)Z=this._getOrReturnCtx(J,Z),F6(Z,{code:h0.too_small,type:"bigint",minimum:Y.value,inclusive:Y.inclusive,message:Y.message}),X.dirty()}else if(Y.kind==="max"){if(Y.inclusive?J.data>Y.value:J.data>=Y.value)Z=this._getOrReturnCtx(J,Z),F6(Z,{code:h0.too_big,type:"bigint",maximum:Y.value,inclusive:Y.inclusive,message:Y.message}),X.dirty()}else if(Y.kind==="multipleOf"){if(J.data%Y.value!==BigInt(0))Z=this._getOrReturnCtx(J,Z),F6(Z,{code:h0.not_multiple_of,multipleOf:Y.value,message:Y.message}),X.dirty()}else O9.assertNever(Y);return{status:X.value,value:J.data}}_getInvalidInput(J){let Q=this._getOrReturnCtx(J);return F6(Q,{code:h0.invalid_type,expected:J6.bigint,received:Q.parsedType}),N8}gte(J,Q){return this.setLimit("min",J,!0,b6.toString(Q))}gt(J,Q){return this.setLimit("min",J,!1,b6.toString(Q))}lte(J,Q){return this.setLimit("max",J,!0,b6.toString(Q))}lt(J,Q){return this.setLimit("max",J,!1,b6.toString(Q))}setLimit(J,Q,Z,X){return new jB({...this._def,checks:[...this._def.checks,{kind:J,value:Q,inclusive:Z,message:b6.toString(X)}]})}_addCheck(J){return new jB({...this._def,checks:[...this._def.checks,J]})}positive(J){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:b6.toString(J)})}negative(J){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:b6.toString(J)})}nonpositive(J){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:b6.toString(J)})}nonnegative(J){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:b6.toString(J)})}multipleOf(J,Q){return this._addCheck({kind:"multipleOf",value:J,message:b6.toString(Q)})}get minValue(){let J=null;for(let Q of this._def.checks)if(Q.kind==="min"){if(J===null||Q.value>J)J=Q.value}return J}get maxValue(){let J=null;for(let Q of this._def.checks)if(Q.kind==="max"){if(J===null||Q.value<J)J=Q.value}return J}};jB.create=(J)=>{return new jB({checks:[],typeName:R8.ZodBigInt,coerce:J?.coerce??!1,...l8(J)})};UO=class UO extends z9{_parse(J){if(this._def.coerce)J.data=Boolean(J.data);if(this._getType(J)!==J6.boolean){let Z=this._getOrReturnCtx(J);return F6(Z,{code:h0.invalid_type,expected:J6.boolean,received:Z.parsedType}),N8}return xJ(J.data)}};UO.create=(J)=>{return new UO({typeName:R8.ZodBoolean,coerce:J?.coerce||!1,...l8(J)})};yN=class yN extends z9{_parse(J){if(this._def.coerce)J.data=new Date(J.data);if(this._getType(J)!==J6.date){let Y=this._getOrReturnCtx(J);return F6(Y,{code:h0.invalid_type,expected:J6.date,received:Y.parsedType}),N8}if(Number.isNaN(J.data.getTime())){let Y=this._getOrReturnCtx(J);return F6(Y,{code:h0.invalid_date}),N8}let Z=new QJ,X=void 0;for(let Y of this._def.checks)if(Y.kind==="min"){if(J.data.getTime()<Y.value)X=this._getOrReturnCtx(J,X),F6(X,{code:h0.too_small,message:Y.message,inclusive:!0,exact:!1,minimum:Y.value,type:"date"}),Z.dirty()}else if(Y.kind==="max"){if(J.data.getTime()>Y.value)X=this._getOrReturnCtx(J,X),F6(X,{code:h0.too_big,message:Y.message,inclusive:!0,exact:!1,maximum:Y.value,type:"date"}),Z.dirty()}else O9.assertNever(Y);return{status:Z.value,value:new Date(J.data.getTime())}}_addCheck(J){return new yN({...this._def,checks:[...this._def.checks,J]})}min(J,Q){return this._addCheck({kind:"min",value:J.getTime(),message:b6.toString(Q)})}max(J,Q){return this._addCheck({kind:"max",value:J.getTime(),message:b6.toString(Q)})}get minDate(){let J=null;for(let Q of this._def.checks)if(Q.kind==="min"){if(J===null||Q.value>J)J=Q.value}return J!=null?new Date(J):null}get maxDate(){let J=null;for(let Q of this._def.checks)if(Q.kind==="max"){if(J===null||Q.value<J)J=Q.value}return J!=null?new Date(J):null}};yN.create=(J)=>{return new yN({checks:[],coerce:J?.coerce||!1,typeName:R8.ZodDate,...l8(J)})};RS=class RS extends z9{_parse(J){if(this._getType(J)!==J6.symbol){let Z=this._getOrReturnCtx(J);return F6(Z,{code:h0.invalid_type,expected:J6.symbol,received:Z.parsedType}),N8}return xJ(J.data)}};RS.create=(J)=>{return new RS({typeName:R8.ZodSymbol,...l8(J)})};WO=class WO extends z9{_parse(J){if(this._getType(J)!==J6.undefined){let Z=this._getOrReturnCtx(J);return F6(Z,{code:h0.invalid_type,expected:J6.undefined,received:Z.parsedType}),N8}return xJ(J.data)}};WO.create=(J)=>{return new WO({typeName:R8.ZodUndefined,...l8(J)})};FO=class FO extends z9{_parse(J){if(this._getType(J)!==J6.null){let Z=this._getOrReturnCtx(J);return F6(Z,{code:h0.invalid_type,expected:J6.null,received:Z.parsedType}),N8}return xJ(J.data)}};FO.create=(J)=>{return new FO({typeName:R8.ZodNull,...l8(J)})};fN=class fN extends z9{constructor(){super(...arguments);this._any=!0}_parse(J){return xJ(J.data)}};fN.create=(J)=>{return new fN({typeName:R8.ZodAny,...l8(J)})};RB=class RB extends z9{constructor(){super(...arguments);this._unknown=!0}_parse(J){return xJ(J.data)}};RB.create=(J)=>{return new RB({typeName:R8.ZodUnknown,...l8(J)})};Zz=class Zz extends z9{_parse(J){let Q=this._getOrReturnCtx(J);return F6(Q,{code:h0.invalid_type,expected:J6.never,received:Q.parsedType}),N8}};Zz.create=(J)=>{return new Zz({typeName:R8.ZodNever,...l8(J)})};OS=class OS extends z9{_parse(J){if(this._getType(J)!==J6.undefined){let Z=this._getOrReturnCtx(J);return F6(Z,{code:h0.invalid_type,expected:J6.void,received:Z.parsedType}),N8}return xJ(J.data)}};OS.create=(J)=>{return new OS({typeName:R8.ZodVoid,...l8(J)})};YG=class YG extends z9{_parse(J){let{ctx:Q,status:Z}=this._processInputParams(J),X=this._def;if(Q.parsedType!==J6.array)return F6(Q,{code:h0.invalid_type,expected:J6.array,received:Q.parsedType}),N8;if(X.exactLength!==null){let K=Q.data.length>X.exactLength.value,G=Q.data.length<X.exactLength.value;if(K||G)F6(Q,{code:K?h0.too_big:h0.too_small,minimum:G?X.exactLength.value:void 0,maximum:K?X.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:X.exactLength.message}),Z.dirty()}if(X.minLength!==null){if(Q.data.length<X.minLength.value)F6(Q,{code:h0.too_small,minimum:X.minLength.value,type:"array",inclusive:!0,exact:!1,message:X.minLength.message}),Z.dirty()}if(X.maxLength!==null){if(Q.data.length>X.maxLength.value)F6(Q,{code:h0.too_big,maximum:X.maxLength.value,type:"array",inclusive:!0,exact:!1,message:X.maxLength.message}),Z.dirty()}if(Q.common.async)return Promise.all([...Q.data].map((K,G)=>{return X.type._parseAsync(new GG(Q,K,Q.path,G))})).then((K)=>{return QJ.mergeArray(Z,K)});let Y=[...Q.data].map((K,G)=>{return X.type._parseSync(new GG(Q,K,Q.path,G))});return QJ.mergeArray(Z,Y)}get element(){return this._def.type}min(J,Q){return new YG({...this._def,minLength:{value:J,message:b6.toString(Q)}})}max(J,Q){return new YG({...this._def,maxLength:{value:J,message:b6.toString(Q)}})}length(J,Q){return new YG({...this._def,exactLength:{value:J,message:b6.toString(Q)}})}nonempty(J){return this.min(1,J)}};YG.create=(J,Q)=>{return new YG({type:J,minLength:null,maxLength:null,exactLength:null,typeName:R8.ZodArray,...l8(Q)})};_4=class _4 extends z9{constructor(){super(...arguments);this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;let J=this._def.shape(),Q=O9.objectKeys(J);return this._cached={shape:J,keys:Q},this._cached}_parse(J){if(this._getType(J)!==J6.object){let z=this._getOrReturnCtx(J);return F6(z,{code:h0.invalid_type,expected:J6.object,received:z.parsedType}),N8}let{status:Z,ctx:X}=this._processInputParams(J),{shape:Y,keys:K}=this._getCached(),G=[];if(!(this._def.catchall instanceof Zz&&this._def.unknownKeys==="strip")){for(let z in X.data)if(!K.includes(z))G.push(z)}let q=[];for(let z of K){let U=Y[z],W=X.data[z];q.push({key:{status:"valid",value:z},value:U._parse(new GG(X,W,X.path,z)),alwaysSet:z in X.data})}if(this._def.catchall instanceof Zz){let z=this._def.unknownKeys;if(z==="passthrough")for(let U of G)q.push({key:{status:"valid",value:U},value:{status:"valid",value:X.data[U]}});else if(z==="strict"){if(G.length>0)F6(X,{code:h0.unrecognized_keys,keys:G}),Z.dirty()}else if(z==="strip");else throw Error("Internal ZodObject error: invalid unknownKeys value.")}else{let z=this._def.catchall;for(let U of G){let W=X.data[U];q.push({key:{status:"valid",value:U},value:z._parse(new GG(X,W,X.path,U)),alwaysSet:U in X.data})}}if(X.common.async)return Promise.resolve().then(async()=>{let z=[];for(let U of q){let W=await U.key,F=await U.value;z.push({key:W,value:F,alwaysSet:U.alwaysSet})}return z}).then((z)=>{return QJ.mergeObjectSync(Z,z)});else return QJ.mergeObjectSync(Z,q)}get shape(){return this._def.shape()}strict(J){return b6.errToObj,new _4({...this._def,unknownKeys:"strict",...J!==void 0?{errorMap:(Q,Z)=>{let X=this._def.errorMap?.(Q,Z).message??Z.defaultError;if(Q.code==="unrecognized_keys")return{message:b6.errToObj(J).message??X};return{message:X}}}:{}})}strip(){return new _4({...this._def,unknownKeys:"strip"})}passthrough(){return new _4({...this._def,unknownKeys:"passthrough"})}extend(J){return new _4({...this._def,shape:()=>({...this._def.shape(),...J})})}merge(J){return new _4({unknownKeys:J._def.unknownKeys,catchall:J._def.catchall,shape:()=>({...this._def.shape(),...J._def.shape()}),typeName:R8.ZodObject})}setKey(J,Q){return this.augment({[J]:Q})}catchall(J){return new _4({...this._def,catchall:J})}pick(J){let Q={};for(let Z of O9.objectKeys(J))if(J[Z]&&this.shape[Z])Q[Z]=this.shape[Z];return new _4({...this._def,shape:()=>Q})}omit(J){let Q={};for(let Z of O9.objectKeys(this.shape))if(!J[Z])Q[Z]=this.shape[Z];return new _4({...this._def,shape:()=>Q})}deepPartial(){return qO(this)}partial(J){let Q={};for(let Z of O9.objectKeys(this.shape)){let X=this.shape[Z];if(J&&!J[Z])Q[Z]=X;else Q[Z]=X.optional()}return new _4({...this._def,shape:()=>Q})}required(J){let Q={};for(let Z of O9.objectKeys(this.shape))if(J&&!J[Z])Q[Z]=this.shape[Z];else{let Y=this.shape[Z];while(Y instanceof KG)Y=Y._def.innerType;Q[Z]=Y}return new _4({...this._def,shape:()=>Q})}keyof(){return tl1(O9.objectKeys(this.shape))}};_4.create=(J,Q)=>{return new _4({shape:()=>J,unknownKeys:"strip",catchall:Zz.create(),typeName:R8.ZodObject,...l8(Q)})};_4.strictCreate=(J,Q)=>{return new _4({shape:()=>J,unknownKeys:"strict",catchall:Zz.create(),typeName:R8.ZodObject,...l8(Q)})};_4.lazycreate=(J,Q)=>{return new _4({shape:J,unknownKeys:"strip",catchall:Zz.create(),typeName:R8.ZodObject,...l8(Q)})};HO=class HO extends z9{_parse(J){let{ctx:Q}=this._processInputParams(J),Z=this._def.options;function X(Y){for(let G of Y)if(G.result.status==="valid")return G.result;for(let G of Y)if(G.result.status==="dirty")return Q.common.issues.push(...G.ctx.common.issues),G.result;let K=Y.map((G)=>new NZ(G.ctx.common.issues));return F6(Q,{code:h0.invalid_union,unionErrors:K}),N8}if(Q.common.async)return Promise.all(Z.map(async(Y)=>{let K={...Q,common:{...Q.common,issues:[]},parent:null};return{result:await Y._parseAsync({data:Q.data,path:Q.path,parent:K}),ctx:K}})).then(X);else{let Y=void 0,K=[];for(let q of Z){let z={...Q,common:{...Q.common,issues:[]},parent:null},U=q._parseSync({data:Q.data,path:Q.path,parent:z});if(U.status==="valid")return U;else if(U.status==="dirty"&&!Y)Y={result:U,ctx:z};if(z.common.issues.length)K.push(z.common.issues)}if(Y)return Q.common.issues.push(...Y.ctx.common.issues),Y.result;let G=K.map((q)=>new NZ(q));return F6(Q,{code:h0.invalid_union,unionErrors:G}),N8}}get options(){return this._def.options}};HO.create=(J,Q)=>{return new HO({options:J,typeName:R8.ZodUnion,...l8(Q)})};Jc=class Jc extends z9{_parse(J){let{ctx:Q}=this._processInputParams(J);if(Q.parsedType!==J6.object)return F6(Q,{code:h0.invalid_type,expected:J6.object,received:Q.parsedType}),N8;let Z=this.discriminator,X=Q.data[Z],Y=this.optionsMap.get(X);if(!Y)return F6(Q,{code:h0.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[Z]}),N8;if(Q.common.async)return Y._parseAsync({data:Q.data,path:Q.path,parent:Q});else return Y._parseSync({data:Q.data,path:Q.path,parent:Q})}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(J,Q,Z){let X=new Map;for(let Y of Q){let K=HW(Y.shape[J]);if(!K.length)throw Error(`A discriminator value for key \`${J}\` could not be extracted from all schema options`);for(let G of K){if(X.has(G))throw Error(`Discriminator property ${String(J)} has duplicate value ${String(G)}`);X.set(G,Y)}}return new Jc({typeName:R8.ZodDiscriminatedUnion,discriminator:J,options:Q,optionsMap:X,...l8(Z)})}};BO=class BO extends z9{_parse(J){let{status:Q,ctx:Z}=this._processInputParams(J),X=(Y,K)=>{if(td(Y)||td(K))return N8;let G=XX1(Y.value,K.value);if(!G.valid)return F6(Z,{code:h0.invalid_intersection_types}),N8;if(ed(Y)||ed(K))Q.dirty();return{status:Q.value,value:G.data}};if(Z.common.async)return Promise.all([this._def.left._parseAsync({data:Z.data,path:Z.path,parent:Z}),this._def.right._parseAsync({data:Z.data,path:Z.path,parent:Z})]).then(([Y,K])=>X(Y,K));else return X(this._def.left._parseSync({data:Z.data,path:Z.path,parent:Z}),this._def.right._parseSync({data:Z.data,path:Z.path,parent:Z}))}};BO.create=(J,Q,Z)=>{return new BO({left:J,right:Q,typeName:R8.ZodIntersection,...l8(Z)})};Xz=class Xz extends z9{_parse(J){let{status:Q,ctx:Z}=this._processInputParams(J);if(Z.parsedType!==J6.array)return F6(Z,{code:h0.invalid_type,expected:J6.array,received:Z.parsedType}),N8;if(Z.data.length<this._def.items.length)return F6(Z,{code:h0.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),N8;if(!this._def.rest&&Z.data.length>this._def.items.length)F6(Z,{code:h0.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),Q.dirty();let Y=[...Z.data].map((K,G)=>{let q=this._def.items[G]||this._def.rest;if(!q)return null;return q._parse(new GG(Z,K,Z.path,G))}).filter((K)=>!!K);if(Z.common.async)return Promise.all(Y).then((K)=>{return QJ.mergeArray(Q,K)});else return QJ.mergeArray(Q,Y)}get items(){return this._def.items}rest(J){return new Xz({...this._def,rest:J})}};Xz.create=(J,Q)=>{if(!Array.isArray(J))throw Error("You must pass an array of schemas to z.tuple([ ... ])");return new Xz({items:J,typeName:R8.ZodTuple,rest:null,...l8(Q)})};jS=class jS extends z9{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(J){let{status:Q,ctx:Z}=this._processInputParams(J);if(Z.parsedType!==J6.object)return F6(Z,{code:h0.invalid_type,expected:J6.object,received:Z.parsedType}),N8;let X=[],Y=this._def.keyType,K=this._def.valueType;for(let G in Z.data)X.push({key:Y._parse(new GG(Z,G,Z.path,G)),value:K._parse(new GG(Z,Z.data[G],Z.path,G)),alwaysSet:G in Z.data});if(Z.common.async)return QJ.mergeObjectAsync(Q,X);else return QJ.mergeObjectSync(Q,X)}get element(){return this._def.valueType}static create(J,Q,Z){if(Q instanceof z9)return new jS({keyType:J,valueType:Q,typeName:R8.ZodRecord,...l8(Z)});return new jS({keyType:XG.create(),valueType:J,typeName:R8.ZodRecord,...l8(Q)})}};$S=class $S extends z9{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(J){let{status:Q,ctx:Z}=this._processInputParams(J);if(Z.parsedType!==J6.map)return F6(Z,{code:h0.invalid_type,expected:J6.map,received:Z.parsedType}),N8;let X=this._def.keyType,Y=this._def.valueType,K=[...Z.data.entries()].map(([G,q],z)=>{return{key:X._parse(new GG(Z,G,Z.path,[z,"key"])),value:Y._parse(new GG(Z,q,Z.path,[z,"value"]))}});if(Z.common.async){let G=new Map;return Promise.resolve().then(async()=>{for(let q of K){let z=await q.key,U=await q.value;if(z.status==="aborted"||U.status==="aborted")return N8;if(z.status==="dirty"||U.status==="dirty")Q.dirty();G.set(z.value,U.value)}return{status:Q.value,value:G}})}else{let G=new Map;for(let q of K){let{key:z,value:U}=q;if(z.status==="aborted"||U.status==="aborted")return N8;if(z.status==="dirty"||U.status==="dirty")Q.dirty();G.set(z.value,U.value)}return{status:Q.value,value:G}}}};$S.create=(J,Q,Z)=>{return new $S({valueType:Q,keyType:J,typeName:R8.ZodMap,...l8(Z)})};hN=class hN extends z9{_parse(J){let{status:Q,ctx:Z}=this._processInputParams(J);if(Z.parsedType!==J6.set)return F6(Z,{code:h0.invalid_type,expected:J6.set,received:Z.parsedType}),N8;let X=this._def;if(X.minSize!==null){if(Z.data.size<X.minSize.value)F6(Z,{code:h0.too_small,minimum:X.minSize.value,type:"set",inclusive:!0,exact:!1,message:X.minSize.message}),Q.dirty()}if(X.maxSize!==null){if(Z.data.size>X.maxSize.value)F6(Z,{code:h0.too_big,maximum:X.maxSize.value,type:"set",inclusive:!0,exact:!1,message:X.maxSize.message}),Q.dirty()}let Y=this._def.valueType;function K(q){let z=new Set;for(let U of q){if(U.status==="aborted")return N8;if(U.status==="dirty")Q.dirty();z.add(U.value)}return{status:Q.value,value:z}}let G=[...Z.data.values()].map((q,z)=>Y._parse(new GG(Z,q,Z.path,z)));if(Z.common.async)return Promise.all(G).then((q)=>K(q));else return K(G)}min(J,Q){return new hN({...this._def,minSize:{value:J,message:b6.toString(Q)}})}max(J,Q){return new hN({...this._def,maxSize:{value:J,message:b6.toString(Q)}})}size(J,Q){return this.min(J,Q).max(J,Q)}nonempty(J){return this.min(1,J)}};hN.create=(J,Q)=>{return new hN({valueType:J,minSize:null,maxSize:null,typeName:R8.ZodSet,...l8(Q)})};zO=class zO extends z9{constructor(){super(...arguments);this.validate=this.implement}_parse(J){let{ctx:Q}=this._processInputParams(J);if(Q.parsedType!==J6.function)return F6(Q,{code:h0.invalid_type,expected:J6.function,received:Q.parsedType}),N8;function Z(G,q){return wS({data:G,path:Q.path,errorMaps:[Q.common.contextualErrorMap,Q.schemaErrorMap,KO(),FW].filter((z)=>!!z),issueData:{code:h0.invalid_arguments,argumentsError:q}})}function X(G,q){return wS({data:G,path:Q.path,errorMaps:[Q.common.contextualErrorMap,Q.schemaErrorMap,KO(),FW].filter((z)=>!!z),issueData:{code:h0.invalid_return_type,returnTypeError:q}})}let Y={errorMap:Q.common.contextualErrorMap},K=Q.data;if(this._def.returns instanceof gN){let G=this;return xJ(async function(...q){let z=new NZ([]),U=await G._def.args.parseAsync(q,Y).catch((H)=>{throw z.addIssue(Z(q,H)),z}),W=await Reflect.apply(K,this,U);return await G._def.returns._def.type.parseAsync(W,Y).catch((H)=>{throw z.addIssue(X(W,H)),z})})}else{let G=this;return xJ(function(...q){let z=G._def.args.safeParse(q,Y);if(!z.success)throw new NZ([Z(q,z.error)]);let U=Reflect.apply(K,this,z.data),W=G._def.returns.safeParse(U,Y);if(!W.success)throw new NZ([X(U,W.error)]);return W.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...J){return new zO({...this._def,args:Xz.create(J).rest(RB.create())})}returns(J){return new zO({...this._def,returns:J})}implement(J){return this.parse(J)}strictImplement(J){return this.parse(J)}static create(J,Q,Z){return new zO({args:J?J:Xz.create([]).rest(RB.create()),returns:Q||RB.create(),typeName:R8.ZodFunction,...l8(Z)})}};DO=class DO extends z9{get schema(){return this._def.getter()}_parse(J){let{ctx:Q}=this._processInputParams(J);return this._def.getter()._parse({data:Q.data,path:Q.path,parent:Q})}};DO.create=(J,Q)=>{return new DO({getter:J,typeName:R8.ZodLazy,...l8(Q)})};MO=class MO extends z9{_parse(J){if(J.data!==this._def.value){let Q=this._getOrReturnCtx(J);return F6(Q,{received:Q.data,code:h0.invalid_literal,expected:this._def.value}),N8}return{status:"valid",value:J.data}}get value(){return this._def.value}};MO.create=(J,Q)=>{return new MO({value:J,typeName:R8.ZodLiteral,...l8(Q)})};$B=class $B extends z9{_parse(J){if(typeof J.data!=="string"){let Q=this._getOrReturnCtx(J),Z=this._def.values;return F6(Q,{expected:O9.joinValues(Z),received:Q.parsedType,code:h0.invalid_type}),N8}if(!this._cache)this._cache=new Set(this._def.values);if(!this._cache.has(J.data)){let Q=this._getOrReturnCtx(J),Z=this._def.values;return F6(Q,{received:Q.data,code:h0.invalid_enum_value,options:Z}),N8}return xJ(J.data)}get options(){return this._def.values}get enum(){let J={};for(let Q of this._def.values)J[Q]=Q;return J}get Values(){let J={};for(let Q of this._def.values)J[Q]=Q;return J}get Enum(){let J={};for(let Q of this._def.values)J[Q]=Q;return J}extract(J,Q=this._def){return $B.create(J,{...this._def,...Q})}exclude(J,Q=this._def){return $B.create(this.options.filter((Z)=>!J.includes(Z)),{...this._def,...Q})}};$B.create=tl1;VO=class VO extends z9{_parse(J){let Q=O9.getValidEnumValues(this._def.values),Z=this._getOrReturnCtx(J);if(Z.parsedType!==J6.string&&Z.parsedType!==J6.number){let X=O9.objectValues(Q);return F6(Z,{expected:O9.joinValues(X),received:Z.parsedType,code:h0.invalid_type}),N8}if(!this._cache)this._cache=new Set(O9.getValidEnumValues(this._def.values));if(!this._cache.has(J.data)){let X=O9.objectValues(Q);return F6(Z,{received:Z.data,code:h0.invalid_enum_value,options:X}),N8}return xJ(J.data)}get enum(){return this._def.values}};VO.create=(J,Q)=>{return new VO({values:J,typeName:R8.ZodNativeEnum,...l8(Q)})};gN=class gN extends z9{unwrap(){return this._def.type}_parse(J){let{ctx:Q}=this._processInputParams(J);if(Q.parsedType!==J6.promise&&Q.common.async===!1)return F6(Q,{code:h0.invalid_type,expected:J6.promise,received:Q.parsedType}),N8;let Z=Q.parsedType===J6.promise?Q.data:Promise.resolve(Q.data);return xJ(Z.then((X)=>{return this._def.type.parseAsync(X,{path:Q.path,errorMap:Q.common.contextualErrorMap})}))}};gN.create=(J,Q)=>{return new gN({type:J,typeName:R8.ZodPromise,...l8(Q)})};qG=class qG extends z9{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===R8.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(J){let{status:Q,ctx:Z}=this._processInputParams(J),X=this._def.effect||null,Y={addIssue:(K)=>{if(F6(Z,K),K.fatal)Q.abort();else Q.dirty()},get path(){return Z.path}};if(Y.addIssue=Y.addIssue.bind(Y),X.type==="preprocess"){let K=X.transform(Z.data,Y);if(Z.common.async)return Promise.resolve(K).then(async(G)=>{if(Q.value==="aborted")return N8;let q=await this._def.schema._parseAsync({data:G,path:Z.path,parent:Z});if(q.status==="aborted")return N8;if(q.status==="dirty")return bN(q.value);if(Q.value==="dirty")return bN(q.value);return q});else{if(Q.value==="aborted")return N8;let G=this._def.schema._parseSync({data:K,path:Z.path,parent:Z});if(G.status==="aborted")return N8;if(G.status==="dirty")return bN(G.value);if(Q.value==="dirty")return bN(G.value);return G}}if(X.type==="refinement"){let K=(G)=>{let q=X.refinement(G,Y);if(Z.common.async)return Promise.resolve(q);if(q instanceof Promise)throw Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return G};if(Z.common.async===!1){let G=this._def.schema._parseSync({data:Z.data,path:Z.path,parent:Z});if(G.status==="aborted")return N8;if(G.status==="dirty")Q.dirty();return K(G.value),{status:Q.value,value:G.value}}else return this._def.schema._parseAsync({data:Z.data,path:Z.path,parent:Z}).then((G)=>{if(G.status==="aborted")return N8;if(G.status==="dirty")Q.dirty();return K(G.value).then(()=>{return{status:Q.value,value:G.value}})})}if(X.type==="transform")if(Z.common.async===!1){let K=this._def.schema._parseSync({data:Z.data,path:Z.path,parent:Z});if(!wB(K))return N8;let G=X.transform(K.value,Y);if(G instanceof Promise)throw Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:Q.value,value:G}}else return this._def.schema._parseAsync({data:Z.data,path:Z.path,parent:Z}).then((K)=>{if(!wB(K))return N8;return Promise.resolve(X.transform(K.value,Y)).then((G)=>({status:Q.value,value:G}))});O9.assertNever(X)}};qG.create=(J,Q,Z)=>{return new qG({schema:J,typeName:R8.ZodEffects,effect:Q,...l8(Z)})};qG.createWithPreprocess=(J,Q,Z)=>{return new qG({schema:Q,effect:{type:"preprocess",transform:J},typeName:R8.ZodEffects,...l8(Z)})};KG=class KG extends z9{_parse(J){if(this._getType(J)===J6.undefined)return xJ(void 0);return this._def.innerType._parse(J)}unwrap(){return this._def.innerType}};KG.create=(J,Q)=>{return new KG({innerType:J,typeName:R8.ZodOptional,...l8(Q)})};BW=class BW extends z9{_parse(J){if(this._getType(J)===J6.null)return xJ(null);return this._def.innerType._parse(J)}unwrap(){return this._def.innerType}};BW.create=(J,Q)=>{return new BW({innerType:J,typeName:R8.ZodNullable,...l8(Q)})};NO=class NO extends z9{_parse(J){let{ctx:Q}=this._processInputParams(J),Z=Q.data;if(Q.parsedType===J6.undefined)Z=this._def.defaultValue();return this._def.innerType._parse({data:Z,path:Q.path,parent:Q})}removeDefault(){return this._def.innerType}};NO.create=(J,Q)=>{return new NO({innerType:J,typeName:R8.ZodDefault,defaultValue:typeof Q.default==="function"?Q.default:()=>Q.default,...l8(Q)})};LO=class LO extends z9{_parse(J){let{ctx:Q}=this._processInputParams(J),Z={...Q,common:{...Q.common,issues:[]}},X=this._def.innerType._parse({data:Z.data,path:Z.path,parent:{...Z}});if(GO(X))return X.then((Y)=>{return{status:"valid",value:Y.status==="valid"?Y.value:this._def.catchValue({get error(){return new NZ(Z.common.issues)},input:Z.data})}});else return{status:"valid",value:X.status==="valid"?X.value:this._def.catchValue({get error(){return new NZ(Z.common.issues)},input:Z.data})}}removeCatch(){return this._def.innerType}};LO.create=(J,Q)=>{return new LO({innerType:J,typeName:R8.ZodCatch,catchValue:typeof Q.catch==="function"?Q.catch:()=>Q.catch,...l8(Q)})};ES=class ES extends z9{_parse(J){if(this._getType(J)!==J6.nan){let Z=this._getOrReturnCtx(J);return F6(Z,{code:h0.invalid_type,expected:J6.nan,received:Z.parsedType}),N8}return{status:"valid",value:J.data}}};ES.create=(J)=>{return new ES({typeName:R8.ZodNaN,...l8(J)})};XB6=Symbol("zod_brand");Qc=class Qc extends z9{_parse(J){let{ctx:Q}=this._processInputParams(J),Z=Q.data;return this._def.type._parse({data:Z,path:Q.path,parent:Q})}unwrap(){return this._def.type}};IS=class IS extends z9{_parse(J){let{status:Q,ctx:Z}=this._processInputParams(J);if(Z.common.async)return(async()=>{let Y=await this._def.in._parseAsync({data:Z.data,path:Z.path,parent:Z});if(Y.status==="aborted")return N8;if(Y.status==="dirty")return Q.dirty(),bN(Y.value);else return this._def.out._parseAsync({data:Y.value,path:Z.path,parent:Z})})();else{let X=this._def.in._parseSync({data:Z.data,path:Z.path,parent:Z});if(X.status==="aborted")return N8;if(X.status==="dirty")return Q.dirty(),{status:"dirty",value:X.value};else return this._def.out._parseSync({data:X.value,path:Z.path,parent:Z})}}static create(J,Q){return new IS({in:J,out:Q,typeName:R8.ZodPipeline})}};AO=class AO extends z9{_parse(J){let Q=this._def.innerType._parse(J),Z=(X)=>{if(wB(X))X.value=Object.freeze(X.value);return X};return GO(Q)?Q.then((X)=>Z(X)):Z(Q)}unwrap(){return this._def.innerType}};AO.create=(J,Q)=>{return new AO({innerType:J,typeName:R8.ZodReadonly,...l8(Q)})};YB6={object:_4.lazycreate};(function(J){J.ZodString="ZodString",J.ZodNumber="ZodNumber",J.ZodNaN="ZodNaN",J.ZodBigInt="ZodBigInt",J.ZodBoolean="ZodBoolean",J.ZodDate="ZodDate",J.ZodSymbol="ZodSymbol",J.ZodUndefined="ZodUndefined",J.ZodNull="ZodNull",J.ZodAny="ZodAny",J.ZodUnknown="ZodUnknown",J.ZodNever="ZodNever",J.ZodVoid="ZodVoid",J.ZodArray="ZodArray",J.ZodObject="ZodObject",J.ZodUnion="ZodUnion",J.ZodDiscriminatedUnion="ZodDiscriminatedUnion",J.ZodIntersection="ZodIntersection",J.ZodTuple="ZodTuple",J.ZodRecord="ZodRecord",J.ZodMap="ZodMap",J.ZodSet="ZodSet",J.ZodFunction="ZodFunction",J.ZodLazy="ZodLazy",J.ZodLiteral="ZodLiteral",J.ZodEnum="ZodEnum",J.ZodEffects="ZodEffects",J.ZodNativeEnum="ZodNativeEnum",J.ZodOptional="ZodOptional",J.ZodNullable="ZodNullable",J.ZodDefault="ZodDefault",J.ZodCatch="ZodCatch",J.ZodPromise="ZodPromise",J.ZodBranded="ZodBranded",J.ZodPipeline="ZodPipeline",J.ZodReadonly="ZodReadonly"})(R8||(R8={}));Ji1=XG.create,Qi1=OB.create,GB6=ES.create,qB6=jB.create,Zi1=UO.create,zB6=yN.create,UB6=RS.create,WB6=WO.create,FB6=FO.create,HB6=fN.create,BB6=RB.create,DB6=Zz.create,MB6=OS.create,VB6=YG.create,NB6=_4.create,LB6=_4.strictCreate,AB6=HO.create,wB6=Jc.create,RB6=BO.create,OB6=Xz.create,jB6=jS.create,$B6=$S.create,EB6=hN.create,IB6=zO.create,PB6=DO.create,TB6=MO.create,CB6=$B.create,SB6=VO.create,vB6=gN.create,kB6=qG.create,_B6=KG.create,xB6=BW.create,bB6=qG.createWithPreprocess,yB6=IS.create,mB6={string:(J)=>XG.create({...J,coerce:!0}),number:(J)=>OB.create({...J,coerce:!0}),boolean:(J)=>UO.create({...J,coerce:!0}),bigint:(J)=>jB.create({...J,coerce:!0}),date:(J)=>yN.create({...J,coerce:!0})},uB6=N8});var Q1={};E6(Q1,{void:()=>MB6,util:()=>O9,unknown:()=>BB6,union:()=>AB6,undefined:()=>WB6,tuple:()=>OB6,transformer:()=>kB6,symbol:()=>UB6,string:()=>Ji1,strictObject:()=>LB6,setErrorMap:()=>xH6,set:()=>EB6,record:()=>jB6,quotelessJson:()=>kH6,promise:()=>vB6,preprocess:()=>bB6,pipeline:()=>yB6,ostring:()=>fB6,optional:()=>_B6,onumber:()=>hB6,oboolean:()=>gB6,objectUtil:()=>eZ1,object:()=>NB6,number:()=>Qi1,nullable:()=>xB6,null:()=>FB6,never:()=>DB6,nativeEnum:()=>SB6,nan:()=>GB6,map:()=>$B6,makeIssue:()=>wS,literal:()=>TB6,lazy:()=>PB6,late:()=>YB6,isValid:()=>wB,isDirty:()=>ed,isAsync:()=>GO,isAborted:()=>td,intersection:()=>RB6,instanceof:()=>KB6,getParsedType:()=>Qz,getErrorMap:()=>KO,function:()=>IB6,enum:()=>CB6,effect:()=>kB6,discriminatedUnion:()=>wB6,defaultErrorMap:()=>FW,datetimeRegex:()=>ol1,date:()=>zB6,custom:()=>el1,coerce:()=>mB6,boolean:()=>Zi1,bigint:()=>qB6,array:()=>VB6,any:()=>HB6,addIssueToContext:()=>F6,ZodVoid:()=>OS,ZodUnknown:()=>RB,ZodUnion:()=>HO,ZodUndefined:()=>WO,ZodType:()=>z9,ZodTuple:()=>Xz,ZodTransformer:()=>qG,ZodSymbol:()=>RS,ZodString:()=>XG,ZodSet:()=>hN,ZodSchema:()=>z9,ZodRecord:()=>jS,ZodReadonly:()=>AO,ZodPromise:()=>gN,ZodPipeline:()=>IS,ZodParsedType:()=>J6,ZodOptional:()=>KG,ZodObject:()=>_4,ZodNumber:()=>OB,ZodNullable:()=>BW,ZodNull:()=>FO,ZodNever:()=>Zz,ZodNativeEnum:()=>VO,ZodNaN:()=>ES,ZodMap:()=>$S,ZodLiteral:()=>MO,ZodLazy:()=>DO,ZodIssueCode:()=>h0,ZodIntersection:()=>BO,ZodFunction:()=>zO,ZodFirstPartyTypeKind:()=>R8,ZodError:()=>NZ,ZodEnum:()=>$B,ZodEffects:()=>qG,ZodDiscriminatedUnion:()=>Jc,ZodDefault:()=>NO,ZodDate:()=>yN,ZodCatch:()=>LO,ZodBranded:()=>Qc,ZodBoolean:()=>UO,ZodBigInt:()=>jB,ZodArray:()=>YG,ZodAny:()=>fN,Schema:()=>z9,ParseStatus:()=>QJ,OK:()=>xJ,NEVER:()=>uB6,INVALID:()=>N8,EMPTY_PATH:()=>bH6,DIRTY:()=>bN,BRAND:()=>XB6});var YX1=B1(()=>{od();QX1();ll1();AS();Xi1();sd()});var DW=B1(()=>{YX1();YX1()});function dB6(J){return Yi1.safeParse(J)}function EB(J){return pB6.safeParse(J)}function wO(J){if(!J||!Array.isArray(J))return[];let Q=[];for(let[Z,X]of J.entries()){let Y=dB6(X);if(Y.success)Q.push(Y.data);else{let K=typeof X==="object"&&X!==null&&"tool"in X?String(X.tool):`entry at index ${Z}`;u.warn(`Permission entry for tool "${K}" is invalid: ${Y.error.errors.map((G)=>`${G.path.join(".")}: ${G.message}`).join(", ")}`)}}return Q}var KX1,Yi1,pB6;var mN=B1(()=>{DW();G0();KX1=Q1.lazy(()=>Q1.union([Q1.string().describe('Pattern match where "*" matches any number of any characters'),Q1.array(KX1).min(1).describe("OR match of each entry"),Q1.boolean().describe("A literal boolean match"),Q1.number().describe("A literal number match"),Q1.null().describe("A literal null match"),Q1.undefined().describe("A literal undefined match"),Q1.record(Q1.string(),KX1).describe("Matching individual keys of an object")])),Yi1=Q1.object({tool:Q1.string().min(1).describe("The name of the tool to which this entry applies"),matches:Q1.record(Q1.string(),KX1).optional().describe("Maps tool inputs to conditions"),action:Q1.enum(["allow","reject","ask","delegate"]).describe("How Amp should proceed in case of a match"),context:Q1.enum(["thread","subagent"]).optional().describe("Only apply this entry in this context"),to:Q1.string().min(1).optional().describe('Command to delegate to when action is "delegate"')}).superRefine((J,Q)=>{if(J.action==="delegate"&&!J.to)Q.addIssue({code:Q1.ZodIssueCode.custom,message:'delegate action requires "to" field',path:["to"]});if(J.action!=="delegate"&&J.to)Q.addIssue({code:Q1.ZodIssueCode.custom,message:'"to" field only allowed with delegate action',path:["to"]})}),pB6=Q1.array(Yi1).describe("Entries checked in sequence to configure tool permissions")});function ZJ(J,Q){let Z=cB6(J,Q);return typeof Z==="string"?Z:Z.toString()}function cB6(J,Q,Z=!0){if(!Q)Q=lB6();let{workspaceFolders:X,isWindows:Y,homeDir:K}=Q,G=typeof J==="string"?$0.parse(J):$0.from(J);if(X)for(let q of X){let z=V8(q);if(y0.hasPrefix(G,z)){let U=z.path.endsWith("/")?z.path.slice(0,-1):z.path,F=Z&&X&&X.length>=2?LN(z.path)+(Y?"\\":"/"):"";return GX1(F+G.path.slice(U.length+1),Y,G.scheme)}}if(G?.scheme==="file"){if(K){let q=V8(K);if(y0.hasPrefix(G,q)){let z=q.path.endsWith("/")?q.path.slice(0,-1):q.path,U=G.path.slice(z.length+1);return GX1("~"+(Y?"\\":"/")+U,Y,G.scheme)}}return GX1(G.fsPath,Y,G.scheme)}return G}function GX1(J,Q,Z){return Q&&Z==="file"?J.replaceAll("/","\\"):J}function Xc(J){let Q=Zc;return Zc=J,Q}function lB6(){if(Zc)return Zc;throw Error("must call setDisplayPathEnvInfo before calling displayPath() and related functions")}var Zc=null;var MW=B1(()=>{k6();mR();Ud()});function bJ(J,...Q){throw Error(`[Immer] minified error nr: ${J}. Full error at: https://bit.ly/3cXEKWf`)}function dN(J){return!!J&&!!J[TX]}function IB(J){if(!J)return!1;return Ui1(J)||Array.isArray(J)||!!J[PS]||!!J.constructor?.[PS]||kS(J)||_S(J)}function Ui1(J){if(!J||typeof J!=="object")return!1;let Q=pN(J);if(Q===null)return!0;let Z=Object.hasOwnProperty.call(Q,"constructor")&&Q.constructor;if(Z===Object)return!0;return typeof Z=="function"&&Function.toString.call(Z)===iB6}function TS(J,Q){if(cN(J)===0)Reflect.ownKeys(J).forEach((Z)=>{Q(Z,J[Z],J)});else J.forEach((Z,X)=>Q(X,Z,J))}function cN(J){let Q=J[TX];return Q?Q.type_:Array.isArray(J)?1:kS(J)?2:_S(J)?3:0}function CS(J,Q){return cN(J)===2?J.has(Q):Object.prototype.hasOwnProperty.call(J,Q)}function qX1(J,Q){return cN(J)===2?J.get(Q):J[Q]}function Wi1(J,Q,Z){let X=cN(J);if(X===2)J.set(Q,Z);else if(X===3)J.add(Z);else J[Q]=Z}function aB6(J,Q){if(J===Q)return J!==0||1/J===1/Q;else return J!==J&&Q!==Q}function kS(J){return J instanceof Map}function _S(J){return J instanceof Set}function uN(J){return J.copy_||J.base_}function WX1(J,Q){if(kS(J))return new Map(J);if(_S(J))return new Set(J);if(Array.isArray(J))return Array.prototype.slice.call(J);let Z=Ui1(J);if(Q===!0||Q==="class_only"&&!Z){let X=Object.getOwnPropertyDescriptors(J);delete X[TX];let Y=Reflect.ownKeys(X);for(let K=0;K<Y.length;K++){let G=Y[K],q=X[G];if(q.writable===!1)q.writable=!0,q.configurable=!0;if(q.get||q.set)X[G]={configurable:!0,writable:!0,enumerable:q.enumerable,value:J[G]}}return Object.create(pN(J),X)}else{let X=pN(J);if(X!==null&&Z)return{...J};let Y=Object.create(X);return Object.assign(Y,J)}}function $Q(J,Q=!1){if(Gc(J)||dN(J)||!IB(J))return J;if(cN(J)>1)J.set=J.add=J.clear=J.delete=nB6;if(Object.freeze(J),Q)Object.entries(J).forEach(([Z,X])=>$Q(X,!0));return J}function nB6(){bJ(2)}function Gc(J){return Object.isFrozen(J)}function lN(J){let Q=FX1[J];if(!Q)bJ(0,J);return Q}function rB6(J,Q){if(!FX1[J])FX1[J]=Q}function Fi1(){return SS}function sB6(J,Q){return{drafts_:[],parent_:J,immer_:Q,canAutoFreeze_:!0,unfinalizedDrafts_:0}}function Ki1(J,Q){if(Q)lN("Patches"),J.patches_=[],J.inversePatches_=[],J.patchListener_=Q}function HX1(J){BX1(J),J.drafts_.forEach(oB6),J.drafts_=null}function BX1(J){if(J===SS)SS=J.parent_}function Gi1(J){return SS=sB6(SS,J)}function oB6(J){let Q=J[TX];if(Q.type_===0||Q.type_===1)Q.revoke_();else Q.revoked_=!0}function qi1(J,Q){Q.unfinalizedDrafts_=Q.drafts_.length;let Z=Q.drafts_[0];if(J!==void 0&&J!==Z){if(Z[TX].modified_)HX1(Q),bJ(4);if(IB(J)){if(J=Yc(Q,J),!Q.parent_)Kc(Q,J)}if(Q.patches_)lN("Patches").generateReplacementPatches_(Z[TX].base_,J,Q.patches_,Q.inversePatches_)}else J=Yc(Q,Z,[]);if(HX1(Q),Q.patches_)Q.patchListener_(Q.patches_,Q.inversePatches_);return J!==VX1?J:void 0}function Yc(J,Q,Z){if(Gc(Q))return Q;let X=Q[TX];if(!X)return TS(Q,(Y,K)=>zi1(J,X,Q,Y,K,Z)),Q;if(X.scope_!==J)return Q;if(!X.modified_)return Kc(J,X.base_,!0),X.base_;if(!X.finalized_){X.finalized_=!0,X.scope_.unfinalizedDrafts_--;let Y=X.copy_,K=Y,G=!1;if(X.type_===3)K=new Set(Y),Y.clear(),G=!0;if(TS(K,(q,z)=>zi1(J,X,Y,q,z,Z,G)),Kc(J,Y,!1),Z&&J.patches_)lN("Patches").generatePatches_(X,Z,J.patches_,J.inversePatches_)}return X.copy_}function zi1(J,Q,Z,X,Y,K,G){if(dN(Y)){let q=K&&Q&&Q.type_!==3&&!CS(Q.assigned_,X)?K.concat(X):void 0,z=Yc(J,Y,q);if(Wi1(Z,X,z),dN(z))J.canAutoFreeze_=!1;else return}else if(G)Z.add(Y);if(IB(Y)&&!Gc(Y)){if(!J.immer_.autoFreeze_&&J.unfinalizedDrafts_<1)return;if(Yc(J,Y),(!Q||!Q.scope_.parent_)&&typeof X!=="symbol"&&Object.prototype.propertyIsEnumerable.call(Z,X))Kc(J,Y)}}function Kc(J,Q,Z=!1){if(!J.parent_&&J.immer_.autoFreeze_&&J.canAutoFreeze_)$Q(Q,Z)}function tB6(J,Q){let Z=Array.isArray(J),X={type_:Z?1:0,scope_:Q?Q.scope_:Fi1(),modified_:!1,finalized_:!1,assigned_:{},parent_:Q,base_:J,draft_:null,copy_:null,revoke_:null,isManual_:!1},Y=X,K=NX1;if(Z)Y=[X],K=vS;let{revoke:G,proxy:q}=Proxy.revocable(Y,K);return X.draft_=q,X.revoke_=G,q}function zX1(J,Q){let Z=J[TX];return(Z?uN(Z):J)[Q]}function eB6(J,Q,Z){let X=Hi1(Q,Z);return X?"value"in X?X.value:X.get?.call(J.draft_):void 0}function Hi1(J,Q){if(!(Q in J))return;let Z=pN(J);while(Z){let X=Object.getOwnPropertyDescriptor(Z,Q);if(X)return X;Z=pN(Z)}return}function DX1(J){if(!J.modified_){if(J.modified_=!0,J.parent_)DX1(J.parent_)}}function UX1(J){if(!J.copy_)J.copy_=WX1(J.base_,J.scope_.immer_.useStrictShallowCopy_)}function MX1(J,Q){let Z=kS(J)?lN("MapSet").proxyMap_(J,Q):_S(J)?lN("MapSet").proxySet_(J,Q):tB6(J,Q);return(Q?Q.scope_:Fi1()).drafts_.push(Z),Z}function QD6(J){if(!dN(J))bJ(10,J);return Bi1(J)}function Bi1(J){if(!IB(J)||Gc(J))return J;let Q=J[TX],Z;if(Q){if(!Q.modified_)return Q.base_;Q.finalized_=!0,Z=WX1(J,Q.scope_.immer_.useStrictShallowCopy_)}else Z=WX1(J,!0);if(TS(Z,(X,Y)=>{Wi1(Z,X,Bi1(Y))}),Q)Q.finalized_=!1;return Z}function qc(){let Q="replace",Z="add",X="remove";function Y(H,B,M,V){switch(H.type_){case 0:case 2:return G(H,B,M,V);case 1:return K(H,B,M,V);case 3:return q(H,B,M,V)}}function K(H,B,M,V){let{base_:N,assigned_:L}=H,A=H.copy_;if(A.length<N.length)[N,A]=[A,N],[M,V]=[V,M];for(let w=0;w<N.length;w++)if(L[w]&&A[w]!==N[w]){let R=B.concat([w]);M.push({op:Q,path:R,value:F(A[w])}),V.push({op:Q,path:R,value:F(N[w])})}for(let w=N.length;w<A.length;w++){let R=B.concat([w]);M.push({op:Z,path:R,value:F(A[w])})}for(let w=A.length-1;N.length<=w;--w){let R=B.concat([w]);V.push({op:X,path:R})}}function G(H,B,M,V){let{base_:N,copy_:L}=H;TS(H.assigned_,(A,w)=>{let R=qX1(N,A),O=qX1(L,A),$=!w?X:CS(N,A)?Q:Z;if(R===O&&$===Q)return;let j=B.concat(A);M.push($===X?{op:$,path:j}:{op:$,path:j,value:O}),V.push($===Z?{op:X,path:j}:$===X?{op:Z,path:j,value:F(R)}:{op:Q,path:j,value:F(R)})})}function q(H,B,M,V){let{base_:N,copy_:L}=H,A=0;N.forEach((w)=>{if(!L.has(w)){let R=B.concat([A]);M.push({op:X,path:R,value:w}),V.unshift({op:Z,path:R,value:w})}A++}),A=0,L.forEach((w)=>{if(!N.has(w)){let R=B.concat([A]);M.push({op:Z,path:R,value:w}),V.unshift({op:X,path:R,value:w})}A++})}function z(H,B,M,V){M.push({op:Q,path:[],value:B===VX1?void 0:B}),V.push({op:Q,path:[],value:H})}function U(H,B){return B.forEach((M)=>{let{path:V,op:N}=M,L=H;for(let O=0;O<V.length-1;O++){let $=cN(L),j=V[O];if(typeof j!=="string"&&typeof j!=="number")j=""+j;if(($===0||$===1)&&(j==="__proto__"||j==="constructor"))bJ(19);if(typeof L==="function"&&j==="prototype")bJ(19);if(L=qX1(L,j),typeof L!=="object")bJ(18,V.join("/"))}let A=cN(L),w=W(M.value),R=V[V.length-1];switch(N){case Q:switch(A){case 2:return L.set(R,w);case 3:bJ(16);default:return L[R]=w}case Z:switch(A){case 1:return R==="-"?L.push(w):L.splice(R,0,w);case 2:return L.set(R,w);case 3:return L.add(w);default:return L[R]=w}case X:switch(A){case 1:return L.splice(R,1);case 2:return L.delete(R);case 3:return L.delete(M.value);default:return delete L[R]}default:bJ(17,N)}}),H}function W(H){if(!IB(H))return H;if(Array.isArray(H))return H.map(W);if(kS(H))return new Map(Array.from(H.entries()).map(([M,V])=>[M,W(V)]));if(_S(H))return new Set(Array.from(H).map(W));let B=Object.create(pN(H));for(let M in H)B[M]=W(H[M]);if(CS(H,PS))B[PS]=H[PS];return B}function F(H){if(dN(H))return W(H);else return H}rB6("Patches",{applyPatches_:U,generatePatches_:Y,generateReplacementPatches_:z})}function i8(J){return J}var VX1,PS,TX,pN,iB6,FX1,SS,NX1,vS,JD6=class{constructor(J){if(this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.produce=(Q,Z,X)=>{if(typeof Q==="function"&&typeof Z!=="function"){let K=Z;Z=Q;let G=this;return function(z=K,...U){return G.produce(z,(W)=>Z.call(this,W,...U))}}if(typeof Z!=="function")bJ(6);if(X!==void 0&&typeof X!=="function")bJ(7);let Y;if(IB(Q)){let K=Gi1(this),G=MX1(Q,void 0),q=!0;try{Y=Z(G),q=!1}finally{if(q)HX1(K);else BX1(K)}return Ki1(K,X),qi1(Y,K)}else if(!Q||typeof Q!=="object"){if(Y=Z(Q),Y===void 0)Y=Q;if(Y===VX1)Y=void 0;if(this.autoFreeze_)$Q(Y,!0);if(X){let K=[],G=[];lN("Patches").generateReplacementPatches_(Q,Y,K,G),X(K,G)}return Y}else bJ(1,Q)},this.produceWithPatches=(Q,Z)=>{if(typeof Q==="function")return(G,...q)=>this.produceWithPatches(G,(z)=>Q(z,...q));let X,Y;return[this.produce(Q,Z,(G,q)=>{X=G,Y=q}),X,Y]},typeof J?.autoFreeze==="boolean")this.setAutoFreeze(J.autoFreeze);if(typeof J?.useStrictShallowCopy==="boolean")this.setUseStrictShallowCopy(J.useStrictShallowCopy)}createDraft(J){if(!IB(J))bJ(8);if(dN(J))J=QD6(J);let Q=Gi1(this),Z=MX1(J,void 0);return Z[TX].isManual_=!0,BX1(Q),Z}finishDraft(J,Q){let Z=J&&J[TX];if(!Z||!Z.isManual_)bJ(9);let{scope_:X}=Z;return Ki1(X,Q),qi1(void 0,X)}setAutoFreeze(J){this.autoFreeze_=J}setUseStrictShallowCopy(J){this.useStrictShallowCopy_=J}applyPatches(J,Q){let Z;for(Z=Q.length-1;Z>=0;Z--){let Y=Q[Z];if(Y.path.length===0&&Y.op==="replace"){J=Y.value;break}}if(Z>-1)Q=Q.slice(Z+1);let X=lN("Patches").applyPatches_;if(dN(J))return X(J,Q);return this.produce(J,(Y)=>X(Y,Q))}},CX,PB,xS,wW9,RW9,Di1,OW9,jW9;var EQ=B1(()=>{VX1=Symbol.for("immer-nothing"),PS=Symbol.for("immer-draftable"),TX=Symbol.for("immer-state");pN=Object.getPrototypeOf;iB6=Object.prototype.constructor.toString();FX1={};NX1={get(J,Q){if(Q===TX)return J;let Z=uN(J);if(!CS(Z,Q))return eB6(J,Z,Q);let X=Z[Q];if(J.finalized_||!IB(X))return X;if(X===zX1(J.base_,Q))return UX1(J),J.copy_[Q]=MX1(X,J);return X},has(J,Q){return Q in uN(J)},ownKeys(J){return Reflect.ownKeys(uN(J))},set(J,Q,Z){let X=Hi1(uN(J),Q);if(X?.set)return X.set.call(J.draft_,Z),!0;if(!J.modified_){let Y=zX1(uN(J),Q),K=Y?.[TX];if(K&&K.base_===Z)return J.copy_[Q]=Z,J.assigned_[Q]=!1,!0;if(aB6(Z,Y)&&(Z!==void 0||CS(J.base_,Q)))return!0;UX1(J),DX1(J)}if(J.copy_[Q]===Z&&(Z!==void 0||(Q in J.copy_))||Number.isNaN(Z)&&Number.isNaN(J.copy_[Q]))return!0;return J.copy_[Q]=Z,J.assigned_[Q]=!0,!0},deleteProperty(J,Q){if(zX1(J.base_,Q)!==void 0||Q in J.base_)J.assigned_[Q]=!1,UX1(J),DX1(J);else delete J.assigned_[Q];if(J.copy_)delete J.copy_[Q];return!0},getOwnPropertyDescriptor(J,Q){let Z=uN(J),X=Reflect.getOwnPropertyDescriptor(Z,Q);if(!X)return X;return{writable:!0,configurable:J.type_!==1||Q!=="length",enumerable:X.enumerable,value:Z[Q]}},defineProperty(){bJ(11)},getPrototypeOf(J){return pN(J.base_)},setPrototypeOf(){bJ(12)}},vS={};TS(NX1,(J,Q)=>{vS[J]=function(){return arguments[0]=arguments[0][0],Q.apply(this,arguments)}});vS.deleteProperty=function(J,Q){return vS.set.call(this,J,Q,void 0)};vS.set=function(J,Q,Z){return NX1.set.call(this,J[0],Q,Z,J[0])};CX=new JD6,PB=CX.produce,xS=CX.produceWithPatches.bind(CX),wW9=CX.setAutoFreeze.bind(CX),RW9=CX.setUseStrictShallowCopy.bind(CX),Di1=CX.applyPatches.bind(CX),OW9=CX.createDraft.bind(CX),jW9=CX.finishDraft.bind(CX)});function LX1({onlyFirst:J=!1}={}){let Z=["[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?(?:\\u0007|\\u001B\\u005C|\\u009C))","(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-nq-uy=><~]))"].join("|");return new RegExp(Z,J?void 0:"g")}function bS(J){if(typeof J!=="string")throw TypeError(`Expected a \`string\`, got \`${typeof J}\``);return J.replace(ZD6,"")}var ZD6;var AX1=B1(()=>{ZD6=LX1()});var Vi1=t((CW9,Mi1)=>{Mi1.exports=()=>{return/[#*0-9]\uFE0F?\u20E3|[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23ED-\u23EF\u23F1\u23F2\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB\u25FC\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692\u2694-\u2697\u2699\u269B\u269C\u26A0\u26A7\u26AA\u26B0\u26B1\u26BD\u26BE\u26C4\u26C8\u26CF\u26D1\u26E9\u26F0-\u26F5\u26F7\u26F8\u26FA\u2702\u2708\u2709\u270F\u2712\u2714\u2716\u271D\u2721\u2733\u2734\u2744\u2747\u2757\u2763\u27A1\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B55\u3030\u303D\u3297\u3299]\uFE0F?|[\u261D\u270C\u270D](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?|[\u270A\u270B](?:\uD83C[\uDFFB-\uDFFF])?|[\u23E9-\u23EC\u23F0\u23F3\u25FD\u2693\u26A1\u26AB\u26C5\u26CE\u26D4\u26EA\u26FD\u2705\u2728\u274C\u274E\u2753-\u2755\u2795-\u2797\u27B0\u27BF\u2B50]|\u26D3\uFE0F?(?:\u200D\uD83D\uDCA5)?|\u26F9(?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|\u2764\uFE0F?(?:\u200D(?:\uD83D\uDD25|\uD83E\uDE79))?|\uD83C(?:[\uDC04\uDD70\uDD71\uDD7E\uDD7F\uDE02\uDE37\uDF21\uDF24-\uDF2C\uDF36\uDF7D\uDF96\uDF97\uDF99-\uDF9B\uDF9E\uDF9F\uDFCD\uDFCE\uDFD4-\uDFDF\uDFF5\uDFF7]\uFE0F?|[\uDF85\uDFC2\uDFC7](?:\uD83C[\uDFFB-\uDFFF])?|[\uDFC4\uDFCA](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDFCB\uDFCC](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDCCF\uDD8E\uDD91-\uDD9A\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF43\uDF45-\uDF4A\uDF4C-\uDF7C\uDF7E-\uDF84\uDF86-\uDF93\uDFA0-\uDFC1\uDFC5\uDFC6\uDFC8\uDFC9\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF8-\uDFFF]|\uDDE6\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF]|\uDDE7\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF]|\uDDE8\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF7\uDDFA-\uDDFF]|\uDDE9\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF]|\uDDEA\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA]|\uDDEB\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7]|\uDDEC\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE]|\uDDED\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA]|\uDDEE\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9]|\uDDEF\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5]|\uDDF0\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF]|\uDDF1\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE]|\uDDF2\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF]|\uDDF3\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF]|\uDDF4\uD83C\uDDF2|\uDDF5\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE]|\uDDF6\uD83C\uDDE6|\uDDF7\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC]|\uDDF8\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF]|\uDDF9\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF]|\uDDFA\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF]|\uDDFB\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA]|\uDDFC\uD83C[\uDDEB\uDDF8]|\uDDFD\uD83C\uDDF0|\uDDFE\uD83C[\uDDEA\uDDF9]|\uDDFF\uD83C[\uDDE6\uDDF2\uDDFC]|\uDF44(?:\u200D\uD83D\uDFEB)?|\uDF4B(?:\u200D\uD83D\uDFE9)?|\uDFC3(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDFF3\uFE0F?(?:\u200D(?:\u26A7\uFE0F?|\uD83C\uDF08))?|\uDFF4(?:\u200D\u2620\uFE0F?|\uDB40\uDC67\uDB40\uDC62\uDB40(?:\uDC65\uDB40\uDC6E\uDB40\uDC67|\uDC73\uDB40\uDC63\uDB40\uDC74|\uDC77\uDB40\uDC6C\uDB40\uDC73)\uDB40\uDC7F)?)|\uD83D(?:[\uDC3F\uDCFD\uDD49\uDD4A\uDD6F\uDD70\uDD73\uDD76-\uDD79\uDD87\uDD8A-\uDD8D\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA\uDECB\uDECD-\uDECF\uDEE0-\uDEE5\uDEE9\uDEF0\uDEF3]\uFE0F?|[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC](?:\uD83C[\uDFFB-\uDFFF])?|[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4\uDEB5](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD74\uDD90](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?|[\uDC00-\uDC07\uDC09-\uDC14\uDC16-\uDC25\uDC27-\uDC3A\uDC3C-\uDC3E\uDC40\uDC44\uDC45\uDC51-\uDC65\uDC6A\uDC79-\uDC7B\uDC7D-\uDC80\uDC84\uDC88-\uDC8E\uDC90\uDC92-\uDCA9\uDCAB-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDDA4\uDDFB-\uDE2D\uDE2F-\uDE34\uDE37-\uDE41\uDE43\uDE44\uDE48-\uDE4A\uDE80-\uDEA2\uDEA4-\uDEB3\uDEB7-\uDEBF\uDEC1-\uDEC5\uDED0-\uDED2\uDED5-\uDED7\uDEDC-\uDEDF\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB\uDFF0]|\uDC08(?:\u200D\u2B1B)?|\uDC15(?:\u200D\uD83E\uDDBA)?|\uDC26(?:\u200D(?:\u2B1B|\uD83D\uDD25))?|\uDC3B(?:\u200D\u2744\uFE0F?)?|\uDC41\uFE0F?(?:\u200D\uD83D\uDDE8\uFE0F?)?|\uDC68(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDC68\uDC69]\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFE])))?))?|\uDC69(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?[\uDC68\uDC69]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?|\uDC69\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?))|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFE])))?))?|\uDC6F(?:\u200D[\u2640\u2642]\uFE0F?)?|\uDD75(?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|\uDE2E(?:\u200D\uD83D\uDCA8)?|\uDE35(?:\u200D\uD83D\uDCAB)?|\uDE36(?:\u200D\uD83C\uDF2B\uFE0F?)?|\uDE42(?:\u200D[\u2194\u2195]\uFE0F?)?|\uDEB6(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?)|\uD83E(?:[\uDD0C\uDD0F\uDD18-\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5\uDEC3-\uDEC5\uDEF0\uDEF2-\uDEF8](?:\uD83C[\uDFFB-\uDFFF])?|[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD\uDDCF\uDDD4\uDDD6-\uDDDD](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDDDE\uDDDF](?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD0D\uDD0E\uDD10-\uDD17\uDD20-\uDD25\uDD27-\uDD2F\uDD3A\uDD3F-\uDD45\uDD47-\uDD76\uDD78-\uDDB4\uDDB7\uDDBA\uDDBC-\uDDCC\uDDD0\uDDE0-\uDDFF\uDE70-\uDE7C\uDE80-\uDE89\uDE8F-\uDEC2\uDEC6\uDECE-\uDEDC\uDEDF-\uDEE9]|\uDD3C(?:\u200D[\u2640\u2642]\uFE0F?|\uD83C[\uDFFB-\uDFFF])?|\uDDCE(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDDD1(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1|\uDDD1\u200D\uD83E\uDDD2(?:\u200D\uD83E\uDDD2)?|\uDDD2(?:\u200D\uD83E\uDDD2)?))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?))?|\uDEF1(?:\uD83C(?:\uDFFB(?:\u200D\uD83E\uDEF2\uD83C[\uDFFC-\uDFFF])?|\uDFFC(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFD-\uDFFF])?|\uDFFD(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])?|\uDFFE(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFD\uDFFF])?|\uDFFF(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFE])?))?)/g}});function XD6(J){return typeof J==="number"&&Number.isInteger(J)&&J>=1&&J<=3600}function Li1(J){let Q=J.settings["tools.inactivityTimeout"],Z=J.settings["tools.stopTimeout"],X=Q;if(X===void 0&&Z!==void 0)X=Z;if(X===void 0)X=JO.contributes.configuration.properties["amp.tools.inactivityTimeout"].default;if(!XD6(X))return null;return X*1000}function Ai1(J){let Q=J.settings["tools.stopTimeout"],Z=JO.contributes.configuration.properties["amp.tools.stopTimeout"].default;return(Q??Z)*1000}var Ni1;var zc=B1(()=>{pZ1();Ni1=JO.contributes.configuration.properties});function Uc(J,Q){return new t1((Z)=>{let X=setTimeout(Y,Q);function Y(){Z.error(Error(`Tool execution timed out after ${Q/1000} seconds`))}function K(){if(X)clearTimeout(X);X=setTimeout(Y,Q)}let G=J.subscribe({next:(q)=>{K(),Z.next(q)},error:(q)=>{if(X)clearTimeout(X),X=null;Z.error(q)},complete:()=>{if(X)clearTimeout(X),X=null;Z.complete()}});return()=>{if(X)clearTimeout(X),X=null;G.unsubscribe()}})}var wX1=B1(()=>{v0()});function x4(J,Q){let Z={name:Q.name,description:Q.description,inputSchema:Q.inputSchema,source:Q.source,meta:Q.meta,customizedForModel:!1},X=Q.modelCustomizations;if(X){for(let Y of X)if(Y.modelSelector.test(J))Z={...Z,name:Y.name??Z.name,description:Y.description??Z.description,inputSchema:Y.inputSchema??Z.inputSchema,customizedForModel:!0}}return Z}function yJ(J){return["done","error","rejected-by-user","cancelled"].includes(J.status)}function Oi1(J){return["done","error","cancelled"].includes(J.status)}function RO(J){let Q=[],Z=new k8;function X(K,G){let q=Q.filter((z)=>z.spec.name===K);if(q.length===0&&K==="Glob")q=Q.filter((z)=>z.spec.name==="glob");for(let z of q)if(yS(z.spec,G).enabled)return z;return}function Y(K,G,q){if(!K)throw Error("spec is required");let z={spec:K,fn:Promise.resolve(G),preprocessArgs:q};return Q.push(z),Z.next(),{dispose:()=>{let U=Q.indexOf(z);if(U!==-1)Q.splice(U,1),Z.next()}}}return{registerTool({spec:K,fn:G,preprocessArgs:q}){if(!G)return YD6;return Y(K,G,q)},tools:x9(J.configService.config,Z.pipe(u2(void 0))).pipe(b0(([K])=>{return Q.map((G)=>({spec:G.spec,...yS(G.spec,K)})).sort((G,q)=>G.spec.name.localeCompare(q.spec.name))})),invokeTool(K,G,q){let z=performance.now(),U=()=>KD6.record(performance.now()-z,{toolName:K});if(K===OX1&&G.args&&"invalid_tool_name"in G.args&&typeof G.args.invalid_tool_name==="string"){Fc.add(1,{toolName:K,error:"invalid"});let F=RX1(G.args.invalid_tool_name);return new t1((H)=>{H.error(Error(F))})}let W=X(K,q.config);if(!W){let F=Q.filter((V)=>V.spec.name===K);if(F.length===0)return Fc.add(1,{toolName:K,error:"not_found"}),new t1((V)=>{V.error(Error(`tool ${JSON.stringify(K)} not found`))});let H=F[0],B=yS(H.spec,q.config);Fc.add(1,{toolName:K,error:"disabled"});let M=B.enabled?"unknown":B.disabledReason;return new t1((V)=>{V.error(Error(`tool ${JSON.stringify(K)} is disabled: ${M}`))})}return Fc.add(1,{toolName:K}),c6(()=>W.fn).pipe(q8((F)=>{let H=F(G,q);if(W.spec.meta?.disableTimeout)return H;return Uc(H,Ai1(q.config))}),zW(()=>U()))},preprocessArgs(K,G,q){let z=X(K,q.config);if(!z||!z.preprocessArgs)return;let U=z.preprocessArgs;try{return U(G,q)}catch(W){u.error("preprocessArgs",{id:K,args:G,error:String(W)});return}},dispose(){}}}function Wc(J,Q){for(let Z of Q){if(Z==="")continue;if(Z.length===1){if(Z==="*")return!0;if(Z===J)return!0;continue}if(J===Z)return!0;if(Z.includes("*")||Z.includes("?")||Z.includes("[")||Z.includes("{"))try{if(Ri1.default(Z,{dot:!0})(J))return!0}catch(X){continue}}return!1}function yS(J,Q){let Z=Q.settings?.["tools.disable"]??[];if(Wc(J.name,Z))return{enabled:!1,disabledReason:"settings"};if(typeof J.source==="object"&&"mcp"in J.source){let X=$i1(J.name);if(X&&J.source.mcp===X.server&&Wc(X.tool,Z))return{enabled:!1,disabledReason:"settings"}}if(J.source==="builtin"&&Wc(`builtin:${J.name}`,Z))return{enabled:!1,disabledReason:"settings"};if(typeof J.source==="object"&&"toolbox"in J.source&&Wc(`toolbox:${J.name}`,Z))return{enabled:!1,disabledReason:"settings"};if(J.name===JJ||J.name===MB){if(Q.settings?.["todos.enabled"])return{enabled:!0};return{enabled:!1,disabledReason:"feature-flag"}}return{enabled:!0}}function RX1(J){return`Invalid tool name ${JSON.stringify(J)}. Tool names must match the pattern ${fS.toString()}. Try again with a valid tool name.`}function $i1(J){let[,Q,Z]=J.split(/mcp__([^ ]+)__([^ ]+)/);if(Q&&Z)return{server:Q,tool:Z};return}function jX1(J){if(J.status==="in-progress"||J.status==="done"||J.status==="cancelled"||J.status==="error")return J.progress;return}function LZ(J,Q,Z=!0){let X=new Set(Q.map((K)=>K.spec.name));function Y(K){if(X.has(K))return!0;if(K==="Glob"&&X.has("glob"))return!0;if(Z&&$i1(K))return!0;return!1}return{registerTool(K){throw Error("Tools should not be registered in a filtered tool service")},invokeTool(K,G,q){if(!Y(K))return new t1((z)=>{z.error(Error(`tool ${JSON.stringify(K)} not allowed in filtered service`))});return J.invokeTool(K,G,q)},preprocessArgs(K,G,q){if(!Y(K))return;return J.preprocessArgs?.(K,G,q)},tools:J.tools.pipe(b0((K)=>K.filter((G)=>Y(G.spec.name)))),dispose(){}}}var wi1,Ri1,YD6,OX1="invalid_tool",fS,ji1,Fc,KD6;var t2=B1(()=>{v0();G0();zc();wX1();F8();wi1=d6(Nd(),1),Ri1=d6(_N(),1);YD6={dispose(){}};fS=/^[a-zA-Z0-9_]{1,64}$/,ji1=wi1.metrics.getMeter("tool_service"),Fc=ji1.createCounter("tool_service.invocation_count",{description:"Number of tool invocations"}),KD6=ji1.createHistogram("tool_service.invocation_latency",{description:"Latency of tool invocations",unit:"ms"})});var Si1=t((Ti1)=>{Object.defineProperty(Ti1,"__esModule",{value:!0});Ti1.calcSlices=Ti1.applyPatch=Ti1.calcPatch=Ti1.lcs=Ti1.diff=Ti1.diff_core=void 0;function GD6(J,Q){let{b:Z,eq:X,stack_base:Y}=J,{i:K,N:G,j:q,M:z,Z:U,stack_top:W}=J;for(;;)switch(Q){case 0:{J:while(G>0&&z>0){Z.fill(0,0,2*U);let F=G-z,H=G+z,B=H&1,M=K+G-1,V=q+z-1,N=(H+B)/2,L;Q:for(let A=0;A<=N;A++){let w=2*Math.max(0,A-z)-A,R=A-2*Math.max(0,A-G);for(let O=w;O<=R;O+=2){let $=Z[O-1-U*Math.floor((O-1)/U)],j=Z[O+1-U*Math.floor((O+1)/U)],E=O===-A||O!==A&&$<j?j:$+1,I=E-O,T=E,S=I;while(T<G&&S<z&&X(K+T,q+S))T++,S++;if(Z[O-U*Math.floor(O/U)]=T,B===1&&(L=F-O)>=1-A&&L<A&&T+Z[U+L-U*Math.floor(L/U)]>=G)if(A>1||T!==E){Y[W++]=K+T,Y[W++]=G-T,Y[W++]=q+S,Y[W++]=z-S,G=E,z=I,U=2*(Math.min(G,z)+1);continue J}else break Q}for(let O=w;O<=R;O+=2){let $=Z[U+O-1-U*Math.floor((O-1)/U)],j=Z[U+O+1-U*Math.floor((O+1)/U)],E=O===-A||O!==A&&$<j?j:$+1,I=E-O,T=E,S=I;while(T<G&&S<z&&X(M-T,V-S))T++,S++;if(Z[U+O-U*Math.floor(O/U)]=T,B===0&&(L=F-O)>=-A&&L<=A&&T+Z[L-U*Math.floor(L/U)]>=G)if(A>0||T!==E){Y[W++]=K+G-E,Y[W++]=E,Y[W++]=q+z-I,Y[W++]=I,G=G-T,z=z-S,U=2*(Math.min(G,z)+1);continue J}else break Q}}if(G===z)continue;if(z>G)K+=G,q+=G,z-=G,G=0;else K+=z,q+=z,G-=z,z=0;break}if(G+z!==0)if(J.pxe===K||J.pye===q)J.pxe=K+G,J.pye=q+z;else{let F=J.pxs;if(J.oxs=J.pxs,J.oxe=J.pxe,J.oys=J.pys,J.oye=J.pye,J.pxs=K,J.pxe=K+G,J.pys=q,J.pye=q+z,F>=0)return J.i=K,J.N=G,J.j=q,J.M=z,J.Z=U,J.stack_top=W,1}}case 1:{if(W===0)return 2;z=Y[--W],q=Y[--W],G=Y[--W],K=Y[--W],U=2*(Math.min(G,z)+1),Q=0}}}class Ei1{constructor(J){this.state=J,this.c=0,this.result={value:null,done:!1}}[Symbol.iterator](){return this}next(){let{state:J,result:Q}=this;if(this.c>1)return Q.done=!0,Q.value=void 0,Q;let Z=GD6(J,this.c);if(this.c=Z,Z===1)return Q.value=[J.oxs,J.oxe,J.oys,J.oye],Q;if(J.pxs>=0)return Q.value=[J.pxs,J.pxe,J.pys,J.pye],Q;return Q.done=!0,Q.value=void 0,Q}}function Ii1(J,Q,Z,X,Y){let K=(Math.min(Q,X)+1)*2,G=Q+X,q=new(G<256?Uint8Array:G<65536?Uint16Array:Uint32Array)(2*K);return new Ei1({i:J,N:Q,j:Z,M:X,Z:K,b:q,eq:Y,pxs:-1,pxe:-1,pys:-1,pye:-1,oxs:-1,oxe:-1,oys:-1,oye:-1,stack_top:0,stack_base:[]})}Ti1.diff_core=Ii1;function Hc(J,Q,Z){let[X,Y,K]=[0,J.length,Q.length];if(typeof Z==="function"){while(X<Y&&X<K&&Z(X,X))X++;if(X===Y&&X===K)return[][Symbol.iterator]();while(Z(--Y,--K)&&Y>X&&K>X);}else{while(X<Y&&X<K&&J[X]===Q[X])X++;if(X===Y&&X===K)return[][Symbol.iterator]();while(J[--Y]===Q[--K]&&Y>X&&K>X);Z=(G,q)=>J[G]===Q[q]}return Ii1(X,Y+1-X,X,K+1-X,Z)}Ti1.diff=Hc;class Pi1{constructor(J,Q){this.diff=J,this.N=Q,this.i=0,this.j=0}[Symbol.iterator](){return this}next(){let J=this.diff.next();if(J.done){let{i:q,j:z,N:U}=this;if(q<U)J.done=!1,J.value=[q,z,U-q],this.i=U;return J}let Q=J.value,Z=Q[0],X=Q[1],Y=Q[3],{i:K,j:G}=this;if(K!==Z)Q.length--,Q[0]=K,Q[1]=G,Q[2]=Z-K;return this.i=X,this.j=Y,J}}function qD6(J,Q,Z){return new Pi1(Hc(J,Q,Z),J.length)}Ti1.lcs=qD6;function*zD6(J,Q,Z){let X=ArrayBuffer.isView(J)?Uint8Array.prototype.subarray:J.slice;for(let Y of Hc(J,Q,Z))Y[2]=X.call(Q,Y[2],Y[3]),yield Y}Ti1.calcPatch=zD6;function*UD6(J,Q){let Z=0,X=ArrayBuffer.isView(J)?Uint8Array.prototype.subarray:J.slice;for(let[Y,K,G]of Q){if(Z<Y)yield X.call(J,Z,Y);if(G.length>0)yield G;Z=K}if(Z<J.length)yield X.call(J,Z)}Ti1.applyPatch=UD6;function*WD6(J,Q,Z){let X=0,Y=ArrayBuffer.isView(J)?Uint8Array.prototype.subarray:J.slice;for(let[K,G,q,z]of Hc(J,Q,Z)){if(X<K)yield[0,Y.call(J,X,K)];if(K<G)yield[-1,Y.call(J,K,G)];if(q<z)yield[1,Y.call(Q,q,z)];X=G}if(X<J.length)yield[0,J.slice(X)]}Ti1.calcSlices=WD6});function Bc(J,Q){if(J===void 0||Q===void 0||J===Q)return{added:0,deleted:0,changed:0};let Z={added:0,deleted:0,changed:0};for(let[X,Y,K,G]of vi1.diff(J.split(`
|
|
3
|
+
`)[0];if(!X?.startsWith("#!"))return{interpreter:null,isValid:!1};let Y=X.slice(2).trim();if(!Y)return{interpreter:null,isValid:!1};let K=Y.split(/\s+/).filter((G)=>G.length>0);if(K[0]?.endsWith("/env")&&K.length>1)return{interpreter:K.slice(1),isValid:!0};return{interpreter:K,isValid:!0}}finally{await Q.close()}}catch{return{interpreter:null,isValid:!1}}}function mc1(J,Q){let Z=(J&73)!==0;if(process.platform==="win32"){let X=CN.extname(Q).toLowerCase();return Z||[".exe",".bat",".cmd",".ps1"].includes(X)}return Z}function uc1(J){return CN.extname(J).toLowerCase()===".md"}function pc1(J){let Q=J.replace(/\\/g,"/"),Z=CN.basename(Q);return CN.basename(Z,CN.extname(Z))}function dc1(J){return/^[a-zA-Z][a-zA-Z0-9_-]*$/.test(J)&&J.length>0}var cc1=()=>{};var nc1={};E6(nc1,{CommandDiscovery:()=>ac1});import*as ic1 from"node:fs";import{promises as jd}from"node:fs";import{homedir as lc1}from"node:os";import*as EX from"node:path";function _Z1(J,Q,Z){return Promise.race([J,new Promise((X,Y)=>setTimeout(()=>Y(Error(`${Z} timed out after ${Q}ms`)),Q))])}class ac1{config;workspaceRoots;watchFactory;debounceMs;changes=new k8;watchers=new Map;debounceTimer;disposed=!1;constructor(J,Q,Z={}){this.config=J,this.workspaceRoots=Q,this.watchFactory=Z.watchFactory??EF6,this.debounceMs=Z.debounceMs??200}get commandChanges(){return this.changes}async discoverCommands(){if(this.disposed)return[];try{let[J,Q]=await Promise.all([this.discoverWorkspaceCommands(),this.discoverGlobalCommands()]),Z=new Map;for(let Y of Q)Z.set(Y.name,Y);for(let Y of J)Z.set(Y.name,Y);let X=Array.from(Z.values());if(u.debug("Discovered commands",{count:X.length,workspace:J.length,global:Q.length}),this.config.enableWatching)await this.setupWatching();return X}catch(J){return u.error("Failed to discover commands",{error:J}),[]}}async discoverWorkspaceCommands(){let J=[];for(let Q of this.workspaceRoots)for(let Z of this.config.workspacePaths){let X=y0.joinPath(Q,Z),Y=await this.discoverCommandsInDirectory(X,"workspace");J.push(...Y)}return J}async discoverGlobalCommands(){let J=[];for(let Q of this.config.globalPaths){let Z=this.resolveGlobalPath(Q),X=$0.file(Z),Y=await this.discoverCommandsInDirectory(X,"global");J.push(...Y)}return J}async discoverCommandsInDirectory(J,Q){try{let Z=J.fsPath;try{await _Z1(jd.access(Z),kZ1,"directory access")}catch{return[]}let Y=(await _Z1(jd.readdir(Z,{withFileTypes:!0}),kZ1,"directory read")).filter((G)=>G.isFile()),K=[];for(let G of Y){let q=EX.join(Z,G.name),z=await this.createCommand(q);if(z)K.push(z)}return u.debug(`Discovered ${K.length} commands in ${Q} directory`,{directory:Z,commands:K.map((G)=>G.name)}),K}catch(Z){return u.warn(`Failed to discover commands in directory: ${J.fsPath}`,{error:Z}),[]}}ignoreCommandName(J){return J.startsWith(".")||J==="README.md"}async createCommand(J){try{let Q=await jd.stat(J),Z=EX.basename(J);if(this.ignoreCommandName(Z))return null;let X=pc1(Z);if(!dc1(X))return u.warn(`Invalid command name: ${X}`,{filePath:J}),null;if(uc1(Z))return this.createMarkdownCommand(J,Q,X);else return this.createExecutableCommand(J,Q,X)}catch(Q){return u.warn(`Failed to process file: ${J}`,{error:Q}),null}}async createMarkdownCommand(J,Q,Z){return{kind:"markdown",name:Z,filePath:J,sourceDirectory:EX.dirname(J),lastModified:Q.mtimeMs,available:!0,unavailableReason:void 0}}async createExecutableCommand(J,Q,Z){let X=EX.basename(J),Y=mc1(Q.mode,X),K=await gc1(J),G=EX.extname(X);if(!Y&&!K.isValid&&!this.isNativeBinary(G))return u.debug(`Skipping non-executable file without shebang: ${J}`),null;let q=Y&&(K.isValid||this.isNativeBinary(G)),z=this.getExecutableUnavailableReason(Y,K.isValid,G);return{kind:"executable",name:Z,filePath:J,sourceDirectory:EX.dirname(J),lastModified:Q.mtimeMs,isExecutable:Y,interpreter:K.interpreter,extension:G,available:q,unavailableReason:z}}isNativeBinary(J){if(process.platform==="win32")return[".exe",".bat",".cmd",".ps1"].includes(J.toLowerCase());return J===""}getExecutableUnavailableReason(J,Q,Z){let X=this.isNativeBinary(Z);if(!J)return"File is not executable (missing execute permissions)";if(!Q&&!X)return"Missing shebang and not a recognized binary type";return}resolveGlobalPath(J){if(J.startsWith("~/"))return EX.join(lc1(),J.slice(2));if(J.startsWith("~/.config/amp/")){let Q=WB||EX.join(lc1(),".config");return EX.join(Q,J.slice(10))}return J}async setupWatching(){if(this.disposed)return;this.stopWatching();let J=new Set;for(let Q of this.workspaceRoots)for(let Z of this.config.workspacePaths){let X=y0.joinPath(Q,Z);J.add(X.fsPath)}for(let Q of this.config.globalPaths){let Z=this.resolveGlobalPath(Q);J.add(Z)}for(let Q of J)await this.watchDirectory(Q)}async watchDirectory(J){try{await _Z1(jd.access(J),kZ1,"watcher access check");try{let Q=this.watchFactory(J,(Z,X)=>{u.debug("Command directory change detected",{directory:J,eventType:Z,filename:X}),this.scheduleRefresh()});Q.on("error",(Z)=>{u.debug("transient file watcher error",{error:Z}),this.scheduleRefresh()}),this.watchers.set(J,Q),u.debug("Started watching command directory",{directory:J})}catch(Q){u.warn("Failed to setup file watcher",{directory:J,error:Q})}}catch(Q){u.debug("Skipping watch for non-existent directory",{directory:J})}}scheduleRefresh(){if(this.disposed)return;if(this.debounceTimer)clearTimeout(this.debounceTimer);this.debounceTimer=setTimeout(async()=>{try{let[J,Q]=await Promise.all([this.discoverWorkspaceCommands(),this.discoverGlobalCommands()]),Z=new Map;for(let Y of Q)Z.set(Y.name,Y);for(let Y of J)Z.set(Y.name,Y);let X=Array.from(Z.values());u.debug("Refreshed commands during file watch",{count:X.length,workspace:J.length,global:Q.length}),this.changes.next(X)}catch(J){u.warn("Failed to refresh commands during file watch",{error:J})}},this.debounceMs)}stopWatching(){try{for(let[J,Q]of this.watchers)try{Q.close(),u.debug("Stopped watching command directory",{directory:J})}catch(Z){u.warn("Failed to close watcher",{directory:J,error:Z})}this.watchers.clear()}finally{if(this.debounceTimer)clearTimeout(this.debounceTimer),this.debounceTimer=void 0}}dispose(){this.disposed=!0;try{this.stopWatching()}catch(J){u.warn("Error during command discovery cleanup",{error:J})}}}var kZ1=5000,EF6=(J,Q)=>ic1.watch(J,Q);var rc1=B1(()=>{k6();v0();rR();G0();cc1()});import{homedir as $d}from"node:os";import SN from"node:path";var oc1,SF6,tc1,vF6,Ed,kF6,sR,FB,bZ1;var WW=B1(()=>{rR();oc1=SN.join($d(),".local/share"),SF6=process.platform==="win32"||process.platform==="darwin"?oc1:UB??oc1,tc1=SN.join($d(),".config"),vF6=process.platform==="win32"||process.platform==="darwin"?tc1:WB??tc1,Ed=SN.join(SF6,"amp"),kF6=SN.join(vF6,"amp"),sR=SN.join(kF6,"tools"),FB=SN.join($d(),".cache","amp"),bZ1=SN.join($d(),".cache","amp","http-debug-logs")});function OQ(J,Q,Z=Q+"s"){return J===1?Q:Z}var JO;var pZ1=B1(()=>{JO={name:"amp",description:"The frontier coding agent, with a highly capable `smart` mode and a fast `free` mode. ",private:!0,displayName:"Amp (Research Preview)",version:"0.0.0-dev",publisher:"sourcegraph",license:"Apache-2.0",categories:["AI","Chat","Programming Languages","Machine Learning"],keywords:["sourcegraph","amp","amp code","ampcode","ai","assistant","llm","Claude","Claude Sonnet 4.5","GPT-5","agent","free","Claude Sonnet"],icon:"./resources/amp-icon.png",scripts:{dev:"pnpm run -s dev:desktop","dev:insiders":"pnpm run -s dev:desktop:insiders","start:dev:desktop":"node scripts/start-dev.js","start:dev:desktop:insiders":"node scripts/start-dev.js --insiders","start:dev:web":"vscode-test-web --extensionDevelopmentPath=. --browserOption=--disable-web-security --verbose --open-devtools --verbose --printServerLog","start:dev:debugger":"pnpm run -s build:dev:desktop && pnpm run -s ./src/autoedit/webview dev","dev:desktop":"pnpm run -s build:dev:desktop && pnpm run start:dev:desktop","dev:desktop:insiders":"pnpm run -s build:dev:desktop && pnpm run start:dev:desktop:insiders","build:dev:desktop":"vite build",build:"pnpm run -s _build:extension && concurrently -n 'debugger,web,review' 'pnpm run -s _build:debugger' 'pnpm run -s _build:web' 'pnpm run -s _build:tab:review'","build:production":"pnpm run -s _build:extension:production && concurrently -n 'debugger,web,review' 'pnpm run -s _build:debugger:production' 'pnpm run -s _build:web:production' 'pnpm run -s _build:tab:review:production'","_build:extension":"vite build","_build:extension:production":"cross-env NODE_ENV=production vite build","_build:web":"pnpm -C ../web run build && cp -R ../web/build dist/web-build","_build:web:production":"pnpm -C ../web run build:production && cp -R ../web/build dist/web-build","_build:debugger":"pnpm -C ./src/autoedit/webview run build && cp -R ./src/autoedit/webview/build dist/autoedit","_build:debugger:production":"cross-env NODE_ENV=production pnpm -C ./src/autoedit/webview run build && cp -R ./src/autoedit/webview/build dist/autoedit","_build:tab:review":"pnpm -C ./src/autoedit/review-panel-webview run build && mkdir -p dist/autoedit && cp -R ./src/autoedit/review-panel-webview/build dist/autoedit/review-panel","_build:tab:review:production":"cross-env NODE_ENV=production pnpm -C ./src/autoedit/review-panel-webview run build && mkdir -p dist/autoedit && cp -R ./src/autoedit/review-panel-webview/build dist/autoedit/review-panel","build:icon-font":"npx -y svgtofont --sources ./icon-font/svg --output ./icon-font/build && cp ./icon-font/build/amp-icons.woff ./resources","dev:forks":"pnpm dev:vsix && cursor --install-extension dist/amp-dev.vsix --force && windsurf --install-extension dist/amp-dev.vsix --force","dev:vsix":"vite build && pnpm run -s _build:web && pnpm run -s _build:debugger && pnpm run -s _build:tab:review && vsce package --no-dependencies --pre-release --out dist/amp-dev.vsix && code --install-extension dist/amp-dev.vsix --force","dev:insiders:vsix":"vite build && pnpm run -s _build:web && pnpm run -s _build:debugger && pnpm run -s _build:tab:review && vsce package --no-dependencies --pre-release --out dist/amp-dev.vsix && code-insiders --install-extension dist/amp-dev.vsix --force",test:"vitest run","test:dev":"vitest"},homepage:"https://ampcode.com",repository:{type:"git",url:"https://github.com/sourcegraph/amp",directory:"vscode"},author:{name:"The Amp Team at Sourcegraph",email:"amp-devs@sourcegraph.com"},engines:{vscode:"^1.79.0",node:">=22.0.0"},main:"./dist/extension.js",activationEvents:["onStartupFinished"],extensionDependencies:["vscode.git"],contributes:{languages:[{id:"jsonc",filenamePatterns:["**/Library/Application Support/ampcode/managed-settings.json","**/etc/ampcode/managed-settings.json","**/ProgramData/ampcode/managed-settings.json"]}],viewsContainers:{activitybar:[{id:"sourcegraph-amp",title:"Amp",icon:"./resources/amp-mark.svg"}]},views:{"sourcegraph-amp":[{type:"webview",id:"amp.sidebarView",name:"Amp",icon:"./resources/amp-mark.svg",visibility:"visible"},{type:"webview",id:"amp.reviewPanel",name:"Review",icon:"$(compare-changes)",visibility:"visible",when:"config.amp.review.separatePanel"}]},commands:[{command:"amp.agent.newThread",title:"New Thread",category:"Amp",icon:"$(add)"},{command:"amp.agent.newWindow",title:"New Agent Window",category:"Amp",icon:"$(browser)",enablement:"amp.activated"},{command:"amp.agent.toggleVisibility",title:"Toggle Agent",category:"Amp"},{command:"amp.agent.openReview",title:"Open Amp Review",category:"Amp",icon:"$(compare-changes)",enablement:"amp.activated"},{command:"amp.agent.focusPromptEditor",title:"Focus Prompt Editor",category:"Amp"},{command:"amp.agent.addSelectionToPromptEditor",title:"Add Selection to Prompt",category:"Amp",enablement:"editorHasSelection"},{command:"amp.agent.switchAgentMode",title:"Switch Agent Mode for Current Thread",category:"Amp",enablement:"amp.hasMultipleVisibleModes"},{command:"amp.agent.setPromptFromRecentActions",title:"Create Prompt from Recent Actions",category:"Amp"},{command:"amp.agent.findInThread",title:"Find in Thread",category:"Amp",enablement:"amp.agent.active"},{command:"amp.agent.collapseAllInThread",title:"Collapse All Blocks in Thread",category:"Amp"},{command:"amp.agent.expandAllInThread",title:"Expand All Blocks in Thread",category:"Amp"},{command:"amp.agent.expandToggleInThread",title:"Toggle Expand All Blocks in Thread",category:"Amp"},{command:"amp.agent.toggleThreadSwitcher",title:"Switch to Thread...",category:"Amp",enablement:"amp.agent.active"},{command:"amp.agent.toggleCostDisplay",title:"Toggle Cost Display",category:"Amp"},{command:"amp.agent.navigateThreadPrevious",title:"Navigate to Previous Thread",category:"Amp",enablement:"amp.agent.active && amp.agent.activeView == 'sidebar'"},{command:"amp.agent.navigateThreadNext",title:"Navigate to Next Thread",category:"Amp",enablement:"amp.agent.active && amp.agent.activeView == 'sidebar'"},{command:"amp.openThreadJSON",title:"Open Thread JSON",category:"Amp",enablement:"amp.isDevelopmentMode"},{command:"amp.testThreadSummary",title:"Test Thread Summary",category:"Amp",enablement:"amp.isDevelopmentMode"},{command:"amp.tab.quickPickMenu",title:"Show Tab Menu",category:"Amp",icon:"$(debug)",enablement:"amp.activated"},{command:"amp.tab.showDebugPanel",title:"Show Tab Debug Panel",category:"Amp",icon:"$(debug)",enablement:"amp.activated && config.amp.tab.enabled"},{command:"amp.tab.showDiff",title:"Tab: Show Diff",category:"Amp",icon:"$(diff)",enablement:"amp.activated && config.amp.tab.enabled && config.amp.tab.experimental.review"},{command:"amp.tab.diffPanel.acceptAll",title:"Tab Review: Accept All Changes",category:"Amp",enablement:"amp.activated && config.amp.tab.enabled && config.amp.tab.experimental.review"},{command:"amp.tab.diffPanel.instruct",title:"Tab Review: Open Instruct Mode",category:"Amp",enablement:"amp.activated && config.amp.tab.enabled && config.amp.tab.experimental.review"},{command:"amp.tab.manualTrigger",title:"Tab Manual Trigger",category:"Amp",enablement:"amp.activated && config.amp.tab.enabled"},{command:"amp.tab.enable",title:"Enable Tab",category:"Amp",enablement:"amp.activated && !config.amp.tab.enabled"},{command:"amp.tab.disable",title:"Disable Tab",category:"Amp",enablement:"amp.activated && config.amp.tab.enabled"},{command:"amp.tab.toggleForCurrentDocument",title:"Toggle Tab for Current Document",category:"Amp",enablement:"amp.activated && config.amp.tab.enabled"},{command:"amp.tab.debugInfo",title:"Open Tab Debug Info",category:"Amp",enablement:"amp.activated && config.amp.tab.enabled"},{command:"amp.tab.autoAcceptChain",title:"Accept Suggestion Chain",category:"Amp",enablement:"amp.activated && config.amp.tab.enabled"},{command:"amp.mcp.restartServers",title:"Restart MCP Servers",category:"Amp"},{command:"amp.agent.editUserPermissions",title:"Edit User Permissions",category:"Amp"},{command:"amp.agent.editWorkspacePermissions",title:"Edit Workspace Permissions",category:"Amp"},{command:"amp.commandPalette.show",title:"Show Amp Command Palette",category:"Amp",icon:"$(list-flat)"}],menus:{"editor/context":[{command:"amp.agent.addSelectionToPromptEditor",when:"editorHasSelection",group:"amp@1"}]},keybindings:[{command:"amp.agent.newThread",key:"ctrl+l",mac:"cmd+l",when:"amp.primaryShortcuts"},{command:"amp.agent.newThread",key:"ctrl+alt+j",mac:"cmd+alt+j",when:"!amp.primaryShortcuts"},{command:"amp.agent.newWindow",key:"ctrl+shift+l",mac:"cmd+shift+l"},{command:"amp.agent.toggleVisibility",key:"ctrl+i",mac:"cmd+i",when:"amp.primaryShortcuts"},{command:"amp.agent.toggleVisibility",key:"ctrl+alt+u",mac:"cmd+alt+u",when:"!amp.primaryShortcuts"},{command:"amp.agent.findInThread",key:"ctrl+f",mac:"cmd+f",when:"amp.agent.active"},{command:"amp.agent.toggleThreadSwitcher",key:"ctrl+k",mac:"cmd+k",when:"amp.agent.active"},{command:"amp.agent.toggleCostDisplay",key:"ctrl+d",mac:"cmd+d",when:"amp.agent.active && amp.isSourcegraphTeammate || isWeb"},{command:"amp.agent.navigateThreadPrevious",key:"ctrl+shift+[",mac:"cmd+shift+[",when:"amp.agent.active && amp.agent.activeView == 'sidebar'"},{command:"amp.agent.navigateThreadNext",key:"ctrl+shift+]",mac:"cmd+shift+]",when:"amp.agent.active && amp.agent.activeView == 'sidebar'"},{command:"amp.agent.savePermissions",key:"ctrl+s",mac:"cmd+s",enablement:"editorTextFocus && resourcePath =~ /[\\\\/]amp[\\\\/]permissions-.*\\.sh$/i",when:"editorTextFocus && resourcePath =~ /[\\\\/]amp[\\\\/]permissions-.*\\.sh$/i"},{command:"amp.tab.diffPanel.acceptAll",key:"ctrl+enter",mac:"cmd+enter",when:"activeWebviewPanelId == 'ampTabDiff'"},{command:"amp.tab.diffPanel.instruct",key:"ctrl+i",mac:"cmd+i",when:"activeWebviewPanelId == 'ampTabDiff'"},{command:"amp.agent.openReview",key:"ctrl+;",mac:"cmd+;"},{command:"-extension.vim_tab",key:"tab",when:"editorTextFocus && vim.active && vim.mode != 'Insert' && !inlineEditIsVisible && !inDebugRepl"},{command:"-vscode-neovim.send",key:"tab",when:"neovim.init && (editorTextFocus && neovim.mode != insert && editorLangId not in neovim.editorLangIdExclusions || neovim.recording)"},{command:"amp.tab.accept",key:"tab",when:"editorTextFocus && amp.activated && amp.tab.active && !amp.nextCursorSuggested && !amp.editorHasMultipleLineSelection"},{command:"amp.tab.showDiff",key:"shift+tab",when:"editorTextFocus && amp.activated && config.amp.tab.experimental.review && (amp.tab.active || inlineSuggestionVisible) && !amp.nextCursorSuggested && !amp.editorHasMultipleLineSelection"},{command:"amp.tab.dismiss",key:"escape",when:"editorTextFocus && amp.activated && amp.tab.active && !amp.nextCursorSuggested && !suggestWidgetVisible && !amp.editorHasMultipleLineSelection"},{command:"amp.nextCursor.accept",key:"tab",when:"editorTextFocus && amp.activated && amp.nextCursorSuggested && !amp.editorHasMultipleLineSelection"},{command:"amp.nextCursor.discard",key:"escape",when:"editorTextFocus && amp.activated && amp.nextCursorSuggested && !suggestWidgetVisible && !amp.editorHasMultipleLineSelection"},{command:"amp.tab.autoAcceptChain",key:"alt+shift+tab",when:"editorTextFocus && amp.activated && (amp.tab.active || amp.nextCursorSuggested) && !amp.editorHasMultipleLineSelection"},{command:"amp.autoImport.accept",key:"tab",when:"editorTextFocus && amp.activated && config.amp.tab.enabled && amp.autoImportSuggested && !amp.editorHasMultipleLineSelection"},{command:"amp.autoImport.discard",key:"escape",when:"editorTextFocus && amp.activated && config.amp.tab.enabled && amp.autoImportSuggested && !amp.editorHasMultipleLineSelection"},{command:"amp.commandPalette.show",key:"ctrl+shift+a",mac:"cmd+shift+a",when:"amp.activated"},{command:"amp.agent.switchAgentMode",key:"ctrl+shift+m",mac:"cmd+shift+m",when:"amp.activated && amp.hasMultipleVisibleModes"}],configuration:{type:"object",title:"Amp",properties:{"amp.url":{type:"string",examples:["https://ampcode.com/"],description:"URL to the Amp server, usually https://ampcode.com/",scope:"application"},"amp.notifications.enabled":{type:"boolean",default:!0,description:"Play notification sound when done or blocked",scope:"window"},"amp.mcpServers":{type:"object",description:"Model Context Protocol servers that expose tools",additionalProperties:{type:"object",oneOf:[{properties:{command:{type:"string"},args:{type:"array",items:{type:"string"}},env:{type:"object",additionalProperties:{type:"string"}}},required:["command"]},{properties:{url:{type:"string"},headers:{type:"object",description:"HTTP headers to send with requests to the MCP server",additionalProperties:{type:"string"}},oauth:{type:"object",description:"OAuth 2.0 configuration for MCP server authentication",properties:{clientId:{type:"string",description:"OAuth client ID"},clientSecret:{type:"string",description:"OAuth client secret (optional for public clients)"},authUrl:{type:"string",description:"OAuth authorization endpoint URL"},tokenUrl:{type:"string",description:"OAuth token endpoint URL"},scopes:{type:"array",description:"OAuth scopes to request",items:{type:"string"}},redirectUrl:{type:"string",description:"OAuth redirect URL (defaults to http://localhost:8976/oauth/callback)"}}}},required:["url"]}]}},"amp.mcpTrustedServers":{type:"array",markdownDescription:"MCP server trust decisions. **Security Note:** This setting is only read from user settings, never workspace settings, to prevent malicious repositories from auto-approving MCP servers.",scope:"application",items:{type:"object",properties:{serverName:{type:"string",description:"MCP server name"},specHash:{type:"string",description:"Hash of the server configuration"},allow:{type:"boolean",description:"Whether this server is approved"}},required:["serverName","specHash","allow"]}},"amp.workspaces":{type:"array",markdownDescription:"Workspace-level configuration. This setting is only read from user settings, never workspace settings.",scope:"application",items:{type:"object",properties:{path:{type:"string",description:"Absolute path to the workspace"},allowAllMcpServers:{type:"boolean",description:"Whether to automatically trust all MCP servers in this workspace"}},required:["path"]}},"amp.mcpPermissions":{type:"array",description:"Permissions for Model Context Protocol (MCP) servers. Controls which MCP servers can be used.",items:{type:"object",properties:{matches:{$ref:"https://static.ampcode.com/schemas/permissions.schema.json#/$defs/permissionMatchCondition"},action:{type:"string",enum:["allow","reject"],description:"Whether to allow or reject MCP servers matching the condition"}},required:["matches","action"],additionalProperties:!1},default:[],scope:"application"},"amp.permissions":{$ref:"https://static.ampcode.com/schemas/permissions.schema.json",description:"Entries checked in sequence to configure tool permissions",default:[]},"amp.experimental.promptAutocompleteMode":{type:"string",enum:["disabled","word-based","tab"],enumDescriptions:["Disabled - no prompt autocomplete","Offline word completion from workspace and thread context","AI-powered suggestions via Amp Tab"],default:"disabled",markdownDescription:"**Experimental:** Prompt autocomplete suggestions while typing.",scope:"application"},"amp.experimental.promptAutocomplete.verboseLogging":{type:"boolean",default:!1,markdownDescription:"Enable verbose logging for prompt autocomplete.",scope:"application"},"amp.experimental.tools":{type:"array",description:"Enable experimental tools by name. Available tools: chat_llm",items:{type:"string"},default:[],scope:"application"},"amp.tools.disable":{type:"array",markdownDescription:'Disable specific tools by name. Glob patterns using * are supported\n\nExamples:\n- Disable edit_file: `["builtin:edit_file"]`\n- Disable all playwright tab tools: `["mcp__playwright__browser_tab*"]`',items:{type:"string"},default:[]},"amp.dangerouslyAllowAll":{type:"boolean",description:"If true, never ask for confirmation when running commands",scope:"window",default:!1},"amp.guardedFiles.allowlist":{type:"array",description:"Glob patterns for files that should bypass guarded file protection. Files matching these patterns can be modified without user confirmation.",items:{type:"string"},default:[],scope:"window"},"amp.anthropic.thinking.enabled":{type:"boolean",default:!0,description:"Enable Claude's extended thinking capabilities",scope:"application"},"amp.tools.inactivityTimeout":{type:"number",default:300,minimum:1,maximum:3600,description:"How many seconds of no output to wait before canceling bash commands.",scope:"workspace"},"amp.tools.stopTimeout":{type:"number",default:300,description:"How many seconds to wait before canceling a running tool.",scope:"application"},"amp.terminal.commands.nodeSpawn.loadProfile":{type:"string",enum:["always","never","daily"],default:"always",description:"Before running commands (including MCP servers), whether to load environment variables from the user's profile (.bashrc, .zshrc, .envrc) as visible from the workspace root directory.",scope:"application"},"amp.todos.enabled":{type:"boolean",default:!0,description:"Enable TODOs tracking for managing tasks",scope:"application"},"amp.guidanceFiles.specs":{type:"boolean",default:!1,description:"[Experimental] Read `*.spec.md` files adjacent to `AGENT.md` files that are read",scope:"window"},"amp.security.audit.logMcpConnections":{type:"boolean",default:!1,description:"Enable telemetry logging for remote MCP server connections (for security auditing)",scope:"application"},"amp.review.separatePanel":{type:"boolean",default:!1,description:"Show the review panel as a separate container that's independently draggable to a different sidebar location.",scope:"window"},"amp.hooks":{type:"array",scope:"window",description:"[Experimental] Hooks are event handlers that can react to specific conditions.",items:{type:"object",properties:{compatibilityDate:{type:"string",const:"2025-05-13",default:"2025-05-13",description:"The version of the hook schema that this value was written to conform to"},id:{type:"string",description:"A unique identifier for the hook",examples:["run-vitest-with-env-vars"]},description:{type:"string",description:"A description of the hook"},on:{oneOf:[{type:"object",properties:{event:{type:"string",const:"tool:pre-execute",default:"tool:pre-execute",description:"Trigger when a tool is about to be executed"},tool:{oneOf:[{type:"string",description:"Tool name to match (e.g., 'edit_file')"},{type:"array",items:{type:"string"},description:"Tool names to match"}],description:"Trigger for the given tool name(s)"},"input.contains":{oneOf:[{type:"string",description:"String pattern to match in the tool input"},{type:"array",items:{type:"string"},description:"String patterns to match in the tool input"}],description:"Trigger only when the tool input contains the given literal string or strings"}},required:["event","tool","input.contains"]},{type:"object",properties:{event:{type:"string",const:"tool:post-execute",default:"tool:post-execute",description:"Trigger after a tool has been executed"},tool:{oneOf:[{type:"string",description:"Tool name to match (e.g., 'edit_file')"},{type:"array",items:{type:"string"},description:"Tool names to match"}],description:"Trigger for the given tool name(s)"}},required:["event","tool"]}]},action:{oneOf:[{type:"object",properties:{type:{type:"string",const:"send-user-message",default:"send-user-message",description:"Send a user message to interrupt the agent and cancel the tool call in the `tool:pre-execute` trigger before it starts to run"},message:{type:"string",description:"The text of the message to send"}},required:["type","message"]},{type:"object",properties:{type:{type:"string",const:"redact-tool-input",default:"redact-tool-input",description:"Redact the tool input after execution. Only allowed with `tool:post-execute` event."},redactedInput:{type:"object",description:"The replacement input data to use instead of the original tool input (must be an object)"}},required:["type","redactedInput"]}]},if:{type:"boolean",description:"A condition that determines whether the hook should be executed",default:!0}},required:["compatibilityDate","id","on","action"]},default:[]},"amp.tab.enabled":{type:"boolean",default:!1,description:"Enable Amp Tab",scope:"application"},"amp.tab.verboseLogs":{type:"boolean",default:!1,description:"Enable verbose logging for Amp Tab",scope:"application"},"amp.debugLogs":{type:"boolean",default:!1,description:"Enable debug logging in the Amp output channel",scope:"application"},"amp.tab.disabledLanguages":{type:"array",items:{type:"string"},default:[],examples:["markdown","python"],description:"List of language IDs for which Amp Tab is disabled",scope:"application"},"amp.tab.disableOnComment":{type:"boolean",default:!1,description:"Disable Amp Tab completions on comment lines",scope:"application"},"amp.tab.autoImport.enabled":{type:"boolean",default:!0,description:"Enable auto import in Amp Tab",scope:"application"},"amp.tab.dismissCommandIds":{type:"array",items:{type:"string"},default:["extension.vim_escape","vim.escape","vscode-neovim.escape","vscode-neovim.escapeKey"],description:"Command IDs to run when Escape is pressed to dismiss an Amp Tab suggestion",scope:"application"},"amp.tab.experimental.showHotStreakProgress":{type:"boolean",default:!1,description:"Experimental: Show hot streak progress in image-rendered suggestions",scope:"window"},"amp.tab.experimental.autoAccept.delayMs":{type:"number",default:0,description:"Experimental: Delay in milliseconds before auto-accepting Amp Tab suggestions",scope:"application"},"amp.tab.experimental.unobtrusiveDiffs":{type:"boolean",default:!1,description:"Experimental: Enable unobtrusive diffs mode for Amp Tab suggestions. When enabled, suggestions are shown as image overlays to avoid layout shifts and visual interference with existing code.",scope:"application"},"amp.tab.experimental.review":{type:"boolean",default:!1,description:"Experimental: Enable review mode for Amp Tab. When enabled, adds the ability to review suggestion changes with Shift+Tab shortcut and review panel.",scope:"window"},"amp.tab.diagnosticTracking":{type:"string",enum:["disabled","same_file","multi_file"],default:"multi_file",description:"Enable diagnostic tracking for Amp Tab suggestions. 'disabled' = no tracking, 'same_file' = track diagnostics within the same file, 'multi_file' = track diagnostics across multiple files.",scope:"application"},"amp.tab.hoverDiagnosticSuggestions":{type:"boolean",default:!1,description:"Show suggestions when hovering over diagnostics.",scope:"application"},"amp.tab.experimental.displayMode":{type:"string",enum:["eager","subtle"],default:"eager",description:"Experimental: Control how Amp Tab suggestions are displayed. 'eager' = show diff immediately, 'subtle' = show 'Tab to Jump' first, then show diff after user interaction.",scope:"application"},"amp.tab.experimental.disableClientFilters":{type:"array",items:{type:"string",enum:["recentlyRejectedCodeToRewrite","recentEdits","rewriteAreaOverlap","bigModification","incompatibleWithSelectedCompletionContextItem","recentlyRejectedDiff","whiteSpaceOnlyChange","formattingOnlyChange"]},default:[],description:"Experimental: Disable specific client-side filters to observe unfiltered model behavior.",scope:"application"},"amp.ui.zoomLevel":{type:"number",default:1,description:"Zoom level for the Amp UI",scope:"application"},"amp.experimental.gitblame":{type:"boolean",default:!1,description:"Experimental: Show git blame authors when editing code.",scope:"application"},"amp.git.commit.coauthor.enabled":{type:"boolean",default:!0,description:"Enable adding Amp as co-author in git commits",scope:"window"},"amp.git.commit.ampThread.enabled":{type:"boolean",default:!0,description:"Enable adding Amp-Thread trailer in git commits",scope:"window"},"amp.gpt5":{type:"boolean",default:!1,description:"[DEPRECATED] GPT-5 is no longer available as the main model. It's now the oracle. See https://ampcode.com/news/gpt-5-oracle",scope:"window",deprecationMessage:"GPT-5 is no longer available as the main model. It's now the oracle. See https://ampcode.com/news/gpt-5-oracle"}}},icons:{"amp-agent-file":{description:"Amp agent file",default:{fontPath:"resources/amp-icons.woff",fontCharacter:"\\0041"}}}},capabilities:{untrustedWorkspaces:{supported:"limited",description:"Amp only uses MCP servers from trusted workspaces because they execute code.",restrictedConfigurations:["amp.mcpServers","amp.mcpPermissions","amp.url"]},virtualWorkspaces:{supported:!1,description:"Amp is not supported in virtual workspaces like GitHub.dev because Amp requires local file system access and terminal capabilities."}},dependencies:{"@opentelemetry/api":"^1.9.0","@opentelemetry/api-logs":"^0.57.2","@opentelemetry/core":"^1.30.1","@opentelemetry/exporter-logs-otlp-http":"^0.57.2","@opentelemetry/exporter-metrics-otlp-http":"^0.57.2","@opentelemetry/exporter-trace-otlp-http":"^0.57.2","@opentelemetry/resources":"^1.30.1","@opentelemetry/sdk-logs":"^0.57.2","@opentelemetry/sdk-metrics":"^1.30.1","@opentelemetry/sdk-node":"^0.57.2","@opentelemetry/sdk-trace-base":"^1.30.1","@opentelemetry/sdk-trace-node":"^1.30.1","@opentelemetry/semantic-conventions":"^1.34.0","@sourcegraph/amp-core":"workspace:*","@sourcegraph/amp-uri":"workspace:*","@sourcegraph/observable":"workspace:*","canvaskit-wasm":"^0.40.0","detect-indent":"^7.0.1","fast-json-stable-stringify":"^2.1.0","fast-myers-diff":"^3.2.0","fast-xml-parser":"^5.2.3",isbinaryfile:"^5.0.5","jsonc-parser":"^3.3.1",lodash:"^4.17.21","lru-cache":"^11.1.0","node-fetch":"^3.3.2",shiki:"3.8.1",systeminformation:"^5.27.7",uuid:"^11.1.0","vscode-languageserver-textdocument":"^1.0.12","wink-nlp-utils":"^2.1.0",ws:"^8.18.3"},devDependencies:{"@sourcegraph/amp-web":"workspace:*","@types/jest-image-snapshot":"^6.4.0","@types/lodash":"^4.17.15","@types/node":"catalog:","@types/uuid":"^10.0.0","@types/vscode":"^1.79.0","@types/ws":"^8.18.1","@vscode/test-electron":"^2.4.1","@vscode/test-web":"*","@vscode/vsce":"^3.2.2","cross-env":"^7.0.3","crypto-browserify":"^3.12.1","jest-image-snapshot":"^6.5.0","os-browserify":"^0.3.0","path-browserify":"^1.0.1","rollup-plugin-polyfill-node":"^0.13.0",tsx:"^4.19.4","vite-plugin-static-copy":"^3.0.0"}}});var Fl1="run_terminal_command",Cd="read_file",Hl1="write_file",t5="Task",Bl1="chat_llm",T5="finder",HB="fast_finder",sq="xai_finder",oq="kimiK2_finder",BB="gossip_finder",DB="sonoma_finder",kN="get_diagnostics",i4="Bash",e5="oracle",WS="mermaid",MB="todo_read",JJ="todo_write",tq="read_web_page",Sd="read_thread",Dl1="run_javascript",_J="create_file",VB="glob",Ml1="Glob",vd="undo_edit",kd="read_mcp_resource",t8="Read",jQ="edit_file",_d="format_file",NB="web_search",k4="Grep",FS="Check",eq="librarian",xd="read_github",bd="search_github",yd="commit_search",fd="list_directory_github",hd="list_repositories",gd="glob_github",md="diff",Vl1;var F8=B1(()=>{Vl1=["Task","chat_llm","finder","fast_finder","xai_finder","kimiK2_finder","gossip_finder","sonoma_finder","get_diagnostics","Bash","oracle","mermaid","todo_read","todo_write","read_web_page","run_javascript","create_file","glob","Glob","undo_edit","Read","edit_file","delete_file","format_file","web_search","Grep","search_documents","get_document","Check","code_review","librarian","read_thread"]});var HS=t((wU9,Ll1)=>{var Nl1={DOT_LITERAL:"\\.",PLUS_LITERAL:"\\+",QMARK_LITERAL:"\\?",SLASH_LITERAL:"\\/",ONE_CHAR:"(?=.)",QMARK:"[^/]",END_ANCHOR:"(?:\\/|$)",DOTS_SLASH:"\\.{1,2}(?:\\/|$)",NO_DOT:"(?!\\.)",NO_DOTS:"(?!(?:^|\\/)\\.{1,2}(?:\\/|$))",NO_DOT_SLASH:"(?!\\.{0,1}(?:\\/|$))",NO_DOTS_SLASH:"(?!\\.{1,2}(?:\\/|$))",QMARK_NO_DOT:"[^.\\/]",STAR:"[^/]*?",START_ANCHOR:"(?:^|\\/)",SEP:"/"},sF6={...Nl1,SLASH_LITERAL:"[\\\\/]",QMARK:"[^\\\\/]",STAR:"[^\\\\/]*?",DOTS_SLASH:"\\.{1,2}(?:[\\\\/]|$)",NO_DOT:"(?!\\.)",NO_DOTS:"(?!(?:^|[\\\\/])\\.{1,2}(?:[\\\\/]|$))",NO_DOT_SLASH:"(?!\\.{0,1}(?:[\\\\/]|$))",NO_DOTS_SLASH:"(?!\\.{1,2}(?:[\\\\/]|$))",QMARK_NO_DOT:"[^.\\\\/]",START_ANCHOR:"(?:^|[\\\\/])",END_ANCHOR:"(?:[\\\\/]|$)",SEP:"\\"},oF6={alnum:"a-zA-Z0-9",alpha:"a-zA-Z",ascii:"\\x00-\\x7F",blank:" \\t",cntrl:"\\x00-\\x1F\\x7F",digit:"0-9",graph:"\\x21-\\x7E",lower:"a-z",print:"\\x20-\\x7E ",punct:"\\-!\"#$%&'()\\*+,./:;<=>?@[\\]^_`{|}~",space:" \\t\\r\\n\\v\\f",upper:"A-Z",word:"A-Za-z0-9_",xdigit:"A-Fa-f0-9"};Ll1.exports={MAX_LENGTH:65536,POSIX_REGEX_SOURCE:oF6,REGEX_BACKSLASH:/\\(?![*+?^${}(|)[\]])/g,REGEX_NON_SPECIAL_CHARS:/^[^@![\].,$*+?^{}()|\\/]+/,REGEX_SPECIAL_CHARS:/[-*+?.^${}(|)[\]]/,REGEX_SPECIAL_CHARS_BACKREF:/(\\?)((\W)(\3*))/g,REGEX_SPECIAL_CHARS_GLOBAL:/([-*+?.^${}(|)[\]])/g,REGEX_REMOVE_BACKSLASH:/(?:\[.*?[^\\]\]|\\(?=.))/g,REPLACEMENTS:{__proto__:null,"***":"*","**/**":"**","**/**/**":"**"},CHAR_0:48,CHAR_9:57,CHAR_UPPERCASE_A:65,CHAR_LOWERCASE_A:97,CHAR_UPPERCASE_Z:90,CHAR_LOWERCASE_Z:122,CHAR_LEFT_PARENTHESES:40,CHAR_RIGHT_PARENTHESES:41,CHAR_ASTERISK:42,CHAR_AMPERSAND:38,CHAR_AT:64,CHAR_BACKWARD_SLASH:92,CHAR_CARRIAGE_RETURN:13,CHAR_CIRCUMFLEX_ACCENT:94,CHAR_COLON:58,CHAR_COMMA:44,CHAR_DOT:46,CHAR_DOUBLE_QUOTE:34,CHAR_EQUAL:61,CHAR_EXCLAMATION_MARK:33,CHAR_FORM_FEED:12,CHAR_FORWARD_SLASH:47,CHAR_GRAVE_ACCENT:96,CHAR_HASH:35,CHAR_HYPHEN_MINUS:45,CHAR_LEFT_ANGLE_BRACKET:60,CHAR_LEFT_CURLY_BRACE:123,CHAR_LEFT_SQUARE_BRACKET:91,CHAR_LINE_FEED:10,CHAR_NO_BREAK_SPACE:160,CHAR_PERCENT:37,CHAR_PLUS:43,CHAR_QUESTION_MARK:63,CHAR_RIGHT_ANGLE_BRACKET:62,CHAR_RIGHT_CURLY_BRACE:125,CHAR_RIGHT_SQUARE_BRACKET:93,CHAR_SEMICOLON:59,CHAR_SINGLE_QUOTE:39,CHAR_SPACE:32,CHAR_TAB:9,CHAR_UNDERSCORE:95,CHAR_VERTICAL_LINE:124,CHAR_ZERO_WIDTH_NOBREAK_SPACE:65279,extglobChars(J){return{"!":{type:"negate",open:"(?:(?!(?:",close:`))${J.STAR})`},"?":{type:"qmark",open:"(?:",close:")?"},"+":{type:"plus",open:"(?:",close:")+"},"*":{type:"star",open:"(?:",close:")*"},"@":{type:"at",open:"(?:",close:")"}}},globChars(J){return J===!0?sF6:Nl1}}});var BS=t((ZH6)=>{var{REGEX_BACKSLASH:tF6,REGEX_REMOVE_BACKSLASH:eF6,REGEX_SPECIAL_CHARS:JH6,REGEX_SPECIAL_CHARS_GLOBAL:QH6}=HS();ZH6.isObject=(J)=>J!==null&&typeof J==="object"&&!Array.isArray(J);ZH6.hasRegexChars=(J)=>JH6.test(J);ZH6.isRegexChar=(J)=>J.length===1&&ZH6.hasRegexChars(J);ZH6.escapeRegex=(J)=>J.replace(QH6,"\\$1");ZH6.toPosixSlashes=(J)=>J.replace(tF6,"/");ZH6.isWindows=()=>{if(typeof navigator<"u"&&navigator.platform){let J=navigator.platform.toLowerCase();return J==="win32"||J==="windows"}if(typeof process<"u"&&process.platform)return process.platform==="win32";return!1};ZH6.removeBackslashes=(J)=>{return J.replace(eF6,(Q)=>{return Q==="\\"?"":Q})};ZH6.escapeLast=(J,Q,Z)=>{let X=J.lastIndexOf(Q,Z);if(X===-1)return J;if(J[X-1]==="\\")return ZH6.escapeLast(J,Q,X-1);return`${J.slice(0,X)}\\${J.slice(X)}`};ZH6.removePrefix=(J,Q={})=>{let Z=J;if(Z.startsWith("./"))Z=Z.slice(2),Q.prefix="./";return Z};ZH6.wrapOutput=(J,Q={},Z={})=>{let X=Z.contains?"":"^",Y=Z.contains?"":"$",K=`${X}(?:${J})${Y}`;if(Q.negated===!0)K=`(?:^(?!${K}).*$)`;return K};ZH6.basename=(J,{windows:Q}={})=>{let Z=J.split(Q?/[\\/]/:"/"),X=Z[Z.length-1];if(X==="")return Z[Z.length-2];return X}});var Tl1=t((OU9,Pl1)=>{var Rl1=BS(),{CHAR_ASTERISK:dZ1,CHAR_AT:HH6,CHAR_BACKWARD_SLASH:DS,CHAR_COMMA:BH6,CHAR_DOT:cZ1,CHAR_EXCLAMATION_MARK:lZ1,CHAR_FORWARD_SLASH:Il1,CHAR_LEFT_CURLY_BRACE:iZ1,CHAR_LEFT_PARENTHESES:aZ1,CHAR_LEFT_SQUARE_BRACKET:DH6,CHAR_PLUS:MH6,CHAR_QUESTION_MARK:Ol1,CHAR_RIGHT_CURLY_BRACE:VH6,CHAR_RIGHT_PARENTHESES:jl1,CHAR_RIGHT_SQUARE_BRACKET:NH6}=HS(),$l1=(J)=>{return J===Il1||J===DS},El1=(J)=>{if(J.isPrefix!==!0)J.depth=J.isGlobstar?1/0:1},LH6=(J,Q)=>{let Z=Q||{},X=J.length-1,Y=Z.parts===!0||Z.scanToEnd===!0,K=[],G=[],q=[],z=J,U=-1,W=0,F=0,H=!1,B=!1,M=!1,V=!1,N=!1,L=!1,A=!1,w=!1,R=!1,O=!1,$=0,j,E,I={value:"",depth:0,isGlob:!1},T=()=>U>=X,S=()=>z.charCodeAt(U+1),_=()=>{return j=E,z.charCodeAt(++U)};while(U<X){E=_();let g;if(E===DS){if(A=I.backslashes=!0,E=_(),E===iZ1)L=!0;continue}if(L===!0||E===iZ1){$++;while(T()!==!0&&(E=_())){if(E===DS){A=I.backslashes=!0,_();continue}if(E===iZ1){$++;continue}if(L!==!0&&E===cZ1&&(E=_())===cZ1){if(H=I.isBrace=!0,M=I.isGlob=!0,O=!0,Y===!0)continue;break}if(L!==!0&&E===BH6){if(H=I.isBrace=!0,M=I.isGlob=!0,O=!0,Y===!0)continue;break}if(E===VH6){if($--,$===0){L=!1,H=I.isBrace=!0,O=!0;break}}}if(Y===!0)continue;break}if(E===Il1){if(K.push(U),G.push(I),I={value:"",depth:0,isGlob:!1},O===!0)continue;if(j===cZ1&&U===W+1){W+=2;continue}F=U+1;continue}if(Z.noext!==!0){if((E===MH6||E===HH6||E===dZ1||E===Ol1||E===lZ1)===!0&&S()===aZ1){if(M=I.isGlob=!0,V=I.isExtglob=!0,O=!0,E===lZ1&&U===W)R=!0;if(Y===!0){while(T()!==!0&&(E=_())){if(E===DS){A=I.backslashes=!0,E=_();continue}if(E===jl1){M=I.isGlob=!0,O=!0;break}}continue}break}}if(E===dZ1){if(j===dZ1)N=I.isGlobstar=!0;if(M=I.isGlob=!0,O=!0,Y===!0)continue;break}if(E===Ol1){if(M=I.isGlob=!0,O=!0,Y===!0)continue;break}if(E===DH6){while(T()!==!0&&(g=_())){if(g===DS){A=I.backslashes=!0,_();continue}if(g===NH6){B=I.isBracket=!0,M=I.isGlob=!0,O=!0;break}}if(Y===!0)continue;break}if(Z.nonegate!==!0&&E===lZ1&&U===W){w=I.negated=!0,W++;continue}if(Z.noparen!==!0&&E===aZ1){if(M=I.isGlob=!0,Y===!0){while(T()!==!0&&(E=_())){if(E===aZ1){A=I.backslashes=!0,E=_();continue}if(E===jl1){O=!0;break}}continue}break}if(M===!0){if(O=!0,Y===!0)continue;break}}if(Z.noext===!0)V=!1,M=!1;let h=z,v="",x="";if(W>0)v=z.slice(0,W),z=z.slice(W),F-=W;if(h&&M===!0&&F>0)h=z.slice(0,F),x=z.slice(F);else if(M===!0)h="",x=z;else h=z;if(h&&h!==""&&h!=="/"&&h!==z){if($l1(h.charCodeAt(h.length-1)))h=h.slice(0,-1)}if(Z.unescape===!0){if(x)x=Rl1.removeBackslashes(x);if(h&&A===!0)h=Rl1.removeBackslashes(h)}let y={prefix:v,input:J,start:W,base:h,glob:x,isBrace:H,isBracket:B,isGlob:M,isExtglob:V,isGlobstar:N,negated:w,negatedExtglob:R};if(Z.tokens===!0){if(y.maxDepth=0,!$l1(E))G.push(I);y.tokens=G}if(Z.parts===!0||Z.tokens===!0){let g;for(let k=0;k<K.length;k++){let f=g?g+1:W,b=K[k],m=J.slice(f,b);if(Z.tokens){if(k===0&&W!==0)G[k].isPrefix=!0,G[k].value=v;else G[k].value=m;El1(G[k]),y.maxDepth+=G[k].depth}if(k!==0||m!=="")q.push(m);g=b}if(g&&g+1<J.length){let k=J.slice(g+1);if(q.push(k),Z.tokens)G[G.length-1].value=k,El1(G[G.length-1]),y.maxDepth+=G[G.length-1].depth}y.slashes=K,y.parts=q}return y};Pl1.exports=LH6});var vl1=t((jU9,Sl1)=>{var ud=HS(),Jz=BS(),{MAX_LENGTH:pd,POSIX_REGEX_SOURCE:AH6,REGEX_NON_SPECIAL_CHARS:wH6,REGEX_SPECIAL_CHARS_BACKREF:RH6,REPLACEMENTS:Cl1}=ud,OH6=(J,Q)=>{if(typeof Q.expandRange==="function")return Q.expandRange(...J,Q);J.sort();let Z=`[${J.join("-")}]`;try{new RegExp(Z)}catch(X){return J.map((Y)=>Jz.escapeRegex(Y)).join("..")}return Z},QO=(J,Q)=>{return`Missing ${J}: "${Q}" - use "\\\\${Q}" to match literal characters`},nZ1=(J,Q)=>{if(typeof J!=="string")throw TypeError("Expected a string");J=Cl1[J]||J;let Z={...Q},X=typeof Z.maxLength==="number"?Math.min(pd,Z.maxLength):pd,Y=J.length;if(Y>X)throw SyntaxError(`Input length: ${Y}, exceeds maximum allowed length: ${X}`);let K={type:"bos",value:"",output:Z.prepend||""},G=[K],q=Z.capture?"":"?:",z=ud.globChars(Z.windows),U=ud.extglobChars(z),{DOT_LITERAL:W,PLUS_LITERAL:F,SLASH_LITERAL:H,ONE_CHAR:B,DOTS_SLASH:M,NO_DOT:V,NO_DOT_SLASH:N,NO_DOTS_SLASH:L,QMARK:A,QMARK_NO_DOT:w,STAR:R,START_ANCHOR:O}=z,$=(F1)=>{return`(${q}(?:(?!${O}${F1.dot?M:W}).)*?)`},j=Z.dot?"":V,E=Z.dot?A:w,I=Z.bash===!0?$(Z):R;if(Z.capture)I=`(${I})`;if(typeof Z.noext==="boolean")Z.noextglob=Z.noext;let T={input:J,index:-1,start:0,dot:Z.dot===!0,consumed:"",output:"",prefix:"",backtrack:!1,negated:!1,brackets:0,braces:0,parens:0,quotes:0,globstar:!1,tokens:G};J=Jz.removePrefix(J,T),Y=J.length;let S=[],_=[],h=[],v=K,x,y=()=>T.index===Y-1,g=T.peek=(F1=1)=>J[T.index+F1],k=T.advance=()=>J[++T.index]||"",f=()=>J.slice(T.index+1),b=(F1="",l=0)=>{T.consumed+=F1,T.index+=l},m=(F1)=>{T.output+=F1.output!=null?F1.output:F1.value,b(F1.value)},a=()=>{let F1=1;while(g()==="!"&&(g(2)!=="("||g(3)==="?"))k(),T.start++,F1++;if(F1%2===0)return!1;return T.negated=!0,T.start++,!0},p=(F1)=>{T[F1]++,h.push(F1)},e=(F1)=>{T[F1]--,h.pop()},G1=(F1)=>{if(v.type==="globstar"){let l=T.braces>0&&(F1.type==="comma"||F1.type==="brace"),d=F1.extglob===!0||S.length&&(F1.type==="pipe"||F1.type==="paren");if(F1.type!=="slash"&&F1.type!=="paren"&&!l&&!d)T.output=T.output.slice(0,-v.output.length),v.type="star",v.value="*",v.output=I,T.output+=v.output}if(S.length&&F1.type!=="paren")S[S.length-1].inner+=F1.value;if(F1.value||F1.output)m(F1);if(v&&v.type==="text"&&F1.type==="text"){v.output=(v.output||v.value)+F1.value,v.value+=F1.value;return}F1.prev=v,G.push(F1),v=F1},W1=(F1,l)=>{let d={...U[l],conditions:1,inner:""};d.prev=v,d.parens=T.parens,d.output=T.output;let i=(Z.capture?"(":"")+d.open;p("parens"),G1({type:F1,value:l,output:T.output?"":B}),G1({type:"paren",extglob:!0,value:k(),output:i}),S.push(d)},Z1=(F1)=>{let l=F1.close+(Z.capture?")":""),d;if(F1.type==="negate"){let i=I;if(F1.inner&&F1.inner.length>1&&F1.inner.includes("/"))i=$(Z);if(i!==I||y()||/^\)+$/.test(f()))l=F1.close=`)$))${i}`;if(F1.inner.includes("*")&&(d=f())&&/^\.[^\\/.]+$/.test(d)){let n=nZ1(d,{...Q,fastpaths:!1}).output;l=F1.close=`)${n})${i})`}if(F1.prev.type==="bos")T.negatedExtglob=!0}G1({type:"paren",extglob:!0,value:x,output:l}),e("parens")};if(Z.fastpaths!==!1&&!/(^[*!]|[/()[\]{}"])/.test(J)){let F1=!1,l=J.replace(RH6,(d,i,n,s,Y1,J1)=>{if(s==="\\")return F1=!0,d;if(s==="?"){if(i)return i+s+(Y1?A.repeat(Y1.length):"");if(J1===0)return E+(Y1?A.repeat(Y1.length):"");return A.repeat(n.length)}if(s===".")return W.repeat(n.length);if(s==="*"){if(i)return i+s+(Y1?I:"");return I}return i?d:`\\${d}`});if(F1===!0)if(Z.unescape===!0)l=l.replace(/\\/g,"");else l=l.replace(/\\+/g,(d)=>{return d.length%2===0?"\\\\":d?"\\":""});if(l===J&&Z.contains===!0)return T.output=J,T;return T.output=Jz.wrapOutput(l,T,Q),T}while(!y()){if(x=k(),x==="\x00")continue;if(x==="\\"){let d=g();if(d==="/"&&Z.bash!==!0)continue;if(d==="."||d===";")continue;if(!d){x+="\\",G1({type:"text",value:x});continue}let i=/^\\+/.exec(f()),n=0;if(i&&i[0].length>2){if(n=i[0].length,T.index+=n,n%2!==0)x+="\\"}if(Z.unescape===!0)x=k();else x+=k();if(T.brackets===0){G1({type:"text",value:x});continue}}if(T.brackets>0&&(x!=="]"||v.value==="["||v.value==="[^")){if(Z.posix!==!1&&x===":"){let d=v.value.slice(1);if(d.includes("[")){if(v.posix=!0,d.includes(":")){let i=v.value.lastIndexOf("["),n=v.value.slice(0,i),s=v.value.slice(i+2),Y1=AH6[s];if(Y1){if(v.value=n+Y1,T.backtrack=!0,k(),!K.output&&G.indexOf(v)===1)K.output=B;continue}}}}if(x==="["&&g()!==":"||x==="-"&&g()==="]")x=`\\${x}`;if(x==="]"&&(v.value==="["||v.value==="[^"))x=`\\${x}`;if(Z.posix===!0&&x==="!"&&v.value==="[")x="^";v.value+=x,m({value:x});continue}if(T.quotes===1&&x!=='"'){x=Jz.escapeRegex(x),v.value+=x,m({value:x});continue}if(x==='"'){if(T.quotes=T.quotes===1?0:1,Z.keepQuotes===!0)G1({type:"text",value:x});continue}if(x==="("){p("parens"),G1({type:"paren",value:x});continue}if(x===")"){if(T.parens===0&&Z.strictBrackets===!0)throw SyntaxError(QO("opening","("));let d=S[S.length-1];if(d&&T.parens===d.parens+1){Z1(S.pop());continue}G1({type:"paren",value:x,output:T.parens?")":"\\)"}),e("parens");continue}if(x==="["){if(Z.nobracket===!0||!f().includes("]")){if(Z.nobracket!==!0&&Z.strictBrackets===!0)throw SyntaxError(QO("closing","]"));x=`\\${x}`}else p("brackets");G1({type:"bracket",value:x});continue}if(x==="]"){if(Z.nobracket===!0||v&&v.type==="bracket"&&v.value.length===1){G1({type:"text",value:x,output:`\\${x}`});continue}if(T.brackets===0){if(Z.strictBrackets===!0)throw SyntaxError(QO("opening","["));G1({type:"text",value:x,output:`\\${x}`});continue}e("brackets");let d=v.value.slice(1);if(v.posix!==!0&&d[0]==="^"&&!d.includes("/"))x=`/${x}`;if(v.value+=x,m({value:x}),Z.literalBrackets===!1||Jz.hasRegexChars(d))continue;let i=Jz.escapeRegex(v.value);if(T.output=T.output.slice(0,-v.value.length),Z.literalBrackets===!0){T.output+=i,v.value=i;continue}v.value=`(${q}${i}|${v.value})`,T.output+=v.value;continue}if(x==="{"&&Z.nobrace!==!0){p("braces");let d={type:"brace",value:x,output:"(",outputIndex:T.output.length,tokensIndex:T.tokens.length};_.push(d),G1(d);continue}if(x==="}"){let d=_[_.length-1];if(Z.nobrace===!0||!d){G1({type:"text",value:x,output:x});continue}let i=")";if(d.dots===!0){let n=G.slice(),s=[];for(let Y1=n.length-1;Y1>=0;Y1--){if(G.pop(),n[Y1].type==="brace")break;if(n[Y1].type!=="dots")s.unshift(n[Y1].value)}i=OH6(s,Z),T.backtrack=!0}if(d.comma!==!0&&d.dots!==!0){let n=T.output.slice(0,d.outputIndex),s=T.tokens.slice(d.tokensIndex);d.value=d.output="\\{",x=i="\\}",T.output=n;for(let Y1 of s)T.output+=Y1.output||Y1.value}G1({type:"brace",value:x,output:i}),e("braces"),_.pop();continue}if(x==="|"){if(S.length>0)S[S.length-1].conditions++;G1({type:"text",value:x});continue}if(x===","){let d=x,i=_[_.length-1];if(i&&h[h.length-1]==="braces")i.comma=!0,d="|";G1({type:"comma",value:x,output:d});continue}if(x==="/"){if(v.type==="dot"&&T.index===T.start+1){T.start=T.index+1,T.consumed="",T.output="",G.pop(),v=K;continue}G1({type:"slash",value:x,output:H});continue}if(x==="."){if(T.braces>0&&v.type==="dot"){if(v.value===".")v.output=W;let d=_[_.length-1];v.type="dots",v.output+=x,v.value+=x,d.dots=!0;continue}if(T.braces+T.parens===0&&v.type!=="bos"&&v.type!=="slash"){G1({type:"text",value:x,output:W});continue}G1({type:"dot",value:x,output:W});continue}if(x==="?"){if(!(v&&v.value==="(")&&Z.noextglob!==!0&&g()==="("&&g(2)!=="?"){W1("qmark",x);continue}if(v&&v.type==="paren"){let i=g(),n=x;if(v.value==="("&&!/[!=<:]/.test(i)||i==="<"&&!/<([!=]|\w+>)/.test(f()))n=`\\${x}`;G1({type:"text",value:x,output:n});continue}if(Z.dot!==!0&&(v.type==="slash"||v.type==="bos")){G1({type:"qmark",value:x,output:w});continue}G1({type:"qmark",value:x,output:A});continue}if(x==="!"){if(Z.noextglob!==!0&&g()==="("){if(g(2)!=="?"||!/[!=<:]/.test(g(3))){W1("negate",x);continue}}if(Z.nonegate!==!0&&T.index===0){a();continue}}if(x==="+"){if(Z.noextglob!==!0&&g()==="("&&g(2)!=="?"){W1("plus",x);continue}if(v&&v.value==="("||Z.regex===!1){G1({type:"plus",value:x,output:F});continue}if(v&&(v.type==="bracket"||v.type==="paren"||v.type==="brace")||T.parens>0){G1({type:"plus",value:x});continue}G1({type:"plus",value:F});continue}if(x==="@"){if(Z.noextglob!==!0&&g()==="("&&g(2)!=="?"){G1({type:"at",extglob:!0,value:x,output:""});continue}G1({type:"text",value:x});continue}if(x!=="*"){if(x==="$"||x==="^")x=`\\${x}`;let d=wH6.exec(f());if(d)x+=d[0],T.index+=d[0].length;G1({type:"text",value:x});continue}if(v&&(v.type==="globstar"||v.star===!0)){v.type="star",v.star=!0,v.value+=x,v.output=I,T.backtrack=!0,T.globstar=!0,b(x);continue}let F1=f();if(Z.noextglob!==!0&&/^\([^?]/.test(F1)){W1("star",x);continue}if(v.type==="star"){if(Z.noglobstar===!0){b(x);continue}let d=v.prev,i=d.prev,n=d.type==="slash"||d.type==="bos",s=i&&(i.type==="star"||i.type==="globstar");if(Z.bash===!0&&(!n||F1[0]&&F1[0]!=="/")){G1({type:"star",value:x,output:""});continue}let Y1=T.braces>0&&(d.type==="comma"||d.type==="brace"),J1=S.length&&(d.type==="pipe"||d.type==="paren");if(!n&&d.type!=="paren"&&!Y1&&!J1){G1({type:"star",value:x,output:""});continue}while(F1.slice(0,3)==="/**"){let H1=J[T.index+4];if(H1&&H1!=="/")break;F1=F1.slice(3),b("/**",3)}if(d.type==="bos"&&y()){v.type="globstar",v.value+=x,v.output=$(Z),T.output=v.output,T.globstar=!0,b(x);continue}if(d.type==="slash"&&d.prev.type!=="bos"&&!s&&y()){T.output=T.output.slice(0,-(d.output+v.output).length),d.output=`(?:${d.output}`,v.type="globstar",v.output=$(Z)+(Z.strictSlashes?")":"|$)"),v.value+=x,T.globstar=!0,T.output+=d.output+v.output,b(x);continue}if(d.type==="slash"&&d.prev.type!=="bos"&&F1[0]==="/"){let H1=F1[1]!==void 0?"|$":"";T.output=T.output.slice(0,-(d.output+v.output).length),d.output=`(?:${d.output}`,v.type="globstar",v.output=`${$(Z)}${H}|${H}${H1})`,v.value+=x,T.output+=d.output+v.output,T.globstar=!0,b(x+k()),G1({type:"slash",value:"/",output:""});continue}if(d.type==="bos"&&F1[0]==="/"){v.type="globstar",v.value+=x,v.output=`(?:^|${H}|${$(Z)}${H})`,T.output=v.output,T.globstar=!0,b(x+k()),G1({type:"slash",value:"/",output:""});continue}T.output=T.output.slice(0,-v.output.length),v.type="globstar",v.output=$(Z),v.value+=x,T.output+=v.output,T.globstar=!0,b(x);continue}let l={type:"star",value:x,output:I};if(Z.bash===!0){if(l.output=".*?",v.type==="bos"||v.type==="slash")l.output=j+l.output;G1(l);continue}if(v&&(v.type==="bracket"||v.type==="paren")&&Z.regex===!0){l.output=x,G1(l);continue}if(T.index===T.start||v.type==="slash"||v.type==="dot"){if(v.type==="dot")T.output+=N,v.output+=N;else if(Z.dot===!0)T.output+=L,v.output+=L;else T.output+=j,v.output+=j;if(g()!=="*")T.output+=B,v.output+=B}G1(l)}while(T.brackets>0){if(Z.strictBrackets===!0)throw SyntaxError(QO("closing","]"));T.output=Jz.escapeLast(T.output,"["),e("brackets")}while(T.parens>0){if(Z.strictBrackets===!0)throw SyntaxError(QO("closing",")"));T.output=Jz.escapeLast(T.output,"("),e("parens")}while(T.braces>0){if(Z.strictBrackets===!0)throw SyntaxError(QO("closing","}"));T.output=Jz.escapeLast(T.output,"{"),e("braces")}if(Z.strictSlashes!==!0&&(v.type==="star"||v.type==="bracket"))G1({type:"maybe_slash",value:"",output:`${H}?`});if(T.backtrack===!0){T.output="";for(let F1 of T.tokens)if(T.output+=F1.output!=null?F1.output:F1.value,F1.suffix)T.output+=F1.suffix}return T};nZ1.fastpaths=(J,Q)=>{let Z={...Q},X=typeof Z.maxLength==="number"?Math.min(pd,Z.maxLength):pd,Y=J.length;if(Y>X)throw SyntaxError(`Input length: ${Y}, exceeds maximum allowed length: ${X}`);J=Cl1[J]||J;let{DOT_LITERAL:K,SLASH_LITERAL:G,ONE_CHAR:q,DOTS_SLASH:z,NO_DOT:U,NO_DOTS:W,NO_DOTS_SLASH:F,STAR:H,START_ANCHOR:B}=ud.globChars(Z.windows),M=Z.dot?W:U,V=Z.dot?F:U,N=Z.capture?"":"?:",L={negated:!1,prefix:""},A=Z.bash===!0?".*?":H;if(Z.capture)A=`(${A})`;let w=(j)=>{if(j.noglobstar===!0)return A;return`(${N}(?:(?!${B}${j.dot?z:K}).)*?)`},R=(j)=>{switch(j){case"*":return`${M}${q}${A}`;case".*":return`${K}${q}${A}`;case"*.*":return`${M}${A}${K}${q}${A}`;case"*/*":return`${M}${A}${G}${q}${V}${A}`;case"**":return M+w(Z);case"**/*":return`(?:${M}${w(Z)}${G})?${V}${q}${A}`;case"**/*.*":return`(?:${M}${w(Z)}${G})?${V}${A}${K}${q}${A}`;case"**/.*":return`(?:${M}${w(Z)}${G})?${K}${q}${A}`;default:{let E=/^(.*?)\.(\w+)$/.exec(j);if(!E)return;let I=R(E[1]);if(!I)return;return I+K+E[2]}}},O=Jz.removePrefix(J,L),$=R(O);if($&&Z.strictSlashes!==!0)$+=`${G}?`;return $};Sl1.exports=nZ1});var MS=t(($U9,_l1)=>{var jH6=Tl1(),rZ1=vl1(),kl1=BS(),$H6=HS(),EH6=(J)=>J&&typeof J==="object"&&!Array.isArray(J),F7=(J,Q,Z=!1)=>{if(Array.isArray(J)){let W=J.map((H)=>F7(H,Q,Z));return(H)=>{for(let B of W){let M=B(H);if(M)return M}return!1}}let X=EH6(J)&&J.tokens&&J.input;if(J===""||typeof J!=="string"&&!X)throw TypeError("Expected pattern to be a non-empty string");let Y=Q||{},K=Y.windows,G=X?F7.compileRe(J,Q):F7.makeRe(J,Q,!1,!0),q=G.state;delete G.state;let z=()=>!1;if(Y.ignore){let W={...Q,ignore:null,onMatch:null,onResult:null};z=F7(Y.ignore,W,Z)}let U=(W,F=!1)=>{let{isMatch:H,match:B,output:M}=F7.test(W,G,Q,{glob:J,posix:K}),V={glob:J,state:q,regex:G,posix:K,input:W,output:M,match:B,isMatch:H};if(typeof Y.onResult==="function")Y.onResult(V);if(H===!1)return V.isMatch=!1,F?V:!1;if(z(W)){if(typeof Y.onIgnore==="function")Y.onIgnore(V);return V.isMatch=!1,F?V:!1}if(typeof Y.onMatch==="function")Y.onMatch(V);return F?V:!0};if(Z)U.state=q;return U};F7.test=(J,Q,Z,{glob:X,posix:Y}={})=>{if(typeof J!=="string")throw TypeError("Expected input to be a string");if(J==="")return{isMatch:!1,output:""};let K=Z||{},G=K.format||(Y?kl1.toPosixSlashes:null),q=J===X,z=q&&G?G(J):J;if(q===!1)z=G?G(J):J,q=z===X;if(q===!1||K.capture===!0)if(K.matchBase===!0||K.basename===!0)q=F7.matchBase(J,Q,Z,Y);else q=Q.exec(z);return{isMatch:Boolean(q),match:q,output:z}};F7.matchBase=(J,Q,Z)=>{return(Q instanceof RegExp?Q:F7.makeRe(Q,Z)).test(kl1.basename(J))};F7.isMatch=(J,Q,Z)=>F7(Q,Z)(J);F7.parse=(J,Q)=>{if(Array.isArray(J))return J.map((Z)=>F7.parse(Z,Q));return rZ1(J,{...Q,fastpaths:!1})};F7.scan=(J,Q)=>jH6(J,Q);F7.compileRe=(J,Q,Z=!1,X=!1)=>{if(Z===!0)return J.output;let Y=Q||{},K=Y.contains?"":"^",G=Y.contains?"":"$",q=`${K}(?:${J.output})${G}`;if(J&&J.negated===!0)q=`^(?!${q}).*$`;let z=F7.toRegex(q,Q);if(X===!0)z.state=J;return z};F7.makeRe=(J,Q={},Z=!1,X=!1)=>{if(!J||typeof J!=="string")throw TypeError("Expected a non-empty string");let Y={negated:!1,fastpaths:!0};if(Q.fastpaths!==!1&&(J[0]==="."||J[0]==="*"))Y.output=rZ1.fastpaths(J,Q);if(!Y.output)Y=rZ1(J,Q);return F7.compileRe(Y,Q,Z,X)};F7.toRegex=(J,Q)=>{try{let Z=Q||{};return new RegExp(J,Z.flags||(Z.nocase?"i":""))}catch(Z){if(Q&&Q.debug===!0)throw Z;return/$^/}};F7.constants=$H6;_l1.exports=F7});var _N=t((EU9,yl1)=>{var xl1=MS(),IH6=BS();function bl1(J,Q,Z=!1){if(Q&&(Q.windows===null||Q.windows===void 0))Q={...Q,windows:IH6.isWindows()};return xl1(J,Q,Z)}Object.assign(bl1,xl1);yl1.exports=bl1});function dd(J){if(!J)return null;let Z=ld(J)?.toolAllowlist;if(!Z)return null;let X=Object.entries(VS).find(([K,G])=>G.includes(J))?.[0],Y=gl1.filter((K)=>K!==X).map((K)=>`!${K}`);if(X&&X!=="finder")Y.push("!finder");return[...Z,...Y]}function cd(J,Q){let Z=!1;for(let X of Q){if(X==="")continue;if(X.startsWith("!")){let Y=X.slice(1);if(fl1(J,Y))return!1;continue}if(fl1(J,X))Z=!0}return Z}function fl1(J,Q){if(Q==="")return!1;if(Q.length===1){if(Q==="*")return!0;return!1}if(J===Q)return!0;if(Q.includes("*")||Q.includes("?")||Q.includes("[")||Q.includes("{"))try{return hl1.default(Q,{dot:!0})(J)}catch(Z){return!1}return!1}var hl1;var sZ1=B1(()=>{q2();hl1=d6(_N(),1)});function f8(J){let Q=p2[J];return`${Q.provider}/${Q.name}`}function PX(J){let[Q,Z]=J.split("/");for(let X of Object.values(p2))if(X.provider===Q&&X.name===Z)return X;switch(Q){case"anthropic":return p2.CLAUDE_SONNET_4_5;case"openai":return p2.GPT_5;case"xai":return p2.GROK_CODE_FAST_1;case"cerebras":return p2.QWEN_3_CODER_480B;case"moonshotai":return p2.KIMI_K2_INSTRUCT;case"openrouter":return p2.SONOMA_SKY_ALPHA;case"supernova":return p2.CODE_SUPERNOVA;case"groq":return p2.GPT_OSS_120B;default:throw Error(`Unknown provider: ${Q}`)}}function ZO(J){let[,Q]=J.split("/");return Q||J}function ZG(J){let Q=PX(J);return Q.contextWindow-Q.maxOutputTokens}function DZ(J){let Q=J?.["internal.visibleModes"]??[];return Object.values(xN).filter((Z)=>{if(Q.includes(`!${Z.key}`))return!1;let Y="visible"in Z?Z.visible:!1,K=Q.includes(Z.key);return Y||K}).map((Z)=>({mode:Z.key,description:"description"in Z?Z.description:void 0})).sort((Z,X)=>Z.mode.localeCompare(X.mode))}function ld(J){return Object.values(xN).find((Q)=>Q.key===J)}function ml1(J){return ld(J)?.primaryModel??f8("CLAUDE_SONNET_4_5")}function ad(J){let Q=ld(J);if(!Q)return!1;return PX(Q.primaryModel).capabilities?.vision??!1}function NS(J,Q){return Q.find((Z)=>Z.mode===J)?.description}function nd(J,Q){let X=(Q.findIndex((K)=>K.mode===J)+1)%Q.length;return Q[X]?.mode??"smart"}var S2,p2,xN,id,VS,gl1;var q2=B1(()=>{S2={ANTHROPIC:"anthropic",OPENAI:"openai",XAI:"xai",CEREBRAS:"cerebras",GROQ:"groq",MOONSHOT:"moonshotai",OPENROUTER:"openrouter",VERTEXAI:"vertexai",SUPERNOVA:"supernova"},p2={CLAUDE_SONNET_4:{provider:S2.ANTHROPIC,name:"claude-sonnet-4-20250514",displayName:"Claude Sonnet 4",contextWindow:1e6,maxOutputTokens:32000,capabilities:{reasoning:!0,vision:!0,tools:!0}},CLAUDE_SONNET_4_5:{provider:S2.ANTHROPIC,name:"claude-sonnet-4-5-20250929",displayName:"Claude Sonnet 4.5",contextWindow:1e6,maxOutputTokens:32000,capabilities:{reasoning:!0,vision:!0,tools:!0}},CLAUDE_OPUS_4:{provider:S2.ANTHROPIC,name:"claude-opus-4-20250514",displayName:"Claude Opus 4",contextWindow:200000,maxOutputTokens:32000,capabilities:{reasoning:!0,vision:!0,tools:!0}},CLAUDE_OPUS_4_1:{provider:S2.ANTHROPIC,name:"claude-opus-4-1-20250805",displayName:"Claude Opus 4.1",contextWindow:200000,maxOutputTokens:32000,capabilities:{reasoning:!0,vision:!0,tools:!0}},CLAUDE_HAIKU_4_5:{provider:S2.ANTHROPIC,name:"claude-haiku-4-5-20251001",displayName:"Claude Haiku 4.5",contextWindow:200000,maxOutputTokens:64000,capabilities:{reasoning:!0,vision:!0,tools:!0}},CLAUDE_3_5_HAIKU:{provider:S2.ANTHROPIC,name:"claude-3-5-haiku-20241022",displayName:"Claude 3.5 Haiku",contextWindow:200000,maxOutputTokens:8000,capabilities:{reasoning:!0,vision:!0,tools:!0},freeTierEligible:!0},CLAUDE_3_5_SONNET:{provider:S2.ANTHROPIC,name:"claude-3-5-sonnet-20241022",displayName:"Claude 3.5 Sonnet",contextWindow:200000,maxOutputTokens:8000,capabilities:{reasoning:!0,vision:!0,tools:!0}},GPT_5:{provider:S2.OPENAI,name:"gpt-5",displayName:"GPT-5",contextWindow:400000,maxOutputTokens:128000,pricing:{input:1.25,output:10,cached:0.125},capabilities:{reasoning:!0,vision:!0,tools:!0}},GPT_5_CODEX:{provider:S2.OPENAI,name:"gpt-5-codex",displayName:"GPT-5 Codex",contextWindow:400000,maxOutputTokens:128000,pricing:{input:1.25,output:10,cached:0.125},capabilities:{reasoning:!0,tools:!0}},GPT_5_MINI:{provider:S2.OPENAI,name:"gpt-5-mini",displayName:"GPT-5 Mini",contextWindow:400000,maxOutputTokens:128000,pricing:{input:0.25,output:2,cached:0.025},capabilities:{reasoning:!0,vision:!0,tools:!0}},GPT_5_NANO:{provider:S2.OPENAI,name:"gpt-5-nano",displayName:"GPT-5 Nano",contextWindow:400000,maxOutputTokens:128000,pricing:{input:0.05,output:0.4,cached:0.005},capabilities:{reasoning:!0,vision:!0,tools:!0}},GPT_4_1:{provider:S2.OPENAI,name:"gpt-4.1",displayName:"GPT-4.1",contextWindow:1047576,maxOutputTokens:32768,pricing:{input:2,output:8,cached:0.5},capabilities:{vision:!0,tools:!0}},GPT_4O:{provider:S2.OPENAI,name:"gpt-4o",displayName:"GPT-4o",contextWindow:128000,maxOutputTokens:16384,pricing:{input:2.5,output:10,cached:1.25},capabilities:{vision:!0,tools:!0}},O3:{provider:S2.OPENAI,name:"o3",displayName:"o3",contextWindow:200000,maxOutputTokens:1e5,pricing:{input:2,output:8,cached:0.5},capabilities:{reasoning:!0,tools:!0}},O3_MINI:{provider:S2.OPENAI,name:"o3-mini",displayName:"o3-mini",contextWindow:200000,maxOutputTokens:1e5,pricing:{input:1.1,output:4.4,cached:0.55},capabilities:{reasoning:!0,tools:!0}},GPT_OSS_120B:{provider:S2.OPENAI,name:"openai/gpt-oss-120b",displayName:"GPT OSS 120B",contextWindow:128000,maxOutputTokens:32000,capabilities:{reasoning:!0,tools:!0}},GROK_CODE_FAST_1:{provider:S2.XAI,name:"grok-code-fast-1",displayName:"Grok Code Fast 1",contextWindow:256000,maxOutputTokens:32000,capabilities:{reasoning:!0,tools:!0},freeTierEligible:!0},GROK_CODE:{provider:S2.XAI,name:"grok-code",displayName:"Grok Code",contextWindow:256000,maxOutputTokens:32000,capabilities:{reasoning:!0,tools:!0},freeTierEligible:!0},GEMINI_2_5_PRO:{provider:S2.VERTEXAI,name:"gemini-2.5-pro",displayName:"Gemini 2.5 Pro",contextWindow:1048576,maxOutputTokens:65535,capabilities:{tools:!0,reasoning:!0,vision:!0}},GEMINI_2_5_FLASH:{provider:S2.VERTEXAI,name:"gemini-2.5-flash",displayName:"Gemini 2.5 Flash",contextWindow:1048576,maxOutputTokens:65535,capabilities:{tools:!0,reasoning:!0,vision:!0}},GEMINI_2_5_FLASH_PREVIEW_09_2025:{provider:S2.VERTEXAI,name:"gemini-2.5-flash-preview-09-2025",displayName:"Gemini 2.5 Flash (Preview)",contextWindow:1048576,maxOutputTokens:65535,capabilities:{tools:!0,reasoning:!0,vision:!0},freeTierEligible:!0},GEMINI_2_5_FLASH_LITE:{provider:S2.VERTEXAI,name:"gemini-2.5-flash-lite",displayName:"Gemini 2.5 Flash Lite",contextWindow:1048576,maxOutputTokens:65535,capabilities:{tools:!0,reasoning:!0,vision:!0}},GEMINI_2_5_FLASH_LITE_PREVIEW_09_2025:{provider:S2.VERTEXAI,name:"gemini-2.5-flash-lite-preview-09-2025",displayName:"Gemini 2.5 Flash Lite (Preview)",contextWindow:1048576,maxOutputTokens:65535,capabilities:{tools:!0,reasoning:!0,vision:!0},freeTierEligible:!0},QWEN_3_CODER_480B:{provider:S2.CEREBRAS,name:"qwen-3-coder-480b",displayName:"Qwen 3 Coder 480B",contextWindow:128000,maxOutputTokens:32000,capabilities:{tools:!0}},KIMI_K2_INSTRUCT:{provider:S2.MOONSHOT,name:"kimi-k2-instruct-0905",displayName:"Kimi K2 Instruct",contextWindow:1e6,maxOutputTokens:32000,capabilities:{tools:!0}},SONOMA_SKY_ALPHA:{provider:S2.OPENROUTER,name:"sonoma-sky-alpha",displayName:"Sonoma Sky Alpha",contextWindow:256000,maxOutputTokens:32000,capabilities:{tools:!0}},CODE_SUPERNOVA:{provider:S2.SUPERNOVA,name:"code-supernova",displayName:"Code Supernova",contextWindow:1e6,maxOutputTokens:32000,capabilities:{tools:!0},freeTierEligible:!0}};xN={SMART:{key:"smart",displayName:"Smart",description:"Smarter, but slower",primaryModel:f8("CLAUDE_SONNET_4_5"),visible:!0},FREE:{key:"free",displayName:"Free",description:"Amp Free",primaryModel:f8("GROK_CODE_FAST_1"),visible:!0,toolAllowlist:["*","!oracle","!librarian","!Task","!read_thread"]},FREE_NEXT:{key:"free-next",displayName:"Free (Next)",description:"Preview of Amp Free configuration in testing",primaryModel:f8("GEMINI_2_5_FLASH_PREVIEW_09_2025"),toolAllowlist:["*","!oracle","!librarian","!Task"]},GRONK_FAST_MAIN:{key:"gronk-fast:main",displayName:"Gronk Fast Main",primaryModel:f8("GROK_CODE_FAST_1")},GRONK_FAST_SEARCH:{key:"gronk-fast:search",displayName:"Gronk Fast Search",primaryModel:f8("CLAUDE_SONNET_4_5"),searchModel:f8("GROK_CODE_FAST_1")},GRONK_FAST_MAIN_SEARCH:{key:"gronk-fast:main+search",displayName:"Gronk Fast Main+Search",primaryModel:f8("GROK_CODE_FAST_1"),searchModel:f8("GROK_CODE_FAST_1")},BOLT_SEARCH:{key:"bolt:search",displayName:"Bolt Search",primaryModel:f8("CLAUDE_SONNET_4_5"),searchModel:f8("QWEN_3_CODER_480B")},BOLT_MAIN:{key:"bolt:main",displayName:"Bolt Main",primaryModel:f8("QWEN_3_CODER_480B")},BOLT_MAIN_SEARCH:{key:"bolt:main+search",displayName:"Bolt Main+Search",primaryModel:f8("QWEN_3_CODER_480B"),searchModel:f8("QWEN_3_CODER_480B")},GEPPETTO_MAIN:{key:"geppetto:main",displayName:"Geppetto Main",primaryModel:f8("GPT_5")},GEPPETTO_PRO_MAIN:{key:"geppetto-pro:main",displayName:"Geppetto Pro Main",primaryModel:f8("GPT_5")},PINOCCHIO_MAIN:{key:"pinocchio:main",displayName:"Pinocchio Main",primaryModel:f8("GPT_5_CODEX")},CLAUDIUS_MAIN:{key:"claudius:main",displayName:"Claudius Main",primaryModel:f8("CLAUDE_OPUS_4")},OPUS_4_1:{key:"opus4.1",displayName:"Opus 4.1",primaryModel:f8("CLAUDE_OPUS_4_1")},HYDROGEN_MAIN:{key:"hydrogen:main",displayName:"Hydrogen Main",primaryModel:f8("CODE_SUPERNOVA")},KASHMIR_MAIN:{key:"kashmir:main",displayName:"Kashmir Main",primaryModel:f8("KIMI_K2_INSTRUCT")},KASHMIR_SEARCH:{key:"kashmir:search",displayName:"Kashmir Search",primaryModel:f8("CLAUDE_SONNET_4_5"),searchModel:f8("KIMI_K2_INSTRUCT")},KASHMIR_MAIN_SEARCH:{key:"kashmir:main+search",displayName:"Kashmir Main+Search",primaryModel:f8("KIMI_K2_INSTRUCT"),searchModel:f8("KIMI_K2_INSTRUCT")},GOSSIP_MAIN:{key:"gossip:main",displayName:"Gossip Main",primaryModel:f8("GPT_OSS_120B")},GOSSIP_SEARCH:{key:"gossip:search",displayName:"Gossip Search",primaryModel:f8("CLAUDE_SONNET_4_5"),searchModel:f8("GPT_OSS_120B")},GOSSIP_MAIN_SEARCH:{key:"gossip:main+search",displayName:"Gossip Main+Search",primaryModel:f8("GPT_OSS_120B"),searchModel:f8("GPT_OSS_120B")},SONOMOON_MAIN:{key:"sonomoon:main",displayName:"Sonomoon Main",primaryModel:f8("SONOMA_SKY_ALPHA")},SONOMOON_SEARCH:{key:"sonomoon:search",displayName:"Sonomoon Search",primaryModel:f8("CLAUDE_SONNET_4_5"),searchModel:f8("SONOMA_SKY_ALPHA")},SONOMOON_MAIN_SEARCH:{key:"sonomoon:main+search",displayName:"Sonomoon Main+Search",primaryModel:f8("SONOMA_SKY_ALPHA"),searchModel:f8("SONOMA_SKY_ALPHA")}},id=Object.values(xN).map((J)=>J.key),VS={xai_finder:["free","gronk-fast:search","gronk-fast:main+search"],fast_finder:["bolt:search","bolt:main+search"],kimiK2_finder:["kashmir:search","kashmir:main+search"],gossip_finder:["gossip:search","gossip:main+search"],sonoma_finder:["sonomoon:search","sonomoon:main+search"]},gl1=Object.keys(VS)});function oZ1(J){return PH6.includes(J)}function pl1(J){let Q=J["internal.oracleModel"]?.trim();if(Q&&Q.length>0)return Q;return p2.GPT_5.name}function dl1(J){let Q=J["internal.model"]?.trim();if(!Q||Q.length===0)return null;let Z=Q.indexOf(":");if(Z===-1)return null;let X=Q.slice(0,Z).trim(),Y=Q.slice(Z+1).trim();if(!X||!Y)return null;return`${X}/${Y}`}var PH6,tZ1,ul1;var XO=B1(()=>{pZ1();q2();PH6=["guardedFiles.allowlist","mcpPermissions","tools.disable","permissions"];tZ1=JO.capabilities.untrustedWorkspaces.restrictedConfigurations.map((J)=>J.replace(/^amp\./,"")),ul1=["apiKey","buildkite-access-token","github-access-token","gitlab-access-token","gitlab-instance-url","mcp-oauth-client-secret","mcp-oauth-token"]});function LB(J){let Q=typeof J==="string"?J:J.toString();return Q===VZ||Q===VZ.slice(0,-1)}function YO(J){return LB(J)?VZ:J}var SH6,VZ,vH6,fU9;var AB=B1(()=>{SH6=new URL("https://ampcode.com/"),VZ=SH6.toString(),vH6=new URL("https://api.anthropic.com/"),fU9=vH6.toString()});var O9,eZ1,J6,Qz=(J)=>{switch(typeof J){case"undefined":return J6.undefined;case"string":return J6.string;case"number":return Number.isNaN(J)?J6.nan:J6.number;case"boolean":return J6.boolean;case"function":return J6.function;case"bigint":return J6.bigint;case"symbol":return J6.symbol;case"object":if(Array.isArray(J))return J6.array;if(J===null)return J6.null;if(J.then&&typeof J.then==="function"&&J.catch&&typeof J.catch==="function")return J6.promise;if(typeof Map<"u"&&J instanceof Map)return J6.map;if(typeof Set<"u"&&J instanceof Set)return J6.set;if(typeof Date<"u"&&J instanceof Date)return J6.date;return J6.object;default:return J6.unknown}};var AS=B1(()=>{(function(J){J.assertEqual=(Y)=>{};function Q(Y){}J.assertIs=Q;function Z(Y){throw Error()}J.assertNever=Z,J.arrayToEnum=(Y)=>{let K={};for(let G of Y)K[G]=G;return K},J.getValidEnumValues=(Y)=>{let K=J.objectKeys(Y).filter((q)=>typeof Y[Y[q]]!=="number"),G={};for(let q of K)G[q]=Y[q];return J.objectValues(G)},J.objectValues=(Y)=>{return J.objectKeys(Y).map(function(K){return Y[K]})},J.objectKeys=typeof Object.keys==="function"?(Y)=>Object.keys(Y):(Y)=>{let K=[];for(let G in Y)if(Object.prototype.hasOwnProperty.call(Y,G))K.push(G);return K},J.find=(Y,K)=>{for(let G of Y)if(K(G))return G;return},J.isInteger=typeof Number.isInteger==="function"?(Y)=>Number.isInteger(Y):(Y)=>typeof Y==="number"&&Number.isFinite(Y)&&Math.floor(Y)===Y;function X(Y,K=" | "){return Y.map((G)=>typeof G==="string"?`'${G}'`:G).join(K)}J.joinValues=X,J.jsonStringifyReplacer=(Y,K)=>{if(typeof K==="bigint")return K.toString();return K}})(O9||(O9={}));(function(J){J.mergeShapes=(Q,Z)=>{return{...Q,...Z}}})(eZ1||(eZ1={}));J6=O9.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"])});var h0,kH6=(J)=>{return JSON.stringify(J,null,2).replace(/"([^"]+)":/g,"$1:")},NZ;var sd=B1(()=>{AS();h0=O9.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]);NZ=class NZ extends Error{get errors(){return this.issues}constructor(J){super();this.issues=[],this.addIssue=(Z)=>{this.issues=[...this.issues,Z]},this.addIssues=(Z=[])=>{this.issues=[...this.issues,...Z]};let Q=new.target.prototype;if(Object.setPrototypeOf)Object.setPrototypeOf(this,Q);else this.__proto__=Q;this.name="ZodError",this.issues=J}format(J){let Q=J||function(Y){return Y.message},Z={_errors:[]},X=(Y)=>{for(let K of Y.issues)if(K.code==="invalid_union")K.unionErrors.map(X);else if(K.code==="invalid_return_type")X(K.returnTypeError);else if(K.code==="invalid_arguments")X(K.argumentsError);else if(K.path.length===0)Z._errors.push(Q(K));else{let G=Z,q=0;while(q<K.path.length){let z=K.path[q];if(q!==K.path.length-1)G[z]=G[z]||{_errors:[]};else G[z]=G[z]||{_errors:[]},G[z]._errors.push(Q(K));G=G[z],q++}}};return X(this),Z}static assert(J){if(!(J instanceof NZ))throw Error(`Not a ZodError: ${J}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,O9.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(J=(Q)=>Q.message){let Q={},Z=[];for(let X of this.issues)if(X.path.length>0){let Y=X.path[0];Q[Y]=Q[Y]||[],Q[Y].push(J(X))}else Z.push(J(X));return{formErrors:Z,fieldErrors:Q}}get formErrors(){return this.flatten()}};NZ.create=(J)=>{return new NZ(J)}});var _H6=(J,Q)=>{let Z;switch(J.code){case h0.invalid_type:if(J.received===J6.undefined)Z="Required";else Z=`Expected ${J.expected}, received ${J.received}`;break;case h0.invalid_literal:Z=`Invalid literal value, expected ${JSON.stringify(J.expected,O9.jsonStringifyReplacer)}`;break;case h0.unrecognized_keys:Z=`Unrecognized key(s) in object: ${O9.joinValues(J.keys,", ")}`;break;case h0.invalid_union:Z="Invalid input";break;case h0.invalid_union_discriminator:Z=`Invalid discriminator value. Expected ${O9.joinValues(J.options)}`;break;case h0.invalid_enum_value:Z=`Invalid enum value. Expected ${O9.joinValues(J.options)}, received '${J.received}'`;break;case h0.invalid_arguments:Z="Invalid function arguments";break;case h0.invalid_return_type:Z="Invalid function return type";break;case h0.invalid_date:Z="Invalid date";break;case h0.invalid_string:if(typeof J.validation==="object")if("includes"in J.validation){if(Z=`Invalid input: must include "${J.validation.includes}"`,typeof J.validation.position==="number")Z=`${Z} at one or more positions greater than or equal to ${J.validation.position}`}else if("startsWith"in J.validation)Z=`Invalid input: must start with "${J.validation.startsWith}"`;else if("endsWith"in J.validation)Z=`Invalid input: must end with "${J.validation.endsWith}"`;else O9.assertNever(J.validation);else if(J.validation!=="regex")Z=`Invalid ${J.validation}`;else Z="Invalid";break;case h0.too_small:if(J.type==="array")Z=`Array must contain ${J.exact?"exactly":J.inclusive?"at least":"more than"} ${J.minimum} element(s)`;else if(J.type==="string")Z=`String must contain ${J.exact?"exactly":J.inclusive?"at least":"over"} ${J.minimum} character(s)`;else if(J.type==="number")Z=`Number must be ${J.exact?"exactly equal to ":J.inclusive?"greater than or equal to ":"greater than "}${J.minimum}`;else if(J.type==="bigint")Z=`Number must be ${J.exact?"exactly equal to ":J.inclusive?"greater than or equal to ":"greater than "}${J.minimum}`;else if(J.type==="date")Z=`Date must be ${J.exact?"exactly equal to ":J.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(J.minimum))}`;else Z="Invalid input";break;case h0.too_big:if(J.type==="array")Z=`Array must contain ${J.exact?"exactly":J.inclusive?"at most":"less than"} ${J.maximum} element(s)`;else if(J.type==="string")Z=`String must contain ${J.exact?"exactly":J.inclusive?"at most":"under"} ${J.maximum} character(s)`;else if(J.type==="number")Z=`Number must be ${J.exact?"exactly":J.inclusive?"less than or equal to":"less than"} ${J.maximum}`;else if(J.type==="bigint")Z=`BigInt must be ${J.exact?"exactly":J.inclusive?"less than or equal to":"less than"} ${J.maximum}`;else if(J.type==="date")Z=`Date must be ${J.exact?"exactly":J.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(J.maximum))}`;else Z="Invalid input";break;case h0.custom:Z="Invalid input";break;case h0.invalid_intersection_types:Z="Intersection results could not be merged";break;case h0.not_multiple_of:Z=`Number must be a multiple of ${J.multipleOf}`;break;case h0.not_finite:Z="Number must be finite";break;default:Z=Q.defaultError,O9.assertNever(J)}return{message:Z}},FW;var JX1=B1(()=>{sd();AS();FW=_H6});function xH6(J){cl1=J}function KO(){return cl1}var cl1;var od=B1(()=>{JX1();cl1=FW});function F6(J,Q){let Z=KO(),X=wS({issueData:Q,data:J.data,path:J.path,errorMaps:[J.common.contextualErrorMap,J.schemaErrorMap,Z,Z===FW?void 0:FW].filter((Y)=>!!Y)});J.common.issues.push(X)}class QJ{constructor(){this.value="valid"}dirty(){if(this.value==="valid")this.value="dirty"}abort(){if(this.value!=="aborted")this.value="aborted"}static mergeArray(J,Q){let Z=[];for(let X of Q){if(X.status==="aborted")return N8;if(X.status==="dirty")J.dirty();Z.push(X.value)}return{status:J.value,value:Z}}static async mergeObjectAsync(J,Q){let Z=[];for(let X of Q){let Y=await X.key,K=await X.value;Z.push({key:Y,value:K})}return QJ.mergeObjectSync(J,Z)}static mergeObjectSync(J,Q){let Z={};for(let X of Q){let{key:Y,value:K}=X;if(Y.status==="aborted")return N8;if(K.status==="aborted")return N8;if(Y.status==="dirty")J.dirty();if(K.status==="dirty")J.dirty();if(Y.value!=="__proto__"&&(typeof K.value<"u"||X.alwaysSet))Z[Y.value]=K.value}return{status:J.value,value:Z}}}var wS=(J)=>{let{data:Q,path:Z,errorMaps:X,issueData:Y}=J,K=[...Z,...Y.path||[]],G={...Y,path:K};if(Y.message!==void 0)return{...Y,path:K,message:Y.message};let q="",z=X.filter((U)=>!!U).slice().reverse();for(let U of z)q=U(G,{data:Q,defaultError:q}).message;return{...Y,path:K,message:q}},bH6,N8,bN=(J)=>({status:"dirty",value:J}),xJ=(J)=>({status:"valid",value:J}),td=(J)=>J.status==="aborted",ed=(J)=>J.status==="dirty",wB=(J)=>J.status==="valid",GO=(J)=>typeof Promise<"u"&&J instanceof Promise;var QX1=B1(()=>{od();JX1();bH6=[];N8=Object.freeze({status:"aborted"})});var ll1=()=>{};var b6;var il1=B1(()=>{(function(J){J.errToObj=(Q)=>typeof Q==="string"?{message:Q}:Q||{},J.toString=(Q)=>typeof Q==="string"?Q:Q?.message})(b6||(b6={}))});class GG{constructor(J,Q,Z,X){this._cachedPath=[],this.parent=J,this.data=Q,this._path=Z,this._key=X}get path(){if(!this._cachedPath.length)if(Array.isArray(this._key))this._cachedPath.push(...this._path,...this._key);else this._cachedPath.push(...this._path,this._key);return this._cachedPath}}function l8(J){if(!J)return{};let{errorMap:Q,invalid_type_error:Z,required_error:X,description:Y}=J;if(Q&&(Z||X))throw Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);if(Q)return{errorMap:Q,description:Y};return{errorMap:(G,q)=>{let{message:z}=J;if(G.code==="invalid_enum_value")return{message:z??q.defaultError};if(typeof q.data>"u")return{message:z??X??q.defaultError};if(G.code!=="invalid_type")return{message:q.defaultError};return{message:z??Z??q.defaultError}},description:Y}}class z9{get description(){return this._def.description}_getType(J){return Qz(J.data)}_getOrReturnCtx(J,Q){return Q||{common:J.parent.common,data:J.data,parsedType:Qz(J.data),schemaErrorMap:this._def.errorMap,path:J.path,parent:J.parent}}_processInputParams(J){return{status:new QJ,ctx:{common:J.parent.common,data:J.data,parsedType:Qz(J.data),schemaErrorMap:this._def.errorMap,path:J.path,parent:J.parent}}}_parseSync(J){let Q=this._parse(J);if(GO(Q))throw Error("Synchronous parse encountered promise.");return Q}_parseAsync(J){let Q=this._parse(J);return Promise.resolve(Q)}parse(J,Q){let Z=this.safeParse(J,Q);if(Z.success)return Z.data;throw Z.error}safeParse(J,Q){let Z={common:{issues:[],async:Q?.async??!1,contextualErrorMap:Q?.errorMap},path:Q?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:J,parsedType:Qz(J)},X=this._parseSync({data:J,path:Z.path,parent:Z});return al1(Z,X)}"~validate"(J){let Q={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:J,parsedType:Qz(J)};if(!this["~standard"].async)try{let Z=this._parseSync({data:J,path:[],parent:Q});return wB(Z)?{value:Z.value}:{issues:Q.common.issues}}catch(Z){if(Z?.message?.toLowerCase()?.includes("encountered"))this["~standard"].async=!0;Q.common={issues:[],async:!0}}return this._parseAsync({data:J,path:[],parent:Q}).then((Z)=>wB(Z)?{value:Z.value}:{issues:Q.common.issues})}async parseAsync(J,Q){let Z=await this.safeParseAsync(J,Q);if(Z.success)return Z.data;throw Z.error}async safeParseAsync(J,Q){let Z={common:{issues:[],contextualErrorMap:Q?.errorMap,async:!0},path:Q?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:J,parsedType:Qz(J)},X=this._parse({data:J,path:Z.path,parent:Z}),Y=await(GO(X)?X:Promise.resolve(X));return al1(Z,Y)}refine(J,Q){let Z=(X)=>{if(typeof Q==="string"||typeof Q>"u")return{message:Q};else if(typeof Q==="function")return Q(X);else return Q};return this._refinement((X,Y)=>{let K=J(X),G=()=>Y.addIssue({code:h0.custom,...Z(X)});if(typeof Promise<"u"&&K instanceof Promise)return K.then((q)=>{if(!q)return G(),!1;else return!0});if(!K)return G(),!1;else return!0})}refinement(J,Q){return this._refinement((Z,X)=>{if(!J(Z))return X.addIssue(typeof Q==="function"?Q(Z,X):Q),!1;else return!0})}_refinement(J){return new qG({schema:this,typeName:R8.ZodEffects,effect:{type:"refinement",refinement:J}})}superRefine(J){return this._refinement(J)}constructor(J){this.spa=this.safeParseAsync,this._def=J,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:(Q)=>this["~validate"](Q)}}optional(){return KG.create(this,this._def)}nullable(){return BW.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return YG.create(this)}promise(){return gN.create(this,this._def)}or(J){return HO.create([this,J],this._def)}and(J){return BO.create(this,J,this._def)}transform(J){return new qG({...l8(this._def),schema:this,typeName:R8.ZodEffects,effect:{type:"transform",transform:J}})}default(J){let Q=typeof J==="function"?J:()=>J;return new NO({...l8(this._def),innerType:this,defaultValue:Q,typeName:R8.ZodDefault})}brand(){return new Qc({typeName:R8.ZodBranded,type:this,...l8(this._def)})}catch(J){let Q=typeof J==="function"?J:()=>J;return new LO({...l8(this._def),innerType:this,catchValue:Q,typeName:R8.ZodCatch})}describe(J){return new this.constructor({...this._def,description:J})}pipe(J){return IS.create(this,J)}readonly(){return AO.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}function sl1(J){let Q="[0-5]\\d";if(J.precision)Q=`${Q}\\.\\d{${J.precision}}`;else if(J.precision==null)Q=`${Q}(\\.\\d+)?`;let Z=J.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${Q})${Z}`}function tH6(J){return new RegExp(`^${sl1(J)}$`)}function ol1(J){let Q=`${rl1}T${sl1(J)}`,Z=[];if(Z.push(J.local?"Z?":"Z"),J.offset)Z.push("([+-]\\d{2}:?\\d{2})");return Q=`${Q}(${Z.join("|")})`,new RegExp(`^${Q}$`)}function eH6(J,Q){if((Q==="v4"||!Q)&&lH6.test(J))return!0;if((Q==="v6"||!Q)&&aH6.test(J))return!0;return!1}function JB6(J,Q){if(!uH6.test(J))return!1;try{let[Z]=J.split(".");if(!Z)return!1;let X=Z.replace(/-/g,"+").replace(/_/g,"/").padEnd(Z.length+(4-Z.length%4)%4,"="),Y=JSON.parse(atob(X));if(typeof Y!=="object"||Y===null)return!1;if("typ"in Y&&Y?.typ!=="JWT")return!1;if(!Y.alg)return!1;if(Q&&Y.alg!==Q)return!1;return!0}catch{return!1}}function QB6(J,Q){if((Q==="v4"||!Q)&&iH6.test(J))return!0;if((Q==="v6"||!Q)&&nH6.test(J))return!0;return!1}function ZB6(J,Q){let Z=(J.toString().split(".")[1]||"").length,X=(Q.toString().split(".")[1]||"").length,Y=Z>X?Z:X,K=Number.parseInt(J.toFixed(Y).replace(".","")),G=Number.parseInt(Q.toFixed(Y).replace(".",""));return K%G/10**Y}function qO(J){if(J instanceof _4){let Q={};for(let Z in J.shape){let X=J.shape[Z];Q[Z]=KG.create(qO(X))}return new _4({...J._def,shape:()=>Q})}else if(J instanceof YG)return new YG({...J._def,type:qO(J.element)});else if(J instanceof KG)return KG.create(qO(J.unwrap()));else if(J instanceof BW)return BW.create(qO(J.unwrap()));else if(J instanceof Xz)return Xz.create(J.items.map((Q)=>qO(Q)));else return J}function XX1(J,Q){let Z=Qz(J),X=Qz(Q);if(J===Q)return{valid:!0,data:J};else if(Z===J6.object&&X===J6.object){let Y=O9.objectKeys(Q),K=O9.objectKeys(J).filter((q)=>Y.indexOf(q)!==-1),G={...J,...Q};for(let q of K){let z=XX1(J[q],Q[q]);if(!z.valid)return{valid:!1};G[q]=z.data}return{valid:!0,data:G}}else if(Z===J6.array&&X===J6.array){if(J.length!==Q.length)return{valid:!1};let Y=[];for(let K=0;K<J.length;K++){let G=J[K],q=Q[K],z=XX1(G,q);if(!z.valid)return{valid:!1};Y.push(z.data)}return{valid:!0,data:Y}}else if(Z===J6.date&&X===J6.date&&+J===+Q)return{valid:!0,data:J};else return{valid:!1}}function tl1(J,Q){return new $B({values:J,typeName:R8.ZodEnum,...l8(Q)})}function nl1(J,Q){let Z=typeof J==="function"?J(Q):typeof J==="string"?{message:J}:J;return typeof Z==="string"?{message:Z}:Z}function el1(J,Q={},Z){if(J)return fN.create().superRefine((X,Y)=>{let K=J(X);if(K instanceof Promise)return K.then((G)=>{if(!G){let q=nl1(Q,X),z=q.fatal??Z??!0;Y.addIssue({code:"custom",...q,fatal:z})}});if(!K){let G=nl1(Q,X),q=G.fatal??Z??!0;Y.addIssue({code:"custom",...G,fatal:q})}return});return fN.create()}var al1=(J,Q)=>{if(wB(Q))return{success:!0,data:Q.value};else{if(!J.common.issues.length)throw Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;let Z=new NZ(J.common.issues);return this._error=Z,this._error}}}},yH6,fH6,hH6,gH6,mH6,uH6,pH6,dH6,cH6="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",ZX1,lH6,iH6,aH6,nH6,rH6,sH6,rl1="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",oH6,XG,OB,jB,UO,yN,RS,WO,FO,fN,RB,Zz,OS,YG,_4,HO,HW=(J)=>{if(J instanceof DO)return HW(J.schema);else if(J instanceof qG)return HW(J.innerType());else if(J instanceof MO)return[J.value];else if(J instanceof $B)return J.options;else if(J instanceof VO)return O9.objectValues(J.enum);else if(J instanceof NO)return HW(J._def.innerType);else if(J instanceof WO)return[void 0];else if(J instanceof FO)return[null];else if(J instanceof KG)return[void 0,...HW(J.unwrap())];else if(J instanceof BW)return[null,...HW(J.unwrap())];else if(J instanceof Qc)return HW(J.unwrap());else if(J instanceof AO)return HW(J.unwrap());else if(J instanceof LO)return HW(J._def.innerType);else return[]},Jc,BO,Xz,jS,$S,hN,zO,DO,MO,$B,VO,gN,qG,KG,BW,NO,LO,ES,XB6,Qc,IS,AO,YB6,R8,KB6=(J,Q={message:`Input not instance of ${J.name}`})=>el1((Z)=>Z instanceof J,Q),Ji1,Qi1,GB6,qB6,Zi1,zB6,UB6,WB6,FB6,HB6,BB6,DB6,MB6,VB6,NB6,LB6,AB6,wB6,RB6,OB6,jB6,$B6,EB6,IB6,PB6,TB6,CB6,SB6,vB6,kB6,_B6,xB6,bB6,yB6,fB6=()=>Ji1().optional(),hB6=()=>Qi1().optional(),gB6=()=>Zi1().optional(),mB6,uB6;var Xi1=B1(()=>{sd();od();il1();QX1();AS();yH6=/^c[^\s-]{8,}$/i,fH6=/^[0-9a-z]+$/,hH6=/^[0-9A-HJKMNP-TV-Z]{26}$/i,gH6=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,mH6=/^[a-z0-9_-]{21}$/i,uH6=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,pH6=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,dH6=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,lH6=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,iH6=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,aH6=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,nH6=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,rH6=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,sH6=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,oH6=new RegExp(`^${rl1}$`);XG=class XG extends z9{_parse(J){if(this._def.coerce)J.data=String(J.data);if(this._getType(J)!==J6.string){let Y=this._getOrReturnCtx(J);return F6(Y,{code:h0.invalid_type,expected:J6.string,received:Y.parsedType}),N8}let Z=new QJ,X=void 0;for(let Y of this._def.checks)if(Y.kind==="min"){if(J.data.length<Y.value)X=this._getOrReturnCtx(J,X),F6(X,{code:h0.too_small,minimum:Y.value,type:"string",inclusive:!0,exact:!1,message:Y.message}),Z.dirty()}else if(Y.kind==="max"){if(J.data.length>Y.value)X=this._getOrReturnCtx(J,X),F6(X,{code:h0.too_big,maximum:Y.value,type:"string",inclusive:!0,exact:!1,message:Y.message}),Z.dirty()}else if(Y.kind==="length"){let K=J.data.length>Y.value,G=J.data.length<Y.value;if(K||G){if(X=this._getOrReturnCtx(J,X),K)F6(X,{code:h0.too_big,maximum:Y.value,type:"string",inclusive:!0,exact:!0,message:Y.message});else if(G)F6(X,{code:h0.too_small,minimum:Y.value,type:"string",inclusive:!0,exact:!0,message:Y.message});Z.dirty()}}else if(Y.kind==="email"){if(!dH6.test(J.data))X=this._getOrReturnCtx(J,X),F6(X,{validation:"email",code:h0.invalid_string,message:Y.message}),Z.dirty()}else if(Y.kind==="emoji"){if(!ZX1)ZX1=new RegExp(cH6,"u");if(!ZX1.test(J.data))X=this._getOrReturnCtx(J,X),F6(X,{validation:"emoji",code:h0.invalid_string,message:Y.message}),Z.dirty()}else if(Y.kind==="uuid"){if(!gH6.test(J.data))X=this._getOrReturnCtx(J,X),F6(X,{validation:"uuid",code:h0.invalid_string,message:Y.message}),Z.dirty()}else if(Y.kind==="nanoid"){if(!mH6.test(J.data))X=this._getOrReturnCtx(J,X),F6(X,{validation:"nanoid",code:h0.invalid_string,message:Y.message}),Z.dirty()}else if(Y.kind==="cuid"){if(!yH6.test(J.data))X=this._getOrReturnCtx(J,X),F6(X,{validation:"cuid",code:h0.invalid_string,message:Y.message}),Z.dirty()}else if(Y.kind==="cuid2"){if(!fH6.test(J.data))X=this._getOrReturnCtx(J,X),F6(X,{validation:"cuid2",code:h0.invalid_string,message:Y.message}),Z.dirty()}else if(Y.kind==="ulid"){if(!hH6.test(J.data))X=this._getOrReturnCtx(J,X),F6(X,{validation:"ulid",code:h0.invalid_string,message:Y.message}),Z.dirty()}else if(Y.kind==="url")try{new URL(J.data)}catch{X=this._getOrReturnCtx(J,X),F6(X,{validation:"url",code:h0.invalid_string,message:Y.message}),Z.dirty()}else if(Y.kind==="regex"){if(Y.regex.lastIndex=0,!Y.regex.test(J.data))X=this._getOrReturnCtx(J,X),F6(X,{validation:"regex",code:h0.invalid_string,message:Y.message}),Z.dirty()}else if(Y.kind==="trim")J.data=J.data.trim();else if(Y.kind==="includes"){if(!J.data.includes(Y.value,Y.position))X=this._getOrReturnCtx(J,X),F6(X,{code:h0.invalid_string,validation:{includes:Y.value,position:Y.position},message:Y.message}),Z.dirty()}else if(Y.kind==="toLowerCase")J.data=J.data.toLowerCase();else if(Y.kind==="toUpperCase")J.data=J.data.toUpperCase();else if(Y.kind==="startsWith"){if(!J.data.startsWith(Y.value))X=this._getOrReturnCtx(J,X),F6(X,{code:h0.invalid_string,validation:{startsWith:Y.value},message:Y.message}),Z.dirty()}else if(Y.kind==="endsWith"){if(!J.data.endsWith(Y.value))X=this._getOrReturnCtx(J,X),F6(X,{code:h0.invalid_string,validation:{endsWith:Y.value},message:Y.message}),Z.dirty()}else if(Y.kind==="datetime"){if(!ol1(Y).test(J.data))X=this._getOrReturnCtx(J,X),F6(X,{code:h0.invalid_string,validation:"datetime",message:Y.message}),Z.dirty()}else if(Y.kind==="date"){if(!oH6.test(J.data))X=this._getOrReturnCtx(J,X),F6(X,{code:h0.invalid_string,validation:"date",message:Y.message}),Z.dirty()}else if(Y.kind==="time"){if(!tH6(Y).test(J.data))X=this._getOrReturnCtx(J,X),F6(X,{code:h0.invalid_string,validation:"time",message:Y.message}),Z.dirty()}else if(Y.kind==="duration"){if(!pH6.test(J.data))X=this._getOrReturnCtx(J,X),F6(X,{validation:"duration",code:h0.invalid_string,message:Y.message}),Z.dirty()}else if(Y.kind==="ip"){if(!eH6(J.data,Y.version))X=this._getOrReturnCtx(J,X),F6(X,{validation:"ip",code:h0.invalid_string,message:Y.message}),Z.dirty()}else if(Y.kind==="jwt"){if(!JB6(J.data,Y.alg))X=this._getOrReturnCtx(J,X),F6(X,{validation:"jwt",code:h0.invalid_string,message:Y.message}),Z.dirty()}else if(Y.kind==="cidr"){if(!QB6(J.data,Y.version))X=this._getOrReturnCtx(J,X),F6(X,{validation:"cidr",code:h0.invalid_string,message:Y.message}),Z.dirty()}else if(Y.kind==="base64"){if(!rH6.test(J.data))X=this._getOrReturnCtx(J,X),F6(X,{validation:"base64",code:h0.invalid_string,message:Y.message}),Z.dirty()}else if(Y.kind==="base64url"){if(!sH6.test(J.data))X=this._getOrReturnCtx(J,X),F6(X,{validation:"base64url",code:h0.invalid_string,message:Y.message}),Z.dirty()}else O9.assertNever(Y);return{status:Z.value,value:J.data}}_regex(J,Q,Z){return this.refinement((X)=>J.test(X),{validation:Q,code:h0.invalid_string,...b6.errToObj(Z)})}_addCheck(J){return new XG({...this._def,checks:[...this._def.checks,J]})}email(J){return this._addCheck({kind:"email",...b6.errToObj(J)})}url(J){return this._addCheck({kind:"url",...b6.errToObj(J)})}emoji(J){return this._addCheck({kind:"emoji",...b6.errToObj(J)})}uuid(J){return this._addCheck({kind:"uuid",...b6.errToObj(J)})}nanoid(J){return this._addCheck({kind:"nanoid",...b6.errToObj(J)})}cuid(J){return this._addCheck({kind:"cuid",...b6.errToObj(J)})}cuid2(J){return this._addCheck({kind:"cuid2",...b6.errToObj(J)})}ulid(J){return this._addCheck({kind:"ulid",...b6.errToObj(J)})}base64(J){return this._addCheck({kind:"base64",...b6.errToObj(J)})}base64url(J){return this._addCheck({kind:"base64url",...b6.errToObj(J)})}jwt(J){return this._addCheck({kind:"jwt",...b6.errToObj(J)})}ip(J){return this._addCheck({kind:"ip",...b6.errToObj(J)})}cidr(J){return this._addCheck({kind:"cidr",...b6.errToObj(J)})}datetime(J){if(typeof J==="string")return this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:J});return this._addCheck({kind:"datetime",precision:typeof J?.precision>"u"?null:J?.precision,offset:J?.offset??!1,local:J?.local??!1,...b6.errToObj(J?.message)})}date(J){return this._addCheck({kind:"date",message:J})}time(J){if(typeof J==="string")return this._addCheck({kind:"time",precision:null,message:J});return this._addCheck({kind:"time",precision:typeof J?.precision>"u"?null:J?.precision,...b6.errToObj(J?.message)})}duration(J){return this._addCheck({kind:"duration",...b6.errToObj(J)})}regex(J,Q){return this._addCheck({kind:"regex",regex:J,...b6.errToObj(Q)})}includes(J,Q){return this._addCheck({kind:"includes",value:J,position:Q?.position,...b6.errToObj(Q?.message)})}startsWith(J,Q){return this._addCheck({kind:"startsWith",value:J,...b6.errToObj(Q)})}endsWith(J,Q){return this._addCheck({kind:"endsWith",value:J,...b6.errToObj(Q)})}min(J,Q){return this._addCheck({kind:"min",value:J,...b6.errToObj(Q)})}max(J,Q){return this._addCheck({kind:"max",value:J,...b6.errToObj(Q)})}length(J,Q){return this._addCheck({kind:"length",value:J,...b6.errToObj(Q)})}nonempty(J){return this.min(1,b6.errToObj(J))}trim(){return new XG({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new XG({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new XG({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find((J)=>J.kind==="datetime")}get isDate(){return!!this._def.checks.find((J)=>J.kind==="date")}get isTime(){return!!this._def.checks.find((J)=>J.kind==="time")}get isDuration(){return!!this._def.checks.find((J)=>J.kind==="duration")}get isEmail(){return!!this._def.checks.find((J)=>J.kind==="email")}get isURL(){return!!this._def.checks.find((J)=>J.kind==="url")}get isEmoji(){return!!this._def.checks.find((J)=>J.kind==="emoji")}get isUUID(){return!!this._def.checks.find((J)=>J.kind==="uuid")}get isNANOID(){return!!this._def.checks.find((J)=>J.kind==="nanoid")}get isCUID(){return!!this._def.checks.find((J)=>J.kind==="cuid")}get isCUID2(){return!!this._def.checks.find((J)=>J.kind==="cuid2")}get isULID(){return!!this._def.checks.find((J)=>J.kind==="ulid")}get isIP(){return!!this._def.checks.find((J)=>J.kind==="ip")}get isCIDR(){return!!this._def.checks.find((J)=>J.kind==="cidr")}get isBase64(){return!!this._def.checks.find((J)=>J.kind==="base64")}get isBase64url(){return!!this._def.checks.find((J)=>J.kind==="base64url")}get minLength(){let J=null;for(let Q of this._def.checks)if(Q.kind==="min"){if(J===null||Q.value>J)J=Q.value}return J}get maxLength(){let J=null;for(let Q of this._def.checks)if(Q.kind==="max"){if(J===null||Q.value<J)J=Q.value}return J}};XG.create=(J)=>{return new XG({checks:[],typeName:R8.ZodString,coerce:J?.coerce??!1,...l8(J)})};OB=class OB extends z9{constructor(){super(...arguments);this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(J){if(this._def.coerce)J.data=Number(J.data);if(this._getType(J)!==J6.number){let Y=this._getOrReturnCtx(J);return F6(Y,{code:h0.invalid_type,expected:J6.number,received:Y.parsedType}),N8}let Z=void 0,X=new QJ;for(let Y of this._def.checks)if(Y.kind==="int"){if(!O9.isInteger(J.data))Z=this._getOrReturnCtx(J,Z),F6(Z,{code:h0.invalid_type,expected:"integer",received:"float",message:Y.message}),X.dirty()}else if(Y.kind==="min"){if(Y.inclusive?J.data<Y.value:J.data<=Y.value)Z=this._getOrReturnCtx(J,Z),F6(Z,{code:h0.too_small,minimum:Y.value,type:"number",inclusive:Y.inclusive,exact:!1,message:Y.message}),X.dirty()}else if(Y.kind==="max"){if(Y.inclusive?J.data>Y.value:J.data>=Y.value)Z=this._getOrReturnCtx(J,Z),F6(Z,{code:h0.too_big,maximum:Y.value,type:"number",inclusive:Y.inclusive,exact:!1,message:Y.message}),X.dirty()}else if(Y.kind==="multipleOf"){if(ZB6(J.data,Y.value)!==0)Z=this._getOrReturnCtx(J,Z),F6(Z,{code:h0.not_multiple_of,multipleOf:Y.value,message:Y.message}),X.dirty()}else if(Y.kind==="finite"){if(!Number.isFinite(J.data))Z=this._getOrReturnCtx(J,Z),F6(Z,{code:h0.not_finite,message:Y.message}),X.dirty()}else O9.assertNever(Y);return{status:X.value,value:J.data}}gte(J,Q){return this.setLimit("min",J,!0,b6.toString(Q))}gt(J,Q){return this.setLimit("min",J,!1,b6.toString(Q))}lte(J,Q){return this.setLimit("max",J,!0,b6.toString(Q))}lt(J,Q){return this.setLimit("max",J,!1,b6.toString(Q))}setLimit(J,Q,Z,X){return new OB({...this._def,checks:[...this._def.checks,{kind:J,value:Q,inclusive:Z,message:b6.toString(X)}]})}_addCheck(J){return new OB({...this._def,checks:[...this._def.checks,J]})}int(J){return this._addCheck({kind:"int",message:b6.toString(J)})}positive(J){return this._addCheck({kind:"min",value:0,inclusive:!1,message:b6.toString(J)})}negative(J){return this._addCheck({kind:"max",value:0,inclusive:!1,message:b6.toString(J)})}nonpositive(J){return this._addCheck({kind:"max",value:0,inclusive:!0,message:b6.toString(J)})}nonnegative(J){return this._addCheck({kind:"min",value:0,inclusive:!0,message:b6.toString(J)})}multipleOf(J,Q){return this._addCheck({kind:"multipleOf",value:J,message:b6.toString(Q)})}finite(J){return this._addCheck({kind:"finite",message:b6.toString(J)})}safe(J){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:b6.toString(J)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:b6.toString(J)})}get minValue(){let J=null;for(let Q of this._def.checks)if(Q.kind==="min"){if(J===null||Q.value>J)J=Q.value}return J}get maxValue(){let J=null;for(let Q of this._def.checks)if(Q.kind==="max"){if(J===null||Q.value<J)J=Q.value}return J}get isInt(){return!!this._def.checks.find((J)=>J.kind==="int"||J.kind==="multipleOf"&&O9.isInteger(J.value))}get isFinite(){let J=null,Q=null;for(let Z of this._def.checks)if(Z.kind==="finite"||Z.kind==="int"||Z.kind==="multipleOf")return!0;else if(Z.kind==="min"){if(Q===null||Z.value>Q)Q=Z.value}else if(Z.kind==="max"){if(J===null||Z.value<J)J=Z.value}return Number.isFinite(Q)&&Number.isFinite(J)}};OB.create=(J)=>{return new OB({checks:[],typeName:R8.ZodNumber,coerce:J?.coerce||!1,...l8(J)})};jB=class jB extends z9{constructor(){super(...arguments);this.min=this.gte,this.max=this.lte}_parse(J){if(this._def.coerce)try{J.data=BigInt(J.data)}catch{return this._getInvalidInput(J)}if(this._getType(J)!==J6.bigint)return this._getInvalidInput(J);let Z=void 0,X=new QJ;for(let Y of this._def.checks)if(Y.kind==="min"){if(Y.inclusive?J.data<Y.value:J.data<=Y.value)Z=this._getOrReturnCtx(J,Z),F6(Z,{code:h0.too_small,type:"bigint",minimum:Y.value,inclusive:Y.inclusive,message:Y.message}),X.dirty()}else if(Y.kind==="max"){if(Y.inclusive?J.data>Y.value:J.data>=Y.value)Z=this._getOrReturnCtx(J,Z),F6(Z,{code:h0.too_big,type:"bigint",maximum:Y.value,inclusive:Y.inclusive,message:Y.message}),X.dirty()}else if(Y.kind==="multipleOf"){if(J.data%Y.value!==BigInt(0))Z=this._getOrReturnCtx(J,Z),F6(Z,{code:h0.not_multiple_of,multipleOf:Y.value,message:Y.message}),X.dirty()}else O9.assertNever(Y);return{status:X.value,value:J.data}}_getInvalidInput(J){let Q=this._getOrReturnCtx(J);return F6(Q,{code:h0.invalid_type,expected:J6.bigint,received:Q.parsedType}),N8}gte(J,Q){return this.setLimit("min",J,!0,b6.toString(Q))}gt(J,Q){return this.setLimit("min",J,!1,b6.toString(Q))}lte(J,Q){return this.setLimit("max",J,!0,b6.toString(Q))}lt(J,Q){return this.setLimit("max",J,!1,b6.toString(Q))}setLimit(J,Q,Z,X){return new jB({...this._def,checks:[...this._def.checks,{kind:J,value:Q,inclusive:Z,message:b6.toString(X)}]})}_addCheck(J){return new jB({...this._def,checks:[...this._def.checks,J]})}positive(J){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:b6.toString(J)})}negative(J){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:b6.toString(J)})}nonpositive(J){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:b6.toString(J)})}nonnegative(J){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:b6.toString(J)})}multipleOf(J,Q){return this._addCheck({kind:"multipleOf",value:J,message:b6.toString(Q)})}get minValue(){let J=null;for(let Q of this._def.checks)if(Q.kind==="min"){if(J===null||Q.value>J)J=Q.value}return J}get maxValue(){let J=null;for(let Q of this._def.checks)if(Q.kind==="max"){if(J===null||Q.value<J)J=Q.value}return J}};jB.create=(J)=>{return new jB({checks:[],typeName:R8.ZodBigInt,coerce:J?.coerce??!1,...l8(J)})};UO=class UO extends z9{_parse(J){if(this._def.coerce)J.data=Boolean(J.data);if(this._getType(J)!==J6.boolean){let Z=this._getOrReturnCtx(J);return F6(Z,{code:h0.invalid_type,expected:J6.boolean,received:Z.parsedType}),N8}return xJ(J.data)}};UO.create=(J)=>{return new UO({typeName:R8.ZodBoolean,coerce:J?.coerce||!1,...l8(J)})};yN=class yN extends z9{_parse(J){if(this._def.coerce)J.data=new Date(J.data);if(this._getType(J)!==J6.date){let Y=this._getOrReturnCtx(J);return F6(Y,{code:h0.invalid_type,expected:J6.date,received:Y.parsedType}),N8}if(Number.isNaN(J.data.getTime())){let Y=this._getOrReturnCtx(J);return F6(Y,{code:h0.invalid_date}),N8}let Z=new QJ,X=void 0;for(let Y of this._def.checks)if(Y.kind==="min"){if(J.data.getTime()<Y.value)X=this._getOrReturnCtx(J,X),F6(X,{code:h0.too_small,message:Y.message,inclusive:!0,exact:!1,minimum:Y.value,type:"date"}),Z.dirty()}else if(Y.kind==="max"){if(J.data.getTime()>Y.value)X=this._getOrReturnCtx(J,X),F6(X,{code:h0.too_big,message:Y.message,inclusive:!0,exact:!1,maximum:Y.value,type:"date"}),Z.dirty()}else O9.assertNever(Y);return{status:Z.value,value:new Date(J.data.getTime())}}_addCheck(J){return new yN({...this._def,checks:[...this._def.checks,J]})}min(J,Q){return this._addCheck({kind:"min",value:J.getTime(),message:b6.toString(Q)})}max(J,Q){return this._addCheck({kind:"max",value:J.getTime(),message:b6.toString(Q)})}get minDate(){let J=null;for(let Q of this._def.checks)if(Q.kind==="min"){if(J===null||Q.value>J)J=Q.value}return J!=null?new Date(J):null}get maxDate(){let J=null;for(let Q of this._def.checks)if(Q.kind==="max"){if(J===null||Q.value<J)J=Q.value}return J!=null?new Date(J):null}};yN.create=(J)=>{return new yN({checks:[],coerce:J?.coerce||!1,typeName:R8.ZodDate,...l8(J)})};RS=class RS extends z9{_parse(J){if(this._getType(J)!==J6.symbol){let Z=this._getOrReturnCtx(J);return F6(Z,{code:h0.invalid_type,expected:J6.symbol,received:Z.parsedType}),N8}return xJ(J.data)}};RS.create=(J)=>{return new RS({typeName:R8.ZodSymbol,...l8(J)})};WO=class WO extends z9{_parse(J){if(this._getType(J)!==J6.undefined){let Z=this._getOrReturnCtx(J);return F6(Z,{code:h0.invalid_type,expected:J6.undefined,received:Z.parsedType}),N8}return xJ(J.data)}};WO.create=(J)=>{return new WO({typeName:R8.ZodUndefined,...l8(J)})};FO=class FO extends z9{_parse(J){if(this._getType(J)!==J6.null){let Z=this._getOrReturnCtx(J);return F6(Z,{code:h0.invalid_type,expected:J6.null,received:Z.parsedType}),N8}return xJ(J.data)}};FO.create=(J)=>{return new FO({typeName:R8.ZodNull,...l8(J)})};fN=class fN extends z9{constructor(){super(...arguments);this._any=!0}_parse(J){return xJ(J.data)}};fN.create=(J)=>{return new fN({typeName:R8.ZodAny,...l8(J)})};RB=class RB extends z9{constructor(){super(...arguments);this._unknown=!0}_parse(J){return xJ(J.data)}};RB.create=(J)=>{return new RB({typeName:R8.ZodUnknown,...l8(J)})};Zz=class Zz extends z9{_parse(J){let Q=this._getOrReturnCtx(J);return F6(Q,{code:h0.invalid_type,expected:J6.never,received:Q.parsedType}),N8}};Zz.create=(J)=>{return new Zz({typeName:R8.ZodNever,...l8(J)})};OS=class OS extends z9{_parse(J){if(this._getType(J)!==J6.undefined){let Z=this._getOrReturnCtx(J);return F6(Z,{code:h0.invalid_type,expected:J6.void,received:Z.parsedType}),N8}return xJ(J.data)}};OS.create=(J)=>{return new OS({typeName:R8.ZodVoid,...l8(J)})};YG=class YG extends z9{_parse(J){let{ctx:Q,status:Z}=this._processInputParams(J),X=this._def;if(Q.parsedType!==J6.array)return F6(Q,{code:h0.invalid_type,expected:J6.array,received:Q.parsedType}),N8;if(X.exactLength!==null){let K=Q.data.length>X.exactLength.value,G=Q.data.length<X.exactLength.value;if(K||G)F6(Q,{code:K?h0.too_big:h0.too_small,minimum:G?X.exactLength.value:void 0,maximum:K?X.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:X.exactLength.message}),Z.dirty()}if(X.minLength!==null){if(Q.data.length<X.minLength.value)F6(Q,{code:h0.too_small,minimum:X.minLength.value,type:"array",inclusive:!0,exact:!1,message:X.minLength.message}),Z.dirty()}if(X.maxLength!==null){if(Q.data.length>X.maxLength.value)F6(Q,{code:h0.too_big,maximum:X.maxLength.value,type:"array",inclusive:!0,exact:!1,message:X.maxLength.message}),Z.dirty()}if(Q.common.async)return Promise.all([...Q.data].map((K,G)=>{return X.type._parseAsync(new GG(Q,K,Q.path,G))})).then((K)=>{return QJ.mergeArray(Z,K)});let Y=[...Q.data].map((K,G)=>{return X.type._parseSync(new GG(Q,K,Q.path,G))});return QJ.mergeArray(Z,Y)}get element(){return this._def.type}min(J,Q){return new YG({...this._def,minLength:{value:J,message:b6.toString(Q)}})}max(J,Q){return new YG({...this._def,maxLength:{value:J,message:b6.toString(Q)}})}length(J,Q){return new YG({...this._def,exactLength:{value:J,message:b6.toString(Q)}})}nonempty(J){return this.min(1,J)}};YG.create=(J,Q)=>{return new YG({type:J,minLength:null,maxLength:null,exactLength:null,typeName:R8.ZodArray,...l8(Q)})};_4=class _4 extends z9{constructor(){super(...arguments);this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;let J=this._def.shape(),Q=O9.objectKeys(J);return this._cached={shape:J,keys:Q},this._cached}_parse(J){if(this._getType(J)!==J6.object){let z=this._getOrReturnCtx(J);return F6(z,{code:h0.invalid_type,expected:J6.object,received:z.parsedType}),N8}let{status:Z,ctx:X}=this._processInputParams(J),{shape:Y,keys:K}=this._getCached(),G=[];if(!(this._def.catchall instanceof Zz&&this._def.unknownKeys==="strip")){for(let z in X.data)if(!K.includes(z))G.push(z)}let q=[];for(let z of K){let U=Y[z],W=X.data[z];q.push({key:{status:"valid",value:z},value:U._parse(new GG(X,W,X.path,z)),alwaysSet:z in X.data})}if(this._def.catchall instanceof Zz){let z=this._def.unknownKeys;if(z==="passthrough")for(let U of G)q.push({key:{status:"valid",value:U},value:{status:"valid",value:X.data[U]}});else if(z==="strict"){if(G.length>0)F6(X,{code:h0.unrecognized_keys,keys:G}),Z.dirty()}else if(z==="strip");else throw Error("Internal ZodObject error: invalid unknownKeys value.")}else{let z=this._def.catchall;for(let U of G){let W=X.data[U];q.push({key:{status:"valid",value:U},value:z._parse(new GG(X,W,X.path,U)),alwaysSet:U in X.data})}}if(X.common.async)return Promise.resolve().then(async()=>{let z=[];for(let U of q){let W=await U.key,F=await U.value;z.push({key:W,value:F,alwaysSet:U.alwaysSet})}return z}).then((z)=>{return QJ.mergeObjectSync(Z,z)});else return QJ.mergeObjectSync(Z,q)}get shape(){return this._def.shape()}strict(J){return b6.errToObj,new _4({...this._def,unknownKeys:"strict",...J!==void 0?{errorMap:(Q,Z)=>{let X=this._def.errorMap?.(Q,Z).message??Z.defaultError;if(Q.code==="unrecognized_keys")return{message:b6.errToObj(J).message??X};return{message:X}}}:{}})}strip(){return new _4({...this._def,unknownKeys:"strip"})}passthrough(){return new _4({...this._def,unknownKeys:"passthrough"})}extend(J){return new _4({...this._def,shape:()=>({...this._def.shape(),...J})})}merge(J){return new _4({unknownKeys:J._def.unknownKeys,catchall:J._def.catchall,shape:()=>({...this._def.shape(),...J._def.shape()}),typeName:R8.ZodObject})}setKey(J,Q){return this.augment({[J]:Q})}catchall(J){return new _4({...this._def,catchall:J})}pick(J){let Q={};for(let Z of O9.objectKeys(J))if(J[Z]&&this.shape[Z])Q[Z]=this.shape[Z];return new _4({...this._def,shape:()=>Q})}omit(J){let Q={};for(let Z of O9.objectKeys(this.shape))if(!J[Z])Q[Z]=this.shape[Z];return new _4({...this._def,shape:()=>Q})}deepPartial(){return qO(this)}partial(J){let Q={};for(let Z of O9.objectKeys(this.shape)){let X=this.shape[Z];if(J&&!J[Z])Q[Z]=X;else Q[Z]=X.optional()}return new _4({...this._def,shape:()=>Q})}required(J){let Q={};for(let Z of O9.objectKeys(this.shape))if(J&&!J[Z])Q[Z]=this.shape[Z];else{let Y=this.shape[Z];while(Y instanceof KG)Y=Y._def.innerType;Q[Z]=Y}return new _4({...this._def,shape:()=>Q})}keyof(){return tl1(O9.objectKeys(this.shape))}};_4.create=(J,Q)=>{return new _4({shape:()=>J,unknownKeys:"strip",catchall:Zz.create(),typeName:R8.ZodObject,...l8(Q)})};_4.strictCreate=(J,Q)=>{return new _4({shape:()=>J,unknownKeys:"strict",catchall:Zz.create(),typeName:R8.ZodObject,...l8(Q)})};_4.lazycreate=(J,Q)=>{return new _4({shape:J,unknownKeys:"strip",catchall:Zz.create(),typeName:R8.ZodObject,...l8(Q)})};HO=class HO extends z9{_parse(J){let{ctx:Q}=this._processInputParams(J),Z=this._def.options;function X(Y){for(let G of Y)if(G.result.status==="valid")return G.result;for(let G of Y)if(G.result.status==="dirty")return Q.common.issues.push(...G.ctx.common.issues),G.result;let K=Y.map((G)=>new NZ(G.ctx.common.issues));return F6(Q,{code:h0.invalid_union,unionErrors:K}),N8}if(Q.common.async)return Promise.all(Z.map(async(Y)=>{let K={...Q,common:{...Q.common,issues:[]},parent:null};return{result:await Y._parseAsync({data:Q.data,path:Q.path,parent:K}),ctx:K}})).then(X);else{let Y=void 0,K=[];for(let q of Z){let z={...Q,common:{...Q.common,issues:[]},parent:null},U=q._parseSync({data:Q.data,path:Q.path,parent:z});if(U.status==="valid")return U;else if(U.status==="dirty"&&!Y)Y={result:U,ctx:z};if(z.common.issues.length)K.push(z.common.issues)}if(Y)return Q.common.issues.push(...Y.ctx.common.issues),Y.result;let G=K.map((q)=>new NZ(q));return F6(Q,{code:h0.invalid_union,unionErrors:G}),N8}}get options(){return this._def.options}};HO.create=(J,Q)=>{return new HO({options:J,typeName:R8.ZodUnion,...l8(Q)})};Jc=class Jc extends z9{_parse(J){let{ctx:Q}=this._processInputParams(J);if(Q.parsedType!==J6.object)return F6(Q,{code:h0.invalid_type,expected:J6.object,received:Q.parsedType}),N8;let Z=this.discriminator,X=Q.data[Z],Y=this.optionsMap.get(X);if(!Y)return F6(Q,{code:h0.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[Z]}),N8;if(Q.common.async)return Y._parseAsync({data:Q.data,path:Q.path,parent:Q});else return Y._parseSync({data:Q.data,path:Q.path,parent:Q})}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(J,Q,Z){let X=new Map;for(let Y of Q){let K=HW(Y.shape[J]);if(!K.length)throw Error(`A discriminator value for key \`${J}\` could not be extracted from all schema options`);for(let G of K){if(X.has(G))throw Error(`Discriminator property ${String(J)} has duplicate value ${String(G)}`);X.set(G,Y)}}return new Jc({typeName:R8.ZodDiscriminatedUnion,discriminator:J,options:Q,optionsMap:X,...l8(Z)})}};BO=class BO extends z9{_parse(J){let{status:Q,ctx:Z}=this._processInputParams(J),X=(Y,K)=>{if(td(Y)||td(K))return N8;let G=XX1(Y.value,K.value);if(!G.valid)return F6(Z,{code:h0.invalid_intersection_types}),N8;if(ed(Y)||ed(K))Q.dirty();return{status:Q.value,value:G.data}};if(Z.common.async)return Promise.all([this._def.left._parseAsync({data:Z.data,path:Z.path,parent:Z}),this._def.right._parseAsync({data:Z.data,path:Z.path,parent:Z})]).then(([Y,K])=>X(Y,K));else return X(this._def.left._parseSync({data:Z.data,path:Z.path,parent:Z}),this._def.right._parseSync({data:Z.data,path:Z.path,parent:Z}))}};BO.create=(J,Q,Z)=>{return new BO({left:J,right:Q,typeName:R8.ZodIntersection,...l8(Z)})};Xz=class Xz extends z9{_parse(J){let{status:Q,ctx:Z}=this._processInputParams(J);if(Z.parsedType!==J6.array)return F6(Z,{code:h0.invalid_type,expected:J6.array,received:Z.parsedType}),N8;if(Z.data.length<this._def.items.length)return F6(Z,{code:h0.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),N8;if(!this._def.rest&&Z.data.length>this._def.items.length)F6(Z,{code:h0.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),Q.dirty();let Y=[...Z.data].map((K,G)=>{let q=this._def.items[G]||this._def.rest;if(!q)return null;return q._parse(new GG(Z,K,Z.path,G))}).filter((K)=>!!K);if(Z.common.async)return Promise.all(Y).then((K)=>{return QJ.mergeArray(Q,K)});else return QJ.mergeArray(Q,Y)}get items(){return this._def.items}rest(J){return new Xz({...this._def,rest:J})}};Xz.create=(J,Q)=>{if(!Array.isArray(J))throw Error("You must pass an array of schemas to z.tuple([ ... ])");return new Xz({items:J,typeName:R8.ZodTuple,rest:null,...l8(Q)})};jS=class jS extends z9{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(J){let{status:Q,ctx:Z}=this._processInputParams(J);if(Z.parsedType!==J6.object)return F6(Z,{code:h0.invalid_type,expected:J6.object,received:Z.parsedType}),N8;let X=[],Y=this._def.keyType,K=this._def.valueType;for(let G in Z.data)X.push({key:Y._parse(new GG(Z,G,Z.path,G)),value:K._parse(new GG(Z,Z.data[G],Z.path,G)),alwaysSet:G in Z.data});if(Z.common.async)return QJ.mergeObjectAsync(Q,X);else return QJ.mergeObjectSync(Q,X)}get element(){return this._def.valueType}static create(J,Q,Z){if(Q instanceof z9)return new jS({keyType:J,valueType:Q,typeName:R8.ZodRecord,...l8(Z)});return new jS({keyType:XG.create(),valueType:J,typeName:R8.ZodRecord,...l8(Q)})}};$S=class $S extends z9{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(J){let{status:Q,ctx:Z}=this._processInputParams(J);if(Z.parsedType!==J6.map)return F6(Z,{code:h0.invalid_type,expected:J6.map,received:Z.parsedType}),N8;let X=this._def.keyType,Y=this._def.valueType,K=[...Z.data.entries()].map(([G,q],z)=>{return{key:X._parse(new GG(Z,G,Z.path,[z,"key"])),value:Y._parse(new GG(Z,q,Z.path,[z,"value"]))}});if(Z.common.async){let G=new Map;return Promise.resolve().then(async()=>{for(let q of K){let z=await q.key,U=await q.value;if(z.status==="aborted"||U.status==="aborted")return N8;if(z.status==="dirty"||U.status==="dirty")Q.dirty();G.set(z.value,U.value)}return{status:Q.value,value:G}})}else{let G=new Map;for(let q of K){let{key:z,value:U}=q;if(z.status==="aborted"||U.status==="aborted")return N8;if(z.status==="dirty"||U.status==="dirty")Q.dirty();G.set(z.value,U.value)}return{status:Q.value,value:G}}}};$S.create=(J,Q,Z)=>{return new $S({valueType:Q,keyType:J,typeName:R8.ZodMap,...l8(Z)})};hN=class hN extends z9{_parse(J){let{status:Q,ctx:Z}=this._processInputParams(J);if(Z.parsedType!==J6.set)return F6(Z,{code:h0.invalid_type,expected:J6.set,received:Z.parsedType}),N8;let X=this._def;if(X.minSize!==null){if(Z.data.size<X.minSize.value)F6(Z,{code:h0.too_small,minimum:X.minSize.value,type:"set",inclusive:!0,exact:!1,message:X.minSize.message}),Q.dirty()}if(X.maxSize!==null){if(Z.data.size>X.maxSize.value)F6(Z,{code:h0.too_big,maximum:X.maxSize.value,type:"set",inclusive:!0,exact:!1,message:X.maxSize.message}),Q.dirty()}let Y=this._def.valueType;function K(q){let z=new Set;for(let U of q){if(U.status==="aborted")return N8;if(U.status==="dirty")Q.dirty();z.add(U.value)}return{status:Q.value,value:z}}let G=[...Z.data.values()].map((q,z)=>Y._parse(new GG(Z,q,Z.path,z)));if(Z.common.async)return Promise.all(G).then((q)=>K(q));else return K(G)}min(J,Q){return new hN({...this._def,minSize:{value:J,message:b6.toString(Q)}})}max(J,Q){return new hN({...this._def,maxSize:{value:J,message:b6.toString(Q)}})}size(J,Q){return this.min(J,Q).max(J,Q)}nonempty(J){return this.min(1,J)}};hN.create=(J,Q)=>{return new hN({valueType:J,minSize:null,maxSize:null,typeName:R8.ZodSet,...l8(Q)})};zO=class zO extends z9{constructor(){super(...arguments);this.validate=this.implement}_parse(J){let{ctx:Q}=this._processInputParams(J);if(Q.parsedType!==J6.function)return F6(Q,{code:h0.invalid_type,expected:J6.function,received:Q.parsedType}),N8;function Z(G,q){return wS({data:G,path:Q.path,errorMaps:[Q.common.contextualErrorMap,Q.schemaErrorMap,KO(),FW].filter((z)=>!!z),issueData:{code:h0.invalid_arguments,argumentsError:q}})}function X(G,q){return wS({data:G,path:Q.path,errorMaps:[Q.common.contextualErrorMap,Q.schemaErrorMap,KO(),FW].filter((z)=>!!z),issueData:{code:h0.invalid_return_type,returnTypeError:q}})}let Y={errorMap:Q.common.contextualErrorMap},K=Q.data;if(this._def.returns instanceof gN){let G=this;return xJ(async function(...q){let z=new NZ([]),U=await G._def.args.parseAsync(q,Y).catch((H)=>{throw z.addIssue(Z(q,H)),z}),W=await Reflect.apply(K,this,U);return await G._def.returns._def.type.parseAsync(W,Y).catch((H)=>{throw z.addIssue(X(W,H)),z})})}else{let G=this;return xJ(function(...q){let z=G._def.args.safeParse(q,Y);if(!z.success)throw new NZ([Z(q,z.error)]);let U=Reflect.apply(K,this,z.data),W=G._def.returns.safeParse(U,Y);if(!W.success)throw new NZ([X(U,W.error)]);return W.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...J){return new zO({...this._def,args:Xz.create(J).rest(RB.create())})}returns(J){return new zO({...this._def,returns:J})}implement(J){return this.parse(J)}strictImplement(J){return this.parse(J)}static create(J,Q,Z){return new zO({args:J?J:Xz.create([]).rest(RB.create()),returns:Q||RB.create(),typeName:R8.ZodFunction,...l8(Z)})}};DO=class DO extends z9{get schema(){return this._def.getter()}_parse(J){let{ctx:Q}=this._processInputParams(J);return this._def.getter()._parse({data:Q.data,path:Q.path,parent:Q})}};DO.create=(J,Q)=>{return new DO({getter:J,typeName:R8.ZodLazy,...l8(Q)})};MO=class MO extends z9{_parse(J){if(J.data!==this._def.value){let Q=this._getOrReturnCtx(J);return F6(Q,{received:Q.data,code:h0.invalid_literal,expected:this._def.value}),N8}return{status:"valid",value:J.data}}get value(){return this._def.value}};MO.create=(J,Q)=>{return new MO({value:J,typeName:R8.ZodLiteral,...l8(Q)})};$B=class $B extends z9{_parse(J){if(typeof J.data!=="string"){let Q=this._getOrReturnCtx(J),Z=this._def.values;return F6(Q,{expected:O9.joinValues(Z),received:Q.parsedType,code:h0.invalid_type}),N8}if(!this._cache)this._cache=new Set(this._def.values);if(!this._cache.has(J.data)){let Q=this._getOrReturnCtx(J),Z=this._def.values;return F6(Q,{received:Q.data,code:h0.invalid_enum_value,options:Z}),N8}return xJ(J.data)}get options(){return this._def.values}get enum(){let J={};for(let Q of this._def.values)J[Q]=Q;return J}get Values(){let J={};for(let Q of this._def.values)J[Q]=Q;return J}get Enum(){let J={};for(let Q of this._def.values)J[Q]=Q;return J}extract(J,Q=this._def){return $B.create(J,{...this._def,...Q})}exclude(J,Q=this._def){return $B.create(this.options.filter((Z)=>!J.includes(Z)),{...this._def,...Q})}};$B.create=tl1;VO=class VO extends z9{_parse(J){let Q=O9.getValidEnumValues(this._def.values),Z=this._getOrReturnCtx(J);if(Z.parsedType!==J6.string&&Z.parsedType!==J6.number){let X=O9.objectValues(Q);return F6(Z,{expected:O9.joinValues(X),received:Z.parsedType,code:h0.invalid_type}),N8}if(!this._cache)this._cache=new Set(O9.getValidEnumValues(this._def.values));if(!this._cache.has(J.data)){let X=O9.objectValues(Q);return F6(Z,{received:Z.data,code:h0.invalid_enum_value,options:X}),N8}return xJ(J.data)}get enum(){return this._def.values}};VO.create=(J,Q)=>{return new VO({values:J,typeName:R8.ZodNativeEnum,...l8(Q)})};gN=class gN extends z9{unwrap(){return this._def.type}_parse(J){let{ctx:Q}=this._processInputParams(J);if(Q.parsedType!==J6.promise&&Q.common.async===!1)return F6(Q,{code:h0.invalid_type,expected:J6.promise,received:Q.parsedType}),N8;let Z=Q.parsedType===J6.promise?Q.data:Promise.resolve(Q.data);return xJ(Z.then((X)=>{return this._def.type.parseAsync(X,{path:Q.path,errorMap:Q.common.contextualErrorMap})}))}};gN.create=(J,Q)=>{return new gN({type:J,typeName:R8.ZodPromise,...l8(Q)})};qG=class qG extends z9{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===R8.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(J){let{status:Q,ctx:Z}=this._processInputParams(J),X=this._def.effect||null,Y={addIssue:(K)=>{if(F6(Z,K),K.fatal)Q.abort();else Q.dirty()},get path(){return Z.path}};if(Y.addIssue=Y.addIssue.bind(Y),X.type==="preprocess"){let K=X.transform(Z.data,Y);if(Z.common.async)return Promise.resolve(K).then(async(G)=>{if(Q.value==="aborted")return N8;let q=await this._def.schema._parseAsync({data:G,path:Z.path,parent:Z});if(q.status==="aborted")return N8;if(q.status==="dirty")return bN(q.value);if(Q.value==="dirty")return bN(q.value);return q});else{if(Q.value==="aborted")return N8;let G=this._def.schema._parseSync({data:K,path:Z.path,parent:Z});if(G.status==="aborted")return N8;if(G.status==="dirty")return bN(G.value);if(Q.value==="dirty")return bN(G.value);return G}}if(X.type==="refinement"){let K=(G)=>{let q=X.refinement(G,Y);if(Z.common.async)return Promise.resolve(q);if(q instanceof Promise)throw Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return G};if(Z.common.async===!1){let G=this._def.schema._parseSync({data:Z.data,path:Z.path,parent:Z});if(G.status==="aborted")return N8;if(G.status==="dirty")Q.dirty();return K(G.value),{status:Q.value,value:G.value}}else return this._def.schema._parseAsync({data:Z.data,path:Z.path,parent:Z}).then((G)=>{if(G.status==="aborted")return N8;if(G.status==="dirty")Q.dirty();return K(G.value).then(()=>{return{status:Q.value,value:G.value}})})}if(X.type==="transform")if(Z.common.async===!1){let K=this._def.schema._parseSync({data:Z.data,path:Z.path,parent:Z});if(!wB(K))return N8;let G=X.transform(K.value,Y);if(G instanceof Promise)throw Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:Q.value,value:G}}else return this._def.schema._parseAsync({data:Z.data,path:Z.path,parent:Z}).then((K)=>{if(!wB(K))return N8;return Promise.resolve(X.transform(K.value,Y)).then((G)=>({status:Q.value,value:G}))});O9.assertNever(X)}};qG.create=(J,Q,Z)=>{return new qG({schema:J,typeName:R8.ZodEffects,effect:Q,...l8(Z)})};qG.createWithPreprocess=(J,Q,Z)=>{return new qG({schema:Q,effect:{type:"preprocess",transform:J},typeName:R8.ZodEffects,...l8(Z)})};KG=class KG extends z9{_parse(J){if(this._getType(J)===J6.undefined)return xJ(void 0);return this._def.innerType._parse(J)}unwrap(){return this._def.innerType}};KG.create=(J,Q)=>{return new KG({innerType:J,typeName:R8.ZodOptional,...l8(Q)})};BW=class BW extends z9{_parse(J){if(this._getType(J)===J6.null)return xJ(null);return this._def.innerType._parse(J)}unwrap(){return this._def.innerType}};BW.create=(J,Q)=>{return new BW({innerType:J,typeName:R8.ZodNullable,...l8(Q)})};NO=class NO extends z9{_parse(J){let{ctx:Q}=this._processInputParams(J),Z=Q.data;if(Q.parsedType===J6.undefined)Z=this._def.defaultValue();return this._def.innerType._parse({data:Z,path:Q.path,parent:Q})}removeDefault(){return this._def.innerType}};NO.create=(J,Q)=>{return new NO({innerType:J,typeName:R8.ZodDefault,defaultValue:typeof Q.default==="function"?Q.default:()=>Q.default,...l8(Q)})};LO=class LO extends z9{_parse(J){let{ctx:Q}=this._processInputParams(J),Z={...Q,common:{...Q.common,issues:[]}},X=this._def.innerType._parse({data:Z.data,path:Z.path,parent:{...Z}});if(GO(X))return X.then((Y)=>{return{status:"valid",value:Y.status==="valid"?Y.value:this._def.catchValue({get error(){return new NZ(Z.common.issues)},input:Z.data})}});else return{status:"valid",value:X.status==="valid"?X.value:this._def.catchValue({get error(){return new NZ(Z.common.issues)},input:Z.data})}}removeCatch(){return this._def.innerType}};LO.create=(J,Q)=>{return new LO({innerType:J,typeName:R8.ZodCatch,catchValue:typeof Q.catch==="function"?Q.catch:()=>Q.catch,...l8(Q)})};ES=class ES extends z9{_parse(J){if(this._getType(J)!==J6.nan){let Z=this._getOrReturnCtx(J);return F6(Z,{code:h0.invalid_type,expected:J6.nan,received:Z.parsedType}),N8}return{status:"valid",value:J.data}}};ES.create=(J)=>{return new ES({typeName:R8.ZodNaN,...l8(J)})};XB6=Symbol("zod_brand");Qc=class Qc extends z9{_parse(J){let{ctx:Q}=this._processInputParams(J),Z=Q.data;return this._def.type._parse({data:Z,path:Q.path,parent:Q})}unwrap(){return this._def.type}};IS=class IS extends z9{_parse(J){let{status:Q,ctx:Z}=this._processInputParams(J);if(Z.common.async)return(async()=>{let Y=await this._def.in._parseAsync({data:Z.data,path:Z.path,parent:Z});if(Y.status==="aborted")return N8;if(Y.status==="dirty")return Q.dirty(),bN(Y.value);else return this._def.out._parseAsync({data:Y.value,path:Z.path,parent:Z})})();else{let X=this._def.in._parseSync({data:Z.data,path:Z.path,parent:Z});if(X.status==="aborted")return N8;if(X.status==="dirty")return Q.dirty(),{status:"dirty",value:X.value};else return this._def.out._parseSync({data:X.value,path:Z.path,parent:Z})}}static create(J,Q){return new IS({in:J,out:Q,typeName:R8.ZodPipeline})}};AO=class AO extends z9{_parse(J){let Q=this._def.innerType._parse(J),Z=(X)=>{if(wB(X))X.value=Object.freeze(X.value);return X};return GO(Q)?Q.then((X)=>Z(X)):Z(Q)}unwrap(){return this._def.innerType}};AO.create=(J,Q)=>{return new AO({innerType:J,typeName:R8.ZodReadonly,...l8(Q)})};YB6={object:_4.lazycreate};(function(J){J.ZodString="ZodString",J.ZodNumber="ZodNumber",J.ZodNaN="ZodNaN",J.ZodBigInt="ZodBigInt",J.ZodBoolean="ZodBoolean",J.ZodDate="ZodDate",J.ZodSymbol="ZodSymbol",J.ZodUndefined="ZodUndefined",J.ZodNull="ZodNull",J.ZodAny="ZodAny",J.ZodUnknown="ZodUnknown",J.ZodNever="ZodNever",J.ZodVoid="ZodVoid",J.ZodArray="ZodArray",J.ZodObject="ZodObject",J.ZodUnion="ZodUnion",J.ZodDiscriminatedUnion="ZodDiscriminatedUnion",J.ZodIntersection="ZodIntersection",J.ZodTuple="ZodTuple",J.ZodRecord="ZodRecord",J.ZodMap="ZodMap",J.ZodSet="ZodSet",J.ZodFunction="ZodFunction",J.ZodLazy="ZodLazy",J.ZodLiteral="ZodLiteral",J.ZodEnum="ZodEnum",J.ZodEffects="ZodEffects",J.ZodNativeEnum="ZodNativeEnum",J.ZodOptional="ZodOptional",J.ZodNullable="ZodNullable",J.ZodDefault="ZodDefault",J.ZodCatch="ZodCatch",J.ZodPromise="ZodPromise",J.ZodBranded="ZodBranded",J.ZodPipeline="ZodPipeline",J.ZodReadonly="ZodReadonly"})(R8||(R8={}));Ji1=XG.create,Qi1=OB.create,GB6=ES.create,qB6=jB.create,Zi1=UO.create,zB6=yN.create,UB6=RS.create,WB6=WO.create,FB6=FO.create,HB6=fN.create,BB6=RB.create,DB6=Zz.create,MB6=OS.create,VB6=YG.create,NB6=_4.create,LB6=_4.strictCreate,AB6=HO.create,wB6=Jc.create,RB6=BO.create,OB6=Xz.create,jB6=jS.create,$B6=$S.create,EB6=hN.create,IB6=zO.create,PB6=DO.create,TB6=MO.create,CB6=$B.create,SB6=VO.create,vB6=gN.create,kB6=qG.create,_B6=KG.create,xB6=BW.create,bB6=qG.createWithPreprocess,yB6=IS.create,mB6={string:(J)=>XG.create({...J,coerce:!0}),number:(J)=>OB.create({...J,coerce:!0}),boolean:(J)=>UO.create({...J,coerce:!0}),bigint:(J)=>jB.create({...J,coerce:!0}),date:(J)=>yN.create({...J,coerce:!0})},uB6=N8});var Q1={};E6(Q1,{void:()=>MB6,util:()=>O9,unknown:()=>BB6,union:()=>AB6,undefined:()=>WB6,tuple:()=>OB6,transformer:()=>kB6,symbol:()=>UB6,string:()=>Ji1,strictObject:()=>LB6,setErrorMap:()=>xH6,set:()=>EB6,record:()=>jB6,quotelessJson:()=>kH6,promise:()=>vB6,preprocess:()=>bB6,pipeline:()=>yB6,ostring:()=>fB6,optional:()=>_B6,onumber:()=>hB6,oboolean:()=>gB6,objectUtil:()=>eZ1,object:()=>NB6,number:()=>Qi1,nullable:()=>xB6,null:()=>FB6,never:()=>DB6,nativeEnum:()=>SB6,nan:()=>GB6,map:()=>$B6,makeIssue:()=>wS,literal:()=>TB6,lazy:()=>PB6,late:()=>YB6,isValid:()=>wB,isDirty:()=>ed,isAsync:()=>GO,isAborted:()=>td,intersection:()=>RB6,instanceof:()=>KB6,getParsedType:()=>Qz,getErrorMap:()=>KO,function:()=>IB6,enum:()=>CB6,effect:()=>kB6,discriminatedUnion:()=>wB6,defaultErrorMap:()=>FW,datetimeRegex:()=>ol1,date:()=>zB6,custom:()=>el1,coerce:()=>mB6,boolean:()=>Zi1,bigint:()=>qB6,array:()=>VB6,any:()=>HB6,addIssueToContext:()=>F6,ZodVoid:()=>OS,ZodUnknown:()=>RB,ZodUnion:()=>HO,ZodUndefined:()=>WO,ZodType:()=>z9,ZodTuple:()=>Xz,ZodTransformer:()=>qG,ZodSymbol:()=>RS,ZodString:()=>XG,ZodSet:()=>hN,ZodSchema:()=>z9,ZodRecord:()=>jS,ZodReadonly:()=>AO,ZodPromise:()=>gN,ZodPipeline:()=>IS,ZodParsedType:()=>J6,ZodOptional:()=>KG,ZodObject:()=>_4,ZodNumber:()=>OB,ZodNullable:()=>BW,ZodNull:()=>FO,ZodNever:()=>Zz,ZodNativeEnum:()=>VO,ZodNaN:()=>ES,ZodMap:()=>$S,ZodLiteral:()=>MO,ZodLazy:()=>DO,ZodIssueCode:()=>h0,ZodIntersection:()=>BO,ZodFunction:()=>zO,ZodFirstPartyTypeKind:()=>R8,ZodError:()=>NZ,ZodEnum:()=>$B,ZodEffects:()=>qG,ZodDiscriminatedUnion:()=>Jc,ZodDefault:()=>NO,ZodDate:()=>yN,ZodCatch:()=>LO,ZodBranded:()=>Qc,ZodBoolean:()=>UO,ZodBigInt:()=>jB,ZodArray:()=>YG,ZodAny:()=>fN,Schema:()=>z9,ParseStatus:()=>QJ,OK:()=>xJ,NEVER:()=>uB6,INVALID:()=>N8,EMPTY_PATH:()=>bH6,DIRTY:()=>bN,BRAND:()=>XB6});var YX1=B1(()=>{od();QX1();ll1();AS();Xi1();sd()});var DW=B1(()=>{YX1();YX1()});function dB6(J){return Yi1.safeParse(J)}function EB(J){return pB6.safeParse(J)}function wO(J){if(!J||!Array.isArray(J))return[];let Q=[];for(let[Z,X]of J.entries()){let Y=dB6(X);if(Y.success)Q.push(Y.data);else{let K=typeof X==="object"&&X!==null&&"tool"in X?String(X.tool):`entry at index ${Z}`;u.warn(`Permission entry for tool "${K}" is invalid: ${Y.error.errors.map((G)=>`${G.path.join(".")}: ${G.message}`).join(", ")}`)}}return Q}var KX1,Yi1,pB6;var mN=B1(()=>{DW();G0();KX1=Q1.lazy(()=>Q1.union([Q1.string().describe('Pattern match where "*" matches any number of any characters'),Q1.array(KX1).min(1).describe("OR match of each entry"),Q1.boolean().describe("A literal boolean match"),Q1.number().describe("A literal number match"),Q1.null().describe("A literal null match"),Q1.undefined().describe("A literal undefined match"),Q1.record(Q1.string(),KX1).describe("Matching individual keys of an object")])),Yi1=Q1.object({tool:Q1.string().min(1).describe("The name of the tool to which this entry applies"),matches:Q1.record(Q1.string(),KX1).optional().describe("Maps tool inputs to conditions"),action:Q1.enum(["allow","reject","ask","delegate"]).describe("How Amp should proceed in case of a match"),context:Q1.enum(["thread","subagent"]).optional().describe("Only apply this entry in this context"),to:Q1.string().min(1).optional().describe('Command to delegate to when action is "delegate"')}).superRefine((J,Q)=>{if(J.action==="delegate"&&!J.to)Q.addIssue({code:Q1.ZodIssueCode.custom,message:'delegate action requires "to" field',path:["to"]});if(J.action!=="delegate"&&J.to)Q.addIssue({code:Q1.ZodIssueCode.custom,message:'"to" field only allowed with delegate action',path:["to"]})}),pB6=Q1.array(Yi1).describe("Entries checked in sequence to configure tool permissions")});function ZJ(J,Q){let Z=cB6(J,Q);return typeof Z==="string"?Z:Z.toString()}function cB6(J,Q,Z=!0){if(!Q)Q=lB6();let{workspaceFolders:X,isWindows:Y,homeDir:K}=Q,G=typeof J==="string"?$0.parse(J):$0.from(J);if(X)for(let q of X){let z=V8(q);if(y0.hasPrefix(G,z)){let U=z.path.endsWith("/")?z.path.slice(0,-1):z.path,F=Z&&X&&X.length>=2?LN(z.path)+(Y?"\\":"/"):"";return GX1(F+G.path.slice(U.length+1),Y,G.scheme)}}if(G?.scheme==="file"){if(K){let q=V8(K);if(y0.hasPrefix(G,q)){let z=q.path.endsWith("/")?q.path.slice(0,-1):q.path,U=G.path.slice(z.length+1);return GX1("~"+(Y?"\\":"/")+U,Y,G.scheme)}}return GX1(G.fsPath,Y,G.scheme)}return G}function GX1(J,Q,Z){return Q&&Z==="file"?J.replaceAll("/","\\"):J}function Xc(J){let Q=Zc;return Zc=J,Q}function lB6(){if(Zc)return Zc;throw Error("must call setDisplayPathEnvInfo before calling displayPath() and related functions")}var Zc=null;var MW=B1(()=>{k6();mR();Ud()});function bJ(J,...Q){throw Error(`[Immer] minified error nr: ${J}. Full error at: https://bit.ly/3cXEKWf`)}function dN(J){return!!J&&!!J[TX]}function IB(J){if(!J)return!1;return Ui1(J)||Array.isArray(J)||!!J[PS]||!!J.constructor?.[PS]||kS(J)||_S(J)}function Ui1(J){if(!J||typeof J!=="object")return!1;let Q=pN(J);if(Q===null)return!0;let Z=Object.hasOwnProperty.call(Q,"constructor")&&Q.constructor;if(Z===Object)return!0;return typeof Z=="function"&&Function.toString.call(Z)===iB6}function TS(J,Q){if(cN(J)===0)Reflect.ownKeys(J).forEach((Z)=>{Q(Z,J[Z],J)});else J.forEach((Z,X)=>Q(X,Z,J))}function cN(J){let Q=J[TX];return Q?Q.type_:Array.isArray(J)?1:kS(J)?2:_S(J)?3:0}function CS(J,Q){return cN(J)===2?J.has(Q):Object.prototype.hasOwnProperty.call(J,Q)}function qX1(J,Q){return cN(J)===2?J.get(Q):J[Q]}function Wi1(J,Q,Z){let X=cN(J);if(X===2)J.set(Q,Z);else if(X===3)J.add(Z);else J[Q]=Z}function aB6(J,Q){if(J===Q)return J!==0||1/J===1/Q;else return J!==J&&Q!==Q}function kS(J){return J instanceof Map}function _S(J){return J instanceof Set}function uN(J){return J.copy_||J.base_}function WX1(J,Q){if(kS(J))return new Map(J);if(_S(J))return new Set(J);if(Array.isArray(J))return Array.prototype.slice.call(J);let Z=Ui1(J);if(Q===!0||Q==="class_only"&&!Z){let X=Object.getOwnPropertyDescriptors(J);delete X[TX];let Y=Reflect.ownKeys(X);for(let K=0;K<Y.length;K++){let G=Y[K],q=X[G];if(q.writable===!1)q.writable=!0,q.configurable=!0;if(q.get||q.set)X[G]={configurable:!0,writable:!0,enumerable:q.enumerable,value:J[G]}}return Object.create(pN(J),X)}else{let X=pN(J);if(X!==null&&Z)return{...J};let Y=Object.create(X);return Object.assign(Y,J)}}function $Q(J,Q=!1){if(Gc(J)||dN(J)||!IB(J))return J;if(cN(J)>1)J.set=J.add=J.clear=J.delete=nB6;if(Object.freeze(J),Q)Object.entries(J).forEach(([Z,X])=>$Q(X,!0));return J}function nB6(){bJ(2)}function Gc(J){return Object.isFrozen(J)}function lN(J){let Q=FX1[J];if(!Q)bJ(0,J);return Q}function rB6(J,Q){if(!FX1[J])FX1[J]=Q}function Fi1(){return SS}function sB6(J,Q){return{drafts_:[],parent_:J,immer_:Q,canAutoFreeze_:!0,unfinalizedDrafts_:0}}function Ki1(J,Q){if(Q)lN("Patches"),J.patches_=[],J.inversePatches_=[],J.patchListener_=Q}function HX1(J){BX1(J),J.drafts_.forEach(oB6),J.drafts_=null}function BX1(J){if(J===SS)SS=J.parent_}function Gi1(J){return SS=sB6(SS,J)}function oB6(J){let Q=J[TX];if(Q.type_===0||Q.type_===1)Q.revoke_();else Q.revoked_=!0}function qi1(J,Q){Q.unfinalizedDrafts_=Q.drafts_.length;let Z=Q.drafts_[0];if(J!==void 0&&J!==Z){if(Z[TX].modified_)HX1(Q),bJ(4);if(IB(J)){if(J=Yc(Q,J),!Q.parent_)Kc(Q,J)}if(Q.patches_)lN("Patches").generateReplacementPatches_(Z[TX].base_,J,Q.patches_,Q.inversePatches_)}else J=Yc(Q,Z,[]);if(HX1(Q),Q.patches_)Q.patchListener_(Q.patches_,Q.inversePatches_);return J!==VX1?J:void 0}function Yc(J,Q,Z){if(Gc(Q))return Q;let X=Q[TX];if(!X)return TS(Q,(Y,K)=>zi1(J,X,Q,Y,K,Z)),Q;if(X.scope_!==J)return Q;if(!X.modified_)return Kc(J,X.base_,!0),X.base_;if(!X.finalized_){X.finalized_=!0,X.scope_.unfinalizedDrafts_--;let Y=X.copy_,K=Y,G=!1;if(X.type_===3)K=new Set(Y),Y.clear(),G=!0;if(TS(K,(q,z)=>zi1(J,X,Y,q,z,Z,G)),Kc(J,Y,!1),Z&&J.patches_)lN("Patches").generatePatches_(X,Z,J.patches_,J.inversePatches_)}return X.copy_}function zi1(J,Q,Z,X,Y,K,G){if(dN(Y)){let q=K&&Q&&Q.type_!==3&&!CS(Q.assigned_,X)?K.concat(X):void 0,z=Yc(J,Y,q);if(Wi1(Z,X,z),dN(z))J.canAutoFreeze_=!1;else return}else if(G)Z.add(Y);if(IB(Y)&&!Gc(Y)){if(!J.immer_.autoFreeze_&&J.unfinalizedDrafts_<1)return;if(Yc(J,Y),(!Q||!Q.scope_.parent_)&&typeof X!=="symbol"&&Object.prototype.propertyIsEnumerable.call(Z,X))Kc(J,Y)}}function Kc(J,Q,Z=!1){if(!J.parent_&&J.immer_.autoFreeze_&&J.canAutoFreeze_)$Q(Q,Z)}function tB6(J,Q){let Z=Array.isArray(J),X={type_:Z?1:0,scope_:Q?Q.scope_:Fi1(),modified_:!1,finalized_:!1,assigned_:{},parent_:Q,base_:J,draft_:null,copy_:null,revoke_:null,isManual_:!1},Y=X,K=NX1;if(Z)Y=[X],K=vS;let{revoke:G,proxy:q}=Proxy.revocable(Y,K);return X.draft_=q,X.revoke_=G,q}function zX1(J,Q){let Z=J[TX];return(Z?uN(Z):J)[Q]}function eB6(J,Q,Z){let X=Hi1(Q,Z);return X?"value"in X?X.value:X.get?.call(J.draft_):void 0}function Hi1(J,Q){if(!(Q in J))return;let Z=pN(J);while(Z){let X=Object.getOwnPropertyDescriptor(Z,Q);if(X)return X;Z=pN(Z)}return}function DX1(J){if(!J.modified_){if(J.modified_=!0,J.parent_)DX1(J.parent_)}}function UX1(J){if(!J.copy_)J.copy_=WX1(J.base_,J.scope_.immer_.useStrictShallowCopy_)}function MX1(J,Q){let Z=kS(J)?lN("MapSet").proxyMap_(J,Q):_S(J)?lN("MapSet").proxySet_(J,Q):tB6(J,Q);return(Q?Q.scope_:Fi1()).drafts_.push(Z),Z}function QD6(J){if(!dN(J))bJ(10,J);return Bi1(J)}function Bi1(J){if(!IB(J)||Gc(J))return J;let Q=J[TX],Z;if(Q){if(!Q.modified_)return Q.base_;Q.finalized_=!0,Z=WX1(J,Q.scope_.immer_.useStrictShallowCopy_)}else Z=WX1(J,!0);if(TS(Z,(X,Y)=>{Wi1(Z,X,Bi1(Y))}),Q)Q.finalized_=!1;return Z}function qc(){let Q="replace",Z="add",X="remove";function Y(H,B,M,V){switch(H.type_){case 0:case 2:return G(H,B,M,V);case 1:return K(H,B,M,V);case 3:return q(H,B,M,V)}}function K(H,B,M,V){let{base_:N,assigned_:L}=H,A=H.copy_;if(A.length<N.length)[N,A]=[A,N],[M,V]=[V,M];for(let w=0;w<N.length;w++)if(L[w]&&A[w]!==N[w]){let R=B.concat([w]);M.push({op:Q,path:R,value:F(A[w])}),V.push({op:Q,path:R,value:F(N[w])})}for(let w=N.length;w<A.length;w++){let R=B.concat([w]);M.push({op:Z,path:R,value:F(A[w])})}for(let w=A.length-1;N.length<=w;--w){let R=B.concat([w]);V.push({op:X,path:R})}}function G(H,B,M,V){let{base_:N,copy_:L}=H;TS(H.assigned_,(A,w)=>{let R=qX1(N,A),O=qX1(L,A),$=!w?X:CS(N,A)?Q:Z;if(R===O&&$===Q)return;let j=B.concat(A);M.push($===X?{op:$,path:j}:{op:$,path:j,value:O}),V.push($===Z?{op:X,path:j}:$===X?{op:Z,path:j,value:F(R)}:{op:Q,path:j,value:F(R)})})}function q(H,B,M,V){let{base_:N,copy_:L}=H,A=0;N.forEach((w)=>{if(!L.has(w)){let R=B.concat([A]);M.push({op:X,path:R,value:w}),V.unshift({op:Z,path:R,value:w})}A++}),A=0,L.forEach((w)=>{if(!N.has(w)){let R=B.concat([A]);M.push({op:Z,path:R,value:w}),V.unshift({op:X,path:R,value:w})}A++})}function z(H,B,M,V){M.push({op:Q,path:[],value:B===VX1?void 0:B}),V.push({op:Q,path:[],value:H})}function U(H,B){return B.forEach((M)=>{let{path:V,op:N}=M,L=H;for(let O=0;O<V.length-1;O++){let $=cN(L),j=V[O];if(typeof j!=="string"&&typeof j!=="number")j=""+j;if(($===0||$===1)&&(j==="__proto__"||j==="constructor"))bJ(19);if(typeof L==="function"&&j==="prototype")bJ(19);if(L=qX1(L,j),typeof L!=="object")bJ(18,V.join("/"))}let A=cN(L),w=W(M.value),R=V[V.length-1];switch(N){case Q:switch(A){case 2:return L.set(R,w);case 3:bJ(16);default:return L[R]=w}case Z:switch(A){case 1:return R==="-"?L.push(w):L.splice(R,0,w);case 2:return L.set(R,w);case 3:return L.add(w);default:return L[R]=w}case X:switch(A){case 1:return L.splice(R,1);case 2:return L.delete(R);case 3:return L.delete(M.value);default:return delete L[R]}default:bJ(17,N)}}),H}function W(H){if(!IB(H))return H;if(Array.isArray(H))return H.map(W);if(kS(H))return new Map(Array.from(H.entries()).map(([M,V])=>[M,W(V)]));if(_S(H))return new Set(Array.from(H).map(W));let B=Object.create(pN(H));for(let M in H)B[M]=W(H[M]);if(CS(H,PS))B[PS]=H[PS];return B}function F(H){if(dN(H))return W(H);else return H}rB6("Patches",{applyPatches_:U,generatePatches_:Y,generateReplacementPatches_:z})}function i8(J){return J}var VX1,PS,TX,pN,iB6,FX1,SS,NX1,vS,JD6=class{constructor(J){if(this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.produce=(Q,Z,X)=>{if(typeof Q==="function"&&typeof Z!=="function"){let K=Z;Z=Q;let G=this;return function(z=K,...U){return G.produce(z,(W)=>Z.call(this,W,...U))}}if(typeof Z!=="function")bJ(6);if(X!==void 0&&typeof X!=="function")bJ(7);let Y;if(IB(Q)){let K=Gi1(this),G=MX1(Q,void 0),q=!0;try{Y=Z(G),q=!1}finally{if(q)HX1(K);else BX1(K)}return Ki1(K,X),qi1(Y,K)}else if(!Q||typeof Q!=="object"){if(Y=Z(Q),Y===void 0)Y=Q;if(Y===VX1)Y=void 0;if(this.autoFreeze_)$Q(Y,!0);if(X){let K=[],G=[];lN("Patches").generateReplacementPatches_(Q,Y,K,G),X(K,G)}return Y}else bJ(1,Q)},this.produceWithPatches=(Q,Z)=>{if(typeof Q==="function")return(G,...q)=>this.produceWithPatches(G,(z)=>Q(z,...q));let X,Y;return[this.produce(Q,Z,(G,q)=>{X=G,Y=q}),X,Y]},typeof J?.autoFreeze==="boolean")this.setAutoFreeze(J.autoFreeze);if(typeof J?.useStrictShallowCopy==="boolean")this.setUseStrictShallowCopy(J.useStrictShallowCopy)}createDraft(J){if(!IB(J))bJ(8);if(dN(J))J=QD6(J);let Q=Gi1(this),Z=MX1(J,void 0);return Z[TX].isManual_=!0,BX1(Q),Z}finishDraft(J,Q){let Z=J&&J[TX];if(!Z||!Z.isManual_)bJ(9);let{scope_:X}=Z;return Ki1(X,Q),qi1(void 0,X)}setAutoFreeze(J){this.autoFreeze_=J}setUseStrictShallowCopy(J){this.useStrictShallowCopy_=J}applyPatches(J,Q){let Z;for(Z=Q.length-1;Z>=0;Z--){let Y=Q[Z];if(Y.path.length===0&&Y.op==="replace"){J=Y.value;break}}if(Z>-1)Q=Q.slice(Z+1);let X=lN("Patches").applyPatches_;if(dN(J))return X(J,Q);return this.produce(J,(Y)=>X(Y,Q))}},CX,PB,xS,wW9,RW9,Di1,OW9,jW9;var EQ=B1(()=>{VX1=Symbol.for("immer-nothing"),PS=Symbol.for("immer-draftable"),TX=Symbol.for("immer-state");pN=Object.getPrototypeOf;iB6=Object.prototype.constructor.toString();FX1={};NX1={get(J,Q){if(Q===TX)return J;let Z=uN(J);if(!CS(Z,Q))return eB6(J,Z,Q);let X=Z[Q];if(J.finalized_||!IB(X))return X;if(X===zX1(J.base_,Q))return UX1(J),J.copy_[Q]=MX1(X,J);return X},has(J,Q){return Q in uN(J)},ownKeys(J){return Reflect.ownKeys(uN(J))},set(J,Q,Z){let X=Hi1(uN(J),Q);if(X?.set)return X.set.call(J.draft_,Z),!0;if(!J.modified_){let Y=zX1(uN(J),Q),K=Y?.[TX];if(K&&K.base_===Z)return J.copy_[Q]=Z,J.assigned_[Q]=!1,!0;if(aB6(Z,Y)&&(Z!==void 0||CS(J.base_,Q)))return!0;UX1(J),DX1(J)}if(J.copy_[Q]===Z&&(Z!==void 0||(Q in J.copy_))||Number.isNaN(Z)&&Number.isNaN(J.copy_[Q]))return!0;return J.copy_[Q]=Z,J.assigned_[Q]=!0,!0},deleteProperty(J,Q){if(zX1(J.base_,Q)!==void 0||Q in J.base_)J.assigned_[Q]=!1,UX1(J),DX1(J);else delete J.assigned_[Q];if(J.copy_)delete J.copy_[Q];return!0},getOwnPropertyDescriptor(J,Q){let Z=uN(J),X=Reflect.getOwnPropertyDescriptor(Z,Q);if(!X)return X;return{writable:!0,configurable:J.type_!==1||Q!=="length",enumerable:X.enumerable,value:Z[Q]}},defineProperty(){bJ(11)},getPrototypeOf(J){return pN(J.base_)},setPrototypeOf(){bJ(12)}},vS={};TS(NX1,(J,Q)=>{vS[J]=function(){return arguments[0]=arguments[0][0],Q.apply(this,arguments)}});vS.deleteProperty=function(J,Q){return vS.set.call(this,J,Q,void 0)};vS.set=function(J,Q,Z){return NX1.set.call(this,J[0],Q,Z,J[0])};CX=new JD6,PB=CX.produce,xS=CX.produceWithPatches.bind(CX),wW9=CX.setAutoFreeze.bind(CX),RW9=CX.setUseStrictShallowCopy.bind(CX),Di1=CX.applyPatches.bind(CX),OW9=CX.createDraft.bind(CX),jW9=CX.finishDraft.bind(CX)});function LX1({onlyFirst:J=!1}={}){let Z=["[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?(?:\\u0007|\\u001B\\u005C|\\u009C))","(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-nq-uy=><~]))"].join("|");return new RegExp(Z,J?void 0:"g")}function bS(J){if(typeof J!=="string")throw TypeError(`Expected a \`string\`, got \`${typeof J}\``);return J.replace(ZD6,"")}var ZD6;var AX1=B1(()=>{ZD6=LX1()});var Vi1=t((CW9,Mi1)=>{Mi1.exports=()=>{return/[#*0-9]\uFE0F?\u20E3|[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23ED-\u23EF\u23F1\u23F2\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB\u25FC\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692\u2694-\u2697\u2699\u269B\u269C\u26A0\u26A7\u26AA\u26B0\u26B1\u26BD\u26BE\u26C4\u26C8\u26CF\u26D1\u26E9\u26F0-\u26F5\u26F7\u26F8\u26FA\u2702\u2708\u2709\u270F\u2712\u2714\u2716\u271D\u2721\u2733\u2734\u2744\u2747\u2757\u2763\u27A1\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B55\u3030\u303D\u3297\u3299]\uFE0F?|[\u261D\u270C\u270D](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?|[\u270A\u270B](?:\uD83C[\uDFFB-\uDFFF])?|[\u23E9-\u23EC\u23F0\u23F3\u25FD\u2693\u26A1\u26AB\u26C5\u26CE\u26D4\u26EA\u26FD\u2705\u2728\u274C\u274E\u2753-\u2755\u2795-\u2797\u27B0\u27BF\u2B50]|\u26D3\uFE0F?(?:\u200D\uD83D\uDCA5)?|\u26F9(?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|\u2764\uFE0F?(?:\u200D(?:\uD83D\uDD25|\uD83E\uDE79))?|\uD83C(?:[\uDC04\uDD70\uDD71\uDD7E\uDD7F\uDE02\uDE37\uDF21\uDF24-\uDF2C\uDF36\uDF7D\uDF96\uDF97\uDF99-\uDF9B\uDF9E\uDF9F\uDFCD\uDFCE\uDFD4-\uDFDF\uDFF5\uDFF7]\uFE0F?|[\uDF85\uDFC2\uDFC7](?:\uD83C[\uDFFB-\uDFFF])?|[\uDFC4\uDFCA](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDFCB\uDFCC](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDCCF\uDD8E\uDD91-\uDD9A\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF43\uDF45-\uDF4A\uDF4C-\uDF7C\uDF7E-\uDF84\uDF86-\uDF93\uDFA0-\uDFC1\uDFC5\uDFC6\uDFC8\uDFC9\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF8-\uDFFF]|\uDDE6\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF]|\uDDE7\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF]|\uDDE8\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF7\uDDFA-\uDDFF]|\uDDE9\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF]|\uDDEA\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA]|\uDDEB\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7]|\uDDEC\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE]|\uDDED\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA]|\uDDEE\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9]|\uDDEF\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5]|\uDDF0\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF]|\uDDF1\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE]|\uDDF2\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF]|\uDDF3\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF]|\uDDF4\uD83C\uDDF2|\uDDF5\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE]|\uDDF6\uD83C\uDDE6|\uDDF7\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC]|\uDDF8\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF]|\uDDF9\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF]|\uDDFA\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF]|\uDDFB\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA]|\uDDFC\uD83C[\uDDEB\uDDF8]|\uDDFD\uD83C\uDDF0|\uDDFE\uD83C[\uDDEA\uDDF9]|\uDDFF\uD83C[\uDDE6\uDDF2\uDDFC]|\uDF44(?:\u200D\uD83D\uDFEB)?|\uDF4B(?:\u200D\uD83D\uDFE9)?|\uDFC3(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDFF3\uFE0F?(?:\u200D(?:\u26A7\uFE0F?|\uD83C\uDF08))?|\uDFF4(?:\u200D\u2620\uFE0F?|\uDB40\uDC67\uDB40\uDC62\uDB40(?:\uDC65\uDB40\uDC6E\uDB40\uDC67|\uDC73\uDB40\uDC63\uDB40\uDC74|\uDC77\uDB40\uDC6C\uDB40\uDC73)\uDB40\uDC7F)?)|\uD83D(?:[\uDC3F\uDCFD\uDD49\uDD4A\uDD6F\uDD70\uDD73\uDD76-\uDD79\uDD87\uDD8A-\uDD8D\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA\uDECB\uDECD-\uDECF\uDEE0-\uDEE5\uDEE9\uDEF0\uDEF3]\uFE0F?|[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC](?:\uD83C[\uDFFB-\uDFFF])?|[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4\uDEB5](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD74\uDD90](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?|[\uDC00-\uDC07\uDC09-\uDC14\uDC16-\uDC25\uDC27-\uDC3A\uDC3C-\uDC3E\uDC40\uDC44\uDC45\uDC51-\uDC65\uDC6A\uDC79-\uDC7B\uDC7D-\uDC80\uDC84\uDC88-\uDC8E\uDC90\uDC92-\uDCA9\uDCAB-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDDA4\uDDFB-\uDE2D\uDE2F-\uDE34\uDE37-\uDE41\uDE43\uDE44\uDE48-\uDE4A\uDE80-\uDEA2\uDEA4-\uDEB3\uDEB7-\uDEBF\uDEC1-\uDEC5\uDED0-\uDED2\uDED5-\uDED7\uDEDC-\uDEDF\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB\uDFF0]|\uDC08(?:\u200D\u2B1B)?|\uDC15(?:\u200D\uD83E\uDDBA)?|\uDC26(?:\u200D(?:\u2B1B|\uD83D\uDD25))?|\uDC3B(?:\u200D\u2744\uFE0F?)?|\uDC41\uFE0F?(?:\u200D\uD83D\uDDE8\uFE0F?)?|\uDC68(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDC68\uDC69]\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFE])))?))?|\uDC69(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?[\uDC68\uDC69]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?|\uDC69\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?))|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFE])))?))?|\uDC6F(?:\u200D[\u2640\u2642]\uFE0F?)?|\uDD75(?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|\uDE2E(?:\u200D\uD83D\uDCA8)?|\uDE35(?:\u200D\uD83D\uDCAB)?|\uDE36(?:\u200D\uD83C\uDF2B\uFE0F?)?|\uDE42(?:\u200D[\u2194\u2195]\uFE0F?)?|\uDEB6(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?)|\uD83E(?:[\uDD0C\uDD0F\uDD18-\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5\uDEC3-\uDEC5\uDEF0\uDEF2-\uDEF8](?:\uD83C[\uDFFB-\uDFFF])?|[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD\uDDCF\uDDD4\uDDD6-\uDDDD](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDDDE\uDDDF](?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD0D\uDD0E\uDD10-\uDD17\uDD20-\uDD25\uDD27-\uDD2F\uDD3A\uDD3F-\uDD45\uDD47-\uDD76\uDD78-\uDDB4\uDDB7\uDDBA\uDDBC-\uDDCC\uDDD0\uDDE0-\uDDFF\uDE70-\uDE7C\uDE80-\uDE89\uDE8F-\uDEC2\uDEC6\uDECE-\uDEDC\uDEDF-\uDEE9]|\uDD3C(?:\u200D[\u2640\u2642]\uFE0F?|\uD83C[\uDFFB-\uDFFF])?|\uDDCE(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDDD1(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1|\uDDD1\u200D\uD83E\uDDD2(?:\u200D\uD83E\uDDD2)?|\uDDD2(?:\u200D\uD83E\uDDD2)?))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?))?|\uDEF1(?:\uD83C(?:\uDFFB(?:\u200D\uD83E\uDEF2\uD83C[\uDFFC-\uDFFF])?|\uDFFC(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFD-\uDFFF])?|\uDFFD(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])?|\uDFFE(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFD\uDFFF])?|\uDFFF(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFE])?))?)/g}});function XD6(J){return typeof J==="number"&&Number.isInteger(J)&&J>=1&&J<=3600}function Li1(J){let Q=J.settings["tools.inactivityTimeout"],Z=J.settings["tools.stopTimeout"],X=Q;if(X===void 0&&Z!==void 0)X=Z;if(X===void 0)X=JO.contributes.configuration.properties["amp.tools.inactivityTimeout"].default;if(!XD6(X))return null;return X*1000}function Ai1(J){let Q=J.settings["tools.stopTimeout"],Z=JO.contributes.configuration.properties["amp.tools.stopTimeout"].default;return(Q??Z)*1000}var Ni1;var zc=B1(()=>{pZ1();Ni1=JO.contributes.configuration.properties});function Uc(J,Q){return new t1((Z)=>{let X=setTimeout(Y,Q);function Y(){Z.error(Error(`Tool execution timed out after ${Q/1000} seconds`))}function K(){if(X)clearTimeout(X);X=setTimeout(Y,Q)}let G=J.subscribe({next:(q)=>{K(),Z.next(q)},error:(q)=>{if(X)clearTimeout(X),X=null;Z.error(q)},complete:()=>{if(X)clearTimeout(X),X=null;Z.complete()}});return()=>{if(X)clearTimeout(X),X=null;G.unsubscribe()}})}var wX1=B1(()=>{v0()});function x4(J,Q){let Z={name:Q.name,description:Q.description,inputSchema:Q.inputSchema,source:Q.source,meta:Q.meta,customizedForModel:!1},X=Q.modelCustomizations;if(X){for(let Y of X)if(Y.modelSelector.test(J))Z={...Z,name:Y.name??Z.name,description:Y.description??Z.description,inputSchema:Y.inputSchema??Z.inputSchema,customizedForModel:!0}}return Z}function yJ(J){return["done","error","rejected-by-user","cancelled"].includes(J.status)}function Oi1(J){return["done","error","cancelled"].includes(J.status)}function RO(J){let Q=[],Z=new k8;function X(K,G){let q=Q.filter((z)=>z.spec.name===K);if(q.length===0&&K==="Glob")q=Q.filter((z)=>z.spec.name==="glob");for(let z of q)if(yS(z.spec,G).enabled)return z;return}function Y(K,G,q){if(!K)throw Error("spec is required");let z={spec:K,fn:Promise.resolve(G),preprocessArgs:q};return Q.push(z),Z.next(),{dispose:()=>{let U=Q.indexOf(z);if(U!==-1)Q.splice(U,1),Z.next()}}}return{registerTool({spec:K,fn:G,preprocessArgs:q}){if(!G)return YD6;return Y(K,G,q)},tools:x9(J.configService.config,Z.pipe(u2(void 0))).pipe(b0(([K])=>{return Q.map((G)=>({spec:G.spec,...yS(G.spec,K)})).sort((G,q)=>G.spec.name.localeCompare(q.spec.name))})),invokeTool(K,G,q){let z=performance.now(),U=()=>KD6.record(performance.now()-z,{toolName:K});if(K===OX1&&G.args&&"invalid_tool_name"in G.args&&typeof G.args.invalid_tool_name==="string"){Fc.add(1,{toolName:K,error:"invalid"});let F=RX1(G.args.invalid_tool_name);return new t1((H)=>{H.error(Error(F))})}let W=X(K,q.config);if(!W){let F=Q.filter((V)=>V.spec.name===K);if(F.length===0)return Fc.add(1,{toolName:K,error:"not_found"}),new t1((V)=>{V.error(Error(`tool ${JSON.stringify(K)} not found`))});let H=F[0],B=yS(H.spec,q.config);Fc.add(1,{toolName:K,error:"disabled"});let M=B.enabled?"unknown":B.disabledReason;return new t1((V)=>{V.error(Error(`tool ${JSON.stringify(K)} is disabled: ${M}`))})}return Fc.add(1,{toolName:K}),c6(()=>W.fn).pipe(q8((F)=>{let H=F(G,q);if(W.spec.meta?.disableTimeout)return H;return Uc(H,Ai1(q.config))}),zW(()=>U()))},preprocessArgs(K,G,q){let z=X(K,q.config);if(!z||!z.preprocessArgs)return;let U=z.preprocessArgs;try{return U(G,q)}catch(W){u.error("preprocessArgs",{id:K,args:G,error:String(W)});return}},dispose(){}}}function Wc(J,Q){for(let Z of Q){if(Z==="")continue;if(Z.length===1){if(Z==="*")return!0;if(Z===J)return!0;continue}if(J===Z)return!0;if(Z.includes("*")||Z.includes("?")||Z.includes("[")||Z.includes("{"))try{if(Ri1.default(Z,{dot:!0})(J))return!0}catch(X){continue}}return!1}function yS(J,Q){let Z=Q.settings?.["tools.disable"]??[];if(Wc(J.name,Z))return{enabled:!1,disabledReason:"settings"};if(typeof J.source==="object"&&"mcp"in J.source){let X=$i1(J.name);if(X&&J.source.mcp===X.server&&Wc(X.tool,Z))return{enabled:!1,disabledReason:"settings"}}if(J.source==="builtin"&&Wc(`builtin:${J.name}`,Z))return{enabled:!1,disabledReason:"settings"};if(typeof J.source==="object"&&"toolbox"in J.source&&Wc(`toolbox:${J.name}`,Z))return{enabled:!1,disabledReason:"settings"};if(J.name===JJ||J.name===MB){if(Q.settings?.["todos.enabled"])return{enabled:!0};return{enabled:!1,disabledReason:"feature-flag"}}return{enabled:!0}}function RX1(J){return`Invalid tool name ${JSON.stringify(J)}. Tool names must match the pattern ${fS.toString()}. Try again with a valid tool name.`}function $i1(J){let[,Q,Z]=J.split(/mcp__([^ ]+)__([^ ]+)/);if(Q&&Z)return{server:Q,tool:Z};return}function jX1(J){if(J.status==="in-progress"||J.status==="done"||J.status==="cancelled"||J.status==="error")return J.progress;return}function LZ(J,Q,Z=!0){let X=new Set(Q.map((K)=>K.spec.name));function Y(K){if(X.has(K))return!0;if(K==="Glob"&&X.has("glob"))return!0;if(Z&&$i1(K))return!0;return!1}return{registerTool(K){throw Error("Tools should not be registered in a filtered tool service")},invokeTool(K,G,q){if(!Y(K))return new t1((z)=>{z.error(Error(`tool ${JSON.stringify(K)} not allowed in filtered service`))});return J.invokeTool(K,G,q)},preprocessArgs(K,G,q){if(!Y(K))return;return J.preprocessArgs?.(K,G,q)},tools:J.tools.pipe(b0((K)=>K.filter((G)=>Y(G.spec.name)))),dispose(){}}}var wi1,Ri1,YD6,OX1="invalid_tool",fS,ji1,Fc,KD6;var t2=B1(()=>{v0();G0();zc();wX1();F8();wi1=d6(Nd(),1),Ri1=d6(_N(),1);YD6={dispose(){}};fS=/^[a-zA-Z0-9_]{1,64}$/,ji1=wi1.metrics.getMeter("tool_service"),Fc=ji1.createCounter("tool_service.invocation_count",{description:"Number of tool invocations"}),KD6=ji1.createHistogram("tool_service.invocation_latency",{description:"Latency of tool invocations",unit:"ms"})});var Si1=t((Ti1)=>{Object.defineProperty(Ti1,"__esModule",{value:!0});Ti1.calcSlices=Ti1.applyPatch=Ti1.calcPatch=Ti1.lcs=Ti1.diff=Ti1.diff_core=void 0;function GD6(J,Q){let{b:Z,eq:X,stack_base:Y}=J,{i:K,N:G,j:q,M:z,Z:U,stack_top:W}=J;for(;;)switch(Q){case 0:{J:while(G>0&&z>0){Z.fill(0,0,2*U);let F=G-z,H=G+z,B=H&1,M=K+G-1,V=q+z-1,N=(H+B)/2,L;Q:for(let A=0;A<=N;A++){let w=2*Math.max(0,A-z)-A,R=A-2*Math.max(0,A-G);for(let O=w;O<=R;O+=2){let $=Z[O-1-U*Math.floor((O-1)/U)],j=Z[O+1-U*Math.floor((O+1)/U)],E=O===-A||O!==A&&$<j?j:$+1,I=E-O,T=E,S=I;while(T<G&&S<z&&X(K+T,q+S))T++,S++;if(Z[O-U*Math.floor(O/U)]=T,B===1&&(L=F-O)>=1-A&&L<A&&T+Z[U+L-U*Math.floor(L/U)]>=G)if(A>1||T!==E){Y[W++]=K+T,Y[W++]=G-T,Y[W++]=q+S,Y[W++]=z-S,G=E,z=I,U=2*(Math.min(G,z)+1);continue J}else break Q}for(let O=w;O<=R;O+=2){let $=Z[U+O-1-U*Math.floor((O-1)/U)],j=Z[U+O+1-U*Math.floor((O+1)/U)],E=O===-A||O!==A&&$<j?j:$+1,I=E-O,T=E,S=I;while(T<G&&S<z&&X(M-T,V-S))T++,S++;if(Z[U+O-U*Math.floor(O/U)]=T,B===0&&(L=F-O)>=-A&&L<=A&&T+Z[L-U*Math.floor(L/U)]>=G)if(A>0||T!==E){Y[W++]=K+G-E,Y[W++]=E,Y[W++]=q+z-I,Y[W++]=I,G=G-T,z=z-S,U=2*(Math.min(G,z)+1);continue J}else break Q}}if(G===z)continue;if(z>G)K+=G,q+=G,z-=G,G=0;else K+=z,q+=z,G-=z,z=0;break}if(G+z!==0)if(J.pxe===K||J.pye===q)J.pxe=K+G,J.pye=q+z;else{let F=J.pxs;if(J.oxs=J.pxs,J.oxe=J.pxe,J.oys=J.pys,J.oye=J.pye,J.pxs=K,J.pxe=K+G,J.pys=q,J.pye=q+z,F>=0)return J.i=K,J.N=G,J.j=q,J.M=z,J.Z=U,J.stack_top=W,1}}case 1:{if(W===0)return 2;z=Y[--W],q=Y[--W],G=Y[--W],K=Y[--W],U=2*(Math.min(G,z)+1),Q=0}}}class Ei1{constructor(J){this.state=J,this.c=0,this.result={value:null,done:!1}}[Symbol.iterator](){return this}next(){let{state:J,result:Q}=this;if(this.c>1)return Q.done=!0,Q.value=void 0,Q;let Z=GD6(J,this.c);if(this.c=Z,Z===1)return Q.value=[J.oxs,J.oxe,J.oys,J.oye],Q;if(J.pxs>=0)return Q.value=[J.pxs,J.pxe,J.pys,J.pye],Q;return Q.done=!0,Q.value=void 0,Q}}function Ii1(J,Q,Z,X,Y){let K=(Math.min(Q,X)+1)*2,G=Q+X,q=new(G<256?Uint8Array:G<65536?Uint16Array:Uint32Array)(2*K);return new Ei1({i:J,N:Q,j:Z,M:X,Z:K,b:q,eq:Y,pxs:-1,pxe:-1,pys:-1,pye:-1,oxs:-1,oxe:-1,oys:-1,oye:-1,stack_top:0,stack_base:[]})}Ti1.diff_core=Ii1;function Hc(J,Q,Z){let[X,Y,K]=[0,J.length,Q.length];if(typeof Z==="function"){while(X<Y&&X<K&&Z(X,X))X++;if(X===Y&&X===K)return[][Symbol.iterator]();while(Z(--Y,--K)&&Y>X&&K>X);}else{while(X<Y&&X<K&&J[X]===Q[X])X++;if(X===Y&&X===K)return[][Symbol.iterator]();while(J[--Y]===Q[--K]&&Y>X&&K>X);Z=(G,q)=>J[G]===Q[q]}return Ii1(X,Y+1-X,X,K+1-X,Z)}Ti1.diff=Hc;class Pi1{constructor(J,Q){this.diff=J,this.N=Q,this.i=0,this.j=0}[Symbol.iterator](){return this}next(){let J=this.diff.next();if(J.done){let{i:q,j:z,N:U}=this;if(q<U)J.done=!1,J.value=[q,z,U-q],this.i=U;return J}let Q=J.value,Z=Q[0],X=Q[1],Y=Q[3],{i:K,j:G}=this;if(K!==Z)Q.length--,Q[0]=K,Q[1]=G,Q[2]=Z-K;return this.i=X,this.j=Y,J}}function qD6(J,Q,Z){return new Pi1(Hc(J,Q,Z),J.length)}Ti1.lcs=qD6;function*zD6(J,Q,Z){let X=ArrayBuffer.isView(J)?Uint8Array.prototype.subarray:J.slice;for(let Y of Hc(J,Q,Z))Y[2]=X.call(Q,Y[2],Y[3]),yield Y}Ti1.calcPatch=zD6;function*UD6(J,Q){let Z=0,X=ArrayBuffer.isView(J)?Uint8Array.prototype.subarray:J.slice;for(let[Y,K,G]of Q){if(Z<Y)yield X.call(J,Z,Y);if(G.length>0)yield G;Z=K}if(Z<J.length)yield X.call(J,Z)}Ti1.applyPatch=UD6;function*WD6(J,Q,Z){let X=0,Y=ArrayBuffer.isView(J)?Uint8Array.prototype.subarray:J.slice;for(let[K,G,q,z]of Hc(J,Q,Z)){if(X<K)yield[0,Y.call(J,X,K)];if(K<G)yield[-1,Y.call(J,K,G)];if(q<z)yield[1,Y.call(Q,q,z)];X=G}if(X<J.length)yield[0,J.slice(X)]}Ti1.calcSlices=WD6});function Bc(J,Q){if(J===void 0||Q===void 0||J===Q)return{added:0,deleted:0,changed:0};let Z={added:0,deleted:0,changed:0};for(let[X,Y,K,G]of vi1.diff(J.split(`
|
|
4
4
|
`),Q.split(`
|
|
5
5
|
`)))Z.deleted+=Y-X,Z.added+=G-K,Z.changed+=Math.min(Y-X,G-K);return Z}function ki1(J){return{added:J?.split(`
|
|
6
6
|
`).length??0,deleted:0,changed:0}}function $X1(J){if(!J)return{totalFiles:0,createdFiles:0,totalAdded:0,totalRemoved:0,totalModified:0,revertedFiles:0,allReverted:!1};let Q=J.files.length,Z=J.files.filter((z)=>z.created).length,X=J.files.filter((z)=>z.reverted).length,Y=X===Q&&Q>0,K=0,G=0,q=0;for(let z of J.files){if(z.reverted)continue;K+=z.diffStat.added,G+=z.diffStat.removed,q+=z.diffStat.modified}return{totalFiles:Q,createdFiles:Z,totalAdded:K,totalRemoved:G,totalModified:q,revertedFiles:X,allReverted:Y}}var vi1;var Dc=B1(()=>{vi1=d6(Si1(),1)});function Yz(){return`T-${crypto.randomUUID()}`}function zG(J){if(!J.startsWith("T-"))return!1;let Q=J.slice(2);return/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i.test(Q)}function OO(){return`toolu_${crypto.randomUUID()}`}function _i1(J){return J.startsWith("toolu_")||J.startsWith("call_")}function xi1(J){for(let Q=J.messages.length-1;Q>=0;Q--){let Z=J.messages[Q];if(Z?.role==="info"){let X=Z.content[0];if(X?.type==="summary"&&X?.summary.type==="message")return}if(Z?.role==="assistant"&&Z.usage)return Z.usage}return J["~debug"]?.lastInferenceUsage}function SX(J,Q){for(let Z of J.messages){if(Z.role!=="assistant")continue;for(let X of Z.content)if(X.type==="tool_use"&&X.id===Q)return X}return}function jO(J,Q){for(let[Z,X]of J.messages.entries()){if(X.role!=="assistant")continue;for(let[Y,K]of X.content.entries())if(K.type==="tool_use"&&K.id===Q)return{message:X,messageIndex:Z,block:K,blockIndex:Y}}return null}function TB(J,Q){for(let Z of J.messages){if(Z.role!=="user")continue;for(let X of Z.content)if(X.type==="tool_result"&&X.toolUseID===Q)return X}return}function XJ(J){return J.messages.filter((Q)=>Q.role==="user").flatMap((Q)=>Q.content).filter((Q)=>Q.type==="tool_result").reduce((Q,Z)=>{return Q.set(Z.toolUseID,Z),Q},new Map)}function EX1(J){if(J&&typeof J==="object"&&"threadID"in J){let Q=J.threadID;if(typeof Q==="string"&&zG(Q))return Q}return}function IX1(J){let Q=[],Z=new Map;for(let X of J)if(X.role==="assistant"){for(let Y of X.content)if(Y.type==="tool_use"&&Y.name===t5)Z.set(Y.id,Y)}else if(X.role==="user"){for(let Y of X.content)if(Y.type==="tool_result"){let K=Z.get(Y.toolUseID);if(K){let G=Y.run,q=(G.status==="in-progress"||G.status==="cancelled"||G.status==="done"||G.status==="error")&&G.progress?EX1(G.progress):void 0;if(q)Q.push({toolUseID:Y.toolUseID,threadID:q,toolUse:K,toolResult:Y})}}}return Q}function bi1(J){if(!J)return!1;if(J.role==="assistant")return J.state?.type==="cancelled";if(J.role==="user")return J.content.some((Q)=>Q.type==="tool_result"&&Q.run.status==="cancelled");return!1}function yi1(J){if(!J)return!1;if(J.role==="user")return J.content.some((Q)=>Q.type==="tool_result"&&Q.run.status==="rejected-by-user");return!1}function PX1(J){if(!J)return!1;return J.role==="info"}function VD6(J){return J.replace(/u([0-9A-Fa-f]{4})(\s)/gi,(Q,Z,X)=>{try{return String.fromCodePoint(parseInt(Z,16))+X}catch{return`u${Z}${X}`}})}function Mc(J){for(let Q=J.messages.length-1;Q>=0;Q--){let Z=J.messages[Q];if(Z?.role==="info"){if(Z.content.some((Y)=>Y.type==="summary"&&Y.summary.type==="message"))break}if(Z?.role!=="assistant"||!Z.state||Z.state.type!=="complete"||Z.state.stopReason!=="tool_use")continue;for(let X of Z.content)if(X.type==="tool_use"&&X.name===JJ&&X.input){let Y=X.input.todos;if(Array.isArray(Y))return Y;let K=X.input.content;if(typeof K==="string")return VD6(K)}}return}function r7(J){return J.map((Q)=>Q.type==="text"?Q.text:null).filter((Q)=>Q!==null).join(`
|
|
@@ -6031,11 +6031,11 @@ Actual: ${Y}`)}async function H29(J,Q,Z){let{execSync:X}=await import("node:ch
|
|
|
6031
6031
|
${B}`;if(Y==="pnpm"&&B.includes("Unable to find the global bin directory"))M+=`
|
|
6032
6032
|
|
|
6033
6033
|
Hint: Try running "pnpm setup" to configure pnpm global directory, or use npm instead:
|
|
6034
|
-
npm install -g @sourcegraph/amp`;q(Error(M))}},error:(H)=>{if(!W)W=!0,q(Error(`Failed to spawn ${Y}: ${H.message}`))},complete:()=>{if(!W)W=!0,G()}})})}G0();G0();async function I51(J){try{let Z=new AbortController,X=setTimeout(()=>Z.abort(),5000),Y=await fetch("https://registry.npmjs.org/@sourcegraph/amp",{signal:Z.signal});if(clearTimeout(X),!Y.ok)return{hasUpdate:!1,currentVersion:J,source:"npm"};let K=await Y.json(),G=K["dist-tags"]?.latest;if(!G)return{hasUpdate:!1,currentVersion:J,source:"npm"};let q=N29(J,G),z=q<0,U,W;if(K.time){let F=K.time[J],H=K.time[G],B=Date.now();if(F)U=Math.floor((B-new Date(F).getTime())/3600000);if(H)W=Math.floor((B-new Date(H).getTime())/3600000)}return u.info("NPM version comparison",{currentVersion:J,latestVersion:G,compareResult:q,hasUpdate:z,currentVersionAge:U,latestVersionAge:W}),{hasUpdate:z,latestVersion:G,currentVersion:J,currentVersionAge:U,latestVersionAge:W,source:"npm"}}catch(Z){return u.debug("Error checking npm version",{error:Z}),{hasUpdate:!1,currentVersion:J,source:"npm"}}}function N29(J,Q){let Z=(G)=>{let[q,z]=G.split("-");return{parts:q?.split(".").map(Number)||[],label:z}},X=Z(J),Y=Z(Q),K=Math.max(X.parts.length,Y.parts.length);for(let G=0;G<K;G++){let q=X.parts[G]||0,z=Y.parts[G]||0;if(q<z)return-1;if(q>z)return 1}if(X.label===Y.label)return 0;if(!X.label&&Y.label)return 1;if(X.label&&!Y.label)return-1;if(X.label&&Y.label)return X.label<Y.label?-1:1;return 0}v0();function Wf1(J,Q){let Z=new k8,X=Z.pipe(M9({shouldCountRefs:!1}));return setImmediate(async()=>{let Y=new rq().scoped("update"),K=X.subscribe({next:(G)=>{Y.debug("emit new state",G)}});try{let G=process.env.AMP_TEST_UPDATE_STATUS;if(G){Y.debug("using fake update status for testing",{status:G}),await N_(500),Z.next(G);return}if(process.env.AMP_SKIP_UPDATE_CHECK==="1"){Y.debug("checking disabled via AMP_SKIP_UPDATE_CHECK environment variable");return}let q=await Q.get("updates.mode");if(q==="disabled"){Y.debug("checking disabled");return}Y.debug("checking",{currentVersion:J,mode:q});let z=await I51(J);if(!(z.latestVersion&&z.hasUpdate)){Y.debug("no update available");return}let U=await E51();if(!q)q=U==="pnpm"?"warn":"auto",Y.debug("no configured update mode; selected default based on package manager",{packageManager:U,mode:q});if(q==="warn"){Z.next("update-available");return}if(!U){Y.debug("auto-update not supported, falling back to warn mode"),Z.next("update-available");return}try{await ru(z.latestVersion,U);let W=await oV(z.latestVersion),F={from:z.currentVersion,to:z.latestVersion,...W};if(W.status==="same")Y.info("success",F),Z.next("updated");else Y.warn("success with warning",F),Z.next("updated-with-warning")}catch(W){Z.next("update-error")}}catch(G){Y.debug("check failed",{error:G})}finally{await N_(5000),Z.next("hidden"),K.unsubscribe(),Z.complete()}}),{state:X}}import{stderr as eU}from"node:process";function KZ6(J){let Q=new ow().name("install").description("Install required tools like ripgrep to $AMP_HOME/bin").option("--force","Force reinstallation even if already installed").option("--verbose","Show installation progress and results").action(async(X)=>{await qf1(X.force||!1,X.verbose||!1,"0.0.
|
|
6034
|
+
npm install -g @sourcegraph/amp`;q(Error(M))}},error:(H)=>{if(!W)W=!0,q(Error(`Failed to spawn ${Y}: ${H.message}`))},complete:()=>{if(!W)W=!0,G()}})})}G0();G0();async function I51(J){try{let Z=new AbortController,X=setTimeout(()=>Z.abort(),5000),Y=await fetch("https://registry.npmjs.org/@sourcegraph/amp",{signal:Z.signal});if(clearTimeout(X),!Y.ok)return{hasUpdate:!1,currentVersion:J,source:"npm"};let K=await Y.json(),G=K["dist-tags"]?.latest;if(!G)return{hasUpdate:!1,currentVersion:J,source:"npm"};let q=N29(J,G),z=q<0,U,W;if(K.time){let F=K.time[J],H=K.time[G],B=Date.now();if(F)U=Math.floor((B-new Date(F).getTime())/3600000);if(H)W=Math.floor((B-new Date(H).getTime())/3600000)}return u.info("NPM version comparison",{currentVersion:J,latestVersion:G,compareResult:q,hasUpdate:z,currentVersionAge:U,latestVersionAge:W}),{hasUpdate:z,latestVersion:G,currentVersion:J,currentVersionAge:U,latestVersionAge:W,source:"npm"}}catch(Z){return u.debug("Error checking npm version",{error:Z}),{hasUpdate:!1,currentVersion:J,source:"npm"}}}function N29(J,Q){let Z=(G)=>{let[q,z]=G.split("-");return{parts:q?.split(".").map(Number)||[],label:z}},X=Z(J),Y=Z(Q),K=Math.max(X.parts.length,Y.parts.length);for(let G=0;G<K;G++){let q=X.parts[G]||0,z=Y.parts[G]||0;if(q<z)return-1;if(q>z)return 1}if(X.label===Y.label)return 0;if(!X.label&&Y.label)return 1;if(X.label&&!Y.label)return-1;if(X.label&&Y.label)return X.label<Y.label?-1:1;return 0}v0();function Wf1(J,Q){let Z=new k8,X=Z.pipe(M9({shouldCountRefs:!1}));return setImmediate(async()=>{let Y=new rq().scoped("update"),K=X.subscribe({next:(G)=>{Y.debug("emit new state",G)}});try{let G=process.env.AMP_TEST_UPDATE_STATUS;if(G){Y.debug("using fake update status for testing",{status:G}),await N_(500),Z.next(G);return}if(process.env.AMP_SKIP_UPDATE_CHECK==="1"){Y.debug("checking disabled via AMP_SKIP_UPDATE_CHECK environment variable");return}let q=await Q.get("updates.mode");if(q==="disabled"){Y.debug("checking disabled");return}Y.debug("checking",{currentVersion:J,mode:q});let z=await I51(J);if(!(z.latestVersion&&z.hasUpdate)){Y.debug("no update available");return}let U=await E51();if(!q)q=U==="pnpm"?"warn":"auto",Y.debug("no configured update mode; selected default based on package manager",{packageManager:U,mode:q});if(q==="warn"){Z.next("update-available");return}if(!U){Y.debug("auto-update not supported, falling back to warn mode"),Z.next("update-available");return}try{await ru(z.latestVersion,U);let W=await oV(z.latestVersion),F={from:z.currentVersion,to:z.latestVersion,...W};if(W.status==="same")Y.info("success",F),Z.next("updated");else Y.warn("success with warning",F),Z.next("updated-with-warning")}catch(W){Z.next("update-error")}}catch(G){Y.debug("check failed",{error:G})}finally{await N_(5000),Z.next("hidden"),K.unsubscribe(),Z.complete()}}),{state:X}}import{stderr as eU}from"node:process";function KZ6(J){let Q=new ow().name("install").description("Install required tools like ripgrep to $AMP_HOME/bin").option("--force","Force reinstallation even if already installed").option("--verbose","Show installation progress and results").action(async(X)=>{await qf1(X.force||!1,X.verbose||!1,"0.0.1761782504-g670405"),process.exit()});J.addCommand(Q,{hidden:!0});let Z=new ow("update").summary("Update Amp CLI").description("Update Amp CLI to the latest version. You can specify a particular version to install, or leave blank to get the latest stable release.").option("--version <version>","Update to a specific version").allowUnknownOption(!1).action(async(X)=>{await L29(X.version)});J.addCommand(Z)}async function L29(J){if(process.env.AMP_SKIP_UPDATE_CHECK==="1")eU.write(U8.yellow(`Note: AMP_SKIP_UPDATE_CHECK=1 is set, which disables automatic update checking. Manual updates will still work.
|
|
6035
6035
|
|
|
6036
6036
|
`));try{if(!J){eU.write(U8.blue(`Checking for updates...
|
|
6037
|
-
`));let{hasUpdate:Z,latestVersion:X}=await I51("0.0.
|
|
6038
|
-
`));let Y=await oV("0.0.
|
|
6037
|
+
`));let{hasUpdate:Z,latestVersion:X}=await I51("0.0.1761782504-g670405");if(!Z){eU.write(U8.green(`✓ Amp CLI is already up to date.
|
|
6038
|
+
`));let Y=await oV("0.0.1761782504-g670405");if(Y.warning)eU.write(`
|
|
6039
6039
|
`+U8.yellow(Y.warning)+`
|
|
6040
6040
|
`);process.exit(0)}if(!X)eU.write(U8.yellow("[WARN] could not find latest version")),process.exit(0);J=X}eU.write(U8.blue(`Updating to version ${J}...
|
|
6041
6041
|
`)),await ru(J,void 0,(Z)=>{eU.write(U8.dim(`Running: ${Z}
|
|
@@ -6455,7 +6455,7 @@ See https://ampcode.com/manual#toolboxes`);return Q[0]||sR}function lZ6(J,Q){let
|
|
|
6455
6455
|
`);J.command("use").argument("<tool-name>","The tool to invoke").summary("Invoke a tool with arguments or JSON input from stdin").description(Z).option("--only <field>","Extract only the specified field from the result").allowUnknownOption(!0).allowExcessArguments(!0).action(async function(X,Y,K){let G=K.optsWithGlobals(),q=await Q(K,G),z=0;await q.mcpService.initialized;let U=K.args.slice(1),W;if(dZ6()){let F=[];for await(let H of process.stdin)F.push(H);W=Buffer.concat(F).toString("utf-8").trim()}await uZ6({toolName:X,rawArgs:U,stdinInput:W,only:Y.only,threadDeps:q,stdout:process.stdout,stderr:process.stderr,exit:(F)=>{z=F}}),await q.asyncDispose(),q.cleanupTerminal(),process.exit(z)})}import{randomBytes as SK9}from"node:crypto";import{homedir as vK9}from"node:os";import tp from"node:path";v0();G0();var iZ6=120000,aZ6=180000;function Nf1(J,Q=Date.now()){return Q-J<aZ6}function Lf1(J,Q,Z=()=>!0,X){let Y=null,K=[],G=5;return $N(t1.of(void 0),Rd(iZ6).pipe(T7(()=>Z()))).pipe(q8(()=>c6(async(q)=>{let z=await X?.getContext();u.debug("[Ads] Fetching ad from server",{hasContext:!!z});let U=await J.getCurrentAd({context:z,excludeAdIds:K},{config:Q,signal:q});if(!U.ok)throw u.error("[Ads] Failed to fetch ad",{error:U.error.message}),Error(U.error.message);if(U.result){if(Y=U.result,K.length>=G)K.shift();K.push(Y.id),u.debug("[Ads] Received ad from server",{adTitle:Y.title,matchType:Y.matchType,matchedPatterns:Y.matchedPatterns,candidateAdPoolCount:Y.candidateAdPoolCount,recentlyShownCount:K.length})}else u.debug("[Ads] No ad available from server");return Y})),e6((q,z)=>q?.id===z?.id))}G0();dj();q2();aB();o9();VL();F8();k6();function nZ6(J){let Q=J.trim();if(Q==="quit"||Q==="exit")return"/quit";return J}function rZ6(J,Q,Z){if(J.agentMode)return J.agentMode;if(Q?.agentMode){let X=Q.agentMode;if(X==="free"){if(Z?.canUseAmpFree??!1)return"free";return"smart"}return X}return"smart"}G0();aB();import p49 from"node:fs";import sZ6 from"node:path";function oZ6(J){let Q=J.trim().replace(/^["']|["']$/g,"");if(Q=Q.replace(/\\(.)/g,"$1"),!/\.(png|jpe?g|gif|webp)$/i.test(Q))return null;if(!sZ6.isAbsolute(Q))return null;return u.debug("Extracted image path",{original:J,extracted:Q}),Q}function tZ6(J){try{let Q=sZ6.extname(J).toLowerCase(),Z=xe1(Q);if(!Z)return u.warn("Unsupported image file extension",{ext:Q}),null;try{let X=p49.readFileSync(J);return d49(X,Z)}catch(X){u.error(`Failed to read image file ${J}:`,X)}}catch(Q){u.error("Error handling image file path",{imagePath:J,error:Q})}return null}function d49(J,Q){if(J.length===0)return u.warn("Image file is empty (0 bytes)"),null;if(J.length>CW)return u.warn(`Image file too large: ${J.length} bytes (max: ${CW})`),null;return{type:"image",source:{type:"base64",data:J.toString("base64"),mediaType:Q}}}import{execSync as _79}from"node:child_process";zj();G0();import{spawn as c49}from"node:child_process";import{promises as l49}from"node:fs";function eZ6(J){return J.kind==="executable"}function JX6(J){return J.kind==="markdown"}var iH=50000,QX6=300000;async function tu(J,Q,Z,X={}){let{timeoutMs:Y=QX6,signal:K}=X;try{let G=await Z.getCommand(J);if(!G)return{success:!1,output:"",error:`Command '${J}' not found`};if(!await Z.isCommandAvailable(J))return{success:!1,output:"",error:`Command '${J}' is not available for execution`};if(u.debug("Executing command",{commandName:J,filePath:G.filePath,args:Q}),JX6(G))return await i49(G,Q);else if(eZ6(G))return await a49(G,Q,Y,K);else return{success:!1,output:"",error:"Unsupported command type"}}catch(G){return u.error("Failed to execute command",{commandName:J,error:G}),{success:!1,output:"",error:G instanceof Error?G.message:"Unknown error occurred"}}}async function i49(J,Q){try{if(Q.length>0)return{success:!1,output:"",error:"Markdown commands do not accept arguments"};let Z=await l49.readFile(J.filePath,"utf8");return{success:!0,output:(Z.length>iH?Z.slice(0,iH)+`
|
|
6456
6456
|
... (output truncated at ${iH} characters)`:Z).trim(),exitCode:0}}catch(Z){return{success:!1,output:"",error:Z instanceof Error?Z.message:"Failed to read markdown file"}}}async function a49(J,Q,Z=QX6,X){return new Promise((Y)=>{let[K,G]=n49(J,Q);u.debug("Spawning command",{spawnCommand:K,spawnArgs:G.slice(0,10),filePath:J.filePath,timeoutMs:Z});let q=Pe1(X),z=!1,U=setTimeout(()=>{z=!0,q.abort(),u.warn("Command execution timed out",{commandName:J.name,timeoutMs:Z})},Z),W=c49(K,G,{stdio:["pipe","pipe","pipe"],signal:q.signal,detached:!0}),F=[],H=[],B=0;W.stdout?.on("data",(M)=>{let V=M.toString();if(B+=V.length,B<=iH)F.push(V);else{let N=iH-(B-V.length);if(N>0)F.push(V.slice(0,N))}}),W.stderr?.on("data",(M)=>{let V=M.toString();if(B+=V.length,B<=iH)H.push(V);else{let N=iH-(B-V.length);if(N>0)H.push(V.slice(0,N))}}),W.on("close",(M)=>{if(clearTimeout(U),z){Y({success:!1,output:F.join(""),error:`Command timed out after ${Z}ms`,exitCode:void 0});return}if(q.signal.aborted){Y({success:!1,output:F.join(""),error:"The command was aborted",exitCode:M??void 0});return}let V=M===0||M===1,N=F.join(""),L=H.join(""),A=N;if(!V&&!N.trim()&&L.trim())A=L;else if(L.trim())A+=N?`
|
|
6457
6457
|
${L}`:L;if(B>iH)A+=`
|
|
6458
|
-
... (output truncated at ${iH} characters)`;Y({success:V,output:A.trim(),error:!V?L.trim()||"Command failed":void 0,exitCode:M??void 0})}),W.on("error",(M)=>{clearTimeout(U);let V=M.message;if(z)V=`Command timed out after ${Z}ms`;else if(M.message.includes("operation was aborted")||M.name==="AbortError")V="The command was aborted";Y({success:!1,output:F.join(""),error:V})})})}function n49(J,Q){let{filePath:Z,interpreter:X,extension:Y}=J;if(process.platform==="win32")return s49(Z,X?[...X]:null,Y,Q);else return r49(Z,X?[...X]:null,Y,Q)}function r49(J,Q,Z,X){if(Q&&Q.length>0&&Q[0])return[Q[0],[...Q.slice(1),J,...X]];else return[J,X]}function s49(J,Q,Z,X){if(Q&&Q.length>0&&Q[0])return[Q[0],[...Q.slice(1),J,...X]];switch(Z.toLowerCase()){case".bat":case".cmd":return["cmd.exe",["/c",J,...X]];case".ps1":return["powershell.exe",["-ExecutionPolicy","Bypass","-File",J,...X]];case".exe":return[J,X];default:return[J,X]}}G0();dj();q2();MW();uX();wz();k6();v0();var _51={};E6(_51,{scrollUp:()=>V79,scrollDown:()=>N79,link:()=>j79,image:()=>$79,iTerm:()=>E79,exitAlternativeScreen:()=>R79,eraseUp:()=>M79,eraseStartLine:()=>B79,eraseScreen:()=>Af1,eraseLines:()=>F79,eraseLine:()=>KX6,eraseEndLine:()=>H79,eraseDown:()=>D79,enterAlternativeScreen:()=>w79,cursorUp:()=>XX6,cursorTo:()=>e49,cursorShow:()=>W79,cursorSavePosition:()=>Y79,cursorRestorePosition:()=>K79,cursorPrevLine:()=>z79,cursorNextLine:()=>q79,cursorMove:()=>J79,cursorLeft:()=>YX6,cursorHide:()=>U79,cursorGetPosition:()=>G79,cursorForward:()=>Z79,cursorDown:()=>Q79,cursorBackward:()=>X79,clearTerminal:()=>A79,clearScreen:()=>L79,beep:()=>O79});import wf1 from"node:process";var k51=globalThis.window?.document!==void 0,IV2=globalThis.process?.versions?.node!==void 0,PV2=globalThis.process?.versions?.bun!==void 0,TV2=globalThis.Deno?.version?.deno!==void 0,CV2=globalThis.process?.versions?.electron!==void 0,SV2=globalThis.navigator?.userAgent?.includes("jsdom")===!0,vV2=typeof WorkerGlobalScope<"u"&&globalThis instanceof WorkerGlobalScope,kV2=typeof DedicatedWorkerGlobalScope<"u"&&globalThis instanceof DedicatedWorkerGlobalScope,_V2=typeof SharedWorkerGlobalScope<"u"&&globalThis instanceof SharedWorkerGlobalScope,xV2=typeof ServiceWorkerGlobalScope<"u"&&globalThis instanceof ServiceWorkerGlobalScope,eu=globalThis.navigator?.userAgentData?.platform,bV2=eu==="macOS"||globalThis.navigator?.platform==="MacIntel"||globalThis.navigator?.userAgent?.includes(" Mac ")===!0||globalThis.process?.platform==="darwin",yV2=eu==="Windows"||globalThis.navigator?.platform==="Win32"||globalThis.process?.platform==="win32",fV2=eu==="Linux"||globalThis.navigator?.platform?.startsWith("Linux")===!0||globalThis.navigator?.userAgent?.includes(" Linux ")===!0||globalThis.process?.platform==="linux",hV2=eu==="iOS"||globalThis.navigator?.platform==="MacIntel"&&globalThis.navigator?.maxTouchPoints>1||/iPad|iPhone|iPod/.test(globalThis.navigator?.platform),gV2=eu==="Android"||globalThis.navigator?.platform==="Android"||globalThis.navigator?.userAgent?.includes(" Android ")===!0||globalThis.process?.platform==="android";var R2="\x1B[",Qp="\x1B]",wC="\x07",Jp=";",ZX6=!k51&&wf1.env.TERM_PROGRAM==="Apple_Terminal",o49=!k51&&wf1.platform==="win32",t49=k51?()=>{throw Error("`process.cwd()` only works in Node.js, not the browser.")}:wf1.cwd,e49=(J,Q)=>{if(typeof J!=="number")throw TypeError("The `x` argument is required");if(typeof Q!=="number")return R2+(J+1)+"G";return R2+(Q+1)+Jp+(J+1)+"H"},J79=(J,Q)=>{if(typeof J!=="number")throw TypeError("The `x` argument is required");let Z="";if(J<0)Z+=R2+-J+"D";else if(J>0)Z+=R2+J+"C";if(Q<0)Z+=R2+-Q+"A";else if(Q>0)Z+=R2+Q+"B";return Z},XX6=(J=1)=>R2+J+"A",Q79=(J=1)=>R2+J+"B",Z79=(J=1)=>R2+J+"C",X79=(J=1)=>R2+J+"D",YX6=R2+"G",Y79=ZX6?"\x1B7":R2+"s",K79=ZX6?"\x1B8":R2+"u",G79=R2+"6n",q79=R2+"E",z79=R2+"F",U79=R2+"?25l",W79=R2+"?25h",F79=(J)=>{let Q="";for(let Z=0;Z<J;Z++)Q+=KX6+(Z<J-1?XX6():"");if(J)Q+=YX6;return Q},H79=R2+"K",B79=R2+"1K",KX6=R2+"2K",D79=R2+"J",M79=R2+"1J",Af1=R2+"2J",V79=R2+"S",N79=R2+"T",L79="\x1Bc",A79=o49?`${Af1}${R2}0f`:`${Af1}${R2}3J${R2}H`,w79=R2+"?1049h",R79=R2+"?1049l",O79=wC,j79=(J,Q)=>[Qp,"8",Jp,Jp,Q,wC,J,Qp,"8",Jp,Jp,wC].join(""),$79=(J,Q={})=>{let Z=`${Qp}1337;File=inline=1`;if(Q.width)Z+=`;width=${Q.width}`;if(Q.height)Z+=`;height=${Q.height}`;if(Q.preserveAspectRatio===!1)Z+=";preserveAspectRatio=0";return Z+":"+Buffer.from(J).toString("base64")+wC},E79={setCwd:(J=t49())=>`${Qp}50;CurrentDir=${J}${wC}`,annotation(J,Q={}){let Z=`${Qp}1337;`,X=Q.x!==void 0,Y=Q.y!==void 0;if((X||Y)&&!(X&&Y&&Q.length!==void 0))throw Error("`x`, `y` and `length` must be defined when `x` or `y` is defined");if(J=J.replaceAll("|",""),Z+=Q.isHidden?"AddHiddenAnnotation=":"AddAnnotation=",Q.length>0)Z+=(X?[J,Q.length,Q.x,Q.y]:[Q.length,J]).join("|");else Z+=J;return Z+wC}};var x51=d6(HX6(),1);function JN(J,Q,{target:Z="stdout",...X}={}){if(!x51.default[Z]){if(X.fallback===!1)return J;return typeof X.fallback==="function"?X.fallback(J,Q):`${J} (${Q})`}return _51.link(J,Q)}JN.isSupported=x51.default.stdout;JN.stderr=(J,Q,Z={})=>JN(J,Q,{target:"stderr",...Z});JN.stderr.isSupported=x51.default.stderr;G0();uX();class Zp{enabled;configService;commandCounts=new Map;timer=null;bufferTimeMs=1e4;constructor(J,Q){this.enabled=J;this.configService=Q;this.startTimer()}startTimer(){this.timer=setInterval(()=>{this.flushEvents()},this.bufferTimeMs)}async flushEvents(){if(this.commandCounts.size===0||!await this.enabled())return;let J=Array.from(this.commandCounts.entries()).map(([Q,Z])=>({feature:"cli.command",action:Q,source:{client:"cli",clientVersion:"0.0.1761768090-g22bb6d"},parameters:{metadata:{count:Z}},timestamp:Date.now()*1000}));this.commandCounts.clear();try{let Q=JSON.stringify(J);await Fn(Q,this.configService)}catch(Q){u.error("Failed to export command telemetry events",Q)}}async submit(J){if(!await this.enabled()||this.timer===null)return;let Q=this.commandCounts.get(J)||0;this.commandCounts.set(J,Q+1)}async dispose(){if(await this.flushEvents(),this.timer!==null)clearInterval(this.timer),this.timer=null}}import{execFile as y51}from"node:child_process";import{platform as Ef1}from"node:os";import{promisify as C79}from"node:util";var b51=C79(y51),S79=(J)=>`\x1B]52;c;${J}\x1B\\`,v79="\x1B]52;c;?\x1B\\",k79="\x1B]52;p;?\x1B\\";class BX6{capabilities=null;pendingReadPromise=null;readResolve=null;readTimeout=null;setCapabilities(J){this.capabilities=J}isOsc52Supported(){return this.capabilities?.osc52??!1}async commandExists(J){try{return await b51("which",[J]),!0}catch{return!1}}async writeToPbcopy(J){try{let Q=y51("pbcopy");return Q.stdin?.write(J),Q.stdin?.end(),await new Promise((Z,X)=>{Q.on("close",(Y)=>{if(Y===0)Z();else X(Error(`pbcopy exited with code ${Y}`))})}),!0}catch{return!1}}async writeToWlCopy(J){try{let Q=y51("wl-copy");return Q.stdin?.write(J),Q.stdin?.end(),await new Promise((Z,X)=>{Q.on("close",(Y)=>{if(Y===0)Z();else X(Error(`wl-copy exited with code ${Y}`))})}),!0}catch{return!1}}async writeToXclip(J){try{let Q=y51("xclip",["-selection","clipboard"]);return Q.stdin?.write(J),Q.stdin?.end(),await new Promise((Z,X)=>{Q.on("close",(Y)=>{if(Y===0)Z();else X(Error(`xclip exited with code ${Y}`))})}),!0}catch{return!1}}async readFromOSC52WithQuery(J){if(!this.isOsc52Supported())return null;if(this.pendingReadPromise)return this.pendingReadPromise;this.pendingReadPromise=new Promise((Z)=>{this.readResolve=Z,this.readTimeout=setTimeout(()=>{this.readResolve=null,this.pendingReadPromise=null,Z(null)},2000),process.stdout.write(J)});let Q=await this.pendingReadPromise;return this.pendingReadPromise=null,Q}async readFromOSC52(){return this.readFromOSC52WithQuery(v79)}handleOSC52Response(J){if(this.readResolve&&this.readTimeout){clearTimeout(this.readTimeout),this.readTimeout=null;try{let Q=Buffer.from(J,"base64").toString("utf8");this.readResolve(Q)}catch{this.readResolve(null)}this.readResolve=null,this.pendingReadPromise=null}}async readFromPbpaste(){try{let{stdout:J}=await b51("pbpaste");return J}catch{return null}}async readFromWlPaste(J){try{let Q=["--no-newline"];if(J==="primary")Q.push("--primary");let{stdout:Z}=await b51("wl-paste",Q);return Z}catch{return null}}async readFromXclip(J){try{let{stdout:Q}=await b51("xclip",["-selection",J,"-o"]);return Q}catch{return null}}async readFromOSC52Primary(){return this.readFromOSC52WithQuery(k79)}async readText(){if(this.isOsc52Supported()){let Q=await this.readFromOSC52();if(Q!==null)return Q}if(Ef1()==="darwin"){let Q=await this.readFromPbpaste();if(Q!==null)return Q}else{if(await this.commandExists("wl-paste")){let Q=await this.readFromWlPaste("clipboard");if(Q!==null)return Q}if(await this.commandExists("xclip")){let Q=await this.readFromXclip("clipboard");if(Q!==null)return Q}}return null}async readPrimarySelection(){if(Ef1()==="darwin")return this.readText();if(this.isOsc52Supported()){let Q=await this.readFromOSC52Primary();if(Q!==null)return Q}if(await this.commandExists("wl-paste")){let Q=await this.readFromWlPaste("primary");if(Q!==null)return Q}if(await this.commandExists("xclip")){let Q=await this.readFromXclip("primary");if(Q!==null)return Q}return null}async writeText(J){if(this.isOsc52Supported()){let Z=Buffer.from(J).toString("base64"),X=S79(Z);process.stdout.write(X);return}if(Ef1()==="darwin"){if(await this.writeToPbcopy(J))return}else{if(await this.commandExists("wl-copy")&&await this.writeToWlCopy(J))return;if(await this.commandExists("xclip")&&await this.writeToXclip(J))return}}}var AY=new BX6;G0();class w4{message;name;constructor(J){this.message=J;this.name="InformationMessage"}}function f51(J){if(J instanceof w4)return{title:"Info",description:J.message,type:"info"};return u.warn("Unknown error type encountered",{name:J.name,message:J.message,stack:J.stack}),{title:"Error",description:J.message||"An unexpected error occurred.",type:"error"}}class If1{configService;commands;customRegistry;latestCustom=[];telemetrySubmitter;constructor(J=XS(),Q){this.configService=Q;this.customRegistry=J,this._initBaseCommands(!1),this.customRegistry.commands.subscribe((Z)=>this.latestCustom=Z),this.telemetrySubmitter=new Zp(async()=>{try{return(await this.configService.getLatest()).settings["experimental.cli.commandTelemetry.enabled"]===!0}catch{return!1}},this.configService),this.configService.config.pipe(b0((Z)=>DZ(Z.settings)),e6()).subscribe((Z)=>{this._initBaseCommands(Z.length>1)})}_initBaseCommands(J){if(this.commands={...x79},J)Object.assign(this.commands,b79)}async execute(J,Q,Z=[],X){this.telemetrySubmitter.submit(J).catch((q)=>{u.debug("Failed to submit command telemetry",q)});let Y=this.commands[J];if(Y)return Y.execute(Q,Z);let K=this.latestCustom.find((q)=>q.name===J),G=await tu(J,Z,this.customRegistry,{signal:X});if(G.success){let q=Q.getEditorText(),U=q.trim()&&!q.endsWith(`
|
|
6458
|
+
... (output truncated at ${iH} characters)`;Y({success:V,output:A.trim(),error:!V?L.trim()||"Command failed":void 0,exitCode:M??void 0})}),W.on("error",(M)=>{clearTimeout(U);let V=M.message;if(z)V=`Command timed out after ${Z}ms`;else if(M.message.includes("operation was aborted")||M.name==="AbortError")V="The command was aborted";Y({success:!1,output:F.join(""),error:V})})})}function n49(J,Q){let{filePath:Z,interpreter:X,extension:Y}=J;if(process.platform==="win32")return s49(Z,X?[...X]:null,Y,Q);else return r49(Z,X?[...X]:null,Y,Q)}function r49(J,Q,Z,X){if(Q&&Q.length>0&&Q[0])return[Q[0],[...Q.slice(1),J,...X]];else return[J,X]}function s49(J,Q,Z,X){if(Q&&Q.length>0&&Q[0])return[Q[0],[...Q.slice(1),J,...X]];switch(Z.toLowerCase()){case".bat":case".cmd":return["cmd.exe",["/c",J,...X]];case".ps1":return["powershell.exe",["-ExecutionPolicy","Bypass","-File",J,...X]];case".exe":return[J,X];default:return[J,X]}}G0();dj();q2();MW();uX();wz();k6();v0();var _51={};E6(_51,{scrollUp:()=>V79,scrollDown:()=>N79,link:()=>j79,image:()=>$79,iTerm:()=>E79,exitAlternativeScreen:()=>R79,eraseUp:()=>M79,eraseStartLine:()=>B79,eraseScreen:()=>Af1,eraseLines:()=>F79,eraseLine:()=>KX6,eraseEndLine:()=>H79,eraseDown:()=>D79,enterAlternativeScreen:()=>w79,cursorUp:()=>XX6,cursorTo:()=>e49,cursorShow:()=>W79,cursorSavePosition:()=>Y79,cursorRestorePosition:()=>K79,cursorPrevLine:()=>z79,cursorNextLine:()=>q79,cursorMove:()=>J79,cursorLeft:()=>YX6,cursorHide:()=>U79,cursorGetPosition:()=>G79,cursorForward:()=>Z79,cursorDown:()=>Q79,cursorBackward:()=>X79,clearTerminal:()=>A79,clearScreen:()=>L79,beep:()=>O79});import wf1 from"node:process";var k51=globalThis.window?.document!==void 0,IV2=globalThis.process?.versions?.node!==void 0,PV2=globalThis.process?.versions?.bun!==void 0,TV2=globalThis.Deno?.version?.deno!==void 0,CV2=globalThis.process?.versions?.electron!==void 0,SV2=globalThis.navigator?.userAgent?.includes("jsdom")===!0,vV2=typeof WorkerGlobalScope<"u"&&globalThis instanceof WorkerGlobalScope,kV2=typeof DedicatedWorkerGlobalScope<"u"&&globalThis instanceof DedicatedWorkerGlobalScope,_V2=typeof SharedWorkerGlobalScope<"u"&&globalThis instanceof SharedWorkerGlobalScope,xV2=typeof ServiceWorkerGlobalScope<"u"&&globalThis instanceof ServiceWorkerGlobalScope,eu=globalThis.navigator?.userAgentData?.platform,bV2=eu==="macOS"||globalThis.navigator?.platform==="MacIntel"||globalThis.navigator?.userAgent?.includes(" Mac ")===!0||globalThis.process?.platform==="darwin",yV2=eu==="Windows"||globalThis.navigator?.platform==="Win32"||globalThis.process?.platform==="win32",fV2=eu==="Linux"||globalThis.navigator?.platform?.startsWith("Linux")===!0||globalThis.navigator?.userAgent?.includes(" Linux ")===!0||globalThis.process?.platform==="linux",hV2=eu==="iOS"||globalThis.navigator?.platform==="MacIntel"&&globalThis.navigator?.maxTouchPoints>1||/iPad|iPhone|iPod/.test(globalThis.navigator?.platform),gV2=eu==="Android"||globalThis.navigator?.platform==="Android"||globalThis.navigator?.userAgent?.includes(" Android ")===!0||globalThis.process?.platform==="android";var R2="\x1B[",Qp="\x1B]",wC="\x07",Jp=";",ZX6=!k51&&wf1.env.TERM_PROGRAM==="Apple_Terminal",o49=!k51&&wf1.platform==="win32",t49=k51?()=>{throw Error("`process.cwd()` only works in Node.js, not the browser.")}:wf1.cwd,e49=(J,Q)=>{if(typeof J!=="number")throw TypeError("The `x` argument is required");if(typeof Q!=="number")return R2+(J+1)+"G";return R2+(Q+1)+Jp+(J+1)+"H"},J79=(J,Q)=>{if(typeof J!=="number")throw TypeError("The `x` argument is required");let Z="";if(J<0)Z+=R2+-J+"D";else if(J>0)Z+=R2+J+"C";if(Q<0)Z+=R2+-Q+"A";else if(Q>0)Z+=R2+Q+"B";return Z},XX6=(J=1)=>R2+J+"A",Q79=(J=1)=>R2+J+"B",Z79=(J=1)=>R2+J+"C",X79=(J=1)=>R2+J+"D",YX6=R2+"G",Y79=ZX6?"\x1B7":R2+"s",K79=ZX6?"\x1B8":R2+"u",G79=R2+"6n",q79=R2+"E",z79=R2+"F",U79=R2+"?25l",W79=R2+"?25h",F79=(J)=>{let Q="";for(let Z=0;Z<J;Z++)Q+=KX6+(Z<J-1?XX6():"");if(J)Q+=YX6;return Q},H79=R2+"K",B79=R2+"1K",KX6=R2+"2K",D79=R2+"J",M79=R2+"1J",Af1=R2+"2J",V79=R2+"S",N79=R2+"T",L79="\x1Bc",A79=o49?`${Af1}${R2}0f`:`${Af1}${R2}3J${R2}H`,w79=R2+"?1049h",R79=R2+"?1049l",O79=wC,j79=(J,Q)=>[Qp,"8",Jp,Jp,Q,wC,J,Qp,"8",Jp,Jp,wC].join(""),$79=(J,Q={})=>{let Z=`${Qp}1337;File=inline=1`;if(Q.width)Z+=`;width=${Q.width}`;if(Q.height)Z+=`;height=${Q.height}`;if(Q.preserveAspectRatio===!1)Z+=";preserveAspectRatio=0";return Z+":"+Buffer.from(J).toString("base64")+wC},E79={setCwd:(J=t49())=>`${Qp}50;CurrentDir=${J}${wC}`,annotation(J,Q={}){let Z=`${Qp}1337;`,X=Q.x!==void 0,Y=Q.y!==void 0;if((X||Y)&&!(X&&Y&&Q.length!==void 0))throw Error("`x`, `y` and `length` must be defined when `x` or `y` is defined");if(J=J.replaceAll("|",""),Z+=Q.isHidden?"AddHiddenAnnotation=":"AddAnnotation=",Q.length>0)Z+=(X?[J,Q.length,Q.x,Q.y]:[Q.length,J]).join("|");else Z+=J;return Z+wC}};var x51=d6(HX6(),1);function JN(J,Q,{target:Z="stdout",...X}={}){if(!x51.default[Z]){if(X.fallback===!1)return J;return typeof X.fallback==="function"?X.fallback(J,Q):`${J} (${Q})`}return _51.link(J,Q)}JN.isSupported=x51.default.stdout;JN.stderr=(J,Q,Z={})=>JN(J,Q,{target:"stderr",...Z});JN.stderr.isSupported=x51.default.stderr;G0();uX();class Zp{enabled;configService;commandCounts=new Map;timer=null;bufferTimeMs=1e4;constructor(J,Q){this.enabled=J;this.configService=Q;this.startTimer()}startTimer(){this.timer=setInterval(()=>{this.flushEvents()},this.bufferTimeMs)}async flushEvents(){if(this.commandCounts.size===0||!await this.enabled())return;let J=Array.from(this.commandCounts.entries()).map(([Q,Z])=>({feature:"cli.command",action:Q,source:{client:"cli",clientVersion:"0.0.1761782504-g670405"},parameters:{metadata:{count:Z}},timestamp:Date.now()*1000}));this.commandCounts.clear();try{let Q=JSON.stringify(J);await Fn(Q,this.configService)}catch(Q){u.error("Failed to export command telemetry events",Q)}}async submit(J){if(!await this.enabled()||this.timer===null)return;let Q=this.commandCounts.get(J)||0;this.commandCounts.set(J,Q+1)}async dispose(){if(await this.flushEvents(),this.timer!==null)clearInterval(this.timer),this.timer=null}}import{execFile as y51}from"node:child_process";import{platform as Ef1}from"node:os";import{promisify as C79}from"node:util";var b51=C79(y51),S79=(J)=>`\x1B]52;c;${J}\x1B\\`,v79="\x1B]52;c;?\x1B\\",k79="\x1B]52;p;?\x1B\\";class BX6{capabilities=null;pendingReadPromise=null;readResolve=null;readTimeout=null;setCapabilities(J){this.capabilities=J}isOsc52Supported(){return this.capabilities?.osc52??!1}async commandExists(J){try{return await b51("which",[J]),!0}catch{return!1}}async writeToPbcopy(J){try{let Q=y51("pbcopy");return Q.stdin?.write(J),Q.stdin?.end(),await new Promise((Z,X)=>{Q.on("close",(Y)=>{if(Y===0)Z();else X(Error(`pbcopy exited with code ${Y}`))})}),!0}catch{return!1}}async writeToWlCopy(J){try{let Q=y51("wl-copy");return Q.stdin?.write(J),Q.stdin?.end(),await new Promise((Z,X)=>{Q.on("close",(Y)=>{if(Y===0)Z();else X(Error(`wl-copy exited with code ${Y}`))})}),!0}catch{return!1}}async writeToXclip(J){try{let Q=y51("xclip",["-selection","clipboard"]);return Q.stdin?.write(J),Q.stdin?.end(),await new Promise((Z,X)=>{Q.on("close",(Y)=>{if(Y===0)Z();else X(Error(`xclip exited with code ${Y}`))})}),!0}catch{return!1}}async readFromOSC52WithQuery(J){if(!this.isOsc52Supported())return null;if(this.pendingReadPromise)return this.pendingReadPromise;this.pendingReadPromise=new Promise((Z)=>{this.readResolve=Z,this.readTimeout=setTimeout(()=>{this.readResolve=null,this.pendingReadPromise=null,Z(null)},2000),process.stdout.write(J)});let Q=await this.pendingReadPromise;return this.pendingReadPromise=null,Q}async readFromOSC52(){return this.readFromOSC52WithQuery(v79)}handleOSC52Response(J){if(this.readResolve&&this.readTimeout){clearTimeout(this.readTimeout),this.readTimeout=null;try{let Q=Buffer.from(J,"base64").toString("utf8");this.readResolve(Q)}catch{this.readResolve(null)}this.readResolve=null,this.pendingReadPromise=null}}async readFromPbpaste(){try{let{stdout:J}=await b51("pbpaste");return J}catch{return null}}async readFromWlPaste(J){try{let Q=["--no-newline"];if(J==="primary")Q.push("--primary");let{stdout:Z}=await b51("wl-paste",Q);return Z}catch{return null}}async readFromXclip(J){try{let{stdout:Q}=await b51("xclip",["-selection",J,"-o"]);return Q}catch{return null}}async readFromOSC52Primary(){return this.readFromOSC52WithQuery(k79)}async readText(){if(this.isOsc52Supported()){let Q=await this.readFromOSC52();if(Q!==null)return Q}if(Ef1()==="darwin"){let Q=await this.readFromPbpaste();if(Q!==null)return Q}else{if(await this.commandExists("wl-paste")){let Q=await this.readFromWlPaste("clipboard");if(Q!==null)return Q}if(await this.commandExists("xclip")){let Q=await this.readFromXclip("clipboard");if(Q!==null)return Q}}return null}async readPrimarySelection(){if(Ef1()==="darwin")return this.readText();if(this.isOsc52Supported()){let Q=await this.readFromOSC52Primary();if(Q!==null)return Q}if(await this.commandExists("wl-paste")){let Q=await this.readFromWlPaste("primary");if(Q!==null)return Q}if(await this.commandExists("xclip")){let Q=await this.readFromXclip("primary");if(Q!==null)return Q}return null}async writeText(J){if(this.isOsc52Supported()){let Z=Buffer.from(J).toString("base64"),X=S79(Z);process.stdout.write(X);return}if(Ef1()==="darwin"){if(await this.writeToPbcopy(J))return}else{if(await this.commandExists("wl-copy")&&await this.writeToWlCopy(J))return;if(await this.commandExists("xclip")&&await this.writeToXclip(J))return}}}var AY=new BX6;G0();class w4{message;name;constructor(J){this.message=J;this.name="InformationMessage"}}function f51(J){if(J instanceof w4)return{title:"Info",description:J.message,type:"info"};return u.warn("Unknown error type encountered",{name:J.name,message:J.message,stack:J.stack}),{title:"Error",description:J.message||"An unexpected error occurred.",type:"error"}}class If1{configService;commands;customRegistry;latestCustom=[];telemetrySubmitter;constructor(J=XS(),Q){this.configService=Q;this.customRegistry=J,this._initBaseCommands(!1),this.customRegistry.commands.subscribe((Z)=>this.latestCustom=Z),this.telemetrySubmitter=new Zp(async()=>{try{return(await this.configService.getLatest()).settings["experimental.cli.commandTelemetry.enabled"]===!0}catch{return!1}},this.configService),this.configService.config.pipe(b0((Z)=>DZ(Z.settings)),e6()).subscribe((Z)=>{this._initBaseCommands(Z.length>1)})}_initBaseCommands(J){if(this.commands={...x79},J)Object.assign(this.commands,b79)}async execute(J,Q,Z=[],X){this.telemetrySubmitter.submit(J).catch((q)=>{u.debug("Failed to submit command telemetry",q)});let Y=this.commands[J];if(Y)return Y.execute(Q,Z);let K=this.latestCustom.find((q)=>q.name===J),G=await tu(J,Z,this.customRegistry,{signal:X});if(G.success){let q=Q.getEditorText(),U=q.trim()&&!q.endsWith(`
|
|
6459
6459
|
|
|
6460
6460
|
`)?`
|
|
6461
6461
|
${G.output}`:G.output;Q.editorDispatch({type:"insert-text",text:U});return}return Error(G.error??`Command '${J}' failed`)}query(J,Q,Z){let X=Object.values(this.commands).filter((K)=>{if(!Q||!K.isVisible)return!0;return K.isVisible(Q,Z)}),Y=this.latestCustom.filter((K)=>K.available).map((K)=>({name:K.name,description:"Custom command",requiresArgs:K.kind==="executable",execute:(G,q)=>this.execute(K.name,G,q??[])}));return[...X,...Y]}async cleanup(){await this.telemetrySubmitter.dispose()}get(J){let Q=this.commands[J];if(Q)return Q;let Z=this.latestCustom.find((X)=>X.name===J);return{name:J,description:"Custom command",requiresArgs:Z?.kind==="executable",execute:(X,Y)=>this.execute(J,X,Y??[])}}getCustomCommand(J){return this.latestCustom.find((Q)=>Q.name===J)}}var x79={"generate-agent-file":{name:"generate-agent-file",description:`Generate an ${k5} file in the current workspace`,execute:async(J,Q)=>{let Z=await J.configService.getLatest(),X=xZ(Z.settings),K=J.getInMemoryAgentModeOverride()??X;J.worker.handle({type:"user:message",message:{content:[{type:"text",text:Bn}],agentMode:K}});return}},editor:{name:"editor",description:"Open $EDITOR to write a prompt",launchesWindow:!0,execute:async(J,Q)=>{return J.openInEditor("")}},help:{name:"help",description:"Show help and hotkeys",execute:async(J,Q)=>{J.openHelp();return}},permissions:{name:"permissions",description:"Edit permission rules in $EDITOR, or `/permissions off|on` to toggle for this session",launchesWindow:!0,execute:async(J,Q)=>{if(Q&&Q.length>0){let Y=Q[0]?.trim().toLowerCase();switch(Y){case"on":try{return MZ("dangerouslyAllowAll",!1),new w4("Amp is now following permissions rules for this session")}catch(K){return u.error("Failed to set dangerously allow all setting",K),Error("Failed to enable permissions for this session")}case"off":try{return MZ("dangerouslyAllowAll",!0),new w4("Permissions disabled for this session - you will NOT be asked for confirmation before Amp runs a command.")}catch(K){return u.error("Failed to set dangerously allow all setting",K),Error("Failed to disable permissions for this session")}case"edit":break;default:return Error(`Invalid option: ${Y}. Use: on, off, or edit (or no argument for edit)`)}}let Z=await JW();if(Z===null)return Error("No editor found, please set $EDITOR to edit permissions");let X="";try{let Y={stdin:process.stdin,stdout:process.stdout,stderr:{write:(K)=>{return X=K.toString(),!0}},exit:(K)=>{if(K!==0)throw u.error("editPermissions exited with status",K),Error(X)},settingsFile:J.settingsFilePath,resolveEditor:JW};await LC(Y);return}catch(Y){u.error("failed to open permissions editor:",Y);let K=Y instanceof Error?`: ${Y.message}`:"";return Error(`Failed to open ${Z}${K}`)}finally{process.stdout.write("\x1B[?25l")}}},new:{name:"new",description:"Start a new thread",execute:async(J,Q)=>{try{await J.startNewThread();return}catch(Z){return u.error("Failed to start new thread",Z),Error("Failed to start new thread")}},isVisible:(J)=>J.messages.length!==0},handoff:{name:"handoff",description:"Draft a new thread with relevant context from current thread: /handoff <your goal>",requiresArgs:!0,execute:async()=>{return},isVisible:(J)=>J.messages.length!==0},continue:{name:"continue",description:"Continue an existing thread",requiresArgs:!1,requiresPicker:!0,execute:async(J,Q)=>{try{if(Q&&Q.length>0){let Z=Q[0]?.trim();if(!Z)return Error("Invalid thread ID provided");return await J.switchToThread(Z),new w4(`Switched to existing thread: ${Z}`)}await J.pickAndContinueThread();return}catch(Z){return u.error("Failed to continue thread",Z),Error("Failed to continue thread")}}},queue:{name:"queue",description:"Queue a message to send when inference completes. If no inference running, sends immediately.",requiresArgs:!0,execute:async(J,Q)=>{if(!Q||Q.length===0)return Error("Queue command requires a message argument. Usage: /queue <message>");let X=[{type:"text",text:Q.join(" ").trim()}],Y=J.takeImageAttachments?.()??[];if(Y.length>0)X.push(...Y);J.worker.handle({type:"user:message-queue:enqueue",message:{content:X}})}},dequeue:{name:"dequeue",description:"Dequeue all messages and restore them to the prompt editor",execute:async(J,Q)=>{let Z=J.thread.queuedMessages??[];if(Z.length===0)return;let Y=Z.map((K)=>{return K.queuedMessage.content.filter((q)=>q.type==="text").map((q)=>q.text).join("").trim()}).filter(Boolean).join(`
|
|
@@ -6664,7 +6664,7 @@ https://www.jetbrains.com/help/idea/managing-plugins.html#install_plugin_from_di
|
|
|
6664
6664
|
`),J.stdout.write(`Thread: ${H}
|
|
6665
6665
|
`),J.stdout.write(`Continue this thread with: amp threads continue ${W}
|
|
6666
6666
|
`)}}function Fu1(J){return J==="smart"?I1.rgb(3,197,97):J==="free"?I1.rgb(0,184,255):_K9(J)}function _K9(J){let Q=0;for(let Y=0;Y<J.length;Y++){let K=J.charCodeAt(Y);Q=(Q<<5)-Q+K,Q=Q&Q}let Z=[9,10,11,12,13,14,15,208,209,210,211,212,213,214,215],X=Math.abs(Q)%Z.length;return I1.index(Z[X])}lf1();if(process.env.AMP_PWD)try{process.chdir(process.env.AMP_PWD),delete process.env.AMP_PWD}catch(J){oK.write(`Failed to change directory to ${process.env.AMP_PWD}: ${J}
|
|
6667
|
-
`)}var Bu1=Hu1.join(hc1||Hu1.join(process.env.HOME||process.cwd(),".local","state"),"amp","last-thread-id");function hK9(J){process.emitWarning=function(Q,Z,X,Y){let K=typeof Q==="string"?Q:Q.message||String(Q),G=Z||"Warning",q=!1;J.warn(K,{name:G,code:X})}}function cq(J,Q){if(J.getOptionValueSourceWithGlobals("dangerouslyAllowAll")==="cli")MZ("dangerouslyAllowAll",Q.dangerouslyAllowAll);if(J.getOptionValueSourceWithGlobals("tryGpt5")==="cli")throw new v9("The --try-gpt5 flag has been removed.",1,`GPT-5 is now available as the oracle. Read why: ${U8.blue("https://ampcode.com/news/gpt-5-oracle")}`);if(J.getOptionValueSourceWithGlobals("agentMode")==="cli")MZ("experimental.agentMode",Q.agentMode)}async function Mu1(J){try{await bK9(Hu1.dirname(Bu1),{recursive:!0}),await yK9(Bu1,J,"utf-8")}catch(Q){u.debug("Failed to save last thread ID",Q)}}async function gK9(){try{return(await Iz6(Bu1,"utf-8")).trim()}catch(J){return null}}function mK9(J,Q){return{...J,async get(Z){if(Z==="mcpServers"){let X=await J.get(Z);return LS("mcpServers",{global:X,workspace:Q})}return J.get(Z)},async keys(){let Z=await J.keys();if(!Z.includes("mcpServers"))Z.push("mcpServers");return Z},[Symbol.dispose](){J[Symbol.dispose]()}}}var jz6=[{name:"notifications",long:"notifications",type:"flag",description:(J)=>`${J?"Enable":"Disable"} sound notifications (enabled by default when not in execute mode)`},{name:"color",long:"color",type:"flag",description:(J)=>`${J?"Enable":"Disable"} color output (enabled by default if stdout and stderr are sent to a TTY)`,deprecated:!0},{name:"settingsFile",long:"settings-file",type:"option",default:process.env.AMP_SETTINGS_FILE??UZ,description:`Custom settings file path (overrides the default location ${UZ})`},{name:"logLevel",long:"log-level",type:"option",description:`Set log level (${Object.keys(u).join(", ")})`},{name:"logFile",long:"log-file",type:"option",description:`Set log file location (overrides the default location ${vy1})`},{name:"format",long:"format",type:"option",description:"output using the standard or new-ui. Options: `ui`, `new-ui`",choices:["ui","jsonl","new-ui"],hidden:!0,deprecated:!0},{name:"dangerouslyAllowAll",long:"dangerously-allow-all",type:"switch",default:!1,description:"Disable all command confirmation prompts (agent will execute all commands without asking)"},{name:"jetbrains",long:"jetbrains",type:"flag",default:DQ(),description:(J)=>J?"Enable JetBrains integration. When enabled, Amp automatically includes your open JetBrains file and text selection with every message.":"Disable JetBrains integration."},{name:"ide",long:"ide",type:"flag",default:!0,description:(J)=>J?"Enable IDE connection (default). When enabled, Amp automatically includes your open IDE's file and text selection with every message.":"Disable IDE connection."},{name:"interactive",long:"interactive",type:"flag",description:(J)=>J?"Enable interactive mode. This will enable the interactive UI.":"Disable interactive mode. This will disable the interactive UI.",hidden:!0,deprecated:!0},{name:"mcpConfig",long:"mcp-config",type:"option",description:"JSON configuration or file path for MCP servers to merge with existing settings"},{name:"tryGpt5",long:"try-gpt5",type:"switch",default:!1,description:"[DEPRECATED] Try GPT-5 as the primary agent model (see https://ampcode.com/news/gpt-5-oracle)",deprecated:!0},{name:"agentMode",long:"agent-mode",type:"option",description:"Set the experimental agent mode configuration",hidden:!0,choices:id}],$z6=(J)=>("deprecated"in J)&&J.deprecated===!0,uK9=(J)=>("hidden"in J)&&J.hidden===!0,pK9=(J)=>("default"in J),dK9=(J)=>("default"in J)?J.default:void 0;function cK9(J,Q){let Z=Q.args[0],X=Q.commands.map((K)=>K.name());if(Z&&!Z.includes(" ")&&Z.length<30&&!/[./\\]/.test(Z)){let K=X.filter((q)=>Z.includes(q)||q.includes(Z)),G="Run amp --help for a list of available commands.";if(K.length>0)G=`Did you mean: ${K.join(", ")}? Or run amp --help for all commands.`;throw new v9(pK.unknownCommand(Z),1,G)}}var Pz6=null;function ar2(){return Pz6}function wQ1(J){return{...J,getThreadEnvironment:Q51,vfs:n20({os:J.fileSystem},J.configService.config),fileChangeTrackerStorage:new C_(J.fileSystem),generateThreadTitle:qq0,deleteThread:(Q)=>J.threadHistoryService.delete(Q)}}var Vu1=$0.file(fK9.homedir()),Tz6=process.env.XDG_CONFIG_HOME?$0.file(process.env.XDG_CONFIG_HOME):y0.joinPath(Vu1,".config");async function lq(J,Q){ii1("0.0.
|
|
6667
|
+
`)}var Bu1=Hu1.join(hc1||Hu1.join(process.env.HOME||process.cwd(),".local","state"),"amp","last-thread-id");function hK9(J){process.emitWarning=function(Q,Z,X,Y){let K=typeof Q==="string"?Q:Q.message||String(Q),G=Z||"Warning",q=!1;J.warn(K,{name:G,code:X})}}function cq(J,Q){if(J.getOptionValueSourceWithGlobals("dangerouslyAllowAll")==="cli")MZ("dangerouslyAllowAll",Q.dangerouslyAllowAll);if(J.getOptionValueSourceWithGlobals("tryGpt5")==="cli")throw new v9("The --try-gpt5 flag has been removed.",1,`GPT-5 is now available as the oracle. Read why: ${U8.blue("https://ampcode.com/news/gpt-5-oracle")}`);if(J.getOptionValueSourceWithGlobals("agentMode")==="cli")MZ("experimental.agentMode",Q.agentMode)}async function Mu1(J){try{await bK9(Hu1.dirname(Bu1),{recursive:!0}),await yK9(Bu1,J,"utf-8")}catch(Q){u.debug("Failed to save last thread ID",Q)}}async function gK9(){try{return(await Iz6(Bu1,"utf-8")).trim()}catch(J){return null}}function mK9(J,Q){return{...J,async get(Z){if(Z==="mcpServers"){let X=await J.get(Z);return LS("mcpServers",{global:X,workspace:Q})}return J.get(Z)},async keys(){let Z=await J.keys();if(!Z.includes("mcpServers"))Z.push("mcpServers");return Z},[Symbol.dispose](){J[Symbol.dispose]()}}}var jz6=[{name:"notifications",long:"notifications",type:"flag",description:(J)=>`${J?"Enable":"Disable"} sound notifications (enabled by default when not in execute mode)`},{name:"color",long:"color",type:"flag",description:(J)=>`${J?"Enable":"Disable"} color output (enabled by default if stdout and stderr are sent to a TTY)`,deprecated:!0},{name:"settingsFile",long:"settings-file",type:"option",default:process.env.AMP_SETTINGS_FILE??UZ,description:`Custom settings file path (overrides the default location ${UZ})`},{name:"logLevel",long:"log-level",type:"option",description:`Set log level (${Object.keys(u).join(", ")})`},{name:"logFile",long:"log-file",type:"option",description:`Set log file location (overrides the default location ${vy1})`},{name:"format",long:"format",type:"option",description:"output using the standard or new-ui. Options: `ui`, `new-ui`",choices:["ui","jsonl","new-ui"],hidden:!0,deprecated:!0},{name:"dangerouslyAllowAll",long:"dangerously-allow-all",type:"switch",default:!1,description:"Disable all command confirmation prompts (agent will execute all commands without asking)"},{name:"jetbrains",long:"jetbrains",type:"flag",default:DQ(),description:(J)=>J?"Enable JetBrains integration. When enabled, Amp automatically includes your open JetBrains file and text selection with every message.":"Disable JetBrains integration."},{name:"ide",long:"ide",type:"flag",default:!0,description:(J)=>J?"Enable IDE connection (default). When enabled, Amp automatically includes your open IDE's file and text selection with every message.":"Disable IDE connection."},{name:"interactive",long:"interactive",type:"flag",description:(J)=>J?"Enable interactive mode. This will enable the interactive UI.":"Disable interactive mode. This will disable the interactive UI.",hidden:!0,deprecated:!0},{name:"mcpConfig",long:"mcp-config",type:"option",description:"JSON configuration or file path for MCP servers to merge with existing settings"},{name:"tryGpt5",long:"try-gpt5",type:"switch",default:!1,description:"[DEPRECATED] Try GPT-5 as the primary agent model (see https://ampcode.com/news/gpt-5-oracle)",deprecated:!0},{name:"agentMode",long:"agent-mode",type:"option",description:"Set the experimental agent mode configuration",hidden:!0,choices:id}],$z6=(J)=>("deprecated"in J)&&J.deprecated===!0,uK9=(J)=>("hidden"in J)&&J.hidden===!0,pK9=(J)=>("default"in J),dK9=(J)=>("default"in J)?J.default:void 0;function cK9(J,Q){let Z=Q.args[0],X=Q.commands.map((K)=>K.name());if(Z&&!Z.includes(" ")&&Z.length<30&&!/[./\\]/.test(Z)){let K=X.filter((q)=>Z.includes(q)||q.includes(Z)),G="Run amp --help for a list of available commands.";if(K.length>0)G=`Did you mean: ${K.join(", ")}? Or run amp --help for all commands.`;throw new v9(pK.unknownCommand(Z),1,G)}}var Pz6=null;function ar2(){return Pz6}function wQ1(J){return{...J,getThreadEnvironment:Q51,vfs:n20({os:J.fileSystem},J.configService.config),fileChangeTrackerStorage:new C_(J.fileSystem),generateThreadTitle:qq0,deleteThread:(Q)=>J.threadHistoryService.delete(Q)}}var Vu1=$0.file(fK9.homedir()),Tz6=process.env.XDG_CONFIG_HOME?$0.file(process.env.XDG_CONFIG_HOME):y0.joinPath(Vu1,".config");async function lq(J,Q){ii1("0.0.1761782504-g670405");let Z=SX1({storage:J.settings,secretStorage:J.secrets,workspaceRoots:t1.of([$0.file(process.cwd())]),defaultAmpURL:J.ampURL,homeDir:Vu1,userConfigDir:Tz6}),{initializeCLITelemetry:X}=await Promise.resolve().then(() => (LQ1(),NQ1));X(Z);let Y=await Z.getLatest();u.debug("Global configuration initialized",{settingsKeys:Object.keys(Y.settings)});let K=Tn(RO({configService:Z})),G=new Map,q=()=>G.clear(),z=$20({configService:Z,toolService:K,secretStorage:J.secrets,createOAuthProvider:async(E)=>{let I=G.get(E);if(I)return u.debug("Reusing existing OAuth provider for server",{serverName:E}),I;u.debug("Creating OAuth provider for server",{serverName:E});let T=(async()=>{let S=new W3(J.secrets),_=await S.getClientInfo(E),h=new eU1({storage:S,serverName:E,clientId:_?.clientId,clientSecret:_?.clientSecret,scopes:_?.scopes});return u.debug("OAuth provider created",{serverName:E,hasManualClientId:!!_?.clientId,willUseDCR:!_?.clientId}),h})();return G.set(E,T),T}}),U=_R0(K,$2,F11).catch((E)=>{u.warn("Toolbox registration failed, continuing anyway:",E)}),W=z.initialized.catch((E)=>{u.warn("MCP service initialization failed, continuing anyway:",E)}),F=Promise.all([W,U]).then(()=>{});if(Q.jetbrains)$O("JetBrains");else if(Q.ide&&dQ6())$O("VS Code");else if(Q.ide&&cQ6())$O("Neovim");if(J.executeMode)ai1(!0);m96(K,{configService:Z});let H,B=S7.status.pipe(b0((E)=>Boolean(E.connected&&E.authenticated)),e6()).subscribe((E)=>{if(E){if(!H)H=K.registerTool(Ss)}else H?.dispose(),H=void 0}),M;if(!J.executeMode)M=new V51(process.cwd(),{},!0);else M=new class extends V51{async start(){}async query(){return[]}getStats(){return{state:"unstarted",stats:[]}}dispose(){}};if(!await J.secrets.get("apiKey",J.ampURL)){if(o2.write(`No API key found. Starting login flow...
|
|
6668
6668
|
`),!await lK9(J))await zR(),process.exit(1)}let V=await J40({isDevelopment:!1}),N=new xV1(V),L=new AB1(V,Z,{lazy:!0}),A=Q.notifications!==void 0?Q.notifications:!J.executeMode,w=p96({playNotificationSound:async(E)=>{if(A){u96(E);let I=df1(),T=cf1();if((!I||T)&&Y.settings["notifications.system.enabled"]!==!1){if(E==="idle")process.stdout.write("\x1B]777;notify;Amp;Agent is ready\x1B\\");else if(E==="requires-user-input")process.stdout.write("\x1B]777;notify;Amp;Waiting for approval\x1B\\")}}},windowFocused:()=>Promise.resolve(!1),threadService:N,configService:Z});u.info("Starting Amp background services");let R=Gq0({threadService:N,threadHistoryService:L,configService:Z,isExtensionDevelopment:!1}),O;S7.status.subscribe((E)=>{O=E});let j={codebaseContextService:new OZ1({workspaceRoots:[$0.file(process.cwd())],getCurrentFile:()=>{if(!O?.openFile)return;try{return $0.parse(O.openFile)}catch(E){u.warn("Failed to parse current file URI",{uri:O.openFile,error:E});return}},getOpenFiles:()=>{if(!O?.visibleFiles?.length)return[];let E=O.openFile;return O.visibleFiles.filter((I)=>I!==E).map((I)=>{try{return $0.parse(I)}catch(T){return u.warn("Failed to parse visible file URI",{uri:I,error:T}),null}}).filter((I)=>I!==null)}}),configService:Z,toolService:K,mcpService:z,threadService:N,threadHistoryService:L,threadSyncService:R,threadStorage:V,secretStorage:J.secrets,settingsStorage:J.settings,fuzzyServer:M,notificationService:w,backgroundInit:F,fileSystem:Q.jetbrains||Q.ide?l20:$2};return{...j,async asyncDispose(){await j.mcpService.dispose(),q(),await j.threadService.asyncDispose(),j.configService.unsubscribe(),j.toolService.dispose(),j.fuzzyServer.dispose(),j.threadSyncService.dispose(),j.settingsStorage[Symbol.dispose](),B.unsubscribe(),H?.dispose()}}}async function lK9(J){if(!J.executeMode){if(!await Hf1("Would you like to log in to Amp? [(y)es, (n)o]: "))return o2.write(`Login cancelled. Run the command again to retry.
|
|
6669
6669
|
`),!1}return await Cz6(J)}async function Cz6(J){let Q=xK9(32).toString("hex"),Z=await Ff1(J.ampURL,Q),X=new AbortController;try{await RQ(Z,X.signal)}catch(K){u.error("Error opening browser",{error:K})}let Y=await Ff1(J.ampURL,Q,!1);o2.write(`If your browser does not open automatically, visit:
|
|
6670
6670
|
|
|
@@ -6674,13 +6674,13 @@ ${U8.blue.bold(Y)}
|
|
|
6674
6674
|
Login successful! You can now use the Amp CLI.
|
|
6675
6675
|
`),!0}catch(K){return u.error("Login failed",{error:K}),oK.write(`
|
|
6676
6676
|
Login failed: ${K instanceof Error?K.message:String(K)}
|
|
6677
|
-
`),!1}}function iK9(){let J=new ow().name("amp").description("AI-powered coding assistant").option("--visibility <visibility>","Set thread visibility (private, public, workspace, group)").configureOutput({writeErr:()=>{}});J.exitOverride((U)=>{if(U.code==="commander.help"||U.code==="commander.version"||U.exitCode===0)WR(),process.exit(0);let W=U.originalError??U;dJ6(W)}),J.option("-V, --version","output the version number",()=>{o2.write(`0.0.
|
|
6677
|
+
`),!1}}function iK9(){let J=new ow().name("amp").description("AI-powered coding assistant").option("--visibility <visibility>","Set thread visibility (private, public, workspace, group)").configureOutput({writeErr:()=>{}});J.exitOverride((U)=>{if(U.code==="commander.help"||U.code==="commander.version"||U.exitCode===0)WR(),process.exit(0);let W=U.originalError??U;dJ6(W)}),J.option("-V, --version","output the version number",()=>{o2.write(`0.0.1761782504-g670405 (released 2025-10-30T00:06:45.010Z)
|
|
6678
6678
|
`),process.exit(0)}),J.addHelpText("after",mQ6()),J.configureHelp({formatHelp:uQ6}),J.command("logout").description("Log out by removing stored API key").action(async(U,W)=>{let F=W.optsWithGlobals(),H=await RX(F);await sK9(H)}),J.command("login").description("Log in to Amp").addHelpText("after","If AMP_URL is set during login, it will be persisted to global settings for future CLI invocations, though AMP_URL will continue to take precedence.").action(async(U,W)=>{let F=W.optsWithGlobals(),H=await RX(F);await rK9(H,await Jf1(F,H.settings))});let Q=async(U,W,F)=>{SX1({storage:W.settings,secretStorage:W.secrets,workspaceRoots:t1.of([$0.file(process.cwd())]),defaultAmpURL:W.ampURL,homeDir:Vu1,userConfigDir:Tz6});let H={...W,executeMode:!1};await Du1(H,{...U,startWithPicker:!0},F)},Z=J.command("threads").alias("t").alias("thread").summary("Manage threads").description("Thread management commands. When no subcommand is provided, defaults to listing threads.").action(async(U,W)=>{let F=W.optsWithGlobals(),H=await RX(F);await Ez6(F,H,W)});Z.command("new").alias("n").summary("Create a new thread").description("Create a new thread and print its ID. The thread will be empty. You can set the visibility using the --visibility option.").option("--visibility <visibility>","Set thread visibility (private, public, workspace, group)").action(async(U,W)=>{let F=W.optsWithGlobals(),H=await RX(F);await ZG9(F,H,W)}),Z.command("continue [threadId]").alias("c").summary("Continue an existing thread").description("Continue an existing thread by resuming the conversation. By default, shows an interactive picker with the most recently used thread at the top. Use --last to continue the last thread directly without the picker.").option("--last","Continue the last thread directly without showing the picker").option("--pick","Pick a thread interactively from a list (DEPRECATED: picker is now the default)").action(async(U,W,F)=>{let H=F.optsWithGlobals(),B=await RX(H);if(W.pick)oK.write(`${U8.yellow("Warning:")} The --pick flag is deprecated. The picker is now shown by default.
|
|
6679
6679
|
`);if(W.last||U||B.executeMode)await QG9(H,B,U,F);else await Q(H,B,F)}),Z.command("fork [threadId]").alias("f").summary("Fork an existing thread").description("Create a new thread by forking an existing one. This copies the conversation history up to the current point and creates a new thread where you can explore different directions. If no thread ID is provided, the most recently used thread will be forked.").action(async(U,W,F)=>{let H=F.optsWithGlobals(),B=await RX(H);await JG9(H,B,U,F)}),Z.command("list").alias("l").alias("ls").summary("List all threads").description("List all your threads with their IDs, names, and last modified times.").action(async(U,W)=>{let F=W.optsWithGlobals(),H=await RX(F);await Ez6(F,H,W)}),Z.command("share <threadId>").summary("Share a thread").description("Change thread visibility (private, public, workspace, group) or share with Amp support for debugging. Use --visibility to change who can access the thread, or --support to share with the Amp team for troubleshooting.").alias("s").option("--visibility <visibility>","Set thread visibility (private, public, workspace, group)").option("--support","Share thread with Amp support for debugging").action(async(U,W,F)=>{let H=F.optsWithGlobals(),B=await RX(H);await eK9(H,B,U,F,W.support)}),Z.command("rename <threadId> <newName>").alias("r").summary("Rename a thread").description('Change the title of a thread. Quote names with spaces: amp threads rename T-123 "New thread name"').action(async(U,W,F,H)=>{let B=H.optsWithGlobals(),M=await RX(B);await oK9(B,M,U,W,H)}),Z.command("markdown <threadId>").alias("md").summary("Render thread as markdown").description("Render a thread as markdown. This outputs the entire conversation history in a readable markdown format.").action(async(U,W,F)=>{let H=F.optsWithGlobals(),B=await RX(H);await tK9(H,B,U,F)}),lZ6(J,async(U,W)=>{let F=await RX(W);cq(U,W);let H=await lq(F,W);return{context:F,mcpService:H.mcpService,toolService:H.toolService,configService:H.configService,cleanupTerminal:WR,asyncDispose:H.asyncDispose.bind(H)}}),wZ6(J),HZ6(J,async(U)=>{let W=await RX(U);return{settings:W.settings,secretStorage:W.secrets,getThreadDeps:async(F)=>{cq(F,U);let H=await lq(W,U);return{mcpService:H.mcpService,asyncDispose:H.asyncDispose.bind(H)}}}}),J.command("connect").description("Connect CLI to web interface for multi-thread management").action(async(U,W)=>{let F=W.optsWithGlobals(),H=await RX(F);cq(W,F);let B=await lq(H,F);try{await my1(B,B.configService,{})}finally{await B.asyncDispose(),await WR()}});function X(U,W,F){let B=typeof U.description==="string"?U.description:F===void 0?U.description(!0):U.description(F),M=new mV(W,B),V=dK9(U);if(V)M.default(V);if(M.hidden=uK9(U)||$z6(U),"choices"in U)M.choices([...U.choices]);return M}for(let U of jz6)switch(U.type){case"flag":{J.addOption(X(U,`--${U.long}`)),J.addOption(X(U,`--no-${U.long}`,!1));break}case"switch":{J.addOption(X(U,`--${U.long}`,!0));break}default:{J.addOption(X(U,`--${U.long} <value>`));break}}let Y=new mV("-x, --execute [message]","Use execute mode, optionally with user message. In execute mode, agent will execute provided prompt (either as argument, or via stdin). Only last assistant message is printed. Enabled automatically when redirecting stdout.").default(!1);J.addOption(Y);let K=new mV("-r, --remote","When used with -x/--execute, execute in an async agent on the Amp server.").default(!1).hideHelp();J.addOption(K);let G=new mV("--stream-json","When used with --execute, output in Claude Code compatible stream JSON format instead of plain text.").default(!1);J.addOption(G);let q=new mV("--stream-json-input","Read JSON Lines user messages from stdin. Requires both --execute and --stream-json.").default(!1);J.addOption(q);let z=new mV("--stats","When used with --execute, output JSON with both result and token usage data (for /evals).").default(!1).hideHelp(!0);if(J.addOption(z),process.env.AMP_CONNECT==="1"){let U=new mV("--client-id <clientId>","Override the client ID for connect functionality (default: amp-<pid>@<hostname>)");J.addOption(U)}return J.action(async(U,W)=>{let F=U,H=await RX(F);if(Object.keys(F).forEach((B)=>{let M=jz6.find((V)=>V.name===B);if(M&&$z6(M)&&!pK9(M))oK.write(U8.yellow(`Warning: '--${B}' flag is deprecated
|
|
6680
6680
|
`))}),W.args.length>0)cK9(H,W);await Du1(H,F,W)}),KZ6(J),J}async function AQ1(J,Q){let{thread:Z,visibility:X}=Q,Y=Z?.id??Yz(),K=wQ1(J);if(Z)await J.threadStorage.set(Y,Z);let G=await HJ.getOrCreateForThread(K,Y);if(X)await J.threadSyncService.updateThreadMeta(Y,T51(X));let q=J.threadService.observe(Y).subscribe(async(z)=>{if(s7(z,"assistant"))await Mu1(Y),q.unsubscribe()});return await G.resume(),G}async function Du1(J,Q,Z){let X=P51(Q);if(X instanceof Error)sK(X.message);let Y,K=null;if(Q.streamJsonInput)Y="";else if(typeof Q.execute==="string"){Y=Q.execute;let O=(await Df1()).trimEnd();if(O)K=O}else Y=(await Df1()).trimEnd();if(Q.remote&&!J.executeMode)throw new v9("The -r/--remote flag currently only works with --execute mode",1,'Use: amp --remote --execute "your message"');if(Q.streamJson&&!J.executeMode)throw new v9("The --stream-json flag requires --execute mode",1,'Use: amp --execute "your message" --stream-json');if(Q.streamJsonInput&&!J.executeMode)throw new v9("The --stream-json-input flag requires --execute mode",1,"Use: amp --execute --stream-json --stream-json-input");if(Q.streamJsonInput&&!Q.streamJson)throw new v9("The --stream-json-input flag requires --stream-json",1,"Use: amp --execute --stream-json --stream-json-input");if((J.executeMode||Q.streamJson)&&Q.agentMode&&Q.agentMode!=="smart")throw new v9(`Execute mode is not permitted with --agent-mode '${Q.agentMode}'`,1);if(Q.stats&&!J.executeMode)throw new v9("The --stats flag requires --execute mode",1,'Use: amp --execute "your message" --stats');if(Q.streamJsonInput&&typeof Q.execute==="string"&&Q.execute.trim()!=="")throw new v9("Do not provide a message argument when using --stream-json-input",1,`Supply messages via stdin JSONL instead: echo '{"type":"user","message":{"role":"user","content":[{"type":"text","text":"your message"}]}}' | amp --execute --stream-json --stream-json-input`);if(J.executeMode&&Y===""&&!Q.streamJsonInput)throw new v9("User message must be provided through stdin or as argument when using execute mode",1,`Either pass a message as an argument: amp --execute "your message"
|
|
6681
6681
|
Or pipe via stdin: echo "your message" | amp --execute`);cq(Z,Q);let G=await lq(J,Q);if(J.executeMode||Q.threadId)await G.backgroundInit;Pz6=G;let q=wQ1(G),z=async(O)=>{let $=await Iz6(O,"utf-8"),j=JSON.parse($);if(!zG(j.id))throw new v9(pK.invalidThreadId);return AQ1(G,{visibility:X,thread:j})},U=async(O)=>{if(!zG(O))throw new v9(pK.invalidThreadId);let $=await G.threadService.get(O)??void 0;if(u.info(`[fetchAndStartThread] Loaded thread ${O}, agentMode: ${$?.agentMode??"undefined"}`),$?.agentMode)u.info(`[fetchAndStartThread] Setting runtime override for agentMode to: ${$.agentMode}`),MZ("experimental.agentMode",$.agentMode);else u.info("[fetchAndStartThread] No agentMode on thread, not setting override");return AQ1(G,{visibility:X,thread:$})},W=async()=>{try{if(Q.threadId)return U(Q.threadId);else return AQ1(G,{visibility:X})}catch(O){if(O instanceof v9)throw O;throw await q51(O,Q.threadId),Error("handleError should have called process.exit()")}},F=async()=>{return AQ1(G,{visibility:X})};if(Q.format==="jsonl")oK.write(`jsonl format is deprecated. Version "0.0.1752148945-gd8844f" or earlier is required to use jsonl format.
|
|
6682
|
-
`),await zR(),process.exit(1);if(J.executeMode&&Q.remote)await RZ6(Y,K,G.configService),await G.asyncDispose(),process.exit(0);let H=await W();if(J.executeMode)await ZQ6(H,H.threadID,Y,K,G,!!Q.streamJson,!!Q.streamJsonInput,!!Q.stats,J.ampURL),await G.asyncDispose(),process.exit(0);let B=!1,M=!1;if(Q.jetbrains||Q.ide){await Gr1();let O=await uO({jetbrainsOnly:Q.jetbrains});if(O.length===0){if(Q.jetbrains)M=!await G.configService.get("jetbrains.skipInstall")}else if(O.length===1){let $=O[0];if($)S7.selectConfig($)}else B=!0}let V=Wf1("0.0.
|
|
6683
|
-
`);let Q=!!J.execute||!process.stdout.isTTY&&!J.streamJson,Z=process.stdout.isTTY&&process.stderr.isTTY,X=await $Q6({...J,getHook:process.env.AMP_URL?(G,q)=>{if(G==="url")return Promise.resolve(process.env.AMP_URL);return q()}:void 0});if(J.mcpConfig){let G=await BZ6(J.mcpConfig);X=mK9(X,G)}let Y=await X.get("url","global");if(!Y)Y=VZ;if(!LB(Y))u.info("Targeting custom Amp server",{ampURL:Y});if(X=Wl1(X),await X.get("debug.httpLogging"))Ql1();return{executeMode:Q,isTTY:Z,ampURL:Y,settings:X,secrets:OZ6(await Jf1(J,X))}}function aK9(J){let Q={};for(let Z=0;Z<J.length;Z++){let X=J[Z];if(X?.startsWith("--")){let K=X.slice(2).replace(/-([a-z])/g,(q,z)=>z.toUpperCase()),G=J[Z+1];if(G&&!G.startsWith("--"))Q[K]=G,Z++}}return Q}async function nK9(){let J=aK9(process.argv);if(IJ6({logLevel:J.logLevel||process.env.AMP_LOG_LEVEL,logFile:J.logFile||process.env.AMP_LOG_FILE}),hK9(u),u.info("Starting Amp CLI.",{version:"0.0.
|
|
6682
|
+
`),await zR(),process.exit(1);if(J.executeMode&&Q.remote)await RZ6(Y,K,G.configService),await G.asyncDispose(),process.exit(0);let H=await W();if(J.executeMode)await ZQ6(H,H.threadID,Y,K,G,!!Q.streamJson,!!Q.streamJsonInput,!!Q.stats,J.ampURL),await G.asyncDispose(),process.exit(0);let B=!1,M=!1;if(Q.jetbrains||Q.ide){await Gr1();let O=await uO({jetbrainsOnly:Q.jetbrains});if(O.length===0){if(Q.jetbrains)M=!await G.configService.get("jetbrains.skipInstall")}else if(O.length===1){let $=O[0];if($)S7.selectConfig($)}else B=!0}let V=Wf1("0.0.1761782504-g670405",G.settingsStorage),N=new LB1(G.threadStorage),L=t1.of([$0.file(process.cwd())]),A=XS(void 0,L);if(Y)H.handle({type:"user:message",message:{content:[{type:"text",text:Y}]}});let w;try{w=await KJ.getUserFreeTierStatus({},{config:G.configService,signal:AbortSignal.timeout(5000)})}catch(O){w={ok:!1,error:O}}u.info("User free tier status:",w);let R=await EZ6();u.info("Loaded session state:",R),await Oz6({codebaseContextService:G.codebaseContextService,stdout:process.stdout,history:new ly1,fuzzyServer:G.fuzzyServer,settingsStorage:G.settingsStorage,threadService:G.threadService,threadSyncService:G.threadSyncService,threadID:H.threadID,threadFuzzyIndexer:N,worker:H,workerDeps:q,configService:G.configService,internalAPIClient:KJ,ampURL:J.ampURL,startNewThread:F,pickAndContinueThread:async()=>{u.info("Thread picker requested - not yet implemented in TUI")},switchToThread:U,ideClient:S7,connectedClientsService:new _X1,commandRegistry:A,showJetBrainsInstaller:M,showIdePicker:B,startWithPicker:Q.startWithPicker,updateService:V,inspector:Q.inspector,inspectorPort:Q.inspectorPort,jetbrainsMode:Q.jetbrains,clientId:Q.clientId,sessionState:R,freeTierStatus:w.ok?w.result:void 0,threadDependencies:G}),await G.asyncDispose(),process.exit(0)}async function RX(J){if(J.interactive)oK.write(`Warning: --interactive flag is deprecated. Interactive mode is now the default unless --execute is used or output is redirected.
|
|
6683
|
+
`);let Q=!!J.execute||!process.stdout.isTTY&&!J.streamJson,Z=process.stdout.isTTY&&process.stderr.isTTY,X=await $Q6({...J,getHook:process.env.AMP_URL?(G,q)=>{if(G==="url")return Promise.resolve(process.env.AMP_URL);return q()}:void 0});if(J.mcpConfig){let G=await BZ6(J.mcpConfig);X=mK9(X,G)}let Y=await X.get("url","global");if(!Y)Y=VZ;if(!LB(Y))u.info("Targeting custom Amp server",{ampURL:Y});if(X=Wl1(X),await X.get("debug.httpLogging"))Ql1();return{executeMode:Q,isTTY:Z,ampURL:Y,settings:X,secrets:OZ6(await Jf1(J,X))}}function aK9(J){let Q={};for(let Z=0;Z<J.length;Z++){let X=J[Z];if(X?.startsWith("--")){let K=X.slice(2).replace(/-([a-z])/g,(q,z)=>z.toUpperCase()),G=J[Z+1];if(G&&!G.startsWith("--"))Q[K]=G,Z++}}return Q}async function nK9(){let J=aK9(process.argv);if(IJ6({logLevel:J.logLevel||process.env.AMP_LOG_LEVEL,logFile:J.logFile||process.env.AMP_LOG_FILE}),hK9(u),u.info("Starting Amp CLI.",{version:"0.0.1761782504-g670405",buildTimestamp:"2025-10-30T00:06:45.010Z"}),parseInt(process.version.slice(1).split(".")[0]??"")<20)throw new v9(pK.nodeVersion(process.version),1,"Please upgrade your Node.js installation from https://nodejs.org");await iK9().parseAsync(process.argv)}nK9().catch(q51);async function rK9(J,Q){if(process.env.AMP_URL)await J.settings.set("url",process.env.AMP_URL,"global"),o2.write(`Saving custom server URL to settings: ${process.env.AMP_URL}
|
|
6684
6684
|
`);else if(!LB(J.ampURL))o2.write(`Logging in to ${new URL(J.ampURL).hostname}
|
|
6685
6685
|
`);let Z=process.env.AMP_API_KEY;if(Z)o2.write(`API key found in environment variable, storing...
|
|
6686
6686
|
`),await Q.set("apiKey",Z,J.ampURL),o2.write(`API key successfully stored.
|