You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
packages/tasks/src/hooks/useTasksApi.ts — webview-side wrapper that re-lists every entry as a convenience method
src/webviews/tasks/tasksPanel.ts — extension-side requestHandlers / commandHandlers maps that re-list every entry by method name
Nothing enforces that these three stay in sync. Forgetting to wire up a new method in one of them is a silent bug — the TypeScript compiler won't catch it.
Desired outcome
A single source of truth (TasksApi) should drive the handler/hook shape so the compiler errors when a method is missing.
Ideally, useTasksApi and the TasksPanel handler maps could be partially or fully generated/inferred from the TasksApi definition (e.g. mapped types, helper that iterates over TasksApi entries, or codegen).
Adding a new request/command/notification should require touching as few files as possible — ideally just the definition and the implementation.
Ideas
Use mapped types over typeof TasksApi to derive the required handler signatures, making requestHandlers / commandHandlers type-incomplete if a handler is missing.
Generate useTasksApi from TasksApi entries automatically (the hook is already a thin request()/command() pass-through).
Explore a registry pattern or codegen script that reads the TasksApi object and emits boilerplate.
Activity