Commit Graph

2336 Commits

Author SHA1 Message Date
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 a065662cd9 refactor(ast-tools): simplify params, cap parse errors
- ast_grep: drop include_meta (always true now); update prompt examples
- ast_edit: dry_run -> preview; max_replacements -> limit; max_files
  removed from schema, always read from $PI_MAX_AST_FILES (default 1000)
- cap parse errors at PARSE_ERRORS_LIMIT (20) in both text output and
  TUI; show 'N / total' summary when over limit
- export PARSE_ERRORS_LIMIT from render-utils, no hardcoded magic numbers
2026-03-01 02:02:57 +01:00
can1357 69cadd7f60 chore: renamed AST tools 2026-03-01 01:45:22 +01:00
can1357 85c5fad2bc refactor: replace named re-exports with star re-exports in barrel files
Convert export { A, B, ... } from and export type { ... } from blocks
to export * from across all packages (ai, coding-agent, natives, tui, utils).
2026-02-28 22:34:02 +01:00
can1357 3f4659c181 docs(coding-agent): clarified hashline prompt to prevent tab indentation errors
- Added clarification to hashline prompt about literal space indentation in JSON entries to prevent tab character mistakes.
2026-02-28 22:12:10 +01:00
can1357 e42b7bf3ce feat: removed normative rewrite experiment from public API and patch processing
- Removed normativeRewrite setting and buildNormativeUpdateInput() function from public API.
- Removed $normative property and TNormative generic parameter from ToolResultMessage and AgentToolResult interfaces.
- Deleted normative.ts patch normalization module and related helper functions for diff anchor processing.
- Removed rewriteAssistantToolCallArgs() and #rewriteToolCallArgs() methods that modified tool call arguments.
2026-02-28 22:11:46 +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 02dd71d847 fix(ast): allow empty replacements and stop trimming patterns/rewrites
Remove the non-empty validation on `out` in both the TypeScript tool
layer and the Rust native layer. An empty replacement template now
deletes the matched AST node, which is the natural semantics.

Also remove .trim() calls on pattern and rewrite strings — trimming
silently destroys intentional whitespace and serves no purpose since
ast-grep matches on AST structure, not raw text.
2026-02-28 21:17:58 +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 60f8658933 fix(coding-agent): show pending state for partial bash results 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 62dcb9f1ca fix(ai,coding-agent): graceful strict-schema degradation for patternProperties
- Add hasUnrepresentableStrictObjectMap() pre-flight in tryEnforceStrictSchema;
  schemas using patternProperties or schema-valued additionalProperties now
  degrade to non-strict mode instead of throwing during enforcement
- Add test coverage for patternProperties graceful degradation
- Extend ANTHROPIC_OAUTH_BETA in openai-compat route with
  interleaved-thinking-2025-05-14, context-management-2025-06-27, and
  prompt-caching-scope-2026-01-05 beta flags
- Add gemini, codex, and synthetic to providers.webSearch setting enum
2026-02-28 20:47:41 +01:00
can1357 e1a7b6360e chore: bump version to 13.3.14 2026-02-28 18:46:47 +01:00
Kevin Loftis 751ff62f8e Allow /plan to accept an inline prompt (#222)
/plan without args still toggles plan mode on/off as before.
/plan <prompt> enters plan mode and immediately starts planning
with the given prompt, skipping the extra enter-then-type step.
2026-02-28 18:45:03 +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 86074beb57 fix(coding-agent): handle wildcard patterns in grep path 2026-02-28 18:38:29 +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 d1c5258592 docs(coding-agent): removed command listing requirement from handoff instructions
- Removed command listing requirement from handoff instructions in system prompt.
2026-02-28 18:38:29 +01:00
can1357 748be25e25 Improve AST tools: expand language support, filter non-code files, hashline output
Rust (crates/pi-natives/src/ast.rs):
- Expand supported languages from 7 to all 25 ast-grep tree-sitter
  languages: Bash, C, C++, C#, CSS, Elixir, Go, Haskell, HCL, HTML,
  Java, JavaScript, JSON, Kotlin, Lua, Nix, PHP, Python, Ruby, Rust,
  Scala, Solidity, Swift, TSX, TypeScript, YAML.
- Pre-filter file candidates by language-resolvable extension before
  reading or parsing. Non-code files (.md, .zip, .bin, .gitignore, etc.)
  are silently skipped instead of producing misleading parse errors.
- Make canonical_lang_name exhaustive over SupportLang so the compiler
  flags new variants on upstream upgrades.

TypeScript (ast-find.ts, ast-replace.ts):
- Format match output with hashline tags (LINE#HASH:content) when
  hashline mode is active, consistent with read/grep tool output.
  Falls back to plain line numbers when hashline mode is off.
- ast_find now emits all lines of a multiline match instead of a
  single truncated preview line.

Prompts:
- Add AST pattern syntax reference (metavariables, wildcards, variadics)
  to the system prompt.
- Add examples and scoping guidance to ast-find.md and ast-replace.md.
2026-02-28 18:38:28 +01:00
Kevin Loftis 32efca8536 fix(theme): prioritize COLORFGBG over macOS system appearance for auto-detection (#221)
COLORFGBG reflects the actual terminal profile colors, while
detectMacOSAppearance() reports the OS-level dark/light setting.
When a user runs a dark terminal on macOS light mode (or vice versa),
COLORFGBG gives the correct answer. The previous ordering caused omp
to load the light theme in dark terminals when macOS was in light mode.

Detection priority is now:
1. Mode 2031 (terminal DSR) - most authoritative
2. COLORFGBG env var - reflects terminal profile
3. macOS system appearance - OS-level fallback
4. Default to dark
2026-02-28 18:38:14 +01:00
can1357 6075ee11aa chore: bump version to 13.3.13 2026-02-28 15:31:22 +01:00
HvC 8863abc95e Refactor file opening to use 'wx' mode (#215)
"wx" == O_WRONLY | O_CREAT | O_EXCL | O_TRUNC
fixes omp python gateway on windows
2026-02-28 15:29:58 +01:00
can1357 53f19cc947 fix(coding-agent): avoid degrading valid submit_result schemas 2026-02-28 14:16:45 +01:00
can1357 3085d51859 chore: bump version to 13.3.12 2026-02-28 14:07:26 +01:00
HvC 3b51ae012a Refactor response handling in Jina search provider (#212)
Jina response was being parsed wrong
2026-02-28 13:32:24 +01:00
can1357 be03b64cf6 chore: bump version to 13.3.11 2026-02-28 12:37:29 +01:00
can1357 c7eeb76949 fix(images): preserve async state, text blocks, and reject unknown protocol overrides
- event-controller: check async state for inlined image read results
  instead of hardcoding isBackgroundRunning=false
- ui-helpers: fall through to render text blocks when read results
  contain both images and text
- terminal-capabilities: return null for unknown PI_FORCE_IMAGE_PROTOCOL
  values instead of silently falling through to fallback detection
2026-02-28 12:36:51 +01:00
Matej da7eba9c25 fix(images): restore read rendering and protocol fallbacks (#195)
* fix(images): restore read rendering and protocol fallbacks

* fix(tui): narrow kitty fallback heuristic

* fix(coding-agent): keep read placeholder on abort

---------

Co-authored-by: Can Bölük <can1357@users.noreply.github.com>
2026-02-28 12:27:34 +01:00
can1357 2e54c9a18b chore: bump version to 13.3.10 2026-02-28 12:18:12 +01:00
lederniermagicien c34a2c01e4 feat(theme): native macOS appearance detection via CoreFoundation FFI (#207)
Move macOS dark/light mode detection from compiled Objective-C helper
+ shell-out to defaults(1) into the Rust pi-natives crate.

Sync detection: CFPreferencesCopyAppValue reads AppleInterfaceStyle
directly — no subprocess, no shell.

Observer: background thread registers with CFDistributedNotificationCenter
for AppleInterfaceThemeChangedNotification. A 2-second CFRunLoopTimer
serves as both run-loop keep-alive and polling fallback (distributed
notifications may not reliably reach background threads on all macOS
versions). Dedup logic prevents double-firing.

Removes: MACOS_OBSERVER_OBJC constant, getOrCompileObserver(), binary
cache at ~/.omp/cache/, defaults read shell-out, readLines stream
parsing, fallback poll timer.

Adds: crates/pi-natives/src/appearance.rs (CoreFoundation FFI),
packages/natives/src/appearance/ (TS bindings).
2026-02-28 12:13:09 +01:00
can1357 c516c38747 chore: bump version to 13.3.9 2026-02-28 10:56:33 +01:00
can1357 ddb9c99967 chore: bump version to 13.3.8 2026-02-28 06:36:20 +01:00
can1357 ee846c1c31 test(coding-agent): make extension deps discovery test self-contained 2026-02-28 06:33:07 +01:00
can1357 faa1dd32b0 chore: trimmed deps
- Replaced external dependencies with native Bun APIs: glob, TOML parsing, and HTML parsing.
- Removed 7 unused dependencies (file-type, glob, ignore, marked, zod, ms, @types/ms) and simplified package.json.
- Migrated mermaid cache key type from string to bigint using Bun.hash.xxHash64() for efficient hashing.
- Deleted ignore-files utility module and removed rootDir/ignoreMatcher parameters from loadFilesFromDir().
- Implemented inline MIME type detection for images, reducing sniff buffer from 4100 to 12 bytes.
2026-02-28 06:23:00 +01:00
can1357 c9bf2d4d5b feat(coding-agent): replaced smol-toml with native Bun.TOML.parse
- Replaced `smol-toml` dependency with native `Bun.TOML.parse()` for TOML parsing, reducing external dependencies.
- Removed `smol-toml` from package.json dependencies.
2026-02-28 06:11:02 +01:00
can1357 a56e1cd13c refactor(coding-agent): migrated web scrapers to linkedom for DOM API compatibility
- Replaced node-html-parser with linkedom library across all web scrapers for improved DOM API compatibility.
- Updated DOM property access from .text to .textContent and .parentNode to .parentElement for linkedom API.
- Refactored extractDocumentLinks() to use regex-based parsing with 20-link limit instead of full DOM traversal.
- Added type assertions and Array.from() wrappers for querySelectorAll() results to ensure proper typing.
2026-02-28 06:05:36 +01:00
can1357 431b453233 feat(tools): unified glob pattern handling in ast_find and ast_replace tools
- Unified glob pattern handling in ast_find and ast_replace tools by consolidating separate glob parameter into path parameter.
- Added parseSearchPath() utility function to parse glob patterns from file paths and separate base path from glob components.
- Made pattern parameter required in ast_find tool and removed strictness parameter from both ast_find and ast_replace tools.
- Updated tool documentation to clarify that path parameter accepts files, directories, and glob patterns.
2026-02-28 05:56:29 +01:00
can1357 254302fd74 perf(tools): optimized HTML parsing to extract head section only, reducing memory overhead
- Replaced full-page HTML parsing with bounded head extraction to reduce memory usage and parsing overhead.
- Implemented regex-based attribute extraction to avoid DOM parsing overhead for link discovery.
- Added extractHeadHtml() to limit parsing to first 32KB of head section, preventing expensive whole-page traversal.
2026-02-28 05:52:30 +01:00
can1357 d12b2c3b22 feat: introduced ast_find and ast_replace tools for syntax-aware code search
- Added ast_find and ast_replace tools for syntax-aware structural code search and rewriting via ast-grep.
- Added astFind.enabled and astReplace.enabled configuration settings to control tool availability.
- Implemented native AST module with pattern matching, language inference, and edit application for 7 languages.
- Added system prompt guidance to prefer AST tools over bash text manipulation for syntax-aware operations.
2026-02-28 05:29:41 +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 8639768a13 fix(coding-agent): harden post-prompt recovery orchestration 2026-02-28 05:27:46 +01:00
can1357 a2a7e2acfd feat(lsp): added type_definition, implementation, and code_actions LSP operations with source context
- Added type_definition, implementation, and code_actions LSP operations with source context display.
- Replaced column/end_line/end_character parameters with symbol parameter for unified position specification.
- Enhanced definition and references operations to include 3-line source context in results.
- Added glob pattern support in file parameter for diagnostics action.
- Implemented code_actions operation with query matching and apply mode for automated fixes.
2026-02-28 05:27:45 +01:00
can1357 6997642565 docs(prompts): documented context section with XML tags for clarity
- Added XML tags to wrap context section in subagent user prompt template for improved clarity.
2026-02-28 05:27:45 +01:00