@openchamber/web 1.21.1 → 1.22.0
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/dist/assets/{CodeMirrorCommentWidgets-BGj8TJxW.js → CodeMirrorCommentWidgets-CPvfxh0N.js} +1 -1
- package/dist/assets/{CommitSection-DwGiXyjf.js → CommitSection-CC5mFzO2.js} +1 -1
- package/dist/assets/DiffView-6xGdyI0n.js +4 -0
- package/dist/assets/FilesView-Bm3vT63N.js +17 -0
- package/dist/assets/GitView-B6y1Y69c.js +6 -0
- package/dist/assets/{JsonTreeView-CggOsLot.js → JsonTreeView-rwHz84MX.js} +1 -1
- package/dist/assets/LinearIssuesView-B0UM_Rkx.js +1 -0
- package/dist/assets/MarkdownImageGallery-sGilV9Hs.js +1 -0
- package/dist/assets/MarkdownRendererImpl--4sRsKBn.js +12 -0
- package/dist/assets/OnboardingScreen-CECL_Cms.js +1 -0
- package/dist/assets/{PatchDiff-DJYMUiXA.js → PatchDiff-BGPl1s-U.js} +1 -1
- package/dist/assets/{PierreDiffViewer-CY2bx_SB.js → PierreDiffViewer-Cvz9Z-io.js} +3 -3
- package/dist/assets/{PlanView-PkiOY_9H.js → PlanView-BFMsnHk3.js} +4 -4
- package/dist/assets/SettingsView-_Gtn5SdT.js +28 -0
- package/dist/assets/{SettingsWindow-oyOm2fHR.js → SettingsWindow-C1Qa09YO.js} +1 -1
- package/dist/assets/{ToolOutputDialog-lKyeQTPL.js → ToolOutputDialog-DzQlzMF4.js} +5 -5
- package/dist/assets/{ToolPartDiffPreview-C7kBQNAA.js → ToolPartDiffPreview-DfVOfwHy.js} +2 -2
- package/dist/assets/{VirtualizedFileDiff-BP7ebDFF.js → VirtualizedFileDiff-DT5MDv-u.js} +1 -1
- package/dist/assets/WalkthroughView-D8sLH_M8.js +4 -0
- package/dist/assets/{computeVirtualFileMetrics-CZ0xPeaT.js → computeVirtualFileMetrics-DmpLWhll.js} +1 -1
- package/dist/assets/{contextPanelEmbeddedChat-C9abMBTb.js → contextPanelEmbeddedChat-BK78t3M_.js} +1 -1
- package/dist/assets/{de-CEoCz3j6.js → de-C3luvSd_.js} +4 -4
- package/dist/assets/{es-DwyXCqaL.js → es-CmU4HLv9.js} +3 -3
- package/dist/assets/{fr-CS7Csln9.js → fr-Bgyni40l.js} +4 -4
- package/dist/assets/index-C57jT0Sa.css +1 -0
- package/dist/assets/{index-CaPAjwXQ.js → index-CWYs7sMK.js} +1 -1
- package/dist/assets/index-b0zDkWyg.js +7 -0
- package/dist/assets/{isDiffPlainText-ZBvDxhVB.js → isDiffPlainText-BO_q5ezD.js} +1 -1
- package/dist/assets/{isFilePlainText-DiLRrkJr.js → isFilePlainText-D8qPqUAf.js} +1 -1
- package/dist/assets/{ja-vnwqLcx6.js → ja-C1ImKinT.js} +4 -4
- package/dist/assets/{ko-CXuSfZv5.js → ko-CP7OdxYH.js} +4 -4
- package/dist/assets/main-D4rd8Hy5.js +928 -0
- package/dist/assets/{main-D5RWr6sJ.js → main-D7fwjW2z.js} +2 -2
- package/dist/assets/markdownCore-BcmkWZPO.js +3 -0
- package/dist/assets/{miniChat-CqR3icsk.js → miniChat-D5rraz-g.js} +2 -2
- package/dist/assets/{mobile-RN_UTTlB.js → mobile-Cg_DE3KL.js} +2 -2
- package/dist/assets/{patchFileDiff-CjRR5ESs.js → patchFileDiff-Bpql0QGw.js} +3 -3
- package/dist/assets/{pl-BJxry0Mi.js → pl-DQYSiGYX.js} +4 -4
- package/dist/assets/{pt-BR-DxLmkhdv.js → pt-BR-DytpsW4M.js} +3 -3
- package/dist/assets/{renderElectronMiniChatApp-1wC94fQK.js → renderElectronMiniChatApp-B_Bn7BbN.js} +2 -2
- package/dist/assets/renderMobileApp-DLfxMzGJ.js +25 -0
- package/dist/assets/runtimeEndpointReset-HlRmXFGW.js +16 -0
- package/dist/assets/scheduledTasksApi-BPvxrynl.js +1 -0
- package/dist/assets/{shikiHighlight-fGmFkxAM.js → shikiHighlight-CFAVs_lu.js} +1 -1
- package/dist/assets/tr-aizaUvft.js +6 -0
- package/dist/assets/{uk-ClgQjmlw.js → uk-DwnRxJZd.js} +3 -3
- package/dist/assets/{useAppFontEffects-KP8_yiGW.js → useAppFontEffects-DWXGRUPZ.js} +191 -151
- package/dist/assets/useInlineCommentController-Cc0OCXr0.js +2 -0
- package/dist/assets/useRootScrollLock-BFZtfciC.js +1 -0
- package/dist/assets/{vendor-codemirror-language-data-DrTPkHl4.js → vendor-codemirror-language-data-BGFszm8n.js} +2 -2
- package/dist/assets/{web-components-DOXvU-tB.js → web-components-CD-GFayc.js} +4 -4
- package/dist/assets/{zh-CN-Ba6y8H-i.js → zh-CN-UDNMxm7r.js} +3 -3
- package/dist/assets/zh-TW-BsswdYL-.js +15 -0
- package/dist/index.html +4 -4
- package/dist/mini-chat.html +3 -3
- package/dist/mobile.html +3 -3
- package/package.json +1 -1
- package/server/index.js +4 -0
- package/server/lib/dictation/DOCUMENTATION.md +19 -6
- package/server/lib/dictation/local/model-catalog.js +220 -0
- package/server/lib/dictation/local/model-catalog.test.js +42 -0
- package/server/lib/dictation/local/sherpa-tts.js +41 -20
- package/server/lib/dictation/local/worker-process.js +2 -0
- package/server/lib/dictation/runtime.js +4 -0
- package/server/lib/dictation/service.js +27 -4
- package/server/lib/fs/DOCUMENTATION.md +4 -0
- package/server/lib/fs/routes.js +129 -0
- package/server/lib/fs/routes.test.js +219 -0
- package/server/lib/linear/DOCUMENTATION.md +97 -0
- package/server/lib/linear/OAUTH-BROKER-HANDOFF.md +91 -0
- package/server/lib/linear/auth.js +436 -0
- package/server/lib/linear/auth.test.js +242 -0
- package/server/lib/linear/client.js +191 -0
- package/server/lib/linear/index.js +61 -0
- package/server/lib/linear/issues.js +499 -0
- package/server/lib/linear/issues.test.js +512 -0
- package/server/lib/linear/mapping.js +188 -0
- package/server/lib/linear/mapping.test.js +147 -0
- package/server/lib/linear/oauth.js +345 -0
- package/server/lib/linear/oauth.test.js +166 -0
- package/server/lib/linear/parse.js +23 -0
- package/server/lib/linear/routes.js +432 -0
- package/server/lib/linear/routes.test.js +661 -0
- package/server/lib/linear/status-runtime.js +64 -0
- package/server/lib/linear/status-runtime.test.js +167 -0
- package/server/lib/linear/status.js +280 -0
- package/server/lib/linear/status.test.js +271 -0
- package/server/lib/linear/teams.js +72 -0
- package/server/lib/linear/teams.test.js +94 -0
- package/server/lib/opencode/feature-routes-runtime.js +2 -0
- package/server/lib/opencode/static-routes-runtime.js +3 -3
- package/server/lib/projects/project-config.js +33 -5
- package/server/lib/projects/project-config.test.js +85 -0
- package/server/lib/scheduled-tasks/DOCUMENTATION.md +7 -0
- package/server/lib/tts/DOCUMENTATION.md +1 -0
- package/server/lib/tts/language-detect.js +210 -0
- package/server/lib/tts/language-detect.test.js +76 -0
- package/server/lib/tts/routes.js +23 -1
- package/server/lib/tts/routes.test.js +26 -0
- package/dist/assets/DiffView-Db6bjVv1.js +0 -4
- package/dist/assets/FilesView-DQOa7Lgz.js +0 -17
- package/dist/assets/GitView-CHzJxTi0.js +0 -6
- package/dist/assets/MarkdownImageGallery-DoZpaHev.js +0 -1
- package/dist/assets/MarkdownRendererImpl-B5Y5xCOz.js +0 -12
- package/dist/assets/OnboardingScreen-C98d69Fp.js +0 -1
- package/dist/assets/SettingsView-D-K3ELCM.js +0 -28
- package/dist/assets/WalkthroughView-MuJodAHD.js +0 -4
- package/dist/assets/index-CUKcHnUA.css +0 -1
- package/dist/assets/index-DIvDEKE-.js +0 -7
- package/dist/assets/main-DLlfDjQ_.js +0 -926
- package/dist/assets/markdownCore-CcTcLsQF.js +0 -3
- package/dist/assets/renderMobileApp-ltva2Plg.js +0 -25
- package/dist/assets/runtimeEndpointReset-D6SmNZaP.js +0 -15
- package/dist/assets/scheduledTasksApi-mjMDet_H.js +0 -1
- package/dist/assets/tr-5Mk_hQ2Q.js +0 -6
- package/dist/assets/useInlineCommentController-HIjtuhxD.js +0 -2
- package/dist/assets/useRootScrollLock-BSiQ5F75.js +0 -1
- package/dist/assets/zh-TW-Dv8yyhN1.js +0 -15
package/dist/index.html
CHANGED
|
@@ -509,16 +509,16 @@
|
|
|
509
509
|
pointer-events: none;
|
|
510
510
|
}
|
|
511
511
|
</style>
|
|
512
|
-
<script type="module" crossorigin src="/assets/main-
|
|
512
|
+
<script type="module" crossorigin src="/assets/main-D7fwjW2z.js"></script>
|
|
513
513
|
<link rel="modulepreload" crossorigin href="/assets/vendor-vite-runtime-DD1OZmLC.js">
|
|
514
514
|
<link rel="modulepreload" crossorigin href="/assets/vendor-scheduler-7OC5HNn7.js">
|
|
515
515
|
<link rel="modulepreload" crossorigin href="/assets/vendor-react-BUCujlKS.js">
|
|
516
516
|
<link rel="modulepreload" crossorigin href="/assets/vendor-zustand-BAGL70zf.js">
|
|
517
517
|
<link rel="modulepreload" crossorigin href="/assets/vendor-zod-BLfBSgBh.js">
|
|
518
518
|
<link rel="modulepreload" crossorigin href="/assets/vendor-opencode-sdk-BJ73u-bH.js">
|
|
519
|
-
<link rel="modulepreload" crossorigin href="/assets/index-
|
|
520
|
-
<link rel="modulepreload" crossorigin href="/assets/contextPanelEmbeddedChat-
|
|
521
|
-
<link rel="stylesheet" crossorigin href="/assets/index-
|
|
519
|
+
<link rel="modulepreload" crossorigin href="/assets/index-b0zDkWyg.js">
|
|
520
|
+
<link rel="modulepreload" crossorigin href="/assets/contextPanelEmbeddedChat-BK78t3M_.js">
|
|
521
|
+
<link rel="stylesheet" crossorigin href="/assets/index-C57jT0Sa.css">
|
|
522
522
|
</head>
|
|
523
523
|
<body class="h-full bg-background text-foreground">
|
|
524
524
|
<div id="root" class="h-full">
|
package/dist/mini-chat.html
CHANGED
|
@@ -74,15 +74,15 @@
|
|
|
74
74
|
}
|
|
75
75
|
</style>
|
|
76
76
|
|
|
77
|
-
<script type="module" crossorigin src="/assets/miniChat-
|
|
77
|
+
<script type="module" crossorigin src="/assets/miniChat-D5rraz-g.js"></script>
|
|
78
78
|
<link rel="modulepreload" crossorigin href="/assets/vendor-vite-runtime-DD1OZmLC.js">
|
|
79
79
|
<link rel="modulepreload" crossorigin href="/assets/vendor-scheduler-7OC5HNn7.js">
|
|
80
80
|
<link rel="modulepreload" crossorigin href="/assets/vendor-react-BUCujlKS.js">
|
|
81
81
|
<link rel="modulepreload" crossorigin href="/assets/vendor-zustand-BAGL70zf.js">
|
|
82
82
|
<link rel="modulepreload" crossorigin href="/assets/vendor-zod-BLfBSgBh.js">
|
|
83
83
|
<link rel="modulepreload" crossorigin href="/assets/vendor-opencode-sdk-BJ73u-bH.js">
|
|
84
|
-
<link rel="modulepreload" crossorigin href="/assets/index-
|
|
85
|
-
<link rel="stylesheet" crossorigin href="/assets/index-
|
|
84
|
+
<link rel="modulepreload" crossorigin href="/assets/index-b0zDkWyg.js">
|
|
85
|
+
<link rel="stylesheet" crossorigin href="/assets/index-C57jT0Sa.css">
|
|
86
86
|
</head>
|
|
87
87
|
<body class="h-full bg-background text-foreground">
|
|
88
88
|
<div id="root" class="h-full">
|
package/dist/mobile.html
CHANGED
|
@@ -63,15 +63,15 @@
|
|
|
63
63
|
})();
|
|
64
64
|
</script>
|
|
65
65
|
|
|
66
|
-
<script type="module" crossorigin src="/assets/mobile-
|
|
66
|
+
<script type="module" crossorigin src="/assets/mobile-Cg_DE3KL.js"></script>
|
|
67
67
|
<link rel="modulepreload" crossorigin href="/assets/vendor-vite-runtime-DD1OZmLC.js">
|
|
68
68
|
<link rel="modulepreload" crossorigin href="/assets/vendor-scheduler-7OC5HNn7.js">
|
|
69
69
|
<link rel="modulepreload" crossorigin href="/assets/vendor-react-BUCujlKS.js">
|
|
70
70
|
<link rel="modulepreload" crossorigin href="/assets/vendor-zustand-BAGL70zf.js">
|
|
71
71
|
<link rel="modulepreload" crossorigin href="/assets/vendor-zod-BLfBSgBh.js">
|
|
72
72
|
<link rel="modulepreload" crossorigin href="/assets/vendor-opencode-sdk-BJ73u-bH.js">
|
|
73
|
-
<link rel="modulepreload" crossorigin href="/assets/index-
|
|
74
|
-
<link rel="stylesheet" crossorigin href="/assets/index-
|
|
73
|
+
<link rel="modulepreload" crossorigin href="/assets/index-b0zDkWyg.js">
|
|
74
|
+
<link rel="stylesheet" crossorigin href="/assets/index-C57jT0Sa.css">
|
|
75
75
|
</head>
|
|
76
76
|
<body class="h-full bg-background text-foreground">
|
|
77
77
|
<div id="root" class="h-full"></div>
|
package/package.json
CHANGED
package/server/index.js
CHANGED
|
@@ -77,6 +77,7 @@ import { createOpenCodeWatcherRuntime } from './lib/opencode/watcher.js';
|
|
|
77
77
|
import { createSessionAssistRuntime } from './lib/session-assist/runtime.js';
|
|
78
78
|
import { createSessionGoalRuntime } from './lib/session-goal/runtime.js';
|
|
79
79
|
import { createContextObligatoryRuntime } from './lib/context-obligatory/runtime.js';
|
|
80
|
+
import { createLinearSessionStatusRuntime } from './lib/linear/status-runtime.js';
|
|
80
81
|
import { createSessionKnowledgeRuntime } from './lib/session-knowledge/runtime.js';
|
|
81
82
|
import { createScheduledTasksRuntime } from './lib/scheduled-tasks/runtime.js';
|
|
82
83
|
import { createServerStartupRuntime } from './lib/opencode/server-startup-runtime.js';
|
|
@@ -856,6 +857,8 @@ const contextObligatoryRuntime = createContextObligatoryRuntime({
|
|
|
856
857
|
sessionKnowledgeRuntime,
|
|
857
858
|
});
|
|
858
859
|
|
|
860
|
+
const linearSessionStatusRuntime = createLinearSessionStatusRuntime();
|
|
861
|
+
|
|
859
862
|
const globalMessageStreamHub = createGlobalMessageStreamHub({
|
|
860
863
|
buildOpenCodeUrl,
|
|
861
864
|
getOpenCodeAuthHeaders,
|
|
@@ -901,6 +904,7 @@ globalMessageStreamHub.subscribeEvent((event) => {
|
|
|
901
904
|
sessionAssistRuntime.processPayload(payload, directory);
|
|
902
905
|
sessionGoalRuntime.processPayload(payload, directory);
|
|
903
906
|
contextObligatoryRuntime.processPayload(payload, directory);
|
|
907
|
+
linearSessionStatusRuntime.processPayload(payload);
|
|
904
908
|
});
|
|
905
909
|
|
|
906
910
|
const processForwardedEventPayload = (payload, emitSyntheticEvent) => {
|
|
@@ -11,12 +11,25 @@ live transcript costs O(n^2) work for a result the final decode replaces. The
|
|
|
11
11
|
composer shows no text while recording and inserts the full transcript on
|
|
12
12
|
stop.
|
|
13
13
|
|
|
14
|
-
Local TTS (Kokoro via sherpa-onnx OfflineTts) runs in the same
|
|
15
|
-
and is exposed as `POST /api/dictation/tts/speak` (JSON
|
|
16
|
-
speed?, model?}` → WAV bytes; 503 with
|
|
17
|
-
downloading). TTS models live in the same
|
|
18
|
-
(`local/model-catalog.js`
|
|
19
|
-
same status/download/delete
|
|
14
|
+
Local TTS (Kokoro and Piper/VITS via sherpa-onnx OfflineTts) runs in the same
|
|
15
|
+
worker process and is exposed as `POST /api/dictation/tts/speak` (JSON
|
|
16
|
+
`{text, speakerId?, speed?, model?, language?, languageSample?}` → WAV bytes; 503 with
|
|
17
|
+
`reasonCode` while the model is downloading). TTS models live in the same
|
|
18
|
+
catalog/downloader as STT models (`local/model-catalog.js`
|
|
19
|
+
`LOCAL_TTS_MODEL_CATALOG`) and are managed by the same status/download/delete
|
|
20
|
+
routes.
|
|
21
|
+
|
|
22
|
+
Each TTS catalog entry declares the `languages` it speaks. With
|
|
23
|
+
`language: 'auto'` the service detects the language of `languageSample` — the
|
|
24
|
+
whole message the chunk belongs to, sent by the client with every chunk — or
|
|
25
|
+
of `text` when no sample is given
|
|
26
|
+
(`../tts/language-detect.js`, script plus function-word scoring, no
|
|
27
|
+
dependencies) and keeps the caller's model when it speaks that language;
|
|
28
|
+
otherwise it switches to the catalog model for the language, downloading it on
|
|
29
|
+
first use like any other model, and starts from that model's default speaker
|
|
30
|
+
(`defaultSpeakerByLanguage`) instead of the caller's speaker id. A language no
|
|
31
|
+
catalog model covers keeps the caller's model, so text is always spoken. The
|
|
32
|
+
response carries `X-Speech-Model` and `X-Speech-Language`.
|
|
20
33
|
|
|
21
34
|
## Ownership
|
|
22
35
|
|
|
@@ -68,9 +68,19 @@ export const LOCAL_STT_MODEL_CATALOG = {
|
|
|
68
68
|
* Local text-to-speech models (sherpa-onnx OfflineTts). Downloaded and
|
|
69
69
|
* managed through the same pipeline as the STT models.
|
|
70
70
|
*/
|
|
71
|
+
/**
|
|
72
|
+
* Local text-to-speech models (sherpa-onnx OfflineTts). Downloaded and
|
|
73
|
+
* managed through the same pipeline as the STT models.
|
|
74
|
+
*
|
|
75
|
+
* `languages` lists the languages a model speaks well; the speech service
|
|
76
|
+
* uses it to pick a model for the language a text is written in. Kokoro
|
|
77
|
+
* models carry speaker ids (`voices`); a Piper model is one voice for one
|
|
78
|
+
* language. `lexicon` entries are joined with commas for sherpa-onnx.
|
|
79
|
+
*/
|
|
71
80
|
export const LOCAL_TTS_MODEL_CATALOG = {
|
|
72
81
|
'kokoro-en-v0_19': {
|
|
73
82
|
type: 'kokoro',
|
|
83
|
+
languages: ['en'],
|
|
74
84
|
archiveUrl:
|
|
75
85
|
'https://github.com/k2-fsa/sherpa-onnx/releases/download/tts-models/kokoro-en-v0_19.tar.bz2',
|
|
76
86
|
extractedDir: 'kokoro-en-v0_19',
|
|
@@ -82,6 +92,188 @@ export const LOCAL_TTS_MODEL_CATALOG = {
|
|
|
82
92
|
},
|
|
83
93
|
description: 'Kokoro TTS (English, natural voices)',
|
|
84
94
|
},
|
|
95
|
+
'kokoro-multi-lang-v1_1': {
|
|
96
|
+
type: 'kokoro',
|
|
97
|
+
languages: ['zh', 'en'],
|
|
98
|
+
// sherpa-onnx wires this Kokoro build for Chinese and English only;
|
|
99
|
+
// speakers 0-2 are English, 3-102 Chinese.
|
|
100
|
+
defaultSpeakerByLanguage: { en: 0, zh: 3 },
|
|
101
|
+
archiveUrl:
|
|
102
|
+
'https://github.com/k2-fsa/sherpa-onnx/releases/download/tts-models/kokoro-multi-lang-v1_1.tar.bz2',
|
|
103
|
+
extractedDir: 'kokoro-multi-lang-v1_1',
|
|
104
|
+
files: {
|
|
105
|
+
model: 'model.onnx',
|
|
106
|
+
voices: 'voices.bin',
|
|
107
|
+
tokens: 'tokens.txt',
|
|
108
|
+
espeakData: 'espeak-ng-data',
|
|
109
|
+
lexiconEnglish: 'lexicon-us-en.txt',
|
|
110
|
+
lexiconChinese: 'lexicon-zh.txt',
|
|
111
|
+
},
|
|
112
|
+
lexicon: ['lexiconEnglish', 'lexiconChinese'],
|
|
113
|
+
description: 'Kokoro TTS (Chinese and English, 103 voices)',
|
|
114
|
+
},
|
|
115
|
+
// The larger `ukrainian_tts-medium` build is a character-level model
|
|
116
|
+
// (`phoneme_type: text`); sherpa-onnx phonemizes every Piper model through
|
|
117
|
+
// espeak-ng, which turns that one into noise. `vits-coqui-uk-mai` sounds
|
|
118
|
+
// better but reads Cyrillic only and drops every Latin word (file names,
|
|
119
|
+
// product names), which is unusable in a coding chat. Lada is an espeak
|
|
120
|
+
// model: small, but it reads mixed text.
|
|
121
|
+
'piper-uk_UA-lada-x_low': {
|
|
122
|
+
type: 'vits',
|
|
123
|
+
languages: ['uk'],
|
|
124
|
+
archiveUrl:
|
|
125
|
+
'https://github.com/k2-fsa/sherpa-onnx/releases/download/tts-models/vits-piper-uk_UA-lada-x_low.tar.bz2',
|
|
126
|
+
extractedDir: 'vits-piper-uk_UA-lada-x_low',
|
|
127
|
+
files: {
|
|
128
|
+
model: 'uk_UA-lada-x_low.onnx',
|
|
129
|
+
tokens: 'tokens.txt',
|
|
130
|
+
espeakData: 'espeak-ng-data',
|
|
131
|
+
},
|
|
132
|
+
description: 'Piper TTS (Ukrainian)',
|
|
133
|
+
},
|
|
134
|
+
'piper-de_DE-thorsten-medium': {
|
|
135
|
+
type: 'vits',
|
|
136
|
+
languages: ['de'],
|
|
137
|
+
archiveUrl:
|
|
138
|
+
'https://github.com/k2-fsa/sherpa-onnx/releases/download/tts-models/vits-piper-de_DE-thorsten-medium.tar.bz2',
|
|
139
|
+
extractedDir: 'vits-piper-de_DE-thorsten-medium',
|
|
140
|
+
files: {
|
|
141
|
+
model: 'de_DE-thorsten-medium.onnx',
|
|
142
|
+
tokens: 'tokens.txt',
|
|
143
|
+
espeakData: 'espeak-ng-data',
|
|
144
|
+
},
|
|
145
|
+
description: 'Piper TTS (German)',
|
|
146
|
+
},
|
|
147
|
+
'piper-fr_FR-siwis-medium': {
|
|
148
|
+
type: 'vits',
|
|
149
|
+
languages: ['fr'],
|
|
150
|
+
archiveUrl:
|
|
151
|
+
'https://github.com/k2-fsa/sherpa-onnx/releases/download/tts-models/vits-piper-fr_FR-siwis-medium.tar.bz2',
|
|
152
|
+
extractedDir: 'vits-piper-fr_FR-siwis-medium',
|
|
153
|
+
files: {
|
|
154
|
+
model: 'fr_FR-siwis-medium.onnx',
|
|
155
|
+
tokens: 'tokens.txt',
|
|
156
|
+
espeakData: 'espeak-ng-data',
|
|
157
|
+
},
|
|
158
|
+
description: 'Piper TTS (French)',
|
|
159
|
+
},
|
|
160
|
+
'piper-es_ES-davefx-medium': {
|
|
161
|
+
type: 'vits',
|
|
162
|
+
languages: ['es'],
|
|
163
|
+
archiveUrl:
|
|
164
|
+
'https://github.com/k2-fsa/sherpa-onnx/releases/download/tts-models/vits-piper-es_ES-davefx-medium.tar.bz2',
|
|
165
|
+
extractedDir: 'vits-piper-es_ES-davefx-medium',
|
|
166
|
+
files: {
|
|
167
|
+
model: 'es_ES-davefx-medium.onnx',
|
|
168
|
+
tokens: 'tokens.txt',
|
|
169
|
+
espeakData: 'espeak-ng-data',
|
|
170
|
+
},
|
|
171
|
+
description: 'Piper TTS (Spanish)',
|
|
172
|
+
},
|
|
173
|
+
'piper-it_IT-paola-medium': {
|
|
174
|
+
type: 'vits',
|
|
175
|
+
languages: ['it'],
|
|
176
|
+
archiveUrl:
|
|
177
|
+
'https://github.com/k2-fsa/sherpa-onnx/releases/download/tts-models/vits-piper-it_IT-paola-medium.tar.bz2',
|
|
178
|
+
extractedDir: 'vits-piper-it_IT-paola-medium',
|
|
179
|
+
files: {
|
|
180
|
+
model: 'it_IT-paola-medium.onnx',
|
|
181
|
+
tokens: 'tokens.txt',
|
|
182
|
+
espeakData: 'espeak-ng-data',
|
|
183
|
+
},
|
|
184
|
+
description: 'Piper TTS (Italian)',
|
|
185
|
+
},
|
|
186
|
+
'piper-pt_BR-faber-medium': {
|
|
187
|
+
type: 'vits',
|
|
188
|
+
languages: ['pt'],
|
|
189
|
+
archiveUrl:
|
|
190
|
+
'https://github.com/k2-fsa/sherpa-onnx/releases/download/tts-models/vits-piper-pt_BR-faber-medium.tar.bz2',
|
|
191
|
+
extractedDir: 'vits-piper-pt_BR-faber-medium',
|
|
192
|
+
files: {
|
|
193
|
+
model: 'pt_BR-faber-medium.onnx',
|
|
194
|
+
tokens: 'tokens.txt',
|
|
195
|
+
espeakData: 'espeak-ng-data',
|
|
196
|
+
},
|
|
197
|
+
description: 'Piper TTS (Portuguese (Brazil))',
|
|
198
|
+
},
|
|
199
|
+
'piper-pl_PL-gosia-medium': {
|
|
200
|
+
type: 'vits',
|
|
201
|
+
languages: ['pl'],
|
|
202
|
+
archiveUrl:
|
|
203
|
+
'https://github.com/k2-fsa/sherpa-onnx/releases/download/tts-models/vits-piper-pl_PL-gosia-medium.tar.bz2',
|
|
204
|
+
extractedDir: 'vits-piper-pl_PL-gosia-medium',
|
|
205
|
+
files: {
|
|
206
|
+
model: 'pl_PL-gosia-medium.onnx',
|
|
207
|
+
tokens: 'tokens.txt',
|
|
208
|
+
espeakData: 'espeak-ng-data',
|
|
209
|
+
},
|
|
210
|
+
description: 'Piper TTS (Polish)',
|
|
211
|
+
},
|
|
212
|
+
'piper-ru_RU-irina-medium': {
|
|
213
|
+
type: 'vits',
|
|
214
|
+
languages: ['ru'],
|
|
215
|
+
archiveUrl:
|
|
216
|
+
'https://github.com/k2-fsa/sherpa-onnx/releases/download/tts-models/vits-piper-ru_RU-irina-medium.tar.bz2',
|
|
217
|
+
extractedDir: 'vits-piper-ru_RU-irina-medium',
|
|
218
|
+
files: {
|
|
219
|
+
model: 'ru_RU-irina-medium.onnx',
|
|
220
|
+
tokens: 'tokens.txt',
|
|
221
|
+
espeakData: 'espeak-ng-data',
|
|
222
|
+
},
|
|
223
|
+
description: 'Piper TTS (Russian)',
|
|
224
|
+
},
|
|
225
|
+
'piper-nl_NL-pim-medium': {
|
|
226
|
+
type: 'vits',
|
|
227
|
+
languages: ['nl'],
|
|
228
|
+
archiveUrl:
|
|
229
|
+
'https://github.com/k2-fsa/sherpa-onnx/releases/download/tts-models/vits-piper-nl_NL-pim-medium.tar.bz2',
|
|
230
|
+
extractedDir: 'vits-piper-nl_NL-pim-medium',
|
|
231
|
+
files: {
|
|
232
|
+
model: 'nl_NL-pim-medium.onnx',
|
|
233
|
+
tokens: 'tokens.txt',
|
|
234
|
+
espeakData: 'espeak-ng-data',
|
|
235
|
+
},
|
|
236
|
+
description: 'Piper TTS (Dutch)',
|
|
237
|
+
},
|
|
238
|
+
'piper-cs_CZ-jirka-medium': {
|
|
239
|
+
type: 'vits',
|
|
240
|
+
languages: ['cs'],
|
|
241
|
+
archiveUrl:
|
|
242
|
+
'https://github.com/k2-fsa/sherpa-onnx/releases/download/tts-models/vits-piper-cs_CZ-jirka-medium.tar.bz2',
|
|
243
|
+
extractedDir: 'vits-piper-cs_CZ-jirka-medium',
|
|
244
|
+
files: {
|
|
245
|
+
model: 'cs_CZ-jirka-medium.onnx',
|
|
246
|
+
tokens: 'tokens.txt',
|
|
247
|
+
espeakData: 'espeak-ng-data',
|
|
248
|
+
},
|
|
249
|
+
description: 'Piper TTS (Czech)',
|
|
250
|
+
},
|
|
251
|
+
'piper-tr_TR-dfki-medium': {
|
|
252
|
+
type: 'vits',
|
|
253
|
+
languages: ['tr'],
|
|
254
|
+
archiveUrl:
|
|
255
|
+
'https://github.com/k2-fsa/sherpa-onnx/releases/download/tts-models/vits-piper-tr_TR-dfki-medium.tar.bz2',
|
|
256
|
+
extractedDir: 'vits-piper-tr_TR-dfki-medium',
|
|
257
|
+
files: {
|
|
258
|
+
model: 'tr_TR-dfki-medium.onnx',
|
|
259
|
+
tokens: 'tokens.txt',
|
|
260
|
+
espeakData: 'espeak-ng-data',
|
|
261
|
+
},
|
|
262
|
+
description: 'Piper TTS (Turkish)',
|
|
263
|
+
},
|
|
264
|
+
'piper-sv_SE-nst-medium': {
|
|
265
|
+
type: 'vits',
|
|
266
|
+
languages: ['sv'],
|
|
267
|
+
archiveUrl:
|
|
268
|
+
'https://github.com/k2-fsa/sherpa-onnx/releases/download/tts-models/vits-piper-sv_SE-nst-medium.tar.bz2',
|
|
269
|
+
extractedDir: 'vits-piper-sv_SE-nst-medium',
|
|
270
|
+
files: {
|
|
271
|
+
model: 'sv_SE-nst-medium.onnx',
|
|
272
|
+
tokens: 'tokens.txt',
|
|
273
|
+
espeakData: 'espeak-ng-data',
|
|
274
|
+
},
|
|
275
|
+
description: 'Piper TTS (Swedish)',
|
|
276
|
+
},
|
|
85
277
|
};
|
|
86
278
|
|
|
87
279
|
export const DEFAULT_LOCAL_STT_MODEL = 'parakeet-tdt-0.6b-v2-int8';
|
|
@@ -131,6 +323,34 @@ export function getLocalSttModelSpec(modelId) {
|
|
|
131
323
|
};
|
|
132
324
|
}
|
|
133
325
|
|
|
326
|
+
/**
|
|
327
|
+
* The local TTS model to use for a language, preferring the model the user
|
|
328
|
+
* selected when it speaks that language. Returns null when no catalog model
|
|
329
|
+
* covers the language, in which case callers keep the selected model.
|
|
330
|
+
* @param {string} language BCP-47 primary subtag (`uk`, `zh`...)
|
|
331
|
+
* @param {string} [preferredModelId]
|
|
332
|
+
* @returns {string | null}
|
|
333
|
+
*/
|
|
334
|
+
export function resolveLocalTtsModelForLanguage(language, preferredModelId) {
|
|
335
|
+
const speaks = (modelId) => LOCAL_TTS_MODEL_CATALOG[modelId]?.languages?.includes(language) === true;
|
|
336
|
+
if (preferredModelId && speaks(preferredModelId)) return preferredModelId;
|
|
337
|
+
const candidate = LOCAL_TTS_MODEL_IDS.find(speaks);
|
|
338
|
+
return candidate ?? null;
|
|
339
|
+
}
|
|
340
|
+
|
|
341
|
+
/**
|
|
342
|
+
* The speaker id a model should use for a language when the caller's
|
|
343
|
+
* speaker was chosen for another language. `undefined` keeps the caller's
|
|
344
|
+
* speaker.
|
|
345
|
+
* @param {string} modelId
|
|
346
|
+
* @param {string} language
|
|
347
|
+
* @returns {number | undefined}
|
|
348
|
+
*/
|
|
349
|
+
export function getLocalTtsDefaultSpeaker(modelId, language) {
|
|
350
|
+
const speaker = LOCAL_TTS_MODEL_CATALOG[modelId]?.defaultSpeakerByLanguage?.[language];
|
|
351
|
+
return Number.isInteger(speaker) ? speaker : undefined;
|
|
352
|
+
}
|
|
353
|
+
|
|
134
354
|
/**
|
|
135
355
|
* @param {string} modelsDir
|
|
136
356
|
* @param {string} modelId
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { describe, expect, it } from 'vitest';
|
|
2
|
+
import {
|
|
3
|
+
DEFAULT_LOCAL_TTS_MODEL,
|
|
4
|
+
LOCAL_TTS_MODEL_CATALOG,
|
|
5
|
+
getLocalSttModelSpec,
|
|
6
|
+
getLocalTtsDefaultSpeaker,
|
|
7
|
+
resolveLocalTtsModelForLanguage,
|
|
8
|
+
} from './model-catalog.js';
|
|
9
|
+
|
|
10
|
+
describe('local TTS catalog', () => {
|
|
11
|
+
it('keeps the selected model when it speaks the language', () => {
|
|
12
|
+
expect(resolveLocalTtsModelForLanguage('en', DEFAULT_LOCAL_TTS_MODEL)).toBe(DEFAULT_LOCAL_TTS_MODEL);
|
|
13
|
+
expect(resolveLocalTtsModelForLanguage('zh', 'kokoro-multi-lang-v1_1')).toBe('kokoro-multi-lang-v1_1');
|
|
14
|
+
});
|
|
15
|
+
|
|
16
|
+
it('picks a catalog model for a language the selected model lacks', () => {
|
|
17
|
+
expect(resolveLocalTtsModelForLanguage('uk', DEFAULT_LOCAL_TTS_MODEL)).toBe('piper-uk_UA-lada-x_low');
|
|
18
|
+
expect(resolveLocalTtsModelForLanguage('zh', DEFAULT_LOCAL_TTS_MODEL)).toBe('kokoro-multi-lang-v1_1');
|
|
19
|
+
});
|
|
20
|
+
|
|
21
|
+
it('returns null for a language no model covers', () => {
|
|
22
|
+
expect(resolveLocalTtsModelForLanguage('xx', DEFAULT_LOCAL_TTS_MODEL)).toBeNull();
|
|
23
|
+
});
|
|
24
|
+
|
|
25
|
+
it('gives Chinese a Chinese speaker on the multi-language Kokoro', () => {
|
|
26
|
+
expect(getLocalTtsDefaultSpeaker('kokoro-multi-lang-v1_1', 'zh')).toBe(3);
|
|
27
|
+
expect(getLocalTtsDefaultSpeaker('kokoro-multi-lang-v1_1', 'en')).toBe(0);
|
|
28
|
+
expect(getLocalTtsDefaultSpeaker('piper-uk_UA-lada-x_low', 'uk')).toBeUndefined();
|
|
29
|
+
});
|
|
30
|
+
|
|
31
|
+
it('every TTS entry declares its languages and installable files', () => {
|
|
32
|
+
for (const [id, spec] of Object.entries(LOCAL_TTS_MODEL_CATALOG)) {
|
|
33
|
+
expect(spec.languages.length, id).toBeGreaterThan(0);
|
|
34
|
+
expect(spec.archiveUrl, id).toMatch(/^https:\/\/github\.com\/k2-fsa\/sherpa-onnx\/releases\/download\/tts-models\//);
|
|
35
|
+
const resolved = getLocalSttModelSpec(id);
|
|
36
|
+
expect(resolved.requiredFiles, id).toContain(spec.files.model);
|
|
37
|
+
for (const key of spec.lexicon ?? []) {
|
|
38
|
+
expect(spec.files[key], `${id} lexicon ${key}`).toBeTruthy();
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
});
|
|
42
|
+
});
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Sherpa-onnx offline TTS (Kokoro). Runs inside the dictation worker process
|
|
2
|
+
* Sherpa-onnx offline TTS (Kokoro and Piper/VITS). Runs inside the dictation worker process
|
|
3
3
|
* only — never load the native addon in the main server process.
|
|
4
4
|
*/
|
|
5
5
|
|
|
@@ -23,20 +23,49 @@ function float32ToPcm16le(samples) {
|
|
|
23
23
|
return Buffer.from(out.buffer, out.byteOffset, out.byteLength);
|
|
24
24
|
}
|
|
25
25
|
|
|
26
|
+
/**
|
|
27
|
+
* sherpa-onnx model config for one catalog entry. Kokoro carries a voices
|
|
28
|
+
* bank (speaker ids) and optional lexicons; a Piper/VITS model is a single
|
|
29
|
+
* voice with espeak-ng phonemization.
|
|
30
|
+
* @param {{ modelDir: string, type?: string, files: Record<string, string>, lexicon?: string[] }} config
|
|
31
|
+
*/
|
|
32
|
+
function buildModelConfig(config) {
|
|
33
|
+
const file = (key, label) => {
|
|
34
|
+
const filePath = path.join(config.modelDir, config.files[key]);
|
|
35
|
+
assertFileExists(filePath, label);
|
|
36
|
+
return filePath;
|
|
37
|
+
};
|
|
38
|
+
const modelPath = file('model', 'TTS model');
|
|
39
|
+
const tokensPath = file('tokens', 'TTS tokens');
|
|
40
|
+
|
|
41
|
+
if (config.type === 'vits') {
|
|
42
|
+
// Piper models phonemize through espeak-ng (`espeakData`); character
|
|
43
|
+
// models (Coqui) read the text directly and carry no espeak data.
|
|
44
|
+
const dataDir = config.files.espeakData ? file('espeakData', 'TTS espeak-ng dataDir') : '';
|
|
45
|
+
return { vits: { model: modelPath, tokens: tokensPath, ...(dataDir ? { dataDir } : {}), lengthScale: 1.0 } };
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
const dataDir = file('espeakData', 'TTS espeak-ng dataDir');
|
|
49
|
+
const voicesPath = file('voices', 'TTS voices');
|
|
50
|
+
const lexicon = (config.lexicon ?? []).map((key) => file(key, 'TTS lexicon')).join(',');
|
|
51
|
+
return {
|
|
52
|
+
kokoro: {
|
|
53
|
+
model: modelPath,
|
|
54
|
+
voices: voicesPath,
|
|
55
|
+
tokens: tokensPath,
|
|
56
|
+
dataDir,
|
|
57
|
+
lengthScale: 1.0,
|
|
58
|
+
...(lexicon ? { lexicon } : {}),
|
|
59
|
+
},
|
|
60
|
+
};
|
|
61
|
+
}
|
|
62
|
+
|
|
26
63
|
export class SherpaTtsEngine {
|
|
27
64
|
/**
|
|
28
|
-
* @param {{ modelDir: string,
|
|
65
|
+
* @param {{ modelDir: string, type?: string, files: Record<string, string>, lexicon?: string[], numThreads?: number }} config
|
|
29
66
|
*/
|
|
30
67
|
constructor(config) {
|
|
31
|
-
const
|
|
32
|
-
const voicesPath = path.join(config.modelDir, config.files.voices);
|
|
33
|
-
const tokensPath = path.join(config.modelDir, config.files.tokens);
|
|
34
|
-
const dataDir = path.join(config.modelDir, config.files.espeakData);
|
|
35
|
-
|
|
36
|
-
assertFileExists(modelPath, 'TTS model');
|
|
37
|
-
assertFileExists(voicesPath, 'TTS voices');
|
|
38
|
-
assertFileExists(tokensPath, 'TTS tokens');
|
|
39
|
-
assertFileExists(dataDir, 'TTS espeak-ng dataDir');
|
|
68
|
+
const model = buildModelConfig(config);
|
|
40
69
|
|
|
41
70
|
const sherpa = loadSherpaOnnxNode();
|
|
42
71
|
if (typeof sherpa.OfflineTts !== 'function') {
|
|
@@ -44,15 +73,7 @@ export class SherpaTtsEngine {
|
|
|
44
73
|
}
|
|
45
74
|
|
|
46
75
|
this.tts = new sherpa.OfflineTts({
|
|
47
|
-
model
|
|
48
|
-
kokoro: {
|
|
49
|
-
model: modelPath,
|
|
50
|
-
voices: voicesPath,
|
|
51
|
-
tokens: tokensPath,
|
|
52
|
-
dataDir,
|
|
53
|
-
lengthScale: 1.0,
|
|
54
|
-
},
|
|
55
|
-
},
|
|
76
|
+
model,
|
|
56
77
|
numThreads: config.numThreads ?? 2,
|
|
57
78
|
provider: 'cpu',
|
|
58
79
|
maxNumSentences: 1,
|
|
@@ -102,7 +102,9 @@ function getTtsEngine(modelsDir, modelId) {
|
|
|
102
102
|
const spec = getLocalSttModelSpec(modelId);
|
|
103
103
|
const created = new SherpaTtsEngine({
|
|
104
104
|
modelDir: getLocalSttModelDir(modelsDir, modelId),
|
|
105
|
+
type: spec.type,
|
|
105
106
|
files: spec.files,
|
|
107
|
+
lexicon: spec.lexicon,
|
|
106
108
|
numThreads: 2,
|
|
107
109
|
});
|
|
108
110
|
ttsEngines.set(key, created);
|
|
@@ -63,6 +63,8 @@ export function createDictationRuntime({
|
|
|
63
63
|
model: typeof req.body?.model === 'string' ? req.body.model : undefined,
|
|
64
64
|
speakerId: Number.isInteger(req.body?.speakerId) ? req.body.speakerId : undefined,
|
|
65
65
|
speed: typeof req.body?.speed === 'number' ? req.body.speed : undefined,
|
|
66
|
+
language: req.body?.language === 'auto' ? 'auto' : undefined,
|
|
67
|
+
languageSample: typeof req.body?.languageSample === 'string' ? req.body.languageSample.slice(0, 4000) : undefined,
|
|
66
68
|
});
|
|
67
69
|
if (result.error) {
|
|
68
70
|
res.status(503).json({
|
|
@@ -73,6 +75,8 @@ export function createDictationRuntime({
|
|
|
73
75
|
return;
|
|
74
76
|
}
|
|
75
77
|
res.setHeader('Content-Type', result.format || 'audio/wav');
|
|
78
|
+
res.setHeader('X-Speech-Model', result.modelId);
|
|
79
|
+
if (result.language) res.setHeader('X-Speech-Language', result.language);
|
|
76
80
|
res.send(result.audio);
|
|
77
81
|
} catch (error) {
|
|
78
82
|
res.status(500).json({ error: error?.message || 'Failed to synthesize speech' });
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { detectTextLanguage } from '../tts/language-detect.js';
|
|
1
2
|
/**
|
|
2
3
|
* Dictation service: resolves STT providers, tracks local model download
|
|
3
4
|
* state, and exposes a readiness snapshot for the status route.
|
|
@@ -16,6 +17,8 @@ import { OpenAICompatibleTranscriptionSession } from './openai-compatible-sessio
|
|
|
16
17
|
import {
|
|
17
18
|
DEFAULT_LOCAL_STT_MODEL,
|
|
18
19
|
DEFAULT_LOCAL_TTS_MODEL,
|
|
20
|
+
getLocalTtsDefaultSpeaker,
|
|
21
|
+
resolveLocalTtsModelForLanguage,
|
|
19
22
|
LOCAL_STT_MODEL_CATALOG,
|
|
20
23
|
LOCAL_STT_MODEL_IDS,
|
|
21
24
|
LOCAL_TTS_MODEL_CATALOG,
|
|
@@ -220,10 +223,30 @@ export function createDictationService({ modelsDir }) {
|
|
|
220
223
|
/**
|
|
221
224
|
* Synthesize speech with the local TTS model. Returns WAV bytes, or a
|
|
222
225
|
* readiness error while the model is missing/downloading.
|
|
223
|
-
*
|
|
226
|
+
*
|
|
227
|
+
* With `language: 'auto'` the text's language decides the model: the
|
|
228
|
+
* caller's model when it speaks that language, otherwise the catalog
|
|
229
|
+
* model for it (downloaded on first use, reported as in-progress until it
|
|
230
|
+
* lands). The caller's speaker id is kept only on the caller's model; a
|
|
231
|
+
* substitute model starts from its own default speaker for the language.
|
|
232
|
+
* A language no catalog model covers keeps the caller's model, so text is
|
|
233
|
+
* never silently dropped.
|
|
234
|
+
* `languageSample` is the whole message the chunk belongs to (or a prefix
|
|
235
|
+
* of it): the language is judged on that, never on a short chunk alone.
|
|
236
|
+
* @param {{ text: string, model?: string, speakerId?: number, speed?: number, language?: string, languageSample?: string }} options
|
|
224
237
|
*/
|
|
225
|
-
const synthesizeSpeech = async ({ text, model, speakerId, speed }) => {
|
|
226
|
-
const
|
|
238
|
+
const synthesizeSpeech = async ({ text, model, speakerId, speed, language, languageSample }) => {
|
|
239
|
+
const requestedModelId = isLocalTtsModelId(model) ? model : DEFAULT_LOCAL_TTS_MODEL;
|
|
240
|
+
let modelId = requestedModelId;
|
|
241
|
+
let resolvedLanguage = null;
|
|
242
|
+
if (language === 'auto') {
|
|
243
|
+
resolvedLanguage = detectTextLanguage(languageSample || text).language;
|
|
244
|
+
const forLanguage = resolveLocalTtsModelForLanguage(resolvedLanguage, requestedModelId);
|
|
245
|
+
if (forLanguage && forLanguage !== requestedModelId) {
|
|
246
|
+
modelId = forLanguage;
|
|
247
|
+
speakerId = getLocalTtsDefaultSpeaker(modelId, resolvedLanguage);
|
|
248
|
+
}
|
|
249
|
+
}
|
|
227
250
|
const installed = await isLocalSttModelInstalled(modelsDir, modelId);
|
|
228
251
|
if (!installed) {
|
|
229
252
|
const state = downloadStates.get(modelId);
|
|
@@ -251,7 +274,7 @@ export function createDictationService({ modelsDir }) {
|
|
|
251
274
|
speakerId,
|
|
252
275
|
speed,
|
|
253
276
|
});
|
|
254
|
-
return { audio: result.audio, format: result.format };
|
|
277
|
+
return { audio: result.audio, format: result.format, modelId, language: resolvedLanguage };
|
|
255
278
|
};
|
|
256
279
|
|
|
257
280
|
/**
|
|
@@ -23,6 +23,10 @@ Own filesystem API behavior for the web server runtime, including workspace-boun
|
|
|
23
23
|
- `POST /api/fs/exec`
|
|
24
24
|
- `GET /api/fs/exec/:jobId`
|
|
25
25
|
- `GET /api/fs/list`
|
|
26
|
+
- `GET /api/fs/git-dirs` — shallow nested git repository discovery for the
|
|
27
|
+
Git tab (depth- and visit-capped readdir walk; `.git` directory, file, or
|
|
28
|
+
symlink marks a repository boundary; junk directories and symlinks are
|
|
29
|
+
never descended into)
|
|
26
30
|
- Owns exec job queue state (`execJobs`) and lifecycle/TTL pruning.
|
|
27
31
|
- Enforces workspace boundary checks with active project + worktree fallback support.
|
|
28
32
|
- The active project directory is validated with `fs.realpath`, so when the project root is itself a symlink the workspace base no longer matches the paths the client sends. Workspace resolution therefore retries against the raw directory the client requested (`requestedDirectory` from `resolveProjectDirectory`) before falling back to worktree roots. Symlinks are still resolved afterwards, and write/exec routes keep their canonical containment check against the resolved base.
|