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