MCPcopy Index your code
hub / github.com/slopus/happy / sendAgentMessage

Method sendAgentMessage

packages/happy-cli/src/api/apiSession.ts:814–830  ·  view source on GitHub ↗

* Send a generic agent message to the session using ACP (Agent Communication Protocol) format. * Works for any agent type (Gemini, Codex, Claude, etc.) - CLI normalizes to unified ACP format. * * @param provider - The agent provider sending the message (e.g., 'gemini', 'codex', 'clau

(provider: 'gemini' | 'codex' | 'claude' | 'opencode' | 'openclaw', body: ACPMessageData)

Source from the content-addressed store, hash-verified

812 * @param body - The message payload (type: 'message' | 'reasoning' | 'tool-call' | 'tool-result')
813 */
814 sendAgentMessage(provider: 'gemini' | 'codex' | 'claude' | 'opencode' | 'openclaw', body: ACPMessageData) {
815 let content = {
816 role: 'agent',
817 content: {
818 type: 'acp',
819 provider,
820 data: body
821 },
822 meta: {
823 sentFrom: 'cli'
824 }
825 };
826
827 logger.debug(`[SOCKET] Sending ACP message from ${provider}:`, { type: body.type, hasMessage: 'message' in body });
828
829 this.enqueueMessage(content);
830 }
831
832 sendSessionEvent(event: {
833 type: 'switch', mode: 'local' | 'remote'

Callers 4

handleAbortFunction · 0.80
runGeminiFunction · 0.80
apiSession.test.tsFile · 0.80

Calls 2

enqueueMessageMethod · 0.95
debugMethod · 0.80

Tested by

no test coverage detected