UNPKG

openclaw

Version:

Multi-channel AI gateway with extensible messaging integrations

32 lines (31 loc) • 1.15 kB
import { a as asOptionalRecord } from "../../record-coerce-TIsquoVR.mjs"; import "../../string-coerce-runtime-B1b8UNzb.mjs"; import { t as jsonResult } from "../../tool-results-BCM3fdVS.mjs"; import { h as readToolStringParam } from "../../common-CwfR3iO6.mjs"; import { t as callGatewayTool } from "../../gateway-b_lf--A8.mjs"; import "../../agent-harness-runtime-ADe6s8a3.mjs"; import "../../param-readers-PfUsCMZz.mjs"; //#region extensions/talk-voice/tool.ts const executeTalkVoiceTool = async (_id, args, signal) => { const params = asOptionalRecord(args) ?? {}; const action = readToolStringParam(params, "action", { required: true }); let method; let request; switch (action) { case "list": method = "talk.voice.get"; request = {}; break; case "set": method = "talk.voice.set"; request = { voice: readToolStringParam(params, "voice", { required: true }) }; break; default: throw new Error(`Unknown Talk voice action: ${action}`); } return jsonResult(await callGatewayTool(method, { timeoutMs: 65e3 }, request, { requireAgentRuntimeIdentity: true, signal })); }; //#endregion export { executeTalkVoiceTool };