Commit Graph

59 Commits

Author SHA1 Message Date
Sam Biggins 15db1dec56 fix(ai): update spoofed Gemini CLI User-Agent to v0.35.3 format (#574)
* fix(ai): update spoofed Gemini CLI User-Agent to v0.35.3 format

Gemini CLI v0.35+ changed its User-Agent format:
- Dropped 'google-api-nodejs-client/10.5.0' suffix
- Added surface field (third param in parens)
- New format: GeminiCLI/VERSION/MODEL (PLATFORM; ARCH; SURFACE)

The stale v0.34.0 UA was contributing to google-gemini-cli/gemini-3.1-pro-preview
being rejected, alongside Google's new abuse detection for third-party CCA usage
(google-gemini/gemini-cli#22970).

Verified: model responds successfully with updated UA.

* feat(scripts): add spoofed version drift checker

Fetches latest stable release from google-gemini/gemini-cli GitHub
releases and compares against the hardcoded version in the provider.

  bun check-spoofed-versions         # report drift, exit 1 on mismatch
  bun check-spoofed-versions --update # apply version bump in-place

Extensible for additional spoofed tools (Antigravity, Copilot headers).
2026-04-01 05:18:58 +02:00
can1357 8e3e0ebf9e feat: introduced Effort enum and ThinkingConfig for model-aware reasoning
- Introduced Effort enum and ThinkingConfig metadata for per-model reasoning capabilities with min/max effort levels.
- Migrated thinking level API from string-based ThinkingLevel to structured Effort enum across agent and AI packages.
- Added model-thinking module with effort mapping, policy application, and semantic versioning utilities for provider-specific thinking modes.
- Removed supportsXhigh() function and replaced effort clamping with model-aware validation using ThinkingConfig metadata.
- Expanded models.json with thinking configuration objects for 50+ models including Claude, Gemini, and OpenAI variants.
- Added Python analysis scripts for edit tool usage patterns and tool invocation stream processing.
2026-03-06 12:35:01 +01:00
can1357 a117b35f9f chore: organized package.json exports across 11 packages with sync-exports script
- Added sync-exports.ts script to enforce canonical package.json field ordering and auto-generate exports from filesystem structure.
- Expanded subpath exports across 11 packages (ai, agent, coding-agent, natives, stats, utils, tui, swarm-extension) to enable flexible module imports.
- Reorganized package.json field ordering to follow standard conventions with metadata before main/exports and files/exports at end.
- Consolidated wildcard export patterns to simplify import paths while maintaining backward compatibility with explicit subpath exports.
2026-02-21 16:21:57 +01:00
can1357 18417c7672 fix(ci): add missing subshell closing paren in install test 2026-02-20 12:47:04 +01:00
can1357 76ab1d53e4 fix(ci): add overrides for tarball install to resolve deps locally
bun resolves transitive deps from the npm registry even when all
packages are provided as local tarballs. Since 12.15.0 isn't published
yet, these lookups fail. Adding overrides in package.json forces bun
to resolve all @oh-my-pi/* packages from the local tarballs.
2026-02-20 12:41:24 +01:00
can1357 c0c45dede7 fix(ci): install all tarballs in single bun add to avoid registry resolution
The coding-agent tarball depends on @oh-my-pi/pi-ai@12.15.0 etc. which
aren't published yet. Two separate bun add calls caused the second to
resolve deps against npm instead of the already-installed local tarballs.
2026-02-20 12:35:16 +01:00
can1357 25b5d125d4 ci: add install-method smoke tests and gate release
Fixes #121
2026-02-20 10:33:48 +01:00
can1357 fe27bc4cf2 feat: enhanced regex sanitization, LSP client messaging, and native addon installation
- Added support for braced escape sequences (\p{...}, \P{...}, \x{...}, \u{...}) in regex pattern sanitization to properly preserve unicode property escapes and hex escapes.
- Improved LSP client message writing by simplifying header encoding and refactoring abort signal handling with the untilAborted utility.
- Enhanced native addon installation script to dynamically fetch release tags from GitHub API instead of using hardcoded versions.
- Relaxed native addon validation to only error when no addons are found rather than when any are missing, improving flexibility in addon availability.
2026-02-16 18:33:05 +01:00
can1357 a4f845a465 feat: added CPU variant support for x64 native addons with AVX2/baseline fallback
- Added CPU variant support for x64 native addons with modern (AVX2/x86-64-v3) and baseline (x86-64-v2) variants, enabling automatic fallback when modern variants are unavailable.
- Added automatic AVX2 CPU detection on Linux, macOS, and Windows platforms to select appropriate native addon variant at runtime.
- Updated native addon filename scheme to include CPU variant suffix (e.g., pi_natives.linux-x64-modern.node) for x64 platforms.
- Updated CLI update mechanism to support downloading and installing multiple native addon variants per platform with fallback support.
- Removed fallback untagged pi_natives.node binary creation; platform and variant-tagged binaries are now required.
2026-02-16 18:33:03 +01:00
can1357 0b492d9fbb fix(react-edit-benchmark): fixed incorrect path resolution for CLI module using Bun.fileURLToPath()
- Fixed incorrect path resolution for CLI module by using Bun.fileURLToPath() to convert import.meta.resolve() result to a proper file path.
- Reordered constant declarations to ensure TMP_DIR is initialized before CLI_PATH which depends on it.
- Updated scripts/repro-stuck.ts to use consistent CLI path resolution with Bun.fileURLToPath().
2026-02-12 15:10:17 +01:00
can1357 acf8ab5225 style: stylistic changes 2026-02-10 07:39:39 +01:00
can1357 5b6f88dd95 fix: fixed #11 schema normalization, #10 version parsing, and variable declarations
- Fixed schema normalization in Google provider to handle array-valued type fields by converting them to single type with nullable flag.
- Refactored version parsing in install script to use bash parameter expansion instead of IFS field splitting.
- Changed variable declarations from let to var in theme module global scope.
2026-02-07 02:43:56 +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 8255875525 refactor(utils): restructured stream handling and improved error semantics across utilities
- Refactored readSseJson abort handling to use pipeThrough with signal instead of manual event listeners, improving stream cancellation semantics.
- Replaced finally block with catch block to handle abort errors explicitly, preventing unnecessary cleanup operations.
- Reformatted test strings to use single quotes for consistency with project style guidelines.
- Removed unused isEnoent import and consolidated error code checking in dump-edit-history script.
2026-02-05 13:41:49 +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 acc799cd2e chore(ci): improved release process and expanded Rust toolchain support
- Updated release process to create new commits with descriptive messages instead of amending previous commits.
- Changed release push strategy from force push to regular push for better git history integrity.
- Extended check:rs script to verify minimal dependency versions and Windows MSVC target compilation.
- Added x86_64-pc-windows-msvc target to Rust toolchain configuration for cross-compilation support.
2026-02-05 08:28:56 +01:00
can1357 37c74bb19d perf: migrated timing measurements to Bun.nanoseconds() for higher precision
- Migrated timing measurements from `performance.now()` to `Bun.nanoseconds()` for higher precision benchmarking across all benchmark and timing-sensitive code.
- Updated elapsed time calculations to convert nanoseconds to milliseconds using division by 1e6 to maintain consistent time units.
- Increased benchmark precision from 4 to 6 decimal places for per-operation timing measurements.
- Refactored grep benchmark to use averaged timing values instead of storing individual iteration times, reducing memory overhead.
2026-02-05 06:19:49 +01:00
can1357 89e6479661 refactor: migrated environment variable access from process.env to Bun.env across 71 files
- Migrated all environment variable access from Node.js `process.env` to Bun runtime `Bun.env` API across the entire codebase.
- Updated 71 files including source code, tests, documentation, and configuration to use Bun's native environment variable API.
- Added comprehensive environment variables documentation in `packages/coding-agent/docs/environment-variables.md` covering 100+ environment variables organized by category.
- Updated CHANGELOG entries to reflect migration from `process.env` to `Bun.env` and environment variable prefix changes (PI_* vs OMP_*).
- Maintained identical behavior and logic across all changes - only the environment variable access method was updated.
2026-02-05 04:51:18 +01:00
can1357 ec801665bc refactor(env): migrated environment variables from OMP_ to PI_ prefix and centralized access via getEnv()
- Migrated environment variable access from direct process.env to centralized getEnv() utility function across all packages.
- Renamed environment variable prefix from OMP_ to PI_ throughout codebase (e.g., OMP_CODING_AGENT_DIR -> PI_CODING_AGENT_DIR).
- Removed automatic environment variable migration from PI_ to OMP_ prefixes via migrate-env.ts module.
- Removed env setting from configuration schema and applyEnvironmentVariables() method from settings.
- Updated CI/CD build configuration to use PI_COMPILED flag instead of OMP_COMPILED.
- Changed venvPath property in PythonRuntime from nullable (string | null) to optional (string | undefined).
2026-02-05 02:55:01 +01:00
can1357 f41705ce3a feat(coding-agent): improved Python startup performance with prelude caching and shared gateway mode
- Added Python prelude caching to improve startup performance by caching helper functions and module discovery results.
- Added OMP_DEBUG_STARTUP environment variable for detailed startup stage tracing across initialization pipeline.
- Changed Python kernel initialization to require shared gateway mode, removing support for local kernel gateway startup.
- Improved error handling in shared gateway acquisition with automatic retries on 5xx status codes.
- Added repro-stuck.ts script for reproducing and debugging rare CLI hang issues with Chrome DevTools integration.
- Added trace-loader.ts preload script for tracing module resolution during startup diagnostics.
2026-02-04 05:02:28 +01:00
can1357 ad37a58b5f feat(scripts): added job-level status checking in CI watcher with auto log tailing for failures
- Added job-level status checking in CI watcher to fail fast on first job failure with detailed error reporting.
- Added automatic log tailing for failed CI jobs showing last 20 lines of output.
2026-02-01 20:34:12 +01:00
can1357 1e52c837c8 feat(natives): added native addon distribution and platform validation to CLI update mechanism
- Added native addon distribution and installation support to the CLI update mechanism, enabling platform-specific native modules to be downloaded and installed alongside the main binary.
- Added platform validation in native addon loader to verify supported platforms (linux-x64, linux-arm64, darwin-x64, darwin-arm64, win32-x64) with helpful error messages for unsupported configurations.
- Enhanced native addon loading error messages to provide platform-specific troubleshooting guidance for both npm/bun installations and local development environments.
- Updated installation scripts (install.sh, install.ps1) to download and install native addon files alongside the main binary during CLI installation.
2026-02-01 05:17:06 +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 32bc2b8d02 fix: fixed LSP server display, file streaming, and slash command autocomplete; reorganized npm scripts
- Fixed LSP servers showing as 'unknown' in status display when server warmup fails by using index-based lookup to correctly extract server name and file types.
- Fixed Read tool loading entire file into memory when offset/limit was specified by implementing streaming line-by-line processing that only collects requested range.
- Fixed slash command autocomplete applying stale completions when typing quickly by adding staleness check before applying completion on Enter/Return.
- Reorganized npm scripts to follow consistent naming pattern with separate TypeScript and Rust variants for check, lint, fmt, and fix operations.
- Updated release script to properly handle Rust workspace version updates in Cargo.toml files and regenerate lockfiles.
2026-01-29 10:57:20 +01:00
can1357 ec463fe7c7 chore(scripts): updated Bun engine requirement to 1.3.7 and added version validation
- Updated minimum Bun engine requirement from 1.2.0 to 1.3.7 across root and coding-agent packages.
- Added Bun version validation to install.ps1 with Get-BunVersion, Test-BunVersion, and Assert-BunVersion functions to enforce minimum version requirement.
- Added Bun version validation to install.sh with version_ge and require_bun_version functions to enforce minimum version requirement.
2026-01-28 04:10:00 +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 f901befd19 refactor(model-discovery): converted model discovery to synchronous file operations
- Changed loadCustomModels from async to sync using fs.readFileSync for immediate resolution.
- Updated discoverModels to return synchronously, removing await from main.ts, pipeline.ts, and commit index.ts.
- Migrated sdk.ts to use node:fs instead of node:fs/promises for synchronous operations.
- Refactored scanDirectoryForSkills to use recursive traversal instead of batch Promise.all.
- Added tarball Dockerfile for testing npm publish/install flow with verdaccio registry.
2026-01-24 04:00:12 +01:00
can1357 fc3dd7e569 fix(tui): fixed race conditions and null reference errors
- Fixed autocomplete race condition in editor by tracking request ID to discard stale results.
- Added guard clause in plugin-settings to prevent null reference when settings list is undefined.
- Added branch change callbacks in footer to update state after git head resolution.
- Added timing instrumentation to Python kernel startup and gateway acquisition.
- Improved error logging in settings manager for config file access failures.
- Fixed model discovery to re-check file existence after JSON to YAML migration and improved file access error handling.
2026-01-24 03:23:02 +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 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 b9c9330ea1 feat: enhanced usage providers to extract account identifiers from headers
- Enhanced usage providers to extract account identifiers from response headers.
- Fixed GitHub Copilot usage provider token handling and account identifier resolution.
- Added usage report deduplication and provider sorting features.
- Added isolated task execution with git worktree management.
2026-01-21 23:52:03 +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
Can Bölük acb70f3545 fix: simplify binary installation in install.ps1
- Removed architecture suffix handling for binary installation.
2026-01-19 15:16:35 +01:00
can1357 34f2fc0854 chore: bump version to 6.0.0 2026-01-19 01:38:04 +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 7469166ad1 chore: cleaned historical changelog entries and added validation to release script
- Removed historical version entries from multiple package CHANGELOG files.
- Added changelog validation functions to release script.
- Prevented creation of empty version entries in changelog generation.
2026-01-18 21:50:00 +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 91e2d478fb chore: bump version to 3.33.0 2026-01-08 14:13:08 +01:00
can1357 5ec30e19f4 feat(scripts): added --ref flag for installing specific git refs
- Added --ref flag to install specific tags, branches, or commits from source or binary releases.
- Enabled source installation from git refs by cloning and checking out the specified reference.
- Added git availability check for source installations with --ref flag.
- Updated README with usage examples for --ref flag on both shell and PowerShell installers.
2026-01-06 22:01:24 +00:00
can1357 f26493824e feat(coding-agent): added 65 themes to expand user customization options
- Added 65 new built-in color themes including dark, light, and material variants.
- Added theme sync script to generate theme index from JSON files.
- Expanded default theme collection from approximately 30 to 96 themes.
2026-01-05 05:16:07 +01:00
can1357 4cc8270ad5 chore: bump version to 3.15.0 2026-01-05 04:52:31 +01:00
can1357 24170d4be2 feat: added watch subcommand to release script 2026-01-04 16:25:50 +01:00
can1357 5a9346ac0c refactor: use Bun shell API in release script 2026-01-04 16:21:36 +01:00
can1357 068a2965a9 refactor: simplified release script glob usage 2026-01-04 16:20:17 +01:00
can1357 994dc34f40 fix: release script now waits for all CI workflow runs 2026-01-04 16:18:35 +01:00
can1357 77bca78dd3 chore: migrated release script to TypeScript 2026-01-04 16:16:29 +01:00
can1357 790a5370bb feat: renamed binary from pi to omp with config migration support
- Renamed CLI binary and package from 'pi' to 'omp' across all platforms and installers.
- Changed environment variable prefix from PI_* to OMP_* with automatic migration support.
- Changed configuration directory from ~/.pi/ to ~/.omp/ with multi-path fallback discovery.
- Added getConfigDirPaths(), findConfigFile(), and readConfigFile() functions for config resolution across .omp, .pi, and .claude directories.
2026-01-03 15:54:45 +01:00