ai_co_discuss 0.4.13 → 0.4.16
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.agents/skills/discuss-host/SKILL.md +42 -42
- package/.agents/skills/workflow-creator/SKILL.md +155 -155
- package/.agents/skills/workflow-creator/references/model-selection.md +24 -23
- package/backend/free_room.py +15 -8
- package/backend/schema.sql +3 -1
- package/backend/server.py +146 -17
- package/docs/THIRD_PARTY_NOTICES.md +721 -1
- package/docs/runner.md +4 -2
- package/docs/workflow.md +1 -1
- package/package.json +10 -3
- package/runner/adapters/api.mjs +33 -7
- package/runner/adapters/api_files.mjs +21 -0
- package/runner/adapters/api_images.mjs +245 -0
- package/runner/adapters/index.mjs +186 -186
- package/runner/adapters/profiles.mjs +152 -139
- package/runner/discussion_launch.mjs +49 -11
- package/runner/free_runner.mjs +1286 -1281
- package/runner/project_files.mjs +390 -330
- package/runner/relay_channel.mjs +326 -325
- package/runner/remote_launch.mjs +2 -2
- package/runner/stt.mjs +135 -111
- package/runner/tts.mjs +180 -172
- package/runner/tts_providers.mjs +479 -435
- package/runner/workflows.mjs +606 -606
- package/web/app.js +82 -12
- package/web/backup.js +1 -1
- package/web/markdown.css +1 -1
- package/web/modern.css +1 -1
- package/web/modern.js +663 -40
- package/web/office/assets/pptx-source-worker-559Vl2R3.mjs +446 -0
- package/web/office/assets/pptx_parser_bg-DON650C_.wasm +0 -0
- package/web/office/assets/render-worker-Ck21oePL-D_L2C4am.js +16 -0
- package/web/office/chunks/comment-ui-runtime-Bp37ytDC-CEDIeFBy.js +125 -0
- package/web/office/chunks/emf--QWY-UlT-D7lCNost.js +1 -0
- package/web/office/chunks/font-preload-demand-NqcVKIpX-_QhVEaPJ.js +1 -0
- package/web/office/chunks/plot-area-frame-DNYMd9Pf-B0ScWz_J.js +2 -0
- package/web/office/chunks/pptx-DbjWegUB-CU8ZIJEP.js +4 -0
- package/web/office/chunks/presentation-model-source-DLNioq7T-Demo5cCW.js +1 -0
- package/web/office/chunks/render-worker-host-CVr53kg0-DUcW76F6.js +1 -0
- package/web/office/chunks/slide-pull-client-3g6TxaKa-BohMnKOC.js +12 -0
- package/web/office/chunks/worker-source-ZQE9C1j6-B31UTbq3.js +1 -0
- package/web/office/docx.js +21 -0
- package/web/office/pptx.js +1 -0
- package/web/office/xlsx.js +64 -0
package/runner/tts.mjs
CHANGED
|
@@ -1,172 +1,180 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Read-aloud: synthesize short text with the speech service chosen in settings (Volcengine, Aliyun, Azure or the local service); keys stay
|
|
3
|
-
* in the local private store. Each service keeps its own key and voices, so switching back finds them as they were.
|
|
4
|
-
*/
|
|
5
|
-
import { createHash } from 'node:crypto';
|
|
6
|
-
import { existsSync, mkdirSync, readdirSync, readFileSync, rmSync, statSync } from 'node:fs';
|
|
7
|
-
import { join } from 'node:path';
|
|
8
|
-
|
|
9
|
-
import { read_saved_api_key, saved_api_keys } from './discussion_api.mjs';
|
|
10
|
-
import { atomic_json } from './files.mjs';
|
|
11
|
-
import { provider_release, provider_speak, STT_PROVIDERS, TTS_PROVIDERS } from './tts_providers.mjs';
|
|
12
|
-
|
|
13
|
-
// Volcengine's key root; its key also serves voice input.
|
|
14
|
-
export const TTS_BASE_URL = 'https://openspeech.bytedance.com';
|
|
15
|
-
// The page sends a paragraph of up to 200 characters; at about 8 KB of MP3 per second this keeps one relayed answer under 1 MiB.
|
|
16
|
-
export const TTS_MAX_TEXT = 300;
|
|
17
|
-
const MAX_CONTEXT = 200;
|
|
18
|
-
const SETTINGS_FILE = 'tts-settings.json';
|
|
19
|
-
const SPEAKER_PATTERN = /^[\w.:-]{1,128}$/;
|
|
20
|
-
const REGION_PATTERN = /^[a-z0-9]{2,32}$/;
|
|
21
|
-
const KEY_REF_PATTERN = /^[a-f0-9-]{36}$/i;
|
|
22
|
-
// Trailing silence the page may ask for at a paragraph or message end; it is part of the audio, so it also plays in the background.
|
|
23
|
-
const MAX_SILENCE_MS = 3000;
|
|
24
|
-
// Synthesized paragraphs are kept on this computer, so hearing the same text again is instant and not billed again.
|
|
25
|
-
const CACHE_DIR = 'tts-cache';
|
|
26
|
-
// The cache is bounded by total size; past it, the least recently heard entries go until it is back under the target.
|
|
27
|
-
const CACHE_LIMIT_BYTES = 50 * 1024 * 1024;
|
|
28
|
-
const CACHE_KEEP_BYTES = 40 * 1024 * 1024;
|
|
29
|
-
const MAX_MEMBER_VOICES = 50;
|
|
30
|
-
// A
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
const
|
|
34
|
-
const
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
*
|
|
45
|
-
*
|
|
46
|
-
* The chosen service's key reference and voices are also given at the top level for readers that only play.
|
|
47
|
-
* The local service's token is saved by the setup skill, so without a reference it uses the latest saved for its address
|
|
48
|
-
*
|
|
49
|
-
*
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
const
|
|
54
|
-
const
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
const
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
const
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
const
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
}
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
}
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
const
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
const
|
|
159
|
-
|
|
160
|
-
const
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
1
|
+
/**
|
|
2
|
+
* Read-aloud: synthesize short text with the speech service chosen in settings (Volcengine, Aliyun, Azure or the local service); keys stay
|
|
3
|
+
* in the local private store. Each service keeps its own key and voices, so switching back finds them as they were.
|
|
4
|
+
*/
|
|
5
|
+
import { createHash } from 'node:crypto';
|
|
6
|
+
import { existsSync, mkdirSync, readdirSync, readFileSync, rmSync, statSync } from 'node:fs';
|
|
7
|
+
import { join } from 'node:path';
|
|
8
|
+
|
|
9
|
+
import { read_saved_api_key, saved_api_keys } from './discussion_api.mjs';
|
|
10
|
+
import { atomic_json } from './files.mjs';
|
|
11
|
+
import { provider_release, provider_speak, STT_PROVIDERS, TTS_PROVIDERS } from './tts_providers.mjs';
|
|
12
|
+
|
|
13
|
+
// Volcengine's key root; its key also serves voice input.
|
|
14
|
+
export const TTS_BASE_URL = 'https://openspeech.bytedance.com';
|
|
15
|
+
// The page sends a paragraph of up to 200 characters; at about 8 KB of MP3 per second this keeps one relayed answer under 1 MiB.
|
|
16
|
+
export const TTS_MAX_TEXT = 300;
|
|
17
|
+
const MAX_CONTEXT = 200;
|
|
18
|
+
const SETTINGS_FILE = 'tts-settings.json';
|
|
19
|
+
const SPEAKER_PATTERN = /^[\w.:-]{1,128}$/;
|
|
20
|
+
const REGION_PATTERN = /^[a-z0-9]{2,32}$/;
|
|
21
|
+
const KEY_REF_PATTERN = /^[a-f0-9-]{36}$/i;
|
|
22
|
+
// Trailing silence the page may ask for at a paragraph or message end; it is part of the audio, so it also plays in the background.
|
|
23
|
+
const MAX_SILENCE_MS = 3000;
|
|
24
|
+
// Synthesized paragraphs are kept on this computer, so hearing the same text again is instant and not billed again.
|
|
25
|
+
const CACHE_DIR = 'tts-cache';
|
|
26
|
+
// The cache is bounded by total size; past it, the least recently heard entries go until it is back under the target.
|
|
27
|
+
const CACHE_LIMIT_BYTES = 50 * 1024 * 1024;
|
|
28
|
+
const CACHE_KEEP_BYTES = 40 * 1024 * 1024;
|
|
29
|
+
const MAX_MEMBER_VOICES = 50;
|
|
30
|
+
// A paragraph asked for again while its synthesis is still running (another device, a quick restart) waits for that call.
|
|
31
|
+
const in_flight = new Map();
|
|
32
|
+
const PROVIDER_IDS = TTS_PROVIDERS.map(provider => provider.id);
|
|
33
|
+
const provider_of = (id) => TTS_PROVIDERS.find(provider => provider.id === id);
|
|
34
|
+
const STT_IDS = STT_PROVIDERS.map(provider => provider.id);
|
|
35
|
+
|
|
36
|
+
/** One service's saved part with its defaults: key reference, voices, tone (services that take one) and (Azure) region. */
|
|
37
|
+
function provider_settings(provider, saved = {}) {
|
|
38
|
+
return { api_key_ref: '', speaker: provider.default_speaker, member_voices: {}, file_voice: '', ...(provider.context ? { context: provider.default_context } : {}),
|
|
39
|
+
...(provider.region ? { region: '' } : {}), ...saved };
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
/**
|
|
43
|
+
* Read the saved read-aloud settings; only key references are kept, never keys. Settings saved before services could be
|
|
44
|
+
* chosen held Volcengine's key and voices at the top level and are read as Volcengine's; so is a tone saved at the top
|
|
45
|
+
* level before each service kept its own.
|
|
46
|
+
* The chosen service's key reference and voices are also given at the top level for readers that only play.
|
|
47
|
+
* The local service's token is saved by the setup skill, so without a reference it uses the latest saved for its address;
|
|
48
|
+
* so does OpenAI, whose key is usually saved already for model API members.
|
|
49
|
+
* Voice input chooses its own service (`stt_provider`); `stt_key_ref` is the key reference of the one chosen, empty
|
|
50
|
+
* until it is set up: a cloud service's key from its reading part of the same id, the local service's token as its skill saved it.
|
|
51
|
+
*/
|
|
52
|
+
export function tts_settings(home) {
|
|
53
|
+
const path = join(home, SETTINGS_FILE);
|
|
54
|
+
const saved = existsSync(path) ? JSON.parse(readFileSync(path, 'utf8')) : {};
|
|
55
|
+
const stored = saved.providers || { volcengine: { api_key_ref: saved.api_key_ref, speaker: saved.speaker, member_voices: saved.member_voices,
|
|
56
|
+
file_voice: saved.file_voice } };
|
|
57
|
+
if (saved.context !== undefined && stored.volcengine?.context === undefined) stored.volcengine = { ...stored.volcengine, context: saved.context };
|
|
58
|
+
const keys = saved_api_keys(home);
|
|
59
|
+
const providers = Object.fromEntries(TTS_PROVIDERS.map(provider => {
|
|
60
|
+
const own = provider_settings(provider, Object.fromEntries(Object.entries(stored[provider.id] || {}).filter(([, value]) => value !== undefined)));
|
|
61
|
+
return [provider.id, (provider.local || provider.shared_key) && !own.api_key_ref ? { ...own, api_key_ref: keys[provider.key_base_url] || '' } : own];
|
|
62
|
+
}));
|
|
63
|
+
// Never chosen: the service on this computer once installed (it needs no key), unless an older file holds a Volcengine key.
|
|
64
|
+
const provider = PROVIDER_IDS.includes(saved.provider) ? saved.provider
|
|
65
|
+
: providers.local.api_key_ref && !stored.volcengine?.api_key_ref ? 'local' : 'volcengine';
|
|
66
|
+
const active = providers[provider];
|
|
67
|
+
const ready = Boolean(active.api_key_ref && (!provider_of(provider).region || active.region));
|
|
68
|
+
const local_stt = STT_PROVIDERS.find(item => item.local);
|
|
69
|
+
const stt_provider = STT_IDS.includes(saved.stt_provider) ? saved.stt_provider : keys[local_stt.key_base_url] ? local_stt.id : 'volcengine';
|
|
70
|
+
const stt = STT_PROVIDERS.find(item => item.id === stt_provider);
|
|
71
|
+
return { provider, speech_rate: saved.speech_rate ?? 0, providers, catalog: TTS_PROVIDERS,
|
|
72
|
+
api_key_ref: ready ? active.api_key_ref : '', speaker: active.speaker, member_voices: active.member_voices, file_voice: active.file_voice,
|
|
73
|
+
stt_provider, stt_catalog: STT_PROVIDERS, stt_key_ref: stt.local ? keys[stt.key_base_url] || '' : providers[stt.id]?.api_key_ref || '' };
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
/** Validate one service's part as the page sent it. */
|
|
77
|
+
function check_provider(provider, input = {}) {
|
|
78
|
+
const speaker = String(input.speaker || provider.default_speaker).trim();
|
|
79
|
+
if (!SPEAKER_PATTERN.test(speaker)) throw new Error('请填写有效的音色 ID');
|
|
80
|
+
const api_key_ref = input.api_key_ref || '';
|
|
81
|
+
if (api_key_ref && !KEY_REF_PATTERN.test(api_key_ref)) throw new Error('API Key 引用无效,请重新填写');
|
|
82
|
+
// Voices chosen per AI platform; members of other platforms, the user and program messages use the default voice.
|
|
83
|
+
const member_voices = {};
|
|
84
|
+
for (const [name, voice] of Object.entries(input.member_voices || {}).slice(0, MAX_MEMBER_VOICES)) {
|
|
85
|
+
if (!voice) continue;
|
|
86
|
+
if (String(name).length > 40 || !SPEAKER_PATTERN.test(voice)) throw new Error('成员音色无效,请重新选择');
|
|
87
|
+
member_voices[name] = voice;
|
|
88
|
+
}
|
|
89
|
+
// The voice for reading project files; empty uses the default voice.
|
|
90
|
+
const file_voice = String(input.file_voice ?? '').trim();
|
|
91
|
+
if (file_voice && !SPEAKER_PATTERN.test(file_voice)) throw new Error('文件音色无效,请重新选择');
|
|
92
|
+
const region = String(input.region ?? '').trim().toLowerCase();
|
|
93
|
+
if (region && !REGION_PATTERN.test(region)) throw new Error('Azure 区域应为如 eastasia 的小写英文与数字');
|
|
94
|
+
const context = String(input.context ?? provider.default_context ?? '').trim();
|
|
95
|
+
if (context.length > MAX_CONTEXT) throw new Error(`语气提示不超过 ${MAX_CONTEXT} 字`);
|
|
96
|
+
return { api_key_ref, speaker, member_voices, file_voice, ...(provider.context ? { context } : {}), ...(provider.region ? { region } : {}) };
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
/**
|
|
100
|
+
* Validate and save the speech settings the page edits: the reading service, each service's part (its tone among them), rate, and
|
|
101
|
+
* the voice-input service. A service is saved only once the user picks one; until then neither is sent and the default
|
|
102
|
+
* follows what is installed, so editing a voice or the rate before installing the local service does not pin the cloud one.
|
|
103
|
+
*/
|
|
104
|
+
export function save_tts_settings(home, input) {
|
|
105
|
+
const current = tts_settings(home);
|
|
106
|
+
const path = join(home, SETTINGS_FILE);
|
|
107
|
+
const saved = existsSync(path) ? JSON.parse(readFileSync(path, 'utf8')) : {};
|
|
108
|
+
const provider = input.provider ?? saved.provider;
|
|
109
|
+
if (provider !== undefined && !PROVIDER_IDS.includes(provider)) throw new Error('请选择语音服务');
|
|
110
|
+
const speech_rate = Number(input.speech_rate ?? 0);
|
|
111
|
+
if (!Number.isInteger(speech_rate) || speech_rate < -50 || speech_rate > 100) throw new Error('语速须为 -50 到 100 的整数');
|
|
112
|
+
const stt_provider = input.stt_provider ?? saved.stt_provider;
|
|
113
|
+
if (stt_provider !== undefined && !STT_IDS.includes(stt_provider)) throw new Error('请选择语音输入服务');
|
|
114
|
+
const providers = Object.fromEntries(TTS_PROVIDERS.map(item => [item.id, check_provider(item, input.providers?.[item.id] || current.providers[item.id])]));
|
|
115
|
+
mkdirSync(home, { recursive: true, mode: 0o700 });
|
|
116
|
+
atomic_json(join(home, SETTINGS_FILE), { provider, speech_rate, providers, stt_provider });
|
|
117
|
+
return tts_settings(home);
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
/** The user stopped reading: the chosen service frees what it holds on this computer (the local model's memory). */
|
|
121
|
+
export function tts_release(home) {
|
|
122
|
+
provider_release(tts_settings(home).provider, home);
|
|
123
|
+
return { released: true };
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
/** Read a cached synthesis, refreshing its time so the most recently heard stay; null when absent or unreadable. */
|
|
127
|
+
function cache_read(path) {
|
|
128
|
+
try { const value = JSON.parse(readFileSync(path, 'utf8')); atomic_json(path, value); return value; } catch { return null; }
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
/** Keep the cache bounded: past the limit, drop the least recently heard entries. */
|
|
132
|
+
function cache_write(directory, path, value) {
|
|
133
|
+
mkdirSync(directory, { recursive: true, mode: 0o700 });
|
|
134
|
+
atomic_json(path, value);
|
|
135
|
+
const entries = readdirSync(directory).filter(name => name.endsWith('.json')).map(name => {
|
|
136
|
+
const { size, mtimeMs } = statSync(join(directory, name));
|
|
137
|
+
return { name, size, mtimeMs };
|
|
138
|
+
});
|
|
139
|
+
let total = entries.reduce((sum, entry) => sum + entry.size, 0);
|
|
140
|
+
if (total <= CACHE_LIMIT_BYTES) return;
|
|
141
|
+
for (const entry of entries.sort((a, b) => a.mtimeMs - b.mtimeMs)) {
|
|
142
|
+
if (total <= CACHE_KEEP_BYTES) break;
|
|
143
|
+
rmSync(join(directory, entry.name), { force: true });
|
|
144
|
+
total -= entry.size;
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
/**
|
|
149
|
+
* Synthesize one paragraph with the chosen service and return it as base64 MP3 with word timings for highlighting.
|
|
150
|
+
* `speaker` may name another voice for this paragraph (a member's own voice); `silence_ms` appends trailing silence.
|
|
151
|
+
* Requests of one reading pass share `section_id`, so Volcengine keeps the earlier paragraphs as context.
|
|
152
|
+
* @param {{ request?: Function, open?: Function }} [transport] `fetch` and WebSocket factory, replaceable in tests.
|
|
153
|
+
*/
|
|
154
|
+
export async function tts_speak(home, input, transport) {
|
|
155
|
+
const text = typeof input?.text === 'string' ? input.text.trim() : '';
|
|
156
|
+
if (!text) throw new Error('朗读文本为空');
|
|
157
|
+
if (text.length > TTS_MAX_TEXT) throw new Error(`单次朗读不超过 ${TTS_MAX_TEXT} 字`);
|
|
158
|
+
const settings = tts_settings(home);
|
|
159
|
+
const provider = provider_of(settings.provider);
|
|
160
|
+
const own = settings.providers[provider.id];
|
|
161
|
+
if (!own.api_key_ref) throw new Error(provider.local ? '本机语音尚未安装:请让本机 AI 按 local-tts-setup 技能安装'
|
|
162
|
+
: `尚未配置语音:请在设置的“语音”中填写${provider.label} API Key`);
|
|
163
|
+
const speaker = SPEAKER_PATTERN.test(input.speaker || '') ? input.speaker : own.speaker;
|
|
164
|
+
const silence = Math.max(0, Math.min(MAX_SILENCE_MS, Math.round(Number(input.silence_ms) || 0)));
|
|
165
|
+
const context = provider.context ? own.context : '';
|
|
166
|
+
const directory = join(home, CACHE_DIR);
|
|
167
|
+
// Local audio cached before 2026-11-10 has its index at the end, which iPhone Safari cannot play; a new key leaves it unused.
|
|
168
|
+
const cache_path = join(directory, `${createHash('sha256').update(JSON.stringify([text, speaker, settings.speech_rate, context, silence,
|
|
169
|
+
...(provider.id === 'volcengine' ? [] : [provider.local ? 'local-faststart' : provider.id])])).digest('hex')}.json`);
|
|
170
|
+
const cached = existsSync(cache_path) && cache_read(cache_path);
|
|
171
|
+
if (cached?.audio) return { ...cached, cached: true };
|
|
172
|
+
if (!in_flight.has(cache_path)) {
|
|
173
|
+
const key = read_saved_api_key(home, provider.key_base_url, own.api_key_ref);
|
|
174
|
+
const section_id = KEY_REF_PATTERN.test(input.section_id || '') ? input.section_id : undefined;
|
|
175
|
+
in_flight.set(cache_path, provider_speak(provider.id, { key, text, speaker, rate: settings.speech_rate, context, silence, section_id, region: own.region, home }, transport)
|
|
176
|
+
.then((result) => { cache_write(directory, cache_path, result); return result; })
|
|
177
|
+
.finally(() => in_flight.delete(cache_path)));
|
|
178
|
+
}
|
|
179
|
+
return in_flight.get(cache_path);
|
|
180
|
+
}
|