Skip to content

Releases: owner888/pig

v0.4.7

Choose a tag to compare

@owner888 owner888 released this 07 Oct 10:30

Fixed

  • Fixed Vim and interactive full-screen TUI applications in Web PTY Terminals:
    • Added COLORFGBG=15;0 to the PTY environment so macOS and Linux Vim correctly recognize dark backgrounds, rendering clear white text and bright tildes instead of invisible black-on-black text.
    • Centralized PtyManager in HttpServer with dynamic terminal-to-connection routing, ensuring active PTY processes and Vim sessions survive WebSocket reconnects rather than being killed when a connection drops.
    • Added container click-to-focus listeners in WebTerminal.js and NodeWorkbench.js so clicking anywhere in the terminal drawer immediately focuses xterm.js input.
    • Initialized terminal instances with visible display before fitting so FitAddon measures real pixel dimensions (cols and rows) rather than defaulting to 80x24.

v0.4.6

Choose a tag to compare

@owner888 owner888 released this 07 Oct 09:46

Changed

  • Streamlined Web UI header action buttons for visual consistency:
    • Renamed "账号与配额" to concise "🔑 账号" (in Chinese) and "🔑 Accounts" (in English) with dedicated key icon.
    • Added clean 6px gap spacing to .ctrl-btn between .nodes-btn-icon SVG and "SSH 节点" label, matching all other header buttons.

v0.4.4

Choose a tag to compare

@owner888 owner888 released this 07 Oct 08:22

Fixed

  • Fixed PHP Warning: Undefined array key in PtyManager::input() and PtyManager::resize():
    • Accessing $this->terminals[$id]?->... triggered PHP undefined array key warnings when frontend xterm.js resize listeners or lingering keystrokes arrived after a terminal session had exited and been unset.
    • Replaced with null-coalescing $this->terminals[$id] ?? null access to safely ignore input and resize operations on terminated or unknown terminal sessions without leaking warnings.

v0.4.3

Choose a tag to compare

@owner888 owner888 released this 07 Oct 08:08

Changed

  • Streamlined TUI working status indicator by removing redundant (esc to interrupt) hint:
    • Aligned with upstream pi's minimal defaultWorkingMessage = "Working" and project UI minimalism principles.
    • Eliminates visual noise in the editor's top border: cleanly renders ⠋ Working... initially, and ⠋ Working... · 16s (or · 1m15s) as time elapses.

v0.4.2

Choose a tag to compare

@owner888 owner888 released this 07 Oct 08:01

Added

  • Added dynamic elapsed timer to TUI working, compaction, and branch summary status indicators:
    • Loader::withTimer() automatically calculates and formats elapsed duration in the top border: ⠋ Working... · 16s (esc to interrupt) (or · 1m15s after 60s).
    • Provides clear real-time feedback that long-running operations (deep model reasoning, large codebase searches, slow network API calls, and context compactions) are actively executing rather than frozen.
    • Enabled during turns (Working...), manual /compact, tree branch summarization, and auto-compaction, while preserving retry countdowns untouched.

v0.4.1

Choose a tag to compare

@owner888 owner888 released this 07 Oct 07:54

Added

  • Added automatic browser launch on in-session /web command:
    • Running /web or /web [port] in the interactive TUI starts the web interface and automatically opens the user's default system browser at http://127.0.0.1:<port>.
    • Re-running /web while the server is already running opens the browser at the existing server URL.
    • Background daemon and status commands (/web start, /web stop, /web status, /web restart) operate strictly in the terminal without opening unwanted browser windows.

v0.4.0 - PTY Terminals, SSH Workbench & Multi-Session Architecture

Choose a tag to compare

@owner888 owner888 released this 07 Oct 07:47

New Features

  • Interactive Local PTY Terminals & Web Terminal Drawer (PtyProcess, PtyManager, WebTerminal.js):
    • Native Unix pseudo-terminal execution using PHP's proc_open with ['pty'] descriptor on macOS/Linux with zero external C-extensions.
    • Non-blocking I/O integrated into Pig\Async\Loop, 16ms output micro-batching to prevent WebSocket frame storms, and slave PTY device detection (lsof on Darwin, /proc/$pid/fd/0 on Linux) with window resizing via stty + SIGWINCH.
    • Frontend integration with xterm.js and FitAddon multi-tab terminal drawer (accessible via Ctrl+\`` / Cmd+` or the top navigation terminal icon), with 200KB scrollback buffering and full support for interactive TUI tools (vim, nvim, nano, htop, tmux, less`).
  • SSH Node Workbench & SFTP Remote File Explorer/Editor (NodeWorkbench.js, NodeManager, NodeProfile):
    • Persistent node inventory in ~/.pig/agent/nodes.json and credentials in ~/.pig/agent/nodes-secrets.json (chmod 0600).
    • SHA-256 host key fingerprint detection (ssh-keyscan + ssh-keygen -lf) with verification and trust prompts.
    • Automatic OpenSSH ~/.ssh/config host discovery and one-click import.
    • Remote interactive SSH terminal streaming via PTY (ssh -tt) and SFTP remote directory listing, navigation, and file reading/writing (capped at 512 KiB).
  • Multi-Session Tab Multiplexing Architecture & Web Daemon:
    • Multiplexed multi-session tabs over a single physical WebSocket connection with per-tab chat scroll areas, background streaming indicators, and state recovery on reload.
    • Isolated pig --mode rpc child processes per cwd::sessionFile with 60s idle reaping and zero cross-session interference.
    • Native zero-dependency daemon management via pig web start|stop|status|restart [-d] and in-session /web restart, /web status, /web stop controls.
  • Telegram-style Language Packs & Client-Side i18n Engine:
    • Full bilingual client-side I18N dictionary with 101 symmetric keys (defaulting to zh-CN), instant zero-refresh language modal (#lang-btn), Telegram-style JSON import/export, and $pig->registerLocale() on ExtensionApi with /api/locales aggregation.

Added

  • Added externalEditor setting and intelligent fallback for Ctrl+G external prompt editing (aligned with upstream pi getExternalEditorCommand): precedence follows settings.externalEditor > $VISUAL > $EDITOR > platform fallback (notepad on Windows; nano / vim / vi on POSIX).
  • Added ExtensionApi Phase 2 parity: EventBus, lifecycle hooks, tool loadout, context/session control, UI capabilities, and cross-handler state sharing via $ctx->set(), $ctx->get(), and $ctx->has().
  • Added provider traffic hooks (before_provider_request, after_provider_response, before_retry) and dynamic provider registration (registerProvider), cleanly decoupling Google Antigravity into a standalone pure PHP extension.
  • Added session title telemetry and speed meter integration in FooterComponent (pwd (branch) • <session-name>), session_info JSONL persistence, and /name slash command.
  • Added model selection persistence control: session switches default to persistAsDefault: false (matching upstream pi), and Ctrl+S (app.models.save) explicitly saves the chosen model as global default.

Changed

  • Enhanced SessionManager::open() and SessionManager::describe() to use streaming line-by-line reading (fopen + fgets), reducing memory consumption on 70MB+ session files from >150MB to <10MB and preventing 128MB OOM crashes.
  • Optimized session tree backtrace (SessionManager::pathTo()) by replacing O(N) array_unshift with O(1) append + single array_reverse, speeding up 28,000-node tree traversal from 718ms to 3ms (230x speedup).
  • Optimized SessionManager::latestPathFor() with lightweight first-line sniffing, reducing pig -c session resume latency from 2275ms to 489ms.
  • Optimized LRU cache eviction in Width::visible() from O(N) array_shift to O(1) hash eviction (unset), speeding up cache updates by 5.0x with capacity expanded to 2048.
  • Aligned TextWrap::tokenize() with upstream pi's cjkBreakRegex for clean hyphenation and natural wrapping in mixed Chinese/English sentences.
  • Updated Chars::isPunctuation() with Unicode punctuation matching (^[\p{P}\p{S}]\z/u) to recognize CJK punctuation as word boundaries for Ctrl+W / Alt+Backspace.

Fixed

  • Fixed background fibers and subprocesses continuing to run on /quit while working: AgentSession::dispose() now cleanly aborts in-flight LLM streams, retries, compactions, and bash commands.
  • Fixed Broken pipe and SSL zero-write loops on non-blocking OpenSSL transport failures: expanded Retry::WORDS regex to catch native SSL, handshake, and connection errors, and encapsulated fwrite/fread in warning-capturing error handlers.
  • Fixed background process (&) pipe inheritance deadlock: added process state polling in Run::wait() to exit gracefully once the parent shell process terminates.
  • Fixed silent LLM turn failures in Web mode: serialized lastError in AgentEndEvent and enhanced client-side error rendering with automatic input restoration.
  • Fixed long quota reset errors displaying raw provider text: normalized to pi-style action guidance messages.
  • Fixed top-level symbol redeclaration crashes on /reload and guarded extensions with tokenized symbol checks.

v0.3.65

Choose a tag to compare

@owner888 owner888 released this 07 Oct 07:41

Added

  • Added externalEditor setting and intelligent fallback for Ctrl+G external prompt editing (aligned with upstream pi getExternalEditorCommand):
    • Added Settings::externalEditor() and setExternalEditor(?string) to support "externalEditor": "vim" (or "nvim", "code --wait") in ~/.pig/agent/settings.json.
    • Resolution precedence: settings.externalEditor > $VISUAL > $EDITOR > platform fallback (notepad on Windows; nano / vim / vi on POSIX).
    • Eliminates the previous hard failure Warning: No editor configured. Set $VISUAL or $EDITOR. when environment variables were not exported.

v0.3.64

Choose a tag to compare

@owner888 owner888 released this 07 Oct 07:28

New Features

  • Ported Interactive Local PTY Terminals, SSH Node Workbench, and SFTP File Explorer (aligned with youweichen/pi-web-ui / omp-web-ui):
    • Local PTY Terminal Engine (PtyProcess & PtyManager): Native pseudo-terminal execution using PHP's proc_open with ['pty'] descriptor on macOS/Linux with zero external C-extensions. Non-blocking I/O integrated into Pig\Async\Loop, 16ms output micro-batching to prevent WebSocket frame storms, slave PTY device detection with window resizing via stty + SIGWINCH, and 200KB scrollback buffering.
    • SSH Node Workbench (NodeProfile & NodeManager): Persistent inventory in ~/.pig/agent/nodes.json and credentials in ~/.pig/agent/nodes-secrets.json (chmod 0600), SHA-256 host key fingerprint detection (ssh-keyscan + ssh-keygen -lf) with verification and trust prompts, OpenSSH ~/.ssh/config discovery, remote PTY terminal streaming (ssh -tt), and SFTP remote directory listing/reading/writing (capped at 512 KiB).
    • Web UI Integration: Embedded xterm.js and FitAddon multi-tab terminal drawer (WebTerminal.js), #nodes-btn in header and mobile drawer, full-featured NodeWorkbench.js modal with remote terminal tabs and SFTP file explorer/editor, and bilingual i18n support.

v0.3.63

Choose a tag to compare

@owner888 owner888 released this 07 Oct 05:03

Fixed

  • Fixed startup model resolution ignoring extension-provided default providers: CodingAgent::session() resolved the startup model before loading extensions, so when settings.json configured an extension provider as defaultProvider (e.g. antigravity), resolution failed to find the unregistered provider and fell back to direct built-ins (e.g. google/gemini-3.8-flash). Extensions and custom providers are now loaded before model resolution runs.