MCPcopy
hub / github.com/slopus/happy / sendSessionEvent

Method sendSessionEvent

packages/happy-cli/src/api/apiSession.ts:832–850  ·  view source on GitHub ↗
(event: {
        type: 'switch', mode: 'local' | 'remote'
    } | {
        type: 'message', message: string
    } | {
        type: 'permission-mode-changed', mode: 'default' | 'acceptEdits' | 'bypassPermissions' | 'plan'
    } | {
        type: 'ready'
    }, id?: string)

Source from the content-addressed store, hash-verified

830 }
831
832 sendSessionEvent(event: {
833 type: 'switch', mode: 'local' | 'remote'
834 } | {
835 type: 'message', message: string
836 } | {
837 type: 'permission-mode-changed', mode: 'default' | 'acceptEdits' | 'bypassPermissions' | 'plan'
838 } | {
839 type: 'ready'
840 }, id?: string) {
841 let content = {
842 role: 'agent',
843 content: {
844 id: id ?? randomUUID(),
845 type: 'event',
846 data: event
847 }
848 };
849 this.enqueueMessage(content);
850 }
851
852 /**
853 * Send a ping message to keep the connection alive

Callers 12

sendReadyFunction · 0.80
runGeminiFunction · 0.80
apiSession.test.tsFile · 0.80
runOpenClawFunction · 0.80
sendReadyFunction · 0.80
handleAbortFunction · 0.80
runCodexFunction · 0.80
resumeExistingThreadFunction · 0.80
runAcpFunction · 0.80
claudeRemoteLauncherFunction · 0.80
claudeLocalLauncherFunction · 0.80
runClaudeFunction · 0.80

Calls 1

enqueueMessageMethod · 0.95

Tested by

no test coverage detected