MCPcopy Create free account
hub / github.com/Noumena-Network/code / writeSdkMessages

Function writeSdkMessages

src/bridge/replBridge.ts:1774–1795  ·  view source on GitHub ↗
(messages)

Source from the content-addressed store, hash-verified

1772 void transport.writeBatch(events)
1773 },
1774 writeSdkMessages(messages) {
1775 // Daemon path: query() already yields SDKMessage, skip conversion.
1776 // Still run echo dedup (server bounces writes back on the WS).
1777 // No initialMessageUUIDs filter — daemon has no initial messages.
1778 // No flushGate — daemon never starts it (no initial flush).
1779 const filtered = messages.filter(
1780 m => !m.uuid || !recentPostedUUIDs.has(m.uuid),
1781 )
1782 if (filtered.length === 0) return
1783 if (!transport) {
1784 logForDebugging(
1785 `[bridge:repl] Transport not configured, dropping ${filtered.length} SDK message(s) for session=${currentSessionId}`,
1786 { level: 'warn' },
1787 )
1788 return
1789 }
1790 for (const msg of filtered) {
1791 if (msg.uuid) recentPostedUUIDs.add(msg.uuid)
1792 }
1793 const events = filtered.map(m => ({ ...m, session_id: currentSessionId }))
1794 void transport.writeBatch(events)
1795 },
1796 sendControlRequest(request: SDKControlRequest) {
1797 if (!transport) {
1798 logForDebugging(

Callers

nothing calls this directly

Calls 4

writeBatchMethod · 0.80
logForDebuggingFunction · 0.50
hasMethod · 0.45
addMethod · 0.45

Tested by

no test coverage detected