refactor: separate local voice handlers and instructions

This commit is contained in:
Sameh Khamis committed 2026-09-12 12:59:39 -07:00
1 parent 318d37ad8d
commit 638902296a
17 files changed
+1094 -951

No files matched your search

+22
View File
@@ -294,5 +294,27 @@
"src/data/regionalBrief.js"
],
"external": []
},
"openai-provider": {
"runtime": "node",
"exports": [
"./server/providers/openai"
],
"modules": [
"server/providers/common/rate-limit.js",
"server/providers/common/request.js",
"server/providers/common/source-root.js",
"server/providers/openai.js",
"server/providers/openai/constants.js",
"server/providers/openai/debug-log.js",
"server/providers/openai/hud-summary.js",
"server/providers/openai/instructions.js",
"server/providers/openai/rate-limit.js",
"server/providers/openai/realtime.js",
"server/providers/openai/tools.js",
"src/hudSummaryResponse.js",
"src/voice/voiceCost.js"
],
"external": []
}
}
+5 -4
View File
@@ -13,7 +13,7 @@
*
* Every touched file is restored on exit, including on failure.
*
* NOTE: two mutations edit server/providers/local.js, and a running dev server watches that
* NOTE: two mutations edit server/providers/openai/instructions.js, and a running dev server watches that
* file and restarts on every write. Writes are therefore content-guarded below
* so the file is touched exactly twice per mutation instead of on every
* iteration — enough that a dev server survives, but expect it to restart. If
@@ -31,7 +31,8 @@ const FILES = {
module: path.join(ROOT, 'src', 'firstRunExperience.js'),
html: path.join(ROOT, 'index.html'),
css: path.join(ROOT, 'style.css'),
vite: path.join(ROOT, 'server/providers/local.js'),
voiceInstructions: path.join(ROOT, 'server/providers/openai/instructions.js'),
voiceTools: path.join(ROOT, 'server/providers/openai/tools.js'),
main: path.join(ROOT, 'src', 'main.js'),
ui: path.join(ROOT, 'src', 'ui.js'),
docs: path.join(ROOT, 'docs', 'CURRENT-STATE.md'),
@@ -452,13 +453,13 @@ const MUTATIONS = [
// ── Voice: schema must not drift ──────────────────────────────────────────
{
defect: 'the voice TOOL SCHEMA is edited (a Realtime prompt-cache bust)',
file: 'vite',
file: 'voiceTools',
from: " 'earthquakes',\n 'satellites',",
to: " 'earthquakes',\n 'infrastructure-mode',\n 'satellites',",
},
{
defect: 'the instruction mapping is dropped, so voice cannot reach the modes',
file: 'vite',
file: 'voiceInstructions',
from: " 'NAMED VIEWS are shorthand",
to: " // 'NAMED VIEWS are shorthand",
},