@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.
@@ -6058,6 +6058,7 @@ var GraphSyncController = class _GraphSyncController {
6058
6058
  this.registeredActorTaskMaps = /* @__PURE__ */ new Set();
6059
6059
  this.registeredIntentDefinitions = /* @__PURE__ */ new Set();
6060
6060
  this.tasksSynced = false;
6061
+ this.actorsSynced = false;
6061
6062
  this.signalsSynced = false;
6062
6063
  this.intentsSynced = false;
6063
6064
  this.routinesSynced = false;
@@ -6522,13 +6523,19 @@ var GraphSyncController = class _GraphSyncController {
6522
6523
  );
6523
6524
  CadenzaService.createUniqueMetaTask(
6524
6525
  "Gather actor registration",
6525
- () => true
6526
+ () => {
6527
+ this.actorsSynced = true;
6528
+ return true;
6529
+ }
6526
6530
  ).doOn("meta.sync_controller.actor_registration_settled").emits("meta.sync_controller.synced_actors");
6527
6531
  this.registerActorTaskMapTask = CadenzaService.createMetaTask(
6528
6532
  "Split actor task maps",
6529
6533
  function* (ctx) {
6530
6534
  const task = ctx.task;
6531
- if (task.hidden || !task.register) {
6535
+ if (!this.tasksSynced || !this.actorsSynced) {
6536
+ return;
6537
+ }
6538
+ if (task.hidden || !task.register || !task.registered) {
6532
6539
  return;
6533
6540
  }
6534
6541
  const metadata = getActorTaskRuntimeMetadata(task.taskFunction);
@@ -6604,7 +6611,7 @@ var GraphSyncController = class _GraphSyncController {
6604
6611
  "Split observed signals of task",
6605
6612
  (ctx, emit) => {
6606
6613
  const task = ctx.task;
6607
- if (task.hidden || !task.register) return false;
6614
+ if (task.hidden || !task.register || !task.registered) return false;
6608
6615
  const serviceName2 = resolveSyncServiceName(task);
6609
6616
  if (!serviceName2) {
6610
6617
  return false;
@@ -6724,7 +6731,7 @@ var GraphSyncController = class _GraphSyncController {
6724
6731
  "Split intents of task",
6725
6732
  function(ctx, emit) {
6726
6733
  const task = ctx.task;
6727
- if (task.hidden || !task.register) return false;
6734
+ if (task.hidden || !task.register || !task.registered) return false;
6728
6735
  const serviceName2 = resolveSyncServiceName(task);
6729
6736
  if (!serviceName2) {
6730
6737
  return false;
@@ -6994,7 +7001,8 @@ var GraphSyncController = class _GraphSyncController {
6994
7001
  this.registerDeputyRelationshipTask
6995
7002
  );
6996
7003
  CadenzaService.registry.doForEachTask.clone().doOn(
6997
- "meta.sync_controller.synced_signals"
7004
+ "meta.sync_controller.synced_signals",
7005
+ "meta.sync_controller.synced_tasks"
6998
7006
  ).then(
6999
7007
  CadenzaService.createMetaTask(
7000
7008
  "Ensure signal and task sync ready",
@@ -7026,7 +7034,10 @@ var GraphSyncController = class _GraphSyncController {
7026
7034
  }
7027
7035
  ).then(this.registerSignalToTaskMapTask)
7028
7036
  );
7029
- CadenzaService.registry.doForEachTask.clone().doOn("meta.sync_controller.synced_intents").then(
7037
+ CadenzaService.registry.doForEachTask.clone().doOn(
7038
+ "meta.sync_controller.synced_intents",
7039
+ "meta.sync_controller.synced_tasks"
7040
+ ).then(
7030
7041
  CadenzaService.createMetaTask(
7031
7042
  "Ensure intent and task sync ready",
7032
7043
  (ctx) => {
@@ -7057,7 +7068,10 @@ var GraphSyncController = class _GraphSyncController {
7057
7068
  }
7058
7069
  ).then(this.registerIntentToTaskMapTask)
7059
7070
  );
7060
- CadenzaService.registry.doForEachTask.clone().doOn("meta.sync_controller.synced_actors").then(this.registerActorTaskMapTask);
7071
+ CadenzaService.registry.doForEachTask.clone().doOn(
7072
+ "meta.sync_controller.synced_actors",
7073
+ "meta.sync_controller.synced_tasks"
7074
+ ).then(this.registerActorTaskMapTask);
7061
7075
  CadenzaService.createMetaTask("Get registered task for actor sync", (ctx) => {
7062
7076
  const task = ctx.task ?? (ctx.__taskName ? CadenzaService.get(ctx.__taskName) : void 0);
7063
7077
  if (!task) {
@@ -7067,9 +7081,20 @@ var GraphSyncController = class _GraphSyncController {
7067
7081
  ...ctx,
7068
7082
  task
7069
7083
  };
7070
- }).doOn("meta.sync_controller.task_registered").then(this.registerActorTaskMapTask);
7084
+ }).doOn("meta.sync_controller.task_registered").then(
7085
+ CadenzaService.createMetaTask(
7086
+ "Ensure actor and task sync ready from task registration",
7087
+ (ctx) => {
7088
+ if (!this.tasksSynced || !this.actorsSynced) {
7089
+ return false;
7090
+ }
7091
+ return ctx;
7092
+ }
7093
+ ).then(this.registerActorTaskMapTask)
7094
+ );
7071
7095
  CadenzaService.registry.getAllRoutines.clone().doOn(
7072
7096
  "meta.sync_controller.synced_routines",
7097
+ "meta.sync_controller.synced_tasks",
7073
7098
  "meta.sync_controller.task_registered"
7074
7099
  ).then(
7075
7100
  CadenzaService.createMetaTask(