@mozaik-ai/core 4.0.1 → 4.0.3

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
@@ -886,10 +886,10 @@ var EventPublisherLoopVisitor = class {
886
886
  this.cloud = (0, import_cloud_sdk.createCloudClient)();
887
887
  }
888
888
  visitContextUpdateStarted(input) {
889
- this.publish("context_update.started", { ...input, loopId: this.loopId });
889
+ this.publish("context_update.started", input);
890
890
  }
891
891
  visitContextUpdateCompleted(output) {
892
- this.publish("context_update.completed", { ...output, loopId: this.loopId });
892
+ this.publish("context_update.completed", output);
893
893
  }
894
894
  visitInferenceStarted(input) {
895
895
  this.publish("inference.started", input);
@@ -916,10 +916,29 @@ var EventPublisherLoopVisitor = class {
916
916
  this.publish("interception.finished", transition);
917
917
  }
918
918
  publish(type, payload) {
919
- const event = new SemanticEvent(type, this.agentId, /* @__PURE__ */ new Date(), payload);
919
+ const event = new SemanticEvent(type, this.agentId, /* @__PURE__ */ new Date(), {
920
+ ...payload,
921
+ loopId: this.loopId
922
+ });
920
923
  this.runtime.publish(event);
921
924
  if (this.cloud.enabled) {
922
- this.cloud.send(event);
925
+ const participant = this.runtime.getParticipant(this.agentId);
926
+ const agent = participant;
927
+ if (agent) {
928
+ this.cloud.send({
929
+ ...event,
930
+ payload: {
931
+ ...payload,
932
+ loopId: this.loopId,
933
+ agent: {
934
+ manifest: agent.getManifest(),
935
+ developerMessage: agent.getDeveloperMessage(),
936
+ tools: agent.getTools(),
937
+ memory: agent.getMemory().getContext().getItems()
938
+ }
939
+ }
940
+ });
941
+ }
923
942
  }
924
943
  }
925
944
  };