@visulima/vis 2.0.0 → 2.0.2
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 +41 -0
- package/LICENSE.md +862 -170
- package/README.md +1 -1
- package/dist/bin.js +1 -1
- package/dist/binx.js +2 -2
- package/dist/config/index.d.ts +1817 -1811
- package/dist/generate/index.d.ts +39 -39
- package/dist/packem_chunks/CONFIG_FILES.js +5 -5
- package/dist/packem_chunks/bloom-status.js +1 -1
- package/dist/packem_chunks/bloom-sync.js +1 -1
- package/dist/packem_chunks/cache-attestation.js +1 -1
- package/dist/packem_chunks/catalog.js +69 -67
- package/dist/packem_chunks/cli-exec.js +1 -1
- package/dist/packem_chunks/cli-main.js +150 -145
- package/dist/packem_chunks/detect.js +3 -3
- package/dist/packem_chunks/detect2.js +4 -4
- package/dist/packem_chunks/dispatch.js +3 -3
- package/dist/packem_chunks/doctor-probe.js +1 -1
- package/dist/packem_chunks/extra-files.js +3 -3
- package/dist/packem_chunks/fix.js +9 -9
- package/dist/packem_chunks/handler.js +1 -1
- package/dist/packem_chunks/handler10.js +5 -5
- package/dist/packem_chunks/handler11.js +1 -1
- package/dist/packem_chunks/handler12.js +6 -6
- 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 +2 -2
- package/dist/packem_chunks/handler22.js +10 -10
- package/dist/packem_chunks/handler23.js +1 -1
- package/dist/packem_chunks/handler24.js +1 -1
- package/dist/packem_chunks/handler25.js +1 -1
- package/dist/packem_chunks/handler26.js +5 -5
- package/dist/packem_chunks/handler27.js +1 -1
- package/dist/packem_chunks/handler28.js +3 -3
- package/dist/packem_chunks/handler29.js +1 -1
- package/dist/packem_chunks/handler3.js +2 -3
- package/dist/packem_chunks/handler30.js +1 -1
- package/dist/packem_chunks/handler31.js +2 -2
- package/dist/packem_chunks/handler35.js +3 -3
- package/dist/packem_chunks/handler4.js +4 -4
- package/dist/packem_chunks/handler40.js +10 -10
- package/dist/packem_chunks/handler42.js +3 -3
- package/dist/packem_chunks/handler43.js +3 -3
- package/dist/packem_chunks/handler5.js +5 -5
- package/dist/packem_chunks/handler50.js +5 -5
- package/dist/packem_chunks/handler51.js +13 -13
- 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/handler57.js +5 -5
- package/dist/packem_chunks/handler58.js +4 -4
- package/dist/packem_chunks/handler59.js +8 -8
- package/dist/packem_chunks/handler6.js +7 -7
- package/dist/packem_chunks/handler60.js +2 -2
- package/dist/packem_chunks/handler61.js +13 -13
- package/dist/packem_chunks/handler62.js +4 -4
- package/dist/packem_chunks/handler63.js +3 -3
- package/dist/packem_chunks/handler64.js +4 -4
- package/dist/packem_chunks/handler65.js +6 -6
- package/dist/packem_chunks/handler66.js +2 -2
- package/dist/packem_chunks/handler67.js +9 -9
- package/dist/packem_chunks/handler68.js +7 -7
- package/dist/packem_chunks/handler69.js +24 -24
- package/dist/packem_chunks/handler7.js +1 -1
- package/dist/packem_chunks/handler70.js +6 -6
- package/dist/packem_chunks/handler71.js +14 -14
- package/dist/packem_chunks/handler72.js +47 -47
- package/dist/packem_chunks/handler73.js +9 -9
- package/dist/packem_chunks/handler74.js +27 -27
- package/dist/packem_chunks/handler75.js +3 -3
- package/dist/packem_chunks/handler76.js +8 -8
- package/dist/packem_chunks/handler77.js +63 -64
- package/dist/packem_chunks/handler78.js +25 -25
- package/dist/packem_chunks/handler8.js +1 -1
- package/dist/packem_chunks/handler9.js +1 -1
- package/dist/packem_chunks/heal-accept.js +5 -5
- package/dist/packem_chunks/heal.js +8 -8
- package/dist/packem_chunks/help-command.js +46 -46
- package/dist/packem_chunks/index2.js +5 -5
- package/dist/packem_chunks/index3.js +3 -3
- package/dist/packem_chunks/index4.js +11 -11
- package/dist/packem_chunks/keys-refresh.js +1 -1
- package/dist/packem_chunks/lean.js +2 -2
- package/dist/packem_chunks/list.js +2 -2
- package/dist/packem_chunks/loader.js +4 -4
- package/dist/packem_chunks/orchestrator.js +14 -14
- package/dist/packem_chunks/pre-mode.js +2 -2
- package/dist/packem_chunks/prompts.js +3 -3
- package/dist/packem_chunks/prune.js +1 -1
- package/dist/packem_chunks/publish-guards.js +1 -1
- package/dist/packem_chunks/registry.js +17 -17
- package/dist/packem_chunks/resolveFormatter.js +5 -5
- package/dist/packem_chunks/shell-runner.js +1 -1
- package/dist/packem_chunks/snapshot.js +2 -2
- package/dist/packem_chunks/stage-publisher.js +1 -1
- package/dist/packem_chunks/staged-registry.js +2 -2
- package/dist/packem_chunks/state.js +3 -3
- 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/tar.js +3 -3
- package/dist/packem_chunks/tripwire.js +2 -2
- package/dist/packem_chunks/ts-loader.js +9 -9
- package/dist/packem_chunks/verify-lockfile.js +2 -2
- package/dist/packem_chunks/workspace.js +2 -2
- package/dist/packem_shared/advisories-CCBGdU8U.js +1 -0
- package/dist/packem_shared/affected-selection-Dj-ymxhw.js +1 -0
- package/dist/packem_shared/affected-shas-PwkVbPch.js +1 -0
- package/dist/packem_shared/ai-analysis-bGCAc1jR.js +68 -0
- package/dist/packem_shared/{ai-fix-CLfWbyqY.js → ai-fix-DV5-dHBY.js} +9 -9
- package/dist/packem_shared/{augment-BVuj3ee7.js → augment-24KX2nkI.js} +4 -4
- package/dist/packem_shared/bin-CtzhnYMp.js +1 -0
- package/dist/packem_shared/build-scripts-w4SNeR7D.js +1 -0
- package/dist/packem_shared/{command-runtime-DTbo12cP.js → command-runtime-BLFPUYAT.js} +1 -1
- package/dist/packem_shared/cyclonedx-C4KaVTn1.js +4 -0
- package/dist/packem_shared/{dependency-scan-DZcSlSFp.js → dependency-scan-D_ona0Qm.js} +1 -1
- package/dist/packem_shared/{docker-69ybb6g7.js → docker-DaVs-9wK.js} +40 -40
- package/dist/packem_shared/{en-C26W78--.js → en-D3CfXlO7.js} +13 -13
- package/dist/packem_shared/failure-log-CTneNcio.js +2 -0
- package/dist/packem_shared/giget-CAxjpwew.js +2 -0
- package/dist/packem_shared/glob-BUjyjdE8-C4M8e02u.js +1 -0
- package/dist/packem_shared/index-BWl4DbMp.js +1 -0
- package/dist/packem_shared/index-CTMU29dI.js +1 -0
- package/dist/packem_shared/index-uBVnF4ji.js +35 -0
- package/dist/packem_shared/index.server-CusjRLCh.js +2 -0
- package/dist/packem_shared/{interface.d-B7VK2rcH.d.ts → interface.d-CRqRz4jt.d.ts} +39 -39
- package/dist/packem_shared/{interface.d-Cezzifoh.d.ts → interface.d-CrHOtJc1.d.ts} +37 -37
- package/dist/packem_shared/lifecycle-B8A2T3gx.js +2 -0
- package/dist/packem_shared/lockfile-Bccery3L.js +1 -0
- package/dist/packem_shared/main-D_cam4hv.js +1 -0
- package/dist/packem_shared/manifests-BDkwiVbh.js +1 -0
- package/dist/packem_shared/{min-release-age-hK604veF.js → min-release-age-OaYpLwux.js} +2 -2
- package/dist/packem_shared/missing-package-json-BqS-OnKd.js +1 -0
- package/dist/packem_shared/{native-config-sync-DDKjAy0i.js → native-config-sync-Ds1FtcrM.js} +7 -7
- package/dist/packem_shared/osv-bloom-pKp7urSB.js +2 -0
- package/dist/packem_shared/package-version-C47v64aB.js +4 -0
- package/dist/packem_shared/packument-HBVbyf7x.js +1 -0
- package/dist/packem_shared/pm-runner-C6eTANt1.js +1 -0
- package/dist/packem_shared/project-name-filter-CJ3XX2TI.js +7 -0
- package/dist/packem_shared/prompt-BSAy8SMH.js +1 -0
- package/dist/packem_shared/{provenance-CRBV9cko.js → provenance-D4Cza8cp.js} +1 -1
- package/dist/packem_shared/{readJsonSync-DuMMeB3s-B9cGBVbJ.js → readJsonSync-DweZd5ZA-0eZh9sGm.js} +1 -1
- package/dist/packem_shared/registry-keys-C0ez2VND.js +1 -0
- package/dist/packem_shared/{resolve-explicit-BX6aMYl-.js → resolve-explicit-BbT764KS.js} +1 -1
- package/dist/packem_shared/{resolve-runtime-COyiEML3.js → resolve-runtime-D_vZovbB.js} +1 -1
- package/dist/packem_shared/run-file-DyPFFN9U.js +1 -0
- package/dist/packem_shared/{runtime-check-fzDkedMW.js → runtime-check-D4um-yQq.js} +1 -1
- package/dist/packem_shared/s1ngularity-St6dhKiq.js +1 -0
- package/dist/packem_shared/scan-progress-q-N2JtIp.js +2 -0
- package/dist/packem_shared/selectors-Ce_6UAoY.js +3 -0
- package/dist/packem_shared/signatures-Dyeyg1q9.js +2 -0
- package/dist/packem_shared/subtree-DSm0QEoE.js +2 -0
- package/dist/packem_shared/target-merge-Cfy7c__2.js +11 -0
- package/dist/packem_shared/target-options-7XcbqGDe.js +1 -0
- package/dist/packem_shared/toolchain-C_pNMBM6.js +5 -0
- package/dist/packem_shared/typosquats-xzcAGPiM.js +1 -0
- package/dist/packem_shared/{use-measured-height-DfNxp6nf.js → use-measured-height-CBjN0fle.js} +1 -1
- package/dist/packem_shared/verify-Dve9PQj3.js +1 -0
- package/dist/packem_shared/{vis-update-app-De8JjZm0.js → vis-update-app-DMAC2pPf.js} +1 -1
- package/dist/packem_shared/vis-user-error-xmha3L4n.js +30 -0
- package/dist/packem_shared/watch-BXOOX7lx.js +1 -0
- package/dist/packem_shared/watch-loop-Q7UpkVbr.js +11 -0
- package/dist/release/core/package-managers/index.d.ts +2 -2
- package/dist/release/core/version-actions/index.d.ts +10 -10
- package/dist/release/index.d.ts +60 -60
- package/dist/release/plugin-sdk.d.ts +80 -80
- package/dist/release/presets.d.ts +148 -148
- package/dist/release/types.d.ts +840 -840
- package/dist/runtime/preload.js +1 -1
- package/index.d.ts +204 -204
- package/index.js +52 -52
- package/package.json +16 -16
- package/schemas/project.schema.json +4 -1
- package/schemas/vis-config.schema.json +9 -3
- package/dist/packem_shared/advisories-B76fBVL-.js +0 -1
- package/dist/packem_shared/affected-shas-BOeR4vEc.js +0 -1
- package/dist/packem_shared/ai-analysis-D7HOdUwd.js +0 -68
- package/dist/packem_shared/bin-CkfFJCAM.js +0 -1
- package/dist/packem_shared/build-scripts-CfAqHBlq.js +0 -1
- package/dist/packem_shared/cyclonedx--L7NbMBH.js +0 -4
- package/dist/packem_shared/failure-log-BZQqxffZ.js +0 -2
- package/dist/packem_shared/giget-DVTFJlbR.js +0 -2
- package/dist/packem_shared/glob-DMbPwGSj-D2Hk3lFG.js +0 -1
- package/dist/packem_shared/index-2LCHaVNX.js +0 -35
- package/dist/packem_shared/index-B0EsgdzO.js +0 -1
- package/dist/packem_shared/index-Bhzio2RB.js +0 -1
- package/dist/packem_shared/index-Bq6YEpiq.js +0 -28
- package/dist/packem_shared/index.server-qvZ-cy29.js +0 -2
- package/dist/packem_shared/lifecycle-BcCMt9wn.js +0 -2
- package/dist/packem_shared/lockfile-Cwt0Nwr0.js +0 -1
- package/dist/packem_shared/main-B3juSU5z.js +0 -1
- package/dist/packem_shared/manifests-BshBdSb-.js +0 -1
- package/dist/packem_shared/missing-package-json-Cu0iWMT2.js +0 -1
- package/dist/packem_shared/osv-bloom-DMhXP184.js +0 -2
- package/dist/packem_shared/package-version-TsxLc6w2.js +0 -4
- package/dist/packem_shared/packument-CtVAoNo7.js +0 -1
- package/dist/packem_shared/pm-runner-CfyxALPK.js +0 -1
- package/dist/packem_shared/prompt-DjXHVgYU.js +0 -1
- package/dist/packem_shared/registry-keys-Ci2keQNi.js +0 -1
- package/dist/packem_shared/run-file-CTJfIZ0I.js +0 -1
- package/dist/packem_shared/s1ngularity-Cq1cCSpU.js +0 -1
- package/dist/packem_shared/scan-progress-DQ9qIGzr.js +0 -2
- package/dist/packem_shared/selectors-B9dOMIMq.js +0 -3
- package/dist/packem_shared/signatures-DvD1E8Xa.js +0 -2
- package/dist/packem_shared/subtree-C7bZuiSQ.js +0 -2
- package/dist/packem_shared/target-merge-Dg25Izl5.js +0 -11
- package/dist/packem_shared/target-options-aPqByoww.js +0 -1
- package/dist/packem_shared/toolchain-CiaW3bx4.js +0 -5
- package/dist/packem_shared/typosquats-CRnvlYPw.js +0 -1
- package/dist/packem_shared/verify-23b6IfSg.js +0 -1
- package/dist/packem_shared/watch-B3P2dwoG.js +0 -1
- package/dist/packem_shared/watch-loop-B3_O8hF-.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 !== '
|
|
85
|
-
throw new Error(`Native binding package version mismatch, expected 2.0.
|
|
84
|
+
if (bindingPackageVersion !== '2.0.1' && 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 2.0.2 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 !== '
|
|
101
|
-
throw new Error(`Native binding package version mismatch, expected 2.0.
|
|
100
|
+
if (bindingPackageVersion !== '2.0.1' && 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 2.0.2 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 !== '
|
|
122
|
-
throw new Error(`Native binding package version mismatch, expected 2.0.
|
|
121
|
+
if (bindingPackageVersion !== '2.0.1' && 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 2.0.2 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 !== '
|
|
138
|
-
throw new Error(`Native binding package version mismatch, expected 2.0.
|
|
137
|
+
if (bindingPackageVersion !== '2.0.1' && 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 2.0.2 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 !== '
|
|
155
|
-
throw new Error(`Native binding package version mismatch, expected 2.0.
|
|
154
|
+
if (bindingPackageVersion !== '2.0.1' && 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 2.0.2 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 !== '
|
|
171
|
-
throw new Error(`Native binding package version mismatch, expected 2.0.
|
|
170
|
+
if (bindingPackageVersion !== '2.0.1' && 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 2.0.2 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 !== '
|
|
190
|
-
throw new Error(`Native binding package version mismatch, expected 2.0.
|
|
189
|
+
if (bindingPackageVersion !== '2.0.1' && 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 2.0.2 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 !== '
|
|
206
|
-
throw new Error(`Native binding package version mismatch, expected 2.0.
|
|
205
|
+
if (bindingPackageVersion !== '2.0.1' && 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 2.0.2 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 !== '
|
|
222
|
-
throw new Error(`Native binding package version mismatch, expected 2.0.
|
|
221
|
+
if (bindingPackageVersion !== '2.0.1' && 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 2.0.2 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 !== '
|
|
242
|
-
throw new Error(`Native binding package version mismatch, expected 2.0.
|
|
241
|
+
if (bindingPackageVersion !== '2.0.1' && 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 2.0.2 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 !== '
|
|
258
|
-
throw new Error(`Native binding package version mismatch, expected 2.0.
|
|
257
|
+
if (bindingPackageVersion !== '2.0.1' && 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 2.0.2 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 !== '
|
|
279
|
-
throw new Error(`Native binding package version mismatch, expected 2.0.
|
|
278
|
+
if (bindingPackageVersion !== '2.0.1' && 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 2.0.2 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 !== '
|
|
295
|
-
throw new Error(`Native binding package version mismatch, expected 2.0.
|
|
294
|
+
if (bindingPackageVersion !== '2.0.1' && 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 2.0.2 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 !== '
|
|
313
|
-
throw new Error(`Native binding package version mismatch, expected 2.0.
|
|
312
|
+
if (bindingPackageVersion !== '2.0.1' && 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 2.0.2 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 !== '
|
|
329
|
-
throw new Error(`Native binding package version mismatch, expected 2.0.
|
|
328
|
+
if (bindingPackageVersion !== '2.0.1' && 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 2.0.2 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 !== '
|
|
347
|
-
throw new Error(`Native binding package version mismatch, expected 2.0.
|
|
346
|
+
if (bindingPackageVersion !== '2.0.1' && 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 2.0.2 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 !== '
|
|
363
|
-
throw new Error(`Native binding package version mismatch, expected 2.0.
|
|
362
|
+
if (bindingPackageVersion !== '2.0.1' && 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 2.0.2 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 !== '
|
|
381
|
-
throw new Error(`Native binding package version mismatch, expected 2.0.
|
|
380
|
+
if (bindingPackageVersion !== '2.0.1' && 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 2.0.2 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 !== '
|
|
397
|
-
throw new Error(`Native binding package version mismatch, expected 2.0.
|
|
396
|
+
if (bindingPackageVersion !== '2.0.1' && 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 2.0.2 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 !== '
|
|
415
|
-
throw new Error(`Native binding package version mismatch, expected 2.0.
|
|
414
|
+
if (bindingPackageVersion !== '2.0.1' && 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 2.0.2 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 !== '
|
|
431
|
-
throw new Error(`Native binding package version mismatch, expected 2.0.
|
|
430
|
+
if (bindingPackageVersion !== '2.0.1' && 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 2.0.2 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 !== '
|
|
448
|
-
throw new Error(`Native binding package version mismatch, expected 2.0.
|
|
447
|
+
if (bindingPackageVersion !== '2.0.1' && 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 2.0.2 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 !== '
|
|
464
|
-
throw new Error(`Native binding package version mismatch, expected 2.0.
|
|
463
|
+
if (bindingPackageVersion !== '2.0.1' && 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 2.0.2 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 !== '
|
|
484
|
-
throw new Error(`Native binding package version mismatch, expected 2.0.
|
|
483
|
+
if (bindingPackageVersion !== '2.0.1' && 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 2.0.2 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 !== '
|
|
500
|
-
throw new Error(`Native binding package version mismatch, expected 2.0.
|
|
499
|
+
if (bindingPackageVersion !== '2.0.1' && 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 2.0.2 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 !== '
|
|
516
|
-
throw new Error(`Native binding package version mismatch, expected 2.0.
|
|
515
|
+
if (bindingPackageVersion !== '2.0.1' && 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 2.0.2 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": "2.0.
|
|
3
|
+
"version": "2.0.2",
|
|
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",
|
|
@@ -115,13 +115,13 @@
|
|
|
115
115
|
"LICENSE.md"
|
|
116
116
|
],
|
|
117
117
|
"dependencies": {
|
|
118
|
-
"@visulima/error": "6.
|
|
119
|
-
"@visulima/secret-scanner": "1.
|
|
120
|
-
"@visulima/source-map": "3.0.
|
|
121
|
-
"@visulima/tabular": "4.
|
|
122
|
-
"@visulima/task-runner": "1.0.
|
|
123
|
-
"@visulima/tui": "
|
|
124
|
-
"@visulima/tui-kit": "1.0.
|
|
118
|
+
"@visulima/error": "6.1.0",
|
|
119
|
+
"@visulima/secret-scanner": "1.1.0",
|
|
120
|
+
"@visulima/source-map": "3.0.1",
|
|
121
|
+
"@visulima/tabular": "4.1.0",
|
|
122
|
+
"@visulima/task-runner": "1.0.3",
|
|
123
|
+
"@visulima/tui": "3.0.0",
|
|
124
|
+
"@visulima/tui-kit": "1.0.2",
|
|
125
125
|
"module-replacements": "^2.11.0",
|
|
126
126
|
"module-replacements-codemods": "^2.0.1",
|
|
127
127
|
"react": "19.2.7",
|
|
@@ -148,14 +148,14 @@
|
|
|
148
148
|
}
|
|
149
149
|
},
|
|
150
150
|
"optionalDependencies": {
|
|
151
|
-
"@visulima/vis-binding-darwin-arm64": "2.0.
|
|
152
|
-
"@visulima/vis-binding-darwin-x64": "2.0.
|
|
153
|
-
"@visulima/vis-binding-linux-
|
|
154
|
-
"@visulima/vis-binding-linux-arm64-musl": "2.0.
|
|
155
|
-
"@visulima/vis-binding-linux-
|
|
156
|
-
"@visulima/vis-binding-
|
|
157
|
-
"@visulima/vis-binding-
|
|
158
|
-
"@visulima/vis-binding-win32-
|
|
151
|
+
"@visulima/vis-binding-darwin-arm64": "2.0.2",
|
|
152
|
+
"@visulima/vis-binding-darwin-x64": "2.0.2",
|
|
153
|
+
"@visulima/vis-binding-linux-arm64-gnu": "2.0.2",
|
|
154
|
+
"@visulima/vis-binding-linux-arm64-musl": "2.0.2",
|
|
155
|
+
"@visulima/vis-binding-linux-x64-gnu": "2.0.2",
|
|
156
|
+
"@visulima/vis-binding-linux-x64-musl": "2.0.2",
|
|
157
|
+
"@visulima/vis-binding-win32-arm64-msvc": "2.0.2",
|
|
158
|
+
"@visulima/vis-binding-win32-x64-msvc": "2.0.2"
|
|
159
159
|
},
|
|
160
160
|
"engines": {
|
|
161
161
|
"node": "^22.14.0 || >=24.10.0"
|
|
@@ -26,7 +26,10 @@
|
|
|
26
26
|
"scaffolding",
|
|
27
27
|
"tool"
|
|
28
28
|
],
|
|
29
|
-
"description": "
|
|
29
|
+
"description": "Architectural layer this project sits in. Purely declarative — set it here in `project.json` and nothing infers it, which is why the `Layer` column in `vis list` reads `—` until you do.\n\nOnce set it becomes queryable (`--query \"layer=library\"`) and feeds `constraints`, where it is the natural way to express rules like \"nothing in `library` may depend on an `application`\".",
|
|
30
|
+
"examples": [
|
|
31
|
+
"library"
|
|
32
|
+
]
|
|
30
33
|
},
|
|
31
34
|
"name": {
|
|
32
35
|
"type": "string",
|
|
@@ -1808,7 +1808,7 @@
|
|
|
1808
1808
|
},
|
|
1809
1809
|
"sharedWorktreeCache": {
|
|
1810
1810
|
"type": "boolean",
|
|
1811
|
-
"description": "Share the cache between sibling git worktrees. When the workspace is a linked worktree (created with `git worktree add`), the cache root is relocated from `<linkedRoot
|
|
1811
|
+
"description": "Share the cache between sibling git worktrees. When the workspace is a linked worktree (created with `git worktree add`), the cache root is relocated from `<linkedRoot>/node_modules/.cache/vis` to the *main* worktree's `node_modules/.cache/vis`. Multiple parallel agents working in sibling worktrees then share a single cache instead of rebuilding the same hash N times.\n\nSingle-checkout repos (where `.git` is a directory) are unaffected.\n\nSet to `false` to opt out — useful when worktrees deliberately need independent caches, e.g. for hermetic experiments.",
|
|
1812
1812
|
"default": true
|
|
1813
1813
|
},
|
|
1814
1814
|
"sortPackageJson": {
|
|
@@ -5951,7 +5951,10 @@
|
|
|
5951
5951
|
"scaffolding",
|
|
5952
5952
|
"tool"
|
|
5953
5953
|
],
|
|
5954
|
-
"description": "
|
|
5954
|
+
"description": "Architectural layer this project sits in. Purely declarative — set it here in `project.json` and nothing infers it, which is why the `Layer` column in `vis list` reads `—` until you do.\n\nOnce set it becomes queryable (`--query \"layer=library\"`) and feeds `constraints`, where it is the natural way to express rules like \"nothing in `library` may depend on an `application`\".",
|
|
5955
|
+
"examples": [
|
|
5956
|
+
"library"
|
|
5957
|
+
]
|
|
5955
5958
|
},
|
|
5956
5959
|
{
|
|
5957
5960
|
"type": "array",
|
|
@@ -5985,7 +5988,10 @@
|
|
|
5985
5988
|
"not": {}
|
|
5986
5989
|
}
|
|
5987
5990
|
],
|
|
5988
|
-
"description": "
|
|
5991
|
+
"description": "Architectural layer this project sits in. Purely declarative — set it here in `project.json` and nothing infers it, which is why the `Layer` column in `vis list` reads `—` until you do.\n\nOnce set it becomes queryable (`--query \"layer=library\"`) and feeds `constraints`, where it is the natural way to express rules like \"nothing in `library` may depend on an `application`\".",
|
|
5992
|
+
"examples": [
|
|
5993
|
+
"library"
|
|
5994
|
+
]
|
|
5989
5995
|
}
|
|
5990
5996
|
}
|
|
5991
5997
|
],
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{createRequire as D}from"node:module";import{w as L}from"./target-merge-Dg25Izl5.js";import{advisoriesQuery as M,advisoriesIngest as W,advisoriesStatus as A,NATIVE_BINDING_VERSION as w}from"#native";const R=D(import.meta.url),l=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,c=s=>{if(typeof l<"u"&&l.versions&&l.versions.node){const[e,t]=l.versions.node.split(".").map(Number);if(e>22||e===22&&t>=3||e===20&&t>=16)return l.getBuiltinModule(s)}return R(s)},{randomUUID:I}=c("node:crypto"),{existsSync:$,createWriteStream:T}=c("node:fs"),{mkdir:O,unlink:P,stat:U}=c("node:fs/promises"),{join:g,dirname:k}=c("node:path"),{Readable:x}=c("node:stream"),{pipeline:C}=c("node:stream/promises"),f=6;if(w!==f)throw new Error(`vis native binding ABI mismatch in advisories: expected ${f}, got ${w}. Rebuild via \`pnpm --filter @visulima/vis run build:native\` or reinstall the platform binding package.`);const Q="https://osv-vulnerabilities.storage.googleapis.com",j=new Set(["osv-vulnerabilities.storage.googleapis.com"]);class q extends Error{cause="DB_NOT_FOUND";constructor(e){super(`No local advisory DB at ${e}. Run 'vis advisories sync' first.`),this.name="AdvisoryDbNotFoundError"}}class p extends Error{cause="SOURCE_NOT_ALLOWED";constructor(e){super(`Advisory source host '${e}' is not in the built-in allowlist. Add it to \`security.audit.advisories.allowedHosts\` if intentional.`),this.name="AdvisorySourceNotAllowedError"}}class E extends Error{cause="SYNC_NETWORK";constructor(e,t){super(`Advisory sync failed for ${e}: ${t}. Check connectivity, proxy env vars, or --source.`),this.name="AdvisorySyncNetworkError"}}const y=s=>{const e=L("vis",{create:!0,cwd:s})??g(s,"node_modules",".cache","vis");return g(e,"advisories","db.sqlite")},B=(s,e)=>{let t;try{t=new URL(s)}catch{throw new p(s)}if(t.protocol!=="https:")throw new p(`${t.protocol}//${t.host}`);if(!new Set([...j,...e??[]]).has(t.host))throw new p(t.host);return t},J=async s=>{const e=s.dbPath??y(s.workspaceRoot);await O(k(e),{recursive:!0});const t=B(s.source,s.allowedHosts),d=new URL(`${s.ecosystem}/all.zip`,z(t.toString())),u=await V(e,s.ecosystem);let r=null;if(!s.force){const i=await b(d,{method:"HEAD"});if(i.ok&&(r=i.headers.get("etag"),r&&u&&r===u))return{advisoriesIngested:0,dbPath:e,durationMs:0,upToDate:!0}}const n=`${e}.${s.ecosystem}.${process.pid}.${I()}.zip.tmp`,o=await b(d,{method:"GET"});if(!o.ok||!o.body)throw new E(d.toString(),o.status);r||(r=o.headers.get("etag"));const v=o.headers.get("content-length"),a=v?Number.parseInt(v,10):null;let m=0;const _=T(n),h=x.fromWeb(o.body);s.onProgress&&a&&h.on("data",i=>{m+=i.byteLength,s.onProgress?.(m,a,"download")}),await C(h,_);try{const i=await W({dbPath:e,ecosystem:s.ecosystem,manifestEtag:r??void 0,zipPath:n},(S,N)=>s.onProgress?.(S,N,"ingest"));return{advisoriesIngested:i.advisoriesIngested,dbPath:e,durationMs:i.durationMs,upToDate:!1}}finally{await P(n).catch(()=>{})}},X=(s,e)=>{if(s.length===0)return new Map;const t=e.dbPath??y(e.workspaceRoot),d=e.ecosystem??"npm";if(!$(t))throw new q(t);const u=s.map(o=>({ecosystem:d,name:o.name,version:o.version})),r=M(t,u),n=new Map;for(const[o,v]of s.entries()){const a=r[o];!a||a.vulnerabilities.length===0||n.set(v.name,a.vulnerabilities.map(m=>H(m)))}return n},Z=async(s,e)=>{const t=e??y(s);return A(t)},V=async(s,e)=>{try{await U(s)}catch{return null}return A(s).ecosystems.find(t=>t.name===e)?.manifestEtag??null},H=s=>({aliases:s.aliases.length>0?s.aliases:void 0,cvssScore:s.cvssScore??void 0,fixedVersions:s.fixedVersions,id:s.id,severity:F(s.severity),summary:s.summary}),F=s=>{const e=s.toUpperCase();return e==="CRITICAL"||e==="HIGH"||e==="MODERATE"||e==="LOW"?e:"UNKNOWN"},z=s=>s.endsWith("/")?s:`${s}/`,b=async(s,e)=>{try{return await fetch(s,e)}catch(t){throw new E(s.toString(),t instanceof Error?t.message:String(t))}};export{q as A,Q as D,Z as g,X as q,y as r,J as s};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{createRequire as l}from"node:module";import{f as g,v as h}from"./index-2LCHaVNX.js";const E=l(import.meta.url),_=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,d=e=>{if(typeof _<"u"&&_.versions&&_.versions.node){const[s,r]=_.versions.node.split(".").map(Number);if(s>22||s===22&&r>=3||s===20&&r>=16)return _.getBuiltinModule(e)}return E(e)},{spawnSync:p}=d("node:child_process"),b="0000000000000000000000000000000000000000",A=e=>{if(g(e))try{const s=h(e);return JSON.parse(s)}catch{return}},f=(e,s)=>{const r=p("git",e,{cwd:s,encoding:"utf8"});if(!(r.error||typeof r.status!="number"||r.status!==0))return typeof r.stdout=="string"?r.stdout.trim():void 0},c=e=>typeof e=="string"&&e.length>0&&e!==b,I=(e,s,r)=>{const i=[],o=e.GITHUB_BASE_REF,t=e.GITHUB_SHA??"HEAD";if(o&&o.length>0)return i.push(`pull_request: $GITHUB_BASE_REF=${o}`),{base:`origin/${o}`,head:t,notes:i,provider:"github"};const a=e.GITHUB_EVENT_PATH,n=a?r(a):void 0;if(n){const u=typeof n.before=="string"?n.before:void 0;if(c(u))return i.push(`push: event.before=${u}`),{base:u,head:t,notes:i,provider:"github"}}return i.push(`fallback: origin/${s}`),{base:`origin/${s}`,head:t,notes:i,provider:"github"}},R=(e,s)=>{const r=[],i=e.CI_COMMIT_SHA??"HEAD";if(e.CI_PIPELINE_SOURCE==="merge_request_event"){const a=e.CI_MERGE_REQUEST_DIFF_BASE_SHA;if(c(a))return r.push(`merge_request: $CI_MERGE_REQUEST_DIFF_BASE_SHA=${a}`),{base:a,head:i,notes:r,provider:"gitlab"};const n=e.CI_MERGE_REQUEST_TARGET_BRANCH_NAME;if(n&&n.length>0)return r.push(`merge_request: $CI_MERGE_REQUEST_TARGET_BRANCH_NAME=${n}`),{base:`origin/${n}`,head:i,notes:r,provider:"gitlab"}}const o=e.CI_COMMIT_BEFORE_SHA;if(c(o))return r.push(`push: $CI_COMMIT_BEFORE_SHA=${o}`),{base:o,head:i,notes:r,provider:"gitlab"};const t=e.CI_DEFAULT_BRANCH??s;return r.push(`fallback: origin/${t}`),{base:`origin/${t}`,head:i,notes:r,provider:"gitlab"}},C=(e,s)=>{const r=[],i=e.BUILDKITE_COMMIT??"HEAD",o=e.BUILDKITE_PULL_REQUEST_BASE_BRANCH;return o&&o.length>0?(r.push(`pull_request: $BUILDKITE_PULL_REQUEST_BASE_BRANCH=${o}`),{base:`origin/${o}`,head:i,notes:r,provider:"buildkite"}):(r.push(`fallback: origin/${s} (buildkite has no canonical previous-build SHA env)`),{base:`origin/${s}`,head:i,notes:r,provider:"buildkite"})},v=(e,s)=>{const r=[],i=e.CIRCLE_SHA1??"HEAD",o=e.CIRCLE_PR_BASE_BRANCH;return o&&o.length>0?(r.push(`pull_request: $CIRCLE_PR_BASE_BRANCH=${o}`),{base:`origin/${o}`,head:i,notes:r,provider:"circleci"}):(r.push(`fallback: origin/${s} (circleci has no canonical previous-build SHA env)`),{base:`origin/${s}`,head:i,notes:r,provider:"circleci"})},T=(e,s,r)=>{const i=[],o=s(["merge-base","HEAD",`origin/${e}`],r);return o&&o.length>0?(i.push(`local: git merge-base HEAD origin/${e}=${o}`),{base:o,head:"HEAD",notes:i,provider:"local"}):(i.push(`local fallback: origin/${e} (no merge-base available)`),{base:`origin/${e}`,head:"HEAD",notes:i,provider:"local"})},H=e=>{const s=e?.env??process.env,r=e?.defaultBase??"main",i=e?.readEventPayload??A,o=e?.runGit??f,t=e?.workspaceRoot??process.cwd();return s.GITHUB_ACTIONS==="true"?I(s,r,i):s.GITLAB_CI==="true"?R(s,r):s.BUILDKITE==="true"?C(s,r):s.CIRCLECI==="true"?v(s,r):T(r,o,t)};export{H as r};
|
|
@@ -1,68 +0,0 @@
|
|
|
1
|
-
import{createRequire as X}from"node:module";import{h as te,d as h,m as ae,g as E}from"../packem_chunks/catalog.js";import"./en-C26W78--.js";import{Table as ne}from"@visulima/tui-kit/table";import{Q as ie,T as re,U as se,V as oe}from"../packem_chunks/cli-main.js";const Q=X(import.meta.url),k=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,R=e=>{if(typeof k<"u"&&k.versions&&k.versions.node){const[t,a]=k.versions.node.split(".").map(Number);if(t>22||t===22&&a>=3||t===20&&a>=16)return k.getBuiltinModule(e)}return Q(e)},{execFile:x,spawn:Z,execFileSync:G}=R("node:child_process"),{existsSync:N}=R("node:fs"),{platform:ee,homedir:j}=R("node:os"),{join:g}=R("node:path"),{promisify:H}=R("node:util"),ce=/v?(\d+\.\d+\.\d+(?:-[\w.]+)?)/,de=5e3,le=1e4,ue=3e5,pe=4096,C=ee()==="win32",V=["amp","claude","codex","copilot","crush","cursor","droid","gemini","kimi","opencode","qwen"],me={alternateCommands:[],buildArgs:(e,{dangerous:t})=>{const a=["-x",e];return t&&a.push("--dangerously-allow-all"),a},command:"amp",defaultModel:"",displayName:"Amp",envVariable:"AMP_PATH",sessionMarkers:[{confidence:"definite",variable:"AMP_CURRENT_THREAD_ID"},{confidence:"definite",equals:"amp",variable:"AGENT"}],supportsMaxTokens:!1,supportsModel:!1},fe={alternateCommands:[],buildArgs:(e,{dangerous:t,model:a})=>{const n=[];return t&&n.push("--dangerously-skip-permissions"),a&&n.push("--model",a),n.push("--output-format","text","-p",e),n},command:"claude",defaultModel:"",displayName:"Claude Code",envVariable:"CLAUDE_PATH",sessionMarkers:[{confidence:"definite",variable:"CLAUDECODE"},{confidence:"definite",variable:"CLAUDE_CODE"}],supportsMaxTokens:!1,supportsModel:!0},ge={alternateCommands:["openai-codex"],buildArgs:(e,{dangerous:t,model:a})=>{const n=["exec"];return a&&n.push("--model",a),t&&n.push("--dangerously-bypass-approvals-and-sandbox"),n.push(e),n},command:"codex",defaultModel:"",displayName:"Codex",envVariable:"CODEX_PATH",sessionMarkers:[{confidence:"definite",variable:"CODEX_SANDBOX"},{confidence:"definite",variable:"CODEX_THREAD_ID"},{confidence:"definite",variable:"CODEX_CI"}],supportsMaxTokens:!1,supportsModel:!0},he={alternateCommands:[],buildArgs:(e,{dangerous:t,model:a})=>{const n=["-p",e];return t&&n.push("--allow-all-tools"),a&&n.push("--model",a),n},command:"copilot",defaultModel:"",displayName:"GitHub Copilot CLI",envVariable:"COPILOT_PATH",sessionMarkers:[{confidence:"definite",variable:"COPILOT_MODEL"},{confidence:"definite",variable:"COPILOT_ALLOW_ALL"},{confidence:"definite",variable:"COPILOT_GITHUB_TOKEN"},{agent:"GitHub Copilot in VS Code",confidence:"definite",label:"TERM_PROGRAM+GIT_PAGER",match:{all:[["TERM_PROGRAM","vscode"],["GIT_PAGER","cat"]],none:["CURSOR_TRACE_ID"]}}],supportsMaxTokens:!1,supportsModel:!0},be={alternateCommands:[],buildArgs:(e,{dangerous:t,model:a})=>{const n=["run"];return t&&n.push("--yolo"),a&&n.push("-m",a),n.push(e),n},command:"crush",defaultModel:"",displayName:"Crush",envVariable:"CRUSH_PATH",sessionMarkers:[{confidence:"definite",equals:"1",variable:"CRUSH"},{confidence:"definite",equals:"crush",variable:"AGENT"}],supportsMaxTokens:!1,supportsModel:!0},ve={alternateCommands:["cursor"],buildArgs:(e,{dangerous:t,model:a})=>{const n=["-p"];return t&&n.push("--force"),n.push("--output-format","text"),a&&n.push("--model",a),n.push(e),n},command:"agent",defaultModel:"",displayName:"Cursor Agent",envVariable:"CURSOR_PATH",sessionMarkers:[{confidence:"definite",variable:"CURSOR_AGENT"},{confidence:"definite",label:"CURSOR_TRACE_ID+PAGER",match:{all:["CURSOR_TRACE_ID",["PAGER","head -n 10000 | cat"]]}},{agent:"Cursor editor",confidence:"ambient",variable:"CURSOR_TRACE_ID"}],supportsMaxTokens:!1,supportsModel:!0},ye={alternateCommands:[],buildArgs:(e,{dangerous:t,model:a})=>{const n=[e];return t&&n.push("--skip-permissions-unsafe"),n.push("-o","text"),a&&n.push("-m",a),n},command:"droid",defaultModel:"",displayName:"Droid",envVariable:"DROID_PATH",sessionMarkers:[],supportsMaxTokens:!1,supportsModel:!0},Ee={alternateCommands:["gemini-cli"],buildArgs:(e,{dangerous:t,maxTokens:a,model:n})=>{const i=[];return t||i.push("--sandbox"),n&&i.push("--model",n),i.push("--max-output-tokens",String(a),"-p",e),i},command:"gemini",defaultModel:"gemini-2.5-pro",displayName:"Gemini CLI",envVariable:"GEMINI_PATH",sessionMarkers:[{confidence:"definite",label:"GEMINI_CLI",match:{all:["GEMINI_CLI"],none:["QWEN_CODE"]}}],supportsMaxTokens:!0,supportsModel:!0},Ae={alternateCommands:[],buildArgs:(e,{model:t})=>{const a=["--quiet","-p",e];return t&&a.push("-m",t),a},command:"kimi",defaultModel:"",displayName:"Kimi CLI",envVariable:"KIMI_PATH",sessionMarkers:[],supportsMaxTokens:!1,supportsModel:!0},ke={alternateCommands:[],buildArgs:(e,{model:t})=>{const a=["run",e];return t&&a.push("-m",t),a},command:"opencode",defaultModel:"",displayName:"opencode",envVariable:"OPENCODE_PATH",sessionMarkers:[{confidence:"definite",label:"OPENCODE",match:{any:["OPENCODE","OPENCODE_BIN_PATH","OPENCODE_SERVER","OPENCODE_APP_INFO","OPENCODE_MODES","OPENCODE_CLIENT"]}}],supportsMaxTokens:!1,supportsModel:!0},Re={alternateCommands:["qwen-code"],buildArgs:(e,{dangerous:t,model:a})=>{const n=["-p",e];return t&&n.push("--yolo"),n.push("-o","text"),a&&n.push("-m",a),n},command:"qwen",defaultModel:"",displayName:"Qwen Code",envVariable:"QWEN_PATH",sessionMarkers:[{confidence:"definite",equals:"1",variable:"QWEN_CODE"}],supportsMaxTokens:!1,supportsModel:!0},w={amp:me,claude:fe,codex:ge,copilot:he,crush:be,cursor:ve,droid:ye,gemini:Ee,kimi:Ae,opencode:ke,qwen:Re};class A extends Error{exitCode;durationMs;provider;stderr;stdout;timedOut;aborted;constructor(t,a){super(t),this.name="AiRunError",this.provider=a.provider,this.exitCode=a.exitCode??null,this.durationMs=a.durationMs,this.stdout=a.stdout??"",this.stderr=a.stderr??"",this.timedOut=a.timedOut??!1,this.aborted=a.aborted??!1}}H(x);const Me=[{agent:"Cline",confidence:"definite",variable:"CLINE_ACTIVE"},{agent:"Aider",confidence:"definite",label:"OR_APP_NAME|AIDER_API_KEY",match:{any:[["OR_APP_NAME","Aider"],"AIDER_API_KEY"]}},{agent:"Antigravity",confidence:"definite",label:"ANTIGRAVITY_AGENT",match:{any:["ANTIGRAVITY_AGENT","ANTIGRAVITY_PROJECT_ID"]}},{agent:"Augment",confidence:"definite",variable:"AUGMENT_AGENT"},{agent:"Windsurf",confidence:"definite",variable:"CODEIUM_EDITOR_APP_ROOT"},{agent:"Warp",confidence:"definite",variable:"OZ_RUN_ID"},{agent:"Pi",confidence:"definite",equals:"true",variable:"PI_CODING_AGENT"},{agent:"Jules",confidence:"definite",label:"HOME+USER",match:{all:[["HOME","/home/jules"],["USER","swebot"]]}},{agent:"Replit Agent",confidence:"definite",variable:"REPLIT_CLI"},{agent:"Replit Assistant",confidence:"definite",label:"REPL_ID+REPLIT_MODE",match:{all:["REPL_ID",["REPLIT_MODE","assistant"]]}},{agent:"Bolt.new",confidence:"definite",label:"SHELL+npm_config_yes",match:{all:[["SHELL","/bin/jsh"],"npm_config_yes"]}},{agent:"Zed",confidence:"definite",label:"TERM_PROGRAM+PAGER",match:{all:[["TERM_PROGRAM","zed"],["PAGER","cat"]]}},{agent:"Replit workspace",confidence:"ambient",label:"REPL_ID",match:{all:["REPL_ID"],none:[["REPLIT_MODE","assistant"]]}},{agent:"Bolt.new editor",confidence:"ambient",label:"SHELL",match:{all:[["SHELL","/bin/jsh"]],none:["npm_config_yes"]}},{agent:"Zed editor",confidence:"ambient",label:"TERM_PROGRAM",match:{all:[["TERM_PROGRAM","zed"]],none:[["PAGER","cat"]]}}],_e={ambient:"interactive",definite:"agent"},q=(e,t,a)=>{const n={agent:e.agent??t,confidence:e.confidence,provider:a,type:e.type??_e[e.confidence]};return"match"in e?{...n,label:e.label,match:e.match}:{...n,label:e.variable,match:e.equals===void 0?e.variable:[e.variable,e.equals]}},we=(e,t)=>t.sessionMarkers.map(a=>q(a,t.displayName,e));[...Object.keys(w).flatMap(e=>we(e,w[e])),...Me.map(e=>q(e,e.agent,e.provider))].toSorted((e,t)=>e.confidence===t.confidence?0:e.confidence==="definite"?-1:1);H(x);const Ce=/\.(?:bat|cmd)$/i,U=e=>C&&Ce.test(e),$=e=>`"${e.replaceAll('"','""')}"`,L=e=>e==="~"||e.startsWith("~/")||C&&e.startsWith("~\\")?g(j(),e.slice(2)):e,Te=e=>{try{const t=G(C?"where":"which",[e],{encoding:"utf8",stdio:["pipe","pipe","pipe"],timeout:de}).trim().split(`
|
|
2
|
-
`)[0]?.trim();return t&&t.length>0?t:void 0}catch{return}},Ie=e=>{const t=j();if(C){const a=process.env.APPDATA??"",n=process.env.LOCALAPPDATA??"",i=process.env.ProgramFiles??"";return[g(a,"npm",`${e}.cmd`),g(a,"npm",e),g(n,"Programs",e,`${e}.exe`),g(i,e,`${e}.exe`),g(t,".npm-global","bin",`${e}.cmd`)]}return[`/opt/homebrew/bin/${e}`,`/usr/local/bin/${e}`,g(t,".npm-global","bin",e),g(t,".local","bin",e),g(t,".cargo","bin",e)]},Oe=e=>{try{const t=G(e,["--version"],{encoding:"utf8",shell:U(e),stdio:["pipe","pipe","pipe"],timeout:le}),a=ce.exec(t);return a?a[1]:void 0}catch{return}},F=(e,t={})=>{const a=w[e],n={available:!1,name:e},i=t.version!==!1,r=o=>{if(i)return Oe(o)},s=process.env[a.envVariable];if(s&&N(L(s))){const o=L(s);return{...n,available:!0,detectionMethod:"envvar",path:o,version:r(o)}}const d=[a.command,...a.alternateCommands];for(const o of d){const c=Te(o);if(c)return{...n,available:!0,detectionMethod:"which",path:c,version:r(c)}}for(const o of d)for(const c of Ie(o))if(N(c))return{...n,available:!0,detectionMethod:"known-path",path:c,version:r(c)};return n},Se=(e={})=>V.map(t=>F(t,e)),Pe=(e={})=>Se(e).filter(t=>t.available),Ne=(e,t,a={})=>{const n=w[e],i=a.model??n.defaultModel,r=a.maxTokens!==void 0&&Number.isFinite(a.maxTokens)?a.maxTokens:pe;return n.buildArgs(t,{dangerous:a.dangerous===!0,maxTokens:r,model:i})},$e=async(e,t,a={})=>{if(!e.available||!e.path)throw new A(`AI provider "${e.name}" is not available.`,{durationMs:0,provider:e.name});const n=Ne(e.name,t,a),i=a.timeoutMs!==void 0&&Number.isFinite(a.timeoutMs)?a.timeoutMs:ue,r=e.path,s=U(r),d=Date.now();if(a.signal?.aborted)throw new A(`${e.name} CLI run was aborted.`,{aborted:!0,durationMs:0,provider:e.name});return new Promise((o,c)=>{const m={cwd:a.cwd,env:{...process.env,...a.env,FORCE_COLOR:"0",NO_COLOR:"1"},shell:s,stdio:["pipe","pipe","pipe"]},u=s?n.map(l=>$(l)):n,f=Z(s?$(r):r,u,m);f.stdin?.end();let b="",v="",y=!1,O,S,M;const T=()=>{clearTimeout(S),clearTimeout(O),M&&a.signal?.removeEventListener("abort",M)},Y=()=>{f.kill("SIGKILL")},P=l=>{if(y)return;y=!0,f.kill("SIGTERM"),O=setTimeout(Y,5e3),T();const p=Date.now()-d,z=l?new A(`${e.name} CLI run was aborted.`,{aborted:!0,durationMs:p,provider:e.name,stderr:v,stdout:b}):new A(`${e.name} CLI timed out after ${String(i)}ms`,{durationMs:p,provider:e.name,stderr:v,stdout:b,timedOut:!0});c(z)};S=setTimeout(P,i,!1),M=()=>{P(!0)},a.signal?.addEventListener("abort",M,{once:!0}),f.stdout?.on("data",l=>{const p=l.toString("utf8");b+=p,a.onStdout?.(p)}),f.stderr?.on("data",l=>{const p=l.toString("utf8");v+=p,a.onStderr?.(p)}),f.on("close",l=>{if(y)return;y=!0,T();const p=Date.now()-d;l===0?o({durationMs:p,exitCode:l,provider:e.name,stderr:v,stdout:b}):c(new A(`${e.name} CLI exited with code ${String(l)}: ${v||b}`,{durationMs:p,exitCode:l,provider:e.name,stderr:v,stdout:b}))}),f.on("error",l=>{y||(y=!0,T(),c(new A(`Failed to spawn ${e.name} CLI: ${l.message}`,{durationMs:Date.now()-d,provider:e.name,stderr:v,stdout:b})))})})},Le=12e4,De=2,xe=1e3,Ge=e=>new Promise(t=>{setTimeout(t,e)}),B=async(e,t,a=De)=>{let n;for(let i=0;i<=a;i+=1)try{return(await $e(e,t,{timeoutMs:Le})).stdout}catch(r){if(n=r instanceof Error?r:new Error(String(r)),n.message.includes("timed out"))throw n;if(i<a){const s=xe*2**i;await Ge(s)}}throw n??new Error("AI request failed after retries")},je={amp:30,claude:80,codex:60,copilot:50,crush:35,cursor:40,droid:20,gemini:100,kimi:25,opencode:35,qwen:30},He=e=>{if(e?.provider){if(!V.includes(e.provider))return;const n=F(e.provider);return n.available?n:void 0}const t=Pe();if(t.length===0)return;const a={...je,...e?.priority};return t.toSorted((n,i)=>(a[i.name]??0)-(a[n.name]??0))[0]},Ve=new Set(["defer","review","skip","update"]),qe=new Set(["critical","high","low","medium"]),Ue=new Set(["high","low","medium"]),Fe=50,I=30,Be=e=>e.map(t=>{const a=t.vulnerabilities&&t.vulnerabilities.length>0?` [VULNERABILITIES: ${t.vulnerabilities.map(i=>`${i.severity} ${i.id}`).join(", ")}]`:"";let n="";if(t.socketReport){const i=Math.round(t.socketReport.score.overall*100),r=[`score:${String(i)}%`];if(t.socketReport.alerts.length>0){const s={};for(const o of t.socketReport.alerts)s[o.severity]=(s[o.severity]??0)+1;const d=Object.entries(s).map(([o,c])=>`${String(c)} ${o}`).join(", ");r.push(`alerts: ${d}`)}r.push(`supply-chain:${String(Math.round(t.socketReport.score.supplyChain*100))}%`),r.push(`quality:${String(Math.round(t.socketReport.score.quality*100))}%`),n=` [SOCKET.DEV: ${r.join(", ")}]`}return`- ${t.packageName}: ${t.currentRange} → ${t.newRange} (${t.updateType})${a}${n}`}).join(`
|
|
3
|
-
`),_=`Respond ONLY with valid JSON in this exact structure:
|
|
4
|
-
{
|
|
5
|
-
"summary": "Brief overall summary",
|
|
6
|
-
"recommendations": [
|
|
7
|
-
{
|
|
8
|
-
"package": "package-name",
|
|
9
|
-
"action": "update|skip|review|defer",
|
|
10
|
-
"reason": "explanation",
|
|
11
|
-
"riskLevel": "low|medium|high|critical",
|
|
12
|
-
"breakingChanges": ["change1"],
|
|
13
|
-
"effort": "low|medium|high"
|
|
14
|
-
}
|
|
15
|
-
],
|
|
16
|
-
"warnings": ["warning1"]
|
|
17
|
-
}`,We={compatibility:e=>`Analyze the compatibility of these package updates:
|
|
18
|
-
|
|
19
|
-
${e}
|
|
20
|
-
|
|
21
|
-
For each package:
|
|
22
|
-
1. Check peer dependency compatibility
|
|
23
|
-
2. Identify potential conflicts with other packages in the list
|
|
24
|
-
3. Assess API compatibility between current and target versions
|
|
25
|
-
4. Check for deprecated features being removed
|
|
26
|
-
5. Evaluate Node.js version requirements
|
|
27
|
-
|
|
28
|
-
${_}`,impact:e=>`Analyze the impact of updating these npm packages:
|
|
29
|
-
|
|
30
|
-
${e}
|
|
31
|
-
|
|
32
|
-
For each package, provide:
|
|
33
|
-
1. Risk level (low/medium/high/critical)
|
|
34
|
-
2. Recommended action (update/skip/review/defer)
|
|
35
|
-
3. Reason for recommendation
|
|
36
|
-
4. Known breaking changes (if any)
|
|
37
|
-
5. Estimated migration effort (low/medium/high)
|
|
38
|
-
|
|
39
|
-
${_}`,recommend:e=>`Provide smart recommendations for updating these packages:
|
|
40
|
-
|
|
41
|
-
${e}
|
|
42
|
-
|
|
43
|
-
Consider:
|
|
44
|
-
1. Update priority based on security, features, and stability
|
|
45
|
-
2. Grouping related packages for atomic updates
|
|
46
|
-
3. Best practices for the specific package ecosystem
|
|
47
|
-
4. Risk vs. benefit analysis
|
|
48
|
-
5. Suggested update order
|
|
49
|
-
6. If Socket.dev scores are provided, prioritize packages with low supply chain or quality scores
|
|
50
|
-
|
|
51
|
-
${_}`,security:e=>`Analyze the security implications of these package updates:
|
|
52
|
-
|
|
53
|
-
${e}
|
|
54
|
-
|
|
55
|
-
For each package:
|
|
56
|
-
1. Check if the update fixes known vulnerabilities (use the vulnerability data above)
|
|
57
|
-
2. Assess if the new version introduces security risks
|
|
58
|
-
3. Evaluate if this is a security-sensitive package (auth, crypto, session, etc.)
|
|
59
|
-
4. Recommend urgency of the update based on vulnerability severity
|
|
60
|
-
5. Flag any packages where skipping the update poses security risk
|
|
61
|
-
6. If Socket.dev scores are provided, factor in supply chain and quality scores — low scores indicate higher risk
|
|
62
|
-
|
|
63
|
-
${_}`},Ke=new Set(["compatibility","impact","recommend","security"]),ot=e=>Ke.has(e)?e:"impact",W=(e,t="impact")=>{const a=Be(e);return We[t](a)},Je=/```(?:json)?\s*([\s\S]*?)```/,Ye=/\{[\s\S]*\}/,ze=e=>{try{return JSON.parse(e)}catch{}const t=Je.exec(e);if(t?.[1])try{return JSON.parse(t[1])}catch{}const a=Ye.exec(e);if(a?.[0])try{return JSON.parse(a[0])}catch{}},Xe=e=>({action:Ve.has(e.action)?e.action:"review",breakingChanges:Array.isArray(e.breakingChanges)?e.breakingChanges:[],effort:Ue.has(e.effort)?e.effort:"medium",package:typeof e.package=="string"?e.package:"",reason:typeof e.reason=="string"?e.reason:"",riskLevel:qe.has(e.riskLevel)?e.riskLevel:"medium"}),K=(e,t,a)=>{const n=ze(e);if(!n||typeof n!="object")return{analysisType:a,provider:t,recommendations:[],summary:"Failed to parse AI response.",warnings:["AI response was not valid JSON."]};const i=n,r=Array.isArray(i.recommendations)?i.recommendations:[];return{analysisType:a,provider:t,recommendations:r.map(s=>Xe(s)),summary:typeof i.summary=="string"?i.summary:"",warnings:Array.isArray(i.warnings)?i.warnings:[]}},Qe={eslint:["ESLint 9.0: Flat config required","ESLint 8.0+: New rule formats"],next:["Next.js 13+: App router changes","Next.js 14+: Server components default"],react:["React 17 to 18: Concurrent features","React 18+: Strict mode changes"],typescript:["TypeScript 5.0: New decorators","TypeScript 4.7+: ESM changes"],vite:["Vite 5: Node.js 18+ required"],vue:["Vue 3: Composition API","Vue 3: Breaking template changes"],webpack:["Webpack 5: Node.js polyfills removed"]},Ze=new Set(["bcrypt","cors","crypto-js","express-session","helmet","jose","jsonwebtoken","node-forge","oauth","passport"]),D=(e,t)=>{const a=e.map(n=>{const i=n.vulnerabilities&&n.vulnerabilities.length>0,r=Ze.has(n.packageName),s=Qe[n.packageName]??[];let d="low",o="update",c="low",m="Patch/minor update, safe to apply.";return n.updateType==="major"?(d="high",o=s.length>0?"review":"update",c="medium",m=s.length>0?`Major update with known breaking changes: ${s[0]}`:"Major version update, review changelog before applying."):n.updateType==="minor"&&(d="medium",m="Minor update, generally safe."),i&&(d="high",o="update",m="Security update — current version has known vulnerabilities."),r&&n.updateType==="major"&&(o="review",m="Security-sensitive package with major update, careful review needed.",c="high"),{action:o,breakingChanges:s,effort:c,package:n.packageName,reason:m,riskLevel:d}});return{analysisType:t,provider:"rule-engine",recommendations:a,summary:`Rule-based ${t} analysis for ${String(e.length)} packages.`,warnings:["No AI provider available — using built-in rule engine."]}},et=async(e,t,a)=>{const n=W(t,a),i=await B(e,n);return K(i,e.name,a)},tt=(e,t,a)=>{const n=[],i=[],r=[];for(const s of e)n.push(...s.recommendations),i.push(...s.warnings),s.summary&&r.push(s.summary);return{analysisType:a,provider:t,recommendations:n,summary:r.length===1?r[0]??"":`Analyzed ${String(n.length)} packages in ${String(e.length)} batches.`,warnings:[...new Set(i)]}},J={compatibility:"Compatibility",impact:"Impact",recommend:"Recommendations",security:"Security"},ct=e=>{const t=`${J[e.analysisType]??e.analysisType} Analysis (${e.provider})`,a=e.recommendations.flatMap(i=>{const r=[{action:i.action,effort:i.effort,package:i.package,reason:i.reason,risk:i.riskLevel}];return i.breakingChanges.length>0&&r.push({action:"",effort:"",package:"",reason:`Breaking: ${i.breakingChanges.join("; ")}`,risk:""}),r}),n=process.stdout.columns||80;return te(h.createElement(ae,{borderStyle:"round",flexDirection:"column",paddingLeft:1,paddingRight:1},h.createElement(E,{bold:!0},t),h.createElement(E,null,""),h.createElement(E,null,e.summary),h.createElement(E,null,""),h.createElement(ne,{borderStyle:"none",data:a}),...e.warnings.length>0?[h.createElement(E,null,""),...e.warnings.map((i,r)=>h.createElement(E,{dimColor:!0,key:String(r)},` ${i}`))]:[]),{columns:n})},dt=async(e,t,a,n="impact")=>{const i=He(a);if(!i)return t.info(`No AI CLI tool found, using rule-based analysis.
|
|
64
|
-
`),D(e,n);const r=ie(i.name,n,e),s=re(r);if(s)return t.info(`Using cached ${n} analysis from ${s.provider}.
|
|
65
|
-
`),s;const d=J[n]??n;t.info(`Running ${d.toLowerCase()} analysis with ${i.name}...
|
|
66
|
-
`);try{let o;if(e.length>Fe){t.info(`Splitting ${String(e.length)} packages into batches of ${String(I)}...
|
|
67
|
-
`);const c=[];for(let u=0;u<e.length;u+=I)c.push(e.slice(u,u+I));const m=[];for(let u=0;u<c.length;u+=1){t.info(` Batch ${String(u+1)}/${String(c.length)}...`);const f=c[u];f&&m.push(await et(i,f,n))}o=tt(m,i.name,n)}else{const c=await B(i,W(e,n));o=K(c,i.name,n)}return se(r,o,oe(n,a?.cacheTtl)),o}catch(o){const c=o instanceof Error?o.message:String(o);return t.warn(`AI analysis failed (${c}), falling back to rule engine.
|
|
68
|
-
`),D(e,n)}};export{Se as F,ot as K,He as R,je as S,ct as W,dt as Z,ze as b,$e as p,B as r};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{createRequire as g}from"node:module";import{c as b}from"./compile-cache-B_Vf_WxT.js";import{i as y,h as w,t as $,p as m,c as M,m as R}from"./package-version-TsxLc6w2.js";import{I as S}from"./index-B0EsgdzO.js";const _=g(import.meta.url),r=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,x=e=>{if(typeof r<"u"&&r.versions&&r.versions.node){const[s,o]=r.versions.node.split(".").map(Number);if(s>22||s===22&&o>=3||s===20&&o>=16)return r.getBuiltinModule(e)}return _(e)},{createRequire:T}=x("node:module"),O=T(import.meta.url),t=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,f=e=>{if(typeof t<"u"&&t.versions&&t.versions.node){const[s,o]=t.versions.node.split(".").map(Number);if(s>22||s===22&&o>=3||s===20&&o>=16)return t.getBuiltinModule(e)}return O(e)},{execFileSync:j}=f("node:child_process"),{totalmem:N}=f("node:os"),q=/--max-old-space-size=(\d+)/,z=/--max-semi-space-size=(\d+)/,C=e=>Math.floor(N()/1024/1024*e),B=e=>e<=512?4:e<=1024?8:e<=2048?16:e<=4096?32:e<=8192?64:Math.floor(Math.log2(e))*8,d=(e,s)=>{for(const o of s){const n=e.exec(o);if(n)return Number.parseInt(n[1],10)}},E=e=>{const o=[...M()],n=[...y()],a=d(q,o),p=d(z,o);if(a!==void 0&&p!==void 0)return;const l=a??C(.75),h=p??B(l),c=[];if(a===void 0&&c.push(`--max-old-space-size=${String(l)}`),p===void 0&&c.push(`--max-semi-space-size=${String(h)}`),c.length!==0)try{j(w(),[...c,...o,...n.slice(1)],{env:$(),stdio:"inherit"}),m(0)}catch(v){const u=v.status;m(typeof u=="number"?u:1)}},I=()=>{process.env.VIS_VERSION=R()},Y=e=>{!process.stdout.isTTY||S||process.env.TERM==="dumb"||process.stdout.write(`\x1B]0;${e}\x07`)},L=new Set(["","--help","--version","-h","-v","completion","dlx","exec","x"]),i=process.argv[2]??"";!L.has(i)&&!process.argv.includes("--help")&&!process.argv.includes("-h")&&E();process.argv.includes("--no-color")&&(process.env.NO_COLOR="1",process.env.FORCE_COLOR="0");I();b();(async()=>{if(i==="__pm-shim"){const{dispatchShim:s}=await import("../packem_chunks/dispatch.js");s(process.argv[3]??"",process.argv.slice(4));return}if(i==="x"){const{runLeanX:s}=await import("../packem_chunks/lean.js");await s(process.argv.slice(3));return}if(i==="exec"||i==="dlx"){const{runExecCli:s}=await import("../packem_chunks/cli-exec.js");await s();return}const{runCli:e}=await import("../packem_chunks/cli-main.js").then(s=>s.an);await e()})();export{Y as s};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{createRequire as j}from"node:module";import{m as h,f as y}from"./index-2LCHaVNX.js";import{a as q}from"./readJsonSync-DuMMeB3s-B9cGBVbJ.js";const $=j(import.meta.url),g=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,k=e=>{if(typeof g<"u"&&g.versions&&g.versions.node){const[s,n]=g.versions.node.split(".").map(Number);if(s>22||s===22&&n>=3||s===20&&n>=16)return g.getBuiltinModule(e)}return $(e)},{readdirSync:_,statSync:M}=k("node:fs"),w=["preinstall","install","postinstall","prepare"],x=e=>{const s=h(e,"node_modules");if(!y(s))return[];const n=new Map,o=(l,p="")=>{let u;try{u=_(l)}catch{return}for(const r of u){const i=h(l,r);if(r.startsWith("@")){o(i,`${r}/`);continue}if(r===".pnpm"&&p===""){let f;try{f=_(i)}catch{continue}for(const a of f){const c=h(i,a,"node_modules");y(c)&&o(c)}continue}if(r.startsWith("."))continue;const m=p+r,t=h(i,"package.json");try{if(!M(i).isDirectory()||!y(t))continue;const f=q(t),a=f.scripts??{},c=w.filter(v=>a[v]);!a.preinstall&&!a.install&&!a.postinstall&&y(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 f.version=="string"?f.version:void 0});const d=h(i,"node_modules");y(d)&&o(d)}catch{}}};return o(s),[...n.values()]},W=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)}},B=(e,s,n)=>{for(const[o,l]of Object.entries(s)){if(!l)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:p,version:u}=W(o);if(p===e.name&&(!n||u===void 0||e.version===u))return!0}return!1},O=(e,s,n={})=>{const o=n.pinVersions===!0,l=x(e),p=[],u=[],r=new Map(l.map(t=>[t.name,t]));for(const t of l)B(t,s,o)?u.push(t):p.push(t);const i=[],m=[];for(const[t,f]of Object.entries(s)){if(!f)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(b=>b.startsWith(v))||i.push(t);continue}const{name:a,version:c}=W(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:u,unapproved:p,versionDrift:m}},S=(e,s)=>O(e,s).unapproved.map(n=>`${n.name} (${n.hooks.join(", ")})`);export{O as W,S as w};
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import{createRequire as ie}from"node:module";import{m as E,v as ue}from"./index-2LCHaVNX.js";import{r as le}from"./docker-69ybb6g7.js";import{a as oe}from"./readJsonSync-DuMMeB3s-B9cGBVbJ.js";import{e as fe}from"./license-t5KnNX6v.js";import{D as de}from"./package-version-TsxLc6w2.js";import"./public-api-WqUCiyIe.js";import{u as he}from"./index-BAe6e0XE.js";const ae=ie(import.meta.url),P=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,se=e=>{if(typeof P<"u"&&P.versions&&P.versions.node){const[n,t]=P.versions.node.split(".").map(Number);if(n>22||n===22&&t>=3||n===20&&t>=16)return P.getBuiltinModule(e)}return ae(e)},{randomUUID:pe}=se("node:crypto"),{readdirSync:me}=se("node:fs"),X=e=>e.replaceAll(/[^\w.~-]/g,n=>`%${(n.codePointAt(0)??0).toString(16).toUpperCase().padStart(2,"0")}`),C=(e,n)=>{const t=e.toLowerCase();if(t.startsWith("@")){const s=t.indexOf("/");if(s>0){const r=t.slice(0,s),p=t.slice(s+1);return`pkg:npm/${X(r)}/${X(p)}@${X(n)}`}}return`pkg:npm/${X(t)}@${X(n)}`},m={ARRAY:"array",BOOLEAN:"boolean",DATE:"date",FUNCTION:"function",JSTOXML_OBJECT:"jstoxml-object",NULL:"null",NUMBER:"number",OBJECT:"object",STRING:"string"},_e=[m.STRING,m.NUMBER,m.BOOLEAN],ge='<?xml version="1.0" encoding="UTF-8"?>',ee=["_selfCloseTag","_attrs"],ye=(e="",n=0)=>e.repeat(n),Y=e=>Array.isArray(e)&&m.ARRAY||typeof e===m.OBJECT&&e!==null&&e._name&&m.JSTOXML_OBJECT||e instanceof Date&&m.DATE||e===null&&m.NULL||typeof e,re=e=>e.startsWith("<![CDATA["),ce=(e="",n={},t)=>{let s=e;if(typeof e===m.STRING){if(re(e))return e;const r=new RegExp(`(${Object.keys(n).join("|")})(?!(\\w|#)*;)`,"g");s=String(e).replace(r,(p,h)=>n[h]||"")}return typeof t=="function"?t(s):s},be=(e={},n,t,s)=>(Array.isArray(e)?e:Object.entries(e).map(([r,p])=>({[r]:p}))).reduce((r,p)=>{const h=Object.keys(p)[0],_=p[h];if(typeof t===m.FUNCTION&&t(h,_))return r;const y=n?ce(_,n):_,$=!s&&y===!0?"":`="${y}"`;return r.push(`${h}${$}`),r},[]),$e=(e={},n,t,s)=>{const r=be(e,n,t,s);return r.length===0?"":` ${r.join(" ")}`},Oe=(e={})=>Object.keys(e).map(n=>({_name:n,_content:e[n]})),ve=e=>_e.includes(Y(e)),je=e=>!e.match("<"),ke=({header:e,isOutputStart:n})=>e&&n?typeof e===m.BOOLEAN?ge:e:"",ne={"<":"<",">":">","&":"&",'"':"""},U=(e={},n={})=>{const{depth:t=0,indent:s,_isFirstItem:r,_isOutputStart:p=!0,header:h,attributeReplacements:_={},attributeFilter:y,attributeExplicitTrue:$=!1,contentReplacements:F={},contentMap:M,selfCloseTags:B=!0}=n,J=typeof _=="boolean"&&!_?{}:{...ne,..._},G=typeof F=="boolean"&&!F?{}:{...ne,...F},D=typeof s=="string",k=ye(s,t),W=Y(e),L=ke({header:h,isOutputStart:p}),N=p&&!L&&r&&t===0,R=D&&!N?`
|
|
2
|
-
`:"";let b="";switch(W){case m.JSTOXML_OBJECT:{const{_name:f,_content:u}=e;if(u===null&&typeof M!="function"){b=`${R}${k}${f}`;break}if(Array.isArray(u)&&u.every(ve))return u.map(j=>U({_name:f,_content:j},{...n,depth:t,_isOutputStart:!1})).join("");if(ee.includes(f))break;const g=U(u,{...n,depth:t+1,_isOutputStart:N}),w=Y(g),O=je(g),v=re(g),x=`${R}${k}`;if(f==="_comment"){b+=`${x}<!-- ${u} -->`;break}const H=w==="undefined"||g==="",c=B,o=e._selfCloseTag,a=typeof o===m.BOOLEAN?H&&o:H&&c,i=a?"/":"",l=$e(e._attrs,J,y,$),d=`<${f}${l}${i}>`,T=D&&!O&&!v?`
|
|
3
|
-
${k}`:"",S=a?"":`${g}${T}</${f}>`;b+=`${x}${d}${S}`;break}case m.OBJECT:{const f=Object.keys(e);b=f.map((u,g)=>{const w={...n,_isFirstItem:g===0,_isLastItem:g+1===f.length,_isOutputStart:N},O={_name:u};if(Y(e[u])===m.OBJECT&&(ee.forEach(v=>{const x=e[u][v];typeof x<"u"&&(O[v]=x,delete e[u][v])}),typeof e[u]._content<"u"&&Object.keys(e[u]).length>1)){const v=Object.assign({},e[u]);delete v._content,O._content=[...Oe(v),e[u]._content]}return typeof O._content>"u"&&(O._content=e[u]),U(O,w)},n).join("");break}case m.FUNCTION:{const f=e(n);b=U(f,n);break}case m.ARRAY:{b=e.map((f,u)=>{const g={...n,_isFirstItem:u===0,_isLastItem:u+1===e.length,_isOutputStart:N};return U(f,g)}).join("");break}default:{b=ce(e,G,M);break}}return`${L}${b}`},Q=e=>{try{return oe(e)}catch{return}},Te=e=>{if(e.length===0||e.includes("..")||e.startsWith(".")||e.includes("\0")||e.includes("\\"))return!1;if(e.startsWith("@")){const n=e.indexOf("/");return n>1&&!e.includes("/",n+1)}return!e.includes("/")},Se=e=>e.length>0&&!e.includes("/")&&!e.includes("\\")&&!e.includes("..")&&!e.includes("\0"),Ae=(e,n,t)=>{const s=`${n.replaceAll("/","+")}@${t}`,r=E(e,"node_modules",".pnpm"),p=Q(E(r,s,"node_modules",n,"package.json"));if(p)return p;let h;try{h=me(r)}catch{return}const _=`${s}_`;for(const y of h){if(!y.startsWith(_))continue;const $=Q(E(r,y,"node_modules",n,"package.json"));if($)return $}},we=(e,n,t)=>{const s=Q(E(e,"node_modules",n,"package.json"));return s?.version===t?s:void 0},xe=(e,n,t)=>{if(!(!Te(n)||!Se(t)))return Ae(e,n,t)??we(e,n,t)},De={sha256:"SHA-256",sha384:"SHA-384",sha512:"SHA-512"},Ne={sha256:64,sha384:96,sha512:128},Re=e=>{const n={name:e.name,version:e.version},{integrity:t}=e;return t&&t.hex.length===Ne[t.algorithm]&&(n.hash={alg:De[t.algorithm],content:t.hex}),e.dependencies&&(n.dependencies=e.dependencies),e.peerDependencies&&(n.peerDependencies=e.peerDependencies),e.optionalDependencies&&(n.optionalDependencies=e.optionalDependencies),n},Ce=[{file:"pnpm-lock.yaml",type:"pnpm"},{file:"npm-shrinkwrap.json",type:"npm"},{file:"package-lock.json",type:"npm"},{file:"yarn.lock",type:"yarn"},{file:"bun.lock",type:"bun"}],Ee=e=>{for(const{file:n,type:t}of Ce){let s;try{s=ue(E(e,n))}catch{continue}const r=new Map;for(const p of de(s,t))r.set(`${p.name}@${p.version}`,Re(p));return{packages:r,type:t}}},Me=e=>{const n=e.indexOf(":");return n<=0?e:e.slice(0,n)==="npm"?e.slice(n+1):e},V=(e,n,t)=>{const s=t.get(e);if(!s||s.size===0)return;if(s.has(n))return n;const r=Me(n);if(r!==n&&s.has(r))return r;const p=[...s];return he.maxSatisfying(p,r,{includePrerelease:!0})||p[0]},Be="1.7",Le="CycloneDX",Ie="http://cyclonedx.org/schema/bom-1.7.schema.json",Ue="@visulima/vis",te=e=>{try{return oe(e)}catch{return}},Fe=e=>{if(e){if(typeof e=="string")return e;if(typeof e=="object"&&e.name)return e.email?`${e.name} <${e.email}>`:e.name}},Je=e=>{if(e)return typeof e=="string"?e:e.url},qe=e=>{if(e)return typeof e=="string"?e:e.url},Pe=e=>{const n=[];e.homepage&&n.push({type:"website",url:e.homepage});const t=Je(e.repository);t&&n.push({type:"vcs",url:t});const s=qe(e.bugs);return s&&n.push({type:"issue-tracker",url:s}),n.length>0?n:void 0},Xe=e=>e==="application"||e==="service"||e==="tool"?"application":"library",K=(e,n)=>{if(!n)return;n.description&&(e.description=n.description);const t=Fe(n.author);t&&(e.author=t);const s=fe(n);s&&(e.licenses=s);const r=Pe(n);r&&(e.externalReferences=r)},tn=e=>{const{focus:n,generatorVersion:t,includeDev:s=!1,now:r=new Date,projectGraph:p,serialNumber:h,workspace:_,workspaceRoot:y}=e,$=n&&n.length>0?[...le(n,p)].sort():Object.keys(_.projects).sort(),F=new Set($),M=new Map;for(const c of $){const o=_.projects[c];o&&M.set(c,te(E(y,o.root,"package.json")))}const B=[],J=new Map;for(const c of $){const o=_.projects[c];if(!o)continue;const a=M.get(c),i=a?.version??"0.0.0",l=C(c,i);J.set(c,l);const d={"bom-ref":l,name:c,purl:l,type:Xe(o.projectType),version:i};K(d,a),B.push(d)}const G=Ee(y),D=new Map,k=new Map;if(G)for(const c of G.packages.values()){D.set(`${c.name}@${c.version}`,c);let o=k.get(c.name);o||(o=new Set,k.set(c.name,o)),o.add(c.version)}const W=[],L=[],N=new Map;for(const c of $){const o=M.get(c);if(!o)continue;const a=[o.dependencies,o.peerDependencies];s&&a.push(o.devDependencies);const i=new Set,l=(d,T)=>{if(T)for(const[S,j]of Object.entries(T)){if(F.has(S)){const I=J.get(S);I&&i.add(I);continue}const A=V(S,j,k);A&&(i.add(C(S,A)),d.push(`${S}@${A}`))}};for(const d of a)l(W,d);l(L,o.optionalDependencies),N.set(c,i)}const R=new Map,b=new Map,f=(c,o)=>{const a=[...c];for(;a.length>0;){const i=a.pop(),l=R.get(i);if(l==="required"||l==="optional"&&o==="optional")continue;R.set(i,o);const d=D.get(i);if(!d)continue;const T=b.get(i)??new Set,S=[d.dependencies,d.peerDependencies];for(const j of S)if(j)for(const[A,I]of Object.entries(j))for(const q of I){const z=V(A,q,k);z&&(T.add(C(A,z)),a.push(`${A}@${z}`))}if(d.optionalDependencies)for(const[j,A]of Object.entries(d.optionalDependencies))for(const I of A){const q=V(j,I,k);q&&(T.add(C(j,q)),L.push(`${j}@${q}`))}T.size>0&&b.set(i,T)}};f(W,"required"),f(L,"optional");const u=[],g=[...R.keys()].sort();for(const c of g){const o=D.get(c);if(!o)continue;const a=C(o.name,o.version),i={"bom-ref":a,name:o.name,purl:a,scope:R.get(c)??"required",type:"library",version:o.version};o.hash&&(i.hashes=[o.hash]),K(i,xe(y,o.name,o.version)),u.push(i)}const w=[];for(const[c,o]of N){const a=J.get(c);if(!a)continue;const i=[...o].sort();w.push(i.length>0?{dependsOn:i,ref:a}:{ref:a})}for(const c of g){const o=D.get(c);if(!o)continue;const a=C(o.name,o.version),i=b.get(c),l=i?[...i].sort():[];w.push(l.length>0?{dependsOn:l,ref:a}:{ref:a})}w.sort((c,o)=>c.ref.localeCompare(o.ref));const O=te(E(y,"package.json")),v=(()=>{if(n?.length===1){const l=B.find(d=>d.name===n[0]);if(l)return{"bom-ref":l["bom-ref"],name:l.name,purl:l.purl,type:l.type,version:l.version}}const c=O?.name??"workspace",o=O?.version??"0.0.0",a=C(c,o),i={"bom-ref":a,name:c,purl:a,type:"application",version:o};return K(i,O),i})(),x=v["bom-ref"],H=x?B.filter(c=>c["bom-ref"]!==x):B;return{$schema:Ie,bomFormat:Le,components:[...H,...u],dependencies:w,metadata:{component:v,lifecycles:[{phase:"build"}],timestamp:r.toISOString(),tools:{components:[{name:Ue,type:"application",...t?{version:t}:{}}]}},serialNumber:h??`urn:uuid:${pe()}`,specVersion:Be,version:1}},sn=e=>{const n={version:e.version??1,xmlns:"http://cyclonedx.org/schema/bom/1.7"};e.serialNumber&&(n.serialNumber=e.serialNumber);const t=[];return e.metadata&&t.push(Ge(e.metadata)),e.components&&e.components.length>0&&t.push({_content:e.components.map(s=>Z(s)),_name:"components"}),e.dependencies&&e.dependencies.length>0&&t.push({_content:e.dependencies.map(s=>He(s)),_name:"dependencies"}),`${U({_attrs:n,_content:t,_name:"bom"},{header:!0,indent:" ",selfCloseTags:!0})}
|
|
4
|
-
`},Ge=e=>{const n=[];return e.timestamp&&n.push({timestamp:e.timestamp}),e.lifecycles&&e.lifecycles.length>0&&n.push({_content:e.lifecycles.map(t=>{const s=[];return t.phase&&s.push({phase:t.phase}),t.name&&s.push({name:t.name}),t.description&&s.push({description:t.description}),{_content:s,_name:"lifecycle"}}),_name:"lifecycles"}),e.tools?.components&&n.push({_content:[{_content:e.tools.components.map(t=>Z(t)),_name:"components"}],_name:"tools"}),e.component&&n.push(Z(e.component)),{_content:n,_name:"metadata"}},Z=e=>{const n={type:e.type};e["bom-ref"]&&(n["bom-ref"]=e["bom-ref"]);const t=[];e.group&&t.push({group:e.group}),t.push({name:e.name}),e.version&&t.push({version:e.version}),e.description&&t.push({description:e.description}),e.author&&t.push({author:e.author}),e.hashes&&e.hashes.length>0&&t.push({_content:e.hashes.map(r=>({_attrs:{alg:r.alg},_content:r.content,_name:"hash"})),_name:"hashes"});const s=We(e.licenses);return s&&t.push(s),e.purl&&t.push({purl:e.purl}),e.scope&&t.push({scope:e.scope}),e.externalReferences&&e.externalReferences.length>0&&t.push({_content:e.externalReferences.map(r=>({_attrs:{type:r.type},_content:[{url:r.url}],_name:"reference"})),_name:"externalReferences"}),{_attrs:n,_content:t,_name:"component"}},We=e=>{if(!e||e.length===0)return;const n=[];for(const t of e){if("expression"in t){n.push({expression:t.expression});continue}const s=[];"id"in t.license&&t.license.id?s.push({id:t.license.id}):"name"in t.license&&t.license.name&&s.push({name:t.license.name}),n.push({_content:s,_name:"license"})}return{_content:n,_name:"licenses"}},He=e=>e.dependsOn&&e.dependsOn.length>0?{_attrs:{ref:e.ref},_content:e.dependsOn.map(n=>({_attrs:{ref:n},_name:"dependency"})),_name:"dependency"}:{_attrs:{ref:e.ref},_name:"dependency"};export{tn as b,sn as s,C as t};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{createRequire as m}from"node:module";import{m as _}from"./index-2LCHaVNX.js";import{a as F}from"./en-C26W78--.js";const p=m(import.meta.url),o=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,c=r=>{if(typeof o<"u"&&o.versions&&o.versions.node){const[t,e]=o.versions.node.split(".").map(Number);if(t>22||t===22&&e>=3||t===20&&e>=16)return o.getBuiltinModule(r)}return p(r)},{mkdirSync:f,writeFileSync:h,readdirSync:g}=c("node:fs"),{readFile:y}=c("node:fs/promises"),n=r=>F(r),a=(r,t)=>_(n(r),`${encodeURIComponent(t)}.json`);class S{#t;#e;constructor(t,e){this.#t=t,this.#e=e}printTaskTerminalOutput(t,e,s){if(e!=="failure")return;const i=n(this.#t);try{f(i,{recursive:!0})}catch{return}const u=t.overrides.command,d=t.projectRoot,l={command:u,cwd:d,exitCode:void 0,hash:t.hash,runId:this.#e,status:e,taskId:t.id,terminalOutput:s,timestamp:new Date().toISOString()};try{h(a(this.#t,t.id),`${JSON.stringify(l,void 0,2)}
|
|
2
|
-
`,"utf8")}catch{}}}const I=async(r,t)=>{const e=a(r,t);try{const s=await y(e,"utf8");return JSON.parse(s)}catch{return}},O=r=>{const t=n(r);let e;try{e=g(t)}catch{return[]}const s=[];for(const i of e)if(i.endsWith(".json"))try{s.push(decodeURIComponent(i.slice(0,-5)))}catch{}return s};export{S as F,I as a,O as l};
|