feat(gateway): include audio + web_search in system.services
This commit is contained in:
@@ -38,6 +38,8 @@ describe('discoverServices', () => {
|
||||
expect.objectContaining({ name: 'telegram', status: 'not_configured' }),
|
||||
expect.objectContaining({ name: 'cron', status: 'not_configured' }),
|
||||
expect.objectContaining({ name: 'mcp', status: 'not_configured' }),
|
||||
expect.objectContaining({ name: 'web_search', status: 'configured' }),
|
||||
expect.objectContaining({ name: 'audio_transcription', status: 'not_configured' }),
|
||||
]));
|
||||
});
|
||||
|
||||
@@ -83,5 +85,20 @@ describe('discoverServices', () => {
|
||||
expect(services.find(s => s.name === 'cron')?.itemCount).toBe(1);
|
||||
expect(services.find(s => s.name === 'mcp')?.metadata).toEqual({ serverCount: 1 });
|
||||
});
|
||||
});
|
||||
|
||||
it('marks audio transcription as configured and includes endpoint metadata', () => {
|
||||
const cfg = makeBaseConfig();
|
||||
(cfg as any).audio = { enabled: true, provider: { type: 'custom', endpoint: 'http://localhost:18801/v1/audio/transcriptions', model: 'whisper-1' } };
|
||||
|
||||
const reg = new ChannelRegistry();
|
||||
const services = discoverServices(cfg, reg);
|
||||
|
||||
const audio = services.find(s => s.name === 'audio_transcription');
|
||||
expect(audio?.status).toBe('configured');
|
||||
expect(audio?.metadata).toMatchObject({
|
||||
provider: 'custom',
|
||||
endpoint: 'http://localhost:18801/v1/audio/transcriptions',
|
||||
model: 'whisper-1',
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
@@ -72,6 +72,33 @@ export function discoverServices(
|
||||
services.push({ name, type: 'channel', status: 'disconnected', description });
|
||||
}
|
||||
|
||||
// Web search (tooling subsystem)
|
||||
services.push({
|
||||
name: 'web_search',
|
||||
type: 'tool',
|
||||
status: 'configured',
|
||||
description: 'Web search provider',
|
||||
metadata: {
|
||||
provider: config.web_search?.provider ?? 'brave',
|
||||
endpoint: config.web_search?.endpoint,
|
||||
max_results: config.web_search?.max_results,
|
||||
},
|
||||
});
|
||||
|
||||
// Audio transcription (tooling subsystem)
|
||||
const audioEnabled = Boolean(config.audio?.enabled);
|
||||
services.push({
|
||||
name: 'audio_transcription',
|
||||
type: 'tool',
|
||||
status: audioEnabled ? 'configured' : 'not_configured',
|
||||
description: 'Audio transcription',
|
||||
metadata: {
|
||||
provider: config.audio?.provider?.type,
|
||||
endpoint: config.audio?.provider?.endpoint,
|
||||
model: config.audio?.provider?.model,
|
||||
},
|
||||
});
|
||||
|
||||
const automation = config.automation;
|
||||
|
||||
const automationConfigs: Array<{ enabled: boolean; name: string; description: string; itemCount?: number }> = [
|
||||
|
||||
Reference in New Issue
Block a user