refactor(cli): merge kill/pause/resume into control.ts + extract readWorkerCtl

- Merge three near-identical files (kill.ts, pause.ts, resume.ts) into
  commands/thread/control.ts with parameterized cmdThreadControl()
- Extract readWorkerCtl() into worker-spawn.ts to eliminate duplicated
  WorkerCtl parsing logic
- Update cli-dispatch.ts and test imports
- Net reduction: ~59 lines

Refs #95
This commit is contained in:
2026-05-08 08:55:25 +08:00
parent 2af299f3ce
commit 9bdb18afd0
8 changed files with 79 additions and 138 deletions
@@ -6,11 +6,9 @@ import { dirname, join } from "node:path";
import { fileURLToPath } from "node:url";
import { getGlobalCasDir } from "@uncaged/workflow";
import { cmdCasPut } from "../src/commands/cas/put.js";
import { cmdKill } from "../src/commands/thread/kill.js";
import { cmdKill, cmdPause, cmdResume } from "../src/commands/thread/control.js";
import { cmdThreads } from "../src/commands/thread/list.js";
import { cmdPause } from "../src/commands/thread/pause.js";
import { cmdPs } from "../src/commands/thread/ps.js";
import { cmdResume } from "../src/commands/thread/resume.js";
import { cmdThreadRemove } from "../src/commands/thread/rm.js";
import { cmdRun } from "../src/commands/thread/run.js";
import { cmdThreadShow } from "../src/commands/thread/show.js";