Commit Graph

5163 Commits

Author SHA1 Message Date
can1357 075e2f47ad fix(coding-agent/export): prevented HTML template $ substitution expansions
- Switched template CSS/JS inlining replacements to callback form in generation scripts to avoid `$` replacement expansion semantics.
- Updated HTML export generation to use callback-based replacements for theme variables and session data injection to prevent accidental `$` substitution parsing.
- Added regression tests for the inlined script ensuring literal `$'` regex tokens remain intact, no closing HTML tags are injected, and the script parses via `new Function`.
2026-05-12 11:15:38 +02:00
can1357 c42c2313a7 feat(tools): added conflict wildcard reads and per-file write grouping
- Added `:conflicts` and `read conflict://<N>`/`read conflict://<N>/<scope>` support and rejected wildcard conflict reads.
- Added bulk conflict resolution via `write({ path: "conflict://*", ... })` across files with per-file grouping.
- Expanded conflict detection to scan files up to 10MB, track insertion-ordered history, and report full `X of Y` summaries.
- Reworked `spliceConflict` to match marker blocks by content, fixing shifted or stale block splicing.
- Added coverage for wildcard parsing, scoped reads, prepended-line splices, relocation, and warning assertions in detect/integration tests.
2026-05-12 11:15:23 +02:00
can1357 0cdd381aee feat(coding-agent/tools): added scoped conflict URI parsing in read tool
- Added `ConflictScope` parsing for `conflict://<N>/<scope>` with `ours`, `theirs`, and `base` validation.
- Added `read` support for full and scoped conflict URIs, rendering regions via `#readConflictRegion` with preserved formatting metadata.
- Added conflict-count and error handling in read results, including `Conflict #N not found` responses.
- Added `write`-path rejection for scoped conflict URIs, returning `ToolError` before lookup to enforce read-only behavior.
- Added unit and integration tests for scope parsing, conflict rendering, and read/write conflict error scenarios.
2026-05-12 11:03:26 +02:00
can1357 478db5183a feat(tools): added strict conflict parsing for read/write tools
- Added conflictCount metadata and warning badge output to read results for files with unresolved conflicts.
- Added conflict detection parsing with strict marker matching and session-scoped conflict IDs.
- Added write-path conflict resolution for `conflict://N` using token expansion and marker validation before splicing.
- Added unit and integration tests for conflict scanning, history lifecycle, URI validation, and workflows.
2026-05-12 10:55:09 +02:00
can1357 093c13877a fix(tui): normalized per-line output to prevent terminal style/link bleed
- Updated markdown cache keys with terminal capability and style-probe values so stale entries invalidated when image protocol, hyperlink mode, theme, or bgColor output changed.
- Trimmed dangling inline style prefixes in markdown rendering so trailing unmatched SGR escapes were removed before emission.
- Added per-line terminal resets and OSC8 closures in TUI output processing, including truncation, so rendered diffs match bytes actually written to the terminal.
2026-05-12 10:42:28 +02:00
can1357 b4b6536838 feat(pi-natives): added link-following control to filesystem scan options
- Added a follow_links flag to ScanOptions and build_walker so callers could control symlink traversal.
- Updated scan callsites so ast, glob, and grep continued skipping symlinks while fd's fuzzy-find enabled link following.
- Updated fd scoring to favor fuzzy basename matching for queries without '/', reducing matches based only on ancestor directory names.
2026-05-12 10:25:24 +02:00
can1357 3c246dfb11 fix(tui): fixed ctrl+alt+letter matching and render test synchronization
- Adjusted ctrl+alt+letter matching in pi-natives so legacy ESC+ctrl-char failures now fall through to CSI-u and modifyOtherKeys sequences when kitty protocol is inactive.
- Added VirtualTerminal.waitForRender() to wait for the throttled 16ms render budget before flushing.
- Reworked overlay and regression tests to await waitForRender() instead of manual sleep-and-flush synchronization.
2026-05-12 10:22:26 +02:00
can1357 718ab4e3ae feat(tui): added tui autocomplete awaitable slash cmd returns with hints
- Added promise-based slash command completions with Awaitable returns and argumentHint metadata.
- Added kitty modifier-key decoding with super-mask support and validation of Alt/Ctrl/Super printable events.
- Added kitty printable key deduplication by filtering pending unmodified follow-up codepoints in the stdin buffer.
- Added render throttling with stop-time finalization, output normalization, and OSC 9;4 progress updates.
2026-05-12 10:17:04 +02:00
can1357 cb9eef1b34 fix(tui/components): fixed editor paste decoding and autocomplete item guards
- Added pre-processing for pasted CSI-u sequences before newline cleanup, converting Ctrl+letter codes back to literal control characters.
- Added array guards before reading autocomplete suggestion lists to avoid errors when suggestion items are missing or non-array values.
2026-05-12 10:12:25 +02:00
can1357 36df8a5a49 fix(tui/components): implemented strict strikethrough tokenizer for markdown parsing
- Added a strict regex-backed strikethrough tokenizer to override the default `del` token parsing.
- Created a dedicated `Marked` parser configured with the custom tokenizer.
- Switched markdown tokenization to the configured parser so it uses the strict strikethrough rules.
2026-05-12 10:11:47 +02:00
can1357 8e1bccf97e fix(tui): normalized Thai/Lao AM output for terminal rendering
- Added normalizeTerminalOutput to convert precomposed Thai and Lao AM vowels into compatibility decompositions for terminal rendering.
- Converted ASCII classification tables to Uint8Array and updated whitespace and punctuation checks to use bounded code-point lookups.
2026-05-12 10:11:18 +02:00
can1357 6d41cdb68c feat(tui): added terminal OSC progress indicator with keepalive support
- Added OSC 9;4 terminal progress start/stop handling with periodic keepalive updates while active.
- Cleared the progress keepalive timer and sent a clear sequence when progress was stopped.
- Fell back to Bun env terminal size variables when stdout columns or rows were unavailable.
2026-05-12 10:10:16 +02:00
can1357 c2e18617b3 fix(tui): adjusted terminal fallback and hyperlink handling for tmux and screen
- Set the base and trueColor fallback terminals to disable hyperlink support.
- Reworked terminal resolution to apply forced and fallback image protocols on a single resolved TerminalInfo.
- Forced hyperlink support off when running under tmux or screen based on environment variables.
2026-05-12 10:10:01 +02:00
can1357 028a442f18 feat(coding-agent): added parser support for t/rst in Cell eval
- Introduced canonical `*** Cell` headers with `t:` and `rst` attributes in eval prompts, schema, and docs.
- Updated parser and grammar to parse `*** Cell` blocks, stop on `*** End`/next header/EOF, and handle invalid `rst` with errors.
- Added quote-aware attribute tokenizers and split HTML eval parsing into `Cell` and legacy `Begin` handlers with `py` defaults.
- Expanded parsing behavior and tests for `rst` booleans, title aliases, abort boundaries, and stray-line skips between cells.
2026-05-12 10:01:56 +02:00
can1357 c562f4dc2a fix(coding-agent/eval): hardened eval parser against stray non-marker lines
- Updated parseEvalInput to verify begin-cell markers before dereferencing regex matches.
- Skipped stray non-marker lines between and after cells, preserving valid cells when model output is noisy.
- Added eval parse regression tests for stray content and trailing chatter, and kept abort-line handling explicit.
2026-05-12 09:41:06 +02:00
can1357 2726ee03e3 chore: bump version to 14.9.7 2026-05-12 09:29:55 +02:00
can1357 510a3db05a fix(coding-agent/web): propagated abort signals through web search execution
- Extended executeSearch to accept an optional AbortSignal parameter.
- Passed the provided signal through to the search provider invocation.
- Updated execute methods to forward incoming signals into executeSearch.
2026-05-12 09:29:31 +02:00
can1357 8d144e17ec feat(coding-agent/eval): added local python-runner subprocess execution
- Replaced Python execution with a local `python -u runner.py` subprocess and NDJSON stdin/stdout framing.
- Removed shared-gateway architecture, including coordinator lifecycle APIs, `useSharedGateway` wiring, and `jupyter` CLI/actions.
- Simplified setup checks to a plain Python 3 availability probe and removed automatic dependency-install fallbacks.
- Updated kernel cancellation and display processing to use status frames, SIGINT/SIGTERM escalation, and normalized output coercion.
- Added `python-runner` integration and display tests while deleting legacy websocket and kernel lifecycle test suites.
2026-05-12 09:09:24 +02:00
can1357 dcf3f1c8a3 feat(coding-agent): added tool.<name>(args) execution in Python prelude
- Added `tool.<name>(args)` execution in Python prelude and docs, enabling direct tool call syntax.
- Added per-execution Python tool-bridge registration, env wiring, and executor lifecycle management.
- Implemented authenticated loopback `/v1/tool` handling with session/name validation and structured responses.
- Updated runtime and lint handling to permit controlled global eval usage in indirect eval paths.
- Added tests for success, failures, invalid bodies, and `emitStatus` propagation in Python tool bridges.
2026-05-12 08:43:36 +02:00
can1357 2f7b2aaccd feat(coding-agent/eval): stripped TypeScript syntax before import rewrites
- Added a stripTypeScript pass that heuristically detects TypeScript-like syntax and transpiles it with Bun's ts loader before rewriting.
- Integrated the new pass into wrapCode so import and lexical rewrites operate on transpiled input.
- Added an executeJs test that verifies interfaces, type annotations, and type assertions execute to the expected numeric result.
2026-05-12 08:42:52 +02:00
can1357 2d4d70e47e feat(coding-agent): added shared JS runtime for worker execution
- Added shared JS runtime infrastructure with RuntimeHooks, RuntimeOptions, JsRuntime, and indirectEval-based execution.
- Reworked worker execution to use runtime.run, track active runs, and clean pending tool calls on close.
- Added tool-call and tool-reply message variants and wired supervisor/worker to route run-scoped calls.
- Added shared helper globals (read, writeFile, diff, tree, env) for browser-tab JS execution.
2026-05-12 08:42:30 +02:00
can1357 efbaa59a05 fix(coding-agent): routed rewritten static imports through cwd-aware helper
- Rewrote static import lowering to emit `__omp_import__` calls instead of direct `import(...)` so rewritten code routes through worker context helpers.
- Added a `__omp_import__` runtime helper in `WorkerCore` that resolves specifiers against the session cwd via `Bun.resolveSync` while passing through URL-like modules unchanged.
- Updated static import rewrite tests to expect the new helper-based `__omp_import__` form, including import attribute cases.
2026-05-12 08:22:55 +02:00
can1357 95b29561c7 feat(history-storage): added substring fallback to search with FTS tokenization fix
- Fixed query tokenization to split on non-alphanumeric runs, aligning with FTS5 unicode61 indexer so punctuation-delimited terms like `git-commit` match correctly.
- Added LIKE-based substring fallback so infix queries FTS5 prefix matching cannot reach (e.g. `mit` matching `commit`) still return results.
- Merged FTS and substring results with deduplication, prioritizing FTS matches before substring-only matches up to the requested limit.
2026-05-12 08:22:46 +02:00
can1357 f56cbbf4c6 feat(stats): added frustration metrics to stats parser and charting
- Added new frustration and revised behavior metrics across stats types, parser mappings, and UI charts.
- Reworked session sync to fan out parsing across a capped worker pool with SyncOptions progress callbacks.
- Added worker-based parse messaging and throttled TTY progress rendering in the stats sync command.
- Updated behavior scoring to strip structured content, ignore noisy prompts, and fix profanity boundary regressions.
- Expanded user message schema and migrations, then repaired assistant model/provider links during sync backfill.
- Updated worker-import guidance in AGENTS.md and recorded sync-progress/metrics updates in package changelogs.
2026-05-12 07:55:23 +02:00
can1357 a7209c2b4f feat(coding-agent-eval): added worker-backed JS runtime with queued runs
- Added worker-backed JS runtime via Transport and WorkerCore, with queued runs, status/error output, and clean teardown.
- Refactored executeInVmContext to reuse worker sessions, route pending runs by id, and fallback inline on spawn failure.
- Added rewrite helpers to convert top-level imports and demote top-level const/let/class declarations for persistence.
- Handled aborts by canceling in-flight tool calls, hard-killing worker sessions, and dropping JS timeout enforcement.
2026-05-12 07:20:43 +02:00
can1357 e3553b3211 test(coding-agent): align kNoAuth fallback test with #1008 behavior 2026-05-12 06:56:39 +02:00
can1357 34aed93f8e fix: win deps 2026-05-12 06:35:41 +02:00
can1357 c504c2654a chore: bump version to 14.9.5 2026-05-12 06:34:13 +02:00
can1357 92ec8607ff fix(coding-agent/tools): added ts-expect-error for Bun file URL worker import
- Documented why the tab worker entry must be imported with Bun's file attribute despite tsgo limitations.
- Added a @ts-expect-error on the tabWorkerEntryUrl import to suppress tsgo TS1192/TS5097 errors.
2026-05-12 06:32:12 +02:00
Can Bölük 8a5d805c06 Merge pull request #1006 from thedavemarshall/fix/rapidly-blinking-cursor-992
fix(tui): eliminate rapidly blinking cursor during task execution
2026-05-12 06:29:13 +02:00
Can Bölük 4db85a79f2 Merge pull request #1002 from ephraimduncan/fix/plugin-directory-extensions
fix(coding-agent/plugins): resolve directory manifest extension entries to their index.{ts,js,mjs,cjs}
2026-05-12 06:28:55 +02:00
Can Bölük 5dfe593828 Merge branch 'main' into fix/plugin-directory-extensions 2026-05-12 06:28:35 +02:00
Can Bölük 84c306f658 Merge pull request #1005 from tsagi2045/feat/ask-no-timeout-default
feat(coding-agent): default ask.timeout to 0 (wait indefinitely)
2026-05-12 06:27:38 +02:00
Can Bölük 4150c96dfc chore: doesnt require a change 2026-05-12 06:27:16 +02:00
Can Bölük 48a42fed58 chore: doesnt belong here 2026-05-12 06:26:09 +02:00
Can Bölük 92499815e7 Merge pull request #999 from jiwangyihao/fix/windows-ssh-controlmaster
fix(coding-agent): avoid SSH ControlMaster on Windows
2026-05-12 06:24:30 +02:00
Can Bölük 66a9c483aa Merge branch 'main' into fix/windows-ssh-controlmaster 2026-05-12 06:24:23 +02:00
Can Bölük f8c9a310ea Merge pull request #1012 from dmarsh-gusto/fix/export-and-tree-support-developer-messages
fix(coding-agent): render developer-role messages in /export and /tree
2026-05-12 06:21:36 +02:00
Can Bölük 68bf2be367 Merge pull request #1010 from rburketaylor/fix/opencode-go-deepseek-tool-choice
fix(opencode-go): disable tool_choice for deepseek-v4 models
2026-05-12 06:21:29 +02:00
Can Bölük 7f94047453 Merge branch 'main' into fix/export-and-tree-support-developer-messages 2026-05-12 06:21:20 +02:00
can1357 9d2355d1cd fix(coding-agent): expose hasConfiguredAuth on ModelRegistry for external plugins (#993)
External plugins, extensions, and downstream wrappers (notably the upstream
`@mariozechner/pi-coding-agent` AgentSession routed through the legacy-pi-compat
shim) call `modelRegistry.hasConfiguredAuth(model)` before launching a subagent
to short-circuit when no API key is configured. Our `ModelRegistry` did not
expose that method, so the direct agent-launch path threw
`this._modelRegistry.hasConfiguredAuth is not a function` and exited with 0
tokens, 0 tool uses, ~100ms runtime — well before any model conversation began.
The `task` tool path bypassed the preflight and worked, masking the missing
API.

Add a thin `hasConfiguredAuth(model)` wrapper that returns true for keyless
providers and providers with stored auth, matching upstream semantics. Add a
focused regression test asserting the method exists and distinguishes
configured vs. unconfigured providers.

Fixes #993.
2026-05-12 06:20:58 +02:00
Can Bölük 2c14fb6de9 Merge pull request #1014 from dmarsh-gusto/fix/esm-circular-import-tdz
fix(coding-agent): break task↔tools ESM cycle causing TDZ at module load
2026-05-12 06:20:30 +02:00
Can Bölük 976280a177 Merge branch 'main' into fix/esm-circular-import-tdz 2026-05-12 06:20:20 +02:00
can1357 ebbe66a3d6 fix(coding-agent/browser): bundle tab-worker-entry for prebuilt binaries (#1011)
The Worker spawn in spawnTabWorker used `new Worker(new URL(...).href, ...)`
through a local variable, which Bun's --compile static analysis does not
recognize. As a result, tab-worker-entry.ts was never embedded in single-file
binaries (v14.5.13+), and the worker thread failed to load its entry at
/$bunfs/root/tab-worker-entry.ts, surfacing as the user-visible
"Timed out initializing browser tab worker".

Switch to a `with { type: "file" }` import of the entry module so the
bundler discovers and embeds it in both dev and compiled targets.

Regression test asserts `Bun.build` emits tab-worker-entry as an asset
alongside the tab-supervisor entry point — the same static-analysis pass
that powers `bun build --compile`.
2026-05-12 06:16:05 +02:00
can1357 9b687a6dc7 feat(coding-agent-tools): added date range filtering to issue/PR/commit/repo
- Added optional since/until/dateField parameters to issue, PR, commit, and repo search tools.
- Added parsing for relative and ISO date bounds and built inclusive/exclusive/range search qualifiers.
- Allowed issue/PR/commit/repo searches to proceed with only date ranges and no query string.
- Mapped tool-specific date fields (commits, repos) and rejected since/until for code search validation.
- Updated search tool docs and tests for date filter formats, mappings, and unsupported-code-search behavior.
2026-05-12 06:14:14 +02:00
can1357 4af52c46f1 fix(coding-agent): honor keyless-by-design local models in subagent resolution
Fixes #1008
2026-05-12 06:13:12 +02:00
can1357 7579af8584 feat(coding-agent): added owner filtering and exclusive args for job API
- Removed jobs:// references from system prompts, router wiring, and protocol handler exports.
- Added job tool list=true snapshots and enforced list/poll/cancel argument exclusivity.
- Added owner-based filtering for job cancel/getAllJobs/getRunningJobs with mismatch guard in cancel.
- Updated task/job docs and unreleased changelog to route async workflow operations through job tool APIs.
2026-05-12 05:59:51 +02:00
can1357 ec649278bd fix(coding-agent): resolved async job owner filters for scoped cancelAll
- Added ownerId metadata to async jobs and to task/bash progress items from the session agent id.
- Extended async job registration and query methods with optional owner filters, and updated cancelAll to target matching owners.
- Updated session handoff and disposal so subagents inherit the parent manager, top-level sessions own it, and teardown cancels own jobs only.
- Added owner-aware async-job tests using hold/AbortSignal and scoped cancelAll assertions for running versus cancelled jobs.
2026-05-12 05:53:18 +02:00
can1357 4135897e19 feat(coding-agent/prompts): updated task prompts to branch on IRC mode
- Passed the `irc.enabled` session setting into task prompt rendering so templates can branch for IRC mode.
- Updated orchestrator and subagent-task prompts with IRC-specific instruction paths for skip-all checks, coordination, and file-scoped assignments.
2026-05-12 05:51:52 +02:00
can1357 7d233725b6 refactor(coding-agent/eval): removed eval shell run helpers from JS and Python preludes
- Removed the JS and Python eval prelude `run` helpers, including their shell execution and timeout/cwd option handling.
- Updated the JS VM helper set to expose `Bun` and removed the deleted `run` entry from the prelude.
- Revised eval docs to drop `run` from the helper surface and note the new JS `Bun` global.
2026-05-12 05:43:37 +02:00