Skip to content

runtime: portable device runtime for Axis Browser Direct#30

Merged
sKuhLight merged 2 commits into
mainfrom
break-free
Jul 3, 2026
Merged

runtime: portable device runtime for Axis Browser Direct#30
sKuhLight merged 2 commits into
mainfrom
break-free

Conversation

@sKuhLight

Copy link
Copy Markdown
Owner

Extract everything a browser needs to run ForgeFX in-page (Axis Browser Direct) while keeping the Fastify HTTP API byte-compatible:

  • Registry core splitdrivers/registryCore.ts holds DeviceRegistry + createRegistry(deps) with all Node transport behavior injected (RegistryDeps); drivers/registry.ts stays the singleton wiring over the real serial/MIDI/connection modules
  • Storage backendsstore.ts becomes backend-agnostic policy (createStore(backend, codec)); the fs backend is byte-identical to the classic ~/.axis layout; in-memory backend for tests/browser mirrors
  • Local folder — the Presets//Sync/ logic runs over an async FolderAdapter with relative-path traversal guards; localStore.ts is thin Fastify glue
  • Runtime routerruntime/router.ts: dependency-injected (method, path, body) dispatcher covering the full Axis endpoint inventory; events via subscribe() instead of SSE; shared handler bodies (runtime/handlers.ts) keep both surfaces identical
  • Cloud — parameterized createCloud(cfg, store) (supabase-js is isomorphic); env-bound server singleton unchanged
  • Packaging — new forgefx-server/runtime subpath export; scripts/check-browser-safe.ts (esbuild platform:'browser') chained into npm test
  • Parity suitetest/api/router.test.ts: 54 app↔router twins over one fake-FM3 registry (byte-parity on bodies, incl. version .syx and /local/* over a temp root)

All 9 suites green; server 0.5.0-beta. Requires forgefx-midi ≥ 0.2.0 (merged: sKuhLight/forgefx-midi#1).

Known intentional divergence: POST /remote/enable answers 503 in the router — a browser tab is never the Realtime relay host.

sKuhLight added 2 commits July 3, 2026 19:47
…age backends, browser router

Extract everything a browser needs to run ForgeFX in-page (Axis Browser
Direct) while keeping the Fastify HTTP API byte-compatible:

- drivers/registryCore.ts: DeviceRegistry + createRegistry(deps) with all
  Node transport behavior injected via RegistryDeps; drivers/registry.ts
  stays the singleton wiring with the real serial/MIDI/connection deps
- runtime/storeBackend.ts + fsStoreBackend.ts + memStoreBackend.ts:
  store.ts becomes backend-agnostic policy (createStore(backend, codec));
  fs backend is byte-identical to the classic ~/.axis layout
- runtime/folderAdapter.ts + fsFolderAdapter.ts + localFolder.ts +
  localService.ts: local storage folder logic over an async adapter with
  relative-path traversal guards; localStore.ts is thin Fastify glue
- runtime/handlers.ts + services.ts: app.ts handler bodies shared between
  Fastify routes and the runtime router
- runtime/cloud.ts: Cloud parameterized as createCloud(cfg, store);
  cloud.ts keeps the env-bound singleton behavior
- runtime/router.ts + index.ts: dependency-injected (method, path, body)
  dispatcher covering the full Axis endpoint inventory, events via
  subscribe() instead of SSE; exported as forgefx-server/runtime
- test/api/router.test.ts: 54 app↔router parity twins over one fake-FM3
  registry; scripts/check-browser-safe.ts (esbuild platform:browser)
  chained into npm test
@sKuhLight sKuhLight merged commit 5d0dcc7 into main Jul 3, 2026
2 checks passed
@sKuhLight sKuhLight deleted the break-free branch July 3, 2026 18:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant