feat(shared): canonical ToolKind taxonomy + per-kind dashboard widgets #984

Merged
charles merged 1 commit from code-lead/954 into main 2026-05-08 14:37:00 +00:00
Collaborator

Provider-agnostic tool taxonomy (ToolKind + mapToolNameToKind + ToolCallNormalized) in @claude-hooks/shared; both adapters now stamp the canonical kind on every tool-related event, event-log forwards it across SSE, and the dashboard renders one lazy-loaded widget per kind (read/write/edit/delete/shell/grep/glob/ls/sem_search/read_lints/web_fetch/web_search/mcp/subagent_task/plan/todos/notebook_edit/unknown).

Test plan

  • bun test packages/shared/src/tool-kind.test.ts — fixture matrix locks the provider×name→kind mapping (anthropic, cursor, mcp prefix, unknown-provider fallback).
  • bun x vitest run src/components/tool-call-widgets/ (in apps/web) — dispatcher routes every kind, four lifecycle states, content surfaces (shell command, mcp split, todos, plan).
  • just qa — typecheck + lint + format + tests across the workspace.
  • Manual smoke via the dashboard once a task runs: tool_call rows render their per-kind widget instead of the generic JSON blob; old events without kind fall through to the legacy renderer.

Closes #954

Provider-agnostic tool taxonomy (`ToolKind` + `mapToolNameToKind` + `ToolCallNormalized`) in `@claude-hooks/shared`; both adapters now stamp the canonical kind on every tool-related event, event-log forwards it across SSE, and the dashboard renders one lazy-loaded widget per kind (read/write/edit/delete/shell/grep/glob/ls/sem_search/read_lints/web_fetch/web_search/mcp/subagent_task/plan/todos/notebook_edit/unknown). ## Test plan - [ ] `bun test packages/shared/src/tool-kind.test.ts` — fixture matrix locks the provider×name→kind mapping (anthropic, cursor, mcp prefix, unknown-provider fallback). - [ ] `bun x vitest run src/components/tool-call-widgets/` (in `apps/web`) — dispatcher routes every kind, four lifecycle states, content surfaces (shell command, mcp split, todos, plan). - [ ] `just qa` — typecheck + lint + format + tests across the workspace. - [ ] Manual smoke via the dashboard once a task runs: tool_call rows render their per-kind widget instead of the generic JSON blob; old events without `kind` fall through to the legacy renderer. Closes #954
feat(shared): canonical ToolKind taxonomy + per-kind dashboard widgets (#954)
Some checks failed
qa / sql-layer-check (pull_request) Successful in 10s
qa / i18n-string-check (pull_request) Successful in 11s
qa / dockerfile (pull_request) Successful in 12s
qa / db-schema (pull_request) Successful in 48s
qa / qa-1 (pull_request) Failing after 2m13s
qa / qa (pull_request) Failing after 0s
2aef311aa9
Introduce a provider-agnostic tool taxonomy in @claude-hooks/shared so
the dashboard can pick the right widget without conditioning on
provider. Both adapters now stamp the canonical kind on every
tool-related event; event-log carries it across the SSE boundary.

- shared: ToolKind union, mapToolNameToKind(provider, name),
  ToolCallNormalized type, fixture-matrix tests.
- adapters: sdk-adapter (anthropic) + cursor-sdk-adapter populate
  ToolUseBlock.kind / ToolProgressEvent.kind / ToolSummaryEvent.kind.
- event-log: persists kind/providerName in event.detail alongside
  legacy tool_name/input fields.
- web: lazy-loaded widget per kind (read/write/edit/delete/shell/grep/
  glob/ls/sem_search/read_lints/web_fetch/web_search/mcp/subagent_task/
  plan/todos/notebook_edit/unknown), dispatched by ToolCallWidget;
  EventLog routes tool_* events through it when the payload carries
  the normalized envelope.

Closes #954

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
reviewer requested changes 2026-05-08 13:51:34 +00:00
Dismissed
reviewer left a comment

Code and AC are otherwise clean: taxonomy, adapters, widgets, lazy dispatch, and fixture tests all look correct.

- **ci**: Run #3227 (https://forge.jacquin.app/charles/claude-hooks/actions/runs/1705) reports `failure` on the head commit `2aef311`. The forge MCP returned sparse run data (no job/step details), so I can't pinpoint the failing step — please check the run URL directly. CI must be green before this can be approved. Code and AC are otherwise clean: taxonomy, adapters, widgets, lazy dispatch, and fixture tests all look correct.
code-lead force-pushed code-lead/954 from 2aef311aa9
Some checks failed
qa / sql-layer-check (pull_request) Successful in 10s
qa / i18n-string-check (pull_request) Successful in 11s
qa / dockerfile (pull_request) Successful in 12s
qa / db-schema (pull_request) Successful in 48s
qa / qa-1 (pull_request) Failing after 2m13s
qa / qa (pull_request) Failing after 0s
to c8f73f1684
Some checks failed
qa / dockerfile (pull_request) Successful in 17s
qa / sql-layer-check (pull_request) Successful in 17s
qa / i18n-string-check (pull_request) Successful in 17s
qa / db-schema (pull_request) Successful in 21s
qa / qa-1 (pull_request) Failing after 12m26s
qa / qa (pull_request) Failing after 0s
2026-05-08 13:58:20 +00:00
Compare
reviewer left a comment
  • ci: Run #1710 (sha c8f73f1) — qa / qa-1 failed after 12m26s; qa / qa blocked at 0s. All other checks (db-schema, dockerfile, i18n-string-check, sql-layer-check) are green. The forge MCP and API don't expose step-level logs for this run — please check https://forge.jacquin.app/charles/claude-hooks/actions/runs/1710 directly to identify the failing step (typecheck, lint, fmt-check, or test). Code and AC remain clean from round 1.
- **ci**: Run #1710 (sha `c8f73f1`) — `qa / qa-1` failed after 12m26s; `qa / qa` blocked at 0s. All other checks (db-schema, dockerfile, i18n-string-check, sql-layer-check) are green. The forge MCP and API don't expose step-level logs for this run — please check https://forge.jacquin.app/charles/claude-hooks/actions/runs/1710 directly to identify the failing step (typecheck, lint, fmt-check, or test). Code and AC remain clean from round 1.
code-lead force-pushed code-lead/954 from c8f73f1684
Some checks failed
qa / dockerfile (pull_request) Successful in 17s
qa / sql-layer-check (pull_request) Successful in 17s
qa / i18n-string-check (pull_request) Successful in 17s
qa / db-schema (pull_request) Successful in 21s
qa / qa-1 (pull_request) Failing after 12m26s
qa / qa (pull_request) Failing after 0s
to 21c7a45a6c
Some checks failed
qa / sql-layer-check (pull_request) Successful in 7s
qa / dockerfile (pull_request) Successful in 10s
qa / db-schema (pull_request) Successful in 11s
qa / i18n-string-check (pull_request) Successful in 12s
qa / qa-1 (pull_request) Failing after 11m59s
qa / qa (pull_request) Failing after 0s
2026-05-08 14:25:03 +00:00
Compare
charles deleted branch code-lead/954 2026-05-08 14:37:01 +00:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
charles/claude-hooks!984
No description provided.