import type { SuperagentToolCall } from '../types'; /** * Pure artifact-tool helpers — native port of the web's artifact-constants.ts * (frontend/apps/builder/src/pages/agent-editor/components/). Same shape * detection so both platforms route the identical calls to the artifact card. */ /** * Display payload the backend `artifacts` tool attaches as the client-only * `client_artifact` field (never part of the LLM-facing results). `text` is * the HTML/SVG markup; `title` rides `_meta` so the chrome can show it without * parsing the body. */ export type ArtifactResource = { uri: string; text: string; _meta?: { title?: string; }; }; /** * Canonical name + all backend aliases the LLM is known to hallucinate. * Must stay in sync with ARTIFACT_TOOL_NAMES in backend/app/ai/tool_constants.py. */ export declare const ARTIFACT_TOOL_NAMES: ReadonlySet; /** Validate a `client_artifact` payload; null for anything unrecognisable. */ export declare function extractArtifact(clientArtifact: unknown): ArtifactResource | null; /** * True when a tool call is genuinely the artifacts tool — same shape guard as * the web's isArtifactToolCall. The definitive signal is a `client_artifact` * payload; only the real backend tool attaches one, so a user backend function * or MCP tool that happens to be named `artifacts` (or an alias like * `render_ui`) keeps the generic tool UI: * - payload present → artifact, for any listed name; * - payload-less alias → NOT an artifact (a genuine alias call is * canonicalized to `artifacts` on the backend, so this is a real tool); * - payload-less canonical `artifacts` → artifact only while still in flight * (mid-stream the payload isn't attached yet); once concluded without a * payload it's a real tool named `artifacts`. */ export declare function isArtifactToolCall(toolCall: SuperagentToolCall): boolean; export type ArtifactRenderState = 'running' | 'failed' | 'stopped' | 'unavailable' | 'rendered'; /** * Card-state matrix for the artifact widget. A delivered `client_artifact` is * the only proof anything rendered (web parity: MessageArtifacts renders only * extractable payloads, and isArtifactToolCall keeps concluded payload-less * calls on the generic UI) — so a settled turn whose payload never arrived is * 'unavailable', never a success: the args `content` is what the model ASKED * to render, not what rendered. */ export declare function getArtifactRenderState(rawStatus: string, hasArtifact: boolean, isActionable: boolean): ArtifactRenderState; /** MIME `type` arg → short label ("text/html" → "HTML"). */ export declare function formatArtifactType(type: string): string; //# sourceMappingURL=artifactToolUtils.d.ts.map