@mozaik-ai/core 4.0.0-beta.2 → 4.0.0-beta.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.d.mts CHANGED
@@ -419,6 +419,7 @@ declare function defineRuntime<TRuntimeState extends RuntimeState>(): {
419
419
  join: (participant: Participant) => void;
420
420
  leave: (participant: Participant) => void;
421
421
  sendMessage: (message: string, senderId: string) => void;
422
+ sendEvent: (event: SemanticEvent, senderId: string) => void;
422
423
  runLoop: (agentId: string, message: string, inferenceInput: InferenceInput) => void;
423
424
  };
424
425
 
package/dist/index.d.ts CHANGED
@@ -419,6 +419,7 @@ declare function defineRuntime<TRuntimeState extends RuntimeState>(): {
419
419
  join: (participant: Participant) => void;
420
420
  leave: (participant: Participant) => void;
421
421
  sendMessage: (message: string, senderId: string) => void;
422
+ sendEvent: (event: SemanticEvent, senderId: string) => void;
422
423
  runLoop: (agentId: string, message: string, inferenceInput: InferenceInput) => void;
423
424
  };
424
425
 
package/dist/index.js CHANGED
@@ -2013,6 +2013,18 @@ var DefaultFunctionCallRunner = class {
2013
2013
  }
2014
2014
  };
2015
2015
 
2016
+ // src/application/use-cases/send-event.ts
2017
+ function createSendEvent(resolveRuntime) {
2018
+ return function sendEvent(event, senderId) {
2019
+ const runtime = resolveRuntime();
2020
+ const participant = runtime.getParticipant(senderId);
2021
+ if (!participant) {
2022
+ throw new Error(`Participant ${senderId} not found`);
2023
+ }
2024
+ runtime.publish(event);
2025
+ };
2026
+ }
2027
+
2016
2028
  // src/define-runtime.ts
2017
2029
  function defineRuntime() {
2018
2030
  let runtime = null;
@@ -2049,6 +2061,7 @@ function defineRuntime() {
2049
2061
  const join = createJoin(resolveRuntime);
2050
2062
  const leave = createLeave(resolveRuntime);
2051
2063
  const sendMessage = createSendMessage(resolveRuntime);
2064
+ const sendEvent = createSendEvent(resolveRuntime);
2052
2065
  const runLoop = createRunLoop(resolveRuntime);
2053
2066
  return {
2054
2067
  initializeRuntime,
@@ -2057,6 +2070,7 @@ function defineRuntime() {
2057
2070
  join,
2058
2071
  leave,
2059
2072
  sendMessage,
2073
+ sendEvent,
2060
2074
  runLoop
2061
2075
  };
2062
2076
  }