mirror of
https://github.com/deepseek-ai/deepseek-harness.git
synced 2026-11-09 20:07:43 +08:00
15 lines
703 B
JavaScript
15 lines
703 B
JavaScript
/** Custom protocol runner exercised through the headless profile's PTC provider. */
|
|
import { openInheritedControlChannel } from '../../../packages/subprocess/subprocess/src/control.ts'
|
|
import { runNodeMain } from '../../../packages/ptc-runtime/ptc-runtime-node/src/process.ts'
|
|
|
|
class Counter {
|
|
#count = 0
|
|
next() { return ++this.#count }
|
|
}
|
|
const exports = { Counter, counter: new Counter() }
|
|
|
|
await runNodeMain(openInheritedControlChannel(), Number(process.argv[2]), process, 'script', async ({ specifier }) => {
|
|
if (specifier === 'runner:denied') throw new Error('Dependency import denied by runner')
|
|
return specifier === 'runner:counter' ? { type: 'module', exports } : { type: 'default' }
|
|
})
|