Commit Graph

47 Commits

Author SHA1 Message Date
can1357 35dbf43670 feat(coding-agent/web): added Brave web search provider with recency filtering and API integration
- Added Brave web search provider with support for query, result count, and recency filtering.
- Added BRAVE_API_KEY environment variable configuration for Brave search authentication.
- Updated web search provider priority order to include Brave as second-highest priority after Exa.
- Extended recency filter support to Brave search provider alongside Perplexity.
- Implemented BraveProvider class with API integration, response mapping, and parameter validation.
- Added helper functions for recency mapping, result clamping, and snippet building in Brave provider.
2026-02-16 18:33:02 +01:00
can1357 fcd7ff4f84 refactor(dirs): centralized directory path utilities into @oh-my-pi/pi-utils/dirs module
- Extracted directory path utilities from multiple packages into a centralized '@oh-my-pi/pi-utils/dirs' module.
- Moved 30+ path helper functions (getAgentDir, getConfigRootDir, getPluginsDir, getMCPConfigPath, etc.) from scattered locations into a single shared utility module.
- Consolidated APP_NAME, CONFIG_DIR_NAME, and VERSION constants into the centralized dirs module for reuse across packages.
- Updated 70+ import statements across packages/ai, packages/coding-agent, packages/stats, and packages/tui to use the new centralized module.
- Removed local path construction logic and replaced with utility function calls for improved maintainability and consistency.
- Deleted packages/coding-agent/src/extensibility/plugins/paths.ts as its functions were moved to the centralized dirs module.
2026-02-13 15:06:05 +01:00
can1357 2c7a32f28c feat(pty): added PTY-backed interactive command execution with streaming output support
- Added PTY (pseudo-terminal) backed interactive command execution with streaming output support via PtySession class in pi-natives.
- Added PtyStartOptions and PtyRunResult types to configure and report PTY session execution status.
- Added write(), resize(), and kill() methods to PtySession for interactive control of running commands.
- Added interactive bash execution via PTY with real-time terminal rendering and input forwarding in bash-interactive tool.
- Added --no-pty CLI flag and PI_NO_PTY environment variable to disable PTY-based interactive bash execution.
- Added bash.virtualTerminal setting to control PTY-backed interactive execution behavior.
2026-02-12 04:34:24 +01:00
can1357 1c84a70417 fix(coding-agent): backported pi-mono changes (9ce00079..34878e)
packages/ai:
- feat: added OpenAI Codex stream test
- fix: google-gemini-cli provider cleanup
- fix: google-shared provider improvements
- fix: amazon-bedrock provider fix
- fix: openai-codex-responses provider fix
- chore: regenerated models

packages/coding-agent:
- feat: extension API reload method and UI sub-protocol
- feat: tilde expansion in custom skill directories
- feat: RPC mode reload support
- feat: tools-manager improvements
- fix: CLI args updates
- docs: extensions and RPC documentation updates

packages/tui:
- feat: kill-ring and undo-stack modules
- feat: editor enhancements (kill/yank, undo/redo)
- feat: input component improvements

packages/agent:
- test: agent test additions
2026-02-10 03:15:19 +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 bfe175fc01 feat(natives): backported fixes from pi-mono (82d7da878..9ce00079) 2026-02-06 01:55:42 +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 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 8858250127 docs(coding-agent/cli): updated help text and documentation for expanded tool availability
- Updated help text to reflect expanded tool availability and simplified main description.
- Added documentation for new subcommands: commit, stats, jupyter, and grep in help text.
- Added documentation for browser and todo_write tools in available tools list.
- Updated --tools option documentation to clarify default behavior includes all tools.
- Reorganized environment variables section in help text for better clarity.
2026-02-05 04:59:19 +01:00
can1357 a1a4824cd7 docs(coding-agent): added LLM provider env vars and expanded CLI help documentation
- Added comprehensive environment variables documentation including API keys for 11 new LLM providers (Groq, Cerebras, xAI, OpenRouter, Mistral, z.ai, MiniMax, OpenCode, Cursor, Vercel AI Gateway, Perplexity) and cloud provider configuration.
- Expanded CLI help text with detailed API keys section documenting all supported LLM providers, cloud providers, search services, and model override configuration variables.
- Fixed redundant fallback check in porting guide example by removing duplicate `Bun.env.HOME` reference.
2026-02-05 04:51:42 +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 315cd35958 feat(coding-agent/mcp): added TUI rendering for MCP tool calls and results with JSON tree display
- Added renderCall and renderResult methods to MCPTool and DeferredMCPTool classes for TUI rendering of tool calls and results.
- Created new mcp/render.ts module providing JSON tree rendering functionality with configurable depth and line limits for terminal display.
- Updated renderResult signature in custom tool and extension types to accept optional args parameter for accessing original tool arguments during result rendering.
- Fixed method binding in extension and hook tool wrappers by applying .bind(tool) to renderCall and renderResult methods to preserve correct 'this' context.
- Added filter to skip .git directories in fuzzy_find_sync function to improve search performance.
2026-02-03 21:59:54 +01:00
can1357 592e5e2191 feat(shell): added interactive shell console and cancellation token support to CLI
- Added interactive shell console subcommand to coding-agent CLI with support for working directory, timeout, and snapshot configuration.
- Added cancellation token support to ExecutionContext and ExecutionParameters for graceful shell execution interruption.
- Implemented cancellation checks throughout AST execution pipeline (Program, CompoundList, AndOrList, Pipeline, and all command types) to enable responsive interruption.
- Replaced process tracking mechanism with tokio_util CancellationToken for improved async cancellation handling.
- Added tokio-util 0.7.16 dependency to pi-natives crate for cancellation token support.
2026-02-01 19:16:57 +01:00
can1357 a0b26fc1aa feat(coding-agent): added plan model role with parallel task execution and improved todo validation
- Added 'plan' model role option to support architectural planning with dedicated model selection via CLI argument (--plan), environment variable (OMP_PLAN_MODEL), and UI menu action.
- Updated model selector to display 'PLAN' badge for plan models and prioritize them in the model sorting order.
- Relaxed task management constraints to allow multiple tasks to be in_progress simultaneously, enabling parallel task execution instead of enforcing single-task-at-a-time workflow.
- Improved todo validation to check for blocking pending tasks before allowing a todo to be marked in_progress, with more specific error messages indicating which earlier tasks are blocking progress.
2026-01-27 06:35:33 +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 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 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 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 4a3f29aed3 feat(coding-agent): renamed web_fetch tool to fetch for consistency
- Renamed web_fetch tool to fetch for consistency across codebase and documentation.
- Removed format parameter from output tool and added automatic JSON to YAML conversion.
- Updated tool documentation and CLI help text to reflect tool name changes.
- Adjusted output truncation limits for bash and python tools.
2026-01-23 06:38:30 +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 7781bdc014 feat(coding-agent/cli): added setup subcommand for optional feature dependencies
- Added setup subcommand for installing optional feature dependencies.
- Implemented Python component setup with Jupyter kernel package installation.
- Added component status checking via --check flag with JSON output support.
- Created package installation logic using uv (preferred) or pip package managers.
2026-01-18 20:00:39 +01:00
can1357 cc52799844 feat(coding-agent): disabled LSP for subtasks spawned via the task tool
- Added `--no-lsp` CLI flag to disable LSP tools, formatting, diagnostics, and warmup for a session.
- Added `enableLsp` option to session configuration for programmatic control of LSP features.
- Added `enableLsp` property to ToolSession interface to propagate LSP state to tools.
- Modified tool filtering logic to exclude LSP tool when disabled.
- Disabled LSP for subtasks spawned via the task tool.
2026-01-11 03:27:27 +01:00
can1357 100061accb chore: merged in upstream changes
- Added ExtensionRuntime shared state with async extension factory support
- Introduced pluggable tool operations (BashOperations, FileOperations, etc.) for remote execution
- Added new CLI flags: --no-tools, --no-extensions, --no-skills
- Added login dialog, countdown timer, and component barrel export
- Added blockImages and thinkingBudgets settings
- Refactored stdin handling with StdinBuffer for improved key parsing
- Updated DEVELOPMENT.md with new architecture documentation
2026-01-10 06:32:51 +01:00
can1357 d11ccd2e93 feat(coding-agent): added temp model controls and auto-chdir 2026-01-08 02:51:29 +01:00
can1357 753be5d87f feat: introduced Worker-based subagent execution with BUILTIN_TOOLS registry
- Added ToolSession interface and Bun Worker-based subagent execution replacing subprocess spawning.
- Added BUILTIN_TOOLS registry and createTools factory function replacing individual tool exports.
- Added toolNames parameter for filtering which built-in tools to include in agent sessions.
- Removed deprecated tool exports (codingTools, readOnlyTools, createCodingTools, createReadOnlyTools).
- Removed subagent custom tool example and question custom tool example.
2026-01-07 03:03:34 +01:00
can1357 15fbe228b3 feat(monorepo): merged codex providers and extensions 2026-01-05 15:37:44 +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
can1357 93f091d32f fix(coding-agent): Task tool subprocess now uses agent's configured model
The --model CLI flag now accepts provider/model format directly,
eliminating the need for a separate --provider flag. The Task tool's
model-resolver returns provider/model format, which the subprocess
CLI correctly parses.

Previously, subprocesses were passed --model gpt-5.2 without --provider,
causing the CLI to ignore the model and fall back to settings default.
2026-01-03 06:25:58 +01:00
can1357 50ab6b8b1b style: removed .js extension from imports and added node: prefix to builtins 2026-01-03 05:12:25 +01:00
can1357 4f8df6b79f refactor(coding-agent): renamed small to smol consistently
- Renamed SMALL_MODEL_PRIORITY to SMOL_MODEL_PRIORITY
- Renamed findSmallModel to findSmolModel
- Updated all role strings from 'small' to 'smol'
- Updated UI labels and comments
2026-01-03 03:46:45 +01:00
can1357 60f39f8382 feat(coding-agent): added CLI args and env vars for model role overrides
- Added --smol and --slow CLI args for ephemeral model role overrides
- Added PI_SMOL_MODEL and PI_SLOW_MODEL env var support
- Overrides are applied at runtime without persisting to settings.json
2026-01-03 03:40:24 +01:00
can1357 7db3b35dc4 refactor(coding-agent): extracted settings defs for single source
- Introduced declarative settings definitions to eliminate duplicated setting logic across UI and handlers.
- Extracted settings configuration into settings-defs.ts for single-source-of-truth maintenance.
- Simplified SettingsSelectorComponent to generate UI from definitions rather than hardcoded items.
- Added bash interceptor toggle to allow users to control shell command interception behavior.
- Updated CLI help text to reflect all available tools with accurate default states.
- Consolidated settings change handling into unified handler dispatching by setting ID.
2026-01-03 00:28:51 +01:00
can1357 fbae5cbb0d refactor(coding-agent): simplified toolset and enhanced navigation
- Removed ast and replace tools to simplify toolset and reduce maintenance overhead.
- Added LSP call hierarchy support (incoming_calls, outgoing_calls) for better code navigation.
- Added Exa as web search provider alongside Anthropic and Perplexity for broader search options.
- Enhanced tool descriptions with detailed usage guidelines to improve agent tool selection.
- Simplified task tool by removing single-mode execution and agentScope parameter.
- Added GitHub tree rendering and improved web-fetch documentation for better URL handling.
2026-01-02 22:13:05 +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
Mario Zechner e69830bf9a fix: enabledModels now supports glob patterns for OAuth providers
Added glob pattern support (e.g., github-copilot/*, *sonnet*) to --models
and enabledModels. Patterns are matched against both provider/modelId and
just modelId, so *sonnet* works without requiring anthropic/*sonnet*.

The existing fuzzy substring matching for non-glob patterns is preserved.

fixes #337
2026-01-01 02:04:04 +01:00
Mario Zechner b3b78ac97a feat(coding-agent): Add --session-dir flag for custom session directory
- Add --session-dir CLI flag to specify custom session directory
- SessionManager API: second param of create(), continueRecent(), list(), open()
  changed from agentDir to sessionDir (direct directory, no cwd encoding)
- When omitted, uses default (~/.pi/agent/sessions/<encoded-cwd>/)
- --session now derives sessionDir from file's parent if --session-dir not provided
- list() validates session header before processing files
- Closes #313

Co-authored-by: scutifer <scutifer@users.noreply.github.com>
2025-12-25 20:27:41 +01:00
Mario Zechner 20702d2cd5 feat(coding-agent): add --skills CLI flag for filtering skills
Adds glob pattern support for skill filtering:
- --skills <patterns> CLI flag (comma-separated glob patterns)
- includeSkills setting in settings.json
- ignoredSkills now supports glob patterns
- ignoredSkills takes precedence over includeSkills and --skills

Closes #268
2025-12-21 20:58:54 +01:00
Mario Zechner 99877a8398 Custom tools with session lifecycle, examples for hooks and tools
- Custom tools: TypeScript modules that extend pi with new tools
  - Custom TUI rendering via renderCall/renderResult
  - User interaction via pi.ui (select, confirm, input, notify)
  - Session lifecycle via onSession callback for state reconstruction
  - Examples: todo.ts, question.ts, hello.ts

- Hook examples: permission-gate, git-checkpoint, protected-paths

- Session lifecycle centralized in AgentSession
  - Works across all modes (interactive, print, RPC)
  - Unified session event for hooks (replaces session_start/session_switch)

- Box component added to pi-tui

- Examples bundled in npm and binary releases

Fixes #190
2025-12-17 16:03:23 +01:00
Mario Zechner 7e78ef9bb2 Release v0.22.4
- Add --list-models CLI flag for listing/finding models with fuzzy search

fixes #203
2025-12-17 00:39:14 +01:00
Nico Bailon 1de5118261 Add skills system with Claude Code compatibility (#171)
* Add skills system with Claude Code compatibility

* consolidate skills into single module, merge loaders, add <available_skills> XML tags

* add Codex CLI skills compatibility, skip hidden/symlinks
2025-12-12 18:24:52 +01:00
Christian Catalan b0b35401e3 Add --version/-v flag to CLI (#170)
- Parse --version and -v flags in args.ts
- Handle version flag early in main.ts (print and exit)
- Add flag to help text
- Add comprehensive test coverage for CLI arg parsing

Co-authored-by: cc-vps <crcatala+vps@gmail.com>
2025-12-12 00:01:06 +01:00
Mario Zechner d4bd429a35 Add hooks system with pi.send() for external message injection
- Hook discovery from ~/.pi/agent/hooks/, .pi/hooks/, --hook flag
- Events: session_start, session_switch, agent_start/end, turn_start/end, tool_call, tool_result, branch
- tool_call can block execution, tool_result can modify results
- pi.send(text, attachments?) to inject messages from external sources
- UI primitives: ctx.ui.select/confirm/input/notify
- Context: ctx.exec(), ctx.cwd, ctx.sessionFile, ctx.hasUI
- Docs shipped with npm package and binary builds
- System prompt references docs folder
2025-12-10 00:50:30 +01:00
Mario Zechner a63092e830 Move config.ts from utils/ to src/ 2025-12-09 01:28:06 +01:00
Mario Zechner 350196694d Remove old implementation files (main.ts, cli.ts, tui-renderer.ts), rename new files 2025-12-09 01:21:28 +01:00
Mario Zechner 4c7b7b5206 Split main-new.ts into modules: cli/args, cli/file-processor, cli/session-picker, core/system-prompt, core/model-resolver 2025-12-09 01:20:31 +01:00