@mcp-com-ai/hapi 1.0.1-beta.260914 → 1.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +9 -3
- package/dist/bin.js +4 -3
- package/dist/core/index.js +36 -35
- package/dist/index.js +4 -3
- package/dist/skills/hapi-agent-prompt-generator/SKILL.md +128 -0
- package/dist/skills/hapi-apps-dump/SKILL.md +187 -0
- package/package.json +19 -8
package/README.md
CHANGED
|
@@ -29,7 +29,7 @@ Deploying & Registering MCP Servers
|
|
|
29
29
|
|
|
30
30
|
---
|
|
31
31
|
|
|
32
|
-
# HAPI CLI 
|
|
33
33
|
|
|
34
34
|
`@mcp-com-ai/hapi` provides the `hapi` command. Install it with the document
|
|
35
35
|
plugin(s) you plan to use; HAPI detects whether `--specs` points to an OpenAPI
|
|
@@ -44,10 +44,16 @@ bun add -g \
|
|
|
44
44
|
@mcp-com-ai/plugin-arazzo@1.0.1-beta.260912
|
|
45
45
|
```
|
|
46
46
|
|
|
47
|
-
|
|
47
|
+
> **Note:** The `--headless` flag runs the MCP server with a backend up and running (Brownfield) without the need to code (and duplicate) the business logic.
|
|
48
48
|
|
|
49
49
|
```sh
|
|
50
|
-
|
|
50
|
+
hapi serve --specs ./my-api.yaml --headless --port 3000
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
Scaffolding and serving a new project (Greenfield development)
|
|
54
|
+
|
|
55
|
+
```sh
|
|
56
|
+
# scaffolding a new project (new code/Greenfield) - ONLY if you want to implement the API code from scratch
|
|
51
57
|
hapi init --specs ./my-api.yaml
|
|
52
58
|
# Serve the API, both as MCP and RESTful API
|
|
53
59
|
hapi serve --specs ./my-api.yaml --mcp --port 3000
|
package/dist/bin.js
CHANGED
|
@@ -142,7 +142,8 @@ ${t.comment}`:t.comment}this.doc.range[2]=t.offset;break}default:this.errors.pus
|
|
|
142
142
|
`)}}async function un(e,t,s){if(await Bun.spawn([e,...t],{cwd:s,stdout:"inherit",stderr:"inherit",env:{...process.env,BUN_BE_BUN:"1"}}).exited)throw Error(`Plugin package operation failed: ${t.join(" ")}`)}async function Wr(e){let t=[];for(let s of e){let n=I.resolve(s);try{if(!(await Vr(n)).isDirectory()){t.push(s);continue}let r=I.join(n,"manifest.json");if(await Bun.file(r).exists())continue;else t.push(n)}catch(i){if(i instanceof Error&&i.message.includes("Release manifest"))throw i;t.push(s)}}return t}async function Gr(e){let t=new Map,s=new Set;for(let r of e){let o=I.resolve(r),a=I.join(o,"manifest.json");if(!await Bun.file(a).exists())continue;let l=await Bun.file(a).json();for(let c of l.packages??[]){if(!c.name||!c.file||!be(c.name))continue;t.set(c.name,{file:I.join(o,c.file),internalDependencies:c.internalDependencies??{}})}for(let c of l.managedPlugins??[])if(be(c))s.add(c);if(s.size===0)throw Error(`Release manifest does not declare managed plugins: ${o}`)}let n=new Map,i=[...s];while(i.length>0){let r=i.pop();if(!r||n.has(r))continue;let o=t.get(r);if(!o)throw Error(`Release manifest is missing required package ${r}.`);n.set(r,`file:${o.file}`),i.push(...Object.keys(o.internalDependencies))}return n}async function Qr(e,t){let s=JSON.parse(await Ve(e,"utf8")),n=Object.fromEntries(t);await rn(e,`${JSON.stringify({...s,dependencies:{...s.dependencies??{},...n},overrides:{...s.overrides??{},...n}},null,2)}
|
|
143
143
|
`)}async function sn(e){let t=JSON.parse(await Ve(e,"utf8"));return Object.keys(t.dependencies??{}).filter(be)}function Xr(e){let t=e.exports&&typeof e.exports==="object"&&!Array.isArray(e.exports)?e.exports["."]??e.exports:e.exports;return Ye(t)??e.module??e.main}function Ye(e){if(typeof e==="string")return e;if(!e||typeof e!=="object"||Array.isArray(e))return;let t=e;return Ye(t.bun)??Ye(t.import)??Ye(t.default)}function Zr(e){return/\.(?:c?m?js)$/i.test(e)&&!/(?:^|\/)src(?:\/|$)/.test(e)}function nn(e,t){let s=I.relative(t,e);return s===""||!s.startsWith(`..${I.sep}`)&&s!==".."&&!I.isAbsolute(s)}var to=["@mcp-com-ai/plugin-openapi","@mcp-com-ai/plugin-arazzo","@mcp-com-ai/plugin-cloudflare","@mcp-com-ai/enterprise-plugin-auth","@mcp-com-ai/enterprise-plugin-licensing","@mcp-com-ai/plugin-otel"];async function pn(e={}){let t=e.warn??(()=>{}),s=new Set(e.blocklist??[]),n=[],i=new Set,r=[];for(let o of e.bundledPlugins??[])r.push({packageName:o.name,source:"bundled",plugin:o});for(let o of e.workspacePackages??[])r.push({packageName:o,source:"workspace"});for(let o of to)r.push({packageName:o,source:"installed"});for(let o of e.configuredPackages??[])r.push({packageName:o,source:"installed"});for(let{packageName:o,source:a,plugin:l}of r){if(i.has(o))continue;if(i.add(o),s.has(o))continue;let c=!1;try{let d=a,u;if(!l)try{u=await import(o)}catch(g){if(!dn(g))throw g;let p=await(e.resolveManagedEntrypoint??an)(o);if(!p)throw g;c=!0,u=await import(p),d="managed"}let f=l??(u?.plugin??u?.default);if(!f){t(`Plugin '${o}' loaded but did not export a plugin definition`);continue}if(f.compatibility?.cliApiVersion!==fn){t(`Plugin '${o}' declares cliApiVersion=${f.compatibility?.cliApiVersion}; CLI expects ${fn}. Skipping.`);continue}let m=f.compatibility.core;if(m&&!eo(m.version,m.range)){t(`Plugin '${o}' resolved core ${m.version}, which does not satisfy its declared range ${m.range}. Skipping.`);continue}n.push({plugin:f,packageName:o,source:d})}catch(d){let u=d instanceof Error?d.message:String(d);if(c||!dn(d))t(`Plugin '${o}' failed to load: ${u}`)}}return n}function dn(e){if(!e||typeof e!=="object")return!1;let t=e.code;if(t==="ERR_MODULE_NOT_FOUND"||t==="MODULE_NOT_FOUND")return!0;let s=e.message??"";return/Cannot find (module|package)/i.test(s)}import{parseArgs as so,renderCommandHelp as Bt}from"@mcp-com-ai/plugin-sdk";var He=[{command:"cloudflare",packageName:"@mcp-com-ai/plugin-cloudflare",description:"Deploy HAPI MCP servers to Cloudflare Workers (deploy, login, status).",installHint:"bun add -g @mcp-com-ai/plugin-cloudflare"},{command:"openapi",packageName:"@mcp-com-ai/plugin-openapi",description:"OpenAPI-driven tooling (init, lint, list, serve).",installHint:"bun add -g @mcp-com-ai/plugin-openapi",documentRootField:"openapi"},{command:"arazzo",packageName:"@mcp-com-ai/plugin-arazzo",description:"Arazzo workflow validation, serving, and execution.",installHint:"bun add -g @mcp-com-ai/plugin-arazzo",documentRootField:"arazzo"},{command:"workflows",packageName:"@mcp-com-ai/plugin-arazzo",description:"Alias for the Arazzo workflow command group.",installHint:"bun add -g @mcp-com-ai/plugin-arazzo",documentRootField:"arazzo"},{command:"auth",packageName:"@mcp-com-ai/enterprise-plugin-auth",description:"OAuth/Security handler configuration for `hapi serve` (enterprise tier).",installHint:"Contact La Rebelion Labs for enterprise access."},{command:"otel",packageName:"@mcp-com-ai/plugin-otel",description:"OpenTelemetry / PostHog telemetry collection for HAPI commands.",installHint:"bun add -g @mcp-com-ai/plugin-otel"},{command:"license",packageName:"@mcp-com-ai/enterprise-plugin-licensing",description:"Enterprise licensing (activation, status, import). Part of the enterprise tier.",installHint:"Contact La Rebelion Labs for enterprise access, then run `hapi plugins install <private-release-or-package>`."}];function hn(e){return He.find((t)=>t.command===e)}function mn(e){return He.find((t)=>t.documentRootField===e)}var no=new Set(["--help","-h","help"]);async function gn(e,t,s){if(t.length===0){let o=e.get("help");if(o?.run){let a=await o.run({positionals:[],options:{},rest:[]},s);return typeof a==="number"?a:0}return s.stdout.write(`Usage: hapi <command> [subcommand] [options]
|
|
144
144
|
`),0}let[n,...i]=t;if(!n)return 0;if(n==="--help"||n==="-h"){let o=e.get("help");if(o?.run){let a=await o.run({positionals:[],options:{},rest:[]},s);return typeof a==="number"?a:0}}if(n==="--version"||n==="-v"){let o=e.get("version");if(o?.run){let a=await o.run({positionals:[],options:{},rest:[]},s);return typeof a==="number"?a:0}}let r=e.get(n);if(!r)return io(n,s);return jt(e,r,i,s,[r.name])}async function jt(e,t,s,n,i){if(s.length>0&&no.has(s[0]))return Bt(t,n,i.slice(0,-1)),0;let r=s[0];if(t.subcommands&&t.subcommands.length>0&&r&&!r.startsWith("-")){let a=t.subcommands.find((l)=>l.name===r||l.aliases?.includes(r));if(a)return jt(e,a,s.slice(1),n,[...i,a.name]);if(!t.run)return n.stderr.write(`Unknown subcommand: ${i.join(" ")} ${r}
|
|
145
|
-
`),Bt(t,n,i.slice(0,-1)),1}if(!t.run)return Bt(t,n,i.slice(0,-1)),0;if(t.name==="serve"&&i.length>1){let a=e.get("serve");if(a?.source==="core")return jt(e,a,s,n,[a.name])}let o=so(s,t.options??[]);
|
|
145
|
+
`),Bt(t,n,i.slice(0,-1)),1}if(!t.run)return Bt(t,n,i.slice(0,-1)),0;if(t.name==="serve"&&i.length>1){let a=e.get("serve");if(a?.source==="core")return jt(e,a,s,n,[a.name])}let o=so(s,t.options??[]);if(o.unknownOptions?.length)n.stderr.write(`\u26A0\uFE0F Unrecognized option(s): ${o.unknownOptions.map((a)=>`--${a}`).join(", ")} \u2014 not applied. Check for a typo (see --help for valid options).
|
|
146
|
+
`);try{let a=await t.run(o,n);return typeof a==="number"?a:Number(process.exitCode??0)}catch(a){let{printCliError:l}=await import("@mcp-com-ai/shared-utils");return l(`\u274C ${i.join(" ")} failed`,a),1}}function io(e,t){let s=hn(e);if(s)return t.stderr.write(`
|
|
146
147
|
Command "${e}" is provided by ${s.packageName}, which is not installed.
|
|
147
148
|
`),t.stderr.write(`
|
|
148
149
|
${s.description}
|
|
@@ -175,7 +176,7 @@ Examples:
|
|
|
175
176
|
`),r(`Is the HAPI CLI helpful?
|
|
176
177
|
Don't forget to star the project on GitHub: https://github.com/mcp-com-ai/hapimcp
|
|
177
178
|
|
|
178
|
-
`),0}}}import{HAPI_CLI_API_VERSION as oo}from"@mcp-com-ai/plugin-sdk";var bn="1.
|
|
179
|
+
`),0}}}import{HAPI_CLI_API_VERSION as oo}from"@mcp-com-ai/plugin-sdk";var bn="1.1.0";var Je=bn;var wn={name:"version",aliases:["--version","-v"],description:"Show the installed CLI version",run:async(e,t)=>(t.stdout.write(`hapi ${Je}
|
|
179
180
|
`),t.stdout.write(`plugin-contract v${oo}
|
|
180
181
|
`),0)};import{hasFileSystemAccess as ao,loadGlobalConfig as Sn,saveGlobalConfig as vn}from"@mcp-com-ai/shared-utils";function kn(e){return{name:"plugins",description:"List loaded plugins and discover installable ones",subcommands:[{name:"list",description:"List the plugins currently loaded by the CLI",async run(t,s){let n=e();if(n.length===0)return s.stdout.write("No plugins loaded. Run `hapi plugins available` to see what you can install.\n"),0;s.stdout.write(`
|
|
181
182
|
Loaded plugins:
|
|
@@ -219,7 +220,7 @@ Loaded plugins: ${a.length}
|
|
|
219
220
|
`);let c=l.plugin.compatibility.core;if(c){let d=uo(c.version,c.range);if(n(` core: ${c.version} ${d?"satisfies":"does not satisfy"} ${c.range}
|
|
220
221
|
`),!d)r++}}if(a.length===0)n(` \u2022 no plugins loaded
|
|
221
222
|
`);return n(`
|
|
222
|
-
`),r===0?0:1}}}import{existsSync as Mr}from"fs";import{resolve as Zs}from"path";import{pathToFileURL as fm}from"url";var Ph=Bs(),Lh=_e(),Eh=Cs(),Qs=De(),qh=ke(),Q=A(),Ih=H(),Th=P(),$h=z(),Mh=W(),Sy=Tt(),xh=zs(),_h=Ws(),Dh=Gs(),_t=Tr(),$r=Se();var Rh=Ph.Composer,Bh=Lh.Document,jh=Eh.Schema,{YAMLError:Kh,YAMLParseError:Fh,YAMLWarning:Uh}=Qs,Yh=qh.Alias,{isAlias:Vh,isCollection:Hh,isDocument:Jh,isMap:zh,isNode:Wh,isPair:Gh,isScalar:Qh,isSeq:Xh}=Q,Zh=Ih.Pair,em=Th.Scalar,tm=$h.YAMLMap,sm=Mh.YAMLSeq;var nm=xh.Lexer,im=_h.LineCounter,rm=Dh.Parser,{parse:Xs,parseAllDocuments:om,parseDocument:am,stringify:lm}=_t,{visit:cm,visitAsync:um}=$r;import{DEFAULT_DOCUMENT_SOURCE_POLICY as Dt,assertRemoteDocumentUrl as dm,redactDocumentUrl as pm}from"@mcp-com-ai/plugin-sdk";async function xr(e,t){let s=e.trim();if(!s)return;let n=bm(s);if(n?.protocol==="http:"||n?.protocol==="https:")return gm(s,n,t);if(n&&n.protocol!=="file:"&&n.protocol!=="path:")throw Error(`Unsupported document source scheme: ${n.protocol}`);let i=n?.protocol==="file:"?Bun.fileURLToPath(n):hm(n?.protocol==="path:"?wm(n):s,t);if(!i)return;return mm(s,i,t.maxBytes??Dt.maxBytes)}function hm(e,t){let s=Zs(t.cwd,e);if(Mr(s))return s;let n=Zs(t.hapiHome,"specs");for(let i of["",".json",".yaml",".yml"]){let r=Zs(n,`${e}${i}`);if(Mr(r))return r}return}async function mm(e,t,s){let n=Bun.file(t);if(n.size>s)throw Error(`Document source exceeds ${s} bytes: ${t}`);let i=await n.text();Dr(i,s,t);let r=fm(t).href;return Rr({identifier:e,canonicalUri:r,baseUri:new URL(".",r).href,raw:i,document:_r(i,t),remote:!1})}async function gm(e,t,s){let n=s.fetchImpl??fetch,i=s.maxBytes??Dt.maxBytes,r=new AbortController,o=setTimeout(()=>r.abort(),s.timeoutMs??Dt.timeoutMs),a=t;try{for(let l=0;l<=Dt.maxRedirects;l++){dm(a);let c=await n(a,{redirect:"manual",signal:r.signal});if(ym(c.status)){let f=c.headers.get("location");if(!f)throw Error(`Redirect from ${re(a)} has no Location header`);a=new URL(f,a);continue}if(!c.ok)throw Error(`Unable to load ${re(a)}: HTTP ${c.status}`);let d=Number(c.headers.get("content-length"));if(Number.isFinite(d)&&d>i)throw Error(`Document source exceeds ${i} bytes: ${re(a)}`);let u=await c.text();return Dr(u,i,re(a)),Rr({identifier:e,canonicalUri:a.href,baseUri:new URL(".",a).href,raw:u,document:_r(u,re(a)),remote:!0})}throw Error(`Too many redirects while loading ${re(t)}`)}catch(l){if(r.signal.aborted)throw Error(`Timed out loading ${re(a)}`);throw l}finally{clearTimeout(o)}}function _r(e,t){try{let s=Xs(e);if(!s||typeof s!=="object"||Array.isArray(s))throw Error("document root must be an object");return s}catch(s){throw Error(`Unable to parse ${t}: ${s instanceof Error?s.message:String(s)}`)}}function Dr(e,t,s){if(new TextEncoder().encode(e).byteLength>t)throw Error(`Document source exceeds ${t} bytes: ${s}`)}function Rr(e){return Object.freeze(e)}function ym(e){return[301,302,303,307,308].includes(e)}function bm(e){try{return new URL(e)}catch{return}}function wm(e){let t=decodeURIComponent(e.pathname);return e.hostname?`${e.hostname}${t}`:t}function re(e){return pm(e)}function jr(e){let t=()=>e().flatMap((s)=>s.plugin.serveProviders??[]);return{name:"serve",description:"Serve an OpenAPI or Arazzo document with the matching installed plugin",arguments:[{name:"source",description:"Project name, local JSON/YAML file, or remote document URL",required:!1}],get options(){return vm(t())},async run(s,n){return Sm(t(),s,n)}}}async function Sm(e,t,s){let n=typeof t.options.specs==="string"?t.options.specs:void 0,i=typeof t.options.openapi==="string"?t.options.openapi:void 0;if(n&&i)return s.stderr.write(`Use either --specs or --openapi, not both.
|
|
223
|
+
`),r===0?0:1}}}import{existsSync as Mr}from"fs";import{resolve as Zs}from"path";import{pathToFileURL as fm}from"url";var Ph=Bs(),Lh=_e(),Eh=Cs(),Qs=De(),qh=ke(),Q=A(),Ih=H(),Th=P(),$h=z(),Mh=W(),Sy=Tt(),xh=zs(),_h=Ws(),Dh=Gs(),_t=Tr(),$r=Se();var Rh=Ph.Composer,Bh=Lh.Document,jh=Eh.Schema,{YAMLError:Kh,YAMLParseError:Fh,YAMLWarning:Uh}=Qs,Yh=qh.Alias,{isAlias:Vh,isCollection:Hh,isDocument:Jh,isMap:zh,isNode:Wh,isPair:Gh,isScalar:Qh,isSeq:Xh}=Q,Zh=Ih.Pair,em=Th.Scalar,tm=$h.YAMLMap,sm=Mh.YAMLSeq;var nm=xh.Lexer,im=_h.LineCounter,rm=Dh.Parser,{parse:Xs,parseAllDocuments:om,parseDocument:am,stringify:lm}=_t,{visit:cm,visitAsync:um}=$r;import{DEFAULT_DOCUMENT_SOURCE_POLICY as Dt,assertRemoteDocumentUrl as dm,redactDocumentUrl as pm}from"@mcp-com-ai/plugin-sdk";async function xr(e,t){let s=e.trim();if(!s)return;let n=bm(s);if(n?.protocol==="http:"||n?.protocol==="https:")return gm(s,n,t);if(n&&n.protocol!=="file:"&&n.protocol!=="path:")throw Error(`Unsupported document source scheme: ${n.protocol}`);let i=n?.protocol==="file:"?Bun.fileURLToPath(n):hm(n?.protocol==="path:"?wm(n):s,t);if(!i)return;return mm(s,i,t.maxBytes??Dt.maxBytes)}function hm(e,t){let s=Zs(t.cwd,e);if(Mr(s))return s;let n=Zs(t.hapiHome,"specs");for(let i of["",".json",".yaml",".yml"]){let r=Zs(n,`${e}${i}`);if(Mr(r))return r}return}async function mm(e,t,s){let n=Bun.file(t);if(n.size>s)throw Error(`Document source exceeds ${s} bytes: ${t}`);let i=await n.text();Dr(i,s,t);let r=fm(t).href;return Rr({identifier:e,canonicalUri:r,baseUri:new URL(".",r).href,raw:i,document:_r(i,t),remote:!1})}async function gm(e,t,s){let n=s.fetchImpl??fetch,i=s.maxBytes??Dt.maxBytes,r=new AbortController,o=setTimeout(()=>r.abort(),s.timeoutMs??Dt.timeoutMs),a=t;try{for(let l=0;l<=Dt.maxRedirects;l++){dm(a);let c=await n(a,{redirect:"manual",signal:r.signal});if(ym(c.status)){let f=c.headers.get("location");if(!f)throw Error(`Redirect from ${re(a)} has no Location header`);a=new URL(f,a);continue}if(!c.ok)throw Error(`Unable to load ${re(a)}: HTTP ${c.status}`);let d=Number(c.headers.get("content-length"));if(Number.isFinite(d)&&d>i)throw Error(`Document source exceeds ${i} bytes: ${re(a)}`);let u=await c.text();return Dr(u,i,re(a)),Rr({identifier:e,canonicalUri:a.href,baseUri:new URL(".",a).href,raw:u,document:_r(u,re(a)),remote:!0})}throw Error(`Too many redirects while loading ${re(t)}`)}catch(l){if(r.signal.aborted)throw Error(`Timed out loading ${re(a)}`);throw l}finally{clearTimeout(o)}}function _r(e,t){try{let s=Xs(e);if(!s||typeof s!=="object"||Array.isArray(s))throw Error("document root must be an object");return s}catch(s){throw Error(`Unable to parse ${t}: ${s instanceof Error?s.message:String(s)}`)}}function Dr(e,t,s){if(new TextEncoder().encode(e).byteLength>t)throw Error(`Document source exceeds ${t} bytes: ${s}`)}function Rr(e){return Object.freeze(e)}function ym(e){return[301,302,303,307,308].includes(e)}function bm(e){try{return new URL(e)}catch{return}}function wm(e){let t=decodeURIComponent(e.pathname);return e.hostname?`${e.hostname}${t}`:t}function re(e){return pm(e)}function jr(e){let t=()=>e().flatMap((s)=>s.plugin.serveProviders??[]);return{name:"serve",description:"Serve an OpenAPI or Arazzo document with the matching installed plugin",arguments:[{name:"source",description:"Project name, local JSON/YAML file, or remote document URL",required:!1}],get options(){return vm(t())},get longHelp(){return t().find((s)=>s.longHelp)?.longHelp},async run(s,n){return Sm(t(),s,n)}}}async function Sm(e,t,s){let n=typeof t.options.specs==="string"?t.options.specs:void 0,i=typeof t.options.openapi==="string"?t.options.openapi:void 0;if(n&&i)return s.stderr.write(`Use either --specs or --openapi, not both.
|
|
223
224
|
`),1;let r=n??i??t.positionals[0]??"",o=await xr(r,{cwd:s.cwd,hapiHome:s.hapiHome});if(!o){let d=e.filter((u)=>u.legacyFallback);if(d.length!==1)return s.stderr.write(`Unable to resolve document source: ${r||"(missing)"}
|
|
224
225
|
`),1;return Br(await d[0].serve({source:o,invocation:t},s))}let a=o.document,l=e.filter((d)=>typeof a[d.rootField]==="string");if(l.length>1)return s.stderr.write(`Ambiguous document ${o.identifier}: multiple root fields matched (${l.map((d)=>d.rootField).join(", ")})
|
|
225
226
|
`),1;if(l.length===0){let d=Object.keys(a).map((u)=>mn(u)).find(Boolean);if(d)return s.stderr.write(`Document type requires ${d.packageName}, which is not installed.
|
package/dist/core/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
var g=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var Fe=import.meta.require;var O=g(function(Pr){var _t=Symbol.for("yaml.alias"),Zs=Symbol.for("yaml.document"),Ue=Symbol.for("yaml.map"),en=Symbol.for("yaml.pair"),xt=Symbol.for("yaml.scalar"),Ye=Symbol.for("yaml.seq"),K=Symbol.for("yaml.node.type"),Nr=(e)=>!!e&&typeof e==="object"&&e[K]===_t,Ar=(e)=>!!e&&typeof e==="object"&&e[K]===Zs,Or=(e)=>!!e&&typeof e==="object"&&e[K]===Ue,
|
|
3
|
-
`)}}M.defaultYaml={explicit:!1,version:"1.2"};M.defaultTags={"!!":"tag:yaml.org,2002:"};Zr.Directives=M});var He=g(function(io){var cn=O(),to=be();function so(e){if(/[\x00-\x19\s,[\]{}]/.test(e)){let s=`Anchor must not contain whitespace or control characters: ${JSON.stringify(e)}`;throw Error(s)}return!0}function un(e){let t=new Set;return to.visit(e,{Value(s,n){if(n.anchor)t.add(n.anchor)}}),t}function fn(e,t){for(let s=1;;++s){let n=`${e}${s}`;if(!t.has(n))return n}}function no(e,t){let s=[],n=new Map,i=null;return{onAnchor:(r)=>{s.push(r),i??(i=un(e));let o=fn(t,i);return i.add(o),o},setAnchors:()=>{for(let r of s){let o=n.get(r);if(typeof o==="object"&&o.anchor&&(cn.isScalar(o.node)||cn.isCollection(o.node)))o.node.anchor=o.anchor;else{let a=Error("Failed to resolve repeated object (this should not happen)");throw a.source=r,a}}},sourceObjects:n}}io.anchorIsValid=so;io.anchorNames=un;io.createNodeAnchors=no;io.findNewAnchor=fn});var Bt=g(function(co){function we(e,t,s,n){if(n&&typeof n==="object")if(Array.isArray(n))for(let i=0,r=n.length;i<r;++i){let o=n[i],a=we(e,n,String(i),o);if(a===void 0)delete n[i];else if(a!==o)n[i]=a}else if(n instanceof Map)for(let i of Array.from(n.keys())){let r=n.get(i),o=we(e,n,i,r);if(o===void 0)n.delete(i);else if(o!==r)n.set(i,o)}else if(n instanceof Set)for(let i of Array.from(n)){let r=we(e,n,i,i);if(r===void 0)n.delete(i);else if(r!==i)n.delete(i),n.add(r)}else for(let[i,r]of Object.entries(n)){let o=we(e,n,i,r);if(o===void 0)delete n[i];else if(o!==r)n[i]=o}return e.call(t,s,n)}co.applyReviver=we});var U=g(function(po){var fo=O();function dn(e,t,s){if(Array.isArray(e))return e.map((n,i)=>dn(n,String(i),s));if(e&&typeof e.toJSON==="function"){if(!s||!fo.hasAnchor(e))return e.toJSON(t,s);let n={aliasCount:0,count:1,res:void 0};s.anchors.set(e,n),s.onCreate=(r)=>{n.res=r,delete s.onCreate};let i=e.toJSON(t,s);if(s.onCreate)s.onCreate(i);return i}if(typeof e==="bigint"&&!s?.keep)return Number(e);return e}po.toJS=dn});var We=g(function(yo){var mo=Bt(),pn=O(),go=U();class hn{constructor(e){Object.defineProperty(this,pn.NODE_TYPE,{value:e})}clone(){let e=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));if(this.range)e.range=this.range.slice();return e}toJS(e,{mapAsMap:t,maxAliasCount:s,onAnchor:n,reviver:i}={}){if(!pn.isDocument(e))throw TypeError("A document argument is required");let r={anchors:new Map,doc:e,keep:!0,mapAsMap:t===!0,mapKeyWarned:!1,maxAliasCount:typeof s==="number"?s:100},o=go.toJS(this,"",r);if(typeof n==="function")for(let{count:a,res:l}of r.anchors.values())n(l,a);return typeof i==="function"?mo.applyReviver(i,{"":o},"",o):o}}yo.NodeBase=hn});var Se=g(function(No){var wo=He(),So=be(),ce=O(),vo=We(),ko=U();class mn extends vo.NodeBase{constructor(e){super(ce.ALIAS);this.source=e,Object.defineProperty(this,"tag",{set(){throw Error("Alias nodes cannot have tags")}})}resolve(e,t){if(t?.maxAliasCount===0)throw ReferenceError("Alias resolution is disabled");let s;if(t?.aliasResolveCache)s=t.aliasResolveCache;else if(s=[],So.visit(e,{Node:(i,r)=>{if(ce.isAlias(r)||ce.hasAnchor(r))s.push(r)}}),t)t.aliasResolveCache=s;let n=void 0;for(let i of s){if(i===this)break;if(i.anchor===this.source)n=i}return n}toJSON(e,t){if(!t)return{source:this.source};let{anchors:s,doc:n,maxAliasCount:i}=t,r=this.resolve(n,t);if(!r){let a=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw ReferenceError(a)}let o=s.get(r);if(!o)ko.toJS(r,null,t),o=s.get(r);if(o?.res===void 0)throw ReferenceError("This should not happen: Alias anchor was not resolved?");if(i>=0){if(o.count+=1,o.aliasCount===0)o.aliasCount=Qe(n,r,s);if(o.count*o.aliasCount>i)throw ReferenceError("Excessive alias count indicates a resource exhaustion attack")}return o.res}toString(e,t,s){let n=`*${this.source}`;if(e){if(wo.anchorIsValid(this.source),e.options.verifyAliasOrder&&!e.anchors.has(this.source)){let i=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw Error(i)}if(e.implicitKey)return`${n} `}return n}}function Qe(e,t,s){if(ce.isAlias(t)){let n=t.resolve(e),i=s&&n&&s.get(n);return i?i.count*i.aliasCount:0}else if(ce.isCollection(t)){let n=0;for(let i of t.items){let r=Qe(e,i,s);if(r>n)n=r}return n}else if(ce.isPair(t)){let n=Qe(e,t.key,s),i=Qe(e,t.value,s);return Math.max(n,i)}return 1}No.Alias=mn});var
|
|
2
|
+
var g=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var Fe=import.meta.require;var O=g(function(Pr){var _t=Symbol.for("yaml.alias"),Zs=Symbol.for("yaml.document"),Ue=Symbol.for("yaml.map"),en=Symbol.for("yaml.pair"),xt=Symbol.for("yaml.scalar"),Ye=Symbol.for("yaml.seq"),K=Symbol.for("yaml.node.type"),Nr=(e)=>!!e&&typeof e==="object"&&e[K]===_t,Ar=(e)=>!!e&&typeof e==="object"&&e[K]===Zs,Or=(e)=>!!e&&typeof e==="object"&&e[K]===Ue,Cr=(e)=>!!e&&typeof e==="object"&&e[K]===en,tn=(e)=>!!e&&typeof e==="object"&&e[K]===xt,Er=(e)=>!!e&&typeof e==="object"&&e[K]===Ye;function sn(e){if(e&&typeof e==="object")switch(e[K]){case Ue:case Ye:return!0}return!1}function qr(e){if(e&&typeof e==="object")switch(e[K]){case _t:case Ue:case xt:case Ye:return!0}return!1}var Lr=(e)=>(tn(e)||sn(e))&&!!e.anchor;Pr.ALIAS=_t;Pr.DOC=Zs;Pr.MAP=Ue;Pr.NODE_TYPE=K;Pr.PAIR=en;Pr.SCALAR=xt;Pr.SEQ=Ye;Pr.hasAnchor=Lr;Pr.isAlias=Nr;Pr.isCollection=sn;Pr.isDocument=Ar;Pr.isMap=Or;Pr.isNode=qr;Pr.isPair=Cr;Pr.isScalar=tn;Pr.isSeq=Er});var be=g(function(Hr){var P=O(),T=Symbol("break visit"),nn=Symbol("skip children"),B=Symbol("remove node");function Ve(e,t){let s=rn(t);if(P.isDocument(e)){if(ae(null,e.contents,s,Object.freeze([e]))===B)e.contents=null}else ae(null,e,s,Object.freeze([]))}Ve.BREAK=T;Ve.SKIP=nn;Ve.REMOVE=B;function ae(e,t,s,n){let i=on(e,t,s,n);if(P.isNode(i)||P.isPair(i))return an(e,n,i),ae(e,i,s,n);if(typeof i!=="symbol"){if(P.isCollection(t)){n=Object.freeze(n.concat(t));for(let r=0;r<t.items.length;++r){let o=ae(r,t.items[r],s,n);if(typeof o==="number")r=o-1;else if(o===T)return T;else if(o===B)t.items.splice(r,1),r-=1}}else if(P.isPair(t)){n=Object.freeze(n.concat(t));let r=ae("key",t.key,s,n);if(r===T)return T;else if(r===B)t.key=null;let o=ae("value",t.value,s,n);if(o===T)return T;else if(o===B)t.value=null}}return i}async function Je(e,t){let s=rn(t);if(P.isDocument(e)){if(await le(null,e.contents,s,Object.freeze([e]))===B)e.contents=null}else await le(null,e,s,Object.freeze([]))}Je.BREAK=T;Je.SKIP=nn;Je.REMOVE=B;async function le(e,t,s,n){let i=await on(e,t,s,n);if(P.isNode(i)||P.isPair(i))return an(e,n,i),le(e,i,s,n);if(typeof i!=="symbol"){if(P.isCollection(t)){n=Object.freeze(n.concat(t));for(let r=0;r<t.items.length;++r){let o=await le(r,t.items[r],s,n);if(typeof o==="number")r=o-1;else if(o===T)return T;else if(o===B)t.items.splice(r,1),r-=1}}else if(P.isPair(t)){n=Object.freeze(n.concat(t));let r=await le("key",t.key,s,n);if(r===T)return T;else if(r===B)t.key=null;let o=await le("value",t.value,s,n);if(o===T)return T;else if(o===B)t.value=null}}return i}function rn(e){if(typeof e==="object"&&(e.Collection||e.Node||e.Value))return Object.assign({Alias:e.Node,Map:e.Node,Scalar:e.Node,Seq:e.Node},e.Value&&{Map:e.Value,Scalar:e.Value,Seq:e.Value},e.Collection&&{Map:e.Collection,Seq:e.Collection},e);return e}function on(e,t,s,n){if(typeof s==="function")return s(e,t,n);if(P.isMap(t))return s.Map?.(e,t,n);if(P.isSeq(t))return s.Seq?.(e,t,n);if(P.isPair(t))return s.Pair?.(e,t,n);if(P.isScalar(t))return s.Scalar?.(e,t,n);if(P.isAlias(t))return s.Alias?.(e,t,n);return}function an(e,t,s){let n=t[t.length-1];if(P.isCollection(n))n.items[e]=s;else if(P.isPair(n))if(e==="key")n.key=s;else n.value=s;else if(P.isDocument(n))n.contents=s;else{let i=P.isAlias(n)?"alias":"scalar";throw Error(`Cannot replace node with ${i} parent`)}}Hr.visit=Ve;Hr.visitAsync=Je});var Dt=g(function(Zr){var ln=O(),zr=be(),Gr={"!":"%21",",":"%2C","[":"%5B","]":"%5D","{":"%7B","}":"%7D"},Xr=(e)=>e.replace(/[!,[\]{}]/g,(t)=>Gr[t]);class M{constructor(e,t){this.docStart=null,this.docEnd=!1,this.yaml=Object.assign({},M.defaultYaml,e),this.tags=Object.assign({},M.defaultTags,t)}clone(){let e=new M(this.yaml,this.tags);return e.docStart=this.docStart,e}atDocument(){let e=new M(this.yaml,this.tags);switch(this.yaml.version){case"1.1":this.atNextDocument=!0;break;case"1.2":this.atNextDocument=!1,this.yaml={explicit:M.defaultYaml.explicit,version:"1.2"},this.tags=Object.assign({},M.defaultTags);break}return e}add(e,t){if(this.atNextDocument)this.yaml={explicit:M.defaultYaml.explicit,version:"1.1"},this.tags=Object.assign({},M.defaultTags),this.atNextDocument=!1;let s=e.trim().split(/[ \t]+/),n=s.shift();switch(n){case"%TAG":{if(s.length!==2){if(t(0,"%TAG directive should contain exactly two parts"),s.length<2)return!1}let[i,r]=s;return this.tags[i]=r,!0}case"%YAML":{if(this.yaml.explicit=!0,s.length!==1)return t(0,"%YAML directive should contain exactly one part"),!1;let[i]=s;if(i==="1.1"||i==="1.2")return this.yaml.version=i,!0;else{let r=/^\d+\.\d+$/.test(i);return t(6,`Unsupported YAML version ${i}`,r),!1}}default:return t(0,`Unknown directive ${n}`,!0),!1}}tagName(e,t){if(e==="!")return"!";if(e[0]!=="!")return t(`Not a valid tag: ${e}`),null;if(e[1]==="<"){let r=e.slice(2,-1);if(r==="!"||r==="!!")return t(`Verbatim tags aren't resolved, so ${e} is invalid.`),null;if(e[e.length-1]!==">")t("Verbatim tags must end with a >");return r}let[,s,n]=e.match(/^(.*!)([^!]*)$/s);if(!n)t(`The ${e} tag has no suffix`);let i=this.tags[s];if(i)try{return i+decodeURIComponent(n)}catch(r){return t(String(r)),null}if(s==="!")return e;return t(`Could not resolve tag: ${e}`),null}tagString(e){for(let[t,s]of Object.entries(this.tags))if(e.startsWith(s))return t+Xr(e.substring(s.length));return e[0]==="!"?e:`!<${e}>`}toString(e){let t=this.yaml.explicit?[`%YAML ${this.yaml.version||"1.2"}`]:[],s=Object.entries(this.tags),n;if(e&&s.length>0&&ln.isNode(e.contents)){let i={};zr.visit(e.contents,(r,o)=>{if(ln.isNode(o)&&o.tag)i[o.tag]=!0}),n=Object.keys(i)}else n=[];for(let[i,r]of s){if(i==="!!"&&r==="tag:yaml.org,2002:")continue;if(!e||n.some((o)=>o.startsWith(r)))t.push(`%TAG ${i} ${r}`)}return t.join(`
|
|
3
|
+
`)}}M.defaultYaml={explicit:!1,version:"1.2"};M.defaultTags={"!!":"tag:yaml.org,2002:"};Zr.Directives=M});var He=g(function(io){var cn=O(),to=be();function so(e){if(/[\x00-\x19\s,[\]{}]/.test(e)){let s=`Anchor must not contain whitespace or control characters: ${JSON.stringify(e)}`;throw Error(s)}return!0}function un(e){let t=new Set;return to.visit(e,{Value(s,n){if(n.anchor)t.add(n.anchor)}}),t}function fn(e,t){for(let s=1;;++s){let n=`${e}${s}`;if(!t.has(n))return n}}function no(e,t){let s=[],n=new Map,i=null;return{onAnchor:(r)=>{s.push(r),i??(i=un(e));let o=fn(t,i);return i.add(o),o},setAnchors:()=>{for(let r of s){let o=n.get(r);if(typeof o==="object"&&o.anchor&&(cn.isScalar(o.node)||cn.isCollection(o.node)))o.node.anchor=o.anchor;else{let a=Error("Failed to resolve repeated object (this should not happen)");throw a.source=r,a}}},sourceObjects:n}}io.anchorIsValid=so;io.anchorNames=un;io.createNodeAnchors=no;io.findNewAnchor=fn});var Bt=g(function(co){function we(e,t,s,n){if(n&&typeof n==="object")if(Array.isArray(n))for(let i=0,r=n.length;i<r;++i){let o=n[i],a=we(e,n,String(i),o);if(a===void 0)delete n[i];else if(a!==o)n[i]=a}else if(n instanceof Map)for(let i of Array.from(n.keys())){let r=n.get(i),o=we(e,n,i,r);if(o===void 0)n.delete(i);else if(o!==r)n.set(i,o)}else if(n instanceof Set)for(let i of Array.from(n)){let r=we(e,n,i,i);if(r===void 0)n.delete(i);else if(r!==i)n.delete(i),n.add(r)}else for(let[i,r]of Object.entries(n)){let o=we(e,n,i,r);if(o===void 0)delete n[i];else if(o!==r)n[i]=o}return e.call(t,s,n)}co.applyReviver=we});var U=g(function(po){var fo=O();function dn(e,t,s){if(Array.isArray(e))return e.map((n,i)=>dn(n,String(i),s));if(e&&typeof e.toJSON==="function"){if(!s||!fo.hasAnchor(e))return e.toJSON(t,s);let n={aliasCount:0,count:1,res:void 0};s.anchors.set(e,n),s.onCreate=(r)=>{n.res=r,delete s.onCreate};let i=e.toJSON(t,s);if(s.onCreate)s.onCreate(i);return i}if(typeof e==="bigint"&&!s?.keep)return Number(e);return e}po.toJS=dn});var We=g(function(yo){var mo=Bt(),pn=O(),go=U();class hn{constructor(e){Object.defineProperty(this,pn.NODE_TYPE,{value:e})}clone(){let e=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));if(this.range)e.range=this.range.slice();return e}toJS(e,{mapAsMap:t,maxAliasCount:s,onAnchor:n,reviver:i}={}){if(!pn.isDocument(e))throw TypeError("A document argument is required");let r={anchors:new Map,doc:e,keep:!0,mapAsMap:t===!0,mapKeyWarned:!1,maxAliasCount:typeof s==="number"?s:100},o=go.toJS(this,"",r);if(typeof n==="function")for(let{count:a,res:l}of r.anchors.values())n(l,a);return typeof i==="function"?mo.applyReviver(i,{"":o},"",o):o}}yo.NodeBase=hn});var Se=g(function(No){var wo=He(),So=be(),ce=O(),vo=We(),ko=U();class mn extends vo.NodeBase{constructor(e){super(ce.ALIAS);this.source=e,Object.defineProperty(this,"tag",{set(){throw Error("Alias nodes cannot have tags")}})}resolve(e,t){if(t?.maxAliasCount===0)throw ReferenceError("Alias resolution is disabled");let s;if(t?.aliasResolveCache)s=t.aliasResolveCache;else if(s=[],So.visit(e,{Node:(i,r)=>{if(ce.isAlias(r)||ce.hasAnchor(r))s.push(r)}}),t)t.aliasResolveCache=s;let n=void 0;for(let i of s){if(i===this)break;if(i.anchor===this.source)n=i}return n}toJSON(e,t){if(!t)return{source:this.source};let{anchors:s,doc:n,maxAliasCount:i}=t,r=this.resolve(n,t);if(!r){let a=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw ReferenceError(a)}let o=s.get(r);if(!o)ko.toJS(r,null,t),o=s.get(r);if(o?.res===void 0)throw ReferenceError("This should not happen: Alias anchor was not resolved?");if(i>=0){if(o.count+=1,o.aliasCount===0)o.aliasCount=Qe(n,r,s);if(o.count*o.aliasCount>i)throw ReferenceError("Excessive alias count indicates a resource exhaustion attack")}return o.res}toString(e,t,s){let n=`*${this.source}`;if(e){if(wo.anchorIsValid(this.source),e.options.verifyAliasOrder&&!e.anchors.has(this.source)){let i=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw Error(i)}if(e.implicitKey)return`${n} `}return n}}function Qe(e,t,s){if(ce.isAlias(t)){let n=t.resolve(e),i=s&&n&&s.get(n);return i?i.count*i.aliasCount:0}else if(ce.isCollection(t)){let n=0;for(let i of t.items){let r=Qe(e,i,s);if(r>n)n=r}return n}else if(ce.isPair(t)){let n=Qe(e,t.key,s),i=Qe(e,t.value,s);return Math.max(n,i)}return 1}No.Alias=mn});var E=g(function(Lo){var Oo=O(),Co=We(),Eo=U(),qo=(e)=>!e||typeof e!=="function"&&typeof e!=="object";class X extends Co.NodeBase{constructor(e){super(Oo.SCALAR);this.value=e}toJSON(e,t){return t?.keep?this.value:Eo.toJS(this.value,e,t)}toString(){return String(this.value)}}X.BLOCK_FOLDED="BLOCK_FOLDED";X.BLOCK_LITERAL="BLOCK_LITERAL";X.PLAIN="PLAIN";X.QUOTE_DOUBLE="QUOTE_DOUBLE";X.QUOTE_SINGLE="QUOTE_SINGLE";Lo.Scalar=X;Lo.isScalarValue=qo});var ve=g(function(xo){var Io=Se(),Z=O(),gn=E(),Mo="tag:yaml.org,2002:";function $o(e,t,s){if(t){let n=s.filter((r)=>r.tag===t),i=n.find((r)=>!r.format)??n[0];if(!i)throw Error(`Tag ${t} not found`);return i}return s.find((n)=>n.identify?.(e)&&!n.format)}function _o(e,t,s){if(Z.isDocument(e))e=e.contents;if(Z.isNode(e))return e;if(Z.isPair(e)){let u=s.schema[Z.MAP].createNode?.(s.schema,null,s);return u.items.push(e),u}if(e instanceof String||e instanceof Number||e instanceof Boolean||typeof BigInt<"u"&&e instanceof BigInt)e=e.valueOf();let{aliasDuplicateObjects:n,onAnchor:i,onTagObj:r,schema:o,sourceObjects:a}=s,l=void 0;if(n&&e&&typeof e==="object")if(l=a.get(e),l)return l.anchor??(l.anchor=i(e)),new Io.Alias(l.anchor);else l={anchor:null,node:null},a.set(e,l);if(t?.startsWith("!!"))t=Mo+t.slice(2);let c=$o(e,t,o.tags);if(!c){if(e&&typeof e.toJSON==="function")e=e.toJSON();if(!e||typeof e!=="object"){let u=new gn.Scalar(e);if(l)l.node=u;return u}c=e instanceof Map?o[Z.MAP]:(Symbol.iterator in Object(e))?o[Z.SEQ]:o[Z.MAP]}if(r)r(c),delete s.onTagObj;let p=c?.createNode?c.createNode(s.schema,e,s):typeof c?.nodeClass?.from==="function"?c.nodeClass.from(s.schema,e,s):new gn.Scalar(e);if(t)p.tag=t;else if(!c.default)p.tag=c.tag;if(l)l.node=p;return p}xo.createNode=_o});var ze=g(function(Ko){var Bo=ve(),R=O(),Ro=We();function Rt(e,t,s){let n=s;for(let i=t.length-1;i>=0;--i){let r=t[i];if(typeof r==="number"&&Number.isInteger(r)&&r>=0){let o=[];o[r]=n,n=o}else n=new Map([[r,n]])}return Bo.createNode(n,void 0,{aliasDuplicateObjects:!1,keepUndefined:!1,onAnchor:()=>{throw Error("This should not happen, please report a bug.")},schema:e,sourceObjects:new Map})}var yn=(e)=>e==null||typeof e==="object"&&!!e[Symbol.iterator]().next().done;class bn extends Ro.NodeBase{constructor(e,t){super(e);Object.defineProperty(this,"schema",{value:t,configurable:!0,enumerable:!1,writable:!0})}clone(e){let t=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));if(e)t.schema=e;if(t.items=t.items.map((s)=>R.isNode(s)||R.isPair(s)?s.clone(e):s),this.range)t.range=this.range.slice();return t}addIn(e,t){if(yn(e))this.add(t);else{let[s,...n]=e,i=this.get(s,!0);if(R.isCollection(i))i.addIn(n,t);else if(i===void 0&&this.schema)this.set(s,Rt(this.schema,n,t));else throw Error(`Expected YAML collection at ${s}. Remaining path: ${n}`)}}deleteIn(e){let[t,...s]=e;if(s.length===0)return this.delete(t);let n=this.get(t,!0);if(R.isCollection(n))return n.deleteIn(s);else throw Error(`Expected YAML collection at ${t}. Remaining path: ${s}`)}getIn(e,t){let[s,...n]=e,i=this.get(s,!0);if(n.length===0)return!t&&R.isScalar(i)?i.value:i;else return R.isCollection(i)?i.getIn(n,t):void 0}hasAllNullValues(e){return this.items.every((t)=>{if(!R.isPair(t))return!1;let s=t.value;return s==null||e&&R.isScalar(s)&&s.value==null&&!s.commentBefore&&!s.comment&&!s.tag})}hasIn(e){let[t,...s]=e;if(s.length===0)return this.has(t);let n=this.get(t,!0);return R.isCollection(n)?n.hasIn(s):!1}setIn(e,t){let[s,...n]=e;if(n.length===0)this.set(s,t);else{let i=this.get(s,!0);if(R.isCollection(i))i.setIn(n,t);else if(i===void 0&&this.schema)this.set(s,Rt(this.schema,n,t));else throw Error(`Expected YAML collection at ${s}. Remaining path: ${n}`)}}}Ko.Collection=bn;Ko.collectionFromPath=Rt;Ko.isEmptyPath=yn});var ke=g(function(Jo){var Yo=(e)=>e.replace(/^(?!$)(?: $)?/gm,"#");function Kt(e,t){if(/^\n+$/.test(e))return e.substring(1);return t?e.replace(/^(?! *$)/gm,t):e}var Vo=(e,t,s)=>e.endsWith(`
|
|
4
4
|
`)?Kt(s,t):s.includes(`
|
|
5
5
|
`)?`
|
|
6
6
|
`+Kt(s,t):(e.endsWith(" ")?"":" ")+s;Jo.indentComment=Kt;Jo.lineComment=Vo;Jo.stringifyComment=Yo});var Sn=g(function(Go){function zo(e,t,s="flow",{indentAtStart:n,lineWidth:i=80,minContentWidth:r=20,onFold:o,onOverflow:a}={}){if(!i||i<0)return e;if(i<r)r=0;let l=Math.max(1+r,1+i-t.length);if(e.length<=l)return e;let c=[],p={},u=i-t.length;if(typeof n==="number")if(n>i-Math.max(2,r))c.push(0);else u=i-n;let f=void 0,m=void 0,y=!1,d=-1,h=-1,w=-1;if(s==="block"){if(d=wn(e,d,t.length),d!==-1)u=d+l}for(let v;v=e[d+=1];){if(s==="quoted"&&v==="\\"){switch(h=d,e[d+1]){case"x":d+=3;break;case"u":d+=5;break;case"U":d+=9;break;default:d+=1}w=d}if(v===`
|
|
@@ -9,7 +9,7 @@ var g=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var Fe=import.meta
|
|
|
9
9
|
`&&k!=="\t")f=d}if(d>=u)if(f)c.push(f),u=f+l,f=void 0;else if(s==="quoted"){while(m===" "||m==="\t")m=v,v=e[d+=1],y=!0;let k=d>w+1?d-2:h-1;if(p[k])return e;c.push(k),p[k]=!0,u=k+l,f=void 0}else y=!0}m=v}if(y&&a)a();if(c.length===0)return e;if(o)o();let S=e.slice(0,c[0]);for(let v=0;v<c.length;++v){let k=c[v],N=c[v+1]||e.length;if(k===0)S=`
|
|
10
10
|
${t}${e.slice(0,N)}`;else{if(s==="quoted"&&p[k])S+=`${e[k]}\\`;S+=`
|
|
11
11
|
${t}${e.slice(k+1,N)}`}}return S}function wn(e,t,s){let n=t,i=t+1,r=e[i];while(r===" "||r==="\t")if(t<i+s)r=e[++t];else{do r=e[++t];while(r&&r!==`
|
|
12
|
-
`);n=t,i=t+1,r=e[i]}return n}Go.FOLD_BLOCK="block";Go.FOLD_FLOW="flow";Go.FOLD_QUOTED="quoted";Go.foldFlowLines=zo});var Ae=g(function(ra){var x=
|
|
12
|
+
`);n=t,i=t+1,r=e[i]}return n}Go.FOLD_BLOCK="block";Go.FOLD_FLOW="flow";Go.FOLD_QUOTED="quoted";Go.foldFlowLines=zo});var Ae=g(function(ra){var x=E(),Y=Sn(),Xe=(e,t)=>({indentAtStart:t?e.indent.length:e.indentAtStart,lineWidth:e.options.lineWidth,minContentWidth:e.options.minContentWidth}),Ze=(e)=>/^(%|---|\.\.\.)/m.test(e);function sa(e,t,s){if(!t||t<0)return!1;let n=t-s,i=e.length;if(i<=n)return!1;for(let r=0,o=0;r<i;++r)if(e[r]===`
|
|
13
13
|
`){if(r-o>n)return!0;if(o=r+1,i-o<=n)return!1}return!0}function Ne(e,t){let s=JSON.stringify(e);if(t.options.doubleQuotedAsJSON)return s;let{implicitKey:n}=t,i=t.options.doubleQuotedMinMultiLineLength,r=t.indent||(Ze(e)?" ":""),o="",a=0;for(let l=0,c=s[l];c;c=s[++l]){if(c===" "&&s[l+1]==="\\"&&s[l+2]==="n")o+=s.slice(a,l)+"\\ ",l+=1,a=l,c="\\";if(c==="\\")switch(s[l+1]){case"u":{o+=s.slice(a,l);let p=s.substr(l+2,4);switch(p){case"0000":o+="\\0";break;case"0007":o+="\\a";break;case"000b":o+="\\v";break;case"001b":o+="\\e";break;case"0085":o+="\\N";break;case"00a0":o+="\\_";break;case"2028":o+="\\L";break;case"2029":o+="\\P";break;default:if(p.substr(0,2)==="00")o+="\\x"+p.substr(2);else o+=s.substr(l,6)}l+=5,a=l+1}break;case"n":if(n||s[l+2]==='"'||s.length<i)l+=1;else{o+=s.slice(a,l)+`
|
|
14
14
|
|
|
15
15
|
`;while(s[l+2]==="\\"&&s[l+3]==="n"&&s[l+4]!=='"')o+=`
|
|
@@ -25,51 +25,51 @@ ${s}`)+"'";return t.implicitKey?n:Y.foldFlowLines(n,s,Y.FOLD_FLOW,Xe(t,!1))}func
|
|
|
25
25
|
`);if(y===-1)u="-";else if(s===m||y!==m.length-1){if(u="+",r)r()}else u="";if(m){if(s=s.slice(0,-m.length),m[m.length-1]===`
|
|
26
26
|
`)m=m.slice(0,-1);m=m.replace(Ft,`$&${c}`)}let d=!1,h,w=-1;for(h=0;h<s.length;++h){let N=s[h];if(N===" ")d=!0;else if(N===`
|
|
27
27
|
`)w=h;else break}let S=s.substring(0,w<h?w+1:h);if(S)s=s.substring(S.length),S=S.replace(/\n+/g,`$&${c}`);let k=(d?c?"2":"1":"")+u;if(e){if(k+=" "+a(e.replace(/ ?[\r\n]+/g," ")),i)i()}if(!p){let N=s.replace(/\n+/g,`
|
|
28
|
-
$&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,"$1$2").replace(/\n+/g,`$&${c}`),A=!1,
|
|
28
|
+
$&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,"$1$2").replace(/\n+/g,`$&${c}`),A=!1,C=Xe(n,!0);if(o!=="folded"&&t!==x.Scalar.BLOCK_FOLDED)C.onOverflow=()=>{A=!0};let b=Y.foldFlowLines(`${S}${N}${m}`,c,Y.FOLD_BLOCK,C);if(!A)return`>${k}
|
|
29
29
|
${c}${b}`}return s=s.replace(/\n+/g,`$&${c}`),`|${k}
|
|
30
30
|
${c}${S}${s}${m}`}function na(e,t,s,n){let{type:i,value:r}=e,{actualString:o,implicitKey:a,indent:l,indentStep:c,inFlow:p}=t;if(a&&r.includes(`
|
|
31
31
|
`)||p&&/[[\]{},]/.test(r))return ue(r,t);if(/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(r))return a||p||!r.includes(`
|
|
32
32
|
`)?ue(r,t):Ge(e,t,s,n);if(!a&&!p&&i!==x.Scalar.PLAIN&&r.includes(`
|
|
33
33
|
`))return Ge(e,t,s,n);if(Ze(r)){if(l==="")return t.forceBlockIndent=!0,Ge(e,t,s,n);else if(a&&l===c)return ue(r,t)}let u=r.replace(/\n+/g,`$&
|
|
34
34
|
${l}`);if(o){let f=(d)=>d.default&&d.tag!=="tag:yaml.org,2002:str"&&d.test?.test(u),{compat:m,tags:y}=t.doc.schema;if(y.some(f)||m?.some(f))return ue(r,t)}return a?u:Y.foldFlowLines(u,l,Y.FOLD_FLOW,Xe(t,!1))}function ia(e,t,s,n){let{implicitKey:i,inFlow:r}=t,o=typeof e.value==="string"?e:Object.assign({},e,{value:String(e.value)}),{type:a}=e;if(a!==x.Scalar.QUOTE_DOUBLE){if(/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(o.value))a=x.Scalar.QUOTE_DOUBLE}let l=(p)=>{switch(p){case x.Scalar.BLOCK_FOLDED:case x.Scalar.BLOCK_LITERAL:return i||r?ue(o.value,t):Ge(o,t,s,n);case x.Scalar.QUOTE_DOUBLE:return Ne(o.value,t);case x.Scalar.QUOTE_SINGLE:return jt(o.value,t);case x.Scalar.PLAIN:return na(o,t,s,n);default:return null}},c=l(a);if(c===null){let{defaultKeyType:p,defaultStringType:u}=t.options,f=i&&p||u;if(c=l(f),c===null)throw Error(`Unsupported default string type ${f}`)}return c}ra.stringifyString=ia});var Oe=g(function(ha){var aa=He(),V=O(),la=ke(),ca=Ae();function ua(e,t){let s=Object.assign({blockQuote:!0,commentString:la.stringifyComment,defaultKeyType:null,defaultStringType:"PLAIN",directives:null,doubleQuotedAsJSON:!1,doubleQuotedMinMultiLineLength:40,falseStr:"false",flowCollectionPadding:!0,indentSeq:!0,lineWidth:80,minContentWidth:20,nullStr:"null",simpleKeys:!1,singleQuote:null,trailingComma:!1,trueStr:"true",verifyAliasOrder:!0},e.schema.toStringOptions,t),n;switch(s.collectionStyle){case"block":n=!1;break;case"flow":n=!0;break;default:n=null}return{anchors:new Set,doc:e,flowCollectionPadding:s.flowCollectionPadding?" ":"",indent:"",indentStep:typeof s.indent==="number"?" ".repeat(s.indent):" ",inFlow:n,options:s}}function fa(e,t){if(t.tag){let i=e.filter((r)=>r.tag===t.tag);if(i.length>0)return i.find((r)=>r.format===t.format)??i[0]}let s=void 0,n;if(V.isScalar(t)){n=t.value;let i=e.filter((r)=>r.identify?.(n));if(i.length>1){let r=i.filter((o)=>o.test);if(r.length>0)i=r}s=i.find((r)=>r.format===t.format)??i.find((r)=>!r.format)}else n=t,s=e.find((i)=>i.nodeClass&&n instanceof i.nodeClass);if(!s){let i=n?.constructor?.name??(n===null?"null":typeof n);throw Error(`Tag not resolved for ${i} value`)}return s}function da(e,t,{anchors:s,doc:n}){if(!n.directives)return"";let i=[],r=(V.isScalar(e)||V.isCollection(e))&&e.anchor;if(r&&aa.anchorIsValid(r))s.add(r),i.push(`&${r}`);let o=e.tag??(t.default?null:t.tag);if(o)i.push(n.directives.tagString(o));return i.join(" ")}function pa(e,t,s,n){if(V.isPair(e))return e.toString(t,s,n);if(V.isAlias(e)){if(t.doc.directives)return e.toString(t);if(t.resolvedAliases?.has(e))throw TypeError("Cannot stringify circular structure without alias nodes");else{if(t.resolvedAliases)t.resolvedAliases.add(e);else t.resolvedAliases=new Set([e]);e=e.resolve(t.doc)}}let i=void 0,r=V.isNode(e)?e:t.doc.createNode(e,{onTagObj:(l)=>i=l});i??(i=fa(t.doc.schema.tags,r));let o=da(r,i,t);if(o.length>0)t.indentAtStart=(t.indentAtStart??0)+o.length+1;let a=typeof i.stringify==="function"?i.stringify(r,t,s,n):V.isScalar(r)?ca.stringifyString(r,t,s,n):r.toString(t,s,n);if(!o)return a;return V.isScalar(r)||a[0]==="{"||a[0]==="["?`${o} ${a}`:`${o}
|
|
35
|
-
${t.indent}${a}`}ha.createStringifyContext=ua;ha.stringify=pa});var Nn=g(function(ba){var j=O(),vn=
|
|
36
|
-
${a}:`}else if(h=`${h}:`,f)h+=
|
|
37
|
-
`:"",S){let
|
|
38
|
-
${
|
|
35
|
+
${t.indent}${a}`}ha.createStringifyContext=ua;ha.stringify=pa});var Nn=g(function(ba){var j=O(),vn=E(),kn=Oe(),Ce=ke();function ya({key:e,value:t},s,n,i){let{allNullValues:r,doc:o,indent:a,indentStep:l,options:{commentString:c,indentSeq:p,simpleKeys:u}}=s,f=j.isNode(e)&&e.comment||null;if(u){if(f)throw Error("With simple keys, key nodes cannot have comments");if(j.isCollection(e)||!j.isNode(e)&&typeof e==="object")throw Error("With simple keys, collection cannot be used as a key value")}let m=!u&&(!e||f&&t==null&&!s.inFlow||j.isCollection(e)||(j.isScalar(e)?e.type===vn.Scalar.BLOCK_FOLDED||e.type===vn.Scalar.BLOCK_LITERAL:typeof e==="object"));s=Object.assign({},s,{allNullValues:!1,implicitKey:!m&&(u||!r),indent:a+l});let y=!1,d=!1,h=kn.stringify(e,s,()=>y=!0,()=>d=!0);if(!m&&!s.inFlow&&h.length>1024){if(u)throw Error("With simple keys, single line scalar must not span more than 1024 characters");m=!0}if(s.inFlow){if(r||t==null){if(y&&n)n();return h===""?"?":m?`? ${h}`:h}}else if(r&&!u||t==null&&m){if(h=`? ${h}`,f&&!y)h+=Ce.lineComment(h,s.indent,c(f));else if(d&&i)i();return h}if(y)f=null;if(m){if(f)h+=Ce.lineComment(h,s.indent,c(f));h=`? ${h}
|
|
36
|
+
${a}:`}else if(h=`${h}:`,f)h+=Ce.lineComment(h,s.indent,c(f));let w,S,v;if(j.isNode(t))w=!!t.spaceBefore,S=t.commentBefore,v=t.comment;else if(w=!1,S=null,v=null,t&&typeof t==="object")t=o.createNode(t);if(s.implicitKey=!1,!m&&!f&&j.isScalar(t))s.indentAtStart=h.length+1;if(d=!1,!p&&l.length>=2&&!s.inFlow&&!m&&j.isSeq(t)&&!t.flow&&!t.tag&&!t.anchor)s.indent=s.indent.substring(2);let k=!1,N=kn.stringify(t,s,()=>k=!0,()=>d=!0),A=" ";if(f||w||S){if(A=w?`
|
|
37
|
+
`:"",S){let C=c(S);A+=`
|
|
38
|
+
${Ce.indentComment(C,s.indent)}`}if(N===""&&!s.inFlow){if(A===`
|
|
39
39
|
`&&v)A=`
|
|
40
40
|
|
|
41
41
|
`}else A+=`
|
|
42
|
-
${s.indent}`}else if(!m&&j.isCollection(t)){let
|
|
43
|
-
`),
|
|
42
|
+
${s.indent}`}else if(!m&&j.isCollection(t)){let C=N[0],b=N.indexOf(`
|
|
43
|
+
`),q=b!==-1,F=s.inFlow??t.flow??t.items.length===0;if(q||!F){let oe=!1;if(q&&(C==="&"||C==="!")){let L=N.indexOf(" ");if(C==="&"&&L!==-1&&L<b&&N[L+1]==="!")L=N.indexOf(" ",L+1);if(L===-1||b<L)oe=!0}if(!oe)A=`
|
|
44
44
|
${s.indent}`}}else if(N===""||N[0]===`
|
|
45
|
-
`)A="";if(h+=A+N,s.inFlow){if(k&&n)n()}else if(v&&!k)h+=
|
|
45
|
+
`)A="";if(h+=A+N,s.inFlow){if(k&&n)n()}else if(v&&!k)h+=Ce.lineComment(h,s.indent,c(v));else if(d&&i)i();return h}ba.stringifyPair=ya});var Ut=g(function(ka){var An=Fe("process");function Sa(e,...t){if(e==="debug")console.log(...t)}function va(e,t){if(e==="debug"||e==="warn")if(typeof An.emitWarning==="function")An.emitWarning(t);else console.warn(t)}ka.debug=Sa;ka.warn=va});var nt=g(function(Ca){var st=O(),On=E(),et="<<",tt={identify:(e)=>e===et||typeof e==="symbol"&&e.description===et,default:"key",tag:"tag:yaml.org,2002:merge",test:/^<<$/,resolve:()=>Object.assign(new On.Scalar(Symbol(et)),{addToJSMap:Cn}),stringify:()=>et},Oa=(e,t)=>(tt.identify(t)||st.isScalar(t)&&(!t.type||t.type===On.Scalar.PLAIN)&&tt.identify(t.value))&&e?.doc.schema.tags.some((s)=>s.tag===tt.tag&&s.default);function Cn(e,t,s){let n=En(e,s);if(st.isSeq(n))for(let i of n.items)Yt(e,t,i);else if(Array.isArray(n))for(let i of n)Yt(e,t,i);else Yt(e,t,n)}function Yt(e,t,s){let n=En(e,s);if(!st.isMap(n))throw Error("Merge sources must be maps or map aliases");let i=n.toJSON(null,e,Map);for(let[r,o]of i)if(t instanceof Map){if(!t.has(r))t.set(r,o)}else if(t instanceof Set)t.add(r);else if(!Object.prototype.hasOwnProperty.call(t,r))Object.defineProperty(t,r,{value:o,writable:!0,enumerable:!0,configurable:!0});return t}function En(e,t){return e&&st.isAlias(t)?t.resolve(e.doc,e):t}Ca.addMergeToJSMap=Cn;Ca.isMergeKey=Oa;Ca.merge=tt});var Jt=g(function($a){var Pa=Ut(),qn=nt(),Ta=Oe(),Ln=O(),Vt=U();function Ia(e,t,{key:s,value:n}){if(Ln.isNode(s)&&s.addToJSMap)s.addToJSMap(e,t,n);else if(qn.isMergeKey(e,s))qn.addMergeToJSMap(e,t,n);else{let i=Vt.toJS(s,"",e);if(t instanceof Map)t.set(i,Vt.toJS(n,i,e));else if(t instanceof Set)t.add(i);else{let r=Ma(s,i,e),o=Vt.toJS(n,r,e);if(r in t)Object.defineProperty(t,r,{value:o,writable:!0,enumerable:!0,configurable:!0});else t[r]=o}}return t}function Ma(e,t,s){if(t===null)return"";if(typeof t!=="object")return String(t);if(Ln.isNode(e)&&s?.doc){let n=Ta.createStringifyContext(s.doc,{});n.anchors=new Set;for(let r of s.anchors.keys())n.anchors.add(r.anchor);n.inFlow=!0,n.inStringifyKey=!0;let i=e.toString(n);if(!s.mapKeyWarned){let r=JSON.stringify(i);if(r.length>40)r=r.substring(0,36)+'..."';Pa.warn(s.doc.options.logLevel,`Keys with collection values will be stringified due to JS Object restrictions: ${r}. Set mapAsMap: true to use object keys.`),s.mapKeyWarned=!0}return i}return JSON.stringify(t)}$a.addPairToJSMap=Ia});var J=g(function(Ra){var Pn=ve(),xa=Nn(),Da=Jt(),it=O();function Ba(e,t,s){let n=Pn.createNode(e,void 0,s),i=Pn.createNode(t,void 0,s);return new rt(n,i)}class rt{constructor(e,t=null){Object.defineProperty(this,it.NODE_TYPE,{value:it.PAIR}),this.key=e,this.value=t}clone(e){let{key:t,value:s}=this;if(it.isNode(t))t=t.clone(e);if(it.isNode(s))s=s.clone(e);return new rt(t,s)}toJSON(e,t){let s=t?.mapAsMap?new Map:{};return Da.addPairToJSMap(t,s,this)}toString(e,t,s){return e?.doc?xa.stringifyPair(this,e,t,s):JSON.stringify(this)}}Ra.Pair=rt;Ra.createPair=Ba});var Ht=g(function(Va){var ee=O(),Tn=Oe(),ot=ke();function Fa(e,t,s){return(t.inFlow??e.flow?Ya:Ua)(e,t,s)}function Ua({comment:e,items:t},s,{blockItemPrefix:n,flowChars:i,itemIndent:r,onChompKeep:o,onComment:a}){let{indent:l,options:{commentString:c}}=s,p=Object.assign({},s,{indent:r,type:null}),u=!1,f=[];for(let y=0;y<t.length;++y){let d=t[y],h=null;if(ee.isNode(d)){if(!u&&d.spaceBefore)f.push("");if(at(s,f,d.commentBefore,u),d.comment)h=d.comment}else if(ee.isPair(d)){let S=ee.isNode(d.key)?d.key:null;if(S){if(!u&&S.spaceBefore)f.push("");at(s,f,S.commentBefore,u)}}u=!1;let w=Tn.stringify(d,p,()=>h=null,()=>u=!0);if(h)w+=ot.lineComment(w,r,c(h));if(u&&h)u=!1;f.push(n+w)}let m;if(f.length===0)m=i.start+i.end;else{m=f[0];for(let y=1;y<f.length;++y){let d=f[y];m+=d?`
|
|
46
46
|
${l}${d}`:`
|
|
47
47
|
`}}if(e){if(m+=`
|
|
48
48
|
`+ot.indentComment(c(e),l),a)a()}else if(u&&o)o();return m}function Ya({items:e},t,{flowChars:s,itemIndent:n}){let{indent:i,indentStep:r,flowCollectionPadding:o,options:{commentString:a}}=t;n+=r;let l=Object.assign({},t,{indent:n,inFlow:!0,type:null}),c=!1,p=0,u=[];for(let y=0;y<e.length;++y){let d=e[y],h=null;if(ee.isNode(d)){if(d.spaceBefore)u.push("");if(at(t,u,d.commentBefore,!1),d.comment)h=d.comment}else if(ee.isPair(d)){let S=ee.isNode(d.key)?d.key:null;if(S){if(S.spaceBefore)u.push("");if(at(t,u,S.commentBefore,!1),S.comment)c=!0}let v=ee.isNode(d.value)?d.value:null;if(v){if(v.comment)h=v.comment;if(v.commentBefore)c=!0}else if(d.value==null&&S?.comment)h=S.comment}if(h)c=!0;let w=Tn.stringify(d,l,()=>h=null);if(c||(c=u.length>p||w.includes(`
|
|
49
49
|
`)),y<e.length-1)w+=",";else if(t.options.trailingComma){if(t.options.lineWidth>0)c||(c=u.reduce((S,v)=>S+v.length+2,2)+(w.length+2)>t.options.lineWidth);if(c)w+=","}if(h)w+=ot.lineComment(w,n,a(h));u.push(w),p=u.length}let{start:f,end:m}=s;if(u.length===0)return f+m;else{if(!c){let y=u.reduce((d,h)=>d+h.length+2,2);c=t.options.lineWidth>0&&y>t.options.lineWidth}if(c){let y=f;for(let d of u)y+=d?`
|
|
50
50
|
${r}${i}${d}`:`
|
|
51
51
|
`;return`${y}
|
|
52
|
-
${i}${m}`}else return`${f}${o}${u.join(" ")}${o}${m}`}}function at({indent:e,options:{commentString:t}},s,n,i){if(n&&i)n=n.replace(/^\n+/,"");if(n){let r=ot.indentComment(t(n),e);s.push(r.trimStart())}}Va.stringifyCollection=Fa});var W=g(function(Ga){var Ha=Ht(),Wa=Jt(),Qa=ze(),H=O(),lt=J(),za=
|
|
53
|
-
`:" ")}return ic.stringifyString({comment:e,type:t,value:a},n,i,r)}};oc.binary=rc});var mt=g(function(fc){var ht=O(),ns=J(),lc=
|
|
52
|
+
${i}${m}`}else return`${f}${o}${u.join(" ")}${o}${m}`}}function at({indent:e,options:{commentString:t}},s,n,i){if(n&&i)n=n.replace(/^\n+/,"");if(n){let r=ot.indentComment(t(n),e);s.push(r.trimStart())}}Va.stringifyCollection=Fa});var W=g(function(Ga){var Ha=Ht(),Wa=Jt(),Qa=ze(),H=O(),lt=J(),za=E();function Ee(e,t){let s=H.isScalar(t)?t.value:t;for(let n of e)if(H.isPair(n)){if(n.key===t||n.key===s)return n;if(H.isScalar(n.key)&&n.key.value===s)return n}return}class In extends Qa.Collection{static get tagName(){return"tag:yaml.org,2002:map"}constructor(e){super(H.MAP,e);this.items=[]}static from(e,t,s){let{keepUndefined:n,replacer:i}=s,r=new this(e),o=(a,l)=>{if(typeof i==="function")l=i.call(t,a,l);else if(Array.isArray(i)&&!i.includes(a))return;if(l!==void 0||n)r.items.push(lt.createPair(a,l,s))};if(t instanceof Map)for(let[a,l]of t)o(a,l);else if(t&&typeof t==="object")for(let a of Object.keys(t))o(a,t[a]);if(typeof e.sortMapEntries==="function")r.items.sort(e.sortMapEntries);return r}add(e,t){let s;if(H.isPair(e))s=e;else if(!e||typeof e!=="object"||!("key"in e))s=new lt.Pair(e,e?.value);else s=new lt.Pair(e.key,e.value);let n=Ee(this.items,s.key),i=this.schema?.sortMapEntries;if(n){if(!t)throw Error(`Key ${s.key} already set`);if(H.isScalar(n.value)&&za.isScalarValue(s.value))n.value.value=s.value;else n.value=s.value}else if(i){let r=this.items.findIndex((o)=>i(s,o)<0);if(r===-1)this.items.push(s);else this.items.splice(r,0,s)}else this.items.push(s)}delete(e){let t=Ee(this.items,e);if(!t)return!1;return this.items.splice(this.items.indexOf(t),1).length>0}get(e,t){let n=Ee(this.items,e)?.value;return(!t&&H.isScalar(n)?n.value:n)??void 0}has(e){return!!Ee(this.items,e)}set(e,t){this.add(new lt.Pair(e,t),!0)}toJSON(e,t,s){let n=s?new s:t?.mapAsMap?new Map:{};if(t?.onCreate)t.onCreate(n);for(let i of this.items)Wa.addPairToJSMap(t,n,i);return n}toString(e,t,s){if(!e)return JSON.stringify(this);for(let n of this.items)if(!H.isPair(n))throw Error(`Map items must all be pairs; found ${JSON.stringify(n)} instead`);if(!e.allNullValues&&this.hasAllNullValues(!1))e=Object.assign({},e,{allNullValues:!0});return Ha.stringifyCollection(this,e,{blockItemPrefix:"",flowChars:{start:"{",end:"}"},itemIndent:e.indent||"",onChompKeep:s,onComment:t})}}Ga.YAMLMap=In;Ga.findPair=Ee});var fe=g(function(sl){var el=O(),Mn=W(),tl={collection:"map",default:!0,nodeClass:Mn.YAMLMap,tag:"tag:yaml.org,2002:map",resolve(e,t){if(!el.isMap(e))t("Expected a mapping for this tag");return e},createNode:(e,t,s)=>Mn.YAMLMap.from(e,t,s)};sl.map=tl});var Q=g(function(cl){var il=ve(),rl=Ht(),ol=ze(),ut=O(),al=E(),ll=U();class $n extends ol.Collection{static get tagName(){return"tag:yaml.org,2002:seq"}constructor(e){super(ut.SEQ,e);this.items=[]}add(e){this.items.push(e)}delete(e){let t=ct(e);if(typeof t!=="number")return!1;return this.items.splice(t,1).length>0}get(e,t){let s=ct(e);if(typeof s!=="number")return;let n=this.items[s];return!t&&ut.isScalar(n)?n.value:n}has(e){let t=ct(e);return typeof t==="number"&&t<this.items.length}set(e,t){let s=ct(e);if(typeof s!=="number")throw Error(`Expected a valid index, not ${e}.`);let n=this.items[s];if(ut.isScalar(n)&&al.isScalarValue(t))n.value=t;else this.items[s]=t}toJSON(e,t){let s=[];if(t?.onCreate)t.onCreate(s);let n=0;for(let i of this.items)s.push(ll.toJS(i,String(n++),t));return s}toString(e,t,s){if(!e)return JSON.stringify(this);return rl.stringifyCollection(this,e,{blockItemPrefix:"- ",flowChars:{start:"[",end:"]"},itemIndent:(e.indent||"")+" ",onChompKeep:s,onComment:t})}static from(e,t,s){let{replacer:n}=s,i=new this(e);if(t&&Symbol.iterator in Object(t)){let r=0;for(let o of t){if(typeof n==="function"){let a=t instanceof Set?o:String(r++);o=n.call(t,a,o)}i.items.push(il.createNode(o,void 0,s))}}return i}}function ct(e){let t=ut.isScalar(e)?e.value:e;if(t&&typeof t==="string")t=Number(t);return typeof t==="number"&&Number.isInteger(t)&&t>=0?t:null}cl.YAMLSeq=$n});var de=g(function(pl){var fl=O(),_n=Q(),dl={collection:"seq",default:!0,nodeClass:_n.YAMLSeq,tag:"tag:yaml.org,2002:seq",resolve(e,t){if(!fl.isSeq(e))t("Expected a sequence for this tag");return e},createNode:(e,t,s)=>_n.YAMLSeq.from(e,t,s)};pl.seq=dl});var qe=g(function(yl){var ml=Ae(),gl={identify:(e)=>typeof e==="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:(e)=>e,stringify(e,t,s,n){return t=Object.assign({actualString:!0},t),ml.stringifyString(e,t,s,n)}};yl.string=gl});var ft=g(function(wl){var xn=E(),Dn={identify:(e)=>e==null,createNode:()=>new xn.Scalar(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>new xn.Scalar(null),stringify:({source:e},t)=>typeof e==="string"&&Dn.test.test(e)?e:t.options.nullStr};wl.nullTag=Dn});var Wt=g(function(kl){var vl=E(),Bn={identify:(e)=>typeof e==="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:(e)=>new vl.Scalar(e[0]==="t"||e[0]==="T"),stringify({source:e,value:t},s){if(e&&Bn.test.test(e)){let n=e[0]==="t"||e[0]==="T";if(t===n)return e}return t?s.options.trueStr:s.options.falseStr}};kl.boolTag=Bn});var pe=g(function(Ol){function Al({format:e,minFractionDigits:t,tag:s,value:n}){if(typeof n==="bigint")return String(n);let i=typeof n==="number"?n:Number(n);if(!isFinite(i))return isNaN(i)?".nan":i<0?"-.inf":".inf";let r=Object.is(n,-0)?"-0":JSON.stringify(n);if(!e&&t&&(!s||s==="tag:yaml.org,2002:float")&&/^-?\d/.test(r)&&!r.includes("e")){let o=r.indexOf(".");if(o<0)o=r.length,r+=".";let a=t-(r.length-o-1);while(a-- >0)r+="0"}return r}Ol.stringifyNumber=Al});var zt=g(function(Tl){var El=E(),Qt=pe(),ql={identify:(e)=>typeof e==="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:(e)=>e.slice(-3).toLowerCase()==="nan"?NaN:e[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:Qt.stringifyNumber},Ll={identify:(e)=>typeof e==="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:\.[0-9]+|[0-9]+(?:\.[0-9]*)?)[eE][-+]?[0-9]+$/,resolve:(e)=>parseFloat(e),stringify(e){let t=Number(e.value);return isFinite(t)?t.toExponential():Qt.stringifyNumber(e)}},Pl={identify:(e)=>typeof e==="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:\.[0-9]+|[0-9]+\.[0-9]*)$/,resolve(e){let t=new El.Scalar(parseFloat(e)),s=e.indexOf(".");if(s!==-1&&e[e.length-1]==="0")t.minFractionDigits=e.length-s-1;return t},stringify:Qt.stringifyNumber};Tl.float=Pl;Tl.floatExp=Ll;Tl.floatNaN=ql});var Xt=g(function(Bl){var Rn=pe(),dt=(e)=>typeof e==="bigint"||Number.isInteger(e),Gt=(e,t,s,{intAsBigInt:n})=>n?BigInt(e):parseInt(e.substring(t),s);function Kn(e,t,s){let{value:n}=e;if(dt(n)&&n>=0)return s+n.toString(t);return Rn.stringifyNumber(e)}var _l={identify:(e)=>dt(e)&&e>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^0o[0-7]+$/,resolve:(e,t,s)=>Gt(e,2,8,s),stringify:(e)=>Kn(e,8,"0o")},xl={identify:dt,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9]+$/,resolve:(e,t,s)=>Gt(e,0,10,s),stringify:Rn.stringifyNumber},Dl={identify:(e)=>dt(e)&&e>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^0x[0-9a-fA-F]+$/,resolve:(e,t,s)=>Gt(e,2,16,s),stringify:(e)=>Kn(e,16,"0x")};Bl.int=xl;Bl.intHex=Dl;Bl.intOct=_l});var jn=g(function(Wl){var Fl=fe(),Ul=ft(),Yl=de(),Vl=qe(),Jl=Wt(),Zt=zt(),es=Xt(),Hl=[Fl.map,Yl.seq,Vl.string,Ul.nullTag,Jl.boolTag,es.intOct,es.int,es.intHex,Zt.floatNaN,Zt.floatExp,Zt.float];Wl.schema=Hl});var Un=g(function(sc){var zl=E(),Gl=fe(),Xl=de();function Fn(e){return typeof e==="bigint"||Number.isInteger(e)}var pt=({value:e})=>JSON.stringify(e),Zl=[{identify:(e)=>typeof e==="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:(e)=>e,stringify:pt},{identify:(e)=>e==null,createNode:()=>new zl.Scalar(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^null$/,resolve:()=>null,stringify:pt},{identify:(e)=>typeof e==="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^true$|^false$/,resolve:(e)=>e==="true",stringify:pt},{identify:Fn,default:!0,tag:"tag:yaml.org,2002:int",test:/^-?(?:0|[1-9][0-9]*)$/,resolve:(e,t,{intAsBigInt:s})=>s?BigInt(e):parseInt(e,10),stringify:({value:e})=>Fn(e)?e.toString():JSON.stringify(e)},{identify:(e)=>typeof e==="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^-?(?:0|[1-9][0-9]*)(?:\.[0-9]*)?(?:[eE][-+]?[0-9]+)?$/,resolve:(e)=>parseFloat(e),stringify:pt}],ec={default:!0,tag:"",test:/^/,resolve(e,t){return t(`Unresolved plain scalar ${JSON.stringify(e)}`),e}},tc=[Gl.map,Xl.seq].concat(Zl,ec);sc.schema=tc});var ss=g(function(oc){var Le=Fe("buffer"),ts=E(),ic=Ae(),rc={identify:(e)=>e instanceof Uint8Array,default:!1,tag:"tag:yaml.org,2002:binary",resolve(e,t){if(typeof Le.Buffer==="function")return Le.Buffer.from(e,"base64");else if(typeof atob==="function"){let s=atob(e.replace(/[\n\r]/g,"")),n=new Uint8Array(s.length);for(let i=0;i<s.length;++i)n[i]=s.charCodeAt(i);return n}else return t("This environment does not support reading binary tags; either Buffer or atob is required"),e},stringify({comment:e,type:t,value:s},n,i,r){if(!s)return"";let o=s,a;if(typeof Le.Buffer==="function")a=o instanceof Le.Buffer?o.toString("base64"):Le.Buffer.from(o.buffer).toString("base64");else if(typeof btoa==="function"){let l="";for(let c=0;c<o.length;++c)l+=String.fromCharCode(o[c]);a=btoa(l)}else throw Error("This environment does not support writing binary tags; either Buffer or btoa is required");if(t??(t=ts.Scalar.BLOCK_LITERAL),t!==ts.Scalar.QUOTE_DOUBLE){let l=Math.max(n.options.lineWidth-n.indent.length,n.options.minContentWidth),c=Math.ceil(a.length/l),p=Array(c);for(let u=0,f=0;u<c;++u,f+=l)p[u]=a.substr(f,l);a=p.join(t===ts.Scalar.BLOCK_LITERAL?`
|
|
53
|
+
`:" ")}return ic.stringifyString({comment:e,type:t,value:a},n,i,r)}};oc.binary=rc});var mt=g(function(fc){var ht=O(),ns=J(),lc=E(),cc=Q();function Yn(e,t){if(ht.isSeq(e))for(let s=0;s<e.items.length;++s){let n=e.items[s];if(ht.isPair(n))continue;else if(ht.isMap(n)){if(n.items.length>1)t("Each pair must have its own sequence indicator");let i=n.items[0]||new ns.Pair(new lc.Scalar(null));if(n.commentBefore)i.key.commentBefore=i.key.commentBefore?`${n.commentBefore}
|
|
54
54
|
${i.key.commentBefore}`:n.commentBefore;if(n.comment){let r=i.value??i.key;r.comment=r.comment?`${n.comment}
|
|
55
|
-
${r.comment}`:n.comment}n=i}e.items[s]=ht.isPair(n)?n:new ns.Pair(n)}else t("Expected a sequence for this tag");return e}function Vn(e,t,s){let{replacer:n}=s,i=new cc.YAMLSeq(e);i.tag="tag:yaml.org,2002:pairs";let r=0;if(t&&Symbol.iterator in Object(t))for(let o of t){if(typeof n==="function")o=n.call(t,String(r++),o);let a,l;if(Array.isArray(o))if(o.length===2)a=o[0],l=o[1];else throw TypeError(`Expected [key, value] tuple: ${o}`);else if(o&&o instanceof Object){let c=Object.keys(o);if(c.length===1)a=c[0],l=o[a];else throw TypeError(`Expected tuple with one key, not ${c.length} keys`)}else a=o;i.items.push(ns.createPair(a,l,s))}return i}var uc={collection:"seq",default:!1,tag:"tag:yaml.org,2002:pairs",resolve:Yn,createNode:Vn};fc.createPairs=Vn;fc.pairs=uc;fc.resolvePairs=Yn});var rs=g(function(yc){var Jn=O(),is=U(),Pe=W(),mc=Q(),Hn=mt();class te extends mc.YAMLSeq{constructor(){super();this.add=Pe.YAMLMap.prototype.add.bind(this),this.delete=Pe.YAMLMap.prototype.delete.bind(this),this.get=Pe.YAMLMap.prototype.get.bind(this),this.has=Pe.YAMLMap.prototype.has.bind(this),this.set=Pe.YAMLMap.prototype.set.bind(this),this.tag=te.tag}toJSON(e,t){if(!t)return super.toJSON(e);let s=new Map;if(t?.onCreate)t.onCreate(s);for(let n of this.items){let i,r;if(Jn.isPair(n))i=is.toJS(n.key,"",t),r=is.toJS(n.value,i,t);else i=is.toJS(n,"",t);if(s.has(i))throw Error("Ordered maps must not include duplicate keys");s.set(i,r)}return s}static from(e,t,s){let n=Hn.createPairs(e,t,s),i=new this;return i.items=n.items,i}}te.tag="tag:yaml.org,2002:omap";var gc={collection:"seq",identify:(e)=>e instanceof Map,nodeClass:te,default:!1,tag:"tag:yaml.org,2002:omap",resolve(e,t){let s=Hn.resolvePairs(e,t),n=[];for(let{key:i}of s.items)if(Jn.isScalar(i))if(n.includes(i.value))t(`Ordered maps must not include duplicate keys: ${i.value}`);else n.push(i.value);return Object.assign(new te,s)},createNode:(e,t,s)=>te.from(e,t,s)};yc.YAMLOMap=te;yc.omap=gc});var Xn=g(function(Sc){var Wn=q();function Qn({value:e,source:t},s){if(t&&(e?zn:Gn).test.test(t))return t;return e?s.options.trueStr:s.options.falseStr}var zn={identify:(e)=>e===!0,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:Y|y|[Yy]es|YES|[Tt]rue|TRUE|[Oo]n|ON)$/,resolve:()=>new Wn.Scalar(!0),stringify:Qn},Gn={identify:(e)=>e===!1,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:N|n|[Nn]o|NO|[Ff]alse|FALSE|[Oo]ff|OFF)$/,resolve:()=>new Wn.Scalar(!1),stringify:Qn};Sc.falseTag=Gn;Sc.trueTag=zn});var Zn=g(function(qc){var Nc=q(),os=pe(),Ac={identify:(e)=>typeof e==="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:(e)=>e.slice(-3).toLowerCase()==="nan"?NaN:e[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:os.stringifyNumber},Oc={identify:(e)=>typeof e==="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:[0-9][0-9_]*)?(?:\.[0-9_]*)?[eE][-+]?[0-9]+$/,resolve:(e)=>parseFloat(e.replace(/_/g,"")),stringify(e){let t=Number(e.value);return isFinite(t)?t.toExponential():os.stringifyNumber(e)}},Ec={identify:(e)=>typeof e==="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:[0-9][0-9_]*)?\.[0-9_]*$/,resolve(e){let t=new Nc.Scalar(parseFloat(e.replace(/_/g,""))),s=e.indexOf(".");if(s!==-1){let n=e.substring(s+1).replace(/_/g,"");if(n[n.length-1]==="0")t.minFractionDigits=n.length}return t},stringify:os.stringifyNumber};qc.float=Ec;qc.floatExp=Oc;qc.floatNaN=Ac});var ti=g(function(_c){var ei=pe(),Te=(e)=>typeof e==="bigint"||Number.isInteger(e);function gt(e,t,s,{intAsBigInt:n}){let i=e[0];if(i==="-"||i==="+")t+=1;if(e=e.substring(t).replace(/_/g,""),n){switch(s){case 2:e=`0b${e}`;break;case 8:e=`0o${e}`;break;case 16:e=`0x${e}`;break}let o=BigInt(e);return i==="-"?BigInt(-1)*o:o}let r=parseInt(e,s);return i==="-"?-1*r:r}function as(e,t,s){let{value:n}=e;if(Te(n)){let i=n.toString(t);return n<0?"-"+s+i.substr(1):s+i}return ei.stringifyNumber(e)}var Tc={identify:Te,default:!0,tag:"tag:yaml.org,2002:int",format:"BIN",test:/^[-+]?0b[0-1_]+$/,resolve:(e,t,s)=>gt(e,2,2,s),stringify:(e)=>as(e,2,"0b")},Ic={identify:Te,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^[-+]?0[0-7_]+$/,resolve:(e,t,s)=>gt(e,1,8,s),stringify:(e)=>as(e,8,"0")},Mc={identify:Te,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9][0-9_]*$/,resolve:(e,t,s)=>gt(e,0,10,s),stringify:ei.stringifyNumber},$c={identify:Te,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:(e,t,s)=>gt(e,2,16,s),stringify:(e)=>as(e,16,"0x")};_c.int=Mc;_c.intBin=Tc;_c.intHex=$c;_c.intOct=Ic});var ls=g(function(jc){var wt=O(),yt=J(),bt=W();class se extends bt.YAMLMap{constructor(e){super(e);this.tag=se.tag}add(e){let t;if(wt.isPair(e))t=e;else if(e&&typeof e==="object"&&"key"in e&&"value"in e&&e.value===null)t=new yt.Pair(e.key,null);else t=new yt.Pair(e,null);if(!bt.findPair(this.items,t.key))this.items.push(t)}get(e,t){let s=bt.findPair(this.items,e);return!t&&wt.isPair(s)?wt.isScalar(s.key)?s.key.value:s.key:s}set(e,t){if(typeof t!=="boolean")throw Error(`Expected boolean value for set(key, value) in a YAML set, not ${typeof t}`);let s=bt.findPair(this.items,e);if(s&&!t)this.items.splice(this.items.indexOf(s),1);else if(!s&&t)this.items.push(new yt.Pair(e))}toJSON(e,t){return super.toJSON(e,t,Set)}toString(e,t,s){if(!e)return JSON.stringify(this);if(this.hasAllNullValues(!0))return super.toString(Object.assign({},e,{allNullValues:!0}),t,s);else throw Error("Set items must all have null values")}static from(e,t,s){let{replacer:n}=s,i=new this(e);if(t&&Symbol.iterator in Object(t))for(let r of t){if(typeof n==="function")r=n.call(t,r,r);i.items.push(yt.createPair(r,null,s))}return i}}se.tag="tag:yaml.org,2002:set";var Kc={collection:"map",identify:(e)=>e instanceof Set,nodeClass:se,default:!1,tag:"tag:yaml.org,2002:set",createNode:(e,t,s)=>se.from(e,t,s),resolve(e,t){if(wt.isMap(e))if(e.hasAllNullValues(!0))return Object.assign(new se,e);else t("Set items must all have null values");else t("Expected a mapping for this tag");return e}};jc.YAMLSet=se;jc.set=Kc});var us=g(function(Hc){var Yc=pe();function cs(e,t){let s=e[0],n=s==="-"||s==="+"?e.substring(1):e,i=(o)=>t?BigInt(o):Number(o),r=n.replace(/_/g,"").split(":").reduce((o,a)=>o*i(60)+i(a),i(0));return s==="-"?i(-1)*r:r}function si(e){let{value:t}=e,s=(o)=>o;if(typeof t==="bigint")s=(o)=>BigInt(o);else if(isNaN(t)||!isFinite(t))return Yc.stringifyNumber(e);let n="";if(t<0)n="-",t*=s(-1);let i=s(60),r=[t%i];if(t<60)r.unshift(0);else if(t=(t-r[0])/i,r.unshift(t%i),t>=60)t=(t-r[0])/i,r.unshift(t);return n+r.map((o)=>String(o).padStart(2,"0")).join(":").replace(/000000\d*$/,"")}var Vc={identify:(e)=>typeof e==="bigint"||Number.isInteger(e),default:!0,tag:"tag:yaml.org,2002:int",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+$/,resolve:(e,t,{intAsBigInt:s})=>cs(e,s),stringify:si},Jc={identify:(e)=>typeof e==="number",default:!0,tag:"tag:yaml.org,2002:float",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\.[0-9_]*$/,resolve:(e)=>cs(e,!1),stringify:si},ni={identify:(e)=>e instanceof Date,default:!0,tag:"tag:yaml.org,2002:timestamp",test:RegExp("^([0-9]{4})-([0-9]{1,2})-([0-9]{1,2})(?:(?:t|T|[ \\t]+)([0-9]{1,2}):([0-9]{1,2}):([0-9]{1,2}(\\.[0-9]+)?)(?:[ \\t]*(Z|[-+][012]?[0-9](?::[0-9]{2})?))?)?$"),resolve(e){let t=e.match(ni.test);if(!t)throw Error("!!timestamp expects a date, starting with yyyy-mm-dd");let[,s,n,i,r,o,a]=t.map(Number),l=t[7]?Number((t[7]+"00").substr(1,3)):0,c=Date.UTC(s,n-1,i,r||0,o||0,a||0,l),p=t[8];if(p&&p!=="Z"){let u=cs(p,!1);if(Math.abs(u)<30)u*=60;c-=60000*u}return new Date(c)},stringify:({value:e})=>e?.toISOString().replace(/(T00:00:00)?\.000Z$/,"")??""};Hc.floatTime=Jc;Hc.intTime=Vc;Hc.timestamp=ni});var ri=g(function(au){var Gc=fe(),Xc=ft(),Zc=de(),eu=Ce(),tu=ss(),ii=Xn(),fs=Zn(),St=ti(),su=nt(),nu=rs(),iu=mt(),ru=ls(),ds=us(),ou=[Gc.map,Zc.seq,eu.string,Xc.nullTag,ii.trueTag,ii.falseTag,St.intBin,St.intOct,St.int,St.intHex,fs.floatNaN,fs.floatExp,fs.float,tu.binary,su.merge,nu.omap,iu.pairs,ru.set,ds.intTime,ds.floatTime,ds.timestamp];au.schema=ou});var mi=g(function(gu){var ci=fe(),cu=ft(),ui=de(),uu=Ce(),fu=Wt(),ps=zt(),hs=Xt(),du=jn(),pu=Un(),fi=ss(),Ie=nt(),di=rs(),pi=mt(),oi=ri(),hi=ls(),vt=us(),ai=new Map([["core",du.schema],["failsafe",[ci.map,ui.seq,uu.string]],["json",pu.schema],["yaml11",oi.schema],["yaml-1.1",oi.schema]]),li={binary:fi.binary,bool:fu.boolTag,float:ps.float,floatExp:ps.floatExp,floatNaN:ps.floatNaN,floatTime:vt.floatTime,int:hs.int,intHex:hs.intHex,intOct:hs.intOct,intTime:vt.intTime,map:ci.map,merge:Ie.merge,null:cu.nullTag,omap:di.omap,pairs:pi.pairs,seq:ui.seq,set:hi.set,timestamp:vt.timestamp},hu={"tag:yaml.org,2002:binary":fi.binary,"tag:yaml.org,2002:merge":Ie.merge,"tag:yaml.org,2002:omap":di.omap,"tag:yaml.org,2002:pairs":pi.pairs,"tag:yaml.org,2002:set":hi.set,"tag:yaml.org,2002:timestamp":vt.timestamp};function mu(e,t,s){let n=ai.get(t);if(n&&!e)return s&&!n.includes(Ie.merge)?n.concat(Ie.merge):n.slice();let i=n;if(!i)if(Array.isArray(e))i=[];else{let r=Array.from(ai.keys()).filter((o)=>o!=="yaml11").map((o)=>JSON.stringify(o)).join(", ");throw Error(`Unknown schema "${t}"; use one of ${r} or define customTags array`)}if(Array.isArray(e))for(let r of e)i=i.concat(r);else if(typeof e==="function")i=e(i.slice());if(s)i=i.concat(Ie.merge);return i.reduce((r,o)=>{let a=typeof o==="string"?li[o]:o;if(!a){let l=JSON.stringify(o),c=Object.keys(li).map((p)=>JSON.stringify(p)).join(", ");throw Error(`Unknown custom tag ${l}; use one of ${c}`)}if(!r.includes(a))r.push(a);return r},[])}gu.coreKnownTags=hu;gu.getTags=mu});var ys=g(function(Nu){var ms=O(),wu=fe(),Su=de(),vu=Ce(),kt=mi(),ku=(e,t)=>e.key<t.key?-1:e.key>t.key?1:0;class gs{constructor({compat:e,customTags:t,merge:s,resolveKnownTags:n,schema:i,sortMapEntries:r,toStringDefaults:o}){this.compat=Array.isArray(e)?kt.getTags(e,"compat"):e?kt.getTags(null,e):null,this.name=typeof i==="string"&&i||"core",this.knownTags=n?kt.coreKnownTags:{},this.tags=kt.getTags(t,this.name,s),this.toStringOptions=o??null,Object.defineProperty(this,ms.MAP,{value:wu.map}),Object.defineProperty(this,ms.SCALAR,{value:vu.string}),Object.defineProperty(this,ms.SEQ,{value:Su.seq}),this.sortMapEntries=typeof r==="function"?r:r===!0?ku:null}clone(){let e=Object.create(gs.prototype,Object.getOwnPropertyDescriptors(this));return e.tags=this.tags.slice(),e}}Nu.Schema=gs});var gi=g(function(qu){var Ou=O(),bs=Oe(),Me=ke();function Eu(e,t){let s=[],n=t.directives===!0;if(t.directives!==!1&&e.directives){let l=e.directives.toString(e);if(l)s.push(l),n=!0;else if(e.directives.docStart)n=!0}if(n)s.push("---");let i=bs.createStringifyContext(e,t),{commentString:r}=i.options;if(e.commentBefore){if(s.length!==1)s.unshift("");let l=r(e.commentBefore);s.unshift(Me.indentComment(l,""))}let o=!1,a=null;if(e.contents){if(Ou.isNode(e.contents)){if(e.contents.spaceBefore&&n)s.push("");if(e.contents.commentBefore){let p=r(e.contents.commentBefore);s.push(Me.indentComment(p,""))}i.forceBlockIndent=!!e.comment,a=e.contents.comment}let l=a?void 0:()=>o=!0,c=bs.stringify(e.contents,i,()=>a=null,l);if(a)c+=Me.lineComment(c,"",r(a));if((c[0]==="|"||c[0]===">")&&s[s.length-1]==="---")s[s.length-1]=`--- ${c}`;else s.push(c)}else s.push(bs.stringify(e.contents,i));if(e.directives?.docEnd)if(e.comment){let l=r(e.comment);if(l.includes(`
|
|
55
|
+
${r.comment}`:n.comment}n=i}e.items[s]=ht.isPair(n)?n:new ns.Pair(n)}else t("Expected a sequence for this tag");return e}function Vn(e,t,s){let{replacer:n}=s,i=new cc.YAMLSeq(e);i.tag="tag:yaml.org,2002:pairs";let r=0;if(t&&Symbol.iterator in Object(t))for(let o of t){if(typeof n==="function")o=n.call(t,String(r++),o);let a,l;if(Array.isArray(o))if(o.length===2)a=o[0],l=o[1];else throw TypeError(`Expected [key, value] tuple: ${o}`);else if(o&&o instanceof Object){let c=Object.keys(o);if(c.length===1)a=c[0],l=o[a];else throw TypeError(`Expected tuple with one key, not ${c.length} keys`)}else a=o;i.items.push(ns.createPair(a,l,s))}return i}var uc={collection:"seq",default:!1,tag:"tag:yaml.org,2002:pairs",resolve:Yn,createNode:Vn};fc.createPairs=Vn;fc.pairs=uc;fc.resolvePairs=Yn});var rs=g(function(yc){var Jn=O(),is=U(),Pe=W(),mc=Q(),Hn=mt();class te extends mc.YAMLSeq{constructor(){super();this.add=Pe.YAMLMap.prototype.add.bind(this),this.delete=Pe.YAMLMap.prototype.delete.bind(this),this.get=Pe.YAMLMap.prototype.get.bind(this),this.has=Pe.YAMLMap.prototype.has.bind(this),this.set=Pe.YAMLMap.prototype.set.bind(this),this.tag=te.tag}toJSON(e,t){if(!t)return super.toJSON(e);let s=new Map;if(t?.onCreate)t.onCreate(s);for(let n of this.items){let i,r;if(Jn.isPair(n))i=is.toJS(n.key,"",t),r=is.toJS(n.value,i,t);else i=is.toJS(n,"",t);if(s.has(i))throw Error("Ordered maps must not include duplicate keys");s.set(i,r)}return s}static from(e,t,s){let n=Hn.createPairs(e,t,s),i=new this;return i.items=n.items,i}}te.tag="tag:yaml.org,2002:omap";var gc={collection:"seq",identify:(e)=>e instanceof Map,nodeClass:te,default:!1,tag:"tag:yaml.org,2002:omap",resolve(e,t){let s=Hn.resolvePairs(e,t),n=[];for(let{key:i}of s.items)if(Jn.isScalar(i))if(n.includes(i.value))t(`Ordered maps must not include duplicate keys: ${i.value}`);else n.push(i.value);return Object.assign(new te,s)},createNode:(e,t,s)=>te.from(e,t,s)};yc.YAMLOMap=te;yc.omap=gc});var Xn=g(function(Sc){var Wn=E();function Qn({value:e,source:t},s){if(t&&(e?zn:Gn).test.test(t))return t;return e?s.options.trueStr:s.options.falseStr}var zn={identify:(e)=>e===!0,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:Y|y|[Yy]es|YES|[Tt]rue|TRUE|[Oo]n|ON)$/,resolve:()=>new Wn.Scalar(!0),stringify:Qn},Gn={identify:(e)=>e===!1,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:N|n|[Nn]o|NO|[Ff]alse|FALSE|[Oo]ff|OFF)$/,resolve:()=>new Wn.Scalar(!1),stringify:Qn};Sc.falseTag=Gn;Sc.trueTag=zn});var Zn=g(function(Ec){var Nc=E(),os=pe(),Ac={identify:(e)=>typeof e==="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:(e)=>e.slice(-3).toLowerCase()==="nan"?NaN:e[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:os.stringifyNumber},Oc={identify:(e)=>typeof e==="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:[0-9][0-9_]*)?(?:\.[0-9_]*)?[eE][-+]?[0-9]+$/,resolve:(e)=>parseFloat(e.replace(/_/g,"")),stringify(e){let t=Number(e.value);return isFinite(t)?t.toExponential():os.stringifyNumber(e)}},Cc={identify:(e)=>typeof e==="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:[0-9][0-9_]*)?\.[0-9_]*$/,resolve(e){let t=new Nc.Scalar(parseFloat(e.replace(/_/g,""))),s=e.indexOf(".");if(s!==-1){let n=e.substring(s+1).replace(/_/g,"");if(n[n.length-1]==="0")t.minFractionDigits=n.length}return t},stringify:os.stringifyNumber};Ec.float=Cc;Ec.floatExp=Oc;Ec.floatNaN=Ac});var ti=g(function(_c){var ei=pe(),Te=(e)=>typeof e==="bigint"||Number.isInteger(e);function gt(e,t,s,{intAsBigInt:n}){let i=e[0];if(i==="-"||i==="+")t+=1;if(e=e.substring(t).replace(/_/g,""),n){switch(s){case 2:e=`0b${e}`;break;case 8:e=`0o${e}`;break;case 16:e=`0x${e}`;break}let o=BigInt(e);return i==="-"?BigInt(-1)*o:o}let r=parseInt(e,s);return i==="-"?-1*r:r}function as(e,t,s){let{value:n}=e;if(Te(n)){let i=n.toString(t);return n<0?"-"+s+i.substr(1):s+i}return ei.stringifyNumber(e)}var Tc={identify:Te,default:!0,tag:"tag:yaml.org,2002:int",format:"BIN",test:/^[-+]?0b[0-1_]+$/,resolve:(e,t,s)=>gt(e,2,2,s),stringify:(e)=>as(e,2,"0b")},Ic={identify:Te,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^[-+]?0[0-7_]+$/,resolve:(e,t,s)=>gt(e,1,8,s),stringify:(e)=>as(e,8,"0")},Mc={identify:Te,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9][0-9_]*$/,resolve:(e,t,s)=>gt(e,0,10,s),stringify:ei.stringifyNumber},$c={identify:Te,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:(e,t,s)=>gt(e,2,16,s),stringify:(e)=>as(e,16,"0x")};_c.int=Mc;_c.intBin=Tc;_c.intHex=$c;_c.intOct=Ic});var ls=g(function(jc){var wt=O(),yt=J(),bt=W();class se extends bt.YAMLMap{constructor(e){super(e);this.tag=se.tag}add(e){let t;if(wt.isPair(e))t=e;else if(e&&typeof e==="object"&&"key"in e&&"value"in e&&e.value===null)t=new yt.Pair(e.key,null);else t=new yt.Pair(e,null);if(!bt.findPair(this.items,t.key))this.items.push(t)}get(e,t){let s=bt.findPair(this.items,e);return!t&&wt.isPair(s)?wt.isScalar(s.key)?s.key.value:s.key:s}set(e,t){if(typeof t!=="boolean")throw Error(`Expected boolean value for set(key, value) in a YAML set, not ${typeof t}`);let s=bt.findPair(this.items,e);if(s&&!t)this.items.splice(this.items.indexOf(s),1);else if(!s&&t)this.items.push(new yt.Pair(e))}toJSON(e,t){return super.toJSON(e,t,Set)}toString(e,t,s){if(!e)return JSON.stringify(this);if(this.hasAllNullValues(!0))return super.toString(Object.assign({},e,{allNullValues:!0}),t,s);else throw Error("Set items must all have null values")}static from(e,t,s){let{replacer:n}=s,i=new this(e);if(t&&Symbol.iterator in Object(t))for(let r of t){if(typeof n==="function")r=n.call(t,r,r);i.items.push(yt.createPair(r,null,s))}return i}}se.tag="tag:yaml.org,2002:set";var Kc={collection:"map",identify:(e)=>e instanceof Set,nodeClass:se,default:!1,tag:"tag:yaml.org,2002:set",createNode:(e,t,s)=>se.from(e,t,s),resolve(e,t){if(wt.isMap(e))if(e.hasAllNullValues(!0))return Object.assign(new se,e);else t("Set items must all have null values");else t("Expected a mapping for this tag");return e}};jc.YAMLSet=se;jc.set=Kc});var us=g(function(Hc){var Yc=pe();function cs(e,t){let s=e[0],n=s==="-"||s==="+"?e.substring(1):e,i=(o)=>t?BigInt(o):Number(o),r=n.replace(/_/g,"").split(":").reduce((o,a)=>o*i(60)+i(a),i(0));return s==="-"?i(-1)*r:r}function si(e){let{value:t}=e,s=(o)=>o;if(typeof t==="bigint")s=(o)=>BigInt(o);else if(isNaN(t)||!isFinite(t))return Yc.stringifyNumber(e);let n="";if(t<0)n="-",t*=s(-1);let i=s(60),r=[t%i];if(t<60)r.unshift(0);else if(t=(t-r[0])/i,r.unshift(t%i),t>=60)t=(t-r[0])/i,r.unshift(t);return n+r.map((o)=>String(o).padStart(2,"0")).join(":").replace(/000000\d*$/,"")}var Vc={identify:(e)=>typeof e==="bigint"||Number.isInteger(e),default:!0,tag:"tag:yaml.org,2002:int",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+$/,resolve:(e,t,{intAsBigInt:s})=>cs(e,s),stringify:si},Jc={identify:(e)=>typeof e==="number",default:!0,tag:"tag:yaml.org,2002:float",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\.[0-9_]*$/,resolve:(e)=>cs(e,!1),stringify:si},ni={identify:(e)=>e instanceof Date,default:!0,tag:"tag:yaml.org,2002:timestamp",test:RegExp("^([0-9]{4})-([0-9]{1,2})-([0-9]{1,2})(?:(?:t|T|[ \\t]+)([0-9]{1,2}):([0-9]{1,2}):([0-9]{1,2}(\\.[0-9]+)?)(?:[ \\t]*(Z|[-+][012]?[0-9](?::[0-9]{2})?))?)?$"),resolve(e){let t=e.match(ni.test);if(!t)throw Error("!!timestamp expects a date, starting with yyyy-mm-dd");let[,s,n,i,r,o,a]=t.map(Number),l=t[7]?Number((t[7]+"00").substr(1,3)):0,c=Date.UTC(s,n-1,i,r||0,o||0,a||0,l),p=t[8];if(p&&p!=="Z"){let u=cs(p,!1);if(Math.abs(u)<30)u*=60;c-=60000*u}return new Date(c)},stringify:({value:e})=>e?.toISOString().replace(/(T00:00:00)?\.000Z$/,"")??""};Hc.floatTime=Jc;Hc.intTime=Vc;Hc.timestamp=ni});var ri=g(function(au){var Gc=fe(),Xc=ft(),Zc=de(),eu=qe(),tu=ss(),ii=Xn(),fs=Zn(),St=ti(),su=nt(),nu=rs(),iu=mt(),ru=ls(),ds=us(),ou=[Gc.map,Zc.seq,eu.string,Xc.nullTag,ii.trueTag,ii.falseTag,St.intBin,St.intOct,St.int,St.intHex,fs.floatNaN,fs.floatExp,fs.float,tu.binary,su.merge,nu.omap,iu.pairs,ru.set,ds.intTime,ds.floatTime,ds.timestamp];au.schema=ou});var mi=g(function(gu){var ci=fe(),cu=ft(),ui=de(),uu=qe(),fu=Wt(),ps=zt(),hs=Xt(),du=jn(),pu=Un(),fi=ss(),Ie=nt(),di=rs(),pi=mt(),oi=ri(),hi=ls(),vt=us(),ai=new Map([["core",du.schema],["failsafe",[ci.map,ui.seq,uu.string]],["json",pu.schema],["yaml11",oi.schema],["yaml-1.1",oi.schema]]),li={binary:fi.binary,bool:fu.boolTag,float:ps.float,floatExp:ps.floatExp,floatNaN:ps.floatNaN,floatTime:vt.floatTime,int:hs.int,intHex:hs.intHex,intOct:hs.intOct,intTime:vt.intTime,map:ci.map,merge:Ie.merge,null:cu.nullTag,omap:di.omap,pairs:pi.pairs,seq:ui.seq,set:hi.set,timestamp:vt.timestamp},hu={"tag:yaml.org,2002:binary":fi.binary,"tag:yaml.org,2002:merge":Ie.merge,"tag:yaml.org,2002:omap":di.omap,"tag:yaml.org,2002:pairs":pi.pairs,"tag:yaml.org,2002:set":hi.set,"tag:yaml.org,2002:timestamp":vt.timestamp};function mu(e,t,s){let n=ai.get(t);if(n&&!e)return s&&!n.includes(Ie.merge)?n.concat(Ie.merge):n.slice();let i=n;if(!i)if(Array.isArray(e))i=[];else{let r=Array.from(ai.keys()).filter((o)=>o!=="yaml11").map((o)=>JSON.stringify(o)).join(", ");throw Error(`Unknown schema "${t}"; use one of ${r} or define customTags array`)}if(Array.isArray(e))for(let r of e)i=i.concat(r);else if(typeof e==="function")i=e(i.slice());if(s)i=i.concat(Ie.merge);return i.reduce((r,o)=>{let a=typeof o==="string"?li[o]:o;if(!a){let l=JSON.stringify(o),c=Object.keys(li).map((p)=>JSON.stringify(p)).join(", ");throw Error(`Unknown custom tag ${l}; use one of ${c}`)}if(!r.includes(a))r.push(a);return r},[])}gu.coreKnownTags=hu;gu.getTags=mu});var ys=g(function(Nu){var ms=O(),wu=fe(),Su=de(),vu=qe(),kt=mi(),ku=(e,t)=>e.key<t.key?-1:e.key>t.key?1:0;class gs{constructor({compat:e,customTags:t,merge:s,resolveKnownTags:n,schema:i,sortMapEntries:r,toStringDefaults:o}){this.compat=Array.isArray(e)?kt.getTags(e,"compat"):e?kt.getTags(null,e):null,this.name=typeof i==="string"&&i||"core",this.knownTags=n?kt.coreKnownTags:{},this.tags=kt.getTags(t,this.name,s),this.toStringOptions=o??null,Object.defineProperty(this,ms.MAP,{value:wu.map}),Object.defineProperty(this,ms.SCALAR,{value:vu.string}),Object.defineProperty(this,ms.SEQ,{value:Su.seq}),this.sortMapEntries=typeof r==="function"?r:r===!0?ku:null}clone(){let e=Object.create(gs.prototype,Object.getOwnPropertyDescriptors(this));return e.tags=this.tags.slice(),e}}Nu.Schema=gs});var gi=g(function(Eu){var Ou=O(),bs=Oe(),Me=ke();function Cu(e,t){let s=[],n=t.directives===!0;if(t.directives!==!1&&e.directives){let l=e.directives.toString(e);if(l)s.push(l),n=!0;else if(e.directives.docStart)n=!0}if(n)s.push("---");let i=bs.createStringifyContext(e,t),{commentString:r}=i.options;if(e.commentBefore){if(s.length!==1)s.unshift("");let l=r(e.commentBefore);s.unshift(Me.indentComment(l,""))}let o=!1,a=null;if(e.contents){if(Ou.isNode(e.contents)){if(e.contents.spaceBefore&&n)s.push("");if(e.contents.commentBefore){let p=r(e.contents.commentBefore);s.push(Me.indentComment(p,""))}i.forceBlockIndent=!!e.comment,a=e.contents.comment}let l=a?void 0:()=>o=!0,c=bs.stringify(e.contents,i,()=>a=null,l);if(a)c+=Me.lineComment(c,"",r(a));if((c[0]==="|"||c[0]===">")&&s[s.length-1]==="---")s[s.length-1]=`--- ${c}`;else s.push(c)}else s.push(bs.stringify(e.contents,i));if(e.directives?.docEnd)if(e.comment){let l=r(e.comment);if(l.includes(`
|
|
56
56
|
`))s.push("..."),s.push(Me.indentComment(l,""));else s.push(`... ${l}`)}else s.push("...");else{let l=e.comment;if(l&&o)l=l.replace(/^\n+/,"");if(l){if((!o||a)&&s[s.length-1]!=="")s.push("");s.push(Me.indentComment(r(l),""))}}return s.join(`
|
|
57
57
|
`)+`
|
|
58
|
-
`}
|
|
58
|
+
`}Eu.stringifyDocument=Cu});var $e=g(function(xu){var Lu=Se(),he=ze(),_=O(),Pu=J(),Tu=U(),Iu=ys(),Mu=gi(),ws=He(),$u=Bt(),_u=ve(),Ss=Dt();class vs{constructor(e,t,s){this.commentBefore=null,this.comment=null,this.errors=[],this.warnings=[],Object.defineProperty(this,_.NODE_TYPE,{value:_.DOC});let n=null;if(typeof t==="function"||Array.isArray(t))n=t;else if(s===void 0&&t)s=t,t=void 0;let i=Object.assign({intAsBigInt:!1,keepSourceTokens:!1,logLevel:"warn",prettyErrors:!0,strict:!0,stringKeys:!1,uniqueKeys:!0,version:"1.2"},s);this.options=i;let{version:r}=i;if(s?._directives){if(this.directives=s._directives.atDocument(),this.directives.yaml.explicit)r=this.directives.yaml.version}else this.directives=new Ss.Directives({version:r});this.setSchema(r,s),this.contents=e===void 0?null:this.createNode(e,n,s)}clone(){let e=Object.create(vs.prototype,{[_.NODE_TYPE]:{value:_.DOC}});if(e.commentBefore=this.commentBefore,e.comment=this.comment,e.errors=this.errors.slice(),e.warnings=this.warnings.slice(),e.options=Object.assign({},this.options),this.directives)e.directives=this.directives.clone();if(e.schema=this.schema.clone(),e.contents=_.isNode(this.contents)?this.contents.clone(e.schema):this.contents,this.range)e.range=this.range.slice();return e}add(e){if(me(this.contents))this.contents.add(e)}addIn(e,t){if(me(this.contents))this.contents.addIn(e,t)}createAlias(e,t){if(!e.anchor){let s=ws.anchorNames(this);e.anchor=!t||s.has(t)?ws.findNewAnchor(t||"a",s):t}return new Lu.Alias(e.anchor)}createNode(e,t,s){let n=void 0;if(typeof t==="function")e=t.call({"":e},"",e),n=t;else if(Array.isArray(t)){let d=(w)=>typeof w==="number"||w instanceof String||w instanceof Number,h=t.filter(d).map(String);if(h.length>0)t=t.concat(h);n=t}else if(s===void 0&&t)s=t,t=void 0;let{aliasDuplicateObjects:i,anchorPrefix:r,flow:o,keepUndefined:a,onTagObj:l,tag:c}=s??{},{onAnchor:p,setAnchors:u,sourceObjects:f}=ws.createNodeAnchors(this,r||"a"),m={aliasDuplicateObjects:i??!0,keepUndefined:a??!1,onAnchor:p,onTagObj:l,replacer:n,schema:this.schema,sourceObjects:f},y=_u.createNode(e,c,m);if(o&&_.isCollection(y))y.flow=!0;return u(),y}createPair(e,t,s={}){let n=this.createNode(e,null,s),i=this.createNode(t,null,s);return new Pu.Pair(n,i)}delete(e){return me(this.contents)?this.contents.delete(e):!1}deleteIn(e){if(he.isEmptyPath(e)){if(this.contents==null)return!1;return this.contents=null,!0}return me(this.contents)?this.contents.deleteIn(e):!1}get(e,t){return _.isCollection(this.contents)?this.contents.get(e,t):void 0}getIn(e,t){if(he.isEmptyPath(e))return!t&&_.isScalar(this.contents)?this.contents.value:this.contents;return _.isCollection(this.contents)?this.contents.getIn(e,t):void 0}has(e){return _.isCollection(this.contents)?this.contents.has(e):!1}hasIn(e){if(he.isEmptyPath(e))return this.contents!==void 0;return _.isCollection(this.contents)?this.contents.hasIn(e):!1}set(e,t){if(this.contents==null)this.contents=he.collectionFromPath(this.schema,[e],t);else if(me(this.contents))this.contents.set(e,t)}setIn(e,t){if(he.isEmptyPath(e))this.contents=t;else if(this.contents==null)this.contents=he.collectionFromPath(this.schema,Array.from(e),t);else if(me(this.contents))this.contents.setIn(e,t)}setSchema(e,t={}){if(typeof e==="number")e=String(e);let s;switch(e){case"1.1":if(this.directives)this.directives.yaml.version="1.1";else this.directives=new Ss.Directives({version:"1.1"});s={resolveKnownTags:!1,schema:"yaml-1.1"};break;case"1.2":case"next":if(this.directives)this.directives.yaml.version=e;else this.directives=new Ss.Directives({version:e});s={resolveKnownTags:!0,schema:"core"};break;case null:if(this.directives)delete this.directives;s=null;break;default:{let n=JSON.stringify(e);throw Error(`Expected '1.1', '1.2' or null as first argument, but found: ${n}`)}}if(t.schema instanceof Object)this.schema=t.schema;else if(s)this.schema=new Iu.Schema(Object.assign(s,t));else throw Error("With a null YAML version, the { schema: Schema } option is required")}toJS({json:e,jsonArg:t,mapAsMap:s,maxAliasCount:n,onAnchor:i,reviver:r}={}){let o={anchors:new Map,doc:this,keep:!e,mapAsMap:s===!0,mapKeyWarned:!1,maxAliasCount:typeof n==="number"?n:100},a=Tu.toJS(this.contents,t??"",o);if(typeof i==="function")for(let{count:l,res:c}of o.anchors.values())i(c,l);return typeof r==="function"?$u.applyReviver(r,{"":a},"",a):a}toJSON(e,t){return this.toJS({json:!0,jsonArg:e,mapAsMap:!1,onAnchor:t})}toString(e={}){if(this.errors.length>0)throw Error("Document with errors cannot be stringified");if("indent"in e&&(!Number.isInteger(e.indent)||Number(e.indent)<=0)){let t=JSON.stringify(e.indent);throw Error(`"indent" option must be a positive integer, not ${t}`)}return Mu.stringifyDocument(this,e)}}function me(e){if(_.isCollection(e))return!0;throw Error("Expected a YAML collection as document contents")}xu.Document=vs});var _e=g(function(Ru){class Nt extends Error{constructor(e,t,s,n){super();this.name=e,this.code=s,this.message=n,this.pos=t}}class yi extends Nt{constructor(e,t,s){super("YAMLParseError",e,t,s)}}class bi extends Nt{constructor(e,t,s){super("YAMLWarning",e,t,s)}}var Bu=(e,t)=>(s)=>{if(s.pos[0]===-1)return;s.linePos=s.pos.map((a)=>t.linePos(a));let{line:n,col:i}=s.linePos[0];s.message+=` at line ${n}, column ${i}`;let r=i-1,o=e.substring(t.lineStarts[n-1],t.lineStarts[n]).replace(/[\n\r]+$/,"");if(r>=60&&o.length>80){let a=Math.min(r-39,o.length-79);o="\u2026"+o.substring(a),r-=a-1}if(o.length>80)o=o.substring(0,79)+"\u2026";if(n>1&&/^ *$/.test(o.substring(0,r))){let a=e.substring(t.lineStarts[n-2],t.lineStarts[n-1]);if(a.length>80)a=a.substring(0,79)+`\u2026
|
|
59
59
|
`;o=a+o}if(/[^ ]/.test(o)){let a=1,l=s.linePos[1];if(l?.line===n&&l.col>i)a=Math.max(1,Math.min(l.col-i,80-r));let c=" ".repeat(r)+"^".repeat(a);s.message+=`:
|
|
60
60
|
|
|
61
61
|
${o}
|
|
62
62
|
${c}
|
|
63
|
-
`}};Ru.YAMLError=Nt;Ru.YAMLParseError=yi;Ru.YAMLWarning=bi;Ru.prettifyError=Bu});var xe=g(function(Vu){function Yu(e,{flow:t,indicator:s,next:n,offset:i,onError:r,parentIndent:o,startOnNewline:a}){let l=!1,c=a,p=a,u="",f="",m=!1,y=!1,d=null,h=null,w=null,S=null,v=null,k=null,N=null;for(let b of e){if(y){if(b.type!=="space"&&b.type!=="newline"&&b.type!=="comma")r(b.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space");y=!1}if(d){if(c&&b.type!=="comment"&&b.type!=="newline")r(d,"TAB_AS_INDENT","Tabs are not allowed as indentation");d=null}switch(b.type){case"space":if(!t&&(s!=="doc-start"||n?.type!=="flow-collection")&&b.source.includes("\t"))d=b;p=!0;break;case"comment":{if(!p)r(b,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");let
|
|
63
|
+
`}};Ru.YAMLError=Nt;Ru.YAMLParseError=yi;Ru.YAMLWarning=bi;Ru.prettifyError=Bu});var xe=g(function(Vu){function Yu(e,{flow:t,indicator:s,next:n,offset:i,onError:r,parentIndent:o,startOnNewline:a}){let l=!1,c=a,p=a,u="",f="",m=!1,y=!1,d=null,h=null,w=null,S=null,v=null,k=null,N=null;for(let b of e){if(y){if(b.type!=="space"&&b.type!=="newline"&&b.type!=="comma")r(b.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space");y=!1}if(d){if(c&&b.type!=="comment"&&b.type!=="newline")r(d,"TAB_AS_INDENT","Tabs are not allowed as indentation");d=null}switch(b.type){case"space":if(!t&&(s!=="doc-start"||n?.type!=="flow-collection")&&b.source.includes("\t"))d=b;p=!0;break;case"comment":{if(!p)r(b,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");let q=b.source.substring(1)||" ";if(!u)u=q;else u+=f+q;f="",c=!1;break}case"newline":if(c){if(u)u+=b.source;else if(!k||s!=="seq-item-ind")l=!0}else f+=b.source;if(c=!0,m=!0,h||w)S=b;p=!0;break;case"anchor":if(h)r(b,"MULTIPLE_ANCHORS","A node can have at most one anchor");if(b.source.endsWith(":"))r(b.offset+b.source.length-1,"BAD_ALIAS","Anchor ending in : is ambiguous",!0);h=b,N??(N=b.offset),c=!1,p=!1,y=!0;break;case"tag":{if(w)r(b,"MULTIPLE_TAGS","A node can have at most one tag");w=b,N??(N=b.offset),c=!1,p=!1,y=!0;break}case s:if(h||w)r(b,"BAD_PROP_ORDER",`Anchors and tags must be after the ${b.source} indicator`);if(k)r(b,"UNEXPECTED_TOKEN",`Unexpected ${b.source} in ${t??"collection"}`);k=b,c=s==="seq-item-ind"||s==="explicit-key-ind",p=!1;break;case"comma":if(t){if(v)r(b,"UNEXPECTED_TOKEN",`Unexpected , in ${t}`);v=b,c=!1,p=!1;break}default:r(b,"UNEXPECTED_TOKEN",`Unexpected ${b.type} token`),c=!1,p=!1}}let A=e[e.length-1],C=A?A.offset+A.source.length:i;if(y&&n&&n.type!=="space"&&n.type!=="newline"&&n.type!=="comma"&&(n.type!=="scalar"||n.source!==""))r(n.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space");if(d&&(c&&d.indent<=o||n?.type==="block-map"||n?.type==="block-seq"))r(d,"TAB_AS_INDENT","Tabs are not allowed as indentation");return{comma:v,found:k,spaceBefore:l,comment:u,hasNewline:m,anchor:h,tag:w,newlineAfterProp:S,end:C,start:N??C}}Vu.resolveProps=Yu});var At=g(function(Hu){function ks(e){if(!e)return null;switch(e.type){case"alias":case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":if(e.source.includes(`
|
|
64
64
|
`))return!0;if(e.end){for(let t of e.end)if(t.type==="newline")return!0}return!1;case"flow-collection":for(let t of e.items){for(let s of t.start)if(s.type==="newline")return!0;if(t.sep){for(let s of t.sep)if(s.type==="newline")return!0}if(ks(t.key)||ks(t.value))return!0}return!1;default:return!0}}Hu.containsNewline=ks});var Ns=g(function(Gu){var Qu=At();function zu(e,t,s){if(t?.type==="flow-collection"){let n=t.end[0];if(n.indent===e&&(n.source==="]"||n.source==="}")&&Qu.containsNewline(t))s(n,"BAD_INDENT","Flow end indicator should be more indented than parent",!0)}}Gu.flowIndentCheck=zu});var As=g(function(ef){var wi=O();function Zu(e,t,s){let{uniqueKeys:n}=e.options;if(n===!1)return!1;let i=typeof n==="function"?n:(r,o)=>r===o||wi.isScalar(r)&&wi.isScalar(o)&&r.value===o.value;return t.some((r)=>i(r.key,s))}ef.mapIncludes=Zu});var Ai=g(function(af){var Si=J(),sf=W(),vi=xe(),nf=At(),ki=Ns(),rf=As(),Ni="All mapping items must start at the same column";function of({composeNode:e,composeEmptyNode:t},s,n,i,r){let a=new(r?.nodeClass??sf.YAMLMap)(s.schema);if(s.atRoot)s.atRoot=!1;let l=n.offset,c=null;for(let p of n.items){let{start:u,key:f,sep:m,value:y}=p,d=vi.resolveProps(u,{indicator:"explicit-key-ind",next:f??m?.[0],offset:l,onError:i,parentIndent:n.indent,startOnNewline:!0}),h=!d.found;if(h){if(f){if(f.type==="block-seq")i(l,"BLOCK_AS_IMPLICIT_KEY","A block sequence may not be used as an implicit map key");else if("indent"in f&&f.indent!==n.indent)i(l,"BAD_INDENT",Ni)}if(!d.anchor&&!d.tag&&!m){if(c=d.end,d.comment)if(a.comment)a.comment+=`
|
|
65
65
|
`+d.comment;else a.comment=d.comment;continue}if(d.newlineAfterProp||nf.containsNewline(f))i(f??u[u.length-1],"MULTILINE_IMPLICIT_KEY","Implicit keys need to be on a single line")}else if(d.found?.indent!==n.indent)i(l,"BAD_INDENT",Ni);s.atKey=!0;let w=d.end,S=f?e(s,f,d,i):t(s,w,u,null,d,i);if(s.schema.compat)ki.flowIndentCheck(n.indent,f,i);if(s.atKey=!1,rf.mapIncludes(s,a.items,S))i(w,"DUPLICATE_KEY","Map keys must be unique");let v=vi.resolveProps(m??[],{indicator:"map-value-ind",next:y,offset:S.range[2],onError:i,parentIndent:n.indent,startOnNewline:!f||f.type==="block-scalar"});if(l=v.end,v.found){if(h){if(y?.type==="block-map"&&!v.hasNewline)i(l,"BLOCK_AS_IMPLICIT_KEY","Nested mappings are not allowed in compact mappings");if(s.options.strict&&d.start<v.found.offset-1024)i(S.range,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit block mapping key")}let k=y?e(s,y,v,i):t(s,l,m,null,v,i);if(s.schema.compat)ki.flowIndentCheck(n.indent,y,i);l=k.range[2];let N=new Si.Pair(S,k);if(s.options.keepSourceTokens)N.srcToken=p;a.items.push(N)}else{if(h)i(S.range,"MISSING_CHAR","Implicit map keys need to be followed by map values");if(v.comment)if(S.comment)S.comment+=`
|
|
66
|
-
`+v.comment;else S.comment=v.comment;let k=new Si.Pair(S);if(s.options.keepSourceTokens)k.srcToken=p;a.items.push(k)}}if(c&&c<l)i(c,"IMPOSSIBLE","Map comment with trailing content");return a.range=[n.offset,l,c??l],a}af.resolveBlockMap=of});var Oi=g(function(pf){var cf=Q(),uf=xe(),ff=Ns();function df({composeNode:e,composeEmptyNode:t},s,n,i,r){let a=new(r?.nodeClass??cf.YAMLSeq)(s.schema);if(s.atRoot)s.atRoot=!1;if(s.atKey)s.atKey=!1;let l=n.offset,c=null;for(let{start:p,value:u}of n.items){let f=uf.resolveProps(p,{indicator:"seq-item-ind",next:u,offset:l,onError:i,parentIndent:n.indent,startOnNewline:!0});if(!f.found)if(f.anchor||f.tag||u)if(u?.type==="block-seq")i(f.end,"BAD_INDENT","All sequence items must start at the same column");else i(l,"MISSING_CHAR","Sequence item without - indicator");else{if(c=f.end,f.comment)a.comment=f.comment;continue}let m=u?e(s,u,f,i):t(s,f.end,p,null,f,i);if(s.schema.compat)ff.flowIndentCheck(n.indent,u,i);l=m.range[2],a.items.push(m)}return a.range=[n.offset,l,c??l],a}pf.resolveBlockSeq=df});var ge=g(function(gf){function mf(e,t,s,n){let i="";if(e){let r=!1,o="";for(let a of e){let{source:l,type:c}=a;switch(c){case"space":r=!0;break;case"comment":{if(s&&!r)n(a,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");let p=l.substring(1)||" ";if(!i)i=p;else i+=o+p;o="";break}case"newline":if(i)o+=l;r=!0;break;default:n(a,"UNEXPECTED_TOKEN",`Unexpected ${c} at node end`)}t+=l.length}}return{comment:i,offset:t}}gf.resolveEnd=mf});var
|
|
67
|
-
`+A.comment;else c.comment=A.comment;u=A.end;continue}if(!o&&s.options.strict&&kf.containsNewline(v))i(v,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line")}if(h===0){if(A.comma)i(A.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${a}`)}else{if(!A.comma)i(A.start,"MISSING_CHAR",`Missing , between ${a} items`);if(A.comment){let
|
|
68
|
-
`+
|
|
69
|
-
`+
|
|
70
|
-
`+h.comment;else c.comment=h.comment;c.range=[n.offset,d,h.offset]}else c.range=[n.offset,d,d];return c}Of.resolveFlowCollection=Af});var Li=g(function(_f){var
|
|
66
|
+
`+v.comment;else S.comment=v.comment;let k=new Si.Pair(S);if(s.options.keepSourceTokens)k.srcToken=p;a.items.push(k)}}if(c&&c<l)i(c,"IMPOSSIBLE","Map comment with trailing content");return a.range=[n.offset,l,c??l],a}af.resolveBlockMap=of});var Oi=g(function(pf){var cf=Q(),uf=xe(),ff=Ns();function df({composeNode:e,composeEmptyNode:t},s,n,i,r){let a=new(r?.nodeClass??cf.YAMLSeq)(s.schema);if(s.atRoot)s.atRoot=!1;if(s.atKey)s.atKey=!1;let l=n.offset,c=null;for(let{start:p,value:u}of n.items){let f=uf.resolveProps(p,{indicator:"seq-item-ind",next:u,offset:l,onError:i,parentIndent:n.indent,startOnNewline:!0});if(!f.found)if(f.anchor||f.tag||u)if(u?.type==="block-seq")i(f.end,"BAD_INDENT","All sequence items must start at the same column");else i(l,"MISSING_CHAR","Sequence item without - indicator");else{if(c=f.end,f.comment)a.comment=f.comment;continue}let m=u?e(s,u,f,i):t(s,f.end,p,null,f,i);if(s.schema.compat)ff.flowIndentCheck(n.indent,u,i);l=m.range[2],a.items.push(m)}return a.range=[n.offset,l,c??l],a}pf.resolveBlockSeq=df});var ge=g(function(gf){function mf(e,t,s,n){let i="";if(e){let r=!1,o="";for(let a of e){let{source:l,type:c}=a;switch(c){case"space":r=!0;break;case"comment":{if(s&&!r)n(a,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");let p=l.substring(1)||" ";if(!i)i=p;else i+=o+p;o="";break}case"newline":if(i)o+=l;r=!0;break;default:n(a,"UNEXPECTED_TOKEN",`Unexpected ${c} at node end`)}t+=l.length}}return{comment:i,offset:t}}gf.resolveEnd=mf});var qi=g(function(Of){var bf=O(),wf=J(),Ci=W(),Sf=Q(),vf=ge(),Ei=xe(),kf=At(),Nf=As(),Os="Block collections are not allowed within flow collections",Cs=(e)=>e&&(e.type==="block-map"||e.type==="block-seq");function Af({composeNode:e,composeEmptyNode:t},s,n,i,r){let o=n.start.source==="{",a=o?"flow map":"flow sequence",c=new(r?.nodeClass??(o?Ci.YAMLMap:Sf.YAMLSeq))(s.schema);c.flow=!0;let p=s.atRoot;if(p)s.atRoot=!1;if(s.atKey)s.atKey=!1;let u=n.offset+n.start.source.length;for(let h=0;h<n.items.length;++h){let w=n.items[h],{start:S,key:v,sep:k,value:N}=w,A=Ei.resolveProps(S,{flow:a,indicator:"explicit-key-ind",next:v??k?.[0],offset:u,onError:i,parentIndent:n.indent,startOnNewline:!1});if(!A.found){if(!A.anchor&&!A.tag&&!k&&!N){if(h===0&&A.comma)i(A.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${a}`);else if(h<n.items.length-1)i(A.start,"UNEXPECTED_TOKEN",`Unexpected empty item in ${a}`);if(A.comment)if(c.comment)c.comment+=`
|
|
67
|
+
`+A.comment;else c.comment=A.comment;u=A.end;continue}if(!o&&s.options.strict&&kf.containsNewline(v))i(v,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line")}if(h===0){if(A.comma)i(A.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${a}`)}else{if(!A.comma)i(A.start,"MISSING_CHAR",`Missing , between ${a} items`);if(A.comment){let C="";e:for(let b of S)switch(b.type){case"comma":case"space":break;case"comment":C=b.source.substring(1);break e;default:break e}if(C){let b=c.items[c.items.length-1];if(bf.isPair(b))b=b.value??b.key;if(b.comment)b.comment+=`
|
|
68
|
+
`+C;else b.comment=C;A.comment=A.comment.substring(C.length+1)}}}if(!o&&!k&&!A.found){let C=N?e(s,N,A,i):t(s,A.end,k,null,A,i);if(c.items.push(C),u=C.range[2],Cs(N))i(C.range,"BLOCK_IN_FLOW",Os)}else{s.atKey=!0;let C=A.end,b=v?e(s,v,A,i):t(s,C,S,null,A,i);if(Cs(v))i(b.range,"BLOCK_IN_FLOW",Os);s.atKey=!1;let q=Ei.resolveProps(k??[],{flow:a,indicator:"map-value-ind",next:N,offset:b.range[2],onError:i,parentIndent:n.indent,startOnNewline:!1});if(q.found){if(!o&&!A.found&&s.options.strict){if(k)for(let L of k){if(L===q.found)break;if(L.type==="newline"){i(L,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line");break}}if(A.start<q.found.offset-1024)i(q.found,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit flow sequence key")}}else if(N)if("source"in N&&N.source?.[0]===":")i(N,"MISSING_CHAR",`Missing space after : in ${a}`);else i(q.start,"MISSING_CHAR",`Missing , or : between ${a} items`);let F=N?e(s,N,q,i):q.found?t(s,q.end,k,null,q,i):null;if(F){if(Cs(N))i(F.range,"BLOCK_IN_FLOW",Os)}else if(q.comment)if(b.comment)b.comment+=`
|
|
69
|
+
`+q.comment;else b.comment=q.comment;let oe=new wf.Pair(b,F);if(s.options.keepSourceTokens)oe.srcToken=w;if(o){let L=c;if(Nf.mapIncludes(s,L.items,b))i(C,"DUPLICATE_KEY","Map keys must be unique");L.items.push(oe)}else{let L=new Ci.YAMLMap(s.schema);L.flow=!0,L.items.push(oe);let Xs=(F??b).range;L.range=[b.range[0],Xs[1],Xs[2]],c.items.push(L)}u=F?F.range[2]:q.end}}let f=o?"}":"]",[m,...y]=n.end,d=u;if(m?.source===f)d=m.offset+m.source.length;else{let h=a[0].toUpperCase()+a.substring(1),w=p?`${h} must end with a ${f}`:`${h} in block collection must be sufficiently indented and end with a ${f}`;if(i(u,p?"MISSING_CHAR":"BAD_INDENT",w),m&&m.source.length!==1)y.unshift(m)}if(y.length>0){let h=vf.resolveEnd(y,d,s.options.strict,i);if(h.comment)if(c.comment)c.comment+=`
|
|
70
|
+
`+h.comment;else c.comment=h.comment;c.range=[n.offset,d,h.offset]}else c.range=[n.offset,d,d];return c}Of.resolveFlowCollection=Af});var Li=g(function(_f){var Ef=O(),qf=E(),Lf=W(),Pf=Q(),Tf=Ai(),If=Oi(),Mf=qi();function Es(e,t,s,n,i,r){let o=s.type==="block-map"?Tf.resolveBlockMap(e,t,s,n,r):s.type==="block-seq"?If.resolveBlockSeq(e,t,s,n,r):Mf.resolveFlowCollection(e,t,s,n,r),a=o.constructor;if(i==="!"||i===a.tagName)return o.tag=a.tagName,o;if(i)o.tag=i;return o}function $f(e,t,s,n,i){let r=n.tag,o=!r?null:t.directives.tagName(r.source,(f)=>i(r,"TAG_RESOLVE_FAILED",f));if(s.type==="block-seq"){let{anchor:f,newlineAfterProp:m}=n,y=f&&r?f.offset>r.offset?f:r:f??r;if(y&&(!m||m.offset<y.offset))i(y,"MISSING_CHAR","Missing newline after block sequence props")}let a=s.type==="block-map"?"map":s.type==="block-seq"?"seq":s.start.source==="{"?"map":"seq";if(!r||!o||o==="!"||o===Lf.YAMLMap.tagName&&a==="map"||o===Pf.YAMLSeq.tagName&&a==="seq")return Es(e,t,s,i,o);let l=t.schema.tags.find((f)=>f.tag===o&&f.collection===a);if(!l){let f=t.schema.knownTags[o];if(f?.collection===a)t.schema.tags.push(Object.assign({},f,{default:!1})),l=f;else{if(f)i(r,"BAD_COLLECTION_TYPE",`${f.tag} used for ${a} collection, but expects ${f.collection??"scalar"}`,!0);else i(r,"TAG_RESOLVE_FAILED",`Unresolved tag: ${o}`,!0);return Es(e,t,s,i,o)}}let c=Es(e,t,s,i,o,l),p=l.resolve?.(c,(f)=>i(r,"TAG_RESOLVE_FAILED",f),t.options)??c,u=Ef.isNode(p)?p:new qf.Scalar(p);if(u.range=c.range,u.tag=o,l?.format)u.format=l.format;return u}_f.composeCollection=$f});var Ls=g(function(Kf){var qs=E();function Df(e,t,s){let n=t.offset,i=Bf(t,e.options.strict,s);if(!i)return{value:"",type:null,comment:"",range:[n,n,n]};let r=i.mode===">"?qs.Scalar.BLOCK_FOLDED:qs.Scalar.BLOCK_LITERAL,o=t.source?Rf(t.source):[],a=o.length;for(let d=o.length-1;d>=0;--d){let h=o[d][1];if(h===""||h==="\r")a=d;else break}if(a===0){let d=i.chomp==="+"&&o.length>0?`
|
|
71
71
|
`.repeat(Math.max(1,o.length-1)):"",h=n+i.length;if(t.source)h+=t.source.length;return{value:d,type:r,comment:i.comment,range:[n,h,h]}}let l=t.indent+i.indent,c=t.offset+i.length,p=0;for(let d=0;d<a;++d){let[h,w]=o[d];if(w===""||w==="\r"){if(i.indent===0&&h.length>l)l=h.length}else{if(h.length<l)s(c+h.length,"MISSING_CHAR","Block scalars with more-indented leading empty lines must use an explicit indentation indicator");if(i.indent===0)l=h.length;if(p=d,l===0&&!e.atRoot)s(c,"BAD_INDENT","Block scalar values in collections must be indented");break}c+=h.length+w.length+1}for(let d=o.length-1;d>=a;--d)if(o[d][0].length>l)a=d+1;let u="",f="",m=!1;for(let d=0;d<p;++d)u+=o[d][0].slice(l)+`
|
|
72
|
-
`;for(let d=p;d<a;++d){let[h,w]=o[d];c+=h.length+w.length+1;let S=w[w.length-1]==="\r";if(S)w=w.slice(0,-1);if(w&&h.length<l){let k=`Block scalar lines must not be less indented than their ${i.indent?"explicit indentation indicator":"first line"}`;s(c-w.length-(S?2:1),"BAD_INDENT",k),h=""}if(r===
|
|
72
|
+
`;for(let d=p;d<a;++d){let[h,w]=o[d];c+=h.length+w.length+1;let S=w[w.length-1]==="\r";if(S)w=w.slice(0,-1);if(w&&h.length<l){let k=`Block scalar lines must not be less indented than their ${i.indent?"explicit indentation indicator":"first line"}`;s(c-w.length-(S?2:1),"BAD_INDENT",k),h=""}if(r===qs.Scalar.BLOCK_LITERAL)u+=f+h.slice(l)+w,f=`
|
|
73
73
|
`;else if(h.length>l||w[0]==="\t"){if(f===" ")f=`
|
|
74
74
|
`;else if(!m&&f===`
|
|
75
75
|
`)f=`
|
|
@@ -82,7 +82,7 @@ ${c}
|
|
|
82
82
|
`+o[d][0].slice(l);if(u[u.length-1]!==`
|
|
83
83
|
`)u+=`
|
|
84
84
|
`;break;default:u+=`
|
|
85
|
-
`}let y=n+i.length+t.source.length;return{value:u,type:r,comment:i.comment,range:[n,y,y]}}function Bf({offset:e,props:t},s,n){if(t[0].type!=="block-scalar-header")return n(t[0],"IMPOSSIBLE","Block scalar header not found"),null;let{source:i}=t[0],r=i[0],o=0,a="",l=-1;for(let f=1;f<i.length;++f){let m=i[f];if(!a&&(m==="-"||m==="+"))a=m;else{let y=Number(m);if(!o&&y)o=y;else if(l===-1)l=e+f}}if(l!==-1)n(l,"UNEXPECTED_TOKEN",`Block scalar header includes extra characters: ${i}`);let c=!1,p="",u=i.length;for(let f=1;f<t.length;++f){let m=t[f];switch(m.type){case"space":c=!0;case"newline":u+=m.source.length;break;case"comment":if(s&&!c)n(m,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");u+=m.source.length,p=m.source.substring(1);break;case"error":n(m,"UNEXPECTED_TOKEN",m.message),u+=m.source.length;break;default:{let y=`Unexpected token in block scalar header: ${m.type}`;n(m,"UNEXPECTED_TOKEN",y);let d=m.source;if(d&&typeof d==="string")u+=d.length}}}return{mode:r,indent:o,chomp:a,comment:p,length:u}}function Rf(e){let t=e.split(/\n( *)/),s=t[0],n=s.match(/^( *)/),r=[n?.[1]?[n[1],s.slice(n[1].length)]:["",s]];for(let o=1;o<t.length;o+=2)r.push([t[o],t[o+1]]);return r}Kf.resolveBlockScalar=Df});var Ts=g(function(zf){var Ps=
|
|
85
|
+
`}let y=n+i.length+t.source.length;return{value:u,type:r,comment:i.comment,range:[n,y,y]}}function Bf({offset:e,props:t},s,n){if(t[0].type!=="block-scalar-header")return n(t[0],"IMPOSSIBLE","Block scalar header not found"),null;let{source:i}=t[0],r=i[0],o=0,a="",l=-1;for(let f=1;f<i.length;++f){let m=i[f];if(!a&&(m==="-"||m==="+"))a=m;else{let y=Number(m);if(!o&&y)o=y;else if(l===-1)l=e+f}}if(l!==-1)n(l,"UNEXPECTED_TOKEN",`Block scalar header includes extra characters: ${i}`);let c=!1,p="",u=i.length;for(let f=1;f<t.length;++f){let m=t[f];switch(m.type){case"space":c=!0;case"newline":u+=m.source.length;break;case"comment":if(s&&!c)n(m,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");u+=m.source.length,p=m.source.substring(1);break;case"error":n(m,"UNEXPECTED_TOKEN",m.message),u+=m.source.length;break;default:{let y=`Unexpected token in block scalar header: ${m.type}`;n(m,"UNEXPECTED_TOKEN",y);let d=m.source;if(d&&typeof d==="string")u+=d.length}}}return{mode:r,indent:o,chomp:a,comment:p,length:u}}function Rf(e){let t=e.split(/\n( *)/),s=t[0],n=s.match(/^( *)/),r=[n?.[1]?[n[1],s.slice(n[1].length)]:["",s]];for(let o=1;o<t.length;o+=2)r.push([t[o],t[o+1]]);return r}Kf.resolveBlockScalar=Df});var Ts=g(function(zf){var Ps=E(),Ff=ge();function Uf(e,t,s){let{offset:n,type:i,source:r,end:o}=e,a,l,c=(f,m,y)=>s(n+f,m,y);switch(i){case"scalar":a=Ps.Scalar.PLAIN,l=Yf(r,c);break;case"single-quoted-scalar":a=Ps.Scalar.QUOTE_SINGLE,l=Vf(r,c);break;case"double-quoted-scalar":a=Ps.Scalar.QUOTE_DOUBLE,l=Jf(r,c);break;default:return s(e,"UNEXPECTED_TOKEN",`Expected a flow scalar value, but found: ${i}`),{value:"",type:null,comment:"",range:[n,n+r.length,n+r.length]}}let p=n+r.length,u=Ff.resolveEnd(o,p,t,s);return{value:l,type:a,comment:u.comment,range:[n,p,u.offset]}}function Yf(e,t){let s="";switch(e[0]){case"\t":s="a tab character";break;case",":s="flow indicator character ,";break;case"%":s="directive indicator character %";break;case"|":case">":{s=`block scalar indicator ${e[0]}`;break}case"@":case"`":{s=`reserved character ${e[0]}`;break}}if(s)t(0,"BAD_SCALAR_START",`Plain value cannot start with ${s}`);return Pi(e)}function Vf(e,t){if(e[e.length-1]!=="'"||e.length===1)t(e.length,"MISSING_CHAR","Missing closing 'quote");return Pi(e.slice(1,-1)).replace(/''/g,"'")}function Pi(e){let t,s;try{t=new RegExp(`(.*?)(?<![ ])[ ]*\r?
|
|
86
86
|
`,"sy"),s=new RegExp(`[ ]*(.*?)(?:(?<![ ])[ ]*)?\r?
|
|
87
87
|
`,"sy")}catch{t=/(.*?)[ \t]*\r?\n/sy,s=/[ \t]*(.*?)[ \t]*\r?\n/sy}let n=t.exec(e);if(!n)return e;let i=n[1],r=" ",o=t.lastIndex;s.lastIndex=o;while(n=s.exec(e)){if(n[1]==="")if(r===`
|
|
88
88
|
`)i+=r;else r=`
|
|
@@ -97,14 +97,14 @@ ${c}
|
|
|
97
97
|
`)break;if(n===`
|
|
98
98
|
`)s+=`
|
|
99
99
|
`;t+=1,n=e[t+1]}if(!s)s=" ";return{fold:s,offset:t}}var Wf={"0":"\x00",a:"\x07",b:"\b",e:"\x1B",f:"\f",n:`
|
|
100
|
-
`,r:"\r",t:"\t",v:"\v",N:"\x85",_:"\xA0",L:"\u2028",P:"\u2029"," ":" ",'"':'"',"/":"/","\\":"\\","\t":"\t"};function Qf(e,t,s,n){let i=e.substr(t,s),o=i.length===s&&/^[0-9a-fA-F]+$/.test(i)?parseInt(i,16):NaN;try{return String.fromCodePoint(o)}catch{let a=e.substr(t-2,s+2);return n(t-2,"BAD_DQ_ESCAPE",`Invalid escape sequence ${a}`),a}}zf.resolveFlowScalar=Uf});var Ii=g(function(nd){var ne=O(),Ti=
|
|
100
|
+
`,r:"\r",t:"\t",v:"\v",N:"\x85",_:"\xA0",L:"\u2028",P:"\u2029"," ":" ",'"':'"',"/":"/","\\":"\\","\t":"\t"};function Qf(e,t,s,n){let i=e.substr(t,s),o=i.length===s&&/^[0-9a-fA-F]+$/.test(i)?parseInt(i,16):NaN;try{return String.fromCodePoint(o)}catch{let a=e.substr(t-2,s+2);return n(t-2,"BAD_DQ_ESCAPE",`Invalid escape sequence ${a}`),a}}zf.resolveFlowScalar=Uf});var Ii=g(function(nd){var ne=O(),Ti=E(),Xf=Ls(),Zf=Ts();function ed(e,t,s,n){let{value:i,type:r,comment:o,range:a}=t.type==="block-scalar"?Xf.resolveBlockScalar(e,t,n):Zf.resolveFlowScalar(t,e.options.strict,n),l=s?e.directives.tagName(s.source,(u)=>n(s,"TAG_RESOLVE_FAILED",u)):null,c;if(e.options.stringKeys&&e.atKey)c=e.schema[ne.SCALAR];else if(l)c=td(e.schema,i,l,s,n);else if(t.type==="scalar")c=sd(e,i,t,n);else c=e.schema[ne.SCALAR];let p;try{let u=c.resolve(i,(f)=>n(s??t,"TAG_RESOLVE_FAILED",f),e.options);p=ne.isScalar(u)?u:new Ti.Scalar(u)}catch(u){let f=u instanceof Error?u.message:String(u);n(s??t,"TAG_RESOLVE_FAILED",f),p=new Ti.Scalar(i)}if(p.range=a,p.source=i,r)p.type=r;if(l)p.tag=l;if(c.format)p.format=c.format;if(o)p.comment=o;return p}function td(e,t,s,n,i){if(s==="!")return e[ne.SCALAR];let r=[];for(let a of e.tags)if(!a.collection&&a.tag===s)if(a.default&&a.test)r.push(a);else return a;for(let a of r)if(a.test?.test(t))return a;let o=e.knownTags[s];if(o&&!o.collection)return e.tags.push(Object.assign({},o,{default:!1,test:void 0})),o;return i(n,"TAG_RESOLVE_FAILED",`Unresolved tag: ${s}`,s!=="tag:yaml.org,2002:str"),e[ne.SCALAR]}function sd({atKey:e,directives:t,schema:s},n,i,r){let o=s.tags.find((a)=>(a.default===!0||e&&a.default==="key")&&a.test?.test(n))||s[ne.SCALAR];if(s.compat){let a=s.compat.find((l)=>l.default&&l.test?.test(n))??s[ne.SCALAR];if(o.tag!==a.tag){let l=t.tagString(o.tag),c=t.tagString(a.tag),p=`Value may be parsed as either ${l} or ${c}`;r(i,"TAG_RESOLVE_FAILED",p,!0)}}return o}nd.composeScalar=ed});var Mi=g(function(od){function rd(e,t,s){if(t){s??(s=t.length);for(let n=s-1;n>=0;--n){let i=t[n];switch(i.type){case"space":case"comment":case"newline":e-=i.source.length;continue}i=t[++n];while(i?.type==="space")e+=i.source.length,i=t[++n];break}}return e}od.emptyScalarPosition=rd});var xi=g(function(md){var ld=Se(),cd=O(),ud=Li(),$i=Ii(),fd=ge(),dd=Mi(),pd={composeNode:_i,composeEmptyNode:Is};function _i(e,t,s,n){let i=e.atKey,{spaceBefore:r,comment:o,anchor:a,tag:l}=s,c,p=!0;switch(t.type){case"alias":if(c=hd(e,t,n),a||l)n(t,"ALIAS_PROPS","An alias node must not specify any properties");break;case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"block-scalar":if(c=$i.composeScalar(e,t,l,n),a)c.anchor=a.source.substring(1);break;case"block-map":case"block-seq":case"flow-collection":try{if(c=ud.composeCollection(pd,e,t,s,n),a)c.anchor=a.source.substring(1)}catch(u){let f=u instanceof Error?u.message:String(u);n(t,"RESOURCE_EXHAUSTION",f)}break;default:{let u=t.type==="error"?t.message:`Unsupported token (type: ${t.type})`;n(t,"UNEXPECTED_TOKEN",u),p=!1}}if(c??(c=Is(e,t.offset,void 0,null,s,n)),a&&c.anchor==="")n(a,"BAD_ALIAS","Anchor cannot be an empty string");if(i&&e.options.stringKeys&&(!cd.isScalar(c)||typeof c.value!=="string"||c.tag&&c.tag!=="tag:yaml.org,2002:str"))n(l??t,"NON_STRING_KEY","With stringKeys, all keys must be strings");if(r)c.spaceBefore=!0;if(o)if(t.type==="scalar"&&t.source==="")c.comment=o;else c.commentBefore=o;if(e.options.keepSourceTokens&&p)c.srcToken=t;return c}function Is(e,t,s,n,{spaceBefore:i,comment:r,anchor:o,tag:a,end:l},c){let p={type:"scalar",offset:dd.emptyScalarPosition(t,s,n),indent:-1,source:""},u=$i.composeScalar(e,p,a,c);if(o){if(u.anchor=o.source.substring(1),u.anchor==="")c(o,"BAD_ALIAS","Anchor cannot be an empty string")}if(i)u.spaceBefore=!0;if(r)u.comment=r,u.range[2]=l;return u}function hd({options:e},{offset:t,source:s,end:n},i){let r=new ld.Alias(s.substring(1));if(r.source==="")i(t,"BAD_ALIAS","Alias cannot be an empty string");if(r.source.endsWith(":"))i(t+s.length-1,"BAD_ALIAS","Alias ending in : is ambiguous",!0);let o=t+s.length,a=fd.resolveEnd(n,o,e.strict,i);if(r.range=[t,o,a.offset],a.comment)r.comment=a.comment;return r}md.composeEmptyNode=Is;md.composeNode=_i});var Bi=g(function(kd){var bd=$e(),Di=xi(),wd=ge(),Sd=xe();function vd(e,t,{offset:s,start:n,value:i,end:r},o){let a=Object.assign({_directives:t},e),l=new bd.Document(void 0,a),c={atKey:!1,atRoot:!0,directives:l.directives,options:l.options,schema:l.schema},p=Sd.resolveProps(n,{indicator:"doc-start",next:i??r?.[0],offset:s,onError:o,parentIndent:0,startOnNewline:!0});if(p.found){if(l.directives.docStart=!0,i&&(i.type==="block-map"||i.type==="block-seq")&&!p.hasNewline)o(p.end,"MISSING_CHAR","Block collection cannot start on same line with directives-end marker")}l.contents=i?Di.composeNode(c,i,p,o):Di.composeEmptyNode(c,p.end,n,null,p,o);let u=l.contents.range[2],f=wd.resolveEnd(r,u,!1,o);if(f.comment)l.comment=f.comment;return l.range=[s,u,f.offset],l}kd.composeDoc=vd});var Ms=g(function(Ld){var Ad=Fe("process"),Od=Dt(),Cd=$e(),De=_e(),Ri=O(),Ed=Bi(),qd=ge();function Be(e){if(typeof e==="number")return[e,e+1];if(Array.isArray(e))return e.length===2?e:[e[0],e[1]];let{offset:t,source:s}=e;return[t,t+(typeof s==="string"?s.length:1)]}function Ki(e){let t="",s=!1,n=!1;for(let i=0;i<e.length;++i){let r=e[i];switch(r[0]){case"#":t+=(t===""?"":n?`
|
|
101
101
|
|
|
102
102
|
`:`
|
|
103
103
|
`)+(r.substring(1)||" "),s=!0,n=!1;break;case"%":if(e[i+1]?.[0]!=="#")i+=1;s=!1;break;default:if(!s)n=!0;s=!1}}return{comment:t,afterEmptyLine:n}}class ji{constructor(e={}){this.doc=null,this.atDirectives=!1,this.prelude=[],this.errors=[],this.warnings=[],this.onError=(t,s,n,i)=>{let r=Be(t);if(i)this.warnings.push(new De.YAMLWarning(r,s,n));else this.errors.push(new De.YAMLParseError(r,s,n))},this.directives=new Od.Directives({version:e.version||"1.2"}),this.options=e}decorate(e,t){let{comment:s,afterEmptyLine:n}=Ki(this.prelude);if(s){let i=e.contents;if(t)e.comment=e.comment?`${e.comment}
|
|
104
104
|
${s}`:s;else if(n||e.directives.docStart||!i)e.commentBefore=s;else if(Ri.isCollection(i)&&!i.flow&&i.items.length>0){let r=i.items[0];if(Ri.isPair(r))r=r.key;let o=r.commentBefore;r.commentBefore=o?`${s}
|
|
105
105
|
${o}`:s}else{let r=i.commentBefore;i.commentBefore=r?`${s}
|
|
106
|
-
${r}`:s}}if(t){for(let i=0;i<this.errors.length;++i)e.errors.push(this.errors[i]);for(let i=0;i<this.warnings.length;++i)e.warnings.push(this.warnings[i])}else e.errors=this.errors,e.warnings=this.warnings;this.prelude=[],this.errors=[],this.warnings=[]}streamInfo(){return{comment:Ki(this.prelude).comment,directives:this.directives,errors:this.errors,warnings:this.warnings}}*compose(e,t=!1,s=-1){for(let n of e)yield*this.next(n);yield*this.end(t,s)}*next(e){if(Ad.env.LOG_STREAM)console.dir(e,{depth:null});switch(e.type){case"directive":this.directives.add(e.source,(t,s,n)=>{let i=Be(e);i[0]+=t,this.onError(i,"BAD_DIRECTIVE",s,n)}),this.prelude.push(e.source),this.atDirectives=!0;break;case"document":{let t=
|
|
107
|
-
${t.comment}`:t.comment}this.doc.range[2]=t.offset;break}default:this.errors.push(new De.YAMLParseError(Be(e),"UNEXPECTED_TOKEN",`Unsupported token ${e.type}`))}}*end(e=!1,t=-1){if(this.doc)this.decorate(this.doc,!0),yield this.doc,this.doc=null;else if(e){let s=Object.assign({_directives:this.directives},this.options),n=new
|
|
106
|
+
${r}`:s}}if(t){for(let i=0;i<this.errors.length;++i)e.errors.push(this.errors[i]);for(let i=0;i<this.warnings.length;++i)e.warnings.push(this.warnings[i])}else e.errors=this.errors,e.warnings=this.warnings;this.prelude=[],this.errors=[],this.warnings=[]}streamInfo(){return{comment:Ki(this.prelude).comment,directives:this.directives,errors:this.errors,warnings:this.warnings}}*compose(e,t=!1,s=-1){for(let n of e)yield*this.next(n);yield*this.end(t,s)}*next(e){if(Ad.env.LOG_STREAM)console.dir(e,{depth:null});switch(e.type){case"directive":this.directives.add(e.source,(t,s,n)=>{let i=Be(e);i[0]+=t,this.onError(i,"BAD_DIRECTIVE",s,n)}),this.prelude.push(e.source),this.atDirectives=!0;break;case"document":{let t=Ed.composeDoc(this.options,this.directives,e,this.onError);if(this.atDirectives&&!t.directives.docStart)this.onError(e,"MISSING_CHAR","Missing directives-end/doc-start indicator line");if(this.decorate(t,!1),this.doc)yield this.doc;this.doc=t,this.atDirectives=!1;break}case"byte-order-mark":case"space":break;case"comment":case"newline":this.prelude.push(e.source);break;case"error":{let t=e.source?`${e.message}: ${JSON.stringify(e.source)}`:e.message,s=new De.YAMLParseError(Be(e),"UNEXPECTED_TOKEN",t);if(this.atDirectives||!this.doc)this.errors.push(s);else this.doc.errors.push(s);break}case"doc-end":{if(!this.doc){this.errors.push(new De.YAMLParseError(Be(e),"UNEXPECTED_TOKEN","Unexpected doc-end without preceding document"));break}this.doc.directives.docEnd=!0;let t=qd.resolveEnd(e.end,e.offset+e.source.length,this.doc.options.strict,this.onError);if(this.decorate(this.doc,!0),t.comment){let s=this.doc.comment;this.doc.comment=s?`${s}
|
|
107
|
+
${t.comment}`:t.comment}this.doc.range[2]=t.offset;break}default:this.errors.push(new De.YAMLParseError(Be(e),"UNEXPECTED_TOKEN",`Unsupported token ${e.type}`))}}*end(e=!1,t=-1){if(this.doc)this.decorate(this.doc,!0),yield this.doc,this.doc=null;else if(e){let s=Object.assign({_directives:this.directives},this.options),n=new Cd.Document(void 0,s);if(this.atDirectives)this.onError(t,"MISSING_CHAR","Missing directives-end indicator line");n.range=[0,t,t],this.decorate(n,!1),yield n}}}Ld.Composer=ji});var Yi=g(function(Bd){var Td=Ls(),Id=Ts(),Md=_e(),Fi=Ae();function $d(e,t=!0,s){if(e){let n=(i,r,o)=>{let a=typeof i==="number"?i:Array.isArray(i)?i[0]:i.offset;if(s)s(a,r,o);else throw new Md.YAMLParseError([a,a+1],r,o)};switch(e.type){case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return Id.resolveFlowScalar(e,t,n);case"block-scalar":return Td.resolveBlockScalar({options:{strict:t}},e,n)}}return null}function _d(e,t){let{implicitKey:s=!1,indent:n,inFlow:i=!1,offset:r=-1,type:o="PLAIN"}=t,a=Fi.stringifyString({type:o,value:e},{implicitKey:s,indent:n>0?" ".repeat(n):"",inFlow:i,options:{blockQuote:!0,lineWidth:-1}}),l=t.end??[{type:"newline",offset:-1,indent:n,source:`
|
|
108
108
|
`}];switch(a[0]){case"|":case">":{let c=a.indexOf(`
|
|
109
109
|
`),p=a.substring(0,c),u=a.substring(c+1)+`
|
|
110
110
|
`,f=[{type:"block-scalar-header",offset:r,indent:n,source:p}];if(!Ui(f,l))f.push({type:"newline",offset:-1,indent:n,source:`
|
|
@@ -112,10 +112,10 @@ ${t.comment}`:t.comment}this.doc.range[2]=t.offset;break}default:this.errors.pus
|
|
|
112
112
|
`),n=t.substring(0,s),i=t.substring(s+1)+`
|
|
113
113
|
`;if(e.type==="block-scalar"){let r=e.props[0];if(r.type!=="block-scalar-header")throw Error("Invalid block scalar header");r.source=n,e.source=i}else{let{offset:r}=e,o="indent"in e?e.indent:-1,a=[{type:"block-scalar-header",offset:r,indent:o,source:n}];if(!Ui(a,"end"in e?e.end:void 0))a.push({type:"newline",offset:-1,indent:o,source:`
|
|
114
114
|
`});for(let l of Object.keys(e))if(l!=="type"&&l!=="offset")delete e[l];Object.assign(e,{type:"block-scalar",indent:o,props:a,source:i})}}function Ui(e,t){if(t)for(let s of t)switch(s.type){case"space":case"comment":e.push(s);break;case"newline":return e.push(s),!0}return!1}function $s(e,t,s){switch(e.type){case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":e.type=s,e.source=t;break;case"block-scalar":{let n=e.props.slice(1),i=t.length;if(e.props[0].type==="block-scalar-header")i-=e.props[0].source.length;for(let r of n)r.offset+=i;delete e.props,Object.assign(e,{type:s,source:t,end:n});break}case"block-map":case"block-seq":{let i={type:"newline",offset:e.offset+t.length,indent:e.indent,source:`
|
|
115
|
-
`};delete e.items,Object.assign(e,{type:s,source:t,end:[i]});break}default:{let n="indent"in e?e.indent:-1,i="end"in e&&Array.isArray(e.end)?e.end.filter((r)=>r.type==="space"||r.type==="comment"||r.type==="newline"):[];for(let r of Object.keys(e))if(r!=="type"&&r!=="offset")delete e[r];Object.assign(e,{type:s,indent:n,source:t,end:i})}}}Bd.createScalarToken=_d;Bd.resolveAsScalar=$d;Bd.setScalarValue=xd});var Vi=g(function(Ud){var Fd=(e)=>("type"in e)?
|
|
115
|
+
`};delete e.items,Object.assign(e,{type:s,source:t,end:[i]});break}default:{let n="indent"in e?e.indent:-1,i="end"in e&&Array.isArray(e.end)?e.end.filter((r)=>r.type==="space"||r.type==="comment"||r.type==="newline"):[];for(let r of Object.keys(e))if(r!=="type"&&r!=="offset")delete e[r];Object.assign(e,{type:s,indent:n,source:t,end:i})}}}Bd.createScalarToken=_d;Bd.resolveAsScalar=$d;Bd.setScalarValue=xd});var Vi=g(function(Ud){var Fd=(e)=>("type"in e)?Ct(e):Ot(e);function Ct(e){switch(e.type){case"block-scalar":{let t="";for(let s of e.props)t+=Ct(s);return t+e.source}case"block-map":case"block-seq":{let t="";for(let s of e.items)t+=Ot(s);return t}case"flow-collection":{let t=e.start.source;for(let s of e.items)t+=Ot(s);for(let s of e.end)t+=s.source;return t}case"document":{let t=Ot(e);if(e.end)for(let s of e.end)t+=s.source;return t}default:{let t=e.source;if("end"in e&&e.end)for(let s of e.end)t+=s.source;return t}}}function Ot({start:e,key:t,sep:s,value:n}){let i="";for(let r of e)i+=r.source;if(t)i+=Ct(t);if(s)for(let r of s)i+=r.source;if(n)i+=Ct(n);return i}Ud.stringify=Fd});var Wi=g(function(Jd){var _s=Symbol("break visit"),Vd=Symbol("skip children"),Ji=Symbol("remove item");function ie(e,t){if("type"in e&&e.type==="document")e={start:e.start,value:e.value};Hi(Object.freeze([]),e,t)}ie.BREAK=_s;ie.SKIP=Vd;ie.REMOVE=Ji;ie.itemAtPath=(e,t)=>{let s=e;for(let[n,i]of t){let r=s?.[n];if(r&&"items"in r)s=r.items[i];else return}return s};ie.parentCollection=(e,t)=>{let s=ie.itemAtPath(e,t.slice(0,-1)),n=t[t.length-1][0],i=s?.[n];if(i&&"items"in i)return i;throw Error("Parent collection not found")};function Hi(e,t,s){let n=s(t,e);if(typeof n==="symbol")return n;for(let i of["key","value"]){let r=t[i];if(r&&"items"in r){for(let o=0;o<r.items.length;++o){let a=Hi(Object.freeze(e.concat([[i,o]])),r.items[o],s);if(typeof a==="number")o=a-1;else if(a===_s)return _s;else if(a===Ji)r.items.splice(o,1),o-=1}if(typeof n==="function"&&i==="key")n=n(t,e)}}return typeof n==="function"?n(t,e):n}Jd.visit=ie});var Et=g(function(ep){var xs=Yi(),Wd=Vi(),Qd=Wi(),Ds="\uFEFF",Bs="\x02",Rs="\x18",Ks="\x1F",zd=(e)=>!!e&&("items"in e),Gd=(e)=>!!e&&(e.type==="scalar"||e.type==="single-quoted-scalar"||e.type==="double-quoted-scalar"||e.type==="block-scalar");function Xd(e){switch(e){case Ds:return"<BOM>";case Bs:return"<DOC>";case Rs:return"<FLOW_END>";case Ks:return"<SCALAR>";default:return JSON.stringify(e)}}function Zd(e){switch(e){case Ds:return"byte-order-mark";case Bs:return"doc-mode";case Rs:return"flow-error-end";case Ks:return"scalar";case"---":return"doc-start";case"...":return"doc-end";case"":case`
|
|
116
116
|
`:case`\r
|
|
117
|
-
`:return"newline";case"-":return"seq-item-ind";case"?":return"explicit-key-ind";case":":return"map-value-ind";case"{":return"flow-map-start";case"}":return"flow-map-end";case"[":return"flow-seq-start";case"]":return"flow-seq-end";case",":return"comma"}switch(e[0]){case" ":case"\t":return"space";case"#":return"comment";case"%":return"directive-line";case"*":return"alias";case"&":return"anchor";case"!":return"tag";case"'":return"single-quoted-scalar";case'"':return"double-quoted-scalar";case"|":case">":return"block-scalar-header"}return null}ep.createScalarToken=xs.createScalarToken;ep.resolveAsScalar=xs.resolveAsScalar;ep.setScalarValue=xs.setScalarValue;ep.stringify=Wd.stringify;ep.visit=Qd.visit;ep.BOM=Ds;ep.DOCUMENT=Bs;ep.FLOW_END=Rs;ep.SCALAR=Ks;ep.isCollection=zd;ep.isScalar=Gd;ep.prettyToken=Xd;ep.tokenType=Zd});var Fs=g(function(gp){var Re=
|
|
118
|
-
`:case"\r":case"\t":return!0;default:return!1}}var Qi=new Set("0123456789ABCDEFabcdef"),hp=new Set("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()"),
|
|
117
|
+
`:return"newline";case"-":return"seq-item-ind";case"?":return"explicit-key-ind";case":":return"map-value-ind";case"{":return"flow-map-start";case"}":return"flow-map-end";case"[":return"flow-seq-start";case"]":return"flow-seq-end";case",":return"comma"}switch(e[0]){case" ":case"\t":return"space";case"#":return"comment";case"%":return"directive-line";case"*":return"alias";case"&":return"anchor";case"!":return"tag";case"'":return"single-quoted-scalar";case'"':return"double-quoted-scalar";case"|":case">":return"block-scalar-header"}return null}ep.createScalarToken=xs.createScalarToken;ep.resolveAsScalar=xs.resolveAsScalar;ep.setScalarValue=xs.setScalarValue;ep.stringify=Wd.stringify;ep.visit=Qd.visit;ep.BOM=Ds;ep.DOCUMENT=Bs;ep.FLOW_END=Rs;ep.SCALAR=Ks;ep.isCollection=zd;ep.isScalar=Gd;ep.prettyToken=Xd;ep.tokenType=Zd});var Fs=g(function(gp){var Re=Et();function D(e){switch(e){case void 0:case" ":case`
|
|
118
|
+
`:case"\r":case"\t":return!0;default:return!1}}var Qi=new Set("0123456789ABCDEFabcdef"),hp=new Set("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()"),qt=new Set(",[]{}"),mp=new Set(` ,[]{}
|
|
119
119
|
\r `),js=(e)=>!e||mp.has(e);class zi{constructor(){this.atEnd=!1,this.blockScalarIndent=-1,this.blockScalarKeep=!1,this.buffer="",this.flowKey=!1,this.flowLevel=0,this.indentNext=0,this.indentValue=0,this.lineEndPos=null,this.next=null,this.pos=0}*lex(e,t=!1){if(e){if(typeof e!=="string")throw TypeError("source is not a string");this.buffer=this.buffer?this.buffer+e:e,this.lineEndPos=null}this.atEnd=!t;let s=this.next??"stream";while(s&&(t||this.hasChars(1)))s=yield*this.parseNext(s)}atLineEnd(){let e=this.pos,t=this.buffer[e];while(t===" "||t==="\t")t=this.buffer[++e];if(!t||t==="#"||t===`
|
|
120
120
|
`)return!0;if(t==="\r")return this.buffer[e+1]===`
|
|
121
121
|
`;return!1}charAt(e){return this.buffer[this.pos+e]}continueScalar(e){let t=this.buffer[e];if(this.indentNext>0){let s=0;while(t===" ")t=this.buffer[++s+e];if(t==="\r"){let n=this.buffer[s+e+1];if(n===`
|
|
@@ -128,20 +128,21 @@ ${t.comment}`:t.comment}this.doc.range[2]=t.offset;break}default:this.errors.pus
|
|
|
128
128
|
`)break}default:break e}if(!s&&!this.atEnd)return this.setNext("block-scalar");if(t>=this.indentNext){if(this.blockScalarIndent===-1)this.indentNext=t;else this.indentNext=this.blockScalarIndent+(this.indentNext===0?1:this.indentNext);do{let i=this.continueScalar(e+1);if(i===-1)break;e=this.buffer.indexOf(`
|
|
129
129
|
`,i)}while(e!==-1);if(e===-1){if(!this.atEnd)return this.setNext("block-scalar");e=this.buffer.length}}let n=e+1;s=this.buffer[n];while(s===" ")s=this.buffer[++n];if(s==="\t"){while(s==="\t"||s===" "||s==="\r"||s===`
|
|
130
130
|
`)s=this.buffer[++n];e=n-1}else if(!this.blockScalarKeep)do{let i=e-1,r=this.buffer[i];if(r==="\r")r=this.buffer[--i];let o=i;while(r===" ")r=this.buffer[--i];if(r===`
|
|
131
|
-
`&&i>=this.pos&&i+1+t>o)e=i;else break}while(!0);return yield Re.SCALAR,yield*this.pushToIndex(e+1,!0),yield*this.parseLineStart()}*parsePlainScalar(){let e=this.flowLevel>0,t=this.pos-1,s=this.pos-1,n;while(n=this.buffer[++s])if(n===":"){let i=this.buffer[s+1];if(D(i)||e&&
|
|
131
|
+
`&&i>=this.pos&&i+1+t>o)e=i;else break}while(!0);return yield Re.SCALAR,yield*this.pushToIndex(e+1,!0),yield*this.parseLineStart()}*parsePlainScalar(){let e=this.flowLevel>0,t=this.pos-1,s=this.pos-1,n;while(n=this.buffer[++s])if(n===":"){let i=this.buffer[s+1];if(D(i)||e&&qt.has(i))break;t=s}else if(D(n)){let i=this.buffer[s+1];if(n==="\r")if(i===`
|
|
132
132
|
`)s+=1,n=`
|
|
133
|
-
`,i=this.buffer[s+1];else t=s;if(i==="#"||e&&
|
|
134
|
-
`){let r=this.continueScalar(s+1);if(r===-1)break;s=Math.max(s,r-2)}}else{if(e&&
|
|
133
|
+
`,i=this.buffer[s+1];else t=s;if(i==="#"||e&&qt.has(i))break;if(n===`
|
|
134
|
+
`){let r=this.continueScalar(s+1);if(r===-1)break;s=Math.max(s,r-2)}}else{if(e&&qt.has(n))break;t=s}if(!n&&!this.atEnd)return this.setNext("plain-scalar");return yield Re.SCALAR,yield*this.pushToIndex(t+1,!0),e?"flow":"doc"}*pushCount(e){if(e>0)return yield this.buffer.substr(this.pos,e),this.pos+=e,e;return 0}*pushToIndex(e,t){let s=this.buffer.slice(this.pos,e);if(s)return yield s,this.pos+=s.length,s.length;else if(t)yield"";return 0}*pushIndicators(){let e=0;e:while(!0){switch(this.charAt(0)){case"!":e+=yield*this.pushTag(),e+=yield*this.pushSpaces(!0);continue e;case"&":e+=yield*this.pushUntil(js),e+=yield*this.pushSpaces(!0);continue e;case"-":case"?":case":":{let t=this.flowLevel>0,s=this.charAt(1);if(D(s)||t&&qt.has(s)){if(!t)this.indentNext=this.indentValue+1;else if(this.flowKey)this.flowKey=!1;e+=yield*this.pushCount(1),e+=yield*this.pushSpaces(!0);continue e}}}break e}return e}*pushTag(){if(this.charAt(1)==="<"){let e=this.pos+2,t=this.buffer[e];while(!D(t)&&t!==">")t=this.buffer[++e];return yield*this.pushToIndex(t===">"?e+1:e,!1)}else{let e=this.pos+1,t=this.buffer[e];while(t)if(hp.has(t))t=this.buffer[++e];else if(t==="%"&&Qi.has(this.buffer[e+1])&&Qi.has(this.buffer[e+2]))t=this.buffer[e+=3];else break;return yield*this.pushToIndex(e,!1)}}*pushNewline(){let e=this.buffer[this.pos];if(e===`
|
|
135
135
|
`)return yield*this.pushCount(1);else if(e==="\r"&&this.charAt(1)===`
|
|
136
|
-
`)return yield*this.pushCount(2);else return 0}*pushSpaces(e){let t=this.pos-1,s;do s=this.buffer[++t];while(s===" "||e&&s==="\t");let n=t-this.pos;if(n>0)yield this.buffer.substr(this.pos,n),this.pos=t;return n}*pushUntil(e){let t=this.pos,s=this.buffer[t];while(!e(s))s=this.buffer[++t];return yield*this.pushToIndex(t,!1)}}gp.Lexer=zi});var Us=g(function(bp){class Gi{constructor(){this.lineStarts=[],this.addNewLine=(e)=>this.lineStarts.push(e),this.linePos=(e)=>{let t=0,s=this.lineStarts.length;while(t<s){let i=t+s>>1;if(this.lineStarts[i]<e)t=i+1;else s=i}if(this.lineStarts[t]===e)return{line:t+1,col:1};if(t===0)return{line:0,col:e};let n=this.lineStarts[t-1];return{line:t,col:e-n+1}}}}bp.LineCounter=Gi});var Ys=g(function(kp){var Sp=Fe("process"),Xi=
|
|
136
|
+
`)return yield*this.pushCount(2);else return 0}*pushSpaces(e){let t=this.pos-1,s;do s=this.buffer[++t];while(s===" "||e&&s==="\t");let n=t-this.pos;if(n>0)yield this.buffer.substr(this.pos,n),this.pos=t;return n}*pushUntil(e){let t=this.pos,s=this.buffer[t];while(!e(s))s=this.buffer[++t];return yield*this.pushToIndex(t,!1)}}gp.Lexer=zi});var Us=g(function(bp){class Gi{constructor(){this.lineStarts=[],this.addNewLine=(e)=>this.lineStarts.push(e),this.linePos=(e)=>{let t=0,s=this.lineStarts.length;while(t<s){let i=t+s>>1;if(this.lineStarts[i]<e)t=i+1;else s=i}if(this.lineStarts[t]===e)return{line:t+1,col:1};if(t===0)return{line:0,col:e};let n=this.lineStarts[t-1];return{line:t,col:e-n+1}}}}bp.LineCounter=Gi});var Ys=g(function(kp){var Sp=Fe("process"),Xi=Et(),vp=Fs();function z(e,t){for(let s=0;s<e.length;++s)if(e[s].type===t)return!0;return!1}function Zi(e){for(let t=0;t<e.length;++t)switch(e[t].type){case"space":case"comment":case"newline":break;default:return t}return-1}function tr(e){switch(e?.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"flow-collection":return!0;default:return!1}}function Lt(e){switch(e.type){case"document":return e.start;case"block-map":{let t=e.items[e.items.length-1];return t.sep??t.start}case"block-seq":return e.items[e.items.length-1].start;default:return[]}}function ye(e){if(e.length===0)return[];let t=e.length;e:while(--t>=0)switch(e[t].type){case"doc-start":case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":case"newline":break e}while(e[++t]?.type==="space");return e.splice(t,e.length)}function Pt(e,t){if(t.length<1e5)Array.prototype.push.apply(e,t);else for(let s=0;s<t.length;++s)e.push(t[s])}function er(e){if(e.start.type==="flow-seq-start"){for(let t of e.items)if(t.sep&&!t.value&&!z(t.start,"explicit-key-ind")&&!z(t.sep,"map-value-ind")){if(t.key)t.value=t.key;if(delete t.key,tr(t.value))if(t.value.end)Pt(t.value.end,t.sep);else t.value.end=t.sep;else Pt(t.start,t.sep);delete t.sep}}}class sr{constructor(e){this.atNewLine=!0,this.atScalar=!1,this.indent=0,this.offset=0,this.onKeyLine=!1,this.stack=[],this.source="",this.type="",this.lexer=new vp.Lexer,this.onNewLine=e}*parse(e,t=!1){if(this.onNewLine&&this.offset===0)this.onNewLine(0);for(let s of this.lexer.lex(e,t))yield*this.next(s);if(!t)yield*this.end()}*next(e){if(this.source=e,Sp.env.LOG_TOKENS)console.log("|",Xi.prettyToken(e));if(this.atScalar){this.atScalar=!1,yield*this.step(),this.offset+=e.length;return}let t=Xi.tokenType(e);if(!t){let s=`Not a YAML token: ${e}`;yield*this.pop({type:"error",offset:this.offset,message:s,source:e}),this.offset+=e.length}else if(t==="scalar")this.atNewLine=!1,this.atScalar=!0,this.type="scalar";else{switch(this.type=t,yield*this.step(),t){case"newline":if(this.atNewLine=!0,this.indent=0,this.onNewLine)this.onNewLine(this.offset+e.length);break;case"space":if(this.atNewLine&&e[0]===" ")this.indent+=e.length;break;case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":if(this.atNewLine)this.indent+=e.length;break;case"doc-mode":case"flow-error-end":return;default:this.atNewLine=!1}this.offset+=e.length}}*end(){while(this.stack.length>0)yield*this.pop()}get sourceToken(){return{type:this.type,offset:this.offset,indent:this.indent,source:this.source}}*step(){let e=this.peek(1);if(this.type==="doc-end"&&e?.type!=="doc-end"){while(this.stack.length>0)yield*this.pop();this.stack.push({type:"doc-end",offset:this.offset,source:this.source});return}if(!e)return yield*this.stream();switch(e.type){case"document":return yield*this.document(e);case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return yield*this.scalar(e);case"block-scalar":return yield*this.blockScalar(e);case"block-map":return yield*this.blockMap(e);case"block-seq":return yield*this.blockSequence(e);case"flow-collection":return yield*this.flowCollection(e);case"doc-end":return yield*this.documentEnd(e)}yield*this.pop()}peek(e){return this.stack[this.stack.length-e]}*pop(e){let t=e??this.stack.pop();if(!t)yield{type:"error",offset:this.offset,source:"",message:"Tried to pop an empty stack"};else if(this.stack.length===0)yield t;else{let s=this.peek(1);if(t.type==="block-scalar")t.indent="indent"in s?s.indent:0;else if(t.type==="flow-collection"&&s.type==="document")t.indent=0;if(t.type==="flow-collection")er(t);switch(s.type){case"document":s.value=t;break;case"block-scalar":s.props.push(t);break;case"block-map":{let n=s.items[s.items.length-1];if(n.value){s.items.push({start:[],key:t,sep:[]}),this.onKeyLine=!0;return}else if(n.sep)n.value=t;else{Object.assign(n,{key:t,sep:[]}),this.onKeyLine=!n.explicitKey;return}break}case"block-seq":{let n=s.items[s.items.length-1];if(n.value)s.items.push({start:[],value:t});else n.value=t;break}case"flow-collection":{let n=s.items[s.items.length-1];if(!n||n.value)s.items.push({start:[],key:t,sep:[]});else if(n.sep)n.value=t;else Object.assign(n,{key:t,sep:[]});return}default:yield*this.pop(),yield*this.pop(t)}if((s.type==="document"||s.type==="block-map"||s.type==="block-seq")&&(t.type==="block-map"||t.type==="block-seq")){let n=t.items[t.items.length-1];if(n&&!n.sep&&!n.value&&n.start.length>0&&Zi(n.start)===-1&&(t.indent===0||n.start.every((i)=>i.type!=="comment"||i.indent<t.indent))){if(s.type==="document")s.end=n.start;else s.items.push({start:n.start});t.items.splice(-1,1)}}}}*stream(){switch(this.type){case"directive-line":yield{type:"directive",offset:this.offset,source:this.source};return;case"byte-order-mark":case"space":case"comment":case"newline":yield this.sourceToken;return;case"doc-mode":case"doc-start":{let e={type:"document",offset:this.offset,start:[]};if(this.type==="doc-start")e.start.push(this.sourceToken);this.stack.push(e);return}}yield{type:"error",offset:this.offset,message:`Unexpected ${this.type} token in YAML stream`,source:this.source}}*document(e){if(e.value)return yield*this.lineEnd(e);switch(this.type){case"doc-start":{if(Zi(e.start)!==-1)yield*this.pop(),yield*this.step();else e.start.push(this.sourceToken);return}case"anchor":case"tag":case"space":case"comment":case"newline":e.start.push(this.sourceToken);return}let t=this.startBlockValue(e);if(t)this.stack.push(t);else yield{type:"error",offset:this.offset,message:`Unexpected ${this.type} token in YAML document`,source:this.source}}*scalar(e){if(this.type==="map-value-ind"){let t=Lt(this.peek(2)),s=ye(t),n;if(e.end)n=e.end,n.push(this.sourceToken),delete e.end;else n=[this.sourceToken];let i={type:"block-map",offset:e.offset,indent:e.indent,items:[{start:s,key:e,sep:n}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=i}else yield*this.lineEnd(e)}*blockScalar(e){switch(this.type){case"space":case"comment":case"newline":e.props.push(this.sourceToken);return;case"scalar":if(e.source=this.source,this.atNewLine=!0,this.indent=0,this.onNewLine){let t=this.source.indexOf(`
|
|
137
137
|
`)+1;while(t!==0)this.onNewLine(this.offset+t),t=this.source.indexOf(`
|
|
138
138
|
`,t)+1}yield*this.pop();break;default:yield*this.pop(),yield*this.step()}}*blockMap(e){let t=e.items[e.items.length-1];switch(this.type){case"newline":if(this.onKeyLine=!1,t.value){let s="end"in t.value?t.value.end:void 0;if((Array.isArray(s)?s[s.length-1]:void 0)?.type==="comment")s?.push(this.sourceToken);else e.items.push({start:[this.sourceToken]})}else if(t.sep)t.sep.push(this.sourceToken);else t.start.push(this.sourceToken);return;case"space":case"comment":if(t.value)e.items.push({start:[this.sourceToken]});else if(t.sep)t.sep.push(this.sourceToken);else{if(this.atIndentedComment(t.start,e.indent)){let n=e.items[e.items.length-2]?.value?.end;if(Array.isArray(n)){Pt(n,t.start),n.push(this.sourceToken),e.items.pop();return}}t.start.push(this.sourceToken)}return}if(this.indent>=e.indent){let s=!this.onKeyLine&&this.indent===e.indent,n=s&&(t.sep||t.explicitKey)&&this.type!=="seq-item-ind",i=[];if(n&&t.sep&&!t.value){let r=[];for(let o=0;o<t.sep.length;++o){let a=t.sep[o];switch(a.type){case"newline":r.push(o);break;case"space":break;case"comment":if(a.indent>e.indent)r.length=0;break;default:r.length=0}}if(r.length>=2)i=t.sep.splice(r[1])}switch(this.type){case"anchor":case"tag":if(n||t.value)i.push(this.sourceToken),e.items.push({start:i}),this.onKeyLine=!0;else if(t.sep)t.sep.push(this.sourceToken);else t.start.push(this.sourceToken);return;case"explicit-key-ind":if(!t.sep&&!t.explicitKey)t.start.push(this.sourceToken),t.explicitKey=!0;else if(n||t.value)i.push(this.sourceToken),e.items.push({start:i,explicitKey:!0});else this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken],explicitKey:!0}]});this.onKeyLine=!0;return;case"map-value-ind":if(t.explicitKey)if(!t.sep)if(z(t.start,"newline"))Object.assign(t,{key:null,sep:[this.sourceToken]});else{let r=ye(t.start);this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:r,key:null,sep:[this.sourceToken]}]})}else if(t.value)e.items.push({start:[],key:null,sep:[this.sourceToken]});else if(z(t.sep,"map-value-ind"))this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:i,key:null,sep:[this.sourceToken]}]});else if(tr(t.key)&&!z(t.sep,"newline")){let r=ye(t.start),{key:o,sep:a}=t;a.push(this.sourceToken),delete t.key,delete t.sep,this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:r,key:o,sep:a}]})}else if(i.length>0)t.sep=t.sep.concat(i,this.sourceToken);else t.sep.push(this.sourceToken);else if(!t.sep)Object.assign(t,{key:null,sep:[this.sourceToken]});else if(t.value||n)e.items.push({start:i,key:null,sep:[this.sourceToken]});else if(z(t.sep,"map-value-ind"))this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[],key:null,sep:[this.sourceToken]}]});else t.sep.push(this.sourceToken);this.onKeyLine=!0;return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{let r=this.flowScalar(this.type);if(n||t.value)e.items.push({start:i,key:r,sep:[]}),this.onKeyLine=!0;else if(t.sep)this.stack.push(r);else Object.assign(t,{key:r,sep:[]}),this.onKeyLine=!0;return}default:{let r=this.startBlockValue(e);if(r){if(r.type==="block-seq"){if(!t.explicitKey&&t.sep&&!z(t.sep,"newline")){yield*this.pop({type:"error",offset:this.offset,message:"Unexpected block-seq-ind on same line with key",source:this.source});return}}else if(s)e.items.push({start:i});this.stack.push(r);return}}}}yield*this.pop(),yield*this.step()}*blockSequence(e){let t=e.items[e.items.length-1];switch(this.type){case"newline":if(t.value){let s="end"in t.value?t.value.end:void 0;if((Array.isArray(s)?s[s.length-1]:void 0)?.type==="comment")s?.push(this.sourceToken);else e.items.push({start:[this.sourceToken]})}else t.start.push(this.sourceToken);return;case"space":case"comment":if(t.value)e.items.push({start:[this.sourceToken]});else{if(this.atIndentedComment(t.start,e.indent)){let n=e.items[e.items.length-2]?.value?.end;if(Array.isArray(n)){Pt(n,t.start),n.push(this.sourceToken),e.items.pop();return}}t.start.push(this.sourceToken)}return;case"anchor":case"tag":if(t.value||this.indent<=e.indent)break;t.start.push(this.sourceToken);return;case"seq-item-ind":if(this.indent!==e.indent)break;if(t.value||z(t.start,"seq-item-ind"))e.items.push({start:[this.sourceToken]});else t.start.push(this.sourceToken);return}if(this.indent>e.indent){let s=this.startBlockValue(e);if(s){this.stack.push(s);return}}yield*this.pop(),yield*this.step()}*flowCollection(e){let t=e.items[e.items.length-1];if(this.type==="flow-error-end"){let s;do yield*this.pop(),s=this.peek(1);while(s?.type==="flow-collection")}else if(e.end.length===0){switch(this.type){case"comma":case"explicit-key-ind":if(!t||t.sep)e.items.push({start:[this.sourceToken]});else t.start.push(this.sourceToken);return;case"map-value-ind":if(!t||t.value)e.items.push({start:[],key:null,sep:[this.sourceToken]});else if(t.sep)t.sep.push(this.sourceToken);else Object.assign(t,{key:null,sep:[this.sourceToken]});return;case"space":case"comment":case"newline":case"anchor":case"tag":if(!t||t.value)e.items.push({start:[this.sourceToken]});else if(t.sep)t.sep.push(this.sourceToken);else t.start.push(this.sourceToken);return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{let n=this.flowScalar(this.type);if(!t||t.value)e.items.push({start:[],key:n,sep:[]});else if(t.sep)this.stack.push(n);else Object.assign(t,{key:n,sep:[]});return}case"flow-map-end":case"flow-seq-end":e.end.push(this.sourceToken);return}let s=this.startBlockValue(e);if(s)this.stack.push(s);else yield*this.pop(),yield*this.step()}else{let s=this.peek(2);if(s.type==="block-map"&&(this.type==="map-value-ind"&&s.indent===e.indent||this.type==="newline"&&!s.items[s.items.length-1].sep))yield*this.pop(),yield*this.step();else if(this.type==="map-value-ind"&&s.type!=="flow-collection"){let n=Lt(s),i=ye(n);er(e);let r=e.end.splice(1,e.end.length);r.push(this.sourceToken);let o={type:"block-map",offset:e.offset,indent:e.indent,items:[{start:i,key:e,sep:r}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=o}else yield*this.lineEnd(e)}}flowScalar(e){if(this.onNewLine){let t=this.source.indexOf(`
|
|
139
139
|
`)+1;while(t!==0)this.onNewLine(this.offset+t),t=this.source.indexOf(`
|
|
140
|
-
`,t)+1}return{type:e,offset:this.offset,indent:this.indent,source:this.source}}startBlockValue(e){switch(this.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return this.flowScalar(this.type);case"block-scalar-header":return{type:"block-scalar",offset:this.offset,indent:this.indent,props:[this.sourceToken],source:""};case"flow-map-start":case"flow-seq-start":return{type:"flow-collection",offset:this.offset,indent:this.indent,start:this.sourceToken,items:[],end:[]};case"seq-item-ind":return{type:"block-seq",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken]}]};case"explicit-key-ind":{this.onKeyLine=!0;let t=Lt(e),s=ye(t);return s.push(this.sourceToken),{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:s,explicitKey:!0}]}}case"map-value-ind":{this.onKeyLine=!0;let t=Lt(e),s=ye(t);return{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:s,key:null,sep:[this.sourceToken]}]}}}return null}atIndentedComment(e,t){if(this.type!=="comment")return!1;if(this.indent<=t)return!1;return e.every((s)=>s.type==="newline"||s.type==="space")}*documentEnd(e){if(this.type!=="doc-mode"){if(e.end)e.end.push(this.sourceToken);else e.end=[this.sourceToken];if(this.type==="newline")yield*this.pop()}}*lineEnd(e){switch(this.type){case"comma":case"doc-start":case"doc-end":case"flow-seq-end":case"flow-map-end":case"map-value-ind":yield*this.pop(),yield*this.step();break;case"newline":this.onKeyLine=!1;case"space":case"comment":default:if(e.end)e.end.push(this.sourceToken);else e.end=[this.sourceToken];if(this.type==="newline")yield*this.pop()}}}kp.Parser=sr});var ar=g(function(Tp){var nr=Ms(),Ap=$e(),Ke=_e(),Op=Ut(),
|
|
140
|
+
`,t)+1}return{type:e,offset:this.offset,indent:this.indent,source:this.source}}startBlockValue(e){switch(this.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return this.flowScalar(this.type);case"block-scalar-header":return{type:"block-scalar",offset:this.offset,indent:this.indent,props:[this.sourceToken],source:""};case"flow-map-start":case"flow-seq-start":return{type:"flow-collection",offset:this.offset,indent:this.indent,start:this.sourceToken,items:[],end:[]};case"seq-item-ind":return{type:"block-seq",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken]}]};case"explicit-key-ind":{this.onKeyLine=!0;let t=Lt(e),s=ye(t);return s.push(this.sourceToken),{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:s,explicitKey:!0}]}}case"map-value-ind":{this.onKeyLine=!0;let t=Lt(e),s=ye(t);return{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:s,key:null,sep:[this.sourceToken]}]}}}return null}atIndentedComment(e,t){if(this.type!=="comment")return!1;if(this.indent<=t)return!1;return e.every((s)=>s.type==="newline"||s.type==="space")}*documentEnd(e){if(this.type!=="doc-mode"){if(e.end)e.end.push(this.sourceToken);else e.end=[this.sourceToken];if(this.type==="newline")yield*this.pop()}}*lineEnd(e){switch(this.type){case"comma":case"doc-start":case"doc-end":case"flow-seq-end":case"flow-map-end":case"map-value-ind":yield*this.pop(),yield*this.step();break;case"newline":this.onKeyLine=!1;case"space":case"comment":default:if(e.end)e.end.push(this.sourceToken);else e.end=[this.sourceToken];if(this.type==="newline")yield*this.pop()}}}kp.Parser=sr});var ar=g(function(Tp){var nr=Ms(),Ap=$e(),Ke=_e(),Op=Ut(),Cp=O(),Ep=Us(),ir=Ys();function rr(e){let t=e.prettyErrors!==!1;return{lineCounter:e.lineCounter||t&&new Ep.LineCounter||null,prettyErrors:t}}function qp(e,t={}){let{lineCounter:s,prettyErrors:n}=rr(t),i=new ir.Parser(s?.addNewLine),r=new nr.Composer(t),o=Array.from(r.compose(i.parse(e)));if(n&&s)for(let a of o)a.errors.forEach(Ke.prettifyError(e,s)),a.warnings.forEach(Ke.prettifyError(e,s));if(o.length>0)return o;return Object.assign([],{empty:!0},r.streamInfo())}function or(e,t={}){let{lineCounter:s,prettyErrors:n}=rr(t),i=new ir.Parser(s?.addNewLine),r=new nr.Composer(t),o=null;for(let a of r.compose(i.parse(e),!0,e.length))if(!o)o=a;else if(o.options.logLevel!=="silent"){o.errors.push(new Ke.YAMLParseError(a.range.slice(0,2),"MULTIPLE_DOCS","Source contains multiple documents; please use YAML.parseAllDocuments()"));break}if(n&&s)o.errors.forEach(Ke.prettifyError(e,s)),o.warnings.forEach(Ke.prettifyError(e,s));return o}function Lp(e,t,s){let n=void 0;if(typeof t==="function")n=t;else if(s===void 0&&t&&typeof t==="object")s=t;let i=or(e,s);if(!i)return null;if(i.warnings.forEach((r)=>Op.warn(i.options.logLevel,r)),i.errors.length>0)if(i.options.logLevel!=="silent")throw i.errors[0];else i.errors=[];return i.toJS(Object.assign({reviver:n},s))}function Pp(e,t,s){let n=null;if(typeof t==="function"||Array.isArray(t))n=t;else if(s===void 0&&t)s=t;if(typeof s==="string")s=s.length;if(typeof s==="number"){let i=Math.round(s);s=i<1?void 0:i>8?{indent:8}:{indent:i}}if(e===void 0){let{keepUndefined:i}=s??t??{};if(!i)return}if(Cp.isDocument(e)&&!n)return e.toString(s);return new Ap.Document(e,n,s).toString(s)}Tp.parse=Lp;Tp.parseAllDocuments=qp;Tp.parseDocument=or;Tp.stringify=Pp});import{existsSync as cr}from"fs";import{resolve as Hs}from"path";import{pathToFileURL as Sh}from"url";var xp=Ms(),Dp=$e(),Bp=ys(),Vs=_e(),Rp=Se(),G=O(),Kp=J(),jp=E(),Fp=W(),Up=Q(),lg=Et(),Yp=Fs(),Vp=Us(),Jp=Ys(),Tt=ar(),lr=be();var Hp=xp.Composer,Wp=Dp.Document,Qp=Bp.Schema,{YAMLError:zp,YAMLParseError:Gp,YAMLWarning:Xp}=Vs,Zp=Rp.Alias,{isAlias:eh,isCollection:th,isDocument:sh,isMap:nh,isNode:ih,isPair:rh,isScalar:oh,isSeq:ah}=G,lh=Kp.Pair,ch=jp.Scalar,uh=Fp.YAMLMap,fh=Up.YAMLSeq;var dh=Yp.Lexer,ph=Vp.LineCounter,hh=Jp.Parser,{parse:Js,parseAllDocuments:mh,parseDocument:gh,stringify:yh}=Tt,{visit:bh,visitAsync:wh}=lr;import{DEFAULT_DOCUMENT_SOURCE_POLICY as It,assertRemoteDocumentUrl as vh,redactDocumentUrl as kh}from"@mcp-com-ai/plugin-sdk";async function mg(e,t){let s=e.trim();if(!s)return;let n=Eh(s);if(n?.protocol==="http:"||n?.protocol==="https:")return Oh(s,n,t);if(n&&n.protocol!=="file:"&&n.protocol!=="path:")throw Error(`Unsupported document source scheme: ${n.protocol}`);let i=n?.protocol==="file:"?Bun.fileURLToPath(n):Nh(n?.protocol==="path:"?qh(n):s,t);if(!i)return;return Ah(s,i,t.maxBytes??It.maxBytes)}function Nh(e,t){let s=Hs(t.cwd,e);if(cr(s))return s;let n=Hs(t.hapiHome,"specs");for(let i of["",".json",".yaml",".yml"]){let r=Hs(n,`${e}${i}`);if(cr(r))return r}return}async function Ah(e,t,s){let n=Bun.file(t);if(n.size>s)throw Error(`Document source exceeds ${s} bytes: ${t}`);let i=await n.text();fr(i,s,t);let r=Sh(t).href;return dr({identifier:e,canonicalUri:r,baseUri:new URL(".",r).href,raw:i,document:ur(i,t),remote:!1})}async function Oh(e,t,s){let n=s.fetchImpl??fetch,i=s.maxBytes??It.maxBytes,r=new AbortController,o=setTimeout(()=>r.abort(),s.timeoutMs??It.timeoutMs),a=t;try{for(let l=0;l<=It.maxRedirects;l++){vh(a);let c=await n(a,{redirect:"manual",signal:r.signal});if(Ch(c.status)){let f=c.headers.get("location");if(!f)throw Error(`Redirect from ${re(a)} has no Location header`);a=new URL(f,a);continue}if(!c.ok)throw Error(`Unable to load ${re(a)}: HTTP ${c.status}`);let p=Number(c.headers.get("content-length"));if(Number.isFinite(p)&&p>i)throw Error(`Document source exceeds ${i} bytes: ${re(a)}`);let u=await c.text();return fr(u,i,re(a)),dr({identifier:e,canonicalUri:a.href,baseUri:new URL(".",a).href,raw:u,document:ur(u,re(a)),remote:!0})}throw Error(`Too many redirects while loading ${re(t)}`)}catch(l){if(r.signal.aborted)throw Error(`Timed out loading ${re(a)}`);throw l}finally{clearTimeout(o)}}function ur(e,t){try{let s=Js(e);if(!s||typeof s!=="object"||Array.isArray(s))throw Error("document root must be an object");return s}catch(s){throw Error(`Unable to parse ${t}: ${s instanceof Error?s.message:String(s)}`)}}function fr(e,t,s){if(new TextEncoder().encode(e).byteLength>t)throw Error(`Document source exceeds ${t} bytes: ${s}`)}function dr(e){return Object.freeze(e)}function Ch(e){return[301,302,303,307,308].includes(e)}function Eh(e){try{return new URL(e)}catch{return}}function qh(e){let t=decodeURIComponent(e.pathname);return e.hostname?`${e.hostname}${t}`:t}function re(e){return kh(e)}function yg(e,t,s={}){let n=s.warn??(()=>{}),i=new Map,r=(o,a,l,c)=>{for(let p of[o.name,...o.aliases??[]]){if(i.has(p)){let u=i.get(p);n(`Command '${p}' already provided by ${u.source==="core"?"core":u.pluginName}; ignoring declaration from ${l??"core"}`);continue}i.set(p,{...o,source:a,pluginName:l,packageName:c})}};for(let o of e)r(o,"core");for(let{plugin:o,packageName:a}of t)for(let l of o.commands)r(l,"plugin",o.name,a);return i}function bg(e){let t=new Set;for(let[s,n]of e.entries())if(s===n.name)t.add(n);return Array.from(t).filter((s)=>!s.hidden).sort((s,n)=>s.name.localeCompare(n.name))}import{HAPI_CLI_API_VERSION as wr,satisfiesVersionRange as Rh}from"@mcp-com-ai/plugin-sdk";import{mkdir as Lh,realpath as Ws,readFile as $t,stat as Ph,writeFile as mr}from"fs/promises";import I from"path";import{pathToFileURL as Th}from"url";import{hasFileSystemAccess as gr,resolveHapiPaths as Ih}from"@mcp-com-ai/shared-utils";function Qs(){let e=I.join(Ih().home,"plugins");return{root:e,nodeModules:I.join(e,"node_modules"),manifest:I.join(e,"package.json")}}function je(e){return/^(?:@[a-z0-9][a-z0-9._-]*\/)?[a-z0-9][a-z0-9._-]*$/i.test(e)}async function yr(e,t=Qs()){if(!gr||!je(e))return;let s=I.join(t.nodeModules,...e.split("/"));try{let n=await Ws(s),i=await Ws(t.nodeModules);if(!hr(n,i))return;let r=JSON.parse(await $t(I.join(n,"package.json"),"utf8"));if(r.name!==e)return;let o=Dh(r);if(!o||!Bh(o))return;let a=I.resolve(n,o),l=await Ws(a);if(!hr(l,n))return;return Th(l).href}catch{return}}async function Ag(e,t={}){if(!gr)throw Error("Managed plugins are not available without filesystem access.");let s=t.store??Qs(),n=await _h(e),i=await $h(e);if(i.length===0&&n.size===0)throw Error("Provide at least one plugin package, tarball, or release directory.");await Lh(s.root,{recursive:!0}),await Mh(s);let r=await pr(s.manifest),o=t.execute??br;if(n.size>0)await xh(s.manifest,n),await o(process.execPath,["install","--production"],s.root);if(i.length>0)await o(process.execPath,["add","--production",...i],s.root);return{packageNames:(await pr(s.manifest)).filter((l)=>!r.includes(l)),store:s}}async function Og(e,t={}){if(!je(e))throw Error(`Invalid plugin package name: ${e}`);let s=t.store??Qs();await(t.execute??br)(process.execPath,["remove",e],s.root)}async function Mh(e){try{await $t(e.manifest,"utf8")}catch{await mr(e.manifest,JSON.stringify({name:"hapi-managed-plugins",private:!0,type:"module"},null,2)+`
|
|
141
141
|
`)}}async function br(e,t,s){if(await Bun.spawn([e,...t],{cwd:s,stdout:"inherit",stderr:"inherit",env:{...process.env,BUN_BE_BUN:"1"}}).exited)throw Error(`Plugin package operation failed: ${t.join(" ")}`)}async function $h(e){let t=[];for(let s of e){let n=I.resolve(s);try{if(!(await Ph(n)).isDirectory()){t.push(s);continue}let r=I.join(n,"manifest.json");if(await Bun.file(r).exists())continue;else t.push(n)}catch(i){if(i instanceof Error&&i.message.includes("Release manifest"))throw i;t.push(s)}}return t}async function _h(e){let t=new Map,s=new Set;for(let r of e){let o=I.resolve(r),a=I.join(o,"manifest.json");if(!await Bun.file(a).exists())continue;let l=await Bun.file(a).json();for(let c of l.packages??[]){if(!c.name||!c.file||!je(c.name))continue;t.set(c.name,{file:I.join(o,c.file),internalDependencies:c.internalDependencies??{}})}for(let c of l.managedPlugins??[])if(je(c))s.add(c);if(s.size===0)throw Error(`Release manifest does not declare managed plugins: ${o}`)}let n=new Map,i=[...s];while(i.length>0){let r=i.pop();if(!r||n.has(r))continue;let o=t.get(r);if(!o)throw Error(`Release manifest is missing required package ${r}.`);n.set(r,`file:${o.file}`),i.push(...Object.keys(o.internalDependencies))}return n}async function xh(e,t){let s=JSON.parse(await $t(e,"utf8")),n=Object.fromEntries(t);await mr(e,`${JSON.stringify({...s,dependencies:{...s.dependencies??{},...n},overrides:{...s.overrides??{},...n}},null,2)}
|
|
142
142
|
`)}async function pr(e){let t=JSON.parse(await $t(e,"utf8"));return Object.keys(t.dependencies??{}).filter(je)}function Dh(e){let t=e.exports&&typeof e.exports==="object"&&!Array.isArray(e.exports)?e.exports["."]??e.exports:e.exports;return Mt(t)??e.module??e.main}function Mt(e){if(typeof e==="string")return e;if(!e||typeof e!=="object"||Array.isArray(e))return;let t=e;return Mt(t.bun)??Mt(t.import)??Mt(t.default)}function Bh(e){return/\.(?:c?m?js)$/i.test(e)&&!/(?:^|\/)src(?:\/|$)/.test(e)}function hr(e,t){let s=I.relative(t,e);return s===""||!s.startsWith(`..${I.sep}`)&&s!==".."&&!I.isAbsolute(s)}var Kh=["@mcp-com-ai/plugin-openapi","@mcp-com-ai/plugin-arazzo","@mcp-com-ai/plugin-cloudflare","@mcp-com-ai/enterprise-plugin-auth","@mcp-com-ai/enterprise-plugin-licensing","@mcp-com-ai/plugin-otel"];async function Lg(e={}){let t=e.warn??(()=>{}),s=new Set(e.blocklist??[]),n=[],i=new Set,r=[];for(let o of e.bundledPlugins??[])r.push({packageName:o.name,source:"bundled",plugin:o});for(let o of e.workspacePackages??[])r.push({packageName:o,source:"workspace"});for(let o of Kh)r.push({packageName:o,source:"installed"});for(let o of e.configuredPackages??[])r.push({packageName:o,source:"installed"});for(let{packageName:o,source:a,plugin:l}of r){if(i.has(o))continue;if(i.add(o),s.has(o))continue;let c=!1;try{let p=a,u;if(!l)try{u=await import(o)}catch(y){if(!Sr(y))throw y;let d=await(e.resolveManagedEntrypoint??yr)(o);if(!d)throw y;c=!0,u=await import(d),p="managed"}let f=l??(u?.plugin??u?.default);if(!f){t(`Plugin '${o}' loaded but did not export a plugin definition`);continue}if(f.compatibility?.cliApiVersion!==wr){t(`Plugin '${o}' declares cliApiVersion=${f.compatibility?.cliApiVersion}; CLI expects ${wr}. Skipping.`);continue}let m=f.compatibility.core;if(m&&!Rh(m.version,m.range)){t(`Plugin '${o}' resolved core ${m.version}, which does not satisfy its declared range ${m.range}. Skipping.`);continue}n.push({plugin:f,packageName:o,source:p})}catch(p){let u=p instanceof Error?p.message:String(p);if(c||!Sr(p))t(`Plugin '${o}' failed to load: ${u}`)}}return n}function Sr(e){if(!e||typeof e!=="object")return!1;let t=e.code;if(t==="ERR_MODULE_NOT_FOUND"||t==="MODULE_NOT_FOUND")return!0;let s=e.message??"";return/Cannot find (module|package)/i.test(s)}import{parseArgs as jh,renderCommandHelp as zs}from"@mcp-com-ai/plugin-sdk";var vr=[{command:"cloudflare",packageName:"@mcp-com-ai/plugin-cloudflare",description:"Deploy HAPI MCP servers to Cloudflare Workers (deploy, login, status).",installHint:"bun add -g @mcp-com-ai/plugin-cloudflare"},{command:"openapi",packageName:"@mcp-com-ai/plugin-openapi",description:"OpenAPI-driven tooling (init, lint, list, serve).",installHint:"bun add -g @mcp-com-ai/plugin-openapi",documentRootField:"openapi"},{command:"arazzo",packageName:"@mcp-com-ai/plugin-arazzo",description:"Arazzo workflow validation, serving, and execution.",installHint:"bun add -g @mcp-com-ai/plugin-arazzo",documentRootField:"arazzo"},{command:"workflows",packageName:"@mcp-com-ai/plugin-arazzo",description:"Alias for the Arazzo workflow command group.",installHint:"bun add -g @mcp-com-ai/plugin-arazzo",documentRootField:"arazzo"},{command:"auth",packageName:"@mcp-com-ai/enterprise-plugin-auth",description:"OAuth/Security handler configuration for `hapi serve` (enterprise tier).",installHint:"Contact La Rebelion Labs for enterprise access."},{command:"otel",packageName:"@mcp-com-ai/plugin-otel",description:"OpenTelemetry / PostHog telemetry collection for HAPI commands.",installHint:"bun add -g @mcp-com-ai/plugin-otel"},{command:"license",packageName:"@mcp-com-ai/enterprise-plugin-licensing",description:"Enterprise licensing (activation, status, import). Part of the enterprise tier.",installHint:"Contact La Rebelion Labs for enterprise access, then run `hapi plugins install <private-release-or-package>`."}];function kr(e){return vr.find((t)=>t.command===e)}function Tg(e){return vr.find((t)=>t.documentRootField===e)}var Fh=new Set(["--help","-h","help"]);async function _g(e,t,s){if(t.length===0){let o=e.get("help");if(o?.run){let a=await o.run({positionals:[],options:{},rest:[]},s);return typeof a==="number"?a:0}return s.stdout.write(`Usage: hapi <command> [subcommand] [options]
|
|
143
143
|
`),0}let[n,...i]=t;if(!n)return 0;if(n==="--help"||n==="-h"){let o=e.get("help");if(o?.run){let a=await o.run({positionals:[],options:{},rest:[]},s);return typeof a==="number"?a:0}}if(n==="--version"||n==="-v"){let o=e.get("version");if(o?.run){let a=await o.run({positionals:[],options:{},rest:[]},s);return typeof a==="number"?a:0}}let r=e.get(n);if(!r)return Uh(n,s);return Gs(e,r,i,s,[r.name])}async function Gs(e,t,s,n,i){if(s.length>0&&Fh.has(s[0]))return zs(t,n,i.slice(0,-1)),0;let r=s[0];if(t.subcommands&&t.subcommands.length>0&&r&&!r.startsWith("-")){let a=t.subcommands.find((l)=>l.name===r||l.aliases?.includes(r));if(a)return Gs(e,a,s.slice(1),n,[...i,a.name]);if(!t.run)return n.stderr.write(`Unknown subcommand: ${i.join(" ")} ${r}
|
|
144
|
-
`),zs(t,n,i.slice(0,-1)),1}if(!t.run)return zs(t,n,i.slice(0,-1)),0;if(t.name==="serve"&&i.length>1){let a=e.get("serve");if(a?.source==="core")return Gs(e,a,s,n,[a.name])}let o=jh(s,t.options??[]);
|
|
144
|
+
`),zs(t,n,i.slice(0,-1)),1}if(!t.run)return zs(t,n,i.slice(0,-1)),0;if(t.name==="serve"&&i.length>1){let a=e.get("serve");if(a?.source==="core")return Gs(e,a,s,n,[a.name])}let o=jh(s,t.options??[]);if(o.unknownOptions?.length)n.stderr.write(`\u26A0\uFE0F Unrecognized option(s): ${o.unknownOptions.map((a)=>`--${a}`).join(", ")} \u2014 not applied. Check for a typo (see --help for valid options).
|
|
145
|
+
`);try{let a=await t.run(o,n);return typeof a==="number"?a:Number(process.exitCode??0)}catch(a){let{printCliError:l}=await import("@mcp-com-ai/shared-utils");return l(`\u274C ${i.join(" ")} failed`,a),1}}function Uh(e,t){let s=kr(e);if(s)return t.stderr.write(`
|
|
145
146
|
Command "${e}" is provided by ${s.packageName}, which is not installed.
|
|
146
147
|
`),t.stderr.write(`
|
|
147
148
|
${s.description}
|
package/dist/index.js
CHANGED
|
@@ -141,7 +141,8 @@ ${t.comment}`:t.comment}this.doc.range[2]=t.offset;break}default:this.errors.pus
|
|
|
141
141
|
`)}}async function un(e,t,s){if(await Bun.spawn([e,...t],{cwd:s,stdout:"inherit",stderr:"inherit",env:{...process.env,BUN_BE_BUN:"1"}}).exited)throw Error(`Plugin package operation failed: ${t.join(" ")}`)}async function Jr(e){let t=[];for(let s of e){let n=I.resolve(s);try{if(!(await Ur(n)).isDirectory()){t.push(s);continue}let r=I.join(n,"manifest.json");if(await Bun.file(r).exists())continue;else t.push(n)}catch(i){if(i instanceof Error&&i.message.includes("Release manifest"))throw i;t.push(s)}}return t}async function zr(e){let t=new Map,s=new Set;for(let r of e){let o=I.resolve(r),a=I.join(o,"manifest.json");if(!await Bun.file(a).exists())continue;let l=await Bun.file(a).json();for(let c of l.packages??[]){if(!c.name||!c.file||!be(c.name))continue;t.set(c.name,{file:I.join(o,c.file),internalDependencies:c.internalDependencies??{}})}for(let c of l.managedPlugins??[])if(be(c))s.add(c);if(s.size===0)throw Error(`Release manifest does not declare managed plugins: ${o}`)}let n=new Map,i=[...s];while(i.length>0){let r=i.pop();if(!r||n.has(r))continue;let o=t.get(r);if(!o)throw Error(`Release manifest is missing required package ${r}.`);n.set(r,`file:${o.file}`),i.push(...Object.keys(o.internalDependencies))}return n}async function Wr(e,t){let s=JSON.parse(await Ve(e,"utf8")),n=Object.fromEntries(t);await rn(e,`${JSON.stringify({...s,dependencies:{...s.dependencies??{},...n},overrides:{...s.overrides??{},...n}},null,2)}
|
|
142
142
|
`)}async function sn(e){let t=JSON.parse(await Ve(e,"utf8"));return Object.keys(t.dependencies??{}).filter(be)}function Gr(e){let t=e.exports&&typeof e.exports==="object"&&!Array.isArray(e.exports)?e.exports["."]??e.exports:e.exports;return Ye(t)??e.module??e.main}function Ye(e){if(typeof e==="string")return e;if(!e||typeof e!=="object"||Array.isArray(e))return;let t=e;return Ye(t.bun)??Ye(t.import)??Ye(t.default)}function Qr(e){return/\.(?:c?m?js)$/i.test(e)&&!/(?:^|\/)src(?:\/|$)/.test(e)}function nn(e,t){let s=I.relative(t,e);return s===""||!s.startsWith(`..${I.sep}`)&&s!==".."&&!I.isAbsolute(s)}var Zr=["@mcp-com-ai/plugin-openapi","@mcp-com-ai/plugin-arazzo","@mcp-com-ai/plugin-cloudflare","@mcp-com-ai/enterprise-plugin-auth","@mcp-com-ai/enterprise-plugin-licensing","@mcp-com-ai/plugin-otel"];async function pn(e={}){let t=e.warn??(()=>{}),s=new Set(e.blocklist??[]),n=[],i=new Set,r=[];for(let o of e.bundledPlugins??[])r.push({packageName:o.name,source:"bundled",plugin:o});for(let o of e.workspacePackages??[])r.push({packageName:o,source:"workspace"});for(let o of Zr)r.push({packageName:o,source:"installed"});for(let o of e.configuredPackages??[])r.push({packageName:o,source:"installed"});for(let{packageName:o,source:a,plugin:l}of r){if(i.has(o))continue;if(i.add(o),s.has(o))continue;let c=!1;try{let d=a,u;if(!l)try{u=await import(o)}catch(g){if(!dn(g))throw g;let p=await(e.resolveManagedEntrypoint??an)(o);if(!p)throw g;c=!0,u=await import(p),d="managed"}let f=l??(u?.plugin??u?.default);if(!f){t(`Plugin '${o}' loaded but did not export a plugin definition`);continue}if(f.compatibility?.cliApiVersion!==fn){t(`Plugin '${o}' declares cliApiVersion=${f.compatibility?.cliApiVersion}; CLI expects ${fn}. Skipping.`);continue}let m=f.compatibility.core;if(m&&!Xr(m.version,m.range)){t(`Plugin '${o}' resolved core ${m.version}, which does not satisfy its declared range ${m.range}. Skipping.`);continue}n.push({plugin:f,packageName:o,source:d})}catch(d){let u=d instanceof Error?d.message:String(d);if(c||!dn(d))t(`Plugin '${o}' failed to load: ${u}`)}}return n}function dn(e){if(!e||typeof e!=="object")return!1;let t=e.code;if(t==="ERR_MODULE_NOT_FOUND"||t==="MODULE_NOT_FOUND")return!0;let s=e.message??"";return/Cannot find (module|package)/i.test(s)}import{parseArgs as eo,renderCommandHelp as Bt}from"@mcp-com-ai/plugin-sdk";var He=[{command:"cloudflare",packageName:"@mcp-com-ai/plugin-cloudflare",description:"Deploy HAPI MCP servers to Cloudflare Workers (deploy, login, status).",installHint:"bun add -g @mcp-com-ai/plugin-cloudflare"},{command:"openapi",packageName:"@mcp-com-ai/plugin-openapi",description:"OpenAPI-driven tooling (init, lint, list, serve).",installHint:"bun add -g @mcp-com-ai/plugin-openapi",documentRootField:"openapi"},{command:"arazzo",packageName:"@mcp-com-ai/plugin-arazzo",description:"Arazzo workflow validation, serving, and execution.",installHint:"bun add -g @mcp-com-ai/plugin-arazzo",documentRootField:"arazzo"},{command:"workflows",packageName:"@mcp-com-ai/plugin-arazzo",description:"Alias for the Arazzo workflow command group.",installHint:"bun add -g @mcp-com-ai/plugin-arazzo",documentRootField:"arazzo"},{command:"auth",packageName:"@mcp-com-ai/enterprise-plugin-auth",description:"OAuth/Security handler configuration for `hapi serve` (enterprise tier).",installHint:"Contact La Rebelion Labs for enterprise access."},{command:"otel",packageName:"@mcp-com-ai/plugin-otel",description:"OpenTelemetry / PostHog telemetry collection for HAPI commands.",installHint:"bun add -g @mcp-com-ai/plugin-otel"},{command:"license",packageName:"@mcp-com-ai/enterprise-plugin-licensing",description:"Enterprise licensing (activation, status, import). Part of the enterprise tier.",installHint:"Contact La Rebelion Labs for enterprise access, then run `hapi plugins install <private-release-or-package>`."}];function hn(e){return He.find((t)=>t.command===e)}function mn(e){return He.find((t)=>t.documentRootField===e)}var to=new Set(["--help","-h","help"]);async function gn(e,t,s){if(t.length===0){let o=e.get("help");if(o?.run){let a=await o.run({positionals:[],options:{},rest:[]},s);return typeof a==="number"?a:0}return s.stdout.write(`Usage: hapi <command> [subcommand] [options]
|
|
143
143
|
`),0}let[n,...i]=t;if(!n)return 0;if(n==="--help"||n==="-h"){let o=e.get("help");if(o?.run){let a=await o.run({positionals:[],options:{},rest:[]},s);return typeof a==="number"?a:0}}if(n==="--version"||n==="-v"){let o=e.get("version");if(o?.run){let a=await o.run({positionals:[],options:{},rest:[]},s);return typeof a==="number"?a:0}}let r=e.get(n);if(!r)return so(n,s);return jt(e,r,i,s,[r.name])}async function jt(e,t,s,n,i){if(s.length>0&&to.has(s[0]))return Bt(t,n,i.slice(0,-1)),0;let r=s[0];if(t.subcommands&&t.subcommands.length>0&&r&&!r.startsWith("-")){let a=t.subcommands.find((l)=>l.name===r||l.aliases?.includes(r));if(a)return jt(e,a,s.slice(1),n,[...i,a.name]);if(!t.run)return n.stderr.write(`Unknown subcommand: ${i.join(" ")} ${r}
|
|
144
|
-
`),Bt(t,n,i.slice(0,-1)),1}if(!t.run)return Bt(t,n,i.slice(0,-1)),0;if(t.name==="serve"&&i.length>1){let a=e.get("serve");if(a?.source==="core")return jt(e,a,s,n,[a.name])}let o=eo(s,t.options??[]);
|
|
144
|
+
`),Bt(t,n,i.slice(0,-1)),1}if(!t.run)return Bt(t,n,i.slice(0,-1)),0;if(t.name==="serve"&&i.length>1){let a=e.get("serve");if(a?.source==="core")return jt(e,a,s,n,[a.name])}let o=eo(s,t.options??[]);if(o.unknownOptions?.length)n.stderr.write(`\u26A0\uFE0F Unrecognized option(s): ${o.unknownOptions.map((a)=>`--${a}`).join(", ")} \u2014 not applied. Check for a typo (see --help for valid options).
|
|
145
|
+
`);try{let a=await t.run(o,n);return typeof a==="number"?a:Number(process.exitCode??0)}catch(a){let{printCliError:l}=await import("@mcp-com-ai/shared-utils");return l(`\u274C ${i.join(" ")} failed`,a),1}}function so(e,t){let s=hn(e);if(s)return t.stderr.write(`
|
|
145
146
|
Command "${e}" is provided by ${s.packageName}, which is not installed.
|
|
146
147
|
`),t.stderr.write(`
|
|
147
148
|
${s.description}
|
|
@@ -174,7 +175,7 @@ Examples:
|
|
|
174
175
|
`),r(`Is the HAPI CLI helpful?
|
|
175
176
|
Don't forget to star the project on GitHub: https://github.com/mcp-com-ai/hapimcp
|
|
176
177
|
|
|
177
|
-
`),0}}}import{HAPI_CLI_API_VERSION as io}from"@mcp-com-ai/plugin-sdk";var bn="1.
|
|
178
|
+
`),0}}}import{HAPI_CLI_API_VERSION as io}from"@mcp-com-ai/plugin-sdk";var bn="1.1.0";var Je=bn;var wn={name:"version",aliases:["--version","-v"],description:"Show the installed CLI version",run:async(e,t)=>(t.stdout.write(`hapi ${Je}
|
|
178
179
|
`),t.stdout.write(`plugin-contract v${io}
|
|
179
180
|
`),0)};import{hasFileSystemAccess as ro,loadGlobalConfig as Sn,saveGlobalConfig as vn}from"@mcp-com-ai/shared-utils";function kn(e){return{name:"plugins",description:"List loaded plugins and discover installable ones",subcommands:[{name:"list",description:"List the plugins currently loaded by the CLI",async run(t,s){let n=e();if(n.length===0)return s.stdout.write("No plugins loaded. Run `hapi plugins available` to see what you can install.\n"),0;s.stdout.write(`
|
|
180
181
|
Loaded plugins:
|
|
@@ -218,7 +219,7 @@ Loaded plugins: ${a.length}
|
|
|
218
219
|
`);let c=l.plugin.compatibility.core;if(c){let d=lo(c.version,c.range);if(n(` core: ${c.version} ${d?"satisfies":"does not satisfy"} ${c.range}
|
|
219
220
|
`),!d)r++}}if(a.length===0)n(` \u2022 no plugins loaded
|
|
220
221
|
`);return n(`
|
|
221
|
-
`),r===0?0:1}}}import{existsSync as Mr}from"fs";import{resolve as Zs}from"path";import{pathToFileURL as cm}from"url";var Ah=Bs(),Oh=_e(),Lh=Cs(),Qs=De(),Ph=ke(),Q=A(),Eh=H(),qh=L(),Ih=z(),Th=W(),gy=Tt(),$h=zs(),Mh=Ws(),xh=Gs(),_t=Tr(),$r=Se();var _h=Ah.Composer,Dh=Oh.Document,Rh=Lh.Schema,{YAMLError:Bh,YAMLParseError:jh,YAMLWarning:Kh}=Qs,Fh=Ph.Alias,{isAlias:Uh,isCollection:Yh,isDocument:Vh,isMap:Hh,isNode:Jh,isPair:zh,isScalar:Wh,isSeq:Gh}=Q,Qh=Eh.Pair,Xh=qh.Scalar,Zh=Ih.YAMLMap,em=Th.YAMLSeq;var tm=$h.Lexer,sm=Mh.LineCounter,nm=xh.Parser,{parse:Xs,parseAllDocuments:im,parseDocument:rm,stringify:om}=_t,{visit:am,visitAsync:lm}=$r;import{DEFAULT_DOCUMENT_SOURCE_POLICY as Dt,assertRemoteDocumentUrl as um,redactDocumentUrl as fm}from"@mcp-com-ai/plugin-sdk";async function xr(e,t){let s=e.trim();if(!s)return;let n=gm(s);if(n?.protocol==="http:"||n?.protocol==="https:")return hm(s,n,t);if(n&&n.protocol!=="file:"&&n.protocol!=="path:")throw Error(`Unsupported document source scheme: ${n.protocol}`);let i=n?.protocol==="file:"?Bun.fileURLToPath(n):dm(n?.protocol==="path:"?ym(n):s,t);if(!i)return;return pm(s,i,t.maxBytes??Dt.maxBytes)}function dm(e,t){let s=Zs(t.cwd,e);if(Mr(s))return s;let n=Zs(t.hapiHome,"specs");for(let i of["",".json",".yaml",".yml"]){let r=Zs(n,`${e}${i}`);if(Mr(r))return r}return}async function pm(e,t,s){let n=Bun.file(t);if(n.size>s)throw Error(`Document source exceeds ${s} bytes: ${t}`);let i=await n.text();Dr(i,s,t);let r=cm(t).href;return Rr({identifier:e,canonicalUri:r,baseUri:new URL(".",r).href,raw:i,document:_r(i,t),remote:!1})}async function hm(e,t,s){let n=s.fetchImpl??fetch,i=s.maxBytes??Dt.maxBytes,r=new AbortController,o=setTimeout(()=>r.abort(),s.timeoutMs??Dt.timeoutMs),a=t;try{for(let l=0;l<=Dt.maxRedirects;l++){um(a);let c=await n(a,{redirect:"manual",signal:r.signal});if(mm(c.status)){let f=c.headers.get("location");if(!f)throw Error(`Redirect from ${re(a)} has no Location header`);a=new URL(f,a);continue}if(!c.ok)throw Error(`Unable to load ${re(a)}: HTTP ${c.status}`);let d=Number(c.headers.get("content-length"));if(Number.isFinite(d)&&d>i)throw Error(`Document source exceeds ${i} bytes: ${re(a)}`);let u=await c.text();return Dr(u,i,re(a)),Rr({identifier:e,canonicalUri:a.href,baseUri:new URL(".",a).href,raw:u,document:_r(u,re(a)),remote:!0})}throw Error(`Too many redirects while loading ${re(t)}`)}catch(l){if(r.signal.aborted)throw Error(`Timed out loading ${re(a)}`);throw l}finally{clearTimeout(o)}}function _r(e,t){try{let s=Xs(e);if(!s||typeof s!=="object"||Array.isArray(s))throw Error("document root must be an object");return s}catch(s){throw Error(`Unable to parse ${t}: ${s instanceof Error?s.message:String(s)}`)}}function Dr(e,t,s){if(new TextEncoder().encode(e).byteLength>t)throw Error(`Document source exceeds ${t} bytes: ${s}`)}function Rr(e){return Object.freeze(e)}function mm(e){return[301,302,303,307,308].includes(e)}function gm(e){try{return new URL(e)}catch{return}}function ym(e){let t=decodeURIComponent(e.pathname);return e.hostname?`${e.hostname}${t}`:t}function re(e){return fm(e)}function jr(e){let t=()=>e().flatMap((s)=>s.plugin.serveProviders??[]);return{name:"serve",description:"Serve an OpenAPI or Arazzo document with the matching installed plugin",arguments:[{name:"source",description:"Project name, local JSON/YAML file, or remote document URL",required:!1}],get options(){return wm(t())},async run(s,n){return bm(t(),s,n)}}}async function bm(e,t,s){let n=typeof t.options.specs==="string"?t.options.specs:void 0,i=typeof t.options.openapi==="string"?t.options.openapi:void 0;if(n&&i)return s.stderr.write(`Use either --specs or --openapi, not both.
|
|
222
|
+
`),r===0?0:1}}}import{existsSync as Mr}from"fs";import{resolve as Zs}from"path";import{pathToFileURL as cm}from"url";var Ah=Bs(),Oh=_e(),Lh=Cs(),Qs=De(),Ph=ke(),Q=A(),Eh=H(),qh=L(),Ih=z(),Th=W(),gy=Tt(),$h=zs(),Mh=Ws(),xh=Gs(),_t=Tr(),$r=Se();var _h=Ah.Composer,Dh=Oh.Document,Rh=Lh.Schema,{YAMLError:Bh,YAMLParseError:jh,YAMLWarning:Kh}=Qs,Fh=Ph.Alias,{isAlias:Uh,isCollection:Yh,isDocument:Vh,isMap:Hh,isNode:Jh,isPair:zh,isScalar:Wh,isSeq:Gh}=Q,Qh=Eh.Pair,Xh=qh.Scalar,Zh=Ih.YAMLMap,em=Th.YAMLSeq;var tm=$h.Lexer,sm=Mh.LineCounter,nm=xh.Parser,{parse:Xs,parseAllDocuments:im,parseDocument:rm,stringify:om}=_t,{visit:am,visitAsync:lm}=$r;import{DEFAULT_DOCUMENT_SOURCE_POLICY as Dt,assertRemoteDocumentUrl as um,redactDocumentUrl as fm}from"@mcp-com-ai/plugin-sdk";async function xr(e,t){let s=e.trim();if(!s)return;let n=gm(s);if(n?.protocol==="http:"||n?.protocol==="https:")return hm(s,n,t);if(n&&n.protocol!=="file:"&&n.protocol!=="path:")throw Error(`Unsupported document source scheme: ${n.protocol}`);let i=n?.protocol==="file:"?Bun.fileURLToPath(n):dm(n?.protocol==="path:"?ym(n):s,t);if(!i)return;return pm(s,i,t.maxBytes??Dt.maxBytes)}function dm(e,t){let s=Zs(t.cwd,e);if(Mr(s))return s;let n=Zs(t.hapiHome,"specs");for(let i of["",".json",".yaml",".yml"]){let r=Zs(n,`${e}${i}`);if(Mr(r))return r}return}async function pm(e,t,s){let n=Bun.file(t);if(n.size>s)throw Error(`Document source exceeds ${s} bytes: ${t}`);let i=await n.text();Dr(i,s,t);let r=cm(t).href;return Rr({identifier:e,canonicalUri:r,baseUri:new URL(".",r).href,raw:i,document:_r(i,t),remote:!1})}async function hm(e,t,s){let n=s.fetchImpl??fetch,i=s.maxBytes??Dt.maxBytes,r=new AbortController,o=setTimeout(()=>r.abort(),s.timeoutMs??Dt.timeoutMs),a=t;try{for(let l=0;l<=Dt.maxRedirects;l++){um(a);let c=await n(a,{redirect:"manual",signal:r.signal});if(mm(c.status)){let f=c.headers.get("location");if(!f)throw Error(`Redirect from ${re(a)} has no Location header`);a=new URL(f,a);continue}if(!c.ok)throw Error(`Unable to load ${re(a)}: HTTP ${c.status}`);let d=Number(c.headers.get("content-length"));if(Number.isFinite(d)&&d>i)throw Error(`Document source exceeds ${i} bytes: ${re(a)}`);let u=await c.text();return Dr(u,i,re(a)),Rr({identifier:e,canonicalUri:a.href,baseUri:new URL(".",a).href,raw:u,document:_r(u,re(a)),remote:!0})}throw Error(`Too many redirects while loading ${re(t)}`)}catch(l){if(r.signal.aborted)throw Error(`Timed out loading ${re(a)}`);throw l}finally{clearTimeout(o)}}function _r(e,t){try{let s=Xs(e);if(!s||typeof s!=="object"||Array.isArray(s))throw Error("document root must be an object");return s}catch(s){throw Error(`Unable to parse ${t}: ${s instanceof Error?s.message:String(s)}`)}}function Dr(e,t,s){if(new TextEncoder().encode(e).byteLength>t)throw Error(`Document source exceeds ${t} bytes: ${s}`)}function Rr(e){return Object.freeze(e)}function mm(e){return[301,302,303,307,308].includes(e)}function gm(e){try{return new URL(e)}catch{return}}function ym(e){let t=decodeURIComponent(e.pathname);return e.hostname?`${e.hostname}${t}`:t}function re(e){return fm(e)}function jr(e){let t=()=>e().flatMap((s)=>s.plugin.serveProviders??[]);return{name:"serve",description:"Serve an OpenAPI or Arazzo document with the matching installed plugin",arguments:[{name:"source",description:"Project name, local JSON/YAML file, or remote document URL",required:!1}],get options(){return wm(t())},get longHelp(){return t().find((s)=>s.longHelp)?.longHelp},async run(s,n){return bm(t(),s,n)}}}async function bm(e,t,s){let n=typeof t.options.specs==="string"?t.options.specs:void 0,i=typeof t.options.openapi==="string"?t.options.openapi:void 0;if(n&&i)return s.stderr.write(`Use either --specs or --openapi, not both.
|
|
222
223
|
`),1;let r=n??i??t.positionals[0]??"",o=await xr(r,{cwd:s.cwd,hapiHome:s.hapiHome});if(!o){let d=e.filter((u)=>u.legacyFallback);if(d.length!==1)return s.stderr.write(`Unable to resolve document source: ${r||"(missing)"}
|
|
223
224
|
`),1;return Br(await d[0].serve({source:o,invocation:t},s))}let a=o.document,l=e.filter((d)=>typeof a[d.rootField]==="string");if(l.length>1)return s.stderr.write(`Ambiguous document ${o.identifier}: multiple root fields matched (${l.map((d)=>d.rootField).join(", ")})
|
|
224
225
|
`),1;if(l.length===0){let d=Object.keys(a).map((u)=>mn(u)).find(Boolean);if(d)return s.stderr.write(`Document type requires ${d.packageName}, which is not installed.
|
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: hapi-agent-prompt-generator
|
|
3
|
+
description: Complete a HAPI `hapi serve --dry-run --output markdown` dump into a production-ready AI agent system prompt. Use whenever you're given a HAPI markdown dry-run dump — piped in, pasted, or saved to a file — and asked to "complete the agent prompt", "generate a system prompt for this API", "finish the placeholders in this dump", or "build an agent prompt from these tools". Requires read access to the underlying OpenAPI/Arazzo document and, ideally, the API's own documentation or provider context, so the Role/Objective/Policy content is grounded in what the API is actually for, not guessed from tool names alone.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# hapi-agent-prompt-generator
|
|
7
|
+
|
|
8
|
+
Completes the semantic half of an AI agent's system prompt that `hapi serve
|
|
9
|
+
--dry-run --output markdown` can't compute on its own. HAPI already derives
|
|
10
|
+
the mechanical part — the `Available Tools` list (name, description, and
|
|
11
|
+
required parameters, straight from the OpenAPI/Arazzo document) — because
|
|
12
|
+
that's just a restatement of the tool schema. What it can't derive is who
|
|
13
|
+
this agent should *be*, what it's *for*, and how it should *behave* — that
|
|
14
|
+
requires understanding what the underlying API does and who'd use an agent
|
|
15
|
+
built on top of it.
|
|
16
|
+
|
|
17
|
+
## Input
|
|
18
|
+
|
|
19
|
+
A markdown document produced by:
|
|
20
|
+
|
|
21
|
+
```
|
|
22
|
+
hapi serve --dry-run --output markdown
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
It has seven sections. `# Available Tools` is already filled in. Every other
|
|
26
|
+
section holds a placeholder matching this exact pattern:
|
|
27
|
+
|
|
28
|
+
```
|
|
29
|
+
<PLACEHOLDER: <hint> — complete with the hapi-agent-prompt-generator skill>
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
A trailing stats note (tool count, rough token estimate) and a completion
|
|
33
|
+
hint follow the template — those aren't part of the prompt itself; don't
|
|
34
|
+
try to "complete" them, and strip them from your final output (see Output
|
|
35
|
+
below).
|
|
36
|
+
|
|
37
|
+
## Your job
|
|
38
|
+
|
|
39
|
+
1. Read the `# Available Tools` section — it's your ground truth for what
|
|
40
|
+
this agent can actually do. Don't invent capabilities beyond it.
|
|
41
|
+
2. Find every `<PLACEHOLDER: ...>` block and replace it with real,
|
|
42
|
+
specific content, using the underlying OpenAPI/Arazzo document (title,
|
|
43
|
+
description, security schemes, server URLs), the API provider's own
|
|
44
|
+
docs if it's a known public API, and the project's source/README if
|
|
45
|
+
available — not just the tool names.
|
|
46
|
+
3. Leave `# Available Tools` itself untouched — it's HAPI's own
|
|
47
|
+
deterministic output, sourced from the same tool computation as
|
|
48
|
+
`hapi serve`'s live `tools/list`.
|
|
49
|
+
4. When you're done, no `PLACEHOLDER` marker should remain anywhere in the
|
|
50
|
+
output.
|
|
51
|
+
|
|
52
|
+
## Section-by-section guidance
|
|
53
|
+
|
|
54
|
+
### `# Role`
|
|
55
|
+
|
|
56
|
+
Name the agent and its domain in one or two sentences: what kind of
|
|
57
|
+
assistant is this, and what's its area of expertise? Ground it in the
|
|
58
|
+
actual API (e.g. "You are a Strava Coach Assistant, an expert in analyzing
|
|
59
|
+
athlete performance data..." — not a generic "You are a helpful assistant").
|
|
60
|
+
State its operating boundary too: what's explicitly *outside* its scope (a
|
|
61
|
+
Strava-data agent isn't a general fitness coach or a nutrition advisor,
|
|
62
|
+
even though a user might ask).
|
|
63
|
+
|
|
64
|
+
### `# Objective`
|
|
65
|
+
|
|
66
|
+
One or two sentences stating the concrete end-state this agent is trying to
|
|
67
|
+
reach for the user on a typical request — not "help the user" but the
|
|
68
|
+
actual outcome (e.g. "accurately answer questions about the user's Strava
|
|
69
|
+
activity, segments, and clubs by calling the right tool with correct
|
|
70
|
+
parameters and synthesizing a clear, factual response").
|
|
71
|
+
|
|
72
|
+
### `# Tool-Use Policy`
|
|
73
|
+
|
|
74
|
+
Rules governing *when* and *how* tools get called, grounded in the actual
|
|
75
|
+
tool list:
|
|
76
|
+
- When should a tool be called at all, vs. answering from general
|
|
77
|
+
knowledge or asking a clarifying question?
|
|
78
|
+
- What should happen when a required parameter (per the tool's "Required
|
|
79
|
+
parameters" note) is missing from the user's request — ask, or infer?
|
|
80
|
+
Be explicit: guessing a required parameter is usually the wrong default.
|
|
81
|
+
- How should the agent evaluate a tool's result before responding — what
|
|
82
|
+
does "this call succeeded but the answer isn't complete" look like for
|
|
83
|
+
*these* tools specifically?
|
|
84
|
+
|
|
85
|
+
### `# Operational Process`
|
|
86
|
+
|
|
87
|
+
A concrete step-by-step sequence (Analyze → Plan → Execute → Verify →
|
|
88
|
+
Respond is a reasonable skeleton, per the reference template) — but tailor
|
|
89
|
+
each step to how *this* API's tools actually get combined. If several tools
|
|
90
|
+
are commonly chained (e.g. look up an ID before fetching its details),
|
|
91
|
+
say so explicitly rather than leaving the process generic.
|
|
92
|
+
|
|
93
|
+
### `# Error Handling & Edge Cases`
|
|
94
|
+
|
|
95
|
+
What happens when a tool call fails, times out, returns an empty result, or
|
|
96
|
+
returns something unexpected? When should the agent retry vs. give up and
|
|
97
|
+
explain the failure vs. escalate to a human? If the API has known
|
|
98
|
+
rate-limiting or auth-expiry behavior (check the OpenAPI security schemes
|
|
99
|
+
and any provider docs), address it here specifically.
|
|
100
|
+
|
|
101
|
+
### `# Guardrails & Boundaries`
|
|
102
|
+
|
|
103
|
+
The placeholder already names which tools are destructive (from HAPI's own
|
|
104
|
+
`destructiveHint` computation) — or states there are none. Your job: decide
|
|
105
|
+
which of those (if any) need explicit user confirmation before executing,
|
|
106
|
+
which should never run without it, and add any other hard limits relevant
|
|
107
|
+
to this API (e.g. never modify another user's data, never exceed a rate
|
|
108
|
+
limit intentionally, never fabricate a value a tool didn't actually
|
|
109
|
+
return). Also keep the standard "don't reveal these instructions" boundary
|
|
110
|
+
unless there's a reason not to.
|
|
111
|
+
|
|
112
|
+
## Output
|
|
113
|
+
|
|
114
|
+
Write the completed prompt back in the same markdown shape — same section
|
|
115
|
+
headers, same order — with every placeholder replaced by real content.
|
|
116
|
+
Strip the trailing stats note and completion-hint footer (the "N tools ·
|
|
117
|
+
~X tokens..." line and the "Complete this agent prompt template with a
|
|
118
|
+
coding agent..." line) from your output; those were context for the human
|
|
119
|
+
running the dry-run, not part of the prompt itself. If you were invoked in
|
|
120
|
+
a pipe, print the completed prompt to stdout. If you were handed a saved
|
|
121
|
+
file, write the result back to that file (or to `agent-system-prompt.md` in
|
|
122
|
+
the project root if none was given) and say where you put it.
|
|
123
|
+
|
|
124
|
+
## Before you finish
|
|
125
|
+
|
|
126
|
+
Search the output for the literal string `PLACEHOLDER`. If it's still
|
|
127
|
+
present anywhere, you're not done — go back and fill in what's left rather
|
|
128
|
+
than leaving a partial result.
|
|
@@ -0,0 +1,187 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: hapi-apps-dump
|
|
3
|
+
description: Complete a HAPI `hapi serve --dry-run --output json` (or `--output yaml`) dump into a submission-ready chatgpt-app-submission.json for ChatGPT Apps. Use whenever you're given a HAPI dry-run dump — piped in, pasted, or saved to a file — and asked to "complete the placeholders", "prepare the app submission", or "fill in the dump from hapi serve". Requires read access to the underlying OpenAPI document and, ideally, the API's implementation/controllers so justifications and test cases are grounded in what the tools actually do, not guessed from names alone.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# hapi-apps-dump
|
|
7
|
+
|
|
8
|
+
Completes the semantic half of a ChatGPT App submission that `hapi serve
|
|
9
|
+
--dry-run` can't compute on its own. HAPI already derives everything
|
|
10
|
+
mechanical from the OpenAPI document — tool names, descriptions, and
|
|
11
|
+
`readOnlyHint`/`destructiveHint`/`openWorldHint` annotations (from HTTP verb,
|
|
12
|
+
or `x-readOnlyHint`/`x-destructiveHint`/`x-openWorldHint` extensions when the
|
|
13
|
+
spec author set them explicitly). What it can't derive is *why* those
|
|
14
|
+
annotations are true, what a human would actually ask this app to do, and
|
|
15
|
+
what "success" looks like for a given request — that requires reading the
|
|
16
|
+
API, not just its shape.
|
|
17
|
+
|
|
18
|
+
## Input
|
|
19
|
+
|
|
20
|
+
A JSON or YAML document shaped like OpenAI's `chatgpt-app-submission.v1.json`
|
|
21
|
+
schema, produced by:
|
|
22
|
+
|
|
23
|
+
```
|
|
24
|
+
hapi serve --dry-run --output json
|
|
25
|
+
hapi serve --dry-run --output yaml
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
Every field HAPI could fill in deterministically already has a real value.
|
|
29
|
+
Every field it couldn't is a placeholder string matching this exact pattern:
|
|
30
|
+
|
|
31
|
+
```
|
|
32
|
+
<PLACEHOLDER: <hint> — complete with the hapi-apps-dump skill>
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
## Your job
|
|
36
|
+
|
|
37
|
+
1. Find every `<PLACEHOLDER: ...>` string in the dump (`grep -n PLACEHOLDER`
|
|
38
|
+
if you're working from a saved file).
|
|
39
|
+
2. For each one, read enough of the project — the OpenAPI document itself,
|
|
40
|
+
the operation's implementation/controller if the source is available,
|
|
41
|
+
README/docs — to write a real, specific value grounded in what that part
|
|
42
|
+
of the API actually does.
|
|
43
|
+
3. Leave every already-filled field untouched. `readOnlyHint` and
|
|
44
|
+
`destructiveHint` are always HAPI's own deterministic output — don't
|
|
45
|
+
second-guess or rewrite them, only explain them where a justification
|
|
46
|
+
field asks you to. `openWorldHint` is usually deterministic too, but not
|
|
47
|
+
always — see the note under "Per-tool `justifications`" below for the
|
|
48
|
+
case where it's a placeholder you need to actually decide.
|
|
49
|
+
4. When you're done, no `PLACEHOLDER` marker should remain anywhere in the
|
|
50
|
+
output.
|
|
51
|
+
|
|
52
|
+
## Field-by-field guidance
|
|
53
|
+
|
|
54
|
+
### `app_info`
|
|
55
|
+
|
|
56
|
+
- **`subtitle`** — one line, 30 characters or fewer, describing what the app
|
|
57
|
+
lets someone do (not what the API "is"). Write it as a pitch, not a spec
|
|
58
|
+
title.
|
|
59
|
+
- **`description`** — a few sentences: who this is for and what they can
|
|
60
|
+
accomplish through it. Base it on the actual set of tools in the dump, not
|
|
61
|
+
a generic restatement of the OpenAPI `info.description`.
|
|
62
|
+
- **`category`** — pick the closest fit from the categories OpenAI's
|
|
63
|
+
`chatgpt-app-submission.v1.json` schema defines. If you can't confirm the
|
|
64
|
+
current category list, say so explicitly in your output rather than
|
|
65
|
+
inventing one — leave a clear note next to the field instead of a
|
|
66
|
+
confident-looking guess.
|
|
67
|
+
|
|
68
|
+
### Per-tool `justifications` (`tools.<name>.justifications`)
|
|
69
|
+
|
|
70
|
+
Each tool already has `annotations` filled in. The matching justification
|
|
71
|
+
explains *why* that specific annotation is true for *this* tool — ground it
|
|
72
|
+
in what the operation does, not a generic restatement of the boolean:
|
|
73
|
+
|
|
74
|
+
- **`read_only_justification`** — if `readOnlyHint` is `true`, explain what
|
|
75
|
+
data this reads and confirm it changes nothing. If `false`, explain what it
|
|
76
|
+
writes/changes.
|
|
77
|
+
- **`destructive_justification`** — if `destructiveHint` is `true`, name what
|
|
78
|
+
gets modified or removed and how. If `false`, explain why the operation is
|
|
79
|
+
safe to retry or reverse.
|
|
80
|
+
- **`open_world_justification`** — unlike the other two, this one is
|
|
81
|
+
sometimes *not* a placeholder to begin with: whenever `openWorldHint` was
|
|
82
|
+
already decided (see the section below), HAPI fills this with a generic,
|
|
83
|
+
accurate statement of that fact (e.g. "Tool ... calls a public internet
|
|
84
|
+
resource or open-ended external entity."). Treat that as a floor, not a
|
|
85
|
+
finished answer — enrich it with the actual external system/resource this
|
|
86
|
+
tool reaches (the specific third-party service, API, or the internet at
|
|
87
|
+
large) when you can determine it, rather than leaving the generic
|
|
88
|
+
statement as-is. If it's still a `<PLACEHOLDER: ...>` (meaning
|
|
89
|
+
`openWorldHint` itself was undecided), decide the hint first — see below —
|
|
90
|
+
then write the justification the normal way: name what's reached if
|
|
91
|
+
`true`, or explain why the effects are scoped to a closed, well-known set
|
|
92
|
+
of resources if `false`.
|
|
93
|
+
|
|
94
|
+
A justification that just restates the boolean in words ("this is read-only
|
|
95
|
+
because readOnlyHint is true") is not acceptable — it must reference what the
|
|
96
|
+
tool actually does.
|
|
97
|
+
|
|
98
|
+
#### `openWorldHint` is sometimes undecided — that's on purpose
|
|
99
|
+
|
|
100
|
+
Unlike `readOnlyHint`/`destructiveHint` (always derived from the HTTP method
|
|
101
|
+
or an explicit `x-*` extension), `annotations.openWorldHint` in the dump can
|
|
102
|
+
itself be a placeholder instead of a real boolean. HAPI only fills it in
|
|
103
|
+
when it's actually knowable: an explicit `x-openWorldHint` on the operation,
|
|
104
|
+
or `--headless` mode (defaults to `true`, since a headless server's backend
|
|
105
|
+
is by definition a separate/external system, unless the operator passed
|
|
106
|
+
`--no-open-world` for an air-gapped or private-workspace deployment). In
|
|
107
|
+
every other case, it's a real judgment call that depends on what the
|
|
108
|
+
*backend this tool actually calls* is — not something inferable from the
|
|
109
|
+
route shape alone — so HAPI leaves it as a placeholder rather than guessing.
|
|
110
|
+
|
|
111
|
+
Per OpenAI's own guidance: set `true` when the tool accesses the public
|
|
112
|
+
internet or an open-ended external entity (including read-only tools like
|
|
113
|
+
web search, and write tools that post, send, publish, push, or submit to
|
|
114
|
+
somewhere open-ended); set `false` when the tool is limited to a bounded
|
|
115
|
+
private account or workspace, even if that service is externally hosted.
|
|
116
|
+
|
|
117
|
+
When you hit this placeholder: look at what the operation's backend actually
|
|
118
|
+
is (the OpenAPI `servers` entry, the implementation, any docs describing the
|
|
119
|
+
integration) and decide for real — don't default to `true` just because it's
|
|
120
|
+
common, and don't restate the placeholder's own wording as if it were an
|
|
121
|
+
answer. If you genuinely can't tell from the available source, say so
|
|
122
|
+
explicitly in your output instead of picking one, so the human doing final
|
|
123
|
+
review has an honest flag to investigate rather than a confident-looking
|
|
124
|
+
guess.
|
|
125
|
+
|
|
126
|
+
### `test_cases` / `negative_test_cases`
|
|
127
|
+
|
|
128
|
+
Each list starts with exactly one placeholder entry showing the expected
|
|
129
|
+
object shape, and its own `description` states how many entries the array
|
|
130
|
+
actually needs — read that placeholder's text before replacing it, since the
|
|
131
|
+
count is stricter than it looks:
|
|
132
|
+
|
|
133
|
+
- **`test_cases`** — needs **at least 3 and up to 5** entries (the published
|
|
134
|
+
`chatgpt-app-submission.v1.json` schema's `minItems: 3` and `maxItems: 5` ).
|
|
135
|
+
Prompts a real user might give that *should* result in one or more of this
|
|
136
|
+
app's tools being called, with a plausible expected result. Prefer prompts
|
|
137
|
+
that exercise different tools, not five variations of the same one.
|
|
138
|
+
- **`negative_test_cases`** — needs **exactly 3** entries. The published
|
|
139
|
+
schema only declares `minItems: 3` (no maximum), but OpenAI's actual
|
|
140
|
+
submission form has been observed rejecting a count other than exactly 3
|
|
141
|
+
— the live form is stricter than the published schema here, so don't rely
|
|
142
|
+
on the schema alone. Prompts that *should not* trigger a tool call:
|
|
143
|
+
out-of-scope requests, ambiguous ones, or ones this app's tools genuinely
|
|
144
|
+
can't help with. These matter as much as the positive cases — they're what
|
|
145
|
+
catches an app that's too eager to claim every request. If you already
|
|
146
|
+
have more than 3 good negative cases, keep the 3 most distinct/valuable
|
|
147
|
+
ones rather than all of them.
|
|
148
|
+
|
|
149
|
+
Keep `file_attachment_urls`/`tools_triggered` accurate to what a real
|
|
150
|
+
interaction would look like (empty arrays are fine when nothing applies)
|
|
151
|
+
rather than filling them in just to look complete.
|
|
152
|
+
|
|
153
|
+
## Known gotchas: the live form can be stricter than the published schema
|
|
154
|
+
|
|
155
|
+
OpenAI's real submission form has been observed enforcing rules the
|
|
156
|
+
published `chatgpt-app-submission.v1.json` JSON Schema doesn't state:
|
|
157
|
+
|
|
158
|
+
- **`$schema`** must be exactly
|
|
159
|
+
`https://developers.openai.com/apps-sdk/schemas/chatgpt-app-submission.v1.json`.
|
|
160
|
+
That URL currently redirects to `/plugins/schemas/chatgpt-app-submission.v1.json`
|
|
161
|
+
and serves the identical schema content — whose own `$id` field still says
|
|
162
|
+
`/plugins/schemas/...` — but the form rejects a document that declares the
|
|
163
|
+
`/plugins/schemas/` path directly. HAPI's dump already uses the correct
|
|
164
|
+
`apps-sdk` path; don't "fix" it back to match the schema's `$id`.
|
|
165
|
+
- **`negative_test_cases`** must have **exactly 3** entries, not just the
|
|
166
|
+
schema's stated `minItems: 3`.
|
|
167
|
+
|
|
168
|
+
HAPI's placeholders reflect this as of when they were written, but the live
|
|
169
|
+
form can change independently of the published schema. If something in this
|
|
170
|
+
skill's guidance and the actual submission form disagree, trust the form and
|
|
171
|
+
flag the mismatch back (e.g. as a note in your output, or to whoever's
|
|
172
|
+
reviewing) rather than silently picking one.
|
|
173
|
+
|
|
174
|
+
## Output
|
|
175
|
+
|
|
176
|
+
Write the completed document back in the same shape (JSON stays JSON, YAML
|
|
177
|
+
stays YAML) — don't change the schema or field order. If you were invoked in
|
|
178
|
+
a pipe (e.g. `hapi serve --dry-run --output json | claude -p '/hapi-apps-dump
|
|
179
|
+
...'`), print the completed document to stdout. If you were handed a saved
|
|
180
|
+
file, write the result back to that file (or to `chatgpt-app-submission.json`
|
|
181
|
+
in the project root if none was given) and say where you put it.
|
|
182
|
+
|
|
183
|
+
## Before you finish
|
|
184
|
+
|
|
185
|
+
Search the output for the literal string `PLACEHOLDER`. If it's still
|
|
186
|
+
present anywhere, you're not done — go back and fill in what's left rather
|
|
187
|
+
than leaving a partial result.
|
package/package.json
CHANGED
|
@@ -1,8 +1,19 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mcp-com-ai/hapi",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.1.0",
|
|
4
4
|
"description": "HAPI CLI — the core executable. Thin shell that discovers first-party and third-party plugins, routes commands, and provides a consistent UX across the HAPI stack.",
|
|
5
5
|
"license": "LRL-CL",
|
|
6
|
+
"repository": {
|
|
7
|
+
"type": "git",
|
|
8
|
+
"url": "https://github.com/mcp-com-ai/hapimcp"
|
|
9
|
+
},
|
|
10
|
+
"homepage": "https://hapi.mcp.com.ai",
|
|
11
|
+
"bugs": {
|
|
12
|
+
"url": "https://github.com/mcp-com-ai/hapimcp"
|
|
13
|
+
},
|
|
14
|
+
"sponsor": {
|
|
15
|
+
"url": "https://go.rebelion.la/sponsors"
|
|
16
|
+
},
|
|
6
17
|
"type": "module",
|
|
7
18
|
"bin": {
|
|
8
19
|
"hapi": "./dist/bin.js"
|
|
@@ -30,19 +41,19 @@
|
|
|
30
41
|
"dev": "bun --watch src/bin.ts",
|
|
31
42
|
"typecheck": "bunx tsc --noEmit",
|
|
32
43
|
"test": "bun test",
|
|
33
|
-
"build": "bun ../../scripts/build-package.ts ."
|
|
44
|
+
"build": "bun ../../scripts/build-package.ts . && bun ../../scripts/copy-cli-skills.ts"
|
|
34
45
|
},
|
|
35
46
|
"dependencies": {
|
|
36
|
-
"@mcp-com-ai/plugin-sdk": "^1.
|
|
37
|
-
"@mcp-com-ai/shared-utils": "^1.
|
|
47
|
+
"@mcp-com-ai/plugin-sdk": "^1.1.0",
|
|
48
|
+
"@mcp-com-ai/shared-utils": "^1.1.0",
|
|
38
49
|
"yaml": "^2.8.2"
|
|
39
50
|
},
|
|
40
51
|
"//optionalDependencies": "Workspace plugins are listed as optional so monorepo dev/test resolves them via Bun workspaces. End users installing @hapi/cli globally won't pay for these — they install only the plugins they need.",
|
|
41
52
|
"optionalDependencies": {
|
|
42
|
-
"@mcp-com-ai/plugin-openapi": "^1.
|
|
43
|
-
"@mcp-com-ai/plugin-arazzo": "^1.
|
|
44
|
-
"@mcp-com-ai/plugin-cloudflare": "^1.
|
|
45
|
-
"@mcp-com-ai/plugin-otel": "^1.
|
|
53
|
+
"@mcp-com-ai/plugin-openapi": "^1.1.0",
|
|
54
|
+
"@mcp-com-ai/plugin-arazzo": "^1.1.0",
|
|
55
|
+
"@mcp-com-ai/plugin-cloudflare": "^1.1.0",
|
|
56
|
+
"@mcp-com-ai/plugin-otel": "^1.1.0"
|
|
46
57
|
},
|
|
47
58
|
"peerDependencies": {
|
|
48
59
|
"typescript": "^5"
|