Mobile Runtime
Cloud Mobile Bridge
Hosted NyrA bridge for Android/browser swarm chat, voice setup, support logs, and updates. Source folder: cloud/mobile-bridge-worker.
Mobile Bridge Handoff Form
Cloud planHosted Bridge Snapshot
Current Internal Hosted Alpha
npm run alpha:hostedTemporary phone-testing host. This proves Android can reach the swarm bridge and download the current APK, but it is not the permanent paid-beta Worker.
Route Contract
npm run cloud:mobile-bridge:checkThese routes mirror the local mobile bridge so Android can switch from tunnel/local PC to a stable HTTPS Worker URL without app-side route changes.
| Route | Runtime Use |
|---|---|
GET /health | Public health or compatibility route. |
GET /api/nyra/status | Provider readiness and hosted bridge health for app settings. |
GET /api/nyra/update/latest | Android update metadata and hosted APK pointer. |
POST /api/nyra/update/android/download-ticket | Short-lived APK installer ticket for paid device-token update downloads. |
GET /api/nyra/update/android/apk | Hosted Android APK download route for app updates. |
HEAD /api/nyra/update/android/apk | APK metadata probe for phone self-tests without a full download. |
POST /api/nyra/chat | Swarm chat path with Captain/Crew council routing for deep requests. |
POST /api/nyra/cancel | Compatibility cancel acknowledgement for stateless Worker requests. |
POST /api/nyra/transcribe-audio | One-shot voice fallback transcription. |
POST /api/nyra/tts-audio | Text-to-speech audio fallback. |
POST /api/nyra/realtime-client-secret | Realtime voice ephemeral secret setup. |
POST /api/nyra/logs | Redacted support diagnostics upload and readback through R2. |
GET /api/nyra/logs | Redacted support diagnostics upload and readback through R2. |
GET /api/nyra/logs/:id | Redacted support diagnostics upload and readback through R2. |
Secret Store Requirements
Never paste raw API keys or bridge tokens into dashboard fields. Save status here, set real values with Wrangler or Cloudflare dashboard secrets.
| Secret | Status | Where It Belongs |
|---|---|---|
NYRA_MOBILE_BRIDGE_TOKEN | Secret store | Set with Wrangler secrets only. |
NYRA_OPENAI_API_KEY | Secret store | Set with Wrangler secrets only. |
NYRA_ANTHROPIC_API_KEY | Secret store | Set with Wrangler secrets only. |
NYRA_GEMINI_API_KEY | Secret store | Set with Wrangler secrets only. |
NYRA_GROK_API_KEY | Secret store | Set with Wrangler secrets only. |
NYRA_LICENSE_SIGNING_SECRET | Secret store | Set with Wrangler secrets only. |
NYRA_ANDROID_DOWNLOAD_TICKET_SECRET | Secret store | Set with Wrangler secrets only. |
Bootstrap Plan
npm run cloud:mobile-bridge:bootstrapThis is the executable path from local/tunnel phone testing to a durable HTTPS Worker with R2-hosted APK updates and support-log readback.
| Step | Command | Note |
|---|---|---|
| check-routes | npm.cmd run cloud:mobile-bridge:check | Run from npm before deploy. |
| whoami | C:\Program Files\nodejs\node.exe G:\My Drive\AI Stuff\desktop-buddy\node_modules\wrangler\bin\wrangler.js whoami | Confirms Cloudflare auth. |
| create-support-r2 | C:\Program Files\nodejs\node.exe G:\My Drive\AI Stuff\desktop-buddy\node_modules\wrangler\bin\wrangler.js r2 bucket create nyra-mobile-support-logs | |
| create-android-r2 | C:\Program Files\nodejs\node.exe G:\My Drive\AI Stuff\desktop-buddy\node_modules\wrangler\bin\wrangler.js r2 bucket create nyra-android-releases | |
| upload-apk | C:\Program Files\nodejs\node.exe G:\My Drive\AI Stuff\desktop-buddy\node_modules\wrangler\bin\wrangler.js r2 object put nyra-android-releases/alpha/0.1.0-alpha.72/NyrA.apk --file G:\My Drive\AI Stuff\desktop-buddy\release\current\android\NyrA.apk --remote |
Hosted Alpha Report
Hosted Alpha Status
Status: HOSTED_ALPHA_READY
Generated: 2026-06-16T23:18:03.234Z
This is the temporary internal phone-testing host for NyrA Android alpha. It is not the paid-beta production bridge. It should be replaced by bridge.porterlabz.com through cloud/mobile-bridge-worker before any customer launch.
Current Public Test URL
- Public URL:
https://olympics-answers-defence-necklace.trycloudflare.com - Bridge token: stored locally at
.runtime-logs/hosted-alpha-bridge-token.txt; not written to this report. - Download token: stored locally at
.runtime-logs/hosted-alpha-download-token.txt; not written to this report. - Version: 0.1.0-alpha.76 (76)
- APK SHA256:
ea425cf64d0fb71331f64ff0a8e290f19f0f5fbc51ec3518ef149a20f882d99d
Health
- Local bridge: reused
- Local proxy: reused
- Cloudflared tunnel: reused
- Providers ready: 4/4
- Update manifest proof: usable by phone (https://olympics-answers-defence-necklace.trycloudflare.com/api/nyra/update/android/apk)
- APK download proof: matches manifest (3395422 bytes)
- Chat proof: gemini / gemini-2.5-flash - Hello! NyrA is online and ready for the alpha smoke test.
- Support-log proof: upload/list/readback passed; log id
2026-06-16T23-18-02-868Z-55b47d13-76bb-461a-9782-2d9fdf9dd94f; server path hidden=yes
Providers
- OpenAI: ready (gpt-5.2)
- Anthropic: ready (claude-sonnet-4-6)
- Gemini: ready (gemini-2.5-flash)
- Grok/xAI: ready (grok-4.3)
No-Go Boundary
- Temporary
trycloudflare.comURLs are internal alpha only. - Bundled shared alpha tokens are internal alpha only.
- Paid beta still requires the durable Worker, R2 APK hosting, secret store, support-log readback, signed/trusted installer path, and deployability preflight clearance.
Bootstrap Report
Mobile Bridge Cloud Bootstrap
Status: MOBILE_BRIDGE_BOOTSTRAP_PLANNED
Generated: 2026-06-15T02:12:00.955Z
This prepares the durable Cloudflare Worker bridge that replaces the temporary trycloudflare tunnel for Android chat, updates, support logs, and phone self-tests.
APK
- Version: 0.1.0-alpha.72 (72)
- R2 key:
alpha/0.1.0-alpha.72/NyrA.apk - SHA256:
23703547952c5ffb501e527cd15c88bea7cab189607764831d87480010d2ecee
Non-Secret Config
- Allowed origin:
https://porterlabz.com - Support logs bucket:
nyra-mobile-support-logs - Android releases bucket:
nyra-android-releases - Env files loaded for secret upload: 3 (
server/.env.local,C:\Users\porte\OneDrive\Desktop\Projects\Commander IDE\.env,C:\Users\porte\OneDrive\Desktop\Projects\Web IDE\.env)
Worker Config
- planned:
cloud/mobile-bridge-worker/wrangler.jsonc- Dry run only; Wrangler config was not written.
Command Center State
- skipped: Dry run cannot write deployment facts into command-center state.
Post-Deploy Verification
- not verified: dry run, deploy skipped, or Worker URL unavailable.
Step Status
- planned:
npm.cmd run cloud:mobile-bridge:check - planned:
C:\Program Files\nodejs\node.exe G:\My Drive\AI Stuff\desktop-buddy\node_modules\wrangler\bin\wrangler.js whoami - planned:
C:\Program Files\nodejs\node.exe G:\My Drive\AI Stuff\desktop-buddy\node_modules\wrangler\bin\wrangler.js r2 bucket create nyra-mobile-support-logs - planned:
C:\Program Files\nodejs\node.exe G:\My Drive\AI Stuff\desktop-buddy\node_modules\wrangler\bin\wrangler.js r2 bucket create nyra-android-releases - planned:
C:\Program Files\nodejs\node.exe G:\My Drive\AI Stuff\desktop-buddy\node_modules\wrangler\bin\wrangler.js r2 object put nyra-android-releases/alpha/0.1.0-alpha.72/NyrA.apk --file G:\My Drive\AI Stuff\desktop-buddy\release\current\android\NyrA.apk --remote
Secret Status
- Secret upload skipped, dry-run only, or failed before secret upload.
No-Secret Rule
Raw bridge/provider secrets are only read from process environment or approved local env files, then sent to Wrangler stdin. They are not written to reports, dashboard state, configs, or source files.
README
NyrA Mobile Bridge Worker
This Worker is the durable hosted replacement for the temporary local/tunnel mobile bridge. It exposes the same /api/nyra/* route contract already used by the Android and browser surfaces, so phones can keep using NyrA chat, provider status, app updates, realtime setup, audio fallback, and support-log upload after the development PC is offline.
Local Checks
npm run cloud:mobile-bridge:check
npm run test:cloud-mobile-bridge
npm run cloud:mobile-bridge:bootstrap -- --dry-run --skip-secrets --skip-deploy
Deploy Path
- Create or confirm the Cloudflare account and route for the hosted bridge, for example
https://bridge.porterlabz.com. - Run the bootstrap dry run and inspect
docs/launch_command_center/MOBILE_BRIDGE_CLOUD_BOOTSTRAP.md. - Run the full bootstrap after Wrangler is authenticated:
npm run cloud:mobile-bridge:bootstrap -- --worker-url=https://bridge.porterlabz.com --write-state
- Only the full bootstrap can update command-center deployment facts. Dry runs never write stable bridge values into
command-center-state.json, even if--write-stateis passed. - A full bootstrap runs post-deploy verification before writing state:
/health, authenticated status, update metadata, APK HEAD, support-log upload/list/readback, and a live chat smoke must pass. - If secrets already exist in Cloudflare, use
--skip-secretsand set only missing secrets manually. - Replace the production
bucket_namevalues only if the deployed bucket names differ. - Save the deployed bridge URL in the command center and in Android build/runtime settings.
- Run a phone self-test from Settings > Updates > Bridge self-test.
The bootstrap creates the support-log and Android-release R2 buckets when needed, uploads the current signed APK to R2, writes non-secret Worker vars for the current APK SHA/version, and can deploy the Worker. It never writes raw bridge/provider secrets to reports, dashboard state, configs, or source files.
Secret Setup
npx wrangler secret put NYRA_MOBILE_BRIDGE_TOKEN --cwd cloud/mobile-bridge-worker --env production
npx wrangler secret put NYRA_OPENAI_API_KEY --cwd cloud/mobile-bridge-worker --env production
npx wrangler secret put NYRA_ANTHROPIC_API_KEY --cwd cloud/mobile-bridge-worker --env production
npx wrangler secret put NYRA_GEMINI_API_KEY --cwd cloud/mobile-bridge-worker --env production
npx wrangler secret put NYRA_GROK_API_KEY --cwd cloud/mobile-bridge-worker --env production
npx wrangler secret put NYRA_LICENSE_SIGNING_SECRET --cwd cloud/mobile-bridge-worker --env production
npx wrangler secret put NYRA_ANDROID_DOWNLOAD_TICKET_SECRET --cwd cloud/mobile-bridge-worker --env production
Routes
GET /health: public structural health check with storage/auth configuration only.GET /api/nyra/status: authenticated provider readiness and hosted bridge status.GET /api/nyra/update/latest: authenticated Android update metadata.POST /api/nyra/update/android/download-ticket: authenticated short-lived Android APK download ticket for paid/device-token installs.GET /api/nyra/update/android/apk: authenticated Android APK download. Streams from theANDROID_RELEASESR2 bucket whenNYRA_ANDROID_UPDATE_APK_R2_KEYis set, or redirects to an absoluteNYRA_ANDROID_UPDATE_APK_URL.HEAD /api/nyra/update/android/apk: authenticated APK metadata probe for phone self-tests without downloading the APK.POST /api/nyra/chat: authenticated swarm chat with Captain/Crew council routing for deeper prompts.POST /api/nyra/cancel: compatibility route. Hosted Workers are stateless per request, so this acknowledges but cannot cancel a completed fetch after the HTTP request is gone.POST /api/nyra/transcribe-audio: authenticated OpenAI transcription fallback.POST /api/nyra/tts-audio: authenticated OpenAI text-to-speech fallback.POST /api/nyra/realtime-client-secret: authenticated OpenAI realtime ephemeral secret setup.POST /api/nyra/logs: authenticated redacted support diagnostics upload to R2.GET /api/nyra/logsandGET /api/nyra/logs/:id: authenticated support-log listing/readback for Codex debugging.
No-Go Rules
- Do not deploy with
ALLOW_DEV_OPEN_API=truein production. - Do not ship a production Android build with a shared bridge token as customer authentication. Paid/customer builds must use the billing device access token plus short-lived APK download tickets.
- Do not store raw chats, API keys, card data, passwords, screenshots, or unrestricted transcripts in support logs.
- Do not claim phone/computer control is production-ready until Android accessibility, screen capture, and high-impact consent gates pass on the final build.
Deployment Checklist
NyrA Mobile Bridge Deployment Checklist
Preflight
cloud/mobile-bridge-worker/wrangler.jsonchasnodejs_compat, observability, productionALLOWED_ORIGIN, and theSUPPORT_LOGSR2 binding.ALLOW_DEV_OPEN_APIisfalsein production.NYRA_MOBILE_BRIDGE_TOKENis set through Wrangler secrets.NYRA_LICENSE_SIGNING_SECRETmatches the billing worker so paid device access tokens can authenticate to the bridge.NYRA_ANDROID_DOWNLOAD_TICKET_SECRETis set through Wrangler secrets for short-lived APK installer links.- Provider secrets are set through Wrangler secrets: OpenAI, Anthropic, Gemini, and Grok/xAI.
- Android update metadata vars are set if this Worker is the hosted update source.
- The Android APK is either uploaded to the
ANDROID_RELEASESR2 bucket withNYRA_ANDROID_UPDATE_APK_R2_KEY, orNYRA_ANDROID_UPDATE_APK_URLis an absolute external HTTPS URL.
Commands
npm run cloud:mobile-bridge:bootstrap -- --dry-run --skip-secrets --skip-deploy
npm run cloud:mobile-bridge:check
npx wrangler r2 bucket create nyra-mobile-support-logs
npx wrangler r2 bucket create nyra-android-releases
npx wrangler secret put NYRA_MOBILE_BRIDGE_TOKEN --cwd cloud/mobile-bridge-worker --env production
npx wrangler secret put NYRA_OPENAI_API_KEY --cwd cloud/mobile-bridge-worker --env production
npx wrangler secret put NYRA_ANTHROPIC_API_KEY --cwd cloud/mobile-bridge-worker --env production
npx wrangler secret put NYRA_GEMINI_API_KEY --cwd cloud/mobile-bridge-worker --env production
npx wrangler secret put NYRA_GROK_API_KEY --cwd cloud/mobile-bridge-worker --env production
npx wrangler secret put NYRA_LICENSE_SIGNING_SECRET --cwd cloud/mobile-bridge-worker --env production
npx wrangler secret put NYRA_ANDROID_DOWNLOAD_TICKET_SECRET --cwd cloud/mobile-bridge-worker --env production
npm run cloud:mobile-bridge:deploy
After Cloudflare authentication is working and secrets are available in environment variables, the preferred one-command path is:
npm run cloud:mobile-bridge:bootstrap -- --worker-url=https://bridge.porterlabz.com --write-state
Use --skip-secrets only when the Cloudflare Worker secrets have already been set manually. The bootstrap report is written to docs/launch_command_center/MOBILE_BRIDGE_CLOUD_BOOTSTRAP.md and docs/launch_command_center/mobile-bridge-cloud-bootstrap.json.
Dry runs are plan-only and cannot write deployment facts into docs/launch_command_center/command-center-state.json, even when --write-state is passed.
Full bootstrap state writes require post-deploy verification: /health, authenticated status, update manifest, APK HEAD, support-log roundtrip, and chat smoke.
Post-Deploy Verification
GET /healthreturnsservice: nyra-mobile-bridge-api.GET /api/nyra/statusrejects missing tokens.GET /api/nyra/statuswithX-NyrA-Bridge-Tokenshows provider readiness without returning secret values.GET /api/nyra/statuswith a signed paid device access token succeeds withoutX-NyrA-Bridge-Token.POST /api/nyra/chatreturns text andprovider/modelroute metadata.GET /api/nyra/update/latestreturns the alpha version, version code, SHA, and APK route or absolute APK URL.POST /api/nyra/update/android/download-ticketreturns a short-lived APK URL for Android installer handoff.GET /api/nyra/update/android/apkdownloads an APK or redirects to the configured absolute APK URL.HEAD /api/nyra/update/android/apkreturns APK content metadata for phone self-tests without a full download.POST /api/nyra/logs,GET /api/nyra/logs, andGET /api/nyra/logs/:idround-trip a redacted diagnostics bundle through R2.- Android Settings > Updates bridge self-test reaches the deployed URL.
Wrangler Config
{
"$schema": "../../node_modules/wrangler/config-schema.json",
"name": "nyra-mobile-bridge-api",
"main": "src/index.mjs",
"compatibility_date": "2026-06-09",
"compatibility_flags": [
"nodejs_compat"
],
"observability": {
"enabled": true
},
"vars": {
"ALLOWED_ORIGIN": "http://localhost:5173",
"ALLOW_DEV_OPEN_API": "false",
"NYRA_ANDROID_UPDATE_CHANNEL": "alpha"
},
"r2_buckets": [
{
"binding": "SUPPORT_LOGS",
"bucket_name": "nyra-mobile-support-logs"
},
{
"binding": "ANDROID_RELEASES",
"bucket_name": "nyra-android-releases"
}
],
"env": {
"local": {
"vars": {
"ALLOWED_ORIGIN": "http://localhost:5173",
"ALLOW_DEV_OPEN_API": "true",
"NYRA_ANDROID_UPDATE_CHANNEL": "alpha"
},
"r2_buckets": [
{
"binding": "SUPPORT_LOGS",
"bucket_name": "nyra-mobile-support-logs"
},
{
"binding": "ANDROID_RELEASES",
"bucket_name": "nyra-android-releases"
}
]
},
"production": {
"vars": {
"ALLOWED_ORIGIN": "https://porterlabz.com",
"ALLOW_DEV_OPEN_API": "false",
"NYRA_ANDROID_UPDATE_CHANNEL": "alpha",
"NYRA_ANDROID_UPDATE_VERSION": "0.1.0-alpha.76",
"NYRA_ANDROID_UPDATE_VERSION_CODE": "76",
"NYRA_ANDROID_UPDATE_APK_R2_KEY": "alpha/0.1.0-alpha.76/NyrA.apk",
"NYRA_ANDROID_UPDATE_APK_FILENAME": "NyrA.apk",
"NYRA_ANDROID_UPDATE_SHA256": "ea425cf64d0fb71331f64ff0a8e290f19f0f5fbc51ec3518ef149a20f882d99d",
"NYRA_ANDROID_UPDATE_NOTES": "Builds the current Android app code as an installable alpha release APK.|Current alpha signing material is stored outside the repo under the Windows user profile.|Internal alpha APKs can include the hosted mobile bridge URL and token from local runtime handoff files so remote phones connect without manual bridge setup.|If a phone has an older NyrA APK signed by a different certificate, Android requires uninstalling that build before installing this signer lineage."
},
"r2_buckets": [
{
"binding": "SUPPORT_LOGS",
"bucket_name": "nyra-mobile-support-logs"
},
{
"binding": "ANDROID_RELEASES",
"bucket_name": "nyra-android-releases"
}
]
}
}
}