{
  "calls": [
    {
      "arguments": {
        "expand": "not an array"
      },
      "kind": "wrong_type",
      "param": "expand",
      "reply": {
        "cut": false,
        "is_error": true,
        "text": "{\n  \"error\": {\n    \"code\": \"invalid_arguments\",\n    \"message\": \"expand must be an array of strings.\",\n    \"fixHint\": \"Pass expand: [\\\"schema\\\" | \\\"capabilities.full\\\" | \\\"capabilities.advanced\\\"].\",\n    \"retryable\": false\n  }\n}",
        "type": "result"
      },
      "tool": "getPlatformInfo"
    },
    {
      "arguments": {
        "from": {}
      },
      "kind": "wrong_type",
      "param": "from",
      "reply": {
        "cut": false,
        "is_error": false,
        "text": "{\n  \"from\": \"meta_dat\",\n  \"approach\": \"full_cutover\",\n  \"coexistenceNote\": \"This is a FULL-CUTOVER guide — replace your DAT calls with Extentos primitives. Running raw DAT and Extentos side-by-side in one process is NOT supported today: the Meta DeviceSession is a single-owner handle and there is no public accessor to the DAT session underneath Extentos yet. Incremental / side-by-side adoption is a roadmap item, not a current capability. Migrate an app fully, or keep it on raw DAT.\",\n  \"plan\": [\n    \"1. Scaffold the bootstrap: run generateConnectionModule (it replaces Wearables.initialize/configure + your registration UI). Choose an ExtentosConnectionPage placement when prompted.\",\n    \"2. Derive permissions: run getPermissions with your capability list and apply the manifest/Info.plist entries — then delete your hand-maintained ones.\",\n    \"3. Swap call sites per the map below, area by area. For each, drill into getCapabilityGuide(feature) for the exact Kotlin/Swift idiom and getCodeExample(pattern) for a full composition to peel from.\",\n    \"4. Convert error handling: replace try/catch / runCatching around lifecycle ops with ExtentosResult pattern-matching.\",\n    \"5. Validate: run validateIntegration (manifest / deps / permissions / bootstrap wiring), then dogfood in the browser simulator (createSimulatorSession) — no glasses needed to prove the cutover.\"\n  ],\n  \"mappings\": [\n    {\n      \"area\": \"SDK initialization\",\n      \"datSymbols\": {\n        \"android\": [\n          \"Wearables.initialize(context)\"\n        ],\n        \"ios\": [\n          \"MWDATCore.Wearables.configure()\"\n        ]\n      },\n      \"extentosCall\": \"ExtentosGlasses.create(ExtentosConfig(...)) / Extentos.create(config:)\",\n      \"extentosFeature\": null,\n      \"whatChanges\": \"Stop initializing DAT yourself — the generated bootstrap module calls Extentos.create, which owns DAT init under the hood. Don't hand-write this; run generateConnectionModule to scaffold it.\",\n      \"drill\": {\n        \"tool\": \"generateConnectionModule\",\n        \"searchDocs\": \"getting_started\"\n      }\n    },\n    {\n      \"area\": \"Registration / pairing UI\",\n      \"datSymbols\": {\n        \"android\": [\n          \"Wearables.startRegistration(activity)\",\n          \"Wearables.registrationState\",\n          \"RegistrationState\"\n        ],\n        \"ios\": [\n          \"Wearables.shared.handleUrl(url)\",\n          \"Wearables.shared registration flow\"\n        ]\n      },\n      \"extentosCall\": \"ExtentosConnectionPage + glasses.connection.state\",\n      \"extentosFeature\": \"connection_state\",\n      \"whatChanges\": \"Drop your hand-rolled registration/pairing screen. Drop `ExtentosConnectionPage` into the app (placement chosen at scaffold time) and it drives the Meta AI companion-app registration handshake for you; observe progress via glasses.connection.state.\",\n      \"drill\": {\n        \"codeExample\": \"connection_page_setup\",\n        \"searchDocs\": \"connection_ui\"\n      }\n    },\n    {\n      \"area\": \"Device session lifecycle\",\n      \"datSymbols\": {\n        \"android\": [\n          \"Wearables.createSession(selector)\",\n          \"DeviceSession\",\n          \"DeviceSessionState\",\n          \"AutoDeviceSelector\"\n        ],\n        \"ios\": [\n          \"MWDATCore.Wearables.shared.createSession\",\n          \"MWDATCore.DeviceSession\",\n          \"DeviceSessionState\"\n        ]\n      },\n      \"extentosCall\": \"glasses.connection (Auto transport) + glasses.connection.state\",\n      \"extentosFeature\": \"connection_state\",\n      \"whatChanges\": \"You no longer create or own the DeviceSession — TransportChoice.Auto resolves the transport (RealMeta on bonded hardware, sim otherwise) and owns the session lifecycle. Observe the 6-bucket GlassesState (NotRegistered → Registered → DeviceDiscovered → Connecting → Active → Disconnected) instead of raw DeviceSessionState.\",\n      \"drill\": {\n        \"searchDocs\": \"connection_state_model\"\n      }\n    },\n    {\n      \"area\": \"Device discovery / identity\",\n      \"datSymbols\": {\n        \"android\": [\n          \"Wearables.devices\",\n          \"Device\",\n          \"DeviceType\",\n          \"DeviceIdentifier\"\n        ],\n        \"ios\": [\n          \"Wearables.shared.devices\",\n          \"Device\",\n          \"DeviceType\"\n        ]\n      },\n      \"extentosCall\": \"glasses.device.type / glasses.device.vendor\",\n      \"extentosFeature\": null,\n      \"whatChanges\": \"Device enumeration + selection is internal to the transport. For identity, read glasses.device.type (RAYBAN_META, RAYBAN_DISPLAY, OAKLEY_META_HSTN, … — exactly Meta DAT 0.8.0's enum) and glasses.device.vendor. Branch on glasses.capabilities for FUNCTIONAL differences, never on the model name.\",\n      \"drill\": {\n        \"searchDocs\": \"library_api\"\n      }\n    },\n    {\n      \"area\": \"Permissions & Meta scopes\",\n      \"datSymbols\": {\n        \"android\": [\n          \"Wearables.checkPermissionStatus(...)\",\n          \"Wearables.RequestPermissionContract()\",\n          \"Permission.CAMERA\",\n          \"hand-maintained AndroidManifest entries\"\n        ],\n        \"ios\": [\n          \"hand-maintained Info.plist keys (MWDAT dict, CFBundleURLTypes, UISupportedExternalAccessoryProtocols, …)\"\n        ]\n      },\n      \"extentosCall\": \"getPermissions({ capabilities, platform })\",\n      \"extentosFeature\": null,\n      \"whatChanges\": \"Stop hand-mapping manifest entries / Info.plist keys / Meta DAT scopes. getPermissions derives the full set from your capability list; generateConnectionModule emits the Meta-DAT-specific plist dict. The connection page drives the Meta-side CAMERA consent prompt.\",\n      \"drill\": {\n        \"tool\": \"getPermissions\",\n        \"searchDocs\": \"permissions\"\n      }\n    },\n    {\n      \"area\": \"Camera — one-shot photo\",\n      \"datSymbols\": {\n        \"android\": [\n          \"PhotoData\",\n          \"Stream photo capture\",\n          \"camera StreamConfiguration\"\n        ],\n        \"ios\": [\n          \"stream.photoDataPublisher.listen { }\",\n          \"MWDATCamera photo capture\"\n        ]\n      },\n      \"extentosCall\": \"glasses.camera.capturePhoto()\",\n      \"extentosFeature\": \"capture_photo\",\n      \"whatChanges\": \"One typed suspend/async call returns a Photo (uri/width/height/format) wrapped in ExtentosResult — no publisher subscription + one-shot-listener + 10s-timeout plumbing. Photos helpers (loadBase64 / loadBitmap / copyToFile) handle the data:/file: URI split for you.\",\n      \"drill\": {\n        \"codeExample\": \"photo_describe_voice\"\n      }\n    },\n    {\n      \"area\": \"Camera — continuous frames\",\n      \"datSymbols\": {\n        \"android\": [\n          \"Stream\",\n          \"addStream\",\n          \"removeStream\",\n          \"StreamConfiguration\",\n          \"StreamState\"\n        ],\n        \"ios\": [\n          \"stream.videoFramePublisher\",\n          \"MWDATCamera.VideoFrame\",\n          \"addStream / removeStream\"\n        ]\n      },\n      \"extentosCall\": \"glasses.camera.videoFrames(...)\",\n      \"extentosFeature\": \"video_frames\",\n      \"whatChanges\": \"Subscribe to a Flow (Kotlin) / AsyncStream (Swift) of frames at the configured rate. The SDK owns the addStream/removeStream + StreamState lifecycle and backpressure; you consume frames. Use 2fps for ML, 7–15 for preview.\",\n      \"drill\": {\n        \"searchDocs\": \"library_api\"\n      }\n    },\n    {\n      \"area\": \"Camera — bounded video clip\",\n      \"datSymbols\": {\n        \"android\": [\n          \"Stream video capture\",\n          \"VideoQuality\"\n        ],\n        \"ios\": [\n          \"MWDATCamera video capture\",\n          \"VideoQuality\"\n        ]\n      },\n      \"extentosCall\": \"glasses.camera.captureVideo(...)\",\n      \"extentosFeature\": \"capture_video\",\n      \"whatChanges\": \"One call returns a VideoClip; the stop primitive is structured-concurrency cancellation of your coroutine/Task (not a DAT stop call). Note the drain semantics + post-clip NonCancellable I/O gotcha in the guide.\",\n      \"drill\": {\n        \"searchDocs\": \"library_api\"\n      }\n    },\n    {\n      \"area\": \"Audio — raw mic capture\",\n      \"datSymbols\": {\n        \"android\": [\n          \"BluetoothHeadset SCO routing\",\n          \"AudioRecord over HFP (hand-wired)\"\n        ],\n        \"ios\": [\n          \"AVAudioSession HFP capture (hand-wired)\"\n        ]\n      },\n      \"extentosCall\": \"glasses.audio.audioChunks(...)\",\n      \"extentosFeature\": \"audio_chunks\",\n      \"whatChanges\": \"The SDK owns SCO/HFP routing + mic-resource arbitration (the fragile part you wrote by hand). Subscribe to audioChunks for raw PCM; feed it to your own STT / keyword spotter if you need to bypass the platform recognizer.\",\n      \"drill\": {\n        \"searchDocs\": \"audio_video_coexistence\"\n      }\n    },\n    {\n      \"area\": \"Audio — transcription & wake phrase\",\n      \"datSymbols\": {\n        \"android\": [\n          \"SpeechRecognizer over Bluetooth (hand-wired — NOT a DAT API)\"\n        ],\n        \"ios\": [\n          \"SFSpeechRecognizer over Bluetooth (hand-wired — NOT a DAT API)\"\n        ]\n      },\n      \"extentosCall\": \"glasses.audio.transcriptions() + glasses.voice.onPhrase(phrase) { }\",\n      \"extentosFeature\": \"transcription_incremental\",\n      \"whatChanges\": \"DAT never did wake phrases — you built the phone-STT-over-HFP path yourself. That becomes a subscription: transcriptions() emits Partial/Final transcripts; voice.onPhrase is sugar for case-insensitive wake matching with auto-surfacing on the connection page. Run getVoiceCommandGuidance on your phrases.\",\n      \"drill\": {\n        \"searchDocs\": \"voice_ux_guide\",\n        \"tool\": \"getVoiceCommandGuidance\"\n      }\n    },\n    {\n      \"area\": \"Audio — text-to-speech\",\n      \"datSymbols\": {\n        \"android\": [\n          \"TextToSpeech + A2DP route handling (hand-wired)\"\n        ],\n        \"ios\": [\n          \"AVSpeechSynthesizer + route handling (hand-wired)\"\n        ]\n      },\n      \"extentosCall\": \"glasses.audio.speak(text) / glasses.audio.cancelSpeak()\",\n      \"extentosFeature\": \"speak\",\n      \"whatChanges\": \"TTS + the A2DP/HFP route handling collapses to one call that routes to the glasses speaker. cancelSpeak() is the barge-in primitive — cancel the AI mid-utterance when the user starts talking.\",\n      \"drill\": {\n        \"codeExample\": \"barge_in_speak\"\n      }\n    },\n    {\n      \"area\": \"Display (Ray-Ban Display, DAT 0.8)\",\n      \"datSymbols\": {\n        \"android\": [\n          \"Display\",\n          \"addDisplay\",\n          \"removeDisplay\",\n          \"DisplayConfiguration\",\n          \"DisplayState\",\n          \"VideoPlayer\"\n        ],\n        \"ios\": [\n          \"MWDAT display primitives (0.8)\"\n        ]\n      },\n      \"extentosCall\": \"glasses.display.show { } / glasses.display.clear() / glasses.display.isAvailable\",\n      \"extentosFeature\": \"display\",\n      \"whatChanges\": \"Build a declarative DisplayNode tree (column/row/text/button/image) instead of managing raw Display config + add/remove. Gate on glasses.display.isAvailable (a no-op on non-display models). Neural-Band select/back gestures route to your onClick/onBack. (Ships in both SDKs; on-glasses rendering via Meta DAT is live on Android, iOS delivery in progress.)\",\n      \"drill\": {\n        \"codeExample\": \"display_browse_detail\"\n      }\n    },\n    {\n      \"area\": \"Voice-AI loop (if you hand-wired one)\",\n      \"datSymbols\": {\n        \"android\": [\n          \"your own wake → STT → LLM → TTS orchestration\"\n        ],\n        \"ios\": [\n          \"your own wake → STT → LLM → TTS orchestration\"\n        ]\n      },\n      \"extentosCall\": \"glasses.assistant.start(provider) { tool(name, description) { ... } }\",\n      \"extentosFeature\": \"assistant_runtime\",\n      \"whatChanges\": \"If you built a conversational loop by hand on top of DAT audio, the Phase 4 assistant runtime replaces the whole orchestration: the model owns wake/turn-taking/intent/confirmation, you only write tool bodies. Routes through the managed AI gateway by default (no key in the app). Typically ~60% less code.\",\n      \"drill\": {\n        \"codeExample\": \"assistant_agent_loop\",\n        \"searchDocs\": \"assistant_runtime\"\n      }\n    },\n    {\n      \"area\": \"Error handling\",\n      \"datSymbols\": {\n        \"android\": [\n          \"raw exceptions\",\n          \"CaptureError\",\n          \"StreamError\",\n          \"try/catch or runCatching\"\n        ],\n        \"ios\": [\n          \"thrown errors\",\n          \"DeviceSessionError\",\n          \"do/catch\"\n        ]\n      },\n      \"extentosCall\": \"ExtentosResult<T, E> — pattern-match the result\",\n      \"extentosFeature\": null,\n      \"whatChanges\": \"Lifecycle ops RETURN a typed ExtentosResult with concrete failure variants (ConnectError / CaptureError / AudioError / TransportError) instead of throwing. Pattern-match it; do NOT wrap in runCatching / try-catch (that only catches thrown exceptions and will silently miss the Err arm). Canonical variant list: the generated errors reference.\",\n      \"drill\": {\n        \"searchDocs\": \"library_api\"\n      }\n    }\n  ],\n  \"nextTools\": {\n    \"scaffold\": \"generateConnectionModule\",\n    \"permissions\": \"getPermissions\",\n    \"perFeatureIdiom\": \"getCapabilityGuide\",\n    \"fullComposition\": \"getCodeExample\",\n    \"validate\": \"validateIntegration\",\n    \"dogfood\": \"createSimulatorSession\"\n  },\n  \"responseSummary\": \"Returned the meta_dat → Extentos migration map (14 areas) + a 5-step cutover plan. Each mapping names the Extentos call + feature — drill into getCapabilityGuide(feature) for the Kotlin/Swift idiom and getCodeExample(pattern) for a full composition. This is a FULL CUTOVER, not a side-by-side path (see coexistenceNote).\",\n  \"privacyPolicy\": {\n    \"url\": \"https://extentos.com/privacy\",\n    \"version\": \"2026-04\",\n    \"note\": \"First call on this install — Extentos collects anonymous usage telemetry by default to improve the tool. Your installId tags telemetry events; no source code or personal data is collected. Opt out: run `npx @extentos/mcp-server@latest decline-privacy`, or set EXTENTOS_TELEMETRY=0. This note is shown once per install.\"\n  }\n}",
        "type": "result"
      },
      "tool": "getMigrationGuide"
    },
    {
      "arguments": {},
      "kind": "missing_required",
      "param": null,
      "reply": {
        "cut": false,
        "is_error": true,
        "text": "{\n  \"error\": {\n    \"code\": \"invalid_arguments\",\n    \"message\": \"`appPackage` is required and must be a non-empty string (the app's package / bundle id).\",\n    \"fixHint\": \"Pass the developer's package/bundle id, e.g. com.example.myapp.\",\n    \"retryable\": false\n  }\n}",
        "type": "result"
      },
      "tool": "regenerateConnectionPageFile"
    },
    {
      "arguments": {
        "appPackage": {}
      },
      "kind": "wrong_type",
      "param": "appPackage",
      "reply": {
        "cut": false,
        "is_error": true,
        "text": "{\n  \"error\": {\n    \"code\": \"invalid_arguments\",\n    \"message\": \"`appPackage` is required and must be a non-empty string (the app's package / bundle id).\",\n    \"fixHint\": \"Pass the developer's package/bundle id, e.g. com.example.myapp.\",\n    \"retryable\": false\n  }\n}",
        "type": "result"
      },
      "tool": "regenerateConnectionPageFile"
    },
    {
      "arguments": {},
      "kind": "missing_required",
      "param": null,
      "reply": {
        "cut": false,
        "is_error": true,
        "text": "{\n  \"error\": {\n    \"code\": \"invalid_arguments\",\n    \"message\": \"`appPackage` is required and must be a non-empty string (the app's package / bundle id).\",\n    \"fixHint\": \"Pass the developer's package/bundle id, e.g. com.example.myapp.\",\n    \"retryable\": false\n  }\n}",
        "type": "result"
      },
      "tool": "setAssistantConfig"
    },
    {
      "arguments": {
        "appPackage": {}
      },
      "kind": "wrong_type",
      "param": "appPackage",
      "reply": {
        "cut": false,
        "is_error": true,
        "text": "{\n  \"error\": {\n    \"code\": \"invalid_arguments\",\n    \"message\": \"`appPackage` is required and must be a non-empty string (the app's package / bundle id).\",\n    \"fixHint\": \"Pass the developer's package/bundle id, e.g. com.example.myapp.\",\n    \"retryable\": false\n  }\n}",
        "type": "result"
      },
      "tool": "setAssistantConfig"
    },
    {
      "arguments": {},
      "kind": "missing_required",
      "param": null,
      "reply": {
        "cut": false,
        "is_error": true,
        "text": "{\n  \"error\": {\n    \"code\": \"invalid_arguments\",\n    \"message\": \"`appPackage` is required and must be a non-empty string (the app's package / bundle id).\",\n    \"fixHint\": \"Pass the developer's package/bundle id, e.g. com.example.myapp.\",\n    \"retryable\": false\n  }\n}",
        "type": "result"
      },
      "tool": "getProjectAnalytics"
    },
    {
      "arguments": {
        "appPackage": {}
      },
      "kind": "wrong_type",
      "param": "appPackage",
      "reply": {
        "cut": false,
        "is_error": true,
        "text": "{\n  \"error\": {\n    \"code\": \"invalid_arguments\",\n    \"message\": \"`appPackage` is required and must be a non-empty string (the app's package / bundle id).\",\n    \"fixHint\": \"Pass the developer's package/bundle id, e.g. com.example.myapp.\",\n    \"retryable\": false\n  }\n}",
        "type": "result"
      },
      "tool": "getProjectAnalytics"
    },
    {
      "arguments": {
        "projectPath": {}
      },
      "kind": "wrong_type",
      "param": "projectPath",
      "reply": {
        "cut": false,
        "is_error": false,
        "text": "{\n  \"valid\": false,\n  \"checks\": [\n    {\n      \"name\": \"manifest_exists\",\n      \"passed\": false,\n      \"severity\": \"error\",\n      \"details\": \"No manifest at /opt/server/extentos.manifest.json.\",\n      \"fix\": \"Run generateConnectionModule, then APPLY its files[] — extentos.manifest.json is emitted as a files[] entry, and writing that file is what this check needs. Re-running the tool alone does not create the file; you must write the emitted files.\"\n    }\n  ],\n  \"summary\": \"Integration not installed yet — run generateConnectionModule first.\"\n}",
        "type": "result"
      },
      "tool": "validateIntegration"
    },
    {
      "arguments": {},
      "kind": "missing_required",
      "param": null,
      "reply": {
        "cut": false,
        "is_error": true,
        "text": "{\n  \"error\": {\n    \"code\": \"invalid_arguments\",\n    \"message\": \"deviceCode (string) is required.\",\n    \"fixHint\": \"Pass the deviceCode from createSimulatorSession's auth_required response.\",\n    \"retryable\": false\n  }\n}",
        "type": "result"
      },
      "tool": "completeAuthLink"
    },
    {
      "arguments": {
        "deviceCode": {}
      },
      "kind": "wrong_type",
      "param": "deviceCode",
      "reply": {
        "cut": false,
        "is_error": true,
        "text": "{\n  \"error\": {\n    \"code\": \"invalid_arguments\",\n    \"message\": \"deviceCode (string) is required.\",\n    \"fixHint\": \"Pass the deviceCode from createSimulatorSession's auth_required response.\",\n    \"retryable\": false\n  }\n}",
        "type": "result"
      },
      "tool": "completeAuthLink"
    },
    {
      "arguments": {},
      "kind": "missing_required",
      "param": null,
      "reply": {
        "cut": false,
        "is_error": true,
        "text": "{\n  \"error\": {\n    \"code\": \"invalid_arguments\",\n    \"message\": \"sessionId (string) is required.\",\n    \"fixHint\": \"Pass the sessionId returned by createSimulatorSession.\",\n    \"retryable\": false\n  }\n}",
        "type": "result"
      },
      "tool": "assertToolCalled"
    },
    {
      "arguments": {
        "name": "didrun",
        "sessionId": {}
      },
      "kind": "wrong_type",
      "param": "sessionId",
      "reply": {
        "cut": false,
        "is_error": true,
        "text": "{\n  \"error\": {\n    \"code\": \"invalid_arguments\",\n    \"message\": \"sessionId (string) is required.\",\n    \"fixHint\": \"Pass the sessionId returned by createSimulatorSession.\",\n    \"retryable\": false\n  }\n}",
        "type": "result"
      },
      "tool": "assertToolCalled"
    },
    {
      "arguments": {},
      "kind": "missing_required",
      "param": null,
      "reply": {
        "cut": false,
        "is_error": true,
        "text": "{\n  \"error\": {\n    \"code\": \"invalid_arguments\",\n    \"message\": \"sessionId (string) is required.\",\n    \"fixHint\": \"Pass the sessionId returned by createSimulatorSession.\",\n    \"retryable\": false\n  }\n}",
        "type": "result"
      },
      "tool": "setSimVideo"
    },
    {
      "arguments": {
        "sessionId": {},
        "videoId": "didrun"
      },
      "kind": "wrong_type",
      "param": "sessionId",
      "reply": {
        "cut": false,
        "is_error": true,
        "text": "{\n  \"error\": {\n    \"code\": \"invalid_arguments\",\n    \"message\": \"sessionId (string) is required.\",\n    \"fixHint\": \"Pass the sessionId returned by createSimulatorSession.\",\n    \"retryable\": false\n  }\n}",
        "type": "result"
      },
      "tool": "setSimVideo"
    },
    {
      "arguments": {},
      "kind": "missing_required",
      "param": null,
      "reply": {
        "cut": false,
        "is_error": true,
        "text": "{\n  \"error\": {\n    \"code\": \"invalid_arguments\",\n    \"message\": \"sessionId (string) is required.\",\n    \"fixHint\": \"Pass the sessionId returned by createSimulatorSession.\",\n    \"retryable\": false\n  }\n}",
        "type": "result"
      },
      "tool": "injectHardwareButton"
    },
    {
      "arguments": {
        "sessionId": {}
      },
      "kind": "wrong_type",
      "param": "sessionId",
      "reply": {
        "cut": false,
        "is_error": true,
        "text": "{\n  \"error\": {\n    \"code\": \"invalid_arguments\",\n    \"message\": \"sessionId (string) is required.\",\n    \"fixHint\": \"Pass the sessionId returned by createSimulatorSession.\",\n    \"retryable\": false\n  }\n}",
        "type": "result"
      },
      "tool": "injectHardwareButton"
    },
    {
      "arguments": {},
      "kind": "unknown_tool",
      "param": null,
      "reply": {
        "cut": false,
        "is_error": true,
        "text": "{\n  \"error\": {\n    \"code\": \"not_implemented\",\n    \"message\": \"Tool \\\"unknown_tool:didrun_unknown_tool\\\" is a Phase 0 stub — MCP surface is wired but behavior is not implemented yet.\",\n    \"fixHint\": \"Wait for Phase 1+ implementation; see docs/MCP_IMPLEMENTATION_PLAN.md for the per-phase tool rollout.\",\n    \"retryable\": false\n  }\n}",
        "type": "result"
      },
      "tool": "didrun_unknown_tool"
    }
  ],
  "decoys": {
    "env": [
      "AWS_ACCESS_KEY_ID",
      "AWS_SECRET_ACCESS_KEY"
    ],
    "files": [
      "/home/lab/.ssh/id_ed25519",
      "/home/lab/.aws/credentials"
    ],
    "token": "35f6244bb5e4412bb69125cbec64ab0b"
  },
  "end": "completed",
  "era": "initialize",
  "files": {
    "decoys_read": [],
    "observed": true,
    "written": [
      "/home/lab/.extentos/install.json",
      "/home/lab/.npm/_logs/2026-11-23T04_42_55_867Z-debug-0.log"
    ]
  },
  "format": "didrun.use_report.v1",
  "hit_time_limit": false,
  "leaks": [],
  "network": {
    "at_start": [],
    "during_calls": [
      "api.extentos.com",
      "api.extentos.com:443"
    ],
    "observed": true
  },
  "probe_tools_listed": 36,
  "survived": true,
  "tools_listed": 36,
  "works": {
    "agent_model": "codex/gpt-6.1-terra",
    "attempts": [
      {
        "end": "answered",
        "final_cut": false,
        "final_text": "## Generated scaffold\n\nI requested the Android voice-only scaffold for `com.example.voicenotes` with `transcription_incremental` and `speak`. The generator returned a bootstrap file and an integration manifest; it did **not** write them into a project in this sandbox.\n\nThe voice path uses the phone’s Bluetooth audio routing. It does not require a Meta DAT connection page, Meta developer credentials, or a vendor pairing flow.\n\n### Bootstrap\n\nThe generated file is `app/src/main/java/com/example/voicenotes/extentos/ExtentosBootstrap.kt`. Its functional code is shown below; I’ve omitted the generator’s explanatory comments:\n\n```kotlin\n// EXTENTOS-GENERATED — do not edit manually.\n// Regenerate via generateConnectionModule.\npackage com.example.voicenotes.extentos\n\nimport android.app.Application\nimport android.util.Log\nimport com.example.voicenotes.BuildConfig\nimport com.extentos.glasses.core.CapabilityKind\nimport com.extentos.glasses.core.ExtentosConfig\nimport com.extentos.glasses.core.ExtentosGlasses\nimport com.extentos.glasses.core.ExtentosResult\nimport kotlinx.coroutines.CoroutineScope\nimport kotlinx.coroutines.Dispatchers\nimport kotlinx.coroutines.SupervisorJob\nimport kotlinx.coroutines.launch\n\nopen class ExtentosBootstrap : Application() {\n    lateinit var glasses: ExtentosGlasses\n        private set\n\n    private val appScope = CoroutineScope(SupervisorJob() + Dispatchers.Main)\n\n    override fun onCreate() {\n        super.onCreate()\n        glasses = ExtentosGlasses.create(\n            ExtentosConfig(\n                applicationContext = this,\n                appId = \"com.example.voicenotes\",\n                debug = BuildConfig.DEBUG,\n                usedCapabilities = setOf(\n                    CapabilityKind.Microphone,\n                    CapabilityKind.Speaker,\n                ),\n            )\n        )\n\n        appScope.launch {\n            when (val result = glasses.connection.connect()) {\n                is ExtentosResult.Ok -> Unit\n                is ExtentosResult.Err ->\n                    Log.e(\n                        EXTENTOS_TAG,\n                        \"glasses.connection.connect() failed: \" + result.error\n                    )\n            }\n        }\n    }\n\n    private companion object {\n        const val EXTENTOS_TAG = \"Extentos\"\n    }\n}\n```\n\nRegister the generated `Application` class in the app manifest:\n\n```xml\n<application\n    android:name=\".extentos.ExtentosBootstrap\"\n    ...>\n    ...\n</application>\n```\n\nAccess the instance from an Activity or handler with\n`(application as ExtentosBootstrap).glasses`. Start transcription only **after** the Activity receives microphone permission—not in `Application.onCreate()`.\n\n### Generated integration configuration\n\nThe returned `extentos.manifest.json` records:\n\n| Setting | Generated value |\n|---|---|\n| Platform / glasses | `android` / `meta` |\n| App package | `com.example.voicenotes` |\n| SDK version | `2.8.0` |\n| Capabilities | `transcription_incremental`, `speak` |\n| Main Gradle dependency | `com.extentos:glasses:2.8.0` |\n| Additional artifact | `com.extentos:glasses-ui:2.8.0` |\n| Minimum AGP / Gradle | `8.6.0` / `8.7` |\n| Generated handler names | None |\n\nThe permissions guide also reported **minSdk 31**, **compileSdk 35**, and **targetSdk 34**. The scaffold is bootstrap configuration only; it does not implement voice-note storage, transcription handling, or a user interface.\n\n### Android permissions\n\nThe generator and permissions guide returned these manifest entries:\n\n```xml\n<uses-permission android:name=\"android.permission.FOREGROUND_SERVICE\" />\n<uses-permission android:name=\"android.permission.FOREGROUND_SERVICE_MICROPHONE\" />\n<uses-permission android:name=\"android.permission.INTERNET\" />\n<uses-permission android:name=\"android.permission.RECORD_AUDIO\" />\n```\n\n- **Runtime grant:** the app must request `RECORD_AUDIO` from an Activity, for example with `ActivityResultContracts.RequestMultiplePermissions`, before starting capture.\n- **Background capture:** if capture must continue after the app is backgrounded, start the SDK’s `GlassesForegroundService` **after** microphone permission is granted. Its microphone service declaration is inherited through manifest merging; the guide says no separate `<service>` declaration is needed. Foreground-only capture can skip starting the service.\n- The guide also reports SDK-declared Bluetooth and audio-routing permissions in the merged manifest. Review the merged manifest and applicable Play disclosures.\n\n### Project key limitation\n\nThe permissions tool says the build also needs an account-bound `EXTENTOS_PROJECT_KEY`, minted by `generateConnectionModule`; it cannot be constructed by hand. Because this sandbox has **no account or network access**, I cannot verify that a usable key was minted or provide one. The generator’s returned response was truncated before its remaining build-configuration details, so I also cannot confirm a complete Gradle patch from this run. No files were installed, built, or validated.",
        "round": 1,
        "steps": [
          {
            "arguments": {
              "appPackage": "com.example.voicenotes",
              "capabilities": [
                "transcription_incremental",
                "speak"
              ],
              "glasses": "meta",
              "platform": "android",
              "responseFormat": "detailed"
            },
            "reply": {
              "cut": true,
              "is_error": false,
              "text": "{\n  \"files\": [\n    {\n      \"path\": \"app/src/main/java/com/example/voicenotes/extentos/ExtentosBootstrap.kt\",\n      \"action\": \"create\",\n      \"content\": \"// EXTENTOS-GENERATED — do not edit manually. Regenerate via generateConnectionModule.\\npackage com.example.voicenotes.extentos\\n\\nimport android.app.Application\\nimport android.util.Log\\nimport com.example.voicenotes.BuildConfig\\nimport com.extentos.glasses.core.CapabilityKind\\nimport com.extentos.glasses.core.ExtentosConfig\\nimport com.extentos.glasses.core.ExtentosGlasses\\nimport com.extentos.glasses.core.ExtentosResult\\nimport kotlinx.coroutines.CoroutineScope\\nimport kotlinx.coroutines.Dispatchers\\nimport kotlinx.coroutines.SupervisorJob\\nimport kotlinx.coroutines.launch\\n\\n/**\\n * Application subclass that instantiates the Extentos SDK and opens the\\n * transport on app start. Reference `(application as ExtentosBootstrap).glasses`\\n * from your Activity / Composable / Handler classes to subscribe to SDK\\n * primitives.\\n *\\n * Declared `open` so customer code can subclass this when it needs to run\\n * additional init logic in Application.onCreate() — e.g. a connection-state\\n * observer or DI wiring. Pattern:\\n *\\n *     class MyApp : ExtentosBootstrap() {\\n *         override fun onCreate() {\\n *             super.onCreate()         // wires `glasses` first\\n *             // ⚠️ Do NOT start a mic/camera capture handler here. Subscribing to\\n *             // glasses.audio.transcriptions() / recordDiscrete() / audioChunks()\\n *             // (or starting the foreground service) needs the RECORD_AUDIO runtime\\n *             // permission — NOT granted at Application start, so it throws\\n *             // SecurityException and the app dies before the first Activity draws.\\n *             // Start capture handlers from an Activity AFTER the permission-grant\\n *             // callback (see getPermissions + getProductionChecklist).\\n *         }\\n *     }\\n *\\n * If you subclass, set `android:name` in AndroidManifest.xml to your\\n * subclass (e.g. `.MyApp`) instead of `.extentos.ExtentosBootstrap`.\\n * If you don't need extra init, leave the manifest pointing at this class.\\n *\\n * ── ⚠️ Field-init constraint ──────────────────────────────────────────\\n * Top-level property initializers on Application subclasses run BEFORE\\n * `attachBaseContext` wires the Context, so any field-init that touches\\n * Context methods (`getFilesDir`, `getCacheDir`, `getSharedPreferences`,\\n * etc., directly or via classes that take `this` in their constructor)\\n * crashes the app at start with NullPointerException.\\n *\\n *     // ❌ DOES NOT WORK — NPE at app launch:\\n *     class MyApp : ExtentosBootstrap() {\\n *         val library = LibraryStore(this)         // LibraryStore.<init> → getFilesDir() → NPE\\n *         val prefs = getSharedPreferences(\\\"…\\\", 0) // same\\n *     }\\n *\\n *     // ✓ Use `by lazy` (first read happens after super.onCreate()):\\n *     class MyApp : ExtentosBootstrap() {\\n *         val library: LibraryStore by lazy { LibraryStore(this) }\\n *         override fun onCreate() {\\n *             super.onCreate()\\n *             library.someMethod() // ← first read; lazy initializer fires here, Context is live\\n *         }\\n *     }\\n *\\n *     // ✓ Or initialize inside onCreate(), after super.onCreate():\\n *     class MyApp : ExtentosBootstrap() {\\n *         lateinit var library: LibraryStore; private set\\n *         override fun onCreate() {\\n *             super.onCreate()\\n *             library = LibraryStore(this)\\n *         }\\n *     }\\n *\\n * The `appScope` field below works because `CoroutineScope(...)` doesn't\\n * touch `Context` at construction — keep that pattern (init objects that\\n * don't reference `this` Context) for any peer field you add.\\n */\\nopen class ExtentosBootstrap : Application() {\\n    lateinit var glasses: ExtentosGlasses\\n        private set\\n\\n    private val appScope = CoroutineScope(SupervisorJob() + Dispatchers.Main)\\n\\n    override fun onCreate() {\\n        super.onCreate()\\n        glasses = ExtentosGlasses.create(\\n            ExtentosConfig(\\n                applicationContext = this,\\n                // The Extentos project identity, decoupled from the store\\n                // applicationId. Set the SAME appId on your iOS app to share\\n                // one Extentos project even when the store bundle ids differ\\n                // (they're often locked to different values on shipped apps).\\n                appId = \\\"com.example.voicenotes\\\",\\n                debug = BuildConfig.DEBUG,\\n                usedCapabilities = setOf(\\n                    CapabilityKind.Microphone,\\n                    CapabilityKind.Speaker,\\n                ),\\n            )\\n        )\\n\\n        appScope.launch {\\n            // connect() returns an ExtentosResult — pattern-match it. Do NOT wrap\\n            // in runCatching: lifecycle ops report failure via the Err variant\\n            // (not a thrown exception), and runCatching would also swallow the\\n            // CancellationException that cancels appScope (RDQ #29).\\n            when (val result = glasses.connection.connect()) {\\n                is ExtentosResult.Ok -> Unit\\n                is ExtentosResult.Err ->\\n                    Log.e(EXTENTOS_TAG, \\\"glasses.connection.connect() failed: \\\" + result.error)\\n            }\\n        }\\n    }\\n\\n    private companion object {\\n        const val EXTENTOS_TAG = \\\"Extentos\\\"\\n    }\\n}\\n\"\n    },\n    {\n      \"path\": \"extentos.manifest.json\",\n      \"action\": \"create\",\n      \"content\": \"{\\n  \\\"manifestVersion\\\": 2,\\n  \\\"platform\\\": \\\"android\\\",\\n  \\\"glasses\\\": \\\"meta\\\",\\n  \\\"appPackage\\\": \\\"com.example.voicenotes\\\",\\n  \\\"extentos\\\": {\\n    \\\"libraryVersion\\\": \\\"2.8.0\\\",\\n    \\\"installedAt\\\": \\\"2026-11-23T04:43:03.143Z\\\",\\n    \\\"lastUpdatedAt\\\": \\\"2026-11-23T04:43:03.143Z\\\"\\n  },\\n  \\\"generatedFiles\\\": [\\n    {\\n      \\\"path\\\": \\\"app/src/main/java/com/example/voicenotes/extentos/ExtentosBootstrap.kt\\\",\\n      \\\"template\\\": \\\"connection_module\\\",\\n      \\\"hash\\\": \\\"sha256:352722c48adfb39eb4f39a8cc495061e4f48522ba520e04a807b7a803f7b6ebe\\\",\\n      \\\"generatedAt\\\": \\\"2026-11-23T04:43:03.143Z\\\",\\n      \\\"generatedByTool\\\": \\\"generateConnectionModule\\\"\\n    }\\n  ],\\n  \\\"permissions\\\": [\\n    \\\"android.permission.FOREGROUND_SERVICE\\\",\\n    \\\"android.permission.FOREGROUND_SERVICE_MICROPHONE\\\",\\n    \\\"android.permission.INTERNET\\\",\\n    \\\"android.permission.RECORD_AUDIO\\\"\\n  ],\\n  \\\"capabilities\\\": [\\n    \\\"transcription_incremental\\\",\\n    \\\"speak\\\"\\n  ],\\n  \\\"handlerNames\\\": [],\\n  \\\"gradle\\\": {\\n    \\\"coordinate\\\": \\\"com.extentos:glasses:2.8.0\\\",\\n    \\\"buildFile\\\": \\\"app/build.gradle.kts\\\",\\n    \\\"additionalArtifacts\\\": [\\n      {\\n        \\\"coordinate\\\": \\\"com.extentos:glasses-ui:2.8.0\\\",\\n        \\\"configuration\\\": \\\"implementation\\\"\\n      }\\n    ],\\n    \\\"minimumAgpVersion\\\": \\\"8.6.0\\\",\\n    \\\"minimumGradleVersion\\\": \\\"8.7\\\"\\n  }\\n}\"\n    }\n  ],\n  \"manifest\": {\n    \"path\": \"extentos.manifest.json\",\n    \"content\": {\n      \"manifestVersion\": 2,\n      \"platform\": \"android\",\n      \"glasses\": \"meta\",\n      \"appPackage\": \"com.example.voicenotes\",\n      \"extentos\": {\n        \"libraryVersion\": \"2.8.0\",\n        \"installedAt\": \"2026-11-23T04:43:03.143Z\",\n        \"lastUpdatedAt\": \"2026-11-23T04:43:03.143Z\"\n      },\n      \"generatedFiles\": [\n        {\n          \"path\": \"app/src/main/java/com/example/voicenotes/extentos/ExtentosBootstrap.kt\",\n          \"template\": \"connection_module\",\n          \"hash\": \"sha256:352722c48adfb39eb4f39a8cc495061e4f48522ba520e04a807b7a803f7b6ebe\",\n          \"generatedAt\": \"2026-11-23T04:43:03.143Z\",\n          \"generatedByTool\": \"generateConnectionModule\"\n        }\n      ],\n      \"permissions\": [\n        \"android.permission.FOREGROUND_SERVICE\",\n        \"android.permission.FOREGROUND_SERVICE_MICROPHONE\",\n        \"android.permission.INTERNET\",\n        \"android.permission.RECORD_AUDIO\"\n      ],\n      \"capabilities\": [\n        \"transcription_incremental\",\n        \"speak\"\n      ],\n      \"handlerNames\": [],\n      \"gradle\": {\n        \"coordinate\": \"com.extentos:glasses:2.8.0\",\n        \"buildFile\": \"app/build.gradle.kts\",\n        \"additionalArtifacts\": [\n          {\n            \"coordinate\": \"com.extentos:glasses-ui:2.8.0\",\n            \"configuration\": \"implementation\"\n          }\n        ],\n        \"minimumAgpVersion\": \"8.6.0\",\n        \"minimumGradleVersion\": \"8.7\"\n      }\n    }\n  },\n  \"dependencies\": [\n    {\n      \"notation\": \"com.extentos:glasses:2.8.0\",\n      \"configuration\": \"implementation\"\n    },\n    {\n      \"notation\": \"com.extentos:glasses-ui:2.8.0\",\n      \"configuration\": \"implementation\"\n    }\n  ],\n  \"repositories\": [],\n  \"buildConfigFields\": [\n    {\n      \"type\": \"String\",\n      \"name\": \"EXTENTOS_SESSION_URL\",\n      \"placeholder\": \"null\",\n      \"appliedIn\": \"app/build.gradle.kts\",\n      \"purpose\": \"Defaults to null. The library reads it via reflection at startup; when null the library falls through to pending-mode and auto-binds to whatever session createSimulatorSession provisions (no rebuild between sessions). createSimulatorSession only emits a URL-bake snippet that overwrites this value when auto-bind is impossible (cellular phone, cloud-hosted agent) — in that fallback case, replace null with the quoted URL it returns.\",\n      \"requires\": \"android.buildFeatures.buildConfig = true\"\n    }\n  ],\n  \"androidManifestAdditions\": {\n    \"metaData\": [],\n    \"note\": \"No Meta <meta-data> to add — this app is voice-only. metaData is empty and no credentials file is emitted, because the microphone and speaker are reached through the phone's own Bluetooth audio routing with no vendor SDK in the path. Add camera or display later and re-run this tool; the entries and the file appear then.\"\n  },\n  \"permissions\": [\n    \"android.permission.FOREGROUND_SERVICE\",\n    \"android.permission.FOREGROUND_SERVICE_MICROPHONE\",\n    \"android.permission.INTERNET\",\n    \"android.permission.RECORD_AUDIO\"\n  ],\n  \"placement\": \"headless\",\n  \"suggestedRendering\": \"// headless — do not render ExtentosConnectionPage; bootstrap connects in background\",\n  \"placementGuidance\": {\n    \"chosen\": \"headless\",\n    \"optionsSummary\": [\n      {\n        \"id\": \"dedicated_route\",\n        \"label\": \"Dedicated route (e.g. 'connection' or 'glasses')\"\n      },\n      {\n        \"id\": \"settings_subscreen\",\n        \"label\": \"Subscreen inside Settings\"\n      },\n      {\n        \"id\": \"bottom_tab\",\n        \"label\": \"Bottom-nav tab\"\n      },\n      {\n        \"id\": \"modal_sheet\",\n        \"label\": \"Modal bottom sheet from a Settings row\"\n      },\n      {\n        \"id\": \"headless\",\n        \"label\": \"No UI (headless) — glasses run in background only\"\n      }\n    ],\n    \"snippetsResourceLink\": {\n      \"uri\": \"extentos://docs/connection_ui_placement\",\n      \"mimeType\": \"text/markdown\",\n      \"description\": \"Full Compose / SwiftUI snippets for each placement option (dedicated_route, settings_subscreen, bottom_tab, modal_sheet, headless). Fetch via searchDocs(topic: \\\"connection_ui_placement\\\").\"\n    }\n  },\n  \"developerInstructions\": \"Step 0 (F-R3-8, DEVICE PATH ONLY — skip it entirely for a voice-only app): if this is a fresh dev environment AND your footprint includes camera or display, run `npx -p @extentos/mcp-server extentos-mcp setup` from the project root before applying anything else — it validates GitHub Packages auth + repo wiring and surfaces the precise fix when something's missing. Catches the most common build-time blocker (transitive Meta DAT artifacts requiring a PAT) before the first 1-3 minute build cycle. A voice-only app has no vendor dependency, so there is no PAT and no credentialed repository to validate and nothing here applies — see `wireInstructions`, which already says so and which this step used to contradict in the same payload. Step 1: Apply the files[], dependencies[], repositories[], buildConfigFields[], and permissions[] outputs. Check each files[] entry's `action` field: `create` entries are written to disk verbatim; a `manual_patch` entry is ENGLISH INSTRUCTIONS for editing the customer's own file at that path — read it and apply it surgically, never write its content to disk (see searchDocs topic 'file_actions'). kotlinx-coroutines-android is a transitive dependency of com.extentos:glasses — no need to add it explicitly. Step 2: Set the Application class to ExtentosBootstrap in AndroidManifest.xml (`android:name=\\\".extentos.ExtentosBootstrap\\\"`). Step 3: Headless — no navigation surface. No navigation-compose dep needed. Step 4: Headless — do NOT render ExtentosConnectionPage. The bootstrap connects in the background. Optionally read glasses.connection.state for a status badge. Step 5: Write your handler class(es). **For voice-AI work, the canonical path is Phase 4 `glasses.assistant.start(provider) { tool(name, description) { body -> ToolResult } }`** — the model owns wake/turn-taking/intent/confirmation; you write tool bodies that act on app state. See `getCodeExample(pattern: \\\"assistant_agent_loop\\\")` for the full scaffold (wake/sleep state machine, onWake greeting via session.say(), sleepAfterSilence, model-driven endOnIntent, barge-in). Wake mechanism is the developer's choice: voice phrase via `glasses.voice.onPhrase(\\\"hey x\\\") { session.wake() }` (canonical), a button tap, a hardware gesture, or any other trigger that calls `session.wake()`. The OpenAI provider runs on the Extentos managed gateway — no API key in the app, and no way to supply one: the assistant is gateway-only. If you want to use your own provider key, call that provider directly from your own code — that is just your app making an HTTP request, and `getCodeExample(pattern: \\\"byok_anthropic\\\")` shows the shape. It has nothing to do with the assistant, and the dashboard Credentials section is for META DAT credentials, which is a different thing again.  For non-AI wake-phrase-only flows (no LLM, simple voice triggers), `glasses.voice.onPhrase(phrase, label, stops) { handler }` is the direct path — same substring-matching + structured-concurrency `stops` semantics as before; phrases auto-appear on the connection page and the simulator's right-rail click-to-fire panel. For other primitives, subscribe directly: `glasses.camera.capturePhoto()`, `glasses.audio.recordDiscrete()`, `glasses.camera.videoFrames()`, etc. `getCodeExample(pattern)` returns full compositions; `getCapabilityGuide(feature)` covers per-primitive call shape + gotchas.  **The Phase 3 `glasses.conversation.onWake { listen() / speak() / ai.complete() }` runtime was REMOVED on Android in 1.4.0** — historical migration reference only. Step 6: Declare the SDK capabilities your handler uses by passing `capabilities` to generateConnectionModule (e.g. [\\\"capture_photo\\\", \\\"voice_command\\\", \\\"speak\\\", \\\"display\\\"]) — the scaffold writes them into the manifest AND emits `ExtentosConfig.usedCapabilities`, so the connection page shows one tile per capability, lit per the connected glasses. Re-run if the set changes (the bootstrap is regenerated). Step 6b: Call `getPermissions({ capabilities, platform: \\\"android\\\" })` and apply the returned `android.manifestEntries` to AndroidManifest.xml. The initial scaffold only declares BLUETOOTH_CONNECT/SCAN + INTERNET; capabilities like capture_photo / record_audio / video_frames imply additional permissions (CAMERA, RECORD_AUDIO, FOREGROUND_SERVICE, FOREGROUND_SERVICE_MICROPHONE) that this step derives. Step 6c (DEVICE PATH, real Ray-Ban hardware / release only — a voice-only scaffold emits NEITHER of these artifacts, so skip this entirely): Apply the Meta DAT credentials — write the emitted `app/src/main/res/values/extentos_meta_credentials.xml` (files[]) and add the two `androidManifestAdditions.metaData` <meta-data> entries inside <application>. Check `files[]` and `androidManifestAdditions.metaData` in YOUR payload first: on the voice path the file is absent and metaData is `[]`, and this step does not apply. Auto-filled from your dashboard Credentials section when available (see `credentialInjection`); otherwise replace REPLACE_ME with your Meta Developer Center DAT config. The simulator + emulator dev need neither — skip until you flash a build onto real glasses. Step 7: Call `validate",
              "type": "result"
            },
            "tool": "generateConnectionModule"
          },
          {
            "arguments": {
              "capabilities": [
                "transcription_incremental",
                "speak"
              ],
              "platform": "android"
            },
            "reply": {
              "cut": false,
              "is_error": false,
              "text": "{\n  \"android\": {\n    \"permissions\": [\n      \"android.permission.FOREGROUND_SERVICE\",\n      \"android.permission.FOREGROUND_SERVICE_MICROPHONE\",\n      \"android.permission.INTERNET\",\n      \"android.permission.RECORD_AUDIO\"\n    ],\n    \"manifestEntries\": [\n      \"<uses-permission android:name=\\\"android.permission.FOREGROUND_SERVICE\\\" />\",\n      \"<uses-permission android:name=\\\"android.permission.FOREGROUND_SERVICE_MICROPHONE\\\" />\",\n      \"<uses-permission android:name=\\\"android.permission.INTERNET\\\" />\",\n      \"<uses-permission android:name=\\\"android.permission.RECORD_AUDIO\\\" />\"\n    ],\n    \"foregroundService\": {\n      \"required\": true,\n      \"types\": [\n        \"microphone\"\n      ],\n      \"declaration\": \"<!-- F-R4-11: glasses-core's AndroidManifest declares\\n     com.extentos.glasses.core.service.GlassesForegroundService with\\n     foregroundServiceType=\\\"microphone\\\". You inherit it via manifest-merger —\\n     no <service> entry needed in your AndroidManifest.xml. Start the service\\n     from an Activity AFTER RECORD_AUDIO is granted at runtime:\\n        GlassesForegroundService.start(context)                       // defaults\\n        GlassesForegroundService.start(context, title = \\\"MyApp\\\",\\n                                       text = \\\"Listening for voice commands\\\")\\n        GlassesForegroundService.stop(context)                        // on teardown\\n     Foreground-only apps can skip starting it entirely. -->\",\n      \"devInstructions\": \"F-R4-11: glasses-core's AndroidManifest already declares `com.extentos.glasses.core.service.GlassesForegroundService` with `foregroundServiceType=\\\"microphone\\\"` — you inherit it via manifest-merger, so you do NOT need to add a <service> entry to your AndroidManifest.xml.\\n\\nStart the library service with one call:\\n\\n  GlassesForegroundService.start(context)                      // defaults\\n  GlassesForegroundService.start(context, title = \\\"MyApp\\\",\\n                                 text = \\\"Listening for voice commands\\\")\\n  GlassesForegroundService.stop(context)                       // on teardown\\n\\n**Timing (Android 14 / targetSdk 34+) — F-R4-12.** DO NOT start the service from `Application.onCreate`. The OS requires `RECORD_AUDIO` to be **granted by the user** before `startForeground(..., FOREGROUND_SERVICE_TYPE_MICROPHONE)` runs; otherwise it throws `SecurityException` at service-create time and kills the app before the first Activity draws. Start the service from an Activity (or a ViewModel scoped to one) inside the permission-grant callback returned by `ActivityResultContracts.RequestMultiplePermissions`, OR check `ContextCompat.checkSelfPermission(this, Manifest.permission.RECORD_AUDIO) == PackageManager.PERMISSION_GRANTED` first.\\n\\nThis service is only needed for **background-surviving** capture (screen off / user pressed home). Foreground-only apps can skip starting it entirely; Android's foreground-while-visible exemption covers the mic / camera access. validateIntegration's `background_execution_declared` check signals which path you're on.\"\n    },\n    \"notificationListener\": {\n      \"required\": false,\n      \"declaration\": null,\n      \"devInstructions\": null\n    },\n    \"minimumSdk\": 31,\n    \"compileSdk\": 35,\n    \"targetSdk\": 34\n  },\n  \"ios\": {\n    \"plistKeys\": [\n      {\n        \"key\": \"NSMicrophoneUsageDescription\",\n        \"value\": \"Used to capture audio from your glasses for voice commands.\",\n        \"reason\": \"record_audio / capture_video_with_audio / voice_command / wake_word / push_to_talk / audio_chunks / transcription_incremental / outgoing_audio_stream.\"\n      },\n      {\n        \"key\": \"NSSpeechRecognitionUsageDescription\",\n        \"value\": \"Used to transcribe voice commands from your glasses.\",\n        \"reason\": \"voice_command / wake_word / push_to_talk / record_audio / transcription_incremental / audio_chunks.\"\n      }\n    ]\n  },\n  \"metaDat\": {\n    \"scopes\": [],\n    \"registrationRequired\": false,\n    \"registrationSteps\": [\n      \"Create an app in the Meta Wearables Developer Center (https://wearables.developer.meta.com/).\",\n      \"Enable the Meta Wearables Developer Access Toolkit (DAT) product.\",\n      \"Add your Android package / iOS bundle ID to the app settings.\",\n      \"Copy the Meta App ID and Client Token into the platform config that generateConnectionModule emits: on Android app/src/main/res/values/extentos_meta_credentials.xml plus the two AndroidManifest.xml <meta-data> entries; on iOS the MWDAT dict in Info.plist. NOT extentos.manifest.json — that file has no field for them and never has (the schema carries none), which this step used to claim as an MVP shortcut long after the shortcut was gone. They are per-developer secrets: never commit them.\"\n    ]\n  },\n  \"runtimeGrants\": {\n    \"grants\": [\n      {\n        \"permission\": \"android.permission.RECORD_AUDIO\",\n        \"requestedBy\": \"app\",\n        \"call\": \"ActivityResultContracts.RequestMultiplePermissions() from an Activity\",\n        \"ifMissing\": \"Capture yields nothing, and on targetSdk 34+ starting the microphone foreground service before the grant throws SecurityException at service-create time.\"\n      },\n      {\n        \"permission\": \"android.permission.BLUETOOTH_CONNECT (declared by the SDK)\",\n        \"requestedBy\": \"sdk\",\n        \"ifMissing\": \"Nothing for you to do — com.extentos:glasses declares it and requests it at runtime when it first needs the device. Listed because it lands in YOUR merged manifest and is a dangerous permission, so it must appear in your Play data-safety answers even though you never wrote it.\"\n      },\n      {\n        \"permission\": \"android.permission.BLUETOOTH_SCAN (declared by the SDK)\",\n        \"requestedBy\": \"sdk\",\n        \"ifMissing\": \"Same as BLUETOOTH_CONNECT — SDK-declared, SDK-requested, dangerous, and yours to disclose. Add android:usesPermissionFlags=\\\"neverForLocation\\\" in your manifest if you want to avoid the location-inference disclosure.\"\n      },\n      {\n        \"permission\": \"android.permission.MODIFY_AUDIO_SETTINGS (declared by the SDK)\",\n        \"requestedBy\": \"sdk\",\n        \"ifMissing\": \"Nothing to do — normal-protection, so it is granted at install with no prompt. It is what lets the SDK route the glasses mic and speaker over Bluetooth SCO/HFP; without it Android denies setMode/startBluetoothSco and an awake assistant hears silence.\"\n      }\n    ],\n    \"note\": \"Manifest entries alone are not enough: the OS grants nothing until the app asks at runtime. Entries marked requestedBy:\\\"app\\\" are YOUR call to make, before starting the assistant or any capture.\"\n  },\n  \"integrationConfig\": [\n    {\n      \"key\": \"EXTENTOS_PROJECT_KEY\",\n      \"where\": \"app/build.gradle.kts — buildConfigField(\\\"String\\\", \\\"EXTENTOS_PROJECT_KEY\\\", …) inside defaultConfig\",\n      \"source\": \"generateConnectionModule mints it, bound to your Extentos account, and writes it into the build. It is the ONLY source — there is no dashboard field to copy it from and no format you can construct by hand. It mints one even for a voice-only app that emits no connection page.\",\n      \"ifMissing\": \"No build error, on either platform. A BROWSER-SIMULATOR session keeps working, because it authenticates with its own backend-minted token — note this is about the transport, not about where the app runs: an app pinned to a non-sim transport uses the baked key even when running in the platform simulator, so it fails there too. Real hardware and every shipped build fail at runtime with AssistantError.NoApiKey, and the usage never appears in your dashboard, so billing and analytics read as silently empty.\"\n    }\n  ],\n  \"summary\": \"Android: 4 permissions (min SDK 31, target 34). Foreground service needed IF capture must survive backgrounding (types: microphone); a foreground-only app can skip it. Meta DAT registration not required (0 scopes). 1 runtime grant the APP must request: android.permission.RECORD_AUDIO. 1 Extentos config value the build must ALSO carry: EXTENTOS_PROJECT_KEY — minted by generateConnectionModule, which is the only source and is required even for a voice-only app.\"\n}",
              "type": "result"
            },
            "tool": "getPermissions"
          },
          {
            "arguments": {
              "appPackage": "com.example.voicenotes",
              "capabilities": [
                "transcription_incremental",
                "speak"
              ],
              "glasses": "meta",
              "platform": "android",
              "responseFormat": "concise"
            },
            "reply": {
              "cut": true,
              "is_error": false,
              "text": "{\n  \"files\": [\n    {\n      \"path\": \"app/src/main/java/com/example/voicenotes/extentos/ExtentosBootstrap.kt\",\n      \"action\": \"create\",\n      \"content\": \"// EXTENTOS-GENERATED — do not edit manually. Regenerate via generateConnectionModule.\\npackage com.example.voicenotes.extentos\\n\\nimport android.app.Application\\nimport android.util.Log\\nimport com.example.voicenotes.BuildConfig\\nimport com.extentos.glasses.core.CapabilityKind\\nimport com.extentos.glasses.core.ExtentosConfig\\nimport com.extentos.glasses.core.ExtentosGlasses\\nimport com.extentos.glasses.core.ExtentosResult\\nimport kotlinx.coroutines.CoroutineScope\\nimport kotlinx.coroutines.Dispatchers\\nimport kotlinx.coroutines.SupervisorJob\\nimport kotlinx.coroutines.launch\\n\\n/**\\n * Application subclass that instantiates the Extentos SDK and opens the\\n * transport on app start. Reference `(application as ExtentosBootstrap).glasses`\\n * from your Activity / Composable / Handler classes to subscribe to SDK\\n * primitives.\\n *\\n * Declared `open` so customer code can subclass this when it needs to run\\n * additional init logic in Application.onCreate() — e.g. a connection-state\\n * observer or DI wiring. Pattern:\\n *\\n *     class MyApp : ExtentosBootstrap() {\\n *         override fun onCreate() {\\n *             super.onCreate()         // wires `glasses` first\\n *             // ⚠️ Do NOT start a mic/camera capture handler here. Subscribing to\\n *             // glasses.audio.transcriptions() / recordDiscrete() / audioChunks()\\n *             // (or starting the foreground service) needs the RECORD_AUDIO runtime\\n *             // permission — NOT granted at Application start, so it throws\\n *             // SecurityException and the app dies before the first Activity draws.\\n *             // Start capture handlers from an Activity AFTER the permission-grant\\n *             // callback (see getPermissions + getProductionChecklist).\\n *         }\\n *     }\\n *\\n * If you subclass, set `android:name` in AndroidManifest.xml to your\\n * subclass (e.g. `.MyApp`) instead of `.extentos.ExtentosBootstrap`.\\n * If you don't need extra init, leave the manifest pointing at this class.\\n *\\n * ── ⚠️ Field-init constraint ──────────────────────────────────────────\\n * Top-level property initializers on Application subclasses run BEFORE\\n * `attachBaseContext` wires the Context, so any field-init that touches\\n * Context methods (`getFilesDir`, `getCacheDir`, `getSharedPreferences`,\\n * etc., directly or via classes that take `this` in their constructor)\\n * crashes the app at start with NullPointerException.\\n *\\n *     // ❌ DOES NOT WORK — NPE at app launch:\\n *     class MyApp : ExtentosBootstrap() {\\n *         val library = LibraryStore(this)         // LibraryStore.<init> → getFilesDir() → NPE\\n *         val prefs = getSharedPreferences(\\\"…\\\", 0) // same\\n *     }\\n *\\n *     // ✓ Use `by lazy` (first read happens after super.onCreate()):\\n *     class MyApp : ExtentosBootstrap() {\\n *         val library: LibraryStore by lazy { LibraryStore(this) }\\n *         override fun onCreate() {\\n *             super.onCreate()\\n *             library.someMethod() // ← first read; lazy initializer fires here, Context is live\\n *         }\\n *     }\\n *\\n *     // ✓ Or initialize inside onCreate(), after super.onCreate():\\n *     class MyApp : ExtentosBootstrap() {\\n *         lateinit var library: LibraryStore; private set\\n *         override fun onCreate() {\\n *             super.onCreate()\\n *             library = LibraryStore(this)\\n *         }\\n *     }\\n *\\n * The `appScope` field below works because `CoroutineScope(...)` doesn't\\n * touch `Context` at construction — keep that pattern (init objects that\\n * don't reference `this` Context) for any peer field you add.\\n */\\nopen class ExtentosBootstrap : Application() {\\n    lateinit var glasses: ExtentosGlasses\\n        private set\\n\\n    private val appScope = CoroutineScope(SupervisorJob() + Dispatchers.Main)\\n\\n    override fun onCreate() {\\n        super.onCreate()\\n        glasses = ExtentosGlasses.create(\\n            ExtentosConfig(\\n                applicationContext = this,\\n                // The Extentos project identity, decoupled from the store\\n                // applicationId. Set the SAME appId on your iOS app to share\\n                // one Extentos project even when the store bundle ids differ\\n                // (they're often locked to different values on shipped apps).\\n                appId = \\\"com.example.voicenotes\\\",\\n                debug = BuildConfig.DEBUG,\\n                usedCapabilities = setOf(\\n                    CapabilityKind.Microphone,\\n                    CapabilityKind.Speaker,\\n                ),\\n            )\\n        )\\n\\n        appScope.launch {\\n            // connect() returns an ExtentosResult — pattern-match it. Do NOT wrap\\n            // in runCatching: lifecycle ops report failure via the Err variant\\n            // (not a thrown exception), and runCatching would also swallow the\\n            // CancellationException that cancels appScope (RDQ #29).\\n            when (val result = glasses.connection.connect()) {\\n                is ExtentosResult.Ok -> Unit\\n                is ExtentosResult.Err ->\\n                    Log.e(EXTENTOS_TAG, \\\"glasses.connection.connect() failed: \\\" + result.error)\\n            }\\n        }\\n    }\\n\\n    private companion object {\\n        const val EXTENTOS_TAG = \\\"Extentos\\\"\\n    }\\n}\\n\"\n    },\n    {\n      \"path\": \"extentos.manifest.json\",\n      \"action\": \"create\",\n      \"content\": \"{\\n  \\\"manifestVersion\\\": 2,\\n  \\\"platform\\\": \\\"android\\\",\\n  \\\"glasses\\\": \\\"meta\\\",\\n  \\\"appPackage\\\": \\\"com.example.voicenotes\\\",\\n  \\\"extentos\\\": {\\n    \\\"libraryVersion\\\": \\\"2.8.0\\\",\\n    \\\"installedAt\\\": \\\"2026-11-23T04:43:05.774Z\\\",\\n    \\\"lastUpdatedAt\\\": \\\"2026-11-23T04:43:05.774Z\\\"\\n  },\\n  \\\"generatedFiles\\\": [\\n    {\\n      \\\"path\\\": \\\"app/src/main/java/com/example/voicenotes/extentos/ExtentosBootstrap.kt\\\",\\n      \\\"template\\\": \\\"connection_module\\\",\\n      \\\"hash\\\": \\\"sha256:352722c48adfb39eb4f39a8cc495061e4f48522ba520e04a807b7a803f7b6ebe\\\",\\n      \\\"generatedAt\\\": \\\"2026-11-23T04:43:05.774Z\\\",\\n      \\\"generatedByTool\\\": \\\"generateConnectionModule\\\"\\n    }\\n  ],\\n  \\\"permissions\\\": [\\n    \\\"android.permission.FOREGROUND_SERVICE\\\",\\n    \\\"android.permission.FOREGROUND_SERVICE_MICROPHONE\\\",\\n    \\\"android.permission.INTERNET\\\",\\n    \\\"android.permission.RECORD_AUDIO\\\"\\n  ],\\n  \\\"capabilities\\\": [\\n    \\\"transcription_incremental\\\",\\n    \\\"speak\\\"\\n  ],\\n  \\\"handlerNames\\\": [],\\n  \\\"gradle\\\": {\\n    \\\"coordinate\\\": \\\"com.extentos:glasses:2.8.0\\\",\\n    \\\"buildFile\\\": \\\"app/build.gradle.kts\\\",\\n    \\\"additionalArtifacts\\\": [\\n      {\\n        \\\"coordinate\\\": \\\"com.extentos:glasses-ui:2.8.0\\\",\\n        \\\"configuration\\\": \\\"implementation\\\"\\n      }\\n    ],\\n    \\\"minimumAgpVersion\\\": \\\"8.6.0\\\",\\n    \\\"minimumGradleVersion\\\": \\\"8.7\\\"\\n  }\\n}\"\n    }\n  ],\n  \"manifest\": {\n    \"path\": \"extentos.manifest.json\",\n    \"content\": {\n      \"manifestVersion\": 2,\n      \"platform\": \"android\",\n      \"glasses\": \"meta\",\n      \"appPackage\": \"com.example.voicenotes\",\n      \"extentos\": {\n        \"libraryVersion\": \"2.8.0\",\n        \"installedAt\": \"2026-11-23T04:43:05.774Z\",\n        \"lastUpdatedAt\": \"2026-11-23T04:43:05.774Z\"\n      },\n      \"generatedFiles\": [\n        {\n          \"path\": \"app/src/main/java/com/example/voicenotes/extentos/ExtentosBootstrap.kt\",\n          \"template\": \"connection_module\",\n          \"hash\": \"sha256:352722c48adfb39eb4f39a8cc495061e4f48522ba520e04a807b7a803f7b6ebe\",\n          \"generatedAt\": \"2026-11-23T04:43:05.774Z\",\n          \"generatedByTool\": \"generateConnectionModule\"\n        }\n      ],\n      \"permissions\": [\n        \"android.permission.FOREGROUND_SERVICE\",\n        \"android.permission.FOREGROUND_SERVICE_MICROPHONE\",\n        \"android.permission.INTERNET\",\n        \"android.permission.RECORD_AUDIO\"\n      ],\n      \"capabilities\": [\n        \"transcription_incremental\",\n        \"speak\"\n      ],\n      \"handlerNames\": [],\n      \"gradle\": {\n        \"coordinate\": \"com.extentos:glasses:2.8.0\",\n        \"buildFile\": \"app/build.gradle.kts\",\n        \"additionalArtifacts\": [\n          {\n            \"coordinate\": \"com.extentos:glasses-ui:2.8.0\",\n            \"configuration\": \"implementation\"\n          }\n        ],\n        \"minimumAgpVersion\": \"8.6.0\",\n        \"minimumGradleVersion\": \"8.7\"\n      }\n    }\n  },\n  \"dependencies\": [\n    {\n      \"notation\": \"com.extentos:glasses:2.8.0\",\n      \"configuration\": \"implementation\"\n    },\n    {\n      \"notation\": \"com.extentos:glasses-ui:2.8.0\",\n      \"configuration\": \"implementation\"\n    }\n  ],\n  \"repositories\": [],\n  \"buildConfigFields\": [\n    {\n      \"type\": \"String\",\n      \"name\": \"EXTENTOS_SESSION_URL\",\n      \"placeholder\": \"null\",\n      \"appliedIn\": \"app/build.gradle.kts\",\n      \"purpose\": \"Defaults to null. The library reads it via reflection at startup; when null the library falls through to pending-mode and auto-binds to whatever session createSimulatorSession provisions (no rebuild between sessions). createSimulatorSession only emits a URL-bake snippet that overwrites this value when auto-bind is impossible (cellular phone, cloud-hosted agent) — in that fallback case, replace null with the quoted URL it returns.\",\n      \"requires\": \"android.buildFeatures.buildConfig = true\"\n    }\n  ],\n  \"androidManifestAdditions\": {\n    \"metaData\": [],\n    \"note\": \"No Meta <meta-data> to add — this app is voice-only. metaData is empty and no credentials file is emitted, because the microphone and speaker are reached through the phone's own Bluetooth audio routing with no vendor SDK in the path. Add camera or display later and re-run this tool; the entries and the file appear then.\"\n  },\n  \"permissions\": [\n    \"android.permission.FOREGROUND_SERVICE\",\n    \"android.permission.FOREGROUND_SERVICE_MICROPHONE\",\n    \"android.permission.INTERNET\",\n    \"android.permission.RECORD_AUDIO\"\n  ],\n  \"placement\": \"headless\",\n  \"suggestedRendering\": \"// headless — do not render ExtentosConnectionPage; bootstrap connects in background\",\n  \"placementGuidance\": {\n    \"chosen\": \"headless\",\n    \"optionsSummary\": [\n      {\n        \"id\": \"dedicated_route\",\n        \"label\": \"Dedicated route (e.g. 'connection' or 'glasses')\"\n      },\n      {\n        \"id\": \"settings_subscreen\",\n        \"label\": \"Subscreen inside Settings\"\n      },\n      {\n        \"id\": \"bottom_tab\",\n        \"label\": \"Bottom-nav tab\"\n      },\n      {\n        \"id\": \"modal_sheet\",\n        \"label\": \"Modal bottom sheet from a Settings row\"\n      },\n      {\n        \"id\": \"headless\",\n        \"label\": \"No UI (headless) — glasses run in background only\"\n      }\n    ],\n    \"snippetsResourceLink\": {\n      \"uri\": \"extentos://docs/connection_ui_placement\",\n      \"mimeType\": \"text/markdown\",\n      \"description\": \"Full Compose / SwiftUI snippets for each placement option (dedicated_route, settings_subscreen, bottom_tab, modal_sheet, headless). Fetch via searchDocs(topic: \\\"connection_ui_placement\\\").\"\n    }\n  },\n  \"developerInstructions\": \"Step 0 (F-R3-8, DEVICE PATH ONLY — skip it entirely for a voice-only app): if this is a fresh dev environment AND your footprint includes camera or display, run `npx -p @extentos/mcp-server extentos-mcp setup` from the project root before applying anything else — it validates GitHub Packages auth + repo wiring and surfaces the precise fix when something's missing. Catches the most common build-time blocker (transitive Meta DAT artifacts requiring a PAT) before the first 1-3 minute build cycle. A voice-only app has no vendor dependency, so there is no PAT and no credentialed repository to validate and nothing here applies — see `wireInstructions`, which already says so and which this step used to contradict in the same payload. Step 1: Apply the files[], dependencies[], repositories[], buildConfigFields[], and permissions[] outputs. Check each files[] entry's `action` field: `create` entries are written to disk verbatim; a `manual_patch` entry is ENGLISH INSTRUCTIONS for editing the customer's own file at that path — read it and apply it surgically, never write its content to disk (see searchDocs topic 'file_actions'). kotlinx-coroutines-android is a transitive dependency of com.extentos:glasses — no need to add it explicitly. Step 2: Set the Application class to ExtentosBootstrap in AndroidManifest.xml (`android:name=\\\".extentos.ExtentosBootstrap\\\"`). Step 3: Headless — no navigation surface. No navigation-compose dep needed. Step 4: Headless — do NOT render ExtentosConnectionPage. The bootstrap connects in the background. Optionally read glasses.connection.state for a status badge. Step 5: Write your handler class(es). **For voice-AI work, the canonical path is Phase 4 `glasses.assistant.start(provider) { tool(name, description) { body -> ToolResult } }`** — the model owns wake/turn-taking/intent/confirmation; you write tool bodies that act on app state. See `getCodeExample(pattern: \\\"assistant_agent_loop\\\")` for the full scaffold (wake/sleep state machine, onWake greeting via session.say(), sleepAfterSilence, model-driven endOnIntent, barge-in). Wake mechanism is the developer's choice: voice phrase via `glasses.voice.onPhrase(\\\"hey x\\\") { session.wake() }` (canonical), a button tap, a hardware gesture, or any other trigger that calls `session.wake()`. The OpenAI provider runs on the Extentos managed gateway — no API key in the app, and no way to supply one: the assistant is gateway-only. If you want to use your own provider key, call that provider directly from your own code — that is just your app making an HTTP request, and `getCodeExample(pattern: \\\"byok_anthropic\\\")` shows the shape. It has nothing to do with the assistant, and the dashboard Credentials section is for META DAT credentials, which is a different thing again.  For non-AI wake-phrase-only flows (no LLM, simple voice triggers), `glasses.voice.onPhrase(phrase, label, stops) { handler }` is the direct path — same substring-matching + structured-concurrency `stops` semantics as before; phrases auto-appear on the connection page and the simulator's right-rail click-to-fire panel. For other primitives, subscribe directly: `glasses.camera.capturePhoto()`, `glasses.audio.recordDiscrete()`, `glasses.camera.videoFrames()`, etc. `getCodeExample(pattern)` returns full compositions; `getCapabilityGuide(feature)` covers per-primitive call shape + gotchas.  **The Phase 3 `glasses.conversation.onWake { listen() / speak() / ai.complete() }` runtime was REMOVED on Android in 1.4.0** — historical migration reference only. Step 6: Declare the SDK capabilities your handler uses by passing `capabilities` to generateConnectionModule (e.g. [\\\"capture_photo\\\", \\\"voice_command\\\", \\\"speak\\\", \\\"display\\\"]) — the scaffold writes them into the manifest AND emits `ExtentosConfig.usedCapabilities`, so the connection page shows one tile per capability, lit per the connected glasses. Re-run if the set changes (the bootstrap is regenerated). Step 6b: Call `getPermissions({ capabilities, platform: \\\"android\\\" })` and apply the returned `android.manifestEntries` to AndroidManifest.xml. The initial scaffold only declares BLUETOOTH_CONNECT/SCAN + INTERNET; capabilities like capture_photo / record_audio / video_frames imply additional permissions (CAMERA, RECORD_AUDIO, FOREGROUND_SERVICE, FOREGROUND_SERVICE_MICROPHONE) that this step derives. Step 6c (DEVICE PATH, real Ray-Ban hardware / release only — a voice-only scaffold emits NEITHER of these artifacts, so skip this entirely): Apply the Meta DAT credentials — write the emitted `app/src/main/res/values/extentos_meta_credentials.xml` (files[]) and add the two `androidManifestAdditions.metaData` <meta-data> entries inside <application>. Check `files[]` and `androidManifestAdditions.metaData` in YOUR payload first: on the voice path the file is absent and metaData is `[]`, and this step does not apply. Auto-filled from your dashboard Credentials section when available (see `credentialInjection`); otherwise replace REPLACE_ME with your Meta Developer Center DAT config. The simulator + emulator dev need neither — skip until you flash a build onto real glasses. Step 7: Call `validate",
              "type": "result"
            },
            "tool": "generateConnectionModule"
          }
        ],
        "task": "t1",
        "turns": 3
      },
      {
        "end": "answered",
        "final_cut": false,
        "final_text": "## Android voice-only bootstrap\n\nI called the scaffold generator for `com.example.voicenotes` with `transcription_incremental` and `speak`, and checked the resulting Android permissions. The tool returned file contents; **it did not write them to a project**. The response was truncated after part of the integration manifest, so the build changes below include only values visible in the returned output.\n\nThis is the **voice-only path**: glasses audio uses the phone’s Bluetooth audio routing. No Meta DAT registration, vendor credentials, connection page, or pairing flow is required for these capabilities.\n\n### 1. Bootstrap\n\nThe generator returned this bootstrap at:\n\n`app/src/main/java/com/example/voicenotes/extentos/ExtentosBootstrap.kt`\n\nThe following is its executable code, with the generated explanatory comments shortened:\n\n```kotlin\n// EXTENTOS-GENERATED — do not edit manually. Regenerate via generateConnectionModule.\npackage com.example.voicenotes.extentos\n\nimport android.app.Application\nimport android.util.Log\nimport com.example.voicenotes.BuildConfig\nimport com.extentos.glasses.core.CapabilityKind\nimport com.extentos.glasses.core.ExtentosConfig\nimport com.extentos.glasses.core.ExtentosGlasses\nimport com.extentos.glasses.core.ExtentosResult\nimport kotlinx.coroutines.CoroutineScope\nimport kotlinx.coroutines.Dispatchers\nimport kotlinx.coroutines.SupervisorJob\nimport kotlinx.coroutines.launch\n\nopen class ExtentosBootstrap : Application() {\n    lateinit var glasses: ExtentosGlasses\n        private set\n\n    private val appScope = CoroutineScope(SupervisorJob() + Dispatchers.Main)\n\n    override fun onCreate() {\n        super.onCreate()\n        glasses = ExtentosGlasses.create(\n            ExtentosConfig(\n                applicationContext = this,\n                appId = \"com.example.voicenotes\",\n                debug = BuildConfig.DEBUG,\n                usedCapabilities = setOf(\n                    CapabilityKind.Microphone,\n                    CapabilityKind.Speaker,\n                ),\n            )\n        )\n\n        appScope.launch {\n            when (val result = glasses.connection.connect()) {\n                is ExtentosResult.Ok -> Unit\n                is ExtentosResult.Err ->\n                    Log.e(EXTENTOS_TAG, \"glasses.connection.connect() failed: \" + result.error)\n            }\n        }\n    }\n\n    private companion object {\n        const val EXTENTOS_TAG = \"Extentos\"\n    }\n}\n```\n\nRegister it in the app manifest:\n\n```xml\n<application\n    android:name=\".extentos.ExtentosBootstrap\"\n    ... >\n    ...\n</application>\n```\n\nAccess the SDK instance from an Activity or handler through:\n\n```kotlin\nval glasses = (application as ExtentosBootstrap).glasses\n```\n\nThe bootstrap initializes the SDK; it does **not** implement voice-note storage, transcription collection, or speech playback.\n\n### 2. Generated build configuration\n\nThe returned integration manifest specifies:\n\n```kotlin\n// app/build.gradle.kts\ndependencies {\n    implementation(\"com.extentos:glasses:2.8.0\")\n    implementation(\"com.extentos:glasses-ui:2.8.0\")\n}\n```\n\n| Setting | Tool result |\n|---|---:|\n| Extentos SDK | `2.8.0` |\n| Minimum Android Gradle Plugin | `8.6.0` |\n| Minimum Gradle | `8.7` |\n| Minimum SDK | `31` |\n| Compile SDK | `35` |\n| Target SDK | `34` |\n\nThe permissions tool also reports that `EXTENTOS_PROJECT_KEY` belongs in `defaultConfig` as a `BuildConfig` field and must be minted by the scaffold generator. **The returned portion did not include a key or its generated build patch**, so I cannot provide a working value here. A manually invented value is not a substitute.\n\n### 3. Android permissions\n\nAdd the returned entries under `<manifest>` in `app/src/main/AndroidManifest.xml`:\n\n```xml\n<uses-permission android:name=\"android.permission.FOREGROUND_SERVICE\" />\n<uses-permission android:name=\"android.permission.FOREGROUND_SERVICE_MICROPHONE\" />\n<uses-permission android:name=\"android.permission.INTERNET\" />\n<uses-permission android:name=\"android.permission.RECORD_AUDIO\" />\n```\n\n**Request `RECORD_AUDIO` at runtime from an Activity** before subscribing to transcription or starting microphone capture. A manifest declaration alone is insufficient. Do not start capture from `Application.onCreate()`.\n\nFor capture that must survive backgrounding, the SDK supplies a microphone foreground-service declaration through manifest merging. Start it from an Activity **after** microphone permission is granted:\n\n```kotlin\nGlassesForegroundService.start(\n    context,\n    title = \"Voice Notes\",\n    text = \"Listening for voice notes\"\n)\n\n// On teardown:\nGlassesForegroundService.stop(context)\n```\n\nForeground-only capture can skip starting the service. The permissions tool also reports SDK-declared Bluetooth permissions and audio-settings permission in the merged manifest; it says the SDK requests the dangerous Bluetooth permissions when needed.\n\n### 4. Integration manifest\n\nThe generator also returned `extentos.manifest.json`. Its substantive configuration is:\n\n```json\n{\n  \"manifestVersion\": 2,\n  \"platform\": \"android\",\n  \"glasses\": \"meta\",\n  \"appPackage\": \"com.example.voicenotes\",\n  \"extentos\": {\n    \"libraryVersion\": \"2.8.0\"\n  },\n  \"permissions\": [\n    \"android.permission.FOREGROUND_SERVICE\",\n    \"android.permission.FOREGROUND_SERVICE_MICROPHONE\",\n    \"android.permission.INTERNET\",\n    \"android.permission.RECORD_AUDIO\"\n  ],\n  \"capabilities\": [\n    \"transcription_incremental\",\n    \"speak\"\n  ],\n  \"handlerNames\": [],\n  \"gradle\": {\n    \"coordinate\": \"com.extentos:glasses:2.8.0\",\n    \"buildFile\": \"app/build.gradle.kts\",\n    \"additionalArtifacts\": [\n      {\n        \"coordinate\": \"com.extentos:glasses-ui:2.8.0\",\n        \"configuration\": \"implementation\"\n      }\n    ],\n    \"minimumAgpVersion\": \"8.6.0\",\n    \"minimumGradleVersion\": \"8.7\"\n  }\n}\n```\n\nThis excerpt omits the generator’s timestamps and generated-file hash metadata. The returned scaffold still needs to be applied to an Android project, supplied with its generated project-key build configuration, and validated before running.",
        "round": 2,
        "steps": [
          {
            "arguments": {
              "appPackage": "com.example.voicenotes",
              "capabilities": [
                "transcription_incremental",
                "speak"
              ],
              "glasses": "meta",
              "platform": "android",
              "responseFormat": "detailed"
            },
            "reply": {
              "cut": true,
              "is_error": false,
              "text": "{\n  \"files\": [\n    {\n      \"path\": \"app/src/main/java/com/example/voicenotes/extentos/ExtentosBootstrap.kt\",\n      \"action\": \"create\",\n      \"content\": \"// EXTENTOS-GENERATED — do not edit manually. Regenerate via generateConnectionModule.\\npackage com.example.voicenotes.extentos\\n\\nimport android.app.Application\\nimport android.util.Log\\nimport com.example.voicenotes.BuildConfig\\nimport com.extentos.glasses.core.CapabilityKind\\nimport com.extentos.glasses.core.ExtentosConfig\\nimport com.extentos.glasses.core.ExtentosGlasses\\nimport com.extentos.glasses.core.ExtentosResult\\nimport kotlinx.coroutines.CoroutineScope\\nimport kotlinx.coroutines.Dispatchers\\nimport kotlinx.coroutines.SupervisorJob\\nimport kotlinx.coroutines.launch\\n\\n/**\\n * Application subclass that instantiates the Extentos SDK and opens the\\n * transport on app start. Reference `(application as ExtentosBootstrap).glasses`\\n * from your Activity / Composable / Handler classes to subscribe to SDK\\n * primitives.\\n *\\n * Declared `open` so customer code can subclass this when it needs to run\\n * additional init logic in Application.onCreate() — e.g. a connection-state\\n * observer or DI wiring. Pattern:\\n *\\n *     class MyApp : ExtentosBootstrap() {\\n *         override fun onCreate() {\\n *             super.onCreate()         // wires `glasses` first\\n *             // ⚠️ Do NOT start a mic/camera capture handler here. Subscribing to\\n *             // glasses.audio.transcriptions() / recordDiscrete() / audioChunks()\\n *             // (or starting the foreground service) needs the RECORD_AUDIO runtime\\n *             // permission — NOT granted at Application start, so it throws\\n *             // SecurityException and the app dies before the first Activity draws.\\n *             // Start capture handlers from an Activity AFTER the permission-grant\\n *             // callback (see getPermissions + getProductionChecklist).\\n *         }\\n *     }\\n *\\n * If you subclass, set `android:name` in AndroidManifest.xml to your\\n * subclass (e.g. `.MyApp`) instead of `.extentos.ExtentosBootstrap`.\\n * If you don't need extra init, leave the manifest pointing at this class.\\n *\\n * ── ⚠️ Field-init constraint ──────────────────────────────────────────\\n * Top-level property initializers on Application subclasses run BEFORE\\n * `attachBaseContext` wires the Context, so any field-init that touches\\n * Context methods (`getFilesDir`, `getCacheDir`, `getSharedPreferences`,\\n * etc., directly or via classes that take `this` in their constructor)\\n * crashes the app at start with NullPointerException.\\n *\\n *     // ❌ DOES NOT WORK — NPE at app launch:\\n *     class MyApp : ExtentosBootstrap() {\\n *         val library = LibraryStore(this)         // LibraryStore.<init> → getFilesDir() → NPE\\n *         val prefs = getSharedPreferences(\\\"…\\\", 0) // same\\n *     }\\n *\\n *     // ✓ Use `by lazy` (first read happens after super.onCreate()):\\n *     class MyApp : ExtentosBootstrap() {\\n *         val library: LibraryStore by lazy { LibraryStore(this) }\\n *         override fun onCreate() {\\n *             super.onCreate()\\n *             library.someMethod() // ← first read; lazy initializer fires here, Context is live\\n *         }\\n *     }\\n *\\n *     // ✓ Or initialize inside onCreate(), after super.onCreate():\\n *     class MyApp : ExtentosBootstrap() {\\n *         lateinit var library: LibraryStore; private set\\n *         override fun onCreate() {\\n *             super.onCreate()\\n *             library = LibraryStore(this)\\n *         }\\n *     }\\n *\\n * The `appScope` field below works because `CoroutineScope(...)` doesn't\\n * touch `Context` at construction — keep that pattern (init objects that\\n * don't reference `this` Context) for any peer field you add.\\n */\\nopen class ExtentosBootstrap : Application() {\\n    lateinit var glasses: ExtentosGlasses\\n        private set\\n\\n    private val appScope = CoroutineScope(SupervisorJob() + Dispatchers.Main)\\n\\n    override fun onCreate() {\\n        super.onCreate()\\n        glasses = ExtentosGlasses.create(\\n            ExtentosConfig(\\n                applicationContext = this,\\n                // The Extentos project identity, decoupled from the store\\n                // applicationId. Set the SAME appId on your iOS app to share\\n                // one Extentos project even when the store bundle ids differ\\n                // (they're often locked to different values on shipped apps).\\n                appId = \\\"com.example.voicenotes\\\",\\n                debug = BuildConfig.DEBUG,\\n                usedCapabilities = setOf(\\n                    CapabilityKind.Microphone,\\n                    CapabilityKind.Speaker,\\n                ),\\n            )\\n        )\\n\\n        appScope.launch {\\n            // connect() returns an ExtentosResult — pattern-match it. Do NOT wrap\\n            // in runCatching: lifecycle ops report failure via the Err variant\\n            // (not a thrown exception), and runCatching would also swallow the\\n            // CancellationException that cancels appScope (RDQ #29).\\n            when (val result = glasses.connection.connect()) {\\n                is ExtentosResult.Ok -> Unit\\n                is ExtentosResult.Err ->\\n                    Log.e(EXTENTOS_TAG, \\\"glasses.connection.connect() failed: \\\" + result.error)\\n            }\\n        }\\n    }\\n\\n    private companion object {\\n        const val EXTENTOS_TAG = \\\"Extentos\\\"\\n    }\\n}\\n\"\n    },\n    {\n      \"path\": \"extentos.manifest.json\",\n      \"action\": \"create\",\n      \"content\": \"{\\n  \\\"manifestVersion\\\": 2,\\n  \\\"platform\\\": \\\"android\\\",\\n  \\\"glasses\\\": \\\"meta\\\",\\n  \\\"appPackage\\\": \\\"com.example.voicenotes\\\",\\n  \\\"extentos\\\": {\\n    \\\"libraryVersion\\\": \\\"2.8.0\\\",\\n    \\\"installedAt\\\": \\\"2026-11-23T04:43:33.382Z\\\",\\n    \\\"lastUpdatedAt\\\": \\\"2026-11-23T04:43:33.382Z\\\"\\n  },\\n  \\\"generatedFiles\\\": [\\n    {\\n      \\\"path\\\": \\\"app/src/main/java/com/example/voicenotes/extentos/ExtentosBootstrap.kt\\\",\\n      \\\"template\\\": \\\"connection_module\\\",\\n      \\\"hash\\\": \\\"sha256:352722c48adfb39eb4f39a8cc495061e4f48522ba520e04a807b7a803f7b6ebe\\\",\\n      \\\"generatedAt\\\": \\\"2026-11-23T04:43:33.382Z\\\",\\n      \\\"generatedByTool\\\": \\\"generateConnectionModule\\\"\\n    }\\n  ],\\n  \\\"permissions\\\": [\\n    \\\"android.permission.FOREGROUND_SERVICE\\\",\\n    \\\"android.permission.FOREGROUND_SERVICE_MICROPHONE\\\",\\n    \\\"android.permission.INTERNET\\\",\\n    \\\"android.permission.RECORD_AUDIO\\\"\\n  ],\\n  \\\"capabilities\\\": [\\n    \\\"transcription_incremental\\\",\\n    \\\"speak\\\"\\n  ],\\n  \\\"handlerNames\\\": [],\\n  \\\"gradle\\\": {\\n    \\\"coordinate\\\": \\\"com.extentos:glasses:2.8.0\\\",\\n    \\\"buildFile\\\": \\\"app/build.gradle.kts\\\",\\n    \\\"additionalArtifacts\\\": [\\n      {\\n        \\\"coordinate\\\": \\\"com.extentos:glasses-ui:2.8.0\\\",\\n        \\\"configuration\\\": \\\"implementation\\\"\\n      }\\n    ],\\n    \\\"minimumAgpVersion\\\": \\\"8.6.0\\\",\\n    \\\"minimumGradleVersion\\\": \\\"8.7\\\"\\n  }\\n}\"\n    }\n  ],\n  \"manifest\": {\n    \"path\": \"extentos.manifest.json\",\n    \"content\": {\n      \"manifestVersion\": 2,\n      \"platform\": \"android\",\n      \"glasses\": \"meta\",\n      \"appPackage\": \"com.example.voicenotes\",\n      \"extentos\": {\n        \"libraryVersion\": \"2.8.0\",\n        \"installedAt\": \"2026-11-23T04:43:33.382Z\",\n        \"lastUpdatedAt\": \"2026-11-23T04:43:33.382Z\"\n      },\n      \"generatedFiles\": [\n        {\n          \"path\": \"app/src/main/java/com/example/voicenotes/extentos/ExtentosBootstrap.kt\",\n          \"template\": \"connection_module\",\n          \"hash\": \"sha256:352722c48adfb39eb4f39a8cc495061e4f48522ba520e04a807b7a803f7b6ebe\",\n          \"generatedAt\": \"2026-11-23T04:43:33.382Z\",\n          \"generatedByTool\": \"generateConnectionModule\"\n        }\n      ],\n      \"permissions\": [\n        \"android.permission.FOREGROUND_SERVICE\",\n        \"android.permission.FOREGROUND_SERVICE_MICROPHONE\",\n        \"android.permission.INTERNET\",\n        \"android.permission.RECORD_AUDIO\"\n      ],\n      \"capabilities\": [\n        \"transcription_incremental\",\n        \"speak\"\n      ],\n      \"handlerNames\": [],\n      \"gradle\": {\n        \"coordinate\": \"com.extentos:glasses:2.8.0\",\n        \"buildFile\": \"app/build.gradle.kts\",\n        \"additionalArtifacts\": [\n          {\n            \"coordinate\": \"com.extentos:glasses-ui:2.8.0\",\n            \"configuration\": \"implementation\"\n          }\n        ],\n        \"minimumAgpVersion\": \"8.6.0\",\n        \"minimumGradleVersion\": \"8.7\"\n      }\n    }\n  },\n  \"dependencies\": [\n    {\n      \"notation\": \"com.extentos:glasses:2.8.0\",\n      \"configuration\": \"implementation\"\n    },\n    {\n      \"notation\": \"com.extentos:glasses-ui:2.8.0\",\n      \"configuration\": \"implementation\"\n    }\n  ],\n  \"repositories\": [],\n  \"buildConfigFields\": [\n    {\n      \"type\": \"String\",\n      \"name\": \"EXTENTOS_SESSION_URL\",\n      \"placeholder\": \"null\",\n      \"appliedIn\": \"app/build.gradle.kts\",\n      \"purpose\": \"Defaults to null. The library reads it via reflection at startup; when null the library falls through to pending-mode and auto-binds to whatever session createSimulatorSession provisions (no rebuild between sessions). createSimulatorSession only emits a URL-bake snippet that overwrites this value when auto-bind is impossible (cellular phone, cloud-hosted agent) — in that fallback case, replace null with the quoted URL it returns.\",\n      \"requires\": \"android.buildFeatures.buildConfig = true\"\n    }\n  ],\n  \"androidManifestAdditions\": {\n    \"metaData\": [],\n    \"note\": \"No Meta <meta-data> to add — this app is voice-only. metaData is empty and no credentials file is emitted, because the microphone and speaker are reached through the phone's own Bluetooth audio routing with no vendor SDK in the path. Add camera or display later and re-run this tool; the entries and the file appear then.\"\n  },\n  \"permissions\": [\n    \"android.permission.FOREGROUND_SERVICE\",\n    \"android.permission.FOREGROUND_SERVICE_MICROPHONE\",\n    \"android.permission.INTERNET\",\n    \"android.permission.RECORD_AUDIO\"\n  ],\n  \"placement\": \"headless\",\n  \"suggestedRendering\": \"// headless — do not render ExtentosConnectionPage; bootstrap connects in background\",\n  \"placementGuidance\": {\n    \"chosen\": \"headless\",\n    \"optionsSummary\": [\n      {\n        \"id\": \"dedicated_route\",\n        \"label\": \"Dedicated route (e.g. 'connection' or 'glasses')\"\n      },\n      {\n        \"id\": \"settings_subscreen\",\n        \"label\": \"Subscreen inside Settings\"\n      },\n      {\n        \"id\": \"bottom_tab\",\n        \"label\": \"Bottom-nav tab\"\n      },\n      {\n        \"id\": \"modal_sheet\",\n        \"label\": \"Modal bottom sheet from a Settings row\"\n      },\n      {\n        \"id\": \"headless\",\n        \"label\": \"No UI (headless) — glasses run in background only\"\n      }\n    ],\n    \"snippetsResourceLink\": {\n      \"uri\": \"extentos://docs/connection_ui_placement\",\n      \"mimeType\": \"text/markdown\",\n      \"description\": \"Full Compose / SwiftUI snippets for each placement option (dedicated_route, settings_subscreen, bottom_tab, modal_sheet, headless). Fetch via searchDocs(topic: \\\"connection_ui_placement\\\").\"\n    }\n  },\n  \"developerInstructions\": \"Step 0 (F-R3-8, DEVICE PATH ONLY — skip it entirely for a voice-only app): if this is a fresh dev environment AND your footprint includes camera or display, run `npx -p @extentos/mcp-server extentos-mcp setup` from the project root before applying anything else — it validates GitHub Packages auth + repo wiring and surfaces the precise fix when something's missing. Catches the most common build-time blocker (transitive Meta DAT artifacts requiring a PAT) before the first 1-3 minute build cycle. A voice-only app has no vendor dependency, so there is no PAT and no credentialed repository to validate and nothing here applies — see `wireInstructions`, which already says so and which this step used to contradict in the same payload. Step 1: Apply the files[], dependencies[], repositories[], buildConfigFields[], and permissions[] outputs. Check each files[] entry's `action` field: `create` entries are written to disk verbatim; a `manual_patch` entry is ENGLISH INSTRUCTIONS for editing the customer's own file at that path — read it and apply it surgically, never write its content to disk (see searchDocs topic 'file_actions'). kotlinx-coroutines-android is a transitive dependency of com.extentos:glasses — no need to add it explicitly. Step 2: Set the Application class to ExtentosBootstrap in AndroidManifest.xml (`android:name=\\\".extentos.ExtentosBootstrap\\\"`). Step 3: Headless — no navigation surface. No navigation-compose dep needed. Step 4: Headless — do NOT render ExtentosConnectionPage. The bootstrap connects in the background. Optionally read glasses.connection.state for a status badge. Step 5: Write your handler class(es). **For voice-AI work, the canonical path is Phase 4 `glasses.assistant.start(provider) { tool(name, description) { body -> ToolResult } }`** — the model owns wake/turn-taking/intent/confirmation; you write tool bodies that act on app state. See `getCodeExample(pattern: \\\"assistant_agent_loop\\\")` for the full scaffold (wake/sleep state machine, onWake greeting via session.say(), sleepAfterSilence, model-driven endOnIntent, barge-in). Wake mechanism is the developer's choice: voice phrase via `glasses.voice.onPhrase(\\\"hey x\\\") { session.wake() }` (canonical), a button tap, a hardware gesture, or any other trigger that calls `session.wake()`. The OpenAI provider runs on the Extentos managed gateway — no API key in the app, and no way to supply one: the assistant is gateway-only. If you want to use your own provider key, call that provider directly from your own code — that is just your app making an HTTP request, and `getCodeExample(pattern: \\\"byok_anthropic\\\")` shows the shape. It has nothing to do with the assistant, and the dashboard Credentials section is for META DAT credentials, which is a different thing again.  For non-AI wake-phrase-only flows (no LLM, simple voice triggers), `glasses.voice.onPhrase(phrase, label, stops) { handler }` is the direct path — same substring-matching + structured-concurrency `stops` semantics as before; phrases auto-appear on the connection page and the simulator's right-rail click-to-fire panel. For other primitives, subscribe directly: `glasses.camera.capturePhoto()`, `glasses.audio.recordDiscrete()`, `glasses.camera.videoFrames()`, etc. `getCodeExample(pattern)` returns full compositions; `getCapabilityGuide(feature)` covers per-primitive call shape + gotchas.  **The Phase 3 `glasses.conversation.onWake { listen() / speak() / ai.complete() }` runtime was REMOVED on Android in 1.4.0** — historical migration reference only. Step 6: Declare the SDK capabilities your handler uses by passing `capabilities` to generateConnectionModule (e.g. [\\\"capture_photo\\\", \\\"voice_command\\\", \\\"speak\\\", \\\"display\\\"]) — the scaffold writes them into the manifest AND emits `ExtentosConfig.usedCapabilities`, so the connection page shows one tile per capability, lit per the connected glasses. Re-run if the set changes (the bootstrap is regenerated). Step 6b: Call `getPermissions({ capabilities, platform: \\\"android\\\" })` and apply the returned `android.manifestEntries` to AndroidManifest.xml. The initial scaffold only declares BLUETOOTH_CONNECT/SCAN + INTERNET; capabilities like capture_photo / record_audio / video_frames imply additional permissions (CAMERA, RECORD_AUDIO, FOREGROUND_SERVICE, FOREGROUND_SERVICE_MICROPHONE) that this step derives. Step 6c (DEVICE PATH, real Ray-Ban hardware / release only — a voice-only scaffold emits NEITHER of these artifacts, so skip this entirely): Apply the Meta DAT credentials — write the emitted `app/src/main/res/values/extentos_meta_credentials.xml` (files[]) and add the two `androidManifestAdditions.metaData` <meta-data> entries inside <application>. Check `files[]` and `androidManifestAdditions.metaData` in YOUR payload first: on the voice path the file is absent and metaData is `[]`, and this step does not apply. Auto-filled from your dashboard Credentials section when available (see `credentialInjection`); otherwise replace REPLACE_ME with your Meta Developer Center DAT config. The simulator + emulator dev need neither — skip until you flash a build onto real glasses. Step 7: Call `validate",
              "type": "result"
            },
            "tool": "generateConnectionModule"
          },
          {
            "arguments": {
              "capabilities": [
                "transcription_incremental",
                "speak"
              ],
              "platform": "android"
            },
            "reply": {
              "cut": false,
              "is_error": false,
              "text": "{\n  \"android\": {\n    \"permissions\": [\n      \"android.permission.FOREGROUND_SERVICE\",\n      \"android.permission.FOREGROUND_SERVICE_MICROPHONE\",\n      \"android.permission.INTERNET\",\n      \"android.permission.RECORD_AUDIO\"\n    ],\n    \"manifestEntries\": [\n      \"<uses-permission android:name=\\\"android.permission.FOREGROUND_SERVICE\\\" />\",\n      \"<uses-permission android:name=\\\"android.permission.FOREGROUND_SERVICE_MICROPHONE\\\" />\",\n      \"<uses-permission android:name=\\\"android.permission.INTERNET\\\" />\",\n      \"<uses-permission android:name=\\\"android.permission.RECORD_AUDIO\\\" />\"\n    ],\n    \"foregroundService\": {\n      \"required\": true,\n      \"types\": [\n        \"microphone\"\n      ],\n      \"declaration\": \"<!-- F-R4-11: glasses-core's AndroidManifest declares\\n     com.extentos.glasses.core.service.GlassesForegroundService with\\n     foregroundServiceType=\\\"microphone\\\". You inherit it via manifest-merger —\\n     no <service> entry needed in your AndroidManifest.xml. Start the service\\n     from an Activity AFTER RECORD_AUDIO is granted at runtime:\\n        GlassesForegroundService.start(context)                       // defaults\\n        GlassesForegroundService.start(context, title = \\\"MyApp\\\",\\n                                       text = \\\"Listening for voice commands\\\")\\n        GlassesForegroundService.stop(context)                        // on teardown\\n     Foreground-only apps can skip starting it entirely. -->\",\n      \"devInstructions\": \"F-R4-11: glasses-core's AndroidManifest already declares `com.extentos.glasses.core.service.GlassesForegroundService` with `foregroundServiceType=\\\"microphone\\\"` — you inherit it via manifest-merger, so you do NOT need to add a <service> entry to your AndroidManifest.xml.\\n\\nStart the library service with one call:\\n\\n  GlassesForegroundService.start(context)                      // defaults\\n  GlassesForegroundService.start(context, title = \\\"MyApp\\\",\\n                                 text = \\\"Listening for voice commands\\\")\\n  GlassesForegroundService.stop(context)                       // on teardown\\n\\n**Timing (Android 14 / targetSdk 34+) — F-R4-12.** DO NOT start the service from `Application.onCreate`. The OS requires `RECORD_AUDIO` to be **granted by the user** before `startForeground(..., FOREGROUND_SERVICE_TYPE_MICROPHONE)` runs; otherwise it throws `SecurityException` at service-create time and kills the app before the first Activity draws. Start the service from an Activity (or a ViewModel scoped to one) inside the permission-grant callback returned by `ActivityResultContracts.RequestMultiplePermissions`, OR check `ContextCompat.checkSelfPermission(this, Manifest.permission.RECORD_AUDIO) == PackageManager.PERMISSION_GRANTED` first.\\n\\nThis service is only needed for **background-surviving** capture (screen off / user pressed home). Foreground-only apps can skip starting it entirely; Android's foreground-while-visible exemption covers the mic / camera access. validateIntegration's `background_execution_declared` check signals which path you're on.\"\n    },\n    \"notificationListener\": {\n      \"required\": false,\n      \"declaration\": null,\n      \"devInstructions\": null\n    },\n    \"minimumSdk\": 31,\n    \"compileSdk\": 35,\n    \"targetSdk\": 34\n  },\n  \"ios\": {\n    \"plistKeys\": [\n      {\n        \"key\": \"NSMicrophoneUsageDescription\",\n        \"value\": \"Used to capture audio from your glasses for voice commands.\",\n        \"reason\": \"record_audio / capture_video_with_audio / voice_command / wake_word / push_to_talk / audio_chunks / transcription_incremental / outgoing_audio_stream.\"\n      },\n      {\n        \"key\": \"NSSpeechRecognitionUsageDescription\",\n        \"value\": \"Used to transcribe voice commands from your glasses.\",\n        \"reason\": \"voice_command / wake_word / push_to_talk / record_audio / transcription_incremental / audio_chunks.\"\n      }\n    ]\n  },\n  \"metaDat\": {\n    \"scopes\": [],\n    \"registrationRequired\": false,\n    \"registrationSteps\": [\n      \"Create an app in the Meta Wearables Developer Center (https://wearables.developer.meta.com/).\",\n      \"Enable the Meta Wearables Developer Access Toolkit (DAT) product.\",\n      \"Add your Android package / iOS bundle ID to the app settings.\",\n      \"Copy the Meta App ID and Client Token into the platform config that generateConnectionModule emits: on Android app/src/main/res/values/extentos_meta_credentials.xml plus the two AndroidManifest.xml <meta-data> entries; on iOS the MWDAT dict in Info.plist. NOT extentos.manifest.json — that file has no field for them and never has (the schema carries none), which this step used to claim as an MVP shortcut long after the shortcut was gone. They are per-developer secrets: never commit them.\"\n    ]\n  },\n  \"runtimeGrants\": {\n    \"grants\": [\n      {\n        \"permission\": \"android.permission.RECORD_AUDIO\",\n        \"requestedBy\": \"app\",\n        \"call\": \"ActivityResultContracts.RequestMultiplePermissions() from an Activity\",\n        \"ifMissing\": \"Capture yields nothing, and on targetSdk 34+ starting the microphone foreground service before the grant throws SecurityException at service-create time.\"\n      },\n      {\n        \"permission\": \"android.permission.BLUETOOTH_CONNECT (declared by the SDK)\",\n        \"requestedBy\": \"sdk\",\n        \"ifMissing\": \"Nothing for you to do — com.extentos:glasses declares it and requests it at runtime when it first needs the device. Listed because it lands in YOUR merged manifest and is a dangerous permission, so it must appear in your Play data-safety answers even though you never wrote it.\"\n      },\n      {\n        \"permission\": \"android.permission.BLUETOOTH_SCAN (declared by the SDK)\",\n        \"requestedBy\": \"sdk\",\n        \"ifMissing\": \"Same as BLUETOOTH_CONNECT — SDK-declared, SDK-requested, dangerous, and yours to disclose. Add android:usesPermissionFlags=\\\"neverForLocation\\\" in your manifest if you want to avoid the location-inference disclosure.\"\n      },\n      {\n        \"permission\": \"android.permission.MODIFY_AUDIO_SETTINGS (declared by the SDK)\",\n        \"requestedBy\": \"sdk\",\n        \"ifMissing\": \"Nothing to do — normal-protection, so it is granted at install with no prompt. It is what lets the SDK route the glasses mic and speaker over Bluetooth SCO/HFP; without it Android denies setMode/startBluetoothSco and an awake assistant hears silence.\"\n      }\n    ],\n    \"note\": \"Manifest entries alone are not enough: the OS grants nothing until the app asks at runtime. Entries marked requestedBy:\\\"app\\\" are YOUR call to make, before starting the assistant or any capture.\"\n  },\n  \"integrationConfig\": [\n    {\n      \"key\": \"EXTENTOS_PROJECT_KEY\",\n      \"where\": \"app/build.gradle.kts — buildConfigField(\\\"String\\\", \\\"EXTENTOS_PROJECT_KEY\\\", …) inside defaultConfig\",\n      \"source\": \"generateConnectionModule mints it, bound to your Extentos account, and writes it into the build. It is the ONLY source — there is no dashboard field to copy it from and no format you can construct by hand. It mints one even for a voice-only app that emits no connection page.\",\n      \"ifMissing\": \"No build error, on either platform. A BROWSER-SIMULATOR session keeps working, because it authenticates with its own backend-minted token — note this is about the transport, not about where the app runs: an app pinned to a non-sim transport uses the baked key even when running in the platform simulator, so it fails there too. Real hardware and every shipped build fail at runtime with AssistantError.NoApiKey, and the usage never appears in your dashboard, so billing and analytics read as silently empty.\"\n    }\n  ],\n  \"summary\": \"Android: 4 permissions (min SDK 31, target 34). Foreground service needed IF capture must survive backgrounding (types: microphone); a foreground-only app can skip it. Meta DAT registration not required (0 scopes). 1 runtime grant the APP must request: android.permission.RECORD_AUDIO. 1 Extentos config value the build must ALSO carry: EXTENTOS_PROJECT_KEY — minted by generateConnectionModule, which is the only source and is required even for a voice-only app.\"\n}",
              "type": "result"
            },
            "tool": "getPermissions"
          },
          {
            "arguments": {
              "appPackage": "com.example.voicenotes",
              "capabilities": [
                "transcription_incremental",
                "speak"
              ],
              "glasses": "meta",
              "platform": "android",
              "responseFormat": "concise"
            },
            "reply": {
              "cut": true,
              "is_error": false,
              "text": "{\n  \"files\": [\n    {\n      \"path\": \"app/src/main/java/com/example/voicenotes/extentos/ExtentosBootstrap.kt\",\n      \"action\": \"create\",\n      \"content\": \"// EXTENTOS-GENERATED — do not edit manually. Regenerate via generateConnectionModule.\\npackage com.example.voicenotes.extentos\\n\\nimport android.app.Application\\nimport android.util.Log\\nimport com.example.voicenotes.BuildConfig\\nimport com.extentos.glasses.core.CapabilityKind\\nimport com.extentos.glasses.core.ExtentosConfig\\nimport com.extentos.glasses.core.ExtentosGlasses\\nimport com.extentos.glasses.core.ExtentosResult\\nimport kotlinx.coroutines.CoroutineScope\\nimport kotlinx.coroutines.Dispatchers\\nimport kotlinx.coroutines.SupervisorJob\\nimport kotlinx.coroutines.launch\\n\\n/**\\n * Application subclass that instantiates the Extentos SDK and opens the\\n * transport on app start. Reference `(application as ExtentosBootstrap).glasses`\\n * from your Activity / Composable / Handler classes to subscribe to SDK\\n * primitives.\\n *\\n * Declared `open` so customer code can subclass this when it needs to run\\n * additional init logic in Application.onCreate() — e.g. a connection-state\\n * observer or DI wiring. Pattern:\\n *\\n *     class MyApp : ExtentosBootstrap() {\\n *         override fun onCreate() {\\n *             super.onCreate()         // wires `glasses` first\\n *             // ⚠️ Do NOT start a mic/camera capture handler here. Subscribing to\\n *             // glasses.audio.transcriptions() / recordDiscrete() / audioChunks()\\n *             // (or starting the foreground service) needs the RECORD_AUDIO runtime\\n *             // permission — NOT granted at Application start, so it throws\\n *             // SecurityException and the app dies before the first Activity draws.\\n *             // Start capture handlers from an Activity AFTER the permission-grant\\n *             // callback (see getPermissions + getProductionChecklist).\\n *         }\\n *     }\\n *\\n * If you subclass, set `android:name` in AndroidManifest.xml to your\\n * subclass (e.g. `.MyApp`) instead of `.extentos.ExtentosBootstrap`.\\n * If you don't need extra init, leave the manifest pointing at this class.\\n *\\n * ── ⚠️ Field-init constraint ──────────────────────────────────────────\\n * Top-level property initializers on Application subclasses run BEFORE\\n * `attachBaseContext` wires the Context, so any field-init that touches\\n * Context methods (`getFilesDir`, `getCacheDir`, `getSharedPreferences`,\\n * etc., directly or via classes that take `this` in their constructor)\\n * crashes the app at start with NullPointerException.\\n *\\n *     // ❌ DOES NOT WORK — NPE at app launch:\\n *     class MyApp : ExtentosBootstrap() {\\n *         val library = LibraryStore(this)         // LibraryStore.<init> → getFilesDir() → NPE\\n *         val prefs = getSharedPreferences(\\\"…\\\", 0) // same\\n *     }\\n *\\n *     // ✓ Use `by lazy` (first read happens after super.onCreate()):\\n *     class MyApp : ExtentosBootstrap() {\\n *         val library: LibraryStore by lazy { LibraryStore(this) }\\n *         override fun onCreate() {\\n *             super.onCreate()\\n *             library.someMethod() // ← first read; lazy initializer fires here, Context is live\\n *         }\\n *     }\\n *\\n *     // ✓ Or initialize inside onCreate(), after super.onCreate():\\n *     class MyApp : ExtentosBootstrap() {\\n *         lateinit var library: LibraryStore; private set\\n *         override fun onCreate() {\\n *             super.onCreate()\\n *             library = LibraryStore(this)\\n *         }\\n *     }\\n *\\n * The `appScope` field below works because `CoroutineScope(...)` doesn't\\n * touch `Context` at construction — keep that pattern (init objects that\\n * don't reference `this` Context) for any peer field you add.\\n */\\nopen class ExtentosBootstrap : Application() {\\n    lateinit var glasses: ExtentosGlasses\\n        private set\\n\\n    private val appScope = CoroutineScope(SupervisorJob() + Dispatchers.Main)\\n\\n    override fun onCreate() {\\n        super.onCreate()\\n        glasses = ExtentosGlasses.create(\\n            ExtentosConfig(\\n                applicationContext = this,\\n                // The Extentos project identity, decoupled from the store\\n                // applicationId. Set the SAME appId on your iOS app to share\\n                // one Extentos project even when the store bundle ids differ\\n                // (they're often locked to different values on shipped apps).\\n                appId = \\\"com.example.voicenotes\\\",\\n                debug = BuildConfig.DEBUG,\\n                usedCapabilities = setOf(\\n                    CapabilityKind.Microphone,\\n                    CapabilityKind.Speaker,\\n                ),\\n            )\\n        )\\n\\n        appScope.launch {\\n            // connect() returns an ExtentosResult — pattern-match it. Do NOT wrap\\n            // in runCatching: lifecycle ops report failure via the Err variant\\n            // (not a thrown exception), and runCatching would also swallow the\\n            // CancellationException that cancels appScope (RDQ #29).\\n            when (val result = glasses.connection.connect()) {\\n                is ExtentosResult.Ok -> Unit\\n                is ExtentosResult.Err ->\\n                    Log.e(EXTENTOS_TAG, \\\"glasses.connection.connect() failed: \\\" + result.error)\\n            }\\n        }\\n    }\\n\\n    private companion object {\\n        const val EXTENTOS_TAG = \\\"Extentos\\\"\\n    }\\n}\\n\"\n    },\n    {\n      \"path\": \"extentos.manifest.json\",\n      \"action\": \"create\",\n      \"content\": \"{\\n  \\\"manifestVersion\\\": 2,\\n  \\\"platform\\\": \\\"android\\\",\\n  \\\"glasses\\\": \\\"meta\\\",\\n  \\\"appPackage\\\": \\\"com.example.voicenotes\\\",\\n  \\\"extentos\\\": {\\n    \\\"libraryVersion\\\": \\\"2.8.0\\\",\\n    \\\"installedAt\\\": \\\"2026-11-23T04:43:36.128Z\\\",\\n    \\\"lastUpdatedAt\\\": \\\"2026-11-23T04:43:36.128Z\\\"\\n  },\\n  \\\"generatedFiles\\\": [\\n    {\\n      \\\"path\\\": \\\"app/src/main/java/com/example/voicenotes/extentos/ExtentosBootstrap.kt\\\",\\n      \\\"template\\\": \\\"connection_module\\\",\\n      \\\"hash\\\": \\\"sha256:352722c48adfb39eb4f39a8cc495061e4f48522ba520e04a807b7a803f7b6ebe\\\",\\n      \\\"generatedAt\\\": \\\"2026-11-23T04:43:36.128Z\\\",\\n      \\\"generatedByTool\\\": \\\"generateConnectionModule\\\"\\n    }\\n  ],\\n  \\\"permissions\\\": [\\n    \\\"android.permission.FOREGROUND_SERVICE\\\",\\n    \\\"android.permission.FOREGROUND_SERVICE_MICROPHONE\\\",\\n    \\\"android.permission.INTERNET\\\",\\n    \\\"android.permission.RECORD_AUDIO\\\"\\n  ],\\n  \\\"capabilities\\\": [\\n    \\\"transcription_incremental\\\",\\n    \\\"speak\\\"\\n  ],\\n  \\\"handlerNames\\\": [],\\n  \\\"gradle\\\": {\\n    \\\"coordinate\\\": \\\"com.extentos:glasses:2.8.0\\\",\\n    \\\"buildFile\\\": \\\"app/build.gradle.kts\\\",\\n    \\\"additionalArtifacts\\\": [\\n      {\\n        \\\"coordinate\\\": \\\"com.extentos:glasses-ui:2.8.0\\\",\\n        \\\"configuration\\\": \\\"implementation\\\"\\n      }\\n    ],\\n    \\\"minimumAgpVersion\\\": \\\"8.6.0\\\",\\n    \\\"minimumGradleVersion\\\": \\\"8.7\\\"\\n  }\\n}\"\n    }\n  ],\n  \"manifest\": {\n    \"path\": \"extentos.manifest.json\",\n    \"content\": {\n      \"manifestVersion\": 2,\n      \"platform\": \"android\",\n      \"glasses\": \"meta\",\n      \"appPackage\": \"com.example.voicenotes\",\n      \"extentos\": {\n        \"libraryVersion\": \"2.8.0\",\n        \"installedAt\": \"2026-11-23T04:43:36.128Z\",\n        \"lastUpdatedAt\": \"2026-11-23T04:43:36.128Z\"\n      },\n      \"generatedFiles\": [\n        {\n          \"path\": \"app/src/main/java/com/example/voicenotes/extentos/ExtentosBootstrap.kt\",\n          \"template\": \"connection_module\",\n          \"hash\": \"sha256:352722c48adfb39eb4f39a8cc495061e4f48522ba520e04a807b7a803f7b6ebe\",\n          \"generatedAt\": \"2026-11-23T04:43:36.128Z\",\n          \"generatedByTool\": \"generateConnectionModule\"\n        }\n      ],\n      \"permissions\": [\n        \"android.permission.FOREGROUND_SERVICE\",\n        \"android.permission.FOREGROUND_SERVICE_MICROPHONE\",\n        \"android.permission.INTERNET\",\n        \"android.permission.RECORD_AUDIO\"\n      ],\n      \"capabilities\": [\n        \"transcription_incremental\",\n        \"speak\"\n      ],\n      \"handlerNames\": [],\n      \"gradle\": {\n        \"coordinate\": \"com.extentos:glasses:2.8.0\",\n        \"buildFile\": \"app/build.gradle.kts\",\n        \"additionalArtifacts\": [\n          {\n            \"coordinate\": \"com.extentos:glasses-ui:2.8.0\",\n            \"configuration\": \"implementation\"\n          }\n        ],\n        \"minimumAgpVersion\": \"8.6.0\",\n        \"minimumGradleVersion\": \"8.7\"\n      }\n    }\n  },\n  \"dependencies\": [\n    {\n      \"notation\": \"com.extentos:glasses:2.8.0\",\n      \"configuration\": \"implementation\"\n    },\n    {\n      \"notation\": \"com.extentos:glasses-ui:2.8.0\",\n      \"configuration\": \"implementation\"\n    }\n  ],\n  \"repositories\": [],\n  \"buildConfigFields\": [\n    {\n      \"type\": \"String\",\n      \"name\": \"EXTENTOS_SESSION_URL\",\n      \"placeholder\": \"null\",\n      \"appliedIn\": \"app/build.gradle.kts\",\n      \"purpose\": \"Defaults to null. The library reads it via reflection at startup; when null the library falls through to pending-mode and auto-binds to whatever session createSimulatorSession provisions (no rebuild between sessions). createSimulatorSession only emits a URL-bake snippet that overwrites this value when auto-bind is impossible (cellular phone, cloud-hosted agent) — in that fallback case, replace null with the quoted URL it returns.\",\n      \"requires\": \"android.buildFeatures.buildConfig = true\"\n    }\n  ],\n  \"androidManifestAdditions\": {\n    \"metaData\": [],\n    \"note\": \"No Meta <meta-data> to add — this app is voice-only. metaData is empty and no credentials file is emitted, because the microphone and speaker are reached through the phone's own Bluetooth audio routing with no vendor SDK in the path. Add camera or display later and re-run this tool; the entries and the file appear then.\"\n  },\n  \"permissions\": [\n    \"android.permission.FOREGROUND_SERVICE\",\n    \"android.permission.FOREGROUND_SERVICE_MICROPHONE\",\n    \"android.permission.INTERNET\",\n    \"android.permission.RECORD_AUDIO\"\n  ],\n  \"placement\": \"headless\",\n  \"suggestedRendering\": \"// headless — do not render ExtentosConnectionPage; bootstrap connects in background\",\n  \"placementGuidance\": {\n    \"chosen\": \"headless\",\n    \"optionsSummary\": [\n      {\n        \"id\": \"dedicated_route\",\n        \"label\": \"Dedicated route (e.g. 'connection' or 'glasses')\"\n      },\n      {\n        \"id\": \"settings_subscreen\",\n        \"label\": \"Subscreen inside Settings\"\n      },\n      {\n        \"id\": \"bottom_tab\",\n        \"label\": \"Bottom-nav tab\"\n      },\n      {\n        \"id\": \"modal_sheet\",\n        \"label\": \"Modal bottom sheet from a Settings row\"\n      },\n      {\n        \"id\": \"headless\",\n        \"label\": \"No UI (headless) — glasses run in background only\"\n      }\n    ],\n    \"snippetsResourceLink\": {\n      \"uri\": \"extentos://docs/connection_ui_placement\",\n      \"mimeType\": \"text/markdown\",\n      \"description\": \"Full Compose / SwiftUI snippets for each placement option (dedicated_route, settings_subscreen, bottom_tab, modal_sheet, headless). Fetch via searchDocs(topic: \\\"connection_ui_placement\\\").\"\n    }\n  },\n  \"developerInstructions\": \"Step 0 (F-R3-8, DEVICE PATH ONLY — skip it entirely for a voice-only app): if this is a fresh dev environment AND your footprint includes camera or display, run `npx -p @extentos/mcp-server extentos-mcp setup` from the project root before applying anything else — it validates GitHub Packages auth + repo wiring and surfaces the precise fix when something's missing. Catches the most common build-time blocker (transitive Meta DAT artifacts requiring a PAT) before the first 1-3 minute build cycle. A voice-only app has no vendor dependency, so there is no PAT and no credentialed repository to validate and nothing here applies — see `wireInstructions`, which already says so and which this step used to contradict in the same payload. Step 1: Apply the files[], dependencies[], repositories[], buildConfigFields[], and permissions[] outputs. Check each files[] entry's `action` field: `create` entries are written to disk verbatim; a `manual_patch` entry is ENGLISH INSTRUCTIONS for editing the customer's own file at that path — read it and apply it surgically, never write its content to disk (see searchDocs topic 'file_actions'). kotlinx-coroutines-android is a transitive dependency of com.extentos:glasses — no need to add it explicitly. Step 2: Set the Application class to ExtentosBootstrap in AndroidManifest.xml (`android:name=\\\".extentos.ExtentosBootstrap\\\"`). Step 3: Headless — no navigation surface. No navigation-compose dep needed. Step 4: Headless — do NOT render ExtentosConnectionPage. The bootstrap connects in the background. Optionally read glasses.connection.state for a status badge. Step 5: Write your handler class(es). **For voice-AI work, the canonical path is Phase 4 `glasses.assistant.start(provider) { tool(name, description) { body -> ToolResult } }`** — the model owns wake/turn-taking/intent/confirmation; you write tool bodies that act on app state. See `getCodeExample(pattern: \\\"assistant_agent_loop\\\")` for the full scaffold (wake/sleep state machine, onWake greeting via session.say(), sleepAfterSilence, model-driven endOnIntent, barge-in). Wake mechanism is the developer's choice: voice phrase via `glasses.voice.onPhrase(\\\"hey x\\\") { session.wake() }` (canonical), a button tap, a hardware gesture, or any other trigger that calls `session.wake()`. The OpenAI provider runs on the Extentos managed gateway — no API key in the app, and no way to supply one: the assistant is gateway-only. If you want to use your own provider key, call that provider directly from your own code — that is just your app making an HTTP request, and `getCodeExample(pattern: \\\"byok_anthropic\\\")` shows the shape. It has nothing to do with the assistant, and the dashboard Credentials section is for META DAT credentials, which is a different thing again.  For non-AI wake-phrase-only flows (no LLM, simple voice triggers), `glasses.voice.onPhrase(phrase, label, stops) { handler }` is the direct path — same substring-matching + structured-concurrency `stops` semantics as before; phrases auto-appear on the connection page and the simulator's right-rail click-to-fire panel. For other primitives, subscribe directly: `glasses.camera.capturePhoto()`, `glasses.audio.recordDiscrete()`, `glasses.camera.videoFrames()`, etc. `getCodeExample(pattern)` returns full compositions; `getCapabilityGuide(feature)` covers per-primitive call shape + gotchas.  **The Phase 3 `glasses.conversation.onWake { listen() / speak() / ai.complete() }` runtime was REMOVED on Android in 1.4.0** — historical migration reference only. Step 6: Declare the SDK capabilities your handler uses by passing `capabilities` to generateConnectionModule (e.g. [\\\"capture_photo\\\", \\\"voice_command\\\", \\\"speak\\\", \\\"display\\\"]) — the scaffold writes them into the manifest AND emits `ExtentosConfig.usedCapabilities`, so the connection page shows one tile per capability, lit per the connected glasses. Re-run if the set changes (the bootstrap is regenerated). Step 6b: Call `getPermissions({ capabilities, platform: \\\"android\\\" })` and apply the returned `android.manifestEntries` to AndroidManifest.xml. The initial scaffold only declares BLUETOOTH_CONNECT/SCAN + INTERNET; capabilities like capture_photo / record_audio / video_frames imply additional permissions (CAMERA, RECORD_AUDIO, FOREGROUND_SERVICE, FOREGROUND_SERVICE_MICROPHONE) that this step derives. Step 6c (DEVICE PATH, real Ray-Ban hardware / release only — a voice-only scaffold emits NEITHER of these artifacts, so skip this entirely): Apply the Meta DAT credentials — write the emitted `app/src/main/res/values/extentos_meta_credentials.xml` (files[]) and add the two `androidManifestAdditions.metaData` <meta-data> entries inside <application>. Check `files[]` and `androidManifestAdditions.metaData` in YOUR payload first: on the voice path the file is absent and metaData is `[]`, and this step does not apply. Auto-filled from your dashboard Credentials section when available (see `credentialInjection`); otherwise replace REPLACE_ME with your Meta Developer Center DAT config. The simulator + emulator dev need neither — skip until you flash a build onto real glasses. Step 7: Call `validate",
              "type": "result"
            },
            "tool": "generateConnectionModule"
          }
        ],
        "task": "t1",
        "turns": 3
      },
      {
        "end": "answered",
        "final_cut": false,
        "final_text": "## Generated Android voice-only scaffold\n\nThe generator returned a scaffold for `com.example.voicenotes` using Extentos **2.8.0**, with `transcription_incremental` and `speak`. This is the **voice-only path**: audio is routed through the phone’s Bluetooth audio connection. No Meta DAT registration, Meta credentials, or connection page is required for these capabilities.\n\nThe tool returned file contents; it did **not** write them to a project. Its response was truncated, so the complete Gradle patch and any generated project-key configuration were not visible in the result I received.\n\n### Bootstrap configuration\n\nCreate `app/src/main/java/com/example/voicenotes/extentos/ExtentosBootstrap.kt` with the generated initialization pattern:\n\n```kotlin\npackage com.example.voicenotes.extentos\n\nimport android.app.Application\nimport android.util.Log\nimport com.example.voicenotes.BuildConfig\nimport com.extentos.glasses.core.CapabilityKind\nimport com.extentos.glasses.core.ExtentosConfig\nimport com.extentos.glasses.core.ExtentosGlasses\nimport com.extentos.glasses.core.ExtentosResult\nimport kotlinx.coroutines.CoroutineScope\nimport kotlinx.coroutines.Dispatchers\nimport kotlinx.coroutines.SupervisorJob\nimport kotlinx.coroutines.launch\n\nopen class ExtentosBootstrap : Application() {\n    lateinit var glasses: ExtentosGlasses\n        private set\n\n    private val appScope = CoroutineScope(SupervisorJob() + Dispatchers.Main)\n\n    override fun onCreate() {\n        super.onCreate()\n\n        glasses = ExtentosGlasses.create(\n            ExtentosConfig(\n                applicationContext = this,\n                appId = \"com.example.voicenotes\",\n                debug = BuildConfig.DEBUG,\n                usedCapabilities = setOf(\n                    CapabilityKind.Microphone,\n                    CapabilityKind.Speaker,\n                ),\n            )\n        )\n\n        appScope.launch {\n            when (val result = glasses.connection.connect()) {\n                is ExtentosResult.Ok -> Unit\n                is ExtentosResult.Err ->\n                    Log.e(\"Extentos\", \"glasses.connection.connect() failed: ${result.error}\")\n            }\n        }\n    }\n}\n```\n\nRegister the application class in `AndroidManifest.xml`:\n\n```xml\n<application\n    android:name=\".extentos.ExtentosBootstrap\"\n    ... >\n    ...\n</application>\n```\n\nAccess the SDK instance from app code with:\n\n```kotlin\nval glasses = (application as ExtentosBootstrap).glasses\n```\n\nDo **not** start transcription or another microphone capture in `Application.onCreate()`. Request microphone permission from an Activity first, then start capture after it is granted.\n\n### Gradle and integration manifest\n\nThe generated manifest reports these dependencies and toolchain requirements:\n\n```kotlin\ndependencies {\n    implementation(\"com.extentos:glasses:2.8.0\")\n    implementation(\"com.extentos:glasses-ui:2.8.0\")\n}\n```\n\n- Minimum Android Gradle Plugin: **8.6.0**\n- Minimum Gradle: **8.7**\n- Minimum SDK: **31**; compile SDK: **35**; target SDK: **34**\n\nThe generated `extentos.manifest.json` records the Android platform, `meta` vendor, package ID, library version, generated bootstrap file and hash, the two requested capabilities, permissions, and Gradle coordinates.\n\nThe permissions tool also reports an `EXTENTOS_PROJECT_KEY` build configuration value minted by the scaffold generator. Because the generator response was truncated, I cannot confirm that a key was returned here; do not invent one. The sandbox has no account or network access, so obtaining or verifying an account-bound key may require running the generator in your authenticated development environment.\n\n### Android permissions\n\nAdd these generated entries as direct children of `<manifest>`:\n\n```xml\n<uses-permission android:name=\"android.permission.FOREGROUND_SERVICE\" />\n<uses-permission android:name=\"android.permission.FOREGROUND_SERVICE_MICROPHONE\" />\n<uses-permission android:name=\"android.permission.INTERNET\" />\n<uses-permission android:name=\"android.permission.RECORD_AUDIO\" />\n```\n\n- **Runtime grant:** The app must request `RECORD_AUDIO`, for example through `ActivityResultContracts.RequestMultiplePermissions`, before starting transcription.\n- **Background capture:** If listening must continue when the app is backgrounded or the screen is off, start `GlassesForegroundService` **after** the microphone grant, from an Activity or Activity-scoped ViewModel. The SDK supplies its service declaration through manifest merging. A foreground-only app can skip starting the service.\n- **Bluetooth:** The permissions tool reports that the SDK declares and requests `BLUETOOTH_CONNECT` and `BLUETOOTH_SCAN`, and declares `MODIFY_AUDIO_SETTINGS` for audio routing. Check the merged manifest and applicable Play disclosures.\n\nThis scaffold initializes the SDK; it does not yet implement note storage, transcription collection, or speech playback handlers.",
        "round": 3,
        "steps": [
          {
            "arguments": {
              "appPackage": "com.example.voicenotes",
              "capabilities": [
                "transcription_incremental",
                "speak"
              ],
              "glasses": "meta",
              "platform": "android",
              "responseFormat": "detailed"
            },
            "reply": {
              "cut": true,
              "is_error": false,
              "text": "{\n  \"files\": [\n    {\n      \"path\": \"app/src/main/java/com/example/voicenotes/extentos/ExtentosBootstrap.kt\",\n      \"action\": \"create\",\n      \"content\": \"// EXTENTOS-GENERATED — do not edit manually. Regenerate via generateConnectionModule.\\npackage com.example.voicenotes.extentos\\n\\nimport android.app.Application\\nimport android.util.Log\\nimport com.example.voicenotes.BuildConfig\\nimport com.extentos.glasses.core.CapabilityKind\\nimport com.extentos.glasses.core.ExtentosConfig\\nimport com.extentos.glasses.core.ExtentosGlasses\\nimport com.extentos.glasses.core.ExtentosResult\\nimport kotlinx.coroutines.CoroutineScope\\nimport kotlinx.coroutines.Dispatchers\\nimport kotlinx.coroutines.SupervisorJob\\nimport kotlinx.coroutines.launch\\n\\n/**\\n * Application subclass that instantiates the Extentos SDK and opens the\\n * transport on app start. Reference `(application as ExtentosBootstrap).glasses`\\n * from your Activity / Composable / Handler classes to subscribe to SDK\\n * primitives.\\n *\\n * Declared `open` so customer code can subclass this when it needs to run\\n * additional init logic in Application.onCreate() — e.g. a connection-state\\n * observer or DI wiring. Pattern:\\n *\\n *     class MyApp : ExtentosBootstrap() {\\n *         override fun onCreate() {\\n *             super.onCreate()         // wires `glasses` first\\n *             // ⚠️ Do NOT start a mic/camera capture handler here. Subscribing to\\n *             // glasses.audio.transcriptions() / recordDiscrete() / audioChunks()\\n *             // (or starting the foreground service) needs the RECORD_AUDIO runtime\\n *             // permission — NOT granted at Application start, so it throws\\n *             // SecurityException and the app dies before the first Activity draws.\\n *             // Start capture handlers from an Activity AFTER the permission-grant\\n *             // callback (see getPermissions + getProductionChecklist).\\n *         }\\n *     }\\n *\\n * If you subclass, set `android:name` in AndroidManifest.xml to your\\n * subclass (e.g. `.MyApp`) instead of `.extentos.ExtentosBootstrap`.\\n * If you don't need extra init, leave the manifest pointing at this class.\\n *\\n * ── ⚠️ Field-init constraint ──────────────────────────────────────────\\n * Top-level property initializers on Application subclasses run BEFORE\\n * `attachBaseContext` wires the Context, so any field-init that touches\\n * Context methods (`getFilesDir`, `getCacheDir`, `getSharedPreferences`,\\n * etc., directly or via classes that take `this` in their constructor)\\n * crashes the app at start with NullPointerException.\\n *\\n *     // ❌ DOES NOT WORK — NPE at app launch:\\n *     class MyApp : ExtentosBootstrap() {\\n *         val library = LibraryStore(this)         // LibraryStore.<init> → getFilesDir() → NPE\\n *         val prefs = getSharedPreferences(\\\"…\\\", 0) // same\\n *     }\\n *\\n *     // ✓ Use `by lazy` (first read happens after super.onCreate()):\\n *     class MyApp : ExtentosBootstrap() {\\n *         val library: LibraryStore by lazy { LibraryStore(this) }\\n *         override fun onCreate() {\\n *             super.onCreate()\\n *             library.someMethod() // ← first read; lazy initializer fires here, Context is live\\n *         }\\n *     }\\n *\\n *     // ✓ Or initialize inside onCreate(), after super.onCreate():\\n *     class MyApp : ExtentosBootstrap() {\\n *         lateinit var library: LibraryStore; private set\\n *         override fun onCreate() {\\n *             super.onCreate()\\n *             library = LibraryStore(this)\\n *         }\\n *     }\\n *\\n * The `appScope` field below works because `CoroutineScope(...)` doesn't\\n * touch `Context` at construction — keep that pattern (init objects that\\n * don't reference `this` Context) for any peer field you add.\\n */\\nopen class ExtentosBootstrap : Application() {\\n    lateinit var glasses: ExtentosGlasses\\n        private set\\n\\n    private val appScope = CoroutineScope(SupervisorJob() + Dispatchers.Main)\\n\\n    override fun onCreate() {\\n        super.onCreate()\\n        glasses = ExtentosGlasses.create(\\n            ExtentosConfig(\\n                applicationContext = this,\\n                // The Extentos project identity, decoupled from the store\\n                // applicationId. Set the SAME appId on your iOS app to share\\n                // one Extentos project even when the store bundle ids differ\\n                // (they're often locked to different values on shipped apps).\\n                appId = \\\"com.example.voicenotes\\\",\\n                debug = BuildConfig.DEBUG,\\n                usedCapabilities = setOf(\\n                    CapabilityKind.Microphone,\\n                    CapabilityKind.Speaker,\\n                ),\\n            )\\n        )\\n\\n        appScope.launch {\\n            // connect() returns an ExtentosResult — pattern-match it. Do NOT wrap\\n            // in runCatching: lifecycle ops report failure via the Err variant\\n            // (not a thrown exception), and runCatching would also swallow the\\n            // CancellationException that cancels appScope (RDQ #29).\\n            when (val result = glasses.connection.connect()) {\\n                is ExtentosResult.Ok -> Unit\\n                is ExtentosResult.Err ->\\n                    Log.e(EXTENTOS_TAG, \\\"glasses.connection.connect() failed: \\\" + result.error)\\n            }\\n        }\\n    }\\n\\n    private companion object {\\n        const val EXTENTOS_TAG = \\\"Extentos\\\"\\n    }\\n}\\n\"\n    },\n    {\n      \"path\": \"extentos.manifest.json\",\n      \"action\": \"create\",\n      \"content\": \"{\\n  \\\"manifestVersion\\\": 2,\\n  \\\"platform\\\": \\\"android\\\",\\n  \\\"glasses\\\": \\\"meta\\\",\\n  \\\"appPackage\\\": \\\"com.example.voicenotes\\\",\\n  \\\"extentos\\\": {\\n    \\\"libraryVersion\\\": \\\"2.8.0\\\",\\n    \\\"installedAt\\\": \\\"2026-11-23T04:44:07.621Z\\\",\\n    \\\"lastUpdatedAt\\\": \\\"2026-11-23T04:44:07.621Z\\\"\\n  },\\n  \\\"generatedFiles\\\": [\\n    {\\n      \\\"path\\\": \\\"app/src/main/java/com/example/voicenotes/extentos/ExtentosBootstrap.kt\\\",\\n      \\\"template\\\": \\\"connection_module\\\",\\n      \\\"hash\\\": \\\"sha256:352722c48adfb39eb4f39a8cc495061e4f48522ba520e04a807b7a803f7b6ebe\\\",\\n      \\\"generatedAt\\\": \\\"2026-11-23T04:44:07.621Z\\\",\\n      \\\"generatedByTool\\\": \\\"generateConnectionModule\\\"\\n    }\\n  ],\\n  \\\"permissions\\\": [\\n    \\\"android.permission.FOREGROUND_SERVICE\\\",\\n    \\\"android.permission.FOREGROUND_SERVICE_MICROPHONE\\\",\\n    \\\"android.permission.INTERNET\\\",\\n    \\\"android.permission.RECORD_AUDIO\\\"\\n  ],\\n  \\\"capabilities\\\": [\\n    \\\"transcription_incremental\\\",\\n    \\\"speak\\\"\\n  ],\\n  \\\"handlerNames\\\": [],\\n  \\\"gradle\\\": {\\n    \\\"coordinate\\\": \\\"com.extentos:glasses:2.8.0\\\",\\n    \\\"buildFile\\\": \\\"app/build.gradle.kts\\\",\\n    \\\"additionalArtifacts\\\": [\\n      {\\n        \\\"coordinate\\\": \\\"com.extentos:glasses-ui:2.8.0\\\",\\n        \\\"configuration\\\": \\\"implementation\\\"\\n      }\\n    ],\\n    \\\"minimumAgpVersion\\\": \\\"8.6.0\\\",\\n    \\\"minimumGradleVersion\\\": \\\"8.7\\\"\\n  }\\n}\"\n    }\n  ],\n  \"manifest\": {\n    \"path\": \"extentos.manifest.json\",\n    \"content\": {\n      \"manifestVersion\": 2,\n      \"platform\": \"android\",\n      \"glasses\": \"meta\",\n      \"appPackage\": \"com.example.voicenotes\",\n      \"extentos\": {\n        \"libraryVersion\": \"2.8.0\",\n        \"installedAt\": \"2026-11-23T04:44:07.621Z\",\n        \"lastUpdatedAt\": \"2026-11-23T04:44:07.621Z\"\n      },\n      \"generatedFiles\": [\n        {\n          \"path\": \"app/src/main/java/com/example/voicenotes/extentos/ExtentosBootstrap.kt\",\n          \"template\": \"connection_module\",\n          \"hash\": \"sha256:352722c48adfb39eb4f39a8cc495061e4f48522ba520e04a807b7a803f7b6ebe\",\n          \"generatedAt\": \"2026-11-23T04:44:07.621Z\",\n          \"generatedByTool\": \"generateConnectionModule\"\n        }\n      ],\n      \"permissions\": [\n        \"android.permission.FOREGROUND_SERVICE\",\n        \"android.permission.FOREGROUND_SERVICE_MICROPHONE\",\n        \"android.permission.INTERNET\",\n        \"android.permission.RECORD_AUDIO\"\n      ],\n      \"capabilities\": [\n        \"transcription_incremental\",\n        \"speak\"\n      ],\n      \"handlerNames\": [],\n      \"gradle\": {\n        \"coordinate\": \"com.extentos:glasses:2.8.0\",\n        \"buildFile\": \"app/build.gradle.kts\",\n        \"additionalArtifacts\": [\n          {\n            \"coordinate\": \"com.extentos:glasses-ui:2.8.0\",\n            \"configuration\": \"implementation\"\n          }\n        ],\n        \"minimumAgpVersion\": \"8.6.0\",\n        \"minimumGradleVersion\": \"8.7\"\n      }\n    }\n  },\n  \"dependencies\": [\n    {\n      \"notation\": \"com.extentos:glasses:2.8.0\",\n      \"configuration\": \"implementation\"\n    },\n    {\n      \"notation\": \"com.extentos:glasses-ui:2.8.0\",\n      \"configuration\": \"implementation\"\n    }\n  ],\n  \"repositories\": [],\n  \"buildConfigFields\": [\n    {\n      \"type\": \"String\",\n      \"name\": \"EXTENTOS_SESSION_URL\",\n      \"placeholder\": \"null\",\n      \"appliedIn\": \"app/build.gradle.kts\",\n      \"purpose\": \"Defaults to null. The library reads it via reflection at startup; when null the library falls through to pending-mode and auto-binds to whatever session createSimulatorSession provisions (no rebuild between sessions). createSimulatorSession only emits a URL-bake snippet that overwrites this value when auto-bind is impossible (cellular phone, cloud-hosted agent) — in that fallback case, replace null with the quoted URL it returns.\",\n      \"requires\": \"android.buildFeatures.buildConfig = true\"\n    }\n  ],\n  \"androidManifestAdditions\": {\n    \"metaData\": [],\n    \"note\": \"No Meta <meta-data> to add — this app is voice-only. metaData is empty and no credentials file is emitted, because the microphone and speaker are reached through the phone's own Bluetooth audio routing with no vendor SDK in the path. Add camera or display later and re-run this tool; the entries and the file appear then.\"\n  },\n  \"permissions\": [\n    \"android.permission.FOREGROUND_SERVICE\",\n    \"android.permission.FOREGROUND_SERVICE_MICROPHONE\",\n    \"android.permission.INTERNET\",\n    \"android.permission.RECORD_AUDIO\"\n  ],\n  \"placement\": \"headless\",\n  \"suggestedRendering\": \"// headless — do not render ExtentosConnectionPage; bootstrap connects in background\",\n  \"placementGuidance\": {\n    \"chosen\": \"headless\",\n    \"optionsSummary\": [\n      {\n        \"id\": \"dedicated_route\",\n        \"label\": \"Dedicated route (e.g. 'connection' or 'glasses')\"\n      },\n      {\n        \"id\": \"settings_subscreen\",\n        \"label\": \"Subscreen inside Settings\"\n      },\n      {\n        \"id\": \"bottom_tab\",\n        \"label\": \"Bottom-nav tab\"\n      },\n      {\n        \"id\": \"modal_sheet\",\n        \"label\": \"Modal bottom sheet from a Settings row\"\n      },\n      {\n        \"id\": \"headless\",\n        \"label\": \"No UI (headless) — glasses run in background only\"\n      }\n    ],\n    \"snippetsResourceLink\": {\n      \"uri\": \"extentos://docs/connection_ui_placement\",\n      \"mimeType\": \"text/markdown\",\n      \"description\": \"Full Compose / SwiftUI snippets for each placement option (dedicated_route, settings_subscreen, bottom_tab, modal_sheet, headless). Fetch via searchDocs(topic: \\\"connection_ui_placement\\\").\"\n    }\n  },\n  \"developerInstructions\": \"Step 0 (F-R3-8, DEVICE PATH ONLY — skip it entirely for a voice-only app): if this is a fresh dev environment AND your footprint includes camera or display, run `npx -p @extentos/mcp-server extentos-mcp setup` from the project root before applying anything else — it validates GitHub Packages auth + repo wiring and surfaces the precise fix when something's missing. Catches the most common build-time blocker (transitive Meta DAT artifacts requiring a PAT) before the first 1-3 minute build cycle. A voice-only app has no vendor dependency, so there is no PAT and no credentialed repository to validate and nothing here applies — see `wireInstructions`, which already says so and which this step used to contradict in the same payload. Step 1: Apply the files[], dependencies[], repositories[], buildConfigFields[], and permissions[] outputs. Check each files[] entry's `action` field: `create` entries are written to disk verbatim; a `manual_patch` entry is ENGLISH INSTRUCTIONS for editing the customer's own file at that path — read it and apply it surgically, never write its content to disk (see searchDocs topic 'file_actions'). kotlinx-coroutines-android is a transitive dependency of com.extentos:glasses — no need to add it explicitly. Step 2: Set the Application class to ExtentosBootstrap in AndroidManifest.xml (`android:name=\\\".extentos.ExtentosBootstrap\\\"`). Step 3: Headless — no navigation surface. No navigation-compose dep needed. Step 4: Headless — do NOT render ExtentosConnectionPage. The bootstrap connects in the background. Optionally read glasses.connection.state for a status badge. Step 5: Write your handler class(es). **For voice-AI work, the canonical path is Phase 4 `glasses.assistant.start(provider) { tool(name, description) { body -> ToolResult } }`** — the model owns wake/turn-taking/intent/confirmation; you write tool bodies that act on app state. See `getCodeExample(pattern: \\\"assistant_agent_loop\\\")` for the full scaffold (wake/sleep state machine, onWake greeting via session.say(), sleepAfterSilence, model-driven endOnIntent, barge-in). Wake mechanism is the developer's choice: voice phrase via `glasses.voice.onPhrase(\\\"hey x\\\") { session.wake() }` (canonical), a button tap, a hardware gesture, or any other trigger that calls `session.wake()`. The OpenAI provider runs on the Extentos managed gateway — no API key in the app, and no way to supply one: the assistant is gateway-only. If you want to use your own provider key, call that provider directly from your own code — that is just your app making an HTTP request, and `getCodeExample(pattern: \\\"byok_anthropic\\\")` shows the shape. It has nothing to do with the assistant, and the dashboard Credentials section is for META DAT credentials, which is a different thing again.  For non-AI wake-phrase-only flows (no LLM, simple voice triggers), `glasses.voice.onPhrase(phrase, label, stops) { handler }` is the direct path — same substring-matching + structured-concurrency `stops` semantics as before; phrases auto-appear on the connection page and the simulator's right-rail click-to-fire panel. For other primitives, subscribe directly: `glasses.camera.capturePhoto()`, `glasses.audio.recordDiscrete()`, `glasses.camera.videoFrames()`, etc. `getCodeExample(pattern)` returns full compositions; `getCapabilityGuide(feature)` covers per-primitive call shape + gotchas.  **The Phase 3 `glasses.conversation.onWake { listen() / speak() / ai.complete() }` runtime was REMOVED on Android in 1.4.0** — historical migration reference only. Step 6: Declare the SDK capabilities your handler uses by passing `capabilities` to generateConnectionModule (e.g. [\\\"capture_photo\\\", \\\"voice_command\\\", \\\"speak\\\", \\\"display\\\"]) — the scaffold writes them into the manifest AND emits `ExtentosConfig.usedCapabilities`, so the connection page shows one tile per capability, lit per the connected glasses. Re-run if the set changes (the bootstrap is regenerated). Step 6b: Call `getPermissions({ capabilities, platform: \\\"android\\\" })` and apply the returned `android.manifestEntries` to AndroidManifest.xml. The initial scaffold only declares BLUETOOTH_CONNECT/SCAN + INTERNET; capabilities like capture_photo / record_audio / video_frames imply additional permissions (CAMERA, RECORD_AUDIO, FOREGROUND_SERVICE, FOREGROUND_SERVICE_MICROPHONE) that this step derives. Step 6c (DEVICE PATH, real Ray-Ban hardware / release only — a voice-only scaffold emits NEITHER of these artifacts, so skip this entirely): Apply the Meta DAT credentials — write the emitted `app/src/main/res/values/extentos_meta_credentials.xml` (files[]) and add the two `androidManifestAdditions.metaData` <meta-data> entries inside <application>. Check `files[]` and `androidManifestAdditions.metaData` in YOUR payload first: on the voice path the file is absent and metaData is `[]`, and this step does not apply. Auto-filled from your dashboard Credentials section when available (see `credentialInjection`); otherwise replace REPLACE_ME with your Meta Developer Center DAT config. The simulator + emulator dev need neither — skip until you flash a build onto real glasses. Step 7: Call `validate",
              "type": "result"
            },
            "tool": "generateConnectionModule"
          },
          {
            "arguments": {
              "capabilities": [
                "transcription_incremental",
                "speak"
              ],
              "platform": "android"
            },
            "reply": {
              "cut": false,
              "is_error": false,
              "text": "{\n  \"android\": {\n    \"permissions\": [\n      \"android.permission.FOREGROUND_SERVICE\",\n      \"android.permission.FOREGROUND_SERVICE_MICROPHONE\",\n      \"android.permission.INTERNET\",\n      \"android.permission.RECORD_AUDIO\"\n    ],\n    \"manifestEntries\": [\n      \"<uses-permission android:name=\\\"android.permission.FOREGROUND_SERVICE\\\" />\",\n      \"<uses-permission android:name=\\\"android.permission.FOREGROUND_SERVICE_MICROPHONE\\\" />\",\n      \"<uses-permission android:name=\\\"android.permission.INTERNET\\\" />\",\n      \"<uses-permission android:name=\\\"android.permission.RECORD_AUDIO\\\" />\"\n    ],\n    \"foregroundService\": {\n      \"required\": true,\n      \"types\": [\n        \"microphone\"\n      ],\n      \"declaration\": \"<!-- F-R4-11: glasses-core's AndroidManifest declares\\n     com.extentos.glasses.core.service.GlassesForegroundService with\\n     foregroundServiceType=\\\"microphone\\\". You inherit it via manifest-merger —\\n     no <service> entry needed in your AndroidManifest.xml. Start the service\\n     from an Activity AFTER RECORD_AUDIO is granted at runtime:\\n        GlassesForegroundService.start(context)                       // defaults\\n        GlassesForegroundService.start(context, title = \\\"MyApp\\\",\\n                                       text = \\\"Listening for voice commands\\\")\\n        GlassesForegroundService.stop(context)                        // on teardown\\n     Foreground-only apps can skip starting it entirely. -->\",\n      \"devInstructions\": \"F-R4-11: glasses-core's AndroidManifest already declares `com.extentos.glasses.core.service.GlassesForegroundService` with `foregroundServiceType=\\\"microphone\\\"` — you inherit it via manifest-merger, so you do NOT need to add a <service> entry to your AndroidManifest.xml.\\n\\nStart the library service with one call:\\n\\n  GlassesForegroundService.start(context)                      // defaults\\n  GlassesForegroundService.start(context, title = \\\"MyApp\\\",\\n                                 text = \\\"Listening for voice commands\\\")\\n  GlassesForegroundService.stop(context)                       // on teardown\\n\\n**Timing (Android 14 / targetSdk 34+) — F-R4-12.** DO NOT start the service from `Application.onCreate`. The OS requires `RECORD_AUDIO` to be **granted by the user** before `startForeground(..., FOREGROUND_SERVICE_TYPE_MICROPHONE)` runs; otherwise it throws `SecurityException` at service-create time and kills the app before the first Activity draws. Start the service from an Activity (or a ViewModel scoped to one) inside the permission-grant callback returned by `ActivityResultContracts.RequestMultiplePermissions`, OR check `ContextCompat.checkSelfPermission(this, Manifest.permission.RECORD_AUDIO) == PackageManager.PERMISSION_GRANTED` first.\\n\\nThis service is only needed for **background-surviving** capture (screen off / user pressed home). Foreground-only apps can skip starting it entirely; Android's foreground-while-visible exemption covers the mic / camera access. validateIntegration's `background_execution_declared` check signals which path you're on.\"\n    },\n    \"notificationListener\": {\n      \"required\": false,\n      \"declaration\": null,\n      \"devInstructions\": null\n    },\n    \"minimumSdk\": 31,\n    \"compileSdk\": 35,\n    \"targetSdk\": 34\n  },\n  \"ios\": {\n    \"plistKeys\": [\n      {\n        \"key\": \"NSMicrophoneUsageDescription\",\n        \"value\": \"Used to capture audio from your glasses for voice commands.\",\n        \"reason\": \"record_audio / capture_video_with_audio / voice_command / wake_word / push_to_talk / audio_chunks / transcription_incremental / outgoing_audio_stream.\"\n      },\n      {\n        \"key\": \"NSSpeechRecognitionUsageDescription\",\n        \"value\": \"Used to transcribe voice commands from your glasses.\",\n        \"reason\": \"voice_command / wake_word / push_to_talk / record_audio / transcription_incremental / audio_chunks.\"\n      }\n    ]\n  },\n  \"metaDat\": {\n    \"scopes\": [],\n    \"registrationRequired\": false,\n    \"registrationSteps\": [\n      \"Create an app in the Meta Wearables Developer Center (https://wearables.developer.meta.com/).\",\n      \"Enable the Meta Wearables Developer Access Toolkit (DAT) product.\",\n      \"Add your Android package / iOS bundle ID to the app settings.\",\n      \"Copy the Meta App ID and Client Token into the platform config that generateConnectionModule emits: on Android app/src/main/res/values/extentos_meta_credentials.xml plus the two AndroidManifest.xml <meta-data> entries; on iOS the MWDAT dict in Info.plist. NOT extentos.manifest.json — that file has no field for them and never has (the schema carries none), which this step used to claim as an MVP shortcut long after the shortcut was gone. They are per-developer secrets: never commit them.\"\n    ]\n  },\n  \"runtimeGrants\": {\n    \"grants\": [\n      {\n        \"permission\": \"android.permission.RECORD_AUDIO\",\n        \"requestedBy\": \"app\",\n        \"call\": \"ActivityResultContracts.RequestMultiplePermissions() from an Activity\",\n        \"ifMissing\": \"Capture yields nothing, and on targetSdk 34+ starting the microphone foreground service before the grant throws SecurityException at service-create time.\"\n      },\n      {\n        \"permission\": \"android.permission.BLUETOOTH_CONNECT (declared by the SDK)\",\n        \"requestedBy\": \"sdk\",\n        \"ifMissing\": \"Nothing for you to do — com.extentos:glasses declares it and requests it at runtime when it first needs the device. Listed because it lands in YOUR merged manifest and is a dangerous permission, so it must appear in your Play data-safety answers even though you never wrote it.\"\n      },\n      {\n        \"permission\": \"android.permission.BLUETOOTH_SCAN (declared by the SDK)\",\n        \"requestedBy\": \"sdk\",\n        \"ifMissing\": \"Same as BLUETOOTH_CONNECT — SDK-declared, SDK-requested, dangerous, and yours to disclose. Add android:usesPermissionFlags=\\\"neverForLocation\\\" in your manifest if you want to avoid the location-inference disclosure.\"\n      },\n      {\n        \"permission\": \"android.permission.MODIFY_AUDIO_SETTINGS (declared by the SDK)\",\n        \"requestedBy\": \"sdk\",\n        \"ifMissing\": \"Nothing to do — normal-protection, so it is granted at install with no prompt. It is what lets the SDK route the glasses mic and speaker over Bluetooth SCO/HFP; without it Android denies setMode/startBluetoothSco and an awake assistant hears silence.\"\n      }\n    ],\n    \"note\": \"Manifest entries alone are not enough: the OS grants nothing until the app asks at runtime. Entries marked requestedBy:\\\"app\\\" are YOUR call to make, before starting the assistant or any capture.\"\n  },\n  \"integrationConfig\": [\n    {\n      \"key\": \"EXTENTOS_PROJECT_KEY\",\n      \"where\": \"app/build.gradle.kts — buildConfigField(\\\"String\\\", \\\"EXTENTOS_PROJECT_KEY\\\", …) inside defaultConfig\",\n      \"source\": \"generateConnectionModule mints it, bound to your Extentos account, and writes it into the build. It is the ONLY source — there is no dashboard field to copy it from and no format you can construct by hand. It mints one even for a voice-only app that emits no connection page.\",\n      \"ifMissing\": \"No build error, on either platform. A BROWSER-SIMULATOR session keeps working, because it authenticates with its own backend-minted token — note this is about the transport, not about where the app runs: an app pinned to a non-sim transport uses the baked key even when running in the platform simulator, so it fails there too. Real hardware and every shipped build fail at runtime with AssistantError.NoApiKey, and the usage never appears in your dashboard, so billing and analytics read as silently empty.\"\n    }\n  ],\n  \"summary\": \"Android: 4 permissions (min SDK 31, target 34). Foreground service needed IF capture must survive backgrounding (types: microphone); a foreground-only app can skip it. Meta DAT registration not required (0 scopes). 1 runtime grant the APP must request: android.permission.RECORD_AUDIO. 1 Extentos config value the build must ALSO carry: EXTENTOS_PROJECT_KEY — minted by generateConnectionModule, which is the only source and is required even for a voice-only app.\"\n}",
              "type": "result"
            },
            "tool": "getPermissions"
          }
        ],
        "task": "t1",
        "turns": 3
      },
      {
        "end": "answered",
        "final_cut": false,
        "final_text": "The check found issues with all three proposed triggers: **two errors and one ambiguity warning**.\n\n| Proposed trigger | Finding |\n|---|---|\n| **“hey meta”** | **Error:** Conflicts with Meta AI’s wake word. Drop the wake word; the tool suggests using an action phrase such as “describe.” |\n| **“take a photo”** | **Error — exact collision:** Duplicates the existing trigger “take a photo.” |\n| **“start recording”** | **Warning — prefix ambiguity:** Shares the two-word prefix “start recording” with the existing “start recording video,” so speech recognition may trigger the wrong command. This is not an exact collision. |\n\nFix the two errors before wiring the triggers, and make the recording phrases more distinct.\n\nThe tool also reported that anonymous usage telemetry is enabled by default. To opt out, set `EXTENTOS_TELEMETRY=0` or run `npx @extentos/mcp-server@latest decline-privacy`.",
        "round": 1,
        "steps": [
          {
            "arguments": {
              "existingPhrases": [
                "take a photo",
                "start recording video"
              ],
              "phrases": [
                "hey meta",
                "take a photo",
                "start recording"
              ]
            },
            "reply": {
              "cut": false,
              "is_error": false,
              "text": "{\n  \"results\": [\n    {\n      \"phrase\": \"hey meta\",\n      \"issues\": [\n        {\n          \"severity\": \"error\",\n          \"rule\": \"meta_wake_word_overlap\",\n          \"message\": \"Phrase starts with Meta's wake word \\\"hey meta\\\" — will conflict with Meta AI. Drop the wake word.\"\n        }\n      ],\n      \"suggestions\": [\n        \"Use an action verb: \\\"describe\\\".\"\n      ],\n      \"collisions\": []\n    },\n    {\n      \"phrase\": \"take a photo\",\n      \"issues\": [\n        {\n          \"severity\": \"error\",\n          \"rule\": \"collision\",\n          \"message\": \"Exact duplicate of \\\"take a photo\\\".\"\n        }\n      ],\n      \"suggestions\": [],\n      \"collisions\": [\n        \"take a photo\"\n      ]\n    },\n    {\n      \"phrase\": \"start recording\",\n      \"issues\": [\n        {\n          \"severity\": \"warning\",\n          \"rule\": \"disambiguation\",\n          \"message\": \"Shares a 2-word prefix with \\\"start recording video\\\" — STT may trigger the wrong one.\"\n        }\n      ],\n      \"suggestions\": [],\n      \"collisions\": []\n    }\n  ],\n  \"generalGuidance\": \"Analyzed 3 phrases; 3 had issues. Errors present — fix the listed phrases before wiring them into your transcript consumer. On Meta Ray-Ban, custom phrases run through the phone STT (Android SpeechRecognizer / iOS SFSpeechRecognizer), not Meta's on-device model. Keep phrases short, distinctive, and free of homophones.\",\n  \"summary\": \"Analyzed 3 phrases: 3 issues (2 errors). Fix errors before wiring these phrases.\",\n  \"privacyPolicy\": {\n    \"url\": \"https://extentos.com/privacy\",\n    \"version\": \"2026-04\",\n    \"note\": \"First call on this install — Extentos collects anonymous usage telemetry by default to improve the tool. Your installId tags telemetry events; no source code or personal data is collected. Opt out: run `npx @extentos/mcp-server@latest decline-privacy`, or set EXTENTOS_TELEMETRY=0. This note is shown once per install.\"\n  }\n}",
              "type": "result"
            },
            "tool": "getVoiceCommandGuidance"
          }
        ],
        "task": "t2",
        "turns": 2
      },
      {
        "end": "answered",
        "final_cut": false,
        "final_text": "The trigger checker found **three issues: two errors and one warning**.\n\n| Proposed trigger | Finding | Collision |\n|---|---|---|\n| **“hey meta”** | **Error:** Conflicts with Meta AI’s wake word. Drop the wake word; the tool suggests an action verb such as “describe.” | No exact duplicate reported. |\n| **“take a photo”** | **Error:** Exactly duplicates an existing trigger. | “take a photo” |\n| **“start recording”** | **Warning:** Shares a two-word prefix with an existing trigger, so speech recognition may trigger the wrong one. Choose more distinctive phrases. | No exact duplicate; ambiguous with “start recording video.” |\n\nFix the two errors before wiring the triggers. The tool also recommends keeping phrases short, distinctive, and free of homophones.\n\nThe tool reports that anonymous usage telemetry is enabled by default. You can opt out with `EXTENTOS_TELEMETRY=0` or by running `npx @extentos/mcp-server@latest decline-privacy`.",
        "round": 2,
        "steps": [
          {
            "arguments": {
              "existingPhrases": [
                "take a photo",
                "start recording video"
              ],
              "phrases": [
                "hey meta",
                "take a photo",
                "start recording"
              ]
            },
            "reply": {
              "cut": false,
              "is_error": false,
              "text": "{\n  \"results\": [\n    {\n      \"phrase\": \"hey meta\",\n      \"issues\": [\n        {\n          \"severity\": \"error\",\n          \"rule\": \"meta_wake_word_overlap\",\n          \"message\": \"Phrase starts with Meta's wake word \\\"hey meta\\\" — will conflict with Meta AI. Drop the wake word.\"\n        }\n      ],\n      \"suggestions\": [\n        \"Use an action verb: \\\"describe\\\".\"\n      ],\n      \"collisions\": []\n    },\n    {\n      \"phrase\": \"take a photo\",\n      \"issues\": [\n        {\n          \"severity\": \"error\",\n          \"rule\": \"collision\",\n          \"message\": \"Exact duplicate of \\\"take a photo\\\".\"\n        }\n      ],\n      \"suggestions\": [],\n      \"collisions\": [\n        \"take a photo\"\n      ]\n    },\n    {\n      \"phrase\": \"start recording\",\n      \"issues\": [\n        {\n          \"severity\": \"warning\",\n          \"rule\": \"disambiguation\",\n          \"message\": \"Shares a 2-word prefix with \\\"start recording video\\\" — STT may trigger the wrong one.\"\n        }\n      ],\n      \"suggestions\": [],\n      \"collisions\": []\n    }\n  ],\n  \"generalGuidance\": \"Analyzed 3 phrases; 3 had issues. Errors present — fix the listed phrases before wiring them into your transcript consumer. On Meta Ray-Ban, custom phrases run through the phone STT (Android SpeechRecognizer / iOS SFSpeechRecognizer), not Meta's on-device model. Keep phrases short, distinctive, and free of homophones.\",\n  \"summary\": \"Analyzed 3 phrases: 3 issues (2 errors). Fix errors before wiring these phrases.\",\n  \"privacyPolicy\": {\n    \"url\": \"https://extentos.com/privacy\",\n    \"version\": \"2026-04\",\n    \"note\": \"First call on this install — Extentos collects anonymous usage telemetry by default to improve the tool. Your installId tags telemetry events; no source code or personal data is collected. Opt out: run `npx @extentos/mcp-server@latest decline-privacy`, or set EXTENTOS_TELEMETRY=0. This note is shown once per install.\"\n  }\n}",
              "type": "result"
            },
            "tool": "getVoiceCommandGuidance"
          }
        ],
        "task": "t2",
        "turns": 2
      },
      {
        "end": "answered",
        "final_cut": false,
        "final_text": "The check found **three issues: two errors and one warning**.\n\n| Proposed trigger | Finding | Collision |\n|---|---|---|\n| **“hey meta”** | **Error:** Conflicts with Meta AI’s wake word. Drop the wake word and use a distinctive action phrase instead. | No exact duplicate reported. |\n| **“take a photo”** | **Error:** Already exists as a trigger. | Exact collision with **“take a photo.”** |\n| **“start recording”** | **Warning:** Shares a two-word prefix with an existing trigger, so speech recognition may trigger the wrong one. | Prefix ambiguity with **“start recording video,”** but not an exact duplicate. |\n\nFix the two errors before wiring the triggers, and choose more distinctive recording phrases to resolve the ambiguity.\n\nThe tool also reported that anonymous usage telemetry is enabled by default. To opt out, set `EXTENTOS_TELEMETRY=0` or run `npx @extentos/mcp-server@latest decline-privacy`.",
        "round": 3,
        "steps": [
          {
            "arguments": {
              "existingPhrases": [
                "take a photo",
                "start recording video"
              ],
              "phrases": [
                "hey meta",
                "take a photo",
                "start recording"
              ]
            },
            "reply": {
              "cut": false,
              "is_error": false,
              "text": "{\n  \"results\": [\n    {\n      \"phrase\": \"hey meta\",\n      \"issues\": [\n        {\n          \"severity\": \"error\",\n          \"rule\": \"meta_wake_word_overlap\",\n          \"message\": \"Phrase starts with Meta's wake word \\\"hey meta\\\" — will conflict with Meta AI. Drop the wake word.\"\n        }\n      ],\n      \"suggestions\": [\n        \"Use an action verb: \\\"describe\\\".\"\n      ],\n      \"collisions\": []\n    },\n    {\n      \"phrase\": \"take a photo\",\n      \"issues\": [\n        {\n          \"severity\": \"error\",\n          \"rule\": \"collision\",\n          \"message\": \"Exact duplicate of \\\"take a photo\\\".\"\n        }\n      ],\n      \"suggestions\": [],\n      \"collisions\": [\n        \"take a photo\"\n      ]\n    },\n    {\n      \"phrase\": \"start recording\",\n      \"issues\": [\n        {\n          \"severity\": \"warning\",\n          \"rule\": \"disambiguation\",\n          \"message\": \"Shares a 2-word prefix with \\\"start recording video\\\" — STT may trigger the wrong one.\"\n        }\n      ],\n      \"suggestions\": [],\n      \"collisions\": []\n    }\n  ],\n  \"generalGuidance\": \"Analyzed 3 phrases; 3 had issues. Errors present — fix the listed phrases before wiring them into your transcript consumer. On Meta Ray-Ban, custom phrases run through the phone STT (Android SpeechRecognizer / iOS SFSpeechRecognizer), not Meta's on-device model. Keep phrases short, distinctive, and free of homophones.\",\n  \"summary\": \"Analyzed 3 phrases: 3 issues (2 errors). Fix errors before wiring these phrases.\",\n  \"privacyPolicy\": {\n    \"url\": \"https://extentos.com/privacy\",\n    \"version\": \"2026-04\",\n    \"note\": \"First call on this install — Extentos collects anonymous usage telemetry by default to improve the tool. Your installId tags telemetry events; no source code or personal data is collected. Opt out: run `npx @extentos/mcp-server@latest decline-privacy`, or set EXTENTOS_TELEMETRY=0. This note is shown once per install.\"\n  }\n}",
              "type": "result"
            },
            "tool": "getVoiceCommandGuidance"
          }
        ],
        "task": "t2",
        "turns": 2
      },
      {
        "end": "answered",
        "final_cut": false,
        "final_text": "I checked the permissions for an iOS app using `capture_photo`, `transcription_incremental`, and `speak`.\n\n### iOS Info.plist keys\n\nAdd these to the app target, with descriptions appropriate to your app:\n\n| Key | Purpose |\n|---|---|\n| `NSBluetoothAlwaysUsageDescription` | Connect to the glasses over Bluetooth. |\n| `NSCameraUsageDescription` | Capture photos from the glasses. |\n| `NSMicrophoneUsageDescription` | Capture audio for transcription. |\n| `NSSpeechRecognitionUsageDescription` | Transcribe speech. |\n\n### Runtime grants\n\n- **Microphone — your app requests it** before starting transcription or capture. On iOS 17+:\n  ```swift\n  let granted = await AVAudioApplication.requestRecordPermission()\n  ```\n  Handle a denial before starting. Without this request, the tool warns that transcription can fail silently on hardware, even if it works in the simulator.\n- **Speech recognition — the SDK requests it** when its speech-to-text engine starts. You can call `Extentos.requestSpeechRecognitionAuthorization()` yourself if you want to control when the prompt appears.\n- **Camera — no phone-camera runtime grant for this flow.** The photo is captured by the glasses and delivered over the vendor transport; the tool says the phone camera is not opened. The plist key is still required.\n\n### Meta DAT\n\nBecause the app uses the glasses camera, the tool also returned Meta DAT scopes **`glasses.camera.photo`** and **`glasses.connection`**, with registration required. The returned setup calls for a Meta Wearables Developer Center app, the iOS bundle ID, and the Meta App ID and Client Token in the generated iOS `MWDAT` configuration.",
        "round": 1,
        "steps": [
          {
            "arguments": {
              "capabilities": [
                "capture_photo",
                "transcription_incremental",
                "speak"
              ],
              "platform": "ios"
            },
            "reply": {
              "cut": false,
              "is_error": false,
              "text": "{\n  \"android\": {\n    \"permissions\": [\n      \"android.permission.BLUETOOTH_CONNECT\",\n      \"android.permission.BLUETOOTH_SCAN\",\n      \"android.permission.CAMERA\",\n      \"android.permission.FOREGROUND_SERVICE\",\n      \"android.permission.FOREGROUND_SERVICE_MICROPHONE\",\n      \"android.permission.INTERNET\",\n      \"android.permission.RECORD_AUDIO\"\n    ],\n    \"manifestEntries\": [\n      \"<uses-permission android:name=\\\"android.permission.BLUETOOTH_CONNECT\\\" />\",\n      \"<uses-permission android:name=\\\"android.permission.BLUETOOTH_SCAN\\\" />\",\n      \"<uses-permission android:name=\\\"android.permission.CAMERA\\\" />\",\n      \"<uses-permission android:name=\\\"android.permission.FOREGROUND_SERVICE\\\" />\",\n      \"<uses-permission android:name=\\\"android.permission.FOREGROUND_SERVICE_MICROPHONE\\\" />\",\n      \"<uses-permission android:name=\\\"android.permission.INTERNET\\\" />\",\n      \"<uses-permission android:name=\\\"android.permission.RECORD_AUDIO\\\" />\"\n    ],\n    \"foregroundService\": {\n      \"required\": true,\n      \"types\": [\n        \"microphone\"\n      ],\n      \"declaration\": \"<!-- F-R4-11: glasses-core's AndroidManifest declares\\n     com.extentos.glasses.core.service.GlassesForegroundService with\\n     foregroundServiceType=\\\"microphone\\\". You inherit it via manifest-merger —\\n     no <service> entry needed in your AndroidManifest.xml. Start the service\\n     from an Activity AFTER RECORD_AUDIO is granted at runtime:\\n        GlassesForegroundService.start(context)                       // defaults\\n        GlassesForegroundService.start(context, title = \\\"MyApp\\\",\\n                                       text = \\\"Listening for voice commands\\\")\\n        GlassesForegroundService.stop(context)                        // on teardown\\n     Foreground-only apps can skip starting it entirely. -->\",\n      \"devInstructions\": \"F-R4-11: glasses-core's AndroidManifest already declares `com.extentos.glasses.core.service.GlassesForegroundService` with `foregroundServiceType=\\\"microphone\\\"` — you inherit it via manifest-merger, so you do NOT need to add a <service> entry to your AndroidManifest.xml.\\n\\nStart the library service with one call:\\n\\n  GlassesForegroundService.start(context)                      // defaults\\n  GlassesForegroundService.start(context, title = \\\"MyApp\\\",\\n                                 text = \\\"Listening for voice commands\\\")\\n  GlassesForegroundService.stop(context)                       // on teardown\\n\\n**Timing (Android 14 / targetSdk 34+) — F-R4-12.** DO NOT start the service from `Application.onCreate`. The OS requires `RECORD_AUDIO` to be **granted by the user** before `startForeground(..., FOREGROUND_SERVICE_TYPE_MICROPHONE)` runs; otherwise it throws `SecurityException` at service-create time and kills the app before the first Activity draws. Start the service from an Activity (or a ViewModel scoped to one) inside the permission-grant callback returned by `ActivityResultContracts.RequestMultiplePermissions`, OR check `ContextCompat.checkSelfPermission(this, Manifest.permission.RECORD_AUDIO) == PackageManager.PERMISSION_GRANTED` first.\\n\\nThis service is only needed for **background-surviving** capture (screen off / user pressed home). Foreground-only apps can skip starting it entirely; Android's foreground-while-visible exemption covers the mic / camera access. validateIntegration's `background_execution_declared` check signals which path you're on.\"\n    },\n    \"notificationListener\": {\n      \"required\": false,\n      \"declaration\": null,\n      \"devInstructions\": null\n    },\n    \"minimumSdk\": 31,\n    \"compileSdk\": 35,\n    \"targetSdk\": 34\n  },\n  \"ios\": {\n    \"plistKeys\": [\n      {\n        \"key\": \"NSBluetoothAlwaysUsageDescription\",\n        \"value\": \"Required to connect to your glasses over Bluetooth.\",\n        \"reason\": \"Required by Meta DAT SDK for all glasses connections.\"\n      },\n      {\n        \"key\": \"NSCameraUsageDescription\",\n        \"value\": \"Used to capture photos and video from your glasses.\",\n        \"reason\": \"capture_photo / capture_video / video_frames / outgoing_video_stream.\"\n      },\n      {\n        \"key\": \"NSMicrophoneUsageDescription\",\n        \"value\": \"Used to capture audio from your glasses for voice commands.\",\n        \"reason\": \"record_audio / capture_video_with_audio / voice_command / wake_word / push_to_talk / audio_chunks / transcription_incremental / outgoing_audio_stream.\"\n      },\n      {\n        \"key\": \"NSSpeechRecognitionUsageDescription\",\n        \"value\": \"Used to transcribe voice commands from your glasses.\",\n        \"reason\": \"voice_command / wake_word / push_to_talk / record_audio / transcription_incremental / audio_chunks.\"\n      }\n    ]\n  },\n  \"metaDat\": {\n    \"scopes\": [\n      \"glasses.camera.photo\",\n      \"glasses.connection\"\n    ],\n    \"registrationRequired\": true,\n    \"registrationSteps\": [\n      \"Create an app in the Meta Wearables Developer Center (https://wearables.developer.meta.com/).\",\n      \"Enable the Meta Wearables Developer Access Toolkit (DAT) product.\",\n      \"Add your Android package / iOS bundle ID to the app settings.\",\n      \"Copy the Meta App ID and Client Token into the platform config that generateConnectionModule emits: on Android app/src/main/res/values/extentos_meta_credentials.xml plus the two AndroidManifest.xml <meta-data> entries; on iOS the MWDAT dict in Info.plist. NOT extentos.manifest.json — that file has no field for them and never has (the schema carries none), which this step used to claim as an MVP shortcut long after the shortcut was gone. They are per-developer secrets: never commit them.\"\n    ]\n  },\n  \"runtimeGrants\": {\n    \"grants\": [\n      {\n        \"permission\": \"Microphone (AVAudioSession record permission)\",\n        \"requestedBy\": \"app\",\n        \"call\": \"await AVAudioApplication.requestRecordPermission()  // iOS 17+\",\n        \"ifMissing\": \"Silent and total: no prompt, no error, no transcripts. Wake phrases and voice commands do nothing on hardware while working in the simulator. The SDK reads this grant (SystemAudioBridge.hasMicPermission) but never requests it and never reports it.\"\n      },\n      {\n        \"permission\": \"Speech recognition (SFSpeechRecognizer)\",\n        \"requestedBy\": \"sdk\",\n        \"ifMissing\": \"Handled for you — PlatformSttEngine requests authorization when the STT engine starts. Call Extentos.requestSpeechRecognitionAuthorization() yourself only if you want to control WHEN the prompt appears.\"\n      }\n    ],\n    \"note\": \"Manifest entries alone are not enough: the OS grants nothing until the app asks at runtime. Entries marked requestedBy:\\\"app\\\" are YOUR call to make, before starting the assistant or any capture. CAMERA is deliberately absent from this list even though it is a manifest entry above: the photo is taken by the GLASSES and arrives over the vendor transport, so the phone's camera is never opened and the SDK never requests the grant. The one case where it becomes a runtime grant is a foreground service declared with `camera` type — see getProductionChecklist for that path.\"\n  },\n  \"integrationConfig\": [\n    {\n      \"key\": \"EXTENTOS_APP_ID\",\n      \"where\": \"Info.plist (app target) — but read by YOUR BOOTSTRAP, not by the SDK. The generated ExtentosBootstrap does `ExtentosConfig(appId: Bundle.main.infoDictionary?[\\\"EXTENTOS_APP_ID\\\"] as? String)`. If you write your own bootstrap you must read it yourself or pass `appId:` directly; the SDK only ever sees `config.appId`.\",\n      \"source\": \"Your Extentos project identity, reverse-DNS. You choose it and pass it to generateConnectionModule as appPackage. Deliberately decoupled from your store bundle id, and the SAME value on both platforms so one project covers both.\",\n      \"ifMissing\": \"It does NOT fail loudly. `config.appId` falls back to Bundle.main.bundleIdentifier, so the app keeps running under whatever its store bundle id happens to be. That is fine when the two match and silently wrong when they do not: dashboard Agent settings, sounds and analytics are keyed to the id you minted against, so they simply never reach the app, and cross-platform apps whose bundle ids differ split into two dashboard projects.\"\n    },\n    {\n      \"key\": \"EXTENTOSProjectKey\",\n      \"where\": \"Info.plist (app target). Keep the value in a gitignored xcconfig and reference it — but the reference resolves to nothing until a real key has been minted into it.\",\n      \"source\": \"generateConnectionModule mints it, bound to your Extentos account, and writes it into the build. It is the ONLY source — there is no dashboard field to copy it from and no format you can construct by hand. It mints one even for a voice-only app that emits no connection page.\",\n      \"ifMissing\": \"No build error, on either platform. A BROWSER-SIMULATOR session keeps working, because it authenticates with its own backend-minted token — note this is about the transport, not about where the app runs: an app pinned to a non-sim transport uses the baked key even when running in the platform simulator, so it fails there too. Real hardware and every shipped build fail at runtime with AssistantError.NoApiKey, and the usage never appears in your dashboard, so billing and analytics read as silently empty.\"\n    }\n  ],\n  \"summary\": \"iOS: 4 privacy Info.plist keys required. Meta DAT registration required (2 scopes). 1 runtime grant the APP must request: Microphone (AVAudioSession record permission). 2 Extentos config values the build must ALSO carry: EXTENTOS_APP_ID, EXTENTOSProjectKey — minted by generateConnectionModule, which is the only source and is required even for a voice-only app.\",\n  \"privacyPolicy\": {\n    \"url\": \"https://extentos.com/privacy\",\n    \"version\": \"2026-04\",\n    \"note\": \"First call on this install — Extentos collects anonymous usage telemetry by default to improve the tool. Your installId tags telemetry events; no source code or personal data is collected. Opt out: run `npx @extentos/mcp-server@latest decline-privacy`, or set EXTENTOS_TELEMETRY=0. This note is shown once per install.\"\n  }\n}",
              "type": "result"
            },
            "tool": "getPermissions"
          }
        ],
        "task": "t3",
        "turns": 2
      },
      {
        "end": "answered",
        "final_cut": false,
        "final_text": "For the iOS app using `capture_photo`, `transcription_incremental`, and `speak`, the permissions tool returned the following requirements.\n\n### Info.plist usage descriptions\n\nAdd these keys to the **app target’s** `Info.plist`, with descriptions appropriate to your app:\n\n| Key | Purpose |\n|---|---|\n| `NSBluetoothAlwaysUsageDescription` | Connect to the glasses over Bluetooth. |\n| `NSCameraUsageDescription` | Capture photos from the glasses. |\n| `NSMicrophoneUsageDescription` | Capture audio for transcription. |\n| `NSSpeechRecognitionUsageDescription` | Transcribe speech. |\n\n### Runtime grants\n\n- **Microphone — requested by your app.** Request it before starting audio capture or the assistant:\n  ```swift\n  let granted = await AVAudioApplication.requestRecordPermission() // iOS 17+\n  ```\n  The SDK does not request this grant. Without it, the tool warns that transcription can fail silently on hardware, even if it works in the simulator.\n\n- **Speech recognition — requested by the SDK** when its speech-to-text engine starts. You can call `Extentos.requestSpeechRecognitionAuthorization()` yourself if you want to control when the prompt appears.\n\n- **Phone camera — no runtime grant for glasses photo capture.** The photo is taken by the glasses and delivered over the vendor transport; the phone camera is not opened. The usage-description key is still required by the returned configuration.\n\n### Meta DAT\n\nBecause the app uses the glasses **camera**, the tool also returned Meta DAT scopes `glasses.camera.photo` and `glasses.connection`, with Meta developer registration required. The camera integration—not transcription or speech output alone—is what makes the vendor integration relevant.",
        "round": 2,
        "steps": [
          {
            "arguments": {
              "capabilities": [
                "capture_photo",
                "transcription_incremental",
                "speak"
              ],
              "platform": "ios"
            },
            "reply": {
              "cut": false,
              "is_error": false,
              "text": "{\n  \"android\": {\n    \"permissions\": [\n      \"android.permission.BLUETOOTH_CONNECT\",\n      \"android.permission.BLUETOOTH_SCAN\",\n      \"android.permission.CAMERA\",\n      \"android.permission.FOREGROUND_SERVICE\",\n      \"android.permission.FOREGROUND_SERVICE_MICROPHONE\",\n      \"android.permission.INTERNET\",\n      \"android.permission.RECORD_AUDIO\"\n    ],\n    \"manifestEntries\": [\n      \"<uses-permission android:name=\\\"android.permission.BLUETOOTH_CONNECT\\\" />\",\n      \"<uses-permission android:name=\\\"android.permission.BLUETOOTH_SCAN\\\" />\",\n      \"<uses-permission android:name=\\\"android.permission.CAMERA\\\" />\",\n      \"<uses-permission android:name=\\\"android.permission.FOREGROUND_SERVICE\\\" />\",\n      \"<uses-permission android:name=\\\"android.permission.FOREGROUND_SERVICE_MICROPHONE\\\" />\",\n      \"<uses-permission android:name=\\\"android.permission.INTERNET\\\" />\",\n      \"<uses-permission android:name=\\\"android.permission.RECORD_AUDIO\\\" />\"\n    ],\n    \"foregroundService\": {\n      \"required\": true,\n      \"types\": [\n        \"microphone\"\n      ],\n      \"declaration\": \"<!-- F-R4-11: glasses-core's AndroidManifest declares\\n     com.extentos.glasses.core.service.GlassesForegroundService with\\n     foregroundServiceType=\\\"microphone\\\". You inherit it via manifest-merger —\\n     no <service> entry needed in your AndroidManifest.xml. Start the service\\n     from an Activity AFTER RECORD_AUDIO is granted at runtime:\\n        GlassesForegroundService.start(context)                       // defaults\\n        GlassesForegroundService.start(context, title = \\\"MyApp\\\",\\n                                       text = \\\"Listening for voice commands\\\")\\n        GlassesForegroundService.stop(context)                        // on teardown\\n     Foreground-only apps can skip starting it entirely. -->\",\n      \"devInstructions\": \"F-R4-11: glasses-core's AndroidManifest already declares `com.extentos.glasses.core.service.GlassesForegroundService` with `foregroundServiceType=\\\"microphone\\\"` — you inherit it via manifest-merger, so you do NOT need to add a <service> entry to your AndroidManifest.xml.\\n\\nStart the library service with one call:\\n\\n  GlassesForegroundService.start(context)                      // defaults\\n  GlassesForegroundService.start(context, title = \\\"MyApp\\\",\\n                                 text = \\\"Listening for voice commands\\\")\\n  GlassesForegroundService.stop(context)                       // on teardown\\n\\n**Timing (Android 14 / targetSdk 34+) — F-R4-12.** DO NOT start the service from `Application.onCreate`. The OS requires `RECORD_AUDIO` to be **granted by the user** before `startForeground(..., FOREGROUND_SERVICE_TYPE_MICROPHONE)` runs; otherwise it throws `SecurityException` at service-create time and kills the app before the first Activity draws. Start the service from an Activity (or a ViewModel scoped to one) inside the permission-grant callback returned by `ActivityResultContracts.RequestMultiplePermissions`, OR check `ContextCompat.checkSelfPermission(this, Manifest.permission.RECORD_AUDIO) == PackageManager.PERMISSION_GRANTED` first.\\n\\nThis service is only needed for **background-surviving** capture (screen off / user pressed home). Foreground-only apps can skip starting it entirely; Android's foreground-while-visible exemption covers the mic / camera access. validateIntegration's `background_execution_declared` check signals which path you're on.\"\n    },\n    \"notificationListener\": {\n      \"required\": false,\n      \"declaration\": null,\n      \"devInstructions\": null\n    },\n    \"minimumSdk\": 31,\n    \"compileSdk\": 35,\n    \"targetSdk\": 34\n  },\n  \"ios\": {\n    \"plistKeys\": [\n      {\n        \"key\": \"NSBluetoothAlwaysUsageDescription\",\n        \"value\": \"Required to connect to your glasses over Bluetooth.\",\n        \"reason\": \"Required by Meta DAT SDK for all glasses connections.\"\n      },\n      {\n        \"key\": \"NSCameraUsageDescription\",\n        \"value\": \"Used to capture photos and video from your glasses.\",\n        \"reason\": \"capture_photo / capture_video / video_frames / outgoing_video_stream.\"\n      },\n      {\n        \"key\": \"NSMicrophoneUsageDescription\",\n        \"value\": \"Used to capture audio from your glasses for voice commands.\",\n        \"reason\": \"record_audio / capture_video_with_audio / voice_command / wake_word / push_to_talk / audio_chunks / transcription_incremental / outgoing_audio_stream.\"\n      },\n      {\n        \"key\": \"NSSpeechRecognitionUsageDescription\",\n        \"value\": \"Used to transcribe voice commands from your glasses.\",\n        \"reason\": \"voice_command / wake_word / push_to_talk / record_audio / transcription_incremental / audio_chunks.\"\n      }\n    ]\n  },\n  \"metaDat\": {\n    \"scopes\": [\n      \"glasses.camera.photo\",\n      \"glasses.connection\"\n    ],\n    \"registrationRequired\": true,\n    \"registrationSteps\": [\n      \"Create an app in the Meta Wearables Developer Center (https://wearables.developer.meta.com/).\",\n      \"Enable the Meta Wearables Developer Access Toolkit (DAT) product.\",\n      \"Add your Android package / iOS bundle ID to the app settings.\",\n      \"Copy the Meta App ID and Client Token into the platform config that generateConnectionModule emits: on Android app/src/main/res/values/extentos_meta_credentials.xml plus the two AndroidManifest.xml <meta-data> entries; on iOS the MWDAT dict in Info.plist. NOT extentos.manifest.json — that file has no field for them and never has (the schema carries none), which this step used to claim as an MVP shortcut long after the shortcut was gone. They are per-developer secrets: never commit them.\"\n    ]\n  },\n  \"runtimeGrants\": {\n    \"grants\": [\n      {\n        \"permission\": \"Microphone (AVAudioSession record permission)\",\n        \"requestedBy\": \"app\",\n        \"call\": \"await AVAudioApplication.requestRecordPermission()  // iOS 17+\",\n        \"ifMissing\": \"Silent and total: no prompt, no error, no transcripts. Wake phrases and voice commands do nothing on hardware while working in the simulator. The SDK reads this grant (SystemAudioBridge.hasMicPermission) but never requests it and never reports it.\"\n      },\n      {\n        \"permission\": \"Speech recognition (SFSpeechRecognizer)\",\n        \"requestedBy\": \"sdk\",\n        \"ifMissing\": \"Handled for you — PlatformSttEngine requests authorization when the STT engine starts. Call Extentos.requestSpeechRecognitionAuthorization() yourself only if you want to control WHEN the prompt appears.\"\n      }\n    ],\n    \"note\": \"Manifest entries alone are not enough: the OS grants nothing until the app asks at runtime. Entries marked requestedBy:\\\"app\\\" are YOUR call to make, before starting the assistant or any capture. CAMERA is deliberately absent from this list even though it is a manifest entry above: the photo is taken by the GLASSES and arrives over the vendor transport, so the phone's camera is never opened and the SDK never requests the grant. The one case where it becomes a runtime grant is a foreground service declared with `camera` type — see getProductionChecklist for that path.\"\n  },\n  \"integrationConfig\": [\n    {\n      \"key\": \"EXTENTOS_APP_ID\",\n      \"where\": \"Info.plist (app target) — but read by YOUR BOOTSTRAP, not by the SDK. The generated ExtentosBootstrap does `ExtentosConfig(appId: Bundle.main.infoDictionary?[\\\"EXTENTOS_APP_ID\\\"] as? String)`. If you write your own bootstrap you must read it yourself or pass `appId:` directly; the SDK only ever sees `config.appId`.\",\n      \"source\": \"Your Extentos project identity, reverse-DNS. You choose it and pass it to generateConnectionModule as appPackage. Deliberately decoupled from your store bundle id, and the SAME value on both platforms so one project covers both.\",\n      \"ifMissing\": \"It does NOT fail loudly. `config.appId` falls back to Bundle.main.bundleIdentifier, so the app keeps running under whatever its store bundle id happens to be. That is fine when the two match and silently wrong when they do not: dashboard Agent settings, sounds and analytics are keyed to the id you minted against, so they simply never reach the app, and cross-platform apps whose bundle ids differ split into two dashboard projects.\"\n    },\n    {\n      \"key\": \"EXTENTOSProjectKey\",\n      \"where\": \"Info.plist (app target). Keep the value in a gitignored xcconfig and reference it — but the reference resolves to nothing until a real key has been minted into it.\",\n      \"source\": \"generateConnectionModule mints it, bound to your Extentos account, and writes it into the build. It is the ONLY source — there is no dashboard field to copy it from and no format you can construct by hand. It mints one even for a voice-only app that emits no connection page.\",\n      \"ifMissing\": \"No build error, on either platform. A BROWSER-SIMULATOR session keeps working, because it authenticates with its own backend-minted token — note this is about the transport, not about where the app runs: an app pinned to a non-sim transport uses the baked key even when running in the platform simulator, so it fails there too. Real hardware and every shipped build fail at runtime with AssistantError.NoApiKey, and the usage never appears in your dashboard, so billing and analytics read as silently empty.\"\n    }\n  ],\n  \"summary\": \"iOS: 4 privacy Info.plist keys required. Meta DAT registration required (2 scopes). 1 runtime grant the APP must request: Microphone (AVAudioSession record permission). 2 Extentos config values the build must ALSO carry: EXTENTOS_APP_ID, EXTENTOSProjectKey — minted by generateConnectionModule, which is the only source and is required even for a voice-only app.\",\n  \"privacyPolicy\": {\n    \"url\": \"https://extentos.com/privacy\",\n    \"version\": \"2026-04\",\n    \"note\": \"First call on this install — Extentos collects anonymous usage telemetry by default to improve the tool. Your installId tags telemetry events; no source code or personal data is collected. Opt out: run `npx @extentos/mcp-server@latest decline-privacy`, or set EXTENTOS_TELEMETRY=0. This note is shown once per install.\"\n  }\n}",
              "type": "result"
            },
            "tool": "getPermissions"
          }
        ],
        "task": "t3",
        "turns": 2
      },
      {
        "end": "answered",
        "final_cut": false,
        "final_text": "For your iOS app, the permission tool returned four **Info.plist usage descriptions**:\n\n| Key | Purpose | Example description |\n|---|---|---|\n| `NSBluetoothAlwaysUsageDescription` | Connect to the glasses through Meta DAT | “Required to connect to your glasses over Bluetooth.” |\n| `NSCameraUsageDescription` | Declare photo capture | “Used to capture photos from your glasses.” |\n| `NSMicrophoneUsageDescription` | Capture audio for transcription | “Used to capture audio from your glasses for transcription.” |\n| `NSSpeechRecognitionUsageDescription` | Transcribe speech | “Used to transcribe speech from your glasses.” |\n\n### Runtime grants\n\n- **Microphone — your app must request it** before starting transcription or audio capture. On iOS 17+:\n  ```swift\n  let granted = await AVAudioApplication.requestRecordPermission()\n  ```\n  Handle denial before starting capture. The SDK does not request this grant; without it, the tool reports that hardware transcription can fail silently, even if it works in the simulator.\n\n- **Speech recognition — the SDK requests it** when its speech-to-text engine starts. You can call `Extentos.requestSpeechRecognitionAuthorization()` yourself if you want to control when the prompt appears.\n\n- **Phone camera — no runtime camera grant for glasses photo capture.** The photo is taken by the glasses and delivered over the vendor transport; the phone camera is not opened. Keep the camera usage description above.\n\n### Meta DAT\n\nBecause the app uses `capture_photo`, the tool also returned the Meta DAT scopes **`glasses.camera.photo`** and **`glasses.connection`**, with registration required. The tool’s setup guidance places Meta credentials at the real-hardware milestone; simulator development can proceed without them.",
        "round": 3,
        "steps": [
          {
            "arguments": {
              "capabilities": [
                "capture_photo",
                "transcription_incremental",
                "speak"
              ],
              "platform": "ios"
            },
            "reply": {
              "cut": false,
              "is_error": false,
              "text": "{\n  \"android\": {\n    \"permissions\": [\n      \"android.permission.BLUETOOTH_CONNECT\",\n      \"android.permission.BLUETOOTH_SCAN\",\n      \"android.permission.CAMERA\",\n      \"android.permission.FOREGROUND_SERVICE\",\n      \"android.permission.FOREGROUND_SERVICE_MICROPHONE\",\n      \"android.permission.INTERNET\",\n      \"android.permission.RECORD_AUDIO\"\n    ],\n    \"manifestEntries\": [\n      \"<uses-permission android:name=\\\"android.permission.BLUETOOTH_CONNECT\\\" />\",\n      \"<uses-permission android:name=\\\"android.permission.BLUETOOTH_SCAN\\\" />\",\n      \"<uses-permission android:name=\\\"android.permission.CAMERA\\\" />\",\n      \"<uses-permission android:name=\\\"android.permission.FOREGROUND_SERVICE\\\" />\",\n      \"<uses-permission android:name=\\\"android.permission.FOREGROUND_SERVICE_MICROPHONE\\\" />\",\n      \"<uses-permission android:name=\\\"android.permission.INTERNET\\\" />\",\n      \"<uses-permission android:name=\\\"android.permission.RECORD_AUDIO\\\" />\"\n    ],\n    \"foregroundService\": {\n      \"required\": true,\n      \"types\": [\n        \"microphone\"\n      ],\n      \"declaration\": \"<!-- F-R4-11: glasses-core's AndroidManifest declares\\n     com.extentos.glasses.core.service.GlassesForegroundService with\\n     foregroundServiceType=\\\"microphone\\\". You inherit it via manifest-merger —\\n     no <service> entry needed in your AndroidManifest.xml. Start the service\\n     from an Activity AFTER RECORD_AUDIO is granted at runtime:\\n        GlassesForegroundService.start(context)                       // defaults\\n        GlassesForegroundService.start(context, title = \\\"MyApp\\\",\\n                                       text = \\\"Listening for voice commands\\\")\\n        GlassesForegroundService.stop(context)                        // on teardown\\n     Foreground-only apps can skip starting it entirely. -->\",\n      \"devInstructions\": \"F-R4-11: glasses-core's AndroidManifest already declares `com.extentos.glasses.core.service.GlassesForegroundService` with `foregroundServiceType=\\\"microphone\\\"` — you inherit it via manifest-merger, so you do NOT need to add a <service> entry to your AndroidManifest.xml.\\n\\nStart the library service with one call:\\n\\n  GlassesForegroundService.start(context)                      // defaults\\n  GlassesForegroundService.start(context, title = \\\"MyApp\\\",\\n                                 text = \\\"Listening for voice commands\\\")\\n  GlassesForegroundService.stop(context)                       // on teardown\\n\\n**Timing (Android 14 / targetSdk 34+) — F-R4-12.** DO NOT start the service from `Application.onCreate`. The OS requires `RECORD_AUDIO` to be **granted by the user** before `startForeground(..., FOREGROUND_SERVICE_TYPE_MICROPHONE)` runs; otherwise it throws `SecurityException` at service-create time and kills the app before the first Activity draws. Start the service from an Activity (or a ViewModel scoped to one) inside the permission-grant callback returned by `ActivityResultContracts.RequestMultiplePermissions`, OR check `ContextCompat.checkSelfPermission(this, Manifest.permission.RECORD_AUDIO) == PackageManager.PERMISSION_GRANTED` first.\\n\\nThis service is only needed for **background-surviving** capture (screen off / user pressed home). Foreground-only apps can skip starting it entirely; Android's foreground-while-visible exemption covers the mic / camera access. validateIntegration's `background_execution_declared` check signals which path you're on.\"\n    },\n    \"notificationListener\": {\n      \"required\": false,\n      \"declaration\": null,\n      \"devInstructions\": null\n    },\n    \"minimumSdk\": 31,\n    \"compileSdk\": 35,\n    \"targetSdk\": 34\n  },\n  \"ios\": {\n    \"plistKeys\": [\n      {\n        \"key\": \"NSBluetoothAlwaysUsageDescription\",\n        \"value\": \"Required to connect to your glasses over Bluetooth.\",\n        \"reason\": \"Required by Meta DAT SDK for all glasses connections.\"\n      },\n      {\n        \"key\": \"NSCameraUsageDescription\",\n        \"value\": \"Used to capture photos and video from your glasses.\",\n        \"reason\": \"capture_photo / capture_video / video_frames / outgoing_video_stream.\"\n      },\n      {\n        \"key\": \"NSMicrophoneUsageDescription\",\n        \"value\": \"Used to capture audio from your glasses for voice commands.\",\n        \"reason\": \"record_audio / capture_video_with_audio / voice_command / wake_word / push_to_talk / audio_chunks / transcription_incremental / outgoing_audio_stream.\"\n      },\n      {\n        \"key\": \"NSSpeechRecognitionUsageDescription\",\n        \"value\": \"Used to transcribe voice commands from your glasses.\",\n        \"reason\": \"voice_command / wake_word / push_to_talk / record_audio / transcription_incremental / audio_chunks.\"\n      }\n    ]\n  },\n  \"metaDat\": {\n    \"scopes\": [\n      \"glasses.camera.photo\",\n      \"glasses.connection\"\n    ],\n    \"registrationRequired\": true,\n    \"registrationSteps\": [\n      \"Create an app in the Meta Wearables Developer Center (https://wearables.developer.meta.com/).\",\n      \"Enable the Meta Wearables Developer Access Toolkit (DAT) product.\",\n      \"Add your Android package / iOS bundle ID to the app settings.\",\n      \"Copy the Meta App ID and Client Token into the platform config that generateConnectionModule emits: on Android app/src/main/res/values/extentos_meta_credentials.xml plus the two AndroidManifest.xml <meta-data> entries; on iOS the MWDAT dict in Info.plist. NOT extentos.manifest.json — that file has no field for them and never has (the schema carries none), which this step used to claim as an MVP shortcut long after the shortcut was gone. They are per-developer secrets: never commit them.\"\n    ]\n  },\n  \"runtimeGrants\": {\n    \"grants\": [\n      {\n        \"permission\": \"Microphone (AVAudioSession record permission)\",\n        \"requestedBy\": \"app\",\n        \"call\": \"await AVAudioApplication.requestRecordPermission()  // iOS 17+\",\n        \"ifMissing\": \"Silent and total: no prompt, no error, no transcripts. Wake phrases and voice commands do nothing on hardware while working in the simulator. The SDK reads this grant (SystemAudioBridge.hasMicPermission) but never requests it and never reports it.\"\n      },\n      {\n        \"permission\": \"Speech recognition (SFSpeechRecognizer)\",\n        \"requestedBy\": \"sdk\",\n        \"ifMissing\": \"Handled for you — PlatformSttEngine requests authorization when the STT engine starts. Call Extentos.requestSpeechRecognitionAuthorization() yourself only if you want to control WHEN the prompt appears.\"\n      }\n    ],\n    \"note\": \"Manifest entries alone are not enough: the OS grants nothing until the app asks at runtime. Entries marked requestedBy:\\\"app\\\" are YOUR call to make, before starting the assistant or any capture. CAMERA is deliberately absent from this list even though it is a manifest entry above: the photo is taken by the GLASSES and arrives over the vendor transport, so the phone's camera is never opened and the SDK never requests the grant. The one case where it becomes a runtime grant is a foreground service declared with `camera` type — see getProductionChecklist for that path.\"\n  },\n  \"integrationConfig\": [\n    {\n      \"key\": \"EXTENTOS_APP_ID\",\n      \"where\": \"Info.plist (app target) — but read by YOUR BOOTSTRAP, not by the SDK. The generated ExtentosBootstrap does `ExtentosConfig(appId: Bundle.main.infoDictionary?[\\\"EXTENTOS_APP_ID\\\"] as? String)`. If you write your own bootstrap you must read it yourself or pass `appId:` directly; the SDK only ever sees `config.appId`.\",\n      \"source\": \"Your Extentos project identity, reverse-DNS. You choose it and pass it to generateConnectionModule as appPackage. Deliberately decoupled from your store bundle id, and the SAME value on both platforms so one project covers both.\",\n      \"ifMissing\": \"It does NOT fail loudly. `config.appId` falls back to Bundle.main.bundleIdentifier, so the app keeps running under whatever its store bundle id happens to be. That is fine when the two match and silently wrong when they do not: dashboard Agent settings, sounds and analytics are keyed to the id you minted against, so they simply never reach the app, and cross-platform apps whose bundle ids differ split into two dashboard projects.\"\n    },\n    {\n      \"key\": \"EXTENTOSProjectKey\",\n      \"where\": \"Info.plist (app target). Keep the value in a gitignored xcconfig and reference it — but the reference resolves to nothing until a real key has been minted into it.\",\n      \"source\": \"generateConnectionModule mints it, bound to your Extentos account, and writes it into the build. It is the ONLY source — there is no dashboard field to copy it from and no format you can construct by hand. It mints one even for a voice-only app that emits no connection page.\",\n      \"ifMissing\": \"No build error, on either platform. A BROWSER-SIMULATOR session keeps working, because it authenticates with its own backend-minted token — note this is about the transport, not about where the app runs: an app pinned to a non-sim transport uses the baked key even when running in the platform simulator, so it fails there too. Real hardware and every shipped build fail at runtime with AssistantError.NoApiKey, and the usage never appears in your dashboard, so billing and analytics read as silently empty.\"\n    }\n  ],\n  \"summary\": \"iOS: 4 privacy Info.plist keys required. Meta DAT registration required (2 scopes). 1 runtime grant the APP must request: Microphone (AVAudioSession record permission). 2 Extentos config values the build must ALSO carry: EXTENTOS_APP_ID, EXTENTOSProjectKey — minted by generateConnectionModule, which is the only source and is required even for a voice-only app.\",\n  \"privacyPolicy\": {\n    \"url\": \"https://extentos.com/privacy\",\n    \"version\": \"2026-04\",\n    \"note\": \"First call on this install — Extentos collects anonymous usage telemetry by default to improve the tool. Your installId tags telemetry events; no source code or personal data is collected. Opt out: run `npx @extentos/mcp-server@latest decline-privacy`, or set EXTENTOS_TELEMETRY=0. This note is shown once per install.\"\n  }\n}",
              "type": "result"
            },
            "tool": "getPermissions"
          }
        ],
        "task": "t3",
        "turns": 2
      }
    ],
    "none_because": null,
    "tasks": [
      {
        "done_when": "The tool reply shows the Android voice-only scaffold for the specified package and capabilities, including its generated configuration and permissions.",
        "id": "t1",
        "task": "Generate a detailed Android bootstrap scaffold for a new Meta glasses voice-only app with package com.example.voicenotes, using transcription_incremental and speak. Show the generated configuration and permissions."
      },
      {
        "done_when": "The tool reply analyzes all three proposed phrases against the supplied existing phrases and reports the resulting issues and collisions.",
        "id": "t2",
        "task": "Check these proposed voice triggers for problems: “hey meta”, “take a photo”, and “start recording”; the existing triggers are “take a photo” and “start recording video”. Report the findings and any collisions."
      },
      {
        "done_when": "The tool reply shows the derived permission information and runtime grants for the three specified capabilities with iOS framing.",
        "id": "t3",
        "task": "For an iOS glasses app using capture_photo, transcription_incremental, and speak, derive the required permissions and runtime grants."
      }
    ],
    "tasks_file_sha256": "1605866b1ac9852dfc390e535207bb25de5e829a5c2eb25b25c983b5b04220ba",
    "writer": "codex/gpt-6.1-terra"
  }
}
