Sends a notification message as output from the swarm session without executing an incoming message.
This function directly sends a provided string as output from the swarm session, bypassing message execution. It is designed exclusively
for sessions established via the "makeConnection" mode. The function validates the session, swarm, and specified agent, ensuring the agent
is still active before sending the notification. If the active agent has changed, the operation is skipped. The execution is wrapped in
beginContext for a clean environment, logs the operation if enabled, and throws an error if the session mode is not "makeConnection".
Parameters
content: string
The content to be processed or stored.
clientId: string
The unique identifier of the client session.
agentName: string
The name of the agent to use or reference.
Returns Promise<void>
Throws
If the session mode is not "makeConnection", or if agent, session, or swarm validation fails.
Example
awaitnotify("Direct output", "client-123", "AgentX"); // Sends "Direct output" if AgentX is active
Sends a notification message as output from the swarm session without executing an incoming message.
This function directly sends a provided string as output from the swarm session, bypassing message execution. It is designed exclusively for sessions established via the "makeConnection" mode. The function validates the session, swarm, and specified agent, ensuring the agent is still active before sending the notification. If the active agent has changed, the operation is skipped. The execution is wrapped in
beginContext
for a clean environment, logs the operation if enabled, and throws an error if the session mode is not "makeConnection".