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 plan

Hosted Bridge Snapshot

Worker URL Needs deployed HTTPS URL Needs input
Secret status Not configured Needs input
Provider secrets Not configured Needs input
Support logs R2 Needs SUPPORT_LOGS bucket Needs input
Android releases R2 Needs ANDROID_RELEASES bucket Needs input
APK R2 key Needs uploaded APK object key Needs input
Bundled bridge Needs Android runtime setting Needs input
Phone self-test Failed evidence review 2026-06-16T05:27:51.911Z: surface=phone; passed=no; 7 pass / 4 warn / 0 fail; supportLogId=2026-06-16T05-27-52-391Z-dbe5c0c4-27b2-481b-998c-b09ad21ef53b. Next action: Open Android Accessibility and enable NyrA Phone Control so NyrA can tap, type, swipe, and inspect the phone when asked. Needs input

Current Internal Hosted Alpha

npm run alpha:hosted

Temporary 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.

Alpha host status HOSTED_ALPHA_READY Ready
Public test URL https://olympics-answers-defence-necklace.trycloudflare.com Temporary
Providers ready 4/4 Ready
APK proof ea425cf64d0fb71331f64ff0a8e290f19f0f5fbc51ec3518ef149a20f882d99d Ready
Support-log proof 2026-06-16T23-18-02-868Z-55b47d13-76bb-461a-9782-2d9fdf9dd94f Ready
Alpha version 0.1.0-alpha.76 (76) Ready
Token handling stored locally only Ready

Route Contract

npm run cloud:mobile-bridge:check

These 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.

RouteRuntime Use
GET /healthPublic health or compatibility route.
GET /api/nyra/statusProvider readiness and hosted bridge health for app settings.
GET /api/nyra/update/latestAndroid update metadata and hosted APK pointer.
POST /api/nyra/update/android/download-ticketShort-lived APK installer ticket for paid device-token update downloads.
GET /api/nyra/update/android/apkHosted Android APK download route for app updates.
HEAD /api/nyra/update/android/apkAPK metadata probe for phone self-tests without a full download.
POST /api/nyra/chatSwarm chat path with Captain/Crew council routing for deep requests.
POST /api/nyra/cancelCompatibility cancel acknowledgement for stateless Worker requests.
POST /api/nyra/transcribe-audioOne-shot voice fallback transcription.
POST /api/nyra/tts-audioText-to-speech audio fallback.
POST /api/nyra/realtime-client-secretRealtime voice ephemeral secret setup.
POST /api/nyra/logsRedacted support diagnostics upload and readback through R2.
GET /api/nyra/logsRedacted support diagnostics upload and readback through R2.
GET /api/nyra/logs/:idRedacted 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.

SecretStatusWhere It Belongs
NYRA_MOBILE_BRIDGE_TOKENSecret storeSet with Wrangler secrets only.
NYRA_OPENAI_API_KEYSecret storeSet with Wrangler secrets only.
NYRA_ANTHROPIC_API_KEYSecret storeSet with Wrangler secrets only.
NYRA_GEMINI_API_KEYSecret storeSet with Wrangler secrets only.
NYRA_GROK_API_KEYSecret storeSet with Wrangler secrets only.
NYRA_LICENSE_SIGNING_SECRETSecret storeSet with Wrangler secrets only.
NYRA_ANDROID_DOWNLOAD_TICKET_SECRETSecret storeSet with Wrangler secrets only.

Bootstrap Plan

npm run cloud:mobile-bridge:bootstrap

This is the executable path from local/tunnel phone testing to a durable HTTPS Worker with R2-hosted APK updates and support-log readback.

Bootstrap status MOBILE_BRIDGE_BOOTSTRAP_PLANNED Planned
Dry run True Dry run only
Deploy skipped True Skipped
Worker URL https://bridge.porterlabz.com Planned
APK key alpha/0.1.0-alpha.72/NyrA.apk Planned
Post-Deploy Verification Full deploy required Needs input
APK SHA 23703547952c5ffb501e527cd15c88bea7cab189607764831d87480010d2ecee Ready
StepCommandNote
check-routesnpm.cmd run cloud:mobile-bridge:checkRun from npm before deploy.
whoamiC:\Program Files\nodejs\node.exe G:\My Drive\AI Stuff\desktop-buddy\node_modules\wrangler\bin\wrangler.js whoamiConfirms Cloudflare auth.
create-support-r2C:\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-r2C:\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-apkC:\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

Health

Providers

No-Go Boundary

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

Non-Secret Config

Worker Config

Command Center State

Post-Deploy Verification

Step Status

Secret Status

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

  1. Create or confirm the Cloudflare account and route for the hosted bridge, for example https://bridge.porterlabz.com.
  2. Run the bootstrap dry run and inspect docs/launch_command_center/MOBILE_BRIDGE_CLOUD_BOOTSTRAP.md.
  3. Run the full bootstrap after Wrangler is authenticated:
npm run cloud:mobile-bridge:bootstrap -- --worker-url=https://bridge.porterlabz.com --write-state
  1. 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-state is passed.
  2. 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.
  3. If secrets already exist in Cloudflare, use --skip-secrets and set only missing secrets manually.
  4. Replace the production bucket_name values only if the deployed bucket names differ.
  5. Save the deployed bridge URL in the command center and in Android build/runtime settings.
  6. 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 the ANDROID_RELEASES R2 bucket when NYRA_ANDROID_UPDATE_APK_R2_KEY is set, or redirects to an absolute NYRA_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/logs and GET /api/nyra/logs/:id: authenticated support-log listing/readback for Codex debugging.

No-Go Rules

  • Do not deploy with ALLOW_DEV_OPEN_API=true in 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.jsonc has nodejs_compat, observability, production ALLOWED_ORIGIN, and the SUPPORT_LOGS R2 binding.
  • ALLOW_DEV_OPEN_API is false in production.
  • NYRA_MOBILE_BRIDGE_TOKEN is set through Wrangler secrets.
  • NYRA_LICENSE_SIGNING_SECRET matches the billing worker so paid device access tokens can authenticate to the bridge.
  • NYRA_ANDROID_DOWNLOAD_TICKET_SECRET is 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_RELEASES R2 bucket with NYRA_ANDROID_UPDATE_APK_R2_KEY, or NYRA_ANDROID_UPDATE_APK_URL is 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 /health returns service: nyra-mobile-bridge-api.
  • GET /api/nyra/status rejects missing tokens.
  • GET /api/nyra/status with X-NyrA-Bridge-Token shows provider readiness without returning secret values.
  • GET /api/nyra/status with a signed paid device access token succeeds without X-NyrA-Bridge-Token.
  • POST /api/nyra/chat returns text and provider/model route metadata.
  • GET /api/nyra/update/latest returns the alpha version, version code, SHA, and APK route or absolute APK URL.
  • POST /api/nyra/update/android/download-ticket returns a short-lived APK URL for Android installer handoff.
  • GET /api/nyra/update/android/apk downloads an APK or redirects to the configured absolute APK URL.
  • HEAD /api/nyra/update/android/apk returns APK content metadata for phone self-tests without a full download.
  • POST /api/nyra/logs, GET /api/nyra/logs, and GET /api/nyra/logs/:id round-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"
        }
      ]
    }
  }
}