From 81a9cdbadf8c9d940d4fe9a2a0de607dee1f5f1a Mon Sep 17 00:00:00 2001 From: Adam Malczewski Date: Thu, 4 Jun 2026 16:16:45 +0900 Subject: feat(config): add subdirectory LSP config watchers and fix permission ordering - Add watchDirConfig() for per-directory config watching - Register watchers for subdirectories with their own dispatch.toml - Fix permission ordering: move "*" wildcard to front so findLast reaches specific rules first (was silently breaking all specific bash permission rules) - Add comprehensive tests for watcher functionality - Update mocks in test files --- packages/api/tests/agent-manager.test.ts | 3 +++ packages/api/tests/routes.test.ts | 3 +++ 2 files changed, 6 insertions(+) (limited to 'packages/api/tests') diff --git a/packages/api/tests/agent-manager.test.ts b/packages/api/tests/agent-manager.test.ts index 5032689..7d8342e 100644 --- a/packages/api/tests/agent-manager.test.ts +++ b/packages/api/tests/agent-manager.test.ts @@ -328,6 +328,9 @@ vi.mock("@dispatch/core", () => ({ createConfigWatcher(_dir: string, _onChange: unknown) { return { close() {} }; }, + watchDirConfig(_dir: string, _onChange: unknown) { + return { close() {} }; + }, loadSkills(_dir: string) { return { skills: [], mappings: [] }; }, diff --git a/packages/api/tests/routes.test.ts b/packages/api/tests/routes.test.ts index a1bf4a6..2d5c7c7 100644 --- a/packages/api/tests/routes.test.ts +++ b/packages/api/tests/routes.test.ts @@ -141,6 +141,9 @@ vi.mock("@dispatch/core", () => ({ createConfigWatcher(_dir: string, _onChange: unknown) { return { close() {} }; }, + watchDirConfig(_dir: string, _onChange: unknown) { + return { close() {} }; + }, loadSkills(_dir: string) { return { skills: [], mappings: [] }; }, -- cgit v1.2.3