MCPcopy Create free account
hub / github.com/ChrisFeldmeier/OpenCodeRust / sendNotification

Function sendNotification

crates/opencode-plugin/host/plugin-host.ts:144–152  ·  view source on GitHub ↗
(method: string, params?: unknown)

Source from the content-addressed store, hash-verified

142}
143
144function sendNotification(method: string, params?: unknown): void {
145 const body = JSON.stringify({
146 jsonrpc: "2.0",
147 method,
148 params,
149 } satisfies JsonRpcNotification);
150 const header = `Content-Length: ${Buffer.byteLength(body)}\r\n\r\n`;
151 process.stdout.write(encoder.encode(header + body));
152}
153
154function sendResult(id: number, result: unknown): void {
155 send({ jsonrpc: "2.0", id, result });

Callers 1

handleAuthFetchStreamFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected