diff --git a/workflows/u/admin/alexa_speak.script.yaml b/workflows/u/admin/alexa_speak.script.yaml index e9e1be3..091b41b 100644 --- a/workflows/u/admin/alexa_speak.script.yaml +++ b/workflows/u/admin/alexa_speak.script.yaml @@ -5,18 +5,16 @@ kind: script schema: type: object properties: - args: - type: object + device: + type: string description: '' default: null - properties: - device: - type: string - description: '' - originalType: string - text: - type: string - description: '' - originalType: string + originalType: string + text: + type: string + description: '' + default: null + originalType: string required: - - args + - device + - text diff --git a/workflows/u/admin/alexa_speak.ts b/workflows/u/admin/alexa_speak.ts index ec380e7..a25942c 100644 --- a/workflows/u/admin/alexa_speak.ts +++ b/workflows/u/admin/alexa_speak.ts @@ -1,27 +1,20 @@ -export async function main(args: { - device: string; - text: string; -}) { +export async function main( + device: string, + text: string, +): Promise<{ ok: boolean; device: string; text: string }> { + const ALEXA_API_URL = "http://alexa_api:3500"; - console.log("ARGS:", args); - - const ssml = `${args.text}`; - - const res = await fetch("http://alexa_api:3500/speak", { + const res = await fetch(`${ALEXA_API_URL}/speak`, { method: "POST", headers: { "Content-Type": "application/json" }, - body: JSON.stringify({ - device: args.device, - text: ssml - }), + body: JSON.stringify({ 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); + const body = await res.json().catch(() => ({})); + throw new Error(`alexa-api error ${res.status}: ${JSON.stringify(body)}`); } - return body; + return await res.json(); } + diff --git a/workflows/wmill-lock.yaml b/workflows/wmill-lock.yaml index b04563f..203624f 100644 --- a/workflows/wmill-lock.yaml +++ b/workflows/wmill-lock.yaml @@ -19,7 +19,7 @@ locks: f/weather/weather_sync__flow+気象データ取得・同期.py: 86c9953ec7346601eaa13c681e2db5c01c9a5b4b45a3c47e8667ad3c47557029 g/all/setup_app__app+__app_hash: d71add32e14e552d1a4c861c972a50d9598b07c0af201bbadec5b59bbd99d7e3 g/all/setup_app__app+change_account.deno.ts: 3c592cac27e9cdab0de6ae19270bcb08c7fa54355ad05253a12de2351894346b - u/admin/alexa_speak: 73022478d7d9a8e238add4bc5a8aa7329a2f7d81864daa8acd881190c8c37ef5 + u/admin/alexa_speak: 38de2eb567f82488e6f819c82dc7d83f41d83f015fac0c944d98dcc6b33a29a1 u/admin/hub_sync: aaf9fd803fa229f3029d1bb02bbe3cc422fce680cad39c4eec8dd1da115de102 u/antigravity/git_sync__flow+__flow_hash: 5a7194ef6bf1ce5529e70ae74fdb4cd05a0da662c78bfa355bb7e98698689ae6 u/antigravity/git_sync__flow+a.sh: ac7fdc83548f305fed33389129b79439e0c40077ed39a410477c77d08dca0ca9