{"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":"","sourcesContent":["#!/usr/bin/env node\n/**\n * CLI entry point for the refactored coding agent.\n * Uses main.ts with AgentSession and new mode modules.\n *\n * Test with: npx tsx src/cli-new.ts [args...]\n */\nimport { EnvHttpProxyAgent, setGlobalDispatcher } from \"undici\";\nimport { APP_NAME } from \"./config.js\";\nimport { main } from \"./main.js\";\nimport { configureGlobalTLS } from \"./utils/tls-ca.js\";\n\nprocess.title = APP_NAME;\nprocess.env.HOOCODE_CODING_AGENT = \"true\";\nprocess.emitWarning = (() => {}) as typeof process.emitWarning;\n\n// App-level TLS CA trust: install any custom/system CA additively on the global\n// HTTPS agent (verification stays ON) and thread the same trust set into the\n// undici dispatcher below. The two flags (--ca-cert / --use-system-ca) are read\n// via a process.argv pre-scan inside configureGlobalTLS, because the dispatcher\n// is built here before main() parses args.\nconst ca = configureGlobalTLS();\n\n// bodyTimeout/headersTimeout default to 300s in undici; long local-LLM stalls\n// (e.g. vLLM buffering a large tool call) exceed that and abort the SSE stream\n// with UND_ERR_BODY_TIMEOUT. Disable both — provider SDKs enforce their own\n// AbortController-based deadlines via retry.provider.timeoutMs.\nsetGlobalDispatcher(new EnvHttpProxyAgent({ bodyTimeout: 0, headersTimeout: 0, connect: { ca } }));\n\nmain(process.argv.slice(2));\n"]}