@hology/core 0.0.212 → 0.0.213

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.
Files changed (135) hide show
  1. package/dist/effects/sequence/index.d.ts +1 -0
  2. package/dist/effects/sequence/index.js +1 -1
  3. package/dist/effects/sequence/sequence-action.d.ts +5 -0
  4. package/dist/effects/sequence/sequence-actor.d.ts +7 -0
  5. package/dist/effects/sequence/sequence-actor.js +1 -1
  6. package/dist/effects/sequence/sequence-animation-retiming.js +1 -1
  7. package/dist/effects/sequence/sequence-data.d.ts +9 -0
  8. package/dist/effects/sequence/sequence-data.js +1 -1
  9. package/dist/effects/sequence/sequence-player.d.ts +12 -1
  10. package/dist/effects/sequence/sequence-player.js +1 -1
  11. package/dist/effects/sequence/sequence-transform.d.ts +10 -0
  12. package/dist/effects/sequence/sequence-transform.js +4 -0
  13. package/dist/effects/sequence/sequence-value-lane.d.ts +2 -0
  14. package/dist/effects/sequence/sequence-value-lane.js +1 -1
  15. package/dist/effects/vfx/vfx-actor.d.ts +5 -0
  16. package/dist/effects/vfx/vfx-actor.js +1 -1
  17. package/dist/effects/vfx/vfx-asset.d.ts +2 -1
  18. package/dist/effects/vfx/vfx-asset.js +1 -1
  19. package/dist/effects/vfx/vfx-materializer.js +1 -1
  20. package/dist/effects/vfx/vfx-renderers.d.ts +1 -0
  21. package/dist/effects/vfx/vfx-renderers.js +1 -1
  22. package/dist/gameplay/actors/actor.d.ts +3 -5
  23. package/dist/gameplay/actors/actor.js +1 -1
  24. package/dist/gameplay/actors/builtin/components/character/character-animation.d.ts +3 -0
  25. package/dist/gameplay/actors/builtin/components/character/character-animation.js +1 -1
  26. package/dist/gameplay/actors/builtin/components/character/character-movement-like.d.ts +2 -0
  27. package/dist/gameplay/actors/builtin/components/character/character-movement.d.ts +13 -0
  28. package/dist/gameplay/actors/builtin/components/character/character-movement.js +1 -1
  29. package/dist/gameplay/actors/builtin/components/character/net-character-movement-protocol.d.ts +4 -1
  30. package/dist/gameplay/actors/builtin/components/character/net-character-movement-protocol.js +1 -1
  31. package/dist/gameplay/actors/builtin/components/mesh-component.d.ts +1 -0
  32. package/dist/gameplay/actors/builtin/components/mesh-component.js +1 -1
  33. package/dist/gameplay/actors/builtin/components/tween-component.js +1 -1
  34. package/dist/gameplay/actors/builtin/navmesh-actor.d.ts +2 -0
  35. package/dist/gameplay/actors/builtin/navmesh-actor.js +1 -1
  36. package/dist/gameplay/actors/builtin/trigger-volume.d.ts +3 -3
  37. package/dist/gameplay/actors/builtin/trigger-volume.js +1 -1
  38. package/dist/gameplay/actors/camera/camera-component.d.ts +1 -3
  39. package/dist/gameplay/actors/camera/camera-component.js +1 -1
  40. package/dist/gameplay/actors/component.d.ts +3 -0
  41. package/dist/gameplay/actors/component.js +1 -1
  42. package/dist/gameplay/actors/type-registry.d.ts +10 -0
  43. package/dist/gameplay/actors/type-registry.js +4 -0
  44. package/dist/gameplay/animation/retarget.d.ts +50 -0
  45. package/dist/gameplay/animation/retarget.js +4 -0
  46. package/dist/gameplay/animation/root-motion.js +1 -1
  47. package/dist/gameplay/event-graph/actor-transform-properties.d.ts +6 -0
  48. package/dist/gameplay/event-graph/actor-transform-properties.js +4 -0
  49. package/dist/gameplay/event-graph/asset-actor-types.d.ts +3 -0
  50. package/dist/gameplay/event-graph/asset-actor-types.js +4 -0
  51. package/dist/gameplay/event-graph/asset-references.d.ts +12 -0
  52. package/dist/gameplay/event-graph/asset-references.js +4 -0
  53. package/dist/gameplay/event-graph/compiler.d.ts +107 -0
  54. package/dist/gameplay/event-graph/compiler.js +4 -0
  55. package/dist/gameplay/event-graph/decorators.d.ts +74 -0
  56. package/dist/gameplay/event-graph/decorators.js +4 -0
  57. package/dist/gameplay/event-graph/document-compiler.d.ts +107 -0
  58. package/dist/gameplay/event-graph/document-compiler.js +4 -0
  59. package/dist/gameplay/event-graph/event-graph-demo.d.ts +2 -0
  60. package/dist/gameplay/event-graph/event-graph-demo.js +4 -0
  61. package/dist/gameplay/event-graph/graph.d.ts +106 -0
  62. package/dist/gameplay/event-graph/graph.js +4 -0
  63. package/dist/gameplay/event-graph/index.d.ts +13 -0
  64. package/dist/gameplay/event-graph/index.js +4 -0
  65. package/dist/gameplay/event-graph/model.d.ts +71 -0
  66. package/dist/gameplay/event-graph/model.js +4 -0
  67. package/dist/gameplay/event-graph/nodes/execution-nodes.d.ts +115 -0
  68. package/dist/gameplay/event-graph/nodes/execution-nodes.js +4 -0
  69. package/dist/gameplay/event-graph/nodes/gameplay-nodes.d.ts +208 -0
  70. package/dist/gameplay/event-graph/nodes/gameplay-nodes.js +4 -0
  71. package/dist/gameplay/event-graph/nodes/index.d.ts +4 -0
  72. package/dist/gameplay/event-graph/nodes/index.js +4 -0
  73. package/dist/gameplay/event-graph/nodes/value-nodes.d.ts +53 -0
  74. package/dist/gameplay/event-graph/nodes/value-nodes.js +4 -0
  75. package/dist/gameplay/event-graph/registry.d.ts +33 -0
  76. package/dist/gameplay/event-graph/registry.js +4 -0
  77. package/dist/gameplay/event-graph/runtime-assets.d.ts +21 -0
  78. package/dist/gameplay/event-graph/runtime-assets.js +4 -0
  79. package/dist/gameplay/event-graph/runtime.d.ts +160 -0
  80. package/dist/gameplay/event-graph/runtime.js +4 -0
  81. package/dist/gameplay/event-graph/type-inference.d.ts +41 -0
  82. package/dist/gameplay/event-graph/type-inference.js +4 -0
  83. package/dist/gameplay/event-graph/types.d.ts +77 -0
  84. package/dist/gameplay/event-graph/types.js +4 -0
  85. package/dist/gameplay/index.d.ts +15 -2
  86. package/dist/gameplay/index.js +1 -1
  87. package/dist/gameplay/initiate.js +1 -1
  88. package/dist/gameplay/input/input.d.ts +22 -17
  89. package/dist/gameplay/input/input.js +1 -1
  90. package/dist/gameplay/net/service/net-decorator.d.ts +1 -1
  91. package/dist/gameplay/net/service/net-decorator.js +1 -1
  92. package/dist/gameplay/net/service/net-serializer.js +1 -1
  93. package/dist/gameplay/net/service/net-service.d.ts +6 -6
  94. package/dist/gameplay/net/service/net-service.js +1 -1
  95. package/dist/gameplay/net/service/rpc-decorator.js +1 -1
  96. package/dist/gameplay/services/asset-loader.d.ts +7 -0
  97. package/dist/gameplay/services/asset-loader.js +1 -1
  98. package/dist/gameplay/services/physics/physics-system.d.ts +14 -0
  99. package/dist/gameplay/services/physics/physics-system.js +1 -1
  100. package/dist/gameplay/services/world.d.ts +12 -0
  101. package/dist/gameplay/services/world.js +1 -1
  102. package/dist/rendering.js +1 -1
  103. package/dist/scene/asset-resource-loader.d.ts +7 -1
  104. package/dist/scene/asset-resource-loader.js +1 -1
  105. package/dist/scene/custom-param-deserialize.js +1 -1
  106. package/dist/scene/custom-param-runtime-types.js +1 -1
  107. package/dist/scene/materializer.d.ts +25 -0
  108. package/dist/scene/materializer.js +1 -1
  109. package/dist/scene/model.d.ts +114 -2
  110. package/dist/scene/model.js +1 -1
  111. package/dist/scene/objects/prefab.js +1 -1
  112. package/dist/shader/graph/compiler.d.ts +3 -0
  113. package/dist/shader/graph/compiler.js +1 -1
  114. package/dist/shader/graph/model.d.ts +1 -1
  115. package/dist/shader/graph/registry.js +1 -1
  116. package/dist/test/animation-retarget.test.d.ts +2 -0
  117. package/dist/test/animation-retarget.test.js +4 -0
  118. package/dist/test/event-graph-generated-code.test.d.ts +2 -0
  119. package/dist/test/event-graph-generated-code.test.js +4 -0
  120. package/dist/test/event-graph-types.test.d.ts +2 -0
  121. package/dist/test/event-graph-types.test.js +4 -0
  122. package/dist/test/event-graph.test.d.ts +2 -0
  123. package/dist/test/event-graph.test.js +4 -0
  124. package/dist/test/input.test.d.ts +2 -0
  125. package/dist/test/input.test.js +4 -0
  126. package/dist/test/net-character-movement.test.js +1 -1
  127. package/dist/test/prefab-instance-params.test.js +1 -1
  128. package/dist/test/sequence-camera-control.test.js +1 -1
  129. package/dist/test/sequence-scene-binding.test.d.ts +2 -0
  130. package/dist/test/sequence-scene-binding.test.js +4 -0
  131. package/dist/test/sequence-transform.test.d.ts +2 -0
  132. package/dist/test/sequence-transform.test.js +4 -0
  133. package/dist/test/shader-graph.test.js +1 -1
  134. package/package.json +10 -2
  135. package/tsconfig.tsbuildinfo +1 -1
@@ -0,0 +1,4 @@
1
+ export class DataOutput{constructor(t,e){this.node=t,this.name=e}}export class Node{constructor(){this.dataOutputs=new Map}output(t="value"){let e=this.dataOutputs.get(t);return null==e&&(e=new DataOutput(this,t),this.dataOutputs.set(t,e)),e}}export class PureNode extends Node{}export class ExecutionNode extends Node{constructor(){super(...arguments),this.executionOutputs=new Map}connect(t,e){if(this.executionOutputs.has(t))throw new Error(`Execution output ${JSON.stringify(t)} is already connected`);return this.executionOutputs.set(t,e),e}then(t){return this.connect("then",t)}getExecutionOutputs(){return this.executionOutputs}}/*
2
+ * Copyright (©) 2026 Hology Interactive AB. All rights reserved.
3
+ * See the LICENSE.md file for details.
4
+ */
@@ -0,0 +1,13 @@
1
+ export * from './compiler.js';
2
+ export * from './asset-references.js';
3
+ export * from './decorators.js';
4
+ export * from './document-compiler.js';
5
+ export * from './graph.js';
6
+ export * from './model.js';
7
+ export * from './nodes/index.js';
8
+ export * from './registry.js';
9
+ export * from './runtime.js';
10
+ export * from './runtime-assets.js';
11
+ export * from './type-inference.js';
12
+ export * from './types.js';
13
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1,4 @@
1
+ export*from"./compiler.js";export*from"./asset-references.js";export*from"./decorators.js";export*from"./document-compiler.js";export*from"./graph.js";export*from"./model.js";export*from"./nodes/index.js";export*from"./registry.js";export*from"./runtime.js";export*from"./runtime-assets.js";export*from"./type-inference.js";export*from"./types.js";/*
2
+ * Copyright (©) 2026 Hology Interactive AB. All rights reserved.
3
+ * See the LICENSE.md file for details.
4
+ */
@@ -0,0 +1,71 @@
1
+ import type { EventGraphType } from './types.js';
2
+ export type EventGraphNodeKind = 'event.beginPlay' | 'event.update' | 'event.endPlay' | 'event.observable' | 'event.source' | 'event.bindSource' | 'flow.branch' | 'flow.sequence' | 'flow.parallel' | 'flow.switch' | 'flow.delay' | 'flow.interval' | 'flow.clearInterval' | 'flow.forLoop' | 'flow.isValid' | 'flow.forEach' | 'flow.doOnce' | 'flow.gate' | 'debug.log' | 'constant.boolean' | 'constant.number' | 'constant.string' | 'constant.vector2' | 'constant.vector3' | 'math.add' | 'math.subtract' | 'math.multiply' | 'math.divide' | 'math.modulo' | 'vector.length' | 'vector.lengthSquared' | 'vector.distance' | 'vector.distanceSquared' | 'vector.normalize' | 'vector.dot' | 'vector.cross' | 'vector.lerp' | 'vector.applyRotation' | 'compare.equal' | 'compare.notEqual' | 'compare.greaterThan' | 'compare.greaterThanOrEqual' | 'compare.lessThan' | 'compare.lessThanOrEqual' | 'boolean.and' | 'boolean.or' | 'boolean.not' | 'variable.get' | 'variable.set' | 'actor.reference' | 'actor.component' | 'actor.getProperty' | 'actor.setProperty' | 'actor.tweenProperty' | 'transform.moveTo' | 'transform.moveBy' | 'transform.rotateTo' | 'transform.rotateBy' | 'transform.scaleTo' | 'transform.scaleBy' | 'actor.callMethod' | 'actor.tryCallMethod' | 'actor.findByType' | 'actor.findAllByType' | 'actor.spawnClass' | 'actor.spawnPrefab' | 'actor.destroy' | 'asset.reference' | 'vfx.play' | 'sequence.play' | 'prefab.destroy';
3
+ export type EventGraphAssetKind = 'prefab' | 'vfx' | 'sequence';
4
+ export type EventGraphTransformSpace = 'local' | 'world';
5
+ export type EventGraphTransformAxis = 'x' | 'y' | 'z';
6
+ /** Persisted soft reference. Runtime graph values lower this to the stable asset id. */
7
+ export interface EventGraphAssetReference {
8
+ [key: string]: string;
9
+ assetId: string;
10
+ assetType: EventGraphAssetKind;
11
+ }
12
+ export type EventGraphSerializableValue = null | boolean | number | string | EventGraphSerializableValue[] | {
13
+ [key: string]: EventGraphSerializableValue;
14
+ };
15
+ export type EventGraphVector2Literal = [number, number];
16
+ export type EventGraphVector3Literal = [number, number, number];
17
+ export type EventGraphEulerLiteral = [number, number, number];
18
+ export interface EventGraphSocketRef {
19
+ nodeId: string;
20
+ port: string;
21
+ }
22
+ export interface EventGraphInputLiteral {
23
+ value: EventGraphSerializableValue;
24
+ }
25
+ export type EventGraphInput = EventGraphSocketRef | EventGraphInputLiteral;
26
+ export interface EventGraphNode {
27
+ id: string;
28
+ kind: EventGraphNodeKind;
29
+ params?: Record<string, EventGraphSerializableValue>;
30
+ inputs?: Record<string, EventGraphInput>;
31
+ }
32
+ export interface EventGraphEdge {
33
+ id?: string;
34
+ from: EventGraphSocketRef;
35
+ to: EventGraphSocketRef;
36
+ }
37
+ export interface EventGraphGroup {
38
+ id: string;
39
+ title: string;
40
+ nodeIds: string[];
41
+ }
42
+ export interface EventGraphLayout {
43
+ nodes?: Record<string, {
44
+ x: number;
45
+ y: number;
46
+ }>;
47
+ groups?: EventGraphGroup[];
48
+ }
49
+ export interface EventGraphVariable {
50
+ name: string;
51
+ type?: EventGraphType;
52
+ defaultValue?: EventGraphSerializableValue;
53
+ }
54
+ /** Persisted event graph data. Editor-only selection and viewport state do not belong here. */
55
+ export interface EventGraphDocument {
56
+ version: 1;
57
+ variables?: EventGraphVariable[];
58
+ nodes: EventGraphNode[];
59
+ edges: EventGraphEdge[];
60
+ layout?: EventGraphLayout;
61
+ }
62
+ export declare function createDefaultEventGraphDocument(): EventGraphDocument;
63
+ /**
64
+ * Returns true only when an authored event entry point can start an execution
65
+ * chain. Layout-only/default event nodes should not make prefab spawning pay
66
+ * for graph compilation or subscriptions.
67
+ */
68
+ export declare function hasExecutableEventGraphDocument(document: EventGraphDocument | null | undefined): document is EventGraphDocument;
69
+ /** Normalizes additive version-1 aliases without cloning current documents. */
70
+ export declare function normalizeEventGraphDocument(document: EventGraphDocument): EventGraphDocument;
71
+ //# sourceMappingURL=model.d.ts.map
@@ -0,0 +1,4 @@
1
+ export function createDefaultEventGraphDocument(){return{version:1,variables:[],nodes:[{id:"begin-play",kind:"event.beginPlay"},{id:"update",kind:"event.update"},{id:"end-play",kind:"event.endPlay"}],edges:[],layout:{nodes:{"begin-play":{x:0,y:0},update:{x:0,y:220},"end-play":{x:0,y:440}}}}}export function hasExecutableEventGraphDocument(e){if(null==e)return!1;const n=new Set(e.nodes.filter(e=>"event.bindSource"!==e.kind&&e.kind.startsWith("event.")).map(e=>e.id));return e.edges.some(e=>n.has(e.from.nodeId)&&"then"===e.from.port)}export function normalizeEventGraphDocument(e){var n;const o=new Set(e.nodes.filter(e=>"actor.spawnPrefab"===e.kind||"vfx.play"===e.kind).map(e=>e.id)),t=new Set(e.nodes.filter(e=>"flow.doOnce"===e.kind).map(e=>e.id)),d=e.nodes.some(e=>o.has(e.id)&&null!=e.inputs?.location)||e.edges.some(e=>o.has(e.to.nodeId)&&"location"===e.to.port),i=e.edges.some(e=>t.has(e.from.nodeId)&&"completed"===e.from.port);if(!d&&!i)return e;const r=structuredClone(e);for(const e of r.nodes)o.has(e.id)&&null!=e.inputs?.location&&((n=e.inputs).position??(n.position=e.inputs.location),delete e.inputs.location);for(const e of r.edges)o.has(e.to.nodeId)&&"location"===e.to.port&&(e.to.port="position"),t.has(e.from.nodeId)&&"completed"===e.from.port&&(e.from.port="then");return r}/*
2
+ * Copyright (©) 2026 Hology Interactive AB. All rights reserved.
3
+ * See the LICENSE.md file for details.
4
+ */
@@ -0,0 +1,115 @@
1
+ import type { CompilationContext } from '../compiler.js';
2
+ import { ExecutionNode, type ExecutionCompileResult, type ValueInput } from '../graph.js';
3
+ export declare class StartNode extends ExecutionNode {
4
+ compileExecution(): ExecutionCompileResult;
5
+ }
6
+ export declare class LogNode extends ExecutionNode {
7
+ readonly value: ValueInput;
8
+ constructor(value: ValueInput);
9
+ compileExecution(c: CompilationContext): ExecutionCompileResult;
10
+ }
11
+ export declare class CallScopeNode extends ExecutionNode {
12
+ compileExecution(): ExecutionCompileResult;
13
+ }
14
+ export declare class DelayNode extends ExecutionNode {
15
+ readonly delayMs: ValueInput;
16
+ constructor(delayMs: ValueInput);
17
+ compileExecution(c: CompilationContext): ExecutionCompileResult;
18
+ }
19
+ export declare class IntervalNode extends ExecutionNode {
20
+ private readonly nodeId;
21
+ private readonly intervalMs;
22
+ readonly timerId: import("../graph.js").DataOutput<number>;
23
+ constructor(nodeId: string, intervalMs: ValueInput);
24
+ compileExecution(c: CompilationContext): ExecutionCompileResult;
25
+ }
26
+ export declare class ClearIntervalNode extends ExecutionNode {
27
+ private readonly timerId;
28
+ constructor(timerId: ValueInput);
29
+ compileExecution(c: CompilationContext): ExecutionCompileResult;
30
+ }
31
+ export declare class SequenceNode extends ExecutionNode {
32
+ private readonly ports;
33
+ constructor(ports: readonly string[]);
34
+ compileExecution(): ExecutionCompileResult;
35
+ }
36
+ export declare class ForLoopNode extends ExecutionNode {
37
+ private readonly firstIndex;
38
+ private readonly lastIndex;
39
+ readonly index: import("../graph.js").DataOutput<number>;
40
+ constructor(firstIndex: ValueInput, lastIndex: ValueInput);
41
+ compileExecution(c: CompilationContext): ExecutionCompileResult;
42
+ }
43
+ export declare class DoOnceNode extends ExecutionNode {
44
+ private readonly nodeId;
45
+ private readonly entryPort;
46
+ private readonly startClosed;
47
+ constructor(nodeId: string, entryPort: string, startClosed: ValueInput);
48
+ compileExecution(c: CompilationContext): ExecutionCompileResult;
49
+ }
50
+ export declare class GateNode extends ExecutionNode {
51
+ private readonly nodeId;
52
+ private readonly entryPort;
53
+ private readonly startClosed;
54
+ constructor(nodeId: string, entryPort: string, startClosed: ValueInput);
55
+ compileExecution(c: CompilationContext): ExecutionCompileResult;
56
+ }
57
+ export declare class AssignNode extends ExecutionNode {
58
+ private readonly variable;
59
+ private readonly value;
60
+ constructor(variable: string, value: ValueInput);
61
+ compileExecution(c: CompilationContext): ExecutionCompileResult;
62
+ }
63
+ export declare class AddAssignNode extends ExecutionNode {
64
+ private readonly variable;
65
+ private readonly value;
66
+ constructor(variable: string, value: ValueInput);
67
+ compileExecution(c: CompilationContext): ExecutionCompileResult;
68
+ }
69
+ /** Chooses exactly one named execution output without producing a data value. */
70
+ export declare class BranchNode extends ExecutionNode {
71
+ private readonly condition;
72
+ constructor(condition: ValueInput);
73
+ compileExecution(c: CompilationContext): ExecutionCompileResult;
74
+ }
75
+ export declare class IsValidNode extends ExecutionNode {
76
+ private readonly input;
77
+ readonly value: import("../graph.js").DataOutput<unknown>;
78
+ constructor(input: ValueInput);
79
+ compileExecution(c: CompilationContext): ExecutionCompileResult;
80
+ }
81
+ export declare class ForEachNode extends ExecutionNode {
82
+ private readonly array;
83
+ readonly arrayElement: import("../graph.js").DataOutput<unknown>;
84
+ readonly arrayIndex: import("../graph.js").DataOutput<number>;
85
+ constructor(array: ValueInput);
86
+ compileExecution(c: CompilationContext): ExecutionCompileResult;
87
+ }
88
+ /** Runs named branches concurrently and continues after all complete successfully. */
89
+ export declare class ParallelNode extends ExecutionNode {
90
+ readonly ports: ReadonlyArray<string>;
91
+ constructor(...ports: string[]);
92
+ compileExecution(): ExecutionCompileResult;
93
+ }
94
+ export declare class SelectNode extends ExecutionNode {
95
+ private readonly expression;
96
+ private readonly cases;
97
+ private readonly defaultPort;
98
+ constructor(expression: ValueInput, cases: ReadonlyArray<{
99
+ match: string;
100
+ port: string;
101
+ }>, defaultPort?: string);
102
+ compileExecution(c: CompilationContext): ExecutionCompileResult;
103
+ }
104
+ /**
105
+ * Demonstrates an impure node with both named execution outputs and named data
106
+ * outputs. The data pins refer to storage populated when this node executes.
107
+ */
108
+ export declare class ParseNumberNode extends ExecutionNode {
109
+ private readonly input;
110
+ readonly value: import("../graph.js").DataOutput<number>;
111
+ readonly error: import("../graph.js").DataOutput<string>;
112
+ constructor(input: ValueInput<string>);
113
+ compileExecution(c: CompilationContext): ExecutionCompileResult;
114
+ }
115
+ //# sourceMappingURL=execution-nodes.d.ts.map
@@ -0,0 +1,4 @@
1
+ import{ExecutionNode as t}from"../graph.js";export class StartNode extends t{compileExecution(){return{}}}export class LogNode extends t{constructor(t){super(),this.value=t}compileExecution(t){return{chunk:`console.log(${t.get(this.value)})`}}}export class CallScopeNode extends t{compileExecution(){return{chunk:"this.foo()",invalidatesValues:!0}}}export class DelayNode extends t{constructor(t){super(),this.delayMs=t}compileExecution(t){return{done:`runtime.delay(${t.get(this.delayMs)})`}}}export class IntervalNode extends t{constructor(t,e){super(),this.nodeId=t,this.intervalMs=e,this.timerId=this.output("timerId")}compileExecution(t){return{route:{kind:"runtimeCallback",callee:"runtime.setInterval",arguments:[JSON.stringify(this.nodeId),t.get(this.intervalMs)],completedPort:"interval",continuationPort:"then",returnValueOutput:t.getOutputVariable(this.timerId)},invalidatesValues:!0}}}export class ClearIntervalNode extends t{constructor(t){super(),this.timerId=t}compileExecution(t){return{chunk:`runtime.clearInterval(${t.get(this.timerId)})`}}}export class SequenceNode extends t{constructor(t){super(),this.ports=t}compileExecution(){return{route:{kind:"sequence",ports:this.ports,continuationPort:"then"}}}}export class ForLoopNode extends t{constructor(t,e){super(),this.firstIndex=t,this.lastIndex=e,this.index=this.output("index")}compileExecution(t){return{route:{kind:"forLoop",firstIndexExpression:t.get(this.firstIndex),lastIndexExpression:t.get(this.lastIndex),indexOutput:t.getOutputVariable(this.index),bodyPort:"loopBody",continuationPort:"completed"}}}}export class DoOnceNode extends t{constructor(t,e,r){super(),this.nodeId=t,this.entryPort=e,this.startClosed=r}compileExecution(t){return{route:{kind:"branch",condition:`runtime.doOnce(${JSON.stringify(this.nodeId)}, ${JSON.stringify(this.entryPort)}, ${t.get(this.startClosed)})`,truePort:"then",falsePort:"__blocked"},invalidatesValues:!0}}}export class GateNode extends t{constructor(t,e,r){super(),this.nodeId=t,this.entryPort=e,this.startClosed=r}compileExecution(t){return{route:{kind:"branch",condition:`runtime.gate(${JSON.stringify(this.nodeId)}, ${JSON.stringify(this.entryPort)}, ${t.get(this.startClosed)})`,truePort:"exit",falsePort:"__blocked"},invalidatesValues:!0}}}export class AssignNode extends t{constructor(t,e){super(),this.variable=t,this.value=e}compileExecution(t){return{chunk:`${t.getVariableName(this.variable)} = ${t.get(this.value)}`,invalidatesValues:!0}}}export class AddAssignNode extends t{constructor(t,e){super(),this.variable=t,this.value=e}compileExecution(t){return{chunk:`${t.getVariableName(this.variable)} += ${t.get(this.value)}`,invalidatesValues:!0}}}export class BranchNode extends t{constructor(t){super(),this.condition=t}compileExecution(t){return{route:{kind:"branch",condition:t.get(this.condition),truePort:"true",falsePort:"false",continuationPort:"then"}}}}export class IsValidNode extends t{constructor(t){super(),this.input=t,this.value=this.output("value")}compileExecution(t){const e=t.getOutputVariable(this.value);return{chunk:`${e} = ${t.get(this.input)}`,route:{kind:"branch",condition:`${e} !== null && ${e} !== undefined`,truePort:"valid",falsePort:"invalid",continuationPort:"then"}}}}export class ForEachNode extends t{constructor(t){super(),this.array=t,this.arrayElement=this.output("arrayElement"),this.arrayIndex=this.output("arrayIndex")}compileExecution(t){return{route:{kind:"forEach",arrayExpression:t.get(this.array),elementOutput:t.getOutputVariable(this.arrayElement),indexOutput:t.getOutputVariable(this.arrayIndex),bodyPort:"loopBody",continuationPort:"completed"}}}}export class ParallelNode extends t{constructor(...t){if(super(),0===t.length)throw new Error("ParallelNode needs at least one branch");if(t.includes("then"))throw new Error('ParallelNode reserves the "then" port for its continuation');if(new Set(t).size!==t.length)throw new Error("ParallelNode branch names must be unique");this.ports=t}compileExecution(){return{route:{kind:"parallel",ports:this.ports,continuationPort:"then"}}}}export class SelectNode extends t{constructor(t,e,r="default"){super(),this.expression=t,this.cases=e,this.defaultPort=r}compileExecution(t){return{route:{kind:"select",expression:t.get(this.expression),cases:this.cases,defaultPort:this.defaultPort,continuationPort:"then"}}}}export class ParseNumberNode extends t{constructor(t){super(),this.input=t,this.value=this.output("value"),this.error=this.output("error")}compileExecution(t){const e=t.getOutputVariable(this.value),r=t.getOutputVariable(this.error),o=`parsed_${t.variable()}`,s=`caught_${t.variable()}`;return{route:{kind:"try",attempt:`const ${o} = Number(${t.get(this.input)})\nif (Number.isNaN(${o})) {\n throw new Error('The input is not a number')\n}\n${e} = ${o}\n${r} = undefined`,catchVariable:s,recover:`${e} = undefined\n${r} = ${s} instanceof Error ? ${s}.message : String(${s})`,successPort:"success",errorPort:"error"}}}}/*
2
+ * Copyright (©) 2026 Hology Interactive AB. All rights reserved.
3
+ * See the LICENSE.md file for details.
4
+ */
@@ -0,0 +1,208 @@
1
+ import type { CompilationContext } from '../compiler.js';
2
+ import type { EventGraphSerializableValue } from '../model.js';
3
+ import type { EventGraphType } from '../types.js';
4
+ import { ExecutionNode, PureNode, type DataCompileResult, type ExecutionCompileResult, type ValueInput, type ValueLiteral } from '../graph.js';
5
+ export type BinaryOperator = '+' | '-' | '*' | '/' | '%' | '===' | '!==' | '>' | '>=' | '<' | '<=' | '&&' | '||';
6
+ export type VectorMathOperator = 'add' | 'subtract' | 'multiply' | 'divide' | 'modulo';
7
+ export type VectorUnaryOperator = 'length' | 'lengthSquared' | 'normalize';
8
+ export type VectorBinaryOperator = 'distance' | 'distanceSquared' | 'dot' | 'cross';
9
+ export declare class LiteralNode extends PureNode {
10
+ private readonly value;
11
+ constructor(value: ValueLiteral);
12
+ compileData(): DataCompileResult;
13
+ }
14
+ export declare class RuntimeLiteralNode extends PureNode {
15
+ private readonly value;
16
+ private readonly type;
17
+ constructor(value: EventGraphSerializableValue, type: EventGraphType);
18
+ compileData(): DataCompileResult;
19
+ }
20
+ export declare class BinaryOperatorNode extends PureNode {
21
+ private readonly a;
22
+ private readonly b;
23
+ private readonly operator;
24
+ constructor(a: ValueInput, b: ValueInput, operator: BinaryOperator);
25
+ compileData(c: CompilationContext): DataCompileResult;
26
+ }
27
+ export declare class VectorMathOperatorNode extends PureNode {
28
+ private readonly a;
29
+ private readonly b;
30
+ private readonly operator;
31
+ constructor(a: ValueInput, b: ValueInput, operator: VectorMathOperator);
32
+ compileData(c: CompilationContext): DataCompileResult;
33
+ }
34
+ export declare class VectorUnaryOperatorNode extends PureNode {
35
+ private readonly value;
36
+ private readonly operator;
37
+ constructor(value: ValueInput, operator: VectorUnaryOperator);
38
+ compileData(c: CompilationContext): DataCompileResult;
39
+ }
40
+ export declare class VectorBinaryOperatorNode extends PureNode {
41
+ private readonly a;
42
+ private readonly b;
43
+ private readonly operator;
44
+ constructor(a: ValueInput, b: ValueInput, operator: VectorBinaryOperator);
45
+ compileData(c: CompilationContext): DataCompileResult;
46
+ }
47
+ export declare class VectorLerpNode extends PureNode {
48
+ private readonly a;
49
+ private readonly b;
50
+ private readonly alpha;
51
+ constructor(a: ValueInput, b: ValueInput, alpha: ValueInput);
52
+ compileData(c: CompilationContext): DataCompileResult;
53
+ }
54
+ export declare class VectorApplyRotationNode extends PureNode {
55
+ private readonly value;
56
+ private readonly rotation;
57
+ constructor(value: ValueInput, rotation: ValueInput);
58
+ compileData(c: CompilationContext): DataCompileResult;
59
+ }
60
+ export declare class VectorEqualityNode extends PureNode {
61
+ private readonly a;
62
+ private readonly b;
63
+ private readonly negate;
64
+ constructor(a: ValueInput, b: ValueInput, negate: boolean);
65
+ compileData(c: CompilationContext): DataCompileResult;
66
+ }
67
+ export declare class NotNode extends PureNode {
68
+ private readonly value;
69
+ constructor(value: ValueInput);
70
+ compileData(c: CompilationContext): DataCompileResult;
71
+ }
72
+ /** Value passed to the currently executing event handler. */
73
+ export declare class EventValueNode extends PureNode {
74
+ compileData(): DataCompileResult;
75
+ }
76
+ export declare class ActorReferenceNode extends PureNode {
77
+ private readonly actorId;
78
+ constructor(actorId: string);
79
+ compileData(c: CompilationContext): DataCompileResult;
80
+ }
81
+ export declare class FindActorByTypeNode extends PureNode {
82
+ private readonly actorClass;
83
+ constructor(actorClass: ValueInput);
84
+ compileData(c: CompilationContext): DataCompileResult;
85
+ }
86
+ export declare class FindActorsByTypeNode extends PureNode {
87
+ private readonly actorClass;
88
+ constructor(actorClass: ValueInput);
89
+ compileData(c: CompilationContext): DataCompileResult;
90
+ }
91
+ export declare class AssetReferenceNode extends PureNode {
92
+ private readonly assetId;
93
+ constructor(assetId: string);
94
+ compileData(): DataCompileResult;
95
+ }
96
+ export declare class ComponentReferenceNode extends PureNode {
97
+ private readonly target;
98
+ private readonly property;
99
+ constructor(target: ValueInput, property: string);
100
+ compileData(c: CompilationContext): DataCompileResult;
101
+ }
102
+ export declare class GetPropertyNode extends PureNode {
103
+ private readonly target;
104
+ private readonly property;
105
+ constructor(target: ValueInput, property: string);
106
+ compileData(c: CompilationContext): DataCompileResult;
107
+ }
108
+ export declare class GraphVariableNode extends PureNode {
109
+ private readonly variable;
110
+ constructor(variable: string);
111
+ compileData(c: CompilationContext): DataCompileResult;
112
+ }
113
+ export declare class SetPropertyNode extends ExecutionNode {
114
+ private readonly target;
115
+ private readonly property;
116
+ private readonly value;
117
+ constructor(target: ValueInput, property: string, value: ValueInput);
118
+ compileExecution(c: CompilationContext): ExecutionCompileResult;
119
+ }
120
+ export declare class RuntimeCallbackNode extends ExecutionNode {
121
+ private readonly runtimeMethod;
122
+ private readonly args;
123
+ constructor(runtimeMethod: string, args: readonly ValueInput[]);
124
+ compileExecution(c: CompilationContext): ExecutionCompileResult;
125
+ }
126
+ export type EventSourceArgumentInput = ValueInput | {
127
+ kind: 'actorClass';
128
+ classId: string;
129
+ };
130
+ export declare class BindEventSourceNode extends ExecutionNode {
131
+ private readonly nodeId;
132
+ private readonly target;
133
+ private readonly method;
134
+ private readonly args;
135
+ private readonly component?;
136
+ readonly value: import("../graph.js").DataOutput<unknown>;
137
+ constructor(nodeId: string, target: ValueInput, method: string, args: readonly EventSourceArgumentInput[], component?: string);
138
+ compileExecution(c: CompilationContext): ExecutionCompileResult;
139
+ }
140
+ export declare class SetGraphVariableNode extends ExecutionNode {
141
+ private readonly variable;
142
+ private readonly value;
143
+ constructor(variable: string, value: ValueInput);
144
+ compileExecution(c: CompilationContext): ExecutionCompileResult;
145
+ }
146
+ export declare class CallMethodNode extends ExecutionNode {
147
+ private readonly target;
148
+ private readonly method;
149
+ private readonly args;
150
+ private readonly awaitResult;
151
+ readonly value: import("../graph.js").DataOutput<unknown>;
152
+ constructor(target: ValueInput, method: string, args: ValueInput[], awaitResult?: boolean);
153
+ compileExecution(c: CompilationContext): ExecutionCompileResult;
154
+ }
155
+ export declare class TryCallMethodNode extends ExecutionNode {
156
+ private readonly target;
157
+ private readonly method;
158
+ private readonly args;
159
+ private readonly awaitResult;
160
+ readonly value: import("../graph.js").DataOutput<unknown>;
161
+ readonly error: import("../graph.js").DataOutput<unknown>;
162
+ constructor(target: ValueInput, method: string, args: ValueInput[], awaitResult?: boolean);
163
+ compileExecution(c: CompilationContext): ExecutionCompileResult;
164
+ }
165
+ export declare class SpawnActorNode extends ExecutionNode {
166
+ private readonly classId;
167
+ readonly value: import("../graph.js").DataOutput<unknown>;
168
+ constructor(classId: string);
169
+ compileExecution(c: CompilationContext): ExecutionCompileResult;
170
+ }
171
+ export declare class SpawnPrefabNode extends ExecutionNode {
172
+ private readonly prefab;
173
+ private readonly position;
174
+ private readonly rotation;
175
+ readonly instance: import("../graph.js").DataOutput<unknown>;
176
+ readonly mainActor: import("../graph.js").DataOutput<unknown>;
177
+ constructor(prefab: ValueInput, position: ValueInput, rotation: ValueInput);
178
+ compileExecution(c: CompilationContext): ExecutionCompileResult;
179
+ }
180
+ export declare class PlayVfxNode extends ExecutionNode {
181
+ private readonly asset;
182
+ private readonly position;
183
+ private readonly rotation;
184
+ private readonly autoDestroy;
185
+ readonly value: import("../graph.js").DataOutput<unknown>;
186
+ constructor(asset: ValueInput, position: ValueInput, rotation: ValueInput, autoDestroy: ValueInput);
187
+ compileExecution(c: CompilationContext): ExecutionCompileResult;
188
+ }
189
+ export declare class PlaySequenceNode extends ExecutionNode {
190
+ private readonly asset;
191
+ private readonly target;
192
+ private readonly cameraControlEnabled;
193
+ private readonly autoDestroy;
194
+ readonly value: import("../graph.js").DataOutput<unknown>;
195
+ constructor(asset: ValueInput, target: ValueInput, cameraControlEnabled: ValueInput, autoDestroy: ValueInput);
196
+ compileExecution(c: CompilationContext): ExecutionCompileResult;
197
+ }
198
+ export declare class DestroyPrefabNode extends ExecutionNode {
199
+ private readonly instance;
200
+ constructor(instance: ValueInput);
201
+ compileExecution(c: CompilationContext): ExecutionCompileResult;
202
+ }
203
+ export declare class DestroyActorNode extends ExecutionNode {
204
+ private readonly actor;
205
+ constructor(actor: ValueInput);
206
+ compileExecution(c: CompilationContext): ExecutionCompileResult;
207
+ }
208
+ //# sourceMappingURL=gameplay-nodes.d.ts.map
@@ -0,0 +1,4 @@
1
+ import{ExecutionNode as t,PureNode as e}from"../graph.js";export class LiteralNode extends e{constructor(t){super(),this.value=t}compileData(){return{outputs:{value:s(this.value)}}}}export class RuntimeLiteralNode extends e{constructor(t,e){super(),this.value=t,this.type=e}compileData(){return{outputs:{value:a(this.value,this.type)}}}}export class BinaryOperatorNode extends e{constructor(t,e,r){super(),this.a=t,this.b=e,this.operator=r}compileData(t){return r(t,"binary",`(${t.get(this.a)} ${this.operator} ${t.get(this.b)})`)}}export class VectorMathOperatorNode extends e{constructor(t,e,r){super(),this.a=t,this.b=e,this.operator=r}compileData(t){return r(t,"vectorMath",`runtime.${function(t){switch(t){case"add":return"mathAdd";case"subtract":return"mathSubtract";case"multiply":return"mathMultiply";case"divide":return"mathDivide";case"modulo":return"mathModulo"}}(this.operator)}(${t.get(this.a)}, ${t.get(this.b)})`)}}export class VectorUnaryOperatorNode extends e{constructor(t,e){super(),this.value=t,this.operator=e}compileData(t){return r(t,"vector",`runtime.${function(t){switch(t){case"length":return"vectorLength";case"lengthSquared":return"vectorLengthSquared";case"normalize":return"vectorNormalize"}}(this.operator)}(${t.get(this.value)})`)}}export class VectorBinaryOperatorNode extends e{constructor(t,e,r){super(),this.a=t,this.b=e,this.operator=r}compileData(t){return r(t,"vector",`runtime.${function(t){switch(t){case"distance":return"vectorDistance";case"distanceSquared":return"vectorDistanceSquared";case"dot":return"vectorDot";case"cross":return"vectorCross"}}(this.operator)}(${t.get(this.a)}, ${t.get(this.b)})`)}}export class VectorLerpNode extends e{constructor(t,e,r){super(),this.a=t,this.b=e,this.alpha=r}compileData(t){return r(t,"vector",`runtime.vectorLerp(${t.get(this.a)}, ${t.get(this.b)}, ${t.get(this.alpha)})`)}}export class VectorApplyRotationNode extends e{constructor(t,e){super(),this.value=t,this.rotation=e}compileData(t){return r(t,"vector",`runtime.vectorApplyRotation(${t.get(this.value)}, ${t.get(this.rotation)})`)}}export class VectorEqualityNode extends e{constructor(t,e,r){super(),this.a=t,this.b=e,this.negate=r}compileData(t){const e=`${t.get(this.a)}.equals(${t.get(this.b)})`;return r(t,"vectorEquals",this.negate?`!(${e})`:e)}}export class NotNode extends e{constructor(t){super(),this.value=t}compileData(t){return r(t,"not",`(!${t.get(this.value)})`)}}export class EventValueNode extends e{compileData(){return{outputs:{value:"eventValue"}}}}export class ActorReferenceNode extends e{constructor(t){super(),this.actorId=t}compileData(t){return r(t,"actor",`runtime.actor(${s(this.actorId)})`)}}export class FindActorByTypeNode extends e{constructor(t){super(),this.actorClass=t}compileData(t){return r(t,"foundActor",`runtime.findActorByType(${t.get(this.actorClass)})`)}}export class FindActorsByTypeNode extends e{constructor(t){super(),this.actorClass=t}compileData(t){return r(t,"foundActors",`runtime.findActorsByType(${t.get(this.actorClass)})`)}}export class AssetReferenceNode extends e{constructor(t){super(),this.assetId=t}compileData(){return{outputs:{value:s(this.assetId)}}}}export class ComponentReferenceNode extends e{constructor(t,e){super(),this.target=t,this.property=e}compileData(t){return r(t,"component",`runtime.component(${t.get(this.target)}, ${s(this.property)})`)}}export class GetPropertyNode extends e{constructor(t,e){super(),this.target=t,this.property=e}compileData(t){return r(t,"property",`runtime.readValue(runtime.getProperty(${t.get(this.target)}, ${s(this.property)}))`)}}export class GraphVariableNode extends e{constructor(t){super(),this.variable=t}compileData(t){return r(t,"variable",`runtime.readValue(runtime.getVariable(${s(this.variable)}))`)}}export class SetPropertyNode extends t{constructor(t,e,r){super(),this.target=t,this.property=e,this.value=r}compileExecution(t){return{chunk:`runtime.setProperty(${t.get(this.target)}, ${s(this.property)}, ${t.get(this.value)})`,invalidatesValues:!0}}}export class RuntimeCallbackNode extends t{constructor(t,e){super(),this.runtimeMethod=t,this.args=e}compileExecution(t){return{route:{kind:"runtimeCallback",callee:`runtime.${this.runtimeMethod}`,arguments:this.args.map(e=>t.get(e)),completedPort:"completed",continuationPort:"then"},invalidatesValues:!0}}}export class BindEventSourceNode extends t{constructor(t,e,r,s,a){super(),this.nodeId=t,this.target=e,this.method=r,this.args=s,this.component=a,this.value=this.output("value")}compileExecution(r){const a=null==this.component?r.get(this.target):`runtime.component(${r.get(this.target)}, ${s(this.component)})`;return{route:{kind:"runtimeCallback",callee:"runtime.bindEventSource",arguments:[s(this.nodeId),a,s(this.method),`[${this.args.map(a=>function(r,a){return"object"!=typeof a||null==a||Array.isArray(a)||a instanceof e||a instanceof t||!("kind"in a)||"actorClass"!==a.kind?r.get(a):`runtime.actorClass(${s(a.classId)})`}(r,a)).join(", ")}]`],completedPort:"triggered",continuationPort:"then",callbackValueOutput:r.getOutputVariable(this.value)},invalidatesValues:!0}}}export class SetGraphVariableNode extends t{constructor(t,e){super(),this.variable=t,this.value=e}compileExecution(t){return{chunk:`runtime.setVariable(${s(this.variable)}, ${t.get(this.value)})`,invalidatesValues:!0}}}export class CallMethodNode extends t{constructor(t,e,r,s=!1){super(),this.target=t,this.method=e,this.args=r,this.awaitResult=s,this.value=this.output("value")}compileExecution(t){const e=`runtime.callMethod(${t.get(this.target)}, ${s(this.method)}, [${this.args.map(e=>t.get(e)).join(", ")}])`;return{chunk:`${t.getOutputVariable(this.value)} = ${this.awaitResult?"await ":""}${e}`,invalidatesValues:!0,requiresAsync:this.awaitResult}}}export class TryCallMethodNode extends t{constructor(t,e,r,s=!1){super(),this.target=t,this.method=e,this.args=r,this.awaitResult=s,this.value=this.output("value"),this.error=this.output("errorValue")}compileExecution(t){const e=t.getOutputVariable(this.value),r=t.getOutputVariable(this.error),a=`caught_${t.variable()}`,o=`runtime.callMethod(${t.get(this.target)}, ${s(this.method)}, [${this.args.map(e=>t.get(e)).join(", ")}])`;return{route:{kind:"try",attempt:`${e} = ${this.awaitResult?"await ":""}${o}\n${r} = undefined`,catchVariable:a,recover:`${e} = undefined\n${r} = ${a}`,successPort:"success",errorPort:"error",continuationPort:"then"},invalidatesValues:!0,requiresAsync:this.awaitResult}}}export class SpawnActorNode extends t{constructor(t){super(),this.classId=t,this.value=this.output("value")}compileExecution(t){return{chunk:`${t.getOutputVariable(this.value)} = await runtime.spawnActor(${s(this.classId)})`,invalidatesValues:!0,requiresAsync:!0}}}export class SpawnPrefabNode extends t{constructor(t,e,r){super(),this.prefab=t,this.position=e,this.rotation=r,this.instance=this.output("instance"),this.mainActor=this.output("mainActor")}compileExecution(t){const e=`spawnedPrefab_${t.variable()}`;return{chunk:`const ${e} = await runtime.spawnPrefab(${t.get(this.prefab)}, ${t.get(this.position)}, ${t.get(this.rotation)})\n${t.getOutputVariable(this.instance)} = ${e}.instance\n${t.getOutputVariable(this.mainActor)} = ${e}.mainActor`,invalidatesValues:!0,requiresAsync:!0}}}export class PlayVfxNode extends t{constructor(t,e,r,s){super(),this.asset=t,this.position=e,this.rotation=r,this.autoDestroy=s,this.value=this.output("value")}compileExecution(t){const e=t.getOutputVariable(this.value);return{chunk:`${e} = await runtime.playVfx(${t.get(this.asset)}, ${t.get(this.position)}, ${t.get(this.rotation)}, ${t.get(this.autoDestroy)})`,invalidatesValues:!0,requiresAsync:!0,route:{kind:"completion",actorExpression:e,completedPort:"completed",continuationPort:"then"}}}}export class PlaySequenceNode extends t{constructor(t,e,r,s){super(),this.asset=t,this.target=e,this.cameraControlEnabled=r,this.autoDestroy=s,this.value=this.output("value")}compileExecution(t){const e=t.getOutputVariable(this.value);return{chunk:`${e} = await runtime.playSequence(${t.get(this.asset)}, ${t.get(this.target)}, ${t.get(this.cameraControlEnabled)}, ${t.get(this.autoDestroy)})`,invalidatesValues:!0,requiresAsync:!0,route:{kind:"completion",actorExpression:e,completedPort:"completed",continuationPort:"then"}}}}export class DestroyPrefabNode extends t{constructor(t){super(),this.instance=t}compileExecution(t){return{chunk:`runtime.destroyPrefab(${t.get(this.instance)})`,invalidatesValues:!0}}}export class DestroyActorNode extends t{constructor(t){super(),this.actor=t}compileExecution(t){return{chunk:`runtime.destroyActor(${t.get(this.actor)})`,invalidatesValues:!0}}}function r(t,e,r){const s=`${e}_${t.variable()}`;return{setup:`const ${s} = ${r}`,outputs:{value:s}}}function s(t){if("number"==typeof t&&!Number.isFinite(t))throw new Error("Event graph numbers must be finite");const e=JSON.stringify(t);if(null==e)throw new Error("Event graph value cannot be serialized to JavaScript");return e}function a(t,e){if("vector2"===e.kind){const e=t;return`runtime.createVector2(${s(e[0])}, ${s(e[1])})`}if("vector3"===e.kind){const e=t;return`runtime.createVector3(${s(e[0])}, ${s(e[1])}, ${s(e[2])})`}if("euler"===e.kind){const e=t;return`runtime.createEuler(${s(e[0])}, ${s(e[1])}, ${s(e[2])})`}return"asset"===e.kind?s(t.assetId):"actorClass"===e.kind?`runtime.actorClass(${s(t)})`:"optional"===e.kind?null===t?"null":a(t,e.value):"array"===e.kind&&Array.isArray(t)?`[${t.map(t=>a(t,e.element)).join(", ")}]`:s(t)}/*
2
+ * Copyright (©) 2026 Hology Interactive AB. All rights reserved.
3
+ * See the LICENSE.md file for details.
4
+ */
@@ -0,0 +1,4 @@
1
+ export * from './execution-nodes.js';
2
+ export * from './gameplay-nodes.js';
3
+ export * from './value-nodes.js';
4
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1,4 @@
1
+ export*from"./execution-nodes.js";export*from"./gameplay-nodes.js";export*from"./value-nodes.js";/*
2
+ * Copyright (©) 2026 Hology Interactive AB. All rights reserved.
3
+ * See the LICENSE.md file for details.
4
+ */
@@ -0,0 +1,53 @@
1
+ import type { CompilationContext } from '../compiler.js';
2
+ import { PureNode, type DataCompileResult, type ValueInput } from '../graph.js';
3
+ export declare abstract class StringNode extends PureNode {
4
+ add(b: StringNode | string): StringNode;
5
+ }
6
+ export declare class ConstantStringNode extends StringNode {
7
+ readonly value: string;
8
+ constructor(value: string);
9
+ compileData(): DataCompileResult;
10
+ }
11
+ export declare abstract class NumberNode extends PureNode {
12
+ add(b: NumberNode | number): NumberNode;
13
+ asString(): StringNode;
14
+ }
15
+ export declare class AddNode extends NumberNode {
16
+ readonly a: NumberNode;
17
+ readonly b: NumberNode;
18
+ constructor(a: NumberNode, b: NumberNode);
19
+ compileData(c: CompilationContext): DataCompileResult;
20
+ }
21
+ export declare class NumberToStringNode extends StringNode {
22
+ private readonly value;
23
+ constructor(value: NumberNode);
24
+ compileData(c: CompilationContext): DataCompileResult;
25
+ }
26
+ export declare class ConcatNode extends StringNode {
27
+ readonly a: StringNode;
28
+ readonly b: StringNode;
29
+ constructor(a: StringNode, b: StringNode);
30
+ compileData(c: CompilationContext): DataCompileResult;
31
+ }
32
+ export declare class ConstantNumberNode extends NumberNode {
33
+ readonly value: number;
34
+ constructor(value: number);
35
+ compileData(): DataCompileResult;
36
+ }
37
+ export declare class ThisNode extends PureNode {
38
+ compileData(): DataCompileResult;
39
+ }
40
+ export declare class VariableNode extends PureNode {
41
+ private readonly variable;
42
+ constructor(variable: string);
43
+ compileData(c: CompilationContext): DataCompileResult;
44
+ }
45
+ export declare class SplitStringNode extends PureNode {
46
+ private readonly input;
47
+ private readonly delimiter;
48
+ readonly before: import("../graph.js").DataOutput<string>;
49
+ readonly after: import("../graph.js").DataOutput<string>;
50
+ constructor(input: ValueInput<string>, delimiter: ValueInput<string>);
51
+ compileData(c: CompilationContext): DataCompileResult;
52
+ }
53
+ //# sourceMappingURL=value-nodes.d.ts.map
@@ -0,0 +1,4 @@
1
+ import{PureNode as t}from"../graph.js";export class StringNode extends t{add(t){return new ConcatNode(this,"string"==typeof(e=t)?new ConstantStringNode(e):e);var e}}export class ConstantStringNode extends StringNode{constructor(t){super(),this.value=t}compileData(){return{outputs:{value:JSON.stringify(this.value)}}}}export class NumberNode extends t{add(t){return new AddNode(this,"number"==typeof(e=t)?new ConstantNumberNode(e):e);var e}asString(){return new NumberToStringNode(this)}}export class AddNode extends NumberNode{constructor(t,e){super(),this.a=t,this.b=e}compileData(t){const e=`sum_${t.variable()}`;return{setup:`const ${e} = (${t.get(this.a)} + ${t.get(this.b)})`,outputs:{value:`${e}`}}}}export class NumberToStringNode extends StringNode{constructor(t){super(),this.value=t}compileData(t){return{outputs:{value:`(${t.get(this.value)})?.toString()`}}}}export class ConcatNode extends StringNode{constructor(t,e){super(),this.a=t,this.b=e}compileData(t){return{outputs:{value:`(${t.get(this.a)} + ${t.get(this.b)})`}}}}export class ConstantNumberNode extends NumberNode{constructor(t){super(),this.value=t}compileData(){return{outputs:{value:this.value.toString()}}}}export class ThisNode extends t{compileData(){return{outputs:{value:"this"}}}}export class VariableNode extends t{constructor(t){super(),this.variable=t}compileData(t){return{outputs:{value:t.getVariableName(this.variable)}}}}export class SplitStringNode extends t{constructor(t,e){super(),this.input=t,this.delimiter=e,this.before=this.output("before"),this.after=this.output("after")}compileData(t){const e=t.get(this.input),s=t.get(this.delimiter),r=`split_${t.variable()}`;return{setup:`const ${r} = ${e}.split(${s})`,outputs:{before:`(${r}[0] ?? "")`,after:`${r}.slice(1).join(${s})`}}}}/*
2
+ * Copyright (©) 2026 Hology Interactive AB. All rights reserved.
3
+ * See the LICENSE.md file for details.
4
+ */
@@ -0,0 +1,33 @@
1
+ import type { EventGraphNode, EventGraphNodeKind, EventGraphSerializableValue } from './model.js';
2
+ import { type EventGraphType } from './types.js';
3
+ export type EventGraphValueType = EventGraphType;
4
+ export interface EventGraphPortDefinition {
5
+ name: string;
6
+ kind: 'execution' | 'data';
7
+ type?: EventGraphType;
8
+ label?: string;
9
+ optional?: boolean;
10
+ /** Effective fallback used when the document does not author a value for this input. */
11
+ defaultValue?: EventGraphSerializableValue;
12
+ }
13
+ export interface EventGraphNodeDefinition {
14
+ kind: EventGraphNodeKind;
15
+ label: string;
16
+ category: string;
17
+ inputs: EventGraphPortDefinition[];
18
+ outputs: EventGraphPortDefinition[];
19
+ pure?: boolean;
20
+ event?: boolean;
21
+ /** Execution output names are declared by node parameters. */
22
+ dynamicExecutionOutputs?: boolean;
23
+ }
24
+ export interface EventGraphPortTypeResolver {
25
+ getOutputType(nodeId: string, port: string): EventGraphType;
26
+ }
27
+ export declare const EVENT_GRAPH_NODE_DEFINITIONS: Record<EventGraphNodeKind, EventGraphNodeDefinition>;
28
+ /** Resolves the effective static and parameter-defined ports for compilers and editors. */
29
+ export declare function getEventGraphNodePorts(node: EventGraphNode, side: 'inputs' | 'outputs', types?: EventGraphPortTypeResolver | null): EventGraphPortDefinition[];
30
+ export declare function getEventGraphPortDefinition(node: EventGraphNode, port: string, side: 'inputs' | 'outputs', types?: EventGraphPortTypeResolver | null): EventGraphPortDefinition | undefined;
31
+ /** Returns the core-owned fallback for an input, or undefined when the input must be authored. */
32
+ export declare function getEventGraphInputDefault(node: EventGraphNode, port: string): EventGraphSerializableValue | undefined;
33
+ //# sourceMappingURL=registry.d.ts.map
@@ -0,0 +1,4 @@
1
+ import{EVENT_GRAPH_ACTOR_TYPE as e,EVENT_GRAPH_ACTOR_CLASS_TYPE as a,EVENT_GRAPH_ANY_TYPE as t,EVENT_GRAPH_BOOLEAN_TYPE as n,EVENT_GRAPH_COMPONENT_TYPE as o,EVENT_GRAPH_ROTATION_TYPE as l,EVENT_GRAPH_NUMBER_TYPE as r,EVENT_GRAPH_OBJECT_TYPE as d,EVENT_GRAPH_STRING_TYPE as i,EVENT_GRAPH_VECTOR2_TYPE as u,EVENT_GRAPH_VECTOR3_TYPE as s,eventGraphAssetType as p,eventGraphOptionalType as c}from"./types.js";const m={name:"exec",kind:"execution"},y={name:"then",kind:"execution"},f={name:"value",kind:"data",type:t},b={name:"target",kind:"data",type:d},k={name:"value",kind:"data",type:t},g=p("prefab"),v=p("vfx"),h=p("sequence"),V={kind:"object",classId:"PrefabInstance"},w={kind:"object",classId:"EventGraphTimer"};function x(e,a,n,o,l){return{kind:e,label:a,category:n,pure:!0,inputs:[{name:"a",kind:"data",type:t,...null!=l?{defaultValue:l[0]}:{}},{name:"b",kind:"data",type:t,...null!=l?{defaultValue:l[1]}:{}}],outputs:[{...f,type:o}]}}export const EVENT_GRAPH_NODE_DEFINITIONS={"event.beginPlay":T("event.beginPlay","Begin Play"),"event.update":{...T("event.update","Update"),outputs:[y,{name:"deltaTime",label:"Delta Seconds",kind:"data",type:r}]},"event.endPlay":T("event.endPlay","End Play"),"event.observable":{...T("event.observable","Observable"),outputs:[y,f]},"event.source":{...T("event.source","Event Source"),outputs:[y,f]},"event.bindSource":{...C("event.bindSource","Bind Event Source","Events",[{name:"target",label:"Target",kind:"data",type:d}]),outputs:[y,{name:"triggered",label:"Triggered",kind:"execution"},f]},"flow.branch":{kind:"flow.branch",label:"Branch",category:"Flow",inputs:[m,{name:"condition",kind:"data",type:n,defaultValue:!1}],outputs:[{name:"true",kind:"execution"},{name:"false",kind:"execution"},y]},"flow.sequence":{kind:"flow.sequence",label:"Sequence",category:"Flow",inputs:[m],outputs:[y],dynamicExecutionOutputs:!0},"flow.parallel":{kind:"flow.parallel",label:"Parallel",category:"Flow",inputs:[m],outputs:[y],dynamicExecutionOutputs:!0},"flow.switch":{kind:"flow.switch",label:"Switch",category:"Flow",inputs:[m,{...k,defaultValue:""}],outputs:[y,{name:"default",kind:"execution"}],dynamicExecutionOutputs:!0},"flow.delay":C("flow.delay","Delay","Flow",[{name:"durationMs",kind:"data",type:r,defaultValue:0}]),"flow.interval":{kind:"flow.interval",label:"Interval",category:"Flow",inputs:[m,{name:"intervalMs",label:"Interval (ms)",kind:"data",type:r,defaultValue:1e3}],outputs:[y,{name:"interval",label:"Interval",kind:"execution"},{name:"timerId",label:"Timer",kind:"data",type:w}]},"flow.clearInterval":C("flow.clearInterval","Clear Interval","Flow",[{name:"timerId",label:"Timer",kind:"data",type:w}]),"flow.forLoop":{kind:"flow.forLoop",label:"For Loop",category:"Flow",inputs:[m,{name:"firstIndex",label:"First Index",kind:"data",type:r,defaultValue:0},{name:"lastIndex",label:"Last Index",kind:"data",type:r,defaultValue:0}],outputs:[{name:"loopBody",label:"Loop Body",kind:"execution"},{name:"completed",label:"Completed",kind:"execution"},{name:"index",label:"Index",kind:"data",type:r}]},"flow.isValid":{kind:"flow.isValid",label:"Is Valid",category:"Flow",inputs:[m,{...k,type:c(t)}],outputs:[{name:"valid",kind:"execution"},{name:"invalid",kind:"execution"},y,f]},"flow.forEach":{kind:"flow.forEach",label:"For Each",category:"Flow",inputs:[m,{name:"array",label:"Array",kind:"data",type:{kind:"array",element:t}}],outputs:[{name:"loopBody",label:"Loop Body",kind:"execution"},{name:"completed",label:"Completed",kind:"execution"},{name:"arrayElement",label:"Array Element",kind:"data",type:t},{name:"arrayIndex",label:"Array Index",kind:"data",type:r}]},"flow.doOnce":{kind:"flow.doOnce",label:"Do Once",category:"Flow",inputs:[m,{name:"reset",label:"Reset",kind:"execution"},{name:"startClosed",label:"Start Closed",kind:"data",type:n,defaultValue:!1}],outputs:[y]},"flow.gate":{kind:"flow.gate",label:"Gate",category:"Flow",inputs:[{name:"enter",label:"Enter",kind:"execution"},{name:"open",label:"Open",kind:"execution"},{name:"close",label:"Close",kind:"execution"},{name:"toggle",label:"Toggle",kind:"execution"},{name:"startClosed",label:"Start Closed",kind:"data",type:n,defaultValue:!1}],outputs:[{name:"exit",label:"Exit",kind:"execution"}]},"debug.log":C("debug.log","Log","Debug",[{...k,defaultValue:""}]),"constant.boolean":A("constant.boolean","Boolean",n),"constant.number":A("constant.number","Number",r),"constant.string":A("constant.string","String",i),"constant.vector2":A("constant.vector2","Vector2",u),"constant.vector3":A("constant.vector3","Vector3",s),"math.add":x("math.add","Add","Math",t,[0,0]),"math.subtract":x("math.subtract","Subtract","Math",t,[0,0]),"math.multiply":x("math.multiply","Multiply","Math",t,[1,1]),"math.divide":x("math.divide","Divide","Math",t,[0,1]),"math.modulo":x("math.modulo","Modulo","Math",t,[0,1]),"vector.length":E("vector.length","Length","Vectors",[{...k,type:t}],r),"vector.lengthSquared":E("vector.lengthSquared","Length Squared","Vectors",[{...k,type:t}],r),"vector.distance":E("vector.distance","Distance","Vectors",[{name:"a",kind:"data",type:t},{name:"b",kind:"data",type:t}],r),"vector.distanceSquared":E("vector.distanceSquared","Distance Squared","Vectors",[{name:"a",kind:"data",type:t},{name:"b",kind:"data",type:t}],r),"vector.normalize":E("vector.normalize","Normalize","Vectors",[{...k,type:t}],t),"vector.dot":E("vector.dot","Dot Product","Vectors",[{name:"a",kind:"data",type:t},{name:"b",kind:"data",type:t}],r),"vector.cross":E("vector.cross","Cross Product","Vectors",[{name:"a",kind:"data",type:s,defaultValue:[1,0,0]},{name:"b",kind:"data",type:s,defaultValue:[0,1,0]}],s),"vector.lerp":E("vector.lerp","Lerp","Vectors",[{name:"a",kind:"data",type:t},{name:"b",kind:"data",type:t},{name:"alpha",kind:"data",type:r,defaultValue:.5}],t),"vector.applyRotation":E("vector.applyRotation","Apply Rotation","Vectors",[{...k,type:s,defaultValue:[0,0,1]},{name:"rotation",kind:"data",type:l,defaultValue:[0,0,0]}],s),"compare.equal":x("compare.equal","Equal","Comparison",n),"compare.notEqual":x("compare.notEqual","Not Equal","Comparison",n),"compare.greaterThan":x("compare.greaterThan","Greater Than","Comparison",n,[0,0]),"compare.greaterThanOrEqual":x("compare.greaterThanOrEqual","Greater Than Or Equal","Comparison",n,[0,0]),"compare.lessThan":x("compare.lessThan","Less Than","Comparison",n,[0,0]),"compare.lessThanOrEqual":x("compare.lessThanOrEqual","Less Than Or Equal","Comparison",n,[0,0]),"boolean.and":x("boolean.and","And","Boolean",n,[!1,!0]),"boolean.or":x("boolean.or","Or","Boolean",n,[!1,!1]),"boolean.not":{kind:"boolean.not",label:"Not",category:"Boolean",pure:!0,inputs:[{...k,defaultValue:!1}],outputs:[{...f,type:n}]},"variable.get":E("variable.get","Get Variable","Variables",[],t),"variable.set":C("variable.set","Set Variable","Variables",[k]),"actor.reference":E("actor.reference","Actor Reference","Actors",[],e),"actor.component":E("actor.component","Get Component","Actors",[b],o),"actor.getProperty":E("actor.getProperty","Get Property","Actors",[b],t),"actor.setProperty":C("actor.setProperty","Set Property","Actors",[b,k]),"actor.tweenProperty":{...C("actor.tweenProperty","Tween Property","Actors",[{name:"target",label:"Target",kind:"data",type:e},{name:"to",label:"To",kind:"data",type:t},{name:"duration",label:"Duration (s)",kind:"data",type:r,defaultValue:1}]),outputs:[y,{name:"completed",label:"Completed",kind:"execution"}]},"transform.moveTo":P("transform.moveTo","Move To",[{name:"position",label:"Position",kind:"data",type:s,defaultValue:[0,0,0]}]),"transform.moveBy":P("transform.moveBy","Move By",[{name:"offset",label:"Offset",kind:"data",type:s,defaultValue:[0,0,0]}]),"transform.rotateTo":P("transform.rotateTo","Rotate To",[{name:"rotation",label:"Rotation",kind:"data",type:l,defaultValue:[0,0,0]}]),"transform.rotateBy":P("transform.rotateBy","Rotate By",[{name:"angle",label:"Angle (deg)",kind:"data",type:r,defaultValue:0}]),"transform.scaleTo":P("transform.scaleTo","Scale To",[{name:"scale",label:"Scale",kind:"data",type:s,defaultValue:[1,1,1]}]),"transform.scaleBy":P("transform.scaleBy","Scale By",[{name:"factor",label:"Factor",kind:"data",type:s,defaultValue:[1,1,1]}]),"actor.callMethod":{...C("actor.callMethod","Call Method","Actors",[b]),outputs:[y,f]},"actor.tryCallMethod":{...C("actor.tryCallMethod","Try Call Method","Actors",[b]),outputs:[{name:"success",kind:"execution"},{name:"error",kind:"execution"},y,f,{name:"errorValue",kind:"data",type:t}]},"actor.findByType":E("actor.findByType","Find Actor by Type","Actors",[{name:"actorClass",label:"Actor Class",kind:"data",type:a}],c(e)),"actor.findAllByType":E("actor.findAllByType","Find Actors by Type","Actors",[{name:"actorClass",label:"Actor Class",kind:"data",type:a}],{kind:"array",element:e}),"actor.spawnClass":{...C("actor.spawnClass","Spawn Actor Class","Gameplay",[]),outputs:[y,{...f,type:e}]},"actor.spawnPrefab":{...C("actor.spawnPrefab","Spawn Prefab","Gameplay",[{name:"prefab",label:"Prefab",kind:"data",type:g},{name:"position",label:"Position",kind:"data",type:s,defaultValue:[0,0,0]},{name:"rotation",label:"Rotation",kind:"data",type:l,defaultValue:[0,0,0]}]),outputs:[y,{name:"instance",label:"Instance",kind:"data",type:V},{name:"mainActor",label:"Main Actor",kind:"data",type:c(e)}]},"actor.destroy":C("actor.destroy","Destroy Actor","Gameplay",[{name:"actor",label:"Actor",kind:"data",type:e}]),"asset.reference":E("asset.reference","Asset Reference","Assets",[],t),"vfx.play":{...C("vfx.play","Play VFX","Effects",[{name:"vfx",label:"VFX",kind:"data",type:v},{name:"position",label:"Position",kind:"data",type:s,defaultValue:[0,0,0]},{name:"rotation",label:"Rotation",kind:"data",type:l,defaultValue:[0,0,0]},{name:"autoDestroy",label:"Auto Destroy",kind:"data",type:n,defaultValue:!0}]),outputs:[y,{name:"completed",label:"Completed",kind:"execution"},{...f,label:"VFX Actor",type:e}]},"sequence.play":{...C("sequence.play","Play Sequence","Effects",[{name:"sequence",label:"Sequence",kind:"data",type:h},{name:"target",label:"Target",kind:"data",type:c(e),defaultValue:null},{name:"cameraControlEnabled",label:"Camera Control",kind:"data",type:n,defaultValue:!1},{name:"autoDestroy",label:"Auto Destroy",kind:"data",type:n,defaultValue:!0}]),outputs:[y,{name:"completed",label:"Completed",kind:"execution"},{...f,label:"Sequence Actor",type:e}]},"prefab.destroy":C("prefab.destroy","Destroy Prefab","Gameplay",[{name:"instance",label:"Instance",kind:"data",type:V}])};export function getEventGraphNodePorts(e,a,n){const o=EVENT_GRAPH_NODE_DEFINITIONS[e.kind][a].map(e=>({...e}));if("inputs"===a&&("actor.callMethod"===e.kind||"actor.tryCallMethod"===e.kind||"event.bindSource"===e.kind)){const a="number"==typeof e.params?.argumentCount&&Number.isInteger(e.params.argumentCount)?Math.max(0,e.params.argumentCount):0,n=Array.isArray(e.params?.argumentLabels)?e.params.argumentLabels.filter(e=>"string"==typeof e):[];for(let e=0;e<a;e++){const a=null!=n[e]&&n[e].length>0?n[e]:`Argument ${e+1}`;o.push({name:`arg${e}`,label:a,kind:"data",type:t})}}return"outputs"!==a||"flow.sequence"!==e.kind&&"flow.parallel"!==e.kind||!Array.isArray(e.params?.ports)||o.unshift(...e.params.ports.filter(e=>"string"==typeof e).map(e=>({name:e,label:e,kind:"execution"}))),"outputs"===a&&"flow.switch"===e.kind&&Array.isArray(e.params?.cases)&&o.unshift(...e.params.cases.flatMap(e=>{return null==e||Array.isArray(e)||"object"!=typeof e||"string"!=typeof e.port?[]:[{name:e.port,label:(a=e.value,"string"==typeof a?a:JSON.stringify(a)),kind:"execution"}];var a})),"outputs"===a&&null!=n?o.filter(a=>"data"!==a.kind||"void"!==n.getOutputType(e.id,a.name).kind):o}export function getEventGraphPortDefinition(e,a,t,n){return getEventGraphNodePorts(e,t,n).find(e=>e.name===a)}export function getEventGraphInputDefault(e,a){return getEventGraphPortDefinition(e,a,"inputs")?.defaultValue}function T(e,a){return{kind:e,label:a,category:"Events",event:!0,inputs:[],outputs:[y]}}function A(e,a,t){return{kind:e,label:a,category:"Constants",pure:!0,inputs:[],outputs:[{...f,type:t}]}}function E(e,a,t,n,o){return{kind:e,label:a,category:t,pure:!0,inputs:n,outputs:[{...f,type:o}]}}function C(e,a,t,n){return{kind:e,label:a,category:t,inputs:[m,...n],outputs:[y]}}function P(a,t,n){return{...C(a,t,"Transforms",[{name:"target",label:"Target",kind:"data",type:e},...n,{name:"duration",label:"Duration (s)",kind:"data",type:r,defaultValue:1}]),outputs:[y,{name:"completed",label:"Completed",kind:"execution"}]}}/*
2
+ * Copyright (©) 2026 Hology Interactive AB. All rights reserved.
3
+ * See the LICENSE.md file for details.
4
+ */