be <name> extension dispatch → bin/<name>.js
Make be run repo-local extension scripts: an unknown leading bareword resolves to bin/<name>.js, forked through the jabc runtime with the tail as args. Last dispatch fallback (never shadows a verb/projector/file). The concept is Extensions; require() between scripts already works. Method: Issues.
ticket wires the dispatch. require.cpp already ships a working sync CommonJS require(), so "scripts that require each other" needs no new code.
be_diagnose_unknown (beagle/BE.cli.c:4326) → typo suggestion → BENOCMD.
jabc (like every other sub-dog via BERun), do NOT
link JSC into be — preserves JABC's anti-bloat ethos. WITH_JS is now ON by default (CMakeLists.txt), so jabc builds and is on hand to fork.
be <name> [args] runs bin/<name>.js via BERun("jabc", ["bin/<name>.js", ...args])
when name is not a verb/projector and bin/<name>.js exists.
becli_inner BEFORE be_diagnose_unknown fires: file →
extension → typo. The script's exit code is be's exit code.
jabc (built without JSC) → a clear "extension unavailable" line,
not a crash; bin/ absent → fall through to the existing typo diagnostic.
be binary; reuse BERun. bin/ is repo-root-relative(resolve off the worktree root, not raw cwd) — a plain dir now, submodule later.
and on-disk-file branches have missed.
be <name> runs a
bin/<name>.js, forwards args, propagates exit code, and that a real verb is unaffected. Add to the BE test surface.
bin/ against the worktree root via HOME (already opened at
the top of becli_inner), so be ext works from a subdir, not just repo root.
jabc: ["bin/<name>.js", ...tail] — jabc
already exposes the tail as args / process.argv (JS-015), so the contract is free. Confirm flags before <name> vs after route correctly through CLIParse.
be get --nosub onto current trunk; debug build per CLAUDE.md.be hello a b runs bin/hello.js seeing
args == ["a","b"], exits with the script's code, and that be get etc. still dispatch natively. Red before the hook, green after.
bin/<name>.js probe + jabc fork in becli_inner before
be_diagnose_unknown; handle missing jabc / missing bin/.
beagle/js/INDEX.md (dispatch note), and the BE board..be, read by sha, classify the wt) is a
SEPARATE larger effort — extensions ship usable over io.spawn-of-be until it lands. Out of scope here.
371ad14b (2026-06-21): be <name> runs <HOME.wt>/bin/<name>.js
via be_run_extension (beagle/BE.cli.c) — forks jabc through BERun (sibling-resolved by HOMEResolveSibling, no JSC linked into be), the verbatim tail forwarded as args, the script's exit becoming be's. LAST dispatch fallback (verbs → projectors → file → bin/<name>.js → typo), so a built-in is never shadowed; original-bareword + tail snapshotted before the cwd-canonization pass so subdir invocation stays wt-rooted. WITH_JS ON by default + jabc built into ${DOG_BIN_DIR} beside be. Missing jabc (no WITH_JS) degrades to "extension unavailable". ctest be-all-02-extension-dispatch; suite 345/346 (the one fail, be-post-relpath, is pre-existing + unrelated).
process.exit) and GET-029 (be get ?/proj baseline breaks when the last wtlog row is a bare post, hit during worktree setup).