Commit Graph

293 Commits

Author SHA1 Message Date
can1357 21af96d890 fix: added Cursor OAuth provider and fixed authentication flow race conditions
- Added Cursor OAuth provider support to CLI authentication flow.
- Fixed race conditions in OAuth callback handling and session picker cleanup.
- Improved JWT token parsing and error handling across OAuth providers.
- Replaced Bun.sleep() with abortable sleep for proper cancellation support.
- Enhanced process execution with concurrent stream reading and better timeout handling.
- Added cache cleanup mechanism for auth storage with 5-minute intervals.
2026-01-20 19:50:50 +01:00
can1357 b2c94bef1a refactor(deps): restructured codebase to use centralized pi-utils package
- Created new @oh-my-pi/pi-utils workspace package with shared utilities for logging, process management, stream handling, and temporary directory management.
- Migrated all packages to use centralized logger from @oh-my-pi/pi-utils instead of local winston implementations.
- Replaced custom process spawning and stream reading implementations with standardized cspawn and readLines utilities across all modules.
- Converted synchronous file operations and process spawning to async patterns using Bun shell syntax and fs/promises.
- Added streaming edit abort functionality with configurable setting to abort on patch preview failures.
- Updated test framework from vitest to bun:test across all test suites.
2026-01-20 05:33:21 +01:00
can1357 dac7202d30 feat(coding-agent): added normative rewrite settings and streaming preview to tools
- Added normative rewrite and read line numbers settings for tool configuration.
- Enhanced edit and write tools with streaming preview and spinner animation.
- Improved normative patch tool to auto-derive anchors from diff hunks.
- Updated read tool to respect default line numbers setting.
2026-01-19 17:32:24 +01:00
can1357 5ae70ed2dd feat: enhanced patch applicator with fallback variants and fuzzy matching
- Enhanced patch applicator with fallback variant generation and improved fuzzy matching.
- Added support for ellipsis placeholders, top-of-file anchors, and comment-prefix normalization.
- Renamed operation and moveTo parameters to op and rename across patch tool interfaces.
- Added batch processing system to benchmark runner for parallel task execution.
- Added comprehensive benchmark reports for Claude Haiku and GPT-5.1-codex-mini models.
2026-01-19 16:16:55 +01:00
can1357 7a081e1c7c feat: added React mutation testing package and coding-agent improvements
- Added new @oh-my-pi/react-edit-benchmark package for React source code mutation testing.
- Added --no-title flag to disable automatic session title generation in coding-agent.
- Changed default behavior of read tool to omit line numbers by default.
- Added environment variable support for edit tool configuration and fuzzy matching.
- Updated test files to use import.meta.dir for ES module compatibility.
- Added Prettier configuration and CI improvements for private package handling.
2026-01-19 16:16:55 +01:00
can1357 50e3d73b65 feat(coding-agent): added allowFuzzy option to control patch matching behavior
- Added allowFuzzy option to control fuzzy matching behavior in patch operations.
- Added validation for line numbers to ensure they are >= 1 in patch headers and hints.
- Enhanced fuzzy matching algorithms to respect the allowFuzzy setting for precise control.
- Fixed patch application to prefer actual diff over cached preview when displaying results.
2026-01-19 16:16:55 +01:00
can1357 df2745e6f5 feat(coding-agent): added OMP_NO_PATCH env var and simplified diff formatting
- Added OMP_NO_PATCH environment variable to control patch mode behavior.
- Simplified function call formatting in diff rendering.
2026-01-19 16:16:54 +01:00
can1357 2b103bf9ad feat(coding-agent/core): added nested @@ context anchors and hierarchical matching
- Added support for nested @@ context anchors and hierarchical context matching.
- Enhanced patch parser to handle @@ line N syntax and multiple context accumulation.
- Improved diff rendering and error messages with hierarchical context display.
- Added comprehensive regression tests for model-generated patch formats.
2026-01-19 16:16:54 +01:00
can1357 fc1ae8dc72 refactor(coding-agent): migrated to class-based architecture for tool implementations
- Refactored output sanitization logic into centralized streaming-output module.
- Converted tool implementations from factory functions to class-based architecture.
- Updated SSH executor to use shared output streaming infrastructure.
- Moved voice recording logic from function to class-based implementation.
2026-01-19 16:16:54 +01:00
can1357 fa2261002d refactor(coding-agent/core): migrated tool implementations from factory functions to class-based architecture
- Converted all tool implementations from factory functions to class-based architecture.
- Updated SDK exports to expose tool classes instead of create*Tool factory functions.
- Refactored tool instantiation patterns across all built-in tools and test files.
- Added proper TypeScript typing with AgentToolResult and AgentToolUpdateCallback interfaces.
2026-01-19 16:16:54 +01:00
can1357 a3ef35d83e feat(coding-agent/core): added configurable fuzzy matching and binary file support to patch operations
- Added configurable fuzzy matching threshold for edit operations with 0.85-0.98 range.
- Added binary file reading support for improved BOM detection in patch operations.
- Enhanced patch application with better ambiguity detection and clearer error messages.
- Improved diff truncation algorithm to preserve context around changes more intelligently.
- Fixed BOM detection to check binary content when text-based detection fails.
2026-01-19 16:16:53 +01:00
can1357 c014c309d6 refactor(coding-agent/core): restructured edit tool into modular patch architecture
- Refactored edit tool implementation with modular patch architecture.
- Moved edit tool implementation from edit/ to patch/ module.
- Updated import paths for EditToolDetails across core modules.
- Enhanced patch parsing with unified diff and Codex-style patch support.
- Improved fuzzy matching algorithms for more robust text location.
2026-01-19 16:16:53 +01:00
can1357 436a0065df fix(coding-agent): corrected tool completion logic to prevent premature marking
- Fixed tool completion logic to only mark tools as complete when streaming is not aborted or in error state.
2026-01-19 16:16:53 +01:00
can1357 232dbc1ea7 feat(coding-agent): added apply-patch mode to edit tool with create update delete rename operations
- Added comprehensive apply-patch mode for edit tool with create, update, delete, rename operations.
- Added MCP tool caching and deferred loading for faster startup performance.
- Improved edit tool architecture with modular diff and apply-patch implementations.
- Enhanced MCP connection handling with waitForConnection for better reliability.
- Fixed MCP tool path formatting to correctly display provider information.
2026-01-19 16:16:53 +01:00
can1357 5a601bb0c0 feat: added Windows ARM64 support and streaming WASM loading with base64 fallback
- Added Windows ARM64 binary support and architecture detection in installers.
- Updated WASM loading to use streaming with base64 fallback for binary compatibility.
- Moved TTSR settings to dedicated tab and expanded abbreviation to Time Traveling Stream Rules.
- Added comprehensive install testing infrastructure with Docker validation.
- Updated package name from @oh-my-pi/omp-coding-agent to @oh-my-pi/pi-coding-agent.
2026-01-19 01:23:27 +01:00
can1357 aac8187e05 feat(coding-agent): implemented shared Python gateway for efficient kernel reuse
- Added Python shared gateway setting for resource-efficient kernel reuse across sessions.
- Enhanced Python tool with session-scoped kernel isolation and workdir-aware session IDs.
- Added Python tool cancellation support with timeout handling and proper cleanup.
- Expanded Python prelude with enhanced file operations, git utilities, and improved output handling.
- Fixed AI provider message transformation for proper tool call handling and error recovery.
2026-01-18 21:07:02 +01:00
can1357 d620f07c1e feat(coding-agent/core): added Python gateway coordinator with shared resource management
- Added shared Python gateway coordinator with file locking and automatic resource management.
- Added comprehensive Git helpers and line-based operations to Python prelude.
- Enhanced /status command to display Python gateway, LSP servers, and MCP connections.
- Changed default Python tool mode from ipy-only to both for shell execution support.
- Fixed Python tool proxy execution and signal handling in worker processes.
2026-01-18 19:54:35 +01:00
can1357 1d414c1383 feat: added IPython-backed Python tool with streaming output and Jupyter integration
- Added IPython-backed Python tool with streaming output and image/JSON rendering.
- Implemented Jupyter kernel gateway integration with WebSocket communication.
- Added Python prelude with 30+ shell-like utility functions for file operations.
- Migrated environment variables from PI_ to OMP_ prefix with automatic migration.
- Added streaming output system with automatic spill-to-disk for large outputs.
- Reorganized settings interface into behavior, tools, display, voice, status, lsp, and exa tabs.
2026-01-18 19:32:27 +01:00
can1357 6dff3daa14 feat(coding-agent/modes): added TabBar component to model selector for provider navigation
- Updated model selector to use TabBar component for provider navigation.
- Added support for /models command alias in addition to /model command.
- Changed role badges to inverted style with colored backgrounds.
- Enhanced TabBar component with text wrapping for overflow content.
2026-01-18 18:07:51 +01:00
can1357 ac151519c1 feat: port upstream changes from pi-mono (72047c05..55769e75)
AI provider fixes:
- Fixed Claude tool prefix matching and Gemini 3 unsigned tool handling
- Added Bedrock thinking budget guardrails and tool id sanitization
- Added tool argument coercion and Codex response retry logic

TUI improvements:
- Improved Kitty key handling and editor behavior (scrolling, padding, kill ring)

Coding agent changes:
- Added extension input interception, compaction helpers, and UI updates
- Added session forking prompt for cross-project sessions
- Added APPEND_SYSTEM discovery, piped stdin print mode, and key hint exports

Docs:
- Updated pi-mono sync point
2026-01-18 17:52:58 +01:00
can1357 f1d71fbd9d feat: implemented Emacs-style kill ring with Alt+D and Ctrl+Y bindings
- Added automatic retry logic for OpenAI Codex responses with configurable delay and max retries.
- Added input event handlers for extensions to intercept user input and argument completion support.
- Added Emacs-style kill ring for text deletion operations with Alt+D and Ctrl+Y keybindings.
- Added configurable editor padding via editorPaddingX theme option and setMaxHeight() method.
- Fixed tool prefix handling in Claude provider to use case-insensitive comparison.
- Enhanced Kitty keyboard protocol support for better key detection and shifted symbol handling.
2026-01-18 17:12:18 +01:00
can1357 591c17e645 chore(coding-agent): set initial terminal title to π 2026-01-14 08:56:49 +01:00
can1357 416baf8ea3 refactor(coding-agent): rendered find/grep/ls tools inline without background box 2026-01-14 08:56:36 +01:00
can1357 0b85098862 feat: port upstream changes from pi-mono (6730b4fa..b74535dc)
Provider additions:
- Added Amazon Bedrock provider with bedrock-converse-stream API
- Added MiniMax provider with OpenAI-compatible API
- Added EU cross-region inference model variants for Bedrock

Provider fixes:
- Fixed Gemini CLI retries with header parsing and empty stream retry logic
- Fixed Bedrock tool call transforms via transformMessages
- Fixed z.ai thinking/reasoning params
- Fixed OpenRouter+Anthropic cache control
- Fixed OpenAI responses timeout and service tier options
- Fixed tool call ID normalization for cross-provider switches
- Fixed thought signature validation for Google providers
- Fixed prompt cache key using session ID

TUI improvements:
- Added OverlayOptions API with CSS-like positioning (SizeValue, percentages)
- Added OverlayHandle for programmatic visibility control
- Added visible callback for responsive overlays
- Added pad parameter to truncateToWidth
- Added pageUp/pageDown key support
- Fixed numbered list items showing 1. when code blocks break continuity
- Fixed overlay width overflow crash with complex ANSI sequences
- Fixed light theme colors for WCAG AA compliance

Coding agent fixes:
- Fixed /new command to create new session file
- Fixed session selector to stay open when folder has no sessions
- Added session header emission in JSON print mode
- Added queued message hint with theme.tree.hook
- Exported highlightCode and getLanguageFromPath for extensions

Also renamed transorm-messages.ts to transform-messages.ts (typo fix)
2026-01-14 01:50:47 +01:00
can1357 16fa5533e5 feat(coding-agent): migrated image processing from wasm-vips to Photon with graceful fallbacks
- Migrated image processing library from wasm-vips to Photon (Rust/WASM) for improved performance and reliability.
- Added graceful fallback for failed image resizing operations, allowing the system to use original images when WASM processing fails.
- Added error handling for image conversion failures in interactive mode to prevent crashes during WASM processing.
- Implemented lazy initialization pattern for Photon WASM module with proper resource cleanup using try-finally blocks.
- Added NULL_PROMPT environment variable support for debugging and testing system prompt generation.
2026-01-12 15:23:35 +01:00
can1357 976acd10bf feat(coding-agent/core): added multi-part questions support and improved cursor behavior in ask tool
- Added multi-part questions support to ask tool via questions array parameter for asking multiple related questions in sequence.
- Updated multi-select cursor behavior in ask tool to stay on toggled option instead of jumping to top.
- Added initialIndex parameter to ExtensionUIDialogOptions interface for controlling initial cursor position in select dialogs.
- Extracted question selection logic into askSingleQuestion helper function with UIContext interface.
- Added formatQuestionResult helper function and QuestionResult interface for multi-part question results.
- Updated ask tool prompt documentation with multi-part questions examples and Other option guidance.
2026-01-12 08:39:27 +01:00
can1357 355e2f22ad feat(cli): add omp config subcommand for managing settings 2026-01-12 07:17:32 +01:00
can1357 66ea245f2d fix(tui): reload todos when switching sessions or navigating tree 2026-01-12 07:15:39 +01:00
can1357 7f459214c1 fix(tui): align todo list 'more' indicator with item indentation 2026-01-12 07:09:12 +01:00
can1357 e29f0017af feat(agent): add todoCompletion setting to remind agent of incomplete todos 2026-01-12 07:05:01 +01:00
can1357 7003c7c605 chore(tui): use π prefix in terminal title 2026-01-12 06:53:10 +01:00
can1357 700281d8a8 fix(tui): render single-file reads inline 2026-01-12 06:51:50 +01:00
can1357 741ab06ed2 feat: port upstream improvements from pi-mono (f1b64b9d..6730b4fa)
TUI:
- Add fuzzy matching module (moved from coding-agent)
- Remove Kitty protocol query timeout (fixes shift+enter delays)
- Add bracketed paste check for key release/repeat detection
- Rendering optimizations (only re-render changed lines)
- Add backslash+enter newline fallback, getExpandedText()
- Refactor input.ts to use keybindings manager

Coding-agent:
- Add /skill:name slash commands with enableSkillCommands setting
- Add cwd to SessionInfo for session list display
- Improve tree selector with custom summarization instructions
- Add dequeue (Alt+Up) to restore all queued messages at once
- Add shutdown request handling for extensions
- Component invalidate() fixes for theme changes
2026-01-12 03:18:30 +01:00
can1357 827841d19f fix(ai/providers): fixed schema sanitization and standardized priority format to string labels
- Fixed Google provider schema sanitization to collapse anyOf/oneOf with const values into enum arrays.
- Fixed const-to-enum conversion to infer type from const value when type is not specified.
- Changed review finding priority format from numeric (0-3) to string labels (P0-P3).
- Replaced Type.Union with Type.Literal patterns with StringEnum helper across tool schemas.
- Added const modifier to StringEnum generic type parameter for improved TypeScript type inference.
- Consolidated priority metadata into single PRIORITY_INFO record with exported getPriorityInfo function.
2026-01-12 01:02:47 +01:00
can1357 03876d0360 feat(coding-agent): added todo_write tool, persistent todo panel, grouped Read display, and refactored prompts
- Added todo_write tool for creating and managing structured task lists during coding sessions.
- Added persistent todo panel above the editor that displays task progress with Ctrl+T toggle.
- Added grouped display for consecutive Read tool calls in a compact tree view.
- Changed system prompt to use more direct, field-oriented language with emphasis on verification and assumptions.
- Changed Ctrl+Enter to insert newline when not streaming, and Ctrl+T from toggling thinking blocks to toggling todo list.
- Replaced yaml package dependency with Bun's built-in YAML parser and extracted frontmatter parsing to dedicated module.
2026-01-11 23:33:27 +01:00
can1357 8ba0498eb7 fix(coding-agent): fixed keybindings and input handling for TUI editor and Cursor provider
- Changed temporary model selector keybinding from Ctrl+Y to Alt+P to avoid conflicts.
- Fixed Alt+Enter to insert newline when not streaming instead of submitting.
- Fixed Cursor provider to avoid advertising Edit tool, using full-file Write instead.
- Added Ctrl+Enter support for inserting newlines in TUI editor using Kitty and legacy terminal formats.
- Removed duplicate Ctrl+Y handler and refactored input controller to use trimmedText variable.
2026-01-11 22:59:04 +01:00
can1357 c11b2f9058 feat(coding-agent): added grouped display and compact tree view for consecutive Read tool calls
- Added grouped display for consecutive Read tool calls, showing multiple file reads in a compact tree view.
- Changed Read tool result display to hide content by default, showing only file path and status.
- Changed expand hint text from 'Ctrl+O to expand' to 'Ctrl+O for more'.
- Added ReadToolGroupComponent class to group multiple Read tool executions together in a single display.
- Renamed getStyledStatusIcon to formatStatusIcon for consistency with other format functions.
- Refactored formatExpandHint function signature to put theme parameter first and make expanded/hasMore optional.
2026-01-11 16:23:42 +01:00
can1357 18bb7c3855 feat(coding-agent): improved bash output preview with 10-line default and full output in expanded view
- Increased default bash output preview from 5 to 10 lines when collapsed.
- Updated expanded bash output view to show full untruncated output when available.
- Added fullOutput field to BashToolDetails to preserve complete output for expanded view.
- Exported BASH_DEFAULT_PREVIEW_LINES constant for consistent preview line configuration.
2026-01-11 15:25:34 +01:00
can1357 5e9ef021bb feat: enhanced subagent config, reviewer output schema, and consolidated discovery helpers
- Added thinkingLevel field to agent frontmatter allowing subagents to override thinking level with clamping to model capabilities.
- Added structured output schema to reviewer agent ensuring consistent review output format with findings, correctness verdict, and confidence.
- Expanded system prompt with defensive reasoning guidance including assumption checks, edge case awareness, and completion reflex inhibition.
- Consolidated expandPath, parseFrontmatter, and parseAgentFields utilities into discovery/helpers module eliminating code duplication across loaders.
- Replaced silent error handling with logger.warn calls across config parsing, migrations, extension loading, and OAuth refresh failures.
2026-01-11 14:09:18 +01:00
can1357 e6d33e0a48 feat(coding-agent): converted capability loading and discovery providers to async APIs with caching fs layer
- Converted SettingsManager.create(), loadSettings(), discoverSkills(), loadSlashCommands(), buildSystemPrompt(), loadSkills(), loadProjectContextFiles(), and getShellConfig() from synchronous to asynchronous APIs.
- Changed capability provider load() method from supporting both sync and async to async-only by removing loadSync().
- Removed fs property from LoadContext interface in capability types.
- Added new fs.ts module with caching layer for filesystem operations using readFile, readDirEntries, readDir, walkUp, and cache management functions.
- Refactored all discovery providers (builtin, claude, cline, codex, cursor, gemini, github, mcp-json, ssh, vscode, windsurf) to use async file operations with Promise.all for parallel loading.
2026-01-11 04:26:43 +01:00
can1357 0a9dd36e3d fix(multi): corrected auth messaging and google tool schemas 2026-01-11 01:06:05 +01:00
can1357 0729d340b7 fix(coding-agent): repaired autocomplete cancel redraw 2026-01-11 00:50:48 +01:00
can1357 9900c30014 chore: bump version to 4.2.0 2026-01-11 00:37:36 +01:00
can1357 1c93809f59 feat(coding-agent): added /dump command for clipboard transcript export
- Added new `/dump` slash command to copy full session transcript to clipboard.
- Separated `/export` and `/dump` commands with distinct responsibilities, removing clipboard copy functionality from `/export`.
- Implemented handleDumpCommand() method in command controller to manage clipboard operations independently.
2026-01-11 00:31:23 +01:00
can1357 24f0e41db7 refactor(interactive): restructured interactive-mode.ts into separate controller and utility classes
- Extracted CommandController class handling slash commands and user-initiated actions from interactive-mode.ts.
- Extracted EventController class handling AgentSessionEvent processing from interactive-mode.ts.
- Extracted ExtensionUiController class managing TUI-based UI context for extensions and hooks from interactive-mode.ts.
- Extracted InputController class handling keyboard input and editor interactions from interactive-mode.ts.
- Extracted SelectorController class managing UI selector components from interactive-mode.ts.
- Extracted UiHelpers and VoiceManager utility classes from interactive-mode.ts.
2026-01-11 00:05:34 +01:00
can1357 7e10c29792 fix(coding-agent): fixed theme variable resolution to handle references without $ prefix
- Fixed theme variable resolution to properly handle variable references without $ prefix.
- Added early return for empty strings and hex color values in theme resolution.
2026-01-10 23:06:34 +01:00
can1357 6797ad08cd feat(coding-agent): added custom share script support, renamed Glob to Find, improved prompts and docs
- Added custom share script support at ~/.omp/agent/share.ts to replace default GitHub Gist sharing.
- Renamed Glob tool to Find tool throughout prompts and documentation.
- Updated project context formatting to use XML-style tags for clearer structure.
- Refined bash tool guidance to prefer dedicated tools over bash for file operations.
- Updated system prompt with clearer tone guidelines emphasizing directness and conciseness.
- Enhanced verification guidance to prefer external feedback loops like tests and linters.
2026-01-10 23:04:38 +01:00
can1357 691b65d953 feat(coding-agent): added persistent prompt history with SQLite FTS5 storage and Ctrl+R search
- Added persistent prompt history with SQLite-backed storage using FTS5 for efficient text searching.
- Added Ctrl+R keybinding to search through prompt history in interactive mode.
- Added HistoryStorage class with singleton pattern, deduplication, and prepared statements for database operations.
- Added HistorySearchComponent with scrollable results list, keyboard navigation, and selection highlighting.
- Added setHistoryStorage() method to Editor class for saving and restoring history across sessions.
2026-01-10 18:48:17 +01:00
can1357 48a9900784 feat: added extension UI customization APIs, SDK exports, CLI flags, and fixed clipboard/resize bugs
- Added setFooter(), setHeader(), and setEditorComponent() methods to ExtensionUIContext for custom UI components.
- Exported InteractiveModeOptions type and numerous UI components for programmatic SDK usage.
- Added --no-tools flag to disable all built-in tools and --no-extensions flag to disable extension discovery.
- Changed bash tool output truncation to recalculate on terminal resize instead of using cached width.
- Fixed Wayland clipboard copy (wl-copy) no longer blocking when the process doesn't exit promptly.
- Updated model pricing and renamed nex-agi/deepseek-v3.1-nex-n1 model removing :free suffix.
2026-01-10 07:11:01 +01:00
can1357 ce84c3c6f1 feat(ai): fixed Anthropic OAuth, token refresh, thinking mode, and added betas option
- Added betas option to AnthropicOptions for passing custom Anthropic beta feature flags.
- Changed Anthropic OAuth tool naming to use 'proxy_' prefix instead of mapping to Claude Code tool names.
- Added Claude Code headers for all Anthropic requests, not just OAuth tokens.
- Fixed Anthropic OAuth code parsing to accept full redirect URLs in addition to raw authorization codes.
- Fixed Anthropic token refresh to preserve existing refresh token when server doesn't return a new one.
- Fixed thinking mode being disabled when tool_choice forces a specific tool, and auto-adjusted max_tokens when thinking budget is set.
2026-01-10 06:38:37 +01:00