Commit Graph

29 Commits

Author SHA1 Message Date
can1357 39f34ada70 feat: added pure-JS sanitizeText
- Migrated sanitizeText from pi-natives to pi-utils as a pure-JS implementation, removing the native dependency across all call sites.
2026-05-16 20:12:26 +02:00
can1357 f0e9a830ff refactor(packages/coding-agent): migrated search args to paths arrays
- Switched search/ast_grep/ast_edit/find inputs from scalar path fields to required `paths` arrays.
- Reworked path resolution to normalize and expand each `paths` entry via explicit helpers in `src/tools/path-utils.ts`.
- Updated search and find tool-call rendering to display explicit `paths` values in mode overlays and export views.
- Updated tool prompt docs and examples to document `paths` array inputs for search, grep, find, and AST tools.
- Raised the default search match limit from 20 to 500 and updated limit-reached messaging.
2026-05-02 04:34:39 +02:00
can1357 88a1072cc5 feat(coding-agent): implemented mcp__-prefixed MCP tool IDs for parsing
- Renamed MCP tool IDs from `mcp_<server>_<tool>` to `mcp__<server>_<tool>`, and changed built-in `grep` to `search`.
- Updated `parseMCPToolName()` and bridge helpers to require and trim the `mcp__` prefix.
- Updated cursor, manager, and session discovery flows to require `mcp__`-prefixed tool names.
- Updated MCP tests and assertion fixtures to use `mcp__`-prefixed tool IDs and expected system prompts.
2026-04-28 01:15:35 +02:00
can1357 a3f8f122cc feat(coding-agent): renamed grep to search in runtime mappings
- Renamed the built-in `grep` content-search tool to `search` across settings, schemas, and SDK exports.
- Switched execution wiring so `Task`, `Plan`, cursor, and shell mapping now invoke `search` instead of `grep`.
- Updated prompts, plan-mode docs, and example tool lists to replace `grep`/`ls` references with `search` guidance.
- Aligned `Grep*`/`grep` event, renderer, and hook types to `Search*`/`search` across runtime and tests.
- Documented and fixed `search` result rendering budget behavior and added internal-URL/path-list transcript notes.
2026-04-27 21:55:31 +02:00
can1357 b22837f898 feat(coding-agent): added unified path targets for grep family
- Consolidated grep, ast-grep, and ast-edit on required `path`, replacing `glob`/`lang`/`sel` with inline file, dir, glob, list, and URL targets.
- Changed ast-grep and grep schemas to require a single `pat` string and use `skip` pagination instead of array patterns or offsets.
- Updated argument validation to reject empty `path` and invalid `skip`, and routed grep context to session settings only.
- Updated tool prompts and tests to reflect new path globbing semantics and `first N` truncation output text.
2026-04-26 04:33:38 +02:00
can1357 d82377cda8 revert: "read-to-open"
This reverts commit c48d2e6080.
2026-04-24 22:36:44 +02:00
can1357 c48d2e6080 feat(coding-agent): implemented read-to-open tool aliasing in runtime
- Canonicalized file and CLI defaults from `read` to `open` across tool registration and prompts.
- Added `resolveToolAlias()` and applied alias-normalized tool selection so legacy `read` maps to `open`.
- Updated runtime, UI, and export layers to treat `open` as first-class while preserving `read` compatibility.
- Renamed read prompt docs to `open.md`/`open-chunk.md` and refreshed system guidance to recommend `open`.
- Updated tool-related tests and expectations from `read` to `open` (including test fixtures and aliases).
2026-04-24 19:13:11 +02:00
can1357 d2caf2770c feat: added /rename command to set session titles for status/header/tab display
- Added `/rename <title>` slash command to set explicit session names and update header/tab titles.
- Added `session_name` status segment with hash-derived accent color for session titles.
- Fixed shell execution failure sanitization to preserve all `execResult` fields after redacting stderr.
- Fixed tool execution completion output to pass original `toolResult` text instead of sanitized `content`.
2026-04-13 01:09:38 +02:00
can1357 b4887e37b7 fix: address PR regression follow-ups 2026-04-13 00:48:13 +02:00
djdembeck ce225ddf83 fix: sanitize tool execution events and streamline handling
- agent-loop: sanitize text content in tool_execution result/partialResult
- ai/cursor: fix ANSI escape handling, add incomplete escape detection
- coding-agent/cursor: fix per-delta sanitization with tracked state
- print-mode: flush stderr before exit to prevent data loss
- add unit tests for bash execution clamp display line
2026-04-10 14:51:27 -05:00
djdembeck 98d81f0cb2 fix: add output flushing and text sanitization for cursor
- Add stdout/stderr flush timers in ai provider to handle buffering
- Sanitize text content in tool execution results before emitting events
- Add @oh-my-pi/pi-natives workspace dependency
2026-04-10 14:16:58 -05:00
djdembeck a6bd1d29dd fix: add missing pi-natives deps and fix ANSI stream handling 2026-04-10 13:54:03 -05:00
djdembeck 1247653747 fix: sanitize tool outputs and fix truncation terminology
- bash-execution.ts: fix 'visible chars omitted' to 'visible columns omitted'
- print-mode.ts: add sanitizeText around errorMessage output
- cursor.ts: use buildToolErrorResult/createToolResultMessage for mcp not-found
- tui.ts: add Ellipsis.Omit parameter to truncateToWidth
- ai/providers/cursor.ts: add sanitizeShellExecResult helper for stdout/stderr
2026-04-10 13:54:03 -05:00
djdembeck b2fac498f0 fix: sanitize onUpdate and tool_execution_end in cursor.ts shell method
- Sanitize partialResult in onUpdate callback

- Sanitize text before onStdout in onUpdate

- Sanitize result in tool_execution_end event

- Return sanitized result from shell method
2026-04-10 13:54:03 -05:00
djdembeck 604711268d fix: sanitize event emissions in cursor.ts
- Sanitize partialResult in onUpdate callback

- Sanitize result in tool_execution_end event

- Return sanitized result from executeTool

- Prevents terminal escape sequences from leaking through event stream
2026-04-10 13:54:03 -05:00
djdembeck c9b63f0fed fix: sanitize tool result content in createToolResultMessage
- Map text content through sanitizeText before returning

- Prevents terminal escape sequences from leaking in tool results
2026-04-10 13:54:03 -05:00
djdembeck cef3f219ca fix: sanitize tool result output in cursor.ts
- Add sanitizeText import

- Sanitize tool result text before onStdout callback

- Prevents terminal escape sequences from leaking through
2026-04-10 13:54:03 -05:00
Qiang 577ccfd724 fix(cursor): resolve shell stream hanging on turnEnded signal (#555)
- Add resolveH2 promise resolver triggered on explicit turnEnded message
- Import CursorShellStreamCallbacks, ExecClientControlMessageSchema, ExecClientStreamCloseSchema
- Refactor handleShellStreamArgs to support shellStream handler with proper logging
- Update types.ts and coding-agent cursor.ts accordingly
2026-03-30 13:44:36 +02:00
can1357 9bcd1310d9 feat(ai/providers): added MCP resource and computer use message types to cursor provider
- Added support for four new exec message types: listMcpResources, readMcpResource, recordScreen, and computerUse.
- Imported four new result schemas to handle responses for MCP resource operations and computer use capabilities.
- Updated bash execution handler to use standardized 'cwd' parameter name instead of 'workdir'.
2026-02-26 11:25:02 +01:00
can1357 acf8ab5225 style: stylistic changes 2026-02-10 07:39:39 +01:00
can1357 c7d7bb5520 feat(grep): refactored grep tool to consolidate output modes and simplify parameters
- Removed `output_mode` parameter from grep tool, consolidating all output to content mode with file grouping and match headers.
- Renamed grep context parameters from `context_pre`/`context_post` to `pre`/`post` for improved clarity.
- Removed `n` (line numbers) parameter from grep tool as line numbers are now always displayed.
- Reformatted grep output to display numbered matches with file paths, line numbers, and context lines with consistent alignment.
- Introduced `SearchParams` struct in Rust grep implementation to simplify parameter passing and improve code maintainability.
- Made `normalize_env_key` function const-eligible for compile-time evaluation in shell module.
2026-02-04 23:24:15 +01:00
can1357 e66d71f6b9 refactor(tools): consolidated directory listing functionality from ls tool into read tool
- Consolidated directory listing functionality from dedicated `ls` tool into the `read` tool.
- Removed the `ls` tool and all related exports, types, and configurations from the public API.
- Updated `read` tool to return formatted directory listings with modification times instead of redirecting to `ls` tool.
- Removed `bashInterceptor.simpleLs` setting and related interception logic from bash tool.
- Removed `ls.enabled` setting and related tool registration logic.
- Removed test cases for the `ls` tool and updated tool type definitions to remove `LsToolResultEvent`.
2026-02-02 14:55:48 +01:00
can1357 0c5be1d660 fix(coding-agent): removed incorrect timeout unit conversion logic in cursor, fetch, gemini-image, and ssh tools
- Removed incorrect millisecond-to-second auto-conversion logic in timeout handling across cursor, fetch, gemini-image, and ssh tools.
- Fixed timeout parameter interpretation to respect user-provided values without automatic unit conversion heuristics.
2026-01-28 15:42:38 +01:00
can1357 db8089cc23 refactor(coding-agent/tools): standardized search tool parameters across find and grep
- Renamed `head_limit` to `limit` in grep and find tools for consistency.
- Added `context` as optional alias for the `c` parameter in grep.
- Made hidden files inclusion configurable in find with `hidden` parameter.
- Integrated .gitignore and .ignore file support in find tool.
- Updated plan mode documentation for self-contained plan files.
2026-01-25 22:38:06 +01:00
can1357 779ca4872b style(deps): migrated from Prettier to Biome and updated formatting rules
- Removed Prettier configuration files (.prettierignore and .prettierrc) and migrated formatting to Biome.
- Updated Biome configuration from version 2.3.11 to 2.3.12 and changed arrowParentheses rule from 'always' to 'asNeeded'.
- Pinned @biomejs/biome dependency to exact version 2.3.12 in package.json and bun.lock.
- Applied consistent arrow function formatting across 489 files by removing unnecessary parentheses around single parameters.
- Removed blank lines after comment blocks and reorganized imports for consistency across the codebase.
2026-01-24 04:20:19 +01:00
can1357 e22d123009 refactor(fs): migrated remaining sync file operations to async
- Converted readdirSync, readFileSync, and statSync to async readdir, readFile, stat across skills and agent discovery.
- Made scanDirectoryForSkills async and refactored custom directory scanning to use Promise.all for concurrent processing.
- Updated agent discovery to use fs/promises for async file reading and refactored helper patterns.
- Added AgentParsingError exception class for better error handling during agent parsing.
- Added filesystem error type guards (isEnoent, isEacces, isPerm, etc.) to pi-utils for safe error checking.
- Added color manipulation utilities to pi-utils for accessibility features.
- Added color-blind mode setting to settings manager.
- Migrated plugins, settings, and config modules from sync to async file operations.
- Updated error handling to use new pi-utils type guards for type-safe checking.
2026-01-24 03:18:03 +01:00
can1357 f66e5dba9b build(config): refactored build and TypeScript configuration with Bun loaders
- Removed WASM generation script; use Bun `wasm?raw` loader for imports.
- Added bunfig.toml with loaders for `.md`, `.py`, and `.wasm?raw` text imports.
- Added types/assets/index.d.ts for global TypeScript module declarations.
- Unified TypeScript configuration with tsgo-based checking across monorepo.
- Removed build and WASM steps from install and publish pipelines.
2026-01-24 00:03:52 +01:00
can1357 0fe761dc4b build(deps): refactored TypeScript and package configuration across monorepo
- Added tsconfig.publish.json files to all packages with optimized publish-time configuration.
- Updated all package.json scripts with prepublishOnly hooks for correct type checking during publish.
- Added @oh-my-pi/omp-stats path mappings to root tsconfig.json for consistent imports.
- Added WASM generation script for photon module and integrated into install:dev script.
2026-01-23 13:46:06 +01:00
can1357 cb5bbbf382 refactor(coding-agent): flattened directory structure, eliminated core/ folder
- Eliminated core/ directory (252 files, 23 subdirs → distributed)
- Reduced max nesting from 9 levels to 5 levels
- Promoted tool subdirs to top level: exa/, lsp/, patch/, task/, web/
- Merged web-scrapers/ + web-search/ into web/{scrapers,search}/
- Flattened modes/interactive/ to modes/
- Split execution/ into: ipy/ (python), exec/ (bash), ssh/
- Renamed ipy/python-*.ts to ipy/*.ts (executor, kernel, etc.)
- Flattened cursor/exec-bridge.ts to cursor.ts
- Created logical groupings: config/, session/, extensibility/, export/
- Updated all imports across 500+ files
2026-01-23 12:24:47 +01:00