2026-08-22 09:06:24 +03:00
|
|
|
import type { ComponentType } from "react";
|
|
|
|
|
import type { ArtifactPartProps } from "@/src/core/contracts";
|
2026-08-22 09:36:15 +03:00
|
|
|
import { JobCard } from "@/components/artifacts/job-card";
|
2026-08-22 09:06:24 +03:00
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Artifact renderer registry — the extension point for tool-part UI.
|
|
|
|
|
*
|
|
|
|
|
* chat.tsx renders any tool part it doesn't specially handle (i.e. not
|
|
|
|
|
* quiz/ask) by looking the tool name up here. Add your renderer — do NOT
|
|
|
|
|
* edit chat.tsx (see docs/plan.md file-ownership rules).
|
|
|
|
|
*
|
|
|
|
|
* Typical shape: while the part is input-available render an activity card
|
|
|
|
|
* (poll GET /api/jobs?chatId=…; on completion call
|
|
|
|
|
* ChatActionsContext.syncFromServer()); when output-available render the
|
|
|
|
|
* artifact itself from part.output.
|
|
|
|
|
*/
|
|
|
|
|
export const artifactRenderers: Record<string, ComponentType<ArtifactPartProps>> = {
|
2026-08-22 09:36:15 +03:00
|
|
|
research: JobCard,
|
2026-08-22 09:06:24 +03:00
|
|
|
// W6: "demo" → sandboxed iframe card, "visual" → svg card
|
|
|
|
|
};
|