Commit Graph

3 Commits

Author SHA1 Message Date
CharlesKWON
76853d4beb feat(rtl): nodebridge decodes JS arrays/objects to native PRG values
jsValToValue now recursively converts JS arrays/objects (the "json" wire
type) into native hbrt arrays/hashes, so PRG can Len()/index/hb_HGetDef the
results of npm methods (e.g. os.cpus()[1]:model). Strings/numbers/booleans/
buffers unchanged.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-15 21:42:00 +09:00
CharlesKWON
1e80c89414 feat(rtl): nodebridge object dispatch — oMod:method() like Node/TFNModule
FN_REQUIRE now returns a module OBJECT; PRG calls npm methods directly
(oQR:toString(args), oQR:__end__()) exactly like Node and the C++ fivenode
TFNModule. At require, the bridge enumerates the module's method names and
registers each as a class method whose closure proxies the call to the
persistent node sidecar (Promise auto-awaited). Native PRG args → JS;
results string/number/boolean/buffer/json. Pure Go glue, no C/CGO.
Replaces the FN_CALL(handle,...) functional API.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-15 21:31:29 +09:00
CharlesKWON
00b4835a53 feat(rtl): nodebridge — handle-based Node module bridge in pure Go
Faithful Go port of the C++ fivenode Require() mechanism: persistent node
sidecar + JSON handle protocol (require→handle, call→method with auto-await
Promise, end), driven by pure-Go glue (os/exec + stdio). No C/CGO, not
`node -e` string eval. NODE_PATH points at the app's node_modules.
PRG: FN_REQUIRE / FN_CALL / FN_END / FN_LASTERROR.

Replaces the earlier nodertl (NODE_EVAL string-eval), removed.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-15 19:04:09 +09:00