@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.mjs CHANGED
@@ -8465,6 +8465,7 @@ var GraphSyncController = class _GraphSyncController {
8465
8465
  this.registeredActorTaskMaps = /* @__PURE__ */ new Set();
8466
8466
  this.registeredIntentDefinitions = /* @__PURE__ */ new Set();
8467
8467
  this.tasksSynced = false;
8468
+ this.actorsSynced = false;
8468
8469
  this.signalsSynced = false;
8469
8470
  this.intentsSynced = false;
8470
8471
  this.routinesSynced = false;
@@ -8929,13 +8930,19 @@ var GraphSyncController = class _GraphSyncController {
8929
8930
  );
8930
8931
  CadenzaService.createUniqueMetaTask(
8931
8932
  "Gather actor registration",
8932
- () => true
8933
+ () => {
8934
+ this.actorsSynced = true;
8935
+ return true;
8936
+ }
8933
8937
  ).doOn("meta.sync_controller.actor_registration_settled").emits("meta.sync_controller.synced_actors");
8934
8938
  this.registerActorTaskMapTask = CadenzaService.createMetaTask(
8935
8939
  "Split actor task maps",
8936
8940
  function* (ctx) {
8937
8941
  const task = ctx.task;
8938
- if (task.hidden || !task.register) {
8942
+ if (!this.tasksSynced || !this.actorsSynced) {
8943
+ return;
8944
+ }
8945
+ if (task.hidden || !task.register || !task.registered) {
8939
8946
  return;
8940
8947
  }
8941
8948
  const metadata = getActorTaskRuntimeMetadata(task.taskFunction);
@@ -9011,7 +9018,7 @@ var GraphSyncController = class _GraphSyncController {
9011
9018
  "Split observed signals of task",
9012
9019
  (ctx, emit) => {
9013
9020
  const task = ctx.task;
9014
- if (task.hidden || !task.register) return false;
9021
+ if (task.hidden || !task.register || !task.registered) return false;
9015
9022
  const serviceName2 = resolveSyncServiceName(task);
9016
9023
  if (!serviceName2) {
9017
9024
  return false;
@@ -9131,7 +9138,7 @@ var GraphSyncController = class _GraphSyncController {
9131
9138
  "Split intents of task",
9132
9139
  function(ctx, emit) {
9133
9140
  const task = ctx.task;
9134
- if (task.hidden || !task.register) return false;
9141
+ if (task.hidden || !task.register || !task.registered) return false;
9135
9142
  const serviceName2 = resolveSyncServiceName(task);
9136
9143
  if (!serviceName2) {
9137
9144
  return false;
@@ -9401,7 +9408,8 @@ var GraphSyncController = class _GraphSyncController {
9401
9408
  this.registerDeputyRelationshipTask
9402
9409
  );
9403
9410
  CadenzaService.registry.doForEachTask.clone().doOn(
9404
- "meta.sync_controller.synced_signals"
9411
+ "meta.sync_controller.synced_signals",
9412
+ "meta.sync_controller.synced_tasks"
9405
9413
  ).then(
9406
9414
  CadenzaService.createMetaTask(
9407
9415
  "Ensure signal and task sync ready",
@@ -9433,7 +9441,10 @@ var GraphSyncController = class _GraphSyncController {
9433
9441
  }
9434
9442
  ).then(this.registerSignalToTaskMapTask)
9435
9443
  );
9436
- CadenzaService.registry.doForEachTask.clone().doOn("meta.sync_controller.synced_intents").then(
9444
+ CadenzaService.registry.doForEachTask.clone().doOn(
9445
+ "meta.sync_controller.synced_intents",
9446
+ "meta.sync_controller.synced_tasks"
9447
+ ).then(
9437
9448
  CadenzaService.createMetaTask(
9438
9449
  "Ensure intent and task sync ready",
9439
9450
  (ctx) => {
@@ -9464,7 +9475,10 @@ var GraphSyncController = class _GraphSyncController {
9464
9475
  }
9465
9476
  ).then(this.registerIntentToTaskMapTask)
9466
9477
  );
9467
- CadenzaService.registry.doForEachTask.clone().doOn("meta.sync_controller.synced_actors").then(this.registerActorTaskMapTask);
9478
+ CadenzaService.registry.doForEachTask.clone().doOn(
9479
+ "meta.sync_controller.synced_actors",
9480
+ "meta.sync_controller.synced_tasks"
9481
+ ).then(this.registerActorTaskMapTask);
9468
9482
  CadenzaService.createMetaTask("Get registered task for actor sync", (ctx) => {
9469
9483
  const task = ctx.task ?? (ctx.__taskName ? CadenzaService.get(ctx.__taskName) : void 0);
9470
9484
  if (!task) {
@@ -9474,9 +9488,20 @@ var GraphSyncController = class _GraphSyncController {
9474
9488
  ...ctx,
9475
9489
  task
9476
9490
  };
9477
- }).doOn("meta.sync_controller.task_registered").then(this.registerActorTaskMapTask);
9491
+ }).doOn("meta.sync_controller.task_registered").then(
9492
+ CadenzaService.createMetaTask(
9493
+ "Ensure actor and task sync ready from task registration",
9494
+ (ctx) => {
9495
+ if (!this.tasksSynced || !this.actorsSynced) {
9496
+ return false;
9497
+ }
9498
+ return ctx;
9499
+ }
9500
+ ).then(this.registerActorTaskMapTask)
9501
+ );
9478
9502
  CadenzaService.registry.getAllRoutines.clone().doOn(
9479
9503
  "meta.sync_controller.synced_routines",
9504
+ "meta.sync_controller.synced_tasks",
9480
9505
  "meta.sync_controller.task_registered"
9481
9506
  ).then(
9482
9507
  CadenzaService.createMetaTask(