























@@ -6,12 +6,10 @@ import {
66type SecretInput,
77} from "openclaw/plugin-sdk/secret-input";
88import { z } from "openclaw/plugin-sdk/zod";
9-import { TtsAutoSchema, TtsConfigSchema, TtsModeSchema, TtsProviderSchema } from "../api.js";
9+import { TtsConfigSchema } from "../api.js";
1010import { deepMergeDefined } from "./deep-merge.js";
1111import { DEFAULT_VOICE_CALL_REALTIME_INSTRUCTIONS } from "./realtime-defaults.js";
121213-export { DEFAULT_VOICE_CALL_REALTIME_INSTRUCTIONS } from "./realtime-defaults.js";
14-1513// -----------------------------------------------------------------------------
1614// Phone Number Validation
1715// -----------------------------------------------------------------------------
@@ -20,7 +18,7 @@ export { DEFAULT_VOICE_CALL_REALTIME_INSTRUCTIONS } from "./realtime-defaults.js
2018 * E.164 phone number format: +[country code][number]
2119 * Examples use 555 prefix (reserved for fictional numbers)
2220 */
23-export const E164Schema = z
21+const E164Schema = z
2422.string()
2523.regex(/^\+[1-9]\d{1,14}$/, "Expected E.164 format, e.g. +15550001234");
2624@@ -35,15 +33,15 @@ export const E164Schema = z
3533 * - "pairing": Unknown callers can request pairing (future)
3634 * - "open": Accept all inbound calls (dangerous!)
3735 */
38-export const InboundPolicySchema = z.enum(["disabled", "allowlist", "pairing", "open"]);
36+const InboundPolicySchema = z.enum(["disabled", "allowlist", "pairing", "open"]);
39374038// -----------------------------------------------------------------------------
4139// Provider-Specific Configuration
4240// -----------------------------------------------------------------------------
43414442const SecretInputSchema = buildSecretInputSchema();
454346-export const TelnyxConfigSchema = z
44+const TelnyxConfigSchema = z
4745.object({
4846/** Telnyx API v2 key */
4947apiKey: z.string().min(1).optional(),
@@ -55,7 +53,7 @@ export const TelnyxConfigSchema = z
5553.strict();
5654export type TelnyxConfig = z.infer<typeof TelnyxConfigSchema>;
575558-export const TwilioConfigSchema = z
56+const TwilioConfigSchema = z
5957.object({
6058/** Twilio Account SID */
6159accountSid: z.string().min(1).optional(),
@@ -64,7 +62,7 @@ export const TwilioConfigSchema = z
6462})
6563.strict();
666467-export const PlivoConfigSchema = z
65+const PlivoConfigSchema = z
6866.object({
6967/** Plivo Auth ID (starts with MA/SA) */
7068authId: z.string().min(1).optional(),
@@ -74,14 +72,13 @@ export const PlivoConfigSchema = z
7472.strict();
7573export type PlivoConfig = z.infer<typeof PlivoConfigSchema>;
767477-export { TtsAutoSchema, TtsConfigSchema, TtsModeSchema, TtsProviderSchema };
7875export type VoiceCallTtsConfig = z.infer<typeof TtsConfigSchema>;
79768077// -----------------------------------------------------------------------------
8178// Webhook Server Configuration
8279// -----------------------------------------------------------------------------
838084-export const VoiceCallServeConfigSchema = z
81+const VoiceCallServeConfigSchema = z
8582.object({
8683/** Port to listen on */
8784port: z.number().int().positive().default(3334),
@@ -93,7 +90,7 @@ export const VoiceCallServeConfigSchema = z
9390.strict()
9491.default({ port: 3334, bind: "127.0.0.1", path: "/voice/webhook" });
959296-export const VoiceCallTailscaleConfigSchema = z
93+const VoiceCallTailscaleConfigSchema = z
9794.object({
9895/**
9996 * Tailscale exposure mode:
@@ -112,7 +109,7 @@ export const VoiceCallTailscaleConfigSchema = z
112109// Tunnel Configuration (unified ngrok/tailscale)
113110// -----------------------------------------------------------------------------
114111115-export const VoiceCallTunnelConfigSchema = z
112+const VoiceCallTunnelConfigSchema = z
116113.object({
117114/**
118115 * Tunnel provider:
@@ -142,7 +139,7 @@ export const VoiceCallTunnelConfigSchema = z
142139// Webhook Security Configuration
143140// -----------------------------------------------------------------------------
144141145-export const VoiceCallWebhookSecurityConfigSchema = z
142+const VoiceCallWebhookSecurityConfigSchema = z
146143.object({
147144/**
148145 * Allowed hostnames for webhook URL reconstruction.
@@ -173,10 +170,10 @@ export type WebhookSecurityConfig = z.infer<typeof VoiceCallWebhookSecurityConfi
173170 * - "notify": Deliver message and auto-hangup after delay (one-way notification)
174171 * - "conversation": Stay open for back-and-forth until explicit end or timeout
175172 */
176-export const CallModeSchema = z.enum(["notify", "conversation"]);
173+const CallModeSchema = z.enum(["notify", "conversation"]);
177174export type CallMode = z.infer<typeof CallModeSchema>;
178175179-export const OutboundConfigSchema = z
176+const OutboundConfigSchema = z
180177.object({
181178/** Default call mode for outbound calls */
182179defaultMode: CallModeSchema.default("notify"),
@@ -190,7 +187,7 @@ export const OutboundConfigSchema = z
190187// Realtime Voice Configuration
191188// -----------------------------------------------------------------------------
192189193-export const RealtimeToolSchema = z
190+const RealtimeToolSchema = z
194191.object({
195192type: z.literal("function"),
196193name: z.string().min(1),
@@ -202,17 +199,17 @@ export const RealtimeToolSchema = z
202199}),
203200})
204201.strict();
205-export type RealtimeToolConfig = z.infer<typeof RealtimeToolSchema>;
202+type RealtimeToolConfig = z.infer<typeof RealtimeToolSchema>;
206203207-export const VoiceCallRealtimeProvidersConfigSchema = z
204+const VoiceCallRealtimeProvidersConfigSchema = z
208205.record(z.string(), z.record(z.string(), z.unknown()))
209206.default({});
210207211-export const VoiceCallRealtimeToolPolicySchema = z.enum(REALTIME_VOICE_AGENT_CONSULT_TOOL_POLICIES);
208+const VoiceCallRealtimeToolPolicySchema = z.enum(REALTIME_VOICE_AGENT_CONSULT_TOOL_POLICIES);
212209213-export const VoiceCallRealtimeFastContextSourceSchema = z.enum(["memory", "sessions"]);
210+const VoiceCallRealtimeFastContextSourceSchema = z.enum(["memory", "sessions"]);
214211215-export const VoiceCallRealtimeFastContextConfigSchema = z
212+const VoiceCallRealtimeFastContextConfigSchema = z
216213.object({
217214/** Enable bounded memory/session lookup before the full consult agent. */
218215enabled: z.boolean().default(false),
@@ -240,11 +237,11 @@ export type VoiceCallRealtimeFastContextConfig = z.infer<
240237typeof VoiceCallRealtimeFastContextConfigSchema
241238>;
242239243-export const VoiceCallStreamingProvidersConfigSchema = z
240+const VoiceCallStreamingProvidersConfigSchema = z
244241.record(z.string(), z.record(z.string(), z.unknown()))
245242.default({});
246243247-export const VoiceCallRealtimeConfigSchema = z
244+const VoiceCallRealtimeConfigSchema = z
248245.object({
249246/** Enable realtime voice-to-voice mode. */
250247enabled: z.boolean().default(false),
@@ -284,7 +281,7 @@ export type VoiceCallRealtimeConfig = z.infer<typeof VoiceCallRealtimeConfigSche
284281// Streaming Configuration (Realtime Transcription)
285282// -----------------------------------------------------------------------------
286283287-export const VoiceCallStreamingConfigSchema = z
284+const VoiceCallStreamingConfigSchema = z
288285.object({
289286/** Enable real-time audio streaming (requires WebSocket support) */
290287enabled: z.boolean().default(false),
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。