export async function main(args: { device: string; text: string; }) { console.log("ARGS:", args); const ssml = `${args.text}`; const res = await fetch("http://alexa_api:3500/speak", { method: "POST", headers: { "Content-Type": "application/json" }, body: JSON.stringify({ device: args.device, text: ssml }), }); const body = await res.text(); console.log("API RESPONSE:", body); if (!res.ok) { throw new Error("alexa-api error " + res.status + ": " + body); } return body; }