mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-05 10:53:59 +00:00
feat: share the tool catalog with voice
This commit is contained in:
1 parent
0953ebb026
commit
1a03e7483d
19 files changed
+288
-15
No files matched your search
@@ -0,0 +1,22 @@
|
||||
/** The standalone tool catalog for voice, loaded the first time voice needs it. */
|
||||
|
||||
let pending = null;
|
||||
|
||||
export function loadToolCatalog() {
|
||||
pending ??= Promise.all([
|
||||
import('../tools/index.js'),
|
||||
import('../tools/services.js'),
|
||||
]).then(([{ composeCatalog, coreTools }, { createToolServices }]) =>
|
||||
composeCatalog({
|
||||
tools: coreTools,
|
||||
services: createToolServices({
|
||||
fetchImpl: (...args) => globalThis.fetch(...args),
|
||||
appUrl: globalThis.location.origin,
|
||||
}),
|
||||
}),
|
||||
);
|
||||
pending.catch(() => {
|
||||
pending = null;
|
||||
});
|
||||
return pending;
|
||||
}
|
||||
Reference in new issue
Block a user