Commit Graph

754 Commits

Author SHA1 Message Date
can1357 5f1ed0fcde chore: reformat 2026-07-01 23:14:36 +02:00
can1357 3c22d25200 Merge PR #4110: fix(natives): catch task::blocking panics before FFI to reject JS Promise (@roboomp) 2026-07-01 21:53:15 +02:00
can1357 826517dc69 Merge PR #3969: fix: preserve bash cwd without hidden pwd probe (@jeffscottward) 2026-07-01 21:50:54 +02:00
can1357 d1015a6b87 Merge PR #3774: fix(natives): cap rayon pool on Windows (@roboomp) 2026-07-01 21:42:25 +02:00
can1357 5356713eae chore: bump version to 16.2.13 2026-07-01 20:03:42 +02:00
roboomp bbd4c66768 fix(natives): catch task::blocking panics before FFI to reject Promise
napi-rs 3.9.4 registers async-work `execute` at src/async_work.rs:109 as
a plain `unsafe extern "C" fn` — not `extern "C-unwind"`. Any panic
inside a `Blocking::compute` closure unwound past that boundary and
force-aborted the host process under Rust's stabilized C-unwind rules
(RFC 2945, stable since 1.81), losing the JS Promise and session state.

Wrap the user closure in `std::panic::catch_unwind` inside
`Blocking::compute` and map the panic payload to
`Error::new(Status::GenericFailure, ...)` so it flows through napi-rs's
existing rejection path (`inner_task.reject` in `complete_impl`) and
surfaces as a rejected JS Promise instead of a host abort. Every
`task::blocking` caller (grep, ast, glob, listWorkspace, html-to-markdown,
snapcompact, fuzzy find, clipboard image read) inherits the guard.

Correct the root Cargo.toml `panic = "unwind"` comment — napi-rs's
per-call `catch_unwind` only covers the tokio-future path, not the
`Task`/`AsyncTask` async-work path we use here.

Regression test in `crates/pi-natives/src/task.rs` synchronously invokes
`Blocking::compute` with panicking closures (str literal, formatted,
`panic_any`, plus Ok/Err/double-invoke controls) and asserts the returned
`napi::Error` carries the tag and payload — proving the invariant: a
panicking closure MUST NOT unwind past this method.

Fixes #4071
2026-07-01 07:03:23 +00:00
Jeff Scott Ward 3da25618ea fix: preserve bash cwd without pwd probe 2026-06-30 23:51:28 -04:00
can1357 fccc0ed3ce chore: bump version to 16.2.12 2026-07-01 05:29:19 +02:00
roboomp dff941d5fe fix(coding-agent): preserved bash status while syncing cwd
Propagated the native shell working directory in ShellRunResult so AgentSession can refresh cwd without running a hidden pwd command in the persistent shell.

Added regression coverage for cd plus a failing command followed by echo $?, proving cwd sync no longer overwrites the user's last shell status.

Fixes #3958
2026-07-01 02:27:05 +00:00
can1357 b2a859a7c5 chore: bump version to 16.2.11 2026-07-01 03:06:34 +02:00
can1357 b92bd7d02c chore: update chanelogs 2026-07-01 02:58:17 +02:00
roboomp 578a2d7626 fix(ast): bounded ast search pagination payloads
Retained only the requested AST search page window in native ast_grep/ast_match and the coding-agent multi-target wrapper while preserving exact totals.

Fixes #3935
2026-06-30 23:54:17 +00:00
can1357 ebdc7280cb chore: bump version to 16.2.10 2026-07-01 00:54:29 +02:00
can1357 31d9fb1145 refactor: consolidated filesystem traversal into a dedicated library
- Replaced custom fast-walk and fs-cache implementations in pi-natives with a new dedicated pi-walker library.
- Integrated the thread-safe, parallel pi-walker library across pi-natives, pi-shell, pi-uu-grep, and uu-find.
- Rewrote file search, fuzzy finding, and glob-matching logic to leverage pi-walker configurations and visitor traits.
- Optimized shell process tracking in pi-shell by replacing global descendant-diff logic with an isolated, per-run SpawnRegistry.
- Added parallel rayon-based walking and optimized fast paths for directory scanning and entry classification.
2026-06-30 23:25:50 +02:00
can1357 5c7c9b2b97 feat(pi-natives): implemented platform-native fast directory traversal
- Added a platform-native fast filesystem traversal implementation leveraging `getattrlistbulk` on macOS, `getdents64` and `statx` on Linux, and `NtQueryDirectoryFile` on Windows.
- Integrated the fast traversal path as a preferred, high-performance fallback before standard walk operations in both cache collection and streaming search routines.
- Consolidated grep search logic by extracting a unified file-matching helper to support both standard and fast-walk execution paths.
- Introduced platform-specific Windows system dependency configurations and unit tests validating correct hidden-file filtering during scanning.
2026-06-30 20:37:25 +02:00
can1357 b6c9747d45 chore: bump version to 16.2.9 2026-06-30 18:01:59 +02:00
can1357 5bc68f57cd chore: bump version to 16.2.8 2026-06-30 11:58:55 +02:00
can1357 38250ce88b chore: bump version to 16.2.7 2026-06-30 07:20:23 +02:00
can1357 b704ac698a chore: update changelogs 2026-06-30 06:55:13 +02:00
can1357 531b4d1e8f chore: normalized merged changelog headings 2026-06-30 03:09:32 +02:00
can1357 242705c06c feat: enabled dynamic font rendering with CJK and unicode support
- Added Silver.ttf TrueType font support to `pi-natives` with automated fallback logic for bitmap font rendering.
- Implemented wide code point detection and cell-width calculation to improve CJK character handling and layout.
- Introduced dynamic font-aware preflight probing via `resolveShapeForText` and `renderabilityProbeText` for better font selection.
- Enabled semantic emoji folding and improved text normalization to handle non-Latin characters and emoji filtering.
2026-06-30 02:49:31 +02:00
can1357 0ba736f5bc chore: bump version to 16.2.6 2026-06-29 20:14:08 +02:00
roboomp b53075c616 fix(natives): reserved windows helper thread capacity
- Reserved one probed Windows thread for native helper spawns before enabling Rayon's global pool.
- Treated one-spawnable-worker capacity as sequential-only so vendored sort can still create its mandatory helper thread.
- Updated regression coverage for the reserved-capacity threshold.

Fixes #3770
2026-06-29 02:56:09 +00:00
roboomp d55b948ad0 fix(natives): avoided current-thread rayon fallback
- Used the probed worker count instead of registering the loader thread as Rayon's only worker.
- Kept patched Rayon callsites sequential when no worker thread can be spawned.
- Guarded count_tokens and vendored sort from lazily touching the global pool in the zero-worker case.

Fixes #3770
2026-06-29 02:48:32 +00:00
roboomp 5859de1b7b fix(natives): capped rayon pool on windows
- Configured Rayon's global pool during the post-load native runtime install.
- Fell back to a current-thread Rayon pool when the Windows spawn probe detects commit pressure.
- Added regression coverage for the Windows pool sizing decision.

Fixes #3770
2026-06-29 02:37:12 +00:00
can1357 695b46aa48 chore: bump version to 16.2.5 2026-06-28 23:28:47 +02:00
roboomp 89cee6a4d5 fix(grep-builtin): accept --color/--colour/--version
The in-process grep builtin in pi-shell (backed by pi-uu-grep) shadowed /usr/bin/grep with a clap subset that rejected three universal GNU-grep flags. The common bashrc alias 'grep --color=auto' guaranteed that bare 'grep' in any pipeline failed with exit 2, and probes like 'grep --version' from shell startup scripts errored out the same way.

Add --color[=WHEN] (alias --colour) as an accepted-and-ignored flag — the builtin writes to in-process file descriptors, never a TTY, so injecting ANSI escapes would corrupt downstream consumers. Add --version routed through clap so it lands on the context stdout via the same path as --help.

Fixes #3755
2026-06-28 21:16:09 +00:00
can1357 7bbaebda24 chore: bump version to 16.2.4 2026-06-28 20:43:59 +02:00
can1357 4c3c2fc3e3 chore: update chanelogs 2026-06-28 20:43:32 +02:00
can1357 6a39d4d3fc fix(vendor/uu-tail): prevented panic on broken pipe during bounded tail
- Propagated IO errors from the bounded tail internal logic to avoid panics.
- Updated `print_target_section` to return `io::Result` instead of unwrapping.
- Added a test case to verify that `BrokenPipe` is correctly surfaced when the consumer closes the pipe.
2026-06-28 20:37:36 +02:00
can1357 96be45c3bf chore: bump version to 16.2.3 2026-06-28 17:29:35 +02:00
can1357 24341e4abf chore: bump version to 16.2.2 2026-06-27 13:24:46 +02:00
can1357 d738329485 chore: bump version to 16.2.1 2026-06-27 06:35:42 +02:00
can1357 7463818a32 chore: bump version to 16.2.0 2026-06-27 04:39:59 +02:00
can1357 5a044dc0da feat: consolidated and automate changelog management
- Added `rewrite-changelog.ts` and `fix-changelogs.ts` utilities to automate the consolidation of release notes using LLM-assisted processing.
- Updated multiple internal changelog files by consolidating redundant entries and improving phrasing for readability.
- Implemented `previewLine` utility in `coding-agent` to prevent visual spillover in status rows by managing text truncation and whitespace.
- Updated `package.json` with new workflow scripts for managing package-level change histories and documentation indexes.
2026-06-27 03:08:52 +02:00
can1357 011f036ef5 chore: bump version to 16.1.23 2026-06-26 18:29:01 +02:00
arg3t 17f91f04ec test(natives): cover vendored syntax definitions in Rust 2026-06-26 06:18:46 -07:00
arg3t b10cea54d7 Merge branch 'main' of https://github.com/can1357/oh-my-pi into lsp-reload-nix-highlight
# Conflicts:
#	packages/coding-agent/src/lsp/index.ts
2026-06-26 06:03:33 -07:00
arg3t e894753603 feat(tui): add mermaid rendering toggle 2026-06-26 04:34:44 -07:00
arg3t dacce3bc53 feat(natives): add Nix syntax highlighting 2026-06-26 04:34:44 -07:00
can1357 7bd326e6f4 fix(pi-shell): resolved find -exec paths against shell working directory
- Ensure `-exec` commands run in the shell current working directory rather than the host process CWD.
- Update operand path resolution in `find` matchers to use the display path, matching behavior expected by shell-integrated utilities.
- Add an integration test to verify path substitution and execution context for shell-integrated `find`.
2026-06-26 12:04:12 +02:00
can1357 ff759ed850 chore: bump version to 16.1.22 2026-06-26 09:19:53 +02:00
can1357 018a9638c0 chore: bump version to 16.1.21 2026-06-26 07:39:22 +02:00
can1357 0fc6d136c3 chore: bump version to 16.1.20 2026-06-25 22:45:00 +02:00
can1357 451af61280 chore: bump version to 16.1.19 2026-06-25 13:14:44 +02:00
can1357 1a89d784e7 chore: bump version to 16.1.18 2026-06-25 05:17:47 +02:00
can1357 8d60776a6f chore: bump version to 16.1.17 2026-06-24 21:11:31 +02:00
changhee.an 82ef6c0a04 feat(tui): runtime Hangul Compatibility Jamo width override + Ghostty detection
Replace the compile-time cfg!(target_os = "macos") jamo-width heuristic
with a runtime override (process-global AtomicU8 in pi-natives, mirrored in
the TS width engine) plus terminal-identity detection: Ghostty renders
Hangul Compatibility Jamo (U+3131..U+318E) at 2 cells, so it is forced wide;
every other terminal keeps the platform default (macOS narrow, otherwise
UAX#11), making the override a no-op outside Ghostty.

Fixes doubled/ghosted jamo during Korean IME composition on Ghostty, where
the hardware cursor landed inside the typed text and the IME candidate window
drifted from the glyph. The width is resolved synchronously before the first
paint, so no stdin/CPR probe or async cache invalidation is needed.

A runtime DSR/CPR probe that auto-detects the width on unknown terminals is
tracked in a follow-up.
2026-06-24 10:27:17 +09:00
can1357 2c3e0d79a4 chore: bump version to 16.1.16 2026-06-23 08:22:21 +02:00
can1357 7f7a7e59db chore: bump version to 16.1.15 2026-06-22 17:47:45 +02:00