Commit Graph

45 Commits

Author SHA1 Message Date
can1357 b09ded42a0 feat(coding-agent): render traced intent in task progress/output 2026-02-20 11:05:19 +01:00
can1357 918bf9b043 style: formatting 2026-02-15 09:44:56 +01:00
can1357 8526491221 fix(task): filtered todo_write from active tools instead of full registry at subagent startup 2026-02-15 09:23:04 +01:00
can1357 3b890dbc9a fix(task): filtered parent-owned tools from subagent setActiveTools handler 2026-02-15 09:18:07 +01:00
Chris Watson 315aa32115 fix(coding-agent): improve todo progress tracking reliability 2026-02-15 09:13:56 +01:00
can1357 733a46c226 fix(coding-agent): discovered ollama models at runtime 2026-02-13 12:56:22 +01:00
can1357 9f94d39789 feat(coding-agent/mcp): added abort signal support to MCP request handling for cancellation
- Added MCPRequestOptions interface with signal property for request cancellation via AbortSignal.
- Added abort signal support to MCP tool execution enabling request cancellation via Escape-to-interrupt or other abort mechanisms.
- Enhanced MCP request handling with abort signal propagation through HTTP, SSE, and stdio transports with proper cleanup.
- Improved stdio transport request handling to use Promise.withResolvers for cleaner async flow and better abort signal integration.
- Updated HTTP transport to combine operation abort signals with timeout signals using AbortSignal.any() for unified cancellation.
- Modified SSE response parsing to support abort signals and distinguish between timeout and user-initiated cancellation.
2026-02-10 17:19:50 +01:00
can1357 1eaf40b784 feat(coding-agent): added temperature configuration setting for LLM sampling control
- Added `temperature` configuration setting to control LLM sampling temperature with values from 0 (deterministic) to 1 (creative) to -1 (provider default).
- Added temperature option selector in settings UI with preset values: Default, 0, 0.2, 0.5, 0.7, 1.
- Renamed `settingsInstance` parameter to `settings` in `CreateAgentSessionOptions` for consistency.
- Updated all internal references from `settingsInstance` to `settings` throughout SDK and components.
- Integrated temperature setting into agent configuration and selector controller.
2026-02-10 15:25:10 +01:00
can1357 a5d9bbb4ca chore(coding-agent): migrated console logging to structured logger and updated import styles
- Migrated console.error() calls to structured logger.warn() and logger.error() throughout codebase.
- Updated os.tmpdir() import style in browser tool from destructured to namespace import.
2026-02-10 11:26:42 +01:00
can1357 acf8ab5225 style: stylistic changes 2026-02-10 07:39:39 +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 a5db81b90b fix(coding-agent/task): fixed task executor to handle null data in submit_result and added schema mismatch warnings
- Fixed task executor to properly handle agents calling `submit_result` with null data by treating it as missing and attempting to extract output from conversation text rather than silently failing.
- Added documentation caution in task.md about schema vs agent mismatch causing null output, with guidance on using `schema` parameter to override built-in schemas.
- Added warning message when subagent calls submit_result with null data to help diagnose schema mismatch issues.
2026-02-06 02:14:53 +01:00
can1357 bfe175fc01 feat(natives): backported fixes from pi-mono (82d7da878..9ce00079) 2026-02-06 01:55:42 +01:00
can1357 881737fec4 refactor(coding-agent): restructured web search and config systems with class-based architecture and type generalization
- Renamed web search types and functions to remove 'Web' prefix for broader applicability (WebSearchProvider -> SearchProviderId, WebSearchResponse -> SearchResponse, WebSearchTool -> SearchTool, etc.).
- Refactored web search provider system from object-based configuration to class-based architecture with abstract SearchProvider base class and concrete provider implementations.
- Refactored ModelRegistry to use direct constructor instantiation instead of discoverModels() helper function, simplifying model discovery pattern.
- Refactored config system to use new ConfigFile class with schema validation, caching, and multi-format support (JSON, JSONC, YAML).
- Simplified Exa API key discovery to check environment variables only, removing .env file reading logic.
2026-02-05 13:56:38 +01:00
can1357 39634776a7 feat(coding-agent): refactored task API to use 'assignment' field and structured context separation
- Refactored task API to use 'assignment' field instead of 'args' for per-task instructions, enabling clearer separation between shared context and task-specific work.
- Introduced structured context/assignment separation pattern with '<swarm_context>' wrapper for template rendering, replacing placeholder-based substitution.
- Changed agent frontmatter field from 'thinkingLevel' to 'thinking-level' (kebab-case) for consistency with YAML conventions.
- Removed 'context' parameter from ExecutorOptions as context is now prepended at template level rather than executor level.
- Removed 'args' field from AgentProgress and SingleResult interfaces, simplifying task result tracking.
- Updated task rendering to display full task text instead of formatted args, improving clarity in progress output.
2026-02-05 07:43:53 +01:00
can1357 f82a5d121f feat(coding-agent/task): added task recursion depth control and hierarchical subagent naming
- Added task.maxRecursionDepth setting to control how many levels deep subagents can spawn their own subagents (0=none, 1=one level, 2=two levels, -1=unlimited).
- Added nested task artifact naming with parent task prefixes (e.g., '0-Auth.1-Subtask') to support hierarchical task identification.
- Added taskDepth and parentTaskPrefix options to CreateAgentSessionOptions for supporting nested/subagent sessions.
- Changed task tool spawns configuration from 'explore' to '*' to allow spawning any type of subagent.
- Updated system prompt to unconditionally include parallel delegation guidance for all agent types instead of only coordinators.
- Implemented automatic task tool disabling at maximum recursion depth to prevent excessive task nesting.
2026-02-05 02:18:10 +01:00
can1357 147a1a773c chore: removed WASM-specific naming and updated to N-API implementation
- Removed WASM-specific naming conventions and terminology throughout the codebase, including import aliases, comments, and type aliases.
- Removed legacy type aliases 'WasmMatch' and 'WasmSearchResult' from grep types module.
- Removed TypeScript module declaration for '*.wasm?raw' file imports.
- Updated error handling in task executor to properly handle stopReason === 'error' case with exit code and error message capture.
- Simplified documentation comments to remove implementation details about WASM and Photon library internals.
- Updated README to reflect shift from WASM to N-API for pi-natives crate implementation.
2026-02-05 00:54:48 +01:00
can1357 ba0b0f6d86 feat(coding-agent): refactored model role system and extracted model resolution utilities
- Added 'commit' model role for dedicated commit message generation.
- Exported 'resolveModelOverride' function from model-resolver module for public use.
- Refactored model role system to centralize role configuration in MODEL_ROLES registry.
- Extracted model resolution utilities into dedicated model-resolver module for improved code organization.
- Made 'tag' and 'color' properties optional in ModelRoleInfo interface to support roles without visual indicators.
- Enhanced model selector with defensive null/undefined checks for optional role properties.
2026-02-05 00:23:33 +01:00
can1357 d5790b5414 refactor: added default generic type parameter to Model interface
- Added default generic type parameter to Model interface, allowing Model to be used without explicit type argument.
- Removed explicit <any> generic type parameters from Model type annotations throughout codebase, leveraging new default parameter.
2026-02-05 00:13:29 +01:00
can1357 92b93d87e0 refactor(coding-agent): centralized model role system into MODEL_ROLES registry with metadata and dynamic menu generation
- Centralized model role system into MODEL_ROLES registry with metadata (tag, name, color) and MODEL_ROLE_IDS array for consistent role management across the codebase.
- Refactored model selector to dynamically generate menu actions from MODEL_ROLES registry instead of hardcoded role definitions.
- Simplified model role resolution by replacing hardcoded role checks with loops over MODEL_ROLE_IDS array.
- Removed support for 'omp/' model role prefix in favor of 'pi/' prefix throughout model selection, task execution, and configuration.
- Added getModelRoles() and overrideModelRoles() helper methods to Settings class for cleaner model role management.
2026-02-05 00:10:07 +01:00
can1357 1217c55562 refactor(coding-agent/task): extracted truncateOutput function to shared tools module as truncateTail
- Extracted truncateOutput function to shared tools module as truncateTail.
- Updated executor to import and use truncateTail from tools module instead of local implementation.
2026-02-04 09:44:32 +01:00
can1357 a857ae4d70 fix(coding-agent): fixed LSP timeout handling and externalized subagent reminder prompt
- Fixed timeout handling in LSP write-through operations to properly clear formatter and diagnostics results when operations exceed the 10-second timeout threshold.
- Added timeout detection mechanism in LSP index that sets a flag when the timeout signal is aborted.
- Added nonAbortable property to EditTool and WriteTool classes to prevent these operations from being aborted during execution.
- Externalized subagent submit reminder prompt to a separate template file for improved maintainability and dynamic retry tracking.
2026-02-03 17:46:13 +01:00
can1357 c8f106c58c feat(text): refactored text processing with UTF-16 optimization and ANSI state bitflags
- Added `visibleWidth()` function to measure visible text width while excluding ANSI codes.
- Optimized text processing from UTF-8 to UTF-16 implementation with direct JsString handling for improved performance.
- Refactored ANSI state tracking to use bitflags-based SgrState struct instead of individual boolean fields for more efficient storage.
- Introduced ColorCode enum to represent color codes (Basic, Indexed, Rgb) for better type safety.
- Added comprehensive test coverage for UTF-16 text processing, ANSI detection, and width calculations.
- Updated napi feature from 'napi8' to 'napi10' and added unicode-segmentation dependency.
2026-02-01 09:34:54 +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 2fc19f69ca feat(coding-agent): added subagent context passing and automatic tool injection for agent sessions
- Added getCompactContext() API to agent session for accessing parent conversation context.
- Implemented automatic submit_result tool injection for subagents with explicit tool lists.
- Added contextFile parameter to ExecutorOptions for passing parent conversation context to subagents.
- Enhanced subagent system prompt with conditional context file instructions and improved code formatting.
- Removed schema override notification from task summary prompt to simplify output.
- Implemented formatCompactContext() method to format conversation history for subagent consumption.
2026-01-31 10:03:50 +01:00
can1357 bcdcccf100 feat(coding-agent/config): added model preference matching system for intelligent model selection
- Added model preference matching system with ModelMatchPreferences and ModelPreferenceContext interfaces to enable intelligent model selection based on usage history and provider preferences.
- Implemented buildPreferenceContext and pickPreferredModel functions to rank and select models based on usage order, provider history, and deprioritization settings.
- Enhanced parseModelPattern function to accept optional ModelMatchPreferences parameter, enabling model resolution to consider user preferences and usage history.
- Updated model matching logic to prioritize models based on historical usage patterns and provider preferences when multiple candidates match a pattern.
2026-01-28 14:15:48 +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 12277cf982 refactor(coding-agent/task): simplified import path for subagent system prompt template to relative
- Simplified import path for subagent system prompt template from absolute to relative path.
2026-01-28 11:29:13 +01:00
can1357 eb3ca1ddd2 refactor(coding-agent): restructured prompt rendering and tool utilities into dedicated modules
- Extracted tool choice mapping logic into dedicated utility module for provider-specific format conversions.
- Refactored task summary generation to use template-based rendering instead of string concatenation.
- Migrated system prompt generation to use Handlebars templates with structured data instead of hardcoded strings.
- Extracted JTD to TypeScript conversion logic into dedicated utility module for schema documentation.
- Consolidated prompt template rendering across multiple modules using unified renderPromptTemplate function.
- Simplified type assertions in stream module to use generic OptionsForApi type instead of provider-specific types.
2026-01-28 03:47:16 +01:00
can1357 a4bfb5795c refactor(coding-agent): renamed 'complete' tool to 'submit_result' for clarity and consistency
- Renamed 'complete' tool to 'submit_result' throughout codebase for clarity and consistency.
- Updated all tool references, function names, and variable names from 'complete' to 'submit_result' in executor, render, and tools modules.
- Renamed CompleteTool class to SubmitResultTool and CompleteDetails interface to SubmitResultDetails.
- Updated agent prompts and documentation to reference the new 'submit_result' tool name.
- Reorganized task.md prompt to move critical guidance to the top and restructure instructions for better clarity.
2026-01-28 03:28:03 +01:00
can1357 cc91f80e99 feat: added toolChoice support and optimized TUI
- Added ToolChoice type and toolChoice parameter support across all AI providers (OpenAI, Azure OpenAI, Anthropic, Google) enabling fine-grained control over tool/function selection during LLM calls.
- Added toolChoice override capability to Agent.prompt() method and session prompt options allowing callers to control tool selection behavior per request.
- Added provider-specific tool choice mapping functions (mapAnthropicToolChoice, mapGoogleToolChoice, mapOpenAiToolChoice) to normalize tool choice formats across different LLM APIs.
- Removed kernel heartbeat/ping mechanism from PythonKernel, simplifying health monitoring by relying on direct isAlive() checks instead of periodic HTTP requests.
2026-01-28 02:53:58 +01:00
can1357 91da560cc7 refactor(coding-agent/task): moved subagents in-process
- run subagent execution in-process and drop worker protocol

- align tool settings manager typing and docs

- queue skill follow-ups, dedupe review findings, restore MCP timeouts
2026-01-27 07:38:55 +01:00
can1357 34f03bc7fb feat(coding-agent): added subagent skill preloads
- Inline preloaded skill contents in system prompts and allow task-level skill selection.
- Record session init entries with system prompt, task, tools, and output schema.
- Fix session persistence to keep pre-assistant entries in subagent logs.
2026-01-27 05:18:30 +01:00
can1357 a8743c1f91 fix(coding-agent/task): reduced subagent progress overhead
- Throttled subagent progress emissions with a coalescing window and terminal flushes.
- Switched message_update handling to append text deltas into a bounded tail buffer for recent output.
- Removed deep cloning from TaskTool progress updates to keep progress rendering cheap.
2026-01-27 03:03:05 +01:00
can1357 6b595a1cad fix(coding-agent): exports 2026-01-25 19:53:14 +01:00
can1357 79079e6ecd feat(coding-agent): added plan mode with approval workflow and tool gating
- Plan mode provides structured workflow where agents propose plans for user approval before execution.
- Added plan:// internal URL protocol for accessing plan files and injecting plan-mode context into subagent prompts.
- Added plan mode toggle shortcut and paused status indicator in status line.
- Fixed plan reference injection to properly pass workflow state to plan-mode system prompts.
- Improved autocomplete fuzzy matching to support subsequence matching for skill suggestions.
2026-01-25 19:35:26 +01:00
can1357 7745206ebc feat(coding-agent/task): added support for comma-separated model lists
- Model field now accepts string arrays for fallback model prioritization.
- Extracted model list parsing into dedicated parseModelList helper function.
- Extended default model alias detection to validate all entries in comma-separated lists.
2026-01-25 14:05:45 +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 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 e3eeb1bafd refactor(coding-agent): restructured tool rendering to merge call and result displays
- Changed tool result rendering to merge call and result displays with tool arguments in headers across 13 tools.
- Added args parameter to render methods enabling display of contextual metadata like patterns, paths, and commands.
- Changed Read tool title to display line range when offset or limit arguments provided.
- Changed worker instantiation to use direct URL import instead of pre-bundled worker files.
- Removed streaming preview rendering logic from write tool.
2026-01-23 13:46:06 +01:00
can1357 6e3a468496 feat(coding-agent/task): added worker bundle caching to improve worker initialization performance
- Added worker bundle caching to pre-build and cache the worker script at startup, improving worker initialization performance.
- Introduced `workerBundlePromise` that bundles worker.ts using Bun.build and caches it in ~/.omp/worker-bundle.js for reuse across worker instances.
- Modified worker instantiation to use the pre-built bundle instead of loading the raw TypeScript file directly.
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