From 9e4a270b6d4d02cc3140241ee7928a446681917f Mon Sep 17 00:00:00 2001 From: Jun Han Date: Fri, 6 Feb 2026 14:42:47 +0800 Subject: [PATCH] fix: use npx.cmd on Windows in client example --- src/examples/client.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/examples/client.ts b/src/examples/client.ts index e450090..d4418e9 100644 --- a/src/examples/client.ts +++ b/src/examples/client.ts @@ -102,8 +102,9 @@ async function main() { const __dirname = dirname(__filename); const agentPath = join(__dirname, "agent.ts"); - // Spawn the agent as a subprocess using tsx - const agentProcess = spawn("npx", ["tsx", agentPath], { + // Spawn the agent as a subprocess via npx (npx.cmd on Windows) using tsx + const npxCmd = process.platform === "win32" ? "npx.cmd" : "npx"; + const agentProcess = spawn(npxCmd, ["tsx", agentPath], { stdio: ["pipe", "pipe", "inherit"], });