@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,108 @@
|
|
|
1
|
+
import { d as createGoogleMeetSpace, t as createMeetWithBrowserProxyOnNode } from "./chrome-create-DMyPCiEd.js";
|
|
2
|
+
import { resolveGoogleMeetAccessToken } from "./oauth-7_sWAae1.js";
|
|
3
|
+
import { normalizeOptionalString } from "klaw/plugin-sdk/string-coerce-runtime";
|
|
4
|
+
//#region extensions/google-meet/src/create.ts
|
|
5
|
+
function normalizeTransport(value) {
|
|
6
|
+
return value === "chrome" || value === "chrome-node" || value === "twilio" ? value : void 0;
|
|
7
|
+
}
|
|
8
|
+
function normalizeMode(value) {
|
|
9
|
+
if (value === "realtime") return "agent";
|
|
10
|
+
return value === "agent" || value === "bidi" || value === "transcribe" ? value : void 0;
|
|
11
|
+
}
|
|
12
|
+
function normalizeGoogleMeetAccessType(value) {
|
|
13
|
+
const normalized = normalizeOptionalString(value)?.toUpperCase().replaceAll("-", "_");
|
|
14
|
+
return normalized === "OPEN" || normalized === "TRUSTED" || normalized === "RESTRICTED" ? normalized : void 0;
|
|
15
|
+
}
|
|
16
|
+
function normalizeGoogleMeetEntryPointAccess(value) {
|
|
17
|
+
const normalized = normalizeOptionalString(value)?.toUpperCase().replaceAll("-", "_");
|
|
18
|
+
return normalized === "ALL" || normalized === "CREATOR_APP_ONLY" ? normalized : void 0;
|
|
19
|
+
}
|
|
20
|
+
function resolveCreateSpaceConfig(raw) {
|
|
21
|
+
const rawAccessType = normalizeOptionalString(raw.accessType);
|
|
22
|
+
const rawEntryPointAccess = normalizeOptionalString(raw.entryPointAccess);
|
|
23
|
+
const accessType = normalizeGoogleMeetAccessType(raw.accessType);
|
|
24
|
+
const entryPointAccess = normalizeGoogleMeetEntryPointAccess(raw.entryPointAccess);
|
|
25
|
+
if (rawAccessType !== void 0 && !accessType) throw new Error("Invalid Google Meet accessType. Expected OPEN, TRUSTED, or RESTRICTED.");
|
|
26
|
+
if (rawEntryPointAccess !== void 0 && !entryPointAccess) throw new Error("Invalid Google Meet entryPointAccess. Expected ALL or CREATOR_APP_ONLY.");
|
|
27
|
+
const config = {
|
|
28
|
+
...accessType ? { accessType } : {},
|
|
29
|
+
...entryPointAccess ? { entryPointAccess } : {}
|
|
30
|
+
};
|
|
31
|
+
return Object.keys(config).length > 0 ? config : void 0;
|
|
32
|
+
}
|
|
33
|
+
function hasCreateSpaceConfigInput(raw) {
|
|
34
|
+
return normalizeOptionalString(raw.accessType) !== void 0 || normalizeOptionalString(raw.entryPointAccess) !== void 0;
|
|
35
|
+
}
|
|
36
|
+
async function createSpaceFromParams(config, raw) {
|
|
37
|
+
const token = await resolveGoogleMeetAccessToken({
|
|
38
|
+
clientId: normalizeOptionalString(raw.clientId) ?? config.oauth.clientId,
|
|
39
|
+
clientSecret: normalizeOptionalString(raw.clientSecret) ?? config.oauth.clientSecret,
|
|
40
|
+
refreshToken: normalizeOptionalString(raw.refreshToken) ?? config.oauth.refreshToken,
|
|
41
|
+
accessToken: normalizeOptionalString(raw.accessToken) ?? config.oauth.accessToken,
|
|
42
|
+
expiresAt: typeof raw.expiresAt === "number" ? raw.expiresAt : config.oauth.expiresAt
|
|
43
|
+
});
|
|
44
|
+
return {
|
|
45
|
+
source: "api",
|
|
46
|
+
token,
|
|
47
|
+
...await createGoogleMeetSpace({
|
|
48
|
+
accessToken: token.accessToken,
|
|
49
|
+
config: resolveCreateSpaceConfig(raw)
|
|
50
|
+
})
|
|
51
|
+
};
|
|
52
|
+
}
|
|
53
|
+
function hasGoogleMeetOAuth(config, raw) {
|
|
54
|
+
return Boolean(normalizeOptionalString(raw.accessToken) ?? normalizeOptionalString(raw.refreshToken) ?? config.oauth.accessToken ?? config.oauth.refreshToken);
|
|
55
|
+
}
|
|
56
|
+
async function createMeetFromParams(params) {
|
|
57
|
+
if (hasGoogleMeetOAuth(params.config, params.raw)) {
|
|
58
|
+
const { token: _token, ...result } = await createSpaceFromParams(params.config, params.raw);
|
|
59
|
+
return {
|
|
60
|
+
...result,
|
|
61
|
+
joined: false,
|
|
62
|
+
nextAction: "URL-only creation was requested. Call google_meet with action=join and url=meetingUri to enter the meeting."
|
|
63
|
+
};
|
|
64
|
+
}
|
|
65
|
+
if (hasCreateSpaceConfigInput(params.raw)) throw new Error("Google Meet access policy options require OAuth/API room creation. Configure Google Meet OAuth or remove accessType/entryPointAccess.");
|
|
66
|
+
const browser = await createMeetWithBrowserProxyOnNode({
|
|
67
|
+
runtime: params.runtime,
|
|
68
|
+
config: params.config
|
|
69
|
+
});
|
|
70
|
+
return {
|
|
71
|
+
source: browser.source,
|
|
72
|
+
meetingUri: browser.meetingUri,
|
|
73
|
+
joined: false,
|
|
74
|
+
nextAction: "URL-only creation was requested. Call google_meet with action=join and url=meetingUri to enter the meeting.",
|
|
75
|
+
space: {
|
|
76
|
+
name: `browser/${browser.meetingUri.split("/").pop()}`,
|
|
77
|
+
meetingUri: browser.meetingUri
|
|
78
|
+
},
|
|
79
|
+
browser: {
|
|
80
|
+
nodeId: browser.nodeId,
|
|
81
|
+
targetId: browser.targetId,
|
|
82
|
+
browserUrl: browser.browserUrl,
|
|
83
|
+
browserTitle: browser.browserTitle,
|
|
84
|
+
notes: browser.notes
|
|
85
|
+
}
|
|
86
|
+
};
|
|
87
|
+
}
|
|
88
|
+
async function createAndJoinMeetFromParams(params) {
|
|
89
|
+
const created = await createMeetFromParams(params);
|
|
90
|
+
const join = await (await params.ensureRuntime()).join({
|
|
91
|
+
url: created.meetingUri,
|
|
92
|
+
transport: normalizeTransport(params.raw.transport),
|
|
93
|
+
mode: normalizeMode(params.raw.mode),
|
|
94
|
+
dialInNumber: normalizeOptionalString(params.raw.dialInNumber),
|
|
95
|
+
pin: normalizeOptionalString(params.raw.pin),
|
|
96
|
+
dtmfSequence: normalizeOptionalString(params.raw.dtmfSequence),
|
|
97
|
+
message: normalizeOptionalString(params.raw.message),
|
|
98
|
+
requesterSessionKey: normalizeOptionalString(params.raw.requesterSessionKey)
|
|
99
|
+
});
|
|
100
|
+
return {
|
|
101
|
+
...created,
|
|
102
|
+
joined: true,
|
|
103
|
+
nextAction: "Share meetingUri with participants; the Klaw agent has started the join flow.",
|
|
104
|
+
join
|
|
105
|
+
};
|
|
106
|
+
}
|
|
107
|
+
//#endregion
|
|
108
|
+
export { createAndJoinMeetFromParams, createMeetFromParams, hasCreateSpaceConfigInput, resolveCreateSpaceConfig };
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
//#region extensions/google-meet/src/config-compat.ts
|
|
2
|
+
function asRecord(value) {
|
|
3
|
+
return value && typeof value === "object" && !Array.isArray(value) ? value : null;
|
|
4
|
+
}
|
|
5
|
+
function normalizeProviderId(value) {
|
|
6
|
+
return typeof value === "string" && value.trim() ? value.trim().toLowerCase() : void 0;
|
|
7
|
+
}
|
|
8
|
+
function hasOwn(record, key) {
|
|
9
|
+
return Object.prototype.hasOwnProperty.call(record, key);
|
|
10
|
+
}
|
|
11
|
+
function hasLegacyGoogleRealtimeProvider(value) {
|
|
12
|
+
const realtime = asRecord(value);
|
|
13
|
+
if (!realtime || normalizeProviderId(realtime.provider) !== "google") return false;
|
|
14
|
+
return !hasOwn(realtime, "voiceProvider") || !hasOwn(realtime, "transcriptionProvider");
|
|
15
|
+
}
|
|
16
|
+
const legacyConfigRules = [{
|
|
17
|
+
path: [
|
|
18
|
+
"plugins",
|
|
19
|
+
"entries",
|
|
20
|
+
"google-meet",
|
|
21
|
+
"config",
|
|
22
|
+
"realtime"
|
|
23
|
+
],
|
|
24
|
+
message: "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\".",
|
|
25
|
+
match: hasLegacyGoogleRealtimeProvider
|
|
26
|
+
}];
|
|
27
|
+
function migrateGoogleMeetLegacyRealtimeProvider(config) {
|
|
28
|
+
const rawRealtime = asRecord(asRecord(asRecord(config.plugins?.entries?.["google-meet"])?.config)?.realtime);
|
|
29
|
+
if (!rawRealtime || !hasLegacyGoogleRealtimeProvider(rawRealtime)) return null;
|
|
30
|
+
const nextConfig = structuredClone(config);
|
|
31
|
+
const nextPlugins = asRecord(nextConfig.plugins) ?? {};
|
|
32
|
+
nextConfig.plugins = nextPlugins;
|
|
33
|
+
const nextEntries = asRecord(nextPlugins.entries) ?? {};
|
|
34
|
+
nextPlugins.entries = nextEntries;
|
|
35
|
+
const nextEntry = asRecord(nextEntries["google-meet"]) ?? {};
|
|
36
|
+
nextEntries["google-meet"] = nextEntry;
|
|
37
|
+
const nextPluginConfig = asRecord(nextEntry.config) ?? {};
|
|
38
|
+
nextEntry.config = nextPluginConfig;
|
|
39
|
+
const nextRealtime = asRecord(nextPluginConfig.realtime) ?? {};
|
|
40
|
+
nextPluginConfig.realtime = nextRealtime;
|
|
41
|
+
nextRealtime.provider = "openai";
|
|
42
|
+
if (!hasOwn(nextRealtime, "transcriptionProvider")) nextRealtime.transcriptionProvider = "openai";
|
|
43
|
+
if (!hasOwn(nextRealtime, "voiceProvider")) nextRealtime.voiceProvider = "google";
|
|
44
|
+
return {
|
|
45
|
+
config: nextConfig,
|
|
46
|
+
changes: ["Moved Google Meet legacy realtime.provider=\"google\" intent to realtime.voiceProvider=\"google\" and realtime.transcriptionProvider=\"openai\"."]
|
|
47
|
+
};
|
|
48
|
+
}
|
|
49
|
+
function normalizeCompatibilityConfig({ cfg }) {
|
|
50
|
+
return migrateGoogleMeetLegacyRealtimeProvider(cfg) ?? {
|
|
51
|
+
config: cfg,
|
|
52
|
+
changes: []
|
|
53
|
+
};
|
|
54
|
+
}
|
|
55
|
+
//#endregion
|
|
56
|
+
export { legacyConfigRules, normalizeCompatibilityConfig };
|