MCPcopy Create free account
hub / github.com/anomalyco/opencode / encode

Function encode

packages/opencode/test/fixture/lsp/fake-lsp-server.js:22–26  ·  view source on GitHub ↗
(message)

Source from the content-addressed store, hash-verified

20}
21
22function encode(message) {
23 const json = JSON.stringify(message)
24 const header = `Content-Length: ${Buffer.byteLength(json, "utf8")}\r\n\r\n`
25 return Buffer.concat([Buffer.from(header, "utf8"), Buffer.from(json, "utf8")])
26}
27
28function decodeFrames(buffer) {
29 const results = []

Callers 2

sendFunction · 0.70

Calls 1

fromMethod · 0.45

Tested by

no test coverage detected