feat(traffic): MCP toolkit + UI dashboard (Phase 2 slices 3 + 4)#435
Merged
arberx merged 1 commit intoarberx/post-pr429-next-stagefrom May 8, 2026
Merged
feat(traffic): MCP toolkit + UI dashboard (Phase 2 slices 3 + 4)#435arberx merged 1 commit intoarberx/post-pr429-next-stagefrom
arberx merged 1 commit intoarberx/post-pr429-next-stagefrom
Conversation
Adds the MCP toolkit and the dashboard surface for the server-side traffic ingestion shipped in slices 1+2, closing API → CLI → MCP → UI parity. Slice 3 — MCP toolkit - Promote 5 traffic ops to `included` in openapi-classification.ts - Add 5 tools to tool-registry.ts (sources_list, source_get, events, connect_cloud_run, sync), tagged with the new `traffic` tier - Add `traffic` toolkit to toolkits.ts so it loads on demand alongside monitoring/setup/gsc/ga/agent - Wire input schemas to packages/contracts Zod schemas - Tests cover registry tier counts, eager-mode count, handler dispatch, plus a stdio smoke test that loads the toolkit and calls one read (sources_list) + one write (sync) - Aero auto-picks them up via mcp-to-agent-tool.ts (no AERO_EXCLUDED entry) Slice 4 — UI dashboard - New /traffic top-level page: project picker + sources table with status, last sync, 24h crawler / AI-referral hits, sample count, plus a Connect-Cloud-Run drawer (paste-or-upload SA JSON, write-only key) - New /traffic/$projectName/$sourceId detail page: ScoreGauge tiles, ToneBadge status, latest run summary, hourly stacked-bar chart via ChartPrimitives (Recharts only — no direct import), filterable events table by kind / window - React Query hooks in queries/server-traffic.ts; toneFromTrafficSourceStatus helper centralizes the status → MetricTone map - Sidebar entry (Radar icon), mobile nav entry, breadcrumb mapping - traffic-sync run completion now invalidates the new server-traffic query namespace alongside the existing GA traffic keys - UI/CLI parity: every metric on screen comes from the same DTOs returned by `canonry traffic status/sources/events --format json` Bumps to 4.15.0. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Stacked on top of #431. Closes API → CLI → MCP → UI parity for the server-side traffic ingestion shipped in slices 1+2.
included; newtraffictoolkit registerscanonry_traffic_sources_list,canonry_traffic_source_get,canonry_traffic_events,canonry_traffic_connect_cloud_run,canonry_traffic_sync(loaded on demand). Aero picks them up automatically./trafficand/traffic/$projectName/$sourceIdpages with sources table, ScoreGauge tiles, hourly stacked-bar chart (ChartPrimitives), filterable events table, Connect Cloud Run drawer (paste/upload SA JSON, write-only). Sidebar entry uses theRadaricon. UI/CLI parity preserved — every metric on screen is whatcanonry traffic status/sources/events --format jsonreturns.Bumps to 4.15.0.
Test plan
pnpm typecheckclean across all packagespnpm lintclean (pre-commit hook also runs it)pnpm test— 2142 tests pass; canonry package alone is 563 (was 561, +5 traffic-tool registry/handler cases, +1 toolkit-count assertion, +stdio smoke test)pnpm --filter @ainyc/canonry-web run build)/trafficroute renders without console errors (gated by dashboard password without auth, expected)Definition of done
included, gated undertraffictoolkitmcp-registryandmcp-stdiotests cover the new tools (toolkit listing, eager-mode count, handler dispatch, stdio invocation read+write)/traffic/sources/:idfor parity withcanonry traffic statuspnpm typecheck && pnpm lint && pnpm testall greenpackage.jsonfiles--base arberx/post-pr429-next-stageExplicitly NOT in this PR
oauthauthMode — separate slice)cloud-run.auth.*) — separate slice🤖 Generated with Claude Code