rename code-mode to ptc (PTC mode), except session-persistent vocabulary
Rename the tool-presentation transport from code-mode to ptc everywhere
that is not written into session logs: the mode config value becomes 'ptc',
the preset directory/id becomes ptc, the demo becomes demo:ptc, the
dispatch waterfall becomes tools/ptc-dispatch-log (types PtcDispatch*), the
prompt rule becomes tools:ptc-only, source/test files become ptc.ts etc.,
and prose says PTC mode / PTC 模式. The session-persistent vocabulary
(durable events tool/code-dispatch*, logged plugin name tools-code-mode,
sub-call id segment :code:) intentionally stays and moves in the stacked
persistence PR, which is blocked until the SESSION_FORMAT_VERSION v0→v1
migration lands with it. run_code, its code parameter, CodeSdkLanguage,
CodeRunFailedError, the dsh-code-runtime family, third-party codex names,
and frozen archived notes keep their names.
2026-08-25 20:46:42 +08:00
|
|
|
/** Run one headless task through the shipped PTC mode composition. Requires a model credential. */
|
2026-07-09 12:16:37 +08:00
|
|
|
import { spawn } from 'node:child_process'
|
|
|
|
|
|
2026-08-24 10:00:15 +08:00
|
|
|
const task = process.argv.slice(2).join(' ').trim()
|
rename code-mode to ptc (PTC mode), except session-persistent vocabulary
Rename the tool-presentation transport from code-mode to ptc everywhere
that is not written into session logs: the mode config value becomes 'ptc',
the preset directory/id becomes ptc, the demo becomes demo:ptc, the
dispatch waterfall becomes tools/ptc-dispatch-log (types PtcDispatch*), the
prompt rule becomes tools:ptc-only, source/test files become ptc.ts etc.,
and prose says PTC mode / PTC 模式. The session-persistent vocabulary
(durable events tool/code-dispatch*, logged plugin name tools-code-mode,
sub-call id segment :code:) intentionally stays and moves in the stacked
persistence PR, which is blocked until the SESSION_FORMAT_VERSION v0→v1
migration lands with it. run_code, its code parameter, CodeSdkLanguage,
CodeRunFailedError, the dsh-code-runtime family, third-party codex names,
and frozen archived notes keep their names.
2026-08-25 20:46:42 +08:00
|
|
|
|| 'Inspect this repository with PTC mode and report its top-level architecture.'
|
2026-07-09 12:16:37 +08:00
|
|
|
|
2026-07-30 14:56:39 +08:00
|
|
|
const child = spawn(process.execPath, [
|
|
|
|
|
'--import',
|
2026-08-23 01:45:44 +08:00
|
|
|
'tsx/esm',
|
|
|
|
|
'apps/cli/src/bin.ts',
|
|
|
|
|
'--profile',
|
2026-08-24 10:00:15 +08:00
|
|
|
'headless',
|
|
|
|
|
task,
|
|
|
|
|
], {
|
|
|
|
|
stdio: 'inherit',
|
rename code-mode to ptc (PTC mode), except session-persistent vocabulary
Rename the tool-presentation transport from code-mode to ptc everywhere
that is not written into session logs: the mode config value becomes 'ptc',
the preset directory/id becomes ptc, the demo becomes demo:ptc, the
dispatch waterfall becomes tools/ptc-dispatch-log (types PtcDispatch*), the
prompt rule becomes tools:ptc-only, source/test files become ptc.ts etc.,
and prose says PTC mode / PTC 模式. The session-persistent vocabulary
(durable events tool/code-dispatch*, logged plugin name tools-code-mode,
sub-call id segment :code:) intentionally stays and moves in the stacked
persistence PR, which is blocked until the SESSION_FORMAT_VERSION v0→v1
migration lands with it. run_code, its code parameter, CodeSdkLanguage,
CodeRunFailedError, the dsh-code-runtime family, third-party codex names,
and frozen archived notes keep their names.
2026-08-25 20:46:42 +08:00
|
|
|
env: { ...process.env, DSH_TOOLS_MODE: 'ptc' },
|
2026-08-24 10:00:15 +08:00
|
|
|
})
|
2026-07-09 12:16:37 +08:00
|
|
|
child.on('exit', (code, signal) => { process.exit(signal !== null ? 1 : code ?? 1) })
|