@aexhq/cli 0.21.0 → 0.22.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli.mjs +24 -2
- package/dist/cli.mjs.sha256 +1 -1
- package/package.json +2 -2
package/dist/cli.mjs
CHANGED
|
@@ -350,6 +350,25 @@ var SKILL_BUNDLE_LIMITS = {
|
|
|
350
350
|
defaultDirMode: 493
|
|
351
351
|
};
|
|
352
352
|
var ASSET_ID_PATTERN = /^asset_[A-Za-z0-9_-]{8,128}$/;
|
|
353
|
+
var MOUNT_PATH_PATTERN = /^\/(?:[^/\0\\]+\/?)*$/;
|
|
354
|
+
var MOUNT_PATH_MAX_LENGTH = 512;
|
|
355
|
+
function assertValidMountPath(value, field) {
|
|
356
|
+
if (value.length === 0 || value.length > MOUNT_PATH_MAX_LENGTH) {
|
|
357
|
+
throw new Error(`${field} must be 1..${MOUNT_PATH_MAX_LENGTH} chars`);
|
|
358
|
+
}
|
|
359
|
+
if (!value.startsWith("/")) {
|
|
360
|
+
throw new Error(`${field} must be an absolute path starting with '/'`);
|
|
361
|
+
}
|
|
362
|
+
if (value.includes("\0") || value.includes("\\")) {
|
|
363
|
+
throw new Error(`${field} must not contain NUL or backslash`);
|
|
364
|
+
}
|
|
365
|
+
if (value.split("/").some((seg) => seg === "..")) {
|
|
366
|
+
throw new Error(`${field} must not contain '..' traversal segments`);
|
|
367
|
+
}
|
|
368
|
+
if (!MOUNT_PATH_PATTERN.test(value)) {
|
|
369
|
+
throw new Error(`${field} must match ${MOUNT_PATH_PATTERN.source}`);
|
|
370
|
+
}
|
|
371
|
+
}
|
|
353
372
|
function parseSkillRef(input, path) {
|
|
354
373
|
if (input === null || typeof input !== "object" || Array.isArray(input)) {
|
|
355
374
|
throw new Error(`${path} must be a SkillRef object`);
|
|
@@ -401,8 +420,11 @@ function parseAssetRefFields(record, path) {
|
|
|
401
420
|
throw new Error(`${path}.name must be a non-empty string (<= 128 chars)`);
|
|
402
421
|
}
|
|
403
422
|
const mountPath = record.mountPath;
|
|
404
|
-
if (mountPath !== void 0
|
|
405
|
-
|
|
423
|
+
if (mountPath !== void 0) {
|
|
424
|
+
if (typeof mountPath !== "string") {
|
|
425
|
+
throw new Error(`${path}.mountPath, when provided, must be a string`);
|
|
426
|
+
}
|
|
427
|
+
assertValidMountPath(mountPath, `${path}.mountPath`);
|
|
406
428
|
}
|
|
407
429
|
return {
|
|
408
430
|
kind: "asset",
|
package/dist/cli.mjs.sha256
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
bfd0fb573fa113fe08d69fc50f246c821bfc9e0acd9bddd6e92775d38120e201 cli.mjs
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aexhq/cli",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.22.0",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "git+https://github.com/aexhq/aex.git"
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
},
|
|
28
28
|
"dependencies": {
|
|
29
29
|
"fflate": "^0.8.2",
|
|
30
|
-
"@aexhq/contracts": "0.
|
|
30
|
+
"@aexhq/contracts": "0.22.0"
|
|
31
31
|
},
|
|
32
32
|
"devDependencies": {
|
|
33
33
|
"esbuild": "^0.28.0"
|