mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-05 10:53:59 +00:00
feat: choose per tool whether MCP, voice or both offer it
src/tools/surfaces.js lists the tools a surface leaves out, and the MCP server, the voice session's tool list and the browser catalog voice calls all filter through it. Voice leaves out tools that answer with images, link to the app, or repeat what its app actions already answer.
This commit is contained in:
1 parent
b4067f9859
commit
df0e0f32e8
9 files changed
+138
-17
No files matched your search
@@ -1,7 +1,11 @@
|
||||
/** The local MCP server: Core's tools over services backed by a running app. */
|
||||
|
||||
import { readFileSync } from 'node:fs';
|
||||
import { composeCatalog, coreTools } from '../../src/tools/index.js';
|
||||
import {
|
||||
composeCatalog,
|
||||
coreTools,
|
||||
toolsForSurface,
|
||||
} from '../../src/tools/index.js';
|
||||
import { createMcpServer } from '../../src/tools/mcp/index.js';
|
||||
import { DEFAULT_API_BASE, createLocalToolServices } from './services.js';
|
||||
|
||||
@@ -20,7 +24,7 @@ export function createLocalMcpServer({
|
||||
);
|
||||
return createMcpServer({
|
||||
catalog: composeCatalog({
|
||||
tools: coreTools,
|
||||
tools: toolsForSurface(coreTools, 'mcp'),
|
||||
services: createLocalToolServices({ apiBase, fetchImpl }),
|
||||
}),
|
||||
name: 'gods-eye-view',
|
||||
|
||||
@@ -1,16 +1,18 @@
|
||||
/**
|
||||
* The voice session's tools for the standalone server: the app actions plus
|
||||
* Core's catalog queries, which the browser runs through the same catalog.
|
||||
* Links to the app are left out, since voice runs inside it.
|
||||
* the catalog tools voice offers (see src/tools/surfaces.js), which the
|
||||
* browser runs through the same catalog.
|
||||
*/
|
||||
|
||||
import { coreTools, toFunctionTools } from '../../src/tools/index.js';
|
||||
import {
|
||||
coreTools,
|
||||
toFunctionTools,
|
||||
toolsForSurface,
|
||||
} from '../../src/tools/index.js';
|
||||
import { realtimeSessionTools } from '../providers/openai/tools.js';
|
||||
|
||||
export const VOICE_EXCLUDED_QUERIES = Object.freeze(['open_in_gods_eye_view']);
|
||||
|
||||
export function standaloneVoiceTools() {
|
||||
return realtimeSessionTools(
|
||||
toFunctionTools(coreTools, { exclude: VOICE_EXCLUDED_QUERIES }),
|
||||
toFunctionTools(toolsForSurface(coreTools, 'voice')),
|
||||
);
|
||||
}
|
||||
Reference in new issue
Block a user