MCPcopy Create free account
hub / github.com/EvoMap/evolver / sendMessage

Method sendMessage

src/proxy/extensions/sessionHandler.js:57–75  ·  view source on GitHub ↗
({ sessionId, toNodeId, msgType, payload } = {})

Source from the content-addressed store, hash-verified

55 }
56
57 sendMessage({ sessionId, toNodeId, msgType, payload } = {}) {
58 if (!sessionId) throw new Error('sessionId is required');
59
60 const safePayload = payload && typeof payload === 'object' ? payload : {};
61 const serialized = JSON.stringify(safePayload);
62 if (serialized.length > 16000) throw new Error('payload too large (max 16KB)');
63
64 return this.store.send({
65 type: 'session_message',
66 payload: {
67 session_id: sessionId,
68 to_node_id: toNodeId || null,
69 msg_type: msgType || 'context_update',
70 payload: safePayload,
71 sent_at: new Date().toISOString(),
72 },
73 priority: 'normal',
74 });
75 }
76
77 delegateSubtask({ sessionId, toNodeId, title, description, role } = {}) {
78 if (!sessionId) throw new Error('sessionId is required');

Callers 2

extensions.test.jsFile · 0.80
buildRoutesFunction · 0.80

Calls 1

sendMethod · 0.45

Tested by

no test coverage detected