Commit Graph

1566 Commits

Author SHA1 Message Date
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 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 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 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 a8bfd2ebe1 fix(coding-agent): fixed role override regression by consolidating multiple override calls
- Fixed role override regression by consolidating multiple override calls into a single operation to prevent intermediate state loss.
- Changed model role assignment in buildSessionOptions to use override with merged state instead of deprecated setModelRole method.
- Refactored multiple conditional override calls for smol, slow, and plan model roles to batch them into a single override call.
2026-02-01 12:36:56 +01:00
can1357 056f0bd22d feat(shell): migrated shell execution to native brush-core bindings with streaming support
- 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.
2026-02-01 11:33:42 +01:00
can1357 ad54335458 chore: bump version to 9.6.4 2026-02-01 11:18:12 +01:00
can1357 7493ed87b6 fix(coding-agent/tools): fixed null reference error in onMatch callback with type annotation update
- Added null check for match parameter in onMatch callback to prevent null reference errors.
- Updated match parameter type annotation from FindMatch to FindMatch | null to reflect actual usage.
2026-02-01 10:51:51 +01:00
can1357 b10adb92cb chore: bump version to 9.6.3 2026-02-01 10:41:26 +01:00
can1357 c52968a2f3 fix(coding-agent/ipy): fixed pythonPath typo and removed unused pythonwPath field
- Fixed typo in gateway coordinator where pythonwPath was referenced instead of pythonPath.
- Removed unused pythonwPath field from PythonRuntime interface and consolidated python executable resolution to use windowless python path directly.
2026-02-01 10:28:14 +01:00
can1357 b193bdcada chore: bump version to 9.6.2 2026-02-01 10:23:57 +01:00
can1357 e1bcf492a1 refactor: restructured text module and simplified NAPI API surface
- 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.
2026-02-01 10:23:41 +01:00
can1357 09225bc491 feat: refactored text truncation API to use string type and hardcoded ellipsis
- 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.
2026-02-01 10:01:56 +01:00
can1357 c8f106c58c feat(text): refactored text processing with UTF-16 optimization and ANSI state bitflags
- 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.
2026-02-01 09:34:54 +01:00
can1357 b91ab4bad0 chore: bump version to 9.6.1 2026-02-01 09:06:05 +01:00
can1357 2767c7e2a9 fix(tui/bench): fixed output handling and added visibleWidth benchmark suite
- Fixed output handling to prioritize text/markdown over text/plain when both are available, ensuring Markdown content is displayed correctly.
- Added comprehensive benchmark suite for visibleWidth implementations comparing native, Bun.stringWidth, and hybrid approaches across ASCII, ANSI, CJK, emoji, and mixed content scenarios.
2026-02-01 08:26:13 +01:00
can1357 5d80d0df7a chore: bump version to 9.6.0 2026-02-01 08:20:08 +01:00
can1357 696cd48f4e fix: backport fixes from pi-mono (52532c7c0..82d7da878)
packages/ai:
- fix: default tool call arguments to {} when nullish
- feat: add Vercel AI Gateway routing support

packages/tui:
- feat: add Ctrl+B/Ctrl+F cursor navigation keybindings
- feat: add character jump navigation (Ctrl+], Ctrl+Alt+])
- fix: support quoted paths with spaces in autocomplete

packages/coding-agent:
- feat: add set_session_name RPC command
- feat: add "none" option to doubleEscapeAction setting
- fix: respect .gitignore/.ignore/.fdignore when scanning package resources
- refactor: unified sessionTitle to sessionName across codebase
2026-02-01 08:14:40 +01:00
can1357 ef415e863b feat(coding-agent): refactored settings system with new singleton API and unified schema
- Replaced SettingsManager class with new Settings singleton providing synchronous get/set API and background persistence.
- Introduced settings-schema.ts as single source of truth for all configuration definitions with 100+ settings organized into logical groups.
- Migrated from method-based settings access (getTheme(), setTheme()) to path-based access using dot notation (settings.get('theme'), settings.set('theme', value)).
- Removed 2035-line settings-manager.ts file and replaced with modular settings.ts (693 lines) and settings-schema.ts (836 lines) for improved maintainability.
- Unified settings schema into single source of truth eliminating duplicate definitions across settings-defs.ts and settings-manager.ts.
2026-02-01 08:08:58 +01:00
can1357 c803338101 chore: bump version to 9.5.1 2026-02-01 06:27:00 +01:00
can1357 b126c275ec refactor(coding-agent): changed persistent shell to opt-in and added Bash settings tab 2026-02-01 06:04:01 +01:00
can1357 a1f674c156 chore: bump version to 9.5.0 2026-02-01 05:56:09 +01:00
can1357 32c6b22bbe feat: added sortByMtime, streaming grep callbacks, mtime field, RequestOptions export, and fixed shell race condition
- 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.
2026-02-01 05:52:12 +01:00
can1357 85535a514e feat(coding-agent/tools): added head/tail parameters to bash tool for native output limiting
- Added head and tail parameters to bash tool for native output limiting without piping.
- Implemented automatic normalization of bash commands to extract and strip head/tail pipes and stderr redirects.
- Created bash-normalize utility module with normalizeBashCommand and applyHeadTail functions for command processing.
- Updated bash tool documentation to recommend using head/tail parameters instead of piping through shell commands.
- Added comprehensive test coverage for bash command normalization and head/tail filtering functionality.
2026-02-01 05:27:24 +01:00
can1357 078db06bcb refactor(coding-agent/ipy): extracted Python runtime resolution logic into shared module
- Extracted Python runtime resolution logic from kernel and gateway-coordinator modules into a new shared runtime module.
- Centralized environment variable filtering, venv detection, and Python executable resolution into ipy/runtime.ts to eliminate code duplication.
- Moved DEFAULT_ENV_ALLOWLIST, WINDOWS_ENV_ALLOWLIST, DEFAULT_ENV_DENYLIST, and related environment configuration constants to the shared runtime module.
- Consolidated filterEnv(), resolveVenvPath(), and resolvePythonRuntime() functions into the shared runtime module for reuse across kernel and gateway-coordinator.
- Updated gateway-coordinator to use pythonw.exe (windowless Python interpreter) on Windows to prevent console window spawning.
2026-02-01 05:17:36 +01:00
can1357 1e52c837c8 feat(natives): added native addon distribution and platform validation to CLI update mechanism
- Added native addon distribution and installation support to the CLI update mechanism, enabling platform-specific native modules to be downloaded and installed alongside the main binary.
- Added platform validation in native addon loader to verify supported platforms (linux-x64, linux-arm64, darwin-x64, darwin-arm64, win32-x64) with helpful error messages for unsupported configurations.
- Enhanced native addon loading error messages to provide platform-specific troubleshooting guidance for both npm/bun installations and local development environments.
- Updated installation scripts (install.sh, install.ps1) to download and install native addon files alongside the main binary during CLI installation.
2026-02-01 05:17:06 +01:00
can1357 67fcf85518 test(coding-agent): added .git directory creation in gitignore test for proper setup
- Added .git directory creation in gitignore test to ensure proper test environment setup.
2026-02-01 05:01:47 +01:00
can1357 f494d2a68a docs(coding-agent/prompts): improved prompt formatting and removed redundant instructions
- Removed redundant instruction about preferring delegation in coordinator prompt.
- Improved task context template formatting with consistent markdown code fence markers.
- Removed dependencies section from task template constraints as it was redundant.
- Enhanced readability of task examples with better spacing and formatting.
2026-02-01 04:57:57 +01:00
can1357 25ca56c05c perf: optimized performance with streaming readers, single-pass algorithms, and reduced allocations
- 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.
2026-02-01 04:57:47 +01:00
Yigit Colakoglu eccf3ec051 fix(coding-agent/lsp): surface server exit errors and add per-server warmup timeout
Previously, any LSP server failure during initialize (process crash, missing
binary, rustup proxy error) was reported as a generic "timed out" message.
The process exit and its stderr were ignored; only the per-request timeout
fired, hiding the actual cause.

proc.exited now rejects all pending requests with the server's stderr output.
ptree already captures stderr and awaits its completion for non-zero exits,
so peekStderr() is reliable at this point. The first rejection wins the race
against the timeout; the other finds the request already removed and no-ops.

Also added warmupTimeoutMs to ServerConfig, allowing per-server override of
the global 5s warmup cap via lsp.json/lsp.yaml. Servers without it fall back
to WARMUP_TIMEOUT_MS as before.

Timeout error messages now include the configured duration for clarity when
they do legitimately fire.
2026-02-01 04:16:08 +01:00
can1357 b5e96526e3 feat: added native find module and made grep/html/image/text async with camelCase naming
- 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.
2026-02-01 03:10:24 +01:00
can1357 eabbde0c8a feat(natives): migrated native bindings from WASM to Node.js N-API with ripgrep-backed grep module
- 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.
2026-01-31 18:02:56 +01:00
can1357 e67e02947f docs(coding-agent/prompts): added phased execution guidance for migrations and refactors with WASM to N-API example
- Added phased execution guidance for migrations and refactors to prevent parallel work on dependent layers.
- Added example demonstrating phased execution pattern for porting WASM to N-API with sequential foundation, parallel implementation, integration, and dependent layer phases.
2026-01-31 15:45:00 +01:00
can1357 242c2d5cb7 feat(coding-agent/lsp): removed Nushell language server from LSP defaults
- Removed Nushell language server configuration from LSP defaults.
2026-01-31 15:44:18 +01:00
can1357 7bd876037d fix(coding-agent/web): disabled related questions in Perplexity search requests to fix unexpected behavior
- Disabled related questions in Perplexity search requests to fix unexpected behavior in search results.
2026-01-31 15:36:06 +01:00
can1357 12eeb63041 chore: bump version to 9.4.0 2026-01-31 14:02:24 +01:00
can1357 92abbe9363 refactor(coding-agent): migrated environment variable handling to centralized getEnv utilities
- Migrated environment variable handling to use centralized getEnv() and getEnvApiKey() utilities from pi-ai package.
- Removed environment variable denylist that previously blocked API keys from being passed to subprocesses.
- Simplified web search error messages by removing provider-specific configuration hints.
- Eliminated duplicate environment variable and .env file parsing logic across web search providers by delegating to centralized utilities.
2026-01-31 14:02:15 +01:00
can1357 cc90ed37f8 refactor: extracted padding logic into reusable utility function with optimized buffer allocation
- Extracted manual space padding logic into a reusable `padding()` utility function across all UI components and utilities.
- Optimized padding operations by introducing a pre-allocated 512-space buffer in the `padding()` function to reduce repeated string allocations.
- Updated all imports across 30 files to use the new `padding()` function from pi-tui instead of inline `' '.repeat()` calls.
- Renamed local variables from `padding` to `pad`, `padSize`, `indent`, or `linePad` to avoid naming conflicts with the imported `padding()` function.
- Exported the `padding()` utility function from the tui package index for public use.
2026-01-31 13:36:54 +01:00
can1357 9a22622f9c fix(coding-agent/web): fixed snippet field assignment in Anthropic search provider response parsing
- Fixed snippet field assignment to use undefined instead of encrypted_content in Anthropic search provider response parsing.
2026-01-31 13:27:42 +01:00
can1357 db3d41622c perf(coding-agent/tools): implemented caching in table and cell renderers to avoid redundant recalculations
- Implemented caching in table and cell results renderers to avoid redundant recalculations when width or cell data hasn't changed.
- Added cache invalidation logic to clear cached render results when cell data or spinner state changes.
2026-01-31 13:19:46 +01:00
can1357 735f808353 docs(coding-agent/prompts): updated task tool docs to clarify parent context access via searchable file
- Updated task tool documentation to clarify that subagents can access parent conversation context via a searchable file, reducing need to repeat information in context parameter.
- Revised critical instruction section to guide users toward leveraging searchable parent context file instead of requiring self-contained context.
2026-01-31 10:31:53 +01:00
can1357 3d0d010536 fix(coding-agent): guide plan mode to use edit tool for incremental updates 2026-01-31 10:29:22 +01:00
can1357 cdebcc6183 chore: bump version to 9.3.1 2026-01-31 10:04:26 +01:00
can1357 2fc19f69ca feat(coding-agent): added subagent context passing and automatic tool injection for agent sessions
- Added getCompactContext() API to agent session for accessing parent conversation context.
- Implemented automatic submit_result tool injection for subagents with explicit tool lists.
- Added contextFile parameter to ExecutorOptions for passing parent conversation context to subagents.
- Enhanced subagent system prompt with conditional context file instructions and improved code formatting.
- Removed schema override notification from task summary prompt to simplify output.
- Implemented formatCompactContext() method to format conversation history for subagent consumption.
2026-01-31 10:03:50 +01:00
can1357 7d0b8c80c8 chore: bump version to 9.3.0 2026-01-31 07:54:10 +01:00
can1357 2b39709f65 refactor(coding-agent): replaced getShellName() with SettingsManager.getGlobalShellConfig() for shell detection
- Removed getShellName() function and replaced with SettingsManager.getGlobalShellConfig() call for more accurate shell detection.
- Updated import to include SettingsManager from settings-manager module.
2026-01-31 07:53:41 +01:00