MCPcopy Create free account
hub / github.com/bearlyai/OpenADE / handleWrite

Function handleWrite

projects/electron/src/modules/code/pty.ts:251–265  ·  view source on GitHub ↗
(params: WriteParams)

Source from the content-addressed store, hash-verified

249}
250
251async function handleWrite(params: WriteParams): Promise<{ ok: boolean }> {
252 const p = activePtys.get(params.ptyId)
253 if (!p || p.exited) {
254 return { ok: false }
255 }
256
257 try {
258 const data = Buffer.from(params.data, "base64").toString("utf8")
259 p.pty.write(data)
260 return { ok: true }
261 } catch (error) {
262 logger.error("[Pty:write] Error:", error)
263 return { ok: false }
264 }
265}
266
267async function handleResize(params: ResizeParams): Promise<{ ok: boolean }> {
268 const p = activePtys.get(params.ptyId)

Callers 1

writeRuntimePtyFunction · 0.85

Calls 3

errorMethod · 0.80
getMethod · 0.65
writeMethod · 0.65

Tested by

no test coverage detected