Commit Graph

1725 Commits

Author SHA1 Message Date
can1357 31d26d75d6 chore: bump version to 11.4.0 2026-02-06 07:32:50 +01:00
can1357 8904798cc0 refactor(coding-agent): renamed XML tag <important> to <caution> for semantic clarity
- Renamed XML tag `<important>` to `<caution>` across system prompts and tool documentation for improved semantic clarity.
- Collapsed multi-line function calls to single lines in diff component formatting for improved code conciseness.
- Consolidated emoji guideline into critical section in write tool documentation.
- Fixed whitespace visualization in CHANGELOG diff output and corrected incomplete text.
2026-02-06 07:27:12 +01:00
can1357 f0c6399d69 fix(patch): fixed patch applicator to preserve indentation in context-only hunks
- Fixed patch applicator to preserve indentation in context-only hunks by skipping unnecessary adjustments when pattern equals actual content.
- Implemented linear regression-based tab width inference to correctly convert space-indented diffs to tab-indented files using ax+b model.
- Added regression tests for context-only hunk handling and space-to-tab indentation conversion with offset models.
- Updated patch tool documentation to emphasize never using edit operations for indentation or formatting fixes.
2026-02-06 07:24:48 +01:00
can1357 228ea7daeb feat(coding-agent/modes): added visualization of indentation in patch application with dim glyphs
- Added visualization of leading whitespace (indentation) in diff output with dim glyphs--tabs display as ` -> ` and spaces as `·` for improved readability.
- Implemented visualizeIndent() function to normalize and display indentation patterns, collapsing 3-space groups into tab arrows and marking individual spaces with middle dots.
2026-02-06 07:14:57 +01:00
can1357 685736667e fix(coding-agent): fixed tab character rendering causing UI holes by converting tabs to spaces
- Fixed tab character rendering in tool output previews and code cell displays by converting tabs to spaces for consistent terminal display.
- Applied replaceTabs() function across patch rendering, write tool output, and code cell output to ensure uniform tab handling.
2026-02-06 07:10:33 +01:00
can1357 97628bfe0f fix(coding-agent): fixed todo carryover in session initialization and formatting
- Fixed `newSession()` to properly await session manager operations for full initialization.
- Changed session formatting to use XML structure instead of YAML for tools and tool invocations.
- Added formatArgsAsXml() helper function to serialize objects as XML parameter elements.
- Removed trailing whitespace from task.md prompt file.
- Added regression test for AgentSession.newSession() to verify proper session switching and artifact isolation.
2026-02-06 07:10:06 +01:00
can1357 bf8267e807 chore: bump version to 11.3.0 2026-02-06 05:36:37 +01:00
can1357 1849d51458 fix(coding-agent/tui): fixed background color stability in output blocks with SGR reset sequences
- Fixed background color stability in output blocks when inner content contains SGR reset sequences, preventing background color from being cleared mid-line.
2026-02-06 05:35:56 +01:00
can1357 4dfeebe36a fix(coding-agent/tui): fixed spurious ellipsis and improved hash collision resistance
- Fixed spurious ellipsis appended to output lines that were already padded to terminal width by trimming trailing spaces before truncation check.
- Improved hash function to include string length in hash computation for better collision resistance.
2026-02-06 05:31:14 +01:00
can1357 fa82cd3b1f perf(tui): optimized cache key computation in Box component with incremental hashing
- Optimized cache key computation in Box component by replacing JSON serialization with incremental hashing.
- Fixed indentation inconsistencies in tree-list rendering logic.
2026-02-06 05:28:28 +01:00
can1357 7222bc1eae feat(tui): removed cursor positioning and refactored TUI rendering with explicit env defaults
- Removed getCursorPosition() method from Component interface and implementations, eliminating hardware cursor positioning support.
- Changed PI_HARDWARE_CURSOR environment variable default from implicit true to explicit '1' with fallback pattern.
- Changed PI_CLEAR_ON_SHRINK environment variable default from implicit false to explicit '0' with fallback pattern.
- Added screen clearing on TUI startup to prevent shell prompts from bleeding into first rendered frame.
- Refactored full-render logic into reusable fullRender() helper function.
2026-02-06 05:18:02 +01:00
can1357 3240318338 feat(coding-agent/session): externalized large images to content-addressed blob store
- Added BlobStore class for content-addressed storage of large binary data externalized from session files.
- Added getBlobsDir() function to retrieve the path to the blob store directory.
- Added blob reference format (blob:sha256:<hash>) for tracking externalized image data in sessions.
- Changed image persistence to externalize images >=1KB to content-addressed blob store instead of compressing inline, reducing JSONL file size.
- Changed session loading to automatically resolve blob references back to base64 image data.
- Changed session forking to resolve blob references in copied entries to ensure data integrity.
2026-02-06 03:20:49 +01:00
can1357 311c3de836 refactor(coding-agent/modes): removed unused seenNonToolContent tracking logic from event controller
- Removed unused seenNonToolContent tracking logic from event controller.
2026-02-06 03:15:34 +01:00
can1357 72f99393ea feat(coding-agent/tools): added automatic image compression to screenshot tool with enhanced output details
- Added automatic image compression to screenshot tool using the same resizing logic as pasted images, reducing API payload size while maintaining quality.
- Enhanced screenshot output to display compression details including final dimensions and MIME type when images are resized.
2026-02-06 03:10:37 +01:00
can1357 a91a2f9d5d refactor(coding-agent/modes): extracted Alt+Enter follow-up message handling into dedicated handleFollowUp() method
- Extracted Alt+Enter follow-up message handling from inline editor callback into dedicated handleFollowUp() method.
- Moved follow-up keybinding registration to use new handleFollowUp() method instead of inline callback.
2026-02-06 03:07:40 +01:00
can1357 42dec91f2a feat(coding-agent): implemented width-aware text truncation and render caching across tool renderers
- Implemented width-aware text truncation across all tool renderers to respect terminal width constraints and prevent output overflow.
- Enhanced render caching to include width parameter for cache invalidation when terminal width changes, improving cache accuracy.
- Migrated truncateToWidth function imports from render-utils to centralized tui module for better code organization.
- Introduced Hasher utility for generating width-aware cache keys in calculator, find, grep, todo-write, and write tools.
- Optimized box component rendering to only truncate lines that exceed content width, reducing unnecessary truncation operations.
2026-02-06 03:07:30 +01:00
can1357 2a76b6de59 fix(coding-agent): fixed config file parsing to handle missing files gracefully
- Fixed config file parsing to properly handle missing files instead of treating them as errors.
2026-02-06 03:02:54 +01:00
can1357 de397b3b04 feat(coding-agent): restored plan mode on resume from session
- Added ModeChangeEntry type export to public API for tracking agent mode transitions.
- Added mode and modeData fields to SessionContext to track active agent mode state across sessions.
- Added appendModeChange() method to SessionManager for recording mode transition entries.
- Added plan mode state restoration from session entries when resuming interactive mode sessions.
- Updated HTML export filter to treat mode_change entries as settings entries alongside model changes and thinking level changes.
- Added type validation for tool arguments in HTML export template with error handling for invalid values.
2026-02-06 02:55:41 +01:00
can1357 5339369abd style: replaced ASCII ellipsis with Unicode character for improved typography
- Replaced ASCII ellipsis characters (three dots '...') with Unicode ellipsis character ('...') throughout the codebase for improved typography.
- Adjusted string truncation logic to account for single-character Unicode ellipsis instead of three-character ASCII ellipsis, reducing reserved space from 3 to 1 character in truncation calculations.
- Updated truncation offsets in multiple files (session-manager, agent, executor, footer) to preserve 2 additional characters before ellipsis due to more compact Unicode representation.
2026-02-06 02:51:07 +01:00
can1357 43473e3b0e perf(coding-agent): optimized tool rendering with caching, improved tool grouping, and enhanced string preview formatting
- Implemented caching for tool output block rendering to avoid redundant computations on re-renders.
- Enhanced read tool grouping to prevent coalescing across narrative boundaries (text/thinking blocks between tool calls).
- Improved string preview formatting to detect multi-line strings and display line counts with ellipsis indicators.
- Refactored tool execution component to use reactive render state tracking for better state management.
- Enhanced error handling in tool renderers with logging for failures.
- Fixed truncation indicator to use ellipsis character instead of verbose suffix.
2026-02-06 02:47:59 +01:00
can1357 9c0828ead5 feat: improved dyn config resolution, git URL parsing, and type safety across packages
- Made shell command execution in configuration values asynchronous to prevent blocking the TUI, improving responsiveness during long-running operations.
- Added deduplication of concurrent shell command executions to prevent redundant processing when the same command is requested multiple times simultaneously.
- Enhanced git URL parsing with credential stripping and validation of URI-encoded hash fragments to improve security and robustness.
- Improved @ prefix normalization for path syntaxes to correctly handle well-known patterns while preserving literal paths like '@my-file.txt'.
- Refactored prompt cache key calculation in OpenAI responses to improve code clarity and ensure cache retention is only set when a cache key exists.
2026-02-06 02:20:41 +01:00
can1357 a5db81b90b fix(coding-agent/task): fixed task executor to handle null data in submit_result and added schema mismatch warnings
- Fixed task executor to properly handle agents calling `submit_result` with null data by treating it as missing and attempting to extract output from conversation text rather than silently failing.
- Added documentation caution in task.md about schema vs agent mismatch causing null output, with guidance on using `schema` parameter to override built-in schemas.
- Added warning message when subagent calls submit_result with null data to help diagnose schema mismatch issues.
2026-02-06 02:14:53 +01:00
can1357 bfe175fc01 feat(natives): backported fixes from pi-mono (82d7da878..9ce00079) 2026-02-06 01:55:42 +01:00
can1357 fbf1b764ef feat(coding-agent/tools): added puppeteer query handler support and improved click action reliability
- Added support for puppeteer query handlers (aria/, text/, xpath/, pierce/) in selector parameters across all browser actions.
- Added automatic normalization of legacy p- prefixed selectors (p-aria/, p-text/, p-xpath/, p-pierce/) to modern puppeteer query handler syntax.
- Added enhanced actionability checking for click operations, validating visibility, pointer events, opacity, viewport intersection, and element occlusion.
- Fixed click action to properly handle text/ query handlers with timeout and retry logic instead of failing immediately.
- Fixed viewport application to only apply when in headless mode or when explicitly requested, preventing conflicts in headed browser mode.
2026-02-06 00:14:47 +01:00
can1357 0171cd7b75 refactor(utils): restructured stream utilities for improved reusability and correctness
- Extracted stream abort handling into dedicated `createAbortableStream` utility function for reuse across stream operations.
- Refactored `sanitizeBinaryOutput` to handle surrogate pairs correctly and filter additional control characters (DEL and C1 control block) with lazy array allocation.
- Simplified JSONL parsing by replacing manual buffer management with new `pullJSONL` generator method in ConcatSink class.
- Removed unused `createSanitizerStream` and `createTextDecoderStream` helper functions that are no longer needed.
- Refactored `readSseJson` to use generator-based line processing with fast-path optimization for OpenAI-style done markers.
- Updated stdio transport to use new `readJsonl` utility instead of manual JSON parsing with TextDecoder.
2026-02-05 23:39:05 +01:00
can1357 c2227e6a81 chore: bump version to 11.2.3 2026-02-05 21:07:09 +01:00
can1357 b12a27830c refactor(stream): improved SSE parsing & added GPT-5.3, Claude 4.6 Opus
- Extracted stream parsing utilities into reusable functions in pi-utils package (readLines, readJsonl, parseJsonlLenient, readSseJson).
- Replaced manual buffer management with ConcatSink class for efficient stream handling across multiple modules.
- Simplified SSE stream parsing in google-gemini-cli provider by using readSseJson utility instead of manual reader setup.
- Refactored MCP stdio transport to use readLines utility for cleaner line-based stream processing.
- Updated RPC client and mode to use readJsonl utility, removing duplicate JSONL parsing logic.
- Optimized buffer allocations by using allocUnsafe where data is immediately populated and reusing empty buffer instances.
2026-02-05 21:06:58 +01:00
can1357 0a8bd08565 chore: bump version to 11.2.2 2026-02-05 17:02:31 +01:00
can1357 50321eb783 fix: missing import 2026-02-05 16:59:49 +01:00
can1357 5a5dcba9ba chore: bump version to 11.2.1 2026-02-05 14:34:50 +01:00
can1357 92fc4f2d9a fix(coding-agent): fixed CLI invocation with flags only to route to default command
- Fixed CLI invocation with flags only (e.g. `pi --model=codex`) to route to the default command instead of erroring.
2026-02-05 14:34:32 +01:00
can1357 e71fabf279 chore: bump version to 11.2.0 2026-02-05 14:31:09 +01:00
can1357 f8950c22b4 refactor(auth-storage): cleanup auth.json mentions
- Migrated authentication storage from JSON-based (auth.json) to database-based (agent.db) format across test files and configuration.
- Simplified auth storage discovery in sdk.ts by removing manual path construction and fallback logic in favor of centralized getAgentDbPath() function.
- Removed dbPath instance property from AuthStorage class as database path is now managed centrally.
- Updated environment variable precedence documentation to reflect agent.db instead of auth.json as the lowest priority source.
- Removed OAuth provider section header comments from multiple test files for cleaner test organization.
- Added support for JSON and JSONC configuration file formats without requiring migration to YAML.
2026-02-05 14:30:22 +01:00
can1357 e47657c4d1 refactor(coding-agent/web): restructured web search providers to use modular class-based architecture
- Reorganized web search provider system to use individual provider classes in separate files under providers/ directory.
- Moved SearchProvider base class and SearchParams interface to dedicated providers/base.ts module.
- Consolidated provider management logic into provider.ts, replacing provider-info.ts.
- Updated web search execution to pass maxOutputTokens, numSearchResults, and temperature parameters to providers.
- Changed Perplexity search context size from 'high' to 'medium' and increased default max tokens from 4096 to 8192.
- Updated Anthropic and Gemini search providers to support max_tokens and temperature parameters.
2026-02-05 14:13:15 +01:00
can1357 9033482710 feat(coding-agent/session): removed legacy file-based auth migration and simplified AuthStorage to use only agent.db
- Removed legacy auth.json file-based authentication migration system and simplified AuthStorage to use only agent.db for credential storage.
- Simplified AuthStorage API by removing authPath and fallbackPaths parameters, now accepting only dbPath for improved startup performance.
- Deleted storage-migration.ts module containing legacy JSON-to-SQLite migration logic that is no longer needed.
- Removed getAuthPath() configuration function from config.ts as auth.json file-based storage is no longer supported.
2026-02-05 14:02:09 +01:00
can1357 881737fec4 refactor(coding-agent): restructured web search and config systems with class-based architecture and type generalization
- Renamed web search types and functions to remove 'Web' prefix for broader applicability (WebSearchProvider -> SearchProviderId, WebSearchResponse -> SearchResponse, WebSearchTool -> SearchTool, etc.).
- Refactored web search provider system from object-based configuration to class-based architecture with abstract SearchProvider base class and concrete provider implementations.
- Refactored ModelRegistry to use direct constructor instantiation instead of discoverModels() helper function, simplifying model discovery pattern.
- Refactored config system to use new ConfigFile class with schema validation, caching, and multi-format support (JSON, JSONC, YAML).
- Simplified Exa API key discovery to check environment variables only, removing .env file reading logic.
2026-02-05 13:56:38 +01:00
can1357 178d1b604a refactor(coding-agent/cli): restructured CLI help rendering into dedicated oclif-help module
- Extracted custom help class implementation into dedicated oclif-help.ts module to centralize CLI help rendering logic.
- Refactored printHelp() function to delegate detailed help output to oclif's Help class, reducing code duplication and complexity.
- Extracted getExtraHelpText() function to isolate environment variables help section for reuse across help implementations.
2026-02-05 13:50:26 +01:00
can1357 22df49b81c feat(coding-agent): migrated CLI from custom parser to oclif framework for improved structure
- Migrated CLI from custom argument parser to oclif framework for improved command structure and maintainability.
- Reorganized CLI subcommands into individual command files under src/commands/ directory with oclif Command classes.
- Added oclif configuration to package.json with bin name 'omp', commands directory, and autocomplete plugin support.
- Refactored CLI entry point in src/cli.ts to use oclif's run() function with improved error handling.
- Simplified extension flag parsing by directly iterating raw arguments instead of using dynamic flag definitions.
- Updated CHANGELOG.md with comprehensive documentation of new oclif-based CLI commands and migration details.
2026-02-05 13:41:20 +01:00
can1357 99ea5b517b fix(agent): fixed abort error handling, exit codes, and stdout text conversion in streams
- Fixed handling of aborted requests to properly throw abort errors when stream terminates without a terminal event.
- Fixed exit error handling in ChildProcess.wait() to properly capture exit reasons and non-zero exit codes.
- Fixed stdout text conversion in ChildProcess.wait() to use Response API for proper text decoding.
2026-02-05 11:26:24 +01:00
can1357 b9ab0cc5cf feat(coding-agent/web): added web search CLI subcommand and refactored provider management
- Added new `omp q` CLI subcommand for testing web search providers with query, provider, recency, and limit options.
- Added web search provider information API with centralized provider-info module supporting authentication requirements and provider metadata.
- Added support for `hour` recency filter option in Perplexity web search.
- Refactored web search provider definitions into centralized provider-info module for improved maintainability.
- Updated web search result rendering to support long-form answers with text wrapping in CLI mode.
- Removed related questions section from web search result rendering.
2026-02-05 11:22:25 +01:00
can1357 3ff628764d feat(coding-agent/web): improved Perplexity search results with pro search type and fallback handling
- Added 'pro' search type to Perplexity API requests for improved search quality and relevance.
- Implemented fallback to search results when Perplexity API returns no citations, ensuring search results are always available to users.
- Added search_type field to PerplexityRequest web_search_options interface.
2026-02-05 11:16:30 +01:00
can1357 16ed34ebed feat(utils): refactored stderr handling API from boolean option to enum-like option
- Changed stderr handling API from `exposeStderr` boolean option to `stderr: "full" | null` enum-like option for clearer intent.
- Refactored ChildProcess constructor to accept stderr parameter directly instead of options object for simpler API.
2026-02-05 11:07:48 +01:00
can1357 435b778a29 refactor(coding-agent/web-search): added provider registry 2026-02-05 11:00:13 +01:00
can1357 1f7c4f6f90 refactor(stream-parsing): restructured stream utilities to use Web standard APIs and generic SSE parsing
- Refactored SSE stream parsing to use generic `readSseJson` utility instead of domain-specific handlers across multiple packages.
- Migrated from Node.js Buffer API to Web standard APIs (Uint8Array, TextDecoder, DataView) for cross-platform compatibility.
- Simplified stream transformation pipeline by consolidating multiple stream operations into unified `createTextLineSplitter` utility.
- Refactored `ptree.ts` to remove complex stream pumping infrastructure and simplify stderr handling with direct async iteration.
- Rewrote stream utilities to operate at binary level with byte-level parsing for improved efficiency and reduced string allocations.
- Updated TypeScript configuration to include DOM.AsyncIterable type definitions for async iterable DOM API support.
2026-02-05 10:59:47 +01:00
can1357 251d5a91ef fix(coding-agent/modes): fixed model switches deferred during streaming to apply correctly on completion
- Fixed model switches deferred during streaming to apply correctly when the stream completes, preventing model changes from being lost.
- Added pendingModelSwitch field to track deferred model changes during active streams.
- Added flushPendingModelSwitch() method to apply deferred model switches after streaming completes.
- Modified switchToPlanModel() to defer model changes when a stream is active instead of applying immediately.
- Modified exitPlanMode() to defer model restoration when a stream is active instead of applying immediately.
- Modified EventController to call flushPendingModelSwitch() when stream completion is detected.
2026-02-05 09:31:54 +01:00
can1357 f69671676d build(deps): migrated from @types/node to @types/bun for Bun runtime compatibility
- Migrated from @types/node to @types/bun across all packages to align with Bun runtime.
- Removed @types/node and bun-types from root and package-specific devDependencies.
- Updated tsconfig.base.json to remove 'node' from types array and 'DOM.AsyncIterable' from lib, keeping only Bun-compatible configurations.
- Simplified ReadableStream type annotation in openai-codex-stream.test.ts by removing explicit Uint8Array generic parameter.
2026-02-05 09:10:45 +01:00
can1357 928c210051 feat(coding-agent): added image file mention support with auto-detection and resizing
- Added support for image file mentions with automatic detection, resizing, and attachment via @filepath syntax.
- Enhanced file mention messages to support both text content and image attachments with optional line count for text files.
- Implemented image dimension information display in file mention UI.
- Updated file mention processing to respect image auto-resize settings.
- Modified file mention data structure to include optional image property and optional lineCount field.
- Refactored variable naming in file processor to remove unused variable convention.
2026-02-05 08:47:57 +01:00
can1357 adf3ad0383 fix(coding-agent/session): fixed plan mode context injection during streaming to prevent file edits
- Fixed plan mode toggles during streaming to inject plan-mode context immediately, preventing file edits while in plan mode.
- Updated file mention processing to respect image auto-resize settings.
- Added sendPlanModeContext method to inject plan mode context message into conversation history.
2026-02-05 08:45:22 +01:00
can1357 d1ccb24e7e chore: bump version to 11.1.0 2026-02-05 08:27:52 +01:00
can1357 a1786ce3b5 feat(coding-agent): added diagnostic sorting by severity, location, and message for consistent output
- Added `sortDiagnostics()` utility function to sort diagnostics by severity, location, and message for consistent output ordering.
- Changed diagnostic output to sort results by severity (errors first), then by file location and message for improved readability.
- Added `getSeverityRank()` helper function in render-utils to map diagnostic severity levels to numeric ranks for sorting.
- Integrated diagnostic sorting in LSP index module to apply consistent ordering before formatting diagnostics.
2026-02-05 08:11:07 +01:00