@helix3/helix-cli 0.1.22-helix3.417 → 0.1.22-helix3.419
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/index.js +66 -1
- package/dist/index.js.map +1 -1
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/dist/vehicle/cabinCheck.d.ts +199 -0
- package/dist/vehicle/cabinCheck.js +770 -0
- package/dist/vehicle/cabinCheck.js.map +1 -0
- package/dist/vehicle/preview.d.ts +6 -1
- package/dist/vehicle/preview.js +4 -0
- package/dist/vehicle/preview.js.map +1 -1
- package/dist/vehicle/previewSeats.d.ts +10 -1
- package/dist/vehicle/previewSeats.js +27 -0
- package/dist/vehicle/previewSeats.js.map +1 -1
- package/dist/vehicle/validate.d.ts +11 -0
- package/dist/vehicle/validate.js +36 -3
- package/dist/vehicle/validate.js.map +1 -1
- package/dist/visualQa/vehicle.js +11 -2
- package/dist/visualQa/vehicle.js.map +1 -1
- package/package.json +1 -1
- package/plugins/beamng-vehicle/bin/__pycache__/beamng_abs.cpython-312.pyc +0 -0
- package/plugins/beamng-vehicle/bin/__pycache__/beamng_audio.cpython-312.pyc +0 -0
- package/plugins/beamng-vehicle/bin/__pycache__/beamng_engine.cpython-312.pyc +0 -0
- package/plugins/beamng-vehicle/bin/__pycache__/beamng_expression.cpython-312.pyc +0 -0
- package/plugins/beamng-vehicle/bin/__pycache__/beamng_jbeam.cpython-312.pyc +0 -0
- package/plugins/beamng-vehicle/bin/__pycache__/beamng_materials.cpython-312.pyc +0 -0
- package/plugins/beamng-vehicle/bin/__pycache__/test_beamng_engine.cpython-312.pyc +0 -0
- package/plugins/beamng-vehicle/vendor/vehicle-package-v2.mjs +79 -9
- package/vendor/vehicle-package-v2.mjs +79 -9
package/dist/index.js
CHANGED
|
@@ -577,6 +577,7 @@ vehicleCommand
|
|
|
577
577
|
.argument('<vehicle-package.json>', 'the vehicle package JSON that will be sealed in the Vehicle Package')
|
|
578
578
|
.option('--glb <model.glb>', 'also check the model: wheel nodes and pivots, frame orientation, budgets, articulation nodes, the lamp nodes (one per light function, each with its own emissive material), and the add-on host manifest (asset.extras.HELIX_vehicle)')
|
|
579
579
|
.option('--no-simulate', 'skip the offline drive (by default a package with `targets` is driven by the platform\'s own engine instrument and every figure outside its tolerance is an ERROR)')
|
|
580
|
+
.option('--cabin', 'with --glb: also run the offline cabin check (`helix vehicle cabin-check`): every declared seat\'s H-point, head, knee, shin, foot, rear footwell and tunnel clearance as the engine runtime fits it; a FAIL is an ERROR')
|
|
580
581
|
.option('--offline', 'drive with the last cached engine runtime; never fetch')
|
|
581
582
|
.option('--api-url <url>', 'API whose engine runtime drives the car (default: this CLI\'s environment)')
|
|
582
583
|
.option('--json', 'print the machine-readable report')
|
|
@@ -609,7 +610,8 @@ vehicleCommand
|
|
|
609
610
|
const { provisionalAudio } = await Promise.resolve().then(() => __importStar(require('./vehicle/audio')));
|
|
610
611
|
const prepared = provisionalAudio(pkg, (0, node_path_1.resolve)(packageFile, '..'));
|
|
611
612
|
provisional = prepared.filled;
|
|
612
|
-
|
|
613
|
+
const runtimeOpts = { apiUrl: opts.apiUrl ?? config_1.DEFAULT_API_URL, offline: opts.offline };
|
|
614
|
+
result = await (0, validate_1.validateVehicle)(prepared.pkg, glb, { ...(opts.simulate === false ? {} : { simulate: runtimeOpts }), ...(opts.cabin && glb ? { cabin: runtimeOpts } : {}) });
|
|
613
615
|
}
|
|
614
616
|
catch (error) {
|
|
615
617
|
process.stderr.write(`✖ cannot validate ${opts.glb ?? packageFile}: ${error instanceof Error ? error.message : String(error)}\n`);
|
|
@@ -626,6 +628,12 @@ vehicleCommand
|
|
|
626
628
|
const { formatSimulationReport } = await Promise.resolve().then(() => __importStar(require('./vehicle/simulate')));
|
|
627
629
|
console.log(formatSimulationReport(result.simulation, { withPolicy: false }).split('\n').map((line) => ` ${line}`).join('\n'));
|
|
628
630
|
}
|
|
631
|
+
if (glb && !opts.cabin) {
|
|
632
|
+
const spec = pkg?.specialty?.module?.seatVars;
|
|
633
|
+
const seatCount = spec && typeof spec === 'object' ? Object.keys(spec).length : 0;
|
|
634
|
+
if (seatCount > 2)
|
|
635
|
+
console.log(` ${seatCount} seats declared: \`helix vehicle cabin-check ${(0, node_path_1.resolve)(packageFile, '..')}\` judges the rear seats offline in seconds (H-point against the roofline, knees against the seat ahead, rear footwell, tunnel); \`validate --cabin\` runs it here`);
|
|
636
|
+
}
|
|
629
637
|
if (provisional > 0)
|
|
630
638
|
console.log(` ${provisional} audio row${provisional === 1 ? '' : 's'} backed by a local WAV: seal the WAV in the Vehicle Package before making its Item; \`helix vehicle audio-check\` proves ${provisional === 1 ? 'it plays' : 'they play'}`);
|
|
631
639
|
console.log(`${result.ok ? '✔' : '✖'} ${result.ok ? 'Valid' : 'Invalid'} vehicle package: ${result.errors} error${result.errors === 1 ? '' : 's'}, ${result.warnings} warning${result.warnings === 1 ? '' : 's'}`
|
|
@@ -809,6 +817,63 @@ vehicleCommand
|
|
|
809
817
|
process.exitCode = 2;
|
|
810
818
|
}
|
|
811
819
|
});
|
|
820
|
+
vehicleCommand
|
|
821
|
+
.command('cabin-check')
|
|
822
|
+
.description('Judge every seat of a car\'s cabin OFFLINE in seconds (no browser, no sign-in): the engine runtime\'s own cabin fit plus the canonical seated legs measured against every triangle of the body. '
|
|
823
|
+
+ 'Per declared seat, any seat count (2, 2+2, 4, 5, 7): the H-point above the floor, how far the runtime had to move the seat, head clearance to the roof\'s inner surface, '
|
|
824
|
+
+ 'knee clearance to the seat back ahead, shin and foot clearance, the legs against the seat ahead and against the tunnel / console, the rear footwell under the front seats '
|
|
825
|
+
+ '(free height over the foot, depth ahead of the cushion), the driver\'s legs against the wheel, and any limb inside the body. Each row is PASS / WARN / FAIL with numbers. '
|
|
826
|
+
+ 'Iterate with this, then confirm with `helix vehicle preview <dir> --occupants` (which now boards and seats every seat). The runtime is fetched once per version and cached '
|
|
827
|
+
+ 'under ~/.helix/cache/engine-runtime; offline, the last cached runtime is used and labelled. Exit 0 = no FAIL, 1 = a FAIL, 2 = could not run')
|
|
828
|
+
.argument('[dir-or-package.json]', 'a vehicle package directory (vehicle-package.json + model.glb), or the package JSON beside its model')
|
|
829
|
+
.option('--glb <model.glb>', 'the model (default: model.glb, or the one .glb, beside the package)')
|
|
830
|
+
.option('--item <id>', 'check a PUBLISHED vehicle item\'s stored package and drawn model (public reads) instead of a local directory')
|
|
831
|
+
.option('--offline', 'use the last cached engine runtime; never fetch')
|
|
832
|
+
.option('--runtime <file-or-url>', 'use this runtime bundle instead of the served one (a candidate engine build)')
|
|
833
|
+
.option('--range <range>', 'engine range to resolve (default ^0.3)')
|
|
834
|
+
.option('--api-url <url>', 'API to resolve the runtime (and --item) from (default: this CLI\'s environment)')
|
|
835
|
+
.option('--json', 'print the machine-readable report')
|
|
836
|
+
.action(async (input, opts) => {
|
|
837
|
+
const cabin = await Promise.resolve().then(() => __importStar(require('./vehicle/cabinCheck')));
|
|
838
|
+
const apiUrl = (opts.apiUrl ?? config_1.DEFAULT_API_URL).replace(/\/$/, '');
|
|
839
|
+
let loaded;
|
|
840
|
+
let source;
|
|
841
|
+
try {
|
|
842
|
+
if (opts.item) {
|
|
843
|
+
const published = await cabin.fetchPublishedCabinInput(apiUrl, opts.item);
|
|
844
|
+
loaded = published;
|
|
845
|
+
source = `item ${opts.item} (${published.modelUrl})`;
|
|
846
|
+
}
|
|
847
|
+
else {
|
|
848
|
+
if (!input)
|
|
849
|
+
throw new Error('pass a vehicle package directory (vehicle-package.json + model.glb), or --item <id>');
|
|
850
|
+
const read = cabin.readCabinInput(input, opts.glb);
|
|
851
|
+
const { provisionalAudio } = await Promise.resolve().then(() => __importStar(require('./vehicle/audio')));
|
|
852
|
+
// an unsealed audio row has no URL yet and the engine refuses such a package; judge it as if it had one (the cabin does not care)
|
|
853
|
+
loaded = { pkg: provisionalAudio(read.pkg, read.dir).pkg, glb: read.glb };
|
|
854
|
+
source = `${read.packageFile} + ${read.glbFile}`;
|
|
855
|
+
}
|
|
856
|
+
}
|
|
857
|
+
catch (error) {
|
|
858
|
+
process.stderr.write(`✖ ${error instanceof Error ? error.message : String(error)}\n`);
|
|
859
|
+
process.exitCode = 2;
|
|
860
|
+
return;
|
|
861
|
+
}
|
|
862
|
+
try {
|
|
863
|
+
const { loadEngineRuntime } = await Promise.resolve().then(() => __importStar(require('./vehicle/simulateRuntime')));
|
|
864
|
+
const runtime = await loadEngineRuntime({ apiUrl, offline: opts.offline, runtime: opts.runtime, range: opts.range });
|
|
865
|
+
const report = await cabin.checkCabin(loaded, runtime);
|
|
866
|
+
if (opts.json)
|
|
867
|
+
console.log(JSON.stringify({ source, ...report }, null, 2));
|
|
868
|
+
else
|
|
869
|
+
console.log(cabin.formatCabinReport(report));
|
|
870
|
+
process.exitCode = report.exitCode;
|
|
871
|
+
}
|
|
872
|
+
catch (error) {
|
|
873
|
+
process.stderr.write(`✖ cannot check the cabin of ${source}: ${error instanceof Error ? error.message : String(error)}\n`);
|
|
874
|
+
process.exitCode = 2;
|
|
875
|
+
}
|
|
876
|
+
});
|
|
812
877
|
vehicleCommand
|
|
813
878
|
.command('audio-check')
|
|
814
879
|
.description('Prove every sound a vehicle declares will actually play: each engine-ladder rung and slot sample the runtime selects must resolve (a local WAV '
|