From d270e0c706eb0c509b8fe1eff233954f394de126 Mon Sep 17 00:00:00 2001 From: Thore Cimbal Date: Sun, 16 Aug 2026 12:00:00 +0000 Subject: [PATCH] fix(embedded): ship the model assets in the widget package MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Element Call reaches production only as the embedded npm package, which webpack copies into ThreadNet-Web under /widgets/element-call/. The embedded build sets publicDir: false — upstream reasons that public/ holds nothing but the favicon, which stopped being true when the model assets landed there. Verified rather than assumed: with the upstream value everything builds, the standalone bundle works, and the filter is dead only inside the widget, 404ing on the model. That is the failure this would have shipped. The package grows from about 41 to 66 MB, measured — most of what was already there is source maps and the crypto and vision wasm. Co-Authored-By: Claude Opus 4.8 --- docs/axion1337-fork.md | 13 +++++++++++++ embedded/web/package.json | 2 +- vite-embedded.config.ts | 8 +++++++- 3 files changed, 21 insertions(+), 2 deletions(-) diff --git a/docs/axion1337-fork.md b/docs/axion1337-fork.md index d06499e7..3790b072 100644 --- a/docs/axion1337-fork.md +++ b/docs/axion1337-fork.md @@ -102,6 +102,19 @@ erkannt - sie gehen ungefiltert raus. Betroffen sind auch leise Chiclet-Tastatur 3. **Default 35 %, nicht 100 %.** Gemessen reicht das fuer "Tastatur weg und Stimme natuerlich"; mehr Daempfung erhoeht nur das Artefaktrisiko. +⚠️ **`vite-embedded.config.ts`: `publicDir` MUSS aktiv bleiben.** Upstream steht dort +`publicDir: false` mit der Begruendung, `public/` enthalte nur das Favicon - bei uns liegen +dort die Modell-Assets. Mit dem Upstream-Wert baut alles fehlerfrei, der Standalone-Build +funktioniert, und **nur im Widget ist der Filter tot** (404 auf das Modell). Genau diese +Zeile ist beim Rebase der wahrscheinlichste stille Rueckfall. + +**Auslieferungsweg (nicht offensichtlich):** Element Call laeuft hier **nicht** als eigenes +Image. Der Weg ist `threadnet-call` -> npm-Paket `@sorb/threadnet-call-embedded` -> Gitea -> +`ThreadNet-Web` (webpack kopiert das Paket-`dist` nach `webapp/widgets/element-call/`) -> +`threadnet-web`-Image. Deshalb muessen die Assets **ins Paket**; das Widget loest sie relativ +zu seiner eigenen URL auf (`/widgets/element-call/assets/dfn3/...`). Das Paket waechst dadurch +von ~41 auf ~66 MB (gemessen; der Rest sind Source-Maps und die Crypto-/Vision-wasm). + **Kein** Rust/wasm-Build noetig (das fertige Paket genuegt), **kein** Dry/Wet-Mixer und **kein** Delay-Node - geregelt wird ueber den Modellparameter (`noiseReductionLevel` / `atten_lim`), nicht ueber Zurueckmischen des Originalsignals. diff --git a/embedded/web/package.json b/embedded/web/package.json index a89951a2..778442be 100644 --- a/embedded/web/package.json +++ b/embedded/web/package.json @@ -1,6 +1,6 @@ { "name": "@sorb/threadnet-call-embedded", - "version": "0.19.2-threadnet.7", + "version": "0.19.2-threadnet.8", "files": [ "README.md", "LICENSE-AGPL-3.0", diff --git a/vite-embedded.config.ts b/vite-embedded.config.ts index a8d671dc..a352c6bb 100644 --- a/vite-embedded.config.ts +++ b/vite-embedded.config.ts @@ -18,7 +18,13 @@ export default defineConfig((env) => fullConfig({ ...env, packageType: "embedded" }), defineConfig({ base, // Use relative URLs to allow the app to be hosted under any path - publicDir: false, // Don't serve the public directory which only contains the favicon + // ThreadNet-Fork (ADR-0018): Upstream steht hier `publicDir: false` mit der + // Begruendung, public/ enthalte nur das Favicon. Bei uns liegen dort auch die + // DeepFilterNet3-Assets, und das Widget ist der einzige Weg, auf dem Element + // Call ausgeliefert wird - ohne sie waere der Filter im Widget tot (404 auf das + // Modell), waehrend er im Standalone-Build funktioniert. Das Widget bleibt damit + // in sich geschlossen: alles, was es braucht, liegt unter /widgets/element-call/. + publicDir: "public", plugins: [ generateFile([ {