From c53c47ce2d412bd48c6bc39fc8a185eead5d7790 Mon Sep 17 00:00:00 2001 From: mARTin-B78 Date: Fri, 4 Sep 2026 13:10:51 +0200 Subject: [PATCH] refactor: scope ai backends --- CHANGELOG.md | 2 ++ VERSION | 2 +- docs/ARCHITECTURE.md | 1 + static/index.html | 16 ++++++++-------- static/js/ai-backends.js | 9 +++++++++ 5 files changed, 21 insertions(+), 9 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3f251db..30a29e9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,8 @@ Follows [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) · versioned wi ## [Unreleased] ### Changed +- **AI-backend namespace migration.** LLM snippets and backend interaction controls now live behind a private section scope + with an explicit `window.TTVC.aiBackends` API for cross-module snippet initialization. - **Integrations namespace migration.** Endpoint helpers, active-voice listings, virtual design IDs, and API snippet rendering now use a private scope with explicit compatibility exports and a `window.TTVC.integrations` API. - **Combined-library namespace migration.** Production books/plays, Rehearser and Reader handoffs, and cast integration diff --git a/VERSION b/VERSION index b9961ac..8a71c6f 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -1.24.81 +1.24.82 diff --git a/docs/ARCHITECTURE.md b/docs/ARCHITECTURE.md index 7eb77f2..45efd5e 100644 --- a/docs/ARCHITECTURE.md +++ b/docs/ARCHITECTURE.md @@ -71,6 +71,7 @@ Done incrementally as global-scope ordered files (no ES-module change needed) - ✅ Engine browser, custom-card, and local-container helpers use a private scope with an explicit namespace API. - ✅ Combined library production rendering and Reader/Rehearser handoffs use a private scope with an explicit namespace API. - ✅ Integration endpoint and API-snippet helpers use a private scope with explicit voice/endpoint compatibility exports. +- ✅ AI-backend section interactions and snippet initialization use a private scope with an explicit namespace API. - ✅ `static/css/resource-diagnostics.css` — isolated Performance/resource diagnostic panel styles. - ✅ `static/css/background-jobs.css` — isolated background-job history and retry-panel styles. - ✅ `static/css/voice-design.css` — isolated Voice Design form, samples, and preview-match styles. diff --git a/static/index.html b/static/index.html index ef3815f..58ec48a 100644 --- a/static/index.html +++ b/static/index.html @@ -10,7 +10,7 @@ - + @@ -27,12 +27,12 @@ - - - - - - + + + + + + @@ -397,7 +397,7 @@ window.toggleNavTree = function(treeId, chevronId) { - + diff --git a/static/js/ai-backends.js b/static/js/ai-backends.js index 93bf07d..48b5703 100644 --- a/static/js/ai-backends.js +++ b/static/js/ai-backends.js @@ -1,5 +1,7 @@ // ── AI Backends section: copy, API keys, local service connect ───────────── +(function (root) { + (function initLlmsSection() { // Copy buttons @@ -835,3 +837,10 @@ window.initCollapsibleCards(); }); }); })(); + +Object.assign(root, { initLlmSnippets }); +root.TTVC = root.TTVC || {}; +root.TTVC.aiBackends = root.TTVC.aiBackends || {}; +root.TTVC.aiBackends.initSnippets = initLlmSnippets; +root.initLlmSnippets = initLlmSnippets; +})(window);