Commit Graph

246 Commits

Author SHA1 Message Date
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 2aa156060b feat(coding-agent/memories): isolated memory storage by project working directory to prevent cross-project contamination
- Modified memory storage to isolate memories by project working directory, preventing cross-project memory contamination.
- Added encodeProjectPath function to safely encode working directory paths for use in memory storage directory names.
- Updated getMemoryRoot function to accept cwd parameter and include encoded project path in memory directory structure.
- Updated clearMemoryData function signature to accept cwd parameter for project-specific memory cleanup.
- Updated test fixtures to use project-aware memory root paths.
2026-02-14 02:35:56 +01:00
can1357 4571e505d9 feat(coding-agent): implemented codex-style memory system with two-phase extraction and consolidation pipeline
- Added autonomous memory extraction and consolidation system with two-phase pipeline for extracting durable knowledge and consolidating into reusable skills.
- Added /memory slash command with subcommands (view, clear, reset, enqueue, rebuild) for inspecting and managing memory maintenance.
- Added configurable memory settings including concurrency limits, lease timeouts, token budgets, and rollout age constraints.
- Added memory injection payload that includes learned context in system prompts with operational rules for reading and using memory artifacts.
- Improved system prompt building to support memory guidance injection and enhanced error handling in resolvePromptInput function for multiline input.
2026-02-14 02:02:48 +01:00
can1357 87010ea61e feat: added WebSocket retry logic with configurable budget and enum-based transport policy
- Added automatic retry logic for WebSocket stream closures before response completion with configurable retry budget.
- Changed `providers.openaiWebsockets` setting from boolean to enum with values 'auto', 'off', 'on' for more granular WebSocket policy control.
- Implemented WebSocket stream retry mechanism that attempts reconnection before falling back to SSE transport when retry budget is exhausted.
- Fixed WebSocket stream retry logic to properly handle mid-stream connection closures and preferWebsockets option handling.
- Added helper functions isCodexWebSocketTransportError() and isCodexWebSocketRetryableStreamError() to classify WebSocket errors.
- Reorganized imports across multiple files for better code organization and consistency.
2026-02-14 00:58:42 +01:00
can1357 7bf5664690 feat: added WebSocket transport support for OpenAI Codex with SSE fallback
- Added WebSocket transport support for OpenAI Codex responses with automatic fallback to SSE on connection failure.
- Added preferWebsockets option to Agent and Model configurations to hint that WebSocket transport should be preferred when supported by provider implementations.
- Added prewarmOpenAICodexResponses() function to pre-establish WebSocket connections for improved performance.
- Added getProviderDetails() function and getOpenAICodexTransportDetails() function to expose transport state and provider configuration information.
- Added provider details display in session info showing active provider configuration and authentication details.
- Added OpenAI websockets setting to enable WebSocket transport preference for OpenAI Codex models in coding agent configuration.
2026-02-14 00:01:25 +01:00
can1357 d1e16d2101 refactor: implemented $PWD > cwd to prevent macOS symlink resolution
- Replaced all direct `process.cwd()` calls with `getProjectDir()` utility function across 40+ files to centralize project directory resolution logic.
- Added `getProjectDir()` and `setProjectDir()` functions to `@oh-my-pi/pi-utils/dirs` module to provide abstracted project directory management.
- Made `SessionManager.list()` method asynchronous to support asynchronous session discovery operations.
- Updated default working directory resolution throughout codebase to use `getProjectDir()` instead of `process.cwd()` for improved project directory detection.
2026-02-13 23:40:02 +01:00
can1357 db48d3270f fix(coding-agent/tools): fixed heredocs by preserving internal spacing in bash normalization
- Removed aggressive whitespace normalization that was breaking heredocs and indentation-sensitive scripts.
- Preserved internal spacing and tabs in bash command normalization to support heredocs and indentation-sensitive scripts.
- Added test cases for internal spacing preservation and heredoc indentation handling.
2026-02-13 18:49:38 +01:00
can1357 0658940410 test(coding-agent/tools): updated python execution test to use full session file path
- Updated python execution test to use full session file path with .jsonl extension instead of hardcoded filename.
2026-02-13 18:06:57 +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 3ade89fd1f fix(coding-agent): added fuzzy @file auto-read matching
Fixes #57
2026-02-13 14:07:38 +01:00
can1357 21f5914121 fix(coding-agent): auto-discover ollama without config
Fixes #52.
2026-02-13 12:57:53 +01:00
can1357 733a46c226 fix(coding-agent): discovered ollama models at runtime 2026-02-13 12:56:22 +01:00
Can Bölük 7965f330e7 Merge pull request #49 from kylesnowschwartz/feat/claude-plugins-discovery
feat(coding-agent): add Claude Code marketplace plugin discovery
2026-02-13 12:33:52 +01:00
can1357 9482a57135 fix(coding-agent): fixed plugin registry validation and precedence 2026-02-13 12:33:14 +01:00
can1357 02bf493ba8 fix(coding-agent): handled fully exhausted oauth rotation
Fixes #55.
2026-02-13 12:28:46 +01:00
kylesnowschwartz 7a6b42353e fix(coding-agent): respect plugin scope and handle multiple registry entries
- P1: Use root.scope instead of hardcoded 'user' level in claude-plugins provider
- P2: Iterate all registry entries per plugin ID, not just first one
- P3: Add home parameter to discoverAgents() for test isolation
- P4: Add test coverage for claude-plugins discovery (12 tests)
- P5: Cache listClaudePluginRoots results to avoid repeated parsing

Addresses issues found in adversarial review of PR #49
2026-02-13 11:11:05 +13:00
can1357 3dbd6b6f02 fix(coding-agent): make tool tests format-agnostic for hashline output 2026-02-12 20:32:13 +01:00
can1357 da455e63fd feat: removed .pi configuration directory alias in favor of .omp
- Removed support for `.pi` configuration directory alias in favor of `.omp` across all packages.
- Updated all configuration paths and references from `.pi` to `.omp` in user and project directories.
- Refactored configuration discovery in builtin.ts to simplify directory traversal logic and remove multi-alias support.
- Simplified Python module discovery to use single directory paths instead of arrays of aliases.
- Updated debug and crash log paths from `.pi/agent/` to `.omp/agent/` in TUI package.
2026-02-12 01:12:03 +01:00
can1357 193724d1d4 refactor(coding-agent): restructured hashline format and simplified test infrastructure
- Changed hashline format separator from two spaces to pipe character (|) throughout codebase for consistency.
- Simplified ollama installation checks in test files by replacing execSync with Bun.which() and inverting PI_NO_LOCAL_LLM to PI_LOCAL_LLM environment variable.
- Added early return guards in test beforeAll hooks to skip tests when required tools (ollama, magick) are unavailable.
- Added debug instrumentation to system prompt building via PI_DEBUG_STARTUP environment variable for startup performance monitoring.
- Removed prompt cache retention assertion from openai-codex streaming test.
2026-02-12 00:12:59 +01:00
can1357 f10f60c786 feat(coding-agent): refactored file display mode handling and improved hashline format readability
- Changed hashline display format separator from pipe to two spaces for improved readability.
- Removed `lines` and `hashes` parameters from read tool in favor of automatic file display mode resolution.
- Added `resolveFileDisplayMode` utility to centralize file display mode configuration logic.
- Integrated file display mode settings into grep and read tools for consistent output formatting.
- Consolidated tool parameter types to use schema-derived types via Typebox `Static` utility.
- Updated parseLineRef to handle both legacy pipe-separator and new two-space hashline formats.
2026-02-11 12:11:08 +01:00
can1357 2707546434 feat(coding-agent): enhanced hashline edits with replace operation, validation, and field renames
- Added new `replace` hashline edit operation for substring-style fuzzy text replacement without line references, with optional `all` flag for replace-all behavior.
- Added `noopEdits` array to `applyHashlineEdits` return value to report edits that produced no changes, including edit index, location, and current content for diagnostics.
- Added validation to detect and reject hashline edits using wrong-format fields (`old_text`/`new_text` from replace mode, `diff` from patch mode) with helpful error messages.
- Renamed hashline edit operation keys from `single`/`range`/`insertAfter` to `set_line`/`replace_lines`/`insert_after` for clearer semantics.
- Enhanced error messages for wrong-format hashline edits to guide users toward correct operation syntax.
2026-02-11 09:18:28 +01:00
can1357 a28a565ead feat(coding-agent/patch): enhanced hashline edit validation and error recovery with deduplication and format checking
- Added noopEdits array to applyHashlineEdits return type to track edits that produce no changes.
- Added validation to reject edits with wrong-format fields (old_text/new_text from replace mode, diff from patch mode) that indicate model confusion.
- Added additionalProperties tolerance to hashline edit schemas to allow flexible field handling.
- Added deduplication logic to remove duplicate edits targeting the same line(s) with identical destination content.
- Improved error handling for missing end fields in edit ranges by returning single-line specs instead of requiring both start and end.
- Enhanced no-op error recovery guidance in prompts with detailed instructions to re-read file and function context after consecutive no-op errors.
2026-02-11 09:03:48 +01:00
can1357 9ff078bdfd fix(coding-agent/patch): removed whitespace preservation override logic in patch application
- Removed whitespace preservation logic that was overriding model-generated formatting choices in patch application.
- Deleted `preserveWhitespaceOnlyLines` and `preserveWhitespaceOnlyLinesLoose` functions that were incorrectly reverting intentional formatting changes.
- Updated test to reflect that model whitespace choices are now respected without override.
2026-02-11 08:12:09 +01:00
can1357 72ac7891ec refactor(coding-agent): restructured hashline edits: renamed operations and improved diagnostics
- Renamed hashline edit operation types from replaceLine/replaceLines to single/range for improved clarity.
- Renamed content field to replacement in hashline edit operations to better reflect its purpose.
- Enhanced no-op edit diagnostics to perform line-by-line comparisons and distinguish between identical and normalized replacements.
- Improved error messages for hashline edits to clarify differences between literal identical content and whitespace-normalized content.
- Removed timeout-retries configuration option from react-edit-benchmark CLI and simplified retry logic.
- Updated all test cases and documentation to reflect renamed hashline edit operation types and fields.
2026-02-11 08:12:09 +01:00
can1357 6c5fa149da feat(coding-agent): removed insertBefore and substr hashline edit operations
- Removed insertBefore and substr hashline edit operations, simplifying the edit API to support only replaceLine, replaceLines, and insertAfter operations.
- Updated hashline edit schema and type definitions to remove insertBefore and substr operation types from the ParsedRefs union and edit validation logic.
- Removed insertBefore and substr test cases from hashline test suite, including tests for insert-before functionality, anchor echo stripping, and substring matching.
- Updated benchmark runner to refactor edit operations from src/dst format to discriminated union types (replaceLine, replaceLines, insertAfter) and adjusted insertAfter line references.
2026-02-11 08:12:08 +01:00
can1357 269f7de483 feat(coding-agent): redesigned hashline edit API with discriminated unions and improved hash algorithm
- Redesigned hashline edit API to use discriminated union variants (replaceLine, replaceLines, insertAfter, insertBefore, substr) instead of nested src/dst structure.
- Changed hash algorithm from xxHash64 hex to xxHash32 base36 encoding and increased hash length from 2 to 3 characters.
- Added substr edit variant to match and replace content by unique substring when line hashes are unavailable.
- Implemented line relocation heuristics to resolve stale line references when hash uniquely identifies a moved line.
- Moved substr needle search from edit application phase to pre-validation phase for earlier error detection.
- Migrated hashline edit type definitions from manual TypeScript interfaces to schema-derived types using Static<typeof schema> pattern.
2026-02-11 08:12:08 +01:00
can1357 bf9ee97d22 feat(coding-agent/patch): added substr source specification for substring-based line matching in patches
- Added `substr` source specification kind to match and replace lines by unique substring without requiring line-hash references.
- Implemented substring matching logic in hashline edits with validation for uniqueness and error handling for not-found and ambiguous cases.
- Added schema definition and type guards for the new `substr` operation type across patch system.
2026-02-11 08:12:07 +01:00
can1357 3e90682970 feat(react-edit-benchmark): enhanced error messages with mutation previews and improved file verification
- Added mutation preview hints to error messages when edits fail with 'No changes made' errors, showing line numbers, hashes, and added/removed lines.
- Changed formatter to pin JavaScript fixtures to the flow parser to avoid parser-dependent formatting drift.
- Added whitespace preservation logic to treat whitespace-only differences as passing in file verification.
2026-02-11 08:12:07 +01:00
can1357 ffdc44e8f1 feat(coding-agent): removed substring source specification from hashline edits and simplified SrcSpec type
- Removed substring source specification kind from hashline edits, requiring users to use line-hash references instead.
- Simplified SrcSpec type to use generic type parameter for line references, removing substring variant from union.
- Updated react-edit-benchmark to use --max-tasks option for deterministic task sampling and changed default batch sizes to 1.
2026-02-11 08:12:07 +01:00
can1357 38e48b9632 feat(coding-agent): added streaming functions and improved hashline format with 2-char hex hashes
- Added streaming functions `streamHashLinesFromUtf8` and `streamHashLinesFromLines` for processing large files with configurable chunking.
- Added `HashlineStreamOptions` interface to control streaming behavior with `startLine`, `maxChunkLines`, and `maxChunkBytes` options.
- Changed hashline format from 4-character to 2-character hex hashes for more compact output.
- Updated `computeLineHash` function to normalize whitespace and removed line number from hash seed for consistency.
- Improved CLI argument parsing with explicit handling of `--help`, `--version`, and subcommand detection.
- Removed `@types/diff` dev dependency as it is no longer needed.
2026-02-10 19:26:49 +01:00
can1357 b016092e9b chore: bump version to 11.10.0 2026-02-10 18:46:35 +01:00
can1357 eff53fbbb6 feat(patch): refactored HashlineEdit.src from string format to structured SrcSpec discriminated union
- Changed `HashlineEdit.src` from string format (e.g., `"5:ab"`, `"5:ab..9:ef"`) to structured `SrcSpec` object with discriminated union types (`{ kind: "single", ref: "..." }`, `{ kind: "range", start: "...", end: "..." }`, `{ kind: "insertAfter", after: "..." }`, `{ kind: "insertBefore", before: "..." }`, `{ kind: "substring", needle: "..." }`).
- Refactored `parseSrc` function to `parseSrcSpec` to handle structured `SrcSpec` objects instead of string parsing, replacing string validation and delimiter parsing logic with explicit case handling for each operation kind.
- Updated tool schema in `index.ts` to define `srcSpecSchema` as a discriminated union type with five variants, replacing the previous simple string-based `src` parameter definition.
2026-02-10 18:27:01 +01:00
can1357 f5e2ff4d69 feat(hashline): enhanced hashline edits with substring matching, merge repair, and Unicode normalization
- Added substring-based source matching for hashline edits to support matching lines by content when hash references are unavailable.
- Added automatic detection and repair of single-line merges where models incorrectly combine multiple lines into one.
- Added normalization of Unicode-confusable hyphens to ASCII hyphens to handle model-generated variations.
- Added heuristics to restore indentation and preserve wrapped line formatting during edits.
- Relaxed comma validation in src to allow commas while rejecting inputs with multiple line references.
- Enhanced parseLineRef to accept shorter hash prefixes instead of requiring exact hash matches.
- Improved error messages for hash mismatches to provide more actionable guidance.
2026-02-10 18:10:40 +01:00
can1357 a62295ca76 feat(hashline): refactored HashlineEdit API with unified range syntax and added benchmark reports
- Replaced HashlineEdit API from old/new/after fields to src/dst fields with unified range syntax supporting single lines, ranges, insert-after, and insert-before operations.
- Added parseSrc() function to parse structured line references from src strings supporting formats like '5:ab', '5:ab..9:ef', '5:ab..', and '..5:ab'.
- Added heuristics to strip anchor line echoes and range boundary echoes from model-generated replacement content.
- Implemented preserveWhitespaceOnlyLinesLoose() for improved whitespace preservation using loose matching strategy when replacement line counts don't match.
- Added comprehensive benchmark reports for Claude Sonnet 4.5, Gemini 2.5 Flash Lite, and GPT-5.1 Codex Mini models evaluating hashline edit performance across 60 tasks.
2026-02-10 17:48:23 +01:00
can1357 ab1db22d1d feat(coding-agent/patch): enhanced hashline validation with toArray helper, HashlineMismatchError, and 2-char hashes
- Added `toArray()` helper function to normalize `string | string[]` inputs for hashline edit operations with comma-separated line reference support.
- Added `HashlineMismatchError` class that displays grep-style output with `>>>` markers for hash validation failures.
- Added `HashMismatch` type for representing individual hash mismatches with line number, expected hash, and actual hash.
- Updated `HashlineEdit` type to accept `string | string[]` for `old` and `new` fields, allowing both singular and plural input formats.
- Reduced hash length from 4 to 2 hex characters (16-bit hashes) for more concise line references.
- Enhanced `parseLineRef()` to strip display-format suffixes and `validateLineRef()` to throw `HashlineMismatchError` with context lines for better error reporting.
2026-02-10 16:52:05 +01:00
can1357 b95ff1abff feat(coding-agent): enhanced hash validation with detailed error reporting and improved field naming
- Added HashlineMismatchError class with formatted error messages showing mismatched hashes with context lines.
- Added HashMismatch type to represent hash validation errors with line number, expected, and actual hash values.
- Enhanced hash validation in applyHashlineEdits to collect all hash mismatches before applying edits instead of failing on first mismatch.
- Renamed HashlineEdit fields from 'src'/'dst' to 'old'/'new' for improved naming clarity and consistency.
2026-02-10 16:27:18 +01:00
can1357 611e24fea0 feat(coding-agent): added hashline edit mode with xxHash64 integrity verification and enum-based edit modes
- Added hashline edit mode for line-addressed edits using hash-verified line references with xxHash64 integrity verification.
- Replaced `edit.patchMode` boolean setting with `edit.mode` enum supporting 'replace', 'patch', and 'hashline' modes.
- Added `readHashLines` configuration setting to include line hashes in read output for hashline edit mode.
- Implemented `computeLineHash`, `formatHashLines`, `parseLineRef`, `validateLineRef`, and `applyHashlineEdits` utility functions for hashline operations.
- Updated read tool to support optional `hashes` parameter and prioritize hash lines over line numbers when both are requested.
- Changed `getEditModelVariants()` return type from `Record<string, 'patch' | 'replace'>` to `Record<string, EditMode | null>` and removed hardcoded model-specific defaults.
2026-02-10 16:11:25 +01:00
can1357 acf8ab5225 style: stylistic changes 2026-02-10 07:39:39 +01:00
can1357 a777ad179d fix(coding-agent): fixed bash tool hanging and file size validation for large @mentions
- Fixed bash tool hanging with background jobs by implementing timeout-based cancellation and draining stdout/stderr pipes instead of waiting indefinitely for EOF.
- Fixed crash when auto-reading large @mentions by adding file size validation (5MB for text, 25MB for images) before reading file contents.
- Prevented out-of-memory issues by skipping files exceeding size limits and displaying file size information in UI for skipped files.
- Added GB file size formatting support to handle very large files in human-readable format.
- Added file size display in UI for skipped files to inform users why files were not included.
- Added test case verifying bash executor returns correctly when command spawns background jobs.
2026-02-10 03:26:43 +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 ba8b9de696 fix(coding-agent): backported pi-mono changes (9ce0007..f9161c4)
packages/agent:
- feat: added hasQueuedMessages() and dequeue helpers for steering/follow-up queues
- fix: resume queued messages from continue() after auto-compaction

packages/ai:
- feat: added Bedrock cache retention support with PI_CACHE_RETENTION env var
- feat: added adaptive thinking for Bedrock Opus 4.6+ models
- feat: added AWS_BEDROCK_SKIP_AUTH for unauthenticated Bedrock proxies
- feat: added AWS_BEDROCK_FORCE_HTTP1 for custom endpoints requiring HTTP/1.1
- feat: re-exported Static, TSchema, Type from @sinclair/typebox
- fix: disabled OpenAI Responses storage by default (store: false)
- fix: clamped reasoning effort for gpt-5.3 Codex models (minimal -> low)
- fix: Bedrock supportsPromptCaching checks model cost fields

packages/coding-agent:
- feat: added /quit slash command as alias for /exit
- feat: added per-model overrides (modelOverrides) in models.json
- feat: merged custom models with built-ins by provider+id instead of replacing
- fix: assistant message spacer before tool executions without visible content
- fix: extension runner emit() type safety with narrowed event/result types
- fix: extension runner tool_result event chaining via dedicated emitToolResult()
- fix: queued messages not delivered after auto-compaction completes
2026-02-07 04:59:57 +01:00
can1357 f0c6399d69 fix(patch): fixed patch applicator to preserve indentation in context-only hunks
- Fixed patch applicator to preserve indentation in context-only hunks by skipping unnecessary adjustments when pattern equals actual content.
- Implemented linear regression-based tab width inference to correctly convert space-indented diffs to tab-indented files using ax+b model.
- Added regression tests for context-only hunk handling and space-to-tab indentation conversion with offset models.
- Updated patch tool documentation to emphasize never using edit operations for indentation or formatting fixes.
2026-02-06 07:24:48 +01:00
can1357 97628bfe0f fix(coding-agent): fixed todo carryover in session initialization and formatting
- Fixed `newSession()` to properly await session manager operations for full initialization.
- Changed session formatting to use XML structure instead of YAML for tools and tool invocations.
- Added formatArgsAsXml() helper function to serialize objects as XML parameter elements.
- Removed trailing whitespace from task.md prompt file.
- Added regression test for AgentSession.newSession() to verify proper session switching and artifact isolation.
2026-02-06 07:10:06 +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 f8950c22b4 refactor(auth-storage): cleanup auth.json mentions
- Migrated authentication storage from JSON-based (auth.json) to database-based (agent.db) format across test files and configuration.
- Simplified auth storage discovery in sdk.ts by removing manual path construction and fallback logic in favor of centralized getAgentDbPath() function.
- Removed dbPath instance property from AuthStorage class as database path is now managed centrally.
- Updated environment variable precedence documentation to reflect agent.db instead of auth.json as the lowest priority source.
- Removed OAuth provider section header comments from multiple test files for cleaner test organization.
- Added support for JSON and JSONC configuration file formats without requiring migration to YAML.
2026-02-05 14:30:22 +01:00
can1357 1a2e833974 feat: added Windows process handle duplication and signal handling for safe job termination
- Added Windows-specific process handle duplication mechanism to safely manage process termination across multiple handles.
- Implemented Windows signal handling support with Signal enum variants (Terminate, Kill, Interrupt) and kill_process() function using Windows API.
- Added background job termination on cancellation with platform-specific implementations (TERM/KILL signals on Unix, TerminateProcess on Windows).
- Implemented cancellation token support in shell execution with proper cleanup of background jobs when timeout or abort occurs.
- Added test coverage for background job termination on timeout and abort scenarios.
2026-02-05 08:10:52 +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 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 a28713b8ba refactor(test): consolidated API key retrieval to use centralized e2eApiKey() utility
- Consolidated API key retrieval across test files to use centralized e2eApiKey() utility function instead of direct environment variable access.
- Removed local API_KEY constant definitions and replaced with imports of e2eApiKey from shared oauth test utilities.
- Updated test skip conditions to use e2eApiKey('ANTHROPIC_API_KEY') for consistent API key availability checks across all test suites.
2026-02-05 03:51:08 +01:00
can1357 b59b104bad refactor(idgen): replaced nanoid with Snowflake ID generator
- Replaced nanoid and randomUUID with Snowflake ID generator across codebase for consistent distributed ID generation.
- Created new Snowflake utility module in packages/utils with support for 64-bit distributed ID generation with configurable epoch, machine ID, and sequence numbers.
- Updated session ID format documentation from nanoid to snowflake hex string format (16 hex characters).
- Removed nanoid dependency from package.json as it is now replaced by internal Snowflake implementation.
2026-02-05 03:48:08 +01:00