Commit Graph

15 Commits

Author SHA1 Message Date
oldschoola fa903b2b2c fix(test): migrate fs.rmSync to removeSyncWithRetries for EBUSY-safe cleanup
Export removeSyncWithRetries from @oh-my-pi/pi-utils as a standalone
function, then migrate the highest-impact fs.rmSync call sites:

- test/helpers/temp-home-cleanup.ts: 2 fs.rmSync → removeSyncWithRetries
  (affects all tests using the cleanupTempHome helper)
- test/core/apply-patch-regression.test.ts: 16 fs.rmSync → removeSyncWithRetries
  (the most fs.rmSync calls of any test file)

removeSyncWithRetries retries on EBUSY/EPERM/ENOTEMPTY (40x25ms on
Windows), matching TempDir.removeSync's retry logic. On Linux/macOS
(CI) the retries are a no-op — fs.rmSync succeeds immediately.
2026-06-19 17:27:54 -07:00
can1357 0f3cced15e refactor(edit): restructured edit tool with substring find and focused chunk rendering
- Reorganized edit tool from `patch/` to `edit/` directory with dedicated mode subdirectories (chunk, patch, hashline, replace).
- Replaced line-scoped edit operations with substring-based `find` parameter and added `replace_body` operation for preserving signatures.
- Added chunk focus modes (Expanded, Collapsed, Container) and focused rendering to display only touched chunks and adjacent siblings.
- Implemented notebook (ipynb) language support with virtual source conversion and cell-based chunk parsing.
- Enhanced chunk edit error messages with consistent checksum mismatch reporting and improved chunk selector auto-resolution.
- Extracted edit mode implementations into separate modules with improved helper functions and LSP integration for diagnostics.
2026-04-08 04:18:59 +02: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 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 7bb2e1aa58 feat(port): ported pi-mono improvements + worker & patch improvements
- added Azure OpenAI Responses support and OpenRouter routing compat
- improved patch applicator diagnostics and subagent context propagation
- updated editor cursor handling, keybindings, and working message API
- refreshed porting sync metadata
2026-01-25 13:50:08 +01:00
can1357 51d39e7eea refactor(imports): migrated node module imports to namespace imports
- Converted named imports from node modules (fs, path, os) to namespace imports across all packages.
- Extended extension loader error handling with isEacces and hasFsCode type guards.
2026-01-24 03:37:59 +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
can1357 7b5af2dd9f refactor(build): migrated imports to path aliases with per-package tsconfig support
- converted relative imports to path aliases ($c/*, $ai/*, $tui/*, etc.) across all packages
- added per-package tsconfig.json with complete path mappings for runtime resolution
- set importModuleSpecifier to non-relative for IDE auto-import preferences
- updated dev script to run from monorepo root for consistent path resolution
2026-01-23 11:56:32 +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 e22d74b8bb fix(coding-agent/patch): accept unique substring matches regardless of line length ratio
Previously, substring context matching required the pattern to be at least
30% of the line length to prevent ambiguous matches. This caused failures
when matching short identifiers like 'class EditTool' against long export
lines with generics and implements clauses.

Now, if exactly one substring match exists in the file, it is accepted
regardless of the ratio threshold - uniqueness alone is sufficient for
disambiguation. The ratio filter is only applied when multiple substring
matches exist.

Added regression tests for model edit attempts from session analysis.
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 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