@kitn.ai/chat
Version:
Framework-agnostic, Shadow-DOM web components for building AI chat interfaces — works in React, Vue, Angular, Svelte, or plain HTML. Authored in SolidJS.
66 lines (65 loc) • 2.4 kB
JSON
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://kitn.ai/schemas/card/confirm.schema.json",
"title": "ConfirmCardData",
"description": "Data payload for a `confirm` card (CardEnvelope.data when type='confirm').",
"type": "object",
"required": ["actions"],
"properties": {
"heading": {
"type": "string",
"description": "Optional in-body heading. Distinct from CardEnvelope.title (the card chrome title)."
},
"body": {
"type": "string",
"description": "Body text. Plain text in v1 (rendered safely; no HTML injection)."
},
"tone": {
"type": "string",
"enum": ["default", "warning", "danger"],
"default": "default",
"description": "Overall card tone; 'danger' adds a warning icon + accent for destructive approvals.",
"x-kc-control": "tone"
},
"actions": {
"type": "array",
"minItems": 1,
"maxItems": 4,
"description": "The choice set. Rendered as buttons in order; max 4 keeps it a decision, not a menu.",
"items": {
"type": "object",
"required": ["id", "label"],
"properties": {
"id": {
"type": "string",
"minLength": 1,
"description": "Emitted as CardEvent.action. Must be unique within `actions`.",
"x-kc-unique": true
},
"label": { "type": "string", "minLength": 1, "description": "Visible button label." },
"style": {
"type": "string",
"enum": ["primary", "default", "destructive"],
"default": "default",
"description": "Button emphasis. 'destructive' = red/danger; 'primary' = filled accent.",
"x-kc-control": "button-style"
},
"payload": {
"description": "Optional opaque payload echoed back in CardEvent.payload (any JSON)."
},
"default": {
"type": "boolean",
"default": false,
"description": "If true, this action is the keyboard default (Enter) and gets initial focus. At most one should be true; the card uses the first if several are.",
"x-kc-default-action": true
}
}
}
},
"dismissible": {
"type": "boolean",
"default": false,
"description": "Show a close affordance that emits the `dismiss` verb."
}
}
}