feat(skills): enable watcher wiring through daemon lifecycle
This commit is contained in:
@@ -140,6 +140,34 @@ describe('configSchema — per-tier fallback', () => {
|
||||
});
|
||||
});
|
||||
|
||||
describe('configSchema — skills watcher', () => {
|
||||
const minimalConfig = {
|
||||
telegram: { bot_token: 'test', allowed_chat_ids: [1] },
|
||||
models: { default: { provider: 'anthropic', model: 'claude-3' } },
|
||||
};
|
||||
|
||||
it('defaults skills watcher settings', () => {
|
||||
const result = configSchema.parse(minimalConfig);
|
||||
expect(result.skills.load.watch).toBe(false);
|
||||
expect(result.skills.load.watch_debounce_ms).toBe(250);
|
||||
});
|
||||
|
||||
it('accepts explicit watcher settings', () => {
|
||||
const result = configSchema.parse({
|
||||
...minimalConfig,
|
||||
skills: {
|
||||
load: {
|
||||
watch: true,
|
||||
watch_debounce_ms: 500,
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
expect(result.skills.load.watch).toBe(true);
|
||||
expect(result.skills.load.watch_debounce_ms).toBe(500);
|
||||
});
|
||||
});
|
||||
|
||||
describe('configSchema automation', () => {
|
||||
const baseConfig = {
|
||||
telegram: { bot_token: 'test-token', allowed_chat_ids: [123] },
|
||||
|
||||
@@ -101,6 +101,13 @@ const hooksSchema = z.object({
|
||||
silent: z.array(z.string()).default([]),
|
||||
}).default({});
|
||||
|
||||
const skillsLoadSchema = z.object({
|
||||
/** Enable filesystem watcher for automatic skill reload detection. */
|
||||
watch: z.boolean().default(false),
|
||||
/** Debounce window for batched watcher events. */
|
||||
watch_debounce_ms: z.number().min(10).max(10_000).default(250),
|
||||
}).default({});
|
||||
|
||||
const skillsSchema = z.object({
|
||||
/** Directory for user-created workspace skills. */
|
||||
workspace_dir: z.string().optional(),
|
||||
@@ -108,6 +115,8 @@ const skillsSchema = z.object({
|
||||
managed_dir: z.string().optional(),
|
||||
/** Directory for bundled skills shipped with Flynn. */
|
||||
bundled_dir: z.string().optional(),
|
||||
/** Skills watcher settings. */
|
||||
load: skillsLoadSchema,
|
||||
}).default({});
|
||||
|
||||
const mcpServerSchema = z.object({
|
||||
|
||||
Reference in New Issue
Block a user