@kodelyth/google-meet 2026.5.39 → 2026.5.42
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/calendar-CEiBGUl2.js +136 -0
- package/dist/chrome-create-DMyPCiEd.js +965 -0
- package/dist/cli-BMVhSIb8.js +1390 -0
- package/dist/create-IbyMXB3V.js +108 -0
- package/dist/doctor-contract-api.js +56 -0
- package/dist/index.js +4979 -0
- package/dist/oauth-7_sWAae1.js +141 -0
- package/doctor-contract-api.ts +1 -0
- package/google-meet.live.test.ts +82 -0
- package/index.create.test.ts +671 -0
- package/index.test.ts +5051 -0
- package/index.ts +1224 -0
- package/klaw.plugin.json +12 -46
- package/node-host.test.ts +241 -0
- package/package.json +3 -3
- package/src/agent-consult.ts +158 -0
- package/src/calendar.ts +252 -0
- package/src/cli.test.ts +1234 -0
- package/src/cli.ts +2350 -0
- package/src/config-compat.test.ts +98 -0
- package/src/config-compat.ts +84 -0
- package/src/config.ts +589 -0
- package/src/create.ts +157 -0
- package/src/drive.ts +72 -0
- package/src/google-api-errors.ts +20 -0
- package/src/meet.ts +1024 -0
- package/src/node-host.ts +520 -0
- package/src/oauth.test.ts +73 -0
- package/src/oauth.ts +229 -0
- package/src/realtime-node.ts +780 -0
- package/src/realtime.ts +1334 -0
- package/src/runtime.ts +1008 -0
- package/src/setup.ts +285 -0
- package/src/test-support/plugin-harness.ts +232 -0
- package/src/transports/chrome-browser-proxy.test.ts +39 -0
- package/src/transports/chrome-browser-proxy.ts +204 -0
- package/src/transports/chrome-create.ts +364 -0
- package/src/transports/chrome.test.ts +12 -0
- package/src/transports/chrome.ts +1065 -0
- package/src/transports/twilio.ts +57 -0
- package/src/transports/types.ts +147 -0
- package/src/voice-call-gateway.test.ts +152 -0
- package/src/voice-call-gateway.ts +241 -0
- package/tsconfig.json +16 -0
- package/doctor-contract-api.js +0 -7
- package/index.js +0 -7
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
import type { KlawConfig } from "klaw/plugin-sdk/config-contracts";
|
|
2
|
+
import { describe, expect, it } from "vitest";
|
|
3
|
+
import {
|
|
4
|
+
legacyConfigRules,
|
|
5
|
+
migrateGoogleMeetLegacyRealtimeProvider,
|
|
6
|
+
normalizeCompatibilityConfig,
|
|
7
|
+
} from "./config-compat.js";
|
|
8
|
+
|
|
9
|
+
describe("google-meet config compatibility", () => {
|
|
10
|
+
it("detects legacy Google realtime provider config", () => {
|
|
11
|
+
expect(
|
|
12
|
+
legacyConfigRules[0]?.match({
|
|
13
|
+
provider: "google",
|
|
14
|
+
model: "gemini-2.5-flash-native-audio-preview-12-2025",
|
|
15
|
+
}),
|
|
16
|
+
).toBe(true);
|
|
17
|
+
});
|
|
18
|
+
|
|
19
|
+
it("migrates legacy Google bidi provider intent to scoped realtime providers", () => {
|
|
20
|
+
const config = {
|
|
21
|
+
plugins: {
|
|
22
|
+
entries: {
|
|
23
|
+
"google-meet": {
|
|
24
|
+
enabled: true,
|
|
25
|
+
config: {
|
|
26
|
+
defaultMode: "agent",
|
|
27
|
+
realtime: {
|
|
28
|
+
provider: "google",
|
|
29
|
+
model: "gemini-2.5-flash-native-audio-preview-12-2025",
|
|
30
|
+
providers: {
|
|
31
|
+
google: {
|
|
32
|
+
voice: "Kore",
|
|
33
|
+
},
|
|
34
|
+
},
|
|
35
|
+
},
|
|
36
|
+
},
|
|
37
|
+
},
|
|
38
|
+
},
|
|
39
|
+
},
|
|
40
|
+
} as KlawConfig;
|
|
41
|
+
|
|
42
|
+
const migration = migrateGoogleMeetLegacyRealtimeProvider(config);
|
|
43
|
+
|
|
44
|
+
expect(migration?.changes).toEqual([
|
|
45
|
+
'Moved Google Meet legacy realtime.provider="google" intent to realtime.voiceProvider="google" and realtime.transcriptionProvider="openai".',
|
|
46
|
+
]);
|
|
47
|
+
expect(
|
|
48
|
+
(
|
|
49
|
+
migration?.config.plugins?.entries?.["google-meet"] as {
|
|
50
|
+
config?: { realtime?: Record<string, unknown> };
|
|
51
|
+
}
|
|
52
|
+
).config?.realtime,
|
|
53
|
+
).toEqual({
|
|
54
|
+
provider: "openai",
|
|
55
|
+
transcriptionProvider: "openai",
|
|
56
|
+
voiceProvider: "google",
|
|
57
|
+
model: "gemini-2.5-flash-native-audio-preview-12-2025",
|
|
58
|
+
providers: {
|
|
59
|
+
google: {
|
|
60
|
+
voice: "Kore",
|
|
61
|
+
},
|
|
62
|
+
},
|
|
63
|
+
});
|
|
64
|
+
});
|
|
65
|
+
|
|
66
|
+
it("leaves fully scoped provider configs alone", () => {
|
|
67
|
+
const config = {
|
|
68
|
+
plugins: {
|
|
69
|
+
entries: {
|
|
70
|
+
"google-meet": {
|
|
71
|
+
config: {
|
|
72
|
+
realtime: {
|
|
73
|
+
provider: "google",
|
|
74
|
+
transcriptionProvider: "custom-stt",
|
|
75
|
+
voiceProvider: "custom-voice",
|
|
76
|
+
},
|
|
77
|
+
},
|
|
78
|
+
},
|
|
79
|
+
},
|
|
80
|
+
},
|
|
81
|
+
} as KlawConfig;
|
|
82
|
+
|
|
83
|
+
const migration = normalizeCompatibilityConfig({ cfg: config });
|
|
84
|
+
|
|
85
|
+
expect(migration.changes).toStrictEqual([]);
|
|
86
|
+
expect(
|
|
87
|
+
(
|
|
88
|
+
migration.config.plugins?.entries?.["google-meet"] as {
|
|
89
|
+
config?: { realtime?: Record<string, unknown> };
|
|
90
|
+
}
|
|
91
|
+
).config?.realtime,
|
|
92
|
+
).toEqual({
|
|
93
|
+
provider: "google",
|
|
94
|
+
transcriptionProvider: "custom-stt",
|
|
95
|
+
voiceProvider: "custom-voice",
|
|
96
|
+
});
|
|
97
|
+
});
|
|
98
|
+
});
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import type { KlawConfig } from "klaw/plugin-sdk/config-contracts";
|
|
2
|
+
|
|
3
|
+
type LegacyConfigRule = {
|
|
4
|
+
path: Array<string | number>;
|
|
5
|
+
message: string;
|
|
6
|
+
match: (value: unknown) => boolean;
|
|
7
|
+
};
|
|
8
|
+
|
|
9
|
+
function asRecord(value: unknown): Record<string, unknown> | null {
|
|
10
|
+
return value && typeof value === "object" && !Array.isArray(value)
|
|
11
|
+
? (value as Record<string, unknown>)
|
|
12
|
+
: null;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
function normalizeProviderId(value: unknown): string | undefined {
|
|
16
|
+
return typeof value === "string" && value.trim() ? value.trim().toLowerCase() : undefined;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
function hasOwn(record: Record<string, unknown>, key: string): boolean {
|
|
20
|
+
return Object.prototype.hasOwnProperty.call(record, key);
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
function hasLegacyGoogleRealtimeProvider(value: unknown): boolean {
|
|
24
|
+
const realtime = asRecord(value);
|
|
25
|
+
if (!realtime || normalizeProviderId(realtime.provider) !== "google") {
|
|
26
|
+
return false;
|
|
27
|
+
}
|
|
28
|
+
return !hasOwn(realtime, "voiceProvider") || !hasOwn(realtime, "transcriptionProvider");
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
export const legacyConfigRules: LegacyConfigRule[] = [
|
|
32
|
+
{
|
|
33
|
+
path: ["plugins", "entries", "google-meet", "config", "realtime"],
|
|
34
|
+
message:
|
|
35
|
+
'plugins.entries.google-meet.config.realtime.provider="google" is legacy for Gemini Live bidi mode; use realtime.voiceProvider="google" and realtime.transcriptionProvider="openai". Run "klaw doctor --fix".',
|
|
36
|
+
match: hasLegacyGoogleRealtimeProvider,
|
|
37
|
+
},
|
|
38
|
+
];
|
|
39
|
+
|
|
40
|
+
export function migrateGoogleMeetLegacyRealtimeProvider(config: KlawConfig): {
|
|
41
|
+
config: KlawConfig;
|
|
42
|
+
changes: string[];
|
|
43
|
+
} | null {
|
|
44
|
+
const rawEntry = asRecord(config.plugins?.entries?.["google-meet"]);
|
|
45
|
+
const rawPluginConfig = asRecord(rawEntry?.config);
|
|
46
|
+
const rawRealtime = asRecord(rawPluginConfig?.realtime);
|
|
47
|
+
if (!rawRealtime || !hasLegacyGoogleRealtimeProvider(rawRealtime)) {
|
|
48
|
+
return null;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
const nextConfig = structuredClone(config);
|
|
52
|
+
const nextPlugins = asRecord(nextConfig.plugins) ?? {};
|
|
53
|
+
nextConfig.plugins = nextPlugins;
|
|
54
|
+
const nextEntries = asRecord(nextPlugins.entries) ?? {};
|
|
55
|
+
nextPlugins.entries = nextEntries;
|
|
56
|
+
const nextEntry = asRecord(nextEntries["google-meet"]) ?? {};
|
|
57
|
+
nextEntries["google-meet"] = nextEntry;
|
|
58
|
+
const nextPluginConfig = asRecord(nextEntry.config) ?? {};
|
|
59
|
+
nextEntry.config = nextPluginConfig;
|
|
60
|
+
const nextRealtime = asRecord(nextPluginConfig.realtime) ?? {};
|
|
61
|
+
nextPluginConfig.realtime = nextRealtime;
|
|
62
|
+
|
|
63
|
+
nextRealtime.provider = "openai";
|
|
64
|
+
if (!hasOwn(nextRealtime, "transcriptionProvider")) {
|
|
65
|
+
nextRealtime.transcriptionProvider = "openai";
|
|
66
|
+
}
|
|
67
|
+
if (!hasOwn(nextRealtime, "voiceProvider")) {
|
|
68
|
+
nextRealtime.voiceProvider = "google";
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
return {
|
|
72
|
+
config: nextConfig,
|
|
73
|
+
changes: [
|
|
74
|
+
'Moved Google Meet legacy realtime.provider="google" intent to realtime.voiceProvider="google" and realtime.transcriptionProvider="openai".',
|
|
75
|
+
],
|
|
76
|
+
};
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
export function normalizeCompatibilityConfig({ cfg }: { cfg: KlawConfig }): {
|
|
80
|
+
config: KlawConfig;
|
|
81
|
+
changes: string[];
|
|
82
|
+
} {
|
|
83
|
+
return migrateGoogleMeetLegacyRealtimeProvider(cfg) ?? { config: cfg, changes: [] };
|
|
84
|
+
}
|