MCPcopy Create free account
hub / github.com/ConsortiumAI/Consortium / streamToStdin

Function streamToStdin

packages/consortium-cli/src/claude/sdk/utils.ts:111–121  ·  view source on GitHub ↗
(
    stream: AsyncIterable<unknown>,
    stdin: NodeJS.WritableStream,
    abort?: AbortSignal
)

Source from the content-addressed store, hash-verified

109 * Stream async messages to stdin
110 */
111export async function streamToStdin(
112 stream: AsyncIterable<unknown>,
113 stdin: NodeJS.WritableStream,
114 abort?: AbortSignal
115): Promise<void> {
116 for await (const message of stream) {
117 if (abort?.aborted) break
118 stdin.write(JSON.stringify(message) + '\n')
119 }
120 stdin.end()
121}

Callers 1

queryFunction · 0.90

Calls 1

endMethod · 0.80

Tested by

no test coverage detected