2026-07-08 11:00:06 +08:00
|
|
|
/**
|
2026-07-13 23:27:00 +08:00
|
|
|
* Spawn-only worker entrypoint over {@link runWorkerMain}. Executable logic stays in
|
|
|
|
|
* `bootstrap.ts` for in-process coverage; real-worker tests cover this glue.
|
2026-08-13 00:36:22 +08:00
|
|
|
* @module @deepseek-ai/dsh-code-runtime-worker-thread/src/worker
|
2026-07-08 11:00:06 +08:00
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
import { parentPort, workerData } from 'node:worker_threads'
|
|
|
|
|
import { runWorkerMain } from './bootstrap.ts'
|
|
|
|
|
import type { WorkerBootData } from './protocol.ts'
|
|
|
|
|
|
|
|
|
|
// A worker always has a parent port; guard loudly rather than run detached.
|
2026-08-13 00:36:22 +08:00
|
|
|
if (!parentPort) throw new Error('dsh-code-runtime-worker-thread: worker entry loaded outside a worker thread')
|
2026-07-08 11:00:06 +08:00
|
|
|
|
2026-07-13 20:55:47 +08:00
|
|
|
void runWorkerMain(parentPort, workerData as WorkerBootData, { stdout: process.stdout, stderr: process.stderr })
|