@augmentcode/onison 1.2.0-prerelease.202609150848 → 1.2.0-prerelease.202609150857
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
|
@@ -519,7 +519,7 @@ Returns search results as Markdown-formatted text with titles, URLs, and snippet
|
|
|
519
519
|
|
|
520
520
|
Use this tool when you need to find current information, documentation, or answers that are not available in the local codebase.`,$sn=5,Ksn=1,jsn=10,aPa=1,cPa="app.tools.expand",lPa=fe.Object({query:fe.String({description:"The search query."}),num_results:fe.Optional(fe.Integer({description:`Number of results to return (${Ksn}-${jsn}). Default: ${$sn}.`,minimum:Ksn,maximum:jsn,default:$sn}))})});import{randomUUID as fPa}from"node:crypto";function gPa(){return globalThis[Zgi]}function APa(e){globalThis[Zgi]=e}function hPa(e){if(!e||typeof e!="object")return!1;let t=e;return typeof t.apiKey=="string"&&typeof t.apiUrl=="string"}function EPa(){let e=globalThis,t=e[zgi];if(t)return t;let n={};return e[zgi]=n,n}function yPa(e){return!e||typeof e!="object"?!1:typeof e.chatFeedback=="function"}function bPa(e){let t=process.env.TERM||"unknown",n=process.env.TERM_PROGRAM||"unknown",r=process.env.SHELL||"unknown",i=e.trim(),o=i?`
|
|
521
521
|
|
|
522
|
-
User Note: ${i}`:"";return`Environment: TERM=${t}, TERM_PROGRAM=${n}, SHELL=${r}${o}`}function CPa(e,t){if(t.lastRequestId)return t.lastRequestId;let n=e.sessionManager.getBranch();for(let r=n.length-1;r>=0;r-=1){let i=n[r];if(!(i?.type!=="message"||i.message.role!=="assistant")&&typeof i.message.requestId=="string"&&i.message.requestId)return i.message.requestId}return fPa()}function IPa(e){if(e==="Positive")return RV.POSITIVE;if(e==="Negative")return RV.NEGATIVE}function SPa(e){return e===RV.POSITIVE?"Great! Any additional comments? (optional)":"Sorry to hear that. What went wrong? (optional)"}async function _Pa(e,t,n,r,i){try{await t.chatFeedback({requestId:CPa(e,n),rating:r,note:bPa(i),mode:Joe.cliAgent}),e.ui.notify("Feedback submitted","info")}catch(o){let s=o instanceof Error?o.message:String(o);e.ui.notify(`Failed to submit feedback: ${s}`,"error")}}function vPa(e,t){let n=EPa();t.api=n.api,e.events.on("augment:api",r=>{yPa(r)&&(t.api=r,n.api=r)}),e.on("message_end",r=>{r.message.role==="assistant"&&typeof r.message.requestId=="string"&&r.message.requestId&&(t.lastRequestId=r.message.requestId)}),e.registerCommand("feedback",{description:"Rate your latest chat response and optionally leave a note",handler:async(r,i)=>{if(!i.hasUI||i.mode!=="interactive"){i.ui.notify("Feedback is only available in interactive mode.","warning");return}let o=t.api;if(!o){i.ui.notify("Feedback requires an Augment login.","error");return}let s=await i.ui.select("How was your experience?",["Positive","Negative"]),a=IPa(s);if(a===void 0){i.ui.notify("Feedback cancelled","info");return}let c=await i.ui.editor(SPa(a),"");if(c===void 0){i.ui.notify("Feedback cancelled","info");return}await _Pa(i,o,t,a,c)}})}function qsn(e){e.events.on("augment:credentials",t=>{hPa(t)&&APa(t)}),vPa(e,{}),e.registerTool(Wgi({operations:{runRemoteTool:(...t)=>{let n=gPa();if(!n)throw new Error("web-search requires an Augment login. Please sign in and try again.");return ss({apiToken:n.apiKey,apiUrl:n.apiUrl,...n.userAgent?{userAgent:n.userAgent}:{}}).runRemoteTool(...t)}}}))}var zgi,Zgi,Hgi=C(()=>{"use strict";uo();Ygi();zgi=Symbol.for("__hermes_augment_legacy_tools_feedback_state__"),Zgi=Symbol.for("__hermes_augment_legacy_tools_credentials__")});function Jgi(e,t){e.events.on("augment:credentials",n=>{let r=n;if(!r||typeof r.apiKey!="string"||typeof r.apiUrl!="string"||typeof r.userAgent!="string"||r.userAgent.length===0||r.cliVersion!==void 0&&typeof r.cliVersion!="string"){Xgi.warn("augment:credentials payload missing apiKey/apiUrl/userAgent or has invalid cliVersion");return}t.credentials=r,Xgi.debug("Received Augment credentials via augment:credentials event"),t.credsResolve?.()})}async function $gi(e,t=5e3){if(e.credentials)return!0;let n=new Promise(r=>setTimeout(r,t));return await Promise.race([e.credsReady,n]),!!e.credentials}var Xgi,ean=C(()=>{"use strict";sr();Xgi=Gt.child({prefix:"pi-cloud"})});var V4,tan=C(()=>{V4={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","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/","assemble-changelog":"tsx scripts/assemble-changelog.ts",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.3.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/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/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 wPa}from"node:fs";import{homedir as TBe}from"node:os";import{dirname as nan,join as tR,resolve as jgi}from"node:path";import{fileURLToPath as RPa}from"node:url";function qgi(){let e=process.env.PI_PACKAGE_DIR;if(e)return e==="~"?TBe():e.startsWith("~/")?TBe()+e.slice(1):e;let t=Kgi;for(;t!==nan(t);){if(wPa(tR(t,"package.json")))return t;t=nan(t)}return Kgi}function jit(){return jgi(tR(qgi(),"docs"))}function qit(){return jgi(tR(qgi(),"CHANGELOG.md"))}function rAi(e){return`${process.env.PI_SHARE_VIEWER_URL||NPa}#${e}`}function iAi(e){return e==="~"?TBe():e.startsWith("~/")?TBe()+e.slice(1):e}function IQ(){let e=process.env.AUGMENT_CACHE_DIR;return e?iAi(e):tR(TBe(),".augment")}function mo(){let e=process.env[ran];return e?iAi(e):IQ()}function kBe(){return tR(mo(),"themes")}function oAi(){return tR(mo(),"models.json")}function sAi(){return tR(mo(),"auth.json")}function aAi(){return tR(mo(),"settings.json")}function W4(){return IQ()}function Fme(){return tR(mo(),"bin")}function cAi(){return tR(mo(),"prompts")}function lAi(){return tR(mo(),BBe)}function uAi(){return tR(mo(),`${es}-debug.log`)}var TPa,Kgi,es,xa,BBe,NBe,eAi,BPa,ll,tAi,nAi,ran,NPa,Mc=C(()=>{"use strict";tan();TPa=RPa(import.meta.url),Kgi=nan(TPa);es=V4.piConfig?.name||"auggie",xa=V4.piConfig?.configDir||".augment",BBe="sessions-v2",NBe=es,eAi="Auggie Coding Agent",BPa="1.2.0-prerelease.202609150848",ll=BPa??V4.version,tAi="5ea294f3b00fda3e7edb41b8166f373c794454cd",nAi="2026-09-15T15:48:00Z",ran=`${es.toUpperCase()}_CODING_AGENT_DIR`,NPa="https://pi.dev/session/"});function ian(...e){return new globalThis.Function(...e)}var dAi=C(()=>{});var eot,tot,oan,pAi=C(()=>{$5();boe();ao();Ip();eot=class extends Zo{constructor(t){super(`Duplicate type kind '${t}' detected`)}},tot=class extends Zo{constructor(t){super(`Duplicate string format '${t}' detected`)}};(function(e){function t(r,i){if(Yg.Has(r))throw new eot(r);return Yg.Set(r,i),(o={})=>mV({...o,[$n]:r})}e.Type=t;function n(r,i){if(sb.Has(r))throw new tot(r);return sb.Set(r,i),r}e.Format=n})(oan||(oan={}))});var MK={};ai(MK,{Evaluate:()=>ian,TypeSystem:()=>oan,TypeSystemDuplicateFormat:()=>tot,TypeSystemDuplicateTypeKind:()=>eot,TypeSystemPolicy:()=>Fd});var Ome=C(()=>{dAi();yIe();pAi()});function mAi(e){switch(e.errorType){case Kn.ArrayContains:return"Expected array to contain at least one matching value";case Kn.ArrayMaxContains:return`Expected array to contain no more than ${e.schema.maxContains} matching values`;case Kn.ArrayMinContains:return`Expected array to contain at least ${e.schema.minContains} matching values`;case Kn.ArrayMaxItems:return`Expected array length to be less or equal to ${e.schema.maxItems}`;case Kn.ArrayMinItems:return`Expected array length to be greater or equal to ${e.schema.minItems}`;case Kn.ArrayUniqueItems:return"Expected array elements to be unique";case Kn.Array:return"Expected array";case Kn.AsyncIterator:return"Expected AsyncIterator";case Kn.BigIntExclusiveMaximum:return`Expected bigint to be less than ${e.schema.exclusiveMaximum}`;case Kn.BigIntExclusiveMinimum:return`Expected bigint to be greater than ${e.schema.exclusiveMinimum}`;case Kn.BigIntMaximum:return`Expected bigint to be less or equal to ${e.schema.maximum}`;case Kn.BigIntMinimum:return`Expected bigint to be greater or equal to ${e.schema.minimum}`;case Kn.BigIntMultipleOf:return`Expected bigint to be a multiple of ${e.schema.multipleOf}`;case Kn.BigInt:return"Expected bigint";case Kn.Boolean:return"Expected boolean";case Kn.DateExclusiveMinimumTimestamp:return`Expected Date timestamp to be greater than ${e.schema.exclusiveMinimumTimestamp}`;case Kn.DateExclusiveMaximumTimestamp:return`Expected Date timestamp to be less than ${e.schema.exclusiveMaximumTimestamp}`;case Kn.DateMinimumTimestamp:return`Expected Date timestamp to be greater or equal to ${e.schema.minimumTimestamp}`;case Kn.DateMaximumTimestamp:return`Expected Date timestamp to be less or equal to ${e.schema.maximumTimestamp}`;case Kn.DateMultipleOfTimestamp:return`Expected Date timestamp to be a multiple of ${e.schema.multipleOfTimestamp}`;case Kn.Date:return"Expected Date";case Kn.Function:return"Expected function";case Kn.IntegerExclusiveMaximum:return`Expected integer to be less than ${e.schema.exclusiveMaximum}`;case Kn.IntegerExclusiveMinimum:return`Expected integer to be greater than ${e.schema.exclusiveMinimum}`;case Kn.IntegerMaximum:return`Expected integer to be less or equal to ${e.schema.maximum}`;case Kn.IntegerMinimum:return`Expected integer to be greater or equal to ${e.schema.minimum}`;case Kn.IntegerMultipleOf:return`Expected integer to be a multiple of ${e.schema.multipleOf}`;case Kn.Integer:return"Expected integer";case Kn.IntersectUnevaluatedProperties:return"Unexpected property";case Kn.Intersect:return"Expected all values to match";case Kn.Iterator:return"Expected Iterator";case Kn.Literal:return`Expected ${typeof e.schema.const=="string"?`'${e.schema.const}'`:e.schema.const}`;case Kn.Never:return"Never";case Kn.Not:return"Value should not match";case Kn.Null:return"Expected null";case Kn.NumberExclusiveMaximum:return`Expected number to be less than ${e.schema.exclusiveMaximum}`;case Kn.NumberExclusiveMinimum:return`Expected number to be greater than ${e.schema.exclusiveMinimum}`;case Kn.NumberMaximum:return`Expected number to be less or equal to ${e.schema.maximum}`;case Kn.NumberMinimum:return`Expected number to be greater or equal to ${e.schema.minimum}`;case Kn.NumberMultipleOf:return`Expected number to be a multiple of ${e.schema.multipleOf}`;case Kn.Number:return"Expected number";case Kn.Object:return"Expected object";case Kn.ObjectAdditionalProperties:return"Unexpected property";case Kn.ObjectMaxProperties:return`Expected object to have no more than ${e.schema.maxProperties} properties`;case Kn.ObjectMinProperties:return`Expected object to have at least ${e.schema.minProperties} properties`;case Kn.ObjectRequiredProperty:return"Expected required property";case Kn.Promise:return"Expected Promise";case Kn.RegExp:return"Expected string to match regular expression";case Kn.StringFormatUnknown:return`Unknown format '${e.schema.format}'`;case Kn.StringFormat:return`Expected string to match '${e.schema.format}' format`;case Kn.StringMaxLength:return`Expected string length less or equal to ${e.schema.maxLength}`;case Kn.StringMinLength:return`Expected string length greater or equal to ${e.schema.minLength}`;case Kn.StringPattern:return`Expected string to match '${e.schema.pattern}'`;case Kn.String:return"Expected string";case Kn.Symbol:return"Expected symbol";case Kn.TupleLength:return`Expected tuple to have ${e.schema.maxItems||0} elements`;case Kn.Tuple:return"Expected tuple";case Kn.Uint8ArrayMaxByteLength:return`Expected byte length less or equal to ${e.schema.maxByteLength}`;case Kn.Uint8ArrayMinByteLength:return`Expected byte length greater or equal to ${e.schema.minByteLength}`;case Kn.Uint8Array:return"Expected Uint8Array";case Kn.Undefined:return"Expected undefined";case Kn.Union:return"Expected union value";case Kn.Void:return"Expected void";case Kn.Kind:return`Expected kind '${e.schema[$n]}'`;default:return"Unknown error type"}}function kPa(e){fAi=e}function san(){return fAi}var fAi,aan=C(()=>{ao();can();fAi=mAi});function DPa(e,t){let n=t.find(r=>r.$id===e.$ref);if(n===void 0)throw new lan(e);return bl(n,t)}function qh(e,t){return!Tc(e.$id)||t.some(n=>n.$id===e.$id)||t.push(e),t}function bl(e,t){return e[$n]==="This"||e[$n]==="Ref"?DPa(e,t):e}var lan,gAi=C(()=>{Ip();ao();b3e();lan=class extends Zo{constructor(t){super(`Unable to dereference schema with $id '${t.$ref}'`),this.schema=t}}});var nR=C(()=>{gAi()});function*OPa(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 PPa(e){Qb(gv.Array);for(let t of e)Lme(t)}function LPa(e){Qb(gv.Boolean),Qb(e?1:0)}function UPa(e){Qb(gv.BigInt),hAi.setBigInt64(0,e);for(let t of EAi)Qb(t)}function GPa(e){Qb(gv.Date),Lme(e.getTime())}function VPa(e){Qb(gv.Null)}function WPa(e){Qb(gv.Number),hAi.setFloat64(0,e);for(let t of EAi)Qb(t)}function YPa(e){Qb(gv.Object);for(let t of globalThis.Object.getOwnPropertyNames(e).sort())Lme(t),Lme(e[t])}function zPa(e){Qb(gv.String);for(let t=0;t<e.length;t++)for(let n of OPa(e.charCodeAt(t)))Qb(n)}function ZPa(e){Qb(gv.Symbol),Lme(e.description)}function HPa(e){Qb(gv.Uint8Array);for(let t=0;t<e.length;t++)Qb(e[t])}function XPa(e){return Qb(gv.Undefined)}function Lme(e){if(qo(e))return PPa(e);if(dB(e))return LPa(e);if(Sh(e))return UPa(e);if(rb(e))return GPa(e);if(Y2(e))return VPa(e);if(Qo(e))return WPa(e);if(ea(e))return YPa(e);if(Tc(e))return zPa(e);if(Z2(e))return ZPa(e);if(RH(e))return HPa(e);if(rp(e))return XPa(e);throw new not(e)}function Qb(e){Pme=Pme^FPa[e],Pme=Pme*MPa%QPa}function IU(e){return Pme=BigInt("14695981039346656037"),Lme(e),Pme}var not,gv,Pme,MPa,QPa,FPa,AAi,hAi,EAi,yAi=C(()=>{Wg();Ip();not=class extends Zo{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"})(gv||(gv={}));Pme=BigInt("14695981039346656037"),[MPa,QPa]=[BigInt("1099511628211"),BigInt("18446744073709551616")],FPa=Array.from({length:256}).map((e,t)=>BigInt(t)),AAi=new Float64Array(1),hAi=new DataView(AAi.buffer),EAi=new Uint8Array(AAi.buffer)});var Ume=C(()=>{yAi()});function JPa(e){return e[$n]==="Any"||e[$n]==="Unknown"}function Qc(e){return e!==void 0}function $Pa(e,t,n){return!0}function KPa(e,t,n){return!0}function jPa(e,t,n){if(!qo(n)||Qc(e.minItems)&&!(n.length>=e.minItems)||Qc(e.maxItems)&&!(n.length<=e.maxItems))return!1;for(let o of n)if(!eE(e.items,t,o))return!1;if(e.uniqueItems===!0&&!(function(){let o=new Set;for(let s of n){let a=IU(s);if(o.has(a))return!1;o.add(a)}return!0})())return!1;if(!(Qc(e.contains)||Qo(e.minContains)||Qo(e.maxContains)))return!0;let r=Qc(e.contains)?e.contains:Es(),i=n.reduce((o,s)=>eE(r,t,s)?o+1:o,0);return!(i===0||Qo(e.minContains)&&i<e.minContains||Qo(e.maxContains)&&i>e.maxContains)}function qPa(e,t,n){return gIe(n)}function eLa(e,t,n){return!(!Sh(n)||Qc(e.exclusiveMaximum)&&!(n<e.exclusiveMaximum)||Qc(e.exclusiveMinimum)&&!(n>e.exclusiveMinimum)||Qc(e.maximum)&&!(n<=e.maximum)||Qc(e.minimum)&&!(n>=e.minimum)||Qc(e.multipleOf)&&n%e.multipleOf!==BigInt(0))}function tLa(e,t,n){return dB(n)}function nLa(e,t,n){return eE(e.returns,t,n.prototype)}function rLa(e,t,n){return!(!rb(n)||Qc(e.exclusiveMaximumTimestamp)&&!(n.getTime()<e.exclusiveMaximumTimestamp)||Qc(e.exclusiveMinimumTimestamp)&&!(n.getTime()>e.exclusiveMinimumTimestamp)||Qc(e.maximumTimestamp)&&!(n.getTime()<=e.maximumTimestamp)||Qc(e.minimumTimestamp)&&!(n.getTime()>=e.minimumTimestamp)||Qc(e.multipleOfTimestamp)&&n.getTime()%e.multipleOfTimestamp!==0)}function iLa(e,t,n){return z2(n)}function oLa(e,t,n){let r=globalThis.Object.values(e.$defs),i=e.$defs[e.$ref];return eE(i,[...t,...r],n)}function sLa(e,t,n){return!(!EIe(n)||Qc(e.exclusiveMaximum)&&!(n<e.exclusiveMaximum)||Qc(e.exclusiveMinimum)&&!(n>e.exclusiveMinimum)||Qc(e.maximum)&&!(n<=e.maximum)||Qc(e.minimum)&&!(n>=e.minimum)||Qc(e.multipleOf)&&n%e.multipleOf!==0)}function aLa(e,t,n){let r=e.allOf.every(i=>eE(i,t,n));if(e.unevaluatedProperties===!1){let i=new RegExp(mB(e)),o=Object.getOwnPropertyNames(n).every(s=>i.test(s));return r&&o}else if(Sp(e.unevaluatedProperties)){let i=new RegExp(mB(e)),o=Object.getOwnPropertyNames(n).every(s=>i.test(s)||eE(e.unevaluatedProperties,t,n[s]));return r&&o}else return r}function cLa(e,t,n){return AIe(n)}function lLa(e,t,n){return n===e.const}function uLa(e,t,n){return!1}function dLa(e,t,n){return!eE(e.not,t,n)}function pLa(e,t,n){return Y2(n)}function mLa(e,t,n){return!(!Fd.IsNumberLike(n)||Qc(e.exclusiveMaximum)&&!(n<e.exclusiveMaximum)||Qc(e.exclusiveMinimum)&&!(n>e.exclusiveMinimum)||Qc(e.minimum)&&!(n>=e.minimum)||Qc(e.maximum)&&!(n<=e.maximum)||Qc(e.multipleOf)&&n%e.multipleOf!==0)}function fLa(e,t,n){if(!Fd.IsObjectLike(n)||Qc(e.minProperties)&&!(Object.getOwnPropertyNames(n).length>=e.minProperties)||Qc(e.maxProperties)&&!(Object.getOwnPropertyNames(n).length<=e.maxProperties))return!1;let r=Object.getOwnPropertyNames(e.properties);for(let i of r){let o=e.properties[i];if(e.required&&e.required.includes(i)){if(!eE(o,t,n[i])||(fB(o)||JPa(o))&&!(i in n))return!1}else if(Fd.IsExactOptionalProperty(n,i)&&!eE(o,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(o=>r.includes(o))}else return typeof e.additionalProperties=="object"?Object.getOwnPropertyNames(n).every(o=>r.includes(o)||eE(e.additionalProperties,t,n[o])):!0}function gLa(e,t,n){return hIe(n)}function ALa(e,t,n){if(!Fd.IsRecordLike(n)||Qc(e.minProperties)&&!(Object.getOwnPropertyNames(n).length>=e.minProperties)||Qc(e.maxProperties)&&!(Object.getOwnPropertyNames(n).length<=e.maxProperties))return!1;let[r,i]=Object.entries(e.patternProperties)[0],o=new RegExp(r),s=Object.entries(n).every(([l,u])=>o.test(l)?eE(i,t,u):!0),a=typeof e.additionalProperties=="object"?Object.entries(n).every(([l,u])=>o.test(l)?!0:eE(e.additionalProperties,t,u)):!0,c=e.additionalProperties===!1?Object.getOwnPropertyNames(n).every(l=>o.test(l)):!0;return s&&a&&c}function hLa(e,t,n){return eE(bl(e,t),t,n)}function ELa(e,t,n){let r=new RegExp(e.source,e.flags);return Qc(e.minLength)&&!(n.length>=e.minLength)||Qc(e.maxLength)&&!(n.length<=e.maxLength)?!1:r.test(n)}function yLa(e,t,n){return!Tc(n)||Qc(e.minLength)&&!(n.length>=e.minLength)||Qc(e.maxLength)&&!(n.length<=e.maxLength)||Qc(e.pattern)&&!new RegExp(e.pattern).test(n)?!1:Qc(e.format)?sb.Has(e.format)?sb.Get(e.format)(n):!1:!0}function bLa(e,t,n){return Z2(n)}function CLa(e,t,n){return Tc(n)&&new RegExp(e.pattern).test(n)}function ILa(e,t,n){return eE(bl(e,t),t,n)}function SLa(e,t,n){if(!qo(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(!eE(e.items[r],t,n[r]))return!1;return!0}function _La(e,t,n){return rp(n)}function vLa(e,t,n){return e.anyOf.some(r=>eE(r,t,n))}function xLa(e,t,n){return!(!RH(n)||Qc(e.maxByteLength)&&!(n.length<=e.maxByteLength)||Qc(e.minByteLength)&&!(n.length>=e.minByteLength))}function wLa(e,t,n){return!0}function RLa(e,t,n){return Fd.IsVoidLike(n)}function TLa(e,t,n){return Yg.Has(e[$n])?Yg.Get(e[$n])(e,n):!1}function eE(e,t,n){let r=Qc(e.$id)?qh(e,t):t,i=e;switch(i[$n]){case"Any":return $Pa(i,r,n);case"Argument":return KPa(i,r,n);case"Array":return jPa(i,r,n);case"AsyncIterator":return qPa(i,r,n);case"BigInt":return eLa(i,r,n);case"Boolean":return tLa(i,r,n);case"Constructor":return nLa(i,r,n);case"Date":return rLa(i,r,n);case"Function":return iLa(i,r,n);case"Import":return oLa(i,r,n);case"Integer":return sLa(i,r,n);case"Intersect":return aLa(i,r,n);case"Iterator":return cLa(i,r,n);case"Literal":return lLa(i,r,n);case"Never":return uLa(i,r,n);case"Not":return dLa(i,r,n);case"Null":return pLa(i,r,n);case"Number":return mLa(i,r,n);case"Object":return fLa(i,r,n);case"Promise":return gLa(i,r,n);case"Record":return ALa(i,r,n);case"Ref":return hLa(i,r,n);case"RegExp":return ELa(i,r,n);case"String":return yLa(i,r,n);case"Symbol":return bLa(i,r,n);case"TemplateLiteral":return CLa(i,r,n);case"This":return ILa(i,r,n);case"Tuple":return SLa(i,r,n);case"Undefined":return _La(i,r,n);case"Union":return vLa(i,r,n);case"Uint8Array":return xLa(i,r,n);case"Unknown":return wLa(i,r,n);case"Void":return RLa(i,r,n);default:if(!Yg.Has(i[$n]))throw new rot(i);return TLa(i,r,n)}}function Fa(...e){return e.length===3?eE(e[0],e[1],e[2]):eE(e[0],[],e[1])}var rot,uan=C(()=>{Ome();nR();Ume();ao();__();rV();$5();Ip();af();Wg();Ha();rot=class extends Zo{constructor(t){super("Unknown type"),this.schema=t}}});var Av=C(()=>{uan()});function SU(e){return e.replace(/~/g,"~0").replace(/\//g,"~1")}function Fc(e){return e!==void 0}function Qi(e,t,n,r,i=[]){return{type:e,schema:t,path:n,value:r,message:san()({errorType:e,path:n,schema:t,value:r,errors:i}),errors:i}}function*BLa(e,t,n,r){}function*NLa(e,t,n,r){}function*kLa(e,t,n,r){if(!qo(r))return yield Qi(Kn.Array,e,n,r);Fc(e.minItems)&&!(r.length>=e.minItems)&&(yield Qi(Kn.ArrayMinItems,e,n,r)),Fc(e.maxItems)&&!(r.length<=e.maxItems)&&(yield Qi(Kn.ArrayMaxItems,e,n,r));for(let s=0;s<r.length;s++)yield*tE(e.items,t,`${n}/${s}`,r[s]);if(e.uniqueItems===!0&&!(function(){let s=new Set;for(let a of r){let c=IU(a);if(s.has(c))return!1;s.add(c)}return!0})()&&(yield Qi(Kn.ArrayUniqueItems,e,n,r)),!(Fc(e.contains)||Fc(e.minContains)||Fc(e.maxContains)))return;let i=Fc(e.contains)?e.contains:Es(),o=r.reduce((s,a,c)=>tE(i,t,`${n}${c}`,a).next().done===!0?s+1:s,0);o===0&&(yield Qi(Kn.ArrayContains,e,n,r)),Qo(e.minContains)&&o<e.minContains&&(yield Qi(Kn.ArrayMinContains,e,n,r)),Qo(e.maxContains)&&o>e.maxContains&&(yield Qi(Kn.ArrayMaxContains,e,n,r))}function*DLa(e,t,n,r){gIe(r)||(yield Qi(Kn.AsyncIterator,e,n,r))}function*MLa(e,t,n,r){if(!Sh(r))return yield Qi(Kn.BigInt,e,n,r);Fc(e.exclusiveMaximum)&&!(r<e.exclusiveMaximum)&&(yield Qi(Kn.BigIntExclusiveMaximum,e,n,r)),Fc(e.exclusiveMinimum)&&!(r>e.exclusiveMinimum)&&(yield Qi(Kn.BigIntExclusiveMinimum,e,n,r)),Fc(e.maximum)&&!(r<=e.maximum)&&(yield Qi(Kn.BigIntMaximum,e,n,r)),Fc(e.minimum)&&!(r>=e.minimum)&&(yield Qi(Kn.BigIntMinimum,e,n,r)),Fc(e.multipleOf)&&r%e.multipleOf!==BigInt(0)&&(yield Qi(Kn.BigIntMultipleOf,e,n,r))}function*QLa(e,t,n,r){dB(r)||(yield Qi(Kn.Boolean,e,n,r))}function*FLa(e,t,n,r){yield*tE(e.returns,t,n,r.prototype)}function*OLa(e,t,n,r){if(!rb(r))return yield Qi(Kn.Date,e,n,r);Fc(e.exclusiveMaximumTimestamp)&&!(r.getTime()<e.exclusiveMaximumTimestamp)&&(yield Qi(Kn.DateExclusiveMaximumTimestamp,e,n,r)),Fc(e.exclusiveMinimumTimestamp)&&!(r.getTime()>e.exclusiveMinimumTimestamp)&&(yield Qi(Kn.DateExclusiveMinimumTimestamp,e,n,r)),Fc(e.maximumTimestamp)&&!(r.getTime()<=e.maximumTimestamp)&&(yield Qi(Kn.DateMaximumTimestamp,e,n,r)),Fc(e.minimumTimestamp)&&!(r.getTime()>=e.minimumTimestamp)&&(yield Qi(Kn.DateMinimumTimestamp,e,n,r)),Fc(e.multipleOfTimestamp)&&r.getTime()%e.multipleOfTimestamp!==0&&(yield Qi(Kn.DateMultipleOfTimestamp,e,n,r))}function*PLa(e,t,n,r){z2(r)||(yield Qi(Kn.Function,e,n,r))}function*LLa(e,t,n,r){let i=globalThis.Object.values(e.$defs),o=e.$defs[e.$ref];yield*tE(o,[...t,...i],n,r)}function*ULa(e,t,n,r){if(!EIe(r))return yield Qi(Kn.Integer,e,n,r);Fc(e.exclusiveMaximum)&&!(r<e.exclusiveMaximum)&&(yield Qi(Kn.IntegerExclusiveMaximum,e,n,r)),Fc(e.exclusiveMinimum)&&!(r>e.exclusiveMinimum)&&(yield Qi(Kn.IntegerExclusiveMinimum,e,n,r)),Fc(e.maximum)&&!(r<=e.maximum)&&(yield Qi(Kn.IntegerMaximum,e,n,r)),Fc(e.minimum)&&!(r>=e.minimum)&&(yield Qi(Kn.IntegerMinimum,e,n,r)),Fc(e.multipleOf)&&r%e.multipleOf!==0&&(yield Qi(Kn.IntegerMultipleOf,e,n,r))}function*GLa(e,t,n,r){let i=!1;for(let o of e.allOf)for(let s of tE(o,t,n,r))i=!0,yield s;if(i)return yield Qi(Kn.Intersect,e,n,r);if(e.unevaluatedProperties===!1){let o=new RegExp(mB(e));for(let s of Object.getOwnPropertyNames(r))o.test(s)||(yield Qi(Kn.IntersectUnevaluatedProperties,e,`${n}/${s}`,r))}if(typeof e.unevaluatedProperties=="object"){let o=new RegExp(mB(e));for(let s of Object.getOwnPropertyNames(r))if(!o.test(s)){let a=tE(e.unevaluatedProperties,t,`${n}/${s}`,r[s]).next();a.done||(yield a.value)}}}function*VLa(e,t,n,r){AIe(r)||(yield Qi(Kn.Iterator,e,n,r))}function*WLa(e,t,n,r){r!==e.const&&(yield Qi(Kn.Literal,e,n,r))}function*YLa(e,t,n,r){yield Qi(Kn.Never,e,n,r)}function*zLa(e,t,n,r){tE(e.not,t,n,r).next().done===!0&&(yield Qi(Kn.Not,e,n,r))}function*ZLa(e,t,n,r){Y2(r)||(yield Qi(Kn.Null,e,n,r))}function*HLa(e,t,n,r){if(!Fd.IsNumberLike(r))return yield Qi(Kn.Number,e,n,r);Fc(e.exclusiveMaximum)&&!(r<e.exclusiveMaximum)&&(yield Qi(Kn.NumberExclusiveMaximum,e,n,r)),Fc(e.exclusiveMinimum)&&!(r>e.exclusiveMinimum)&&(yield Qi(Kn.NumberExclusiveMinimum,e,n,r)),Fc(e.maximum)&&!(r<=e.maximum)&&(yield Qi(Kn.NumberMaximum,e,n,r)),Fc(e.minimum)&&!(r>=e.minimum)&&(yield Qi(Kn.NumberMinimum,e,n,r)),Fc(e.multipleOf)&&r%e.multipleOf!==0&&(yield Qi(Kn.NumberMultipleOf,e,n,r))}function*XLa(e,t,n,r){if(!Fd.IsObjectLike(r))return yield Qi(Kn.Object,e,n,r);Fc(e.minProperties)&&!(Object.getOwnPropertyNames(r).length>=e.minProperties)&&(yield Qi(Kn.ObjectMinProperties,e,n,r)),Fc(e.maxProperties)&&!(Object.getOwnPropertyNames(r).length<=e.maxProperties)&&(yield Qi(Kn.ObjectMaxProperties,e,n,r));let i=Array.isArray(e.required)?e.required:[],o=Object.getOwnPropertyNames(e.properties),s=Object.getOwnPropertyNames(r);for(let a of i)s.includes(a)||(yield Qi(Kn.ObjectRequiredProperty,e.properties[a],`${n}/${SU(a)}`,void 0));if(e.additionalProperties===!1)for(let a of s)o.includes(a)||(yield Qi(Kn.ObjectAdditionalProperties,e,`${n}/${SU(a)}`,r[a]));if(typeof e.additionalProperties=="object")for(let a of s)o.includes(a)||(yield*tE(e.additionalProperties,t,`${n}/${SU(a)}`,r[a]));for(let a of o){let c=e.properties[a];e.required&&e.required.includes(a)?(yield*tE(c,t,`${n}/${SU(a)}`,r[a]),fB(e)&&!(a in r)&&(yield Qi(Kn.ObjectRequiredProperty,c,`${n}/${SU(a)}`,void 0))):Fd.IsExactOptionalProperty(r,a)&&(yield*tE(c,t,`${n}/${SU(a)}`,r[a]))}}function*JLa(e,t,n,r){hIe(r)||(yield Qi(Kn.Promise,e,n,r))}function*$La(e,t,n,r){if(!Fd.IsRecordLike(r))return yield Qi(Kn.Object,e,n,r);Fc(e.minProperties)&&!(Object.getOwnPropertyNames(r).length>=e.minProperties)&&(yield Qi(Kn.ObjectMinProperties,e,n,r)),Fc(e.maxProperties)&&!(Object.getOwnPropertyNames(r).length<=e.maxProperties)&&(yield Qi(Kn.ObjectMaxProperties,e,n,r));let[i,o]=Object.entries(e.patternProperties)[0],s=new RegExp(i);for(let[a,c]of Object.entries(r))s.test(a)&&(yield*tE(o,t,`${n}/${SU(a)}`,c));if(typeof e.additionalProperties=="object")for(let[a,c]of Object.entries(r))s.test(a)||(yield*tE(e.additionalProperties,t,`${n}/${SU(a)}`,c));if(e.additionalProperties===!1){for(let[a,c]of Object.entries(r))if(!s.test(a))return yield Qi(Kn.ObjectAdditionalProperties,e,`${n}/${SU(a)}`,c)}}function*KLa(e,t,n,r){yield*tE(bl(e,t),t,n,r)}function*jLa(e,t,n,r){if(!Tc(r))return yield Qi(Kn.String,e,n,r);if(Fc(e.minLength)&&!(r.length>=e.minLength)&&(yield Qi(Kn.StringMinLength,e,n,r)),Fc(e.maxLength)&&!(r.length<=e.maxLength)&&(yield Qi(Kn.StringMaxLength,e,n,r)),!new RegExp(e.source,e.flags).test(r))return yield Qi(Kn.RegExp,e,n,r)}function*qLa(e,t,n,r){if(!Tc(r))return yield Qi(Kn.String,e,n,r);Fc(e.minLength)&&!(r.length>=e.minLength)&&(yield Qi(Kn.StringMinLength,e,n,r)),Fc(e.maxLength)&&!(r.length<=e.maxLength)&&(yield Qi(Kn.StringMaxLength,e,n,r)),Tc(e.pattern)&&(new RegExp(e.pattern).test(r)||(yield Qi(Kn.StringPattern,e,n,r))),Tc(e.format)&&(sb.Has(e.format)?sb.Get(e.format)(r)||(yield Qi(Kn.StringFormat,e,n,r)):yield Qi(Kn.StringFormatUnknown,e,n,r))}function*eUa(e,t,n,r){Z2(r)||(yield Qi(Kn.Symbol,e,n,r))}function*tUa(e,t,n,r){if(!Tc(r))return yield Qi(Kn.String,e,n,r);new RegExp(e.pattern).test(r)||(yield Qi(Kn.StringPattern,e,n,r))}function*nUa(e,t,n,r){yield*tE(bl(e,t),t,n,r)}function*rUa(e,t,n,r){if(!qo(r))return yield Qi(Kn.Tuple,e,n,r);if(e.items===void 0&&r.length!==0)return yield Qi(Kn.TupleLength,e,n,r);if(r.length!==e.maxItems)return yield Qi(Kn.TupleLength,e,n,r);if(e.items)for(let i=0;i<e.items.length;i++)yield*tE(e.items[i],t,`${n}/${i}`,r[i])}function*iUa(e,t,n,r){rp(r)||(yield Qi(Kn.Undefined,e,n,r))}function*oUa(e,t,n,r){if(Fa(e,t,r))return;let i=e.anyOf.map(o=>new hv(tE(o,t,n,r)));yield Qi(Kn.Union,e,n,r,i)}function*sUa(e,t,n,r){if(!RH(r))return yield Qi(Kn.Uint8Array,e,n,r);Fc(e.maxByteLength)&&!(r.length<=e.maxByteLength)&&(yield Qi(Kn.Uint8ArrayMaxByteLength,e,n,r)),Fc(e.minByteLength)&&!(r.length>=e.minByteLength)&&(yield Qi(Kn.Uint8ArrayMinByteLength,e,n,r))}function*aUa(e,t,n,r){}function*cUa(e,t,n,r){Fd.IsVoidLike(r)||(yield Qi(Kn.Void,e,n,r))}function*lUa(e,t,n,r){Yg.Get(e[$n])(e,r)||(yield Qi(Kn.Kind,e,n,r))}function*tE(e,t,n,r){let i=Fc(e.$id)?[...t,e]:t,o=e;switch(o[$n]){case"Any":return yield*BLa(o,i,n,r);case"Argument":return yield*NLa(o,i,n,r);case"Array":return yield*kLa(o,i,n,r);case"AsyncIterator":return yield*DLa(o,i,n,r);case"BigInt":return yield*MLa(o,i,n,r);case"Boolean":return yield*QLa(o,i,n,r);case"Constructor":return yield*FLa(o,i,n,r);case"Date":return yield*OLa(o,i,n,r);case"Function":return yield*PLa(o,i,n,r);case"Import":return yield*LLa(o,i,n,r);case"Integer":return yield*ULa(o,i,n,r);case"Intersect":return yield*GLa(o,i,n,r);case"Iterator":return yield*VLa(o,i,n,r);case"Literal":return yield*WLa(o,i,n,r);case"Never":return yield*YLa(o,i,n,r);case"Not":return yield*zLa(o,i,n,r);case"Null":return yield*ZLa(o,i,n,r);case"Number":return yield*HLa(o,i,n,r);case"Object":return yield*XLa(o,i,n,r);case"Promise":return yield*JLa(o,i,n,r);case"Record":return yield*$La(o,i,n,r);case"Ref":return yield*KLa(o,i,n,r);case"RegExp":return yield*jLa(o,i,n,r);case"String":return yield*qLa(o,i,n,r);case"Symbol":return yield*eUa(o,i,n,r);case"TemplateLiteral":return yield*tUa(o,i,n,r);case"This":return yield*nUa(o,i,n,r);case"Tuple":return yield*rUa(o,i,n,r);case"Undefined":return yield*iUa(o,i,n,r);case"Union":return yield*oUa(o,i,n,r);case"Uint8Array":return yield*sUa(o,i,n,r);case"Unknown":return yield*aUa(o,i,n,r);case"Void":return yield*cUa(o,i,n,r);default:if(!Yg.Has(o[$n]))throw new iot(e);return yield*lUa(o,i,n,r)}}function YN(...e){let t=e.length===3?tE(e[0],e[1],"",e[2]):tE(e[0],[],"",e[1]);return new hv(t)}var Kn,iot,hv,can=C(()=>{Ome();__();$5();X3e();aan();Ip();nR();Ume();Av();ao();af();Wg();(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"})(Kn||(Kn={}));iot=class extends Zo{constructor(t){super("Unknown type"),this.schema=t}};hv=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 QK={};ai(QK,{DefaultErrorFunction:()=>mAi,Errors:()=>YN,GetErrorFunction:()=>san,SetErrorFunction:()=>kPa,ValueErrorIterator:()=>hv,ValueErrorType:()=>Kn,ValueErrorsUnknownTypeError:()=>iot});var SQ=C(()=>{can();aan()});function fm(e,t,n){try{return kl(e)?e[ip].Decode(n):n}catch(r){throw new oot(e,t,n,r)}}function uUa(e,t,n,r){return qo(r)?fm(e,n,r.map((i,o)=>zN(e.items,t,`${n}/${o}`,i))):fm(e,n,r)}function dUa(e,t,n,r){if(!ea(r)||mI(r))return fm(e,n,r);let i=Kie(e),o=i.map(u=>u[0]),s={...r};for(let[u,d]of i)u in s&&(s[u]=zN(d,t,`${n}/${u}`,s[u]));if(!kl(e.unevaluatedProperties))return fm(e,n,s);let a=Object.getOwnPropertyNames(s),c=e.unevaluatedProperties,l={...s};for(let u of a)o.includes(u)||(l[u]=fm(c,`${n}/${u}`,l[u]));return fm(e,n,l)}function pUa(e,t,n,r){let i=globalThis.Object.values(e.$defs),o=e.$defs[e.$ref],s=zN(o,[...t,...i],n,r);return fm(e,n,s)}function mUa(e,t,n,r){return fm(e,n,zN(e.not,t,n,r))}function fUa(e,t,n,r){if(!ea(r))return fm(e,n,r);let i=ub(e),o={...r};for(let l of i)hs(o,l)&&(rp(o[l])&&(!J2(e.properties[l])||Fd.IsExactOptionalProperty(o,l))||(o[l]=zN(e.properties[l],t,`${n}/${l}`,o[l])));if(!Sp(e.additionalProperties))return fm(e,n,o);let s=Object.getOwnPropertyNames(o),a=e.additionalProperties,c={...o};for(let l of s)i.includes(l)||(c[l]=fm(a,`${n}/${l}`,c[l]));return fm(e,n,c)}function gUa(e,t,n,r){if(!ea(r))return fm(e,n,r);let i=Object.getOwnPropertyNames(e.patternProperties)[0],o=new RegExp(i),s={...r};for(let u of Object.getOwnPropertyNames(r))o.test(u)&&(s[u]=zN(e.patternProperties[i],t,`${n}/${u}`,s[u]));if(!Sp(e.additionalProperties))return fm(e,n,s);let a=Object.getOwnPropertyNames(s),c=e.additionalProperties,l={...s};for(let u of a)o.test(u)||(l[u]=fm(c,`${n}/${u}`,l[u]));return fm(e,n,l)}function AUa(e,t,n,r){let i=bl(e,t);return fm(e,n,zN(i,t,n,r))}function hUa(e,t,n,r){let i=bl(e,t);return fm(e,n,zN(i,t,n,r))}function EUa(e,t,n,r){return qo(r)&&qo(e.items)?fm(e,n,e.items.map((i,o)=>zN(i,t,`${n}/${o}`,r[o]))):fm(e,n,r)}function yUa(e,t,n,r){for(let i of e.anyOf){if(!Fa(i,t,r))continue;let o=zN(i,t,n,r);return fm(e,n,o)}return fm(e,n,r)}function zN(e,t,n,r){let i=qh(e,t),o=e;switch(e[$n]){case"Array":return uUa(o,i,n,r);case"Import":return pUa(o,i,n,r);case"Intersect":return dUa(o,i,n,r);case"Not":return mUa(o,i,n,r);case"Object":return fUa(o,i,n,r);case"Record":return gUa(o,i,n,r);case"Ref":return AUa(o,i,n,r);case"Symbol":return fm(o,n,r);case"This":return hUa(o,i,n,r);case"Tuple":return EUa(o,i,n,r);case"Union":return yUa(o,i,n,r);default:return fm(o,n,r)}}function OK(e,t,n){return zN(e,t,"",n)}var FK,oot,bAi=C(()=>{yIe();ao();Ip();__();nR();Av();Wg();Ha();FK=class extends Zo{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}},oot=class extends Zo{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 my(e,t,n){try{return kl(e)?e[ip].Encode(n):n}catch(r){throw new sot(e,t,n,r)}}function bUa(e,t,n,r){let i=my(e,n,r);return qo(i)?i.map((o,s)=>ZN(e.items,t,`${n}/${s}`,o)):i}function CUa(e,t,n,r){let i=globalThis.Object.values(e.$defs),o=e.$defs[e.$ref],s=my(e,n,r);return ZN(o,[...t,...i],n,s)}function IUa(e,t,n,r){let i=my(e,n,r);if(!ea(r)||mI(r))return i;let o=Kie(e),s=o.map(d=>d[0]),a={...i};for(let[d,p]of o)d in a&&(a[d]=ZN(p,t,`${n}/${d}`,a[d]));if(!kl(e.unevaluatedProperties))return a;let c=Object.getOwnPropertyNames(a),l=e.unevaluatedProperties,u={...a};for(let d of c)s.includes(d)||(u[d]=my(l,`${n}/${d}`,u[d]));return u}function SUa(e,t,n,r){return my(e.not,n,my(e,n,r))}function _Ua(e,t,n,r){let i=my(e,n,r);if(!ea(i))return i;let o=ub(e),s={...i};for(let u of o)hs(s,u)&&(rp(s[u])&&(!J2(e.properties[u])||Fd.IsExactOptionalProperty(s,u))||(s[u]=ZN(e.properties[u],t,`${n}/${u}`,s[u])));if(!Sp(e.additionalProperties))return s;let a=Object.getOwnPropertyNames(s),c=e.additionalProperties,l={...s};for(let u of a)o.includes(u)||(l[u]=my(c,`${n}/${u}`,l[u]));return l}function vUa(e,t,n,r){let i=my(e,n,r);if(!ea(r))return i;let o=Object.getOwnPropertyNames(e.patternProperties)[0],s=new RegExp(o),a={...i};for(let d of Object.getOwnPropertyNames(r))s.test(d)&&(a[d]=ZN(e.patternProperties[o],t,`${n}/${d}`,a[d]));if(!Sp(e.additionalProperties))return a;let c=Object.getOwnPropertyNames(a),l=e.additionalProperties,u={...a};for(let d of c)s.test(d)||(u[d]=my(l,`${n}/${d}`,u[d]));return u}function xUa(e,t,n,r){let i=bl(e,t),o=ZN(i,t,n,r);return my(e,n,o)}function wUa(e,t,n,r){let i=bl(e,t),o=ZN(i,t,n,r);return my(e,n,o)}function RUa(e,t,n,r){let i=my(e,n,r);return qo(e.items)?e.items.map((o,s)=>ZN(o,t,`${n}/${s}`,i[s])):[]}function TUa(e,t,n,r){for(let i of e.anyOf){if(!Fa(i,t,r))continue;let o=ZN(i,t,n,r);return my(e,n,o)}for(let i of e.anyOf){let o=ZN(i,t,n,r);if(Fa(e,t,o))return my(e,n,o)}return my(e,n,r)}function ZN(e,t,n,r){let i=qh(e,t),o=e;switch(e[$n]){case"Array":return bUa(o,i,n,r);case"Import":return CUa(o,i,n,r);case"Intersect":return IUa(o,i,n,r);case"Not":return SUa(o,i,n,r);case"Object":return _Ua(o,i,n,r);case"Record":return vUa(o,i,n,r);case"Ref":return xUa(o,i,n,r);case"This":return wUa(o,i,n,r);case"Tuple":return RUa(o,i,n,r);case"Union":return TUa(o,i,n,r);default:return my(o,n,r)}}function LK(e,t,n){return ZN(e,t,"",n)}var PK,sot,CAi=C(()=>{yIe();ao();Ip();__();nR();Av();Wg();Ha();PK=class extends Zo{constructor(t,n,r){super("The encoded value does not match the expected schema"),this.schema=t,this.value=n,this.error=r}},sot=class extends Zo{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 BUa(e,t){return kl(e)||YA(e.items,t)}function NUa(e,t){return kl(e)||YA(e.items,t)}function kUa(e,t){return kl(e)||YA(e.returns,t)||e.parameters.some(n=>YA(n,t))}function DUa(e,t){return kl(e)||YA(e.returns,t)||e.parameters.some(n=>YA(n,t))}function MUa(e,t){return kl(e)||kl(e.unevaluatedProperties)||e.allOf.some(n=>YA(n,t))}function QUa(e,t){let n=globalThis.Object.getOwnPropertyNames(e.$defs).reduce((i,o)=>[...i,e.$defs[o]],[]),r=e.$defs[e.$ref];return kl(e)||YA(r,[...n,...t])}function FUa(e,t){return kl(e)||YA(e.items,t)}function OUa(e,t){return kl(e)||YA(e.not,t)}function PUa(e,t){return kl(e)||Object.values(e.properties).some(n=>YA(n,t))||Sp(e.additionalProperties)&&YA(e.additionalProperties,t)}function LUa(e,t){return kl(e)||YA(e.item,t)}function UUa(e,t){let n=Object.getOwnPropertyNames(e.patternProperties)[0],r=e.patternProperties[n];return kl(e)||YA(r,t)||Sp(e.additionalProperties)&&kl(e.additionalProperties)}function GUa(e,t){return kl(e)?!0:YA(bl(e,t),t)}function VUa(e,t){return kl(e)?!0:YA(bl(e,t),t)}function WUa(e,t){return kl(e)||!rp(e.items)&&e.items.some(n=>YA(n,t))}function YUa(e,t){return kl(e)||e.anyOf.some(n=>YA(n,t))}function YA(e,t){let n=qh(e,t),r=e;if(e.$id&&dan.has(e.$id))return!1;switch(e.$id&&dan.add(e.$id),e[$n]){case"Array":return BUa(r,n);case"AsyncIterator":return NUa(r,n);case"Constructor":return kUa(r,n);case"Function":return DUa(r,n);case"Import":return QUa(r,n);case"Intersect":return MUa(r,n);case"Iterator":return FUa(r,n);case"Not":return OUa(r,n);case"Object":return PUa(r,n);case"Promise":return LUa(r,n);case"Record":return UUa(r,n);case"Ref":return GUa(r,n);case"This":return VUa(r,n);case"Tuple":return WUa(r,n);case"Union":return YUa(r,n);default:return kl(e)}}function _Q(e,t){return dan.clear(),YA(e,t)}var dan,IAi=C(()=>{nR();ao();Ha();Wg();dan=new Set});var Gme=C(()=>{bAi();CAi();IAi()});function Y4(e){if(!Tc(e))throw Error("ConstantString: Not a String");return`'${JSON.stringify(e).slice(1,-1).replace(/'/g,"\\'")}'`}function SAi(e,t){return`${e}[${Y4(t)}]`}var aot,cot,pan,lot,DBe,z4,UK,_Ai=C(()=>{Gme();SQ();Ome();Ip();nR();Ume();ao();$5();__();X3e();af();nD();Wg();nkt();aot=class{constructor(t,n,r,i){this.schema=t,this.references=n,this.checkFunc=r,this.code=i,this.hasTransform=_Q(t,n)}Code(){return this.code}Schema(){return this.schema}References(){return this.references}Errors(t){return YN(this.schema,this.references,t)}Check(t){return this.checkFunc(t)}Decode(t){if(!this.checkFunc(t))throw new FK(this.schema,t,this.Errors(t).First());return this.hasTransform?OK(this.schema,this.references,t):t}Encode(t){let n=this.hasTransform?LK(this.schema,this.references,t):t;if(!this.checkFunc(n))throw new PK(this.schema,t,this.Errors(t).First());return n}};(function(e){function t(o){return o===36}e.DollarSign=t;function n(o){return o===95}e.IsUnderscore=n;function r(o){return o>=65&&o<=90||o>=97&&o<=122}e.IsAlpha=r;function i(o){return o>=48&&o<=57}e.IsNumeric=i})(cot||(cot={}));(function(e){function t(n){let r=[];for(let i=0;i<n.length;i++){let o=n.charCodeAt(i);cot.IsNumeric(o)||cot.IsAlpha(o)?r.push(n.charAt(i)):r.push(`_${o}_`)}return r.join("").replace(/__/g,"_")}e.Encode=t})(pan||(pan={}));lot=class extends Zo{constructor(t){super("Unknown type"),this.schema=t}},DBe=class extends Zo{constructor(t){super("Preflight validation check failed to guard for the given schema"),this.schema=t}};(function(e){function t(s,a,c){return Fd.ExactOptionalPropertyTypes?`(${Y4(a)} in ${s} ? ${c} : true)`:`(${SAi(s,a)} !== undefined ? ${c} : true)`}e.IsExactOptionalProperty=t;function n(s){return Fd.AllowArrayObject?`(typeof ${s} === 'object' && ${s} !== null)`:`(typeof ${s} === 'object' && ${s} !== null && !Array.isArray(${s}))`}e.IsObjectLike=n;function r(s){return Fd.AllowArrayObject?`(typeof ${s} === 'object' && ${s} !== null && !(${s} instanceof Date) && !(${s} instanceof Uint8Array))`:`(typeof ${s} === 'object' && ${s} !== null && !Array.isArray(${s}) && !(${s} instanceof Date) && !(${s} instanceof Uint8Array))`}e.IsRecordLike=r;function i(s){return Fd.AllowNaN?`typeof ${s} === 'number'`:`Number.isFinite(${s})`}e.IsNumberLike=i;function o(s){return Fd.AllowNullVoid?`(${s} === undefined || ${s} === null)`:`${s} === undefined`}e.IsVoidLike=o})(z4||(z4={}));(function(e){function t(te){return te[$n]==="Any"||te[$n]==="Unknown"}function*n(te,J,G){yield"true"}function*r(te,J,G){yield"true"}function*i(te,J,G){yield`Array.isArray(${G})`;let[ue,de]=[le("value","any"),le("acc","number")];Qo(te.maxItems)&&(yield`${G}.length <= ${te.maxItems}`),Qo(te.minItems)&&(yield`${G}.length >= ${te.minItems}`);let we=Me(te.items,J,"value");if(yield`((array) => { for(const ${ue} of array) if(!(${we})) { return false }; return true; })(${G})`,_p(te.contains)||Qo(te.minContains)||Qo(te.maxContains)){let De=_p(te.contains)?te.contains:Es(),Ie=Me(De,J,"value"),ie=Qo(te.minContains)?[`(count >= ${te.minContains})`]:[],Ye=Qo(te.maxContains)?[`(count <= ${te.maxContains})`]:[],st=`const count = value.reduce((${de}, ${ue}) => ${Ie} ? acc + 1 : acc, 0)`,it=["(count > 0)",...ie,...Ye].join(" && ");yield`((${ue}) => { ${st}; return ${it}})(${G})`}te.uniqueItems===!0&&(yield`((${ue}) => { 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 } )(${G})`)}function*o(te,J,G){yield`(typeof value === 'object' && Symbol.asyncIterator in ${G})`}function*s(te,J,G){yield`(typeof ${G} === 'bigint')`,Sh(te.exclusiveMaximum)&&(yield`${G} < BigInt(${te.exclusiveMaximum})`),Sh(te.exclusiveMinimum)&&(yield`${G} > BigInt(${te.exclusiveMinimum})`),Sh(te.maximum)&&(yield`${G} <= BigInt(${te.maximum})`),Sh(te.minimum)&&(yield`${G} >= BigInt(${te.minimum})`),Sh(te.multipleOf)&&(yield`(${G} % BigInt(${te.multipleOf})) === 0`)}function*a(te,J,G){yield`(typeof ${G} === 'boolean')`}function*c(te,J,G){yield*pe(te.returns,J,`${G}.prototype`)}function*l(te,J,G){yield`(${G} instanceof Date) && Number.isFinite(${G}.getTime())`,Qo(te.exclusiveMaximumTimestamp)&&(yield`${G}.getTime() < ${te.exclusiveMaximumTimestamp}`),Qo(te.exclusiveMinimumTimestamp)&&(yield`${G}.getTime() > ${te.exclusiveMinimumTimestamp}`),Qo(te.maximumTimestamp)&&(yield`${G}.getTime() <= ${te.maximumTimestamp}`),Qo(te.minimumTimestamp)&&(yield`${G}.getTime() >= ${te.minimumTimestamp}`),Qo(te.multipleOfTimestamp)&&(yield`(${G}.getTime() % ${te.multipleOfTimestamp}) === 0`)}function*u(te,J,G){yield`(typeof ${G} === 'function')`}function*d(te,J,G){let ue=globalThis.Object.getOwnPropertyNames(te.$defs).reduce((de,we)=>[...de,te.$defs[we]],[]);yield*pe(xh(te.$ref),[...J,...ue],G)}function*p(te,J,G){yield`Number.isInteger(${G})`,Qo(te.exclusiveMaximum)&&(yield`${G} < ${te.exclusiveMaximum}`),Qo(te.exclusiveMinimum)&&(yield`${G} > ${te.exclusiveMinimum}`),Qo(te.maximum)&&(yield`${G} <= ${te.maximum}`),Qo(te.minimum)&&(yield`${G} >= ${te.minimum}`),Qo(te.multipleOf)&&(yield`(${G} % ${te.multipleOf}) === 0`)}function*m(te,J,G){let ue=te.allOf.map(de=>Me(de,J,G)).join(" && ");if(te.unevaluatedProperties===!1){let de=$(`${new RegExp(mB(te))};`),we=`Object.getOwnPropertyNames(${G}).every(key => ${de}.test(key))`;yield`(${ue} && ${we})`}else if(_p(te.unevaluatedProperties)){let de=$(`${new RegExp(mB(te))};`),we=`Object.getOwnPropertyNames(${G}).every(key => ${de}.test(key) || ${Me(te.unevaluatedProperties,J,`${G}[key]`)})`;yield`(${ue} && ${we})`}else yield`(${ue})`}function*f(te,J,G){yield`(typeof value === 'object' && Symbol.iterator in ${G})`}function*g(te,J,G){if(typeof te.const=="number"||typeof te.const=="boolean")yield`(${G} === ${te.const})`;else if(typeof te.const=="string")yield`(${G} === ${Y4(te.const)})`;else throw Error("Invalid Literal Value")}function*A(te,J,G){yield"false"}function*h(te,J,G){yield`(!${Me(te.not,J,G)})`}function*E(te,J,G){yield`(${G} === null)`}function*y(te,J,G){yield z4.IsNumberLike(G),Qo(te.exclusiveMaximum)&&(yield`${G} < ${te.exclusiveMaximum}`),Qo(te.exclusiveMinimum)&&(yield`${G} > ${te.exclusiveMinimum}`),Qo(te.maximum)&&(yield`${G} <= ${te.maximum}`),Qo(te.minimum)&&(yield`${G} >= ${te.minimum}`),Qo(te.multipleOf)&&(yield`(${G} % ${te.multipleOf}) === 0`)}function*b(te,J,G){yield z4.IsObjectLike(G),Qo(te.minProperties)&&(yield`Object.getOwnPropertyNames(${G}).length >= ${te.minProperties}`),Qo(te.maxProperties)&&(yield`Object.getOwnPropertyNames(${G}).length <= ${te.maxProperties}`);let ue=Object.getOwnPropertyNames(te.properties);for(let de of ue){let we=SAi(G,de),De=te.properties[de];if(te.required&&te.required.includes(de))yield*pe(De,J,we),(fB(De)||t(De))&&(yield`(${Y4(de)} in ${G})`);else{let Ie=Me(De,J,we);yield z4.IsExactOptionalProperty(G,de,Ie)}}if(te.additionalProperties===!1)if(te.required&&te.required.length===ue.length)yield`Object.getOwnPropertyNames(${G}).length === ${ue.length}`;else{let de=`[${ue.map(we=>`${Y4(we)}`).join(", ")}]`;yield`Object.getOwnPropertyNames(${G}).every(key => ${de}.includes(key))`}if(typeof te.additionalProperties=="object"){let de=Me(te.additionalProperties,J,`${G}[key]`),we=`[${ue.map(De=>`${Y4(De)}`).join(", ")}]`;yield`(Object.getOwnPropertyNames(${G}).every(key => ${we}.includes(key) || ${de}))`}}function*I(te,J,G){yield`${G} instanceof Promise`}function*_(te,J,G){yield z4.IsRecordLike(G),Qo(te.minProperties)&&(yield`Object.getOwnPropertyNames(${G}).length >= ${te.minProperties}`),Qo(te.maxProperties)&&(yield`Object.getOwnPropertyNames(${G}).length <= ${te.maxProperties}`);let[ue,de]=Object.entries(te.patternProperties)[0],we=$(`${new RegExp(ue)}`),De=Me(de,J,"value"),Ie=_p(te.additionalProperties)?Me(te.additionalProperties,J,G):te.additionalProperties===!1?"false":"true",ie=`(${we}.test(key) ? ${De} : ${Ie})`;yield`(Object.entries(${G}).every(([key, value]) => ${ie}))`}function*v(te,J,G){let ue=bl(te,J);if(Ae.functions.has(te.$ref))return yield`${ye(te.$ref)}(${G})`;yield*pe(ue,J,G)}function*w(te,J,G){let ue=$(`${new RegExp(te.source,te.flags)};`);yield`(typeof ${G} === 'string')`,Qo(te.maxLength)&&(yield`${G}.length <= ${te.maxLength}`),Qo(te.minLength)&&(yield`${G}.length >= ${te.minLength}`),yield`${ue}.test(${G})`}function*R(te,J,G){yield`(typeof ${G} === 'string')`,Qo(te.maxLength)&&(yield`${G}.length <= ${te.maxLength}`),Qo(te.minLength)&&(yield`${G}.length >= ${te.minLength}`),te.pattern!==void 0&&(yield`${$(`${new RegExp(te.pattern)};`)}.test(${G})`),te.format!==void 0&&(yield`format(${Y4(te.format)}, ${G})`)}function*N(te,J,G){yield`(typeof ${G} === 'symbol')`}function*Q(te,J,G){yield`(typeof ${G} === 'string')`,yield`${$(`${new RegExp(te.pattern)};`)}.test(${G})`}function*F(te,J,G){yield`${ye(te.$ref)}(${G})`}function*D(te,J,G){if(yield`Array.isArray(${G})`,te.items===void 0)return yield`${G}.length === 0`;yield`(${G}.length === ${te.maxItems})`;for(let ue=0;ue<te.items.length;ue++)yield`${Me(te.items[ue],J,`${G}[${ue}]`)}`}function*k(te,J,G){yield`${G} === undefined`}function*W(te,J,G){yield`(${te.anyOf.map(de=>Me(de,J,G)).join(" || ")})`}function*Y(te,J,G){yield`${G} instanceof Uint8Array`,Qo(te.maxByteLength)&&(yield`(${G}.length <= ${te.maxByteLength})`),Qo(te.minByteLength)&&(yield`(${G}.length >= ${te.minByteLength})`)}function*K(te,J,G){yield"true"}function*z(te,J,G){yield z4.IsVoidLike(G)}function*q(te,J,G){let ue=Ae.instances.size;Ae.instances.set(ue,te),yield`kind(${Y4(te[$n])}, ${ue}, ${G})`}function*pe(te,J,G,ue=!0){let de=Tc(te.$id)?[...J,te]:J,we=te;if(ue&&Tc(te.$id)){let De=ye(te.$id);if(Ae.functions.has(De))return yield`${De}(${G})`;{Ae.functions.set(De,"<deferred>");let Ie=ne(De,te,J,"value",!1);return Ae.functions.set(De,Ie),yield`${De}(${G})`}}switch(we[$n]){case"Any":return yield*n(we,de,G);case"Argument":return yield*r(we,de,G);case"Array":return yield*i(we,de,G);case"AsyncIterator":return yield*o(we,de,G);case"BigInt":return yield*s(we,de,G);case"Boolean":return yield*a(we,de,G);case"Constructor":return yield*c(we,de,G);case"Date":return yield*l(we,de,G);case"Function":return yield*u(we,de,G);case"Import":return yield*d(we,de,G);case"Integer":return yield*p(we,de,G);case"Intersect":return yield*m(we,de,G);case"Iterator":return yield*f(we,de,G);case"Literal":return yield*g(we,de,G);case"Never":return yield*A(we,de,G);case"Not":return yield*h(we,de,G);case"Null":return yield*E(we,de,G);case"Number":return yield*y(we,de,G);case"Object":return yield*b(we,de,G);case"Promise":return yield*I(we,de,G);case"Record":return yield*_(we,de,G);case"Ref":return yield*v(we,de,G);case"RegExp":return yield*w(we,de,G);case"String":return yield*R(we,de,G);case"Symbol":return yield*N(we,de,G);case"TemplateLiteral":return yield*Q(we,de,G);case"This":return yield*F(we,de,G);case"Tuple":return yield*D(we,de,G);case"Undefined":return yield*k(we,de,G);case"Union":return yield*W(we,de,G);case"Uint8Array":return yield*Y(we,de,G);case"Unknown":return yield*K(we,de,G);case"Void":return yield*z(we,de,G);default:if(!Yg.Has(we[$n]))throw new lot(te);return yield*q(we,de,G)}}let Ae={language:"javascript",functions:new Map,variables:new Map,instances:new Map};function Me(te,J,G,ue=!0){return`(${[...pe(te,J,G,ue)].join(" && ")})`}function ye(te){return`check_${pan.Encode(te)}`}function $(te){let J=`local_${Ae.variables.size}`;return Ae.variables.set(J,`const ${J} = ${te}`),J}function ne(te,J,G,ue,de=!0){let[we,De]=[`
|
|
522
|
+
User Note: ${i}`:"";return`Environment: TERM=${t}, TERM_PROGRAM=${n}, SHELL=${r}${o}`}function CPa(e,t){if(t.lastRequestId)return t.lastRequestId;let n=e.sessionManager.getBranch();for(let r=n.length-1;r>=0;r-=1){let i=n[r];if(!(i?.type!=="message"||i.message.role!=="assistant")&&typeof i.message.requestId=="string"&&i.message.requestId)return i.message.requestId}return fPa()}function IPa(e){if(e==="Positive")return RV.POSITIVE;if(e==="Negative")return RV.NEGATIVE}function SPa(e){return e===RV.POSITIVE?"Great! Any additional comments? (optional)":"Sorry to hear that. What went wrong? (optional)"}async function _Pa(e,t,n,r,i){try{await t.chatFeedback({requestId:CPa(e,n),rating:r,note:bPa(i),mode:Joe.cliAgent}),e.ui.notify("Feedback submitted","info")}catch(o){let s=o instanceof Error?o.message:String(o);e.ui.notify(`Failed to submit feedback: ${s}`,"error")}}function vPa(e,t){let n=EPa();t.api=n.api,e.events.on("augment:api",r=>{yPa(r)&&(t.api=r,n.api=r)}),e.on("message_end",r=>{r.message.role==="assistant"&&typeof r.message.requestId=="string"&&r.message.requestId&&(t.lastRequestId=r.message.requestId)}),e.registerCommand("feedback",{description:"Rate your latest chat response and optionally leave a note",handler:async(r,i)=>{if(!i.hasUI||i.mode!=="interactive"){i.ui.notify("Feedback is only available in interactive mode.","warning");return}let o=t.api;if(!o){i.ui.notify("Feedback requires an Augment login.","error");return}let s=await i.ui.select("How was your experience?",["Positive","Negative"]),a=IPa(s);if(a===void 0){i.ui.notify("Feedback cancelled","info");return}let c=await i.ui.editor(SPa(a),"");if(c===void 0){i.ui.notify("Feedback cancelled","info");return}await _Pa(i,o,t,a,c)}})}function qsn(e){e.events.on("augment:credentials",t=>{hPa(t)&&APa(t)}),vPa(e,{}),e.registerTool(Wgi({operations:{runRemoteTool:(...t)=>{let n=gPa();if(!n)throw new Error("web-search requires an Augment login. Please sign in and try again.");return ss({apiToken:n.apiKey,apiUrl:n.apiUrl,...n.userAgent?{userAgent:n.userAgent}:{}}).runRemoteTool(...t)}}}))}var zgi,Zgi,Hgi=C(()=>{"use strict";uo();Ygi();zgi=Symbol.for("__hermes_augment_legacy_tools_feedback_state__"),Zgi=Symbol.for("__hermes_augment_legacy_tools_credentials__")});function Jgi(e,t){e.events.on("augment:credentials",n=>{let r=n;if(!r||typeof r.apiKey!="string"||typeof r.apiUrl!="string"||typeof r.userAgent!="string"||r.userAgent.length===0||r.cliVersion!==void 0&&typeof r.cliVersion!="string"){Xgi.warn("augment:credentials payload missing apiKey/apiUrl/userAgent or has invalid cliVersion");return}t.credentials=r,Xgi.debug("Received Augment credentials via augment:credentials event"),t.credsResolve?.()})}async function $gi(e,t=5e3){if(e.credentials)return!0;let n=new Promise(r=>setTimeout(r,t));return await Promise.race([e.credsReady,n]),!!e.credentials}var Xgi,ean=C(()=>{"use strict";sr();Xgi=Gt.child({prefix:"pi-cloud"})});var V4,tan=C(()=>{V4={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","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/","assemble-changelog":"tsx scripts/assemble-changelog.ts",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.3.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/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/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 wPa}from"node:fs";import{homedir as TBe}from"node:os";import{dirname as nan,join as tR,resolve as jgi}from"node:path";import{fileURLToPath as RPa}from"node:url";function qgi(){let e=process.env.PI_PACKAGE_DIR;if(e)return e==="~"?TBe():e.startsWith("~/")?TBe()+e.slice(1):e;let t=Kgi;for(;t!==nan(t);){if(wPa(tR(t,"package.json")))return t;t=nan(t)}return Kgi}function jit(){return jgi(tR(qgi(),"docs"))}function qit(){return jgi(tR(qgi(),"CHANGELOG.md"))}function rAi(e){return`${process.env.PI_SHARE_VIEWER_URL||NPa}#${e}`}function iAi(e){return e==="~"?TBe():e.startsWith("~/")?TBe()+e.slice(1):e}function IQ(){let e=process.env.AUGMENT_CACHE_DIR;return e?iAi(e):tR(TBe(),".augment")}function mo(){let e=process.env[ran];return e?iAi(e):IQ()}function kBe(){return tR(mo(),"themes")}function oAi(){return tR(mo(),"models.json")}function sAi(){return tR(mo(),"auth.json")}function aAi(){return tR(mo(),"settings.json")}function W4(){return IQ()}function Fme(){return tR(mo(),"bin")}function cAi(){return tR(mo(),"prompts")}function lAi(){return tR(mo(),BBe)}function uAi(){return tR(mo(),`${es}-debug.log`)}var TPa,Kgi,es,xa,BBe,NBe,eAi,BPa,ll,tAi,nAi,ran,NPa,Mc=C(()=>{"use strict";tan();TPa=RPa(import.meta.url),Kgi=nan(TPa);es=V4.piConfig?.name||"auggie",xa=V4.piConfig?.configDir||".augment",BBe="sessions-v2",NBe=es,eAi="Auggie Coding Agent",BPa="1.2.0-prerelease.202609150857",ll=BPa??V4.version,tAi="5ea294f3b00fda3e7edb41b8166f373c794454cd",nAi="2026-09-15T15:57:20Z",ran=`${es.toUpperCase()}_CODING_AGENT_DIR`,NPa="https://pi.dev/session/"});function ian(...e){return new globalThis.Function(...e)}var dAi=C(()=>{});var eot,tot,oan,pAi=C(()=>{$5();boe();ao();Ip();eot=class extends Zo{constructor(t){super(`Duplicate type kind '${t}' detected`)}},tot=class extends Zo{constructor(t){super(`Duplicate string format '${t}' detected`)}};(function(e){function t(r,i){if(Yg.Has(r))throw new eot(r);return Yg.Set(r,i),(o={})=>mV({...o,[$n]:r})}e.Type=t;function n(r,i){if(sb.Has(r))throw new tot(r);return sb.Set(r,i),r}e.Format=n})(oan||(oan={}))});var MK={};ai(MK,{Evaluate:()=>ian,TypeSystem:()=>oan,TypeSystemDuplicateFormat:()=>tot,TypeSystemDuplicateTypeKind:()=>eot,TypeSystemPolicy:()=>Fd});var Ome=C(()=>{dAi();yIe();pAi()});function mAi(e){switch(e.errorType){case Kn.ArrayContains:return"Expected array to contain at least one matching value";case Kn.ArrayMaxContains:return`Expected array to contain no more than ${e.schema.maxContains} matching values`;case Kn.ArrayMinContains:return`Expected array to contain at least ${e.schema.minContains} matching values`;case Kn.ArrayMaxItems:return`Expected array length to be less or equal to ${e.schema.maxItems}`;case Kn.ArrayMinItems:return`Expected array length to be greater or equal to ${e.schema.minItems}`;case Kn.ArrayUniqueItems:return"Expected array elements to be unique";case Kn.Array:return"Expected array";case Kn.AsyncIterator:return"Expected AsyncIterator";case Kn.BigIntExclusiveMaximum:return`Expected bigint to be less than ${e.schema.exclusiveMaximum}`;case Kn.BigIntExclusiveMinimum:return`Expected bigint to be greater than ${e.schema.exclusiveMinimum}`;case Kn.BigIntMaximum:return`Expected bigint to be less or equal to ${e.schema.maximum}`;case Kn.BigIntMinimum:return`Expected bigint to be greater or equal to ${e.schema.minimum}`;case Kn.BigIntMultipleOf:return`Expected bigint to be a multiple of ${e.schema.multipleOf}`;case Kn.BigInt:return"Expected bigint";case Kn.Boolean:return"Expected boolean";case Kn.DateExclusiveMinimumTimestamp:return`Expected Date timestamp to be greater than ${e.schema.exclusiveMinimumTimestamp}`;case Kn.DateExclusiveMaximumTimestamp:return`Expected Date timestamp to be less than ${e.schema.exclusiveMaximumTimestamp}`;case Kn.DateMinimumTimestamp:return`Expected Date timestamp to be greater or equal to ${e.schema.minimumTimestamp}`;case Kn.DateMaximumTimestamp:return`Expected Date timestamp to be less or equal to ${e.schema.maximumTimestamp}`;case Kn.DateMultipleOfTimestamp:return`Expected Date timestamp to be a multiple of ${e.schema.multipleOfTimestamp}`;case Kn.Date:return"Expected Date";case Kn.Function:return"Expected function";case Kn.IntegerExclusiveMaximum:return`Expected integer to be less than ${e.schema.exclusiveMaximum}`;case Kn.IntegerExclusiveMinimum:return`Expected integer to be greater than ${e.schema.exclusiveMinimum}`;case Kn.IntegerMaximum:return`Expected integer to be less or equal to ${e.schema.maximum}`;case Kn.IntegerMinimum:return`Expected integer to be greater or equal to ${e.schema.minimum}`;case Kn.IntegerMultipleOf:return`Expected integer to be a multiple of ${e.schema.multipleOf}`;case Kn.Integer:return"Expected integer";case Kn.IntersectUnevaluatedProperties:return"Unexpected property";case Kn.Intersect:return"Expected all values to match";case Kn.Iterator:return"Expected Iterator";case Kn.Literal:return`Expected ${typeof e.schema.const=="string"?`'${e.schema.const}'`:e.schema.const}`;case Kn.Never:return"Never";case Kn.Not:return"Value should not match";case Kn.Null:return"Expected null";case Kn.NumberExclusiveMaximum:return`Expected number to be less than ${e.schema.exclusiveMaximum}`;case Kn.NumberExclusiveMinimum:return`Expected number to be greater than ${e.schema.exclusiveMinimum}`;case Kn.NumberMaximum:return`Expected number to be less or equal to ${e.schema.maximum}`;case Kn.NumberMinimum:return`Expected number to be greater or equal to ${e.schema.minimum}`;case Kn.NumberMultipleOf:return`Expected number to be a multiple of ${e.schema.multipleOf}`;case Kn.Number:return"Expected number";case Kn.Object:return"Expected object";case Kn.ObjectAdditionalProperties:return"Unexpected property";case Kn.ObjectMaxProperties:return`Expected object to have no more than ${e.schema.maxProperties} properties`;case Kn.ObjectMinProperties:return`Expected object to have at least ${e.schema.minProperties} properties`;case Kn.ObjectRequiredProperty:return"Expected required property";case Kn.Promise:return"Expected Promise";case Kn.RegExp:return"Expected string to match regular expression";case Kn.StringFormatUnknown:return`Unknown format '${e.schema.format}'`;case Kn.StringFormat:return`Expected string to match '${e.schema.format}' format`;case Kn.StringMaxLength:return`Expected string length less or equal to ${e.schema.maxLength}`;case Kn.StringMinLength:return`Expected string length greater or equal to ${e.schema.minLength}`;case Kn.StringPattern:return`Expected string to match '${e.schema.pattern}'`;case Kn.String:return"Expected string";case Kn.Symbol:return"Expected symbol";case Kn.TupleLength:return`Expected tuple to have ${e.schema.maxItems||0} elements`;case Kn.Tuple:return"Expected tuple";case Kn.Uint8ArrayMaxByteLength:return`Expected byte length less or equal to ${e.schema.maxByteLength}`;case Kn.Uint8ArrayMinByteLength:return`Expected byte length greater or equal to ${e.schema.minByteLength}`;case Kn.Uint8Array:return"Expected Uint8Array";case Kn.Undefined:return"Expected undefined";case Kn.Union:return"Expected union value";case Kn.Void:return"Expected void";case Kn.Kind:return`Expected kind '${e.schema[$n]}'`;default:return"Unknown error type"}}function kPa(e){fAi=e}function san(){return fAi}var fAi,aan=C(()=>{ao();can();fAi=mAi});function DPa(e,t){let n=t.find(r=>r.$id===e.$ref);if(n===void 0)throw new lan(e);return bl(n,t)}function qh(e,t){return!Tc(e.$id)||t.some(n=>n.$id===e.$id)||t.push(e),t}function bl(e,t){return e[$n]==="This"||e[$n]==="Ref"?DPa(e,t):e}var lan,gAi=C(()=>{Ip();ao();b3e();lan=class extends Zo{constructor(t){super(`Unable to dereference schema with $id '${t.$ref}'`),this.schema=t}}});var nR=C(()=>{gAi()});function*OPa(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 PPa(e){Qb(gv.Array);for(let t of e)Lme(t)}function LPa(e){Qb(gv.Boolean),Qb(e?1:0)}function UPa(e){Qb(gv.BigInt),hAi.setBigInt64(0,e);for(let t of EAi)Qb(t)}function GPa(e){Qb(gv.Date),Lme(e.getTime())}function VPa(e){Qb(gv.Null)}function WPa(e){Qb(gv.Number),hAi.setFloat64(0,e);for(let t of EAi)Qb(t)}function YPa(e){Qb(gv.Object);for(let t of globalThis.Object.getOwnPropertyNames(e).sort())Lme(t),Lme(e[t])}function zPa(e){Qb(gv.String);for(let t=0;t<e.length;t++)for(let n of OPa(e.charCodeAt(t)))Qb(n)}function ZPa(e){Qb(gv.Symbol),Lme(e.description)}function HPa(e){Qb(gv.Uint8Array);for(let t=0;t<e.length;t++)Qb(e[t])}function XPa(e){return Qb(gv.Undefined)}function Lme(e){if(qo(e))return PPa(e);if(dB(e))return LPa(e);if(Sh(e))return UPa(e);if(rb(e))return GPa(e);if(Y2(e))return VPa(e);if(Qo(e))return WPa(e);if(ea(e))return YPa(e);if(Tc(e))return zPa(e);if(Z2(e))return ZPa(e);if(RH(e))return HPa(e);if(rp(e))return XPa(e);throw new not(e)}function Qb(e){Pme=Pme^FPa[e],Pme=Pme*MPa%QPa}function IU(e){return Pme=BigInt("14695981039346656037"),Lme(e),Pme}var not,gv,Pme,MPa,QPa,FPa,AAi,hAi,EAi,yAi=C(()=>{Wg();Ip();not=class extends Zo{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"})(gv||(gv={}));Pme=BigInt("14695981039346656037"),[MPa,QPa]=[BigInt("1099511628211"),BigInt("18446744073709551616")],FPa=Array.from({length:256}).map((e,t)=>BigInt(t)),AAi=new Float64Array(1),hAi=new DataView(AAi.buffer),EAi=new Uint8Array(AAi.buffer)});var Ume=C(()=>{yAi()});function JPa(e){return e[$n]==="Any"||e[$n]==="Unknown"}function Qc(e){return e!==void 0}function $Pa(e,t,n){return!0}function KPa(e,t,n){return!0}function jPa(e,t,n){if(!qo(n)||Qc(e.minItems)&&!(n.length>=e.minItems)||Qc(e.maxItems)&&!(n.length<=e.maxItems))return!1;for(let o of n)if(!eE(e.items,t,o))return!1;if(e.uniqueItems===!0&&!(function(){let o=new Set;for(let s of n){let a=IU(s);if(o.has(a))return!1;o.add(a)}return!0})())return!1;if(!(Qc(e.contains)||Qo(e.minContains)||Qo(e.maxContains)))return!0;let r=Qc(e.contains)?e.contains:Es(),i=n.reduce((o,s)=>eE(r,t,s)?o+1:o,0);return!(i===0||Qo(e.minContains)&&i<e.minContains||Qo(e.maxContains)&&i>e.maxContains)}function qPa(e,t,n){return gIe(n)}function eLa(e,t,n){return!(!Sh(n)||Qc(e.exclusiveMaximum)&&!(n<e.exclusiveMaximum)||Qc(e.exclusiveMinimum)&&!(n>e.exclusiveMinimum)||Qc(e.maximum)&&!(n<=e.maximum)||Qc(e.minimum)&&!(n>=e.minimum)||Qc(e.multipleOf)&&n%e.multipleOf!==BigInt(0))}function tLa(e,t,n){return dB(n)}function nLa(e,t,n){return eE(e.returns,t,n.prototype)}function rLa(e,t,n){return!(!rb(n)||Qc(e.exclusiveMaximumTimestamp)&&!(n.getTime()<e.exclusiveMaximumTimestamp)||Qc(e.exclusiveMinimumTimestamp)&&!(n.getTime()>e.exclusiveMinimumTimestamp)||Qc(e.maximumTimestamp)&&!(n.getTime()<=e.maximumTimestamp)||Qc(e.minimumTimestamp)&&!(n.getTime()>=e.minimumTimestamp)||Qc(e.multipleOfTimestamp)&&n.getTime()%e.multipleOfTimestamp!==0)}function iLa(e,t,n){return z2(n)}function oLa(e,t,n){let r=globalThis.Object.values(e.$defs),i=e.$defs[e.$ref];return eE(i,[...t,...r],n)}function sLa(e,t,n){return!(!EIe(n)||Qc(e.exclusiveMaximum)&&!(n<e.exclusiveMaximum)||Qc(e.exclusiveMinimum)&&!(n>e.exclusiveMinimum)||Qc(e.maximum)&&!(n<=e.maximum)||Qc(e.minimum)&&!(n>=e.minimum)||Qc(e.multipleOf)&&n%e.multipleOf!==0)}function aLa(e,t,n){let r=e.allOf.every(i=>eE(i,t,n));if(e.unevaluatedProperties===!1){let i=new RegExp(mB(e)),o=Object.getOwnPropertyNames(n).every(s=>i.test(s));return r&&o}else if(Sp(e.unevaluatedProperties)){let i=new RegExp(mB(e)),o=Object.getOwnPropertyNames(n).every(s=>i.test(s)||eE(e.unevaluatedProperties,t,n[s]));return r&&o}else return r}function cLa(e,t,n){return AIe(n)}function lLa(e,t,n){return n===e.const}function uLa(e,t,n){return!1}function dLa(e,t,n){return!eE(e.not,t,n)}function pLa(e,t,n){return Y2(n)}function mLa(e,t,n){return!(!Fd.IsNumberLike(n)||Qc(e.exclusiveMaximum)&&!(n<e.exclusiveMaximum)||Qc(e.exclusiveMinimum)&&!(n>e.exclusiveMinimum)||Qc(e.minimum)&&!(n>=e.minimum)||Qc(e.maximum)&&!(n<=e.maximum)||Qc(e.multipleOf)&&n%e.multipleOf!==0)}function fLa(e,t,n){if(!Fd.IsObjectLike(n)||Qc(e.minProperties)&&!(Object.getOwnPropertyNames(n).length>=e.minProperties)||Qc(e.maxProperties)&&!(Object.getOwnPropertyNames(n).length<=e.maxProperties))return!1;let r=Object.getOwnPropertyNames(e.properties);for(let i of r){let o=e.properties[i];if(e.required&&e.required.includes(i)){if(!eE(o,t,n[i])||(fB(o)||JPa(o))&&!(i in n))return!1}else if(Fd.IsExactOptionalProperty(n,i)&&!eE(o,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(o=>r.includes(o))}else return typeof e.additionalProperties=="object"?Object.getOwnPropertyNames(n).every(o=>r.includes(o)||eE(e.additionalProperties,t,n[o])):!0}function gLa(e,t,n){return hIe(n)}function ALa(e,t,n){if(!Fd.IsRecordLike(n)||Qc(e.minProperties)&&!(Object.getOwnPropertyNames(n).length>=e.minProperties)||Qc(e.maxProperties)&&!(Object.getOwnPropertyNames(n).length<=e.maxProperties))return!1;let[r,i]=Object.entries(e.patternProperties)[0],o=new RegExp(r),s=Object.entries(n).every(([l,u])=>o.test(l)?eE(i,t,u):!0),a=typeof e.additionalProperties=="object"?Object.entries(n).every(([l,u])=>o.test(l)?!0:eE(e.additionalProperties,t,u)):!0,c=e.additionalProperties===!1?Object.getOwnPropertyNames(n).every(l=>o.test(l)):!0;return s&&a&&c}function hLa(e,t,n){return eE(bl(e,t),t,n)}function ELa(e,t,n){let r=new RegExp(e.source,e.flags);return Qc(e.minLength)&&!(n.length>=e.minLength)||Qc(e.maxLength)&&!(n.length<=e.maxLength)?!1:r.test(n)}function yLa(e,t,n){return!Tc(n)||Qc(e.minLength)&&!(n.length>=e.minLength)||Qc(e.maxLength)&&!(n.length<=e.maxLength)||Qc(e.pattern)&&!new RegExp(e.pattern).test(n)?!1:Qc(e.format)?sb.Has(e.format)?sb.Get(e.format)(n):!1:!0}function bLa(e,t,n){return Z2(n)}function CLa(e,t,n){return Tc(n)&&new RegExp(e.pattern).test(n)}function ILa(e,t,n){return eE(bl(e,t),t,n)}function SLa(e,t,n){if(!qo(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(!eE(e.items[r],t,n[r]))return!1;return!0}function _La(e,t,n){return rp(n)}function vLa(e,t,n){return e.anyOf.some(r=>eE(r,t,n))}function xLa(e,t,n){return!(!RH(n)||Qc(e.maxByteLength)&&!(n.length<=e.maxByteLength)||Qc(e.minByteLength)&&!(n.length>=e.minByteLength))}function wLa(e,t,n){return!0}function RLa(e,t,n){return Fd.IsVoidLike(n)}function TLa(e,t,n){return Yg.Has(e[$n])?Yg.Get(e[$n])(e,n):!1}function eE(e,t,n){let r=Qc(e.$id)?qh(e,t):t,i=e;switch(i[$n]){case"Any":return $Pa(i,r,n);case"Argument":return KPa(i,r,n);case"Array":return jPa(i,r,n);case"AsyncIterator":return qPa(i,r,n);case"BigInt":return eLa(i,r,n);case"Boolean":return tLa(i,r,n);case"Constructor":return nLa(i,r,n);case"Date":return rLa(i,r,n);case"Function":return iLa(i,r,n);case"Import":return oLa(i,r,n);case"Integer":return sLa(i,r,n);case"Intersect":return aLa(i,r,n);case"Iterator":return cLa(i,r,n);case"Literal":return lLa(i,r,n);case"Never":return uLa(i,r,n);case"Not":return dLa(i,r,n);case"Null":return pLa(i,r,n);case"Number":return mLa(i,r,n);case"Object":return fLa(i,r,n);case"Promise":return gLa(i,r,n);case"Record":return ALa(i,r,n);case"Ref":return hLa(i,r,n);case"RegExp":return ELa(i,r,n);case"String":return yLa(i,r,n);case"Symbol":return bLa(i,r,n);case"TemplateLiteral":return CLa(i,r,n);case"This":return ILa(i,r,n);case"Tuple":return SLa(i,r,n);case"Undefined":return _La(i,r,n);case"Union":return vLa(i,r,n);case"Uint8Array":return xLa(i,r,n);case"Unknown":return wLa(i,r,n);case"Void":return RLa(i,r,n);default:if(!Yg.Has(i[$n]))throw new rot(i);return TLa(i,r,n)}}function Fa(...e){return e.length===3?eE(e[0],e[1],e[2]):eE(e[0],[],e[1])}var rot,uan=C(()=>{Ome();nR();Ume();ao();__();rV();$5();Ip();af();Wg();Ha();rot=class extends Zo{constructor(t){super("Unknown type"),this.schema=t}}});var Av=C(()=>{uan()});function SU(e){return e.replace(/~/g,"~0").replace(/\//g,"~1")}function Fc(e){return e!==void 0}function Qi(e,t,n,r,i=[]){return{type:e,schema:t,path:n,value:r,message:san()({errorType:e,path:n,schema:t,value:r,errors:i}),errors:i}}function*BLa(e,t,n,r){}function*NLa(e,t,n,r){}function*kLa(e,t,n,r){if(!qo(r))return yield Qi(Kn.Array,e,n,r);Fc(e.minItems)&&!(r.length>=e.minItems)&&(yield Qi(Kn.ArrayMinItems,e,n,r)),Fc(e.maxItems)&&!(r.length<=e.maxItems)&&(yield Qi(Kn.ArrayMaxItems,e,n,r));for(let s=0;s<r.length;s++)yield*tE(e.items,t,`${n}/${s}`,r[s]);if(e.uniqueItems===!0&&!(function(){let s=new Set;for(let a of r){let c=IU(a);if(s.has(c))return!1;s.add(c)}return!0})()&&(yield Qi(Kn.ArrayUniqueItems,e,n,r)),!(Fc(e.contains)||Fc(e.minContains)||Fc(e.maxContains)))return;let i=Fc(e.contains)?e.contains:Es(),o=r.reduce((s,a,c)=>tE(i,t,`${n}${c}`,a).next().done===!0?s+1:s,0);o===0&&(yield Qi(Kn.ArrayContains,e,n,r)),Qo(e.minContains)&&o<e.minContains&&(yield Qi(Kn.ArrayMinContains,e,n,r)),Qo(e.maxContains)&&o>e.maxContains&&(yield Qi(Kn.ArrayMaxContains,e,n,r))}function*DLa(e,t,n,r){gIe(r)||(yield Qi(Kn.AsyncIterator,e,n,r))}function*MLa(e,t,n,r){if(!Sh(r))return yield Qi(Kn.BigInt,e,n,r);Fc(e.exclusiveMaximum)&&!(r<e.exclusiveMaximum)&&(yield Qi(Kn.BigIntExclusiveMaximum,e,n,r)),Fc(e.exclusiveMinimum)&&!(r>e.exclusiveMinimum)&&(yield Qi(Kn.BigIntExclusiveMinimum,e,n,r)),Fc(e.maximum)&&!(r<=e.maximum)&&(yield Qi(Kn.BigIntMaximum,e,n,r)),Fc(e.minimum)&&!(r>=e.minimum)&&(yield Qi(Kn.BigIntMinimum,e,n,r)),Fc(e.multipleOf)&&r%e.multipleOf!==BigInt(0)&&(yield Qi(Kn.BigIntMultipleOf,e,n,r))}function*QLa(e,t,n,r){dB(r)||(yield Qi(Kn.Boolean,e,n,r))}function*FLa(e,t,n,r){yield*tE(e.returns,t,n,r.prototype)}function*OLa(e,t,n,r){if(!rb(r))return yield Qi(Kn.Date,e,n,r);Fc(e.exclusiveMaximumTimestamp)&&!(r.getTime()<e.exclusiveMaximumTimestamp)&&(yield Qi(Kn.DateExclusiveMaximumTimestamp,e,n,r)),Fc(e.exclusiveMinimumTimestamp)&&!(r.getTime()>e.exclusiveMinimumTimestamp)&&(yield Qi(Kn.DateExclusiveMinimumTimestamp,e,n,r)),Fc(e.maximumTimestamp)&&!(r.getTime()<=e.maximumTimestamp)&&(yield Qi(Kn.DateMaximumTimestamp,e,n,r)),Fc(e.minimumTimestamp)&&!(r.getTime()>=e.minimumTimestamp)&&(yield Qi(Kn.DateMinimumTimestamp,e,n,r)),Fc(e.multipleOfTimestamp)&&r.getTime()%e.multipleOfTimestamp!==0&&(yield Qi(Kn.DateMultipleOfTimestamp,e,n,r))}function*PLa(e,t,n,r){z2(r)||(yield Qi(Kn.Function,e,n,r))}function*LLa(e,t,n,r){let i=globalThis.Object.values(e.$defs),o=e.$defs[e.$ref];yield*tE(o,[...t,...i],n,r)}function*ULa(e,t,n,r){if(!EIe(r))return yield Qi(Kn.Integer,e,n,r);Fc(e.exclusiveMaximum)&&!(r<e.exclusiveMaximum)&&(yield Qi(Kn.IntegerExclusiveMaximum,e,n,r)),Fc(e.exclusiveMinimum)&&!(r>e.exclusiveMinimum)&&(yield Qi(Kn.IntegerExclusiveMinimum,e,n,r)),Fc(e.maximum)&&!(r<=e.maximum)&&(yield Qi(Kn.IntegerMaximum,e,n,r)),Fc(e.minimum)&&!(r>=e.minimum)&&(yield Qi(Kn.IntegerMinimum,e,n,r)),Fc(e.multipleOf)&&r%e.multipleOf!==0&&(yield Qi(Kn.IntegerMultipleOf,e,n,r))}function*GLa(e,t,n,r){let i=!1;for(let o of e.allOf)for(let s of tE(o,t,n,r))i=!0,yield s;if(i)return yield Qi(Kn.Intersect,e,n,r);if(e.unevaluatedProperties===!1){let o=new RegExp(mB(e));for(let s of Object.getOwnPropertyNames(r))o.test(s)||(yield Qi(Kn.IntersectUnevaluatedProperties,e,`${n}/${s}`,r))}if(typeof e.unevaluatedProperties=="object"){let o=new RegExp(mB(e));for(let s of Object.getOwnPropertyNames(r))if(!o.test(s)){let a=tE(e.unevaluatedProperties,t,`${n}/${s}`,r[s]).next();a.done||(yield a.value)}}}function*VLa(e,t,n,r){AIe(r)||(yield Qi(Kn.Iterator,e,n,r))}function*WLa(e,t,n,r){r!==e.const&&(yield Qi(Kn.Literal,e,n,r))}function*YLa(e,t,n,r){yield Qi(Kn.Never,e,n,r)}function*zLa(e,t,n,r){tE(e.not,t,n,r).next().done===!0&&(yield Qi(Kn.Not,e,n,r))}function*ZLa(e,t,n,r){Y2(r)||(yield Qi(Kn.Null,e,n,r))}function*HLa(e,t,n,r){if(!Fd.IsNumberLike(r))return yield Qi(Kn.Number,e,n,r);Fc(e.exclusiveMaximum)&&!(r<e.exclusiveMaximum)&&(yield Qi(Kn.NumberExclusiveMaximum,e,n,r)),Fc(e.exclusiveMinimum)&&!(r>e.exclusiveMinimum)&&(yield Qi(Kn.NumberExclusiveMinimum,e,n,r)),Fc(e.maximum)&&!(r<=e.maximum)&&(yield Qi(Kn.NumberMaximum,e,n,r)),Fc(e.minimum)&&!(r>=e.minimum)&&(yield Qi(Kn.NumberMinimum,e,n,r)),Fc(e.multipleOf)&&r%e.multipleOf!==0&&(yield Qi(Kn.NumberMultipleOf,e,n,r))}function*XLa(e,t,n,r){if(!Fd.IsObjectLike(r))return yield Qi(Kn.Object,e,n,r);Fc(e.minProperties)&&!(Object.getOwnPropertyNames(r).length>=e.minProperties)&&(yield Qi(Kn.ObjectMinProperties,e,n,r)),Fc(e.maxProperties)&&!(Object.getOwnPropertyNames(r).length<=e.maxProperties)&&(yield Qi(Kn.ObjectMaxProperties,e,n,r));let i=Array.isArray(e.required)?e.required:[],o=Object.getOwnPropertyNames(e.properties),s=Object.getOwnPropertyNames(r);for(let a of i)s.includes(a)||(yield Qi(Kn.ObjectRequiredProperty,e.properties[a],`${n}/${SU(a)}`,void 0));if(e.additionalProperties===!1)for(let a of s)o.includes(a)||(yield Qi(Kn.ObjectAdditionalProperties,e,`${n}/${SU(a)}`,r[a]));if(typeof e.additionalProperties=="object")for(let a of s)o.includes(a)||(yield*tE(e.additionalProperties,t,`${n}/${SU(a)}`,r[a]));for(let a of o){let c=e.properties[a];e.required&&e.required.includes(a)?(yield*tE(c,t,`${n}/${SU(a)}`,r[a]),fB(e)&&!(a in r)&&(yield Qi(Kn.ObjectRequiredProperty,c,`${n}/${SU(a)}`,void 0))):Fd.IsExactOptionalProperty(r,a)&&(yield*tE(c,t,`${n}/${SU(a)}`,r[a]))}}function*JLa(e,t,n,r){hIe(r)||(yield Qi(Kn.Promise,e,n,r))}function*$La(e,t,n,r){if(!Fd.IsRecordLike(r))return yield Qi(Kn.Object,e,n,r);Fc(e.minProperties)&&!(Object.getOwnPropertyNames(r).length>=e.minProperties)&&(yield Qi(Kn.ObjectMinProperties,e,n,r)),Fc(e.maxProperties)&&!(Object.getOwnPropertyNames(r).length<=e.maxProperties)&&(yield Qi(Kn.ObjectMaxProperties,e,n,r));let[i,o]=Object.entries(e.patternProperties)[0],s=new RegExp(i);for(let[a,c]of Object.entries(r))s.test(a)&&(yield*tE(o,t,`${n}/${SU(a)}`,c));if(typeof e.additionalProperties=="object")for(let[a,c]of Object.entries(r))s.test(a)||(yield*tE(e.additionalProperties,t,`${n}/${SU(a)}`,c));if(e.additionalProperties===!1){for(let[a,c]of Object.entries(r))if(!s.test(a))return yield Qi(Kn.ObjectAdditionalProperties,e,`${n}/${SU(a)}`,c)}}function*KLa(e,t,n,r){yield*tE(bl(e,t),t,n,r)}function*jLa(e,t,n,r){if(!Tc(r))return yield Qi(Kn.String,e,n,r);if(Fc(e.minLength)&&!(r.length>=e.minLength)&&(yield Qi(Kn.StringMinLength,e,n,r)),Fc(e.maxLength)&&!(r.length<=e.maxLength)&&(yield Qi(Kn.StringMaxLength,e,n,r)),!new RegExp(e.source,e.flags).test(r))return yield Qi(Kn.RegExp,e,n,r)}function*qLa(e,t,n,r){if(!Tc(r))return yield Qi(Kn.String,e,n,r);Fc(e.minLength)&&!(r.length>=e.minLength)&&(yield Qi(Kn.StringMinLength,e,n,r)),Fc(e.maxLength)&&!(r.length<=e.maxLength)&&(yield Qi(Kn.StringMaxLength,e,n,r)),Tc(e.pattern)&&(new RegExp(e.pattern).test(r)||(yield Qi(Kn.StringPattern,e,n,r))),Tc(e.format)&&(sb.Has(e.format)?sb.Get(e.format)(r)||(yield Qi(Kn.StringFormat,e,n,r)):yield Qi(Kn.StringFormatUnknown,e,n,r))}function*eUa(e,t,n,r){Z2(r)||(yield Qi(Kn.Symbol,e,n,r))}function*tUa(e,t,n,r){if(!Tc(r))return yield Qi(Kn.String,e,n,r);new RegExp(e.pattern).test(r)||(yield Qi(Kn.StringPattern,e,n,r))}function*nUa(e,t,n,r){yield*tE(bl(e,t),t,n,r)}function*rUa(e,t,n,r){if(!qo(r))return yield Qi(Kn.Tuple,e,n,r);if(e.items===void 0&&r.length!==0)return yield Qi(Kn.TupleLength,e,n,r);if(r.length!==e.maxItems)return yield Qi(Kn.TupleLength,e,n,r);if(e.items)for(let i=0;i<e.items.length;i++)yield*tE(e.items[i],t,`${n}/${i}`,r[i])}function*iUa(e,t,n,r){rp(r)||(yield Qi(Kn.Undefined,e,n,r))}function*oUa(e,t,n,r){if(Fa(e,t,r))return;let i=e.anyOf.map(o=>new hv(tE(o,t,n,r)));yield Qi(Kn.Union,e,n,r,i)}function*sUa(e,t,n,r){if(!RH(r))return yield Qi(Kn.Uint8Array,e,n,r);Fc(e.maxByteLength)&&!(r.length<=e.maxByteLength)&&(yield Qi(Kn.Uint8ArrayMaxByteLength,e,n,r)),Fc(e.minByteLength)&&!(r.length>=e.minByteLength)&&(yield Qi(Kn.Uint8ArrayMinByteLength,e,n,r))}function*aUa(e,t,n,r){}function*cUa(e,t,n,r){Fd.IsVoidLike(r)||(yield Qi(Kn.Void,e,n,r))}function*lUa(e,t,n,r){Yg.Get(e[$n])(e,r)||(yield Qi(Kn.Kind,e,n,r))}function*tE(e,t,n,r){let i=Fc(e.$id)?[...t,e]:t,o=e;switch(o[$n]){case"Any":return yield*BLa(o,i,n,r);case"Argument":return yield*NLa(o,i,n,r);case"Array":return yield*kLa(o,i,n,r);case"AsyncIterator":return yield*DLa(o,i,n,r);case"BigInt":return yield*MLa(o,i,n,r);case"Boolean":return yield*QLa(o,i,n,r);case"Constructor":return yield*FLa(o,i,n,r);case"Date":return yield*OLa(o,i,n,r);case"Function":return yield*PLa(o,i,n,r);case"Import":return yield*LLa(o,i,n,r);case"Integer":return yield*ULa(o,i,n,r);case"Intersect":return yield*GLa(o,i,n,r);case"Iterator":return yield*VLa(o,i,n,r);case"Literal":return yield*WLa(o,i,n,r);case"Never":return yield*YLa(o,i,n,r);case"Not":return yield*zLa(o,i,n,r);case"Null":return yield*ZLa(o,i,n,r);case"Number":return yield*HLa(o,i,n,r);case"Object":return yield*XLa(o,i,n,r);case"Promise":return yield*JLa(o,i,n,r);case"Record":return yield*$La(o,i,n,r);case"Ref":return yield*KLa(o,i,n,r);case"RegExp":return yield*jLa(o,i,n,r);case"String":return yield*qLa(o,i,n,r);case"Symbol":return yield*eUa(o,i,n,r);case"TemplateLiteral":return yield*tUa(o,i,n,r);case"This":return yield*nUa(o,i,n,r);case"Tuple":return yield*rUa(o,i,n,r);case"Undefined":return yield*iUa(o,i,n,r);case"Union":return yield*oUa(o,i,n,r);case"Uint8Array":return yield*sUa(o,i,n,r);case"Unknown":return yield*aUa(o,i,n,r);case"Void":return yield*cUa(o,i,n,r);default:if(!Yg.Has(o[$n]))throw new iot(e);return yield*lUa(o,i,n,r)}}function YN(...e){let t=e.length===3?tE(e[0],e[1],"",e[2]):tE(e[0],[],"",e[1]);return new hv(t)}var Kn,iot,hv,can=C(()=>{Ome();__();$5();X3e();aan();Ip();nR();Ume();Av();ao();af();Wg();(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"})(Kn||(Kn={}));iot=class extends Zo{constructor(t){super("Unknown type"),this.schema=t}};hv=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 QK={};ai(QK,{DefaultErrorFunction:()=>mAi,Errors:()=>YN,GetErrorFunction:()=>san,SetErrorFunction:()=>kPa,ValueErrorIterator:()=>hv,ValueErrorType:()=>Kn,ValueErrorsUnknownTypeError:()=>iot});var SQ=C(()=>{can();aan()});function fm(e,t,n){try{return kl(e)?e[ip].Decode(n):n}catch(r){throw new oot(e,t,n,r)}}function uUa(e,t,n,r){return qo(r)?fm(e,n,r.map((i,o)=>zN(e.items,t,`${n}/${o}`,i))):fm(e,n,r)}function dUa(e,t,n,r){if(!ea(r)||mI(r))return fm(e,n,r);let i=Kie(e),o=i.map(u=>u[0]),s={...r};for(let[u,d]of i)u in s&&(s[u]=zN(d,t,`${n}/${u}`,s[u]));if(!kl(e.unevaluatedProperties))return fm(e,n,s);let a=Object.getOwnPropertyNames(s),c=e.unevaluatedProperties,l={...s};for(let u of a)o.includes(u)||(l[u]=fm(c,`${n}/${u}`,l[u]));return fm(e,n,l)}function pUa(e,t,n,r){let i=globalThis.Object.values(e.$defs),o=e.$defs[e.$ref],s=zN(o,[...t,...i],n,r);return fm(e,n,s)}function mUa(e,t,n,r){return fm(e,n,zN(e.not,t,n,r))}function fUa(e,t,n,r){if(!ea(r))return fm(e,n,r);let i=ub(e),o={...r};for(let l of i)hs(o,l)&&(rp(o[l])&&(!J2(e.properties[l])||Fd.IsExactOptionalProperty(o,l))||(o[l]=zN(e.properties[l],t,`${n}/${l}`,o[l])));if(!Sp(e.additionalProperties))return fm(e,n,o);let s=Object.getOwnPropertyNames(o),a=e.additionalProperties,c={...o};for(let l of s)i.includes(l)||(c[l]=fm(a,`${n}/${l}`,c[l]));return fm(e,n,c)}function gUa(e,t,n,r){if(!ea(r))return fm(e,n,r);let i=Object.getOwnPropertyNames(e.patternProperties)[0],o=new RegExp(i),s={...r};for(let u of Object.getOwnPropertyNames(r))o.test(u)&&(s[u]=zN(e.patternProperties[i],t,`${n}/${u}`,s[u]));if(!Sp(e.additionalProperties))return fm(e,n,s);let a=Object.getOwnPropertyNames(s),c=e.additionalProperties,l={...s};for(let u of a)o.test(u)||(l[u]=fm(c,`${n}/${u}`,l[u]));return fm(e,n,l)}function AUa(e,t,n,r){let i=bl(e,t);return fm(e,n,zN(i,t,n,r))}function hUa(e,t,n,r){let i=bl(e,t);return fm(e,n,zN(i,t,n,r))}function EUa(e,t,n,r){return qo(r)&&qo(e.items)?fm(e,n,e.items.map((i,o)=>zN(i,t,`${n}/${o}`,r[o]))):fm(e,n,r)}function yUa(e,t,n,r){for(let i of e.anyOf){if(!Fa(i,t,r))continue;let o=zN(i,t,n,r);return fm(e,n,o)}return fm(e,n,r)}function zN(e,t,n,r){let i=qh(e,t),o=e;switch(e[$n]){case"Array":return uUa(o,i,n,r);case"Import":return pUa(o,i,n,r);case"Intersect":return dUa(o,i,n,r);case"Not":return mUa(o,i,n,r);case"Object":return fUa(o,i,n,r);case"Record":return gUa(o,i,n,r);case"Ref":return AUa(o,i,n,r);case"Symbol":return fm(o,n,r);case"This":return hUa(o,i,n,r);case"Tuple":return EUa(o,i,n,r);case"Union":return yUa(o,i,n,r);default:return fm(o,n,r)}}function OK(e,t,n){return zN(e,t,"",n)}var FK,oot,bAi=C(()=>{yIe();ao();Ip();__();nR();Av();Wg();Ha();FK=class extends Zo{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}},oot=class extends Zo{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 my(e,t,n){try{return kl(e)?e[ip].Encode(n):n}catch(r){throw new sot(e,t,n,r)}}function bUa(e,t,n,r){let i=my(e,n,r);return qo(i)?i.map((o,s)=>ZN(e.items,t,`${n}/${s}`,o)):i}function CUa(e,t,n,r){let i=globalThis.Object.values(e.$defs),o=e.$defs[e.$ref],s=my(e,n,r);return ZN(o,[...t,...i],n,s)}function IUa(e,t,n,r){let i=my(e,n,r);if(!ea(r)||mI(r))return i;let o=Kie(e),s=o.map(d=>d[0]),a={...i};for(let[d,p]of o)d in a&&(a[d]=ZN(p,t,`${n}/${d}`,a[d]));if(!kl(e.unevaluatedProperties))return a;let c=Object.getOwnPropertyNames(a),l=e.unevaluatedProperties,u={...a};for(let d of c)s.includes(d)||(u[d]=my(l,`${n}/${d}`,u[d]));return u}function SUa(e,t,n,r){return my(e.not,n,my(e,n,r))}function _Ua(e,t,n,r){let i=my(e,n,r);if(!ea(i))return i;let o=ub(e),s={...i};for(let u of o)hs(s,u)&&(rp(s[u])&&(!J2(e.properties[u])||Fd.IsExactOptionalProperty(s,u))||(s[u]=ZN(e.properties[u],t,`${n}/${u}`,s[u])));if(!Sp(e.additionalProperties))return s;let a=Object.getOwnPropertyNames(s),c=e.additionalProperties,l={...s};for(let u of a)o.includes(u)||(l[u]=my(c,`${n}/${u}`,l[u]));return l}function vUa(e,t,n,r){let i=my(e,n,r);if(!ea(r))return i;let o=Object.getOwnPropertyNames(e.patternProperties)[0],s=new RegExp(o),a={...i};for(let d of Object.getOwnPropertyNames(r))s.test(d)&&(a[d]=ZN(e.patternProperties[o],t,`${n}/${d}`,a[d]));if(!Sp(e.additionalProperties))return a;let c=Object.getOwnPropertyNames(a),l=e.additionalProperties,u={...a};for(let d of c)s.test(d)||(u[d]=my(l,`${n}/${d}`,u[d]));return u}function xUa(e,t,n,r){let i=bl(e,t),o=ZN(i,t,n,r);return my(e,n,o)}function wUa(e,t,n,r){let i=bl(e,t),o=ZN(i,t,n,r);return my(e,n,o)}function RUa(e,t,n,r){let i=my(e,n,r);return qo(e.items)?e.items.map((o,s)=>ZN(o,t,`${n}/${s}`,i[s])):[]}function TUa(e,t,n,r){for(let i of e.anyOf){if(!Fa(i,t,r))continue;let o=ZN(i,t,n,r);return my(e,n,o)}for(let i of e.anyOf){let o=ZN(i,t,n,r);if(Fa(e,t,o))return my(e,n,o)}return my(e,n,r)}function ZN(e,t,n,r){let i=qh(e,t),o=e;switch(e[$n]){case"Array":return bUa(o,i,n,r);case"Import":return CUa(o,i,n,r);case"Intersect":return IUa(o,i,n,r);case"Not":return SUa(o,i,n,r);case"Object":return _Ua(o,i,n,r);case"Record":return vUa(o,i,n,r);case"Ref":return xUa(o,i,n,r);case"This":return wUa(o,i,n,r);case"Tuple":return RUa(o,i,n,r);case"Union":return TUa(o,i,n,r);default:return my(o,n,r)}}function LK(e,t,n){return ZN(e,t,"",n)}var PK,sot,CAi=C(()=>{yIe();ao();Ip();__();nR();Av();Wg();Ha();PK=class extends Zo{constructor(t,n,r){super("The encoded value does not match the expected schema"),this.schema=t,this.value=n,this.error=r}},sot=class extends Zo{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 BUa(e,t){return kl(e)||YA(e.items,t)}function NUa(e,t){return kl(e)||YA(e.items,t)}function kUa(e,t){return kl(e)||YA(e.returns,t)||e.parameters.some(n=>YA(n,t))}function DUa(e,t){return kl(e)||YA(e.returns,t)||e.parameters.some(n=>YA(n,t))}function MUa(e,t){return kl(e)||kl(e.unevaluatedProperties)||e.allOf.some(n=>YA(n,t))}function QUa(e,t){let n=globalThis.Object.getOwnPropertyNames(e.$defs).reduce((i,o)=>[...i,e.$defs[o]],[]),r=e.$defs[e.$ref];return kl(e)||YA(r,[...n,...t])}function FUa(e,t){return kl(e)||YA(e.items,t)}function OUa(e,t){return kl(e)||YA(e.not,t)}function PUa(e,t){return kl(e)||Object.values(e.properties).some(n=>YA(n,t))||Sp(e.additionalProperties)&&YA(e.additionalProperties,t)}function LUa(e,t){return kl(e)||YA(e.item,t)}function UUa(e,t){let n=Object.getOwnPropertyNames(e.patternProperties)[0],r=e.patternProperties[n];return kl(e)||YA(r,t)||Sp(e.additionalProperties)&&kl(e.additionalProperties)}function GUa(e,t){return kl(e)?!0:YA(bl(e,t),t)}function VUa(e,t){return kl(e)?!0:YA(bl(e,t),t)}function WUa(e,t){return kl(e)||!rp(e.items)&&e.items.some(n=>YA(n,t))}function YUa(e,t){return kl(e)||e.anyOf.some(n=>YA(n,t))}function YA(e,t){let n=qh(e,t),r=e;if(e.$id&&dan.has(e.$id))return!1;switch(e.$id&&dan.add(e.$id),e[$n]){case"Array":return BUa(r,n);case"AsyncIterator":return NUa(r,n);case"Constructor":return kUa(r,n);case"Function":return DUa(r,n);case"Import":return QUa(r,n);case"Intersect":return MUa(r,n);case"Iterator":return FUa(r,n);case"Not":return OUa(r,n);case"Object":return PUa(r,n);case"Promise":return LUa(r,n);case"Record":return UUa(r,n);case"Ref":return GUa(r,n);case"This":return VUa(r,n);case"Tuple":return WUa(r,n);case"Union":return YUa(r,n);default:return kl(e)}}function _Q(e,t){return dan.clear(),YA(e,t)}var dan,IAi=C(()=>{nR();ao();Ha();Wg();dan=new Set});var Gme=C(()=>{bAi();CAi();IAi()});function Y4(e){if(!Tc(e))throw Error("ConstantString: Not a String");return`'${JSON.stringify(e).slice(1,-1).replace(/'/g,"\\'")}'`}function SAi(e,t){return`${e}[${Y4(t)}]`}var aot,cot,pan,lot,DBe,z4,UK,_Ai=C(()=>{Gme();SQ();Ome();Ip();nR();Ume();ao();$5();__();X3e();af();nD();Wg();nkt();aot=class{constructor(t,n,r,i){this.schema=t,this.references=n,this.checkFunc=r,this.code=i,this.hasTransform=_Q(t,n)}Code(){return this.code}Schema(){return this.schema}References(){return this.references}Errors(t){return YN(this.schema,this.references,t)}Check(t){return this.checkFunc(t)}Decode(t){if(!this.checkFunc(t))throw new FK(this.schema,t,this.Errors(t).First());return this.hasTransform?OK(this.schema,this.references,t):t}Encode(t){let n=this.hasTransform?LK(this.schema,this.references,t):t;if(!this.checkFunc(n))throw new PK(this.schema,t,this.Errors(t).First());return n}};(function(e){function t(o){return o===36}e.DollarSign=t;function n(o){return o===95}e.IsUnderscore=n;function r(o){return o>=65&&o<=90||o>=97&&o<=122}e.IsAlpha=r;function i(o){return o>=48&&o<=57}e.IsNumeric=i})(cot||(cot={}));(function(e){function t(n){let r=[];for(let i=0;i<n.length;i++){let o=n.charCodeAt(i);cot.IsNumeric(o)||cot.IsAlpha(o)?r.push(n.charAt(i)):r.push(`_${o}_`)}return r.join("").replace(/__/g,"_")}e.Encode=t})(pan||(pan={}));lot=class extends Zo{constructor(t){super("Unknown type"),this.schema=t}},DBe=class extends Zo{constructor(t){super("Preflight validation check failed to guard for the given schema"),this.schema=t}};(function(e){function t(s,a,c){return Fd.ExactOptionalPropertyTypes?`(${Y4(a)} in ${s} ? ${c} : true)`:`(${SAi(s,a)} !== undefined ? ${c} : true)`}e.IsExactOptionalProperty=t;function n(s){return Fd.AllowArrayObject?`(typeof ${s} === 'object' && ${s} !== null)`:`(typeof ${s} === 'object' && ${s} !== null && !Array.isArray(${s}))`}e.IsObjectLike=n;function r(s){return Fd.AllowArrayObject?`(typeof ${s} === 'object' && ${s} !== null && !(${s} instanceof Date) && !(${s} instanceof Uint8Array))`:`(typeof ${s} === 'object' && ${s} !== null && !Array.isArray(${s}) && !(${s} instanceof Date) && !(${s} instanceof Uint8Array))`}e.IsRecordLike=r;function i(s){return Fd.AllowNaN?`typeof ${s} === 'number'`:`Number.isFinite(${s})`}e.IsNumberLike=i;function o(s){return Fd.AllowNullVoid?`(${s} === undefined || ${s} === null)`:`${s} === undefined`}e.IsVoidLike=o})(z4||(z4={}));(function(e){function t(te){return te[$n]==="Any"||te[$n]==="Unknown"}function*n(te,J,G){yield"true"}function*r(te,J,G){yield"true"}function*i(te,J,G){yield`Array.isArray(${G})`;let[ue,de]=[le("value","any"),le("acc","number")];Qo(te.maxItems)&&(yield`${G}.length <= ${te.maxItems}`),Qo(te.minItems)&&(yield`${G}.length >= ${te.minItems}`);let we=Me(te.items,J,"value");if(yield`((array) => { for(const ${ue} of array) if(!(${we})) { return false }; return true; })(${G})`,_p(te.contains)||Qo(te.minContains)||Qo(te.maxContains)){let De=_p(te.contains)?te.contains:Es(),Ie=Me(De,J,"value"),ie=Qo(te.minContains)?[`(count >= ${te.minContains})`]:[],Ye=Qo(te.maxContains)?[`(count <= ${te.maxContains})`]:[],st=`const count = value.reduce((${de}, ${ue}) => ${Ie} ? acc + 1 : acc, 0)`,it=["(count > 0)",...ie,...Ye].join(" && ");yield`((${ue}) => { ${st}; return ${it}})(${G})`}te.uniqueItems===!0&&(yield`((${ue}) => { 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 } )(${G})`)}function*o(te,J,G){yield`(typeof value === 'object' && Symbol.asyncIterator in ${G})`}function*s(te,J,G){yield`(typeof ${G} === 'bigint')`,Sh(te.exclusiveMaximum)&&(yield`${G} < BigInt(${te.exclusiveMaximum})`),Sh(te.exclusiveMinimum)&&(yield`${G} > BigInt(${te.exclusiveMinimum})`),Sh(te.maximum)&&(yield`${G} <= BigInt(${te.maximum})`),Sh(te.minimum)&&(yield`${G} >= BigInt(${te.minimum})`),Sh(te.multipleOf)&&(yield`(${G} % BigInt(${te.multipleOf})) === 0`)}function*a(te,J,G){yield`(typeof ${G} === 'boolean')`}function*c(te,J,G){yield*pe(te.returns,J,`${G}.prototype`)}function*l(te,J,G){yield`(${G} instanceof Date) && Number.isFinite(${G}.getTime())`,Qo(te.exclusiveMaximumTimestamp)&&(yield`${G}.getTime() < ${te.exclusiveMaximumTimestamp}`),Qo(te.exclusiveMinimumTimestamp)&&(yield`${G}.getTime() > ${te.exclusiveMinimumTimestamp}`),Qo(te.maximumTimestamp)&&(yield`${G}.getTime() <= ${te.maximumTimestamp}`),Qo(te.minimumTimestamp)&&(yield`${G}.getTime() >= ${te.minimumTimestamp}`),Qo(te.multipleOfTimestamp)&&(yield`(${G}.getTime() % ${te.multipleOfTimestamp}) === 0`)}function*u(te,J,G){yield`(typeof ${G} === 'function')`}function*d(te,J,G){let ue=globalThis.Object.getOwnPropertyNames(te.$defs).reduce((de,we)=>[...de,te.$defs[we]],[]);yield*pe(xh(te.$ref),[...J,...ue],G)}function*p(te,J,G){yield`Number.isInteger(${G})`,Qo(te.exclusiveMaximum)&&(yield`${G} < ${te.exclusiveMaximum}`),Qo(te.exclusiveMinimum)&&(yield`${G} > ${te.exclusiveMinimum}`),Qo(te.maximum)&&(yield`${G} <= ${te.maximum}`),Qo(te.minimum)&&(yield`${G} >= ${te.minimum}`),Qo(te.multipleOf)&&(yield`(${G} % ${te.multipleOf}) === 0`)}function*m(te,J,G){let ue=te.allOf.map(de=>Me(de,J,G)).join(" && ");if(te.unevaluatedProperties===!1){let de=$(`${new RegExp(mB(te))};`),we=`Object.getOwnPropertyNames(${G}).every(key => ${de}.test(key))`;yield`(${ue} && ${we})`}else if(_p(te.unevaluatedProperties)){let de=$(`${new RegExp(mB(te))};`),we=`Object.getOwnPropertyNames(${G}).every(key => ${de}.test(key) || ${Me(te.unevaluatedProperties,J,`${G}[key]`)})`;yield`(${ue} && ${we})`}else yield`(${ue})`}function*f(te,J,G){yield`(typeof value === 'object' && Symbol.iterator in ${G})`}function*g(te,J,G){if(typeof te.const=="number"||typeof te.const=="boolean")yield`(${G} === ${te.const})`;else if(typeof te.const=="string")yield`(${G} === ${Y4(te.const)})`;else throw Error("Invalid Literal Value")}function*A(te,J,G){yield"false"}function*h(te,J,G){yield`(!${Me(te.not,J,G)})`}function*E(te,J,G){yield`(${G} === null)`}function*y(te,J,G){yield z4.IsNumberLike(G),Qo(te.exclusiveMaximum)&&(yield`${G} < ${te.exclusiveMaximum}`),Qo(te.exclusiveMinimum)&&(yield`${G} > ${te.exclusiveMinimum}`),Qo(te.maximum)&&(yield`${G} <= ${te.maximum}`),Qo(te.minimum)&&(yield`${G} >= ${te.minimum}`),Qo(te.multipleOf)&&(yield`(${G} % ${te.multipleOf}) === 0`)}function*b(te,J,G){yield z4.IsObjectLike(G),Qo(te.minProperties)&&(yield`Object.getOwnPropertyNames(${G}).length >= ${te.minProperties}`),Qo(te.maxProperties)&&(yield`Object.getOwnPropertyNames(${G}).length <= ${te.maxProperties}`);let ue=Object.getOwnPropertyNames(te.properties);for(let de of ue){let we=SAi(G,de),De=te.properties[de];if(te.required&&te.required.includes(de))yield*pe(De,J,we),(fB(De)||t(De))&&(yield`(${Y4(de)} in ${G})`);else{let Ie=Me(De,J,we);yield z4.IsExactOptionalProperty(G,de,Ie)}}if(te.additionalProperties===!1)if(te.required&&te.required.length===ue.length)yield`Object.getOwnPropertyNames(${G}).length === ${ue.length}`;else{let de=`[${ue.map(we=>`${Y4(we)}`).join(", ")}]`;yield`Object.getOwnPropertyNames(${G}).every(key => ${de}.includes(key))`}if(typeof te.additionalProperties=="object"){let de=Me(te.additionalProperties,J,`${G}[key]`),we=`[${ue.map(De=>`${Y4(De)}`).join(", ")}]`;yield`(Object.getOwnPropertyNames(${G}).every(key => ${we}.includes(key) || ${de}))`}}function*I(te,J,G){yield`${G} instanceof Promise`}function*_(te,J,G){yield z4.IsRecordLike(G),Qo(te.minProperties)&&(yield`Object.getOwnPropertyNames(${G}).length >= ${te.minProperties}`),Qo(te.maxProperties)&&(yield`Object.getOwnPropertyNames(${G}).length <= ${te.maxProperties}`);let[ue,de]=Object.entries(te.patternProperties)[0],we=$(`${new RegExp(ue)}`),De=Me(de,J,"value"),Ie=_p(te.additionalProperties)?Me(te.additionalProperties,J,G):te.additionalProperties===!1?"false":"true",ie=`(${we}.test(key) ? ${De} : ${Ie})`;yield`(Object.entries(${G}).every(([key, value]) => ${ie}))`}function*v(te,J,G){let ue=bl(te,J);if(Ae.functions.has(te.$ref))return yield`${ye(te.$ref)}(${G})`;yield*pe(ue,J,G)}function*w(te,J,G){let ue=$(`${new RegExp(te.source,te.flags)};`);yield`(typeof ${G} === 'string')`,Qo(te.maxLength)&&(yield`${G}.length <= ${te.maxLength}`),Qo(te.minLength)&&(yield`${G}.length >= ${te.minLength}`),yield`${ue}.test(${G})`}function*R(te,J,G){yield`(typeof ${G} === 'string')`,Qo(te.maxLength)&&(yield`${G}.length <= ${te.maxLength}`),Qo(te.minLength)&&(yield`${G}.length >= ${te.minLength}`),te.pattern!==void 0&&(yield`${$(`${new RegExp(te.pattern)};`)}.test(${G})`),te.format!==void 0&&(yield`format(${Y4(te.format)}, ${G})`)}function*N(te,J,G){yield`(typeof ${G} === 'symbol')`}function*Q(te,J,G){yield`(typeof ${G} === 'string')`,yield`${$(`${new RegExp(te.pattern)};`)}.test(${G})`}function*F(te,J,G){yield`${ye(te.$ref)}(${G})`}function*D(te,J,G){if(yield`Array.isArray(${G})`,te.items===void 0)return yield`${G}.length === 0`;yield`(${G}.length === ${te.maxItems})`;for(let ue=0;ue<te.items.length;ue++)yield`${Me(te.items[ue],J,`${G}[${ue}]`)}`}function*k(te,J,G){yield`${G} === undefined`}function*W(te,J,G){yield`(${te.anyOf.map(de=>Me(de,J,G)).join(" || ")})`}function*Y(te,J,G){yield`${G} instanceof Uint8Array`,Qo(te.maxByteLength)&&(yield`(${G}.length <= ${te.maxByteLength})`),Qo(te.minByteLength)&&(yield`(${G}.length >= ${te.minByteLength})`)}function*K(te,J,G){yield"true"}function*z(te,J,G){yield z4.IsVoidLike(G)}function*q(te,J,G){let ue=Ae.instances.size;Ae.instances.set(ue,te),yield`kind(${Y4(te[$n])}, ${ue}, ${G})`}function*pe(te,J,G,ue=!0){let de=Tc(te.$id)?[...J,te]:J,we=te;if(ue&&Tc(te.$id)){let De=ye(te.$id);if(Ae.functions.has(De))return yield`${De}(${G})`;{Ae.functions.set(De,"<deferred>");let Ie=ne(De,te,J,"value",!1);return Ae.functions.set(De,Ie),yield`${De}(${G})`}}switch(we[$n]){case"Any":return yield*n(we,de,G);case"Argument":return yield*r(we,de,G);case"Array":return yield*i(we,de,G);case"AsyncIterator":return yield*o(we,de,G);case"BigInt":return yield*s(we,de,G);case"Boolean":return yield*a(we,de,G);case"Constructor":return yield*c(we,de,G);case"Date":return yield*l(we,de,G);case"Function":return yield*u(we,de,G);case"Import":return yield*d(we,de,G);case"Integer":return yield*p(we,de,G);case"Intersect":return yield*m(we,de,G);case"Iterator":return yield*f(we,de,G);case"Literal":return yield*g(we,de,G);case"Never":return yield*A(we,de,G);case"Not":return yield*h(we,de,G);case"Null":return yield*E(we,de,G);case"Number":return yield*y(we,de,G);case"Object":return yield*b(we,de,G);case"Promise":return yield*I(we,de,G);case"Record":return yield*_(we,de,G);case"Ref":return yield*v(we,de,G);case"RegExp":return yield*w(we,de,G);case"String":return yield*R(we,de,G);case"Symbol":return yield*N(we,de,G);case"TemplateLiteral":return yield*Q(we,de,G);case"This":return yield*F(we,de,G);case"Tuple":return yield*D(we,de,G);case"Undefined":return yield*k(we,de,G);case"Union":return yield*W(we,de,G);case"Uint8Array":return yield*Y(we,de,G);case"Unknown":return yield*K(we,de,G);case"Void":return yield*z(we,de,G);default:if(!Yg.Has(we[$n]))throw new lot(te);return yield*q(we,de,G)}}let Ae={language:"javascript",functions:new Map,variables:new Map,instances:new Map};function Me(te,J,G,ue=!0){return`(${[...pe(te,J,G,ue)].join(" && ")})`}function ye(te){return`check_${pan.Encode(te)}`}function $(te){let J=`local_${Ae.variables.size}`;return Ae.variables.set(J,`const ${J} = ${te}`),J}function ne(te,J,G,ue,de=!0){let[we,De]=[`
|
|
523
523
|
`,st=>"".padStart(st," ")],Ie=le("value","any"),ie=re("boolean"),Ye=[...pe(J,G,ue,de)].map(st=>`${De(4)}${st}`).join(` &&${we}`);return`function ${te}(${Ie})${ie} {${we}${De(2)}return (${we}${Ye}${we}${De(2)})
|
|
524
524
|
}`}function le(te,J){let G=Ae.language==="typescript"?`: ${J}`:"";return`${te}${G}`}function re(te){return Ae.language==="typescript"?`: ${te}`:""}function se(te,J,G){let ue=ne("check",te,J,"value"),de=le("value","any"),we=re("boolean"),De=[...Ae.functions.values()],Ie=[...Ae.variables.values()],ie=Tc(te.$id)?`return function check(${de})${we} {
|
|
525
525
|
return ${ye(te.$id)}(value)
|
|
@@ -6706,7 +6706,7 @@ not revoke server-side tokens; use \`auggie token revoke\` for revocation.
|
|
|
6706
6706
|
|
|
6707
6707
|
Interactive /login and /logout manage the platform session in session.json.`,_yo=`Usage: auggie auth status
|
|
6708
6708
|
|
|
6709
|
-
Show whether the CLI has an active Augment authentication session.`,Vsl="Note: Injected credentials remain active and may override the saved session.",Wsl="Note: Injected credentials remain active.",Ysl="AUGGIE_V2_SEGMENT_WRITE_KEY"});import{readFile as dal}from"node:fs/promises";import{resolve as pal}from"node:path";function gal(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===dBn){let o=e[r+1];if(o===void 0||o.startsWith("-")||!o.trim())return{type:"fatal"};n=o,r+=1;continue}if(i.startsWith(`${dBn}=`)){let o=i.slice(dBn.length+1);if(!o.trim())return{type:"fatal"};n=o;continue}t.push(i)}return{type:"success",args:t,candidate:n}}async function Byo(e,t=fal){let n=gal(e);if(n.type==="fatal")return{type:"fatal",message:mal};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(pal(process.cwd(),r))}catch{return{type:"fatal",message:pBn}}let o;try{o=JSON.parse(i)}catch{return{type:"fatal",message:pBn}}let s=FQe(o);return s?{type:"success",args:n.args,credentials:s}:{type:"fatal",message:pBn}}var dBn,mal,pBn,fal,Nyo=C(()=>{"use strict";zht();dBn="--augment-session-json",mal="--augment-session-json requires a value",pBn="--augment-session-json value is unusable",fal={readPath:e=>dal(e,"utf8")}});import{execFile as Aal}from"node:child_process";import{existsSync as hal,rmSync as Eal}from"node:fs";import{promisify as yal}from"node:util";function mBn(e){let t=e.match(/^git@([^:]+):(.+?)(?:\.git)?$/);if(t){let[,r,i]=t;return{sshUrl:e.endsWith(".git")?e:`${e}.git`,httpsUrl:`https://${r}/${i}.git`}}let n=e.match(/^https?:\/\/([^/]+)\/(.+?)(?:\.git)?$/);if(n){let[,r,i]=n;return{sshUrl:`git@${r}:${i}.git`,httpsUrl:e.endsWith(".git")?e:`${e}.git`}}return{sshUrl:e,httpsUrl:e}}function Qyo(e){return e instanceof Error?e.message:String(e)}async function fBn({sshUrl:e,httpsUrl:t,targetDir:n,extraArgs:r=[]}){let i;for(let o of[{url:e,env:bal},{url:t,env:Myo}])try{return await Dyo("git",["clone","--depth","1",...r,o.url,n],{env:o.env}),{success:!0}}catch(s){i=s,hal(n)&&Eal(n,{recursive:!0,force:!0})}return{success:!1,error:Qyo(i)}}function kyo(e,t){return Dyo("git",e,{cwd:t,env:Myo})}async function Fyo(e,t){try{return await kyo(["fetch","--depth","1","origin",t],e),await kyo(["checkout","FETCH_HEAD"],e),{success:!0}}catch(n){return{success:!1,error:Qyo(n)}}}var Dyo,bal,Myo,Oyo=C(()=>{"use strict";Dyo=yal(Aal),bal={...process.env,GIT_TERMINAL_PROMPT:"0",GIT_SSH_COMMAND:"ssh -o BatchMode=yes"},Myo={...process.env,GIT_TERMINAL_PROMPT:"0"}});import{existsSync as Cal,readFileSync as Ial}from"node:fs";import{join as wEe}from"node:path";function Uyo(e){for(let t of Lyo)if(Cal(wEe(e,t)))return!0;return!1}function Q6(e){let t=Sal(e,Pyo);return t.manifest||t.diagnostics.length>0?t:{diagnostics:[`no marketplace manifest found (looked for ${Pyo.join(", ")})`]}}function Sal(e,t){let n=[];for(let r of t){let i=wEe(e,r),o;try{o=Ial(i,"utf-8")}catch{continue}try{let s=JSON.parse(o);if(s&&typeof s=="object"&&!Array.isArray(s))return{manifest:s,manifestPath:i,diagnostics:n};n.push(`manifest at ${r} is not a JSON object; ignoring`)}catch(s){n.push(`failed to parse manifest at ${r}: ${s.message}`)}}return{diagnostics:n}}var Lyo,Pyo,Gyo,kbt=C(()=>{"use strict";Lyo=[wEe(".augment-plugin","plugin.json"),wEe(".claude-plugin","plugin.json")],Pyo=[wEe(".augment-plugin","marketplace.json"),wEe(".claude-plugin","marketplace.json")];Gyo=`no plugin manifest found (looked for ${Lyo.join(", ")})`});import{execFile as _al}from"node:child_process";import{existsSync as eG,mkdirSync as Wyo,readdirSync as val,renameSync as xal,rmSync as wal,statSync as Ral}from"node:fs";import{dirname as Tal,isAbsolute as Yyo,join as tG,relative as zyo,resolve as gBn}from"node:path";import{promisify as Bal}from"node:util";function Hyo(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 Vyo(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 kal(e){let t=e.match(/^([a-zA-Z0-9_-]+)\/([a-zA-Z0-9_.-]+?)(?:@(.+))?$/);if(t?.[1]&&t[2])return{owner:t[1],repo:t[2].replace(/\.git$/,""),...t[3]?{ref:t[3]}:{}};let n=e.match(/^https?:\/\/github\.com\/([a-zA-Z0-9_-]+)\/([a-zA-Z0-9_.-]+?)(\.git)?(?:#(.+))?$/);if(n?.[1]&&n[2])return{owner:n[1],repo:n[2],...n[4]?{ref:n[4]}:{}};let r=e.match(/^git@github\.com:([a-zA-Z0-9_-]+)\/([a-zA-Z0-9_.-]+?)(\.git)?(?:#(.+))?$/);return r?.[1]&&r[2]?{owner:r[1],repo:r[2],...r[4]?{ref:r[4]}:{}}:null}function nO(e){return typeof e=="string"&&e.length>0?e:void 0}function Dal(e,t){let n=nO(e.repo);return n?{kind:"github",url:`https://github.com/${n.replace(/\.git$/,"")}.git`,...t?{ref:t}:{},...nO(e.path)?{subdir:nO(e.path)}:{}}:null}function Mal(e,t){let n=nO(e.url);return n?{kind:"url",url:n,...t?{ref:t}:{},...nO(e.path)?{subdir:nO(e.path)}:{}}:null}function Qal(e,t){let n=nO(e.url),r=nO(e.path);return n&&r?{kind:"git-subdir",url:n,subdir:r,...t?{ref:t}:{}}:null}function ABn(e){if(!e||typeof e!="object")return null;let t=e,n=nO(t.sha)??nO(t.ref);switch(t.source){case"github":return Dal(t,n);case"url":return Mal(t,n);case"git-subdir":return Qal(t,n);default:return null}}function Xyo(e,t,n){let r=Hyo(t);if(!r)return;let i=tG(e,Zyo,r);if(!eG(tG(i,".git")))return;if(!n)return i;let o=gBn(i,n),s=zyo(i,o);if(!(s.startsWith("..")||Yyo(s)))return eG(o)?o:void 0}async function Fal(e,t){let n=typeof t.name=="string"?t.name:"",r=ABn(t.source);if(!r)return;let i=Hyo(n);if(!i)return{name:n,status:"failed",error:"invalid plugin cache name"};let o=tG(e,Zyo,i);if(eG(tG(o,".git")))return{name:n,status:"skipped"};let s=Tal(o);eG(s)||Wyo(s,{recursive:!0});let{sshUrl:a,httpsUrl:c}=mBn(r.url),l=r.kind==="git-subdir",u=await fBn({sshUrl:a,httpsUrl:c,targetDir:o,extraArgs:l?["--filter=blob:none","--sparse"]:[]});if(!u.success)return{name:n,status:"failed",error:u.error};if(r.ref){let d=await Fyo(o,r.ref);if(!d.success)return{name:n,status:"failed",error:d.error}}if(l&&r.kind==="git-subdir")try{await Nal("git",["sparse-checkout","set",r.subdir],{cwd:o,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 Jyo(e){let{manifest:t}=Q6(e),n=t?.plugins;if(!n||n.length===0)return[];let r=[];for(let i of n){let o=await Fal(e,i);o&&r.push(o)}return r}function Oal(e){try{return Ral(e).isDirectory()}catch{return!1}}function Pal(e,t){let n=zyo(gBn(e),gBn(t));return n!==""&&!n.startsWith("..")&&!Yyo(n)}async function KFe(e,t){let n=kal(t);if(!n)return{success:!1,error:`Invalid GitHub repository: ${t}. Expected owner/repo or a github.com URL.`};let{owner:r,repo:i,ref:o}=n;eG(e)||Wyo(e,{recursive:!0});let s=Vyo(i);if(!s)return{success:!1,error:`Invalid repository name for marketplace directory: "${i}".`};let a=tG(e,s);if(eG(a))return{success:!1,alreadyInstalled:!0,marketplaceId:s,error:`Marketplace '${s}' is already installed.`};let{sshUrl:c,httpsUrl:l}=mBn(`https://github.com/${r}/${i}`),u=await fBn({sshUrl:c,httpsUrl:l,targetDir:a,extraArgs:o?["--branch",o]:[]});if(!u.success)return{success:!1,error:`Failed to clone '${r}/${i}' (SSH and HTTPS both failed): ${u.error}`};let{manifest:d}=Q6(a),p=s,m=typeof d?.name=="string"?Vyo(d.name):null;if(m&&m!==s){let f=tG(e,m);if(!eG(f))try{xal(a,f),p=m}catch{}}return await Jyo(tG(e,p)),{success:!0,marketplaceId:p}}function jFe(e,t){let n=tG(e,t);if(!Pal(e,n))return{success:!1,error:`Refusing to remove '${t}': path is outside the marketplaces directory.`};if(!eG(n))return{success:!1,error:`Marketplace '${t}' not found.`};try{return wal(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 $yo(e){let t=!1;for(let n of e){if(!eG(n))continue;let r;try{r=val(n)}catch{continue}for(let i of r){let o=tG(n,i);if(!Oal(o))continue;(await Jyo(o)).some(a=>a.status==="cloned")&&(t=!0)}}return t}var Nal,Zyo,Dbt=C(()=>{"use strict";Oyo();kbt();Nal=Bal(_al),Zyo=".plugin-cache"});import{readFileSync as Lal}from"node:fs";import{join as Ual}from"node:path";function Kyo(e){let t=Ual(e,"hooks","hooks.json"),n;try{n=Lal(t,"utf-8")}catch{return{diagnostics:[]}}let r;try{r=JSON.parse(n)}catch(o){return{diagnostics:[`failed to parse hooks/hooks.json: ${o.message}`]}}return!r||typeof r!="object"||Array.isArray(r)?{diagnostics:["hooks/hooks.json must be a JSON object"]}:{config:JDe(r),diagnostics:[]}}var jyo=C(()=>{"use strict";zq()});import{existsSync as Gal,lstatSync as Val,readdirSync as nbo,statSync as Wal}from"node:fs";import{basename as qyo,isAbsolute as ebo,join as qFe,relative as Yal,resolve as rbo}from"node:path";function hBn(e,t){let n=[],r=[],i=[],o=new Map;for(let s of e)for(let a of zal(s,t,r)){let c=o.get(a.id);if(c!==void 0){i.push({id:a.id,shadowedRoot:s,winnerRoot:c});continue}o.set(a.id,s),n.push(a)}for(let[s,a]of Object.entries(t))a&&!o.has(s)&&r.push(`enabledPlugins["${s}"] = true but no plugin with that id was found in any marketplace root`);return{plugins:n,globalDiagnostics:r,shadowedPlugins:i}}function zal(e,t,n){let r=[];if(!Gal(e))return r;let i=Q6(e);if(!i.manifest)for(let s of i.diagnostics)s.startsWith("no marketplace manifest found")||n.push(`[${qyo(e)}] ${s}`);if(i.manifest)return tbo(e,qyo(e),t,r,n),r;let o;try{o=nbo(e)}catch(s){return n.push(`failed to read marketplaces directory ${e}: ${s.message}`),r}for(let s of o){let a=qFe(e,s);eOe(a)&&tbo(a,s,t,r,n)}return r}function tbo(e,t,n,r,i){let o=Q6(e);if(!o.manifest){for(let l of o.diagnostics)i.push(`[${t}] ${l}`);return}let s=jal(o.manifest.name,t),a=Kal(e,o.manifest.metadata?.pluginRoot),c=Array.isArray(o.manifest.plugins)?o.manifest.plugins:[];c.length===0&&i.push(`[${s}] marketplace.json has no plugins[] entries`);for(let l of c){let u=Zal(l,e,a,s,n);u&&r.push(u)}for(let l of o.diagnostics)i.push(`[${s}] ${l}`)}function Zal(e,t,n,r,i){let o=typeof e.name=="string"?REe(e.name):void 0;if(!o)return;let s=`${o}@${r}`,a=i[s]===!0,c=[],l=$al(e.source,o,t,n,c);return l?Xal(s,r,o,l,a,c):{id:s,marketplace:r,name:o,root:t,enabled:a,commandsDir:void 0,skillsDir:void 0,hooksConfig:void 0,agentsDirPresent:!1,diagnostics:c}}function Hal(e,t){let n=[],r;try{r=nbo(e).sort()}catch(o){return t.push(`failed to read agents directory: ${o.message}`),n}let i=[];for(let o of r){if(!o.endsWith(".md"))continue;let s=qFe(e,o);try{if(!Val(s).isFile()){i.push(o);continue}}catch(a){t.push(`failed to stat agent file ${o}: ${a.message}`);continue}n.push(s)}return i.length>0&&t.push(`ignoring non-regular agent file(s) under agents/ (symlinks / dirs / devices are not followed): ${i.join(", ")}`),n}function Xal(e,t,n,r,i,o){Uyo(r)||o.push(Gyo);let s=qFe(r,"commands"),a=qFe(r,"skills"),c=qFe(r,"agents"),l=eOe(s)?s:void 0,u=eOe(a)?a:void 0,d=eOe(c),p=d&&i?Hal(c,o):void 0,m=Kyo(r);for(let f of m.diagnostics)o.push(f);return{id:e,marketplace:t,name:n,root:r,enabled:i,commandsDir:l,skillsDir:u,hooksConfig:m.config,agentsDirPresent:d,agentFiles:p,diagnostics:o}}function Jal(e,t,n,r){let i=ABn(e);if(!i){let s=e.source;r.push(`source kind "${typeof s=="string"?s:"object"}" is not supported; install the plugin manually as a relative directory`);return}let o=Xyo(n,t,i.subdir);if(o)return o;r.push(`source kind "${i.kind}" not fetched yet; run /plugins to clone it (or marketplace update)`)}function $al(e,t,n,r,i){if(typeof e!="string"){if(e&&typeof e=="object")return Jal(e,t,n,i);i.push("plugin entry has no source field; skipping");return}if(ebo(e)){i.push(`absolute source "${e}" is not allowed; skipping`);return}let o=e.startsWith("./")?n:r,s=rbo(o,e),a=Yal(n,s);if(a.startsWith("..")||ebo(a)){i.push(`source "${e}" resolves outside the marketplace root; skipping`);return}if(!eOe(s)){i.push(`source "${e}" does not point to an existing directory (looked at ${s})`);return}return s}function Kal(e,t){return typeof t!="string"||t.length===0?e:rbo(e,t)}function jal(e,t){if(typeof e=="string"&&e.length>0){let n=REe(e);if(n.length>0)return n}return t}function REe(e){let t="";for(let n of e){let r=n.codePointAt(0);if(r===void 0)continue;let i=r<=31,o=r>=127&&r<=159;i||o||(t+=n)}return t}function eOe(e){try{return Wal(e).isDirectory()}catch{return!1}}var Mbt=C(()=>{"use strict";Dbt();jyo();kbt()});import{readFileSync as qal}from"node:fs";import{basename as ecl}from"node:path";function Qbt(e){return typeof e=="string"?e:void 0}function ncl(e){if(typeof e=="string")return obo.includes(e)?e:void 0}function rcl(e){return typeof e=="number"&&e>=0?e:void 0}function abo(e){if(e==null)return;let t=String(e).trim();if(!t||t==="none")return;let n=t.split(",").map(r=>r.trim()).filter(Boolean);return n.length>0?n:void 0}function cbo(e,t){return e==null?[...t]:abo(e)??[]}function icl(e){return abo(e)}function ocl(e){if(e==="user"||e==="project"||e==="local")return e}function ibo(e){if(e==null||e===!0)return!0;if(e===!1||e==="none")return!1;let t=cbo(e,[]);return t.length>0?t:!1}function scl(e,t){let n=REe(ecl(e,".md")),r;try{r=qal(e,"utf-8")}catch(u){let d=u instanceof Error?u.message:String(u);return{ok:!1,diagnostic:`failed to read agent file ${e}: ${d}`}}let i,o;try{let u=fk(r);i=u.frontmatter??{},o=u.body}catch(u){let d=u instanceof Error?u.message:String(u);return{ok:!1,diagnostic:`invalid frontmatter in agent file ${e}: ${d}`}}let s=Qbt(i.thinking),a=ncl(i.thinking),c=[];s!==void 0&&a===void 0&&c.push(`agent file ${e} declares thinking: "${s}", which is not a recognised level (expected one of: ${obo.join(", ")}); falling back to the model's default`);let l={name:n,displayName:Qbt(i.display_name),description:Qbt(i.description)??n,builtinToolNames:cbo(i.tools,tcl),disallowedTools:icl(i.disallowed_tools),extensions:ibo(i.extensions??i.inherit_extensions),skills:ibo(i.skills??i.inherit_skills),model:Qbt(i.model),thinking:a,maxTurns:rcl(i.max_turns),systemPrompt:o.trim(),promptMode:i.prompt_mode==="append"?"append":"replace",inheritContext:i.inherit_context==null?void 0:i.inherit_context===!0,runInBackground:i.run_in_background==null?void 0:i.run_in_background===!0,isolated:i.isolated==null?void 0:i.isolated===!0,memory:ocl(i.memory),isolation:i.isolation==="worktree"?"worktree":void 0,enabled:i.enabled!==!1,source:"plugin",pluginId:t};return c.length>0?{ok:!0,config:l,warnings:c}:{ok:!0,config:l}}function lbo(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 o=scl(i,e.id);if(!o.ok){n.push(o.diagnostic);continue}if(o.warnings)for(let c of o.warnings)n.push(c);let{config:s}=o,a=s.name.toLowerCase();if(r.has(a)){let c=r.get(a)??s.name,l=c===s.name?`"${s.name}"`:`"${s.name}" (case-insensitive collision with "${c}")`;n.push(`duplicate agent name ${l} in plugin ${e.id}; ignoring ${i}`);continue}t.set(s.name,s),r.set(a,s.name)}return{agents:t,diagnostics:n}}var tcl,obo,sbo,ubo=C(()=>{"use strict";Sl();Mbt();tcl=["read","bash","edit","write","grep","find","ls"],obo=["off","minimal","low","medium","high","xhigh"],sbo=["general-purpose","explore","plan"]});import{lstatSync as acl,readFileSync as ccl,realpathSync as dbo}from"node:fs";import{isAbsolute as lcl,join as ucl,relative as dcl}from"node:path";function TEe(e,t){let n=e;for(let r of pcl){let i=`\${${r}}`;n.includes(i)&&(n=n.split(i).join(t))}return n}function EBn(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function pbo(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 mcl(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 fcl(e,t){let n=mcl(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`);return{type:n,name:e,disabled:t.disabled,url:t.url,headers:pbo(t.headers),auth:t.auth==="oauth"?"oauth":void 0,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)):[],o=t.useShellInterpolation??!0,s=o&&i.length>0?`${r} ${i.join(" ")}`:r;return{type:"stdio",name:e,disabled:t.disabled,command:s,args:o?[]:i,env:pbo(t.env),cwd:t.cwd,timeoutMs:t.timeoutMs,useShellInterpolation:o}}function mbo(e,t){if(!e)return;let n={};for(let[r,i]of Object.entries(e))n[r]=TEe(i,t);return n}function gcl(e,t){return e.type==="stdio"?{...e,command:TEe(e.command,t),args:e.args.map(n=>TEe(n,t)),env:mbo(e.env,t),cwd:e.cwd?TEe(e.cwd,t):void 0}:{...e,url:TEe(e.url,t),headers:mbo(e.headers,t),cwd:e.cwd?TEe(e.cwd,t):void 0}}function Acl(e,t){let n=ucl(e,".mcp.json"),r;try{r=acl(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=dbo(e),o=dbo(n),s=dcl(i,o);if(s.startsWith("..")||lcl(s)){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 ccl(n,"utf-8")}catch(i){t.push(`failed to read .mcp.json: ${i.message}`);return}}function fbo(e){let t=[],n=Acl(e.root,t);if(n===void 0)return{servers:[],diagnostics:t};let r;try{r=JSON.parse(n)}catch(s){return t.push(`failed to parse .mcp.json: ${s.message}`),{servers:[],diagnostics:t}}if(!EBn(r))return t.push(".mcp.json must be a JSON object"),{servers:[],diagnostics:t};let i=r.mcpServers;if(!EBn(i))return t.push('.mcp.json must contain an "mcpServers" object'),{servers:[],diagnostics:t};let o=[];for(let[s,a]of Object.entries(i)){let c=`${e.id}/${REe(s)}`;if(!EBn(a)){t.push(`MCP server "${c}" must be a JSON object`);continue}try{let l=fcl(c,a);o.push(gcl(l,e.root))}catch(l){t.push(l instanceof Error?l.message:String(l))}}return{servers:o,diagnostics:t}}var pcl,gbo,Abo=C(()=>{"use strict";Mbt();pcl=["CLAUDE_PLUGIN_ROOT","AUGMENT_PLUGIN_ROOT","AUGGIE_PLUGIN_ROOT"];gbo="hermes:mcp:register-server-source"});function hbo(e,t,n){let r=Cs.create(e,t,n),i={};for(let s of[r.getVfsOrgSettings(),r.getVfsSpaceSettings(),r.getVfsUserSettings(),r.getSettings()])for(let[a,c]of Object.entries(s.enabledPlugins??{}))typeof c=="boolean"&&(i[a]=c);let o=r.drainErrors().map(({scope:s,error:a})=>`failed to load ${s} settings: ${a.message}; enabledPlugins entries from this scope will be ignored`);return{enabled:i,diagnostics:o}}var Ebo=C(()=>{"use strict";Sl()});var ybo,bbo=C(()=>{"use strict";ybo="hermes:subagents:register-agent-source"});import{join as Iee,resolve as hcl}from"node:path";import{existsSync as Ecl,readdirSync as ycl,statSync as bcl}from"node:fs";function Icl(){return globalThis[Cbo]??{}}function Scl(e){globalThis[Cbo]=e}function CBn(e){Zk=[],bBn=[],Fbt=[],yBn=[],tOe=[];let t=!1,n,r=new Map,i,o,s=new Map,a;e.events.on(Wft,w=>{n=w.register}),e.events.on(ybo,w=>{i=w.register}),e.events.on(gbo,w=>{a=w.registerServerSource}),e.events.on(Ccl,w=>{Scl(w?.scopes??{})});function c(w,R,N=[]){let Q=Icl(),{enabled:F,diagnostics:D}=hbo(w,R,Q),k=[...new Set(N.map(Ae=>hcl(w,Ae)))],W=hBn(k,{}),Y={...F};for(let Ae of W.plugins)Y[Ae.id]=!0;let K=Iee(W4(),"plugins","marketplaces"),z=Iee(R,"plugins","marketplaces"),q=[Q.user,Q.space,Q.org].flatMap(Ae=>Ae?[Iee(Ae,".augment","plugins","marketplaces")]:[]),pe=hBn([...k,K,z,...q],Y);for(let Ae of pe.shadowedPlugins)nx.debug(`plugin "${Ae.id}" from ${Ae.shadowedRoot} is shadowed by the higher-precedence root ${Ae.winnerRoot}`);return pe.globalDiagnostics=[...D,...pe.globalDiagnostics],Zk=pe.plugins,bBn=pe.globalDiagnostics,t=!0,pe}function l(w,R,N=[]){t||c(w,R,N)}function u(){let w=new Map,R=new Map;Fbt=[];let N=[...Zk.filter(Q=>Q.enabled)].sort((Q,F)=>Q.id.localeCompare(F.id));for(let Q of N){let{agents:F,diagnostics:D}=lbo(Q);for(let k of D)nx.warn(`[${Q.id}] ${k}`),Fbt.push({type:"warning",message:`[${Q.id}] ${k}`,path:Q.root});for(let[k,W]of F)d(Q.id,k,W,w,R)}s=w}function d(w,R,N,Q,F){let D=R.toLowerCase(),k=F.get(D);if(k){let W=k.name===R?`"${R}"`:`"${R}" (case-insensitive collision with "${k.name}")`;nx.warn(`[${w}] plugin-contributed agent ${W} shadowed by earlier plugin ${k.pluginId}; ignoring`);return}sbo.includes(D)&&nx.warn(`[${w}] plugin-contributed agent "${R}" 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`),Q.set(R,N),F.set(D,{pluginId:w,name:R})}function p(){if(!i)return;o?.(),o=i({getAgents:()=>s,getDiagnostics:()=>Fbt})}function m(){let w=[];tOe=[];let R=[...Zk.filter(N=>N.enabled)].sort((N,Q)=>N.id.localeCompare(Q.id));for(let N of R){let{servers:Q,diagnostics:F}=fbo(N);for(let D of F)nx.warn(`[${N.id}] ${D}`),tOe.push({type:"warning",message:`[${N.id}] ${D}`,path:N.root});for(let D of Q)w.push(D)}yBn=w}function f(){if(!a)return;a({source:"plugin",getServers:()=>yBn,getDiagnostics:()=>tOe})}function g(){if(n){for(let w of r.values())w();r.clear();for(let w of Zk){if(!w.enabled)continue;let R=_cl(w);r.set(w.id,n(R))}}}function A(){for(let w of r.values())w();r.clear()}function h(){let w=[],R=[];for(let N of Zk){if(!N.enabled){for(let Q of N.diagnostics)nx.debug(`[${N.id}] ${Q}`);continue}N.commandsDir&&R.push(N.commandsDir),N.skillsDir&&w.push(N.skillsDir);for(let Q of N.diagnostics)nx.warn(`[${N.id}] ${Q}`)}return{skillPaths:w,promptPaths:R}}e.on("resources_discover",(w,R)=>{t=!1;let N=c(w.cwd,w.agentDir,R.pluginDirs),{skillPaths:Q,promptPaths:F}=h();for(let k of N.globalDiagnostics)nx.warn(k);let D=Zk.filter(k=>k.enabled).length;return Zk.length>0&&nx.info(`Discovered ${Zk.length} plugin(s); ${D} enabled`),g(),u(),p(),_(),m(),f(),v(),{skillPaths:Q,promptPaths:F}}),e.on("session_start",(w,R)=>{l(R.cwd,R.agentDir,R.pluginDirs),g(),u(),p(),I(),m(),f();let N=Iee(W4(),"plugins","marketplaces"),Q=Iee(R.agentDir,"plugins","marketplaces");$yo([N,Q]).then(F=>{F&&(t=!1,c(R.cwd,R.agentDir,R.pluginDirs),g(),u(),p(),m(),f())}).catch(F=>{nx.debug(`background plugin source fetch failed: ${F instanceof Error?F.message:String(F)}`)})}),e.on("session_shutdown",()=>{A(),o?.(),o=void 0,s=new Map});let E=!1,y=!1,b=!1;function I(){!n&&!E&&(E=!0,nx.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 _(){!i&&!y&&(y=!0,nx.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&&!b&&(b=!0,nx.debug("@hermes/mcp did not register a server source; plugin-contributed MCP servers will not be loaded."))}}function _cl(e){return{source:e.id,isEnabled:()=>e.enabled,getConfig:()=>e.hooksConfig,env:vcl(e.root),postToolUsePrefix:`Plugin ${e.id} hook`,backgroundLabel:t=>`[${e.id}] ${t} hook`,blockedFallbackReason:"Blocked by plugin hook"}}function vcl(e){return{PLUGIN_ROOT:e,CLAUDE_PLUGIN_ROOT:e}}function F6(){return Zk}function nOe(e){return Iee(e,"plugins","marketplaces")}function Obt(e){let t=nOe(e);if(!Ecl(t))return[];let n;try{n=ycl(t)}catch{return[]}let r=[];for(let i of n){let o=Iee(t,i);try{if(!bcl(o).isDirectory())continue}catch{continue}let{manifest:s}=Q6(o);if(!s)continue;let a=typeof s.name=="string"&&s.name.length>0?s.name:i;r.push({dir:i,name:a,path:o})}return r}function rO(){let e=[];for(let t of Zk)for(let n of t.diagnostics)e.push({type:"warning",message:`[${t.id}] ${n}`,path:t.root});for(let t of bBn)e.push({type:"warning",message:t});for(let t of tOe)e.push(t);return e}var nx,Ccl,Cbo,Zk,bBn,Fbt,yBn,tOe,BEe=C(()=>{"use strict";Sl();zq();sr();ubo();Mbt();Dbt();kbt();Abo();Ebo();bbo();Dbt();nx=Gt.child({prefix:"pi-plugins"}),Ccl="augment:vfs-scopes",Cbo=Symbol.for("__pi_plugins_vfs_scopes__");Zk=[],bBn=[],Fbt=[],yBn=[],tOe=[]});function IBn(){let e=globalThis;return e[Ibo]??=new Map,e[Ibo]}function Sbo(){return[...IBn().values()]}function _bo(e){return IBn().get(e)}function vbo(e){let t=IBn();t.clear();for(let n of e)t.set(n.name,n)}var Ibo,SBn=C(()=>{"use strict";Ibo=Symbol.for("__hermes_cloud_tool_registry__")});function xcl(e){return{...e,execute:(t,n,r,i,o)=>{let s=_bo(e.name);if(!s)throw new Error(`Cloud tool "${e.name}" is unavailable`);return s.execute(t,n,r,i,o)}}}function _Bn(e){for(let t of Sbo())e.registerTool(xcl(t))}var xbo=C(()=>{"use strict";SBn()});function Pbt(){let e=globalThis;return e[wbo]??=new Map,e[wbo]}function Tbo(){return[...Pbt().values()]}function Bbo(e){return Pbt().get(e)}function O6(e){Pbt().set(e.name,e)}function Nbo(e,t){let n=Pbt();(t===void 0||n.get(e)===t)&&n.delete(e)}function kbo(e){Reflect.set(e,Rbo,!0)}function Lbt(e){return Reflect.get(e,Rbo)===!0}var wbo,Rbo,See=C(()=>{"use strict";wbo=Symbol.for("__hermes_mcp_tool_registry__"),Rbo=Symbol.for("__hermes_mcp_extension_factory__")});function wcl(e){return{...e,execute:(t,n,r,i,o)=>{let s=Bbo(e.name);if(!s)throw new Error(`MCP tool "${e.name}" is unavailable`);return s.execute(t,n,r,i,o)}}}function Ubt(e){for(let t of Tbo())e.registerTool(wcl(t))}var Dbo=C(()=>{"use strict";See()});import{existsSync as Rcl}from"node:fs";import{homedir as rOe}from"node:os";import{dirname as vBn,join as rT,resolve as Qbo}from"node:path";import{fileURLToPath as Tcl}from"node:url";function Fbo(){let e=process.env.PI_PACKAGE_DIR;if(e)return e==="~"?rOe():e.startsWith("~/")?rOe()+e.slice(1):e;let t=Mbo;for(;t!==vBn(t);){if(Rcl(rT(t,"package.json")))return t;t=vBn(t)}return Mbo}function Gbt(){return Qbo(rT(Fbo(),"docs"))}function Vbt(){return Qbo(rT(Fbo(),"CHANGELOG.md"))}function Ubo(e){return`${process.env.PI_SHARE_VIEWER_URL||kcl}#${e}`}function Gbo(e){return e==="~"?rOe():e.startsWith("~/")?rOe()+e.slice(1):e}function iO(){let e=process.env.AUGMENT_CACHE_DIR;return e?Gbo(e):rT(rOe(),".augment")}function gi(){let e=process.env[xBn];return e?Gbo(e):iO()}function sOe(){return rT(gi(),"themes")}function Vbo(){return rT(gi(),"models.json")}function Wbo(){return rT(gi(),"auth.json")}function Ybo(){return rT(gi(),"settings.json")}function aOe(){return iO()}function NEe(){return rT(gi(),"bin")}function zbo(){return rT(gi(),"prompts")}function Zbo(){return rT(gi(),iOe)}function Hbo(){return rT(gi(),`${is}-debug.log`)}var Bcl,Mbo,is,Ba,iOe,oOe,Obo,Ncl,Vl,Pbo,Lbo,xBn,kcl,Wc=C(()=>{"use strict";tan();Bcl=Tcl(import.meta.url),Mbo=vBn(Bcl);is=V4.piConfig?.name||"auggie",Ba=V4.piConfig?.configDir||".augment",iOe="sessions-v2",oOe=is,Obo="Auggie Coding Agent",Ncl="1.2.0-prerelease.202609150848",Vl=Ncl??V4.version,Pbo="5ea294f3b00fda3e7edb41b8166f373c794454cd",Lbo="2026-09-15T15:48:00Z",xBn=`${is.toUpperCase()}_CODING_AGENT_DIR`,kcl="https://pi.dev/session/"});var Jbo,Xbo=C(()=>{Jbo={$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",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 Kbo,$bo=C(()=>{Kbo={$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",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 M0 from"node:fs";import*as Ybt from"node:path";function Fcl(){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 BBn(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 wBn(e){let t=Number.POSITIVE_INFINITY,n=0;for(let[r,i]of Wbt.entries()){let o=Math.abs(e-i);o<t&&(t=o,n=r)}return n}function Ocl(e){let t=Number.POSITIVE_INFINITY,n=0;for(let[r,i]of tCo.entries()){let o=Math.abs(e-i);o<t&&(t=o,n=r)}return n}function qbo(e,t,n,r,i,o){let s=e-r,a=t-i,c=n-o;return s*s*.299+a*a*.587+c*c*.114}function Pcl(e,t,n){let r=wBn(e),i=wBn(t),o=wBn(n),s=Wbt[r]??0,a=Wbt[i]??0,c=Wbt[o]??0,l=16+36*r+6*i+o,u=qbo(e,t,n,s,a,c),d=Math.round(.299*e+.587*t+.114*n),p=Ocl(d),m=tCo[p]??0,f=232+p,g=qbo(e,t,n,m,m,m),A=Math.max(e,t,n),h=Math.min(e,t,n);return A-h<10&&g<u?f:l}function nCo(e){let{r:t,g:n,b:r}=BBn(e);return Pcl(t,n,r)}function Lcl(e,t){if(e==="")return"\x1B[39m";if(typeof e=="number")return`\x1B[38;5;${e}m`;if(e.startsWith("#")){if(t==="truecolor"){let{r,g:i,b:o}=BBn(e);return`\x1B[38;2;${r};${i};${o}m`}return`\x1B[38;5;${nCo(e)}m`}throw new Error(`Invalid color value: ${e}`)}function Ucl(e,t){if(e==="")return"\x1B[49m";if(typeof e=="number")return`\x1B[48;5;${e}m`;if(e.startsWith("#")){if(t==="truecolor"){let{r,g:i,b:o}=BBn(e);return`\x1B[48;2;${r};${i};${o}m`}return`\x1B[48;5;${nCo(e)}m`}throw new Error(`Invalid color value: ${e}`)}function NBn(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 NBn(r,t,n)}function rCo(e,t={}){let n={};for(let[r,i]of Object.entries(e))n[r]=NBn(i,t);return n}function zbt(){let e=new Set(Object.keys(kBn)),t=sOe();if(M0.existsSync(t)){let n=M0.readdirSync(t);for(let r of n)r.endsWith(".json")&&e.add(r.slice(0,-5))}for(let n of wee.keys())e.add(n);return Array.from(e).sort()}function iCo(){let e=sOe(),t=[];for(let n of Object.keys(kBn))t.push({name:n,path:void 0});if(M0.existsSync(e)){for(let n of M0.readdirSync(e))if(n.endsWith(".json")){let r=n.slice(0,-5);t.some(i=>i.name===r)||t.push({name:r,path:Ybt.join(e,n)})}}for(let[n,r]of wee.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 Gcl(e,t){if(!jbo.Check(t)){let n=Array.from(jbo.Errors(t)),r=[],i=[];for(let s of n){let c=s.path.match(/^\/colors\/(\w+)$/)?.[1];c&&s.message.includes("Required")?r.push(c):i.push(` - ${s.path}: ${s.message}`)}let o=`Invalid theme "${e}":
|
|
6709
|
+
Show whether the CLI has an active Augment authentication session.`,Vsl="Note: Injected credentials remain active and may override the saved session.",Wsl="Note: Injected credentials remain active.",Ysl="AUGGIE_V2_SEGMENT_WRITE_KEY"});import{readFile as dal}from"node:fs/promises";import{resolve as pal}from"node:path";function gal(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===dBn){let o=e[r+1];if(o===void 0||o.startsWith("-")||!o.trim())return{type:"fatal"};n=o,r+=1;continue}if(i.startsWith(`${dBn}=`)){let o=i.slice(dBn.length+1);if(!o.trim())return{type:"fatal"};n=o;continue}t.push(i)}return{type:"success",args:t,candidate:n}}async function Byo(e,t=fal){let n=gal(e);if(n.type==="fatal")return{type:"fatal",message:mal};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(pal(process.cwd(),r))}catch{return{type:"fatal",message:pBn}}let o;try{o=JSON.parse(i)}catch{return{type:"fatal",message:pBn}}let s=FQe(o);return s?{type:"success",args:n.args,credentials:s}:{type:"fatal",message:pBn}}var dBn,mal,pBn,fal,Nyo=C(()=>{"use strict";zht();dBn="--augment-session-json",mal="--augment-session-json requires a value",pBn="--augment-session-json value is unusable",fal={readPath:e=>dal(e,"utf8")}});import{execFile as Aal}from"node:child_process";import{existsSync as hal,rmSync as Eal}from"node:fs";import{promisify as yal}from"node:util";function mBn(e){let t=e.match(/^git@([^:]+):(.+?)(?:\.git)?$/);if(t){let[,r,i]=t;return{sshUrl:e.endsWith(".git")?e:`${e}.git`,httpsUrl:`https://${r}/${i}.git`}}let n=e.match(/^https?:\/\/([^/]+)\/(.+?)(?:\.git)?$/);if(n){let[,r,i]=n;return{sshUrl:`git@${r}:${i}.git`,httpsUrl:e.endsWith(".git")?e:`${e}.git`}}return{sshUrl:e,httpsUrl:e}}function Qyo(e){return e instanceof Error?e.message:String(e)}async function fBn({sshUrl:e,httpsUrl:t,targetDir:n,extraArgs:r=[]}){let i;for(let o of[{url:e,env:bal},{url:t,env:Myo}])try{return await Dyo("git",["clone","--depth","1",...r,o.url,n],{env:o.env}),{success:!0}}catch(s){i=s,hal(n)&&Eal(n,{recursive:!0,force:!0})}return{success:!1,error:Qyo(i)}}function kyo(e,t){return Dyo("git",e,{cwd:t,env:Myo})}async function Fyo(e,t){try{return await kyo(["fetch","--depth","1","origin",t],e),await kyo(["checkout","FETCH_HEAD"],e),{success:!0}}catch(n){return{success:!1,error:Qyo(n)}}}var Dyo,bal,Myo,Oyo=C(()=>{"use strict";Dyo=yal(Aal),bal={...process.env,GIT_TERMINAL_PROMPT:"0",GIT_SSH_COMMAND:"ssh -o BatchMode=yes"},Myo={...process.env,GIT_TERMINAL_PROMPT:"0"}});import{existsSync as Cal,readFileSync as Ial}from"node:fs";import{join as wEe}from"node:path";function Uyo(e){for(let t of Lyo)if(Cal(wEe(e,t)))return!0;return!1}function Q6(e){let t=Sal(e,Pyo);return t.manifest||t.diagnostics.length>0?t:{diagnostics:[`no marketplace manifest found (looked for ${Pyo.join(", ")})`]}}function Sal(e,t){let n=[];for(let r of t){let i=wEe(e,r),o;try{o=Ial(i,"utf-8")}catch{continue}try{let s=JSON.parse(o);if(s&&typeof s=="object"&&!Array.isArray(s))return{manifest:s,manifestPath:i,diagnostics:n};n.push(`manifest at ${r} is not a JSON object; ignoring`)}catch(s){n.push(`failed to parse manifest at ${r}: ${s.message}`)}}return{diagnostics:n}}var Lyo,Pyo,Gyo,kbt=C(()=>{"use strict";Lyo=[wEe(".augment-plugin","plugin.json"),wEe(".claude-plugin","plugin.json")],Pyo=[wEe(".augment-plugin","marketplace.json"),wEe(".claude-plugin","marketplace.json")];Gyo=`no plugin manifest found (looked for ${Lyo.join(", ")})`});import{execFile as _al}from"node:child_process";import{existsSync as eG,mkdirSync as Wyo,readdirSync as val,renameSync as xal,rmSync as wal,statSync as Ral}from"node:fs";import{dirname as Tal,isAbsolute as Yyo,join as tG,relative as zyo,resolve as gBn}from"node:path";import{promisify as Bal}from"node:util";function Hyo(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 Vyo(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 kal(e){let t=e.match(/^([a-zA-Z0-9_-]+)\/([a-zA-Z0-9_.-]+?)(?:@(.+))?$/);if(t?.[1]&&t[2])return{owner:t[1],repo:t[2].replace(/\.git$/,""),...t[3]?{ref:t[3]}:{}};let n=e.match(/^https?:\/\/github\.com\/([a-zA-Z0-9_-]+)\/([a-zA-Z0-9_.-]+?)(\.git)?(?:#(.+))?$/);if(n?.[1]&&n[2])return{owner:n[1],repo:n[2],...n[4]?{ref:n[4]}:{}};let r=e.match(/^git@github\.com:([a-zA-Z0-9_-]+)\/([a-zA-Z0-9_.-]+?)(\.git)?(?:#(.+))?$/);return r?.[1]&&r[2]?{owner:r[1],repo:r[2],...r[4]?{ref:r[4]}:{}}:null}function nO(e){return typeof e=="string"&&e.length>0?e:void 0}function Dal(e,t){let n=nO(e.repo);return n?{kind:"github",url:`https://github.com/${n.replace(/\.git$/,"")}.git`,...t?{ref:t}:{},...nO(e.path)?{subdir:nO(e.path)}:{}}:null}function Mal(e,t){let n=nO(e.url);return n?{kind:"url",url:n,...t?{ref:t}:{},...nO(e.path)?{subdir:nO(e.path)}:{}}:null}function Qal(e,t){let n=nO(e.url),r=nO(e.path);return n&&r?{kind:"git-subdir",url:n,subdir:r,...t?{ref:t}:{}}:null}function ABn(e){if(!e||typeof e!="object")return null;let t=e,n=nO(t.sha)??nO(t.ref);switch(t.source){case"github":return Dal(t,n);case"url":return Mal(t,n);case"git-subdir":return Qal(t,n);default:return null}}function Xyo(e,t,n){let r=Hyo(t);if(!r)return;let i=tG(e,Zyo,r);if(!eG(tG(i,".git")))return;if(!n)return i;let o=gBn(i,n),s=zyo(i,o);if(!(s.startsWith("..")||Yyo(s)))return eG(o)?o:void 0}async function Fal(e,t){let n=typeof t.name=="string"?t.name:"",r=ABn(t.source);if(!r)return;let i=Hyo(n);if(!i)return{name:n,status:"failed",error:"invalid plugin cache name"};let o=tG(e,Zyo,i);if(eG(tG(o,".git")))return{name:n,status:"skipped"};let s=Tal(o);eG(s)||Wyo(s,{recursive:!0});let{sshUrl:a,httpsUrl:c}=mBn(r.url),l=r.kind==="git-subdir",u=await fBn({sshUrl:a,httpsUrl:c,targetDir:o,extraArgs:l?["--filter=blob:none","--sparse"]:[]});if(!u.success)return{name:n,status:"failed",error:u.error};if(r.ref){let d=await Fyo(o,r.ref);if(!d.success)return{name:n,status:"failed",error:d.error}}if(l&&r.kind==="git-subdir")try{await Nal("git",["sparse-checkout","set",r.subdir],{cwd:o,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 Jyo(e){let{manifest:t}=Q6(e),n=t?.plugins;if(!n||n.length===0)return[];let r=[];for(let i of n){let o=await Fal(e,i);o&&r.push(o)}return r}function Oal(e){try{return Ral(e).isDirectory()}catch{return!1}}function Pal(e,t){let n=zyo(gBn(e),gBn(t));return n!==""&&!n.startsWith("..")&&!Yyo(n)}async function KFe(e,t){let n=kal(t);if(!n)return{success:!1,error:`Invalid GitHub repository: ${t}. Expected owner/repo or a github.com URL.`};let{owner:r,repo:i,ref:o}=n;eG(e)||Wyo(e,{recursive:!0});let s=Vyo(i);if(!s)return{success:!1,error:`Invalid repository name for marketplace directory: "${i}".`};let a=tG(e,s);if(eG(a))return{success:!1,alreadyInstalled:!0,marketplaceId:s,error:`Marketplace '${s}' is already installed.`};let{sshUrl:c,httpsUrl:l}=mBn(`https://github.com/${r}/${i}`),u=await fBn({sshUrl:c,httpsUrl:l,targetDir:a,extraArgs:o?["--branch",o]:[]});if(!u.success)return{success:!1,error:`Failed to clone '${r}/${i}' (SSH and HTTPS both failed): ${u.error}`};let{manifest:d}=Q6(a),p=s,m=typeof d?.name=="string"?Vyo(d.name):null;if(m&&m!==s){let f=tG(e,m);if(!eG(f))try{xal(a,f),p=m}catch{}}return await Jyo(tG(e,p)),{success:!0,marketplaceId:p}}function jFe(e,t){let n=tG(e,t);if(!Pal(e,n))return{success:!1,error:`Refusing to remove '${t}': path is outside the marketplaces directory.`};if(!eG(n))return{success:!1,error:`Marketplace '${t}' not found.`};try{return wal(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 $yo(e){let t=!1;for(let n of e){if(!eG(n))continue;let r;try{r=val(n)}catch{continue}for(let i of r){let o=tG(n,i);if(!Oal(o))continue;(await Jyo(o)).some(a=>a.status==="cloned")&&(t=!0)}}return t}var Nal,Zyo,Dbt=C(()=>{"use strict";Oyo();kbt();Nal=Bal(_al),Zyo=".plugin-cache"});import{readFileSync as Lal}from"node:fs";import{join as Ual}from"node:path";function Kyo(e){let t=Ual(e,"hooks","hooks.json"),n;try{n=Lal(t,"utf-8")}catch{return{diagnostics:[]}}let r;try{r=JSON.parse(n)}catch(o){return{diagnostics:[`failed to parse hooks/hooks.json: ${o.message}`]}}return!r||typeof r!="object"||Array.isArray(r)?{diagnostics:["hooks/hooks.json must be a JSON object"]}:{config:JDe(r),diagnostics:[]}}var jyo=C(()=>{"use strict";zq()});import{existsSync as Gal,lstatSync as Val,readdirSync as nbo,statSync as Wal}from"node:fs";import{basename as qyo,isAbsolute as ebo,join as qFe,relative as Yal,resolve as rbo}from"node:path";function hBn(e,t){let n=[],r=[],i=[],o=new Map;for(let s of e)for(let a of zal(s,t,r)){let c=o.get(a.id);if(c!==void 0){i.push({id:a.id,shadowedRoot:s,winnerRoot:c});continue}o.set(a.id,s),n.push(a)}for(let[s,a]of Object.entries(t))a&&!o.has(s)&&r.push(`enabledPlugins["${s}"] = true but no plugin with that id was found in any marketplace root`);return{plugins:n,globalDiagnostics:r,shadowedPlugins:i}}function zal(e,t,n){let r=[];if(!Gal(e))return r;let i=Q6(e);if(!i.manifest)for(let s of i.diagnostics)s.startsWith("no marketplace manifest found")||n.push(`[${qyo(e)}] ${s}`);if(i.manifest)return tbo(e,qyo(e),t,r,n),r;let o;try{o=nbo(e)}catch(s){return n.push(`failed to read marketplaces directory ${e}: ${s.message}`),r}for(let s of o){let a=qFe(e,s);eOe(a)&&tbo(a,s,t,r,n)}return r}function tbo(e,t,n,r,i){let o=Q6(e);if(!o.manifest){for(let l of o.diagnostics)i.push(`[${t}] ${l}`);return}let s=jal(o.manifest.name,t),a=Kal(e,o.manifest.metadata?.pluginRoot),c=Array.isArray(o.manifest.plugins)?o.manifest.plugins:[];c.length===0&&i.push(`[${s}] marketplace.json has no plugins[] entries`);for(let l of c){let u=Zal(l,e,a,s,n);u&&r.push(u)}for(let l of o.diagnostics)i.push(`[${s}] ${l}`)}function Zal(e,t,n,r,i){let o=typeof e.name=="string"?REe(e.name):void 0;if(!o)return;let s=`${o}@${r}`,a=i[s]===!0,c=[],l=$al(e.source,o,t,n,c);return l?Xal(s,r,o,l,a,c):{id:s,marketplace:r,name:o,root:t,enabled:a,commandsDir:void 0,skillsDir:void 0,hooksConfig:void 0,agentsDirPresent:!1,diagnostics:c}}function Hal(e,t){let n=[],r;try{r=nbo(e).sort()}catch(o){return t.push(`failed to read agents directory: ${o.message}`),n}let i=[];for(let o of r){if(!o.endsWith(".md"))continue;let s=qFe(e,o);try{if(!Val(s).isFile()){i.push(o);continue}}catch(a){t.push(`failed to stat agent file ${o}: ${a.message}`);continue}n.push(s)}return i.length>0&&t.push(`ignoring non-regular agent file(s) under agents/ (symlinks / dirs / devices are not followed): ${i.join(", ")}`),n}function Xal(e,t,n,r,i,o){Uyo(r)||o.push(Gyo);let s=qFe(r,"commands"),a=qFe(r,"skills"),c=qFe(r,"agents"),l=eOe(s)?s:void 0,u=eOe(a)?a:void 0,d=eOe(c),p=d&&i?Hal(c,o):void 0,m=Kyo(r);for(let f of m.diagnostics)o.push(f);return{id:e,marketplace:t,name:n,root:r,enabled:i,commandsDir:l,skillsDir:u,hooksConfig:m.config,agentsDirPresent:d,agentFiles:p,diagnostics:o}}function Jal(e,t,n,r){let i=ABn(e);if(!i){let s=e.source;r.push(`source kind "${typeof s=="string"?s:"object"}" is not supported; install the plugin manually as a relative directory`);return}let o=Xyo(n,t,i.subdir);if(o)return o;r.push(`source kind "${i.kind}" not fetched yet; run /plugins to clone it (or marketplace update)`)}function $al(e,t,n,r,i){if(typeof e!="string"){if(e&&typeof e=="object")return Jal(e,t,n,i);i.push("plugin entry has no source field; skipping");return}if(ebo(e)){i.push(`absolute source "${e}" is not allowed; skipping`);return}let o=e.startsWith("./")?n:r,s=rbo(o,e),a=Yal(n,s);if(a.startsWith("..")||ebo(a)){i.push(`source "${e}" resolves outside the marketplace root; skipping`);return}if(!eOe(s)){i.push(`source "${e}" does not point to an existing directory (looked at ${s})`);return}return s}function Kal(e,t){return typeof t!="string"||t.length===0?e:rbo(e,t)}function jal(e,t){if(typeof e=="string"&&e.length>0){let n=REe(e);if(n.length>0)return n}return t}function REe(e){let t="";for(let n of e){let r=n.codePointAt(0);if(r===void 0)continue;let i=r<=31,o=r>=127&&r<=159;i||o||(t+=n)}return t}function eOe(e){try{return Wal(e).isDirectory()}catch{return!1}}var Mbt=C(()=>{"use strict";Dbt();jyo();kbt()});import{readFileSync as qal}from"node:fs";import{basename as ecl}from"node:path";function Qbt(e){return typeof e=="string"?e:void 0}function ncl(e){if(typeof e=="string")return obo.includes(e)?e:void 0}function rcl(e){return typeof e=="number"&&e>=0?e:void 0}function abo(e){if(e==null)return;let t=String(e).trim();if(!t||t==="none")return;let n=t.split(",").map(r=>r.trim()).filter(Boolean);return n.length>0?n:void 0}function cbo(e,t){return e==null?[...t]:abo(e)??[]}function icl(e){return abo(e)}function ocl(e){if(e==="user"||e==="project"||e==="local")return e}function ibo(e){if(e==null||e===!0)return!0;if(e===!1||e==="none")return!1;let t=cbo(e,[]);return t.length>0?t:!1}function scl(e,t){let n=REe(ecl(e,".md")),r;try{r=qal(e,"utf-8")}catch(u){let d=u instanceof Error?u.message:String(u);return{ok:!1,diagnostic:`failed to read agent file ${e}: ${d}`}}let i,o;try{let u=fk(r);i=u.frontmatter??{},o=u.body}catch(u){let d=u instanceof Error?u.message:String(u);return{ok:!1,diagnostic:`invalid frontmatter in agent file ${e}: ${d}`}}let s=Qbt(i.thinking),a=ncl(i.thinking),c=[];s!==void 0&&a===void 0&&c.push(`agent file ${e} declares thinking: "${s}", which is not a recognised level (expected one of: ${obo.join(", ")}); falling back to the model's default`);let l={name:n,displayName:Qbt(i.display_name),description:Qbt(i.description)??n,builtinToolNames:cbo(i.tools,tcl),disallowedTools:icl(i.disallowed_tools),extensions:ibo(i.extensions??i.inherit_extensions),skills:ibo(i.skills??i.inherit_skills),model:Qbt(i.model),thinking:a,maxTurns:rcl(i.max_turns),systemPrompt:o.trim(),promptMode:i.prompt_mode==="append"?"append":"replace",inheritContext:i.inherit_context==null?void 0:i.inherit_context===!0,runInBackground:i.run_in_background==null?void 0:i.run_in_background===!0,isolated:i.isolated==null?void 0:i.isolated===!0,memory:ocl(i.memory),isolation:i.isolation==="worktree"?"worktree":void 0,enabled:i.enabled!==!1,source:"plugin",pluginId:t};return c.length>0?{ok:!0,config:l,warnings:c}:{ok:!0,config:l}}function lbo(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 o=scl(i,e.id);if(!o.ok){n.push(o.diagnostic);continue}if(o.warnings)for(let c of o.warnings)n.push(c);let{config:s}=o,a=s.name.toLowerCase();if(r.has(a)){let c=r.get(a)??s.name,l=c===s.name?`"${s.name}"`:`"${s.name}" (case-insensitive collision with "${c}")`;n.push(`duplicate agent name ${l} in plugin ${e.id}; ignoring ${i}`);continue}t.set(s.name,s),r.set(a,s.name)}return{agents:t,diagnostics:n}}var tcl,obo,sbo,ubo=C(()=>{"use strict";Sl();Mbt();tcl=["read","bash","edit","write","grep","find","ls"],obo=["off","minimal","low","medium","high","xhigh"],sbo=["general-purpose","explore","plan"]});import{lstatSync as acl,readFileSync as ccl,realpathSync as dbo}from"node:fs";import{isAbsolute as lcl,join as ucl,relative as dcl}from"node:path";function TEe(e,t){let n=e;for(let r of pcl){let i=`\${${r}}`;n.includes(i)&&(n=n.split(i).join(t))}return n}function EBn(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function pbo(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 mcl(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 fcl(e,t){let n=mcl(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`);return{type:n,name:e,disabled:t.disabled,url:t.url,headers:pbo(t.headers),auth:t.auth==="oauth"?"oauth":void 0,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)):[],o=t.useShellInterpolation??!0,s=o&&i.length>0?`${r} ${i.join(" ")}`:r;return{type:"stdio",name:e,disabled:t.disabled,command:s,args:o?[]:i,env:pbo(t.env),cwd:t.cwd,timeoutMs:t.timeoutMs,useShellInterpolation:o}}function mbo(e,t){if(!e)return;let n={};for(let[r,i]of Object.entries(e))n[r]=TEe(i,t);return n}function gcl(e,t){return e.type==="stdio"?{...e,command:TEe(e.command,t),args:e.args.map(n=>TEe(n,t)),env:mbo(e.env,t),cwd:e.cwd?TEe(e.cwd,t):void 0}:{...e,url:TEe(e.url,t),headers:mbo(e.headers,t),cwd:e.cwd?TEe(e.cwd,t):void 0}}function Acl(e,t){let n=ucl(e,".mcp.json"),r;try{r=acl(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=dbo(e),o=dbo(n),s=dcl(i,o);if(s.startsWith("..")||lcl(s)){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 ccl(n,"utf-8")}catch(i){t.push(`failed to read .mcp.json: ${i.message}`);return}}function fbo(e){let t=[],n=Acl(e.root,t);if(n===void 0)return{servers:[],diagnostics:t};let r;try{r=JSON.parse(n)}catch(s){return t.push(`failed to parse .mcp.json: ${s.message}`),{servers:[],diagnostics:t}}if(!EBn(r))return t.push(".mcp.json must be a JSON object"),{servers:[],diagnostics:t};let i=r.mcpServers;if(!EBn(i))return t.push('.mcp.json must contain an "mcpServers" object'),{servers:[],diagnostics:t};let o=[];for(let[s,a]of Object.entries(i)){let c=`${e.id}/${REe(s)}`;if(!EBn(a)){t.push(`MCP server "${c}" must be a JSON object`);continue}try{let l=fcl(c,a);o.push(gcl(l,e.root))}catch(l){t.push(l instanceof Error?l.message:String(l))}}return{servers:o,diagnostics:t}}var pcl,gbo,Abo=C(()=>{"use strict";Mbt();pcl=["CLAUDE_PLUGIN_ROOT","AUGMENT_PLUGIN_ROOT","AUGGIE_PLUGIN_ROOT"];gbo="hermes:mcp:register-server-source"});function hbo(e,t,n){let r=Cs.create(e,t,n),i={};for(let s of[r.getVfsOrgSettings(),r.getVfsSpaceSettings(),r.getVfsUserSettings(),r.getSettings()])for(let[a,c]of Object.entries(s.enabledPlugins??{}))typeof c=="boolean"&&(i[a]=c);let o=r.drainErrors().map(({scope:s,error:a})=>`failed to load ${s} settings: ${a.message}; enabledPlugins entries from this scope will be ignored`);return{enabled:i,diagnostics:o}}var Ebo=C(()=>{"use strict";Sl()});var ybo,bbo=C(()=>{"use strict";ybo="hermes:subagents:register-agent-source"});import{join as Iee,resolve as hcl}from"node:path";import{existsSync as Ecl,readdirSync as ycl,statSync as bcl}from"node:fs";function Icl(){return globalThis[Cbo]??{}}function Scl(e){globalThis[Cbo]=e}function CBn(e){Zk=[],bBn=[],Fbt=[],yBn=[],tOe=[];let t=!1,n,r=new Map,i,o,s=new Map,a;e.events.on(Wft,w=>{n=w.register}),e.events.on(ybo,w=>{i=w.register}),e.events.on(gbo,w=>{a=w.registerServerSource}),e.events.on(Ccl,w=>{Scl(w?.scopes??{})});function c(w,R,N=[]){let Q=Icl(),{enabled:F,diagnostics:D}=hbo(w,R,Q),k=[...new Set(N.map(Ae=>hcl(w,Ae)))],W=hBn(k,{}),Y={...F};for(let Ae of W.plugins)Y[Ae.id]=!0;let K=Iee(W4(),"plugins","marketplaces"),z=Iee(R,"plugins","marketplaces"),q=[Q.user,Q.space,Q.org].flatMap(Ae=>Ae?[Iee(Ae,".augment","plugins","marketplaces")]:[]),pe=hBn([...k,K,z,...q],Y);for(let Ae of pe.shadowedPlugins)nx.debug(`plugin "${Ae.id}" from ${Ae.shadowedRoot} is shadowed by the higher-precedence root ${Ae.winnerRoot}`);return pe.globalDiagnostics=[...D,...pe.globalDiagnostics],Zk=pe.plugins,bBn=pe.globalDiagnostics,t=!0,pe}function l(w,R,N=[]){t||c(w,R,N)}function u(){let w=new Map,R=new Map;Fbt=[];let N=[...Zk.filter(Q=>Q.enabled)].sort((Q,F)=>Q.id.localeCompare(F.id));for(let Q of N){let{agents:F,diagnostics:D}=lbo(Q);for(let k of D)nx.warn(`[${Q.id}] ${k}`),Fbt.push({type:"warning",message:`[${Q.id}] ${k}`,path:Q.root});for(let[k,W]of F)d(Q.id,k,W,w,R)}s=w}function d(w,R,N,Q,F){let D=R.toLowerCase(),k=F.get(D);if(k){let W=k.name===R?`"${R}"`:`"${R}" (case-insensitive collision with "${k.name}")`;nx.warn(`[${w}] plugin-contributed agent ${W} shadowed by earlier plugin ${k.pluginId}; ignoring`);return}sbo.includes(D)&&nx.warn(`[${w}] plugin-contributed agent "${R}" 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`),Q.set(R,N),F.set(D,{pluginId:w,name:R})}function p(){if(!i)return;o?.(),o=i({getAgents:()=>s,getDiagnostics:()=>Fbt})}function m(){let w=[];tOe=[];let R=[...Zk.filter(N=>N.enabled)].sort((N,Q)=>N.id.localeCompare(Q.id));for(let N of R){let{servers:Q,diagnostics:F}=fbo(N);for(let D of F)nx.warn(`[${N.id}] ${D}`),tOe.push({type:"warning",message:`[${N.id}] ${D}`,path:N.root});for(let D of Q)w.push(D)}yBn=w}function f(){if(!a)return;a({source:"plugin",getServers:()=>yBn,getDiagnostics:()=>tOe})}function g(){if(n){for(let w of r.values())w();r.clear();for(let w of Zk){if(!w.enabled)continue;let R=_cl(w);r.set(w.id,n(R))}}}function A(){for(let w of r.values())w();r.clear()}function h(){let w=[],R=[];for(let N of Zk){if(!N.enabled){for(let Q of N.diagnostics)nx.debug(`[${N.id}] ${Q}`);continue}N.commandsDir&&R.push(N.commandsDir),N.skillsDir&&w.push(N.skillsDir);for(let Q of N.diagnostics)nx.warn(`[${N.id}] ${Q}`)}return{skillPaths:w,promptPaths:R}}e.on("resources_discover",(w,R)=>{t=!1;let N=c(w.cwd,w.agentDir,R.pluginDirs),{skillPaths:Q,promptPaths:F}=h();for(let k of N.globalDiagnostics)nx.warn(k);let D=Zk.filter(k=>k.enabled).length;return Zk.length>0&&nx.info(`Discovered ${Zk.length} plugin(s); ${D} enabled`),g(),u(),p(),_(),m(),f(),v(),{skillPaths:Q,promptPaths:F}}),e.on("session_start",(w,R)=>{l(R.cwd,R.agentDir,R.pluginDirs),g(),u(),p(),I(),m(),f();let N=Iee(W4(),"plugins","marketplaces"),Q=Iee(R.agentDir,"plugins","marketplaces");$yo([N,Q]).then(F=>{F&&(t=!1,c(R.cwd,R.agentDir,R.pluginDirs),g(),u(),p(),m(),f())}).catch(F=>{nx.debug(`background plugin source fetch failed: ${F instanceof Error?F.message:String(F)}`)})}),e.on("session_shutdown",()=>{A(),o?.(),o=void 0,s=new Map});let E=!1,y=!1,b=!1;function I(){!n&&!E&&(E=!0,nx.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 _(){!i&&!y&&(y=!0,nx.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&&!b&&(b=!0,nx.debug("@hermes/mcp did not register a server source; plugin-contributed MCP servers will not be loaded."))}}function _cl(e){return{source:e.id,isEnabled:()=>e.enabled,getConfig:()=>e.hooksConfig,env:vcl(e.root),postToolUsePrefix:`Plugin ${e.id} hook`,backgroundLabel:t=>`[${e.id}] ${t} hook`,blockedFallbackReason:"Blocked by plugin hook"}}function vcl(e){return{PLUGIN_ROOT:e,CLAUDE_PLUGIN_ROOT:e}}function F6(){return Zk}function nOe(e){return Iee(e,"plugins","marketplaces")}function Obt(e){let t=nOe(e);if(!Ecl(t))return[];let n;try{n=ycl(t)}catch{return[]}let r=[];for(let i of n){let o=Iee(t,i);try{if(!bcl(o).isDirectory())continue}catch{continue}let{manifest:s}=Q6(o);if(!s)continue;let a=typeof s.name=="string"&&s.name.length>0?s.name:i;r.push({dir:i,name:a,path:o})}return r}function rO(){let e=[];for(let t of Zk)for(let n of t.diagnostics)e.push({type:"warning",message:`[${t.id}] ${n}`,path:t.root});for(let t of bBn)e.push({type:"warning",message:t});for(let t of tOe)e.push(t);return e}var nx,Ccl,Cbo,Zk,bBn,Fbt,yBn,tOe,BEe=C(()=>{"use strict";Sl();zq();sr();ubo();Mbt();Dbt();kbt();Abo();Ebo();bbo();Dbt();nx=Gt.child({prefix:"pi-plugins"}),Ccl="augment:vfs-scopes",Cbo=Symbol.for("__pi_plugins_vfs_scopes__");Zk=[],bBn=[],Fbt=[],yBn=[],tOe=[]});function IBn(){let e=globalThis;return e[Ibo]??=new Map,e[Ibo]}function Sbo(){return[...IBn().values()]}function _bo(e){return IBn().get(e)}function vbo(e){let t=IBn();t.clear();for(let n of e)t.set(n.name,n)}var Ibo,SBn=C(()=>{"use strict";Ibo=Symbol.for("__hermes_cloud_tool_registry__")});function xcl(e){return{...e,execute:(t,n,r,i,o)=>{let s=_bo(e.name);if(!s)throw new Error(`Cloud tool "${e.name}" is unavailable`);return s.execute(t,n,r,i,o)}}}function _Bn(e){for(let t of Sbo())e.registerTool(xcl(t))}var xbo=C(()=>{"use strict";SBn()});function Pbt(){let e=globalThis;return e[wbo]??=new Map,e[wbo]}function Tbo(){return[...Pbt().values()]}function Bbo(e){return Pbt().get(e)}function O6(e){Pbt().set(e.name,e)}function Nbo(e,t){let n=Pbt();(t===void 0||n.get(e)===t)&&n.delete(e)}function kbo(e){Reflect.set(e,Rbo,!0)}function Lbt(e){return Reflect.get(e,Rbo)===!0}var wbo,Rbo,See=C(()=>{"use strict";wbo=Symbol.for("__hermes_mcp_tool_registry__"),Rbo=Symbol.for("__hermes_mcp_extension_factory__")});function wcl(e){return{...e,execute:(t,n,r,i,o)=>{let s=Bbo(e.name);if(!s)throw new Error(`MCP tool "${e.name}" is unavailable`);return s.execute(t,n,r,i,o)}}}function Ubt(e){for(let t of Tbo())e.registerTool(wcl(t))}var Dbo=C(()=>{"use strict";See()});import{existsSync as Rcl}from"node:fs";import{homedir as rOe}from"node:os";import{dirname as vBn,join as rT,resolve as Qbo}from"node:path";import{fileURLToPath as Tcl}from"node:url";function Fbo(){let e=process.env.PI_PACKAGE_DIR;if(e)return e==="~"?rOe():e.startsWith("~/")?rOe()+e.slice(1):e;let t=Mbo;for(;t!==vBn(t);){if(Rcl(rT(t,"package.json")))return t;t=vBn(t)}return Mbo}function Gbt(){return Qbo(rT(Fbo(),"docs"))}function Vbt(){return Qbo(rT(Fbo(),"CHANGELOG.md"))}function Ubo(e){return`${process.env.PI_SHARE_VIEWER_URL||kcl}#${e}`}function Gbo(e){return e==="~"?rOe():e.startsWith("~/")?rOe()+e.slice(1):e}function iO(){let e=process.env.AUGMENT_CACHE_DIR;return e?Gbo(e):rT(rOe(),".augment")}function gi(){let e=process.env[xBn];return e?Gbo(e):iO()}function sOe(){return rT(gi(),"themes")}function Vbo(){return rT(gi(),"models.json")}function Wbo(){return rT(gi(),"auth.json")}function Ybo(){return rT(gi(),"settings.json")}function aOe(){return iO()}function NEe(){return rT(gi(),"bin")}function zbo(){return rT(gi(),"prompts")}function Zbo(){return rT(gi(),iOe)}function Hbo(){return rT(gi(),`${is}-debug.log`)}var Bcl,Mbo,is,Ba,iOe,oOe,Obo,Ncl,Vl,Pbo,Lbo,xBn,kcl,Wc=C(()=>{"use strict";tan();Bcl=Tcl(import.meta.url),Mbo=vBn(Bcl);is=V4.piConfig?.name||"auggie",Ba=V4.piConfig?.configDir||".augment",iOe="sessions-v2",oOe=is,Obo="Auggie Coding Agent",Ncl="1.2.0-prerelease.202609150857",Vl=Ncl??V4.version,Pbo="5ea294f3b00fda3e7edb41b8166f373c794454cd",Lbo="2026-09-15T15:57:20Z",xBn=`${is.toUpperCase()}_CODING_AGENT_DIR`,kcl="https://pi.dev/session/"});var Jbo,Xbo=C(()=>{Jbo={$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",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 Kbo,$bo=C(()=>{Kbo={$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",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 M0 from"node:fs";import*as Ybt from"node:path";function Fcl(){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 BBn(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 wBn(e){let t=Number.POSITIVE_INFINITY,n=0;for(let[r,i]of Wbt.entries()){let o=Math.abs(e-i);o<t&&(t=o,n=r)}return n}function Ocl(e){let t=Number.POSITIVE_INFINITY,n=0;for(let[r,i]of tCo.entries()){let o=Math.abs(e-i);o<t&&(t=o,n=r)}return n}function qbo(e,t,n,r,i,o){let s=e-r,a=t-i,c=n-o;return s*s*.299+a*a*.587+c*c*.114}function Pcl(e,t,n){let r=wBn(e),i=wBn(t),o=wBn(n),s=Wbt[r]??0,a=Wbt[i]??0,c=Wbt[o]??0,l=16+36*r+6*i+o,u=qbo(e,t,n,s,a,c),d=Math.round(.299*e+.587*t+.114*n),p=Ocl(d),m=tCo[p]??0,f=232+p,g=qbo(e,t,n,m,m,m),A=Math.max(e,t,n),h=Math.min(e,t,n);return A-h<10&&g<u?f:l}function nCo(e){let{r:t,g:n,b:r}=BBn(e);return Pcl(t,n,r)}function Lcl(e,t){if(e==="")return"\x1B[39m";if(typeof e=="number")return`\x1B[38;5;${e}m`;if(e.startsWith("#")){if(t==="truecolor"){let{r,g:i,b:o}=BBn(e);return`\x1B[38;2;${r};${i};${o}m`}return`\x1B[38;5;${nCo(e)}m`}throw new Error(`Invalid color value: ${e}`)}function Ucl(e,t){if(e==="")return"\x1B[49m";if(typeof e=="number")return`\x1B[48;5;${e}m`;if(e.startsWith("#")){if(t==="truecolor"){let{r,g:i,b:o}=BBn(e);return`\x1B[48;2;${r};${i};${o}m`}return`\x1B[48;5;${nCo(e)}m`}throw new Error(`Invalid color value: ${e}`)}function NBn(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 NBn(r,t,n)}function rCo(e,t={}){let n={};for(let[r,i]of Object.entries(e))n[r]=NBn(i,t);return n}function zbt(){let e=new Set(Object.keys(kBn)),t=sOe();if(M0.existsSync(t)){let n=M0.readdirSync(t);for(let r of n)r.endsWith(".json")&&e.add(r.slice(0,-5))}for(let n of wee.keys())e.add(n);return Array.from(e).sort()}function iCo(){let e=sOe(),t=[];for(let n of Object.keys(kBn))t.push({name:n,path:void 0});if(M0.existsSync(e)){for(let n of M0.readdirSync(e))if(n.endsWith(".json")){let r=n.slice(0,-5);t.some(i=>i.name===r)||t.push({name:r,path:Ybt.join(e,n)})}}for(let[n,r]of wee.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 Gcl(e,t){if(!jbo.Check(t)){let n=Array.from(jbo.Errors(t)),r=[],i=[];for(let s of n){let c=s.path.match(/^\/colors\/(\w+)$/)?.[1];c&&s.message.includes("Required")?r.push(c):i.push(` - ${s.path}: ${s.message}`)}let o=`Invalid theme "${e}":
|
|
6710
6710
|
`;throw r.length>0&&(o+=`
|
|
6711
6711
|
Missing required color tokens:
|
|
6712
6712
|
`,o+=r.map(s=>` - ${s}`).join(`
|
package/package.json
CHANGED