
























1+import {
2+optionalPositiveIntegerSchema,
3+readPositiveIntegerParam,
4+} from "openclaw/plugin-sdk/channel-actions";
15import { formatErrorMessage } from "openclaw/plugin-sdk/error-runtime";
26import {
37callGatewayFromCli,
@@ -272,7 +276,7 @@ const GoogleMeetToolSchema = Type.Object({
272276dtmfSequence: Type.Optional(Type.String({ description: "Explicit DTMF sequence for Twilio" })),
273277sessionId: Type.Optional(Type.String({ description: "Meet session ID" })),
274278message: Type.Optional(Type.String({ description: "Realtime instructions to speak now" })),
275-timeoutMs: Type.Optional(Type.Number({ description: "Probe timeout in milliseconds" })),
279+timeoutMs: optionalPositiveIntegerSchema({ description: "Probe timeout in milliseconds" }),
276280meeting: Type.Optional(Type.String({ description: "Meet URL, meeting code, or spaces/{id}" })),
277281today: Type.Optional(
278282Type.Boolean({
@@ -288,7 +292,7 @@ const GoogleMeetToolSchema = Type.Object({
288292conferenceRecord: Type.Optional(
289293Type.String({ description: "Meet conferenceRecords/{id} resource name or id" }),
290294),
291-pageSize: Type.Optional(Type.Number({ description: "Meet API page size for list actions" })),
295+pageSize: optionalPositiveIntegerSchema({ description: "Meet API page size for list actions" }),
292296includeTranscriptEntries: Type.Optional(
293297Type.Boolean({ description: "For artifacts, include structured transcript entries" }),
294298),
@@ -314,12 +318,12 @@ const GoogleMeetToolSchema = Type.Object({
314318mergeDuplicateParticipants: Type.Optional(
315319Type.Boolean({ description: "For attendance, merge duplicate participant resources." }),
316320),
317-lateAfterMinutes: Type.Optional(
318-Type.Number({ description: "For attendance, mark participants late after this many minutes." }),
319-),
320-earlyBeforeMinutes: Type.Optional(
321-Type.Number({ description: "For attendance, mark early leavers before this many minutes." }),
322-),
321+lateAfterMinutes: optionalPositiveIntegerSchema({
322+description: "For attendance, mark participants late after this many minutes.",
323+}),
324+earlyBeforeMinutes: optionalPositiveIntegerSchema({
325+description: "For attendance, mark early leavers before this many minutes.",
326+}),
323327accessToken: Type.Optional(Type.String({ description: "Access token override" })),
324328refreshToken: Type.Optional(Type.String({ description: "Refresh token override" })),
325329clientId: Type.Optional(Type.String({ description: "OAuth client id override" })),
@@ -363,17 +367,6 @@ function resolveMeetingInput(config: GoogleMeetConfig, value: unknown): string {
363367return meeting;
364368}
365369366-function resolveOptionalPositiveInteger(value: unknown): number | undefined {
367-if (value === undefined) {
368-return undefined;
369-}
370-const parsed = typeof value === "number" ? value : Number(normalizeOptionalString(value));
371-if (!Number.isInteger(parsed) || parsed <= 0) {
372-throw new Error("Expected pageSize to be a positive integer");
373-}
374-return parsed;
375-}
376-377370function shouldJoinCreatedMeet(raw: Record<string, unknown>): boolean {
378371return raw.join !== false && raw.join !== "false";
379372}
@@ -591,13 +584,13 @@ async function resolveArtifactQueryFromParams(
591584meeting: resolvedMeeting.meeting,
592585calendarEvent: resolvedMeeting.calendarEvent,
593586 conferenceRecord,
594-pageSize: resolveOptionalPositiveInteger(raw.pageSize),
587+pageSize: readPositiveIntegerParam(raw, "pageSize"),
595588includeTranscriptEntries: raw.includeTranscriptEntries !== false,
596589includeDocumentBodies: raw.includeDocumentBodies === true,
597590allConferenceRecords: raw.includeAllConferenceRecords === true,
598591mergeDuplicateParticipants: raw.mergeDuplicateParticipants !== false,
599-lateAfterMinutes: resolveOptionalPositiveInteger(raw.lateAfterMinutes),
600-earlyBeforeMinutes: resolveOptionalPositiveInteger(raw.earlyBeforeMinutes),
592+lateAfterMinutes: readPositiveIntegerParam(raw, "lateAfterMinutes"),
593+earlyBeforeMinutes: readPositiveIntegerParam(raw, "earlyBeforeMinutes"),
601594};
602595}
603596@@ -1014,7 +1007,7 @@ export default definePluginEntry({
10141007url: resolveMeetingInput(config, params?.url),
10151008transport: normalizeTransport(params?.transport),
10161009mode: normalizeMode(params?.mode),
1017-timeoutMs: typeof params?.timeoutMs === "number" ? params.timeoutMs : undefined,
1010+timeoutMs: readPositiveIntegerParam(asParamRecord(params), "timeoutMs"),
10181011});
10191012respond(true, result);
10201013} catch (err) {
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。