Commit Graph

972 Commits

Author SHA1 Message Date
roboomp 30264cb151 fix(natives): port wayland capture to pipewire 0.9 Rc handle API
capture.rs still constructed the PipeWire main loop and context via the
0.8 owning constructors (MainLoop::new / Context::new / connect_fd),
which pipewire 0.9.2 removed in favour of the Rc handle types. The
migration was partial — StreamBox::new was already 0.9 — so the
wayland-pipewire feature failed to compile with E0599.

Switch to MainLoopRc::new / ContextRc::new(&loop, None) / connect_fd_rc.
The downstream call sites are unchanged: MainLoopRc derefs to MainLoop
(run/quit/clone), ContextRc derefs to Context, and CoreRc derefs to
Core so StreamBox::new(&core, ...) still coerces.

Fixes #7885
2026-08-07 08:19:56 +00:00
can1357 43c1b245e7 chore: bump version to 17.2.10 2026-08-06 13:32:34 +02:00
can1357 86375c130a style: reflowed window id doc comment with cargo fmt 2026-08-05 22:19:57 +02:00
can1357 ee026fa2e3 Merge PR #7704: fix(natives): gate wayland capture capability on pipewire feature (@roboomp)
# Conflicts:
#	crates/pi-natives/src/desktop/linux/wayland/mod.rs
2026-08-05 22:16:16 +02:00
can1357 307ba8b9f3 Merge PR #7711: fix(computer): correct Wayland foreground delivery (@roboomp) 2026-08-05 22:15:47 +02:00
roboomp 2ef15378f6 fix(computer): accept backend-minted window ids in wayland capture
The Capture request arm of Worker::process pre-parsed every window
target as a u64 before consulting the backend, so composite AT-SPI ids
minted by the Wayland backend's own windows() (e.g.
atspi::1.31:/org/a11y/atspi/accessible/1) could never pass the gate,
making per-window capture unreachable on Wayland in every build.

All backends resolve capture targets by string-matching against the ids
they themselves minted, so the u64 gate was a leaked X11/Win32/macOS
assumption. Drop it and let the backend validate the id; unknown ids now
fail as WindowNotFound from the backend lookup instead of InvalidTarget.

Fixes #7701
2026-08-05 11:06:54 +00:00
roboomp ea887b00a9 fix(computer): corrected Wayland foreground delivery
Reported compositor-limited per-window input before reaching the AT-SPI focus path and stopped advertising foreground delivery on Wayland.

Removed the obsolete AT-SPI window-raise helper and updated public recovery guidance.

Fixes #7702
2026-08-05 10:57:25 +00:00
roboomp dc4725e626 fix(natives): gate wayland capture capability on pipewire feature
WaylandBackend::capabilities() hardcoded capture:true, but the PipeWire
screencast path is compiled only under the wayland-pipewire feature, which
is off by default and excluded from shipped Bazel addons (crate_features=[]).
Released builds therefore advertised capture the binary could never do:
every capture() call returned CaptureFailed, and callers trusting
capabilities() retried into a guaranteed failure.

Gate the capture flag and capture_permission on cfg!(feature =
"wayland-pipewire") so the report matches the compiled-in path, and align
docs/computer-use.md with what shipped builds actually support.

Fixes #7700
2026-08-05 10:45:57 +00:00
can1357 f7f8e040ee chore: bump version to 17.2.9 2026-08-05 03:07:47 +02:00
can1357 b0a94a8fc0 chore: cleanup 2026-08-05 03:07:16 +02:00
can1357 f3cf3b926d test(fuzzy-find): prove bounded large-corpus ranking 2026-08-05 01:11:58 +02:00
can1357 0897725394 Merge PR #7536: perf(fuzzy-find): retain only the bounded top-K scored matches (@Mustaqeem66) 2026-08-05 01:11:58 +02:00
can1357 003bb5548c chore: bump version to 17.2.8 2026-08-04 05:53:35 +02:00
can1357 a5090f1f81 chore: bump version to 17.2.7 2026-08-04 01:19:36 +02:00
can1357 1cf919099e style(pi-shell): wrapped long command string in test
- Split a long command string across multiple lines in shell test.
2026-08-03 23:41:07 +02:00
can1357 dce12984f2 fix(pi-shell): parsed state format specifier correctly in ps builtin
- Corrected the mapping of the "state" specifier to PsField::State in the ps format parser.
- Added a test to verify that the ps builtin successfully accepts tpgid and other job control columns.
2026-08-03 19:01:09 +02:00
can1357 451eb9842c fix: mapped tail builtin broken pipe to silent exit 141
- Handled broken pipe errors across tail output and follow paths by translating them to a silent SIGPIPE exit code.
- Prevented stderr noise when downstream pipeline readers exit early, matching native tail behavior.
2026-08-03 18:53:14 +02:00
can1357 cdd1d13079 feat(pi-shell): extended ps builtin format specifiers and process metrics
- Added support for extended ps format specifiers including tpgid, ruid, rgid, egid, pri, flags, min_flt, maj_flt, times, sz, s, ruser, rgroup, and tgid.
- Implemented group name resolution via `getgrgid_r` on Unix platforms.
- Suppressed broken pipe diagnostic output in the tail builtin to match standard tail behavior on downstream closure.
2026-08-03 18:51:23 +02:00
Muhammad Mustaqeem 60187c9ba9 refactor(fuzzy-find): release the heap borrow before evicting
Comparing against the heap root inside an `if let` binding keeps the shared
borrow of `heap` alive across the `pop`/`push` in the same block. Fold the
comparison into the condition instead, so the borrow ends with the
condition expression and eviction takes a clean mutable borrow.

No behavior change.
2026-08-03 21:09:01 +05:00
Muhammad Mustaqeem 2cf0a47d6a perf(fuzzy-find): retain only the bounded top-K scored matches
fuzzyFind returns at most maxResults matches (100 by default), but it
allocated a scored match for every fuzzy hit and full-sorted the complete
hit set before truncating.

Score every eligible entry exactly once into a bounded worst-first
BinaryHeap of at most maxResults candidates, while still counting every
nonzero-score hit for the exact totalMatches contract. RankedMatch orders
candidates as the exact inverse of the final comparator (score descending,
then path_depth ascending, then path ascending), so the heap root is the
first candidate to evict and into_sorted_vec yields the final order
directly. path_depth is now computed once per retained candidate instead of
repeatedly inside the sort comparator.

The scoring stage also consumes the walker outcome as an iterator, so the
all-entry intermediate Vec is gone and the match path is moved instead of
cloned.

Walker request construction, cache policy, scoring rules, query
normalization, symlink handling, the maxResults == 0 and empty-query early
returns, the cancellation heartbeat and error mapping are unchanged.
2026-08-03 21:06:17 +05:00
can1357 01c1f91ff5 chore: bump version to 17.2.6 2026-08-03 16:44:19 +02:00
can1357 74c346623b chore: clippy 2026-08-03 16:43:59 +02:00
can1357 455493dfad feat: introduced native file lock bindings for cross-process advisory locking
- Added native `FileLock` bindings supporting cross-process advisory locking on Linux, Unix, and Windows.
- Replaced directory-based file locking and custom stale-lock reclamation with OS-backed native locks.
- Updated TypeScript declarations, native bindings, and package documentation for the new API.
- Added comprehensive unit tests and fixtures validating single-owner constraints and process death handoff.
2026-08-03 16:09:09 +02:00
can1357 6ca4d0a753 style: applied rustfmt to pcre2 jit statics 2026-08-03 15:26:46 +02:00
can1357 ce408bf9bb feat(grep): added OMP_PCRE2_JIT override for the macos jit gate
- OMP_PCRE2_JIT=1 forces PCRE2 JIT on (macOS opt-in), 0/false forces it off;
  unset keeps JIT on everywhere except macOS (issue #7399).
2026-08-03 15:14:40 +02:00
can1357 0f83baa3b6 Merge PR #7469: fix(grep): disable pcre2 jit on macos (@roboomp) 2026-08-03 15:12:03 +02:00
can1357 3eb89ef4e3 Merge PR #7453: fix(pi-shell): spare host process from run-cancellation sweeps (@roboomp) 2026-08-03 14:46:24 +02:00
roboomp dc1c98f46d fix(grep): disabled pcre2 jit on macos
- Kept PCRE2 matching interpreted on macOS across native grep, embedded grep, and embedded rg while preserving JIT elsewhere.

- Added regressions for both reported PCRE2-only crash patterns.

Fixes #7399
2026-08-03 07:56:17 +00:00
can1357 c53b85aaf4 chore: bump version to 17.2.5 2026-08-03 05:53:12 +02:00
roboomp dc22ea5dad fix(pi-shell): kept recycled targets killable
Protect only the harness pid during cancellation sweeps. The host recorded parent pid can be stale on Windows and recycled onto the hung command; adding that raw pid to the protected set spared the cancellation target and pruned its whole subtree from cleanup.

Keep protected-subtree pruning rooted at the harness itself, which still spares its real workers while allowing the timed-out target to be reaped.

Fixes #7452
2026-08-03 03:47:32 +00:00
roboomp e5f954b0fe fix(pi-shell): prune protected subtrees from cancellation sweeps
The flattened descendant list can contain a protected node (the
harness, on a Windows PID-reuse false-descendant) together with that
node's real children, collected by recursing through it. Skipping only
the exact protected pid kept omp alive but still TerminateProcess'd its
unrelated worker/tool subprocesses.

signal_tree/terminate_tree now drop every node whose recorded parent
chain within the enumerated set passes through a protected pid, so a
false descendant of the harness can no longer drag the harness's real
children into the kill set.

Fixes #7452
2026-08-03 03:42:50 +00:00
roboomp 25633d357d fix(pi-shell): spare host process from run-cancellation sweeps
On Windows the descendant tree used to reap a cancelled bash run is
built from raw th32ParentProcessID links that outlive their recorded
parent. A recycled pid matching the harness's stale parent pid could
surface omp itself (or an ancestor) as a false descendant, and
signal_tree TerminateProcess'd it — killing the session with no
cleanup and no session_exit record when a blocking command hit its
timeout.

Add host_protected_pids() (harness pid plus its resolvable ancestor
chain) and skip those pids in signal_tree and terminate_tree. The
guard is cross-platform: a no-op on Unix, where the descendant walk is
already identity-pinned, and the safety net that keeps a tool timeout
from ever taking down the harness on Windows.

Fixes #7452
2026-08-03 03:34:44 +00:00
can1357 83c0ba0198 fix(natives): used libc::Ioctl for uinput requests to fix musl build
- libc::ioctl takes c_ulong on glibc but c_int on musl; the hardcoded
  c_ulong request type broke //:natives-linux-musl-{x64,arm64}. Verified
  by cross-checking aarch64-unknown-linux-musl on the CI-pinned nightly.
2026-08-02 23:07:47 +02:00
can1357 b0d38498a2 fix(natives): used from_mins for operation timeout to satisfy clippy
- CI's bazel-pinned clippy (nightly-2026-04-29) denies
  duration_suboptimal_units under -Dwarnings; verified against the same
  pinned toolchain locally.
2026-08-02 23:01:51 +02:00
can1357 800b23dd6c fix(natives): gated pipewire behind opt-in feature, fixed linux clippy
- libspa-sys hard-links system libpipewire-0.3 via pkg-config, which no CI
  or cross triple (musl, arm64) can satisfy; bazel addons already build with
  crate_features = [], so shipping builds lose nothing. Linux devs opt in
  with --features wayland-pipewire.
- Gated normalize_role_macos and the wayland capture helpers to the configs
  that use them; handled the cfg(test) AxHandle variant in AtSpiAx::object.
- Fixed clippy-strict violations (redundant_pub_crate, missing_const_for_fn,
  unnecessary_wraps, collapsible_if, map_unwrap_or, needless_return,
  needless_pass_by_ref_mut) across the new linux desktop backend.
2026-08-02 22:55:29 +02:00
can1357 fa72776652 fix(keys): keep unmodified alternate keys as text 2026-08-02 20:57:05 +02:00
can1357 7d6eb47314 feat: implemented ps shell builtin with sorting and formatting options
- Added the `ps` shell builtin with BSD and procps selection forms, custom formatting, and sorting capabilities.
- Implemented the `sanitize_process_command` helper to clean process command names and arguments.
- Updated the bash prompt template and package changelogs to document the new builtin.
2026-08-02 20:40:19 +02:00
can1357 d0c13aab3e fix(pi-natives/desktop): corrected macos accessibility and input routing
- Refused background keyboard delivery for multi-window macOS applications to prevent ambiguous keystroke routing.
- Set `AXMain` and `AXFocused` attributes during foreground macOS input delivery to ensure proper window activation.
- Activated Chromium renderer accessibility trees lazily during window snapshots to avoid capturing only browser chrome.
- Used `AXDescription` as a fallback title for unnamed macOS accessibility controls in snapshots and queries.
2026-08-02 20:29:57 +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
can1357 d595332fc6 chore: bump version to 17.2.4 2026-08-02 00:19:30 +02:00
can1357 dda859b60f fix(ci): hardened logger probe timeouts and silenced async trait lint
- Raised probe-spawning logger tests to 30s timeouts; bun's 5s default
  SIGTERMed probe children (exit 143) on shared-core CI runners, matching
  the precedent documented in logger-contract.test.ts.
- Allowed clippy::unused_async_trait_impl on KillCommand::execute with an
  unknown_lints guard for the pinned CI nightly that predates the lint.
2026-08-01 22:34:39 +02:00
can1357 d3ca0184de fix(brush-core): exposed windows signal stubs as public re-export
pi-shell calls sys::signal::kill_process on the windows target; the
pub(crate) glob re-export made it invisible outside brush-core, unlike
the unix module where kill_process is pub. Mirrors unix visibility.
2026-08-01 22:24:31 +02:00
can1357 534f43eda6 style(pi-shell): wrapped long allow attributes per rustfmt 2026-08-01 22:12:13 +02:00
can1357 ed7d085708 fix(pi-shell): resolved clippy-strict errors in process builtins
- Made infallible ProcInfo accessors const and annotated Option-returning
  accessors with allow(unnecessary_wraps) since Option is the shared
  cross-platform contract.
- Boxed ParseProcResult::Options to shrink the enum.
- Restructured kill signal resolution to bind signal once instead of
  let-then-reassign sequences.
- Simplified liveness re-check with Option::is_none_or.
2026-08-01 22:08:55 +02:00
can1357 d326af8ed0 feat: implemented process management builtins and cross-platform snapshotting
- Implemented new shell builtins including `top`, `pgrep`, `pkill`, `pidwait`, and `kill`.
- Added a cross-platform process snapshot module supporting Linux, macOS, and Windows.
- Extended job and process handling utilities with process iteration and handle termination methods.
- Replaced test mutex locks with thread-local counters to prevent test races in the minimizer engine.
2026-08-01 21:58:09 +02:00
can1357 8baa3300bc chore: bump version to 17.2.3 2026-08-01 08:35:39 +02:00
can1357 d5861c2c66 chore: bump version to 17.2.2 2026-07-31 20:56:49 +02:00
can1357 b3e0bde7b7 refactor(coding-agent): adjusted block resolution formatting and update tests
- Update hashline block resolution formatting to correctly incorporate anchor lines within operation labels.
- Fix and update test assertions and mock contexts across coding agent tests.
2026-07-31 20:55:37 +02:00
can1357 db2659297a Merge PR #7143: fix(natives): prevent deep HTML crashes and silent truncation (@br411)
# Conflicts:
#	MODULE.bazel.lock
2026-07-31 19:17:47 +02:00