@augmentcode/auggie 1.2.0-prerelease.202609150921 → 1.2.0-prerelease.202609150952

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.
Files changed (2) hide show
  1. package/auggie-v2.mjs +2 -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,dPa=1,pPa="app.tools.expand",mPa=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 EPa}from"node:crypto";function yPa(){return globalThis[$gi]}function bPa(e){globalThis[$gi]=e}function CPa(e){if(!e||typeof e!="object")return!1;let t=e;return typeof t.apiKey=="string"&&typeof t.apiUrl=="string"}function IPa(){let e=globalThis,t=e[Jgi];if(t)return t;let n={};return e[Jgi]=n,n}function SPa(e){return!e||typeof e!="object"?!1:typeof e.chatFeedback=="function"}function _Pa(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 vPa(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 EPa()}function xPa(e){if(e==="Positive")return RV.POSITIVE;if(e==="Negative")return RV.NEGATIVE}function wPa(e){return e===RV.POSITIVE?"Great! Any additional comments? (optional)":"Sorry to hear that. What went wrong? (optional)"}async function RPa(e,t,n,r,i){try{await t.chatFeedback({requestId:vPa(e,n),rating:r,note:_Pa(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 TPa(e,t){let n=IPa();t.api=n.api,e.events.on("augment:api",r=>{SPa(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=xPa(s);if(a===void 0){i.ui.notify("Feedback cancelled","info");return}let c=await i.ui.editor(wPa(a),"");if(c===void 0){i.ui.notify("Feedback cancelled","info");return}await RPa(i,o,t,a,c)}})}function qsn(e){e.events.on("augment:credentials",t=>{CPa(t)&&bPa(t)}),TPa(e,{}),e.registerTool(Hgi({operations:{runRemoteTool:(...t)=>{let n=yPa();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 Jgi,$gi,Kgi=C(()=>{"use strict";uo();Xgi();Jgi=Symbol.for("__hermes_augment_legacy_tools_feedback_state__"),$gi=Symbol.for("__hermes_augment_legacy_tools_credentials__")});function qgi(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"){jgi.warn("augment:credentials payload missing apiKey/apiUrl/userAgent or has invalid cliVersion");return}t.credentials=r,jgi.debug("Received Augment credentials via augment:credentials event"),t.credsResolve?.()})}async function eAi(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 jgi,ean=C(()=>{"use strict";sr();jgi=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 NPa}from"node:fs";import{homedir as TBe}from"node:os";import{dirname as nan,join as tR,resolve as nAi}from"node:path";import{fileURLToPath as kPa}from"node:url";function rAi(){let e=process.env.PI_PACKAGE_DIR;if(e)return e==="~"?TBe():e.startsWith("~/")?TBe()+e.slice(1):e;let t=tAi;for(;t!==nan(t);){if(NPa(tR(t,"package.json")))return t;t=nan(t)}return tAi}function jit(){return nAi(tR(rAi(),"docs"))}function qit(){return nAi(tR(rAi(),"CHANGELOG.md"))}function aAi(e){return`${process.env.PI_SHARE_VIEWER_URL||QPa}#${e}`}function cAi(e){return e==="~"?TBe():e.startsWith("~/")?TBe()+e.slice(1):e}function IQ(){let e=process.env.AUGMENT_CACHE_DIR;return e?cAi(e):tR(TBe(),".augment")}function mo(){let e=process.env[ran];return e?cAi(e):IQ()}function kBe(){return tR(mo(),"themes")}function lAi(){return tR(mo(),"models.json")}function uAi(){return tR(mo(),"auth.json")}function dAi(){return tR(mo(),"settings.json")}function W4(){return IQ()}function Fme(){return tR(mo(),"bin")}function pAi(){return tR(mo(),"prompts")}function mAi(){return tR(mo(),BBe)}function fAi(){return tR(mo(),`${es}-debug.log`)}var DPa,tAi,es,xa,BBe,NBe,iAi,MPa,ll,oAi,sAi,ran,QPa,Mc=C(()=>{"use strict";tan();DPa=kPa(import.meta.url),tAi=nan(DPa);es=V4.piConfig?.name||"auggie",xa=V4.piConfig?.configDir||".augment",BBe="sessions-v2",NBe=es,iAi="Auggie Coding Agent",MPa="1.2.0-prerelease.202609150921",ll=MPa??V4.version,oAi="ceaa09881f62be5e6aa44c80621f72a663c7e37f",sAi="2026-09-15T16:21:28Z",ran=`${es.toUpperCase()}_CODING_AGENT_DIR`,QPa="https://pi.dev/session/"});function ian(...e){return new globalThis.Function(...e)}var gAi=C(()=>{});var eot,tot,oan,AAi=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(()=>{gAi();yIe();AAi()});function hAi(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 FPa(e){EAi=e}function san(){return EAi}var EAi,aan=C(()=>{ao();can();EAi=hAi});function OPa(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"?OPa(e,t):e}var lan,yAi=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(()=>{yAi()});function*GPa(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 VPa(e){Qb(gv.Array);for(let t of e)Lme(t)}function WPa(e){Qb(gv.Boolean),Qb(e?1:0)}function YPa(e){Qb(gv.BigInt),CAi.setBigInt64(0,e);for(let t of IAi)Qb(t)}function zPa(e){Qb(gv.Date),Lme(e.getTime())}function ZPa(e){Qb(gv.Null)}function HPa(e){Qb(gv.Number),CAi.setFloat64(0,e);for(let t of IAi)Qb(t)}function XPa(e){Qb(gv.Object);for(let t of globalThis.Object.getOwnPropertyNames(e).sort())Lme(t),Lme(e[t])}function JPa(e){Qb(gv.String);for(let t=0;t<e.length;t++)for(let n of GPa(e.charCodeAt(t)))Qb(n)}function $Pa(e){Qb(gv.Symbol),Lme(e.description)}function KPa(e){Qb(gv.Uint8Array);for(let t=0;t<e.length;t++)Qb(e[t])}function jPa(e){return Qb(gv.Undefined)}function Lme(e){if(qo(e))return VPa(e);if(dB(e))return WPa(e);if(Sh(e))return YPa(e);if(rb(e))return zPa(e);if(Y2(e))return ZPa(e);if(Qo(e))return HPa(e);if(ea(e))return XPa(e);if(Tc(e))return JPa(e);if(Z2(e))return $Pa(e);if(RH(e))return KPa(e);if(rp(e))return jPa(e);throw new not(e)}function Qb(e){Pme=Pme^UPa[e],Pme=Pme*PPa%LPa}function IU(e){return Pme=BigInt("14695981039346656037"),Lme(e),Pme}var not,gv,Pme,PPa,LPa,UPa,bAi,CAi,IAi,SAi=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"),[PPa,LPa]=[BigInt("1099511628211"),BigInt("18446744073709551616")],UPa=Array.from({length:256}).map((e,t)=>BigInt(t)),bAi=new Float64Array(1),CAi=new DataView(bAi.buffer),IAi=new Uint8Array(bAi.buffer)});var Ume=C(()=>{SAi()});function qPa(e){return e[$n]==="Any"||e[$n]==="Unknown"}function Qc(e){return e!==void 0}function eLa(e,t,n){return!0}function tLa(e,t,n){return!0}function nLa(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 rLa(e,t,n){return gIe(n)}function iLa(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 oLa(e,t,n){return dB(n)}function sLa(e,t,n){return eE(e.returns,t,n.prototype)}function aLa(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 cLa(e,t,n){return z2(n)}function lLa(e,t,n){let r=globalThis.Object.values(e.$defs),i=e.$defs[e.$ref];return eE(i,[...t,...r],n)}function uLa(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 dLa(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 pLa(e,t,n){return AIe(n)}function mLa(e,t,n){return n===e.const}function fLa(e,t,n){return!1}function gLa(e,t,n){return!eE(e.not,t,n)}function ALa(e,t,n){return Y2(n)}function hLa(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 ELa(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)||qPa(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 yLa(e,t,n){return hIe(n)}function bLa(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 CLa(e,t,n){return eE(bl(e,t),t,n)}function ILa(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 SLa(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 _La(e,t,n){return Z2(n)}function vLa(e,t,n){return Tc(n)&&new RegExp(e.pattern).test(n)}function xLa(e,t,n){return eE(bl(e,t),t,n)}function wLa(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 RLa(e,t,n){return rp(n)}function TLa(e,t,n){return e.anyOf.some(r=>eE(r,t,n))}function BLa(e,t,n){return!(!RH(n)||Qc(e.maxByteLength)&&!(n.length<=e.maxByteLength)||Qc(e.minByteLength)&&!(n.length>=e.minByteLength))}function NLa(e,t,n){return!0}function kLa(e,t,n){return Fd.IsVoidLike(n)}function DLa(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 eLa(i,r,n);case"Argument":return tLa(i,r,n);case"Array":return nLa(i,r,n);case"AsyncIterator":return rLa(i,r,n);case"BigInt":return iLa(i,r,n);case"Boolean":return oLa(i,r,n);case"Constructor":return sLa(i,r,n);case"Date":return aLa(i,r,n);case"Function":return cLa(i,r,n);case"Import":return lLa(i,r,n);case"Integer":return uLa(i,r,n);case"Intersect":return dLa(i,r,n);case"Iterator":return pLa(i,r,n);case"Literal":return mLa(i,r,n);case"Never":return fLa(i,r,n);case"Not":return gLa(i,r,n);case"Null":return ALa(i,r,n);case"Number":return hLa(i,r,n);case"Object":return ELa(i,r,n);case"Promise":return yLa(i,r,n);case"Record":return bLa(i,r,n);case"Ref":return CLa(i,r,n);case"RegExp":return ILa(i,r,n);case"String":return SLa(i,r,n);case"Symbol":return _La(i,r,n);case"TemplateLiteral":return vLa(i,r,n);case"This":return xLa(i,r,n);case"Tuple":return wLa(i,r,n);case"Undefined":return RLa(i,r,n);case"Union":return TLa(i,r,n);case"Uint8Array":return BLa(i,r,n);case"Unknown":return NLa(i,r,n);case"Void":return kLa(i,r,n);default:if(!Yg.Has(i[$n]))throw new rot(i);return DLa(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*MLa(e,t,n,r){}function*QLa(e,t,n,r){}function*FLa(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*OLa(e,t,n,r){gIe(r)||(yield Qi(Kn.AsyncIterator,e,n,r))}function*PLa(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*LLa(e,t,n,r){dB(r)||(yield Qi(Kn.Boolean,e,n,r))}function*ULa(e,t,n,r){yield*tE(e.returns,t,n,r.prototype)}function*GLa(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*VLa(e,t,n,r){z2(r)||(yield Qi(Kn.Function,e,n,r))}function*WLa(e,t,n,r){let i=globalThis.Object.values(e.$defs),o=e.$defs[e.$ref];yield*tE(o,[...t,...i],n,r)}function*YLa(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*zLa(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*ZLa(e,t,n,r){AIe(r)||(yield Qi(Kn.Iterator,e,n,r))}function*HLa(e,t,n,r){r!==e.const&&(yield Qi(Kn.Literal,e,n,r))}function*XLa(e,t,n,r){yield Qi(Kn.Never,e,n,r)}function*JLa(e,t,n,r){tE(e.not,t,n,r).next().done===!0&&(yield Qi(Kn.Not,e,n,r))}function*$La(e,t,n,r){Y2(r)||(yield Qi(Kn.Null,e,n,r))}function*KLa(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*jLa(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*qLa(e,t,n,r){hIe(r)||(yield Qi(Kn.Promise,e,n,r))}function*eUa(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*tUa(e,t,n,r){yield*tE(bl(e,t),t,n,r)}function*nUa(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*rUa(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*iUa(e,t,n,r){Z2(r)||(yield Qi(Kn.Symbol,e,n,r))}function*oUa(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*sUa(e,t,n,r){yield*tE(bl(e,t),t,n,r)}function*aUa(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*cUa(e,t,n,r){rp(r)||(yield Qi(Kn.Undefined,e,n,r))}function*lUa(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*uUa(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*dUa(e,t,n,r){}function*pUa(e,t,n,r){Fd.IsVoidLike(r)||(yield Qi(Kn.Void,e,n,r))}function*mUa(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*MLa(o,i,n,r);case"Argument":return yield*QLa(o,i,n,r);case"Array":return yield*FLa(o,i,n,r);case"AsyncIterator":return yield*OLa(o,i,n,r);case"BigInt":return yield*PLa(o,i,n,r);case"Boolean":return yield*LLa(o,i,n,r);case"Constructor":return yield*ULa(o,i,n,r);case"Date":return yield*GLa(o,i,n,r);case"Function":return yield*VLa(o,i,n,r);case"Import":return yield*WLa(o,i,n,r);case"Integer":return yield*YLa(o,i,n,r);case"Intersect":return yield*zLa(o,i,n,r);case"Iterator":return yield*ZLa(o,i,n,r);case"Literal":return yield*HLa(o,i,n,r);case"Never":return yield*XLa(o,i,n,r);case"Not":return yield*JLa(o,i,n,r);case"Null":return yield*$La(o,i,n,r);case"Number":return yield*KLa(o,i,n,r);case"Object":return yield*jLa(o,i,n,r);case"Promise":return yield*qLa(o,i,n,r);case"Record":return yield*eUa(o,i,n,r);case"Ref":return yield*tUa(o,i,n,r);case"RegExp":return yield*nUa(o,i,n,r);case"String":return yield*rUa(o,i,n,r);case"Symbol":return yield*iUa(o,i,n,r);case"TemplateLiteral":return yield*oUa(o,i,n,r);case"This":return yield*sUa(o,i,n,r);case"Tuple":return yield*aUa(o,i,n,r);case"Undefined":return yield*cUa(o,i,n,r);case"Union":return yield*lUa(o,i,n,r);case"Uint8Array":return yield*uUa(o,i,n,r);case"Unknown":return yield*dUa(o,i,n,r);case"Void":return yield*pUa(o,i,n,r);default:if(!Yg.Has(o[$n]))throw new iot(e);return yield*mUa(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:()=>hAi,Errors:()=>YN,GetErrorFunction:()=>san,SetErrorFunction:()=>FPa,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 fUa(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 gUa(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 AUa(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 hUa(e,t,n,r){return fm(e,n,zN(e.not,t,n,r))}function EUa(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 yUa(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 bUa(e,t,n,r){let i=bl(e,t);return fm(e,n,zN(i,t,n,r))}function CUa(e,t,n,r){let i=bl(e,t);return fm(e,n,zN(i,t,n,r))}function IUa(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 SUa(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 fUa(o,i,n,r);case"Import":return AUa(o,i,n,r);case"Intersect":return gUa(o,i,n,r);case"Not":return hUa(o,i,n,r);case"Object":return EUa(o,i,n,r);case"Record":return yUa(o,i,n,r);case"Ref":return bUa(o,i,n,r);case"Symbol":return fm(o,n,r);case"This":return CUa(o,i,n,r);case"Tuple":return IUa(o,i,n,r);case"Union":return SUa(o,i,n,r);default:return fm(o,n,r)}}function OK(e,t,n){return zN(e,t,"",n)}var FK,oot,_Ai=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 _Ua(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 vUa(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 xUa(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 wUa(e,t,n,r){return my(e.not,n,my(e,n,r))}function RUa(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 TUa(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 BUa(e,t,n,r){let i=bl(e,t),o=ZN(i,t,n,r);return my(e,n,o)}function NUa(e,t,n,r){let i=bl(e,t),o=ZN(i,t,n,r);return my(e,n,o)}function kUa(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 DUa(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 _Ua(o,i,n,r);case"Import":return vUa(o,i,n,r);case"Intersect":return xUa(o,i,n,r);case"Not":return wUa(o,i,n,r);case"Object":return RUa(o,i,n,r);case"Record":return TUa(o,i,n,r);case"Ref":return BUa(o,i,n,r);case"This":return NUa(o,i,n,r);case"Tuple":return kUa(o,i,n,r);case"Union":return DUa(o,i,n,r);default:return my(o,n,r)}}function LK(e,t,n){return ZN(e,t,"",n)}var PK,sot,vAi=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 MUa(e,t){return kl(e)||YA(e.items,t)}function QUa(e,t){return kl(e)||YA(e.items,t)}function FUa(e,t){return kl(e)||YA(e.returns,t)||e.parameters.some(n=>YA(n,t))}function OUa(e,t){return kl(e)||YA(e.returns,t)||e.parameters.some(n=>YA(n,t))}function PUa(e,t){return kl(e)||kl(e.unevaluatedProperties)||e.allOf.some(n=>YA(n,t))}function LUa(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 UUa(e,t){return kl(e)||YA(e.items,t)}function GUa(e,t){return kl(e)||YA(e.not,t)}function VUa(e,t){return kl(e)||Object.values(e.properties).some(n=>YA(n,t))||Sp(e.additionalProperties)&&YA(e.additionalProperties,t)}function WUa(e,t){return kl(e)||YA(e.item,t)}function YUa(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 zUa(e,t){return kl(e)?!0:YA(bl(e,t),t)}function ZUa(e,t){return kl(e)?!0:YA(bl(e,t),t)}function HUa(e,t){return kl(e)||!rp(e.items)&&e.items.some(n=>YA(n,t))}function XUa(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 MUa(r,n);case"AsyncIterator":return QUa(r,n);case"Constructor":return FUa(r,n);case"Function":return OUa(r,n);case"Import":return LUa(r,n);case"Intersect":return PUa(r,n);case"Iterator":return UUa(r,n);case"Not":return GUa(r,n);case"Object":return VUa(r,n);case"Promise":return WUa(r,n);case"Record":return YUa(r,n);case"Ref":return zUa(r,n);case"This":return ZUa(r,n);case"Tuple":return HUa(r,n);case"Union":return XUa(r,n);default:return kl(e)}}function _Q(e,t){return dan.clear(),YA(e,t)}var dan,xAi=C(()=>{nR();ao();Ha();Wg();dan=new Set});var Gme=C(()=>{_Ai();vAi();xAi()});function Y4(e){if(!Tc(e))throw Error("ConstantString: Not a String");return`'${JSON.stringify(e).slice(1,-1).replace(/'/g,"\\'")}'`}function wAi(e,t){return`${e}[${Y4(t)}]`}var aot,cot,pan,lot,DBe,z4,UK,RAi=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)`:`(${wAi(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=wAi(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 vPa(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 EPa()}function xPa(e){if(e==="Positive")return RV.POSITIVE;if(e==="Negative")return RV.NEGATIVE}function wPa(e){return e===RV.POSITIVE?"Great! Any additional comments? (optional)":"Sorry to hear that. What went wrong? (optional)"}async function RPa(e,t,n,r,i){try{await t.chatFeedback({requestId:vPa(e,n),rating:r,note:_Pa(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 TPa(e,t){let n=IPa();t.api=n.api,e.events.on("augment:api",r=>{SPa(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=xPa(s);if(a===void 0){i.ui.notify("Feedback cancelled","info");return}let c=await i.ui.editor(wPa(a),"");if(c===void 0){i.ui.notify("Feedback cancelled","info");return}await RPa(i,o,t,a,c)}})}function qsn(e){e.events.on("augment:credentials",t=>{CPa(t)&&bPa(t)}),TPa(e,{}),e.registerTool(Hgi({operations:{runRemoteTool:(...t)=>{let n=yPa();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 Jgi,$gi,Kgi=C(()=>{"use strict";uo();Xgi();Jgi=Symbol.for("__hermes_augment_legacy_tools_feedback_state__"),$gi=Symbol.for("__hermes_augment_legacy_tools_credentials__")});function qgi(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"){jgi.warn("augment:credentials payload missing apiKey/apiUrl/userAgent or has invalid cliVersion");return}t.credentials=r,jgi.debug("Received Augment credentials via augment:credentials event"),t.credsResolve?.()})}async function eAi(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 jgi,ean=C(()=>{"use strict";sr();jgi=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 NPa}from"node:fs";import{homedir as TBe}from"node:os";import{dirname as nan,join as tR,resolve as nAi}from"node:path";import{fileURLToPath as kPa}from"node:url";function rAi(){let e=process.env.PI_PACKAGE_DIR;if(e)return e==="~"?TBe():e.startsWith("~/")?TBe()+e.slice(1):e;let t=tAi;for(;t!==nan(t);){if(NPa(tR(t,"package.json")))return t;t=nan(t)}return tAi}function jit(){return nAi(tR(rAi(),"docs"))}function qit(){return nAi(tR(rAi(),"CHANGELOG.md"))}function aAi(e){return`${process.env.PI_SHARE_VIEWER_URL||QPa}#${e}`}function cAi(e){return e==="~"?TBe():e.startsWith("~/")?TBe()+e.slice(1):e}function IQ(){let e=process.env.AUGMENT_CACHE_DIR;return e?cAi(e):tR(TBe(),".augment")}function mo(){let e=process.env[ran];return e?cAi(e):IQ()}function kBe(){return tR(mo(),"themes")}function lAi(){return tR(mo(),"models.json")}function uAi(){return tR(mo(),"auth.json")}function dAi(){return tR(mo(),"settings.json")}function W4(){return IQ()}function Fme(){return tR(mo(),"bin")}function pAi(){return tR(mo(),"prompts")}function mAi(){return tR(mo(),BBe)}function fAi(){return tR(mo(),`${es}-debug.log`)}var DPa,tAi,es,xa,BBe,NBe,iAi,MPa,ll,oAi,sAi,ran,QPa,Mc=C(()=>{"use strict";tan();DPa=kPa(import.meta.url),tAi=nan(DPa);es=V4.piConfig?.name||"auggie",xa=V4.piConfig?.configDir||".augment",BBe="sessions-v2",NBe=es,iAi="Auggie Coding Agent",MPa="1.2.0-prerelease.202609150952",ll=MPa??V4.version,oAi="19b9405b262ab29af23a836925729de7d90d65a6",sAi="2026-09-15T16:52:40Z",ran=`${es.toUpperCase()}_CODING_AGENT_DIR`,QPa="https://pi.dev/session/"});function ian(...e){return new globalThis.Function(...e)}var gAi=C(()=>{});var eot,tot,oan,AAi=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(()=>{gAi();yIe();AAi()});function hAi(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 FPa(e){EAi=e}function san(){return EAi}var EAi,aan=C(()=>{ao();can();EAi=hAi});function OPa(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"?OPa(e,t):e}var lan,yAi=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(()=>{yAi()});function*GPa(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 VPa(e){Qb(gv.Array);for(let t of e)Lme(t)}function WPa(e){Qb(gv.Boolean),Qb(e?1:0)}function YPa(e){Qb(gv.BigInt),CAi.setBigInt64(0,e);for(let t of IAi)Qb(t)}function zPa(e){Qb(gv.Date),Lme(e.getTime())}function ZPa(e){Qb(gv.Null)}function HPa(e){Qb(gv.Number),CAi.setFloat64(0,e);for(let t of IAi)Qb(t)}function XPa(e){Qb(gv.Object);for(let t of globalThis.Object.getOwnPropertyNames(e).sort())Lme(t),Lme(e[t])}function JPa(e){Qb(gv.String);for(let t=0;t<e.length;t++)for(let n of GPa(e.charCodeAt(t)))Qb(n)}function $Pa(e){Qb(gv.Symbol),Lme(e.description)}function KPa(e){Qb(gv.Uint8Array);for(let t=0;t<e.length;t++)Qb(e[t])}function jPa(e){return Qb(gv.Undefined)}function Lme(e){if(qo(e))return VPa(e);if(dB(e))return WPa(e);if(Sh(e))return YPa(e);if(rb(e))return zPa(e);if(Y2(e))return ZPa(e);if(Qo(e))return HPa(e);if(ea(e))return XPa(e);if(Tc(e))return JPa(e);if(Z2(e))return $Pa(e);if(RH(e))return KPa(e);if(rp(e))return jPa(e);throw new not(e)}function Qb(e){Pme=Pme^UPa[e],Pme=Pme*PPa%LPa}function IU(e){return Pme=BigInt("14695981039346656037"),Lme(e),Pme}var not,gv,Pme,PPa,LPa,UPa,bAi,CAi,IAi,SAi=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"),[PPa,LPa]=[BigInt("1099511628211"),BigInt("18446744073709551616")],UPa=Array.from({length:256}).map((e,t)=>BigInt(t)),bAi=new Float64Array(1),CAi=new DataView(bAi.buffer),IAi=new Uint8Array(bAi.buffer)});var Ume=C(()=>{SAi()});function qPa(e){return e[$n]==="Any"||e[$n]==="Unknown"}function Qc(e){return e!==void 0}function eLa(e,t,n){return!0}function tLa(e,t,n){return!0}function nLa(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 rLa(e,t,n){return gIe(n)}function iLa(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 oLa(e,t,n){return dB(n)}function sLa(e,t,n){return eE(e.returns,t,n.prototype)}function aLa(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 cLa(e,t,n){return z2(n)}function lLa(e,t,n){let r=globalThis.Object.values(e.$defs),i=e.$defs[e.$ref];return eE(i,[...t,...r],n)}function uLa(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 dLa(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 pLa(e,t,n){return AIe(n)}function mLa(e,t,n){return n===e.const}function fLa(e,t,n){return!1}function gLa(e,t,n){return!eE(e.not,t,n)}function ALa(e,t,n){return Y2(n)}function hLa(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 ELa(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)||qPa(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 yLa(e,t,n){return hIe(n)}function bLa(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 CLa(e,t,n){return eE(bl(e,t),t,n)}function ILa(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 SLa(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 _La(e,t,n){return Z2(n)}function vLa(e,t,n){return Tc(n)&&new RegExp(e.pattern).test(n)}function xLa(e,t,n){return eE(bl(e,t),t,n)}function wLa(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 RLa(e,t,n){return rp(n)}function TLa(e,t,n){return e.anyOf.some(r=>eE(r,t,n))}function BLa(e,t,n){return!(!RH(n)||Qc(e.maxByteLength)&&!(n.length<=e.maxByteLength)||Qc(e.minByteLength)&&!(n.length>=e.minByteLength))}function NLa(e,t,n){return!0}function kLa(e,t,n){return Fd.IsVoidLike(n)}function DLa(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 eLa(i,r,n);case"Argument":return tLa(i,r,n);case"Array":return nLa(i,r,n);case"AsyncIterator":return rLa(i,r,n);case"BigInt":return iLa(i,r,n);case"Boolean":return oLa(i,r,n);case"Constructor":return sLa(i,r,n);case"Date":return aLa(i,r,n);case"Function":return cLa(i,r,n);case"Import":return lLa(i,r,n);case"Integer":return uLa(i,r,n);case"Intersect":return dLa(i,r,n);case"Iterator":return pLa(i,r,n);case"Literal":return mLa(i,r,n);case"Never":return fLa(i,r,n);case"Not":return gLa(i,r,n);case"Null":return ALa(i,r,n);case"Number":return hLa(i,r,n);case"Object":return ELa(i,r,n);case"Promise":return yLa(i,r,n);case"Record":return bLa(i,r,n);case"Ref":return CLa(i,r,n);case"RegExp":return ILa(i,r,n);case"String":return SLa(i,r,n);case"Symbol":return _La(i,r,n);case"TemplateLiteral":return vLa(i,r,n);case"This":return xLa(i,r,n);case"Tuple":return wLa(i,r,n);case"Undefined":return RLa(i,r,n);case"Union":return TLa(i,r,n);case"Uint8Array":return BLa(i,r,n);case"Unknown":return NLa(i,r,n);case"Void":return kLa(i,r,n);default:if(!Yg.Has(i[$n]))throw new rot(i);return DLa(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*MLa(e,t,n,r){}function*QLa(e,t,n,r){}function*FLa(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*OLa(e,t,n,r){gIe(r)||(yield Qi(Kn.AsyncIterator,e,n,r))}function*PLa(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*LLa(e,t,n,r){dB(r)||(yield Qi(Kn.Boolean,e,n,r))}function*ULa(e,t,n,r){yield*tE(e.returns,t,n,r.prototype)}function*GLa(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*VLa(e,t,n,r){z2(r)||(yield Qi(Kn.Function,e,n,r))}function*WLa(e,t,n,r){let i=globalThis.Object.values(e.$defs),o=e.$defs[e.$ref];yield*tE(o,[...t,...i],n,r)}function*YLa(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*zLa(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*ZLa(e,t,n,r){AIe(r)||(yield Qi(Kn.Iterator,e,n,r))}function*HLa(e,t,n,r){r!==e.const&&(yield Qi(Kn.Literal,e,n,r))}function*XLa(e,t,n,r){yield Qi(Kn.Never,e,n,r)}function*JLa(e,t,n,r){tE(e.not,t,n,r).next().done===!0&&(yield Qi(Kn.Not,e,n,r))}function*$La(e,t,n,r){Y2(r)||(yield Qi(Kn.Null,e,n,r))}function*KLa(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*jLa(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*qLa(e,t,n,r){hIe(r)||(yield Qi(Kn.Promise,e,n,r))}function*eUa(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*tUa(e,t,n,r){yield*tE(bl(e,t),t,n,r)}function*nUa(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*rUa(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*iUa(e,t,n,r){Z2(r)||(yield Qi(Kn.Symbol,e,n,r))}function*oUa(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*sUa(e,t,n,r){yield*tE(bl(e,t),t,n,r)}function*aUa(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*cUa(e,t,n,r){rp(r)||(yield Qi(Kn.Undefined,e,n,r))}function*lUa(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*uUa(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*dUa(e,t,n,r){}function*pUa(e,t,n,r){Fd.IsVoidLike(r)||(yield Qi(Kn.Void,e,n,r))}function*mUa(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*MLa(o,i,n,r);case"Argument":return yield*QLa(o,i,n,r);case"Array":return yield*FLa(o,i,n,r);case"AsyncIterator":return yield*OLa(o,i,n,r);case"BigInt":return yield*PLa(o,i,n,r);case"Boolean":return yield*LLa(o,i,n,r);case"Constructor":return yield*ULa(o,i,n,r);case"Date":return yield*GLa(o,i,n,r);case"Function":return yield*VLa(o,i,n,r);case"Import":return yield*WLa(o,i,n,r);case"Integer":return yield*YLa(o,i,n,r);case"Intersect":return yield*zLa(o,i,n,r);case"Iterator":return yield*ZLa(o,i,n,r);case"Literal":return yield*HLa(o,i,n,r);case"Never":return yield*XLa(o,i,n,r);case"Not":return yield*JLa(o,i,n,r);case"Null":return yield*$La(o,i,n,r);case"Number":return yield*KLa(o,i,n,r);case"Object":return yield*jLa(o,i,n,r);case"Promise":return yield*qLa(o,i,n,r);case"Record":return yield*eUa(o,i,n,r);case"Ref":return yield*tUa(o,i,n,r);case"RegExp":return yield*nUa(o,i,n,r);case"String":return yield*rUa(o,i,n,r);case"Symbol":return yield*iUa(o,i,n,r);case"TemplateLiteral":return yield*oUa(o,i,n,r);case"This":return yield*sUa(o,i,n,r);case"Tuple":return yield*aUa(o,i,n,r);case"Undefined":return yield*cUa(o,i,n,r);case"Union":return yield*lUa(o,i,n,r);case"Uint8Array":return yield*uUa(o,i,n,r);case"Unknown":return yield*dUa(o,i,n,r);case"Void":return yield*pUa(o,i,n,r);default:if(!Yg.Has(o[$n]))throw new iot(e);return yield*mUa(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:()=>hAi,Errors:()=>YN,GetErrorFunction:()=>san,SetErrorFunction:()=>FPa,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 fUa(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 gUa(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 AUa(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 hUa(e,t,n,r){return fm(e,n,zN(e.not,t,n,r))}function EUa(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 yUa(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 bUa(e,t,n,r){let i=bl(e,t);return fm(e,n,zN(i,t,n,r))}function CUa(e,t,n,r){let i=bl(e,t);return fm(e,n,zN(i,t,n,r))}function IUa(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 SUa(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 fUa(o,i,n,r);case"Import":return AUa(o,i,n,r);case"Intersect":return gUa(o,i,n,r);case"Not":return hUa(o,i,n,r);case"Object":return EUa(o,i,n,r);case"Record":return yUa(o,i,n,r);case"Ref":return bUa(o,i,n,r);case"Symbol":return fm(o,n,r);case"This":return CUa(o,i,n,r);case"Tuple":return IUa(o,i,n,r);case"Union":return SUa(o,i,n,r);default:return fm(o,n,r)}}function OK(e,t,n){return zN(e,t,"",n)}var FK,oot,_Ai=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 _Ua(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 vUa(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 xUa(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 wUa(e,t,n,r){return my(e.not,n,my(e,n,r))}function RUa(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 TUa(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 BUa(e,t,n,r){let i=bl(e,t),o=ZN(i,t,n,r);return my(e,n,o)}function NUa(e,t,n,r){let i=bl(e,t),o=ZN(i,t,n,r);return my(e,n,o)}function kUa(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 DUa(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 _Ua(o,i,n,r);case"Import":return vUa(o,i,n,r);case"Intersect":return xUa(o,i,n,r);case"Not":return wUa(o,i,n,r);case"Object":return RUa(o,i,n,r);case"Record":return TUa(o,i,n,r);case"Ref":return BUa(o,i,n,r);case"This":return NUa(o,i,n,r);case"Tuple":return kUa(o,i,n,r);case"Union":return DUa(o,i,n,r);default:return my(o,n,r)}}function LK(e,t,n){return ZN(e,t,"",n)}var PK,sot,vAi=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 MUa(e,t){return kl(e)||YA(e.items,t)}function QUa(e,t){return kl(e)||YA(e.items,t)}function FUa(e,t){return kl(e)||YA(e.returns,t)||e.parameters.some(n=>YA(n,t))}function OUa(e,t){return kl(e)||YA(e.returns,t)||e.parameters.some(n=>YA(n,t))}function PUa(e,t){return kl(e)||kl(e.unevaluatedProperties)||e.allOf.some(n=>YA(n,t))}function LUa(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 UUa(e,t){return kl(e)||YA(e.items,t)}function GUa(e,t){return kl(e)||YA(e.not,t)}function VUa(e,t){return kl(e)||Object.values(e.properties).some(n=>YA(n,t))||Sp(e.additionalProperties)&&YA(e.additionalProperties,t)}function WUa(e,t){return kl(e)||YA(e.item,t)}function YUa(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 zUa(e,t){return kl(e)?!0:YA(bl(e,t),t)}function ZUa(e,t){return kl(e)?!0:YA(bl(e,t),t)}function HUa(e,t){return kl(e)||!rp(e.items)&&e.items.some(n=>YA(n,t))}function XUa(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 MUa(r,n);case"AsyncIterator":return QUa(r,n);case"Constructor":return FUa(r,n);case"Function":return OUa(r,n);case"Import":return LUa(r,n);case"Intersect":return PUa(r,n);case"Iterator":return UUa(r,n);case"Not":return GUa(r,n);case"Object":return VUa(r,n);case"Promise":return WUa(r,n);case"Record":return YUa(r,n);case"Ref":return zUa(r,n);case"This":return ZUa(r,n);case"Tuple":return HUa(r,n);case"Union":return XUa(r,n);default:return kl(e)}}function _Q(e,t){return dan.clear(),YA(e,t)}var dan,xAi=C(()=>{nR();ao();Ha();Wg();dan=new Set});var Gme=C(()=>{_Ai();vAi();xAi()});function Y4(e){if(!Tc(e))throw Error("ConstantString: Not a String");return`'${JSON.stringify(e).slice(1,-1).replace(/'/g,"\\'")}'`}function wAi(e,t){return`${e}[${Y4(t)}]`}var aot,cot,pan,lot,DBe,z4,UK,RAi=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)`:`(${wAi(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=wAi(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)
@@ -6707,7 +6707,7 @@ not revoke server-side tokens; use \`auggie token revoke\` for revocation.
6707
6707
 
6708
6708
  Interactive /login and /logout manage the platform session in session.json.`,Nyo=`Usage: auggie auth status
6709
6709
 
6710
- Show whether the CLI has an active Augment authentication session.`,oal="Note: Injected credentials remain active and may override the saved session.",sal="Note: Injected credentials remain active.",aal="AUGGIE_V2_SEGMENT_WRITE_KEY"});import{readFile as Ral}from"node:fs/promises";import{resolve as Tal}from"node:path";function kal(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===mBn){let o=e[r+1];if(o===void 0||o.startsWith("-")||!o.trim())return{type:"fatal"};n=o,r+=1;continue}if(i.startsWith(`${mBn}=`)){let o=i.slice(mBn.length+1);if(!o.trim())return{type:"fatal"};n=o;continue}t.push(i)}return{type:"success",args:t,candidate:n}}async function Oyo(e,t=Nal){let n=kal(e);if(n.type==="fatal")return{type:"fatal",message:Bal};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(Tal(process.cwd(),r))}catch{return{type:"fatal",message:fBn}}let o;try{o=JSON.parse(i)}catch{return{type:"fatal",message:fBn}}let s=FQe(o);return s?{type:"success",args:n.args,credentials:s}:{type:"fatal",message:fBn}}var mBn,Bal,fBn,Nal,Pyo=C(()=>{"use strict";zht();mBn="--augment-session-json",Bal="--augment-session-json requires a value",fBn="--augment-session-json value is unusable",Nal={readPath:e=>Ral(e,"utf8")}});import{execFile as Dal}from"node:child_process";import{existsSync as Mal,rmSync as Qal}from"node:fs";import{promisify as Fal}from"node:util";function gBn(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 Vyo(e){return e instanceof Error?e.message:String(e)}async function ABn({sshUrl:e,httpsUrl:t,targetDir:n,extraArgs:r=[]}){let i;for(let o of[{url:e,env:Oal},{url:t,env:Gyo}])try{return await Uyo("git",["clone","--depth","1",...r,o.url,n],{env:o.env}),{success:!0}}catch(s){i=s,Mal(n)&&Qal(n,{recursive:!0,force:!0})}return{success:!1,error:Vyo(i)}}function Lyo(e,t){return Uyo("git",e,{cwd:t,env:Gyo})}async function Wyo(e,t){try{return await Lyo(["fetch","--depth","1","origin",t],e),await Lyo(["checkout","FETCH_HEAD"],e),{success:!0}}catch(n){return{success:!1,error:Vyo(n)}}}var Uyo,Oal,Gyo,Yyo=C(()=>{"use strict";Uyo=Fal(Dal),Oal={...process.env,GIT_TERMINAL_PROMPT:"0",GIT_SSH_COMMAND:"ssh -o BatchMode=yes"},Gyo={...process.env,GIT_TERMINAL_PROMPT:"0"}});import{existsSync as Pal,readFileSync as Lal}from"node:fs";import{join as wEe}from"node:path";function Hyo(e){for(let t of Zyo)if(Pal(wEe(e,t)))return!0;return!1}function Q6(e){let t=Ual(e,zyo);return t.manifest||t.diagnostics.length>0?t:{diagnostics:[`no marketplace manifest found (looked for ${zyo.join(", ")})`]}}function Ual(e,t){let n=[];for(let r of t){let i=wEe(e,r),o;try{o=Lal(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 Zyo,zyo,Xyo,kbt=C(()=>{"use strict";Zyo=[wEe(".augment-plugin","plugin.json"),wEe(".claude-plugin","plugin.json")],zyo=[wEe(".augment-plugin","marketplace.json"),wEe(".claude-plugin","marketplace.json")];Xyo=`no plugin manifest found (looked for ${Zyo.join(", ")})`});import{execFile as Gal}from"node:child_process";import{existsSync as eG,mkdirSync as $yo,readdirSync as Val,renameSync as Wal,rmSync as Yal,statSync as zal}from"node:fs";import{dirname as Zal,isAbsolute as Kyo,join as tG,relative as jyo,resolve as hBn}from"node:path";import{promisify as Hal}from"node:util";function ebo(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 Jyo(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 Jal(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 $al(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 Kal(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 jal(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 EBn(e){if(!e||typeof e!="object")return null;let t=e,n=nO(t.sha)??nO(t.ref);switch(t.source){case"github":return $al(t,n);case"url":return Kal(t,n);case"git-subdir":return jal(t,n);default:return null}}function tbo(e,t,n){let r=ebo(t);if(!r)return;let i=tG(e,qyo,r);if(!eG(tG(i,".git")))return;if(!n)return i;let o=hBn(i,n),s=jyo(i,o);if(!(s.startsWith("..")||Kyo(s)))return eG(o)?o:void 0}async function qal(e,t){let n=typeof t.name=="string"?t.name:"",r=EBn(t.source);if(!r)return;let i=ebo(n);if(!i)return{name:n,status:"failed",error:"invalid plugin cache name"};let o=tG(e,qyo,i);if(eG(tG(o,".git")))return{name:n,status:"skipped"};let s=Zal(o);eG(s)||$yo(s,{recursive:!0});let{sshUrl:a,httpsUrl:c}=gBn(r.url),l=r.kind==="git-subdir",u=await ABn({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 Wyo(o,r.ref);if(!d.success)return{name:n,status:"failed",error:d.error}}if(l&&r.kind==="git-subdir")try{await Xal("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 nbo(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 qal(e,i);o&&r.push(o)}return r}function ecl(e){try{return zal(e).isDirectory()}catch{return!1}}function tcl(e,t){let n=jyo(hBn(e),hBn(t));return n!==""&&!n.startsWith("..")&&!Kyo(n)}async function KFe(e,t){let n=Jal(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)||$yo(e,{recursive:!0});let s=Jyo(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}=gBn(`https://github.com/${r}/${i}`),u=await ABn({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"?Jyo(d.name):null;if(m&&m!==s){let f=tG(e,m);if(!eG(f))try{Wal(a,f),p=m}catch{}}return await nbo(tG(e,p)),{success:!0,marketplaceId:p}}function jFe(e,t){let n=tG(e,t);if(!tcl(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 Yal(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 rbo(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(!ecl(o))continue;(await nbo(o)).some(a=>a.status==="cloned")&&(t=!0)}}return t}var Xal,qyo,Dbt=C(()=>{"use strict";Yyo();kbt();Xal=Hal(Gal),qyo=".plugin-cache"});import{readFileSync as ncl}from"node:fs";import{join as rcl}from"node:path";function ibo(e){let t=rcl(e,"hooks","hooks.json"),n;try{n=ncl(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 obo=C(()=>{"use strict";zq()});import{existsSync as icl,lstatSync as ocl,readdirSync as lbo,statSync as scl}from"node:fs";import{basename as sbo,isAbsolute as abo,join as qFe,relative as acl,resolve as ubo}from"node:path";function yBn(e,t){let n=[],r=[],i=[],o=new Map;for(let s of e)for(let a of ccl(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 ccl(e,t,n){let r=[];if(!icl(e))return r;let i=Q6(e);if(!i.manifest)for(let s of i.diagnostics)s.startsWith("no marketplace manifest found")||n.push(`[${sbo(e)}] ${s}`);if(i.manifest)return cbo(e,sbo(e),t,r,n),r;let o;try{o=lbo(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)&&cbo(a,s,t,r,n)}return r}function cbo(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=gcl(o.manifest.name,t),a=fcl(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=lcl(l,e,a,s,n);u&&r.push(u)}for(let l of o.diagnostics)i.push(`[${s}] ${l}`)}function lcl(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=mcl(e.source,o,t,n,c);return l?dcl(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 ucl(e,t){let n=[],r;try{r=lbo(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(!ocl(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 dcl(e,t,n,r,i,o){Hyo(r)||o.push(Xyo);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?ucl(c,o):void 0,m=ibo(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 pcl(e,t,n,r){let i=EBn(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=tbo(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 mcl(e,t,n,r,i){if(typeof e!="string"){if(e&&typeof e=="object")return pcl(e,t,n,i);i.push("plugin entry has no source field; skipping");return}if(abo(e)){i.push(`absolute source "${e}" is not allowed; skipping`);return}let o=e.startsWith("./")?n:r,s=ubo(o,e),a=acl(n,s);if(a.startsWith("..")||abo(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 fcl(e,t){return typeof t!="string"||t.length===0?e:ubo(e,t)}function gcl(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 scl(e).isDirectory()}catch{return!1}}var Mbt=C(()=>{"use strict";Dbt();obo();kbt()});import{readFileSync as Acl}from"node:fs";import{basename as hcl}from"node:path";function Qbt(e){return typeof e=="string"?e:void 0}function ycl(e){if(typeof e=="string")return pbo.includes(e)?e:void 0}function bcl(e){return typeof e=="number"&&e>=0?e:void 0}function fbo(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 gbo(e,t){return e==null?[...t]:fbo(e)??[]}function Ccl(e){return fbo(e)}function Icl(e){if(e==="user"||e==="project"||e==="local")return e}function dbo(e){if(e==null||e===!0)return!0;if(e===!1||e==="none")return!1;let t=gbo(e,[]);return t.length>0?t:!1}function Scl(e,t){let n=REe(hcl(e,".md")),r;try{r=Acl(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=ycl(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: ${pbo.join(", ")}); falling back to the model's default`);let l={name:n,displayName:Qbt(i.display_name),description:Qbt(i.description)??n,builtinToolNames:gbo(i.tools,Ecl),disallowedTools:Ccl(i.disallowed_tools),extensions:dbo(i.extensions??i.inherit_extensions),skills:dbo(i.skills??i.inherit_skills),model:Qbt(i.model),thinking:a,maxTurns:bcl(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:Icl(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 Abo(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 Ecl,pbo,mbo,hbo=C(()=>{"use strict";Sl();Mbt();Ecl=["read","bash","edit","write","grep","find","ls"],pbo=["off","minimal","low","medium","high","xhigh"],mbo=["general-purpose","explore","plan"]});import{lstatSync as _cl,readFileSync as vcl,realpathSync as Ebo}from"node:fs";import{isAbsolute as xcl,join as wcl,relative as Rcl}from"node:path";function TEe(e,t){let n=e;for(let r of Tcl){let i=`\${${r}}`;n.includes(i)&&(n=n.split(i).join(t))}return n}function bBn(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function ybo(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 Bcl(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 Ncl(e,t){let n=Bcl(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:ybo(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:ybo(t.env),cwd:t.cwd,timeoutMs:t.timeoutMs,useShellInterpolation:o}}function bbo(e,t){if(!e)return;let n={};for(let[r,i]of Object.entries(e))n[r]=TEe(i,t);return n}function kcl(e,t){return e.type==="stdio"?{...e,command:TEe(e.command,t),args:e.args.map(n=>TEe(n,t)),env:bbo(e.env,t),cwd:e.cwd?TEe(e.cwd,t):void 0}:{...e,url:TEe(e.url,t),headers:bbo(e.headers,t),cwd:e.cwd?TEe(e.cwd,t):void 0}}function Dcl(e,t){let n=wcl(e,".mcp.json"),r;try{r=_cl(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=Ebo(e),o=Ebo(n),s=Rcl(i,o);if(s.startsWith("..")||xcl(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 vcl(n,"utf-8")}catch(i){t.push(`failed to read .mcp.json: ${i.message}`);return}}function Cbo(e){let t=[],n=Dcl(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(!bBn(r))return t.push(".mcp.json must be a JSON object"),{servers:[],diagnostics:t};let i=r.mcpServers;if(!bBn(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(!bBn(a)){t.push(`MCP server "${c}" must be a JSON object`);continue}try{let l=Ncl(c,a);o.push(kcl(l,e.root))}catch(l){t.push(l instanceof Error?l.message:String(l))}}return{servers:o,diagnostics:t}}var Tcl,Ibo,Sbo=C(()=>{"use strict";Mbt();Tcl=["CLAUDE_PLUGIN_ROOT","AUGMENT_PLUGIN_ROOT","AUGGIE_PLUGIN_ROOT"];Ibo="hermes:mcp:register-server-source"});function _bo(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 vbo=C(()=>{"use strict";Sl()});var xbo,wbo=C(()=>{"use strict";xbo="hermes:subagents:register-agent-source"});import{join as Iee,resolve as Mcl}from"node:path";import{existsSync as Qcl,readdirSync as Fcl,statSync as Ocl}from"node:fs";function Lcl(){return globalThis[Rbo]??{}}function Ucl(e){globalThis[Rbo]=e}function SBn(e){Zk=[],IBn=[],Fbt=[],CBn=[],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(xbo,w=>{i=w.register}),e.events.on(Ibo,w=>{a=w.registerServerSource}),e.events.on(Pcl,w=>{Ucl(w?.scopes??{})});function c(w,R,N=[]){let Q=Lcl(),{enabled:F,diagnostics:D}=_bo(w,R,Q),k=[...new Set(N.map(Ae=>Mcl(w,Ae)))],W=yBn(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=yBn([...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,IBn=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}=Abo(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}mbo.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}=Cbo(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)}CBn=w}function f(){if(!a)return;a({source:"plugin",getServers:()=>CBn,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=Gcl(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");rbo([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 Gcl(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(!Qcl(t))return[];let n;try{n=Fcl(t)}catch{return[]}let r=[];for(let i of n){let o=Iee(t,i);try{if(!Ocl(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 IBn)e.push({type:"warning",message:t});for(let t of tOe)e.push(t);return e}var nx,Pcl,Rbo,Zk,IBn,Fbt,CBn,tOe,BEe=C(()=>{"use strict";Sl();zq();sr();hbo();Mbt();Dbt();kbt();Sbo();vbo();wbo();Dbt();nx=Gt.child({prefix:"pi-plugins"}),Pcl="augment:vfs-scopes",Rbo=Symbol.for("__pi_plugins_vfs_scopes__");Zk=[],IBn=[],Fbt=[],CBn=[],tOe=[]});function _Bn(){let e=globalThis;return e[Tbo]??=new Map,e[Tbo]}function Bbo(){return[..._Bn().values()]}function Nbo(e){return _Bn().get(e)}function kbo(e){let t=_Bn();t.clear();for(let n of e)t.set(n.name,n)}var Tbo,vBn=C(()=>{"use strict";Tbo=Symbol.for("__hermes_cloud_tool_registry__")});function Wcl(e){return{...e,execute:(t,n,r,i,o)=>{let s=Nbo(e.name);if(!s)throw new Error(`Cloud tool "${e.name}" is unavailable`);return s.execute(t,n,r,i,o)}}}function xBn(e){for(let t of Bbo())e.registerTool(Wcl(t))}var Dbo=C(()=>{"use strict";vBn()});function Pbt(){let e=globalThis;return e[Mbo]??=new Map,e[Mbo]}function Fbo(){return[...Pbt().values()]}function Obo(e){return Pbt().get(e)}function O6(e){Pbt().set(e.name,e)}function Pbo(e,t){let n=Pbt();(t===void 0||n.get(e)===t)&&n.delete(e)}function Lbo(e){Reflect.set(e,Qbo,!0)}function Lbt(e){return Reflect.get(e,Qbo)===!0}var Mbo,Qbo,See=C(()=>{"use strict";Mbo=Symbol.for("__hermes_mcp_tool_registry__"),Qbo=Symbol.for("__hermes_mcp_extension_factory__")});function Ycl(e){return{...e,execute:(t,n,r,i,o)=>{let s=Obo(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 Fbo())e.registerTool(Ycl(t))}var Ubo=C(()=>{"use strict";See()});import{existsSync as zcl}from"node:fs";import{homedir as rOe}from"node:os";import{dirname as wBn,join as rT,resolve as Vbo}from"node:path";import{fileURLToPath as Zcl}from"node:url";function Wbo(){let e=process.env.PI_PACKAGE_DIR;if(e)return e==="~"?rOe():e.startsWith("~/")?rOe()+e.slice(1):e;let t=Gbo;for(;t!==wBn(t);){if(zcl(rT(t,"package.json")))return t;t=wBn(t)}return Gbo}function Gbt(){return Vbo(rT(Wbo(),"docs"))}function Vbt(){return Vbo(rT(Wbo(),"CHANGELOG.md"))}function Hbo(e){return`${process.env.PI_SHARE_VIEWER_URL||Jcl}#${e}`}function Xbo(e){return e==="~"?rOe():e.startsWith("~/")?rOe()+e.slice(1):e}function iO(){let e=process.env.AUGMENT_CACHE_DIR;return e?Xbo(e):rT(rOe(),".augment")}function gi(){let e=process.env[RBn];return e?Xbo(e):iO()}function sOe(){return rT(gi(),"themes")}function Jbo(){return rT(gi(),"models.json")}function $bo(){return rT(gi(),"auth.json")}function Kbo(){return rT(gi(),"settings.json")}function aOe(){return iO()}function NEe(){return rT(gi(),"bin")}function jbo(){return rT(gi(),"prompts")}function qbo(){return rT(gi(),iOe)}function eCo(){return rT(gi(),`${is}-debug.log`)}var Hcl,Gbo,is,Ba,iOe,oOe,Ybo,Xcl,Vl,zbo,Zbo,RBn,Jcl,Wc=C(()=>{"use strict";tan();Hcl=Zcl(import.meta.url),Gbo=wBn(Hcl);is=V4.piConfig?.name||"auggie",Ba=V4.piConfig?.configDir||".augment",iOe="sessions-v2",oOe=is,Ybo="Auggie Coding Agent",Xcl="1.2.0-prerelease.202609150921",Vl=Xcl??V4.version,zbo="ceaa09881f62be5e6aa44c80621f72a663c7e37f",Zbo="2026-09-15T16:21:28Z",RBn=`${is.toUpperCase()}_CODING_AGENT_DIR`,Jcl="https://pi.dev/session/"});var nCo,tCo=C(()=>{nCo={$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 iCo,rCo=C(()=>{iCo={$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 qcl(){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 kBn(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 TBn(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 ell(e){let t=Number.POSITIVE_INFINITY,n=0;for(let[r,i]of cCo.entries()){let o=Math.abs(e-i);o<t&&(t=o,n=r)}return n}function sCo(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 tll(e,t,n){let r=TBn(e),i=TBn(t),o=TBn(n),s=Wbt[r]??0,a=Wbt[i]??0,c=Wbt[o]??0,l=16+36*r+6*i+o,u=sCo(e,t,n,s,a,c),d=Math.round(.299*e+.587*t+.114*n),p=ell(d),m=cCo[p]??0,f=232+p,g=sCo(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 lCo(e){let{r:t,g:n,b:r}=kBn(e);return tll(t,n,r)}function nll(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}=kBn(e);return`\x1B[38;2;${r};${i};${o}m`}return`\x1B[38;5;${lCo(e)}m`}throw new Error(`Invalid color value: ${e}`)}function rll(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}=kBn(e);return`\x1B[48;2;${r};${i};${o}m`}return`\x1B[48;5;${lCo(e)}m`}throw new Error(`Invalid color value: ${e}`)}function DBn(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 DBn(r,t,n)}function uCo(e,t={}){let n={};for(let[r,i]of Object.entries(e))n[r]=DBn(i,t);return n}function zbt(){let e=new Set(Object.keys(MBn)),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 dCo(){let e=sOe(),t=[];for(let n of Object.keys(MBn))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 ill(e,t){if(!oCo.Check(t)){let n=Array.from(oCo.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
+ Show whether the CLI has an active Augment authentication session.`,oal="Note: Injected credentials remain active and may override the saved session.",sal="Note: Injected credentials remain active.",aal="AUGGIE_V2_SEGMENT_WRITE_KEY"});import{readFile as Ral}from"node:fs/promises";import{resolve as Tal}from"node:path";function kal(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===mBn){let o=e[r+1];if(o===void 0||o.startsWith("-")||!o.trim())return{type:"fatal"};n=o,r+=1;continue}if(i.startsWith(`${mBn}=`)){let o=i.slice(mBn.length+1);if(!o.trim())return{type:"fatal"};n=o;continue}t.push(i)}return{type:"success",args:t,candidate:n}}async function Oyo(e,t=Nal){let n=kal(e);if(n.type==="fatal")return{type:"fatal",message:Bal};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(Tal(process.cwd(),r))}catch{return{type:"fatal",message:fBn}}let o;try{o=JSON.parse(i)}catch{return{type:"fatal",message:fBn}}let s=FQe(o);return s?{type:"success",args:n.args,credentials:s}:{type:"fatal",message:fBn}}var mBn,Bal,fBn,Nal,Pyo=C(()=>{"use strict";zht();mBn="--augment-session-json",Bal="--augment-session-json requires a value",fBn="--augment-session-json value is unusable",Nal={readPath:e=>Ral(e,"utf8")}});import{execFile as Dal}from"node:child_process";import{existsSync as Mal,rmSync as Qal}from"node:fs";import{promisify as Fal}from"node:util";function gBn(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 Vyo(e){return e instanceof Error?e.message:String(e)}async function ABn({sshUrl:e,httpsUrl:t,targetDir:n,extraArgs:r=[]}){let i;for(let o of[{url:e,env:Oal},{url:t,env:Gyo}])try{return await Uyo("git",["clone","--depth","1",...r,o.url,n],{env:o.env}),{success:!0}}catch(s){i=s,Mal(n)&&Qal(n,{recursive:!0,force:!0})}return{success:!1,error:Vyo(i)}}function Lyo(e,t){return Uyo("git",e,{cwd:t,env:Gyo})}async function Wyo(e,t){try{return await Lyo(["fetch","--depth","1","origin",t],e),await Lyo(["checkout","FETCH_HEAD"],e),{success:!0}}catch(n){return{success:!1,error:Vyo(n)}}}var Uyo,Oal,Gyo,Yyo=C(()=>{"use strict";Uyo=Fal(Dal),Oal={...process.env,GIT_TERMINAL_PROMPT:"0",GIT_SSH_COMMAND:"ssh -o BatchMode=yes"},Gyo={...process.env,GIT_TERMINAL_PROMPT:"0"}});import{existsSync as Pal,readFileSync as Lal}from"node:fs";import{join as wEe}from"node:path";function Hyo(e){for(let t of Zyo)if(Pal(wEe(e,t)))return!0;return!1}function Q6(e){let t=Ual(e,zyo);return t.manifest||t.diagnostics.length>0?t:{diagnostics:[`no marketplace manifest found (looked for ${zyo.join(", ")})`]}}function Ual(e,t){let n=[];for(let r of t){let i=wEe(e,r),o;try{o=Lal(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 Zyo,zyo,Xyo,kbt=C(()=>{"use strict";Zyo=[wEe(".augment-plugin","plugin.json"),wEe(".claude-plugin","plugin.json")],zyo=[wEe(".augment-plugin","marketplace.json"),wEe(".claude-plugin","marketplace.json")];Xyo=`no plugin manifest found (looked for ${Zyo.join(", ")})`});import{execFile as Gal}from"node:child_process";import{existsSync as eG,mkdirSync as $yo,readdirSync as Val,renameSync as Wal,rmSync as Yal,statSync as zal}from"node:fs";import{dirname as Zal,isAbsolute as Kyo,join as tG,relative as jyo,resolve as hBn}from"node:path";import{promisify as Hal}from"node:util";function ebo(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 Jyo(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 Jal(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 $al(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 Kal(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 jal(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 EBn(e){if(!e||typeof e!="object")return null;let t=e,n=nO(t.sha)??nO(t.ref);switch(t.source){case"github":return $al(t,n);case"url":return Kal(t,n);case"git-subdir":return jal(t,n);default:return null}}function tbo(e,t,n){let r=ebo(t);if(!r)return;let i=tG(e,qyo,r);if(!eG(tG(i,".git")))return;if(!n)return i;let o=hBn(i,n),s=jyo(i,o);if(!(s.startsWith("..")||Kyo(s)))return eG(o)?o:void 0}async function qal(e,t){let n=typeof t.name=="string"?t.name:"",r=EBn(t.source);if(!r)return;let i=ebo(n);if(!i)return{name:n,status:"failed",error:"invalid plugin cache name"};let o=tG(e,qyo,i);if(eG(tG(o,".git")))return{name:n,status:"skipped"};let s=Zal(o);eG(s)||$yo(s,{recursive:!0});let{sshUrl:a,httpsUrl:c}=gBn(r.url),l=r.kind==="git-subdir",u=await ABn({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 Wyo(o,r.ref);if(!d.success)return{name:n,status:"failed",error:d.error}}if(l&&r.kind==="git-subdir")try{await Xal("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 nbo(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 qal(e,i);o&&r.push(o)}return r}function ecl(e){try{return zal(e).isDirectory()}catch{return!1}}function tcl(e,t){let n=jyo(hBn(e),hBn(t));return n!==""&&!n.startsWith("..")&&!Kyo(n)}async function KFe(e,t){let n=Jal(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)||$yo(e,{recursive:!0});let s=Jyo(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}=gBn(`https://github.com/${r}/${i}`),u=await ABn({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"?Jyo(d.name):null;if(m&&m!==s){let f=tG(e,m);if(!eG(f))try{Wal(a,f),p=m}catch{}}return await nbo(tG(e,p)),{success:!0,marketplaceId:p}}function jFe(e,t){let n=tG(e,t);if(!tcl(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 Yal(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 rbo(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(!ecl(o))continue;(await nbo(o)).some(a=>a.status==="cloned")&&(t=!0)}}return t}var Xal,qyo,Dbt=C(()=>{"use strict";Yyo();kbt();Xal=Hal(Gal),qyo=".plugin-cache"});import{readFileSync as ncl}from"node:fs";import{join as rcl}from"node:path";function ibo(e){let t=rcl(e,"hooks","hooks.json"),n;try{n=ncl(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 obo=C(()=>{"use strict";zq()});import{existsSync as icl,lstatSync as ocl,readdirSync as lbo,statSync as scl}from"node:fs";import{basename as sbo,isAbsolute as abo,join as qFe,relative as acl,resolve as ubo}from"node:path";function yBn(e,t){let n=[],r=[],i=[],o=new Map;for(let s of e)for(let a of ccl(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 ccl(e,t,n){let r=[];if(!icl(e))return r;let i=Q6(e);if(!i.manifest)for(let s of i.diagnostics)s.startsWith("no marketplace manifest found")||n.push(`[${sbo(e)}] ${s}`);if(i.manifest)return cbo(e,sbo(e),t,r,n),r;let o;try{o=lbo(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)&&cbo(a,s,t,r,n)}return r}function cbo(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=gcl(o.manifest.name,t),a=fcl(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=lcl(l,e,a,s,n);u&&r.push(u)}for(let l of o.diagnostics)i.push(`[${s}] ${l}`)}function lcl(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=mcl(e.source,o,t,n,c);return l?dcl(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 ucl(e,t){let n=[],r;try{r=lbo(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(!ocl(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 dcl(e,t,n,r,i,o){Hyo(r)||o.push(Xyo);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?ucl(c,o):void 0,m=ibo(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 pcl(e,t,n,r){let i=EBn(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=tbo(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 mcl(e,t,n,r,i){if(typeof e!="string"){if(e&&typeof e=="object")return pcl(e,t,n,i);i.push("plugin entry has no source field; skipping");return}if(abo(e)){i.push(`absolute source "${e}" is not allowed; skipping`);return}let o=e.startsWith("./")?n:r,s=ubo(o,e),a=acl(n,s);if(a.startsWith("..")||abo(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 fcl(e,t){return typeof t!="string"||t.length===0?e:ubo(e,t)}function gcl(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 scl(e).isDirectory()}catch{return!1}}var Mbt=C(()=>{"use strict";Dbt();obo();kbt()});import{readFileSync as Acl}from"node:fs";import{basename as hcl}from"node:path";function Qbt(e){return typeof e=="string"?e:void 0}function ycl(e){if(typeof e=="string")return pbo.includes(e)?e:void 0}function bcl(e){return typeof e=="number"&&e>=0?e:void 0}function fbo(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 gbo(e,t){return e==null?[...t]:fbo(e)??[]}function Ccl(e){return fbo(e)}function Icl(e){if(e==="user"||e==="project"||e==="local")return e}function dbo(e){if(e==null||e===!0)return!0;if(e===!1||e==="none")return!1;let t=gbo(e,[]);return t.length>0?t:!1}function Scl(e,t){let n=REe(hcl(e,".md")),r;try{r=Acl(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=ycl(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: ${pbo.join(", ")}); falling back to the model's default`);let l={name:n,displayName:Qbt(i.display_name),description:Qbt(i.description)??n,builtinToolNames:gbo(i.tools,Ecl),disallowedTools:Ccl(i.disallowed_tools),extensions:dbo(i.extensions??i.inherit_extensions),skills:dbo(i.skills??i.inherit_skills),model:Qbt(i.model),thinking:a,maxTurns:bcl(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:Icl(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 Abo(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 Ecl,pbo,mbo,hbo=C(()=>{"use strict";Sl();Mbt();Ecl=["read","bash","edit","write","grep","find","ls"],pbo=["off","minimal","low","medium","high","xhigh"],mbo=["general-purpose","explore","plan"]});import{lstatSync as _cl,readFileSync as vcl,realpathSync as Ebo}from"node:fs";import{isAbsolute as xcl,join as wcl,relative as Rcl}from"node:path";function TEe(e,t){let n=e;for(let r of Tcl){let i=`\${${r}}`;n.includes(i)&&(n=n.split(i).join(t))}return n}function bBn(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function ybo(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 Bcl(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 Ncl(e,t){let n=Bcl(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:ybo(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:ybo(t.env),cwd:t.cwd,timeoutMs:t.timeoutMs,useShellInterpolation:o}}function bbo(e,t){if(!e)return;let n={};for(let[r,i]of Object.entries(e))n[r]=TEe(i,t);return n}function kcl(e,t){return e.type==="stdio"?{...e,command:TEe(e.command,t),args:e.args.map(n=>TEe(n,t)),env:bbo(e.env,t),cwd:e.cwd?TEe(e.cwd,t):void 0}:{...e,url:TEe(e.url,t),headers:bbo(e.headers,t),cwd:e.cwd?TEe(e.cwd,t):void 0}}function Dcl(e,t){let n=wcl(e,".mcp.json"),r;try{r=_cl(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=Ebo(e),o=Ebo(n),s=Rcl(i,o);if(s.startsWith("..")||xcl(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 vcl(n,"utf-8")}catch(i){t.push(`failed to read .mcp.json: ${i.message}`);return}}function Cbo(e){let t=[],n=Dcl(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(!bBn(r))return t.push(".mcp.json must be a JSON object"),{servers:[],diagnostics:t};let i=r.mcpServers;if(!bBn(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(!bBn(a)){t.push(`MCP server "${c}" must be a JSON object`);continue}try{let l=Ncl(c,a);o.push(kcl(l,e.root))}catch(l){t.push(l instanceof Error?l.message:String(l))}}return{servers:o,diagnostics:t}}var Tcl,Ibo,Sbo=C(()=>{"use strict";Mbt();Tcl=["CLAUDE_PLUGIN_ROOT","AUGMENT_PLUGIN_ROOT","AUGGIE_PLUGIN_ROOT"];Ibo="hermes:mcp:register-server-source"});function _bo(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 vbo=C(()=>{"use strict";Sl()});var xbo,wbo=C(()=>{"use strict";xbo="hermes:subagents:register-agent-source"});import{join as Iee,resolve as Mcl}from"node:path";import{existsSync as Qcl,readdirSync as Fcl,statSync as Ocl}from"node:fs";function Lcl(){return globalThis[Rbo]??{}}function Ucl(e){globalThis[Rbo]=e}function SBn(e){Zk=[],IBn=[],Fbt=[],CBn=[],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(xbo,w=>{i=w.register}),e.events.on(Ibo,w=>{a=w.registerServerSource}),e.events.on(Pcl,w=>{Ucl(w?.scopes??{})});function c(w,R,N=[]){let Q=Lcl(),{enabled:F,diagnostics:D}=_bo(w,R,Q),k=[...new Set(N.map(Ae=>Mcl(w,Ae)))],W=yBn(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=yBn([...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,IBn=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}=Abo(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}mbo.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}=Cbo(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)}CBn=w}function f(){if(!a)return;a({source:"plugin",getServers:()=>CBn,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=Gcl(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");rbo([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 Gcl(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(!Qcl(t))return[];let n;try{n=Fcl(t)}catch{return[]}let r=[];for(let i of n){let o=Iee(t,i);try{if(!Ocl(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 IBn)e.push({type:"warning",message:t});for(let t of tOe)e.push(t);return e}var nx,Pcl,Rbo,Zk,IBn,Fbt,CBn,tOe,BEe=C(()=>{"use strict";Sl();zq();sr();hbo();Mbt();Dbt();kbt();Sbo();vbo();wbo();Dbt();nx=Gt.child({prefix:"pi-plugins"}),Pcl="augment:vfs-scopes",Rbo=Symbol.for("__pi_plugins_vfs_scopes__");Zk=[],IBn=[],Fbt=[],CBn=[],tOe=[]});function _Bn(){let e=globalThis;return e[Tbo]??=new Map,e[Tbo]}function Bbo(){return[..._Bn().values()]}function Nbo(e){return _Bn().get(e)}function kbo(e){let t=_Bn();t.clear();for(let n of e)t.set(n.name,n)}var Tbo,vBn=C(()=>{"use strict";Tbo=Symbol.for("__hermes_cloud_tool_registry__")});function Wcl(e){return{...e,execute:(t,n,r,i,o)=>{let s=Nbo(e.name);if(!s)throw new Error(`Cloud tool "${e.name}" is unavailable`);return s.execute(t,n,r,i,o)}}}function xBn(e){for(let t of Bbo())e.registerTool(Wcl(t))}var Dbo=C(()=>{"use strict";vBn()});function Pbt(){let e=globalThis;return e[Mbo]??=new Map,e[Mbo]}function Fbo(){return[...Pbt().values()]}function Obo(e){return Pbt().get(e)}function O6(e){Pbt().set(e.name,e)}function Pbo(e,t){let n=Pbt();(t===void 0||n.get(e)===t)&&n.delete(e)}function Lbo(e){Reflect.set(e,Qbo,!0)}function Lbt(e){return Reflect.get(e,Qbo)===!0}var Mbo,Qbo,See=C(()=>{"use strict";Mbo=Symbol.for("__hermes_mcp_tool_registry__"),Qbo=Symbol.for("__hermes_mcp_extension_factory__")});function Ycl(e){return{...e,execute:(t,n,r,i,o)=>{let s=Obo(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 Fbo())e.registerTool(Ycl(t))}var Ubo=C(()=>{"use strict";See()});import{existsSync as zcl}from"node:fs";import{homedir as rOe}from"node:os";import{dirname as wBn,join as rT,resolve as Vbo}from"node:path";import{fileURLToPath as Zcl}from"node:url";function Wbo(){let e=process.env.PI_PACKAGE_DIR;if(e)return e==="~"?rOe():e.startsWith("~/")?rOe()+e.slice(1):e;let t=Gbo;for(;t!==wBn(t);){if(zcl(rT(t,"package.json")))return t;t=wBn(t)}return Gbo}function Gbt(){return Vbo(rT(Wbo(),"docs"))}function Vbt(){return Vbo(rT(Wbo(),"CHANGELOG.md"))}function Hbo(e){return`${process.env.PI_SHARE_VIEWER_URL||Jcl}#${e}`}function Xbo(e){return e==="~"?rOe():e.startsWith("~/")?rOe()+e.slice(1):e}function iO(){let e=process.env.AUGMENT_CACHE_DIR;return e?Xbo(e):rT(rOe(),".augment")}function gi(){let e=process.env[RBn];return e?Xbo(e):iO()}function sOe(){return rT(gi(),"themes")}function Jbo(){return rT(gi(),"models.json")}function $bo(){return rT(gi(),"auth.json")}function Kbo(){return rT(gi(),"settings.json")}function aOe(){return iO()}function NEe(){return rT(gi(),"bin")}function jbo(){return rT(gi(),"prompts")}function qbo(){return rT(gi(),iOe)}function eCo(){return rT(gi(),`${is}-debug.log`)}var Hcl,Gbo,is,Ba,iOe,oOe,Ybo,Xcl,Vl,zbo,Zbo,RBn,Jcl,Wc=C(()=>{"use strict";tan();Hcl=Zcl(import.meta.url),Gbo=wBn(Hcl);is=V4.piConfig?.name||"auggie",Ba=V4.piConfig?.configDir||".augment",iOe="sessions-v2",oOe=is,Ybo="Auggie Coding Agent",Xcl="1.2.0-prerelease.202609150952",Vl=Xcl??V4.version,zbo="19b9405b262ab29af23a836925729de7d90d65a6",Zbo="2026-09-15T16:52:40Z",RBn=`${is.toUpperCase()}_CODING_AGENT_DIR`,Jcl="https://pi.dev/session/"});var nCo,tCo=C(()=>{nCo={$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 iCo,rCo=C(()=>{iCo={$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 qcl(){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 kBn(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 TBn(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 ell(e){let t=Number.POSITIVE_INFINITY,n=0;for(let[r,i]of cCo.entries()){let o=Math.abs(e-i);o<t&&(t=o,n=r)}return n}function sCo(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 tll(e,t,n){let r=TBn(e),i=TBn(t),o=TBn(n),s=Wbt[r]??0,a=Wbt[i]??0,c=Wbt[o]??0,l=16+36*r+6*i+o,u=sCo(e,t,n,s,a,c),d=Math.round(.299*e+.587*t+.114*n),p=ell(d),m=cCo[p]??0,f=232+p,g=sCo(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 lCo(e){let{r:t,g:n,b:r}=kBn(e);return tll(t,n,r)}function nll(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}=kBn(e);return`\x1B[38;2;${r};${i};${o}m`}return`\x1B[38;5;${lCo(e)}m`}throw new Error(`Invalid color value: ${e}`)}function rll(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}=kBn(e);return`\x1B[48;2;${r};${i};${o}m`}return`\x1B[48;5;${lCo(e)}m`}throw new Error(`Invalid color value: ${e}`)}function DBn(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 DBn(r,t,n)}function uCo(e,t={}){let n={};for(let[r,i]of Object.entries(e))n[r]=DBn(i,t);return n}function zbt(){let e=new Set(Object.keys(MBn)),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 dCo(){let e=sOe(),t=[];for(let n of Object.keys(MBn))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 ill(e,t){if(!oCo.Check(t)){let n=Array.from(oCo.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}":
6711
6711
  `;throw r.length>0&&(o+=`
6712
6712
  Missing required color tokens:
6713
6713
  `,o+=r.map(s=>` - ${s}`).join(`
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@augmentcode/auggie",
3
- "version": "1.2.0-prerelease.202609150921",
3
+ "version": "1.2.0-prerelease.202609150952",
4
4
  "description": "Coding agent CLI with read, bash, edit, write tools and session management",
5
5
  "type": "module",
6
6
  "bin": {