noskills 4.5.2 → 5.0.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 +497 -18
- package/noskills.js +145 -1
- package/package.json +14 -1
- package/{chunks/ajan-bridge-BNPC757J.js → ts/chunks/ajan-bridge-6UUIUFAV.js} +1 -1
- package/ts/chunks/anthropic-ICVQ5GK6.js +1 -0
- package/ts/chunks/approve-R7MCYHCS.js +1 -0
- package/ts/chunks/ask-GBLFPNFX.js +2 -0
- package/ts/chunks/block-YEKLMXHR.js +1 -0
- package/ts/chunks/cancel-7NS4WM2N.js +1 -0
- package/ts/chunks/chunk-2CLD527I.js +1 -0
- package/ts/chunks/chunk-34AWV7DB.js +1 -0
- package/ts/chunks/chunk-3M26Y3NG.js +27 -0
- package/{chunks/chunk-J25XTDQQ.js → ts/chunks/chunk-3QVRJO3V.js} +1 -1
- package/ts/chunks/chunk-5ALJRBMW.js +22 -0
- package/ts/chunks/chunk-5NMDE2VZ.js +4 -0
- package/ts/chunks/chunk-6BKTY7SA.js +4 -0
- package/ts/chunks/chunk-6M7PCVUR.js +1 -0
- package/ts/chunks/chunk-6O2RXYTM.js +3 -0
- package/ts/chunks/chunk-7DIQYKPL.js +3 -0
- package/ts/chunks/chunk-7J6R2D2K.js +2 -0
- package/ts/chunks/chunk-AW3XJGEP.js +1 -0
- package/ts/chunks/chunk-BRC46A3N.js +39 -0
- package/ts/chunks/chunk-C5LYQDQH.js +368 -0
- package/ts/chunks/chunk-CCYWFSXR.js +3 -0
- package/{chunks/chunk-OAWYVETM.js → ts/chunks/chunk-CL55MNGD.js} +1 -1
- package/ts/chunks/chunk-CSP2GUD4.js +29 -0
- package/{chunks/chunk-EROZRDGT.js → ts/chunks/chunk-D2UKX2VW.js} +1 -1
- package/ts/chunks/chunk-DGYDUGTM.js +1 -0
- package/ts/chunks/chunk-FB3Z7XYQ.js +1 -0
- package/ts/chunks/chunk-FLLYK5FU.js +1 -0
- package/{chunks/chunk-EJYSOUEA.js → ts/chunks/chunk-GCPGG4YB.js} +1 -1
- package/{chunks/chunk-FYFUEK4U.js → ts/chunks/chunk-HLDPASM6.js} +1 -1
- package/ts/chunks/chunk-HNQA5O2S.js +2 -0
- package/ts/chunks/chunk-HUP7XWW6.js +1 -0
- package/ts/chunks/chunk-J3XNDEMU.js +4 -0
- package/ts/chunks/chunk-K6FVY52W.js +5 -0
- package/ts/chunks/chunk-KQJGXVWX.js +91 -0
- package/ts/chunks/chunk-M4U4Y3XQ.js +7 -0
- package/ts/chunks/chunk-M6CAJL36.js +1 -0
- package/ts/chunks/chunk-MPHTBN7E.js +1 -0
- package/ts/chunks/chunk-NYIFCLEG.js +1 -0
- package/ts/chunks/chunk-RRDWQKZY.js +1 -0
- package/ts/chunks/chunk-RVNSKPFL.js +1 -0
- package/ts/chunks/chunk-S5F2DAAG.js +5 -0
- package/ts/chunks/chunk-SCYP2G2T.js +3 -0
- package/ts/chunks/chunk-SWP6BJR6.js +147 -0
- package/{chunks/chunk-XDRX4ZBJ.js → ts/chunks/chunk-SWRVSRYY.js} +1 -1
- package/ts/chunks/chunk-T2X4E35X.js +1 -0
- package/ts/chunks/chunk-TDLTCTV4.js +1 -0
- package/ts/chunks/chunk-TKBGNLNV.js +1 -0
- package/ts/chunks/chunk-UY4YFVSW.js +3 -0
- package/ts/chunks/chunk-V5ZXCJPI.js +2 -0
- package/ts/chunks/chunk-W46BJM2F.js +1 -0
- package/ts/chunks/chunk-W7KQFMHV.js +1 -0
- package/ts/chunks/chunk-XGRZPTAD.js +24 -0
- package/ts/chunks/chunk-XTQFSF6C.js +1 -0
- package/ts/chunks/chunk-YN3SHWBR.js +1 -0
- package/ts/chunks/chunk-ZAY6LSJD.js +2 -0
- package/ts/chunks/chunk-ZGVXR3EC.js +8 -0
- package/ts/chunks/chunk-ZW5C5IGT.js +32 -0
- package/ts/chunks/claude-code-J2V5WSGZ.js +1 -0
- package/ts/chunks/concern-EDWQHU4H.js +1 -0
- package/ts/chunks/config-E7BDBHPK.js +1 -0
- package/ts/chunks/decision-ledger-5QXKZSV2.js +1 -0
- package/ts/chunks/delegate-LVQQ3GCV.js +1 -0
- package/ts/chunks/diagrams-2F5ZYXA7.js +1 -0
- package/ts/chunks/diagrams-H62JGTIS.js +1 -0
- package/ts/chunks/done-U3TOSZIX.js +1 -0
- package/ts/chunks/followup-J2HJU3ZT.js +1 -0
- package/ts/chunks/free-73WMLMCT.js +1 -0
- package/ts/chunks/gemini-GA6P4M7D.js +1 -0
- package/ts/chunks/init-6CVDGRY2.js +1 -0
- package/ts/chunks/invoke-hook-2TMKWL7I.js +15 -0
- package/ts/chunks/kiro-BJSKSAUC.js +1 -0
- package/ts/chunks/learn-7Q2VWZMI.js +7 -0
- package/ts/chunks/ledger-XR4AHZRX.js +2 -0
- package/ts/chunks/list-CUQCPXZH.js +1 -0
- package/ts/chunks/manager-WTLJ5C2I.js +3 -0
- package/ts/chunks/mod-BZA5TFW7.js +1 -0
- package/ts/chunks/mod-RWA5ZPYH.js +1 -0
- package/ts/chunks/mod-X372UNSQ.js +1 -0
- package/ts/chunks/mod-XVE4ZWPY.js +1 -0
- package/ts/chunks/next-CEYZSYGB.js +20 -0
- package/ts/chunks/node-33JV5VS3.js +15 -0
- package/ts/chunks/node-XYP2DQHR.js +74 -0
- package/{chunks/node-2XIHQ2M4.js → ts/chunks/node-ZSGIX7K3.js} +1 -1
- package/ts/chunks/ollama-X6OGN5BW.js +1 -0
- package/ts/chunks/openai-TV7KLQ2C.js +1 -0
- package/ts/chunks/openai-YPM2E7QS.js +30 -0
- package/ts/chunks/opencode-AK6WWZRF.js +1 -0
- package/ts/chunks/pack-EOUSZGJT.js +5 -0
- package/ts/chunks/plan-export-ZBINRAAS.js +3 -0
- package/ts/chunks/purge-GPMC5A6Y.js +5 -0
- package/ts/chunks/reopen-LPVNZN5I.js +1 -0
- package/ts/chunks/reset-RNLPXGWQ.js +1 -0
- package/ts/chunks/review-ZGAY5XCN.js +1 -0
- package/ts/chunks/rule-SNBQ4VZD.js +6 -0
- package/ts/chunks/run-4TDP4C7Z.js +3 -0
- package/ts/chunks/sdk-MEVPL5WT.js +1 -0
- package/ts/chunks/session-J7TSLNEH.js +1 -0
- package/ts/chunks/spec-3NSPFDIC.js +1 -0
- package/ts/chunks/status-DIEA2OGR.js +1 -0
- package/ts/chunks/sync-HZNKILSP.js +1 -0
- package/ts/chunks/validate-MWHDOF2F.js +1 -0
- package/ts/chunks/vertexai-ARXI4AMJ.js +1 -0
- package/ts/chunks/watch-P6HABMAS.js +7 -0
- package/ts/chunks/web-BMIC3VJQ.js +1 -0
- package/ts/chunks/wontfix-6UKEYTVB.js +1 -0
- package/ts/noskills.js +2 -0
- package/chunks/anthropic-ZKOMTKX2.js +0 -1
- package/chunks/approve-3TKOHYHH.js +0 -1
- package/chunks/ask-UB26SBWQ.js +0 -2
- package/chunks/block-Q4WAIX7X.js +0 -1
- package/chunks/browser-BGFD24RX.js +0 -1
- package/chunks/bun-WZ7BVR7Y.js +0 -1
- package/chunks/cancel-DY76ADX4.js +0 -1
- package/chunks/chunk-34RPTI4K.js +0 -29
- package/chunks/chunk-3JTDWOAJ.js +0 -2
- package/chunks/chunk-5FX4EBFY.js +0 -5
- package/chunks/chunk-5RLCKUIF.js +0 -2
- package/chunks/chunk-7PBHRFOZ.js +0 -3
- package/chunks/chunk-7PPUGTKL.js +0 -4
- package/chunks/chunk-AB3N327V.js +0 -1
- package/chunks/chunk-AUZWXMWA.js +0 -27
- package/chunks/chunk-BYPCI5VU.js +0 -1
- package/chunks/chunk-CH6A3LES.js +0 -91
- package/chunks/chunk-CKIZYL4O.js +0 -3
- package/chunks/chunk-CTTMQSHF.js +0 -1
- package/chunks/chunk-DEHRWREM.js +0 -1
- package/chunks/chunk-DYCGJ4RY.js +0 -4
- package/chunks/chunk-ENP4P2YH.js +0 -0
- package/chunks/chunk-EVJYA7S3.js +0 -21
- package/chunks/chunk-FE4MKOI4.js +0 -1
- package/chunks/chunk-GNMOE7H3.js +0 -48
- package/chunks/chunk-HB62UGZI.js +0 -2
- package/chunks/chunk-IFE5SYGK.js +0 -1
- package/chunks/chunk-IM73MYMS.js +0 -1
- package/chunks/chunk-JYVB6UAV.js +0 -1
- package/chunks/chunk-KJLEPI7T.js +0 -1
- package/chunks/chunk-KRRPOVQG.js +0 -1
- package/chunks/chunk-LGQEWL5X.js +0 -1
- package/chunks/chunk-LJEWPIEI.js +0 -1
- package/chunks/chunk-LKZZ4JN5.js +0 -110
- package/chunks/chunk-NGCBWJML.js +0 -2
- package/chunks/chunk-NPWXEWRN.js +0 -4
- package/chunks/chunk-O4KKKYCH.js +0 -1
- package/chunks/chunk-ONJVI5AZ.js +0 -23
- package/chunks/chunk-OP4XAIGW.js +0 -1
- package/chunks/chunk-PSX63TYP.js +0 -2
- package/chunks/chunk-Q4TI7EYT.js +0 -5
- package/chunks/chunk-SLO22P65.js +0 -1
- package/chunks/chunk-T6NZVA6P.js +0 -7
- package/chunks/chunk-TCSIXKUD.js +0 -3
- package/chunks/chunk-VJRCTYGL.js +0 -1
- package/chunks/chunk-VXU6XZ66.js +0 -39
- package/chunks/chunk-WDKWHGJU.js +0 -146
- package/chunks/chunk-XDPATEP5.js +0 -1
- package/chunks/chunk-Y45DQJSS.js +0 -3
- package/chunks/chunk-Y5E7ZCCX.js +0 -1
- package/chunks/chunk-YUTDPPXX.js +0 -1
- package/chunks/chunk-Z7OYXH3J.js +0 -1
- package/chunks/claude-code-OQJIUKZP.js +0 -1
- package/chunks/cmd-46ZIHXLB.js +0 -1
- package/chunks/concern-UIGVWDFS.js +0 -1
- package/chunks/config-72Z4PIJN.js +0 -1
- package/chunks/decision-ledger-5IPPTRT7.js +0 -1
- package/chunks/delegate-OV6NY434.js +0 -1
- package/chunks/deno-YM5PW6ZM.js +0 -1
- package/chunks/diagrams-CBCUA47B.js +0 -1
- package/chunks/diagrams-OX4FBDGP.js +0 -1
- package/chunks/done-V54GSSTY.js +0 -1
- package/chunks/followup-NL7EPIGF.js +0 -1
- package/chunks/free-KD344KRL.js +0 -1
- package/chunks/gemini-23EOEXSF.js +0 -1
- package/chunks/init-WDRNFT57.js +0 -1
- package/chunks/invoke-hook-I3NTD36Q.js +0 -13
- package/chunks/kiro-TPAAIMY6.js +0 -1
- package/chunks/learn-WBWNJEB2.js +0 -7
- package/chunks/ledger-QYK252DV.js +0 -1
- package/chunks/list-WO6RS7JX.js +0 -1
- package/chunks/loader-command-3A5FK2RF.js +0 -1
- package/chunks/loader-reactor-YZM7HO4G.js +0 -1
- package/chunks/manager-ZSPRC5R4.js +0 -3
- package/chunks/mod-7VTKN6Q5.js +0 -1
- package/chunks/mod-B6LBGYON.js +0 -1
- package/chunks/mod-MMHDQRNF.js +0 -1
- package/chunks/mod-RBGAMGZA.js +0 -1
- package/chunks/mod-SFSUQWSB.js +0 -8
- package/chunks/mod-SV4VELMH.js +0 -1
- package/chunks/next-QXCLZ7P3.js +0 -15
- package/chunks/node-BXYZKSJY.js +0 -15
- package/chunks/node-DMUOWFGA.js +0 -69
- package/chunks/node-J4GTOSL2.js +0 -1
- package/chunks/ollama-MXRDGQDF.js +0 -1
- package/chunks/openai-LE47IWMQ.js +0 -30
- package/chunks/openai-MSJF4B6H.js +0 -1
- package/chunks/opencode-ZDHKR2P6.js +0 -1
- package/chunks/pack-NS64WU6M.js +0 -5
- package/chunks/plan-export-HECAF7D4.js +0 -3
- package/chunks/purge-PSQNN42H.js +0 -4
- package/chunks/reopen-L37M5XUI.js +0 -1
- package/chunks/reset-OOTZXW6Q.js +0 -1
- package/chunks/review-QLD6WSOB.js +0 -1
- package/chunks/rule-OOANQBHB.js +0 -6
- package/chunks/run-YHCIRY7Z.js +0 -3
- package/chunks/sdk-OQIHH3OY.js +0 -1
- package/chunks/session-OWWDH7KA.js +0 -1
- package/chunks/spec-O7F525UN.js +0 -1
- package/chunks/status-SZZXY7V3.js +0 -1
- package/chunks/sync-3RYRGTEA.js +0 -1
- package/chunks/unstable_chmod-44MCKF3B.js +0 -1
- package/chunks/validate-UZD6JBSG.js +0 -1
- package/chunks/vertexai-CVCRCO24.js +0 -1
- package/chunks/watch-5DNM646U.js +0 -8
- package/chunks/web-662LNB3K.js +0 -1
- package/chunks/wontfix-UDCTLHNB.js +0 -1
- package/chunks/workerd-I7MLRCLJ.js +0 -1
- /package/{chunks/chunk-5OTECUN7.js → ts/chunks/chunk-ATNTR7M5.js} +0 -0
- /package/{chunks → ts/chunks}/chunk-HISXAZ4Y.js +0 -0
- /package/{chunks → ts/chunks}/chunk-I4Z2RF7L.js +0 -0
- /package/{chunks → ts/chunks}/dist-3MH5UCQU.js +0 -0
- /package/{chunks → ts/chunks}/multipart-parser-DKDFOZKD.js +0 -0
- /package/{chunks → ts/chunks}/src-HXQVVTGQ.js +0 -0
|
@@ -0,0 +1,147 @@
|
|
|
1
|
+
import{C as E,b as zn}from"./chunk-M4U4Y3XQ.js";import{a as rt,c as y,e as sa}from"./chunk-HISXAZ4Y.js";var C=y($=>{"use strict";var fs=Symbol.for("yaml.alias"),Zn=Symbol.for("yaml.document"),at=Symbol.for("yaml.map"),ei=Symbol.for("yaml.pair"),ds=Symbol.for("yaml.scalar"),lt=Symbol.for("yaml.seq"),U=Symbol.for("yaml.node.type"),ra=s=>!!s&&typeof s=="object"&&s[U]===fs,oa=s=>!!s&&typeof s=="object"&&s[U]===Zn,aa=s=>!!s&&typeof s=="object"&&s[U]===at,la=s=>!!s&&typeof s=="object"&&s[U]===ei,ti=s=>!!s&&typeof s=="object"&&s[U]===ds,ca=s=>!!s&&typeof s=="object"&&s[U]===lt;function si(s){if(s&&typeof s=="object")switch(s[U]){case at:case lt:return!0}return!1}function ua(s){if(s&&typeof s=="object")switch(s[U]){case fs:case at:case ds:case lt:return!0}return!1}var fa=s=>(ti(s)||si(s))&&!!s.anchor;$.ALIAS=fs;$.DOC=Zn;$.MAP=at;$.NODE_TYPE=U;$.PAIR=ei;$.SCALAR=ds;$.SEQ=lt;$.hasAnchor=fa;$.isAlias=ra;$.isCollection=si;$.isDocument=oa;$.isMap=aa;$.isNode=ua;$.isPair=la;$.isScalar=ti;$.isSeq=ca});var Ee=y(hs=>{"use strict";var L=C(),D=Symbol("break visit"),ni=Symbol("skip children"),j=Symbol("remove node");function ct(s,e){let t=ii(e);L.isDocument(s)?pe(null,s.contents,t,Object.freeze([s]))===j&&(s.contents=null):pe(null,s,t,Object.freeze([]))}ct.BREAK=D;ct.SKIP=ni;ct.REMOVE=j;function pe(s,e,t,n){let i=ri(s,e,t,n);if(L.isNode(i)||L.isPair(i))return oi(s,n,i),pe(s,i,t,n);if(typeof i!="symbol"){if(L.isCollection(e)){n=Object.freeze(n.concat(e));for(let r=0;r<e.items.length;++r){let o=pe(r,e.items[r],t,n);if(typeof o=="number")r=o-1;else{if(o===D)return D;o===j&&(e.items.splice(r,1),r-=1)}}}else if(L.isPair(e)){n=Object.freeze(n.concat(e));let r=pe("key",e.key,t,n);if(r===D)return D;r===j&&(e.key=null);let o=pe("value",e.value,t,n);if(o===D)return D;o===j&&(e.value=null)}}return i}async function ut(s,e){let t=ii(e);L.isDocument(s)?await me(null,s.contents,t,Object.freeze([s]))===j&&(s.contents=null):await me(null,s,t,Object.freeze([]))}ut.BREAK=D;ut.SKIP=ni;ut.REMOVE=j;async function me(s,e,t,n){let i=await ri(s,e,t,n);if(L.isNode(i)||L.isPair(i))return oi(s,n,i),me(s,i,t,n);if(typeof i!="symbol"){if(L.isCollection(e)){n=Object.freeze(n.concat(e));for(let r=0;r<e.items.length;++r){let o=await me(r,e.items[r],t,n);if(typeof o=="number")r=o-1;else{if(o===D)return D;o===j&&(e.items.splice(r,1),r-=1)}}}else if(L.isPair(e)){n=Object.freeze(n.concat(e));let r=await me("key",e.key,t,n);if(r===D)return D;r===j&&(e.key=null);let o=await me("value",e.value,t,n);if(o===D)return D;o===j&&(e.value=null)}}return i}function ii(s){return typeof s=="object"&&(s.Collection||s.Node||s.Value)?Object.assign({Alias:s.Node,Map:s.Node,Scalar:s.Node,Seq:s.Node},s.Value&&{Map:s.Value,Scalar:s.Value,Seq:s.Value},s.Collection&&{Map:s.Collection,Seq:s.Collection},s):s}function ri(s,e,t,n){if(typeof t=="function")return t(s,e,n);if(L.isMap(e))return t.Map?.(s,e,n);if(L.isSeq(e))return t.Seq?.(s,e,n);if(L.isPair(e))return t.Pair?.(s,e,n);if(L.isScalar(e))return t.Scalar?.(s,e,n);if(L.isAlias(e))return t.Alias?.(s,e,n)}function oi(s,e,t){let n=e[e.length-1];if(L.isCollection(n))n.items[s]=t;else if(L.isPair(n))s==="key"?n.key=t:n.value=t;else if(L.isDocument(n))n.contents=t;else{let i=L.isAlias(n)?"alias":"scalar";throw new Error(`Cannot replace node with ${i} parent`)}}hs.visit=ct;hs.visitAsync=ut});var ps=y(li=>{"use strict";var ai=C(),da=Ee(),ha={"!":"%21",",":"%2C","[":"%5B","]":"%5D","{":"%7B","}":"%7D"},pa=s=>s.replace(/[!,[\]{}]/g,e=>ha[e]),Ce=class s{constructor(e,t){this.docStart=null,this.docEnd=!1,this.yaml=Object.assign({},s.defaultYaml,e),this.tags=Object.assign({},s.defaultTags,t)}clone(){let e=new s(this.yaml,this.tags);return e.docStart=this.docStart,e}atDocument(){let e=new s(this.yaml,this.tags);switch(this.yaml.version){case"1.1":this.atNextDocument=!0;break;case"1.2":this.atNextDocument=!1,this.yaml={explicit:s.defaultYaml.explicit,version:"1.2"},this.tags=Object.assign({},s.defaultTags);break}return e}add(e,t){this.atNextDocument&&(this.yaml={explicit:s.defaultYaml.explicit,version:"1.1"},this.tags=Object.assign({},s.defaultTags),this.atNextDocument=!1);let n=e.trim().split(/[ \t]+/),i=n.shift();switch(i){case"%TAG":{if(n.length!==2&&(t(0,"%TAG directive should contain exactly two parts"),n.length<2))return!1;let[r,o]=n;return this.tags[r]=o,!0}case"%YAML":{if(this.yaml.explicit=!0,n.length!==1)return t(0,"%YAML directive should contain exactly one part"),!1;let[r]=n;if(r==="1.1"||r==="1.2")return this.yaml.version=r,!0;{let o=/^\d+\.\d+$/.test(r);return t(6,`Unsupported YAML version ${r}`,o),!1}}default:return t(0,`Unknown directive ${i}`,!0),!1}}tagName(e,t){if(e==="!")return"!";if(e[0]!=="!")return t(`Not a valid tag: ${e}`),null;if(e[1]==="<"){let o=e.slice(2,-1);return o==="!"||o==="!!"?(t(`Verbatim tags aren't resolved, so ${e} is invalid.`),null):(e[e.length-1]!==">"&&t("Verbatim tags must end with a >"),o)}let[,n,i]=e.match(/^(.*!)([^!]*)$/s);i||t(`The ${e} tag has no suffix`);let r=this.tags[n];if(r)try{return r+decodeURIComponent(i)}catch(o){return t(String(o)),null}return n==="!"?e:(t(`Could not resolve tag: ${e}`),null)}tagString(e){for(let[t,n]of Object.entries(this.tags))if(e.startsWith(n))return t+pa(e.substring(n.length));return e[0]==="!"?e:`!<${e}>`}toString(e){let t=this.yaml.explicit?[`%YAML ${this.yaml.version||"1.2"}`]:[],n=Object.entries(this.tags),i;if(e&&n.length>0&&ai.isNode(e.contents)){let r={};da.visit(e.contents,(o,a)=>{ai.isNode(a)&&a.tag&&(r[a.tag]=!0)}),i=Object.keys(r)}else i=[];for(let[r,o]of n)r==="!!"&&o==="tag:yaml.org,2002:"||(!e||i.some(a=>a.startsWith(o)))&&t.push(`%TAG ${r} ${o}`);return t.join(`
|
|
2
|
+
`)}};Ce.defaultYaml={explicit:!1,version:"1.2"};Ce.defaultTags={"!!":"tag:yaml.org,2002:"};li.Directives=Ce});var ft=y(Oe=>{"use strict";var ci=C(),ma=Ee();function ya(s){if(/[\x00-\x19\s,[\]{}]/.test(s)){let t=`Anchor must not contain whitespace or control characters: ${JSON.stringify(s)}`;throw new Error(t)}return!0}function ui(s){let e=new Set;return ma.visit(s,{Value(t,n){n.anchor&&e.add(n.anchor)}}),e}function fi(s,e){for(let t=1;;++t){let n=`${s}${t}`;if(!e.has(n))return n}}function ga(s,e){let t=[],n=new Map,i=null;return{onAnchor:r=>{t.push(r),i??(i=ui(s));let o=fi(e,i);return i.add(o),o},setAnchors:()=>{for(let r of t){let o=n.get(r);if(typeof o=="object"&&o.anchor&&(ci.isScalar(o.node)||ci.isCollection(o.node)))o.node.anchor=o.anchor;else{let a=new Error("Failed to resolve repeated object (this should not happen)");throw a.source=r,a}}},sourceObjects:n}}Oe.anchorIsValid=ya;Oe.anchorNames=ui;Oe.createNodeAnchors=ga;Oe.findNewAnchor=fi});var ms=y(di=>{"use strict";function qe(s,e,t,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=qe(s,n,String(i),o);a===void 0?delete n[i]:a!==o&&(n[i]=a)}else if(n instanceof Map)for(let i of Array.from(n.keys())){let r=n.get(i),o=qe(s,n,i,r);o===void 0?n.delete(i):o!==r&&n.set(i,o)}else if(n instanceof Set)for(let i of Array.from(n)){let r=qe(s,n,i,i);r===void 0?n.delete(i):r!==i&&(n.delete(i),n.add(r))}else for(let[i,r]of Object.entries(n)){let o=qe(s,n,i,r);o===void 0?delete n[i]:o!==r&&(n[i]=o)}return s.call(e,t,n)}di.applyReviver=qe});var G=y(pi=>{"use strict";var Sa=C();function hi(s,e,t){if(Array.isArray(s))return s.map((n,i)=>hi(n,String(i),t));if(s&&typeof s.toJSON=="function"){if(!t||!Sa.hasAnchor(s))return s.toJSON(e,t);let n={aliasCount:0,count:1,res:void 0};t.anchors.set(s,n),t.onCreate=r=>{n.res=r,delete t.onCreate};let i=s.toJSON(e,t);return t.onCreate&&t.onCreate(i),i}return typeof s=="bigint"&&!t?.keep?Number(s):s}pi.toJS=hi});var dt=y(yi=>{"use strict";var ba=ms(),mi=C(),wa=G(),ys=class{constructor(e){Object.defineProperty(this,mi.NODE_TYPE,{value:e})}clone(){let e=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return this.range&&(e.range=this.range.slice()),e}toJS(e,{mapAsMap:t,maxAliasCount:n,onAnchor:i,reviver:r}={}){if(!mi.isDocument(e))throw new TypeError("A document argument is required");let o={anchors:new Map,doc:e,keep:!0,mapAsMap:t===!0,mapKeyWarned:!1,maxAliasCount:typeof n=="number"?n:100},a=wa.toJS(this,"",o);if(typeof i=="function")for(let{count:l,res:c}of o.anchors.values())i(c,l);return typeof r=="function"?ba.applyReviver(r,{"":a},"",a):a}};yi.NodeBase=ys});var Te=y(gi=>{"use strict";var va=ft(),ka=Ee(),ye=C(),Aa=dt(),Na=G(),gs=class extends Aa.NodeBase{constructor(e){super(ye.ALIAS),this.source=e,Object.defineProperty(this,"tag",{set(){throw new Error("Alias nodes cannot have tags")}})}resolve(e,t){if(t?.maxAliasCount===0)throw new ReferenceError("Alias resolution is disabled");let n;t?.aliasResolveCache?n=t.aliasResolveCache:(n=[],ka.visit(e,{Node:(r,o)=>{(ye.isAlias(o)||ye.hasAnchor(o))&&n.push(o)}}),t&&(t.aliasResolveCache=n));let i;for(let r of n){if(r===this)break;r.anchor===this.source&&(i=r)}if(i&&t){let{anchors:r,doc:o,maxAliasCount:a}=t,l=r.get(i);if(l||(Na.toJS(i,null,t),l=r.get(i)),l?.res===void 0){let c="This should not happen: Alias anchor was not resolved?";throw new ReferenceError(c)}if(a>=0&&(l.count+=1,l.aliasCount===0&&(l.aliasCount=ht(o,i,r)),l.count*l.aliasCount>a)){let c="Excessive alias count indicates a resource exhaustion attack";throw new ReferenceError(c)}}return i}toJSON(e,t){if(!t)return{source:this.source};let n=this.resolve(t.doc,t);if(!n){let i=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new ReferenceError(i)}return t.anchors.get(n).res}toString(e,t,n){let i=`*${this.source}`;if(e){if(va.anchorIsValid(this.source),e.options.verifyAliasOrder&&!e.anchors.has(this.source)){let r=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new Error(r)}if(e.implicitKey)return`${i} `}return i}};function ht(s,e,t){if(ye.isAlias(e)){let n=e.resolve(s),i=t&&n&&t.get(n);return i?i.count*i.aliasCount:0}else if(ye.isCollection(e)){let n=0;for(let i of e.items){let r=ht(s,i,t);r>n&&(n=r)}return n}else if(ye.isPair(e)){let n=ht(s,e.key,t),i=ht(s,e.value,t);return Math.max(n,i)}return 1}gi.Alias=gs});var T=y(Ss=>{"use strict";var Ea=C(),Ca=dt(),Oa=G(),qa=s=>!s||typeof s!="function"&&typeof s!="object",H=class extends Ca.NodeBase{constructor(e){super(Ea.SCALAR),this.value=e}toJSON(e,t){return t?.keep?this.value:Oa.toJS(this.value,e,t)}toString(){return String(this.value)}};H.BLOCK_FOLDED="BLOCK_FOLDED";H.BLOCK_LITERAL="BLOCK_LITERAL";H.PLAIN="PLAIN";H.QUOTE_DOUBLE="QUOTE_DOUBLE";H.QUOTE_SINGLE="QUOTE_SINGLE";Ss.Scalar=H;Ss.isScalarValue=qa});var Ie=y(bi=>{"use strict";var Ta=Te(),re=C(),Si=T(),Ia="tag:yaml.org,2002:";function Pa(s,e,t){if(e){let n=t.filter(r=>r.tag===e),i=n.find(r=>!r.format)??n[0];if(!i)throw new Error(`Tag ${e} not found`);return i}return t.find(n=>n.identify?.(s)&&!n.format)}function La(s,e,t){if(re.isDocument(s)&&(s=s.contents),re.isNode(s))return s;if(re.isPair(s)){let f=t.schema[re.MAP].createNode?.(t.schema,null,t);return f.items.push(s),f}(s instanceof String||s instanceof Number||s instanceof Boolean||typeof BigInt<"u"&&s instanceof BigInt)&&(s=s.valueOf());let{aliasDuplicateObjects:n,onAnchor:i,onTagObj:r,schema:o,sourceObjects:a}=t,l;if(n&&s&&typeof s=="object"){if(l=a.get(s),l)return l.anchor??(l.anchor=i(s)),new Ta.Alias(l.anchor);l={anchor:null,node:null},a.set(s,l)}e?.startsWith("!!")&&(e=Ia+e.slice(2));let c=Pa(s,e,o.tags);if(!c){if(s&&typeof s.toJSON=="function"&&(s=s.toJSON()),!s||typeof s!="object"){let f=new Si.Scalar(s);return l&&(l.node=f),f}c=s instanceof Map?o[re.MAP]:Symbol.iterator in Object(s)?o[re.SEQ]:o[re.MAP]}r&&(r(c),delete t.onTagObj);let h=c?.createNode?c.createNode(t.schema,s,t):typeof c?.nodeClass?.from=="function"?c.nodeClass.from(t.schema,s,t):new Si.Scalar(s);return e?h.tag=e:c.default||(h.tag=c.tag),l&&(l.node=h),h}bi.createNode=La});var mt=y(pt=>{"use strict";var $a=Ie(),K=C(),Da=dt();function bs(s,e,t){let n=t;for(let i=e.length-1;i>=0;--i){let r=e[i];if(typeof r=="number"&&Number.isInteger(r)&&r>=0){let o=[];o[r]=n,n=o}else n=new Map([[r,n]])}return $a.createNode(n,void 0,{aliasDuplicateObjects:!1,keepUndefined:!1,onAnchor:()=>{throw new Error("This should not happen, please report a bug.")},schema:s,sourceObjects:new Map})}var wi=s=>s==null||typeof s=="object"&&!!s[Symbol.iterator]().next().done,ws=class extends Da.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));return e&&(t.schema=e),t.items=t.items.map(n=>K.isNode(n)||K.isPair(n)?n.clone(e):n),this.range&&(t.range=this.range.slice()),t}addIn(e,t){if(wi(e))this.add(t);else{let[n,...i]=e,r=this.get(n,!0);if(K.isCollection(r))r.addIn(i,t);else if(r===void 0&&this.schema)this.set(n,bs(this.schema,i,t));else throw new Error(`Expected YAML collection at ${n}. Remaining path: ${i}`)}}deleteIn(e){let[t,...n]=e;if(n.length===0)return this.delete(t);let i=this.get(t,!0);if(K.isCollection(i))return i.deleteIn(n);throw new Error(`Expected YAML collection at ${t}. Remaining path: ${n}`)}getIn(e,t){let[n,...i]=e,r=this.get(n,!0);return i.length===0?!t&&K.isScalar(r)?r.value:r:K.isCollection(r)?r.getIn(i,t):void 0}hasAllNullValues(e){return this.items.every(t=>{if(!K.isPair(t))return!1;let n=t.value;return n==null||e&&K.isScalar(n)&&n.value==null&&!n.commentBefore&&!n.comment&&!n.tag})}hasIn(e){let[t,...n]=e;if(n.length===0)return this.has(t);let i=this.get(t,!0);return K.isCollection(i)?i.hasIn(n):!1}setIn(e,t){let[n,...i]=e;if(i.length===0)this.set(n,t);else{let r=this.get(n,!0);if(K.isCollection(r))r.setIn(i,t);else if(r===void 0&&this.schema)this.set(n,bs(this.schema,i,t));else throw new Error(`Expected YAML collection at ${n}. Remaining path: ${i}`)}}};pt.Collection=ws;pt.collectionFromPath=bs;pt.isEmptyPath=wi});var Pe=y(yt=>{"use strict";var Ma=s=>s.replace(/^(?!$)(?: $)?/gm,"#");function vs(s,e){return/^\n+$/.test(s)?s.substring(1):e?s.replace(/^(?! *$)/gm,e):s}var _a=(s,e,t)=>s.endsWith(`
|
|
3
|
+
`)?vs(t,e):t.includes(`
|
|
4
|
+
`)?`
|
|
5
|
+
`+vs(t,e):(s.endsWith(" ")?"":" ")+t;yt.indentComment=vs;yt.lineComment=_a;yt.stringifyComment=Ma});var ki=y(Le=>{"use strict";var Ra="flow",ks="block",gt="quoted";function Fa(s,e,t="flow",{indentAtStart:n,lineWidth:i=80,minContentWidth:r=20,onFold:o,onOverflow:a}={}){if(!i||i<0)return s;i<r&&(r=0);let l=Math.max(1+r,1+i-e.length);if(s.length<=l)return s;let c=[],h={},f=i-e.length;typeof n=="number"&&(n>i-Math.max(2,r)?c.push(0):f=i-n);let u,m,g=!1,d=-1,p=-1,b=-1;t===ks&&(d=vi(s,d,e.length),d!==-1&&(f=d+l));for(let v;v=s[d+=1];){if(t===gt&&v==="\\"){switch(p=d,s[d+1]){case"x":d+=3;break;case"u":d+=5;break;case"U":d+=9;break;default:d+=1}b=d}if(v===`
|
|
6
|
+
`)t===ks&&(d=vi(s,d,e.length)),f=d+e.length+l,u=void 0;else{if(v===" "&&m&&m!==" "&&m!==`
|
|
7
|
+
`&&m!==" "){let k=s[d+1];k&&k!==" "&&k!==`
|
|
8
|
+
`&&k!==" "&&(u=d)}if(d>=f)if(u)c.push(u),f=u+l,u=void 0;else if(t===gt){for(;m===" "||m===" ";)m=v,v=s[d+=1],g=!0;let k=d>b+1?d-2:p-1;if(h[k])return s;c.push(k),h[k]=!0,f=k+l,u=void 0}else g=!0}m=v}if(g&&a&&a(),c.length===0)return s;o&&o();let w=s.slice(0,c[0]);for(let v=0;v<c.length;++v){let k=c[v],A=c[v+1]||s.length;k===0?w=`
|
|
9
|
+
${e}${s.slice(0,A)}`:(t===gt&&h[k]&&(w+=`${s[k]}\\`),w+=`
|
|
10
|
+
${e}${s.slice(k+1,A)}`)}return w}function vi(s,e,t){let n=e,i=e+1,r=s[i];for(;r===" "||r===" ";)if(e<i+t)r=s[++e];else{do r=s[++e];while(r&&r!==`
|
|
11
|
+
`);n=e,i=e+1,r=s[i]}return n}Le.FOLD_BLOCK=ks;Le.FOLD_FLOW=Ra;Le.FOLD_QUOTED=gt;Le.foldFlowLines=Fa});var De=y(Ai=>{"use strict";var F=T(),Q=ki(),bt=(s,e)=>({indentAtStart:e?s.indent.length:s.indentAtStart,lineWidth:s.options.lineWidth,minContentWidth:s.options.minContentWidth}),wt=s=>/^(%|---|\.\.\.)/m.test(s);function xa(s,e,t){if(!e||e<0)return!1;let n=e-t,i=s.length;if(i<=n)return!1;for(let r=0,o=0;r<i;++r)if(s[r]===`
|
|
12
|
+
`){if(r-o>n)return!0;if(o=r+1,i-o<=n)return!1}return!0}function $e(s,e){let t=JSON.stringify(s);if(e.options.doubleQuotedAsJSON)return t;let{implicitKey:n}=e,i=e.options.doubleQuotedMinMultiLineLength,r=e.indent||(wt(s)?" ":""),o="",a=0;for(let l=0,c=t[l];c;c=t[++l])if(c===" "&&t[l+1]==="\\"&&t[l+2]==="n"&&(o+=t.slice(a,l)+"\\ ",l+=1,a=l,c="\\"),c==="\\")switch(t[l+1]){case"u":{o+=t.slice(a,l);let h=t.substr(l+2,4);switch(h){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:h.substr(0,2)==="00"?o+="\\x"+h.substr(2):o+=t.substr(l,6)}l+=5,a=l+1}break;case"n":if(n||t[l+2]==='"'||t.length<i)l+=1;else{for(o+=t.slice(a,l)+`
|
|
13
|
+
|
|
14
|
+
`;t[l+2]==="\\"&&t[l+3]==="n"&&t[l+4]!=='"';)o+=`
|
|
15
|
+
`,l+=2;o+=r,t[l+2]===" "&&(o+="\\"),l+=1,a=l+1}break;default:l+=1}return o=a?o+t.slice(a):t,n?o:Q.foldFlowLines(o,r,Q.FOLD_QUOTED,bt(e,!1))}function As(s,e){if(e.options.singleQuote===!1||e.implicitKey&&s.includes(`
|
|
16
|
+
`)||/[ \t]\n|\n[ \t]/.test(s))return $e(s,e);let t=e.indent||(wt(s)?" ":""),n="'"+s.replace(/'/g,"''").replace(/\n+/g,`$&
|
|
17
|
+
${t}`)+"'";return e.implicitKey?n:Q.foldFlowLines(n,t,Q.FOLD_FLOW,bt(e,!1))}function ge(s,e){let{singleQuote:t}=e.options,n;if(t===!1)n=$e;else{let i=s.includes('"'),r=s.includes("'");i&&!r?n=As:r&&!i?n=$e:n=t?As:$e}return n(s,e)}var Ns;try{Ns=new RegExp(`(^|(?<!
|
|
18
|
+
))
|
|
19
|
+
+(?!
|
|
20
|
+
|$)`,"g")}catch{Ns=/\n+(?!\n|$)/g}function St({comment:s,type:e,value:t},n,i,r){let{blockQuote:o,commentString:a,lineWidth:l}=n.options;if(!o||/\n[\t ]+$/.test(t))return ge(t,n);let c=n.indent||(n.forceBlockIndent||wt(t)?" ":""),h=o==="literal"?!0:o==="folded"||e===F.Scalar.BLOCK_FOLDED?!1:e===F.Scalar.BLOCK_LITERAL?!0:!xa(t,l,c.length);if(!t)return h?`|
|
|
21
|
+
`:`>
|
|
22
|
+
`;let f,u;for(u=t.length;u>0;--u){let A=t[u-1];if(A!==`
|
|
23
|
+
`&&A!==" "&&A!==" ")break}let m=t.substring(u),g=m.indexOf(`
|
|
24
|
+
`);g===-1?f="-":t===m||g!==m.length-1?(f="+",r&&r()):f="",m&&(t=t.slice(0,-m.length),m[m.length-1]===`
|
|
25
|
+
`&&(m=m.slice(0,-1)),m=m.replace(Ns,`$&${c}`));let d=!1,p,b=-1;for(p=0;p<t.length;++p){let A=t[p];if(A===" ")d=!0;else if(A===`
|
|
26
|
+
`)b=p;else break}let w=t.substring(0,b<p?b+1:p);w&&(t=t.substring(w.length),w=w.replace(/\n+/g,`$&${c}`));let k=(d?c?"2":"1":"")+f;if(s&&(k+=" "+a(s.replace(/ ?[\r\n]+/g," ")),i&&i()),!h){let A=t.replace(/\n+/g,`
|
|
27
|
+
$&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,"$1$2").replace(/\n+/g,`$&${c}`),N=!1,q=bt(n,!0);o!=="folded"&&e!==F.Scalar.BLOCK_FOLDED&&(q.onOverflow=()=>{N=!0});let S=Q.foldFlowLines(`${w}${A}${m}`,c,Q.FOLD_BLOCK,q);if(!N)return`>${k}
|
|
28
|
+
${c}${S}`}return t=t.replace(/\n+/g,`$&${c}`),`|${k}
|
|
29
|
+
${c}${w}${t}${m}`}function Ba(s,e,t,n){let{type:i,value:r}=s,{actualString:o,implicitKey:a,indent:l,indentStep:c,inFlow:h}=e;if(a&&r.includes(`
|
|
30
|
+
`)||h&&/[[\]{},]/.test(r))return ge(r,e);if(/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(r))return a||h||!r.includes(`
|
|
31
|
+
`)?ge(r,e):St(s,e,t,n);if(!a&&!h&&i!==F.Scalar.PLAIN&&r.includes(`
|
|
32
|
+
`))return St(s,e,t,n);if(wt(r)){if(l==="")return e.forceBlockIndent=!0,St(s,e,t,n);if(a&&l===c)return ge(r,e)}let f=r.replace(/\n+/g,`$&
|
|
33
|
+
${l}`);if(o){let u=d=>d.default&&d.tag!=="tag:yaml.org,2002:str"&&d.test?.test(f),{compat:m,tags:g}=e.doc.schema;if(g.some(u)||m?.some(u))return ge(r,e)}return a?f:Q.foldFlowLines(f,l,Q.FOLD_FLOW,bt(e,!1))}function ja(s,e,t,n){let{implicitKey:i,inFlow:r}=e,o=typeof s.value=="string"?s:Object.assign({},s,{value:String(s.value)}),{type:a}=s;a!==F.Scalar.QUOTE_DOUBLE&&/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(o.value)&&(a=F.Scalar.QUOTE_DOUBLE);let l=h=>{switch(h){case F.Scalar.BLOCK_FOLDED:case F.Scalar.BLOCK_LITERAL:return i||r?ge(o.value,e):St(o,e,t,n);case F.Scalar.QUOTE_DOUBLE:return $e(o.value,e);case F.Scalar.QUOTE_SINGLE:return As(o.value,e);case F.Scalar.PLAIN:return Ba(o,e,t,n);default:return null}},c=l(a);if(c===null){let{defaultKeyType:h,defaultStringType:f}=e.options,u=i&&h||f;if(c=l(u),c===null)throw new Error(`Unsupported default string type ${u}`)}return c}Ai.stringifyString=ja});var Me=y(Es=>{"use strict";var Ka=ft(),X=C(),Ua=Pe(),Ya=De();function Va(s,e){let t=Object.assign({blockQuote:!0,commentString:Ua.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},s.schema.toStringOptions,e),n;switch(t.collectionStyle){case"block":n=!1;break;case"flow":n=!0;break;default:n=null}return{anchors:new Set,doc:s,flowCollectionPadding:t.flowCollectionPadding?" ":"",indent:"",indentStep:typeof t.indent=="number"?" ".repeat(t.indent):" ",inFlow:n,options:t}}function Ja(s,e){if(e.tag){let i=s.filter(r=>r.tag===e.tag);if(i.length>0)return i.find(r=>r.format===e.format)??i[0]}let t,n;if(X.isScalar(e)){n=e.value;let i=s.filter(r=>r.identify?.(n));if(i.length>1){let r=i.filter(o=>o.test);r.length>0&&(i=r)}t=i.find(r=>r.format===e.format)??i.find(r=>!r.format)}else n=e,t=s.find(i=>i.nodeClass&&n instanceof i.nodeClass);if(!t){let i=n?.constructor?.name??(n===null?"null":typeof n);throw new Error(`Tag not resolved for ${i} value`)}return t}function Wa(s,e,{anchors:t,doc:n}){if(!n.directives)return"";let i=[],r=(X.isScalar(s)||X.isCollection(s))&&s.anchor;r&&Ka.anchorIsValid(r)&&(t.add(r),i.push(`&${r}`));let o=s.tag??(e.default?null:e.tag);return o&&i.push(n.directives.tagString(o)),i.join(" ")}function Ga(s,e,t,n){if(X.isPair(s))return s.toString(e,t,n);if(X.isAlias(s)){if(e.doc.directives)return s.toString(e);if(e.resolvedAliases?.has(s))throw new TypeError("Cannot stringify circular structure without alias nodes");e.resolvedAliases?e.resolvedAliases.add(s):e.resolvedAliases=new Set([s]),s=s.resolve(e.doc)}let i,r=X.isNode(s)?s:e.doc.createNode(s,{onTagObj:l=>i=l});i??(i=Ja(e.doc.schema.tags,r));let o=Wa(r,i,e);o.length>0&&(e.indentAtStart=(e.indentAtStart??0)+o.length+1);let a=typeof i.stringify=="function"?i.stringify(r,e,t,n):X.isScalar(r)?Ya.stringifyString(r,e,t,n):r.toString(e,t,n);return o?X.isScalar(r)||a[0]==="{"||a[0]==="["?`${o} ${a}`:`${o}
|
|
34
|
+
${e.indent}${a}`:a}Es.createStringifyContext=Va;Es.stringify=Ga});var Oi=y(Ci=>{"use strict";var Y=C(),Ni=T(),Ei=Me(),_e=Pe();function Ha({key:s,value:e},t,n,i){let{allNullValues:r,doc:o,indent:a,indentStep:l,options:{commentString:c,indentSeq:h,simpleKeys:f}}=t,u=Y.isNode(s)&&s.comment||null;if(f){if(u)throw new Error("With simple keys, key nodes cannot have comments");if(Y.isCollection(s)||!Y.isNode(s)&&typeof s=="object"){let q="With simple keys, collection cannot be used as a key value";throw new Error(q)}}let m=!f&&(!s||u&&e==null&&!t.inFlow||Y.isCollection(s)||(Y.isScalar(s)?s.type===Ni.Scalar.BLOCK_FOLDED||s.type===Ni.Scalar.BLOCK_LITERAL:typeof s=="object"));t=Object.assign({},t,{allNullValues:!1,implicitKey:!m&&(f||!r),indent:a+l});let g=!1,d=!1,p=Ei.stringify(s,t,()=>g=!0,()=>d=!0);if(!m&&!t.inFlow&&p.length>1024){if(f)throw new Error("With simple keys, single line scalar must not span more than 1024 characters");m=!0}if(t.inFlow){if(r||e==null)return g&&n&&n(),p===""?"?":m?`? ${p}`:p}else if(r&&!f||e==null&&m)return p=`? ${p}`,u&&!g?p+=_e.lineComment(p,t.indent,c(u)):d&&i&&i(),p;g&&(u=null),m?(u&&(p+=_e.lineComment(p,t.indent,c(u))),p=`? ${p}
|
|
35
|
+
${a}:`):(p=`${p}:`,u&&(p+=_e.lineComment(p,t.indent,c(u))));let b,w,v;Y.isNode(e)?(b=!!e.spaceBefore,w=e.commentBefore,v=e.comment):(b=!1,w=null,v=null,e&&typeof e=="object"&&(e=o.createNode(e))),t.implicitKey=!1,!m&&!u&&Y.isScalar(e)&&(t.indentAtStart=p.length+1),d=!1,!h&&l.length>=2&&!t.inFlow&&!m&&Y.isSeq(e)&&!e.flow&&!e.tag&&!e.anchor&&(t.indent=t.indent.substring(2));let k=!1,A=Ei.stringify(e,t,()=>k=!0,()=>d=!0),N=" ";if(u||b||w){if(N=b?`
|
|
36
|
+
`:"",w){let q=c(w);N+=`
|
|
37
|
+
${_e.indentComment(q,t.indent)}`}A===""&&!t.inFlow?N===`
|
|
38
|
+
`&&v&&(N=`
|
|
39
|
+
|
|
40
|
+
`):N+=`
|
|
41
|
+
${t.indent}`}else if(!m&&Y.isCollection(e)){let q=A[0],S=A.indexOf(`
|
|
42
|
+
`),I=S!==-1,W=t.inFlow??e.flow??e.items.length===0;if(I||!W){let he=!1;if(I&&(q==="&"||q==="!")){let P=A.indexOf(" ");q==="&"&&P!==-1&&P<S&&A[P+1]==="!"&&(P=A.indexOf(" ",P+1)),(P===-1||S<P)&&(he=!0)}he||(N=`
|
|
43
|
+
${t.indent}`)}}else(A===""||A[0]===`
|
|
44
|
+
`)&&(N="");return p+=N+A,t.inFlow?k&&n&&n():v&&!k?p+=_e.lineComment(p,t.indent,c(v)):d&&i&&i(),p}Ci.stringifyPair=Ha});var Os=y(Cs=>{"use strict";var qi=rt("process");function Qa(s,...e){s==="debug"&&console.log(...e)}function Xa(s,e){(s==="debug"||s==="warn")&&(typeof qi.emitWarning=="function"?qi.emitWarning(e):console.warn(e))}Cs.debug=Qa;Cs.warn=Xa});var Et=y(Nt=>{"use strict";var At=C(),Ti=T(),vt="<<",kt={identify:s=>s===vt||typeof s=="symbol"&&s.description===vt,default:"key",tag:"tag:yaml.org,2002:merge",test:/^<<$/,resolve:()=>Object.assign(new Ti.Scalar(Symbol(vt)),{addToJSMap:Ii}),stringify:()=>vt},za=(s,e)=>(kt.identify(e)||At.isScalar(e)&&(!e.type||e.type===Ti.Scalar.PLAIN)&&kt.identify(e.value))&&s?.doc.schema.tags.some(t=>t.tag===kt.tag&&t.default);function Ii(s,e,t){let n=Pi(s,t);if(At.isSeq(n))for(let i of n.items)qs(s,e,i);else if(Array.isArray(n))for(let i of n)qs(s,e,i);else qs(s,e,n)}function qs(s,e,t){let n=Pi(s,t);if(!At.isMap(n))throw new Error("Merge sources must be maps or map aliases");let i=n.toJSON(null,s,Map);for(let[r,o]of i)e instanceof Map?e.has(r)||e.set(r,o):e instanceof Set?e.add(r):Object.prototype.hasOwnProperty.call(e,r)||Object.defineProperty(e,r,{value:o,writable:!0,enumerable:!0,configurable:!0});return e}function Pi(s,e){return s&&At.isAlias(e)?e.resolve(s.doc,s):e}Nt.addMergeToJSMap=Ii;Nt.isMergeKey=za;Nt.merge=kt});var Is=y(Di=>{"use strict";var Za=Os(),Li=Et(),el=Me(),$i=C(),Ts=G();function tl(s,e,{key:t,value:n}){if($i.isNode(t)&&t.addToJSMap)t.addToJSMap(s,e,n);else if(Li.isMergeKey(s,t))Li.addMergeToJSMap(s,e,n);else{let i=Ts.toJS(t,"",s);if(e instanceof Map)e.set(i,Ts.toJS(n,i,s));else if(e instanceof Set)e.add(i);else{let r=sl(t,i,s),o=Ts.toJS(n,r,s);r in e?Object.defineProperty(e,r,{value:o,writable:!0,enumerable:!0,configurable:!0}):e[r]=o}}return e}function sl(s,e,t){if(e===null)return"";if(typeof e!="object")return String(e);if($i.isNode(s)&&t?.doc){let n=el.createStringifyContext(t.doc,{});n.anchors=new Set;for(let r of t.anchors.keys())n.anchors.add(r.anchor);n.inFlow=!0,n.inStringifyKey=!0;let i=s.toString(n);if(!t.mapKeyWarned){let r=JSON.stringify(i);r.length>40&&(r=r.substring(0,36)+'..."'),Za.warn(t.doc.options.logLevel,`Keys with collection values will be stringified due to JS Object restrictions: ${r}. Set mapAsMap: true to use object keys.`),t.mapKeyWarned=!0}return i}return JSON.stringify(e)}Di.addPairToJSMap=tl});var z=y(Ps=>{"use strict";var Mi=Ie(),nl=Oi(),il=Is(),Ct=C();function rl(s,e,t){let n=Mi.createNode(s,void 0,t),i=Mi.createNode(e,void 0,t);return new Ot(n,i)}var Ot=class s{constructor(e,t=null){Object.defineProperty(this,Ct.NODE_TYPE,{value:Ct.PAIR}),this.key=e,this.value=t}clone(e){let{key:t,value:n}=this;return Ct.isNode(t)&&(t=t.clone(e)),Ct.isNode(n)&&(n=n.clone(e)),new s(t,n)}toJSON(e,t){let n=t?.mapAsMap?new Map:{};return il.addPairToJSMap(t,n,this)}toString(e,t,n){return e?.doc?nl.stringifyPair(this,e,t,n):JSON.stringify(this)}};Ps.Pair=Ot;Ps.createPair=rl});var Ls=y(Ri=>{"use strict";var oe=C(),_i=Me(),qt=Pe();function ol(s,e,t){return(e.inFlow??s.flow?ll:al)(s,e,t)}function al({comment:s,items:e},t,{blockItemPrefix:n,flowChars:i,itemIndent:r,onChompKeep:o,onComment:a}){let{indent:l,options:{commentString:c}}=t,h=Object.assign({},t,{indent:r,type:null}),f=!1,u=[];for(let g=0;g<e.length;++g){let d=e[g],p=null;if(oe.isNode(d))!f&&d.spaceBefore&&u.push(""),Tt(t,u,d.commentBefore,f),d.comment&&(p=d.comment);else if(oe.isPair(d)){let w=oe.isNode(d.key)?d.key:null;w&&(!f&&w.spaceBefore&&u.push(""),Tt(t,u,w.commentBefore,f))}f=!1;let b=_i.stringify(d,h,()=>p=null,()=>f=!0);p&&(b+=qt.lineComment(b,r,c(p))),f&&p&&(f=!1),u.push(n+b)}let m;if(u.length===0)m=i.start+i.end;else{m=u[0];for(let g=1;g<u.length;++g){let d=u[g];m+=d?`
|
|
45
|
+
${l}${d}`:`
|
|
46
|
+
`}}return s?(m+=`
|
|
47
|
+
`+qt.indentComment(c(s),l),a&&a()):f&&o&&o(),m}function ll({items:s},e,{flowChars:t,itemIndent:n}){let{indent:i,indentStep:r,flowCollectionPadding:o,options:{commentString:a}}=e;n+=r;let l=Object.assign({},e,{indent:n,inFlow:!0,type:null}),c=!1,h=0,f=[];for(let g=0;g<s.length;++g){let d=s[g],p=null;if(oe.isNode(d))d.spaceBefore&&f.push(""),Tt(e,f,d.commentBefore,!1),d.comment&&(p=d.comment);else if(oe.isPair(d)){let w=oe.isNode(d.key)?d.key:null;w&&(w.spaceBefore&&f.push(""),Tt(e,f,w.commentBefore,!1),w.comment&&(c=!0));let v=oe.isNode(d.value)?d.value:null;v?(v.comment&&(p=v.comment),v.commentBefore&&(c=!0)):d.value==null&&w?.comment&&(p=w.comment)}p&&(c=!0);let b=_i.stringify(d,l,()=>p=null);c||(c=f.length>h||b.includes(`
|
|
48
|
+
`)),g<s.length-1?b+=",":e.options.trailingComma&&(e.options.lineWidth>0&&(c||(c=f.reduce((w,v)=>w+v.length+2,2)+(b.length+2)>e.options.lineWidth)),c&&(b+=",")),p&&(b+=qt.lineComment(b,n,a(p))),f.push(b),h=f.length}let{start:u,end:m}=t;if(f.length===0)return u+m;if(!c){let g=f.reduce((d,p)=>d+p.length+2,2);c=e.options.lineWidth>0&&g>e.options.lineWidth}if(c){let g=u;for(let d of f)g+=d?`
|
|
49
|
+
${r}${i}${d}`:`
|
|
50
|
+
`;return`${g}
|
|
51
|
+
${i}${m}`}else return`${u}${o}${f.join(" ")}${o}${m}`}function Tt({indent:s,options:{commentString:e}},t,n,i){if(n&&i&&(n=n.replace(/^\n+/,"")),n){let r=qt.indentComment(e(n),s);t.push(r.trimStart())}}Ri.stringifyCollection=ol});var ee=y(Ds=>{"use strict";var cl=Ls(),ul=Is(),fl=mt(),Z=C(),It=z(),dl=T();function Re(s,e){let t=Z.isScalar(e)?e.value:e;for(let n of s)if(Z.isPair(n)&&(n.key===e||n.key===t||Z.isScalar(n.key)&&n.key.value===t))return n}var $s=class extends fl.Collection{static get tagName(){return"tag:yaml.org,2002:map"}constructor(e){super(Z.MAP,e),this.items=[]}static from(e,t,n){let{keepUndefined:i,replacer:r}=n,o=new this(e),a=(l,c)=>{if(typeof r=="function")c=r.call(t,l,c);else if(Array.isArray(r)&&!r.includes(l))return;(c!==void 0||i)&&o.items.push(It.createPair(l,c,n))};if(t instanceof Map)for(let[l,c]of t)a(l,c);else if(t&&typeof t=="object")for(let l of Object.keys(t))a(l,t[l]);return typeof e.sortMapEntries=="function"&&o.items.sort(e.sortMapEntries),o}add(e,t){let n;Z.isPair(e)?n=e:!e||typeof e!="object"||!("key"in e)?n=new It.Pair(e,e?.value):n=new It.Pair(e.key,e.value);let i=Re(this.items,n.key),r=this.schema?.sortMapEntries;if(i){if(!t)throw new Error(`Key ${n.key} already set`);Z.isScalar(i.value)&&dl.isScalarValue(n.value)?i.value.value=n.value:i.value=n.value}else if(r){let o=this.items.findIndex(a=>r(n,a)<0);o===-1?this.items.push(n):this.items.splice(o,0,n)}else this.items.push(n)}delete(e){let t=Re(this.items,e);return t?this.items.splice(this.items.indexOf(t),1).length>0:!1}get(e,t){let i=Re(this.items,e)?.value;return(!t&&Z.isScalar(i)?i.value:i)??void 0}has(e){return!!Re(this.items,e)}set(e,t){this.add(new It.Pair(e,t),!0)}toJSON(e,t,n){let i=n?new n:t?.mapAsMap?new Map:{};t?.onCreate&&t.onCreate(i);for(let r of this.items)ul.addPairToJSMap(t,i,r);return i}toString(e,t,n){if(!e)return JSON.stringify(this);for(let i of this.items)if(!Z.isPair(i))throw new Error(`Map items must all be pairs; found ${JSON.stringify(i)} instead`);return!e.allNullValues&&this.hasAllNullValues(!1)&&(e=Object.assign({},e,{allNullValues:!0})),cl.stringifyCollection(this,e,{blockItemPrefix:"",flowChars:{start:"{",end:"}"},itemIndent:e.indent||"",onChompKeep:n,onComment:t})}};Ds.YAMLMap=$s;Ds.findPair=Re});var Se=y(xi=>{"use strict";var hl=C(),Fi=ee(),pl={collection:"map",default:!0,nodeClass:Fi.YAMLMap,tag:"tag:yaml.org,2002:map",resolve(s,e){return hl.isMap(s)||e("Expected a mapping for this tag"),s},createNode:(s,e,t)=>Fi.YAMLMap.from(s,e,t)};xi.map=pl});var te=y(Bi=>{"use strict";var ml=Ie(),yl=Ls(),gl=mt(),Lt=C(),Sl=T(),bl=G(),Ms=class extends gl.Collection{static get tagName(){return"tag:yaml.org,2002:seq"}constructor(e){super(Lt.SEQ,e),this.items=[]}add(e){this.items.push(e)}delete(e){let t=Pt(e);return typeof t!="number"?!1:this.items.splice(t,1).length>0}get(e,t){let n=Pt(e);if(typeof n!="number")return;let i=this.items[n];return!t&&Lt.isScalar(i)?i.value:i}has(e){let t=Pt(e);return typeof t=="number"&&t<this.items.length}set(e,t){let n=Pt(e);if(typeof n!="number")throw new Error(`Expected a valid index, not ${e}.`);let i=this.items[n];Lt.isScalar(i)&&Sl.isScalarValue(t)?i.value=t:this.items[n]=t}toJSON(e,t){let n=[];t?.onCreate&&t.onCreate(n);let i=0;for(let r of this.items)n.push(bl.toJS(r,String(i++),t));return n}toString(e,t,n){return e?yl.stringifyCollection(this,e,{blockItemPrefix:"- ",flowChars:{start:"[",end:"]"},itemIndent:(e.indent||"")+" ",onChompKeep:n,onComment:t}):JSON.stringify(this)}static from(e,t,n){let{replacer:i}=n,r=new this(e);if(t&&Symbol.iterator in Object(t)){let o=0;for(let a of t){if(typeof i=="function"){let l=t instanceof Set?a:String(o++);a=i.call(t,l,a)}r.items.push(ml.createNode(a,void 0,n))}}return r}};function Pt(s){let e=Lt.isScalar(s)?s.value:s;return e&&typeof e=="string"&&(e=Number(e)),typeof e=="number"&&Number.isInteger(e)&&e>=0?e:null}Bi.YAMLSeq=Ms});var be=y(Ki=>{"use strict";var wl=C(),ji=te(),vl={collection:"seq",default:!0,nodeClass:ji.YAMLSeq,tag:"tag:yaml.org,2002:seq",resolve(s,e){return wl.isSeq(s)||e("Expected a sequence for this tag"),s},createNode:(s,e,t)=>ji.YAMLSeq.from(s,e,t)};Ki.seq=vl});var Fe=y(Ui=>{"use strict";var kl=De(),Al={identify:s=>typeof s=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:s=>s,stringify(s,e,t,n){return e=Object.assign({actualString:!0},e),kl.stringifyString(s,e,t,n)}};Ui.string=Al});var $t=y(Ji=>{"use strict";var Yi=T(),Vi={identify:s=>s==null,createNode:()=>new Yi.Scalar(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>new Yi.Scalar(null),stringify:({source:s},e)=>typeof s=="string"&&Vi.test.test(s)?s:e.options.nullStr};Ji.nullTag=Vi});var _s=y(Gi=>{"use strict";var Nl=T(),Wi={identify:s=>typeof s=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:s=>new Nl.Scalar(s[0]==="t"||s[0]==="T"),stringify({source:s,value:e},t){if(s&&Wi.test.test(s)){let n=s[0]==="t"||s[0]==="T";if(e===n)return s}return e?t.options.trueStr:t.options.falseStr}};Gi.boolTag=Wi});var we=y(Hi=>{"use strict";function El({format:s,minFractionDigits:e,tag:t,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(!s&&e&&(!t||t==="tag:yaml.org,2002:float")&&/^-?\d/.test(r)&&!r.includes("e")){let o=r.indexOf(".");o<0&&(o=r.length,r+=".");let a=e-(r.length-o-1);for(;a-- >0;)r+="0"}return r}Hi.stringifyNumber=El});var Fs=y(Dt=>{"use strict";var Cl=T(),Rs=we(),Ol={identify:s=>typeof s=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:s=>s.slice(-3).toLowerCase()==="nan"?NaN:s[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:Rs.stringifyNumber},ql={identify:s=>typeof s=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:\.[0-9]+|[0-9]+(?:\.[0-9]*)?)[eE][-+]?[0-9]+$/,resolve:s=>parseFloat(s),stringify(s){let e=Number(s.value);return isFinite(e)?e.toExponential():Rs.stringifyNumber(s)}},Tl={identify:s=>typeof s=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:\.[0-9]+|[0-9]+\.[0-9]*)$/,resolve(s){let e=new Cl.Scalar(parseFloat(s)),t=s.indexOf(".");return t!==-1&&s[s.length-1]==="0"&&(e.minFractionDigits=s.length-t-1),e},stringify:Rs.stringifyNumber};Dt.float=Tl;Dt.floatExp=ql;Dt.floatNaN=Ol});var Bs=y(_t=>{"use strict";var Qi=we(),Mt=s=>typeof s=="bigint"||Number.isInteger(s),xs=(s,e,t,{intAsBigInt:n})=>n?BigInt(s):parseInt(s.substring(e),t);function Xi(s,e,t){let{value:n}=s;return Mt(n)&&n>=0?t+n.toString(e):Qi.stringifyNumber(s)}var Il={identify:s=>Mt(s)&&s>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^0o[0-7]+$/,resolve:(s,e,t)=>xs(s,2,8,t),stringify:s=>Xi(s,8,"0o")},Pl={identify:Mt,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9]+$/,resolve:(s,e,t)=>xs(s,0,10,t),stringify:Qi.stringifyNumber},Ll={identify:s=>Mt(s)&&s>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^0x[0-9a-fA-F]+$/,resolve:(s,e,t)=>xs(s,2,16,t),stringify:s=>Xi(s,16,"0x")};_t.int=Pl;_t.intHex=Ll;_t.intOct=Il});var Zi=y(zi=>{"use strict";var $l=Se(),Dl=$t(),Ml=be(),_l=Fe(),Rl=_s(),js=Fs(),Ks=Bs(),Fl=[$l.map,Ml.seq,_l.string,Dl.nullTag,Rl.boolTag,Ks.intOct,Ks.int,Ks.intHex,js.floatNaN,js.floatExp,js.float];zi.schema=Fl});var sr=y(tr=>{"use strict";var xl=T(),Bl=Se(),jl=be();function er(s){return typeof s=="bigint"||Number.isInteger(s)}var Rt=({value:s})=>JSON.stringify(s),Kl=[{identify:s=>typeof s=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:s=>s,stringify:Rt},{identify:s=>s==null,createNode:()=>new xl.Scalar(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^null$/,resolve:()=>null,stringify:Rt},{identify:s=>typeof s=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^true$|^false$/,resolve:s=>s==="true",stringify:Rt},{identify:er,default:!0,tag:"tag:yaml.org,2002:int",test:/^-?(?:0|[1-9][0-9]*)$/,resolve:(s,e,{intAsBigInt:t})=>t?BigInt(s):parseInt(s,10),stringify:({value:s})=>er(s)?s.toString():JSON.stringify(s)},{identify:s=>typeof s=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^-?(?:0|[1-9][0-9]*)(?:\.[0-9]*)?(?:[eE][-+]?[0-9]+)?$/,resolve:s=>parseFloat(s),stringify:Rt}],Ul={default:!0,tag:"",test:/^/,resolve(s,e){return e(`Unresolved plain scalar ${JSON.stringify(s)}`),s}},Yl=[Bl.map,jl.seq].concat(Kl,Ul);tr.schema=Yl});var Ys=y(nr=>{"use strict";var xe=rt("buffer"),Us=T(),Vl=De(),Jl={identify:s=>s instanceof Uint8Array,default:!1,tag:"tag:yaml.org,2002:binary",resolve(s,e){if(typeof xe.Buffer=="function")return xe.Buffer.from(s,"base64");if(typeof atob=="function"){let t=atob(s.replace(/[\n\r]/g,"")),n=new Uint8Array(t.length);for(let i=0;i<t.length;++i)n[i]=t.charCodeAt(i);return n}else return e("This environment does not support reading binary tags; either Buffer or atob is required"),s},stringify({comment:s,type:e,value:t},n,i,r){if(!t)return"";let o=t,a;if(typeof xe.Buffer=="function")a=o instanceof xe.Buffer?o.toString("base64"):xe.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 new Error("This environment does not support writing binary tags; either Buffer or btoa is required");if(e??(e=Us.Scalar.BLOCK_LITERAL),e!==Us.Scalar.QUOTE_DOUBLE){let l=Math.max(n.options.lineWidth-n.indent.length,n.options.minContentWidth),c=Math.ceil(a.length/l),h=new Array(c);for(let f=0,u=0;f<c;++f,u+=l)h[f]=a.substr(u,l);a=h.join(e===Us.Scalar.BLOCK_LITERAL?`
|
|
52
|
+
`:" ")}return Vl.stringifyString({comment:s,type:e,value:a},n,i,r)}};nr.binary=Jl});var Bt=y(xt=>{"use strict";var Ft=C(),Vs=z(),Wl=T(),Gl=te();function ir(s,e){if(Ft.isSeq(s))for(let t=0;t<s.items.length;++t){let n=s.items[t];if(!Ft.isPair(n)){if(Ft.isMap(n)){n.items.length>1&&e("Each pair must have its own sequence indicator");let i=n.items[0]||new Vs.Pair(new Wl.Scalar(null));if(n.commentBefore&&(i.key.commentBefore=i.key.commentBefore?`${n.commentBefore}
|
|
53
|
+
${i.key.commentBefore}`:n.commentBefore),n.comment){let r=i.value??i.key;r.comment=r.comment?`${n.comment}
|
|
54
|
+
${r.comment}`:n.comment}n=i}s.items[t]=Ft.isPair(n)?n:new Vs.Pair(n)}}else e("Expected a sequence for this tag");return s}function rr(s,e,t){let{replacer:n}=t,i=new Gl.YAMLSeq(s);i.tag="tag:yaml.org,2002:pairs";let r=0;if(e&&Symbol.iterator in Object(e))for(let o of e){typeof n=="function"&&(o=n.call(e,String(r++),o));let a,l;if(Array.isArray(o))if(o.length===2)a=o[0],l=o[1];else throw new 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 new TypeError(`Expected tuple with one key, not ${c.length} keys`)}else a=o;i.items.push(Vs.createPair(a,l,t))}return i}var Hl={collection:"seq",default:!1,tag:"tag:yaml.org,2002:pairs",resolve:ir,createNode:rr};xt.createPairs=rr;xt.pairs=Hl;xt.resolvePairs=ir});var Gs=y(Ws=>{"use strict";var or=C(),Js=G(),Be=ee(),Ql=te(),ar=Bt(),ae=class s extends Ql.YAMLSeq{constructor(){super(),this.add=Be.YAMLMap.prototype.add.bind(this),this.delete=Be.YAMLMap.prototype.delete.bind(this),this.get=Be.YAMLMap.prototype.get.bind(this),this.has=Be.YAMLMap.prototype.has.bind(this),this.set=Be.YAMLMap.prototype.set.bind(this),this.tag=s.tag}toJSON(e,t){if(!t)return super.toJSON(e);let n=new Map;t?.onCreate&&t.onCreate(n);for(let i of this.items){let r,o;if(or.isPair(i)?(r=Js.toJS(i.key,"",t),o=Js.toJS(i.value,r,t)):r=Js.toJS(i,"",t),n.has(r))throw new Error("Ordered maps must not include duplicate keys");n.set(r,o)}return n}static from(e,t,n){let i=ar.createPairs(e,t,n),r=new this;return r.items=i.items,r}};ae.tag="tag:yaml.org,2002:omap";var Xl={collection:"seq",identify:s=>s instanceof Map,nodeClass:ae,default:!1,tag:"tag:yaml.org,2002:omap",resolve(s,e){let t=ar.resolvePairs(s,e),n=[];for(let{key:i}of t.items)or.isScalar(i)&&(n.includes(i.value)?e(`Ordered maps must not include duplicate keys: ${i.value}`):n.push(i.value));return Object.assign(new ae,t)},createNode:(s,e,t)=>ae.from(s,e,t)};Ws.YAMLOMap=ae;Ws.omap=Xl});var dr=y(Hs=>{"use strict";var lr=T();function cr({value:s,source:e},t){return e&&(s?ur:fr).test.test(e)?e:s?t.options.trueStr:t.options.falseStr}var ur={identify:s=>s===!0,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:Y|y|[Yy]es|YES|[Tt]rue|TRUE|[Oo]n|ON)$/,resolve:()=>new lr.Scalar(!0),stringify:cr},fr={identify:s=>s===!1,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:N|n|[Nn]o|NO|[Ff]alse|FALSE|[Oo]ff|OFF)$/,resolve:()=>new lr.Scalar(!1),stringify:cr};Hs.falseTag=fr;Hs.trueTag=ur});var hr=y(jt=>{"use strict";var zl=T(),Qs=we(),Zl={identify:s=>typeof s=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:s=>s.slice(-3).toLowerCase()==="nan"?NaN:s[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:Qs.stringifyNumber},ec={identify:s=>typeof s=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:[0-9][0-9_]*)?(?:\.[0-9_]*)?[eE][-+]?[0-9]+$/,resolve:s=>parseFloat(s.replace(/_/g,"")),stringify(s){let e=Number(s.value);return isFinite(e)?e.toExponential():Qs.stringifyNumber(s)}},tc={identify:s=>typeof s=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:[0-9][0-9_]*)?\.[0-9_]*$/,resolve(s){let e=new zl.Scalar(parseFloat(s.replace(/_/g,""))),t=s.indexOf(".");if(t!==-1){let n=s.substring(t+1).replace(/_/g,"");n[n.length-1]==="0"&&(e.minFractionDigits=n.length)}return e},stringify:Qs.stringifyNumber};jt.float=tc;jt.floatExp=ec;jt.floatNaN=Zl});var mr=y(Ke=>{"use strict";var pr=we(),je=s=>typeof s=="bigint"||Number.isInteger(s);function Kt(s,e,t,{intAsBigInt:n}){let i=s[0];if((i==="-"||i==="+")&&(e+=1),s=s.substring(e).replace(/_/g,""),n){switch(t){case 2:s=`0b${s}`;break;case 8:s=`0o${s}`;break;case 16:s=`0x${s}`;break}let o=BigInt(s);return i==="-"?BigInt(-1)*o:o}let r=parseInt(s,t);return i==="-"?-1*r:r}function Xs(s,e,t){let{value:n}=s;if(je(n)){let i=n.toString(e);return n<0?"-"+t+i.substr(1):t+i}return pr.stringifyNumber(s)}var sc={identify:je,default:!0,tag:"tag:yaml.org,2002:int",format:"BIN",test:/^[-+]?0b[0-1_]+$/,resolve:(s,e,t)=>Kt(s,2,2,t),stringify:s=>Xs(s,2,"0b")},nc={identify:je,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^[-+]?0[0-7_]+$/,resolve:(s,e,t)=>Kt(s,1,8,t),stringify:s=>Xs(s,8,"0")},ic={identify:je,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9][0-9_]*$/,resolve:(s,e,t)=>Kt(s,0,10,t),stringify:pr.stringifyNumber},rc={identify:je,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:(s,e,t)=>Kt(s,2,16,t),stringify:s=>Xs(s,16,"0x")};Ke.int=ic;Ke.intBin=sc;Ke.intHex=rc;Ke.intOct=nc});var Zs=y(zs=>{"use strict";var Vt=C(),Ut=z(),Yt=ee(),le=class s extends Yt.YAMLMap{constructor(e){super(e),this.tag=s.tag}add(e){let t;Vt.isPair(e)?t=e:e&&typeof e=="object"&&"key"in e&&"value"in e&&e.value===null?t=new Ut.Pair(e.key,null):t=new Ut.Pair(e,null),Yt.findPair(this.items,t.key)||this.items.push(t)}get(e,t){let n=Yt.findPair(this.items,e);return!t&&Vt.isPair(n)?Vt.isScalar(n.key)?n.key.value:n.key:n}set(e,t){if(typeof t!="boolean")throw new Error(`Expected boolean value for set(key, value) in a YAML set, not ${typeof t}`);let n=Yt.findPair(this.items,e);n&&!t?this.items.splice(this.items.indexOf(n),1):!n&&t&&this.items.push(new Ut.Pair(e))}toJSON(e,t){return super.toJSON(e,t,Set)}toString(e,t,n){if(!e)return JSON.stringify(this);if(this.hasAllNullValues(!0))return super.toString(Object.assign({},e,{allNullValues:!0}),t,n);throw new Error("Set items must all have null values")}static from(e,t,n){let{replacer:i}=n,r=new this(e);if(t&&Symbol.iterator in Object(t))for(let o of t)typeof i=="function"&&(o=i.call(t,o,o)),r.items.push(Ut.createPair(o,null,n));return r}};le.tag="tag:yaml.org,2002:set";var oc={collection:"map",identify:s=>s instanceof Set,nodeClass:le,default:!1,tag:"tag:yaml.org,2002:set",createNode:(s,e,t)=>le.from(s,e,t),resolve(s,e){if(Vt.isMap(s)){if(s.hasAllNullValues(!0))return Object.assign(new le,s);e("Set items must all have null values")}else e("Expected a mapping for this tag");return s}};zs.YAMLSet=le;zs.set=oc});var tn=y(Jt=>{"use strict";var ac=we();function en(s,e){let t=s[0],n=t==="-"||t==="+"?s.substring(1):s,i=o=>e?BigInt(o):Number(o),r=n.replace(/_/g,"").split(":").reduce((o,a)=>o*i(60)+i(a),i(0));return t==="-"?i(-1)*r:r}function yr(s){let{value:e}=s,t=o=>o;if(typeof e=="bigint")t=o=>BigInt(o);else if(isNaN(e)||!isFinite(e))return ac.stringifyNumber(s);let n="";e<0&&(n="-",e*=t(-1));let i=t(60),r=[e%i];return e<60?r.unshift(0):(e=(e-r[0])/i,r.unshift(e%i),e>=60&&(e=(e-r[0])/i,r.unshift(e))),n+r.map(o=>String(o).padStart(2,"0")).join(":").replace(/000000\d*$/,"")}var lc={identify:s=>typeof s=="bigint"||Number.isInteger(s),default:!0,tag:"tag:yaml.org,2002:int",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+$/,resolve:(s,e,{intAsBigInt:t})=>en(s,t),stringify:yr},cc={identify:s=>typeof s=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\.[0-9_]*$/,resolve:s=>en(s,!1),stringify:yr},gr={identify:s=>s 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(s){let e=s.match(gr.test);if(!e)throw new Error("!!timestamp expects a date, starting with yyyy-mm-dd");let[,t,n,i,r,o,a]=e.map(Number),l=e[7]?Number((e[7]+"00").substr(1,3)):0,c=Date.UTC(t,n-1,i,r||0,o||0,a||0,l),h=e[8];if(h&&h!=="Z"){let f=en(h,!1);Math.abs(f)<30&&(f*=60),c-=6e4*f}return new Date(c)},stringify:({value:s})=>s?.toISOString().replace(/(T00:00:00)?\.000Z$/,"")??""};Jt.floatTime=cc;Jt.intTime=lc;Jt.timestamp=gr});var wr=y(br=>{"use strict";var uc=Se(),fc=$t(),dc=be(),hc=Fe(),pc=Ys(),Sr=dr(),sn=hr(),Wt=mr(),mc=Et(),yc=Gs(),gc=Bt(),Sc=Zs(),nn=tn(),bc=[uc.map,dc.seq,hc.string,fc.nullTag,Sr.trueTag,Sr.falseTag,Wt.intBin,Wt.intOct,Wt.int,Wt.intHex,sn.floatNaN,sn.floatExp,sn.float,pc.binary,mc.merge,yc.omap,gc.pairs,Sc.set,nn.intTime,nn.floatTime,nn.timestamp];br.schema=bc});var Ir=y(an=>{"use strict";var Nr=Se(),wc=$t(),Er=be(),vc=Fe(),kc=_s(),rn=Fs(),on=Bs(),Ac=Zi(),Nc=sr(),Cr=Ys(),Ue=Et(),Or=Gs(),qr=Bt(),vr=wr(),Tr=Zs(),Gt=tn(),kr=new Map([["core",Ac.schema],["failsafe",[Nr.map,Er.seq,vc.string]],["json",Nc.schema],["yaml11",vr.schema],["yaml-1.1",vr.schema]]),Ar={binary:Cr.binary,bool:kc.boolTag,float:rn.float,floatExp:rn.floatExp,floatNaN:rn.floatNaN,floatTime:Gt.floatTime,int:on.int,intHex:on.intHex,intOct:on.intOct,intTime:Gt.intTime,map:Nr.map,merge:Ue.merge,null:wc.nullTag,omap:Or.omap,pairs:qr.pairs,seq:Er.seq,set:Tr.set,timestamp:Gt.timestamp},Ec={"tag:yaml.org,2002:binary":Cr.binary,"tag:yaml.org,2002:merge":Ue.merge,"tag:yaml.org,2002:omap":Or.omap,"tag:yaml.org,2002:pairs":qr.pairs,"tag:yaml.org,2002:set":Tr.set,"tag:yaml.org,2002:timestamp":Gt.timestamp};function Cc(s,e,t){let n=kr.get(e);if(n&&!s)return t&&!n.includes(Ue.merge)?n.concat(Ue.merge):n.slice();let i=n;if(!i)if(Array.isArray(s))i=[];else{let r=Array.from(kr.keys()).filter(o=>o!=="yaml11").map(o=>JSON.stringify(o)).join(", ");throw new Error(`Unknown schema "${e}"; use one of ${r} or define customTags array`)}if(Array.isArray(s))for(let r of s)i=i.concat(r);else typeof s=="function"&&(i=s(i.slice()));return t&&(i=i.concat(Ue.merge)),i.reduce((r,o)=>{let a=typeof o=="string"?Ar[o]:o;if(!a){let l=JSON.stringify(o),c=Object.keys(Ar).map(h=>JSON.stringify(h)).join(", ");throw new Error(`Unknown custom tag ${l}; use one of ${c}`)}return r.includes(a)||r.push(a),r},[])}an.coreKnownTags=Ec;an.getTags=Cc});var un=y(Pr=>{"use strict";var ln=C(),Oc=Se(),qc=be(),Tc=Fe(),Ht=Ir(),Ic=(s,e)=>s.key<e.key?-1:s.key>e.key?1:0,cn=class s{constructor({compat:e,customTags:t,merge:n,resolveKnownTags:i,schema:r,sortMapEntries:o,toStringDefaults:a}){this.compat=Array.isArray(e)?Ht.getTags(e,"compat"):e?Ht.getTags(null,e):null,this.name=typeof r=="string"&&r||"core",this.knownTags=i?Ht.coreKnownTags:{},this.tags=Ht.getTags(t,this.name,n),this.toStringOptions=a??null,Object.defineProperty(this,ln.MAP,{value:Oc.map}),Object.defineProperty(this,ln.SCALAR,{value:Tc.string}),Object.defineProperty(this,ln.SEQ,{value:qc.seq}),this.sortMapEntries=typeof o=="function"?o:o===!0?Ic:null}clone(){let e=Object.create(s.prototype,Object.getOwnPropertyDescriptors(this));return e.tags=this.tags.slice(),e}};Pr.Schema=cn});var $r=y(Lr=>{"use strict";var Pc=C(),fn=Me(),Ye=Pe();function Lc(s,e){let t=[],n=e.directives===!0;if(e.directives!==!1&&s.directives){let l=s.directives.toString(s);l?(t.push(l),n=!0):s.directives.docStart&&(n=!0)}n&&t.push("---");let i=fn.createStringifyContext(s,e),{commentString:r}=i.options;if(s.commentBefore){t.length!==1&&t.unshift("");let l=r(s.commentBefore);t.unshift(Ye.indentComment(l,""))}let o=!1,a=null;if(s.contents){if(Pc.isNode(s.contents)){if(s.contents.spaceBefore&&n&&t.push(""),s.contents.commentBefore){let h=r(s.contents.commentBefore);t.push(Ye.indentComment(h,""))}i.forceBlockIndent=!!s.comment,a=s.contents.comment}let l=a?void 0:()=>o=!0,c=fn.stringify(s.contents,i,()=>a=null,l);a&&(c+=Ye.lineComment(c,"",r(a))),(c[0]==="|"||c[0]===">")&&t[t.length-1]==="---"?t[t.length-1]=`--- ${c}`:t.push(c)}else t.push(fn.stringify(s.contents,i));if(s.directives?.docEnd)if(s.comment){let l=r(s.comment);l.includes(`
|
|
55
|
+
`)?(t.push("..."),t.push(Ye.indentComment(l,""))):t.push(`... ${l}`)}else t.push("...");else{let l=s.comment;l&&o&&(l=l.replace(/^\n+/,"")),l&&((!o||a)&&t[t.length-1]!==""&&t.push(""),t.push(Ye.indentComment(r(l),"")))}return t.join(`
|
|
56
|
+
`)+`
|
|
57
|
+
`}Lr.stringifyDocument=Lc});var Ve=y(Dr=>{"use strict";var $c=Te(),ve=mt(),R=C(),Dc=z(),Mc=G(),_c=un(),Rc=$r(),dn=ft(),Fc=ms(),xc=Ie(),hn=ps(),pn=class s{constructor(e,t,n){this.commentBefore=null,this.comment=null,this.errors=[],this.warnings=[],Object.defineProperty(this,R.NODE_TYPE,{value:R.DOC});let i=null;typeof t=="function"||Array.isArray(t)?i=t:n===void 0&&t&&(n=t,t=void 0);let r=Object.assign({intAsBigInt:!1,keepSourceTokens:!1,logLevel:"warn",prettyErrors:!0,strict:!0,stringKeys:!1,uniqueKeys:!0,version:"1.2"},n);this.options=r;let{version:o}=r;n?._directives?(this.directives=n._directives.atDocument(),this.directives.yaml.explicit&&(o=this.directives.yaml.version)):this.directives=new hn.Directives({version:o}),this.setSchema(o,n),this.contents=e===void 0?null:this.createNode(e,i,n)}clone(){let e=Object.create(s.prototype,{[R.NODE_TYPE]:{value:R.DOC}});return 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()),e.schema=this.schema.clone(),e.contents=R.isNode(this.contents)?this.contents.clone(e.schema):this.contents,this.range&&(e.range=this.range.slice()),e}add(e){ke(this.contents)&&this.contents.add(e)}addIn(e,t){ke(this.contents)&&this.contents.addIn(e,t)}createAlias(e,t){if(!e.anchor){let n=dn.anchorNames(this);e.anchor=!t||n.has(t)?dn.findNewAnchor(t||"a",n):t}return new $c.Alias(e.anchor)}createNode(e,t,n){let i;if(typeof t=="function")e=t.call({"":e},"",e),i=t;else if(Array.isArray(t)){let p=w=>typeof w=="number"||w instanceof String||w instanceof Number,b=t.filter(p).map(String);b.length>0&&(t=t.concat(b)),i=t}else n===void 0&&t&&(n=t,t=void 0);let{aliasDuplicateObjects:r,anchorPrefix:o,flow:a,keepUndefined:l,onTagObj:c,tag:h}=n??{},{onAnchor:f,setAnchors:u,sourceObjects:m}=dn.createNodeAnchors(this,o||"a"),g={aliasDuplicateObjects:r??!0,keepUndefined:l??!1,onAnchor:f,onTagObj:c,replacer:i,schema:this.schema,sourceObjects:m},d=xc.createNode(e,h,g);return a&&R.isCollection(d)&&(d.flow=!0),u(),d}createPair(e,t,n={}){let i=this.createNode(e,null,n),r=this.createNode(t,null,n);return new Dc.Pair(i,r)}delete(e){return ke(this.contents)?this.contents.delete(e):!1}deleteIn(e){return ve.isEmptyPath(e)?this.contents==null?!1:(this.contents=null,!0):ke(this.contents)?this.contents.deleteIn(e):!1}get(e,t){return R.isCollection(this.contents)?this.contents.get(e,t):void 0}getIn(e,t){return ve.isEmptyPath(e)?!t&&R.isScalar(this.contents)?this.contents.value:this.contents:R.isCollection(this.contents)?this.contents.getIn(e,t):void 0}has(e){return R.isCollection(this.contents)?this.contents.has(e):!1}hasIn(e){return ve.isEmptyPath(e)?this.contents!==void 0:R.isCollection(this.contents)?this.contents.hasIn(e):!1}set(e,t){this.contents==null?this.contents=ve.collectionFromPath(this.schema,[e],t):ke(this.contents)&&this.contents.set(e,t)}setIn(e,t){ve.isEmptyPath(e)?this.contents=t:this.contents==null?this.contents=ve.collectionFromPath(this.schema,Array.from(e),t):ke(this.contents)&&this.contents.setIn(e,t)}setSchema(e,t={}){typeof e=="number"&&(e=String(e));let n;switch(e){case"1.1":this.directives?this.directives.yaml.version="1.1":this.directives=new hn.Directives({version:"1.1"}),n={resolveKnownTags:!1,schema:"yaml-1.1"};break;case"1.2":case"next":this.directives?this.directives.yaml.version=e:this.directives=new hn.Directives({version:e}),n={resolveKnownTags:!0,schema:"core"};break;case null:this.directives&&delete this.directives,n=null;break;default:{let i=JSON.stringify(e);throw new Error(`Expected '1.1', '1.2' or null as first argument, but found: ${i}`)}}if(t.schema instanceof Object)this.schema=t.schema;else if(n)this.schema=new _c.Schema(Object.assign(n,t));else throw new Error("With a null YAML version, the { schema: Schema } option is required")}toJS({json:e,jsonArg:t,mapAsMap:n,maxAliasCount:i,onAnchor:r,reviver:o}={}){let a={anchors:new Map,doc:this,keep:!e,mapAsMap:n===!0,mapKeyWarned:!1,maxAliasCount:typeof i=="number"?i:100},l=Mc.toJS(this.contents,t??"",a);if(typeof r=="function")for(let{count:c,res:h}of a.anchors.values())r(h,c);return typeof o=="function"?Fc.applyReviver(o,{"":l},"",l):l}toJSON(e,t){return this.toJS({json:!0,jsonArg:e,mapAsMap:!1,onAnchor:t})}toString(e={}){if(this.errors.length>0)throw new 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 new Error(`"indent" option must be a positive integer, not ${t}`)}return Rc.stringifyDocument(this,e)}};function ke(s){if(R.isCollection(s))return!0;throw new Error("Expected a YAML collection as document contents")}Dr.Document=pn});var Ge=y(We=>{"use strict";var Je=class extends Error{constructor(e,t,n,i){super(),this.name=e,this.code=n,this.message=i,this.pos=t}},mn=class extends Je{constructor(e,t,n){super("YAMLParseError",e,t,n)}},yn=class extends Je{constructor(e,t,n){super("YAMLWarning",e,t,n)}},Bc=(s,e)=>t=>{if(t.pos[0]===-1)return;t.linePos=t.pos.map(a=>e.linePos(a));let{line:n,col:i}=t.linePos[0];t.message+=` at line ${n}, column ${i}`;let r=i-1,o=s.substring(e.lineStarts[n-1],e.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"),n>1&&/^ *$/.test(o.substring(0,r))){let a=s.substring(e.lineStarts[n-2],e.lineStarts[n-1]);a.length>80&&(a=a.substring(0,79)+`\u2026
|
|
58
|
+
`),o=a+o}if(/[^ ]/.test(o)){let a=1,l=t.linePos[1];l?.line===n&&l.col>i&&(a=Math.max(1,Math.min(l.col-i,80-r)));let c=" ".repeat(r)+"^".repeat(a);t.message+=`:
|
|
59
|
+
|
|
60
|
+
${o}
|
|
61
|
+
${c}
|
|
62
|
+
`}};We.YAMLError=Je;We.YAMLParseError=mn;We.YAMLWarning=yn;We.prettifyError=Bc});var He=y(Mr=>{"use strict";function jc(s,{flow:e,indicator:t,next:n,offset:i,onError:r,parentIndent:o,startOnNewline:a}){let l=!1,c=a,h=a,f="",u="",m=!1,g=!1,d=null,p=null,b=null,w=null,v=null,k=null,A=null;for(let S of s)switch(g&&(S.type!=="space"&&S.type!=="newline"&&S.type!=="comma"&&r(S.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),g=!1),d&&(c&&S.type!=="comment"&&S.type!=="newline"&&r(d,"TAB_AS_INDENT","Tabs are not allowed as indentation"),d=null),S.type){case"space":!e&&(t!=="doc-start"||n?.type!=="flow-collection")&&S.source.includes(" ")&&(d=S),h=!0;break;case"comment":{h||r(S,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");let I=S.source.substring(1)||" ";f?f+=u+I:f=I,u="",c=!1;break}case"newline":c?f?f+=S.source:(!k||t!=="seq-item-ind")&&(l=!0):u+=S.source,c=!0,m=!0,(p||b)&&(w=S),h=!0;break;case"anchor":p&&r(S,"MULTIPLE_ANCHORS","A node can have at most one anchor"),S.source.endsWith(":")&&r(S.offset+S.source.length-1,"BAD_ALIAS","Anchor ending in : is ambiguous",!0),p=S,A??(A=S.offset),c=!1,h=!1,g=!0;break;case"tag":{b&&r(S,"MULTIPLE_TAGS","A node can have at most one tag"),b=S,A??(A=S.offset),c=!1,h=!1,g=!0;break}case t:(p||b)&&r(S,"BAD_PROP_ORDER",`Anchors and tags must be after the ${S.source} indicator`),k&&r(S,"UNEXPECTED_TOKEN",`Unexpected ${S.source} in ${e??"collection"}`),k=S,c=t==="seq-item-ind"||t==="explicit-key-ind",h=!1;break;case"comma":if(e){v&&r(S,"UNEXPECTED_TOKEN",`Unexpected , in ${e}`),v=S,c=!1,h=!1;break}default:r(S,"UNEXPECTED_TOKEN",`Unexpected ${S.type} token`),c=!1,h=!1}let N=s[s.length-1],q=N?N.offset+N.source.length:i;return g&&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"),d&&(c&&d.indent<=o||n?.type==="block-map"||n?.type==="block-seq")&&r(d,"TAB_AS_INDENT","Tabs are not allowed as indentation"),{comma:v,found:k,spaceBefore:l,comment:f,hasNewline:m,anchor:p,tag:b,newlineAfterProp:w,end:q,start:A??q}}Mr.resolveProps=jc});var Qt=y(_r=>{"use strict";function gn(s){if(!s)return null;switch(s.type){case"alias":case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":if(s.source.includes(`
|
|
63
|
+
`))return!0;if(s.end){for(let e of s.end)if(e.type==="newline")return!0}return!1;case"flow-collection":for(let e of s.items){for(let t of e.start)if(t.type==="newline")return!0;if(e.sep){for(let t of e.sep)if(t.type==="newline")return!0}if(gn(e.key)||gn(e.value))return!0}return!1;default:return!0}}_r.containsNewline=gn});var Sn=y(Rr=>{"use strict";var Kc=Qt();function Uc(s,e,t){if(e?.type==="flow-collection"){let n=e.end[0];n.indent===s&&(n.source==="]"||n.source==="}")&&Kc.containsNewline(e)&&t(n,"BAD_INDENT","Flow end indicator should be more indented than parent",!0)}}Rr.flowIndentCheck=Uc});var bn=y(xr=>{"use strict";var Fr=C();function Yc(s,e,t){let{uniqueKeys:n}=s.options;if(n===!1)return!1;let i=typeof n=="function"?n:(r,o)=>r===o||Fr.isScalar(r)&&Fr.isScalar(o)&&r.value===o.value;return e.some(r=>i(r.key,t))}xr.mapIncludes=Yc});var Vr=y(Yr=>{"use strict";var Br=z(),Vc=ee(),jr=He(),Jc=Qt(),Kr=Sn(),Wc=bn(),Ur="All mapping items must start at the same column";function Gc({composeNode:s,composeEmptyNode:e},t,n,i,r){let o=r?.nodeClass??Vc.YAMLMap,a=new o(t.schema);t.atRoot&&(t.atRoot=!1);let l=n.offset,c=null;for(let h of n.items){let{start:f,key:u,sep:m,value:g}=h,d=jr.resolveProps(f,{indicator:"explicit-key-ind",next:u??m?.[0],offset:l,onError:i,parentIndent:n.indent,startOnNewline:!0}),p=!d.found;if(p){if(u&&(u.type==="block-seq"?i(l,"BLOCK_AS_IMPLICIT_KEY","A block sequence may not be used as an implicit map key"):"indent"in u&&u.indent!==n.indent&&i(l,"BAD_INDENT",Ur)),!d.anchor&&!d.tag&&!m){c=d.end,d.comment&&(a.comment?a.comment+=`
|
|
64
|
+
`+d.comment:a.comment=d.comment);continue}(d.newlineAfterProp||Jc.containsNewline(u))&&i(u??f[f.length-1],"MULTILINE_IMPLICIT_KEY","Implicit keys need to be on a single line")}else d.found?.indent!==n.indent&&i(l,"BAD_INDENT",Ur);t.atKey=!0;let b=d.end,w=u?s(t,u,d,i):e(t,b,f,null,d,i);t.schema.compat&&Kr.flowIndentCheck(n.indent,u,i),t.atKey=!1,Wc.mapIncludes(t,a.items,w)&&i(b,"DUPLICATE_KEY","Map keys must be unique");let v=jr.resolveProps(m??[],{indicator:"map-value-ind",next:g,offset:w.range[2],onError:i,parentIndent:n.indent,startOnNewline:!u||u.type==="block-scalar"});if(l=v.end,v.found){p&&(g?.type==="block-map"&&!v.hasNewline&&i(l,"BLOCK_AS_IMPLICIT_KEY","Nested mappings are not allowed in compact mappings"),t.options.strict&&d.start<v.found.offset-1024&&i(w.range,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit block mapping key"));let k=g?s(t,g,v,i):e(t,l,m,null,v,i);t.schema.compat&&Kr.flowIndentCheck(n.indent,g,i),l=k.range[2];let A=new Br.Pair(w,k);t.options.keepSourceTokens&&(A.srcToken=h),a.items.push(A)}else{p&&i(w.range,"MISSING_CHAR","Implicit map keys need to be followed by map values"),v.comment&&(w.comment?w.comment+=`
|
|
65
|
+
`+v.comment:w.comment=v.comment);let k=new Br.Pair(w);t.options.keepSourceTokens&&(k.srcToken=h),a.items.push(k)}}return c&&c<l&&i(c,"IMPOSSIBLE","Map comment with trailing content"),a.range=[n.offset,l,c??l],a}Yr.resolveBlockMap=Gc});var Wr=y(Jr=>{"use strict";var Hc=te(),Qc=He(),Xc=Sn();function zc({composeNode:s,composeEmptyNode:e},t,n,i,r){let o=r?.nodeClass??Hc.YAMLSeq,a=new o(t.schema);t.atRoot&&(t.atRoot=!1),t.atKey&&(t.atKey=!1);let l=n.offset,c=null;for(let{start:h,value:f}of n.items){let u=Qc.resolveProps(h,{indicator:"seq-item-ind",next:f,offset:l,onError:i,parentIndent:n.indent,startOnNewline:!0});if(!u.found)if(u.anchor||u.tag||f)f?.type==="block-seq"?i(u.end,"BAD_INDENT","All sequence items must start at the same column"):i(l,"MISSING_CHAR","Sequence item without - indicator");else{c=u.end,u.comment&&(a.comment=u.comment);continue}let m=f?s(t,f,u,i):e(t,u.end,h,null,u,i);t.schema.compat&&Xc.flowIndentCheck(n.indent,f,i),l=m.range[2],a.items.push(m)}return a.range=[n.offset,l,c??l],a}Jr.resolveBlockSeq=zc});var Ae=y(Gr=>{"use strict";function Zc(s,e,t,n){let i="";if(s){let r=!1,o="";for(let a of s){let{source:l,type:c}=a;switch(c){case"space":r=!0;break;case"comment":{t&&!r&&n(a,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");let h=l.substring(1)||" ";i?i+=o+h:i=h,o="";break}case"newline":i&&(o+=l),r=!0;break;default:n(a,"UNEXPECTED_TOKEN",`Unexpected ${c} at node end`)}e+=l.length}}return{comment:i,offset:e}}Gr.resolveEnd=Zc});var zr=y(Xr=>{"use strict";var eu=C(),tu=z(),Hr=ee(),su=te(),nu=Ae(),Qr=He(),iu=Qt(),ru=bn(),wn="Block collections are not allowed within flow collections",vn=s=>s&&(s.type==="block-map"||s.type==="block-seq");function ou({composeNode:s,composeEmptyNode:e},t,n,i,r){let o=n.start.source==="{",a=o?"flow map":"flow sequence",l=r?.nodeClass??(o?Hr.YAMLMap:su.YAMLSeq),c=new l(t.schema);c.flow=!0;let h=t.atRoot;h&&(t.atRoot=!1),t.atKey&&(t.atKey=!1);let f=n.offset+n.start.source.length;for(let p=0;p<n.items.length;++p){let b=n.items[p],{start:w,key:v,sep:k,value:A}=b,N=Qr.resolveProps(w,{flow:a,indicator:"explicit-key-ind",next:v??k?.[0],offset:f,onError:i,parentIndent:n.indent,startOnNewline:!1});if(!N.found){if(!N.anchor&&!N.tag&&!k&&!A){p===0&&N.comma?i(N.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${a}`):p<n.items.length-1&&i(N.start,"UNEXPECTED_TOKEN",`Unexpected empty item in ${a}`),N.comment&&(c.comment?c.comment+=`
|
|
66
|
+
`+N.comment:c.comment=N.comment),f=N.end;continue}!o&&t.options.strict&&iu.containsNewline(v)&&i(v,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line")}if(p===0)N.comma&&i(N.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${a}`);else if(N.comma||i(N.start,"MISSING_CHAR",`Missing , between ${a} items`),N.comment){let q="";e:for(let S of w)switch(S.type){case"comma":case"space":break;case"comment":q=S.source.substring(1);break e;default:break e}if(q){let S=c.items[c.items.length-1];eu.isPair(S)&&(S=S.value??S.key),S.comment?S.comment+=`
|
|
67
|
+
`+q:S.comment=q,N.comment=N.comment.substring(q.length+1)}}if(!o&&!k&&!N.found){let q=A?s(t,A,N,i):e(t,N.end,k,null,N,i);c.items.push(q),f=q.range[2],vn(A)&&i(q.range,"BLOCK_IN_FLOW",wn)}else{t.atKey=!0;let q=N.end,S=v?s(t,v,N,i):e(t,q,w,null,N,i);vn(v)&&i(S.range,"BLOCK_IN_FLOW",wn),t.atKey=!1;let I=Qr.resolveProps(k??[],{flow:a,indicator:"map-value-ind",next:A,offset:S.range[2],onError:i,parentIndent:n.indent,startOnNewline:!1});if(I.found){if(!o&&!N.found&&t.options.strict){if(k)for(let P of k){if(P===I.found)break;if(P.type==="newline"){i(P,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line");break}}N.start<I.found.offset-1024&&i(I.found,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit flow sequence key")}}else A&&("source"in A&&A.source?.[0]===":"?i(A,"MISSING_CHAR",`Missing space after : in ${a}`):i(I.start,"MISSING_CHAR",`Missing , or : between ${a} items`));let W=A?s(t,A,I,i):I.found?e(t,I.end,k,null,I,i):null;W?vn(A)&&i(W.range,"BLOCK_IN_FLOW",wn):I.comment&&(S.comment?S.comment+=`
|
|
68
|
+
`+I.comment:S.comment=I.comment);let he=new tu.Pair(S,W);if(t.options.keepSourceTokens&&(he.srcToken=b),o){let P=c;ru.mapIncludes(t,P.items,S)&&i(q,"DUPLICATE_KEY","Map keys must be unique"),P.items.push(he)}else{let P=new Hr.YAMLMap(t.schema);P.flow=!0,P.items.push(he);let Xn=(W??S).range;P.range=[S.range[0],Xn[1],Xn[2]],c.items.push(P)}f=W?W.range[2]:I.end}}let u=o?"}":"]",[m,...g]=n.end,d=f;if(m?.source===u)d=m.offset+m.source.length;else{let p=a[0].toUpperCase()+a.substring(1),b=h?`${p} must end with a ${u}`:`${p} in block collection must be sufficiently indented and end with a ${u}`;i(f,h?"MISSING_CHAR":"BAD_INDENT",b),m&&m.source.length!==1&&g.unshift(m)}if(g.length>0){let p=nu.resolveEnd(g,d,t.options.strict,i);p.comment&&(c.comment?c.comment+=`
|
|
69
|
+
`+p.comment:c.comment=p.comment),c.range=[n.offset,d,p.offset]}else c.range=[n.offset,d,d];return c}Xr.resolveFlowCollection=ou});var eo=y(Zr=>{"use strict";var au=C(),lu=T(),cu=ee(),uu=te(),fu=Vr(),du=Wr(),hu=zr();function kn(s,e,t,n,i,r){let o=t.type==="block-map"?fu.resolveBlockMap(s,e,t,n,r):t.type==="block-seq"?du.resolveBlockSeq(s,e,t,n,r):hu.resolveFlowCollection(s,e,t,n,r),a=o.constructor;return i==="!"||i===a.tagName?(o.tag=a.tagName,o):(i&&(o.tag=i),o)}function pu(s,e,t,n,i){let r=n.tag,o=r?e.directives.tagName(r.source,u=>i(r,"TAG_RESOLVE_FAILED",u)):null;if(t.type==="block-seq"){let{anchor:u,newlineAfterProp:m}=n,g=u&&r?u.offset>r.offset?u:r:u??r;g&&(!m||m.offset<g.offset)&&i(g,"MISSING_CHAR","Missing newline after block sequence props")}let a=t.type==="block-map"?"map":t.type==="block-seq"?"seq":t.start.source==="{"?"map":"seq";if(!r||!o||o==="!"||o===cu.YAMLMap.tagName&&a==="map"||o===uu.YAMLSeq.tagName&&a==="seq")return kn(s,e,t,i,o);let l=e.schema.tags.find(u=>u.tag===o&&u.collection===a);if(!l){let u=e.schema.knownTags[o];if(u?.collection===a)e.schema.tags.push(Object.assign({},u,{default:!1})),l=u;else return u?i(r,"BAD_COLLECTION_TYPE",`${u.tag} used for ${a} collection, but expects ${u.collection??"scalar"}`,!0):i(r,"TAG_RESOLVE_FAILED",`Unresolved tag: ${o}`,!0),kn(s,e,t,i,o)}let c=kn(s,e,t,i,o,l),h=l.resolve?.(c,u=>i(r,"TAG_RESOLVE_FAILED",u),e.options)??c,f=au.isNode(h)?h:new lu.Scalar(h);return f.range=c.range,f.tag=o,l?.format&&(f.format=l.format),f}Zr.composeCollection=pu});var Nn=y(to=>{"use strict";var An=T();function mu(s,e,t){let n=e.offset,i=yu(e,s.options.strict,t);if(!i)return{value:"",type:null,comment:"",range:[n,n,n]};let r=i.mode===">"?An.Scalar.BLOCK_FOLDED:An.Scalar.BLOCK_LITERAL,o=e.source?gu(e.source):[],a=o.length;for(let d=o.length-1;d>=0;--d){let p=o[d][1];if(p===""||p==="\r")a=d;else break}if(a===0){let d=i.chomp==="+"&&o.length>0?`
|
|
70
|
+
`.repeat(Math.max(1,o.length-1)):"",p=n+i.length;return e.source&&(p+=e.source.length),{value:d,type:r,comment:i.comment,range:[n,p,p]}}let l=e.indent+i.indent,c=e.offset+i.length,h=0;for(let d=0;d<a;++d){let[p,b]=o[d];if(b===""||b==="\r")i.indent===0&&p.length>l&&(l=p.length);else{p.length<l&&t(c+p.length,"MISSING_CHAR","Block scalars with more-indented leading empty lines must use an explicit indentation indicator"),i.indent===0&&(l=p.length),h=d,l===0&&!s.atRoot&&t(c,"BAD_INDENT","Block scalar values in collections must be indented");break}c+=p.length+b.length+1}for(let d=o.length-1;d>=a;--d)o[d][0].length>l&&(a=d+1);let f="",u="",m=!1;for(let d=0;d<h;++d)f+=o[d][0].slice(l)+`
|
|
71
|
+
`;for(let d=h;d<a;++d){let[p,b]=o[d];c+=p.length+b.length+1;let w=b[b.length-1]==="\r";if(w&&(b=b.slice(0,-1)),b&&p.length<l){let k=`Block scalar lines must not be less indented than their ${i.indent?"explicit indentation indicator":"first line"}`;t(c-b.length-(w?2:1),"BAD_INDENT",k),p=""}r===An.Scalar.BLOCK_LITERAL?(f+=u+p.slice(l)+b,u=`
|
|
72
|
+
`):p.length>l||b[0]===" "?(u===" "?u=`
|
|
73
|
+
`:!m&&u===`
|
|
74
|
+
`&&(u=`
|
|
75
|
+
|
|
76
|
+
`),f+=u+p.slice(l)+b,u=`
|
|
77
|
+
`,m=!0):b===""?u===`
|
|
78
|
+
`?f+=`
|
|
79
|
+
`:u=`
|
|
80
|
+
`:(f+=u+b,u=" ",m=!1)}switch(i.chomp){case"-":break;case"+":for(let d=a;d<o.length;++d)f+=`
|
|
81
|
+
`+o[d][0].slice(l);f[f.length-1]!==`
|
|
82
|
+
`&&(f+=`
|
|
83
|
+
`);break;default:f+=`
|
|
84
|
+
`}let g=n+i.length+e.source.length;return{value:f,type:r,comment:i.comment,range:[n,g,g]}}function yu({offset:s,props:e},t,n){if(e[0].type!=="block-scalar-header")return n(e[0],"IMPOSSIBLE","Block scalar header not found"),null;let{source:i}=e[0],r=i[0],o=0,a="",l=-1;for(let u=1;u<i.length;++u){let m=i[u];if(!a&&(m==="-"||m==="+"))a=m;else{let g=Number(m);!o&&g?o=g:l===-1&&(l=s+u)}}l!==-1&&n(l,"UNEXPECTED_TOKEN",`Block scalar header includes extra characters: ${i}`);let c=!1,h="",f=i.length;for(let u=1;u<e.length;++u){let m=e[u];switch(m.type){case"space":c=!0;case"newline":f+=m.source.length;break;case"comment":t&&!c&&n(m,"MISSING_CHAR","Comments must be separated from other tokens by white space characters"),f+=m.source.length,h=m.source.substring(1);break;case"error":n(m,"UNEXPECTED_TOKEN",m.message),f+=m.source.length;break;default:{let g=`Unexpected token in block scalar header: ${m.type}`;n(m,"UNEXPECTED_TOKEN",g);let d=m.source;d&&typeof d=="string"&&(f+=d.length)}}}return{mode:r,indent:o,chomp:a,comment:h,length:f}}function gu(s){let e=s.split(/\n( *)/),t=e[0],n=t.match(/^( *)/),r=[n?.[1]?[n[1],t.slice(n[1].length)]:["",t]];for(let o=1;o<e.length;o+=2)r.push([e[o],e[o+1]]);return r}to.resolveBlockScalar=mu});var Cn=y(no=>{"use strict";var En=T(),Su=Ae();function bu(s,e,t){let{offset:n,type:i,source:r,end:o}=s,a,l,c=(u,m,g)=>t(n+u,m,g);switch(i){case"scalar":a=En.Scalar.PLAIN,l=wu(r,c);break;case"single-quoted-scalar":a=En.Scalar.QUOTE_SINGLE,l=vu(r,c);break;case"double-quoted-scalar":a=En.Scalar.QUOTE_DOUBLE,l=ku(r,c);break;default:return t(s,"UNEXPECTED_TOKEN",`Expected a flow scalar value, but found: ${i}`),{value:"",type:null,comment:"",range:[n,n+r.length,n+r.length]}}let h=n+r.length,f=Su.resolveEnd(o,h,e,t);return{value:l,type:a,comment:f.comment,range:[n,h,f.offset]}}function wu(s,e){let t="";switch(s[0]){case" ":t="a tab character";break;case",":t="flow indicator character ,";break;case"%":t="directive indicator character %";break;case"|":case">":{t=`block scalar indicator ${s[0]}`;break}case"@":case"`":{t=`reserved character ${s[0]}`;break}}return t&&e(0,"BAD_SCALAR_START",`Plain value cannot start with ${t}`),so(s)}function vu(s,e){return(s[s.length-1]!=="'"||s.length===1)&&e(s.length,"MISSING_CHAR","Missing closing 'quote"),so(s.slice(1,-1)).replace(/''/g,"'")}function so(s){let e=/(.*?)\r?\n/sy,t=e.exec(s);if(!t)return s;let n,i;try{n=new RegExp("(?<![ ])[ ]+$"),i=new RegExp("^[ ]+|(?<![ ])[ ]+$","g")}catch{n=/[ \t]+$/,i=/^[ \t]+|[ \t]+$/g}let r=t[1].replace(n,""),o=" ",a=e.lastIndex;for(;t=e.exec(s);){let c=t[1].replace(i,"");c===""?o===`
|
|
85
|
+
`?r+=o:o=`
|
|
86
|
+
`:(r+=o+c,o=" "),a=e.lastIndex}let l=/[ \t]*(.*)/sy;return l.lastIndex=a,t=l.exec(s),r+o+(t?.[1]??"")}function ku(s,e){let t="";for(let n=1;n<s.length-1;++n){let i=s[n];if(!(i==="\r"&&s[n+1]===`
|
|
87
|
+
`))if(i===`
|
|
88
|
+
`){let{fold:r,offset:o}=Au(s,n);t+=r,n=o}else if(i==="\\"){let r=s[++n],o=Nu[r];if(o)t+=o;else if(r===`
|
|
89
|
+
`)for(r=s[n+1];r===" "||r===" ";)r=s[++n+1];else if(r==="\r"&&s[n+1]===`
|
|
90
|
+
`)for(r=s[++n+1];r===" "||r===" ";)r=s[++n+1];else if(r==="x"||r==="u"||r==="U"){let a=r==="x"?2:r==="u"?4:8;t+=Eu(s,n+1,a,e),n+=a}else{let a=s.substr(n-1,2);e(n-1,"BAD_DQ_ESCAPE",`Invalid escape sequence ${a}`),t+=a}}else if(i===" "||i===" "){let r=n,o=s[n+1];for(;o===" "||o===" ";)o=s[++n+1];o!==`
|
|
91
|
+
`&&!(o==="\r"&&s[n+2]===`
|
|
92
|
+
`)&&(t+=n>r?s.slice(r,n+1):i)}else t+=i}return(s[s.length-1]!=='"'||s.length===1)&&e(s.length,"MISSING_CHAR",'Missing closing "quote'),t}function Au(s,e){let t="",n=s[e+1];for(;(n===" "||n===" "||n===`
|
|
93
|
+
`||n==="\r")&&!(n==="\r"&&s[e+2]!==`
|
|
94
|
+
`);)n===`
|
|
95
|
+
`&&(t+=`
|
|
96
|
+
`),e+=1,n=s[e+1];return t||(t=" "),{fold:t,offset:e}}var Nu={0:"\0",a:"\x07",b:"\b",e:"\x1B",f:"\f",n:`
|
|
97
|
+
`,r:"\r",t:" ",v:"\v",N:"\x85",_:"\xA0",L:"\u2028",P:"\u2029"," ":" ",'"':'"',"/":"/","\\":"\\"," ":" "};function Eu(s,e,t,n){let i=s.substr(e,t),o=i.length===t&&/^[0-9a-fA-F]+$/.test(i)?parseInt(i,16):NaN;try{return String.fromCodePoint(o)}catch{let a=s.substr(e-2,t+2);return n(e-2,"BAD_DQ_ESCAPE",`Invalid escape sequence ${a}`),a}}no.resolveFlowScalar=bu});var oo=y(ro=>{"use strict";var ce=C(),io=T(),Cu=Nn(),Ou=Cn();function qu(s,e,t,n){let{value:i,type:r,comment:o,range:a}=e.type==="block-scalar"?Cu.resolveBlockScalar(s,e,n):Ou.resolveFlowScalar(e,s.options.strict,n),l=t?s.directives.tagName(t.source,f=>n(t,"TAG_RESOLVE_FAILED",f)):null,c;s.options.stringKeys&&s.atKey?c=s.schema[ce.SCALAR]:l?c=Tu(s.schema,i,l,t,n):e.type==="scalar"?c=Iu(s,i,e,n):c=s.schema[ce.SCALAR];let h;try{let f=c.resolve(i,u=>n(t??e,"TAG_RESOLVE_FAILED",u),s.options);h=ce.isScalar(f)?f:new io.Scalar(f)}catch(f){let u=f instanceof Error?f.message:String(f);n(t??e,"TAG_RESOLVE_FAILED",u),h=new io.Scalar(i)}return h.range=a,h.source=i,r&&(h.type=r),l&&(h.tag=l),c.format&&(h.format=c.format),o&&(h.comment=o),h}function Tu(s,e,t,n,i){if(t==="!")return s[ce.SCALAR];let r=[];for(let a of s.tags)if(!a.collection&&a.tag===t)if(a.default&&a.test)r.push(a);else return a;for(let a of r)if(a.test?.test(e))return a;let o=s.knownTags[t];return o&&!o.collection?(s.tags.push(Object.assign({},o,{default:!1,test:void 0})),o):(i(n,"TAG_RESOLVE_FAILED",`Unresolved tag: ${t}`,t!=="tag:yaml.org,2002:str"),s[ce.SCALAR])}function Iu({atKey:s,directives:e,schema:t},n,i,r){let o=t.tags.find(a=>(a.default===!0||s&&a.default==="key")&&a.test?.test(n))||t[ce.SCALAR];if(t.compat){let a=t.compat.find(l=>l.default&&l.test?.test(n))??t[ce.SCALAR];if(o.tag!==a.tag){let l=e.tagString(o.tag),c=e.tagString(a.tag),h=`Value may be parsed as either ${l} or ${c}`;r(i,"TAG_RESOLVE_FAILED",h,!0)}}return o}ro.composeScalar=qu});var lo=y(ao=>{"use strict";function Pu(s,e,t){if(e){t??(t=e.length);for(let n=t-1;n>=0;--n){let i=e[n];switch(i.type){case"space":case"comment":case"newline":s-=i.source.length;continue}for(i=e[++n];i?.type==="space";)s+=i.source.length,i=e[++n];break}}return s}ao.emptyScalarPosition=Pu});var fo=y(qn=>{"use strict";var Lu=Te(),$u=C(),Du=eo(),co=oo(),Mu=Ae(),_u=lo(),Ru={composeNode:uo,composeEmptyNode:On};function uo(s,e,t,n){let i=s.atKey,{spaceBefore:r,comment:o,anchor:a,tag:l}=t,c,h=!0;switch(e.type){case"alias":c=Fu(s,e,n),(a||l)&&n(e,"ALIAS_PROPS","An alias node must not specify any properties");break;case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"block-scalar":c=co.composeScalar(s,e,l,n),a&&(c.anchor=a.source.substring(1));break;case"block-map":case"block-seq":case"flow-collection":try{c=Du.composeCollection(Ru,s,e,t,n),a&&(c.anchor=a.source.substring(1))}catch(f){let u=f instanceof Error?f.message:String(f);n(e,"RESOURCE_EXHAUSTION",u)}break;default:{let f=e.type==="error"?e.message:`Unsupported token (type: ${e.type})`;n(e,"UNEXPECTED_TOKEN",f),h=!1}}return c??(c=On(s,e.offset,void 0,null,t,n)),a&&c.anchor===""&&n(a,"BAD_ALIAS","Anchor cannot be an empty string"),i&&s.options.stringKeys&&(!$u.isScalar(c)||typeof c.value!="string"||c.tag&&c.tag!=="tag:yaml.org,2002:str")&&n(l??e,"NON_STRING_KEY","With stringKeys, all keys must be strings"),r&&(c.spaceBefore=!0),o&&(e.type==="scalar"&&e.source===""?c.comment=o:c.commentBefore=o),s.options.keepSourceTokens&&h&&(c.srcToken=e),c}function On(s,e,t,n,{spaceBefore:i,comment:r,anchor:o,tag:a,end:l},c){let h={type:"scalar",offset:_u.emptyScalarPosition(e,t,n),indent:-1,source:""},f=co.composeScalar(s,h,a,c);return o&&(f.anchor=o.source.substring(1),f.anchor===""&&c(o,"BAD_ALIAS","Anchor cannot be an empty string")),i&&(f.spaceBefore=!0),r&&(f.comment=r,f.range[2]=l),f}function Fu({options:s},{offset:e,source:t,end:n},i){let r=new Lu.Alias(t.substring(1));r.source===""&&i(e,"BAD_ALIAS","Alias cannot be an empty string"),r.source.endsWith(":")&&i(e+t.length-1,"BAD_ALIAS","Alias ending in : is ambiguous",!0);let o=e+t.length,a=Mu.resolveEnd(n,o,s.strict,i);return r.range=[e,o,a.offset],a.comment&&(r.comment=a.comment),r}qn.composeEmptyNode=On;qn.composeNode=uo});var mo=y(po=>{"use strict";var xu=Ve(),ho=fo(),Bu=Ae(),ju=He();function Ku(s,e,{offset:t,start:n,value:i,end:r},o){let a=Object.assign({_directives:e},s),l=new xu.Document(void 0,a),c={atKey:!1,atRoot:!0,directives:l.directives,options:l.options,schema:l.schema},h=ju.resolveProps(n,{indicator:"doc-start",next:i??r?.[0],offset:t,onError:o,parentIndent:0,startOnNewline:!0});h.found&&(l.directives.docStart=!0,i&&(i.type==="block-map"||i.type==="block-seq")&&!h.hasNewline&&o(h.end,"MISSING_CHAR","Block collection cannot start on same line with directives-end marker")),l.contents=i?ho.composeNode(c,i,h,o):ho.composeEmptyNode(c,h.end,n,null,h,o);let f=l.contents.range[2],u=Bu.resolveEnd(r,f,!1,o);return u.comment&&(l.comment=u.comment),l.range=[t,f,u.offset],l}po.composeDoc=Ku});var In=y(So=>{"use strict";var Uu=rt("process"),Yu=ps(),Vu=Ve(),Qe=Ge(),yo=C(),Ju=mo(),Wu=Ae();function Xe(s){if(typeof s=="number")return[s,s+1];if(Array.isArray(s))return s.length===2?s:[s[0],s[1]];let{offset:e,source:t}=s;return[e,e+(typeof t=="string"?t.length:1)]}function go(s){let e="",t=!1,n=!1;for(let i=0;i<s.length;++i){let r=s[i];switch(r[0]){case"#":e+=(e===""?"":n?`
|
|
98
|
+
|
|
99
|
+
`:`
|
|
100
|
+
`)+(r.substring(1)||" "),t=!0,n=!1;break;case"%":s[i+1]?.[0]!=="#"&&(i+=1),t=!1;break;default:t||(n=!0),t=!1}}return{comment:e,afterEmptyLine:n}}var Tn=class{constructor(e={}){this.doc=null,this.atDirectives=!1,this.prelude=[],this.errors=[],this.warnings=[],this.onError=(t,n,i,r)=>{let o=Xe(t);r?this.warnings.push(new Qe.YAMLWarning(o,n,i)):this.errors.push(new Qe.YAMLParseError(o,n,i))},this.directives=new Yu.Directives({version:e.version||"1.2"}),this.options=e}decorate(e,t){let{comment:n,afterEmptyLine:i}=go(this.prelude);if(n){let r=e.contents;if(t)e.comment=e.comment?`${e.comment}
|
|
101
|
+
${n}`:n;else if(i||e.directives.docStart||!r)e.commentBefore=n;else if(yo.isCollection(r)&&!r.flow&&r.items.length>0){let o=r.items[0];yo.isPair(o)&&(o=o.key);let a=o.commentBefore;o.commentBefore=a?`${n}
|
|
102
|
+
${a}`:n}else{let o=r.commentBefore;r.commentBefore=o?`${n}
|
|
103
|
+
${o}`:n}}if(t){for(let r=0;r<this.errors.length;++r)e.errors.push(this.errors[r]);for(let r=0;r<this.warnings.length;++r)e.warnings.push(this.warnings[r])}else e.errors=this.errors,e.warnings=this.warnings;this.prelude=[],this.errors=[],this.warnings=[]}streamInfo(){return{comment:go(this.prelude).comment,directives:this.directives,errors:this.errors,warnings:this.warnings}}*compose(e,t=!1,n=-1){for(let i of e)yield*this.next(i);yield*this.end(t,n)}*next(e){switch(Uu.env.LOG_STREAM&&console.dir(e,{depth:null}),e.type){case"directive":this.directives.add(e.source,(t,n,i)=>{let r=Xe(e);r[0]+=t,this.onError(r,"BAD_DIRECTIVE",n,i)}),this.prelude.push(e.source),this.atDirectives=!0;break;case"document":{let t=Ju.composeDoc(this.options,this.directives,e,this.onError);this.atDirectives&&!t.directives.docStart&&this.onError(e,"MISSING_CHAR","Missing directives-end/doc-start indicator line"),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,n=new Qe.YAMLParseError(Xe(e),"UNEXPECTED_TOKEN",t);this.atDirectives||!this.doc?this.errors.push(n):this.doc.errors.push(n);break}case"doc-end":{if(!this.doc){let n="Unexpected doc-end without preceding document";this.errors.push(new Qe.YAMLParseError(Xe(e),"UNEXPECTED_TOKEN",n));break}this.doc.directives.docEnd=!0;let t=Wu.resolveEnd(e.end,e.offset+e.source.length,this.doc.options.strict,this.onError);if(this.decorate(this.doc,!0),t.comment){let n=this.doc.comment;this.doc.comment=n?`${n}
|
|
104
|
+
${t.comment}`:t.comment}this.doc.range[2]=t.offset;break}default:this.errors.push(new Qe.YAMLParseError(Xe(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 n=Object.assign({_directives:this.directives},this.options),i=new Vu.Document(void 0,n);this.atDirectives&&this.onError(t,"MISSING_CHAR","Missing directives-end indicator line"),i.range=[0,t,t],this.decorate(i,!1),yield i}}};So.Composer=Tn});var vo=y(Xt=>{"use strict";var Gu=Nn(),Hu=Cn(),Qu=Ge(),bo=De();function Xu(s,e=!0,t){if(s){let n=(i,r,o)=>{let a=typeof i=="number"?i:Array.isArray(i)?i[0]:i.offset;if(t)t(a,r,o);else throw new Qu.YAMLParseError([a,a+1],r,o)};switch(s.type){case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return Hu.resolveFlowScalar(s,e,n);case"block-scalar":return Gu.resolveBlockScalar({options:{strict:e}},s,n)}}return null}function zu(s,e){let{implicitKey:t=!1,indent:n,inFlow:i=!1,offset:r=-1,type:o="PLAIN"}=e,a=bo.stringifyString({type:o,value:s},{implicitKey:t,indent:n>0?" ".repeat(n):"",inFlow:i,options:{blockQuote:!0,lineWidth:-1}}),l=e.end??[{type:"newline",offset:-1,indent:n,source:`
|
|
105
|
+
`}];switch(a[0]){case"|":case">":{let c=a.indexOf(`
|
|
106
|
+
`),h=a.substring(0,c),f=a.substring(c+1)+`
|
|
107
|
+
`,u=[{type:"block-scalar-header",offset:r,indent:n,source:h}];return wo(u,l)||u.push({type:"newline",offset:-1,indent:n,source:`
|
|
108
|
+
`}),{type:"block-scalar",offset:r,indent:n,props:u,source:f}}case'"':return{type:"double-quoted-scalar",offset:r,indent:n,source:a,end:l};case"'":return{type:"single-quoted-scalar",offset:r,indent:n,source:a,end:l};default:return{type:"scalar",offset:r,indent:n,source:a,end:l}}}function Zu(s,e,t={}){let{afterKey:n=!1,implicitKey:i=!1,inFlow:r=!1,type:o}=t,a="indent"in s?s.indent:null;if(n&&typeof a=="number"&&(a+=2),!o)switch(s.type){case"single-quoted-scalar":o="QUOTE_SINGLE";break;case"double-quoted-scalar":o="QUOTE_DOUBLE";break;case"block-scalar":{let c=s.props[0];if(c.type!=="block-scalar-header")throw new Error("Invalid block scalar header");o=c.source[0]===">"?"BLOCK_FOLDED":"BLOCK_LITERAL";break}default:o="PLAIN"}let l=bo.stringifyString({type:o,value:e},{implicitKey:i||a===null,indent:a!==null&&a>0?" ".repeat(a):"",inFlow:r,options:{blockQuote:!0,lineWidth:-1}});switch(l[0]){case"|":case">":ef(s,l);break;case'"':Pn(s,l,"double-quoted-scalar");break;case"'":Pn(s,l,"single-quoted-scalar");break;default:Pn(s,l,"scalar")}}function ef(s,e){let t=e.indexOf(`
|
|
109
|
+
`),n=e.substring(0,t),i=e.substring(t+1)+`
|
|
110
|
+
`;if(s.type==="block-scalar"){let r=s.props[0];if(r.type!=="block-scalar-header")throw new Error("Invalid block scalar header");r.source=n,s.source=i}else{let{offset:r}=s,o="indent"in s?s.indent:-1,a=[{type:"block-scalar-header",offset:r,indent:o,source:n}];wo(a,"end"in s?s.end:void 0)||a.push({type:"newline",offset:-1,indent:o,source:`
|
|
111
|
+
`});for(let l of Object.keys(s))l!=="type"&&l!=="offset"&&delete s[l];Object.assign(s,{type:"block-scalar",indent:o,props:a,source:i})}}function wo(s,e){if(e)for(let t of e)switch(t.type){case"space":case"comment":s.push(t);break;case"newline":return s.push(t),!0}return!1}function Pn(s,e,t){switch(s.type){case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":s.type=t,s.source=e;break;case"block-scalar":{let n=s.props.slice(1),i=e.length;s.props[0].type==="block-scalar-header"&&(i-=s.props[0].source.length);for(let r of n)r.offset+=i;delete s.props,Object.assign(s,{type:t,source:e,end:n});break}case"block-map":case"block-seq":{let i={type:"newline",offset:s.offset+e.length,indent:s.indent,source:`
|
|
112
|
+
`};delete s.items,Object.assign(s,{type:t,source:e,end:[i]});break}default:{let n="indent"in s?s.indent:-1,i="end"in s&&Array.isArray(s.end)?s.end.filter(r=>r.type==="space"||r.type==="comment"||r.type==="newline"):[];for(let r of Object.keys(s))r!=="type"&&r!=="offset"&&delete s[r];Object.assign(s,{type:t,indent:n,source:e,end:i})}}}Xt.createScalarToken=zu;Xt.resolveAsScalar=Xu;Xt.setScalarValue=Zu});var Ao=y(ko=>{"use strict";var tf=s=>"type"in s?Zt(s):zt(s);function Zt(s){switch(s.type){case"block-scalar":{let e="";for(let t of s.props)e+=Zt(t);return e+s.source}case"block-map":case"block-seq":{let e="";for(let t of s.items)e+=zt(t);return e}case"flow-collection":{let e=s.start.source;for(let t of s.items)e+=zt(t);for(let t of s.end)e+=t.source;return e}case"document":{let e=zt(s);if(s.end)for(let t of s.end)e+=t.source;return e}default:{let e=s.source;if("end"in s&&s.end)for(let t of s.end)e+=t.source;return e}}}function zt({start:s,key:e,sep:t,value:n}){let i="";for(let r of s)i+=r.source;if(e&&(i+=Zt(e)),t)for(let r of t)i+=r.source;return n&&(i+=Zt(n)),i}ko.stringify=tf});var Oo=y(Co=>{"use strict";var Ln=Symbol("break visit"),sf=Symbol("skip children"),No=Symbol("remove item");function ue(s,e){"type"in s&&s.type==="document"&&(s={start:s.start,value:s.value}),Eo(Object.freeze([]),s,e)}ue.BREAK=Ln;ue.SKIP=sf;ue.REMOVE=No;ue.itemAtPath=(s,e)=>{let t=s;for(let[n,i]of e){let r=t?.[n];if(r&&"items"in r)t=r.items[i];else return}return t};ue.parentCollection=(s,e)=>{let t=ue.itemAtPath(s,e.slice(0,-1)),n=e[e.length-1][0],i=t?.[n];if(i&&"items"in i)return i;throw new Error("Parent collection not found")};function Eo(s,e,t){let n=t(e,s);if(typeof n=="symbol")return n;for(let i of["key","value"]){let r=e[i];if(r&&"items"in r){for(let o=0;o<r.items.length;++o){let a=Eo(Object.freeze(s.concat([[i,o]])),r.items[o],t);if(typeof a=="number")o=a-1;else{if(a===Ln)return Ln;a===No&&(r.items.splice(o,1),o-=1)}}typeof n=="function"&&i==="key"&&(n=n(e,s))}}return typeof n=="function"?n(e,s):n}Co.visit=ue});var es=y(M=>{"use strict";var $n=vo(),nf=Ao(),rf=Oo(),Dn="\uFEFF",Mn="",_n="",Rn="",of=s=>!!s&&"items"in s,af=s=>!!s&&(s.type==="scalar"||s.type==="single-quoted-scalar"||s.type==="double-quoted-scalar"||s.type==="block-scalar");function lf(s){switch(s){case Dn:return"<BOM>";case Mn:return"<DOC>";case _n:return"<FLOW_END>";case Rn:return"<SCALAR>";default:return JSON.stringify(s)}}function cf(s){switch(s){case Dn:return"byte-order-mark";case Mn:return"doc-mode";case _n:return"flow-error-end";case Rn:return"scalar";case"---":return"doc-start";case"...":return"doc-end";case"":case`
|
|
113
|
+
`:case`\r
|
|
114
|
+
`: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(s[0]){case" ":case" ":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}M.createScalarToken=$n.createScalarToken;M.resolveAsScalar=$n.resolveAsScalar;M.setScalarValue=$n.setScalarValue;M.stringify=nf.stringify;M.visit=rf.visit;M.BOM=Dn;M.DOCUMENT=Mn;M.FLOW_END=_n;M.SCALAR=Rn;M.isCollection=of;M.isScalar=af;M.prettyToken=lf;M.tokenType=cf});var Bn=y(To=>{"use strict";var ze=es();function x(s){switch(s){case void 0:case" ":case`
|
|
115
|
+
`:case"\r":case" ":return!0;default:return!1}}var qo=new Set("0123456789ABCDEFabcdef"),uf=new Set("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()"),ts=new Set(",[]{}"),ff=new Set(` ,[]{}
|
|
116
|
+
\r `),Fn=s=>!s||ff.has(s),xn=class{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 n=this.next??"stream";for(;n&&(t||this.hasChars(1));)n=yield*this.parseNext(n)}atLineEnd(){let e=this.pos,t=this.buffer[e];for(;t===" "||t===" ";)t=this.buffer[++e];return!t||t==="#"||t===`
|
|
117
|
+
`?!0:t==="\r"?this.buffer[e+1]===`
|
|
118
|
+
`:!1}charAt(e){return this.buffer[this.pos+e]}continueScalar(e){let t=this.buffer[e];if(this.indentNext>0){let n=0;for(;t===" ";)t=this.buffer[++n+e];if(t==="\r"){let i=this.buffer[n+e+1];if(i===`
|
|
119
|
+
`||!i&&!this.atEnd)return e+n+1}return t===`
|
|
120
|
+
`||n>=this.indentNext||!t&&!this.atEnd?e+n:-1}if(t==="-"||t==="."){let n=this.buffer.substr(e,3);if((n==="---"||n==="...")&&x(this.buffer[e+3]))return-1}return e}getLine(){let e=this.lineEndPos;return(typeof e!="number"||e!==-1&&e<this.pos)&&(e=this.buffer.indexOf(`
|
|
121
|
+
`,this.pos),this.lineEndPos=e),e===-1?this.atEnd?this.buffer.substring(this.pos):null:(this.buffer[e-1]==="\r"&&(e-=1),this.buffer.substring(this.pos,e))}hasChars(e){return this.pos+e<=this.buffer.length}setNext(e){return this.buffer=this.buffer.substring(this.pos),this.pos=0,this.lineEndPos=null,this.next=e,null}peek(e){return this.buffer.substr(this.pos,e)}*parseNext(e){switch(e){case"stream":return yield*this.parseStream();case"line-start":return yield*this.parseLineStart();case"block-start":return yield*this.parseBlockStart();case"doc":return yield*this.parseDocument();case"flow":return yield*this.parseFlowCollection();case"quoted-scalar":return yield*this.parseQuotedScalar();case"block-scalar":return yield*this.parseBlockScalar();case"plain-scalar":return yield*this.parsePlainScalar()}}*parseStream(){let e=this.getLine();if(e===null)return this.setNext("stream");if(e[0]===ze.BOM&&(yield*this.pushCount(1),e=e.substring(1)),e[0]==="%"){let t=e.length,n=e.indexOf("#");for(;n!==-1;){let r=e[n-1];if(r===" "||r===" "){t=n-1;break}else n=e.indexOf("#",n+1)}for(;;){let r=e[t-1];if(r===" "||r===" ")t-=1;else break}let i=(yield*this.pushCount(t))+(yield*this.pushSpaces(!0));return yield*this.pushCount(e.length-i),this.pushNewline(),"stream"}if(this.atLineEnd()){let t=yield*this.pushSpaces(!0);return yield*this.pushCount(e.length-t),yield*this.pushNewline(),"stream"}return yield ze.DOCUMENT,yield*this.parseLineStart()}*parseLineStart(){let e=this.charAt(0);if(!e&&!this.atEnd)return this.setNext("line-start");if(e==="-"||e==="."){if(!this.atEnd&&!this.hasChars(4))return this.setNext("line-start");let t=this.peek(3);if((t==="---"||t==="...")&&x(this.charAt(3)))return yield*this.pushCount(3),this.indentValue=0,this.indentNext=0,t==="---"?"doc":"stream"}return this.indentValue=yield*this.pushSpaces(!1),this.indentNext>this.indentValue&&!x(this.charAt(1))&&(this.indentNext=this.indentValue),yield*this.parseBlockStart()}*parseBlockStart(){let[e,t]=this.peek(2);if(!t&&!this.atEnd)return this.setNext("block-start");if((e==="-"||e==="?"||e===":")&&x(t)){let n=(yield*this.pushCount(1))+(yield*this.pushSpaces(!0));return this.indentNext=this.indentValue+1,this.indentValue+=n,"block-start"}return"doc"}*parseDocument(){yield*this.pushSpaces(!0);let e=this.getLine();if(e===null)return this.setNext("doc");let t=yield*this.pushIndicators();switch(e[t]){case"#":yield*this.pushCount(e.length-t);case void 0:return yield*this.pushNewline(),yield*this.parseLineStart();case"{":case"[":return yield*this.pushCount(1),this.flowKey=!1,this.flowLevel=1,"flow";case"}":case"]":return yield*this.pushCount(1),"doc";case"*":return yield*this.pushUntil(Fn),"doc";case'"':case"'":return yield*this.parseQuotedScalar();case"|":case">":return t+=yield*this.parseBlockScalarHeader(),t+=yield*this.pushSpaces(!0),yield*this.pushCount(e.length-t),yield*this.pushNewline(),yield*this.parseBlockScalar();default:return yield*this.parsePlainScalar()}}*parseFlowCollection(){let e,t,n=-1;do e=yield*this.pushNewline(),e>0?(t=yield*this.pushSpaces(!1),this.indentValue=n=t):t=0,t+=yield*this.pushSpaces(!0);while(e+t>0);let i=this.getLine();if(i===null)return this.setNext("flow");if((n!==-1&&n<this.indentNext&&i[0]!=="#"||n===0&&(i.startsWith("---")||i.startsWith("..."))&&x(i[3]))&&!(n===this.indentNext-1&&this.flowLevel===1&&(i[0]==="]"||i[0]==="}")))return this.flowLevel=0,yield ze.FLOW_END,yield*this.parseLineStart();let r=0;for(;i[r]===",";)r+=yield*this.pushCount(1),r+=yield*this.pushSpaces(!0),this.flowKey=!1;switch(r+=yield*this.pushIndicators(),i[r]){case void 0:return"flow";case"#":return yield*this.pushCount(i.length-r),"flow";case"{":case"[":return yield*this.pushCount(1),this.flowKey=!1,this.flowLevel+=1,"flow";case"}":case"]":return yield*this.pushCount(1),this.flowKey=!0,this.flowLevel-=1,this.flowLevel?"flow":"doc";case"*":return yield*this.pushUntil(Fn),"flow";case'"':case"'":return this.flowKey=!0,yield*this.parseQuotedScalar();case":":{let o=this.charAt(1);if(this.flowKey||x(o)||o===",")return this.flowKey=!1,yield*this.pushCount(1),yield*this.pushSpaces(!0),"flow"}default:return this.flowKey=!1,yield*this.parsePlainScalar()}}*parseQuotedScalar(){let e=this.charAt(0),t=this.buffer.indexOf(e,this.pos+1);if(e==="'")for(;t!==-1&&this.buffer[t+1]==="'";)t=this.buffer.indexOf("'",t+2);else for(;t!==-1;){let r=0;for(;this.buffer[t-1-r]==="\\";)r+=1;if(r%2===0)break;t=this.buffer.indexOf('"',t+1)}let n=this.buffer.substring(0,t),i=n.indexOf(`
|
|
122
|
+
`,this.pos);if(i!==-1){for(;i!==-1;){let r=this.continueScalar(i+1);if(r===-1)break;i=n.indexOf(`
|
|
123
|
+
`,r)}i!==-1&&(t=i-(n[i-1]==="\r"?2:1))}if(t===-1){if(!this.atEnd)return this.setNext("quoted-scalar");t=this.buffer.length}return yield*this.pushToIndex(t+1,!1),this.flowLevel?"flow":"doc"}*parseBlockScalarHeader(){this.blockScalarIndent=-1,this.blockScalarKeep=!1;let e=this.pos;for(;;){let t=this.buffer[++e];if(t==="+")this.blockScalarKeep=!0;else if(t>"0"&&t<="9")this.blockScalarIndent=Number(t)-1;else if(t!=="-")break}return yield*this.pushUntil(t=>x(t)||t==="#")}*parseBlockScalar(){let e=this.pos-1,t=0,n;e:for(let r=this.pos;n=this.buffer[r];++r)switch(n){case" ":t+=1;break;case`
|
|
124
|
+
`:e=r,t=0;break;case"\r":{let o=this.buffer[r+1];if(!o&&!this.atEnd)return this.setNext("block-scalar");if(o===`
|
|
125
|
+
`)break}default:break e}if(!n&&!this.atEnd)return this.setNext("block-scalar");if(t>=this.indentNext){this.blockScalarIndent===-1?this.indentNext=t:this.indentNext=this.blockScalarIndent+(this.indentNext===0?1:this.indentNext);do{let r=this.continueScalar(e+1);if(r===-1)break;e=this.buffer.indexOf(`
|
|
126
|
+
`,r)}while(e!==-1);if(e===-1){if(!this.atEnd)return this.setNext("block-scalar");e=this.buffer.length}}let i=e+1;for(n=this.buffer[i];n===" ";)n=this.buffer[++i];if(n===" "){for(;n===" "||n===" "||n==="\r"||n===`
|
|
127
|
+
`;)n=this.buffer[++i];e=i-1}else if(!this.blockScalarKeep)do{let r=e-1,o=this.buffer[r];o==="\r"&&(o=this.buffer[--r]);let a=r;for(;o===" ";)o=this.buffer[--r];if(o===`
|
|
128
|
+
`&&r>=this.pos&&r+1+t>a)e=r;else break}while(!0);return yield ze.SCALAR,yield*this.pushToIndex(e+1,!0),yield*this.parseLineStart()}*parsePlainScalar(){let e=this.flowLevel>0,t=this.pos-1,n=this.pos-1,i;for(;i=this.buffer[++n];)if(i===":"){let r=this.buffer[n+1];if(x(r)||e&&ts.has(r))break;t=n}else if(x(i)){let r=this.buffer[n+1];if(i==="\r"&&(r===`
|
|
129
|
+
`?(n+=1,i=`
|
|
130
|
+
`,r=this.buffer[n+1]):t=n),r==="#"||e&&ts.has(r))break;if(i===`
|
|
131
|
+
`){let o=this.continueScalar(n+1);if(o===-1)break;n=Math.max(n,o-2)}}else{if(e&&ts.has(i))break;t=n}return!i&&!this.atEnd?this.setNext("plain-scalar"):(yield ze.SCALAR,yield*this.pushToIndex(t+1,!0),e?"flow":"doc")}*pushCount(e){return e>0?(yield this.buffer.substr(this.pos,e),this.pos+=e,e):0}*pushToIndex(e,t){let n=this.buffer.slice(this.pos,e);return n?(yield n,this.pos+=n.length,n.length):(t&&(yield""),0)}*pushIndicators(){let e=0;e:for(;;){switch(this.charAt(0)){case"!":e+=yield*this.pushTag(),e+=yield*this.pushSpaces(!0);continue e;case"&":e+=yield*this.pushUntil(Fn),e+=yield*this.pushSpaces(!0);continue e;case"-":case"?":case":":{let t=this.flowLevel>0,n=this.charAt(1);if(x(n)||t&&ts.has(n)){t?this.flowKey&&(this.flowKey=!1):this.indentNext=this.indentValue+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];for(;!x(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];for(;t;)if(uf.has(t))t=this.buffer[++e];else if(t==="%"&&qo.has(this.buffer[e+1])&&qo.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];return e===`
|
|
132
|
+
`?yield*this.pushCount(1):e==="\r"&&this.charAt(1)===`
|
|
133
|
+
`?yield*this.pushCount(2):0}*pushSpaces(e){let t=this.pos-1,n;do n=this.buffer[++t];while(n===" "||e&&n===" ");let i=t-this.pos;return i>0&&(yield this.buffer.substr(this.pos,i),this.pos=t),i}*pushUntil(e){let t=this.pos,n=this.buffer[t];for(;!e(n);)n=this.buffer[++t];return yield*this.pushToIndex(t,!1)}};To.Lexer=xn});var Kn=y(Io=>{"use strict";var jn=class{constructor(){this.lineStarts=[],this.addNewLine=e=>this.lineStarts.push(e),this.linePos=e=>{let t=0,n=this.lineStarts.length;for(;t<n;){let r=t+n>>1;this.lineStarts[r]<e?t=r+1:n=r}if(this.lineStarts[t]===e)return{line:t+1,col:1};if(t===0)return{line:0,col:e};let i=this.lineStarts[t-1];return{line:t,col:e-i+1}}}};Io.LineCounter=jn});var Yn=y(Mo=>{"use strict";var df=rt("process"),Po=es(),hf=Bn();function se(s,e){for(let t=0;t<s.length;++t)if(s[t].type===e)return!0;return!1}function Lo(s){for(let e=0;e<s.length;++e)switch(s[e].type){case"space":case"comment":case"newline":break;default:return e}return-1}function Do(s){switch(s?.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"flow-collection":return!0;default:return!1}}function ss(s){switch(s.type){case"document":return s.start;case"block-map":{let e=s.items[s.items.length-1];return e.sep??e.start}case"block-seq":return s.items[s.items.length-1].start;default:return[]}}function Ne(s){if(s.length===0)return[];let e=s.length;e:for(;--e>=0;)switch(s[e].type){case"doc-start":case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":case"newline":break e}for(;s[++e]?.type==="space";);return s.splice(e,s.length)}function ns(s,e){if(e.length<1e5)Array.prototype.push.apply(s,e);else for(let t=0;t<e.length;++t)s.push(e[t])}function $o(s){if(s.start.type==="flow-seq-start")for(let e of s.items)e.sep&&!e.value&&!se(e.start,"explicit-key-ind")&&!se(e.sep,"map-value-ind")&&(e.key&&(e.value=e.key),delete e.key,Do(e.value)?e.value.end?ns(e.value.end,e.sep):e.value.end=e.sep:ns(e.start,e.sep),delete e.sep)}var Un=class{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 hf.Lexer,this.onNewLine=e}*parse(e,t=!1){this.onNewLine&&this.offset===0&&this.onNewLine(0);for(let n of this.lexer.lex(e,t))yield*this.next(n);t||(yield*this.end())}*next(e){if(this.source=e,df.env.LOG_TOKENS&&console.log("|",Po.prettyToken(e)),this.atScalar){this.atScalar=!1,yield*this.step(),this.offset+=e.length;return}let t=Po.tokenType(e);if(t)if(t==="scalar")this.atNewLine=!1,this.atScalar=!0,this.type="scalar";else{switch(this.type=t,yield*this.step(),t){case"newline":this.atNewLine=!0,this.indent=0,this.onNewLine&&this.onNewLine(this.offset+e.length);break;case"space":this.atNewLine&&e[0]===" "&&(this.indent+=e.length);break;case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":this.atNewLine&&(this.indent+=e.length);break;case"doc-mode":case"flow-error-end":return;default:this.atNewLine=!1}this.offset+=e.length}else{let n=`Not a YAML token: ${e}`;yield*this.pop({type:"error",offset:this.offset,message:n,source:e}),this.offset+=e.length}}*end(){for(;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"){for(;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 n=this.peek(1);switch(t.type==="block-scalar"?t.indent="indent"in n?n.indent:0:t.type==="flow-collection"&&n.type==="document"&&(t.indent=0),t.type==="flow-collection"&&$o(t),n.type){case"document":n.value=t;break;case"block-scalar":n.props.push(t);break;case"block-map":{let i=n.items[n.items.length-1];if(i.value){n.items.push({start:[],key:t,sep:[]}),this.onKeyLine=!0;return}else if(i.sep)i.value=t;else{Object.assign(i,{key:t,sep:[]}),this.onKeyLine=!i.explicitKey;return}break}case"block-seq":{let i=n.items[n.items.length-1];i.value?n.items.push({start:[],value:t}):i.value=t;break}case"flow-collection":{let i=n.items[n.items.length-1];!i||i.value?n.items.push({start:[],key:t,sep:[]}):i.sep?i.value=t:Object.assign(i,{key:t,sep:[]});return}default:yield*this.pop(),yield*this.pop(t)}if((n.type==="document"||n.type==="block-map"||n.type==="block-seq")&&(t.type==="block-map"||t.type==="block-seq")){let i=t.items[t.items.length-1];i&&!i.sep&&!i.value&&i.start.length>0&&Lo(i.start)===-1&&(t.indent===0||i.start.every(r=>r.type!=="comment"||r.indent<t.indent))&&(n.type==="document"?n.end=i.start:n.items.push({start:i.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:[]};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":{Lo(e.start)!==-1?(yield*this.pop(),yield*this.step()):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);t?this.stack.push(t):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=ss(this.peek(2)),n=Ne(t),i;e.end?(i=e.end,i.push(this.sourceToken),delete e.end):i=[this.sourceToken];let r={type:"block-map",offset:e.offset,indent:e.indent,items:[{start:n,key:e,sep:i}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=r}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(`
|
|
134
|
+
`)+1;for(;t!==0;)this.onNewLine(this.offset+t),t=this.source.indexOf(`
|
|
135
|
+
`,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 n="end"in t.value?t.value.end:void 0;(Array.isArray(n)?n[n.length-1]:void 0)?.type==="comment"?n?.push(this.sourceToken):e.items.push({start:[this.sourceToken]})}else t.sep?t.sep.push(this.sourceToken):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 i=e.items[e.items.length-2]?.value?.end;if(Array.isArray(i)){ns(i,t.start),i.push(this.sourceToken),e.items.pop();return}}t.start.push(this.sourceToken)}return}if(this.indent>=e.indent){let n=!this.onKeyLine&&this.indent===e.indent,i=n&&(t.sep||t.explicitKey)&&this.type!=="seq-item-ind",r=[];if(i&&t.sep&&!t.value){let o=[];for(let a=0;a<t.sep.length;++a){let l=t.sep[a];switch(l.type){case"newline":o.push(a);break;case"space":break;case"comment":l.indent>e.indent&&(o.length=0);break;default:o.length=0}}o.length>=2&&(r=t.sep.splice(o[1]))}switch(this.type){case"anchor":case"tag":i||t.value?(r.push(this.sourceToken),e.items.push({start:r}),this.onKeyLine=!0):t.sep?t.sep.push(this.sourceToken):t.start.push(this.sourceToken);return;case"explicit-key-ind":!t.sep&&!t.explicitKey?(t.start.push(this.sourceToken),t.explicitKey=!0):i||t.value?(r.push(this.sourceToken),e.items.push({start:r,explicitKey:!0})):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(t.value)e.items.push({start:[],key:null,sep:[this.sourceToken]});else if(se(t.sep,"map-value-ind"))this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:r,key:null,sep:[this.sourceToken]}]});else if(Do(t.key)&&!se(t.sep,"newline")){let o=Ne(t.start),a=t.key,l=t.sep;l.push(this.sourceToken),delete t.key,delete t.sep,this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:o,key:a,sep:l}]})}else r.length>0?t.sep=t.sep.concat(r,this.sourceToken):t.sep.push(this.sourceToken);else if(se(t.start,"newline"))Object.assign(t,{key:null,sep:[this.sourceToken]});else{let o=Ne(t.start);this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:o,key:null,sep:[this.sourceToken]}]})}else t.sep?t.value||i?e.items.push({start:r,key:null,sep:[this.sourceToken]}):se(t.sep,"map-value-ind")?this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[],key:null,sep:[this.sourceToken]}]}):t.sep.push(this.sourceToken):Object.assign(t,{key:null,sep:[this.sourceToken]});this.onKeyLine=!0;return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{let o=this.flowScalar(this.type);i||t.value?(e.items.push({start:r,key:o,sep:[]}),this.onKeyLine=!0):t.sep?this.stack.push(o):(Object.assign(t,{key:o,sep:[]}),this.onKeyLine=!0);return}default:{let o=this.startBlockValue(e);if(o){if(o.type==="block-seq"){if(!t.explicitKey&&t.sep&&!se(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 n&&e.items.push({start:r});this.stack.push(o);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 n="end"in t.value?t.value.end:void 0;(Array.isArray(n)?n[n.length-1]:void 0)?.type==="comment"?n?.push(this.sourceToken):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 i=e.items[e.items.length-2]?.value?.end;if(Array.isArray(i)){ns(i,t.start),i.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;t.value||se(t.start,"seq-item-ind")?e.items.push({start:[this.sourceToken]}):t.start.push(this.sourceToken);return}if(this.indent>e.indent){let n=this.startBlockValue(e);if(n){this.stack.push(n);return}}yield*this.pop(),yield*this.step()}*flowCollection(e){let t=e.items[e.items.length-1];if(this.type==="flow-error-end"){let n;do yield*this.pop(),n=this.peek(1);while(n?.type==="flow-collection")}else if(e.end.length===0){switch(this.type){case"comma":case"explicit-key-ind":!t||t.sep?e.items.push({start:[this.sourceToken]}):t.start.push(this.sourceToken);return;case"map-value-ind":!t||t.value?e.items.push({start:[],key:null,sep:[this.sourceToken]}):t.sep?t.sep.push(this.sourceToken):Object.assign(t,{key:null,sep:[this.sourceToken]});return;case"space":case"comment":case"newline":case"anchor":case"tag":!t||t.value?e.items.push({start:[this.sourceToken]}):t.sep?t.sep.push(this.sourceToken):t.start.push(this.sourceToken);return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{let i=this.flowScalar(this.type);!t||t.value?e.items.push({start:[],key:i,sep:[]}):t.sep?this.stack.push(i):Object.assign(t,{key:i,sep:[]});return}case"flow-map-end":case"flow-seq-end":e.end.push(this.sourceToken);return}let n=this.startBlockValue(e);n?this.stack.push(n):(yield*this.pop(),yield*this.step())}else{let n=this.peek(2);if(n.type==="block-map"&&(this.type==="map-value-ind"&&n.indent===e.indent||this.type==="newline"&&!n.items[n.items.length-1].sep))yield*this.pop(),yield*this.step();else if(this.type==="map-value-ind"&&n.type!=="flow-collection"){let i=ss(n),r=Ne(i);$o(e);let o=e.end.splice(1,e.end.length);o.push(this.sourceToken);let a={type:"block-map",offset:e.offset,indent:e.indent,items:[{start:r,key:e,sep:o}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=a}else yield*this.lineEnd(e)}}flowScalar(e){if(this.onNewLine){let t=this.source.indexOf(`
|
|
136
|
+
`)+1;for(;t!==0;)this.onNewLine(this.offset+t),t=this.source.indexOf(`
|
|
137
|
+
`,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=ss(e),n=Ne(t);return n.push(this.sourceToken),{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:n,explicitKey:!0}]}}case"map-value-ind":{this.onKeyLine=!0;let t=ss(e),n=Ne(t);return{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:n,key:null,sep:[this.sourceToken]}]}}}return null}atIndentedComment(e,t){return this.type!=="comment"||this.indent<=t?!1:e.every(n=>n.type==="newline"||n.type==="space")}*documentEnd(e){this.type!=="doc-mode"&&(e.end?e.end.push(this.sourceToken):e.end=[this.sourceToken],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;default:e.end?e.end.push(this.sourceToken):e.end=[this.sourceToken],this.type==="newline"&&(yield*this.pop())}}};Mo.Parser=Un});var Bo=y(et=>{"use strict";var _o=In(),pf=Ve(),Ze=Ge(),mf=Os(),yf=C(),gf=Kn(),Ro=Yn();function Fo(s){let e=s.prettyErrors!==!1;return{lineCounter:s.lineCounter||e&&new gf.LineCounter||null,prettyErrors:e}}function Sf(s,e={}){let{lineCounter:t,prettyErrors:n}=Fo(e),i=new Ro.Parser(t?.addNewLine),r=new _o.Composer(e),o=Array.from(r.compose(i.parse(s)));if(n&&t)for(let a of o)a.errors.forEach(Ze.prettifyError(s,t)),a.warnings.forEach(Ze.prettifyError(s,t));return o.length>0?o:Object.assign([],{empty:!0},r.streamInfo())}function xo(s,e={}){let{lineCounter:t,prettyErrors:n}=Fo(e),i=new Ro.Parser(t?.addNewLine),r=new _o.Composer(e),o=null;for(let a of r.compose(i.parse(s),!0,s.length))if(!o)o=a;else if(o.options.logLevel!=="silent"){o.errors.push(new Ze.YAMLParseError(a.range.slice(0,2),"MULTIPLE_DOCS","Source contains multiple documents; please use YAML.parseAllDocuments()"));break}return n&&t&&(o.errors.forEach(Ze.prettifyError(s,t)),o.warnings.forEach(Ze.prettifyError(s,t))),o}function bf(s,e,t){let n;typeof e=="function"?n=e:t===void 0&&e&&typeof e=="object"&&(t=e);let i=xo(s,t);if(!i)return null;if(i.warnings.forEach(r=>mf.warn(i.options.logLevel,r)),i.errors.length>0){if(i.options.logLevel!=="silent")throw i.errors[0];i.errors=[]}return i.toJS(Object.assign({reviver:n},t))}function wf(s,e,t){let n=null;if(typeof e=="function"||Array.isArray(e)?n=e:t===void 0&&e&&(t=e),typeof t=="string"&&(t=t.length),typeof t=="number"){let i=Math.round(t);t=i<1?void 0:i>8?{indent:8}:{indent:i}}if(s===void 0){let{keepUndefined:i}=t??e??{};if(!i)return}return yf.isDocument(s)&&!n?s.toString(t):new pf.Document(s,n,t).toString(t)}et.parse=bf;et.parseAllDocuments=Sf;et.parseDocument=xo;et.stringify=wf});var Ko=y(O=>{"use strict";var vf=In(),kf=Ve(),Af=un(),Vn=Ge(),Nf=Te(),ne=C(),Ef=z(),Cf=T(),Of=ee(),qf=te(),Tf=es(),If=Bn(),Pf=Kn(),Lf=Yn(),is=Bo(),jo=Ee();O.Composer=vf.Composer;O.Document=kf.Document;O.Schema=Af.Schema;O.YAMLError=Vn.YAMLError;O.YAMLParseError=Vn.YAMLParseError;O.YAMLWarning=Vn.YAMLWarning;O.Alias=Nf.Alias;O.isAlias=ne.isAlias;O.isCollection=ne.isCollection;O.isDocument=ne.isDocument;O.isMap=ne.isMap;O.isNode=ne.isNode;O.isPair=ne.isPair;O.isScalar=ne.isScalar;O.isSeq=ne.isSeq;O.Pair=Ef.Pair;O.Scalar=Cf.Scalar;O.YAMLMap=Of.YAMLMap;O.YAMLSeq=qf.YAMLSeq;O.CST=Tf;O.Lexer=If.Lexer;O.LineCounter=Pf.LineCounter;O.Parser=Lf.Parser;O.parse=is.parse;O.parseAllDocuments=is.parseAllDocuments;O.parseDocument=is.parseDocument;O.stringify=is.stringify;O.visit=jo.visit;O.visitAsync=jo.visitAsync});var id={created:{date:"",user:""},lastModified:{date:"",user:""},contributors:[],approvals:[],pendingDecisions:[]},ot=()=>({version:"0.1.0",phase:"IDLE",spec:null,specDescription:null,branch:null,discovery:{answers:[],completed:!1,currentQuestion:0,audience:"human",approved:!1,planPath:null},specState:{path:null,status:"none",metadata:{created:{date:"",user:""},lastModified:{date:"",user:""},contributors:[],approvals:[],pendingDecisions:[]},placeholders:[]},execution:{iteration:0,lastProgress:null,modifiedFiles:[],lastVerification:null,awaitingStatusReport:!1,debt:null,completedTasks:[],debtCounter:0,naItems:[]},decisions:[],lastCalledAt:null,classification:null,completionReason:null,completedAt:null,completionNote:null,reopenedFrom:null,revisitHistory:[]}),na="npx eser@latest noskills",rd="claude-code",od="claude-sonnet-5",ad=(s,e,t,n)=>({concerns:s,tools:e,providers:t,project:n,maxIterationsBeforeRestart:15,verifyCommand:null,allowGit:!1,command:na}),ld=s=>"user"in s&&"timestamp"in s?s:{questionId:s.questionId,answer:s.answer,user:"Unknown User",email:"",timestamp:"",type:"original"};var Vo=["ui","api","data","migration"],Jo={ui:"involvesWebUI",api:"involvesPublicAPI",data:"involvesDataHandling",migration:"involvesMigration"},$f=["involvesWebUI","involvesCLI","involvesPublicAPI","involvesMigration","involvesDataHandling"],Df=new Set([".tsx",".jsx",".html",".css",".svelte",".vue"]),Mf=new Set([".ts",".go",".py",".rs"]),_f={ui:s=>Df.has(s),api:s=>Mf.has(s),data:()=>!0,migration:()=>!0},Rf=s=>typeof s=="string"&&Vo.includes(s),Oh=s=>typeof s=="string"?s:s.text,qh=s=>typeof s=="string"?[]:s.scope??[],Ff=(s,e)=>s.length===0||s.some(t=>e[Jo[t]]===!0),xf=s=>{let e=Math.max(s.lastIndexOf("/"),s.lastIndexOf("\\"))+1,t=s.lastIndexOf(".");return t>e?s.slice(t):""},Th=(s,e,t)=>{let n=xf(e);return s.some(i=>_f[i](n)&&(t===null||t[Jo[i]]===!0))},Ih=s=>s.scope.length>0||s.condition!==null,Ph=(s,e)=>Ff(s.scope,e)?s.condition===null?!0:$f.includes(s.condition)&&e[s.condition]===!0:!1,Jn=s=>s instanceof Object&&!Array.isArray(s),Uo=`expected a list of ${Vo.join(", ")}`,Yo=(s,e)=>{if(e===void 0)return null;if(!Array.isArray(e))return`${s}.scope is ${JSON.stringify(e)}; ${Uo}`;let t=e.find(n=>!Rf(n));return t===void 0?null:`${s}.scope has ${JSON.stringify(t)}; ${Uo}`},Wo=s=>{if(!Jn(s))return"the concern must be a JSON object";let e=s.reminders;if(Array.isArray(e))for(let[n,i]of e.entries()){let r=`reminders[${n}]`;if(typeof i=="string")continue;if(!Jn(i)||typeof i.text!="string")return`${r} must be a string or an object with a "text" string`;let o=Yo(r,i.scope);if(o!==null)return o}let t=s.specSections;if(Array.isArray(t))for(let[n,i]of t.entries()){if(!Jn(i))continue;let r=Yo(`specSections[${n}]`,i.scope);if(r!==null)return r}return null};var de=sa(Ko(),1);var Hn=s=>s instanceof zn?!0:s===null||typeof s!="object"?!1:s.code==="ENOENT",Go=new Set,st=(s,e)=>{if(Go.has(s))return;Go.add(s);let t=e instanceof Error?e.message:String(e);try{console.error(`noskills: WARNING \u2014 ${s} exists but could not be read (${t}). Treating it as empty; the previous contents are still on disk and have NOT been overwritten yet.`)}catch{}},V=async(s,e)=>{let t=s.lastIndexOf("/"),i=`${t===-1?".":s.slice(0,t)}/.${s.slice(t+1)}.${crypto.randomUUID()}.tmp`;try{await E.fs.writeTextFile(i,e),await E.fs.rename(i,s)}catch(r){try{await E.fs.remove(i)}catch{}throw r}},_=".eser",ie=`${_}/.state`,B=`${ie}/progresses`,Qn=`${B}/state.json`,jf=`${B}/ask-token.json`,as=`${_}/manifest.yml`,nt=`${_}/concerns`,Qo=`${_}/rules`,os=`${_}/specs`,Xo=`${_}/workflows`,it=`${B}/specs`,Kf=`${B}/active.json`,fe=`${ie}/sessions`,ls=`${ie}/events`,Uf=`${ls}/events.jsonl`,rs=`${B}/ledger`,Wn=`${B}/validations`,Yf=`${ie}/purge-history`,J={eserDir:_,stateDir:ie,progressesDir:B,stateFile:Qn,askTokenFile:jf,manifestFile:as,concernsDir:nt,rulesDir:Qo,specsDir:os,workflowsDir:Xo,specStatesDir:it,activeFile:Kf,specDir:s=>`${os}/${s}`,specFile:s=>`${os}/${s}/spec.md`,specStateFile:s=>`${it}/${s}.json`,concernFile:s=>`${nt}/${s}.json`,sessionsDir:fe,sessionFile:s=>`${fe}/${s}.json`,eventsDir:ls,eventsFile:Uf,ledgerDir:rs,ledgerRunDir:s=>`${rs}/${s}`,ledgerFile:s=>`${rs}/${s}/ledger.jsonl`,ledgerSummaryFile:s=>`${rs}/${s}/summary.json`,validationsDir:Wn,validationFile:s=>`${Wn}/${s}.json`,purgeHistoryDir:Yf,eserGitignore:`${_}/.gitignore`},Ho=async s=>{await ea(s);let e=`${s}/${Qn}`;try{let t=await E.fs.readTextFile(e),n=JSON.parse(t);return zo(n)}catch(t){return Hn(t)||st(e,t),ot()}},zo=s=>{let e=s.discovery;if(e==null)return s;let t=e.userContext,n;if(typeof t=="string"?n=t.length>0?[t]:[]:Array.isArray(t)?n=t:n=void 0,t===n)return s;let i={...e};return n===void 0?delete i.userContext:i.userContext=n,{...s,discovery:i}},Gn=class extends Error{specName;constructor(e,t,n){super(`Spec '${e}' not found. Run \`${t} spec list\` to see available specs.`,n),this.specName=e,this.name="SpecNotFoundError"}},$h=async(s,e,t)=>{if(e==null)return await Ho(s);let n=`${s}/${J.specDir(e)}`;try{await E.fs.stat(n)}catch(o){throw Hn(o)?new Gn(e,t,{cause:o}):new Error(`read spec directory ${n}`,{cause:o})}let i=await Zo(s,e);if(i.spec===e)return i;let r=await Ho(s);return r.spec===e?r:{...i,spec:e}};var Vf=s=>{if(s===void 0)return null;for(let e of s)if(e.startsWith("--spec="))return e.slice(7);return null},Dh=(s,e)=>{let t=Vf(s);return t===null||t.length===0?{ok:!1,error:`Error: spec name is required. Use \`${e} spec <name> <command>\` format.`}:{ok:!0,spec:t}},Jf=async(s,e)=>{let t=`${s}/${B}`,n=`${s}/${Qn}`;await E.fs.mkdir(t,{recursive:!0}),await V(n,JSON.stringify(e,null,2)+`
|
|
138
|
+
`)};var Zo=async(s,e)=>{let t=`${s}/${J.specStateFile(e)}`;try{let n=await E.fs.readTextFile(t),i=JSON.parse(n);return zo(i)}catch(n){return Hn(n)||st(t,n),ot()}},Wf=async(s,e,t)=>{let n=`${s}/${it}`,i=`${s}/${J.specStateFile(e)}`,r;try{r=await Zo(s,e)}catch{r=ot()}await E.fs.mkdir(n,{recursive:!0}),await V(i,JSON.stringify(t,null,2)+`
|
|
139
|
+
`);try{await(await import("./decision-ledger-5QXKZSV2.js")).captureTransition(s,r,t)}catch{}},Mh=async s=>{let e=`${s}/${it}`,t=[];try{for await(let n of E.fs.readDir(e)){if(!n.isFile||!n.name.endsWith(".json"))continue;let i=`${e}/${n.name}`;try{let r=await E.fs.readTextFile(i);t.push({name:n.name.replace(/\.json$/,""),state:JSON.parse(r)})}catch(r){st(i,r)}}}catch{}return t},_h=async s=>{let e=`${s}/${as}`;try{let t=await E.fs.readTextFile(e),n=de.parse(t);return n?.noskills===void 0?null:n.noskills}catch{return null}},Rh=async(s,e)=>{let t=`${s}/${as}`,n;try{let r=await E.fs.readTextFile(t);n=de.parseDocument(r)}catch{n=new de.Document({})}let i=n.createNode(e);i.commentBefore=" noskills orchestrator \u2014 inline comments in this section won't be preserved on next write",n.set("noskills",i),await V(t,n.toString())},Fh=async(s,e)=>{let t=`${s}/${J.concernFile(e)}`;try{let n=await E.fs.readTextFile(t);return JSON.parse(n)}catch{return null}},xh=async(s,e)=>{let t=`${s}/${nt}`,n=`${s}/${J.concernFile(e.id)}`;await E.fs.mkdir(t,{recursive:!0}),await V(n,JSON.stringify(e,null,2)+`
|
|
140
|
+
`)},Bh=async s=>{let e=`${s}/${nt}`,t=[];try{for await(let n of E.fs.readDir(e)){if(!n.isFile||!n.name.endsWith(".json"))continue;let i=`${e}/${n.name}`;try{let r=await E.fs.readTextFile(i),o=JSON.parse(r),a=Wo(o);if(a!==null){st(i,new Error(`${a}; see README-HOW.md#where-content-applies-scope`));continue}t.push(o)}catch(r){st(i,r)}}}catch{}return t},ea=async s=>{let e=`${s}/${ie}/state.json`,t=`${s}/${_}/.sessions`,n=`${s}/${_}/.events`,i=await ta(e),r=await tt(t),o=await tt(n);if(!i&&!r&&!o)return!1;if(i){let u=`${s}/${B}`;if(await tt(u))throw new Error(`noskills: partial migration detected \u2014 both ${e} (file) and ${u} (dir) exist. Resolve manually before continuing.`)}let a=[{present:r,from:t,to:`${s}/${fe}`},{present:o,from:n,to:`${s}/${ls}`}];for(let u of a)if(u.present&&!await Gf(u.to))throw new Error(`noskills: partial migration detected \u2014 both ${u.from} (dir) and ${u.to} (dir) exist. Resolve manually before continuing.`);let l=`${s}/${ie}`,c=`${l}/.progresses-tmp`,h=`${s}/${B}`;if(i){await E.fs.mkdir(c,{recursive:!0});for await(let u of E.fs.readDir(l))u.name===".progresses-tmp"||u.name==="progresses"||u.name==="sessions"||u.name==="events"||u.name==="purge-history"||await E.fs.rename(`${l}/${u.name}`,`${c}/${u.name}`);await E.fs.rename(c,h)}for(let u of a)u.present&&(await E.fs.mkdir(l,{recursive:!0}),await tt(u.to)&&await E.fs.remove(u.to,{recursive:!0}),await E.fs.rename(u.from,u.to));let f=`${s}/${J.eserGitignore}`;try{let u=await E.fs.readTextFile(f);(u.includes(".sessions/")||u.includes(".events/"))&&await V(f,`# eser toolchain runtime state \u2014 not tracked by git
|
|
141
|
+
.state/
|
|
142
|
+
`)}catch{}return console.error("noskills: migrated .eser/ runtime layout to .eser/.state/{progresses,sessions,events}/"),!0},Gf=async s=>{if(!await tt(s))return!await ta(s);for await(let e of E.fs.readDir(s))return!1;return!0},ta=async s=>{try{return(await E.fs.stat(s)).isFile===!0}catch{return!1}},tt=async s=>{try{return(await E.fs.stat(s)).isDirectory===!0}catch{return!1}},jh=async s=>{await ea(s);let e=[_,ie,B,it,fe,ls,nt,Qo,os,Xo];await Promise.all(e.map(n=>E.fs.mkdir(`${s}/${n}`,{recursive:!0})));let t=`${s}/${J.eserGitignore}`;try{await E.fs.stat(t)}catch{await V(t,`# eser toolchain runtime state \u2014 not tracked by git
|
|
143
|
+
.state/
|
|
144
|
+
`)}},Kh=async(s,e)=>{await Jf(s,e),e.spec!==null&&await Wf(s,e.spec,e)},Uh=async(s,e)=>{try{let t=await E.fs.readTextFile(`${s}/${J.validationFile(e)}`);return JSON.parse(t)}catch{return null}},Yh=async(s,e,t)=>{await E.fs.mkdir(`${s}/${Wn}`,{recursive:!0}),await V(`${s}/${J.validationFile(e)}`,JSON.stringify(t,null,2)+`
|
|
145
|
+
`)},Hf=7200*1e3,Qf=/^[A-Za-z0-9_-]{1,64}$/,cs=s=>Qf.test(s),us=(s,e)=>{if(!cs(e))throw new Error(`Invalid session id: ${JSON.stringify(e)}`);return`${s}/${fe}/${e}.json`},Vh=async(s,e)=>{let t=us(s,e.id);await E.fs.mkdir(`${s}/${fe}`,{recursive:!0}),await V(t,JSON.stringify(e,null,2)+`
|
|
146
|
+
`)},Xf=async(s,e)=>{if(!cs(e))return null;try{let t=await E.fs.readTextFile(us(s,e)),n=JSON.parse(t);return n.id===e?n:null}catch{return null}},zf=async s=>{let e=`${s}/${fe}`,t=[];try{for await(let n of E.fs.readDir(e))if(n.isFile&&n.name.endsWith(".json")){let i=n.name.slice(0,-5);if(!cs(i))continue;try{let r=await E.fs.readTextFile(`${e}/${n.name}`),o=JSON.parse(r);if(o.id!==i)continue;t.push(o)}catch{}}}catch{}return t},Zf=async(s,e)=>{if(!cs(e))return!1;try{return await E.fs.remove(us(s,e)),!0}catch{return!1}},Jh=async(s,e,t)=>{let n=await Xf(s,e);if(n===null)return;let i={...n,phase:t,lastActiveAt:new Date().toISOString()};await V(us(s,e),JSON.stringify(i,null,2)+`
|
|
147
|
+
`)},Wh=async s=>{let e=await zf(s),t=Date.now(),n=e.filter(i=>td(i,t));return await Promise.all(n.map(i=>Zf(s,i.id))),n.map(i=>i.id)},ed=(s,e=Date.now())=>{let t=s.lastActiveAt;if(typeof t!="string")return null;let n=new Date(t).getTime();return Number.isNaN(n)?null:e-n},td=(s,e=Date.now())=>{let t=ed(s,e);return t===null||t>Hf},Gh=()=>{let s=new Uint8Array(4);return crypto.getRandomValues(s),Array.from(s).map(e=>e.toString(16).padStart(2,"0")).join("")},Hh=async s=>{try{let e=await E.fs.readTextFile(`${s}/${as}`);return de.parse(e)?.noskills!==void 0}catch{return!1}},sd=s=>{let e=s.includes("\\")?"\\":"/",t=s.split(e).filter(n=>n!=="");return t.length<=1?s.startsWith("/")?"/":s:(t.pop(),(s.startsWith("/")?"/":"")+t.join(e))},nd=async s=>{let e=s;for(let t=0;t<100;t++){try{return await E.fs.stat(`${e}/${_}`),e}catch{}let n=sd(e);if(n===e)return null;e=n}return null},Qh=async()=>{let s=E.process.cwd(),e=E.env.get("NOSKILLS_PROJECT_ROOT")??null;if(e!==null)try{return await E.fs.stat(`${e}/${_}`),{root:e,found:!0}}catch{}let t=await nd(s);return t!==null?{root:t,found:!0}:e!==null?{root:e,found:!1}:{root:s,found:!1}};export{id as a,ot as b,na as c,rd as d,od as e,ad as f,ld as g,Ko as h,Rf as i,Oh as j,qh as k,Ff as l,Th as m,Ih as n,Ph as o,Wo as p,V as q,J as r,Ho as s,Gn as t,$h as u,Vf as v,Dh as w,Jf as x,Zo as y,Wf as z,Mh as A,_h as B,Rh as C,Fh as D,xh as E,Bh as F,jh as G,Kh as H,Uh as I,Yh as J,Vh as K,Xf as L,zf as M,Zf as N,Jh as O,Wh as P,ed as Q,td as R,Gh as S,Hh as T,Qh as U};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{C as c}from"./chunk-M4U4Y3XQ.js";var l=".eser/learnings.jsonl",f=async(s,e)=>{let r=`${s}/${l}`,t=JSON.stringify(e)+`
|
|
2
2
|
`,o="";try{o=await c.fs.readTextFile(r)}catch{}await c.fs.writeTextFile(r,o+t)},y=async s=>{let e=`${s}/${l}`,r;try{r=await c.fs.readTextFile(e)}catch{return[]}return r.trim().split(`
|
|
3
3
|
`).filter(t=>t.length>0).map(t=>{try{return JSON.parse(t)}catch{return null}}).filter(t=>t!==null)},m=async(s,e)=>{let r=await y(s);if(e<0||e>=r.length)return!1;let t=r.filter((a,i)=>i!==e),o=`${s}/${l}`,n=t.map(a=>JSON.stringify(a)).join(`
|
|
4
4
|
`)+(t.length>0?`
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{e as a}from"./chunk-YN3SHWBR.js";import{e as y}from"./chunk-CL55MNGD.js";var u=(o,t)=>{let e=o.jsonSchema;if(e===void 0)throw new a('response format "json_schema" has no jsonSchema; set jsonSchema to a JSON Schema object',{provider:t});if(e===null||typeof e!="object"||Array.isArray(e))throw new a('response format "json_schema" has a jsonSchema that is not an object; set jsonSchema to a JSON Schema object',{provider:t});return e},d=o=>{let t=[];for(let e of o.content)e.kind==="text"&&t.push(e.text);return t.join("")},m=o=>y(o,d),g=o=>{let t=[];for(let e of o.content)e.kind==="tool_call"&&t.push(e.toolCall);return t},k=async(o,t="unknown")=>{let e=[],r=[],s="",l="end_turn",i={inputTokens:0,outputTokens:0,totalTokens:0};for await(let n of o)switch(n.kind){case"content_delta":{s+=n.textDelta;break}case"tool_call_delta":{n.toolCall!==void 0&&r.push({kind:"tool_call",toolCall:n.toolCall});break}case"thinking":{e.push({kind:"thinking",thinking:n.thinking});break}case"message_done":{l=n.stopReason,i=n.usage;break}case"error":throw n.error}return s.length>0&&r.unshift({kind:"text",text:s}),{content:[...e,...r],stopReason:l,usage:i,modelId:t}};export{u as a,d as b,m as c,g as d,k as e};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as f,c as w,d as l,g as y,h as x}from"./chunk-C5LYQDQH.js";import{i as g}from"./chunk-AW3XJGEP.js";import{B as d}from"./chunk-SWP6BJR6.js";import{C as i,n as m}from"./chunk-M4U4Y3XQ.js";var h=5e3,W=t=>`${t}/${f}`,P=async t=>{try{let e=await i.fs.stat(t);return e.isFile&&e.mode!==null&&(e.mode&73)!==0}catch{return!1}},R=async t=>{try{return await i.fs.realPath(t)}catch{return t}},E=async(t,e)=>{let s=await R(e);for(let r of t.split(":")){if(!r.startsWith("/"))continue;let n=await R(r);if(r===e||n===s)continue;let o=`${r}/git`;if(await P(o))return o}return null},p=async(t,e,s)=>{let r=await i.exec.spawn(t,[...e,"rev-parse","--path-format=absolute","--git-common-dir"],{cwd:s,stdin:"null",stdout:"piped",stderr:"null",signal:AbortSignal.timeout(h)});if(!r.success)return null;let n=new TextDecoder().decode(r.stdout).trim();return n===""?null:n},S=async(t,e,s={})=>{if(m()==="windows")return null;let r=W(t),n=await E(i.env.get("PATH")??"",r);if(n===null)return null;let o=await p(n,[],t)??`${await i.fs.realPath(t)}/.git`,a=x({realGit:n,projectGitDir:o,projectRoot:t,commandPrefix:e,checkTimeoutSeconds:s.checkTimeoutSeconds});await i.fs.mkdir(r,{recursive:!0});let u=`${r}/git`,c=`${r}/.git.${crypto.randomUUID()}.tmp`;try{await i.fs.writeTextFile(c,a,{mode:493}),await i.fs.chmod(c,493),await i.fs.rename(c,u)}catch(G){try{await i.fs.remove(c)}catch{}throw G}return{binDir:r,realGit:n}},F=async(t,e)=>{let s=y(e),r="";try{r=await i.fs.readTextFile(t)}catch{}r.includes(s)||await i.fs.writeTextFile(t,s,{append:!0})},I=async(t,e)=>{if((await d(e.root))?.allowGit===!0)return null;let r=w(t);if(r==="read"||r==="clone")return null;if(r==="push")return l(t);let{globalOptions:n,subcommand:o}=g(t);if(o.startsWith("-"))return l(t);let[a,u]=await Promise.all([p(e.realGit,n,e.cwd),p(e.realGit,[],e.root)]);return a!==null&&a===u?l(t):null};export{W as a,E as b,S as c,F as d,I as e};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{c}from"./chunk-XTQFSF6C.js";var a=[{id:"status_quo",text:"What does the user do today without this feature?",concerns:["product:status_quo","eng:replace_scope","qa:regression_risk"]},{id:"ambition",text:"Describe the 1-star and 10-star versions.",concerns:["product:scope_direction","eng:complexity_tier","qa:test_depth"]},{id:"reversibility",text:"Does this change involve an irreversible decision?",concerns:["product:one_way_door","eng:migration_strategy","qa:verification_stringency"]},{id:"user_impact",text:"Does this change affect existing users' behavior?",concerns:["product:breaking_change","eng:backward_compat","qa:regression_tests"]},{id:"verification",text:"How do you verify this works correctly?",concerns:["product:success_metric","eng:test_strategy","qa:acceptance_criteria"]},{id:"scope_boundary",text:"What should this feature NOT do?",concerns:["product:focus","eng:out_of_scope","qa:negative_tests"]}],d=[{questionId:"verification",text:"What tests should be written? (unit, integration, e2e \u2014 be specific about what behavior to test)"},{questionId:"verification",text:"What documentation needs updating? (README, API docs, CHANGELOG, inline comments)"}],l=s=>a.map(e=>{let t=d.filter(r=>r.questionId===e.id),n=c(s,e.id);return{...e,extras:[...t,...n]}}),y=(s,e)=>{let t=new Set(e.map(n=>n.questionId));for(let n of s)if(!t.has(n.id))return n;return null},u=s=>{let e=new Set(s.map(t=>t.questionId));return a.every(t=>e.has(t.id))},o=class extends Error{constructor(e){super(e),this.name="DiscoveryAnswerError"}},p=s=>{let e;try{e=JSON.parse(s)}catch{return null}if(typeof e!="object"||e===null||Array.isArray(e))return null;let t=a.map(r=>r.id),n={};for(let[r,i]of Object.entries(e)){if(!t.includes(r))throw new o(`Cannot record the discovery answers: "${r}" is not a question id. Key each answer by one of: ${t.join(", ")}.`);if(typeof i!="string")throw new o(`Cannot record the discovery answers: the answer to "${r}" is not a string. Send each answer as text.`);i.length>0&&(n[r]=i)}if(Object.keys(n).length===0)throw new o(`Cannot record the discovery answers: the object holds no answer. Key each answer by one of: ${t.join(", ")}.`);return n},g=s=>{let e=s.discovery,t=s.specDescription,n=typeof t=="string"&&t.length>0;return e.mode===void 0&&n&&e.answers.length===0&&e.planPath===null?e.userContext!==void 0&&e.userContext.length>0?"mode":"listen":e.mode!==void 0&&e.premisesCompleted!==!0&&!u(e.answers)?"premises":"questions"};export{a,l as b,y as c,u as d,o as e,p as f,g};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import{a as E,c as C,e as T}from"./chunk-ZAY6LSJD.js";import{C as B,D as O,n as _}from"./chunk-M4U4Y3XQ.js";import{n as q}from"./chunk-ZW5C5IGT.js";var R=class extends Error{command;code;stderr;constructor(e,r,n,s){super(e),this.name="CommandError",this.command=r,this.code=n,this.stderr=s}},x=class extends Error{command;constructor(e,r,n){super(e,n),this.name="CommandRunError",this.command=r}};var G=null,W=null,I=null,z=()=>(G===null&&(G=q({wasm:!1}).then(t=>(W=t,t),t=>(I=t instanceof Error?t:new Error(String(t)),null))),G),K=()=>W,X=()=>I!==null?`
|
|
2
|
+
Cause: ${I.message}`:"";var Q=t=>{let e=new Uint8Array(t.reduce((n,s)=>n+s.length,0)),r=0;for(let n of t)e.set(n,r),r+=n.length;return e},H=async t=>{let e=[],r=t.getReader();try{for(;;){let{done:n,value:s}=await r.read();if(n)break;s&&e.push(s)}}finally{r.releaseLock()}return e},M=(t,e)=>{let r=t.stream("shellExecStream",{command:e.command,args:e.args??[],cwd:e.cwd??"",env:e.env??[]}),n=r.opened;if(n.error!==void 0)throw new Error(n.error);let s=r.handle,o=n.pid,d=!1,l=()=>d?-1:(d=!0,r.close().code??-1),u,m=new Promise(i=>{u=i}),b,g,y=!1,P=i=>{y||(y=!0,u({success:i===0,code:i}),b.close(),g.close())},c={stdout:0,stderr:0},f=i=>{y||(y=!0,b.error(i),g.error(i))},v=async()=>{if(y)return;let i;try{i=await r.read()}catch(p){f(p instanceof Error?p:new Error(String(p)));return}if(y)return;if(i===null){P(l());return}if(i.error!==void 0){f(new Error(i.error));return}let w=Uint8Array.from(atob(i.chunk??""),p=>p.charCodeAt(0));i.stream==="stderr"?(c.stderr+=1,g.enqueue(w)):(c.stdout+=1,b.enqueue(w))},a=Promise.resolve(),h=i=>{let w=async()=>{let ne=c[i];for(;!y&&c[i]===ne;)await v()},p=a.then(w);return a=p.catch(()=>{}),p},S=new ReadableStream({start(i){b=i},pull(){return h("stdout")}}),j=new ReadableStream({start(i){g=i},pull(){return h("stderr")}}),re=new WritableStream({write(i){let w=btoa(String.fromCharCode(...i)),p=t.call("shellExecWrite",{handle:s,data:w});if(p.error!==void 0)throw new Error(p.error)}});return{pid:o,stdin:re,stdout:S,stderr:j,status:m,async output(){let[i,w]=await Promise.all([H(S),H(j)]);return{...await m,stdout:Q(i),stderr:Q(w)}},kill(i){let w=l();P(w)}}};var U=600*1e3,J=2147483647,F=t=>{if(!Number.isFinite(t)||t<=0||t>J)throw new RangeError(`timeout ${t} ms is out of range: pass milliseconds above 0 and at most ${J} (about 24.8 days), such as 30_000, or leave the timeout unset for the default`);return Math.ceil(t)},$=t=>t!==void 0?Object.entries(t).map(([e,r])=>`${e}=${r}`):void 0,Y=(t,e)=>({command:t,args:e.args,cwd:e.cwd,env:$(e.env),stdin:e.stdin,timeout:`${F(e.timeout??U)}ms`}),Z=async(t,e)=>{let r=await t.call("shellExec",e);if(r.error!==void 0&&r.error!=="")throw new x(`run ${e.command}: ${r.error}`,e.command);return{stdout:r.stdout??"",stderr:r.stderr??"",code:r.code}};var V=new TextEncoder,A=new TextDecoder,L=class t{#t;#r;#e;constructor(e,r=[],n={}){this.#t=e,this.#r=r,this.#e={throwOnError:!0,stdout:"piped",stderr:"piped",...n,timeout:n.timeout!==void 0?F(n.timeout):void 0}}cwd(e){return new t(this.#t,this.#r,{...this.#e,cwd:e})}env(e,r){let n=this.#e.env??{},s;return typeof e=="string"&&r!==void 0?s={...n,[e]:r}:e!==null&&typeof e=="object"?s={...n,...e}:s=n,new t(this.#t,this.#r,{...this.#e,env:s})}stdin(e){return new t(this.#t,this.#r,{...this.#e,stdin:e})}stdinText(e){return new t(this.#t,this.#r,{...this.#e,stdin:"piped",stdinText:e})}stdout(e){return new t(this.#t,this.#r,{...this.#e,stdout:e})}stderr(e){return new t(this.#t,this.#r,{...this.#e,stderr:e})}timeout(e){return new t(this.#t,this.#r,{...this.#e,timeout:e})}noThrow(){return new t(this.#t,this.#r,{...this.#e,throwOnError:!1})}quiet(){return new t(this.#t,this.#r,{...this.#e,stdout:"null",stderr:"null"})}printCommand(){let e=[this.#t,...this.#r].join(" ");return console.log(`$ ${e}`),this}async spawn(){let e=this.#e.stdin==="inherit"||this.#e.stdout==="inherit"||this.#e.stderr==="inherit";if(!e&&this.#e.stdin!=="piped"){let r=await z();if(r!==null)return await this.#i(r)}return await this.#o(e)}async#i(e){let r=await Z(e,Y(this.#t,{args:this.#r,cwd:this.#e.cwd,env:this.#e.env,timeout:this.#e.timeout}));return this.#s({code:r.code,success:r.code===0,stdout:V.encode(r.stdout),stderr:V.encode(r.stderr)},r.stderr)}async#o(e){let{runtime:r}=O,n=this.#e.timeout??(e?void 0:U),s=n!==void 0?new AbortController:void 0,o=s!==void 0?setTimeout(()=>s.abort(),n):void 0,d=()=>s?.signal.aborted===!0,l;try{l=await r.exec.spawn(this.#t,this.#r,this.#a(s?.signal))}catch(u){throw n!==void 0&&d()?this.#n(n,u):new x(`run ${this.#t}: ${u instanceof Error?u.message:String(u)}`,this.#t,{cause:u})}finally{clearTimeout(o)}if(n!==void 0&&!l.success&&d())throw this.#n(n);return this.#s(l,A.decode(l.stderr))}#a(e){return{cwd:this.#e.cwd,env:this.#e.env,stdin:this.#e.stdin,stdinText:this.#e.stdinText,stdout:this.#e.stdout,stderr:this.#e.stderr,signal:e}}#n(e,r){return new x(`run ${this.#t}: the command ran past its ${e} ms timeout and was stopped; pass a larger value to timeout() to allow more time`,this.#t,r!==void 0?{cause:r}:void 0)}#s(e,r){if(!e.success&&this.#e.throwOnError===!0)throw new R(`Command failed with exit code ${e.code}: ${this.#t}`,this.#t,e.code,r);return e}async text(e="stdout"){let r=await this.spawn();switch(e){case"stdout":return A.decode(r.stdout).trim();case"stderr":return A.decode(r.stderr).trim();case"combined":return(A.decode(r.stdout)+A.decode(r.stderr)).trim()}}async json(){let e=await this.text();return JSON.parse(e)}async lines(){let e=await this.text();return e===""?[]:e.split(`
|
|
3
|
+
`)}async bytes(){return(await this.spawn()).stdout}async code(){return(await this.noThrow().spawn()).code}pipe(e){throw new Error("exec(...).pipe() is not implemented. It previously discarded the upstream output instead of writing it to the next command's stdin, so results were silently wrong. Build the pipeline with .child() and pipe the streams yourself: const a = exec`...`.child(); const b = exec`...`.child(); await a.stdout.pipeTo(b.stdin);")}child(){let e=K()??C();if(e===null){let n=X();throw new Error("@eserstack/ajan native library is not available: exec.child() requires the native library (the WASM fallback does not serve shell functions)"+(n!==""?n:T()))}let r=$(this.#e.env);return M(e,{command:this.#t,args:this.#r,cwd:this.#e.cwd,env:r})}};var N=(t,e)=>{let r=[];for(let s=0;s<t.length;s++){let o=t[s];if(o!==void 0&&r.push(o),s<e.length){let d=e[s];Array.isArray(d)?r.push(d.map(l=>ee(String(l))).join(" ")):d!=null&&r.push(ee(String(d)))}}let n=r.join("").trim();return ae(n)},ee=t=>t===""?"''":/[\s"'\\$`]/.test(t)?`'${t.replace(/'/g,"'\\''")}'`:t,ae=t=>{let e=[],r="",n=!1,s=!1,o=!1,d=!1;for(let u=0;u<t.length;u++){let m=t[u];if(o){r+=m,o=!1;continue}if(m==="\\"&&!n){o=!0;continue}if(m==="'"&&!s){n=!n,d=!0;continue}if(m==='"'&&!n){s=!s,d=!0;continue}if(m===" "&&!n&&!s){d&&(e.push(r),r="",d=!1);continue}r+=m,d=!0}d&&e.push(r);let l=e[0];return l===void 0?["",[]]:[l,e.slice(1)]};var ce=(t,...e)=>{let[r,n]=N(t,e);return new L(r,n)};var le=async()=>{await E();let t=C();if(t===null)throw new Error("@eserstack/ajan native library is not available \u2014 shellPtyStream requires the native library (the WASM fallback does not serve shell functions)"+T());return t},ue=t=>{let e="";for(let r of t)e+=String.fromCharCode(r);return btoa(e)},me=t=>Uint8Array.from(atob(t),e=>e.charCodeAt(0)),te=async t=>{let e=await le(),r=Object.entries({...t.env,TERM:"xterm-256color",COLUMNS:String(t.cols??80),LINES:String(t.rows??24)}).map(([a,h])=>`${a}=${h}`),n=e.stream("shellPtyStream",{command:t.command,args:t.args??[],cwd:t.cwd??"",env:r,cols:t.cols??80,rows:t.rows??24}),s=n.opened;if(s.error!==void 0)throw new Error(s.error);let o=n.handle,d=s.pid??-1,l=new TextDecoder,u=new TextEncoder,m=[],b=!1,g,y=new Promise(a=>{g=a}),P=()=>{if(b)return;b=!0;let a=l.decode();if(a.length>0)for(let S of m)S(a);let h=-1;try{h=n.close().code??-1}catch{}g(h)},c=async()=>{try{for(;;){let a;try{a=await n.read()}catch{break}if(a===null||a.error!==void 0)break;if(a.chunk!==void 0&&a.chunk.length>0){let h=l.decode(me(a.chunk),{stream:!0});for(let S of m)S(h)}}}finally{P()}},f=!1,v=()=>{f||(f=!0,c())};return{onData(a){m.push(a),v()},write(a){try{e.call("shellPtyWrite",{handle:o,data:ue(u.encode(a))})}catch{}},resize(a,h){try{e.call("shellPtyResize",{handle:o,cols:a,rows:h})}catch{}},kill(a){try{e.call("shellPtyKill",{handle:o,signal:a??"SIGTERM"})}catch{}v()},get pid(){return d},get exitCode(){return y}}};var pe=/\x04/g,ye=/^Script (started|done),? ?(output file is )?[^\n]*\n?/gm,he=/^script: tcgetattr[^\n]*\n?/gm,ge=t=>t.replace(pe,"").replace(ye,"").replace(he,""),we=(t,e)=>{let r=_();if(r==="darwin"){let n=e.map(o=>`'${o.replace(/'/g,"'\\''")}'`);return{cmd:"sh",args:["-c",`script -q /dev/null ${[t,...n].join(" ")} 2>/dev/null`],usesScript:!0}}return r==="linux"?{cmd:"sh",args:["-c",`script -qc '${(e.length>0?`${t} ${e.map(s=>`'${s.replace(/'/g,"'\\''")}'`).join(" ")}`:t).replace(/'/g,"'\\''")}' /dev/null 2>/dev/null`],usesScript:!0}:{cmd:t,args:e,usesScript:!1}},be=async t=>{let e;try{e=B.env.get("ESERSTACK_PTY")}catch{}let r=!1;if(e!=="script")try{await E(),r=C()!==null}catch{r=!1}return r?await te(t):await ve(t)},ve=async t=>{let{runtime:e}=O,r=t.args!==void 0?[...t.args]:[],n=we(t.command,r),s={...t.env,TERM:"xterm-256color",COLUMNS:String(t.cols??80),LINES:String(t.rows??24)},o=e.exec.spawnChild(n.cmd,[...n.args],{cwd:t.cwd,env:s,stdin:"piped",stdout:"piped",stderr:"piped"}),d=new TextDecoder,l=new TextEncoder,u=[],m=!1,b=c=>{let f=n.usesScript?ge(c):c;if(f.length!==0)for(let v of u)v(f)},g=async c=>{let f=c.getReader();try{for(;;){let{done:v,value:a}=await f.read();if(v)break;b(d.decode(a))}}catch{}finally{f.releaseLock()}},y=()=>{m||(m=!0,o.stdout&&g(o.stdout),o.stderr&&g(o.stderr))},P=null;return o.stdin&&(P=o.stdin.getWriter()),{onData(c){u.push(c),y()},write(c){P?.write(l.encode(c)).catch(()=>{})},resize(c,f){},kill(c){try{o.kill(c==="SIGKILL"?"SIGKILL":"SIGTERM")}catch{}},get pid(){return o.pid},get exitCode(){return o.status.then(c=>c.code)}}};export{R as a,L as b,ce as c,be as d};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{C as c}from"./chunk-M4U4Y3XQ.js";var y=e=>e.split(`
|
|
2
|
+
`).map(r=>r.replace(/^[-*]\s+/,"").trim()).filter(r=>r.length>0&&!r.startsWith("#")),k=async(e,r)=>{let o=r.startsWith(e)?r.slice(e.length+1):r,t=[],l=!1;for(let n of o.split("/").slice(0,-1))if(!(n===""||n===".")){if(n===".."){if(t.length===0){l=!0;break}t.pop();continue}t.push(n)}l&&(t.length=0);let i=Array.from({length:t.length+1},(n,a)=>t.length-a);return(await Promise.all(i.map(async n=>{let u=`${n===0?e:`${e}/${t.slice(0,n).join("/")}`}/.folder-rules.md`,p=n===0?".":t.slice(0,n).join("/");try{let f=await c.fs.readTextFile(u);return y(f).map(g=>({folder:p,rule:g}))}catch{return[]}}))).flat()},h=async(e,r)=>{let o=new Set,t=[];for(let l of r){let i=await k(e,l);for(let s of i){let n=`${s.folder}::${s.rule}`;o.has(n)||(o.add(n),t.push(s))}}return t};var d=e=>typeof e=="object"&&e!==null&&!Array.isArray(e),m=e=>!d(e)||typeof e.stepId!="string"?null:{stepId:e.stepId,match:e.match==="modified"?"modified":"exact",...typeof e.originalQuestion=="string"?{originalQuestion:e.originalQuestion}:{},...typeof e.askedQuestion=="string"?{askedQuestion:e.askedQuestion}:{}},T=(e,r,o)=>{let t;try{t=JSON.parse(e)}catch{return null}if(!d(t)||(typeof t.spec=="string"?t.spec:null)!==r)return null;let i=typeof t.createdAt=="string"?new Date(t.createdAt).getTime():Number.NaN,s=o-i;return!Number.isFinite(s)||s<0||s>18e5?null:(Array.isArray(t.steps)?t.steps:[t]).map(m).filter(a=>a!==null)};export{h as a,T as b};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{h as k,i as x}from"./chunk-GCPGG4YB.js";import{a as R}from"./chunk-T2X4E35X.js";import{a as b,k as w}from"./chunk-YN3SHWBR.js";import{a as y,b as _}from"./chunk-CL55MNGD.js";var f=class{capabilities=["text_generation","streaming","tool_calling","vision","batch_processing","structured_output","reasoning"];provider="anthropic";modelId;client;config;constructor(e,n){this.client=e,this.config=n,this.modelId=n.model}async generateText(e,n){try{let r=p(this.config,e),o=await this.client.messages.create(r,{signal:n,timeout:this.config.requestTimeoutMs});return y(T(o,this.modelId))}catch(r){return _(c(r))}}async*streamText(e,n){try{let r=p(this.config,e),o=await this.client.messages.create({...r,stream:!0},{signal:n,timeout:this.config.requestTimeoutMs}),a=null,i=null,d="",l=null,m=0,g=0;for await(let s of o)if(s.type==="message_start")m=s.message?.usage?.input_tokens??0;else if(s.type==="content_block_start")if(s.content_block?.type==="tool_use")a=s.content_block.id??null,i=s.content_block.name??null,d="";else{let u=D(s.content_block);l=u===null?null:{text:u.text,signature:u.signature??"",redactedData:u.redactedData??null}}else if(s.type==="content_block_delta")s.delta?.type==="text_delta"?yield{kind:"content_delta",textDelta:s.delta.text}:s.delta?.type==="input_json_delta"?(d+=s.delta.partial_json??"",yield{kind:"tool_call_delta",textDelta:s.delta.partial_json}):s.delta?.type==="thinking_delta"&&l!==null?l.text+=s.delta.thinking??"":s.delta?.type==="signature_delta"&&l!==null&&(l.signature+=s.delta.signature??"");else if(s.type==="content_block_stop"){if(l!==null&&(yield{kind:"thinking",thinking:J(l)},l=null),a!==null&&i!==null){let u={};if(d!=="")try{u=JSON.parse(d)}catch{}yield{kind:"tool_call_delta",toolCall:{id:a,name:i,arguments:u}},a=null,i=null,d=""}}else s.type==="message_delta"&&(g=s.usage?.output_tokens??g,yield{kind:"message_done",stopReason:B(s.delta?.stop_reason),usage:{inputTokens:m,outputTokens:g,totalTokens:m+g}})}catch(r){yield{kind:"error",error:c(r)}}}async submitBatch(e,n){try{let r=e.items.map(a=>({custom_id:a.customId,params:p(this.config,a.options)})),o=await this.client.beta.messages.batches.create({requests:r},{signal:n});return h(o)}catch(r){throw c(r)}}async getBatchJob(e,n){try{let r=await this.client.beta.messages.batches.retrieve(e,{signal:n});return h(r)}catch(r){throw c(r)}}async listBatchJobs(e,n){try{let r=await this.client.beta.messages.batches.list({limit:e?.limit,after_id:e?.after},{signal:n}),o=[];for(let a of r.data??[])o.push(h(a));return o}catch(r){throw c(r)}}async downloadBatchResults(e,n){try{let r=await this.client.beta.messages.batches.results(e.id,{signal:n}),o=[];for await(let a of r)a.result?.type==="succeeded"?o.push({customId:a.custom_id,result:T(a.result.message,this.modelId)}):o.push({customId:a.custom_id,error:a.result?.error?.message??"Unknown error"});return o}catch(r){throw c(r)}}async cancelBatchJob(e,n){try{await this.client.beta.messages.batches.cancel(e,{signal:n})}catch(r){throw c(r)}}async close(){}getRawClient(){return this.client}},F={provider:"anthropic",createModel:async t=>{let e=await import("./sdk-MEVPL5WT.js"),n={};t.apiKey!==void 0&&(n.apiKey=t.apiKey),t.baseUrl!==void 0&&(n.baseURL=t.baseUrl);let r=new e.Anthropic(n);return new f(r,t)}},v=1e3,A=1e4,S=t=>t<=v?"low":t>=A?"high":"medium",p=(t,e)=>{let n={model:t.model,max_tokens:e.maxTokens??t.maxTokens,messages:E(e.messages)};e.system!==void 0&&(n.system=e.system),e.stopWords!==void 0&&(n.stop_sequences=e.stopWords),e.tools!==void 0&&(n.tools=e.tools.map(i=>({name:i.name,description:i.description,input_schema:i.parameters??{type:"object",properties:{}}}))),e.toolChoice!==void 0&&(n.tool_choice={type:e.toolChoice==="required"?"any":e.toolChoice}),e.thinkingBudget!==void 0&&(n.thinking={type:"adaptive"});let r=e.effort??(e.thinkingBudget===void 0?void 0:S(e.thinkingBudget)),o=P(e.responseFormat),a={};return r!==void 0&&(a.effort=r),o!==null&&(a.format=o),Object.keys(a).length>0&&(n.output_config=a),n},P=t=>t?.type!=="json_schema"?null:{type:"json_schema",schema:R(t,"anthropic")},E=t=>{let e=[];for(let n of t){if(n.role==="system")continue;let r=[];for(let o of n.content){let a=I(o);a!==null&&r.push(a)}e.push({role:n.role==="tool"?"user":n.role,content:r})}return e},I=t=>{switch(t.kind){case"text":return{type:"text",text:t.text};case"image":{if(t.image.data!==void 0)return{type:"image",source:{type:"base64",media_type:t.image.mimeType??"image/png",data:C(t.image.data)}};if(t.image.url!==void 0){if(k(t.image.url)){let e=x(t.image.url);if(e!==null)return{type:"image",source:{type:"base64",media_type:e.mimeType,data:C(e.data)}}}return{type:"image",source:{type:"url",url:t.image.url}}}return{type:"text",text:"[unsupported image]"}}case"tool_call":return{type:"tool_use",id:t.toolCall.id,name:t.toolCall.name,input:t.toolCall.arguments};case"tool_result":return{type:"tool_result",tool_use_id:t.toolResult.toolCallId,content:t.toolResult.content,is_error:t.toolResult.isError};case"thinking":{let{redactedData:e,signature:n}=t.thinking;return e!==void 0&&e!==""?{type:"redacted_thinking",data:e}:n===void 0||n===""?null:{type:"thinking",thinking:t.thinking.text,signature:n}}default:return{type:"text",text:`[unsupported content: ${t.kind}]`}}},T=(t,e)=>{let n=[];for(let r of t.content??[]){let o=D(r);r.type==="text"?n.push({kind:"text",text:r.text}):o!==null?n.push({kind:"thinking",thinking:o}):r.type==="tool_use"&&n.push({kind:"tool_call",toolCall:{id:r.id,name:r.name,arguments:r.input??{}}})}return{content:n,stopReason:B(t.stop_reason),usage:{inputTokens:t.usage?.input_tokens??0,outputTokens:t.usage?.output_tokens??0,totalTokens:(t.usage?.input_tokens??0)+(t.usage?.output_tokens??0)},modelId:e,rawResponse:t}},B=t=>t==="end_turn"?"end_turn":t==="max_tokens"||t==="model_context_window_exceeded"?"max_tokens":t==="tool_use"?"tool_use":t==="stop_sequence"?"stop":t==="refusal"?"refusal":"end_turn",J=t=>t.redactedData!==null?{text:"",redactedData:t.redactedData}:t.signature===""?{text:t.text}:{text:t.text,signature:t.signature},D=t=>t?.type==="thinking"?t.signature===void 0?{text:t.thinking??""}:{text:t.thinking??"",signature:t.signature}:t?.type==="redacted_thinking"?{text:"",redactedData:t.data??""}:null,h=t=>({id:t.id,status:q(t.processing_status),createdAt:new Date(t.created_at),completedAt:t.ended_at!==void 0?new Date(t.ended_at):void 0,totalCount:t.request_counts?.total??0,doneCount:t.request_counts?.succeeded??0,failedCount:t.request_counts?.errored??0}),q=t=>t==="in_progress"?"processing":t==="ended"?"completed":t==="canceling"||t==="canceled"?"cancelled":"pending",c=t=>{if(t instanceof b)return t;let e=t instanceof Error?t:new Error(String(t)),n=t?.status??t?.statusCode??500;return w("anthropic",n,e)},C=t=>{let e="";for(let n=0;n<t.length;n++)e+=String.fromCharCode(t[n]);return btoa(e)};export{f as a,F as b};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{B as m,c as e}from"./chunk-SWP6BJR6.js";import{C as o,x as i}from"./chunk-M4U4Y3XQ.js";var c={command:"eser",devCommand:"pnpm cli",npmPackage:"eser"},n=e,g=t=>{n=t},P=()=>n,l=t=>`${n} ${t}`,u=async t=>{let r=(await m(t))?.command;return typeof r=="string"&&r!==""&&(n=r),n},a="NOSKILLS_CLI_PREFIX",p=t=>{let s=t?.trim()??"";return s===""||/[\r\n]/.test(s)?null:s},C=async()=>p(o.env.get(a))??await i(c,["noskills","nos"])??e;export{g as a,P as b,l as c,u as d,C as e};
|