#!/usr/bin/env node import { readFileSync } from "node:fs"; import { createConnection } from "node:net"; import { dirname, join } from "node:path"; import { cwd } from "node:process"; import { fileURLToPath } from "node:url"; import type { RpcCommand, RpcExtensionUIResponse } from "@earendil-works/pi-coding-agent"; import { getSocketPath } from "./config.ts"; import { sendIpcRequest } from "./ipc/client.ts"; import { encodeMessage } from "./ipc/protocol.ts"; import { serve } from "./serve.ts"; const __filename = fileURLToPath(import.meta.url); const __dirname = dirname(__filename); const packageJson = JSON.parse(readFileSync(join(__dirname, "../package.json"), "utf-8")) as { version: string; }; function printHelp(): void { console.log( `orchestrator v${packageJson.version}\n\nUsage:\n orchestrator serve\n orchestrator list\n orchestrator spawn [--cwd ] [--label