@openclaw/google-meet 2026.10.10 → 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.
- package/assets/activity.svg +1 -1
- package/dist/.setup/{chrome-create-DIcW4QCh.mjs → chrome-create-BlDlV2YP.mjs} +11 -30
- package/dist/.setup/{cli-9linTFHb.mjs → cli-C-MrY7IZ.mjs} +275 -309
- package/dist/.setup/{cli-export-CaDYoSP8.mjs → cli-export-6eiywS3T.mjs} +16 -35
- package/dist/.setup/{cli-output-mode-BJSm88N9.mjs → cli-output-mode-DztqqVeZ.mjs} +5 -6
- package/dist/.setup/config-CMTw0Anh.mjs +110 -0
- package/dist/.setup/{create-D3fHR8uX.mjs → create-DMk4zbMq.mjs} +23 -9
- package/dist/.setup/{google-meet-platform-adapter-D7poqL1J.mjs → google-meet-platform-adapter-DgchqNLV.mjs} +52 -18
- package/dist/.setup/{node-host-B196lvNZ.mjs → node-host-BIZD9InM.mjs} +2 -2
- package/dist/.setup/{node-invoke-policy-BzRAe25r.mjs → node-invoke-policy-bg7p_BWB.mjs} +1 -1
- package/dist/.setup/oauth-DZkuGMs1.mjs +1 -0
- package/dist/.setup/{plugin-helpers-Buhixxsx.mjs → plugin-helpers-ChCBuyAl.mjs} +363 -69
- package/dist/.setup/{plugin-registration-B_nOxAym.mjs → plugin-registration-CAW7_zO_.mjs} +8 -8
- package/dist/.setup/{runtime-D-dwEsSW.mjs → runtime-Cyc6bv1i.mjs} +37 -38
- package/dist/.source-module-urls/c06239f68b6f4959b5d3db7e0cee004911d8eb43092f4135c729b507e37f6333.json +1 -1
- package/dist/cli-metadata.js +1 -1
- package/dist/doctor-contract-api.js +25 -21
- package/dist/index.js +14 -13
- package/node_modules/typebox/build/format/duration.d.mts +2 -2
- package/node_modules/typebox/build/format/duration.mjs +2 -2
- package/node_modules/typebox/build/format/idn_email.d.mts +1 -0
- package/node_modules/typebox/build/format/idn_email.mjs +1 -0
- package/node_modules/typebox/build/format/idn_hostname.d.mts +1 -1
- package/node_modules/typebox/build/format/idn_hostname.mjs +1 -1
- package/node_modules/typebox/build/format/ipv4.d.mts +2 -2
- package/node_modules/typebox/build/format/ipv4.mjs +2 -2
- package/node_modules/typebox/build/format/ipv6.d.mts +1 -1
- package/node_modules/typebox/build/format/ipv6.mjs +1 -1
- package/node_modules/typebox/build/format/relative_json_pointer.d.mts +2 -2
- package/node_modules/typebox/build/format/relative_json_pointer.mjs +2 -2
- package/node_modules/typebox/build/schema/build.mjs +1 -0
- package/node_modules/typebox/build/schema/engine/_unique.d.mts +4 -2
- package/node_modules/typebox/build/schema/engine/_unique.mjs +7 -3
- package/node_modules/typebox/build/schema/engine/additionalItems.mjs +3 -3
- package/node_modules/typebox/build/schema/engine/additionalProperties.d.mts +0 -3
- package/node_modules/typebox/build/schema/engine/additionalProperties.mjs +15 -17
- package/node_modules/typebox/build/schema/engine/contains.mjs +3 -3
- package/node_modules/typebox/build/schema/engine/index.d.mts +1 -0
- package/node_modules/typebox/build/schema/engine/index.mjs +1 -0
- package/node_modules/typebox/build/schema/engine/items.mjs +7 -4
- package/node_modules/typebox/build/schema/engine/maxContains.mjs +2 -2
- package/node_modules/typebox/build/schema/engine/minContains.mjs +3 -3
- package/node_modules/typebox/build/schema/engine/oneOf.mjs +2 -2
- package/node_modules/typebox/build/schema/engine/patternProperties.mjs +2 -2
- package/node_modules/typebox/build/schema/engine/propertyNames.mjs +2 -2
- package/node_modules/typebox/build/schema/engine/unevaluatedItems.mjs +2 -2
- package/node_modules/typebox/build/schema/engine/unevaluatedProperties.mjs +2 -2
- package/node_modules/typebox/build/system/hashing/hash.mjs +63 -34
- package/node_modules/typebox/build/system/locale/en_US.mjs +2 -1
- package/node_modules/typebox/build/system/memory/assign.d.mts +2 -8
- package/node_modules/typebox/build/system/memory/assign.mjs +13 -6
- package/node_modules/typebox/build/system/memory/clone.d.mts +4 -5
- package/node_modules/typebox/build/system/memory/clone.mjs +8 -96
- package/node_modules/typebox/build/system/memory/create.d.mts +1 -5
- package/node_modules/typebox/build/system/memory/create.mjs +18 -13
- package/node_modules/typebox/build/system/memory/deep.d.mts +2 -0
- package/node_modules/typebox/build/system/memory/deep.mjs +108 -0
- package/node_modules/typebox/build/system/memory/discard.d.mts +1 -1
- package/node_modules/typebox/build/system/memory/discard.mjs +9 -8
- package/node_modules/typebox/build/system/memory/finalize.d.mts +4 -0
- package/node_modules/typebox/build/system/memory/finalize.mjs +30 -0
- package/node_modules/typebox/build/system/memory/keys.d.mts +2 -0
- package/node_modules/typebox/build/system/memory/keys.mjs +8 -0
- package/node_modules/typebox/build/system/memory/update.d.mts +1 -4
- package/node_modules/typebox/build/system/memory/update.mjs +43 -16
- package/node_modules/typebox/build/type/engine/call/index.d.mts +1 -0
- package/node_modules/typebox/build/type/engine/call/index.mjs +1 -0
- package/node_modules/typebox/build/type/engine/evaluate/composite.d.mts +2 -24
- package/node_modules/typebox/build/type/engine/evaluate/composite.mjs +2 -29
- package/node_modules/typebox/build/type/engine/evaluate/index.d.mts +1 -0
- package/node_modules/typebox/build/type/engine/evaluate/index.mjs +1 -0
- package/node_modules/typebox/build/type/engine/evaluate/narrow.d.mts +5 -1
- package/node_modules/typebox/build/type/engine/evaluate/narrow.mjs +6 -1
- package/node_modules/typebox/build/type/engine/evaluate/property.d.mts +30 -0
- package/node_modules/typebox/build/type/engine/evaluate/property.mjs +29 -0
- package/node_modules/typebox/build/type/engine/immutable/instantiate_add.d.mts +1 -3
- package/node_modules/typebox/build/type/engine/immutable/instantiate_add.mjs +1 -4
- package/node_modules/typebox/build/type/engine/object/from_intersect.d.mts +2 -2
- package/node_modules/typebox/build/type/engine/object/from_intersect.mjs +2 -2
- package/node_modules/typebox/build/type/engine/object/from_union.d.mts +2 -2
- package/node_modules/typebox/build/type/engine/object/from_union.mjs +2 -2
- package/node_modules/typebox/build/type/engine/optional/instantiate_add.d.mts +1 -3
- package/node_modules/typebox/build/type/engine/optional/instantiate_add.mjs +1 -4
- package/node_modules/typebox/build/type/engine/readonly/instantiate_add.d.mts +1 -3
- package/node_modules/typebox/build/type/engine/readonly/instantiate_add.mjs +1 -4
- package/node_modules/typebox/build/type/engine/this/index.d.mts +1 -0
- package/node_modules/typebox/build/type/engine/this/index.mjs +1 -0
- package/node_modules/typebox/build/value/clone/clone.d.mts +4 -3
- package/node_modules/typebox/build/value/clone/clone.mjs +5 -7
- package/node_modules/typebox/build/value/repair/from_cyclic.d.mts +2 -0
- package/node_modules/typebox/build/value/repair/from_cyclic.mjs +6 -0
- package/node_modules/typebox/build/value/shared/union_priority_sort.mjs +25 -14
- package/node_modules/typebox/package.json +1 -1
- package/node_modules/typebox/readme.md +1 -1
- package/package.json +5 -5
- package/dist/.setup/config-Cu3zsl_3.mjs +0 -239
- package/dist/.setup/oauth-DGv28ZgA.mjs +0 -158
- package/node_modules/typebox/build/system/memory/freeze.d.mts +0 -4
- package/node_modules/typebox/build/system/memory/freeze.mjs +0 -6
|
@@ -1,39 +1,18 @@
|
|
|
1
1
|
import { n as GOOGLE_MEET_NODE_COMMAND, t as GOOGLE_MEET_BROWSER_NODE_ADAPTER } from "./google-meet-platform-constants-C83Cdmpd.mjs";
|
|
2
2
|
import { t as normalizeMeetUrl } from "./meet-url-DzLdrq0Z.mjs";
|
|
3
|
-
import {
|
|
4
|
-
import { n as normalizeDialInNumber, t as GOOGLE_MEET_PLATFORM_ADAPTER } from "./google-meet-platform-adapter-D7poqL1J.mjs";
|
|
3
|
+
import { n as normalizeDialInNumber, t as GOOGLE_MEET_PLATFORM_ADAPTER } from "./google-meet-platform-adapter-DgchqNLV.mjs";
|
|
5
4
|
import { asOptionalRecord, asRecord, normalizeOptionalString, uniqueStrings } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
6
5
|
import { formatErrorMessage } from "openclaw/plugin-sdk/error-runtime";
|
|
7
6
|
import path from "node:path";
|
|
8
7
|
import { isBlockedHostnameOrIp } from "openclaw/plugin-sdk/ssrf-runtime";
|
|
9
8
|
import { GatewayClient, startGatewayClientWhenEventLoopReady } from "openclaw/plugin-sdk/gateway-runtime";
|
|
10
9
|
import { raceWithTimeout } from "openclaw/plugin-sdk/time-runtime";
|
|
11
|
-
import { MeetingPlatformAdapter, MeetingSessionRuntime, addMeetingSetupCheck, createMeetingSession, createMeetingSetupStatus, createMeetingVoiceCallGateway, endMeetingVoiceCallGatewayCall, getMeetingVoiceCallGatewayCall, isMeetingVoiceCallMissingError, joinMeetingViaVoiceCallGateway, leaveMeetingWithBrowser, readMeetingTranscriptWithBrowser, recoverMeetingBrowserTab, resolveLocalMeetingBrowserRequest, speakMeetingViaVoiceCallGateway } from "openclaw/plugin-sdk/meeting-runtime";
|
|
10
|
+
import { MeetingPlatformAdapter, MeetingSessionRuntime, addMeetingSetupCheck, callMeetingBrowserProxyOnNode, createMeetingSession, createMeetingSetupStatus, createMeetingVoiceCallGateway, endMeetingVoiceCallGatewayCall, getMeetingVoiceCallGatewayCall, isMeetingVoiceCallMissingError, joinMeetingViaVoiceCallGateway, leaveMeetingWithBrowser, readMeetingTranscriptWithBrowser, recoverMeetingBrowserTab, resolveLocalMeetingBrowserRequest, resolveMeetingBrowserNode, resolveMeetingBrowserNodeInfo, speakMeetingViaVoiceCallGateway } from "openclaw/plugin-sdk/meeting-runtime";
|
|
12
11
|
import { resolveDefaultAgentId } from "openclaw/plugin-sdk/agent-runtime";
|
|
13
12
|
import { normalizeAgentId } from "openclaw/plugin-sdk/routing";
|
|
14
13
|
import fs from "node:fs";
|
|
15
14
|
import os from "node:os";
|
|
16
15
|
import { resolveTranscriptsConfig } from "openclaw/plugin-sdk/transcripts";
|
|
17
|
-
// extensions/google-meet/src/runtime-probes.ts
|
|
18
|
-
const probes = MeetingPlatformAdapter.createRuntimeProbes({
|
|
19
|
-
defaultSpeechMessage: "Say exactly: Google Meet speech test complete.",
|
|
20
|
-
invalidRequest: (message) => new Error(message),
|
|
21
|
-
resolveTimeoutMs: MeetingPlatformAdapter.resolveProbeTimeoutMs,
|
|
22
|
-
shouldWaitForListening: (session) => Boolean((session.transport === "chrome" || session.transport === "chrome-node") && session.chrome?.launched),
|
|
23
|
-
talkBackMode: MeetingPlatformAdapter.isTalkBackMode,
|
|
24
|
-
normalizeUrl: normalizeMeetUrl,
|
|
25
|
-
resolveRequestMode: (mode) => mode === "realtime" ? "agent" : mode,
|
|
26
|
-
defaultTransport: (config) => config.defaultTransport,
|
|
27
|
-
validateListeningTransport: (transport) => {
|
|
28
|
-
if (transport === "twilio") throw new Error("test_listen supports chrome or chrome-node transports");
|
|
29
|
-
},
|
|
30
|
-
resolveSpeechTimeoutMs: (_request, config) => Math.min(config.chrome.joinTimeoutMs, 5e3),
|
|
31
|
-
refreshCaptionHealth: async (context, session) => await context.refreshCaptionHealth(session),
|
|
32
|
-
speechModeError: "test_speech requires mode: agent or bidi; use join mode: transcribe for observe-only sessions.",
|
|
33
|
-
listeningModeError: "test_listen requires mode: transcribe; use test_speech for talk-back sessions."
|
|
34
|
-
});
|
|
35
|
-
const testGoogleMeetListening = probes.testListening;
|
|
36
|
-
const testGoogleMeetSpeech = probes.testSpeech;
|
|
37
16
|
// extensions/google-meet/src/setup.ts
|
|
38
17
|
function resolveUserPath(input) {
|
|
39
18
|
if (input === "~") return os.homedir();
|
|
@@ -79,7 +58,6 @@ function getVoiceCallWebhookExposureCheck(voiceCallConfig) {
|
|
|
79
58
|
}
|
|
80
59
|
function getGoogleMeetSetupStatus(config, options) {
|
|
81
60
|
const checks = [];
|
|
82
|
-
const env = options?.env ?? process.env;
|
|
83
61
|
const fullConfig = asRecord(options?.fullConfig);
|
|
84
62
|
const mode = options?.mode ?? config.defaultMode;
|
|
85
63
|
const transport = options?.transport ?? config.defaultTransport;
|
|
@@ -91,10 +69,11 @@ function getGoogleMeetSetupStatus(config, options) {
|
|
|
91
69
|
const voiceCallTwilioConfig = asRecord(voiceCallConfig.twilio);
|
|
92
70
|
if (config.auth.tokenPath) {
|
|
93
71
|
const tokenPath = resolveUserPath(config.auth.tokenPath);
|
|
72
|
+
const tokenExists = fs.existsSync(tokenPath);
|
|
94
73
|
checks.push({
|
|
95
74
|
id: "google-oauth-token",
|
|
96
|
-
ok:
|
|
97
|
-
message:
|
|
75
|
+
ok: tokenExists,
|
|
76
|
+
message: tokenExists ? "Google OAuth token file found" : `Google OAuth token file missing at ${config.auth.tokenPath}`
|
|
98
77
|
});
|
|
99
78
|
} else checks.push({
|
|
100
79
|
id: "google-oauth-token",
|
|
@@ -154,9 +133,9 @@ function getGoogleMeetSetupStatus(config, options) {
|
|
|
154
133
|
message: voiceCallAllowed && voiceCallEnabled ? "Twilio transport can delegate dialing to the voice-call plugin" : "Enable plugins.entries.voice-call and include voice-call in plugins.allow for Twilio dialing"
|
|
155
134
|
});
|
|
156
135
|
if ((normalizeOptionalString(voiceCallConfig.provider) ?? "twilio") === "twilio") {
|
|
157
|
-
const accountSid = resolveVoiceCallSetupValue(voiceCallTwilioConfig.accountSid, env.TWILIO_ACCOUNT_SID);
|
|
158
|
-
const authToken = resolveVoiceCallSetupValue(voiceCallTwilioConfig.authToken, env.TWILIO_AUTH_TOKEN);
|
|
159
|
-
const fromNumber = resolveVoiceCallSetupValue(voiceCallConfig.fromNumber, env.TWILIO_FROM_NUMBER);
|
|
136
|
+
const accountSid = resolveVoiceCallSetupValue(voiceCallTwilioConfig.accountSid, process.env.TWILIO_ACCOUNT_SID);
|
|
137
|
+
const authToken = resolveVoiceCallSetupValue(voiceCallTwilioConfig.authToken, process.env.TWILIO_AUTH_TOKEN);
|
|
138
|
+
const fromNumber = resolveVoiceCallSetupValue(voiceCallConfig.fromNumber, process.env.TWILIO_FROM_NUMBER);
|
|
160
139
|
const twilioReady = Boolean(accountSid && authToken && fromNumber);
|
|
161
140
|
checks.push({
|
|
162
141
|
id: "twilio-voice-call-credentials",
|
|
@@ -191,17 +170,19 @@ async function resolveChromeBrowserRoute(params) {
|
|
|
191
170
|
transport: "chrome",
|
|
192
171
|
callBrowser: await resolveLocalMeetingBrowserRequest(params.runtime)
|
|
193
172
|
};
|
|
194
|
-
const nodeId = params.nodeId ?? await
|
|
173
|
+
const nodeId = params.nodeId ?? await resolveMeetingBrowserNode({
|
|
195
174
|
runtime: params.runtime,
|
|
196
|
-
requestedNode: params.config.chromeNode.node
|
|
175
|
+
requestedNode: params.config.chromeNode.node,
|
|
176
|
+
adapter: GOOGLE_MEET_BROWSER_NODE_ADAPTER
|
|
197
177
|
});
|
|
198
178
|
return {
|
|
199
179
|
transport: "chrome-node",
|
|
200
180
|
nodeId,
|
|
201
|
-
callBrowser: (request) =>
|
|
181
|
+
callBrowser: (request) => callMeetingBrowserProxyOnNode({
|
|
202
182
|
...request,
|
|
203
183
|
runtime: params.runtime,
|
|
204
|
-
nodeId
|
|
184
|
+
nodeId,
|
|
185
|
+
adapter: GOOGLE_MEET_BROWSER_NODE_ADAPTER
|
|
205
186
|
})
|
|
206
187
|
};
|
|
207
188
|
}
|
|
@@ -281,9 +262,10 @@ async function getGoogleMeetRuntimeSetupStatus(params) {
|
|
|
281
262
|
twilioDialInNumber
|
|
282
263
|
});
|
|
283
264
|
if (shouldCheckChromeNode) try {
|
|
284
|
-
const node = await
|
|
265
|
+
const node = await resolveMeetingBrowserNodeInfo({
|
|
285
266
|
runtime: params.runtime,
|
|
286
|
-
requestedNode: params.config.chromeNode.node
|
|
267
|
+
requestedNode: params.config.chromeNode.node,
|
|
268
|
+
adapter: GOOGLE_MEET_BROWSER_NODE_ADAPTER
|
|
287
269
|
});
|
|
288
270
|
const label = node.displayName ?? node.remoteIp ?? node.nodeId ?? "connected node";
|
|
289
271
|
status = addMeetingSetupCheck(status, {
|
|
@@ -411,6 +393,23 @@ async function joinMeetViaVoiceCallGateway(params) {
|
|
|
411
393
|
});
|
|
412
394
|
}
|
|
413
395
|
// extensions/google-meet/src/runtime.ts
|
|
396
|
+
const probes = MeetingPlatformAdapter.createRuntimeProbes({
|
|
397
|
+
defaultSpeechMessage: "Say exactly: Google Meet speech test complete.",
|
|
398
|
+
invalidRequest: (message) => new Error(message),
|
|
399
|
+
resolveTimeoutMs: MeetingPlatformAdapter.resolveProbeTimeoutMs,
|
|
400
|
+
shouldWaitForListening: (session) => Boolean((session.transport === "chrome" || session.transport === "chrome-node") && session.chrome?.launched),
|
|
401
|
+
talkBackMode: MeetingPlatformAdapter.isTalkBackMode,
|
|
402
|
+
normalizeUrl: normalizeMeetUrl,
|
|
403
|
+
resolveRequestMode: (mode) => mode === "realtime" ? "agent" : mode,
|
|
404
|
+
defaultTransport: (config) => config.defaultTransport,
|
|
405
|
+
validateListeningTransport: (transport) => {
|
|
406
|
+
if (transport === "twilio") throw new Error("test_listen supports chrome or chrome-node transports");
|
|
407
|
+
},
|
|
408
|
+
resolveSpeechTimeoutMs: (_request, config) => Math.min(config.chrome.joinTimeoutMs, 5e3),
|
|
409
|
+
refreshCaptionHealth: async (context, session) => await context.refreshCaptionHealth(session),
|
|
410
|
+
speechModeError: "test_speech requires mode: agent or bidi; use join mode: transcribe for observe-only sessions.",
|
|
411
|
+
listeningModeError: "test_listen requires mode: transcribe; use test_speech for talk-back sessions."
|
|
412
|
+
});
|
|
414
413
|
const nowIso = () => (/* @__PURE__ */ new Date()).toISOString();
|
|
415
414
|
function isBrowserTransport(transport) {
|
|
416
415
|
return transport === "chrome" || transport === "chrome-node";
|
|
@@ -564,10 +563,10 @@ var GoogleMeetRuntime = class extends MeetingSessionRuntime {
|
|
|
564
563
|
});
|
|
565
564
|
}
|
|
566
565
|
async testSpeech(request) {
|
|
567
|
-
return await
|
|
566
|
+
return await probes.testSpeech(this.#probeContext(), request);
|
|
568
567
|
}
|
|
569
568
|
async testListen(request) {
|
|
570
|
-
return await
|
|
569
|
+
return await probes.testListening(this.#probeContext(), request);
|
|
571
570
|
}
|
|
572
571
|
#probeContext() {
|
|
573
572
|
return {
|
|
@@ -639,7 +638,7 @@ var GoogleMeetRuntime = class extends MeetingSessionRuntime {
|
|
|
639
638
|
const dialInNumber = dialPlan.number;
|
|
640
639
|
if (!dialInNumber) throw new Error("Twilio transport requires a Meet dial-in phone number. Google Meet URLs do not include dial-in details; pass dialInNumber with optional pin/dtmfSequence, configure twilio.defaultDialInNumber, or use chrome/chrome-node transport.");
|
|
641
640
|
const dtmfSequence = dialPlan.dtmfSequence;
|
|
642
|
-
const delegatedAgentId = Boolean(normalizeOptionalString(request.agentId) ||
|
|
641
|
+
const delegatedAgentId = Boolean(normalizeOptionalString(request.agentId) || this.params.config.realtime.agentId) ? session.agentId : void 0;
|
|
643
642
|
const voiceCallResult = this.params.config.voiceCall.enabled ? await joinMeetViaVoiceCallGateway({
|
|
644
643
|
config: this.params.config,
|
|
645
644
|
gateway: this.#voiceCallGateway,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"entries":[{"output":"cli-metadata.js","source":"extensions/google-meet/cli-metadata.ts"},{"output":"doctor-contract-api.js","source":"extensions/google-meet/doctor-contract-api.ts"},{"output":"index.js","source":"extensions/google-meet/index.ts"}],"chunks":[{"output":".setup/chrome-create-
|
|
1
|
+
{"version":3,"entries":[{"output":"cli-metadata.js","source":"extensions/google-meet/cli-metadata.ts"},{"output":"doctor-contract-api.js","source":"extensions/google-meet/doctor-contract-api.ts"},{"output":"index.js","source":"extensions/google-meet/index.ts"}],"chunks":[{"output":".setup/chrome-create-BlDlV2YP.mjs","sha256":"834e56ae40cb8a5c5a75ef751d1bb37e380984fec7a5edc933f7e1695a0e40ac","facadeSource":null,"sources":["extensions/google-meet/src/transports/chrome-create.ts","extensions/google-meet/src/transports/google-meet-urls.ts"]},{"output":".setup/cli-C-MrY7IZ.mjs","sha256":"02683da2e7dc06cef32b6d05facf00a196e589399bb92c426622940592807d25","facadeSource":"extensions/google-meet/src/cli.ts","sources":["extensions/google-meet/src/cli-command-context.ts","extensions/google-meet/src/cli-space-commands.ts","extensions/google-meet/src/cli.ts"]},{"output":".setup/cli-export-6eiywS3T.mjs","sha256":"eb72cb8f66a3e28287ff6433e391fbd470fb194ebd832f1733a11e2214ba56f9","facadeSource":"extensions/google-meet/src/cli-export.ts","sources":["extensions/google-meet/src/cli-export.ts","extensions/google-meet/src/cli-shared.ts"]},{"output":".setup/cli-output-mode-DztqqVeZ.mjs","sha256":"48a602e741be8cca54f9381179c40df1b80d0b6eddf6d0d5cc7c30bedcd8bc74","facadeSource":null,"sources":["extensions/google-meet/src/cli-output-mode.ts"]},{"output":".setup/config-CMTw0Anh.mjs","sha256":"dc7f286e9e3ab95f5167b4693cce6a8f19c82bf0dbcdfa1423ca3f6583c2b7bf","facadeSource":null,"sources":["extensions/google-meet/src/config.ts"]},{"output":".setup/create-DMk4zbMq.mjs","sha256":"12b4896142e9336b9b704fcf8a3eff824a1092f08a0654522e96a43d9ea98dbf","facadeSource":null,"sources":["extensions/google-meet/src/create.ts"]},{"output":".setup/google-api-B5FR9zy2.mjs","sha256":"a86efec8f6f1fdb4ee4da31a51b90ccdeaa6bc1240e6c6713ba34867fbb4c7be","facadeSource":null,"sources":["extensions/google-meet/src/google-api.ts"]},{"output":".setup/google-meet-platform-adapter-DgchqNLV.mjs","sha256":"c0d03152d1c8d96b36f4b09bb7363d4c0c500af88939334a4dc6641d03ce485f","facadeSource":null,"sources":["extensions/google-meet/src/transports/google-meet-caption-observer-source.ts","extensions/google-meet/src/transports/google-meet-caption-scripts.ts","extensions/google-meet/src/transports/google-meet-page-scripts.ts","extensions/google-meet/src/transports/google-meet-platform-adapter.ts","extensions/google-meet/src/transports/twilio.ts","extensions/google-meet/src/transports/types.ts"]},{"output":".setup/google-meet-platform-constants-C83Cdmpd.mjs","sha256":"13b40b9ac51fefa397f235f02dcc00e803083090c5fccfd73dc2e87f919e0a62","facadeSource":null,"sources":["extensions/google-meet/src/browser-manual-action-error.ts","extensions/google-meet/src/transports/google-meet-platform-constants.ts"]},{"output":".setup/meet-url-DzLdrq0Z.mjs","sha256":"97b073e80c8e8f44de27642813aa477c186473870495d3ff4913a7b58209ce6e","facadeSource":null,"sources":["extensions/google-meet/src/meet-url.ts"]},{"output":".setup/node-host-BIZD9InM.mjs","sha256":"fb73b5e2446b85a52c523164c662f7f95eb02559352f07f05bb0ae176e93731e","facadeSource":"extensions/google-meet/src/node-host.ts","sources":["extensions/google-meet/src/node-host.ts"]},{"output":".setup/node-invoke-policy-bg7p_BWB.mjs","sha256":"b675daca2c94c89299f3d9f671b2c9c33440132504effd2cfc3147cf563463a1","facadeSource":"extensions/google-meet/src/node-invoke-policy.ts","sources":["extensions/google-meet/src/node-invoke-policy.ts"]},{"output":".setup/oauth-DZkuGMs1.mjs","sha256":"7745140a4db9c3e5608932ef60198338bb5899896c986787471130990a2f6043","facadeSource":"extensions/google-meet/src/oauth.ts","sources":[]},{"output":".setup/plugin-helpers-ChCBuyAl.mjs","sha256":"5422ec3b70901d40b80d10867bb6561dc39110a3034e6f2ca7d2a79f6076b338","facadeSource":"extensions/google-meet/src/plugin-helpers.ts","sources":["extensions/google-meet/src/calendar.ts","extensions/google-meet/src/drive.ts","extensions/google-meet/src/meet-api.ts","extensions/google-meet/src/meet.ts","extensions/google-meet/src/oauth-owner.ts","extensions/google-meet/src/oauth.ts","extensions/google-meet/src/plugin-helpers.ts"]},{"output":".setup/plugin-registration-CAW7_zO_.mjs","sha256":"a6c39ccc16af063e374b26eadce495178b4307239b4e6bed9ca5048f97699e66","facadeSource":null,"sources":["extensions/google-meet/src/plugin-registration.ts"]},{"output":".setup/runtime-Cyc6bv1i.mjs","sha256":"9b18cfd9179f15021377d2a70054d75cb12856b72e5f1d7151cf0898b8d6dd2c","facadeSource":"extensions/google-meet/src/runtime.ts","sources":["extensions/google-meet/src/runtime-setup.ts","extensions/google-meet/src/runtime.ts","extensions/google-meet/src/setup.ts","extensions/google-meet/src/transports/chrome.ts","extensions/google-meet/src/voice-call-gateway.ts"]},{"output":"cli-metadata.js","sha256":"dad34e275e62cb3f51031cac343d176d82831f9e3e9c015bc8686e507abf2c31","facadeSource":"extensions/google-meet/cli-metadata.ts","sources":["extensions/google-meet/cli-metadata.ts"]},{"output":"doctor-contract-api.js","sha256":"fc3ece93285a1994ac8434d5196ac78319687f607e647ea9b6bc797650e1458a","facadeSource":"extensions/google-meet/doctor-contract-api.ts","sources":["extensions/google-meet/src/config-compat.ts"]},{"output":"index.js","sha256":"b17ecc698908fc2d3f8ad8877a230f85f186ad9c59786dc1e6ac4ab948fdd948","facadeSource":"extensions/google-meet/index.ts","sources":["extensions/google-meet/index.ts","extensions/google-meet/src/plugin-schema.ts"]}],"unrenderedSources":["extensions/google-meet/doctor-contract-api.ts"]}
|
package/dist/cli-metadata.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as GOOGLE_MEET_CLI_DESCRIPTOR } from "./.setup/cli-output-mode-
|
|
1
|
+
import { t as GOOGLE_MEET_CLI_DESCRIPTOR } from "./.setup/cli-output-mode-DztqqVeZ.mjs";
|
|
2
2
|
import { definePluginEntry } from "openclaw/plugin-sdk/plugin-entry";
|
|
3
3
|
// extensions/google-meet/cli-metadata.ts
|
|
4
4
|
var cli_metadata_default = definePluginEntry({
|
|
@@ -16,34 +16,38 @@ const legacyConfigRules = [{
|
|
|
16
16
|
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 \"openclaw doctor --fix\".",
|
|
17
17
|
match: hasLegacyGoogleRealtimeProvider
|
|
18
18
|
}];
|
|
19
|
-
function
|
|
19
|
+
function normalizeCompatibilityConfig({ cfg: config }) {
|
|
20
20
|
const rawEntry = asNullableRecord(config.plugins?.entries?.["google-meet"]);
|
|
21
21
|
const rawPluginConfig = asNullableRecord(rawEntry?.config);
|
|
22
22
|
const rawRealtime = asNullableRecord(rawPluginConfig?.realtime);
|
|
23
|
-
if (!rawRealtime || !hasLegacyGoogleRealtimeProvider(rawRealtime)) return
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
const
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
const nextPluginConfig = asNullableRecord(nextEntry.config) ?? {};
|
|
32
|
-
nextEntry.config = nextPluginConfig;
|
|
33
|
-
const nextRealtime = asNullableRecord(nextPluginConfig.realtime) ?? {};
|
|
34
|
-
nextPluginConfig.realtime = nextRealtime;
|
|
35
|
-
nextRealtime.provider = "openai";
|
|
23
|
+
if (!rawRealtime || !hasLegacyGoogleRealtimeProvider(rawRealtime)) return {
|
|
24
|
+
config,
|
|
25
|
+
changes: []
|
|
26
|
+
};
|
|
27
|
+
const nextRealtime = {
|
|
28
|
+
...rawRealtime,
|
|
29
|
+
provider: "openai"
|
|
30
|
+
};
|
|
36
31
|
if (!Object.hasOwn(nextRealtime, "transcriptionProvider")) nextRealtime.transcriptionProvider = "openai";
|
|
37
32
|
if (!Object.hasOwn(nextRealtime, "voiceProvider")) nextRealtime.voiceProvider = "google";
|
|
38
33
|
return {
|
|
39
|
-
config:
|
|
34
|
+
config: {
|
|
35
|
+
...config,
|
|
36
|
+
plugins: {
|
|
37
|
+
...config.plugins,
|
|
38
|
+
entries: {
|
|
39
|
+
...config.plugins?.entries,
|
|
40
|
+
"google-meet": {
|
|
41
|
+
...rawEntry,
|
|
42
|
+
config: {
|
|
43
|
+
...rawPluginConfig,
|
|
44
|
+
realtime: nextRealtime
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
},
|
|
40
50
|
changes: ["Moved Google Meet legacy realtime.provider=\"google\" intent to realtime.voiceProvider=\"google\" and realtime.transcriptionProvider=\"openai\"."]
|
|
41
51
|
};
|
|
42
52
|
}
|
|
43
|
-
function normalizeCompatibilityConfig({ cfg }) {
|
|
44
|
-
return migrateGoogleMeetLegacyRealtimeProvider(cfg) ?? {
|
|
45
|
-
config: cfg,
|
|
46
|
-
changes: []
|
|
47
|
-
};
|
|
48
|
-
}
|
|
49
53
|
export { legacyConfigRules, normalizeCompatibilityConfig };
|
package/dist/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { t as GOOGLE_MEET_CLI_DESCRIPTOR } from "./.setup/cli-output-mode-
|
|
1
|
+
import { t as GOOGLE_MEET_CLI_DESCRIPTOR } from "./.setup/cli-output-mode-DztqqVeZ.mjs";
|
|
2
2
|
import { n as GOOGLE_MEET_NODE_COMMAND } from "./.setup/google-meet-platform-constants-C83Cdmpd.mjs";
|
|
3
|
-
import { r as resolveGoogleMeetConfig } from "./.setup/config-
|
|
4
|
-
import { a as formatGoogleMeetGatewayError, c as loadGoogleMeetCreateModule, d as normalizeMode, f as normalizeTransport, g as shouldJoinCreatedMeet, h as sendGoogleMeetGatewayError, i as createLazyGoogleMeetNodeInvokePolicy, l as loadGoogleMeetNodeHostModule, m as resolveMeetingInput, n as callGoogleMeetGatewayFromTool, o as keepTrustedToolAgentId, p as readGoogleMeetParticipationParams, r as createGoogleMeetRuntimeAccessor, s as loadGoogleMeetCliModule, t as assertGoogleMeetAgentToolActionSupported, u as loadGoogleMeetPluginHelpers } from "./.setup/plugin-registration-
|
|
3
|
+
import { r as resolveGoogleMeetConfig } from "./.setup/config-CMTw0Anh.mjs";
|
|
4
|
+
import { a as formatGoogleMeetGatewayError, c as loadGoogleMeetCreateModule, d as normalizeMode, f as normalizeTransport, g as shouldJoinCreatedMeet, h as sendGoogleMeetGatewayError, i as createLazyGoogleMeetNodeInvokePolicy, l as loadGoogleMeetNodeHostModule, m as resolveMeetingInput, n as callGoogleMeetGatewayFromTool, o as keepTrustedToolAgentId, p as readGoogleMeetParticipationParams, r as createGoogleMeetRuntimeAccessor, s as loadGoogleMeetCliModule, t as assertGoogleMeetAgentToolActionSupported, u as loadGoogleMeetPluginHelpers } from "./.setup/plugin-registration-CAW7_zO_.mjs";
|
|
5
5
|
import { definePluginEntry } from "openclaw/plugin-sdk/plugin-entry";
|
|
6
6
|
import { asNonArrayRecord, normalizeOptionalString } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
7
7
|
import { jsonResult } from "openclaw/plugin-sdk/tool-results";
|
|
@@ -150,7 +150,7 @@ var google_meet_default = definePluginEntry({
|
|
|
150
150
|
const queryActions = {
|
|
151
151
|
latest: async (raw) => {
|
|
152
152
|
const helpers = await loadGoogleMeetPluginHelpers();
|
|
153
|
-
const token = await helpers.resolveGoogleMeetTokenFromParams(config, raw);
|
|
153
|
+
const token = await helpers.resolveGoogleMeetTokenFromParams(config, raw, api.runtime);
|
|
154
154
|
const resolved = await helpers.resolveMeetingFromParams({
|
|
155
155
|
config,
|
|
156
156
|
raw,
|
|
@@ -166,7 +166,7 @@ var google_meet_default = definePluginEntry({
|
|
|
166
166
|
},
|
|
167
167
|
calendar_events: async (raw) => {
|
|
168
168
|
const helpers = await loadGoogleMeetPluginHelpers();
|
|
169
|
-
const token = await helpers.resolveGoogleMeetTokenFromParams(config, raw);
|
|
169
|
+
const token = await helpers.resolveGoogleMeetTokenFromParams(config, raw, api.runtime);
|
|
170
170
|
const window = raw.today === true ? helpers.buildGoogleMeetCalendarDayWindow() : {};
|
|
171
171
|
return helpers.listGoogleMeetCalendarEvents({
|
|
172
172
|
accessToken: token.accessToken,
|
|
@@ -177,11 +177,11 @@ var google_meet_default = definePluginEntry({
|
|
|
177
177
|
},
|
|
178
178
|
artifacts: async (raw) => {
|
|
179
179
|
const helpers = await loadGoogleMeetPluginHelpers();
|
|
180
|
-
return helpers.fetchResolvedGoogleMeetArtifacts(await helpers.resolveArtifactQueryFromParams(config, raw));
|
|
180
|
+
return helpers.fetchResolvedGoogleMeetArtifacts(await helpers.resolveArtifactQueryFromParams(config, raw, api.runtime));
|
|
181
181
|
},
|
|
182
182
|
attendance: async (raw) => {
|
|
183
183
|
const helpers = await loadGoogleMeetPluginHelpers();
|
|
184
|
-
return helpers.fetchResolvedGoogleMeetAttendance(await helpers.resolveArtifactQueryFromParams(config, raw));
|
|
184
|
+
return helpers.fetchResolvedGoogleMeetAttendance(await helpers.resolveArtifactQueryFromParams(config, raw, api.runtime));
|
|
185
185
|
}
|
|
186
186
|
};
|
|
187
187
|
api.registerTranscriptSourceProvider({
|
|
@@ -251,7 +251,7 @@ var google_meet_default = definePluginEntry({
|
|
|
251
251
|
["googlemeet.attendance", "attendance"]
|
|
252
252
|
]) registerGatewayMethod(method, ({ params }) => queryActions[action](asNonArrayRecord(params)));
|
|
253
253
|
registerGatewayMethod("googlemeet.export", async ({ params }) => {
|
|
254
|
-
return (await loadGoogleMeetPluginHelpers()).exportGoogleMeetBundleFromParams(config, asNonArrayRecord(params));
|
|
254
|
+
return (await loadGoogleMeetPluginHelpers()).exportGoogleMeetBundleFromParams(config, asNonArrayRecord(params), api.runtime);
|
|
255
255
|
});
|
|
256
256
|
registerGatewayMethod("googlemeet.leave", async ({ params }) => {
|
|
257
257
|
const sessionId = requireSessionId(params);
|
|
@@ -260,7 +260,7 @@ var google_meet_default = definePluginEntry({
|
|
|
260
260
|
registerGatewayMethod("googlemeet.endActiveConference", async ({ params }) => {
|
|
261
261
|
const raw = asNonArrayRecord(params);
|
|
262
262
|
const helpers = await loadGoogleMeetPluginHelpers();
|
|
263
|
-
const token = await helpers.resolveGoogleMeetTokenFromParams(config, raw);
|
|
263
|
+
const token = await helpers.resolveGoogleMeetTokenFromParams(config, raw, api.runtime);
|
|
264
264
|
return helpers.endGoogleMeetActiveConference({
|
|
265
265
|
accessToken: token.accessToken,
|
|
266
266
|
meeting: resolveMeetingInput(config, raw.meeting)
|
|
@@ -323,12 +323,12 @@ var google_meet_default = definePluginEntry({
|
|
|
323
323
|
case "setup_status":
|
|
324
324
|
case "end_active_conference": break;
|
|
325
325
|
case "resolve_space": {
|
|
326
|
-
const { token: _token, ...result } = await (await loadGoogleMeetPluginHelpers()).resolveSpaceFromParams(config, raw);
|
|
326
|
+
const { token: _token, ...result } = await (await loadGoogleMeetPluginHelpers()).resolveSpaceFromParams(config, raw, api.runtime);
|
|
327
327
|
return jsonResult(result);
|
|
328
328
|
}
|
|
329
329
|
case "preflight": {
|
|
330
330
|
const helpers = await loadGoogleMeetPluginHelpers();
|
|
331
|
-
const { meeting, token, space } = await helpers.resolveSpaceFromParams(config, raw);
|
|
331
|
+
const { meeting, token, space } = await helpers.resolveSpaceFromParams(config, raw, api.runtime);
|
|
332
332
|
return jsonResult(helpers.buildGoogleMeetPreflightReport({
|
|
333
333
|
input: meeting,
|
|
334
334
|
space,
|
|
@@ -342,7 +342,7 @@ var google_meet_default = definePluginEntry({
|
|
|
342
342
|
case "attendance": return jsonResult(await queryActions[raw.action](raw));
|
|
343
343
|
case "export": {
|
|
344
344
|
const helpers = await loadGoogleMeetPluginHelpers();
|
|
345
|
-
return jsonResult(await helpers.exportGoogleMeetBundleFromParams(config, raw));
|
|
345
|
+
return jsonResult(await helpers.exportGoogleMeetBundleFromParams(config, raw, api.runtime));
|
|
346
346
|
}
|
|
347
347
|
case "participate":
|
|
348
348
|
readGoogleMeetParticipationParams(raw);
|
|
@@ -382,7 +382,8 @@ var google_meet_default = definePluginEntry({
|
|
|
382
382
|
registerGoogleMeetCli({
|
|
383
383
|
program,
|
|
384
384
|
config,
|
|
385
|
-
ensureRuntime
|
|
385
|
+
ensureRuntime,
|
|
386
|
+
oauthRuntime: api.runtime
|
|
386
387
|
});
|
|
387
388
|
}, {
|
|
388
389
|
commands: ["googlemeet"],
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Returns true if the value is a valid
|
|
3
|
-
* @specification https://
|
|
2
|
+
* Returns true if the value is a valid duration.
|
|
3
|
+
* @specification https://www.rfc-editor.org/rfc/rfc3339.html#appendix-A
|
|
4
4
|
*/
|
|
5
5
|
export declare function IsDuration(value: string): boolean;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
const Duration = /^P((\d+Y(\d+M(\d+D)?)?|\d+M(\d+D)?|\d+D)(T(\d+H(\d+M(\d+S)?)?|\d+M(\d+S)?|\d+S))?|T(\d+H(\d+M(\d+S)?)?|\d+M(\d+S)?|\d+S)|\d+W)$/;
|
|
2
2
|
/**
|
|
3
|
-
* Returns true if the value is a valid
|
|
4
|
-
* @specification https://
|
|
3
|
+
* Returns true if the value is a valid duration.
|
|
4
|
+
* @specification https://www.rfc-editor.org/rfc/rfc3339.html#appendix-A
|
|
5
5
|
*/
|
|
6
6
|
export function IsDuration(value) {
|
|
7
7
|
return Duration.test(value);
|
|
@@ -2,6 +2,7 @@ const IdnEmail = /^(?:[A-Za-z0-9!#$%&'*+\/=?^_`{|}~\u{0080}-\u{10FFFF}-]+(?:\.[A
|
|
|
2
2
|
/**
|
|
3
3
|
* Returns true if the value is an IdnEmail
|
|
4
4
|
* @specification https://datatracker.ietf.org/doc/html/rfc4952
|
|
5
|
+
* @specification https://datatracker.ietf.org/doc/html/rfc6531
|
|
5
6
|
*/
|
|
6
7
|
export function IsIdnEmail(value) {
|
|
7
8
|
return IdnEmail.test(value.normalize('NFC'));
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Returns true if the value is a valid internationalized (IDN) hostname.
|
|
3
|
-
* @specification https://
|
|
3
|
+
* @specification https://datatracker.ietf.org/doc/html/rfc5890
|
|
4
4
|
* @specification https://tools.ietf.org/html/rfc5891
|
|
5
5
|
* @specification https://tools.ietf.org/html/rfc5892
|
|
6
6
|
* @specification https://tools.ietf.org/html/rfc5893
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as Idna from './idna/index.mjs';
|
|
2
2
|
/**
|
|
3
3
|
* Returns true if the value is a valid internationalized (IDN) hostname.
|
|
4
|
-
* @specification https://
|
|
4
|
+
* @specification https://datatracker.ietf.org/doc/html/rfc5890
|
|
5
5
|
* @specification https://tools.ietf.org/html/rfc5891
|
|
6
6
|
* @specification https://tools.ietf.org/html/rfc5892
|
|
7
7
|
* @specification https://tools.ietf.org/html/rfc5893
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Returns true if the value is
|
|
3
|
-
* @specification
|
|
2
|
+
* Returns true if the value is an IPv4 address
|
|
3
|
+
* @specification https://datatracker.ietf.org/doc/html/rfc3986#section-3.2.2
|
|
4
4
|
*/
|
|
5
5
|
export declare function IsIPv4(value: string): boolean;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
const IPv4 = /^(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)$/;
|
|
2
2
|
/**
|
|
3
|
-
* Returns true if the value is
|
|
4
|
-
* @specification
|
|
3
|
+
* Returns true if the value is an IPv4 address
|
|
4
|
+
* @specification https://datatracker.ietf.org/doc/html/rfc3986#section-3.2.2
|
|
5
5
|
*/
|
|
6
6
|
export function IsIPv4(value) {
|
|
7
7
|
return IPv4.test(value);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
const IPv6 = /^(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:)?[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)$/i;
|
|
2
2
|
/**
|
|
3
3
|
* Returns true if the value is an IPv6 address
|
|
4
|
-
* @specification
|
|
4
|
+
* @specification https://datatracker.ietf.org/doc/html/rfc4291#section-2.2
|
|
5
5
|
*/
|
|
6
6
|
export function IsIPv6(value) {
|
|
7
7
|
return IPv6.test(value);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Returns true if the value is a relative
|
|
3
|
-
* @specification https://datatracker.ietf.org/doc/html/
|
|
2
|
+
* Returns true if the value is a relative JSON Pointer
|
|
3
|
+
* @specification https://datatracker.ietf.org/doc/html/draft-handrews-relative-json-pointer/
|
|
4
4
|
* @source https://github.com/ajv-validator/ajv-formats
|
|
5
5
|
*/
|
|
6
6
|
export declare function IsRelativeJsonPointer(value: string): boolean;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
const RelativeJsonPointer = /^(?:0|[1-9][0-9]*)(?:#|(?:\/(?:[^~/]|~0|~1)*)*)$/;
|
|
2
2
|
/**
|
|
3
|
-
* Returns true if the value is a relative
|
|
4
|
-
* @specification https://datatracker.ietf.org/doc/html/
|
|
3
|
+
* Returns true if the value is a relative JSON Pointer
|
|
4
|
+
* @specification https://datatracker.ietf.org/doc/html/draft-handrews-relative-json-pointer/
|
|
5
5
|
* @source https://github.com/ajv-validator/ajv-formats
|
|
6
6
|
*/
|
|
7
7
|
export function IsRelativeJsonPointer(value) {
|
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
let index = 0;
|
|
2
|
-
/**
|
|
3
|
-
export function
|
|
4
|
-
return `
|
|
2
|
+
/** Creates a unique variable name */
|
|
3
|
+
export function CreateUnique() {
|
|
4
|
+
return `unique_${index++}`;
|
|
5
|
+
}
|
|
6
|
+
/** Resets the unique variable name counter */
|
|
7
|
+
export function ResetUnique() {
|
|
8
|
+
index = 0;
|
|
5
9
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// deno-fmt-ignore-file
|
|
2
2
|
import * as Schema from '../types/index.mjs';
|
|
3
|
-
import
|
|
3
|
+
import * as Unique from './_unique.mjs';
|
|
4
4
|
import { Guard as G, EmitGuard as E } from '../../guard/index.mjs';
|
|
5
5
|
import { BuildSchemaPushStack, CheckSchemaPushStack, ErrorSchemaPushStack } from './schema.mjs';
|
|
6
6
|
// ------------------------------------------------------------------
|
|
@@ -13,14 +13,14 @@ function IsValid(schema) {
|
|
|
13
13
|
// Build
|
|
14
14
|
// ------------------------------------------------------------------
|
|
15
15
|
function BuildAdditionalItemsStandard(stack, context, schema, value) {
|
|
16
|
-
const [item, index] = [Unique(), Unique()];
|
|
16
|
+
const [item, index] = [Unique.CreateUnique(), Unique.CreateUnique()];
|
|
17
17
|
const isSchema = BuildSchemaPushStack(stack, context, schema.additionalItems, item);
|
|
18
18
|
const isLength = E.IsLessThan(index, E.Constant(schema.items.length));
|
|
19
19
|
const addIndex = context.AddIndex(index);
|
|
20
20
|
return E.Every(value, E.Constant(0), [item, index], E.Or(isLength, E.And(isSchema, addIndex)));
|
|
21
21
|
}
|
|
22
22
|
function BuildAdditionalItemsFast(stack, context, schema, value) {
|
|
23
|
-
const [item, index] = [Unique(), Unique()];
|
|
23
|
+
const [item, index] = [Unique.CreateUnique(), Unique.CreateUnique()];
|
|
24
24
|
const isSchema = BuildSchemaPushStack(stack, context, schema.additionalItems, item);
|
|
25
25
|
const isLength = E.IsLessThan(index, E.Constant(schema.items.length));
|
|
26
26
|
return E.Every(value, E.Constant(0), [item, index], E.Or(isLength, isSchema));
|
|
@@ -1,9 +1,6 @@
|
|
|
1
1
|
import * as Schema from '../types/index.mjs';
|
|
2
2
|
import * as Stack from './_stack.mjs';
|
|
3
3
|
import { BuildContext, CheckContext, ErrorContext } from './_context.mjs';
|
|
4
|
-
export declare function CanAdditionalPropertiesFast(_context: BuildContext, schema: Schema.XAdditionalProperties, _value: string): schema is Schema.XAdditionalProperties & Schema.XRequired;
|
|
5
|
-
export declare function BuildAdditionalPropertiesFast(_context: BuildContext, schema: Schema.XAdditionalProperties & Schema.XRequired, value: string): string;
|
|
6
|
-
export declare function BuildAdditionalPropertiesStandard(stack: Stack.XStack, context: BuildContext, schema: Schema.XAdditionalProperties, value: string): string;
|
|
7
4
|
export declare function BuildAdditionalProperties(stack: Stack.XStack, context: BuildContext, schema: Schema.XAdditionalProperties, value: string): string;
|
|
8
5
|
export declare function CheckAdditionalProperties(stack: Stack.XStack, context: CheckContext, schema: Schema.XAdditionalProperties, value: Record<PropertyKey, unknown>): boolean;
|
|
9
6
|
export declare function ErrorAdditionalProperties(stack: Stack.XStack, context: ErrorContext, schemaPath: string, instancePath: string, schema: Schema.XAdditionalProperties, value: Record<PropertyKey, unknown>): boolean;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
// deno-fmt-ignore-file
|
|
2
2
|
import * as Schema from '../types/index.mjs';
|
|
3
|
+
import * as Unique from './_unique.mjs';
|
|
3
4
|
import * as Externals from './_externals.mjs';
|
|
4
5
|
import * as Pathing from './_pathing.mjs';
|
|
5
|
-
import { Unique } from './_unique.mjs';
|
|
6
6
|
import { UnicodeRegExp } from './_regexp.mjs';
|
|
7
7
|
import { EmitGuard as E, Guard as G } from '../../guard/index.mjs';
|
|
8
8
|
import { BuildSchemaPushStack, CheckSchemaPushStack, ErrorSchemaPushStack } from './schema.mjs';
|
|
@@ -42,35 +42,33 @@ function GetPropertiesPattern(schema) {
|
|
|
42
42
|
return G.IsEqual(patterns.length, 0) ? '(?!)' : `(${patterns.join('|')})`;
|
|
43
43
|
}
|
|
44
44
|
// ------------------------------------------------------------------
|
|
45
|
-
// BuildAdditionalPropertiesFast
|
|
45
|
+
// BuildAdditionalPropertiesFast (AdditionalProperties False)
|
|
46
46
|
//
|
|
47
|
-
//
|
|
48
|
-
//
|
|
49
|
-
//
|
|
50
|
-
// - `additionalProperties` is explicitly set to false,
|
|
51
|
-
// - the schema uses only `properties` (no `patternProperties`),
|
|
52
|
-
// - and all defined properties are required (i.e., no optional keys).
|
|
53
|
-
//
|
|
54
|
-
// This constraint is common when enforcing strict object shapes
|
|
55
|
-
// with only known, fixed keys. When all these conditions are met,
|
|
56
|
-
// we can generate a simplified and efficient runtime check.
|
|
47
|
+
// - AdditionalProperties is explicitly set to false,
|
|
48
|
+
// - The schema uses only Properties (no PatternProperties),
|
|
49
|
+
// - Required contains exactly the keys in Properties.
|
|
57
50
|
//
|
|
58
51
|
// ------------------------------------------------------------------
|
|
59
|
-
|
|
52
|
+
function HasExactRequiredProperties(schema) {
|
|
53
|
+
const keys = G.Keys(schema.properties);
|
|
54
|
+
return G.IsEqual(keys.length, schema.required.length)
|
|
55
|
+
&& G.Every(keys, 0, (key) => schema.required.includes(key));
|
|
56
|
+
}
|
|
57
|
+
function CanAdditionalPropertiesFast(_context, schema, _value) {
|
|
60
58
|
return Schema.IsRequired(schema)
|
|
61
59
|
&& Schema.IsProperties(schema)
|
|
62
60
|
&& !Schema.IsPatternProperties(schema)
|
|
63
61
|
&& G.IsEqual(schema.additionalProperties, false)
|
|
64
|
-
&&
|
|
62
|
+
&& HasExactRequiredProperties(schema);
|
|
65
63
|
}
|
|
66
|
-
|
|
64
|
+
function BuildAdditionalPropertiesFast(_context, schema, value) {
|
|
67
65
|
return E.IsEqual(E.Member(E.Call(E.Member('Object', 'getOwnPropertyNames'), [value]), 'length'), E.Constant(schema.required.length));
|
|
68
66
|
}
|
|
69
67
|
// ------------------------------------------------------------------
|
|
70
68
|
// BuildAdditionalPropertiesStandard
|
|
71
69
|
// ------------------------------------------------------------------
|
|
72
|
-
|
|
73
|
-
const [key, _index] = [Unique(), Unique()];
|
|
70
|
+
function BuildAdditionalPropertiesStandard(stack, context, schema, value) {
|
|
71
|
+
const [key, _index] = [Unique.CreateUnique(), Unique.CreateUnique()];
|
|
74
72
|
const regexp = Externals.CreateVariable(UnicodeRegExp(GetPropertiesPattern(schema)));
|
|
75
73
|
const isSchema = BuildSchemaPushStack(stack, context, schema.additionalProperties, `${value}[${key}]`);
|
|
76
74
|
const isKey = E.Call(E.Member(regexp, 'test'), [key]);
|