Commit Graph
75 Commits
Author SHA1 Message Date
can1357 e6079d562a fix: fixed cursor display, keyboard protocol, screen redraws, scrollback, and clipboard handling
- Fixed cursor display position in Input component during horizontal scrolling by calculating position relative to visible text window instead of using fixed halfWidth value.
- Fixed full-screen redraws optimization by tracking previous rendered line count and avoiding unnecessary full redraws when changes occur above the viewport.
- Fixed scrollback clearing behavior by removing scrollback clear sequence (3J) and only clearing screen content, preventing unintended terminal scroll events.
- Fixed OSC 52 clipboard emission to only occur in real terminal environments (TTY), preventing unnecessary output in piped or headless contexts.
- Fixed error handling for OSC 52 clipboard writes to gracefully handle EPIPE errors when stdout is closed or piped to processes that exit early.
2026-02-06 02:15:47 +01:00
can1357 103b419177 fix: fixed autocomplete, key parsing, editor tests, and quote border styling
- Fixed `.git` directory appearing in autocomplete suggestions when filtering by prefix.
- Refined codepoint matching logic in key parsing to exclude latin letters and known symbols when matching base codepoints.
- Corrected editor test width parameters to properly validate text wrapping and cursor positioning behavior.
- Updated quote border symbol from ASCII pipe to Unicode box-drawing character for improved visual presentation.
2026-02-06 02:12:37 +01:00
can1357 bfe175fc01 feat(natives): backported fixes from pi-mono (82d7da878..9ce00079) 2026-02-06 01:55:42 +01:00
can1357 d1ccb24e7e chore: bump version to 11.1.0 2026-02-05 08:27:52 +01:00
can1357 1a2e833974 feat: added Windows process handle duplication and signal handling for safe job termination
- Added Windows-specific process handle duplication mechanism to safely manage process termination across multiple handles.
- Implemented Windows signal handling support with Signal enum variants (Terminate, Kill, Interrupt) and kill_process() function using Windows API.
- Added background job termination on cancellation with platform-specific implementations (TERM/KILL signals on Unix, TerminateProcess on Windows).
- Implemented cancellation token support in shell execution with proper cleanup of background jobs when timeout or abort occurs.
- Added test coverage for background job termination on timeout and abort scenarios.
2026-02-05 08:10:52 +01:00
can1357 2993b68c15 fix(pi-natives): added graceful shutdown timeout before aborting shell tasks
- Added graceful shutdown timeout before aborting shell tasks to allow proper cleanup.
- Implemented 2-second timeout for task completion in run_shell_session before forceful abort.
- Implemented 2-second timeout for task completion in run_shell_oneshot before forceful abort.
- Added tokio_cancel.cancel() call in run_shell_oneshot cancellation path for consistency.
2026-02-05 07:49:32 +01:00
can1357 9a3b6115f1 fix(pi-natives): fixed bash session getting stuck on interrupt with proper task abort and cleanup
- Added explicit task abort and session cleanup to prevent bash session from getting stuck when interrupted.
- Ensured task is properly awaited after abort to allow graceful shutdown.
- Cleared session state on cancellation to prevent stale session references.
2026-02-05 06:21:56 +01:00
can1357 89092165bd feat(pi-natives/shell): enhanced Windows PATH handling with Git path detection and deduplication
- Added PATH environment variable merging on Windows to deduplicate and normalize path entries.
- Enhanced Git path detection to support multiple installation patterns (cmd, bin, usr/bin, mingw variants).
- Implemented path normalization and deduplication logic to prevent duplicate entries in PATH.
- Refactored Windows Git path discovery to return multiple candidate paths instead of single path.
2026-02-04 23:25:22 +01:00
can1357 c7d7bb5520 feat(grep): refactored grep tool to consolidate output modes and simplify parameters
- Removed `output_mode` parameter from grep tool, consolidating all output to content mode with file grouping and match headers.
- Renamed grep context parameters from `context_pre`/`context_post` to `pre`/`post` for improved clarity.
- Removed `n` (line numbers) parameter from grep tool as line numbers are now always displayed.
- Reformatted grep output to display numbered matches with file paths, line numbers, and context lines with consistent alignment.
- Introduced `SearchParams` struct in Rust grep implementation to simplify parameter passing and improve code maintainability.
- Made `normalize_env_key` function const-eligible for compile-time evaluation in shell module.
2026-02-04 23:24:15 +01:00
can1357 98fb1f9f3c feat: split grep context into separate before/after parameters with configurable defaults
- Split grep context parameter into separate contextBefore and contextAfter options for more granular control over context lines displayed before and after matches.
- Added configurable grep context defaults via grep.contextBefore and grep.contextAfter settings with reduced default values (1 line before, 3 lines after).
- Updated grep tool schema to use context_pre and context_post parameters instead of unified context parameter.
- Maintained backward compatibility by keeping legacy context field in SearchOptions and GrepOptions structs.
- Added resolve_context() function to handle logic for choosing between separate before/after context values or legacy unified context value.
2026-02-04 23:10:10 +01:00
can1357 4d772bee75 fix(pi-natives): added environment variable key normalization on Windows for case-insensitive PATH handling
- Added environment variable key normalization on Windows to handle case-insensitive PATH variable correctly.
- Introduced normalize_env_key() function with platform-specific implementations to normalize environment variable keys before setting them in the shell session.
2026-02-04 23:02:36 +01:00
can1357 927cc77795 chore: bump version to 10.5.0 2026-02-04 12:06:50 +01:00
can1357 fb5f8a72a4 fix(brush-core-vendored): fixed Windows build errors for newer Rust
- Added windows_by_handle feature flag for MetadataExt methods
- Changed OnceCell to OnceLock in is_root() for static compatibility
- Fixed HWND/HANDLE pointer comparisons to use .is_null()
2026-02-04 11:11:22 +01:00
can1357 24aca1f169 feat(brush-core-vendored/sys): implemented Windows-specific command execution
- Implemented Windows-specific command execution utilities with CommandExt, ExitStatusExt, CommandFdInjectionExt, and CommandFgControlExt traits for process group and foreground control.
- Implemented Windows terminal configuration management with Config struct, from_term(), apply_to_term(), and terminal control methods including parent process ID and foreground window detection.
- Replaced stub implementations with actual Windows API calls for file permission checking (readable/writable) and device/inode retrieval in fs module.
- Implemented proper Windows elevation detection in is_root() using Windows API token information queries instead of always returning false.
2026-02-04 11:07:00 +01:00
can1357 36b27fb8c7 fix(brush-core-vendored/sys): fixed Windows PATH parsing and added System32 to executable search paths
- Trimmed quotes from PATH entries to handle Windows paths with quoted directories.
- Added System32 directory to default executable search paths on Windows.
- Implemented system32_path() helper function to resolve SystemRoot environment variable.
2026-02-04 10:42:21 +01:00
can1357 b9938ada49 refactor(brush-core-vendored): fixed PATHEXT handling for Windows executable discovery
- Refactored ExecutablePathSearch to remove generic type parameter N and use pre-computed filename candidates instead of single filename.
- Extracted platform-specific candidate_filenames() functions to generate executable filename variants on Windows and Unix-like systems.
- Replaced manual PATH string splitting with std::env::split_paths() for cross-platform path parsing.
- Simplified find_in_path() method to delegate to pathsearch::search_for_executable() instead of custom path searching logic.
- Implemented executable_extensions() function with lazy initialization to parse PATHEXT environment variable on Windows.
- Enhanced executable() method to validate file extensions against known executable extensions instead of returning hardcoded true.
2026-02-04 10:37:51 +01:00
can1357 315cd35958 feat(coding-agent/mcp): added TUI rendering for MCP tool calls and results with JSON tree display
- Added renderCall and renderResult methods to MCPTool and DeferredMCPTool classes for TUI rendering of tool calls and results.
- Created new mcp/render.ts module providing JSON tree rendering functionality with configurable depth and line limits for terminal display.
- Updated renderResult signature in custom tool and extension types to accept optional args parameter for accessing original tool arguments during result rendering.
- Fixed method binding in extension and hook tool wrappers by applying .bind(tool) to renderCall and renderResult methods to preserve correct 'this' context.
- Added filter to skip .git directories in fuzzy_find_sync function to improve search performance.
2026-02-03 21:59:54 +01:00
can1357 1600df2a23 fix(brush-core-vendored): resolve conflicting PathExt impl on Windows
Added #[cfg(not(windows))] to stubs/fs.rs PathExt implementation.
On Windows, both stubs (not unix) and windows modules were compiled,
causing duplicate impl PathExt for Path. Now Windows uses only
windows/fs.rs while WASM still uses stubs.
2026-02-03 12:07:09 +01:00
can1357 b2dba503b0 fix(platform): handled windows null and crash logs 2026-02-03 11:54:49 +01:00
d0e131bb5c fix(shell): use NUL device on Windows instead of /dev/null (#7)
Co-authored-by: ou23h4rfuiyh3e5rg <ou23h4rfuiyh3e5rg@users.noreply.github.com>
2026-02-03 11:52:35 +01:00
can1357 41e4d5a0b1 feat(task-scheduling): refactored task scheduling with CancelToken, renamed find() to glob(), and unified async cancellation
- Introduced new task scheduling system with CancelToken for cooperative cancellation, replacing Rayon-based work scheduling with libuv thread pool integration.
- Added Cancellable interface with timeoutMs and signal properties for unified timeout and abort signal handling across all async operations.
- Converted async functions (clipboard, html, image, shell, grep, glob) to synchronous functions returning task::Async wrappers for consistent cancellation semantics.
- Removed abortShellExecution() function and executionId tracking in favor of centralized CancelToken-based cancellation.
- Simplified htmlToMarkdown() signature by removing RequestOptions parameter and delegating cancellation to Cancellable interface.
2026-02-02 03:26:36 +01:00
can1357 68992fbbf3 perf(pi-natives): optimized memory allocations by replacing Vec with SmallVec across modules
- Replaced heap-allocated Vec with stack-allocated SmallVec in grep module for context lines and type filters to reduce allocations.
- Optimized process tree data structure in ps module from Vec to SmallVec with capacity 4 for typical process child counts.
- Changed shell module to use SmallVec for process IDs collection, reducing heap allocations in abort operations.
- Refactored text module to use SmallVec for token and line collections, avoiding heap allocations for typical text wrapping scenarios.
- Increased work profiler stack capacity from 2 to 4 elements and optimized stack collection using iterator copy.
- Added work profile capture to debug report bundle for improved profiling insights.
2026-02-01 22:08:02 +01:00
can1357 951fc48eba feat(work): added work scheduling profiler with circular buffer sampling and flamegraph visualization
- Added work scheduling profiler with always-on circular buffer sampling to track CPU scheduling patterns and task execution times.
- Added `getWorkProfile()` native function to retrieve profiling data including folded stacks, markdown summary, SVG flamegraph, and metrics for the last N seconds.
- Added work profile debug menu item to visualize CPU scheduling patterns via flamegraph in the coding agent.
- Added work profile support to report bundles with folded stacks, summary, and flamegraph visualization.
- Updated `launch_blocking()` and `launch_async()` functions to accept task name tags for profiling instrumentation.
- Added dependencies on inferno, smallvec, and heapless crates for profiling infrastructure.
2026-02-01 22:04:15 +01:00
can1357 529ba004b7 refactor(pi-natives): restructured shell session management to use per-instance sessions and u64 identifiers
- Refactored shell session management to use per-instance sessions instead of global session map.
- Changed execution and shell identifiers from strings to u64 for improved performance and type safety.
- Simplified ExecutionControl struct to remove session_key field and use shell_id instead.
- Extracted ShellConfig struct to consolidate session configuration parameters.
- Refactored read_output function to use async I/O with improved UTF-8 handling and buffer management.
- Removed global SESSIONS map and session counter in favor of per-instance Arc-wrapped session storage.
2026-02-01 21:35:52 +01:00
can1357 1e32ffc0eb chore(pi-natives): updated winreg dependency from 0.52 to 0.55
- Updated `winreg` dependency from 0.52 to 0.55 for Windows registry access.
2026-02-01 21:35:31 +01:00
can1357 ad37a58b5f feat(scripts): added job-level status checking in CI watcher with auto log tailing for failures
- Added job-level status checking in CI watcher to fail fast on first job failure with detailed error reporting.
- Added automatic log tailing for failed CI jobs showing last 20 lines of output.
2026-02-01 20:34:12 +01:00
can1357 c8d5ada528 chore: bump version to 10.0.0 2026-02-01 19:38:28 +01:00
can1357 654ee503f7 feat(brush-core-vendored): added process cancellation support with CancellationToken and platform-specific termination
- Added process cancellation support via optional CancellationToken parameter to wait() methods across process execution layers.
- Implemented platform-specific process termination using SIGKILL on Unix and TerminateProcess on Windows when cancellation is triggered.
- Added ProcessWaitResult::Cancelled variant to represent cancelled process execution with exit code 130.
- Added windows-sys dependency with Win32_Foundation and Win32_System_Threading features for Windows process termination support.
- Removed process_id_tracker and process_group_id_tracker fields from ExecutionParameters struct to simplify process tracking.
2026-02-01 19:27:33 +01:00
can1357 00e743cb29 feat(pi-natives/shell): added Windows PATH configuration for Git usr/bin directory detection
- Added Windows PATH configuration to automatically detect and include Git's usr/bin directory in the shell environment.
- Added winreg dependency for Windows registry access to locate Git installations.
2026-02-01 19:17:07 +01:00
can1357 592e5e2191 feat(shell): added interactive shell console and cancellation token support to CLI
- Added interactive shell console subcommand to coding-agent CLI with support for working directory, timeout, and snapshot configuration.
- Added cancellation token support to ExecutionContext and ExecutionParameters for graceful shell execution interruption.
- Implemented cancellation checks throughout AST execution pipeline (Program, CompoundList, AndOrList, Pipeline, and all command types) to enable responsive interruption.
- Replaced process tracking mechanism with tokio_util CancellationToken for improved async cancellation handling.
- Added tokio-util 0.7.16 dependency to pi-natives crate for cancellation token support.
2026-02-01 19:16:57 +01:00
can1357 49a24cf27b build(deps): vendored brush-core crate locally for development and patching
- Vendored brush-core crate locally to enable local development and patching.
- Added patch.crates-io section in Cargo.toml to redirect brush-core dependency to vendored version at crates/brush-core-vendored.
- Updated pi-natives Cargo.toml to use local path dependency for brush-core instead of external crate version.
2026-02-01 19:04:16 +01:00
can1357 06ef6e18e8 refactor(pi-natives): simplified timeout handling logic in TimeoutCommand by consolidating result handling
- Simplified timeout handling logic in TimeoutCommand by consolidating result handling and eliminating redundant state tracking.
2026-02-01 17:41:09 +01:00
can1357 52af39f7a5 build(pi-natives): enabled wayland-data-control feature for arboard clipboard library
- Enabled wayland-data-control feature for arboard clipboard library.
2026-02-01 17:21:07 +01:00
can1357 0088def795 style(pi-natives): refactored code formatting and import organization across native modules
- Reformatted fuzzy_find function body to single line with consistent indentation.
- Wrapped PhotonImage::new documentation comment to approximately 80 characters.
- Reordered import statement for brush_builtins to appear before brush_core imports.
- Moved SAFETY comment in text.rs to immediately precede the unsafe block it documents.
- Updated string formatting from positional arguments to inline variable syntax.
2026-02-01 17:17:38 +01:00
can1357 feb3a51d1e feat(deps): upgraded brush-core to 0.4.0 and refactored shell execution with new types
- 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.
2026-02-01 16:51:06 +01:00
can1357 89df02edbc refactor(pi-natives): replaced tokio::task::spawn_blocking with unified launch_task abstraction
- 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.
2026-02-01 15:52:22 +01:00
can1357 96b83875f4 feat: refactored native bindings into modular types with persistent shell sessions
- 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.
2026-02-01 15:48:05 +01:00
can1357 e042823697 feat: refactored PhotonImage API to instance methods with simplified naming
- 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.
2026-02-01 15:20:19 +01:00
can1357 df1a8bfe02 fix(pi-natives): expanded environment variable filtering to exclude bash function definitions
- Expanded environment variable filtering to exclude bash function definitions and additional shell-specific variables that should not be inherited by child processes.
2026-02-01 15:04:49 +01:00
can1357 44424fdeb1 feat(shell): added session-based shell execution with persistent instances and process group management
- 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.
2026-02-01 15:01:43 +01:00
can1357 5edbf98281 feat(system-info): migrated system info collection to native Rust bindings
- 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.
2026-02-01 14:56:27 +01:00
can1357 df118b0b50 feat(clipboard): added native clipboard support with arboard library integration
- 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.
2026-02-01 14:55:17 +01:00
can1357 12e6b2d7c9 feat(pi-natives): added keypad navigation support to Kitty keyboard protocol parsing
- 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.
2026-02-01 14:38:54 +01:00
can1357 17259e4afd feat: fixed word wrap not retaining line style with ANSI code preservation
- 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.
2026-02-01 14:13:40 +01:00
can1357 f6261fc4b9 feat(shell)!: migrated bash execution to native brush-core bindings
- 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.
2026-02-01 13:41:49 +01:00
can1357 df789022ac fix(natives): removed unused ptr import on windows 2026-02-01 13:23:54 +01:00
can1357 11c7939177 chore: bump version to 9.7.0 2026-02-01 13:23:01 +01:00
can1357 c537523212 docs(coding-agent/prompts): reorganized system prompt guidance for parallel task execution
- Reorganized system prompt guidance for parallel task execution, moving coordinator section earlier and restructuring parallel_reflex section for improved clarity.
2026-02-01 13:21:03 +01:00
can1357 6896802d75 feat(process-management): implemented native process tree management with platform-specific implementations
- 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.
2026-02-01 13:18:14 +01:00
can1357 66da3e8759 feat(natives): added development mode support for native binary builds with debug profiles
- 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.
2026-02-01 12:56:44 +01:00