Skip to content

Local runtime for agent v2 and signed app packages - #2

Merged
IbraTech04 merged 5 commits into
developfrom
claude/awesome-turing-bdgpfd
Sep 25, 2026
Merged

IbraTech04 merged 5 commits into
developfrom
claude/awesome-turing-bdgpfd

Conversation

@IbraTech04

Copy link
Copy Markdown
Collaborator

Frontend half of the local-first board architecture (contract: docs/architecture.md in LensBridge/agent, sections 7 and 15).

Changes

  • src/runtime.js: detects local (served by the agent at 127.0.0.1:8080, ?runtime=local, or v1 ?mode=offline) vs hosted (Cloudflare). Hosted behaviour is unchanged.
  • Local runtime: device id from /api/local/status, in-place refresh on SSE /api/local/events (content refetches, app reloads), no backend WebSocket, 10 min payload poll and 1 min status poll as backstops.
  • "Waiting for content" screen explaining sync state, or how to update by USB stick or at http://10.77.0.1/.
  • Stale-content note and diagnostics now show app/agent versions, content source and sync status.
  • scripts/package-mbu.mjs: dependency-free packer that builds a signed musallahboard-app-<version>.mbu plus app-channel.json (key from MB_RELEASE_SIGNING_KEY). npm run package.
  • .github/workflows/release.yml: on a tag, tests, packages and uploads the signed app to the GitHub release.

Testing

  • npm test (88 tests, including the cross-language key-id vector), npm run typecheck, npx vite build.
  • A package built by the Node packer verifies with the agent's Go verifier (mbpack verify).
  • Local runtime rendered in jsdom; not yet on a real board.

🤖 Generated with Claude Code

https://claude.ai/code/session_01VUxfdFFUkL7SmAEUvUzspy


Generated by Claude Code

… signed app releases

The page now decides once at startup whether it is served by the device agent
(local runtime: 127.0.0.1:8080, localhost:8080, ?runtime=local or v1's
?mode=offline) or is the hosted Cloudflare site, per the agent's
docs/architecture.md section 15.

Local runtime: same-origin API, device id from /api/local/status instead of
the cookie, /api/local/events (content -> re-fetch in place, app -> reload),
no backend refresh socket, status polled every minute, and a full-screen
"Waiting for content" screen when the agent has no content installed that
says whether it is downloading from LensBridge or needs a USB stick / laptop
on the service port. The staleness note and diagnostics read the v2 status
(content, sync, agent/app versions) and still accept v1's bundle fields.
The build embeds its own version (package.json via Vite define), shown in
diagnostics and returned by window.MusallahBoard.getStatus() with runtime.

Hosted runtime is unchanged.

scripts/package-mbu.mjs is a dependency-free packer that writes a signed
format-2 `app` .mbu (own zip writer, Ed25519 over the domain-prefixed
mbu.json) and app-channel.json; `npm run package` builds and packs, and
.github/workflows/release.yml publishes both on v* tags.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VUxfdFFUkL7SmAEUvUzspy
@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Sep 24, 2026 •

Copy link
Copy Markdown
Contributor

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Updated (UTC)
❌ Deployment failed
View logs
musallahboard c16844f Sep 25 2026, 12:27 AM

… deploy

The backend's live payload endpoint is being retired, so the app now only
ever runs served by the device agent at 127.0.0.1:8080.

- Remove the local/hosted runtime split (src/runtime.js); APP_VERSION moves
  to src/version.js.
- Remove the cookie / ?deviceId= identity flow, the unpaired "Waiting for
  device enrollment" screen, the SetupModal device id override, and the
  setDeviceId / getConfig / __refreshBoard hooks. The device id comes from
  /api/local/status only; hideCursor stays a cookie.
- Remove the backend refresh WebSocket (src/api/refreshSocket.js) and the
  openapi-fetch client (src/api/client.js, VITE_API_BASE_URL). The payload
  is a plain same-origin fetch of the agent's /api/musallah/payload, typed
  with the generated MusallahBoardPayload schema component.
- Remove the Cloudflare deployment: wrangler.jsonc, @cloudflare/vite-plugin,
  wrangler, the deploy script, and the packer's dist/client and
  .assetsignore / wrangler.json special cases. The build is plain dist/.
- npm run dev proxies /api (including SSE) and /media to VITE_DEV_AGENT,
  default http://127.0.0.1:8080, for use with ssh -L to a real board.
- README documents the dev workflow; PLAN.md is marked superseded.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VUxfdFFUkL7SmAEUvUzspy
…ed, weather endpoint added)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VUxfdFFUkL7SmAEUvUzspy
Nothing ran the v1 agent, so the status helpers that also accepted its
bundle/generatedAt names are gone.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VUxfdFFUkL7SmAEUvUzspy
@IbraTech04
IbraTech04 merged commit 4f2878c into develop Sep 25, 2026
1 of 3 checks passed
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.

2 participants