Commit Graph

85 Commits

Author SHA1 Message Date
can1357 d8384a488e feat(fetch): added optional Kagi summarizer toggle to fetch configuration
- Added `fetch.useKagiSummarizer` configuration setting to toggle Kagi Universal Summarizer usage in fetch tool.
- Updated fetch tool to conditionally apply Kagi summarization based on configuration setting.
- Added comprehensive test coverage for Kagi summarizer toggle behavior with mocked dependencies.
2026-03-04 02:34:47 +01:00
can1357 f9ac6b5c5f test(coding-agent): removed misaligned exa provider text assertion 2026-03-04 02:11:49 +01:00
can1357 b5a471d8db feat(ask): add back and forward multi-question navigation
Fixes #262
2026-03-03 15:09:46 +01:00
daandden 60086d8a49 fix(ask): restore ask timeout auto-select behavior (#269)
* fix(coding-agent): restore ask timeout auto-select behavior

Fixes #266

* fix(coding-agent): derive ask timeout from ui timeout events

* fix(coding-agent): enforce ask timeout during custom input

* fix(ask): preserve sub-second timeout precision in interactive flow

* fix(ask): reset hook input timeout on user activity

* fix(ask): keep expiration timeout when refreshing tick interval

* fix(ask): auto-select deterministic default on timeout

Fixes #266

---------

Co-authored-by: Vũ Anh Nguyễn <vu.anh.nguyen@mgm-tp.com>
Co-authored-by: can1357 <me@can.ac>
2026-03-03 14:45:06 +01:00
HvC 28d9de74ce Implement Windows Sixel support and terminal capability checks (#241)
* windows sixel imp

* windows sixel imp, terminal capability check, pessimistic sixel selection

* fix codex suggestions

---------

Co-authored-by: Brit <lol@no.com>
2026-03-01 22:23:05 +01:00
can1357 05ffa7ede1 fix(coding-agent): normalize Exa MCP tool payload parsing
Fixes #229
2026-03-01 11:36:34 +01:00
can1357 1643cd4673 feat(ask): migrated ask tool to AbortSignal-based cancellation for unified abort handling
- Replaced timeout-based cancellation with AbortSignal-based cancellation in ask tool for unified abort handling.
- Added signal parameter to UIContext select() and input() methods to support external cancellation propagation.
- Fixed race condition in dialog overlay handling by replacing direct resolve() calls with settled flag wrapper.
- Added comprehensive test coverage for ask tool cancellation behavior across user-initiated and timeout scenarios.
2026-03-01 11:19:32 +01:00
can1357 1c30f5c972 feat: introduced render_mermaid tool for ASCII diagram output
- Added render_mermaid tool to convert Mermaid diagrams to ASCII output with configurable rendering options.
- Added renderMermaid.enabled setting to control availability of the render_mermaid tool.
- Changed Mermaid rendering from PNG terminal graphics to ASCII text format across theme and TUI components.
- Migrated mermaid utilities from pi-tui to pi-utils package with new ASCII rendering functions.
- Removed PNG-based mermaid rendering APIs (getMermaidImage, renderMermaidToPng) in favor of ASCII alternatives.
2026-03-01 09:40:57 +01:00
can1357 6da102a11b feat(coding-agent): pass reason to apply/reject callbacks in PendingAction
PendingAction.apply() and reject() now receive the reason string that was
passed to resolve(). This lets custom tools surface the agent's rationale
in their apply/discard output or use it for logging.

- PendingAction interface: apply(reason) and reject?(reason)
- CustomToolPendingAction: same signatures, reject is optional
- CustomToolLoader: threads reject through when building PendingAction
- AstEditTool: accepts _reason (unused, reserved for future tracing)
- resolve.test: covers reason forwarding on apply and reject paths,
  and verifies reject return value replaces the default discard message
- docs/resolve-tool-runtime.md: updated interface table, built-in
  producer description, usage example, and developer guidance
2026-03-01 03:36:43 +01:00
can1357 c3d0bd9773 feat(coding-agent): deferrable tools, LIFO pending-action stack, custom tool pushPendingAction
- Introduce `deferrable?: boolean` on AgentTool, CustomTool, and ToolDefinition.
  AstEditTool sets it to true; resolve is now injected only when at least one
  active tool is deferrable (previously unconditional).

- Replace single-slot PendingActionStore (set/get/clear) with a LIFO stack
  (push/peek/pop/clear). Multiple deferrable tools can stage independent
  preview actions; resolve always consumes the topmost one first.

- Wire pendingActionStore through discoverAndLoadCustomTools / loadCustomTools /
  CustomToolLoader so custom tools can call pushPendingAction(action) to
  register a resolve-compatible pending action with label, apply callback,
  optional details, and optional sourceToolName.

- Export HIDDEN_TOOLS and ResolveTool from the SDK for manual tool composition.

- Add CustomToolPendingAction type and pushPendingAction to CustomToolAPI.

- Update createAgentSession to re-inject or remove resolve after the deferrable
  audit, consistent with createTools behavior.

- Add LIFO resolve test, update existing tests (set -> push, get -> peek).

- Add docs/resolve-tool-runtime.md covering PendingActionStore internals,
  built-in producer example, and custom tool usage guide.
2026-03-01 02:57:31 +01:00
can1357 cd6ed4ce8c refactor(tools): restructured tool rendering to inline highlighted format
- Simplified resolve tool output rendering from boxed layout to inline highlighted format for cleaner display.
- Updated resolve tool to parse source tool name from label using colon separator instead of separate metadata field.
- Replaced CachedOutputBlock with direct line rendering using padToWidth and inverse styling.
- Removed actionBadge helper function and consolidated action/state logic into single rendering path.
- Updated 1 test to verify inline rendering behavior and label parsing.
2026-03-01 02:44:52 +01:00
can1357 67e1aa40bf feat(coding-agent): introduced resolve tool for AST edit preview confirmation with reasoning
- Added `resolve` tool to apply or discard pending AST edit previews with required reasoning.
- Changed `ast_edit` tool to always return previews by default; removed `preview` parameter.
- Added `getToolChoice` callback option to dynamically override tool choice per LLM call.
- Implemented PendingActionStore for managing deferred tool action state across agent sessions.
- Updated agent loop to support dynamic tool choice resolution via optional callback.
2026-03-01 02:35:43 +01:00
can1357 69cadd7f60 chore: renamed AST tools 2026-03-01 01:45:22 +01:00
can1357 dc2fde6e0f fix(coding-agent): use vi.spyOn for fetch mocking in exa tests
Replace direct globalThis.fetch assignment with vi.spyOn + vi.restoreAllMocks
to prevent mock leaking to other test files.
2026-02-28 21:59:40 +01:00
can1357 a5470157da fix(coding-agent): fallback to Exa MCP without API key
Fixes #224
2026-02-28 21:49:58 +01:00
can1357 6a81ed9fa7 fix: resolve type errors in web-search-anthropic test 2026-02-28 21:34:28 +01:00
can1357 7d0807ec36 feat(ai,coding-agent): Google fingerprint hardening
providers/google-gemini-cli:
- parseGeminiCliCredentials() handles legacy, alias (project_id/refresh/expires),
  and enriched credential JSON formats
- shouldRefreshGeminiCliCredentials() + refreshGeminiCliCredentialsIfNeeded()
  proactively refresh OAuth tokens 60s before expiry for both providers
- normalizeAntigravityTools() converts parametersJsonSchema -> parameters
  in function declarations for Antigravity compatibility
- VALIDATED tool calling config applied for Antigravity + Claude model combos
- maxOutputTokens removed from generation config for Antigravity non-Claude models
- Antigravity system instruction injection scoped to Claude + gemini-3-pro-high models
- Antigravity session ID: signed decimal int63 derived from SHA-256 of first user
  message (or random bounded int63), replacing truncated hex hash
- Antigravity requestId uses agent-{uuid}; non-Antigravity requests omit
  requestId/userAgent/requestType from payload
- ANTIGRAVITY_DAILY_ENDPOINT corrected to daily-cloudcode-pa.googleapis.com;
  sandbox kept as fallback
- ANTIGRAVITY_SYSTEM_INSTRUCTION exported

oauth/google-antigravity:
- PKCE removed from OAuth flow (no code_challenge)
- loadCodeAssist metadata ideType changed to ANTIGRAVITY
- discoverProject uses single production endpoint; falls back to onboardUser LRO
  (up to 5 retries, 2s interval) instead of hardcoded default project ID
- ANTIGRAVITY_LOAD_CODE_ASSIST_METADATA exported

oauth/google-gemini-cli:
- PKCE removed from OAuth flow

oauth/index:
- getOAuthApiKey includes refreshToken, expiresAt, email, accountId in
  Gemini/Antigravity JSON payload for proactive refresh support

discovery/antigravity:
- Tries production daily endpoint first, sandbox as fallback
- Removed recommended/agentModelSorts filter; applies denylist instead
- ANTIGRAVITY_DISCOVERY_DENYLIST filters low-quality/internal models
- Request body no longer includes project field

coding-agent:
- gemini_image: corrected responseModalities to uppercase IMAGE/TEXT
- Gemini web search: endpoint fallback (daily->sandbox) with retry on 429/5xx,
  aligned Antigravity request metadata, ANTIGRAVITY_SYSTEM_INSTRUCTION injection
- buildGeminiRequestTools() helper for composable googleSearch/codeExecution/urlContext
- Web search schema: expose max_tokens, temperature, num_search_results params
- Web search: explicit provider falls back to auto chain when unavailable

Tests: google-antigravity-auth, google-gemini-cli-alignment, web-search-gemini
2026-02-28 21:17:57 +01:00
can1357 e7daffdda7 feat(ai,coding-agent): Claude fingerprint hardening
providers/anthropic:
- Bump claudeCodeVersion to 2.1.63; system instruction identifies as Claude Agent SDK
- X-Stainless-Os and X-Stainless-Arch now runtime-computed via mapStainlessOs/mapStainlessArch
- Remove X-Stainless-Helper-Method; update package version to 0.74.0, runtime to v24.3.0
- Remove fine-grained-tool-streaming-2025-05-14 from default beta set; add
  context-management-2025-06-27 and prompt-caching-scope-2026-01-05
- Accept-Encoding updated to 'gzip, deflate, br, zstd'
- Inject x-anthropic-billing-header block (SHA-256 payload fingerprint) and
  Claude Agent SDK identity block with ephemeral 1h cache-control for OAuth requests
- Auto-generate cloaking user IDs for OAuth metadata.user_id when absent/invalid
- applyClaudeToolPrefix / stripClaudeToolPrefix skip Anthropic built-in tool names
- buildClaudeCodeTlsFetchOptions attaches SNI + default TLS ciphers for api.anthropic.com
- Non-Anthropic base URLs now use Bearer auth regardless of OAuth status
- Prompt-caching no longer strips then re-applies; skips if blocks already have cache_control

oauth/anthropic:
- Token URL changed from platform.claude.com to api.anthropic.com
- OAuth scopes trimmed to org:create_api_key user:profile user:inference
- Code exchange strips URL fragment from callback code (fragment used as state override)
- AnthropicOAuthFlow exported
- OAuth callback server timeout extended from 2 min to 5 min

usage/claude:
- user-agent updated to claude-cli/2.1.63 (external, cli)
- anthropic-beta header extended with full production beta set

coding-agent web search:
- Anthropic provider uses buildAnthropicSearchHeaders instead of buildAnthropicHeaders

Tests: anthropic-alignment, anthropic-oauth, claude-usage-headers, web-search-anthropic
2026-02-28 21:17:57 +01:00
can1357 0a71899499 feat(ast,natives,coding-agent)!: multi-pattern ast_find and ops-based ast_replace
BREAKING CHANGE: ast_find parameter 'pattern' (string) is replaced by
'patterns' (string[]). ast_replace parameters 'pattern' + 'rewrite' are
replaced by 'ops: Array<{ pat: string; out: string }>'.

Native (pi-natives / crates/pi-natives):
- astFind accepts patterns[] array; all patterns run per file, results
  merged and sorted by path/line/column before offset+limit are applied
- astReplace accepts rewrites Record<string,string>; all patterns compiled
  once upfront and applied per file in a single pass
- Deterministic result ordering via BTreeSet/BTreeMap

Coding-agent tools:
- ast_find: multi-pattern deduplication, '>>' prefix on match-start lines,
  padded line numbers, directory-tree grouping (# dir / ## └─ file headers),
  scopePath/files/fileMatches in tool details
- ast_replace: ops[] interface with duplicate-pattern rejection, diff-style
  (-before/+after) previews grouped by directory, parse errors shown on
  zero-replacement path, fileReplacements in tool details
- Tool prompts updated to document new interfaces with multi-pattern examples
- Task item id maxLength raised from 32 to 48 characters
- Added ast_replace tool test suite
2026-02-28 20:48:27 +01:00
can1357 cba80c79c3 fix(schema): harden all provider schema normalizers with cycle detection, fixpoint iteration, and correctness fixes
## New: schema compatibility validation API

Add `validateSchemaCompatibility(schema, provider)` in
`packages/ai/src/utils/schema/compatibility.ts` that performs a static
audit of a JSON Schema against three provider targets:

- `openai-strict`: checks forbidden keys, required/properties symmetry,
  additionalProperties constraint, and that every node declares a type,
  combinator, or $ref
- `google`: checks unsupported keyword set and array-valued type
- `cloud-code-assist-claude`: checks forbidden keywords, array type,
  null type, nullable keyword, and combiner presence; also validates via
  AJV 2020 draft

Add `validateStrictSchemaEnforcement(original, result)` to assert the
fail-open contract: when strict enforcement succeeds the output must pass
openai-strict validation; when it fails the output must be the original
schema object (same reference).

Export both functions and their types from `./utils/schema/index.ts`.

## New: shared constants in fields.ts

Extract `COMBINATOR_KEYS` (`anyOf`, `allOf`, `oneOf`) and add
`CCA_UNSUPPORTED_SCHEMA_FIELDS` as exported constants, eliminating the
local duplicate in `strict-mode.ts` and providing a canonical field set
for Cloud Code Assist (much narrower than the Google set — CCA supports
validation keywords like `additionalProperties`, `minLength`,
`pattern`, etc.).

## Fix: cycle detection in all recursive schema traversals

All recursive walkers now carry a `WeakSet<object>` guard. Previously any
schema with a reference cycle (or a schema object that appears at two
nodes in the tree) would cause an infinite loop or a stack overflow:

- `sanitizeSchemaForStrictMode` / `enforceStrictSchema`
- `normalizeSchemaForCloudCodeAssistClaude`
- `normalizeNullablePropertiesForCloudCodeAssist`
- `stripResidualCombiners`
- `sanitizeSchemaImpl` (Google sanitizer)
- `hasResidualCloudCodeAssistIncompatibilities`

`hasResidualCloudCodeAssistIncompatibilities` previously returned `true`
for already-visited nodes, producing false positives that forced the CCA
fallback schema on valid (but multiply-referenced) schemas. It now
correctly returns `false`.

## Fix: stripResidualCombiners iterates to fixpoint

The previous single-pass approach missed chained combiner reductions
where one collapsed variant exposed another reducible combiner. The
rewriter now loops until no further reduction occurs.

## Fix: mergeObjectCombinerVariants required-field computation

The merged object schema now takes the intersection of all variants'
`required` arrays, then unions in own-level required properties that
exist in the merged schema. Previously the `required` field was silently
dropped from the flattened schema, making all properties effectively
optional.

## Fix: sanitizeSchemaForGoogle improvements

- Type inference for const-collapsed enums: type is derived from all
  variants (must unanimously agree), falling back to inference from enum
  values; mixed null/non-null infers the non-null scalar type and sets
  `nullable: true`
- Const→enum deduplication now uses deep structural equality instead of
  `Object.is`
- Recursion spreads the full options object so new fields (`unsupportedFields`,
  `seen`) are not silently dropped when descending into sub-schemas
- Array-valued `type` is filtered to strings before processing
- Removed incorrect stripping of `additionalProperties: false` (the
  field is valid and should be preserved)
- Parameterized `unsupportedFields` in `SanitizeSchemaOptions` enables
  code reuse between the Google and CCA sanitizers

## Fix: sanitizeSchemaForStrictMode / enforceStrictSchema

- `nullable: true` is now stripped during sanitization and expanded into
  `anyOf: [schema, {type: "null"}]` in the enforcer output, matching
  what OpenAI strict mode requires
- Type inference: `type: "array"` is inferred when `items` is present;
  a scalar type is inferred from uniform `enum` values
- Const→enum merge uses deep equality to avoid duplicate entries when
  both `const` and `enum` exist with the same value
- `additionalProperties` is now dropped unconditionally in sanitization
  (previously only object-valued `additionalProperties` was recursed;
  non-object values were passed through)
- `enforceStrictSchema` recurses into `$defs` and `definitions` blocks
- `enforceStrictSchema` handles tuple-style `items` arrays
- `enforceStrictSchema` skips double-wrapping: optional properties
  already expressed as `anyOf: [..., {type: "null"}]` are not wrapped again
- `tryEnforceStrictSchema` now caches results in a `WeakMap` keyed on
  the input schema object to avoid redundant work on repeated calls

## Fix: mergeCompatibleEnumSchemas deep equality

Uses `areJsonValuesEqual` instead of `Object.is` when deduplicating
enum members, so structurally equal objects are not duplicated.

## New: test coverage

- `packages/ai/test/schema-normalization.test.ts`: comprehensive unit
  tests for strict mode, Google, and Cloud Code Assist normalization
- `packages/ai/test/schema-compatibility.test.ts`: unit tests for all
  three provider targets in the new compatibility validator
- `packages/coding-agent/test/tools/provider-schema-compatibility.test.ts`:
  integration test that instantiates every builtin and hidden tool, runs
  their parameter schemas through all three provider pipelines, and
  asserts zero compatibility violations
2026-02-28 18:41:10 +01:00
can1357 a44f8f1f48 refactor(ai): restructured schema utilities into modular utils/schema package with unified strict mode enforcement
- Extracted schema utilities from typebox-helpers and google-shared into new modular utils/schema package with 17 exported functions.
- Consolidated OpenAI strict mode schema enforcement across codex, completions, and responses providers using unified adaptSchemaForStrict() helper.
- Refactored credential ranking from hardcoded Codex-specific logic to pluggable CredentialRankingStrategy pattern with provider implementations.
- Migrated 500+ lines of Google schema sanitization and normalization logic from google-shared.ts to dedicated utils/schema modules with expanded functionality.
2026-02-28 18:38:29 +01:00
can1357 7de4c831e6 refactor(coding-agent): extracted prompt formatting into reusable utility
- Extracted prompt formatting logic into reusable `formatPromptContent()` utility function with configurable render phases.
- Removed 166 lines of duplicate formatting code from scripts and config modules by centralizing regex patterns and helper functions.
- Updated prompt template rendering to use unified `formatPromptContent()` instead of inline `optimizePromptLayout()` implementation.
- Added comprehensive test coverage for prompt formatting with pre-render and post-render mode validation.
2026-02-28 05:27:46 +01:00
can1357 400fdac6b1 fix lsp diagnostics timeout and symbol targeting correctness 2026-02-28 05:27:46 +01:00
can1357 9b1a848da7 fix(todo-write): auto-start tasks and report remaining items 2026-02-28 05:27:46 +01:00
can1357 aed5c8de15 feat(lsp): added occurrence parameter to symbol resolution for disambiguating repeated matches
- Added `occurrence` parameter to symbol resolution for disambiguating repeated matches on the same line.
- Fixed code action application to execute command-based actions via `workspace/executeCommand` protocol.
- Fixed diagnostics glob pattern detection to recognize bracket character class patterns.
- Fixed LSP render metadata sanitization to prevent tab and newline characters from breaking layout.
- Refactored symbol resolution and code action handling into reusable utility functions with improved error handling.
- Added comprehensive regression test suite covering glob patterns, symbol resolution, code actions, and text sanitization.
2026-02-28 05:27:46 +01:00
can1357 a2193a2d05 feat(coding-agent): added lenient argument validation with circular reference detection
- Added lenientArgValidation option to tools for graceful handling of argument validation errors.
- Refactored schema reference resolution to inline all $ref definitions instead of preserving them at root level.
- Added circular reference detection during schema resolution to prevent infinite loops.
- Added AJV compilation verification to catch unresolved $ref references before tool execution.
2026-02-27 13:31:18 +01:00
can1357 e64013f76e feat(coding-agent): added graceful schema validation fallback for AI providers
- Added graceful schema validation fallback mechanism that degrades to unconstrained schemas on repeated validation failures.
- Enhanced schema enforcement across AI providers to use try-catch pattern with automatic fallback to non-strict mode on validation errors.
- Improved handling of circular, deeply nested, and non-object output schemas with stack overflow prevention and type conversion fallbacks.
- Added `tryEnforceStrictSchema()` utility function providing error-resilient schema validation with strict mode flag tracking.
2026-02-27 13:12:32 +01:00
can1357 1b4fd9cbae feat(tools): added normalizeMixedSchemaNode() to handle JTD and JSON Schema
- Added normalizeMixedSchemaNode() function to recursively convert mixed JTD and JSON Schema definitions into valid JSON Schema.
- Changed output schema validation to gracefully fall back to unconstrained JSON objects when schema is invalid instead of throwing errors.
- Fixed handling of mixed JTD and JSON Schema output definitions by normalizing them during schema conversion.
- Added comprehensive test coverage for JTD-to-JSON Schema conversion and output schema validation edge cases.
2026-02-27 12:17:03 +01:00
can1357 d357298b4e feat(ai): added schema sanitization for strict mode validation
- Added `sanitizeSchemaForStrictMode` function to normalize JSON schemas by removing non-structural keys for strict mode compatibility.
- Enhanced `enforceStrictSchema` to handle union types with object variants and type arrays containing object.
- Fixed `enforceStrictSchema` to properly handle malformed object schemas with required keys.
- Integrated schema sanitization in coding-agent submit-result tool with fallback to non-strict mode on validation errors.
2026-02-26 21:19:43 +01:00
can1357 2e20d87151 feat(coding-agent): simplified skill management by removing per-task pinning
- Removed per-task skill pinning feature; subagents now inherit session skill set instead of per-task selection.
- Removed `preloadedSkills` option from `CreateAgentSessionOptions` interface and related system prompt plumbing.
- Removed `skills` field from Task schema; task execution now passes available session skills directly to subagents.
- Simplified task execution pipeline by removing skill resolution logic and preloaded skills handling from system prompt templates.
2026-02-26 20:47:54 +01:00
can1357 bdb980c478 feat(coding-agent): restructured submit_result tool to nest data and error in result object
- Restructured submit_result tool parameter schema to wrap data and error fields in a nested result object.
- Updated all prompt documentation to reference the new result.data and result.error parameter paths.
- Added validation logic to ensure result is an object containing exactly one of data or error.
- Updated test cases to reflect the new nested result object parameter structure.
2026-02-26 16:56:06 +01:00
can1357 130b646d1d fix(coding-agent): guard report_finding extraction and rendering
Validate report_finding details before extraction and normalize findings before task rendering to avoid crashes when tool errors emit empty details.

Fixes #173
2026-02-26 10:07:02 +01:00
can1357 ccbcb682df fix(submit-result): enforce data-or-error union contract 2026-02-26 09:02:09 +01:00
Muhammad Zahid Masruri fa7b962e51 fix(exa): synthesize answer from per-result summaries (#169)
Request contents.summary from Exa /search API and combine up to
3 non-empty summaries into SearchResponse.answer, replacing the
previous 'No answer text returned' output.

Changes:
- Add contents.summary to every Exa search request body
- Add summary field to ExaSearchResult interface
- Export synthesizeAnswer() to build combined answer from summaries
- Export buildExaRequestBody() for testability
- Export normalizeSearchType() (was private)
- Prefer summary over text/highlights for snippet field (falsy check)
- Only synthesize answer from results that have a URL (mirrors sources filter)

Tests: 37 new tests covering normalizeSearchType, buildExaRequestBody,
synthesizeAnswer (pure unit tests) and searchExa (mocked fetch)
2026-02-25 19:45:34 +01:00
can1357 2bf90e5a94 fix: align task-template test expectations with trimmed prompt output
optimizePromptLayout trims the rendered template, stripping the leading
newlines from sectionSeparator. Tests now account for this.
2026-02-24 03:37:47 +01:00
can1357 8a3699bff4 refactor(prompts): harmonized prompt templates and bolded keywords
- Standardized prompt structures, replacing custom XML-like tags with Markdown.
- Implemented automatic bolding for RFC 2119 keywords (e.g., MUST, SHOULD) in prompt content.
- Simplified environment information provided to agents, removing desktop environment details.
- Updated image generation tool parameters for improved clarity and capacity.
2026-02-23 21:19:26 +01:00
can1357 90f68431bf Fix local URL resolution for bash destinations 2026-02-23 01:51:54 +01:00
can1357 cd5c9655aa refactor: renamed notes protocol to local
- Renamed the `notes://` protocol to `local://` for better clarity.
- Updated all internal references, prompts, and tool documentation.
- Migrated plan storage paths to use the new `local://` scheme.
2026-02-22 18:05:22 +01:00
can1357 4e8a3773c9 refactor(coding-agent): restructured XML tags to kebab-case format
- Renamed XML tags from underscore to kebab-case format for consistency across prompts and system messages.
- Updated context tag from `swarm_context` to `context` in render logic and test assertions.
- Consolidated conditional logic in subagent user prompt by removing duplicate assignment blocks.
- Updated system prompt documentation to reflect kebab-case naming convention for XML tags.
2026-02-22 17:57:52 +01:00
can1357 563d6a0ab9 feat(coding-agent): introduced notes:// protocol for session-scoped artifact storage
- Replaced plan:// protocol with notes:// for session-scoped artifact storage and plan finalization.
- Added title parameter to exit_plan_mode tool to enable plan file renaming during approval workflow.
- Implemented NotesProtocolHandler for notes:// URL scheme with path traversal protection and session fallback.
- Added renameApprovedPlanFile function to handle plan artifact finalization with validation and error handling.
- Updated system prompt documentation to reference notes:// protocol and internal URL schemes for artifact access.
2026-02-22 17:41:01 +01:00
can1357 8a49f11110 test(scrapers): increased PubMed timeout and relaxed metadata assertions for API variability
- Increased PubMed test timeout from 20s to 60s to accommodate slower network conditions.
- Updated metadata field assertions to handle variable response formats from PubMed API.
2026-02-22 12:01:26 +01:00
can1357 7ab8abbcf2 feat(scrapers): added retry mechanisms and data fallbacks
- Added retry logic to PubMed and OpenLibrary fetches.
- Implemented XML parsing fallback for Chocolatey package details.
- Restructured Hackage scraper to use .json and .cabal for metadata.
- Generated informative markdown for OpenCorporates API failures.
- Updated User-Agent headers for Repology.
2026-02-22 11:53:05 +01:00
can1357 469f1546f9 refactor(coding-agent): migrated artifact management to SessionManager for centralized control
- Moved artifact management from ToolSession to SessionManager for centralized lifecycle control and caching.
- Replaced getArtifactManager() with allocateOutputArtifact() async method in ToolSession interface for simplified artifact allocation.
- Updated bash, fetch, python, and ssh tools to call session.allocateOutputArtifact() directly with optional chaining fallback.
- Fixed Lobsters scraper to handle user fields as strings instead of nested objects in API responses.
2026-02-22 11:28:58 +01:00
can1357 83e914d075 fix(submit-result): corrected submit_result validation to prevent false completion flags
- Added validation to submit_result tool to ensure status field is present and correctly typed as 'success' or 'aborted'.
- Fixed executor to only mark submitResultCalled when submit_result tool succeeds or aborts, preventing false positives on validation failures.
- Added type guards and error state checks to prevent setting completion flags on malformed tool execution results.
- Added comprehensive test coverage for submit_result extraction with valid and malformed payload validation.
2026-02-20 15:23:33 +01:00
can1357 aea59fa3e5 style: formatting 2026-02-19 17:06:21 +01:00
can1357 c9c1077272 feat(tools/grep): added artifact:// URL resolution to grep tool for backing file search
- Added support for resolving internal artifact:// URLs in grep tool to search backing files.
- Fixed grep tool to properly handle internal URL resolution with validation for missing backing files.
- Added comprehensive test suite covering artifact URL resolution, regex patterns, and error handling.
- Optimized CI matrix to conditionally include platform variants based on git tag presence.
2026-02-19 15:47:15 +01:00
can1357 ba1e3f8a07 fix(coding-agent): expanded internal url resolution and hardened memory protocol
Fixes #54
Fixes #74
2026-02-18 15:14:21 +01:00
can1357 2e33e436b4 feat: switched to native text sanitization, removed Bun.stripANSI
- Added `sanitizeText` function to pi-natives that strips ANSI escape sequences, removes control characters and lone surrogates, and normalizes line endings.
- Moved `sanitizeText` function from `@oh-my-pi/pi-utils` to `@oh-my-pi/pi-natives` for better code organization and native performance.
- Added line length clamping (4000 characters) to bash and Python execution output to prevent excessively long lines.
- Replaced internal `#normalizeOutput` methods with `sanitizeText` utility function in bash and Python execution components.
- Fixed bash interactive tool to gracefully handle malformed output chunks by normalizing them with `sanitizeText`.
- Simplified documentation by removing WASM terminology from package descriptions and comments.
2026-02-14 03:25:13 +01:00
can1357 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