@visulima/vis 5.0.0 → 6.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/CHANGELOG.md +101 -0
- package/LICENSE.md +151 -88
- package/README.md +2 -2
- package/dist/bin.js +1 -1
- package/dist/binx.js +1 -1
- package/dist/config/index.d.ts +16 -18
- package/dist/packem_chunks/CONFIG_FILES.js +4 -4
- package/dist/packem_chunks/bloom-status.js +1 -1
- package/dist/packem_chunks/bloom-sync.js +1 -1
- package/dist/packem_chunks/catalog.js +61 -51
- package/dist/packem_chunks/cli-exec.js +1 -1
- package/dist/packem_chunks/cli-main.js +202 -176
- package/dist/packem_chunks/dart-plan.js +1 -1
- package/dist/packem_chunks/dart-projects.js +1 -1
- package/dist/packem_chunks/dispatch.js +1 -1
- package/dist/packem_chunks/doctor-probe.js +1 -1
- package/dist/packem_chunks/fix.js +1 -1
- package/dist/packem_chunks/handler.js +1 -1
- package/dist/packem_chunks/handler10.js +4 -4
- package/dist/packem_chunks/handler11.js +1 -1
- package/dist/packem_chunks/handler12.js +1 -1
- package/dist/packem_chunks/handler13.js +1 -1
- package/dist/packem_chunks/handler14.js +1 -1
- package/dist/packem_chunks/handler15.js +1 -1
- package/dist/packem_chunks/handler16.js +1 -1
- package/dist/packem_chunks/handler17.js +1 -1
- package/dist/packem_chunks/handler18.js +1 -1
- package/dist/packem_chunks/handler19.js +1 -1
- package/dist/packem_chunks/handler2.js +1 -1
- package/dist/packem_chunks/handler20.js +2 -2
- package/dist/packem_chunks/handler21.js +1 -1
- package/dist/packem_chunks/handler22.js +2 -2
- package/dist/packem_chunks/handler23.js +1 -1
- package/dist/packem_chunks/handler24.js +1 -1
- package/dist/packem_chunks/handler26.js +3 -3
- package/dist/packem_chunks/handler27.js +1 -1
- package/dist/packem_chunks/handler28.js +1 -1
- package/dist/packem_chunks/handler29.js +1 -1
- package/dist/packem_chunks/handler3.js +1 -1
- package/dist/packem_chunks/handler30.js +1 -1
- package/dist/packem_chunks/handler39.js +6 -6
- package/dist/packem_chunks/handler5.js +1 -1
- package/dist/packem_chunks/handler50.js +2 -2
- package/dist/packem_chunks/handler51.js +1 -1
- package/dist/packem_chunks/handler53.js +1 -1
- package/dist/packem_chunks/handler54.js +1 -1
- package/dist/packem_chunks/handler55.js +1 -1
- package/dist/packem_chunks/handler58.js +1 -1
- package/dist/packem_chunks/handler59.js +1 -1
- package/dist/packem_chunks/handler6.js +1 -1
- package/dist/packem_chunks/handler60.js +7 -7
- package/dist/packem_chunks/handler61.js +2 -2
- package/dist/packem_chunks/handler62.js +2 -2
- package/dist/packem_chunks/handler63.js +1 -1
- package/dist/packem_chunks/handler64.js +2 -2
- package/dist/packem_chunks/handler65.js +3 -3
- package/dist/packem_chunks/handler66.js +2 -2
- package/dist/packem_chunks/handler67.js +31 -20
- package/dist/packem_chunks/handler68.js +1 -1
- package/dist/packem_chunks/handler69.js +4 -4
- package/dist/packem_chunks/handler7.js +1 -1
- package/dist/packem_chunks/handler70.js +5 -5
- package/dist/packem_chunks/handler71.js +1 -1
- package/dist/packem_chunks/handler72.js +1 -1
- package/dist/packem_chunks/handler73.js +1 -1
- package/dist/packem_chunks/handler74.js +1 -1
- package/dist/packem_chunks/handler75.js +36 -36
- package/dist/packem_chunks/handler76.js +1 -1
- package/dist/packem_chunks/handler77.js +3 -3
- package/dist/packem_chunks/handler78.js +24 -24
- package/dist/packem_chunks/handler8.js +1 -1
- package/dist/packem_chunks/handler9.js +1 -1
- package/dist/packem_chunks/heal-accept.js +1 -1
- package/dist/packem_chunks/heal.js +1 -1
- package/dist/packem_chunks/help-command.js +40 -7
- package/dist/packem_chunks/index2.js +32 -32
- package/dist/packem_chunks/index6.js +1 -1
- package/dist/packem_chunks/keys-refresh.js +1 -1
- package/dist/packem_chunks/lean.js +3 -4
- package/dist/packem_chunks/list.js +1 -1
- package/dist/packem_chunks/loader.js +1 -1
- package/dist/packem_chunks/orchestrator.js +1 -1
- package/dist/packem_chunks/prompts.js +1 -1
- package/dist/packem_chunks/status.js +1 -1
- package/dist/packem_chunks/sync.js +1 -1
- package/dist/packem_chunks/sync2.js +1 -1
- package/dist/packem_chunks/tripwire.js +1 -1
- package/dist/packem_chunks/ts-loader.js +5 -5
- package/dist/packem_chunks/verify-lockfile.js +1 -1
- package/dist/packem_shared/{affected-selection-BJXJW_3Q.js → affected-selection-DDxwjwM4.js} +1 -1
- package/dist/packem_shared/{affected-shas-B_kfSKss.js → affected-shas-BuaWvmsG.js} +1 -1
- package/dist/packem_shared/{ai-fix-BC6aIRJT.js → ai-fix-C2BhFFhi.js} +5 -5
- package/dist/packem_shared/{augment-B9kSZuvW.js → augment-CxUPE8KX.js} +1 -1
- package/dist/packem_shared/{bin-Dx8mjl3g.js → bin-Be7_QhQK.js} +1 -1
- package/dist/packem_shared/{build-scripts-CEDx_nJp.js → build-scripts-DxyVSkgM.js} +1 -1
- package/dist/packem_shared/command-runtime-BXvH5EC0.js +1 -0
- package/dist/packem_shared/{dart-pubspec-BK_cK2EP.js → dart-pubspec-DvmyleIr.js} +2 -2
- package/dist/packem_shared/{dependency-scan-B8jroa1D.js → dependency-scan-DKK3ZEZI.js} +1 -1
- package/dist/packem_shared/{docker-DXqV-07f.js → docker-BTuwdXaC.js} +1 -1
- package/dist/packem_shared/{ecosystem-gate-CeV20GSB.js → ecosystem-gate-BpQNUJzN.js} +1 -1
- package/dist/packem_shared/{env-consistency-Dt_uDbSP.js → env-consistency-CUBJHENL.js} +1 -1
- package/dist/packem_shared/{failure-log-D2x5BT8S.js → failure-log-kp0n2rbD.js} +1 -1
- package/dist/packem_shared/{formatBytes-BHAzNIrn-CrusHOew.js → formatBytes-BHAzNIrn-DRcKvqnb.js} +1 -1
- package/dist/packem_shared/{index-BzhrR_iC.js → index-BdMIfGVZ.js} +15 -15
- package/dist/packem_shared/index-C9ENZqH9.js +39 -0
- package/dist/packem_shared/{index-nEyN71oX.js → index-DQfNpt2u.js} +1 -1
- package/dist/packem_shared/{index-C_ScJMpb.js → index-DsSWb5XH.js} +1 -1
- package/dist/packem_shared/{index.server-sXNQYpsl.js → index.server-D8BLnYZO.js} +2 -2
- package/dist/packem_shared/{isAccessibleSync-DYKTrrvc-C-_5cgwu.js → isAccessibleSync-DYKTrrvc-BwaMhQs0.js} +1 -1
- package/dist/packem_shared/{lifecycle-D6PMPor-.js → lifecycle-BAhkhE2L.js} +1 -1
- package/dist/packem_shared/{lockfile-CiUtEbnt.js → lockfile-DHmlPGk1.js} +1 -1
- package/dist/packem_shared/{manifests-Du4yKlf_.js → manifests-Dd4Hoztt.js} +1 -1
- package/dist/packem_shared/{min-release-age-JViyQuBM.js → min-release-age-BJnOQaoF.js} +1 -1
- package/dist/packem_shared/{missing-package-json-Cu5YVAot.js → missing-package-json-DfzrGwe1.js} +1 -1
- package/dist/packem_shared/{multi-eco-lockfiles-B2X3yhyo.js → multi-eco-lockfiles-BIa6xvJc.js} +1 -1
- package/dist/packem_shared/{native-config-sync-TdTWjVgI.js → native-config-sync-Dr9XvxOf.js} +1 -1
- package/dist/packem_shared/osv-bloom-t40ra5U5.js +2 -0
- package/dist/packem_shared/{package-version-CiRZecQu.js → package-version-CFuNUWDG.js} +2 -2
- package/dist/packem_shared/{packument-Df46y5MY.js → packument-C9nRiBJf.js} +1 -1
- package/dist/packem_shared/pm-runner-ImwtpnWY.js +1 -0
- package/dist/packem_shared/{project-name-filter-CH8Ih7Qr.js → project-name-filter-C2rkW-Vn.js} +1 -1
- package/dist/packem_shared/{provenance-DKeR0Ig1.js → provenance-DF-ypZj3.js} +1 -1
- package/dist/packem_shared/{readJsonSync-CbryXYxN-EWl7_7KX.js → readJsonSync-CbryXYxN-Bm5i10UW.js} +1 -1
- package/dist/packem_shared/{registry-keys-DwB3ZXS_.js → registry-keys-BLuHOyZu.js} +1 -1
- package/dist/packem_shared/{resolve-explicit-BmV8YBE-.js → resolve-explicit-BDaQRR6o.js} +1 -1
- package/dist/packem_shared/resolve-runtime-Cr19Pk6L.js +1 -0
- package/dist/packem_shared/{run-file-UBukWaha.js → run-file-XbRCF6Mp.js} +1 -1
- package/dist/packem_shared/{runtime-check-1U8HrQd9.js → runtime-check-Bh5q9IrT.js} +1 -1
- package/dist/packem_shared/{s1ngularity-DZhkIqL4.js → s1ngularity-UCZN7skW.js} +1 -1
- package/dist/packem_shared/{scan-progress-CkumcBG-.js → scan-progress-DcYI76zE.js} +1 -1
- package/dist/packem_shared/{selectors-edwcgNl3.js → selectors-DCiEU0iv.js} +2 -2
- package/dist/packem_shared/{signatures-BxTMck2l.js → signatures-CicxPHN4.js} +1 -1
- package/dist/packem_shared/target-merge-BClIXg2k.js +14 -0
- package/dist/packem_shared/{target-options-DsHFmRZH.js → target-options-PgWIuJnb.js} +1 -1
- package/dist/packem_shared/{task-env-DzR4RkOj.js → task-env-Dl08aklA.js} +1 -1
- package/dist/packem_shared/toolchain-DvUxlbDz.js +5 -0
- package/dist/packem_shared/{typosquats-8u0drCqQ.js → typosquats-DxPzyK7u.js} +1 -1
- package/dist/packem_shared/{verify-B_MblU_Q.js → verify-CadR9PUk.js} +1 -1
- package/dist/packem_shared/{vis-update-app-BCIccZfA.js → vis-update-app-DrFWQyPn.js} +1 -1
- package/dist/packem_shared/{vis-user-error-Dd7hwxlW.js → vis-user-error-k7CLTpA4.js} +15 -15
- package/dist/packem_shared/{watch-CcTketln.js → watch-Dr_6yz3o.js} +1 -1
- package/dist/packem_shared/watch-loop-BId9vT7Q.js +11 -0
- package/dist/packem_shared/{writeFileSync-DJoHk3Ks-BPRoepNw.js → writeFileSync-DJoHk3Ks-Dhem3Uof.js} +1 -1
- package/dist/release/core/version-actions/index.d.ts +1 -1
- package/dist/release/presets.d.ts +1 -55
- package/dist/release/presets.js +1 -1
- package/dist/release/types.d.ts +1 -18
- package/dist/runtime/preload.js +1 -1
- package/index.d.ts +204 -204
- package/index.js +26 -26
- package/package.json +10 -10
- package/schemas/vis-config.schema.json +6 -28
- package/schemas/vis-release-config.schema.json +1 -12
- package/dist/packem_shared/Table-BB8xHTU5-BLPS917D.js +0 -11
- package/dist/packem_shared/command-runtime-p4IXiIf6.js +0 -1
- package/dist/packem_shared/index-BisalDCf.js +0 -39
- package/dist/packem_shared/osv-bloom-BCAX5ARR.js +0 -2
- package/dist/packem_shared/pm-runner-3iiQayy-.js +0 -1
- package/dist/packem_shared/resolve-runtime-CNiHcVtx.js +0 -1
- package/dist/packem_shared/target-merge-DVJl-7Qz.js +0 -4
- package/dist/packem_shared/toolchain-BRdpaAC4.js +0 -5
- package/dist/packem_shared/watch-loop-BBkg02-Q.js +0 -11
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
const dt=/[\t\n\r ]/,Xt=(t,e,o=4,s=79)=>{let r=e.position,i=e.position,n="",a="";for(;r>0&&!dt.test(t.charAt(r-1));)if(r-=1,e.position-r>s/2-1){n=" ... ",r+=5;break}for(;i<t.length&&!dt.test(t.charAt(i));)if(i+=1,i-e.position>s/2-1){a=" ... ",i-=5;break}const l=t.slice(r,i),u=" ".repeat(o+e.position-r+n.length);return`${" ".repeat(o)}${n}${l}${a}
|
|
2
|
-
${u}^`};let rt=class extends Error{mark;constructor(e,o,s){let r=e,i=o;if(o&&(r+=` at line ${String(o.line+1)}, column ${String(o.column+1)}`,s!==void 0)){const n=Xt(s,o);r+=`:
|
|
3
|
-
${n}`,i={...o,snippet:n}}super(r),this.name="YAMLError",this.mark=i}},x=class extends rt{constructor(e,o,s){super(e,o,s),this.name="YAMLParseError"}},E=class extends rt{constructor(e,o,s){super(e,o,s),this.name="YAMLStringifyError"}},Zt=class extends rt{constructor(e,o,s){super(e,o,s),this.name="YAMLWarning"}},K=class{kind="SCALAR";value;anchor;comment;commentBefore;spaceBefore;tag;type;constructor(e){this.value=e}toJSON(){return I(this)}toString(){return String(this.value)}},$t=class{kind="ALIAS";source;comment;commentBefore;spaceBefore;constructor(e){this.source=e}toString(){return`*${this.source}`}};class ot{kind="PAIR";key;value;comment;commentBefore;spaceBefore;constructor(e,o){this.key=e,this.value=o}toJSON(){return{key:I(this.key),value:I(this.value)}}}const R=(t,e)=>typeof t=="object"&&t!==null&&t.kind===e,v=t=>R(t,"SCALAR"),it=t=>R(t,"ALIAS"),Ct=t=>R(t,"PAIR"),U=t=>R(t,"MAP"),nt=t=>R(t,"SEQ"),W=t=>U(t)||nt(t),Ht=t=>v(t)||it(t)||W(t),te=(t,e)=>{const o=v(t)?t.value:t,s=v(e)?e.value:e;return o===s};let Nt=class{anchor;comment;commentBefore;flow;spaceBefore;tag;getIn(e,o=!1){const[s,...r]=[...e];if(s===void 0)return;const i=this.get(s,!0);return r.length===0?o||!v(i)?i:i.value:W(i)?i.getIn(r,o):void 0}hasIn(e){const[o,...s]=[...e];if(o===void 0)return!1;if(s.length===0)return this.has(o);const r=this.get(o,!0);return W(r)?r.hasIn(s):!1}setIn(e,o){const[s,...r]=[...e];if(s===void 0)return;if(r.length===0){this.set(s,o);return}let i=this.get(s,!0);W(i)||(i=new T,this.set(s,i)),i.setIn(r,o)}deleteIn(e){const[o,...s]=[...e];if(o===void 0)return!1;if(s.length===0)return this.delete(o);const r=this.get(o,!0);return W(r)?r.deleteIn(s):!1}toJSON(){return I(this)}};class T extends Nt{kind="MAP";items=[];#t;#e=0;#r(){if(this.#t===void 0||this.#e!==this.items.length){const e=new Map;for(const o of this.items){const s=v(o.key)?o.key.value:o.key;e.has(s)||e.set(s,o)}this.#t=e,this.#e=this.items.length}return this.#t}#o(e){return this.#r().get(v(e)?e.value:e)}get(e,o=!1){const s=this.#o(e);if(s)return o||!v(s.value)?s.value:s.value.value}set(e,o){const s=this.#o(e);if(s){s.value=o;return}const r=new ot(e,o);this.items.push(r),this.#t!==void 0&&this.#e===this.items.length-1&&(this.#t.set(v(e)?e.value:e,r),this.#e=this.items.length)}has(e){return this.#o(e)!==void 0}delete(e){const o=this.items.findIndex(s=>te(s.key,e));return o===-1?!1:(this.items.splice(o,1),this.#t=void 0,!0)}add(e){this.items.push(e)}}let at=class extends Nt{kind="SEQ";items=[];get(e,o=!1){const s=V(e),r=s===void 0?void 0:this.items[s];return o||!v(r)?r:r.value}set(e,o){const s=V(e);s!==void 0&&(this.items[s]=o)}has(e){const o=V(e);return o!==void 0&&o<this.items.length}delete(e){const o=V(e);return o===void 0||o>=this.items.length?!1:(this.items.splice(o,1),!0)}add(e){this.items.push(e)}};const V=t=>{const e=v(t)?t.value:t,o=typeof e=="number"?e:Number(e);return Number.isInteger(o)&&o>=0?o:void 0},ee=t=>(v(t)?t.value:t)==="<<",xt=(t,e,o)=>{Object.defineProperty(t,e,{configurable:!0,enumerable:!0,value:o,writable:!0})},w=t=>typeof t=="string"?t:t===null||typeof t!="object"?String(t):v(t)?w(t.value):nt(t)?`[${t.items.map(e=>w(e)).join(",")}]`:U(t)?`{${t.items.map(e=>`${w(e.key)}: ${w(e.value)}`).toSorted((e,o)=>e.localeCompare(o)).join(", ")}}`:it(t)?`*${t.source}`:Array.isArray(t)?`[${t.map(e=>w(e)).join(",")}]`:Object.prototype.toString.call(t)==="[object Object]"?`{${Object.entries(t).map(([e,o])=>`${e}: ${w(o)}`).toSorted((e,o)=>e.localeCompare(o)).join(", ")}}`:Object.prototype.toString.call(t),oe=(t,e)=>{const o=I(t,e);return Array.isArray(o)?o.filter(s=>gt(s)):gt(o)?[o]:[]},gt=t=>typeof t=="object"&&t!==null&&!Array.isArray(t),se=(t,e)=>{const o={};t.anchor&&e.set(t.anchor,o);for(const s of t.items){if(ee(s.key)){re(o,s.value,e);continue}xt(o,w(s.key),I(s.value,e))}return o},re=(t,e,o)=>{for(const s of oe(e,o))for(const[r,i]of Object.entries(s))Object.hasOwn(t,r)||xt(t,r,i)},I=(t,e)=>{const o=e??new Map;if(v(t))return t.anchor&&o.set(t.anchor,t.value),t.value;if(it(t))return o.get(t.source);if(nt(t)){const s=[];t.anchor&&o.set(t.anchor,s);for(const r of t.items)s.push(I(r,o));return s}return U(t)?se(t,o):Ct(t)?{key:I(t.key,o),value:I(t.value,o)}:t},L=t=>{if(Ht(t)||Ct(t))return t;if(Array.isArray(t)){const e=new at;for(const o of t)e.items.push(L(o));return e}if(t instanceof Map){const e=new T;for(const[o,s]of t)e.items.push(new ot(L(o),L(s)));return e}if(typeof t=="object"&&t!==null&&Object.prototype.toString.call(t)==="[object Object]"){const e=new T;for(const[o,s]of Object.entries(t))e.items.push(new ot(new K(o),L(s)));return e}return new K(t)},Mt=/^[-+]?\d+$/,jt=/^0x[0-9a-fA-F]+$/,Lt=/^0o[0-7]+$/,ie=/^[-+]?(?:\.\d+|\d+(?:\.\d*)?)(?:e[-+]?\d+)?$/i,ne=/^([-+]?)\.(?:inf|Inf|INF)$/,ae=/^\.(?:nan|NaN|NAN)$/,le=t=>t==="~"||t==="null"||t==="Null"||t==="NULL",Ot=t=>t==="true"||t==="True"||t==="TRUE",Tt=t=>t==="false"||t==="False"||t==="FALSE",lt=t=>{if(t.length===0)return null;const e=t.charCodeAt(0);if(e>=65&&e<=90||e>=97&&e<=122||e===126){const{length:o}=t;if(o===1)return e===126?null:t;if(o===4){if(le(t))return null;if(Ot(t))return!0}else if(o===5&&Tt(t))return!1;return t}if(e>=48&&e<=57||e===43||e===45||e===46){if(Mt.test(t))return Number.parseInt(t,10);if(e===48&&jt.test(t))return Number.parseInt(t.slice(2),16);if(e===48&&Lt.test(t))return Number.parseInt(t.slice(2),8);if(e===46||e===43||e===45){const o=ne.exec(t);if(o)return o[1]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY;if(ae.test(t))return Number.NaN}if(ie.test(t))return Number.parseFloat(t)}return t},ce=t=>lt(t)!==t,H={status:"invalid"},ue={status:"unknown"},pe=(t,e)=>{switch(t){case"!!bool":case"tag:yaml.org,2002:bool":return Ot(e)?{status:"ok",value:!0}:Tt(e)?{status:"ok",value:!1}:H;case"!!float":case"tag:yaml.org,2002:float":{const o=lt(e);return typeof o=="number"?{status:"ok",value:o}:H}case"!!int":case"tag:yaml.org,2002:int":return jt.test(e)?{status:"ok",value:Number.parseInt(e.slice(2),16)}:Lt.test(e)?{status:"ok",value:Number.parseInt(e.slice(2),8)}:Mt.test(e)?{status:"ok",value:Number.parseInt(e,10)}:H;case"!!null":case"tag:yaml.org,2002:null":return{status:"ok",value:null};case"!!str":case"tag:yaml.org,2002:str":return{status:"ok",value:e};default:return ue}},fe=t=>t.startsWith("!!")?[t,`tag:yaml.org,2002:${t.slice(2)}`]:[t],he=t=>{if(!t)return;const e=typeof t=="function"?t([]):t;if(!Array.isArray(e))throw new x("customTags must be an array of tags, or a function returning one");if(e.length===0)return;const o=new Map,s=[];for(const r of e){for(const i of fe(r.tag))o.set(i,r);if(r.default&&r.test){const i=r.test.flags.includes("g")||r.test.flags.includes("y")?new RegExp(r.test.source,r.test.flags.replaceAll(/[gy]/gu,"")):r.test;s.push({...r,test:i})}}return{byTag:o,implicit:s}},de=(t,e)=>{if(t){for(const o of t.implicit)if(o.test.test(e))return{value:o.resolve(e)}}},ct=(t,e)=>{if(t){for(const o of t)if(o.identify?.(e)){const s=o.stringify?o.stringify(e):String(e);return`${o.tag} ${s}`}}},ge=/[\u0000-\u0008\u000B-\u001F\u007F-\u009F\u2028\u2029\uFFFE\uFFFF]/,me=new Set("!\"#%&'*,-:>?@[\\]`{|}"),be=/^\s|\s$/,ye=/[\n\t]/,Ae=/:[ \t]|:$|[ \t]#/,ke=/[,[\]{}]/,ve=/^\s/,Se=/[ \t]$/,we=t=>{let e=t.length;for(;e>0&&t.codePointAt(e-1)===10;)e-=1;return e===t.length?t:t.slice(0,e)},Ie=/[\n\t]/g,$e=/\t/,Ce=/^\S+(?: \S+)*$/,Z=(t,e)=>" ".repeat(t*e.indent),Ne=(t,e)=>t<e?-1:t>e?1:0,xe=(t,e)=>!(t.length===0||t==="<<"||me.has(t[0])||be.test(t)||ye.test(t)||Ae.test(t)||e&&ke.test(t)),Me=t=>`'${t.replaceAll("'","''")}'`,B=(t,e)=>{let o="";for(const s of t){const r=s.codePointAt(0);switch(s){case`
|
|
4
|
-
`:{o+=String.raw`\n`;break}case" ":{o+=String.raw`\t`;break}case"\r":{o+=String.raw`\r`;break}case"\0":{o+=String.raw`\0`;break}case"\f":{o+=String.raw`\f`;break}case"\v":{o+=String.raw`\v`;break}case"\b":{o+=String.raw`\b`;break}case"\x1B":{o+=String.raw`\e`;break}case'"':{o+=String.raw`\"`;break}case"\\":{o+="\\\\";break}default:{const i=r.toString(16).toUpperCase();r<32||r>=127&&r<=159?o+=String.raw`\x${i.padStart(2,"0")}`:e&&r>126?o+=r<=255?String.raw`\x${i.padStart(2,"0")}`:String.raw`\u${i.padStart(4,"0")}`:o+=s}}}return`"${o}"`},je=(t,e,o)=>{const s=Z(e+1,o);let r="",i=t;t.endsWith(`
|
|
5
|
-
`)?(t.endsWith(`
|
|
6
|
-
|
|
7
|
-
`)&&(r="+"),i=t.slice(0,-1)):r="-";const n=i.split(`
|
|
8
|
-
`).map(a=>a===""?"":s+a).join(`
|
|
9
|
-
`);return`|${r}
|
|
10
|
-
${n}`},Le=(t,e)=>{const o=t.split(" "),s=[];let r="";for(const i of o)r===""?r=i:r.length+1+i.length<=e?r+=` ${i}`:(s.push(r),r=i);return r!==""&&s.push(r),s},Oe=(t,e,o)=>{const s=Z(e+1,o),r=Math.max(1,o.lineWidth-s.length);return`>-
|
|
11
|
-
${Le(t,r).map(i=>s+i).join(`
|
|
12
|
-
`)}`},Te=(t,e,o)=>{if(o.lineWidth<=0)return!1;const s=o.lineWidth-(e+1)*o.indent;return t.length<=s?!1:t.includes(" ")&&Ce.test(t)},ut=(t,e,o,s)=>t===""?'""':ge.test(t.replaceAll(Ie,""))?B(t,o.forceQuotes):o.forceQuotes?B(t,!0):t.includes(`
|
|
13
|
-
`)?o.blockQuote!==!1&&!s&&!ve.test(t)&&!Se.test(we(t))?je(t,e,o):B(t,!1):xe(t,s)&&!ce(t)?!s&&Te(t,e,o)?Oe(t,e,o):t:$e.test(t)?B(t,!1):o.singleQuote?Me(t):B(t,!1),Fe=t=>Number.isNaN(t)?".nan":t===Number.POSITIVE_INFINITY?".inf":t===Number.NEGATIVE_INFINITY?"-.inf":Object.is(t,-0)?"-0":String(t),Ft=(t,e)=>{const o=Object.entries(t);if(e.sortKeys===!0)o.sort(([s],[r])=>Ne(s,r));else if(typeof e.sortKeys=="function"){const s=e.sortKeys;o.sort(([r],[i])=>s(r,i))}return o},Ee=t=>Array.isArray(t)?t.length>0:typeof t=="object"&&t!==null&&Object.keys(t).length>0,D=(t,e,o)=>{let s=o;return s!==null&&typeof s=="object"&&typeof s.toJSON=="function"&&(s=s.toJSON()),t.replacer&&(s=t.replacer(e,s)),s},J=(t,e,o)=>{const s=ct(o.customTags,t);if(s!==void 0)return s;if(Array.isArray(t)){G(t,o),o.stack.add(t);const r=t.map((i,n)=>J(D(o,String(n),i),e,o));return o.stack.delete(t),r.length===0?"[]":o.flowCollectionPadding?`[ ${r.join(", ")} ]`:`[${r.join(", ")}]`}if(typeof t=="object"&&t!==null){G(t,o),o.stack.add(t);const r=Ft(t,o).map(([i,n])=>`${ut(i,e,o,!0)}: ${J(D(o,i,n),e,o)}`);return o.stack.delete(t),r.length===0?"{}":o.flowCollectionPadding?`{ ${r.join(", ")} }`:`{${r.join(", ")}}`}return Et(t,e,o,!0)},Et=(t,e,o,s)=>{if(t==null)return o.nullStr;switch(typeof t){case"bigint":return t.toString();case"boolean":return t?o.trueStr:o.falseStr;case"number":return Fe(t);case"string":return ut(t,e,o,s);default:{if(o.skipInvalid)return o.nullStr;throw new E(`cannot serialize a value of type "${typeof t}"`)}}},_t=(t,e,o)=>{const s=ct(o.customTags,t);return s!==void 0?s:Array.isArray(t)?t.length===0?"[]":st(e,o)?J(t,e,o):_e(t,e,o):typeof t=="object"&&t!==null&&Object.prototype.toString.call(t)==="[object Object]"?Object.keys(t).length===0?"{}":st(e,o)?J(t,e,o):Pe(t,e,o):Et(t,e,o,!1)},G=(t,e)=>{if(e.stack.has(t))throw new E("cannot serialize a circular structure to YAML")},st=(t,e)=>e.collectionStyle==="flow"?!0:e.collectionStyle==="block"?!1:e.flowLevel>=0&&t>=e.flowLevel,Pt=(t,e,o)=>{const s=Ee(t)&&ct(o.customTags,t)===void 0,r=_t(t,s?e+1:e,o);return{block:s&&!st(e+1,o)&&r!=="[]"&&r!=="{}",text:r}},_e=(t,e,o)=>{G(t,o),o.stack.add(t);const s=o.indentSeq||e===0?e:e-1,r=Z(s,o),i=`-${" ".repeat(o.indent-1)}`,n=(s+1)*o.indent,a=[];for(const[l,u]of t.entries()){const p=D(o,String(l),u);if(p===void 0&&o.skipInvalid&&!o.keepUndefined)continue;const{block:f,text:b}=Pt(p,s,o);a.push(r+i+(f?b.slice(n):b))}return o.stack.delete(t),a.length===0?"[]":a.join(`
|
|
14
|
-
`)},Pe=(t,e,o)=>{G(t,o),o.stack.add(t);const s=Z(e,o),r=Ft(t,o),i=[];for(const[n,a]of r){const l=D(o,n,a);if(l===void 0&&!o.keepUndefined)continue;const u=ut(n,e,o,!0),{block:p,text:f}=Pt(l,e,o);i.push(p?`${s+u}:
|
|
15
|
-
${f}`:`${s+u}: ${f}`)}return o.stack.delete(t),i.length===0?"{}":i.join(`
|
|
16
|
-
`)},q=(t,e={})=>{const o={blockQuote:e.blockQuote??!0,collectionStyle:e.collectionStyle??"any",customTags:typeof e.customTags=="function"?e.customTags([]):e.customTags,falseStr:e.falseStr??"false",flowCollectionPadding:e.flowCollectionPadding??!0,flowLevel:e.flowLevel??-1,forceQuotes:e.forceQuotes??!1,indent:e.indent??2,indentSeq:e.indentSeq??!0,keepUndefined:e.keepUndefined??!1,lineWidth:e.lineWidth??80,nullStr:e.nullStr??"null",replacer:e.replacer,singleQuote:e.singleQuote??!1,skipInvalid:e.skipInvalid??!1,sortKeys:e.sortKeys??!1,stack:new Set,trueStr:e.trueStr??"true"};if(o.indent<2)throw new E("indentation width must be at least 2");const s=D(o,"",t);if(s===void 0)return e.directives?`---
|
|
17
|
-
`:`
|
|
18
|
-
`;const r=_t(s,0,o);return`${e.directives?`---
|
|
19
|
-
`:""}${r}
|
|
20
|
-
`},Bt=Symbol("invalid scalar"),Be=/^-?(?:0|[1-9]\d*)$/,We=/^-?(?:0|[1-9]\d*)(?:\.\d+)?(?:e[-+]?\d+)?$/i,qe=/^[-+]?(?:0|[1-9][\d_]*)$/,Ye=/^[-+]?0[0-7_]+$/,Ke=/^[-+]?0x[\dA-Fa-f_]+$/,Ue=/^[-+]?0b[01_]+$/,De=/^[-+]?(?:\d[\d_]*)?\.[\d_]*(?:e[-+]?\d+)?$/i,Re=/^[-+]?[1-9][\d_]*(?::[0-5]?\d)+$/,Qe=/^[-+]?[1-9][\d_]*(?::[0-5]?\d)+\.[\d_]*$/,Ve=/^([-+])?\.(?:inf|Inf|INF)$/,Je=/^\.(?:nan|NaN|NAN)$/,Ge=/^[-+]?0b/,ze=/^[-+]?0x/,Xe=/^[-+]?0/,Ze=new Set(["","null","Null","NULL","~"]),He=new Set(["on","On","ON","true","True","TRUE","y","Y","yes","Yes","YES"]),to=new Set(["false","False","FALSE","n","N","no","No","NO","off","Off","OFF"]),j=t=>t.includes("_")?t.replaceAll("_",""):t,mt=(t,e)=>{const o=j(t),s=o.startsWith("-"),r=s||o.startsWith("+")?o.slice(1):o;let i=0;for(const n of r.split(":"))i=i*60+(e?Number.parseFloat(n):Number.parseInt(n,10));return s?-i:i},eo=t=>{let e=0;const o=(d,h)=>{let m=0,g=0;for(;g<h&&e<t.length;){const S=t.codePointAt(e)??0;if(S<48||S>57)break;m=m*10+(S-48),e+=1,g+=1}return g<d?-1:m},s=d=>t[e]===d?(e+=1,!0):!1,r=()=>{const d=e;for(;t[e]===" "||t[e]===" ";)e+=1;return e-d},i=o(4,4);if(i<0||!s("-"))return;const n=o(1,2);if(n<0||!s("-"))return;const a=o(1,2);if(a<0)return;if(e===t.length)return new Date(Date.UTC(i,n-1,a));if(!s("T")&&!s("t")&&r()===0)return;const l=o(1,2);if(l<0||!s(":"))return;const u=o(2,2);if(u<0||!s(":"))return;const p=o(2,2);if(p<0)return;let f=0;if(s(".")){const d=e;if(o(1,9)<0)return;f=Math.round(+`0.${t.slice(d,e)}`*1e3)}r();let b=0;if(e<t.length&&!s("Z")&&!s("z")){const d=s("-");if(!d&&!s("+"))return;const h=o(1,2);if(h<0)return;s(":");const m=e<t.length?o(2,2):0;if(m<0)return;b=(h*60+m)*(d?-1:1)}if(e===t.length)return new Date(Date.UTC(i,n-1,a,l,u,p,f)-b*6e4)},oo=t=>t,so=t=>t==="null"?null:t==="true"?!0:t==="false"?!1:Be.test(t)?Number.parseInt(t,10):We.test(t)?Number.parseFloat(t):Bt,ro=t=>{if(Ze.has(t))return null;if(He.has(t))return!0;if(to.has(t))return!1;if(Ue.test(t)){const o=j(t);return(o.startsWith("-")?-1:1)*Number.parseInt(o.replace(Ge,""),2)}if(Ke.test(t)){const o=j(t);return(o.startsWith("-")?-1:1)*Number.parseInt(o.replace(ze,""),16)}if(Ye.test(t)){const o=j(t);return(o.startsWith("-")?-1:1)*Number.parseInt(o.replace(Xe,""),8)}if(Qe.test(t))return mt(t,!0);if(Re.test(t))return mt(t,!1);if(qe.test(t))return Number.parseInt(j(t),10);const e=Ve.exec(t);return e?e[1]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY:Je.test(t)?Number.NaN:De.test(t)?Number.parseFloat(j(t)):eo(t)??t},tt={core:lt,failsafe:oo,json:so,"yaml-1.1":ro},io=/^[-+]?(?:0B[01]+|0O[0-7]+|0X[\dA-F]+|\d+)$/i,no=t=>e=>{const o=t(e);if(typeof o!="number"||!Number.isInteger(o))return o;const s=j(e);return io.test(s)?BigInt(s):o},ao=t=>t==="core"||t==="failsafe"||t==="json"||t==="yaml-1.1",bt=(t,e,o=!1)=>{let s=tt.core;if(t!==void 0){if(!ao(t))throw new x(`unknown schema "${String(t)}"; expected one of core, failsafe, json, yaml-1.1`);s=tt[t]}else e==="1.1"&&(s=tt["yaml-1.1"]);return o?no(s):s},lo="tag:yaml.org,2002:merge",Wt=(t,e)=>t===lo||t==="?"&&e==="<<",co={alias:(t,e)=>t.anchorMap.get(e),anchor:()=>{},finish:(t,e)=>e,has:(t,e)=>Object.hasOwn(t,e),isMergeKey:Wt,key:(t,e)=>w(e),map:()=>({}),push:(t,e)=>{t.push(e)},seq:()=>[],set:(t,e,o,s)=>{if(o==="__proto__"&&t.options.preventProtoPollution){Object.defineProperty(e,o,{configurable:!0,enumerable:!0,value:s,writable:!0});return}e[o]=s}},uo={alias:(t,e)=>t.anchorMap.get(e),anchor:()=>{},finish:(t,e)=>e,has:(t,e)=>t.has(e),isMergeKey:Wt,key:(t,e)=>t.options.stringKeys?w(e):e,map:()=>new Map,push:(t,e)=>{t.push(e)},seq:()=>[],set:(t,e,o,s)=>{e.set(o,s)}},po={alias:(t,e)=>new $t(e),anchor:(t,e)=>{t.anchor=e},finish:(t,e,o)=>fo(t,e,o),has:(t,e)=>t.has(e),isMergeKey:()=>!1,key:(t,e)=>t.options.stringKeys?new K(w(e)):e,map:()=>new T,push:(t,e)=>{t.items.push(e)},seq:()=>new at,set:(t,e,o,s)=>{e.set(o,s)}},fo=(t,e,o)=>{if(e instanceof $t)return e;if(e instanceof K)return t.anchor!==null&&(e.anchor=t.anchor),t.tag!==null&&t.tag!=="?"&&t.tag!=="!"&&(e.tag=t.tag),e;if(e instanceof T||e instanceof at)return t.tag!==null&&t.tag!=="?"&&t.tag!=="!"&&(e.tag=t.tag),e;const s=new K(e);return o&&t.scalarStyle&&(s.type=t.scalarStyle),t.anchor!==null&&(s.anchor=t.anchor),t.tag!==null&&t.tag!=="?"&&t.tag!=="!"&&(s.tag=t.tag),s},ho=(t,e)=>t?po:e?uo:co;class go{input;length;position=0;line=0;lineStart=0;lineIndent=0;firstTabInLine=-1;documentMarkerLine=-1;documents=[];tag=null;anchor=null;kind=null;result=null;anchorMap=new Map;tagMap=new Map;aliasCount=0;depth=0;mappingRanges=null;resolveScalar;#t;nodes;build;lineCounter;scalarStyle=void 0;tags;options;constructor(e,o){this.input=e,this.length=e.length,this.options={...o,duplicateKeys:o.duplicateKeys??"error",maxAliasCount:o.maxAliasCount??100,maxDepth:o.maxDepth??1e3,preventProtoPollution:o.preventProtoPollution??!0,strict:o.strict??!0},this.#t=bt(this.options.schema,this.options.version,this.options.intAsBigInt),this.resolveScalar=this.#t,this.tags=he(this.options.customTags),this.nodes=o.nodes??!1,this.build=ho(this.nodes,this.options.mapAsMap),this.lineCounter=o.lineCounter}applyVersionDirective(e){this.resolveScalar=e==="1.1"||e==="1.2"?bt(this.options.schema,e,this.options.intAsBigInt):this.#t}resetVersionDirective(){this.resolveScalar=this.#t}}const qt=t=>({anchor:t.anchor,firstTabInLine:t.firstTabInLine,kind:t.kind,line:t.line,lineIndent:t.lineIndent,lineStart:t.lineStart,position:t.position,result:t.result,tag:t.tag}),Yt=(t,e)=>{t.position=e.position,t.line=e.line,t.lineStart=e.lineStart,t.lineIndent=e.lineIndent,t.firstTabInLine=e.firstTabInLine,t.tag=e.tag,t.anchor=e.anchor,t.kind=e.kind,t.result=e.result},mo=t=>({aliasCount:t.aliasCount,anchorMap:new Map(t.anchorMap),cursor:qt(t)}),bo=(t,e)=>{t.anchorMap=e.anchorMap,t.aliasCount=e.aliasCount,Yt(t,e.cursor)},c=(t,e)=>{throw new x(e,{column:t.position-t.lineStart,line:t.line,position:t.position},t.input)},yo=(t,e)=>{t.options.onWarning&&t.options.onWarning(new Zt(e,{column:t.position-t.lineStart,line:t.line,position:t.position},t.input))},Kt=t=>typeof t=="object"&&t!==null&&Object.prototype.toString.call(t)==="[object Object]",Ao=t=>t instanceof Map?[...t.keys()]:Object.keys(t),ko=(t,e)=>t instanceof Map?t.get(e):t[String(e)],yt=(t,e,o,s)=>{!Kt(o)&&!(o instanceof Map)&&c(t,"cannot merge mappings; the provided source object is unacceptable");const r=o;for(const i of Ao(r))t.build.has(e,i)||(t.build.set(t,e,i,ko(r,i)),s.add(i))},vo=(t,e,o,s,r,i)=>{if(t.mappingRanges===null||s<0)return;let n=t.mappingRanges.get(e);n===void 0&&(n=[],t.mappingRanges.set(e,n)),n.push({column:s-(t.input.lastIndexOf(`
|
|
21
|
-
`,s-1)+1),end:i,key:w(o),start:s,valueStart:r})},F=(t,e,o,s,r,i)=>{const{build:n}=t;let a=o;if(t.options.merge!==!1&&n.isMergeKey(s,r)){if(a??=new Set,Array.isArray(i))for(const u of i)yt(t,e,u,a);else yt(t,e,i,a);return a}const l=n.key(t,r);if(!a?.has(l)&&n.has(e,l)){if(t.options.duplicateKeys==="error")c(t,`duplicated mapping key "${String(l)}"`);else if(t.options.duplicateKeys==="ignore")return a}return n.set(t,e,l,i),a?.delete(l),a},$=t=>t===10||t===13,C=t=>t===9||t===32,k=t=>t===9||t===32||t===10||t===13||t===0,O=t=>t===44||t===91||t===93||t===123||t===125,Ut=new Uint8Array(128);for(const t of[33,34,35,37,38,39,42,62,64,96,124])Ut[t]=1;const So=t=>t<128&&Ut[t]===1,wo=t=>{if(t>=48&&t<=57)return t-48;const e=t|32;return e>=97&&e<=102?e-97+10:-1},Io=t=>t>=48&&t<=57?t-48:-1,y=Array.from({length:256});y[48]="\0";y[97]="\x07";y[98]="\b";y[116]=" ";y[9]=" ";y[110]=`
|
|
22
|
-
`;y[118]="\v";y[102]="\f";y[114]="\r";y[101]="\x1B";y[32]=" ";y[34]='"';y[47]="/";y[92]="\\";y[78]="
";y[95]=" ";y[76]="\u2028";y[80]="\u2029";const $o=t=>{switch(t){case 85:return 8;case 117:return 4;case 120:return 2;default:return 0}},N=(t,e,o)=>{e<o&&(t.result=t.result+t.input.slice(e,o))},pt=(t,e)=>{e===1?t.result=`${t.result} `:e>1&&(t.result=t.result+`
|
|
23
|
-
`.repeat(e-1))},ft=t=>{const e=t.input.charCodeAt(t.position);e===10?t.position++:e===13?(t.position++,t.input.charCodeAt(t.position)===10&&t.position++):c(t,"a line break is expected"),t.line+=1,t.lineStart=t.position,t.firstTabInLine=-1,t.lineCounter?.addNewLine(t.position)},A=(t,e,o)=>{let s=0,r=t.input.charCodeAt(t.position);for(;r!==0;){for(;C(r);)r===9&&t.firstTabInLine===-1&&(t.firstTabInLine=t.position),r=t.input.charCodeAt(++t.position);if(e&&r===35){const i=t.position===t.lineStart?10:t.input.charCodeAt(t.position-1);k(i)||c(t,"a comment must be separated from other tokens by white space characters");do r=t.input.charCodeAt(++t.position);while(r!==10&&r!==13&&r!==0)}if($(r))for(ft(t),r=t.input.charCodeAt(t.position),s++,t.lineIndent=0;r===32;)t.lineIndent++,r=t.input.charCodeAt(++t.position);else break}return o!==-1&&s!==0&&t.lineIndent<o&&c(t,"deficient indentation"),s},Q=t=>{let{position:e}=t,o=t.input.charCodeAt(e);return!!((o===45||o===46)&&o===t.input.charCodeAt(e+1)&&o===t.input.charCodeAt(e+2)&&(e+=3,o=t.input.charCodeAt(e),o===0||k(o)))},Co=/^(?:!|!!|![a-z-]+!)$/i,No=t=>{let e=t.input.charCodeAt(t.position);if(e!==33)return!1;t.tag!==null&&c(t,"duplication of a tag property");let o=!1,s=!1,r="!";e=t.input.charCodeAt(++t.position),e===60?(o=!0,e=t.input.charCodeAt(++t.position)):e===33&&(s=!0,r="!!",e=t.input.charCodeAt(++t.position));let{position:i}=t,n;if(o){do e=t.input.charCodeAt(++t.position);while(e!==0&&e!==62);if(e===62)n=t.input.slice(i,t.position),t.position++;else return c(t,"unexpected end of the stream within a verbatim tag")}else{for(;e!==0&&!k(e)&&!O(e);)e===33&&(s?c(t,"tag suffix cannot contain exclamation marks"):(r=t.input.slice(i-1,t.position+1),Co.test(r)||c(t,"named tag handle cannot contain such characters"),s=!0,i=t.position+1)),e=t.input.charCodeAt(++t.position);n=t.input.slice(i,t.position)}return o?t.tag=n:t.tagMap.has(r)?t.tag=t.tagMap.get(r)+n:r==="!"?t.tag=`!${n}`:r==="!!"?t.tag=`tag:yaml.org,2002:${n}`:c(t,`undeclared tag handle "${r}"`),!0},xo=t=>{let e=t.input.charCodeAt(t.position);if(e!==38)return!1;t.anchor!==null&&c(t,"duplication of an anchor property"),e=t.input.charCodeAt(++t.position);const{position:o}=t;for(;e!==0&&!k(e)&&!O(e);)e=t.input.charCodeAt(++t.position);return t.position===o&&c(t,"name of an anchor node must contain at least one character"),t.anchor=t.input.slice(o,t.position),!0},Mo=t=>{let e=t.input.charCodeAt(t.position);if(e!==42)return!1;e=t.input.charCodeAt(++t.position);const{position:o}=t;for(;e!==0&&!k(e)&&!O(e);)e=t.input.charCodeAt(++t.position);t.position===o&&c(t,"name of an alias node must contain at least one character");const s=t.input.slice(o,t.position);return t.anchorMap.has(s)||c(t,`unidentified alias "${s}"`),t.aliasCount++,t.aliasCount>t.options.maxAliasCount&&c(t,"alias reference count limit exceeded (possible resource-exhaustion attack)"),t.result=t.build.alias(t,s),t.kind="scalar",!0},et=1,jo=2,At=3,Lo=(t,e,o)=>{t.scalarStyle="PLAIN";const s=t.kind,r=t.result,{input:i}=t;let n=i.charCodeAt(t.position);if(k(n)||O(n)||So(n))return!1;let a;if((n===63||n===45)&&(a=i.charCodeAt(t.position+1),k(a)||o&&O(a)))return!1;t.kind="scalar",t.result="";let l=t.position,u=t.position,p=!1,f=0,b=0,d=0;for(;n!==0;){if(n===58){if(a=i.charCodeAt(t.position+1),k(a)||o&&O(a))break}else if(n===35){const h=i.charCodeAt(t.position-1);if(k(h))break}else{if(t.position===t.lineStart&&Q(t)||o&&O(n))break;if($(n))if(f=t.line,b=t.lineStart,d=t.lineIndent,A(t,!1,-1),t.lineIndent>=e){p=!0,n=i.charCodeAt(t.position);continue}else{t.position=u,t.line=f,t.lineStart=b,t.lineIndent=d;break}}p&&(N(t,l,u),pt(t,t.line-f),l=t.position,u=t.position,p=!1),C(n)||(u=t.position+1),n=i.charCodeAt(++t.position)}return N(t,l,u),t.result!==""?!0:(t.kind=s,t.result=r,!1)},Oo=(t,e)=>{t.scalarStyle="QUOTE_SINGLE";let o=t.input.charCodeAt(t.position);if(o!==39)return!1;t.kind="scalar",t.result="",t.position++;let s=t.position,r=t.position;for(;(o=t.input.charCodeAt(t.position))!==0;)if(o===39)if(N(t,s,t.position),o=t.input.charCodeAt(++t.position),o===39)s=t.position,t.position++,r=t.position;else return!0;else $(o)?(N(t,s,r),pt(t,A(t,!1,e)),s=t.position,r=t.position):t.position===t.lineStart&&Q(t)?c(t,"unexpected end of the document within a single quoted scalar"):(C(o)||(r=t.position+1),t.position++);return c(t,"unexpected end of the stream within a single quoted scalar")},To=(t,e)=>{t.scalarStyle="QUOTE_DOUBLE";let o=t.input.charCodeAt(t.position);if(o!==34)return!1;t.kind="scalar",t.result="",t.position++;let s=t.position,r=t.position;for(;(o=t.input.charCodeAt(t.position))!==0;){if(o===34)return N(t,s,t.position),t.position++,!0;if(o===92){if(N(t,s,t.position),o=t.input.charCodeAt(++t.position),$(o))A(t,!1,e);else if(o<256&&y[o]!==void 0)t.result=t.result+y[o],t.position++;else{const i=$o(o);if(i>0){let n=i,a=0;for(;n>0;n--){o=t.input.charCodeAt(++t.position);const l=wo(o);l>=0?a=a*16+l:c(t,"expected hexadecimal character")}a>1114111&&c(t,`code point "${a.toString(16).toUpperCase()}" is outside the Unicode range`),t.result=t.result+String.fromCodePoint(a),t.position++}else c(t,"unknown escape sequence")}s=t.position,r=t.position}else $(o)?(N(t,s,r),pt(t,A(t,!1,e)),s=t.position,r=t.position):t.position===t.lineStart&&Q(t)?c(t,"unexpected end of the document within a double quoted scalar"):(C(o)||(r=t.position+1),t.position++)}return c(t,"unexpected end of the stream within a double quoted scalar")},Fo=(t,e)=>{let o=t.input.charCodeAt(t.position),s;if(o===124)s=!1,t.scalarStyle="BLOCK_LITERAL";else if(o===62)s=!0,t.scalarStyle="BLOCK_FOLDED";else return!1;t.kind="scalar",t.result="";let r=et,i=!1,n=!1,a=e,l=0,u=!1,p=0;for(;o!==0;)if(o=t.input.charCodeAt(++t.position),o===43||o===45)r===et?r=o===43?At:jo:c(t,"repeat of a chomping mode identifier");else{const f=Io(o);if(f>=0)f===0?c(t,"bad explicit indentation width of a block scalar; it cannot be less than one"):n?c(t,"repeat of an indentation width identifier"):(a=e+f-1,n=!0);else break}if(C(o)){do o=t.input.charCodeAt(++t.position);while(C(o));if(o===35)do o=t.input.charCodeAt(++t.position);while(!$(o)&&o!==0)}for(;o!==0;){for(ft(t),t.lineIndent=0,o=t.input.charCodeAt(t.position);(!n||t.lineIndent<a)&&o===32;)t.lineIndent++,o=t.input.charCodeAt(++t.position);if(!n&&t.lineIndent>a&&(a=t.lineIndent),$(o)){!n&&t.lineIndent>p&&(p=t.lineIndent),l++;continue}t.options.strict&&o===9&&t.lineIndent<a&&c(t,"tab characters must not be used in indentation");const f=t.position===t.lineStart&&Q(t);if(t.options.strict&&o!==0&&!f&&!n&&p>t.lineIndent&&c(t,"a block scalar's leading empty lines cannot be indented more than its content"),t.lineIndent<a||o===0||f){r===At?t.result=t.result+`
|
|
24
|
-
`.repeat(i?1+l:l):r===et&&i&&(t.result=`${t.result}
|
|
25
|
-
`);break}s?C(o)?(u=!0,t.result=t.result+`
|
|
26
|
-
`.repeat(i?1+l:l)):u?(u=!1,t.result=t.result+`
|
|
27
|
-
`.repeat(l+1)):l===0?i&&(t.result=`${t.result} `):t.result=t.result+`
|
|
28
|
-
`.repeat(l):t.result=t.result+`
|
|
29
|
-
`.repeat(i?1+l:l),i=!0,n=!0,l=0;const b=t.position;for(;!$(o)&&o!==0;)o=t.input.charCodeAt(++t.position);N(t,b,t.position)}return!0},z=1,Dt=2,Rt=3,X=4,kt=(t,e)=>{const o=t.tag,s=t.anchor,r=t.build.seq();let i=!1;if(t.firstTabInLine!==-1)return!1;const n=t.line;t.anchor!==null&&(t.build.anchor(r,t.anchor),t.anchorMap.set(t.anchor,r));let a=t.input.charCodeAt(t.position);for(;a!==0&&(t.firstTabInLine!==-1&&(t.position=t.firstTabInLine,c(t,"tab characters must not be used in indentation")),a===45);){const l=t.input.charCodeAt(t.position+1);if(!k(l))break;if(i=!0,t.position++,A(t,!0,-1)&&t.lineIndent<=e){t.build.push(r,null),a=t.input.charCodeAt(t.position);continue}const{line:u}=t;if(_(t,e,Rt,!1,!0),t.build.push(r,t.result),A(t,!0,-1),a=t.input.charCodeAt(t.position),(t.line===u||t.lineIndent>e)&&a!==0)c(t,"bad indentation of a sequence entry");else if(t.lineIndent<e)break}return i?(t.options.strict&&n===t.documentMarkerLine&&c(t,"a block collection cannot start on the same line as the document start marker"),t.tag=o,t.anchor=s,t.kind="sequence",t.result=r,!0):!1},Qt=(t,e,o)=>{const s=t.tag,r=t.anchor,i=t.build.map();let n,a=null,l=null,u=null,p=!1,f=!1,b=!1,d=-1,h=-1;if(t.firstTabInLine!==-1)return!1;const m=t.line;t.anchor!==null&&(t.build.anchor(i,t.anchor),t.anchorMap.set(t.anchor,i));let g=t.input.charCodeAt(t.position);for(;g!==0;){!p&&t.firstTabInLine!==-1&&(t.position=t.firstTabInLine,c(t,"tab characters must not be used in indentation"));const S=t.input.charCodeAt(t.position+1),{line:P}=t;if((g===63||g===58)&&k(S))g===63?(p&&(n=F(t,i,n,a,l,null),a=null,l=null,u=null),f=!0,p=!0,b=!0):p?(p=!1,b=!0):(f=!0,p=!1,b=!1,a=null,l=null),t.position+=1,g=S;else{if(d=t.position,!_(t,o,Dt,!1,!0))break;if(t.line===P){for(g=t.input.charCodeAt(t.position);C(g);)g=t.input.charCodeAt(++t.position);if(g===58)g=t.input.charCodeAt(++t.position),k(g)||c(t,"a whitespace character is expected after the key-value separator within a block mapping"),p&&(n=F(t,i,n,a,l,null),a=null,l=null,u=null),f=!0,p=!1,b=!1,a=t.tag,l=t.result,h=t.position+1;else if(f)c(t,"can not read an implicit mapping pair; a colon is missed");else return t.tag=s,t.anchor=r,!0}else if(f)c(t,"can not read a block mapping entry; a multiline key may not be an implicit key");else return t.tag=s,t.anchor=r,!0}if((t.line===P||t.lineIndent>e)&&(_(t,e,X,!0,b)&&(p?l=t.result:u=t.result),p||(vo(t,i,l,d,h,t.position),n=F(t,i,n,a,l,u),a=null,l=null,u=null,d=-1,h=-1),A(t,!0,-1),g=t.input.charCodeAt(t.position)),(t.line===P||t.lineIndent>e)&&g!==0)c(t,"bad indentation of a mapping entry");else if(t.lineIndent<e)break}return p&&F(t,i,n,a,l,null),f&&(t.options.strict&&m===t.documentMarkerLine&&c(t,"a block collection cannot start on the same line as the document start marker"),t.tag=s,t.anchor=r,t.kind="mapping",t.result=i),f},Eo=(t,e)=>{const o=t.tag,s=t.anchor;let r,i=t.input.charCodeAt(t.position),n,a,l;if(i===91)n=93,a=!1,l=t.build.seq();else if(i===123)n=125,a=!0,l=t.build.map();else return!1;t.anchor!==null&&(t.build.anchor(l,t.anchor),t.anchorMap.set(t.anchor,l)),i=t.input.charCodeAt(++t.position);let u=!0;for(;i!==0;){if(A(t,!0,e),i=t.input.charCodeAt(t.position),i===n)return t.position++,t.tag=o,t.anchor=s,t.kind=a?"mapping":"sequence",t.result=l,!0;u?i===44&&c(t,"expected the node content, but found ','"):c(t,"missed comma between flow collection entries");let p=null,f=null,b=null,d=!1;if(i===63){const m=t.input.charCodeAt(t.position+1);k(m)&&(d=!0,t.position++,A(t,!0,e))}const h=t.line;if(_(t,e,z,!1,!0),p=t.tag,f=t.result,A(t,!0,e),i=t.input.charCodeAt(t.position),i===58&&(a||d||h===t.line)&&(d=!0,t.position++,A(t,!0,e),_(t,e,z,!1,!0),b=t.result),a)r=F(t,l,r,p,f,b);else if(d){const m=t.build.map();r=F(t,m,r,p,f,b),t.build.push(l,m)}else t.build.push(l,f);A(t,!0,e),i=t.input.charCodeAt(t.position),i===44?(u=!0,i=t.input.charCodeAt(++t.position)):u=!1}return c(t,"unexpected end of the stream within a flow collection")},vt=(t,e,o,s)=>{const r=mo(t);s&&Yt(t,s),t.tag=null,t.anchor=null,t.kind=null,t.result=null;let i=!1;try{i=Qt(t,e,o)&&t.kind==="mapping"}catch(n){if(!(n instanceof x))throw n;i=!1}return i?!0:(bo(t,r),!1)},_o=(t,e,o,s,r)=>{let i=1,n=!1,a=!1,l=!1,u=!1,p=null;t.tag=null,t.anchor=null,t.kind=null,t.result=null;const f=o===X||o===Rt,b=f;let d=f;if(s&&A(t,!0,-1)&&(n=!0,t.lineIndent>e?i=1:t.lineIndent===e?i=0:i=-1),i===1)for(;;){const h=t.input.charCodeAt(t.position);if(n&&(h===33&&t.tag!==null||h===38&&t.anchor!==null)){u=!0;break}if(n&&(h===33||h===38)&&(t.tag!==null||t.anchor!==null)){const g=t.tag,S=t.anchor;if(vt(t,t.position-t.lineStart,e+1)){t.tag=g,t.anchor=S,t.anchor!==null&&t.anchorMap.set(t.anchor,t.result),l=!0;break}t.tag=g,t.anchor=S}t.options.strict&&n&&i!==1&&(h===33||h===38)&&c(t,"a node property must be indented more than its parent node");const m=qt(t);if(!No(t)&&!xo(t))break;p??=m,A(t,!0,-1)?(n=!0,d=f,t.lineIndent>e?i=1:t.lineIndent===e?i=0:i=-1):d=!1}if(d&&(d=n||r),l)a=!0;else if(i===1||o===X){const h=o===z||o===Dt?e:e+1,m=t.position-t.lineStart;if(i===1){let g=d&&(kt(t,m)||Qt(t,m,h));g||(g=Eo(t,h));const S=t.input.charCodeAt(t.position),P=p!==null&&f&&!d&&S!==124&&S!==62;let ht=!1;if(!g&&P&&p){const M=p.position-p.lineStart;ht=vt(t,M,h,p)}if(t.options.strict&&u&&t.kind!=="mapping"&&t.kind!=="sequence"&&c(t,"a node may only have one anchor and one tag"),g||ht)a=!0;else{let M=b&&Fo(t,h);M||(M=Oo(t,h)),M||(M=To(t,h)),M?a=!0:Mo(t)?(a=!0,(t.tag!==null||t.anchor!==null)&&c(t,"alias node should not have any properties")):Lo(t,h,o===z)&&(a=!0,t.tag??="?")}}else i===0&&(a=d&&kt(t,m))}if(t.tag==="?"){if(t.kind==="scalar"&&typeof t.result=="string"){const h=de(t.tags,t.result);if(h)return t.result=h.value,t.result=t.build.finish(t,t.result,a),t.anchor!==null&&t.anchorMap.set(t.anchor,t.result),t.tag!==null||t.anchor!==null||a;const m=t.resolveScalar(t.result);m===Bt&&c(t,`unquoted scalar "${t.result}" is not valid under the json schema`),t.result=m}}else if(t.tag!==null&&t.tag!=="!"&&(t.kind==="scalar"||!a&&t.kind===null)){const h=typeof t.result=="string"?t.result:"",m=t.tags?.byTag.get(t.tag);if(m)t.result=m.resolve(h);else{const g=pe(t.tag,h);g.status==="ok"?t.result=g.value:g.status==="invalid"&&c(t,`unacceptable value "${h}" for the "${t.tag}" tag`)}}return t.result=t.build.finish(t,t.result,a),t.anchor!==null&&t.anchorMap.set(t.anchor,t.result),t.tag!==null||t.anchor!==null||a},_=(t,e,o,s,r)=>{t.depth>=t.options.maxDepth&&c(t,`maximum nesting depth of ${String(t.options.maxDepth)} exceeded`),t.depth+=1;try{return _o(t,e,o,s,r)}finally{t.depth-=1}},Po=/^\d+\.\d+$/,Vt=t=>{let e=!1,o=!1;t.tagMap=new Map,t.anchorMap=new Map,t.aliasCount=0,t.resetVersionDirective();let s;for(;t.input.charCodeAt(t.position)!==0&&(A(t,!0,-1),s=t.input.charCodeAt(t.position),!(t.lineIndent>0||s!==37));){e=!0,s=t.input.charCodeAt(++t.position);let{position:n}=t;for(;s!==0&&!k(s);)s=t.input.charCodeAt(++t.position);const a=t.input.slice(n,t.position),l=[];for(a.length===0&&c(t,"directive name must not be less than one character in length");s!==0;){for(;C(s);)s=t.input.charCodeAt(++t.position);if(s===35){do s=t.input.charCodeAt(++t.position);while(s!==0&&!$(s));break}if($(s))break;for(n=t.position;s!==0&&!k(s);)s=t.input.charCodeAt(++t.position);l.push(t.input.slice(n,t.position))}s!==0&&ft(t),a==="YAML"?(o?c(t,"duplication of a YAML directive"):l.length!==1?c(t,"the YAML directive accepts exactly one argument"):Po.test(l[0]??"")||c(t,"ill-formed argument of the YAML directive"),o=!0,t.applyVersionDirective(l[0])):a==="TAG"?l.length===2?t.tagMap.set(l[0],l[1]):c(t,"the TAG directive accepts exactly two arguments"):yo(t,`unknown document directive "${a}"`)}A(t,!0,-1);let r=!1;t.lineIndent===0&&t.input.startsWith("---",t.position)&&k(t.input.charCodeAt(t.position+3))?(t.position+=3,r=!0,A(t,!0,-1)===0&&(t.documentMarkerLine=t.line)):e&&c(t,"directives end mark is expected");const i=_(t,t.lineIndent-1,X,!1,!0);if(t.documentMarkerLine=-1,A(t,!0,-1),(i||r||e)&&t.documents.push(t.result),t.position===t.lineStart&&Q(t)){if(t.input.charCodeAt(t.position)===46){t.position+=3;let n=t.input.charCodeAt(t.position);for(;n===32||n===9;)n=t.input.charCodeAt(++t.position);n!==0&&n!==35&&!$(n)&&c(t,"unexpected content after document end marker"),A(t,!0,-1)}return}t.position<t.length-1&&c(t,"end of the stream or a document separator is expected")},Bo=t=>{let e=t;if(e.length>0){const o=e.charCodeAt(e.length-1);o!==10&&o!==13&&(e+=`
|
|
30
|
-
`),e.charCodeAt(0)===65279&&(e=e.slice(1))}return e},Jt=(t,e)=>{if(typeof t!="string")throw new x(`expected a string to parse, received ${t===null?"null":typeof t}`);let o=Bo(t);if(o.includes("\0"))throw new x("null byte is not allowed in input");o+="\0";const s=new go(o,e);return s.position=0,s.lineIndent=0,s},Y=(t,e,o,s)=>{if(Array.isArray(o))for(let r=o.length-1;r>=0;r--){const i=Y(o,String(r),o[r],s);o[r]=i}else if(o instanceof Map)for(const r of o.keys()){const i=Y(o,r,o.get(r),s);i===void 0?o.delete(r):o.set(r,i)}else if(Kt(o)){const r=o;for(const i of Object.keys(r)){const n=Y(r,i,r[i],s);n===void 0?delete r[i]:r[i]=n}}return s.call(t,e,o)},Wo=(t,e={})=>{const o=Jt(t,e);for(;o.position<o.length-1;)Vt(o);const{reviver:s}=e;return s?o.documents.map(r=>Y({"":r},"",r,s)):o.documents},qo=t=>{const{input:e}=t;let o=e.indexOf(`
|
|
31
|
-
`,t.position);for(;o!==-1;){const s=o+1,r=e.slice(s,s+3);if(r==="---"||r==="...")return t.position=s,t.lineStart=s,t.line+=1,t.lineIndent=0,t.firstTabInLine=-1,t.position<t.length-1;o=e.indexOf(`
|
|
32
|
-
`,s)}return!1},Gt=(t,e={})=>{const o=[],s=Jt(t,{...e,onWarning:i=>{o.push(i),e.onWarning?.(i)}});s.mappingRanges=new WeakMap;const r=[];for(;s.position<s.length-1;){const i=s.documents.length,n=o.length,a=s.position;try{Vt(s)}catch(l){if(!(l instanceof x))throw l;if(r.push({contents:null,errors:[l],warnings:o.slice(n)}),!qo(s))break;continue}for(const l of s.documents.slice(i))r.push({contents:l,errors:[],warnings:o.slice(n)});if(s.position===a)break}return{documents:r,ranges:s.mappingRanges}},St=(t,e={})=>{const o=Wo(t,e);if(o.length!==0){if(o.length===1)return o[0];throw new x("expected a single document in the stream, but found more")}},Yo=/\s/,wt=(t,e)=>{let o=e;for(;o>0&&Yo.test(t[o-1]);)o-=1;return o},Ko=t=>typeof t=="object"&&t!==null&&!Array.isArray(t),It=(t,e,o)=>{const s=q(t,o).trimEnd();if(!s.includes(`
|
|
33
|
-
`)&&!Ko(t)&&!Array.isArray(t))return` ${s}`;const r=" ".repeat(e+(o.indent??2));return`
|
|
34
|
-
${s.split(`
|
|
35
|
-
`).map(i=>i===""?i:r+i).join(`
|
|
36
|
-
`)}`};class zt{errors;warnings;contents;#t;#e=[];#r;#o;#s;constructor(e,o,s,r={}){this.#s=e,this.#t=s,this.#r=r,this.contents=o.contents,this.errors=o.errors,this.warnings=o.warnings}toJS(e){const o=I(this.contents);return e?.reviver?Y({"":o},"",o,e.reviver):o}toJSON(){return this.toJS()}getIn(e){this.#o??={value:I(this.contents)};let o=this.#o.value;for(const s of e){if(o===null||typeof o!="object"&&typeof o!="string")return;o=o[s]}return o}get(e){return this.getIn([e])}hasIn(e){return this.getIn(e)!==void 0}has(e){return this.hasIn([e])}setIn(e,o){if(e.length===0)throw new E("setIn requires a non-empty path");const s=e.map(String);let r=this.#i(),i=0;for(;i<s.length-1;){const p=r.get(s[i],!0);if(!U(p))break;r=p,i+=1}const n=this.#t.get(r)??[],a=s.slice(i);if(n.length===0&&r!==this.contents)throw new E(`cannot edit ${JSON.stringify(e)}: the target is not a block mapping`);const l=a.length===1?n.find(p=>p.key===a[0]):void 0;l?this.#n(l,o):this.#a(n,a,o);let u=r;for(const p of a.slice(0,-1)){const f=new T;u.set(L(p),f),u=f}u.set(L(a.at(-1)),L(o)),this.#o=void 0}set(e,o){this.setIn([e],o)}toString(){if(this.#e.length===0)return this.#s;const e=this.#e.toSorted((s,r)=>r.start-s.start);let o=this.#s;for(const s of e)o=o.slice(0,s.start)+s.text+o.slice(s.end);return this.#s=o,this.#e.length=0,o}#i(){if(this.contents===null||this.contents===void 0){const e=new T;return this.contents=e,this.#o=void 0,e}if(!U(this.contents))throw new E("cannot edit a document whose root is not a mapping");return this.contents}#n(e,o){const s=It(o,e.column,this.#r),r=e.valueStart>0?e.valueStart-1:e.end,i=Math.max(r,wt(this.#s,e.end));this.#e.push({end:i,start:r,text:s})}#a(e,o,s){let r;for(const u of e)(r===void 0||u.end>r.end)&&(r=u);const i=r?.column??0;let n="";for(const[u,p]of o.entries()){const f=" ".repeat(i+u*(this.#r.indent??2));n+=`
|
|
37
|
-
${f}${p}:`,u===o.length-1&&(n+=It(s,i+u*(this.#r.indent??2),this.#r))}const a=wt(this.#s,r?.end??this.#s.length);let l=a===0?n.slice(1):n;this.#s.slice(a).includes(`
|
|
38
|
-
`)||(l+=`
|
|
39
|
-
`),this.#e.push({end:a,start:a,text:l})}}const Uo={contents:null,errors:[],warnings:[]};function Zo(t,e,o){const s=typeof e=="function"?St(t,{...o,reviver:e}):St(t,e??o);return s===void 0?null:s}function Ho(t,e,o){if(!(typeof e=="function"||Array.isArray(e)||e===null)&&e!==void 0)return q(t,e);let s={};if(typeof o=="number"?s={indent:o}:typeof o=="string"?s={indent:o.length}:o&&(s=o),Array.isArray(e)){const r=new Set(e.map(String));return q(t,{...s,replacer:(i,n)=>{if(i===""||r.has(i))return n}})}return typeof e=="function"?q(t,{...s,replacer:e}):q(t,s)}const ts=(t,e)=>{const{documents:o,ranges:s}=Gt(t,{...e,nodes:!0});return new zt(t,o[0]??Uo,s)},es=(t,e)=>{const{documents:o,ranges:s}=Gt(t,{...e,nodes:!0});return o.map(r=>new zt(t,r,s))};export{Zo as L,Ho as S,es as h,ts as y};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{createRequire as j}from"node:module";import{L as J}from"./target-merge-DVJl-7Qz.js";import{osvBloomDecode as z,osvBloomProbeBatch as K,NATIVE_BINDING_VERSION as D}from"#native";let k;const V=e=>(k??=j(import.meta.url))(e),h=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,v=e=>{if(typeof h<"u"&&h.versions&&h.versions.node){const[s,t]=h.versions.node.split(".").map(Number);if(s>22||s===22&&t>=3||s===20&&t>=16)return h.getBuiltinModule(e)}return V(e)},{createHash:H,randomUUID:P}=v("node:crypto"),{existsSync:g}=v("node:fs"),{readFile:O,mkdir:T,stat:B,writeFile:F,rename:q,unlink:G}=v("node:fs/promises"),{join:d,dirname:W}=v("node:path"),I=6;if(D!==I)throw new Error(`vis native binding ABI mismatch in osv-bloom: expected ${I}, got ${D}. Rebuild via \`pnpm --filter @visulima/vis run build:native\` or reinstall the platform binding package.`);const nt="https://endevco.github.io/osv-bloom",X=new Set(["endevco.github.io"]);class w extends Error{cause="OSV_BLOOM_SOURCE_NOT_ALLOWED";constructor(s){super(`osv-bloom source host '${s}' is not in the built-in allowlist. Add it to \`security.audit.advisories.bloom.allowedHosts\` if intentional.`),this.name="OsvBloomSourceNotAllowedError"}}class b extends Error{cause="OSV_BLOOM_NETWORK";constructor(s,t){super(`osv-bloom fetch failed for ${s}: ${t}. Check connectivity, proxy env vars, or --source.`),this.name="OsvBloomNetworkError"}}class Y extends Error{cause="OSV_BLOOM_INTEGRITY";constructor(s,t){super(`osv-bloom filter.bin sha256 mismatch (expected ${s}, got ${t}). Refusing to install a corrupted filter.`),this.name="OsvBloomIntegrityError"}}class m extends Error{cause="OSV_BLOOM_MANIFEST";constructor(s){super(`osv-bloom manifest invalid: ${s}`),this.name="OsvBloomManifestError"}}class Q extends Error{cause="OSV_BLOOM_CACHE_MISS";constructor(s){super(`No osv-bloom cache at ${s}. Run 'vis advisories bloom sync' first.`),this.name="OsvBloomCacheMissError"}}const p=e=>{const t=J("vis",{create:!0,cwd:e})??d(e,"node_modules",".cache","vis");return d(t,"osv-bloom")},l=e=>d(e,"filter.bin"),L=e=>d(e,"manifest.json"),$=e=>d(e,"state.json"),Z=(e,s)=>{let t;try{t=new URL(e)}catch{throw new w(e)}if(!t.host)throw new w(e);if(t.protocol!=="https:")throw new w(`${t.protocol}//${t.host}`);if(!new Set([...X,...s??[]]).has(t.host))throw new w(t.host);return t},at=async e=>{const s=Date.now(),t=e.cacheDir??p(e.workspaceRoot);await T(t,{recursive:!0});const r=Z(e.source,e.allowedHosts),n=new URL("manifest.json",M(r.toString())),o=new URL("filter.bin",M(r.toString())),a=await A(n,{method:"GET"});if(!a.ok)throw new b(n.toString(),a.status);const _=await a.text(),i=R(_),u=await x(t);if(!e.force&&u?.setDigestSha256===i.setDigestSha256&&g(l(t)))return{bytesOnDisk:(await B(l(t))).size,cacheDir:t,durationMs:Date.now()-s,manifest:i,upToDate:!0};const E={};!e.force&&u?.filterEtag&&(E.headers={"if-none-match":u.filterEtag});const f=await A(o,{...E,method:"GET"});if(f.status===304&&u&&g(l(t)))return await N(t,_,{fetchedAtIso:new Date().toISOString(),filterEtag:u.filterEtag,setDigestSha256:i.setDigestSha256}),{bytesOnDisk:(await B(l(t))).size,cacheDir:t,durationMs:Date.now()-s,manifest:i,upToDate:!0};if(!f.ok||!f.body)throw new b(o.toString(),f.status);const c=Buffer.from(await f.arrayBuffer());e.onProgress&&e.onProgress(c.length,c.length);const y=tt(c);if(y!==i.filterSha256)throw new Y(i.filterSha256,y);if(c.length!==i.bloomByteLen)throw new m(`filter.bin length ${c.length} does not match manifest.bloom_byte_len ${i.bloomByteLen}`);const U=f.headers.get("etag")??void 0;return await S(l(t),c),await N(t,_,{fetchedAtIso:new Date().toISOString(),filterEtag:U,setDigestSha256:i.setDigestSha256}),{bytesOnDisk:c.length,cacheDir:t,durationMs:Date.now()-s,manifest:i,upToDate:!1}},it=async(e,s)=>{const t=s?.cacheDir??p(e),r=l(t);if(!g(r)){if(s?.softFail)return null;throw new Q(t)}const n=await O(r);return z(n)},ct=(e,s)=>K(e,s),lt=async(e,s)=>{const t=s??p(e);if(!g(l(t)))return{cacheDir:t,present:!1};let n,o;try{n=R(await O(L(t),"utf8"))}catch{}try{o=await x(t)}catch{}return{cacheDir:t,fetchedAtIso:o?.fetchedAtIso,manifest:n,present:!0}},R=e=>{let s;try{s=JSON.parse(e)}catch(o){throw new m(o instanceof Error?o.message:String(o))}const t=o=>{const a=s[o];if(typeof a!="number"||Number.isNaN(a))throw new m(`field '${o}' missing or non-numeric`);return a},r=o=>{const a=s[o];if(typeof a!="string"||a.length===0)throw new m(`field '${o}' missing or empty`);return a},n=t("format_version");if(n!==1)throw new m(`unsupported format_version ${n} (this build expects v1)`);return{advisoryCount:t("advisory_count"),bloomByteLen:t("bloom_byte_len"),bloomKHashes:t("bloom_k_hashes"),bloomMBits:t("bloom_m_bits"),builtAtRfc3339:r("built_at_rfc3339"),builtAtUnix:t("built_at_unix"),entryCount:t("entry_count"),filterSha256:r("filter_sha256"),formatVersion:n,setDigestSha256:r("set_digest_sha256"),sourceUrl:r("source_url"),targetFpr:t("target_fpr")}},x=async e=>{try{const s=await O($(e),"utf8"),t=JSON.parse(s);return typeof t.setDigestSha256!="string"||typeof t.fetchedAtIso!="string"?void 0:{fetchedAtIso:t.fetchedAtIso,filterEtag:typeof t.filterEtag=="string"?t.filterEtag:void 0,setDigestSha256:t.setDigestSha256}}catch{return}},N=async(e,s,t)=>{await S(L(e),Buffer.from(s,"utf8")),await S($(e),Buffer.from(`${JSON.stringify(t,void 0,2)}
|
|
2
|
-
`,"utf8"))},S=async(e,s)=>{await T(W(e),{recursive:!0});const t=`${e}.${process.pid}.${P()}.tmp`;try{await F(t,s),await q(t,e)}catch(r){throw await G(t).catch(()=>{}),r}},tt=e=>H("sha256").update(e).digest("hex"),M=e=>e.endsWith("/")?e:`${e}/`,et=3e4,A=async(e,s)=>{try{return await fetch(e,{...s,signal:AbortSignal.timeout(et)})}catch(t){throw new b(e.toString(),t instanceof Error?t.message:String(t))}};export{nt as D,Q as O,lt as g,it as l,ct as p,at as s};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{createRequire as U}from"node:module";import{e as y,m as O,b as S,z as J}from"./index-BzhrR_iC.js";import{withEnhancedPath as Y,collectNodeModulesBinDirs as z}from"@visulima/task-runner";import{s as j}from"./index-B4AjSxHU.js";import{detectPackageManager as G,resolveAdd as H,resolveRemove as V,whichBin as X,resolveUnlink as K,resolveInstall as Q,execPmCommandInteractive as Z,resolveDlx as ee,resolveExec as ne,resolveDedupe as re,resolveWhy as se,resolveLink as ae,resolvePmCommand as ie}from"#native";import{y as R}from"./isAccessibleSync-DYKTrrvc-C-_5cgwu.js";let T;const x=e=>(T??=U(import.meta.url))(e),k=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,q=e=>{if(typeof k<"u"&&k.versions&&k.versions.node){const[n,r]=k.versions.node.split(".").map(Number);if(n>22||n===22&&r>=3||n===20&&r>=16)return k.getBuiltinModule(e)}return x(e)},{spawn:F,spawnSync:E}=q("node:child_process"),p=(e,n,r,s)=>{for(const a of n)e.push("--filter",a);r&&e.push("--recursive"),s&&e.push("--workspace-root")},te=e=>{const n=[],r=[];return p(n,e.filter,e.recursive,e.workspaceRoot),e.silent&&n.push("--silent"),e.frozenLockfile&&n.push("--frozen-lockfile"),n.push("install"),e.dev&&n.push("--dev"),e.prod&&n.push("--prod"),e.force&&n.push("--force"),e.ignoreScripts&&n.push("--ignore-scripts"),e.lockfileOnly&&n.push("--lockfile-only"),e.noOptional&&n.push("--no-optional"),e.offline&&n.push("--offline"),{args:n,bin:"aube",warnings:r}},oe=e=>{const n=[],r=[];return p(n,e.filter,!1,!1),n.push("add"),e.saveDev&&n.push("--save-dev"),e.exact&&n.push("--save-exact"),e.global&&n.push("--global"),e.optional&&n.push("--save-optional"),e.peer&&n.push("--save-peer"),e.workspace&&r.push("aube has no flag for the `workspace:` protocol; it auto-detects local workspace members during add. Ignoring --workspace."),e.workspaceRoot&&n.push("--workspace"),n.push(...e.packages),{args:n,bin:"aube",warnings:r}},ue=e=>{const n=[];return p(n,e.filter,e.recursive,!1),n.push("remove"),e.saveDev&&n.push("--save-dev"),e.global&&n.push("--global"),e.workspaceRoot&&n.push("--workspace"),n.push(...e.packages),{args:n,bin:"aube",warnings:[]}},ce=e=>{const n=["dedupe"];return e&&n.push("--check"),{args:n,bin:"aube",warnings:[]}},le=e=>{const n=[],r=[];p(n,e.filter,e.recursive,!1),n.push("why"),e.dev&&n.push("--dev"),e.prod&&n.push("--prod"),e.json&&n.push("--json"),e.long&&n.push("--long"),e.parseable&&n.push("--parseable"),e.depth!==void 0&&r.push("aube why does not accept --depth; ignoring."),e.noOptional&&r.push("aube why does not accept --no-optional; ignoring."),e.global&&r.push("aube why does not accept --global; ignoring.");const[s,...a]=e.packages;return s===void 0?r.push("aube why requires a package name; none provided."):(a.length>0&&r.push("aube why takes a single package; using the first."),n.push(s)),{args:n,bin:"aube",warnings:r}},fe=e=>{const n=[];e.silent&&n.push("--silent"),n.push("dlx");for(const r of e.additionalPackages)n.push("--package",r);return e.shellMode&&n.push("--shell-mode"),n.push(e.package),n.push(...e.args),{args:n,bin:"aube",warnings:[]}},de=e=>{const n=[];return p(n,e.filter,e.recursive,e.workspaceRoot),n.push("exec"),e.parallel&&n.push("--parallel"),e.reverse&&n.push("--reverse"),e.shellMode&&n.push("--shell-mode"),n.push(e.command),n.push(...e.args),{args:n,bin:"aube",warnings:[]}},he=e=>{const n=["link"];return e!==null&&n.push(e),{args:n,bin:"aube",warnings:[]}},pe=(e,n)=>{const r=[],s=[];return n&&r.push("--recursive"),r.push("unlink"),e.length>1&&s.push("aube unlink takes a single package; using the first."),e.length>0&&r.push(e[0]),{args:r,bin:"aube",warnings:s}},ge=e=>{const n=["view","--",e.package],r=[],[s,...a]=e.fields;return s!==void 0?(a.length>0&&r.push("aube view only supports a single field; using the first."),e.json&&r.push("aube view does not support --json with a field selector; printing the field without --json."),n.push(s)):e.json&&n.push("--json"),{args:n,bin:"aube",warnings:r}},Ye=e=>{const n=[],r=[];return p(n,e.filters,e.recursive,e.workspaceRoot),n.push("update"),e.dev&&n.push("--dev"),e.prod&&n.push("--prod"),e.global&&n.push("--global"),e.interactive&&n.push("--interactive"),e.latest&&n.push("--latest"),e.noOptional&&n.push("--no-optional"),e.noSave&&n.push("--no-save"),n.push(...e.packages),{args:n,bin:"aube",warnings:r}},be=new Set(["fund","ping","search","token"]),ke=(e,n)=>be.has(e)?{args:[e,...n],bin:"npm",warnings:[`'${e}' is not natively supported by aube. Delegating to npm.`]}:{args:[e,...n],bin:"aube",warnings:[]},w=256*1024,we=e=>{const n=e?{...process.env,...e}:{...process.env};return process.stderr.isTTY&&n.FORCE_COLOR===void 0&&n.NO_COLOR===void 0&&(n.FORCE_COLOR="1"),n},I=e=>e!==""&&!/[\s"&()<>^|%!]/u.test(e)?e:`"${e.replaceAll(/(\\*)"/gu,String.raw`$1$1\"`).replace(/(\\+)$/u,"$1$1").replaceAll(/[&()<>^|%!]/gu,String.raw`^$&`)}"`,ve=async(e,n,r)=>new Promise((s,a)=>{const i=process.platform==="win32",t=F(i?I(e):e,i?n.map(o=>I(o)):[...n],{cwd:r.cwd,env:we(r.env),shell:i,stdio:["inherit","pipe","pipe"],windowsHide:!0});let c=[],f=0;const d=o=>{if(c.push(o),f+=o.length,!(f<=w)){for(;c.length>1&&f-c[0].length>w;)f-=c.shift().length;if(c.length===1&&f>w){const h=c[0];c[0]=h.subarray(h.length-w),f=w}}},b=()=>Buffer.concat(c).toString("utf8");t.stdout?.on("data",o=>{process.stdout.write(o),d(o)}),t.stderr?.on("data",o=>{process.stderr.write(o),d(o)}),t.on("error",a),t.on("close",o=>{const h=b();c=[],s({code:o??1,output:h})})}),v=e=>{const n=j.coerce(e);return n?j.gte(n,"11.0.0"):!1},l=e=>e.name==="yarn"&&!e.version.startsWith("1."),$=e=>e.name==="yarn"&&e.version.startsWith("1."),ye=e=>e[0]==="rm"?["remove",...e.slice(1)]:e,me=(e,n,r)=>{switch(n){case"audit":return l(e)?{args:["npm","audit",...r],bin:"yarn",kind:"rewrite"}:{kind:"passthrough"};case"config":{if(l(e)){const[s,...a]=r;return s==="delete"?{args:["config","unset",...a],bin:"yarn",kind:"rewrite",warning:"yarn berry uses `config unset`, not `config delete`."}:{kind:"passthrough"}}return e.name==="bun"?{kind:"skip",warning:"bun has no `config` CLI. Edit bunfig.toml or .npmrc directly."}:e.name==="deno"?{kind:"skip",warning:"deno has no registry-config CLI. Edit deno.json directly."}:{kind:"passthrough"}}case"dist-tag":return $(e)?{args:["tag",...r],bin:"yarn",kind:"rewrite",warning:"yarn 1 has no `dist-tag`; using `yarn tag`."}:l(e)?{args:["npm","tag",...ye(r)],bin:"yarn",kind:"rewrite"}:e.name==="bun"||e.name==="deno"?{kind:"skip",warning:`${e.name} has no \`dist-tag\`. Use \`npm dist-tag\` instead.`}:{kind:"passthrough"};case"login":case"logout":return l(e)?{args:["npm",n,...r],bin:"yarn",kind:"rewrite"}:e.name==="bun"?{args:[n,...r],bin:"npm",kind:"rewrite",warning:`bun has no \`${n}\`; falling back to \`npm ${n}\` (writes ~/.npmrc, which bun reads).`}:e.name==="deno"?{kind:"skip",warning:`deno has no \`${n}\`. JSR uses browser OAuth via \`deno publish\`.`}:{kind:"passthrough"};case"owner":return e.name==="pnpm"&&v(e.version)?{args:["owner",...r],bin:"npm",kind:"rewrite",warning:"pnpm 11 removed `owner`; falling back to `npm owner`."}:l(e)?{args:["owner",...r],bin:"npm",kind:"rewrite",warning:"yarn berry has no `owner` (not in `yarn npm`); falling back to `npm owner`."}:e.name==="bun"?{args:["owner",...r],bin:"npm",kind:"rewrite",warning:"bun has no `owner`; falling back to `npm owner`."}:e.name==="deno"?{kind:"skip",warning:"deno has no `owner`. JSR uses scope-member roles via the web UI."}:{kind:"passthrough"};case"ping":return e.name==="pnpm"&&v(e.version)?{args:["ping",...r],bin:"npm",kind:"rewrite",warning:"pnpm 11 removed `ping`; falling back to `npm ping`."}:{kind:"passthrough"};case"pkg":return e.name==="bun"?{args:["pm","pkg",...r],bin:"bun",kind:"rewrite"}:e.name==="yarn"||e.name==="deno"?{args:["pkg",...r],bin:"npm",kind:"rewrite",warning:`${e.name} has no \`pkg\` command; falling back to \`npm pkg\`.`}:{kind:"passthrough"};case"plugin":return l(e)?{kind:"passthrough"}:{kind:"skip",warning:`${e.name} does not support yarn-style plugins. Skipping (no-op).`};case"prune":return $(e)?{kind:"skip",warning:"yarn 1 has no `prune`. Use `yarn install --production` for a prod-only tree."}:l(e)?{kind:"skip",warning:"yarn berry has no `prune`. Use `yarn workspaces focus --production` instead."}:e.name==="bun"||e.name==="deno"?{kind:"skip",warning:`${e.name} has no \`prune\`. Pruning happens automatically on install.`}:{kind:"passthrough"};case"publish":return l(e)?{args:["npm","publish",...r],bin:"yarn",kind:"rewrite"}:{kind:"passthrough"};case"rebuild":return $(e)?{kind:"skip",warning:"yarn 1 has no `rebuild`. Re-install instead."}:e.name==="bun"?{kind:"skip",warning:"bun has no `rebuild`. Use `bun install --force` instead."}:e.name==="deno"?{kind:"skip",warning:"deno has no `rebuild`."}:{kind:"passthrough"};case"search":return e.name==="pnpm"&&v(e.version)?{args:["search",...r],bin:"npm",kind:"rewrite",warning:"pnpm 11 removed `search`; falling back to `npm search`."}:{kind:"passthrough"};case"token":return e.name==="pnpm"&&v(e.version)?{args:["token",...r],bin:"npm",kind:"rewrite",warning:"pnpm 11 removed `token`; falling back to `npm token`."}:{kind:"passthrough"};case"whoami":return e.name==="pnpm"&&v(e.version)?{args:["whoami",...r],bin:"npm",kind:"rewrite",warning:"pnpm 11 removed `whoami`; falling back to `npm whoami`."}:l(e)?{args:["npm","whoami",...r],bin:"yarn",kind:"rewrite"}:e.name==="bun"?{args:["pm","whoami",...r],bin:"bun",kind:"rewrite"}:e.name==="deno"?{kind:"skip",warning:"deno has no `whoami`. JSR uses browser auth."}:{kind:"passthrough"};default:return{kind:"passthrough"}}},A=e=>X(e)!==null,je=e=>{const n=[["pnpm-lock.yaml","pnpm"],["yarn.lock","yarn"],["package-lock.json","npm"],["npm-shrinkwrap.json","npm"],["bun.lock","bun"],["bun.lockb","bun"],["deno.lock","deno"]];let r=e;for(;;){for(const[a,i]of n)if(R(y(r,a)))return i;const s=O(r);if(s===r||S(r).root===r)return;r=s}},ze=(e,n)=>{if(n.name!=="aube")return;const r=je(e);if(r!==void 0)return`Resolved installer is aube but the workspace has a ${r} lockfile. Aube reads and writes ${r}'s lockfile format in place, but its byte output may differ subtly — expect a one-time churn diff on the first install, and ongoing drift if your team mixes tools on the same lockfile. To pin the choice across the team, set \`install.backend\` in vis.config; to bypass aube for this run, pass --no-aube.`},C=e=>{if(R(e))try{return JSON.parse(J(e,{buffer:!1}))}catch{return}},Re=e=>{let n=e;for(;;){const r=y(n,"package.json"),s=C(r);if(s&&typeof s.packageManager=="string"&&s.packageManager.length>0)return s.packageManager;const a=O(n);if(a===n||S(n).root===n)return;n=a}},M=new Set(["npm","pnpm","yarn"]),P=(e,n,r)=>r===!1||!M.has(n)||!A("corepack")?!1:r===!0?!0:Re(e)!==void 0,Ge=(e,n)=>{const r=n.backend,s=process.env.VIS_INSTALLER,a=r??s??n.configBackend,i=n.configCorepack??"auto";if(a&&a!=="auto"){if(a==="aube"&&!A("aube"))throw new Error('install.backend is set to "aube" but the `aube` binary is not on PATH. Install it via `npm i -g @endevco/aube`, `mise use -g aube`, or `brew install endevco/tap/aube`.');return{name:a,useCorepack:P(e,a,i),version:"latest"}}if(A("aube"))return{name:"aube",useCorepack:!1,version:"latest"};const t=$e(e);return{...t,useCorepack:P(e,t.name,i)}},$e=e=>{if(!R(e))throw new Error(`Could not detect package manager in ${e}. Directory does not exist.`);const n=G(e);return{name:n.name,version:n.version||"latest"}},L=(e,n)=>n.useCorepack!==!0||!M.has(n.name)||e.bin==="corepack"||e.bin!==n.name?e:{...e,args:[n.name,...e.args],bin:"corepack"},Ae=(e,n,r)=>{if(r===void 0)return Z(e.bin,e.args,n);const s=E(e.bin,e.args,{cwd:n,env:{...process.env,...r},stdio:"inherit"});if(s.error)throw s.error;return s.status??1},u=(e,n,r,s,a={})=>{const i=L(n,e);for(const t of i.warnings)s.warn(`warning: ${t}`);return a.dry?(s.log(`[dry-run] ${i.bin} ${i.args.join(" ")}`),0):Ae(i,r,a.env)},g=(e,n,r,s,a={})=>u(e,n(),r,s,a),Oe=(e,n)=>n==="aube"||n==="deno"?e:{...e,args:[...e.args,"--prefer-offline"]},Se=(e,n,r)=>n!=="yarn"||r.startsWith("1.")||!e.args.includes("--immutable")||e.args.includes("--immutable-cache")?e:{...e,args:[...e.args,"--immutable-cache"]},W=(e,n,r)=>{let s=e.name==="aube"?te(n):Q(e.name,e.version,{...n,silent:n.silent||r.silent===!0});return r.preferOffline&&(s=Oe(s,e.name)),r.ciMode&&(s=Se(s,e.name,e.version)),s},He=(e,n,r,s,a={})=>{const i=W(e,n,a);return D(e,i,r,s,{dry:a.dry,env:a.env})},Ve=async(e,n,r,s,a={})=>{const i=L(W(e,n,a),e);for(const t of i.warnings)s.warn(`warning: ${t}`);return a.dry?(s.log(`[dry-run] ${i.bin} ${i.args.join(" ")}`),{code:0,output:""}):ve(i.bin,i.args,{cwd:r,env:a.env?{...process.env,...a.env}:process.env})},N=(e,n)=>{const r=n==="deno"?"--quiet":"--silent";return{...e,args:[...e.args,r]}},Ce=(e,n)=>n==="yarn"||n==="aube"?null:{...e,args:[...e.args,"--dry-run"]},D=(e,n,r,s,a)=>{if(a.dry!==!0)return u(e,n,r,s,a);const i=Ce(n,e.name);return i===null?u(e,n,r,s,a):u(e,i,r,s,{env:a.env})},De=(e,n)=>n==="aube"?{...e,args:[...e.args,"--ignore-scripts"]}:n==="deno"?e:{...e,args:[...e.args,"--ignore-scripts"]},_e=(e,n,r,s,a={})=>{let i=e.name==="aube"?oe(n):H(e.name,e.version,n);a.ignoreScripts&&(i=De(i,e.name)),a.silent&&(i=N(i,e.name));const t=D(e,i,r,s,{dry:a.dry,env:a.env});return t===0&&a.autoInstallPeers&&Me(e,n,r,s,a),t},Ie=e=>{if(e.startsWith("@")){const r=e.indexOf("/");if(r===-1)return e;const s=e.indexOf("@",r);return s===-1?e:e.slice(0,s)}const n=e.indexOf("@");return n===-1?e:e.slice(0,n)},Pe=(e,n)=>{let r=e;for(;;){const s=y(r,"node_modules",n,"package.json"),a=C(s);if(a)return a;const i=O(r);if(i===r||S(r).root===r)return;r=i}},Ee=e=>{const n=C(y(e,"package.json")),r=new Set;if(!n)return r;for(const s of["dependencies","devDependencies","peerDependencies","optionalDependencies"]){const a=n[s];if(a)for(const i of Object.keys(a))r.add(i)}return r},Me=(e,n,r,s,a)=>{if(e.name==="deno")return;const i=Ee(r),t=new Map;for(const d of n.packages){const b=Ie(d),o=Pe(r,b);if(!o?.peerDependencies)continue;const h=o.peerDependenciesMeta??{};for(const[m,B]of Object.entries(o.peerDependencies))h[m]?.optional||i.has(m)||t.has(m)||t.set(m,B)}if(t.size===0)return;const c=[...t.entries()].map(([d,b])=>`${d}@${b}`);s.log(`auto-installing peer dependencies: ${c.join(", ")}`);const f={exact:!1,filter:n.filter,global:!1,optional:!1,packages:c,peer:!1,saveDev:n.saveDev,workspace:!1,workspaceRoot:n.workspaceRoot};_e(e,f,r,s,{ignoreScripts:a.ignoreScripts})},Xe=(e,n,r,s,a={})=>{let i=e.name==="aube"?ue(n):V(e.name,e.version,n);return a.silent&&(i=N(i,e.name)),D(e,i,r,s,{dry:a.dry,env:a.env})},Ke=(e,n,r,s,a={})=>e.name==="aube"?u(e,ce(n),r,s,a):g(e,()=>re(e.name,e.version,n),r,s,a),Qe=(e,n,r,s,a={})=>e.name==="aube"?u(e,le(n),r,s,a):g(e,()=>se(e.name,e.version,n),r,s,a),Le=(e,n)=>{if(e.name==="aube")return ge(n);const r=[],s=[],a=e.name;switch(e.name){case"bun":{const i=j.coerce(e.version);i&&j.lt(i,"1.3.0")&&s.push(`bun ${e.version} does not support \`bun pm view\` (added in bun 1.3). Upgrade bun, or run \`npm view ${n.package}\` instead.`),r.push("pm","view","--",n.package,...n.fields),n.json&&r.push("--json");break}case"deno":{const i=n.package.startsWith("npm:")||n.package.startsWith("jsr:")||n.package.startsWith("https://")||n.package.startsWith("http://")||n.package.startsWith("file:")?n.package:`npm:${n.package}`;r.push("info","--",i),n.json&&r.push("--json"),n.fields.length>0&&s.push("deno info does not accept field selectors; ignoring.");break}case"npm":case"pnpm":{r.push("view","--",n.package,...n.fields),n.json&&r.push("--json");break}case"yarn":{if(e.version.startsWith("1.")){r.push("info","--",n.package);const[i,...t]=n.fields;i!==void 0&&(t.length>0&&s.push("yarn v1 only supports querying one field at a time; using the first."),r.push(i)),n.json&&r.push("--json")}else r.push("npm","info","--",n.package),n.fields.length>0&&s.push("yarn berry does not support field arguments to 'npm info'; ignoring."),n.json&&r.push("--json");break}default:{const i=e.name;throw new Error(`Unsupported package manager: ${i}`)}}return{args:r,bin:a,warnings:s}},Ze=(e,n,r,s,a={})=>u(e,Le(e,n),r,s,a),en=(e,n,r,s,a={})=>e.name==="aube"?u(e,he(n),r,s,a):g(e,()=>ae(e.name,e.version,n),r,s,a),nn=(e,n,r,s,a,i={})=>e.name==="aube"?u(e,pe(n,r),s,a,i):g(e,()=>K(e.name,e.version,n,r),s,a,i),We=(e,n,r)=>{if(e.args.includes("--offline")||e.args.includes("--cached-only"))return e;const s=(a,i)=>{const t=[...e.args];return t.splice(i,0,a),{...e,args:t}};switch(n){case"aube":case"pnpm":return s("--offline",1);case"bun":return{...e,warnings:[...e.warnings,"bun x does not support --offline. Pre-install the package via `vis install` so bun x resolves from the local cache."]};case"deno":return s("--cached-only",1);case"npm":return s("--offline",1);case"yarn":return r.startsWith("1.")?s("--offline",0):{...e,warnings:[...e.warnings,"yarn berry has no --offline flag for dlx. Configure `enableNetwork: false` in .yarnrc.yml or set `enableMirror: true` for offline-first behavior."]};default:{const a=n;return{...e,warnings:[...e.warnings,`applyDlxOffline: unsupported pm ${String(a)}`]}}}},rn=(e,n,r,s,a={})=>{let i=e.name==="aube"?fe(n):ee(e.name,e.version,n);return a.offline&&(i=We(i,e.name,e.version)),u(e,i,r,s,{dry:a.dry,env:a.env})},_=process.platform==="win32",Ne=_?[".exe",".cmd",".bat",".ps1",""]:[""],Be=(e,n)=>{if(!(e.includes("/")||e.includes("\\")))for(const r of z(n))for(const s of Ne){const a=y(r,`${e}${s}`);if(R(a))return _?a.replaceAll("/","\\"):a}},sn=(e,n,r)=>{const s=Be(e,r);if(s===void 0||_&&!s.toLowerCase().endsWith(".exe"))return null;const a=E(s,n,{cwd:r,env:Y({...process.env},r),stdio:"inherit"});if(a.error)throw a.error;return a.status??1},an=(e,n,r,s,a={})=>e.name==="aube"?u(e,de(n),r,s,a):g(e,()=>ne(e.name,e.version,n),r,s,a),tn=(e,n,r,s,a,i={})=>{if(e.name==="aube")return u(e,ke(n,r),s,a,i);const t=me(e,n,r);return t.kind==="skip"?(a.warn(`warning: ${t.warning}`),0):t.kind==="rewrite"?u(e,{args:t.args,bin:t.bin,warnings:t.warning?[t.warning]:[]},s,a,i):g(e,()=>ie(e.name,e.version,n,r),s,a,i)};export{Ge as a,an as b,_e as c,$e as d,Ke as e,Ze as f,ze as g,Ve as h,en as i,tn as j,Xe as k,nn as l,Qe as m,He as n,rn as o,Ye as p,sn as r,ve as s};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{e as d,m as E,b}from"./index-BzhrR_iC.js";import{y as u}from"./isAccessibleSync-DYKTrrvc-C-_5cgwu.js";const g={id:"bun",label:"Bun",lockfiles:["bun.lock","bun.lockb"],scriptSource:"package.json"},R={id:"node",label:"Node.js",lockfiles:["pnpm-lock.yaml","yarn.lock","package-lock.json","npm-shrinkwrap.json"],scriptSource:"package.json"},l={bun:g,node:R},a=["node","bun"],i={"deno.lock":"deno"},j=a.flatMap(n=>l[n].lockfiles.map(e=>[e,n])),p="Deno is not supported yet (deferred — see rfc/design-runtime-multitool.md).",s=(n,e)=>{if(n==="node"||n==="bun")return n;throw n in i||n==="deno"?new Error(`${e} requested runtime "${n}", but ${p}`):new Error(`${e} requested unknown runtime "${n}". Supported: ${a.join(", ")}.`)},D=n=>{let e=n;for(;;){for(const[o,t]of j)if(u(d(e,o)))return{runtime:t};for(const o of Object.keys(i))if(u(d(e,o)))return{deferred:i[o]};const r=E(e);if(r===e||b(e).root===e)return{};e=r}},$=(n,e={})=>{const r=e.env??process.env,o=(f,m,k)=>({adapter:l[f],deferredNotice:k,runtime:f,source:m});if(e.flag!==void 0&&e.flag!=="")return o(s(e.flag,"--runtime"),"flag");const t=r.VIS_RUNTIME;if(t!==void 0&&t!=="")return o(s(t,"VIS_RUNTIME"),"env");if(e.config!==void 0)return o(s(e.config,"config runtime:"),"config");const c=D(n);return c.runtime!==void 0?o(c.runtime,"lockfile"):c.deferred!==void 0?o("node","default",`Detected a ${c.deferred} project but ${p} Falling back to node.`):o("node","default")};export{$ as r};
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import{createRequire as ue}from"node:module";import{_ as he}from"./index-BzhrR_iC.js";import{y as be}from"./isAccessibleSync-DYKTrrvc-C-_5cgwu.js";import{U as ve}from"./writeFileSync-DJoHk3Ks-BPRoepNw.js";let me;const de=e=>(me??=ue(import.meta.url))(e),x=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,ge=e=>{if(typeof x<"u"&&x.versions&&x.versions.node){const[t,s]=x.versions.node.split(".").map(Number);if(t>22||t===22&&s>=3||t===20&&s>=16)return x.getBuiltinModule(e)}return de(e)},{createRequire:ne}=ge("node:module"),ye=/^(?:( )+|\t+)/,M="space";function Z(e,t,s){return e&&t===M&&s===1}function G(e,t){const s=new Map;let o=0,r,n;for(const c of e.split(/\n/g)){if(!c)continue;const i=c.match(ye);if(i===null)o=0,r="";else{const u=i[0].length,a=i[1]?M:"tab";if(Z(t,a,u))continue;a!==r&&(o=0),r=a;let l=1,p=0;const f=u-o;if(o=u,f===0)l=0,p=1;else{const g=Math.abs(f);if(Z(t,a,g))continue;n=xe(a,g)}const m=s.get(n);s.set(n,m===void 0?[1,0]:[m[0]+l,m[1]+p])}}return s}function xe(e,t){return(e===M?"s":"t")+String(t)}function we(e){const t=e[0]==="s"?M:"tab",s=Number(e.slice(1));return{type:t,amount:s}}function Te(e){let t,s=0,o=0;for(const[r,[n,c]]of e)(n>s||n===s&&c>o)&&(s=n,o=c,t=r);return t}function ke(e,t){return(e===M?" ":" ").repeat(t)}function ze(e){if(typeof e!="string")throw new TypeError("Expected a string");let t=G(e,!0);t.size===0&&(t=G(e,!1));const s=Te(t);let o,r=0,n="";return s!==void 0&&({type:o,amount:r}=we(s),n=ke(o,r)),{amount:r,type:o,indent:n}}let $e;const Ee=e=>($e??=ne(import.meta.url))(e),w=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,Ne=e=>{if(typeof w<"u"&&w.versions&&w.versions.node){const[t,s]=w.versions.node.split(".").map(Number);if(t>22||t===22&&s>=3||t===20&&s>=16)return w.getBuiltinModule(e)}return Ee(e)},{readFileSync:Se}=Ne("node:fs"),os=(e,t,s={})=>{const{detectIndent:o,indent:r,replacer:n,stringify:c=JSON.stringify,...i}={indent:" ",...s};let u=r,a=`
|
|
2
|
-
`;if(be(e,he))try{const p=Se(e,"utf8");if(o){const{indent:f}=ze(p);u=f}a=p.endsWith(`
|
|
3
|
-
`)?`
|
|
4
|
-
`:""}catch(p){if(p.code!=="ENOENT")throw p}const l=c(t,n,u);ve(e,`${l}${a}`,i)};let _e;const je=e=>(_e??=ne(import.meta.url))(e),b=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,re=e=>{if(typeof b<"u"&&b.versions&&b.versions.node){const[t,s]=b.versions.node.split(".").map(Number);if(t>22||t===22&&s>=3||t===20&&s>=16)return b.getBuiltinModule(e)}return je(e)},{homedir:Ce,tmpdir:B}=re("node:os"),{env:A,cwd:Ie,platform:V}=b,{createRequire:h}=re("node:module"),Ae=0,ie=2,Oe=Symbol("findUpStop"),Me=/^[A-Z]:\//i,y=(e="")=>e&&e.replaceAll("\\","/").replace(Me,t=>t.toUpperCase()),Re=/^[/\\](?![/\\])|^[/\\]{2}(?!\.)|^[A-Z]:[/\\]/i,ce=/^[A-Z]:$/i,Le=/[^/](\.[^./]+)$/,De=/^[/\\]|^[a-z]:[/\\]/i,Be=/\/$/,Fe=()=>{if(typeof process.cwd=="function")try{const e=process.cwd();if(typeof e=="string")return y(e)}catch{}return"/"},Ue=(e,t)=>{let s="",o=0,r=-1,n=0,c;for(let i=0;i<=e.length;++i){if(i<e.length)c=e[i];else{if(c==="/")break;c="/"}if(c==="/"){if(!(r===i-1||n===1))if(n===2){if(s.length<2||o!==2||!s.endsWith(".")||s.at(-2)!=="."){if(s.length>2){const u=s.lastIndexOf("/");u===-1?(s="",o=0):(s=s.slice(0,u),o=s.length-1-s.lastIndexOf("/")),r=i,n=0;continue}else if(s.length>0){s="",o=0,r=i,n=0;continue}}t&&(s+=s.length>0?"/..":"..",o=2)}else s.length>0?s+=`/${e.slice(r+1,i)}`:s=e.slice(r+1,i),o=i-r-1;r=i,n=0}else c==="."&&n!==-1?++n:n=-1}return s},O=e=>Re.test(e),F=function(...e){e=e.map(o=>y(o));let t="",s=!1;for(let o=e.length-1;o>=-1&&!s;o--){const r=o>=0?e[o]:Fe();!r||r.length===0||(t=`${r}/${t}`,s=O(r))}return t=Ue(t,!s),ce.test(t)?`${t}/`:s&&!O(t)?`/${t}`:t.length>0?t:"."},Pe=function(e){return Le.exec(y(e))?.[1]??""},le=e=>{const t=y(e).replace(Be,""),s=t.lastIndexOf("/");if(s===-1)return O(e)?"/":".";const o=t.slice(0,s);return ce.test(o)?`${o}/`:o||(O(e)?"/":".")},qe=(e,t)=>{const s=y(e);return s.slice(s.lastIndexOf("/")+1)},We=function(e){const t=De.exec(e)?.[0]?.replaceAll("\\","/")??"",s=qe(e),o=Pe(s);return{base:s,dir:le(e),ext:o,name:s.slice(0,s.length-o.length),root:t}};let He;const Ze=e=>(He??=h(import.meta.url))(e),T=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,Ge=e=>{if(typeof T<"u"&&T.versions&&T.versions.node){const[t,s]=T.versions.node.split(".").map(Number);if(t>22||t===22&&s>=3||t===20&&s>=16)return T.getBuiltinModule(e)}return Ze(e)},{fileURLToPath:Ve}=Ge("node:url");function Xe(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var X,Y;function Ye(){return Y||(Y=1,X=["3dm","3ds","3g2","3gp","7z","a","aac","adp","afdesign","afphoto","afpub","ai","aif","aiff","alz","ape","apk","appimage","ar","arj","asf","au","avi","bak","baml","bh","bin","bk","bmp","btif","bz2","bzip2","cab","caf","cgm","class","cmx","cpio","cr2","cr3","cur","dat","dcm","deb","dex","djvu","dll","dmg","dng","doc","docm","docx","dot","dotm","dra","DS_Store","dsk","dts","dtshd","dvb","dwg","dxf","ecelp4800","ecelp7470","ecelp9600","egg","eol","eot","epub","exe","f4v","fbs","fh","fla","flac","flatpak","fli","flv","fpx","fst","fvt","g3","gh","gif","graffle","gz","gzip","h261","h263","h264","icns","ico","ief","img","ipa","iso","jar","jpeg","jpg","jpgv","jpm","jxr","key","ktx","lha","lib","lvp","lz","lzh","lzma","lzo","m3u","m4a","m4v","mar","mdi","mht","mid","midi","mj2","mka","mkv","mmr","mng","mobi","mov","movie","mp3","mp4","mp4a","mpeg","mpg","mpga","mxu","nef","npx","numbers","nupkg","o","odp","ods","odt","oga","ogg","ogv","otf","ott","pages","pbm","pcx","pdb","pdf","pea","pgm","pic","png","pnm","pot","potm","potx","ppa","ppam","ppm","pps","ppsm","ppsx","ppt","pptm","pptx","psd","pya","pyc","pyo","pyv","qt","rar","ras","raw","resources","rgb","rip","rlc","rmf","rmvb","rpm","rtf","rz","s3m","s7z","scpt","sgi","shar","snap","sil","sketch","slk","smv","snk","so","stl","suo","sub","swf","tar","tbz","tbz2","tga","tgz","thmx","tif","tiff","tlz","ttc","ttf","txz","udf","uvh","uvi","uvm","uvp","uvs","uvu","viv","vob","war","wav","wax","wbmp","wdp","weba","webm","webp","whl","wim","wm","wma","wmv","wmx","woff","woff2","wrm","wvx","xbm","xif","xla","xlam","xls","xlsb","xlsm","xlsx","xlt","xltm","xltx","xm","xmind","xpi","xpm","xwd","xz","z","zip","zipx"]),X}var Je=Ye();const Ke=Xe(Je);new Set(Ke);const L=e=>y(e instanceof URL?Ve(e):e),pe=e=>{if(!e||!(e instanceof URL)&&typeof e!="string")throw new TypeError("Path must be a non-empty string or URL.")},J=e=>{if(e.isFile())return"file";if(e.isDirectory())return"dir";if(e.isSymbolicLink())return"symlink"};let Qe;const et=e=>(Qe??=h(import.meta.url))(e),k=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,tt=e=>{if(typeof k<"u"&&k.versions&&k.versions.node){const[t,s]=k.versions.node.split(".").map(Number);if(t>22||t===22&&s>=3||t===20&&s>=16)return k.getBuiltinModule(e)}return et(e)},{lstat:ns,mkdir:rs}=tt("node:fs/promises");let st;const ot=e=>(st??=h(import.meta.url))(e),z=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,nt=e=>{if(typeof z<"u"&&z.versions&&z.versions.node){const[t,s]=z.versions.node.split(".").map(Number);if(t>22||t===22&&s>=3||t===20&&s>=16)return z.getBuiltinModule(e)}return ot(e)},{lstatSync:K,mkdirSync:rt}=nt("node:fs"),$=e=>{pe(e);try{const t=K(e);if(!t.isDirectory())throw new Error(`Ensure path exists, expected 'dir', got '${String(J(t))}'`);return}catch(t){if(t.code!=="ENOENT")throw t}try{rt(e,{recursive:!0})}catch(t){if(t.code!=="EEXIST")throw t;const s=K(e);if(!s.isDirectory())throw new Error(`Ensure path exists, expected 'dir', got '${String(J(s))}'`,{cause:t})}};let it;const ct=e=>(it??=h(import.meta.url))(e),E=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,lt=e=>{if(typeof E<"u"&&E.versions&&E.versions.node){const[t,s]=E.versions.node.split(".").map(Number);if(t>22||t===22&&s>=3||t===20&&s>=16)return E.getBuiltinModule(e)}return ct(e)},{stat:is,lstat:cs}=lt("node:fs/promises");let pt;const at=e=>(pt??=h(import.meta.url))(e),N=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,ft=e=>{if(typeof N<"u"&&N.versions&&N.versions.node){const[t,s]=N.versions.node.split(".").map(Number);if(t>22||t===22&&s>=3||t===20&&s>=16)return N.getBuiltinModule(e)}return at(e)},{statSync:ut,lstatSync:mt}=ft("node:fs"),dt=(e,t={})=>{const s=t.cwd?L(t.cwd):process.cwd();let o=F(s);const{root:r}=We(o),n=L(t.stopAt??r),c=F(o,n),i=t.type??"file",u=function(l){return[e]};t.allowSymlinks??=!0;const a=t.allowSymlinks?ut:mt;for(;o;){for(let l of u()){if(l===Oe)return;if(l===void 0)continue;Buffer.isBuffer(l)?l=l.toString():l instanceof URL&&(l=L(l));const p=O(l)?l:F(o,l);try{const f=a(p);if(i==="file"&&f.isFile()||i==="directory"&&f.isDirectory())return p}catch{}}if(o===c||o===r)break;o=le(o)}};let gt;const ht=e=>(gt??=h(import.meta.url))(e),S=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,bt=e=>{if(typeof S<"u"&&S.versions&&S.versions.node){const[t,s]=S.versions.node.split(".").map(Number);if(t>22||t===22&&s>=3||t===20&&s>=16)return S.getBuiltinModule(e)}return ht(e)},{access:ls}=bt("node:fs/promises");let vt;const yt=e=>(vt??=h(import.meta.url))(e),_=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,xt=e=>{if(typeof _<"u"&&_.versions&&_.versions.node){const[t,s]=_.versions.node.split(".").map(Number);if(t>22||t===22&&s>=3||t===20&&s>=16)return _.getBuiltinModule(e)}return yt(e)},{accessSync:wt}=xt("node:fs");function D(e,t=Ae){pe(e),e=L(e);try{return wt(e,t),!0}catch{return!1}}class Tt extends Error{constructor(t){super(`ENOENT: ${t}`)}get code(){return"ENOENT"}set code(t){throw new Error("Cannot overwrite code ENOENT")}get name(){return"NotFoundError"}set name(t){throw new Error("Cannot overwrite name of NotFoundError")}}let kt;const zt=e=>(kt??=h(import.meta.url))(e),j=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,q=e=>{if(typeof j<"u"&&j.versions&&j.versions.node){const[t,s]=j.versions.node.split(".").map(Number);if(t>22||t===22&&s>=3||t===20&&s>=16)return j.getBuiltinModule(e)}return zt(e)},$t=q("fs"),Et=q("os"),Nt=q("path");var U={},Q;function St(){if(Q)return U;Q=1;var e=Object.defineProperty,t=(l,p)=>e(l,"name",{value:p,configurable:!0}),s=$t,o=Et,r=Nt;const n=t(l=>{let p="";for(let f=0;f<l.length;f+=1){const m=l[f],g=m.toUpperCase();p+=m===g?m.toLowerCase():g}return p},"invertCase"),c=new Map,i=t((l,p)=>{const f=r.join(l,`.is-fs-case-sensitive-test-${process.pid}`);try{return p.writeFileSync(f,""),!p.existsSync(n(f))}finally{try{p.unlinkSync(f)}catch{}}},"checkDirectoryCaseWithWrite"),u=t((l,p,f)=>{try{return i(l,f)}catch(m){if(p===void 0)return i(o.tmpdir(),f);throw m}},"checkDirectoryCaseWithFallback"),a=t((l,p=s,f=!0)=>{const m=l??process.cwd();if(f&&c.has(m))return c.get(m);let g;const H=n(m);return H!==m&&p.existsSync(m)?g=!p.existsSync(H):g=u(m,l,p),f&&c.set(m,g),g},"isFsCaseSensitive");return U.isFsCaseSensitive=a,U}var _t=St();_t.isFsCaseSensitive;const jt=/^[A-Z]:\//i,R=(e="")=>e&&e.replaceAll("\\","/").replace(jt,t=>t.toUpperCase()),Ct=/^[/\\]{2}/,It=/^[/\\](?![/\\])|^[/\\]{2}(?!\.)|^[A-Z]:[/\\]/i,W=/^[A-Z]:$/i,At=/\/$/,Ot=()=>{if(typeof process.cwd=="function")try{const e=process.cwd();if(typeof e=="string")return R(e)}catch{}return"/"},P="/",ae=(e,t)=>{let s="",o=0,r=-1,n=0,c;for(let i=0;i<=e.length;++i){if(i<e.length)c=e[i];else{if(c==="/")break;c="/"}if(c==="/"){if(!(r===i-1||n===1))if(n===2){if(s.length<2||o!==2||!s.endsWith(".")||s.at(-2)!=="."){if(s.length>2){const u=s.lastIndexOf("/");u===-1?(s="",o=0):(s=s.slice(0,u),o=s.length-1-s.lastIndexOf("/")),r=i,n=0;continue}else if(s.length>0){s="",o=0,r=i,n=0;continue}}t&&(s+=s.length>0?"/..":"..",o=2)}else s.length>0?s+=`/${e.slice(r+1,i)}`:s=e.slice(r+1,i),o=i-r-1;r=i,n=0}else c==="."&&n!==-1?++n:n=-1}return s},v=e=>It.test(e),Mt=function(e){if(e.length===0)return".";e=R(e);const t=Ct.exec(e),s=v(e),o=e.at(-1)==="/";return e=ae(e,!s),e.length===0?s?"/":o?"./":".":(o&&(e+="/"),W.test(e)&&(e+="/"),t?s?`//${e}`:`//./${e}`:s&&!v(e)?`/${e}`:e)},d=(...e)=>{let t="";for(const s of e)if(s)if(t.length>0){const o=t.at(-1)==="/",r=s[0]==="/";o&&r?t+=s.slice(1):t+=o||r?s:`/${s}`}else t+=s;return Mt(t)},Rt=function(...e){e=e.map(o=>R(o));let t="",s=!1;for(let o=e.length-1;o>=-1&&!s;o--){const r=o>=0?e[o]:Ot();!r||r.length===0||(t=`${r}/${t}`,s=v(r))}return t=ae(t,!s),W.test(t)?`${t}/`:s&&!v(t)?`/${t}`:t.length>0?t:"."},Lt=e=>{const t=R(e).replace(At,""),s=t.lastIndexOf("/");if(s===-1)return v(e)?"/":".";const o=t.slice(0,s);return W.test(o)?`${o}/`:o||(v(e)?"/":".")};let Dt;const Bt=e=>(Dt??=h(import.meta.url))(e),C=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,Ft=e=>{if(typeof C<"u"&&C.versions&&C.versions.node){const[t,s]=C.versions.node.split(".").map(Number);if(t>22||t===22&&s>=3||t===20&&s>=16)return C.getBuiltinModule(e)}return Bt(e)},{fileURLToPath:Ut}=Ft("node:url");function Pt(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var ee,te;function qt(){return te||(te=1,ee=["3dm","3ds","3g2","3gp","7z","a","aac","adp","afdesign","afphoto","afpub","ai","aif","aiff","alz","ape","apk","appimage","ar","arj","asf","au","avi","bak","baml","bh","bin","bk","bmp","btif","bz2","bzip2","cab","caf","cgm","class","cmx","cpio","cr2","cr3","cur","dat","dcm","deb","dex","djvu","dll","dmg","dng","doc","docm","docx","dot","dotm","dra","DS_Store","dsk","dts","dtshd","dvb","dwg","dxf","ecelp4800","ecelp7470","ecelp9600","egg","eol","eot","epub","exe","f4v","fbs","fh","fla","flac","flatpak","fli","flv","fpx","fst","fvt","g3","gh","gif","graffle","gz","gzip","h261","h263","h264","icns","ico","ief","img","ipa","iso","jar","jpeg","jpg","jpgv","jpm","jxr","key","ktx","lha","lib","lvp","lz","lzh","lzma","lzo","m3u","m4a","m4v","mar","mdi","mht","mid","midi","mj2","mka","mkv","mmr","mng","mobi","mov","movie","mp3","mp4","mp4a","mpeg","mpg","mpga","mxu","nef","npx","numbers","nupkg","o","odp","ods","odt","oga","ogg","ogv","otf","ott","pages","pbm","pcx","pdb","pdf","pea","pgm","pic","png","pnm","pot","potm","potx","ppa","ppam","ppm","pps","ppsm","ppsx","ppt","pptm","pptx","psd","pya","pyc","pyo","pyv","qt","rar","ras","raw","resources","rgb","rip","rlc","rmf","rmvb","rpm","rtf","rz","s3m","s7z","scpt","sgi","shar","snap","sil","sketch","slk","smv","snk","so","stl","suo","sub","swf","tar","tbz","tbz2","tga","tgz","thmx","tif","tiff","tlz","ttc","ttf","txz","udf","uvh","uvi","uvm","uvp","uvs","uvu","viv","vob","war","wav","wax","wbmp","wdp","weba","webm","webp","whl","wim","wm","wma","wmv","wmx","woff","woff2","wrm","wvx","xbm","xif","xla","xlam","xls","xlsb","xlsm","xlsx","xlt","xltm","xltx","xm","xmind","xpi","xpm","xwd","xz","z","zip","zipx"]),ee}var Wt=qt();const Ht=Pt(Wt);new Set(Ht);const fe=e=>R(e instanceof URL?Ut(e):e),se=e=>{const t=Ce();if(V==="win32"){const n=A.LOCALAPPDATA,c=t?d(t,"AppData","Local"):B(),i=n&&n.length>0?n:c;return d(i,e,"Cache")}if(V==="darwin"){const n=t?d(t,"Library","Caches"):B();return d(n,e)}const s=A.XDG_CACHE_HOME,o=t?d(t,".cache"):B(),r=s&&s.length>0?s:o;return d(r,e)},Zt=e=>{if(e.length===0)return;const t=e.map(n=>Rt(fe(n)).split(P));let s=Number.POSITIVE_INFINITY;for(const n of t)n.length<s&&(s=n.length);const o=[];for(let n=0;n<s;n+=1){const c=t[0][n];if(t.every(i=>i[n]===c))o.push(c);else break}const r=o.join(P);return r===""?P:r},I=(e,t)=>{if(e!==void 0)return t?(...s)=>d(e,...s):e},Gt=e=>{if(e?.files&&e.files.length>0){const t=Zt(e.files);if(t!==void 0)return t}return e?.cwd??Ie()},Vt=e=>new Tt(`No package.json found searching upwards from '${fe(e)}'.`),Xt=e=>!D(e,ie)&&D(e),Yt=(e,t)=>{if(A.CACHE_DIR&&!["0","1","false","true"].includes(A.CACHE_DIR)){const a=d(A.CACHE_DIR,e);return t?.create&&$(a),I(a,t?.thunk)}const s=Gt(t),o=dt("package.json",{cwd:s,type:"file"});if(!o){if(t?.useGlobalCacheFallback){const a=se(e);return t.create&&$(a),I(a,t.thunk)}if(t?.throwError)throw Vt(s);return}const r=Lt(o),n=d(r,"node_modules"),c=d(n,".cache"),i=d(c,e);if(D(i,ie))return t?.create&&$(i),I(i,t?.thunk);const u=[i,c,n];if(D(n)||u.push(r),u.some(a=>Xt(a))){if(t?.useGlobalCacheFallback){const a=se(e);return t.create&&$(a),I(a,t.thunk)}return}return t?.create&&$(i),I(i,t?.thunk)},ps=Yt,oe="@inherit",Jt=["aliases","dependsOn","inputs","outputs"],Kt=(e,t)=>{if(t===void 0)return e===void 0?void 0:[...e];if(!t.includes(oe))return[...t];const s=[];for(const o of t){if(o===oe){e!==void 0&&s.push(...e);continue}s.push(o)}return s},as=(e,t)=>{const s={...e,...t};for(const o of Jt){const r=e?.[o],n=t?.[o],c=Kt(r,n);c===void 0?delete s[o]:s[o]=c}return s};export{ps as L,os as T,as as m};
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import{createRequire as z}from"node:module";import{e as p,l as H,z as M}from"./index-BzhrR_iC.js";import{y as v}from"./isAccessibleSync-DYKTrrvc-C-_5cgwu.js";import{p as A}from"./readJsonSync-CbryXYxN-EWl7_7KX.js";let B;const D=e=>(B??=z(import.meta.url))(e),k=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,T=e=>{if(typeof k<"u"&&k.versions&&k.versions.node){const[n,t]=k.versions.node.split(".").map(Number);if(n>22||n===22&&t>=3||n===20&&t>=16)return k.getBuiltinModule(e)}return D(e)},{execFileSync:P}=T("node:child_process"),{randomBytes:L}=T("node:crypto"),{writeFileSync:V,renameSync:q,unlinkSync:R}=T("node:fs"),{delimiter:U}=T("node:path"),J=["proto","mise","fnm","volta","asdf","nvm","corepack"],G={asdf:["bun","deno","go","node","npm","pnpm","python","ruby","rust","yarn"],corepack:["npm","pnpm","yarn"],fnm:["node"],mise:["aube","bun","deno","go","node","npm","pnpm","python","ruby","rust","yarn"],nvm:["node"],proto:["bun","deno","go","node","npm","pnpm","python","ruby","rust","yarn"],volta:["node","npm","pnpm","yarn"]},Z=["proto","mise","fnm","volta","asdf","nvm","corepack"],O={asdf:[".tool-versions"],corepack:[],fnm:[".nvmrc",".node-version"],mise:[".mise.toml",".config/mise.toml","mise.toml"],nvm:[".nvmrc"],proto:[".prototools"],volta:[]},y=new Map,b=e=>{const n=y.get(e);if(n!==void 0||y.has(e))return n;const t=process.env.PATH;if(!t){y.set(e,void 0);return}const o=process.platform==="win32"?["",...(process.env.PATHEXT??".COM;.EXE;.BAT;.CMD").split(";")]:[""];for(const i of t.split(U)){const c=i.replaceAll(/^["']|["']$/g,"").trim();if(c!=="")for(const s of o){const a=`${c}${H}${e}${s}`;if(v(a))return y.set(e,a),a}}y.set(e,void 0)},S=(e,n=["--version"])=>{try{const t=P(e,n,{encoding:"utf8",stdio:["ignore","pipe","ignore"],timeout:2e3}),r=/\d+\.\d+(?:\.\d+)?/.exec(t);return r?r[0]:t.trim()||void 0}catch{return}},j=(e,n)=>{const t=p(e,"package.json");if(!v(t))return[];try{const o=A(t)[n];if(n==="volta"&&typeof o=="object"&&o!==null&&Object.keys(o).length>0)return["package.json"];if(n==="packageManager"&&typeof o=="string"&&o.length>0)return["package.json"]}catch{}return[]},X=(e,n)=>e==="volta"?j(n,"volta"):e==="corepack"?j(n,"packageManager"):O[e].filter(t=>v(p(n,t))),x=new Map,Y=()=>{x.clear(),y.clear()},N=(e,n)=>{{const i=x.get(e);if(i)return i}const t=[],r=!!b("pnpm")||!!b("yarn");for(const i of Z){const c=i==="nvm"?void 0:b(i),s=i==="nvm"&&!!process.env.NVM_DIR,a=X(i,e),l=!!c||s;i==="corepack"&&!l&&(!(a.length>0)||r)||!l&&a.length===0||t.push({binPath:c,configFiles:a,installed:l,name:i,version:c?S(c):void 0})}const o=Object.freeze(t);return x.set(e,o),o},$n=(e,n,t)=>{const r=N(e);return n?.preferredManager&&n.preferredManager!=="none"?r.find(o=>o.name===n.preferredManager)??{configFiles:[],installed:!1,name:n.preferredManager}:r.find(o=>o.installed&&o.configFiles.length>0)??r.find(o=>o.installed)??r.find(o=>o.configFiles.length>0)??{configFiles:[],installed:!1,name:"none"}},K=(e,n)=>{for(const t of n){const r=p(e,t);if(v(r))try{const o=M(r).trim();if(o!=="")return{name:t,value:o.replace(/^v/,"")}}catch{}}},Q=/^([a-z][\w-]*)\s*=\s*"?([^"\n#]+?)"?\s*(?:#.*)?$/i,nn=e=>{const n=p(e,".prototools");if(!v(n))return[];const t=M(n),r=[];let o=!1;for(const i of t.split(/\r?\n/)){const c=i.trim();if(c===""||c.startsWith("#"))continue;if(c.startsWith("[")){o=!0;continue}if(o)continue;const s=Q.exec(c);if(!s)continue;const[,a,l]=s,f=g(a);f&&r.push({source:".prototools",tool:f,version:l.trim()})}return r},en=/^\[tools\]\s*$/i,tn=/^([a-z][\w-]*)\s*=\s*"?([^"\n#]+?)"?\s*(?:#.*)?$/i,on=e=>{for(const n of O.mise){const t=p(e,n);if(!v(t))continue;const r=[],o=M(t);let i=!1;for(const c of o.split(/\r?\n/)){const s=c.trim();if(s===""||s.startsWith("#"))continue;if(s.startsWith("[")){i=en.test(s);continue}if(!i)continue;const a=tn.exec(s);if(!a)continue;const[,l,f]=a,d=g(l);d&&r.push({source:".mise.toml",tool:d,version:f.trim()})}if(r.length>0)return r}return[]},rn=e=>{const n=p(e,".tool-versions");if(!v(n))return[];const t=M(n),r=[];for(const o of t.split(/\r?\n/)){const i=o.trim();if(i===""||i.startsWith("#"))continue;const c=i.split(/\s+/);if(c.length<2)continue;const[s,...a]=c,l=g(s);l&&a[0]&&r.push({source:".tool-versions",tool:l,version:a[0]})}return r},g=e=>{switch(e.toLowerCase()){case"aube":return"aube";case"bun":return"bun";case"deno":return"deno";case"go":case"golang":return"go";case"node":case"nodejs":return"node";case"npm":return"npm";case"pnpm":return"pnpm";case"python":case"python3":return"python";case"ruby":return"ruby";case"rust":case"rustc":return"rust";case"yarn":return"yarn";default:return}},sn=e=>{const[n]=e.split("+",1),t=/^(pnpm|yarn|npm|bun)@(.+)$/.exec(n??"");if(!t)return;const r=g(t[1]);if(r)return{source:"packageManager",tool:r,version:t[2]}},an=(e,n)=>{const t=new Map,r=s=>{t.set(s.tool,s)},o=p(e,"package.json");let i={};try{v(o)&&(i=A(o))}catch{}if(i.engines)for(const[s,a]of Object.entries(i.engines)){const l=g(s);l&&typeof a=="string"&&r({source:"engines",tool:l,version:a})}if(i.packageManager){const s=sn(i.packageManager);s&&r(s)}if(i.volta)for(const[s,a]of Object.entries(i.volta)){const l=g(s);l&&typeof a=="string"&&r({source:"volta",tool:l,version:a})}const c=K(e,[".nvmrc",".node-version"]);c&&r({source:c.name===".nvmrc"?".nvmrc":".node-version",tool:"node",version:c.value});for(const s of rn(e))r(s);for(const s of on(e))r(s);for(const s of nn(e))r(s);if(n?.tools)for(const[s,a]of Object.entries(n.tools)){const l=g(s);l&&typeof a=="string"&&r({source:"vis.config.ts",tool:l,version:a})}return[...t.values()]},E={aube:{args:["--version"],binaries:["aube"]},bun:{args:["--version"],binaries:["bun"]},deno:{args:["--version"],binaries:["deno"]},go:{args:["version"],binaries:["go"]},node:{args:["--version"],binaries:["node"]},npm:{args:["--version"],binaries:["npm"]},pnpm:{args:["--version"],binaries:["pnpm"]},python:{args:["--version"],binaries:["python","python3"]},ruby:{args:["--version"],binaries:["ruby"]},rust:{args:["--version"],binaries:["rustc"]},yarn:{args:["--version"],binaries:["yarn"]}},F=e=>{const n=E[e];for(const t of n.binaries){const r=b(t);if(r)return S(r,n.args)}if(e==="node")return process.versions.node},W=(e,n)=>{const t=n.trim();if(t===""||t==="*"||t==="latest")return!0;if(/^\d[\d.]*$/.test(t))return e===t||e.startsWith(`${t}.`);const r=s=>s.split(/[.\-+]/).map(a=>Number.parseInt(a,10)||0),o=(s,a)=>{const l=r(s),f=r(a),d=Math.max(l.length,f.length);for(let h=0;h<d;h++){const $=l[h]??0,u=f[h]??0;if($!==u)return $-u}return 0},i=s=>{for(const a of s)if(a.startsWith(">=")){if(o(e,a.slice(2).trim())<0)return!1}else if(a.startsWith("<=")){if(o(e,a.slice(2).trim())>0)return!1}else if(a.startsWith(">")){if(o(e,a.slice(1).trim())<=0)return!1}else if(a.startsWith("<")){if(o(e,a.slice(1).trim())>=0)return!1}else if(a.startsWith("^")||a.startsWith("~")){const l=a.slice(1).trim(),[f,d]=r(l),[h,$]=r(e);if(h!==f||a.startsWith("~")&&$!==d||o(e,l)<0)return!1}return!0},c=t.split("||").map(s=>s.trim().split(/\s+/).filter(Boolean)).filter(s=>s.length>0);return c.length===0?!0:c.some(s=>i(s))},cn=(e,n)=>{switch(e){case".mise.toml":return["mise"];case".node-version":case".nvmrc":return["fnm","nvm","volta","proto","mise","asdf"];case".prototools":return["proto"];case".tool-versions":return["asdf","mise"];case"packageManager":return n==="pnpm"||n==="yarn"?["self-activate","volta","proto","mise","corepack"]:n==="npm"?["volta","proto","mise","asdf","corepack"]:n==="aube"?["mise"]:n==="bun"?["proto","mise","asdf"]:["volta","proto","mise"];case"volta":return["volta"];default:return["proto","mise","fnm","volta","asdf","nvm","corepack"]}},ln=(e,n,t)=>{if(t?.preferredManager&&t.preferredManager!=="none"&&_(t.preferredManager,e.tool)){const o=n.find(i=>i.name===t.preferredManager);return o?{installed:o.installed,name:o.name}:{installed:!1,name:t.preferredManager,note:`${t.preferredManager} is the preferred manager but isn't on PATH`}}const r=cn(e.source,e.tool);for(const o of r){if(o==="self-activate"){if((e.tool==="pnpm"||e.tool==="yarn")&&b(e.tool))return{installed:!0,name:"self-activate",note:`${e.tool} will activate ${e.version} from the packageManager field on next invocation`};continue}if(!_(o,e.tool))continue;if(n.find(c=>c.name===o)?.installed)return{installed:!0,name:o}}for(const o of r)if(!(o==="self-activate"||!_(o,e.tool)))return{installed:!1,name:o,note:`${o} can install ${e.tool} — run \`vis toolchain install\` after adding it to PATH`};return{installed:!1,name:"none",note:"No manager knows how to install this tool"}},_=(e,n)=>e==="none"?!1:e==="self-activate"?n==="pnpm"||n==="yarn":G[e].includes(n),fn=(e,n)=>{const t=N(e),o=an(e,n).map(i=>{const c=F(i.tool),s=c!==void 0&&W(c,i.version),a=ln(i,t,n);return{actual:c,expected:i,manager:a,matches:s}});return{detected:t,tools:o}},un=(e,n)=>{switch(e){case"asdf":return n?{args:["install",n.tool,n.version],bin:"asdf"}:void 0;case"corepack":return n?{args:["prepare",`${n.tool}@${n.version}`,"--activate"],bin:"corepack"}:{args:["prepare","--activate"],bin:"corepack",hint:"reads the packageManager field in package.json"};case"fnm":return n?.tool!=="node"?void 0:{args:["install",n.version],bin:"fnm"};case"mise":return n?{args:["install",`${n.tool}@${n.version}`],bin:"mise"}:void 0;case"none":return;case"nvm":return{args:[],bin:"nvm",hint:"nvm is a shell function — run `nvm install` / `nvm use` from your shell"};case"proto":return n?{args:["install",n.tool,n.version],bin:"proto"}:void 0;case"self-activate":return{args:[],bin:n?.tool??"pnpm",hint:`${n?.tool??"pnpm"} will self-activate on next invocation — no install needed`};case"volta":return n?{args:["install",`${n.tool}@${n.version}`],bin:"volta"}:{args:["install","node@lts"],bin:"volta",hint:"volta pins per-tool; specify <tool>@<version>"};default:{const t=e;throw new Error(`Unknown manager: ${t}`)}}},yn=(e,n)=>{switch(e){case"asdf":return{args:["local",n.tool,n.version],bin:"asdf",configChange:{file:".tool-versions",hint:`Pins ${n.tool} ${n.version}`}};case"corepack":return n.tool!=="npm"&&n.tool!=="pnpm"&&n.tool!=="yarn"?void 0:{args:["use",`${n.tool}@${n.version}`],bin:"corepack",configChange:{file:"package.json",hint:`Writes packageManager: "${n.tool}@${n.version}"`}};case"fnm":return n.tool==="node"?{args:["use",n.version],bin:"fnm"}:void 0;case"mise":return{args:["use","--",`${n.tool}@${n.version}`],bin:"mise",configChange:{file:".mise.toml",hint:`Pins ${n.tool} ${n.version}`}};case"none":return;case"nvm":return n.tool==="node"?{args:[],bin:"nvm",configChange:{file:".nvmrc",hint:"Write version to .nvmrc manually (nvm doesn't persist)."}}:void 0;case"proto":return{args:["pin",n.tool,n.version],bin:"proto",configChange:{file:".prototools",hint:`Pins ${n.tool} ${n.version}`}};case"self-activate":return{args:[],bin:n.tool,configChange:{file:"package.json",hint:`Set packageManager: "${n.tool}@${n.version}" — ${n.tool} will self-activate on next invocation`}};case"volta":return{args:["pin",`${n.tool}@${n.version}`],bin:"volta",configChange:{file:"package.json",hint:`Writes volta.${n.tool}`}};default:{const t=e;throw new Error(`Unknown manager: ${t}`)}}},Mn=e=>{for(const n of E[e].binaries){const t=b(n);if(t)return t}},wn=(e,n)=>{const t=E[n].binaries;if(e.installed&&e.binPath&&(e.name==="proto"||e.name==="mise"||e.name==="asdf"||e.name==="volta"||e.name==="fnm"))for(const r of t)try{const i=P(e.binPath,["which",r],{encoding:"utf8",stdio:["ignore","pipe","ignore"],timeout:2e3}).trim();if(i)return i}catch{}for(const r of t){const o=b(r);if(o)return o}},I=(e,n)=>{const t=`${e}.${process.pid}.${L(6).toString("hex")}.tmp`;V(t,n);try{q(t,e)}catch(r){try{R(t)}catch{}throw r}},dn=(e,n)=>{if("packageManager"in e)return e.packageManager=n,e;const t={};let r=!1;for(const[o,i]of Object.entries(e))!r&&(o==="dependencies"||o==="devDependencies"||o==="peerDependencies"||o==="optionalDependencies")&&(t.packageManager=n,r=!0),t[o]=i;return r||(t.packageManager=n),t},kn=(e,n)=>{if(n.tool!=="pnpm"&&n.tool!=="yarn"&&n.tool!=="npm"&&n.tool!=="bun")return;const t=p(e,"package.json");if(!v(t))throw new Error(`Cannot pin ${n.tool}: ${t} does not exist.`);const r=M(t),i=/\n([ \t]+)/.exec(r)?.[1]??" ";let c;try{c=JSON.parse(r)}catch(f){throw new Error(`${t} is not valid JSON — fix it before running \`vis toolchain use\`. Underlying error: ${f.message}`,{cause:f})}const s=`${n.tool}@${n.version}`,a=dn(c,s),l=r.endsWith(`
|
|
2
|
-
`)?`
|
|
3
|
-
`:"";return I(t,`${JSON.stringify(a,void 0,i)}${l}`),s},Tn=(e,n)=>{const t=p(e,"package.json");if(!v(t))return;const r=M(t);let o;try{o=JSON.parse(r)}catch(a){throw new Error(`${t} is not valid JSON — fix it before running \`vis toolchain use\`. Underlying error: ${a.message}`,{cause:a})}if(o.engines?.[n.tool]===void 0||o.engines[n.tool]===n.version)return;o.engines[n.tool]=n.version;const c=/\n([ \t]+)/.exec(r)?.[1]??" ",s=r.endsWith(`
|
|
4
|
-
`)?`
|
|
5
|
-
`:"";return I(t,`${JSON.stringify(o,void 0,c)}${s}`),n.version},Pn=e=>{const n=/^([a-z][\w-]*)@(.+)$/i.exec(e.trim());if(!n)return;const t=g(n[1]);if(t)return{source:"vis.config.ts",tool:t,version:n[2]}},mn=async(e,n,t)=>{const r=fn(e,n),o=r.tools.filter(f=>!f.matches);if(o.length===0)return{attempted:[],failed:[],upToDate:!0};const i=r.detected.some(f=>f.installed);if(!(n?.autoInstall??i))return{attempted:[],failed:[],upToDate:!1};const s=[],a=[],l=new Map;for(const f of o){const d=l.get(f.manager.name);d?d.push(f):l.set(f.manager.name,[f])}for(const[f,d]of l){if(f==="self-activate"){for(const{expected:u}of d)t.info(`toolchain: ${u.tool} ${u.version} will self-activate on next ${u.tool} invocation`),s.push(u);continue}if(f==="none"){for(const{expected:u}of d)a.push({error:`no manager can install ${u.tool} — install one of ${J.join(", ")}`,spec:u});continue}if(!r.detected.find(u=>u.name===f)?.installed){for(const{expected:u}of d)a.push({error:`${f} is not on PATH`,spec:u});continue}const $=d.map(u=>({invocation:un(f,u.expected),tool:u})).filter(u=>u.invocation!==void 0);for(const{invocation:u,tool:C}of $){const{expected:m}=C;if(u.bin==="nvm"&&u.args.length===0){const w=F(m.tool);if(w!==void 0&&W(w,m.version)){t.info(`toolchain: ${m.tool} ${w} already satisfies ${m.version}; skipping nvm shell activation`),s.push(m);continue}t.warn(`toolchain: nvm requires a shell-side activation for ${m.tool} ${m.version}. Run \`nvm install\` / \`nvm use\` manually.`),a.push({error:"nvm requires shell-side activation",spec:m});continue}t.info(`toolchain: $ ${u.bin} ${u.args.join(" ")}`);try{P(u.bin,u.args,{cwd:e,stdio:"inherit"}),s.push(m),f==="fnm"&&vn(u.bin,t)}catch(w){a.push({error:w.message,spec:m});break}}}return Y(),{attempted:s,failed:a,upToDate:!1}},_n=async(e,n,t,r=!1)=>{if(r)return;const o=await mn(e,n,t);for(const i of o.failed)t.warn(`toolchain: ${i.spec.tool} ${i.spec.version} — ${i.error}`)},vn=(e,n)=>{const t=process.platform==="win32"?"powershell":"bash";try{const r=P(e,["env","--shell",t],{encoding:"utf8",stdio:["ignore","pipe","ignore"],timeout:2e3});for(const o of r.split(/\r?\n/)){const i=o.trim();if(i==="")continue;const c=/^\$env:([A-Z_]\w*)\s*=\s*(.+)$/i.exec(i);if(c){const[,l,f]=c;process.env[l]=f.replaceAll(/^["']|["']$/g,"");continue}const s=/^set\s+"?([A-Z_]\w*)=(.*?)"?$/i.exec(i);if(s){const[,l,f]=s;process.env[l]=f;continue}const a=/^(?:export\s+)?([A-Z_]\w*)=(.+)$/i.exec(i);if(a){const[,l,f]=a;process.env[l]=f.replaceAll(/^["']|["']$/g,"")}}}catch(r){n.warn(`toolchain: could not activate fnm env (${r.message}). Subsequent tasks may use the previous Node version.`)}};export{J as S,Pn as a,un as b,ln as c,yn as d,wn as e,N as f,fn as g,Mn as h,$n as p,_n as r,Tn as u,kn as w};
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import{createRequire as K}from"node:module";import{e as h,z as H,v as S,U as Y,m as Q}from"./index-BzhrR_iC.js";import{T as w}from"../packem_chunks/catalog.js";import{y as C}from"./isAccessibleSync-DYKTrrvc-C-_5cgwu.js";import{p as ee}from"./readJsonSync-CbryXYxN-EWl7_7KX.js";import{h as le}from"./writeFileSync-DJoHk3Ks-BPRoepNw.js";import{s as ue}from"./watch-CcTketln.js";let z;const G=e=>(z??=K(import.meta.url))(e),x=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,A=e=>{if(typeof x<"u"&&x.versions&&x.versions.node){const[t,n]=x.versions.node.split(".").map(Number);if(t>22||t===22&&n>=3||t===20&&n>=16)return x.getBuiltinModule(e)}return G(e)},{createHash:g}=A("node:crypto"),{fileURLToPath:X,pathToFileURL:Z}=A("node:url"),{spawnSync:te,spawn:ne}=A("node:child_process"),{openSync:se,writeSync:re,closeSync:oe,statSync:ie,readFileSync:P,mkdirSync:ce,writeFileSync:ae}=A("node:fs"),{availableParallelism:k}=A("node:os"),D=(e,t)=>{for(const n of["dependencies","devDependencies","optionalDependencies","peerDependencies"]){const s=e[n];if(s&&typeof s[t]=="string")return s[t]}},F=(e,t)=>{for(const n of t){const s=h(e,n);if(C(s))return s}},de=e=>{const t=h(e,"package.json");if(!C(t))return{};try{return ee(t)}catch{return{}}},rt=(e,t)=>{const n=de(e),s=new Map;for(const o of t){const r=o.detect(e,n);r&&s.set(o.id,r)}return s},fe={error:"error",info:"info",information:"info",warning:"warning"},ot={argsCheck:(e,t)=>I(e,t,!1),argsFix:(e,t)=>I(e,t,!0),bin:()=>["pnpm","exec","biome"],cacheKey:(e,t)=>{const n=["biome",e.declaredVersion??"unknown",e.configFile??"no-config",t.maxWarnings===void 0?"":`mw=${t.maxWarnings}`,t.quiet?"q":"",...t.extraArgs??[]];return g("sha256").update(n.join("|")).digest("hex").slice(0,16)},detect:(e,t)=>{const n=D(t,w.biome.packageNames[0]),s=F(e,w.biome.configFiles);if(!(!n&&!s))return{adapter:"biome",configFile:s,declared:!!n,declaredVersion:n,root:e}},extensions:["astro","cjs","css","cts","js","json","jsonc","jsx","mjs","mts","svelte","ts","tsx","vue"],id:"biome",kind:"both",parse:(e,t)=>{if(!e.stdout.trim())return[];let n;try{n=JSON.parse(e.stdout)}catch{return[{adapter:"biome",file:t.root,fixable:!1,message:`biome output was not valid JSON (exit ${e.exitCode})`,severity:"error"}]}const s=[];for(const o of n.diagnostics??[]){const r=o.location?.start,i=o.location?.end,c=pe(t.root,o.location?.path),u=o.category??"",a=u==="format"||u.startsWith("format/");s.push({adapter:"biome",column:r?.column&&r.column>0?r.column:void 0,endColumn:i?.column&&i.column>0?i.column:void 0,endLine:i?.line&&i.line>0?i.line:void 0,file:c,fixable:!0,line:r?.line&&r.line>0?r.line:void 0,message:a?"Code style issues would be auto-fixed":o.message??"",ruleId:u||void 0,severity:fe[o.severity??""]??"warning"})}return s}},I=(e,t,n)=>{const s=["check","--reporter=json"];return n&&s.push("--write"),typeof t.maxWarnings=="number"&&s.push(`--max-diagnostics=${String(t.maxWarnings)}`),t.extraArgs?.length&&s.push(...t.extraArgs),s.push(...e),s},pe=(e,t)=>{const n=typeof t=="string"?t:t?.file;return n?n.startsWith("/")||/^[a-z]:[\\/]/i.test(n)?n:h(e,n):e},N=e=>t=>{const n=F(t,w.deno.configFiles);if(n)return{adapter:e,configFile:n,declared:!1,root:t}},O=e=>e.startsWith("/")||/^[a-z]:[\\/]/i.test(e),it={argsCheck:(e,t)=>b(e,t,!1),argsFix:(e,t)=>b(e,t,!0),bin:()=>["deno","lint"],cacheKey:(e,t)=>{const n=["deno-lint",e.configFile??"no-config",t.quiet?"q":"",...t.extraArgs??[]];return g("sha256").update(n.join("|")).digest("hex").slice(0,16)},detect:N("deno-lint"),extensions:["js","jsx","mjs","mts","ts","tsx"],id:"deno-lint",kind:"lint",parse:(e,t)=>{if(!e.stdout.trim())return[];let n;try{n=JSON.parse(e.stdout)}catch{return[{adapter:"deno-lint",file:t.root,fixable:!1,message:`deno lint output was not valid JSON (exit ${e.exitCode})`,severity:"error"}]}const s=[];for(const o of n.diagnostics??[]){const r=o.range?.start,i=o.range?.end;s.push({adapter:"deno-lint",column:r?.col===void 0?void 0:r.col+1,endColumn:i?.col===void 0?void 0:i.col+1,endLine:i?.line===void 0?void 0:i.line+1,file:he(o.filename??t.root,t.root),fixable:!1,line:r?.line===void 0?void 0:r.line+1,message:o.message??"",ruleId:o.code,severity:"warning"})}return s}},ct={argsCheck:(e,t)=>R(e,t,!1),argsFix:(e,t)=>R(e,t,!0),bin:()=>["deno","fmt"],cacheKey:(e,t)=>{const n=["deno-fmt",e.configFile??"no-config",t.quiet?"q":"",...t.extraArgs??[]];return g("sha256").update(n.join("|")).digest("hex").slice(0,16)},detect:N("deno-fmt"),extensions:["astro","cjs","css","cts","html","ipynb","js","json","jsonc","jsx","less","md","mjs","mts","sass","scss","sql","svelte","ts","tsx","vue","yaml","yml"],id:"deno-fmt",kind:"fmt",parse:(e,t)=>{if(e.exitCode===0)return[];const n=[],s=new Set;for(const o of e.stdout.split(/\r?\n/)){const r=/^from (.+):$/.exec(o);if(!r)continue;const i=r[1];s.has(i)||(s.add(i),n.push({adapter:"deno-fmt",file:O(i)?i:`${t.root}/${i}`,fixable:!0,message:"Code style issues would be auto-fixed",severity:"info"}))}return n}},b=(e,t,n)=>{const s=["--json"];return n&&s.push("--fix"),t.extraArgs?.length&&s.push(...t.extraArgs),s.push(...e),s},R=(e,t,n)=>{const s=[];return n||s.push("--check"),t.quiet&&s.push("--quiet"),t.extraArgs?.length&&s.push(...t.extraArgs),s.push(...e),s},he=(e,t)=>e.startsWith("file://")?X(e):O(e)?e:`${t}/${e}`,W="pyproject.toml",me=/^\[tool\.ruff(?:\.[\w-]+)*\]\s*$/m,ge=/^Would reformat:?\s+(.+)$/,ye=e=>{const t=h(e,W);if(!C(t))return!1;try{const n=H(t);return me.test(n)}catch{return!1}},B=e=>(t,n)=>{const s=w.ruff.packageNames.map(c=>D(n,c)).find(c=>c!==void 0),o=F(t,w.ruff.configFiles),r=o?void 0:ye(t)?h(t,W):void 0,i=o??r;if(!(!s&&!i))return{adapter:e,configFile:i,declared:!!s,declaredVersion:s,root:t}},xe=e=>e.startsWith("/")||/^[a-z]:[\\/]/i.test(e),J=(e,t)=>e?xe(e)?e:h(t,e):t,ve=e=>ge.exec(e)?.[1]?.trim(),at={argsCheck:(e,t)=>T(e,t,!1),argsFix:(e,t)=>T(e,t,!0),bin:()=>["ruff","check"],cacheKey:(e,t)=>{const n=["ruff-check",e.declaredVersion??"unknown",e.configFile??"no-config",t.maxWarnings===void 0?"":`mw=${t.maxWarnings}`,t.quiet?"q":"",...t.extraArgs??[]];return g("sha256").update(n.join("|")).digest("hex").slice(0,16)},detect:B("ruff-check"),extensions:["py","pyi"],id:"ruff-check",kind:"lint",parse:(e,t)=>{if(!e.stdout.trim())return[];let n;try{n=JSON.parse(e.stdout)}catch{return[{adapter:"ruff-check",file:t.root,fixable:!1,message:`ruff check output was not valid JSON (exit ${e.exitCode})`,severity:"error"}]}const s=[];for(const o of n){const r=o.location,i=o.end_location;s.push({adapter:"ruff-check",column:r?.column,endColumn:i?.column,endLine:i?.row,file:J(o.filename,t.root),fixable:!!o.fix,line:r?.row,message:o.message??"",ruleId:o.code,severity:"warning"})}return s}},lt={argsCheck:(e,t)=>L(e,t,!1),argsFix:(e,t)=>L(e,t,!0),bin:()=>["ruff","format"],cacheKey:(e,t)=>{const n=["ruff-fmt",e.declaredVersion??"unknown",e.configFile??"no-config",t.quiet?"q":"",...t.extraArgs??[]];return g("sha256").update(n.join("|")).digest("hex").slice(0,16)},detect:B("ruff-fmt"),extensions:["py","pyi"],id:"ruff-fmt",kind:"fmt",parse:(e,t)=>{if(e.exitCode===0)return[];const n=[],s=new Set;for(const o of e.stdout.split(/\r?\n/)){const r=ve(o);!r||s.has(r)||(s.add(r),n.push({adapter:"ruff-fmt",file:J(r,t.root),fixable:!0,message:"Code style issues would be auto-fixed",severity:"info"}))}return n}},T=(e,t,n)=>{const s=["--output-format=json"];return n&&s.push("--fix"),t.quiet&&s.push("--quiet"),t.extraArgs?.length&&s.push(...t.extraArgs),s.push(...e),s},L=(e,t,n)=>{const s=[];return n||s.push("--check"),t.quiet&&s.push("--quiet"),t.extraArgs?.length&&s.push(...t.extraArgs),s.push(...e),s},ut=(e,t)=>{const n=v(e,["diff","--name-only","--diff-filter=ACMR","-z",`${t}...HEAD`]);if(n===void 0)return;const s=v(e,["diff","--name-only","--diff-filter=ACMR","-z"]),o=v(e,["diff","--name-only","--diff-filter=ACMR","--cached","-z"]),r=v(e,["ls-files","--others","--exclude-standard","-z"]),i=new Set;for(const c of[n,s??"",o??"",r??""])for(const u of c.split("\0"))u.length!==0&&i.add(S(u)?u:h(e,u));return[...i].sort()},dt=e=>{const t=v(e,["diff","--name-only","--diff-filter=ACMR","--cached","-z"]);if(t===void 0)return;const n=new Set;for(const s of t.split("\0"))s.length!==0&&n.add(S(s)?s:h(e,s));return[...n].sort()},v=(e,t)=>{const n=te("git",[...t],{cwd:e,encoding:"utf8",timeout:1e4});if(n.status===0)return n.stdout},ft=(e,t)=>{const n=new Set(t.map(r=>r.toLowerCase())),s=[],o=new Set;for(const r of e){const i=r.lastIndexOf(".");if(i===-1||i===r.length-1)continue;const c=r.slice(i+1).toLowerCase();n.has(c)&&(o.has(r)||(o.add(r),s.push(r)))}return s},we=new Set(["-","stdout"]),_=e=>({close:()=>{},write:t=>{e.write(t)}}),Ae=e=>{le(Q(e));const t=se(e,"w");let n=[];return{close:()=>{n.length>0&&(re(t,n.join("")),n=[]),oe(t)},write:s=>{n.push(s)}}},pt=e=>{const{cwd:t,target:n}=e;if(n===void 0||we.has(n))return _(process.stdout);if(n==="stderr")return _(process.stderr);const s=S(n)?n:Y(t,n);return Ae(s)},j=["oxlint","oxfmt","biome","eslint","dprint","prettier","stylelint","ruff-check","ruff-fmt","markdownlint","shellcheck","deno-lint","deno-fmt","typecheck"],ht=(e,t)=>{const n=new Map(e.map(i=>[i.id,i])),s=[],o=new Set,r=t&&t.length>0?t:j;for(const i of r){const c=n.get(i);c&&!o.has(i)&&(s.push(c),o.add(i))}if(t&&t.length>0)for(const i of j){const c=n.get(i);c&&!o.has(i)&&(s.push(c),o.add(i))}for(const i of e)o.has(i.id)||(s.push(i),o.add(i.id));return s},mt=(e,t,n)=>{const s=[];for(const o of t){const r=e.get(o.id);r&&Se(o.kind,n)&&s.push({adapter:o,presence:r})}return s},Se=(e,t)=>e===t||e==="both",gt=(e,t,n={})=>{const s=new Map;for(const o of e){const r=$e(o),i=Ce(r,t,n);if(!i)continue;const c=s.get(i);c?c.push(o):s.set(i,[o])}return s},$e=e=>{const t=e.lastIndexOf(".");return t===-1||t===e.length-1?"":e.slice(t+1).toLowerCase()},Ce=(e,t,n)=>{const s=n[e];if(s&&t.some(o=>o.adapter.id===s))return s;for(const{adapter:o}of t)if(o.extensions.includes(e))return o.id},Fe=e=>e==="error"?"error":e==="warning"?"warning":"notice",V=e=>e.replaceAll("%","%25").replaceAll("\r","%0D").replaceAll(`
|
|
2
|
-
`,"%0A"),M=e=>V(e).replaceAll(",","%2C").replaceAll(":","%3A").replaceAll("=","%3D"),ke=(e,t)=>t&&e.startsWith(`${t}/`)?e.slice(t.length+1):e,Ie=(e,t)=>e.file!==t.file?e.file<t.file?-1:1:(e.line??0)-(t.line??0)||(e.column??0)-(t.column??0),be=(e,t)=>{const n=Fe(e.severity),s=ke(e.file,t),o=e.ruleId?`${e.adapter}(${e.ruleId})`:e.adapter,r=[`file=${M(s)}`];return e.line!==void 0&&r.push(`line=${String(e.line)}`),e.endLine!==void 0&&r.push(`endLine=${String(e.endLine)}`),e.column!==void 0&&r.push(`col=${String(e.column)}`),e.endColumn!==void 0&&r.push(`endColumn=${String(e.endColumn)}`),r.push(`title=${M(o)}`),`::${n} ${r.join(",")}::${V(e.message)}
|
|
3
|
-
`},yt=e=>e.runs.flatMap(n=>[...n.findings]).sort(Ie).map(n=>be(n,e.workspaceRoot)).join(""),y=e=>e.replaceAll("&","&").replaceAll("<","<").replaceAll(">",">").replaceAll('"',""").replaceAll("'","'"),Re=e=>`<![CDATA[${e.replaceAll("]]>","]]]]><![CDATA[>")}]]>`,Te=(e,t)=>e.file!==t.file?e.file<t.file?-1:1:(e.line??0)-(t.line??0)||(e.column??0)-(t.column??0),Le=e=>e==="error"?"error":e==="warning"?"warning":"info",_e=(e,t)=>{let{file:n}=e;return t&&e.file.startsWith(`${t}/`)&&(n=e.file.slice(t.length+1)),e.line===void 0?n:e.column===void 0?`${n}:${String(e.line)}`:`${n}:${String(e.line)}:${String(e.column)}`},je=(e,t,n)=>{const s=_e(e,n),o=Le(e.severity),r=e.ruleId?`[${e.ruleId}] ${e.message}`:e.message;return[` <testcase classname="${y(t)}" name="${y(s)}">`,` <failure type="${y(o)}" message="${y(r)}">${Re(e.message)}</failure>`," </testcase>",""].join(`
|
|
4
|
-
`)},Me=(e,t,n)=>{const s=[...e.findings].sort(Te),o=s.filter(d=>d.severity==="error").length,r=s.filter(d=>d.severity==="warning").length,i=s.length,c=(e.durationMs/1e3).toFixed(3),u=s.map(d=>je(d,e.adapter,n)).join("");return` <testsuite ${[`name="${y(e.adapter)}"`,`tests="${String(i)}"`,`failures="${String(o)}"`,'errors="0"',`skipped="${String(r)}"`,`time="${c}"`,`timestamp="${t}"`].join(" ")}>
|
|
5
|
-
${u} </testsuite>
|
|
6
|
-
`},xt=e=>{const t=(e.now??new Date).toISOString(),n=e.suiteName??"vis-lint-fmt",s=e.runs.map(a=>Me(a,t,e.workspaceRoot)).join(""),o=e.runs.reduce((a,d)=>a+d.findings.length,0),r=e.runs.reduce((a,d)=>a+d.findings.filter(l=>l.severity==="error").length,0),i=e.runs.reduce((a,d)=>a+d.findings.filter(l=>l.severity==="warning").length,0),c=(e.runs.reduce((a,d)=>a+d.durationMs,0)/1e3).toFixed(3);return`<?xml version="1.0" encoding="UTF-8"?>
|
|
7
|
-
<testsuites ${[`name="${y(n)}"`,`tests="${String(o)}"`,`failures="${String(r)}"`,'errors="0"',`skipped="${String(i)}"`,`time="${c}"`].join(" ")}>
|
|
8
|
-
${s}</testsuites>
|
|
9
|
-
`},Ee="2.1.0",qe="https://json.schemastore.org/sarif-2.1.0.json",Pe=e=>e==="error"?"error":e==="warning"?"warning":"note",De=(e,t)=>t&&e.startsWith(`${t}/`)?{uri:e.slice(t.length+1),uriBaseId:"SRCROOT"}:{uri:e},Ne=e=>{const{href:t}=Z(e);return t.endsWith("/")?t:`${t}/`},Oe=(e,t)=>e.file!==t.file?e.file<t.file?-1:1:(e.line??0)-(t.line??0)||(e.column??0)-(t.column??0),We=e=>{const t=new Map;for(const n of e)n.ruleId&&(t.has(n.ruleId)||t.set(n.ruleId,{id:n.ruleId,name:n.ruleId}));return[...t.values()]},Be=(e,t)=>{const{uri:n,uriBaseId:s}=De(e.file,t),o={artifactLocation:s?{uri:n,uriBaseId:s}:{uri:n}};if(e.line!==void 0){const i={startLine:e.line};e.column!==void 0&&(i.startColumn=e.column),e.endLine!==void 0&&(i.endLine=e.endLine),e.endColumn!==void 0&&(i.endColumn=e.endColumn),o.region=i}const r={level:Pe(e.severity),locations:[{physicalLocation:o}],message:{text:e.message}};return e.ruleId&&(r.ruleId=e.ruleId),r},Je=(e,t)=>{const n=[...e.findings].sort(Oe),s=We(n),o={name:e.adapter,rules:s};e.presence?.declaredVersion&&(o.version=e.presence.declaredVersion);const r={results:n.map(i=>Be(i,t)),tool:{driver:o}};return t&&(r.originalUriBaseIds={SRCROOT:{uri:Ne(t)}}),r},vt=e=>{const t={$schema:qe,runs:e.runs.map(n=>Je(n,e.workspaceRoot)),version:Ee};return`${JSON.stringify(t,void 0,2)}
|
|
10
|
-
`},E={error:3,info:1,warning:2},wt=e=>{const t=[],n=[];let s,o=!1;for(const r of e){n.push({adapter:r.adapter,durationMs:r.durationMs,exitCode:r.exitCode,findingCount:r.findings.length}),r.exitCode!==0&&r.exitCode!==null&&r.findings.length===0&&(o=!0);for(const i of r.findings)t.push(i),(!s||E[i.severity]>E[s])&&(s=i.severity)}return{findings:t,hadProcessFailure:o,maxSeverity:s,runs:n}},At=e=>{const t=new Map;for(const n of e){const s=t.get(n.file);s?s.push(n):t.set(n.file,[n])}return t},St=e=>e.hadProcessFailure||e.maxSeverity==="error"?1:0,Ve=(e,t)=>{if(t==="fix"||process.env.VIS_NO_CACHE==="1"||e.length===0)return!1;for(const n of e)if(n==="."||n==="./"||n==="..")return!1;return!0},Ue=e=>{try{const t=P(e);return g("sha256").update(t).digest("hex")}catch{return}},Ke=(e,t,n,s,o)=>{const r=e.cacheKey(t,s),i=[];for(const u of[...n].sort()){const a=S(u)?u:h(t.root,u);try{ie(a)}catch{return}const d=Ue(a);if(!d)return;i.push({hash:d,path:a})}const c=g("sha256");c.update(e.id),c.update("\0"),c.update(r),c.update("\0"),c.update(o);for(const u of i)c.update("\0"),c.update(u.path),c.update("\0"),c.update(u.hash);return{fileHashes:i,key:c.digest("hex")}},U=(e,t)=>h(e,"lint-fmt",t),ze=(e,t,n)=>{const s=h(U(e,t.id),`${n}.json`);try{const o=P(s,"utf8"),r=JSON.parse(o);return r.schema!==1?void 0:r}catch{return}},Ge=(e,t,n,s,o)=>{const r=U(e,t.id),i={fileHashes:o,result:s,savedAt:Date.now(),schema:1};try{ce(r,{recursive:!0}),ae(h(r,`${n}.json`),JSON.stringify(i))}catch{}},q=async(e,t,n,s,o)=>{const r=e.bin(t),i=[...r.slice(1),...o==="fix"?e.argsFix(n,s):e.argsCheck(n,s)];return new Promise(c=>{const u=Date.now(),a=ne(r[0],i,{cwd:t.root}),d=[],l=[];let m=!1;const p=setTimeout(()=>{m=!0,a.kill("SIGKILL")},6e4);a.stdout.on("data",f=>d.push(f)),a.stderr.on("data",f=>l.push(f)),a.on("error",f=>{clearTimeout(p),c({durationMs:Date.now()-u,exitCode:null,stderr:f.message,stdout:""})}),a.on("close",f=>{clearTimeout(p),c({durationMs:Date.now()-u,exitCode:m?null:f,stderr:Buffer.concat(l).toString("utf8"),stdout:Buffer.concat(d).toString("utf8")})})})},$t=async(e,t,n,s=k())=>{if(e.length===0)return[];const{cacheRoot:o,concurrency:r}=typeof s=="number"?{concurrency:s}:{cacheRoot:s.cacheRoot,concurrency:s.concurrency??k()},i=async l=>{const m=l.options??t;if(o&&Ve(l.files,n)){const p=Ke(l.adapter,l.presence,l.files,m,n);if(p){const f=ze(o,l.adapter,p.key);if(f)return f.result;const $=await q(l.adapter,l.presence,l.files,m,n);return $.exitCode!==null&&Ge(o,l.adapter,p.key,$,p.fileHashes),$}}return q(l.adapter,l.presence,l.files,m,n)};if(process.env.VIS_LINT_FMT_SERIAL==="1"){const l=[];for(const m of e)l.push(await i(m));return l}const c=Math.max(1,Math.min(r,e.length)),u=Array.from({length:e.length});let a=0;const d=async()=>{for(;;){const l=a;if(a+=1,l>=e.length)return;u[l]=await i(e[l])}};return await Promise.all(Array.from({length:c},()=>d())),u},He=e=>{const t=new Set;for(const n of e)t.add(n.toLowerCase());return t},Ye=(e,t)=>{const n=e.lastIndexOf(".");return n===-1||n===e.length-1?!1:t.has(e.slice(n+1).toLowerCase())},Ct=async e=>{const{extensions:t,initialFiles:n,label:s,log:o,runCycle:r,workspaceRoot:i}=e,c=o??(p=>{process.stdout.write(`${p}
|
|
11
|
-
`)}),u=He(t);await r(n),c(`▸ ${s}: watching workspace — press Ctrl-C to exit`);let a=new Set,d=!1;const l=async()=>{for(;a.size>0;){const p=[...a];a=new Set;try{await r(p)}catch(f){c(`✗ ${s}: watch cycle failed — ${f.message}`)}}},m=ue({debounceMs:200,filter:p=>Ye(p,u),onChange:async p=>{for(const f of p)a.add(S(f)?f:h(i,f));if(!d){d=!0;try{await l()}finally{d=!1}}},paths:[i]});await new Promise(p=>{const f=()=>{m.close(),process.off("SIGINT",f),process.off("SIGTERM",f),p()};process.once("SIGINT",f),process.once("SIGTERM",f)})};export{rt as a,mt as b,ut as c,D as d,Ct as e,F as f,ot as g,lt as h,ct as i,gt as j,$t as k,wt as l,pt as m,vt as n,xt as o,yt as p,St as q,ht as r,dt as s,At as t,de as u,at as v,it as w,ft as x};
|