Preface

In the development of the DeepSeek Harness (DSH) web console, developers often face limited terminal interaction, difficulty tracking AI-generated files in real time, and the lack of full-chain behavior statistics. As a developer toolbox plugin, dsh-devpanel provides a real multi-tab PTY terminal and an AI output file browser directly in the browser console. Without relying on complex build processes, it mounts a Remote namespace and injects stylesheets, adding a native terminal interaction experience and visual workflow tracking capabilities to DSH.

Plugin Positioning

  • Name: dsh-devpanel
  • Maintainer: lispking
  • Core Value: Reproduces a native terminal experience in the browser and links AI tool calls with file changes, providing dual-dimension behavior statistics (AI + terminal).

Core Features

The plugin enhances the DSH console through three main panels:

1. Real PTY Terminal Panel

The terminal panel is docked below the editor and provides an environment similar to a native shell.

  • Real session: Starts the system login shell in the session’s working directory ($SHELL, falling back to /bin/sh), correctly exports the TERM environment variable, and ensures normal rendering of colored output and prompts for commands such as git and ls.
  • Multi-tab management: Supports creating new tabs, closing individual tabs, and closing all tabs. Closing the last tab destroys the panel, while reopening it initializes a new default tab.
  • Native behavior: Supports text selection and copying, pasting with Cmd/Ctrl+Shift+V, the clear command, and correctly handles multi-byte UTF-8 output to avoid garbled characters.
  • Process control: Can send SIGINT, SIGTERM, SIGKILL, SIGTSTP, and SIGHUP signals to foreground process groups, or terminate captured process trees with a 2-second grace period.
  • Incremental output: The browser polls the read interface to obtain incremental output, while the host maintains a 1 MB rolling buffer to ensure that long output does not cause memory overflow.

2. AI Output File Sidebar

The right-side sidebar lists files written or edited by the AI in the current session, as well as files generated by shell commands.

  • Source tracking: Collects files produced by AI tool write/edit calls (deduplicated and sorted by first appearance), and validates paths parsed from shell command output.
  • Multi-format rendering: Supports syntax highlighting, Markdown rendering, image preview, and a full-screen viewing mode.

3. Dual-Dimension Usage Statistics Panel

Displays AI and terminal activity data through a modal overlay.

  • Data dimensions: Merges the AI activity side (token consumption, call count, model distribution, response duration) with the terminal activity side (number of sessions, number of submitted commands, runtime).
  • Visualization: Includes overview cards, a daily two-series trend chart, and an annual activity heatmap.
  • Persistence: Historical session indexes are replayed on a best-effort basis through ctx.sessionQuery and persisted to DSH_HOME/devpanel/usage-v1.json.
  • Export: Supports CSV/JSON export of call and terminal details.

Other Features

  • Session-scoped CWD: Terminal and relative file reads are based on the session’s project directory, falling back to the user home directory or host CWD.
  • Bilingual UI: Built-in dictionaries for Simplified Chinese and English, registered under the toolkit namespace.
  • Clean lifecycle: When the plugin is uninstalled, it terminates all active PTY sessions and cleans up injected stylesheets and the Remote namespace.

Architecture Design

The plugin uses a client/host-separated duality architecture and communicates across the Typert Remote boundary:

  • Host side: Provides TerminalPanelService (manages PTY sessions and rolling buffers) and UsageService (handles session/event rockets and persists statistics).
  • Client side: By mounting the TYPERT_REMOTE namespace, it registers three slots: conversation.session.header.utilities (action icons), details (file sidebar, priority -10 overriding the default details view), and conversation.composer.dock (terminal dialog).

Installation and Enablement

No specific installation command is currently provided. You can access the plugin source code or directory information through the following links:

Typical Usage

  1. Terminal Interaction: Click the terminal icon in the top toolbar of the DSH console to launch a multi-tab terminal. Manually enter commands or start background processes (such as python server.py) and observe real-time incremental output.
  2. File Browsing: After the AI writes code or modifies configuration, click the sidebar icon in the top toolbar of the console to view all AI-generated or modified files listed on the right, with image preview and code highlighting supported.
  3. Work Statistics: Click the statistics icon in the top console to open the modal panel, view token consumption, model distribution, and terminal runtime, and export CSV analysis data.

Applicable Scenarios and Cautions

  • Suitable For: Developers who need to debug code deeply in the browser, frequently inspect AI output files, or quantitatively analyze the collaboration efficiency between AI and terminal workflows.
  • Cautions:
    • The plugin runs with the permissions of the current DSH process and involves file read/write operations and process control. The source code and license should be reviewed before installation.
    • The plugin lifecycle is bound to the session, and uninstalling the plugin terminates all active PTY sessions. Do not uninstall the plugin after running critical tasks in the session.