Commit Graph

508 Commits

Author SHA1 Message Date
can1357 56efdfc4db Merge PR #8546: fix(coding-agent): restore Windows external editor launch (@roboomp) 2026-08-14 14:12:00 +02:00
can1357 04fab5ecb4 feat: replaced custom mupdf wasm pipeline with native function
- Replaced the custom MuPDF-WASM PDF extraction and rendering pipeline with the new `pdfToMarkdown` native function from `@oh-my-pi/pi-natives`.
- Removed legacy MuPDF extraction modules, WASM embedding scripts, and PDF image extraction tools.
- Added OCR warnings and browser/text redirection for unsupported PDF image reads.
- Updated native package definitions, documentation, and test suites for the new PDF inspection capability.
2026-08-14 14:08:28 +02:00
roboomp a9075ae509 fix(coding-agent): restored Windows external editor launch
Passed the cmd.exe /s /c command line through Bun verbatim so configured editors and temporary paths retain their quotes.

Added command-line regression coverage and documented the fix.

Fixes #8544
2026-08-14 11:27:13 +00:00
can1357 15981329d6 refactor(coding-agent): migrated external editor and removed obsolete tests
- Replaced child_process spawn with Bun.spawn in packages/coding-agent/src/utils/external-editor.ts.
- Removed the browser tab evaluation test suite from packages/coding-agent/test/tools/browser-tab-evaluate.test.ts.
2026-08-14 00:14:29 +02:00
can1357 6563b16424 fix(coding-agent): stat-poll git HEAD instead of fs.watch for branch display
- Bun's inotify-backed fs.watch permanently stops delivering events after
  observing git's atomic HEAD.lock -> HEAD rename in the watched directory
  (oven-sh/bun#24875), so the directory-watch fix for issue #8412 still froze
  the status-line branch on Linux after the first switch; CI caught it as a
  30s timeout in status-line-vcs-refresh.test.ts.
- Added git.head.watch: fs.watchFile stat-poll of the HEAD path (reftable dir
  for reftable repos) with a disposer; path-based polling survives inode swaps
  on every platform.
- Status line and footer now consume the helper; the footer previously bound
  fs.watch to the HEAD file inode and died after one switch on all platforms.
- Dropped the FSWatcher error-listener plumbing (StatWatcher has no error
  mode) and reworked the watcher lifecycle tests to the stat-poll contract;
  verified the atomic-rename regression test passes on Linux bun 1.3.14 in
  Docker where it previously timed out.
2026-08-13 20:20:49 +02:00
can1357 b279db1790 test: refactored test suites to eliminate time-based sleeps and polling loops
- Replaced time-based sleeps and polling loops with event-driven promise resolvers and fake timers across agent and tool tests.
- Migrated test suites to share in-memory auth storage and fixtures using lifecycle hooks.
- Updated catalog model definitions, metadata, and configurations.
2026-08-13 19:32:22 +02:00
can1357 b60bef961c feat: introduced nix packaging and path-based binary resolution
- Add comprehensive Nix flake definitions, derivations, modules, and CI workflows.
- Update tests and executables to resolve binaries from PATH rather than absolute paths.
- Ensure byte reproducibility and zeroed timestamps in embedded dashboard archives.
- Add handling for Nix-managed installations in CLI update checks.
2026-08-13 03:52:47 +02:00
can1357 ad2dee6351 feat(coding-agent): improved title generation quality and accuracy
- Set generation temperature to zero for online title generation to prevent garbled names.
- Update system prompt to instruct exact copying of technical terms and names.
- Reject generated titles containing no word characters to prevent punctuation-only sessions.
2026-08-13 02:07:57 +02:00
can1357 3bc6269dbe Merge PR #8339: fix(coding-agent): normalize WebP for STB-backed models (@ethancawse) 2026-08-13 01:14:54 +02:00
can1357 c23c99052b Merge PR #8288: Fix open browser behaviour on Windows (@x86matthew) 2026-08-13 01:14:52 +02:00
Ethan Cawse 8be57a0ce6 fix(coding-agent): normalize native WebP replay 2026-08-12 11:27:27 -04:00
Ethan Cawse 54965de624 fix(coding-agent): guard malformed image data 2026-08-12 10:54:39 -04:00
Ethan Cawse 76b1169858 fix(coding-agent): drop stale native image replay 2026-08-12 09:16:57 -04:00
Ethan Cawse 4c71e92e3e fix(coding-agent): tolerate legacy image metadata 2026-08-12 09:13:03 -04:00
Ethan Cawse f43467f048 fix(coding-agent): preserve image normalization slots 2026-08-12 08:51:16 -04:00
Ethan Cawse 001460ee8a fix(coding-agent): normalize WebP on provider path 2026-08-12 08:36:28 -04:00
Ethan Cawse 2cd25fb4ee fix(coding-agent): normalize WebP for custom STB models 2026-08-11 23:07:21 -04:00
x86matthew 8924c152a4 Fix open browser behaviour on Windows 2026-08-12 02:42:53 +01:00
can1357 21a7693dd7 fix(hashline): prevented exposing terminal newline as an addressable row
- Added `splitAddressableFileLines` to strip terminal newlines from line addressability without removing genuine blank lines.
- Updated coding-agent read tool context parsing to use addressable file lines.
2026-08-12 03:22:01 +02:00
can1357 63b39b7040 feat(coding-agent/utils): expanded tar extraction and validation logic
- Added archive and member size assertion limits along with path byte-length checks for PAX and GNU metadata targets.
- Added support for global PAX attributes, old-GNU name records, and signed GNU base-256 numeric header fields.
- Updated archive reading in WriteTool to accept a filesystem path instead of buffered bytes.
- Added test coverage for signed GNU base-256 values, PAX extensions, overlong path rejections, and oversized archives.
2026-08-12 03:04:17 +02:00
can1357 94a76a8f27 feat: hardened tar parser and optimize prompt handling
- Bound PAX sparse record memory overhead by caching sparse markers and specific keys.
- Update system prompt phrasing and tests for tool inventory and date displays.
2026-08-12 03:04:07 +02:00
can1357 a4d8860a6c feat: added google reasoning controls mcp stream resumption and tar support
- Added Google provider thinking configuration parameters and force-reasoning-off controls.
- Implemented MCP SSE stream resumption using Last-Event-ID and `SSEResumeError`.
- Added support for TAR old-GNU sparse extension blocks, path length checks, and archive entry overrides.
- Restricted external thinking support to specific models and added semver fallback parsing.
2026-08-12 02:32:45 +02:00
can1357 7e2663360f fix(read): bounded tar directory-alias resolution and resolved aliased link targets
- Capped directory-alias rewrites per lookup (ELOOP-style, 40) so a directory
  symlink targeting its own subtree (a -> a/b) throws a catchable ToolError
  instead of looping forever growing the path.
- Deferred pending tar link resolution while any directory on the target path
  is itself an unresolved link, and rewrote targets through established
  directory aliases before the exact-path lookup, so file symlinks routed
  through directory aliases materialize instead of dangling.
- Regression tests reproduce both shapes: pre-fix the aliased symlink read
  failed with 'cannot be materialized' and the self-cycle read hung.
2026-08-12 02:02:33 +02:00
can1357 c63b475f47 Merge PR #8260: fix(read): avoid libarchive for tar reads (@roboomp) 2026-08-12 01:53:49 +02:00
roboomp f30a60b797 fix(read): resolved archive-root symlink targets
Symlink targets that normalize to the archive root (current -> ., dir/up -> ..) now resolve as directory aliases to the root instead of being treated as dangling links. The lookup normalizer distinguishes an empty root target from an escaping target, and ArchiveReader treats a resolved-empty path as the root directory.

Fixes #4774
2026-08-11 22:06:41 +00:00
roboomp 1df67cc667 fix(read): honored GNU sparse PAX member names
GNU 1.0 sparse PAX entries now list under GNU.sparse.name with GNU.sparse.realsize as the displayed size, so root listings no longer expose the internal GNUSparseFile path and reads of the real name reject as sparse instead of reporting the member missing. The on-disk header size still drives offset advance and truncation.

Fixes #4774
2026-08-11 21:57:06 +00:00
roboomp 40ce90866e fix(read): resolved tar directory symlinks lazily
Kept directory symlinks as one alias node and rewrote requested paths through aliases in ArchiveReader instead of cloning every target descendant during indexing.

Full archive materialization now fails explicitly on directory aliases rather than expanding them without a bound.

Fixes #4774
2026-08-11 21:47:45 +00:00
roboomp e1360bbb9d fix(read): preserved symlinks and rejected partial tar indexes
Resolved safe file and directory symlinks against indexed members, while retaining dangling links as listed nodes that fail explicitly when read or materialized.

Required fully buffered tar inputs to reach an end-of-archive zero block so truncated downloads cannot expose partial listings.

Fixes #4774
2026-08-11 21:37:18 +00:00
roboomp 861d5f5909 fix(read): preserved tar hard-link members
Resolved hard-link targets after indexing so forward links and chains reuse the referenced member's storage and size. Missing, directory, or cyclic targets now surface catchable archive errors instead of silently dropping paths.

Fixes #4774
2026-08-11 16:11:16 +00:00
roboomp b49e41fc7a fix(read): rejected non-tar gzip payloads while indexing
A gzip stream whose decompressed payload never presents a complete tar header or terminating zero block (a plain .txt.gz, or a tar truncated before the first header) now raises a catchable ToolError instead of returning an empty index rendered as '(empty archive directory)'. fetch falls back to binary rendering.

Fixes #4774
2026-08-11 16:02:00 +00:00
roboomp 1588f79ecf fix(read): rejected truncated tar members while indexing
A member header declaring more bytes than remain in the buffer now throws a ToolError during indexing instead of being listed as a valid entry that only fails on read.

Fixes #4774
2026-08-11 15:52:07 +00:00
roboomp 5892cd1ea4 fix(read): avoided libarchive for tar reads
- Parsed tar and tar.gz members in-process with bounded gzip inflation.

- Added UTF-8 ustar-prefix coverage for the minimal libarchive crash shape.

Fixes #4774
2026-08-11 15:41:51 +00:00
can1357 b524dfe36f refactor: standardized outbound User-Agent headers on shared utility constant
- Define a centralized `USER_AGENT` constant in `@oh-my-pi/pi-utils` formatted as `omp/<version>`.
- Replace hardcoded and platform-specific user agent strings across AI providers, catalog scrapers, tools, and search providers with the unified `USER_AGENT`.
- Add unit tests for update-cli binary release distribution gating.
2026-08-11 15:38:32 +02:00
Anatoli Tsinovoy 5d8214ea77 fix(coding-agent): keep lineage timezone visible 2026-08-09 16:49:13 +03:00
roboomp a6aa462a60 fix(tui): bounded WSL idle animation CPU
- Removed the Loader backpressure cap so slow ConPTY paints retain the documented proportional duty cycle.

- Made WSL terminal-title working state static to avoid a second periodic OSC write loop.

Fixes #8012
2026-08-08 13:17:01 +00:00
can1357 7cebe901b7 refactor(coding-agent): narrowed over-exported internal symbols
- 28 symbols across discovery, mcp header policy, agent-hub projection and
  rendering, the agent registry, shell tokenizing and changelog comparison
  were exported but referenced only inside their own module; they are now
  module-private, shrinking the deep-import surface.
- Kept AGENT_PLUGIN_MANIFEST_SCHEMA, AGENT_PLUGIN_MCP_SCHEMA,
  parseAgentPluginManifest, clearAgentPluginRootCache and mergeMCPHeaders
  exported: each is a seam for tests that defend real parsing or header
  precedence behavior.
- Nothing reachable from an explicit exports entry or public barrel changed.
2026-08-08 06:32:01 +02:00
can1357 cac0887fee Merge PR #7708: fix(coding-agent): preserve shell quoting in POSIX $EDITOR commands (@metaphorics) 2026-08-05 22:16:29 +02:00
can1357 7ef3822de9 Merge PR #7706: fix(coding-agent): fall back to xsel for Linux X11 clipboard reads (@metaphorics) 2026-08-05 21:50:24 +02:00
metaphorics e9ee424ded fix(coding-agent): preserve POSIX editor quoting 2026-08-05 11:42:28 +00:00
can1357 e9888367d1 refactor: migrated packages to internal utility modules and removed external dependencies
- Implemented in-house, zero-dependency utility modules in `pi-utils` covering DOM manipulation, markdown parsing, templating, browser automation helpers, and terminal buffers.
- Migrated packages across the repository to consume the new internal utilities and `omptype` schema validators instead of external dependencies.
- Removed multiple external runtime and development dependencies including Zod, Marked, LRU cache, Turndown, and Puppeteer browser packages.
2026-08-05 13:39:09 +02:00
metaphorics 64f2639d61 fix(coding-agent): fall back to xsel for Linux clipboard 2026-08-05 10:51:01 +00:00
can1357 6da9460dff Merge PR #7488: fix(task): bound abort cleanup and quarantine late jobs (@metaphorics) 2026-08-05 01:12:02 +02:00
metaphorics 954894f1d4 refactor: centralize version comparison in pi-utils 2026-08-05 02:48:59 +09:00
metaphorics 687f3326b2 fix(task): bound abort cleanup and quarantine late jobs 2026-08-03 20:14:25 +09:00
can1357 0156ddcbe1 fix(coding-agent): kept computer worker graph off CLI startup
- The PR #7205 merge left cli.ts statically importing startComputerWorker,
  dragging the computer worker graph (and pi_natives via the pi-utils
  barrel) into normal CLI startup; --version died under --no-addons and
  dotenv loaded before profile bootstrap. worker-entry is now a
  self-starting side-effect module dispatched via dynamic import like
  every other worker selector, and utils/clipboard.ts imports the mime
  constant from its submodule instead of the barrel.
- Repointed the clipboard test spy at @oh-my-pi/pi-natives/clipboard —
  spying the barrel never intercepted the subpath the code imports, so
  the real native bridge ran (X11 timeouts on headless CI).
- Refreshed the pinned HTML export template digest and the scout gate
  phrase the system-prompt rewrite changed.
2026-08-03 00:02:29 +02:00
can1357 05af20a9f2 fix(coding-agent): prevented recursive argument placeholder expansion in substituteArgs
Extracted the coding-agent scope of PR #7077 (@santhreal): single-pass
placeholder matcher so positional values containing literal $@ or
$ARGUMENTS are never re-expanded. The unrelated utils formatting changes
in that PR were not taken.
2026-08-02 21:19:45 +02:00
can1357 71ca62cb1e Merge PR #7318: fix(coding-agent): support Wayland image paste (@roboomp)
# Conflicts:
#	packages/coding-agent/src/utils/clipboard.ts
2026-08-02 20:54:38 +02:00
can1357 ef852af986 feat(computer): implemented modular desktop backend and script workflows
- Replaced monolithic desktop native bindings and action batching with a modular cross-platform backend structure supporting Wayland, X11, macOS, and Win32.
- Updated the computer tool schema and supervisor to execute persistent JavaScript script runs with timeout clamping and asynchronous tool calling.
- Integrated accessibility (AX) tree snapshotting, node querying, and bounds-based hit testing across platform desktop layers.
- Added native clipboard bindings and updated coding-agent prompts, renderers, and tests to validate script-based computer workflows.
2026-08-02 19:46:25 +02:00
can1357 7c3b24ddf2 feat: implemented cross-platform window discovery and targeting capabilities
- Added window discovery, targeting, and frame validation for macOS, Windows, and Linux platforms.
- Updated computer tool and protocol definitions to support listing and targeting specific application windows.
- Refactored native computer tool exposure to function-only representation across models.
- Updated documentation and test suites to reflect window-scoped computer control capabilities.
2026-08-02 17:35:29 +02:00
roboomp 0e34798036 fix(coding-agent): supported wayland image mime types
List offered Wayland clipboard types and request the first image format supported by the existing image pipeline.
2026-08-01 20:14:09 +00:00