2026-07-08 11:00:06 +08:00
|
|
|
/**
|
2026-07-12 03:36:43 +08:00
|
|
|
* The worker-thread entrypoint: self-executing glue over `bootstrap.ts`'s {@link
|
|
|
|
|
* runWorkerMain}, kept to the spawn wiring alone.
|
2026-07-08 11:00:06 +08:00
|
|
|
* @module @deepseek-ai/dsh-code-runtime-worker/src/worker
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
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.
|
|
|
|
|
if (!parentPort) throw new Error('dsh-code-runtime-worker: worker entry loaded outside a worker thread')
|
|
|
|
|
|
|
|
|
|
await runWorkerMain(parentPort, workerData as WorkerBootData, { stdout: process.stdout, stderr: process.stderr })
|