@ultrst-armada/kloks 1.4.2 → 1.4.4

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 (79) hide show
  1. package/package.json +8 -20
  2. package/packages/audio-midi/dist/index.d.ts +23 -14
  3. package/packages/audio-midi/dist/index.js +170 -45
  4. package/packages/audio-midi/kloks.manifest.json +8 -8
  5. package/packages/audio-midi/package.json +1 -1
  6. package/packages/backend/dist/{WebSocketTransport-CxUzUfwl.d.ts → WebSocketTransport-CHmkJ0tj.d.ts} +109 -2
  7. package/packages/backend/dist/auth/index.js +6 -6
  8. package/packages/backend/dist/chunk-5336MTXD.js +597 -0
  9. package/packages/backend/dist/{chunk-T3NYNBDC.js → chunk-5E6JRFUH.js} +201 -3
  10. package/packages/backend/dist/{chunk-XTWHEZWS.js → chunk-7B24ZWB3.js} +16 -1
  11. package/packages/backend/dist/{chunk-DZ4ZGIZM.js → chunk-JXUSBKJ2.js} +91 -654
  12. package/packages/backend/dist/{chunk-FO6WYLW4.js → chunk-KI3LHMUN.js} +133 -46
  13. package/packages/backend/dist/{chunk-4ZFXEFOE.js → chunk-MPYASJ5A.js} +2 -87
  14. package/packages/backend/dist/{chunk-KX3OTBQ3.js → chunk-OZDYAEH4.js} +0 -114
  15. package/packages/backend/dist/chunk-TY32TUNI.js +376 -0
  16. package/packages/backend/dist/chunk-VDROUXFT.js +116 -0
  17. package/packages/backend/dist/chunk-ZDH4XI7W.js +140 -0
  18. package/packages/backend/dist/client/index.d.ts +2 -3
  19. package/packages/backend/dist/connectivity/index.d.ts +18 -6
  20. package/packages/backend/dist/connectivity/index.js +3 -7
  21. package/packages/backend/dist/index.d.ts +3 -6
  22. package/packages/backend/dist/index.js +101 -91
  23. package/packages/backend/dist/krnl-services.d.ts +84 -7
  24. package/packages/backend/dist/krnl-services.js +40 -12
  25. package/packages/backend/dist/services/index.d.ts +4 -6
  26. package/packages/backend/dist/services/index.js +2 -2
  27. package/packages/backend/dist/srkl/index.js +6 -4
  28. package/packages/backend/dist/storage/index.js +7 -7
  29. package/packages/backend/dist/workspace/index.js +2 -2
  30. package/packages/backend/kloks.manifest.json +47 -45
  31. package/packages/backend/package.json +3 -8
  32. package/packages/client/package.json +1 -1
  33. package/packages/contracts/dist/index.js +5 -10
  34. package/packages/contracts/package.json +1 -1
  35. package/packages/functions/dist/index.d.ts +12 -1
  36. package/packages/functions/dist/index.js +132 -24
  37. package/packages/functions/package.json +1 -1
  38. package/packages/orchestrations/dist/index.d.ts +33 -31
  39. package/packages/orchestrations/dist/index.js +81 -203
  40. package/packages/orchestrations/kloks.manifest.json +10 -2
  41. package/packages/orchestrations/package.json +2 -2
  42. package/packages/services/dist/index.d.ts +51 -1
  43. package/packages/services/dist/index.js +249 -51
  44. package/packages/services/kloks.manifest.json +69 -33
  45. package/packages/services/package.json +1 -1
  46. package/packages/state-graph/dist/{BaseGraph-BvkSYOTw.d.ts → BaseGraph-Bd5F1NMP.d.ts} +1 -1
  47. package/packages/state-graph/dist/{BaseNode-DTcd3K1B.d.ts → BaseNode-DKpGXMy8.d.ts} +6 -0
  48. package/packages/state-graph/dist/{CompatibilityMatrix-Dj-tCWUA.d.ts → CompatibilityMatrix-TiEJ3j3_.d.ts} +1 -1
  49. package/packages/state-graph/dist/domain/index.d.ts +3 -3
  50. package/packages/state-graph/dist/domain/index.js +0 -1
  51. package/packages/state-graph/dist/index.d.ts +40 -8
  52. package/packages/state-graph/dist/index.js +193 -44
  53. package/packages/state-graph/dist/rules/index.d.ts +3 -3
  54. package/packages/state-graph/dist/rules/index.js +0 -1
  55. package/packages/state-graph/dist/spatial/index.d.ts +4 -4
  56. package/packages/state-graph/dist/spatial/index.js +0 -1
  57. package/packages/state-graph/dist/state/index.js +1 -3
  58. package/packages/state-graph/dist/store/index.d.ts +4 -4
  59. package/packages/state-graph/dist/store/index.js +0 -1
  60. package/packages/state-graph/dist/{types-VDoc4FIc.d.ts → types-D5kQSa65.d.ts} +2 -2
  61. package/packages/state-graph/kloks.manifest.json +26 -10
  62. package/packages/state-graph/package.json +2 -8
  63. package/packages/backend/dist/IdempotencyManager-B5MjK871.d.ts +0 -16
  64. package/packages/backend/dist/chunk-25Y7AVTP.js +0 -55
  65. package/packages/backend/dist/chunk-3EPY34R6.js +0 -67
  66. package/packages/backend/dist/chunk-7KNGX522.js +0 -220
  67. package/packages/backend/dist/chunk-FZKBTF34.js +0 -15
  68. package/packages/backend/dist/chunk-QGHDJGYS.js +0 -92
  69. package/packages/backend/dist/chunk-UPFKBBQI.js +0 -138
  70. package/packages/backend/dist/chunk-VQEFULWT.js +0 -88
  71. package/packages/backend/dist/execution/index.d.ts +0 -124
  72. package/packages/backend/dist/execution/index.js +0 -20
  73. package/packages/backend/dist/types-BERZJ93O.d.ts +0 -110
  74. package/packages/state-graph/dist/chunk-3RG5ZIWI.js +0 -10
  75. package/packages/state-graph/dist/chunk-Q5I42UX7.js +0 -0
  76. package/packages/state-graph/dist/chunk-ZTHBPV24.js +0 -267
  77. package/packages/state-graph/dist/execution/index.d.ts +0 -152
  78. package/packages/state-graph/dist/execution/index.js +0 -16
  79. /package/packages/state-graph/dist/{chunk-SHIBCPGQ.js → chunk-EW4ACSZB.js} +0 -0
@@ -6,6 +6,7 @@ import {
6
6
  ViewHandle,
7
7
  instantiateSubgraph
8
8
  } from "./chunk-S22PMERU.js";
9
+ import "./chunk-RHRXPY2U.js";
9
10
  import {
10
11
  AttractionEngine,
11
12
  GhostInferenceEngine,
@@ -15,21 +16,12 @@ import {
15
16
  getBeamPoints,
16
17
  useMagneticTraces
17
18
  } from "./chunk-JXDJZSFW.js";
18
- import "./chunk-RHRXPY2U.js";
19
19
  import {
20
20
  ConnectionRuleStore,
21
21
  HandleTypeRegistry,
22
22
  WireTypeRegistry,
23
23
  initializeDefaultGraphRules
24
24
  } from "./chunk-TZOL3RN7.js";
25
- import {
26
- BullMQAdapter,
27
- CommandBus,
28
- SKIPO_EXECUTION,
29
- SkipoExecutionEngine,
30
- useCommand
31
- } from "./chunk-ZTHBPV24.js";
32
- import "./chunk-Q5I42UX7.js";
33
25
  import {
34
26
  LifecycleCycleError,
35
27
  LifecycleGraph,
@@ -38,7 +30,7 @@ import {
38
30
  useLifecycleScope,
39
31
  useSkipoBind,
40
32
  useSkipoState
41
- } from "./chunk-SHIBCPGQ.js";
33
+ } from "./chunk-EW4ACSZB.js";
42
34
  import {
43
35
  CommandApi,
44
36
  GhostStore,
@@ -66,9 +58,8 @@ import {
66
58
  import {
67
59
  CompatibilityMatrix
68
60
  } from "./chunk-ISFNY7EZ.js";
69
- import "./chunk-3RG5ZIWI.js";
70
61
 
71
- // ../../node_modules/.pnpm/@ultrst-armada+krnl@1.0.2/node_modules/@ultrst-armada/krnl/packages/core/dist/index.js
62
+ // ../../node_modules/.pnpm/@ultrst-armada+krnl@1.0.3/node_modules/@ultrst-armada/krnl/packages/core/dist/index.js
72
63
  var ServiceStateStore = class {
73
64
  state;
74
65
  listeners = /* @__PURE__ */ new Set();
@@ -122,17 +113,37 @@ var ServiceEventBus = class {
122
113
  this.handlers.clear();
123
114
  }
124
115
  };
116
+ var TRANSITIONS = {
117
+ uninitialized: ["initializing"],
118
+ initializing: ["ready", "uninitialized"],
119
+ ready: ["starting"],
120
+ starting: ["running", "ready"],
121
+ running: ["stopping"],
122
+ stopping: ["stopped", "running"],
123
+ stopped: ["starting"]
124
+ };
125
125
  var LifecycleManager = class {
126
126
  status = "uninitialized";
127
127
  getStatus() {
128
128
  return this.status;
129
129
  }
130
- setStatus(next) {
130
+ canTransitionTo(next) {
131
+ return TRANSITIONS[this.status].includes(next);
132
+ }
133
+ transitionTo(next) {
134
+ if (!this.canTransitionTo(next)) {
135
+ throw new Error("[Lifecycle] Invalid transition '" + this.status + "' -> '" + next + "'.");
136
+ }
131
137
  this.status = next;
132
138
  }
139
+ setStatus(next) {
140
+ this.transitionTo(next);
141
+ }
133
142
  assertRunning(serviceName) {
134
143
  if (this.status !== "running") {
135
- throw new Error(`[Service:${serviceName}] Cannot invoke operation while status is '${this.status}' (expected 'running').`);
144
+ throw new Error(
145
+ "[Service:" + serviceName + "] Cannot invoke operation while status is '" + this.status + "' (expected 'running')."
146
+ );
136
147
  }
137
148
  }
138
149
  };
@@ -144,7 +155,7 @@ var ServiceInstance = class {
144
155
  this.version = definition.version;
145
156
  this.lifecycle = new LifecycleManager();
146
157
  this.eventBus = new ServiceEventBus();
147
- if (definition.state?.initial) {
158
+ if (definition.state) {
148
159
  this.stateStore = new ServiceStateStore(definition.state.initial);
149
160
  }
150
161
  }
@@ -155,46 +166,76 @@ var ServiceInstance = class {
155
166
  stateStore;
156
167
  eventBus;
157
168
  lifecycle;
169
+ initialized = false;
170
+ disposed = false;
158
171
  getDefinition() {
159
172
  return this.definition;
160
173
  }
174
+ getStatus() {
175
+ return this.lifecycle.getStatus();
176
+ }
161
177
  async start() {
162
- this.lifecycle.setStatus("starting");
163
- if (this.definition.lifecycle?.onInit) {
164
- await this.definition.lifecycle.onInit();
178
+ if (this.disposed) throw new Error("[Service:" + this.name + "] Cannot start a disposed service.");
179
+ const current = this.lifecycle.getStatus();
180
+ if (current === "running") return;
181
+ if (current === "initializing" || current === "starting" || current === "stopping") {
182
+ throw new Error("[Service:" + this.name + "] Cannot start while status is '" + current + "'.");
183
+ }
184
+ if (!this.initialized) {
185
+ this.lifecycle.transitionTo("initializing");
186
+ try {
187
+ await this.definition.lifecycle?.onInit?.();
188
+ this.initialized = true;
189
+ this.lifecycle.transitionTo("ready");
190
+ } catch (error) {
191
+ this.lifecycle.transitionTo("uninitialized");
192
+ throw error;
193
+ }
165
194
  }
166
- if (this.definition.lifecycle?.onStart) {
167
- await this.definition.lifecycle.onStart();
195
+ this.lifecycle.transitionTo("starting");
196
+ try {
197
+ await this.definition.lifecycle?.onStart?.();
198
+ this.lifecycle.transitionTo("running");
199
+ } catch (error) {
200
+ this.lifecycle.transitionTo("ready");
201
+ throw error;
168
202
  }
169
- this.lifecycle.setStatus("running");
170
203
  }
171
204
  async stop() {
172
- this.lifecycle.setStatus("stopping");
173
- if (this.definition.lifecycle?.onStop) {
174
- await this.definition.lifecycle.onStop();
205
+ const current = this.lifecycle.getStatus();
206
+ if (current === "stopped") return;
207
+ if (current !== "running") {
208
+ throw new Error("[Service:" + this.name + "] Cannot stop while status is '" + current + "'.");
175
209
  }
176
- if (this.definition.lifecycle?.onDispose) {
177
- await this.definition.lifecycle.onDispose();
210
+ this.lifecycle.transitionTo("stopping");
211
+ try {
212
+ await this.definition.lifecycle?.onStop?.();
213
+ this.lifecycle.transitionTo("stopped");
214
+ } catch (error) {
215
+ this.lifecycle.transitionTo("running");
216
+ throw error;
178
217
  }
179
- this.lifecycle.setStatus("stopped");
218
+ }
219
+ async dispose() {
220
+ if (this.disposed) return;
221
+ if (this.lifecycle.getStatus() === "running") await this.stop();
222
+ await this.definition.lifecycle?.onDispose?.();
223
+ this.disposed = true;
180
224
  }
181
225
  async call(op, input, ctx = {}) {
182
226
  this.lifecycle.assertRunning(this.name);
183
227
  const operation = this.definition.operations[op];
184
228
  if (!operation) {
185
- throw new Error(`[Service:${this.name}] Operation '${op}' not found.`);
229
+ throw new Error("[Service:" + this.name + "] Operation '" + op + "' not found.");
186
230
  }
187
231
  return await operation.handler(input, ctx);
188
232
  }
189
233
  getState() {
190
- if (!this.stateStore) {
191
- return Object.freeze({});
192
- }
193
- return this.stateStore.getState();
234
+ return this.stateStore?.getState() ?? Object.freeze({});
194
235
  }
195
236
  setState(mutation) {
196
237
  if (!this.stateStore) {
197
- this.stateStore = new ServiceStateStore(mutation);
238
+ this.stateStore = new ServiceStateStore({ ...mutation });
198
239
  return;
199
240
  }
200
241
  this.stateStore.setState(mutation);
@@ -206,12 +247,66 @@ var ServiceInstance = class {
206
247
  this.eventBus.emit(event, payload);
207
248
  }
208
249
  };
209
- function createServiceDefinition(definition) {
250
+ function assertRecord(value, field) {
251
+ if (!value || typeof value !== "object" || Array.isArray(value)) {
252
+ throw new Error("[KrnlTS] Invalid service definition: '" + field + "' must be an object.");
253
+ }
254
+ }
255
+ function assertNonEmptyString(value, field) {
256
+ if (typeof value !== "string" || value.trim().length === 0) {
257
+ throw new Error("[KrnlTS] Invalid service definition: '" + field + "' must be a non-empty string.");
258
+ }
259
+ }
260
+ function validateServiceDefinition(definition) {
261
+ if (!definition || typeof definition !== "object") {
262
+ throw new Error("[KrnlTS] Invalid service definition: expected an object.");
263
+ }
264
+ assertNonEmptyString(definition.id, "id");
265
+ assertNonEmptyString(definition.name, "name");
266
+ assertNonEmptyString(definition.version, "version");
267
+ if (!definition.operations || typeof definition.operations !== "object") {
268
+ throw new Error("[Service:" + definition.name + "] Invalid operations: expected an object.");
269
+ }
270
+ for (const [key, operation] of Object.entries(definition.operations)) {
271
+ if (!operation || typeof operation !== "object") {
272
+ throw new Error("[Service:" + definition.name + "] Invalid operation '" + key + "'.");
273
+ }
274
+ assertNonEmptyString(operation.id, "operations." + key + ".id");
275
+ assertNonEmptyString(operation.name, "operations." + key + ".name");
276
+ if (operation.inputSchema !== void 0) assertRecord(operation.inputSchema, "operations." + key + ".inputSchema");
277
+ if (operation.outputSchema !== void 0) assertRecord(operation.outputSchema, "operations." + key + ".outputSchema");
278
+ if (typeof operation.handler !== "function") {
279
+ throw new Error("[Service:" + definition.name + "] Operation '" + key + "' must define a handler.");
280
+ }
281
+ }
282
+ for (const [key, event] of Object.entries(definition.events ?? {})) {
283
+ if (!event || typeof event !== "object") {
284
+ throw new Error("[Service:" + definition.name + "] Invalid event '" + key + "'.");
285
+ }
286
+ assertNonEmptyString(event.name, "events." + key + ".name");
287
+ }
288
+ for (const [key, schema] of Object.entries(definition.inputs ?? {})) assertRecord(schema, "inputs." + key);
289
+ for (const [key, schema] of Object.entries(definition.outputs ?? {})) assertRecord(schema, "outputs." + key);
290
+ if (definition.state?.schema !== void 0) assertRecord(definition.state.schema, "state.schema");
291
+ for (const capability of definition.capabilities ?? []) {
292
+ assertNonEmptyString(capability.id, "capability.id");
293
+ assertNonEmptyString(capability.name, "capability.name");
294
+ if (!Array.isArray(capability.protocols)) {
295
+ throw new Error("[Service:" + definition.name + "] Capability '" + capability.name + "' protocols must be an array.");
296
+ }
297
+ }
298
+ for (const dependency of definition.dependencies ?? []) {
299
+ assertNonEmptyString(dependency.serviceId, "dependency.serviceId");
300
+ }
210
301
  return definition;
211
302
  }
303
+ function createServiceDefinition(definition) {
304
+ return validateServiceDefinition(definition);
305
+ }
212
306
  function createService(definition) {
213
- return new ServiceInstance(definition);
307
+ return new ServiceInstance(validateServiceDefinition(definition));
214
308
  }
309
+ var asyncHooks = globalThis.process?.getBuiltinModule?.("node:async_hooks");
215
310
 
216
311
  // src/Viewport.ts
217
312
  function screenToCanvas(clientX, clientY, viewport) {
@@ -1215,6 +1310,29 @@ function getNodeSockets(node) {
1215
1310
  const outputs = customSockets.filter((s) => s.polarity === "output");
1216
1311
  return { inputs, outputs };
1217
1312
  }
1313
+ const rawInputs = node.inputs;
1314
+ const rawOutputs = node.outputs;
1315
+ if (Array.isArray(rawInputs) || Array.isArray(rawOutputs)) {
1316
+ const inputs = Array.isArray(rawInputs) ? rawInputs.map((inp, idx) => createPackagedSocket({
1317
+ socketId: inp.id || `in_${idx}`,
1318
+ label: inp.label || inp.id || "IN",
1319
+ polarity: "input",
1320
+ medium: inp.dataType?.toLowerCase().includes("audio") ? "audio_stereo" : "trigger",
1321
+ dataType: "stream",
1322
+ signalType: inp.dataType?.toLowerCase() || "audio_stereo",
1323
+ description: inp.label || "Input Socket"
1324
+ })) : [];
1325
+ const outputs = Array.isArray(rawOutputs) ? rawOutputs.map((out, idx) => createPackagedSocket({
1326
+ socketId: out.id || `out_${idx}`,
1327
+ label: out.label || out.id || "OUT",
1328
+ polarity: "output",
1329
+ medium: out.dataType?.toLowerCase().includes("audio") ? "audio_stereo" : "trigger",
1330
+ dataType: "stream",
1331
+ signalType: out.dataType?.toLowerCase() || "audio_stereo",
1332
+ description: out.label || "Output Socket"
1333
+ })) : [];
1334
+ return { inputs, outputs };
1335
+ }
1218
1336
  if (node.type === "input_strip") {
1219
1337
  const ioCfg = node.mapIoConfig || createDefaultMapIoConfig();
1220
1338
  const inputsList = ioCfg?.inputs && Array.isArray(ioCfg.inputs) ? ioCfg.inputs : [];
@@ -4821,12 +4939,12 @@ var GraphBridgeNode = class extends BaseNode {
4821
4939
  originalSpaceNode;
4822
4940
  constructor(spaceNode, handles) {
4823
4941
  const dims = GraphNodeParent.getNodeDimensions(spaceNode);
4942
+ const pos = Array.isArray(spaceNode.position) ? { x: spaceNode.position[0] * COORD_SCALE, y: (spaceNode.position[2] ?? spaceNode.position[1] ?? 0) * COORD_SCALE } : spaceNode.position && typeof spaceNode.position === "object" ? { x: Number(spaceNode.position.x ?? 0), y: Number(spaceNode.position.y ?? 0) } : { x: 0, y: 0 };
4824
4943
  super({
4825
4944
  id: spaceNode.id,
4826
4945
  type: spaceNode.type,
4827
- label: spaceNode.name || spaceNode.id,
4828
- position: { x: spaceNode.position[0] * COORD_SCALE, y: spaceNode.position[2] * COORD_SCALE },
4829
- // 2D projection on XZ plane
4946
+ label: spaceNode.name || spaceNode.label || spaceNode.id,
4947
+ position: pos,
4830
4948
  size: { width: dims.width, height: dims.height },
4831
4949
  handles
4832
4950
  });
@@ -4893,7 +5011,31 @@ function initializeMagneticRules() {
4893
5011
  }
4894
5012
  function mapSpaceNodeToBridgeNode(spaceNode) {
4895
5013
  initializeMagneticRules();
4896
- const { inputs, outputs } = getNodeSockets(spaceNode);
5014
+ let { inputs, outputs } = getNodeSockets(spaceNode);
5015
+ const rawInputs = spaceNode.inputs;
5016
+ const rawOutputs = spaceNode.outputs;
5017
+ if (Array.isArray(rawInputs)) {
5018
+ inputs = rawInputs.map((inp, idx) => createPackagedSocket({
5019
+ socketId: inp.id || `in_${idx}`,
5020
+ label: inp.label || inp.id || "IN",
5021
+ polarity: "input",
5022
+ medium: inp.dataType?.toLowerCase().includes("audio") ? "audio_stereo" : "trigger",
5023
+ dataType: "stream",
5024
+ signalType: inp.dataType?.toLowerCase() || "audio_stereo",
5025
+ description: inp.label || "Input Socket"
5026
+ }));
5027
+ }
5028
+ if (Array.isArray(rawOutputs)) {
5029
+ outputs = rawOutputs.map((out, idx) => createPackagedSocket({
5030
+ socketId: out.id || `out_${idx}`,
5031
+ label: out.label || out.id || "OUT",
5032
+ polarity: "output",
5033
+ medium: out.dataType?.toLowerCase().includes("audio") ? "audio_stereo" : "trigger",
5034
+ dataType: "stream",
5035
+ signalType: out.dataType?.toLowerCase() || "audio_stereo",
5036
+ description: out.label || "Output Socket"
5037
+ }));
5038
+ }
4897
5039
  const handles = [];
4898
5040
  const customOffsets = spaceNode.socketOffsets;
4899
5041
  const dims = GraphNodeParent.getNodeDimensions(spaceNode);
@@ -9511,6 +9653,12 @@ var PredictiveGraphServiceFacade = {
9511
9653
  return predictiveGraphServiceInstance.call(op, input);
9512
9654
  }
9513
9655
  };
9656
+ var krnlStateLifecycleServiceDefinition = StateLifecycleServiceDefinition;
9657
+ var krnlStateLifecycleServiceFacade = StateLifecycleServiceFacade;
9658
+ var krnlNodeGraphEngineServiceDefinition = NodeGraphEngineServiceDefinition;
9659
+ var krnlNodeGraphEngineServiceFacade = NodeGraphEngineServiceFacade;
9660
+ var krnlPredictiveGraphServiceDefinition = PredictiveGraphServiceDefinition;
9661
+ var krnlPredictiveGraphServiceFacade = PredictiveGraphServiceFacade;
9514
9662
  export {
9515
9663
  ALL_GRAPH_TYPES,
9516
9664
  ArrangementNodeModel,
@@ -9530,7 +9678,6 @@ export {
9530
9678
  BaseNode,
9531
9679
  BaseViewWindow,
9532
9680
  BufferConcepts,
9533
- BullMQAdapter,
9534
9681
  CANONICAL_EFFECTS_TABLE,
9535
9682
  CANONICAL_SIGNAL_TYPES,
9536
9683
  COLOR_PALETTES,
@@ -9539,7 +9686,6 @@ export {
9539
9686
  CanonicalMidiInputEndpoint,
9540
9687
  CodeNodeModel,
9541
9688
  CommandApi,
9542
- CommandBus,
9543
9689
  CompatibilityMatrix,
9544
9690
  ComponentSocket,
9545
9691
  ComponentWire,
@@ -9620,12 +9766,10 @@ export {
9620
9766
  RouterNodeModel,
9621
9767
  RoutingNodeParent,
9622
9768
  SIGNAL_TYPES,
9623
- SKIPO_EXECUTION,
9624
9769
  SKIPO_STATE,
9625
9770
  SPAWN_ELEVATIONS,
9626
9771
  STORAGE_KEY,
9627
9772
  SignalGeneratorNodeParent,
9628
- SkipoExecutionEngine,
9629
9773
  SkipoStateEngine,
9630
9774
  SolidConnection,
9631
9775
  SpatialEngine,
@@ -9774,6 +9918,12 @@ export {
9774
9918
  isNodeInCenterDeadZone,
9775
9919
  isSignalCompatibleWithTrack,
9776
9920
  isWireAffectedByEffect,
9921
+ krnlNodeGraphEngineServiceDefinition,
9922
+ krnlNodeGraphEngineServiceFacade,
9923
+ krnlPredictiveGraphServiceDefinition,
9924
+ krnlPredictiveGraphServiceFacade,
9925
+ krnlStateLifecycleServiceDefinition,
9926
+ krnlStateLifecycleServiceFacade,
9777
9927
  linearToDb,
9778
9928
  lintJavaScriptCode,
9779
9929
  loadStoredConfig,
@@ -9809,7 +9959,6 @@ export {
9809
9959
  unregisterCustomNodeSockets,
9810
9960
  unregisterNodeArchetype,
9811
9961
  updateNamedMidiProfile,
9812
- useCommand,
9813
9962
  useLifecycleScope,
9814
9963
  useMagneticTraces,
9815
9964
  useSkipoBind,
@@ -1,6 +1,6 @@
1
- import { c as CompatibilityRule, C as CompatibilityResolution } from '../CompatibilityMatrix-Dj-tCWUA.js';
2
- export { a as CompatibilityMatrix, b as CompatibilityResolverDelegate } from '../CompatibilityMatrix-Dj-tCWUA.js';
3
- import { j as NodeDefinition, B as BaseHandle, c as HandleDirection, H as HandleCategory, g as HandleDefinition } from '../BaseNode-DTcd3K1B.js';
1
+ import { c as CompatibilityRule, C as CompatibilityResolution } from '../CompatibilityMatrix-TiEJ3j3_.js';
2
+ export { a as CompatibilityMatrix, b as CompatibilityResolverDelegate } from '../CompatibilityMatrix-TiEJ3j3_.js';
3
+ import { j as NodeDefinition, B as BaseHandle, c as HandleDirection, H as HandleCategory, g as HandleDefinition } from '../BaseNode-DKpGXMy8.js';
4
4
 
5
5
  interface HandleTypeDefinition {
6
6
  dataType: string;
@@ -8,7 +8,6 @@ import {
8
8
  import {
9
9
  CompatibilityMatrix
10
10
  } from "../chunk-ISFNY7EZ.js";
11
- import "../chunk-3RG5ZIWI.js";
12
11
  export {
13
12
  CompatibilityMatrix,
14
13
  ConnectionRuleStore,
@@ -1,8 +1,8 @@
1
- import { b as BaseNode, B as BaseHandle, i as HandlePosition, N as NodePosition, j as NodeDefinition } from '../BaseNode-DTcd3K1B.js';
2
- import { T as Trace, G as GraphNode, f as GraphEdge, N as NodeGraphConfig, b as GhostInferenceOptions, a as GhostCandidate, c as GhostNodeRecord, e as GhostTraceRecord } from '../types-VDoc4FIc.js';
3
- export { d as GhostSocketMapping, i as TraceEngine } from '../types-VDoc4FIc.js';
1
+ import { b as BaseNode, B as BaseHandle, i as HandlePosition, N as NodePosition, j as NodeDefinition } from '../BaseNode-DKpGXMy8.js';
2
+ import { T as Trace, G as GraphNode, f as GraphEdge, N as NodeGraphConfig, b as GhostInferenceOptions, a as GhostCandidate, c as GhostNodeRecord, e as GhostTraceRecord } from '../types-D5kQSa65.js';
3
+ export { d as GhostSocketMapping, i as TraceEngine } from '../types-D5kQSa65.js';
4
4
  import { S as SolidConnection } from '../BaseConnection-CMRrL6Fe.js';
5
- import '../CompatibilityMatrix-Dj-tCWUA.js';
5
+ import '../CompatibilityMatrix-TiEJ3j3_.js';
6
6
 
7
7
  declare class SpatialEngine {
8
8
  static calculateEffectiveHandlePosition(node: BaseNode, handle: BaseHandle): HandlePosition;
@@ -15,7 +15,6 @@ import {
15
15
  } from "../chunk-OV4JVTNY.js";
16
16
  import "../chunk-OYN4ZEZC.js";
17
17
  import "../chunk-ISFNY7EZ.js";
18
- import "../chunk-3RG5ZIWI.js";
19
18
  export {
20
19
  AttractionEngine,
21
20
  AutoSolidify,
@@ -1,4 +1,3 @@
1
- import "../chunk-Q5I42UX7.js";
2
1
  import {
3
2
  LifecycleCycleError,
4
3
  LifecycleGraph,
@@ -7,8 +6,7 @@ import {
7
6
  useLifecycleScope,
8
7
  useSkipoBind,
9
8
  useSkipoState
10
- } from "../chunk-SHIBCPGQ.js";
11
- import "../chunk-3RG5ZIWI.js";
9
+ } from "../chunk-EW4ACSZB.js";
12
10
  export {
13
11
  LifecycleCycleError,
14
12
  LifecycleGraph,
@@ -1,8 +1,8 @@
1
- import { N as NodePosition, a as NodeSize, b as BaseNode, e as BaseNodeProps, h as HandleOffset } from '../BaseNode-DTcd3K1B.js';
1
+ import { N as NodePosition, a as NodeSize, b as BaseNode, e as BaseNodeProps, h as HandleOffset } from '../BaseNode-DKpGXMy8.js';
2
2
  import { V as ViewLink, S as SolidConnection } from '../BaseConnection-CMRrL6Fe.js';
3
- import { a as BaseViewWindow, L as Landmark, e as GraphView, G as GraphSettings, f as Group } from '../BaseGraph-BvkSYOTw.js';
4
- import { T as Trace, c as GhostNodeRecord, e as GhostTraceRecord } from '../types-VDoc4FIc.js';
5
- import '../CompatibilityMatrix-Dj-tCWUA.js';
3
+ import { a as BaseViewWindow, L as Landmark, e as GraphView, G as GraphSettings, f as Group } from '../BaseGraph-Bd5F1NMP.js';
4
+ import { T as Trace, c as GhostNodeRecord, e as GhostTraceRecord } from '../types-D5kQSa65.js';
5
+ import '../CompatibilityMatrix-TiEJ3j3_.js';
6
6
 
7
7
  interface CreateViewWindowParams {
8
8
  id?: string;
@@ -7,7 +7,6 @@ import "../chunk-KG6QYS26.js";
7
7
  import "../chunk-OV4JVTNY.js";
8
8
  import "../chunk-OYN4ZEZC.js";
9
9
  import "../chunk-ISFNY7EZ.js";
10
- import "../chunk-3RG5ZIWI.js";
11
10
  export {
12
11
  CommandApi,
13
12
  GhostStore,
@@ -1,5 +1,5 @@
1
- import { b as BaseNode, c as HandleDirection, B as BaseHandle } from './BaseNode-DTcd3K1B.js';
2
- import { C as CompatibilityResolution } from './CompatibilityMatrix-Dj-tCWUA.js';
1
+ import { b as BaseNode, c as HandleDirection, B as BaseHandle } from './BaseNode-DKpGXMy8.js';
2
+ import { C as CompatibilityResolution } from './CompatibilityMatrix-TiEJ3j3_.js';
3
3
 
4
4
  interface Trace {
5
5
  id: string;
@@ -13,8 +13,14 @@
13
13
  "export": "StateLifecycleServiceFacade",
14
14
  "facade": "StateLifecycleServiceFacade"
15
15
  },
16
- "modes": ["backend"],
17
- "targets": { "backend": ["BackendFacade.services"] }
16
+ "modes": [
17
+ "backend"
18
+ ],
19
+ "targets": {
20
+ "backend": [
21
+ "BackendFacade.services"
22
+ ]
23
+ }
18
24
  },
19
25
  {
20
26
  "id": "node-graph",
@@ -26,15 +32,25 @@
26
32
  "export": "NodeGraphEngineServiceFacade",
27
33
  "facade": "NodeGraphEngineServiceFacade"
28
34
  },
29
- "ui": {
30
- "package": "@floks/canvas-ui",
31
- "components": ["InfiniteCanvas"]
32
- },
33
- "modes": ["backend", "fullstack"],
35
+ "modes": [
36
+ "backend",
37
+ "fullstack"
38
+ ],
34
39
  "targets": {
35
- "backend": ["BackendFacade.services"],
36
- "frontend": ["App.main-content"]
37
- }
40
+ "backend": [
41
+ "BackendFacade.services"
42
+ ],
43
+ "frontend": [
44
+ "App.main-content"
45
+ ]
46
+ },
47
+ "defaultFrontend": {
48
+ "component": "FrnlEditableNodeGraph",
49
+ "package": "@ultrst-armada/floks/canvas-ui",
50
+ "export": "FrnlEditableNodeGraph",
51
+ "relationship": "recommended"
52
+ },
53
+ "dependencies": []
38
54
  }
39
55
  ]
40
56
  }
@@ -23,11 +23,6 @@
23
23
  "types": "./dist/state/index.d.ts",
24
24
  "default": "./dist/state/index.js"
25
25
  },
26
- "./execution": {
27
- "import": "./dist/execution/index.js",
28
- "types": "./dist/execution/index.d.ts",
29
- "default": "./dist/execution/index.js"
30
- },
31
26
  "./domain": {
32
27
  "import": "./dist/domain/index.js",
33
28
  "types": "./dist/domain/index.d.ts",
@@ -50,13 +45,12 @@
50
45
  }
51
46
  },
52
47
  "scripts": {
53
- "build": "tsup src/index.ts src/state/index.ts src/execution/index.ts src/domain/index.ts src/rules/index.ts src/spatial/index.ts src/store/index.ts --format esm --dts --clean --external zustand --external bullmq --external react --external ws",
48
+ "build": "tsup src/index.ts src/state/index.ts src/domain/index.ts src/rules/index.ts src/spatial/index.ts src/store/index.ts --format esm --dts --clean --external zustand --external react --external ws",
54
49
  "typecheck": "tsc --noEmit",
55
50
  "clean": "rm -rf dist"
56
51
  },
57
52
  "dependencies": {
58
53
  "@kloks/functions": "workspace:*",
59
- "bullmq": "^6.3.8",
60
54
  "zustand": "^5.0.15"
61
55
  },
62
56
  "peerDependencies": {
@@ -68,6 +62,6 @@
68
62
  }
69
63
  },
70
64
  "devDependencies": {
71
- "@ultrst-armada/krnl": "^1.0.2"
65
+ "@ultrst-armada/krnl": "^1.0.3"
72
66
  }
73
67
  }
@@ -1,16 +0,0 @@
1
- /**
2
- * @file IdempotencyManager.ts
3
- * @description In-flight mutation deduplication, concurrent attachment, and completed result caching.
4
- */
5
- declare class IdempotencyManager {
6
- private inFlight;
7
- private completedCache;
8
- private ttlMs;
9
- constructor(ttlMs?: number);
10
- executeIdempotent<T>(idempotencyKey: string, operation: () => Promise<T>): Promise<T>;
11
- has(idempotencyKey: string): boolean;
12
- prune(): void;
13
- clear(): void;
14
- }
15
-
16
- export { IdempotencyManager as I };
@@ -1,55 +0,0 @@
1
- // src/auth/SessionManager.ts
2
- var SessionManager = class {
3
- ttl;
4
- constructor(ttlMs = 864e5) {
5
- this.ttl = ttlMs;
6
- }
7
- generateToken(userId) {
8
- return `sess::${userId}::${Date.now()}::${Math.random().toString(36).substring(2, 9)}`;
9
- }
10
- createSession(userId, role) {
11
- return {
12
- token: this.generateToken(userId),
13
- userId,
14
- role,
15
- expiresAt: Date.now() + this.ttl
16
- };
17
- }
18
- isValid(session) {
19
- return Date.now() < session.expiresAt;
20
- }
21
- };
22
-
23
- // src/auth/RateLimiter.ts
24
- var RateLimiter = class {
25
- attempts = /* @__PURE__ */ new Map();
26
- windowMs;
27
- maxUser;
28
- maxAdmin;
29
- constructor(windowMs = 9e5, maxUser = 5, maxAdmin = 3) {
30
- this.windowMs = windowMs;
31
- this.maxUser = maxUser;
32
- this.maxAdmin = maxAdmin;
33
- }
34
- check(identifier, isAdminAttempt = false) {
35
- const now = Date.now();
36
- let record = this.attempts.get(identifier);
37
- if (!record || now - record.windowStart > this.windowMs) {
38
- record = { count: 0, windowStart: now };
39
- this.attempts.set(identifier, record);
40
- }
41
- record.count++;
42
- const limit = isAdminAttempt ? this.maxAdmin : this.maxUser;
43
- if (record.count > limit) {
44
- throw new Error("Too many requests. Please try again later.");
45
- }
46
- }
47
- reset(identifier) {
48
- this.attempts.delete(identifier);
49
- }
50
- };
51
-
52
- export {
53
- SessionManager,
54
- RateLimiter
55
- };