MCPcopy Create free account
hub / github.com/commandoperator/cmdop-sdk / attachStreamsForTest

Method attachStreamsForTest

node/src/transport.ts:124–129  ·  view source on GitHub ↗

* @internal Test seam: drive the demux off a provided stdin/stdout pair * instead of spawning a binary. Used by the transport unit tests, mirroring * the Python test that injects a fake process.

(stdin: Writable, stdout: Readable)

Source from the content-addressed store, hash-verified

122 const env = { ...process.env };
123 if (this.config.token) env.CMDOP_TOKEN = this.config.token;
124 else delete env.CMDOP_TOKEN;
125 if (this.config.baseUrl) env.CMDOP_BASE_URL = this.config.baseUrl;
126 else delete env.CMDOP_BASE_URL;
127 const child = spawn(this.binaryPath, ["--stdio"], {
128 stdio: ["pipe", "pipe", "pipe"],
129 env,
130 windowsHide: true,
131 });
132 this.#child = child;

Callers 2

makeTransportFunction · 0.95
makeTransportFunction · 0.95

Calls 2

#startReaderMethod · 0.95
resolveMethod · 0.80

Tested by 2

makeTransportFunction · 0.76
makeTransportFunction · 0.76