- Upgraded brush-core from 0.3.5 to 0.4.0 and added brush-builtins 0.1.0 dependency to support new builtin command framework.
- Refactored shell execution to use new ExecutionResult and ExecutionControlFlow types from brush-core 0.4.0, replacing previous ExitCode-based approach.
- Updated system_info disk refresh to use new sysinfo 0.38 API with single refresh(true) call instead of separate refresh_list() and refresh() calls.
- Added tokio full-featured runtime dependency to support async operations in pi-natives.
- Updated phf from 0.11 to 0.13 with macros feature for improved perfect hash function support.
- Fixed UTF-16 string handling in text.rs to properly strip trailing null bytes before conversion.
- Replaced tokio::task::spawn_blocking with custom launch_task abstraction across clipboard, find, grep, html, image, and shell modules.
- Introduced new work module providing Rayon-backed task scheduling for blocking operations in N-API exports.
- Simplified error handling by removing redundant join error mapping and consolidating to single-level error propagation.
- Unified task spawning pattern across all native modules to use consistent launch_task API with wait() method.
- Added Shell class to persistent shell session management with session caching and abort capabilities.
- Added find() function for file discovery with glob pattern matching and optional streaming callbacks.
- Exported ImageFormat enum from main natives package for image encoding format selection.
- Reorganized native bindings into modular type files with declaration merging pattern for better maintainability.
- Refactored shell execution to use persistent Shell instances instead of stateless executeShell function calls.
- Enhanced SystemInfo type with additional fields for distro, kernel, CPU, and disk information.
- Refactored PhotonImage API from standalone functions to instance methods with simplified naming conventions.
- Renamed PhotonImage.new_from_byteslice() to parse() for a simpler, more intuitive factory method API.
- Converted PhotonImage.get_width() and get_height() methods to width and height getter properties.
- Consolidated four separate encoding methods (getBytes, getBytesJpeg, getBytesWebp, getBytesGif) into a single encode(format, quality) method.
- Moved resize() from a standalone function to a PhotonImage instance method.
- Added ImageFormat enum to specify encoding formats (PNG, JPEG, WEBP, GIF) in the encode method.
- Removed manual resource management via free() and Symbol.dispose, simplifying PhotonImage lifecycle.
- Expanded environment variable filtering to exclude bash function definitions and additional shell-specific variables that should not be inherited by child processes.
- Added session-based shell execution with persistent shell instances and session management via sessionKey parameter.
- Added support for shell snapshots to initialize bash sessions with saved state via snapshotPath parameter.
- Added sessionEnv option to set environment variables once per session, separate from command-specific env variables.
- Added process group management functions (process_group_id and kill_process_group) for better process lifecycle control on Linux, macOS, and Windows.
- Changed env option to apply variables for the current command only, with session-level variables now managed via sessionEnv.
- Refactored shell execution to use async output queuing with enqueueChunk for proper chunk sequencing and improved timeout handling with process group termination.
- Added native system information collection via new getSystemInfo() function in pi-natives crate using sysinfo library.
- Exported SystemInfo type and getSystemInfo() function from @oh-my-pi/pi-natives package for cross-platform system details.
- Migrated system information collection in coding-agent from shell-based commands to native Rust bindings for improved performance and reliability.
- Removed shell configuration retrieval from environment information display in coding-agent.
- Refactored system-prompt.ts to use native getSystemInfo() instead of platform-specific shell commands and helper functions.
- Added sysinfo 0.30 dependency to pi-natives crate for native system information gathering.
- Added native clipboard support with copyToClipboard() and readImageFromClipboard() functions using arboard library.
- Exported ClipboardImage type for clipboard image data with MIME type information.
- Migrated clipboard operations from shell commands to native arboard bindings for improved performance and reliability.
- Implemented Rust native module in pi-natives crate providing cross-platform clipboard access for Linux, macOS, and Windows.
- Added TypeScript bindings and type definitions for clipboard functionality in natives package.
- Added support for keypad navigation keys (0-9, decimal) in Kitty keyboard protocol parsing.
- Implemented keypad-to-navigation key mapping function that translates keypad codepoints to standard navigation keys (arrows, home, end, page up/down, insert, delete).
- Enhanced ParsedKittySequence struct with text_codepoint field to track text representation of keys.
- Improved key matching logic to apply keypad navigation mapping when text codepoint is absent.
- Extended parse_csi_u parser to extract and validate text codepoints from Kitty protocol sequences.
- Added new public `wrapTextWithAnsi()` function to wrap text to a visible width while preserving ANSI escape codes across line breaks.
- Implemented ANSI state tracking and restoration logic to maintain color and formatting codes when wrapping multi-line text.
- Migrated `wrapTextWithAnsi` implementation from tui package to pi-natives package for better code organization and reusability.
- Added comprehensive test coverage for ANSI color code preservation across wrapped lines.
- Replaced Node.js-based persistent shell sessions with direct native calls for improved reliability and streaming.
- Integrated `brush-core` and `os_pipe` into the `pi-natives` crate for shell command execution.
- Removed the `shell-session.ts` module and its corresponding test suite.
- Updated `bash-executor` to leverage the new native shell execution.
- Reorganized system prompt guidance for parallel task execution, moving coordinator section earlier and restructuring parallel_reflex section for improved clarity.
- Added native process tree killing and listing functions via new `ps` module in pi-natives crate with platform-specific implementations (Linux /proc, macOS libproc, Windows CreateToolhelp32Snapshot).
- Refactored process termination logic to prioritize native process tree killing when available, improving reliability of process cleanup across platforms.
- Removed detached process spawning across codebase (bash-executor, shell-session, kernel, lsp client, markitdown conversion) in favor of native process tree management.
- Simplified ptree module by removing managed children tracking and postmortem cleanup hooks, delegating process lifecycle management to native implementations.
- Added development mode support for native binary builds via `--dev` flag and `OMP_DEV` environment variable.
- Added `dev:native` npm script for building debug native binaries in development environments.
- Changed native binary build process to conditionally use debug or release profiles based on development mode flag.
- Changed native addon loader to prioritize debug builds when `OMP_DEV` environment variable is set.
- Refactored keyboard parsing functions in pi-natives to use const functions and guard clauses for improved code clarity.
- Migrated keyboard parsing and matching logic from JavaScript to native Rust implementation for improved performance.
- Exported new native functions parseKey, parseKittySequence, matchesLegacySequence, and matchesKey from @oh-my-pi/pi-natives package.
- Exported KeyEventType enum and ParsedKittyResult type for Kitty keyboard protocol support.
- Removed Key helper object from public API of @oh-my-pi/pi-tui package; users should now pass key identifiers as strings (e.g., 'ctrl+c' instead of Key.ctrl('c')).
- Added comprehensive keyboard parsing support in native layer including Kitty protocol, legacy terminal sequences, function keys, and modifier combinations.
- Added phf dependency for efficient perfect hash map lookups of legacy terminal escape sequences.
- Added native shell execution API via brush-core with streaming output support and configurable timeouts.
- Migrated bash executor from persistent ptree-based shell sessions to native bindings with improved performance and simplified architecture.
- Removed persistent shell session module and replaced with native brush-core implementation for better resource management.
- Added executeShell() and abortShellExecution() functions to native bindings for shell command execution with cancellation support.
- Implemented shell execution with support for environment variables, working directory changes, and timeout handling.
- Optimized grapheme width calculation with inline ASCII fast path detection.
- Renamed for_each_grapheme_u16 to for_each_grapheme_u16_slow to clarify it handles non-ASCII segments only.
- Removed segment_is_ascii_u16 helper function and inlined ASCII detection directly in hot loops.
- Refactored visible_width_u16_up_to, truncate_to_width, slice_with_width_impl, and extract_segments_impl to branch on ASCII vs non-ASCII segments separately.
- Improved grapheme_width_str to use pattern matching for single-character detection.
- Changed ANSI sequence tracking from saw_any_ansi to saw_sgr for more precise SGR code detection.
- Renamed `EllipsisKind` enum to `Ellipsis` across all packages for clearer API naming.
- Refactored Rust text module from 356 to 155 lines with simplified state tracking using u32 ColorVal instead of enum ColorCode and named attribute constants.
- Removed `Env` parameter from public NAPI functions `truncate_to_width` and `extract_segments` to simplify API surface.
- Changed return type of `truncate_to_width` from `JsString` to `Either<JsString, Utf16String>` to support zero-copy returns.
- Removed early return optimization in `truncateToWidth()` function.
- Reordered native module search paths to prioritize repository build artifacts over system paths.
- Changed TextInput type parameter to string in truncateToWidth(), visibleWidth(), sliceWithWidth(), and extractSegments() functions in native bindings.
- Removed TextInput type export from public API of pi-natives package.
- Removed format.ellipsis symbol from theme configuration, replacing all theme-based ellipsis references with hardcoded Unicode ellipsis character (...).
- Removed ellipsis property from SymbolTheme interface in pi-tui package.
- Removed truncateToWidth, sliceWithWidth, and extractSegments wrapper functions from pi-tui public API, now re-exporting directly from pi-natives.
- Added early return optimizations in truncateToWidth() and sliceWithWidth() native functions to skip native calls when possible.
- Added `visibleWidth()` function to measure visible text width while excluding ANSI codes.
- Optimized text processing from UTF-8 to UTF-16 implementation with direct JsString handling for improved performance.
- Refactored ANSI state tracking to use bitflags-based SgrState struct instead of individual boolean fields for more efficient storage.
- Introduced ColorCode enum to represent color codes (Basic, Indexed, Rgb) for better type safety.
- Added comprehensive test coverage for UTF-16 text processing, ANSI detection, and width calculations.
- Updated napi feature from 'napi8' to 'napi10' and added unicode-segmentation dependency.
- Added native Kitty keyboard protocol sequence matching via new `matchesKittySequence` function in pi-natives crate.
- Removed `visibleWidth` function from text utilities in favor of consistent Bun.stringWidth approach.
- Upgraded napi and napi-derive dependencies from version 2 to 3.
- Relaxed grep-regex, grep-searcher, and grep-matcher dependency version constraints to allow any 0.1.x version.
- Replaced unicode-segmentation dependency with bstr for improved byte-slice handling in text processing.
- Refactored text module to use byte-slice abstractions instead of string references for better performance and flexibility.
- Added sortByMtime option to FindOptions for native-level mtime-based sorting of file search results.
- Added streaming callback support (onMatch parameter) to grep() function for real-time match notifications.
- Added mtime field to FindMatch struct to expose file modification times in search results.
- Exported RequestOptions type from natives package for public API use.
- Implemented wrapRequestOptions utility for consistent timeout and abort signal handling across native functions.
- Fixed race condition in shell session where command completion could occur before stream data was fully processed.
- Added fuzzyFind native function for case-insensitive fuzzy file path searching with .gitignore support and configurable result limits.
- Exported FuzzyFindOptions, FuzzyFindMatch, and FuzzyFindResult types from @oh-my-pi/pi-natives for fuzzy search configuration and results.
- Replaced external fd binary dependency with native fuzzyFind implementation in autocomplete provider for improved performance.
- Implemented safeCopy function in native build script to prevent crashes when updating native binaries by using atomic-like file operations.
- Optimized grep search to use streaming readers instead of buffering entire files, reducing memory overhead for large files.
- Added thread-local caching to scope color computation in highlight module to avoid repeated prefix checks.
- Refactored text truncation from two-pass algorithm to single-pass streaming algorithm, eliminating intermediate vector allocations.
- Removed Arc overhead from image storage by storing DynamicImage directly and pre-allocating buffer capacity for encoding operations.
- Updated find tool to emit streaming match updates via callback and use native match metadata instead of redundant filesystem stats, improving performance.
- Added maxResults parameter to find tool to limit result set at the native layer.
- Optimized string handling in find.rs by replacing String allocations with Cow<'_, str> to avoid unnecessary copies when glob patterns don't contain backslashes on non-Windows systems.
- Refactored grep.rs to use Cow<'a, str> in normalize_relative_path() for conditional allocation, reducing memory overhead on non-Windows platforms.
- Extracted helper functions bytes_to_trimmed_string() and matches_case_insensitive() in grep.rs to reduce code duplication and improve maintainability.
- Converted multiple match statements to let...else syntax in grep.rs for cleaner error handling patterns.
- Restructured visible_width_impl() in text.rs to use a two-pass algorithm that separates ANSI escape sequence detection from width calculation for improved clarity.
- Added native find module for high-performance filesystem discovery with glob pattern matching and .gitignore support.
- Made grep, html, image, and text native functions asynchronous to prevent blocking the event loop.
- Updated native function names to use camelCase convention for JavaScript interoperability.
- Extended grep and text functions to accept Uint8Array/Buffer input for zero-copy operations.
- Delegated file discovery logic from JavaScript to native Rust implementation for improved performance.
- Migrated native bindings from WebAssembly (wasm-bindgen) to Node.js N-API architecture for improved performance and platform support.
- Replaced worker pool-based async architecture with synchronous native addon calls, eliminating thread overhead and simplifying the API.
- Added new grep module with ripgrep-backed filesystem search supporting parallel processing, glob filtering, and context line extraction.
- Updated build system to compile Rust crates to platform-specific .node binaries instead of WASM modules.
- Removed WASI implementation and worker pool infrastructure no longer needed with N-API native bindings.
- Updated CI/CD pipeline to build native addons for multiple platforms (Linux x64/arm64, macOS x64/arm64, Windows x64) and include them in releases.
- Added grep CLI subcommand with support for pattern matching, file globbing, context lines, and multiple output modes (content, files-with-matches, count).
- Added diff syntax highlighting support with distinct colors for inserted and deleted lines in code output.
- Implemented FileReader abstraction for cross-platform file reading with mmap support and 4MB size limit.
- Refactored worker pool initialization to support both compiled and development build environments using resolveWorkerSpecifier utility.
- Enhanced markdown rendering with improved inline style context handling and blockquote formatting with text wrapping.
- Replaced external strip-ansi dependency with Bun's built-in stripANSI method across all packages.
- Added `get_bytes_gif()` method to PhotonImage for exporting images as GIF bytes.
- Added `get_bytes_webp()` method to PhotonImage for exporting images as lossless WebP bytes.
- Enabled 'gif' and 'webp' features for the image crate dependency.
- Added `RequestOptions` interface to worker pool with support for `timeoutMs`, `signal`, and `transfer` properties.
- Added `stuckGracePeriodMs` configuration option to `WorkerPoolOptions` for graceful handling of stuck workers after timeout.
- Enhanced worker pool request method to accept `RequestOptions` object parameter instead of simple transfer array, enabling timeout and abort signal handling.
- Implemented comprehensive timeout and abort signal handling in worker pool with support for combined signals and grace period before force-terminating stuck workers.
- Removed html2text tool from coding agent in favor of native WASM html-to-markdown converter.
- Exported `RequestOptions` type from natives package public API.
- Added HTML to Markdown conversion functionality via new WASM binding in pi-natives crate with configurable options for content cleaning and image skipping.
- Exported htmlToMarkdown async function from @oh-my-pi/pi-natives package with worker pool support for efficient HTML to Markdown conversion.
- Integrated native WASM HTML to Markdown converter as the primary conversion method in fetch tool, replacing text-only rendering with markdown output.
- Added html-to-markdown-rs dependency to pi-natives crate for server-side HTML to Markdown conversion with preprocessing support.
- Added comprehensive test coverage for htmlToMarkdown function including headings, links, lists, code blocks, and conversion options.
- Added native syntax highlighting module powered by syntect library with ANSI color output support.
- Implemented highlightCode() function that applies syntax highlighting to code with language detection and customizable color themes.
- Implemented supportsLanguage() function to check if a given programming language is supported for syntax highlighting.
- Implemented getSupportedLanguages() function that returns list of all supported language identifiers.
- Replaced cli-highlight dependency with native syntect-based highlighting in coding-agent theme module.
- Added comprehensive language alias mappings supporting 50+ programming languages including TypeScript, Python, Rust, Go, C/C++, and web languages.
The nullish coalescing operator (??) was treating null as a fallback
trigger, causing getAskTimeout()'s null return value (meaning 'disabled')
to be replaced with DEFAULT_ASK_TIMEOUT_MS (30000ms).
Now explicitly checks for undefined to distinguish between:
- undefined: settingsManager unavailable → use default
- null: user explicitly disabled timeout → preserve null
- number: user-set timeout → use that value
- Added native text utilities in pi-natives (visible width, truncation, slicing, segment extraction)
- Wired pi-tui to use native implementations with short-string JS fast path
- Optimized key matching via cached parsed key ids
- Refactored visual truncation to reuse Text instances
- Reduced theme color lookups by switching from Map to plain records
- Regenerated WASM artifacts
Benchmarks (after vs before, lower is better):
- truncateToWidth/ansi: 20.37ms vs 38.13ms (2000 iters)
- sliceWithWidth/ansi: 5.12ms vs 20.39ms
- extractSegments/ansi: 8.92ms vs 27.60ms
- truncateToVisualLines: 3.51ms vs 411.55ms (500 iters)
- visibleWidth/ansi: 0.24ms vs 0.31ms
- Consolidated grep, find, and image processing into a new `@oh-my-pi/pi-natives` WASM package.
- Eliminated subprocess overhead and simplified JS tool implementations.
- Updated CI to include Rust workspace, linting, formatting, and WASM build steps.
- Documented `Promise.withResolvers()` and `using` declarations for wasm-bindgen.