Skip to content

feat: add diagnostic-report artifact component#16

Merged
juliarvalenti merged 1 commit intomainfrom
review/diagnostic-report-clean
Feb 12, 2026
Merged

feat: add diagnostic-report artifact component#16
juliarvalenti merged 1 commit intomainfrom
review/diagnostic-report-clean

Conversation

@juliarvalenti
Copy link
Copy Markdown
Collaborator

Summary

Fixes Applied

  • types.ts: Fixed import { z } (was default import); exported DiagnosticItemZod with .describe() annotations; removed unnecessary ArtifactTabZod discriminated union
  • action.ts: Added Zod validation for itemsJson parsing; use direct DiagnosticReportArtifact["data"] type instead of Extract<ArtifactTab, ...>
  • index.ts: Added missing DIAGNOSTIC_REPORT_DESCRIPTION and DiagnosticItemZod exports; simplified exports
  • Registry: Added alongside existing artifacts (original PR overwrote capability-manifest due to stale branch)

Files

hax/artifacts/diagnostic-report/
├── diagnostic-report.tsx   # Table layout with confidence bars, action buttons
├── types.ts                # Zod schemas with .describe() annotations
├── action.ts               # CopilotKit hook with Zod validation
├── description.ts          # AI prompt guidance
├── index.ts                # Barrel exports
└── README.md               # Documentation

Test plan

  • hax add artifact diagnostic-report installs correctly
  • Component renders with sample diagnostic items and confidence bars
  • CopilotKit action create_diagnostic_report works with AI agents

Fixes from PR #4:
- Fixed zod import (named import)
- Exported DiagnosticItemZod with .describe() annotations
- Added Zod validation in action handler
- Removed ArtifactTabZod discriminated union
- Added DIAGNOSTIC_REPORT_DESCRIPTION barrel export
- Used direct type reference instead of Extract<>

Signed-off-by: Julia Valenti (julvalen) <julvalen@cisco.com>
@juliarvalenti juliarvalenti force-pushed the review/diagnostic-report-clean branch from fa689df to a000a4b Compare February 12, 2026 20:17
@juliarvalenti juliarvalenti merged commit 3322ca2 into main Feb 12, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant