@cadenza.io/service 2.17.26 → 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.
@@ -6007,6 +6007,7 @@ var GraphSyncController = class _GraphSyncController {
6007
6007
  this.registeredActorTaskMaps = /* @__PURE__ */ new Set();
6008
6008
  this.registeredIntentDefinitions = /* @__PURE__ */ new Set();
6009
6009
  this.tasksSynced = false;
6010
+ this.actorsSynced = false;
6010
6011
  this.signalsSynced = false;
6011
6012
  this.intentsSynced = false;
6012
6013
  this.routinesSynced = false;
@@ -6471,13 +6472,19 @@ var GraphSyncController = class _GraphSyncController {
6471
6472
  );
6472
6473
  CadenzaService.createUniqueMetaTask(
6473
6474
  "Gather actor registration",
6474
- () => true
6475
+ () => {
6476
+ this.actorsSynced = true;
6477
+ return true;
6478
+ }
6475
6479
  ).doOn("meta.sync_controller.actor_registration_settled").emits("meta.sync_controller.synced_actors");
6476
6480
  this.registerActorTaskMapTask = CadenzaService.createMetaTask(
6477
6481
  "Split actor task maps",
6478
6482
  function* (ctx) {
6479
6483
  const task = ctx.task;
6480
- if (task.hidden || !task.register) {
6484
+ if (!this.tasksSynced || !this.actorsSynced) {
6485
+ return;
6486
+ }
6487
+ if (task.hidden || !task.register || !task.registered) {
6481
6488
  return;
6482
6489
  }
6483
6490
  const metadata = getActorTaskRuntimeMetadata(task.taskFunction);
@@ -6553,7 +6560,7 @@ var GraphSyncController = class _GraphSyncController {
6553
6560
  "Split observed signals of task",
6554
6561
  (ctx, emit) => {
6555
6562
  const task = ctx.task;
6556
- if (task.hidden || !task.register) return false;
6563
+ if (task.hidden || !task.register || !task.registered) return false;
6557
6564
  const serviceName2 = resolveSyncServiceName(task);
6558
6565
  if (!serviceName2) {
6559
6566
  return false;
@@ -6673,7 +6680,7 @@ var GraphSyncController = class _GraphSyncController {
6673
6680
  "Split intents of task",
6674
6681
  function(ctx, emit) {
6675
6682
  const task = ctx.task;
6676
- if (task.hidden || !task.register) return false;
6683
+ if (task.hidden || !task.register || !task.registered) return false;
6677
6684
  const serviceName2 = resolveSyncServiceName(task);
6678
6685
  if (!serviceName2) {
6679
6686
  return false;
@@ -6943,7 +6950,8 @@ var GraphSyncController = class _GraphSyncController {
6943
6950
  this.registerDeputyRelationshipTask
6944
6951
  );
6945
6952
  CadenzaService.registry.doForEachTask.clone().doOn(
6946
- "meta.sync_controller.synced_signals"
6953
+ "meta.sync_controller.synced_signals",
6954
+ "meta.sync_controller.synced_tasks"
6947
6955
  ).then(
6948
6956
  CadenzaService.createMetaTask(
6949
6957
  "Ensure signal and task sync ready",
@@ -6975,7 +6983,10 @@ var GraphSyncController = class _GraphSyncController {
6975
6983
  }
6976
6984
  ).then(this.registerSignalToTaskMapTask)
6977
6985
  );
6978
- CadenzaService.registry.doForEachTask.clone().doOn("meta.sync_controller.synced_intents").then(
6986
+ CadenzaService.registry.doForEachTask.clone().doOn(
6987
+ "meta.sync_controller.synced_intents",
6988
+ "meta.sync_controller.synced_tasks"
6989
+ ).then(
6979
6990
  CadenzaService.createMetaTask(
6980
6991
  "Ensure intent and task sync ready",
6981
6992
  (ctx) => {
@@ -7006,7 +7017,10 @@ var GraphSyncController = class _GraphSyncController {
7006
7017
  }
7007
7018
  ).then(this.registerIntentToTaskMapTask)
7008
7019
  );
7009
- CadenzaService.registry.doForEachTask.clone().doOn("meta.sync_controller.synced_actors").then(this.registerActorTaskMapTask);
7020
+ CadenzaService.registry.doForEachTask.clone().doOn(
7021
+ "meta.sync_controller.synced_actors",
7022
+ "meta.sync_controller.synced_tasks"
7023
+ ).then(this.registerActorTaskMapTask);
7010
7024
  CadenzaService.createMetaTask("Get registered task for actor sync", (ctx) => {
7011
7025
  const task = ctx.task ?? (ctx.__taskName ? CadenzaService.get(ctx.__taskName) : void 0);
7012
7026
  if (!task) {
@@ -7016,9 +7030,20 @@ var GraphSyncController = class _GraphSyncController {
7016
7030
  ...ctx,
7017
7031
  task
7018
7032
  };
7019
- }).doOn("meta.sync_controller.task_registered").then(this.registerActorTaskMapTask);
7033
+ }).doOn("meta.sync_controller.task_registered").then(
7034
+ CadenzaService.createMetaTask(
7035
+ "Ensure actor and task sync ready from task registration",
7036
+ (ctx) => {
7037
+ if (!this.tasksSynced || !this.actorsSynced) {
7038
+ return false;
7039
+ }
7040
+ return ctx;
7041
+ }
7042
+ ).then(this.registerActorTaskMapTask)
7043
+ );
7020
7044
  CadenzaService.registry.getAllRoutines.clone().doOn(
7021
7045
  "meta.sync_controller.synced_routines",
7046
+ "meta.sync_controller.synced_tasks",
7022
7047
  "meta.sync_controller.task_registered"
7023
7048
  ).then(
7024
7049
  CadenzaService.createMetaTask(