@cadenza.io/core 3.1.1 → 3.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.mjs CHANGED
@@ -13,7 +13,7 @@ function deepCloneFilter(input, filterOut = () => false) {
13
13
  const currentTarget = key !== void 0 ? target[key] : target;
14
14
  if (
15
15
  // TODO Should probably not be done like this...
16
- key === "__taskInstance" || key === "__routineInstance" || key === "__task" || key === "__routine" || key === "__httpServer" || key === "__httpsServer" || key === "__socketServer"
16
+ key === "__taskInstance" || key === "__routineInstance" || key === "__task" || key === "__routine" || key === "__tasks" || key === "__routines" || key === "__httpServer" || key === "__httpsServer" || key === "__socketServer"
17
17
  ) {
18
18
  target[key] = source;
19
19
  continue;
@@ -96,7 +96,7 @@ var SignalBroker = class _SignalBroker {
96
96
  this.metaRunner = metaRunner;
97
97
  }
98
98
  init() {
99
- Cadenza.createMetaTask(
99
+ this.clearSignalsTask = Cadenza.createDebounceMetaTask(
100
100
  "Execute and clear queued signals",
101
101
  () => {
102
102
  for (const [id, signals] of this.emitStacks.entries()) {
@@ -1352,14 +1352,19 @@ var GraphRoutine = class extends SignalEmitter {
1352
1352
  });
1353
1353
  tasks.forEach((t) => {
1354
1354
  this.tasks.add(t);
1355
- this.emit("meta.routine.task_added", {
1356
- data: {
1357
- taskName: t.name,
1358
- taskVersion: t.version,
1359
- routineName: this.name,
1360
- routineVersion: this.version
1361
- }
1362
- });
1355
+ const tasks2 = t.getIterator();
1356
+ while (tasks2.hasNext()) {
1357
+ const task = tasks2.next();
1358
+ if (!task) break;
1359
+ this.emit("meta.routine.task_added", {
1360
+ data: {
1361
+ taskName: task.name,
1362
+ taskVersion: task.version,
1363
+ routineName: this.name,
1364
+ routineVersion: this.version
1365
+ }
1366
+ });
1367
+ }
1363
1368
  });
1364
1369
  }
1365
1370
  /**
@@ -1567,6 +1572,7 @@ var Task = class extends SignalEmitter {
1567
1572
  isDebounce: this.isDebounce,
1568
1573
  isEphemeral: this.isEphemeral,
1569
1574
  isMeta: this.isMeta,
1575
+ isSubMeta: this.isSubMeta,
1570
1576
  validateInputContext: this.validateInputContext,
1571
1577
  validateOutputContext: this.validateOutputContext
1572
1578
  // inputContextSchemaId: this.inputContextSchema,
@@ -2055,6 +2061,9 @@ var Task = class extends SignalEmitter {
2055
2061
  mapOnFailSignals(callback) {
2056
2062
  return Array.from(this.signalsToEmitOnFail).map(callback);
2057
2063
  }
2064
+ mapObservedSignals(callback) {
2065
+ return Array.from(this.observedSignals).map(callback);
2066
+ }
2058
2067
  /**
2059
2068
  * Emits attached signals.
2060
2069
  * @param context The context for emission.