@openclaw/google-meet 2026.9.7 → 2026.10.1-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/.setup/{chrome-create-wuAK5Pnq.mjs → chrome-create-Bh1L33pr.mjs} +20 -57
- package/dist/.setup/{cli-DVDq0TFu.mjs → cli-Bfm5LpNM.mjs} +63 -143
- package/dist/.setup/{cli-export-D4IM6KLJ.mjs → cli-export-BOebaVFW.mjs} +52 -57
- package/dist/.setup/{create-UrHOmnWb.mjs → create-DyYbmN11.mjs} +3 -3
- package/dist/.setup/google-api-DEZ9mWx7.mjs +50 -0
- package/dist/.setup/{google-meet-platform-adapter-gosgbMIM.mjs → google-meet-platform-adapter-CKXMbP3X.mjs} +1 -1
- package/dist/.setup/{node-host-Tr7Mx3da.mjs → node-host-CyFclhO_.mjs} +1 -1
- package/dist/.setup/{node-invoke-policy-Dd3krTYV.mjs → node-invoke-policy-BnX3PaH7.mjs} +3 -4
- package/dist/.setup/{oauth-BoyruWcS.mjs → oauth-XgdPFWEJ.mjs} +1 -1
- package/dist/.setup/{plugin-helpers-CdQ_YNA7.mjs → plugin-helpers-D1OyyzEZ.mjs} +85 -201
- package/dist/.setup/{plugin-registration-aCEuCerg.mjs → plugin-registration-BP83dqMw.mjs} +23 -31
- package/dist/.setup/{runtime-BdiF53A2.mjs → runtime-DQgxZ2Na.mjs} +16 -67
- package/dist/index.js +4 -4
- package/package.json +4 -4
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { m as resolveMeetingInput } from "./plugin-registration-BP83dqMw.mjs";
|
|
2
|
+
import { n as requestGoogleApi } from "./google-api-DEZ9mWx7.mjs";
|
|
2
3
|
import { t as normalizeMeetUrl } from "./meet-url-BP2Jlvjs.mjs";
|
|
3
4
|
import { normalizeOptionalString, uniqueStrings } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
4
5
|
import { formatErrorMessage } from "openclaw/plugin-sdk/error-runtime";
|
|
5
6
|
import { createLazyRuntimeModule } from "openclaw/plugin-sdk/lazy-runtime";
|
|
6
7
|
import { parseDateStringTimestampMs, timestampMsToIsoString } from "openclaw/plugin-sdk/number-runtime";
|
|
7
8
|
import { readPositiveIntegerParam } from "openclaw/plugin-sdk/channel-actions";
|
|
8
|
-
import { readProviderJsonResponse, readProviderTextResponse
|
|
9
|
-
import { fetchWithSsrFGuard } from "openclaw/plugin-sdk/ssrf-runtime";
|
|
9
|
+
import { readProviderJsonResponse, readProviderTextResponse } from "openclaw/plugin-sdk/provider-http";
|
|
10
10
|
//#region \0rolldown/runtime.js
|
|
11
11
|
var __defProp = Object.defineProperty;
|
|
12
12
|
var __exportAll = (all, no_symbols) => {
|
|
@@ -19,31 +19,10 @@ var __exportAll = (all, no_symbols) => {
|
|
|
19
19
|
return target;
|
|
20
20
|
};
|
|
21
21
|
//#endregion
|
|
22
|
-
//#region extensions/google-meet/src/google-api-errors.ts
|
|
23
|
-
const REAUTH_HINT = "Re-run `openclaw googlemeet auth login` and store the refreshed oauth block.";
|
|
24
|
-
const GOOGLE_API_ERROR_BODY_LIMIT_BYTES = 8192;
|
|
25
|
-
function scopeText(scopes) {
|
|
26
|
-
return scopes.map((scope) => `\`${scope}\``).join(", ");
|
|
27
|
-
}
|
|
28
|
-
async function readGoogleApiErrorDetail(response) {
|
|
29
|
-
return await readResponseTextLimited(response, GOOGLE_API_ERROR_BODY_LIMIT_BYTES);
|
|
30
|
-
}
|
|
31
|
-
async function googleApiError(params) {
|
|
32
|
-
const detail = await readGoogleApiErrorDetail(params.response);
|
|
33
|
-
const scopeHint = params.scopes && params.scopes.length > 0 ? ` Required OAuth scope: ${scopeText(params.scopes)}. ${REAUTH_HINT}` : "";
|
|
34
|
-
return /* @__PURE__ */ new Error(`${params.prefix} failed (${params.response.status}): ${detail}${scopeHint}`);
|
|
35
|
-
}
|
|
36
|
-
//#endregion
|
|
37
22
|
//#region extensions/google-meet/src/calendar.ts
|
|
38
23
|
const GOOGLE_CALENDAR_API_BASE_URL = "https://www.googleapis.com/calendar/v3";
|
|
39
24
|
const GOOGLE_CALENDAR_API_HOST = "www.googleapis.com";
|
|
40
25
|
const GOOGLE_CALENDAR_EVENTS_SCOPE = "https://www.googleapis.com/auth/calendar.events.readonly";
|
|
41
|
-
const GOOGLE_CALENDAR_REQUEST_TIMEOUT_MS = 3e4;
|
|
42
|
-
function appendQuery$2(url, query) {
|
|
43
|
-
const parsed = new URL(url);
|
|
44
|
-
for (const [key, value] of Object.entries(query)) if (value !== void 0) parsed.searchParams.set(key, String(value));
|
|
45
|
-
return parsed.toString();
|
|
46
|
-
}
|
|
47
26
|
function normalizeGoogleMeetCalendarUri(value) {
|
|
48
27
|
if (!value?.trim()) return;
|
|
49
28
|
try {
|
|
@@ -74,11 +53,7 @@ function extractGoogleMeetUriFromCalendarEvent(event) {
|
|
|
74
53
|
const hangoutLink = normalizeGoogleMeetCalendarUri(event.hangoutLink);
|
|
75
54
|
if (hangoutLink) return hangoutLink;
|
|
76
55
|
const entryPoints = event.conferenceData?.entryPoints ?? [];
|
|
77
|
-
|
|
78
|
-
if (videoEntryUri) return videoEntryUri;
|
|
79
|
-
const meetEntryUri = findFirstGoogleMeetCalendarUri(entryPoints);
|
|
80
|
-
if (meetEntryUri) return meetEntryUri;
|
|
81
|
-
return extractGoogleMeetUriFromText(event.location) ?? extractGoogleMeetUriFromText(event.description);
|
|
56
|
+
return findFirstGoogleMeetCalendarUri(entryPoints, (entry) => entry.entryPointType === "video") ?? findFirstGoogleMeetCalendarUri(entryPoints) ?? extractGoogleMeetUriFromText(event.location) ?? extractGoogleMeetUriFromText(event.description);
|
|
82
57
|
}
|
|
83
58
|
function buildGoogleMeetCalendarDayWindow(now = /* @__PURE__ */ new Date()) {
|
|
84
59
|
const start = new Date(now);
|
|
@@ -97,27 +72,14 @@ function rankCalendarEvent(event, nowMs) {
|
|
|
97
72
|
if (startMs > nowMs) return startMs - nowMs;
|
|
98
73
|
return nowMs - startMs + 2592e6;
|
|
99
74
|
}
|
|
100
|
-
function chooseBestMeetCalendarEvent(events, now) {
|
|
101
|
-
const nowMs = now.getTime();
|
|
102
|
-
let selected;
|
|
103
|
-
let selectedRank = Number.POSITIVE_INFINITY;
|
|
104
|
-
for (const event of events) {
|
|
105
|
-
if (event.status === "cancelled" || !extractGoogleMeetUriFromCalendarEvent(event)) continue;
|
|
106
|
-
const rank = rankCalendarEvent(event, nowMs);
|
|
107
|
-
if (!selected || rank < selectedRank) {
|
|
108
|
-
selected = event;
|
|
109
|
-
selectedRank = rank;
|
|
110
|
-
}
|
|
111
|
-
}
|
|
112
|
-
return selected;
|
|
113
|
-
}
|
|
114
75
|
async function fetchGoogleCalendarEvents(params) {
|
|
115
76
|
const calendarId = params.calendarId?.trim() || "primary";
|
|
116
77
|
const now = params.now ?? /* @__PURE__ */ new Date();
|
|
117
78
|
const defaultTimeMax = new Date(now);
|
|
118
79
|
defaultTimeMax.setDate(defaultTimeMax.getDate() + 7);
|
|
119
|
-
|
|
120
|
-
url:
|
|
80
|
+
return requestGoogleApi({
|
|
81
|
+
url: `${GOOGLE_CALENDAR_API_BASE_URL}/calendars/${encodeURIComponent(calendarId)}/events`,
|
|
82
|
+
query: {
|
|
121
83
|
maxResults: params.maxResults ?? 50,
|
|
122
84
|
orderBy: "startTime",
|
|
123
85
|
q: params.eventQuery?.trim() || void 0,
|
|
@@ -125,21 +87,13 @@ async function fetchGoogleCalendarEvents(params) {
|
|
|
125
87
|
singleEvents: true,
|
|
126
88
|
timeMin: params.timeMin ?? now.toISOString(),
|
|
127
89
|
timeMax: params.timeMax ?? defaultTimeMax.toISOString()
|
|
128
|
-
}
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
Accept: "application/json"
|
|
132
|
-
} },
|
|
133
|
-
policy: { allowedHostnames: [GOOGLE_CALENDAR_API_HOST] },
|
|
90
|
+
},
|
|
91
|
+
accessToken: params.accessToken,
|
|
92
|
+
allowedHostname: GOOGLE_CALENDAR_API_HOST,
|
|
134
93
|
auditContext: "google-meet.calendar.events.list",
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
if (!response.ok) throw await googleApiError({
|
|
139
|
-
response,
|
|
140
|
-
prefix: "Google Calendar events.list",
|
|
141
|
-
scopes: [GOOGLE_CALENDAR_EVENTS_SCOPE]
|
|
142
|
-
});
|
|
94
|
+
prefix: "Google Calendar events.list",
|
|
95
|
+
scopes: [GOOGLE_CALENDAR_EVENTS_SCOPE]
|
|
96
|
+
}, async (response) => {
|
|
143
97
|
const payload = await readProviderJsonResponse(response, "Google Calendar events.list");
|
|
144
98
|
if (payload.items !== void 0 && !Array.isArray(payload.items)) throw new Error("Google Calendar events.list response had non-array items");
|
|
145
99
|
return {
|
|
@@ -147,23 +101,33 @@ async function fetchGoogleCalendarEvents(params) {
|
|
|
147
101
|
events: payload.items ?? [],
|
|
148
102
|
now
|
|
149
103
|
};
|
|
150
|
-
}
|
|
151
|
-
await release();
|
|
152
|
-
}
|
|
104
|
+
});
|
|
153
105
|
}
|
|
154
106
|
async function listGoogleMeetCalendarEvents(params) {
|
|
155
107
|
const { calendarId, events, now } = await fetchGoogleCalendarEvents(params);
|
|
156
|
-
const
|
|
108
|
+
const meetEvents = [];
|
|
109
|
+
let best;
|
|
110
|
+
let bestRank = Number.POSITIVE_INFINITY;
|
|
111
|
+
for (const event of events) {
|
|
112
|
+
const meetingUri = extractGoogleMeetUriFromCalendarEvent(event);
|
|
113
|
+
if (!meetingUri) continue;
|
|
114
|
+
meetEvents.push({
|
|
115
|
+
event,
|
|
116
|
+
meetingUri,
|
|
117
|
+
selected: false
|
|
118
|
+
});
|
|
119
|
+
if (event.status !== "cancelled") {
|
|
120
|
+
const rank = rankCalendarEvent(event, now.getTime());
|
|
121
|
+
if (!best || rank < bestRank) {
|
|
122
|
+
best = event;
|
|
123
|
+
bestRank = rank;
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
for (const entry of meetEvents) entry.selected = entry.event === best;
|
|
157
128
|
return {
|
|
158
129
|
calendarId,
|
|
159
|
-
events:
|
|
160
|
-
const meetingUri = extractGoogleMeetUriFromCalendarEvent(event);
|
|
161
|
-
return meetingUri ? {
|
|
162
|
-
event,
|
|
163
|
-
meetingUri,
|
|
164
|
-
selected: event === best
|
|
165
|
-
} : void 0;
|
|
166
|
-
}).filter((event) => Boolean(event))
|
|
130
|
+
events: meetEvents
|
|
167
131
|
};
|
|
168
132
|
}
|
|
169
133
|
async function findGoogleMeetCalendarEvent(params) {
|
|
@@ -181,7 +145,6 @@ async function findGoogleMeetCalendarEvent(params) {
|
|
|
181
145
|
const GOOGLE_MEET_API_BASE_URL = `https://meet.googleapis.com/v2`;
|
|
182
146
|
const GOOGLE_MEET_URL_HOST = "meet.google.com";
|
|
183
147
|
const GOOGLE_MEET_API_HOST = "meet.googleapis.com";
|
|
184
|
-
const GOOGLE_MEET_REQUEST_TIMEOUT_MS = 3e4;
|
|
185
148
|
const GOOGLE_MEET_MEDIA_SCOPE = "https://www.googleapis.com/auth/meetings.conference.media.readonly";
|
|
186
149
|
const GOOGLE_MEET_SPACE_SCOPE = "https://www.googleapis.com/auth/meetings.space.readonly";
|
|
187
150
|
const GOOGLE_MEET_SPACE_CREATED_SCOPE = "https://www.googleapis.com/auth/meetings.space.created";
|
|
@@ -216,12 +179,6 @@ function normalizeConferenceRecordName(input) {
|
|
|
216
179
|
if (!trimmed) throw new Error("Conference record is required");
|
|
217
180
|
return trimmed.startsWith("conferenceRecords/") ? trimmed : `conferenceRecords/${trimmed}`;
|
|
218
181
|
}
|
|
219
|
-
function appendQuery$1(url, query) {
|
|
220
|
-
if (!query) return url;
|
|
221
|
-
const parsed = new URL(url);
|
|
222
|
-
for (const [key, value] of Object.entries(query)) if (value !== void 0) parsed.searchParams.set(key, String(value));
|
|
223
|
-
return parsed.toString();
|
|
224
|
-
}
|
|
225
182
|
function assertResourceArray(value, key, context) {
|
|
226
183
|
if (value === void 0) return [];
|
|
227
184
|
if (!Array.isArray(value)) throw new Error(`Google Meet ${context} response had non-array ${key}`);
|
|
@@ -229,51 +186,36 @@ function assertResourceArray(value, key, context) {
|
|
|
229
186
|
for (const resource of resources) if (!resource.name?.trim()) throw new Error(`Google Meet ${context} response included a resource without name`);
|
|
230
187
|
return resources;
|
|
231
188
|
}
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
url:
|
|
189
|
+
function requestGoogleMeetApi(params, read) {
|
|
190
|
+
return requestGoogleApi({
|
|
191
|
+
url: `${GOOGLE_MEET_API_BASE_URL}/${params.path}`,
|
|
192
|
+
query: params.query,
|
|
193
|
+
accessToken: params.accessToken,
|
|
194
|
+
allowedHostname: GOOGLE_MEET_API_HOST,
|
|
195
|
+
auditContext: `google-meet.${params.operation}`,
|
|
196
|
+
prefix: `Google Meet ${params.operation}`,
|
|
197
|
+
scopes: params.scopes ?? [GOOGLE_MEET_MEDIA_SCOPE],
|
|
235
198
|
init: {
|
|
236
199
|
method: params.method,
|
|
237
|
-
headers: {
|
|
238
|
-
Authorization: `Bearer ${params.accessToken}`,
|
|
239
|
-
Accept: "application/json",
|
|
240
|
-
...params.body === void 0 ? {} : { "Content-Type": "application/json" }
|
|
241
|
-
},
|
|
242
200
|
body: params.body
|
|
243
|
-
}
|
|
244
|
-
|
|
245
|
-
auditContext: params.auditContext,
|
|
246
|
-
timeoutMs: GOOGLE_MEET_REQUEST_TIMEOUT_MS
|
|
247
|
-
});
|
|
248
|
-
try {
|
|
249
|
-
if (!response.ok) throw await googleApiError({
|
|
250
|
-
response,
|
|
251
|
-
prefix: params.errorPrefix,
|
|
252
|
-
scopes: params.scopes ?? [GOOGLE_MEET_MEDIA_SCOPE]
|
|
253
|
-
});
|
|
254
|
-
return await read(response);
|
|
255
|
-
} finally {
|
|
256
|
-
await release();
|
|
257
|
-
}
|
|
201
|
+
}
|
|
202
|
+
}, read);
|
|
258
203
|
}
|
|
259
204
|
function fetchGoogleMeetJson(params) {
|
|
260
|
-
return requestGoogleMeetApi(params, (response) => readProviderJsonResponse(response, params.
|
|
205
|
+
return requestGoogleMeetApi(params, (response) => readProviderJsonResponse(response, `Google Meet ${params.operation}`));
|
|
261
206
|
}
|
|
262
207
|
async function listGoogleMeetCollection(params) {
|
|
263
208
|
const items = [];
|
|
264
209
|
let pageToken;
|
|
265
210
|
do {
|
|
266
211
|
const payload = await fetchGoogleMeetJson({
|
|
267
|
-
|
|
268
|
-
path: params.path,
|
|
212
|
+
...params,
|
|
269
213
|
query: {
|
|
270
214
|
...params.query,
|
|
271
215
|
pageToken
|
|
272
|
-
}
|
|
273
|
-
auditContext: params.auditContext,
|
|
274
|
-
errorPrefix: params.errorPrefix
|
|
216
|
+
}
|
|
275
217
|
});
|
|
276
|
-
const pageItems = assertResourceArray(payload[params.collectionKey], params.collectionKey, params.
|
|
218
|
+
const pageItems = assertResourceArray(payload[params.collectionKey], params.collectionKey, `Google Meet ${params.operation}`);
|
|
277
219
|
const remaining = typeof params.maxItems === "number" ? Math.max(params.maxItems - items.length, 0) : void 0;
|
|
278
220
|
items.push(...remaining === void 0 ? pageItems : pageItems.slice(0, remaining));
|
|
279
221
|
if (typeof params.maxItems === "number" && items.length >= params.maxItems) break;
|
|
@@ -286,8 +228,7 @@ async function fetchGoogleMeetSpace(params) {
|
|
|
286
228
|
const payload = await fetchGoogleMeetJson({
|
|
287
229
|
accessToken: params.accessToken,
|
|
288
230
|
path: encodeSpaceNameForPath(name),
|
|
289
|
-
|
|
290
|
-
errorPrefix: "Google Meet spaces.get",
|
|
231
|
+
operation: "spaces.get",
|
|
291
232
|
scopes: [GOOGLE_MEET_SPACE_SCOPE]
|
|
292
233
|
});
|
|
293
234
|
if (!payload.name?.trim()) throw new Error("Google Meet spaces.get response was missing name");
|
|
@@ -300,8 +241,7 @@ async function createGoogleMeetSpace(params) {
|
|
|
300
241
|
path: "spaces",
|
|
301
242
|
method: "POST",
|
|
302
243
|
body: hasConfig ? JSON.stringify({ config: params.config }) : "{}",
|
|
303
|
-
|
|
304
|
-
errorPrefix: "Google Meet spaces.create",
|
|
244
|
+
operation: "spaces.create",
|
|
305
245
|
scopes: hasConfig ? [GOOGLE_MEET_SPACE_CREATED_SCOPE, GOOGLE_MEET_SPACE_SETTINGS_SCOPE] : [GOOGLE_MEET_SPACE_CREATED_SCOPE]
|
|
306
246
|
});
|
|
307
247
|
if (!payload.name?.trim()) throw new Error("Google Meet spaces.create response was missing name");
|
|
@@ -313,17 +253,13 @@ async function createGoogleMeetSpace(params) {
|
|
|
313
253
|
};
|
|
314
254
|
}
|
|
315
255
|
async function endGoogleMeetActiveConference(params) {
|
|
316
|
-
const space = (await fetchGoogleMeetSpace(
|
|
317
|
-
accessToken: params.accessToken,
|
|
318
|
-
meeting: params.meeting
|
|
319
|
-
})).name;
|
|
256
|
+
const space = (await fetchGoogleMeetSpace(params)).name;
|
|
320
257
|
await requestGoogleMeetApi({
|
|
321
258
|
accessToken: params.accessToken,
|
|
322
259
|
path: `${encodeSpaceNameForPath(space)}:endActiveConference`,
|
|
323
260
|
method: "POST",
|
|
324
261
|
body: "{}",
|
|
325
|
-
|
|
326
|
-
errorPrefix: "Google Meet spaces.endActiveConference",
|
|
262
|
+
operation: "spaces.endActiveConference",
|
|
327
263
|
scopes: [GOOGLE_MEET_SPACE_CREATED_SCOPE]
|
|
328
264
|
}, async () => void 0);
|
|
329
265
|
return {
|
|
@@ -336,8 +272,7 @@ async function fetchGoogleMeetConferenceRecord(params) {
|
|
|
336
272
|
const payload = await fetchGoogleMeetJson({
|
|
337
273
|
accessToken: params.accessToken,
|
|
338
274
|
path: encodeResourceNameForPath(name),
|
|
339
|
-
|
|
340
|
-
errorPrefix: "Google Meet conferenceRecords.get"
|
|
275
|
+
operation: "conferenceRecords.get"
|
|
341
276
|
});
|
|
342
277
|
if (!payload.name?.trim()) throw new Error("Google Meet conferenceRecords.get response was missing name");
|
|
343
278
|
return payload;
|
|
@@ -353,15 +288,11 @@ async function listGoogleMeetConferenceRecords(params) {
|
|
|
353
288
|
filter
|
|
354
289
|
},
|
|
355
290
|
maxItems: params.maxItems,
|
|
356
|
-
|
|
357
|
-
errorPrefix: "Google Meet conferenceRecords.list"
|
|
291
|
+
operation: "conferenceRecords.list"
|
|
358
292
|
});
|
|
359
293
|
}
|
|
360
294
|
async function fetchLatestGoogleMeetConferenceRecord(params) {
|
|
361
|
-
const space = await fetchGoogleMeetSpace(
|
|
362
|
-
accessToken: params.accessToken,
|
|
363
|
-
meeting: params.meeting
|
|
364
|
-
});
|
|
295
|
+
const space = await fetchGoogleMeetSpace(params);
|
|
365
296
|
const [conferenceRecord] = await listGoogleMeetConferenceRecords({
|
|
366
297
|
accessToken: params.accessToken,
|
|
367
298
|
meeting: space.name,
|
|
@@ -381,8 +312,7 @@ function listGoogleMeetConferenceResources(collection, params) {
|
|
|
381
312
|
path: `${encodeResourceNameForPath(parent)}/${collection}`,
|
|
382
313
|
collectionKey: collection,
|
|
383
314
|
query: { pageSize: params.pageSize },
|
|
384
|
-
|
|
385
|
-
errorPrefix: `Google Meet conferenceRecords.${collection}.list`
|
|
315
|
+
operation: `conferenceRecords.${collection}.list`
|
|
386
316
|
});
|
|
387
317
|
}
|
|
388
318
|
async function listGoogleMeetParticipantSessions(params) {
|
|
@@ -391,8 +321,7 @@ async function listGoogleMeetParticipantSessions(params) {
|
|
|
391
321
|
path: `${encodeResourceNameForPath(params.participant)}/participantSessions`,
|
|
392
322
|
collectionKey: "participantSessions",
|
|
393
323
|
query: { pageSize: params.pageSize },
|
|
394
|
-
|
|
395
|
-
errorPrefix: "Google Meet conferenceRecords.participants.participantSessions.list"
|
|
324
|
+
operation: "conferenceRecords.participants.participantSessions.list"
|
|
396
325
|
});
|
|
397
326
|
}
|
|
398
327
|
async function listGoogleMeetTranscriptEntries(params) {
|
|
@@ -401,8 +330,7 @@ async function listGoogleMeetTranscriptEntries(params) {
|
|
|
401
330
|
path: `${encodeResourceNameForPath(params.transcript)}/entries`,
|
|
402
331
|
collectionKey: "transcriptEntries",
|
|
403
332
|
query: { pageSize: params.pageSize },
|
|
404
|
-
|
|
405
|
-
errorPrefix: "Google Meet conferenceRecords.transcripts.entries.list"
|
|
333
|
+
operation: "conferenceRecords.transcripts.entries.list"
|
|
406
334
|
});
|
|
407
335
|
}
|
|
408
336
|
async function resolveConferenceRecordQuery(params) {
|
|
@@ -438,13 +366,7 @@ async function resolveConferenceRecordQuery(params) {
|
|
|
438
366
|
const GOOGLE_DRIVE_API_BASE_URL = "https://www.googleapis.com/drive/v3";
|
|
439
367
|
const GOOGLE_DRIVE_API_HOST = "www.googleapis.com";
|
|
440
368
|
const GOOGLE_DRIVE_MEET_SCOPE = "https://www.googleapis.com/auth/drive.meet.readonly";
|
|
441
|
-
const GOOGLE_DRIVE_REQUEST_TIMEOUT_MS = 3e4;
|
|
442
369
|
const TEXT_PLAIN_MIME = "text/plain";
|
|
443
|
-
function appendQuery(url, query) {
|
|
444
|
-
const parsed = new URL(url);
|
|
445
|
-
for (const [key, value] of Object.entries(query)) if (value !== void 0) parsed.searchParams.set(key, value);
|
|
446
|
-
return parsed.toString();
|
|
447
|
-
}
|
|
448
370
|
function extractGoogleDriveDocumentId(value) {
|
|
449
371
|
if (typeof value !== "string") return;
|
|
450
372
|
const trimmed = value.trim();
|
|
@@ -457,49 +379,37 @@ function extractGoogleDriveDocumentId(value) {
|
|
|
457
379
|
return trimmed.split("/").filter(Boolean).at(-1);
|
|
458
380
|
}
|
|
459
381
|
async function exportGoogleDriveDocumentText(params) {
|
|
460
|
-
|
|
461
|
-
url:
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
} },
|
|
466
|
-
policy: { allowedHostnames: [GOOGLE_DRIVE_API_HOST] },
|
|
382
|
+
return requestGoogleApi({
|
|
383
|
+
url: `${GOOGLE_DRIVE_API_BASE_URL}/files/${encodeURIComponent(params.documentId)}/export`,
|
|
384
|
+
query: { mimeType: TEXT_PLAIN_MIME },
|
|
385
|
+
accessToken: params.accessToken,
|
|
386
|
+
allowedHostname: GOOGLE_DRIVE_API_HOST,
|
|
467
387
|
auditContext: "google-meet.drive.files.export",
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
response,
|
|
473
|
-
prefix: "Google Drive files.export",
|
|
474
|
-
scopes: [GOOGLE_DRIVE_MEET_SCOPE]
|
|
475
|
-
});
|
|
476
|
-
return await readProviderTextResponse(response, "Google Drive files.export");
|
|
477
|
-
} finally {
|
|
478
|
-
await release();
|
|
479
|
-
}
|
|
388
|
+
prefix: "Google Drive files.export",
|
|
389
|
+
scopes: [GOOGLE_DRIVE_MEET_SCOPE],
|
|
390
|
+
accept: TEXT_PLAIN_MIME
|
|
391
|
+
}, (response) => readProviderTextResponse(response, "Google Drive files.export"));
|
|
480
392
|
}
|
|
481
393
|
//#endregion
|
|
482
394
|
//#region extensions/google-meet/src/meet.ts
|
|
483
395
|
function getParticipantDisplayName(participant) {
|
|
484
396
|
return participant.signedinUser?.displayName ?? participant.anonymousUser?.displayName ?? participant.phoneUser?.displayName;
|
|
485
397
|
}
|
|
486
|
-
function
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
const documentId = getDocsDestinationDocumentId(params.resource.docsDestination);
|
|
491
|
-
if (!documentId) return params.resource;
|
|
398
|
+
async function attachDocumentText(accessToken, resource) {
|
|
399
|
+
const destination = resource.docsDestination;
|
|
400
|
+
const documentId = extractGoogleDriveDocumentId(destination?.document) ?? extractGoogleDriveDocumentId(destination?.documentId) ?? extractGoogleDriveDocumentId(destination?.file);
|
|
401
|
+
if (!documentId) return resource;
|
|
492
402
|
try {
|
|
493
403
|
return {
|
|
494
|
-
...
|
|
404
|
+
...resource,
|
|
495
405
|
documentText: await exportGoogleDriveDocumentText({
|
|
496
|
-
accessToken
|
|
406
|
+
accessToken,
|
|
497
407
|
documentId
|
|
498
408
|
})
|
|
499
409
|
};
|
|
500
410
|
} catch (error) {
|
|
501
411
|
return {
|
|
502
|
-
...
|
|
412
|
+
...resource,
|
|
503
413
|
documentTextError: formatErrorMessage(error)
|
|
504
414
|
};
|
|
505
415
|
}
|
|
@@ -619,15 +529,9 @@ async function fetchGoogleMeetArtifacts(params) {
|
|
|
619
529
|
conferenceRecord,
|
|
620
530
|
participants,
|
|
621
531
|
recordings,
|
|
622
|
-
transcripts: params.includeDocumentBodies === true ? await Promise.all(transcripts.map((transcript) => attachDocumentText(
|
|
623
|
-
accessToken: params.accessToken,
|
|
624
|
-
resource: transcript
|
|
625
|
-
}))) : transcripts,
|
|
532
|
+
transcripts: params.includeDocumentBodies === true ? await Promise.all(transcripts.map((transcript) => attachDocumentText(params.accessToken, transcript))) : transcripts,
|
|
626
533
|
transcriptEntries,
|
|
627
|
-
smartNotes: params.includeDocumentBodies === true ? await Promise.all(smartNotesResult.smartNotes.map((smartNote) => attachDocumentText(
|
|
628
|
-
accessToken: params.accessToken,
|
|
629
|
-
resource: smartNote
|
|
630
|
-
}))) : smartNotesResult.smartNotes,
|
|
534
|
+
smartNotes: params.includeDocumentBodies === true ? await Promise.all(smartNotesResult.smartNotes.map((smartNote) => attachDocumentText(params.accessToken, smartNote))) : smartNotesResult.smartNotes,
|
|
631
535
|
...smartNotesResult.smartNotesError ? { smartNotesError: smartNotesResult.smartNotesError } : {}
|
|
632
536
|
};
|
|
633
537
|
}));
|
|
@@ -687,8 +591,6 @@ var plugin_helpers_exports = /* @__PURE__ */ __exportAll({
|
|
|
687
591
|
buildGoogleMeetCalendarDayWindow: () => buildGoogleMeetCalendarDayWindow,
|
|
688
592
|
buildGoogleMeetExportRequest: () => buildGoogleMeetExportRequest,
|
|
689
593
|
buildGoogleMeetPreflightReport: () => buildGoogleMeetPreflightReport,
|
|
690
|
-
createAndJoinMeetFromParams: () => createAndJoinMeetFromParams,
|
|
691
|
-
createMeetFromParams: () => createMeetFromParams,
|
|
692
594
|
endGoogleMeetActiveConference: () => endGoogleMeetActiveConference,
|
|
693
595
|
exportGoogleMeetBundleFromParams: () => exportGoogleMeetBundleFromParams,
|
|
694
596
|
fetchLatestGoogleMeetConferenceRecord: () => fetchLatestGoogleMeetConferenceRecord,
|
|
@@ -700,16 +602,9 @@ var plugin_helpers_exports = /* @__PURE__ */ __exportAll({
|
|
|
700
602
|
resolveMeetingFromParams: () => resolveMeetingFromParams,
|
|
701
603
|
resolveSpaceFromParams: () => resolveSpaceFromParams
|
|
702
604
|
});
|
|
703
|
-
const
|
|
704
|
-
const loadGoogleMeetExportModule = createLazyRuntimeModule(() => import("./cli-export-D4IM6KLJ.mjs").then((n) => n.t));
|
|
705
|
-
async function createMeetFromParams(params) {
|
|
706
|
-
return (await loadGoogleMeetCreateModule()).createMeetFromParams(params);
|
|
707
|
-
}
|
|
708
|
-
async function createAndJoinMeetFromParams(params) {
|
|
709
|
-
return (await loadGoogleMeetCreateModule()).createAndJoinMeetFromParams(params);
|
|
710
|
-
}
|
|
605
|
+
const loadGoogleMeetExportModule = createLazyRuntimeModule(() => import("./cli-export-BOebaVFW.mjs").then((n) => n.t));
|
|
711
606
|
async function resolveGoogleMeetTokenFromParams(config, raw) {
|
|
712
|
-
const { resolveGoogleMeetAccessToken } = await import("./oauth-
|
|
607
|
+
const { resolveGoogleMeetAccessToken } = await import("./oauth-XgdPFWEJ.mjs");
|
|
713
608
|
return resolveGoogleMeetAccessToken({
|
|
714
609
|
clientId: normalizeOptionalString(raw.clientId) ?? config.oauth.clientId,
|
|
715
610
|
clientSecret: normalizeOptionalString(raw.clientSecret) ?? config.oauth.clientSecret,
|
|
@@ -780,25 +675,14 @@ async function resolveArtifactQueryFromParams(config, raw) {
|
|
|
780
675
|
}
|
|
781
676
|
function fetchResolvedGoogleMeetArtifacts(query) {
|
|
782
677
|
return fetchGoogleMeetArtifacts({
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
conferenceRecord: query.conferenceRecord,
|
|
786
|
-
pageSize: query.pageSize,
|
|
787
|
-
includeTranscriptEntries: query.includeTranscriptEntries,
|
|
788
|
-
includeDocumentBodies: query.includeDocumentBodies,
|
|
789
|
-
allConferenceRecords: query.allConferenceRecords
|
|
678
|
+
...query,
|
|
679
|
+
accessToken: query.token.accessToken
|
|
790
680
|
});
|
|
791
681
|
}
|
|
792
682
|
function fetchResolvedGoogleMeetAttendance(query) {
|
|
793
683
|
return fetchGoogleMeetAttendance({
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
conferenceRecord: query.conferenceRecord,
|
|
797
|
-
pageSize: query.pageSize,
|
|
798
|
-
allConferenceRecords: query.allConferenceRecords,
|
|
799
|
-
mergeDuplicateParticipants: query.mergeDuplicateParticipants,
|
|
800
|
-
lateAfterMinutes: query.lateAfterMinutes,
|
|
801
|
-
earlyBeforeMinutes: query.earlyBeforeMinutes
|
|
684
|
+
...query,
|
|
685
|
+
accessToken: query.token.accessToken
|
|
802
686
|
});
|
|
803
687
|
}
|
|
804
688
|
function buildGoogleMeetExportRequest(resolved, calendarId) {
|
|
@@ -833,4 +717,4 @@ async function exportGoogleMeetBundleFromParams(config, raw) {
|
|
|
833
717
|
});
|
|
834
718
|
}
|
|
835
719
|
//#endregion
|
|
836
|
-
export {
|
|
720
|
+
export { resolveArtifactQueryFromParams as a, resolveSpaceFromParams as c, endGoogleMeetActiveConference as d, fetchGoogleMeetSpace as f, __exportAll as g, listGoogleMeetCalendarEvents as h, plugin_helpers_exports as i, buildGoogleMeetPreflightReport as l, buildGoogleMeetCalendarDayWindow as m, fetchResolvedGoogleMeetArtifacts as n, resolveGoogleMeetTokenFromParams as o, fetchLatestGoogleMeetConferenceRecord as p, fetchResolvedGoogleMeetAttendance as r, resolveMeetingFromParams as s, buildGoogleMeetExportRequest as t, createGoogleMeetSpace as u };
|
|
@@ -4,11 +4,12 @@ import { asNonArrayRecord, normalizeOptionalString } from "openclaw/plugin-sdk/s
|
|
|
4
4
|
import { formatErrorMessage } from "openclaw/plugin-sdk/error-runtime";
|
|
5
5
|
import { createLazyRuntimeModule } from "openclaw/plugin-sdk/lazy-runtime";
|
|
6
6
|
//#region extensions/google-meet/src/plugin-registration.ts
|
|
7
|
-
const loadGoogleMeetPluginHelpers = createLazyRuntimeModule(() => import("./plugin-helpers-
|
|
8
|
-
const loadGoogleMeetCliModule = createLazyRuntimeModule(() => import("./cli-
|
|
9
|
-
const
|
|
10
|
-
const
|
|
11
|
-
const
|
|
7
|
+
const loadGoogleMeetPluginHelpers = createLazyRuntimeModule(() => import("./plugin-helpers-D1OyyzEZ.mjs").then((n) => n.i));
|
|
8
|
+
const loadGoogleMeetCliModule = createLazyRuntimeModule(() => import("./cli-Bfm5LpNM.mjs"));
|
|
9
|
+
const loadGoogleMeetCreateModule = createLazyRuntimeModule(() => import("./create-DyYbmN11.mjs").then((n) => n.t));
|
|
10
|
+
const loadGoogleMeetNodeHostModule = createLazyRuntimeModule(() => import("./node-host-CyFclhO_.mjs"));
|
|
11
|
+
const loadGoogleMeetRuntimeModule = createLazyRuntimeModule(() => import("./runtime-DQgxZ2Na.mjs"));
|
|
12
|
+
const loadGoogleMeetNodeInvokePolicyModule = createLazyRuntimeModule(() => import("./node-invoke-policy-BnX3PaH7.mjs"));
|
|
12
13
|
const loadGoogleMeetGatewayRuntimeModule = createLazyRuntimeModule(() => import("openclaw/plugin-sdk/gateway-runtime"));
|
|
13
14
|
const loadGoogleMeetNodeInvokePolicy = async (config) => (await loadGoogleMeetNodeInvokePolicyModule()).createGoogleMeetChromeNodeInvokePolicy(config);
|
|
14
15
|
function normalizeTransport(value) {
|
|
@@ -27,17 +28,14 @@ function shouldJoinCreatedMeet(raw) {
|
|
|
27
28
|
return raw.join !== false && raw.join !== "false";
|
|
28
29
|
}
|
|
29
30
|
const googleMeetToolDeps = { platform: () => process.platform };
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
default: return `googlemeet.${action}`;
|
|
39
|
-
}
|
|
40
|
-
}
|
|
31
|
+
const googleMeetGatewayMethods = {
|
|
32
|
+
participation_context: "googlemeet.participationContext",
|
|
33
|
+
recover_current_tab: "googlemeet.recoverCurrentTab",
|
|
34
|
+
setup_status: "googlemeet.setup",
|
|
35
|
+
test_speech: "googlemeet.testSpeech",
|
|
36
|
+
test_listen: "googlemeet.testListen",
|
|
37
|
+
end_active_conference: "googlemeet.endActiveConference"
|
|
38
|
+
};
|
|
41
39
|
function readGoogleMeetParticipationParams(raw) {
|
|
42
40
|
const sessionId = normalizeOptionalString(raw.sessionId);
|
|
43
41
|
if (!sessionId) throw new Error("sessionId required");
|
|
@@ -61,30 +59,24 @@ function readGoogleMeetParticipationParams(raw) {
|
|
|
61
59
|
}
|
|
62
60
|
};
|
|
63
61
|
}
|
|
64
|
-
function
|
|
62
|
+
function assertGoogleMeetAgentToolActionSupported(params) {
|
|
65
63
|
const platform = googleMeetToolDeps.platform();
|
|
66
|
-
if (platform === "darwin" || platform === "linux") return
|
|
64
|
+
if (platform === "darwin" || platform === "linux") return;
|
|
67
65
|
const action = params.raw.action;
|
|
68
|
-
if (action !== "join" && action !== "test_speech" && !(action === "create" && shouldJoinCreatedMeet(params.raw))) return
|
|
66
|
+
if (action !== "join" && action !== "test_speech" && !(action === "create" && shouldJoinCreatedMeet(params.raw))) return;
|
|
69
67
|
const transport = normalizeTransport(params.raw.transport) ?? params.config.defaultTransport;
|
|
70
68
|
const mode = action === "test_speech" ? "agent" : normalizeMode(params.raw.mode) ?? params.config.defaultMode;
|
|
71
|
-
|
|
72
|
-
}
|
|
73
|
-
function assertGoogleMeetAgentToolActionSupported(params) {
|
|
74
|
-
if (!isGoogleMeetAgentToolActionUnsupportedOnHost(params)) return;
|
|
69
|
+
if (transport !== "chrome" || mode !== "agent" && mode !== "bidi") return;
|
|
75
70
|
throw new Error("Google Meet local Chrome talk-back audio requires macOS with BlackHole 2ch or Linux with PipeWire-Pulse. On this host, use mode: transcribe, transport: twilio, or a supported chrome-node.");
|
|
76
71
|
}
|
|
77
|
-
function readGatewayErrorDetails(err) {
|
|
78
|
-
if (!err || typeof err !== "object" || !("details" in err)) return;
|
|
79
|
-
return err.details;
|
|
80
|
-
}
|
|
81
72
|
async function callGoogleMeetGatewayFromTool(params) {
|
|
73
|
+
const method = googleMeetGatewayMethods[params.action] ?? `googlemeet.${params.action}`;
|
|
82
74
|
try {
|
|
83
|
-
if (params.runtime) return await params.runtime.gateway.request(
|
|
75
|
+
if (params.runtime) return await params.runtime.gateway.request(method, params.raw, {
|
|
84
76
|
timeoutMs: resolveGoogleMeetGatewayOperationTimeoutMs(params.config),
|
|
85
77
|
scopes: ["operator.admin"]
|
|
86
78
|
});
|
|
87
|
-
return await (googleMeetToolDeps.callGatewayFromCli ?? (await loadGoogleMeetGatewayRuntimeModule()).callGatewayFromCli)(
|
|
79
|
+
return await (googleMeetToolDeps.callGatewayFromCli ?? (await loadGoogleMeetGatewayRuntimeModule()).callGatewayFromCli)(method, {
|
|
88
80
|
json: true,
|
|
89
81
|
timeout: String(resolveGoogleMeetGatewayOperationTimeoutMs(params.config))
|
|
90
82
|
}, params.raw, {
|
|
@@ -92,7 +84,7 @@ async function callGoogleMeetGatewayFromTool(params) {
|
|
|
92
84
|
scopes: ["operator.admin"]
|
|
93
85
|
});
|
|
94
86
|
} catch (err) {
|
|
95
|
-
const details =
|
|
87
|
+
const details = err && typeof err === "object" && "details" in err ? err.details : void 0;
|
|
96
88
|
if (details && typeof details === "object") return details;
|
|
97
89
|
throw err;
|
|
98
90
|
}
|
|
@@ -171,4 +163,4 @@ function sendGoogleMeetGatewayError(respond, err, code = "UNAVAILABLE") {
|
|
|
171
163
|
});
|
|
172
164
|
}
|
|
173
165
|
//#endregion
|
|
174
|
-
export { formatGoogleMeetGatewayError as a,
|
|
166
|
+
export { formatGoogleMeetGatewayError as a, loadGoogleMeetCreateModule as c, normalizeMode as d, normalizeTransport as f, shouldJoinCreatedMeet as g, sendGoogleMeetGatewayError as h, createLazyGoogleMeetNodeInvokePolicy as i, loadGoogleMeetNodeHostModule as l, resolveMeetingInput as m, callGoogleMeetGatewayFromTool as n, keepTrustedToolAgentId as o, readGoogleMeetParticipationParams as p, createGoogleMeetRuntimeAccessor as r, loadGoogleMeetCliModule as s, assertGoogleMeetAgentToolActionSupported as t, loadGoogleMeetPluginHelpers as u };
|