Skip to content
Source
Sign inSign up
pingdotgg/t3code
Open History to see the last commit

bin.ts

28 lines1.1 KB

1/**
2 * Every ACP agent spawns `t3 acp-mcp-bridge` while opening its session, and terminal-fallback
3 * agents run `t3 acp-mcp-call` per tool call, so their startup sits on first-message latency.
4 * Both dispatch here before the full CLI module graph (seconds of evaluation) loads; everything
5 * else defers to the real CLI in ./binCli.ts.
6 */
7import { isEntrypoint } from "./entrypoint.ts";
8​
9if (
10 isEntrypoint({
11 moduleUrl: import.meta.url,
12 entryPath: process.argv[1],
13 runtimeMain: import.meta.main,
14 })
15) {
16 const command = process.argv[2];
17 if (command === "acp-mcp-bridge" || command === "acp-mcp-call") {
18 const { runAcpMcpCliFastPath } = await import("./mcp/AcpMcpStdioBridge.ts");
19 await runAcpMcpCliFastPath(command, process.argv.slice(3));
20 } else {
21 // Before anything reads stdin: the desktop app's Windows launcher starts
22 // the CLI without one. Never for the fast paths, whose stdin is a pipe.
23 const { attachConsoleStdin } = await import("./cli/consoleStdin.ts");
24 attachConsoleStdin();
25 const { runCli } = await import("./binCli.ts");
26 runCli();
27 }