Commit Graph
2 Commits
Author SHA1 Message Date
james.maes 23aa5c74f8 fix(02): sync canonical webview/bus-harness.html to match 02-03's bundle copy
02-02 initially wrote an import-based harness (dynamic import from
./packages/bus/dist/index.js). 02-03 replaced the bundle copy with an
injection-based harness (relies on the WKUserScript document-start
Injection.js to set up window.jarvisBus before any inline script runs).

The injection-based approach is architecturally correct per RESEARCH.md
§handshake — it lets the native side inject the bridge before any web
code runs, and removes the compile-time dependency on the dist/
bundle layout.

Syncing canonical to match so check-bus-harness-parity.sh passes.
2026-04-23 18:12:17 -05:00
james.maes c21df441fd feat(02-02): implement window.jarvisBus glue + bus-harness.html
- installJarvisBus() wires receive/send/onOutbound around decode pipeline
- receive() routes to handler if set; auto-acks hello when unset so the
  minimal harness completes the handshake without page-side code
- send() is the ONLY surface that calls webkit.messageHandlers.jarvisBus
- Missing-webkit surfaces a helpful Error instead of a TypeError
- bus-harness.html is the static stub Plan 03's loadFileURL targets;
  imports compiled ./packages/bus/dist/index.js, calls installJarvisBus
- index.ts now re-exports protocol + bridge
- 7 bridge tests green; 28 total vitest assertions; tsc --strict clean
2026-04-23 17:20:58 -05:00