singularity-forge/packages
Tom Boucher 97d589c200 fix: graceful fallback when native addon is unavailable on unsupported platforms (#1225)
* fix: graceful fallback when native addon is unavailable on unsupported platforms

On platforms without a pre-built native binary (e.g., win32-arm64),
the native loader threw at import time, crashing the entire application.

Now returns a Proxy object that:
- Allows the import to succeed (no startup crash)
- Throws per-function when a native function is actually called
- Individual consumers (GSD parser bridge, fuzzy find, autocomplete)
  already wrap native calls in try/catch and fall back to JS
  implementations

Also exports nativeAvailable boolean for consumers that want to check
upfront. Prints a one-line warning to stderr on startup.

GSD is now fully functional on unsupported platforms — just slower for
file parsing, grep, and fuzzy search.

Fixes #1223

* fix: remove __nativeUnavailable from exported type to fix TS2352 cast errors

The __nativeUnavailable boolean property on the native type caused
TS2352 errors in consumers that cast native as Record<string, Function>
(ast/index.ts, diff/index.ts, gsd-parser/index.ts).

Replaced with a module-level _loadedSuccessfully flag and exported
nativeAvailable boolean. The proxy no longer needs a sentinel property.
2026-03-18 13:28:01 -06:00
..
native fix: graceful fallback when native addon is unavailable on unsupported platforms (#1225) 2026-03-18 13:28:01 -06:00
pi-agent-core fix: add exports fields to pi-tui and pi-agent-core packages (#991) 2026-03-17 17:05:47 -06:00
pi-ai Fix Codex server_error handling: extraction, retry matching, escalating backoff (#1106) 2026-03-18 01:10:55 -06:00
pi-coding-agent refactor: replace MCPorter with native MCP client (#1210) 2026-03-18 12:26:16 -06:00
pi-tui feat: add searchExcludeDirs setting for @ file autocomplete blacklist (#1202) 2026-03-18 11:23:40 -06:00