Repository navigation
Local runtime for agent v2 and signed app packages - #2
Merged
Merged
Conversation
… 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
Contributor
Deploying with
|
| 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
…uired) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01VUxfdFFUkL7SmAEUvUzspy
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Frontend half of the local-first board architecture (contract:
docs/architecture.mdin LensBridge/agent, sections 7 and 15).Changes
src/runtime.js: detectslocal(served by the agent at 127.0.0.1:8080,?runtime=local, or v1?mode=offline) vshosted(Cloudflare). Hosted behaviour is unchanged./api/local/status, in-place refresh on SSE/api/local/events(contentrefetches,appreloads), no backend WebSocket, 10 min payload poll and 1 min status poll as backstops.http://10.77.0.1/.scripts/package-mbu.mjs: dependency-free packer that builds a signedmusallahboard-app-<version>.mbuplusapp-channel.json(key fromMB_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.mbpack verify).🤖 Generated with Claude Code
https://claude.ai/code/session_01VUxfdFFUkL7SmAEUvUzspy
Generated by Claude Code