MCPcopy Index your code
hub / github.com/tiann/hapi / sendSessionEvent

Method sendSessionEvent

cli/src/api/apiSession.ts:541–566  ·  view source on GitHub ↗
(event: {
        type: 'switch'
        mode: 'local' | 'remote'
    } | {
        type: 'message'
        message: string
    } | {
        type: 'permission-mode-changed'
        mode: SessionPermissionMode
    } | {
        type: 'ready'
    }, id?: string)

Source from the content-addressed store, hash-verified

539 }
540
541 sendSessionEvent(event: {
542 type: 'switch'
543 mode: 'local' | 'remote'
544 } | {
545 type: 'message'
546 message: string
547 } | {
548 type: 'permission-mode-changed'
549 mode: SessionPermissionMode
550 } | {
551 type: 'ready'
552 }, id?: string): void {
553 const content = {
554 role: 'agent',
555 content: {
556 id: id ?? randomUUID(),
557 type: 'event',
558 data: event
559 }
560 }
561
562 this.socket.emit('message', {
563 sid: this.sessionId,
564 message: content
565 })
566 }
567
568 keepAlive(
569 thinking: boolean,

Callers 15

runMainLoopMethod · 0.80
sendReadyMethod · 0.80
handleAbortMethod · 0.80
sendSessionEventFunction · 0.80
GeminiSessionClass · 0.80
geminiLocalLauncherFunction · 0.80
sendReadyMethod · 0.80
runMainLoopMethod · 0.80
runCursorFunction · 0.80
CursorSessionClass · 0.80
cursorLocalLauncherFunction · 0.80

Calls 1

emitMethod · 0.45

Tested by 3

sendSessionEventFunction · 0.64
sendSessionEventFunction · 0.64
sendSessionEventFunction · 0.64