diff --git a/OpenGlasses/Info.plist b/OpenGlasses/Info.plist index aa68857c4..11906d9f2 100644 --- a/OpenGlasses/Info.plist +++ b/OpenGlasses/Info.plist @@ -152,7 +152,7 @@ NSPhotoLibraryAddUsageDescription OpenGlasses saves photos taken with your Ray-Ban Meta glasses to your photo library. NSPhotoLibraryUsageDescription - OpenGlasses accesses your photo library to organize glasses photos into a dedicated album. + OpenGlasses saves glasses photos into a dedicated Glasses album in your photo library. NSRemindersFullAccessUsageDescription OpenGlasses creates and manages reminders so you can set them hands-free through your glasses. NSRemindersUsageDescription diff --git a/OpenGlasses/Sources/App/OpenGlassesApp.swift b/OpenGlasses/Sources/App/OpenGlassesApp.swift index 6b256efbe..e504818ae 100644 --- a/OpenGlasses/Sources/App/OpenGlassesApp.swift +++ b/OpenGlasses/Sources/App/OpenGlassesApp.swift @@ -1317,10 +1317,7 @@ class AppState: ObservableObject, AppStateProtocol { // Lets end() give the camera back the way it found it without stopping a stream some // other feature is mid-way through using (same consumer set LivePreviewView checks). ReadingCompanionService.shared.otherStreamConsumersActive = { [weak self] in - guard let self else { return false } - return self.videoRecorder.isRecording || self.broadcastService.isBroadcasting - || self.webRTCStreaming.isStreaming || self.geminiLiveSession.isActive - || self.openAIRealtimeSession.isActive + self?.otherStreamConsumersActive() ?? false } // Skill Self-Evolution (Plan AW) — give the loop its LLM analyzer. The capture hook @@ -3427,6 +3424,24 @@ class AppState: ObservableObject, AppStateProtocol { // MARK: - Smart Camera Activation + /// True when some other feature legitimately owns the glasses camera stream. + private func otherStreamConsumersActive() -> Bool { + videoRecorder.isRecording || broadcastService.isBroadcasting + || webRTCStreaming.isStreaming || geminiLiveSession.isActive + || openAIRealtimeSession.isActive || ReadingCompanionService.shared.isActive + || SceneNarrationService.shared.isPerceiving + || FingerspellingSessionService.shared.isActive + } + + /// Stop the glasses camera stream when nothing else needs it. Preserves intentional + /// always-on presets and streams another feature is mid-way through using. + private func stopStreamUnlessShared() async { + guard cameraService.isStreaming else { return } + guard Config.activePresetCameraBehavior != "always" else { return } + guard !otherStreamConsumersActive() else { return } + await cameraService.stopStreaming() + } + /// Timestamp of the last smart camera activation (for cooldown window). private var lastSmartCameraActivation: Date? @@ -3484,6 +3499,8 @@ class AppState: ObservableObject, AppStateProtocol { return data } + let startedForCapture = !cameraService.isStreaming + // Plan CU P1: the grab sits between commit and first token, so a vision turn's raw TTFT // contains it — uncorrected, the Bluetooth stream's wait reads as model latency. Timed from // here rather than from the top of the function: the already-streaming path above returns a @@ -3500,15 +3517,18 @@ class AppState: ObservableObject, AppStateProtocol { let data = frame.jpegData(compressionQuality: Config.geminiLiveVideoJPEGQuality), !LLMImagePreparer.isDegenerate(data) { print("📷 Smart Camera: captured frame") + if startedForCapture { await stopStreamUnlessShared() } return data } // Try photo capture as fallback let photoData = try await cameraService.capturePhoto() cameraService.restoreAudioForWakeWord() print("📷 Smart Camera: captured photo") + if startedForCapture { await stopStreamUnlessShared() } return photoData } catch { print("📷 Smart Camera: capture failed — \(error.localizedDescription)") + if startedForCapture { await stopStreamUnlessShared() } return nil } } @@ -4553,6 +4573,8 @@ class AppState: ObservableObject, AppStateProtocol { // silent mode (silent mode only suppresses the *initial* auto-start). let wasInConversation = inConversation + await stopStreamUnlessShared() + isListening = false inConversation = false activePersona = nil diff --git a/OpenGlasses/Sources/Resources/Localizable.xcstrings b/OpenGlasses/Sources/Resources/Localizable.xcstrings index 2381598b7..c2dc437c0 100644 --- a/OpenGlasses/Sources/Resources/Localizable.xcstrings +++ b/OpenGlasses/Sources/Resources/Localizable.xcstrings @@ -3,15 +3,17 @@ "strings" : { "" : { + }, + "—" : { + + }, + "…" : { + }, "·" : { "comment" : "A period used to separate different pieces of text.", "isCommentAutoGenerated" : true }, - "· Unload" : { - "comment" : "A separator between the main text and the secondary text.", - "isCommentAutoGenerated" : true - }, "\"%@\"" : { "comment" : "A sublabel inside the persona list item, showing the wake word of a persona.", "isCommentAutoGenerated" : true @@ -66,6 +68,9 @@ }, "\"Share the transcript\" or \"Export the recording\"" : { + }, + "“What's new” — one ranked glance of pending notifications on the HUD or spoken." : { + }, "{\"key\": \"value\"}" : { "comment" : "A placeholder for a JSON string.", @@ -171,6 +176,16 @@ } } }, + "%@ — %lld models, %lld ms" : { + "localizations" : { + "en" : { + "stringUnit" : { + "state" : "new", + "value" : "%1$@ — %2$lld models, %3$lld ms" + } + } + } + }, "%@ · %@" : { "comment" : "A subline of text that shows the LLM provider and model name for a saved model.", "isCommentAutoGenerated" : true, @@ -183,6 +198,26 @@ } } }, + "%@ · %lld section%@" : { + "localizations" : { + "en" : { + "stringUnit" : { + "state" : "new", + "value" : "%1$@ · %2$lld section%3$@" + } + } + } + }, + "%@ · %lld section%@ · %@" : { + "localizations" : { + "en" : { + "stringUnit" : { + "state" : "new", + "value" : "%1$@ · %2$lld section%3$@ · %4$@" + } + } + } + }, "%@ · v%@ · %lld files" : { "comment" : "A label showing the vault's unique identifier, version, and the number of files in the vault.", "isCommentAutoGenerated" : true, @@ -237,9 +272,15 @@ } } }, - "%@ loaded" : { - "comment" : "A label that indicates a model is loaded. The argument is the name of the model.", - "isCommentAutoGenerated" : true + "%@ in · %@ out" : { + "localizations" : { + "en" : { + "stringUnit" : { + "state" : "new", + "value" : "%1$@ in · %2$@ out" + } + } + } }, "%@ loaded. Tap to unload." : { @@ -256,6 +297,25 @@ } } }, + "%@ only" : { + + }, + "%@ value" : { + + }, + "%@ wants:" : { + + }, + "%@ wants: %@. Approve or deny?" : { + "localizations" : { + "en" : { + "stringUnit" : { + "state" : "new", + "value" : "%1$@ wants: %2$@. Approve or deny?" + } + } + } + }, "%@ was denied. You can grant it in Settings." : { "comment" : "A message displayed when the user has denied permission to use a tool. The argument is the name of the tool.", "isCommentAutoGenerated" : true @@ -434,12 +494,25 @@ }, "%lld entries" : { + }, + "%lld frames" : { + }, "%lld installed" : { }, "%lld more — use search to narrow down" : { + }, + "%lld page%@ · %lld min" : { + "localizations" : { + "en" : { + "stringUnit" : { + "state" : "new", + "value" : "%1$lld page%2$@ · %3$lld min" + } + } + } }, "%lld page%@ captured" : { "comment" : "A button to start a new script from the scanned pages, and a button to save the script as a new one.", @@ -452,6 +525,9 @@ } } } + }, + "%lld px" : { + }, "%lld requests" : { @@ -653,23 +729,38 @@ "• %@" : { "comment" : "A bullet point with a key point from a study deck.", "isCommentAutoGenerated" : true + }, + "→ %@" : { + }, "+ %lld more tools" : { + }, + "$" : { + }, "1. Select the templates you want" : { }, "2 FPS (Battery Saver)" : { + }, + "2 Mbps" : { + }, "2. Tap Install — this creates scheduled tasks in the app" : { "comment" : "A step in the process of using the app, describing what happens when the \"Install\" button is tapped.", "isCommentAutoGenerated" : true + }, + "3 seconds" : { + }, "3. Create the matching Shortcuts in the Shortcuts app (we'll show you how)" : { "comment" : "A step in the process of using shortcut templates, explaining how to create the corresponding shortcuts in the shortcuts app.", "isCommentAutoGenerated" : true + }, + "4 Mbps" : { + }, "4. The agent runs each Shortcut on schedule and summarizes results" : { "comment" : "A step in the process of using the app, explaining how the agent interacts with the Shortcuts.", @@ -681,9 +772,21 @@ }, "7 FPS" : { + }, + "8 Mbps" : { + + }, + "10 seconds" : { + + }, + "12 Mbps" : { + }, "15 FPS (Default)" : { + }, + "20 Mbps" : { + }, "24 FPS" : { @@ -727,6 +830,9 @@ }, "720p (High)" : { + }, + "A camera frame leaves your device for whichever agent endpoint you've configured. Separate from Agentic Features itself, so turning agents on never starts sending pictures on its own." : { + }, "A free, offline neural voice that can speak even when the app is in the background. Downloads %@ (~185 MB) over Wi-Fi; until it's installed, on-device speech falls back to the iOS voice." : { @@ -782,6 +888,9 @@ } } } + }, + "A pack's actions become voice commands the assistant can use. Turning a pack off removes its actions immediately; its settings are kept." : { + }, "A photo is captured first, then this prompt is sent to the AI along with the image." : { "comment" : "A description of how the prompt is used with a photo.", @@ -793,9 +902,6 @@ "A short label to pick this prompt from the list — e.g. \"Concise\", \"Coding helper\", \"British butler\"." : { "comment" : "A description of the prompt field.", "isCommentAutoGenerated" : true - }, - "About" : { - }, "Accent Colour" : { @@ -803,6 +909,9 @@ "Access Key" : { "comment" : "A label for the access key field.", "isCommentAutoGenerated" : true + }, + "Access token" : { + }, "Access token (paste)" : { @@ -810,6 +919,9 @@ "Accessibility" : { "comment" : "A label for the accessibility settings screen.", "isCommentAutoGenerated" : true + }, + "Account connected" : { + }, "Action" : { "extractionState" : "manual", @@ -857,6 +969,9 @@ } } } + }, + "Action name (what you'll say)" : { + }, "Action Type" : { @@ -911,6 +1026,9 @@ }, "Active" : { + }, + "Active Limits" : { + }, "Active mode:" : { @@ -939,6 +1057,9 @@ "Activity" : { "comment" : "A section of the Insights view that shows the user's usage activity.", "isCommentAutoGenerated" : true + }, + "Activity Log" : { + }, "Add" : { "extractionState" : "manual", @@ -1002,6 +1123,9 @@ "Add %@" : { "comment" : "The title of the navigation bar.", "isCommentAutoGenerated" : true + }, + "Add a Gemini API key in AI Models to enable translation" : { + }, "Add a model in Settings → AI Models first" : { @@ -1010,12 +1134,15 @@ "comment" : "A description text that appears when there are no saved models to choose from in the model picker sheet.", "isCommentAutoGenerated" : true }, - "Add a Perplexity API key for AI-powered search with cited sources. Without one, DuckDuckGo is used." : { + "Add a Perplexity or Tavily API key for AI-powered search with cited sources, or a Brave Search key for an independent web index. With several configured the order is Perplexity → Tavily → Brave. Without any, DuckDuckGo is used." : { }, "Add a server manually with + on the previous screen." : { "comment" : "A description of the action to add a server manually.", "isCommentAutoGenerated" : true + }, + "Add Action" : { + }, "Add actions to your speed dial — photo prompts, smart home controls, shortcuts, and more." : { "comment" : "A description below the \"No Quick Actions\" message in the Quick Actions Settings view, explaining that users can add actions to their speed dial.", @@ -1070,6 +1197,9 @@ } } } + }, + "Add Document" : { + }, "Add Gateway" : { @@ -1170,6 +1300,9 @@ } } } + }, + "Add step" : { + }, "Add Step" : { @@ -1177,6 +1310,12 @@ "Add Teleprompter Script" : { "comment" : "Title of the intent to add a teleprompter script.", "isCommentAutoGenerated" : true + }, + "Add text or import a file to build your private on-device knowledge base." : { + + }, + "Add text…" : { + }, "Add to Speed Dial" : { "comment" : "Button label for adding a template to the speed dial.", @@ -1194,6 +1333,9 @@ }, "Agent Behavior" : { + }, + "Agent Bridge" : { + }, "Agent Model" : { @@ -1210,6 +1352,9 @@ "AI" : { "comment" : "A label for the AI-generated response.", "isCommentAutoGenerated" : true + }, + "AI & Personality" : { + }, "AI assistant for your smart glasses" : { "comment" : "A description of the purpose of the app.", @@ -1218,6 +1363,9 @@ "AI HECA · %@" : { "comment" : "A label that shows the date and time of the report.", "isCommentAutoGenerated" : true + }, + "AI is replying: %@" : { + }, "AI Model" : { @@ -1307,6 +1455,9 @@ }, "All AI queries are processed on-device. No clinical data is sent to cloud providers." : { + }, + "All conversations" : { + }, "All Domains" : { "comment" : "A label for a filter that shows all domains.", @@ -1326,16 +1477,22 @@ "Allowed Tools" : { "comment" : "A label displayed above a list of tools that are allowed in a mode.", "isCommentAutoGenerated" : true + }, + "Allows installing unsigned packs while building your own. Unsigned packs are labeled on their row. The catalog's own signature is always enforced." : { + }, "Alternative spellings" : { }, - "Alternative ways to start the assistant without the wake word — for noisy, silent, or no-speech situations. All are off by default. The Volume Button trigger can interfere with normal volume control." : { + "Alternative ways to start the assistant without the wake word — for noisy, silent, or no-speech situations. All are off by default. The Volume Button trigger can interfere with normal volume control; Temple Tap pauses while your own audio plays." : { }, "Alternatives" : { "comment" : "A label for a list of alternative wake phrases.", "isCommentAutoGenerated" : true + }, + "Ambient captions render in your language while someone speaks another — “they speak Spanish, you read English”. When off, captions transcribe exactly as today." : { + }, "Analyze Food" : { @@ -1346,6 +1503,9 @@ "Annual" : { "comment" : "A label for an annual subscription.", "isCommentAutoGenerated" : true + }, + "Answers in this project are grounded in these documents and cite them. Local-only." : { + }, "API Key" : { "extractionState" : "manual", @@ -1393,9 +1553,6 @@ } } } - }, - "API Key (optional for local servers)" : { - }, "API key missing" : { @@ -1405,10 +1562,16 @@ }, "API Keys" : { + }, + "App memory" : { + }, "App URL" : { "comment" : "A label displayed above the text field for entering a URL scheme to open.", "isCommentAutoGenerated" : true + }, + "App work in backend leg" : { + }, "Appearance" : { "comment" : "A section header in the Quick Action Editor that describes the appearance settings.", @@ -1416,6 +1579,9 @@ }, "Approve" : { + }, + "Arguments JSON (optional)" : { + }, "Ask" : { "extractionState" : "manual", @@ -1487,6 +1653,9 @@ "Ask a specific OpenGlasses persona by voice and hear the answer" : { "comment" : "Description of the AskPersonaIntent.", "isCommentAutoGenerated" : true + }, + "Ask anything" : { + }, "Ask OpenGlasses" : { "comment" : "Title of the \"Ask OpenGlasses\" action button.", @@ -1510,6 +1679,9 @@ "Assign any model to each tier. Simple queries use Fast, most use Balanced, complex reasoning uses Best." : { "comment" : "A description of the tier assignments.", "isCommentAutoGenerated" : true + }, + "Assistant is typing" : { + }, "Assistive Mode" : { "comment" : "A section of the accessibility settings that shows the assistive mode toggle.", @@ -1518,10 +1690,25 @@ "Assistive: %@" : { "comment" : "A label that shows the assistive mode status.", "isCommentAutoGenerated" : true + }, + "Attach a file (PDF or text)" : { + + }, + "Attach document" : { + + }, + "Attach from Documents" : { + }, "Attach photo" : { "comment" : "A button that lets users attach a photo.", "isCommentAutoGenerated" : true + }, + "Attached copy" : { + + }, + "Attributions" : { + }, "Audit Log" : { @@ -1584,9 +1771,15 @@ "Authentication failed. Tap to try again." : { "comment" : "A message displayed when biometric authentication fails.", "isCommentAutoGenerated" : true + }, + "Authentication failed. Try again." : { + }, "Author" : { + }, + "Author Capture-Flow" : { + }, "Authorize camera access and link OpenGlasses to the Meta AI app." : { "comment" : "A description of the next step in onboarding.", @@ -1600,6 +1793,9 @@ }, "Auto-Purge After" : { + }, + "Automatic scales the recording bitrate to the resolution and frame rate above, which is almost always what you want — a fixed rate either starves 720p or wastes space at 360p. A higher fixed rate fills storage faster and shortens the low-storage warning's estimate.\n\nChoose where transcripts are saved. Videos always save to the Glasses album in Photos. Transcripts are also accessible via the Files app." : { + }, "Automatically selects the best available model for %@ requests." : { "comment" : "A description of the auto-detection feature for selecting a model.", @@ -1673,6 +1869,12 @@ } } } + }, + "Bar Layout" : { + + }, + "Barcode/Voice" : { + }, "Base URL" : { @@ -1817,6 +2019,12 @@ "Branches" : { "comment" : "A section for the branches of a step.", "isCommentAutoGenerated" : true + }, + "brave.com" : { + + }, + "Bridge" : { + }, "Brightness" : { @@ -1876,9 +2084,6 @@ } } } - }, - "Build" : { - }, "Built-in" : { "extractionState" : "manual", @@ -1926,6 +2131,12 @@ } } } + }, + "Built-in Actions" : { + + }, + "Built-in actions stay visible in the Shortcuts app even when off — turning one off makes Siri refuse it and hides it from the action list." : { + }, "Built-in capabilities that run on your phone. Tap a row to see what arguments the AI passes when it calls a tool. Some tools (Calendar, Contacts, Reminders, Health, Notifications) need iOS permission the first time you enable them." : { "comment" : "A description of the", @@ -2025,12 +2236,6 @@ } } } - }, - "Callback source: %@" : { - - }, - "Callback URL: %@" : { - }, "CAM" : { "comment" : "A label for a camera streaming badge.", @@ -2038,6 +2243,9 @@ }, "Camera" : { + }, + "Camera & recording (capture)" : { + }, "Camera Permission" : { "extractionState" : "manual", @@ -2242,6 +2450,9 @@ } } } + }, + "Cancel download" : { + }, "Cancelled" : { "extractionState" : "manual", @@ -2301,10 +2512,19 @@ } } } + }, + "Captions from this voice will show this name. Give two chips the same name to merge them." : { + + }, + "Capture flows, procedures, playbooks, and custom tools you've authored. Off by default — turn one on to run it by voice." : { + }, "Capture from camera" : { "comment" : "A section header for the teleprompter capture functionality.", "isCommentAutoGenerated" : true + }, + "Capture Glasses Photo" : { + }, "Card %lld of %lld" : { "comment" : "A label showing the current card index and total number of cards in the review session.", @@ -2317,6 +2537,9 @@ } } } + }, + "Catalog" : { + }, "Catalogue" : { "comment" : "A screen that lists a curated catalogue of vetted MCP servers.", @@ -2331,6 +2554,15 @@ }, "Changes take effect next time the camera session starts. Higher settings use more battery." : { + }, + "Chat" : { + + }, + "Chat options" : { + + }, + "Chat Read-Aloud (Twitch)" : { + }, "Chattiness" : { @@ -2338,11 +2570,10 @@ "Check Frequency" : { }, - "Checking connection…" : { - "comment" : "A description of a progress indicator while checking a connection.", - "isCommentAutoGenerated" : true + "Choice" : { + }, - "Checking…" : { + "Choose a copy" : { }, "Choose Provider" : { @@ -2396,12 +2627,15 @@ } } }, - "Choose where transcripts are saved. Videos always save to the Glasses album in Photos. Transcripts are also accessible via the Files app." : { + "Choose what Siri can run. Say \"Run on OpenGlasses\" — or create your own actions below." : { }, "Choose your AI" : { "comment" : "A title for the onboarding page where users can choose an AI provider.", "isCommentAutoGenerated" : true + }, + "Choose…" : { + }, "Clear" : { "extractionState" : "manual", @@ -2449,6 +2683,12 @@ } } } + }, + "Clear Pending Items" : { + + }, + "Clear Recents" : { + }, "Clear scan" : { "comment" : "A button that clears the scanned script.", @@ -2503,9 +2743,18 @@ } } } + }, + "Cloud diarization is hard-disabled while HIPAA mode is on, so clinical audio never leaves the device." : { + }, "Cloud LLM providers may process clinical data. Ensure you have a signed agreement (BAA, DPA, or equivalent) with your provider." : { + }, + "Cloud tier disabled in HIPAA mode" : { + + }, + "Cloud translation is hard-disabled while HIPAA mode is on, so clinical audio never leaves the device. The on-device tier (SenseVoice + Apple Translation) still works when installed." : { + }, "Coming Soon" : { @@ -2513,9 +2762,6 @@ "Compatibility" : { "comment" : "A heading for the compatibility of a skill.", "isCommentAutoGenerated" : true - }, - "Complete in Meta AI" : { - }, "Compliance" : { @@ -2527,6 +2773,9 @@ "Confidence %lld%%" : { "comment" : "A label showing the confidence level of the assessment. The argument is the confidence level, rounded to the nearest whole number.", "isCommentAutoGenerated" : true + }, + "Confidence floor" : { + }, "Configuration" : { "comment" : "A heading for the configuration of a mode.", @@ -2538,13 +2787,21 @@ "Configured" : { }, - "Confirm action" : { - "comment" : "A title for a confirmation dialog.", - "isCommentAutoGenerated" : true + "Confirmed read" : { + }, "Conflicts" : { "comment" : "A label displayed above a list of conflicts in the offline queue.", "isCommentAutoGenerated" : true + }, + "Connect" : { + + }, + "Connect ChatGPT" : { + + }, + "Connect Claude" : { + }, "Connect Glasses" : { "extractionState" : "manual", @@ -2676,6 +2933,9 @@ "Connect Your Glasses" : { "comment" : "A title for the onboarding page that allows the user to connect their Meta AI glasses.", "isCommentAutoGenerated" : true + }, + "Connect your glasses first." : { + }, "Connected" : { "extractionState" : "manual", @@ -2738,6 +2998,9 @@ }, "Connected Apps & Services" : { + }, + "Connected Glasses" : { + }, "Connected to %@" : { "comment" : "A label at the bottom of the gateways view indicating the name of the currently active gateway.", @@ -2839,6 +3102,9 @@ } } } + }, + "Connecting…" : { + }, "Connection" : { "extractionState" : "manual", @@ -2892,6 +3158,9 @@ }, "Connection Test" : { + }, + "Connections" : { + }, "Connectivity" : { "extractionState" : "manual", @@ -2939,6 +3208,15 @@ } } } + }, + "Content" : { + + }, + "Content in Search" : { + + }, + "Context" : { + }, "Context trimmed by gateway" : { "comment" : "A message displayed when the Gemini session has been trimmed.", @@ -2990,9 +3268,30 @@ } } } + }, + "Conversation history is off — messages won't be saved. Enable it in Settings." : { + + }, + "Conversation Mode" : { + + }, + "Conversations (%lld)" : { + }, "Conversations Locked" : { + }, + "Copied" : { + + }, + "Copied code" : { + + }, + "Copy" : { + + }, + "Copy code" : { + }, "Copy Debug Log" : { "extractionState" : "manual", @@ -3087,6 +3386,9 @@ } } } + }, + "Copy token" : { + }, "Could not load skills from ClawHub. Check your connection and try again." : { @@ -3094,9 +3396,15 @@ "Couldn't start session" : { "comment" : "A title for an alert that can't start a Field Assist session.", "isCommentAutoGenerated" : true + }, + "Couldn't verify it's you — Simple Mode stays on." : { + }, "Covered by this app" : { + }, + "Create an iOS OAuth client in your GCP project (APIs & Services → Credentials) and paste its client ID above to enable sign-in." : { + }, "Create Playbook" : { @@ -3107,6 +3415,12 @@ "Creates scheduled tasks in the app. For the actual Siri Shortcuts, you'll be guided to create them in the Shortcuts app." : { "comment" : "A footer description under the \"Install\" button in the ShortcutTemplatesView.", "isCommentAutoGenerated" : true + }, + "Custom" : { + + }, + "Custom Actions" : { + }, "Custom Data (JSON)" : { @@ -3168,6 +3482,9 @@ "Custom soul for this persona. Leave empty to use the global soul.md. This overrides the system prompt personality when agentic mode is on." : { "comment" : "A description of the persona's personality.", "isCommentAutoGenerated" : true + }, + "Custom Tool" : { + }, "Custom Tools" : { "extractionState" : "manual", @@ -3225,6 +3542,9 @@ "Custom: %@" : { "comment" : "A text field within the \"Wake Word\" section, allowing users to input a custom wake phrase. The text field is pre-populated with the value of the \"wakePhrase\" state variable.", "isCommentAutoGenerated" : true + }, + "Daily Briefing" : { + }, "Dark" : { @@ -3244,6 +3564,12 @@ }, "Data Sent by Category" : { + }, + "Date" : { + + }, + "Date unavailable" : { + }, "Debug" : { "extractionState" : "manual", @@ -3291,6 +3617,15 @@ } } } + }, + "Decode every" : { + + }, + "Deepgram" : { + + }, + "deepgram.com" : { + }, "Default" : { "comment" : "A default value for a brightness picker.", @@ -3379,6 +3714,12 @@ } } } + }, + "Delivery" : { + + }, + "Deny" : { + }, "Describe" : { "extractionState" : "manual", @@ -3447,12 +3788,21 @@ }, "Describe surroundings for accessibility" : { + }, + "Describes the space around you as it changes, for moving through somewhere unfamiliar. Watching is silent — descriptions build up so questions about what you're looking at are answered instantly. Speaking them aloud is a separate switch.\n\nNot continuous coverage: descriptions are generated on this device, which can't run while the app is in the background or the phone is locked. Narration stops there and says so out loud. It also needs glasses that stream live video — on glasses that only take photos it can't run at all.\n\nLive captions take priority: while captions are running, narration keeps watching but stops speaking, so it doesn't talk over what people are saying or end up transcribed as if it were one of them." : { + }, "Description" : { }, "Description for the AI" : { + }, + "Desktop Dev Loop" : { + + }, + "Detach copy" : { + }, "Details" : { @@ -3467,6 +3817,12 @@ }, "Deterministic rules that confirm or block risky actions before they run — voice approval, quiet hours, and an away-from-home geofence." : { + }, + "Developer" : { + + }, + "Developer Mode" : { + }, "Developer unlock (skip IAP)" : { @@ -3565,16 +3921,27 @@ } } } + }, + "Device class" : { + + }, + "Device Pairing" : { + }, "Device RAM" : { + }, + "Device-smoke knobs: shorter decode intervals lower latency but cost battery; the confidence floor trades missed letters against false ones (0 = pure greedy decode). Changes apply the next time recognition starts." : { + }, "Diagnostic tools for power users — inspect the prompts being sent to the AI and watch live network requests. Useful for debugging or building your own integrations." : { }, - "Direct mode — %@" : { - "comment" : "A label that describes the current LLM mode.", - "isCommentAutoGenerated" : true + "Diarization" : { + + }, + "Digest" : { + }, "Direct REST API control — works alongside or instead of HomeKit. Generate a token in HA → Profile → Security → Long-Lived Access Tokens." : { @@ -3587,6 +3954,9 @@ }, "Disable Medical Compliance?" : { + }, + "Disabled in HIPAA mode" : { + }, "Disabled personas won't listen for their wake word." : { @@ -3671,9 +4041,6 @@ }, "Disconnected: every %lld min" : { - }, - "Discord" : { - }, "Discover Tools" : { "extractionState" : "manual", @@ -3827,6 +4194,9 @@ }, "Display" : { + }, + "Display Backend" : { + }, "Display Name" : { "extractionState" : "manual", @@ -3874,6 +4244,12 @@ } } } + }, + "Documents" : { + + }, + "Documents (%lld)" : { + }, "Documents/Transcripts" : { @@ -3957,6 +4333,9 @@ }, "Double-tap to preview" : { + }, + "Double-tap to start or stop recording." : { + }, "Download" : { "extractionState" : "manual", @@ -4063,6 +4442,9 @@ "Download All Languages" : { "comment" : "A button that downloads all available languages.", "isCommentAutoGenerated" : true + }, + "Download Model (~32 MB)" : { + }, "Download Model (~185 MB)" : { @@ -4087,6 +4469,15 @@ "Drag to reorder priority. The app tries gateways top-to-bottom until one responds." : { "comment" : "A description of how to reorder gateways.", "isCommentAutoGenerated" : true + }, + "Drop near-duplicate frames" : { + + }, + "Dual Capture (picture-in-picture)" : { + + }, + "Duration" : { + }, "During this window the quiet-hours rule confirms before any message is sent." : { "comment" : "A description of the quiet-hours rule.", @@ -4211,6 +4602,9 @@ } } } + }, + "Edit & resend" : { + }, "Edit %@" : { "comment" : "A button that opens a sheet for editing a system prompt preset.", @@ -4267,9 +4661,15 @@ }, "Edit Gateway" : { + }, + "Edit message" : { + }, "Edit Model" : { + }, + "Edit model pricing" : { + }, "Edit Persona" : { @@ -4279,6 +4679,9 @@ }, "Edit Preset" : { + }, + "Edit Prompt" : { + }, "Edit Step" : { "comment" : "The title of the navigation bar for editing a step.", @@ -4287,13 +4690,13 @@ "Edit Tool" : { }, - "ElevenLabs API Key" : { + "Editing a built-in prompt makes it your own copy, safe from app updates." : { }, "ElevenLabs Voice" : { }, - "ElevenLabs voices, Perplexity search, broadcast targets, and live-streaming live under Services. Gateways are OpenClaw bridges to your devices (smart home, automations). MCP Servers expose external tool servers the AI can call." : { + "ElevenLabs voices, Perplexity search, broadcast targets, and live-streaming live under Services. Gateways connect the app to external agents — OpenClaw tool bridges and the Hermes agent bridge. MCP Servers expose external tool servers the AI can call." : { }, "elevenlabs.io" : { @@ -4305,9 +4708,15 @@ "Enable %@" : { "comment" : "A toggle to enable/disable a MCP server.", "isCommentAutoGenerated" : true + }, + "Enable Diarization" : { + }, "Enable Field Assist" : { + }, + "Enable Fingerspelling" : { + }, "Enable Listening" : { @@ -4369,6 +4778,9 @@ "Enable Reading Accessibility" : { "comment" : "A toggle that enables or disables reading accessibility.", "isCommentAutoGenerated" : true + }, + "Enable Scene Narration" : { + }, "Enabled" : { @@ -4579,6 +4991,9 @@ } } } + }, + "Estimated from each provider's reported token usage at list prices. Local-only — never leaves your device. Realtime voice sessions and streamed Chat replies aren't counted yet." : { + }, "Estimated Tokens" : { @@ -4586,6 +5001,9 @@ "Evaluated automatically. Enter the variable name without braces." : { "comment" : "A description of how the condition is evaluated.", "isCommentAutoGenerated" : true + }, + "EVEN G2 lenses are two separate Bluetooth devices — pair both. One lens alone works in a degraded single-lens mode." : { + }, "Event" : { "extractionState" : "manual", @@ -4643,6 +5061,9 @@ "Every install lands on the \"Redact\" data policy and is screened by the egress + tool-poisoning checks before the AI can use its tools. Open Safety & Trust to review or change a server's policy." : { "comment" : "A footer for the catalogue view.", "isCommentAutoGenerated" : true + }, + "Every request must send `Authorization: Bearer `. Configure your Claude Code MCP bridge with the LAN URL and this token. Keep it on your trusted local network — these endpoints expose the live camera, so don't put them behind a public tunnel." : { + }, "Example: A \"log_water\" tool that runs your \"Log Water\" shortcut, or a \"open_notion\" tool that opens notion://." : { "comment" : "An example of a custom tool's description, highlighting how it can be used by the AI.", @@ -4655,6 +5076,9 @@ "Expand each section to see exactly what data is included. Green items are active in the current request." : { "comment" : "A footer explaining the purpose of the \"Expand each section\" text in the Prompt Inspector view.", "isCommentAutoGenerated" : true + }, + "Experimental" : { + }, "Expert Escalation Webhook" : { @@ -4808,6 +5232,9 @@ } } } + }, + "Export flow JSON" : { + }, "Export Library" : { "localizations" : { @@ -4854,9 +5281,18 @@ } } } + }, + "Export Preview Page" : { + + }, + "Export project" : { + }, "Export soul, skills, memory, conversations, and quick actions as a portable zip bundle. Compatible with OpenClaw/nanoclaw agent format." : { + }, + "Exposed content appears in Spotlight and Siri search. Conversations donate titles only. Health data, recognized people, and audio are never indexed." : { + }, "Exposes the glasses camera and TTS to a Claude Code session on your network. Developer-only." : { "comment" : "A description of the MCP Glasses server.", @@ -5003,6 +5439,12 @@ } } } + }, + "Fallback" : { + + }, + "Fallback keeps a turn alive across model limits; narration keeps you informed when it happens." : { + }, "Fast" : { "extractionState" : "manual", @@ -5068,6 +5510,9 @@ }, "FHIR Server" : { + }, + "Field (e.g. suction_psig)" : { + }, "Field Assist" : { @@ -5129,6 +5574,9 @@ }, "Field mapping" : { + }, + "Field Sessions in Search" : { + }, "Field Sync" : { @@ -5138,6 +5586,12 @@ }, "Filter" : { + }, + "Filter conversations by project" : { + + }, + "Fingerspelling" : { + }, "Finish" : { "comment" : "A button that finishes a quiz.", @@ -5146,9 +5600,24 @@ "Flashcards" : { "comment" : "The title of the flashcards view.", "isCommentAutoGenerated" : true + }, + "Flow" : { + + }, + "For a bilingual exchange: the screen splits, each side's speech renders in the other's language, and the glasses display shows only the line addressed to you." : { + }, "For now, use FHIR R4 or Manual Share to export transcripts." : { + }, + "Forget Pairing" : { + + }, + "Found Content" : { + + }, + "Frame grab" : { + }, "Frame Rate" : { @@ -5167,22 +5636,27 @@ "comment" : "A heading for a list of gateways.", "isCommentAutoGenerated" : true }, - "Gemini Live" : { + "Gateways add tools the assistant can call. The Hermes Bridge goes further: when enabled, an agent on your Mac answers whole conversations with its own tools and memory." : { }, - "Gemini Live — bidirectional voice streaming" : { - "comment" : "A description of Gemini Live, a bidirectional voice streaming service.", - "isCommentAutoGenerated" : true + "GCP OAuth Client ID (…apps.googleusercontent.com)" : { + }, - "Gemini Live details" : { + "GCP Project ID" : { }, - "Gemini: %@" : { + "Gemini Live" : { }, "General" : { "comment" : "A section of the gateway edit form.", "isCommentAutoGenerated" : true + }, + "Generation rate" : { + + }, + "Get a spoken briefing with weather, news, and your day ahead" : { + }, "Get API Key" : { "comment" : "A label that reads \"Get API Key\".", @@ -5196,6 +5670,12 @@ }, "Get your API key from %@" : { + }, + "Glance" : { + + }, + "Glasses" : { + }, "Glasses & Privacy" : { @@ -5302,6 +5782,9 @@ } } } + }, + "Google account connected" : { + }, "Got it" : { "comment" : "A button that marks a flashcard as correct.", @@ -5387,11 +5870,13 @@ "Header name (e.g. Authorization)" : { }, - "Header value (e.g. Bearer …)" : { - "comment" : "A label for the value of the authentication header.", - "isCommentAutoGenerated" : true + "Headroom" : { + }, - "Header value (e.g. Bearer xxx)" : { + "Headroom is how much more memory the app can use before iOS terminates it. A model won't load unless it fits in the current headroom with room to generate." : { + + }, + "Headroom now: %@" : { }, "Health Vault" : { @@ -5405,10 +5890,19 @@ "Health Vault Unavailable" : { "comment" : "A title for a view that indicates that the Health Vault is unavailable.", "isCommentAutoGenerated" : true + }, + "Heartbeat: %llds" : { + }, "HECA score" : { "comment" : "A label displayed under the HECA score.", "isCommentAutoGenerated" : true + }, + "Held before this turn" : { + + }, + "Hermes Bridge" : { + }, "Hey Assistant" : { @@ -5427,13 +5921,16 @@ }, "Hey Rayban" : { + }, + "Hide" : { + + }, + "Higher threshold drops more (treats more frames as \"the same scene\"). Heartbeat forces a fresh frame through after this many seconds even if nothing changed, so the AI's view can't go stale. Defaults: 4 and 12s." : { + }, "HIPAA Protected" : { "comment" : "A description of the data that is protected by HIPAA.", "isCommentAutoGenerated" : true - }, - "History" : { - }, "Home Assistant" : { "extractionState" : "manual", @@ -5485,6 +5982,9 @@ "Home Region (geofence)" : { "comment" : "A label displayed above the Home Region settings.", "isCommentAutoGenerated" : true + }, + "Host (Mac's LAN address)" : { + }, "How It Behaves" : { @@ -5562,6 +6062,9 @@ }, "HUD Mirror (phone preview)" : { + }, + "HUD renders on" : { + }, "HuggingFace model ID" : { @@ -5575,9 +6078,18 @@ }, "I'll add it later" : { + }, + "I'll sign in later" : { + + }, + "I've read up to my current spot" : { + }, "Icon" : { + }, + "Id (e.g. fridge_inspection)" : { + }, "Identify Object" : { @@ -5585,6 +6097,12 @@ "If" : { "comment" : "A label displayed before a variable name in a condition.", "isCommentAutoGenerated" : true + }, + "Image Compression" : { + + }, + "Images are downscaled to the long-edge limit, then JPEG-compressed until they fit the size cap." : { + }, "Import" : { "localizations" : { @@ -5631,6 +6149,9 @@ } } } + }, + "Import file…" : { + }, "Import from Apple Notes" : { "comment" : "A label that describes how to import a teleprompter script from Apple Notes.", @@ -5681,6 +6202,9 @@ } } } + }, + "Import project…" : { + }, "Import skills?" : { "localizations" : { @@ -5801,6 +6325,9 @@ "Insights" : { "comment" : "A title for a view that shows usage insights.", "isCommentAutoGenerated" : true + }, + "Install" : { + }, "Install & Activate" : { "comment" : "A button that installs and activates a mode.", @@ -5826,6 +6353,9 @@ }, "Install Skill" : { + }, + "Install Skill Pack?" : { + }, "Installed" : { "comment" : "A label displayed next to a skill that is already installed.", @@ -5845,6 +6375,9 @@ "Installs on the safe \"Redact\" data policy. You can change it later under Safety & Trust." : { "comment" : "A footer for the button in the `MCPCatalogInstallView`.", "isCommentAutoGenerated" : true + }, + "Instruction for the assistant" : { + }, "Intelligence" : { "extractionState" : "manual", @@ -6045,6 +6578,12 @@ } } } + }, + "Items expire on their own: low priority after 30 minutes, medium after 2 hours, and anything dismissed or shown “enough” is retired." : { + + }, + "JPEG quality" : { + }, "JSON body. Use {{variable}} to insert values from previous steps." : { "comment" : "A description of how to use variables in a JSON body.", @@ -6062,9 +6601,18 @@ }, "Kick" : { + }, + "Label" : { + }, "Label (e.g. Home Assistant)" : { + }, + "Label captions and meeting transcripts by speaker (“who said what”) via Deepgram. Off by default." : { + + }, + "Labels each caption and meeting line with the speaker. When off, transcription works exactly as today (a single, unlabeled stream)." : { + }, "LAN for local network, Tunnel for Tailscale/remote access, Auto tries LAN first." : { "comment" : "A description of the connection options available for a gateway.", @@ -6076,6 +6624,12 @@ "LAN URL" : { "comment" : "A label for the URL of a local area network.", "isCommentAutoGenerated" : true + }, + "Landscape" : { + + }, + "Language" : { + }, "Language Tutor" : { @@ -6084,7 +6638,7 @@ "comment" : "The title of the language settings screen.", "isCommentAutoGenerated" : true }, - "Last callback at: %@" : { + "Last read" : { }, "Last Reasoning" : { @@ -6092,6 +6646,9 @@ }, "Last Run" : { + }, + "Last word" : { + }, "Later steps can reference this result with {{%@}}." : { "comment" : "A message that appears under a step's output variable when it's not empty. The variable is replaced with the step's output variable.", @@ -6108,6 +6665,12 @@ } } } + }, + "Left" : { + + }, + "Lets a gateway agent ask the glasses to act (speak, show text, check status — and with capture enabled, take photos or record). Everything is denied while Agent Mode is off; capture always asks for confirmation and announces itself before a sensor starts." : { + }, "License Code" : { "comment" : "A label displayed above a text field for entering a license code.", @@ -6210,6 +6773,9 @@ }, "Limited RAM — use models under 1 GB" : { + }, + "Lines: %lld" : { + }, "Listen via Glasses Mic" : { "extractionState" : "manual", @@ -6427,6 +6993,9 @@ } } } + }, + "Live Recognition" : { + }, "Live Streaming" : { "extractionState" : "manual", @@ -6480,6 +7049,9 @@ }, "Live Translator Mode" : { + }, + "Live Vision" : { + }, "LiveAI Mode" : { @@ -6488,10 +7060,6 @@ "comment" : "A button to load a model.", "isCommentAutoGenerated" : true }, - "Load %@" : { - "comment" : "A button to load a local machine learning model.", - "isCommentAutoGenerated" : true - }, "Load Entities" : { }, @@ -6509,9 +7077,8 @@ "comment" : "A label that indicates a model is loaded.", "isCommentAutoGenerated" : true }, - "Loading %@…" : { - "comment" : "A label at the top of the checkout view providing medication instructions. The argument is the instructions for taking the primary medication in the cart.", - "isCommentAutoGenerated" : true + "Loading catalog…" : { + }, "Loading entities…" : { "comment" : "A placeholder text displayed while loading Home Assistant entities.", @@ -6599,11 +7166,14 @@ "comment" : "A description of how conversation encryption works.", "isCommentAutoGenerated" : true }, - "Long-Lived Access Token" : { + "Long edge" : { }, "Look & Feel" : { + }, + "Looking for “Even G2” devices…" : { + }, "Manage Field Assist" : { "comment" : "A label for the settings button in the Field Assist tab.", @@ -6621,6 +7191,12 @@ "Max %lld steps per plan" : { "comment" : "A stepper that lets the user set the maximum number of steps an agent can take in a single plan.", "isCommentAutoGenerated" : true + }, + "Max file size" : { + + }, + "Max long edge" : { + }, "MCP Server" : { @@ -6672,9 +7248,8 @@ } } }, - "MCP servers expose tools the AI can call. Popular servers: Home Assistant, Notion, GitHub, Slack, and more." : { - "comment" : "A footer in the MCPServersView, explaining that MCP servers expose tools the AI can call.", - "isCommentAutoGenerated" : true + "MCP servers expose tools the AI can call. Tap a server to edit it (URL, token, transport). Popular servers: Home Assistant, Notion, GitHub, Slack, and more." : { + }, "Medical Compliance" : { @@ -6690,10 +7265,25 @@ }, "Meeting Link" : { + }, + "Meeting Records" : { + + }, + "Meeting Summary" : { + }, "Memory" : { "comment" : "A label displayed above the user's memory.", "isCommentAutoGenerated" : true + }, + "Memory Rewind" : { + + }, + "Mentions Only" : { + + }, + "Message" : { + }, "Meta / Facebook Calls" : { "comment" : "A section header for network activity related to Meta calls (e.g. those made by the Meta Wearables SDK).", @@ -6708,9 +7298,15 @@ }, "Mic source, on-device bystander-face blurring, and encrypted conversations live in Hardware & Privacy. Medical Compliance enables HIPAA-grade encryption and exports for clinical use (separate subscription)." : { + }, + "Microphone" : { + }, "Microphone permission is required" : { + }, + "Minutes" : { + }, "Missed" : { "comment" : "A label for a button that dismisses a review session.", @@ -6789,7 +7385,7 @@ "comment" : "A label for a button that unloads a loaded local LLM model.", "isCommentAutoGenerated" : true }, - "Model: %@" : { + "Model Pricing" : { }, "Models are the AI you talk to. Add a key for any provider you want — you can switch between them anytime from the main screen." : { @@ -6825,6 +7421,9 @@ "Name (e.g. My Agent SDK)" : { "comment" : "A label for the name of a custom agent.", "isCommentAutoGenerated" : true + }, + "Name this speaker" : { + }, "Native Tools" : { "extractionState" : "manual", @@ -6880,9 +7479,14 @@ "Natural-sounding voice. Without this, the built-in iOS voice is used." : { }, - "Needs 8 GB" : { - "comment" : "A warning label that appears when a recommended model is too small for the device.", - "isCommentAutoGenerated" : true + "Navigation" : { + + }, + "Needs %@ — connect glasses first" : { + + }, + "Needs %lld GB" : { + }, "Needs 8 GB RAM" : { @@ -6939,9 +7543,18 @@ }, "New Action" : { + }, + "New chat" : { + + }, + "New Chat" : { + }, "New Custom Tool" : { + }, + "New persona" : { + }, "New Persona" : { @@ -7019,10 +7632,6 @@ "comment" : "A message displayed when the user has not yet purchased the Medical Compliance subscription.", "isCommentAutoGenerated" : true }, - "No active session" : { - "comment" : "A label indicating that there is no active session.", - "isCommentAutoGenerated" : true - }, "No active session." : { }, @@ -7037,7 +7646,13 @@ "comment" : "A message displayed when the audit log is empty.", "isCommentAutoGenerated" : true }, - "No Conversations Yet" : { + "No cohort has a sealed turn with a recorded perceived latency yet." : { + + }, + "No conversations in this project yet." : { + + }, + "No conversations yet" : { }, "No custom personality set. Using the global agent soul." : { @@ -7047,6 +7662,15 @@ "No Custom Tools" : { "comment" : "A label displayed when a user has not created any custom tools.", "isCommentAutoGenerated" : true + }, + "No documents" : { + + }, + "No documents in this project yet. Attach files or scan documents from a chat in this project to ground answers here." : { + + }, + "No events yet." : { + }, "No Gateways Configured" : { "comment" : "A message displayed when a user has not configured any gateways.", @@ -7123,10 +7747,16 @@ "No MCP servers configured. Add one to connect external tools." : { "comment" : "A message displayed when no MCP servers are configured, encouraging the user to add one.", "isCommentAutoGenerated" : true + }, + "No meeting records yet" : { + }, "No memories yet. The agent learns from conversations." : { "comment" : "A description of the memory section of a persona detail view.", "isCommentAutoGenerated" : true + }, + "No model repository configured." : { + }, "No Models" : { @@ -7184,6 +7814,9 @@ "No models downloaded yet. Pick one below to get started." : { "comment" : "A message displayed when a user hasn't downloaded any local LLM models yet. It encourages them to do so.", "isCommentAutoGenerated" : true + }, + "No named speakers yet. Tap a speaker chip on a caption to name them." : { + }, "No network activity yet. Use the app and requests will appear here." : { "comment" : "A message displayed when there are no network requests to display in the Network Monitor View.", @@ -7201,6 +7834,18 @@ "No quick actions configured" : { "comment" : "A message displayed when there are no quick actions configured.", "isCommentAutoGenerated" : true + }, + "No Reading Yet" : { + + }, + "No recent destinations yet." : { + + }, + "No recordings yet" : { + + }, + "No remote commands yet." : { + }, "No Results" : { @@ -7209,9 +7854,18 @@ "comment" : "A message displayed when the user has not saved any scripts.", "isCommentAutoGenerated" : true }, - "No Siri Shortcuts found on this device. Type the exact name manually." : { - "comment" : "A description of the text field displayed when no shortcuts are found.", + "No sealed turns yet — %lld in flight." : { + + }, + "No sealed turns yet. A turn appears here once it's sealed." : { + + }, + "No Siri Shortcuts found on this device. Type the exact name manually." : { + "comment" : "A description of the text field displayed when no shortcuts are found.", "isCommentAutoGenerated" : true + }, + "No skill packs installed yet. Install one from the catalog below." : { + }, "No Skills Available" : { @@ -7226,10 +7880,16 @@ "No Subscription Found" : { "comment" : "A title for an alert that appears when a user tries to restore purchases but doesn't have an active Medical Compliance subscription.", "isCommentAutoGenerated" : true + }, + "No Suggestions" : { + }, "No tools discovered yet. Run “Discover Tools” on the MCP Servers screen." : { "comment" : "A message displayed when no tools have been discovered yet.", "isCommentAutoGenerated" : true + }, + "No transcript available." : { + }, "No Voice Skills" : { "comment" : "A label displayed when the user has no voice skills.", @@ -7278,6 +7938,9 @@ } } } + }, + "No Wi-Fi address available" : { + }, "None" : { "comment" : "A placeholder text in the \"Model\" section of the persona editor, indicating that no model has been selected.", @@ -7329,10 +7992,22 @@ } } } + }, + "Not paired" : { + + }, + "not recorded" : { + }, "Nothing queued — you're all caught up." : { "comment" : "A message displayed when there are no queued operations.", "isCommentAutoGenerated" : true + }, + "Notification Digest" : { + + }, + "nova-3 has the strongest diarization. Streaming is billed per minute of audio." : { + }, "Now playing" : { "comment" : "A section that displays the currently playing script.", @@ -7384,6 +8059,9 @@ } } } + }, + "OCR text" : { + }, "Off" : { "comment" : "A label indicating that a feature is currently disabled.", @@ -7391,6 +8069,9 @@ }, "Off by default. Turn this on if you want the AI to act on its own — running background tasks, scheduling actions, looping through multi-step plans. Tap %@ above for the full list of what it unlocks." : { + }, + "Off by default. When on, each turn sends a short prompt and recent lines only — no tool list or full system prompt. Use this for tight providers like Groq." : { + }, "Off by default. When on, the fitness coach may read your Apple Health workout history and send it to your configured AI provider (Anthropic, OpenAI, Google, etc.) so it can discuss your progress. Your Health data leaves the device only while this is enabled. On-device workout tracking, form analysis, and saving workouts to Apple Health work either way." : { "extractionState" : "manual", @@ -7442,6 +8123,9 @@ "Offline" : { "comment" : "A label for an offline connection.", "isCommentAutoGenerated" : true + }, + "Offline (or in HIPAA mode), translation runs entirely on the phone: SenseVoice transcribes, Apple Translation translates. Download the SenseVoice model under Speech Recognition; Apple's language pairs download on first use. Lower quality than the cloud tier, zero audio egress." : { + }, "Offline Mode" : { "extractionState" : "manual", @@ -7506,12 +8190,21 @@ }, "On-Device Model" : { + }, + "On-device recognition not in this build" : { + + }, + "On-Device Tier" : { + }, "On-Device Voice (Kokoro)" : { }, "Once daily" : { + }, + "One of: %@" : { + }, "Online" : { "comment" : "A label for a connected network.", @@ -7519,6 +8212,12 @@ }, "Only the top 4 actions are shown on the Voice tab. Drag to reorder priority." : { + }, + "Open a note, summary, or other saved content" : { + + }, + "Open OpenGlasses Content" : { + }, "Open Settings" : { "extractionState" : "manual", @@ -7567,14 +8266,10 @@ } } }, - "OpenAI Realtime — bidirectional voice streaming" : { - "comment" : "A description of an OpenAI Realtime connection.", - "isCommentAutoGenerated" : true - }, - "OpenAI Realtime details" : { + "Open the owning section in the app for the full record." : { }, - "OpenAI: %@" : { + "OpenAI Codex · Claude Code (remote)" : { }, "OpenClaw" : { @@ -7627,9 +8322,6 @@ } } } - }, - "OpenClaw Gateway details" : { - }, "OpenClaw tools are managed on your Mac. The 'execute' tool is added to the prompt when the gateway is connected." : { "comment" : "A footer description for the \"External Tools\" section in the ToolsSettingsView.", @@ -7684,11 +8376,20 @@ } } } + }, + "OpenGlasses Action" : { + + }, + "OpenGlasses Content" : { + + }, + "OpenGlasses didn't return a response. Try again." : { + }, "OpenGlasses Discord" : { }, - "OpenGlasses is an open-source community project. Join the Discord for help, ideas, and to share what you've built." : { + "OpenGlasses is busy with another request. Try again in a moment." : { }, "OpenGlasses is not running." : { @@ -7707,10 +8408,16 @@ }, "OpenGlasses Photo" : { + }, + "OpenGlasses turn ledger" : { + }, "Operator" : { "comment" : "A label for the condition operator picker.", "isCommentAutoGenerated" : true + }, + "optional" : { + }, "Optional — add these later in Settings if you prefer." : { @@ -7738,6 +8445,12 @@ "Options" : { "comment" : "A section of the task detail view that lets the user configure the task's options.", "isCommentAutoGenerated" : true + }, + "Options (comma-separated)" : { + + }, + "or paste an API key" : { + }, "Or type a name manually" : { "comment" : "A button that allows the user to enter a shortcut name manually.", @@ -7745,10 +8458,16 @@ }, "Oracle Health (Cerner) uses FHIR R4 with Millennium platform integration." : { + }, + "Orientation" : { + }, "OS" : { "comment" : "A label for the operating system requirements of a skill.", "isCommentAutoGenerated" : true + }, + "Other names, comma-separated (optional)" : { + }, "Outbound Data Policy" : { "comment" : "A heading for the outbound data policy section.", @@ -7757,6 +8476,9 @@ "Outbound policy for %@" : { "comment" : "A picker that lets the user select an outbound data policy for a server.", "isCommentAutoGenerated" : true + }, + "Override the bundled prices when they drift. Blank a field to fall back to the default. Estimates are local-only and never leave your device." : { + }, "Overview" : { "extractionState" : "manual", @@ -7804,10 +8526,19 @@ } } } + }, + "Pace" : { + }, "Pacing" : { "comment" : "A heading for the pacing options in the teleprompter settings.", "isCommentAutoGenerated" : true + }, + "Pack Settings" : { + + }, + "Packs are signed and verified before anything installs. The catalog itself is signed — an unverifiable index is refused outright." : { + }, "Page %lld of %lld" : { "localizations" : { @@ -7818,14 +8549,41 @@ } } } + }, + "Pages read" : { + + }, + "Pair with a one-time setup code instead of a shared token. The gateway issues a per-device token you can revoke independently." : { + + }, + "Pair With Setup Code" : { + + }, + "Paired" : { + + }, + "Paired Lenses" : { + + }, + "Pairing" : { + }, "Parameters" : { "comment" : "A label displayed above the list of parameters for a custom tool.", "isCommentAutoGenerated" : true + }, + "Paste" : { + + }, + "Paste a token to enable the backend — the endpoints are pre-filled (override the base URL only if your deployment differs). Tokens are stored in the Keychain. Live dispatch is verified against your endpoint." : { + }, "Paste any HuggingFace MLX model ID, e.g. \"mlx-community/phi-3-mini-4k-instruct-4bit\"" : { "comment" : "A description below the text field for entering a custom HuggingFace MLX model ID.", "isCommentAutoGenerated" : true + }, + "Paste authorization code" : { + }, "Paste license code" : { "comment" : "A label for a text field where a license code is pasted.", @@ -7886,12 +8644,18 @@ "Paste your %@ access key below" : { "comment" : "A description of what to do when adding an API key. The argument is the name of the AI provider.", "isCommentAutoGenerated" : true + }, + "Pasted as an Authorization: Bearer header." : { + }, "Patient ID" : { }, "Pause" : { + }, + "Pause recording" : { + }, "Pending" : { "comment" : "A label for the number of pending operations in the offline queue.", @@ -7900,6 +8664,9 @@ "Per-server outbound data policy, tool trust badges, and recent egress decisions." : { "comment" : "A section of MCP Servers that shows the safety and trust of each server.", "isCommentAutoGenerated" : true + }, + "Per-vault. Only session metadata (asset, date, outcome) is donated — never the audit log or captured values." : { + }, "Permission Denied" : { "comment" : "A title for an alert that appears when a user denies a tool's permission.", @@ -7908,9 +8675,6 @@ "Permissions" : { "comment" : "A title for the permissions page.", "isCommentAutoGenerated" : true - }, - "Perplexity API Key" : { - }, "Perplexity Search" : { @@ -8074,6 +8838,9 @@ }, "Personas are different characters with their own model + prompt (e.g. a museum docent, a fitness coach). System Prompt tweaks the default voice and behaviour." : { + }, + "Phone" : { + }, "Photo" : { "extractionState" : "manual", @@ -8139,6 +8906,9 @@ }, "Photos" : { + }, + "Photos are sent as captured unless they exceed the provider's hard limit, which these bounds enforce." : { + }, "Photos not available (text-only model)" : { "extractionState" : "manual", @@ -8201,6 +8971,18 @@ "Pick from the list or type a model ID. Turn on Vision to send photos from your glasses to the AI." : { "comment" : "A footer for the \"Model\" section in `ModelFormView`, explaining how users can select or input an LLM model.", "isCommentAutoGenerated" : true + }, + "Pin this frame" : { + + }, + "PINNED" : { + + }, + "Pinned frame — the assistant sees this. Tap to release." : { + + }, + "Pipeline" : { + }, "Plan" : { @@ -8255,6 +9037,9 @@ } } } + }, + "Play recording" : { + }, "Playbooks" : { "comment" : "A label displayed above the list of available guided task playbooks.", @@ -8268,12 +9053,11 @@ "comment" : "A description of how to use the teleprompter.", "isCommentAutoGenerated" : true }, - "Point your Claude Code MCP bridge at the LAN URL above. For remote access, run `cloudflared tunnel --url http://localhost:%u` on this network and use the public URL." : { - "comment" : "A message instructing the user to point their Claude Code MCP bridge at the LAN URL of the MCP server.", - "isCommentAutoGenerated" : true - }, "Port" : { + }, + "Portrait" : { + }, "Practitioner ID" : { @@ -8281,10 +9065,13 @@ "Pre-built templates for email, messages, health, smart home, and more. Preview each before installing." : { }, - "Pre-obtained OAuth token" : { + "Premium voice detected" : { }, - "Premium voice detected" : { + "Preserved meeting recordings with playback and transcripts, and summaries saved by the Meeting Summary tool." : { + + }, + "Preset" : { }, "Preset Name" : { @@ -8484,10 +9271,22 @@ "Professional-grade safeguards for clinical recordings" : { "comment" : "A description of the features of the Medical Compliance subscription.", "isCommentAutoGenerated" : true + }, + "Progress" : { + + }, + "Project" : { + + }, + "Project import" : { + }, "Prompt" : { "comment" : "A section header for the prompt text in a quick action.", "isCommentAutoGenerated" : true + }, + "Prompt (read aloud)" : { + }, "Prompt After Photo (optional)" : { "comment" : "A label displayed above a text field for a prompt that is sent to the AI after a photo is captured.", @@ -8688,12 +9487,21 @@ "Radius %lld m" : { "comment" : "A stepper that lets the user set the radius of a geofence around their home.", "isCommentAutoGenerated" : true + }, + "Raw audio is streamed to Deepgram's cloud for transcription — including the voices of anyone nearby, not just you. Many places (two-party-consent jurisdictions) require everyone's consent before their speech is recorded, and Deepgram may retain or use audio under its own terms. Unlike the on-device visual bystander filter, there is no audio equivalent — nearby speech is sent as captured. The key is stored in the Keychain; only enable this where recording bystanders is lawful and acceptable." : { + + }, + "Raw audio is streamed to Google's Gemini API for transcription and translation — including the voices of anyone nearby, not just you. Many places (two-party-consent jurisdictions) require everyone's consent before their speech is recorded, and Google may retain or use audio under its own terms. Only enable this where recording bystanders is lawful and acceptable." : { + }, "Read Text" : { }, "Read text visible through the glasses" : { + }, + "Reading" : { + }, "Reading Assistant" : { @@ -8701,6 +9509,9 @@ "Reading Level" : { "comment" : "A label for the reading level picker.", "isCommentAutoGenerated" : true + }, + "Reads American Sign Language fingerspelling through the glasses camera — the signer faces you, letters build into words, and committed words are spoken aloud and shown on the HUD. Recognition runs entirely on this device." : { + }, "Reads text through the glasses camera using on-device OCR. When enabled, the `reading_assist` tool can read aloud, simplify, translate, or define text you're looking at. Images never leave your device." : { "comment" : "A description of the reading accessibility feature.", @@ -8713,6 +9524,9 @@ "REC %@" : { "comment" : "A label indicating that video recording is active, showing the duration.", "isCommentAutoGenerated" : true + }, + "Recent Destinations" : { + }, "Recent Egress Decisions" : { "comment" : "A section title for the list of recent egress decisions.", @@ -8720,9 +9534,18 @@ }, "Recent Sessions" : { + }, + "Recents also appear in the glasses menu under Navigate." : { + + }, + "Recognition Model" : { + }, "Recognizer" : { + }, + "Recognizes ASL fingerspelling through the glasses camera and speaks the words — on-device, independent of Reading Accessibility." : { + }, "Recommended" : { "extractionState" : "manual", @@ -8774,13 +9597,37 @@ "Reconnecting..." : { "comment" : "A label that appears when the app is reconnecting.", "isCommentAutoGenerated" : true + }, + "Record Glasses Video" : { + + }, + "Record meeting" : { + + }, + "Recording" : { + }, "Recording & Transcripts" : { + }, + "Recording %@" : { + + }, + "Recording failed" : { + + }, + "Recording, %@" : { + }, "Recording: %@" : { "comment" : "A label that shows the duration of the current video recording.", "isCommentAutoGenerated" : true + }, + "Recordings" : { + + }, + "Reference copy" : { + }, "Reference Files" : { "localizations" : { @@ -8836,19 +9683,30 @@ "comment" : "A button that refreshes the sync status view.", "isCommentAutoGenerated" : true }, - "Registration: %lld — %@" : { - "localizations" : { - "en" : { - "stringUnit" : { - "state" : "new", - "value" : "Registration: %1$lld — %2$@" - } - } - } + "Regenerate" : { + + }, + "Regenerate token" : { + + }, + "Region" : { + + }, + "Register this URL once in the Meta AI app's Developer Mode. The access token rides the URL hash, which never appears in requests or logs. Rotating the token invalidates the registered URL." : { + + }, + "Registration URL" : { + + }, + "Remote Activity" : { + }, "Remote Agents" : { "comment" : "A screen that lets you configure a custom endpoint for the Remote Agent Harness.", "isCommentAutoGenerated" : true + }, + "Remote Invoke" : { + }, "Remove" : { @@ -8921,6 +9779,9 @@ }, "Renews" : { + }, + "Replay what was just said from the ambient audio buffer" : { + }, "Request" : { "comment" : "A section for the request part of a step.", @@ -8929,6 +9790,9 @@ "Requests are classified by complexity and routed to the assigned model. Memory and conversation context are always preserved." : { "comment" : "A description of the auto model routing feature.", "isCommentAutoGenerated" : true + }, + "Requests authenticate with OAuth on your GCP project — no API key." : { + }, "Required" : { "extractionState" : "manual", @@ -8983,22 +9847,34 @@ "Requirements" : { "comment" : "A heading for the requirements of a skill.", "isCommentAutoGenerated" : true + }, + "Requires Agent Mode" : { + + }, + "Requires Agent Mode (Settings → Tools & Actions → Agentic Features). Until it's on, turns keep using the normal model path." : { + }, "Requires Agent Mode. Enable Agent Mode first, then turn this on." : { "comment" : "A description of the MCP server.", "isCommentAutoGenerated" : true }, - "Reset Reg" : { + "Reset Bridge Conversation" : { }, "Reset to Default" : { + }, + "Reset to defaults" : { + }, "Reset to Defaults" : { }, "Resets soul, skills, and memory to factory defaults. Your learned memories will be lost." : { + }, + "Resize and compress photos before they're sent to the AI for description — keeps context smaller while preserving readable detail." : { + }, "Resolution" : { @@ -9115,6 +9991,9 @@ } } } + }, + "Reveal" : { + }, "Review complete" : { "comment" : "A title for a view that appears when a user has reviewed all of their flashcards.", @@ -9123,12 +10002,33 @@ "Review flashcards (%lld)" : { "comment" : "A label that opens a view that lets the user review flashcards.", "isCommentAutoGenerated" : true + }, + "Right" : { + + }, + "Rotate Token" : { + + }, + "Route via Hermes Bridge" : { + }, "RTMP URL" : { + }, + "Run Action" : { + + }, + "Run All" : { + + }, + "Run an OpenGlasses action you've exposed for voice — built-in, authored, or custom" : { + }, "Run Now" : { + }, + "Run OpenGlasses Action" : { + }, "Run Purge Now" : { @@ -9139,6 +10039,9 @@ "Running: %@" : { "comment" : "A tool callout button. The argument is the tool callout text.", "isCommentAutoGenerated" : true + }, + "Running…" : { + }, "Runs approximately every %lld minutes when the agent is idle." : { @@ -9230,6 +10133,9 @@ "Save %@/year" : { "comment" : "A label showing the savings from switching from a monthly subscription to an annual subscription. The argument is the savings amount.", "isCommentAutoGenerated" : true + }, + "Save Codex / Claude Code" : { + }, "Save Configuration" : { @@ -9237,6 +10143,9 @@ "Save endpoint" : { "comment" : "A button that saves a custom agent endpoint.", "isCommentAutoGenerated" : true + }, + "Save prices" : { + }, "Save Result As" : { "comment" : "A label displayed above a text field that lets the user name the output of a step.", @@ -9246,9 +10155,14 @@ "comment" : "A button that saves a scanned script to the store.", "isCommentAutoGenerated" : true }, - "Save text (e.g. from an Apple Note, Reminder, or file) as a teleprompter script in OpenGlasses." : { - "comment" : "Description of the Add Teleprompter Script intent.", - "isCommentAutoGenerated" : true + "Save text — for example from a note, a reminder, or a file — as a teleprompter script in OpenGlasses." : { + + }, + "Save This Location" : { + + }, + "Save your current location under a name you choose" : { + }, "Saved" : { "comment" : "A label that indicates that the endpoint has been saved.", @@ -9262,13 +10176,24 @@ "comment" : "A subheading describing how to activate a mode. The argument is the mode's wake phrase.", "isCommentAutoGenerated" : true }, - "Say \"Hey OpenGlasses\" or tap the mic to start a conversation." : { - "comment" : "A description of how to use the app.", - "isCommentAutoGenerated" : true + "Say “navigate to …” to start walking directions — each turn shows in-lens and is spoken as you approach it. Walking routes only; driving stays with CarPlay. Routing needs a network connection." : { + + }, + "Say \"OpenGlasses\" or tap the mic to start a conversation." : { + }, "Say \"start [playbook name]\" to begin a guided workflow. Use steps, conditions, HTTP requests, and variables to build powerful SOPs." : { "comment" : "A description of the Playbooks settings screen.", "isCommentAutoGenerated" : true + }, + "Say “start reading” with a book's title and the glasses will follow along." : { + + }, + "Say “what's new” (or pick What's new in the HUD menu) for one ranked glance of pending calendar, location, and agent notifications — instead of one-at-a-time interruptions." : { + + }, + "Say \"yes\" or \"no\", or tap." : { + }, "Say this phrase to activate this persona. Add alternatives for common misrecognitions." : { "comment" : "A footer for the \"Wake Word\" section in the PersonaEditorView, explaining the purpose of the \"Alternative spellings\" text field.", @@ -9277,6 +10202,12 @@ "Scan a page (camera)" : { "comment" : "A button that scans a page with the camera.", "isCommentAutoGenerated" : true + }, + "Scan for Lenses" : { + + }, + "Scan local network" : { + }, "Scanning…" : { "comment" : "A button that scans a page with the camera.", @@ -9285,6 +10216,9 @@ "Scenarios — %@" : { "comment" : "A heading for a section of the persona picker that lists scenarios (procedures) in a vault. The argument is the name of the vault.", "isCommentAutoGenerated" : true + }, + "Scene Narration" : { + }, "Schedule" : { "comment" : "A label displayed above the task's schedule.", @@ -9292,10 +10226,16 @@ }, "Scheduled Tasks" : { + }, + "Scope" : { + }, "Screens tool arguments for secrets and personal data before they leave the device. Default: Redact." : { "comment" : "A description of the \"Outbound Data Policy\" setting.", "isCommentAutoGenerated" : true + }, + "Script Name" : { + }, "Script Text" : { @@ -9388,6 +10328,12 @@ "Selected: %@" : { "comment" : "A label that indicates whether a preset is selected. The argument is the name of the preset.", "isCommentAutoGenerated" : true + }, + "Send" : { + + }, + "Send a short spoken-style prompt, your last few lines, and the photo if any — no tool list or full system prompt. Off by default. Turn on for tight providers like Groq (8k token cap)." : { + }, "Send message" : { "comment" : "A button that sends a message.", @@ -9395,6 +10341,15 @@ }, "Sends a metadata request to verify the FHIR server is reachable and responds to capability queries." : { + }, + "SenseVoice model installed" : { + + }, + "SenseVoice model not downloaded" : { + + }, + "Sent as the %@ header." : { + }, "Server" : { "extractionState" : "manual", @@ -9443,12 +10398,11 @@ } } }, - "Server unreachable" : { - "comment" : "A message indicating that the server is not reachable.", - "isCommentAutoGenerated" : true - }, "Server URL" : { + }, + "Serves the current HUD frame to the glasses' built-in web view — no display entitlement needed. Read-only: item labels render, actions stay on the phone." : { + }, "Service" : { "comment" : "A label for the Home Assistant service picker.", @@ -9507,10 +10461,6 @@ } } }, - "Set up OpenClaw in Settings to enable Mac-powered tools." : { - "comment" : "A message explaining that the user needs to set up OpenClaw in the app settings to use its features.", - "isCommentAutoGenerated" : true - }, "Settings" : { "extractionState" : "manual", "localizations" : { @@ -9569,6 +10519,15 @@ } } } + }, + "Settings are locked" : { + + }, + "Setup Code" : { + + }, + "Share Audio" : { + }, "Share Health Data with AI" : { "extractionState" : "manual", @@ -9616,9 +10575,21 @@ } } } + }, + "Share meeting record" : { + + }, + "Share Preview HTML" : { + }, "Share Sheet" : { + }, + "Share transcript" : { + + }, + "Share URL" : { + }, "Shared agent memory (memory.md). The agent updates this as it learns about you." : { "comment" : "A description of the memory of a persona.", @@ -9633,16 +10604,55 @@ "Shortcut Templates" : { "comment" : "A heading for the list of shortcut templates.", "isCommentAutoGenerated" : true + }, + "Show on Reconnect" : { + + }, + "Show on Reconnect flashes the digest once when the glasses reconnect and something urgent is pending — never while you're away, and never in power reserve." : { + + }, + "Show Original" : { + + }, + "Show Original adds the source-language words under each translated caption." : { + + }, + "Sign in with Google" : { + + }, + "Sign in with your ChatGPT account — no API key needed" : { + + }, + "Sign in with your Claude account, or paste an API key" : { + + }, + "Sign Language" : { + + }, + "Sign out" : { + + }, + "Sign Out" : { + + }, + "Similarity threshold" : { + }, "Simplify Default" : { "comment" : "A label displayed above the default reading level picker.", "isCommentAutoGenerated" : true + }, + "Siri & Search" : { + }, "Siri Shortcut" : { "comment" : "A section header for configuring a Siri Shortcut action.", "isCommentAutoGenerated" : true }, - "sk-..." : { + "Sittings" : { + + }, + "Size cap" : { }, "Skill Details" : { @@ -9693,6 +10703,12 @@ } } } + }, + "Skill Pack" : { + + }, + "Skill Packs" : { + }, "Skill Prompt" : { "comment" : "A label displayed above the skill prompt.", @@ -9766,6 +10782,9 @@ "Skip this section if you don't run your own server — most users won't need a gateway." : { "comment" : "A description of the gateway settings screen.", "isCommentAutoGenerated" : true + }, + "Small context" : { + }, "Smart Routing" : { @@ -9777,10 +10796,19 @@ "Sorry, I couldn't get an answer." : { "comment" : "Error message when the ask intent fails to get an answer.", "isCommentAutoGenerated" : true + }, + "Speak & display (output)" : { + + }, + "Speak descriptions aloud" : { + }, "Speak recap" : { "comment" : "A button that speaks a recap of your usage.", "isCommentAutoGenerated" : true + }, + "Speak replies" : { + }, "Speak Result" : { @@ -9788,6 +10816,15 @@ "Speak the result aloud via TTS, or run silently in the background." : { "comment" : "A description of the speakResult toggle.", "isCommentAutoGenerated" : true + }, + "Speaker %@. Tap to name." : { + + }, + "Speaker %lld" : { + + }, + "Speakers" : { + }, "Speaking..." : { "extractionState" : "manual", @@ -9917,6 +10954,15 @@ "Speed: %lld WPM" : { "comment" : "A label and slider that lets the user adjust the speed of the teleprompter. The argument is the current speed in words per minute.", "isCommentAutoGenerated" : true + }, + "spoke before generation finished" : { + + }, + "Spoken messages per minute: %lld" : { + + }, + "Spotlight donation is disabled while Medical Compliance Mode is on." : { + }, "Standard" : { @@ -9928,6 +10974,9 @@ "Start %@:00" : { "comment" : "A label that shows the start time of the quiet hours. The value is bound to a `Stepper`", "isCommentAutoGenerated" : true + }, + "Start a chat — works with or without your glasses." : { + }, "Start a Field Assist session on %@ and run “%@”." : { "comment" : "A confirmation dialog message that asks the user to start a Field Assist session on a vault and run a specific procedure. The first argument is the name of the vault. The second argument is the title of the", @@ -10169,6 +11218,15 @@ }, "Start or stop a Gemini Live session" : { + }, + "Start or stop broadcasting the glasses camera over RTMP" : { + + }, + "Start or stop recording video on the glasses" : { + + }, + "Start Recognizing" : { + }, "Start Recording" : { @@ -10180,16 +11238,28 @@ "Start session?" : { "comment" : "A confirmation dialog asking the user to start a session.", "isCommentAutoGenerated" : true + }, + "Start Teleprompter" : { + + }, + "Start the teleprompter, optionally with a saved script" : { + }, "Start wake word detection and Live Activity" : { }, "Started: %@" : { + }, + "starts here" : { + }, "Status" : { "comment" : "A label displayed above the connection status of the app.", "isCommentAutoGenerated" : true + }, + "Status & transcript (observe)" : { + }, "Status: %@" : { @@ -10197,6 +11267,9 @@ "Step" : { "comment" : "A section of a step editor that allows editing the step's title and type.", "isCommentAutoGenerated" : true + }, + "Step %lld" : { + }, "Step %lld of %lld" : { "localizations" : { @@ -10340,16 +11413,27 @@ } } } + }, + "Stop Recognizing" : { + }, "Stop Recording" : { }, - "Stop Session" : { - "comment" : "A button label that stops a Gemini Live session.", - "isCommentAutoGenerated" : true + "Stop Scanning" : { + + }, + "Stop Teleprompter" : { + + }, + "Stop the running teleprompter" : { + }, "Stop wake word detection and end Live Activity" : { + }, + "Stopped" : { + }, "Storage Used" : { "comment" : "A label displayed under the size of the storage used by the app.", @@ -10359,7 +11443,7 @@ "comment" : "A footer for the Agent Harness Settings view.", "isCommentAutoGenerated" : true }, - "Stream Key" : { + "Streak" : { }, "Stream transport" : { @@ -10429,6 +11513,15 @@ "Subscription renews automatically. Cancel anytime in Settings → Apple ID → Subscriptions." : { "comment" : "A description of the terms of a subscription.", "isCommentAutoGenerated" : true + }, + "Suggested Skills" : { + + }, + "Summaries appear here after the Meeting Summary tool runs. Say \"hey meeting\", or ask the assistant to summarize the meeting." : { + + }, + "Summarize the conversation captured by ambient captions" : { + }, "Summary" : { "extractionState" : "manual", @@ -10572,6 +11665,12 @@ } } } + }, + "Switch Broadcast Camera" : { + + }, + "Switch model" : { + }, "Switch Model" : { "extractionState" : "manual", @@ -10625,6 +11724,9 @@ } } } + }, + "Switch persona" : { + }, "Switch the active knowledge vault. Each vault can link its own model, used only while a session is running. Tap Manage for license, vault editing, and sessions." : { "comment" : "A footer for the Field Assist section of the persona picker.", @@ -10676,6 +11778,9 @@ } } } + }, + "Switch to push to talk" : { + }, "Switch to voice input" : { "comment" : "A button that switches to voice input.", @@ -10727,6 +11832,9 @@ } } } + }, + "Switch to wake word listening" : { + }, "Sync" : { "comment" : "A section title for the sync status.", @@ -10789,6 +11897,9 @@ } } } + }, + "Take a photo on the glasses and save it" : { + }, "Take a photo with the glasses and analyze it" : { @@ -10925,9 +12036,8 @@ "comment" : "A footer for the list of system prompt presets.", "isCommentAutoGenerated" : true }, - "Tap the Model button below to switch models" : { - "comment" : "A description of the feature that lets you switch between different models.", - "isCommentAutoGenerated" : true + "Tap the record button to capture a meeting. Recordings and their transcripts appear here." : { + }, "Tap to cancel" : { "extractionState" : "manual", @@ -11145,6 +12255,9 @@ }, "Task name" : { + }, + "tavily.com" : { + }, "Teach skills by voice, e.g. “learn that when I say ‘expense this’, create a note tagged EXPENSE.” Then export them here to move to another device." : { "comment" : "A description of how to use the voice skills library.", @@ -11260,6 +12373,9 @@ }, "Testing…" : { + }, + "Text" : { + }, "Text-to-Speech" : { "extractionState" : "manual", @@ -11308,7 +12424,13 @@ } } }, - "The agent will ask you questions to learn about you and customize its personality. Say \"Hey OpenGlasses\" to begin." : { + "That action is turned off in OpenGlasses Settings → Siri & Search." : { + + }, + "That action no longer exists. Check OpenGlasses Settings → Siri & Search." : { + + }, + "The agent will ask you questions to learn about you and customize its personality. Say \"OpenGlasses\" to begin." : { }, "The AI receives this message. Tap {{ }} to insert a variable from a previous step." : { @@ -11319,13 +12441,24 @@ "comment" : "A description of the last reasoning.", "isCommentAutoGenerated" : true }, - "The gateway token from your server's config." : { - "comment" : "A description of the gateway token field.", - "isCommentAutoGenerated" : true + "The bridge prints its address and port when it starts. Leave the token empty unless the bridge was started with one." : { + + }, + "The catalog is empty right now." : { + + }, + "The EVEN protocol support is early: it is based on a community reconstruction and hasn't been validated against hardware yet. The display path stays inert until lenses are paired here." : { + + }, + "The gateway token from your server's config — or leave blank and pair this device below." : { + }, "The geofence rule blocks smart-home / Home Assistant actuation when you're outside this region. Turn the rule on above after setting a home." : { "comment" : "A description of the home region geofence rule.", "isCommentAutoGenerated" : true + }, + "The glasses run their own companion app for developer access, updated separately from the firmware and from the Meta AI app on your phone. If streaming is refused as needing an update, this is usually the one to open." : { + }, "The Home Assistant service to call." : { "comment" : "A description of the Home Assistant service field.", @@ -11346,10 +12479,16 @@ "The MCP endpoint URL. %@ connections aren't wired for live calls yet — the server will be saved but won't connect until SSE support ships." : { "comment" : "A note that a live connection isn't yet supported for a given transport.", "isCommentAutoGenerated" : true + }, + "The mirror serves HUD content over the network, so HIPAA mode hard-disables it." : { + }, "The name is how the AI calls this tool. The description tells it when to use it." : { "comment" : "A footer in the \"Tool Identity\" section of the custom tool editor, explaining the purpose of each field.", "isCommentAutoGenerated" : true + }, + "The order of everything in the Voice tab's control bar — Quick Actions is the block configured above. Drag to reorder; buttons that only appear in context (Preview, Disconnect) keep their conditions, just in your order." : { + }, "The Personal Health Vault unlocks with the Medical Compliance subscription." : { "comment" : "A description of the Health Vault.", @@ -11361,6 +12500,9 @@ "The reading level used when you ask to simplify text without specifying one." : { "comment" : "A description of the reading level used when you ask to simplify text without specifying one.", "isCommentAutoGenerated" : true + }, + "The recognizer and its landmark extractor download once (~32 MB) and then work offline." : { + }, "The script text was empty." : { "comment" : "Error message when the teleprompter script is empty.", @@ -11369,7 +12511,7 @@ "The script to save" : { }, - "The system prompt that shapes how this persona responds." : { + "The system prompt that shapes how this persona responds. Editing a built-in prompt makes it your own copy, safe from app updates." : { }, "The target language used when you ask to translate text without specifying one." : { @@ -11379,6 +12521,9 @@ "The URL scheme to open. Examples: weixin://, spotify://, shortcuts://" : { "comment" : "A description of the URL scheme field in the Quick Action Editor.", "isCommentAutoGenerated" : true + }, + "Their Language" : { + }, "Theme" : { @@ -11397,9 +12542,8 @@ "comment" : "A description of the languages that are included with the app.", "isCommentAutoGenerated" : true }, - "These models are tested on iPhone and optimized for size. Larger models need more RAM." : { - "comment" : "A footer in the Local Model Manager View, describing the recommended model sizes.", - "isCommentAutoGenerated" : true + "These models are tested on iPhone and optimized for size. Larger models need more RAM. Keep the app open while downloading — the screen stays awake automatically." : { + }, "These tools are available to the AI alongside built-in tools. Disable them in Settings → Tools." : { "comment" : "A footer description under the section titled \"Custom Tools\", explaining that these tools are available to the AI alongside built-in tools and that they can be disabled in the \"Tools\" section of the app settings.", @@ -11466,6 +12610,9 @@ }, "This app provides technical safeguards (encryption, access control, audit logging, data retention) to support medical data compliance. It does not constitute a complete compliance programme." : { + }, + "This device" : { + }, "This mode is restricted to %lld specific tools." : { "comment" : "A footer that describes the number of tools that the mode is restricted to.", @@ -11493,6 +12640,9 @@ }, "This will:\n• Require biometric authentication to open the app\n• Encrypt all recordings and transcripts at rest\n• Disable web search and external messaging\n• Exclude clinical data from iCloud backup\n• Enable audit logging of all data access" : { + }, + "Through the book" : { + }, "Tier Assignments" : { "comment" : "A section header for the list of model tiers.", @@ -11500,6 +12650,9 @@ }, "TikTok" : { + }, + "Time" : { + }, "Title" : { "comment" : "A label for the title of a step.", @@ -11508,6 +12661,9 @@ "Title (optional)" : { "comment" : "A label for the title of a teleprompter script.", "isCommentAutoGenerated" : true + }, + "Toggle Broadcast" : { + }, "Toggle Gemini Live" : { "comment" : "AppIntent for the iPhone Action Button — toggles a Gemini Live session.", @@ -11515,13 +12671,16 @@ }, "Toggle OpenGlasses" : { - }, - "Token" : { - }, "Token estimate is approximate (~4 characters per token)." : { "comment" : "A footer note explaining that token estimates are approximate and based on an average of 4 characters per token.", "isCommentAutoGenerated" : true + }, + "Tokens & estimated cost" : { + + }, + "Tool" : { + }, "Tool Identity" : { "extractionState" : "manual", @@ -11572,9 +12731,15 @@ }, "Tool name (e.g. log_water)" : { + }, + "Tool time (%lld×)" : { + }, "Tools" : { + }, + "Tools & Actions" : { + }, "Tools the AI Can Use" : { @@ -11595,6 +12760,15 @@ } } } + }, + "Transcribe Again" : { + + }, + "Transcript" : { + + }, + "Transcript %@" : { + }, "Transcript Save Location" : { @@ -11607,6 +12781,12 @@ }, "Transcripts will be automatically uploaded to the configured FHIR server when a recording stops. You can also share manually at any time." : { + }, + "Translate Captions" : { + + }, + "Translate Into" : { + }, "Translate Text" : { @@ -11614,6 +12794,12 @@ "Translate To" : { "comment" : "A label for the translation language picker.", "isCommentAutoGenerated" : true + }, + "Translated captions — surrounding speech rendered in your language. Off by default." : { + + }, + "Translation" : { + }, "Translation Default" : { "comment" : "A label displayed above the user's preferred translation language.", @@ -11669,6 +12855,9 @@ "Transport" : { "comment" : "A label for the transport method of a MCP server.", "isCommentAutoGenerated" : true + }, + "Try again" : { + }, "Try Again" : { "extractionState" : "manual", @@ -11728,6 +12917,12 @@ } } } + }, + "TTS lead-in" : { + + }, + "Tuning" : { + }, "Tunnel / Tailscale Host" : { @@ -11735,20 +12930,41 @@ "Turn on Vision to send photos from your glasses to the AI. Leave it off for text-only models." : { "comment" : "A footer in the `ModelFormView` that explains the purpose of the \"Vision\" toggle.", "isCommentAutoGenerated" : true + }, + "Turn Timeline" : { + + }, + "Turn-by-turn pedestrian directions on the HUD — “navigate to…”." : { + }, "Twitch" : { + }, + "Twitch Channel" : { + + }, + "Two-Way Conversation" : { + }, "Type" : { "comment" : "A label for the type of a step.", "isCommentAutoGenerated" : true }, - "Type a message..." : { + "Type below — works with or without your glasses." : { }, "Unavailable" : { "comment" : "A label displayed when a vault is unavailable.", "isCommentAutoGenerated" : true + }, + "Uninstall" : { + + }, + "Unit (e.g. psig)" : { + + }, + "Units" : { + }, "Unlock" : { @@ -11849,12 +13065,30 @@ } } } + }, + "Unpair This Device" : { + + }, + "Unsigned — developer install" : { + + }, + "Update" : { + + }, + "Update Glasses App" : { + + }, + "Update Glasses Firmware" : { + }, "URL scheme (e.g., weixin://)" : { }, "URL template" : { + }, + "USD per 1M tokens" : { + }, "Use {{param_name}} for placeholders. Example: myapp://action?value={{amount}}" : { "comment" : "A description for the URL template field in the Custom Tool Editor.", @@ -11917,6 +13151,9 @@ } } } + }, + "Using your Gemini API key" : { + }, "v%@ — %lld reference files" : { "localizations" : { @@ -11928,9 +13165,22 @@ } } }, + "v%@ · %lld action%@" : { + "localizations" : { + "en" : { + "stringUnit" : { + "state" : "new", + "value" : "v%1$@ · %2$lld action%3$@" + } + } + } + }, "Validate key & fetch models" : { "comment" : "A button label that triggers the validation and fetching of LLM models when tapped.", "isCommentAutoGenerated" : true + }, + "Validates the flow and exports its JSON. Save it into a vault's flows/ folder (via Vault import) to run it with the capture_flow tool." : { + }, "Validating…" : { "comment" : "A text label indicating that the app is currently validating the API key and fetching available models.", @@ -11947,6 +13197,9 @@ "variable_name" : { "comment" : "A placeholder for the variable name in the step editor.", "isCommentAutoGenerated" : true + }, + "Verifying download…" : { + }, "Verifying…" : { @@ -11954,9 +13207,11 @@ "Version" : { }, - "via %@" : { - "comment" : "A text label inside the connection pill that shows the connection method used by OpenClaw. The argument is a string describing the connection method (e.g. \"Wi-Fi\").", - "isCommentAutoGenerated" : true + "Video" : { + + }, + "Video Quality" : { + }, "View full report" : { @@ -12060,6 +13315,9 @@ }, "Vision enabled" : { + }, + "Vision Images" : { + }, "Vision Mode" : { @@ -12110,9 +13368,15 @@ } } } + }, + "Voice & Triggers" : { + }, "Voice Command" : { + }, + "Voice Cues" : { + }, "Voice Engine" : { @@ -12179,6 +13443,9 @@ "Wait" : { "comment" : "A section for specifying the wait time before the next step begins.", "isCommentAutoGenerated" : true + }, + "waited after generation finished" : { + }, "Wake Phrase" : { "extractionState" : "manual", @@ -12273,6 +13540,18 @@ } } } + }, + "Walking Navigation" : { + + }, + "Watch the scene" : { + + }, + "Watching…" : { + + }, + "Web HUD Mirror" : { + }, "Web Search" : { "extractionState" : "manual", @@ -12321,7 +13600,10 @@ } } }, - "Web searches use Perplexity AI with cited sources." : { + "Web searches use Perplexity AI with cited sources%@." : { + + }, + "Web searches use Tavily with cited sources." : { }, "WebRTC Connection" : { @@ -12442,6 +13724,9 @@ "What it can do" : { "comment" : "A section title that describes what a catalogue entry can do.", "isCommentAutoGenerated" : true + }, + "What it does" : { + }, "What to ask the AI. For photo actions, the photo is sent alongside this prompt." : { "comment" : "A description of what to ask the AI in the prompt field of a Quick Action.", @@ -12470,10 +13755,22 @@ "When enabled, the result is spoken via TTS. When off, the task runs silently in the background." : { "comment" : "A description of the TTS setting.", "isCommentAutoGenerated" : true + }, + "When on, the bridge answers your queries with its own tools and memory; the app still transcribes and speaks on-device. If the bridge is unreachable the turn falls back to the normal model path automatically." : { + + }, + "When on, the glasses stop sending the live AI a new frame while the scene hasn't visibly changed — saving bandwidth and tokens. Distinct views still flow." : { + + }, + "When the assistant repeatedly stumbles on the same kind of task (with Agent Mode on), it proposes a skill to fix it here for you to approve. Nothing is applied without your review." : { + }, "Where the mic listens and how audio is routed. Tap any %@ for a full explanation. Glasses mic uses more battery but is truly hands-free." : { "comment" : "A description of the mic and audio routing. The argument is the “info.circle” symbol.", "isCommentAutoGenerated" : true + }, + "Where the wake-word listener captures voice. Glasses Mic enables true hands-free use but streams Bluetooth audio continuously (more battery) — and on Display glasses the active hands-free link covers the lens HUD with the call screen. Headset Mic keeps voice in your earbuds while the lens keeps the HUD; it never falls back to the glasses mic. iPhone Mic never re-routes to Bluetooth." : { + }, "Whether the Voice tab shows just the top four actions or every action in a wrapping grid." : { @@ -12485,12 +13782,24 @@ "Which backend the “code_agent” voice tool dispatches to. OpenClaw uses your existing gateway connection; Custom uses the endpoint below." : { "comment" : "A description of the available backends.", "isCommentAutoGenerated" : true + }, + "Which glasses render the in-lens HUD. Camera and voice are unaffected — Ray-Ban camera plus EVEN G2 display works together. Takes effect on the next HUD update." : { + }, "Window" : { }, "Work done without signal is saved on the device and syncs automatically when you're back online. Tap to see what's queued." : { + }, + "Works best with %@" : { + + }, + "Works best with the signer 1–2 m away, facing the camera, at a camera frame rate of 15 fps or higher (Settings › Look & Feel › Camera)." : { + + }, + "Writes the current HUD frame as a self-contained HTML file — open it in any browser at 600×600 to preview exactly what the glasses would render. Arrow keys stand in for the D-pad." : { + }, "You" : { "extractionState" : "manual", @@ -12572,16 +13881,18 @@ "You're ready" : { "comment" : "A title for the \"Ready\" onboarding page.", "isCommentAutoGenerated" : true + }, + "Your Capabilities" : { + + }, + "Your Language" : { + }, "Your organisation is responsible for: staff training, risk assessments, incident response procedures, data processing agreements with cloud providers, and any jurisdiction-specific administrative requirements." : { }, "Your organisation's responsibility" : { - }, - "Your voice conversations will appear here." : { - "comment" : "A description text that appears when there are no voice conversations available.", - "isCommentAutoGenerated" : true }, "YouTube" : { diff --git a/OpenGlasses/Sources/Services/Camera/MetaCameraBackend.swift b/OpenGlasses/Sources/Services/Camera/MetaCameraBackend.swift index 17ff2a0eb..30a7f2145 100644 --- a/OpenGlasses/Sources/Services/Camera/MetaCameraBackend.swift +++ b/OpenGlasses/Sources/Services/Camera/MetaCameraBackend.swift @@ -59,6 +59,9 @@ final class MetaCameraBackend: GlassesCameraBackend { /// BR P2: listener on the DeviceSession's error stream (update-required and terminal /// device errors surface here, not on the camera Stream's errorPublisher). private var sessionErrorTask: Task? + /// Latest stream error seen while waiting for `.streaming`. Blind `start()` nudges after + /// `.videoStreamingError` just replay the same failure; outer callers rebuild instead. + private var lastStreamError: StreamError? /// BR P2: actionable compatibility copy ("update the Meta AI app…") when the DAT layer /// reports an update requirement. Nil when compatible. Read by the retry loop to stop @@ -379,6 +382,7 @@ final class MetaCameraBackend: GlassesCameraBackend { let message = CameraErrorPolicy.message(for: error) NSLog("[Camera] Error: %@", message) self.debug("Camera error: \(message)") + self.lastStreamError = error // Device-traced 2026-08-23: this copy already said exactly what was wrong // ("hinges are closed", "too hot", "battery is too low") and went only to the log @@ -405,6 +409,7 @@ final class MetaCameraBackend: GlassesCameraBackend { /// Wait for the session to reach `.streaming` state, starting it if necessary. private func waitForStreaming(timeout: TimeInterval = 20) async throws { guard let session = streamSession else { throw CameraError.captureFailed } + lastStreamError = nil // Start the session if it is not already running. `.paused` counts: a stream paused after // a one-off capture (see `pauseStreamAfterCapture`) is idle, not broken. @@ -415,10 +420,22 @@ final class MetaCameraBackend: GlassesCameraBackend { // Wait for streaming state. During a cold start the stream bounces through .stopped // (device-traced: ~15-18s of .stopped/.waitingForDevice churn before .streaming), so a // transient .stopped is NOT terminal — nudge start() again a few times before giving up. + // Exception: `.videoStreamingError` / `.internalError` mean start already failed — more + // nudges only replay the same cycle (field log: waiting→starting→stopping→error×3). var restartNudges = 0 let deadline = ContinuousClock.now + .seconds(timeout) while ContinuousClock.now < deadline { if session.state == .streaming { break } + if let err = lastStreamError, + case .videoStreamingError = err { + NSLog("[Camera] Aborting warmup after videoStreamingError — needs stream rebuild") + throw CameraError.streamNotReady + } + if let err = lastStreamError, + case .internalError = err { + NSLog("[Camera] Aborting warmup after internalError — needs stream rebuild") + throw CameraError.streamNotReady + } if session.state == .stopped || session.state == .paused { if restartNudges < 3 { restartNudges += 1 @@ -685,8 +702,32 @@ final class MetaCameraBackend: GlassesCameraBackend { do { try await ensurePermission() - try await ensureSession() - try await waitForStreaming() + // Match capturePhoto: after a paused one-off capture, start() can fail with + // videoStreamingError. Rebuild stream (then session) rather than fail the smart + // camera turn on the first dead start cycle. + var lastError: Error? + for attempt in 1...2 { + do { + try await ensureSession() + try await waitForStreaming(timeout: attempt == 1 ? 10 : 20) + lastError = nil + break + } catch { + NSLog("[Camera] startStreaming attempt %d failed: %@", + attempt, error.localizedDescription) + lastError = error + if attempt < 2 { + let action = StreamRecoveryPolicy.action(consecutiveFailures: attempt - 1) + if action == .rebuildStream { + await teardownStreamOnly() + } else { + await resetSession() + } + try await Task.sleep(nanoseconds: 1_000_000_000) + } + } + } + if let error = lastError { throw error } } catch { continuousStreamingIntent = false throw error diff --git a/OpenGlasses/Sources/Services/CameraService.swift b/OpenGlasses/Sources/Services/CameraService.swift index d03c5f21c..9f735e927 100644 --- a/OpenGlasses/Sources/Services/CameraService.swift +++ b/OpenGlasses/Sources/Services/CameraService.swift @@ -71,9 +71,6 @@ class CameraService: ObservableObject { /// a simulator with an unresolved camera privacy decision, hangs waiting for a prompt. private let phoneSource: PhoneCameraCapturing - /// Name of the Photos album where glasses photos are saved. - private nonisolated static let albumName = "Glasses" - /// `nil` means the default Meta/DAT backend and the real iPhone camera. The backend is built /// here rather than as a default argument because a default argument expression is evaluated /// nonisolated, and the backend is main-actor bound; the phone source takes the same shape so @@ -217,66 +214,13 @@ class CameraService: ObservableObject { // MARK: - Photo Library - /// Save photo data to the "Glasses" album in the photo library. func saveToPhotoLibrary(_ data: Data) { guard let image = UIImage(data: data) else { return } - - PHPhotoLibrary.requestAuthorization(for: .addOnly) { status in - guard status == .authorized || status == .limited else { - NSLog("[Camera] Photo library access denied") - return - } - - // Fetch/create album BEFORE performChanges to avoid nested change block deadlock - let album = self.fetchGlassesAlbum() - - PHPhotoLibrary.shared().performChanges { - let creationRequest = PHAssetChangeRequest.creationRequestForAsset(from: image) - - if let album { - let albumChangeRequest = PHAssetCollectionChangeRequest(for: album) - if let placeholder = creationRequest.placeholderForCreatedAsset { - albumChangeRequest?.addAssets([placeholder] as NSArray) - } - } - } completionHandler: { success, error in - if success { - print("📸 Photo saved to Glasses album") - } else if let error { - NSLog("[Camera] Save to album failed: %@", error.localizedDescription) - // Fallback: save without album - UIImageWriteToSavedPhotosAlbum(image, nil, nil, nil) - print("📸 Photo saved to camera roll (album unavailable)") - } - } - } - } - - /// Fetch the "Glasses" album, creating it if it doesn't exist. - private nonisolated func fetchGlassesAlbum() -> PHAssetCollection? { - let fetchOptions = PHFetchOptions() - fetchOptions.predicate = NSPredicate(format: "title = %@", CameraService.albumName) - let collections = PHAssetCollection.fetchAssetCollections(with: .album, subtype: .any, options: fetchOptions) - - if let existing = collections.firstObject { - return existing - } - - // Create the album synchronously - var localIdentifier: String? - do { - try PHPhotoLibrary.shared().performChangesAndWait { - let createRequest = PHAssetCollectionChangeRequest.creationRequestForAssetCollection(withTitle: CameraService.albumName) - localIdentifier = createRequest.placeholderForCreatedAssetCollection.localIdentifier + GlassesPhotoAlbum.saveImage(image) { success in + if success { + print("📸 Photo saved to library") } - } catch { - NSLog("[Camera] Failed to create Glasses album: %@", error.localizedDescription) - return nil } - - guard let identifier = localIdentifier else { return nil } - let result = PHAssetCollection.fetchAssetCollections(withLocalIdentifiers: [identifier], options: nil) - return result.firstObject } // MARK: - Audio Session Helpers diff --git a/OpenGlasses/Sources/Services/GlassesPhotoAlbum.swift b/OpenGlasses/Sources/Services/GlassesPhotoAlbum.swift new file mode 100644 index 000000000..52d8bc546 --- /dev/null +++ b/OpenGlasses/Sources/Services/GlassesPhotoAlbum.swift @@ -0,0 +1,132 @@ +import Photos +import UIKit + +enum GlassesPhotoAlbum { + private static let albumName = "Glasses" + private static let albumIDKey = "GlassesPhotoAlbumLocalIdentifier" + + static func saveImage(_ image: UIImage, completion: ((Bool) -> Void)? = nil) { + ensureCanSave { canSave in + guard canSave else { + NSLog("[GlassesPhotoAlbum] Photo library access denied") + completion?(false) + return + } + performSave(image: image, completion: completion) + } + } + + static func saveVideo(at url: URL) async -> Bool { + guard await ensureCanSave() else { return false } + return await performSave(videoURL: url) + } + + private static func ensureCanSave() async -> Bool { + await withCheckedContinuation { continuation in + ensureCanSave { continuation.resume(returning: $0) } + } + } + + private static func ensureCanSave(completion: @escaping (Bool) -> Void) { + let status = PHPhotoLibrary.authorizationStatus(for: .addOnly) + switch status { + case .authorized: + completion(true) + case .notDetermined: + PHPhotoLibrary.requestAuthorization(for: .addOnly) { newStatus in + completion(newStatus == .authorized) + } + default: + completion(false) + } + } + + private static func resolveAlbum() -> PHAssetCollection? { + if let cachedID = UserDefaults.standard.string(forKey: albumIDKey) { + if let album = fetchAlbum(localIdentifier: cachedID) { + return album + } + UserDefaults.standard.removeObject(forKey: albumIDKey) + } + + if let existing = findAlbumByTitle() { + cacheAlbumID(existing.localIdentifier) + return existing + } + + return createAlbum() + } + + private static func fetchAlbum(localIdentifier: String) -> PHAssetCollection? { + PHAssetCollection.fetchAssetCollections(withLocalIdentifiers: [localIdentifier], options: nil).firstObject + } + + private static func findAlbumByTitle() -> PHAssetCollection? { + let readWriteStatus = PHPhotoLibrary.authorizationStatus(for: .readWrite) + guard readWriteStatus == .authorized || readWriteStatus == .limited else { return nil } + let fetchOptions = PHFetchOptions() + fetchOptions.predicate = NSPredicate(format: "title = %@", albumName) + return PHAssetCollection.fetchAssetCollections(with: .album, subtype: .any, options: fetchOptions).firstObject + } + + private static func createAlbum() -> PHAssetCollection? { + var localIdentifier: String? + do { + try PHPhotoLibrary.shared().performChangesAndWait { + let createRequest = PHAssetCollectionChangeRequest.creationRequestForAssetCollection(withTitle: albumName) + localIdentifier = createRequest.placeholderForCreatedAssetCollection.localIdentifier + } + } catch { + if isAlbumAlreadyExistsError(error), let existing = findAlbumByTitle() { + cacheAlbumID(existing.localIdentifier) + return existing + } + NSLog("[GlassesPhotoAlbum] Failed to create album: %@", error.localizedDescription) + return nil + } + + guard let localIdentifier else { return nil } + cacheAlbumID(localIdentifier) + return fetchAlbum(localIdentifier: localIdentifier) + } + + private static func cacheAlbumID(_ localIdentifier: String) { + UserDefaults.standard.set(localIdentifier, forKey: albumIDKey) + } + + private static func isAlbumAlreadyExistsError(_ error: Error) -> Bool { + let nsError = error as NSError + return nsError.domain == PHPhotosErrorDomain && nsError.code == 3311 + } + + private static func performSave(image: UIImage, completion: ((Bool) -> Void)?) { + let album = resolveAlbum() + PHPhotoLibrary.shared().performChanges { + let creationRequest = PHAssetChangeRequest.creationRequestForAsset(from: image) + if let album, let placeholder = creationRequest.placeholderForCreatedAsset { + PHAssetCollectionChangeRequest(for: album)?.addAssets([placeholder] as NSArray) + } + } completionHandler: { success, error in + if let error { + NSLog("[GlassesPhotoAlbum] Save failed: %@", error.localizedDescription) + } + completion?(success) + } + } + + private static func performSave(videoURL: URL) async -> Bool { + let album = resolveAlbum() + do { + try await PHPhotoLibrary.shared().performChanges { + guard let creationRequest = PHAssetChangeRequest.creationRequestForAssetFromVideo(atFileURL: videoURL) else { return } + if let album, let placeholder = creationRequest.placeholderForCreatedAsset { + PHAssetCollectionChangeRequest(for: album)?.addAssets([placeholder] as NSArray) + } + } + return true + } catch { + NSLog("[GlassesPhotoAlbum] Video save failed: %@", error.localizedDescription) + return false + } + } +} diff --git a/OpenGlasses/Sources/Services/Interaction/DwellCaptureService.swift b/OpenGlasses/Sources/Services/Interaction/DwellCaptureService.swift index 811a1bdbb..054e9f83e 100644 --- a/OpenGlasses/Sources/Services/Interaction/DwellCaptureService.swift +++ b/OpenGlasses/Sources/Services/Interaction/DwellCaptureService.swift @@ -61,7 +61,7 @@ final class DwellCaptureService: ObservableObject { let captured = Self.crop(frame, to: box) ?? frame lastCapture = captured - UIImageWriteToSavedPhotosAlbum(captured, nil, nil, nil) + GlassesPhotoAlbum.saveImage(captured) await announce?("Captured that.") } diff --git a/OpenGlasses/Sources/Services/LLMService.swift b/OpenGlasses/Sources/Services/LLMService.swift index affb0eb7f..3174cceaf 100644 --- a/OpenGlasses/Sources/Services/LLMService.swift +++ b/OpenGlasses/Sources/Services/LLMService.swift @@ -2674,17 +2674,22 @@ class LLMService: ObservableObject { try await localService.loadModel(config.model) } - // Build tool instructions — use minimal set for local models + // Build tool instructions — use minimal set for local models. + // Skip tools on photo turns: Gemma 4 multimodal prefill is one unchunked + // forward, and the tool block alone pushes the prompt past phone memory. var fullPrompt = systemPrompt - if includeTools, let router = nativeToolRouter { + if includeTools, imageData == nil, let router = nativeToolRouter { let toolNames = router.registry.toolNames.filter { Self.localSafeTools.contains($0) } fullPrompt += Self.localToolInstructions(toolNames: toolNames) } // Build history — last 3 exchanges for local models (context is precious; the // LocalModelBudget cap still guards the ceiling). Was 2 — too short for a - // follow-up that references the answer before last. - let history = recentTupleHistory(6, stripToolMarkup: true) + // follow-up that references the answer before last. Photo turns drop history: + // multimodal forward is unchunked and history tokens compete with soft tokens. + let history = imageData == nil + ? recentTupleHistory(6, stripToolMarkup: true) + : [] // Add user message to history conversationHistory.append(["role": "user", "content": text]) diff --git a/OpenGlasses/Sources/Services/LocalLLMService.swift b/OpenGlasses/Sources/Services/LocalLLMService.swift index 8d420429c..ce9a6a2d5 100644 --- a/OpenGlasses/Sources/Services/LocalLLMService.swift +++ b/OpenGlasses/Sources/Services/LocalLLMService.swift @@ -82,7 +82,7 @@ final class LocalLLMService: ObservableObject { estimatedSize: "3.6 GB", hasVision: true, hasToolCalling: true, - notes: "Best on-device agent — tool calling, 140+ languages. Vision-ready architecture, but this build's vision weights don't load in the current MLX runtime (device-verified 2026-07-16) — photo questions answer text-only until a fixed build lands, then vision enables automatically. Uses ~4 GB while running.", + notes: "Best on-device agent — tool calling, 140+ languages, vision. Uses ~4 GB while running.", minimumRAMGB: 8 ), RecommendedModel( @@ -91,7 +91,7 @@ final class LocalLLMService: ObservableObject { estimatedSize: "5.1 GB", hasVision: true, hasToolCalling: true, - notes: "Bigger Gemma 4 — highest-quality on-device agent. Same vision caveat as E2B (text-only until an MLX runtime fix). Needs a high-memory device (12 GB).", + notes: "Bigger Gemma 4 — highest-quality on-device agent, with vision. Needs a high-memory device (12 GB).", minimumRAMGB: 12 ), // Vision models (can see photos from glasses) @@ -143,16 +143,8 @@ final class LocalLLMService: ObservableObject { ), ] - /// Model IDs whose checkpoints declare a vision tree, attempted through `VLMModelFactory`. - /// - /// Gemma 4 history: the VLM factory used to fatally trap on 1-D tokens (talk-button - /// crash); mlx-swift-lm 3.31.4 made that catchable — but a device test (2026-07-15) - /// showed the e2b 4-bit quant failing VLM weight mapping (`keyNotFound(language_model… - /// k_norm.weight, Gemma4RMSNormZeroShift)`). The hub configs for all three Gemma 4 - /// checkpoints declare `Gemma4ForConditionalGeneration` with a `vision_config` - /// (verified 2026-07-16), so vision is *attempted* — and a mapping failure now demotes - /// gracefully to the text factory (`loadModel`), with image turns refused honestly by - /// the vision guard in LLMService. Nothing regresses if a checkpoint doesn't cooperate. + /// Model IDs loaded through `VLMModelFactory`. Gemma 4 text turns MUST go through + /// `Gemma4Processor.prepare` — hand-built `LMInput` tokens crash MLX on first forward. nonisolated static let visionModelIds: Set = [ "mlx-community/SmolVLM2-2.2B-Instruct-mlx", "mlx-community/SmolVLM2-500M-Video-Instruct-mlx", @@ -322,7 +314,7 @@ final class LocalLLMService: ObservableObject { // own iOS guidance; set here (not init) so simulator unit tests never touch Metal. Memory.cacheLimit = 20 * 1024 * 1024 - let config = ModelConfiguration(id: modelId) + let config = Self.modelConfiguration(for: modelId) func load(with factory: any ModelFactory) async throws -> ModelContainer { try await factory.loadContainer( from: #hubDownloader(hub), @@ -342,11 +334,8 @@ final class LocalLLMService: ObservableObject { modelContainer = try await load(with: VLMModelFactory.shared) loadedViaVLMFactory = true } catch { - // The known shape of this failure is a quant whose weight tree doesn't - // match the VLM export (keyNotFound …k_norm.weight — device trace - // 2026-07-15). Whatever the cause, the model is still a perfectly good - // text model: demote for this run and load through the text factory. - // Image turns then get the honest refusal instead of a broken load. + // Weight-tree mismatch (pre-#390: KV-shared tail declared v_proj/k_norm). + // Model still loads as text; image turns get the honest refusal. NSLog("[LocalLLM] VLM load failed for %@ — demoting to text factory: %@", modelId, error.localizedDescription) visionDemotedModelIds.insert(modelId) @@ -420,6 +409,12 @@ final class LocalLLMService: ObservableObject { // has no way to interleave image tokens. if let imageData { if loadedViaVLMFactory { + if Gemma4ChatPrompt.matches(modelId: loadedModelId) { + return try await generateGemma4VLMTurn( + userMessage: userMessage, systemPrompt: systemPrompt, + history: history, imageData: imageData, + container: container, onToken: onToken) + } return try await generateVisionTurn( userMessage: userMessage, systemPrompt: systemPrompt, history: history, imageData: imageData, @@ -434,20 +429,50 @@ final class LocalLLMService: ObservableObject { return Self.visionWeightsUnavailableMessage } + if loadedViaVLMFactory && Gemma4ChatPrompt.matches(modelId: loadedModelId) { + let budget = LocalModelBudget.promptBudget(for: loadedModelId) + let tokenizer = await container.tokenizer + let trimmedHistory = try LocalModelBudget.historyFittingBudget( + history: history, budget: budget + ) { hist in + let text = Gemma4ChatPrompt.render( + system: systemPrompt, history: hist, userMessage: userMessage, + bosToken: tokenizer.bosToken) + return tokenizer.encode(text: text, addSpecialTokens: false).count + } + if trimmedHistory.count < history.count { + NSLog("🔬 LocalLLM.generate trimmed history %d→%d turns to fit budget %d", + history.count, trimmedHistory.count, budget) + } + return try await generateGemma4VLMTurn( + userMessage: userMessage, systemPrompt: systemPrompt, + history: trimmedHistory, imageData: nil, + container: container, onToken: onToken) + } + // Tokenize a candidate history exactly as the model will — chat template, with the // no-system-role fallback some small models need. Used both to measure truncation // candidates and to produce the final token ids. let tokenizer = await container.tokenizer func tokenize(_ hist: [(role: String, content: String)]) throws -> [Int] { + if Gemma4ChatPrompt.matches(modelId: loadedModelId) { + let text = Gemma4ChatPrompt.render( + system: systemPrompt, history: hist, userMessage: userMessage, + bosToken: tokenizer.bosToken) + return tokenizer.encode(text: text, addSpecialTokens: false) + } var messages: [[String: String]] = [["role": "system", "content": systemPrompt]] for turn in hist { messages.append(["role": turn.role, "content": turn.content]) } messages.append(["role": "user", "content": userMessage]) do { return try tokenizer.applyChatTemplate(messages: messages) } catch { - // Merge the system prompt into the user turn for models without a system role. - // No "User:" transcript label — a small model reads a speaker-labelled dialogue - // and can flip roles, replying *as* the user addressed to the persona name. + if Gemma4ChatPrompt.isJinjaParserFailure(error) { + let text = Gemma4ChatPrompt.render( + system: systemPrompt, history: hist, userMessage: userMessage, + bosToken: tokenizer.bosToken) + return tokenizer.encode(text: text, addSpecialTokens: false) + } var fallback: [[String: String]] = [] for turn in hist { fallback.append(["role": turn.role, "content": turn.content]) } fallback.append(["role": "user", "content": systemPrompt + "\n\n" + userMessage]) @@ -583,6 +608,101 @@ final class LocalLLMService: ObservableObject { return output.trimmingCharacters(in: .whitespacesAndNewlines) } + /// Gemma 4 VLM turn: photos via `Gemma4Processor.prepare`; text via render + masked + /// `LMInput` (processor with no image hits Metal nil `setBytes`). + private func generateGemma4VLMTurn( + userMessage: String, + systemPrompt: String, + history: [(role: String, content: String)], + imageData: Data?, + container: ModelContainer, + onToken: ((String) -> Void)? + ) async throws -> String { + let parameters = Self.generateParameters(for: loadedModelId) + + let backgroundedFlag = LockedFlag() + let bgObserver = NotificationCenter.default.addObserver( + forName: UIApplication.didEnterBackgroundNotification, + object: nil, + queue: .main + ) { _ in + backgroundedFlag.set() + } + defer { NotificationCenter.default.removeObserver(bgObserver) } + + if let imageData { + NSLog("🔬 LocalLLM.generateGemma4VLMTurn model=%@ image=%dKB", + loadedModelId ?? "?", imageData.count / 1024) + } else { + NSLog("🔬 LocalLLM.generateGemma4VLMTurn model=%@ text-only", loadedModelId ?? "?") + } + + let report = LockedGenerationReport() + // Multimodal Gemma 4 prepare is a single unchunked forward. Fat system+tools + // (~1.7k) + soft tokens Jetsam mid-Metal — photo turns use a short vision system. + // Text-only must NOT use Gemma4Processor.prepare: with no image tensors the + // multimodal kernels hit Metal `setBytes` with nil → fatal assertion. Render + + // masked LMInput matches the Jinja fallback that already works for text. + let effectiveSystem: String + let effectiveHistory: [(role: String, content: String)] + if imageData != nil { + effectiveSystem = """ + You are OpenGlasses, a voice assistant on smart glasses. A photo from the glasses camera is attached. You CAN see it — never deny vision. + Answer in 1–2 short spoken sentences. Name the main subject and anything asked. Skip background, lighting, and composition unless asked. + If asked to read text: quote it verbatim; translate only if asked. + """ + effectiveHistory = [] + } else { + effectiveSystem = systemPrompt + effectiveHistory = history + } + + let output = try await container.perform { context -> String in + let lmInput: LMInput + if let imageData, let ciImage = CIImage(data: imageData) { + var chat: [Chat.Message] = [.system(effectiveSystem)] + chat.append(.user(userMessage, images: [.ciImage(ciImage)])) + lmInput = try await context.processor.prepare(input: UserInput(chat: chat)) + } else { + let text = Gemma4ChatPrompt.render( + system: effectiveSystem, history: effectiveHistory, userMessage: userMessage, + bosToken: context.tokenizer.bosToken) + let tokens = context.tokenizer.encode(text: text, addSpecialTokens: false) + let promptArray = MLXArray(tokens).expandedDimensions(axis: 0) + let mask = ones(like: promptArray).asType(.int8) + lmInput = LMInput(text: .init(tokens: promptArray, mask: mask)) + } + + NSLog("🔬 LocalLLM.generateGemma4VLMTurn tokenIDs.shape=%@ count=%d", + "\(lmInput.text.tokens.shape)", lmInput.text.tokens.size) + + let stream = try MLXLMCommon.generate( + input: lmInput, parameters: parameters, context: context) + var iterator = stream.makeAsyncIterator() + return try await Self.drainTokenStream( + nextChunk: { + while let generation = await iterator.next() { + if case .chunk(let text) = generation { return text } + if case .info(let info) = generation { report.note(info) } + } + return nil + }, + isBackgrounded: { backgroundedFlag.isSet }, + onToken: { chunk in + report.noteToken(at: Date()) + onToken?(chunk) + } + ) + } + if let firstTokenAt = report.firstTokenAt { TurnRecorder.mark(.firstToken, at: firstTokenAt) } + if let completion = report.completion { + TurnRecorder.addGeneration(tokens: completion.generationTokenCount, seconds: completion.generateTime) + } + NSLog("🔬 LocalLLM.generateGemma4VLMTurn done — mlx active=%dMB cache=%dMB", + Memory.activeMemory / 1_048_576, Memory.cacheMemory / 1_048_576) + return output.trimmingCharacters(in: CharacterSet.whitespacesAndNewlines) + } + /// One image turn through a VLM-factory model. The processor owns the chat template and /// image tokenization; history is kept short (image tokens are big) and un-budgeted — the /// processor's own encoding is the authority on how many tokens the image costs. @@ -680,6 +800,13 @@ final class LocalLLMService: ObservableObject { ) } + nonisolated static func modelConfiguration(for modelId: String) -> ModelConfiguration { + if Gemma4ChatPrompt.matches(modelId: modelId) { + return ModelConfiguration(id: modelId, extraEOSTokens: [""]) + } + return ModelConfiguration(id: modelId) + } + /// Shape token ids for the loaded model (see the call site in `generate` for why): /// 1D (L,) for text-factory models — their chunked prefill slices axis 0 and an explicit /// batch axis fatally breaks prompts over the prefill step size; (1, L) for vision-factory @@ -955,3 +1082,42 @@ final class LockedGenerationReport: @unchecked Sendable { return info } } + +enum Gemma4ChatPrompt { + static func matches(modelId: String?) -> Bool { + guard let id = modelId?.lowercased() else { return false } + return id.contains("gemma-4") || id.contains("gemma4") + } + + static func isJinjaParserFailure(_ error: Error) -> Bool { + let text = String(describing: error) + return text.contains("modulo") + || text.contains("Unexpected token") + || text.contains("parser(") + } + + static func render( + system: String, + history: [(role: String, content: String)], + userMessage: String, + bosToken: String? + ) -> String { + var out = bosToken ?? "" + let sys = system.trimmingCharacters(in: .whitespacesAndNewlines) + if !sys.isEmpty { + appendTurn(&out, role: "system", body: sys) + } + for turn in history { + let role = turn.role == "assistant" ? "model" : turn.role + appendTurn(&out, role: role, body: turn.content) + } + appendTurn(&out, role: "user", body: userMessage) + out += "<|turn>model\n" + return out + } + + private static func appendTurn(_ out: inout String, role: String, body: String) { + let trimmed = body.trimmingCharacters(in: .whitespacesAndNewlines) + out += "<|turn>\(role)\n\(trimmed)\n" + } +} diff --git a/OpenGlasses/Sources/Services/VideoRecordingService.swift b/OpenGlasses/Sources/Services/VideoRecordingService.swift index 7deed6876..cc7837ad3 100644 --- a/OpenGlasses/Sources/Services/VideoRecordingService.swift +++ b/OpenGlasses/Sources/Services/VideoRecordingService.swift @@ -62,7 +62,6 @@ class VideoRecordingService: ObservableObject { private nonisolated(unsafe) var poolHeight: Int = 0 /// Name of the Photos album where recordings are saved. - private nonisolated static let albumName = "Glasses" /// Transcript accumulated during recording (from ambient captions). @Published private(set) var recordingTranscript: String = "" @@ -447,57 +446,10 @@ class VideoRecordingService: ObservableObject { // MARK: - Photos Library - /// Save the video file to the "Glasses" album in the Photos library. private func saveVideoToPhotos(_ url: URL) async { - let status = await PHPhotoLibrary.requestAuthorization(for: .addOnly) - guard status == .authorized || status == .limited else { - NSLog("[Recording] Photo library access denied") - return + if await GlassesPhotoAlbum.saveVideo(at: url) { + NSLog("[Recording] Video saved to library") } - - let album = fetchGlassesAlbum() - - do { - try await PHPhotoLibrary.shared().performChanges { - let creationRequest = PHAssetChangeRequest.creationRequestForAssetFromVideo(atFileURL: url) - - if let album { - let albumChangeRequest = PHAssetCollectionChangeRequest(for: album) - if let placeholder = creationRequest?.placeholderForCreatedAsset { - albumChangeRequest?.addAssets([placeholder] as NSArray) - } - } - } - NSLog("[Recording] Video saved to Glasses album") - } catch { - NSLog("[Recording] Save to Photos failed: %@", error.localizedDescription) - } - } - - /// Fetch the "Glasses" album, creating it if it doesn't exist. - private nonisolated func fetchGlassesAlbum() -> PHAssetCollection? { - let fetchOptions = PHFetchOptions() - fetchOptions.predicate = NSPredicate(format: "title = %@", VideoRecordingService.albumName) - let collections = PHAssetCollection.fetchAssetCollections(with: .album, subtype: .any, options: fetchOptions) - - if let existing = collections.firstObject { - return existing - } - - var localIdentifier: String? - do { - try PHPhotoLibrary.shared().performChangesAndWait { - let createRequest = PHAssetCollectionChangeRequest.creationRequestForAssetCollection( - withTitle: VideoRecordingService.albumName) - localIdentifier = createRequest.placeholderForCreatedAssetCollection.localIdentifier - } - } catch { - NSLog("[Recording] Failed to create Glasses album: %@", error.localizedDescription) - return nil - } - - guard let identifier = localIdentifier else { return nil } - return PHAssetCollection.fetchAssetCollections(withLocalIdentifiers: [identifier], options: nil).firstObject } // MARK: - Transcript Persistence diff --git a/OpenGlasses/Sources/Utils/Config.swift b/OpenGlasses/Sources/Utils/Config.swift index 8bf453c42..aefd1f749 100644 --- a/OpenGlasses/Sources/Utils/Config.swift +++ b/OpenGlasses/Sources/Utils/Config.swift @@ -3311,11 +3311,8 @@ struct Config { /// Whether fast-tier queries may run on the *on-device* MLX agent model. /// - /// Historically default-off because the gemma-4 agent model fatally crashed during - /// inference: it was mis-routed through `VLMModelFactory` (see - /// `LocalLLMService.visionModelIds`) into the uncatchable `MLXVLM.Gemma4` trap. That - /// routing is fixed — the model now loads as text — but the default stays off pending - /// on-device confirmation that the text path generates cleanly. Cloud agents are unaffected. + /// Default-off pending on-device confirmation that Gemma 4 generates cleanly + /// through the VLM factory (mlx-swift-lm#390). Cloud agents are unaffected. @UserDefaultsBacked("localAgentEnabled", default: false) static var localAgentEnabled: Bool static func setLocalAgentEnabled(_ value: Bool) { localAgentEnabled = value } diff --git a/OpenGlassesTests/Gemma4ChatPromptTests.swift b/OpenGlassesTests/Gemma4ChatPromptTests.swift new file mode 100644 index 000000000..d4502386a --- /dev/null +++ b/OpenGlassesTests/Gemma4ChatPromptTests.swift @@ -0,0 +1,50 @@ +import XCTest +@testable import OpenGlasses + +final class Gemma4ChatPromptTests: XCTestCase { + func testMatchesGemma4Ids() { + XCTAssertTrue(Gemma4ChatPrompt.matches(modelId: "mlx-community/gemma-4-e2b-it-4bit")) + XCTAssertTrue(Gemma4ChatPrompt.matches(modelId: "mlx-community/gemma-4-E2B-it-4bit")) + XCTAssertFalse(Gemma4ChatPrompt.matches(modelId: "mlx-community/gemma-3-4b-it-qat-4bit")) + XCTAssertFalse(Gemma4ChatPrompt.matches(modelId: "mlx-community/Qwen2.5-3B-Instruct-4bit")) + } + + func testRenderSystemUser() { + let text = Gemma4ChatPrompt.render( + system: "You are helpful.", + history: [], + userMessage: "What's the quickest route to Istanbul", + bosToken: "") + XCTAssertEqual( + text, + "<|turn>system\nYou are helpful.\n<|turn>user\nWhat's the quickest route to Istanbul\n<|turn>model\n") + } + + func testRenderHistoryMapsAssistantToModel() { + let text = Gemma4ChatPrompt.render( + system: "", + history: [ + (role: "user", content: "Hi"), + (role: "assistant", content: "Hello"), + ], + userMessage: "Next", + bosToken: nil) + XCTAssertEqual( + text, + "<|turn>user\nHi\n<|turn>model\nHello\n<|turn>user\nNext\n<|turn>model\n") + } + + func testGemma4ConfigurationAddsTurnStop() { + XCTAssertEqual( + LocalLLMService.modelConfiguration(for: "mlx-community/gemma-4-e2b-it-4bit").extraEOSTokens, + [""]) + } + + func testJinjaParserFailure() { + struct Fake: Error { let localizedDescription: String } + XCTAssertTrue(Gemma4ChatPrompt.isJinjaParserFailure( + Fake(localizedDescription: #"parser("Unexpected token for primary expression: modulo")"#))) + XCTAssertFalse(Gemma4ChatPrompt.isJinjaParserFailure( + Fake(localizedDescription: "The glasses camera is not connected."))) + } +} diff --git a/OpenGlassesTests/LocalLocationFixTests.swift b/OpenGlassesTests/LocalLocationFixTests.swift index a366fd2ee..b023c767e 100644 --- a/OpenGlassesTests/LocalLocationFixTests.swift +++ b/OpenGlassesTests/LocalLocationFixTests.swift @@ -111,11 +111,7 @@ final class LocalLocationFixTests: XCTestCase { func testVisionCapabilityByModelId() { XCTAssertTrue(LocalLLMService.isVisionCapable(modelId: "mlx-community/SmolVLM2-2.2B-Instruct-mlx")) - // Attempt-and-demote (2026-07-16): Gemma 4 is nominally vision-capable and ATTEMPTS the - // VLM factory; if this build's weights fail VLM mapping it demotes to text at runtime - // (`isVisionUsable` is the demotion-aware truth, and image turns refuse honestly). - XCTAssertTrue(LocalLLMService.isVisionCapable(modelId: "mlx-community/gemma-4-e2b-it-4bit"), - "nominal capability — runtime demotion (visionDemotedModelIds) handles load failure") + XCTAssertTrue(LocalLLMService.isVisionCapable(modelId: "mlx-community/gemma-4-e2b-it-4bit")) } func testCurrentDateTimeLineFormat() { diff --git a/OpenGlassesTests/LocalModelRoutingTests.swift b/OpenGlassesTests/LocalModelRoutingTests.swift index 3907cff6b..3967aa8be 100644 --- a/OpenGlassesTests/LocalModelRoutingTests.swift +++ b/OpenGlassesTests/LocalModelRoutingTests.swift @@ -1,28 +1,17 @@ import XCTest @testable import OpenGlasses -/// Regression guard for the talk-button / Field-Assist crash: the on-device agent model must -/// load through the TEXT factory, not the vision factory. `visionModelIds` decides that in -/// `LocalLLMService.loadModel`, so the agent model landing in that set silently routes inference -/// into mlx-swift-lm's crashing `MLXVLM.Gemma4` (an uncatchable MLX assertion). +/// Regression guard for on-device model routing. Gemma 4 loads through the VLM factory +/// (vision + tools) and generates via `Gemma4Processor.prepare` — not hand-built tokens. @MainActor final class LocalModelRoutingTests: XCTestCase { - /// Attempt-and-demote (2026-07-16): Gemma 4 models ATTEMPT the VLM factory (they are - /// architecturally VLMs) and demote to the text factory at runtime if the checkpoint's - /// vision weights fail mapping. The old crash this test feared (wrong token shape through - /// the VLM forward pass) is prevented by keying the shape off `loadedViaVLMFactory` — the - /// factory that ACTUALLY loaded — not off nominal membership in `visionModelIds`. func testGemma4AttemptsVisionFactoryWithRuntimeDemotion() { XCTAssertTrue(LocalLLMService.visionModelIds.contains { $0.contains("gemma-4") }, - "Gemma 4 must attempt the VLM factory so vision self-enables on a fixed runtime") - XCTAssertTrue(LocalLLMService.visionModelIds.contains { $0.contains("SmolVLM") }, - "the proven vision models stay on the VLM route") + "Gemma 4 must load through the VLM factory for vision") + XCTAssertTrue(LocalLLMService.visionModelIds.contains { $0.contains("SmolVLM") }) } - /// The on-device prompt budget (BK P2) must sit below the observed OOM point (an ~8.2k-token - /// prompt Jetsam-killed the app) yet leave headroom for a normal lean prompt + some history — - /// for every recommended model and for an unknown/user-typed id. func testOnDevicePromptBudgetIsBelowTheObservedOOMPoint() { let ids = LocalLLMService.recommendedModels.map(\.id) + [nil, "some/unknown-model"] for id in ids { diff --git a/OpenGlassesTests/LocalTokenShapeTests.swift b/OpenGlassesTests/LocalTokenShapeTests.swift index ba35217d7..bc38f6cda 100644 --- a/OpenGlassesTests/LocalTokenShapeTests.swift +++ b/OpenGlassesTests/LocalTokenShapeTests.swift @@ -7,7 +7,8 @@ import XCTest /// chunks prompts longer than the 512-token prefill step by slicing axis 0, so an /// explicit (1, L) batch axis leaves an empty (0, L) remainder that fatally crashes /// MLX in the embedding reshape — the "local Gemma crashes on any real question" bug. -/// Vision-factory models (SmolVLM2) skip chunked prepare and need the batch axis. +/// Gemma 4 VLM turns skip manual token shaping entirely — they go through +/// `Gemma4Processor.prepare`. SmolVLM2 still needs the (1, L) batch axis. /// /// The shaping itself (`LocalLLMService.tokenBatch`) can't be exercised here: even /// constructing an MLXArray crashes on the simulator (no MLX Metal support), so the @@ -16,16 +17,10 @@ import XCTest final class LocalTokenShapeTests: XCTestCase { func testGemma4AttemptsVLMFactory() { - // Attempt-and-demote (2026-07-16): gemma-4 IS routed to VLMModelFactory first. The 1D- - // vs-(1,L) token shape that used to make this membership dangerous is now keyed off - // `loadedViaVLMFactory` — the factory that ACTUALLY loaded — so a demoted Gemma takes - // the 1D path automatically and the fatal shape mismatch cannot recur. XCTAssertTrue(LocalLLMService.visionModelIds.contains("mlx-community/gemma-4-e2b-it-4bit")) } func testVisionModelIdsAreVLMFactoryModels() { - // The VLM-factory attempt set: proven SmolVLM2 checkpoints plus the Gemma 4 family - // (both hub casings of e2b — the catalog uses lowercase, the community page capital). XCTAssertEqual( LocalLLMService.visionModelIds, [ diff --git a/Package.resolved b/Package.resolved index e59de6d1f..1b1a3bb23 100644 --- a/Package.resolved +++ b/Package.resolved @@ -1,5 +1,5 @@ { - "originHash" : "18e3260711c0130c5c74b2ecf73b3387b67fb41621ecbcb8aa9eb73917aefae6", + "originHash" : "65bfb1005cb55040abf276b5b29b4d0803a3c9d9094147c0025bd554d02e4cb6", "pins" : [ { "identity" : "haishinkit.swift", @@ -42,8 +42,7 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/ml-explore/mlx-swift-lm.git", "state" : { - "branch" : "main", - "revision" : "702e5a0eaf990e1f6d3db2b6e7d8872858a44055" + "revision" : "14414441fa44f45eee35a61e9fa0bab577cf9734" } }, { diff --git a/Package.swift b/Package.swift index 813cefb5d..a45b56900 100644 --- a/Package.swift +++ b/Package.swift @@ -12,7 +12,7 @@ let package = Package( // HaishinKit — RTMP live streaming .package(url: "https://github.com/shogo4405/HaishinKit.swift.git", from: "2.2.5"), // MLX Swift LM — on-device LLM inference - .package(url: "https://github.com/ml-explore/mlx-swift-lm.git", branch: "main"), + .package(url: "https://github.com/ml-explore/mlx-swift-lm.git", revision: "14414441fa44f45eee35a61e9fa0bab577cf9734"), // WebRTC — real peer-to-peer expert transport (Plan L) .package(url: "https://github.com/stasel/WebRTC.git", from: "120.0.0"), ], diff --git a/ci_scripts/Package.resolved b/ci_scripts/Package.resolved index 549b0743a..a1b57ba7e 100644 --- a/ci_scripts/Package.resolved +++ b/ci_scripts/Package.resolved @@ -50,8 +50,7 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/ml-explore/mlx-swift-lm.git", "state" : { - "revision" : "1c05248bb0899e2a7a4962b84d319cf12f4e12aa", - "version" : "3.31.3" + "revision" : "14414441fa44f45eee35a61e9fa0bab577cf9734" } }, { @@ -68,8 +67,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/apple/swift-asn1.git", "state" : { - "revision" : "eb50cbd14606a9161cbc5d452f18797c90ef0bab", - "version" : "1.7.0" + "revision" : "9f542610331815e29cc3821d3b6f488db8715517", + "version" : "1.6.0" } }, { @@ -86,8 +85,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/apple/swift-collections.git", "state" : { - "revision" : "fea17c02d767f46b23070fdfdacc28a03a39232a", - "version" : "1.5.1" + "revision" : "6675bc0ff86e61436e615df6fc5174e043e57924", + "version" : "1.4.1" } }, { @@ -95,8 +94,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/apple/swift-crypto.git", "state" : { - "revision" : "1b6b2e274e85105bfa155183145a1dcfd63331f1", - "version" : "4.5.0" + "revision" : "fa308c07a6fa04a727212d793e761460e41049c3", + "version" : "4.3.0" } }, { @@ -113,8 +112,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/huggingface/swift-jinja.git", "state" : { - "revision" : "0b67ecb79139f6addef8699eff3622808aa6c7dc", - "version" : "2.3.6" + "revision" : "7d0b8880ef8e567dd4e0089f8b99fb354129017c", + "version" : "2.4.2" } }, { @@ -122,8 +121,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/apple/swift-nio.git", "state" : { - "revision" : "57c0a08a331aaea9f5d7a932ad94ef43be942a95", - "version" : "2.100.0" + "revision" : "b31565862a8f39866af50bc6676160d8dda7de35", + "version" : "2.96.0" } }, { @@ -140,8 +139,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/swiftlang/swift-syntax.git", "state" : { - "revision" : "0687f71944021d616d34d922343dcef086855920", - "version" : "600.0.1" + "revision" : "79e4b74a295b6eb74a8b585e3a39d29e70c1dbd1", + "version" : "603.0.2" } }, { @@ -156,10 +155,10 @@ { "identity" : "swift-transformers", "kind" : "remoteSourceControl", - "location" : "https://github.com/huggingface/swift-transformers.git", + "location" : "https://github.com/huggingface/swift-transformers", "state" : { - "revision" : "2fa33e1f5e7131a7fc64c28e6d161dcec0d24820", - "version" : "1.3.3" + "revision" : "58c4bc11963a140358d791f678a60a2745a23146", + "version" : "1.2.1" } }, { diff --git a/project.base.yml b/project.base.yml index 01aa46b4e..d3257ef3b 100644 --- a/project.base.yml +++ b/project.base.yml @@ -69,7 +69,9 @@ packages: from: "2.2.5" mlx-swift-lm: url: https://github.com/ml-explore/mlx-swift-lm.git - version: "3.31.3" + # No tag after 3.31.4 includes mlx-swift-lm#390 (Gemma 4 VLM KV-shared + # layers). Pin the main SHA that does; floating `main` re-broke vision. + revision: 14414441fa44f45eee35a61e9fa0bab577cf9734 swift-huggingface: # Same 0.x exposure as the DAT SDK, and it already drifted: the spec said `from: "0.1.0"` while # Package.resolved had walked to 0.9.0 — eight minor versions of a pre-1.0 package, adopted @@ -79,6 +81,9 @@ packages: swift-transformers: url: https://github.com/huggingface/swift-transformers.git from: "1.0.0" + swift-jinja: + url: https://github.com/huggingface/swift-jinja.git + version: "2.4.2" SystemNotification: url: https://github.com/danielsaidi/SystemNotification.git from: "1.0.0" @@ -199,6 +204,8 @@ targets: product: HuggingFace - package: swift-transformers product: Tokenizers + - package: swift-jinja + product: Jinja - package: SystemNotification product: SystemNotification - package: WebRTC