This repository is an OpenCode plugin that provides interactive pseudo-terminal (PTY) management for AI coding agents. It allows agents to spawn, write to, read from, and kill multiple background terminal sessions, enabling long-running processes like dev servers, watch modes, and interactive programs. The plugin exposes five tools (pty_spawn, pty_write, pty_read, pty_list, pty_kill) and two slash commands for opening a web UI. The architecture is modular: a core PTYManager orchestrates session lifecycle, output buffering (via a RingBuffer), and exit notifications, while adapters decouple the plugin from OpenCode V1 and V2 APIs. A Bun-based web server serves a React frontend with real-time WebSocket streaming and a REST API for session management. The codebase demonstrates strong TypeScript patterns, clean abstractions, and comprehensive testing (unit, integration, and Playwright E2E).
Dura is a background process (daemon) that automatically snapshots uncommitted changes in Git repositories. It runs as a CLI tool with subcommands: `serve` (daemon loop), `watch`/`unwatch` (manage watched repos), `capture` (one-shot snapshot), `status` (daemon state), `kill` (stop daemon), and `metrics` (post-process logs with git diff stats). The architecture is a single Rust binary. On every polling cycle (5 seconds), it iterates watched repos, uses an optimized file-timestamp check (`PollGuard`) to detect changes efficiently, then creates a commit on a separate `dura/<HEAD_hash>` branch without modifying the working tree or HEAD. Snapshots include all tracked and untracked files. Configuration is stored as TOML in the user's config directory; runtime state (PID) is stored as JSON. Logging is structured JSON via a custom tracing layer. The design emphasizes non-disruptive operation and data safety.