Group of 2 Use it now Notable
Plugins can now hook into and trigger sending a message into a session via the new session.send event and $.session.send API
What
- A new hookable event
session.sendwas added to the plugin event system, alongside the existingsession.receive,session.detach, andsession.end. It has its own schema (checkArgument,restoreArgument,check), is included in the events that can trigger the "hook ... is holding" warning if answered late, and runs through the same delivery pipeline as tool calls, trackingisDelivered/reasonwith a "the message was not delivered" failure message. - The plugin/SDK host API now exposes a
$.session.sendoperation that lets a plugin send text to a named target: a session ID, an agent ID, or an address object ({sessionId}or{agentId}). It requires non-emptytoandtextvalues.
Why This lets plugins and SDK integrations both react to and initiate messages being sent into a session, rather than only observing incoming ones.
Names in the bundlesession.send
Documented inclaude-code/agent-sdk/typescript-v2-preview