@visulima/vis 4.1.19 → 4.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +33 -0
- package/LICENSE.md +804 -360
- package/dist/bin.js +1 -1
- package/dist/binx.js +1 -1
- package/dist/config/index.d.ts +21 -0
- package/dist/packem_chunks/CONFIG_FILES.js +3 -3
- package/dist/packem_chunks/bloom-status.js +1 -1
- package/dist/packem_chunks/bloom-sync.js +1 -1
- package/dist/packem_chunks/catalog.js +49 -51
- package/dist/packem_chunks/cli-exec.js +1 -1
- package/dist/packem_chunks/cli-main.js +138 -138
- package/dist/packem_chunks/dispatch.js +1 -1
- package/dist/packem_chunks/fix.js +8 -8
- package/dist/packem_chunks/handler.js +1 -1
- package/dist/packem_chunks/handler10.js +3 -3
- package/dist/packem_chunks/handler11.js +1 -1
- package/dist/packem_chunks/handler12.js +2 -2
- 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 +1 -1
- 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 +2 -2
- package/dist/packem_chunks/handler30.js +1 -1
- package/dist/packem_chunks/handler5.js +1 -1
- package/dist/packem_chunks/handler51.js +1 -1
- package/dist/packem_chunks/handler52.js +3 -3
- package/dist/packem_chunks/handler53.js +1 -1
- package/dist/packem_chunks/handler54.js +2 -2
- package/dist/packem_chunks/handler55.js +1 -1
- package/dist/packem_chunks/handler58.js +2 -2
- package/dist/packem_chunks/handler59.js +1 -1
- package/dist/packem_chunks/handler6.js +1 -1
- package/dist/packem_chunks/handler60.js +8 -8
- package/dist/packem_chunks/handler61.js +1 -1
- package/dist/packem_chunks/handler62.js +16 -16
- package/dist/packem_chunks/handler63.js +2 -2
- package/dist/packem_chunks/handler64.js +1 -1
- package/dist/packem_chunks/handler65.js +3 -3
- package/dist/packem_chunks/handler66.js +2 -2
- package/dist/packem_chunks/handler67.js +3 -3
- package/dist/packem_chunks/handler68.js +2 -2
- package/dist/packem_chunks/handler69.js +3 -3
- package/dist/packem_chunks/handler7.js +1 -1
- package/dist/packem_chunks/handler70.js +3 -3
- package/dist/packem_chunks/handler71.js +2 -2
- package/dist/packem_chunks/handler72.js +2 -2
- package/dist/packem_chunks/handler73.js +2 -2
- package/dist/packem_chunks/handler74.js +1 -1
- package/dist/packem_chunks/handler75.js +18 -18
- package/dist/packem_chunks/handler76.js +3 -3
- package/dist/packem_chunks/handler77.js +2 -2
- package/dist/packem_chunks/handler78.js +64 -64
- 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 -7
- package/dist/packem_chunks/index5.js +2 -2
- package/dist/packem_chunks/index6.js +7 -8
- package/dist/packem_chunks/keys-refresh.js +1 -1
- package/dist/packem_chunks/lean.js +1 -1
- package/dist/packem_chunks/list.js +2 -2
- package/dist/packem_chunks/loader.js +1 -1
- package/dist/packem_chunks/prune.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 +2 -2
- package/dist/packem_chunks/ts-loader.js +5 -5
- package/dist/packem_chunks/verify-lockfile.js +2 -2
- package/dist/packem_shared/{Table-DyORjLji-CC9cYgCG.js → Table-BB8xHTU5-BLPS917D.js} +8 -8
- package/dist/packem_shared/{advisories-0ScpWAHV.js → advisories-BSpzRIXP.js} +1 -1
- package/dist/packem_shared/affected-selection-M7riOi5-.js +1 -0
- package/dist/packem_shared/{affected-shas-Dd0P7fGD.js → affected-shas-CAwpSPmP.js} +1 -1
- package/dist/packem_shared/{ai-fix-CyUx_ZAB.js → ai-fix-BTm1Z5og.js} +1 -1
- package/dist/packem_shared/{augment-COAiXSIx.js → augment-CBv1hwMR.js} +1 -1
- package/dist/packem_shared/{bin-x7RPlduv.js → bin-Cbs_ix6l.js} +1 -1
- package/dist/packem_shared/build-scripts-BIgkWVgY.js +1 -0
- package/dist/packem_shared/{command-runtime-CiLVo4ED.js → command-runtime-BD-4UmPB.js} +1 -1
- package/dist/packem_shared/{cyclonedx-CX2fFvDi.js → cyclonedx-CT1rtKxV.js} +3 -3
- package/dist/packem_shared/dependency-scan-W9b2X0a1.js +1 -0
- package/dist/packem_shared/{docker-Dy-X_BuM.js → docker-1jgKW5Wd.js} +3 -3
- package/dist/packem_shared/failure-log-B91LvYWw.js +2 -0
- package/dist/packem_shared/formatBytes-BHAzNIrn-CLYsxlUj.js +4 -0
- package/dist/packem_shared/glob-Cyk1H9ZL-Dxlf9Swz.js +1 -0
- package/dist/packem_shared/{index-DHD8wb6Z.js → index-CVBR-Kit.js} +5 -5
- package/dist/packem_shared/{index-Chv2RJRN.js → index-Cq-J2MdB.js} +1 -1
- package/dist/packem_shared/index-onibYJkv.js +1 -0
- package/dist/packem_shared/{isAccessibleSync-DYKTrrvc-CSnBISfV.js → isAccessibleSync-DYKTrrvc-K2xhg6sV.js} +1 -1
- package/dist/packem_shared/lifecycle-DDJzp-4H.js +2 -0
- package/dist/packem_shared/lockfile-Bi1mw9jJ.js +1 -0
- package/dist/packem_shared/manifests-D671Sb1T.js +1 -0
- package/dist/packem_shared/{min-release-age-ChzTC7_I.js → min-release-age-Da4V046o.js} +7 -7
- package/dist/packem_shared/missing-package-json-CMoHdvmj.js +1 -0
- package/dist/packem_shared/{native-config-sync-BSzU4qUO.js → native-config-sync-CEB0rWlk.js} +2 -2
- package/dist/packem_shared/{osv-bloom-JYIWcH3F.js → osv-bloom-BRacgzs7.js} +1 -1
- package/dist/packem_shared/{package-version-ZC59HAtH.js → package-version-C5EPMgRw.js} +2 -2
- package/dist/packem_shared/packument-DuEV-qSE.js +1 -0
- package/dist/packem_shared/path-CxEa27Rz-pjheKk6v.js +1 -0
- package/dist/packem_shared/pm-runner-9L6ocnu2.js +1 -0
- package/dist/packem_shared/{project-name-filter-BmszI2_J.js → project-name-filter-zrdrEQbu.js} +1 -1
- package/dist/packem_shared/{provenance-w-NIPtim.js → provenance-CFPT_FQA.js} +1 -1
- package/dist/packem_shared/readJsonSync-CbryXYxN-BxKjDZnF.js +1 -0
- package/dist/packem_shared/registry-keys-C3EsP_s4.js +1 -0
- package/dist/packem_shared/{resolve-explicit-CsTmALmE.js → resolve-explicit-opfIkxoY.js} +1 -1
- package/dist/packem_shared/resolve-runtime-lJ5L9gU4.js +1 -0
- package/dist/packem_shared/run-file-DZff6GqY.js +1 -0
- package/dist/packem_shared/runtime-check-DAbveBr_.js +1 -0
- package/dist/packem_shared/s1ngularity-DTvrfWIM.js +1 -0
- package/dist/packem_shared/{scan-progress-DRIGQRMr.js → scan-progress-BGB9hIrD.js} +2 -2
- package/dist/packem_shared/{selectors-B7lSFz7l.js → selectors-CjIZ3gy2.js} +1 -1
- package/dist/packem_shared/{signatures-ijwqxAtF.js → signatures-DpqZVmmU.js} +1 -1
- package/dist/packem_shared/spinner-BVCEMm3G.js +1 -0
- package/dist/packem_shared/{tabs-UDYQ3tqt.js → tabs-Dz6xVpfX.js} +1 -1
- package/dist/packem_shared/{target-merge-B4No-LHM.js → target-merge-hsawesT4.js} +1 -1
- package/dist/packem_shared/target-options-Bxb0Y5qa.js +1 -0
- package/dist/packem_shared/toolchain-887JoquG.js +5 -0
- package/dist/packem_shared/typosquats-Xv6dN4sr.js +1 -0
- package/dist/packem_shared/verify-BLoaI7En.js +1 -0
- package/dist/packem_shared/{vis-update-app-DNeU8RBQ.js → vis-update-app-D9KWJ9Ir.js} +1 -1
- package/dist/packem_shared/{vis-user-error-DFPJeiL5.js → vis-user-error-Bdg9NRuJ.js} +7 -7
- package/dist/packem_shared/watch-BTZw2Y8Q.js +1 -0
- package/dist/packem_shared/watch-loop-Cjh2wlUl.js +11 -0
- package/dist/packem_shared/{writeFileSync-DJoHk3Ks-CgQ-VNNT.js → writeFileSync-DJoHk3Ks-O9zOKqeM.js} +1 -1
- package/dist/runtime/preload.js +1 -1
- package/index.js +52 -52
- package/package.json +12 -12
- package/schemas/vis-config.schema.json +14 -0
- package/dist/packem_shared/affected-selection-BXrRytsU.js +0 -1
- package/dist/packem_shared/build-scripts-pdVmqXRm.js +0 -1
- package/dist/packem_shared/dependency-scan-DBH2Qo4I.js +0 -1
- package/dist/packem_shared/failure-log-DE_MJCzB.js +0 -2
- package/dist/packem_shared/formatBytes-BHAzNIrn-Bkk_uRS-.js +0 -4
- package/dist/packem_shared/glob-Cyk1H9ZL-ox19CSsT.js +0 -1
- package/dist/packem_shared/index-CIIKPX4H.js +0 -1
- package/dist/packem_shared/lifecycle-DW8KRF5d.js +0 -2
- package/dist/packem_shared/lockfile-DVFySxTS.js +0 -1
- package/dist/packem_shared/manifests-BNSmpPF_.js +0 -1
- package/dist/packem_shared/missing-package-json-C0keIt78.js +0 -1
- package/dist/packem_shared/packument-CHdDsn0O.js +0 -1
- package/dist/packem_shared/pm-runner-d93_73O6.js +0 -1
- package/dist/packem_shared/readJsonSync-CbryXYxN-B2aSeDpC.js +0 -1
- package/dist/packem_shared/registry-keys-_IKDLSbu.js +0 -1
- package/dist/packem_shared/resolve-runtime-C7NBCA1C.js +0 -1
- package/dist/packem_shared/run-file-jMngGQhs.js +0 -1
- package/dist/packem_shared/runtime-check-BklgEMkC.js +0 -1
- package/dist/packem_shared/s1ngularity-BRk_GMUj.js +0 -1
- package/dist/packem_shared/spinner-BM_0Bj6x.js +0 -1
- package/dist/packem_shared/target-options-d_rIrLyq.js +0 -1
- package/dist/packem_shared/toolchain-DY11tPCw.js +0 -5
- package/dist/packem_shared/typosquats-CSkIFgF5.js +0 -1
- package/dist/packem_shared/verify-D8wYvB85.js +0 -1
- package/dist/packem_shared/watch-Dswvj6Zp.js +0 -1
- package/dist/packem_shared/watch-loop-COWvvSbR.js +0 -11
package/index.js
CHANGED
|
@@ -81,8 +81,8 @@ function requireNative() {
|
|
|
81
81
|
try {
|
|
82
82
|
const binding = require('@visulima/vis-binding-android-arm64')
|
|
83
83
|
const bindingPackageVersion = require('@visulima/vis-binding-android-arm64/package.json').version
|
|
84
|
-
if (bindingPackageVersion !== '4.1.
|
|
85
|
-
throw new Error(`Native binding package version mismatch, expected 4.
|
|
84
|
+
if (bindingPackageVersion !== '4.1.19' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
85
|
+
throw new Error(`Native binding package version mismatch, expected 4.2.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
86
86
|
}
|
|
87
87
|
return binding
|
|
88
88
|
} catch (e) {
|
|
@@ -97,8 +97,8 @@ function requireNative() {
|
|
|
97
97
|
try {
|
|
98
98
|
const binding = require('@visulima/vis-binding-android-arm-eabi')
|
|
99
99
|
const bindingPackageVersion = require('@visulima/vis-binding-android-arm-eabi/package.json').version
|
|
100
|
-
if (bindingPackageVersion !== '4.1.
|
|
101
|
-
throw new Error(`Native binding package version mismatch, expected 4.
|
|
100
|
+
if (bindingPackageVersion !== '4.1.19' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
101
|
+
throw new Error(`Native binding package version mismatch, expected 4.2.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
102
102
|
}
|
|
103
103
|
return binding
|
|
104
104
|
} catch (e) {
|
|
@@ -118,8 +118,8 @@ function requireNative() {
|
|
|
118
118
|
try {
|
|
119
119
|
const binding = require('@visulima/vis-binding-win32-x64-gnu')
|
|
120
120
|
const bindingPackageVersion = require('@visulima/vis-binding-win32-x64-gnu/package.json').version
|
|
121
|
-
if (bindingPackageVersion !== '4.1.
|
|
122
|
-
throw new Error(`Native binding package version mismatch, expected 4.
|
|
121
|
+
if (bindingPackageVersion !== '4.1.19' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
122
|
+
throw new Error(`Native binding package version mismatch, expected 4.2.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
123
123
|
}
|
|
124
124
|
return binding
|
|
125
125
|
} catch (e) {
|
|
@@ -134,8 +134,8 @@ function requireNative() {
|
|
|
134
134
|
try {
|
|
135
135
|
const binding = require('@visulima/vis-binding-win32-x64-msvc')
|
|
136
136
|
const bindingPackageVersion = require('@visulima/vis-binding-win32-x64-msvc/package.json').version
|
|
137
|
-
if (bindingPackageVersion !== '4.1.
|
|
138
|
-
throw new Error(`Native binding package version mismatch, expected 4.
|
|
137
|
+
if (bindingPackageVersion !== '4.1.19' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
138
|
+
throw new Error(`Native binding package version mismatch, expected 4.2.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
139
139
|
}
|
|
140
140
|
return binding
|
|
141
141
|
} catch (e) {
|
|
@@ -151,8 +151,8 @@ function requireNative() {
|
|
|
151
151
|
try {
|
|
152
152
|
const binding = require('@visulima/vis-binding-win32-ia32-msvc')
|
|
153
153
|
const bindingPackageVersion = require('@visulima/vis-binding-win32-ia32-msvc/package.json').version
|
|
154
|
-
if (bindingPackageVersion !== '4.1.
|
|
155
|
-
throw new Error(`Native binding package version mismatch, expected 4.
|
|
154
|
+
if (bindingPackageVersion !== '4.1.19' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
155
|
+
throw new Error(`Native binding package version mismatch, expected 4.2.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
156
156
|
}
|
|
157
157
|
return binding
|
|
158
158
|
} catch (e) {
|
|
@@ -167,8 +167,8 @@ function requireNative() {
|
|
|
167
167
|
try {
|
|
168
168
|
const binding = require('@visulima/vis-binding-win32-arm64-msvc')
|
|
169
169
|
const bindingPackageVersion = require('@visulima/vis-binding-win32-arm64-msvc/package.json').version
|
|
170
|
-
if (bindingPackageVersion !== '4.1.
|
|
171
|
-
throw new Error(`Native binding package version mismatch, expected 4.
|
|
170
|
+
if (bindingPackageVersion !== '4.1.19' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
171
|
+
throw new Error(`Native binding package version mismatch, expected 4.2.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
172
172
|
}
|
|
173
173
|
return binding
|
|
174
174
|
} catch (e) {
|
|
@@ -186,8 +186,8 @@ function requireNative() {
|
|
|
186
186
|
try {
|
|
187
187
|
const binding = require('@visulima/vis-binding-darwin-universal')
|
|
188
188
|
const bindingPackageVersion = require('@visulima/vis-binding-darwin-universal/package.json').version
|
|
189
|
-
if (bindingPackageVersion !== '4.1.
|
|
190
|
-
throw new Error(`Native binding package version mismatch, expected 4.
|
|
189
|
+
if (bindingPackageVersion !== '4.1.19' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
190
|
+
throw new Error(`Native binding package version mismatch, expected 4.2.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
191
191
|
}
|
|
192
192
|
return binding
|
|
193
193
|
} catch (e) {
|
|
@@ -202,8 +202,8 @@ function requireNative() {
|
|
|
202
202
|
try {
|
|
203
203
|
const binding = require('@visulima/vis-binding-darwin-x64')
|
|
204
204
|
const bindingPackageVersion = require('@visulima/vis-binding-darwin-x64/package.json').version
|
|
205
|
-
if (bindingPackageVersion !== '4.1.
|
|
206
|
-
throw new Error(`Native binding package version mismatch, expected 4.
|
|
205
|
+
if (bindingPackageVersion !== '4.1.19' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
206
|
+
throw new Error(`Native binding package version mismatch, expected 4.2.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
207
207
|
}
|
|
208
208
|
return binding
|
|
209
209
|
} catch (e) {
|
|
@@ -218,8 +218,8 @@ function requireNative() {
|
|
|
218
218
|
try {
|
|
219
219
|
const binding = require('@visulima/vis-binding-darwin-arm64')
|
|
220
220
|
const bindingPackageVersion = require('@visulima/vis-binding-darwin-arm64/package.json').version
|
|
221
|
-
if (bindingPackageVersion !== '4.1.
|
|
222
|
-
throw new Error(`Native binding package version mismatch, expected 4.
|
|
221
|
+
if (bindingPackageVersion !== '4.1.19' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
222
|
+
throw new Error(`Native binding package version mismatch, expected 4.2.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
223
223
|
}
|
|
224
224
|
return binding
|
|
225
225
|
} catch (e) {
|
|
@@ -238,8 +238,8 @@ function requireNative() {
|
|
|
238
238
|
try {
|
|
239
239
|
const binding = require('@visulima/vis-binding-freebsd-x64')
|
|
240
240
|
const bindingPackageVersion = require('@visulima/vis-binding-freebsd-x64/package.json').version
|
|
241
|
-
if (bindingPackageVersion !== '4.1.
|
|
242
|
-
throw new Error(`Native binding package version mismatch, expected 4.
|
|
241
|
+
if (bindingPackageVersion !== '4.1.19' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
242
|
+
throw new Error(`Native binding package version mismatch, expected 4.2.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
243
243
|
}
|
|
244
244
|
return binding
|
|
245
245
|
} catch (e) {
|
|
@@ -254,8 +254,8 @@ function requireNative() {
|
|
|
254
254
|
try {
|
|
255
255
|
const binding = require('@visulima/vis-binding-freebsd-arm64')
|
|
256
256
|
const bindingPackageVersion = require('@visulima/vis-binding-freebsd-arm64/package.json').version
|
|
257
|
-
if (bindingPackageVersion !== '4.1.
|
|
258
|
-
throw new Error(`Native binding package version mismatch, expected 4.
|
|
257
|
+
if (bindingPackageVersion !== '4.1.19' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
258
|
+
throw new Error(`Native binding package version mismatch, expected 4.2.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
259
259
|
}
|
|
260
260
|
return binding
|
|
261
261
|
} catch (e) {
|
|
@@ -275,8 +275,8 @@ function requireNative() {
|
|
|
275
275
|
try {
|
|
276
276
|
const binding = require('@visulima/vis-binding-linux-x64-musl')
|
|
277
277
|
const bindingPackageVersion = require('@visulima/vis-binding-linux-x64-musl/package.json').version
|
|
278
|
-
if (bindingPackageVersion !== '4.1.
|
|
279
|
-
throw new Error(`Native binding package version mismatch, expected 4.
|
|
278
|
+
if (bindingPackageVersion !== '4.1.19' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
279
|
+
throw new Error(`Native binding package version mismatch, expected 4.2.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
280
280
|
}
|
|
281
281
|
return binding
|
|
282
282
|
} catch (e) {
|
|
@@ -291,8 +291,8 @@ function requireNative() {
|
|
|
291
291
|
try {
|
|
292
292
|
const binding = require('@visulima/vis-binding-linux-x64-gnu')
|
|
293
293
|
const bindingPackageVersion = require('@visulima/vis-binding-linux-x64-gnu/package.json').version
|
|
294
|
-
if (bindingPackageVersion !== '4.1.
|
|
295
|
-
throw new Error(`Native binding package version mismatch, expected 4.
|
|
294
|
+
if (bindingPackageVersion !== '4.1.19' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
295
|
+
throw new Error(`Native binding package version mismatch, expected 4.2.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
296
296
|
}
|
|
297
297
|
return binding
|
|
298
298
|
} catch (e) {
|
|
@@ -309,8 +309,8 @@ function requireNative() {
|
|
|
309
309
|
try {
|
|
310
310
|
const binding = require('@visulima/vis-binding-linux-arm64-musl')
|
|
311
311
|
const bindingPackageVersion = require('@visulima/vis-binding-linux-arm64-musl/package.json').version
|
|
312
|
-
if (bindingPackageVersion !== '4.1.
|
|
313
|
-
throw new Error(`Native binding package version mismatch, expected 4.
|
|
312
|
+
if (bindingPackageVersion !== '4.1.19' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
313
|
+
throw new Error(`Native binding package version mismatch, expected 4.2.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
314
314
|
}
|
|
315
315
|
return binding
|
|
316
316
|
} catch (e) {
|
|
@@ -325,8 +325,8 @@ function requireNative() {
|
|
|
325
325
|
try {
|
|
326
326
|
const binding = require('@visulima/vis-binding-linux-arm64-gnu')
|
|
327
327
|
const bindingPackageVersion = require('@visulima/vis-binding-linux-arm64-gnu/package.json').version
|
|
328
|
-
if (bindingPackageVersion !== '4.1.
|
|
329
|
-
throw new Error(`Native binding package version mismatch, expected 4.
|
|
328
|
+
if (bindingPackageVersion !== '4.1.19' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
329
|
+
throw new Error(`Native binding package version mismatch, expected 4.2.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
330
330
|
}
|
|
331
331
|
return binding
|
|
332
332
|
} catch (e) {
|
|
@@ -343,8 +343,8 @@ function requireNative() {
|
|
|
343
343
|
try {
|
|
344
344
|
const binding = require('@visulima/vis-binding-linux-arm-musleabihf')
|
|
345
345
|
const bindingPackageVersion = require('@visulima/vis-binding-linux-arm-musleabihf/package.json').version
|
|
346
|
-
if (bindingPackageVersion !== '4.1.
|
|
347
|
-
throw new Error(`Native binding package version mismatch, expected 4.
|
|
346
|
+
if (bindingPackageVersion !== '4.1.19' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
347
|
+
throw new Error(`Native binding package version mismatch, expected 4.2.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
348
348
|
}
|
|
349
349
|
return binding
|
|
350
350
|
} catch (e) {
|
|
@@ -359,8 +359,8 @@ function requireNative() {
|
|
|
359
359
|
try {
|
|
360
360
|
const binding = require('@visulima/vis-binding-linux-arm-gnueabihf')
|
|
361
361
|
const bindingPackageVersion = require('@visulima/vis-binding-linux-arm-gnueabihf/package.json').version
|
|
362
|
-
if (bindingPackageVersion !== '4.1.
|
|
363
|
-
throw new Error(`Native binding package version mismatch, expected 4.
|
|
362
|
+
if (bindingPackageVersion !== '4.1.19' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
363
|
+
throw new Error(`Native binding package version mismatch, expected 4.2.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
364
364
|
}
|
|
365
365
|
return binding
|
|
366
366
|
} catch (e) {
|
|
@@ -377,8 +377,8 @@ function requireNative() {
|
|
|
377
377
|
try {
|
|
378
378
|
const binding = require('@visulima/vis-binding-linux-loong64-musl')
|
|
379
379
|
const bindingPackageVersion = require('@visulima/vis-binding-linux-loong64-musl/package.json').version
|
|
380
|
-
if (bindingPackageVersion !== '4.1.
|
|
381
|
-
throw new Error(`Native binding package version mismatch, expected 4.
|
|
380
|
+
if (bindingPackageVersion !== '4.1.19' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
381
|
+
throw new Error(`Native binding package version mismatch, expected 4.2.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
382
382
|
}
|
|
383
383
|
return binding
|
|
384
384
|
} catch (e) {
|
|
@@ -393,8 +393,8 @@ function requireNative() {
|
|
|
393
393
|
try {
|
|
394
394
|
const binding = require('@visulima/vis-binding-linux-loong64-gnu')
|
|
395
395
|
const bindingPackageVersion = require('@visulima/vis-binding-linux-loong64-gnu/package.json').version
|
|
396
|
-
if (bindingPackageVersion !== '4.1.
|
|
397
|
-
throw new Error(`Native binding package version mismatch, expected 4.
|
|
396
|
+
if (bindingPackageVersion !== '4.1.19' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
397
|
+
throw new Error(`Native binding package version mismatch, expected 4.2.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
398
398
|
}
|
|
399
399
|
return binding
|
|
400
400
|
} catch (e) {
|
|
@@ -411,8 +411,8 @@ function requireNative() {
|
|
|
411
411
|
try {
|
|
412
412
|
const binding = require('@visulima/vis-binding-linux-riscv64-musl')
|
|
413
413
|
const bindingPackageVersion = require('@visulima/vis-binding-linux-riscv64-musl/package.json').version
|
|
414
|
-
if (bindingPackageVersion !== '4.1.
|
|
415
|
-
throw new Error(`Native binding package version mismatch, expected 4.
|
|
414
|
+
if (bindingPackageVersion !== '4.1.19' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
415
|
+
throw new Error(`Native binding package version mismatch, expected 4.2.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
416
416
|
}
|
|
417
417
|
return binding
|
|
418
418
|
} catch (e) {
|
|
@@ -427,8 +427,8 @@ function requireNative() {
|
|
|
427
427
|
try {
|
|
428
428
|
const binding = require('@visulima/vis-binding-linux-riscv64-gnu')
|
|
429
429
|
const bindingPackageVersion = require('@visulima/vis-binding-linux-riscv64-gnu/package.json').version
|
|
430
|
-
if (bindingPackageVersion !== '4.1.
|
|
431
|
-
throw new Error(`Native binding package version mismatch, expected 4.
|
|
430
|
+
if (bindingPackageVersion !== '4.1.19' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
431
|
+
throw new Error(`Native binding package version mismatch, expected 4.2.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
432
432
|
}
|
|
433
433
|
return binding
|
|
434
434
|
} catch (e) {
|
|
@@ -444,8 +444,8 @@ function requireNative() {
|
|
|
444
444
|
try {
|
|
445
445
|
const binding = require('@visulima/vis-binding-linux-ppc64-gnu')
|
|
446
446
|
const bindingPackageVersion = require('@visulima/vis-binding-linux-ppc64-gnu/package.json').version
|
|
447
|
-
if (bindingPackageVersion !== '4.1.
|
|
448
|
-
throw new Error(`Native binding package version mismatch, expected 4.
|
|
447
|
+
if (bindingPackageVersion !== '4.1.19' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
448
|
+
throw new Error(`Native binding package version mismatch, expected 4.2.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
449
449
|
}
|
|
450
450
|
return binding
|
|
451
451
|
} catch (e) {
|
|
@@ -460,8 +460,8 @@ function requireNative() {
|
|
|
460
460
|
try {
|
|
461
461
|
const binding = require('@visulima/vis-binding-linux-s390x-gnu')
|
|
462
462
|
const bindingPackageVersion = require('@visulima/vis-binding-linux-s390x-gnu/package.json').version
|
|
463
|
-
if (bindingPackageVersion !== '4.1.
|
|
464
|
-
throw new Error(`Native binding package version mismatch, expected 4.
|
|
463
|
+
if (bindingPackageVersion !== '4.1.19' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
464
|
+
throw new Error(`Native binding package version mismatch, expected 4.2.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
465
465
|
}
|
|
466
466
|
return binding
|
|
467
467
|
} catch (e) {
|
|
@@ -480,8 +480,8 @@ function requireNative() {
|
|
|
480
480
|
try {
|
|
481
481
|
const binding = require('@visulima/vis-binding-openharmony-arm64')
|
|
482
482
|
const bindingPackageVersion = require('@visulima/vis-binding-openharmony-arm64/package.json').version
|
|
483
|
-
if (bindingPackageVersion !== '4.1.
|
|
484
|
-
throw new Error(`Native binding package version mismatch, expected 4.
|
|
483
|
+
if (bindingPackageVersion !== '4.1.19' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
484
|
+
throw new Error(`Native binding package version mismatch, expected 4.2.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
485
485
|
}
|
|
486
486
|
return binding
|
|
487
487
|
} catch (e) {
|
|
@@ -496,8 +496,8 @@ function requireNative() {
|
|
|
496
496
|
try {
|
|
497
497
|
const binding = require('@visulima/vis-binding-openharmony-x64')
|
|
498
498
|
const bindingPackageVersion = require('@visulima/vis-binding-openharmony-x64/package.json').version
|
|
499
|
-
if (bindingPackageVersion !== '4.1.
|
|
500
|
-
throw new Error(`Native binding package version mismatch, expected 4.
|
|
499
|
+
if (bindingPackageVersion !== '4.1.19' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
500
|
+
throw new Error(`Native binding package version mismatch, expected 4.2.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
501
501
|
}
|
|
502
502
|
return binding
|
|
503
503
|
} catch (e) {
|
|
@@ -512,8 +512,8 @@ function requireNative() {
|
|
|
512
512
|
try {
|
|
513
513
|
const binding = require('@visulima/vis-binding-openharmony-arm')
|
|
514
514
|
const bindingPackageVersion = require('@visulima/vis-binding-openharmony-arm/package.json').version
|
|
515
|
-
if (bindingPackageVersion !== '4.1.
|
|
516
|
-
throw new Error(`Native binding package version mismatch, expected 4.
|
|
515
|
+
if (bindingPackageVersion !== '4.1.19' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
516
|
+
throw new Error(`Native binding package version mismatch, expected 4.2.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
517
517
|
}
|
|
518
518
|
return binding
|
|
519
519
|
} catch (e) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@visulima/vis",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.2.0",
|
|
4
4
|
"description": "A monorepo dev toolkit — task runner, remote caching, security scanning, git hooks, and AI agent integrations — powered by @visulima/task-runner",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"build",
|
|
@@ -119,9 +119,9 @@
|
|
|
119
119
|
"@visulima/secret-scanner": "2.0.1",
|
|
120
120
|
"@visulima/source-map": "3.0.1",
|
|
121
121
|
"@visulima/tabular": "4.1.0",
|
|
122
|
-
"@visulima/task-runner": "1.0
|
|
123
|
-
"@visulima/tui": "4.0.
|
|
124
|
-
"@visulima/tui-kit": "1.0.
|
|
122
|
+
"@visulima/task-runner": "1.1.0",
|
|
123
|
+
"@visulima/tui": "4.0.29",
|
|
124
|
+
"@visulima/tui-kit": "1.0.32",
|
|
125
125
|
"module-replacements": "^3.1.0",
|
|
126
126
|
"module-replacements-codemods": "^2.0.2",
|
|
127
127
|
"react": "19.2.8",
|
|
@@ -148,14 +148,14 @@
|
|
|
148
148
|
}
|
|
149
149
|
},
|
|
150
150
|
"optionalDependencies": {
|
|
151
|
-
"@visulima/vis-binding-
|
|
152
|
-
"@visulima/vis-binding-darwin-x64": "4.
|
|
153
|
-
"@visulima/vis-binding-linux-
|
|
154
|
-
"@visulima/vis-binding-linux-arm64-musl": "4.
|
|
155
|
-
"@visulima/vis-binding-
|
|
156
|
-
"@visulima/vis-binding-linux-x64-musl": "4.
|
|
157
|
-
"@visulima/vis-binding-win32-arm64-msvc": "4.
|
|
158
|
-
"@visulima/vis-binding-win32-x64-msvc": "4.
|
|
151
|
+
"@visulima/vis-binding-darwin-arm64": "4.2.0",
|
|
152
|
+
"@visulima/vis-binding-darwin-x64": "4.2.0",
|
|
153
|
+
"@visulima/vis-binding-linux-arm64-gnu": "4.2.0",
|
|
154
|
+
"@visulima/vis-binding-linux-arm64-musl": "4.2.0",
|
|
155
|
+
"@visulima/vis-binding-linux-x64-gnu": "4.2.0",
|
|
156
|
+
"@visulima/vis-binding-linux-x64-musl": "4.2.0",
|
|
157
|
+
"@visulima/vis-binding-win32-arm64-msvc": "4.2.0",
|
|
158
|
+
"@visulima/vis-binding-win32-x64-msvc": "4.2.0"
|
|
159
159
|
},
|
|
160
160
|
"engines": {
|
|
161
161
|
"node": "^22.14.0 || >=24.10.0"
|
|
@@ -5,6 +5,20 @@
|
|
|
5
5
|
"description": "Workspace configuration for @visulima/vis. Used by defineConfig() in vis.config.ts. This schema is for non-TypeScript editors; TypeScript users get autocomplete from defineConfig() types.",
|
|
6
6
|
"type": "object",
|
|
7
7
|
"properties": {
|
|
8
|
+
"affectedIgnore": {
|
|
9
|
+
"type": "array",
|
|
10
|
+
"items": {
|
|
11
|
+
"type": "string"
|
|
12
|
+
},
|
|
13
|
+
"description": "Workspace-relative glob patterns for changed files outside every project that `vis affected`, `vis run --affected`, `vis ci` and `vis ci ignore` should not count as a change.\n\nBy default a changed file that belongs to no project (a root `tsconfig.json`, `package.json`, …) is a global change and marks every project affected. A changed file matching one of these patterns is skipped instead. The patterns are only checked for files that belong to NO project: a file inside a project root is never filtered, so a broad pattern like `*.md` cannot hide a real package change.\n\nPatterns use `path.matchesGlob` syntax, where `*` does not cross `/`: `*.md` matches `README.md` but not `docs/guide.md`.\n\nDo NOT list paths whose changes really do affect projects, such as bundler-inlined shared source or the root `tsconfig.json`: an edit there would then run nothing.",
|
|
14
|
+
"examples": [
|
|
15
|
+
[
|
|
16
|
+
"api-snapshots/**",
|
|
17
|
+
"plans/**",
|
|
18
|
+
"*.md"
|
|
19
|
+
]
|
|
20
|
+
]
|
|
21
|
+
},
|
|
8
22
|
"ai": {
|
|
9
23
|
"type": "object",
|
|
10
24
|
"properties": {
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{createRequire as C}from"node:module";import{getAffectedProjects as S}from"@visulima/task-runner";import{i as W}from"./index-BjdW45xX.js";import{V as j}from"./vis-user-error-DFPJeiL5.js";import{r as A}from"./affected-shas-Dd0P7fGD.js";let T;const $=e=>(T??=C(import.meta.url))(e),f=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,R=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 $(e)},{spawnSync:I}=R("node:child_process"),v=new Set(["deep","direct","none"]),B=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 p=o.slice(0,2),d=o.slice(3);if(d&&t.push(d),p.includes("R")||p.includes("C")){n+=1;const c=s[n];c&&t.push(c)}}return t},P=e=>{const t=I("git",["status","--porcelain","-z"],{cwd:e,encoding:"utf8"});return t.error||t.status!==0||typeof t.stdout!="string"?[]:B(t.stdout)},D=async(e,t,s={})=>{const n=e.downstream??"deep",o=e.upstream??"none";if(!v.has(n))throw new j(`Invalid --downstream value: "${n}". Must be "none", "direct", or "deep".`);if(!v.has(o))throw new j(`Invalid --upstream value: "${o}". Must be "none", "direct", or "deep".`);const{projectGraph:p,projects:d,workspaceRoot:c}=t,u=[];let{base:m}=e,{head:r}=e;if(!m||!r){const l=A({defaultBase:s.defaultBase,workspaceRoot:c});m=m||l.base,r=r||l.head,u.push(`Resolved affected refs from ${l.provider} (${l.notes.join("; ")})`)}const k=s.runningInCi??W,h=r==="HEAD"||r==="",b=e.uncommitted??(!k&&h);let a=[];if(b)if(h){const g=(s.readWorkingTreeChanges??P)(c),y=Object.values(d).map(i=>i.root?.replace(/\/$/,"")).filter(i=>!!i&&i!==".");a=g.filter(i=>y.some(_=>i===_||i.startsWith(`${_}/`)));const w=g.length-a.length;a.length>0&&u.push(`including ${a.length} uncommitted working-tree file(s)`),w>0&&u.push(`ignoring ${w} uncommitted path(s) outside any project (untracked scratch would otherwise mark every project affected)`)}else u.push(`ignoring --uncommitted: --head=${r} pins the comparison to a commit, not the working tree`);return{...await S({additionalChangedFiles:a,base:m,downstream:n,head:r,projectGraph:p,projects:d,upstream:o,workspaceRoot:c}),notes:u,uncommittedFileCount:a.length}};export{D as s};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{createRequire as W}from"node:module";import{e as h}from"./index-DHD8wb6Z.js";import{y as g}from"./isAccessibleSync-DYKTrrvc-CSnBISfV.js";import{p as O}from"./readJsonSync-CbryXYxN-B2aSeDpC.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 +0,0 @@
|
|
|
1
|
-
import{z as d,e as l}from"./index-DHD8wb6Z.js";import{S as m}from"./lockfile-DhHAaHN5.js";import{i as v,j as g}from"../packem_chunks/catalog.js";import{y as D}from"./isAccessibleSync-DYKTrrvc-CSnBISfV.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"}},j=t=>{const o=b[t];return o?[...o.aliases??[],o.file].map(e=>({file:e,type:o.type})):[]},h=(t,o)=>{const e=j(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},P=(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:P(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,2 +0,0 @@
|
|
|
1
|
-
import{createRequire as p}from"node:module";import{e as j}from"./index-DHD8wb6Z.js";import{a as F}from"./formatBytes-BHAzNIrn-Bkk_uRS-.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
|
-
`,"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};
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import{createRequire as st}from"node:module";import{e as f}from"./index-DHD8wb6Z.js";import{y as G}from"./isAccessibleSync-DYKTrrvc-CSnBISfV.js";import{p as ht}from"./readJsonSync-CbryXYxN-B2aSeDpC.js";import{h as dt}from"./writeFileSync-DJoHk3Ks-CgQ-VNNT.js";let nt;const ot=t=>(nt??=st(import.meta.url))(t),E=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,I=t=>{if(typeof E<"u"&&E.versions&&E.versions.node){const[s,e]=E.versions.node.split(".").map(Number);if(s>22||s===22&&e>=3||s===20&&e>=16)return E.getBuiltinModule(t)}return ot(t)},{existsSync:it,readdirSync:z,statSync:rt,rmSync:Y,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],$t=32,St=10630,Et=[32,126,162,163,165,166,172,172,175,175,10214,10221,10629,10630],xt=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],x=(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},j=19968,[kt,vt]=Bt(V);function Bt(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(j>=r&&j<=c)return[r,c];c-r>e-s&&(s=r,e=c)}return[s,e]}const Rt=t=>t<161||t>1114109?!1:x(pt,t),Tt=t=>t<ft||t>gt?!1:x(mt,t),It=t=>t<wt||t>bt?!1:x(yt,t),Wt=t=>t<$t||t>St?!1:x(Et,t),_t=t=>t>=kt&&t<=vt?!0:t<xt||t>Mt?!1:x(V,t);function Ct(t){return Rt(t)?"ambiguous":Tt(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,D=H`\p{Emoji}(?:\p{EMod}|[\u{E0020}-\u{E007E}]+\u{E007F}|\uFE0F?\u20E3?)`,Nt=()=>new RegExp(H`\p{RI}{2}|(?)${D}(?:\u200D${D})*`,"gu"),fe=new Set(["\x1B",""]),Ft="\x07",jt="[",ge="m",Dt="]8;;",me=39,we=/[\u200B\uFEFF\u2060-\u2064]/g,be=new RegExp(`(?:\\${jt}(?<code>\\d+)m|\\${Dt}(?<uri>.*)${Ft})`),ye=Object.freeze(new Map([[0,0],[1,22],[2,22],[3,23],[4,24],[7,27],[8,28],[9,29],[30,39],[31,39],[32,39],[33,39],[34,39],[35,39],[36,39],[37,39],[40,49],[41,49],[42,49],[43,49],[44,49],[45,49],[46,49],[47,49],[90,39]])),U=/[\u001B\u009B](?:[[()#;?]{0,10}(?:\d{1,4}(?:;\d{0,4})*)?[0-9A-ORZcf-nqry=><]|\]8;;[^\u0007\u001B]{0,100}(?:\u0007|\u001B\\))/g,$e=/\u001B\[[\d;]*m[^\u001B]*(?:\u001B\[[\d;]*m|$)/g,Se=/\u001B\]8;[^\u0007\u001B]*(?:\u0007|\u001B\\)[^\u001B]*\u001B\]8;;(?:\u0007|\u001B\\)/g,B=/[\u0000-\u0008\n-\u001F\u007F-\u009F]{1,1000}/y,q=Nt(),Ee=/[-_./\s]+/g,xe=/(\u001B\[[0-9;]*[a-z])/i,Me=new RegExp("\\p{Script=Arabic}","u"),ke=new RegExp("\\p{Script=Bengali}","u"),ve=new RegExp("\\p{Script=Cyrillic}","u"),Be=new RegExp("\\p{Script=Devanagari}","u"),Re=new RegExp("\\p{Script=Ethiopic}","u"),Te=new RegExp("\\p{Script=Greek}","u"),Ie=new RegExp("\\p{Script=Greek}+|\\p{Script=Latin}+|[^\\p{Script=Greek}\\p{Script=Latin}]+","gu"),We=new RegExp("\\p{Script=Gujarati}","u"),_e=new RegExp("\\p{Script=Gurmukhi}","u"),Ce=new RegExp("\\p{Script=Hangul}","u"),Ae=new RegExp("\\p{Script=Hebrew}","u"),Ne=new RegExp("\\p{Script=Hiragana}","u"),Fe=new RegExp("\\p{Script=Han}","u"),je=new RegExp("\\p{Script=Kannada}","u"),De=new RegExp("\\p{Script=Katakana}","u"),Oe=new RegExp("\\p{Script=Khmer}","u"),Pe=new RegExp("\\p{Script=Lao}","u"),Ke=new RegExp("\\p{Script=Latin}","u"),Le=new RegExp("\\p{Script=Malayalam}","u"),ze=new RegExp("\\p{Script=Myanmar}","u"),Ye=new RegExp("\\p{Script=Oriya}","u"),Ge=new RegExp("\\p{Script=Sinhala}","u"),Ve=new RegExp("\\p{Script=Tamil}","u"),Ze=new RegExp("\\p{Script=Telugu}","u"),He=new RegExp("\\p{Script=Thai}","u"),Ue=new RegExp("\\p{Script=Tibetan}","u"),qe=/[\u02BB\u02BC\u0027]/u,Je=t=>t.replace(q,""),O=new Map,Ot=t=>[t.ambiguousIsNarrow?1:0,t.control,t.fullWidth,t.regular,t.wide].join("|"),Pt=t=>{const s=Ot(t.width);let e=O.get(s);return e||(e=new Map,O.set(s,e)),e},R=new RegExp(U.source,"y"),_=new RegExp(q.source,"uy"),T=/(?:[\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",Kt=(t,s)=>{const e=Pt(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},Lt=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 $=t.indexOf(d,y+1);if($!==-1){const k=$+w,W=t.slice(y+1,$).replace(U,""),v=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}),S=v.width;if(v.truncated)l=!0,a=Math.min(a,o);else if(i+S>n&&(a=Math.min(a,o),l=!0,i+S>e.truncation.limit))break;if(i+=S,o=k,l&&i>=e.truncation.limit)break;continue}}}if(R.lastIndex=o,R.test(t)){const d=R.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=R.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(T.lastIndex=o,T.test(t)){const d=(T.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=T.lastIndex;continue}if((u<=31||u>=127&&u<=159)&&(B.lastIndex=o,B.test(t))){const d=(B.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=B.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(Lt(m)){o+=m>65535?2:1;continue}let h;if(c)h=Kt(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}},Xe=(t,s={})=>C(t,{...s,ellipsis:"",ellipsisWidth:0,limit:Number.POSITIVE_INFINITY}).width,A=()=>f(lt(),".vis"),zt=()=>f(A(),"cache"),Qe=()=>f(A(),"state"),Yt=t=>ct("sha256").update(t).digest("hex").slice(0,12),ts=t=>f(A(),"workspaces",Yt(t)),Gt=".vis",N=t=>f(t,Gt),es="node_modules/.cache/vis",ss=t=>f(N(t),"runs"),ns=t=>f(N(t),"last-summary.json"),os=t=>f(N(t),"last-failures"),is=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{}}},Vt="https://api.socket.dev/v0/purl?alerts=true",M=()=>f(zt(),"socket-security"),Zt=3600*1e3,X=.4,P=100,Ht=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",Ut=()=>{dt(M())},Q=(t,s)=>`${encodeURIComponent(t)}@${encodeURIComponent(s)}`,qt=(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}},Jt=(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")},Xt=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=qt(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")}`;Ut();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(Vt,{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();te(m,l,c,n)}catch{}finally{clearTimeout(b)}}return c},te=(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
|
-
`);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??Xt(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),Ht(u)&&(e.set(g,u),Jt(p,a.version,u,n))}catch{}}},ee=t=>t.namespace?`${t.namespace}/${t.name}`:t.name,rs=t=>t>=.8?"excellent":t>=.6?"good":t>=.4?"fair":t>=.2?"poor":"critical",as=t=>t>=.6?"green":t>=.4?"yellow":"red",cs=t=>{const s=ee(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})`},ls=(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
|
-
`)},se=()=>{const t=M();if(!G(t))return 0;const s=z(t).filter(e=>e.endsWith(".json"));for(const e of s)Y(f(t,e),{force:!0});return s.length},ne=()=>{const t=M();if(!G(t))return{entries:0,newestEntry:void 0,oldestEntry:void 0,totalSizeBytes:0};const s=z(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}},oe=(t,s)=>t?.enabled?{apiToken:t.apiToken??process.env.VIS_SOCKET_TOKEN,cacheTtlMs:t.cacheTtlMs,minimumScore:s??X,timeoutMs:t.timeoutMs}:void 0,us=(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},hs=(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
|
-
`),ds=(t,s={})=>{const e=oe(t,s.minimumScore);if(e)return{clearCache:se,displayName:"Socket.dev",fetchReports:n=>Qt(n,e),getCacheStats:ne,id:"socket"}},ps=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"}]},ie=[{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},re=t=>{switch(t){case 2:return 1024;case 10:return 1e3;default:throw new Error("Unsupported base.")}},ae=(t,s,e)=>({maximumFractionDigits:t,minimumFractionDigits:t,...s,...e}),ce=(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},fs=(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=re(e),b=n?t*8:t,u=Math.abs(b),m=s?.space??!0?" ":"",h=n?ie:tt[l],d=ce(a,h,l,n),w=r<0?void 0:r,y=i?{signDisplay:"exceptZero"}:{};if(b===0){const S=d===-1?0:Math.min(d,h.length-1),et=h[S][o?"long":"short"];return L(c,{...y,...p}).format(0)+m+et}const $=Math.max(0,Math.min(Math.floor(Math.log(u)/Math.log(g)),h.length-1)),k=d===-1?$:d,W=h[k][o?"long":"short"],v=b/g**k;return L(c,ae(w,y,p)).format(v)+m+W};export{fs as $,Le as A,Ge as B,Me as C,X as D,He as E,Te as F,ke as G,xe as H,Pe as I,Ue as J,ze as K,Re as L,ve as M,Oe as N,Ee as O,We as P,qe as Q,is as R,$e as S,Se as T,Fe as U,Ye as V,Ce as W,Je as X,De as Y,Ze as Z,U as _,os as a,C as a0,Tt as a1,_t as a2,we as a3,fe as a4,Dt as a5,Ft as a6,ge as a7,be as a8,ye as a9,jt as aa,me as ab,ds as ac,ls as ad,es as ae,ne as af,se as ag,ns as ah,A as b,N as c,ss as d,ee as e,us as f,zt as g,cs as h,rs as i,hs as j,ps as k,Qe as l,Xt as m,Qt as n,Xe as o,ts as p,q,Ke as r,as as s,Ie as t,Ne as u,Ae as v,Be as w,_e as x,je as y,Ve as z};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{createRequire as ae}from"node:module";let le;const ce=t=>(le??=ae(import.meta.url))(t),dt=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,pe=t=>{if(typeof dt<"u"&&dt.versions&&dt.versions.node){const[e,n]=dt.versions.node.split(".").map(Number);if(e>22||e===22&&n>=3||e===20&&n>=16)return dt.getBuiltinModule(t)}return ce(t)},{createRequire:he}=pe("node:module");function fe(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var Lt={},xt,Pt;function vt(){if(Pt)return xt;Pt=1;const t="\\\\/",e=`[^${t}]`,n=0,l=Symbol("unignore"),c="\\.",u="\\+",r="\\?",p="\\/",y="(?=.)",$="[^/]",v=`(?:${p}|$)`,x=`(?:^|${p})`,T=`${c}{1,2}${v}`,E=`(?!${c})`,O=`(?!${x}${T})`,L=`(?!${c}{0,1}${v})`,m=`(?!${T})`,j=`[^.${p}]`,C=`${$}*?`,g={DOT_LITERAL:c,PLUS_LITERAL:u,QMARK_LITERAL:r,SLASH_LITERAL:p,ONE_CHAR:y,QMARK:$,END_ANCHOR:v,DOTS_SLASH:T,NO_DOT:E,NO_DOTS:O,NO_DOT_SLASH:L,NO_DOTS_SLASH:m,QMARK_NO_DOT:j,STAR:C,START_ANCHOR:x,SEP:"/"},d={...g,SLASH_LITERAL:`[${t}]`,QMARK:e,STAR:`${e}*?`,DOTS_SLASH:`${c}{1,2}(?:[${t}]|$)`,NO_DOT:`(?!${c})`,NO_DOTS:`(?!(?:^|[${t}])${c}{1,2}(?:[${t}]|$))`,NO_DOT_SLASH:`(?!${c}{0,1}(?:[${t}]|$))`,NO_DOTS_SLASH:`(?!${c}{1,2}(?:[${t}]|$))`,QMARK_NO_DOT:`[^.${t}]`,START_ANCHOR:`(?:^|[${t}])`,END_ANCHOR:`(?:[${t}]|$)`,SEP:"\\"},s={__proto__:null,alnum:"a-zA-Z0-9",alpha:"a-zA-Z",ascii:"\\x00-\\x7F",blank:" \\t",cntrl:"\\x00-\\x1F\\x7F",digit:"0-9",graph:"\\x21-\\x7E",lower:"a-z",print:"\\x20-\\x7E ",punct:"\\-!\"#$%&'()\\*+,./:;<=>?@[\\]^_`{|}~",space:" \\t\\r\\n\\v\\f",upper:"A-Z",word:"A-Za-z0-9_",xdigit:"A-Fa-f0-9"};return xt={DEFAULT_MAX_EXTGLOB_RECURSION:n,MAX_LENGTH:1024*64,POSIX_REGEX_SOURCE:s,UNIGNORE:l,REGEX_BACKSLASH:/\\(?![*+?^${}(|)[\]])/g,REGEX_NON_SPECIAL_CHARS:/^[^@![\].,$*+?^{}()|\\/]+/,REGEX_SPECIAL_CHARS:/[-*+?.^${}(|)[\]]/,REGEX_SPECIAL_CHARS_BACKREF:/(\\?)((\W)(\3*))/g,REGEX_SPECIAL_CHARS_GLOBAL:/([-*+?.^${}(|)[\]])/g,REGEX_REMOVE_BACKSLASH:/(?:\[.*?[^\\]\]|\\(?=.))/g,REPLACEMENTS:{__proto__:null,"***":"*","**/**":"**","**/**/**":"**"},CHAR_0:48,CHAR_9:57,CHAR_UPPERCASE_A:65,CHAR_LOWERCASE_A:97,CHAR_UPPERCASE_Z:90,CHAR_LOWERCASE_Z:122,CHAR_LEFT_PARENTHESES:40,CHAR_RIGHT_PARENTHESES:41,CHAR_ASTERISK:42,CHAR_AMPERSAND:38,CHAR_AT:64,CHAR_BACKWARD_SLASH:92,CHAR_CARRIAGE_RETURN:13,CHAR_CIRCUMFLEX_ACCENT:94,CHAR_COLON:58,CHAR_COMMA:44,CHAR_DOT:46,CHAR_DOUBLE_QUOTE:34,CHAR_EQUAL:61,CHAR_EXCLAMATION_MARK:33,CHAR_FORM_FEED:12,CHAR_FORWARD_SLASH:47,CHAR_GRAVE_ACCENT:96,CHAR_HASH:35,CHAR_HYPHEN_MINUS:45,CHAR_LEFT_ANGLE_BRACKET:60,CHAR_LEFT_CURLY_BRACE:123,CHAR_LEFT_SQUARE_BRACKET:91,CHAR_LINE_FEED:10,CHAR_NO_BREAK_SPACE:160,CHAR_PERCENT:37,CHAR_PLUS:43,CHAR_QUESTION_MARK:63,CHAR_RIGHT_ANGLE_BRACKET:62,CHAR_RIGHT_CURLY_BRACE:125,CHAR_RIGHT_SQUARE_BRACKET:93,CHAR_SEMICOLON:59,CHAR_SINGLE_QUOTE:39,CHAR_SPACE:32,CHAR_TAB:9,CHAR_UNDERSCORE:95,CHAR_VERTICAL_LINE:124,CHAR_ZERO_WIDTH_NOBREAK_SPACE:65279,extglobChars(b){return{"!":{type:"negate",open:"(?:(?!(?:",close:`))${b.STAR})`},"?":{type:"qmark",open:"(?:",close:")?"},"+":{type:"plus",open:"(?:",close:")+"},"*":{type:"star",open:"(?:",close:")*"},"@":{type:"at",open:"(?:",close:")"}}},globChars(b){return b===!0?d:g}},xt}var It;function St(){return It||(It=1,(function(t){const{REGEX_BACKSLASH:e,REGEX_REMOVE_BACKSLASH:n,REGEX_SPECIAL_CHARS:l,REGEX_SPECIAL_CHARS_GLOBAL:c}=vt();t.isObject=u=>u!==null&&typeof u=="object"&&!Array.isArray(u),t.hasRegexChars=u=>l.test(u),t.isRegexChar=u=>u.length===1&&t.hasRegexChars(u),t.escapeRegex=u=>u.replace(c,"\\$1"),t.toPosixSlashes=u=>u.replace(e,"/"),t.isWindows=()=>{if(typeof navigator<"u"&&navigator.platform){const u=navigator.platform.toLowerCase();return u==="win32"||u==="windows"}return process.platform?process.platform==="win32":!1},t.removeBackslashes=u=>u.replace(n,r=>r==="\\"?"":r),t.escapeLast=(u,r,p)=>{const y=u.lastIndexOf(r,p);return y===-1?u:u[y-1]==="\\"?t.escapeLast(u,r,y-1):`${u.slice(0,y)}\\${u.slice(y)}`},t.removePrefix=(u,r={})=>{let p=u;return p.startsWith("./")&&(p=p.slice(2),r.prefix="./"),p},t.wrapOutput=(u,r={},p={})=>{const y=p.contains?"":"^",$=p.contains?"":"$";let v=`${y}(?:${u})${$}`;return r.negated===!0&&(v=`(?:^(?!${v}).*$)`),v},t.basename=(u,{windows:r}={})=>{const p=u.split(r?/[\\/]/:"/"),y=p[p.length-1];return y===""?p[p.length-2]:y}})(Lt)),Lt}var mt,Nt;function ge(){if(Nt)return mt;Nt=1;const t=St(),{CHAR_ASTERISK:e,CHAR_AT:n,CHAR_BACKWARD_SLASH:l,CHAR_COMMA:c,CHAR_DOT:u,CHAR_EXCLAMATION_MARK:r,CHAR_FORWARD_SLASH:p,CHAR_LEFT_CURLY_BRACE:y,CHAR_LEFT_PARENTHESES:$,CHAR_LEFT_SQUARE_BRACKET:v,CHAR_PLUS:x,CHAR_QUESTION_MARK:T,CHAR_RIGHT_CURLY_BRACE:E,CHAR_RIGHT_PARENTHESES:O,CHAR_RIGHT_SQUARE_BRACKET:L}=vt(),m=C=>C===p||C===l,j=C=>{C.isPrefix!==!0&&(C.depth=C.isGlobstar?1/0:1)};return mt=(C,g)=>{const d=g||{},s=C.length-1,b=d.parts===!0||d.scanToEnd===!0,w=[],R=[],_=[];let A=C,I=-1,M=0,V=0,at=!1,J=!1,K=!1,tt=!1,lt=!1,rt=!1,et=!1,U=!1,st=!1,Q=!1,ct=0,z,S,N={value:"",depth:0,isGlob:!1};const W=()=>I>=s,a=()=>A.charCodeAt(I+1),F=()=>(z=S,A.charCodeAt(++I));for(;I<s;){S=F();let Z;if(S===l){et=N.backslashes=!0,S=F(),S===y&&(rt=!0);continue}if(rt===!0||S===y){for(ct++;W()!==!0&&(S=F());){if(S===l){et=N.backslashes=!0,F();continue}if(S===y){ct++;continue}if(rt!==!0&&S===u&&(S=F())===u){if(at=N.isBrace=!0,K=N.isGlob=!0,Q=!0,b===!0)continue;break}if(rt!==!0&&S===c){if(at=N.isBrace=!0,K=N.isGlob=!0,Q=!0,b===!0)continue;break}if(S===E&&(ct--,ct===0)){rt=!1,at=N.isBrace=!0,Q=!0;break}}if(b===!0)continue;break}if(S===p){if(w.push(I),R.push(N),N={value:"",depth:0,isGlob:!1},Q===!0)continue;if(z===u&&I===M+1){M+=2;continue}V=I+1;continue}if(d.noext!==!0&&(S===x||S===n||S===e||S===T||S===r)&&a()===$){if(K=N.isGlob=!0,tt=N.isExtglob=!0,Q=!0,S===r&&I===M&&(st=!0),b===!0){for(;W()!==!0&&(S=F());){if(S===l){et=N.backslashes=!0,S=F();continue}if(S===O){K=N.isGlob=!0,Q=!0;break}}continue}break}if(S===e){if(z===e&&(lt=N.isGlobstar=!0),K=N.isGlob=!0,Q=!0,b===!0)continue;break}if(S===T){if(K=N.isGlob=!0,Q=!0,b===!0)continue;break}if(S===v){for(;W()!==!0&&(Z=F());){if(Z===l){et=N.backslashes=!0,F();continue}if(Z===L){J=N.isBracket=!0,K=N.isGlob=!0,Q=!0;break}}if(b===!0)continue;break}if(d.nonegate!==!0&&S===r&&I===M){U=N.negated=!0,M++;continue}if(d.noparen!==!0&&S===$){if(K=N.isGlob=!0,b===!0){for(;W()!==!0&&(S=F());){if(S===$){et=N.backslashes=!0,S=F();continue}if(S===O){Q=!0;break}}continue}break}if(K===!0){if(Q=!0,b===!0)continue;break}}d.noext===!0&&(tt=!1,K=!1);let B=A,pt="",o="";M>0&&(pt=A.slice(0,M),A=A.slice(M),V-=M),B&&K===!0&&V>0?(B=A.slice(0,V),o=A.slice(V)):K===!0?(B="",o=A):B=A,B&&B!==""&&B!=="/"&&B!==A&&m(B.charCodeAt(B.length-1))&&(B=B.slice(0,-1)),d.unescape===!0&&(o&&(o=t.removeBackslashes(o)),B&&et===!0&&(B=t.removeBackslashes(B)));const i={prefix:pt,input:C,start:M,base:B,glob:o,isBrace:at,isBracket:J,isGlob:K,isExtglob:tt,isGlobstar:lt,negated:U,negatedExtglob:st};if(d.tokens===!0&&(i.maxDepth=0,m(S)||R.push(N),i.tokens=R),d.parts===!0||d.tokens===!0){let Z;for(let P=0;P<w.length;P++){const nt=Z?Z+1:M,ot=w[P],Y=C.slice(nt,ot);d.tokens&&(P===0&&M!==0?(R[P].isPrefix=!0,R[P].value=pt):R[P].value=Y,j(R[P]),i.maxDepth+=R[P].depth),(P!==0||Y!=="")&&_.push(Y),Z=ot}if(Z&&Z+1<C.length){const P=C.slice(Z+1);_.push(P),d.tokens&&(R[R.length-1].value=P,j(R[R.length-1]),i.maxDepth+=R[R.length-1].depth)}i.slashes=w,i.parts=_}return i},mt}var Ct,Dt;function de(){if(Dt)return Ct;Dt=1;const t=vt(),e=St(),{MAX_LENGTH:n,POSIX_REGEX_SOURCE:l,REGEX_NON_SPECIAL_CHARS:c,REGEX_SPECIAL_CHARS_BACKREF:u,REPLACEMENTS:r}=t,p=(g,d)=>{if(typeof d.expandRange=="function")return d.expandRange(...g,d);g.sort();const s=`[${g.join("-")}]`;try{new RegExp(s)}catch{return g.map(b=>e.escapeRegex(b)).join("..")}return s},y=(g,d)=>`Missing ${g}: "${d}" - use "\\\\${d}" to match literal characters`,$=g=>{const d=[];let s=0,b=0,w=0,R="",_=!1;for(const A of g){if(_===!0){R+=A,_=!1;continue}if(A==="\\"){R+=A,_=!0;continue}if(A==='"'){w=w===1?0:1,R+=A;continue}if(w===0){if(A==="[")s++;else if(A==="]"&&s>0)s--;else if(s===0){if(A==="(")b++;else if(A===")"&&b>0)b--;else if(A==="|"&&b===0){d.push(R),R="";continue}}}R+=A}return d.push(R),d},v=g=>{let d=!1;for(const s of g){if(d===!0){d=!1;continue}if(s==="\\"){d=!0;continue}if(/[?*+@!()[\]{}]/.test(s))return!1}return!0},x=g=>{let d=g.trim(),s=!0;for(;s===!0;)s=!1,/^@\([^\\()[\]{}|]+\)$/.test(d)&&(d=d.slice(2,-1),s=!0);if(v(d))return d.replace(/\\(.)/g,"$1")},T=g=>{const d=g.map(x).filter(Boolean);for(let s=0;s<d.length;s++)for(let b=s+1;b<d.length;b++){const w=d[s],R=d[b],_=w[0];if(!(!_||w!==_.repeat(w.length)||R!==_.repeat(R.length))&&(w===R||w.startsWith(R)||R.startsWith(w)))return!0}return!1},E=(g,d=!0)=>{if(g[0]!=="+"&&g[0]!=="*"||g[1]!=="(")return;let s=0,b=0,w=0,R=!1;for(let _=1;_<g.length;_++){const A=g[_];if(R===!0){R=!1;continue}if(A==="\\"){R=!0;continue}if(A==='"'){w=w===1?0:1;continue}if(w!==1){if(A==="["){s++;continue}if(A==="]"&&s>0){s--;continue}if(!(s>0)){if(A==="("){b++;continue}if(A===")"&&(b--,b===0))return d===!0&&_!==g.length-1?void 0:{type:g[0],body:g.slice(2,_),end:_}}}}},O=g=>`${g.length===1?e.escapeRegex(g[0]):`[${g.map(d=>e.escapeRegex(d)).join("")}]`}*`,L=g=>{let d=0;const s=[];for(;d<g.length;){const b=E(g.slice(d),!1);if(!b||b.type!=="*")return;const w=$(b.body).map(_=>_.trim());if(w.length!==1)return;const R=x(w[0]);if(!R||R.length!==1)return;s.push(R),d+=b.end+1}if(!(s.length<1))return s},m=g=>{let d=0,s=g.trim(),b=E(s);for(;b;)d++,s=b.body.trim(),b=E(s);return d},j=(g,d)=>{if(d.maxExtglobRecursion===!1)return{risky:!1};const s=typeof d.maxExtglobRecursion=="number"?d.maxExtglobRecursion:t.DEFAULT_MAX_EXTGLOB_RECURSION,b=$(g).map(A=>A.trim());if(b.length>1&&(b.some(A=>A==="")||b.some(A=>/^[*?]+$/.test(A))||T(b)))return{risky:!0};const w=[];let R=!1,_=!0;for(const A of b){const I=L(A);if(I){R=!0,w.push(...I);continue}const M=x(A);if(M&&M.length===1){w.push(M);continue}if(_=!1,m(A)>s)return{risky:!0}}return R?_?{risky:!0,safeOutput:O([...new Set(w)])}:{risky:!0}:{risky:!1}},C=(g,d)=>{if(typeof g!="string")throw new TypeError("Expected a string");g=r[g]||g;const s={...d},b=typeof s.maxLength=="number"?Math.min(n,s.maxLength):n;let w=g.length;if(w>b)throw new SyntaxError(`Input length: ${w}, exceeds maximum allowed length: ${b}`);const R={type:"bos",value:"",output:s.prepend||""},_=[R],A=s.capture?"":"?:",I=t.globChars(s.windows),M=t.extglobChars(I),{DOT_LITERAL:V,PLUS_LITERAL:at,SLASH_LITERAL:J,ONE_CHAR:K,DOTS_SLASH:tt,NO_DOT:lt,NO_DOT_SLASH:rt,NO_DOTS_SLASH:et,QMARK:U,QMARK_NO_DOT:st,STAR:Q,START_ANCHOR:ct}=I,z=f=>`(${A}(?:(?!${ct}${f.dot?tt:V}).)*?)`,S=s.dot?"":lt,N=s.dot?U:st;let W=s.bash===!0?z(s):Q;s.capture&&(W=`(${W})`),typeof s.noext=="boolean"&&(s.noextglob=s.noext);const a={input:g,index:-1,start:0,dot:s.dot===!0,consumed:"",output:"",prefix:"",backtrack:!1,negated:!1,brackets:0,braces:0,parens:0,quotes:0,globstar:!1,tokens:_};g=e.removePrefix(g,a),w=g.length;const F=[],B=[],pt=[];let o=R,i;const Z=()=>a.index===w-1,P=a.peek=(f=1)=>g[a.index+f],nt=a.advance=()=>g[++a.index]||"",ot=()=>g.slice(a.index+1),Y=(f="",G=0)=>{a.consumed+=f,a.index+=G},_t=f=>{a.output+=f.output!=null?f.output:f.value,Y(f.value)},ue=()=>{let f=1;for(;P()==="!"&&(P(2)!=="("||P(3)==="?");)nt(),a.start++,f++;return f%2===0?!1:(a.negated=!0,a.start++,!0)},bt=f=>{a[f]++,pt.push(f)},ht=f=>{a[f]--,pt.pop()},k=f=>{if(o.type==="globstar"){const G=a.braces>0&&(f.type==="comma"||f.type==="brace"),h=f.extglob===!0||F.length&&(f.type==="pipe"||f.type==="paren");f.type!=="slash"&&f.type!=="paren"&&!G&&!h&&(a.output=a.output.slice(0,-o.output.length),o.type="star",o.value="*",o.output=W,a.output+=o.output)}if(F.length&&f.type!=="paren"&&(F[F.length-1].inner+=f.value),(f.value||f.output)&&_t(f),o&&o.type==="text"&&f.type==="text"){o.output=(o.output||o.value)+f.value,o.value+=f.value;return}f.prev=o,_.push(f),o=f},Et=(f,G)=>{const h={...M[G],conditions:1,inner:""};h.prev=o,h.parens=a.parens,h.output=a.output,h.startIndex=a.index,h.tokensIndex=_.length;const H=(s.capture?"(":"")+h.open;bt("parens"),k({type:f,value:G,output:a.output?"":K}),k({type:"paren",extglob:!0,value:nt(),output:H}),F.push(h)},ie=f=>{const G=g.slice(f.startIndex,a.index+1),h=g.slice(f.startIndex+2,a.index),H=j(h,s);if((f.type==="plus"||f.type==="star")&&H.risky){const D=H.safeOutput?(f.output?"":K)+(s.capture?`(${H.safeOutput})`:H.safeOutput):void 0,ut=_[f.tokensIndex];ut.type="text",ut.value=G,ut.output=D||e.escapeRegex(G);for(let it=f.tokensIndex+1;it<_.length;it++)_[it].value="",_[it].output="",delete _[it].suffix;a.output=f.output+ut.output,a.backtrack=!0,k({type:"paren",extglob:!0,value:i,output:""}),ht("parens");return}let q=f.close+(s.capture?")":""),X;if(f.type==="negate"){let D=W;if(f.inner&&f.inner.length>1&&f.inner.includes("/")&&(D=z(s)),(D!==W||Z()||/^\)+$/.test(ot()))&&(q=f.close=`)$))${D}`),f.inner.includes("*")&&(X=ot())&&/^\.[^\\/.]+$/.test(X)){const ut=C(X,{...d,fastpaths:!1}).output;q=f.close=`)${ut})${D})`}f.prev.type==="bos"&&(a.negatedExtglob=!0)}k({type:"paren",extglob:!0,value:i,output:q}),ht("parens")};if(s.fastpaths!==!1&&!/(^[*!]|[/()[\]{}"])/.test(g)){let f=!1,G=g.replace(u,(h,H,q,X,D,ut)=>X==="\\"?(f=!0,h):X==="?"?H?H+X+(D?U.repeat(D.length):""):ut===0?N+(D?U.repeat(D.length):""):U.repeat(q.length):X==="."?V.repeat(q.length):X==="*"?H?H+X+(D?W:""):W:H?h:`\\${h}`);return f===!0&&(s.unescape===!0?G=G.replace(/\\/g,""):G=G.replace(/\\+/g,h=>h.length%2===0?"\\\\":h?"\\":"")),G===g&&s.contains===!0?(a.output=g,a):(a.output=e.wrapOutput(G,a,d),a)}for(;!Z();){if(i=nt(),i==="\0")continue;if(i==="\\"){const h=P();if(h==="/"&&s.bash!==!0||h==="."||h===";")continue;if(!h){i+="\\",k({type:"text",value:i});continue}const H=/^\\+/.exec(ot());let q=0;if(H&&H[0].length>2&&(q=H[0].length,a.index+=q,q%2!==0&&(i+="\\")),s.unescape===!0?i=nt():i+=nt(),a.brackets===0){k({type:"text",value:i});continue}}if(a.brackets>0&&(i!=="]"||o.value==="["||o.value==="[^")){if(s.posix!==!1&&i===":"){const h=o.value.slice(1);if(h.includes("[")&&(o.posix=!0,h.includes(":"))){const H=o.value.lastIndexOf("["),q=o.value.slice(0,H),X=o.value.slice(H+2),D=l[X];if(D){o.value=q+D,a.backtrack=!0,nt(),!R.output&&_.indexOf(o)===1&&(R.output=K);continue}}}(i==="["&&P()!==":"||i==="-"&&P()==="]")&&(i=`\\${i}`),i==="]"&&(o.value==="["||o.value==="[^")&&(i=`\\${i}`),s.posix===!0&&i==="!"&&o.value==="["&&(i="^"),o.value+=i,_t({value:i});continue}if(a.quotes===1&&i!=='"'){i=e.escapeRegex(i),o.value+=i,_t({value:i});continue}if(i==='"'){a.quotes=a.quotes===1?0:1,s.keepQuotes===!0&&k({type:"text",value:i});continue}if(i==="("){bt("parens"),k({type:"paren",value:i});continue}if(i===")"){if(a.parens===0&&s.strictBrackets===!0)throw new SyntaxError(y("opening","("));const h=F[F.length-1];if(h&&a.parens===h.parens+1){ie(F.pop());continue}k({type:"paren",value:i,output:a.parens?")":"\\)"}),ht("parens");continue}if(i==="["){if(s.nobracket===!0||!ot().includes("]")){if(s.nobracket!==!0&&s.strictBrackets===!0)throw new SyntaxError(y("closing","]"));i=`\\${i}`}else bt("brackets");k({type:"bracket",value:i});continue}if(i==="]"){if(s.nobracket===!0||o&&o.type==="bracket"&&o.value.length===1){k({type:"text",value:i,output:`\\${i}`});continue}if(a.brackets===0){if(s.strictBrackets===!0)throw new SyntaxError(y("opening","["));k({type:"text",value:i,output:`\\${i}`});continue}ht("brackets");const h=o.value.slice(1);if(o.posix!==!0&&h[0]==="^"&&!h.includes("/")&&(i=`/${i}`),o.value+=i,_t({value:i}),s.literalBrackets===!1||e.hasRegexChars(h))continue;const H=e.escapeRegex(o.value);if(a.output=a.output.slice(0,-o.value.length),s.literalBrackets===!0){a.output+=H,o.value=H;continue}o.value=`(${A}${H}|${o.value})`,a.output+=o.value;continue}if(i==="{"&&s.nobrace!==!0){bt("braces");const h={type:"brace",value:i,output:"(",outputIndex:a.output.length,tokensIndex:a.tokens.length};B.push(h),k(h);continue}if(i==="}"){const h=B[B.length-1];if(s.nobrace===!0||!h){k({type:"text",value:i,output:i});continue}let H=")";if(h.dots===!0){const q=_.slice(),X=[];for(let D=q.length-1;D>=0&&(_.pop(),q[D].type!=="brace");D--)q[D].type!=="dots"&&X.unshift(q[D].value);H=p(X,s),a.backtrack=!0}if(h.comma!==!0&&h.dots!==!0){const q=a.output.slice(0,h.outputIndex),X=a.tokens.slice(h.tokensIndex);h.value=h.output="\\{",i=H="\\}",a.output=q;for(const D of X)a.output+=D.output||D.value}k({type:"brace",value:i,output:H}),ht("braces"),B.pop();continue}if(i==="|"){F.length>0&&F[F.length-1].conditions++,k({type:"text",value:i});continue}if(i===","){let h=i;const H=B[B.length-1];H&&pt[pt.length-1]==="braces"&&(H.comma=!0,h="|"),k({type:"comma",value:i,output:h});continue}if(i==="/"){if(o.type==="dot"&&a.index===a.start+1){a.start=a.index+1,a.consumed="",a.output="",_.pop(),o=R;continue}k({type:"slash",value:i,output:J});continue}if(i==="."){if(a.braces>0&&o.type==="dot"){o.value==="."&&(o.output=V);const h=B[B.length-1];o.type="dots",o.output+=i,o.value+=i,h.dots=!0;continue}if(a.braces+a.parens===0&&o.type!=="bos"&&o.type!=="slash"){k({type:"text",value:i,output:V});continue}k({type:"dot",value:i,output:V});continue}if(i==="?"){if(!(o&&o.value==="(")&&s.noextglob!==!0&&P()==="("&&P(2)!=="?"){Et("qmark",i);continue}if(o&&o.type==="paren"){const h=P();let H=i;(o.value==="("&&!/[!=<:]/.test(h)||h==="<"&&!/<([!=]|\w+>)/.test(ot()))&&(H=`\\${i}`),k({type:"text",value:i,output:H});continue}if(s.dot!==!0&&(o.type==="slash"||o.type==="bos")){k({type:"qmark",value:i,output:st});continue}k({type:"qmark",value:i,output:U});continue}if(i==="!"){if(s.noextglob!==!0&&P()==="("&&(P(2)!=="?"||!/[!=<:]/.test(P(3)))){Et("negate",i);continue}if(s.nonegate!==!0&&a.index===0){ue();continue}}if(i==="+"){if(s.noextglob!==!0&&P()==="("&&P(2)!=="?"){Et("plus",i);continue}if(o&&o.value==="("||s.regex===!1){k({type:"plus",value:i,output:at});continue}if(o&&(o.type==="bracket"||o.type==="paren"||o.type==="brace")||a.parens>0){k({type:"plus",value:i});continue}k({type:"plus",value:at});continue}if(i==="@"){if(s.noextglob!==!0&&P()==="("&&P(2)!=="?"){k({type:"at",extglob:!0,value:i,output:""});continue}k({type:"text",value:i});continue}if(i!=="*"){(i==="$"||i==="^")&&(i=`\\${i}`);const h=c.exec(ot());h&&(i+=h[0],a.index+=h[0].length),k({type:"text",value:i});continue}if(o&&(o.type==="globstar"||o.star===!0)){o.type="star",o.star=!0,o.value+=i,o.output=W,a.backtrack=!0,a.globstar=!0,Y(i);continue}let f=ot();if(s.noextglob!==!0&&/^\([^?]/.test(f)){Et("star",i);continue}if(o.type==="star"){if(s.noglobstar===!0){Y(i);continue}const h=o.prev,H=h.prev,q=h.type==="slash"||h.type==="bos",X=H&&(H.type==="star"||H.type==="globstar");if(s.bash===!0&&(!q||f[0]&&f[0]!=="/")){k({type:"star",value:i,output:""});continue}const D=a.braces>0&&(h.type==="comma"||h.type==="brace"),ut=F.length&&(h.type==="pipe"||h.type==="paren");if(!q&&h.type!=="paren"&&!D&&!ut){k({type:"star",value:i,output:""});continue}for(;f.slice(0,3)==="/**";){const it=g[a.index+4];if(it&&it!=="/")break;f=f.slice(3),Y("/**",3)}if(h.type==="bos"&&Z()){o.type="globstar",o.value+=i,o.output=z(s),a.output=o.output,a.globstar=!0,Y(i);continue}if(h.type==="slash"&&h.prev.type!=="bos"&&!X&&Z()){a.output=a.output.slice(0,-(h.output+o.output).length),h.output=`(?:${h.output}`,o.type="globstar",o.output=z(s)+(s.strictSlashes?")":"|$)"),o.value+=i,a.globstar=!0,a.output+=h.output+o.output,Y(i);continue}if(h.type==="slash"&&h.prev.type!=="bos"&&f[0]==="/"){const it=f[1]!==void 0?"|$":"";a.output=a.output.slice(0,-(h.output+o.output).length),h.output=`(?:${h.output}`,o.type="globstar",o.output=`${z(s)}${J}|${J}${it})`,o.value+=i,a.output+=h.output+o.output,a.globstar=!0,Y(i+nt()),k({type:"slash",value:"/",output:""});continue}if(h.type==="bos"&&f[0]==="/"){o.type="globstar",o.value+=i,o.output=`(?:^|${J}|${z(s)}${J})`,a.output=o.output,a.globstar=!0,Y(i+nt()),k({type:"slash",value:"/",output:""});continue}if(D&&f[0]==="/"){o.type="globstar",o.value+=i,o.output=`(?:^|${J}|${z(s)}${J})`,a.output+=o.output,a.globstar=!0,Y(i+nt()),k({type:"slash",value:"/",output:""});continue}a.output=a.output.slice(0,-o.output.length),o.type="globstar",o.output=z(s),o.value+=i,a.output+=o.output,a.globstar=!0,Y(i);continue}const G={type:"star",value:i,output:W};if(s.bash===!0){G.output=".*?",(o.type==="bos"||o.type==="slash")&&(G.output=S+G.output),k(G);continue}if(o&&(o.type==="bracket"||o.type==="paren")&&s.regex===!0){G.output=i,k(G);continue}(a.index===a.start||o.type==="slash"||o.type==="dot")&&(o.type==="dot"?(a.output+=rt,o.output+=rt):s.dot===!0?(a.output+=et,o.output+=et):(a.output+=S,o.output+=S),P()!=="*"&&(a.output+=K,o.output+=K)),k(G)}for(;a.brackets>0;){if(s.strictBrackets===!0)throw new SyntaxError(y("closing","]"));a.output=e.escapeLast(a.output,"["),ht("brackets")}for(;a.parens>0;){if(s.strictBrackets===!0)throw new SyntaxError(y("closing",")"));a.output=e.escapeLast(a.output,"("),ht("parens")}for(;a.braces>0;){if(s.strictBrackets===!0)throw new SyntaxError(y("closing","}"));a.output=e.escapeLast(a.output,"{"),ht("braces")}if(s.strictSlashes!==!0&&(o.type==="star"||o.type==="bracket")&&k({type:"maybe_slash",value:"",output:`${J}?`}),a.backtrack===!0){a.output="";for(const f of a.tokens)a.output+=f.output!=null?f.output:f.value,f.suffix&&(a.output+=f.suffix)}return a};return C.fastpaths=(g,d)=>{const s={...d},b=typeof s.maxLength=="number"?Math.min(n,s.maxLength):n,w=g.length;if(w>b)throw new SyntaxError(`Input length: ${w}, exceeds maximum allowed length: ${b}`);g=r[g]||g;const{DOT_LITERAL:R,SLASH_LITERAL:_,ONE_CHAR:A,DOTS_SLASH:I,NO_DOT:M,NO_DOTS:V,NO_DOTS_SLASH:at,STAR:J,START_ANCHOR:K}=t.globChars(s.windows),tt=s.dot?V:M,lt=s.dot?at:M,rt=s.capture?"":"?:",et={negated:!1,prefix:""};let U=s.bash===!0?".*?":J;s.capture&&(U=`(${U})`);const st=S=>S.noglobstar===!0?U:`(${rt}(?:(?!${K}${S.dot?I:R}).)*?)`,Q=S=>{switch(S){case"*":return`${tt}${A}${U}`;case".*":return`${R}${A}${U}`;case"*.*":return`${tt}${U}${R}${A}${U}`;case"*/*":return`${tt}${U}${_}${A}${lt}${U}`;case"**":return tt+st(s);case"**/*":return`(?:${tt}${st(s)}${_})?${lt}${A}${U}`;case"**/*.*":return`(?:${tt}${st(s)}${_})?${lt}${U}${R}${A}${U}`;case"**/.*":return`(?:${tt}${st(s)}${_})?${R}${A}${U}`;default:{const N=/^(.*?)\.(\w+)$/.exec(S);if(!N)return;const W=Q(N[1]);return W?W+R+N[2]:void 0}}},ct=e.removePrefix(g,et);let z=Q(ct);return z&&s.strictSlashes!==!0&&(z+=`${_}?`),z},Ct=C,Ct}var kt,Bt;function ye(){if(Bt)return kt;Bt=1;const t=ge(),e=de(),n=St(),l=vt(),c=r=>r&&typeof r=="object"&&!Array.isArray(r),u=(r,p,y=!1)=>{if(Array.isArray(r)){const m=r.map(j=>u(j,p,y));return j=>{for(const C of m){const g=C(j);if(g)return g}return!1}}const $=c(r)&&r.tokens&&r.input;if(r===""||typeof r!="string"&&!$)throw new TypeError("Expected pattern to be a non-empty string");const v=p||{},x=v.windows,T=$?u.compileRe(r,p):u.makeRe(r,p,!1,!0),E=T.state;delete T.state;let O=()=>!1;if(v.ignore){const m={...p,ignore:null,onMatch:null,onResult:null};O=u(v.ignore,m,y)}const L=(m,j=!1)=>{const{isMatch:C,match:g,output:d}=u.test(m,T,p,{glob:r,posix:x}),s={glob:r,state:E,regex:T,posix:x,input:m,output:d,match:g,isMatch:C};if(typeof v.onResult=="function"&&v.onResult(s),C===!1)return s.isMatch=!1,j?s:!1;t:if(O(m)){if(typeof v.onIgnore=="function"&&v.onIgnore(s)===l.UNIGNORE){s.isMatch=!0;break t}return s.isMatch=!1,j?s:!1}return typeof v.onMatch=="function"&&v.onMatch(s),j?s:!0};return y&&(L.state=E),L};return u.test=(r,p,y,{glob:$,posix:v}={})=>{if(typeof r!="string")throw new TypeError("Expected input to be a string");if(r==="")return{isMatch:!1,output:""};const x=y||{},T=x.format||(v?n.toPosixSlashes:null);let E=r===$,O=E&&T?T(r):r;return E===!1&&(O=T?T(r):r,E=O===$),(E===!1||x.capture===!0)&&(x.matchBase===!0||x.basename===!0?E=u.matchBase(r,p,y,v):E=p.exec(O)),{isMatch:!!E,match:E,output:O}},u.matchBase=(r,p,y,$=y&&y.windows)=>(p instanceof RegExp?p:u.makeRe(p,y)).test(n.basename(r,{windows:$})),u.isMatch=(r,p,y)=>u(p,y)(r),u.parse=(r,p)=>Array.isArray(r)?r.map(y=>u.parse(y,p)):e(r,{...p,fastpaths:!1}),u.scan=(r,p)=>t(r,p),u.compileRe=(r,p,y=!1,$=!1)=>{if(y===!0)return r.output;const v=p||{},x=v.contains?"":"^",T=v.contains?"":"$";let E=`${x}(?:${r.output})${T}`;r&&r.negated===!0&&(E=`^(?!${E}).*$`);const O=u.toRegex(E,p);return $===!0&&(O.state=r),O},u.makeRe=(r,p={},y=!1,$=!1)=>{if(!r||typeof r!="string")throw new TypeError("Expected a non-empty string");let v={negated:!1,fastpaths:!0};return p.fastpaths!==!1&&(r[0]==="."||r[0]==="*")&&(v.output=e.fastpaths(r,p)),v.output||(v=e(r,p)),u.compileRe(v,p,y,$)},u.toRegex=(r,p)=>{try{const y=p||{};return new RegExp(r,y.flags||(y.nocase?"i":""))}catch(y){if(p&&p.debug===!0)throw y;return/$^/}},u.constants=l,kt=u,kt}var wt,Mt;function Ae(){if(Mt)return wt;Mt=1;const t=ye(),e=St();function n(l,c,u=!1){return c&&(c.windows===null||c.windows===void 0)&&(c={...c,windows:e.isWindows()}),t(l,c,u)}return Object.assign(n,t),wt=n,wt}var Re=Ae();const ft=fe(Re);let _e;const be=t=>(_e??=he(import.meta.url))(t),yt=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,Rt=t=>{if(typeof yt<"u"&&yt.versions&&yt.versions.node){const[e,n]=yt.versions.node.split(".").map(Number);if(e>22||e===22&&n>=3||e===20&&n>=16)return yt.getBuiltinModule(t)}return be(t)},Ft=Rt("fs"),Ee={...Ft,default:Ft},{statSync:ve,stat:Se,realpathSync:$e,realpath:xe,readdirSync:me,readdir:Ce}=Rt("fs"),{sep:Wt,basename:ke,dirname:Tt,resolve:Qt,normalize:we,relative:He,posix:gt,isAbsolute:Oe}=Rt("path"),{fileURLToPath:Te}=Rt("url"),{createRequire:Le}=Rt("module");var Gt=Le(import.meta.url);function Pe(t){let e=we(t);return e.length>1&&e[e.length-1]===Wt&&(e=e.substring(0,e.length-1)),e}const Ie=/[\\/]/g;function zt(t,e){return t.replace(Ie,e)}const Ne=/^[a-z]:[\\/]$/i;function De(t){return t==="/"||Ne.test(t)}function Ht(t,e){const{resolvePaths:n,normalizePath:l,pathSeparator:c}=e,u=process.platform==="win32"&&t.includes("/")||t.startsWith(".");if(n&&(t=Qt(t)),(l||u)&&(t=Pe(t)),t===".")return"";const r=t[t.length-1]!==c;return zt(r?t+c:t,c)}function Zt(t,e){return e+t}function Be(t,e){return function(n,l){return l.startsWith(t)?l.slice(t.length)+n:zt(He(t,l),e.pathSeparator)+e.pathSeparator+n}}function Me(t){return t}function Fe(t,e,n){return e+t+n}function Ge(t,e){const{relativePaths:n,includeBasePath:l}=e;return n&&t?Be(t,e):l?Zt:Me}function Ue(t){return function(e,n){n.push(e.substring(t.length)||".")}}function qe(t){return function(e,n,l){const c=e.substring(t.length)||".";l.every(u=>u(c,!0))&&n.push(c)}}const Ke=(t,e)=>{e.push(t||".")},Xe=(t,e,n)=>{const l=t||".";n.every(c=>c(l,!0))&&e.push(l)},je=()=>{};function We(t,e){const{includeDirs:n,filters:l,relativePaths:c}=e;return n?c?l&&l.length?qe(t):Ue(t):l&&l.length?Xe:Ke:je}const Qe=(t,e,n,l)=>{l.every(c=>c(t,!1))&&n.files++},ze=(t,e,n,l)=>{l.every(c=>c(t,!1))&&e.push(t)},Ze=(t,e,n,l)=>{n.files++},Ye=(t,e)=>{e.push(t)},Ve=()=>{};function Je(t){const{excludeFiles:e,filters:n,onlyCounts:l}=t;return e?Ve:n&&n.length?l?Qe:ze:l?Ze:Ye}const tn=t=>t,en=()=>[""].slice(0,0);function nn(t){return t.group?en:tn}const rn=(t,e,n)=>{t.push({directory:e,files:n,dir:e})},sn=()=>{};function on(t){return t.group?rn:sn}const un=function(t,e,n){const{queue:l,fs:c,options:{suppressErrors:u}}=e;l.enqueue(),c.realpath(t,(r,p)=>{if(r)return l.dequeue(u?null:r,e);c.stat(p,(y,$)=>{if(y)return l.dequeue(u?null:y,e);if($.isDirectory()&&Yt(t,p,e))return l.dequeue(null,e);n($,p),l.dequeue(null,e)})})},an=function(t,e,n){const{queue:l,fs:c,options:{suppressErrors:u}}=e;l.enqueue();try{const r=c.realpathSync(t),p=c.statSync(r);if(p.isDirectory()&&Yt(t,r,e))return;n(p,r)}catch(r){if(!u)throw r}};function ln(t,e){return!t.resolveSymlinks||t.excludeSymlinks?null:e?an:un}function Yt(t,e,n){if(n.options.useRealPaths)return cn(e,n);let l=Tt(t),c=1;for(;l!==n.root&&c<2;){const u=n.symlinks.get(l);u&&(u===e||u.startsWith(e)||e.startsWith(u))?c++:l=Tt(l)}return n.symlinks.set(t,e),c>1}function cn(t,e){return e.visited.includes(t+e.options.pathSeparator)}const pn=t=>t.counts,hn=t=>t.groups,fn=t=>t.paths,gn=t=>t.paths.slice(0,t.options.maxFiles),dn=(t,e,n)=>($t(e,n,t.counts,t.options.suppressErrors),null),yn=(t,e,n)=>($t(e,n,t.paths,t.options.suppressErrors),null),An=(t,e,n)=>($t(e,n,t.paths.slice(0,t.options.maxFiles),t.options.suppressErrors),null),Rn=(t,e,n)=>($t(e,n,t.groups,t.options.suppressErrors),null);function $t(t,e,n,l){e(t&&!l?t:null,n)}function _n(t,e){const{onlyCounts:n,group:l,maxFiles:c}=t;return n?e?pn:dn:l?e?hn:Rn:c?e?gn:An:e?fn:yn}const Vt={withFileTypes:!0},bn=(t,e,n,l,c)=>{if(t.queue.enqueue(),l<0)return t.queue.dequeue(null,t);const{fs:u}=t;t.visited.push(e),t.counts.directories++,u.readdir(e||".",Vt,(r,p=[])=>{c(p,n,l),t.queue.dequeue(t.options.suppressErrors?null:r,t)})},En=(t,e,n,l,c)=>{const{fs:u}=t;if(l<0)return;t.visited.push(e),t.counts.directories++;let r=[];try{r=u.readdirSync(e||".",Vt)}catch(p){if(!t.options.suppressErrors)throw p}c(r,n,l)};function vn(t){return t?En:bn}var Sn=class{count=0;constructor(t){this.onQueueEmpty=t}enqueue(){return this.count++,this.count}dequeue(t,e){this.onQueueEmpty&&(--this.count<=0||t)&&(this.onQueueEmpty(t,e),t&&(e.controller.abort(),this.onQueueEmpty=void 0))}},$n=class{_files=0;_directories=0;set files(t){this._files=t}get files(){return this._files}set directories(t){this._directories=t}get directories(){return this._directories}get dirs(){return this._directories}},xn=class{aborted=!1;abort(){this.aborted=!0}},Jt=class{root;isSynchronous;state;joinPath;pushDirectory;pushFile;getArray;groupFiles;resolveSymlink;walkDirectory;callbackInvoker;constructor(t,e,n){this.isSynchronous=!n,this.callbackInvoker=_n(e,this.isSynchronous),this.root=Ht(t,e),this.state={root:De(this.root)?this.root:this.root.slice(0,-1),paths:[""].slice(0,0),groups:[],counts:new $n,options:e,queue:new Sn((l,c)=>this.callbackInvoker(c,l,n)),symlinks:new Map,visited:[""].slice(0,0),controller:new xn,fs:e.fs||Ee},this.joinPath=Ge(this.root,e),this.pushDirectory=We(this.root,e),this.pushFile=Je(e),this.getArray=nn(e),this.groupFiles=on(e),this.resolveSymlink=ln(e,this.isSynchronous),this.walkDirectory=vn(this.isSynchronous)}start(){return this.pushDirectory(this.root,this.state.paths,this.state.options.filters),this.walkDirectory(this.state,this.root,this.root,this.state.options.maxDepth,this.walk),this.isSynchronous?this.callbackInvoker(this.state,null):null}walk=(t,e,n)=>{const{paths:l,options:{filters:c,resolveSymlinks:u,excludeSymlinks:r,exclude:p,maxFiles:y,signal:$,useRealPaths:v,pathSeparator:x},controller:T}=this.state;if(T.aborted||$&&$.aborted||y&&l.length>y)return;const E=this.getArray(this.state.paths);for(let O=0;O<t.length;++O){const L=t[O];if(L.isFile()||L.isSymbolicLink()&&!u&&!r){const m=this.joinPath(L.name,e);this.pushFile(m,E,this.state.counts,c)}else if(L.isDirectory()){let m=Fe(L.name,e,this.state.options.pathSeparator);if(p&&p(L.name,m))continue;this.pushDirectory(m,l,c),this.walkDirectory(this.state,m,m,n-1,this.walk)}else if(this.resolveSymlink&&L.isSymbolicLink()){let m=Zt(L.name,e);this.resolveSymlink(m,this.state,(j,C)=>{if(j.isDirectory()){if(C=Ht(C,this.state.options),p&&p(L.name,v?C:m+x))return;this.walkDirectory(this.state,C,v?C:m+x,n-1,this.walk)}else{C=v?C:m;const g=ke(C),d=Ht(Tt(C),this.state.options);C=this.joinPath(g,d),this.pushFile(C,E,this.state.counts,c)}})}}this.groupFiles(this.state.groups,e,E)}};function mn(t,e){return new Promise((n,l)=>{te(t,e,(c,u)=>{if(c)return l(c);n(u)})})}function te(t,e,n){new Jt(t,e,n).start()}function Cn(t,e){return new Jt(t,e).start()}var Ut=class{constructor(t,e){this.root=t,this.options=e}withPromise(){return mn(this.root,this.options)}withCallback(t){te(this.root,this.options,t)}sync(){return Cn(this.root,this.options)}};let ee=null;try{Gt.resolve("picomatch"),ee=Gt("picomatch")}catch{}var kn=class{globCache={};options={maxDepth:1/0,suppressErrors:!0,pathSeparator:Wt,filters:[]};globFunction;constructor(t){this.options={...this.options,...t},this.globFunction=this.options.globFunction}group(){return this.options.group=!0,this}withPathSeparator(t){return this.options.pathSeparator=t,this}withBasePath(){return this.options.includeBasePath=!0,this}withRelativePaths(){return this.options.relativePaths=!0,this}withDirs(){return this.options.includeDirs=!0,this}withMaxDepth(t){return this.options.maxDepth=t,this}withMaxFiles(t){return this.options.maxFiles=t,this}withFullPaths(){return this.options.resolvePaths=!0,this.options.includeBasePath=!0,this}withErrors(){return this.options.suppressErrors=!1,this}withSymlinks({resolvePaths:t=!0}={}){return this.options.resolveSymlinks=!0,this.options.useRealPaths=t,this.withFullPaths()}withAbortSignal(t){return this.options.signal=t,this}normalize(){return this.options.normalizePath=!0,this}filter(t){return this.options.filters.push(t),this}onlyDirs(){return this.options.excludeFiles=!0,this.options.includeDirs=!0,this}exclude(t){return this.options.exclude=t,this}onlyCounts(){return this.options.onlyCounts=!0,this}crawl(t){return new Ut(t||".",this.options)}withGlobFunction(t){return this.globFunction=t,this}crawlWithOptions(t,e){return this.options={...this.options,...e},new Ut(t||".",this.options)}glob(...t){return this.globFunction?this.globWithOptions(t):this.globWithOptions(t,{dot:!0})}globWithOptions(t,...e){const n=this.globFunction||ee;if(!n)throw new Error("Please specify a glob function to use glob matching.");var l=this.globCache[t.join("\0")];return l||(l=n(t,...e),this.globCache[t.join("\0")]=l),this.options.filters.push(c=>l(c)),this}};const wn=Array.isArray,ne=/\\/g,Hn=/^[A-Za-z]:$/,re=process.platform==="win32",On=/^(\/?\.\.)+$/;function qt(t,e={}){const n=t.length,l=Array(n),c=Array(n);let u,r;for(u=0;u<n;u++){const p=se(t[u]);l[u]=p;const y=p.length,$=Array(y);for(r=0;r<y;r++)$[r]=ft(p[r],e);c[u]=$}return p=>{const y=p.split("/");if(y[0]===".."&&On.test(p))return!0;for(u=0;u<n;u++){const $=l[u],v=c[u],x=y.length,T=Math.min(x,$.length);for(r=0;r<T;){const E=$[r];if(E.includes("/"))return!0;if(!v[r](y[r]))break;if(!e.noglobstar&&E==="**")return!0;r++}if(r===x)return!0}return!1}}const Tn=/^[A-Z]:\/$/i,Ln=re?t=>Tn.test(t):t=>t==="/";function Kt(t,e,n){if(t===e||e.startsWith(`${t}/`)){if(n){const c=t.length+ +!Ln(t);return(u,r)=>u.slice(c,r?-1:void 0)||"."}const l=e.slice(t.length+1);return l?(c,u)=>{if(c===".")return l;const r=`${l}/${c}`;return u?r.slice(0,-1):r}:(c,u)=>u&&c!=="."?c.slice(0,-1):c}return n?l=>gt.relative(t,l)||".":l=>gt.relative(t,`${e}/${l}`)||"."}function Pn(t,e){if(e.startsWith(`${t}/`)){const n=e.slice(t.length+1);return l=>`${n}/${l}`}return n=>{const l=gt.relative(t,`${e}/${n}`);return n[n.length-1]==="/"&&l!==""?`${l}/`:l||"."}}function Xt(t){return t.replace(Hn,e=>`${e}/`)}const In={parts:!0};function se(t){var e;const n=ft.scan(t,In);return!((e=n.parts)===null||e===void 0)&&e.length?n.parts:[t]}const Nn=/(?<!\\)([()[\]{}*?|]|^!|[!+@](?=\()|\\(?![()[\]{}!*+?@|]))/g,Dn=/(?<!\\)([()[\]{}]|^!|[!+@](?=\())/g,Bn=t=>t.replace(Nn,"\\$&"),Mn=t=>t.replace(Dn,"\\$&"),Fn=re?Mn:Bn;function Gn(t,e){const n=ft.scan(t);return n.isGlob||n.negated}function At(...t){console.log(`[tinyglobby ${new Date().toLocaleTimeString("es")}]`,...t)}function oe(t){return typeof t=="string"?[t]:t??[]}const Un=/^(\/?\.\.)+/,qn=/\\(?=[()[\]{}!*+?@|])/g;function Ot(t,e,n,l){var c;const u=e.cwd;let r=t;t[t.length-1]==="/"&&(r=t.slice(0,-1));const p=r.lastIndexOf("/"),y=(p===-1?r:r.slice(p+1)).startsWith("!(");r[r.length-1]!=="*"&&!y&&e.expandDirectories&&(r+="/**");const $=Fn(u);r=Oe(r.replace(qn,""))?gt.relative($,r):gt.normalize(r);const v=(c=Un.exec(r))===null||c===void 0?void 0:c[0],x=se(r);if(v){const E=(v.length+1)/3;let O=0;const L=$.split("/");for(;O<E&&x[O+E]===L[L.length+O-E];)r=r.slice(0,(E-O-1)*3)+r.slice((E-O)*3+x[O+E].length+1)||".",O++;const m=gt.join(u,v.slice(O*3));m[0]!=="."&&n.root.length>m.length&&(n.root=Xt(m),n.depthOffset=-E+O)}if(!l&&n.depthOffset>=0){var T;(T=n.commonPath)!==null&&T!==void 0||(n.commonPath=x);const E=[],O=Math.min(n.commonPath.length,x.length);for(let L=0;L<O;L++){const m=x[L];if(m==="**"&&!x[L+1]){E.pop();break}if(L===x.length-1||m!==n.commonPath[L]||Gn(m))break;E.push(m)}n.depthOffset=E.length,n.commonPath=E,n.root=Xt(E.length>0?gt.join(u,...E):u)}return r}function Kn(t,e,n){const l=[],c=[],u=[];for(const r of t.ignore)r&&(r[0]!=="!"||r[1]==="("?c.push(Ot(r,t,n,!0)):u.push(r.slice(1)));for(const r of e)r&&(r[0]!=="!"||r[1]==="("?l.push(Ot(r,t,n,!1)):(r[1]!=="!"||r[2]==="(")&&c.push(Ot(r.slice(1),t,n,!0)));return{match:l,ignore:c,unignore:u}}function Xn(t,e){const n=t.cwd,l={root:n,depthOffset:0},c=Kn(t,e,l);t.debug&&At("internal processing patterns:",c);const{absolute:u,caseSensitiveMatch:r,debug:p,dot:y,followSymbolicLinks:$,onlyDirectories:v}=t,x=l.root.replace(ne,""),T={dot:y,nobrace:t.braceExpansion===!1,nocase:!r,noextglob:t.extglob===!1,noglobstar:t.globstar===!1,posix:!0},E=c.unignore.length>0,O=E?ft(c.unignore,T):void 0,L=E?qt(c.unignore,T):void 0,m=ft(c.match,{...T,ignore:c.ignore,onIgnore:O?_=>O(_.output)&&ft.constants.UNIGNORE:void 0}),j=ft(c.ignore,T),C=qt(c.match,T),g=Kt(n,x,u),d=u?g:Kt(n,x,!0),s=c.match.length>0&&c.match.every(_=>_==="**"||_==="**/*"),b=c.ignore.length>0||E||!s?(_,A)=>{const I=d(A,!0);return I==="."||L&&L(I)?!1:!C(I)||j(I)}:void 0;let w;t.deep!==void 0&&(w=Math.round(t.deep-l.depthOffset));const R=new kn({filters:[p?(_,A)=>{const I=g(_,A),M=m(I);return M&&At(`matched ${I}`),M}:(_,A)=>{const I=g(_,A);return m(I)}],exclude:p&&b?(_,A)=>{const I=b(_,A);return At(`${I?"skipped":"crawling"} ${A}`),I}:b,fs:t.fs,pathSeparator:"/",relativePaths:!u,resolvePaths:u,includeBasePath:u,resolveSymlinks:$,excludeSymlinks:!$,excludeFiles:v,includeDirs:v||!t.onlyFiles,maxDepth:w,signal:t.signal}).crawl(x);return t.debug&&At("internal properties:",{...l,root:x}),[R,n!==x&&!u&&Pn(n,x)]}function jn(t,e){if(e)for(let n=t.length-1;n>=0;n--)t[n]=e(t[n]);return t}const jt={caseSensitiveMatch:!0,debug:!!process.env.TINYGLOBBY_DEBUG,expandDirectories:!0,followSymbolicLinks:!0,onlyFiles:!0};function Wn(t){const e=Object.assign({},t);for(const n in jt)e[n]===void 0&&Object.assign(e,{[n]:jt[n]});return e.cwd=(e.cwd instanceof URL?Te(e.cwd):Qt(e.cwd||process.cwd())).replace(ne,"/"),e.ignore=oe(e.ignore),e.fs&&(e.fs={readdir:e.fs.readdir||Ce,readdirSync:e.fs.readdirSync||me,realpath:e.fs.realpath||xe,realpathSync:e.fs.realpathSync||$e,stat:e.fs.stat||Se,statSync:e.fs.statSync||ve}),e.debug&&At("globbing with options:",e),e}function Qn(t,e={}){var n;if(t&&e?.patterns)throw new Error("Cannot pass patterns as both an argument and an option");const l=wn(t)||typeof t=="string",c=oe((n=l?t:t.patterns)!==null&&n!==void 0?n:"**/*"),u=Wn(l?e:t);return c.length>0?Xn(u,c):[]}async function zn(t,e){const[n,l]=Qn(t,e);return n?jn(await n.withPromise(),l):[]}const Yn=async(t,e)=>await zn(t,e);export{Yn as l};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{m as k,D as S,f as L}from"./provenance-w-NIPtim.js";import{g as $}from"./packument-CHdDsn0O.js";import{f}from"./formatBytes-BHAzNIrn-Bkk_uRS-.js";import{a as E}from"./build-scripts-pdVmqXRm.js";import{n as h}from"./license-DvlYdo6T.js";import{v as A,U as P,z as x}from"./index-DHD8wb6Z.js";import{S as O}from"./lockfile-DhHAaHN5.js";import{L as b}from"./dependency-scan-DBH2Qo4I.js";const C=2,m=4,y={CRITICAL:0,HIGH:1,LOW:3,MODERATE:C,UNKNOWN:m},ae=(s,e)=>{const n=y[(s.vulnerability.severity??"UNKNOWN").toUpperCase()]??m,t=y[(e.vulnerability.severity??"UNKNOWN").toUpperCase()]??m;return n-t||s.packageName.localeCompare(e.packageName)||s.packageVersion.localeCompare(e.packageVersion)},M=(s,e)=>{const n=y[e.toUpperCase()]??C;return(y[s.toUpperCase()]??m)<=n},R=["firstSeen","installScripts","license","malware","publisherChange","score","unexpectedDeps","vulnerability"],w=6e4,D=(s,e,n)=>{for(const t of n)if(t===s||t===`${s}@${e}`||t.endsWith("*")&&s.startsWith(t.slice(0,-1)))return!0;return!1},W=async(s,e)=>{const n=e.security?.policies?.firstSeen;if(n?.minutes===void 0||n.minutes<=0)return[];const{minutes:t}=n,r=n.exclude??[],a=e.security?.acceptedRisks,c=t*w,o=Date.now();return(await k(s.packages,S,async l=>{if(D(l.name,l.version,r))return;const p=await $(l.name,{workspaceRoot:s.workspaceRoot});if(p===void 0)return;const u=p.time?.[l.version];if(u===void 0)return;const d=Date.parse(u);if(Number.isNaN(d))return;const v=o-d;if(v>=c)return;const g=Math.max(0,Math.floor(v/w));return{acceptedRisk:f(l.name,l.version,a,"firstSeen"),data:{ageMinutes:g,minimumMinutes:t,publishedAt:u},packageName:l.name,policy:"firstSeen",reason:`${l.name}@${l.version} was published ${String(g)} min ago — below the ${String(t)} min firstSeen cooldown.`,severity:"block",version:l.version}})).filter(l=>l!==void 0)},U=(s,e)=>{const n=e.security?.policies?.installScripts;if(!n)return[];const t=n.allow??{},r=n.strict===!0;if(!r&&Object.keys(t).length===0)return[];const a=E(s.workspaceRoot,t,{pinVersions:e.security?.pinVersions===!0});if(a.unapproved.length===0)return[];const c=e.security?.acceptedRisks,o=r?"block":"warn";return a.unapproved.map(i=>({acceptedRisk:f(i.name,i.version??"*",c,"installScripts"),data:{hooks:i.hooks},packageName:i.name,policy:"installScripts",reason:`${i.name}${i.version?`@${i.version}`:""} declares unapproved build script(s): ${i.hooks.join(", ")}`,severity:o,version:i.version??"*"}))},_=new Set(["AND","OR"]),I=s=>{const e=s.replaceAll("("," ").replaceAll(")"," ").split(/\s+/).map(r=>r.trim()).filter(r=>r.length>0),n=[];let t=!1;for(const r of e){const a=r.toUpperCase();if(t){t=!1;continue}if(a==="WITH"){t=!0;continue}if(_.has(a))continue;const c=r.endsWith("+"),o=c?r.slice(0,-1):r,i=h(o)??o;n.push(i),c&&n.push(`${i}-or-later`)}return n},T=s=>{if(typeof s.license=="string"){const e=s.license.trim();return e.length>0?e:void 0}if(s.license&&typeof s.license=="object"&&typeof s.license.type=="string"){const e=s.license.type.trim();if(e.length>0)return e}if(Array.isArray(s.licenses)&&s.licenses.length>0){const e=s.licenses.map(n=>n&&typeof n.type=="string"?n.type.trim():"").filter(n=>n.length>0);if(e.length>0)return e.length===1?e[0]:`(${e.join(" OR ")})`}},V=(s,e)=>{if(e.length===0)return;const n=new Set(e.map(t=>h(t)??t).map(t=>t.toLowerCase()));for(const t of s)if(n.has(t.toLowerCase()))return t},F=(s,e)=>{if(e.length===0)return;const n=new Set(e.map(t=>h(t)??t).map(t=>t.toLowerCase()));for(const t of s)if(!n.has(t.toLowerCase()))return t},j=(s,e)=>{const n=e.security?.policies?.license;if(!n)return[];const t=n.allow??[],r=n.deny??[];if(t.length===0&&r.length===0)return[];const a=e.security?.acceptedRisks,c=[];for(const o of s.packages){const i=s.manifestData?.get(`${o.name}@${o.version}`),l=i?T(i):void 0;if(!l){t.length>0&&c.push({acceptedRisk:f(o.name,o.version,a,"license"),data:{declaredLicense:null},packageName:o.name,policy:"license",reason:`${o.name}@${o.version} declares no license; allow-list mode requires one of: ${t.join(", ")}`,severity:"block",version:o.version});continue}const p=I(l),u=V(p,r);if(u){c.push({acceptedRisk:f(o.name,o.version,a,"license"),data:{declaredLicense:l,deniedLicense:u},packageName:o.name,policy:"license",reason:`${o.name}@${o.version} uses denied license '${u}' (declared: ${l})`,severity:"block",version:o.version});continue}const d=F(p,t);d&&c.push({acceptedRisk:f(o.name,o.version,a,"license"),data:{allowList:t,declaredLicense:l,unallowedLicense:d},packageName:o.name,policy:"license",reason:`${o.name}@${o.version} uses license '${d}' which is not on the allow-list (declared: ${l})`,severity:"block",version:o.version})}return c},K=6e4,z=(s,e,n)=>{for(const t of n)if(t===s||t===`${s}@${e}`||t.endsWith("*")&&s.startsWith(t.slice(0,-1)))return!0;return!1},B=async(s,e)=>{const n=e.security?.policies?.publisherChange;if(n?.mode!=="no-downgrade")return[];const t=n.exclude??[],r=typeof n.ignoreAfter=="number"?n.ignoreAfter*K:void 0,a=e.security?.acceptedRisks,c=Date.now();return(await k(s.packages,S,async i=>{if(z(i.name,i.version,t))return;const l=await $(i.name,{workspaceRoot:s.workspaceRoot});if(l===void 0)return;if(r!==void 0){const d=l.time?.[i.version],v=d===void 0?Number.NaN:Date.parse(d);if(!Number.isNaN(v)&&c-v>r)return}if(l.versions[i.version]?.dist?.attestations?.provenance!==void 0)return;const u=L(l,i.version);if(u!==void 0)return{acceptedRisk:f(i.name,i.version,a,"publisherChange"),data:{priorVersionWithProvenance:u},packageName:i.name,policy:"publisherChange",reason:`${i.name}@${i.version} dropped the provenance attestation that ${i.name}@${u} carried — publisher trust downgrade.`,severity:"block",version:i.version}})).filter(i=>i!==void 0)},Y=s=>{for(const e of Object.values(b))for(const n of[e.file,...e.aliases??[]])if(s===n||s.endsWith(`/${n}`)||s.endsWith(`.${n}`))return e.type},H=(s,e,n)=>{const t=A(e)?e:P(s,e);let r;try{r=x(t)}catch{return}const a=Y(t)??b[n]?.type;if(!a)return;const c=O(r,a);if(c.length===0)return;const o=new Set;for(const i of c)o.add(`${i.name}@${i.version}`);return o},q=(s,e)=>{for(const n of e)if(n===s||n.endsWith("*")&&s.startsWith(n.slice(0,-1)))return!0;return!1},G=(s,e)=>{const n=e.security?.policies?.unexpectedDeps;if(!n)return[];const t=n.allow??[],r=n.baselineLockfile;if(t.length===0&&!r)return[];const a=r?H(s.workspaceRoot,r,s.packageManager):void 0,c=e.security?.acceptedRisks,o=[];for(const i of s.packages){const l=t.length===0||q(i.name,t),p=a?a.has(`${i.name}@${i.version}`):!0;if(l&&p)continue;const u=[],d={};l||(u.push(`not on allow-list (${t.length} entr${t.length===1?"y":"ies"})`),d.allowList=t),!p&&a&&(u.push(`not present in baseline lockfile (${r})`),d.baselineLockfile=r),o.push({acceptedRisk:f(i.name,i.version,c,"unexpectedDeps"),data:d,packageName:i.name,policy:"unexpectedDeps",reason:`${i.name}@${i.version} is unexpected: ${u.join("; ")}`,severity:"block",version:i.version})}return o},X=(s,e)=>{if(!s.osvFindings||s.osvFindings.size===0)return[];const t=e.security?.policies?.vulnerability?.failOn,r=e.security?.acceptedRisks,a=[];for(const c of s.packages){const o=s.osvFindings.get(c.name);if(!(!o||o.length===0))for(const i of o){const l=t?M(i.severity,t)?"block":"warn":"info";a.push({acceptedRisk:f(c.name,c.version,r,"vulnerability"),data:{advisoryId:i.id,aliases:i.aliases??[],cvssScore:i.cvssScore,fixedVersions:i.fixedVersions,severity:i.severity,summary:i.summary},packageName:c.name,policy:"vulnerability",reason:`${i.severity} ${i.id} affects ${c.name}@${c.version}: ${i.summary}`,severity:l,version:c.version})}}return a},N=[{evaluate:X,isConfigured:s=>s.security?.policies?.vulnerability!==void 0,name:"vulnerability",offlineSupported:!0,surfaces:["audit","doctor"]},{evaluate:j,isConfigured:s=>{const e=s.security?.policies?.license;return!!(e&&(e.allow&&e.allow.length>0||e.deny&&e.deny.length>0))},name:"license",offlineSupported:!0,surfaces:["audit","doctor","install"]},{evaluate:U,isConfigured:s=>{const e=s.security?.policies?.installScripts;return!!(e&&(e.allow&&Object.keys(e.allow).length>0||e.strict===!0))},name:"installScripts",offlineSupported:!0,surfaces:["audit","doctor","install"]},{evaluate:G,isConfigured:s=>{const e=s.security?.policies?.unexpectedDeps;return!!(e&&(e.allow&&e.allow.length>0||typeof e.baselineLockfile=="string"))},name:"unexpectedDeps",offlineSupported:!0,surfaces:["audit","doctor","install"]},{evaluate:W,isConfigured:s=>{const e=s.security?.policies?.firstSeen?.minutes;return typeof e=="number"&&e>0},name:"firstSeen",offlineSupported:!1,surfaces:["audit","doctor","install"]},{evaluate:B,isConfigured:s=>s.security?.policies?.publisherChange?.mode==="no-downgrade",name:"publisherChange",offlineSupported:!1,surfaces:["audit","doctor","install"]}],J=(s,e,n)=>N.filter(t=>t.surfaces.includes(s)?n!==void 0?n.has(t.name):t.isConfigured(e):!1),ce=async(s,e,n)=>{const t=J(e,n.visConfig,n.enabledPolicies),r=[];for(const a of t){if(s.offline&&!a.offlineSupported){r.push({packageName:"*",policy:a.name,reason:`policy.${a.name} skipped: requires network (--offline)`,severity:"info",version:"*"});continue}try{const c=await a.evaluate(s,n.visConfig);r.push(...c)}catch(c){const o=c instanceof Error?c.message:String(c);r.push({packageName:"*",policy:a.name,reason:`policy.${a.name} failed: ${o}`,severity:"info",version:"*"})}}return r},Q=(()=>{const s=new Map;for(const e of R)s.set(e.toLowerCase(),e);return s})(),le=()=>N.map(s=>s.name),ue=(s,e)=>{if(s===void 0)return;const n=s.trim().toLowerCase();if(n===""||n==="none")return new Set;if(n==="all")return new Set(R);const t=new Set;for(const r of s.split(",").map(a=>a.trim()).filter(a=>a.length>0)){const a=r.replace(/^_+/,"").replaceAll(/_+([a-z])/g,(o,i)=>i.toUpperCase()),c=Q.get(a.toLowerCase());c===void 0?e?.(r):t.add(c)}return t};export{ae as c,ce as e,le as g,ue as p,M as s};
|