English | 中文
Owner-scoped persistent PTY seam. PtyService registers as ctx.pty, mints opaque session ids, routes creation through named backends, fences every operation to the exact live Agent, and awaits backend quiescence when that agent or the service disposes.
type and return an unpublished PtyBackendSession; failed or cancelled setup must clean partial resources, and a failed cleanup rejects with PtyBackendCleanupError so the registry can retain it across cancellation.hasOwnerActivity(owner) spans unpublished setup through final close, so lifecycle policy can fence the exact owner without a publication race.PtySessionId. The optional name is owner-local display metadata, never authority.PtySendResult.waitReason and sessionStatus are independent. session_exit describes the top-level PTY process, not an arbitrary foreground command.kill() and disposal resolve only after the backend's captured process tree is quiescent. A cleanup failure rejects instead of claiming success and clears the matching backend and registry fences so a later close can retry without disturbing a newer attempt.The seam contains no node-pty, sandbox, tool-schema, prompt, task, or terminal-rendering policy. Implementations own terminal mechanics; consumers own model presentation and optional background-task registration.
Nothing directly. This package registers no prompt or tool; @deepseek-ai/dsh-tool-pty owns visible schemas and result text.
None directly. Live session state stays process-local until a consumer returns a bounded result.
No direct invalidation; the named consumer owns request-prefix changes.