@cadenza.io/service 2.17.27 → 2.17.28

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -8516,6 +8516,7 @@ var GraphSyncController = class _GraphSyncController {
8516
8516
  this.registeredActorTaskMaps = /* @__PURE__ */ new Set();
8517
8517
  this.registeredIntentDefinitions = /* @__PURE__ */ new Set();
8518
8518
  this.tasksSynced = false;
8519
+ this.actorsSynced = false;
8519
8520
  this.signalsSynced = false;
8520
8521
  this.intentsSynced = false;
8521
8522
  this.routinesSynced = false;
@@ -8980,13 +8981,19 @@ var GraphSyncController = class _GraphSyncController {
8980
8981
  );
8981
8982
  CadenzaService.createUniqueMetaTask(
8982
8983
  "Gather actor registration",
8983
- () => true
8984
+ () => {
8985
+ this.actorsSynced = true;
8986
+ return true;
8987
+ }
8984
8988
  ).doOn("meta.sync_controller.actor_registration_settled").emits("meta.sync_controller.synced_actors");
8985
8989
  this.registerActorTaskMapTask = CadenzaService.createMetaTask(
8986
8990
  "Split actor task maps",
8987
8991
  function* (ctx) {
8988
8992
  const task = ctx.task;
8989
- if (task.hidden || !task.register) {
8993
+ if (!this.tasksSynced || !this.actorsSynced) {
8994
+ return;
8995
+ }
8996
+ if (task.hidden || !task.register || !task.registered) {
8990
8997
  return;
8991
8998
  }
8992
8999
  const metadata = getActorTaskRuntimeMetadata(task.taskFunction);
@@ -9062,7 +9069,7 @@ var GraphSyncController = class _GraphSyncController {
9062
9069
  "Split observed signals of task",
9063
9070
  (ctx, emit) => {
9064
9071
  const task = ctx.task;
9065
- if (task.hidden || !task.register) return false;
9072
+ if (task.hidden || !task.register || !task.registered) return false;
9066
9073
  const serviceName2 = resolveSyncServiceName(task);
9067
9074
  if (!serviceName2) {
9068
9075
  return false;
@@ -9182,7 +9189,7 @@ var GraphSyncController = class _GraphSyncController {
9182
9189
  "Split intents of task",
9183
9190
  function(ctx, emit) {
9184
9191
  const task = ctx.task;
9185
- if (task.hidden || !task.register) return false;
9192
+ if (task.hidden || !task.register || !task.registered) return false;
9186
9193
  const serviceName2 = resolveSyncServiceName(task);
9187
9194
  if (!serviceName2) {
9188
9195
  return false;
@@ -9452,7 +9459,8 @@ var GraphSyncController = class _GraphSyncController {
9452
9459
  this.registerDeputyRelationshipTask
9453
9460
  );
9454
9461
  CadenzaService.registry.doForEachTask.clone().doOn(
9455
- "meta.sync_controller.synced_signals"
9462
+ "meta.sync_controller.synced_signals",
9463
+ "meta.sync_controller.synced_tasks"
9456
9464
  ).then(
9457
9465
  CadenzaService.createMetaTask(
9458
9466
  "Ensure signal and task sync ready",
@@ -9484,7 +9492,10 @@ var GraphSyncController = class _GraphSyncController {
9484
9492
  }
9485
9493
  ).then(this.registerSignalToTaskMapTask)
9486
9494
  );
9487
- CadenzaService.registry.doForEachTask.clone().doOn("meta.sync_controller.synced_intents").then(
9495
+ CadenzaService.registry.doForEachTask.clone().doOn(
9496
+ "meta.sync_controller.synced_intents",
9497
+ "meta.sync_controller.synced_tasks"
9498
+ ).then(
9488
9499
  CadenzaService.createMetaTask(
9489
9500
  "Ensure intent and task sync ready",
9490
9501
  (ctx) => {
@@ -9515,7 +9526,10 @@ var GraphSyncController = class _GraphSyncController {
9515
9526
  }
9516
9527
  ).then(this.registerIntentToTaskMapTask)
9517
9528
  );
9518
- CadenzaService.registry.doForEachTask.clone().doOn("meta.sync_controller.synced_actors").then(this.registerActorTaskMapTask);
9529
+ CadenzaService.registry.doForEachTask.clone().doOn(
9530
+ "meta.sync_controller.synced_actors",
9531
+ "meta.sync_controller.synced_tasks"
9532
+ ).then(this.registerActorTaskMapTask);
9519
9533
  CadenzaService.createMetaTask("Get registered task for actor sync", (ctx) => {
9520
9534
  const task = ctx.task ?? (ctx.__taskName ? CadenzaService.get(ctx.__taskName) : void 0);
9521
9535
  if (!task) {
@@ -9525,9 +9539,20 @@ var GraphSyncController = class _GraphSyncController {
9525
9539
  ...ctx,
9526
9540
  task
9527
9541
  };
9528
- }).doOn("meta.sync_controller.task_registered").then(this.registerActorTaskMapTask);
9542
+ }).doOn("meta.sync_controller.task_registered").then(
9543
+ CadenzaService.createMetaTask(
9544
+ "Ensure actor and task sync ready from task registration",
9545
+ (ctx) => {
9546
+ if (!this.tasksSynced || !this.actorsSynced) {
9547
+ return false;
9548
+ }
9549
+ return ctx;
9550
+ }
9551
+ ).then(this.registerActorTaskMapTask)
9552
+ );
9529
9553
  CadenzaService.registry.getAllRoutines.clone().doOn(
9530
9554
  "meta.sync_controller.synced_routines",
9555
+ "meta.sync_controller.synced_tasks",
9531
9556
  "meta.sync_controller.task_registered"
9532
9557
  ).then(
9533
9558
  CadenzaService.createMetaTask(