@visulima/vis 6.0.0 → 6.0.1
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 +38 -0
- package/LICENSE.md +89 -152
- package/dist/bin.js +1 -1
- package/dist/binx.js +1 -1
- 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 +52 -61
- package/dist/packem_chunks/cli-exec.js +1 -1
- package/dist/packem_chunks/cli-main.js +150 -152
- 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 +1 -1
- 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/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 +1 -1
- 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 +1 -1
- package/dist/packem_chunks/handler66.js +1 -1
- package/dist/packem_chunks/handler67.js +20 -31
- package/dist/packem_chunks/handler68.js +1 -1
- package/dist/packem_chunks/handler69.js +1 -1
- 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 +17 -17
- package/dist/packem_chunks/handler76.js +1 -1
- package/dist/packem_chunks/handler77.js +2 -2
- package/dist/packem_chunks/handler78.js +31 -31
- 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 +7 -40
- package/dist/packem_chunks/index2.js +11 -11
- package/dist/packem_chunks/index6.js +1 -1
- package/dist/packem_chunks/keys-refresh.js +1 -1
- package/dist/packem_chunks/lean.js +1 -1
- 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/Table-Bo1JKNCN-CGGet8ES.js +34 -0
- package/dist/packem_shared/{affected-selection-DDxwjwM4.js → affected-selection-CrW7fWEd.js} +1 -1
- package/dist/packem_shared/{affected-shas-BuaWvmsG.js → affected-shas-B_kfSKss.js} +1 -1
- package/dist/packem_shared/{ai-fix-C2BhFFhi.js → ai-fix-D9MxigBQ.js} +5 -5
- package/dist/packem_shared/{augment-CxUPE8KX.js → augment-B9kSZuvW.js} +1 -1
- package/dist/packem_shared/{bin-Be7_QhQK.js → bin-D3TtXgz6.js} +1 -1
- package/dist/packem_shared/{build-scripts-DxyVSkgM.js → build-scripts-CEDx_nJp.js} +1 -1
- package/dist/packem_shared/{command-runtime-BXvH5EC0.js → command-runtime-HSsYGCQd.js} +1 -1
- package/dist/packem_shared/{dart-pubspec-DvmyleIr.js → dart-pubspec-BK_cK2EP.js} +2 -2
- package/dist/packem_shared/{dependency-scan-DKK3ZEZI.js → dependency-scan-B8jroa1D.js} +1 -1
- package/dist/packem_shared/{docker-BTuwdXaC.js → docker-DXqV-07f.js} +1 -1
- package/dist/packem_shared/{ecosystem-gate-BpQNUJzN.js → ecosystem-gate-ByxWtzPE.js} +1 -1
- package/dist/packem_shared/{env-consistency-CUBJHENL.js → env-consistency-Dt_uDbSP.js} +1 -1
- package/dist/packem_shared/{failure-log-kp0n2rbD.js → failure-log-BP-gCUb5.js} +1 -1
- package/dist/packem_shared/{formatBytes-BHAzNIrn-DRcKvqnb.js → formatBytes-_HvjOy8a-B_qQr4Hw.js} +3 -3
- package/dist/packem_shared/{getRandomSpinner-4ZEcbTYv-DCyIuj19.js → getRandomSpinner-DX11qCB2-CoIsn7ZU.js} +1 -1
- package/dist/packem_shared/{index-DsSWb5XH.js → index-BKbMnn8K.js} +1 -1
- package/dist/packem_shared/index-BisalDCf.js +39 -0
- package/dist/packem_shared/{index-BdMIfGVZ.js → index-BzhrR_iC.js} +15 -15
- package/dist/packem_shared/{index-DQfNpt2u.js → index-DGdD4w-b.js} +1 -1
- package/dist/packem_shared/index.server-Ca_EEVfw.js +2 -0
- package/dist/packem_shared/{isAccessibleSync-DYKTrrvc-BwaMhQs0.js → isAccessibleSync-DYKTrrvc-C-_5cgwu.js} +1 -1
- package/dist/packem_shared/{lifecycle-BAhkhE2L.js → lifecycle-DvmDIRbb.js} +1 -1
- package/dist/packem_shared/{lockfile-DHmlPGk1.js → lockfile-CiUtEbnt.js} +1 -1
- package/dist/packem_shared/{manifests-Dd4Hoztt.js → manifests-Du4yKlf_.js} +1 -1
- package/dist/packem_shared/{min-release-age-BJnOQaoF.js → min-release-age-JViyQuBM.js} +1 -1
- package/dist/packem_shared/{missing-package-json-DfzrGwe1.js → missing-package-json-Cu5YVAot.js} +1 -1
- package/dist/packem_shared/{multi-eco-lockfiles-BIa6xvJc.js → multi-eco-lockfiles-B2X3yhyo.js} +1 -1
- package/dist/packem_shared/{native-config-sync-Dr9XvxOf.js → native-config-sync-TdTWjVgI.js} +1 -1
- package/dist/packem_shared/osv-bloom-BCAX5ARR.js +2 -0
- package/dist/packem_shared/package-version-QFmE9anh.js +4 -0
- package/dist/packem_shared/{packument-C9nRiBJf.js → packument-zb18Jnlw.js} +1 -1
- package/dist/packem_shared/{pm-runner-ImwtpnWY.js → pm-runner-RM72mDZg.js} +1 -1
- package/dist/packem_shared/{project-name-filter-C2rkW-Vn.js → project-name-filter-DIqpdsvP.js} +1 -1
- package/dist/packem_shared/{provenance-DF-ypZj3.js → provenance-L1M2FPy_.js} +1 -1
- package/dist/packem_shared/{readJsonSync-CbryXYxN-Bm5i10UW.js → readJsonSync-CbryXYxN-EWl7_7KX.js} +1 -1
- package/dist/packem_shared/{registry-keys-BLuHOyZu.js → registry-keys-DxdqMzyp.js} +1 -1
- package/dist/packem_shared/{resolve-explicit-BDaQRR6o.js → resolve-explicit-CQa37JSq.js} +1 -1
- package/dist/packem_shared/{resolve-runtime-Cr19Pk6L.js → resolve-runtime-DNukUjIr.js} +1 -1
- package/dist/packem_shared/{run-file-XbRCF6Mp.js → run-file-UBukWaha.js} +1 -1
- package/dist/packem_shared/{runtime-check-Bh5q9IrT.js → runtime-check-1U8HrQd9.js} +1 -1
- package/dist/packem_shared/{s1ngularity-UCZN7skW.js → s1ngularity-CO5GkkqX.js} +1 -1
- package/dist/packem_shared/{scan-progress-DcYI76zE.js → scan-progress-RwCRxJdX.js} +1 -1
- package/dist/packem_shared/{selectors-DCiEU0iv.js → selectors-edwcgNl3.js} +2 -2
- package/dist/packem_shared/{signatures-CicxPHN4.js → signatures-DIqFUOfs.js} +1 -1
- package/dist/packem_shared/spinner-BJjbNl1F.js +1 -0
- package/dist/packem_shared/target-merge-DVJl-7Qz.js +4 -0
- package/dist/packem_shared/{target-options-PgWIuJnb.js → target-options-DsHFmRZH.js} +1 -1
- package/dist/packem_shared/{task-env-Dl08aklA.js → task-env-DzR4RkOj.js} +1 -1
- package/dist/packem_shared/{toolchain-DvUxlbDz.js → toolchain-Bz70UIcp.js} +1 -1
- package/dist/packem_shared/{typosquats-DxPzyK7u.js → typosquats-D4DEHhFy.js} +1 -1
- package/dist/packem_shared/{verify-CadR9PUk.js → verify-B_MblU_Q.js} +1 -1
- package/dist/packem_shared/{vis-update-app-DrFWQyPn.js → vis-update-app-9b2kSk9f.js} +1 -1
- package/dist/packem_shared/{vis-user-error-k7CLTpA4.js → vis-user-error-S0Fesz5y.js} +15 -15
- package/dist/packem_shared/{watch-Dr_6yz3o.js → watch-CcTketln.js} +1 -1
- package/dist/packem_shared/{watch-loop-BId9vT7Q.js → watch-loop-BEnGuMBn.js} +1 -1
- package/dist/packem_shared/{writeFileSync-DJoHk3Ks-Dhem3Uof.js → writeFileSync-DJoHk3Ks-BPRoepNw.js} +1 -1
- package/dist/runtime/preload.js +1 -1
- package/index.js +26 -26
- package/package.json +12 -12
- package/dist/packem_shared/index-C9ENZqH9.js +0 -39
- package/dist/packem_shared/index.server-D8BLnYZO.js +0 -2
- package/dist/packem_shared/osv-bloom-t40ra5U5.js +0 -2
- package/dist/packem_shared/package-version-CFuNUWDG.js +0 -4
- package/dist/packem_shared/spinner-ukDEdGvp.js +0 -1
- package/dist/packem_shared/target-merge-BClIXg2k.js +0 -14
package/dist/packem_shared/{affected-selection-DDxwjwM4.js → affected-selection-CrW7fWEd.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{createRequire as T}from"node:module";import{getAffectedProjects as W}from"@visulima/task-runner";import{i as A}from"./index-BjdW45xX.js";import{V as k}from"./vis-user-error-
|
|
1
|
+
import{createRequire as T}from"node:module";import{getAffectedProjects as W}from"@visulima/task-runner";import{i as A}from"./index-BjdW45xX.js";import{V as k}from"./vis-user-error-S0Fesz5y.js";import{r as B}from"./affected-shas-B_kfSKss.js";let I;const R=e=>(I??=T(import.meta.url))(e),f=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,F=e=>{if(typeof f<"u"&&f.versions&&f.versions.node){const[t,s]=f.versions.node.split(".").map(Number);if(t>22||t===22&&s>=3||t===20&&s>=16)return f.getBuiltinModule(e)}return R(e)},{spawnSync:S}=F("node:child_process"),b=new Set(["deep","direct","none"]),O=e=>{const t=[],s=e.split("\0");for(let n=0;n<s.length;n++){const o=s[n];if(!o||o.length<4)continue;const c=o.slice(0,2),p=o.slice(3);if(p&&t.push(p),c.includes("R")||c.includes("C")){n+=1;const l=s[n];l&&t.push(l)}}return t},P=e=>{const t=S("git",["status","--porcelain","-z"],{cwd:e,encoding:"utf8"});return t.error||t.status!==0||typeof t.stdout!="string"?[]:O(t.stdout)},D=async(e,t,s={})=>{const n=e.downstream??"deep",o=e.upstream??"none";if(!b.has(n))throw new k(`Invalid --downstream value: "${n}". Must be "none", "direct", or "deep".`);if(!b.has(o))throw new k(`Invalid --upstream value: "${o}". Must be "none", "direct", or "deep".`);const{fileOwners:c,projectGraph:p,projects:l,workspaceRoot:h}=t,a=[];let{base:g}=e,{head:i}=e;if(!g||!i){const u=B({defaultBase:s.defaultBase,workspaceRoot:h});g=g||u.base,i=i||u.head,a.push(`Resolved affected refs from ${u.provider} (${u.notes.join("; ")})`)}const y=s.runningInCi??A,w=i==="HEAD"||i==="",$=e.uncommitted??(!y&&w);let d=[];if($)if(w){const j=(s.readWorkingTreeChanges??P)(h),C=Object.values(l).map(r=>r.root?.replace(/\/$/,"")).filter(r=>!!r&&r!==".");d=j.filter(r=>c!==void 0&&Object.hasOwn(c,r)||C.some(v=>r===v||r.startsWith(`${v}/`)));const _=j.length-d.length;d.length>0&&a.push(`including ${d.length} uncommitted working-tree file(s)`),_>0&&a.push(`ignoring ${_} uncommitted path(s) outside any project (untracked scratch would otherwise mark every project affected)`)}else a.push(`ignoring --uncommitted: --head=${i} pins the comparison to a commit, not the working tree`);const m=await W({additionalChangedFiles:d,base:g,downstream:n,fileOwners:c,head:i,ignoredFiles:s.affectedIgnore,projectGraph:p,projects:l,upstream:o,workspaceRoot:h});return m.ignoredFiles.length>0&&a.push(`ignoring ${m.ignoredFiles.length} changed path(s) outside any project matching affectedIgnore`),{...m,notes:a,uncommittedFileCount:d.length}};export{D as s};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{createRequire as l}from"node:module";import{
|
|
1
|
+
import{createRequire as l}from"node:module";import{z as g}from"./index-BzhrR_iC.js";import{y as b}from"./isAccessibleSync-DYKTrrvc-C-_5cgwu.js";let E;const d=e=>(E??=l(import.meta.url))(e),u=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,h=e=>{if(typeof u<"u"&&u.versions&&u.versions.node){const[t,r]=u.versions.node.split(".").map(Number);if(t>22||t===22&&r>=3||t===20&&r>=16)return u.getBuiltinModule(e)}return d(e)},{spawnSync:p}=h("node:child_process"),A="0000000000000000000000000000000000000000",f=e=>{if(b(e))try{const t=g(e);return JSON.parse(t)}catch{return}},R=(e,t)=>{const r=p("git",e,{cwd:t,encoding:"utf8"});if(!(r.error||typeof r.status!="number"||r.status!==0))return typeof r.stdout=="string"?r.stdout.trim():void 0},_=e=>typeof e=="string"&&e.length>0&&e!==A,S=(e,t,r)=>{const o=[],s=e.GITHUB_BASE_REF,n=e.GITHUB_SHA??"HEAD";if(s&&s.length>0)return o.push(`pull_request: $GITHUB_BASE_REF=${s}`),{base:`origin/${s}`,head:n,notes:o,provider:"github"};const i=e.GITHUB_EVENT_PATH,c=i?r(i):void 0;if(c){const a=typeof c.before=="string"?c.before:void 0;if(_(a))return o.push(`push: event.before=${a}`),{base:a,head:n,notes:o,provider:"github"}}return o.push(`fallback: origin/${t}`),{base:`origin/${t}`,head:n,notes:o,provider:"github"}},I=(e,t)=>{const r=[],o=e.CI_COMMIT_SHA??"HEAD";if(e.CI_PIPELINE_SOURCE==="merge_request_event"){const c=e.CI_MERGE_REQUEST_DIFF_BASE_SHA;if(_(c))return r.push(`merge_request: $CI_MERGE_REQUEST_DIFF_BASE_SHA=${c}`),{base:c,head:o,notes:r,provider:"gitlab"};const a=e.CI_MERGE_REQUEST_TARGET_BRANCH_NAME;if(a&&a.length>0)return r.push(`merge_request: $CI_MERGE_REQUEST_TARGET_BRANCH_NAME=${a}`),{base:`origin/${a}`,head:o,notes:r,provider:"gitlab"}}const n=e.CI_COMMIT_BEFORE_SHA;if(_(n))return r.push(`push: $CI_COMMIT_BEFORE_SHA=${n}`),{base:n,head:o,notes:r,provider:"gitlab"};const i=e.CI_DEFAULT_BRANCH??t;return r.push(`fallback: origin/${i}`),{base:`origin/${i}`,head:o,notes:r,provider:"gitlab"}},T=(e,t)=>{const r=[],o=e.BUILD_SOURCEVERSION??"HEAD",s=e.SYSTEM_PULLREQUEST_TARGETBRANCHNAME,n=e.SYSTEM_PULLREQUEST_TARGETBRANCH,i=s&&s.length>0?s:n?.replace(/^refs\/heads\//,"");return i&&i.length>0?(r.push(`pull_request: target branch ${i}`),{base:`origin/${i}`,head:o,notes:r,provider:"azure"}):(r.push(`fallback: origin/${t} (azure has no canonical previous-build SHA env)`),{base:`origin/${t}`,head:o,notes:r,provider:"azure"})},C=(e,t)=>{const r=[],o=e.BUILDKITE_COMMIT??"HEAD",s=e.BUILDKITE_PULL_REQUEST_BASE_BRANCH;return s&&s.length>0?(r.push(`pull_request: $BUILDKITE_PULL_REQUEST_BASE_BRANCH=${s}`),{base:`origin/${s}`,head:o,notes:r,provider:"buildkite"}):(r.push(`fallback: origin/${t} (buildkite has no canonical previous-build SHA env)`),{base:`origin/${t}`,head:o,notes:r,provider:"buildkite"})},B=(e,t)=>{const r=[],o=e.CIRCLE_SHA1??"HEAD",s=e.CIRCLE_PR_BASE_BRANCH;return s&&s.length>0?(r.push(`pull_request: $CIRCLE_PR_BASE_BRANCH=${s}`),{base:`origin/${s}`,head:o,notes:r,provider:"circleci"}):(r.push(`fallback: origin/${t} (circleci has no canonical previous-build SHA env)`),{base:`origin/${t}`,head:o,notes:r,provider:"circleci"})},H=(e,t,r)=>{const o=[],s=t(["merge-base","HEAD",`origin/${e}`],r);return s&&s.length>0?(o.push(`local: git merge-base HEAD origin/${e}=${s}`),{base:s,head:"HEAD",notes:o,provider:"local"}):(o.push(`local fallback: origin/${e} (no merge-base available)`),{base:`origin/${e}`,head:"HEAD",notes:o,provider:"local"})},m=e=>{const t=e?.env??process.env,r=e?.defaultBase??"main",o=e?.readEventPayload??f,s=e?.runGit??R,n=e?.workspaceRoot??process.cwd();return t.GITHUB_ACTIONS==="true"?S(t,r,o):t.GITLAB_CI==="true"?I(t,r):t.TF_BUILD?.toLowerCase()==="true"?T(t,r):t.BUILDKITE==="true"?C(t,r):t.CIRCLECI==="true"?B(t,r):H(r,s,n)};export{m as r};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import{createRequire as T}from"node:module";import{readLastRunSummary as _}from"@visulima/task-runner";import{a as $}from"./failure-log-
|
|
2
|
-
${n}`},J=async(e,t)=>t===void 0?_(e,{dataDirectory:R(e)}):j(e,t),pe=async(e,t,n={})=>{const o=n.terminalOutputLimit??q,[r,i]=await Promise.all([$(e,t),J(e,n.runId)]),s=i?v(i,t):void 0;if(!r&&!s)return;let a,c;if(i&&s){const u=await P(e,i.id),f=u?v(u,t):void 0;a=D(s.hashDetails,f?.hashDetails),c=u?.id}const d=r?.terminalOutput??"";return{command:r?.command??void 0,cwd:r?.cwd??void 0,dependencies:s?.dependencies??[],duration:s?.duration,exitCode:r?.exitCode??s?.exitCode,hash:s?.hash??r?.hash,hashDetails:s?.hashDetails,hashDiff:a,previousRunId:c,project:s?.target.project,runId:i?.id??r?.runId,status:r?.status??(s?K(s):void 0),target:s?.target.target,taskId:t,terminalOutput:W(d,o),terminalOutputCaptured:!!r,timestamp:r?.timestamp??s?.endTime??s?.startTime}},K=e=>{if(e.exitCode!==void 0&&e.exitCode!==0)return"failure";switch(e.cacheStatus){case"HIT":return"local-cache";case"REMOTE_HIT":return"remote-cache";case"SKIPPED":return"skipped";default:return e.exitCode===0?"success":void 0}},Y=3600*1e3,w=80,V=new Set(["high","low","medium"]),
|
|
1
|
+
import{createRequire as T}from"node:module";import{readLastRunSummary as _}from"@visulima/task-runner";import{a as $}from"./failure-log-BP-gCUb5.js";import{m as v,n as P,o as D,d as j,s as E,t as N,u as A}from"../packem_chunks/cli-main.js";import{c as R}from"./formatBytes-_HvjOy8a-B_qQr4Hw.js";import{v as x,U as y,e as B,a as H}from"./index-BzhrR_iC.js";import{a as C,b as U,e as k}from"./ai-analysis-pldoS_N4.js";let I;const F=e=>(I??=T(import.meta.url))(e),h=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,O=e=>{if(typeof h<"u"&&h.versions&&h.versions.node){const[t,n]=h.versions.node.split(".").map(Number);if(t>22||t===22&&n>=3||t===20&&n>=16)return h.getBuiltinModule(e)}return F(e)},{readFile:L,writeFile:M}=O("node:fs/promises"),q=32*1024,W=(e,t)=>{if(e.length<=t)return e;const n=e.slice(-t),o=e.length-n.length;return`[…${String(o)} bytes truncated from head…]
|
|
2
|
+
${n}`},J=async(e,t)=>t===void 0?_(e,{dataDirectory:R(e)}):j(e,t),pe=async(e,t,n={})=>{const o=n.terminalOutputLimit??q,[r,i]=await Promise.all([$(e,t),J(e,n.runId)]),s=i?v(i,t):void 0;if(!r&&!s)return;let a,c;if(i&&s){const u=await P(e,i.id),f=u?v(u,t):void 0;a=D(s.hashDetails,f?.hashDetails),c=u?.id}const d=r?.terminalOutput??"";return{command:r?.command??void 0,cwd:r?.cwd??void 0,dependencies:s?.dependencies??[],duration:s?.duration,exitCode:r?.exitCode??s?.exitCode,hash:s?.hash??r?.hash,hashDetails:s?.hashDetails,hashDiff:a,previousRunId:c,project:s?.target.project,runId:i?.id??r?.runId,status:r?.status??(s?K(s):void 0),target:s?.target.target,taskId:t,terminalOutput:W(d,o),terminalOutputCaptured:!!r,timestamp:r?.timestamp??s?.endTime??s?.startTime}},K=e=>{if(e.exitCode!==void 0&&e.exitCode!==0)return"failure";switch(e.cacheStatus){case"HIT":return"local-cache";case"REMOTE_HIT":return"remote-cache";case"SKIPPED":return"skipped";default:return e.exitCode===0?"success":void 0}},Y=3600*1e3,w=80,V=new Set(["high","low","medium"]),X=()=>`You are an expert software engineer helping fix a failing build/test/lint task.
|
|
3
3
|
|
|
4
4
|
You will be given:
|
|
5
5
|
- The terminal output (stdout/stderr) from the failed task.
|
|
@@ -32,9 +32,9 @@ Respond ONLY with valid JSON in this exact structure:
|
|
|
32
32
|
"cannotFix": "optional — set when no safe patch can be proposed"
|
|
33
33
|
}`,l=(e,t)=>{const n=[];if(t.added.length>0&&n.push(` added: ${t.added.join(", ")}`),t.changed.length>0&&n.push(` changed: ${t.changed.join(", ")}`),t.removed.length>0&&n.push(` removed: ${t.removed.join(", ")}`),n.length!==0)return`- ${e}:
|
|
34
34
|
${n.join(`
|
|
35
|
-
`)}`},
|
|
36
|
-
`)},G=e=>{const t=[`Task: ${e.taskId}`];return e.project&&t.push(`Project: ${e.project}`),e.target&&t.push(`Target: ${e.target}`),e.command&&t.push(`Command: ${e.command}`),e.cwd&&t.push(`CWD: ${e.cwd}`),e.exitCode!==void 0&&t.push(`Exit code: ${String(e.exitCode)}`),e.hash&&t.push(`Task hash: ${e.hash}`),t.push("","Hash-diff since previous run:",
|
|
37
|
-
`)},Q=e=>`${
|
|
35
|
+
`)}`},z=e=>{if(!e.hashDiff)return"No hash-diff available — there is no previous run to compare against.";const t=[];e.hashDiff.commandChanged&&t.push("- command line changed since previous run");const n=l("file inputs",e.hashDiff.nodes),o=l("implicit deps",e.hashDiff.implicitDeps),r=l("runtime/env",e.hashDiff.runtime);return n&&t.push(n),o&&t.push(o),r&&t.push(r),t.length===0?"No detectable changes between this run and the previous run.":t.join(`
|
|
36
|
+
`)},G=e=>{const t=[`Task: ${e.taskId}`];return e.project&&t.push(`Project: ${e.project}`),e.target&&t.push(`Target: ${e.target}`),e.command&&t.push(`Command: ${e.command}`),e.cwd&&t.push(`CWD: ${e.cwd}`),e.exitCode!==void 0&&t.push(`Exit code: ${String(e.exitCode)}`),e.hash&&t.push(`Task hash: ${e.hash}`),t.push("","Hash-diff since previous run:",z(e),""),e.terminalOutputCaptured?t.push("Terminal output:","```",e.terminalOutput,"```"):t.push("Terminal output: <no failure log was captured for this task>",'Set "cannotFix" and tell the user to re-run with `vis run` so logs can be captured.'),t.join(`
|
|
37
|
+
`)},Q=e=>`${X()}
|
|
38
38
|
|
|
39
39
|
${G(e)}`,Z=(e,t)=>{const n=Array.isArray(e.patches)?e.patches:[],o=[];for(const i of n)typeof i.file!="string"||i.file.length===0||typeof i.oldString!="string"||i.oldString.length===0||typeof i.newString=="string"&&o.push({file:i.file,newString:i.newString,oldString:i.oldString,reason:typeof i.reason=="string"&&i.reason.length>0?i.reason:void 0});const r=typeof e.cannotFix=="string"&&e.cannotFix.length>0?e.cannotFix:void 0;return{cannotFix:r,confidence:V.has(e.confidence)?e.confidence:"low",explanation:typeof e.explanation=="string"?e.explanation:"",patches:r?[]:o,provider:t}},ee=(e,t)=>{const n=k(e);return!n||typeof n!="object"?{cannotFix:"AI response was not valid JSON.",confidence:"low",explanation:"Failed to parse AI response.",patches:[],provider:t}:Z(n,t)},te=(e,t)=>A({cwd:t.cwd??null,flow:"ai-fix",hash:t.hash??null,provider:e,taskId:t.taskId,terminalOutput:t.terminalOutput,terminalOutputCaptured:t.terminalOutputCaptured}),le=async(e,t,n={})=>{const o=C(n.config);if(!o){t.warn(`No AI provider available — install one of: claude, gemini, copilot, codex.
|
|
40
40
|
`);return}const r=n.cache!==!1,i=te(o.name,e);if(r){const s=E(i);if(s)return t.info(`Using cached fix proposal from ${s.provider}.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{createRequire as _}from"node:module";import{l as L}from"./target-options-
|
|
1
|
+
import{createRequire as _}from"node:module";import{l as L}from"./target-options-DsHFmRZH.js";import{e as q}from"./index-BzhrR_iC.js";let P;const R=e=>(P??=_(import.meta.url))(e),g=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,b=e=>{if(typeof g<"u"&&g.versions&&g.versions.node){const[t,r]=g.versions.node.split(".").map(Number);if(t>22||t===22&&r>=3||t===20&&r>=16)return g.getBuiltinModule(e)}return R(e)},{createRequire:j}=b("node:module"),{pathToFileURL:F}=b("node:url"),w=["temporal","urlpattern","reporterror","regexp-escape","promise-try","float16array","error-iserror","navigator-locks"],x=e=>{const t=e.trim().toLowerCase();return t===""||t==="all"||t==="1"||t==="true"?w:t.split(",").map(r=>r.trim()).filter(r=>w.includes(r))},E=async(e,t)=>{try{const o=j(q(t,"__vis_polyfill_resolver__.js")).resolve(e);return await import(F(o).href)}catch{return}},A=async e=>{if(globalThis.Temporal!==void 0)return;const t=await E("@js-temporal/polyfill",e);t?.Temporal===void 0?process.stderr.write(`vis: --polyfill temporal requested but @js-temporal/polyfill is not installed in this project.
|
|
2
2
|
`):globalThis.Temporal=t.Temporal},I=async e=>{if(globalThis.URLPattern!==void 0)return;const t=await E("urlpattern-polyfill",e);t?.URLPattern===void 0?process.stderr.write(`vis: --polyfill urlpattern requested but urlpattern-polyfill is not installed in this project.
|
|
3
3
|
`):globalThis.URLPattern=t.URLPattern},N=()=>{typeof globalThis.reportError!="function"&&(globalThis.reportError=e=>{const t=e instanceof Error?e.stack??`${e.name}: ${e.message}`:String(e);process.stderr.write(`${t}
|
|
4
4
|
`)})},O=()=>{if(typeof RegExp.escape=="function")return;const e=new Set(String.raw`^$\.*+?()[]{}|/`),t={"\f":String.raw`\f`,"\n":String.raw`\n`,"\r":String.raw`\r`," ":String.raw`\t`,"\v":String.raw`\v`},r=/\s/u,o=l=>l<=255?String.raw`\x${l.toString(16).padStart(2,"0")}`:String.raw`\u${l.toString(16).padStart(4,"0")}`;RegExp.escape=l=>{if(typeof l!="string")throw new TypeError("RegExp.escape requires a string argument");let i="",s=!0;for(const a of l){const u=a.codePointAt(0);s&&/[\dA-Za-z]/u.test(a)?i+=o(u):e.has(a)?i+=`\\${a}`:t[a]!==void 0?i+=t[a]:r.test(a)?i+=o(u):i+=a,s=!1}return i}},k=()=>{typeof Promise.try!="function"&&(Promise.try=function(t,...r){const o=typeof this=="function"?this:Promise;return new o((n,l)=>{try{n(t(...r))}catch(i){l(i)}})})},h=e=>{const t=new Float32Array(1),r=new Uint32Array(t.buffer);t[0]=e;const o=r[0],n=o>>>16&32768,l=o>>>23&255,i=o&8388607;if(l===255)return i===0?n|31744:n|32256;const s=l-127+15;if(s>=31)return n|31744;if(s<=0){if(s<-10)return n;const f=i|8388608,c=14-s;let p=f>>c;const m=f&(1<<c)-1,d=1<<c-1;return(m>d||m===d&&(p&1)===1)&&(p+=1),n|p}let a=s<<10|i>>13;const u=i&8191;return(u>4096||u===4096&&(a&1)===1)&&(a+=1),n|a},v=e=>{const t=e&32768?-1:1,r=e>>10&31,o=e&1023;return r===0?t*o*2**-24:r===31?o?Number.NaN:t*Number.POSITIVE_INFINITY:t*(1+o/1024)*2**(r-15)},U=()=>{const e=Math;typeof e.f16round!="function"&&(e.f16round=r=>v(h(r)));const t=DataView.prototype;typeof t.getFloat16!="function"&&(t.getFloat16=function(o,n){return v(this.getUint16(o,n))}),typeof t.setFloat16!="function"&&(t.setFloat16=function(o,n,l){this.setUint16(o,h(n),l)})},C=()=>{typeof Error.isError!="function"&&(Error.isError=e=>typeof e=="object"&&e!==null&&Object.prototype.toString.call(e)==="[object Error]")},V=()=>{const e=globalThis,t=e.navigator;if(t?.locks!==void 0)return;const r=new Map,o=new Set,n=s=>s.reason??(typeof DOMException=="function"?new DOMException("The lock request is aborted","AbortError"):Object.assign(new Error("The lock request is aborted"),{name:"AbortError"})),i={request:async(s,a,u)=>{const f=typeof a!="function",c=(f?a:{})??{},p=f?u:a,m=c.mode==="shared"?"shared":"exclusive";if(c.signal?.aborted)throw n(c.signal);if(c.ifAvailable===!0&&o.has(s))return p(null);const d=r.get(s)??Promise.resolve();let y;const S=new Promise(T=>{y=T});if(r.set(s,d.then(()=>S)),await d.catch(()=>{}),c.signal?.aborted)throw y(),n(c.signal);o.add(s);try{return await p({mode:m,name:s})}finally{o.delete(s),y()}}};t===void 0?Object.defineProperty(e,"navigator",{configurable:!0,enumerable:!0,value:{locks:i},writable:!0}):Object.defineProperty(t,"locks",{configurable:!0,enumerable:!0,value:i})},$={"error-iserror":C,float16array:U,"navigator-locks":V,"promise-try":k,"regexp-escape":O,reporterror:N},M=async(e,t=process.cwd())=>{const r=x(e);await Promise.all(r.map(async o=>{o==="temporal"?await A(t):o==="urlpattern"?await I(t):$[o]?.()}))},H=async e=>{for(const[t,r]of Object.entries(L(e,!0)))process.env[t]===void 0&&(process.env[t]=r);process.env.VIS_POLYFILL!==void 0&&await M(process.env.VIS_POLYFILL,e)};export{H as p};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{createRequire as
|
|
1
|
+
import{createRequire as v}from"node:module";import{t as T}from"./compile-cache-DoMHRsRZ.js";import{a as w,c as R,i as $,t as M,u as m,g as S}from"./package-version-QFmE9anh.js";import{i as j}from"./index-BjdW45xX.js";let _;const x=s=>(_??=v(import.meta.url))(s),t=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,b=s=>{if(typeof t<"u"&&t.versions&&t.versions.node){const[e,o]=t.versions.node.split(".").map(Number);if(e>22||e===22&&o>=3||e===20&&o>=16)return t.getBuiltinModule(s)}return x(s)},{createRequire:y}=b("node:module");let N;const O=s=>(N??=y(import.meta.url))(s),r=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,f=s=>{if(typeof r<"u"&&r.versions&&r.versions.node){const[e,o]=r.versions.node.split(".").map(Number);if(e>22||e===22&&o>=3||e===20&&o>=16)return r.getBuiltinModule(s)}return O(s)},{execFileSync:C}=f("node:child_process"),{totalmem:I}=f("node:os"),q=/--max-old-space-size=(\d+)/,z=/--max-semi-space-size=(\d+)/,E=s=>Math.floor(I()/1024/1024*s),P=s=>s<=512?4:s<=1024?8:s<=2048?16:s<=4096?32:s<=8192?64:Math.floor(Math.log2(s))*8,d=(s,e)=>{for(const o of e){const n=s.exec(o);if(n)return Number.parseInt(n[1],10)}},B=s=>{const o=[...w()],n=[...R()],a=d(q,o),p=d(z,o);if(a!==void 0&&p!==void 0)return;const l=a??E(.75),g=p??P(l),c=[];if(a===void 0&&c.push(`--max-old-space-size=${String(l)}`),p===void 0&&c.push(`--max-semi-space-size=${String(g)}`),c.length!==0)try{C($(),[...c,...o,...n.slice(1)],{env:M(),stdio:"inherit"}),m(0)}catch(h){const u=h.status;m(typeof u=="number"?u:1)}},V=()=>{process.env.VIS_VERSION=S()},H=s=>{!process.stdout.isTTY||j||process.env.TERM==="dumb"||process.stdout.write(`\x1B]0;${s}\x07`)},A=new Set(["","--help","--version","-h","-v","completion","dlx","exec","x"]),i=process.argv[2]??"";!A.has(i)&&!process.argv.includes("--help")&&!process.argv.includes("-h")&&B();process.argv.includes("--no-color")&&(process.env.NO_COLOR="1",process.env.FORCE_COLOR="0");V();T();(async()=>{if(i==="__pm-shim"){const{dispatchShim:e}=await import("../packem_chunks/dispatch.js");e(process.argv[3]??"",process.argv.slice(4));return}if(i==="x"){const{runLeanX:e}=await import("../packem_chunks/lean.js");await e(process.argv.slice(3));return}if(i==="exec"||i==="dlx"){const{runExecCli:e}=await import("../packem_chunks/cli-exec.js");await e();return}const{runCli:s}=await import("../packem_chunks/cli-main.js").then(e=>e.ax);await s()})();export{H as s};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{createRequire as W}from"node:module";import{e as h}from"./index-
|
|
1
|
+
import{createRequire as W}from"node:module";import{e as h}from"./index-BzhrR_iC.js";import{y as g}from"./isAccessibleSync-DYKTrrvc-C-_5cgwu.js";import{p as O}from"./readJsonSync-CbryXYxN-EWl7_7KX.js";let S;const B=e=>(S??=W(import.meta.url))(e),_=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,w=e=>{if(typeof _<"u"&&_.versions&&_.versions.node){const[s,n]=_.versions.node.split(".").map(Number);if(s>22||s===22&&n>=3||s===20&&n>=16)return _.getBuiltinModule(e)}return B(e)},{readdirSync:y,statSync:M}=w("node:fs"),P=["preinstall","install","postinstall","prepare"],$=e=>{const s=h(e,"node_modules");if(!g(s))return[];const n=new Map,o=(p,f="")=>{let l;try{l=y(p)}catch{return}for(const r of l){const i=h(p,r);if(r.startsWith("@")){o(i,`${r}/`);continue}if(r===".pnpm"&&f===""){let u;try{u=y(i)}catch{continue}for(const a of u){const c=h(i,a,"node_modules");g(c)&&o(c)}continue}if(r.startsWith("."))continue;const m=f+r,t=h(i,"package.json");try{if(!M(i).isDirectory()||!g(t))continue;const u=O(t),a=u.scripts??{},c=P.filter(v=>a[v]);!a.preinstall&&!a.install&&!a.postinstall&&g(h(i,"binding.gyp"))&&c.push("install (binding.gyp)"),c.length>0&&!n.has(m)&&n.set(m,{directory:i,hooks:c,name:m,version:typeof u.version=="string"?u.version:void 0});const d=h(i,"node_modules");g(d)&&o(d)}catch{}}};return o(s),[...n.values()]},b=e=>{const s=e.startsWith("@"),n=e.indexOf("@",s?1:0);return n===-1?{name:e}:{name:e.slice(0,n),version:e.slice(n+1)}},k=(e,s,n)=>{for(const[o,p]of Object.entries(s)){if(!p)continue;if(o.endsWith("@*")){if(o.slice(0,-2)===e.name)return!0;continue}if(o.endsWith("*")){if(e.name.startsWith(o.slice(0,-1)))return!0;continue}const{name:f,version:l}=b(o);if(f===e.name&&(!n||l===void 0||e.version===l))return!0}return!1},q=(e,s,n={})=>{const o=n.pinVersions===!0,p=$(e),f=[],l=[],r=new Map(p.map(t=>[t.name,t]));for(const t of p)k(t,s,o)?l.push(t):f.push(t);const i=[],m=[];for(const[t,u]of Object.entries(s)){if(!u)continue;if(t.endsWith("@*")){const v=t.slice(0,-2);r.has(v)||i.push(t);continue}if(t.endsWith("*")){const v=t.slice(0,-1);[...r.keys()].some(j=>j.startsWith(v))||i.push(t);continue}const{name:a,version:c}=b(t),d=r.get(a);if(!d){i.push(t);continue}o&&c!==void 0&&c!=="*"&&d.version&&d.version!==c&&m.push({from:t,to:`${a}@${d.version}`})}return{excess:i,installed:l,unapproved:f,versionDrift:m}},T=(e,s)=>q(e,s).unapproved.map(n=>`${n.name} (${n.hooks.join(", ")})`);export{q as a,T as s};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r}from"./resolve-runtime-
|
|
1
|
+
import{r}from"./resolve-runtime-DNukUjIr.js";const t=e=>{if(e!==null&&typeof e=="object"&&"runtime"in e){const n=e.runtime;if(typeof n=="string")return n}},u=(e,n)=>r(n,{config:e.visConfig?.runtime,flag:t(e.options)}),m=e=>e.runtime==="bun"?"bun":void 0;export{m as a,u as r};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{createRequire as v}from"node:module";import{
|
|
2
|
-
`).length,value:t.version}}return{dependencyNames:c!==null&&typeof c=="object"&&!Array.isArray(c)?Object.keys(c):[],name:n,publishTo:s,version:a,workspace:o}},E=(e,r,t)=>{const n=m.exec(e);if(n?.[3]!==r)throw new i(`the version literal is no longer "${r}"`);const s=n.index+8+n[1].length+n[2].length,o=s+n[3].length;return`${e.slice(0,s)}${t}${e.slice(o)}`},q=(e,r)=>{const t=r.split("/").filter(s=>s!==""&&s!==".");if(r.startsWith("/")||t.includes("..")||r.includes("\\"))throw new i(`workspace entry "${r}" must be a relative path inside the workspace`);let n=[e];for(const s of t){if(s==="**"||s.includes("*")&&s!=="*")throw new i(`workspace entry "${r}" uses an unsupported pattern; list the package directories explicitly or use "dir/*"`);n=n.flatMap(o=>{if(s!=="*")return[u(o,s)];let c;try{c=g(o)}catch{return[]}return c.map(a=>u(o,a)).filter(a=>d(a))})}return n.filter(s=>d(s)
|
|
1
|
+
import{createRequire as v}from"node:module";import{y as b}from"./index-BisalDCf.js";let y;const w=e=>(y??=v(import.meta.url))(e),l=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,f=e=>{if(typeof l<"u"&&l.versions&&l.versions.node){const[r,t]=l.versions.node.split(".").map(Number);if(r>22||r===22&&t>=3||r===20&&t>=16)return l.getBuiltinModule(e)}return w(e)},{readdirSync:g,statSync:h}=f("node:fs"),{join:u}=f("node:path");class i extends Error{}const _=/^\d+\.\d+\.\d+(?:-[\w.-]+)?(?:\+[\w.-]+)?$/,m=/^version:([ \t]+)(["']?)([^"'\s#]+)\2[ \t]*(?:#.*)?$/m,D=e=>{const r=b(e);if(r.errors.length>0)throw new i(`the YAML does not parse: ${r.errors[0]?.message??"unknown error"}`);const t=r.toJS()??{},{name:n}=t,s=t.publish_to,{workspace:o}=t,{dependencies:c}=t;if(n!==void 0&&typeof n!="string")throw new i("name must be a plain string");if(s!==void 0&&typeof s!="string")throw new i("publish_to must be a string");if(o!==void 0&&(!Array.isArray(o)||o.some(p=>typeof p!="string")))throw new i("workspace must be a list of directory paths");let a;if(t.version!==void 0){if(typeof t.version!="string")throw new i(`version is ${typeof t.version=="number"?"a number":"not a string"}; quote it, for example version: "1.0.0"`);const p=m.exec(e);if(p?.[3]!==t.version)throw new i("version must be a plain or quoted literal on its own top-level line, for example version: 1.0.0");if(!_.test(t.version))throw new i(`version "${t.version}" is not a semantic version`);a={line:e.slice(0,p.index).split(`
|
|
2
|
+
`).length,value:t.version}}return{dependencyNames:c!==null&&typeof c=="object"&&!Array.isArray(c)?Object.keys(c):[],name:n,publishTo:s,version:a,workspace:o}},E=(e,r,t)=>{const n=m.exec(e);if(n?.[3]!==r)throw new i(`the version literal is no longer "${r}"`);const s=n.index+8+n[1].length+n[2].length,o=s+n[3].length;return`${e.slice(0,s)}${t}${e.slice(o)}`},q=(e,r)=>{const t=r.split("/").filter(s=>s!==""&&s!==".");if(r.startsWith("/")||t.includes("..")||r.includes("\\"))throw new i(`workspace entry "${r}" must be a relative path inside the workspace`);let n=[e];for(const s of t){if(s==="**"||s.includes("*")&&s!=="*")throw new i(`workspace entry "${r}" uses an unsupported pattern; list the package directories explicitly or use "dir/*"`);n=n.flatMap(o=>{if(s!=="*")return[u(o,s)];let c;try{c=g(o)}catch{return[]}return c.map(a=>u(o,a)).filter(a=>d(a))})}return n.filter(s=>d(s)&&$(u(s,"pubspec.yaml")))},d=e=>{try{return h(e).isDirectory()}catch{return!1}},$=e=>{try{return h(e).isFile()}catch{return!1}};export{i as D,q as e,E as r,D as s};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{e as l,
|
|
1
|
+
import{e as l,z as d}from"./index-BzhrR_iC.js";import{S as m}from"./lockfile-DhHAaHN5.js";import{k as v,l as g}from"../packem_chunks/catalog.js";import{y as D}from"./isAccessibleSync-DYKTrrvc-C-_5cgwu.js";const b={bun:{file:"bun.lock",type:"bun"},npm:{aliases:["npm-shrinkwrap.json"],file:"package-lock.json",type:"npm"},pnpm:{file:"pnpm-lock.yaml",type:"pnpm"},yarn:{file:"yarn.lock",type:"yarn"}},P=t=>{const o=b[t];return o?[...o.aliases??[],o.file].map(e=>({file:e,type:o.type})):[]},h=(t,o)=>{const e=P(o);if(e.length!==0)return e.find(r=>D(l(t,r.file)))??e[e.length-1]},k=t=>{try{return JSON.parse(d(t))}catch{return}},y=t=>{const o=[],e=k(l(t,"package.json"));e&&o.push(e);const r=v(t);let c;if(r?c=r:e?.workspaces&&(Array.isArray(e.workspaces)?c=e.workspaces:e.workspaces.packages&&(c=e.workspaces.packages)),!c)return o;const i=g(t,c);for(const s of i){const n=k(l(t,s,"package.json"));n&&o.push(n)}return o},S=(t,o)=>{const e=new Set,r=[],c=new Map;for(const s of o){const n=c.get(s.name);n?n.push(s):c.set(s.name,[s])}const i=s=>{if(s)for(const n of Object.keys(s))e.has(n)||(e.add(n),r.push(n))};for(const s of y(t))i(s.dependencies),i(s.peerDependencies),i(s.optionalDependencies);for(;r.length>0;){const s=r.shift(),n=c.get(s);if(n){for(const a of n)for(const p of[a.dependencies,a.peerDependencies,a.optionalDependencies])if(p)for(const f of Object.keys(p))e.has(f)||(e.add(f),r.push(f))}}return e},O=(t,o,e={})=>{const r=h(t,o);if(!r)return[];let c;try{c=d(l(t,r.file))}catch{return[]}const i=m(c,r.type);if(i.length===0)return[];const n=e.includeDev??!0?void 0:S(t,i),a=new Set,p=[];for(const f of i){if(n&&!n.has(f.name))continue;const u=`${f.name}@${f.version}`;a.has(u)||(a.add(u),p.push({isDev:!1,name:f.name,version:f.version}))}return p},I=(t,o)=>{const e=h(t,o);if(!e)return[];let r;try{r=d(l(t,e.file))}catch{return[]}const c=m(r,e.type);if(c.length===0)return[];const i=new Map;for(const n of c)i.has(n.name)||i.set(n.name,new Set),i.get(n.name).add(n.version);const s=[];for(const[n,a]of i)a.size<=1||s.push({name:n,versions:[...a]});return s.sort((n,a)=>n.name.localeCompare(a.name))},M=(t,o)=>{const e=h(t,o);if(!e)return;let r;try{r=d(l(t,e.file))}catch{return}const c=m(r,e.type);if(c.length===0)return;const i=[],s=new Set;for(const n of y(t))for(const a of[n.dependencies,n.devDependencies,n.peerDependencies,n.optionalDependencies])if(a)for(const[p,f]of Object.entries(a)){const u=`${p}@${f}`;s.has(u)||(s.add(u),i.push({name:p,version:f}))}return{entries:c,roots:i}};export{b as L,M as a,I as f,O as l,h as r};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{createRequire as Xs}from"node:module";import{e as Le,
|
|
1
|
+
import{createRequire as Xs}from"node:module";import{e as Le,a as to,m as _i}from"./index-BzhrR_iC.js";import{h as so,S as oo}from"./index-BisalDCf.js";import{y as fo}from"./isAccessibleSync-DYKTrrvc-C-_5cgwu.js";import{p as ns}from"./readJsonSync-CbryXYxN-EWl7_7KX.js";import{U as ut,h as lo}from"./writeFileSync-DJoHk3Ks-BPRoepNw.js";let Zs;const eo=a=>(Zs??=Xs(import.meta.url))(a),zr=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,ro=a=>{if(typeof zr<"u"&&zr.versions&&zr.versions.node){const[g,C]=zr.versions.node.split(".").map(Number);if(g>22||g===22&&C>=3||g===20&&C>=16)return zr.getBuiltinModule(a)}return eo(a)},{rmSync:ki,existsSync:es,readFileSync:at,cpSync:rs,lstatSync:no,readdirSync:io}=ro("node:fs");class Ze extends Error{constructor(g){super(g),this.name="LockfilePruneError"}}const is=a=>{let g=a.startsWith("/")?a.slice(1):a;const C=g.indexOf("(");return C!==-1&&(g=g.slice(0,C)),g},co=(a,g)=>{if(!(g.startsWith("link:")||g.startsWith("file:")||g.startsWith("workspace:")))return`${a}@${g}`},ao=a=>{const g=[];for(const C of[a.dependencies,a.devDependencies,a.optionalDependencies])if(C)for(const[s,h]of Object.entries(C))h?.version&&g.push({name:s,version:h.version});return g},pt=a=>{const g=[];for(const C of[a.dependencies,a.optionalDependencies])if(C)for(const[s,h]of Object.entries(C))typeof h=="string"&&g.push({name:s,version:h});return g},ht=a=>{const g=new Map;if(!a)return g;for(const C of Object.keys(a)){const s=is(C),h=g.get(s);h?h.push(C):g.set(s,[C])}return g},ts=a=>{const g=a.displayName??"pnpm-lock.yaml",C=typeof a.lockfileContent=="string"?a.lockfileContent:a.lockfileContent.toString("utf8");let s;try{s=so(C)}catch(V){throw new Ze(`${g}: parse failed — ${V.message}`)}const h=V=>V.packages?Object.keys(V.packages).length:0;let e;for(const V of s){const[ne]=V.errors;if(ne)throw new Ze(`${g}: parse failed — ${ne.message}`);const M=V.toJS();if(!M||typeof M!="object")continue;const le=M;(e===void 0||h(le)>h(e))&&(e=le)}if(e===void 0)throw new Ze(`${g}: top-level value is not an object`);const d=e.importers??{},w=ht(e.packages),m=ht(e.snapshots),A=new Set(["."]);for(const V of a.closure)A.add(V.relativeRoot===""?".":V.relativeRoot);const x={};for(const[V,ne]of Object.entries(d))A.has(V)&&(x[V]=ne);const Y=new Set,y=new Set,v=[];for(const V of Object.values(x))for(const ne of ao(V))v.push(ne);for(;v.length>0;){const{name:V,version:ne}=v.shift(),M=co(V,ne);if(!M)continue;const le=is(M),we=m.get(le)??m.get(M)??[];for(const ve of we){if(y.has(ve))continue;y.add(ve);const Se=e.snapshots?.[ve];if(Se)for(const xe of pt(Se))v.push(xe)}const ge=w.get(le)??w.get(M)??[];for(const ve of ge){if(Y.has(ve))continue;Y.add(ve);const Se=e.packages?.[ve];if(Se&&!e.snapshots)for(const xe of pt(Se))v.push(xe)}}const $={lockfileVersion:e.lockfileVersion};for(const V of["settings","overrides","patchedDependencies","catalogs"])e[V]!==void 0&&($[V]=e[V]);if($.importers=x,e.packages){const V={};for(const ne of Object.keys(e.packages))Y.has(ne)&&(V[ne]=e.packages[ne]);$.packages=V}if(e.snapshots){const V={};for(const ne of Object.keys(e.snapshots))y.has(ne)&&(V[ne]=e.snapshots[ne]);$.snapshots=V}const P=Object.keys(e.packages??{}).length,ie=Object.keys($.packages??{}).length,oe=P-ie,R=Object.keys(d).length-Object.keys(x).length;return{content:oo($,{lineWidth:0}),message:`${g}: kept ${ie}/${P} packages and ${Object.keys(x).length} importers (dropped ${oe} packages, ${R} importers)`,status:"pruned"}},uo=a=>ts({...a,displayName:a.displayName??"aube-lock.yaml"}),po=a=>{let g="",C=!1,s=!1,h=!1;for(let e=0;e<a.length;e+=1){const d=a[e],w=a[e+1];if(s){d===`
|
|
2
2
|
`&&(s=!1,g+=d);continue}if(h){d==="*"&&w==="/"&&(h=!1,e+=1);continue}if(C){if(d==="\\"){g+=d,w!==void 0&&(g+=w,e+=1);continue}d==='"'&&(C=!1),g+=d;continue}if(d==='"'){C=!0,g+=d;continue}if(d==="/"&&w==="/"){s=!0,e+=1;continue}if(d==="/"&&w==="*"){h=!0,e+=1;continue}g+=d}return g},ho=a=>{const g=[];for(const C of[a.dependencies,a.devDependencies,a.optionalDependencies,a.peerDependencies])if(C)for(const[s,h]of Object.entries(C))typeof h=="string"&&g.push({name:s,spec:h});return g},go=a=>{for(const g of a)if(typeof g=="object"&&!Array.isArray(g))return g},mo=a=>{if(!a)return[];const g=[];for(const C of["dependencies","optionalDependencies","peerDependencies"]){const s=a[C];s!==null&&typeof s=="object"&&!Array.isArray(s)&&g.push(...Object.keys(s))}return g},yo=a=>{if(Buffer.isBuffer(a.lockfileContent))return{message:"bun.lockb is binary; run `bun install --save-text-lockfile` to regenerate as bun.lock, then rerun `vis docker scaffold`.",status:"skipped"};const g=po(a.lockfileContent);let C;try{C=JSON.parse(g)}catch(P){throw new Ze(`bun.lock: parse failed — ${P.message}`)}if(!C||typeof C!="object")throw new Ze("bun.lock: top-level value is not an object");const s=C.workspaces??{},h=C.packages??{},e=new Set([""]);for(const P of a.closure)e.add(P.relativeRoot===""?"":P.relativeRoot);const d={},w=[];for(const[P,ie]of Object.entries(s))e.has(P)&&(d[P]=ie,w.push(...ho(ie)));const m=new Set;for(const{name:P}of w)m.add(P);const A=[...m];for(;A.length>0;){const P=A.shift();for(const ie of Object.keys(h)){if(ie.split("/")[0]!==P&&ie!==P)continue;const R=go(h[ie]);for(const V of mo(R))m.has(V)||(m.add(V),A.push(V))}}const x={};for(const[P,ie]of Object.entries(h)){const oe=P.split("/")[0];(m.has(oe)||m.has(P))&&(x[P]=ie)}const Y={...C,packages:x,workspaces:d},y=Object.keys(h).length,v=Object.keys(x).length,$=y-v;return{content:`${JSON.stringify(Y,null,2)}
|
|
3
3
|
`,message:`bun.lock: kept ${v}/${y} packages (dropped ${$})`,status:"pruned"}},Jn="node_modules/",$o=(a,g,C)=>{let s=g;for(;;){const h=s===""?`${Jn}${C}`:`${s}/${Jn}${C}`;if(a[h]!==void 0)return h;if(s==="")return;const e=s.lastIndexOf(`/${Jn.slice(0,-1)}/`);s=e===-1?"":s.slice(0,e)}},vo=a=>{const g=[];for(const C of[a.dependencies,a.devDependencies,a.optionalDependencies,a.peerDependencies])if(C)for(const s of Object.keys(C))g.push(s);return g},Ao=a=>{const g=a.displayName??"package-lock.json",C=typeof a.lockfileContent=="string"?a.lockfileContent:a.lockfileContent.toString("utf8");let s;try{s=JSON.parse(C)}catch($){throw new Ze(`${g}: parse failed — ${$.message}`)}if(!s||typeof s!="object")throw new Ze(`${g}: top-level value is not an object`);const h=s.packages??{},e=new Set([""]);for(const $ of a.closure)$.relativeRoot!==""&&e.add($.relativeRoot);const d=new Set,w=[];for(const $ of Object.keys(h))e.has($)&&(d.add($),w.push($));for(const[$,P]of Object.entries(h))P.link===!0&&typeof P.resolved=="string"&&e.has(P.resolved)&&d.add($);for(;w.length>0;){const $=w.shift(),P=h[$];if(P)for(const ie of vo(P)){const oe=$o(h,$,ie);if(!oe||d.has(oe))continue;d.add(oe);const R=h[oe];R.link===!0&&typeof R.resolved=="string"&&h[R.resolved]!==void 0&&!d.has(R.resolved)?(d.add(R.resolved),w.push(R.resolved)):w.push(oe)}}const m={};for(const $ of Object.keys(h))d.has($)&&(m[$]=h[$]);const A=m[""];A&&Array.isArray(A.workspaces)&&(A.workspaces=A.workspaces.filter($=>{if(typeof $!="string")return!1;const P=$.replace(/\/?\*+$/,"").replace(/\/$/,"");if(P===""||P==="*")return!0;for(const ie of e)if(ie===$||ie===P||ie.startsWith(`${P}/`))return!0;return!1}));const x={...s,packages:m};delete x.dependencies;const Y=Object.keys(h).length,y=Object.keys(m).length,v=Y-y;return{content:`${JSON.stringify(x,null,2)}
|
|
4
4
|
`,message:`${g}: kept ${y}/${Y} entries (dropped ${v})`,status:"pruned"}};var Qn={},Fe={},zn,gt;function wo(){if(gt)return zn;gt=1;function a(s,h){function e(){this.constructor=s}e.prototype=h.prototype,s.prototype=new e}function g(s,h,e,d){this.message=s,this.expected=h,this.found=e,this.location=d,this.name="SyntaxError",typeof Error.captureStackTrace=="function"&&Error.captureStackTrace(this,g)}a(g,Error),g.buildMessage=function(s,h){var e={literal:function(y){return'"'+w(y.text)+'"'},class:function(y){var v="",$;for($=0;$<y.parts.length;$++)v+=y.parts[$]instanceof Array?m(y.parts[$][0])+"-"+m(y.parts[$][1]):m(y.parts[$]);return"["+(y.inverted?"^":"")+v+"]"},any:function(y){return"any character"},end:function(y){return"end of input"},other:function(y){return y.description}};function d(y){return y.charCodeAt(0).toString(16).toUpperCase()}function w(y){return y.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\0/g,"\\0").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/[\x00-\x0F]/g,function(v){return"\\x0"+d(v)}).replace(/[\x10-\x1F\x7F-\x9F]/g,function(v){return"\\x"+d(v)})}function m(y){return y.replace(/\\/g,"\\\\").replace(/\]/g,"\\]").replace(/\^/g,"\\^").replace(/-/g,"\\-").replace(/\0/g,"\\0").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/[\x00-\x0F]/g,function(v){return"\\x0"+d(v)}).replace(/[\x10-\x1F\x7F-\x9F]/g,function(v){return"\\x"+d(v)})}function A(y){return e[y.type](y)}function x(y){var v=new Array(y.length),$,P;for($=0;$<y.length;$++)v[$]=A(y[$]);if(v.sort(),v.length>0){for($=1,P=1;$<v.length;$++)v[$-1]!==v[$]&&(v[P]=v[$],P++);v.length=P}switch(v.length){case 1:return v[0];case 2:return v[0]+" or "+v[1];default:return v.slice(0,-1).join(", ")+", or "+v[v.length-1]}}function Y(y){return y?'"'+w(y)+'"':"end of input"}return"Expected "+x(s)+" but "+Y(h)+" found."};function C(s,h){h=h!==void 0?h:{};var e={},d={Start:Vi},w=Vi,m=function(r){return r||[]},A=function(r,t,o){return[{command:r,type:t}].concat(o||[])},x=function(r,t){return[{command:r,type:t||";"}]},Y=function(r){return r},y=";",v=ce(";",!1),$="&",P=ce("&",!1),ie=function(r,t){return t?{chain:r,then:t}:{chain:r}},oe=function(r,t){return{type:r,line:t}},R="&&",V=ce("&&",!1),ne="||",M=ce("||",!1),le=function(r,t){return t?{...r,then:t}:r},we=function(r,t){return{type:r,chain:t}},ge="|&",ve=ce("|&",!1),Se="|",xe=ce("|",!1),je="=",Be=ce("=",!1),$e=function(r,t){return{name:r,args:[t]}},Ne=function(r){return{name:r,args:[]}},Qe="(",Ee=ce("(",!1),re=")",Ie=ce(")",!1),De=function(r,t){return{type:"subshell",subshell:r,args:t}},Oe="{",Pe=ce("{",!1),_e="}",B=ce("}",!1),G=function(r,t){return{type:"group",group:r,args:t}},X=function(r,t){return{type:"command",args:t,envs:r}},me=function(r){return{type:"envs",envs:r}},qe=function(r){return r},ze=function(r){return r},Me=/^[0-9]/,Ye=We([["0","9"]],!1,!1),er=function(r,t,o){return{type:"redirection",subtype:t,fd:r!==null?parseInt(r):null,args:[o]}},or=">>",hr=ce(">>",!1),fr=">&",lr=ce(">&",!1),Cr=">",gr=ce(">",!1),Ke="<<<",rr=ce("<<<",!1),Ge="<&",dr=ce("<&",!1),mr="<",yr=ce("<",!1),Ue=function(r){return{type:"argument",segments:[].concat(...r)}},n=function(r){return r},k="$'",j=ce("$'",!1),J="'",l=ce("'",!1),b=function(r){return[{type:"text",text:r}]},E='""',T=ce('""',!1),O=function(){return{type:"text",text:""}},q='"',U=ce('"',!1),N=function(r){return r},Z=function(r){return{type:"arithmetic",arithmetic:r,quoted:!0}},Q=function(r){return{type:"shell",shell:r,quoted:!0}},ae=function(r){return{type:"variable",...r,quoted:!0}},de=function(r){return{type:"text",text:r}},se=function(r){return{type:"arithmetic",arithmetic:r,quoted:!1}},En=function(r){return{type:"shell",shell:r,quoted:!1}},kn=function(r){return{type:"variable",...r,quoted:!1}},tn=function(r){return{type:"glob",pattern:r}},jr=/^[^']/,Fr=We(["'"],!0,!1),$r=function(r){return r.join("")},sn=/^[^$"]/,on=We(["$",'"'],!0,!1),Kr=`\\
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{createRequire as ze}from"node:module";import{e as M,
|
|
1
|
+
import{createRequire as ze}from"node:module";import{e as M,z as Fe}from"./index-BzhrR_iC.js";import{r as qe}from"./docker-DXqV-07f.js";import{parse as We}from"../packem_chunks/index4.js";import Re from"../packem_chunks/index.js";import{b as fe,l as Ke,a as Ze,d as Qe,e as en,f as nn,g as tn}from"./multi-eco-lockfiles-B2X3yhyo.js";import{p as ke,r as ue,c as sn}from"./composer-DR3D-Psb.js";import{p as Ie}from"./readJsonSync-CbryXYxN-EWl7_7KX.js";import{e as on}from"./license-DvlYdo6T.js";import{S as rn}from"./lockfile-DhHAaHN5.js";import{a as cn}from"./index-B4AjSxHU.js";import{V as Le}from"./vis-user-error-S0Fesz5y.js";import{w as an,r as pn,Z as Ce}from"./zig-manifest-P7ydLEOa.js";let He;const Ve=e=>(He??=ze(import.meta.url))(e),ee=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,be=e=>{if(typeof ee<"u"&&ee.versions&&ee.versions.node){const[t,n]=ee.versions.node.split(".").map(Number);if(t>22||t===22&&n>=3||t===20&&n>=16)return ee.getBuiltinModule(e)}return Ve(e)},{randomUUID:Be}=be("node:crypto"),{readFileSync:G,readdirSync:Pe,statSync:Xe,existsSync:Je}=be("node:fs"),{join:A,relative:$e,resolve:De,basename:Ye}=be("node:path"),ne=e=>e.replaceAll(/[^\w.~-]/g,t=>`%${(t.codePointAt(0)??0).toString(16).toUpperCase().padStart(2,"0")}`),j=(e,t)=>{const n=e.toLowerCase();if(n.startsWith("@")){const s=n.indexOf("/");if(s>0){const o=n.slice(0,s),r=n.slice(s+1);return`pkg:npm/${ne(o)}/${ne(r)}@${ne(t)}`}}return`pkg:npm/${ne(n)}@${ne(t)}`},_={ARRAY:"array",BOOLEAN:"boolean",DATE:"date",FUNCTION:"function",JSTOXML_OBJECT:"jstoxml-object",NULL:"null",NUMBER:"number",OBJECT:"object",STRING:"string"},ln=[_.STRING,_.NUMBER,_.BOOLEAN],un='<?xml version="1.0" encoding="UTF-8"?>',Ee=["_selfCloseTag","_attrs"],fn=(e="",t=0)=>e.repeat(t),pe=e=>Array.isArray(e)&&_.ARRAY||typeof e===_.OBJECT&&e!==null&&e._name&&_.JSTOXML_OBJECT||e instanceof Date&&_.DATE||e===null&&_.NULL||typeof e,Ue=e=>e.startsWith("<![CDATA["),je=(e="",t={},n)=>{let s=e;if(typeof e===_.STRING){if(Ue(e))return e;const o=new RegExp(`(${Object.keys(t).join("|")})(?!(\\w|#)*;)`,"g");s=String(e).replace(o,(r,l)=>t[l]||"")}return typeof n=="function"?n(s):s},dn=(e={},t,n,s)=>(Array.isArray(e)?e:Object.entries(e).map(([r,l])=>({[r]:l}))).reduce((r,l)=>{const c=Object.keys(l)[0],i=l[c];if(typeof n===_.FUNCTION&&n(c,i))return r;const a=t?je(i,t):i,f=!s&&a===!0?"":`="${a}"`;return r.push(`${c}${f}`),r},[]),mn=(e={},t,n,s)=>{const o=dn(e,t,n,s);return o.length===0?"":` ${o.join(" ")}`},hn=(e={})=>Object.keys(e).map(t=>({_name:t,_content:e[t]})),gn=e=>ln.includes(pe(e)),vn=e=>!e.match("<"),yn=({header:e,isOutputStart:t})=>e&&t?typeof e===_.BOOLEAN?un:e:"",Ae={"<":"<",">":">","&":"&",'"':"""},q=(e={},t={})=>{const{depth:n=0,indent:s,_isFirstItem:o,_isOutputStart:r=!0,header:l,attributeReplacements:c={},attributeFilter:i,attributeExplicitTrue:a=!1,contentReplacements:f={},contentMap:g,selfCloseTags:y=!0}=t,X=typeof c=="boolean"&&!c?{}:{...Ae,...c},z=typeof f=="boolean"&&!f?{}:{...Ae,...f},N=typeof s=="string",H=fn(s,n),J=pe(e),Y=yn({header:l,isOutputStart:r}),O=r&&!Y&&o&&n===0,V=N&&!O?`
|
|
2
2
|
`:"";let k="";switch(J){case _.JSTOXML_OBJECT:{const{_name:b,_content:S}=e;if(S===null&&typeof g!="function"){k=`${V}${H}${b}`;break}if(Array.isArray(S)&&S.every(gn))return S.map(ae=>q({_name:b,_content:ae},{...t,depth:n,_isOutputStart:!1})).join("");if(Ee.includes(b))break;const $=q(S,{...t,depth:n+1,_isOutputStart:O}),B=pe($),E=vn($),oe=Ue($),T=`${V}${H}`;if(b==="_comment"){k+=`${T}<!-- ${S} -->`;break}const R=B==="undefined"||$==="",D=y,W=e._selfCloseTag,K=typeof W===_.BOOLEAN?R&&W:R&&D,I=K?"/":"",re=mn(e._attrs,X,i,a),Z=`<${b}${re}${I}>`,ce=N&&!E&&!oe?`
|
|
3
3
|
${H}`:"",ie=K?"":`${$}${ce}</${b}>`;k+=`${T}${Z}${ie}`;break}case _.OBJECT:{const b=Object.keys(e);k=b.map((v,$)=>{const B={...t,_isFirstItem:$===0,_isLastItem:$+1===b.length,_isOutputStart:O},E={_name:v};if(pe(e[v])===_.OBJECT&&(Ee.forEach(R=>{const D=e[v][R];typeof D<"u"&&(E[R]=D,delete e[v][R])}),typeof e[v]._content<"u"&&Object.keys(e[v]).length>1)){const R=Object.assign({},e[v]);delete R._content,E._content=[...hn(R),e[v]._content]}return typeof E._content>"u"&&(E._content=e[v]),q(E,B)},t).join("");break}case _.FUNCTION:{const b=e(t);k=q(b,t);break}case _.ARRAY:{k=e.map((S,v)=>{const $={...t,_isFirstItem:v===0,_isLastItem:v+1===e.length,_isOutputStart:O};return q(S,$)}).join("");break}default:{k=je(e,z,g);break}}return`${Y}${k}`},_n=(e,t)=>`pkg:cargo/${encodeURIComponent(e)}@${encodeURIComponent(t)}`,se=e=>e,bn=e=>{const t=e.split(" ")[0];if(t===void 0||t==="")return;const n=/^\S+\s+(\d[^\s(]*)/.exec(e)?.[1],s=/\(([^)]+)\)/.exec(e)?.[1];return{kind:"main",name:t,source:s,version:n}},$n=e=>{const t=[];let n,s=!1;const o=()=>{n?.name!==void 0&&n.version!==void 0&&t.push({deps:n.deps,member:n.source===void 0,name:n.name,source:n.source,version:n.version})};for(const r of e.split(`
|
|
4
4
|
`)){const l=r.trim();if(l==="[[package]]"){o(),n={deps:[]},s=!1;continue}if(n===void 0)continue;if(s){const i=/^"([^"]+)",?$/.exec(l);if(i){const a=bn(i[1]);a!==void 0&&n.deps.push(a)}else l==="]"&&(s=!1);continue}if(l==="dependencies = ["){s=!0;continue}const c=/^(name|version|source)\s*=\s*"([^"]*)"$/.exec(l);if(c){const[,i="",a=""]=c;i==="name"?n.name=a:i==="version"?n.version=a:n.source=a}}return o(),t},Cn=(e,t)=>{const n=typeof t=="object"&&t!==null?t.package:void 0;return typeof n=="string"?n:e},Sn=(e,t)=>{const n=Array.isArray(t.workspace?.members)?t.workspace.members.filter(r=>typeof r=="string"):[],s=Array.isArray(t.workspace?.exclude)?t.workspace.exclude.filter(r=>typeof r=="string"):[],o=new Set;for(const r of n){let l=[e];for(const c of r.split("/").filter(i=>i!==""&&i!==".")){const i=[];for(const a of l){if(!/[*?[{]/.test(c)){i.push(A(a,c));continue}let f;try{f=Pe(a)}catch{f=[]}for(const g of f){const y=A(a,g);Re(c,g)&&Xe(y).isDirectory()&&i.push(y)}}l=i}for(const c of l){const i=c.slice(e.length+1).split("\\").join("/");s.some(a=>Re(a,i))||o.add(c)}}return[...o]},Rn=e=>{const t=new Map;let n;try{n=Oe(G(A(e,"Cargo.toml"),"utf8"))}catch{return t}const s=Sn(e,n);n.package?.name!==void 0&&s.push(e);for(const o of s){let r;try{r=Oe(G(A(o,"Cargo.toml"),"utf8"))}catch{continue}if(typeof r.package?.name!="string")continue;const l=new Set,c=i=>{for(const[a,f]of Object.entries(i??{}))l.add(se(Cn(a,f)))};c(r.dependencies),c(r["build-dependencies"]);for(const i of Object.values(r.target??{}))c(i.dependencies),c(i["build-dependencies"]);t.set(se(r.package.name),l)}return t},Oe=e=>We(e),kn=(e,t={})=>{let n;try{n=G(A(e,"Cargo.lock"),"utf8")}catch{return{components:[],dependencies:[]}}const s=Rn(e),o=$n(n).map(r=>{const l=r.member?s.get(se(r.name)):void 0;return l===void 0?r:{...r,deps:r.deps.map(c=>l.has(se(c.name))?c:{...c,kind:"dev"})}});return fe(o,{focusNames:t.focusNames,includeDev:t.includeDev,normalize:se,purl:_n})},En=(e,t)=>`pkg:composer/${e.split("/").map(n=>encodeURIComponent(n)).join("/")}@${encodeURIComponent(t)}`,te=e=>e.toLowerCase(),An=e=>{const t=[];for(const[n,s]of[["packages",!1],["packages-dev",!0]]){const o=e[n];if(Array.isArray(o))for(const r of o){if(typeof r.name!="string"||typeof r.version!="string")continue;const l=[...ue(r,"require").map(c=>({kind:s?"dev":"main",name:c})),...ue(r,"require-dev").map(c=>({kind:"dev",name:c}))];t.push({deps:l,member:!1,name:r.name,version:sn(r.version)})}}return t},On=(e,t={})=>{const n={components:[],dependencies:[]};let s,o;try{s=ke(G(A(e,"composer.lock"),"utf8")),o=ke(G(A(e,"composer.json"),"utf8"))}catch{return n}const r=typeof o.name=="string"?te(o.name):void 0;if(t.focusNames!==void 0&&!t.focusNames.some(i=>te(i)===r))return n;const l=new Set([...ue(o,"require"),...t.includeDev?ue(o,"require-dev"):[]].map(i=>te(i))),c=An(s).map(i=>({...i,member:l.has(te(i.name))}));return fe(c,{includeDev:t.includeDev,normalize:te,purl:En})},Te=e=>e.split("/").map(t=>encodeURIComponent(t)).join("/"),Tn={Go:(e,t)=>`pkg:golang/${Te(e)}@${encodeURIComponent(t)}`,Pub:(e,t)=>`pkg:pub/${encodeURIComponent(e)}@${encodeURIComponent(t)}`,SwiftURL:(e,t)=>`pkg:swift/${Te(e)}@${encodeURIComponent(t)}`},wn=(e,t)=>{const n=Ke(e,t).map(s=>{const o=Tn[t](s.name,s.version);return{"bom-ref":o,name:s.name,purl:o,type:"library",version:s.version}}).sort((s,o)=>(s["bom-ref"]??"").localeCompare(o["bom-ref"]??""));return{components:n,dependencies:n.map(s=>({ref:s["bom-ref"]??""}))}},xn=(e,t)=>`pkg:gem/${encodeURIComponent(e)}@${encodeURIComponent(t)}`,Nn=/^ {4}(\S+) \(([^()]+)\)\s*$/,Pn=/^ {6}(\S+)(?: \(.*\))?\s*$/,Dn=e=>{const t=new Map;let n,s,o;for(const r of e.split(/\r?\n/)){if(r.length>0&&!r.startsWith(" ")){n=r.trim(),s=void 0,o=void 0;continue}if(n!=="PATH"&&n!=="GEM"&&n!=="GIT")continue;const l=/^ {2}remote: (.+)$/.exec(r);if(l?.[1]!==void 0){s=l[1].trim();continue}const c=Nn.exec(r);if(c?.[1]!==void 0&&c[2]!==void 0){const a=c[1],f=c[2].split("-")[0]??c[2],g=n==="GIT"&&s!==void 0?`git:${s}`:void 0,y=`${a}\0${f}\0${g??""}`;o=t.get(y)??{deps:[],member:n==="PATH",name:a,source:g,version:f},t.set(y,o);continue}const i=Pn.exec(r);i?.[1]!==void 0&&o!==void 0&&o.deps.push({kind:"main",name:i[1]})}return[...t.values()]},In=(e,t={})=>{let n;try{n=G(A(e,"Gemfile.lock"),"utf8")}catch{return{components:[],dependencies:[]}}return fe(Dn(n),{focusNames:t.focusNames,includeDev:t.includeDev,normalize:s=>s,purl:xn})},ye=e=>{try{return Ie(e)}catch{return}},Ln=e=>{if(e.length===0||e.includes("..")||e.startsWith(".")||e.includes("\0")||e.includes("\\"))return!1;if(e.startsWith("@")){const t=e.indexOf("/");return t>1&&!e.includes("/",t+1)}return!e.includes("/")},Un=e=>e.length>0&&!e.includes("/")&&!e.includes("\\")&&!e.includes("..")&&!e.includes("\0"),jn=(e,t,n)=>{const o=`${t.replaceAll("/","+")}@${n}`,r=M(e,"node_modules",".pnpm"),l=ye(M(r,o,"node_modules",t,"package.json"));if(l)return l;let c;try{c=Pe(r)}catch{return}const i=`${o}_`;for(const a of c){if(!a.startsWith(i))continue;const f=ye(M(r,a,"node_modules",t,"package.json"));if(f)return f}},Mn=(e,t,n)=>{const s=ye(M(e,"node_modules",t,"package.json"));return s?.version===n?s:void 0},Gn=(e,t,n)=>{if(!(!Ln(t)||!Un(n)))return jn(e,t,n)??Mn(e,t,n)},zn={sha256:"SHA-256",sha384:"SHA-384",sha512:"SHA-512"},Hn={sha256:64,sha384:96,sha512:128},Vn=e=>{const t={name:e.name,version:e.version},{integrity:n}=e;return n&&n.hex.length===Hn[n.algorithm]&&(t.hash={alg:zn[n.algorithm],content:n.hex}),e.dependencies&&(t.dependencies=e.dependencies),e.peerDependencies&&(t.peerDependencies=e.peerDependencies),e.optionalDependencies&&(t.optionalDependencies=e.optionalDependencies),t},Bn=[{file:"pnpm-lock.yaml",type:"pnpm"},{file:"npm-shrinkwrap.json",type:"npm"},{file:"package-lock.json",type:"npm"},{file:"yarn.lock",type:"yarn"},{file:"bun.lock",type:"bun"}],Fn=e=>{for(const{file:t,type:n}of Bn){let s;try{s=Fe(M(e,t))}catch{continue}const o=new Map;for(const r of rn(s,n))o.set(`${r.name}@${r.version}`,Vn(r));return{packages:o,type:n}}},Me=e=>e.toLowerCase().replaceAll(/[-_.]+/g,"-"),qn=(e,t)=>`pkg:pypi/${encodeURIComponent(Me(e))}@${encodeURIComponent(t)}`,Xn=/^source\s*=\s*\{\s*(?:editable|virtual|directory)\s*=/,Jn=/\{\s*name\s*=\s*"([^"]+)"([^}]*)\}/,Yn=e=>{const t=[];let n,s="none",o=!1;const r=()=>{n?.name!==void 0&&n.version!==void 0&&t.push({deps:n.deps,member:n.member,name:n.name,source:n.source,version:n.version})};for(const l of e.split(`
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{e as d,
|
|
1
|
+
import{e as d,z as u}from"./index-BzhrR_iC.js";import{s as l}from"./index-B4AjSxHU.js";import{y as f}from"./isAccessibleSync-DYKTrrvc-C-_5cgwu.js";import{p as m}from"./readJsonSync-CbryXYxN-EWl7_7KX.js";const v={sha1:40,sha224:56,sha256:64,sha384:96,sha512:128},p=o=>{const n=o.indexOf("+");if(n===-1)return;const t=o.slice(n+1),e=/^([a-z0-9]+)\.([0-9a-f]+)$/.exec(t),s=e?v[e[1]]:void 0;if(!(e&&s!==void 0&&e[2].length===s))return`packageManager "${o}" has a malformed integrity suffix. Expected "+<algo>.<hex>" with algo sha1, sha224, sha256, sha384 or sha512 and lowercase hex of the matching length (sha512 = 128 characters).`},k=[".nvmrc",".node-version"],y=o=>{const n=d(o,"package.json");if(!f(n))return{};try{return m(n)??{}}catch{return{}}},c=(o,n)=>{const t=[];for(const{name:e,version:s}of n){const a=typeof s=="string"&&s.trim()!==""?s.trim():"*";l.validRange(a)!==null&&t.push({name:e,range:a})}if(t.length!==0)return{entries:t,label:o,value:n.map(e=>typeof e.version=="string"&&e.version!==""?`${e.name}@${e.version}`:e.name).join(" | ")}},h=(o,n)=>{const t=Array.isArray(o)?o:[o],e=[];for(const s of t){if(typeof s!="object"||s===null)continue;const{name:a,version:r}=s;typeof a!="string"||n!==void 0&&a!==n||e.push({name:a,version:r})}return e},E=(o,n)=>{const t=d(o,n);if(f(t))try{const e=u(t).trim();return e===""?void 0:e}catch{return}},x=(o,n)=>{const t=[];for(const r of k){const i=E(o,r);i!==void 0&&t.push(c(r,[{name:"node",version:i}]))}const e=n.engines;e&&typeof e.node=="string"&&t.push(c("engines.node",[{name:"node",version:e.node}]));const s=n.devEngines;s?.runtime!==void 0&&t.push(c("devEngines.runtime",h(s.runtime,"node")));const a=n.volta;return a&&typeof a.node=="string"&&t.push(c("volta.node",[{name:"node",version:a.node}])),t.filter(r=>r!==void 0)},$=o=>{const n=[],t=[];if(typeof o.packageManager=="string"){const s=o.packageManager,a=p(s);a&&t.push(a);const[r]=s.split("+",1),i=/^([^@]+)@(.+)$/.exec(r??"");i&&n.push(c("packageManager",[{name:i[1],version:i[2]}]))}const e=o.devEngines;if(e?.packageManager!==void 0){const s=h(e.packageManager);n.push(c("devEngines.packageManager",s))}return{declarations:n.filter(s=>s!==void 0),integrityIssues:t}},M=(o,n)=>o.entries.some(t=>n.entries.some(e=>t.name===e.name&&l.intersects(t.range,e.range))),g=(o,n)=>{const t=[];for(let e=0;e<n.length;e++)for(let s=e+1;s<n.length;s++){const a=n[e],r=n[s];M(a,r)||t.push(`Conflicting ${o} declarations: ${a.label} (${a.value}) and ${r.label} (${r.value}) have no version in common. vis does not pick one; align them.`)}return t},P=o=>{const n=y(o),t=x(o,n),{declarations:e,integrityIssues:s}=$(n),a=t.length+e.length;if(a===0&&s.length===0)return[{id:"env-declarations",message:"No Node.js or package-manager declarations to cross-check.",status:"skip"}];const r=[...g("Node.js",t),...g("package-manager",e)].map(i=>({id:"env-conflict",message:i,status:"warn"}));for(const i of s)r.push({id:"env-integrity",message:i,status:"warn"});return r.length===0?[{id:"env-declarations",message:`Node.js and package-manager declarations agree (${a} checked).`,status:"ok"}]:r};export{P as c};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{createRequire as p}from"node:module";import{e as j}from"./index-
|
|
1
|
+
import{createRequire as p}from"node:module";import{e as j}from"./index-BzhrR_iC.js";import{a as F}from"./formatBytes-_HvjOy8a-B_qQr4Hw.js";let h;const m=t=>(h??=p(import.meta.url))(t),s=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,c=t=>{if(typeof s<"u"&&s.versions&&s.versions.node){const[e,r]=s.versions.node.split(".").map(Number);if(e>22||e===22&&r>=3||e===20&&r>=16)return s.getBuiltinModule(t)}return m(t)},{mkdirSync:f,writeFileSync:y,readdirSync:g}=c("node:fs"),{readFile:_}=c("node:fs/promises"),i=t=>F(t),a=(t,e)=>j(i(t),`${encodeURIComponent(e)}.json`);class R{#e;#t;constructor(e,r){this.#e=e,this.#t=r}printTaskTerminalOutput(e,r,o){if(r!=="failure")return;const n=i(this.#e);try{f(n,{recursive:!0})}catch{return}const u=e.overrides.command,d=e.projectRoot,l={command:u,cwd:d,exitCode:void 0,hash:e.hash,runId:this.#t,status:r,taskId:e.id,terminalOutput:o,timestamp:new Date().toISOString()};try{y(a(this.#e,e.id),`${JSON.stringify(l,void 0,2)}
|
|
2
2
|
`,"utf8")}catch{}}}const S=async(t,e)=>{const r=a(t,e);try{const o=await _(r,"utf8");return JSON.parse(o)}catch{return}},w=t=>{const e=i(t);let r;try{r=g(e)}catch{return[]}const o=[];for(const n of r)if(n.endsWith(".json"))try{o.push(decodeURIComponent(n.slice(0,-5)))}catch{}return o};export{R as F,S as a,w as l};
|
package/dist/packem_shared/{formatBytes-BHAzNIrn-DRcKvqnb.js → formatBytes-_HvjOy8a-B_qQr4Hw.js}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{createRequire as st}from"node:module";import{e as f}from"./index-BdMIfGVZ.js";import{y as G}from"./isAccessibleSync-DYKTrrvc-BwaMhQs0.js";import{p as ht}from"./readJsonSync-CbryXYxN-Bm5i10UW.js";import{h as dt}from"./writeFileSync-DJoHk3Ks-Dhem3Uof.js";let nt;const ot=t=>(nt??=st(import.meta.url))(t),x=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,R=t=>{if(typeof x<"u"&&x.versions&&x.versions.node){const[s,e]=x.versions.node.split(".").map(Number);if(s>22||s===22&&e>=3||s===20&&e>=16)return x.getBuiltinModule(t)}return ot(t)},{existsSync:it,readdirSync:z,statSync:rt,rmSync:Y,writeFileSync:at}=R("node:fs"),{spawn:F}=R("node:child_process"),{createHash:ct}=R("node:crypto"),{homedir:lt,platform:ut}=R("node:os"),pt=[161,161,164,164,167,168,170,170,173,174,176,180,182,186,188,191,198,198,208,208,215,216,222,225,230,230,232,234,236,237,240,240,242,243,247,250,252,252,254,254,257,257,273,273,275,275,283,283,294,295,299,299,305,307,312,312,319,322,324,324,328,331,333,333,338,339,358,359,363,363,462,462,464,464,466,466,468,468,470,470,472,472,474,474,476,476,593,593,609,609,708,708,711,711,713,715,717,717,720,720,728,731,733,733,735,735,768,879,913,929,931,937,945,961,963,969,1025,1025,1040,1103,1105,1105,8208,8208,8211,8214,8216,8217,8220,8221,8224,8226,8228,8231,8240,8240,8242,8243,8245,8245,8251,8251,8254,8254,8308,8308,8319,8319,8321,8324,8364,8364,8451,8451,8453,8453,8457,8457,8467,8467,8470,8470,8481,8482,8486,8486,8491,8491,8531,8532,8539,8542,8544,8555,8560,8569,8585,8585,8592,8601,8632,8633,8658,8658,8660,8660,8679,8679,8704,8704,8706,8707,8711,8712,8715,8715,8719,8719,8721,8721,8725,8725,8730,8730,8733,8736,8739,8739,8741,8741,8743,8748,8750,8750,8756,8759,8764,8765,8776,8776,8780,8780,8786,8786,8800,8801,8804,8807,8810,8811,8814,8815,8834,8835,8838,8839,8853,8853,8857,8857,8869,8869,8895,8895,8978,8978,9312,9449,9451,9547,9552,9587,9600,9615,9618,9621,9632,9633,9635,9641,9650,9651,9654,9655,9660,9661,9664,9665,9670,9672,9675,9675,9678,9681,9698,9701,9711,9711,9733,9734,9737,9737,9742,9743,9756,9756,9758,9758,9792,9792,9794,9794,9824,9825,9827,9829,9831,9834,9836,9837,9839,9839,9886,9887,9919,9919,9926,9933,9935,9939,9941,9953,9955,9955,9960,9961,9963,9969,9972,9972,9974,9977,9979,9980,9982,9983,10045,10045,10102,10111,11094,11097,12872,12879,57344,63743,65024,65039,65533,65533,127232,127242,127248,127277,127280,127337,127344,127373,127375,127376,127387,127404,917760,917999,983040,1048573,1048576,1114109],ft=12288,gt=65510,mt=[12288,12288,65281,65376,65504,65510],wt=8361,bt=65518,yt=[8361,8361,65377,65470,65474,65479,65482,65487,65490,65495,65498,65500,65512,65518],St=32,Et=10630,xt=[32,126,162,163,165,166,172,172,175,175,10214,10221,10629,10630],$t=4352,Mt=262141,V=[4352,4447,8986,8987,9001,9002,9193,9196,9200,9200,9203,9203,9725,9726,9748,9749,9776,9783,9800,9811,9855,9855,9866,9871,9875,9875,9889,9889,9898,9899,9917,9918,9924,9925,9934,9934,9940,9940,9962,9962,9970,9971,9973,9973,9978,9978,9981,9981,9989,9989,9994,9995,10024,10024,10060,10060,10062,10062,10067,10069,10071,10071,10133,10135,10160,10160,10175,10175,11035,11036,11088,11088,11093,11093,11904,11929,11931,12019,12032,12245,12272,12287,12289,12350,12353,12438,12441,12543,12549,12591,12593,12686,12688,12773,12783,12830,12832,12871,12880,42124,42128,42182,43360,43388,44032,55203,63744,64255,65040,65049,65072,65106,65108,65126,65128,65131,94176,94180,94192,94198,94208,101589,101631,101662,101760,101874,110576,110579,110581,110587,110589,110590,110592,110882,110898,110898,110928,110930,110933,110933,110948,110951,110960,111355,119552,119638,119648,119670,126980,126980,127183,127183,127374,127374,127377,127386,127488,127490,127504,127547,127552,127560,127568,127569,127584,127589,127744,127776,127789,127797,127799,127868,127870,127891,127904,127946,127951,127955,127968,127984,127988,127988,127992,128062,128064,128064,128066,128252,128255,128317,128331,128334,128336,128359,128378,128378,128405,128406,128420,128420,128507,128591,128640,128709,128716,128716,128720,128722,128725,128728,128732,128735,128747,128748,128756,128764,128992,129003,129008,129008,129292,129338,129340,129349,129351,129535,129648,129660,129664,129674,129678,129734,129736,129736,129741,129756,129759,129770,129775,129784,131072,196605,196608,262141],$=(t,s)=>{let e=0,n=Math.floor(t.length/2)-1;for(;e<=n;){const r=Math.floor((e+n)/2),c=r*2;if(s<t[c])n=r-1;else if(s>t[c+1])e=r+1;else return!0}return!1},D=19968,[Bt,kt]=vt(V);function vt(t){let s=t[0],e=t[1];for(let n=0;n<t.length;n+=2){const r=t[n],c=t[n+1];if(D>=r&&D<=c)return[r,c];c-r>e-s&&(s=r,e=c)}return[s,e]}const Tt=t=>t<161||t>1114109?!1:$(pt,t),It=t=>t<ft||t>gt?!1:$(mt,t),Rt=t=>t<wt||t>bt?!1:$(yt,t),Wt=t=>t<St||t>Et?!1:$(xt,t),_t=t=>t>=Bt&&t<=kt?!0:t<$t||t>Mt?!1:$(V,t);function Ct(t){return Tt(t)?"ambiguous":It(t)?"fullwidth":Rt(t)?"halfwidth":Wt(t)?"narrow":_t(t)?"wide":"neutral"}function Nt(t){if(!Number.isSafeInteger(t))throw new TypeError(`Expected a code point, got \`${typeof t}\`.`)}function Z(t){return Nt(t),Ct(t)}const H=String.raw,j=H`\p{Emoji}(?:\p{EMod}|[\u{E0020}-\u{E007E}]+\u{E007F}|\uFE0F?\u20E3?)`,At=()=>new RegExp(H`\p{RI}{2}|(?)${j}(?:\u200D${j})*`,"gu"),he=new Set(["\x1B",""]),de="\x07",pe="]8;;",fe=/[\u200B\uFEFF\u2060-\u2064]/g,U=/[\u001B\u009B](?:[[()#;?]{0,10}(?:\d{1,4}(?:;\d{0,4})*)?[0-9A-ORZcf-nqry=><]|\]8;;[^\u0007\u001B]{0,100}(?:\u0007|\u001B\\)|\][^\u0007\u001B]{0,1000}(?:\u0007|\u001B\\))/g,ge=/\u001B\[[\d;]*m[^\u001B]*(?:\u001B\[[\d;]*m|$)/g,me=/\u001B\]8;[^\u0007\u001B]*(?:\u0007|\u001B\\)[^\u001B]*\u001B\]8;;(?:\u0007|\u001B\\)/g,v=/[\u0000-\u0008\n-\u001F\u007F-\u009F]{1,1000}/y,q=At(),we=/[-_./\s]+/g,be=/(\u001B\[[0-9;]*[a-z])/i,ye=new RegExp("\\p{Script=Arabic}","u"),Se=new RegExp("\\p{Script=Bengali}","u"),Ee=new RegExp("\\p{Script=Cyrillic}","u"),xe=new RegExp("\\p{Script=Devanagari}","u"),$e=new RegExp("\\p{Script=Ethiopic}","u"),Me=new RegExp("\\p{Script=Greek}","u"),Be=new RegExp("\\p{Script=Greek}+|\\p{Script=Latin}+|[^\\p{Script=Greek}\\p{Script=Latin}]+","gu"),ke=new RegExp("\\p{Script=Gujarati}","u"),ve=new RegExp("\\p{Script=Gurmukhi}","u"),Te=new RegExp("\\p{Script=Hangul}","u"),Ie=new RegExp("\\p{Script=Hebrew}","u"),Re=new RegExp("\\p{Script=Hiragana}","u"),We=new RegExp("\\p{Script=Han}","u"),_e=new RegExp("\\p{Script=Kannada}","u"),Ce=new RegExp("\\p{Script=Katakana}","u"),Ne=new RegExp("\\p{Script=Khmer}","u"),Ae=new RegExp("\\p{Script=Lao}","u"),Fe=new RegExp("\\p{Script=Latin}","u"),De=new RegExp("\\p{Script=Malayalam}","u"),je=new RegExp("\\p{Script=Myanmar}","u"),Oe=new RegExp("\\p{Script=Oriya}","u"),Pe=new RegExp("\\p{Script=Sinhala}","u"),Ke=new RegExp("\\p{Script=Tamil}","u"),Le=new RegExp("\\p{Script=Telugu}","u"),ze=new RegExp("\\p{Script=Thai}","u"),Ye=new RegExp("\\p{Script=Tibetan}","u"),Ge=/[\u02BB\u02BC\u0027]/u,Ve=t=>t.replace(q,""),O=new Map,Ft=t=>[t.ambiguousIsNarrow?1:0,t.control,t.fullWidth,t.regular,t.wide].join("|"),Dt=t=>{const s=Ft(t.width);let e=O.get(s);return e||(e=new Map,O.set(s,e)),e},T=new RegExp(U.source,"y"),_=new RegExp(q.source,"uy"),I=/(?:[\u0020-\u007E\u00A0-\u00FF](?!\uFE0F)){1,1000}/y,J=t=>t>=32&&t<=126?"latin":t===8203||t===8204||t===8205||t===8288?"zero":t<=31||t>=127&&t<=159?"control":t>=160&&t<=255||t>=9472&&t<=9599?"latin":t>=4352&&t<=4607||t>=11904&&t<=40959||t>=44032&&t<=55215||t>=63744&&t<=64255||t>=65280&&t<=65519&&!(t>=65377&&t<=65439)||t>=12352&&t<=12543?"wide":t===8230?"latin":"other",jt=(t,s)=>{const e=Dt(s),n=Math.floor(t/65536),r=t%65536;let c=e.get(n);if(c||(c=new Map,e.set(n,c)),c.has(r))return c.get(r);let o;switch(J(t)){case"control":{o=s.width.control;break}case"latin":{o=s.width.regular;break}case"wide":{o=s.width.wide;break}case"zero":{o=0;break}default:switch(Z(t)){case"ambiguous":{o=s.width.ambiguousIsNarrow?s.width.regular:s.width.wide;break}case"fullwidth":{o=s.width.fullWidth;break}case"wide":{o=s.width.wide;break}default:o=s.width.regular}}return c.set(r,o),o},Ot=t=>t>=768&&t<=879||t>=6832&&t<=6911||t>=7616&&t<=7679||t>=8400&&t<=8447||t>=65056&&t<=65071||t>=917760&&t<=917999||t>=65024&&t<=65039||t>=3633&&t<=3642||t>=3655&&t<=3662||t>=3761&&t<=3769||t>=3771&&t<=3772||t>=3784&&t<=3789||t>=2304&&t<=2307||t>=2362&&t<=2383||t>=2385&&t<=2391||t>=2402&&t<=2403||t>=2433&&t<=2435||t>=2492&&t<=2500||t>=2509&&t<=2509||t>=2561&&t<=2563||t>=2620&&t<=2637||t>=1611&&t<=1631||t>=1648&&t<=1648||t>=1750&&t<=1773||t>=2276&&t<=2302||t>=1425&&t<=1469||t>=1471&&t<=1471||t>=1473&&t<=1474||t>=1476&&t<=1477||t>=1479&&t<=1479||t>=3893&&t<=3893||t>=3895&&t<=3895||t>=3897&&t<=3897||t>=3953&&t<=3966||t>=3968&&t<=3972||t>=3974&&t<=3975?!0:t>=768&&t<=777||t>=803&&t<=803,C=(t,s={})=>{if(!t||t.length===0)return{ellipsed:!1,index:0,truncated:!1,width:0};const e={truncation:{countAnsiEscapeCodes:s.countAnsiEscapeCodes??!1,ellipsis:s.ellipsis??"",ellipsisWidth:s.ellipsisWidth??(s.ellipsis?C(s.ellipsis,{...s,ellipsis:"",ellipsisWidth:0,limit:Number.POSITIVE_INFINITY}).width:0),limit:s.limit??Number.POSITIVE_INFINITY},width:{ambiguousIsNarrow:s.ambiguousIsNarrow??!1,ansi:s.ansiWidth??0,control:s.controlWidth??0,emoji:s.emojiWidth??2,fullWidth:s.fullWidth??2,halfWidth:s.halfWidth??1,regular:s.regularWidth??1,tab:s.tabWidth??8,wide:s.wideWidth??2}},n=Math.max(0,e.truncation.limit-e.truncation.ellipsisWidth),{length:r}=t,c=r>1e4;let o=0,i=0,a=r,l=!1;const p=t.includes("\x1B")||t.includes("");for(;o<r;){if(p&&(t[o]==="\x1B"||t[o]==="")){if(t.startsWith("\x1B]8;;",o)){const d="\x1B]8;;\x07",w=d.length,y=t.indexOf("\x07",o+5);if(y!==-1){const S=t.indexOf(d,y+1);if(S!==-1){const B=S+w,W=t.slice(y+1,S).replace(U,""),k=C(W,{ambiguousIsNarrow:e.width.ambiguousIsNarrow,ansiWidth:e.width.ansi,controlWidth:e.width.control,countAnsiEscapeCodes:!1,ellipsis:e.truncation.ellipsis,ellipsisWidth:e.truncation.ellipsisWidth,emojiWidth:e.width.emoji,fullWidth:e.width.fullWidth,halfWidth:e.width.halfWidth,limit:Math.max(0,n-i),regularWidth:e.width.regular,tabWidth:e.width.tab,wideWidth:e.width.wide}),E=k.width;if(k.truncated)l=!0,a=Math.min(a,o);else if(i+E>n&&(a=Math.min(a,o),l=!0,i+E>e.truncation.limit))break;if(i+=E,o=B,l&&i>=e.truncation.limit)break;continue}}}if(T.lastIndex=o,T.test(t)){const d=T.lastIndex-o,w=e.truncation.countAnsiEscapeCodes?d:e.width.ansi;if(i+w>n&&(a=Math.min(a,o),i+w>e.truncation.limit)){l=!0;break}i+=w,o=T.lastIndex;continue}}const u=t.codePointAt(o);if(u===8203||u===65279||u>=8288&&u<=8292){o+=1;continue}if(u===9){if(i+e.width.tab>n&&(a=Math.min(a,o),i+e.width.tab>e.truncation.limit)){l=!0;break}i+=e.width.tab,o+=1;continue}if(I.lastIndex=o,I.test(t)){const d=(I.lastIndex-o)*e.width.regular;if(i+d>n){const w=e.width.regular>0?Math.floor((n-i)/e.width.regular):0;if(a=Math.min(a,o+w),i+d>e.truncation.limit){l=!0;break}}i+=d,o=I.lastIndex;continue}if((u<=31||u>=127&&u<=159)&&(v.lastIndex=o,v.test(t))){const d=(v.lastIndex-o)*e.width.control;if(i+d>n){const w=e.width.control>0?Math.floor((n-i)/e.width.control):0;if(a=Math.min(a,o+w),i+d>e.truncation.limit){l=!0;break}}i+=d,o=v.lastIndex;continue}if(_.lastIndex=o,_.test(t)){if(i+e.width.emoji>n&&(a=Math.min(a,o),i+e.width.emoji>e.truncation.limit)){l=!0;break}i+=e.width.emoji,o=_.lastIndex;continue}const m=t.codePointAt(o)??0;if(Ot(m)){o+=m>65535?2:1;continue}let h;if(c)h=jt(m,e);else switch(J(m)){case"control":{h=e.width.control;break}case"latin":{h=e.width.regular;break}case"wide":{h=e.width.wide;break}case"zero":{h=0;break}default:switch(Z(m)){case"ambiguous":{h=e.width.ambiguousIsNarrow?e.width.regular:e.width.wide;break}case"fullwidth":{h=e.width.fullWidth;break}case"wide":{h=e.width.wide;break}default:h=e.width.regular}}if(i+h>n&&(a=Math.min(a,o),i+h>e.truncation.limit)){l=!0;break}i+=h,o+=m>65535?2:1}let g=i,b=!1;return l&&e.truncation.limit>=e.truncation.ellipsisWidth&&(g=e.truncation.limit,b=!0),{ellipsed:b,index:l?a:r,truncated:l,width:g}},Ze=(t,s={})=>C(t,{...s,ellipsis:"",ellipsisWidth:0,limit:Number.POSITIVE_INFINITY}).width,N=()=>f(lt(),".vis"),Pt=()=>f(N(),"cache"),He=()=>f(N(),"state"),Kt=t=>ct("sha256").update(t).digest("hex").slice(0,12),Ue=t=>f(N(),"workspaces",Kt(t)),Lt=".vis",A=t=>f(t,Lt),qe="node_modules/.cache/vis",Je=t=>f(A(t),"runs"),Xe=t=>f(A(t),"last-summary.json"),Qe=t=>f(A(t),"last-failures"),ts=t=>{const s=ut()==="win32";for(const e of[".task-runner",".task-runner-cache"]){const n=f(t,e);if(it(n))try{const r=s?F("cmd.exe",["/c","rmdir","/s","/q",n],{detached:!0,stdio:"ignore"}):F("rm",["-rf",n],{detached:!0,stdio:"ignore"});r.on("error",()=>{}),r.unref()}catch{}}},zt="https://api.socket.dev/v0/purl?alerts=true",M=()=>f(Pt(),"socket-security"),Yt=3600*1e3,X=.4,P=100,Gt=t=>typeof t=="object"&&t!==null&&"id"in t&&"type"in t&&"name"in t&&"version"in t&&"alerts"in t&&"score"in t&&t.type==="npm",Vt=()=>{dt(M())},Q=(t,s)=>`${encodeURIComponent(t)}@${encodeURIComponent(s)}`,Zt=(t,s)=>{const e=Q(t,s),n=f(M(),`${e}.json`);try{const r=ht(n);if(Date.now()-r.createdAt>r.ttlMs){Y(n,{force:!0});return}return r.report}catch{return}},Ht=(t,s,e,n)=>{const r=Q(t,s),c={createdAt:Date.now(),report:e,ttlMs:n};at(f(M(),`${r}.json`),JSON.stringify(c),"utf8")},Ut=t=>{const s=[t.license,t.maintenance,t.quality,t.supplyChain,t.vulnerability];return Number((s.reduce((e,n)=>e+n,0)/s.length).toFixed(2))},qt=async(t,s={})=>{const{apiToken:e,cacheTtlMs:n=Yt,timeoutMs:r=15e3}=s,c=new Map;if(t.length===0||!e)return c;const o=[];for(const l of t){const p=Zt(l.name,l.version);p?c.set(`${l.name}@${l.version}`,p):o.push(l)}if(o.length===0)return c;const i=`Basic ${Buffer.from(`${e}:`).toString("base64")}`;Vt();const a=[];for(let l=0;l<o.length;l+=P)a.push(o.slice(l,l+P));for(const l of a){const p=l.map(u=>({purl:`pkg:npm/${u.name}@${u.version}`})),g=new AbortController,b=setTimeout(()=>{g.abort()},r);try{const u=await fetch(zt,{body:JSON.stringify({components:p}),headers:{Authorization:i,"Content-Type":"application/json","User-Agent":"@visulima/vis"},method:"POST",signal:g.signal});if(!u.ok)continue;const m=await u.text();Jt(m,l,c,n)}catch{}finally{clearTimeout(b)}}return c},Jt=(t,s,e,n)=>{const r=new Map;for(const o of s)r.set(`${o.name}@${o.version}`,o);const c=t.split(`}
|
|
1
|
+
import{createRequire as st}from"node:module";import{e as f}from"./index-BzhrR_iC.js";import{y as G}from"./isAccessibleSync-DYKTrrvc-C-_5cgwu.js";import{p as ht}from"./readJsonSync-CbryXYxN-EWl7_7KX.js";import{h as dt}from"./writeFileSync-DJoHk3Ks-BPRoepNw.js";let nt;const ot=t=>(nt??=st(import.meta.url))(t),x=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,I=t=>{if(typeof x<"u"&&x.versions&&x.versions.node){const[s,e]=x.versions.node.split(".").map(Number);if(s>22||s===22&&e>=3||s===20&&e>=16)return x.getBuiltinModule(t)}return ot(t)},{existsSync:it,readdirSync:Y,statSync:rt,rmSync:z,writeFileSync:at}=I("node:fs"),{spawn:F}=I("node:child_process"),{createHash:ct}=I("node:crypto"),{homedir:lt,platform:ut}=I("node:os"),pt=[161,161,164,164,167,168,170,170,173,174,176,180,182,186,188,191,198,198,208,208,215,216,222,225,230,230,232,234,236,237,240,240,242,243,247,250,252,252,254,254,257,257,273,273,275,275,283,283,294,295,299,299,305,307,312,312,319,322,324,324,328,331,333,333,338,339,358,359,363,363,462,462,464,464,466,466,468,468,470,470,472,472,474,474,476,476,593,593,609,609,708,708,711,711,713,715,717,717,720,720,728,731,733,733,735,735,768,879,913,929,931,937,945,961,963,969,1025,1025,1040,1103,1105,1105,8208,8208,8211,8214,8216,8217,8220,8221,8224,8226,8228,8231,8240,8240,8242,8243,8245,8245,8251,8251,8254,8254,8308,8308,8319,8319,8321,8324,8364,8364,8451,8451,8453,8453,8457,8457,8467,8467,8470,8470,8481,8482,8486,8486,8491,8491,8531,8532,8539,8542,8544,8555,8560,8569,8585,8585,8592,8601,8632,8633,8658,8658,8660,8660,8679,8679,8704,8704,8706,8707,8711,8712,8715,8715,8719,8719,8721,8721,8725,8725,8730,8730,8733,8736,8739,8739,8741,8741,8743,8748,8750,8750,8756,8759,8764,8765,8776,8776,8780,8780,8786,8786,8800,8801,8804,8807,8810,8811,8814,8815,8834,8835,8838,8839,8853,8853,8857,8857,8869,8869,8895,8895,8978,8978,9312,9449,9451,9547,9552,9587,9600,9615,9618,9621,9632,9633,9635,9641,9650,9651,9654,9655,9660,9661,9664,9665,9670,9672,9675,9675,9678,9681,9698,9701,9711,9711,9733,9734,9737,9737,9742,9743,9756,9756,9758,9758,9792,9792,9794,9794,9824,9825,9827,9829,9831,9834,9836,9837,9839,9839,9886,9887,9919,9919,9926,9933,9935,9939,9941,9953,9955,9955,9960,9961,9963,9969,9972,9972,9974,9977,9979,9980,9982,9983,10045,10045,10102,10111,11094,11097,12872,12879,57344,63743,65024,65039,65533,65533,127232,127242,127248,127277,127280,127337,127344,127373,127375,127376,127387,127404,917760,917999,983040,1048573,1048576,1114109],ft=12288,gt=65510,mt=[12288,12288,65281,65376,65504,65510],wt=8361,bt=65518,yt=[8361,8361,65377,65470,65474,65479,65482,65487,65490,65495,65498,65500,65512,65518],St=32,Et=10630,xt=[32,126,162,163,165,166,172,172,175,175,10214,10221,10629,10630],$t=4352,Mt=262141,V=[4352,4447,8986,8987,9001,9002,9193,9196,9200,9200,9203,9203,9725,9726,9748,9749,9776,9783,9800,9811,9855,9855,9866,9871,9875,9875,9889,9889,9898,9899,9917,9918,9924,9925,9934,9934,9940,9940,9962,9962,9970,9971,9973,9973,9978,9978,9981,9981,9989,9989,9994,9995,10024,10024,10060,10060,10062,10062,10067,10069,10071,10071,10133,10135,10160,10160,10175,10175,11035,11036,11088,11088,11093,11093,11904,11929,11931,12019,12032,12245,12272,12287,12289,12350,12353,12438,12441,12543,12549,12591,12593,12686,12688,12773,12783,12830,12832,12871,12880,42124,42128,42182,43360,43388,44032,55203,63744,64255,65040,65049,65072,65106,65108,65126,65128,65131,94176,94180,94192,94198,94208,101589,101631,101662,101760,101874,110576,110579,110581,110587,110589,110590,110592,110882,110898,110898,110928,110930,110933,110933,110948,110951,110960,111355,119552,119638,119648,119670,126980,126980,127183,127183,127374,127374,127377,127386,127488,127490,127504,127547,127552,127560,127568,127569,127584,127589,127744,127776,127789,127797,127799,127868,127870,127891,127904,127946,127951,127955,127968,127984,127988,127988,127992,128062,128064,128064,128066,128252,128255,128317,128331,128334,128336,128359,128378,128378,128405,128406,128420,128420,128507,128591,128640,128709,128716,128716,128720,128722,128725,128728,128732,128735,128747,128748,128756,128764,128992,129003,129008,129008,129292,129338,129340,129349,129351,129535,129648,129660,129664,129674,129678,129734,129736,129736,129741,129756,129759,129770,129775,129784,131072,196605,196608,262141],$=(t,s)=>{let e=0,n=Math.floor(t.length/2)-1;for(;e<=n;){const r=Math.floor((e+n)/2),c=r*2;if(s<t[c])n=r-1;else if(s>t[c+1])e=r+1;else return!0}return!1},D=19968,[Bt,kt]=vt(V);function vt(t){let s=t[0],e=t[1];for(let n=0;n<t.length;n+=2){const r=t[n],c=t[n+1];if(D>=r&&D<=c)return[r,c];c-r>e-s&&(s=r,e=c)}return[s,e]}const Tt=t=>t<161||t>1114109?!1:$(pt,t),Rt=t=>t<ft||t>gt?!1:$(mt,t),It=t=>t<wt||t>bt?!1:$(yt,t),Wt=t=>t<St||t>Et?!1:$(xt,t),_t=t=>t>=Bt&&t<=kt?!0:t<$t||t>Mt?!1:$(V,t);function Ct(t){return Tt(t)?"ambiguous":Rt(t)?"fullwidth":It(t)?"halfwidth":Wt(t)?"narrow":_t(t)?"wide":"neutral"}function At(t){if(!Number.isSafeInteger(t))throw new TypeError(`Expected a code point, got \`${typeof t}\`.`)}function Z(t){return At(t),Ct(t)}const H=String.raw,j=H`\p{Emoji}(?:\p{EMod}|[\u{E0020}-\u{E007E}]+\u{E007F}|\uFE0F?\u20E3?)`,Nt=()=>new RegExp(H`\p{RI}{2}|(?)${j}(?:\u200D${j})*`,"gu"),he=new Set(["\x1B",""]),de="\x07",pe="]8;;",fe=/[\u200B\uFEFF\u2060-\u2064]/g,U=/[\u001B\u009B](?:[[()#;?]{0,10}(?:\d{1,4}(?:;\d{0,4})*)?[0-9A-ORZcf-nqry=><]|\]8;;[^\u0007\u001B]{0,100}(?:\u0007|\u001B\\)|\][^\u0007\u001B]{0,1000}(?:\u0007|\u001B\\))/g,ge=/\u001B\[[\d;]*m[^\u001B]*(?:\u001B\[[\d;]*m|$)/g,me=/\u001B\]8;[^\u0007\u001B]*(?:\u0007|\u001B\\)[^\u001B]*\u001B\]8;;(?:\u0007|\u001B\\)/g,v=/[\u0000-\u0008\n-\u001F\u007F-\u009F]{1,1000}/y,q=Nt(),we=/[-_./\s]+/g,be=/(\u001B\[[0-9;]*[a-z])/i,ye=new RegExp("\\p{Script=Arabic}","u"),Se=new RegExp("\\p{Script=Bengali}","u"),Ee=new RegExp("\\p{Script=Cyrillic}","u"),xe=new RegExp("\\p{Script=Devanagari}","u"),$e=new RegExp("\\p{Script=Ethiopic}","u"),Me=new RegExp("\\p{Script=Greek}","u"),Be=new RegExp("\\p{Script=Greek}+|\\p{Script=Latin}+|[^\\p{Script=Greek}\\p{Script=Latin}]+","gu"),ke=new RegExp("\\p{Script=Gujarati}","u"),ve=new RegExp("\\p{Script=Gurmukhi}","u"),Te=new RegExp("\\p{Script=Hangul}","u"),Re=new RegExp("\\p{Script=Hebrew}","u"),Ie=new RegExp("\\p{Script=Hiragana}","u"),We=new RegExp("\\p{Script=Han}","u"),_e=new RegExp("\\p{Script=Kannada}","u"),Ce=new RegExp("\\p{Script=Katakana}","u"),Ae=new RegExp("\\p{Script=Khmer}","u"),Ne=new RegExp("\\p{Script=Lao}","u"),Fe=new RegExp("\\p{Script=Latin}","u"),De=new RegExp("\\p{Script=Malayalam}","u"),je=new RegExp("\\p{Script=Myanmar}","u"),Oe=new RegExp("\\p{Script=Oriya}","u"),Pe=new RegExp("\\p{Script=Sinhala}","u"),Ke=new RegExp("\\p{Script=Tamil}","u"),Le=new RegExp("\\p{Script=Telugu}","u"),Ye=new RegExp("\\p{Script=Thai}","u"),ze=new RegExp("\\p{Script=Tibetan}","u"),Ge=/[\u02BB\u02BC\u0027]/u,Ve=t=>t.replace(q,""),O=new Map,Ft=t=>[t.ambiguousIsNarrow?1:0,t.control,t.fullWidth,t.regular,t.wide].join("|"),Dt=t=>{const s=Ft(t.width);let e=O.get(s);return e||(e=new Map,O.set(s,e)),e},T=new RegExp(U.source,"y"),_=new RegExp(q.source,"uy"),R=/(?:[\u0020-\u007E\u00A0-\u00FF](?!\uFE0F)){1,1000}/y,J=t=>t>=32&&t<=126?"latin":t===8203||t===8204||t===8205||t===8288?"zero":t<=31||t>=127&&t<=159?"control":t>=160&&t<=255||t>=9472&&t<=9599?"latin":t>=4352&&t<=4607||t>=11904&&t<=40959||t>=44032&&t<=55215||t>=63744&&t<=64255||t>=65280&&t<=65519&&!(t>=65377&&t<=65439)||t>=12352&&t<=12543?"wide":t===8230?"latin":"other",jt=(t,s)=>{const e=Dt(s),n=Math.floor(t/65536),r=t%65536;let c=e.get(n);if(c||(c=new Map,e.set(n,c)),c.has(r))return c.get(r);let o;switch(J(t)){case"control":{o=s.width.control;break}case"latin":{o=s.width.regular;break}case"wide":{o=s.width.wide;break}case"zero":{o=0;break}default:switch(Z(t)){case"ambiguous":{o=s.width.ambiguousIsNarrow?s.width.regular:s.width.wide;break}case"fullwidth":{o=s.width.fullWidth;break}case"wide":{o=s.width.wide;break}default:o=s.width.regular}}return c.set(r,o),o},Ot=t=>t>=768&&t<=879||t>=6832&&t<=6911||t>=7616&&t<=7679||t>=8400&&t<=8447||t>=65056&&t<=65071||t>=917760&&t<=917999||t>=65024&&t<=65039||t>=3633&&t<=3642||t>=3655&&t<=3662||t>=3761&&t<=3769||t>=3771&&t<=3772||t>=3784&&t<=3789||t>=2304&&t<=2307||t>=2362&&t<=2383||t>=2385&&t<=2391||t>=2402&&t<=2403||t>=2433&&t<=2435||t>=2492&&t<=2500||t>=2509&&t<=2509||t>=2561&&t<=2563||t>=2620&&t<=2637||t>=1611&&t<=1631||t>=1648&&t<=1648||t>=1750&&t<=1773||t>=2276&&t<=2302||t>=1425&&t<=1469||t>=1471&&t<=1471||t>=1473&&t<=1474||t>=1476&&t<=1477||t>=1479&&t<=1479||t>=3893&&t<=3893||t>=3895&&t<=3895||t>=3897&&t<=3897||t>=3953&&t<=3966||t>=3968&&t<=3972||t>=3974&&t<=3975?!0:t>=768&&t<=777||t>=803&&t<=803,C=(t,s={})=>{if(!t||t.length===0)return{ellipsed:!1,index:0,truncated:!1,width:0};const e={truncation:{countAnsiEscapeCodes:s.countAnsiEscapeCodes??!1,ellipsis:s.ellipsis??"",ellipsisWidth:s.ellipsisWidth??(s.ellipsis?C(s.ellipsis,{...s,ellipsis:"",ellipsisWidth:0,limit:Number.POSITIVE_INFINITY}).width:0),limit:s.limit??Number.POSITIVE_INFINITY},width:{ambiguousIsNarrow:s.ambiguousIsNarrow??!1,ansi:s.ansiWidth??0,control:s.controlWidth??0,emoji:s.emojiWidth??2,fullWidth:s.fullWidth??2,halfWidth:s.halfWidth??1,regular:s.regularWidth??1,tab:s.tabWidth??8,wide:s.wideWidth??2}},n=Math.max(0,e.truncation.limit-e.truncation.ellipsisWidth),{length:r}=t,c=r>1e4;let o=0,i=0,a=r,l=!1;const p=t.includes("\x1B")||t.includes("");for(;o<r;){if(p&&(t[o]==="\x1B"||t[o]==="")){if(t.startsWith("\x1B]8;;",o)){const d="\x1B]8;;\x07",w=d.length,y=t.indexOf("\x07",o+5);if(y!==-1){const S=t.indexOf(d,y+1);if(S!==-1){const B=S+w,W=t.slice(y+1,S).replace(U,""),k=C(W,{ambiguousIsNarrow:e.width.ambiguousIsNarrow,ansiWidth:e.width.ansi,controlWidth:e.width.control,countAnsiEscapeCodes:!1,ellipsis:e.truncation.ellipsis,ellipsisWidth:e.truncation.ellipsisWidth,emojiWidth:e.width.emoji,fullWidth:e.width.fullWidth,halfWidth:e.width.halfWidth,limit:Math.max(0,n-i),regularWidth:e.width.regular,tabWidth:e.width.tab,wideWidth:e.width.wide}),E=k.width;if(k.truncated)l=!0,a=Math.min(a,o);else if(i+E>n&&(a=Math.min(a,o),l=!0,i+E>e.truncation.limit))break;if(i+=E,o=B,l&&i>=e.truncation.limit)break;continue}}}if(T.lastIndex=o,T.test(t)){const d=T.lastIndex-o,w=e.truncation.countAnsiEscapeCodes?d:e.width.ansi;if(i+w>n&&(a=Math.min(a,o),i+w>e.truncation.limit)){l=!0;break}i+=w,o=T.lastIndex;continue}}const u=t.codePointAt(o);if(u===8203||u===65279||u>=8288&&u<=8292){o+=1;continue}if(u===9){if(i+e.width.tab>n&&(a=Math.min(a,o),i+e.width.tab>e.truncation.limit)){l=!0;break}i+=e.width.tab,o+=1;continue}if(R.lastIndex=o,R.test(t)){const d=(R.lastIndex-o)*e.width.regular;if(i+d>n){const w=e.width.regular>0?Math.floor((n-i)/e.width.regular):0;if(a=Math.min(a,o+w),i+d>e.truncation.limit){l=!0;break}}i+=d,o=R.lastIndex;continue}if((u<=31||u>=127&&u<=159)&&(v.lastIndex=o,v.test(t))){const d=(v.lastIndex-o)*e.width.control;if(i+d>n){const w=e.width.control>0?Math.floor((n-i)/e.width.control):0;if(a=Math.min(a,o+w),i+d>e.truncation.limit){l=!0;break}}i+=d,o=v.lastIndex;continue}if(_.lastIndex=o,_.test(t)){if(i+e.width.emoji>n&&(a=Math.min(a,o),i+e.width.emoji>e.truncation.limit)){l=!0;break}i+=e.width.emoji,o=_.lastIndex;continue}const m=t.codePointAt(o)??0;if(Ot(m)){o+=m>65535?2:1;continue}let h;if(c)h=jt(m,e);else switch(J(m)){case"control":{h=e.width.control;break}case"latin":{h=e.width.regular;break}case"wide":{h=e.width.wide;break}case"zero":{h=0;break}default:switch(Z(m)){case"ambiguous":{h=e.width.ambiguousIsNarrow?e.width.regular:e.width.wide;break}case"fullwidth":{h=e.width.fullWidth;break}case"wide":{h=e.width.wide;break}default:h=e.width.regular}}if(i+h>n&&(a=Math.min(a,o),i+h>e.truncation.limit)){l=!0;break}i+=h,o+=m>65535?2:1}let g=i,b=!1;return l&&e.truncation.limit>=e.truncation.ellipsisWidth&&(g=e.truncation.limit,b=!0),{ellipsed:b,index:l?a:r,truncated:l,width:g}},Ze=(t,s={})=>C(t,{...s,ellipsis:"",ellipsisWidth:0,limit:Number.POSITIVE_INFINITY}).width,A=()=>f(lt(),".vis"),Pt=()=>f(A(),"cache"),He=()=>f(A(),"state"),Kt=t=>ct("sha256").update(t).digest("hex").slice(0,12),Ue=t=>f(A(),"workspaces",Kt(t)),Lt=".vis",N=t=>f(t,Lt),qe="node_modules/.cache/vis",Je=t=>f(N(t),"runs"),Xe=t=>f(N(t),"last-summary.json"),Qe=t=>f(N(t),"last-failures"),ts=t=>{const s=ut()==="win32";for(const e of[".task-runner",".task-runner-cache"]){const n=f(t,e);if(it(n))try{const r=s?F("cmd.exe",["/c","rmdir","/s","/q",n],{detached:!0,stdio:"ignore"}):F("rm",["-rf",n],{detached:!0,stdio:"ignore"});r.on("error",()=>{}),r.unref()}catch{}}},Yt="https://api.socket.dev/v0/purl?alerts=true",M=()=>f(Pt(),"socket-security"),zt=3600*1e3,X=.4,P=100,Gt=t=>typeof t=="object"&&t!==null&&"id"in t&&"type"in t&&"name"in t&&"version"in t&&"alerts"in t&&"score"in t&&t.type==="npm",Vt=()=>{dt(M())},Q=(t,s)=>`${encodeURIComponent(t)}@${encodeURIComponent(s)}`,Zt=(t,s)=>{const e=Q(t,s),n=f(M(),`${e}.json`);try{const r=ht(n);if(Date.now()-r.createdAt>r.ttlMs){z(n,{force:!0});return}return r.report}catch{return}},Ht=(t,s,e,n)=>{const r=Q(t,s),c={createdAt:Date.now(),report:e,ttlMs:n};at(f(M(),`${r}.json`),JSON.stringify(c),"utf8")},Ut=t=>{const s=[t.license,t.maintenance,t.quality,t.supplyChain,t.vulnerability];return Number((s.reduce((e,n)=>e+n,0)/s.length).toFixed(2))},qt=async(t,s={})=>{const{apiToken:e,cacheTtlMs:n=zt,timeoutMs:r=15e3}=s,c=new Map;if(t.length===0||!e)return c;const o=[];for(const l of t){const p=Zt(l.name,l.version);p?c.set(`${l.name}@${l.version}`,p):o.push(l)}if(o.length===0)return c;const i=`Basic ${Buffer.from(`${e}:`).toString("base64")}`;Vt();const a=[];for(let l=0;l<o.length;l+=P)a.push(o.slice(l,l+P));for(const l of a){const p=l.map(u=>({purl:`pkg:npm/${u.name}@${u.version}`})),g=new AbortController,b=setTimeout(()=>{g.abort()},r);try{const u=await fetch(Yt,{body:JSON.stringify({components:p}),headers:{Authorization:i,"Content-Type":"application/json","User-Agent":"@visulima/vis"},method:"POST",signal:g.signal});if(!u.ok)continue;const m=await u.text();Jt(m,l,c,n)}catch{}finally{clearTimeout(b)}}return c},Jt=(t,s,e,n)=>{const r=new Map;for(const o of s)r.set(`${o.name}@${o.version}`,o);const c=t.split(`}
|
|
2
2
|
`);for(const o of c){const i=o.trim();if(i)try{const a=JSON.parse(i.endsWith("}")?i:`${i}}`),p=`${a.namespace?`${a.namespace}/`:""}${a.name}`,g=`${p}@${a.version}`;if(!r.has(g))continue;const b=a.score.overall??Ut(a.score),u={alerts:a.alerts,author:a.author,id:a.id,license:a.license,name:a.name,score:{...a.score,overall:b},size:a.size,type:"npm",version:a.version};a.namespace&&(u.namespace=a.namespace),Gt(u)&&(e.set(g,u),Ht(p,a.version,u,n))}catch{}}},Xt=t=>t.namespace?`${t.namespace}/${t.name}`:t.name,es=t=>t>=.8?"excellent":t>=.6?"good":t>=.4?"fair":t>=.2?"poor":"critical",ss=t=>t>=.6?"green":t>=.4?"yellow":"red",ns=t=>{const s=Xt(t),e=`score: ${String(Math.round(t.score.overall*100))}%`,n=t.alerts.length,r=n>0?`${String(n)} alert${n===1?"":"s"}`:"no alerts";return`${s}@${t.version} (${e}, ${r})`},os=(t,s=X)=>{if(t.size===0)return"";let e=0,n=0,r=0,c=0,o=0,i=0;for(const l of t.values()){for(const p of l.alerts)switch(e++,p.severity){case"critical":{n++;break}case"high":{r++;break}case"medium":{c++;break}default:o++}l.score.overall<s&&i++}const a=[`Socket.dev: scanned ${String(t.size)} package${t.size===1?"":"s"}`];if(e>0){const l=[];n>0&&l.push(`${String(n)} critical`),r>0&&l.push(`${String(r)} high`),c>0&&l.push(`${String(c)} medium`),o>0&&l.push(`${String(o)} low`),a.push(` Alerts: ${String(e)} total (${l.join(", ")})`)}else a.push(" No security alerts found.");if(i>0){const l=Math.round(s*100);a.push(` ${String(i)} package${i===1?"":"s"} with low security score (<${String(l)}%)`)}return a.join(`
|
|
3
|
-
`)},Qt=()=>{const t=M();if(!G(t))return 0;const s=
|
|
4
|
-
`),as=(t,s={})=>{const e=ee(t,s.minimumScore);if(e)return{clearCache:Qt,displayName:"Socket.dev",fetchReports:n=>qt(n,e),getCacheStats:te,id:"socket"}},cs=t=>{if(t===void 0)return!1;const s=t.trim().toLowerCase();return s!==""&&s!=="0"&&s!=="false"&&s!=="no"},tt={iec:[{long:"Bytes",short:"B"},{long:"Kibibytes",short:"KiB"},{long:"Mebibytes",short:"MiB"},{long:"Gibibytes",short:"GiB"},{long:"Tebibytes",short:"TiB"},{long:"Pebibytes",short:"PiB"},{long:"Exbibytes",short:"EiB"},{long:"Zebibytes",short:"ZiB"},{long:"Yobibytes",short:"YiB"}],iec_octet:[{long:"Octets",short:"o"},{long:"Kibioctets",short:"Kio"},{long:"Mebioctets",short:"Mio"},{long:"Gibioctets",short:"Gio"},{long:"Tebioctets",short:"Tio"},{long:"Pebioctets",short:"Pio"},{long:"Exbioctets",short:"Eio"},{long:"Zebioctets",short:"Zio"},{long:"Yobioctets",short:"Yio"}],metric:[{long:"Bytes",short:"Bytes"},{long:"Kilobytes",short:"KB"},{long:"Megabytes",short:"MB"},{long:"Gigabytes",short:"GB"},{long:"Terabytes",short:"TB"},{long:"Petabytes",short:"PB"},{long:"Exabytes",short:"EB"},{long:"Zettabytes",short:"ZB"},{long:"Yottabytes",short:"YB"}],metric_octet:[{long:"Octets",short:"o"},{long:"Kilo-octets",short:"ko"},{long:"Mega-octets",short:"Mo"},{long:"Giga-octets",short:"Go"},{long:"Tera-octets",short:"To"},{long:"Peta-octets",short:"Po"},{long:"Exa-octets",short:"Eo"},{long:"Zetta-octets",short:"Zo"},{long:"Yotta-octets",short:"Yo"}]},se=[{long:"bits",short:"bit"},{long:"Kilobits",short:"kbit"},{long:"Megabits",short:"Mbit"},{long:"Gigabits",short:"Gbit"},{long:"Terabits",short:"Tbit"},{long:"Petabits",short:"Pbit"},{long:"Exabits",short:"Ebit"},{long:"Zettabits",short:"Zbit"},{long:"Yottabits",short:"Ybit"}],K=new Map,L=(t,s)=>{const e=`${t}\0${JSON.stringify(s)}`;let n=K.get(e);return n===void 0&&(n=new Intl.NumberFormat(t,s),K.set(e,n)),n},ne=t=>{switch(t){case 2:return 1024;case 10:return 1e3;default:throw new Error("Unsupported base.")}},oe=(t,s,e)=>({maximumFractionDigits:t,minimumFractionDigits:t,...s,...e}),ie=(t,s,e,n)=>{if(t===void 0)return-1;const r=s.findIndex(c=>c.short===t);return r===-1&&n?tt[e].findIndex(c=>c.short===t):r},ls=(t,s)=>{if(typeof t!="number"||!Number.isFinite(t))throw new TypeError("Bytesize is not a number.");const{base:e,bits:n,decimals:r,locale:c,long:o,signed:i,unit:a,units:l,...p}={base:2,bits:!1,decimals:0,locale:"en-US",long:!1,signed:!1,units:"metric",...s},g=ne(e),b=n?t*8:t,u=Math.abs(b),m=s?.space??!0?" ":"",h=n?se:tt[l],d=ie(a,h,l,n),w=r<0?void 0:r,y=i?{signDisplay:"exceptZero"}:{};if(b===0){const E=d===-1?0:Math.min(d,h.length-1),et=h[E][o?"long":"short"];return L(c,{...y,...p}).format(0)+m+et}const S=Math.max(0,Math.min(Math.floor(Math.log(u)/Math.log(g)),h.length-1)),B=d===-1?S:d,W=h[B][o?"long":"short"],k=b/g**B;return L(c,oe(w,y,p)).format(k)+m+W};export{
|
|
3
|
+
`)},Qt=()=>{const t=M();if(!G(t))return 0;const s=Y(t).filter(e=>e.endsWith(".json"));for(const e of s)z(f(t,e),{force:!0});return s.length},te=()=>{const t=M();if(!G(t))return{entries:0,newestEntry:void 0,oldestEntry:void 0,totalSizeBytes:0};const s=Y(t).filter(c=>c.endsWith(".json"));let e=0,n,r;for(const c of s){const o=rt(f(t,c));e+=o.size;const{mtimeMs:i}=o;(n===void 0||i<n)&&(n=i),(r===void 0||i>r)&&(r=i)}return{entries:s.length,newestEntry:r,oldestEntry:n,totalSizeBytes:e}},ee=(t,s)=>t?.enabled?{apiToken:t.apiToken??process.env.VIS_SOCKET_TOKEN,cacheTtlMs:t.cacheTtlMs,minimumScore:s??X,timeoutMs:t.timeoutMs}:void 0,is=(t,s,e,n)=>{if(!e)return;const r=Date.now(),c=i=>{if(i.expiresAt){const a=Date.parse(i.expiresAt);if(!Number.isNaN(a)&&a<r)return!1}return!(n&&i.policies&&!i.policies.includes(n))},o=`${t}@${s}`;if(e[o]&&c(e[o]))return e[o];if(e[t]&&c(e[t]))return e[t];for(const[i,a]of Object.entries(e))if(i.endsWith("*")&&t.startsWith(i.slice(0,-1))&&c(a))return a},rs=(t,s,e,n)=>[" // Add to security.acceptedRisks in vis.config.ts:",` ${`"${t}"`}: {`,` reason: "${n}",`,` acceptedAt: "${new Date().toISOString()}",`,` acceptedScore: ${String(e)},`,' policies: ["score"],'," },"].join(`
|
|
4
|
+
`),as=(t,s={})=>{const e=ee(t,s.minimumScore);if(e)return{clearCache:Qt,displayName:"Socket.dev",fetchReports:n=>qt(n,e),getCacheStats:te,id:"socket"}},cs=t=>{if(t===void 0)return!1;const s=t.trim().toLowerCase();return s!==""&&s!=="0"&&s!=="false"&&s!=="no"},tt={iec:[{long:"Bytes",short:"B"},{long:"Kibibytes",short:"KiB"},{long:"Mebibytes",short:"MiB"},{long:"Gibibytes",short:"GiB"},{long:"Tebibytes",short:"TiB"},{long:"Pebibytes",short:"PiB"},{long:"Exbibytes",short:"EiB"},{long:"Zebibytes",short:"ZiB"},{long:"Yobibytes",short:"YiB"}],iec_octet:[{long:"Octets",short:"o"},{long:"Kibioctets",short:"Kio"},{long:"Mebioctets",short:"Mio"},{long:"Gibioctets",short:"Gio"},{long:"Tebioctets",short:"Tio"},{long:"Pebioctets",short:"Pio"},{long:"Exbioctets",short:"Eio"},{long:"Zebioctets",short:"Zio"},{long:"Yobioctets",short:"Yio"}],metric:[{long:"Bytes",short:"Bytes"},{long:"Kilobytes",short:"KB"},{long:"Megabytes",short:"MB"},{long:"Gigabytes",short:"GB"},{long:"Terabytes",short:"TB"},{long:"Petabytes",short:"PB"},{long:"Exabytes",short:"EB"},{long:"Zettabytes",short:"ZB"},{long:"Yottabytes",short:"YB"}],metric_octet:[{long:"Octets",short:"o"},{long:"Kilo-octets",short:"ko"},{long:"Mega-octets",short:"Mo"},{long:"Giga-octets",short:"Go"},{long:"Tera-octets",short:"To"},{long:"Peta-octets",short:"Po"},{long:"Exa-octets",short:"Eo"},{long:"Zetta-octets",short:"Zo"},{long:"Yotta-octets",short:"Yo"}]},se=[{long:"bits",short:"bit"},{long:"Kilobits",short:"kbit"},{long:"Megabits",short:"Mbit"},{long:"Gigabits",short:"Gbit"},{long:"Terabits",short:"Tbit"},{long:"Petabits",short:"Pbit"},{long:"Exabits",short:"Ebit"},{long:"Zettabits",short:"Zbit"},{long:"Yottabits",short:"Ybit"}],K=new Map,L=(t,s)=>{const e=`${t}\0${JSON.stringify(s)}`;let n=K.get(e);return n===void 0&&(n=new Intl.NumberFormat(t,s),K.set(e,n)),n},ne=t=>{switch(t){case 2:return 1024;case 10:return 1e3;default:throw new Error("Unsupported base.")}},oe=(t,s,e)=>({maximumFractionDigits:t,minimumFractionDigits:t,...s,...e}),ie=(t,s,e,n)=>{if(t===void 0)return-1;const r=s.findIndex(c=>c.short===t);return r===-1&&n?tt[e].findIndex(c=>c.short===t):r},ls=(t,s)=>{if(typeof t!="number"||!Number.isFinite(t))throw new TypeError("Bytesize is not a number.");const{base:e,bits:n,decimals:r,locale:c,long:o,signed:i,unit:a,units:l,...p}={base:2,bits:!1,decimals:0,locale:"en-US",long:!1,signed:!1,units:"metric",...s},g=ne(e),b=n?t*8:t,u=Math.abs(b),m=s?.space??!0?" ":"",h=n?se:tt[l],d=ie(a,h,l,n),w=r<0?void 0:r,y=i?{signDisplay:"exceptZero"}:{};if(b===0){const E=d===-1?0:Math.min(d,h.length-1),et=h[E][o?"long":"short"];return L(c,{...y,...p}).format(0)+m+et}const S=Math.max(0,Math.min(Math.floor(Math.log(u)/Math.log(g)),h.length-1)),B=d===-1?S:d,W=h[B][o?"long":"short"],k=b/g**B;return L(c,oe(w,y,p)).format(k)+m+W};export{je as $,Pe as A,Ee as B,ve as C,X as D,Ne as E,Te as F,$e as G,xe as H,Ae as I,Ye as J,Be as K,we as L,ke as M,Oe as N,Me as O,_e as P,ts as Q,q as R,ge as S,be as T,Fe as U,ze as V,Ce as W,me as X,De as Y,Ge as Z,U as _,Qe as a,C as a0,Rt as a1,_t as a2,fe as a3,he as a4,pe as a5,de as a6,as as a7,os as a8,qe as a9,te as aa,Qt as ab,Xe as ac,A as b,N as c,Je as d,Xt as e,is as f,Pt as g,ns as h,es as i,rs as j,cs as k,He as l,Ut as m,qt as n,Ze as o,Ue as p,Ve as q,We as r,ss as s,Ie as t,Re as u,Ke as v,Se as w,ye as x,Le as y,ls as z};
|