Commit Graph

2136 Commits

Author SHA1 Message Date
can1357 1f6c61ac3a feat(ai): added OpenCode Zen provider and updated AI model configurations
- Added OpenCode Zen provider with API key-based authentication supporting multiple AI models.
- Added four new free models via OpenCode provider: glm-4.7-free, kimi-k2.5-free, minimax-m2.1-free, and trinity-large-preview-free.
- Added glm-4.7-flash model via Zai provider.
- Updated pricing and configuration for multiple models across Kimi, MiniMax, OpenRouter, Anthropic, Vercel AI Gateway, and Zai providers.
- Removed google/gemini-2.0-flash-exp:free from OpenRouter and stealth models from Vercel AI Gateway.
2026-01-31 02:11:23 +01:00
can1357 5280292306 docs: retrospective changelog maintenance for recent commits 2026-01-31 01:57:20 +01:00
can1357 26d50f370e fix(coding-agent/session): improved OAuth token refresh error handling and agent error reporting
- Improved OAuth token refresh error handling to distinguish between definitive auth failures and transient errors.
- Added logic to only remove credentials for definitive failures (invalid_grant, revoked, expired tokens) while temporarily blocking credentials for transient errors like network timeouts.
- Enhanced error message handling in commit agent to display error messages when stopReason is 'error'.
- Added debug stack trace output for agent errors when DEBUG environment variable is set.
2026-01-31 01:39:38 +01:00
can1357 4e4fb944c5 chore: bump version to 9.2.1 2026-01-31 01:35:32 +01:00
can1357 7233c4c8af fix: added windowsHide option to child process spawn calls
- Added `windowsHide: true` option to all child process spawn calls to prevent console windows from appearing on Windows systems.
2026-01-31 01:35:10 +01:00
can1357 ff8ec3426c chore: bump version to 9.2.0 2026-01-31 01:29:50 +01:00
can1357 a07f38b16e feat(grep): added grep CLI, diff highlighting, FileReader abstraction, and markdown improvements
- 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.
2026-01-31 01:27:36 +01:00
can1357 d1a18a29e5 feat: added Kimi Code provider with OpenAI and Anthropic API format support
- Added Kimi Code provider with support for both OpenAI and Anthropic API formats.
- Added kimiApiFormat configuration option to allow users to select between 'openai' and 'anthropic' API formats for Kimi Code provider.
- Added Kimi API format setting in the tools configuration tab with descriptions for each format option.
- Refactored Anthropic provider authentication logic to support multiple API endpoints including Kimi's Anthropic-compatible API.
- Updated OpenAI completions provider to route direct Kimi models to dedicated Kimi provider implementation.
2026-01-30 23:09:28 +01:00
can1357 687cf413e6 feat(coding-agent/tools): simplified find tool API by consolidating path and pattern parameters
- Simplified find tool API by removing separate `path` parameter and consolidating pattern parsing into a single `pattern` parameter that includes the search path.
- Added automatic recursive search for simple patterns like `*.ts` by implicitly prefixing them with `**/` when no explicit path is provided.
- Implemented `parsePatternPath()` function to intelligently extract base directory and glob pattern from user input, supporting patterns like `src/**/*.tsx`, `lib/*.json`, and `*.md`.
2026-01-30 18:33:40 +01:00
can1357 3f3e696e3e fix(ai/providers): fixed rate limit issues with Kimi models by always sending max_tokens
- Fixed rate limit issues with Kimi models by always sending max_tokens parameter, which Kimi uses for TPM calculation regardless of actual output.
- Added detection for Kimi models (kimi-code provider or moonshotai/kimi ID) to apply the max_tokens workaround.
2026-01-30 18:09:31 +01:00
can1357 27d7e66be6 chore: bump version to 9.1.1 2026-01-30 01:27:47 +01:00
can1357 d972f3dcb9 refactor(tui): restructured box component cache and consolidated image line detection logic
- Consolidated box component cache state from four separate properties into a single typed Cache object with key, width, bgSample, and result fields.
- Extracted image line detection logic into centralized TERMINAL_INFO.isImageLine() method, removing duplicate containsImage() implementations from Markdown and TUI classes.
- Simplified cache validation in box component by introducing matchCache() method to compare current parameters against cached values.
- Removed trimStart() call from TerminalInfo.isImageLine() to check image protocol at line start without whitespace stripping.
2026-01-30 01:27:28 +01:00
can1357 cdb4f72cbc chore: bump version to 9.1.0 2026-01-30 01:13:03 +01:00
can1357 599c0dfe38 refactor(tui): restructured terminal capabilities from interface-based to class-based model
- Replaced interface-based terminal capabilities with class-based TerminalInfo model.
- Converted ImageProtocol from union type to enum with escape sequence values.
- Removed detectCapabilities, getCapabilities, and resetCapabilitiesCache functions in favor of eager TERMINAL_ID and TERMINAL_INFO constants.
- Introduced TerminalId type and KNOWN_TERMINALS registry for terminal detection.
- Updated renderImage and TUI.queryCellSize to use TERMINAL_INFO directly instead of calling getCapabilities().
- Updated exports in index.ts to reflect new API surface.
2026-01-30 01:12:28 +01:00
can1357 aaca60ea81 feat(coding-agent/config): added fuzzy matching for model resolution with scoring and ranking fallback
- Added fuzzy matching for model resolution with scoring and ranking fallback logic.
2026-01-30 01:07:02 +01:00
can1357 47dc81720c feat(natives/wasm): added GIF and WebP export methods to PhotonImage
- 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.
2026-01-30 01:06:49 +01:00
can1357 8248b9e5ef feat(coding-agent/debug): added 'Open: artifact folder' menu option to debug selector for quick access to session artifacts
- Added 'Open: artifact folder' menu option to debug selector for quick access to session artifacts.
- Implemented handleOpenArtifacts() method to open session artifact directories in the native file manager with cross-platform support (macOS, Windows, Linux).
- Added fs/promises import for directory existence validation.
2026-01-30 01:04:54 +01:00
can1357 f28d0bc507 chore: bump version to 9.0.0 2026-01-30 00:23:37 +01:00
can1357 bf891b329c fix: backport fixes from pi-mono (9f3eef65f..52532c7c0)
packages/ai:
- fix: handle "sensitive" stop reason from Anthropic API
- fix: normalize tool call IDs with special characters for Responses API
- fix: add overflow detection for Bedrock, MiniMax, Kimi providers
- fix: 429 status is rate limiting, not context overflow

packages/tui:
- fix: refactored autocomplete state tracking
- fix: file autocomplete should not trigger on empty text
- fix: configurable autocomplete max visible items
- fix: improved table column width calculation with word-aware wrapping

packages/coding-agent:
- fix: preserve external config.yml edits on save (#1046 by @nicobailonMD)
- fix: resolve macOS NFD and curly quote variants in file paths
2026-01-30 00:22:13 +01:00
can1357 fa68a6606b chore: bump version to 8.13.0 2026-01-29 23:35:38 +01:00
can1357 ddb617e3f5 feat: enhanced worker pool with timeout/abort handling and replaced html2text with WASM converter
- 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.
2026-01-29 23:35:02 +01:00
can1357 0eaa18c15b feat(html-to-markdown): added bundled HTML-to-Markdown conversion via Rust natives
- 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.
2026-01-29 23:25:56 +01:00
can1357 818ebc5d4e fix(coding-agent/lsp): exposed LSP server startup errors in session display and logs
- Added error field to LSP server status types throughout the mode context chain.
- Updated /session command to display the actual error message when an LSP server fails to start.
- Added logger.warn call during LSP warmup to log server startup failures to ~/.omp/logs/.
2026-01-29 23:16:41 +01:00
can1357 7d715a92d3 feat(coding-agent/web): added Codex and Gemini web search providers with OAuth and grounding support
- Added Codex web search provider with OAuth credential management and SSE streaming support.
- Added Gemini web search provider with Google Search grounding and citation extraction.
- Extended WebSearchProvider type to include 'gemini' and 'codex' providers.
2026-01-29 23:12:14 +01:00
can1357 ff457d2319 refactor(coding-agent): consolidated signal handling with ptree.combineSignals across scrapers and tools
- Consolidated signal and timeout handling by replacing custom createRequestSignal utility with ptree.combineSignals across all scrapers and tools.
- Refactored ensureTool function to accept signal parameter through options object, enabling cancellation of tool installation and execution.
- Migrated all tool execution calls from Bun's $ template syntax to ptree.exec with explicit signal and error handling options.
- Simplified HTML rendering strategy in fetch.ts to use ptree.combineSignals for timeout management and added jina.ai integration as primary rendering method.
- Removed redundant abort checks throughout youtube.ts scraper, consolidating signal handling to rely on ptree.exec signal-based timeout mechanism.
2026-01-29 23:06:05 +01:00
can1357 54697dbfaa fix(coding-agent/session): improved error handling and security in agent storage initialization
- Added error handling for database initialization failures with detailed diagnostics including directory existence and writability checks.
- Improved directory creation in ensureDir() with proper error handling for EEXIST conditions and post-creation verification.
- Set restrictive file permissions (0o700) on created agent storage directories for improved security.
- Optimized applyLineResets() in TUI to use in-place array modification instead of creating new array via map().
2026-01-29 22:33:27 +01:00
can1357 094e37b24d feat(tui): added /debug command with triage menu and image detection capabilities
- Added `/debug` slash command with interactive menu for bug report triage and system diagnostics.
- Added `containsImage()` method to `TerminalCapabilities` interface to detect image sequences in terminal output.
- Refactored terminal capability detection to use shared capability objects, reducing duplication and improving maintainability.
- Migrated `TUI.containsImage()` from instance method to static method delegating to capabilities detection.
2026-01-29 16:14:28 +01:00
can1357 5503560d68 feat(coding-agent/debug): added interactive debug command with profiling and diagnostics
- Added interactive `/debug` command with menu-driven interface for bug report triage and system diagnostics.
- Implemented CPU profiling workflow allowing users to capture performance profiles during issue reproduction.
- Added heap snapshot generation for memory issue analysis and debugging.
- Implemented debug report bundle creation with session data, logs, system info, and optional profiling artifacts.
- Added system information collection and display including OS, CPU, memory, and version details.
- Implemented artifact cache management with size statistics and cleanup functionality.
2026-01-29 16:00:36 +01:00
can1357 d1be6e541b chore: bump version to 8.12.10 2026-01-29 15:43:01 +01:00
can1357 6665b0dfaa fix(coding-agent): fixed linter issues and reorganized imports for consistency
- Fixed incorrect byte and line limit calculations in file read tool that were applying user limits to total selected content instead of just user-limited content.
- Updated test to use SettingsManager.getGlobalShellConfig() instead of shell.getShellConfig() for consistent shell configuration access.
- Reorganized import statements across multiple files for consistency and alphabetical ordering.
- Changed firstLinePreviewChunks from let to const in read tool since it is only mutated via array methods.
2026-01-29 15:41:35 +01:00
can1357 de7f43f3d2 refactor(coding-agent/tools): restructured file reading logic to process bytes directly and improve memory efficiency
- Refactored file reading logic to process bytes directly instead of decoding entire chunks into strings, improving memory efficiency and enabling better line boundary detection.
- Restructured line collection state management with dedicated helper functions (setupLineState, appendSegment, finalizeLine, decodeLine) for clearer control flow and byte tracking.
- Enhanced byte limit tracking to accurately count selected lines and bytes separately, fixing calculation of truncation metadata.
- Added firstLinePreview and firstLineByteLength fields to streamLinesFromFile return type to support better handling of oversized first lines.
- Improved firstLineExceedsLimit detection to use actual byte length instead of relying on empty collection state.
2026-01-29 15:37:01 +01:00
can1357 3f59a73b83 refactor: restructured TUI and file streaming APIs with WASM optimization
- Removed TUI layout engine exports from public API surface.
- Replaced Bun.file().stream() with fs/promises for manual buffer reading in file streaming.
- Added AbortSignal support to streamLinesFromFile for cancellation capability.
- Removed stdin monitoring feature that detected stalled input after 10 seconds.
- Removed cli-highlight and highlight.js dependencies from lock file.
- Rebuilt WASM module with reduced binary size (2.1% reduction).
2026-01-29 15:16:37 +01:00
can1357 48b6bb0986 refactor(utils): extracted process management utilities into dedicated procmgr module
- Extracted process management utilities from coding-agent shell module into dedicated procmgr module in utils package.
- Migrated shell configuration retrieval to SettingsManager class with new getGlobalShellConfig() static method.
- Replaced custom killProcessTree() implementation with new terminate() function supporting graceful shutdown with timeout and AbortSignal.
- Updated ptree.ChildProcess to use generic type parameter for input stream masking and delegated process termination to procmgr.terminate().
- Centralized process management across coding-agent modules to use SettingsManager and procmgr utilities instead of standalone shell functions.
2026-01-29 15:07:06 +01:00
can1357 37d5b69250 feat(highlight): replaced cli-highlight with rust-based syntax highlighting
- 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.
2026-01-29 12:01:11 +01:00
can1357 e6e217c8f1 chore: bump version to 8.12.9 2026-01-29 11:33:27 +01:00
can1357 8169289941 feat(tui): added stdin monitoring to detect stalled input events and log warnings
- Added stdin monitoring to detect stalled input events and log warnings when no input is received for 10 seconds.
- Added private methods startStdinMonitor() and stopStdinMonitor() to manage stdin event monitoring lifecycle.
- Added lastStdinEvent and stdinMonitor instance variables to track stdin activity.
2026-01-29 11:33:17 +01:00
can1357 f45d894692 fix(tui): simplified terminal write error handling to mark terminal as dead on any write failure
- Simplified terminal write error handling to mark terminal as dead on any write failure instead of only on EIO errors.
2026-01-29 11:31:08 +01:00
can1357 6d23309f14 chore: bump version to 8.12.8 2026-01-29 11:19:52 +01:00
can1357 2ae12a7cee fix(tui): split multi-line strings in renderOutputBlock to prevent width overflow
Multi-line bash commands (e.g., for loops with newlines) were being passed
as single "lines" to renderOutputBlock. Since visibleWidth() treats newlines
as width 0, truncateToWidth() calculated incorrect truncation points. The
result was rendered lines with embedded newlines that exceeded terminal width,
causing "Rendered line N exceeds terminal width" crashes.

Split section lines by newlines before processing so each line gets properly
truncated and wrapped with box borders.
2026-01-29 11:19:33 +01:00
can1357 2aa046c053 chore: bump version to 8.12.7 2026-01-29 11:03:59 +01:00
can1357 2c85f43709 refactor(utils): renamed packages/pi-utils to packages/utils
- Renamed package directory from packages/pi-utils to packages/utils.
- Updated all path aliases and references in tsconfig.base.json to reflect new package location.
- Updated workspace references in bun.lock and package.json to point to new packages/utils directory.
- Updated documentation and build scripts to reference the renamed utils package.
2026-01-29 11:03:27 +01:00
can1357 269681518a docs: documented WASM bindings and reformatted agent commands table
- Added documentation for new `packages/natives` WASM bindings package.
- Added documentation for new `crates/pi-natives` Rust WASM crate.
- Reformatted Commands section in AGENTS.md as a structured table for clarity.
- Updated package structure table with improved formatting and alignment.
- Added Rust language badge to README.md.
2026-01-29 10:59:04 +01:00
can1357 32bc2b8d02 fix: fixed LSP server display, file streaming, and slash command autocomplete; reorganized npm scripts
- Fixed LSP servers showing as 'unknown' in status display when server warmup fails by using index-based lookup to correctly extract server name and file types.
- Fixed Read tool loading entire file into memory when offset/limit was specified by implementing streaming line-by-line processing that only collects requested range.
- Fixed slash command autocomplete applying stale completions when typing quickly by adding staleness check before applying completion on Enter/Return.
- Reorganized npm scripts to follow consistent naming pattern with separate TypeScript and Rust variants for check, lint, fmt, and fix operations.
- Updated release script to properly handle Rust workspace version updates in Cargo.toml files and regenerate lockfiles.
2026-01-29 10:57:20 +01:00
can1357 2abaddec84 chore: bump version to 8.12.6 2026-01-29 10:53:15 +01:00
can1357 961539aae2 fix(ask): preserved null timeout when user disables ask timeout setting
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
2026-01-29 10:49:39 +01:00
can1357 8ef11355e7 perf(tui,natives): added native text utilities with JS fast path for short strings
- 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
2026-01-29 10:47:55 +01:00
can1357 a7ad179356 chore: bump version to 8.12.5 2026-01-29 09:49:52 +01:00
can1357 e9e106da1b refactor(natives/wasm): restructured WASM module loading to use import.meta.resolve() for better resolution
- Refactored WASM module loading to use import.meta.resolve() instead of URL constructor for better module resolution.
2026-01-29 09:47:43 +01:00
can1357 aa156af6e1 chore: bump version to 8.12.4 2026-01-29 09:34:06 +01:00
can1357 28bf9057e3 chore: fix *.rs formatting 2026-01-29 09:33:01 +01:00