@augmentcode/auggie 1.2.0-prerelease.202611031510 → 1.2.0-prerelease.202611040910
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/auggie-v2.mjs +2 -2
- package/package.json +1 -1
package/auggie-v2.mjs
CHANGED
|
@@ -292,7 +292,7 @@ ${s}${a}`;throw new Error(l)}function Aus(e){let t=e.instancePath?e.instancePath
|
|
|
292
292
|
|
|
293
293
|
Re-emit the call with a corrected arguments object.`:`
|
|
294
294
|
|
|
295
|
-
Offending fields: ${e.join(", ")}. Re-emit the call with corrected values for those fields only.`}function _us(e,t){if(t.params?.missingProperty!==void 0||t.params?.additionalProperty!==void 0||!t.instancePath)return"";let n=Sus(e,t.instancePath);if(n===void 0)return"";if(typeof n=="string")return` (current value: ${n.length>vRe?JSON.stringify(`${n.slice(0,vRe)}\u2026`):JSON.stringify(n)})`;let r;try{r=JSON.stringify(n)}catch{return""}return r===void 0?"":` (current value: ${r.length>vRe?`${r.slice(0,vRe)}\u2026`:r})`}function Sus(e,t){if(t===""||t==="/")return e;let n=t.split("/").slice(1),r=e;for(let i of n){let s=i.replace(/~1/g,"/").replace(/~0/g,"~");if(r==null)return;if(Array.isArray(r)){let o=Number(s);if(!Number.isInteger(o)||o<0)return;r=r[o];continue}if(typeof r!="object")return;r=r[s]}return r}var cft,uft,dft,pus,mus,_Rn,fus,SRn,hus,gus,xRe,pft,vRe,CRn=C(()=>{"use strict";cft=_n(qH(),1),uft=_n(lRn(),1),dft=_n(lft(),1),pus=cft.default.default||cft.default,mus=uft.default.default||uft.default,_Rn=dft.default.default||dft.default,fus=typeof globalThis<"u"&&globalThis.chrome?.runtime?.id!==void 0;SRn={allErrors:!0,strict:!1,coerceTypes:!0},hus=/^https?:\/\/json-schema\.org\/draft-07\/schema#?$/,gus=/^https?:\/\/json-schema\.org\/draft\/2020-12\/schema#?$/;xRe=null,pft=null;if(xRn())try{let e=new pus(SRn);_Rn(e);let t=new mus(SRn);_Rn(t),vRn(e,"http://json-schema.org/draft-07/schema#","https://json-schema.org/draft-07/schema"),vRn(t,"https://json-schema.org/draft/2020-12/schema","http://json-schema.org/draft/2020-12/schema"),xRe=e,pft=t}catch{console.warn("AJV validation disabled due to CSP restrictions")}vRe=200});var t4={};li(t4,{AssistantMessageEventStream:()=>VN,EventStream:()=>zP,LEGACY_THINKING_LEVELS:()=>Rwe,StringEnum:()=>Vwe,Type:()=>te,appendAssistantMessageDiagnostic:()=>xdt,calculateCost:()=>Vts,calculateDetailedContextUsedTokens:()=>BT,cleanupSessionResources:()=>Fns,clearApiProviders:()=>bdt,complete:()=>Gdt,completeSimple:()=>nb,createAssistantMessageDiagnostic:()=>jts,createAssistantMessageEventStream:()=>Jts,createAugmentTransportErrorDiagnostic:()=>Tdt,discoverAugmentModels:()=>W3,extractDiagnosticError:()=>vCn,findAugmentTransportErrorContext:()=>Tv,findEnvKeys:()=>gCn,formatThrownValue:()=>SCn,formatUnsupportedReasoningEffort:()=>nm,getApiProvider:()=>V3,getApiProviders:()=>Nts,getEnvApiKey:()=>DT,getModel:()=>Uts,getModels:()=>Joe,getOrCreateAugmentClient:()=>rl,getOverflowPatterns:()=>Zns,getProviders:()=>qoe,isContextOverflow:()=>WN,isContextOverflowErrorText:()=>PH,isDetailedContextUsage:()=>vA,isLegacyThinkingLevel:()=>xA,isModelUnavailableErrorText:()=>nae,modelsAreEqual:()=>sa,normalizeReasoningEfforts:()=>Owe,parseAugmentTransportErrorDiagnostic:()=>CCn,parseJsonWithRepair:()=>aTn,parseStreamingJson:()=>Ydt,reasoningSelectionLabel:()=>CA,reasoningSelections:()=>tb,registerApiProvider:()=>U3,registerBuiltInApiProviders:()=>Fdt,registerSessionResourceCleanup:()=>Lns,repairJson:()=>Qdt,resetApiProviders:()=>GN,resolveReasoningCapabilities:()=>Xu,resolveReasoningSelection:()=>Ls,sanitizeAugmentTransportErrorContext:()=>eae,stream:()=>rTn,streamAugment:()=>MH,streamSimple:()=>LT,streamSimpleAugment:()=>eTn,supportsXhigh:()=>ACn,toProviderStopReason:()=>Sdt,unregisterApiProviders:()=>kts,validateToolArguments:()=>CRe,validateToolCall:()=>yus});var Bi=C(()=>{"use strict";cs();Twe();_dt();vdt();Ldt();Udt();tTn();iTn();Nwe();Idt();Dwe();lTn();uTn();dTn();CRn()});var oD,mft=C(()=>{oD={name:"@augmentcode/auggie-v2",version:"1.2.0",description:"Auggie CLI Client by Augment Code",type:"module",piConfig:{name:"auggie",configDir:".augment"},bin:{auggie:"dist/cli.js","auggie-v2":"dist/cli.js",pi:"dist/cli.js"},main:"./dist/index.js",types:"./dist/index.d.ts",exports:{".":{source:"./src/index.ts",types:"./dist/index.d.ts",import:"./dist/index.js"},"./hooks":{types:"./dist/core/hooks/index.d.ts",import:"./dist/core/hooks/index.js"}},files:["dist","docs","examples","CHANGELOG.md"],scripts:{"check-types":"pnpm run bake:export-html && tsgo -p tsconfig.build.json",clean:"shx rm -rf dist",banners:"tsx --conditions=source scripts/print-banners.ts","cli:source":"tsx --conditions=source src/cli.ts",dev:"pnpm run bake:export-html && pnpm run cli:source","dev:debug":"pnpm run bake:export-html && node --conditions=source --inspect-wait=ws://localhost:6499/57uz7t2uyri --import tsx src/cli.ts","bake:export-html":"node scripts/bake-export-html.mjs",build:"pnpm run bake:export-html && tsgo -p tsconfig.build.json --noCheck && shx chmod +x dist/cli.js && shx cp src/runtime/register-extensions.js dist/runtime/register-extensions.js && shx cp src/runtime/cloud-bridge.js dist/runtime/cloud-bridge.js && shx cp src/runtime/cloud-tracer-bridge.js dist/runtime/cloud-tracer-bridge.js && shx cp src/runtime/cloud-error-bridge.js dist/runtime/cloud-error-bridge.js && shx cp src/runtime/mcp-error-bridge.js dist/runtime/mcp-error-bridge.js && pnpm run copy-assets","build:npm:release":"node scripts/build-npm-release.mjs","build:migration-engine":"node scripts/build-migration-engine.mjs","build:release:sea":"node scripts/build-sea-release.mjs","build:release:sea:from-onison":"node scripts/build-sea-from-onison.mjs","build:release-js":"pnpm run bake:export-html && tsgo -p tsconfig.release.json --noCheck && shx chmod +x dist/cli.js && shx cp src/runtime/register-extensions.js dist/runtime/register-extensions.js && shx cp src/runtime/cloud-bridge.js dist/runtime/cloud-bridge.js && shx cp src/runtime/cloud-tracer-bridge.js dist/runtime/cloud-tracer-bridge.js && shx cp src/runtime/cloud-error-bridge.js dist/runtime/cloud-error-bridge.js && shx cp src/runtime/mcp-error-bridge.js dist/runtime/mcp-error-bridge.js && pnpm run copy-assets","build:npm":"pnpm run build:npm:release","clean:npm-artifacts":"find dist -name '*.js' -not -path 'dist/cli.js' -not -path 'dist/index.js' -not -path 'dist/release/*' -not -path 'dist/core/export-html/*' -delete && find dist -name '*.js.map' -delete","copy-assets":"shx mkdir -p dist/modes/interactive/theme && shx cp src/modes/interactive/theme/*.json dist/modes/interactive/theme/",test:"pnpm run bake:export-html && vitest --run","test:acp:e2e":"pnpm run bake:export-html && vitest --run --config vitest.e2e.config.ts e2e-test/acp/","test:e2e:sanity":"pnpm run bake:export-html && vitest --run --config vitest.e2e.config.ts e2e-test/tui/sanity.test.ts","test:e2e:tui":"pnpm run bake:export-html && vitest --run --no-file-parallelism --config vitest.e2e.config.ts e2e-test/tui/","test:e2e:cli":"pnpm run bake:export-html && vitest --run --no-file-parallelism --config vitest.e2e.config.ts e2e-test/cli/",prepublishOnly:"pnpm run clean && pnpm run build"},dependencies:{"@agentclientprotocol/sdk":"1.4.0","@augmentcode/api-client":"workspace:*","@earendil-works/pi-agent-core":"workspace:*","@earendil-works/pi-ai":"workspace:*","@earendil-works/pi-indexing":"workspace:*","@earendil-works/pi-tui":"workspace:*","@hermes/ask-user":"workspace:*","@hermes/augment-legacy-tools":"workspace:*","@hermes/cloud":"workspace:*","@hermes/context-usage":"workspace:*","@hermes/import-sessions":"workspace:*","@hermes/cosmos":"workspace:*","@hermes/daemon":"workspace:*","@hermes/git-credentials":"workspace:*","@hermes/hashline-edit":"workspace:*","@hermes/hooks":"workspace:*","@hermes/logger":"workspace:*","@hermes/lsp":"workspace:*","@hermes/mcp":"workspace:*","@hermes/migration":"workspace:*","@hermes/open-browser":"workspace:*","@hermes/otel":"workspace:*","@hermes/path-utils":"workspace:*","@hermes/plugins":"workspace:*","@hermes/prompt-enhancer":"workspace:*","@hermes/segment-analytics":"workspace:*","@hermes/sentry":"workspace:*","@hermes/settings":"workspace:*","@hermes/shared-types":"workspace:*","@hermes/subagents":"workspace:*","@hermes/tool-permissions":"workspace:*","@mariozechner/jiti":"^2.6.2","@sentry/node":"^10.53.1","@silvia-odwyer/photon-node":"^0.3.4","@sinclair/typebox":"^0.34.41",ajv:"^8.17.1",chalk:"^5.5.0","cli-highlight":"^2.1.11",diff:"^8.0.2","extract-zip":"^2.0.1",fdir:"^6.5.0","file-type":"^21.1.1",glob:"^13.0.1","hosted-git-info":"^9.0.2",ignore:"^7.0.5",jimp:"^1.6.1","jsonc-parser":"3.3.1",marked:"^15.0.12",minimatch:"^10.2.3","proper-lockfile":"^4.1.2","strip-ansi":"^7.1.0",turndown:"^7.2.4",undici:"^7.19.1",yaml:"^2.8.2",zod:"^4.4.3"},overrides:{rimraf:"6.1.2",gaxios:{rimraf:"6.1.2"}},optionalDependencies:{"@mariozechner/clipboard":"^0.3.2"},devDependencies:{"@tintinweb/pi-subagents":"workspace:*","@types/diff":"^7.0.2","@types/hosted-git-info":"^3.0.5","@types/ms":"^2.1.0","@types/node":"^24.3.0","@types/proper-lockfile":"^4.1.4","@types/turndown":"^5.0.5",level:"^10.0.0",shx:"^0.4.0",tsx:"^4.21.0",typescript:"^5.7.3",vitest:"^3.2.4"},keywords:["coding-agent","ai","llm","cli","tui","agent"],author:"Mario Zechner",license:"MIT",repository:{type:"git",url:"git+https://github.com/badlogic/pi-mono.git",directory:"packages/coding-agent"},engines:{node:">=20.6.0"}}});import{existsSync as xus}from"node:fs";import{homedir as Pae}from"node:os";import{dirname as fft,join as Ov,resolve as IRn}from"node:path";import{fileURLToPath as Cus}from"node:url";function wRn(){let e=process.env.PI_PACKAGE_DIR;if(e)return e==="~"?Pae():e.startsWith("~/")?Pae()+e.slice(1):e;let t=TRn;for(;t!==fft(t);){if(xus(Ov(t,"package.json")))return t;t=fft(t)}return TRn}function TRe(){return IRn(Ov(wRn(),"docs"))}function IRe(){return IRn(Ov(wRn(),"CHANGELOG.md"))}function ORn(e){return e==="~"?Pae():e.startsWith("~/")?Pae()+e.slice(1):e}function $T(){let e=process.env.AUGMENT_CACHE_DIR;return e?ORn(e):Ov(Pae(),".augment")}function Dr(){let e=process.env[hft];return e?ORn(e):$T()}function Lae(){return Ov(Dr(),"themes")}function MRn(){return Ov(Dr(),"models.json")}function PRn(){return Ov(Dr(),"auth.json")}function DRn(){return Ov(Dr(),"settings.json")}function TA(){return $T()}function rZ(){return Ov(Dr(),"bin")}function BRn(){return Ov(Dr(),Dae)}function LRn(){return Ov(Dr(),`${Jr}-debug.log`)}var Tus,TRn,Jr,Ns,Dae,Bae,RRn,Ius,hs,NRn,kRn,hft,Fs=C(()=>{"use strict";mft();Tus=Cus(import.meta.url),TRn=fft(Tus);Jr=oD.piConfig?.name||"auggie",Ns=oD.piConfig?.configDir||".augment",Dae="sessions-v2",Bae=Jr,RRn="Auggie Coding Agent",Ius="1.2.0-prerelease.202611031510",hs=Ius??oD.version,NRn="2c02c0c37a9ce983fd62e407026f441855626f94",kRn="2026-11-03T23:10:38Z",hft=`${Jr.toUpperCase()}_CODING_AGENT_DIR`});function gft(...e){return new globalThis.Function(...e)}var FRn=C(()=>{});var wRe,RRe,bft,URn=C(()=>{qM();dY();Fr();Vc();wRe=class extends vi{constructor(t){super(`Duplicate type kind '${t}' detected`)}},RRe=class extends vi{constructor(t){super(`Duplicate string format '${t}' detected`)}};(function(e){function t(r,i){if(wp.Has(r))throw new wRe(r);return wp.Set(r,i),(s={})=>hP({...s,[on]:r})}e.Type=t;function n(r,i){if(Yh.Has(r))throw new RRe(r);return Yh.Set(r,i),r}e.Format=n})(bft||(bft={}))});var n4={};li(n4,{Evaluate:()=>gft,TypeSystem:()=>bft,TypeSystemDuplicateFormat:()=>RRe,TypeSystemDuplicateTypeKind:()=>wRe,TypeSystemPolicy:()=>mc});var iZ=C(()=>{FRn();gie();URn()});function VRn(e){switch(e.errorType){case an.ArrayContains:return"Expected array to contain at least one matching value";case an.ArrayMaxContains:return`Expected array to contain no more than ${e.schema.maxContains} matching values`;case an.ArrayMinContains:return`Expected array to contain at least ${e.schema.minContains} matching values`;case an.ArrayMaxItems:return`Expected array length to be less or equal to ${e.schema.maxItems}`;case an.ArrayMinItems:return`Expected array length to be greater or equal to ${e.schema.minItems}`;case an.ArrayUniqueItems:return"Expected array elements to be unique";case an.Array:return"Expected array";case an.AsyncIterator:return"Expected AsyncIterator";case an.BigIntExclusiveMaximum:return`Expected bigint to be less than ${e.schema.exclusiveMaximum}`;case an.BigIntExclusiveMinimum:return`Expected bigint to be greater than ${e.schema.exclusiveMinimum}`;case an.BigIntMaximum:return`Expected bigint to be less or equal to ${e.schema.maximum}`;case an.BigIntMinimum:return`Expected bigint to be greater or equal to ${e.schema.minimum}`;case an.BigIntMultipleOf:return`Expected bigint to be a multiple of ${e.schema.multipleOf}`;case an.BigInt:return"Expected bigint";case an.Boolean:return"Expected boolean";case an.DateExclusiveMinimumTimestamp:return`Expected Date timestamp to be greater than ${e.schema.exclusiveMinimumTimestamp}`;case an.DateExclusiveMaximumTimestamp:return`Expected Date timestamp to be less than ${e.schema.exclusiveMaximumTimestamp}`;case an.DateMinimumTimestamp:return`Expected Date timestamp to be greater or equal to ${e.schema.minimumTimestamp}`;case an.DateMaximumTimestamp:return`Expected Date timestamp to be less or equal to ${e.schema.maximumTimestamp}`;case an.DateMultipleOfTimestamp:return`Expected Date timestamp to be a multiple of ${e.schema.multipleOfTimestamp}`;case an.Date:return"Expected Date";case an.Function:return"Expected function";case an.IntegerExclusiveMaximum:return`Expected integer to be less than ${e.schema.exclusiveMaximum}`;case an.IntegerExclusiveMinimum:return`Expected integer to be greater than ${e.schema.exclusiveMinimum}`;case an.IntegerMaximum:return`Expected integer to be less or equal to ${e.schema.maximum}`;case an.IntegerMinimum:return`Expected integer to be greater or equal to ${e.schema.minimum}`;case an.IntegerMultipleOf:return`Expected integer to be a multiple of ${e.schema.multipleOf}`;case an.Integer:return"Expected integer";case an.IntersectUnevaluatedProperties:return"Unexpected property";case an.Intersect:return"Expected all values to match";case an.Iterator:return"Expected Iterator";case an.Literal:return`Expected ${typeof e.schema.const=="string"?`'${e.schema.const}'`:e.schema.const}`;case an.Never:return"Never";case an.Not:return"Value should not match";case an.Null:return"Expected null";case an.NumberExclusiveMaximum:return`Expected number to be less than ${e.schema.exclusiveMaximum}`;case an.NumberExclusiveMinimum:return`Expected number to be greater than ${e.schema.exclusiveMinimum}`;case an.NumberMaximum:return`Expected number to be less or equal to ${e.schema.maximum}`;case an.NumberMinimum:return`Expected number to be greater or equal to ${e.schema.minimum}`;case an.NumberMultipleOf:return`Expected number to be a multiple of ${e.schema.multipleOf}`;case an.Number:return"Expected number";case an.Object:return"Expected object";case an.ObjectAdditionalProperties:return"Unexpected property";case an.ObjectMaxProperties:return`Expected object to have no more than ${e.schema.maxProperties} properties`;case an.ObjectMinProperties:return`Expected object to have at least ${e.schema.minProperties} properties`;case an.ObjectRequiredProperty:return"Expected required property";case an.Promise:return"Expected Promise";case an.RegExp:return"Expected string to match regular expression";case an.StringFormatUnknown:return`Unknown format '${e.schema.format}'`;case an.StringFormat:return`Expected string to match '${e.schema.format}' format`;case an.StringMaxLength:return`Expected string length less or equal to ${e.schema.maxLength}`;case an.StringMinLength:return`Expected string length greater or equal to ${e.schema.minLength}`;case an.StringPattern:return`Expected string to match '${e.schema.pattern}'`;case an.String:return"Expected string";case an.Symbol:return"Expected symbol";case an.TupleLength:return`Expected tuple to have ${e.schema.maxItems||0} elements`;case an.Tuple:return"Expected tuple";case an.Uint8ArrayMaxByteLength:return`Expected byte length less or equal to ${e.schema.maxByteLength}`;case an.Uint8ArrayMinByteLength:return`Expected byte length greater or equal to ${e.schema.minByteLength}`;case an.Uint8Array:return"Expected Uint8Array";case an.Undefined:return"Expected undefined";case an.Union:return"Expected union value";case an.Void:return"Expected void";case an.Kind:return`Expected kind '${e.schema[on]}'`;default:return"Unknown error type"}}function wus(e){GRn=e}function yft(){return GRn}var GRn,Aft=C(()=>{Fr();Eft();GRn=VRn});function Rus(e,t){let n=t.find(r=>r.$id===e.$ref);if(n===void 0)throw new _ft(e);return aa(n,t)}function Gm(e,t){return!Lo(e.$id)||t.some(n=>n.$id===e.$id)||t.push(e),t}function aa(e,t){return e[on]==="This"||e[on]==="Ref"?Rus(e,t):e}var _ft,WRn=C(()=>{Vc();Fr();Hve();_ft=class extends vi{constructor(t){super(`Unable to dereference schema with $id '${t.$ref}'`),this.schema=t}}});var rS=C(()=>{WRn()});function*Mus(e){let t=e===0?1:Math.ceil(Math.floor(Math.log2(e)+1)/8);for(let n=0;n<t;n++)yield e>>8*(t-1-n)&255}function Pus(e){ng(IA.Array);for(let t of e)oZ(t)}function Dus(e){ng(IA.Boolean),ng(e?1:0)}function Bus(e){ng(IA.BigInt),QRn.setBigInt64(0,e);for(let t of YRn)ng(t)}function Lus(e){ng(IA.Date),oZ(e.getTime())}function Fus(e){ng(IA.Null)}function Uus(e){ng(IA.Number),QRn.setFloat64(0,e);for(let t of YRn)ng(t)}function Vus(e){ng(IA.Object);for(let t of globalThis.Object.getOwnPropertyNames(e).sort())oZ(t),oZ(e[t])}function Gus(e){ng(IA.String);for(let t=0;t<e.length;t++)for(let n of Mus(e.charCodeAt(t)))ng(n)}function Wus(e){ng(IA.Symbol),oZ(e.description)}function $us(e){ng(IA.Uint8Array);for(let t=0;t<e.length;t++)ng(e[t])}function Qus(e){return ng(IA.Undefined)}function oZ(e){if(wi(e))return Pus(e);if(hv(e))return Dus(e);if(Bm(e))return Bus(e);if(Wh(e))return Lus(e);if(rT(e))return Fus(e);if(pi(e))return Uus(e);if(ps(e))return Vus(e);if(Lo(e))return Gus(e);if(sT(e))return Wus(e);if(PU(e))return $us(e);if(Nc(e))return Qus(e);throw new NRe(e)}function ng(e){sZ=sZ^Ous[e],sZ=sZ*Nus%kus}function HN(e){return sZ=BigInt("14695981039346656037"),oZ(e),sZ}var NRe,IA,sZ,Nus,kus,Ous,$Rn,QRn,YRn,HRn=C(()=>{Ip();Vc();NRe=class extends vi{constructor(t){super("Unable to hash value"),this.value=t}};(function(e){e[e.Undefined=0]="Undefined",e[e.Null=1]="Null",e[e.Boolean=2]="Boolean",e[e.Number=3]="Number",e[e.String=4]="String",e[e.Object=5]="Object",e[e.Array=6]="Array",e[e.Date=7]="Date",e[e.Uint8Array=8]="Uint8Array",e[e.Symbol=9]="Symbol",e[e.BigInt=10]="BigInt"})(IA||(IA={}));sZ=BigInt("14695981039346656037"),[Nus,kus]=[BigInt("1099511628211"),BigInt("18446744073709551616")],Ous=Array.from({length:256}).map((e,t)=>BigInt(t)),$Rn=new Float64Array(1),QRn=new DataView($Rn.buffer),YRn=new Uint8Array($Rn.buffer)});var aZ=C(()=>{HRn()});function Yus(e){return e[on]==="Any"||e[on]==="Unknown"}function Fo(e){return e!==void 0}function Hus(e,t,n){return!0}function Zus(e,t,n){return!0}function jus(e,t,n){if(!wi(n)||Fo(e.minItems)&&!(n.length>=e.minItems)||Fo(e.maxItems)&&!(n.length<=e.maxItems))return!1;for(let s of n)if(!Wm(e.items,t,s))return!1;if(e.uniqueItems===!0&&!(function(){let s=new Set;for(let o of n){let a=HN(o);if(s.has(a))return!1;s.add(a)}return!0})())return!1;if(!(Fo(e.contains)||pi(e.minContains)||pi(e.maxContains)))return!0;let r=Fo(e.contains)?e.contains:Gi(),i=n.reduce((s,o)=>Wm(r,t,o)?s+1:s,0);return!(i===0||pi(e.minContains)&&i<e.minContains||pi(e.maxContains)&&i>e.maxContains)}function zus(e,t,n){return pie(n)}function Xus(e,t,n){return!(!Bm(n)||Fo(e.exclusiveMaximum)&&!(n<e.exclusiveMaximum)||Fo(e.exclusiveMinimum)&&!(n>e.exclusiveMinimum)||Fo(e.maximum)&&!(n<=e.maximum)||Fo(e.minimum)&&!(n>=e.minimum)||Fo(e.multipleOf)&&n%e.multipleOf!==BigInt(0))}function Kus(e,t,n){return hv(n)}function qus(e,t,n){return Wm(e.returns,t,n.prototype)}function Jus(e,t,n){return!(!Wh(n)||Fo(e.exclusiveMaximumTimestamp)&&!(n.getTime()<e.exclusiveMaximumTimestamp)||Fo(e.exclusiveMinimumTimestamp)&&!(n.getTime()>e.exclusiveMinimumTimestamp)||Fo(e.maximumTimestamp)&&!(n.getTime()<=e.maximumTimestamp)||Fo(e.minimumTimestamp)&&!(n.getTime()>=e.minimumTimestamp)||Fo(e.multipleOfTimestamp)&&n.getTime()%e.multipleOfTimestamp!==0)}function eds(e,t,n){return iT(n)}function tds(e,t,n){let r=globalThis.Object.values(e.$defs),i=e.$defs[e.$ref];return Wm(i,[...t,...r],n)}function nds(e,t,n){return!(!hie(n)||Fo(e.exclusiveMaximum)&&!(n<e.exclusiveMaximum)||Fo(e.exclusiveMinimum)&&!(n>e.exclusiveMinimum)||Fo(e.maximum)&&!(n<=e.maximum)||Fo(e.minimum)&&!(n>=e.minimum)||Fo(e.multipleOf)&&n%e.multipleOf!==0)}function rds(e,t,n){let r=e.allOf.every(i=>Wm(i,t,n));if(e.unevaluatedProperties===!1){let i=new RegExp(bv(e)),s=Object.getOwnPropertyNames(n).every(o=>i.test(o));return r&&s}else if(Gc(e.unevaluatedProperties)){let i=new RegExp(bv(e)),s=Object.getOwnPropertyNames(n).every(o=>i.test(o)||Wm(e.unevaluatedProperties,t,n[o]));return r&&s}else return r}function ids(e,t,n){return mie(n)}function sds(e,t,n){return n===e.const}function ods(e,t,n){return!1}function ads(e,t,n){return!Wm(e.not,t,n)}function lds(e,t,n){return rT(n)}function cds(e,t,n){return!(!mc.IsNumberLike(n)||Fo(e.exclusiveMaximum)&&!(n<e.exclusiveMaximum)||Fo(e.exclusiveMinimum)&&!(n>e.exclusiveMinimum)||Fo(e.minimum)&&!(n>=e.minimum)||Fo(e.maximum)&&!(n<=e.maximum)||Fo(e.multipleOf)&&n%e.multipleOf!==0)}function uds(e,t,n){if(!mc.IsObjectLike(n)||Fo(e.minProperties)&&!(Object.getOwnPropertyNames(n).length>=e.minProperties)||Fo(e.maxProperties)&&!(Object.getOwnPropertyNames(n).length<=e.maxProperties))return!1;let r=Object.getOwnPropertyNames(e.properties);for(let i of r){let s=e.properties[i];if(e.required&&e.required.includes(i)){if(!Wm(s,t,n[i])||(yv(s)||Yus(s))&&!(i in n))return!1}else if(mc.IsExactOptionalProperty(n,i)&&!Wm(s,t,n[i]))return!1}if(e.additionalProperties===!1){let i=Object.getOwnPropertyNames(n);return e.required&&e.required.length===r.length&&i.length===r.length?!0:i.every(s=>r.includes(s))}else return typeof e.additionalProperties=="object"?Object.getOwnPropertyNames(n).every(s=>r.includes(s)||Wm(e.additionalProperties,t,n[s])):!0}function dds(e,t,n){return fie(n)}function pds(e,t,n){if(!mc.IsRecordLike(n)||Fo(e.minProperties)&&!(Object.getOwnPropertyNames(n).length>=e.minProperties)||Fo(e.maxProperties)&&!(Object.getOwnPropertyNames(n).length<=e.maxProperties))return!1;let[r,i]=Object.entries(e.patternProperties)[0],s=new RegExp(r),o=Object.entries(n).every(([u,c])=>s.test(u)?Wm(i,t,c):!0),a=typeof e.additionalProperties=="object"?Object.entries(n).every(([u,c])=>s.test(u)?!0:Wm(e.additionalProperties,t,c)):!0,l=e.additionalProperties===!1?Object.getOwnPropertyNames(n).every(u=>s.test(u)):!0;return o&&a&&l}function mds(e,t,n){return Wm(aa(e,t),t,n)}function fds(e,t,n){let r=new RegExp(e.source,e.flags);return Fo(e.minLength)&&!(n.length>=e.minLength)||Fo(e.maxLength)&&!(n.length<=e.maxLength)?!1:r.test(n)}function hds(e,t,n){return!Lo(n)||Fo(e.minLength)&&!(n.length>=e.minLength)||Fo(e.maxLength)&&!(n.length<=e.maxLength)||Fo(e.pattern)&&!new RegExp(e.pattern).test(n)?!1:Fo(e.format)?Yh.Has(e.format)?Yh.Get(e.format)(n):!1:!0}function gds(e,t,n){return sT(n)}function bds(e,t,n){return Lo(n)&&new RegExp(e.pattern).test(n)}function yds(e,t,n){return Wm(aa(e,t),t,n)}function Ads(e,t,n){if(!wi(n)||e.items===void 0&&n.length!==0||n.length!==e.maxItems)return!1;if(!e.items)return!0;for(let r=0;r<e.items.length;r++)if(!Wm(e.items[r],t,n[r]))return!1;return!0}function Eds(e,t,n){return Nc(n)}function _ds(e,t,n){return e.anyOf.some(r=>Wm(r,t,n))}function Sds(e,t,n){return!(!PU(n)||Fo(e.maxByteLength)&&!(n.length<=e.maxByteLength)||Fo(e.minByteLength)&&!(n.length>=e.minByteLength))}function vds(e,t,n){return!0}function xds(e,t,n){return mc.IsVoidLike(n)}function Cds(e,t,n){return wp.Has(e[on])?wp.Get(e[on])(e,n):!1}function Wm(e,t,n){let r=Fo(e.$id)?Gm(e,t):t,i=e;switch(i[on]){case"Any":return Hus(i,r,n);case"Argument":return Zus(i,r,n);case"Array":return jus(i,r,n);case"AsyncIterator":return zus(i,r,n);case"BigInt":return Xus(i,r,n);case"Boolean":return Kus(i,r,n);case"Constructor":return qus(i,r,n);case"Date":return Jus(i,r,n);case"Function":return eds(i,r,n);case"Import":return tds(i,r,n);case"Integer":return nds(i,r,n);case"Intersect":return rds(i,r,n);case"Iterator":return ids(i,r,n);case"Literal":return sds(i,r,n);case"Never":return ods(i,r,n);case"Not":return ads(i,r,n);case"Null":return lds(i,r,n);case"Number":return cds(i,r,n);case"Object":return uds(i,r,n);case"Promise":return dds(i,r,n);case"Record":return pds(i,r,n);case"Ref":return mds(i,r,n);case"RegExp":return fds(i,r,n);case"String":return hds(i,r,n);case"Symbol":return gds(i,r,n);case"TemplateLiteral":return bds(i,r,n);case"This":return yds(i,r,n);case"Tuple":return Ads(i,r,n);case"Undefined":return Eds(i,r,n);case"Union":return _ds(i,r,n);case"Uint8Array":return Sds(i,r,n);case"Unknown":return vds(i,r,n);case"Void":return xds(i,r,n);default:if(!wp.Has(i[on]))throw new kRe(i);return Cds(i,r,n)}}function Us(...e){return e.length===3?Wm(e[0],e[1],e[2]):Wm(e[0],[],e[1])}var kRe,Sft=C(()=>{iZ();rS();aZ();Fr();pA();sP();qM();Vc();fd();Ip();Ks();kRe=class extends vi{constructor(t){super("Unknown type"),this.schema=t}}});var wA=C(()=>{Sft()});function ZN(e){return e.replace(/~/g,"~0").replace(/\//g,"~1")}function Uo(e){return e!==void 0}function br(e,t,n,r,i=[]){return{type:e,schema:t,path:n,value:r,message:yft()({errorType:e,path:n,schema:t,value:r,errors:i}),errors:i}}function*Tds(e,t,n,r){}function*Ids(e,t,n,r){}function*wds(e,t,n,r){if(!wi(r))return yield br(an.Array,e,n,r);Uo(e.minItems)&&!(r.length>=e.minItems)&&(yield br(an.ArrayMinItems,e,n,r)),Uo(e.maxItems)&&!(r.length<=e.maxItems)&&(yield br(an.ArrayMaxItems,e,n,r));for(let o=0;o<r.length;o++)yield*$m(e.items,t,`${n}/${o}`,r[o]);if(e.uniqueItems===!0&&!(function(){let o=new Set;for(let a of r){let l=HN(a);if(o.has(l))return!1;o.add(l)}return!0})()&&(yield br(an.ArrayUniqueItems,e,n,r)),!(Uo(e.contains)||Uo(e.minContains)||Uo(e.maxContains)))return;let i=Uo(e.contains)?e.contains:Gi(),s=r.reduce((o,a,l)=>$m(i,t,`${n}${l}`,a).next().done===!0?o+1:o,0);s===0&&(yield br(an.ArrayContains,e,n,r)),pi(e.minContains)&&s<e.minContains&&(yield br(an.ArrayMinContains,e,n,r)),pi(e.maxContains)&&s>e.maxContains&&(yield br(an.ArrayMaxContains,e,n,r))}function*Rds(e,t,n,r){pie(r)||(yield br(an.AsyncIterator,e,n,r))}function*Nds(e,t,n,r){if(!Bm(r))return yield br(an.BigInt,e,n,r);Uo(e.exclusiveMaximum)&&!(r<e.exclusiveMaximum)&&(yield br(an.BigIntExclusiveMaximum,e,n,r)),Uo(e.exclusiveMinimum)&&!(r>e.exclusiveMinimum)&&(yield br(an.BigIntExclusiveMinimum,e,n,r)),Uo(e.maximum)&&!(r<=e.maximum)&&(yield br(an.BigIntMaximum,e,n,r)),Uo(e.minimum)&&!(r>=e.minimum)&&(yield br(an.BigIntMinimum,e,n,r)),Uo(e.multipleOf)&&r%e.multipleOf!==BigInt(0)&&(yield br(an.BigIntMultipleOf,e,n,r))}function*kds(e,t,n,r){hv(r)||(yield br(an.Boolean,e,n,r))}function*Ods(e,t,n,r){yield*$m(e.returns,t,n,r.prototype)}function*Mds(e,t,n,r){if(!Wh(r))return yield br(an.Date,e,n,r);Uo(e.exclusiveMaximumTimestamp)&&!(r.getTime()<e.exclusiveMaximumTimestamp)&&(yield br(an.DateExclusiveMaximumTimestamp,e,n,r)),Uo(e.exclusiveMinimumTimestamp)&&!(r.getTime()>e.exclusiveMinimumTimestamp)&&(yield br(an.DateExclusiveMinimumTimestamp,e,n,r)),Uo(e.maximumTimestamp)&&!(r.getTime()<=e.maximumTimestamp)&&(yield br(an.DateMaximumTimestamp,e,n,r)),Uo(e.minimumTimestamp)&&!(r.getTime()>=e.minimumTimestamp)&&(yield br(an.DateMinimumTimestamp,e,n,r)),Uo(e.multipleOfTimestamp)&&r.getTime()%e.multipleOfTimestamp!==0&&(yield br(an.DateMultipleOfTimestamp,e,n,r))}function*Pds(e,t,n,r){iT(r)||(yield br(an.Function,e,n,r))}function*Dds(e,t,n,r){let i=globalThis.Object.values(e.$defs),s=e.$defs[e.$ref];yield*$m(s,[...t,...i],n,r)}function*Bds(e,t,n,r){if(!hie(r))return yield br(an.Integer,e,n,r);Uo(e.exclusiveMaximum)&&!(r<e.exclusiveMaximum)&&(yield br(an.IntegerExclusiveMaximum,e,n,r)),Uo(e.exclusiveMinimum)&&!(r>e.exclusiveMinimum)&&(yield br(an.IntegerExclusiveMinimum,e,n,r)),Uo(e.maximum)&&!(r<=e.maximum)&&(yield br(an.IntegerMaximum,e,n,r)),Uo(e.minimum)&&!(r>=e.minimum)&&(yield br(an.IntegerMinimum,e,n,r)),Uo(e.multipleOf)&&r%e.multipleOf!==0&&(yield br(an.IntegerMultipleOf,e,n,r))}function*Lds(e,t,n,r){let i=!1;for(let s of e.allOf)for(let o of $m(s,t,n,r))i=!0,yield o;if(i)return yield br(an.Intersect,e,n,r);if(e.unevaluatedProperties===!1){let s=new RegExp(bv(e));for(let o of Object.getOwnPropertyNames(r))s.test(o)||(yield br(an.IntersectUnevaluatedProperties,e,`${n}/${o}`,r))}if(typeof e.unevaluatedProperties=="object"){let s=new RegExp(bv(e));for(let o of Object.getOwnPropertyNames(r))if(!s.test(o)){let a=$m(e.unevaluatedProperties,t,`${n}/${o}`,r[o]).next();a.done||(yield a.value)}}}function*Fds(e,t,n,r){mie(r)||(yield br(an.Iterator,e,n,r))}function*Uds(e,t,n,r){r!==e.const&&(yield br(an.Literal,e,n,r))}function*Vds(e,t,n,r){yield br(an.Never,e,n,r)}function*Gds(e,t,n,r){$m(e.not,t,n,r).next().done===!0&&(yield br(an.Not,e,n,r))}function*Wds(e,t,n,r){rT(r)||(yield br(an.Null,e,n,r))}function*$ds(e,t,n,r){if(!mc.IsNumberLike(r))return yield br(an.Number,e,n,r);Uo(e.exclusiveMaximum)&&!(r<e.exclusiveMaximum)&&(yield br(an.NumberExclusiveMaximum,e,n,r)),Uo(e.exclusiveMinimum)&&!(r>e.exclusiveMinimum)&&(yield br(an.NumberExclusiveMinimum,e,n,r)),Uo(e.maximum)&&!(r<=e.maximum)&&(yield br(an.NumberMaximum,e,n,r)),Uo(e.minimum)&&!(r>=e.minimum)&&(yield br(an.NumberMinimum,e,n,r)),Uo(e.multipleOf)&&r%e.multipleOf!==0&&(yield br(an.NumberMultipleOf,e,n,r))}function*Qds(e,t,n,r){if(!mc.IsObjectLike(r))return yield br(an.Object,e,n,r);Uo(e.minProperties)&&!(Object.getOwnPropertyNames(r).length>=e.minProperties)&&(yield br(an.ObjectMinProperties,e,n,r)),Uo(e.maxProperties)&&!(Object.getOwnPropertyNames(r).length<=e.maxProperties)&&(yield br(an.ObjectMaxProperties,e,n,r));let i=Array.isArray(e.required)?e.required:[],s=Object.getOwnPropertyNames(e.properties),o=Object.getOwnPropertyNames(r);for(let a of i)o.includes(a)||(yield br(an.ObjectRequiredProperty,e.properties[a],`${n}/${ZN(a)}`,void 0));if(e.additionalProperties===!1)for(let a of o)s.includes(a)||(yield br(an.ObjectAdditionalProperties,e,`${n}/${ZN(a)}`,r[a]));if(typeof e.additionalProperties=="object")for(let a of o)s.includes(a)||(yield*$m(e.additionalProperties,t,`${n}/${ZN(a)}`,r[a]));for(let a of s){let l=e.properties[a];e.required&&e.required.includes(a)?(yield*$m(l,t,`${n}/${ZN(a)}`,r[a]),yv(e)&&!(a in r)&&(yield br(an.ObjectRequiredProperty,l,`${n}/${ZN(a)}`,void 0))):mc.IsExactOptionalProperty(r,a)&&(yield*$m(l,t,`${n}/${ZN(a)}`,r[a]))}}function*Yds(e,t,n,r){fie(r)||(yield br(an.Promise,e,n,r))}function*Hds(e,t,n,r){if(!mc.IsRecordLike(r))return yield br(an.Object,e,n,r);Uo(e.minProperties)&&!(Object.getOwnPropertyNames(r).length>=e.minProperties)&&(yield br(an.ObjectMinProperties,e,n,r)),Uo(e.maxProperties)&&!(Object.getOwnPropertyNames(r).length<=e.maxProperties)&&(yield br(an.ObjectMaxProperties,e,n,r));let[i,s]=Object.entries(e.patternProperties)[0],o=new RegExp(i);for(let[a,l]of Object.entries(r))o.test(a)&&(yield*$m(s,t,`${n}/${ZN(a)}`,l));if(typeof e.additionalProperties=="object")for(let[a,l]of Object.entries(r))o.test(a)||(yield*$m(e.additionalProperties,t,`${n}/${ZN(a)}`,l));if(e.additionalProperties===!1){for(let[a,l]of Object.entries(r))if(!o.test(a))return yield br(an.ObjectAdditionalProperties,e,`${n}/${ZN(a)}`,l)}}function*Zds(e,t,n,r){yield*$m(aa(e,t),t,n,r)}function*jds(e,t,n,r){if(!Lo(r))return yield br(an.String,e,n,r);if(Uo(e.minLength)&&!(r.length>=e.minLength)&&(yield br(an.StringMinLength,e,n,r)),Uo(e.maxLength)&&!(r.length<=e.maxLength)&&(yield br(an.StringMaxLength,e,n,r)),!new RegExp(e.source,e.flags).test(r))return yield br(an.RegExp,e,n,r)}function*zds(e,t,n,r){if(!Lo(r))return yield br(an.String,e,n,r);Uo(e.minLength)&&!(r.length>=e.minLength)&&(yield br(an.StringMinLength,e,n,r)),Uo(e.maxLength)&&!(r.length<=e.maxLength)&&(yield br(an.StringMaxLength,e,n,r)),Lo(e.pattern)&&(new RegExp(e.pattern).test(r)||(yield br(an.StringPattern,e,n,r))),Lo(e.format)&&(Yh.Has(e.format)?Yh.Get(e.format)(r)||(yield br(an.StringFormat,e,n,r)):yield br(an.StringFormatUnknown,e,n,r))}function*Xds(e,t,n,r){sT(r)||(yield br(an.Symbol,e,n,r))}function*Kds(e,t,n,r){if(!Lo(r))return yield br(an.String,e,n,r);new RegExp(e.pattern).test(r)||(yield br(an.StringPattern,e,n,r))}function*qds(e,t,n,r){yield*$m(aa(e,t),t,n,r)}function*Jds(e,t,n,r){if(!wi(r))return yield br(an.Tuple,e,n,r);if(e.items===void 0&&r.length!==0)return yield br(an.TupleLength,e,n,r);if(r.length!==e.maxItems)return yield br(an.TupleLength,e,n,r);if(e.items)for(let i=0;i<e.items.length;i++)yield*$m(e.items[i],t,`${n}/${i}`,r[i])}function*eps(e,t,n,r){Nc(r)||(yield br(an.Undefined,e,n,r))}function*tps(e,t,n,r){if(Us(e,t,r))return;let i=e.anyOf.map(s=>new RA($m(s,t,n,r)));yield br(an.Union,e,n,r,i)}function*nps(e,t,n,r){if(!PU(r))return yield br(an.Uint8Array,e,n,r);Uo(e.maxByteLength)&&!(r.length<=e.maxByteLength)&&(yield br(an.Uint8ArrayMaxByteLength,e,n,r)),Uo(e.minByteLength)&&!(r.length>=e.minByteLength)&&(yield br(an.Uint8ArrayMinByteLength,e,n,r))}function*rps(e,t,n,r){}function*ips(e,t,n,r){mc.IsVoidLike(r)||(yield br(an.Void,e,n,r))}function*sps(e,t,n,r){wp.Get(e[on])(e,r)||(yield br(an.Kind,e,n,r))}function*$m(e,t,n,r){let i=Uo(e.$id)?[...t,e]:t,s=e;switch(s[on]){case"Any":return yield*Tds(s,i,n,r);case"Argument":return yield*Ids(s,i,n,r);case"Array":return yield*wds(s,i,n,r);case"AsyncIterator":return yield*Rds(s,i,n,r);case"BigInt":return yield*Nds(s,i,n,r);case"Boolean":return yield*kds(s,i,n,r);case"Constructor":return yield*Ods(s,i,n,r);case"Date":return yield*Mds(s,i,n,r);case"Function":return yield*Pds(s,i,n,r);case"Import":return yield*Dds(s,i,n,r);case"Integer":return yield*Bds(s,i,n,r);case"Intersect":return yield*Lds(s,i,n,r);case"Iterator":return yield*Fds(s,i,n,r);case"Literal":return yield*Uds(s,i,n,r);case"Never":return yield*Vds(s,i,n,r);case"Not":return yield*Gds(s,i,n,r);case"Null":return yield*Wds(s,i,n,r);case"Number":return yield*$ds(s,i,n,r);case"Object":return yield*Qds(s,i,n,r);case"Promise":return yield*Yds(s,i,n,r);case"Record":return yield*Hds(s,i,n,r);case"Ref":return yield*Zds(s,i,n,r);case"RegExp":return yield*jds(s,i,n,r);case"String":return yield*zds(s,i,n,r);case"Symbol":return yield*Xds(s,i,n,r);case"TemplateLiteral":return yield*Kds(s,i,n,r);case"This":return yield*qds(s,i,n,r);case"Tuple":return yield*Jds(s,i,n,r);case"Undefined":return yield*eps(s,i,n,r);case"Union":return yield*tps(s,i,n,r);case"Uint8Array":return yield*nps(s,i,n,r);case"Unknown":return yield*rps(s,i,n,r);case"Void":return yield*ips(s,i,n,r);default:if(!wp.Has(s[on]))throw new ORe(e);return yield*sps(s,i,n,r)}}function Mv(...e){let t=e.length===3?$m(e[0],e[1],"",e[2]):$m(e[0],[],"",e[1]);return new RA(t)}var an,ORe,RA,Eft=C(()=>{iZ();pA();qM();Exe();Aft();Vc();rS();aZ();wA();Fr();fd();Ip();(function(e){e[e.ArrayContains=0]="ArrayContains",e[e.ArrayMaxContains=1]="ArrayMaxContains",e[e.ArrayMaxItems=2]="ArrayMaxItems",e[e.ArrayMinContains=3]="ArrayMinContains",e[e.ArrayMinItems=4]="ArrayMinItems",e[e.ArrayUniqueItems=5]="ArrayUniqueItems",e[e.Array=6]="Array",e[e.AsyncIterator=7]="AsyncIterator",e[e.BigIntExclusiveMaximum=8]="BigIntExclusiveMaximum",e[e.BigIntExclusiveMinimum=9]="BigIntExclusiveMinimum",e[e.BigIntMaximum=10]="BigIntMaximum",e[e.BigIntMinimum=11]="BigIntMinimum",e[e.BigIntMultipleOf=12]="BigIntMultipleOf",e[e.BigInt=13]="BigInt",e[e.Boolean=14]="Boolean",e[e.DateExclusiveMaximumTimestamp=15]="DateExclusiveMaximumTimestamp",e[e.DateExclusiveMinimumTimestamp=16]="DateExclusiveMinimumTimestamp",e[e.DateMaximumTimestamp=17]="DateMaximumTimestamp",e[e.DateMinimumTimestamp=18]="DateMinimumTimestamp",e[e.DateMultipleOfTimestamp=19]="DateMultipleOfTimestamp",e[e.Date=20]="Date",e[e.Function=21]="Function",e[e.IntegerExclusiveMaximum=22]="IntegerExclusiveMaximum",e[e.IntegerExclusiveMinimum=23]="IntegerExclusiveMinimum",e[e.IntegerMaximum=24]="IntegerMaximum",e[e.IntegerMinimum=25]="IntegerMinimum",e[e.IntegerMultipleOf=26]="IntegerMultipleOf",e[e.Integer=27]="Integer",e[e.IntersectUnevaluatedProperties=28]="IntersectUnevaluatedProperties",e[e.Intersect=29]="Intersect",e[e.Iterator=30]="Iterator",e[e.Kind=31]="Kind",e[e.Literal=32]="Literal",e[e.Never=33]="Never",e[e.Not=34]="Not",e[e.Null=35]="Null",e[e.NumberExclusiveMaximum=36]="NumberExclusiveMaximum",e[e.NumberExclusiveMinimum=37]="NumberExclusiveMinimum",e[e.NumberMaximum=38]="NumberMaximum",e[e.NumberMinimum=39]="NumberMinimum",e[e.NumberMultipleOf=40]="NumberMultipleOf",e[e.Number=41]="Number",e[e.ObjectAdditionalProperties=42]="ObjectAdditionalProperties",e[e.ObjectMaxProperties=43]="ObjectMaxProperties",e[e.ObjectMinProperties=44]="ObjectMinProperties",e[e.ObjectRequiredProperty=45]="ObjectRequiredProperty",e[e.Object=46]="Object",e[e.Promise=47]="Promise",e[e.RegExp=48]="RegExp",e[e.StringFormatUnknown=49]="StringFormatUnknown",e[e.StringFormat=50]="StringFormat",e[e.StringMaxLength=51]="StringMaxLength",e[e.StringMinLength=52]="StringMinLength",e[e.StringPattern=53]="StringPattern",e[e.String=54]="String",e[e.Symbol=55]="Symbol",e[e.TupleLength=56]="TupleLength",e[e.Tuple=57]="Tuple",e[e.Uint8ArrayMaxByteLength=58]="Uint8ArrayMaxByteLength",e[e.Uint8ArrayMinByteLength=59]="Uint8ArrayMinByteLength",e[e.Uint8Array=60]="Uint8Array",e[e.Undefined=61]="Undefined",e[e.Union=62]="Union",e[e.Void=63]="Void"})(an||(an={}));ORe=class extends vi{constructor(t){super("Unknown type"),this.schema=t}};RA=class{constructor(t){this.iterator=t}[Symbol.iterator](){return this.iterator}First(){let t=this.iterator.next();return t.done?void 0:t.value}}});var r4={};li(r4,{DefaultErrorFunction:()=>VRn,Errors:()=>Mv,GetErrorFunction:()=>yft,SetErrorFunction:()=>wus,ValueErrorIterator:()=>RA,ValueErrorType:()=>an,ValueErrorsUnknownTypeError:()=>ORe});var QT=C(()=>{Eft();Aft()});function _u(e,t,n){try{return fa(e)?e[kc].Decode(n):n}catch(r){throw new MRe(e,t,n,r)}}function ops(e,t,n,r){return wi(r)?_u(e,n,r.map((i,s)=>Pv(e.items,t,`${n}/${s}`,i))):_u(e,n,r)}function aps(e,t,n,r){if(!ps(r)||Ry(r))return _u(e,n,r);let i=W7(e),s=i.map(c=>c[0]),o={...r};for(let[c,d]of i)c in o&&(o[c]=Pv(d,t,`${n}/${c}`,o[c]));if(!fa(e.unevaluatedProperties))return _u(e,n,o);let a=Object.getOwnPropertyNames(o),l=e.unevaluatedProperties,u={...o};for(let c of a)s.includes(c)||(u[c]=_u(l,`${n}/${c}`,u[c]));return _u(e,n,u)}function lps(e,t,n,r){let i=globalThis.Object.values(e.$defs),s=e.$defs[e.$ref],o=Pv(s,[...t,...i],n,r);return _u(e,n,o)}function cps(e,t,n,r){return _u(e,n,Pv(e.not,t,n,r))}function ups(e,t,n,r){if(!ps(r))return _u(e,n,r);let i=zh(e),s={...r};for(let u of i)Vi(s,u)&&(Nc(s[u])&&(!lT(e.properties[u])||mc.IsExactOptionalProperty(s,u))||(s[u]=Pv(e.properties[u],t,`${n}/${u}`,s[u])));if(!Gc(e.additionalProperties))return _u(e,n,s);let o=Object.getOwnPropertyNames(s),a=e.additionalProperties,l={...s};for(let u of o)i.includes(u)||(l[u]=_u(a,`${n}/${u}`,l[u]));return _u(e,n,l)}function dps(e,t,n,r){if(!ps(r))return _u(e,n,r);let i=Object.getOwnPropertyNames(e.patternProperties)[0],s=new RegExp(i),o={...r};for(let c of Object.getOwnPropertyNames(r))s.test(c)&&(o[c]=Pv(e.patternProperties[i],t,`${n}/${c}`,o[c]));if(!Gc(e.additionalProperties))return _u(e,n,o);let a=Object.getOwnPropertyNames(o),l=e.additionalProperties,u={...o};for(let c of a)s.test(c)||(u[c]=_u(l,`${n}/${c}`,u[c]));return _u(e,n,u)}function pps(e,t,n,r){let i=aa(e,t);return _u(e,n,Pv(i,t,n,r))}function mps(e,t,n,r){let i=aa(e,t);return _u(e,n,Pv(i,t,n,r))}function fps(e,t,n,r){return wi(r)&&wi(e.items)?_u(e,n,e.items.map((i,s)=>Pv(i,t,`${n}/${s}`,r[s]))):_u(e,n,r)}function hps(e,t,n,r){for(let i of e.anyOf){if(!Us(i,t,r))continue;let s=Pv(i,t,n,r);return _u(e,n,s)}return _u(e,n,r)}function Pv(e,t,n,r){let i=Gm(e,t),s=e;switch(e[on]){case"Array":return ops(s,i,n,r);case"Import":return lps(s,i,n,r);case"Intersect":return aps(s,i,n,r);case"Not":return cps(s,i,n,r);case"Object":return ups(s,i,n,r);case"Record":return dps(s,i,n,r);case"Ref":return pps(s,i,n,r);case"Symbol":return _u(s,n,r);case"This":return mps(s,i,n,r);case"Tuple":return fps(s,i,n,r);case"Union":return hps(s,i,n,r);default:return _u(s,n,r)}}function s4(e,t,n){return Pv(e,t,"",n)}var i4,MRe,ZRn=C(()=>{gie();Fr();Vc();pA();rS();wA();Ip();Ks();i4=class extends vi{constructor(t,n,r){super("Unable to decode value as it does not match the expected schema"),this.schema=t,this.value=n,this.error=r}},MRe=class extends vi{constructor(t,n,r,i){super(i instanceof Error?i.message:"Unknown error"),this.schema=t,this.path=n,this.value=r,this.error=i}}});function Kf(e,t,n){try{return fa(e)?e[kc].Encode(n):n}catch(r){throw new PRe(e,t,n,r)}}function gps(e,t,n,r){let i=Kf(e,n,r);return wi(i)?i.map((s,o)=>Dv(e.items,t,`${n}/${o}`,s)):i}function bps(e,t,n,r){let i=globalThis.Object.values(e.$defs),s=e.$defs[e.$ref],o=Kf(e,n,r);return Dv(s,[...t,...i],n,o)}function yps(e,t,n,r){let i=Kf(e,n,r);if(!ps(r)||Ry(r))return i;let s=W7(e),o=s.map(d=>d[0]),a={...i};for(let[d,p]of s)d in a&&(a[d]=Dv(p,t,`${n}/${d}`,a[d]));if(!fa(e.unevaluatedProperties))return a;let l=Object.getOwnPropertyNames(a),u=e.unevaluatedProperties,c={...a};for(let d of l)o.includes(d)||(c[d]=Kf(u,`${n}/${d}`,c[d]));return c}function Aps(e,t,n,r){return Kf(e.not,n,Kf(e,n,r))}function Eps(e,t,n,r){let i=Kf(e,n,r);if(!ps(i))return i;let s=zh(e),o={...i};for(let c of s)Vi(o,c)&&(Nc(o[c])&&(!lT(e.properties[c])||mc.IsExactOptionalProperty(o,c))||(o[c]=Dv(e.properties[c],t,`${n}/${c}`,o[c])));if(!Gc(e.additionalProperties))return o;let a=Object.getOwnPropertyNames(o),l=e.additionalProperties,u={...o};for(let c of a)s.includes(c)||(u[c]=Kf(l,`${n}/${c}`,u[c]));return u}function _ps(e,t,n,r){let i=Kf(e,n,r);if(!ps(r))return i;let s=Object.getOwnPropertyNames(e.patternProperties)[0],o=new RegExp(s),a={...i};for(let d of Object.getOwnPropertyNames(r))o.test(d)&&(a[d]=Dv(e.patternProperties[s],t,`${n}/${d}`,a[d]));if(!Gc(e.additionalProperties))return a;let l=Object.getOwnPropertyNames(a),u=e.additionalProperties,c={...a};for(let d of l)o.test(d)||(c[d]=Kf(u,`${n}/${d}`,c[d]));return c}function Sps(e,t,n,r){let i=aa(e,t),s=Dv(i,t,n,r);return Kf(e,n,s)}function vps(e,t,n,r){let i=aa(e,t),s=Dv(i,t,n,r);return Kf(e,n,s)}function xps(e,t,n,r){let i=Kf(e,n,r);return wi(e.items)?e.items.map((s,o)=>Dv(s,t,`${n}/${o}`,i[o])):[]}function Cps(e,t,n,r){for(let i of e.anyOf){if(!Us(i,t,r))continue;let s=Dv(i,t,n,r);return Kf(e,n,s)}for(let i of e.anyOf){let s=Dv(i,t,n,r);if(Us(e,t,s))return Kf(e,n,s)}return Kf(e,n,r)}function Dv(e,t,n,r){let i=Gm(e,t),s=e;switch(e[on]){case"Array":return gps(s,i,n,r);case"Import":return bps(s,i,n,r);case"Intersect":return yps(s,i,n,r);case"Not":return Aps(s,i,n,r);case"Object":return Eps(s,i,n,r);case"Record":return _ps(s,i,n,r);case"Ref":return Sps(s,i,n,r);case"This":return vps(s,i,n,r);case"Tuple":return xps(s,i,n,r);case"Union":return Cps(s,i,n,r);default:return Kf(s,n,r)}}function a4(e,t,n){return Dv(e,t,"",n)}var o4,PRe,jRn=C(()=>{gie();Fr();Vc();pA();rS();wA();Ip();Ks();o4=class extends vi{constructor(t,n,r){super("The encoded value does not match the expected schema"),this.schema=t,this.value=n,this.error=r}},PRe=class extends vi{constructor(t,n,r,i){super(`${i instanceof Error?i.message:"Unknown error"}`),this.schema=t,this.path=n,this.value=r,this.error=i}}});function Tps(e,t){return fa(e)||rm(e.items,t)}function Ips(e,t){return fa(e)||rm(e.items,t)}function wps(e,t){return fa(e)||rm(e.returns,t)||e.parameters.some(n=>rm(n,t))}function Rps(e,t){return fa(e)||rm(e.returns,t)||e.parameters.some(n=>rm(n,t))}function Nps(e,t){return fa(e)||fa(e.unevaluatedProperties)||e.allOf.some(n=>rm(n,t))}function kps(e,t){let n=globalThis.Object.getOwnPropertyNames(e.$defs).reduce((i,s)=>[...i,e.$defs[s]],[]),r=e.$defs[e.$ref];return fa(e)||rm(r,[...n,...t])}function Ops(e,t){return fa(e)||rm(e.items,t)}function Mps(e,t){return fa(e)||rm(e.not,t)}function Pps(e,t){return fa(e)||Object.values(e.properties).some(n=>rm(n,t))||Gc(e.additionalProperties)&&rm(e.additionalProperties,t)}function Dps(e,t){return fa(e)||rm(e.item,t)}function Bps(e,t){let n=Object.getOwnPropertyNames(e.patternProperties)[0],r=e.patternProperties[n];return fa(e)||rm(r,t)||Gc(e.additionalProperties)&&fa(e.additionalProperties)}function Lps(e,t){return fa(e)?!0:rm(aa(e,t),t)}function Fps(e,t){return fa(e)?!0:rm(aa(e,t),t)}function Ups(e,t){return fa(e)||!Nc(e.items)&&e.items.some(n=>rm(n,t))}function Vps(e,t){return fa(e)||e.anyOf.some(n=>rm(n,t))}function rm(e,t){let n=Gm(e,t),r=e;if(e.$id&&vft.has(e.$id))return!1;switch(e.$id&&vft.add(e.$id),e[on]){case"Array":return Tps(r,n);case"AsyncIterator":return Ips(r,n);case"Constructor":return wps(r,n);case"Function":return Rps(r,n);case"Import":return kps(r,n);case"Intersect":return Nps(r,n);case"Iterator":return Ops(r,n);case"Not":return Mps(r,n);case"Object":return Pps(r,n);case"Promise":return Dps(r,n);case"Record":return Bps(r,n);case"Ref":return Lps(r,n);case"This":return Fps(r,n);case"Tuple":return Ups(r,n);case"Union":return Vps(r,n);default:return fa(e)}}function YT(e,t){return vft.clear(),rm(e,t)}var vft,zRn=C(()=>{rS();Fr();Ks();Ip();vft=new Set});var lZ=C(()=>{ZRn();jRn();zRn()});function aD(e){if(!Lo(e))throw Error("ConstantString: Not a String");return`'${JSON.stringify(e).slice(1,-1).replace(/'/g,"\\'")}'`}function XRn(e,t){return`${e}[${aD(t)}]`}var DRe,BRe,xft,LRe,Fae,lD,l4,KRn=C(()=>{lZ();QT();iZ();Vc();rS();aZ();Fr();qM();pA();Exe();fd();hT();Ip();Gtt();DRe=class{constructor(t,n,r,i){this.schema=t,this.references=n,this.checkFunc=r,this.code=i,this.hasTransform=YT(t,n)}Code(){return this.code}Schema(){return this.schema}References(){return this.references}Errors(t){return Mv(this.schema,this.references,t)}Check(t){return this.checkFunc(t)}Decode(t){if(!this.checkFunc(t))throw new i4(this.schema,t,this.Errors(t).First());return this.hasTransform?s4(this.schema,this.references,t):t}Encode(t){let n=this.hasTransform?a4(this.schema,this.references,t):t;if(!this.checkFunc(n))throw new o4(this.schema,t,this.Errors(t).First());return n}};(function(e){function t(s){return s===36}e.DollarSign=t;function n(s){return s===95}e.IsUnderscore=n;function r(s){return s>=65&&s<=90||s>=97&&s<=122}e.IsAlpha=r;function i(s){return s>=48&&s<=57}e.IsNumeric=i})(BRe||(BRe={}));(function(e){function t(n){let r=[];for(let i=0;i<n.length;i++){let s=n.charCodeAt(i);BRe.IsNumeric(s)||BRe.IsAlpha(s)?r.push(n.charAt(i)):r.push(`_${s}_`)}return r.join("").replace(/__/g,"_")}e.Encode=t})(xft||(xft={}));LRe=class extends vi{constructor(t){super("Unknown type"),this.schema=t}},Fae=class extends vi{constructor(t){super("Preflight validation check failed to guard for the given schema"),this.schema=t}};(function(e){function t(o,a,l){return mc.ExactOptionalPropertyTypes?`(${aD(a)} in ${o} ? ${l} : true)`:`(${XRn(o,a)} !== undefined ? ${l} : true)`}e.IsExactOptionalProperty=t;function n(o){return mc.AllowArrayObject?`(typeof ${o} === 'object' && ${o} !== null)`:`(typeof ${o} === 'object' && ${o} !== null && !Array.isArray(${o}))`}e.IsObjectLike=n;function r(o){return mc.AllowArrayObject?`(typeof ${o} === 'object' && ${o} !== null && !(${o} instanceof Date) && !(${o} instanceof Uint8Array))`:`(typeof ${o} === 'object' && ${o} !== null && !Array.isArray(${o}) && !(${o} instanceof Date) && !(${o} instanceof Uint8Array))`}e.IsRecordLike=r;function i(o){return mc.AllowNaN?`typeof ${o} === 'number'`:`Number.isFinite(${o})`}e.IsNumberLike=i;function s(o){return mc.AllowNullVoid?`(${o} === undefined || ${o} === null)`:`${o} === undefined`}e.IsVoidLike=s})(lD||(lD={}));(function(e){function t(ee){return ee[on]==="Any"||ee[on]==="Unknown"}function*n(ee,X,$){yield"true"}function*r(ee,X,$){yield"true"}function*i(ee,X,$){yield`Array.isArray(${$})`;let[se,oe]=[j("value","any"),j("acc","number")];pi(ee.maxItems)&&(yield`${$}.length <= ${ee.maxItems}`),pi(ee.minItems)&&(yield`${$}.length >= ${ee.minItems}`);let we=ce(ee.items,X,"value");if(yield`((array) => { for(const ${se} of array) if(!(${we})) { return false }; return true; })(${$})`,Wc(ee.contains)||pi(ee.minContains)||pi(ee.maxContains)){let Re=Wc(ee.contains)?ee.contains:Gi(),xe=ce(Re,X,"value"),re=pi(ee.minContains)?[`(count >= ${ee.minContains})`]:[],Oe=pi(ee.maxContains)?[`(count <= ${ee.maxContains})`]:[],Ze=`const count = value.reduce((${oe}, ${se}) => ${xe} ? acc + 1 : acc, 0)`,Ye=["(count > 0)",...re,...Oe].join(" && ");yield`((${se}) => { ${Ze}; return ${Ye}})(${$})`}ee.uniqueItems===!0&&(yield`((${se}) => { const set = new Set(); for(const element of value) { const hashed = hash(element); if(set.has(hashed)) { return false } else { set.add(hashed) } } return true } )(${$})`)}function*s(ee,X,$){yield`(typeof value === 'object' && Symbol.asyncIterator in ${$})`}function*o(ee,X,$){yield`(typeof ${$} === 'bigint')`,Bm(ee.exclusiveMaximum)&&(yield`${$} < BigInt(${ee.exclusiveMaximum})`),Bm(ee.exclusiveMinimum)&&(yield`${$} > BigInt(${ee.exclusiveMinimum})`),Bm(ee.maximum)&&(yield`${$} <= BigInt(${ee.maximum})`),Bm(ee.minimum)&&(yield`${$} >= BigInt(${ee.minimum})`),Bm(ee.multipleOf)&&(yield`(${$} % BigInt(${ee.multipleOf})) === 0`)}function*a(ee,X,$){yield`(typeof ${$} === 'boolean')`}function*l(ee,X,$){yield*ie(ee.returns,X,`${$}.prototype`)}function*u(ee,X,$){yield`(${$} instanceof Date) && Number.isFinite(${$}.getTime())`,pi(ee.exclusiveMaximumTimestamp)&&(yield`${$}.getTime() < ${ee.exclusiveMaximumTimestamp}`),pi(ee.exclusiveMinimumTimestamp)&&(yield`${$}.getTime() > ${ee.exclusiveMinimumTimestamp}`),pi(ee.maximumTimestamp)&&(yield`${$}.getTime() <= ${ee.maximumTimestamp}`),pi(ee.minimumTimestamp)&&(yield`${$}.getTime() >= ${ee.minimumTimestamp}`),pi(ee.multipleOfTimestamp)&&(yield`(${$}.getTime() % ${ee.multipleOfTimestamp}) === 0`)}function*c(ee,X,$){yield`(typeof ${$} === 'function')`}function*d(ee,X,$){let se=globalThis.Object.getOwnPropertyNames(ee.$defs).reduce((oe,we)=>[...oe,ee.$defs[we]],[]);yield*ie(Um(ee.$ref),[...X,...se],$)}function*p(ee,X,$){yield`Number.isInteger(${$})`,pi(ee.exclusiveMaximum)&&(yield`${$} < ${ee.exclusiveMaximum}`),pi(ee.exclusiveMinimum)&&(yield`${$} > ${ee.exclusiveMinimum}`),pi(ee.maximum)&&(yield`${$} <= ${ee.maximum}`),pi(ee.minimum)&&(yield`${$} >= ${ee.minimum}`),pi(ee.multipleOf)&&(yield`(${$} % ${ee.multipleOf}) === 0`)}function*m(ee,X,$){let se=ee.allOf.map(oe=>ce(oe,X,$)).join(" && ");if(ee.unevaluatedProperties===!1){let oe=W(`${new RegExp(bv(ee))};`),we=`Object.getOwnPropertyNames(${$}).every(key => ${oe}.test(key))`;yield`(${se} && ${we})`}else if(Wc(ee.unevaluatedProperties)){let oe=W(`${new RegExp(bv(ee))};`),we=`Object.getOwnPropertyNames(${$}).every(key => ${oe}.test(key) || ${ce(ee.unevaluatedProperties,X,`${$}[key]`)})`;yield`(${se} && ${we})`}else yield`(${se})`}function*f(ee,X,$){yield`(typeof value === 'object' && Symbol.iterator in ${$})`}function*h(ee,X,$){if(typeof ee.const=="number"||typeof ee.const=="boolean")yield`(${$} === ${ee.const})`;else if(typeof ee.const=="string")yield`(${$} === ${aD(ee.const)})`;else throw Error("Invalid Literal Value")}function*g(ee,X,$){yield"false"}function*b(ee,X,$){yield`(!${ce(ee.not,X,$)})`}function*A(ee,X,$){yield`(${$} === null)`}function*y(ee,X,$){yield lD.IsNumberLike($),pi(ee.exclusiveMaximum)&&(yield`${$} < ${ee.exclusiveMaximum}`),pi(ee.exclusiveMinimum)&&(yield`${$} > ${ee.exclusiveMinimum}`),pi(ee.maximum)&&(yield`${$} <= ${ee.maximum}`),pi(ee.minimum)&&(yield`${$} >= ${ee.minimum}`),pi(ee.multipleOf)&&(yield`(${$} % ${ee.multipleOf}) === 0`)}function*S(ee,X,$){yield lD.IsObjectLike($),pi(ee.minProperties)&&(yield`Object.getOwnPropertyNames(${$}).length >= ${ee.minProperties}`),pi(ee.maxProperties)&&(yield`Object.getOwnPropertyNames(${$}).length <= ${ee.maxProperties}`);let se=Object.getOwnPropertyNames(ee.properties);for(let oe of se){let we=XRn($,oe),Re=ee.properties[oe];if(ee.required&&ee.required.includes(oe))yield*ie(Re,X,we),(yv(Re)||t(Re))&&(yield`(${aD(oe)} in ${$})`);else{let xe=ce(Re,X,we);yield lD.IsExactOptionalProperty($,oe,xe)}}if(ee.additionalProperties===!1)if(ee.required&&ee.required.length===se.length)yield`Object.getOwnPropertyNames(${$}).length === ${se.length}`;else{let oe=`[${se.map(we=>`${aD(we)}`).join(", ")}]`;yield`Object.getOwnPropertyNames(${$}).every(key => ${oe}.includes(key))`}if(typeof ee.additionalProperties=="object"){let oe=ce(ee.additionalProperties,X,`${$}[key]`),we=`[${se.map(Re=>`${aD(Re)}`).join(", ")}]`;yield`(Object.getOwnPropertyNames(${$}).every(key => ${we}.includes(key) || ${oe}))`}}function*_(ee,X,$){yield`${$} instanceof Promise`}function*x(ee,X,$){yield lD.IsRecordLike($),pi(ee.minProperties)&&(yield`Object.getOwnPropertyNames(${$}).length >= ${ee.minProperties}`),pi(ee.maxProperties)&&(yield`Object.getOwnPropertyNames(${$}).length <= ${ee.maxProperties}`);let[se,oe]=Object.entries(ee.patternProperties)[0],we=W(`${new RegExp(se)}`),Re=ce(oe,X,"value"),xe=Wc(ee.additionalProperties)?ce(ee.additionalProperties,X,$):ee.additionalProperties===!1?"false":"true",re=`(${we}.test(key) ? ${Re} : ${xe})`;yield`(Object.entries(${$}).every(([key, value]) => ${re}))`}function*v(ee,X,$){let se=aa(ee,X);if(ne.functions.has(ee.$ref))return yield`${ue(ee.$ref)}(${$})`;yield*ie(se,X,$)}function*w(ee,X,$){let se=W(`${new RegExp(ee.source,ee.flags)};`);yield`(typeof ${$} === 'string')`,pi(ee.maxLength)&&(yield`${$}.length <= ${ee.maxLength}`),pi(ee.minLength)&&(yield`${$}.length >= ${ee.minLength}`),yield`${se}.test(${$})`}function*T(ee,X,$){yield`(typeof ${$} === 'string')`,pi(ee.maxLength)&&(yield`${$}.length <= ${ee.maxLength}`),pi(ee.minLength)&&(yield`${$}.length >= ${ee.minLength}`),ee.pattern!==void 0&&(yield`${W(`${new RegExp(ee.pattern)};`)}.test(${$})`),ee.format!==void 0&&(yield`format(${aD(ee.format)}, ${$})`)}function*D(ee,X,$){yield`(typeof ${$} === 'symbol')`}function*M(ee,X,$){yield`(typeof ${$} === 'string')`,yield`${W(`${new RegExp(ee.pattern)};`)}.test(${$})`}function*P(ee,X,$){yield`${ue(ee.$ref)}(${$})`}function*O(ee,X,$){if(yield`Array.isArray(${$})`,ee.items===void 0)return yield`${$}.length === 0`;yield`(${$}.length === ${ee.maxItems})`;for(let se=0;se<ee.items.length;se++)yield`${ce(ee.items[se],X,`${$}[${se}]`)}`}function*k(ee,X,$){yield`${$} === undefined`}function*L(ee,X,$){yield`(${ee.anyOf.map(oe=>ce(oe,X,$)).join(" || ")})`}function*F(ee,X,$){yield`${$} instanceof Uint8Array`,pi(ee.maxByteLength)&&(yield`(${$}.length <= ${ee.maxByteLength})`),pi(ee.minByteLength)&&(yield`(${$}.length >= ${ee.minByteLength})`)}function*Y(ee,X,$){yield"true"}function*U(ee,X,$){yield lD.IsVoidLike($)}function*J(ee,X,$){let se=ne.instances.size;ne.instances.set(se,ee),yield`kind(${aD(ee[on])}, ${se}, ${$})`}function*ie(ee,X,$,se=!0){let oe=Lo(ee.$id)?[...X,ee]:X,we=ee;if(se&&Lo(ee.$id)){let Re=ue(ee.$id);if(ne.functions.has(Re))return yield`${Re}(${$})`;{ne.functions.set(Re,"<deferred>");let xe=Q(Re,ee,X,"value",!1);return ne.functions.set(Re,xe),yield`${Re}(${$})`}}switch(we[on]){case"Any":return yield*n(we,oe,$);case"Argument":return yield*r(we,oe,$);case"Array":return yield*i(we,oe,$);case"AsyncIterator":return yield*s(we,oe,$);case"BigInt":return yield*o(we,oe,$);case"Boolean":return yield*a(we,oe,$);case"Constructor":return yield*l(we,oe,$);case"Date":return yield*u(we,oe,$);case"Function":return yield*c(we,oe,$);case"Import":return yield*d(we,oe,$);case"Integer":return yield*p(we,oe,$);case"Intersect":return yield*m(we,oe,$);case"Iterator":return yield*f(we,oe,$);case"Literal":return yield*h(we,oe,$);case"Never":return yield*g(we,oe,$);case"Not":return yield*b(we,oe,$);case"Null":return yield*A(we,oe,$);case"Number":return yield*y(we,oe,$);case"Object":return yield*S(we,oe,$);case"Promise":return yield*_(we,oe,$);case"Record":return yield*x(we,oe,$);case"Ref":return yield*v(we,oe,$);case"RegExp":return yield*w(we,oe,$);case"String":return yield*T(we,oe,$);case"Symbol":return yield*D(we,oe,$);case"TemplateLiteral":return yield*M(we,oe,$);case"This":return yield*P(we,oe,$);case"Tuple":return yield*O(we,oe,$);case"Undefined":return yield*k(we,oe,$);case"Union":return yield*L(we,oe,$);case"Uint8Array":return yield*F(we,oe,$);case"Unknown":return yield*Y(we,oe,$);case"Void":return yield*U(we,oe,$);default:if(!wp.Has(we[on]))throw new LRe(ee);return yield*J(we,oe,$)}}let ne={language:"javascript",functions:new Map,variables:new Map,instances:new Map};function ce(ee,X,$,se=!0){return`(${[...ie(ee,X,$,se)].join(" && ")})`}function ue(ee){return`check_${xft.Encode(ee)}`}function W(ee){let X=`local_${ne.variables.size}`;return ne.variables.set(X,`const ${X} = ${ee}`),X}function Q(ee,X,$,se,oe=!0){let[we,Re]=[`
|
|
295
|
+
Offending fields: ${e.join(", ")}. Re-emit the call with corrected values for those fields only.`}function _us(e,t){if(t.params?.missingProperty!==void 0||t.params?.additionalProperty!==void 0||!t.instancePath)return"";let n=Sus(e,t.instancePath);if(n===void 0)return"";if(typeof n=="string")return` (current value: ${n.length>vRe?JSON.stringify(`${n.slice(0,vRe)}\u2026`):JSON.stringify(n)})`;let r;try{r=JSON.stringify(n)}catch{return""}return r===void 0?"":` (current value: ${r.length>vRe?`${r.slice(0,vRe)}\u2026`:r})`}function Sus(e,t){if(t===""||t==="/")return e;let n=t.split("/").slice(1),r=e;for(let i of n){let s=i.replace(/~1/g,"/").replace(/~0/g,"~");if(r==null)return;if(Array.isArray(r)){let o=Number(s);if(!Number.isInteger(o)||o<0)return;r=r[o];continue}if(typeof r!="object")return;r=r[s]}return r}var cft,uft,dft,pus,mus,_Rn,fus,SRn,hus,gus,xRe,pft,vRe,CRn=C(()=>{"use strict";cft=_n(qH(),1),uft=_n(lRn(),1),dft=_n(lft(),1),pus=cft.default.default||cft.default,mus=uft.default.default||uft.default,_Rn=dft.default.default||dft.default,fus=typeof globalThis<"u"&&globalThis.chrome?.runtime?.id!==void 0;SRn={allErrors:!0,strict:!1,coerceTypes:!0},hus=/^https?:\/\/json-schema\.org\/draft-07\/schema#?$/,gus=/^https?:\/\/json-schema\.org\/draft\/2020-12\/schema#?$/;xRe=null,pft=null;if(xRn())try{let e=new pus(SRn);_Rn(e);let t=new mus(SRn);_Rn(t),vRn(e,"http://json-schema.org/draft-07/schema#","https://json-schema.org/draft-07/schema"),vRn(t,"https://json-schema.org/draft/2020-12/schema","http://json-schema.org/draft/2020-12/schema"),xRe=e,pft=t}catch{console.warn("AJV validation disabled due to CSP restrictions")}vRe=200});var t4={};li(t4,{AssistantMessageEventStream:()=>VN,EventStream:()=>zP,LEGACY_THINKING_LEVELS:()=>Rwe,StringEnum:()=>Vwe,Type:()=>te,appendAssistantMessageDiagnostic:()=>xdt,calculateCost:()=>Vts,calculateDetailedContextUsedTokens:()=>BT,cleanupSessionResources:()=>Fns,clearApiProviders:()=>bdt,complete:()=>Gdt,completeSimple:()=>nb,createAssistantMessageDiagnostic:()=>jts,createAssistantMessageEventStream:()=>Jts,createAugmentTransportErrorDiagnostic:()=>Tdt,discoverAugmentModels:()=>W3,extractDiagnosticError:()=>vCn,findAugmentTransportErrorContext:()=>Tv,findEnvKeys:()=>gCn,formatThrownValue:()=>SCn,formatUnsupportedReasoningEffort:()=>nm,getApiProvider:()=>V3,getApiProviders:()=>Nts,getEnvApiKey:()=>DT,getModel:()=>Uts,getModels:()=>Joe,getOrCreateAugmentClient:()=>rl,getOverflowPatterns:()=>Zns,getProviders:()=>qoe,isContextOverflow:()=>WN,isContextOverflowErrorText:()=>PH,isDetailedContextUsage:()=>vA,isLegacyThinkingLevel:()=>xA,isModelUnavailableErrorText:()=>nae,modelsAreEqual:()=>sa,normalizeReasoningEfforts:()=>Owe,parseAugmentTransportErrorDiagnostic:()=>CCn,parseJsonWithRepair:()=>aTn,parseStreamingJson:()=>Ydt,reasoningSelectionLabel:()=>CA,reasoningSelections:()=>tb,registerApiProvider:()=>U3,registerBuiltInApiProviders:()=>Fdt,registerSessionResourceCleanup:()=>Lns,repairJson:()=>Qdt,resetApiProviders:()=>GN,resolveReasoningCapabilities:()=>Xu,resolveReasoningSelection:()=>Ls,sanitizeAugmentTransportErrorContext:()=>eae,stream:()=>rTn,streamAugment:()=>MH,streamSimple:()=>LT,streamSimpleAugment:()=>eTn,supportsXhigh:()=>ACn,toProviderStopReason:()=>Sdt,unregisterApiProviders:()=>kts,validateToolArguments:()=>CRe,validateToolCall:()=>yus});var Bi=C(()=>{"use strict";cs();Twe();_dt();vdt();Ldt();Udt();tTn();iTn();Nwe();Idt();Dwe();lTn();uTn();dTn();CRn()});var oD,mft=C(()=>{oD={name:"@augmentcode/auggie-v2",version:"1.2.0",description:"Auggie CLI Client by Augment Code",type:"module",piConfig:{name:"auggie",configDir:".augment"},bin:{auggie:"dist/cli.js","auggie-v2":"dist/cli.js",pi:"dist/cli.js"},main:"./dist/index.js",types:"./dist/index.d.ts",exports:{".":{source:"./src/index.ts",types:"./dist/index.d.ts",import:"./dist/index.js"},"./hooks":{types:"./dist/core/hooks/index.d.ts",import:"./dist/core/hooks/index.js"}},files:["dist","docs","examples","CHANGELOG.md"],scripts:{"check-types":"pnpm run bake:export-html && tsgo -p tsconfig.build.json",clean:"shx rm -rf dist",banners:"tsx --conditions=source scripts/print-banners.ts","cli:source":"tsx --conditions=source src/cli.ts",dev:"pnpm run bake:export-html && pnpm run cli:source","dev:debug":"pnpm run bake:export-html && node --conditions=source --inspect-wait=ws://localhost:6499/57uz7t2uyri --import tsx src/cli.ts","bake:export-html":"node scripts/bake-export-html.mjs",build:"pnpm run bake:export-html && tsgo -p tsconfig.build.json --noCheck && shx chmod +x dist/cli.js && shx cp src/runtime/register-extensions.js dist/runtime/register-extensions.js && shx cp src/runtime/cloud-bridge.js dist/runtime/cloud-bridge.js && shx cp src/runtime/cloud-tracer-bridge.js dist/runtime/cloud-tracer-bridge.js && shx cp src/runtime/cloud-error-bridge.js dist/runtime/cloud-error-bridge.js && shx cp src/runtime/mcp-error-bridge.js dist/runtime/mcp-error-bridge.js && pnpm run copy-assets","build:npm:release":"node scripts/build-npm-release.mjs","build:migration-engine":"node scripts/build-migration-engine.mjs","build:release:sea":"node scripts/build-sea-release.mjs","build:release:sea:from-onison":"node scripts/build-sea-from-onison.mjs","build:release-js":"pnpm run bake:export-html && tsgo -p tsconfig.release.json --noCheck && shx chmod +x dist/cli.js && shx cp src/runtime/register-extensions.js dist/runtime/register-extensions.js && shx cp src/runtime/cloud-bridge.js dist/runtime/cloud-bridge.js && shx cp src/runtime/cloud-tracer-bridge.js dist/runtime/cloud-tracer-bridge.js && shx cp src/runtime/cloud-error-bridge.js dist/runtime/cloud-error-bridge.js && shx cp src/runtime/mcp-error-bridge.js dist/runtime/mcp-error-bridge.js && pnpm run copy-assets","build:npm":"pnpm run build:npm:release","clean:npm-artifacts":"find dist -name '*.js' -not -path 'dist/cli.js' -not -path 'dist/index.js' -not -path 'dist/release/*' -not -path 'dist/core/export-html/*' -delete && find dist -name '*.js.map' -delete","copy-assets":"shx mkdir -p dist/modes/interactive/theme && shx cp src/modes/interactive/theme/*.json dist/modes/interactive/theme/",test:"pnpm run bake:export-html && vitest --run","test:acp:e2e":"pnpm run bake:export-html && vitest --run --config vitest.e2e.config.ts e2e-test/acp/","test:e2e:sanity":"pnpm run bake:export-html && vitest --run --config vitest.e2e.config.ts e2e-test/tui/sanity.test.ts","test:e2e:tui":"pnpm run bake:export-html && vitest --run --no-file-parallelism --config vitest.e2e.config.ts e2e-test/tui/","test:e2e:cli":"pnpm run bake:export-html && vitest --run --no-file-parallelism --config vitest.e2e.config.ts e2e-test/cli/",prepublishOnly:"pnpm run clean && pnpm run build"},dependencies:{"@agentclientprotocol/sdk":"1.4.0","@augmentcode/api-client":"workspace:*","@earendil-works/pi-agent-core":"workspace:*","@earendil-works/pi-ai":"workspace:*","@earendil-works/pi-indexing":"workspace:*","@earendil-works/pi-tui":"workspace:*","@hermes/ask-user":"workspace:*","@hermes/augment-legacy-tools":"workspace:*","@hermes/cloud":"workspace:*","@hermes/context-usage":"workspace:*","@hermes/import-sessions":"workspace:*","@hermes/cosmos":"workspace:*","@hermes/daemon":"workspace:*","@hermes/git-credentials":"workspace:*","@hermes/hashline-edit":"workspace:*","@hermes/hooks":"workspace:*","@hermes/logger":"workspace:*","@hermes/lsp":"workspace:*","@hermes/mcp":"workspace:*","@hermes/migration":"workspace:*","@hermes/open-browser":"workspace:*","@hermes/otel":"workspace:*","@hermes/path-utils":"workspace:*","@hermes/plugins":"workspace:*","@hermes/prompt-enhancer":"workspace:*","@hermes/segment-analytics":"workspace:*","@hermes/sentry":"workspace:*","@hermes/settings":"workspace:*","@hermes/shared-types":"workspace:*","@hermes/subagents":"workspace:*","@hermes/tool-permissions":"workspace:*","@mariozechner/jiti":"^2.6.2","@sentry/node":"^10.53.1","@silvia-odwyer/photon-node":"^0.3.4","@sinclair/typebox":"^0.34.41",ajv:"^8.17.1",chalk:"^5.5.0","cli-highlight":"^2.1.11",diff:"^8.0.2","extract-zip":"^2.0.1",fdir:"^6.5.0","file-type":"^21.1.1",glob:"^13.0.1","hosted-git-info":"^9.0.2",ignore:"^7.0.5",jimp:"^1.6.1","jsonc-parser":"3.3.1",marked:"^15.0.12",minimatch:"^10.2.3","proper-lockfile":"^4.1.2","strip-ansi":"^7.1.0",turndown:"^7.2.4",undici:"^7.19.1",yaml:"^2.8.2",zod:"^4.4.3"},overrides:{rimraf:"6.1.2",gaxios:{rimraf:"6.1.2"}},optionalDependencies:{"@mariozechner/clipboard":"^0.3.2"},devDependencies:{"@tintinweb/pi-subagents":"workspace:*","@types/diff":"^7.0.2","@types/hosted-git-info":"^3.0.5","@types/ms":"^2.1.0","@types/node":"^24.3.0","@types/proper-lockfile":"^4.1.4","@types/turndown":"^5.0.5",level:"^10.0.0",shx:"^0.4.0",tsx:"^4.21.0",typescript:"^5.7.3",vitest:"^3.2.4"},keywords:["coding-agent","ai","llm","cli","tui","agent"],author:"Mario Zechner",license:"MIT",repository:{type:"git",url:"git+https://github.com/badlogic/pi-mono.git",directory:"packages/coding-agent"},engines:{node:">=20.6.0"}}});import{existsSync as xus}from"node:fs";import{homedir as Pae}from"node:os";import{dirname as fft,join as Ov,resolve as IRn}from"node:path";import{fileURLToPath as Cus}from"node:url";function wRn(){let e=process.env.PI_PACKAGE_DIR;if(e)return e==="~"?Pae():e.startsWith("~/")?Pae()+e.slice(1):e;let t=TRn;for(;t!==fft(t);){if(xus(Ov(t,"package.json")))return t;t=fft(t)}return TRn}function TRe(){return IRn(Ov(wRn(),"docs"))}function IRe(){return IRn(Ov(wRn(),"CHANGELOG.md"))}function ORn(e){return e==="~"?Pae():e.startsWith("~/")?Pae()+e.slice(1):e}function $T(){let e=process.env.AUGMENT_CACHE_DIR;return e?ORn(e):Ov(Pae(),".augment")}function Dr(){let e=process.env[hft];return e?ORn(e):$T()}function Lae(){return Ov(Dr(),"themes")}function MRn(){return Ov(Dr(),"models.json")}function PRn(){return Ov(Dr(),"auth.json")}function DRn(){return Ov(Dr(),"settings.json")}function TA(){return $T()}function rZ(){return Ov(Dr(),"bin")}function BRn(){return Ov(Dr(),Dae)}function LRn(){return Ov(Dr(),`${Jr}-debug.log`)}var Tus,TRn,Jr,Ns,Dae,Bae,RRn,Ius,hs,NRn,kRn,hft,Fs=C(()=>{"use strict";mft();Tus=Cus(import.meta.url),TRn=fft(Tus);Jr=oD.piConfig?.name||"auggie",Ns=oD.piConfig?.configDir||".augment",Dae="sessions-v2",Bae=Jr,RRn="Auggie Coding Agent",Ius="1.2.0-prerelease.202611040910",hs=Ius??oD.version,NRn="2c02c0c37a9ce983fd62e407026f441855626f94",kRn="2026-11-04T17:10:35Z",hft=`${Jr.toUpperCase()}_CODING_AGENT_DIR`});function gft(...e){return new globalThis.Function(...e)}var FRn=C(()=>{});var wRe,RRe,bft,URn=C(()=>{qM();dY();Fr();Vc();wRe=class extends vi{constructor(t){super(`Duplicate type kind '${t}' detected`)}},RRe=class extends vi{constructor(t){super(`Duplicate string format '${t}' detected`)}};(function(e){function t(r,i){if(wp.Has(r))throw new wRe(r);return wp.Set(r,i),(s={})=>hP({...s,[on]:r})}e.Type=t;function n(r,i){if(Yh.Has(r))throw new RRe(r);return Yh.Set(r,i),r}e.Format=n})(bft||(bft={}))});var n4={};li(n4,{Evaluate:()=>gft,TypeSystem:()=>bft,TypeSystemDuplicateFormat:()=>RRe,TypeSystemDuplicateTypeKind:()=>wRe,TypeSystemPolicy:()=>mc});var iZ=C(()=>{FRn();gie();URn()});function VRn(e){switch(e.errorType){case an.ArrayContains:return"Expected array to contain at least one matching value";case an.ArrayMaxContains:return`Expected array to contain no more than ${e.schema.maxContains} matching values`;case an.ArrayMinContains:return`Expected array to contain at least ${e.schema.minContains} matching values`;case an.ArrayMaxItems:return`Expected array length to be less or equal to ${e.schema.maxItems}`;case an.ArrayMinItems:return`Expected array length to be greater or equal to ${e.schema.minItems}`;case an.ArrayUniqueItems:return"Expected array elements to be unique";case an.Array:return"Expected array";case an.AsyncIterator:return"Expected AsyncIterator";case an.BigIntExclusiveMaximum:return`Expected bigint to be less than ${e.schema.exclusiveMaximum}`;case an.BigIntExclusiveMinimum:return`Expected bigint to be greater than ${e.schema.exclusiveMinimum}`;case an.BigIntMaximum:return`Expected bigint to be less or equal to ${e.schema.maximum}`;case an.BigIntMinimum:return`Expected bigint to be greater or equal to ${e.schema.minimum}`;case an.BigIntMultipleOf:return`Expected bigint to be a multiple of ${e.schema.multipleOf}`;case an.BigInt:return"Expected bigint";case an.Boolean:return"Expected boolean";case an.DateExclusiveMinimumTimestamp:return`Expected Date timestamp to be greater than ${e.schema.exclusiveMinimumTimestamp}`;case an.DateExclusiveMaximumTimestamp:return`Expected Date timestamp to be less than ${e.schema.exclusiveMaximumTimestamp}`;case an.DateMinimumTimestamp:return`Expected Date timestamp to be greater or equal to ${e.schema.minimumTimestamp}`;case an.DateMaximumTimestamp:return`Expected Date timestamp to be less or equal to ${e.schema.maximumTimestamp}`;case an.DateMultipleOfTimestamp:return`Expected Date timestamp to be a multiple of ${e.schema.multipleOfTimestamp}`;case an.Date:return"Expected Date";case an.Function:return"Expected function";case an.IntegerExclusiveMaximum:return`Expected integer to be less than ${e.schema.exclusiveMaximum}`;case an.IntegerExclusiveMinimum:return`Expected integer to be greater than ${e.schema.exclusiveMinimum}`;case an.IntegerMaximum:return`Expected integer to be less or equal to ${e.schema.maximum}`;case an.IntegerMinimum:return`Expected integer to be greater or equal to ${e.schema.minimum}`;case an.IntegerMultipleOf:return`Expected integer to be a multiple of ${e.schema.multipleOf}`;case an.Integer:return"Expected integer";case an.IntersectUnevaluatedProperties:return"Unexpected property";case an.Intersect:return"Expected all values to match";case an.Iterator:return"Expected Iterator";case an.Literal:return`Expected ${typeof e.schema.const=="string"?`'${e.schema.const}'`:e.schema.const}`;case an.Never:return"Never";case an.Not:return"Value should not match";case an.Null:return"Expected null";case an.NumberExclusiveMaximum:return`Expected number to be less than ${e.schema.exclusiveMaximum}`;case an.NumberExclusiveMinimum:return`Expected number to be greater than ${e.schema.exclusiveMinimum}`;case an.NumberMaximum:return`Expected number to be less or equal to ${e.schema.maximum}`;case an.NumberMinimum:return`Expected number to be greater or equal to ${e.schema.minimum}`;case an.NumberMultipleOf:return`Expected number to be a multiple of ${e.schema.multipleOf}`;case an.Number:return"Expected number";case an.Object:return"Expected object";case an.ObjectAdditionalProperties:return"Unexpected property";case an.ObjectMaxProperties:return`Expected object to have no more than ${e.schema.maxProperties} properties`;case an.ObjectMinProperties:return`Expected object to have at least ${e.schema.minProperties} properties`;case an.ObjectRequiredProperty:return"Expected required property";case an.Promise:return"Expected Promise";case an.RegExp:return"Expected string to match regular expression";case an.StringFormatUnknown:return`Unknown format '${e.schema.format}'`;case an.StringFormat:return`Expected string to match '${e.schema.format}' format`;case an.StringMaxLength:return`Expected string length less or equal to ${e.schema.maxLength}`;case an.StringMinLength:return`Expected string length greater or equal to ${e.schema.minLength}`;case an.StringPattern:return`Expected string to match '${e.schema.pattern}'`;case an.String:return"Expected string";case an.Symbol:return"Expected symbol";case an.TupleLength:return`Expected tuple to have ${e.schema.maxItems||0} elements`;case an.Tuple:return"Expected tuple";case an.Uint8ArrayMaxByteLength:return`Expected byte length less or equal to ${e.schema.maxByteLength}`;case an.Uint8ArrayMinByteLength:return`Expected byte length greater or equal to ${e.schema.minByteLength}`;case an.Uint8Array:return"Expected Uint8Array";case an.Undefined:return"Expected undefined";case an.Union:return"Expected union value";case an.Void:return"Expected void";case an.Kind:return`Expected kind '${e.schema[on]}'`;default:return"Unknown error type"}}function wus(e){GRn=e}function yft(){return GRn}var GRn,Aft=C(()=>{Fr();Eft();GRn=VRn});function Rus(e,t){let n=t.find(r=>r.$id===e.$ref);if(n===void 0)throw new _ft(e);return aa(n,t)}function Gm(e,t){return!Lo(e.$id)||t.some(n=>n.$id===e.$id)||t.push(e),t}function aa(e,t){return e[on]==="This"||e[on]==="Ref"?Rus(e,t):e}var _ft,WRn=C(()=>{Vc();Fr();Hve();_ft=class extends vi{constructor(t){super(`Unable to dereference schema with $id '${t.$ref}'`),this.schema=t}}});var rS=C(()=>{WRn()});function*Mus(e){let t=e===0?1:Math.ceil(Math.floor(Math.log2(e)+1)/8);for(let n=0;n<t;n++)yield e>>8*(t-1-n)&255}function Pus(e){ng(IA.Array);for(let t of e)oZ(t)}function Dus(e){ng(IA.Boolean),ng(e?1:0)}function Bus(e){ng(IA.BigInt),QRn.setBigInt64(0,e);for(let t of YRn)ng(t)}function Lus(e){ng(IA.Date),oZ(e.getTime())}function Fus(e){ng(IA.Null)}function Uus(e){ng(IA.Number),QRn.setFloat64(0,e);for(let t of YRn)ng(t)}function Vus(e){ng(IA.Object);for(let t of globalThis.Object.getOwnPropertyNames(e).sort())oZ(t),oZ(e[t])}function Gus(e){ng(IA.String);for(let t=0;t<e.length;t++)for(let n of Mus(e.charCodeAt(t)))ng(n)}function Wus(e){ng(IA.Symbol),oZ(e.description)}function $us(e){ng(IA.Uint8Array);for(let t=0;t<e.length;t++)ng(e[t])}function Qus(e){return ng(IA.Undefined)}function oZ(e){if(wi(e))return Pus(e);if(hv(e))return Dus(e);if(Bm(e))return Bus(e);if(Wh(e))return Lus(e);if(rT(e))return Fus(e);if(pi(e))return Uus(e);if(ps(e))return Vus(e);if(Lo(e))return Gus(e);if(sT(e))return Wus(e);if(PU(e))return $us(e);if(Nc(e))return Qus(e);throw new NRe(e)}function ng(e){sZ=sZ^Ous[e],sZ=sZ*Nus%kus}function HN(e){return sZ=BigInt("14695981039346656037"),oZ(e),sZ}var NRe,IA,sZ,Nus,kus,Ous,$Rn,QRn,YRn,HRn=C(()=>{Ip();Vc();NRe=class extends vi{constructor(t){super("Unable to hash value"),this.value=t}};(function(e){e[e.Undefined=0]="Undefined",e[e.Null=1]="Null",e[e.Boolean=2]="Boolean",e[e.Number=3]="Number",e[e.String=4]="String",e[e.Object=5]="Object",e[e.Array=6]="Array",e[e.Date=7]="Date",e[e.Uint8Array=8]="Uint8Array",e[e.Symbol=9]="Symbol",e[e.BigInt=10]="BigInt"})(IA||(IA={}));sZ=BigInt("14695981039346656037"),[Nus,kus]=[BigInt("1099511628211"),BigInt("18446744073709551616")],Ous=Array.from({length:256}).map((e,t)=>BigInt(t)),$Rn=new Float64Array(1),QRn=new DataView($Rn.buffer),YRn=new Uint8Array($Rn.buffer)});var aZ=C(()=>{HRn()});function Yus(e){return e[on]==="Any"||e[on]==="Unknown"}function Fo(e){return e!==void 0}function Hus(e,t,n){return!0}function Zus(e,t,n){return!0}function jus(e,t,n){if(!wi(n)||Fo(e.minItems)&&!(n.length>=e.minItems)||Fo(e.maxItems)&&!(n.length<=e.maxItems))return!1;for(let s of n)if(!Wm(e.items,t,s))return!1;if(e.uniqueItems===!0&&!(function(){let s=new Set;for(let o of n){let a=HN(o);if(s.has(a))return!1;s.add(a)}return!0})())return!1;if(!(Fo(e.contains)||pi(e.minContains)||pi(e.maxContains)))return!0;let r=Fo(e.contains)?e.contains:Gi(),i=n.reduce((s,o)=>Wm(r,t,o)?s+1:s,0);return!(i===0||pi(e.minContains)&&i<e.minContains||pi(e.maxContains)&&i>e.maxContains)}function zus(e,t,n){return pie(n)}function Xus(e,t,n){return!(!Bm(n)||Fo(e.exclusiveMaximum)&&!(n<e.exclusiveMaximum)||Fo(e.exclusiveMinimum)&&!(n>e.exclusiveMinimum)||Fo(e.maximum)&&!(n<=e.maximum)||Fo(e.minimum)&&!(n>=e.minimum)||Fo(e.multipleOf)&&n%e.multipleOf!==BigInt(0))}function Kus(e,t,n){return hv(n)}function qus(e,t,n){return Wm(e.returns,t,n.prototype)}function Jus(e,t,n){return!(!Wh(n)||Fo(e.exclusiveMaximumTimestamp)&&!(n.getTime()<e.exclusiveMaximumTimestamp)||Fo(e.exclusiveMinimumTimestamp)&&!(n.getTime()>e.exclusiveMinimumTimestamp)||Fo(e.maximumTimestamp)&&!(n.getTime()<=e.maximumTimestamp)||Fo(e.minimumTimestamp)&&!(n.getTime()>=e.minimumTimestamp)||Fo(e.multipleOfTimestamp)&&n.getTime()%e.multipleOfTimestamp!==0)}function eds(e,t,n){return iT(n)}function tds(e,t,n){let r=globalThis.Object.values(e.$defs),i=e.$defs[e.$ref];return Wm(i,[...t,...r],n)}function nds(e,t,n){return!(!hie(n)||Fo(e.exclusiveMaximum)&&!(n<e.exclusiveMaximum)||Fo(e.exclusiveMinimum)&&!(n>e.exclusiveMinimum)||Fo(e.maximum)&&!(n<=e.maximum)||Fo(e.minimum)&&!(n>=e.minimum)||Fo(e.multipleOf)&&n%e.multipleOf!==0)}function rds(e,t,n){let r=e.allOf.every(i=>Wm(i,t,n));if(e.unevaluatedProperties===!1){let i=new RegExp(bv(e)),s=Object.getOwnPropertyNames(n).every(o=>i.test(o));return r&&s}else if(Gc(e.unevaluatedProperties)){let i=new RegExp(bv(e)),s=Object.getOwnPropertyNames(n).every(o=>i.test(o)||Wm(e.unevaluatedProperties,t,n[o]));return r&&s}else return r}function ids(e,t,n){return mie(n)}function sds(e,t,n){return n===e.const}function ods(e,t,n){return!1}function ads(e,t,n){return!Wm(e.not,t,n)}function lds(e,t,n){return rT(n)}function cds(e,t,n){return!(!mc.IsNumberLike(n)||Fo(e.exclusiveMaximum)&&!(n<e.exclusiveMaximum)||Fo(e.exclusiveMinimum)&&!(n>e.exclusiveMinimum)||Fo(e.minimum)&&!(n>=e.minimum)||Fo(e.maximum)&&!(n<=e.maximum)||Fo(e.multipleOf)&&n%e.multipleOf!==0)}function uds(e,t,n){if(!mc.IsObjectLike(n)||Fo(e.minProperties)&&!(Object.getOwnPropertyNames(n).length>=e.minProperties)||Fo(e.maxProperties)&&!(Object.getOwnPropertyNames(n).length<=e.maxProperties))return!1;let r=Object.getOwnPropertyNames(e.properties);for(let i of r){let s=e.properties[i];if(e.required&&e.required.includes(i)){if(!Wm(s,t,n[i])||(yv(s)||Yus(s))&&!(i in n))return!1}else if(mc.IsExactOptionalProperty(n,i)&&!Wm(s,t,n[i]))return!1}if(e.additionalProperties===!1){let i=Object.getOwnPropertyNames(n);return e.required&&e.required.length===r.length&&i.length===r.length?!0:i.every(s=>r.includes(s))}else return typeof e.additionalProperties=="object"?Object.getOwnPropertyNames(n).every(s=>r.includes(s)||Wm(e.additionalProperties,t,n[s])):!0}function dds(e,t,n){return fie(n)}function pds(e,t,n){if(!mc.IsRecordLike(n)||Fo(e.minProperties)&&!(Object.getOwnPropertyNames(n).length>=e.minProperties)||Fo(e.maxProperties)&&!(Object.getOwnPropertyNames(n).length<=e.maxProperties))return!1;let[r,i]=Object.entries(e.patternProperties)[0],s=new RegExp(r),o=Object.entries(n).every(([u,c])=>s.test(u)?Wm(i,t,c):!0),a=typeof e.additionalProperties=="object"?Object.entries(n).every(([u,c])=>s.test(u)?!0:Wm(e.additionalProperties,t,c)):!0,l=e.additionalProperties===!1?Object.getOwnPropertyNames(n).every(u=>s.test(u)):!0;return o&&a&&l}function mds(e,t,n){return Wm(aa(e,t),t,n)}function fds(e,t,n){let r=new RegExp(e.source,e.flags);return Fo(e.minLength)&&!(n.length>=e.minLength)||Fo(e.maxLength)&&!(n.length<=e.maxLength)?!1:r.test(n)}function hds(e,t,n){return!Lo(n)||Fo(e.minLength)&&!(n.length>=e.minLength)||Fo(e.maxLength)&&!(n.length<=e.maxLength)||Fo(e.pattern)&&!new RegExp(e.pattern).test(n)?!1:Fo(e.format)?Yh.Has(e.format)?Yh.Get(e.format)(n):!1:!0}function gds(e,t,n){return sT(n)}function bds(e,t,n){return Lo(n)&&new RegExp(e.pattern).test(n)}function yds(e,t,n){return Wm(aa(e,t),t,n)}function Ads(e,t,n){if(!wi(n)||e.items===void 0&&n.length!==0||n.length!==e.maxItems)return!1;if(!e.items)return!0;for(let r=0;r<e.items.length;r++)if(!Wm(e.items[r],t,n[r]))return!1;return!0}function Eds(e,t,n){return Nc(n)}function _ds(e,t,n){return e.anyOf.some(r=>Wm(r,t,n))}function Sds(e,t,n){return!(!PU(n)||Fo(e.maxByteLength)&&!(n.length<=e.maxByteLength)||Fo(e.minByteLength)&&!(n.length>=e.minByteLength))}function vds(e,t,n){return!0}function xds(e,t,n){return mc.IsVoidLike(n)}function Cds(e,t,n){return wp.Has(e[on])?wp.Get(e[on])(e,n):!1}function Wm(e,t,n){let r=Fo(e.$id)?Gm(e,t):t,i=e;switch(i[on]){case"Any":return Hus(i,r,n);case"Argument":return Zus(i,r,n);case"Array":return jus(i,r,n);case"AsyncIterator":return zus(i,r,n);case"BigInt":return Xus(i,r,n);case"Boolean":return Kus(i,r,n);case"Constructor":return qus(i,r,n);case"Date":return Jus(i,r,n);case"Function":return eds(i,r,n);case"Import":return tds(i,r,n);case"Integer":return nds(i,r,n);case"Intersect":return rds(i,r,n);case"Iterator":return ids(i,r,n);case"Literal":return sds(i,r,n);case"Never":return ods(i,r,n);case"Not":return ads(i,r,n);case"Null":return lds(i,r,n);case"Number":return cds(i,r,n);case"Object":return uds(i,r,n);case"Promise":return dds(i,r,n);case"Record":return pds(i,r,n);case"Ref":return mds(i,r,n);case"RegExp":return fds(i,r,n);case"String":return hds(i,r,n);case"Symbol":return gds(i,r,n);case"TemplateLiteral":return bds(i,r,n);case"This":return yds(i,r,n);case"Tuple":return Ads(i,r,n);case"Undefined":return Eds(i,r,n);case"Union":return _ds(i,r,n);case"Uint8Array":return Sds(i,r,n);case"Unknown":return vds(i,r,n);case"Void":return xds(i,r,n);default:if(!wp.Has(i[on]))throw new kRe(i);return Cds(i,r,n)}}function Us(...e){return e.length===3?Wm(e[0],e[1],e[2]):Wm(e[0],[],e[1])}var kRe,Sft=C(()=>{iZ();rS();aZ();Fr();pA();sP();qM();Vc();fd();Ip();Ks();kRe=class extends vi{constructor(t){super("Unknown type"),this.schema=t}}});var wA=C(()=>{Sft()});function ZN(e){return e.replace(/~/g,"~0").replace(/\//g,"~1")}function Uo(e){return e!==void 0}function br(e,t,n,r,i=[]){return{type:e,schema:t,path:n,value:r,message:yft()({errorType:e,path:n,schema:t,value:r,errors:i}),errors:i}}function*Tds(e,t,n,r){}function*Ids(e,t,n,r){}function*wds(e,t,n,r){if(!wi(r))return yield br(an.Array,e,n,r);Uo(e.minItems)&&!(r.length>=e.minItems)&&(yield br(an.ArrayMinItems,e,n,r)),Uo(e.maxItems)&&!(r.length<=e.maxItems)&&(yield br(an.ArrayMaxItems,e,n,r));for(let o=0;o<r.length;o++)yield*$m(e.items,t,`${n}/${o}`,r[o]);if(e.uniqueItems===!0&&!(function(){let o=new Set;for(let a of r){let l=HN(a);if(o.has(l))return!1;o.add(l)}return!0})()&&(yield br(an.ArrayUniqueItems,e,n,r)),!(Uo(e.contains)||Uo(e.minContains)||Uo(e.maxContains)))return;let i=Uo(e.contains)?e.contains:Gi(),s=r.reduce((o,a,l)=>$m(i,t,`${n}${l}`,a).next().done===!0?o+1:o,0);s===0&&(yield br(an.ArrayContains,e,n,r)),pi(e.minContains)&&s<e.minContains&&(yield br(an.ArrayMinContains,e,n,r)),pi(e.maxContains)&&s>e.maxContains&&(yield br(an.ArrayMaxContains,e,n,r))}function*Rds(e,t,n,r){pie(r)||(yield br(an.AsyncIterator,e,n,r))}function*Nds(e,t,n,r){if(!Bm(r))return yield br(an.BigInt,e,n,r);Uo(e.exclusiveMaximum)&&!(r<e.exclusiveMaximum)&&(yield br(an.BigIntExclusiveMaximum,e,n,r)),Uo(e.exclusiveMinimum)&&!(r>e.exclusiveMinimum)&&(yield br(an.BigIntExclusiveMinimum,e,n,r)),Uo(e.maximum)&&!(r<=e.maximum)&&(yield br(an.BigIntMaximum,e,n,r)),Uo(e.minimum)&&!(r>=e.minimum)&&(yield br(an.BigIntMinimum,e,n,r)),Uo(e.multipleOf)&&r%e.multipleOf!==BigInt(0)&&(yield br(an.BigIntMultipleOf,e,n,r))}function*kds(e,t,n,r){hv(r)||(yield br(an.Boolean,e,n,r))}function*Ods(e,t,n,r){yield*$m(e.returns,t,n,r.prototype)}function*Mds(e,t,n,r){if(!Wh(r))return yield br(an.Date,e,n,r);Uo(e.exclusiveMaximumTimestamp)&&!(r.getTime()<e.exclusiveMaximumTimestamp)&&(yield br(an.DateExclusiveMaximumTimestamp,e,n,r)),Uo(e.exclusiveMinimumTimestamp)&&!(r.getTime()>e.exclusiveMinimumTimestamp)&&(yield br(an.DateExclusiveMinimumTimestamp,e,n,r)),Uo(e.maximumTimestamp)&&!(r.getTime()<=e.maximumTimestamp)&&(yield br(an.DateMaximumTimestamp,e,n,r)),Uo(e.minimumTimestamp)&&!(r.getTime()>=e.minimumTimestamp)&&(yield br(an.DateMinimumTimestamp,e,n,r)),Uo(e.multipleOfTimestamp)&&r.getTime()%e.multipleOfTimestamp!==0&&(yield br(an.DateMultipleOfTimestamp,e,n,r))}function*Pds(e,t,n,r){iT(r)||(yield br(an.Function,e,n,r))}function*Dds(e,t,n,r){let i=globalThis.Object.values(e.$defs),s=e.$defs[e.$ref];yield*$m(s,[...t,...i],n,r)}function*Bds(e,t,n,r){if(!hie(r))return yield br(an.Integer,e,n,r);Uo(e.exclusiveMaximum)&&!(r<e.exclusiveMaximum)&&(yield br(an.IntegerExclusiveMaximum,e,n,r)),Uo(e.exclusiveMinimum)&&!(r>e.exclusiveMinimum)&&(yield br(an.IntegerExclusiveMinimum,e,n,r)),Uo(e.maximum)&&!(r<=e.maximum)&&(yield br(an.IntegerMaximum,e,n,r)),Uo(e.minimum)&&!(r>=e.minimum)&&(yield br(an.IntegerMinimum,e,n,r)),Uo(e.multipleOf)&&r%e.multipleOf!==0&&(yield br(an.IntegerMultipleOf,e,n,r))}function*Lds(e,t,n,r){let i=!1;for(let s of e.allOf)for(let o of $m(s,t,n,r))i=!0,yield o;if(i)return yield br(an.Intersect,e,n,r);if(e.unevaluatedProperties===!1){let s=new RegExp(bv(e));for(let o of Object.getOwnPropertyNames(r))s.test(o)||(yield br(an.IntersectUnevaluatedProperties,e,`${n}/${o}`,r))}if(typeof e.unevaluatedProperties=="object"){let s=new RegExp(bv(e));for(let o of Object.getOwnPropertyNames(r))if(!s.test(o)){let a=$m(e.unevaluatedProperties,t,`${n}/${o}`,r[o]).next();a.done||(yield a.value)}}}function*Fds(e,t,n,r){mie(r)||(yield br(an.Iterator,e,n,r))}function*Uds(e,t,n,r){r!==e.const&&(yield br(an.Literal,e,n,r))}function*Vds(e,t,n,r){yield br(an.Never,e,n,r)}function*Gds(e,t,n,r){$m(e.not,t,n,r).next().done===!0&&(yield br(an.Not,e,n,r))}function*Wds(e,t,n,r){rT(r)||(yield br(an.Null,e,n,r))}function*$ds(e,t,n,r){if(!mc.IsNumberLike(r))return yield br(an.Number,e,n,r);Uo(e.exclusiveMaximum)&&!(r<e.exclusiveMaximum)&&(yield br(an.NumberExclusiveMaximum,e,n,r)),Uo(e.exclusiveMinimum)&&!(r>e.exclusiveMinimum)&&(yield br(an.NumberExclusiveMinimum,e,n,r)),Uo(e.maximum)&&!(r<=e.maximum)&&(yield br(an.NumberMaximum,e,n,r)),Uo(e.minimum)&&!(r>=e.minimum)&&(yield br(an.NumberMinimum,e,n,r)),Uo(e.multipleOf)&&r%e.multipleOf!==0&&(yield br(an.NumberMultipleOf,e,n,r))}function*Qds(e,t,n,r){if(!mc.IsObjectLike(r))return yield br(an.Object,e,n,r);Uo(e.minProperties)&&!(Object.getOwnPropertyNames(r).length>=e.minProperties)&&(yield br(an.ObjectMinProperties,e,n,r)),Uo(e.maxProperties)&&!(Object.getOwnPropertyNames(r).length<=e.maxProperties)&&(yield br(an.ObjectMaxProperties,e,n,r));let i=Array.isArray(e.required)?e.required:[],s=Object.getOwnPropertyNames(e.properties),o=Object.getOwnPropertyNames(r);for(let a of i)o.includes(a)||(yield br(an.ObjectRequiredProperty,e.properties[a],`${n}/${ZN(a)}`,void 0));if(e.additionalProperties===!1)for(let a of o)s.includes(a)||(yield br(an.ObjectAdditionalProperties,e,`${n}/${ZN(a)}`,r[a]));if(typeof e.additionalProperties=="object")for(let a of o)s.includes(a)||(yield*$m(e.additionalProperties,t,`${n}/${ZN(a)}`,r[a]));for(let a of s){let l=e.properties[a];e.required&&e.required.includes(a)?(yield*$m(l,t,`${n}/${ZN(a)}`,r[a]),yv(e)&&!(a in r)&&(yield br(an.ObjectRequiredProperty,l,`${n}/${ZN(a)}`,void 0))):mc.IsExactOptionalProperty(r,a)&&(yield*$m(l,t,`${n}/${ZN(a)}`,r[a]))}}function*Yds(e,t,n,r){fie(r)||(yield br(an.Promise,e,n,r))}function*Hds(e,t,n,r){if(!mc.IsRecordLike(r))return yield br(an.Object,e,n,r);Uo(e.minProperties)&&!(Object.getOwnPropertyNames(r).length>=e.minProperties)&&(yield br(an.ObjectMinProperties,e,n,r)),Uo(e.maxProperties)&&!(Object.getOwnPropertyNames(r).length<=e.maxProperties)&&(yield br(an.ObjectMaxProperties,e,n,r));let[i,s]=Object.entries(e.patternProperties)[0],o=new RegExp(i);for(let[a,l]of Object.entries(r))o.test(a)&&(yield*$m(s,t,`${n}/${ZN(a)}`,l));if(typeof e.additionalProperties=="object")for(let[a,l]of Object.entries(r))o.test(a)||(yield*$m(e.additionalProperties,t,`${n}/${ZN(a)}`,l));if(e.additionalProperties===!1){for(let[a,l]of Object.entries(r))if(!o.test(a))return yield br(an.ObjectAdditionalProperties,e,`${n}/${ZN(a)}`,l)}}function*Zds(e,t,n,r){yield*$m(aa(e,t),t,n,r)}function*jds(e,t,n,r){if(!Lo(r))return yield br(an.String,e,n,r);if(Uo(e.minLength)&&!(r.length>=e.minLength)&&(yield br(an.StringMinLength,e,n,r)),Uo(e.maxLength)&&!(r.length<=e.maxLength)&&(yield br(an.StringMaxLength,e,n,r)),!new RegExp(e.source,e.flags).test(r))return yield br(an.RegExp,e,n,r)}function*zds(e,t,n,r){if(!Lo(r))return yield br(an.String,e,n,r);Uo(e.minLength)&&!(r.length>=e.minLength)&&(yield br(an.StringMinLength,e,n,r)),Uo(e.maxLength)&&!(r.length<=e.maxLength)&&(yield br(an.StringMaxLength,e,n,r)),Lo(e.pattern)&&(new RegExp(e.pattern).test(r)||(yield br(an.StringPattern,e,n,r))),Lo(e.format)&&(Yh.Has(e.format)?Yh.Get(e.format)(r)||(yield br(an.StringFormat,e,n,r)):yield br(an.StringFormatUnknown,e,n,r))}function*Xds(e,t,n,r){sT(r)||(yield br(an.Symbol,e,n,r))}function*Kds(e,t,n,r){if(!Lo(r))return yield br(an.String,e,n,r);new RegExp(e.pattern).test(r)||(yield br(an.StringPattern,e,n,r))}function*qds(e,t,n,r){yield*$m(aa(e,t),t,n,r)}function*Jds(e,t,n,r){if(!wi(r))return yield br(an.Tuple,e,n,r);if(e.items===void 0&&r.length!==0)return yield br(an.TupleLength,e,n,r);if(r.length!==e.maxItems)return yield br(an.TupleLength,e,n,r);if(e.items)for(let i=0;i<e.items.length;i++)yield*$m(e.items[i],t,`${n}/${i}`,r[i])}function*eps(e,t,n,r){Nc(r)||(yield br(an.Undefined,e,n,r))}function*tps(e,t,n,r){if(Us(e,t,r))return;let i=e.anyOf.map(s=>new RA($m(s,t,n,r)));yield br(an.Union,e,n,r,i)}function*nps(e,t,n,r){if(!PU(r))return yield br(an.Uint8Array,e,n,r);Uo(e.maxByteLength)&&!(r.length<=e.maxByteLength)&&(yield br(an.Uint8ArrayMaxByteLength,e,n,r)),Uo(e.minByteLength)&&!(r.length>=e.minByteLength)&&(yield br(an.Uint8ArrayMinByteLength,e,n,r))}function*rps(e,t,n,r){}function*ips(e,t,n,r){mc.IsVoidLike(r)||(yield br(an.Void,e,n,r))}function*sps(e,t,n,r){wp.Get(e[on])(e,r)||(yield br(an.Kind,e,n,r))}function*$m(e,t,n,r){let i=Uo(e.$id)?[...t,e]:t,s=e;switch(s[on]){case"Any":return yield*Tds(s,i,n,r);case"Argument":return yield*Ids(s,i,n,r);case"Array":return yield*wds(s,i,n,r);case"AsyncIterator":return yield*Rds(s,i,n,r);case"BigInt":return yield*Nds(s,i,n,r);case"Boolean":return yield*kds(s,i,n,r);case"Constructor":return yield*Ods(s,i,n,r);case"Date":return yield*Mds(s,i,n,r);case"Function":return yield*Pds(s,i,n,r);case"Import":return yield*Dds(s,i,n,r);case"Integer":return yield*Bds(s,i,n,r);case"Intersect":return yield*Lds(s,i,n,r);case"Iterator":return yield*Fds(s,i,n,r);case"Literal":return yield*Uds(s,i,n,r);case"Never":return yield*Vds(s,i,n,r);case"Not":return yield*Gds(s,i,n,r);case"Null":return yield*Wds(s,i,n,r);case"Number":return yield*$ds(s,i,n,r);case"Object":return yield*Qds(s,i,n,r);case"Promise":return yield*Yds(s,i,n,r);case"Record":return yield*Hds(s,i,n,r);case"Ref":return yield*Zds(s,i,n,r);case"RegExp":return yield*jds(s,i,n,r);case"String":return yield*zds(s,i,n,r);case"Symbol":return yield*Xds(s,i,n,r);case"TemplateLiteral":return yield*Kds(s,i,n,r);case"This":return yield*qds(s,i,n,r);case"Tuple":return yield*Jds(s,i,n,r);case"Undefined":return yield*eps(s,i,n,r);case"Union":return yield*tps(s,i,n,r);case"Uint8Array":return yield*nps(s,i,n,r);case"Unknown":return yield*rps(s,i,n,r);case"Void":return yield*ips(s,i,n,r);default:if(!wp.Has(s[on]))throw new ORe(e);return yield*sps(s,i,n,r)}}function Mv(...e){let t=e.length===3?$m(e[0],e[1],"",e[2]):$m(e[0],[],"",e[1]);return new RA(t)}var an,ORe,RA,Eft=C(()=>{iZ();pA();qM();Exe();Aft();Vc();rS();aZ();wA();Fr();fd();Ip();(function(e){e[e.ArrayContains=0]="ArrayContains",e[e.ArrayMaxContains=1]="ArrayMaxContains",e[e.ArrayMaxItems=2]="ArrayMaxItems",e[e.ArrayMinContains=3]="ArrayMinContains",e[e.ArrayMinItems=4]="ArrayMinItems",e[e.ArrayUniqueItems=5]="ArrayUniqueItems",e[e.Array=6]="Array",e[e.AsyncIterator=7]="AsyncIterator",e[e.BigIntExclusiveMaximum=8]="BigIntExclusiveMaximum",e[e.BigIntExclusiveMinimum=9]="BigIntExclusiveMinimum",e[e.BigIntMaximum=10]="BigIntMaximum",e[e.BigIntMinimum=11]="BigIntMinimum",e[e.BigIntMultipleOf=12]="BigIntMultipleOf",e[e.BigInt=13]="BigInt",e[e.Boolean=14]="Boolean",e[e.DateExclusiveMaximumTimestamp=15]="DateExclusiveMaximumTimestamp",e[e.DateExclusiveMinimumTimestamp=16]="DateExclusiveMinimumTimestamp",e[e.DateMaximumTimestamp=17]="DateMaximumTimestamp",e[e.DateMinimumTimestamp=18]="DateMinimumTimestamp",e[e.DateMultipleOfTimestamp=19]="DateMultipleOfTimestamp",e[e.Date=20]="Date",e[e.Function=21]="Function",e[e.IntegerExclusiveMaximum=22]="IntegerExclusiveMaximum",e[e.IntegerExclusiveMinimum=23]="IntegerExclusiveMinimum",e[e.IntegerMaximum=24]="IntegerMaximum",e[e.IntegerMinimum=25]="IntegerMinimum",e[e.IntegerMultipleOf=26]="IntegerMultipleOf",e[e.Integer=27]="Integer",e[e.IntersectUnevaluatedProperties=28]="IntersectUnevaluatedProperties",e[e.Intersect=29]="Intersect",e[e.Iterator=30]="Iterator",e[e.Kind=31]="Kind",e[e.Literal=32]="Literal",e[e.Never=33]="Never",e[e.Not=34]="Not",e[e.Null=35]="Null",e[e.NumberExclusiveMaximum=36]="NumberExclusiveMaximum",e[e.NumberExclusiveMinimum=37]="NumberExclusiveMinimum",e[e.NumberMaximum=38]="NumberMaximum",e[e.NumberMinimum=39]="NumberMinimum",e[e.NumberMultipleOf=40]="NumberMultipleOf",e[e.Number=41]="Number",e[e.ObjectAdditionalProperties=42]="ObjectAdditionalProperties",e[e.ObjectMaxProperties=43]="ObjectMaxProperties",e[e.ObjectMinProperties=44]="ObjectMinProperties",e[e.ObjectRequiredProperty=45]="ObjectRequiredProperty",e[e.Object=46]="Object",e[e.Promise=47]="Promise",e[e.RegExp=48]="RegExp",e[e.StringFormatUnknown=49]="StringFormatUnknown",e[e.StringFormat=50]="StringFormat",e[e.StringMaxLength=51]="StringMaxLength",e[e.StringMinLength=52]="StringMinLength",e[e.StringPattern=53]="StringPattern",e[e.String=54]="String",e[e.Symbol=55]="Symbol",e[e.TupleLength=56]="TupleLength",e[e.Tuple=57]="Tuple",e[e.Uint8ArrayMaxByteLength=58]="Uint8ArrayMaxByteLength",e[e.Uint8ArrayMinByteLength=59]="Uint8ArrayMinByteLength",e[e.Uint8Array=60]="Uint8Array",e[e.Undefined=61]="Undefined",e[e.Union=62]="Union",e[e.Void=63]="Void"})(an||(an={}));ORe=class extends vi{constructor(t){super("Unknown type"),this.schema=t}};RA=class{constructor(t){this.iterator=t}[Symbol.iterator](){return this.iterator}First(){let t=this.iterator.next();return t.done?void 0:t.value}}});var r4={};li(r4,{DefaultErrorFunction:()=>VRn,Errors:()=>Mv,GetErrorFunction:()=>yft,SetErrorFunction:()=>wus,ValueErrorIterator:()=>RA,ValueErrorType:()=>an,ValueErrorsUnknownTypeError:()=>ORe});var QT=C(()=>{Eft();Aft()});function _u(e,t,n){try{return fa(e)?e[kc].Decode(n):n}catch(r){throw new MRe(e,t,n,r)}}function ops(e,t,n,r){return wi(r)?_u(e,n,r.map((i,s)=>Pv(e.items,t,`${n}/${s}`,i))):_u(e,n,r)}function aps(e,t,n,r){if(!ps(r)||Ry(r))return _u(e,n,r);let i=W7(e),s=i.map(c=>c[0]),o={...r};for(let[c,d]of i)c in o&&(o[c]=Pv(d,t,`${n}/${c}`,o[c]));if(!fa(e.unevaluatedProperties))return _u(e,n,o);let a=Object.getOwnPropertyNames(o),l=e.unevaluatedProperties,u={...o};for(let c of a)s.includes(c)||(u[c]=_u(l,`${n}/${c}`,u[c]));return _u(e,n,u)}function lps(e,t,n,r){let i=globalThis.Object.values(e.$defs),s=e.$defs[e.$ref],o=Pv(s,[...t,...i],n,r);return _u(e,n,o)}function cps(e,t,n,r){return _u(e,n,Pv(e.not,t,n,r))}function ups(e,t,n,r){if(!ps(r))return _u(e,n,r);let i=zh(e),s={...r};for(let u of i)Vi(s,u)&&(Nc(s[u])&&(!lT(e.properties[u])||mc.IsExactOptionalProperty(s,u))||(s[u]=Pv(e.properties[u],t,`${n}/${u}`,s[u])));if(!Gc(e.additionalProperties))return _u(e,n,s);let o=Object.getOwnPropertyNames(s),a=e.additionalProperties,l={...s};for(let u of o)i.includes(u)||(l[u]=_u(a,`${n}/${u}`,l[u]));return _u(e,n,l)}function dps(e,t,n,r){if(!ps(r))return _u(e,n,r);let i=Object.getOwnPropertyNames(e.patternProperties)[0],s=new RegExp(i),o={...r};for(let c of Object.getOwnPropertyNames(r))s.test(c)&&(o[c]=Pv(e.patternProperties[i],t,`${n}/${c}`,o[c]));if(!Gc(e.additionalProperties))return _u(e,n,o);let a=Object.getOwnPropertyNames(o),l=e.additionalProperties,u={...o};for(let c of a)s.test(c)||(u[c]=_u(l,`${n}/${c}`,u[c]));return _u(e,n,u)}function pps(e,t,n,r){let i=aa(e,t);return _u(e,n,Pv(i,t,n,r))}function mps(e,t,n,r){let i=aa(e,t);return _u(e,n,Pv(i,t,n,r))}function fps(e,t,n,r){return wi(r)&&wi(e.items)?_u(e,n,e.items.map((i,s)=>Pv(i,t,`${n}/${s}`,r[s]))):_u(e,n,r)}function hps(e,t,n,r){for(let i of e.anyOf){if(!Us(i,t,r))continue;let s=Pv(i,t,n,r);return _u(e,n,s)}return _u(e,n,r)}function Pv(e,t,n,r){let i=Gm(e,t),s=e;switch(e[on]){case"Array":return ops(s,i,n,r);case"Import":return lps(s,i,n,r);case"Intersect":return aps(s,i,n,r);case"Not":return cps(s,i,n,r);case"Object":return ups(s,i,n,r);case"Record":return dps(s,i,n,r);case"Ref":return pps(s,i,n,r);case"Symbol":return _u(s,n,r);case"This":return mps(s,i,n,r);case"Tuple":return fps(s,i,n,r);case"Union":return hps(s,i,n,r);default:return _u(s,n,r)}}function s4(e,t,n){return Pv(e,t,"",n)}var i4,MRe,ZRn=C(()=>{gie();Fr();Vc();pA();rS();wA();Ip();Ks();i4=class extends vi{constructor(t,n,r){super("Unable to decode value as it does not match the expected schema"),this.schema=t,this.value=n,this.error=r}},MRe=class extends vi{constructor(t,n,r,i){super(i instanceof Error?i.message:"Unknown error"),this.schema=t,this.path=n,this.value=r,this.error=i}}});function Kf(e,t,n){try{return fa(e)?e[kc].Encode(n):n}catch(r){throw new PRe(e,t,n,r)}}function gps(e,t,n,r){let i=Kf(e,n,r);return wi(i)?i.map((s,o)=>Dv(e.items,t,`${n}/${o}`,s)):i}function bps(e,t,n,r){let i=globalThis.Object.values(e.$defs),s=e.$defs[e.$ref],o=Kf(e,n,r);return Dv(s,[...t,...i],n,o)}function yps(e,t,n,r){let i=Kf(e,n,r);if(!ps(r)||Ry(r))return i;let s=W7(e),o=s.map(d=>d[0]),a={...i};for(let[d,p]of s)d in a&&(a[d]=Dv(p,t,`${n}/${d}`,a[d]));if(!fa(e.unevaluatedProperties))return a;let l=Object.getOwnPropertyNames(a),u=e.unevaluatedProperties,c={...a};for(let d of l)o.includes(d)||(c[d]=Kf(u,`${n}/${d}`,c[d]));return c}function Aps(e,t,n,r){return Kf(e.not,n,Kf(e,n,r))}function Eps(e,t,n,r){let i=Kf(e,n,r);if(!ps(i))return i;let s=zh(e),o={...i};for(let c of s)Vi(o,c)&&(Nc(o[c])&&(!lT(e.properties[c])||mc.IsExactOptionalProperty(o,c))||(o[c]=Dv(e.properties[c],t,`${n}/${c}`,o[c])));if(!Gc(e.additionalProperties))return o;let a=Object.getOwnPropertyNames(o),l=e.additionalProperties,u={...o};for(let c of a)s.includes(c)||(u[c]=Kf(l,`${n}/${c}`,u[c]));return u}function _ps(e,t,n,r){let i=Kf(e,n,r);if(!ps(r))return i;let s=Object.getOwnPropertyNames(e.patternProperties)[0],o=new RegExp(s),a={...i};for(let d of Object.getOwnPropertyNames(r))o.test(d)&&(a[d]=Dv(e.patternProperties[s],t,`${n}/${d}`,a[d]));if(!Gc(e.additionalProperties))return a;let l=Object.getOwnPropertyNames(a),u=e.additionalProperties,c={...a};for(let d of l)o.test(d)||(c[d]=Kf(u,`${n}/${d}`,c[d]));return c}function Sps(e,t,n,r){let i=aa(e,t),s=Dv(i,t,n,r);return Kf(e,n,s)}function vps(e,t,n,r){let i=aa(e,t),s=Dv(i,t,n,r);return Kf(e,n,s)}function xps(e,t,n,r){let i=Kf(e,n,r);return wi(e.items)?e.items.map((s,o)=>Dv(s,t,`${n}/${o}`,i[o])):[]}function Cps(e,t,n,r){for(let i of e.anyOf){if(!Us(i,t,r))continue;let s=Dv(i,t,n,r);return Kf(e,n,s)}for(let i of e.anyOf){let s=Dv(i,t,n,r);if(Us(e,t,s))return Kf(e,n,s)}return Kf(e,n,r)}function Dv(e,t,n,r){let i=Gm(e,t),s=e;switch(e[on]){case"Array":return gps(s,i,n,r);case"Import":return bps(s,i,n,r);case"Intersect":return yps(s,i,n,r);case"Not":return Aps(s,i,n,r);case"Object":return Eps(s,i,n,r);case"Record":return _ps(s,i,n,r);case"Ref":return Sps(s,i,n,r);case"This":return vps(s,i,n,r);case"Tuple":return xps(s,i,n,r);case"Union":return Cps(s,i,n,r);default:return Kf(s,n,r)}}function a4(e,t,n){return Dv(e,t,"",n)}var o4,PRe,jRn=C(()=>{gie();Fr();Vc();pA();rS();wA();Ip();Ks();o4=class extends vi{constructor(t,n,r){super("The encoded value does not match the expected schema"),this.schema=t,this.value=n,this.error=r}},PRe=class extends vi{constructor(t,n,r,i){super(`${i instanceof Error?i.message:"Unknown error"}`),this.schema=t,this.path=n,this.value=r,this.error=i}}});function Tps(e,t){return fa(e)||rm(e.items,t)}function Ips(e,t){return fa(e)||rm(e.items,t)}function wps(e,t){return fa(e)||rm(e.returns,t)||e.parameters.some(n=>rm(n,t))}function Rps(e,t){return fa(e)||rm(e.returns,t)||e.parameters.some(n=>rm(n,t))}function Nps(e,t){return fa(e)||fa(e.unevaluatedProperties)||e.allOf.some(n=>rm(n,t))}function kps(e,t){let n=globalThis.Object.getOwnPropertyNames(e.$defs).reduce((i,s)=>[...i,e.$defs[s]],[]),r=e.$defs[e.$ref];return fa(e)||rm(r,[...n,...t])}function Ops(e,t){return fa(e)||rm(e.items,t)}function Mps(e,t){return fa(e)||rm(e.not,t)}function Pps(e,t){return fa(e)||Object.values(e.properties).some(n=>rm(n,t))||Gc(e.additionalProperties)&&rm(e.additionalProperties,t)}function Dps(e,t){return fa(e)||rm(e.item,t)}function Bps(e,t){let n=Object.getOwnPropertyNames(e.patternProperties)[0],r=e.patternProperties[n];return fa(e)||rm(r,t)||Gc(e.additionalProperties)&&fa(e.additionalProperties)}function Lps(e,t){return fa(e)?!0:rm(aa(e,t),t)}function Fps(e,t){return fa(e)?!0:rm(aa(e,t),t)}function Ups(e,t){return fa(e)||!Nc(e.items)&&e.items.some(n=>rm(n,t))}function Vps(e,t){return fa(e)||e.anyOf.some(n=>rm(n,t))}function rm(e,t){let n=Gm(e,t),r=e;if(e.$id&&vft.has(e.$id))return!1;switch(e.$id&&vft.add(e.$id),e[on]){case"Array":return Tps(r,n);case"AsyncIterator":return Ips(r,n);case"Constructor":return wps(r,n);case"Function":return Rps(r,n);case"Import":return kps(r,n);case"Intersect":return Nps(r,n);case"Iterator":return Ops(r,n);case"Not":return Mps(r,n);case"Object":return Pps(r,n);case"Promise":return Dps(r,n);case"Record":return Bps(r,n);case"Ref":return Lps(r,n);case"This":return Fps(r,n);case"Tuple":return Ups(r,n);case"Union":return Vps(r,n);default:return fa(e)}}function YT(e,t){return vft.clear(),rm(e,t)}var vft,zRn=C(()=>{rS();Fr();Ks();Ip();vft=new Set});var lZ=C(()=>{ZRn();jRn();zRn()});function aD(e){if(!Lo(e))throw Error("ConstantString: Not a String");return`'${JSON.stringify(e).slice(1,-1).replace(/'/g,"\\'")}'`}function XRn(e,t){return`${e}[${aD(t)}]`}var DRe,BRe,xft,LRe,Fae,lD,l4,KRn=C(()=>{lZ();QT();iZ();Vc();rS();aZ();Fr();qM();pA();Exe();fd();hT();Ip();Gtt();DRe=class{constructor(t,n,r,i){this.schema=t,this.references=n,this.checkFunc=r,this.code=i,this.hasTransform=YT(t,n)}Code(){return this.code}Schema(){return this.schema}References(){return this.references}Errors(t){return Mv(this.schema,this.references,t)}Check(t){return this.checkFunc(t)}Decode(t){if(!this.checkFunc(t))throw new i4(this.schema,t,this.Errors(t).First());return this.hasTransform?s4(this.schema,this.references,t):t}Encode(t){let n=this.hasTransform?a4(this.schema,this.references,t):t;if(!this.checkFunc(n))throw new o4(this.schema,t,this.Errors(t).First());return n}};(function(e){function t(s){return s===36}e.DollarSign=t;function n(s){return s===95}e.IsUnderscore=n;function r(s){return s>=65&&s<=90||s>=97&&s<=122}e.IsAlpha=r;function i(s){return s>=48&&s<=57}e.IsNumeric=i})(BRe||(BRe={}));(function(e){function t(n){let r=[];for(let i=0;i<n.length;i++){let s=n.charCodeAt(i);BRe.IsNumeric(s)||BRe.IsAlpha(s)?r.push(n.charAt(i)):r.push(`_${s}_`)}return r.join("").replace(/__/g,"_")}e.Encode=t})(xft||(xft={}));LRe=class extends vi{constructor(t){super("Unknown type"),this.schema=t}},Fae=class extends vi{constructor(t){super("Preflight validation check failed to guard for the given schema"),this.schema=t}};(function(e){function t(o,a,l){return mc.ExactOptionalPropertyTypes?`(${aD(a)} in ${o} ? ${l} : true)`:`(${XRn(o,a)} !== undefined ? ${l} : true)`}e.IsExactOptionalProperty=t;function n(o){return mc.AllowArrayObject?`(typeof ${o} === 'object' && ${o} !== null)`:`(typeof ${o} === 'object' && ${o} !== null && !Array.isArray(${o}))`}e.IsObjectLike=n;function r(o){return mc.AllowArrayObject?`(typeof ${o} === 'object' && ${o} !== null && !(${o} instanceof Date) && !(${o} instanceof Uint8Array))`:`(typeof ${o} === 'object' && ${o} !== null && !Array.isArray(${o}) && !(${o} instanceof Date) && !(${o} instanceof Uint8Array))`}e.IsRecordLike=r;function i(o){return mc.AllowNaN?`typeof ${o} === 'number'`:`Number.isFinite(${o})`}e.IsNumberLike=i;function s(o){return mc.AllowNullVoid?`(${o} === undefined || ${o} === null)`:`${o} === undefined`}e.IsVoidLike=s})(lD||(lD={}));(function(e){function t(ee){return ee[on]==="Any"||ee[on]==="Unknown"}function*n(ee,X,$){yield"true"}function*r(ee,X,$){yield"true"}function*i(ee,X,$){yield`Array.isArray(${$})`;let[se,oe]=[j("value","any"),j("acc","number")];pi(ee.maxItems)&&(yield`${$}.length <= ${ee.maxItems}`),pi(ee.minItems)&&(yield`${$}.length >= ${ee.minItems}`);let we=ce(ee.items,X,"value");if(yield`((array) => { for(const ${se} of array) if(!(${we})) { return false }; return true; })(${$})`,Wc(ee.contains)||pi(ee.minContains)||pi(ee.maxContains)){let Re=Wc(ee.contains)?ee.contains:Gi(),xe=ce(Re,X,"value"),re=pi(ee.minContains)?[`(count >= ${ee.minContains})`]:[],Oe=pi(ee.maxContains)?[`(count <= ${ee.maxContains})`]:[],Ze=`const count = value.reduce((${oe}, ${se}) => ${xe} ? acc + 1 : acc, 0)`,Ye=["(count > 0)",...re,...Oe].join(" && ");yield`((${se}) => { ${Ze}; return ${Ye}})(${$})`}ee.uniqueItems===!0&&(yield`((${se}) => { const set = new Set(); for(const element of value) { const hashed = hash(element); if(set.has(hashed)) { return false } else { set.add(hashed) } } return true } )(${$})`)}function*s(ee,X,$){yield`(typeof value === 'object' && Symbol.asyncIterator in ${$})`}function*o(ee,X,$){yield`(typeof ${$} === 'bigint')`,Bm(ee.exclusiveMaximum)&&(yield`${$} < BigInt(${ee.exclusiveMaximum})`),Bm(ee.exclusiveMinimum)&&(yield`${$} > BigInt(${ee.exclusiveMinimum})`),Bm(ee.maximum)&&(yield`${$} <= BigInt(${ee.maximum})`),Bm(ee.minimum)&&(yield`${$} >= BigInt(${ee.minimum})`),Bm(ee.multipleOf)&&(yield`(${$} % BigInt(${ee.multipleOf})) === 0`)}function*a(ee,X,$){yield`(typeof ${$} === 'boolean')`}function*l(ee,X,$){yield*ie(ee.returns,X,`${$}.prototype`)}function*u(ee,X,$){yield`(${$} instanceof Date) && Number.isFinite(${$}.getTime())`,pi(ee.exclusiveMaximumTimestamp)&&(yield`${$}.getTime() < ${ee.exclusiveMaximumTimestamp}`),pi(ee.exclusiveMinimumTimestamp)&&(yield`${$}.getTime() > ${ee.exclusiveMinimumTimestamp}`),pi(ee.maximumTimestamp)&&(yield`${$}.getTime() <= ${ee.maximumTimestamp}`),pi(ee.minimumTimestamp)&&(yield`${$}.getTime() >= ${ee.minimumTimestamp}`),pi(ee.multipleOfTimestamp)&&(yield`(${$}.getTime() % ${ee.multipleOfTimestamp}) === 0`)}function*c(ee,X,$){yield`(typeof ${$} === 'function')`}function*d(ee,X,$){let se=globalThis.Object.getOwnPropertyNames(ee.$defs).reduce((oe,we)=>[...oe,ee.$defs[we]],[]);yield*ie(Um(ee.$ref),[...X,...se],$)}function*p(ee,X,$){yield`Number.isInteger(${$})`,pi(ee.exclusiveMaximum)&&(yield`${$} < ${ee.exclusiveMaximum}`),pi(ee.exclusiveMinimum)&&(yield`${$} > ${ee.exclusiveMinimum}`),pi(ee.maximum)&&(yield`${$} <= ${ee.maximum}`),pi(ee.minimum)&&(yield`${$} >= ${ee.minimum}`),pi(ee.multipleOf)&&(yield`(${$} % ${ee.multipleOf}) === 0`)}function*m(ee,X,$){let se=ee.allOf.map(oe=>ce(oe,X,$)).join(" && ");if(ee.unevaluatedProperties===!1){let oe=W(`${new RegExp(bv(ee))};`),we=`Object.getOwnPropertyNames(${$}).every(key => ${oe}.test(key))`;yield`(${se} && ${we})`}else if(Wc(ee.unevaluatedProperties)){let oe=W(`${new RegExp(bv(ee))};`),we=`Object.getOwnPropertyNames(${$}).every(key => ${oe}.test(key) || ${ce(ee.unevaluatedProperties,X,`${$}[key]`)})`;yield`(${se} && ${we})`}else yield`(${se})`}function*f(ee,X,$){yield`(typeof value === 'object' && Symbol.iterator in ${$})`}function*h(ee,X,$){if(typeof ee.const=="number"||typeof ee.const=="boolean")yield`(${$} === ${ee.const})`;else if(typeof ee.const=="string")yield`(${$} === ${aD(ee.const)})`;else throw Error("Invalid Literal Value")}function*g(ee,X,$){yield"false"}function*b(ee,X,$){yield`(!${ce(ee.not,X,$)})`}function*A(ee,X,$){yield`(${$} === null)`}function*y(ee,X,$){yield lD.IsNumberLike($),pi(ee.exclusiveMaximum)&&(yield`${$} < ${ee.exclusiveMaximum}`),pi(ee.exclusiveMinimum)&&(yield`${$} > ${ee.exclusiveMinimum}`),pi(ee.maximum)&&(yield`${$} <= ${ee.maximum}`),pi(ee.minimum)&&(yield`${$} >= ${ee.minimum}`),pi(ee.multipleOf)&&(yield`(${$} % ${ee.multipleOf}) === 0`)}function*S(ee,X,$){yield lD.IsObjectLike($),pi(ee.minProperties)&&(yield`Object.getOwnPropertyNames(${$}).length >= ${ee.minProperties}`),pi(ee.maxProperties)&&(yield`Object.getOwnPropertyNames(${$}).length <= ${ee.maxProperties}`);let se=Object.getOwnPropertyNames(ee.properties);for(let oe of se){let we=XRn($,oe),Re=ee.properties[oe];if(ee.required&&ee.required.includes(oe))yield*ie(Re,X,we),(yv(Re)||t(Re))&&(yield`(${aD(oe)} in ${$})`);else{let xe=ce(Re,X,we);yield lD.IsExactOptionalProperty($,oe,xe)}}if(ee.additionalProperties===!1)if(ee.required&&ee.required.length===se.length)yield`Object.getOwnPropertyNames(${$}).length === ${se.length}`;else{let oe=`[${se.map(we=>`${aD(we)}`).join(", ")}]`;yield`Object.getOwnPropertyNames(${$}).every(key => ${oe}.includes(key))`}if(typeof ee.additionalProperties=="object"){let oe=ce(ee.additionalProperties,X,`${$}[key]`),we=`[${se.map(Re=>`${aD(Re)}`).join(", ")}]`;yield`(Object.getOwnPropertyNames(${$}).every(key => ${we}.includes(key) || ${oe}))`}}function*_(ee,X,$){yield`${$} instanceof Promise`}function*x(ee,X,$){yield lD.IsRecordLike($),pi(ee.minProperties)&&(yield`Object.getOwnPropertyNames(${$}).length >= ${ee.minProperties}`),pi(ee.maxProperties)&&(yield`Object.getOwnPropertyNames(${$}).length <= ${ee.maxProperties}`);let[se,oe]=Object.entries(ee.patternProperties)[0],we=W(`${new RegExp(se)}`),Re=ce(oe,X,"value"),xe=Wc(ee.additionalProperties)?ce(ee.additionalProperties,X,$):ee.additionalProperties===!1?"false":"true",re=`(${we}.test(key) ? ${Re} : ${xe})`;yield`(Object.entries(${$}).every(([key, value]) => ${re}))`}function*v(ee,X,$){let se=aa(ee,X);if(ne.functions.has(ee.$ref))return yield`${ue(ee.$ref)}(${$})`;yield*ie(se,X,$)}function*w(ee,X,$){let se=W(`${new RegExp(ee.source,ee.flags)};`);yield`(typeof ${$} === 'string')`,pi(ee.maxLength)&&(yield`${$}.length <= ${ee.maxLength}`),pi(ee.minLength)&&(yield`${$}.length >= ${ee.minLength}`),yield`${se}.test(${$})`}function*T(ee,X,$){yield`(typeof ${$} === 'string')`,pi(ee.maxLength)&&(yield`${$}.length <= ${ee.maxLength}`),pi(ee.minLength)&&(yield`${$}.length >= ${ee.minLength}`),ee.pattern!==void 0&&(yield`${W(`${new RegExp(ee.pattern)};`)}.test(${$})`),ee.format!==void 0&&(yield`format(${aD(ee.format)}, ${$})`)}function*D(ee,X,$){yield`(typeof ${$} === 'symbol')`}function*M(ee,X,$){yield`(typeof ${$} === 'string')`,yield`${W(`${new RegExp(ee.pattern)};`)}.test(${$})`}function*P(ee,X,$){yield`${ue(ee.$ref)}(${$})`}function*O(ee,X,$){if(yield`Array.isArray(${$})`,ee.items===void 0)return yield`${$}.length === 0`;yield`(${$}.length === ${ee.maxItems})`;for(let se=0;se<ee.items.length;se++)yield`${ce(ee.items[se],X,`${$}[${se}]`)}`}function*k(ee,X,$){yield`${$} === undefined`}function*L(ee,X,$){yield`(${ee.anyOf.map(oe=>ce(oe,X,$)).join(" || ")})`}function*F(ee,X,$){yield`${$} instanceof Uint8Array`,pi(ee.maxByteLength)&&(yield`(${$}.length <= ${ee.maxByteLength})`),pi(ee.minByteLength)&&(yield`(${$}.length >= ${ee.minByteLength})`)}function*Y(ee,X,$){yield"true"}function*U(ee,X,$){yield lD.IsVoidLike($)}function*J(ee,X,$){let se=ne.instances.size;ne.instances.set(se,ee),yield`kind(${aD(ee[on])}, ${se}, ${$})`}function*ie(ee,X,$,se=!0){let oe=Lo(ee.$id)?[...X,ee]:X,we=ee;if(se&&Lo(ee.$id)){let Re=ue(ee.$id);if(ne.functions.has(Re))return yield`${Re}(${$})`;{ne.functions.set(Re,"<deferred>");let xe=Q(Re,ee,X,"value",!1);return ne.functions.set(Re,xe),yield`${Re}(${$})`}}switch(we[on]){case"Any":return yield*n(we,oe,$);case"Argument":return yield*r(we,oe,$);case"Array":return yield*i(we,oe,$);case"AsyncIterator":return yield*s(we,oe,$);case"BigInt":return yield*o(we,oe,$);case"Boolean":return yield*a(we,oe,$);case"Constructor":return yield*l(we,oe,$);case"Date":return yield*u(we,oe,$);case"Function":return yield*c(we,oe,$);case"Import":return yield*d(we,oe,$);case"Integer":return yield*p(we,oe,$);case"Intersect":return yield*m(we,oe,$);case"Iterator":return yield*f(we,oe,$);case"Literal":return yield*h(we,oe,$);case"Never":return yield*g(we,oe,$);case"Not":return yield*b(we,oe,$);case"Null":return yield*A(we,oe,$);case"Number":return yield*y(we,oe,$);case"Object":return yield*S(we,oe,$);case"Promise":return yield*_(we,oe,$);case"Record":return yield*x(we,oe,$);case"Ref":return yield*v(we,oe,$);case"RegExp":return yield*w(we,oe,$);case"String":return yield*T(we,oe,$);case"Symbol":return yield*D(we,oe,$);case"TemplateLiteral":return yield*M(we,oe,$);case"This":return yield*P(we,oe,$);case"Tuple":return yield*O(we,oe,$);case"Undefined":return yield*k(we,oe,$);case"Union":return yield*L(we,oe,$);case"Uint8Array":return yield*F(we,oe,$);case"Unknown":return yield*Y(we,oe,$);case"Void":return yield*U(we,oe,$);default:if(!wp.Has(we[on]))throw new LRe(ee);return yield*J(we,oe,$)}}let ne={language:"javascript",functions:new Map,variables:new Map,instances:new Map};function ce(ee,X,$,se=!0){return`(${[...ie(ee,X,$,se)].join(" && ")})`}function ue(ee){return`check_${xft.Encode(ee)}`}function W(ee){let X=`local_${ne.variables.size}`;return ne.variables.set(X,`const ${X} = ${ee}`),X}function Q(ee,X,$,se,oe=!0){let[we,Re]=[`
|
|
296
296
|
`,Ze=>"".padStart(Ze," ")],xe=j("value","any"),re=Z("boolean"),Oe=[...ie(X,$,se,oe)].map(Ze=>`${Re(4)}${Ze}`).join(` &&${we}`);return`function ${ee}(${xe})${re} {${we}${Re(2)}return (${we}${Oe}${we}${Re(2)})
|
|
297
297
|
}`}function j(ee,X){let $=ne.language==="typescript"?`: ${X}`:"";return`${ee}${$}`}function Z(ee){return ne.language==="typescript"?`: ${ee}`:""}function z(ee,X,$){let se=Q("check",ee,X,"value"),oe=j("value","any"),we=Z("boolean"),Re=[...ne.functions.values()],xe=[...ne.variables.values()],re=Lo(ee.$id)?`return function check(${oe})${we} {
|
|
298
298
|
return ${ue(ee.$id)}(value)
|
|
@@ -6399,7 +6399,7 @@ not revoke server-side tokens; use \`auggie token revoke\` for revocation.
|
|
|
6399
6399
|
|
|
6400
6400
|
Interactive /login and /logout manage the platform session in session.json.`,IPr=`Usage: auggie auth status
|
|
6401
6401
|
|
|
6402
|
-
Show whether the CLI has an active Augment authentication session.`,lFo="Note: Injected credentials remain active and may override the saved session.",cFo="Note: Injected credentials remain active.",uFo="AUGGIE_V2_SEGMENT_WRITE_KEY"});import{readFile as wFo}from"node:fs/promises";import{resolve as RFo}from"node:path";function OFo(e){let t=[],n;for(let r=0;r<e.length;r+=1){let i=e[r];if(i==="--"){t.push(...e.slice(r));break}if(i===QBt){let s=e[r+1];if(s===void 0||s.startsWith("-")||!s.trim())return{type:"fatal"};n=s,r+=1;continue}if(i.startsWith(`${QBt}=`)){let s=i.slice(QBt.length+1);if(!s.trim())return{type:"fatal"};n=s;continue}t.push(i)}return{type:"success",args:t,candidate:n}}async function LPr(e,t=kFo){let n=OFo(e);if(n.type==="fatal")return{type:"fatal",message:NFo};if(n.candidate===void 0)return{type:"success",args:n.args};let r=n.candidate.trim(),i;if(r.startsWith("{"))i=r;else try{i=await t.readPath(RFo(process.cwd(),r))}catch{return{type:"fatal",message:YBt}}let s;try{s=JSON.parse(i)}catch{return{type:"fatal",message:YBt}}let o=_de(s);return o?{type:"success",args:n.args,credentials:o}:{type:"fatal",message:YBt}}var QBt,NFo,YBt,kFo,FPr=C(()=>{"use strict";Sde();QBt="--augment-session-json",NFo="--augment-session-json requires a value",YBt="--augment-session-json value is unusable",kFo={readPath:e=>wFo(e,"utf8")}});import{execFile as MFo}from"node:child_process";import{existsSync as PFo,rmSync as DFo}from"node:fs";import{promisify as BFo}from"node:util";function ZBt(e){let t=e.match(/^git@github\.com:(.+?)(?:\.git)?$/);if(t){let r=t[1];return{sshUrl:`git@github.com:${r}.git`,httpsUrl:`https://github.com/${r}.git`}}let n=e.match(/^https?:\/\/github\.com\/(.+?)(?:\.git)?$/);if(n){let r=n[1];return{sshUrl:`git@github.com:${r}.git`,httpsUrl:`https://github.com/${r}.git`}}return{sshUrl:e,httpsUrl:e}}function WPr(e){return e instanceof Error?e.message:String(e)}async function jBt({sshUrl:e,httpsUrl:t,targetDir:n,extraArgs:r=[]}){let i,s=e===t?[{url:e,env:e.startsWith("http")?HBt:UPr}]:[{url:e,env:UPr},{url:t,env:HBt}];for(let o of s)try{return await GPr("git",["clone","--depth","1",...r,o.url,n],{env:o.env}),{success:!0}}catch(a){i=a,PFo(n)&&DFo(n,{recursive:!0,force:!0})}return{success:!1,error:WPr(i)}}function VPr(e,t){return GPr("git",e,{cwd:t,env:HBt})}async function $Pr(e,t){try{return await VPr(["fetch","--depth","1","origin",t],e),await VPr(["checkout","FETCH_HEAD"],e),{success:!0}}catch(n){return{success:!1,error:WPr(n)}}}var GPr,UPr,HBt,QPr=C(()=>{"use strict";GPr=BFo(MFo),UPr={...process.env,GIT_TERMINAL_PROMPT:"0",GIT_SSH_COMMAND:"ssh -o BatchMode=yes"},HBt={...process.env,GIT_TERMINAL_PROMPT:"0"}});import{readFileSync as LFo}from"node:fs";import{join as zBt}from"node:path";function u9(e){let t=FFo(e,YPr);return t.manifest||t.diagnostics.length>0?t:{diagnostics:[`no marketplace manifest found (looked for ${YPr.join(", ")})`]}}function FFo(e,t){let n=[];for(let r of t){let i=zBt(e,r),s;try{s=LFo(i,"utf-8")}catch{continue}try{let o=JSON.parse(s);if(o&&typeof o=="object"&&!Array.isArray(o))return{manifest:o,manifestPath:i,diagnostics:n};n.push(`manifest at ${r} is not a JSON object; ignoring`)}catch(o){n.push(`failed to parse manifest at ${r}: ${o.message}`)}}return{diagnostics:n}}var YPr,jVe=C(()=>{"use strict";YPr=[zBt(".augment-plugin","marketplace.json"),zBt(".claude-plugin","marketplace.json")]});import{execFile as UFo}from"node:child_process";import{existsSync as Tw,mkdirSync as ZPr,readdirSync as VFo,renameSync as GFo,rmSync as WFo,statSync as $Fo}from"node:fs";import{dirname as QFo,isAbsolute as jPr,join as Iw,relative as zPr,resolve as XBt}from"node:path";import{promisify as YFo}from"node:util";function qPr(e){let t=e.replace(/\.\./g,"").replace(/[/\\]/g,"").replace(/^\.+/,"").trim();return!t||!/^[a-zA-Z0-9][a-zA-Z0-9._-]*$/.test(t)?null:t}function HPr(e){let t=e.replace(/\.\./g,"").replace(/[/\\]/g,"").replace(/^\.+/,"").trim();return!t||!/^[a-zA-Z0-9][a-zA-Z0-9._-]*$/.test(t)?null:t}function HFo(e){let t=e.trim();if(!t)return null;let n=t.match(/^([a-zA-Z0-9_-]+)\/([a-zA-Z0-9_.-]+?)(?:@(.+))?$/);if(n?.[1]&&n[2]){let r=n[1],i=n[2].replace(/\.git$/,"");return{repo:i,cloneUrl:`https://github.com/${r}/${i}`,...n[3]?{ref:n[3]}:{}}}if(/^(https?|ssh|file):\/\/|^git@/.test(t)){let[r,i]=t.split("#");if(!r)return null;let s=r.replace(/\/+$/,""),o=s.split(/[/:]/).pop()?.replace(/\.git$/,"");if(o)return{repo:o,cloneUrl:s,...i?{ref:i}:{}}}return null}function ww(e){return typeof e=="string"&&e.length>0?e:void 0}function ZFo(e,t){let n=ww(e.repo);return n?{kind:"github",url:`https://github.com/${n.replace(/\.git$/,"")}.git`,...t?{ref:t}:{},...ww(e.path)?{subdir:ww(e.path)}:{}}:null}function jFo(e,t){let n=ww(e.url);return n?{kind:"url",url:n,...t?{ref:t}:{},...ww(e.path)?{subdir:ww(e.path)}:{}}:null}function zFo(e,t){let n=ww(e.url),r=ww(e.path);return n&&r?{kind:"git-subdir",url:n,subdir:r,...t?{ref:t}:{}}:null}function KBt(e){if(!e||typeof e!="object")return null;let t=e,n=ww(t.sha)??ww(t.ref);switch(t.source){case"github":return ZFo(t,n);case"url":return jFo(t,n);case"git-subdir":return zFo(t,n);default:return null}}function JPr(e,t,n){let r=qPr(t);if(!r)return;let i=Iw(e,KPr,r);if(!Tw(Iw(i,".git")))return;if(!n)return i;let s=XBt(i,n),o=zPr(i,s);if(!(o.startsWith("..")||jPr(o)))return Tw(s)?s:void 0}async function XFo(e,t){let n=typeof t.name=="string"?t.name:"",r=KBt(t.source);if(!r)return;let i=qPr(n);if(!i)return{name:n,status:"failed",error:"invalid plugin cache name"};let s=Iw(e,KPr,i);if(Tw(Iw(s,".git")))return{name:n,status:"skipped"};let o=QFo(s);Tw(o)||ZPr(o,{recursive:!0});let{sshUrl:a,httpsUrl:l}=ZBt(r.url),u=r.kind==="git-subdir",c=await jBt({sshUrl:a,httpsUrl:l,targetDir:s,extraArgs:u?["--filter=blob:none","--sparse"]:[]});if(!c.success)return{name:n,status:"failed",error:c.error};if(r.ref){let d=await $Pr(s,r.ref);if(!d.success)return{name:n,status:"failed",error:d.error}}if(u&&r.kind==="git-subdir")try{await XPr("git",["sparse-checkout","set",r.subdir],{cwd:s,env:{...process.env,GIT_TERMINAL_PROMPT:"0"}})}catch(d){return{name:n,status:"failed",error:d instanceof Error?d.message:String(d)}}return{name:n,status:"cloned"}}async function qBt(e){let{manifest:t}=u9(e),n=t?.plugins;if(!n||n.length===0)return[];let r=[];for(let i of n){let s=await XFo(e,i);s&&r.push(s)}return r}function KFo(e){try{return $Fo(e).isDirectory()}catch{return!1}}function qFo(e,t){let n=zPr(XBt(e),XBt(t));return n!==""&&!n.startsWith("..")&&!jPr(n)}async function Aq(e,t){let n=HFo(t);if(!n)return{success:!1,error:`Invalid repository: ${t}. Expected owner/repo, a Git URL (HTTPS/SSH/file), or a github.com URL.`};let{repo:r,ref:i,cloneUrl:s}=n;Tw(e)||ZPr(e,{recursive:!0});let o=HPr(r);if(!o)return{success:!1,error:`Invalid repository name for marketplace directory: "${r}".`};let a=Iw(e,o);if(Tw(a))return{success:!1,alreadyInstalled:!0,marketplaceId:o,error:`Marketplace '${o}' is already installed.`};let{sshUrl:l,httpsUrl:u}=ZBt(s),c=await jBt({sshUrl:l,httpsUrl:u,targetDir:a,extraArgs:i?["--branch",i]:[]});if(!c.success)return{success:!1,error:`Failed to clone '${s}': ${c.error}`};let{manifest:d}=u9(a),p=o,m=typeof d?.name=="string"?HPr(d.name):null;if(m&&m!==o){let f=Iw(e,m);if(!Tw(f))try{GFo(a,f),p=m}catch{}}return await qBt(Iw(e,p)),{success:!0,marketplaceId:p}}function Eq(e,t){let n=Iw(e,t);if(!qFo(e,n))return{success:!1,error:`Refusing to remove '${t}': path is outside the marketplaces directory.`};if(!Tw(n))return{success:!1,error:`Marketplace '${t}' not found.`};try{return WFo(n,{recursive:!0,force:!0}),{success:!0}}catch(r){return{success:!1,error:`Failed to remove '${t}': ${r instanceof Error?r.message:String(r)}`}}}async function eDr(e){if(!Tw(Iw(e,".git")))return{success:!1,notGitRepo:!0,error:"Not a git repository"};try{return await XPr("git",["pull"],{cwd:e,env:{...process.env,GIT_TERMINAL_PROMPT:"0"}}),await qBt(e),{success:!0}}catch(t){return{success:!1,error:t instanceof Error?t.message:String(t)}}}async function tDr(e){let t=!1;for(let n of e){if(!Tw(n))continue;let r;try{r=VFo(n)}catch{continue}for(let i of r){let s=Iw(n,i);if(!KFo(s))continue;(await qBt(s)).some(a=>a.status==="cloned")&&(t=!0)}}return t}var XPr,KPr,zVe=C(()=>{"use strict";QPr();jVe();XPr=YFo(UFo),KPr=".plugin-cache"});import{readFileSync as JFo}from"node:fs";import{join as e5o}from"node:path";function XVe(e){let t=e5o(e,"hooks","hooks.json"),n;try{n=JFo(t,"utf-8")}catch{return{diagnostics:[]}}let r;try{r=JSON.parse(n)}catch(s){return{diagnostics:[`failed to parse hooks/hooks.json: ${s.message}`]}}return!r||typeof r!="object"||Array.isArray(r)?{diagnostics:["hooks/hooks.json must be a JSON object"]}:{config:zI(r),diagnostics:[]}}var JBt=C(()=>{"use strict";J2()});import{existsSync as t5o,lstatSync as n5o,readdirSync as sDr,realpathSync as nDr,statSync as r5o}from"node:fs";import{basename as rDr,isAbsolute as eLt,join as xhe,relative as oDr,resolve as tLt}from"node:path";function nLt(e,t){let n=[],r=[],i=[],s=new Map;for(let o of new Set(e))for(let a of i5o(o,t,r)){let l=s.get(a.id);if(l!==void 0){i.push({id:a.id,shadowedRoot:o,winnerRoot:l});continue}s.set(a.id,o),n.push(a)}for(let[o,a]of Object.entries(t))a&&!s.has(o)&&r.push(`enabledPlugins["${o}"] = true but no plugin with that id was found in any marketplace root`);return{plugins:n,globalDiagnostics:r,shadowedPlugins:i}}function i5o(e,t,n){let r=[];if(!t5o(e))return r;let i=u9(e);if(!i.manifest)for(let o of i.diagnostics)o.startsWith("no marketplace manifest found")||n.push(`[${rDr(e)}] ${o}`);if(i.manifest)return iDr(e,rDr(e),t,r,n),r;let s;try{s=sDr(e)}catch(o){return n.push(`failed to read marketplaces directory ${e}: ${o.message}`),r}for(let o of s){let a=xhe(e,o);Che(a)&&iDr(a,o,t,r,n)}return r}function iDr(e,t,n,r,i){let s=u9(e);if(!s.manifest){for(let u of s.diagnostics)i.push(`[${t}] ${u}`);return}let o=d5o(s.manifest.name,t),a=u5o(e,s.manifest.metadata?.pluginRoot),l=Array.isArray(s.manifest.plugins)?s.manifest.plugins:[];l.length===0&&i.push(`[${o}] marketplace.json has no plugins[] entries`);for(let u of l){let c=s5o(u,e,a,o,n);c&&r.push(c)}for(let u of s.diagnostics)i.push(`[${o}] ${u}`)}function s5o(e,t,n,r,i){let s=typeof e.name=="string"?d9(e.name):void 0;if(!s)return;let o=`${s}@${r}`,a=i[o]===!0,l=[],u=c5o(e.source,s,t,n,l);return u?a5o(o,r,s,u,a,l,t):{id:o,marketplace:r,name:s,enabled:a,commandsDir:void 0,skillsDir:void 0,hooksConfig:void 0,agentsDirPresent:!1,diagnostics:l}}function o5o(e,t){let n=[],r;try{r=sDr(e).sort()}catch(s){return t.push(`failed to read agents directory: ${s.message}`),n}let i=[];for(let s of r){if(!s.endsWith(".md"))continue;let o=xhe(e,s);try{if(!n5o(o).isFile()){i.push(s);continue}}catch(a){t.push(`failed to stat agent file ${s}: ${a.message}`);continue}n.push(o)}return i.length>0&&t.push(`ignoring non-regular agent file(s) under agents/ (symlinks / dirs / devices are not followed): ${i.join(", ")}`),n}function a5o(e,t,n,r,i,s,o){let a=xhe(r,"commands"),l=xhe(r,"skills"),u=xhe(r,"agents"),c=p5o(a,r,s),d=Che(l)?l:void 0,p=Che(u),m=p&&i?o5o(u,s):void 0,f=XVe(r);for(let h of f.diagnostics)s.push(h);return{id:e,marketplace:t,name:n,root:r,marketplacePath:tLt(o),enabled:i,commandsDir:c,skillsDir:d,hooksConfig:f.config,agentsDirPresent:p,agentFiles:m,diagnostics:s}}function l5o(e,t,n,r){let i=KBt(e);if(!i){let o=e.source;r.push(`source kind "${typeof o=="string"?o:"object"}" is not supported; install the plugin manually as a relative directory`);return}let s=JPr(n,t,i.subdir);if(s)return s;r.push(`source kind "${i.kind}" not fetched yet; run /plugins to clone it (or marketplace update)`)}function c5o(e,t,n,r,i){if(typeof e!="string"){if(e&&typeof e=="object")return l5o(e,t,n,i);i.push("plugin entry has no source field; skipping");return}if(eLt(e)){i.push(`absolute source "${e}" is not allowed; skipping`);return}let s=e.startsWith("./")?n:r,o=tLt(s,e),a=oDr(n,o);if(a.startsWith("..")||eLt(a)){i.push(`source "${e}" resolves outside the marketplace root; skipping`);return}if(!Che(o)){i.push(`source "${e}" does not point to an existing directory (looked at ${o})`);return}return o}function u5o(e,t){return typeof t!="string"||t.length===0?e:tLt(e,t)}function d5o(e,t){if(typeof e=="string"&&e.length>0){let n=d9(e);if(n.length>0)return n}return t}function d9(e){let t="";for(let n of e){let r=n.codePointAt(0);if(r===void 0)continue;let i=r<=31,s=r>=127&&r<=159;i||s||(t+=n)}return t}function p5o(e,t,n){if(Che(e))try{let r=oDr(nDr(t),nDr(e));if(r===".."||r.startsWith("../")||r.startsWith("..\\")||eLt(r)){n.push("commands/ directory resolves outside the plugin root");return}return e}catch{n.push("commands/ directory could not be resolved");return}}function Che(e){try{return r5o(e).isDirectory()}catch{return!1}}var The=C(()=>{"use strict";zVe();JBt();jVe()});import{readFileSync as m5o}from"node:fs";import{basename as f5o}from"node:path";function Px(e,t,n=!0){if(e!==void 0){if(typeof e!="string")throw new Dx(`Invalid ${t}: expected a string.`);return n?e.trim():e}}function Bk(e,t){if(e!==void 0){if(typeof e!="boolean")throw new Dx(`Invalid ${t}: expected a boolean.`);return e}}function aDr(e){return d9(e.trim().replace(/\s+/g,"-").replace(/[^a-zA-Z0-9_-]/g,"-").replace(/-+/g,"-"))}function KVe(e,t){if(typeof e=="string")return e.trim()==="none"?[]:[...new Set(e.split(",").map(n=>n.trim()).filter(Boolean))];if(!Array.isArray(e)||e.some(n=>typeof n!="string"||!n.trim()))throw new Dx(`Invalid ${t}: expected named strings as a list or CSV.`);return[...new Set(e.map(n=>n.trim()))]}function b5o(e){if(e===void 0)return!0;if(typeof e=="boolean")throw new Dx("Boolean skills is unsupported. Use disable_skills: true for opt-out; omit skills for defaults.");let t=KVe(e,"skills");return t.length?t:!1}function y5o(e){switch(e){case"red":case"blue":case"green":case"yellow":case"orange":case"purple":case"pink":case"cyan":return e;default:return}}function rLt(e,t,n){return{name:e,pluginId:t,source:"plugin",description:e,enabled:!1,invalidDefinition:!0,diagnostics:[n],builtinToolNames:[],disallowedTools:[],extensions:!1,skills:!1,systemPrompt:"",promptMode:"append"}}function A5o(e){if(typeof e=="string")return g5o.includes(e)?e:void 0}function E5o(e){return typeof e=="number"&&e>=0?e:void 0}function _5o(e){if(e==="user"||e==="project"||e==="local")return e}function S5o(e){if(e==null||e===!0)return!0;if(e===!1||e==="none")return!1;let t=KVe(e,"extensions");return t.length>0?t:!1}function v5o(e,t){let n=f5o(e,".md"),r=aDr(n),i;try{i=m5o(e,"utf-8")}catch{return rLt(r,t,"Custom-agent file could not be read.")}try{let{frontmatter:s,body:o}=ux(i);if(!s||typeof s!="object"||Array.isArray(s))throw new Dx("Invalid frontmatter mapping.");if(r=aDr(Px(s.name,"name")||n),!r)throw new Dx("Invalid name: a non-empty identity is required.");for(let[a,l]of Object.entries({disallowed_tools:"Use disabled_tools instead.",prompt_mode:"Use replace_system_prompt: false for append or true for replace.",inherit_skills:"Use disable_skills for opt-out or skills for named selection."}))if(Object.hasOwn(s,a))throw new Dx(`Removed frontmatter field ${a}. ${l}`);return C5o({fm:s,body:o,name:r,pluginId:t})}catch(s){return rLt(r,t,s instanceof Dx?s.message:"Invalid custom-agent definition.")}}function x5o(e){let t=Px(e.thinking,"thinking"),n=A5o(t),r=y5o(e.color),i=[];return e.color!==void 0&&!r&&i.push("Invalid color: expected a supported terminal label color."),t!==void 0&&n===void 0&&i.push("Invalid thinking: expected a supported thinking level. Model default retained."),{color:r,thinking:n,diagnostics:i.length?i:void 0}}function C5o({fm:e,body:t,name:n,pluginId:r}){let i=Bk(e.replace_system_prompt,"replace_system_prompt")??!1;if(i&&!t.trim())throw new Dx("replace_system_prompt requires a non-empty Markdown body.");let s=Bk(e.disable_skills,"disable_skills")??!1,o=b5o(e.skills);return{name:n,displayName:Px(e.display_name,"display_name")||n,description:Px(e.description,"description")||n,...x5o(e),toolDescription:Px(e.tool_description,"tool_description")||void 0,instructionDescription:Px(e.instruction_description,"instruction_description")||void 0,providerModel:Px(e.provider_model,"provider_model",!1),providerApiKey:Px(e.provider_api_key,"provider_api_key",!1),providerBaseUrl:Px(e.provider_base_url,"provider_base_url",!1),builtinToolNames:e.tools===void 0?[...h5o]:KVe(e.tools,"tools"),disallowedTools:e.disabled_tools===void 0?void 0:KVe(e.disabled_tools,"disabled_tools"),extensions:S5o(e.extensions??e.inherit_extensions),skills:s?!1:o,disableSkills:s,disableRules:Bk(e.disable_rules,"disable_rules")??!1,disableWorkspaceGuidelines:Bk(e.disable_workspace_guidelines,"disable_workspace_guidelines")??!1,model:Px(e.model,"model"),maxTurns:E5o(e.max_turns),systemPrompt:t.trim(),replaceSystemPrompt:i,promptMode:i?"replace":"append",inheritContext:Bk(e.inherit_context,"inherit_context"),runInBackground:Bk(e.run_in_background,"run_in_background"),isolated:Bk(e.isolated,"isolated"),memory:_5o(e.memory),isolation:e.isolation==="worktree"?"worktree":void 0,enabled:Bk(e.enabled,"enabled")??!0,hidden:Bk(e.hidden,"hidden")??!1,finishTool:Px(e.finish_tool,"finish_tool"),source:"plugin",pluginId:r}}function cDr(e){let t=new Map,n=[];if(!e.agentFiles||e.agentFiles.length===0)return{agents:t,diagnostics:n};let r=new Map;for(let i of e.agentFiles){let s=v5o(i,e.id);n.push(...s.diagnostics??[]);let o=s.name.toLowerCase();if(r.has(o)){let a=r.get(o)??s.name,l="Duplicate agent identity in the same directory.";n.push(l),t.set(a,rLt(a,e.id,l));continue}t.set(s.name,s),r.set(o,s.name)}return{agents:t,diagnostics:n}}var h5o,g5o,lDr,Dx,uDr=C(()=>{"use strict";Ms();The();h5o=["read","bash","edit","write","grep","find","ls"],g5o=["off","minimal","low","medium","high","xhigh"],lDr=["general-purpose","explore","plan"],Dx=class extends Error{}});import{lstatSync as T5o,readFileSync as I5o,realpathSync as dDr}from"node:fs";import{isAbsolute as w5o,join as R5o,relative as N5o}from"node:path";function _q(e,t){let n=e;for(let r of k5o){let i=`\${${r}}`;n.includes(i)&&(n=n.split(i).join(t))}return n}function iLt(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function pDr(e){if(!e)return;let t={};for(let[n,r]of Object.entries(e))r!=null&&(t[n]=String(r));return Object.keys(t).length>0?t:void 0}function O5o(e){if(e.type==="stdio"||e.type==="http"||e.type==="sse")return e.type;if(e.url)return"http";if(e.command)return"stdio"}function M5o(e,t){let n=O5o(t);if(!n)throw new Error(`MCP server "${e}" must declare a 'command' (stdio) or 'url' (http/sse) property`);if(n==="http"||n==="sse"){if(!t.url)throw new Error(`MCP server "${e}" has type "${n}" but no 'url' property`);let a=typeof t.clientId=="string"?t.clientId.trim():void 0;return{type:n,name:e,disabled:t.disabled,url:t.url,headers:pDr(t.headers),auth:t.auth==="oauth"?"oauth":void 0,...a?{clientId:a}:{},cwd:t.cwd,timeoutMs:t.timeoutMs}}let r=t.command;if(!r)throw new Error(`MCP server "${e}" has type "stdio" but no 'command' property`);let i=Array.isArray(t.args)?t.args.map(a=>String(a)):[],s=t.useShellInterpolation??!0,o=s&&i.length>0?`${r} ${i.join(" ")}`:r;return{type:"stdio",name:e,disabled:t.disabled,command:o,args:s?[]:i,env:pDr(t.env),cwd:t.cwd,timeoutMs:t.timeoutMs,useShellInterpolation:s}}function mDr(e,t){if(!e)return;let n={};for(let[r,i]of Object.entries(e))n[r]=_q(i,t);return n}function P5o(e,t){return e.type==="stdio"?{...e,command:_q(e.command,t),args:e.args.map(n=>_q(n,t)),env:mDr(e.env,t),cwd:e.cwd?_q(e.cwd,t):void 0}:{...e,url:_q(e.url,t),headers:mDr(e.headers,t),cwd:e.cwd?_q(e.cwd,t):void 0}}function D5o(e,t){let n=R5o(e,".mcp.json"),r;try{r=T5o(n)}catch(i){if(i?.code==="ENOENT")return;t.push(`failed to stat .mcp.json: ${i.message}`);return}if(r.isSymbolicLink()){t.push(".mcp.json is a symlink; refusing to follow it out of the plugin root");return}if(!r.isFile()){t.push(".mcp.json is not a regular file; skipping");return}try{let i=dDr(e),s=dDr(n),o=N5o(i,s);if(o.startsWith("..")||w5o(o)){t.push(".mcp.json resolves outside the plugin root; skipping");return}}catch(i){t.push(`failed to resolve .mcp.json real path: ${i.message}`);return}try{return I5o(n,"utf-8")}catch(i){t.push(`failed to read .mcp.json: ${i.message}`);return}}function qVe(e){let t=[];if(!e.root)return{servers:[],diagnostics:t};let n=D5o(e.root,t);if(n===void 0)return{servers:[],diagnostics:t};let r;try{r=JSON.parse(n)}catch(o){return t.push(`failed to parse .mcp.json: ${o.message}`),{servers:[],diagnostics:t}}if(!iLt(r))return t.push(".mcp.json must be a JSON object"),{servers:[],diagnostics:t};let i=r.mcpServers;if(!iLt(i))return t.push('.mcp.json must contain an "mcpServers" object'),{servers:[],diagnostics:t};let s=[];for(let[o,a]of Object.entries(i)){let l=`${e.id}/${d9(o)}`;if(!iLt(a)){t.push(`MCP server "${l}" must be a JSON object`);continue}try{let u=M5o(l,a);s.push(P5o(u,e.root))}catch(u){t.push(u instanceof Error?u.message:String(u))}}return{servers:s,diagnostics:t}}var k5o,fDr,sLt=C(()=>{"use strict";The();k5o=["CLAUDE_PLUGIN_ROOT","AUGMENT_PLUGIN_ROOT","AUGGIE_PLUGIN_ROOT"];fDr="hermes:mcp:register-server-source"});function hDr(e,t,n){let r=gi.create(e,t,n),i={};for(let o of[r.getVfsOrgSettings(),r.getVfsSpaceSettings(),r.getVfsUserSettings(),r.getSettings()])for(let[a,l]of Object.entries(o.enabledPlugins??{}))typeof l=="boolean"&&(i[a]=l);let s=r.drainErrors().map(({scope:o,error:a})=>`failed to load ${o} settings: ${a.message}; enabledPlugins entries from this scope will be ignored`);return{enabled:i,diagnostics:s}}var gDr=C(()=>{"use strict";Ms()});var bDr,yDr=C(()=>{"use strict";bDr="hermes:subagents:register-agent-source"});import{lstatSync as B5o,readdirSync as L5o,readFileSync as oLt}from"node:fs";import{basename as F5o,dirname as U5o,extname as V5o,isAbsolute as G5o,join as Bx,parse as W5o,relative as Sq,resolve as Ihe,sep as aLt}from"node:path";function JVe(e){return typeof e=="string"&&eGe(e)||void 0}function ADr(e,t){let n=Sq(e,t);return!G5o(n)&&n!==".."&&!n.startsWith(`..${aLt}`)}function $5o(e,t,n){let r=n?Ihe(n):W5o(e).root;if(!ADr(r,e)||!ADr(e,t))throw new Error("Plugin metadata path is outside the plugin root");let i=r,s;for(let o of["",...Sq(r,t).split(aLt).filter(Boolean)]){i=Bx(i,o);try{s=B5o(i)}catch(a){if(a.code==="ENOENT")return;throw a}if(s.isSymbolicLink())throw new Error("Plugin metadata path contains a symbolic link")}return s}function vq(e){let t={agents:[],commands:[],rules:[],mcpServers:[],hooks:[],skills:[],diagnostics:[]};if(!e.root)return t.diagnostics.push("Plugin source is unavailable"),t;let n=Ihe(e.root),r=d=>$5o(n,d,e.marketplacePath),i=Kz(),s=d=>{let p=`Could not read plugin ${d} metadata`;t.diagnostics.includes(p)||t.diagnostics.push(p)};try{if(!r(n)?.isDirectory())throw new Error("Plugin root is unavailable")}catch{return s("contents"),t}let o=(d,p,m,f)=>{let h={name:eGe(p)};try{if(!r(d)?.isFile())throw new Error("Plugin metadata file is unavailable");let{frontmatter:g}=ux(oLt(d,"utf8"));if(!g||typeof g!="object"||Array.isArray(g))throw new Error("Invalid plugin frontmatter");f&&(h.name=JVe(g.name)??h.name),h.description=JVe(g.description)}catch{s(m)}return h},a=(d,p,m)=>{let f=V5o(p);if(!(f===".md"||(d==="commands"||d==="rules")&&f===".txt")||d==="skills"&&U5o(p)!==m)return;let g=Sq(m,p),b=d==="rules"?g:g.slice(0,-f.length).split(aLt).join(":");t[d].push(o(p,b,d,d==="agents"||d==="skills"))},l=(d,p,m)=>{try{let f=r(p);if(d==="skills"&&XB(i,Sq(m,p),f?.isDirectory()))return;f?.isDirectory()?d!=="agents"&&c(d,p,m):f?.isFile()&&a(d,p,m)}catch{s(d)}},u=(d,p)=>{for(let m of Xz){let f=Bx(d,m);try{let h=r(f);if(!h)continue;if(!h.isFile())throw new Error("Invalid skill ignore file");qz(i,oLt(f,"utf8"),Sq(p,d))}catch{s("skills")}}},c=(d,p,m=p)=>{try{let f=r(p);if(!f)return;if(!f.isDirectory())throw new Error("Plugin metadata directory is invalid");if(d==="skills"){u(p,m);let h=Bx(p,"SKILL.md");if(!XB(i,Sq(m,h))&&r(h)?.isFile()){t.skills.push(o(h,F5o(p),d,!0));return}}for(let h of L5o(p).sort())(d==="commands"||d==="skills")&&zB(h)||l(d,Bx(p,h),m)}catch{s(d)}};return c("agents",Bx(n,"agents")),c("commands",Ihe(e.commandsDir??Bx(n,"commands"))),c("rules",Bx(n,"rules")),c("skills",Ihe(e.skillsDir??Bx(n,"skills"))),t.hooks=H5o(n,r,s),t.mcpServers=Z5o(e,r,s),Object.assign(t,Y5o(n,r,s)),t}function Q5o(e){let t={};for(let s of["description","version","homepage"]){let o=JVe(e[s]);o&&(t[s]=o)}let n=e.author,r=n&&typeof n=="object"&&!Array.isArray(n)?n.name:n,i=JVe(r);return i&&(t.author=i),t}function Y5o(e,t,n){for(let r of[".augment-plugin",".claude-plugin"])try{let i=Bx(e,r,"plugin.json"),s=t(i);if(!s)continue;if(!s.isFile())throw new Error("Invalid plugin manifest file");let o=JSON.parse(oLt(i,"utf8"));if(!o||typeof o!="object"||Array.isArray(o))throw new Error("Invalid plugin manifest");return Q5o(o)}catch{n("manifest")}return{}}function H5o(e,t,n){let r=[];try{let i=t(Bx(e,"hooks","hooks.json"));if(i){if(!i.isFile())throw new Error("Invalid plugin hooks file");let{config:s,diagnostics:o}=XVe(e);(!s||o.length)&&n("hook");for(let[a,l]of Object.entries(s??{}).sort(([u],[c])=>u.localeCompare(c)))for(let u of l??[])r.push({name:eGe(`${a}[${u.matcher??".*"}]`),description:"Command hook"})}}catch{n("hook")}return r}function Z5o(e,t,n){if(!e.root)return[];let r=Ihe(e.root);try{let i=t(Bx(r,".mcp.json"));if(i){if(!i.isFile())throw new Error("Invalid plugin MCP file");let{servers:s,diagnostics:o}=qVe(e);return o.length&&n("MCP server"),s.map(a=>({name:eGe(a.name.slice(e.id.length+1)),description:`${a.type==="stdio"?"stdio":a.type.toUpperCase()} server`})).sort((a,l)=>a.name.localeCompare(l.name))}}catch{n("MCP server")}return[]}var eGe,EDr=C(()=>{"use strict";Ms();The();JBt();sLt();eGe=e=>d9(e.replace(/\s+/g," ")).trim()});var Rhe={};li(Rhe,{addMarketplace:()=>Aq,default:()=>rGe,getDiscoveredMarketplaces:()=>whe,getDiscoveredPlugins:()=>Lx,getInteractivePluginDiagnostics:()=>iUo,getPluginDetails:()=>vq,getPluginDiagnostics:()=>Fx,getV2MarketplacesRoot:()=>Cq,removeMarketplace:()=>Eq,updateMarketplace:()=>eDr});import{join as HW,resolve as j5o}from"node:path";import{existsSync as z5o,readdirSync as X5o,statSync as K5o}from"node:fs";function J5o(){return globalThis[_Dr]??{}}function eUo(e){globalThis[_Dr]=e}function rGe(e){u1=[],nGe=[],tGe=[],lLt=[],xq=[];let t=!1,n,r=new Map,i,s,o=new Map,a;e.events.on(U9e,w=>{n=w.register}),e.events.on(bDr,w=>{i=w.register}),e.events.on(fDr,w=>{a=w.registerServerSource}),e.events.on(q5o,w=>{eUo(w?.scopes??{})});function l(w,T,D=[]){let M=J5o(),{enabled:P,diagnostics:O}=hDr(w,T,M),k=[...new Set(D.map(ne=>j5o(w,ne)))],L=nLt(k,{}),F={...P};for(let ne of L.plugins)F[ne.id]=!0;let Y=HW(TA(),"plugins","marketplaces"),U=HW(T,"plugins","marketplaces"),J=[M.user,M.space,M.org].flatMap(ne=>ne?[HW(ne,".augment","plugins","marketplaces")]:[]),ie=nLt([...k,Y,U,...J],F);for(let ne of ie.shadowedPlugins)mE.debug(`plugin "${ne.id}" from ${ne.shadowedRoot} is shadowed by the higher-precedence root ${ne.winnerRoot}`);return ie.globalDiagnostics=[...O,...ie.globalDiagnostics],u1=ie.plugins,nGe=ie.globalDiagnostics,t=!0,ie}function u(w,T,D=[]){t||l(w,T,D)}function c(){let w=new Map,T=new Map;tGe=[];let D=[...u1.filter(M=>M.enabled)].sort((M,P)=>M.id.localeCompare(P.id));for(let M of D){let{agents:P,diagnostics:O}=cDr(M);for(let k of O)mE.warn(`[${M.id}] ${k}`),tGe.push({type:"warning",message:`[${M.id}] ${k}`,path:M.root});for(let[k,L]of P)d(M.id,k,L,w,T)}o=w}function d(w,T,D,M,P){let O=T.toLowerCase(),k=P.get(O);if(k){let L=k.name===T?`"${T}"`:`"${T}" (case-insensitive collision with "${k.name}")`;mE.warn(`[${w}] plugin-contributed agent ${L} shadowed by earlier plugin ${k.pluginId}; ignoring`);return}lDr.includes(O)&&mE.warn(`[${w}] plugin-contributed agent "${T}" shadows the built-in default agent of the same name; the plugin's definition will be used for every Agent-tool invocation across this session`),M.set(T,D),P.set(O,{pluginId:w,name:T})}function p(){if(!i)return;s?.(),s=i({getAgents:()=>o,getDiagnostics:()=>tGe})}function m(){let w=[];xq=[];let T=[...u1.filter(D=>D.enabled)].sort((D,M)=>D.id.localeCompare(M.id));for(let D of T){let{servers:M,diagnostics:P}=qVe(D);for(let O of P)mE.warn(`[${D.id}] ${O}`),xq.push({type:"warning",message:`[${D.id}] ${O}`,path:D.root});for(let O of M)w.push(O)}lLt=w}function f(){if(!a)return;a({source:"plugin",getServers:()=>lLt,getDiagnostics:()=>xq})}function h(){if(n){for(let w of r.values())w();r.clear();for(let w of u1){if(!w.enabled)continue;let T=tUo(w);T&&r.set(w.id,n(T))}}}function g(){for(let w of r.values())w();r.clear()}function b(){let w=[],T=[];for(let D of u1){if(!D.enabled){for(let M of D.diagnostics)mE.debug(`[${D.id}] ${M}`);continue}D.root&&D.commandsDir&&T.push({path:D.commandsDir,commandNamespace:`${D.name}--${D.marketplace}`}),D.root&&D.skillsDir&&w.push(D.skillsDir);for(let M of D.diagnostics)mE.warn(`[${D.id}] ${M}`)}return{skillPaths:w,promptPaths:T}}e.on("resources_discover",(w,T)=>{t=!1;let D=l(w.cwd,w.agentDir,T.pluginDirs),{skillPaths:M,promptPaths:P}=b();for(let k of D.globalDiagnostics)mE.warn(k);let O=u1.filter(k=>k.enabled).length;return u1.length>0&&mE.info(`Discovered ${u1.length} plugin(s); ${O} enabled`),h(),c(),p(),x(),m(),f(),v(),{skillPaths:M,promptPaths:P}}),e.on("session_start",(w,T)=>{u(T.cwd,T.agentDir,T.pluginDirs),h(),c(),p(),_(),m(),f();let D=HW(TA(),"plugins","marketplaces"),M=HW(T.agentDir,"plugins","marketplaces");tDr([D,M]).then(P=>{P&&(t=!1,l(T.cwd,T.agentDir,T.pluginDirs),h(),c(),p(),m(),f())}).catch(P=>{mE.debug(`background plugin source fetch failed: ${P instanceof Error?P.message:String(P)}`)})}),e.on("session_shutdown",()=>{g(),s?.(),s=void 0,o=new Map});let A=!1,y=!1,S=!1;function _(){!n&&!A&&(A=!0,mE.warn("@hermes/hooks did not register a hook listener; plugin hooks will not run. This usually means @hermes/hooks was removed from the built-in extension list."))}function x(){!i&&!y&&(y=!0,mE.debug("@hermes/subagents did not register an agent source; plugin-contributed subagents will not be available (expected when --disable-subagents is set)."))}function v(){!a&&!S&&(S=!0,mE.debug("@hermes/mcp did not register a server source; plugin-contributed MCP servers will not be loaded."))}}function tUo(e){if(e.root)return{source:e.id,isEnabled:()=>e.enabled,getConfig:()=>e.hooksConfig,env:nUo(e.root),postToolUsePrefix:`Plugin ${e.id} hook`,backgroundLabel:t=>`[${e.id}] ${t} hook`,blockedFallbackReason:"Blocked by plugin hook"}}function nUo(e){return{PLUGIN_ROOT:e,CLAUDE_PLUGIN_ROOT:e,AUGMENT_PLUGIN_ROOT:e,AUGGIE_PLUGIN_ROOT:e}}function Lx(){return u1}function Cq(e){return HW(e,"plugins","marketplaces")}function whe(e){let t=Cq(e);if(!z5o(t))return[];let n;try{n=X5o(t)}catch{return[]}let r=[];for(let i of n){let s=HW(t,i);try{if(!K5o(s).isDirectory())continue}catch{continue}let{manifest:o}=u9(s);if(!o)continue;let a=typeof o.name=="string"&&o.name.length>0?o.name:i;r.push({dir:i,name:a,path:s})}return r}function Fx(){let e=[];for(let t of u1)for(let n of t.diagnostics)e.push({type:"warning",message:`[${t.id}] ${n}`,path:t.root});for(let t of nGe)e.push({type:"warning",message:t});for(let t of xq)e.push(t);return e}function iUo(){let e=[],t=new Set,n=0;for(let r of u1){let i=!1;for(let s of r.diagnostics){let o=r.enabled?null:rUo.exec(s);if(o?.[1]){t.add(o[1]),i=!0;continue}e.push({type:"warning",message:`[${r.id}] ${s}`,path:r.root})}i&&n++}if(n>0){let r=[...t].sort().join(", "),i=n===1?"plugin":"plugins";e.push({type:"warning",message:`${n} disabled ${i} use unsupported source kinds (${r}); enable one to see details, or re-run with --check-startup`})}for(let r of nGe)e.push({type:"warning",message:r});for(let r of xq)e.push(r);return e}var mE,q5o,_Dr,u1,nGe,tGe,lLt,xq,rUo,Rw=C(()=>{"use strict";Ms();J2();en();uDr();The();zVe();jVe();sLt();gDr();yDr();EDr();zVe();mE=tt.child({prefix:"pi-plugins"}),q5o="augment:vfs-scopes",_Dr=Symbol.for("__pi_plugins_vfs_scopes__");u1=[],nGe=[],tGe=[],lLt=[],xq=[];rUo=/^source kind "([^"]+)" (?:is not supported; install the plugin manually as a relative directory|not fetched yet; run \/plugins to clone it \(or marketplace update\))$/});function sUo(e){return{...e,execute:(t,n,r,i,s)=>{let o=Cwe(e.name);if(!o)throw new Error(`Cloud tool "${e.name}" is unavailable`);return o.execute(t,n,r,i,s)}}}function cLt(e){for(let t of tCn())e.registerTool(sUo(t))}var SDr=C(()=>{"use strict";NH()});function sGe(){let e=globalThis;return e[vDr]??=new Map,e[vDr]}function iGe(){let e=globalThis;return e[xDr]??=new Map,e[xDr]}function oGe(){return[...sGe().values()]}function aGe(e){return sGe().get(e)}function TDr(e){return iGe().get(e)}function p9(e,t){sGe().set(e.name,e),t===void 0?iGe().delete(e.name):iGe().set(e.name,t)}function Tq(e,t){let n=sGe();(t===void 0||n.get(e)===t)&&(n.delete(e),iGe().delete(e))}function IDr(e){Reflect.set(e,CDr,!0)}function lGe(e){return Reflect.get(e,CDr)===!0}var vDr,xDr,CDr,Lk=C(()=>{"use strict";vDr=Symbol.for("__hermes_mcp_tool_registry__"),xDr=Symbol.for("__hermes_mcp_tool_server_registry__"),CDr=Symbol.for("__hermes_mcp_extension_factory__")});function oUo(e){return{...e,execute:(t,n,r,i,s)=>{let o=aGe(e.name);if(!o)throw new Error(`MCP tool "${e.name}" is unavailable`);return o.execute(t,n,r,i,s)}}}function cGe(e){for(let t of oGe())e.registerTool(oUo(t))}var wDr=C(()=>{"use strict";Lk()});import{existsSync as aUo}from"node:fs";import{homedir as Nhe}from"node:os";import{dirname as uLt,join as Ux,resolve as NDr}from"node:path";import{fileURLToPath as lUo}from"node:url";function kDr(){let e=process.env.PI_PACKAGE_DIR;if(e)return e==="~"?Nhe():e.startsWith("~/")?Nhe()+e.slice(1):e;let t=RDr;for(;t!==uLt(t);){if(aUo(Ux(t,"package.json")))return t;t=uLt(t)}return RDr}function uGe(){return NDr(Ux(kDr(),"docs"))}function dGe(){return NDr(Ux(kDr(),"CHANGELOG.md"))}function DDr(e){return e==="~"?Nhe():e.startsWith("~/")?Nhe()+e.slice(1):e}function Nw(){let e=process.env.AUGMENT_CACHE_DIR;return e?DDr(e):Ux(Nhe(),".augment")}function nr(){let e=process.env[dLt];return e?DDr(e):Nw()}function Mhe(){return Ux(nr(),"themes")}function BDr(){return Ux(nr(),"models.json")}function LDr(){return Ux(nr(),"auth.json")}function FDr(){return Ux(nr(),"settings.json")}function m9(){return Nw()}function Iq(){return Ux(nr(),"bin")}function UDr(){return Ux(nr(),khe)}function VDr(){return Ux(nr(),`${ei}-debug.log`)}var cUo,RDr,ei,Ps,khe,Ohe,ODr,uUo,Gs,MDr,PDr,dLt,Ws=C(()=>{"use strict";mft();cUo=lUo(import.meta.url),RDr=uLt(cUo);ei=oD.piConfig?.name||"auggie",Ps=oD.piConfig?.configDir||".augment",khe="sessions-v2",Ohe=ei,ODr="Auggie Coding Agent",uUo="1.2.0-prerelease.202611031510",Gs=uUo??oD.version,MDr="2c02c0c37a9ce983fd62e407026f441855626f94",PDr="2026-11-03T23:10:38Z",dLt=`${ei.toUpperCase()}_CODING_AGENT_DIR`});var WDr,GDr=C(()=>{WDr={$schema:"https://raw.githubusercontent.com/badlogic/pi-mono/main/packages/coding-agent/src/modes/interactive/theme/theme-schema.json",name:"ansi",vars:{red:1,green:2,yellow:3,blue:4,magenta:5,cyan:6,gray:8,brightMagenta:13},colors:{accent:"magenta",border:"gray",borderAccent:"magenta",borderMuted:"gray",success:"green",error:"red",warning:"yellow",muted:"gray",dim:"gray",text:"",thinkingText:"gray",selectedBg:"gray",userMessageBg:"",userMessageText:"",customMessageBg:"",customMessageText:"",customMessageLabel:"magenta",toolPendingBg:"",toolSuccessBg:"",toolErrorBg:"",toolTitle:"magenta",toolOutput:"gray",mdHeading:"magenta",mdLink:"magenta",mdLinkUrl:"gray",mdCode:"magenta",mdCodeBlock:"green",mdCodeBlockBorder:"gray",mdQuote:"gray",mdQuoteBorder:"gray",mdHr:"gray",mdListBullet:"magenta",toolDiffAdded:"green",toolDiffRemoved:"red",toolDiffContext:"gray",syntaxComment:"gray",syntaxKeyword:"blue",syntaxFunction:"yellow",syntaxVariable:"cyan",syntaxString:"green",syntaxNumber:"magenta",syntaxType:"cyan",syntaxOperator:"",syntaxPunctuation:"",thinkingOff:"gray",thinkingMinimal:"gray",thinkingLow:"blue",thinkingMedium:"cyan",thinkingHigh:"magenta",thinkingXhigh:"brightMagenta",bashMode:"green"},export:{pageBg:"#18181e",cardBg:"#1e1e24",infoBg:"#3c3728"}}});var kw,$Dr=C(()=>{kw={$schema:"https://raw.githubusercontent.com/badlogic/pi-mono/main/packages/coding-agent/src/modes/interactive/theme/theme-schema.json",name:"dark",vars:{cyan:"#00d7ff",blue:"#5f87ff",green:"#b5bd68",red:"#cc6666",yellow:"#ffff00",gray:"#808080",dimGray:"#666666",darkGray:"#505050",accent:"#8abeb7",selectedBg:"#3a3a4a",userMsgBg:"#343541",toolPendingBg:"#282832",toolSuccessBg:"#283228",toolErrorBg:"#3c2828",customMsgBg:"#2d2838"},colors:{accent:"accent",border:"blue",borderAccent:"cyan",borderMuted:"darkGray",success:"green",error:"red",warning:"yellow",muted:"gray",dim:"dimGray",text:"",thinkingText:"gray",agentRed:"#CC6666",agentBlue:"#81A2BE",agentGreen:"#B5BD68",agentYellow:"#F0C674",agentOrange:"#CE9178",agentPurple:"#B294BB",agentPink:"#D183E8",agentCyan:"#8ABEB7",selectedBg:"selectedBg",userMessageBg:"userMsgBg",userMessageText:"",customMessageBg:"customMsgBg",customMessageText:"",customMessageLabel:"#9575cd",toolPendingBg:"toolPendingBg",toolSuccessBg:"toolSuccessBg",toolErrorBg:"toolErrorBg",toolTitle:"#b294bb",toolOutput:"gray",mdHeading:"#f0c674",mdLink:"#81a2be",mdLinkUrl:"dimGray",mdCode:"accent",mdCodeBlock:"green",mdCodeBlockBorder:"gray",mdQuote:"gray",mdQuoteBorder:"gray",mdHr:"gray",mdListBullet:"accent",toolDiffAdded:"green",toolDiffRemoved:"red",toolDiffContext:"gray",syntaxComment:"#6A9955",syntaxKeyword:"#569CD6",syntaxFunction:"#DCDCAA",syntaxVariable:"#9CDCFE",syntaxString:"#CE9178",syntaxNumber:"#B5CEA8",syntaxType:"#4EC9B0",syntaxOperator:"#D4D4D4",syntaxPunctuation:"#D4D4D4",thinkingOff:"darkGray",thinkingMinimal:"#6e6e6e",thinkingLow:"#5f87af",thinkingMedium:"#81a2be",thinkingHigh:"#b294bb",thinkingXhigh:"#d183e8",bashMode:"green"},export:{pageBg:"#18181e",cardBg:"#1e1e24",infoBg:"#3c3728"}}});var YDr,QDr=C(()=>{YDr={$schema:"https://raw.githubusercontent.com/badlogic/pi-mono/main/packages/coding-agent/src/modes/interactive/theme/theme-schema.json",name:"light",vars:{teal:"#5a8080",blue:"#547da7",green:"#588458",red:"#aa5555",yellow:"#9a7326",mediumGray:"#6c6c6c",dimGray:"#767676",lightGray:"#b0b0b0",selectedBg:"#d0d0e0",userMsgBg:"#e8e8e8",toolPendingBg:"#e8e8f0",toolSuccessBg:"#e8f0e8",toolErrorBg:"#f0e8e8",customMsgBg:"#ede7f6"},colors:{accent:"teal",border:"blue",borderAccent:"teal",borderMuted:"lightGray",success:"green",error:"red",warning:"yellow",muted:"mediumGray",dim:"dimGray",text:"",thinkingText:"mediumGray",agentRed:"#AA5555",agentBlue:"#476D94",agentGreen:"#477047",agentYellow:"#8A6822",agentOrange:"#795E26",agentPurple:"#875F87",agentPink:"#8B008B",agentCyan:"#4D7070",selectedBg:"selectedBg",userMessageBg:"userMsgBg",userMessageText:"",customMessageBg:"customMsgBg",customMessageText:"",customMessageLabel:"#7e57c2",toolPendingBg:"toolPendingBg",toolSuccessBg:"toolSuccessBg",toolErrorBg:"toolErrorBg",toolTitle:"",toolOutput:"mediumGray",mdHeading:"yellow",mdLink:"blue",mdLinkUrl:"dimGray",mdCode:"teal",mdCodeBlock:"green",mdCodeBlockBorder:"mediumGray",mdQuote:"mediumGray",mdQuoteBorder:"mediumGray",mdHr:"mediumGray",mdListBullet:"green",toolDiffAdded:"green",toolDiffRemoved:"red",toolDiffContext:"mediumGray",syntaxComment:"#008000",syntaxKeyword:"#0000FF",syntaxFunction:"#795E26",syntaxVariable:"#001080",syntaxString:"#A31515",syntaxNumber:"#098658",syntaxType:"#267F99",syntaxOperator:"#000000",syntaxPunctuation:"#000000",thinkingOff:"lightGray",thinkingMinimal:"#767676",thinkingLow:"blue",thinkingMedium:"teal",thinkingHigh:"#875f87",thinkingXhigh:"#8b008b",bashMode:"green"},export:{pageBg:"#f8f8f8",cardBg:"#ffffff",infoBg:"#fffae6"}}});import*as Wb from"node:fs";import*as mGe from"node:path";function hLt(){let e=process.env.COLORTERM;if(e==="truecolor"||e==="24bit"||process.env.WT_SESSION)return"truecolor";let t=process.env.TERM||"";return t==="dumb"||t===""||t==="linux"||process.env.TERM_PROGRAM==="Apple_Terminal"||t==="screen"||t.startsWith("screen-")||t.startsWith("screen.")?"256color":"truecolor"}function gLt(e){let t=e.replace("#","");if(t.length!==6)throw new Error(`Invalid hex color: ${e}`);let n=Number.parseInt(t.slice(0,2),16),r=Number.parseInt(t.slice(2,4),16),i=Number.parseInt(t.slice(4,6),16);if(Number.isNaN(n)||Number.isNaN(r)||Number.isNaN(i))throw new Error(`Invalid hex color: ${e}`);return{r:n,g:r,b:i}}function pLt(e){let t=Number.POSITIVE_INFINITY,n=0;for(let[r,i]of pGe.entries()){let s=Math.abs(e-i);s<t&&(t=s,n=r)}return n}function hUo(e){let t=Number.POSITIVE_INFINITY,n=0;for(let[r,i]of XDr.entries()){let s=Math.abs(e-i);s<t&&(t=s,n=r)}return n}function ZDr(e,t,n,r,i,s){let o=e-r,a=t-i,l=n-s;return o*o*.299+a*a*.587+l*l*.114}function bLt(e,t,n){let r=pLt(e),i=pLt(t),s=pLt(n),o=pGe[r]??0,a=pGe[i]??0,l=pGe[s]??0,u=16+36*r+6*i+s,c=ZDr(e,t,n,o,a,l),d=Math.round(.299*e+.587*t+.114*n),p=hUo(d),m=XDr[p]??0,f=232+p,h=ZDr(e,t,n,m,m,m),g=Math.max(e,t,n),b=Math.min(e,t,n);return g-b<10&&h<c?f:u}function KDr(e){let{r:t,g:n,b:r}=gLt(e);return bLt(t,n,r)}function qDr(e,t,n){return`\x1B[${e<8?t+e:n+e-8}m`}function jDr(e,t){if(e==="")return"\x1B[39m";if(typeof e=="number")return e<16?qDr(e,30,90):`\x1B[38;5;${e}m`;if(e.startsWith("#")){if(t==="truecolor"){let{r,g:i,b:s}=gLt(e);return`\x1B[38;2;${r};${i};${s}m`}return`\x1B[38;5;${KDr(e)}m`}throw new Error(`Invalid color value: ${e}`)}function gUo(e,t){if(e==="")return"\x1B[49m";if(typeof e=="number")return e<16?qDr(e,40,100):`\x1B[48;5;${e}m`;if(e.startsWith("#")){if(t==="truecolor"){let{r,g:i,b:s}=gLt(e);return`\x1B[48;2;${r};${i};${s}m`}return`\x1B[48;5;${KDr(e)}m`}throw new Error(`Invalid color value: ${e}`)}function yLt(e,t,n=new Set){if(typeof e=="number"||e===""||e.startsWith("#"))return e;if(n.has(e))throw new Error(`Circular variable reference detected: ${e}`);if(!(e in t))throw new Error(`Variable reference not found: ${e}`);n.add(e);let r=t[e];if(r===void 0)throw new Error(`Variable reference not found: ${e}`);return yLt(r,t,n)}function JDr(e,t={}){let n={};for(let[r,i]of Object.entries(e))n[r]=yLt(i,t);return n}function hGe(){let e=new Set(Object.keys(fGe)),t=Mhe();if(Wb.existsSync(t)){let n=Wb.readdirSync(t);for(let r of n)r.endsWith(".json")&&e.add(r.slice(0,-5))}for(let n of XW.keys())e.add(n);return Array.from(e).sort()}function eBr(){let e=Mhe(),t=[];for(let n of Object.keys(fGe))t.push({name:n,path:void 0});if(Wb.existsSync(e)){for(let n of Wb.readdirSync(e))if(n.endsWith(".json")){let r=n.slice(0,-5);t.some(i=>i.name===r)||t.push({name:r,path:mGe.join(e,n)})}}for(let[n,r]of XW.entries())t.some(i=>i.name===n)||t.push({name:n,path:r.sourcePath});return t.sort((n,r)=>n.name.localeCompare(r.name))}function bUo(e,t){if(!HDr.Check(t)){let n=Array.from(HDr.Errors(t)),r=[],i=[];for(let o of n){let l=o.path.match(/^\/colors\/(\w+)$/)?.[1];l&&o.message.includes("Required")?r.push(l):i.push(` - ${o.path}: ${o.message}`)}let s=`Invalid theme "${e}":
|
|
6402
|
+
Show whether the CLI has an active Augment authentication session.`,lFo="Note: Injected credentials remain active and may override the saved session.",cFo="Note: Injected credentials remain active.",uFo="AUGGIE_V2_SEGMENT_WRITE_KEY"});import{readFile as wFo}from"node:fs/promises";import{resolve as RFo}from"node:path";function OFo(e){let t=[],n;for(let r=0;r<e.length;r+=1){let i=e[r];if(i==="--"){t.push(...e.slice(r));break}if(i===QBt){let s=e[r+1];if(s===void 0||s.startsWith("-")||!s.trim())return{type:"fatal"};n=s,r+=1;continue}if(i.startsWith(`${QBt}=`)){let s=i.slice(QBt.length+1);if(!s.trim())return{type:"fatal"};n=s;continue}t.push(i)}return{type:"success",args:t,candidate:n}}async function LPr(e,t=kFo){let n=OFo(e);if(n.type==="fatal")return{type:"fatal",message:NFo};if(n.candidate===void 0)return{type:"success",args:n.args};let r=n.candidate.trim(),i;if(r.startsWith("{"))i=r;else try{i=await t.readPath(RFo(process.cwd(),r))}catch{return{type:"fatal",message:YBt}}let s;try{s=JSON.parse(i)}catch{return{type:"fatal",message:YBt}}let o=_de(s);return o?{type:"success",args:n.args,credentials:o}:{type:"fatal",message:YBt}}var QBt,NFo,YBt,kFo,FPr=C(()=>{"use strict";Sde();QBt="--augment-session-json",NFo="--augment-session-json requires a value",YBt="--augment-session-json value is unusable",kFo={readPath:e=>wFo(e,"utf8")}});import{execFile as MFo}from"node:child_process";import{existsSync as PFo,rmSync as DFo}from"node:fs";import{promisify as BFo}from"node:util";function ZBt(e){let t=e.match(/^git@github\.com:(.+?)(?:\.git)?$/);if(t){let r=t[1];return{sshUrl:`git@github.com:${r}.git`,httpsUrl:`https://github.com/${r}.git`}}let n=e.match(/^https?:\/\/github\.com\/(.+?)(?:\.git)?$/);if(n){let r=n[1];return{sshUrl:`git@github.com:${r}.git`,httpsUrl:`https://github.com/${r}.git`}}return{sshUrl:e,httpsUrl:e}}function WPr(e){return e instanceof Error?e.message:String(e)}async function jBt({sshUrl:e,httpsUrl:t,targetDir:n,extraArgs:r=[]}){let i,s=e===t?[{url:e,env:e.startsWith("http")?HBt:UPr}]:[{url:e,env:UPr},{url:t,env:HBt}];for(let o of s)try{return await GPr("git",["clone","--depth","1",...r,o.url,n],{env:o.env}),{success:!0}}catch(a){i=a,PFo(n)&&DFo(n,{recursive:!0,force:!0})}return{success:!1,error:WPr(i)}}function VPr(e,t){return GPr("git",e,{cwd:t,env:HBt})}async function $Pr(e,t){try{return await VPr(["fetch","--depth","1","origin",t],e),await VPr(["checkout","FETCH_HEAD"],e),{success:!0}}catch(n){return{success:!1,error:WPr(n)}}}var GPr,UPr,HBt,QPr=C(()=>{"use strict";GPr=BFo(MFo),UPr={...process.env,GIT_TERMINAL_PROMPT:"0",GIT_SSH_COMMAND:"ssh -o BatchMode=yes"},HBt={...process.env,GIT_TERMINAL_PROMPT:"0"}});import{readFileSync as LFo}from"node:fs";import{join as zBt}from"node:path";function u9(e){let t=FFo(e,YPr);return t.manifest||t.diagnostics.length>0?t:{diagnostics:[`no marketplace manifest found (looked for ${YPr.join(", ")})`]}}function FFo(e,t){let n=[];for(let r of t){let i=zBt(e,r),s;try{s=LFo(i,"utf-8")}catch{continue}try{let o=JSON.parse(s);if(o&&typeof o=="object"&&!Array.isArray(o))return{manifest:o,manifestPath:i,diagnostics:n};n.push(`manifest at ${r} is not a JSON object; ignoring`)}catch(o){n.push(`failed to parse manifest at ${r}: ${o.message}`)}}return{diagnostics:n}}var YPr,jVe=C(()=>{"use strict";YPr=[zBt(".augment-plugin","marketplace.json"),zBt(".claude-plugin","marketplace.json")]});import{execFile as UFo}from"node:child_process";import{existsSync as Tw,mkdirSync as ZPr,readdirSync as VFo,renameSync as GFo,rmSync as WFo,statSync as $Fo}from"node:fs";import{dirname as QFo,isAbsolute as jPr,join as Iw,relative as zPr,resolve as XBt}from"node:path";import{promisify as YFo}from"node:util";function qPr(e){let t=e.replace(/\.\./g,"").replace(/[/\\]/g,"").replace(/^\.+/,"").trim();return!t||!/^[a-zA-Z0-9][a-zA-Z0-9._-]*$/.test(t)?null:t}function HPr(e){let t=e.replace(/\.\./g,"").replace(/[/\\]/g,"").replace(/^\.+/,"").trim();return!t||!/^[a-zA-Z0-9][a-zA-Z0-9._-]*$/.test(t)?null:t}function HFo(e){let t=e.trim();if(!t)return null;let n=t.match(/^([a-zA-Z0-9_-]+)\/([a-zA-Z0-9_.-]+?)(?:@(.+))?$/);if(n?.[1]&&n[2]){let r=n[1],i=n[2].replace(/\.git$/,"");return{repo:i,cloneUrl:`https://github.com/${r}/${i}`,...n[3]?{ref:n[3]}:{}}}if(/^(https?|ssh|file):\/\/|^git@/.test(t)){let[r,i]=t.split("#");if(!r)return null;let s=r.replace(/\/+$/,""),o=s.split(/[/:]/).pop()?.replace(/\.git$/,"");if(o)return{repo:o,cloneUrl:s,...i?{ref:i}:{}}}return null}function ww(e){return typeof e=="string"&&e.length>0?e:void 0}function ZFo(e,t){let n=ww(e.repo);return n?{kind:"github",url:`https://github.com/${n.replace(/\.git$/,"")}.git`,...t?{ref:t}:{},...ww(e.path)?{subdir:ww(e.path)}:{}}:null}function jFo(e,t){let n=ww(e.url);return n?{kind:"url",url:n,...t?{ref:t}:{},...ww(e.path)?{subdir:ww(e.path)}:{}}:null}function zFo(e,t){let n=ww(e.url),r=ww(e.path);return n&&r?{kind:"git-subdir",url:n,subdir:r,...t?{ref:t}:{}}:null}function KBt(e){if(!e||typeof e!="object")return null;let t=e,n=ww(t.sha)??ww(t.ref);switch(t.source){case"github":return ZFo(t,n);case"url":return jFo(t,n);case"git-subdir":return zFo(t,n);default:return null}}function JPr(e,t,n){let r=qPr(t);if(!r)return;let i=Iw(e,KPr,r);if(!Tw(Iw(i,".git")))return;if(!n)return i;let s=XBt(i,n),o=zPr(i,s);if(!(o.startsWith("..")||jPr(o)))return Tw(s)?s:void 0}async function XFo(e,t){let n=typeof t.name=="string"?t.name:"",r=KBt(t.source);if(!r)return;let i=qPr(n);if(!i)return{name:n,status:"failed",error:"invalid plugin cache name"};let s=Iw(e,KPr,i);if(Tw(Iw(s,".git")))return{name:n,status:"skipped"};let o=QFo(s);Tw(o)||ZPr(o,{recursive:!0});let{sshUrl:a,httpsUrl:l}=ZBt(r.url),u=r.kind==="git-subdir",c=await jBt({sshUrl:a,httpsUrl:l,targetDir:s,extraArgs:u?["--filter=blob:none","--sparse"]:[]});if(!c.success)return{name:n,status:"failed",error:c.error};if(r.ref){let d=await $Pr(s,r.ref);if(!d.success)return{name:n,status:"failed",error:d.error}}if(u&&r.kind==="git-subdir")try{await XPr("git",["sparse-checkout","set",r.subdir],{cwd:s,env:{...process.env,GIT_TERMINAL_PROMPT:"0"}})}catch(d){return{name:n,status:"failed",error:d instanceof Error?d.message:String(d)}}return{name:n,status:"cloned"}}async function qBt(e){let{manifest:t}=u9(e),n=t?.plugins;if(!n||n.length===0)return[];let r=[];for(let i of n){let s=await XFo(e,i);s&&r.push(s)}return r}function KFo(e){try{return $Fo(e).isDirectory()}catch{return!1}}function qFo(e,t){let n=zPr(XBt(e),XBt(t));return n!==""&&!n.startsWith("..")&&!jPr(n)}async function Aq(e,t){let n=HFo(t);if(!n)return{success:!1,error:`Invalid repository: ${t}. Expected owner/repo, a Git URL (HTTPS/SSH/file), or a github.com URL.`};let{repo:r,ref:i,cloneUrl:s}=n;Tw(e)||ZPr(e,{recursive:!0});let o=HPr(r);if(!o)return{success:!1,error:`Invalid repository name for marketplace directory: "${r}".`};let a=Iw(e,o);if(Tw(a))return{success:!1,alreadyInstalled:!0,marketplaceId:o,error:`Marketplace '${o}' is already installed.`};let{sshUrl:l,httpsUrl:u}=ZBt(s),c=await jBt({sshUrl:l,httpsUrl:u,targetDir:a,extraArgs:i?["--branch",i]:[]});if(!c.success)return{success:!1,error:`Failed to clone '${s}': ${c.error}`};let{manifest:d}=u9(a),p=o,m=typeof d?.name=="string"?HPr(d.name):null;if(m&&m!==o){let f=Iw(e,m);if(!Tw(f))try{GFo(a,f),p=m}catch{}}return await qBt(Iw(e,p)),{success:!0,marketplaceId:p}}function Eq(e,t){let n=Iw(e,t);if(!qFo(e,n))return{success:!1,error:`Refusing to remove '${t}': path is outside the marketplaces directory.`};if(!Tw(n))return{success:!1,error:`Marketplace '${t}' not found.`};try{return WFo(n,{recursive:!0,force:!0}),{success:!0}}catch(r){return{success:!1,error:`Failed to remove '${t}': ${r instanceof Error?r.message:String(r)}`}}}async function eDr(e){if(!Tw(Iw(e,".git")))return{success:!1,notGitRepo:!0,error:"Not a git repository"};try{return await XPr("git",["pull"],{cwd:e,env:{...process.env,GIT_TERMINAL_PROMPT:"0"}}),await qBt(e),{success:!0}}catch(t){return{success:!1,error:t instanceof Error?t.message:String(t)}}}async function tDr(e){let t=!1;for(let n of e){if(!Tw(n))continue;let r;try{r=VFo(n)}catch{continue}for(let i of r){let s=Iw(n,i);if(!KFo(s))continue;(await qBt(s)).some(a=>a.status==="cloned")&&(t=!0)}}return t}var XPr,KPr,zVe=C(()=>{"use strict";QPr();jVe();XPr=YFo(UFo),KPr=".plugin-cache"});import{readFileSync as JFo}from"node:fs";import{join as e5o}from"node:path";function XVe(e){let t=e5o(e,"hooks","hooks.json"),n;try{n=JFo(t,"utf-8")}catch{return{diagnostics:[]}}let r;try{r=JSON.parse(n)}catch(s){return{diagnostics:[`failed to parse hooks/hooks.json: ${s.message}`]}}return!r||typeof r!="object"||Array.isArray(r)?{diagnostics:["hooks/hooks.json must be a JSON object"]}:{config:zI(r),diagnostics:[]}}var JBt=C(()=>{"use strict";J2()});import{existsSync as t5o,lstatSync as n5o,readdirSync as sDr,realpathSync as nDr,statSync as r5o}from"node:fs";import{basename as rDr,isAbsolute as eLt,join as xhe,relative as oDr,resolve as tLt}from"node:path";function nLt(e,t){let n=[],r=[],i=[],s=new Map;for(let o of new Set(e))for(let a of i5o(o,t,r)){let l=s.get(a.id);if(l!==void 0){i.push({id:a.id,shadowedRoot:o,winnerRoot:l});continue}s.set(a.id,o),n.push(a)}for(let[o,a]of Object.entries(t))a&&!s.has(o)&&r.push(`enabledPlugins["${o}"] = true but no plugin with that id was found in any marketplace root`);return{plugins:n,globalDiagnostics:r,shadowedPlugins:i}}function i5o(e,t,n){let r=[];if(!t5o(e))return r;let i=u9(e);if(!i.manifest)for(let o of i.diagnostics)o.startsWith("no marketplace manifest found")||n.push(`[${rDr(e)}] ${o}`);if(i.manifest)return iDr(e,rDr(e),t,r,n),r;let s;try{s=sDr(e)}catch(o){return n.push(`failed to read marketplaces directory ${e}: ${o.message}`),r}for(let o of s){let a=xhe(e,o);Che(a)&&iDr(a,o,t,r,n)}return r}function iDr(e,t,n,r,i){let s=u9(e);if(!s.manifest){for(let u of s.diagnostics)i.push(`[${t}] ${u}`);return}let o=d5o(s.manifest.name,t),a=u5o(e,s.manifest.metadata?.pluginRoot),l=Array.isArray(s.manifest.plugins)?s.manifest.plugins:[];l.length===0&&i.push(`[${o}] marketplace.json has no plugins[] entries`);for(let u of l){let c=s5o(u,e,a,o,n);c&&r.push(c)}for(let u of s.diagnostics)i.push(`[${o}] ${u}`)}function s5o(e,t,n,r,i){let s=typeof e.name=="string"?d9(e.name):void 0;if(!s)return;let o=`${s}@${r}`,a=i[o]===!0,l=[],u=c5o(e.source,s,t,n,l);return u?a5o(o,r,s,u,a,l,t):{id:o,marketplace:r,name:s,enabled:a,commandsDir:void 0,skillsDir:void 0,hooksConfig:void 0,agentsDirPresent:!1,diagnostics:l}}function o5o(e,t){let n=[],r;try{r=sDr(e).sort()}catch(s){return t.push(`failed to read agents directory: ${s.message}`),n}let i=[];for(let s of r){if(!s.endsWith(".md"))continue;let o=xhe(e,s);try{if(!n5o(o).isFile()){i.push(s);continue}}catch(a){t.push(`failed to stat agent file ${s}: ${a.message}`);continue}n.push(o)}return i.length>0&&t.push(`ignoring non-regular agent file(s) under agents/ (symlinks / dirs / devices are not followed): ${i.join(", ")}`),n}function a5o(e,t,n,r,i,s,o){let a=xhe(r,"commands"),l=xhe(r,"skills"),u=xhe(r,"agents"),c=p5o(a,r,s),d=Che(l)?l:void 0,p=Che(u),m=p&&i?o5o(u,s):void 0,f=XVe(r);for(let h of f.diagnostics)s.push(h);return{id:e,marketplace:t,name:n,root:r,marketplacePath:tLt(o),enabled:i,commandsDir:c,skillsDir:d,hooksConfig:f.config,agentsDirPresent:p,agentFiles:m,diagnostics:s}}function l5o(e,t,n,r){let i=KBt(e);if(!i){let o=e.source;r.push(`source kind "${typeof o=="string"?o:"object"}" is not supported; install the plugin manually as a relative directory`);return}let s=JPr(n,t,i.subdir);if(s)return s;r.push(`source kind "${i.kind}" not fetched yet; run /plugins to clone it (or marketplace update)`)}function c5o(e,t,n,r,i){if(typeof e!="string"){if(e&&typeof e=="object")return l5o(e,t,n,i);i.push("plugin entry has no source field; skipping");return}if(eLt(e)){i.push(`absolute source "${e}" is not allowed; skipping`);return}let s=e.startsWith("./")?n:r,o=tLt(s,e),a=oDr(n,o);if(a.startsWith("..")||eLt(a)){i.push(`source "${e}" resolves outside the marketplace root; skipping`);return}if(!Che(o)){i.push(`source "${e}" does not point to an existing directory (looked at ${o})`);return}return o}function u5o(e,t){return typeof t!="string"||t.length===0?e:tLt(e,t)}function d5o(e,t){if(typeof e=="string"&&e.length>0){let n=d9(e);if(n.length>0)return n}return t}function d9(e){let t="";for(let n of e){let r=n.codePointAt(0);if(r===void 0)continue;let i=r<=31,s=r>=127&&r<=159;i||s||(t+=n)}return t}function p5o(e,t,n){if(Che(e))try{let r=oDr(nDr(t),nDr(e));if(r===".."||r.startsWith("../")||r.startsWith("..\\")||eLt(r)){n.push("commands/ directory resolves outside the plugin root");return}return e}catch{n.push("commands/ directory could not be resolved");return}}function Che(e){try{return r5o(e).isDirectory()}catch{return!1}}var The=C(()=>{"use strict";zVe();JBt();jVe()});import{readFileSync as m5o}from"node:fs";import{basename as f5o}from"node:path";function Px(e,t,n=!0){if(e!==void 0){if(typeof e!="string")throw new Dx(`Invalid ${t}: expected a string.`);return n?e.trim():e}}function Bk(e,t){if(e!==void 0){if(typeof e!="boolean")throw new Dx(`Invalid ${t}: expected a boolean.`);return e}}function aDr(e){return d9(e.trim().replace(/\s+/g,"-").replace(/[^a-zA-Z0-9_-]/g,"-").replace(/-+/g,"-"))}function KVe(e,t){if(typeof e=="string")return e.trim()==="none"?[]:[...new Set(e.split(",").map(n=>n.trim()).filter(Boolean))];if(!Array.isArray(e)||e.some(n=>typeof n!="string"||!n.trim()))throw new Dx(`Invalid ${t}: expected named strings as a list or CSV.`);return[...new Set(e.map(n=>n.trim()))]}function b5o(e){if(e===void 0)return!0;if(typeof e=="boolean")throw new Dx("Boolean skills is unsupported. Use disable_skills: true for opt-out; omit skills for defaults.");let t=KVe(e,"skills");return t.length?t:!1}function y5o(e){switch(e){case"red":case"blue":case"green":case"yellow":case"orange":case"purple":case"pink":case"cyan":return e;default:return}}function rLt(e,t,n){return{name:e,pluginId:t,source:"plugin",description:e,enabled:!1,invalidDefinition:!0,diagnostics:[n],builtinToolNames:[],disallowedTools:[],extensions:!1,skills:!1,systemPrompt:"",promptMode:"append"}}function A5o(e){if(typeof e=="string")return g5o.includes(e)?e:void 0}function E5o(e){return typeof e=="number"&&e>=0?e:void 0}function _5o(e){if(e==="user"||e==="project"||e==="local")return e}function S5o(e){if(e==null||e===!0)return!0;if(e===!1||e==="none")return!1;let t=KVe(e,"extensions");return t.length>0?t:!1}function v5o(e,t){let n=f5o(e,".md"),r=aDr(n),i;try{i=m5o(e,"utf-8")}catch{return rLt(r,t,"Custom-agent file could not be read.")}try{let{frontmatter:s,body:o}=ux(i);if(!s||typeof s!="object"||Array.isArray(s))throw new Dx("Invalid frontmatter mapping.");if(r=aDr(Px(s.name,"name")||n),!r)throw new Dx("Invalid name: a non-empty identity is required.");for(let[a,l]of Object.entries({disallowed_tools:"Use disabled_tools instead.",prompt_mode:"Use replace_system_prompt: false for append or true for replace.",inherit_skills:"Use disable_skills for opt-out or skills for named selection."}))if(Object.hasOwn(s,a))throw new Dx(`Removed frontmatter field ${a}. ${l}`);return C5o({fm:s,body:o,name:r,pluginId:t})}catch(s){return rLt(r,t,s instanceof Dx?s.message:"Invalid custom-agent definition.")}}function x5o(e){let t=Px(e.thinking,"thinking"),n=A5o(t),r=y5o(e.color),i=[];return e.color!==void 0&&!r&&i.push("Invalid color: expected a supported terminal label color."),t!==void 0&&n===void 0&&i.push("Invalid thinking: expected a supported thinking level. Model default retained."),{color:r,thinking:n,diagnostics:i.length?i:void 0}}function C5o({fm:e,body:t,name:n,pluginId:r}){let i=Bk(e.replace_system_prompt,"replace_system_prompt")??!1;if(i&&!t.trim())throw new Dx("replace_system_prompt requires a non-empty Markdown body.");let s=Bk(e.disable_skills,"disable_skills")??!1,o=b5o(e.skills);return{name:n,displayName:Px(e.display_name,"display_name")||n,description:Px(e.description,"description")||n,...x5o(e),toolDescription:Px(e.tool_description,"tool_description")||void 0,instructionDescription:Px(e.instruction_description,"instruction_description")||void 0,providerModel:Px(e.provider_model,"provider_model",!1),providerApiKey:Px(e.provider_api_key,"provider_api_key",!1),providerBaseUrl:Px(e.provider_base_url,"provider_base_url",!1),builtinToolNames:e.tools===void 0?[...h5o]:KVe(e.tools,"tools"),disallowedTools:e.disabled_tools===void 0?void 0:KVe(e.disabled_tools,"disabled_tools"),extensions:S5o(e.extensions??e.inherit_extensions),skills:s?!1:o,disableSkills:s,disableRules:Bk(e.disable_rules,"disable_rules")??!1,disableWorkspaceGuidelines:Bk(e.disable_workspace_guidelines,"disable_workspace_guidelines")??!1,model:Px(e.model,"model"),maxTurns:E5o(e.max_turns),systemPrompt:t.trim(),replaceSystemPrompt:i,promptMode:i?"replace":"append",inheritContext:Bk(e.inherit_context,"inherit_context"),runInBackground:Bk(e.run_in_background,"run_in_background"),isolated:Bk(e.isolated,"isolated"),memory:_5o(e.memory),isolation:e.isolation==="worktree"?"worktree":void 0,enabled:Bk(e.enabled,"enabled")??!0,hidden:Bk(e.hidden,"hidden")??!1,finishTool:Px(e.finish_tool,"finish_tool"),source:"plugin",pluginId:r}}function cDr(e){let t=new Map,n=[];if(!e.agentFiles||e.agentFiles.length===0)return{agents:t,diagnostics:n};let r=new Map;for(let i of e.agentFiles){let s=v5o(i,e.id);n.push(...s.diagnostics??[]);let o=s.name.toLowerCase();if(r.has(o)){let a=r.get(o)??s.name,l="Duplicate agent identity in the same directory.";n.push(l),t.set(a,rLt(a,e.id,l));continue}t.set(s.name,s),r.set(o,s.name)}return{agents:t,diagnostics:n}}var h5o,g5o,lDr,Dx,uDr=C(()=>{"use strict";Ms();The();h5o=["read","bash","edit","write","grep","find","ls"],g5o=["off","minimal","low","medium","high","xhigh"],lDr=["general-purpose","explore","plan"],Dx=class extends Error{}});import{lstatSync as T5o,readFileSync as I5o,realpathSync as dDr}from"node:fs";import{isAbsolute as w5o,join as R5o,relative as N5o}from"node:path";function _q(e,t){let n=e;for(let r of k5o){let i=`\${${r}}`;n.includes(i)&&(n=n.split(i).join(t))}return n}function iLt(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function pDr(e){if(!e)return;let t={};for(let[n,r]of Object.entries(e))r!=null&&(t[n]=String(r));return Object.keys(t).length>0?t:void 0}function O5o(e){if(e.type==="stdio"||e.type==="http"||e.type==="sse")return e.type;if(e.url)return"http";if(e.command)return"stdio"}function M5o(e,t){let n=O5o(t);if(!n)throw new Error(`MCP server "${e}" must declare a 'command' (stdio) or 'url' (http/sse) property`);if(n==="http"||n==="sse"){if(!t.url)throw new Error(`MCP server "${e}" has type "${n}" but no 'url' property`);let a=typeof t.clientId=="string"?t.clientId.trim():void 0;return{type:n,name:e,disabled:t.disabled,url:t.url,headers:pDr(t.headers),auth:t.auth==="oauth"?"oauth":void 0,...a?{clientId:a}:{},cwd:t.cwd,timeoutMs:t.timeoutMs}}let r=t.command;if(!r)throw new Error(`MCP server "${e}" has type "stdio" but no 'command' property`);let i=Array.isArray(t.args)?t.args.map(a=>String(a)):[],s=t.useShellInterpolation??!0,o=s&&i.length>0?`${r} ${i.join(" ")}`:r;return{type:"stdio",name:e,disabled:t.disabled,command:o,args:s?[]:i,env:pDr(t.env),cwd:t.cwd,timeoutMs:t.timeoutMs,useShellInterpolation:s}}function mDr(e,t){if(!e)return;let n={};for(let[r,i]of Object.entries(e))n[r]=_q(i,t);return n}function P5o(e,t){return e.type==="stdio"?{...e,command:_q(e.command,t),args:e.args.map(n=>_q(n,t)),env:mDr(e.env,t),cwd:e.cwd?_q(e.cwd,t):void 0}:{...e,url:_q(e.url,t),headers:mDr(e.headers,t),cwd:e.cwd?_q(e.cwd,t):void 0}}function D5o(e,t){let n=R5o(e,".mcp.json"),r;try{r=T5o(n)}catch(i){if(i?.code==="ENOENT")return;t.push(`failed to stat .mcp.json: ${i.message}`);return}if(r.isSymbolicLink()){t.push(".mcp.json is a symlink; refusing to follow it out of the plugin root");return}if(!r.isFile()){t.push(".mcp.json is not a regular file; skipping");return}try{let i=dDr(e),s=dDr(n),o=N5o(i,s);if(o.startsWith("..")||w5o(o)){t.push(".mcp.json resolves outside the plugin root; skipping");return}}catch(i){t.push(`failed to resolve .mcp.json real path: ${i.message}`);return}try{return I5o(n,"utf-8")}catch(i){t.push(`failed to read .mcp.json: ${i.message}`);return}}function qVe(e){let t=[];if(!e.root)return{servers:[],diagnostics:t};let n=D5o(e.root,t);if(n===void 0)return{servers:[],diagnostics:t};let r;try{r=JSON.parse(n)}catch(o){return t.push(`failed to parse .mcp.json: ${o.message}`),{servers:[],diagnostics:t}}if(!iLt(r))return t.push(".mcp.json must be a JSON object"),{servers:[],diagnostics:t};let i=r.mcpServers;if(!iLt(i))return t.push('.mcp.json must contain an "mcpServers" object'),{servers:[],diagnostics:t};let s=[];for(let[o,a]of Object.entries(i)){let l=`${e.id}/${d9(o)}`;if(!iLt(a)){t.push(`MCP server "${l}" must be a JSON object`);continue}try{let u=M5o(l,a);s.push(P5o(u,e.root))}catch(u){t.push(u instanceof Error?u.message:String(u))}}return{servers:s,diagnostics:t}}var k5o,fDr,sLt=C(()=>{"use strict";The();k5o=["CLAUDE_PLUGIN_ROOT","AUGMENT_PLUGIN_ROOT","AUGGIE_PLUGIN_ROOT"];fDr="hermes:mcp:register-server-source"});function hDr(e,t,n){let r=gi.create(e,t,n),i={};for(let o of[r.getVfsOrgSettings(),r.getVfsSpaceSettings(),r.getVfsUserSettings(),r.getSettings()])for(let[a,l]of Object.entries(o.enabledPlugins??{}))typeof l=="boolean"&&(i[a]=l);let s=r.drainErrors().map(({scope:o,error:a})=>`failed to load ${o} settings: ${a.message}; enabledPlugins entries from this scope will be ignored`);return{enabled:i,diagnostics:s}}var gDr=C(()=>{"use strict";Ms()});var bDr,yDr=C(()=>{"use strict";bDr="hermes:subagents:register-agent-source"});import{lstatSync as B5o,readdirSync as L5o,readFileSync as oLt}from"node:fs";import{basename as F5o,dirname as U5o,extname as V5o,isAbsolute as G5o,join as Bx,parse as W5o,relative as Sq,resolve as Ihe,sep as aLt}from"node:path";function JVe(e){return typeof e=="string"&&eGe(e)||void 0}function ADr(e,t){let n=Sq(e,t);return!G5o(n)&&n!==".."&&!n.startsWith(`..${aLt}`)}function $5o(e,t,n){let r=n?Ihe(n):W5o(e).root;if(!ADr(r,e)||!ADr(e,t))throw new Error("Plugin metadata path is outside the plugin root");let i=r,s;for(let o of["",...Sq(r,t).split(aLt).filter(Boolean)]){i=Bx(i,o);try{s=B5o(i)}catch(a){if(a.code==="ENOENT")return;throw a}if(s.isSymbolicLink())throw new Error("Plugin metadata path contains a symbolic link")}return s}function vq(e){let t={agents:[],commands:[],rules:[],mcpServers:[],hooks:[],skills:[],diagnostics:[]};if(!e.root)return t.diagnostics.push("Plugin source is unavailable"),t;let n=Ihe(e.root),r=d=>$5o(n,d,e.marketplacePath),i=Kz(),s=d=>{let p=`Could not read plugin ${d} metadata`;t.diagnostics.includes(p)||t.diagnostics.push(p)};try{if(!r(n)?.isDirectory())throw new Error("Plugin root is unavailable")}catch{return s("contents"),t}let o=(d,p,m,f)=>{let h={name:eGe(p)};try{if(!r(d)?.isFile())throw new Error("Plugin metadata file is unavailable");let{frontmatter:g}=ux(oLt(d,"utf8"));if(!g||typeof g!="object"||Array.isArray(g))throw new Error("Invalid plugin frontmatter");f&&(h.name=JVe(g.name)??h.name),h.description=JVe(g.description)}catch{s(m)}return h},a=(d,p,m)=>{let f=V5o(p);if(!(f===".md"||(d==="commands"||d==="rules")&&f===".txt")||d==="skills"&&U5o(p)!==m)return;let g=Sq(m,p),b=d==="rules"?g:g.slice(0,-f.length).split(aLt).join(":");t[d].push(o(p,b,d,d==="agents"||d==="skills"))},l=(d,p,m)=>{try{let f=r(p);if(d==="skills"&&XB(i,Sq(m,p),f?.isDirectory()))return;f?.isDirectory()?d!=="agents"&&c(d,p,m):f?.isFile()&&a(d,p,m)}catch{s(d)}},u=(d,p)=>{for(let m of Xz){let f=Bx(d,m);try{let h=r(f);if(!h)continue;if(!h.isFile())throw new Error("Invalid skill ignore file");qz(i,oLt(f,"utf8"),Sq(p,d))}catch{s("skills")}}},c=(d,p,m=p)=>{try{let f=r(p);if(!f)return;if(!f.isDirectory())throw new Error("Plugin metadata directory is invalid");if(d==="skills"){u(p,m);let h=Bx(p,"SKILL.md");if(!XB(i,Sq(m,h))&&r(h)?.isFile()){t.skills.push(o(h,F5o(p),d,!0));return}}for(let h of L5o(p).sort())(d==="commands"||d==="skills")&&zB(h)||l(d,Bx(p,h),m)}catch{s(d)}};return c("agents",Bx(n,"agents")),c("commands",Ihe(e.commandsDir??Bx(n,"commands"))),c("rules",Bx(n,"rules")),c("skills",Ihe(e.skillsDir??Bx(n,"skills"))),t.hooks=H5o(n,r,s),t.mcpServers=Z5o(e,r,s),Object.assign(t,Y5o(n,r,s)),t}function Q5o(e){let t={};for(let s of["description","version","homepage"]){let o=JVe(e[s]);o&&(t[s]=o)}let n=e.author,r=n&&typeof n=="object"&&!Array.isArray(n)?n.name:n,i=JVe(r);return i&&(t.author=i),t}function Y5o(e,t,n){for(let r of[".augment-plugin",".claude-plugin"])try{let i=Bx(e,r,"plugin.json"),s=t(i);if(!s)continue;if(!s.isFile())throw new Error("Invalid plugin manifest file");let o=JSON.parse(oLt(i,"utf8"));if(!o||typeof o!="object"||Array.isArray(o))throw new Error("Invalid plugin manifest");return Q5o(o)}catch{n("manifest")}return{}}function H5o(e,t,n){let r=[];try{let i=t(Bx(e,"hooks","hooks.json"));if(i){if(!i.isFile())throw new Error("Invalid plugin hooks file");let{config:s,diagnostics:o}=XVe(e);(!s||o.length)&&n("hook");for(let[a,l]of Object.entries(s??{}).sort(([u],[c])=>u.localeCompare(c)))for(let u of l??[])r.push({name:eGe(`${a}[${u.matcher??".*"}]`),description:"Command hook"})}}catch{n("hook")}return r}function Z5o(e,t,n){if(!e.root)return[];let r=Ihe(e.root);try{let i=t(Bx(r,".mcp.json"));if(i){if(!i.isFile())throw new Error("Invalid plugin MCP file");let{servers:s,diagnostics:o}=qVe(e);return o.length&&n("MCP server"),s.map(a=>({name:eGe(a.name.slice(e.id.length+1)),description:`${a.type==="stdio"?"stdio":a.type.toUpperCase()} server`})).sort((a,l)=>a.name.localeCompare(l.name))}}catch{n("MCP server")}return[]}var eGe,EDr=C(()=>{"use strict";Ms();The();JBt();sLt();eGe=e=>d9(e.replace(/\s+/g," ")).trim()});var Rhe={};li(Rhe,{addMarketplace:()=>Aq,default:()=>rGe,getDiscoveredMarketplaces:()=>whe,getDiscoveredPlugins:()=>Lx,getInteractivePluginDiagnostics:()=>iUo,getPluginDetails:()=>vq,getPluginDiagnostics:()=>Fx,getV2MarketplacesRoot:()=>Cq,removeMarketplace:()=>Eq,updateMarketplace:()=>eDr});import{join as HW,resolve as j5o}from"node:path";import{existsSync as z5o,readdirSync as X5o,statSync as K5o}from"node:fs";function J5o(){return globalThis[_Dr]??{}}function eUo(e){globalThis[_Dr]=e}function rGe(e){u1=[],nGe=[],tGe=[],lLt=[],xq=[];let t=!1,n,r=new Map,i,s,o=new Map,a;e.events.on(U9e,w=>{n=w.register}),e.events.on(bDr,w=>{i=w.register}),e.events.on(fDr,w=>{a=w.registerServerSource}),e.events.on(q5o,w=>{eUo(w?.scopes??{})});function l(w,T,D=[]){let M=J5o(),{enabled:P,diagnostics:O}=hDr(w,T,M),k=[...new Set(D.map(ne=>j5o(w,ne)))],L=nLt(k,{}),F={...P};for(let ne of L.plugins)F[ne.id]=!0;let Y=HW(TA(),"plugins","marketplaces"),U=HW(T,"plugins","marketplaces"),J=[M.user,M.space,M.org].flatMap(ne=>ne?[HW(ne,".augment","plugins","marketplaces")]:[]),ie=nLt([...k,Y,U,...J],F);for(let ne of ie.shadowedPlugins)mE.debug(`plugin "${ne.id}" from ${ne.shadowedRoot} is shadowed by the higher-precedence root ${ne.winnerRoot}`);return ie.globalDiagnostics=[...O,...ie.globalDiagnostics],u1=ie.plugins,nGe=ie.globalDiagnostics,t=!0,ie}function u(w,T,D=[]){t||l(w,T,D)}function c(){let w=new Map,T=new Map;tGe=[];let D=[...u1.filter(M=>M.enabled)].sort((M,P)=>M.id.localeCompare(P.id));for(let M of D){let{agents:P,diagnostics:O}=cDr(M);for(let k of O)mE.warn(`[${M.id}] ${k}`),tGe.push({type:"warning",message:`[${M.id}] ${k}`,path:M.root});for(let[k,L]of P)d(M.id,k,L,w,T)}o=w}function d(w,T,D,M,P){let O=T.toLowerCase(),k=P.get(O);if(k){let L=k.name===T?`"${T}"`:`"${T}" (case-insensitive collision with "${k.name}")`;mE.warn(`[${w}] plugin-contributed agent ${L} shadowed by earlier plugin ${k.pluginId}; ignoring`);return}lDr.includes(O)&&mE.warn(`[${w}] plugin-contributed agent "${T}" shadows the built-in default agent of the same name; the plugin's definition will be used for every Agent-tool invocation across this session`),M.set(T,D),P.set(O,{pluginId:w,name:T})}function p(){if(!i)return;s?.(),s=i({getAgents:()=>o,getDiagnostics:()=>tGe})}function m(){let w=[];xq=[];let T=[...u1.filter(D=>D.enabled)].sort((D,M)=>D.id.localeCompare(M.id));for(let D of T){let{servers:M,diagnostics:P}=qVe(D);for(let O of P)mE.warn(`[${D.id}] ${O}`),xq.push({type:"warning",message:`[${D.id}] ${O}`,path:D.root});for(let O of M)w.push(O)}lLt=w}function f(){if(!a)return;a({source:"plugin",getServers:()=>lLt,getDiagnostics:()=>xq})}function h(){if(n){for(let w of r.values())w();r.clear();for(let w of u1){if(!w.enabled)continue;let T=tUo(w);T&&r.set(w.id,n(T))}}}function g(){for(let w of r.values())w();r.clear()}function b(){let w=[],T=[];for(let D of u1){if(!D.enabled){for(let M of D.diagnostics)mE.debug(`[${D.id}] ${M}`);continue}D.root&&D.commandsDir&&T.push({path:D.commandsDir,commandNamespace:`${D.name}--${D.marketplace}`}),D.root&&D.skillsDir&&w.push(D.skillsDir);for(let M of D.diagnostics)mE.warn(`[${D.id}] ${M}`)}return{skillPaths:w,promptPaths:T}}e.on("resources_discover",(w,T)=>{t=!1;let D=l(w.cwd,w.agentDir,T.pluginDirs),{skillPaths:M,promptPaths:P}=b();for(let k of D.globalDiagnostics)mE.warn(k);let O=u1.filter(k=>k.enabled).length;return u1.length>0&&mE.info(`Discovered ${u1.length} plugin(s); ${O} enabled`),h(),c(),p(),x(),m(),f(),v(),{skillPaths:M,promptPaths:P}}),e.on("session_start",(w,T)=>{u(T.cwd,T.agentDir,T.pluginDirs),h(),c(),p(),_(),m(),f();let D=HW(TA(),"plugins","marketplaces"),M=HW(T.agentDir,"plugins","marketplaces");tDr([D,M]).then(P=>{P&&(t=!1,l(T.cwd,T.agentDir,T.pluginDirs),h(),c(),p(),m(),f())}).catch(P=>{mE.debug(`background plugin source fetch failed: ${P instanceof Error?P.message:String(P)}`)})}),e.on("session_shutdown",()=>{g(),s?.(),s=void 0,o=new Map});let A=!1,y=!1,S=!1;function _(){!n&&!A&&(A=!0,mE.warn("@hermes/hooks did not register a hook listener; plugin hooks will not run. This usually means @hermes/hooks was removed from the built-in extension list."))}function x(){!i&&!y&&(y=!0,mE.debug("@hermes/subagents did not register an agent source; plugin-contributed subagents will not be available (expected when --disable-subagents is set)."))}function v(){!a&&!S&&(S=!0,mE.debug("@hermes/mcp did not register a server source; plugin-contributed MCP servers will not be loaded."))}}function tUo(e){if(e.root)return{source:e.id,isEnabled:()=>e.enabled,getConfig:()=>e.hooksConfig,env:nUo(e.root),postToolUsePrefix:`Plugin ${e.id} hook`,backgroundLabel:t=>`[${e.id}] ${t} hook`,blockedFallbackReason:"Blocked by plugin hook"}}function nUo(e){return{PLUGIN_ROOT:e,CLAUDE_PLUGIN_ROOT:e,AUGMENT_PLUGIN_ROOT:e,AUGGIE_PLUGIN_ROOT:e}}function Lx(){return u1}function Cq(e){return HW(e,"plugins","marketplaces")}function whe(e){let t=Cq(e);if(!z5o(t))return[];let n;try{n=X5o(t)}catch{return[]}let r=[];for(let i of n){let s=HW(t,i);try{if(!K5o(s).isDirectory())continue}catch{continue}let{manifest:o}=u9(s);if(!o)continue;let a=typeof o.name=="string"&&o.name.length>0?o.name:i;r.push({dir:i,name:a,path:s})}return r}function Fx(){let e=[];for(let t of u1)for(let n of t.diagnostics)e.push({type:"warning",message:`[${t.id}] ${n}`,path:t.root});for(let t of nGe)e.push({type:"warning",message:t});for(let t of xq)e.push(t);return e}function iUo(){let e=[],t=new Set,n=0;for(let r of u1){let i=!1;for(let s of r.diagnostics){let o=r.enabled?null:rUo.exec(s);if(o?.[1]){t.add(o[1]),i=!0;continue}e.push({type:"warning",message:`[${r.id}] ${s}`,path:r.root})}i&&n++}if(n>0){let r=[...t].sort().join(", "),i=n===1?"plugin":"plugins";e.push({type:"warning",message:`${n} disabled ${i} use unsupported source kinds (${r}); enable one to see details, or re-run with --check-startup`})}for(let r of nGe)e.push({type:"warning",message:r});for(let r of xq)e.push(r);return e}var mE,q5o,_Dr,u1,nGe,tGe,lLt,xq,rUo,Rw=C(()=>{"use strict";Ms();J2();en();uDr();The();zVe();jVe();sLt();gDr();yDr();EDr();zVe();mE=tt.child({prefix:"pi-plugins"}),q5o="augment:vfs-scopes",_Dr=Symbol.for("__pi_plugins_vfs_scopes__");u1=[],nGe=[],tGe=[],lLt=[],xq=[];rUo=/^source kind "([^"]+)" (?:is not supported; install the plugin manually as a relative directory|not fetched yet; run \/plugins to clone it \(or marketplace update\))$/});function sUo(e){return{...e,execute:(t,n,r,i,s)=>{let o=Cwe(e.name);if(!o)throw new Error(`Cloud tool "${e.name}" is unavailable`);return o.execute(t,n,r,i,s)}}}function cLt(e){for(let t of tCn())e.registerTool(sUo(t))}var SDr=C(()=>{"use strict";NH()});function sGe(){let e=globalThis;return e[vDr]??=new Map,e[vDr]}function iGe(){let e=globalThis;return e[xDr]??=new Map,e[xDr]}function oGe(){return[...sGe().values()]}function aGe(e){return sGe().get(e)}function TDr(e){return iGe().get(e)}function p9(e,t){sGe().set(e.name,e),t===void 0?iGe().delete(e.name):iGe().set(e.name,t)}function Tq(e,t){let n=sGe();(t===void 0||n.get(e)===t)&&(n.delete(e),iGe().delete(e))}function IDr(e){Reflect.set(e,CDr,!0)}function lGe(e){return Reflect.get(e,CDr)===!0}var vDr,xDr,CDr,Lk=C(()=>{"use strict";vDr=Symbol.for("__hermes_mcp_tool_registry__"),xDr=Symbol.for("__hermes_mcp_tool_server_registry__"),CDr=Symbol.for("__hermes_mcp_extension_factory__")});function oUo(e){return{...e,execute:(t,n,r,i,s)=>{let o=aGe(e.name);if(!o)throw new Error(`MCP tool "${e.name}" is unavailable`);return o.execute(t,n,r,i,s)}}}function cGe(e){for(let t of oGe())e.registerTool(oUo(t))}var wDr=C(()=>{"use strict";Lk()});import{existsSync as aUo}from"node:fs";import{homedir as Nhe}from"node:os";import{dirname as uLt,join as Ux,resolve as NDr}from"node:path";import{fileURLToPath as lUo}from"node:url";function kDr(){let e=process.env.PI_PACKAGE_DIR;if(e)return e==="~"?Nhe():e.startsWith("~/")?Nhe()+e.slice(1):e;let t=RDr;for(;t!==uLt(t);){if(aUo(Ux(t,"package.json")))return t;t=uLt(t)}return RDr}function uGe(){return NDr(Ux(kDr(),"docs"))}function dGe(){return NDr(Ux(kDr(),"CHANGELOG.md"))}function DDr(e){return e==="~"?Nhe():e.startsWith("~/")?Nhe()+e.slice(1):e}function Nw(){let e=process.env.AUGMENT_CACHE_DIR;return e?DDr(e):Ux(Nhe(),".augment")}function nr(){let e=process.env[dLt];return e?DDr(e):Nw()}function Mhe(){return Ux(nr(),"themes")}function BDr(){return Ux(nr(),"models.json")}function LDr(){return Ux(nr(),"auth.json")}function FDr(){return Ux(nr(),"settings.json")}function m9(){return Nw()}function Iq(){return Ux(nr(),"bin")}function UDr(){return Ux(nr(),khe)}function VDr(){return Ux(nr(),`${ei}-debug.log`)}var cUo,RDr,ei,Ps,khe,Ohe,ODr,uUo,Gs,MDr,PDr,dLt,Ws=C(()=>{"use strict";mft();cUo=lUo(import.meta.url),RDr=uLt(cUo);ei=oD.piConfig?.name||"auggie",Ps=oD.piConfig?.configDir||".augment",khe="sessions-v2",Ohe=ei,ODr="Auggie Coding Agent",uUo="1.2.0-prerelease.202611040910",Gs=uUo??oD.version,MDr="2c02c0c37a9ce983fd62e407026f441855626f94",PDr="2026-11-04T17:10:35Z",dLt=`${ei.toUpperCase()}_CODING_AGENT_DIR`});var WDr,GDr=C(()=>{WDr={$schema:"https://raw.githubusercontent.com/badlogic/pi-mono/main/packages/coding-agent/src/modes/interactive/theme/theme-schema.json",name:"ansi",vars:{red:1,green:2,yellow:3,blue:4,magenta:5,cyan:6,gray:8,brightMagenta:13},colors:{accent:"magenta",border:"gray",borderAccent:"magenta",borderMuted:"gray",success:"green",error:"red",warning:"yellow",muted:"gray",dim:"gray",text:"",thinkingText:"gray",selectedBg:"gray",userMessageBg:"",userMessageText:"",customMessageBg:"",customMessageText:"",customMessageLabel:"magenta",toolPendingBg:"",toolSuccessBg:"",toolErrorBg:"",toolTitle:"magenta",toolOutput:"gray",mdHeading:"magenta",mdLink:"magenta",mdLinkUrl:"gray",mdCode:"magenta",mdCodeBlock:"green",mdCodeBlockBorder:"gray",mdQuote:"gray",mdQuoteBorder:"gray",mdHr:"gray",mdListBullet:"magenta",toolDiffAdded:"green",toolDiffRemoved:"red",toolDiffContext:"gray",syntaxComment:"gray",syntaxKeyword:"blue",syntaxFunction:"yellow",syntaxVariable:"cyan",syntaxString:"green",syntaxNumber:"magenta",syntaxType:"cyan",syntaxOperator:"",syntaxPunctuation:"",thinkingOff:"gray",thinkingMinimal:"gray",thinkingLow:"blue",thinkingMedium:"cyan",thinkingHigh:"magenta",thinkingXhigh:"brightMagenta",bashMode:"green"},export:{pageBg:"#18181e",cardBg:"#1e1e24",infoBg:"#3c3728"}}});var kw,$Dr=C(()=>{kw={$schema:"https://raw.githubusercontent.com/badlogic/pi-mono/main/packages/coding-agent/src/modes/interactive/theme/theme-schema.json",name:"dark",vars:{cyan:"#00d7ff",blue:"#5f87ff",green:"#b5bd68",red:"#cc6666",yellow:"#ffff00",gray:"#808080",dimGray:"#666666",darkGray:"#505050",accent:"#8abeb7",selectedBg:"#3a3a4a",userMsgBg:"#343541",toolPendingBg:"#282832",toolSuccessBg:"#283228",toolErrorBg:"#3c2828",customMsgBg:"#2d2838"},colors:{accent:"accent",border:"blue",borderAccent:"cyan",borderMuted:"darkGray",success:"green",error:"red",warning:"yellow",muted:"gray",dim:"dimGray",text:"",thinkingText:"gray",agentRed:"#CC6666",agentBlue:"#81A2BE",agentGreen:"#B5BD68",agentYellow:"#F0C674",agentOrange:"#CE9178",agentPurple:"#B294BB",agentPink:"#D183E8",agentCyan:"#8ABEB7",selectedBg:"selectedBg",userMessageBg:"userMsgBg",userMessageText:"",customMessageBg:"customMsgBg",customMessageText:"",customMessageLabel:"#9575cd",toolPendingBg:"toolPendingBg",toolSuccessBg:"toolSuccessBg",toolErrorBg:"toolErrorBg",toolTitle:"#b294bb",toolOutput:"gray",mdHeading:"#f0c674",mdLink:"#81a2be",mdLinkUrl:"dimGray",mdCode:"accent",mdCodeBlock:"green",mdCodeBlockBorder:"gray",mdQuote:"gray",mdQuoteBorder:"gray",mdHr:"gray",mdListBullet:"accent",toolDiffAdded:"green",toolDiffRemoved:"red",toolDiffContext:"gray",syntaxComment:"#6A9955",syntaxKeyword:"#569CD6",syntaxFunction:"#DCDCAA",syntaxVariable:"#9CDCFE",syntaxString:"#CE9178",syntaxNumber:"#B5CEA8",syntaxType:"#4EC9B0",syntaxOperator:"#D4D4D4",syntaxPunctuation:"#D4D4D4",thinkingOff:"darkGray",thinkingMinimal:"#6e6e6e",thinkingLow:"#5f87af",thinkingMedium:"#81a2be",thinkingHigh:"#b294bb",thinkingXhigh:"#d183e8",bashMode:"green"},export:{pageBg:"#18181e",cardBg:"#1e1e24",infoBg:"#3c3728"}}});var YDr,QDr=C(()=>{YDr={$schema:"https://raw.githubusercontent.com/badlogic/pi-mono/main/packages/coding-agent/src/modes/interactive/theme/theme-schema.json",name:"light",vars:{teal:"#5a8080",blue:"#547da7",green:"#588458",red:"#aa5555",yellow:"#9a7326",mediumGray:"#6c6c6c",dimGray:"#767676",lightGray:"#b0b0b0",selectedBg:"#d0d0e0",userMsgBg:"#e8e8e8",toolPendingBg:"#e8e8f0",toolSuccessBg:"#e8f0e8",toolErrorBg:"#f0e8e8",customMsgBg:"#ede7f6"},colors:{accent:"teal",border:"blue",borderAccent:"teal",borderMuted:"lightGray",success:"green",error:"red",warning:"yellow",muted:"mediumGray",dim:"dimGray",text:"",thinkingText:"mediumGray",agentRed:"#AA5555",agentBlue:"#476D94",agentGreen:"#477047",agentYellow:"#8A6822",agentOrange:"#795E26",agentPurple:"#875F87",agentPink:"#8B008B",agentCyan:"#4D7070",selectedBg:"selectedBg",userMessageBg:"userMsgBg",userMessageText:"",customMessageBg:"customMsgBg",customMessageText:"",customMessageLabel:"#7e57c2",toolPendingBg:"toolPendingBg",toolSuccessBg:"toolSuccessBg",toolErrorBg:"toolErrorBg",toolTitle:"",toolOutput:"mediumGray",mdHeading:"yellow",mdLink:"blue",mdLinkUrl:"dimGray",mdCode:"teal",mdCodeBlock:"green",mdCodeBlockBorder:"mediumGray",mdQuote:"mediumGray",mdQuoteBorder:"mediumGray",mdHr:"mediumGray",mdListBullet:"green",toolDiffAdded:"green",toolDiffRemoved:"red",toolDiffContext:"mediumGray",syntaxComment:"#008000",syntaxKeyword:"#0000FF",syntaxFunction:"#795E26",syntaxVariable:"#001080",syntaxString:"#A31515",syntaxNumber:"#098658",syntaxType:"#267F99",syntaxOperator:"#000000",syntaxPunctuation:"#000000",thinkingOff:"lightGray",thinkingMinimal:"#767676",thinkingLow:"blue",thinkingMedium:"teal",thinkingHigh:"#875f87",thinkingXhigh:"#8b008b",bashMode:"green"},export:{pageBg:"#f8f8f8",cardBg:"#ffffff",infoBg:"#fffae6"}}});import*as Wb from"node:fs";import*as mGe from"node:path";function hLt(){let e=process.env.COLORTERM;if(e==="truecolor"||e==="24bit"||process.env.WT_SESSION)return"truecolor";let t=process.env.TERM||"";return t==="dumb"||t===""||t==="linux"||process.env.TERM_PROGRAM==="Apple_Terminal"||t==="screen"||t.startsWith("screen-")||t.startsWith("screen.")?"256color":"truecolor"}function gLt(e){let t=e.replace("#","");if(t.length!==6)throw new Error(`Invalid hex color: ${e}`);let n=Number.parseInt(t.slice(0,2),16),r=Number.parseInt(t.slice(2,4),16),i=Number.parseInt(t.slice(4,6),16);if(Number.isNaN(n)||Number.isNaN(r)||Number.isNaN(i))throw new Error(`Invalid hex color: ${e}`);return{r:n,g:r,b:i}}function pLt(e){let t=Number.POSITIVE_INFINITY,n=0;for(let[r,i]of pGe.entries()){let s=Math.abs(e-i);s<t&&(t=s,n=r)}return n}function hUo(e){let t=Number.POSITIVE_INFINITY,n=0;for(let[r,i]of XDr.entries()){let s=Math.abs(e-i);s<t&&(t=s,n=r)}return n}function ZDr(e,t,n,r,i,s){let o=e-r,a=t-i,l=n-s;return o*o*.299+a*a*.587+l*l*.114}function bLt(e,t,n){let r=pLt(e),i=pLt(t),s=pLt(n),o=pGe[r]??0,a=pGe[i]??0,l=pGe[s]??0,u=16+36*r+6*i+s,c=ZDr(e,t,n,o,a,l),d=Math.round(.299*e+.587*t+.114*n),p=hUo(d),m=XDr[p]??0,f=232+p,h=ZDr(e,t,n,m,m,m),g=Math.max(e,t,n),b=Math.min(e,t,n);return g-b<10&&h<c?f:u}function KDr(e){let{r:t,g:n,b:r}=gLt(e);return bLt(t,n,r)}function qDr(e,t,n){return`\x1B[${e<8?t+e:n+e-8}m`}function jDr(e,t){if(e==="")return"\x1B[39m";if(typeof e=="number")return e<16?qDr(e,30,90):`\x1B[38;5;${e}m`;if(e.startsWith("#")){if(t==="truecolor"){let{r,g:i,b:s}=gLt(e);return`\x1B[38;2;${r};${i};${s}m`}return`\x1B[38;5;${KDr(e)}m`}throw new Error(`Invalid color value: ${e}`)}function gUo(e,t){if(e==="")return"\x1B[49m";if(typeof e=="number")return e<16?qDr(e,40,100):`\x1B[48;5;${e}m`;if(e.startsWith("#")){if(t==="truecolor"){let{r,g:i,b:s}=gLt(e);return`\x1B[48;2;${r};${i};${s}m`}return`\x1B[48;5;${KDr(e)}m`}throw new Error(`Invalid color value: ${e}`)}function yLt(e,t,n=new Set){if(typeof e=="number"||e===""||e.startsWith("#"))return e;if(n.has(e))throw new Error(`Circular variable reference detected: ${e}`);if(!(e in t))throw new Error(`Variable reference not found: ${e}`);n.add(e);let r=t[e];if(r===void 0)throw new Error(`Variable reference not found: ${e}`);return yLt(r,t,n)}function JDr(e,t={}){let n={};for(let[r,i]of Object.entries(e))n[r]=yLt(i,t);return n}function hGe(){let e=new Set(Object.keys(fGe)),t=Mhe();if(Wb.existsSync(t)){let n=Wb.readdirSync(t);for(let r of n)r.endsWith(".json")&&e.add(r.slice(0,-5))}for(let n of XW.keys())e.add(n);return Array.from(e).sort()}function eBr(){let e=Mhe(),t=[];for(let n of Object.keys(fGe))t.push({name:n,path:void 0});if(Wb.existsSync(e)){for(let n of Wb.readdirSync(e))if(n.endsWith(".json")){let r=n.slice(0,-5);t.some(i=>i.name===r)||t.push({name:r,path:mGe.join(e,n)})}}for(let[n,r]of XW.entries())t.some(i=>i.name===n)||t.push({name:n,path:r.sourcePath});return t.sort((n,r)=>n.name.localeCompare(r.name))}function bUo(e,t){if(!HDr.Check(t)){let n=Array.from(HDr.Errors(t)),r=[],i=[];for(let o of n){let l=o.path.match(/^\/colors\/(\w+)$/)?.[1];l&&o.message.includes("Required")?r.push(l):i.push(` - ${o.path}: ${o.message}`)}let s=`Invalid theme "${e}":
|
|
6403
6403
|
`;throw r.length>0&&(s+=`
|
|
6404
6404
|
Missing required color tokens:
|
|
6405
6405
|
`,s+=r.map(o=>` - ${o}`).join(`
|
package/package.json
CHANGED