@openclaw/google-meet 2026.9.5 → 2026.9.7
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/assets/icon.png +0 -0
- package/dist/.setup/{chrome-create-BZRBHJp9.mjs → chrome-create-wuAK5Pnq.mjs} +14 -19
- package/dist/.setup/{cli-MJjnaxoP.mjs → cli-DVDq0TFu.mjs} +27 -695
- package/dist/.setup/cli-export-D4IM6KLJ.mjs +632 -0
- package/dist/.setup/config-BXGAMntj.mjs +240 -0
- package/dist/.setup/{create-sGWmlpgC.mjs → create-UrHOmnWb.mjs} +4 -17
- package/dist/.setup/{google-meet-platform-adapter-DQZ74Kd5.mjs → google-meet-platform-adapter-gosgbMIM.mjs} +337 -228
- package/dist/.setup/{google-meet-platform-constants-Bs5iAg3E.mjs → google-meet-platform-constants-CnRfrYX7.mjs} +1 -4
- package/dist/.setup/{node-host-BOzEP_Us.mjs → node-host-Tr7Mx3da.mjs} +4 -7
- package/dist/.setup/{node-invoke-policy-hwXq9MfV.mjs → node-invoke-policy-Dd3krTYV.mjs} +2 -2
- package/dist/.setup/{oauth-22Ey-zCb.mjs → oauth-BoyruWcS.mjs} +2 -2
- package/dist/.setup/{plugin-helpers-rGjL9QFK.mjs → plugin-helpers-CdQ_YNA7.mjs} +147 -236
- package/dist/.setup/{plugin-registration-CfZbUMDY.mjs → plugin-registration-aCEuCerg.mjs} +59 -16
- package/dist/.setup/{runtime-D_C0dFI1.mjs → runtime-BdiF53A2.mjs} +89 -41
- package/dist/doctor-contract-api.js +3 -6
- package/dist/index.js +54 -13
- package/node_modules/typebox/build/compile/code.mjs +1 -2
- package/node_modules/typebox/build/compile/validator.mjs +5 -1
- package/node_modules/typebox/build/format/iri.mjs +16 -9
- package/node_modules/typebox/build/guard/emit.mjs +2 -2
- package/node_modules/typebox/build/guard/guard.d.mts +7 -5
- package/node_modules/typebox/build/guard/guard.mjs +14 -9
- package/node_modules/typebox/build/guard/index.mjs +6 -0
- package/node_modules/typebox/build/guard/unicode/unicode.d.mts +6 -0
- package/node_modules/typebox/build/guard/unicode/unicode.mjs +35 -0
- package/node_modules/typebox/build/guard/{string.mjs → unicode/unicode_segment.mjs} +16 -19
- package/node_modules/typebox/build/schema/build.mjs +2 -3
- package/node_modules/typebox/build/schema/engine/_pathing.d.mts +1 -0
- package/node_modules/typebox/build/schema/engine/_pathing.mjs +11 -0
- package/node_modules/typebox/build/schema/engine/_refine.mjs +13 -5
- package/node_modules/typebox/build/schema/engine/additionalProperties.mjs +2 -1
- package/node_modules/typebox/build/schema/engine/dependencies.mjs +2 -1
- package/node_modules/typebox/build/schema/engine/dependentSchemas.mjs +2 -1
- package/node_modules/typebox/build/schema/engine/dynamicRef.d.mts +1 -1
- package/node_modules/typebox/build/schema/engine/dynamicRef.mjs +2 -2
- package/node_modules/typebox/build/schema/engine/format.mjs +9 -2
- package/node_modules/typebox/build/schema/engine/patternProperties.mjs +3 -2
- package/node_modules/typebox/build/schema/engine/properties.mjs +3 -2
- package/node_modules/typebox/build/schema/engine/propertyNames.mjs +2 -1
- package/node_modules/typebox/build/schema/engine/recursiveRef.d.mts +1 -1
- package/node_modules/typebox/build/schema/engine/recursiveRef.mjs +2 -2
- package/node_modules/typebox/build/schema/engine/ref.d.mts +1 -1
- package/node_modules/typebox/build/schema/engine/ref.mjs +2 -2
- package/node_modules/typebox/build/schema/engine/schema.mjs +24 -24
- package/node_modules/typebox/build/schema/parse.mjs +3 -0
- package/node_modules/typebox/build/schema/pointer/pointer.d.mts +1 -6
- package/node_modules/typebox/build/schema/pointer/pointer.mjs +47 -64
- package/node_modules/typebox/build/system/settings/internal.d.mts +2 -0
- package/node_modules/typebox/build/system/settings/internal.mjs +20 -0
- package/node_modules/typebox/build/system/settings/settings.d.mts +11 -0
- package/node_modules/typebox/build/system/settings/settings.mjs +14 -0
- package/node_modules/typebox/build/type/extends/inference.d.mts +1 -1
- package/node_modules/typebox/build/type/extends/inference.mjs +15 -2
- package/node_modules/typebox/build/type/extends/tuple.d.mts +2 -1
- package/node_modules/typebox/build/type/extends/tuple.mjs +21 -1
- package/node_modules/typebox/build/value/parse/parse.mjs +10 -4
- package/node_modules/typebox/package.json +1 -1
- package/node_modules/typebox/readme.md +3 -1
- package/package.json +5 -5
- package/dist/.setup/config-C-6enWkx.mjs +0 -328
- package/dist/.setup/google-api-errors-BDYXfKRa.mjs +0 -17
- /package/node_modules/typebox/build/guard/{string.d.mts → unicode/unicode_segment.d.mts} +0 -0
|
@@ -1,328 +0,0 @@
|
|
|
1
|
-
import { asBoolean, asRecord, normalizeOptionalLowercaseString, normalizeOptionalString, normalizeOptionalTrimmedStringList, parseBooleanValue } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
2
|
-
import { addTimerTimeoutGraceMs, resolvePositiveTimerTimeoutMs } from "openclaw/plugin-sdk/number-runtime";
|
|
3
|
-
import { REALTIME_VOICE_AGENT_CONSULT_TOOL_NAME, resolveRealtimeVoiceAgentConsultToolPolicy } from "openclaw/plugin-sdk/realtime-voice";
|
|
4
|
-
//#region extensions/google-meet/src/config.ts
|
|
5
|
-
function resolveGoogleMeetGatewayOperationTimeoutMs(config) {
|
|
6
|
-
return Math.max(6e4, addTimerTimeoutGraceMs(config.chrome.joinTimeoutMs, 3e4) ?? 1, addTimerTimeoutGraceMs(config.voiceCall.requestTimeoutMs, 1e4) ?? 1);
|
|
7
|
-
}
|
|
8
|
-
const SOX_DEFAULT_BUFFER_BYTES = 8192;
|
|
9
|
-
const SOX_MIN_BUFFER_BYTES = 17;
|
|
10
|
-
const DEFAULT_GOOGLE_MEET_AUDIO_BUFFER_BYTES = SOX_DEFAULT_BUFFER_BYTES / 2;
|
|
11
|
-
const PLAIN_DECIMAL_NUMBER_RE = /^\d+(?:\.\d+)?$/;
|
|
12
|
-
function buildGoogleMeetAudioCommands(backend, format, bufferBytes) {
|
|
13
|
-
const pipeWire = backend === "pipewire-pulse" || backend === "auto" && process.platform === "linux";
|
|
14
|
-
const sampleRate = format === "g711-ulaw-8khz" ? 8e3 : 24e3;
|
|
15
|
-
const bits = format === "g711-ulaw-8khz" ? 8 : 16;
|
|
16
|
-
if (pipeWire) {
|
|
17
|
-
const pulseFormat = format === "g711-ulaw-8khz" ? "ulaw" : "s16le";
|
|
18
|
-
const latencyMs = Math.max(1, Math.ceil(bufferBytes / (sampleRate * Math.ceil(bits / 8)) * 1e3));
|
|
19
|
-
const common = [
|
|
20
|
-
"--device=openclaw_meeting_audio",
|
|
21
|
-
`--format=${pulseFormat}`,
|
|
22
|
-
`--rate=${sampleRate}`,
|
|
23
|
-
"--channels=1",
|
|
24
|
-
`--latency-msec=${latencyMs}`
|
|
25
|
-
];
|
|
26
|
-
return {
|
|
27
|
-
inputCommand: [
|
|
28
|
-
"parec",
|
|
29
|
-
"--raw",
|
|
30
|
-
...common
|
|
31
|
-
],
|
|
32
|
-
outputCommand: [
|
|
33
|
-
"pacat",
|
|
34
|
-
"--raw",
|
|
35
|
-
"--playback",
|
|
36
|
-
...common
|
|
37
|
-
]
|
|
38
|
-
};
|
|
39
|
-
}
|
|
40
|
-
const wire = format === "g711-ulaw-8khz" ? [
|
|
41
|
-
"-t",
|
|
42
|
-
"raw",
|
|
43
|
-
"-r",
|
|
44
|
-
"8000",
|
|
45
|
-
"-c",
|
|
46
|
-
"1",
|
|
47
|
-
"-e",
|
|
48
|
-
"mu-law",
|
|
49
|
-
"-b",
|
|
50
|
-
"8",
|
|
51
|
-
"-"
|
|
52
|
-
] : [
|
|
53
|
-
"-t",
|
|
54
|
-
"raw",
|
|
55
|
-
"-r",
|
|
56
|
-
"24000",
|
|
57
|
-
"-c",
|
|
58
|
-
"1",
|
|
59
|
-
"-e",
|
|
60
|
-
"signed-integer",
|
|
61
|
-
"-b",
|
|
62
|
-
"16",
|
|
63
|
-
"-L",
|
|
64
|
-
"-"
|
|
65
|
-
];
|
|
66
|
-
const withBuffer = (executable, args) => [
|
|
67
|
-
executable,
|
|
68
|
-
"-q",
|
|
69
|
-
"--buffer",
|
|
70
|
-
String(bufferBytes),
|
|
71
|
-
...args
|
|
72
|
-
];
|
|
73
|
-
return {
|
|
74
|
-
inputCommand: withBuffer("sox", [
|
|
75
|
-
"-t",
|
|
76
|
-
"coreaudio",
|
|
77
|
-
"BlackHole 2ch",
|
|
78
|
-
...wire
|
|
79
|
-
]),
|
|
80
|
-
outputCommand: withBuffer("sox", [
|
|
81
|
-
...wire,
|
|
82
|
-
"-t",
|
|
83
|
-
"coreaudio",
|
|
84
|
-
"BlackHole 2ch"
|
|
85
|
-
])
|
|
86
|
-
};
|
|
87
|
-
}
|
|
88
|
-
const DEFAULT_GOOGLE_MEET_AUDIO_COMMANDS = buildGoogleMeetAudioCommands("blackhole-2ch", "pcm16-24khz", DEFAULT_GOOGLE_MEET_AUDIO_BUFFER_BYTES);
|
|
89
|
-
const DEFAULT_GOOGLE_MEET_AUDIO_INPUT_COMMAND = DEFAULT_GOOGLE_MEET_AUDIO_COMMANDS.inputCommand;
|
|
90
|
-
const DEFAULT_GOOGLE_MEET_AUDIO_OUTPUT_COMMAND = DEFAULT_GOOGLE_MEET_AUDIO_COMMANDS.outputCommand;
|
|
91
|
-
const DEFAULT_GOOGLE_MEET_CHROME_AUDIO_FORMAT = "pcm16-24khz";
|
|
92
|
-
const DEFAULT_GOOGLE_MEET_BARGE_IN_RMS_THRESHOLD = 650;
|
|
93
|
-
const DEFAULT_GOOGLE_MEET_BARGE_IN_PEAK_THRESHOLD = 2500;
|
|
94
|
-
const DEFAULT_GOOGLE_MEET_BARGE_IN_COOLDOWN_MS = 900;
|
|
95
|
-
const DEFAULT_GOOGLE_MEET_REALTIME_MODEL = void 0;
|
|
96
|
-
const DEFAULT_GOOGLE_MEET_REALTIME_INSTRUCTIONS = `You are joining a private Google Meet as an OpenClaw voice transport. Keep spoken replies brief and natural. In agent mode, wait for OpenClaw consult results and speak them exactly. In bidi mode, answer directly and call ${REALTIME_VOICE_AGENT_CONSULT_TOOL_NAME} for deeper reasoning, current information, or tools.`;
|
|
97
|
-
const DEFAULT_GOOGLE_MEET_REALTIME_INTRO_MESSAGE = "Say exactly: I'm here and listening.";
|
|
98
|
-
const DEFAULT_GOOGLE_MEET_CONFIG = {
|
|
99
|
-
enabled: true,
|
|
100
|
-
defaults: {},
|
|
101
|
-
preview: { enrollmentAcknowledged: false },
|
|
102
|
-
defaultTransport: "chrome",
|
|
103
|
-
defaultMode: "agent",
|
|
104
|
-
chrome: {
|
|
105
|
-
audioBackend: "auto",
|
|
106
|
-
audioFormat: DEFAULT_GOOGLE_MEET_CHROME_AUDIO_FORMAT,
|
|
107
|
-
audioBufferBytes: DEFAULT_GOOGLE_MEET_AUDIO_BUFFER_BYTES,
|
|
108
|
-
launch: true,
|
|
109
|
-
guestName: "OpenClaw Agent",
|
|
110
|
-
reuseExistingTab: true,
|
|
111
|
-
autoJoin: true,
|
|
112
|
-
joinTimeoutMs: 3e4,
|
|
113
|
-
waitForInCallMs: 2e4,
|
|
114
|
-
audioInputCommand: [...DEFAULT_GOOGLE_MEET_AUDIO_INPUT_COMMAND],
|
|
115
|
-
audioOutputCommand: [...DEFAULT_GOOGLE_MEET_AUDIO_OUTPUT_COMMAND],
|
|
116
|
-
bargeInRmsThreshold: DEFAULT_GOOGLE_MEET_BARGE_IN_RMS_THRESHOLD,
|
|
117
|
-
bargeInPeakThreshold: DEFAULT_GOOGLE_MEET_BARGE_IN_PEAK_THRESHOLD,
|
|
118
|
-
bargeInCooldownMs: DEFAULT_GOOGLE_MEET_BARGE_IN_COOLDOWN_MS
|
|
119
|
-
},
|
|
120
|
-
chromeNode: {},
|
|
121
|
-
twilio: {},
|
|
122
|
-
voiceCall: {
|
|
123
|
-
enabled: true,
|
|
124
|
-
requestTimeoutMs: 3e4,
|
|
125
|
-
dtmfDelayMs: 12e3,
|
|
126
|
-
postDtmfSpeechDelayMs: 5e3
|
|
127
|
-
},
|
|
128
|
-
realtime: {
|
|
129
|
-
strategy: "agent",
|
|
130
|
-
provider: "openai",
|
|
131
|
-
transcriptionProvider: "openai",
|
|
132
|
-
model: DEFAULT_GOOGLE_MEET_REALTIME_MODEL,
|
|
133
|
-
instructions: DEFAULT_GOOGLE_MEET_REALTIME_INSTRUCTIONS,
|
|
134
|
-
introMessage: DEFAULT_GOOGLE_MEET_REALTIME_INTRO_MESSAGE,
|
|
135
|
-
toolPolicy: "safe-read-only",
|
|
136
|
-
providers: {}
|
|
137
|
-
},
|
|
138
|
-
oauth: {},
|
|
139
|
-
auth: { provider: "google-oauth" }
|
|
140
|
-
};
|
|
141
|
-
const GOOGLE_MEET_CLIENT_ID_KEYS = ["OPENCLAW_GOOGLE_MEET_CLIENT_ID", "GOOGLE_MEET_CLIENT_ID"];
|
|
142
|
-
const GOOGLE_MEET_CLIENT_SECRET_KEYS = ["OPENCLAW_GOOGLE_MEET_CLIENT_SECRET", "GOOGLE_MEET_CLIENT_SECRET"];
|
|
143
|
-
const GOOGLE_MEET_REFRESH_TOKEN_KEYS = ["OPENCLAW_GOOGLE_MEET_REFRESH_TOKEN", "GOOGLE_MEET_REFRESH_TOKEN"];
|
|
144
|
-
const GOOGLE_MEET_ACCESS_TOKEN_KEYS = ["OPENCLAW_GOOGLE_MEET_ACCESS_TOKEN", "GOOGLE_MEET_ACCESS_TOKEN"];
|
|
145
|
-
const GOOGLE_MEET_ACCESS_TOKEN_EXPIRES_AT_KEYS = ["OPENCLAW_GOOGLE_MEET_ACCESS_TOKEN_EXPIRES_AT", "GOOGLE_MEET_ACCESS_TOKEN_EXPIRES_AT"];
|
|
146
|
-
const GOOGLE_MEET_DEFAULT_MEETING_KEYS = ["OPENCLAW_GOOGLE_MEET_DEFAULT_MEETING", "GOOGLE_MEET_DEFAULT_MEETING"];
|
|
147
|
-
const GOOGLE_MEET_PREVIEW_ACK_KEYS = ["OPENCLAW_GOOGLE_MEET_PREVIEW_ACK", "GOOGLE_MEET_PREVIEW_ACK"];
|
|
148
|
-
function resolveBoolean(value, fallback) {
|
|
149
|
-
return asBoolean(value) ?? fallback;
|
|
150
|
-
}
|
|
151
|
-
function resolveNumber(value, fallback) {
|
|
152
|
-
return typeof value === "number" && Number.isFinite(value) && value > 0 ? value : fallback;
|
|
153
|
-
}
|
|
154
|
-
function resolveTimerConfigMs(value, fallback) {
|
|
155
|
-
return resolvePositiveTimerTimeoutMs(resolveNumber(value, fallback), fallback);
|
|
156
|
-
}
|
|
157
|
-
function resolveOptionalNumber(value) {
|
|
158
|
-
if (typeof value === "number" && Number.isFinite(value)) return value;
|
|
159
|
-
if (typeof value === "string" && value.trim()) {
|
|
160
|
-
const trimmed = value.trim();
|
|
161
|
-
const parsed = PLAIN_DECIMAL_NUMBER_RE.test(trimmed) ? Number(trimmed) : NaN;
|
|
162
|
-
return Number.isFinite(parsed) ? parsed : void 0;
|
|
163
|
-
}
|
|
164
|
-
}
|
|
165
|
-
function readEnvString(env, keys) {
|
|
166
|
-
for (const key of keys) {
|
|
167
|
-
const value = normalizeOptionalString(env[key]);
|
|
168
|
-
if (value) return value;
|
|
169
|
-
}
|
|
170
|
-
}
|
|
171
|
-
function normalizeStringAllowEmpty(value) {
|
|
172
|
-
return typeof value === "string" ? value.trim() : void 0;
|
|
173
|
-
}
|
|
174
|
-
function readEnvBoolean(env, keys) {
|
|
175
|
-
return parseBooleanValue(readEnvString(env, keys));
|
|
176
|
-
}
|
|
177
|
-
function readEnvNumber(env, keys) {
|
|
178
|
-
return resolveOptionalNumber(readEnvString(env, keys));
|
|
179
|
-
}
|
|
180
|
-
function resolveStringArray(value) {
|
|
181
|
-
return normalizeOptionalTrimmedStringList(value);
|
|
182
|
-
}
|
|
183
|
-
function resolveProvidersConfig(value) {
|
|
184
|
-
const raw = asRecord(value);
|
|
185
|
-
const providers = {};
|
|
186
|
-
for (const [key, entry] of Object.entries(raw)) {
|
|
187
|
-
const providerId = normalizeOptionalLowercaseString(key);
|
|
188
|
-
if (!providerId) continue;
|
|
189
|
-
providers[providerId] = asRecord(entry);
|
|
190
|
-
}
|
|
191
|
-
return providers;
|
|
192
|
-
}
|
|
193
|
-
function resolveTransport(value, fallback) {
|
|
194
|
-
const normalized = normalizeOptionalLowercaseString(value);
|
|
195
|
-
return normalized === "chrome" || normalized === "chrome-node" || normalized === "twilio" ? normalized : fallback;
|
|
196
|
-
}
|
|
197
|
-
function resolveMode(value, fallback) {
|
|
198
|
-
const normalized = normalizeOptionalLowercaseString(value);
|
|
199
|
-
if (normalized === "realtime") return "agent";
|
|
200
|
-
return normalized === "agent" || normalized === "bidi" || normalized === "transcribe" ? normalized : fallback;
|
|
201
|
-
}
|
|
202
|
-
function resolveRealtimeStrategy(value, fallback) {
|
|
203
|
-
const normalized = normalizeOptionalLowercaseString(value);
|
|
204
|
-
return normalized === "agent" || normalized === "bidi" ? normalized : fallback;
|
|
205
|
-
}
|
|
206
|
-
function resolveChromeAudioFormat(value) {
|
|
207
|
-
switch (normalizeOptionalString(value)?.toLowerCase().replaceAll("_", "-")) {
|
|
208
|
-
case "pcm16-24khz":
|
|
209
|
-
case "pcm16-24k":
|
|
210
|
-
case "pcm24":
|
|
211
|
-
case "pcm": return "pcm16-24khz";
|
|
212
|
-
case "g711-ulaw-8khz":
|
|
213
|
-
case "g711-ulaw-8k":
|
|
214
|
-
case "g711-ulaw":
|
|
215
|
-
case "mulaw":
|
|
216
|
-
case "mu-law": return "g711-ulaw-8khz";
|
|
217
|
-
default: return;
|
|
218
|
-
}
|
|
219
|
-
}
|
|
220
|
-
function resolveAudioBufferBytes(value, fallback) {
|
|
221
|
-
const number = resolveNumber(value, fallback);
|
|
222
|
-
if (!Number.isFinite(number) || number <= 0) return fallback;
|
|
223
|
-
return Math.max(SOX_MIN_BUFFER_BYTES, Math.trunc(number));
|
|
224
|
-
}
|
|
225
|
-
function defaultAudioInputCommand(backend, format, bufferBytes) {
|
|
226
|
-
return buildGoogleMeetAudioCommands(backend, format, bufferBytes).inputCommand;
|
|
227
|
-
}
|
|
228
|
-
function defaultAudioOutputCommand(backend, format, bufferBytes) {
|
|
229
|
-
return buildGoogleMeetAudioCommands(backend, format, bufferBytes).outputCommand;
|
|
230
|
-
}
|
|
231
|
-
function resolveAudioBackend(value) {
|
|
232
|
-
const normalized = normalizeOptionalLowercaseString(value)?.replaceAll("_", "-");
|
|
233
|
-
return normalized === "blackhole-2ch" || normalized === "pipewire-pulse" ? normalized : "auto";
|
|
234
|
-
}
|
|
235
|
-
function resolveGoogleMeetConfig(input) {
|
|
236
|
-
return resolveGoogleMeetConfigWithEnv(input);
|
|
237
|
-
}
|
|
238
|
-
function resolveGoogleMeetConfigWithEnv(input, env = process.env) {
|
|
239
|
-
const raw = asRecord(input);
|
|
240
|
-
const defaults = asRecord(raw.defaults);
|
|
241
|
-
const preview = asRecord(raw.preview);
|
|
242
|
-
const chrome = asRecord(raw.chrome);
|
|
243
|
-
const configuredAudioInputCommand = resolveStringArray(chrome.audioInputCommand);
|
|
244
|
-
const configuredAudioOutputCommand = resolveStringArray(chrome.audioOutputCommand);
|
|
245
|
-
const hasCustomAudioCommand = configuredAudioInputCommand !== void 0 || configuredAudioOutputCommand !== void 0;
|
|
246
|
-
const audioFormat = resolveChromeAudioFormat(chrome.audioFormat) ?? (hasCustomAudioCommand ? "g711-ulaw-8khz" : DEFAULT_GOOGLE_MEET_CONFIG.chrome.audioFormat);
|
|
247
|
-
const audioBufferBytes = resolveAudioBufferBytes(chrome.audioBufferBytes, DEFAULT_GOOGLE_MEET_CONFIG.chrome.audioBufferBytes);
|
|
248
|
-
const audioBackend = resolveAudioBackend(chrome.audioBackend);
|
|
249
|
-
const chromeNode = asRecord(raw.chromeNode);
|
|
250
|
-
const twilio = asRecord(raw.twilio);
|
|
251
|
-
const voiceCall = asRecord(raw.voiceCall);
|
|
252
|
-
const realtime = asRecord(raw.realtime);
|
|
253
|
-
const realtimeProvider = normalizeOptionalString(realtime.provider);
|
|
254
|
-
const resolvedRealtimeProvider = realtimeProvider ?? DEFAULT_GOOGLE_MEET_CONFIG.realtime.provider;
|
|
255
|
-
const oauth = asRecord(raw.oauth);
|
|
256
|
-
const auth = asRecord(raw.auth);
|
|
257
|
-
return {
|
|
258
|
-
enabled: resolveBoolean(raw.enabled, DEFAULT_GOOGLE_MEET_CONFIG.enabled),
|
|
259
|
-
defaults: { meeting: normalizeOptionalString(defaults.meeting) ?? readEnvString(env, GOOGLE_MEET_DEFAULT_MEETING_KEYS) },
|
|
260
|
-
preview: { enrollmentAcknowledged: resolveBoolean(preview.enrollmentAcknowledged, readEnvBoolean(env, GOOGLE_MEET_PREVIEW_ACK_KEYS) ?? DEFAULT_GOOGLE_MEET_CONFIG.preview.enrollmentAcknowledged) },
|
|
261
|
-
defaultTransport: resolveTransport(raw.defaultTransport, DEFAULT_GOOGLE_MEET_CONFIG.defaultTransport),
|
|
262
|
-
defaultMode: resolveMode(raw.defaultMode, DEFAULT_GOOGLE_MEET_CONFIG.defaultMode),
|
|
263
|
-
chrome: {
|
|
264
|
-
audioBackend,
|
|
265
|
-
audioFormat,
|
|
266
|
-
audioBufferBytes,
|
|
267
|
-
launch: resolveBoolean(chrome.launch, DEFAULT_GOOGLE_MEET_CONFIG.chrome.launch),
|
|
268
|
-
browserProfile: normalizeOptionalString(chrome.browserProfile),
|
|
269
|
-
guestName: normalizeOptionalString(chrome.guestName) ?? DEFAULT_GOOGLE_MEET_CONFIG.chrome.guestName,
|
|
270
|
-
reuseExistingTab: resolveBoolean(chrome.reuseExistingTab, DEFAULT_GOOGLE_MEET_CONFIG.chrome.reuseExistingTab),
|
|
271
|
-
autoJoin: resolveBoolean(chrome.autoJoin, DEFAULT_GOOGLE_MEET_CONFIG.chrome.autoJoin),
|
|
272
|
-
joinTimeoutMs: resolveTimerConfigMs(chrome.joinTimeoutMs, DEFAULT_GOOGLE_MEET_CONFIG.chrome.joinTimeoutMs),
|
|
273
|
-
waitForInCallMs: resolveTimerConfigMs(chrome.waitForInCallMs, DEFAULT_GOOGLE_MEET_CONFIG.chrome.waitForInCallMs),
|
|
274
|
-
audioInputCommand: configuredAudioInputCommand ?? defaultAudioInputCommand(audioBackend, audioFormat, audioBufferBytes),
|
|
275
|
-
audioOutputCommand: configuredAudioOutputCommand ?? defaultAudioOutputCommand(audioBackend, audioFormat, audioBufferBytes),
|
|
276
|
-
audioInputCommandOverride: configuredAudioInputCommand,
|
|
277
|
-
audioOutputCommandOverride: configuredAudioOutputCommand,
|
|
278
|
-
bargeInInputCommand: resolveStringArray(chrome.bargeInInputCommand),
|
|
279
|
-
bargeInRmsThreshold: resolveNumber(chrome.bargeInRmsThreshold, DEFAULT_GOOGLE_MEET_CONFIG.chrome.bargeInRmsThreshold),
|
|
280
|
-
bargeInPeakThreshold: resolveNumber(chrome.bargeInPeakThreshold, DEFAULT_GOOGLE_MEET_CONFIG.chrome.bargeInPeakThreshold),
|
|
281
|
-
bargeInCooldownMs: resolveTimerConfigMs(chrome.bargeInCooldownMs, DEFAULT_GOOGLE_MEET_CONFIG.chrome.bargeInCooldownMs),
|
|
282
|
-
audioBridgeCommand: resolveStringArray(chrome.audioBridgeCommand),
|
|
283
|
-
audioBridgeHealthCommand: resolveStringArray(chrome.audioBridgeHealthCommand)
|
|
284
|
-
},
|
|
285
|
-
chromeNode: { node: normalizeOptionalString(chromeNode.node) },
|
|
286
|
-
twilio: {
|
|
287
|
-
defaultDialInNumber: normalizeOptionalString(twilio.defaultDialInNumber),
|
|
288
|
-
defaultPin: normalizeOptionalString(twilio.defaultPin),
|
|
289
|
-
defaultDtmfSequence: normalizeOptionalString(twilio.defaultDtmfSequence)
|
|
290
|
-
},
|
|
291
|
-
voiceCall: {
|
|
292
|
-
enabled: resolveBoolean(voiceCall.enabled, DEFAULT_GOOGLE_MEET_CONFIG.voiceCall.enabled),
|
|
293
|
-
gatewayUrl: normalizeOptionalString(voiceCall.gatewayUrl),
|
|
294
|
-
token: normalizeOptionalString(voiceCall.token),
|
|
295
|
-
requestTimeoutMs: resolveTimerConfigMs(voiceCall.requestTimeoutMs, DEFAULT_GOOGLE_MEET_CONFIG.voiceCall.requestTimeoutMs),
|
|
296
|
-
dtmfDelayMs: resolveTimerConfigMs(voiceCall.dtmfDelayMs, DEFAULT_GOOGLE_MEET_CONFIG.voiceCall.dtmfDelayMs),
|
|
297
|
-
postDtmfSpeechDelayMs: resolveTimerConfigMs(voiceCall.postDtmfSpeechDelayMs, DEFAULT_GOOGLE_MEET_CONFIG.voiceCall.postDtmfSpeechDelayMs),
|
|
298
|
-
introMessage: normalizeOptionalString(voiceCall.introMessage)
|
|
299
|
-
},
|
|
300
|
-
realtime: {
|
|
301
|
-
strategy: resolveRealtimeStrategy(realtime.strategy, DEFAULT_GOOGLE_MEET_CONFIG.realtime.strategy),
|
|
302
|
-
provider: resolvedRealtimeProvider,
|
|
303
|
-
transcriptionProvider: normalizeOptionalString(realtime.transcriptionProvider) ?? (realtimeProvider && realtimeProvider !== "google" ? resolvedRealtimeProvider : DEFAULT_GOOGLE_MEET_CONFIG.realtime.transcriptionProvider),
|
|
304
|
-
voiceProvider: normalizeOptionalString(realtime.voiceProvider),
|
|
305
|
-
model: normalizeOptionalString(realtime.model) ?? DEFAULT_GOOGLE_MEET_CONFIG.realtime.model,
|
|
306
|
-
instructions: normalizeOptionalString(realtime.instructions) ?? DEFAULT_GOOGLE_MEET_CONFIG.realtime.instructions,
|
|
307
|
-
introMessage: normalizeStringAllowEmpty(realtime.introMessage) ?? DEFAULT_GOOGLE_MEET_CONFIG.realtime.introMessage,
|
|
308
|
-
agentId: normalizeOptionalString(realtime.agentId),
|
|
309
|
-
toolPolicy: resolveRealtimeVoiceAgentConsultToolPolicy(realtime.toolPolicy, DEFAULT_GOOGLE_MEET_CONFIG.realtime.toolPolicy),
|
|
310
|
-
providers: resolveProvidersConfig(realtime.providers)
|
|
311
|
-
},
|
|
312
|
-
oauth: {
|
|
313
|
-
clientId: normalizeOptionalString(oauth.clientId) ?? normalizeOptionalString(auth.clientId) ?? readEnvString(env, GOOGLE_MEET_CLIENT_ID_KEYS),
|
|
314
|
-
clientSecret: normalizeOptionalString(oauth.clientSecret) ?? normalizeOptionalString(auth.clientSecret) ?? readEnvString(env, GOOGLE_MEET_CLIENT_SECRET_KEYS),
|
|
315
|
-
refreshToken: normalizeOptionalString(oauth.refreshToken) ?? readEnvString(env, GOOGLE_MEET_REFRESH_TOKEN_KEYS),
|
|
316
|
-
accessToken: normalizeOptionalString(oauth.accessToken) ?? readEnvString(env, GOOGLE_MEET_ACCESS_TOKEN_KEYS),
|
|
317
|
-
expiresAt: resolveOptionalNumber(oauth.expiresAt) ?? readEnvNumber(env, GOOGLE_MEET_ACCESS_TOKEN_EXPIRES_AT_KEYS)
|
|
318
|
-
},
|
|
319
|
-
auth: {
|
|
320
|
-
provider: "google-oauth",
|
|
321
|
-
clientId: normalizeOptionalString(auth.clientId),
|
|
322
|
-
clientSecret: normalizeOptionalString(auth.clientSecret),
|
|
323
|
-
tokenPath: normalizeOptionalString(auth.tokenPath)
|
|
324
|
-
}
|
|
325
|
-
};
|
|
326
|
-
}
|
|
327
|
-
//#endregion
|
|
328
|
-
export { resolveGoogleMeetGatewayOperationTimeoutMs as i, DEFAULT_GOOGLE_MEET_AUDIO_OUTPUT_COMMAND as n, resolveGoogleMeetConfig as r, DEFAULT_GOOGLE_MEET_AUDIO_INPUT_COMMAND as t };
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { readResponseTextLimited } from "openclaw/plugin-sdk/provider-http";
|
|
2
|
-
//#region extensions/google-meet/src/google-api-errors.ts
|
|
3
|
-
const REAUTH_HINT = "Re-run `openclaw googlemeet auth login` and store the refreshed oauth block.";
|
|
4
|
-
const GOOGLE_API_ERROR_BODY_LIMIT_BYTES = 8192;
|
|
5
|
-
function scopeText(scopes) {
|
|
6
|
-
return scopes.map((scope) => `\`${scope}\``).join(", ");
|
|
7
|
-
}
|
|
8
|
-
async function readGoogleApiErrorDetail(response) {
|
|
9
|
-
return await readResponseTextLimited(response, GOOGLE_API_ERROR_BODY_LIMIT_BYTES);
|
|
10
|
-
}
|
|
11
|
-
async function googleApiError(params) {
|
|
12
|
-
const detail = await readGoogleApiErrorDetail(params.response);
|
|
13
|
-
const scopeHint = params.scopes && params.scopes.length > 0 ? ` Required OAuth scope: ${scopeText(params.scopes)}. ${REAUTH_HINT}` : "";
|
|
14
|
-
return /* @__PURE__ */ new Error(`${params.prefix} failed (${params.response.status}): ${detail}${scopeHint}`);
|
|
15
|
-
}
|
|
16
|
-
//#endregion
|
|
17
|
-
export { readGoogleApiErrorDetail as n, googleApiError as t };
|
|
File without changes
|