refactor: extract cli command runtime wiring

This commit is contained in:
2026-02-20 03:16:16 -08:00
parent 2b70b54faf
commit 2ffd503898
5 changed files with 76 additions and 14 deletions

View File

@@ -9,6 +9,10 @@
## Current Work (newest first)
- [2026-02-20T11:15:54Z] progress: extracted CLI command composition from `src/main.ts` into `src/main/runtime/cli-command-runtime-handler.ts`; `main.ts` now creates `handleCliCommand` via one runtime factory (precheck + context + runtime dispatch wiring).
- [2026-02-20T11:15:54Z] progress: added `src/main/runtime/cli-command-runtime-handler.test.ts` to lock composed behavior around texthooker precheck, context creation, and `'initial'` source forwarding.
- [2026-02-20T11:15:54Z] test: `bun run build` pass (expected macOS helper Swift cache fallback) + focused suites pass for `cli-command-runtime-handler*`, `cli-command-prechecks*`, `cli-command-context-factory*`, `initial-args-runtime-handler*`, and `startup-runtime-handlers*` (7/7).
- [2026-02-20T11:15:54Z] scope: staging `src/main.ts`, new cli-command runtime handler module/test, and subagent bookkeeping only.
- [2026-02-20T11:14:14Z] progress: extracted startup/app-lifecycle composition from `src/main.ts` into `src/main/runtime/startup-runtime-handlers.ts`; rewired `main.ts` to inject `createAppLifecycleRuntimeRunner` + `createStartupBootstrapRuntimeDeps` into `createStartupRuntimeHandlers(...)`.
- [2026-02-20T11:14:14Z] progress: extracted initial-args composition from `src/main.ts` into `src/main/runtime/initial-args-runtime-handler.ts`; `main.ts` now constructs `handleInitialArgsRuntimeHandler` with one runtime factory call.
- [2026-02-20T11:14:14Z] progress: added parity tests `src/main/runtime/startup-runtime-handlers.test.ts` and `src/main/runtime/initial-args-runtime-handler.test.ts` (fixing previous `node:sqlite` test-import leak by removing direct runtime imports from startup handler module).