Procházet zdrojové kódy

Prepare Meet Media API OAuth scope and backend env loading.

Request meetings.conference.media.readonly alongside existing Meet scopes, load dotenv in the capture service so .env controls simulate mode, clarify env example and live-worker placeholder messaging, and align microphone usage copy with Meet-based capture.

Co-authored-by: Cursor <cursoragent@cursor.com>
huzaifahayat12 před 2 měsíci
rodič
revize
cee12be3af

+ 1 - 1
Info.plist

@@ -27,7 +27,7 @@
 	<key>NSPrincipalClass</key>
 	<string>NSApplication</string>
 	<key>NSMicrophoneUsageDescription</key>
-	<string>This app records meeting audio locally with your consent so it can be shown in AI Companion after the meeting.</string>
+	<string>Meeting audio is captured through Google Meet when you allow it, then saved in AI Companion. Microphone access may be requested only if a feature needs the mic on this Mac.</string>
 	<key>MeetMediaCaptureEnabled</key>
 	<true/>
 	<key>MeetMediaCaptureServiceBaseURL</key>

+ 1 - 0
backend/meet-media-capture/.env.example

@@ -1,3 +1,4 @@
 PORT=8787
 MEET_MEDIA_AUDIO_DIR=./recordings
+# true = silent WAV pipeline test only. false = live Meet Media API path (requires Google Developer Preview + implemented worker).
 MEET_MEDIA_SIMULATE=true

+ 13 - 0
backend/meet-media-capture/package-lock.json

@@ -8,6 +8,7 @@
       "name": "meet-media-capture-service",
       "version": "0.1.0",
       "dependencies": {
+        "dotenv": "^16.4.7",
         "express": "^4.21.2",
         "nanoid": "^5.1.5"
       },
@@ -738,6 +739,18 @@
         "npm": "1.2.8000 || >= 1.4.16"
       }
     },
+    "node_modules/dotenv": {
+      "version": "16.6.1",
+      "resolved": "https://registry.npmjs.org/dotenv/-/dotenv-16.6.1.tgz",
+      "integrity": "sha512-uBq4egWHTcTt33a72vpSG0z3HnPuIl6NqYcTrKEg2azoEyl2hpW0zqlxysq2pK9HlDIHyHyakeYaYnSAwd8bow==",
+      "license": "BSD-2-Clause",
+      "engines": {
+        "node": ">=12"
+      },
+      "funding": {
+        "url": "https://dotenvx.com"
+      }
+    },
     "node_modules/dunder-proto": {
       "version": "1.0.1",
       "resolved": "https://registry.npmjs.org/dunder-proto/-/dunder-proto-1.0.1.tgz",

+ 1 - 0
backend/meet-media-capture/package.json

@@ -9,6 +9,7 @@
     "start": "node dist/server.js"
   },
   "dependencies": {
+    "dotenv": "^16.4.7",
     "express": "^4.21.2",
     "nanoid": "^5.1.5"
   },

+ 3 - 4
backend/meet-media-capture/src/google/meetMediaWorker.ts

@@ -15,11 +15,10 @@ export async function captureMeetAudio(args: StartWorkerArgs): Promise<void> {
     return;
   }
 
-  // Placeholder for Meet Media API WebRTC integration.
-  // This branch is intentionally fail-fast until production credentials and
-  // full signaling implementation are wired in.
+  // Placeholder: implement WebRTC + Meet Media API signaling per Google’s get-started guide.
+  // Requires Developer Preview enrollment and OAuth token with meetings.conference.media.readonly.
   throw new Error(
-    "Meet Media API live ingestion is not configured yet. Set MEET_MEDIA_SIMULATE=true for local validation."
+    "Meet Media API live ingestion is not implemented in this worker yet. Use MEET_MEDIA_SIMULATE=true until the WebRTC client is complete, or after Google enables your project in Developer Preview."
   );
 }
 

+ 1 - 0
backend/meet-media-capture/src/server.ts

@@ -1,3 +1,4 @@
+import "dotenv/config";
 import express from "express";
 import fs from "node:fs";
 import { nanoid } from "nanoid";

+ 4 - 2
meetings_app/Auth/GoogleOAuthService.swift

@@ -43,13 +43,15 @@ final class GoogleOAuthService: NSObject {
     private let bundledClientSecret = "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"
 
     // Calendar is needed for schedule. Profile/email make login feel complete in-app.
+    // Meet Media API (real-time media) requires conference media scope; space scope covers REST metadata/transcripts.
+    // After changing scopes, users must sign out and sign in again so Google issues a token that includes new scopes.
     private let scopes = [
         "openid",
         "email",
         "profile",
         "https://www.googleapis.com/auth/calendar.events",
-        // Required for Google Meet conferenceRecords/transcripts APIs.
-        "https://www.googleapis.com/auth/meetings.space.readonly"
+        "https://www.googleapis.com/auth/meetings.space.readonly",
+        "https://www.googleapis.com/auth/meetings.conference.media.readonly"
     ]
 
     private let tokenStore = KeychainTokenStore()