Commit Graph

2538 Commits

Author SHA1 Message Date
can1357 02367bce6d feat(coding-agent): added tool wire-name support for system prompt rendering
- Added wire-name extraction in system prompt tool metadata and propagated resolved names into rendered prompt context.
- Updated system prompt templates to reference `toolRefs` placeholders and use the resolved name for `report_tool_issue` guidance.
- Added tests to verify custom wire names are emitted in generated prompts and no longer show internal names where overridden.
2026-04-29 01:31:29 +02:00
can1357 b9ba75100b refactor(coding-agent/edit): adjusted hashline preview formatting for atom edits
- Updated atom mode diff output to use path-prefixed preview text and removed the explicit summary header.
- Changed hashline preview generation to truncate unchanged runs by direct slicing and reduced placeholder spacing for line prefixes.
- Updated hashline preview expectations in tests to match the new compact unchanged-line formatting.
2026-04-29 01:27:20 +02:00
can1357 c6a11079f5 feat: added compact atom-mode parser and execution support
- Added compact Lark grammar processing and applied it to OpenAI custom-format tools before conversion.
- Reworked atom mode into `---PATH` compact commands with new grammar, parser, and rm/mv file operations.
- Updated `hline`/`href`/`hrefr` helper behavior and hashline mismatch guidance using shared anchor state.
- Standardized path formatting with `formatPathRelativeToCwd` across LSP, prompts, and edit/search/write tools.
- Added benchmark run-path handling, including `.gitignore` runs mapping, absolute reports, and safer snapshot output.
- Added tests for compact grammar payloads, atom parsing/execution, renderer streaming, and path-list outputs.
2026-04-29 01:16:33 +02:00
can1357 82097602c3 docs(coding-agent/prompts): clarified agent handoff and verification guidance in system prompt
- Updated the system prompt to require concise final outputs without closure recaps or wrap-up narratives.
- Clarified that marking tasks or phase transitions should continue directly to the next pending step without yielding.
- Broadened proof-of-work requirements by removing mock allowances and requiring explicit evidence before yielding on non-trivial work.
2026-04-28 07:58:07 +02:00
can1357 60c9c80e53 fix(coding-agent): allowed multiline replace.with values and preserved signatures
- Removed the newline guard for `replace.with` in atom edit parsing so multiline replacement text is accepted.
- Updated atom tests to assert replacing a matching line with multiline content now succeeds.
- Stopped clearing `optimisticUserMessageSignature` during session-context rendering so interactive status preserves in-progress signatures.
2026-04-28 05:23:26 +02:00
can1357 5944fe34c0 feat(coding-agent): implemented shared single-path edit request handling
- Required top-level `path` in edit requests, removed per-entry `path` fields, and updated docs/tests to match.
- Updated patch/hashline/atom streaming preview generation to return a single request-level path diff preview.
- Changed edit execution to route patch/replace/atom/hashline through single-path handlers sharing `path`.
- Added `scripts/analyze-edit-formats` Go CLI with reports to audit edit-tool usage from session JSONL logs.
2026-04-28 05:21:24 +02:00
can1357 e8c5c660b6 feat(coding-agent): implemented atom replace semantics via replace_file
- Replaced atom sed parsing and operations with replace-based edit schema (`find`, `with`, `all`) and `replace_file`.
- Removed bracketed/range locator handling and delimiter-based block APIs, including `splice_block` workflows.
- Restricted Atom locator parsing to one anchor or `$` with line > 0 and enforced line-only targets.
- Updated atom docs and tests to cover the new replace semantics, anchor-only edits, and literal newline limits.
2026-04-28 03:47:53 +02:00
can1357 b48bcb5fcb docs(coding-agent/prompts): documented plan-mode and read tool rules
- Updated plan-mode-active instructions to require `find`, `search`, and `read` only when exploring.
- Adjusted the system-prompt guidance for the `read` tool to disallow `ls` and explain that `read` on a directory path lists entries.
2026-04-28 01:54:29 +02:00
can1357 88a1072cc5 feat(coding-agent): implemented mcp__-prefixed MCP tool IDs for parsing
- Renamed MCP tool IDs from `mcp_<server>_<tool>` to `mcp__<server>_<tool>`, and changed built-in `grep` to `search`.
- Updated `parseMCPToolName()` and bridge helpers to require and trim the `mcp__` prefix.
- Updated cursor, manager, and session discovery flows to require `mcp__`-prefixed tool names.
- Updated MCP tests and assertion fixtures to use `mcp__`-prefixed tool IDs and expected system prompts.
2026-04-28 01:15:35 +02:00
can1357 527c083977 docs(coding-agent/prompts): clarified large-plan handling guidance in system prompt
- Added guidance in the system prompt to aggressively delegate oversized plans to parallel work instead of dropping phases or narrowing scope.
- This update instructed agents not to abandon or silently trim work when a plan becomes large.
2026-04-28 00:29:34 +02:00
can1357 a3f8f122cc feat(coding-agent): renamed grep to search in runtime mappings
- Renamed the built-in `grep` content-search tool to `search` across settings, schemas, and SDK exports.
- Switched execution wiring so `Task`, `Plan`, cursor, and shell mapping now invoke `search` instead of `grep`.
- Updated prompts, plan-mode docs, and example tool lists to replace `grep`/`ls` references with `search` guidance.
- Aligned `Grep*`/`grep` event, renderer, and hook types to `Search*`/`search` across runtime and tests.
- Documented and fixed `search` result rendering budget behavior and added internal-URL/path-list transcript notes.
2026-04-27 21:55:31 +02:00
can1357 38dd0aa9ff docs(coding-agent/prompts): documented prompt rules to use helper tools
- Updated bash tool guidance to require specialized helpers for file, directory, and search operations instead of shell commands.
- Added find tool guidance requiring file-name lookups to use the built-in Find tool.
- Revised read guidance to require path arguments and use sel for specific line ranges while forbidding cat/head/tail-style reads.
2026-04-27 21:36:51 +02:00
can1357 88cba3c5ba refactor(coding-agent/edit): added structural ordinals for brace-only line hashes
- Added a structural-only-line check that routes whitespace-and-brace lines to a dedicated hash path.
- Introduced structuralBigram to convert line numbers into ordinal suffix tokens and return them for those lines.
- Kept non-alphanumeric-line handling using line-number seeding for all other punctuation-heavy lines.
2026-04-27 14:42:22 +02:00
can1357 296c3da43e fix(coding-agent/tools): raised read default limit and scaled byte budget by line count
- Increased the default `read.defaultLimit` configuration from 300 to 500.
- Computed a dynamic read byte budget in `ReadTool` as `max(50KB, maxLinesToCollect * 512)` so larger line limits are not clipped by the fixed 50KB cap.
- Updated truncation and hashline checks to compare against the new dynamic budget instead of `DEFAULT_MAX_BYTES`.
2026-04-27 14:38:56 +02:00
can1357 697e4aa543 feat(coding-agent/session): added IRC relay forwarding for main session transcript
- Added agent identity and registry fields to session configuration and session creation, enabling relay routing metadata for agent sessions.
- Implemented non-persistent IRC relay emission to forward incoming and reply observations from non-main agents into the main session UI.
- Updated IRC UI rendering to support `irc:relay` messages with participant-aware arrow formatting and body display.
2026-04-27 14:32:13 +02:00
can1357 2b53492c2f feat(coding-agent): added IRC message event handling and chat rendering
- Added an `irc_message` session event carrying custom IRC messages and emitted it when IRC records are created.
- Registered an IRC message handler in EventController that skips duplicate messages by role, custom type, and timestamp.
- The handler now appends IRC messages to chat, resets read grouping, and triggers a UI render.
2026-04-27 02:44:58 +02:00
can1357 8976ce7106 feat(coding-agent): enabled strict atom prompt and removed F mode
- Removed the `F` sed flag and `literal` field, keeping only `pat`, `rep`, and `g`, and dropped the obsolete `F` test.
- Updated sed parsing, serialization, and error text to remove `splice_block` exclusivity and explain regex escaping.
- Reworked atom prompt format to `<ops>/<splice>/<sed>`, with shared `{path, edits}` calls and strict one-loc/one-verb rules.
- Updated docs (`read.md` and `CHANGELOG.md`) to remove `F:true` anti-patterns and add current `line+hash` and sed behavior guidance.
2026-04-27 01:54:53 +02:00
can1357 67b8fe91b6 docs(coding-agent/prompts): expanded atom splice guidance for bracketed edits
- Updated the atom tool prompt to clarify that bracketed `[A]` replacements span the opener and closer lines and must include matching trailing closers.
- Added constraints to avoid bracketed splices on unparsable files, to anchor block edits on body lines, and to reread files after large bracketed edits.
- Documented indentation expectations for bracketed splice re-indentation, warning against mixed-space style in replacement bodies.
2026-04-27 01:02:16 +02:00
can1357 b6027acf89 feat(coding-agent): added splice_block locators for atom edits
- Added `splice_block` atom edits with bracket-aware locators for block, body, head, and tail regions.
- Expanded `href` with optional `pre`/`post` args and updated anchor docs to describe bracketed wrapping behavior.
- Added delimiter and indent helpers to infer block delimiters, skip comments/strings, validate braces, and reindent inserts.
- Updated edit resolution to use block editing flow, enforce splice-only bracket locators, and reject mixed splice_block ops.
- Added unit and regression tests covering splice boundaries, unbalanced-brace cases, and locator validation errors.
2026-04-27 00:53:47 +02:00
can1357 fd8fa422c8 feat(ai): added Fireworks provider onboarding with API-key login
- Added Fireworks provider onboarding with API-key login and credential storage.
- Added Fireworks provider registrations across stream, types, descriptors, and OAuth registries.
- Mapped Fireworks public model IDs to wire IDs for OpenAI-completion requests.
- Extended OpenAI-compatible detection to treat api.fireworks.ai as supported for streaming and max_tokens.
- Updated model catalog handling with Fireworks models plus context-window/max-token inheritance and metadata updates.
- Added Fireworks model reference loading and fallback logic to preserve best context and token caps.
2026-04-26 19:38:01 +02:00
can1357 c8d6efa395 style(coding-agent/tools): removed tree glyph from grouped file headers
- Simplified diagnostic grouping output in the LSP utility to use plain `## file` headers.
- Adjusted AstEdit, AstGrep, and Grep tools to emit file headings without the `└─` tree prefix.
- Removed the GrepTool context legend text and its related guard variable from output construction.
2026-04-26 19:16:36 +02:00
can1357 93ea938375 refactor(edit): removed unsupported ignore-case and multiline sed flags
- Removed `i` and `m` from the Atom sed schema and docs, so sed now accepts only `pat`, `rep`, `g`, and `F` options.
- Updated `SedSpec` parsing and serialization to drop ignore-case and multiline handling.
- Adjusted regex construction to apply sed replacements using only global and literal flags.
2026-04-26 14:56:16 +02:00
can1357 37a8203f94 refactor(coding-agent): standardized tool intent handling via unified intent option
- Replaced `AgentTool` `nointent` and `deriveIntent` with a unified `intent` option that supports `omit`, `optional`, `require`, or a callback function.
- Updated agent tool schema injection and execution paths to inject `_i` as required/optional/omitted and to derive intent through the new `intent` callback.
- Aligned atom-edit tests with the updated default sed behavior (`g` now off by default and explicit `g: true` for global replacement).
2026-04-26 14:54:53 +02:00
can1357 33c760848b feat(coding-agent/edit): added multiline sed support and defaulted global replace to false
- Updated the atom sed schema and parser to accept an optional `m` multiline flag and pass it through as a new `multiline` field.
- Adjusted flag handling so `g` now defaults to false, with formatting and regex construction emitting `g`/`m` only when enabled.
- Kept user guidance aligned by updating atom tool prompt docs with the revised sed defaults and the new multiline option.
2026-04-26 14:52:34 +02:00
can1357 7887d64e25 feat: updated atom.sed edge handling for object syntax and matching
- Replaced `atom.sed` string syntax with `{pat,rep,g?,F?,i?}` objects in schema, prompts, and tests.
- Changed sed validation defaults so `pat` is regex, `g` defaults to global replacement, and `F:true` forces literal matching.
- Fixed `sed` edge cases by allowing sequential same-anchor edits, handling zero-length matches, and preserving chaining.
- Updated native build flow to local `--profile` defaults, refactored enum generation, and switched totals to `total_ms`.
2026-04-26 14:45:45 +02:00
can1357 18085ac704 feat(coding-agent): added optional tool intent derivation and opt-out support
- Added `nointent` and `deriveIntent` to `AgentTool`, and made intent-schema injection honor `PI_NO_INTENT` plus per-tool opt-outs.
- Updated tool execution and streaming UI handling to derive a fallback intent when `_i` is absent, without aborting on derivation failures.
- Marked several coding tools as `nointent` and added `deriveIntent` callbacks where needed, then relaxed prompt language to indicate intent is present on most tools.
2026-04-26 14:22:26 +02:00
Can Bölük 9ece58c501 Merge pull request #623 from apoc/fix/notification-inject-on-receive
fix(coding-agent): inject received notifications into agent context immediately
2026-04-26 13:53:17 +02:00
Can Bölük 497cbe4a3a Merge pull request #604 from Clarity-89/fix/status-line-branch-overflow
fix: shrink path segment before dropping branch from status line
2026-04-26 13:42:24 +02:00
Can Bölük 6e711b9da1 Merge branch 'main' into feat/ollama-provider 2026-04-26 13:35:27 +02:00
can1357 848388c1a3 refactor(coding-agent): remove edit-mode autocorrects and unsafe partial JSON unescape
Drop three pieces of well-intentioned-but-fragile string mangling that
were quietly mutating model edit content:

- `maybeAutocorrectEscapedTabIndentation` in both hashline and atom edit
  modes (plus the `PI_HASHLINE_AUTOCORRECT_ESCAPED_TABS` env toggle and
  `isEscapedTabAutocorrectEnabled` helper). Literal `\\t` in edit content
  is now preserved verbatim.

- `maybeWarnSuspiciousUnicodeEscapePlaceholder` and the
  `runHashlinePreflightSanitizers` wrapper. The warning was misleading:
  it flagged `\\uDDDD` as suspicious without distinguishing intentional
  literal text from a likely-malformed escape, and it was the only
  remaining caller.

- The hand-rolled JSON-unescape fallback in
  `decodePartialJsonStringFragment` (renderer.ts). The fallback used
  `String.fromCharCode` (mishandling lone surrogates) and only covered a
  subset of JSON escapes, so the same fragment decoded one way mid-stream
  and a different way after `JSON.parse` succeeded. Now we trim a
  trailing partial `\\u`/odd-backslash escape and surface the raw
  fragment if `JSON.parse` still fails.
2026-04-26 13:05:19 +02:00
can1357 fe36c93300 fix(coding-agent): sanitized edit and diff text before rendering
- Added sanitizeText to edit renderer previews and diff rendering before line processing.
- Passed filePath into replaceTabs calls across edit previews, errors, and diff visualization paths.
2026-04-26 13:01:42 +02:00
can1357 2e3e032645 fix(coding-agent): preserve editor draft on optimistic user message_start
Fixes #783
2026-04-26 13:00:00 +02:00
can1357 4219ce736e fix(coding-agent/web): fixed ZAI MCP tool identifier to web_search_prime
- Updated the ZAI provider constant to use the `web_search_prime` tool name.
- This aligned the search provider configuration with the expected MCP endpoint identifier.
2026-04-26 12:46:34 +02:00
can1357 e847616f61 fix(edit): rejected zero-length sed matches in atom edits
- Added a guard in applySedToLine that probes matches and rejects sed patterns that match empty strings.
- Updated atom edit error handling to label invalid sed expressions as rejected rather than failed to compile.
- Adjusted sed tests to expect the new rejection wording and added coverage for zero-length pattern `s/()/X/`.
2026-04-26 12:27:51 +02:00
can1357 76b0393874 fix(coding-agent/tools): fixed Puppeteer browser resolution and added on-demand Chromium setup
- Replaced Puppeteer imports and package references with puppeteer-core, adding @puppeteer/browsers where needed for explicit browser management.
- Updated the browser tool to prefer a detected system Chrome/Chromium executable and respect PUPPETEER_EXECUTABLE_PATH before launch.
- Implemented lazy, on-demand Chromium download via @puppeteer/browsers with cached executable resolution and fallback error handling.

Fixes #797
2026-04-26 12:26:14 +02:00
can1357 9dea505c97 feat(session-observer): left/right cycle agents and auto-scroll to bottom 2026-04-26 12:13:39 +02:00
can1357 21559626da chore: updated fix scripts to use workspace-level TypeScript fixes
- Updated the root `fix:ts` script to run `bun run --workspaces --if-present fix` after `fix:tools`.
- Updated `fix:ts:all` to run `fix:tools:all` followed by workspace-wide `fix` tasks.
- Applied minor SearXNG request cleanup, including direct `Authorization` header assignment and formatting-only formatting changes.
2026-04-26 12:12:46 +02:00
Can Bölük 94d3c05519 Merge pull request #743 from DamanHanzo/feat/session-observer-enhancements
feat(session-observer): full-screen viewer with scrolling, expand/collapse, markdown, and agent cycling
2026-04-26 12:11:42 +02:00
Can Bölük 39e0cbe4f9 Merge pull request #712 from mouyase/feat/searxng-search-provider
feat(search): add SearXNG support to web_search tool
2026-04-26 12:10:29 +02:00
Can Bölük d52b3acd15 Merge pull request #796 from apoc/feat/drop-command
feat(coding-agent): add /drop command to delete current session and start fresh
2026-04-26 12:06:46 +02:00
can1357 3b82ecf242 feat(coding-agent/tools): updated read selector syntax to support numeric and plus ranges
- Updated `read` selector parsing for file and URL reads to accept optional leading `L` and `+` count-style ranges.
- Adjusted truncation notices and schema/help text to emit and suggest `sel` offsets without the `L` prefix, including continuation and suggestion messages.
- Updated hashline/output parsing and related tests to recognize the new `sel` formatting in truncation notices.
2026-04-26 11:48:45 +02:00
can1357 06a5cc2ba1 docs(coding-agent/prompts): refined atom tool documentation wording
- Updated atom tool docs to clarify that `pre` inserts before the anchor and `post` inserts after it.
- Simplified the `F` flag description in the sed guidance from a detailed phrase to the concise term `literal`.
2026-04-26 11:29:41 +02:00
can1357 09e5407539 refactor(coding-agent): renamed atom edit verb from set to splice
- Renamed atom tool schema fields and internal `AtomEdit` operation from `set` to `splice` in edit parsing and application.
- Adjusted resolver and conflict checks to use `splice` semantics, including file-loc rejection, blank-line deletion handling, and sed precedence.
- Updated atom edit documentation and tests to describe and verify the new `splice`-based API.
2026-04-26 11:16:52 +02:00
can1357 94e9dcf35f feat: never collapse added lines in the diff 2026-04-26 10:56:11 +02:00
can1357 fe25549d1f refactor(coding-agent): updated hashline/grep anchors to * and |-separated output
- Updated `formatMatchLine` to emit `*` for matched lines, a leading space for context, and a `|` anchor/content separator.
- Revised grep/hashline mismatch messages and prompts to describe the new marker and separator format.
- Aligned affected atom and hashline tests with the updated match-line prefixes and separators.
2026-04-26 10:41:07 +02:00
Miroslav Drbal 4ad7a9d754 fix(coding-agent): address /drop reviewer findings
- dropSession: close persist writer before deletion to prevent EPERM
  on Windows where an open file handle blocks unlink
- #runNewSessionFlow: guard UI reset on newSession return value;
  session_before_switch hook cancellation now prevents chat state
  being cleared and success banner being shown
2026-04-26 10:36:38 +02:00
can1357 413e517c5e feat(coding-agent): added AgentRegistry for IRC session peer lookup
- Added `AgentRegistry` singleton with session registration/unregistration and IRC routing metadata for peer lookups.
- Added IRC messaging prompts and tooling with `irc.enabled` setting, `list/send` tool paths, and peer roster rendering.
- Changed `/btw` to session-side `runEphemeralTurn`, added background IRC exchange flushing, and fixed empty-input checks.
- Added unit tests for IRC tool and BtwController ephemeral behavior, including disabled, busy, not-found, and abort cases.
2026-04-26 10:28:22 +02:00
Miroslav Drbal d9d870bab4 feat(coding-agent): add /drop command to delete current session and start fresh
/drop works like /new but permanently deletes the current session file
and artifacts instead of flushing (saving) it. Useful when the session
should not be kept.

- add drop?: boolean to NewSessionOptions
- branch in AgentSession.newSession(): skip flush, delete via
  FileSessionStorage.deleteSessionWithArtifacts when drop=true;
  deletion failure is non-fatal (logged, new session still starts)
- wire handleDropCommand() through InteractiveModeContext interface,
  InteractiveMode delegation, and CommandController implementation
- guard: shows error if session has not been saved yet (no file to drop)
- register /drop in builtin-registry adjacent to /new
2026-04-26 10:00:48 +02:00
can1357 8e5ad4665c feat(coding-agent/tools): added unified job tool for poll and cancel
- Added a unified `job` prompt and removed `poll` and `cancel-job` prompts, documenting merged async actions.
- Renamed `PollTool` to `JobTool` and replaced `poll`/`cancel_job` tool exports with a unified `job` tool.
- Expanded `JobTool` schema to accept `poll` and `cancel` IDs, adding cancel-first execution for cancel-only requests.
- Consolidated poll/cancel rendering in `renderJob`, mapping `await`, `poll`, and `cancel_job` keys to the unified job renderer with action badges.
- Updated bash/task prompts and tests to use `job` for polling and cancellation flows, including JobTool auto-background checks.
2026-04-26 09:31:57 +02:00
can1357 4c1a899679 chore: reformat 2026-04-26 09:05:56 +02:00