{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "checkpoint-svelte",
  "title": "Checkpoint (Svelte)",
  "description": "A marker in the conversation that restores to that point, after a dialog asks what to restore and says what's lost.",
  "dependencies": [
    "@kind-ui/agent-ui@0.9.0",
    "@ui-sdk/core@0.1.0-beta.17",
    "@ui-sdk/svelte@0.1.0-beta.17"
  ],
  "registryDependencies": [
    "@kind-ui/agent-ui-setup",
    "@kind-ui/internal-alert-dialog-svelte",
    "@kind-ui/internal-radio-svelte",
    "@kind-ui/internal-tooltip-svelte"
  ],
  "files": [
    {
      "path": "packages/agent-ui/src/svelte/checkpoint/Checkpoint.svelte",
      "content": "<!--\n  A marker in the conversation that a person can restore. Restore opens a dialog that asks before calling\n  `onRestore`. Any `children` replace the default parts.\n-->\n<script lang=\"ts\">\n  import type { ComponentProps } from \"svelte\";\n  import CheckpointDescription from \"./CheckpointDescription.svelte\";\n  import CheckpointLabel from \"./CheckpointLabel.svelte\";\n  import CheckpointRestore from \"./CheckpointRestore.svelte\";\n  import CheckpointRestored from \"./CheckpointRestored.svelte\";\n  import { parts } from \"./parts\";\n\n  let { children, open = $bindable(), ...props }: ComponentProps<typeof parts.Root> = $props();\n</script>\n\n{#snippet fallback()}\n  <CheckpointLabel\n  /><CheckpointDescription\n  /><parts.Line\n  /><CheckpointRestore\n  /><CheckpointRestored />\n{/snippet}\n\n<parts.Root {...props} bind:open children={children ?? fallback} />\n",
      "type": "registry:ui",
      "target": "@ui/svelte/checkpoint/Checkpoint.svelte"
    },
    {
      "path": "packages/agent-ui/src/svelte/checkpoint/CheckpointCancel.svelte",
      "content": "<!-- Closes the dialog. Reads \"Cancel\" unless you pass children. -->\n<script lang=\"ts\">\n  import type { ComponentProps } from \"svelte\";\n  import { parts } from \"./parts\";\n\n  let { children, ...props }: ComponentProps<typeof parts.Cancel> = $props();\n</script>\n\n{#snippet fallback()}\n  Cancel\n{/snippet}\n\n<parts.Cancel {...props} children={children ?? fallback} />\n",
      "type": "registry:ui",
      "target": "@ui/svelte/checkpoint/CheckpointCancel.svelte"
    },
    {
      "path": "packages/agent-ui/src/svelte/checkpoint/CheckpointCompare.svelte",
      "content": "<!-- Calls `onCompare`. Reads \"Compare\" with its icon unless you pass children. Rendered only with `onCompare`. -->\n<script lang=\"ts\">\n  import type { ComponentProps } from \"svelte\";\n  import { parts } from \"./parts\";\n\n  let { children, ...props }: ComponentProps<typeof parts.Compare> = $props();\n</script>\n\n{#snippet fallback()}<span data-checkpoint-compare-icon=\"\" aria-hidden=\"true\"></span>Compare{/snippet}\n\n<parts.Compare {...props} children={children ?? fallback} />\n",
      "type": "registry:ui",
      "target": "@ui/svelte/checkpoint/CheckpointCompare.svelte"
    },
    {
      "path": "packages/agent-ui/src/svelte/checkpoint/CheckpointConfirm.svelte",
      "content": "<!-- Calls `onRestore`. Reads \"Restore\", with a running mark while the restore is pending, unless you pass children. -->\n<script lang=\"ts\">\n  import type { ComponentProps } from \"svelte\";\n  import { parts } from \"./parts\";\n\n  let { children, ...props }: ComponentProps<typeof parts.Confirm> = $props();\n</script>\n\n<!-- The mark shows only while the restore is pending (controls.css). -->\n{#snippet fallback()}<span data-kind-pending-mark=\"\" data-status-mark=\"\" data-status=\"running\" aria-hidden=\"true\"\n  ></span>Restore{/snippet}\n\n<parts.Confirm {...props} children={children ?? fallback} />\n",
      "type": "registry:ui",
      "target": "@ui/svelte/checkpoint/CheckpointConfirm.svelte"
    },
    {
      "path": "packages/agent-ui/src/svelte/checkpoint/CheckpointDescription.svelte",
      "content": "<!-- The `description`, unless you pass children. Rendered only with one. -->\n<script lang=\"ts\">\n  import type { ComponentProps } from \"svelte\";\n  import { parts } from \"./parts\";\n\n  let { children, ...props }: ComponentProps<typeof parts.Description> = $props();\n</script>\n\n{#snippet fallback({ description }: { description: string })}{description}{/snippet}\n\n<parts.Description {...props} children={children ?? fallback} />\n",
      "type": "registry:ui",
      "target": "@ui/svelte/checkpoint/CheckpointDescription.svelte"
    },
    {
      "path": "packages/agent-ui/src/svelte/checkpoint/CheckpointDialog.svelte",
      "content": "<!--\n  The dialog's backdrop and content: its title, the checkpoint's description, the scope, the loss sentence as its\n  description, and the answers, unless you pass children, which replace the scope and the answers.\n-->\n<script lang=\"ts\">\n  import type { CheckpointDialogState } from \"@kind-ui/agent-ui/core\";\n  import type { Snippet } from \"svelte\";\n  import { KindAlertDialogBackdrop, KindAlertDialogContent, KindAlertDialogTitle } from \"../internal/alert-dialog/index\";\n  import CheckpointCancel from \"./CheckpointCancel.svelte\";\n  import CheckpointCompare from \"./CheckpointCompare.svelte\";\n  import CheckpointConfirm from \"./CheckpointConfirm.svelte\";\n  import CheckpointError from \"./CheckpointError.svelte\";\n  import CheckpointLoss from \"./CheckpointLoss.svelte\";\n  import CheckpointScope from \"./CheckpointScope.svelte\";\n\n  type Props = Omit<CheckpointDialogState, \"controller\" | \"dismissible\" | \"busy\"> & {\n    busy?: boolean;\n    children?: Snippet;\n  };\n\n  let { title, point, description, note, initialFocus, busy, children }: Props = $props();\n</script>\n\n<KindAlertDialogBackdrop\n/><KindAlertDialogContent {initialFocus} aria-busy={busy || undefined}>\n  <KindAlertDialogTitle>{title}</KindAlertDialogTitle\n  >{#if point}<p data-checkpoint-point=\"\">{point}</p>{/if}{#if children}\n    {@render children()}\n  {:else}<CheckpointScope /><CheckpointLoss {description} {note} /><div data-checkpoint-answers=\"\"\n      ><CheckpointCompare\n      /><CheckpointError\n      /><CheckpointCancel\n      /><CheckpointConfirm /></div\n    >{/if}\n</KindAlertDialogContent>\n",
      "type": "registry:ui",
      "target": "@ui/svelte/checkpoint/CheckpointDialog.svelte"
    },
    {
      "path": "packages/agent-ui/src/svelte/checkpoint/CheckpointError.svelte",
      "content": "<!-- \"Couldn't restore. Try again.\" after a restore fails, unless you pass children. -->\n<script lang=\"ts\">\n  import type { ComponentProps } from \"svelte\";\n  import { parts } from \"./parts\";\n\n  let { children, ...props }: ComponentProps<typeof parts.Error> = $props();\n</script>\n\n{#snippet fallback()}\n  Couldn't restore. Try again.\n{/snippet}\n\n<parts.Error {...props} children={children ?? fallback} />\n",
      "type": "registry:ui",
      "target": "@ui/svelte/checkpoint/CheckpointError.svelte"
    },
    {
      "path": "packages/agent-ui/src/svelte/checkpoint/CheckpointLabel.svelte",
      "content": "<!-- The `label`, unless you pass children. -->\n<script lang=\"ts\">\n  import type { ComponentProps } from \"svelte\";\n  import { parts } from \"./parts\";\n\n  let { children, ...props }: ComponentProps<typeof parts.Label> = $props();\n</script>\n\n{#snippet fallback({ label }: { label: string })}{label}{/snippet}\n\n<parts.Label {...props} children={children ?? fallback} />\n",
      "type": "registry:ui",
      "target": "@ui/svelte/checkpoint/CheckpointLabel.svelte"
    },
    {
      "path": "packages/agent-ui/src/svelte/checkpoint/CheckpointLoss.svelte",
      "content": "<!-- The loss sentence, then the note, as the dialog's description, so both are read as it opens. -->\n<script lang=\"ts\">\n  import type { CheckpointDialogState } from \"@kind-ui/agent-ui/core\";\n  import { KindAlertDialogDescription } from \"../internal/alert-dialog/index\";\n\n  let { description, note }: Pick<CheckpointDialogState, \"description\" | \"note\"> = $props();\n</script>\n\n<KindAlertDialogDescription data-checkpoint-loss=\"\"\n  ><span data-checkpoint-loss-text=\"\">{description}</span><span data-checkpoint-note=\"\">{note}</span\n  ></KindAlertDialogDescription>\n",
      "type": "registry:ui",
      "target": "@ui/svelte/checkpoint/CheckpointLoss.svelte"
    },
    {
      "path": "packages/agent-ui/src/svelte/checkpoint/CheckpointRestore.svelte",
      "content": "<!--\n  Restore and its dialog, unless you pass children: a snippet that gets the Alert Dialog's props. Rendered only\n  while `onRestore` is set and the checkpoint isn't `restored`.\n-->\n<script lang=\"ts\">\n  import type { CheckpointDialogState } from \"@kind-ui/agent-ui/core\";\n  import type { ComponentProps } from \"svelte\";\n  import { KindAlertDialog, KindAlertDialogTrigger } from \"../internal/alert-dialog/index\";\n  import { KindTooltip, KindTooltipContent, KindTooltipTrigger } from \"../internal/tooltip/index\";\n  import CheckpointDialog from \"./CheckpointDialog.svelte\";\n  import { parts } from \"./parts\";\n\n  let { children, ...props }: ComponentProps<typeof parts.Restore> = $props();\n</script>\n\n{#snippet fallback({ controller, dismissible, title, point, description, note, initialFocus, busy }: CheckpointDialogState)}\n  <KindAlertDialog {controller} {dismissible}>\n    <KindTooltip type=\"label\">\n      <KindTooltipTrigger data-checkpoint-trigger=\"\" data-kind-icon-button=\"\">\n        {#snippet render({ props })}<KindAlertDialogTrigger {...props} />{/snippet}\n      </KindTooltipTrigger\n      ><KindTooltipContent>Restore checkpoint</KindTooltipContent>\n    </KindTooltip\n    ><CheckpointDialog {title} {point} {description} {note} {initialFocus} {busy} />\n  </KindAlertDialog>\n{/snippet}\n\n<parts.Restore {...props} children={children ?? fallback} />\n",
      "type": "registry:ui",
      "target": "@ui/svelte/checkpoint/CheckpointRestore.svelte"
    },
    {
      "path": "packages/agent-ui/src/svelte/checkpoint/CheckpointRestored.svelte",
      "content": "<!--\n  \"Restored code and conversation\" with a check and what it brought back, in Restore's place once the host restores\n  the checkpoint, unless you pass children.\n-->\n<script lang=\"ts\">\n  import type { ComponentProps } from \"svelte\";\n  import { parts } from \"./parts\";\n\n  let { children, ...props }: ComponentProps<typeof parts.Restored> = $props();\n</script>\n\n{#snippet fallback({ outcome, meta }: { outcome: string; meta: string })}<span\n    aria-hidden=\"true\"\n    data-status-mark=\"\"\n    data-status=\"complete\"\n  ></span>{outcome}{#if meta}<span data-checkpoint-outcome-meta=\"\">{meta}</span>{/if}{/snippet}\n\n<parts.Restored {...props} children={children ?? fallback} />\n",
      "type": "registry:ui",
      "target": "@ui/svelte/checkpoint/CheckpointRestored.svelte"
    },
    {
      "path": "packages/agent-ui/src/svelte/checkpoint/CheckpointScope.svelte",
      "content": "<!--\n  \"Restore\" and a radio per scope, unless you pass children: a snippet that gets the Radio group's props. Rendered\n  only while the host offers more than one scope.\n-->\n<script lang=\"ts\">\n  import type { CheckpointScopeState } from \"@kind-ui/agent-ui/core\";\n  import type { ComponentProps } from \"svelte\";\n  import { KindRadio, KindRadioGroup, KindRadioIndicator } from \"../internal/radio/index\";\n  import { parts } from \"./parts\";\n\n  // The Radio group takes any string; core keeps its controller to the scopes.\n  type Controller = ComponentProps<typeof KindRadioGroup>[\"controller\"];\n\n  let { children, ...props }: ComponentProps<typeof parts.Scope> = $props();\n</script>\n\n{#snippet fallback({ controller, defaultValue, options, label }: CheckpointScopeState)}<span\n    aria-hidden=\"true\"\n    data-checkpoint-scope-label=\"\">{label}</span\n  ><KindRadioGroup controller={controller as Controller} {defaultValue} aria-label={label} data-agent-hidden=\"\"\n    >{#each options as option (option.value)}<!-- svelte-ignore a11y_label_has_associated_control: the label wraps UI SDK's radio, which it names. --><label\n          data-checkpoint-option=\"\"\n          ><KindRadio value={option.value}><KindRadioIndicator /></KindRadio\n          >{option.label}</label\n        >{/each}</KindRadioGroup\n  >{/snippet}\n\n<parts.Scope {...props} children={children ?? fallback} />\n",
      "type": "registry:ui",
      "target": "@ui/svelte/checkpoint/CheckpointScope.svelte"
    },
    {
      "path": "packages/agent-ui/src/svelte/checkpoint/index.ts",
      "content": "import type { ComponentProps } from \"svelte\";\nimport Checkpoint from \"./Checkpoint.svelte\";\nimport CheckpointCancel from \"./CheckpointCancel.svelte\";\nimport CheckpointCompare from \"./CheckpointCompare.svelte\";\nimport CheckpointConfirm from \"./CheckpointConfirm.svelte\";\nimport CheckpointDescription from \"./CheckpointDescription.svelte\";\nimport CheckpointDialog from \"./CheckpointDialog.svelte\";\nimport CheckpointError from \"./CheckpointError.svelte\";\nimport CheckpointLabel from \"./CheckpointLabel.svelte\";\nimport CheckpointLoss from \"./CheckpointLoss.svelte\";\nimport CheckpointRestore from \"./CheckpointRestore.svelte\";\nimport CheckpointRestored from \"./CheckpointRestored.svelte\";\nimport CheckpointScope from \"./CheckpointScope.svelte\";\nimport { parts } from \"./parts\";\n\nexport {\n  Checkpoint,\n  CheckpointCancel,\n  CheckpointCompare,\n  CheckpointConfirm,\n  CheckpointDescription,\n  CheckpointDialog,\n  CheckpointError,\n  CheckpointLabel,\n  CheckpointLoss,\n  CheckpointRestore,\n  CheckpointRestored,\n  CheckpointScope,\n};\nexport const CheckpointLine = parts.Line;\nexport type CheckpointProps = ComponentProps<typeof Checkpoint>;\nexport type CheckpointLabelProps = ComponentProps<typeof CheckpointLabel>;\nexport type CheckpointDescriptionProps = ComponentProps<typeof CheckpointDescription>;\nexport type CheckpointRestoreProps = ComponentProps<typeof CheckpointRestore>;\nexport type CheckpointDialogProps = ComponentProps<typeof CheckpointDialog>;\nexport type CheckpointRestoredProps = ComponentProps<typeof CheckpointRestored>;\nexport type CheckpointErrorProps = ComponentProps<typeof CheckpointError>;\nexport type CheckpointCancelProps = ComponentProps<typeof CheckpointCancel>;\nexport type CheckpointConfirmProps = ComponentProps<typeof CheckpointConfirm>;\nexport type CheckpointLossProps = ComponentProps<typeof CheckpointLoss>;\nexport type CheckpointScopeProps = ComponentProps<typeof CheckpointScope>;\nexport type CheckpointCompareProps = ComponentProps<typeof CheckpointCompare>;\n",
      "type": "registry:ui",
      "target": "@ui/svelte/checkpoint/index.ts"
    },
    {
      "path": "packages/agent-ui/src/svelte/checkpoint/parts.ts",
      "content": "import { checkpointPrimitive } from \"@kind-ui/agent-ui/core\";\nimport { createParts } from \"@ui-sdk/svelte/primitive\";\n\nexport const parts = createParts(checkpointPrimitive, {\n  root: \"div\",\n  label: \"span\",\n  description: \"span\",\n  line: \"span\",\n  restore: \"div\",\n  restored: \"span\",\n  scope: \"div\",\n  compare: \"button\",\n  error: \"span\",\n  cancel: \"button\",\n  confirm: \"button\",\n});\n",
      "type": "registry:ui",
      "target": "@ui/svelte/checkpoint/parts.ts"
    }
  ],
  "meta": {
    "layer": "svelte"
  },
  "type": "registry:ui"
}
