feat(ptc): 支持 embedded 模式启用 persistent PTC

This commit is contained in:
Anlai Lu committed 2026-11-06 12:55:15 +08:00
1 parent 46f423f5a8
commit 4ac6a28e68
13 files changed
+88 -28

No files matched your search

+8 -2
View File
@@ -84,9 +84,15 @@ if (resource !== undefined) {
} else if (aclRunner !== undefined && process.argv[2] === aclRunner) {
process.argv.splice(1, 1)
await import('@deepseek-ai/dsh-sandbox-windows-acl/runner')
} else if (process.env.DSH_PTC_RUNTIME_NODE === '1') {
} else if (process.env.DSH_PTC_RUNTIME_NODE !== undefined) {
const mode = process.env.DSH_PTC_RUNTIME_NODE
Reflect.deleteProperty(process.env, 'DSH_PTC_RUNTIME_NODE')
await import('@deepseek-ai/dsh-ptc-runtime-node/process')
if (mode !== '1' && mode !== 'persistent') {
throw new Error('DSH_PTC_RUNTIME_NODE must be 1 or persistent')
}
await import(mode === 'persistent'
? '@deepseek-ai/dsh-ptc-runtime-node/persistent-process'
: '@deepseek-ai/dsh-ptc-runtime-node/process')
} else if (selection === undefined) {
// A DSH_PRIMARY_RUNTIME set or inherited from the environment, including the empty opt-out, takes precedence over the
// downloaded cache.