Files
deepseek-harness/packages/terminal
Tianyi Cui 3ca9c7d489 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-27 23:14:31 +08:00
..

description, kind
description kind
Package map for the persistent terminal capability family: the owner-scoped ctx.terminals service, the shell backend that starts interactive bash or pwsh, and the six model-facing tools. package-group

terminal/ — persistent PTY capability family

English | 中文

Summary

The terminal/ group gives agents persistent, owner-scoped terminal sessions: shell and REPL state — cwd, exported variables, activated environments, running interactive children — survives across tool calls. Three packages cover the family: terminal/ provides the owner-scoped session service behind ctx.terminals (sessions get opaque ids, and every operation stays fenced to the owning agent); terminal-bash/ starts an interactive bash or pwsh shell under the shared sandbox policy; and tool-terminal/ exposes six model-facing tools with bounded results. A terminal complements the one-shot bash and filesystem tools: use it when work needs interactive stdin or cross-call state. Sessions are process-local and do not survive a harness restart.

Table of Contents


Packages

The family is one session service, one shell backend, and one set of model-facing tools. Each child README owns the full contract; the subsystem reference owns the shared vocabulary and the generated service surface.

Package Role ctx key
terminal/ Session service: owner-scoped sessions with opaque ids, exact-owner fencing, and awaited cleanup ctx.terminals
terminal-bash/ Shell backend: interactive bash or pwsh under the shared sandbox policy, with readiness detection and bounded output registers a backend on ctx.terminals
tool-terminal/ Six model-facing tools with owner isolation and optional background sends registers on ctx.tools

Start with the subsystem reference for the shared types and the service surface, then the Agent Note for the design rationale and deferred boundaries.

Dev Note

Working context for maintainers — click to expand

None.