@openclaw/google-meet 2026.9.6 → 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-CbxqjjTC.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-CG9Pgwsb.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-BUrsParx.mjs → node-host-Tr7Mx3da.mjs} +3 -3
- 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--7X3icub.mjs → plugin-helpers-CdQ_YNA7.mjs} +147 -236
- package/dist/.setup/{plugin-registration-B3LXKV4R.mjs → plugin-registration-aCEuCerg.mjs} +34 -10
- package/dist/.setup/{runtime-BuIZ5e3V.mjs → runtime-BdiF53A2.mjs} +85 -41
- package/dist/doctor-contract-api.js +3 -6
- package/dist/index.js +48 -12
- 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
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { Get } from './settings.mjs';
|
|
2
|
+
// ------------------------------------------------------------------
|
|
3
|
+
// TempMaxErrors
|
|
4
|
+
// ------------------------------------------------------------------
|
|
5
|
+
let TempMaxErrors = 0;
|
|
6
|
+
// ------------------------------------------------------------------
|
|
7
|
+
// [Internal] EnableParseErrors
|
|
8
|
+
// ------------------------------------------------------------------
|
|
9
|
+
export function EnableParseErrors() {
|
|
10
|
+
const settings = Get();
|
|
11
|
+
TempMaxErrors = settings.maxErrors;
|
|
12
|
+
settings.maxErrors = settings.maxParseErrors;
|
|
13
|
+
}
|
|
14
|
+
// ------------------------------------------------------------------
|
|
15
|
+
// [Internal] DisableParseErrors
|
|
16
|
+
// ------------------------------------------------------------------
|
|
17
|
+
export function DisableParseErrors() {
|
|
18
|
+
const settings = Get();
|
|
19
|
+
settings.maxErrors = TempMaxErrors;
|
|
20
|
+
}
|
|
@@ -16,6 +16,17 @@ export interface TSettings {
|
|
|
16
16
|
* @default 8
|
|
17
17
|
*/
|
|
18
18
|
maxErrors: number;
|
|
19
|
+
/**
|
|
20
|
+
* Specifies the maximum number of errors to gather for failed Parse operations. TypeBox will
|
|
21
|
+
* automatically run an error-gathering pass on failed Parses to attach diagnostics to the
|
|
22
|
+
* thrown exception. This setting controls the number of errors gathered in that pass. Higher
|
|
23
|
+
* values will reduce throughput on failure cases, so a maximum of 4 is recommended if more
|
|
24
|
+
* errors are needed. The default setting of 1 will terminate on the first error, while a
|
|
25
|
+
* setting of 0 will skip error gathering entirely.
|
|
26
|
+
*
|
|
27
|
+
* @default 1
|
|
28
|
+
*/
|
|
29
|
+
maxParseErrors: number;
|
|
19
30
|
/**
|
|
20
31
|
* Specifies the maximum number of instantiations allowed within a top-level generic instantiation
|
|
21
32
|
* context. This setting can be used to bound generic calls to a fixed count, which can be useful if
|
|
@@ -1,8 +1,12 @@
|
|
|
1
1
|
import { Guard } from '../../guard/index.mjs';
|
|
2
|
+
// -------------------------------------------------------------------
|
|
3
|
+
// State
|
|
4
|
+
// -------------------------------------------------------------------
|
|
2
5
|
// Internal mutable state
|
|
3
6
|
const settings = {
|
|
4
7
|
immutableTypes: false,
|
|
5
8
|
maxErrors: 8,
|
|
9
|
+
maxParseErrors: 1,
|
|
6
10
|
maxInstantiationCount: 128,
|
|
7
11
|
useAcceleration: true,
|
|
8
12
|
exactOptionalPropertyTypes: false,
|
|
@@ -10,10 +14,14 @@ const settings = {
|
|
|
10
14
|
correctiveParse: false,
|
|
11
15
|
unionPrioritySort: true
|
|
12
16
|
};
|
|
17
|
+
// -------------------------------------------------------------------
|
|
18
|
+
// Reset
|
|
19
|
+
// -------------------------------------------------------------------
|
|
13
20
|
/** Resets system settings to defaults */
|
|
14
21
|
export function Reset() {
|
|
15
22
|
settings.immutableTypes = false;
|
|
16
23
|
settings.maxErrors = 8;
|
|
24
|
+
settings.maxParseErrors = 1;
|
|
17
25
|
settings.maxInstantiationCount = 128;
|
|
18
26
|
settings.useAcceleration = true;
|
|
19
27
|
settings.exactOptionalPropertyTypes = false;
|
|
@@ -21,6 +29,9 @@ export function Reset() {
|
|
|
21
29
|
settings.correctiveParse = false;
|
|
22
30
|
settings.unionPrioritySort = true;
|
|
23
31
|
}
|
|
32
|
+
// -------------------------------------------------------------------
|
|
33
|
+
// Set
|
|
34
|
+
// -------------------------------------------------------------------
|
|
24
35
|
/** Sets system settings */
|
|
25
36
|
export function Set(options) {
|
|
26
37
|
for (const key of Guard.Keys(options)) {
|
|
@@ -30,6 +41,9 @@ export function Set(options) {
|
|
|
30
41
|
}
|
|
31
42
|
}
|
|
32
43
|
}
|
|
44
|
+
// -------------------------------------------------------------------
|
|
45
|
+
// Get
|
|
46
|
+
// -------------------------------------------------------------------
|
|
33
47
|
/** Gets current system settings */
|
|
34
48
|
export function Get() {
|
|
35
49
|
return settings;
|
|
@@ -22,7 +22,7 @@ export declare function TryRestInferable<Type extends TSchema>(type: Type): TTry
|
|
|
22
22
|
export type TTryInferable<Type extends TSchema, Result extends TInferable | undefined = (Type extends TInfer<infer Name extends string, infer Type extends TSchema> ? TInferable<Name, Type> : undefined)> = Result;
|
|
23
23
|
export declare function TryInferable<Type extends TSchema>(type: Type): TTryInferable<Type>;
|
|
24
24
|
type TryInferResults<Rest extends TSchema[], Right extends TSchema, Result extends TSchema[] = []> = (Rest extends [infer Head extends TSchema, ...infer Tail extends TSchema[]] ? TExtendsLeft<{}, Head, Right> extends Result.TExtendsTrueLike ? TryInferResults<Tail, Right, [...Result, Head]> : undefined : Result);
|
|
25
|
-
declare function TryInferResults<Rest extends TSchema[], Right extends TSchema>(rest: [...Rest], right: Right
|
|
25
|
+
declare function TryInferResults<Rest extends TSchema[], Right extends TSchema>(rest: [...Rest], right: Right): TryInferResults<Rest, Right>;
|
|
26
26
|
export type TInferTupleResult<Inferred extends TProperties, Name extends string, Left extends TSchema[], Right extends TSchema, Results extends TSchema[] | undefined = TryInferResults<Left, Right>> = (Results extends [...infer Results extends TSchema[]] ? Result.TExtendsTrue<Memory.TAssign<Inferred, {
|
|
27
27
|
[_ in Name]: TTuple<Results>;
|
|
28
28
|
}>> : Result.TExtendsFalse);
|
|
@@ -45,8 +45,21 @@ export function TryInferable(type) {
|
|
|
45
45
|
return (IsInfer(type) ? Inferrable(type.name, type.extends) :
|
|
46
46
|
undefined);
|
|
47
47
|
}
|
|
48
|
-
function TryInferResults(rest, right, result = []) {
|
|
49
|
-
|
|
48
|
+
// function TryInferResults<Rest extends TSchema[], Right extends TSchema>(rest: [...Rest], right: Right, result: TSchema[] = []): TryInferResults<Rest, Right> {
|
|
49
|
+
// return Guard.ShiftLeft(rest, (head, tail) =>
|
|
50
|
+
// Result.Match(ExtendsLeft({}, head, right),
|
|
51
|
+
// () => TryInferResults(tail, right, [...result, head]), // Stack Overflow Here (Large Rest)
|
|
52
|
+
// () => undefined),
|
|
53
|
+
// () => result) as never
|
|
54
|
+
// }
|
|
55
|
+
function TryInferResults(rest, right) {
|
|
56
|
+
const result = [];
|
|
57
|
+
for (const head of rest) {
|
|
58
|
+
if (!Result.IsExtendsTrueLike(ExtendsLeft({}, head, right)))
|
|
59
|
+
return undefined;
|
|
60
|
+
result.push(head);
|
|
61
|
+
}
|
|
62
|
+
return result;
|
|
50
63
|
}
|
|
51
64
|
export function InferTupleResult(inferred, name, left, right) {
|
|
52
65
|
const results = TryInferResults(left, right);
|
|
@@ -16,7 +16,8 @@ type TElementsLeft<Inferred extends TProperties, Reversed extends boolean, LeftR
|
|
|
16
16
|
type TElementsRight<Inferred extends TProperties, Reversed extends boolean, LeftRest extends TSchema[], RightRest extends TSchema[]> = (RightRest extends [infer Head extends TSchema, ...infer Tail extends TSchema[]] ? TElementsLeft<Inferred, Reversed, LeftRest, Head, Tail> : LeftRest['length'] extends 0 ? Result.TExtendsTrue<Inferred> : Result.TExtendsFalse);
|
|
17
17
|
type TElements<Inferred extends TProperties, Reversed extends boolean, LeftRest extends TSchema[], RightRest extends TSchema[]> = TElementsRight<Inferred, Reversed, LeftRest, RightRest>;
|
|
18
18
|
type TExtendsTupleToTuple<Inferred extends TProperties, Left extends TSchema[], Right extends TSchema[], InstantiatedRight extends TSchema[] = TInstantiateElements<Inferred, TState<[], []>, Right>, Reversed extends boolean = TReversed<InstantiatedRight>> = TElements<Inferred, Reversed, TApplyReverse<Left, Reversed>, TApplyReverse<InstantiatedRight, Reversed>>;
|
|
19
|
-
type
|
|
19
|
+
type TExtendsTupleToArrayReduce<Inferred extends TProperties, Left extends TSchema[], Right extends TSchema> = (Left extends [infer Head extends TSchema, ...infer Tail extends TSchema[]] ? TExtendsLeft<Inferred, Head, Right> extends Result.TExtendsTrueLike<infer Inferred extends TProperties> ? TExtendsTupleToArrayReduce<Inferred, Tail, Right> : Result.TExtendsFalse : Result.TExtendsTrue<Inferred>);
|
|
20
|
+
type TExtendsTupleToArray<Inferred extends TProperties, Left extends TSchema[], Right extends TSchema, Inferrable extends TInferable | undefined = TTryInferable<Right>> = (Inferrable extends TInferable ? TInferUnionResult<Inferred, Inferrable['name'], Left, Inferrable['type']> : TExtendsTupleToArrayReduce<Inferred, Left, Right>);
|
|
20
21
|
export type TExtendsTuple<Inferred extends TProperties, Left extends TSchema[], Right extends TSchema, InstantiatedLeft extends TSchema[] = TInstantiateElements<Inferred, TState<[], []>, Left>> = (Right extends TTuple<infer Types extends TSchema[]> ? TExtendsTupleToTuple<Inferred, InstantiatedLeft, Types> : Right extends TArray<infer Type extends TSchema> ? TExtendsTupleToArray<Inferred, InstantiatedLeft, Type> : TExtendsRight<Inferred, TTuple<InstantiatedLeft>, Right>);
|
|
21
22
|
export declare function ExtendsTuple<Inferred extends TProperties, Left extends TSchema[], Right extends TSchema>(inferred: Inferred, left: Left, right: Right): TExtendsTuple<Inferred, Left, Right>;
|
|
22
23
|
export {};
|
|
@@ -47,11 +47,31 @@ function ExtendsTupleToTuple(inferred, left, right) {
|
|
|
47
47
|
const reversed = Reversed(instantiatedRight);
|
|
48
48
|
return Elements(inferred, reversed, ApplyReverse(left, reversed), ApplyReverse(instantiatedRight, reversed));
|
|
49
49
|
}
|
|
50
|
+
// function ExtendsTupleToArrayReduce<Inferred extends TProperties, Left extends TSchema[], Right extends TSchema>
|
|
51
|
+
// (inferred: Inferred, left: [...Left], right: Right):
|
|
52
|
+
// TExtendsTupleToArrayReduce<Inferred, Left, Right> {
|
|
53
|
+
// return (
|
|
54
|
+
// Guard.ShiftLeft(left, (head, tail) =>
|
|
55
|
+
// Result.Match(ExtendsLeft(inferred, head, right), inferred =>
|
|
56
|
+
// ExtendsTupleToArrayReduce(inferred, tail, right), // Stack Overflow Here (Large Left)
|
|
57
|
+
// () => Result.ExtendsFalse()),
|
|
58
|
+
// () => Result.ExtendsTrue(inferred))
|
|
59
|
+
// ) as never
|
|
60
|
+
// }
|
|
61
|
+
function ExtendsTupleToArrayReduce(inferred, left, right) {
|
|
62
|
+
for (const head of left) {
|
|
63
|
+
const result = ExtendsLeft(inferred, head, right);
|
|
64
|
+
if (!Result.IsExtendsTrueLike(result))
|
|
65
|
+
return result;
|
|
66
|
+
inferred = result.inferred; // (review-assign-to-argument)
|
|
67
|
+
}
|
|
68
|
+
return Result.ExtendsTrue(inferred);
|
|
69
|
+
}
|
|
50
70
|
function ExtendsTupleToArray(inferred, left, right) {
|
|
51
71
|
const inferrable = TryInferable(right);
|
|
52
72
|
return (IsInferable(inferrable)
|
|
53
73
|
? InferUnionResult(inferred, inferrable['name'], left, inferrable['type'])
|
|
54
|
-
:
|
|
74
|
+
: ExtendsTupleToArrayReduce(inferred, left, right));
|
|
55
75
|
}
|
|
56
76
|
export function ExtendsTuple(inferred, left, right) {
|
|
57
77
|
const instantiatedLeft = InstantiateElements(inferred, State([], []), left);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// deno-fmt-ignore-file
|
|
2
|
-
import {
|
|
3
|
-
import { Arguments } from '../../system/
|
|
2
|
+
import { EnableParseErrors, DisableParseErrors } from '../../system/settings/internal.mjs';
|
|
3
|
+
import { Arguments, Settings } from '../../system/index.mjs';
|
|
4
4
|
import { AssertError } from '../assert/index.mjs';
|
|
5
5
|
import { Check } from '../check/index.mjs';
|
|
6
6
|
import { Errors } from '../errors/index.mjs';
|
|
@@ -18,8 +18,11 @@ export class ParseError extends AssertError {
|
|
|
18
18
|
}
|
|
19
19
|
}
|
|
20
20
|
function Assert(context, type, value) {
|
|
21
|
+
EnableParseErrors();
|
|
22
|
+
const errors = Errors(context, type, value);
|
|
23
|
+
DisableParseErrors();
|
|
21
24
|
if (!Check(context, type, value))
|
|
22
|
-
throw new ParseError(value,
|
|
25
|
+
throw new ParseError(value, errors);
|
|
23
26
|
return value;
|
|
24
27
|
}
|
|
25
28
|
// ------------------------------------------------------------------
|
|
@@ -43,5 +46,8 @@ export function Parse(...args) {
|
|
|
43
46
|
return value;
|
|
44
47
|
if (Settings.Get().correctiveParse)
|
|
45
48
|
return Parser(context, type, value);
|
|
46
|
-
|
|
49
|
+
EnableParseErrors();
|
|
50
|
+
const errors = Errors(context, type, value);
|
|
51
|
+
DisableParseErrors();
|
|
52
|
+
throw new ParseError(value, errors);
|
|
47
53
|
}
|
|
@@ -166,9 +166,11 @@ import Schema from 'typebox/schema'
|
|
|
166
166
|
|
|
167
167
|
### Compile
|
|
168
168
|
|
|
169
|
-
The compiler accepts
|
|
169
|
+
The compiler accepts TypeBox types as well as plain JSON Schema objects, and returns a Validator instance which can be used to check values. The following compiles a Vector type.
|
|
170
170
|
|
|
171
171
|
```typescript
|
|
172
|
+
import Schema from 'typebox/schema'
|
|
173
|
+
|
|
172
174
|
// Compile
|
|
173
175
|
|
|
174
176
|
const Vector = Schema.Compile(Type.Script(`{
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@openclaw/google-meet",
|
|
3
|
-
"version": "2026.9.
|
|
3
|
+
"version": "2026.9.7",
|
|
4
4
|
"description": "OpenClaw Google Meet participant plugin for joining calls through Chrome or Twilio transports.",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -9,10 +9,10 @@
|
|
|
9
9
|
"type": "module",
|
|
10
10
|
"dependencies": {
|
|
11
11
|
"jszip": "3.10.2",
|
|
12
|
-
"typebox": "1.3.
|
|
12
|
+
"typebox": "1.3.34"
|
|
13
13
|
},
|
|
14
14
|
"peerDependencies": {
|
|
15
|
-
"openclaw": ">=2026.9.
|
|
15
|
+
"openclaw": ">=2026.9.7"
|
|
16
16
|
},
|
|
17
17
|
"peerDependenciesMeta": {
|
|
18
18
|
"openclaw": {
|
|
@@ -30,10 +30,10 @@
|
|
|
30
30
|
"minHostVersion": ">=2026.4.20"
|
|
31
31
|
},
|
|
32
32
|
"compat": {
|
|
33
|
-
"pluginApi": ">=2026.9.
|
|
33
|
+
"pluginApi": ">=2026.9.7"
|
|
34
34
|
},
|
|
35
35
|
"build": {
|
|
36
|
-
"openclawVersion": "2026.9.
|
|
36
|
+
"openclawVersion": "2026.9.7"
|
|
37
37
|
},
|
|
38
38
|
"release": {
|
|
39
39
|
"publishToClawHub": true,
|
|
@@ -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
|