@visulima/vis 1.0.0-alpha.40 → 1.0.0-alpha.41
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 +27 -0
- package/dist/bin.js +1 -1
- package/dist/binx.js +2 -2
- package/dist/config/index.d.ts +18 -0
- package/dist/packem_chunks/bin.js +202 -202
- package/dist/packem_chunks/handler10.js +1 -1
- package/dist/packem_chunks/handler12.js +1 -1
- package/dist/packem_chunks/handler13.js +1 -1
- package/dist/packem_chunks/handler14.js +1 -1
- package/dist/packem_chunks/handler15.js +1 -1
- package/dist/packem_chunks/handler16.js +1 -1
- package/dist/packem_chunks/handler17.js +1 -1
- package/dist/packem_chunks/handler18.js +1 -1
- package/dist/packem_chunks/handler19.js +1 -1
- package/dist/packem_chunks/handler21.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/handler30.js +1 -2
- package/dist/packem_chunks/handler31.js +2 -2
- package/dist/packem_chunks/handler32.js +2 -2
- package/dist/packem_chunks/handler33.js +2 -3
- package/dist/packem_chunks/handler34.js +3 -6
- package/dist/packem_chunks/handler35.js +6 -1
- package/dist/packem_chunks/handler36.js +1 -42
- package/dist/packem_chunks/handler37.js +42 -8
- package/dist/packem_chunks/handler38.js +8 -9
- package/dist/packem_chunks/handler39.js +9 -75
- package/dist/packem_chunks/handler4.js +1 -1
- package/dist/packem_chunks/handler40.js +75 -5
- package/dist/packem_chunks/handler41.js +5 -4
- package/dist/packem_chunks/handler42.js +4 -3
- package/dist/packem_chunks/handler43.js +3 -2
- package/dist/packem_chunks/handler44.js +2 -1
- package/dist/packem_chunks/handler45.js +1 -1
- package/dist/packem_chunks/handler46.js +1 -1
- package/dist/packem_chunks/handler47.js +1 -3
- package/dist/packem_chunks/handler48.js +3 -1
- package/dist/packem_chunks/handler49.js +1 -7
- package/dist/packem_chunks/handler5.js +1 -1
- package/dist/packem_chunks/handler50.js +6 -32
- package/dist/packem_chunks/handler51.js +33 -3
- package/dist/packem_chunks/handler52.js +3 -8
- package/dist/packem_chunks/handler53.js +6 -2
- package/dist/packem_chunks/handler54.js +4 -1
- package/dist/packem_chunks/handler55.js +1 -12
- package/dist/packem_chunks/handler56.js +11 -6
- package/dist/packem_chunks/handler57.js +7 -5
- package/dist/packem_chunks/handler58.js +5 -11
- package/dist/packem_chunks/handler59.js +11 -3
- package/dist/packem_chunks/handler60.js +3 -22
- package/dist/packem_chunks/handler61.js +21 -60
- package/dist/packem_chunks/handler62.js +61 -3
- package/dist/packem_chunks/handler63.js +3 -6
- package/dist/packem_chunks/handler64.js +6 -708
- package/dist/packem_chunks/handler65.js +708 -24
- package/dist/packem_chunks/handler66.js +24 -25
- package/dist/packem_chunks/handler67.js +25 -153
- package/dist/packem_chunks/handler68.js +153 -10
- package/dist/packem_chunks/handler69.js +10 -24
- package/dist/packem_chunks/handler70.js +24 -322
- package/dist/packem_chunks/handler71.js +322 -48
- package/dist/packem_chunks/handler72.js +48 -27
- package/dist/packem_chunks/handler73.js +27 -3
- package/dist/packem_chunks/handler74.js +3 -190
- package/dist/packem_chunks/handler75.js +189 -37
- package/dist/packem_chunks/handler76.js +38 -0
- 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/help-command.js +1 -1
- package/dist/packem_chunks/list.js +1 -1
- package/dist/packem_chunks/loader.js +1 -1
- package/dist/packem_chunks/orchestrator.js +1 -1
- package/dist/packem_chunks/sync2.js +1 -1
- package/dist/packem_chunks/tripwire.js +1 -1
- package/dist/packem_chunks/verify-lockfile.js +1 -1
- package/dist/packem_chunks/version-resolver.js +1 -1
- package/dist/packem_shared/command-runtime-CR70qSUM.js +1 -0
- package/dist/packem_shared/{cyclonedx-kYozDyxp.js → cyclonedx-Cadls41z.js} +1 -1
- package/dist/packem_shared/{index-Du8RWawQ.js → index-3jMNqQom.js} +1 -1
- package/dist/packem_shared/index-Bt521H5J.js +30 -0
- package/dist/packem_shared/{index-CgcF6_wo.js → index-DGSsjmpV.js} +1 -1
- package/dist/packem_shared/{pm-runner-OGResYrA.js → pm-runner-BKZQo7Ts.js} +1 -1
- package/dist/packem_shared/{provenance-_CJjMKwu.js → provenance-BFEwKgI3.js} +1 -1
- package/dist/packem_shared/{resolve-explicit-CMDl55Nz.js → resolve-explicit-C6WM-I2u.js} +1 -1
- package/dist/packem_shared/{s1ngularity-Dhr3bPk0.js → s1ngularity-DCPmPE5M.js} +1 -1
- package/dist/packem_shared/{signatures-C730vkyK.js → signatures-Xpd6HjG_.js} +1 -1
- package/index.d.ts +201 -201
- package/index.js +26 -26
- package/package.json +13 -13
- package/schemas/vis-config.schema.json +12 -0
- package/dist/packem_shared/index-yBikBkHT.js +0 -30
package/index.js
CHANGED
|
@@ -82,7 +82,7 @@ function requireNative() {
|
|
|
82
82
|
const binding = require('@visulima/vis-binding-android-arm64')
|
|
83
83
|
const bindingPackageVersion = require('@visulima/vis-binding-android-arm64/package.json').version
|
|
84
84
|
if (bindingPackageVersion !== '1.0.0-alpha.39' && 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 1.0.0-alpha.
|
|
85
|
+
throw new Error(`Native binding package version mismatch, expected 1.0.0-alpha.41 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
86
86
|
}
|
|
87
87
|
return binding
|
|
88
88
|
} catch (e) {
|
|
@@ -98,7 +98,7 @@ function requireNative() {
|
|
|
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
100
|
if (bindingPackageVersion !== '1.0.0-alpha.39' && 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 1.0.0-alpha.
|
|
101
|
+
throw new Error(`Native binding package version mismatch, expected 1.0.0-alpha.41 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
102
102
|
}
|
|
103
103
|
return binding
|
|
104
104
|
} catch (e) {
|
|
@@ -119,7 +119,7 @@ function requireNative() {
|
|
|
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
121
|
if (bindingPackageVersion !== '1.0.0-alpha.39' && 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 1.0.0-alpha.
|
|
122
|
+
throw new Error(`Native binding package version mismatch, expected 1.0.0-alpha.41 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
123
123
|
}
|
|
124
124
|
return binding
|
|
125
125
|
} catch (e) {
|
|
@@ -135,7 +135,7 @@ function requireNative() {
|
|
|
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
137
|
if (bindingPackageVersion !== '1.0.0-alpha.39' && 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 1.0.0-alpha.
|
|
138
|
+
throw new Error(`Native binding package version mismatch, expected 1.0.0-alpha.41 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
139
139
|
}
|
|
140
140
|
return binding
|
|
141
141
|
} catch (e) {
|
|
@@ -152,7 +152,7 @@ function requireNative() {
|
|
|
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
154
|
if (bindingPackageVersion !== '1.0.0-alpha.39' && 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 1.0.0-alpha.
|
|
155
|
+
throw new Error(`Native binding package version mismatch, expected 1.0.0-alpha.41 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
156
156
|
}
|
|
157
157
|
return binding
|
|
158
158
|
} catch (e) {
|
|
@@ -168,7 +168,7 @@ function requireNative() {
|
|
|
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
170
|
if (bindingPackageVersion !== '1.0.0-alpha.39' && 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 1.0.0-alpha.
|
|
171
|
+
throw new Error(`Native binding package version mismatch, expected 1.0.0-alpha.41 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
172
172
|
}
|
|
173
173
|
return binding
|
|
174
174
|
} catch (e) {
|
|
@@ -187,7 +187,7 @@ function requireNative() {
|
|
|
187
187
|
const binding = require('@visulima/vis-binding-darwin-universal')
|
|
188
188
|
const bindingPackageVersion = require('@visulima/vis-binding-darwin-universal/package.json').version
|
|
189
189
|
if (bindingPackageVersion !== '1.0.0-alpha.39' && 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 1.0.0-alpha.
|
|
190
|
+
throw new Error(`Native binding package version mismatch, expected 1.0.0-alpha.41 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
191
191
|
}
|
|
192
192
|
return binding
|
|
193
193
|
} catch (e) {
|
|
@@ -203,7 +203,7 @@ function requireNative() {
|
|
|
203
203
|
const binding = require('@visulima/vis-binding-darwin-x64')
|
|
204
204
|
const bindingPackageVersion = require('@visulima/vis-binding-darwin-x64/package.json').version
|
|
205
205
|
if (bindingPackageVersion !== '1.0.0-alpha.39' && 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 1.0.0-alpha.
|
|
206
|
+
throw new Error(`Native binding package version mismatch, expected 1.0.0-alpha.41 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
207
207
|
}
|
|
208
208
|
return binding
|
|
209
209
|
} catch (e) {
|
|
@@ -219,7 +219,7 @@ function requireNative() {
|
|
|
219
219
|
const binding = require('@visulima/vis-binding-darwin-arm64')
|
|
220
220
|
const bindingPackageVersion = require('@visulima/vis-binding-darwin-arm64/package.json').version
|
|
221
221
|
if (bindingPackageVersion !== '1.0.0-alpha.39' && 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 1.0.0-alpha.
|
|
222
|
+
throw new Error(`Native binding package version mismatch, expected 1.0.0-alpha.41 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
223
223
|
}
|
|
224
224
|
return binding
|
|
225
225
|
} catch (e) {
|
|
@@ -239,7 +239,7 @@ function requireNative() {
|
|
|
239
239
|
const binding = require('@visulima/vis-binding-freebsd-x64')
|
|
240
240
|
const bindingPackageVersion = require('@visulima/vis-binding-freebsd-x64/package.json').version
|
|
241
241
|
if (bindingPackageVersion !== '1.0.0-alpha.39' && 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 1.0.0-alpha.
|
|
242
|
+
throw new Error(`Native binding package version mismatch, expected 1.0.0-alpha.41 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
243
243
|
}
|
|
244
244
|
return binding
|
|
245
245
|
} catch (e) {
|
|
@@ -255,7 +255,7 @@ function requireNative() {
|
|
|
255
255
|
const binding = require('@visulima/vis-binding-freebsd-arm64')
|
|
256
256
|
const bindingPackageVersion = require('@visulima/vis-binding-freebsd-arm64/package.json').version
|
|
257
257
|
if (bindingPackageVersion !== '1.0.0-alpha.39' && 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 1.0.0-alpha.
|
|
258
|
+
throw new Error(`Native binding package version mismatch, expected 1.0.0-alpha.41 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
259
259
|
}
|
|
260
260
|
return binding
|
|
261
261
|
} catch (e) {
|
|
@@ -276,7 +276,7 @@ function requireNative() {
|
|
|
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
278
|
if (bindingPackageVersion !== '1.0.0-alpha.39' && 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 1.0.0-alpha.
|
|
279
|
+
throw new Error(`Native binding package version mismatch, expected 1.0.0-alpha.41 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
280
280
|
}
|
|
281
281
|
return binding
|
|
282
282
|
} catch (e) {
|
|
@@ -292,7 +292,7 @@ function requireNative() {
|
|
|
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
294
|
if (bindingPackageVersion !== '1.0.0-alpha.39' && 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 1.0.0-alpha.
|
|
295
|
+
throw new Error(`Native binding package version mismatch, expected 1.0.0-alpha.41 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
296
296
|
}
|
|
297
297
|
return binding
|
|
298
298
|
} catch (e) {
|
|
@@ -310,7 +310,7 @@ function requireNative() {
|
|
|
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
312
|
if (bindingPackageVersion !== '1.0.0-alpha.39' && 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 1.0.0-alpha.
|
|
313
|
+
throw new Error(`Native binding package version mismatch, expected 1.0.0-alpha.41 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
314
314
|
}
|
|
315
315
|
return binding
|
|
316
316
|
} catch (e) {
|
|
@@ -326,7 +326,7 @@ function requireNative() {
|
|
|
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
328
|
if (bindingPackageVersion !== '1.0.0-alpha.39' && 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 1.0.0-alpha.
|
|
329
|
+
throw new Error(`Native binding package version mismatch, expected 1.0.0-alpha.41 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
330
330
|
}
|
|
331
331
|
return binding
|
|
332
332
|
} catch (e) {
|
|
@@ -344,7 +344,7 @@ function requireNative() {
|
|
|
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
346
|
if (bindingPackageVersion !== '1.0.0-alpha.39' && 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 1.0.0-alpha.
|
|
347
|
+
throw new Error(`Native binding package version mismatch, expected 1.0.0-alpha.41 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
348
348
|
}
|
|
349
349
|
return binding
|
|
350
350
|
} catch (e) {
|
|
@@ -360,7 +360,7 @@ function requireNative() {
|
|
|
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
362
|
if (bindingPackageVersion !== '1.0.0-alpha.39' && 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 1.0.0-alpha.
|
|
363
|
+
throw new Error(`Native binding package version mismatch, expected 1.0.0-alpha.41 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
364
364
|
}
|
|
365
365
|
return binding
|
|
366
366
|
} catch (e) {
|
|
@@ -378,7 +378,7 @@ function requireNative() {
|
|
|
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
380
|
if (bindingPackageVersion !== '1.0.0-alpha.39' && 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 1.0.0-alpha.
|
|
381
|
+
throw new Error(`Native binding package version mismatch, expected 1.0.0-alpha.41 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
382
382
|
}
|
|
383
383
|
return binding
|
|
384
384
|
} catch (e) {
|
|
@@ -394,7 +394,7 @@ function requireNative() {
|
|
|
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
396
|
if (bindingPackageVersion !== '1.0.0-alpha.39' && 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 1.0.0-alpha.
|
|
397
|
+
throw new Error(`Native binding package version mismatch, expected 1.0.0-alpha.41 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
398
398
|
}
|
|
399
399
|
return binding
|
|
400
400
|
} catch (e) {
|
|
@@ -412,7 +412,7 @@ function requireNative() {
|
|
|
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
414
|
if (bindingPackageVersion !== '1.0.0-alpha.39' && 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 1.0.0-alpha.
|
|
415
|
+
throw new Error(`Native binding package version mismatch, expected 1.0.0-alpha.41 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
416
416
|
}
|
|
417
417
|
return binding
|
|
418
418
|
} catch (e) {
|
|
@@ -428,7 +428,7 @@ function requireNative() {
|
|
|
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
430
|
if (bindingPackageVersion !== '1.0.0-alpha.39' && 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 1.0.0-alpha.
|
|
431
|
+
throw new Error(`Native binding package version mismatch, expected 1.0.0-alpha.41 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
432
432
|
}
|
|
433
433
|
return binding
|
|
434
434
|
} catch (e) {
|
|
@@ -445,7 +445,7 @@ function requireNative() {
|
|
|
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
447
|
if (bindingPackageVersion !== '1.0.0-alpha.39' && 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 1.0.0-alpha.
|
|
448
|
+
throw new Error(`Native binding package version mismatch, expected 1.0.0-alpha.41 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
449
449
|
}
|
|
450
450
|
return binding
|
|
451
451
|
} catch (e) {
|
|
@@ -461,7 +461,7 @@ function requireNative() {
|
|
|
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
463
|
if (bindingPackageVersion !== '1.0.0-alpha.39' && 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 1.0.0-alpha.
|
|
464
|
+
throw new Error(`Native binding package version mismatch, expected 1.0.0-alpha.41 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
465
465
|
}
|
|
466
466
|
return binding
|
|
467
467
|
} catch (e) {
|
|
@@ -481,7 +481,7 @@ function requireNative() {
|
|
|
481
481
|
const binding = require('@visulima/vis-binding-openharmony-arm64')
|
|
482
482
|
const bindingPackageVersion = require('@visulima/vis-binding-openharmony-arm64/package.json').version
|
|
483
483
|
if (bindingPackageVersion !== '1.0.0-alpha.39' && 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 1.0.0-alpha.
|
|
484
|
+
throw new Error(`Native binding package version mismatch, expected 1.0.0-alpha.41 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
485
485
|
}
|
|
486
486
|
return binding
|
|
487
487
|
} catch (e) {
|
|
@@ -497,7 +497,7 @@ function requireNative() {
|
|
|
497
497
|
const binding = require('@visulima/vis-binding-openharmony-x64')
|
|
498
498
|
const bindingPackageVersion = require('@visulima/vis-binding-openharmony-x64/package.json').version
|
|
499
499
|
if (bindingPackageVersion !== '1.0.0-alpha.39' && 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 1.0.0-alpha.
|
|
500
|
+
throw new Error(`Native binding package version mismatch, expected 1.0.0-alpha.41 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
501
501
|
}
|
|
502
502
|
return binding
|
|
503
503
|
} catch (e) {
|
|
@@ -513,7 +513,7 @@ function requireNative() {
|
|
|
513
513
|
const binding = require('@visulima/vis-binding-openharmony-arm')
|
|
514
514
|
const bindingPackageVersion = require('@visulima/vis-binding-openharmony-arm/package.json').version
|
|
515
515
|
if (bindingPackageVersion !== '1.0.0-alpha.39' && 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 1.0.0-alpha.
|
|
516
|
+
throw new Error(`Native binding package version mismatch, expected 1.0.0-alpha.41 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": "1.0.0-alpha.
|
|
3
|
+
"version": "1.0.0-alpha.41",
|
|
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",
|
|
@@ -109,27 +109,27 @@
|
|
|
109
109
|
"dependencies": {
|
|
110
110
|
"@floating-ui/core": "1.7.5",
|
|
111
111
|
"@floating-ui/dom": "1.7.6",
|
|
112
|
-
"@hono/node-server": "^2.0.
|
|
112
|
+
"@hono/node-server": "^2.0.5",
|
|
113
113
|
"@visulima/error": "6.0.0-alpha.33",
|
|
114
114
|
"@visulima/secret-scanner": "1.0.0-alpha.6",
|
|
115
115
|
"@visulima/source-map": "3.0.0-alpha.12",
|
|
116
116
|
"@visulima/tabular": "4.0.0-alpha.14",
|
|
117
117
|
"@visulima/task-runner": "1.0.0-alpha.23",
|
|
118
118
|
"@visulima/tui": "1.0.0-alpha.25",
|
|
119
|
-
"conventional-commits-parser": "^6.
|
|
119
|
+
"conventional-commits-parser": "^6.4.0",
|
|
120
120
|
"graphology": "0.26.0",
|
|
121
121
|
"graphology-layout-forceatlas2": "0.10.1",
|
|
122
122
|
"graphology-types": "0.24.8",
|
|
123
123
|
"hono": "4.12.25",
|
|
124
124
|
"jiti": "^2.7.0",
|
|
125
125
|
"module-replacements": "^2.11.0",
|
|
126
|
-
"module-replacements-codemods": "^2.0.
|
|
126
|
+
"module-replacements-codemods": "^2.0.1",
|
|
127
127
|
"react": "19.2.7",
|
|
128
128
|
"react-reconciler": ">=0.33.0",
|
|
129
129
|
"sigma": "3.0.3",
|
|
130
130
|
"smol-toml": "^1.6.1",
|
|
131
131
|
"tinyexec": "^1.2.4",
|
|
132
|
-
"undici": "^
|
|
132
|
+
"undici": "^8.5.0"
|
|
133
133
|
},
|
|
134
134
|
"peerDependencies": {
|
|
135
135
|
"@gitbeaker/rest": ">=43.8.0",
|
|
@@ -152,14 +152,14 @@
|
|
|
152
152
|
}
|
|
153
153
|
},
|
|
154
154
|
"optionalDependencies": {
|
|
155
|
-
"@visulima/vis-binding-darwin-
|
|
156
|
-
"@visulima/vis-binding-
|
|
157
|
-
"@visulima/vis-binding-
|
|
158
|
-
"@visulima/vis-binding-linux-arm64-musl": "1.0.0-alpha.
|
|
159
|
-
"@visulima/vis-binding-linux-x64-musl": "1.0.0-alpha.
|
|
160
|
-
"@visulima/vis-binding-linux-x64-gnu": "1.0.0-alpha.
|
|
161
|
-
"@visulima/vis-binding-win32-
|
|
162
|
-
"@visulima/vis-binding-win32-
|
|
155
|
+
"@visulima/vis-binding-darwin-arm64": "1.0.0-alpha.41",
|
|
156
|
+
"@visulima/vis-binding-darwin-x64": "1.0.0-alpha.41",
|
|
157
|
+
"@visulima/vis-binding-linux-arm64-gnu": "1.0.0-alpha.41",
|
|
158
|
+
"@visulima/vis-binding-linux-arm64-musl": "1.0.0-alpha.41",
|
|
159
|
+
"@visulima/vis-binding-linux-x64-musl": "1.0.0-alpha.41",
|
|
160
|
+
"@visulima/vis-binding-linux-x64-gnu": "1.0.0-alpha.41",
|
|
161
|
+
"@visulima/vis-binding-win32-arm64-msvc": "1.0.0-alpha.41",
|
|
162
|
+
"@visulima/vis-binding-win32-x64-msvc": "1.0.0-alpha.41"
|
|
163
163
|
},
|
|
164
164
|
"engines": {
|
|
165
165
|
"node": "^22.14.0 || >=24.10.0"
|
|
@@ -870,6 +870,10 @@
|
|
|
870
870
|
"additionalProperties": false,
|
|
871
871
|
"description": "Behavior of `vis run` when invoked tasks declare service dependencies that aren't running in the workspace registry. CLI `--services=<mode>` overrides this block."
|
|
872
872
|
},
|
|
873
|
+
"runtime": {
|
|
874
|
+
"$ref": "#/$defs/RuntimeId",
|
|
875
|
+
"description": "Target JS runtime for this workspace/project — `\"node\"` (default) or `\"bun\"`. Overridden by the `--runtime` flag and the `VIS_RUNTIME` env var; falls back to lockfile detection when unset. Part of the cross-runtime multi-tool (see `rfc/design-runtime-multitool.md`)."
|
|
876
|
+
},
|
|
873
877
|
"scopedTasks": {
|
|
874
878
|
"type": "array",
|
|
875
879
|
"items": {
|
|
@@ -5309,6 +5313,14 @@
|
|
|
5309
5313
|
},
|
|
5310
5314
|
"additionalProperties": false
|
|
5311
5315
|
},
|
|
5316
|
+
"RuntimeId": {
|
|
5317
|
+
"type": "string",
|
|
5318
|
+
"enum": [
|
|
5319
|
+
"bun",
|
|
5320
|
+
"node"
|
|
5321
|
+
],
|
|
5322
|
+
"description": "JS runtimes vis can target today. `\"deno\"` is deferred."
|
|
5323
|
+
},
|
|
5312
5324
|
"ScopedTasksBlock": {
|
|
5313
5325
|
"type": "object",
|
|
5314
5326
|
"properties": {
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import{createRequire as zt}from"node:module";import __cjs_mod__ from "node:module"; // -- packem CommonJS require shim --
|
|
2
|
-
const require = __cjs_mod__.createRequire(import.meta.url);
|
|
3
|
-
const Wt=zt(import.meta.url),ie=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,Ft=t=>{if(typeof ie<"u"&&ie.versions&&ie.versions.node){const[e,n]=ie.versions.node.split(".").map(Number);if(e>22||e===22&&n>=3||e===20&&n>=16)return ie.getBuiltinModule(t)}return Wt(t)},{createRequire:ve}=Ft("node:module"),qt=16,be=32,Gt=64,V=128,ge="positionals",Ht=ve(import.meta.url),se=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,Jt=t=>{if(typeof se<"u"&&se.versions&&se.versions.node){const[e,n]=se.versions.node.split(".").map(Number);if(e>22||e===22&&n>=3||e===20&&n>=16)return se.getBuiltinModule(t)}return Ht(t)},{createRequire:ht}=Jt("node:module"),Kt=globalThis.process??Object.create(null),Pe={versions:{}},_e=new Proxy(Kt,{get(t,e){if(e in t)return t[e];if(e in Pe)return Pe[e]}}),Yt=t=>t.replaceAll(/\r\n|\r(?!\n)|\n/gu,`
|
|
4
|
-
`),Qt=(t,e,n,o)=>{const s={column:0,line:-1,...t.start},i={...s,...t.end},c=s.line,a=s.column,u=i.line,r=i.column;let l=Math.max(c-(n+1),0),d=Math.min(e.length,u+o);c===-1&&(l=0),u===-1&&(d=e.length);const h=u-c,f={};if(h)for(let p=0;p<=h;p++){const g=p+c;if(!a)f[g]=!0;else if(p===0){const $=e[g-1]?.length;f[g]=[a,($??0)-a+1]}else if(p===h)f[g]=[0,r];else{const $=e[g-p]?.length;f[g]=[0,$]}}else a===r?f[c]=a?[a,0]:!0:f[c]=[a,(r??0)-(a??0)];return{end:d,markerLines:f,start:l}},Zt=_e.platform==="win32"&&!_e.env?.WT_SESSION?">":"❯",Xt=(t,e,n)=>{const o={linesAbove:2,linesBelow:3,prefix:"",showGutter:!0,tabWidth:4,...n,color:{gutter:p=>p,marker:p=>p,message:p=>p,...n?.color}},s=typeof e.start.column=="number";let i=(t.includes("\r")?Yt(t):t).split(`
|
|
5
|
-
`);typeof o.tabWidth=="number"&&t.includes(" ")&&(i=i.map(p=>p.replaceAll(" "," ".repeat(o.tabWidth))));const{end:c,markerLines:a,start:u}=Qt(e,i,o.linesAbove,o.linesBelow),r=String(c).length,{gutter:l,marker:d,message:h}=o.color;let f=i.slice(u,c).map((p,g)=>{const $=u+1+g,w=a[$],y=String($).padStart(r),b=!a[$+1],N=` ${y}${o.showGutter?" |":""}`;if(w){let E="";if(Array.isArray(w)){const I=p.replaceAll(/[^\t]/g," ").slice(0,Math.max(w[0]-1,0)),O=w[1]||1;E=[`
|
|
6
|
-
`,o.prefix+l(N.replaceAll(/\d/g," "))," ",I,d("^").repeat(O)].join(""),b&&o.message&&(E+=` ${h(o.message)}`)}return[o.prefix+d(Zt),l(N),p.length>0?` ${p}`:"",E].join("")}return`${o.prefix} ${l(N)}${p.length>0?` ${p}`:""}`}).join(`
|
|
7
|
-
`);return o.message&&!s&&(f=`${o.prefix+" ".repeat(r+1)+o.message}
|
|
8
|
-
${f}`),f},en=new Map([["Error",Error],["EvalError",EvalError],["RangeError",RangeError],["ReferenceError",ReferenceError],["SyntaxError",SyntaxError],["TypeError",TypeError],["URIError",URIError]]);typeof AggregateError<"u"&&en.set("AggregateError",AggregateError);const tn=ht(import.meta.url),re=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,nn=t=>{if(typeof re<"u"&&re.versions&&re.versions.node){const[e,n]=re.versions.node.split(".").map(Number);if(e>22||e===22&&n>=3||e===20&&n>=16)return re.getBuiltinModule(t)}return tn(t)};nn("node:util");const on=()=>_e.env?.DEBUG==="true",Y=(t,...e)=>{if(on()){const n=e.map(o=>typeof o=="function"?o():o);console.debug(`error:parse-stacktrace: ${t}`,...n)}},Q="<unknown>",sn=/^(?:node:internal\/|node:|internal\/)/,rn=t=>t!==void 0&&sn.test(t),an=/^.*?\s*at\s(?:(.+?\)(?:\s\[.+\])?|\(?.*?)\s?\((?:address\sat\s)?)?(?:async\s)?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,ln=/\((\S+)\),\s(<[^>]+>)?:(\d+)?:(\d+)?\)?/,cn=/(.*?):(\d+):(\d+)(?:\s<-\s.+:\d+:\d+)?/,un=/eval\sat\s(<anonymous>)\s\((.*)\)?:(\d+)?:(\d+)\),\s*<anonymous>?:(\d+)?:(\d+)/,hn=/^\s*in\s(?:([^\\/]+(?:\s\[as\s\S+\])?)\s\(?)?\(at?\s?(.*?):(\d+)(?::(\d+))?\)?\s*$/,pn=/in\s(.*)\s\(at\s(.+)\)\sat/,dn=/^(?:.*@)?(.*):(\d+):(\d+)$/,fn=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. \/=]+)(?::(\d+))?(?::(\d+))?\s*$/i,mn=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,gn=/(\S[^\s[]*\[.*\]|.*?)@(.*):(\d+):(\d+)/,De=/\(error: (.*)\)/,wn=/at\s/,yn=/^(\S+):(\d+):(\d+)$|^(\S+):(\d+)$/,vn=/\S*(?:Error: |AggregateError:)/,pt=/^Anonymous function$/,$n=/^\s*in\s.*/,bn=/^.*?\s*at\s.*/,xn=/^.*?\s*@.*|\[native code\]/,dt=(t,e)=>{const n=t.includes("safari-extension"),o=t.includes("safari-web-extension");return n||o?[t.includes("@")?t.split("@")[0]:Q,n?`safari-extension:${e}`:`safari-web-extension:${e}`]:[t,e]},ft=(t,e)=>{const n=cn.exec(e);n&&(t.file=n[1],t.line=+n[2],t.column=+n[3])},Nn=t=>{const e=pn.exec(t);if(e){Y(`parse nested node error stack line: "${t}"`,()=>`found: ${JSON.stringify(e)}`);const o=e[2].split(":");return{column:o[2]?+o[2]:void 0,file:o[0],line:o[1]?+o[1]:void 0,methodName:e[1]??Q,raw:t,type:void 0}}const n=hn.exec(t);if(n){Y(`parse node error stack line: "${t}"`,()=>`found: ${JSON.stringify(n)}`);const o={column:n[4]?+n[4]:void 0,file:n[2]?n[2].replace(wn,""):void 0,line:n[3]?+n[3]:void 0,methodName:n[1]??Q,raw:t,type:t.startsWith("internal")?"internal":void 0};return ft(o,`${n[2]}:${n[3]}:${n[4]}`),o}},An=t=>{const e=an.exec(t);if(e){Y(`parse chrome error stack line: "${t}"`,()=>`found: ${JSON.stringify(e)}`);const n=e[2]?.startsWith("native"),o=e[2]?.startsWith("eval")||e[1]?.startsWith("eval");let s,i;if(o){const r=ln.exec(t);if(r){const l=yn.exec(r[1]);l?(e[2]=l[4]??l[1],e[3]=l[5]??l[2],e[4]=l[3]):r[2]&&(e[2]=r[1]),r[2]&&(s={column:r[4]?+r[4]:void 0,file:r[2],line:r[3]?+r[3]:void 0,methodName:"eval",raw:t,type:"eval"})}else{const l=un.exec(t);l&&(i={column:l[4]?+l[4]:void 0,file:l[2],line:l[3]?+l[3]:void 0},s={column:l[6]?+l[6]:void 0,file:l[1],line:l[5]?+l[5]:void 0,methodName:"eval",raw:l[0],type:"eval"})}}const[c,a]=dt(e[1]?e[1].replace(pt,"<anonymous>"):Q,e[2]),u={column:e[4]?+e[4]:void 0,evalOrigin:s,file:a,line:e[3]?+e[3]:void 0,methodName:c,raw:t,type:o?"eval":n?"native":rn(a)?"internal":void 0};return i?(u.column=i.column,u.file=i.file,u.line=i.line):ft(u,`${a}:${e[3]}:${e[4]}`),u}},kn=(t,e)=>{const n=fn.exec(t);if(n){Y(`parse gecko error stack line: "${t}"`,()=>`found: ${JSON.stringify(n)}`);const o=n[3]?.includes(" > eval"),s=o&&n[3]&&mn.exec(n[3]);let i;o&&s&&(n[3]=s[1],i={column:n[5]?+n[5]:void 0,file:n[3],line:n[4]?+n[4]:void 0,methodName:"eval",raw:t,type:"eval"},n[4]=s[2]);const[c,a]=dt(n[1]?n[1].replace(pt,"<anonymous>"):Q,n[3]);let u;(e?.type==="safari"||!o&&e?.type==="firefox")&&e.column?u=e.column:!o&&n[5]&&(u=+n[5]);let r;return(e?.type==="safari"||!o&&e?.type==="firefox")&&e.line?r=e.line:n[4]&&(r=+n[4]),{column:u,evalOrigin:i,file:a,line:r,methodName:c,raw:t,type:o?"eval":a.includes("[native code]")?"native":void 0}}},En=(t,e)=>{const n=gn.exec(t);if(!(n&&n[2].includes(" > eval"))&&n)return Y(`parse firefox error stack line: "${t}"`,()=>`found: ${JSON.stringify(n)}`),{column:n[4]?+n[4]:e?.column??void 0,file:n[2],line:n[3]?+n[3]:e?.line??void 0,methodName:n[1]||Q,raw:t,type:void 0}},Cn=t=>{const e=dn.exec(t);if(e)return Y(`parse react android native error stack line: "${t}"`,()=>`found: ${JSON.stringify(e)}`),{column:e[3]?+e[3]:void 0,file:e[1],line:e[2]?+e[2]:void 0,methodName:Q,raw:t,type:void 0}},mt=(t,{filter:e,frameLimit:n=50}={})=>{const o=t;let s=(typeof o.stacktrace=="string"?o.stacktrace:t.stack??"").split(`
|
|
9
|
-
`).map(i=>(De.test(i)?i.replace(De,"$1"):i).trim()).filter(i=>!vn.test(i)&&i!=="eval code");return e&&(s=s.filter(i=>e(i))),s=s.slice(0,n),s.reduce((i,c,a)=>{if(!c||c.length>1024)return i;let u;if($n.test(c))u=Nn(c);else if(bn.test(c))u=An(c);else if(xn.test(c)){let r;if(a===0){const l=t,d=l.columnNumber,h=l.lineNumber,f=l.line,p=l.column;d||h?r={column:d,line:h,type:"firefox"}:(f||p)&&(r={column:p,line:f,type:"safari"})}u=En(c,r)??kn(c,r)}else u=Cn(c);return u?i.push(u):Y(`parse error stack line: "${c}"`,"not parser found"),i},[])},On=ht(import.meta.url),te=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,Le=t=>{if(typeof te<"u"&&te.versions&&te.versions.node){const[e,n]=te.versions.node.split(".").map(Number);if(e>22||e===22&&n>=3||e===20&&n>=16)return te.getBuiltinModule(t)}return On(t)},{existsSync:_n,readFileSync:In}=Le("node:fs"),{relative:Ln,resolve:Ue,sep:Sn}=Le("node:path"),{cwd:Tn}=te,{fileURLToPath:Mn}=Le("node:url"),Z=(t,e,n)=>n===0?t:e===" "?t+" ".repeat(n):t+" ".repeat(e*n),gt=t=>t.replaceAll("\\","/"),Pn=(t,e)=>{const n=t.replace("async file:","file:");return gt(Ln(e,n.startsWith("file:")?Mn(n):n))},Dn=(t,e,n)=>{if(e)return n.title(t.message);const o=t.message?`: ${t.message}`:"";return n.title(t.name+o)},wt=(t,{color:e,hideErrorTitle:n,indentation:o,prefix:s},i)=>`${Z(s,o,i)}${Dn(t,n,e)}
|
|
10
|
-
`,yt=(t,{color:e,indentation:n,prefix:o},s)=>{if(t.hint===void 0)return;const i=Z(o,n,s);let c="";if(Array.isArray(t.hint))for(const a of t.hint)c+=`${i+a}
|
|
11
|
-
`;else c+=i+t.hint;return e.hint(c)},vt=(t,e)=>{if(!e||t.file===void 0||t.line===void 0)return{trace:t};try{const n=e({column:t.column,file:t.file,line:t.line});return n?{source:n.source,trace:{...t,column:n.column??t.column,file:n.file??t.file,line:n.line??t.line}}:{trace:t}}catch{return{trace:t}}},Se=(t,e,n=0)=>{const{color:o,cwd:s,displayShortPath:i,indentation:c,prefix:a}=e,{trace:u}=vt(t,e.sourceMap),r=i?Pn(u.file,s):gt(u.file),{fileLine:l,method:d}=o;return`${Z(a,c,n)}at ${u.methodName?`${d(u.methodName)} `:""}${l(r)}:${l(u.line?.toString()??"")}`},Un=(t,e)=>{if(e.allowAllFilePaths)return!0;const n=Ue(e.cwd),o=Ue(n,t);return o===n||o.startsWith(n+Sn)},$t=(t,e,n)=>{const{color:o,indentation:s,linesAbove:i,linesBelow:c,prefix:a,showGutter:u,showLineNumbers:r,tabWidth:l}=e,{source:d,trace:h}=vt(t,e.sourceMap);if(h.file===void 0)return;let f;if(d===void 0){const p=h.file.replace("file://","");if(!Un(p,e)||!_n(p))return;f=In(p,"utf8")}else f=d;return Xt(f,{start:{column:h.column,line:h.line}},{color:o,linesAbove:i,linesBelow:c,prefix:Z(a,s,n),showGutter:u,showLineNumbers:r,tabWidth:l})},bt=(t,e,n)=>{if(t.errors.length===0)return;let o=`${Z(e.prefix,e.indentation,n)}Errors:
|
|
12
|
-
|
|
13
|
-
`,s=!0;for(const i of t.errors)s?s=!1:o+=`
|
|
14
|
-
|
|
15
|
-
`,o+=Nt(i,{...e,framesMaxLimit:1,hideErrorCodeView:e.hideErrorErrorsCodeView},n+1);return`
|
|
16
|
-
${o}`},xt=(t,e,n,o=new Set)=>{o.add(t);let s=`${Z(e.prefix,e.indentation,n)}Caused by:
|
|
17
|
-
|
|
18
|
-
`;const i=t.cause;s+=wt(i,e,n);const c=mt(i).shift(),a=yt(i,e,n);if(a&&(s+=`${a}
|
|
19
|
-
`),c&&(s+=Se(c,e,n),!e.hideErrorCauseCodeView)){const u=$t(c,e,n);u!==void 0&&(s+=`
|
|
20
|
-
${u}`)}if(i instanceof AggregateError){const u=bt(i,e,n);u!==void 0&&(s+=`
|
|
21
|
-
${u}`)}return i.cause&&(s+=o.has(i)?`
|
|
22
|
-
${Z(e.prefix,e.indentation,n+1)}Caused by: [Circular]`:`
|
|
23
|
-
${xt(i,e,n+1,o)}`),`
|
|
24
|
-
${s}`},jn=(t,e)=>(t.length>0?`
|
|
25
|
-
`:"")+t.map(n=>Se(n,e)).join(`
|
|
26
|
-
`),Nt=(t,e,n)=>{const o={allowAllFilePaths:!1,cwd:Tn(),displayShortPath:!1,filterStacktrace:void 0,framesMaxLimit:Number.POSITIVE_INFINITY,hideErrorCauseCodeView:!1,hideErrorCodeView:!1,hideErrorErrorsCodeView:!1,hideErrorTitle:!1,hideMessage:!1,indentation:4,linesAbove:2,linesBelow:3,prefix:"",showGutter:!0,showLineNumbers:!0,tabWidth:4,...e,color:{fileLine:c=>c,gutter:c=>c,hint:c=>c,marker:c=>c,message:c=>c,method:c=>c,title:c=>c,...e.color}},s=mt(t,{filter:e.filterStacktrace,frameLimit:o.framesMaxLimit}),i=s.shift();return[e.hideMessage?void 0:wt(t,o,n),yt(t,o,n),i?Se(i,o,n):void 0,i&&!o.hideErrorCodeView?$t(i,o,n):void 0,t instanceof AggregateError?bt(t,o,n):void 0,t.cause===void 0?void 0:xt(t,o,n),s.length>0?jn(s,o):void 0].filter(Boolean).join(`
|
|
27
|
-
`)},Vn=(t,e={})=>{if(e.framesMaxLimit!==void 0&&e.framesMaxLimit<=0)throw new RangeError("The 'framesMaxLimit' option must be a positive number");return Nt(t,e,0)};class oe extends Error{loc;title;hint;type="VisulimaError";constructor({cause:e,hint:n,location:o,message:s,name:i,stack:c,title:a}){super(s,{cause:e}),this.title=a,this.name=i,this.stack=c??this.stack,this.loc=o,this.hint=n}setLocation(e){this.loc=e}setName(e){this.name=e}setMessage(e){this.message=e}setHint(e){this.hint=e}}class k extends oe{code;context;constructor(e,n,o){super({message:e,name:"CerebroError"}),this.code=n,this.context=o}}const z=t=>"Deno"in t,W=t=>"Bun"in t,ye=()=>{if(z(globalThis)){const t=globalThis.Deno,e=t.execPath();let n=e;try{const{importMeta:o}=globalThis;o?.url&&(n=o.url)}catch{}return[e,n,...t.args]}return W(globalThis)?globalThis.Bun.process.argv:process.argv},Bn=()=>z(globalThis)?globalThis.Deno.cwd():W(globalThis)?globalThis.Bun.process.cwd():process.cwd(),he=()=>{if(z(globalThis)){const t=globalThis.Deno;return new Proxy(t.env.toObject(),{get:(e,n)=>typeof n=="string"?t.env.get(n):e[n],has:(e,n)=>typeof n=="string"?t.env.has(n):n in e,set:(e,n,o)=>typeof n=="string"?(o===void 0||t.env.set(n,o),!0):!1})}return W(globalThis)?globalThis.Bun.process.env:process.env},At=()=>z(globalThis)?[]:W(globalThis)?globalThis.Bun.process.execArgv:process.execArgv,kt=()=>z(globalThis)?globalThis.Deno.execPath():W(globalThis)?globalThis.Bun.process.execPath:process.execPath,Rn=()=>{if(z(globalThis)){const t=globalThis.Deno.build?.os??"unknown";return t==="windows"?"win32":t}return W(globalThis)?globalThis.Bun.platform??"unknown":process.platform},zn=()=>{if(z(globalThis)){const t=globalThis.Deno.build?.arch??"unknown";return t==="x86_64"?"x64":t==="aarch64"?"arm64":t}return W(globalThis)?globalThis.Bun.process.arch:process.arch},R=(t=0)=>{if(z(globalThis))throw globalThis.Deno.exit(t),new Error("Deno exit failed");if(W(globalThis))throw globalThis.Bun.process.exit(t),new Error("Bun exit failed");process.exit(t)},je=(t,e)=>{if(z(globalThis))return()=>{};if(W(globalThis)){try{const o=globalThis.Bun;if(o.process?.on)return o.process.on(t,e),()=>{o.process?.removeListener&&o.process.removeListener(t,e)}}catch{}return()=>{}}const n=process;return n.on(t,e),()=>{n.removeListener(t,e)}},B=new Uint32Array(65536),Wn=(t,e)=>{const n=t.length,o=e.length,s=1<<n-1;let i=-1,c=0,a=n,u=n;for(;u--;)B[t.charCodeAt(u)]|=1<<u;for(u=0;u<o;u++){let r=B[e.charCodeAt(u)];const l=r|c;r|=(r&i)+i^i,c|=~(r|i),i&=r,c&s&&a++,i&s&&a--,c=c<<1|1,i=i<<1|~(l|c),c&=l}for(u=n;u--;)B[t.charCodeAt(u)]=0;return a},Fn=(t,e)=>{const n=e.length,o=t.length,s=[],i=[],c=Math.ceil(n/32),a=Math.ceil(o/32);for(let p=0;p<c;p++)i[p]=-1,s[p]=0;let u=0;for(;u<a-1;u++){let p=0,g=-1;const $=u*32,w=Math.min(32,o)+$;for(let y=$;y<w;y++)B[t.charCodeAt(y)]|=1<<y;for(let y=0;y<n;y++){const b=B[e.charCodeAt(y)],N=i[y/32|0]>>>y&1,E=s[y/32|0]>>>y&1,I=b|p,O=((b|E)&g)+g^g|b|E;let m=p|~(O|g),v=g&O;m>>>31^N&&(i[y/32|0]^=1<<y),v>>>31^E&&(s[y/32|0]^=1<<y),m=m<<1|N,v=v<<1|E,g=v|~(I|m),p=m&I}for(let y=$;y<w;y++)B[t.charCodeAt(y)]=0}let r=0,l=-1;const d=u*32,h=Math.min(32,o-d)+d;for(let p=d;p<h;p++)B[t.charCodeAt(p)]|=1<<p;let f=o;for(let p=0;p<n;p++){const g=B[e.charCodeAt(p)],$=i[p/32|0]>>>p&1,w=s[p/32|0]>>>p&1,y=g|r,b=((g|w)&l)+l^l|g|w;let N=r|~(b|l),E=l&b;f+=N>>>o-1&1,f-=E>>>o-1&1,N>>>31^$&&(i[p/32|0]^=1<<p),E>>>31^w&&(s[p/32|0]^=1<<p),N=N<<1|$,E=E<<1|w,l=E|~(y|N),r=N&y}for(let p=d;p<h;p++)B[t.charCodeAt(p)]=0;return f},qn=(t,e)=>{if(t.length<e.length){const n=e;e=t,t=n}return e.length===0?t.length:t.length<=32?Wn(t,e):Fn(t,e)},Gn=ve(import.meta.url),ae=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,Hn=t=>{if(typeof ae<"u"&&ae.versions&&ae.versions.node){const[e,n]=ae.versions.node.split(".").map(Number);if(e>22||e===22&&n>=3||e===20&&n>=16)return ae.getBuiltinModule(t)}return Gn(t)},{createRequire:Jn}=Hn("node:module"),Et=String.raw,Ve=Et`\p{Emoji}(?:\p{EMod}|[\u{E0020}-\u{E007E}]+\u{E007F}|\uFE0F?\u20E3?)`,Kn=()=>new RegExp(Et`\p{RI}{2}|(?)${Ve}(?:\u200D${Ve})*`,"gu");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]]));const gs=/^[ \t]*(?:\r\n|\r|\n)/,ws=/(?:\r\n|\r|\n)[ \t]*$/,ys=/^(?:[\r\n]|$)/,vs=/(?:\r\n|\r|\n)([ \t]*)(?:[^ \t\r\n]|$)/,$s=/^[ \t]*[\r\n][ \t\r\n]*$/,bs=/\r\n|\n|\r/g,xs=/[\u001B\u009B](?:[[()#;?]{0,10}(?:\d{1,4}(?:;\d{0,4})*)?[0-9A-ORZcf-nqry=><]|\]8;;[^\u0007\u001B]{0,100}(?:\u0007|\u001B\\))/g,Ns=/[\u0000-\u0008\n-\u001F\u007F-\u009F]{1,1000}/y,G=Kn(),Yn=/[-_./\s]+/g,we=/(\u001B\[[0-9;]*[a-z])/i,Be=new RegExp("\\p{Script=Arabic}","u"),Qn=new RegExp("\\p{Script=Bengali}","u"),X=new RegExp("\\p{Script=Cyrillic}","u"),Zn=new RegExp("\\p{Script=Devanagari}","u"),Xn=new RegExp("\\p{Script=Ethiopic}","u"),xe=new RegExp("\\p{Script=Greek}","u"),Re=new RegExp("\\p{Script=Greek}+|\\p{Script=Latin}+|[^\\p{Script=Greek}\\p{Script=Latin}]+","gu"),eo=new RegExp("\\p{Script=Gujarati}","u"),to=new RegExp("\\p{Script=Gurmukhi}","u"),ze=new RegExp("\\p{Script=Hangul}","u"),We=new RegExp("\\p{Script=Hebrew}","u"),no=new RegExp("\\p{Script=Hiragana}","u"),Fe=new RegExp("\\p{Script=Han}","u"),oo=new RegExp("\\p{Script=Kannada}","u"),io=new RegExp("\\p{Script=Katakana}","u"),so=new RegExp("\\p{Script=Khmer}","u"),ro=new RegExp("\\p{Script=Lao}","u"),M=new RegExp("\\p{Script=Latin}","u"),ao=new RegExp("\\p{Script=Malayalam}","u"),lo=new RegExp("\\p{Script=Myanmar}","u"),co=new RegExp("\\p{Script=Oriya}","u"),uo=new RegExp("\\p{Script=Sinhala}","u"),ho=new RegExp("\\p{Script=Tamil}","u"),po=new RegExp("\\p{Script=Telugu}","u"),fo=new RegExp("\\p{Script=Thai}","u"),mo=new RegExp("\\p{Script=Tibetan}","u"),qe=/[\u02BB\u02BC\u0027]/u,go=t=>t.replace(G,"");let wo=class{capacity;cache;constructor(e){this.capacity=e,this.cache=new Map}get(e){if(!this.cache.has(e))return;const n=this.cache.get(e);return this.cache.delete(e),this.cache.set(e,n),n}has(e){return this.cache.has(e)}set(e,n){if(this.cache.has(e))this.cache.delete(e);else if(this.cache.size>=this.capacity){const o=this.cache.keys().next().value;o!==void 0&&this.cache.delete(o)}this.cache.set(e,n)}delete(e){this.cache.delete(e)}clear(){this.cache.clear()}size(){return this.cache.size}};const yo=Jn(import.meta.url),le=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,vo=t=>{if(typeof le<"u"&&le.versions&&le.versions.node){const[e,n]=le.versions.node.split(".").map(Number);if(e>22||e===22&&n>=3||e===20&&n>=16)return le.getBuiltinModule(t)}return yo(t)},{stripVTControlCharacters:$o}=vo("node:util"),Ne=new wo(1e3),bo=/[.*+?^${}()|[\]\\]/g,xo=t=>{const e=t.join("");if(Ne.has(e)){const s=Ne.get(e);return s.lastIndex=0,s}const n=t.map(s=>s.replaceAll(bo,String.raw`\$&`)).join("|"),o=new RegExp(n,"g");return Ne.set(e,o),o},No=t=>{const e=[];let n=0,o;for(G.lastIndex=0;(o=G.exec(t))!==null;)o.index>n&&e.push(t.slice(n,o.index)),e.push(o[0]),n=G.lastIndex;return n<t.length&&e.push(t.slice(n)),e.filter(Boolean)},Ao=/[ČŠŽĐ]/i,Ct=new Uint8Array(128),Ot=new Uint8Array(128),_t=new Uint8Array(128);for(let t=0;t<128;t++)Ct[t]=t>=65&&t<=90?1:0,Ot[t]=t>=97&&t<=122?1:0,_t[t]=t>=48&&t<=57?1:0;const Ae=t=>Ct[t],Ge=t=>Ot[t],ke=t=>_t[t],F=(t,e,n,o,s)=>{if(t.length===0)return[];let i=!1;const c=Object.values(e);for(const f of c)if(f(t[0])){i=!0;break}if(!i&&!n)return[t];const a=[...t],u=[];let r=a[0],l="other";const d=Object.entries(e);for(const f of d){const[p,g]=f;if(g(a[0])){l=p;break}}let h=n&&o?a[0]===a[0].toLocaleUpperCase(o):!1;for(let f=1;f<a.length;f++){const p=a[f];let g="other";for(const y of d){const[b,N]=y;if(N(p)){g=b;break}}const $=n&&o?p===p.toLocaleUpperCase(o):!1;let w=!1;s?w=s(l,g,h,$,p,f,a):(l!==g&&l!=="other"&&g!=="other"&&(w=!0),n&&g!=="other"&&!h&&$&&(w=!0)),w?(u.push(r),r=p):r+=p,l=g,n&&(h=$)}return r&&r.length>0&&u.push(r),u.length>0?u:[t]},ko=(t,e,n,o)=>{if(n.size===0)return e;for(const s of n)if(t.startsWith(s,e))return o.push(s),e+s.length;return e},It=(t,e=new Set)=>{if(t.length===0)return[];if(t.toUpperCase()===t)return[t];let n=0;const o=[],s=t.length;for(let i=1;i<s;i++){const c=ko(t,n,e,o);if(c!==n){n=c,i=n-1;continue}const a=t.codePointAt(i-1),u=t.codePointAt(i),r=a&&a<128&&Ae(a),l=u&&u<128&&Ae(u),d=a&&a<128&&Ge(a),h=a&&a<128&&ke(a),f=u&&u<128&&ke(u);if(d&&l){o.push(t.slice(n,i)),n=i;continue}if(h&&!f||!h&&f){o.push(t.slice(n,i)),n=i;continue}if(f&&!h){let p=!1,g=!1;if(i+1<s){const $=t.codePointAt(i+1);p=$&&$<128&&Ae($),g=$&&$<128&&ke($)}if(!g&&p){o.push(t.slice(n,i),t.slice(i,i+1)),n=i+1;continue}}if(i+1<s){const p=t.codePointAt(i+1),g=p&&p<128&&Ge(p);if(r&&l&&g){const $=t.slice(n,i+1);e.has($)||(o.push(t.slice(n,i)),n=i)}}}return n<s&&o.push(t.slice(n)),o.filter(i=>i!=="")},Lt=(t,e,n)=>{if(t.length===0)return[];const o=t===t.toLocaleUpperCase(e);if(e.startsWith("de")){if(!o&&t.replaceAll("ß","SS")===t.toLocaleUpperCase(e))return[t];const r=[...t],l=r.length,d=[];let h=r[0],f=r[0]===r[0].toLocaleUpperCase(e),p=f,g=f?0:-1;for(let $=1;$<l;$++){const w=r[$],y=w===w.toLocaleUpperCase(e);if(y===f)h+=w;else if(y)h&&h.length>0&&(d.push(h),h=w),p=!0,g=$;else{if(p&&$-g>1){const b=r[$-1],N=h.slice(0,-1);N&&N.length>0&&d.push(N),h=b+w}else h+=w;p=!1,g=-1}f=y}return h&&h.length>0&&d.push(h),d}if(e.startsWith("uk")||e.startsWith("ru")||e.startsWith("bg")||e.startsWith("sr")||e.startsWith("mk")||e.startsWith("be")){if(!X.test(t)&&!M.test(t))return[t];const r=[...t],l=r.length,d=[];let h=r[0];const f=r[0];let p;X.test(f)?p=1:M.test(f)?p=2:p=0;let g=f===f.toLocaleUpperCase(e);for(let w=1;w<l;w++){const y=r[w];let b;X.test(y)?b=1:M.test(y)?b=2:b=0;const N=y===y.toLocaleUpperCase(e);p!==b&&(p===1||p===2)&&(b===1||b===2)||b===p&&!g&&N?(d.push(h),h=y):h+=y,p=b,g=N}h&&h.length>0&&d.push(h);const $=[];for(let w=0;w<d.length;w++)w<d.length-1&&d[w].length===1&&M.test(d[w])&&X.test(d[w+1][0])?($.push(d[w]+d[w+1]),w+=1):$.push(d[w]);return $}if(e.startsWith("el")){if(!xe.test(t)&&!M.test(t))return[t];const r=[];Re.lastIndex=0;let l;for(;(l=Re.exec(t))!==null;)r.push(l[0]);r.length===0&&r.push(t);const d=[];if(r.length===1){const h=r[0];if(!h||!xe.test(h[0])||h.length===1)return[h??t]}for(const h of r){if(!h)continue;if(!xe.test(h[0])||h.length===1){d.push(h);continue}const f=h.length;let p=h[0],g=h[0]===h[0].toLocaleUpperCase(e);for(let $=1;$<f;$++){const w=h[$],y=w===w.toLocaleUpperCase(e);!g&&y?(d.push(p),p=w):p+=w,g=y}p&&d.push(p)}return d}if(e.startsWith("ja")||e.startsWith("ko")){const r=e.startsWith("ja"),l=r?{hiragana:h=>no.test(h),kanji:h=>Fe.test(h),katakana:h=>io.test(h),latin:h=>M.test(h)}:{hangul:h=>ze.test(h),latin:h=>M.test(h)},d=new Set(["が","で","と","に","の","は","へ","も","や","を"]);if(r){const h=F(t,l,!1,e,(p,g)=>p==="hiragana"&&g==="katakana"||p==="katakana"&&g==="hiragana"||p==="hiragana"&&g==="latin"||p==="katakana"&&g==="latin"||p==="kanji"&&g==="latin"||p==="latin"&&(g==="hiragana"||g==="katakana"||g==="kanji")),f=[];for(const p of h){const g=p;g.length===1&&d.has(g)&&f.length>0?f[f.length-1]=f.at(-1)+g:f.push(g)}return f.length>0?f:[t]}return F(t,l,!1,e,(h,f)=>h==="hangul"&&f==="latin"||h==="latin"&&f==="hangul")}if(e.startsWith("sl")){const r=[...t],l=r.length,d=[];let h=r[0],f=r[0]===r[0].toLocaleUpperCase(e);for(let p=1;p<l;p++){const g=r[p],$=g===g.toLocaleUpperCase(e),w=Ao.test(g),y=p<l-1&&r[p+1]===r[p+1].toLocaleUpperCase(e);!f&&$||w&&y?(d.push(h),h=g,w&&y&&(d.push(h),h="")):h+=g,f=$}return h&&h.length>0&&d.push(h),d}if(e.startsWith("zh"))return F(t,{han:r=>Fe.test(r),latin:r=>M.test(r)},!1,e);if(["ar","fa","he","ur"].includes(e.split("-")[0])){const r=l=>We.test(l)||Be.test(l);return F(t,{latin:l=>M.test(l),rtl:l=>r(l)},!1,e)}if(["am","bn","gu","hi","km","kn","lo","ml","mr","ne","or","pa","si","ta","te","th"].includes(e.split("-")[0])){const r=l=>Zn.test(l)||Qn.test(l)||eo.test(l)||to.test(l)||oo.test(l)||ho.test(l)||po.test(l)||ao.test(l)||uo.test(l)||fo.test(l)||ro.test(l)||mo.test(l)||lo.test(l)||Xn.test(l)||so.test(l)||co.test(l);return F(t,{indic:l=>r(l),latin:l=>M.test(l)},!1,e)}if(["be","bg","ru","sr","uk"].includes(e))return F(t,{cyrillic:r=>X.test(r),latin:r=>M.test(r)},!0,e);if(["ar","fa","he"].includes(e))return F(t,{latin:r=>M.test(r),rtl:r=>We.test(r)||Be.test(r)},!1,e);if(e.startsWith("ko"))return F(t,{hangul:r=>ze.test(r),latin:r=>M.test(r)},!1,e);if(e.startsWith("uz")){if(!X.test(t)&&!M.test(t))return[t];const r=[...t],l=r.length,d=[];let h=r[0],f=r[0]===r[0].toLocaleUpperCase(e);for(let p=1;p<l;p++){const g=r[p],$=g===g.toLocaleUpperCase(e);if(qe.test(g)||qe.test(r[p-1])){h+=g;continue}!f&&$?(d.push(h),h=g):h+=g,f=$}return h&&h.length>0&&d.push(h),d}const s=[...t],i=s.length,c=[];let a=s[0],u=s[0]===s[0].toLocaleUpperCase(e);for(const r of n)if(t.startsWith(r)){c.push(r),a=s[r.length],u=a===a.toLocaleUpperCase(e);break}for(let r=1;r<i;r++){const l=s[r],d=l===l.toLocaleUpperCase(e);let h=0;for(const f of n)if(t.startsWith(f,r)){c.push(a,f),h=f.length,a="";const p=f.at(-1);p&&(u=p===p.toLocaleUpperCase(e));break}if(h>0){r+=h-1;continue}!u&&d?(c.push(a),a=l):a+=l,u=d}return a&&c.push(a),c},Eo=(t,e,n)=>{const o=[],s=we.test(t)?t.split(we).filter(Boolean):[t];for(const i of s){const c=i;if(we.test(c))o.push(c);else{G.lastIndex=0;const a=G.test(c)?No(c).filter(Boolean):[c];for(const u of a)if(G.lastIndex=0,G.test(u))o.push(u);else if(e){const r=e.toLowerCase().split("-")[0];o.push(...Lt(u,r,n))}else o.push(...It(u,n))}}return o},Co=(t,e={})=>{if(!t||typeof t!="string")return[];const{handleAnsi:n=!1,handleEmoji:o=!1,knownAcronyms:s=[],locale:i,normalize:c=!1,separators:a,stripAnsi:u=!1,stripEmoji:r=!1}=e,l=new Set([...s].toSorted((w,y)=>y.length-w.length));let d=t;u&&(d=$o(d)),r&&(d=go(d));let h;Array.isArray(a)?h=xo(a):a instanceof RegExp?h=a:h=Yn;const f=[];let p=d;const g=h.flags.includes("g")?h:new RegExp(h.source,`${h.flags}g`);for(;p.length>0;){const w=g.exec(p);if(!w){p===".."?f.push(".."):p==="."?f.push("."):p.length>0&&f.push(p);break}const y=w.index,b=w[0],N=b.length,E=p.slice(0,y),I=p.slice(y+N);if(b.startsWith("../"))f.push(".."),p=p.slice(y+3);else if(b.startsWith("./"))f.push("."),p=p.slice(y+2);else if(y===0&&b==="..")f.push(".."),p=p.slice(2);else if(y===0&&b===".")f.push("."),p=p.slice(1);else{E.length>0&&f.push(E);let O=0;for(;(O=b.indexOf("../",O))!==-1;)f.push(".."),O+=3;for(O=0;(O=b.indexOf("./",O))!==-1;)(O===0||b[O-1]!==".")&&f.push("."),O+=2;let m=I;for(;m.startsWith("../");)f.push(".."),m=m.slice(3);for(;m.startsWith("./");)f.push("."),m=m.slice(2);if(m===".."){f.push("..");break}else if(m==="."){f.push(".");break}else p=m}g.lastIndex=0}if(f.length===0){const w=d.split(h).filter(Boolean);f.push(...w)}let $=[];for(const w of f)n||o?$.push(...Eo(w,i,l)):i?$.push(...Lt(w,i,l)):$.push(...It(w,l));return c&&($=$.map(w=>l.has(w)?w:i&&w===w.toLocaleUpperCase(i)?w[0]+w.slice(1).toLocaleLowerCase(i):w.toUpperCase()===w&&!l.has(w)?w.slice(0,1)+w.slice(1).toLowerCase():w)),$},Oo=ve(import.meta.url),ce=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,_o=t=>{if(typeof ce<"u"&&ce.versions&&ce.versions.node){const[e,n]=ce.versions.node.split(".").map(Number);if(e>22||e===22&&n>=3||e===20&&n>=16)return ce.getBuiltinModule(t)}return Oo(t)},{writeFile:Io,stat:Lo,rm:So,readFile:He,readdir:To,mkdir:Mo,access:Po}=_o("node:fs/promises"),de=[{alias:"v",description:"Turn on verbose output",group:"global",name:"verbose",type:Boolean},{description:"Turn on debugging output",group:"global",name:"debug",type:Boolean},{alias:"h",description:"Print out helpful usage information",group:"global",name:"help",type:Boolean},{alias:"q",description:"Silence output",group:"global",name:"quiet",type:Boolean},{alias:"V",description:"Print version info",group:"global",name:"version",type:Boolean},{description:"Turn off colored output",group:"global",name:"no-color",type:Boolean},{description:"Force colored output",group:"global",name:"color",type:Boolean}];let H=class extends k{commandName;constructor(t,e=[]){const n=`Command "${t}" not found${e.length>0?`. Did you mean: ${e.join(", ")}?`:""}`;super(n,"COMMAND_NOT_FOUND",{commandName:t,suggestions:e}),this.name="CommandNotFoundError",this.commandName=t,e.length>0&&(this.hint=`Try one of these commands: ${e.join(", ")}`)}},St=class extends k{option1;option2;constructor(t,e){super(`Options "${t}" and "${e}" cannot be used together`,"CONFLICTING_OPTIONS",{option1:t,option2:e}),this.name="ConflictingOptionsError",this.option1=t,this.option2=e,this.hint=`Remove either --${t} or --${e}`}},Do=class extends k{unknownOptions;constructor(t,e){const n=t.join(", "),o=`Found unknown ${t.length===1?"option":"options"}: ${n}`;super(o,"UNKNOWN_OPTION",{suggestions:e,unknownOptions:t}),this.name="UnknownOptionError",this.unknownOptions=t,e&&e.length>0&&(this.hint=`Did you mean: ${e.join(", ")}?`)}},Uo=class extends k{pluginName;constructor(t,e,n){super(`Plugin "${t}" error: ${e}`,"PLUGIN_ERROR",{originalError:n,pluginName:t}),this.name="PluginError",this.pluginName=t,n&&(this.cause=n)}},jo=class{logger;plugins=new Map;initialized=!1;cachedDependencyOrder=void 0;constructor(t){this.logger=t}hasPlugins(){return this.plugins.size>0}register(t){if(this.initialized)throw new Error(`Cannot register plugin "${t.name}" after initialization`);if(this.plugins.has(t.name))throw new Error(`Plugin "${t.name}" is already registered`);he().CEREBRO_OUTPUT_LEVEL===String(V)&&this.logger.debug(`registering plugin: ${t.name}`),this.plugins.set(t.name,t),this.cachedDependencyOrder=void 0}async init(t){if(this.initialized)throw new Error("PluginManager already initialized");if(this.plugins.size===0){this.logger.debug("no plugins registered, skipping initialization"),this.initialized=!0;return}this.validateDependencies();const e=this.getDependencyOrder();this.logger.debug(`initializing ${String(e.length)} plugin(s)...`);for(const n of e)if(typeof n.init=="function"){this.logger.debug(`initializing plugin: ${n.name}`);try{await n.init(t)}catch(o){const s=new Uo(n.name,`Failed to initialize: ${o instanceof Error?o.message:String(o)}`,o instanceof Error?o:void 0);throw this.logger.error(s.message),s}}this.initialized=!0}async executeLifecycle(t,e,n){if(!this.initialized)throw new Error("PluginManager not initialized");if(this.plugins.size===0)return;const o=this.getDependencyOrder();for(const s of o){const i=s[t];if(typeof i=="function"){this.logger.debug(`executing ${t} hook for plugin: ${s.name}`);try{await(t==="afterCommand"?i(e,n):i(e))}catch(c){throw this.logger.error(`Error in ${t} hook for plugin "${s.name}":`,c),c}}}}async executeErrorHandlers(t,e){if(!this.initialized||this.plugins.size===0)return;const n=this.getDependencyOrder();for(const o of n)if(typeof o.onError=="function"){this.logger.debug(`executing error handler for plugin: ${o.name}`);try{await o.onError(t,e)}catch(s){this.logger.error(`Error in error handler for plugin "${o.name}":`,s)}}}getDependencyOrder(){if(this.cachedDependencyOrder!==void 0)return this.cachedDependencyOrder;const t=[],e=new Set,n=new Set,o=s=>{if(e.has(s))return;if(n.has(s))throw new Error(`Circular dependency detected involving plugin "${s}"`);const i=this.plugins.get(s);if(!i)throw new Error(`Plugin "${s}" not found`);if(n.add(s),i.dependencies)for(const c of i.dependencies)o(c);n.delete(s),e.add(s),t.push(i)};for(const s of this.plugins.keys())o(s);return this.cachedDependencyOrder=t,t}validateDependencies(){for(const t of this.plugins.values())if(t.dependencies){for(const e of t.dependencies)if(!this.plugins.has(e))throw new Error(`Plugin "${t.name}" depends on "${e}" which is not registered`)}}};const pe=t=>t.type?.name==="Boolean",Vo=t=>{let e=t.type?t.type.name.toLowerCase():"string";const n=t.multiple??t.lazyMultiple?"[]":"";return e&&(e=e==="boolean"?"":`{underline ${e}${n}}`),e},Je=t=>(pe(t)||(t.typeLabel=t.typeLabel??Vo(t),t.defaultOption&&(t.typeLabel=`${t.typeLabel} (D)`),t.required&&(t.typeLabel=`${t.typeLabel} (R)`)),t),Bo=new RegExp(/^-([^\d-])$/),Ro=new RegExp(/^--(\S+)/),zo=new RegExp(/^-([^\d-]{2,})$/),Wo=t=>Bo.test(t)||Ro.test(t)||zo.test(t),Fo=(t,e)=>{const n=e[0]&&Wo(e[0])||e.length===0?null:e.shift()??null;if(!t.includes(n)){const o=new Error(`Command not recognised: ${String(n)}`);throw o.command=n,o.name="INVALID_COMMAND",o}return{argv:e,command:n}};class Te extends oe{optionName;value;constructor(e,n,o){super({hint:`Pass a valid ${o} value for '${e}'.`,message:`Invalid ${o} value '${n}' for option '${e}'`,name:"INVALID_VALUE",title:"Invalid Value"}),this.optionName=e,this.value=n,Object.setPrototypeOf(this,Te.prototype)}}let qo=class Tt extends oe{optionName;constructor(e){super({cause:void 0,hint:`Remove the duplicate option '${e}' from your command line arguments.`,location:void 0,message:`Option '${e}' is already set`,name:"ALREADY_SET",stack:void 0,title:"Option Already Set"}),this.optionName=e,Object.setPrototypeOf(this,Tt.prototype)}},Ke=class Mt extends oe{optionName;constructor(e){super({cause:void 0,hint:`Check your option definitions or remove the unknown option '${e}' from your command line arguments.`,location:void 0,message:`Unknown option: --${e}`,name:"UNKNOWN_OPTION",stack:void 0,title:"Unknown Option"}),this.optionName=`--${e}`,Object.setPrototypeOf(this,Mt.prototype)}},Go=class Pt extends oe{value;constructor(e){super({hint:"Use a defined option or add a defaultOption to capture this value.",message:`Unknown value: ${e}`,name:"UNKNOWN_VALUE",title:"Unknown Value"}),this.value=e,Object.setPrototypeOf(this,Pt.prototype)}};class S extends oe{constructor(e,n){super({cause:void 0,hint:n,location:void 0,message:e,name:"INVALID_DEFINITIONS",stack:void 0,title:"Invalid Option Definition"}),Object.setPrototypeOf(this,S.prototype)}}const Ye=(t,e,n)=>{const o=Number(t);if(e&&Number.isNaN(o)&&String(t).trim().toLowerCase()!=="nan")throw new Te(n??"",String(t),"Number");return o},Qe=t=>t===Boolean||typeof t=="function"&&t.name==="Boolean",Ze=t=>t===Number||typeof t=="function"&&t.name==="Number",Xe=t=>t===String||typeof t=="function"&&t.name==="String",Ho=(t,e,n={})=>{const{optionName:o,strictTypes:s}=n;return Array.isArray(t)?Qe(e)?t.map(Boolean):Ze(e)?t.map(i=>Ye(i,s,o)):Xe(e)?t.map(String):t.map(i=>e(String(i))):t===null?null:Qe(e)?!!t:Ze(e)?Ye(t,s,o):Xe(e)?typeof t=="string"?t:String(t):e(typeof t=="string"?t:String(t))},_=(t,e,n,...o)=>{t&&console.debug(`[command-line-args:${n}] ${e}`,...o)},Jo=/-([a-z])/g,Ko=/^\d+$/,fe=t=>t===Boolean||typeof t=="function"&&t.name==="Boolean",Yo=t=>t.codePointAt(0)===95,et=(t,e)=>Array.isArray(t)?[...t,...e]:[t,...e],tt=t=>t==="__proto__"||t==="constructor"||t==="prototype",nt=(t,e,n,o=!1)=>{t[e]===void 0?t[e]=o?[n]:n:o&&Array.isArray(t[e])?t[e].push(n):t[e]=[t[e],n]},ot=(t,e,n,o,s)=>{let i=e.get(t)??n.get(t);if(!i&&o){const c=t.toLowerCase();i=o.get(c)??s?.get(c)}return i},Qo=(t,e,n,o)=>{const s=n.debug??!1;_(s,"resolveArgs called with options:","resolver",{partial:n.partial,stopAtFirstUnknown:n.stopAtFirstUnknown}),_(s,"Starting argument resolution","resolver"),_(s,"Tokens:","resolver",t),_(s,"Definitions:","resolver",e),_(s,"Processing tokens...","resolver");const i=new Map,c=new Map,a=n.caseInsensitive?new Map:void 0,u=n.caseInsensitive?new Map:void 0,r=n.camelCase?new Map:void 0,l=n.camelCase?new Map:void 0;for(const m of e)if(i.set(m.name,m),m.alias&&c.set(m.alias,m),n.caseInsensitive&&a&&(a.set(m.name.toLowerCase(),m),m.alias&&u&&u.set(m.alias.toLowerCase(),m)),n.camelCase&&r&&l){const v=m.name.replaceAll(Jo,(x,L)=>L.toUpperCase());r.set(m.name,v),l.set(v,m.name)}const d=Object.create(null),h=Object.create(null),f=[],p=[],g=new Set;let $=!1;const w=e.find(m=>m.defaultOption),y=e.some(m=>m.group),b=e.find(m=>m.type===Number);for(let m=0;m<t.length;m++){const v=t[m];if(v.kind==="option-terminator"){d._unknown=o.slice(v.index),$=!0;break}if(v.kind==="option"&&v.name){let x=ot(v.name,i,c,a,u);!x&&v.value===void 0&&b&&Ko.test(v.name)&&(x=b,v.value=v.name,v.name=b.name);let L=!1;if(!x&&n.negation&&v.value===void 0&&v.name.startsWith("no-")){const C=v.name.slice(3),P=ot(C,i,c,a,u);P?.type&&fe(P.type)&&(x=P,L=!0)}const A=x?x.name:v.name,T=x?.multiple,D=x?.lazyMultiple;if(Object.hasOwn(h,A)&&h[A]!==void 0&&!T&&!D&&!n.partial)throw new qo(A);if(!x&&n.partial){const C=v.rawName??`--${v.name}${v.value!==void 0&&v.inlineValue?`=${v.value}`:""}`;f.push({index:v.index,value:C});continue}if(!x&&n.stopAtFirstUnknown){d._unknown=o.slice(v.index);break}if(!x&&!n.partial)throw new Ke(v.name);if(v.value===void 0){const C=t[m+1],P=C?.kind==="option"&&!("name"in C)&&C.value!==void 0,U=C&&x&&!(x.type&&fe(x.type))&&(C.kind==="positional"||P),Rt=x&&x.defaultOption&&!x.multiple&&!x.lazyMultiple;if(U&&(!x?.defaultOption||Rt))if(T){let j=m+1;const $e=[];for(;j<t.length&&(t[j].kind==="positional"||t[j].kind==="option"&&!("name"in t[j])&&t[j].value!==void 0);)$e.push(t[j].value),g.add(t[j].index),j++;h[A]=h[A]===void 0?$e:et(h[A],$e),m=j-1}else D?(nt(h,A,C.value,!0),g.add(C.index),m++):(h[A]=C.value,g.add(C.index),m++);else x?.type&&fe(x.type)?nt(h,A,!L,T):h[A]=T?[]:null}else{let{value:C}=v;if(x?.type&&fe(x.type))switch(C){case"":{if(n.partial){h._unknown??=[];const U=`${v.rawName??`--${v.name}`}${v.value?`=${v.value}`:""}`;h._unknown.push(U),p.push({index:v.index,value:U}),C=!0}else throw new Ke(v.name);break}case"false":{C=!1;break}case"true":{C=!0;break}default:C=!0}const P=[C];if(T){let U=m+1;for(;U<t.length&&t[U].kind==="positional";)P.push(t[U].value),g.add(t[U].index),U++;m=U-1}h[A]===void 0?h[A]=T||D?P:C:T||D?h[A]=et(h[A],P):h[A]=C}}else if(v.kind==="positional"&&n.stopAtFirstUnknown&&!g.has(v.index)&&!w){_(s,`Found unconsumed positional token at index ${String(v.index)}, stopping processing`,"resolver"),d._unknown=o.slice(v.index);break}}for(const[m,v]of Object.entries(h)){const x=i.get(m);x&&(x.multiple||x.lazyMultiple)&&!Array.isArray(v)&&(h[m]=[v])}const N=m=>m.kind==="option"&&!i.has(m.name??"")&&!c.has(m.name??"")&&(!n.caseInsensitive||!a?.has(m.name?.toLowerCase()??"")&&!u?.has(m.name?.toLowerCase()??""));let E=-1,I=Number.POSITIVE_INFINITY;if(n.stopAtFirstUnknown&&!$&&(E=t.findIndex(m=>N(m)),E!==-1&&(I=t[E].index)),w){const m=[],v=[];for(const x of t)x.kind==="positional"&&!g.has(x.index)&&x.index<I&&(m.push(x.value),v.push(x));if(m.length>0){const x=h[w.name],L=w.multiple??w.lazyMultiple;x===void 0?L?(v.forEach(A=>g.add(A.index)),h[w.name]=m):(g.add(v[0].index),h[w.name]=m[0]):L&&(v.forEach(A=>g.add(A.index)),h[w.name]=Array.isArray(x)?[...m,...x]:[...m,x])}}if(!n.partial){for(const m of t)if(m.kind==="positional"&&!g.has(m.index))throw new Go(o[m.index])}if(n.partial&&!n.stopAtFirstUnknown){const m=[...f];if(h._unknown)for(const v of p)m.push({index:v.index,value:v.value});for(const v of t)v.kind==="positional"&&!g.has(v.index)&&m.push({index:v.index,value:o[v.index]});m.length>0&&(m.sort((v,x)=>v.index-x.index),d._unknown=m.map(v=>v.value))}if(n.stopAtFirstUnknown&&!$){const m=t.findIndex(x=>x.kind==="positional"&&!g.has(x.index));let v=-1;if(E!==-1&&m!==-1?v=Math.min(E,m):E!==-1?v=E:m!==-1&&(v=m),v>=0){const x=t[v].index;d._unknown=o.slice(x)}}else f.length>0&&!n.partial&&(d._unknown=f.map(m=>m.value));for(const[m,v]of Object.entries(h)){const x=n.camelCase?r?.get(m)??m:m,L=i.get(m);L?.type?d[x]=Ho(v,L.type,{optionName:L.name,strictTypes:n.strictTypes}):d[x]=v===void 0?null:v}for(const m of e){const v=n.camelCase?r?.get(m.name)??m.name:m.name;!(v in d)&&m.defaultValue!==void 0&&(m.multiple??m.lazyMultiple?d[v]=Array.isArray(m.defaultValue)?[...m.defaultValue]:[m.defaultValue]:d[v]=m.defaultValue)}if(y){const m={},v={},x={};for(const A of e)if(A.group){const T=Array.isArray(A.group)?A.group:[A.group];for(const D of T)tt(D)||(m[D]??={})}for(const A of Object.keys(d))if(!Yo(A)){v[A]=d[A];let T=A;n.camelCase&&(T=l?.get(A)??A);const D=i.get(T);if(D?.group){const C=Array.isArray(D.group)?D.group:[D.group];for(const P of C)tt(P)||m[P]&&(m[P][A]=d[A])}else x[A]=d[A]}const L={_all:v};for(const[A,T]of Object.entries(m))L[A]=T;Object.keys(x).length>0&&(L._none=x),d._unknown&&(L._unknown=d._unknown),Object.keys(d).forEach(A=>delete d[A]),Object.assign(d,L)}const O=Object.defineProperties({},Object.getOwnPropertyDescriptors(d));return _(s,"Final parsed result:","resolver",O),O},ne="-".codePointAt(0),K="=",Zo=K.codePointAt(0),Xo="--",ei="-",ti="--",Dt=t=>t.length>2&&t.startsWith(ti),ni=t=>Dt(t)&&!t.includes(K,3),oi=t=>Dt(t)&&t.includes(K,3),ii=t=>{if(t.length!==2||t.codePointAt(0)!==ne||t.codePointAt(1)===ne)return!1;const e=t.codePointAt(1);return e!==void 0&&(e<48||e>57)},si=t=>!(t.length<=2||t.codePointAt(0)!==ne||t.codePointAt(1)===ne),ri=t=>{const e=[];let n=0,o=[],s=0,i=-1,c=0;for(;s<o.length||n<t.length;){let a;if(s<o.length?(a=o[s],s++):(a=t[n],n++),c>0?c--:i++,a===Xo){e.push({index:i,kind:"option-terminator"});const u=[...o.slice(s),...t.slice(n)],r=u.map((l,d)=>({index:i+d+1,kind:"positional",value:l}));e.push(...r),i+=u.length;break}if(ii(a)){const u=a.charAt(1);e.push({index:i,kind:"option",name:u,rawName:a});continue}if(si(a)&&!a.includes(K)){const u=[];let r="",l=!1;for(let d=1;d<a.length;d++){const h=a.charAt(d);l?r+=h:h.codePointAt(0)===Zo?l=!0:u.push(`${ei}${h}`)}if(l)if(u.length>0){const d=u.pop();u.push(`${d}=${r}`)}else u.push(r);o=s<o.length?[...u,...o.slice(s)]:u,s=0,c=u.length;continue}if(ni(a)){const u=a.slice(2);e.push({index:i,kind:"option",name:u,rawName:a});continue}if(oi(a)){const u=a.indexOf(K),r=a.slice(2,u),l=a.slice(u+1);e.push({index:i,inlineValue:!0,kind:"option",name:r,rawName:a,value:l});continue}if(a.length>2&&a.codePointAt(0)===ne&&a.codePointAt(1)!==ne&&a.includes(K)){const u=a.indexOf(K),r=a.charAt(1),l=a.slice(u+1);e.push({index:i,inlineValue:!0,kind:"option",name:r,rawName:a,value:l});continue}e.push({index:i,kind:"positional",value:a})}return e},ai=/\d/,li=t=>t===Boolean||typeof t=="function"&&t.name==="Boolean",ci=t=>typeof t=="function",ui=(t,e,n)=>{const o=n?.debug??!1;_(o,"Validating definitions:","validation",t,"caseInsensitive:",e);const s=new Set,i=new Set,c=new Set,a=new Set;let u=0;for(const r of t){if(_(o,"Checking definition:","validation",r),!r.name)throw _(o,"Validation failed: name is required","validation"),new S("Invalid option definition: name is required");if(typeof r.name!="string")throw new S("Invalid option definition: name must be a string");if(r.name.trim()==="")throw new S("Invalid option definition: name cannot be empty");const l=e?r.name.toLowerCase():"";if(s.has(r.name)||e&&c.has(l))throw new S(`Invalid option definition: duplicate name '${r.name}'`);if(i.has(r.name)||e&&a.has(l))throw new S(`Invalid option definition: name '${r.name}' conflicts with an existing alias`);if(s.add(r.name),e&&c.add(l),r.alias!==void 0){if(typeof r.alias!="string")throw new S("Invalid option definition: alias must be a string");if(r.alias.length!==1)throw new S("Invalid option definition: alias must be a single character");if(ai.test(r.alias))throw new S("Invalid option definition: alias cannot be numeric");if(r.alias==="-")throw new S('Invalid option definition: alias cannot be "-"');const d=e?r.alias.toLowerCase():"";if(i.has(r.alias)||e&&a.has(d))throw new S(`Invalid option definition: duplicate alias '${r.alias}'`);if(s.has(r.alias)||e&&c.has(d))throw new S(`Invalid option definition: alias '${r.alias}' conflicts with an existing option name`);i.add(r.alias),e&&a.add(d)}if(r.defaultOption&&(u++,r.type!==void 0&&li(r.type)))throw new S("Invalid option definition: defaultOption cannot be Boolean type");if(r.type!==void 0&&!(r.type===Boolean||r.type===Number||r.type===String||typeof r.type=="function"&&ci(r.type)))throw new S("Invalid option definition: invalid type")}if(u>1)throw _(o,"Validation failed: multiple defaultOptions not allowed","validation"),new S("Invalid option definition: multiple defaultOptions not allowed");_(o,"Validation completed successfully","validation")};function hi(t,e={}){const n=e.debug??!1;_(n,"Starting command-line-args parsing","index"),_(n,"Options:","index",e);const o={...e};o.stopAtFirstUnknown&&(o.partial=!0);const s=Array.isArray(t)?t:[t];_(n,"Normalized definitions:","index",s),ui(s,o.caseInsensitive,n?o:void 0);let{argv:i}=o;if(!i&&(i=process.argv.slice(2),process.execArgv.length>0)){const r=new Set(process.execArgv);i=i.filter(l=>!r.has(l))}_(n,"Using argv:","index",i);let c=i;o.caseInsensitive&&(c=i.map(r=>{if(r.startsWith("--")){const l=r.indexOf("="),d=(l===-1?r.slice(2):r.slice(2,l)).toLowerCase();return l===-1?`--${d}`:`--${d}${r.slice(l)}`}if(r.startsWith("-")&&!r.startsWith("--")&&r.length>1){const l=r.slice(1).split("=",2),d=l[0],h=l[1];if(!d)return r;const f=d.toLowerCase();return h===void 0?`-${f}`:`-${f}=${h}`}return r}));const a=ri(c.map(String));_(n,"Tokenized arguments:","index",a);const u=Qo(a,s,o,i);return _(n,"Command-line-args parsing completed","index"),u}class pi{result;argv;options;argument;command;commandName;env;logger;console;fs;process;runtime;rawUnknown;constructor(e,n){this.commandName=e,this.command=n}}let Ee=class extends k{commandName;constructor(t,e,n){super(`Failed to load command "${t}": ${e}`,"COMMAND_LOADER_ERROR",{commandName:t,reason:e}),this.name="CommandLoaderError",this.commandName=t,this.hint="Ensure the loader resolves to a module with a default export that is the command handler function.",n!==void 0&&(this.cause=n)}};const di=/^-{1,2}(\w+)(=(.+))?$/,Ut=(t,e,n,o)=>{const s=di.exec(t);if(s===null)return{};const i=s[1];if(!i)return{};const c=n&&o?n.get(i)??o.get(i):e.find(a=>a.name===i||a.alias===i);return c!==void 0?{argName:c.name,argValue:s[3],option:c}:{}},it=(t,e)=>{if(e.type===void 0)return t;if(e.type.name==="Boolean"){if(t==="true"||t==="1")return e.type(!0);if(t==="false"||t==="0")return e.type(!1)}return e.type(t)},fi=new Set(["0","1","false","true"]),mi=(t,e,n,o)=>{if(e.length===0||t.length===0)return{};const s=(i,c)=>{const{argName:a,argValue:u,option:r}=Ut(c,e,n,o),{lastOption:l}=i;return r&&pe(r)&&u&&a?i.partial[a]=it(u,r):i.lastName&&l&&pe(l)&&fi.has(c)&&(i.partial[i.lastName]=it(c,l)),{lastName:a,lastOption:r,partial:i.partial}};return t.reduce(s,{partial:{}}).partial},gi=new Set(["0","1","false","true"]),wi=(t,e,n,o)=>{if(e.length===0||t.length===0)return t;const s=(i,c)=>{const{argValue:a,option:u}=Ut(c,e,n,o),{lastOption:r}=i;if(r&&pe(r)&&gi.has(c)){const{args:l}=i;return{args:l.slice(0,-1)}}return u&&pe(u)&&a?{args:i.args}:{args:[...i.args,c],lastOption:u}};return t.reduce(s,{args:[]}).args},yi=t=>{const e=new Map;for(const n of t){const o=e.get(n.name);o?e.set(n.name,{...o,...n}):e.set(n.name,n)}return[...e.values()]},vi=t=>{if(t===void 0)return;const e=t.toLowerCase().trim();return e==="true"||e==="1"||e==="yes"||e==="on"},$i=(t,e)=>{if(!t.type)return e;if(e!==void 0){if(t.type===Boolean||typeof t.type=="function"&&t.type.name==="Boolean")return vi(e);if(t.type===Number||typeof t.type=="function"&&t.type.name==="Number"){const n=Number.parseFloat(e);return Number.isNaN(n)?void 0:n}return t.type===String||typeof t.type=="function"&&t.type.name==="String"?e:t.type(e)}},bi=/_./g,xi=/^[A-Z]/,Ni=t=>t.toLowerCase().replaceAll(bi,e=>e[1]?.toUpperCase()??e).replace(xi,e=>e.toLowerCase()),Ai=t=>{if(!t||t.length===0)return{};const e={},n=he();for(const o of t){const s=n[o.name],i=$i(o,s),c=i===void 0?o.defaultValue:i,a=Ni(o.name);e[a]=c}return e},ki=t=>{const e=new Map,n=new Map;for(const o of t)if(e.set(o.name,o),o.alias){const s=Array.isArray(o.alias)?o.alias:[o.alias];for(const i of s)n.set(i,o)}return{optionMapByAlias:n,optionMapByName:e}},jt=async t=>{if(typeof t.__resolvedExecute__=="function")return t.__resolvedExecute__;if(typeof t.loader!="function")throw new Ee(t.name,"no execute or loader defined");let e;try{e=await t.loader()}catch(o){throw new Ee(t.name,o instanceof Error?o.message:String(o),o)}const n=e.default;if(typeof n!="function")throw new Ee(t.name,"loader did not return a module with a default-exported handler function");return t.__resolvedExecute__=n,n},Ei=(t,e,n,o)=>{const s=new pi(t.name,t),{_all:i,_unknown:c,positionals:a}=e,u=Object.keys(n).length>0?{...i,...n}:i;ge in u&&delete u[ge],s.argument=a?.[ge]??[],s.rawUnknown=[...c??[]];const r=Object.keys(o).length>0;return s.options=r?{...u,...o}:u,s.env=Ai(t.env),s},Ci=(t,e,n)=>{const o=t.options??[],s=o.length>0;let i=yi(s?[...o,...n]:n);if(i.length>0){for(const r of i)if(r.multiple&&r.lazyMultiple)throw new Error(`Argument "${r.name}" cannot have both multiple and lazyMultiple options, please choose one.`)}t.argument&&(i=[{defaultOption:!0,description:t.argument.description,group:"positionals",multiple:!0,name:ge,type:t.argument.type,typeLabel:t.argument.typeLabel},...i]);let c,a;if(s){const{optionMapByAlias:r,optionMapByName:l}=ki(o);c=wi(e,o,l,r),a=mi(e,o,l,r)}else c=e,a={};const u=hi(i,{argv:c,camelCase:!0,partial:!0,stopAtFirstUnknown:!0});return{arguments_:i,booleanValues:a,parsedArgs:u}},ee=async(t,e,n)=>typeof t.execute=="function"?t.execute(e):(await jt(t))(e);let Oi=class extends k{commandName;missingOptions;constructor(t,e){super(`Command "${t}" is missing required options: ${e.join(", ")}`,"COMMAND_VALIDATION_ERROR",{commandName:t,missingOptions:e}),this.name="CommandValidationError",this.commandName=t,this.missingOptions=e,this.hint=`Provide the following required options: ${e.join(", ")}`}},_i=class extends k{choices;option;value;constructor(t,e,n){super(`Invalid value "${e}" for option "${t}". Allowed values: ${n.join(", ")}`,"INVALID_CHOICE",{choices:n,option:t,value:e}),this.name="InvalidChoiceError",this.option=t,this.value=e,this.choices=n,this.hint=`Use one of: ${n.map(o=>`--${t} ${o}`).join(", ")}`}};const st=(t,e,n=!1)=>{const o=[];for(const s of t)if(!(!n&&!s.required)&&e[s.name]===void 0){if(s.type?.name==="Boolean"){e[s.name]=!1;continue}o.push(s)}return o},Ii=(t,e)=>e.includes(t)?!0:Math.abs(t.length-e.length)>t.length/2?!1:qn(t,e)<=t.length/3,q=(t,e)=>{const n=t.toLowerCase();return e.filter(o=>Ii(o.toLowerCase(),n))},Li=(t,e)=>{const n=[];if(t._unknown&&t._unknown.forEach(o=>{const s=o.startsWith("--");let i=`Found unknown ${s?"option":"argument"} "${o}"`;if(s){const c=q(o.replace("--",""),(e.options??[]).map(a=>a.name));if(c.length>0){const[a,...u]=c.map(r=>`--${r}`);i+=u.length>0?`, did you mean ${a??""} or ${u.join(", ")}?`:`, did you mean ${a??""}?`}}n.push(i)}),n.length>0)throw new Error(n.join(`
|
|
28
|
-
`))},Si=(t,e,n)=>{const o=n.__requiredOptions__,s=o?st(o,e,!0):st(t,e,!1);if(s.length>0)throw new Oi(n.name,s.map(i=>i.name));e._unknown&&e._unknown.length>0&&!n.argument&&Li(e,n)},Ti=(t,e,n)=>{const o=n.__conflictingOptions__??t.filter(s=>s.conflicts!==void 0);if(o.length>0){const s=o.find(i=>Array.isArray(i.conflicts)?i.conflicts.some(c=>e[c]!==void 0)&&e[i.name]!==void 0:e[i.conflicts]!==void 0&&e[i.name]!==void 0);if(s)throw new St(s.name,typeof s.conflicts=="string"?s.conflicts:s.conflicts?.[0]??"unknown")}},Mi=(t,e)=>{const n=e.options;if(n)for(const o of n){if(!o.choices||o.choices.length===0)continue;const s=t[o.name];if(s==null)continue;const i=Array.isArray(s)?s:[s];for(const c of i){const a=String(c);if(!o.choices.includes(a))throw new _i(o.name,a,o.choices)}}},Pi=t=>{if(!Array.isArray(t.options))return;const e=new Map,n=new Map;for(const s of t.options){if(s.name){const i=e.get(s.name)??[];i.push(s),e.set(s.name,i)}if(typeof s.alias=="string"&&s.alias.length>0){const i=n.get(s.alias)??[];i.push(s),n.set(s.alias,i)}else if(Array.isArray(s.alias)){for(const i of s.alias)if(i.length>0){const c=n.get(i)??[];c.push(s),n.set(i,c)}}}const o=[];for(const[s,i]of e)i.length>1&&o.push(`Duplicate option name "${s}" in command "${t.name}": ${JSON.stringify(i)}`);for(const[s,i]of n)i.length>1&&o.push(`Duplicate option alias "-${s}" used by options ${i.map(c=>`"${c.name}"`).join(", ")} in command "${t.name}"`);if(o.length>0)throw new Error(o.join(`
|
|
29
|
-
`))},Di=(t,e)=>{if(e.length===0)return{argv:[],commandPath:void 0};const n=[];let o;for(let s=1;s<=e.length;s+=1){const i=e[s-1];if(i===void 0||i.startsWith("-"))break;n.push(i);const c=n.join(" ");t.has(c)&&(o={commandPath:[...n],depth:s})}return o?{argv:e.slice(o.depth),commandPath:o.commandPath}:{argv:e,commandPath:void 0}},J=t=>t.join(" "),rt=(t,e)=>e&&e.length>0?[...e,t]:[t],Ui=(t,e)=>typeof t!="string"||t===""?"":t[0].toLowerCase()+t.slice(1),ji=(t,e)=>typeof t!="string"||t===""?"":t[0].toUpperCase()+t.slice(1),Vi=(t,e)=>{const{length:n}=t;if(n===0)return"";if(n===1)return t[0];const o=[];let s="",i="";for(let c=0;c<n;c++){const a=t[c];if(we.test(a)){s?(o.push(s+i+a),s="",i=""):(o.length>0&&o.push(e),s=a);continue}s?(i&&(i+=e),i+=a):(o.length>0&&o.push(e),o.push(a))}return o.join("")},Vt=(t,e)=>{if(typeof t!="string"||!t)return"";let n=!0;return Vi(Co(t,{handleAnsi:e?.handleAnsi,handleEmoji:e?.handleEmoji,knownAcronyms:e?.knownAcronyms,locale:e?.locale,normalize:e?.normalize,separators:void 0,stripAnsi:e?.stripAnsi,stripEmoji:e?.stripEmoji}).map(o=>{const s=o,i=s.toLowerCase();return n?(n=!1,Ui(i)):ji(i)}),"")},Bi=/^no-/,Ri=t=>{t.options?.forEach(e=>{e.__camelCaseName__=Vt(e.name)})},zi=t=>{if(!Array.isArray(t.options)||t.options.length===0)return;const e=new Set;for(const o of t.options)e.add(o.name);const n=[];for(const o of t.options)if(o.name.startsWith("no-")){const s=o.name.replace(Bi,"");if(!e.has(s)){if(o.type!==Boolean)throw new Error(`Cannot add negated option "${o.name}" to command "${t.name}" because it is not a boolean.`);const i={...o,defaultValue:o.defaultValue===void 0?!0:!o.defaultValue,name:s};n.push(i),e.add(s)}}n.length>0&&t.options.push(...n)},Wi=(t,e)=>{if(!e.options||e.options.length===0)return;const{options:n}=t,o=new Map;for(const i of e.options)if(i.name.startsWith("no-")){const c=Vt(i.name);o.set(c,i)}const s=Object.keys(n).filter(i=>o.has(i));if(s.length!==0)for(const i of s){const c=i.charAt(2);if(!c)continue;const a=c.toLowerCase()+i.slice(3),u=o.get(i);u&&(u.__negated__=!0),n[a]=!n[i],Reflect.deleteProperty(n,i)}},Fi=(t,e)=>{if(!e.options||e.options.length===0)return;const n=new Map;for(const s of e.options)s.__camelCaseName__&&s.__negated__===void 0&&s.implies!==void 0&&n.set(s.__camelCaseName__,s);if(n.size===0)return;const{options:o}=t;for(const s of Object.keys(o)){const i=n.get(s);if(i?.implies){const{implies:c}=i;for(const[a,u]of Object.entries(c))o[a]===void 0&&(o[a]=u)}}},qi=()=>!!process.versions.electron,Gi=()=>qi()&&!process.defaultApp,Hi=()=>Gi()?0:1,Ji=t=>t.slice(Hi()+1),Ki=" ",Yi=(t,e)=>t===e?!0:t.length!==e.length?!1:t.every((n,o)=>n===e[o]),Qi=t=>{if(typeof t=="string")return t.split(Ki);const e=ye();return Yi(t,e)?Ji(t):t},Zi=t=>{const e=i=>{t.error(`Uncaught exception: ${i.message||i}`),i.stack&&t.error(i.stack),R(1)},n=(i,c)=>{if(i instanceof Error)t.error(`Promise rejection: ${i.message||i}`),i.stack&&t.error(i.stack);else{let a;if(typeof i=="string")a=i;else try{a=JSON.stringify(i)}catch{a=String(i)}t.error(`Promise rejection: ${a}`)}R(1)},o=je("uncaughtException",e),s=je("unhandledRejection",n);return()=>{o(),s()}},at=100,Xi=/^[a-z][\w-]*$/i,Ie=(t,e)=>{if(typeof t!="string"||t.trim().length===0)throw new k(`${e} must be a non-empty string`,"INVALID_INPUT",{fieldName:e,value:t});return t.trim()},lt=(t,e)=>{if(!Array.isArray(t)||!t.every(n=>typeof n=="string"))throw new k(`${e} must be an array of strings`,"INVALID_INPUT",{fieldName:e,value:t});return t},Ce=(t,e)=>{if(typeof t!="object"||t===null)throw new k(`${e} must be an object`,"INVALID_INPUT",{fieldName:e,value:t});return t},me=t=>{const e=Ie(t,"Command name");if(e.length>at)throw new k(`Command name is too long (maximum ${String(at)} characters)`,"INVALID_COMMAND_NAME",{commandName:e,length:e.length});if(e.includes("..")||e.includes("/")||e.includes("\\")||e.includes(";")||e.includes("|")||e.includes("&"))throw new k(`Command name "${e}" contains invalid characters`,"INVALID_COMMAND_NAME",{commandName:e});if(!Xi.test(e))throw new k(`Command name "${e}" must start with a letter and contain only letters, numbers, hyphens, and underscores`,"INVALID_COMMAND_NAME",{commandName:e});return e},es=new Set([`
|
|
30
|
-
`,"\r"," ","\0",'"',"$","&","'","(",")",";","<",">","[","\\","]","`","{","|","}"]),ts=(t,e={})=>{if(typeof t!="string")throw new TypeError("Argument must be a string");const n=typeof e=="boolean"?{checkDangerousChars:e}:e,o=n.maxArgumentLength??1e6;if(Number.isFinite(o)&&o>0&&t.length>o)throw new Error(`Argument is too long (maximum ${String(o)} characters)`);if(n.checkDangerousChars){for(const s of t)if(es.has(s))throw new Error(`Argument contains dangerous character: ${s}`)}return n.trim?t.trim():t},ct=(t,e={})=>{if(!Array.isArray(t))throw new TypeError("Arguments must be an array");const n=typeof e=="boolean"?{checkDangerousChars:e}:e,o=n.maxArguments??1e5;if(Number.isFinite(o)&&o>0&&t.length>o)throw new Error(`Too many arguments (maximum ${String(o)})`);return t.map(s=>ts(s,n))},ns=/^-([^\d-])$/,os=/^--(\S+)/,is=/^-([^\d-]{2,})$/,Oe=t=>ns.test(t)||os.test(t)||is.test(t),ss={access:(t,e)=>Po(t,e),mkdir:(t,e)=>Mo(t,e),readdir:t=>To(t),readFile:(async(t,e)=>e===void 0?He(t):He(t,e)),rm:(t,e)=>So(t,e),stat:t=>Lo(t),writeFile:(t,e,n)=>Io(t,e,n)},rs=(t,e,n)=>{const o=e.indexOf("--"),s=o===-1?new Set:new Set(e.slice(o+1)),i=n.filter(u=>u.startsWith("--")&&u!=="--"&&!s.has(u));if(i.length===0)return;const c=(t.options??[]).map(u=>u.name),a=i.flatMap(u=>q(u.slice(2),c).map(r=>`--${r}`));throw new Do(i,a)};class Me{#t;#e;#u;#h;#f;#m;#A;#k;#E;#$;#C;#b;#O;#_=be;#p;#n;#o;#i;#s;#r;#g=!1;#I;#L=!1;#w;#y;#v;#l=[];#D(){return this.#w===void 0&&(this.#w=[...this.#o.keys()]),this.#w}#S(){return this.#y===void 0&&(this.#y=[...this.#n.keys()]),this.#y}#a(){return this.#v===void 0&&(this.#v=[...this.#D(),...this.#S()]),this.#v}#T(){return this.#l.length===0?de:[...de,...this.#l]}#M(){this.#w=void 0,this.#y=void 0,this.#v=void 0}#x(){if(this.#u===void 0){const e=Qi(this.#e.argv);this.#u=ct(e,{maxArguments:this.#b}),this.#U()}return this.#u}#N(){return this.#$??he()}#d(e){this.#_=e,this.#N().CEREBRO_OUTPUT_LEVEL=String(e)}#c(){const e=this.#N().CEREBRO_OUTPUT_LEVEL,n=e===void 0?Number.NaN:Number(e);return Number.isNaN(n)?this.#_:n}#U(){if(!this.#u)return;let e=!1;for(const n of this.#u){if(n==="--quiet"||n==="-q"){this.#d(qt),e=!0;break}if(n==="--verbose"||n==="-v"){this.#d(Gt),e=!0;break}if(n==="--debug"){this.#d(V),e=!0;break}}e||this.#d(Object.hasOwn(this.#N(),"DEBUG")?V:be)}#j(){this.#L||(this.#I=Zi(this.#t),this.#L=!0)}#V(){return{arch:zn(),argv:this.#x(),cwd:this.#h,env:this.#$??he(),exit:this.#E??(e=>R(e??0)),platform:Rn(),stdin:this.#C}}#P(e,n,o,s){this.#c()===V&&this.#t.debug(`command '${s}' found, parsing command args: ${n.join(", ")}`);const{arguments_:i,booleanValues:c,parsedArgs:a}=Ci(e,n,this.#T()),u=Object.keys(c).length>0;let r=a;u&&(r={...a,_all:{...a._all,...c}}),Si(i,r,e);const l=Ei(e,a,c,o);l.runtime=this,l.argv=this.#x(),l.fs=this.#k??ss,l.process=this.#V(),l.console=this.#t;const d=e.options&&e.options.length>0;if(d&&e.options){const h=e.options.filter(f=>f.name.startsWith("no-"));for(const f of h){const p=f.name.slice(3),g=`--${f.name}`,$=`--${p}`,w=n.includes(g),y=n.includes($);if(w&&y)throw new St(p,f.name)}}return d&&(Wi(l,e),Fi(l,e)),Ti(i,l.options,e),Mi(l.options,e),this.#O&&rs(e,n,l.rawUnknown),this.#c()===V&&(this.#t.debug("command options parsed from options:"),this.#t.debug(JSON.stringify(l.options,null,2)),this.#t.debug("command argument parsed from argument:"),this.#t.debug(JSON.stringify(l.argument,null,2))),{arguments_:i,booleanValues:c,commandArgs:r,parsedArgs:a,toolbox:l}}constructor(e,n={}){if(typeof e!="string"||e.trim().length===0)throw new k("CLI name must be a non-empty string","INVALID_INPUT",{cliName:e});this.#f=e.trim();const o=n.argv??ye(),s=n.cwd??Bn();if(this.#e={...n,argv:o,cwd:s},this.#e.argv&&!Array.isArray(this.#e.argv))throw new k("CLI argv option must be an array of strings","INVALID_INPUT",{argv:this.#e.argv});if(this.#e.cwd&&typeof this.#e.cwd!="string")throw new k("CLI cwd option must be a string","INVALID_INPUT",{cwd:this.#e.cwd});if(this.#e.packageName&&typeof this.#e.packageName!="string")throw new k("CLI packageName option must be a string","INVALID_INPUT",{packageName:this.#e.packageName});if(this.#e.packageVersion&&typeof this.#e.packageVersion!="string")throw new k("CLI packageVersion option must be a string","INVALID_INPUT",{packageVersion:this.#e.packageVersion});if(typeof this.#e.logger=="object"){const r=["debug","error","info","log","warn"],l=[],d=this.#e.logger;for(const h of r)typeof d[h]!="function"&&l.push(h);if(l.length>0)throw new k(`Logger object is missing required methods: ${l.join(", ")}`,"INVALID_INPUT",{logger:this.#e.logger,missingMethods:l});this.#t=this.#e.logger}else this.#t={...console,debug:(...r)=>{this.#c()===V&&console.debug(...r)}};this.#m=this.#e.packageVersion,this.#A=this.#e.packageName,this.#h=this.#e.cwd,this.#s="help",this.#r={};const i=n.fs;if(i!==void 0&&(typeof i!="object"||i===null))throw new k("CLI fs option must be an object implementing the CerebroFs interface","INVALID_INPUT",{fs:n.fs});const c=n.exit;if(c!==void 0&&typeof c!="function")throw new k("CLI exit option must be a function","INVALID_INPUT",{exit:n.exit});const a=n.env;if(a!==void 0&&(typeof a!="object"||a===null))throw new k("CLI env option must be a record of string keys","INVALID_INPUT",{env:n.env});const u=n.stdin;if(u!==void 0&&typeof u!="string")throw new k("CLI stdin option must be a string","INVALID_INPUT",{stdin:n.stdin});this.#k=n.fs,this.#E=n.exit,this.#$=n.env,this.#C=n.stdin??"",this.#b=n.maxArguments,this.#O=n.strictOptions??!1,this.#d(be),this.#n=new Map,this.#o=new Map,this.#i=new Map}setCommandSection(e){return this.#r=e,this}getCommandSection(){return this.#r.header||(this.#r.header=`${this.#f}${this.#m?` v${this.#m}`:""}`),this.#r}setDefaultCommand(e){return this.#s=e,this}get defaultCommand(){return this.#s}addCommand(e){Ce(e,"Command"),me(e.name);const n=typeof e.execute=="function",o=typeof e.loader=="function";if(n&&o)throw new k(`Command "${e.name}" cannot define both "execute" and "loader" — choose one`,"INVALID_COMMAND",{commandName:e.name});if(!n&&!o)throw new k(`Command "${e.name}" must define either "execute" or "loader"`,"INVALID_COMMAND",{commandName:e.name});e.alias&&(typeof e.alias=="string"?me(e.alias):lt(e.alias,"Command alias").forEach(r=>me(r))),e.argument&&Ce(e.argument,"Command argument"),e.options&&Ce(e.options,"Command options"),e.commandPath&&(lt(e.commandPath,"Command commandPath"),e.commandPath.forEach(r=>{me(r)}));const s=rt(e.name,e.commandPath),i=J(s);if(this.#o.has(i))throw new k(`Command with path "${i}" already exists`,"DUPLICATE_COMMAND",{commandName:e.name,commandPath:e.commandPath});const c=Array.isArray(e.commandPath)&&e.commandPath.length>0,a=this.#n.get(e.name),u=a!==void 0&&(a.commandPath===void 0||a.commandPath.length===0);if(!c&&u)throw new k(`Command with name "${e.name}" already exists`,"DUPLICATE_COMMAND",{commandName:e.name});if(e.options)for(const r of e.options)Je(r);if(Pi(e),zi(e),Ri(e),e.options&&(e.__conflictingOptions__=e.options.filter(r=>r.conflicts!==void 0),e.__requiredOptions__=e.options.filter(r=>r.required===!0)),c&&a!==void 0)this.#n.set(i,e);else{if(!c&&a!==void 0&&!u){const r=rt(a.name,a.commandPath);this.#n.set(J(r),a)}this.#n.set(e.name,e)}if(this.#o.set(i,s),this.#i.set(i,e),this.#M(),e.alias!==void 0){const r=typeof e.alias=="string"?[e.alias]:e.alias;for(const l of r){if(this.#c()===V&&this.#t.debug("adding alias",l),this.#n.has(l))throw new k(`Command alias "${l}" conflicts with existing command`,"DUPLICATE_COMMAND",{alias:l,commandName:e.name});this.#n.set(l,e)}}return this}addGlobalOption(e){const n=e,o=new Set(de.map(i=>i.name)),s=new Set(de.map(i=>i.alias).filter(Boolean));if(o.has(n.name))throw new k(`Cannot add global option "--${n.name}": it conflicts with a built-in global option`,"DUPLICATE_OPTION",{optionName:n.name});if(n.alias&&s.has(n.alias))throw new k(`Cannot add global option with alias "-${n.alias}": it conflicts with a built-in global option alias`,"DUPLICATE_OPTION",{alias:n.alias,optionName:n.name});if(new Set(this.#l.map(i=>i.name)).has(n.name))throw new k(`Global option "--${n.name}" has already been added`,"DUPLICATE_OPTION",{optionName:n.name});return n.group="global",Je(n),this.#l.push(n),this}getGlobalOptions(){return this.#T()}addPlugin(e){return this.getPluginManager().register(e),this}getPluginManager(){return this.#p?this.#p:(this.#p=new jo(this.#t),this.#p.register({description:"Attaches the logger to the toolbox",execute:e=>{e.logger=this.#t,e.console=e.logger},name:"logger"}),this.#p)}getCliName(){return this.#f}getPackageVersion(){return this.#m}getPackageName(){return this.#A}getCommands(){return this.#n}getCwd(){return this.#h}dispose(){this.#I?.()}async run(e={}){const{autoDispose:n=!0,shouldExitProcess:o=!0,...s}=e;if(!this.#n.has("help")){const{default:y}=await import("../packem_chunks/help-command.js");this.addCommand(new y(this.#n))}const i=this.#S(),c=this.#o;this.#j();const a=this.#x();let u,r=[...a];this.#c()===V&&(this.#t.debug(`process.execPath: ${kt()}`),this.#t.debug(`process.execArgv: ${At().join(" ")}`),this.#t.debug(`process.argv: ${ye().join(" ")}`));const l=Di(c,[...a]);if(l.commandPath)u=l.commandPath,r=l.argv;else{if(a.length>1&&a[0]&&a[1]&&!Oe(a[0])&&!Oe(a[1])){const b=[];let N=0;for(;N<a.length;){const I=a[N];if(!I||Oe(I))break;b.push(I),N+=1}const E=J(b);if(b[0]&&!i.includes(b[0])){const I=this.#a(),O=q(E,I);throw new H(E,O)}}let y;try{y=Fo([null,...i],[...a])}catch(b){if(b instanceof Error&&b.name==="INVALID_COMMAND"&&"command"in b){const N=b.command,E=this.#a(),I=q(N,E);throw new H(N,I)}throw b}y.command&&(u=[y.command],r=y.argv)}if(!u)if(this.#s)u=[this.#s];else{const y=this.#a();throw new H("",y)}const d=J(u),h=this.#o.get(d);let f;if(h){if(f=this.#i.get(d),!f||J(h)!==d){const y=this.#a(),b=q(d,y);throw new H(d,b)}}else{const y=u.at(-1);if(f=y?this.#n.get(y):void 0,!f){const b=this.#a(),N=q(d,b);throw new H(d,N)}}if(typeof f.execute!="function"&&typeof f.loader!="function")return this.#t.error(`Command "${f.name}" has no function to execute.`),o?R(1):void 0;const p=r;let g,$;try{({commandArgs:g,toolbox:$}=this.#P(f,p,s,d))}catch(y){if(this.#t.error(y),o)return R(1);throw y}const w=this.getPluginManager();try{!this.#g&&w.hasPlugins()&&(await w.init({cli:this,cwd:this.#h,logger:this.#t}),this.#g=!0),await w.executeLifecycle("execute",$),await w.executeLifecycle("beforeCommand",$);let y;const b=g.global;if(b?.help){const N=this.#n.get("help");if(!N)throw new k("Help command not found","COMMAND_NOT_FOUND");y=await ee(N,$)}else if(b?.version??b?.V){const N=this.#n.get("version");if(!N)throw new k("Version command not found","COMMAND_NOT_FOUND");y=await ee(N,$)}else y=await ee(f,$);return await w.executeLifecycle("afterCommand",$,y),o?R(0):void 0}catch(y){throw await w.executeErrorHandlers(y,$),y}finally{n&&this.dispose()}}async runCommand(e,n={}){const{argv:o=[],...s}=n;Ie(e,"Command name");const i=e.split(" ").filter(Boolean),c=J(i),a=this.#o.get(c)?this.#i.get(c):this.#n.get(e);if(!a){const h=this.#a(),f=q(c||e,h);throw new H(e,f)}if(typeof a.execute!="function"&&typeof a.loader!="function")throw new k(`Command "${a.name}" has no function to execute`,"INVALID_COMMAND",{commandName:a.name});const u=[...ct(o,{maxArguments:this.#b})];this.#c()===V&&this.#t.debug(`running command '${e}' programmatically with args: ${u.join(", ")}`);const{commandArgs:r,toolbox:l}=this.#P(a,u,s,c||e),d=this.getPluginManager();try{!this.#g&&d.hasPlugins()&&(await d.init({cli:this,cwd:this.#h,logger:this.#t}),this.#g=!0),await d.executeLifecycle("execute",l),await d.executeLifecycle("beforeCommand",l);let h;const f=r.global;if(f?.help){const p=this.#n.get("help");if(!p)throw new k("Help command not found","COMMAND_NOT_FOUND");h=await ee(p,l)}else if(f?.version??f?.V){const p=this.#n.get("version");if(!p)throw new k("Version command not found","COMMAND_NOT_FOUND");h=await ee(p,l)}else h=await ee(a,l);return await d.executeLifecycle("afterCommand",l,h),h}catch(h){throw await d.executeErrorHandlers(h,l),h}}clone(e){const n={...this.#e,...e},o=new Me(this.#f,n);for(const[s,i]of this.#n)o.#n.set(s,i);for(const[s,i]of this.#o)o.#o.set(s,[...i]);for(const[s,i]of this.#i)o.#i.set(s,i);for(const s of this.#l)o.#l.push(s);return o.#s=this.#s,o.#r={...this.#r},o.#M(),o}async getAction(e){Ie(e,"Command name");const n=e.split(" ").filter(Boolean),o=J(n),s=this.#o.get(o)?this.#i.get(o):this.#n.get(e);if(!s){const i=this.#a(),c=q(o||e,i);throw new H(e,c)}if(typeof s.execute=="function")return s.execute;if(typeof s.loader=="function")return jt(s);throw new k(`Command "${s.name}" has no execute or loader defined`,"INVALID_COMMAND",{commandName:s.name})}}const ks=(t,e)=>new Me(t,e),Es=()=>{try{const t=require("node:module");if(typeof t.enableCompileCache=="function"){t.enableCompileCache();return}}catch{}try{require("v8-compile-cache")}catch{}},as=ve(import.meta.url),ue=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,Bt=t=>{if(typeof ue<"u"&&ue.versions&&ue.versions.node){const[e,n]=ue.versions.node.split(".").map(Number);if(e>22||e===22&&n>=3||e===20&&n>=16)return ue.getBuiltinModule(t)}return as(t)},{execFileSync:ls}=Bt("node:child_process"),{totalmem:cs}=Bt("node:os"),us=/--max-old-space-size=(\d+)/,hs=/--max-semi-space-size=(\d+)/,ps=t=>Math.floor(cs()/1024/1024*t),ds=t=>t<=512?4:t<=1024?8:t<=2048?16:t<=4096?32:t<=8192?64:Math.floor(Math.log2(t))*8,ut=(t,e)=>{for(const n of e){const o=t.exec(n);if(o)return Number.parseInt(o[1],10)}},Cs=t=>{const n=[...At()],o=[...ye()],s=ut(us,n),i=ut(hs,n);if(s!==void 0&&i!==void 0)return;const c=s??ps(.75),a=i??ds(c),u=[];if(s===void 0&&u.push(`--max-old-space-size=${String(c)}`),i===void 0&&u.push(`--max-semi-space-size=${String(a)}`),u.length!==0)try{ls(kt(),[...u,...n,...o.slice(1)],{env:he(),stdio:"inherit"}),R(0)}catch(r){const l=r.status;R(typeof l=="number"?l:1)}},Os=(t={})=>({description:"Enhanced error handling and reporting with beautiful code frames",name:"error-handler",onError:(e,n)=>{const{logger:o,runtime:s}=n,{detailed:i=!1,exitOnError:c=!0,formatter:a,logErrors:u=!0,renderOptions:r={}}=t;if(u)if(a)o.error(a(e));else if(i){const l=s.getCwd(),d=Vn(e,{cwd:l,hideErrorCodeView:!1,hideErrorTitle:!1,hideMessage:!1,linesAbove:2,linesBelow:3,...r});o.error(d)}else o.error(e);c&&R(1)},version:"1.0.0"});var fs="1.0.0-alpha.39";const _s={version:fs},Is={argument:{description:"Package to execute (optionally with @version)",name:"package",type:String},description:"Execute a remote package without permanent installation",examples:[["vis dlx create-vite my-app","Scaffold a new project"],["vis dlx typescript@5.5.4 tsc --version","Run specific version"],["vis dlx -p cowsay -p lolcatjs -c 'echo hi | cowsay | lolcatjs'","Multiple packages with shell"],["vis install && vis dlx --offline typescript tsc --version","Hardened: pre-install + offline (no registry fetch on dlx)"]],group:"Run & Execute",loader:()=>import("../packem_chunks/handler9.js"),name:"dlx",options:[{alias:"p",description:"Additional packages to install (repeatable)",multiple:!0,name:"package",type:String},{alias:"c",defaultValue:!1,description:"Execute within shell environment",name:"shell-mode",type:Boolean},{alias:"s",defaultValue:!1,description:"Suppress output except command results",name:"silent",type:Boolean},{defaultValue:!1,description:"Resolve from local store only — fail rather than fetch from the registry. Pair with `vis install` for hardened npx-style workflows.",name:"offline",type:Boolean}]};export{G as L,Cs as P,ks as V,Es as a,gs as b,_s as c,bs as d,Is as e,k as f,Os as h,$s as i,ys as n,xs as o,Ns as p,vs as r,ws as s,he as t};
|