feat(code-runtime-python): add the fd-3 frame protocol
Introduce @deepseek-ai/dsh-code-runtime-python with the versionless
JSON-lines protocol between the Node host and the CPython subprocess:
the host-side hostile-frame codec (validateChildFrame, encodeJsonPlain,
checkDoneValue, hasUnsafeIntegerToken, hasNonLosslessNumber,
logTruncationMarker) and the Python-side wire-vocabulary mirror
(py/protocol.py).
This is the protocol layer of the code-runtime-python stack, split from
#436 and based on the multi-language seam extension. The PythonCodeRuntime
implementation and its Python JSON codec land in the backend-core PR on
top of this branch.
Ship the minimal buildable package skeleton (package.json, tsconfig,
tsdown, barrel index, invariant companion, bilingual README) because the
workspace-constraint, coverage, and invariant-topology gates require the
package to exist and build the moment its directory does; the backend-core
PR extends those files rather than creating them.
Align py/protocol.py with src/protocol.ts (the round-12 review of #436
found LogMessage.truncated, DoneMessage.error.kind, and Namespace.errorClass
stale) and guard the two runtime-executed surfaces (PROTOCOL_FD and the log
truncation marker) with a real-python3 cross-language mirror e2e test.
2026-07-31 18:51:03 +08:00
|
|
|
/**
|
|
|
|
|
* CPython subprocess code runtime for the DeepSeek Harness code-execution seam.
|
|
|
|
|
*
|
2026-08-17 18:07:24 +08:00
|
|
|
* The package owns the versionless fd-3 wire protocol between the Node host and
|
|
|
|
|
* the CPython subprocess. The protocol's host-side codec and hostile-frame
|
|
|
|
|
* validators are re-exported so every consumer of the wire shares one
|
|
|
|
|
* vocabulary.
|
feat(code-runtime-python): add the fd-3 frame protocol
Introduce @deepseek-ai/dsh-code-runtime-python with the versionless
JSON-lines protocol between the Node host and the CPython subprocess:
the host-side hostile-frame codec (validateChildFrame, encodeJsonPlain,
checkDoneValue, hasUnsafeIntegerToken, hasNonLosslessNumber,
logTruncationMarker) and the Python-side wire-vocabulary mirror
(py/protocol.py).
This is the protocol layer of the code-runtime-python stack, split from
#436 and based on the multi-language seam extension. The PythonCodeRuntime
implementation and its Python JSON codec land in the backend-core PR on
top of this branch.
Ship the minimal buildable package skeleton (package.json, tsconfig,
tsdown, barrel index, invariant companion, bilingual README) because the
workspace-constraint, coverage, and invariant-topology gates require the
package to exist and build the moment its directory does; the backend-core
PR extends those files rather than creating them.
Align py/protocol.py with src/protocol.ts (the round-12 review of #436
found LogMessage.truncated, DoneMessage.error.kind, and Namespace.errorClass
stale) and guard the two runtime-executed surfaces (PROTOCOL_FD and the log
truncation marker) with a real-python3 cross-language mirror e2e test.
2026-07-31 18:51:03 +08:00
|
|
|
* @module @deepseek-ai/dsh-code-runtime-python
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
export type { BootMessage, ChildToHost, ReplyMessage } from './protocol.ts'
|
|
|
|
|
export {
|
|
|
|
|
checkDoneValue,
|
|
|
|
|
encodeJsonPlain,
|
|
|
|
|
hasNonLosslessNumber,
|
|
|
|
|
hasUnsafeIntegerToken,
|
|
|
|
|
logTruncationMarker,
|
|
|
|
|
validateChildFrame,
|
|
|
|
|
} from './protocol.ts'
|