UNPKG

openclaw

Version:

Multi-channel AI gateway with extensible messaging integrations

34 lines (33 loc) • 1.11 kB
import { a as asOptionalRecord } from "../../record-coerce-CVPuDqcc.mjs"; import { n as jsonResult } from "../../tool-results-CcV0sxnb.mjs"; import { m as readToolStringParam } from "../../common-njQNtpnW.mjs"; import { t as callGatewayTool } from "../../gateway-DL_Nxi-v.mjs"; import "../../string-coerce-runtime-BwAZZDf5.mjs"; import "../../agent-harness-runtime-BCklzcv7.mjs"; import "../../param-readers-CVZN1591.mjs"; //#region extensions/talk-voice/tool.ts async function executeTalkVoiceTool(e, ...t) { const [, n, r] = t; const i = asOptionalRecord(n) ?? {}; const a = readToolStringParam(i, "action", { required: true }); let o; let s; switch (a) { case "list": o = "talk.voice.get"; s = {}; break; case "set": o = "talk.voice.set"; s = { voice: readToolStringParam(i, "voice", { required: true }) }; break; default: throw new Error(`Unknown Talk voice action: ${a}`); } if (e) s.sessionKey = e; return jsonResult(await callGatewayTool(o, { timeoutMs: 65e3 }, s, { requireAgentRuntimeIdentity: true, signal: r })); } //#endregion export { executeTalkVoiceTool };