@hypersoniclabs/helix-cli 0.1.27-helix3.695 → 0.1.27-helix3.697
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/device.d.ts +1 -1
- package/dist/device.js +35 -0
- package/dist/device.js.map +1 -1
- package/dist/index.js +59 -0
- package/dist/index.js.map +1 -1
- package/dist/lib.d.ts +67 -0
- package/dist/lib.js +178 -2
- package/dist/lib.js.map +1 -1
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/package.json +1 -1
package/dist/device.d.ts
CHANGED
|
@@ -42,7 +42,7 @@ export declare const DEVICE_COMPONENT_TYPES: readonly ["slider", "clockHands", "
|
|
|
42
42
|
* `repeat`, `stopAudio`) — their absence from the examples is why the gap went
|
|
43
43
|
* unnoticed for so long.
|
|
44
44
|
*/
|
|
45
|
-
export declare const DEVICE_GRAPH_STEP_KINDS: readonly ["setState", "toggleState", "moveNode", "rotateNode", "playAudio", "stopAudio", "setVfx", "attachCharacter", "playCharacterAnimation", "releaseCharacter", "enterCharacterSpot", "reachCharacterHand", "releaseCharacterHand", "attachItem", "releaseItem", "emitSignal", "branch", "sequence", "delay", "repeat"];
|
|
45
|
+
export declare const DEVICE_GRAPH_STEP_KINDS: readonly ["setState", "toggleState", "moveNode", "rotateNode", "playAudio", "stopAudio", "setVfx", "attachCharacter", "playCharacterAnimation", "releaseCharacter", "enterCharacterSpot", "relocateCharacter", "requestTravel", "reachCharacterHand", "releaseCharacterHand", "attachItem", "releaseItem", "emitSignal", "branch", "sequence", "delay", "repeat"];
|
|
46
46
|
/**
|
|
47
47
|
* The closed CHARACTER socket set an `attachItem` step may target.
|
|
48
48
|
*
|
package/dist/device.js
CHANGED
|
@@ -121,6 +121,8 @@ exports.DEVICE_GRAPH_STEP_KINDS = [
|
|
|
121
121
|
'playCharacterAnimation',
|
|
122
122
|
'releaseCharacter',
|
|
123
123
|
'enterCharacterSpot',
|
|
124
|
+
'relocateCharacter',
|
|
125
|
+
'requestTravel',
|
|
124
126
|
'reachCharacterHand',
|
|
125
127
|
'releaseCharacterHand',
|
|
126
128
|
'attachItem',
|
|
@@ -279,6 +281,14 @@ function isNumberTriple(value) {
|
|
|
279
281
|
value.length === 3 &&
|
|
280
282
|
value.every((part) => typeof part === 'number' && !Number.isNaN(part)));
|
|
281
283
|
}
|
|
284
|
+
/**
|
|
285
|
+
* R138-TOWER: the two travel target shapes the platform lists: a Parallel City title (1..15000) or a named portal (`pc-portal:<slug>`).
|
|
286
|
+
* Mirrors the engine's `DeviceTravel.ts`; the id is only a key, the shell's allowlist decides what it is.
|
|
287
|
+
*/
|
|
288
|
+
const DEVICE_TRAVEL_TITLE_PATTERN = /^parallel-city:([1-9][0-9]{0,4})$/;
|
|
289
|
+
const DEVICE_TRAVEL_PORTAL_PATTERN = /^pc-portal:[a-z][a-z0-9-]{0,31}$/;
|
|
290
|
+
const DEVICE_TRAVEL_MAX_TITLE = 15_000;
|
|
291
|
+
const DEVICE_TRAVEL_TARGET_RULE = `parallel-city:<1..${DEVICE_TRAVEL_MAX_TITLE}> or pc-portal:<slug>`;
|
|
282
292
|
function isFiniteNumber(value) {
|
|
283
293
|
return typeof value === 'number' && Number.isFinite(value);
|
|
284
294
|
}
|
|
@@ -655,6 +665,30 @@ function validateGraphSteps(steps, context, path, depth) {
|
|
|
655
665
|
context.usage.animation = true;
|
|
656
666
|
return;
|
|
657
667
|
}
|
|
668
|
+
case 'relocateCharacter': {
|
|
669
|
+
// R138-TOWER: a socket of THIS Device (its own sealed pose), from a press only. Mirrors the engine `DeviceValidate`/`DeviceTravel`.
|
|
670
|
+
context.usage.animation = true;
|
|
671
|
+
requireName('to');
|
|
672
|
+
if (isNonEmptyName(step.to) && !context.sockets.has(String(step.to)))
|
|
673
|
+
context.errors.push(`graph: unknown relocateCharacter socket "${String(step.to)}"`);
|
|
674
|
+
if (context.trigger !== 'interact')
|
|
675
|
+
context.errors.push(`${stepPath}: relocateCharacter is valid only under an interact trigger`);
|
|
676
|
+
return;
|
|
677
|
+
}
|
|
678
|
+
case 'requestTravel': {
|
|
679
|
+
// The id, never a URL: the shell owns the one allowlist that turns it into a route.
|
|
680
|
+
context.usage.animation = true;
|
|
681
|
+
const target = step.target;
|
|
682
|
+
const title = typeof target === 'string' ? DEVICE_TRAVEL_TITLE_PATTERN.exec(target) : null;
|
|
683
|
+
const listed = typeof target === 'string' &&
|
|
684
|
+
(DEVICE_TRAVEL_PORTAL_PATTERN.test(target) ||
|
|
685
|
+
(title !== null && Number(title[1]) <= DEVICE_TRAVEL_MAX_TITLE));
|
|
686
|
+
if (!listed)
|
|
687
|
+
context.errors.push(`${stepPath}: requestTravel target must be ${DEVICE_TRAVEL_TARGET_RULE}`);
|
|
688
|
+
if (context.trigger !== 'interact')
|
|
689
|
+
context.errors.push(`${stepPath}: requestTravel is valid only under an interact trigger`);
|
|
690
|
+
return;
|
|
691
|
+
}
|
|
658
692
|
case 'enterCharacterSpot': {
|
|
659
693
|
context.usage.posture = true;
|
|
660
694
|
const component = String(step.component ?? '');
|
|
@@ -2501,6 +2535,7 @@ function validateDeviceProject(input, options = {}) {
|
|
|
2501
2535
|
if (trigger.do === undefined)
|
|
2502
2536
|
errors.push(`${triggerPath}: every trigger requires a do array`);
|
|
2503
2537
|
else {
|
|
2538
|
+
graphContext.trigger = on;
|
|
2504
2539
|
validateGraphSteps(trigger.do, graphContext, `${triggerPath}.do`, 0);
|
|
2505
2540
|
let handBudgetInvalid = false;
|
|
2506
2541
|
if (graphHasHandStep(trigger.do)) {
|