@openclaw/google-meet 2026.10.10-beta.5 → 2026.11.5-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.
Files changed (102) hide show
  1. package/assets/activity.svg +1 -1
  2. package/dist/.setup/{chrome-create-CW_QQzuj.mjs → chrome-create-BlDlV2YP.mjs} +14 -36
  3. package/dist/.setup/{cli-CBLj67Qo.mjs → cli-C-MrY7IZ.mjs} +278 -318
  4. package/dist/.setup/{cli-export-3ijBYTqg.mjs → cli-export-6eiywS3T.mjs} +18 -39
  5. package/dist/.setup/{cli-output-mode-BwH_6tH8.mjs → cli-output-mode-DztqqVeZ.mjs} +6 -8
  6. package/dist/.setup/config-CMTw0Anh.mjs +110 -0
  7. package/dist/.setup/{create-DMUmVyQg.mjs → create-DMk4zbMq.mjs} +24 -11
  8. package/dist/.setup/{google-api-KAOF1Wn5.mjs → google-api-B5FR9zy2.mjs} +1 -2
  9. package/dist/.setup/{google-meet-platform-adapter-Bz77Bdt-.mjs → google-meet-platform-adapter-DgchqNLV.mjs} +60 -32
  10. package/dist/.setup/{google-meet-platform-constants-CnRfrYX7.mjs → google-meet-platform-constants-C83Cdmpd.mjs} +2 -4
  11. package/dist/.setup/{meet-url-i_QvIxnP.mjs → meet-url-DzLdrq0Z.mjs} +1 -2
  12. package/dist/.setup/{node-host-BP4g4zw3.mjs → node-host-BIZD9InM.mjs} +4 -5
  13. package/dist/.setup/{node-invoke-policy-67WaZNPN.mjs → node-invoke-policy-bg7p_BWB.mjs} +3 -4
  14. package/dist/.setup/oauth-DZkuGMs1.mjs +1 -0
  15. package/dist/.setup/{plugin-helpers-D3VKNUTD.mjs → plugin-helpers-ChCBuyAl.mjs} +369 -81
  16. package/dist/.setup/{plugin-registration-1Oc4T1Bj.mjs → plugin-registration-CAW7_zO_.mjs} +10 -11
  17. package/dist/.setup/{runtime-2_R9PsRx.mjs → runtime-Cyc6bv1i.mjs} +44 -51
  18. package/dist/.source-module-urls/c06239f68b6f4959b5d3db7e0cee004911d8eb43092f4135c729b507e37f6333.json +1 -1
  19. package/dist/cli-metadata.js +2 -3
  20. package/dist/doctor-contract-api.js +26 -23
  21. package/dist/index.js +17 -18
  22. package/node_modules/typebox/build/format/duration.d.mts +2 -2
  23. package/node_modules/typebox/build/format/duration.mjs +2 -2
  24. package/node_modules/typebox/build/format/idn_email.d.mts +1 -0
  25. package/node_modules/typebox/build/format/idn_email.mjs +1 -0
  26. package/node_modules/typebox/build/format/idn_hostname.d.mts +1 -1
  27. package/node_modules/typebox/build/format/idn_hostname.mjs +1 -1
  28. package/node_modules/typebox/build/format/ipv4.d.mts +2 -2
  29. package/node_modules/typebox/build/format/ipv4.mjs +2 -2
  30. package/node_modules/typebox/build/format/ipv6.d.mts +1 -1
  31. package/node_modules/typebox/build/format/ipv6.mjs +1 -1
  32. package/node_modules/typebox/build/format/relative_json_pointer.d.mts +2 -2
  33. package/node_modules/typebox/build/format/relative_json_pointer.mjs +2 -2
  34. package/node_modules/typebox/build/schema/build.mjs +1 -0
  35. package/node_modules/typebox/build/schema/engine/_unique.d.mts +4 -2
  36. package/node_modules/typebox/build/schema/engine/_unique.mjs +7 -3
  37. package/node_modules/typebox/build/schema/engine/additionalItems.mjs +3 -3
  38. package/node_modules/typebox/build/schema/engine/additionalProperties.d.mts +0 -3
  39. package/node_modules/typebox/build/schema/engine/additionalProperties.mjs +15 -17
  40. package/node_modules/typebox/build/schema/engine/contains.mjs +3 -3
  41. package/node_modules/typebox/build/schema/engine/index.d.mts +1 -0
  42. package/node_modules/typebox/build/schema/engine/index.mjs +1 -0
  43. package/node_modules/typebox/build/schema/engine/items.mjs +7 -4
  44. package/node_modules/typebox/build/schema/engine/maxContains.mjs +2 -2
  45. package/node_modules/typebox/build/schema/engine/minContains.mjs +3 -3
  46. package/node_modules/typebox/build/schema/engine/oneOf.mjs +2 -2
  47. package/node_modules/typebox/build/schema/engine/patternProperties.mjs +2 -2
  48. package/node_modules/typebox/build/schema/engine/propertyNames.mjs +2 -2
  49. package/node_modules/typebox/build/schema/engine/unevaluatedItems.mjs +2 -2
  50. package/node_modules/typebox/build/schema/engine/unevaluatedProperties.mjs +2 -2
  51. package/node_modules/typebox/build/system/hashing/hash.mjs +63 -34
  52. package/node_modules/typebox/build/system/locale/en_US.mjs +2 -1
  53. package/node_modules/typebox/build/system/memory/assign.d.mts +2 -8
  54. package/node_modules/typebox/build/system/memory/assign.mjs +13 -6
  55. package/node_modules/typebox/build/system/memory/clone.d.mts +4 -5
  56. package/node_modules/typebox/build/system/memory/clone.mjs +8 -96
  57. package/node_modules/typebox/build/system/memory/create.d.mts +1 -5
  58. package/node_modules/typebox/build/system/memory/create.mjs +18 -13
  59. package/node_modules/typebox/build/system/memory/deep.d.mts +2 -0
  60. package/node_modules/typebox/build/system/memory/deep.mjs +108 -0
  61. package/node_modules/typebox/build/system/memory/discard.d.mts +1 -1
  62. package/node_modules/typebox/build/system/memory/discard.mjs +9 -8
  63. package/node_modules/typebox/build/system/memory/finalize.d.mts +4 -0
  64. package/node_modules/typebox/build/system/memory/finalize.mjs +30 -0
  65. package/node_modules/typebox/build/system/memory/keys.d.mts +2 -0
  66. package/node_modules/typebox/build/system/memory/keys.mjs +8 -0
  67. package/node_modules/typebox/build/system/memory/update.d.mts +1 -4
  68. package/node_modules/typebox/build/system/memory/update.mjs +43 -16
  69. package/node_modules/typebox/build/type/engine/call/index.d.mts +1 -0
  70. package/node_modules/typebox/build/type/engine/call/index.mjs +1 -0
  71. package/node_modules/typebox/build/type/engine/evaluate/composite.d.mts +2 -24
  72. package/node_modules/typebox/build/type/engine/evaluate/composite.mjs +2 -29
  73. package/node_modules/typebox/build/type/engine/evaluate/index.d.mts +1 -0
  74. package/node_modules/typebox/build/type/engine/evaluate/index.mjs +1 -0
  75. package/node_modules/typebox/build/type/engine/evaluate/narrow.d.mts +5 -1
  76. package/node_modules/typebox/build/type/engine/evaluate/narrow.mjs +6 -1
  77. package/node_modules/typebox/build/type/engine/evaluate/property.d.mts +30 -0
  78. package/node_modules/typebox/build/type/engine/evaluate/property.mjs +29 -0
  79. package/node_modules/typebox/build/type/engine/immutable/instantiate_add.d.mts +1 -3
  80. package/node_modules/typebox/build/type/engine/immutable/instantiate_add.mjs +1 -4
  81. package/node_modules/typebox/build/type/engine/object/from_intersect.d.mts +2 -2
  82. package/node_modules/typebox/build/type/engine/object/from_intersect.mjs +2 -2
  83. package/node_modules/typebox/build/type/engine/object/from_union.d.mts +2 -2
  84. package/node_modules/typebox/build/type/engine/object/from_union.mjs +2 -2
  85. package/node_modules/typebox/build/type/engine/optional/instantiate_add.d.mts +1 -3
  86. package/node_modules/typebox/build/type/engine/optional/instantiate_add.mjs +1 -4
  87. package/node_modules/typebox/build/type/engine/readonly/instantiate_add.d.mts +1 -3
  88. package/node_modules/typebox/build/type/engine/readonly/instantiate_add.mjs +1 -4
  89. package/node_modules/typebox/build/type/engine/this/index.d.mts +1 -0
  90. package/node_modules/typebox/build/type/engine/this/index.mjs +1 -0
  91. package/node_modules/typebox/build/value/clone/clone.d.mts +4 -3
  92. package/node_modules/typebox/build/value/clone/clone.mjs +5 -7
  93. package/node_modules/typebox/build/value/repair/from_cyclic.d.mts +2 -0
  94. package/node_modules/typebox/build/value/repair/from_cyclic.mjs +6 -0
  95. package/node_modules/typebox/build/value/shared/union_priority_sort.mjs +25 -14
  96. package/node_modules/typebox/package.json +1 -1
  97. package/node_modules/typebox/readme.md +1 -1
  98. package/package.json +5 -5
  99. package/dist/.setup/config-BXGAMntj.mjs +0 -240
  100. package/dist/.setup/oauth-pXa-YQ9H.mjs +0 -159
  101. package/node_modules/typebox/build/system/memory/freeze.d.mts +0 -4
  102. package/node_modules/typebox/build/system/memory/freeze.mjs +0 -6
@@ -1,12 +1,11 @@
1
- import { a as resolveArtifactQueryFromParams, c as resolveSpaceFromParams, d as endGoogleMeetActiveConference, f as fetchGoogleMeetSpace, h as listGoogleMeetCalendarEvents, l as buildGoogleMeetPreflightReport, m as buildGoogleMeetCalendarDayWindow, n as fetchResolvedGoogleMeetArtifacts, o as resolveGoogleMeetTokenFromParams, p as fetchLatestGoogleMeetConferenceRecord, r as fetchResolvedGoogleMeetAttendance, s as resolveMeetingFromParams, t as buildGoogleMeetExportRequest, u as createGoogleMeetSpace } from "./plugin-helpers-D3VKNUTD.mjs";
2
- import { i as resolveGoogleMeetGatewayOperationTimeoutMs } from "./config-BXGAMntj.mjs";
3
- import { C as writeStdoutJson, S as writeSetupStatus, _ as resolveGoogleMeetOAuthCallbackTimeoutMs, a as renderAttendanceCsv, b as writeLeaveResult, c as callGoogleMeetGateway, d as parseGoogleMeetTransport, f as parseOptionalNumber, g as resolveCliJoinRequest, h as promptInput, i as renderAttendance, l as parseGoogleMeetBrowserTransport, m as parsePositiveNumber, n as exportGoogleMeetBundle, o as writeCalendarEventsSummary, p as parsePositiveIntegerOption, r as renderArtifacts, s as writeLatestConferenceRecordSummary, u as parseGoogleMeetMode, v as writeCliOutput, w as writeStdoutLine, x as writeRecoverCurrentTabResult, y as writeDoctorStatus } from "./cli-export-3ijBYTqg.mjs";
4
- import { buildGoogleMeetAuthUrl, exchangeGoogleMeetAuthCode, resolveGoogleMeetAccessToken, waitForGoogleMeetAuthCode } from "./oauth-pXa-YQ9H.mjs";
5
- import { i as hasGoogleMeetOAuth, r as hasCreateSpaceConfigInput, t as createSpaceFromParams } from "./create-DMUmVyQg.mjs";
1
+ import { i as hasGoogleMeetOAuth, r as hasCreateSpaceConfigInput, t as createSpaceFromParams } from "./create-DMk4zbMq.mjs";
2
+ import { i as resolveGoogleMeetGatewayOperationTimeoutMs } from "./config-CMTw0Anh.mjs";
3
+ import { _ as writeStdoutLine, a as parseOptionalNumber, c as promptInput, d as writeCliOutput, exportGoogleMeetBundle, f as writeDoctorStatus, g as writeStdoutJson, h as writeSetupStatus, i as parseGoogleMeetTransport, l as resolveCliJoinRequest, m as writeRecoverCurrentTabResult, n as parseGoogleMeetBrowserTransport, o as parsePositiveIntegerOption, p as writeLeaveResult, r as parseGoogleMeetMode, renderArtifacts, renderAttendance, renderAttendanceCsv, s as parsePositiveNumber, t as callGoogleMeetGateway, u as resolveGoogleMeetOAuthCallbackTimeoutMs, writeCalendarEventsSummary, writeLatestConferenceRecordSummary } from "./cli-export-6eiywS3T.mjs";
4
+ import { buildGoogleMeetCalendarDayWindow, buildGoogleMeetExportRequest, buildGoogleMeetPreflightReport, c as fetchGoogleMeetSpace, endGoogleMeetActiveConference, fetchLatestGoogleMeetConferenceRecord, fetchResolvedGoogleMeetArtifacts, fetchResolvedGoogleMeetAttendance, listGoogleMeetCalendarEvents, n as exchangeGoogleMeetAuthCode, o as waitForGoogleMeetAuthCode, resolveArtifactQueryFromParams, resolveGoogleMeetTokenFromParams, resolveMeetingFromParams, resolveSpaceFromParams, s as createGoogleMeetSpace, t as buildGoogleMeetAuthUrl } from "./plugin-helpers-ChCBuyAl.mjs";
6
5
  import { parseStrictNonNegativeInteger } from "openclaw/plugin-sdk/number-runtime";
7
6
  import { generateHexPkceVerifierChallenge } from "openclaw/plugin-sdk/provider-auth";
8
7
  import { generateOAuthState } from "openclaw/plugin-sdk/provider-auth-runtime";
9
- //#region extensions/google-meet/src/cli-command-context.ts
8
+ // extensions/google-meet/src/cli-command-context.ts
10
9
  function addGoogleMeetOAuthOptions(command) {
11
10
  return command.option("--access-token <token>", "Access token override").option("--refresh-token <token>", "Refresh token override").option("--client-id <id>", "OAuth client id override").option("--client-secret <secret>", "OAuth client secret override").option("--expires-at <ms>", "Cached access token expiry as unix epoch milliseconds");
12
11
  }
@@ -40,297 +39,7 @@ async function callGoogleMeetRuntime(context, method, payload, local, timeoutMs)
40
39
  });
41
40
  return delegated.ok ? delegated.payload : local(await context.ensureRuntime());
42
41
  }
43
- //#endregion
44
- //#region extensions/google-meet/src/cli-artifact-commands.ts
45
- async function resolveCliArtifactQuery(context, options) {
46
- const meeting = options.meeting?.trim() || context.config.defaults.meeting;
47
- const conferenceRecord = options.conferenceRecord?.trim();
48
- if (!meeting && !conferenceRecord && !(options.today || options.event?.trim())) throw new Error("Meeting input or conference record is required. Pass --meeting, --today, --event, --conference-record, or configure defaults.meeting.");
49
- const { lateAfterMinutes: late, earlyBeforeMinutes: early, ...queryOptions } = options;
50
- const raw = {
51
- ...resolveCliParams(queryOptions),
52
- meeting,
53
- conferenceRecord,
54
- pageSize: parsePositiveIntegerOption(options.pageSize, "page-size"),
55
- includeTranscriptEntries: options.transcriptEntries,
56
- includeAllConferenceRecords: options.allConferenceRecords,
57
- includeDocumentBodies: options.includeDocBodies,
58
- mergeDuplicateParticipants: options.mergeDuplicates
59
- };
60
- const lateAfterMinutes = parseOptionalNumber(late);
61
- const earlyBeforeMinutes = parseOptionalNumber(early);
62
- return {
63
- ...await resolveArtifactQueryFromParams(context.config, raw),
64
- lateAfterMinutes,
65
- earlyBeforeMinutes
66
- };
67
- }
68
- function resolveTokenSource(refreshed) {
69
- return refreshed ? "refresh-token" : "cached-access-token";
70
- }
71
- async function writeArtifactOutput(options, result, refreshed, render, csv) {
72
- const tokenSource = resolveTokenSource(refreshed);
73
- let text;
74
- if (options.json) text = JSON.stringify({
75
- ...result,
76
- tokenSource
77
- }, null, 2);
78
- else if (options.format === "markdown") text = render(result, "markdown");
79
- else if (options.format === "csv" && csv) text = csv(result);
80
- else if (!options.format || options.format === "summary") text = `${render(result, "summary")}token source: ${tokenSource}\n`;
81
- else throw new Error(csv ? "Unsupported format. Expected summary, markdown, or csv." : "Unsupported format. Expected summary or markdown.");
82
- await writeCliOutput(options, text);
83
- }
84
- function registerGoogleMeetArtifactCommands(context) {
85
- const { root } = context;
86
- addGoogleMeetArtifactOptions(root.command("artifacts").description("List Meet conference records and available participant/artifact metadata")).option("--no-transcript-entries", "Skip structured transcript entry lookup").option("--include-doc-bodies", "Export linked transcript and smart-note Google Docs text").option("--format <format>", "Output format: summary or markdown", "summary").option("--output <path>", "Write output to a file instead of stdout").option("--json", "Print JSON output", false).action(async (options) => {
87
- const resolved = await resolveCliArtifactQuery(context, options);
88
- await writeArtifactOutput(options, await fetchResolvedGoogleMeetArtifacts(resolved), resolved.token.refreshed, renderArtifacts);
89
- });
90
- addGoogleMeetArtifactOptions(root.command("attendance").description("List Meet participants and participant sessions")).option("--no-merge-duplicates", "Keep duplicate participant resources as separate rows").option("--late-after-minutes <n>", "Mark participants late after this many minutes", "5").option("--early-before-minutes <n>", "Mark early leavers before this many minutes", "5").option("--format <format>", "Output format: summary, markdown, or csv", "summary").option("--output <path>", "Write output to a file instead of stdout").option("--json", "Print JSON output", false).action(async (options) => {
91
- const resolved = await resolveCliArtifactQuery(context, options);
92
- await writeArtifactOutput(options, await fetchResolvedGoogleMeetAttendance(resolved), resolved.token.refreshed, renderAttendance, renderAttendanceCsv);
93
- });
94
- addGoogleMeetArtifactOptions(root.command("export").description("Write Meet artifacts, attendance, transcript, and raw JSON into a folder")).option("--no-transcript-entries", "Skip structured transcript entry lookup").option("--include-doc-bodies", "Export linked transcript and smart-note Google Docs text").option("--no-merge-duplicates", "Keep duplicate participant resources as separate rows").option("--late-after-minutes <n>", "Mark participants late after this many minutes", "5").option("--early-before-minutes <n>", "Mark early leavers before this many minutes", "5").option("--output <dir>", "Output directory").option("--zip", "Also write a portable .zip archive").option("--dry-run", "Fetch export data and print the manifest without writing files", false).option("--json", "Print JSON output", false).action(async (options) => {
95
- const resolved = await resolveCliArtifactQuery(context, options);
96
- const artifacts = await fetchResolvedGoogleMeetArtifacts(resolved);
97
- const attendance = await fetchResolvedGoogleMeetAttendance(resolved);
98
- const payload = await exportGoogleMeetBundle({
99
- outputDir: options.output,
100
- artifacts,
101
- attendance,
102
- zip: Boolean(options.zip),
103
- dryRun: options.dryRun,
104
- request: buildGoogleMeetExportRequest(resolved, options.calendar),
105
- tokenSource: resolveTokenSource(resolved.token.refreshed),
106
- calendarEvent: resolved.calendarEvent
107
- });
108
- if (options.json || "dryRun" in payload) {
109
- writeStdoutJson(payload);
110
- return;
111
- }
112
- writeStdoutLine("export: %s", payload.outputDir);
113
- for (const file of payload.files) writeStdoutLine("- %s", file);
114
- if (payload.zipFile) writeStdoutLine("zip: %s", payload.zipFile);
115
- });
116
- }
117
- //#endregion
118
- //#region extensions/google-meet/src/cli-doctor.ts
119
- function sanitizeOAuthErrorMessage(error) {
120
- return (error instanceof Error ? error.message : String(error)).replace(/(access_token["'=:\s]+)[^"',\s&]+/gi, "$1[redacted]").replace(/(refresh_token["'=:\s]+)[^"',\s&]+/gi, "$1[redacted]").replace(/(client_secret["'=:\s]+)[^"',\s&]+/gi, "$1[redacted]");
121
- }
122
- async function buildOAuthDoctorReport(config, options) {
123
- const clientId = options.clientId?.trim() || config.oauth.clientId;
124
- const clientSecret = options.clientSecret?.trim() || config.oauth.clientSecret;
125
- const refreshToken = options.refreshToken?.trim() || config.oauth.refreshToken;
126
- const accessToken = options.accessToken?.trim() || config.oauth.accessToken;
127
- const expiresAt = parseOptionalNumber(options.expiresAt) ?? config.oauth.expiresAt;
128
- const checks = [];
129
- const hasRefreshConfig = Boolean(clientId && refreshToken);
130
- if (!hasRefreshConfig && !Boolean(accessToken)) {
131
- checks.push({
132
- id: "oauth-config",
133
- ok: false,
134
- message: "Missing Google Meet OAuth credentials. Configure oauth.clientId and oauth.refreshToken, or pass --client-id and --refresh-token."
135
- });
136
- return {
137
- ok: false,
138
- configured: false,
139
- checks
140
- };
141
- }
142
- checks.push({
143
- id: "oauth-config",
144
- ok: true,
145
- message: hasRefreshConfig ? "Google Meet OAuth refresh credentials are configured" : "Google Meet cached access token is configured"
146
- });
147
- let token;
148
- try {
149
- token = await resolveGoogleMeetAccessToken({
150
- clientId,
151
- clientSecret,
152
- refreshToken,
153
- accessToken,
154
- expiresAt
155
- });
156
- checks.push({
157
- id: "oauth-token",
158
- ok: true,
159
- message: token.refreshed ? "Refresh token minted an access token" : "Cached access token is still valid"
160
- });
161
- } catch (error) {
162
- checks.push({
163
- id: "oauth-token",
164
- ok: false,
165
- message: sanitizeOAuthErrorMessage(error)
166
- });
167
- return {
168
- ok: false,
169
- configured: true,
170
- checks
171
- };
172
- }
173
- const report = {
174
- ok: true,
175
- configured: true,
176
- tokenSource: token.refreshed ? "refresh-token" : "cached-access-token",
177
- expiresAt: token.expiresAt,
178
- checks
179
- };
180
- const meeting = options.meeting?.trim();
181
- if (meeting) try {
182
- const space = await fetchGoogleMeetSpace({
183
- accessToken: token.accessToken,
184
- meeting
185
- });
186
- checks.push({
187
- id: "meet-spaces-get",
188
- ok: true,
189
- message: `Resolved ${space.name}`
190
- });
191
- report.meetingUri = space.meetingUri;
192
- } catch (error) {
193
- checks.push({
194
- id: "meet-spaces-get",
195
- ok: false,
196
- message: sanitizeOAuthErrorMessage(error)
197
- });
198
- }
199
- if (options.createSpace) try {
200
- const created = await createGoogleMeetSpace({ accessToken: token.accessToken });
201
- checks.push({
202
- id: "meet-spaces-create",
203
- ok: true,
204
- message: `Created ${created.space.name}`
205
- });
206
- report.createdSpace = created.space.name;
207
- report.meetingUri = created.meetingUri;
208
- } catch (error) {
209
- checks.push({
210
- id: "meet-spaces-create",
211
- ok: false,
212
- message: sanitizeOAuthErrorMessage(error)
213
- });
214
- }
215
- report.ok = checks.every((check) => check.ok);
216
- return report;
217
- }
218
- function writeOAuthDoctorReport(report) {
219
- writeStdoutLine("Google Meet OAuth: %s", report.ok ? "OK" : "needs attention");
220
- writeStdoutLine("configured: %s", report.configured ? "yes" : "no");
221
- if (report.tokenSource) writeStdoutLine("token source: %s", report.tokenSource);
222
- if (report.meetingUri) writeStdoutLine("meeting uri: %s", report.meetingUri);
223
- for (const check of report.checks) writeStdoutLine("[%s] %s: %s", check.ok ? "ok" : "fail", check.id, check.message);
224
- }
225
- function registerGoogleMeetDoctorCommand(context) {
226
- const { root } = context;
227
- addGoogleMeetOAuthOptions(root.command("doctor").description("Show human-readable Meet session/browser/realtime health").argument("[session-id]", "Meet session ID").option("--oauth", "Verify Google Meet OAuth token refresh without printing secrets", false).option("--meeting <value>", "Also verify spaces.get for a Meet URL, code, or spaces/{id}").option("--create-space", "Also verify spaces.create by creating a throwaway Meet space", false)).option("--json", "Print JSON output", false).action(async (sessionId, options) => {
228
- if (options.oauth) {
229
- const report = await buildOAuthDoctorReport(context.config, options);
230
- if (options.json) {
231
- writeStdoutJson(report);
232
- return;
233
- }
234
- writeOAuthDoctorReport(report);
235
- return;
236
- }
237
- const status = await callGoogleMeetRuntime(context, "googlemeet.status", { sessionId }, (rt) => rt.status(sessionId));
238
- if (options.json) {
239
- writeStdoutJson(status);
240
- return;
241
- }
242
- writeDoctorStatus(status);
243
- });
244
- }
245
- //#endregion
246
- //#region extensions/google-meet/src/cli-runtime-commands.ts
247
- function registerGoogleMeetProbeCommands(context) {
248
- const { root, operationTimeoutMs } = context;
249
- root.command("join").argument("[url]", "Explicit https://meet.google.com/... URL").option("--transport <transport>", "Transport: chrome, chrome-node, or twilio").option("--mode <mode>", "Mode: agent, bidi, or transcribe").option("--message <text>", "Realtime speech to trigger after join").option("--dial-in-number <phone>", "Meet dial-in number for Twilio transport").option("--pin <pin>", "Meet phone PIN; # is appended if omitted").option("--dtmf-sequence <sequence>", "Explicit Twilio DTMF sequence").action(async (url, options) => {
250
- const payload = resolveCliJoinRequest(resolveCliMeetingInput(context.config, url), options);
251
- const result = await callGoogleMeetRuntime(context, "googlemeet.join", payload, (rt) => rt.join(payload), operationTimeoutMs);
252
- writeStdoutJson(result.session ?? result);
253
- });
254
- root.command("test-speech").argument("[url]", "Explicit https://meet.google.com/... URL").option("--transport <transport>", "Transport: chrome, chrome-node, or twilio").option("--mode <mode>", "Mode: agent, bidi, or transcribe").option("--message <text>", "Realtime speech to trigger", "Say exactly: Google Meet speech test complete.").action(async (url, options) => {
255
- const payload = {
256
- url: resolveCliMeetingInput(context.config, url),
257
- transport: parseGoogleMeetTransport(options.transport),
258
- mode: parseGoogleMeetMode(options.mode),
259
- message: options.message
260
- };
261
- writeStdoutJson(await callGoogleMeetRuntime(context, "googlemeet.testSpeech", payload, (rt) => rt.testSpeech(payload), operationTimeoutMs));
262
- });
263
- root.command("test-listen").argument("[url]", "Explicit https://meet.google.com/... URL").option("--transport <transport>", "Transport: chrome or chrome-node").option("--timeout-ms <ms>", "How long to wait for fresh captions/transcript movement").action(async (url, options) => {
264
- const payload = {
265
- url: resolveCliMeetingInput(context.config, url),
266
- transport: parseGoogleMeetBrowserTransport(options.transport),
267
- timeoutMs: parsePositiveNumber(options.timeoutMs, "timeout-ms")
268
- };
269
- writeStdoutJson(await callGoogleMeetRuntime(context, "googlemeet.testListen", payload, (rt) => rt.testListen(payload), operationTimeoutMs));
270
- });
271
- }
272
- function registerGoogleMeetSessionCommands(context) {
273
- const { root } = context;
274
- root.command("status").argument("[session-id]", "Meet session ID").option("--json", "Print JSON output", false).action(async (sessionId) => {
275
- writeStdoutJson(await callGoogleMeetRuntime(context, "googlemeet.status", { sessionId }, (rt) => rt.status(sessionId)));
276
- });
277
- root.command("transcript").description("Print the bounded caption transcript for a Meet session").argument("<session-id>", "Meet session ID").option("--since <index>", "Resume from the previous response's nextIndex").option("--json", "Print JSON output", false).action(async (sessionId, options) => {
278
- const sinceIndex = parseStrictNonNegativeInteger(options.since);
279
- if (options.since !== void 0 && sinceIndex === void 0) throw new Error("--since must be a non-negative safe integer");
280
- const result = await callGoogleMeetRuntime(context, "googlemeet.transcript", {
281
- sessionId,
282
- ...sinceIndex === void 0 ? {} : { sinceIndex }
283
- }, (rt) => rt.transcript(sessionId, sinceIndex === void 0 ? {} : { sinceIndex }));
284
- if (!result.found) throw new Error("session not found");
285
- if (options.json) {
286
- writeStdoutJson(result);
287
- return;
288
- }
289
- if (result.evicted) writeStdoutLine("# transcript evicted from runtime memory");
290
- else if (result.droppedLines) writeStdoutLine("# %d earlier lines dropped by the transcript cap", result.droppedLines);
291
- for (const line of result.lines ?? []) writeStdoutLine("%s%s%s", line.at ? `[${line.at}] ` : "", line.speaker ? `${line.speaker}: ` : "", line.text);
292
- writeStdoutLine("# nextIndex: %d", result.nextIndex ?? 0);
293
- });
294
- }
295
- function registerGoogleMeetLifecycleCommands(context) {
296
- const { root } = context;
297
- root.command("recover-tab").description("Focus and inspect an existing Google Meet tab").argument("[url]", "Optional Meet URL to match").option("--transport <transport>", "Transport to inspect: chrome or chrome-node").option("--json", "Print JSON output", false).action(async (url, options) => {
298
- const result = await (await context.ensureRuntime()).recoverCurrentTab({
299
- url,
300
- transport: parseGoogleMeetBrowserTransport(options.transport)
301
- });
302
- if (options.json) {
303
- writeStdoutJson(result);
304
- return;
305
- }
306
- writeRecoverCurrentTabResult(result);
307
- });
308
- root.command("setup").description("Show Google Meet transport setup status").option("--transport <transport>", "Transport to check: chrome, chrome-node, or twilio").option("--mode <mode>", "Mode to check: agent, bidi, or transcribe").option("--json", "Print JSON output", false).action(async (options) => {
309
- const status = await (await context.ensureRuntime()).setupStatus({
310
- transport: parseGoogleMeetTransport(options.transport),
311
- mode: parseGoogleMeetMode(options.mode)
312
- });
313
- if (options.json) writeStdoutJson(status);
314
- else writeSetupStatus(status);
315
- if (!status.ok) process.exitCode = 1;
316
- });
317
- root.command("leave").argument("<session-id>", "Meet session ID").action(async (sessionId) => {
318
- const result = await callGoogleMeetRuntime(context, "googlemeet.leave", { sessionId }, (rt) => rt.leave(sessionId));
319
- if (!result.found) throw new Error("session not found");
320
- writeLeaveResult(sessionId, result);
321
- });
322
- root.command("speak").argument("<session-id>", "Meet session ID").argument("[message]", "Realtime instructions to speak now").action(async (sessionId, message) => {
323
- const result = await callGoogleMeetRuntime(context, "googlemeet.speak", {
324
- sessionId,
325
- message
326
- }, (rt) => rt.speak(sessionId, message));
327
- if (!result.found) throw new Error("session not found");
328
- if (!result.spoken) throw new Error(result.session?.chrome?.health?.speechBlockedMessage ?? "session has no active realtime audio bridge");
329
- writeStdoutLine("speaking on %s", sessionId);
330
- });
331
- }
332
- //#endregion
333
- //#region extensions/google-meet/src/cli-space-commands.ts
42
+ // extensions/google-meet/src/cli-space-commands.ts
334
43
  function writeGoogleMeetCreateOutput(payload, json) {
335
44
  if (json) {
336
45
  writeStdoutJson(payload);
@@ -377,7 +86,7 @@ function registerGoogleMeetCreateCommands(context) {
377
86
  }
378
87
  };
379
88
  } else {
380
- const { token, source: _source, ...result } = await createSpaceFromParams(context.config, resolveCliParams(options));
89
+ const { token, source: _source, ...result } = await createSpaceFromParams(context.config, resolveCliParams(options), context.oauthRuntime);
381
90
  created = {
382
91
  ...result,
383
92
  tokenSource: token.refreshed ? "refresh-token" : "cached-access-token"
@@ -393,7 +102,7 @@ function registerGoogleMeetCreateCommands(context) {
393
102
  }, options.json);
394
103
  });
395
104
  addGoogleMeetOAuthOptions(root.command("end-active-conference").description("End the active conference for a Google Meet space").argument("[meeting]", "Meet URL, meeting code, or spaces/{id}")).option("--json", "Print JSON output", false).action(async (meeting, options) => {
396
- const token = await resolveGoogleMeetTokenFromParams(context.config, resolveCliParams(options));
105
+ const token = await resolveGoogleMeetTokenFromParams(context.config, resolveCliParams(options), context.oauthRuntime);
397
106
  const result = await endGoogleMeetActiveConference({
398
107
  accessToken: token.accessToken,
399
108
  meeting: resolveCliMeetingInput(context.config, meeting ?? options.meeting)
@@ -414,10 +123,7 @@ function registerGoogleMeetApiCommands(context) {
414
123
  const { root } = context;
415
124
  addGoogleMeetOAuthOptions(addGoogleMeetMeetingOption(root.command("resolve-space").description("Resolve a Meet URL, meeting code, or spaces/{id} to the matching space"))).option("--json", "Print JSON output", false).action(async (options) => {
416
125
  const meeting = resolveCliMeetingInput(context.config, options.meeting);
417
- const { space, token } = await resolveSpaceFromParams(context.config, {
418
- ...resolveCliParams(options),
419
- meeting
420
- });
126
+ const { space, token } = await resolveSpaceFromParams(context.config, resolveCliParams(options), context.oauthRuntime);
421
127
  if (options.json) {
422
128
  writeStdoutJson(space);
423
129
  return;
@@ -431,10 +137,7 @@ function registerGoogleMeetApiCommands(context) {
431
137
  });
432
138
  addGoogleMeetOAuthOptions(addGoogleMeetMeetingOption(root.command("preflight").description("Validate OAuth + meeting resolution prerequisites for Meet media work"))).option("--json", "Print JSON output", false).action(async (options) => {
433
139
  const meeting = resolveCliMeetingInput(context.config, options.meeting);
434
- const { space, token } = await resolveSpaceFromParams(context.config, {
435
- ...resolveCliParams(options),
436
- meeting
437
- });
140
+ const { space, token } = await resolveSpaceFromParams(context.config, resolveCliParams(options), context.oauthRuntime);
438
141
  const report = buildGoogleMeetPreflightReport({
439
142
  input: meeting,
440
143
  space,
@@ -461,7 +164,7 @@ function registerGoogleMeetApiCommands(context) {
461
164
  });
462
165
  addGoogleMeetOAuthOptions(addGoogleMeetCalendarOptions(addGoogleMeetMeetingOption(root.command("latest").description("Find the latest Meet conference record for a meeting")))).option("--json", "Print JSON output", false).action(async (options) => {
463
166
  const raw = resolveCliParams(options);
464
- const token = await resolveGoogleMeetTokenFromParams(context.config, raw);
167
+ const token = await resolveGoogleMeetTokenFromParams(context.config, raw, context.oauthRuntime);
465
168
  if (!options.today && !options.event?.trim()) {
466
169
  const meeting = options.meeting?.trim() || context.config.defaults.meeting;
467
170
  if (!meeting) throw new Error("Meeting input is required. Pass --meeting, --today, --event, or configure defaults.meeting.");
@@ -492,7 +195,7 @@ function registerGoogleMeetApiCommands(context) {
492
195
  writeStdoutLine("token source: %s", token.refreshed ? "refresh-token" : "cached-access-token");
493
196
  });
494
197
  addGoogleMeetOAuthOptions(root.command("calendar-events").description("Preview Calendar events with Google Meet links").option("--today", "Find Meet links on today's calendar").option("--event <query>", "Find matching calendar events with Meet links").option("--calendar <id>", "Calendar id for lookup", "primary")).option("--json", "Print JSON output", false).action(async (options) => {
495
- const token = await resolveGoogleMeetTokenFromParams(context.config, resolveCliParams(options));
198
+ const token = await resolveGoogleMeetTokenFromParams(context.config, resolveCliParams(options), context.oauthRuntime);
496
199
  const window = options.today ? buildGoogleMeetCalendarDayWindow() : {};
497
200
  const result = await listGoogleMeetCalendarEvents({
498
201
  accessToken: token.accessToken,
@@ -512,8 +215,124 @@ function registerGoogleMeetApiCommands(context) {
512
215
  writeStdoutLine("token source: %s", token.refreshed ? "refresh-token" : "cached-access-token");
513
216
  });
514
217
  }
515
- //#endregion
516
- //#region extensions/google-meet/src/cli.ts
218
+ // extensions/google-meet/src/cli.ts
219
+ function sanitizeOAuthErrorMessage(error) {
220
+ return (error instanceof Error ? error.message : String(error)).replace(/(access_token["'=:\s]+)[^"',\s&]+/gi, "$1[redacted]").replace(/(refresh_token["'=:\s]+)[^"',\s&]+/gi, "$1[redacted]").replace(/(client_secret["'=:\s]+)[^"',\s&]+/gi, "$1[redacted]");
221
+ }
222
+ async function buildOAuthDoctorReport(config, options, runtime) {
223
+ const clientId = options.clientId?.trim() || config.oauth.clientId;
224
+ const clientSecret = options.clientSecret?.trim() || config.oauth.clientSecret;
225
+ const refreshToken = options.refreshToken?.trim() || config.oauth.refreshToken;
226
+ const accessToken = options.accessToken?.trim() || config.oauth.accessToken;
227
+ const expiresAt = parseOptionalNumber(options.expiresAt) ?? config.oauth.expiresAt;
228
+ const checks = [];
229
+ const recordFailure = (id, error) => {
230
+ checks.push({
231
+ id,
232
+ ok: false,
233
+ message: sanitizeOAuthErrorMessage(error)
234
+ });
235
+ };
236
+ const hasRefreshConfig = Boolean(clientId && refreshToken);
237
+ if (!hasRefreshConfig && !Boolean(accessToken)) {
238
+ checks.push({
239
+ id: "oauth-config",
240
+ ok: false,
241
+ message: "Missing Google Meet OAuth credentials. Configure oauth.clientId and oauth.refreshToken, or pass --client-id and --refresh-token."
242
+ });
243
+ return {
244
+ ok: false,
245
+ configured: false,
246
+ checks
247
+ };
248
+ }
249
+ checks.push({
250
+ id: "oauth-config",
251
+ ok: true,
252
+ message: hasRefreshConfig ? "Google Meet OAuth refresh credentials are configured" : "Google Meet cached access token is configured"
253
+ });
254
+ let token;
255
+ try {
256
+ token = await resolveGoogleMeetTokenFromParams(config, {
257
+ clientId,
258
+ clientSecret,
259
+ refreshToken,
260
+ accessToken,
261
+ expiresAt
262
+ }, runtime);
263
+ checks.push({
264
+ id: "oauth-token",
265
+ ok: true,
266
+ message: token.refreshed ? "Refresh token minted an access token" : "Cached access token is still valid"
267
+ });
268
+ } catch (error) {
269
+ recordFailure("oauth-token", error);
270
+ return {
271
+ ok: false,
272
+ configured: true,
273
+ checks
274
+ };
275
+ }
276
+ const report = {
277
+ ok: true,
278
+ configured: true,
279
+ tokenSource: token.refreshed ? "refresh-token" : "cached-access-token",
280
+ expiresAt: token.expiresAt,
281
+ checks
282
+ };
283
+ const meeting = options.meeting?.trim();
284
+ if (meeting) try {
285
+ const space = await fetchGoogleMeetSpace({
286
+ accessToken: token.accessToken,
287
+ meeting
288
+ });
289
+ checks.push({
290
+ id: "meet-spaces-get",
291
+ ok: true,
292
+ message: `Resolved ${space.name}`
293
+ });
294
+ report.meetingUri = space.meetingUri;
295
+ } catch (error) {
296
+ recordFailure("meet-spaces-get", error);
297
+ }
298
+ if (options.createSpace) try {
299
+ const created = await createGoogleMeetSpace({ accessToken: token.accessToken });
300
+ checks.push({
301
+ id: "meet-spaces-create",
302
+ ok: true,
303
+ message: `Created ${created.space.name}`
304
+ });
305
+ report.createdSpace = created.space.name;
306
+ report.meetingUri = created.meetingUri;
307
+ } catch (error) {
308
+ recordFailure("meet-spaces-create", error);
309
+ }
310
+ report.ok = checks.every((check) => check.ok);
311
+ return report;
312
+ }
313
+ function writeOAuthDoctorReport(report) {
314
+ writeStdoutLine("Google Meet OAuth: %s", report.ok ? "OK" : "needs attention");
315
+ writeStdoutLine("configured: %s", report.configured ? "yes" : "no");
316
+ if (report.tokenSource) writeStdoutLine("token source: %s", report.tokenSource);
317
+ if (report.meetingUri) writeStdoutLine("meeting uri: %s", report.meetingUri);
318
+ for (const check of report.checks) writeStdoutLine("[%s] %s: %s", check.ok ? "ok" : "fail", check.id, check.message);
319
+ }
320
+ function resolveTokenSource(refreshed) {
321
+ return refreshed ? "refresh-token" : "cached-access-token";
322
+ }
323
+ async function writeArtifactOutput(options, result, refreshed, render, csv) {
324
+ const tokenSource = resolveTokenSource(refreshed);
325
+ let text;
326
+ if (options.json) text = JSON.stringify({
327
+ ...result,
328
+ tokenSource
329
+ }, null, 2);
330
+ else if (options.format === "markdown") text = render(result, "markdown");
331
+ else if (options.format === "csv" && csv) text = csv(result);
332
+ else if (!options.format || options.format === "summary") text = `${render(result, "summary")}token source: ${tokenSource}\n`;
333
+ else throw new Error(csv ? "Unsupported format. Expected summary, markdown, or csv." : "Unsupported format. Expected summary or markdown.");
334
+ await writeCliOutput(options, text);
335
+ }
517
336
  function registerGoogleMeetCli(params) {
518
337
  const operationTimeoutMs = resolveGoogleMeetGatewayOperationTimeoutMs(params.config);
519
338
  const root = params.program.command("googlemeet").description("Google Meet participant utilities").addHelpText("after", () => `\nDocs: https://docs.openclaw.ai/plugins/google-meet\n`);
@@ -561,15 +380,156 @@ function registerGoogleMeetCli(params) {
561
380
  root,
562
381
  config: params.config,
563
382
  ensureRuntime: params.ensureRuntime,
564
- operationTimeoutMs
383
+ operationTimeoutMs,
384
+ oauthRuntime: params.oauthRuntime
565
385
  };
566
386
  registerGoogleMeetCreateCommands(context);
567
- registerGoogleMeetProbeCommands(context);
387
+ root.command("join").argument("[url]", "Explicit https://meet.google.com/... URL").option("--transport <transport>", "Transport: chrome, chrome-node, or twilio").option("--mode <mode>", "Mode: agent, bidi, or transcribe").option("--message <text>", "Realtime speech to trigger after join").option("--dial-in-number <phone>", "Meet dial-in number for Twilio transport").option("--pin <pin>", "Meet phone PIN; # is appended if omitted").option("--dtmf-sequence <sequence>", "Explicit Twilio DTMF sequence").action(async (url, options) => {
388
+ const payload = resolveCliJoinRequest(resolveCliMeetingInput(context.config, url), options);
389
+ const result = await callGoogleMeetRuntime(context, "googlemeet.join", payload, (rt) => rt.join(payload), operationTimeoutMs);
390
+ writeStdoutJson(result.session ?? result);
391
+ });
392
+ root.command("test-speech").argument("[url]", "Explicit https://meet.google.com/... URL").option("--transport <transport>", "Transport: chrome, chrome-node, or twilio").option("--mode <mode>", "Mode: agent, bidi, or transcribe").option("--message <text>", "Realtime speech to trigger", "Say exactly: Google Meet speech test complete.").action(async (url, options) => {
393
+ const payload = {
394
+ url: resolveCliMeetingInput(context.config, url),
395
+ transport: parseGoogleMeetTransport(options.transport),
396
+ mode: parseGoogleMeetMode(options.mode),
397
+ message: options.message
398
+ };
399
+ writeStdoutJson(await callGoogleMeetRuntime(context, "googlemeet.testSpeech", payload, (rt) => rt.testSpeech(payload), operationTimeoutMs));
400
+ });
401
+ root.command("test-listen").argument("[url]", "Explicit https://meet.google.com/... URL").option("--transport <transport>", "Transport: chrome or chrome-node").option("--timeout-ms <ms>", "How long to wait for fresh captions/transcript movement").action(async (url, options) => {
402
+ const payload = {
403
+ url: resolveCliMeetingInput(context.config, url),
404
+ transport: parseGoogleMeetBrowserTransport(options.transport),
405
+ timeoutMs: parsePositiveNumber(options.timeoutMs, "timeout-ms")
406
+ };
407
+ writeStdoutJson(await callGoogleMeetRuntime(context, "googlemeet.testListen", payload, (rt) => rt.testListen(payload), operationTimeoutMs));
408
+ });
568
409
  registerGoogleMeetApiCommands(context);
569
- registerGoogleMeetArtifactCommands(context);
570
- registerGoogleMeetSessionCommands(context);
571
- registerGoogleMeetDoctorCommand(context);
572
- registerGoogleMeetLifecycleCommands(context);
410
+ async function resolveCliArtifactQuery(options) {
411
+ const meeting = options.meeting?.trim() || context.config.defaults.meeting;
412
+ const conferenceRecord = options.conferenceRecord?.trim();
413
+ if (!meeting && !conferenceRecord && !(options.today || options.event?.trim())) throw new Error("Meeting input or conference record is required. Pass --meeting, --today, --event, --conference-record, or configure defaults.meeting.");
414
+ const { lateAfterMinutes: late, earlyBeforeMinutes: early, ...queryOptions } = options;
415
+ const raw = {
416
+ ...resolveCliParams(queryOptions),
417
+ meeting,
418
+ conferenceRecord,
419
+ pageSize: parsePositiveIntegerOption(options.pageSize, "page-size"),
420
+ includeTranscriptEntries: options.transcriptEntries,
421
+ includeAllConferenceRecords: options.allConferenceRecords,
422
+ includeDocumentBodies: options.includeDocBodies,
423
+ mergeDuplicateParticipants: options.mergeDuplicates
424
+ };
425
+ const lateAfterMinutes = parseOptionalNumber(late);
426
+ const earlyBeforeMinutes = parseOptionalNumber(early);
427
+ return {
428
+ ...await resolveArtifactQueryFromParams(context.config, raw, context.oauthRuntime),
429
+ lateAfterMinutes,
430
+ earlyBeforeMinutes
431
+ };
432
+ }
433
+ addGoogleMeetArtifactOptions(root.command("artifacts").description("List Meet conference records and available participant/artifact metadata")).option("--no-transcript-entries", "Skip structured transcript entry lookup").option("--include-doc-bodies", "Export linked transcript and smart-note Google Docs text").option("--format <format>", "Output format: summary or markdown", "summary").option("--output <path>", "Write output to a file instead of stdout").option("--json", "Print JSON output", false).action(async (options) => {
434
+ const resolved = await resolveCliArtifactQuery(options);
435
+ await writeArtifactOutput(options, await fetchResolvedGoogleMeetArtifacts(resolved), resolved.token.refreshed, renderArtifacts);
436
+ });
437
+ addGoogleMeetArtifactOptions(root.command("attendance").description("List Meet participants and participant sessions")).option("--no-merge-duplicates", "Keep duplicate participant resources as separate rows").option("--late-after-minutes <n>", "Mark participants late after this many minutes", "5").option("--early-before-minutes <n>", "Mark early leavers before this many minutes", "5").option("--format <format>", "Output format: summary, markdown, or csv", "summary").option("--output <path>", "Write output to a file instead of stdout").option("--json", "Print JSON output", false).action(async (options) => {
438
+ const resolved = await resolveCliArtifactQuery(options);
439
+ await writeArtifactOutput(options, await fetchResolvedGoogleMeetAttendance(resolved), resolved.token.refreshed, renderAttendance, renderAttendanceCsv);
440
+ });
441
+ addGoogleMeetArtifactOptions(root.command("export").description("Write Meet artifacts, attendance, transcript, and raw JSON into a folder")).option("--no-transcript-entries", "Skip structured transcript entry lookup").option("--include-doc-bodies", "Export linked transcript and smart-note Google Docs text").option("--no-merge-duplicates", "Keep duplicate participant resources as separate rows").option("--late-after-minutes <n>", "Mark participants late after this many minutes", "5").option("--early-before-minutes <n>", "Mark early leavers before this many minutes", "5").option("--output <dir>", "Output directory").option("--zip", "Also write a portable .zip archive").option("--dry-run", "Fetch export data and print the manifest without writing files", false).option("--json", "Print JSON output", false).action(async (options) => {
442
+ const resolved = await resolveCliArtifactQuery(options);
443
+ const artifacts = await fetchResolvedGoogleMeetArtifacts(resolved);
444
+ const attendance = await fetchResolvedGoogleMeetAttendance(resolved);
445
+ const payload = await exportGoogleMeetBundle({
446
+ outputDir: options.output,
447
+ artifacts,
448
+ attendance,
449
+ zip: Boolean(options.zip),
450
+ dryRun: options.dryRun,
451
+ request: buildGoogleMeetExportRequest(resolved, options.calendar),
452
+ tokenSource: resolveTokenSource(resolved.token.refreshed),
453
+ calendarEvent: resolved.calendarEvent
454
+ });
455
+ if (options.json || "dryRun" in payload) {
456
+ writeStdoutJson(payload);
457
+ return;
458
+ }
459
+ writeStdoutLine("export: %s", payload.outputDir);
460
+ for (const file of payload.files) writeStdoutLine("- %s", file);
461
+ if (payload.zipFile) writeStdoutLine("zip: %s", payload.zipFile);
462
+ });
463
+ root.command("status").argument("[session-id]", "Meet session ID").option("--json", "Print JSON output", false).action(async (sessionId) => {
464
+ writeStdoutJson(await callGoogleMeetRuntime(context, "googlemeet.status", { sessionId }, (rt) => rt.status(sessionId)));
465
+ });
466
+ root.command("transcript").description("Print the bounded caption transcript for a Meet session").argument("<session-id>", "Meet session ID").option("--since <index>", "Resume from the previous response's nextIndex").option("--json", "Print JSON output", false).action(async (sessionId, options) => {
467
+ const sinceIndex = parseStrictNonNegativeInteger(options.since);
468
+ if (options.since !== void 0 && sinceIndex === void 0) throw new Error("--since must be a non-negative safe integer");
469
+ const result = await callGoogleMeetRuntime(context, "googlemeet.transcript", {
470
+ sessionId,
471
+ ...sinceIndex === void 0 ? {} : { sinceIndex }
472
+ }, (rt) => rt.transcript(sessionId, sinceIndex === void 0 ? {} : { sinceIndex }));
473
+ if (!result.found) throw new Error("session not found");
474
+ if (options.json) {
475
+ writeStdoutJson(result);
476
+ return;
477
+ }
478
+ if (result.evicted) writeStdoutLine("# transcript evicted from runtime memory");
479
+ else if (result.droppedLines) writeStdoutLine("# %d earlier lines dropped by the transcript cap", result.droppedLines);
480
+ for (const line of result.lines ?? []) writeStdoutLine("%s%s%s", line.at ? `[${line.at}] ` : "", line.speaker ? `${line.speaker}: ` : "", line.text);
481
+ writeStdoutLine("# nextIndex: %d", result.nextIndex ?? 0);
482
+ });
483
+ addGoogleMeetOAuthOptions(root.command("doctor").description("Show human-readable Meet session/browser/realtime health").argument("[session-id]", "Meet session ID").option("--oauth", "Verify Google Meet OAuth token refresh without printing secrets", false).option("--meeting <value>", "Also verify spaces.get for a Meet URL, code, or spaces/{id}").option("--create-space", "Also verify spaces.create by creating a throwaway Meet space", false)).option("--json", "Print JSON output", false).action(async (sessionId, options) => {
484
+ if (options.oauth) {
485
+ const report = await buildOAuthDoctorReport(context.config, options, context.oauthRuntime);
486
+ if (options.json) {
487
+ writeStdoutJson(report);
488
+ return;
489
+ }
490
+ writeOAuthDoctorReport(report);
491
+ return;
492
+ }
493
+ const status = await callGoogleMeetRuntime(context, "googlemeet.status", { sessionId }, (rt) => rt.status(sessionId));
494
+ if (options.json) {
495
+ writeStdoutJson(status);
496
+ return;
497
+ }
498
+ writeDoctorStatus(status);
499
+ });
500
+ root.command("recover-tab").description("Focus and inspect an existing Google Meet tab").argument("[url]", "Optional Meet URL to match").option("--transport <transport>", "Transport to inspect: chrome or chrome-node").option("--json", "Print JSON output", false).action(async (url, options) => {
501
+ const result = await (await context.ensureRuntime()).recoverCurrentTab({
502
+ url,
503
+ transport: parseGoogleMeetBrowserTransport(options.transport)
504
+ });
505
+ if (options.json) {
506
+ writeStdoutJson(result);
507
+ return;
508
+ }
509
+ writeRecoverCurrentTabResult(result);
510
+ });
511
+ root.command("setup").description("Show Google Meet transport setup status").option("--transport <transport>", "Transport to check: chrome, chrome-node, or twilio").option("--mode <mode>", "Mode to check: agent, bidi, or transcribe").option("--json", "Print JSON output", false).action(async (options) => {
512
+ const status = await (await context.ensureRuntime()).setupStatus({
513
+ transport: parseGoogleMeetTransport(options.transport),
514
+ mode: parseGoogleMeetMode(options.mode)
515
+ });
516
+ if (options.json) writeStdoutJson(status);
517
+ else writeSetupStatus(status);
518
+ if (!status.ok) process.exitCode = 1;
519
+ });
520
+ root.command("leave").argument("<session-id>", "Meet session ID").action(async (sessionId) => {
521
+ const result = await callGoogleMeetRuntime(context, "googlemeet.leave", { sessionId }, (rt) => rt.leave(sessionId));
522
+ if (!result.found) throw new Error("session not found");
523
+ writeLeaveResult(sessionId, result);
524
+ });
525
+ root.command("speak").argument("<session-id>", "Meet session ID").argument("[message]", "Realtime instructions to speak now").action(async (sessionId, message) => {
526
+ const result = await callGoogleMeetRuntime(context, "googlemeet.speak", {
527
+ sessionId,
528
+ message
529
+ }, (rt) => rt.speak(sessionId, message));
530
+ if (!result.found) throw new Error("session not found");
531
+ if (!result.spoken) throw new Error(result.session?.chrome?.health?.speechBlockedMessage ?? "session has no active realtime audio bridge");
532
+ writeStdoutLine("speaking on %s", sessionId);
533
+ });
573
534
  }
574
- //#endregion
575
535
  export { registerGoogleMeetCli };