Commit Graph

12 Commits

Author SHA1 Message Date
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
can1357 5105b2cd4e fix(browser): prevent stealth logger crashes 2026-07-14 18:47:55 +02:00
can1357 883e68f2d2 deps(deps): bumped dependency versions and refreshed patch mappings
- Upgraded `@agentclientprotocol/sdk` from `0.25.0` to `1.2.1` and `@ark/schema` from `0.56.1` to `0.56.2` in `package.json` and `bun.lock`, updating `patchedDependencies` and override entries accordingly.
- Updated lockfile package metadata to match new manifest versions, including TypeScript `7.0.2`, arktype `2.2.3`, and several related dependency/version dependency-tree entries.
- Added a new `@agentclientprotocol/sdk@1.2.1` patch that extends the package exports with `./dist/schema/zod.gen.js` including type and default import mappings.
2026-07-13 18:51:17 +02:00
can1357 0d07da529a feat(coding-agent-tools): implemented browser execution safety controls
- Implemented cell budget clamping for timeouts to prevent stalled browser operations from exceeding execution limits.
- Added `recover` capabilities for tab workers to clear blocking dialogs and safely terminate hung navigations.
- Introduced `//!world=main` support for `tab.evaluate` via Puppeteer patch to allow execution in main execution contexts.
- Improved failure attribution for tab terminations by tracking dialogs, stalled operations, and specific termination reasons.
2026-07-13 00:05:43 +02:00
can1357 980d24e24c fix(patches): resolved puppeteer locator timeouts
- Corrected `QueryHandler.waitFor` to return results within the isolated Puppeteer world instead of transferring them to the main world.
- Prevented cross-context handle errors in Locator actions that previously caused silent retries until timeout.
2026-07-11 07:33:19 +02:00
can1357 58f962b30c feat(patches): upgraded puppeteer and enabled main world execution
- Upgraded puppeteer-core to version 25.3.0 to resolve stealth patch deactivation.
- Enabled main world execution support via the `!world=main` directive for frames and element handles.
- Improved handle management by updating disposal logic to track and clear main world handles.
- Optimized web worker communication by removing redundant Runtime.enable calls.
2026-07-05 19:42:13 +02:00
can1357 343ade685f fix(deps): re-keyed @ark/schema patch to 0.56.1 for wire key order
The 16.3.7 bump pulled arktype 2.2.2, which pins @ark/schema to 0.56.1. The patch was keyed to 0.56.0, so Bun silently skipped it and the arktype constraint keys reverted to hash/alphabetical order. Tool wire schemas then lost authored declaration order, failing packages/ai schema-wire tests and blocking the release pipeline.

Regenerated the patch against 0.56.1 (flattenConstraints shifted, so the old hunk offsets no longer applied) and re-pointed patchedDependencies.
2026-07-05 17:19:18 +02:00
can1357 57cb7447e0 feat(coding-agent): enhanced browser stealth and automation capabilities
- Overhauled stealth spoofing mechanisms for WebGL, screen dimensions, Web workers, and iframe contexts using prototype-aware injection.
- Centralized function string representation patching to improve mimicry of native browser behavior across global objects.
- Patched puppeteer-core to remove detectable evaluation markers and implement lazy, pull-style execution context management.
- Enabled support for capturing LLM request JSON dumps and adjusted launcher flags to improve organic request patterns.
2026-06-21 04:14:26 +02:00
can1357 f5ebab2b83 feat(utils): vendor mermaid rendering 2026-06-18 18:52:38 +02:00
can1357 7c295faa52 feat: added native support for ArkType schemas alongside Zod
- Added native support for parsing, normalized validation, and serialization of ArkType schemas throughout the agent pipeline.
- Implemented pruning of unconstrained union branches and normalization helpers to handle unrepresentable strict-mode branches.
- Patched ArkType's schema package to preserve declared object key order during serialization.
- Integrated ArkType schemas into `agent-loop` and migrated coding agent tool parameters to ArkType format.
2026-06-18 00:59:56 +02:00
can1357 508a9f543e feat: removed render_mermaid tool and added width-aware Mermaid clipping
- Removed render_mermaid from tool discovery, task definitions, and registries.
- Removed renderMermaid setting and prompt/docs references tied to the deleted tool.
- Added maxWidth and theme color options to Mermaid ASCII resolution in markdown flow.
- Re-rendered Mermaid ASCII in both directions and clipped output to available width.
2026-06-16 21:32:39 +02:00
chan1103 4b136b0710 fix: align Mermaid ASCII box borders for CJK/emoji labels
beautiful-mermaid@1.1.3 measures label width in UTF-16 code units, but
terminals render East Asian characters (Hangul/CJK/kana) and emoji 2
columns wide, so fenced mermaid blocks in assistant messages and
render_mermaid tool output had misaligned box borders for non-Latin
labels (upstream: lukilabs/beautiful-mermaid#119, #122).

Adds a patchedDependencies entry rebuilding the ASCII renderer to
measure terminal display columns: grapheme-cluster segmentation
(Intl.Segmenter), wcwidth-style policy (East Asian Wide + emoji
presentation + ZWJ/VS16/flag sequences = 2 columns; text-presentation
symbols like the renderer's own arrowheads stay narrow), and atomic
wide-glyph cell pairs so label collisions cannot shift row widths.

The patch modifies only existing files (bun cannot patch in new files,
and the exports "bun" condition loads src/ directly, so both src and
dist are patched). It mirrors the upstream PR and should be dropped
once the fix ships in a beautiful-mermaid release; a new CJK alignment
regression test keeps that transition honest.

Verified: bun test packages/coding-agent/test/modes/components/
assistant-message-mermaid.test.ts (8 pass, incl. new display-column
alignment regression test); bun test packages/utils (154 pass); Korean
flowchart renders with uniform display-column row widths through the
patched package.
2026-06-13 16:44:17 +09:00