fix: run composite tool sections through the catalog

situation_brief, military_awareness and the HUD caption called other tools
directly, so replaced tools and interceptors did not apply to their sections.
Tools now reach each other through the catalog, and interceptors see these
calls with the calling tool as parent. Surfaces become a view over the
composed catalog, so a composite offered on voice keeps sections that voice
does not list.
This commit is contained in:
Sameh Khamis committed 2026-10-02 15:21:36 -07:00
1 parent 7ddee426e7
commit 963c791a5c
9 files changed
+219 -65

No files matched your search

+10 -7
View File
@@ -8,16 +8,19 @@ export function loadToolCatalog() {
import('../tools/services.js'),
]).then(
([
{ composeCatalog, coreTools, toolsForSurface },
{ composeCatalog, coreTools, catalogForSurface },
{ createToolServices },
]) =>
composeCatalog({
tools: toolsForSurface(coreTools, 'voice'),
services: createToolServices({
fetchImpl: (...args) => globalThis.fetch(...args),
appUrl: globalThis.location.origin,
catalogForSurface(
composeCatalog({
tools: coreTools,
services: createToolServices({
fetchImpl: (...args) => globalThis.fetch(...args),
appUrl: globalThis.location.origin,
}),
}),
}),
'voice',
),
);
pending.catch(() => {
pending = null;