feat(runtime): add talk mode and capture tools
This commit is contained in:
@@ -350,6 +350,39 @@ describe('configSchema — signal', () => {
|
||||
});
|
||||
});
|
||||
|
||||
describe('configSchema — audio talk mode', () => {
|
||||
const minimalConfig = {
|
||||
telegram: { bot_token: 'test', allowed_chat_ids: [1] },
|
||||
models: { default: { provider: 'anthropic', model: 'claude-3' } },
|
||||
};
|
||||
|
||||
it('defaults talk_mode fields', () => {
|
||||
const result = configSchema.parse(minimalConfig);
|
||||
expect(result.audio.talk_mode.enabled).toBe(false);
|
||||
expect(result.audio.talk_mode.wake_phrase).toBe('hey flynn');
|
||||
expect(result.audio.talk_mode.timeout_ms).toBe(120000);
|
||||
expect(result.audio.talk_mode.allow_manual_toggle).toBe(true);
|
||||
});
|
||||
|
||||
it('accepts custom talk_mode settings', () => {
|
||||
const result = configSchema.parse({
|
||||
...minimalConfig,
|
||||
audio: {
|
||||
talk_mode: {
|
||||
enabled: true,
|
||||
wake_phrase: 'ok flynn',
|
||||
timeout_ms: 300000,
|
||||
allow_manual_toggle: false,
|
||||
},
|
||||
},
|
||||
});
|
||||
expect(result.audio.talk_mode.enabled).toBe(true);
|
||||
expect(result.audio.talk_mode.wake_phrase).toBe('ok flynn');
|
||||
expect(result.audio.talk_mode.timeout_ms).toBe(300000);
|
||||
expect(result.audio.talk_mode.allow_manual_toggle).toBe(false);
|
||||
});
|
||||
});
|
||||
|
||||
describe('configSchema — teams', () => {
|
||||
const minimalConfig = {
|
||||
telegram: { bot_token: 'test', allowed_chat_ids: [1] },
|
||||
|
||||
@@ -472,9 +472,17 @@ const audioProviderSchema = z.object({
|
||||
model: z.string().optional(),
|
||||
});
|
||||
|
||||
const talkModeSchema = z.object({
|
||||
enabled: z.boolean().default(false),
|
||||
wake_phrase: z.string().default('hey flynn'),
|
||||
timeout_ms: z.number().min(1000).max(60 * 60 * 1000).default(120000),
|
||||
allow_manual_toggle: z.boolean().default(true),
|
||||
}).default({});
|
||||
|
||||
const audioSchema = z.object({
|
||||
enabled: z.boolean().default(false),
|
||||
provider: audioProviderSchema.optional(),
|
||||
talk_mode: talkModeSchema,
|
||||
}).default({});
|
||||
|
||||
// ── Tool policy schemas ──────────────────────────────────────────────
|
||||
|
||||
Reference in New Issue
Block a user