Commit Graph

81 Commits

Author SHA1 Message Date
can1357 6b4823181b test: cleaned test suites and documented filtering guidelines
- Remove redundant definedness, null, and type checks across test suites in multiple packages.
- Clean up unused assertions, metadata tests, and obsolete test cases.
- Add good versus bad test filter guidelines and requirements to project documentation.
2026-08-13 08:28:42 +02:00
can1357 bc39ffa265 feat: introduced omptype validation package and migrated workspace dependencies
- Introduce `@oh-my-pi/omptype` as a new ArkType-compatible schema validation package featuring a lazy JIT runtime, JSON Schema emission, and compatibility adapters.
- Replace `arktype` across workspace packages and test utilities with `@oh-my-pi/omptype`.
- Add benchmark suites, tests, and documentation for the new validation engine and adapters.
- Update workspace build, test runner, and release configurations to include the new package.
2026-08-03 21:56:48 +02:00
can1357 c565e6fb44 feat(catalog): migrated model catalog endpoints to stencil.so with ETag and ZStd
- Migrated model catalog fetching and documentation references from the models.dev API to the stencil.so well-known models endpoint.
- Added support for zstd decompression and session-based caching with ETag conditional requests and stale fallback handling.
- Updated test suites, mock URLs, and constants across catalog and coding-agent packages to target stencil.so.
2026-07-31 20:38:49 +02:00
Rod Vagg 1c07f76a87 chore(agents): update agents logging guidelines for TUI vs console 2026-07-25 10:17:32 +10:00
can1357 c2eeaa640d docs: added central utilities guidance and merge commit conventions
- Add Central Utilities section guiding contributors to search for existing helpers before implementing new ones, with examples of sanctioned patterns.
- Add merge commit convention format for maintainer PR merges in the Testing Guidance section.
2026-07-23 20:45:18 +02:00
can1357 cc78244217 fix(coding-agent): shared streamed-arg decode across render paths
- Extracted decodeStreamedToolArgs into tool-args-reveal.ts and used it from both the live event path and transcript rebuilds, so mid-write theme/settings/focus replays no longer show stale streamed write/edit/eval content.
- Fixed the smoothing-off live path returning stale provider-parsed args.
- Documented the mandatory shared decode in the AGENTS.md streaming-preview hazard note; added changelog entries for this batch.
2026-07-02 01:03:48 +02:00
can1357 5a044dc0da feat: consolidated and automate changelog management
- Added `rewrite-changelog.ts` and `fix-changelogs.ts` utilities to automate the consolidation of release notes using LLM-assisted processing.
- Updated multiple internal changelog files by consolidating redundant entries and improving phrasing for readability.
- Implemented `previewLine` utility in `coding-agent` to prevent visual spillover in status rows by managing text truncation and whitespace.
- Updated `package.json` with new workflow scripts for managing package-level change histories and documentation indexes.
2026-06-27 03:08:52 +02:00
can1357 44368e3459 test(coding-agent): removed tests using source-grep patterns
- Removed multiple test files and cases that relied on brittle source string matching for validation.
- Updated project architecture documentation to explicitly prohibit source-grep style testing patterns.
- Eliminated legacy reproduction tests for issues that reached project maturity.
2026-06-26 15:51:34 +02:00
can1357 af01c63e3b test(ai): updated credential access in E2E tests and CI test runner
- Updated the `ai` package E2E tests to retrieve environment variables via `e2eApiKey` to ensure they only execute when E2E testing is enabled.
- Refactored the `scripts/ci-test-ts` runner to conditionally apply the `--only-failures` flag based on provided arguments.
2026-06-25 21:50:55 +02:00
can1357 3ab675a83b fix: added buffered worker inboxing and standardized worker selectors
- Added `WorkerInbox` and `installWorkerInbox(port)` to queue worker messages before bind.
- Added `consumeWorkerInbox()` to replay buffered messages and clear one active inbox.
- Added buffered inbox consumption in JS and tab worker transports before direct message handlers.
- Normalized worker selector arguments to the `__omp_worker_*` naming across workers and tests.
2026-06-15 11:59:44 +02:00
can1357 fd4bdf77fc docs(agent): updated AGENTS.md changelog review guidance wording
- Updated AGENTS.md to state that changelog section order and formatting should not be flagged in reviews or PRs.

Closes #2377
Closes #2379
Closes #2380
Closes #2381
Closes #2382
Closes #2383
Closes #2384
Closes #2410
Closes #2432
Closes #2449
Closes #2451
Closes #2452
Closes #2456
Closes #2457
Closes #2466
Closes #2487
2026-06-14 17:57:10 +02:00
can1357 9f8f49f6c1 docs: note that fix-changelogs normalizes changelog formatting 2026-06-14 17:51:45 +02:00
can1357 1b9d9d0851 refactor(catalog)!: split model catalog from pi-ai
Move bundled models, model cache/manager, thinking metadata, effort helpers,
provider descriptors/discovery, wire constants, and model identity utilities
into the new @oh-my-pi/pi-catalog package.

Update pi-ai to keep provider runtime/auth concerns, move catalog provider
metadata into CATALOG_PROVIDERS, and migrate coding-agent, agent, stats, docs,
and tests to import catalog values from pi-catalog.

Split coding-agent model registry helpers into discovery, roles, and models
config modules while preserving registry orchestration.

BREAKING CHANGE: @oh-my-pi/pi-ai no longer exports catalog subpaths such as
/models, /model-cache, /model-manager, /model-thinking, /effort,
/provider-models*, discovery helpers, and provider wire constants; use the
matching @oh-my-pi/pi-catalog subpaths instead.
2026-06-10 04:06:57 +02:00
can1357 dc5c93462f feat: rerouted worker subprocesses through the bundled CLI host entrypoint
- Rerouted sync, tab, js-eval, and tiny workers to re-enter CLI modes via `__omp_*` selectors.
- Adjusted `cli.ts` startup to dispatch worker entrypoints before parsing and exit 1 on uncaught errors.
- Bundled CLI as `dist/cli.js` in prepack, switching `omp` binary and published files.
- Removed explicit Bun `--compile` worker entrypoints from build/release scripts in favor of host-entry dispatch.
- Added `declareWorkerHostEntry()` and `workerHostEntry()` environment helpers and `PI_COMPILED` binary detection.
2026-06-10 03:57:31 +02:00
can1357 1cb451a071 fix(workers): replaced file-URL import pattern with compiled-binary-aware spawn
- Replaced `with { type: "file" }` worker imports with `isCompiledBinary()` hybrid: literal string for `--compile` static analysis, `new URL(import.meta.url)` for dev portability.
- Added worker entrypoints as explicit `--compile` args in `build-binary.ts` so Bun emits them into bunfs.
- Added `smokeTestSyncWorker` and `omp --smoke-test` to catch silent worker-load failures in compiled binaries (fixes #1011, #1027).
- Added `isCompiledBinary()` utility to `@oh-my-pi/pi-utils` detecting bunfs path markers.
2026-05-12 16:40:15 +02:00
can1357 f56cbbf4c6 feat(stats): added frustration metrics to stats parser and charting
- Added new frustration and revised behavior metrics across stats types, parser mappings, and UI charts.
- Reworked session sync to fan out parsing across a capped worker pool with SyncOptions progress callbacks.
- Added worker-based parse messaging and throttled TTY progress rendering in the stats sync command.
- Updated behavior scoring to strip structured content, ignore noisy prompts, and fix profanity boundary regressions.
- Expanded user message schema and migrations, then repaired assistant model/provider links during sync backfill.
- Updated worker-import guidance in AGENTS.md and recorded sync-progress/metrics updates in package changelogs.
2026-05-12 07:55:23 +02:00
can1357 5f2c47ed85 docs: condensed AGENTS.md 2026-05-07 02:03:56 +02:00
can1357 2f756bcc1b fix(ai/provider-models): corrected OpenCode Go API routing for Qwen models
- Updated qwen3.5-plus and qwen3.6-plus to use openai-completions API with /v1 base URL path.
- Added idOverrides parameter to createOpenCodeApiResolution to allow per-model API routing corrections.
- Configured OPENCODE_GO_API_RESOLUTION to override Qwen models to openai-completions, matching the actual OpenCode Go endpoint table.
2026-04-30 04:02:57 +02:00
can1357 6d07944654 refactor: migrated binary detection to $which() utility across codebase
- Replaced all Bun.which() calls with $which() utility from @oh-my-pi/pi-utils across 22 files.
- Removed findBashOnPath() wrapper function from procmgr.ts, consolidating binary path resolution.
- Updated AGENTS.md documentation to reflect new $which() API usage pattern.
- Centralized binary detection logic through shared utility, reducing code duplication.
2026-04-08 05:28:22 +02:00
can1357 db763e327d docs: clarified test isolation requirements and mock restoration patterns
- Clarified test isolation requirements to prohibit `mock.module()` due to global registry leakage across test files.
- Added guidance on using `spyOn` with proper restoration via `vi.restoreAllMocks()` for reliable per-test isolation.
- Documented workaround for pass and package dependencies using namespace imports and spy restoration in `afterEach`.
2026-04-02 02:00:20 +02:00
can1357 df369dd7fd refactor(coding-agent): migrated test mocks to vitest spyOn with Symbol.dispose cleanup
- Migrated test mocking from bun:test mock API to vitest spyOn pattern across 9 test files.
- Extracted mock setup logic into reusable helper functions with Symbol.dispose cleanup pattern.
- Replaced manual beforeEach/afterEach and try-finally blocks with TypeScript 5.2 using declarations.
- Removed 178 lines of boilerplate mock initialization and restoration code from test suite.
2026-03-26 16:17:27 +01:00
can1357 82e4f168b9 feat: implemented background model discovery with provider caching for faster startup
- Added background model discovery with provider status tracking and 24-hour model caching to improve startup performance.
- Changed model discovery timeout from 3000ms to 250ms and deferred blocking refresh to background operations for faster initialization.
- Fixed model discovery to preserve cached models when providers are unavailable or unauthenticated.
- Added validation in Kitty key formatting to reject unsupported modifiers and improved error handling.
- Reorganized CI workflow to run TypeScript linting in check job and conditional Rust checks in native job matrix.
- Updated system prompt and tool guidance to recommend combined investigation-and-edit workflows and maintainable code practices.
2026-03-10 07:08:00 +01:00
can1357 57c89cf503 refactor(auth-storage): restructured credential matching to use accountId
- Extracted OAuth identifier logic into public functions extractOAuthCredentialIdentifiers and extractOAuthTokenIdentifiers.
- Replaced single credentialIdentity string with multi-identifier resolveCredentialIdentifiers returning string[] for flexible matching.
- Changed credential deduplication from email-based to accountId-based matching in replaceAuthCredentialsForProvider.
- Updated auth-storage tests to verify accountId-prioritized deduplication behavior across soft-disable and hard-delete scenarios.
- Added documentation comments in coding-agent modules explaining partial JSON preservation for streaming tool previews.
- Documented streaming tool preview requirements and render paths in AGENTS.md.
2026-03-08 15:58:52 +01:00
can1357 85c5fad2bc refactor: replace named re-exports with star re-exports in barrel files
Convert export { A, B, ... } from and export type { ... } from blocks
to export * from across all packages (ai, coding-agent, natives, tui, utils).
2026-02-28 22:34:02 +01:00
can1357 2e33e436b4 feat: switched to native text sanitization, removed Bun.stripANSI
- Added `sanitizeText` function to pi-natives that strips ANSI escape sequences, removes control characters and lone surrogates, and normalizes line endings.
- Moved `sanitizeText` function from `@oh-my-pi/pi-utils` to `@oh-my-pi/pi-natives` for better code organization and native performance.
- Added line length clamping (4000 characters) to bash and Python execution output to prevent excessively long lines.
- Replaced internal `#normalizeOutput` methods with `sanitizeText` utility function in bash and Python execution components.
- Fixed bash interactive tool to gracefully handle malformed output chunks by normalizing them with `sanitizeText`.
- Simplified documentation by removing WASM terminology from package descriptions and comments.
2026-02-14 03:25:13 +01:00
can1357 acf8ab5225 style: stylistic changes 2026-02-10 07:39:39 +01:00
can1357 4eef01bdaa fix: fixed tab character display holes in UI by sanitizing output
- Fixed tab character display in error messages and bash tool output by applying replaceTabs() sanitization.
- Added TUI rendering sanitization documentation to AGENTS.md with guidelines for sanitizing text in tool renderers.
- Applied replaceTabs() function to error text in patch shared module to ensure proper tab-to-space conversion.
- Applied replaceTabs() function to bash tool output lines in both expanded and collapsed display modes.
2026-02-06 07:38:46 +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 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 978b93ba62 refactor: migrated native tools to WASM-based implementation
- Consolidated grep, find, and image processing into a new `@oh-my-pi/pi-natives` WASM package.
- Eliminated subprocess overhead and simplified JS tool implementations.
- Updated CI to include Rust workspace, linting, formatting, and WASM build steps.
- Documented `Promise.withResolvers()` and `using` declarations for wasm-bindgen.
2026-01-29 09:29:21 +01:00
can1357 34569030c6 refactor(coding-agent): migrated import paths to relative imports and consolidated tool imports
- Migrated import paths from absolute package imports to relative imports throughout coding-agent modules.
- Consolidated related imports in tools/index.ts to reduce import statement count.
- Removed guideline about avoiding relative parent imports from AGENTS.md documentation.
- Reformatted code examples in AGENTS.md for improved readability with multi-line formatting.
2026-01-28 12:59:49 +01:00
can1357 d9a3291641 feat(deps): replaced external JSON/JSONL and text utilities with Bun built-in APIs
- Replaced external JSON/JSONL parsing libraries with Bun's built-in JSON5 and JSONL APIs across all packages.
- Removed dependencies: json5, ndjson, get-east-asian-width, json-stringify-safe, split2, through2, and @types/ndjson.
- Replaced custom text width and ANSI wrapping implementations with Bun.stringWidth() and Bun.wrapAnsi() APIs.
- Updated Bun type definitions from ^1.2.17 to ^1.2.18 and bun-types from ^1.3.5 to ^1.3.7.
- Refactored JSONL parsing throughout codebase to use Bun.JSONL.parse() and Bun.JSONL.parseChunk() with improved buffer management and error handling.
- Updated test assertions to use Bun.stringWidth() for dynamic width calculations instead of hardcoded values.
2026-01-27 19:18:58 +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 fcbfab765b refactor: consolidated module import paths
- Removed custom TypeScript path aliases and the associated transformation script.
- Replaced aliased imports with direct `@oh-my-pi` package imports for improved clarity.
- Simplified internal module references by removing explicit `/index` suffixes.
2026-01-23 21:01:13 +01:00
can1357 6e5fa5b24d docs: added guidelines for import patterns, prompt management, and static file handling
- Added guidelines for import patterns, prompt management, and static file handling in the coding agent documentation.
2026-01-23 13:46:06 +01:00
can1357 a2501514d2 feat(omp-stats): added omp-stats package for AI usage tracking with SQLite aggregation
- Added new omp-stats package for AI usage statistics tracking with SQLite-based aggregation.
- Implemented web dashboard with real-time visualization and auto-refresh functionality.
- Added `omp stats` CLI command with configurable port, JSON output, and summary options.
- Created programmatic API for session sync and stats retrieval with TypeScript exports.
2026-01-21 10:25:22 +01:00
can1357 fa881fd508 refactor: removed voice control and git features from coding-agent
- Removed voice control and TTS features from coding-agent package.
- Removed git tool integration and worktree management from coding-agent.
- Deleted entire git-tool package and all git operations.
- Inlined OpenAI Codex prompt utilities and removed provider exports.
2026-01-21 08:09:15 +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 70af6c525c docs(coding-agent): improved system prompt with clearer tone, planning, and verification guidelines
- Updated system prompt with clearer tone guidelines emphasizing directness and conciseness.
- Revised workflow instructions to require explicit planning for non-trivial tasks.
- Enhanced verification guidance to prefer external feedback loops like tests and linters.
- Added explicit alignment and prohibited behavior sections to improve response quality.
2026-01-10 22:55:15 +01:00
can1357 91a49e7178 feat(coding-agent): added diff-aware code review with auto-scaled reviewer agents
- Added upfront diff parsing and filtering in code review command with automatic reviewer agent count recommendation.
- Added fsync call before closing session writer to ensure data durability.
- Replaced Bun.Glob-based gitignore scanning with fd command execution in find tool.
- Fixed hasOverrides logic to only set true when parsed.servers has entries in LSP config.
- Replaced console.log/error/warn calls with structured logger across session manager and LSP modules.
2026-01-08 00:26:31 +01:00
can1357 b9c33d0788 docs(coding-agent): expanded architecture docs for SDK wrapper and capability system
- Updated DEVELOPMENT.md architecture diagram to reflect SDK wrapper, capability system, and git-tool dependency.
- Expanded directory structure documentation to cover 40+ new files including capability, discovery, and extension systems.
- Revised development workflow instructions to use bun commands instead of npm/tsx.
- Added documentation sections for new extension sources and capability types.
- Updated AGENTS.md with simplified issue labeling, corrected repository URLs, and streamlined release commands.
- Consolidated README.md package table and removed redundant development/publishing sections.
2026-01-07 03:09:30 +01:00
can1357 6f128238f3 feat(coding-agent): added configurable sub-providers and fixed a few
- Added webSearchProvider, imageProvider, and git.enabled settings for configurable provider selection and feature toggles.
- Added offset and limit parameters to Output tool for paginated reading of large outputs.
- Added provider fallback chain for web search with WebSearchProviderError class for graceful degradation.
- Changed generate_image tool to save images to temp files instead of inline base64 to reduce context bloat.
- Changed web search default model from claude-sonnet-4-5-20250514 to claude-haiku-4-5.
- Added git command interception in bash to redirect to dedicated git tool when enabled.
2026-01-06 22:16:24 +00:00
can1357 56e760f2bc feat(git-tool): added git-tool package with 22 operations and safety guards
- Added new @oh-my-pi/pi-git-tool package with 22 git operations, safety guards, caching, and GitHub CLI integration.
- Added /wt slash command for git worktree management with create, list, merge, remove, spawn, and parallel operations.
- Added worktree library with collapse strategies (simple, merge-base, rebase) and session tracking for agent tasks.
- Added structured git tool with TypeBox schema exposing gitTool and createGitTool from SDK.
- Added safety policies blocking force push to protected branches and warning on destructive operations.
2026-01-05 15:37:44 +01:00
can1357 754da171a4 feat: added interactive /review command with multi-mode selection
- Added interactive /review command with mode selection for base
branch, uncommitted changes, specific commit, or custom
instructions.
- Added subprocess tool registry for extracting and rendering tool
data from subprocess agents.
- Added combined review result rendering with verdict and findings
tree structure.
- Changed bundled commands to be overridable by user/project
commands with same name.
- Removed findings_count parameter from submit_review tool in
favor of automatic counting.
- Added fix npm script for auto-fixable lint issues with unsafe
fixes.
2026-01-03 06:39:04 +01:00
can1357 2be354322d chore: renamed package scope to @oh-my-pi for consistent branding
- Renamed npm package scope from @mariozechner to @oh-my-pi across all packages for consistent branding.
- Removed packages/pods directory and all related pod management functionality.
- Updated import paths and module declarations throughout codebase to reflect new package names.
- Reformatted code with consistent trailing comma removal and ternary operator alignment.
2026-01-02 18:08:23 +01:00
can1357 560c9670a8 feat: added MCP support and plugin system for external tool integration
- Added MCP (Model Context Protocol) support with stdio and HTTP transports for external tool integration.
- Implemented plugin system with install, enable, configure, and doctor commands for extensibility.
- Added 22 Exa MCP tools for web search, LinkedIn, company research, and websets operations.
- Introduced LSP tool with rust-analyzer support for code intelligence (diagnostics, hover, references, code actions).
- Added task tool for delegating work to specialized subagents with parallel execution support.
- Implemented web_search and web_fetch tools with Anthropic and Perplexity provider support.
2026-01-02 17:54:42 +01:00
can1357 b85d3f6aa4 merge(pi/main): integrate upstream changes through v0.31.1
Merged 53 commits from pi/main including:
- Export HTML rewrite with tree sidebar and /share command
- Hooks API enhancements (custom status, editor, session management)
- Edit diff preview before tool execution
- TUI fixes (Unicode format chars, OSC 8 hyperlinks, emoji optimization)
- Gemini CLI rate limit retry with server-provided delay
- Various bug fixes and documentation updates

Resolved conflicts by preserving Bun migration (spawn→Bun.spawn,
fs→Bun.file) while accepting upstream's new features and APIs.
2026-01-02 14:34:27 +01:00
can1357 1cee37cf92 build: migrated from Node.js to Bun for native TypeScript support
- Migrated from Node.js to Bun runtime to leverage native TypeScript execution and faster startup times.
- Replaced npm with bun package manager and updated lockfile format.
- Converted Node.js APIs (child_process, fs, readline) to Bun equivalents across all packages.
- Updated shebang lines from node/tsx to bun for CLI entry points.
- Removed TypeScript build step by using source files directly as package entry points.
- Updated CI workflows to use Bun instead of Node.js for installation and testing.
2026-01-02 13:46:05 +01:00