
Security News
PHP Foundation Says Chainguard Broke Security Embargo Ahead of Emergency Patches
The PHP Foundation says Chainguard broke a security embargo ahead of critical RCE patches, as leaks disrupted the coordinated release.
dsh-interactive-shell
Advanced tools
Interactive shell bridge for DeepSeek Harness: the agent drives real interactive CLIs (vim/psql/ssh/dev servers) over the ctx.terminals PTY seam in Monitor/Dispatch modes with live Web UI stream overlay and bidirectional human takeover. Port of pi-interac
让 Agent 亲手驱动真实交互式 CLI(vim / psql / ssh / npm run dev / docker logs -f),用户在 Web 端实时观看输出并可随时按键接管。移植自 pi-interactive-shell,深度融合 DeepSeek Harness 的 ctx.terminals PTY 缝隙与 Cordis 服务总线。
状态:生产就绪(M1 ~ M8 全量落地与加固,单元/集成/E2E 75/75 测试全绿,覆盖率 94.92%+)。
interactive:持久 sessionId,Agent 按需发送输入、轮询状态,支持人机双向接管;hands-free:静默窗自动判定,Agent 无需高频探询;dispatch:一次性子任务派发(如构建/测试),完成或超时后单次唤醒 Agent 并携带尾部日志;monitor:基于正则触发器或文件系统变更(watch)监听,命中时主动注入 Notice 唤醒 Agent,全周期 0 模型轮询开销。permissive / balanced / strict,内置高危破坏性指令拦截(rm -rf /、mkfs、dd、chmod 777 /、fork bomb、del /s /q、format c:、curl | sh);StreamCircuitBreaker 动态速率限流,抵御海量输出打爆客户端。StreamHub):支持环形缓冲区历史回放、帧广播(init / output / event / lock / exit);<dsh-shell-dock>):Shadow DOM 样式隔离,支持浅色/深色双主题切换与自定义事件;transport):支持 WebSocket/SSE 与内存直连适配器。.cast 格式录像文件;getTimelineAttribution 划分人类与 Agent 操作时间轴;getTimeTravelSnapshot 按任意历史时间戳重构虚拟屏幕缓冲区。(y/N) 确认、密码输入、单选光标菜单与多选复选框;generatePromptAnswer 自动计算上下光标方向键与回车,避免模型猜键开销。graph TD
Agent[DeepSeek Agent] -->|Tool Call: interactive_shell| Plugin[dsh-interactive-shell]
Plugin -->|PTY Seam| Terminals[ctx.terminals PTY]
Plugin -->|Stream Broadcast| StreamHub[StreamHub / ctx.interactiveShellStream]
StreamHub -->|term:output / term:lock| Transport[Transport Layer / WebSocket]
Transport -->|TermFrame| Dock[<dsh-shell-dock> Web Component]
Dock -->|Direct Keystrokes & Takeover| StreamHub
StreamHub -->|agent.followup / notice| Agent
StreamHub -->|Stream Frames| Recorder[SessionRecorder / Asciinema Export]
| 模式 | Agent 行为 | 输出如何反馈给 Agent | 适用场景 |
|---|---|---|---|
interactive | 异步驱动,按需交互 | 随时调用 read 或 status 检查输出 Tail | vim / psql / SSH 交互式会话 |
hands-free | 异步观察 | 静默窗触发后主动反馈 | 短时构建、脚本执行 |
dispatch | 派发后继续执行其他任务 | 进程退出/静默/超时后,通过 agent.followup 单次主动唤醒 | 长耗时测试或编译任务 |
monitor | 休眠等待 | 匹配到正则 trigger 或文件变更时,通过 agent.followup 唤醒 | 日志监控、Dev Server 启动探针 |
<dsh-shell-dock><script type="module">
import { defineDshShellComponent } from 'dsh-interactive-shell'
defineDshShellComponent()
</script>
<dsh-shell-dock theme="dark"></dsh-shell-dock>
import { SessionRecorder } from 'dsh-interactive-shell'
const recorder = new SessionRecorder()
// 记录流式帧
streamHub.subscribeAll(frame => recorder.record(frame))
// 导出 Asciinema v2 .cast 字符串
const castJsonl = recorder.exportAsciinema('session_123', { title: 'Dev Build' })
// 获取任意历史时刻(如 10 秒前)的虚拟屏幕内容
const snapshotLines = recorder.getTimeTravelSnapshot('session_123', Date.now() - 10000)
import { parseInteractivePrompt, generatePromptAnswer } from 'dsh-interactive-shell'
const prompt = parseInteractivePrompt(terminalTail)
if (prompt?.kind === 'select_menu') {
const answerKeys = generatePromptAnswer(prompt, { preferredChoice: 'TypeScript' })
// 自动生成 '\x1B[B\n'(方向下键+回车)
await tool.execute({ action: 'send', sessionId, input: answerKeys })
}
仓库内置了开箱即用的演示示例,可直接运行体验:
# 1. 智能 CLI 交互提示词自动应答(确认框、多级单选、数字菜单、多选复选框按键生成)
node examples/demo-auto-responder.mjs
# 2. 会话录制、人机协作归属占比与时光机快照回放导出 Asciinema .cast
node examples/demo-recorder.mjs
# 3. 浏览器查看 <dsh-shell-dock> Web Component 主题切换与接管联动演示
# 在浏览器中直接打开 examples/demo-web-client.html
tsc --strict 与 oxlint 0 警告、0 错误。FAQs
Interactive shell bridge for DeepSeek Harness: the agent drives real interactive CLIs (vim/psql/ssh/dev servers) over the ctx.terminals PTY seam in Monitor/Dispatch modes with live Web UI stream overlay and bidirectional human takeover. Port of pi-interac
The npm package dsh-interactive-shell receives a total of 4 weekly downloads. As such, dsh-interactive-shell popularity was classified as not popular.
We found that dsh-interactive-shell demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.

Security News
The PHP Foundation says Chainguard broke a security embargo ahead of critical RCE patches, as leaks disrupted the coordinated release.

Security News
PHP releases emergency patches for two critical RCE vulnerabilities as agencies urge organizations to take unpatched sites offline.

Threat Research
/Security News
A supply chain attack compromised LiteLLM 1.107.0 on PyPI and Docker, spreading malware that steals cloud credentials, developer secrets, and AI provider keys.