@cadenza.io/service 2.17.8 → 2.17.9

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
@@ -433,16 +433,16 @@ function normalizeServiceTransportConfig(value) {
433
433
  }
434
434
  function normalizeServiceTransportDescriptor(value) {
435
435
  const raw = value ?? {};
436
- const uuid5 = normalizeString(raw.uuid);
436
+ const uuid6 = normalizeString(raw.uuid);
437
437
  const serviceInstanceId = normalizeString(
438
438
  raw.serviceInstanceId ?? raw.service_instance_id
439
439
  );
440
440
  const config = normalizeServiceTransportConfig(raw);
441
- if (!uuid5 || !serviceInstanceId || !config) {
441
+ if (!uuid6 || !serviceInstanceId || !config) {
442
442
  return null;
443
443
  }
444
444
  return {
445
- uuid: uuid5,
445
+ uuid: uuid6,
446
446
  serviceInstanceId,
447
447
  role: config.role,
448
448
  origin: config.origin,
@@ -504,14 +504,14 @@ function normalizeTransportArray(value, serviceInstanceId) {
504
504
  }
505
505
  function normalizeServiceInstanceDescriptor(value) {
506
506
  const raw = value ?? {};
507
- const uuid5 = normalizeString2(raw.uuid);
507
+ const uuid6 = normalizeString2(raw.uuid);
508
508
  const serviceName = normalizeString2(raw.serviceName ?? raw.service_name);
509
- if (!uuid5 || !serviceName) {
509
+ if (!uuid6 || !serviceName) {
510
510
  return null;
511
511
  }
512
- const transports = normalizeTransportArray(raw.transports, uuid5);
512
+ const transports = normalizeTransportArray(raw.transports, uuid6);
513
513
  return {
514
- uuid: uuid5,
514
+ uuid: uuid6,
515
515
  serviceName,
516
516
  numberOfRunningGraphs: Math.max(
517
517
  0,
@@ -954,15 +954,15 @@ var ServiceRegistry = class _ServiceRegistry {
954
954
  if (!serviceInstance) {
955
955
  return false;
956
956
  }
957
- const uuid5 = serviceInstance.uuid;
957
+ const uuid6 = serviceInstance.uuid;
958
958
  const serviceName = serviceInstance.serviceName;
959
959
  const deleted = Boolean(
960
960
  ctx.deleted ?? ctx.serviceInstance?.deleted ?? ctx.data?.deleted
961
961
  );
962
- if (uuid5 === this.serviceInstanceId) return;
962
+ if (uuid6 === this.serviceInstanceId) return;
963
963
  if (deleted) {
964
- const existingInstance = this.instances.get(serviceName)?.find((instance) => instance.uuid === uuid5);
965
- const indexToDelete = this.instances.get(serviceName)?.findIndex((i) => i.uuid === uuid5) ?? -1;
964
+ const existingInstance = this.instances.get(serviceName)?.find((instance) => instance.uuid === uuid6);
965
+ const indexToDelete = this.instances.get(serviceName)?.findIndex((i) => i.uuid === uuid6) ?? -1;
966
966
  if (indexToDelete >= 0 && existingInstance) {
967
967
  this.instances.get(serviceName)?.splice(indexToDelete, 1);
968
968
  for (const transport of existingInstance.transports) {
@@ -974,13 +974,13 @@ var ServiceRegistry = class _ServiceRegistry {
974
974
  if (this.instances.get(serviceName)?.length === 0) {
975
975
  this.instances.delete(serviceName);
976
976
  }
977
- this.unregisterDependee(uuid5, serviceName);
977
+ this.unregisterDependee(uuid6, serviceName);
978
978
  return;
979
979
  }
980
980
  if (!this.instances.has(serviceName))
981
981
  this.instances.set(serviceName, []);
982
982
  const instances = this.instances.get(serviceName);
983
- const existing = instances.find((i) => i.uuid === uuid5);
983
+ const existing = instances.find((i) => i.uuid === uuid6);
984
984
  if (existing) {
985
985
  Object.assign(existing, {
986
986
  ...serviceInstance,
@@ -990,7 +990,7 @@ var ServiceRegistry = class _ServiceRegistry {
990
990
  } else {
991
991
  instances.push(serviceInstance);
992
992
  }
993
- const trackedInstance = existing ?? instances.find((instance) => instance.uuid === uuid5);
993
+ const trackedInstance = existing ?? instances.find((instance) => instance.uuid === uuid6);
994
994
  if (trackedInstance) {
995
995
  const snapshot = this.resolveRuntimeStatusSnapshot(
996
996
  trackedInstance.numberOfRunningGraphs ?? 0,
@@ -1003,7 +1003,7 @@ var ServiceRegistry = class _ServiceRegistry {
1003
1003
  trackedInstance.reportedAt = trackedInstance.reportedAt ?? (/* @__PURE__ */ new Date()).toISOString();
1004
1004
  }
1005
1005
  if (!serviceInstance.isBootstrapPlaceholder) {
1006
- this.reconcileBootstrapPlaceholderInstance(serviceName, uuid5, emit);
1006
+ this.reconcileBootstrapPlaceholderInstance(serviceName, uuid6, emit);
1007
1007
  }
1008
1008
  if (this.serviceName === serviceName) {
1009
1009
  return false;
@@ -1029,7 +1029,7 @@ var ServiceRegistry = class _ServiceRegistry {
1029
1029
  if (!clientCreated) {
1030
1030
  emit("meta.service_registry.dependee_registered", {
1031
1031
  serviceName,
1032
- serviceInstanceId: uuid5,
1032
+ serviceInstanceId: uuid6,
1033
1033
  serviceTransportId: trackedTransport.uuid,
1034
1034
  serviceOrigin: trackedTransport.origin,
1035
1035
  transportProtocols: trackedTransport.protocols,
@@ -1043,7 +1043,7 @@ var ServiceRegistry = class _ServiceRegistry {
1043
1043
  } else {
1044
1044
  emit("meta.service_registry.routeable_transport_missing", {
1045
1045
  serviceName,
1046
- serviceInstanceId: uuid5,
1046
+ serviceInstanceId: uuid6,
1047
1047
  requiredRole: this.getRoutingTransportRole(),
1048
1048
  isFrontend: this.isFrontend
1049
1049
  });
@@ -3284,6 +3284,7 @@ var import_node_http = __toESM(require("http"));
3284
3284
  var import_node_fs = __toESM(require("fs"));
3285
3285
  var import_node_https = __toESM(require("https"));
3286
3286
  var import_node_fetch = __toESM(require("node-fetch"));
3287
+ var import_uuid3 = require("uuid");
3287
3288
  var RestController = class _RestController {
3288
3289
  /**
3289
3290
  * Constructor for initializing the REST server and related configurations.
@@ -3645,7 +3646,7 @@ var RestController = class _RestController {
3645
3646
  const internalOrigin = httpOrigin ?? httpsOrigin;
3646
3647
  if (internalOrigin) {
3647
3648
  transportData.unshift({
3648
- uuid: `${ctx.__serviceInstanceId}-internal-auto`,
3649
+ uuid: (0, import_uuid3.v4)(),
3649
3650
  service_instance_id: ctx.__serviceInstanceId,
3650
3651
  role: "internal",
3651
3652
  origin: internalOrigin,
@@ -8006,7 +8007,7 @@ function tableFieldTypeToSchemaType(type) {
8006
8007
  }
8007
8008
 
8008
8009
  // src/Cadenza.ts
8009
- var import_uuid3 = require("uuid");
8010
+ var import_uuid4 = require("uuid");
8010
8011
 
8011
8012
  // src/graph/controllers/GraphSyncController.ts
8012
8013
  var ACTOR_TASK_METADATA = /* @__PURE__ */ Symbol.for("@cadenza.io/core/actor-task-meta");
@@ -8068,10 +8069,29 @@ function buildActorRegistrationData(actor) {
8068
8069
  version: 1
8069
8070
  };
8070
8071
  }
8072
+ function resolveSyncServiceName(task) {
8073
+ const taskServiceName = typeof task?.serviceName === "string" ? task.serviceName.trim() : "";
8074
+ const registryServiceName = typeof CadenzaService.serviceRegistry.serviceName === "string" ? CadenzaService.serviceRegistry.serviceName.trim() : "";
8075
+ return taskServiceName || registryServiceName || void 0;
8076
+ }
8077
+ function buildIntentRegistryData(intent) {
8078
+ const name = String(intent?.name ?? "").trim();
8079
+ if (!name) {
8080
+ return null;
8081
+ }
8082
+ return {
8083
+ name,
8084
+ description: typeof intent?.description === "string" ? intent.description : "",
8085
+ input: intent?.input && typeof intent.input === "object" ? intent.input : { type: "object" },
8086
+ output: intent?.output && typeof intent.output === "object" ? intent.output : { type: "object" },
8087
+ isMeta: isMetaIntentName(name)
8088
+ };
8089
+ }
8071
8090
  var GraphSyncController = class _GraphSyncController {
8072
8091
  constructor() {
8073
8092
  this.registeredActors = /* @__PURE__ */ new Set();
8074
8093
  this.registeredActorTaskMaps = /* @__PURE__ */ new Set();
8094
+ this.registeredIntentDefinitions = /* @__PURE__ */ new Set();
8075
8095
  this.isCadenzaDBReady = false;
8076
8096
  }
8077
8097
  static get instance() {
@@ -8079,11 +8099,27 @@ var GraphSyncController = class _GraphSyncController {
8079
8099
  return this._instance;
8080
8100
  }
8081
8101
  init() {
8102
+ const insertIntentRegistryTask = this.isCadenzaDBReady ? CadenzaService.createCadenzaDBInsertTask(
8103
+ "intent_registry",
8104
+ {
8105
+ onConflict: {
8106
+ target: ["name"],
8107
+ action: {
8108
+ do: "nothing"
8109
+ }
8110
+ }
8111
+ },
8112
+ { concurrency: 30 }
8113
+ ) : CadenzaService.get("dbInsertIntentRegistry");
8082
8114
  this.splitRoutinesTask = CadenzaService.createMetaTask(
8083
8115
  "Split routines for registration",
8084
8116
  async function* (ctx, emit) {
8085
8117
  const { routines } = ctx;
8086
8118
  if (!routines) return;
8119
+ const serviceName = resolveSyncServiceName();
8120
+ if (!serviceName) {
8121
+ return;
8122
+ }
8087
8123
  CadenzaService.debounce("meta.sync_controller.synced_resource", {
8088
8124
  delayMs: 2e3
8089
8125
  });
@@ -8094,7 +8130,7 @@ var GraphSyncController = class _GraphSyncController {
8094
8130
  name: routine.name,
8095
8131
  version: routine.version,
8096
8132
  description: routine.description,
8097
- serviceName: CadenzaService.serviceRegistry.serviceName,
8133
+ serviceName,
8098
8134
  isMeta: routine.isMeta
8099
8135
  },
8100
8136
  __routineName: routine.name
@@ -8136,6 +8172,10 @@ var GraphSyncController = class _GraphSyncController {
8136
8172
  function* (ctx) {
8137
8173
  const { routines } = ctx;
8138
8174
  if (!routines) return;
8175
+ const serviceName = resolveSyncServiceName();
8176
+ if (!serviceName) {
8177
+ return;
8178
+ }
8139
8179
  CadenzaService.debounce("meta.sync_controller.synced_resource", {
8140
8180
  delayMs: 3e3
8141
8181
  });
@@ -8155,7 +8195,7 @@ var GraphSyncController = class _GraphSyncController {
8155
8195
  taskVersion: nextTask.version,
8156
8196
  routineName: routine.name,
8157
8197
  routineVersion: routine.version,
8158
- serviceName: CadenzaService.serviceRegistry.serviceName
8198
+ serviceName
8159
8199
  },
8160
8200
  __routineName: routine.name,
8161
8201
  __taskName: nextTask.name
@@ -8258,6 +8298,10 @@ var GraphSyncController = class _GraphSyncController {
8258
8298
  delayMs: 3e3
8259
8299
  });
8260
8300
  const tasks = ctx.tasks;
8301
+ const serviceName = resolveSyncServiceName();
8302
+ if (!serviceName) {
8303
+ return;
8304
+ }
8261
8305
  for (const task of tasks) {
8262
8306
  if (task.registered) continue;
8263
8307
  const { __functionString, __getTagCallback } = task.export();
@@ -8287,7 +8331,7 @@ var GraphSyncController = class _GraphSyncController {
8287
8331
  retryDelay: task.retryDelay,
8288
8332
  retryDelayMax: task.retryDelayMax,
8289
8333
  retryDelayFactor: task.retryDelayFactor,
8290
- service_name: CadenzaService.serviceRegistry.serviceName,
8334
+ service_name: serviceName,
8291
8335
  signals: {
8292
8336
  emits: Array.from(task.emitsSignals),
8293
8337
  signalsToEmitAfter: Array.from(task.signalsToEmitAfter),
@@ -8335,11 +8379,15 @@ var GraphSyncController = class _GraphSyncController {
8335
8379
  CadenzaService.debounce("meta.sync_controller.synced_resource", {
8336
8380
  delayMs: 3e3
8337
8381
  });
8382
+ const serviceName = resolveSyncServiceName();
8383
+ if (!serviceName) {
8384
+ return;
8385
+ }
8338
8386
  const actors = ctx.actors ?? [];
8339
8387
  for (const actor of actors) {
8340
8388
  const data = {
8341
8389
  ...buildActorRegistrationData(actor),
8342
- service_name: CadenzaService.serviceRegistry.serviceName
8390
+ service_name: serviceName
8343
8391
  };
8344
8392
  if (!data.name) {
8345
8393
  continue;
@@ -8395,7 +8443,11 @@ var GraphSyncController = class _GraphSyncController {
8395
8443
  if (!metadata?.actorName) {
8396
8444
  return;
8397
8445
  }
8398
- const registrationKey = `${metadata.actorName}|${task.name}|${task.version}|${CadenzaService.serviceRegistry.serviceName}`;
8446
+ const serviceName = resolveSyncServiceName(task);
8447
+ if (!serviceName) {
8448
+ return;
8449
+ }
8450
+ const registrationKey = `${metadata.actorName}|${task.name}|${task.version}|${serviceName}`;
8399
8451
  if (this.registeredActorTaskMaps.has(registrationKey)) {
8400
8452
  return;
8401
8453
  }
@@ -8405,7 +8457,7 @@ var GraphSyncController = class _GraphSyncController {
8405
8457
  actor_version: 1,
8406
8458
  task_name: task.name,
8407
8459
  task_version: task.version,
8408
- service_name: CadenzaService.serviceRegistry.serviceName,
8460
+ service_name: serviceName,
8409
8461
  mode: metadata.mode,
8410
8462
  description: task.description ?? metadata.actorDescription ?? "",
8411
8463
  is_meta: metadata.actorKind === "meta" || task.isMeta === true
@@ -8460,6 +8512,10 @@ var GraphSyncController = class _GraphSyncController {
8460
8512
  function* (ctx) {
8461
8513
  const task = ctx.task;
8462
8514
  if (task.hidden || !task.register) return;
8515
+ const serviceName = resolveSyncServiceName(task);
8516
+ if (!serviceName) {
8517
+ return;
8518
+ }
8463
8519
  for (const signal of task.observedSignals) {
8464
8520
  const _signal = signal.split(":")[0];
8465
8521
  if (task.registeredSignals.has(signal)) continue;
@@ -8470,7 +8526,7 @@ var GraphSyncController = class _GraphSyncController {
8470
8526
  isGlobal,
8471
8527
  taskName: task.name,
8472
8528
  taskVersion: task.version,
8473
- serviceName: CadenzaService.serviceRegistry.serviceName
8529
+ serviceName
8474
8530
  },
8475
8531
  __taskName: task.name,
8476
8532
  __signal: signal
@@ -8496,6 +8552,46 @@ var GraphSyncController = class _GraphSyncController {
8496
8552
  { concurrency: 30 }
8497
8553
  ) : CadenzaService.get("dbInsertSignalToTaskMap"))?.then(registerSignalTask)
8498
8554
  );
8555
+ this.splitIntentsTask = CadenzaService.createMetaTask(
8556
+ "Split intents for registration",
8557
+ function* (ctx) {
8558
+ CadenzaService.debounce("meta.sync_controller.synced_resource", {
8559
+ delayMs: 3e3
8560
+ });
8561
+ const intents = Array.isArray(ctx.intents) ? ctx.intents : Array.from(CadenzaService.inquiryBroker.intents.values());
8562
+ for (const intent of intents) {
8563
+ const intentData = buildIntentRegistryData(intent);
8564
+ if (!intentData) {
8565
+ continue;
8566
+ }
8567
+ if (this.registeredIntentDefinitions.has(intentData.name)) {
8568
+ continue;
8569
+ }
8570
+ yield {
8571
+ data: intentData,
8572
+ __intentName: intentData.name
8573
+ };
8574
+ }
8575
+ }.bind(this)
8576
+ ).then(
8577
+ insertIntentRegistryTask?.then(
8578
+ CadenzaService.createMetaTask("Record intent definition registration", (ctx) => {
8579
+ if (!ctx.__syncing) {
8580
+ return;
8581
+ }
8582
+ CadenzaService.debounce("meta.sync_controller.synced_resource", {
8583
+ delayMs: 3e3
8584
+ });
8585
+ this.registeredIntentDefinitions.add(ctx.__intentName);
8586
+ return true;
8587
+ }).then(
8588
+ CadenzaService.createUniqueMetaTask(
8589
+ "Gather intent registration",
8590
+ () => true
8591
+ ).emits("meta.sync_controller.synced_intents")
8592
+ )
8593
+ )
8594
+ );
8499
8595
  const registerIntentTask = CadenzaService.createMetaTask(
8500
8596
  "Record intent registration",
8501
8597
  (ctx) => {
@@ -8515,6 +8611,10 @@ var GraphSyncController = class _GraphSyncController {
8515
8611
  function* (ctx) {
8516
8612
  const task = ctx.task;
8517
8613
  if (task.hidden || !task.register) return;
8614
+ const serviceName = resolveSyncServiceName(task);
8615
+ if (!serviceName) {
8616
+ return;
8617
+ }
8518
8618
  task.__registeredIntents = task.__registeredIntents ?? /* @__PURE__ */ new Set();
8519
8619
  task.__invalidMetaIntentWarnings = task.__invalidMetaIntentWarnings ?? /* @__PURE__ */ new Set();
8520
8620
  for (const intent of task.handlesIntents) {
@@ -8534,36 +8634,75 @@ var GraphSyncController = class _GraphSyncController {
8534
8634
  }
8535
8635
  continue;
8536
8636
  }
8637
+ const intentDefinition = buildIntentRegistryData(CadenzaService.inquiryBroker.intents.get(intent)) ?? buildIntentRegistryData({ name: intent });
8638
+ if (!intentDefinition) {
8639
+ continue;
8640
+ }
8537
8641
  yield {
8538
8642
  data: {
8539
8643
  intentName: intent,
8540
8644
  taskName: task.name,
8541
8645
  taskVersion: task.version,
8542
- serviceName: CadenzaService.serviceRegistry.serviceName
8646
+ serviceName
8543
8647
  },
8544
8648
  __taskName: task.name,
8545
- __intent: intent
8649
+ __intent: intent,
8650
+ __intentDefinition: intentDefinition,
8651
+ __intentMapData: {
8652
+ intentName: intent,
8653
+ taskName: task.name,
8654
+ taskVersion: task.version,
8655
+ serviceName
8656
+ }
8546
8657
  };
8547
8658
  }
8548
8659
  }
8549
8660
  ).then(
8550
- (this.isCadenzaDBReady ? CadenzaService.createCadenzaDBInsertTask(
8551
- "intent_to_task_map",
8552
- {
8553
- onConflict: {
8554
- target: [
8555
- "intent_name",
8556
- "task_name",
8557
- "task_version",
8558
- "service_name"
8559
- ],
8560
- action: {
8561
- do: "nothing"
8562
- }
8661
+ CadenzaService.createMetaTask(
8662
+ "Prepare intent definition for intent-to-task map",
8663
+ (ctx) => {
8664
+ if (!ctx.__intentDefinition || !ctx.__intentMapData) {
8665
+ return false;
8563
8666
  }
8564
- },
8565
- { concurrency: 30 }
8566
- ) : CadenzaService.get("dbInsertIntentToTaskMap"))?.then(registerIntentTask)
8667
+ return {
8668
+ ...ctx,
8669
+ data: ctx.__intentDefinition
8670
+ };
8671
+ }
8672
+ ).then(
8673
+ insertIntentRegistryTask?.then(
8674
+ CadenzaService.createMetaTask(
8675
+ "Restore intent-to-task map payload",
8676
+ (ctx) => {
8677
+ if (!ctx.__intentMapData) {
8678
+ return false;
8679
+ }
8680
+ return {
8681
+ ...ctx,
8682
+ data: ctx.__intentMapData
8683
+ };
8684
+ }
8685
+ ).then(
8686
+ (this.isCadenzaDBReady ? CadenzaService.createCadenzaDBInsertTask(
8687
+ "intent_to_task_map",
8688
+ {
8689
+ onConflict: {
8690
+ target: [
8691
+ "intent_name",
8692
+ "task_name",
8693
+ "task_version",
8694
+ "service_name"
8695
+ ],
8696
+ action: {
8697
+ do: "nothing"
8698
+ }
8699
+ }
8700
+ },
8701
+ { concurrency: 30 }
8702
+ ) : CadenzaService.get("dbInsertIntentToTaskMap"))?.then(registerIntentTask)
8703
+ )
8704
+ )
8705
+ )
8567
8706
  );
8568
8707
  this.registerTaskMapTask = CadenzaService.createMetaTask(
8569
8708
  "Register task map to DB",
@@ -8573,18 +8712,26 @@ var GraphSyncController = class _GraphSyncController {
8573
8712
  delayMs: 3e3
8574
8713
  });
8575
8714
  if (task.hidden || !task.register) return;
8715
+ const predecessorServiceName = resolveSyncServiceName(task);
8716
+ if (!predecessorServiceName) {
8717
+ return;
8718
+ }
8576
8719
  for (const t of task.nextTasks) {
8577
8720
  if (task.taskMapRegistration.has(t.name) || t.hidden || !t.register) {
8578
8721
  continue;
8579
8722
  }
8723
+ const serviceName = resolveSyncServiceName(t);
8724
+ if (!serviceName) {
8725
+ continue;
8726
+ }
8580
8727
  yield {
8581
8728
  data: {
8582
8729
  taskName: t.name,
8583
8730
  taskVersion: t.version,
8584
8731
  predecessorTaskName: task.name,
8585
8732
  predecessorTaskVersion: task.version,
8586
- serviceName: CadenzaService.serviceRegistry.serviceName,
8587
- predecessorServiceName: CadenzaService.serviceRegistry.serviceName
8733
+ serviceName,
8734
+ predecessorServiceName
8588
8735
  },
8589
8736
  __taskName: task.name,
8590
8737
  __nextTaskName: t.name
@@ -8631,14 +8778,19 @@ var GraphSyncController = class _GraphSyncController {
8631
8778
  if (task.hidden || !task.register) return;
8632
8779
  if (task.isDeputy && !task.signalName) {
8633
8780
  if (task.registeredDeputyMap) return;
8781
+ const serviceName = resolveSyncServiceName(task);
8782
+ const predecessorServiceName = resolveSyncServiceName();
8783
+ if (!serviceName || !predecessorServiceName) {
8784
+ return;
8785
+ }
8634
8786
  return {
8635
8787
  data: {
8636
8788
  task_name: task.remoteRoutineName,
8637
8789
  task_version: 1,
8638
- service_name: task.serviceName,
8790
+ service_name: serviceName,
8639
8791
  predecessor_task_name: task.name,
8640
8792
  predecessor_task_version: task.version,
8641
- predecessor_service_name: CadenzaService.serviceRegistry.serviceName
8793
+ predecessor_service_name: predecessorServiceName
8642
8794
  },
8643
8795
  __taskName: task.name
8644
8796
  };
@@ -8683,6 +8835,12 @@ var GraphSyncController = class _GraphSyncController {
8683
8835
  "meta.service_registry.initial_sync_complete"
8684
8836
  ).then(this.splitSignalsTask);
8685
8837
  CadenzaService.registry.getAllTasks.clone().doOn("meta.sync_controller.synced_signals").then(this.splitTasksForRegistration);
8838
+ CadenzaService.createMetaTask("Get all intents", (ctx) => {
8839
+ return {
8840
+ ...ctx,
8841
+ intents: Array.from(CadenzaService.inquiryBroker.intents.values())
8842
+ };
8843
+ }).doOn("meta.sync_controller.synced_tasks").then(this.splitIntentsTask);
8686
8844
  CadenzaService.registry.getAllRoutines.clone().doOn("meta.sync_controller.synced_tasks").then(this.splitRoutinesTask);
8687
8845
  CadenzaService.createMetaTask("Get all actors", (ctx) => {
8688
8846
  return {
@@ -8693,9 +8851,9 @@ var GraphSyncController = class _GraphSyncController {
8693
8851
  CadenzaService.registry.doForEachTask.clone().doOn("meta.sync_controller.synced_tasks").then(
8694
8852
  this.registerTaskMapTask,
8695
8853
  this.registerSignalToTaskMapTask,
8696
- this.registerIntentToTaskMapTask,
8697
8854
  this.registerDeputyRelationshipTask
8698
8855
  );
8856
+ CadenzaService.registry.doForEachTask.clone().doOn("meta.sync_controller.synced_tasks", "meta.sync_controller.synced_intents").then(this.registerIntentToTaskMapTask);
8699
8857
  CadenzaService.registry.doForEachTask.clone().doOn("meta.sync_controller.synced_tasks", "meta.sync_controller.synced_actors").then(this.registerActorTaskMapTask);
8700
8858
  CadenzaService.registry.getAllRoutines.clone().doOn("meta.sync_controller.synced_routines").then(this.splitTasksInRoutines);
8701
8859
  CadenzaService.createMetaTask("Finish sync", (ctx, emit) => {
@@ -8955,9 +9113,9 @@ var CadenzaService = class {
8955
9113
  static normalizeDeclaredTransports(transports, serviceId) {
8956
9114
  return (transports ?? []).map((transport) => normalizeServiceTransportConfig(transport)).filter(
8957
9115
  (transport) => !!transport
8958
- ).map((transport, index) => ({
9116
+ ).map((transport) => ({
8959
9117
  ...transport,
8960
- uuid: `${serviceId}-transport-${index + 1}`
9118
+ uuid: (0, import_uuid4.v4)()
8961
9119
  }));
8962
9120
  }
8963
9121
  static createBootstrapTransport(serviceInstanceId, role, endpoint) {
@@ -9201,7 +9359,7 @@ var CadenzaService = class {
9201
9359
  }
9202
9360
  for (const responder of responders) {
9203
9361
  const { task, descriptor } = responder;
9204
- const inquiryId = (0, import_uuid3.v4)();
9362
+ const inquiryId = (0, import_uuid4.v4)();
9205
9363
  startTimeByTask.set(task, Date.now());
9206
9364
  const resolverTask = this.createEphemeralMetaTask(
9207
9365
  `Resolve inquiry ${inquiry} for ${descriptor.localTaskName}`,
@@ -9690,7 +9848,7 @@ var CadenzaService = class {
9690
9848
  this.bootstrap();
9691
9849
  this.validateName(serviceName);
9692
9850
  this.validateServiceName(serviceName);
9693
- const serviceId = options.customServiceId ?? (0, import_uuid3.v4)();
9851
+ const serviceId = options.customServiceId ?? (0, import_uuid4.v4)();
9694
9852
  this.serviceRegistry.serviceName = serviceName;
9695
9853
  this.serviceRegistry.serviceInstanceId = serviceId;
9696
9854
  this.setHydrationResults(options.hydration);
@@ -10515,7 +10673,7 @@ CadenzaService.frontendSyncScheduled = false;
10515
10673
  var import_core5 = require("@cadenza.io/core");
10516
10674
 
10517
10675
  // src/ssr/createSSRInquiryBridge.ts
10518
- var import_uuid4 = require("uuid");
10676
+ var import_uuid5 = require("uuid");
10519
10677
  function ensureFetch() {
10520
10678
  if (typeof globalThis.fetch !== "function") {
10521
10679
  throw new Error("SSR inquiry bridge requires global fetch support.");
@@ -10591,7 +10749,7 @@ function createSSRInquiryBridge(options = {}) {
10591
10749
  __remoteRoutineName: remoteRoutineName,
10592
10750
  __metadata: {
10593
10751
  ...context.__metadata ?? {},
10594
- __deputyExecId: (0, import_uuid4.v4)()
10752
+ __deputyExecId: (0, import_uuid5.v4)()
10595
10753
  }
10596
10754
  }),
10597
10755
  signal