{
  "version": 1,
  "docs": "https://docs.foldspace.ai/ui-catalog/",
  "install": "Copy the template and fs-kit into agent/ui/ (agent repo) or into your app, then wire it up as in the hosted-action or in-page-handler file.",
  "shared": {
    "id": "fs-kit",
    "ts": "/ui-catalog/files/ts/fs-kit.ts",
    "js": "/ui-catalog/files/js/fs-kit.js"
  },
  "templates": [
    {
      "id": "kpi-tiles",
      "title": "KPI tiles",
      "group": "Chat cards",
      "surface": "card",
      "kind": "read-only",
      "mobile": "same",
      "summary": "Two to six headline numbers, each with its change and a sparkline. The agent answers in a sentence; the card carries the numbers.",
      "whenToUse": "The user asks how something is doing and the answer is 2–6 headline numbers (totals, rates, counts), each with a change vs a period.",
      "whenNotToUse": "One number only (answer in text). A trend over time is the point (chart card). Many rows of the same metric (records list / table).",
      "states": [
        {
          "kind": "loading",
          "when": "While the card loads again in place, for example after Try again. While execute runs, the SDK shows its own loader."
        },
        {
          "kind": "empty",
          "when": "execute found nothing to show. The card says so and the agent explains why."
        },
        {
          "kind": "error",
          "when": "execute returned the failure as data, so the agent can explain it. Try again loads in place."
        }
      ],
      "facts": {
        "Kind": "Read-only",
        "Agent waits": "No",
        "Mobile": "Same card"
      },
      "page": "/ui-catalog/kpi-tiles/",
      "markdown": "/ui-catalog/kpi-tiles.md",
      "reports": [
        {
          "call": "displayed()",
          "gets": "FUNCTION_TOOL_DISPLAYED",
          "when": "As soon as the card shows. The agent goes on."
        }
      ],
      "data": {
        "KpiTilesData": [
          {
            "name": "title",
            "optional": false,
            "type": "string",
            "doc": ""
          },
          {
            "name": "subtitle",
            "optional": true,
            "type": "string",
            "doc": ""
          },
          {
            "name": "icon",
            "optional": true,
            "type": "IconName",
            "doc": ""
          },
          {
            "name": "metrics",
            "optional": false,
            "type": "KpiMetric[]",
            "doc": "2–6 tiles; more are cut."
          },
          {
            "name": "footnote",
            "optional": true,
            "type": "string",
            "doc": ""
          },
          {
            "name": "link",
            "optional": true,
            "type": "{ label: string; href: string }",
            "doc": ""
          }
        ],
        "KpiMetric": [
          {
            "name": "label",
            "optional": false,
            "type": "string",
            "doc": ""
          },
          {
            "name": "value",
            "optional": false,
            "type": "number | string",
            "doc": ""
          },
          {
            "name": "format",
            "optional": true,
            "type": "NumberFormat",
            "doc": ""
          },
          {
            "name": "delta",
            "optional": true,
            "type": "{ value: number; good?: boolean; vs?: string }",
            "doc": "Change in percent. good: false when up is bad (costs, churn); default: up is good."
          },
          {
            "name": "trend",
            "optional": true,
            "type": "number[]",
            "doc": "Recent values, oldest first, for the sparkline."
          }
        ]
      },
      "files": [
        {
          "label": "Hosted action",
          "role": "hosted-action",
          "path": {
            "ts": "agent/actions/show_pipeline_kpis/index.ts",
            "js": "agent/actions/show_pipeline_kpis/index.js"
          },
          "url": {
            "ts": "/ui-catalog/files/ts/usage/kpi-tiles.hosted.ts",
            "js": "/ui-catalog/files/js/usage/kpi-tiles.hosted.js"
          }
        },
        {
          "label": "In-page handler",
          "role": "in-page-handler",
          "path": {
            "ts": null,
            "js": null
          },
          "url": {
            "ts": "/ui-catalog/files/ts/usage/kpi-tiles.component.ts",
            "js": "/ui-catalog/files/js/usage/kpi-tiles.component.js"
          }
        },
        {
          "label": "kpi-tiles",
          "role": "template",
          "path": {
            "ts": "agent/ui/kpi-tiles.ts",
            "js": "agent/ui/kpi-tiles.js"
          },
          "url": {
            "ts": "/ui-catalog/files/ts/kpi-tiles.ts",
            "js": "/ui-catalog/files/js/kpi-tiles.js"
          }
        },
        {
          "label": "fs-kit",
          "role": "shared",
          "path": {
            "ts": "agent/ui/fs-kit.ts",
            "js": "agent/ui/fs-kit.js"
          },
          "url": {
            "ts": "/ui-catalog/files/ts/fs-kit.ts",
            "js": "/ui-catalog/files/js/fs-kit.js"
          }
        }
      ]
    },
    {
      "id": "chart",
      "title": "Chart",
      "group": "Chat cards",
      "surface": "card",
      "kind": "read-only",
      "mobile": "same",
      "summary": "One chart in a chat card: a trend with its previous period dashed behind it, bars grouped or stacked, or a donut breakdown. A headline carries the latest number and its change; hover or tap reads any point.",
      "whenToUse": "The answer is a shape, not one number: a trend over time (line), amounts per period or channel (bars, grouped or stacked), or how a whole splits up (donut). One to three series, plus a previous period to compare against.",
      "whenNotToUse": "A few headline numbers without their history (KPI tiles). Exact values to look up or sort (table). More than three series, or a full report with findings (report canvas).",
      "states": [
        {
          "kind": "loading",
          "when": "While the card loads again in place, for example after Try again. While execute runs, the SDK shows its own loader."
        },
        {
          "kind": "empty",
          "when": "execute found no data for the period. The card says so and the agent explains why."
        },
        {
          "kind": "error",
          "when": "execute returned the failure as data, so the agent can explain it. Try again loads in place."
        }
      ],
      "facts": {
        "Kind": "Read-only",
        "Agent waits": "No",
        "Types": "Line, bar (grouped or stacked), donut",
        "Mobile": "Same card, taller plot, 44px legend keys"
      },
      "page": "/ui-catalog/chart/",
      "markdown": "/ui-catalog/chart.md",
      "reports": [
        {
          "call": "displayed()",
          "gets": "FUNCTION_TOOL_DISPLAYED",
          "when": "As soon as the chart shows. The agent goes on; it already has every number from execute."
        }
      ],
      "data": {
        "ChartData": [
          {
            "name": "type",
            "optional": false,
            "type": "\"line\" | \"bar\" | \"donut\"",
            "doc": "line: a trend over time. bar: amounts per period or category. donut: parts of one whole."
          },
          {
            "name": "title",
            "optional": false,
            "type": "string",
            "doc": ""
          },
          {
            "name": "subtitle",
            "optional": true,
            "type": "string",
            "doc": ""
          },
          {
            "name": "icon",
            "optional": true,
            "type": "IconName",
            "doc": "Default: chart, bars or pie, by type."
          },
          {
            "name": "labels",
            "optional": false,
            "type": "string[]",
            "doc": "The x-axis labels, oldest first. On a donut, the slice names."
          },
          {
            "name": "series",
            "optional": false,
            "type": "ChartSeries[]",
            "doc": "1 to 3 series plus one compare series; more are cut. A donut draws its first series, up to 5 slices (the rest become Other)."
          },
          {
            "name": "stacked",
            "optional": true,
            "type": "boolean",
            "doc": "Bars only: stack the series instead of grouping them. Values should be 0 or more."
          },
          {
            "name": "format",
            "optional": true,
            "type": "NumberFormat",
            "doc": "How the axis, the tooltip and the headline format values."
          },
          {
            "name": "headline",
            "optional": true,
            "type": "ChartHeadline",
            "doc": "The number above the chart, with its change."
          },
          {
            "name": "footnote",
            "optional": true,
            "type": "string",
            "doc": "Short note on the left of the footer, e.g. \"Excludes refunds\"."
          },
          {
            "name": "link",
            "optional": true,
            "type": "{ label: string; href: string }",
            "doc": "A footer link to the full report in your app."
          }
        ],
        "ChartSeries": [
          {
            "name": "name",
            "optional": false,
            "type": "string",
            "doc": "The legend and tooltip name, e.g. \"2026\" or \"Organic\"."
          },
          {
            "name": "values",
            "optional": false,
            "type": "number[]",
            "doc": "One value per label, in the same order."
          },
          {
            "name": "compare",
            "optional": true,
            "type": "boolean",
            "doc": "A comparison series (last year, last period, a target): muted and dashed, never stacked. At most one."
          }
        ],
        "ChartHeadline": [
          {
            "name": "value",
            "optional": true,
            "type": "number | string",
            "doc": "The big number. Default: the last period's value (summed when stacked), or a donut's total."
          },
          {
            "name": "label",
            "optional": true,
            "type": "string",
            "doc": "What the number is, e.g. \"Revenue in November\". Default: the last label, or \"Total\" on a donut."
          },
          {
            "name": "delta",
            "optional": true,
            "type": "number",
            "doc": "Change in percent. Default: the last period against the compare series, or the period before."
          },
          {
            "name": "good",
            "optional": true,
            "type": "boolean",
            "doc": "false when up is bad (costs, churn). Default: up is good."
          },
          {
            "name": "vs",
            "optional": true,
            "type": "string",
            "doc": "What the change is against, e.g. \"vs Nov 2025\"."
          }
        ]
      },
      "files": [
        {
          "label": "Hosted action",
          "role": "hosted-action",
          "path": {
            "ts": "agent/actions/show_revenue_trend/index.ts",
            "js": "agent/actions/show_revenue_trend/index.js"
          },
          "url": {
            "ts": "/ui-catalog/files/ts/usage/chart.hosted.ts",
            "js": "/ui-catalog/files/js/usage/chart.hosted.js"
          }
        },
        {
          "label": "In-page handler",
          "role": "in-page-handler",
          "path": {
            "ts": null,
            "js": null
          },
          "url": {
            "ts": "/ui-catalog/files/ts/usage/chart.component.ts",
            "js": "/ui-catalog/files/js/usage/chart.component.js"
          }
        },
        {
          "label": "chart",
          "role": "template",
          "path": {
            "ts": "agent/ui/chart.ts",
            "js": "agent/ui/chart.js"
          },
          "url": {
            "ts": "/ui-catalog/files/ts/chart.ts",
            "js": "/ui-catalog/files/js/chart.js"
          }
        },
        {
          "label": "fs-kit",
          "role": "shared",
          "path": {
            "ts": "agent/ui/fs-kit.ts",
            "js": "agent/ui/fs-kit.js"
          },
          "url": {
            "ts": "/ui-catalog/files/ts/fs-kit.ts",
            "js": "/ui-catalog/files/js/fs-kit.js"
          }
        }
      ]
    },
    {
      "id": "entity-card",
      "title": "Entity card",
      "group": "Chat cards",
      "surface": "card",
      "kind": "read-only",
      "mobile": "same",
      "summary": "One record at a glance: what it is, its status and the 4–6 fields that matter, with a link to open it in your app. The agent answers the question; the card shows the record.",
      "whenToUse": "The user asks about one record (an account, a contact, an order, a project) and the answer is what it is, its status and 4–6 key fields, with a way to open it in your app.",
      "whenNotToUse": "Several records (records list or table). The user wants to change the record (form with approval). More than ~6 fields or long text (link to the record, or a canvas).",
      "states": [
        {
          "kind": "loading",
          "when": "While the card loads the record again in place, for example after Try again. While execute runs, the SDK shows its own loader."
        },
        {
          "kind": "empty",
          "when": "execute found no record that matches. The card says so and the agent offers the closest match."
        },
        {
          "kind": "error",
          "when": "execute returned the failure as data, so the agent can explain it. Try again loads the record in place."
        }
      ],
      "facts": {
        "Kind": "Read-only",
        "Agent waits": "No",
        "Mobile": "Same card"
      },
      "page": "/ui-catalog/entity-card/",
      "markdown": "/ui-catalog/entity-card.md",
      "reports": [
        {
          "call": "displayed()",
          "gets": "FUNCTION_TOOL_DISPLAYED",
          "when": "As soon as the card shows. The agent goes on."
        }
      ],
      "data": {
        "EntityCardData": [
          {
            "name": "id",
            "optional": true,
            "type": "string",
            "doc": "Your record's id. The card doesn't show it; your actions.run can use it."
          },
          {
            "name": "kind",
            "optional": true,
            "type": "string",
            "doc": "What the record is, above the name: \"Account\", \"Contact\", \"Order\"."
          },
          {
            "name": "name",
            "optional": false,
            "type": "string",
            "doc": ""
          },
          {
            "name": "subtitle",
            "optional": true,
            "type": "string",
            "doc": ""
          },
          {
            "name": "avatarUrl",
            "optional": true,
            "type": "string",
            "doc": "Logo or photo URL. Without it, or if it fails to load, the card shows initials."
          },
          {
            "name": "avatarShape",
            "optional": true,
            "type": "\"square\" | \"circle\"",
            "doc": "\"square\" (default) for companies and things, \"circle\" for people."
          },
          {
            "name": "status",
            "optional": true,
            "type": "EntityStatus",
            "doc": ""
          },
          {
            "name": "fields",
            "optional": false,
            "type": "EntityField[]",
            "doc": "4–6 key fields. More are cut."
          },
          {
            "name": "tags",
            "optional": true,
            "type": "string[]",
            "doc": ""
          },
          {
            "name": "owner",
            "optional": true,
            "type": "EntityOwner",
            "doc": ""
          },
          {
            "name": "links",
            "optional": true,
            "type": "EntityLink[]",
            "doc": "At most 2, in the footer. More are cut."
          }
        ],
        "EntityField": [
          {
            "name": "label",
            "optional": false,
            "type": "string",
            "doc": ""
          },
          {
            "name": "value",
            "optional": false,
            "type": "string | number",
            "doc": "A number is formatted with format; a string is shown as is."
          },
          {
            "name": "format",
            "optional": true,
            "type": "NumberFormat",
            "doc": ""
          },
          {
            "name": "icon",
            "optional": true,
            "type": "IconName",
            "doc": "Small icon before the label."
          },
          {
            "name": "hint",
            "optional": true,
            "type": "string",
            "doc": "Short note after the value, e.g. \"in 108 days\"."
          },
          {
            "name": "href",
            "optional": true,
            "type": "string",
            "doc": "Makes the value a link: a page in your app, mailto: or tel:."
          },
          {
            "name": "meter",
            "optional": true,
            "type": "number",
            "doc": "0–100: draws a thin bar under the value (seat usage, a health score)."
          },
          {
            "name": "tone",
            "optional": true,
            "type": "EntityTone",
            "doc": "Colour of the meter. Default: info (the brand colour)."
          },
          {
            "name": "wide",
            "optional": true,
            "type": "boolean",
            "doc": "Full row in the two-column grid."
          }
        ],
        "EntityStatus": [
          {
            "name": "label",
            "optional": false,
            "type": "string",
            "doc": ""
          },
          {
            "name": "tone",
            "optional": true,
            "type": "EntityTone",
            "doc": "neutral (default), info, success, warning, error."
          }
        ],
        "EntityOwner": [
          {
            "name": "name",
            "optional": false,
            "type": "string",
            "doc": ""
          },
          {
            "name": "role",
            "optional": true,
            "type": "string",
            "doc": "e.g. \"Account owner\"."
          },
          {
            "name": "avatarUrl",
            "optional": true,
            "type": "string",
            "doc": "Photo URL. Without it the card shows initials."
          }
        ],
        "EntityLink": [
          {
            "name": "label",
            "optional": false,
            "type": "string",
            "doc": ""
          },
          {
            "name": "href",
            "optional": true,
            "type": "string",
            "doc": "Where the link goes. Without it, the card calls actions.run(link)."
          },
          {
            "name": "id",
            "optional": true,
            "type": "string",
            "doc": "Tells your actions.run which link was clicked."
          },
          {
            "name": "primary",
            "optional": true,
            "type": "boolean",
            "doc": "One link can be the primary button (brand colour). The others are then outline buttons."
          },
          {
            "name": "icon",
            "optional": true,
            "type": "IconName",
            "doc": ""
          }
        ],
        "EntityCardActions": [
          {
            "name": "run()",
            "optional": true,
            "type": "(link: EntityLink) => void",
            "doc": "A footer link without href was clicked. Open or do it in your app."
          }
        ]
      },
      "files": [
        {
          "label": "Hosted action",
          "role": "hosted-action",
          "path": {
            "ts": "agent/actions/show_account/index.ts",
            "js": "agent/actions/show_account/index.js"
          },
          "url": {
            "ts": "/ui-catalog/files/ts/usage/entity-card.hosted.ts",
            "js": "/ui-catalog/files/js/usage/entity-card.hosted.js"
          }
        },
        {
          "label": "In-page handler",
          "role": "in-page-handler",
          "path": {
            "ts": null,
            "js": null
          },
          "url": {
            "ts": "/ui-catalog/files/ts/usage/entity-card.component.ts",
            "js": "/ui-catalog/files/js/usage/entity-card.component.js"
          }
        },
        {
          "label": "entity-card",
          "role": "template",
          "path": {
            "ts": "agent/ui/entity-card.ts",
            "js": "agent/ui/entity-card.js"
          },
          "url": {
            "ts": "/ui-catalog/files/ts/entity-card.ts",
            "js": "/ui-catalog/files/js/entity-card.js"
          }
        },
        {
          "label": "fs-kit",
          "role": "shared",
          "path": {
            "ts": "agent/ui/fs-kit.ts",
            "js": "agent/ui/fs-kit.js"
          },
          "url": {
            "ts": "/ui-catalog/files/ts/fs-kit.ts",
            "js": "/ui-catalog/files/js/fs-kit.js"
          }
        }
      ]
    },
    {
      "id": "records-list",
      "title": "Records list",
      "group": "Chat cards",
      "surface": "card",
      "kind": "read-only",
      "mobile": "same",
      "summary": "Three to eight records of one type, each with one line of detail and a value or status. Each row opens the record in your app; a footer link leads to the rest.",
      "whenToUse": "The answer is a short list of records of one type (open tickets, deals closing soon, recent orders): 3–8 rows, each with a title, one line of detail and a value or status. Rows open the record in your app.",
      "whenNotToUse": "One record (entity card). The user needs to compare several columns or sort (paginated table). The user must pick one to go on (picker).",
      "states": [
        {
          "kind": "loading",
          "when": "While the list loads again in place, for example after Try again or a refresh. While execute runs, the SDK shows its own loader."
        },
        {
          "kind": "empty",
          "when": "execute found no records. The card says so and the agent explains why."
        },
        {
          "kind": "error",
          "when": "execute returned the failure as data, so the agent can explain it. Try again loads the rows in place."
        }
      ],
      "facts": {
        "Kind": "Read-only",
        "Agent waits": "No",
        "Mobile": "Same card, 44px rows"
      },
      "page": "/ui-catalog/records-list/",
      "markdown": "/ui-catalog/records-list.md",
      "reports": [
        {
          "call": "displayed()",
          "gets": "FUNCTION_TOOL_DISPLAYED",
          "when": "As soon as the card shows. The agent goes on. Opening a row is your app's job."
        }
      ],
      "data": {
        "RecordsListData": [
          {
            "name": "title",
            "optional": false,
            "type": "string",
            "doc": ""
          },
          {
            "name": "subtitle",
            "optional": true,
            "type": "string",
            "doc": ""
          },
          {
            "name": "icon",
            "optional": true,
            "type": "IconName",
            "doc": ""
          },
          {
            "name": "records",
            "optional": false,
            "type": "ListRecord[]",
            "doc": "3–8 rows. More are cut."
          },
          {
            "name": "total",
            "optional": true,
            "type": "number",
            "doc": "How many there are in all. When it's more than the rows shown, the footer links to the rest."
          },
          {
            "name": "noun",
            "optional": true,
            "type": "string",
            "doc": "What the rows are, plural, for \"Show all 12 deals\". Default: \"records\"."
          },
          {
            "name": "allHref",
            "optional": true,
            "type": "string",
            "doc": "Where \"Show all\" goes. Without it, the link calls actions.showAll (when given)."
          },
          {
            "name": "avatarShape",
            "optional": true,
            "type": "\"square\" | \"circle\"",
            "doc": "\"square\" (default) for companies and things, \"circle\" for people."
          },
          {
            "name": "footnote",
            "optional": true,
            "type": "string",
            "doc": "Short note on the left of the footer, e.g. \"Sorted by close date\"."
          },
          {
            "name": "emptyText",
            "optional": true,
            "type": "string",
            "doc": "Shown instead of rows when records is empty."
          }
        ],
        "ListRecord": [
          {
            "name": "id",
            "optional": false,
            "type": "string",
            "doc": "Your record's id: actions.open gets the record back."
          },
          {
            "name": "title",
            "optional": false,
            "type": "string",
            "doc": ""
          },
          {
            "name": "meta",
            "optional": true,
            "type": "string",
            "doc": "The one line under the title, e.g. \"Acme Logistics · closes Nov 28\"."
          },
          {
            "name": "avatar",
            "optional": true,
            "type": "string",
            "doc": "Name for the leading avatar's initials (a person or a company). Default: the title."
          },
          {
            "name": "avatarUrl",
            "optional": true,
            "type": "string",
            "doc": "Logo or photo for the leading avatar. Falls back to initials."
          },
          {
            "name": "icon",
            "optional": true,
            "type": "IconName",
            "doc": "A leading icon instead of an avatar."
          },
          {
            "name": "value",
            "optional": true,
            "type": "string | number",
            "doc": "Trailing value. A number is formatted with format."
          },
          {
            "name": "format",
            "optional": true,
            "type": "NumberFormat",
            "doc": ""
          },
          {
            "name": "status",
            "optional": true,
            "type": "ListStatus",
            "doc": ""
          },
          {
            "name": "href",
            "optional": true,
            "type": "string",
            "doc": "Opens the record in your app. Without it, the row calls actions.open (when given)."
          }
        ],
        "ListStatus": [
          {
            "name": "label",
            "optional": false,
            "type": "string",
            "doc": ""
          },
          {
            "name": "tone",
            "optional": true,
            "type": "ListTone",
            "doc": "neutral (default), info, success, warning, error."
          }
        ],
        "RecordsListActions": [
          {
            "name": "open()",
            "optional": true,
            "type": "(record: ListRecord) => void",
            "doc": "A row without href was clicked. Open the record in your app."
          },
          {
            "name": "showAll()",
            "optional": true,
            "type": "() => void",
            "doc": "\"Show all\" was clicked and there's no allHref."
          }
        ]
      },
      "files": [
        {
          "label": "Hosted action",
          "role": "hosted-action",
          "path": {
            "ts": "agent/actions/list_closing_deals/index.ts",
            "js": "agent/actions/list_closing_deals/index.js"
          },
          "url": {
            "ts": "/ui-catalog/files/ts/usage/records-list.hosted.ts",
            "js": "/ui-catalog/files/js/usage/records-list.hosted.js"
          }
        },
        {
          "label": "In-page handler",
          "role": "in-page-handler",
          "path": {
            "ts": null,
            "js": null
          },
          "url": {
            "ts": "/ui-catalog/files/ts/usage/records-list.component.ts",
            "js": "/ui-catalog/files/js/usage/records-list.component.js"
          }
        },
        {
          "label": "records-list",
          "role": "template",
          "path": {
            "ts": "agent/ui/records-list.ts",
            "js": "agent/ui/records-list.js"
          },
          "url": {
            "ts": "/ui-catalog/files/ts/records-list.ts",
            "js": "/ui-catalog/files/js/records-list.js"
          }
        },
        {
          "label": "fs-kit",
          "role": "shared",
          "path": {
            "ts": "agent/ui/fs-kit.ts",
            "js": "agent/ui/fs-kit.js"
          },
          "url": {
            "ts": "/ui-catalog/files/ts/fs-kit.ts",
            "js": "/ui-catalog/files/js/fs-kit.js"
          }
        }
      ]
    },
    {
      "id": "data-table",
      "title": "Paginated table",
      "group": "Chat cards",
      "surface": "card",
      "kind": "read-only",
      "mobile": "variant",
      "summary": "Rows to compare across 3–6 columns. The user sorts by any column and pages through five rows at a time, inside the card. When the card is too narrow for the columns, rows stack instead of scrolling sideways.",
      "whenToUse": "The answer is 6–50 rows the user wants to compare across 3–6 columns (amounts, dates, statuses): unpaid invoices, usage by team, orders this week. The user sorts and pages in the card; the agent doesn't wait.",
      "whenNotToUse": "Up to ~8 rows with one value each (records list). One record (entity card). More than 6 columns, filters or bulk edits (link to the page in your app, or a REPORT canvas).",
      "states": [
        {
          "kind": "loading",
          "when": "While the rows load again in place, for example after Try again. While execute runs, the SDK shows its own loader. Pass the columns and the header band shows their labels."
        },
        {
          "kind": "empty",
          "when": "execute found no rows. The card says so and the agent explains why."
        },
        {
          "kind": "error",
          "when": "execute returned the failure as data, so the agent can explain it. Try again loads the rows in place."
        }
      ],
      "facts": {
        "Kind": "Read-only",
        "Agent waits": "No",
        "Mobile": "Variant: stacked row cards, 44px targets"
      },
      "page": "/ui-catalog/data-table/",
      "markdown": "/ui-catalog/data-table.md",
      "reports": [
        {
          "call": "displayed()",
          "gets": "FUNCTION_TOOL_DISPLAYED",
          "when": "As soon as the card shows. Sorting and paging stay in the card; the agent already has every row."
        }
      ],
      "data": {
        "DataTableData": [
          {
            "name": "title",
            "optional": false,
            "type": "string",
            "doc": ""
          },
          {
            "name": "subtitle",
            "optional": true,
            "type": "string",
            "doc": ""
          },
          {
            "name": "icon",
            "optional": true,
            "type": "IconName",
            "doc": ""
          },
          {
            "name": "columns",
            "optional": false,
            "type": "TableColumn[]",
            "doc": "3–6 columns. More are cut."
          },
          {
            "name": "rows",
            "optional": false,
            "type": "Record<string, TableCell>[]",
            "doc": "Every row (not one page), keyed by column id. The card sorts and pages them itself."
          },
          {
            "name": "pageSize",
            "optional": true,
            "type": "number",
            "doc": "Rows per page. Default 5."
          },
          {
            "name": "sortBy",
            "optional": true,
            "type": "string",
            "doc": "Column id the rows start sorted by. Default: the order given."
          },
          {
            "name": "sortDir",
            "optional": true,
            "type": "\"asc\" | \"desc\"",
            "doc": "Default: high to low for numbers and dates, A to Z for text."
          },
          {
            "name": "titleColumn",
            "optional": true,
            "type": "string",
            "doc": "Column shown as each row's title when the table stacks. Default: the first text column."
          },
          {
            "name": "link",
            "optional": true,
            "type": "TableLink",
            "doc": "A link in the header, e.g. to the full list in your app."
          }
        ],
        "TableColumn": [
          {
            "name": "id",
            "optional": false,
            "type": "string",
            "doc": "The key of this column's value in each row."
          },
          {
            "name": "label",
            "optional": false,
            "type": "string",
            "doc": ""
          },
          {
            "name": "type",
            "optional": true,
            "type": "\"text\" | \"number\" | \"currency\" | \"date\" | \"status\"",
            "doc": "text (default), number, currency, date (ISO, e.g. \"2026-11-03\") or status. Numbers and currency align right."
          },
          {
            "name": "format",
            "optional": true,
            "type": "NumberFormat",
            "doc": "For number and currency columns. Currency defaults to USD."
          },
          {
            "name": "sortable",
            "optional": true,
            "type": "boolean",
            "doc": "Default true: the header sorts the rows."
          },
          {
            "name": "tones",
            "optional": true,
            "type": "Record<string, TableTone>",
            "doc": "Status columns: the tone of each value, e.g. { Overdue: \"error\", Paid: \"success\" }. Default neutral."
          }
        ],
        "TableLink": [
          {
            "name": "label",
            "optional": false,
            "type": "string",
            "doc": ""
          },
          {
            "name": "href",
            "optional": false,
            "type": "string",
            "doc": ""
          }
        ]
      },
      "files": [
        {
          "label": "Hosted action",
          "role": "hosted-action",
          "path": {
            "ts": "agent/actions/list_unpaid_invoices/index.ts",
            "js": "agent/actions/list_unpaid_invoices/index.js"
          },
          "url": {
            "ts": "/ui-catalog/files/ts/usage/data-table.hosted.ts",
            "js": "/ui-catalog/files/js/usage/data-table.hosted.js"
          }
        },
        {
          "label": "In-page handler",
          "role": "in-page-handler",
          "path": {
            "ts": null,
            "js": null
          },
          "url": {
            "ts": "/ui-catalog/files/ts/usage/data-table.component.ts",
            "js": "/ui-catalog/files/js/usage/data-table.component.js"
          }
        },
        {
          "label": "data-table",
          "role": "template",
          "path": {
            "ts": "agent/ui/data-table.ts",
            "js": "agent/ui/data-table.js"
          },
          "url": {
            "ts": "/ui-catalog/files/ts/data-table.ts",
            "js": "/ui-catalog/files/js/data-table.js"
          }
        },
        {
          "label": "fs-kit",
          "role": "shared",
          "path": {
            "ts": "agent/ui/fs-kit.ts",
            "js": "agent/ui/fs-kit.js"
          },
          "url": {
            "ts": "/ui-catalog/files/ts/fs-kit.ts",
            "js": "/ui-catalog/files/js/fs-kit.js"
          }
        }
      ]
    },
    {
      "id": "timeline",
      "title": "Timeline",
      "group": "Chat cards",
      "surface": "card",
      "kind": "read-only",
      "mobile": "same",
      "summary": "What happened to one record, newest first and grouped by day: who did it, what changed from what to what, and the comment or email behind it. Long feeds fold behind \"Show earlier events\".",
      "whenToUse": "The user asks what happened to one record (a deal, a ticket, an order): who did what and when, in order. Comments, emails, status moves and field changes, grouped by day.",
      "whenNotToUse": "The record's current state matters more than its history (entity card). Events across many records (records list or table). A trend in numbers over time (chart).",
      "states": [
        {
          "kind": "loading",
          "when": "While the card loads again in place, for example after Try again. While execute runs, the SDK shows its own loader."
        },
        {
          "kind": "empty",
          "when": "execute found no events for the record. The card says so and the agent explains why."
        },
        {
          "kind": "error",
          "when": "execute returned the failure as data, so the agent can explain it. Try again loads in place."
        }
      ],
      "facts": {
        "Kind": "Read-only",
        "Agent waits": "No",
        "Mobile": "Same card, 44px links and button"
      },
      "page": "/ui-catalog/timeline/",
      "markdown": "/ui-catalog/timeline.md",
      "reports": [
        {
          "call": "displayed()",
          "gets": "FUNCTION_TOOL_DISPLAYED",
          "when": "As soon as the card shows. The agent goes on. Opening an event is your app's job."
        }
      ],
      "data": {
        "TimelineData": [
          {
            "name": "title",
            "optional": false,
            "type": "string",
            "doc": ""
          },
          {
            "name": "subtitle",
            "optional": true,
            "type": "string",
            "doc": ""
          },
          {
            "name": "icon",
            "optional": true,
            "type": "IconName",
            "doc": "Default: clock."
          },
          {
            "name": "events",
            "optional": false,
            "type": "TimelineEvent[]",
            "doc": "In any order: the card sorts them newest first and groups them by day."
          },
          {
            "name": "visible",
            "optional": true,
            "type": "number",
            "doc": "How many events show before \"Show N earlier events\". Default: 5."
          },
          {
            "name": "footnote",
            "optional": true,
            "type": "string",
            "doc": "Short note on the left of the footer, e.g. \"Last 30 days\"."
          },
          {
            "name": "link",
            "optional": true,
            "type": "{ label: string; href: string }",
            "doc": "A footer link to the full history in your app."
          }
        ],
        "TimelineEvent": [
          {
            "name": "id",
            "optional": false,
            "type": "string",
            "doc": "Your event's id: actions.open gets the event back."
          },
          {
            "name": "kind",
            "optional": false,
            "type": "TimelineKind",
            "doc": "Sets the icon and its tone: created, updated, comment, status, email, call or system."
          },
          {
            "name": "actor",
            "optional": true,
            "type": "string",
            "doc": "Who did it, by name. Leave it out for events your system made."
          },
          {
            "name": "actorAvatarUrl",
            "optional": true,
            "type": "string",
            "doc": "A photo for the actor's avatar. Falls back to initials."
          },
          {
            "name": "action",
            "optional": false,
            "type": "string",
            "doc": "What happened, after the actor's name: \"moved the deal to Negotiation\". Without an actor, the whole sentence."
          },
          {
            "name": "at",
            "optional": false,
            "type": "string",
            "doc": "When, as an ISO 8601 time. Shown relative (\"2 hours ago\"), the exact time on hover."
          },
          {
            "name": "detail",
            "optional": true,
            "type": "string",
            "doc": "A comment's text, an email's subject or a call's note. Up to three lines show."
          },
          {
            "name": "changes",
            "optional": true,
            "type": "TimelineChange[]",
            "doc": "Field changes, drawn as old value, arrow, new value."
          },
          {
            "name": "linkLabel",
            "optional": true,
            "type": "string",
            "doc": "Shows a link on this event, e.g. \"Open email\". With href it goes there; without, it calls actions.open."
          },
          {
            "name": "href",
            "optional": true,
            "type": "string",
            "doc": "Where the event's link goes in your app."
          }
        ],
        "TimelineChange": [
          {
            "name": "field",
            "optional": false,
            "type": "string",
            "doc": "The field's name, e.g. \"Stage\"."
          },
          {
            "name": "from",
            "optional": true,
            "type": "string",
            "doc": "The old value. Leave it out when the field was empty."
          },
          {
            "name": "to",
            "optional": false,
            "type": "string",
            "doc": "The new value."
          }
        ],
        "TimelineActions": [
          {
            "name": "open()",
            "optional": true,
            "type": "(event: TimelineEvent) => void",
            "doc": "An event's link was clicked and the event has no href. Open it in your app."
          }
        ]
      },
      "files": [
        {
          "label": "Hosted action",
          "role": "hosted-action",
          "path": {
            "ts": "agent/actions/show_deal_activity/index.ts",
            "js": "agent/actions/show_deal_activity/index.js"
          },
          "url": {
            "ts": "/ui-catalog/files/ts/usage/timeline.hosted.ts",
            "js": "/ui-catalog/files/js/usage/timeline.hosted.js"
          }
        },
        {
          "label": "In-page handler",
          "role": "in-page-handler",
          "path": {
            "ts": null,
            "js": null
          },
          "url": {
            "ts": "/ui-catalog/files/ts/usage/timeline.component.ts",
            "js": "/ui-catalog/files/js/usage/timeline.component.js"
          }
        },
        {
          "label": "timeline",
          "role": "template",
          "path": {
            "ts": "agent/ui/timeline.ts",
            "js": "agent/ui/timeline.js"
          },
          "url": {
            "ts": "/ui-catalog/files/ts/timeline.ts",
            "js": "/ui-catalog/files/js/timeline.js"
          }
        },
        {
          "label": "fs-kit",
          "role": "shared",
          "path": {
            "ts": "agent/ui/fs-kit.ts",
            "js": "agent/ui/fs-kit.js"
          },
          "url": {
            "ts": "/ui-catalog/files/ts/fs-kit.ts",
            "js": "/ui-catalog/files/js/fs-kit.js"
          }
        }
      ]
    },
    {
      "id": "comparison",
      "title": "Comparison",
      "group": "Chat cards",
      "surface": "card",
      "kind": "read-only",
      "mobile": "variant",
      "summary": "Two to four plans, quotes or versions side by side. Rows that match collapse to one quiet line, the best value in a row gets a star, and the agent's pick is highlighted with its reason. Read-only by default; with selectable, each column gets a Choose button and the agent waits for the choice.",
      "whenToUse": "The user weighs 2–4 concrete options on the same attributes: plans, vendor quotes, versions, offers. The answer is in how they differ, row by row. Read-only by default; set selectable when the next step is choosing one, and the card waits for that choice.",
      "whenNotToUse": "One option (entity card). Five or more, or options that share few attributes (records list or table). A choice where a line per option is enough to decide (picker). Numbers over time (chart).",
      "states": [
        {
          "kind": "loading",
          "when": "While the card loads again in place, for example after Try again. While execute runs, the SDK shows its own loader."
        },
        {
          "kind": "empty",
          "when": "execute found fewer than two items. There's nothing to set side by side, so the card says so."
        },
        {
          "kind": "error",
          "when": "execute returned the failure as data, so the agent can explain it. Try again loads in place."
        }
      ],
      "facts": {
        "Kind": "Read-only (default), or input with selectable",
        "Agent waits": "Only with selectable, for a choice or cancel",
        "Mobile": "Variant: 44px targets, label above values"
      },
      "page": "/ui-catalog/comparison/",
      "markdown": "/ui-catalog/comparison.md",
      "reports": [
        {
          "call": "displayed()",
          "gets": "FUNCTION_TOOL_DISPLAYED",
          "when": "Read-only (no selectable): as soon as the card shows. The agent goes on."
        },
        {
          "call": "submit({ chosen, label, result })",
          "gets": "FUNCTION_TOOL_SUBMITTED_BY_USER",
          "when": "selectable: the user chose an item, after actions.choose() succeeds. chosen is the item id."
        },
        {
          "call": "cancel()",
          "gets": "FUNCTION_TOOL_CANCELLED_BY_USER",
          "when": "selectable: the user pressed the way out (default None of these). Nothing changed."
        }
      ],
      "data": {
        "ComparisonData": [
          {
            "name": "title",
            "optional": false,
            "type": "string",
            "doc": ""
          },
          {
            "name": "subtitle",
            "optional": true,
            "type": "string",
            "doc": ""
          },
          {
            "name": "icon",
            "optional": true,
            "type": "IconName",
            "doc": ""
          },
          {
            "name": "items",
            "optional": false,
            "type": "ComparisonItem[]",
            "doc": "2–4 items, one column each, in this order. More are cut."
          },
          {
            "name": "rows",
            "optional": false,
            "type": "ComparisonRow[]",
            "doc": "The attributes, top to bottom. Rows that match across every item draw as one quiet line."
          },
          {
            "name": "recommended",
            "optional": true,
            "type": "{ id: string; reason: string }",
            "doc": "The item the agent recommends, and why in one sentence. Its column is highlighted and badged."
          },
          {
            "name": "recommendedLabel",
            "optional": true,
            "type": "string",
            "doc": "Badge on the recommended column. Default \"Recommended\"."
          },
          {
            "name": "onlyDifferences",
            "optional": true,
            "type": "boolean",
            "doc": "Start with matching rows hidden. The user can switch them back on."
          },
          {
            "name": "selectable",
            "optional": true,
            "type": "boolean",
            "doc": "A Choose button under each item. The card becomes an input and the agent waits for the choice. Default: read-only."
          },
          {
            "name": "chooseLabel",
            "optional": true,
            "type": "string",
            "doc": "Default \"Choose\"."
          },
          {
            "name": "busyLabel",
            "optional": true,
            "type": "string",
            "doc": ""
          },
          {
            "name": "cancelLabel",
            "optional": true,
            "type": "string",
            "doc": "Selectable: the way out. Default \"None of these\"."
          },
          {
            "name": "receiptLabel",
            "optional": true,
            "type": "string",
            "doc": "Receipt lead-in before the chosen name. Default \"You chose\"."
          },
          {
            "name": "cancelledText",
            "optional": true,
            "type": "string",
            "doc": ""
          },
          {
            "name": "footnote",
            "optional": true,
            "type": "string",
            "doc": ""
          },
          {
            "name": "link",
            "optional": true,
            "type": "{ label: string; href: string }",
            "doc": ""
          }
        ],
        "ComparisonItem": [
          {
            "name": "id",
            "optional": false,
            "type": "string",
            "doc": "Key into every row's values."
          },
          {
            "name": "name",
            "optional": false,
            "type": "string",
            "doc": "Column heading: the plan, vendor, version or offer."
          },
          {
            "name": "price",
            "optional": true,
            "type": "string",
            "doc": "Headline figure under the name, e.g. \"$29\"."
          },
          {
            "name": "priceSub",
            "optional": true,
            "type": "string",
            "doc": "Small line under the price, e.g. \"per seat / mo\"."
          },
          {
            "name": "description",
            "optional": true,
            "type": "string",
            "doc": "One short line under the price. Keep it to a few words: columns are narrow in chat."
          },
          {
            "name": "disabledReason",
            "optional": true,
            "type": "string",
            "doc": "With selectable: shown instead of its Choose button, e.g. \"Not for 18 seats\"."
          }
        ],
        "ComparisonRow": [
          {
            "name": "label",
            "optional": false,
            "type": "string",
            "doc": "The attribute, e.g. \"Storage\"."
          },
          {
            "name": "values",
            "optional": false,
            "type": "Record<string, CompareValue>",
            "doc": "One value per item id. A missing id or null shows as not offered."
          },
          {
            "name": "kind",
            "optional": true,
            "type": "\"text\" | \"number\" | \"boolean\" | \"rating\"",
            "doc": "How values draw. Default: from the value (number, boolean, else text). \"rating\" draws stars out of max."
          },
          {
            "name": "format",
            "optional": true,
            "type": "NumberFormat",
            "doc": "How a number shows (currency, percent, compact)."
          },
          {
            "name": "unit",
            "optional": true,
            "type": "string",
            "doc": "After a number, e.g. \"GB\" or \"days\"."
          },
          {
            "name": "max",
            "optional": true,
            "type": "number",
            "doc": "Rating scale. Default 5."
          },
          {
            "name": "better",
            "optional": true,
            "type": "\"higher\" | \"lower\"",
            "doc": "Which value wins the row: it gets a star and \"best\" for screen readers. Omit when neither is better."
          },
          {
            "name": "hint",
            "optional": true,
            "type": "string",
            "doc": "A short hint under the label."
          },
          {
            "name": "group",
            "optional": true,
            "type": "string",
            "doc": "Starts a section above this row, e.g. \"Security\"."
          }
        ],
        "ComparisonActions": [
          {
            "name": "choose()",
            "optional": true,
            "type": "(id: string) => Promise<unknown>",
            "doc": "Selectable: acts on the choice (switch the plan, accept the quote). Throw to show the error and keep the card open."
          }
        ]
      },
      "files": [
        {
          "label": "Hosted action",
          "role": "hosted-action",
          "path": {
            "ts": "agent/actions/compare_plans/index.ts",
            "js": "agent/actions/compare_plans/index.js"
          },
          "url": {
            "ts": "/ui-catalog/files/ts/usage/comparison.hosted.ts",
            "js": "/ui-catalog/files/js/usage/comparison.hosted.js"
          }
        },
        {
          "label": "In-page handler",
          "role": "in-page-handler",
          "path": {
            "ts": null,
            "js": null
          },
          "url": {
            "ts": "/ui-catalog/files/ts/usage/comparison.component.ts",
            "js": "/ui-catalog/files/js/usage/comparison.component.js"
          }
        },
        {
          "label": "comparison",
          "role": "template",
          "path": {
            "ts": "agent/ui/comparison.ts",
            "js": "agent/ui/comparison.js"
          },
          "url": {
            "ts": "/ui-catalog/files/ts/comparison.ts",
            "js": "/ui-catalog/files/js/comparison.js"
          }
        },
        {
          "label": "fs-kit",
          "role": "shared",
          "path": {
            "ts": "agent/ui/fs-kit.ts",
            "js": "agent/ui/fs-kit.js"
          },
          "url": {
            "ts": "/ui-catalog/files/ts/fs-kit.ts",
            "js": "/ui-catalog/files/js/fs-kit.js"
          }
        }
      ]
    },
    {
      "id": "form-approval",
      "title": "Form with approval",
      "group": "Chat cards",
      "surface": "card",
      "kind": "input",
      "mobile": "variant",
      "summary": "The agent drafts a record and the user checks it, edits it and approves it. Nothing is written until they do. Fields the agent filled in are marked until the user edits them.",
      "whenToUse": "The agent is about to create or change a record and has drafted most values (from the conversation, the page or an API). The user checks, edits and approves; only then is anything written.",
      "whenNotToUse": "A single yes/no (confirm card). Choosing one of a few options (picker or ask_user_question). More than ~8 fields or dependent sections (wizard, or a FORM canvas on desktop).",
      "states": [
        {
          "kind": "loading",
          "when": "While the form loads again in place, after Try again. While execute runs, the SDK shows its own loader."
        },
        {
          "kind": "error",
          "when": "execute couldn't load what the form needs and returned the failure as data. Try again loads the form in place. Cancel reports cancel(), so the agent stops waiting."
        }
      ],
      "facts": {
        "Kind": "Input",
        "Agent waits": "Yes, for approve or cancel",
        "Mobile": "Variant: one column, 44px targets"
      },
      "page": "/ui-catalog/form-approval/",
      "markdown": "/ui-catalog/form-approval.md",
      "reports": [
        {
          "call": "submit({ approved, values, result })",
          "gets": "FUNCTION_TOOL_SUBMITTED_BY_USER",
          "when": "After actions.save() succeeds. A save that throws keeps the form open."
        },
        {
          "call": "cancel()",
          "gets": "FUNCTION_TOOL_CANCELLED_BY_USER",
          "when": "The user pressed Cancel. Nothing was saved."
        }
      ],
      "data": {
        "FormApprovalData": [
          {
            "name": "title",
            "optional": false,
            "type": "string",
            "doc": ""
          },
          {
            "name": "subtitle",
            "optional": true,
            "type": "string",
            "doc": ""
          },
          {
            "name": "icon",
            "optional": true,
            "type": "IconName",
            "doc": ""
          },
          {
            "name": "note",
            "optional": true,
            "type": "string",
            "doc": "The agent's one-line note above the fields."
          },
          {
            "name": "fields",
            "optional": false,
            "type": "FormField[]",
            "doc": ""
          },
          {
            "name": "submitLabel",
            "optional": true,
            "type": "string",
            "doc": ""
          },
          {
            "name": "busyLabel",
            "optional": true,
            "type": "string",
            "doc": ""
          },
          {
            "name": "cancelLabel",
            "optional": true,
            "type": "string",
            "doc": ""
          },
          {
            "name": "cancelledText",
            "optional": true,
            "type": "string",
            "doc": ""
          },
          {
            "name": "receipt",
            "optional": true,
            "type": "{ title?: string; subtitle?: string; fields?: string[]; link?: { label: string; href: string } }",
            "doc": "What the card shows after a successful save."
          }
        ],
        "FormField": [
          {
            "name": "id",
            "optional": false,
            "type": "string",
            "doc": ""
          },
          {
            "name": "label",
            "optional": false,
            "type": "string",
            "doc": ""
          },
          {
            "name": "type",
            "optional": true,
            "type": "\"text\" | \"email\" | \"number\" | \"date\" | \"select\" | \"textarea\"",
            "doc": ""
          },
          {
            "name": "value",
            "optional": true,
            "type": "string | number",
            "doc": ""
          },
          {
            "name": "required",
            "optional": true,
            "type": "boolean",
            "doc": ""
          },
          {
            "name": "aiFilled",
            "optional": true,
            "type": "boolean",
            "doc": "The agent filled this in: dashed border and a \"Suggested\" mark until the user edits it."
          },
          {
            "name": "wide",
            "optional": true,
            "type": "boolean",
            "doc": "Full row in the two-column layout (textareas always are)."
          },
          {
            "name": "options",
            "optional": true,
            "type": "(string | { value: string; label: string })[]",
            "doc": ""
          },
          {
            "name": "placeholder",
            "optional": true,
            "type": "string",
            "doc": ""
          },
          {
            "name": "hint",
            "optional": true,
            "type": "string",
            "doc": ""
          },
          {
            "name": "prefix",
            "optional": true,
            "type": "string",
            "doc": "Shown inside the input, e.g. \"$\"."
          },
          {
            "name": "rows",
            "optional": true,
            "type": "number",
            "doc": ""
          },
          {
            "name": "format",
            "optional": true,
            "type": "NumberFormat",
            "doc": "How a number shows on the receipt."
          }
        ],
        "FormActions": [
          {
            "name": "save()",
            "optional": true,
            "type": "(values: FormValues) => Promise<{ url?: string } | void>",
            "doc": "Writes the record. Throw to show the error and keep the form open. Return { url } to link the receipt."
          }
        ]
      },
      "files": [
        {
          "label": "Hosted action",
          "role": "hosted-action",
          "path": {
            "ts": "agent/actions/create_deal/index.ts",
            "js": "agent/actions/create_deal/index.js"
          },
          "url": {
            "ts": "/ui-catalog/files/ts/usage/form-approval.hosted.ts",
            "js": "/ui-catalog/files/js/usage/form-approval.hosted.js"
          }
        },
        {
          "label": "In-page handler",
          "role": "in-page-handler",
          "path": {
            "ts": null,
            "js": null
          },
          "url": {
            "ts": "/ui-catalog/files/ts/usage/form-approval.component.ts",
            "js": "/ui-catalog/files/js/usage/form-approval.component.js"
          }
        },
        {
          "label": "form-approval",
          "role": "template",
          "path": {
            "ts": "agent/ui/form-approval.ts",
            "js": "agent/ui/form-approval.js"
          },
          "url": {
            "ts": "/ui-catalog/files/ts/form-approval.ts",
            "js": "/ui-catalog/files/js/form-approval.js"
          }
        },
        {
          "label": "fs-kit",
          "role": "shared",
          "path": {
            "ts": "agent/ui/fs-kit.ts",
            "js": "agent/ui/fs-kit.js"
          },
          "url": {
            "ts": "/ui-catalog/files/ts/fs-kit.ts",
            "js": "/ui-catalog/files/js/fs-kit.js"
          }
        }
      ]
    },
    {
      "id": "picker",
      "title": "Picker",
      "group": "Chat cards",
      "surface": "card",
      "kind": "input",
      "mobile": "variant",
      "summary": "The user chooses one, or several, of up to 12 options, each with an icon or avatar, a description and a price or badge. Continue unlocks once something is chosen, and the card collapses to one line after.",
      "whenToUse": "The next step depends on a choice between 2–12 concrete options the agent already has: a plan, a time slot, an owner, the channels to notify. Each option needs more than a word to choose well: a description, a price, a badge.",
      "whenNotToUse": "Two or three one-word answers (quick replies or ask_user_question). A yes or no before a change (confirm card). Values the user types in (form with approval). Hundreds of options (ask what they're looking for, then search).",
      "states": [
        {
          "kind": "loading",
          "when": "While the options load in place: after Try again, or when they load after the card opens (free time slots, say). While execute runs, the SDK shows its own loader."
        },
        {
          "kind": "empty",
          "when": "execute found nothing to choose from: the plan is set by a contract. Cancel reports cancel(), so the agent stops waiting."
        },
        {
          "kind": "error",
          "when": "execute couldn't read the plans and returned the failure as data. Try again loads them in place. Cancel reports cancel(), so the agent stops waiting."
        }
      ],
      "facts": {
        "Kind": "Input",
        "Agent waits": "Yes, for a choice or cancel",
        "Mobile": "Variant: one column, 44px targets"
      },
      "page": "/ui-catalog/picker/",
      "markdown": "/ui-catalog/picker.md",
      "reports": [
        {
          "call": "submit({ selected, labels, result })",
          "gets": "FUNCTION_TOOL_SUBMITTED_BY_USER",
          "when": "The user pressed Continue. selected is always an array of option ids, one item unless multiple is on."
        },
        {
          "call": "cancel()",
          "gets": "FUNCTION_TOOL_CANCELLED_BY_USER",
          "when": "The user pressed Cancel. Nothing was chosen."
        }
      ],
      "data": {
        "PickerData": [
          {
            "name": "title",
            "optional": false,
            "type": "string",
            "doc": ""
          },
          {
            "name": "subtitle",
            "optional": true,
            "type": "string",
            "doc": ""
          },
          {
            "name": "icon",
            "optional": true,
            "type": "IconName",
            "doc": ""
          },
          {
            "name": "note",
            "optional": true,
            "type": "string",
            "doc": "The agent's one line above the options, e.g. why it recommends one."
          },
          {
            "name": "options",
            "optional": false,
            "type": "PickerOption[]",
            "doc": "2–12 options. A search box shows above more than 6."
          },
          {
            "name": "multiple",
            "optional": true,
            "type": "boolean",
            "doc": "Choose several (checkbox cards). Default: one (radio cards)."
          },
          {
            "name": "max",
            "optional": true,
            "type": "number",
            "doc": "With multiple: the most the user can choose."
          },
          {
            "name": "selected",
            "optional": true,
            "type": "string[]",
            "doc": "Option ids chosen when the card opens (the agent's suggestion)."
          },
          {
            "name": "layout",
            "optional": true,
            "type": "\"list\" | \"grid\"",
            "doc": "\"grid\": two columns of compact tiles, for short options like time slots."
          },
          {
            "name": "submitLabel",
            "optional": true,
            "type": "string",
            "doc": ""
          },
          {
            "name": "busyLabel",
            "optional": true,
            "type": "string",
            "doc": ""
          },
          {
            "name": "cancelLabel",
            "optional": true,
            "type": "string",
            "doc": ""
          },
          {
            "name": "searchPlaceholder",
            "optional": true,
            "type": "string",
            "doc": ""
          },
          {
            "name": "receiptLabel",
            "optional": true,
            "type": "string",
            "doc": "Receipt lead-in before the chosen labels. Default \"You chose\"."
          },
          {
            "name": "cancelledText",
            "optional": true,
            "type": "string",
            "doc": ""
          }
        ],
        "PickerOption": [
          {
            "name": "id",
            "optional": false,
            "type": "string",
            "doc": ""
          },
          {
            "name": "label",
            "optional": false,
            "type": "string",
            "doc": ""
          },
          {
            "name": "description",
            "optional": true,
            "type": "string",
            "doc": ""
          },
          {
            "name": "icon",
            "optional": true,
            "type": "IconName",
            "doc": "Icon in the option's leading tile. Ignored when avatar is set."
          },
          {
            "name": "avatar",
            "optional": true,
            "type": "string",
            "doc": "An image URL, or 1–2 initials, for people, accounts and workspaces."
          },
          {
            "name": "meta",
            "optional": true,
            "type": "string",
            "doc": "Right-hand detail: a price, a time, a count."
          },
          {
            "name": "metaSub",
            "optional": true,
            "type": "string",
            "doc": "Small line under meta, e.g. \"per month\"."
          },
          {
            "name": "badge",
            "optional": true,
            "type": "string",
            "doc": "Short badge after the label, e.g. \"Recommended\"."
          },
          {
            "name": "disabled",
            "optional": true,
            "type": "boolean",
            "doc": "Shown but can't be chosen."
          },
          {
            "name": "disabledReason",
            "optional": true,
            "type": "string",
            "doc": "Why it can't be chosen. Replaces the description."
          }
        ],
        "PickerActions": [
          {
            "name": "choose()",
            "optional": true,
            "type": "(ids: string[]) => Promise<unknown>",
            "doc": "Acts on the choice (reserve the slot, switch the plan). Throw to show the error and keep the picker open."
          }
        ]
      },
      "files": [
        {
          "label": "Hosted action",
          "role": "hosted-action",
          "path": {
            "ts": "agent/actions/choose_plan/index.ts",
            "js": "agent/actions/choose_plan/index.js"
          },
          "url": {
            "ts": "/ui-catalog/files/ts/usage/picker.hosted.ts",
            "js": "/ui-catalog/files/js/usage/picker.hosted.js"
          }
        },
        {
          "label": "In-page handler",
          "role": "in-page-handler",
          "path": {
            "ts": null,
            "js": null
          },
          "url": {
            "ts": "/ui-catalog/files/ts/usage/picker.component.ts",
            "js": "/ui-catalog/files/js/usage/picker.component.js"
          }
        },
        {
          "label": "picker",
          "role": "template",
          "path": {
            "ts": "agent/ui/picker.ts",
            "js": "agent/ui/picker.js"
          },
          "url": {
            "ts": "/ui-catalog/files/ts/picker.ts",
            "js": "/ui-catalog/files/js/picker.js"
          }
        },
        {
          "label": "fs-kit",
          "role": "shared",
          "path": {
            "ts": "agent/ui/fs-kit.ts",
            "js": "agent/ui/fs-kit.js"
          },
          "url": {
            "ts": "/ui-catalog/files/ts/fs-kit.ts",
            "js": "/ui-catalog/files/js/fs-kit.js"
          }
        }
      ]
    },
    {
      "id": "confirm",
      "title": "Confirm",
      "group": "Chat cards",
      "surface": "card",
      "kind": "input",
      "mobile": "variant",
      "summary": "Before a change that costs money, reaches other people or can't be undone, the user sees what changes, before and after, and confirms it. The destructive tone adds an alert, an error-colored button and an optional word to type.",
      "whenToUse": "The agent is about to make a change the user should approve first: billing, permissions, bulk updates, deletes, anything sent to other people. The values are settled; the user only says yes or no.",
      "whenNotToUse": "The user still has values to fill in or correct (form with approval). A choice between options (picker). A change that is cheap to undo and was asked for in so many words (do it and show the result).",
      "states": [
        {
          "kind": "loading",
          "when": "While the preview loads again in place, after Try again. While execute runs, the SDK shows its own loader."
        },
        {
          "kind": "error",
          "when": "execute couldn't preview the change and returned the failure as data. Try again loads the preview in place. Cancel reports cancel(), so the agent stops waiting."
        }
      ],
      "facts": {
        "Kind": "Input",
        "Agent waits": "Yes, for confirm or cancel",
        "Mobile": "Variant: stacked full-width buttons"
      },
      "page": "/ui-catalog/confirm/",
      "markdown": "/ui-catalog/confirm.md",
      "reports": [
        {
          "call": "submit({ confirmed: true, result })",
          "gets": "FUNCTION_TOOL_SUBMITTED_BY_USER",
          "when": "After actions.confirm() succeeds. A confirm that throws keeps the card open with the error."
        },
        {
          "call": "cancel()",
          "gets": "FUNCTION_TOOL_CANCELLED_BY_USER",
          "when": "The user pressed Cancel. Nothing changed."
        }
      ],
      "data": {
        "ConfirmData": [
          {
            "name": "title",
            "optional": false,
            "type": "string",
            "doc": ""
          },
          {
            "name": "subtitle",
            "optional": true,
            "type": "string",
            "doc": ""
          },
          {
            "name": "icon",
            "optional": true,
            "type": "IconName",
            "doc": ""
          },
          {
            "name": "summary",
            "optional": false,
            "type": "string",
            "doc": "One sentence: what happens when the user confirms."
          },
          {
            "name": "changes",
            "optional": true,
            "type": "ConfirmChange[]",
            "doc": "Before and after rows. A row without `to` shows as removed, one without `from` as new."
          },
          {
            "name": "impact",
            "optional": true,
            "type": "string",
            "doc": "One line on how far the change reaches, e.g. \"Affects 42 contacts\"."
          },
          {
            "name": "impactIcon",
            "optional": true,
            "type": "IconName",
            "doc": ""
          },
          {
            "name": "tone",
            "optional": true,
            "type": "\"default\" | \"destructive\"",
            "doc": "\"destructive\": alert note, error-colored confirm button with a trash icon, optional type-to-confirm."
          },
          {
            "name": "warning",
            "optional": true,
            "type": "string",
            "doc": "Destructive: the alert note. Default \"This can't be undone.\""
          },
          {
            "name": "confirmWord",
            "optional": true,
            "type": "string",
            "doc": "Destructive: the user types this word before the confirm button unlocks."
          },
          {
            "name": "confirmLabel",
            "optional": true,
            "type": "string",
            "doc": "Name the action, e.g. \"Delete 3 automations\", not \"OK\"."
          },
          {
            "name": "busyLabel",
            "optional": true,
            "type": "string",
            "doc": ""
          },
          {
            "name": "cancelLabel",
            "optional": true,
            "type": "string",
            "doc": ""
          },
          {
            "name": "removedLabel",
            "optional": true,
            "type": "string",
            "doc": "Tag on a removed row. Default \"Removed\"."
          },
          {
            "name": "done",
            "optional": true,
            "type": "ConfirmDone",
            "doc": "What the card shows after the change went through."
          },
          {
            "name": "cancelledText",
            "optional": true,
            "type": "string",
            "doc": ""
          }
        ],
        "ConfirmChange": [
          {
            "name": "field",
            "optional": false,
            "type": "string",
            "doc": "What changes, e.g. \"Seats\". For an added or removed item: the item's name."
          },
          {
            "name": "from",
            "optional": true,
            "type": "string | number",
            "doc": "The value now. Omit it for something new."
          },
          {
            "name": "to",
            "optional": true,
            "type": "string | number",
            "doc": "The value after. Omit it for something removed."
          },
          {
            "name": "format",
            "optional": true,
            "type": "NumberFormat",
            "doc": "How a number shows."
          }
        ],
        "ConfirmDone": [
          {
            "name": "title",
            "optional": true,
            "type": "string",
            "doc": ""
          },
          {
            "name": "text",
            "optional": true,
            "type": "string",
            "doc": ""
          },
          {
            "name": "link",
            "optional": true,
            "type": "{ label: string; href: string }",
            "doc": ""
          }
        ],
        "ConfirmActions": [
          {
            "name": "confirm()",
            "optional": true,
            "type": "() => Promise<{ url?: string } | void>",
            "doc": "Makes the change. Throw to show the error and keep the card open. Return { url } to link the done state."
          }
        ]
      },
      "files": [
        {
          "label": "Hosted action",
          "role": "hosted-action",
          "path": {
            "ts": "agent/actions/update_seats/index.ts",
            "js": "agent/actions/update_seats/index.js"
          },
          "url": {
            "ts": "/ui-catalog/files/ts/usage/confirm.hosted.ts",
            "js": "/ui-catalog/files/js/usage/confirm.hosted.js"
          }
        },
        {
          "label": "In-page handler",
          "role": "in-page-handler",
          "path": {
            "ts": null,
            "js": null
          },
          "url": {
            "ts": "/ui-catalog/files/ts/usage/confirm.component.ts",
            "js": "/ui-catalog/files/js/usage/confirm.component.js"
          }
        },
        {
          "label": "confirm",
          "role": "template",
          "path": {
            "ts": "agent/ui/confirm.ts",
            "js": "agent/ui/confirm.js"
          },
          "url": {
            "ts": "/ui-catalog/files/ts/confirm.ts",
            "js": "/ui-catalog/files/js/confirm.js"
          }
        },
        {
          "label": "fs-kit",
          "role": "shared",
          "path": {
            "ts": "agent/ui/fs-kit.ts",
            "js": "agent/ui/fs-kit.js"
          },
          "url": {
            "ts": "/ui-catalog/files/ts/fs-kit.ts",
            "js": "/ui-catalog/files/js/fs-kit.js"
          }
        }
      ]
    },
    {
      "id": "wizard",
      "title": "Wizard",
      "group": "Chat cards",
      "surface": "card",
      "kind": "input",
      "mobile": "variant",
      "summary": "A short guided setup inside one card: two or three small steps, each checked before Next, then a review of every answer with Edit links back. The card keeps one height across steps, so the chat doesn't jump.",
      "whenToUse": "A setup needs 5–12 answers that fall into 2–3 natural groups, and later answers make more sense once earlier ones are in: connect an integration, create a webhook, invite a team. The user reviews everything before anything is created.",
      "whenNotToUse": "Up to ~8 fields the agent can mostly draft (form with approval). One choice (picker). A long setup with many sections or dependent screens (onboarding or FORM canvas on desktop).",
      "states": [
        {
          "kind": "loading",
          "when": "While the setup loads again in place, after Try again. While execute runs, the SDK shows its own loader."
        },
        {
          "kind": "error",
          "when": "execute couldn't load what the setup needs and returned the failure as data. Try again loads the steps in place. Cancel setup reports cancel(), so the agent stops waiting."
        }
      ],
      "facts": {
        "Kind": "Input",
        "Agent waits": "Yes, for create or cancel",
        "Mobile": "Variant: one column, 44px targets"
      },
      "page": "/ui-catalog/wizard/",
      "markdown": "/ui-catalog/wizard.md",
      "reports": [
        {
          "call": "submit({ values, result })",
          "gets": "FUNCTION_TOOL_SUBMITTED_BY_USER",
          "when": "After actions.save() succeeds on the review step. A save that throws keeps the review open with the error."
        },
        {
          "call": "cancel()",
          "gets": "FUNCTION_TOOL_CANCELLED_BY_USER",
          "when": "The user closed the card (the × in its header). Nothing was created."
        }
      ],
      "data": {
        "WizardData": [
          {
            "name": "title",
            "optional": false,
            "type": "string",
            "doc": ""
          },
          {
            "name": "subtitle",
            "optional": true,
            "type": "string",
            "doc": ""
          },
          {
            "name": "icon",
            "optional": true,
            "type": "IconName",
            "doc": ""
          },
          {
            "name": "steps",
            "optional": false,
            "type": "WizardStep[]",
            "doc": "1–3 input steps. The review step is added after them."
          },
          {
            "name": "reviewTitle",
            "optional": true,
            "type": "string",
            "doc": ""
          },
          {
            "name": "reviewDescription",
            "optional": true,
            "type": "string",
            "doc": ""
          },
          {
            "name": "submitLabel",
            "optional": true,
            "type": "string",
            "doc": ""
          },
          {
            "name": "busyLabel",
            "optional": true,
            "type": "string",
            "doc": ""
          },
          {
            "name": "cancelLabel",
            "optional": true,
            "type": "string",
            "doc": "Accessible name of the close button, which cancels."
          },
          {
            "name": "cancelledText",
            "optional": true,
            "type": "string",
            "doc": ""
          },
          {
            "name": "receipt",
            "optional": true,
            "type": "WizardReceipt",
            "doc": "What the card shows after a successful save."
          }
        ],
        "WizardStep": [
          {
            "name": "id",
            "optional": false,
            "type": "string",
            "doc": ""
          },
          {
            "name": "title",
            "optional": false,
            "type": "string",
            "doc": "Short name: the step heading and its group on the review step."
          },
          {
            "name": "description",
            "optional": true,
            "type": "string",
            "doc": ""
          },
          {
            "name": "fields",
            "optional": false,
            "type": "WizardField[]",
            "doc": ""
          }
        ],
        "WizardField": [
          {
            "name": "id",
            "optional": false,
            "type": "string",
            "doc": ""
          },
          {
            "name": "label",
            "optional": false,
            "type": "string",
            "doc": ""
          },
          {
            "name": "type",
            "optional": true,
            "type": "\"text\" | \"email\" | \"url\" | \"number\" | \"select\" | \"textarea\" | \"choice\" | \"checks\" | \"toggle\"",
            "doc": "\"choice\": one option (segmented, or cards when options have descriptions). \"checks\": several. \"toggle\": an on/off switch."
          },
          {
            "name": "value",
            "optional": true,
            "type": "string | number | boolean | string[]",
            "doc": "Starting value. An array for \"checks\", a boolean for \"toggle\"."
          },
          {
            "name": "required",
            "optional": true,
            "type": "boolean",
            "doc": "Must be filled in. For \"checks\": at least one."
          },
          {
            "name": "options",
            "optional": true,
            "type": "WizardOption[]",
            "doc": ""
          },
          {
            "name": "placeholder",
            "optional": true,
            "type": "string",
            "doc": ""
          },
          {
            "name": "hint",
            "optional": true,
            "type": "string",
            "doc": ""
          },
          {
            "name": "pattern",
            "optional": true,
            "type": "string",
            "doc": "A regular expression the whole value must match."
          },
          {
            "name": "patternMessage",
            "optional": true,
            "type": "string",
            "doc": "Shown when the value doesn't match pattern."
          },
          {
            "name": "rows",
            "optional": true,
            "type": "number",
            "doc": ""
          },
          {
            "name": "mono",
            "optional": true,
            "type": "boolean",
            "doc": "Monospace text, for ids, URLs and event names."
          }
        ],
        "WizardOption": [
          {
            "name": "value",
            "optional": false,
            "type": "string",
            "doc": ""
          },
          {
            "name": "label",
            "optional": false,
            "type": "string",
            "doc": ""
          },
          {
            "name": "description",
            "optional": true,
            "type": "string",
            "doc": "Second line on option cards."
          }
        ],
        "WizardReceipt": [
          {
            "name": "title",
            "optional": true,
            "type": "string",
            "doc": ""
          },
          {
            "name": "subtitle",
            "optional": true,
            "type": "string",
            "doc": ""
          },
          {
            "name": "fields",
            "optional": true,
            "type": "string[]",
            "doc": "Field ids to show. Default: the first three."
          },
          {
            "name": "link",
            "optional": true,
            "type": "{ label: string; href: string }",
            "doc": ""
          }
        ],
        "WizardActions": [
          {
            "name": "save()",
            "optional": true,
            "type": "(values: WizardValues) => Promise<{ url?: string } | void>",
            "doc": "Saves everything. Throw to show the error on the review step. Return { url } to link the receipt."
          }
        ]
      },
      "files": [
        {
          "label": "Hosted action",
          "role": "hosted-action",
          "path": {
            "ts": "agent/actions/create_webhook/index.ts",
            "js": "agent/actions/create_webhook/index.js"
          },
          "url": {
            "ts": "/ui-catalog/files/ts/usage/wizard.hosted.ts",
            "js": "/ui-catalog/files/js/usage/wizard.hosted.js"
          }
        },
        {
          "label": "In-page handler",
          "role": "in-page-handler",
          "path": {
            "ts": null,
            "js": null
          },
          "url": {
            "ts": "/ui-catalog/files/ts/usage/wizard.component.ts",
            "js": "/ui-catalog/files/js/usage/wizard.component.js"
          }
        },
        {
          "label": "wizard",
          "role": "template",
          "path": {
            "ts": "agent/ui/wizard.ts",
            "js": "agent/ui/wizard.js"
          },
          "url": {
            "ts": "/ui-catalog/files/ts/wizard.ts",
            "js": "/ui-catalog/files/js/wizard.js"
          }
        },
        {
          "label": "fs-kit",
          "role": "shared",
          "path": {
            "ts": "agent/ui/fs-kit.ts",
            "js": "agent/ui/fs-kit.js"
          },
          "url": {
            "ts": "/ui-catalog/files/ts/fs-kit.ts",
            "js": "/ui-catalog/files/js/fs-kit.js"
          }
        }
      ]
    },
    {
      "id": "progress",
      "title": "Progress",
      "group": "Chat cards",
      "surface": "card",
      "kind": "interactive",
      "mobile": "variant",
      "summary": "A job the agent started (import, export, sync, bulk update) as it runs: overall progress, each step, elapsed and estimated time. The user can stop it, and when it ends, open the result, download the error report or retry what failed. The agent doesn't wait for it.",
      "whenToUse": "The agent started a job that takes more than a few seconds and runs on its own: an import, an export, a sync, a bulk update. The user wants to see it move, stop it, and act on what failed.",
      "whenNotToUse": "A change that finishes in a second or two (do it, then show the result). A yes or no before the job starts (confirm card first). Setup steps the user does by hand (onboarding guide). A job whose result the agent must read before it answers (wait in execute instead).",
      "states": [
        {
          "kind": "loading",
          "when": "While the card starts the job again in place, for example after Try again. While execute runs, the SDK shows its own loader."
        },
        {
          "kind": "empty",
          "when": "execute found nothing to run, here a file with no rows. Nothing started, and the card says why."
        },
        {
          "kind": "error",
          "when": "The job didn't start, and execute returned the failure as data, so the agent can explain it. Try again starts it in place."
        }
      ],
      "facts": {
        "Kind": "Interactive",
        "Agent waits": "No, displayed() at once",
        "Mobile": "Variant: 44px targets, stacked buttons"
      },
      "page": "/ui-catalog/progress/",
      "markdown": "/ui-catalog/progress.md",
      "reports": [
        {
          "call": "displayed()",
          "gets": "FUNCTION_TOOL_DISPLAYED",
          "when": "As soon as the card shows. The agent goes on and isn't told when the job ends: the user sees the outcome here, and the agent learns it on a later turn (a status action that reads the job) or from your app."
        }
      ],
      "data": {
        "ProgressData": [
          {
            "name": "title",
            "optional": false,
            "type": "string",
            "doc": "Name the job as it runs, \"Importing contacts\"; send a new title when it ends, \"Contacts imported\"."
          },
          {
            "name": "subtitle",
            "optional": true,
            "type": "string",
            "doc": ""
          },
          {
            "name": "icon",
            "optional": true,
            "type": "IconName",
            "doc": ""
          },
          {
            "name": "status",
            "optional": false,
            "type": "JobStatus",
            "doc": ""
          },
          {
            "name": "done",
            "optional": false,
            "type": "number",
            "doc": "Items handled so far."
          },
          {
            "name": "total",
            "optional": false,
            "type": "number",
            "doc": ""
          },
          {
            "name": "unit",
            "optional": true,
            "type": "string",
            "doc": "What's counted, plural: \"rows\", \"files\". Default \"items\"."
          },
          {
            "name": "failed",
            "optional": true,
            "type": "number",
            "doc": "Items that failed. With status \"partial\" they're what Retry sends again."
          },
          {
            "name": "steps",
            "optional": false,
            "type": "ProgressStep[]",
            "doc": ""
          },
          {
            "name": "startedAt",
            "optional": true,
            "type": "string | number",
            "doc": "When the job started (ISO string or ms). Default: when the card mounted. Elapsed time counts from it."
          },
          {
            "name": "finishedAt",
            "optional": true,
            "type": "string | number",
            "doc": "When it ended. Default: when the card saw it end. Freezes elapsed time."
          },
          {
            "name": "etaSeconds",
            "optional": true,
            "type": "number",
            "doc": "Seconds left, when your job knows. Otherwise the card estimates it from the rate so far."
          },
          {
            "name": "summary",
            "optional": true,
            "type": "string",
            "doc": "The outcome in a sentence, under the result title: what happened, what failed and why."
          },
          {
            "name": "link",
            "optional": true,
            "type": "{ label: string; href: string }",
            "doc": "Where the result lives, e.g. \"Open contacts\". Shown when the job is done or partly done."
          },
          {
            "name": "reportHref",
            "optional": true,
            "type": "string",
            "doc": "A file of the failed items and why (CSV). Shows \"Download error report\"."
          },
          {
            "name": "error",
            "optional": true,
            "type": "string",
            "doc": "status \"failed\": what went wrong, in the user's words, and whether anything changed."
          },
          {
            "name": "notice",
            "optional": true,
            "type": "string",
            "doc": "A passing problem while it runs, e.g. \"Can't reach the import service. Retrying…\". An empty string clears it."
          },
          {
            "name": "cancelable",
            "optional": true,
            "type": "boolean",
            "doc": "Show Cancel while running. Default: when actions.cancel is set."
          },
          {
            "name": "jobNoun",
            "optional": true,
            "type": "string",
            "doc": "The noun in buttons and the stop question, e.g. \"import\". Default \"job\"."
          }
        ],
        "ProgressStep": [
          {
            "name": "id",
            "optional": false,
            "type": "string",
            "doc": ""
          },
          {
            "name": "label",
            "optional": false,
            "type": "string",
            "doc": ""
          },
          {
            "name": "status",
            "optional": false,
            "type": "StepStatus",
            "doc": ""
          },
          {
            "name": "detail",
            "optional": true,
            "type": "string",
            "doc": "One short line under the label: \"214 merged\", or why it failed or was skipped."
          },
          {
            "name": "failed",
            "optional": true,
            "type": "number",
            "doc": "Items this step couldn't handle. A done step with failures shows a warning mark and \"12 failed\"."
          }
        ],
        "ProgressActions": [
          {
            "name": "subscribe()",
            "optional": true,
            "type": "(onChange: (patch: ProgressPatch) => void) => () => void",
            "doc": "Your job's updates (app events, polling). Call onChange with each change; the card redraws and announces step changes. Return the unsubscribe."
          },
          {
            "name": "cancel()",
            "optional": true,
            "type": "() => Promise<unknown>",
            "doc": "Stops the job. Throw to keep it running and show why. Without it, there's no Cancel."
          },
          {
            "name": "retry()",
            "optional": true,
            "type": "() => Promise<unknown>",
            "doc": "Runs again what failed: the failed items for \"partial\", the job for \"failed\". New progress arrives through subscribe."
          },
          {
            "name": "download()",
            "optional": true,
            "type": "(href: string) => void",
            "doc": "Downloads the error report. Hosted actions pass ctx.ui.download (the sandbox blocks native downloads). Without it, a download link."
          }
        ]
      },
      "files": [
        {
          "label": "Hosted action",
          "role": "hosted-action",
          "path": {
            "ts": "agent/actions/import_contacts/index.ts",
            "js": "agent/actions/import_contacts/index.js"
          },
          "url": {
            "ts": "/ui-catalog/files/ts/usage/progress.hosted.ts",
            "js": "/ui-catalog/files/js/usage/progress.hosted.js"
          }
        },
        {
          "label": "In-page handler",
          "role": "in-page-handler",
          "path": {
            "ts": null,
            "js": null
          },
          "url": {
            "ts": "/ui-catalog/files/ts/usage/progress.component.ts",
            "js": "/ui-catalog/files/js/usage/progress.component.js"
          }
        },
        {
          "label": "progress",
          "role": "template",
          "path": {
            "ts": "agent/ui/progress.ts",
            "js": "agent/ui/progress.js"
          },
          "url": {
            "ts": "/ui-catalog/files/ts/progress.ts",
            "js": "/ui-catalog/files/js/progress.js"
          }
        },
        {
          "label": "fs-kit",
          "role": "shared",
          "path": {
            "ts": "agent/ui/fs-kit.ts",
            "js": "agent/ui/fs-kit.js"
          },
          "url": {
            "ts": "/ui-catalog/files/ts/fs-kit.ts",
            "js": "/ui-catalog/files/js/fs-kit.js"
          }
        }
      ]
    },
    {
      "id": "onboarding-canvas",
      "title": "Onboarding guide",
      "group": "Canvas",
      "surface": "canvas",
      "kind": "interactive",
      "mobile": "fallback-card",
      "summary": "A setup guide that stays open beside the chat while the user works through 3–7 steps in your app. The agent explains the current step; only your app ticks a step off.",
      "whenToUse": "A new user needs to finish 3–7 setup steps in your app, in order. The guide stays open beside the chat while the user works and the agent explains the current step.",
      "whenNotToUse": "One step (tell the user in chat, or spotlight it). Steps the agent does itself (that's an action, not a guide). Mobile: the canvas isn't available; use the checklist card (mountMobile).",
      "states": [
        {
          "kind": "loading",
          "when": "The guide opens at once while your app reads which steps the user already did, and again after Try again."
        },
        {
          "kind": "empty",
          "when": "Your app has no setup steps for this user, for example a teammate who joined a workspace an admin already set up."
        },
        {
          "kind": "error",
          "when": "Your app couldn't read the user's progress. Try again loads the steps in place; steps already done stay done."
        }
      ],
      "facts": {
        "Kind": "Canvas · ONBOARDING",
        "Agent waits": "No",
        "Mobile": "No canvas: a checklist card"
      },
      "page": "/ui-catalog/onboarding-canvas/",
      "markdown": "/ui-catalog/onboarding-canvas.md",
      "reports": [
        {
          "call": "canvas.setState(patch)",
          "gets": "Canvas state",
          "when": "A step is done (your app, or “I've done this”). The agent sees it with the user's next message."
        },
        {
          "call": "displayed()",
          "gets": "FUNCTION_TOOL_DISPLAYED",
          "when": "Mobile checklist card: as soon as it shows."
        }
      ],
      "data": {
        "OnboardingState": [
          {
            "name": "title",
            "optional": false,
            "type": "string",
            "doc": ""
          },
          {
            "name": "intro",
            "optional": true,
            "type": "string",
            "doc": ""
          },
          {
            "name": "canvasTitle",
            "optional": true,
            "type": "string",
            "doc": "The canvas header (setTitle, up to 80 characters)."
          },
          {
            "name": "eyebrow",
            "optional": true,
            "type": "string",
            "doc": ""
          },
          {
            "name": "doneTitle",
            "optional": true,
            "type": "string",
            "doc": ""
          },
          {
            "name": "doneText",
            "optional": true,
            "type": "string",
            "doc": ""
          },
          {
            "name": "steps",
            "optional": false,
            "type": "OnboardingStep[]",
            "doc": ""
          },
          {
            "name": "current",
            "optional": false,
            "type": "string | null",
            "doc": "The step the user is on. The agent moves it only when the user asks."
          }
        ],
        "OnboardingStep": [
          {
            "name": "id",
            "optional": false,
            "type": "string",
            "doc": ""
          },
          {
            "name": "title",
            "optional": false,
            "type": "string",
            "doc": ""
          },
          {
            "name": "detail",
            "optional": false,
            "type": "string",
            "doc": ""
          },
          {
            "name": "done",
            "optional": false,
            "type": "boolean",
            "doc": "Only your app sets this, when the user really did the step. The agent never does."
          },
          {
            "name": "minutes",
            "optional": true,
            "type": "number",
            "doc": ""
          },
          {
            "name": "cta",
            "optional": true,
            "type": "{ label: string; href?: string }",
            "doc": "The step's button. Without actions.go, href is opened."
          },
          {
            "name": "auto",
            "optional": true,
            "type": "boolean",
            "doc": "Your app detects this step itself: hides \"I've done this\"."
          }
        ],
        "OnboardingActions": [
          {
            "name": "go()",
            "optional": true,
            "type": "(step: OnboardingStep) => void",
            "doc": "Take the user to the step in your app (navigate, spotlight)."
          },
          {
            "name": "finish()",
            "optional": true,
            "type": "() => void",
            "doc": "The last screen's button. Default: close the canvas."
          },
          {
            "name": "subscribe()",
            "optional": true,
            "type": "(onChange: (patch: Partial<OnboardingState>) => void) => () => void",
            "doc": "Your app reports progress here (a step the user really finished). The guide redraws and shares it with the agent through canvas.setState. Return the unsubscribe."
          }
        ]
      },
      "files": [
        {
          "label": "Hosted action",
          "role": "hosted-action",
          "path": {
            "ts": "agent/actions/open_setup_guide/index.ts",
            "js": "agent/actions/open_setup_guide/index.js"
          },
          "url": {
            "ts": "/ui-catalog/files/ts/usage/onboarding-canvas.hosted.ts",
            "js": "/ui-catalog/files/js/usage/onboarding-canvas.hosted.js"
          }
        },
        {
          "label": "In-page handler",
          "role": "in-page-handler",
          "path": {
            "ts": null,
            "js": null
          },
          "url": {
            "ts": "/ui-catalog/files/ts/usage/onboarding-canvas.canvas.ts",
            "js": "/ui-catalog/files/js/usage/onboarding-canvas.canvas.js"
          }
        },
        {
          "label": "onboarding-canvas",
          "role": "template",
          "path": {
            "ts": "agent/ui/onboarding-canvas.ts",
            "js": "agent/ui/onboarding-canvas.js"
          },
          "url": {
            "ts": "/ui-catalog/files/ts/onboarding-canvas.ts",
            "js": "/ui-catalog/files/js/onboarding-canvas.js"
          }
        },
        {
          "label": "fs-kit",
          "role": "shared",
          "path": {
            "ts": "agent/ui/fs-kit.ts",
            "js": "agent/ui/fs-kit.js"
          },
          "url": {
            "ts": "/ui-catalog/files/ts/fs-kit.ts",
            "js": "/ui-catalog/files/js/fs-kit.js"
          }
        }
      ]
    },
    {
      "id": "report-canvas",
      "title": "Report",
      "group": "Canvas",
      "surface": "canvas",
      "kind": "read-only",
      "mobile": "fallback-card",
      "summary": "A report the agent opens beside the chat: headline numbers, one chart, a breakdown and what stands out. The agent explains it and answers follow-ups from the same state; it can't change the numbers.",
      "whenToUse": "The user asks how something did over a period and the answer needs room: a few headline numbers, a trend, a breakdown and what stands out. The agent explains it beside the chat and answers follow-ups from the same state.",
      "whenNotToUse": "A few numbers that fit in the chat (KPI tiles card). Data the user edits (table or form canvas). Raw exports with hundreds of rows (link to your app). Mobile: the canvas isn't available; use the summary card (mountMobile).",
      "states": [
        {
          "kind": "loading",
          "when": "The canvas opens at once while renderCanvas fetches the numbers, and again after Try again. The agent reads the report once it's in the canvas state."
        },
        {
          "kind": "empty",
          "when": "The period has no data yet. The report says so and offers the latest period that has some."
        },
        {
          "kind": "error",
          "when": "The report's data didn't load. execute or renderCanvas got the failure; Try again loads it in place."
        }
      ],
      "facts": {
        "Kind": "Canvas · REPORT · READ_MODE",
        "Agent waits": "No",
        "Mobile": "No canvas: a summary card"
      },
      "page": "/ui-catalog/report-canvas/",
      "markdown": "/ui-catalog/report-canvas.md",
      "reports": [
        {
          "call": "canvas.state",
          "gets": "Canvas state",
          "when": "With every message. READ_MODE: the agent reads the numbers and findings and explains them; any change it tries is refused."
        },
        {
          "call": "canvas.setTitle(title)",
          "gets": "Canvas title",
          "when": "When the report draws. The header and the chat card show it."
        },
        {
          "call": "displayed()",
          "gets": "FUNCTION_TOOL_DISPLAYED",
          "when": "Mobile summary card: as soon as it shows."
        }
      ],
      "data": {
        "ReportState": [
          {
            "name": "canvasTitle",
            "optional": true,
            "type": "string",
            "doc": "The canvas header (setTitle, up to 80 characters). Default: the title."
          },
          {
            "name": "eyebrow",
            "optional": true,
            "type": "string",
            "doc": ""
          },
          {
            "name": "title",
            "optional": false,
            "type": "string",
            "doc": ""
          },
          {
            "name": "summary",
            "optional": true,
            "type": "string",
            "doc": "One or two sentences that answer the user's question."
          },
          {
            "name": "period",
            "optional": true,
            "type": "string",
            "doc": "The period the numbers cover, such as \"Oct 1 to Oct 31, 2026\"."
          },
          {
            "name": "updated",
            "optional": true,
            "type": "string",
            "doc": "When the data was read, such as \"8 min ago\"."
          },
          {
            "name": "kpis",
            "optional": false,
            "type": "ReportKpi[]",
            "doc": "2 to 4 headline numbers; more are cut."
          },
          {
            "name": "chart",
            "optional": true,
            "type": "ReportChart",
            "doc": ""
          },
          {
            "name": "table",
            "optional": true,
            "type": "ReportTable",
            "doc": ""
          },
          {
            "name": "insights",
            "optional": true,
            "type": "ReportInsight[]",
            "doc": "2 to 4 findings, written by the agent or your backend."
          }
        ],
        "ReportKpi": [
          {
            "name": "label",
            "optional": false,
            "type": "string",
            "doc": ""
          },
          {
            "name": "value",
            "optional": false,
            "type": "number | string",
            "doc": ""
          },
          {
            "name": "format",
            "optional": true,
            "type": "NumberFormat",
            "doc": ""
          },
          {
            "name": "delta",
            "optional": true,
            "type": "{ value: number; good?: boolean; vs?: string }",
            "doc": "Change in percent vs the previous period. good: false when up is bad (costs, churn)."
          },
          {
            "name": "trend",
            "optional": true,
            "type": "number[]",
            "doc": "Recent values, oldest first, for the sparkline."
          }
        ],
        "ReportChart": [
          {
            "name": "type",
            "optional": false,
            "type": "\"bar\" | \"line\"",
            "doc": "bar for amounts per period or category, line for a trend."
          },
          {
            "name": "title",
            "optional": false,
            "type": "string",
            "doc": ""
          },
          {
            "name": "labels",
            "optional": false,
            "type": "string[]",
            "doc": "The x-axis labels, oldest first."
          },
          {
            "name": "series",
            "optional": false,
            "type": "ReportSeries[]",
            "doc": "1 to 3 series; more are cut."
          },
          {
            "name": "format",
            "optional": true,
            "type": "NumberFormat",
            "doc": "How the axis and the tooltip format values."
          }
        ],
        "ReportSeries": [
          {
            "name": "name",
            "optional": false,
            "type": "string",
            "doc": ""
          },
          {
            "name": "values",
            "optional": false,
            "type": "number[]",
            "doc": "One value per chart label, in the same order."
          },
          {
            "name": "compare",
            "optional": true,
            "type": "boolean",
            "doc": "A comparison series (last period, target): drawn muted, dashed on a line chart."
          }
        ],
        "ReportTable": [
          {
            "name": "title",
            "optional": false,
            "type": "string",
            "doc": ""
          },
          {
            "name": "rowLabel",
            "optional": false,
            "type": "string",
            "doc": "The first column's header, such as \"Plan\" or \"Region\"."
          },
          {
            "name": "columns",
            "optional": false,
            "type": "ReportColumn[]",
            "doc": ""
          },
          {
            "name": "rows",
            "optional": false,
            "type": "ReportRow[]",
            "doc": "Sorted the way you want them shown (biggest first)."
          },
          {
            "name": "limit",
            "optional": true,
            "type": "number",
            "doc": "Rows shown (default 6). The rest show as \"N more\"."
          }
        ],
        "ReportColumn": [
          {
            "name": "label",
            "optional": false,
            "type": "string",
            "doc": ""
          },
          {
            "name": "format",
            "optional": true,
            "type": "NumberFormat",
            "doc": ""
          },
          {
            "name": "delta",
            "optional": true,
            "type": "boolean",
            "doc": "A change column in percent: an arrow, colored by sign."
          },
          {
            "name": "upIsGood",
            "optional": true,
            "type": "boolean",
            "doc": "For a change column: false when up is bad (costs, churn)."
          },
          {
            "name": "bar",
            "optional": true,
            "type": "boolean",
            "doc": "Draws a share bar next to the numbers, scaled to the column's largest value."
          }
        ],
        "ReportRow": [
          {
            "name": "label",
            "optional": false,
            "type": "string",
            "doc": ""
          },
          {
            "name": "values",
            "optional": false,
            "type": "(number | string)[]",
            "doc": "One value per column, in the same order."
          }
        ],
        "ReportInsight": [
          {
            "name": "tone",
            "optional": false,
            "type": "\"positive\" | \"negative\" | \"neutral\"",
            "doc": "positive (good news), negative (needs attention) or neutral (context)."
          },
          {
            "name": "title",
            "optional": false,
            "type": "string",
            "doc": "One short line the user can scan."
          },
          {
            "name": "detail",
            "optional": true,
            "type": "string",
            "doc": ""
          }
        ],
        "ReportActions": [
          {
            "name": "openInApp()",
            "optional": true,
            "type": "() => void",
            "doc": "Opens the full report in your app. Adds \"Open in app\" to the header and the table."
          }
        ]
      },
      "files": [
        {
          "label": "Hosted action",
          "role": "hosted-action",
          "path": {
            "ts": "agent/actions/open_revenue_report/index.ts",
            "js": "agent/actions/open_revenue_report/index.js"
          },
          "url": {
            "ts": "/ui-catalog/files/ts/usage/report-canvas.hosted.ts",
            "js": "/ui-catalog/files/js/usage/report-canvas.hosted.js"
          }
        },
        {
          "label": "In-page handler",
          "role": "in-page-handler",
          "path": {
            "ts": null,
            "js": null
          },
          "url": {
            "ts": "/ui-catalog/files/ts/usage/report-canvas.canvas.ts",
            "js": "/ui-catalog/files/js/usage/report-canvas.canvas.js"
          }
        },
        {
          "label": "report-canvas",
          "role": "template",
          "path": {
            "ts": "agent/ui/report-canvas.ts",
            "js": "agent/ui/report-canvas.js"
          },
          "url": {
            "ts": "/ui-catalog/files/ts/report-canvas.ts",
            "js": "/ui-catalog/files/js/report-canvas.js"
          }
        },
        {
          "label": "fs-kit",
          "role": "shared",
          "path": {
            "ts": "agent/ui/fs-kit.ts",
            "js": "agent/ui/fs-kit.js"
          },
          "url": {
            "ts": "/ui-catalog/files/ts/fs-kit.ts",
            "js": "/ui-catalog/files/js/fs-kit.js"
          }
        }
      ]
    },
    {
      "id": "content-canvas",
      "title": "Article editor",
      "group": "Canvas",
      "surface": "canvas",
      "kind": "interactive",
      "mobile": "fallback-card",
      "summary": "An article the user and the agent write together beside the chat: a help article, a blog post, release notes. Headings, lists, callouts and links, with a format toolbar and markdown shortcuts. The agent rewrites the parts the user asks for, in place, and marks what it changed.",
      "whenToUse": "The user and the agent write one article together over several turns: a help article, a blog post, release notes, an announcement. The user writes and formats in the canvas, and asks the agent to draft, shorten or rewrite parts of it.",
      "whenNotToUse": "A one-line reply or a short answer (the chat). Structured fields with rules (form canvas). Text the agent writes once and the user never edits (a chat card). Mobile: the canvas isn't available; use the preview card (mountMobile).",
      "states": [
        {
          "kind": "loading",
          "when": "The canvas opens with only a title while the agent writes the first draft into its state. The editor takes over when the draft arrives."
        },
        {
          "kind": "error",
          "when": "A saved article didn't load when the canvas reopened. Try again loads it in place; the article itself is still saved."
        }
      ],
      "facts": {
        "Kind": "Canvas · CONTENT_EDITOR · EDIT_MODE",
        "Agent waits": "No",
        "Mobile": "No canvas: a preview card"
      },
      "page": "/ui-catalog/content-canvas/",
      "markdown": "/ui-catalog/content-canvas.md",
      "reports": [
        {
          "call": "canvas.setState(patch)",
          "gets": "Canvas state",
          "when": "600 ms after the user stops writing, and on blur. Only the fields that changed (title, subtitle, blocks), and publishedAt and url after Publish."
        },
        {
          "call": "canvas.setTitle(title)",
          "gets": "Canvas title",
          "when": "When the title changes: “Help article: <title>”."
        },
        {
          "call": "displayed()",
          "gets": "FUNCTION_TOOL_DISPLAYED",
          "when": "Mobile preview card: as soon as it shows."
        }
      ],
      "data": {
        "ContentState": [
          {
            "name": "canvasTitle",
            "optional": true,
            "type": "string",
            "doc": "The canvas header (setTitle, up to 80 characters). Default: \"<kind>: <title>\"."
          },
          {
            "name": "kind",
            "optional": true,
            "type": "string",
            "doc": "What is being written, on the badge: \"Help article\", \"Blog post\"."
          },
          {
            "name": "collection",
            "optional": true,
            "type": "string",
            "doc": "Where it lives, as a breadcrumb: \"Help center / Reports\". Display only."
          },
          {
            "name": "title",
            "optional": false,
            "type": "string",
            "doc": "The headline."
          },
          {
            "name": "subtitle",
            "optional": true,
            "type": "string",
            "doc": "One or two sentences under the headline: the summary readers see in search and lists."
          },
          {
            "name": "author",
            "optional": true,
            "type": "string",
            "doc": "The byline. Display only."
          },
          {
            "name": "tags",
            "optional": true,
            "type": "string[]",
            "doc": "Shown under the byline. Display only: the user asks the agent to change them."
          },
          {
            "name": "blocks",
            "optional": false,
            "type": "ContentBlock[]",
            "doc": ""
          },
          {
            "name": "publishedAt",
            "optional": true,
            "type": "string",
            "doc": "When the user last published it (ISO time). The editor sets it, so the agent knows."
          },
          {
            "name": "url",
            "optional": true,
            "type": "string",
            "doc": "The published article's address, from your app's publish()."
          }
        ],
        "ContentBlock": [
          {
            "name": "id",
            "optional": false,
            "type": "string",
            "doc": "Stable id. The agent keeps it when it rewrites a block, so the editor can show what it changed."
          },
          {
            "name": "type",
            "optional": false,
            "type": "ContentBlockType",
            "doc": "p (paragraph), h2 (heading), h3 (subheading), ul or ol (lists), quote or callout."
          },
          {
            "name": "text",
            "optional": true,
            "type": "string",
            "doc": "The text of every type but lists. Inline markdown: **bold**, *italic*, `code`, [label](https://…)."
          },
          {
            "name": "items",
            "optional": true,
            "type": "string[]",
            "doc": "A list's items (ul, ol), each with the same inline markdown."
          }
        ],
        "ContentActions": [
          {
            "name": "onChange()",
            "optional": true,
            "type": "(state: ContentState) => void",
            "doc": "Called each time the draft is shared with the agent (debounced). Keep a copy in your app here if you need one."
          },
          {
            "name": "publish()",
            "optional": true,
            "type": "(state: ContentState) => Promise<{ url?: string } | void>",
            "doc": "Publishes (or updates) the article in your app. With it the toolbar shows Publish. Resolve with its address; throw to show the error."
          }
        ]
      },
      "files": [
        {
          "label": "Hosted action",
          "role": "hosted-action",
          "path": {
            "ts": "agent/actions/draft_help_article/index.ts",
            "js": "agent/actions/draft_help_article/index.js"
          },
          "url": {
            "ts": "/ui-catalog/files/ts/usage/content-canvas.hosted.ts",
            "js": "/ui-catalog/files/js/usage/content-canvas.hosted.js"
          }
        },
        {
          "label": "In-page handler",
          "role": "in-page-handler",
          "path": {
            "ts": null,
            "js": null
          },
          "url": {
            "ts": "/ui-catalog/files/ts/usage/content-canvas.canvas.ts",
            "js": "/ui-catalog/files/js/usage/content-canvas.canvas.js"
          }
        },
        {
          "label": "content-canvas",
          "role": "template",
          "path": {
            "ts": "agent/ui/content-canvas.ts",
            "js": "agent/ui/content-canvas.js"
          },
          "url": {
            "ts": "/ui-catalog/files/ts/content-canvas.ts",
            "js": "/ui-catalog/files/js/content-canvas.js"
          }
        },
        {
          "label": "fs-kit",
          "role": "shared",
          "path": {
            "ts": "agent/ui/fs-kit.ts",
            "js": "agent/ui/fs-kit.js"
          },
          "url": {
            "ts": "/ui-catalog/files/ts/fs-kit.ts",
            "js": "/ui-catalog/files/js/fs-kit.js"
          }
        }
      ]
    },
    {
      "id": "form-canvas",
      "title": "Form",
      "group": "Canvas",
      "surface": "canvas",
      "kind": "input",
      "mobile": "fallback-card",
      "summary": "A long form beside the chat. The agent fills in what it knows and answers questions about the rest; its fields stay marked until the user checks them. Only the user sends it.",
      "whenToUse": "A long form (3–4 sections, 10–16 fields) the user fills in over a few turns, with the agent filling what it can find and answering questions about the rest. The user sends it from the canvas.",
      "whenNotToUse": "Up to ~8 fields the agent can draft in one go (form with approval card). Steps that depend on earlier answers (wizard). Mobile: the canvas isn't available; use the progress card (mountMobile).",
      "states": [
        {
          "kind": "loading",
          "when": "The canvas opens while your app loads the form's sections and options, and again after Try again. It stays in READ_MODE until the fields show."
        },
        {
          "kind": "error",
          "when": "The form didn't load, or your app refused a submit outright (no permission). A submit worth retrying keeps its inline message instead."
        }
      ],
      "facts": {
        "Kind": "Canvas · FORM · EDIT_MODE",
        "Agent waits": "No",
        "Mobile": "No canvas: a progress card"
      },
      "page": "/ui-catalog/form-canvas/",
      "markdown": "/ui-catalog/form-canvas.md",
      "reports": [
        {
          "call": "canvas.setState({ values, suggested })",
          "gets": "Canvas state",
          "when": "600 ms after the user stops typing, and when a field loses focus. The agent sees it with the user's next message."
        },
        {
          "call": "canvas.setState({ submitted })",
          "gets": "Canvas state",
          "when": "After actions.submit() succeeds. The canvas switches to READ_MODE."
        },
        {
          "call": "displayed()",
          "gets": "FUNCTION_TOOL_DISPLAYED",
          "when": "Mobile progress card: as soon as it shows."
        }
      ],
      "data": {
        "FormCanvasState": [
          {
            "name": "title",
            "optional": false,
            "type": "string",
            "doc": ""
          },
          {
            "name": "intro",
            "optional": true,
            "type": "string",
            "doc": ""
          },
          {
            "name": "canvasTitle",
            "optional": true,
            "type": "string",
            "doc": "The canvas header (setTitle, up to 80 characters). Default: title."
          },
          {
            "name": "sections",
            "optional": false,
            "type": "FormCanvasSection[]",
            "doc": ""
          },
          {
            "name": "values",
            "optional": false,
            "type": "Record<string, string>",
            "doc": "Field id to value, as text. The user and the agent both write here. A key the agent leaves out keeps its value."
          },
          {
            "name": "suggested",
            "optional": true,
            "type": "string[]",
            "doc": "Fields the agent filled that the user hasn't changed yet. The form keeps this list."
          },
          {
            "name": "submitLabel",
            "optional": true,
            "type": "string",
            "doc": ""
          },
          {
            "name": "busyLabel",
            "optional": true,
            "type": "string",
            "doc": ""
          },
          {
            "name": "doneTitle",
            "optional": true,
            "type": "string",
            "doc": ""
          },
          {
            "name": "doneText",
            "optional": true,
            "type": "string",
            "doc": ""
          },
          {
            "name": "receiptFields",
            "optional": true,
            "type": "string[]",
            "doc": "Field ids listed on the success screen. Default: the first three required fields."
          },
          {
            "name": "submitted",
            "optional": true,
            "type": "FormCanvasReceipt",
            "doc": "Set by the form after a successful submit. A reopened canvas shows the success screen."
          }
        ],
        "FormCanvasSection": [
          {
            "name": "id",
            "optional": false,
            "type": "string",
            "doc": ""
          },
          {
            "name": "title",
            "optional": false,
            "type": "string",
            "doc": ""
          },
          {
            "name": "description",
            "optional": true,
            "type": "string",
            "doc": ""
          },
          {
            "name": "icon",
            "optional": true,
            "type": "IconName",
            "doc": "The section card's icon. Default: doc."
          },
          {
            "name": "fields",
            "optional": false,
            "type": "FormCanvasField[]",
            "doc": ""
          }
        ],
        "FormCanvasField": [
          {
            "name": "id",
            "optional": false,
            "type": "string",
            "doc": ""
          },
          {
            "name": "label",
            "optional": false,
            "type": "string",
            "doc": ""
          },
          {
            "name": "type",
            "optional": true,
            "type": "\"text\" | \"email\" | \"tel\" | \"url\" | \"number\" | \"date\" | \"select\" | \"textarea\"",
            "doc": ""
          },
          {
            "name": "required",
            "optional": true,
            "type": "boolean",
            "doc": ""
          },
          {
            "name": "wide",
            "optional": true,
            "type": "boolean",
            "doc": "Full row in the two-column layout (textareas always are)."
          },
          {
            "name": "options",
            "optional": true,
            "type": "(string | { value: string; label: string })[]",
            "doc": ""
          },
          {
            "name": "placeholder",
            "optional": true,
            "type": "string",
            "doc": ""
          },
          {
            "name": "hint",
            "optional": true,
            "type": "string",
            "doc": ""
          },
          {
            "name": "prefix",
            "optional": true,
            "type": "string",
            "doc": "Shown inside the input, e.g. \"$\"."
          },
          {
            "name": "rows",
            "optional": true,
            "type": "number",
            "doc": ""
          },
          {
            "name": "format",
            "optional": true,
            "type": "NumberFormat",
            "doc": "How a number shows on the success screen."
          }
        ],
        "FormCanvasActions": [
          {
            "name": "submit()",
            "optional": true,
            "type": "(values: FormCanvasValues) => Promise<{ id?: string; url?: string } | void>",
            "doc": "Sends the form through your app. Throw to show the error and keep the draft. Return { id, url } to link the record."
          },
          {
            "name": "finish()",
            "optional": true,
            "type": "() => void",
            "doc": "The success screen's button. Default: close the canvas."
          }
        ]
      },
      "files": [
        {
          "label": "Hosted action",
          "role": "hosted-action",
          "path": {
            "ts": "agent/actions/open_vendor_form/index.ts",
            "js": "agent/actions/open_vendor_form/index.js"
          },
          "url": {
            "ts": "/ui-catalog/files/ts/usage/form-canvas.hosted.ts",
            "js": "/ui-catalog/files/js/usage/form-canvas.hosted.js"
          }
        },
        {
          "label": "In-page handler",
          "role": "in-page-handler",
          "path": {
            "ts": null,
            "js": null
          },
          "url": {
            "ts": "/ui-catalog/files/ts/usage/form-canvas.canvas.ts",
            "js": "/ui-catalog/files/js/usage/form-canvas.canvas.js"
          }
        },
        {
          "label": "form-canvas",
          "role": "template",
          "path": {
            "ts": "agent/ui/form-canvas.ts",
            "js": "agent/ui/form-canvas.js"
          },
          "url": {
            "ts": "/ui-catalog/files/ts/form-canvas.ts",
            "js": "/ui-catalog/files/js/form-canvas.js"
          }
        },
        {
          "label": "fs-kit",
          "role": "shared",
          "path": {
            "ts": "agent/ui/fs-kit.ts",
            "js": "agent/ui/fs-kit.js"
          },
          "url": {
            "ts": "/ui-catalog/files/ts/fs-kit.ts",
            "js": "/ui-catalog/files/js/fs-kit.js"
          }
        }
      ]
    },
    {
      "id": "table-canvas",
      "title": "Table",
      "group": "Canvas",
      "surface": "canvas",
      "kind": "interactive",
      "mobile": "fallback-card",
      "summary": "Rows the user and the agent clean up together beside the chat, before your app saves them. Every cell is checked as it changes, the agent's edits are marked cell by cell, and only the user imports.",
      "whenToUse": "Rows the user reviews and fixes in bulk before your app saves them: imported contacts, invoice lines, a price list (10 to 40 rows, 3 to 7 columns). The agent fixes the cells the user asks about, and the user imports from the canvas.",
      "whenNotToUse": "A few rows to read (data table card). One record (form canvas). More rows than fit in about 3 KB of state: page them in your app. Mobile: the canvas isn't available; use the summary card (mountMobile).",
      "states": [
        {
          "kind": "loading",
          "when": "While execute reads the file and your app checks the rows. The skeleton has the grid's shape, so nothing jumps when the rows arrive."
        },
        {
          "kind": "empty",
          "when": "The file had no rows your app could read. The agent says why and what to try."
        },
        {
          "kind": "error",
          "when": "execute couldn't read the rows. Nothing was imported; Try again reads the file again in place."
        }
      ],
      "facts": {
        "Kind": "Canvas · TABLE · EDIT_MODE",
        "Agent waits": "No",
        "Mobile": "No canvas: a summary card"
      },
      "page": "/ui-catalog/table-canvas/",
      "markdown": "/ui-catalog/table-canvas.md",
      "reports": [
        {
          "call": "canvas.setState({ rows })",
          "gets": "Canvas state",
          "when": "600 ms after the user stops editing. Only the keys that changed: rows, selected, skipped."
        },
        {
          "call": "canvas.setState({ selected })",
          "gets": "Canvas state",
          "when": "When the user selects rows, so “fix these” in the chat means those rows."
        },
        {
          "call": "canvas.setState({ committed })",
          "gets": "Canvas state",
          "when": "After actions.commit() succeeds. The canvas switches to READ_MODE."
        },
        {
          "call": "displayed()",
          "gets": "FUNCTION_TOOL_DISPLAYED",
          "when": "Mobile summary card: as soon as it shows."
        }
      ],
      "data": {
        "TableCanvasState": [
          {
            "name": "canvasTitle",
            "optional": true,
            "type": "string",
            "doc": "The canvas header (setTitle, up to 80 characters). Default: title."
          },
          {
            "name": "title",
            "optional": false,
            "type": "string",
            "doc": "Above the table, e.g. \"Review imported contacts\"."
          },
          {
            "name": "intro",
            "optional": true,
            "type": "string",
            "doc": "One line under the title: where the rows came from."
          },
          {
            "name": "columns",
            "optional": false,
            "type": "TableCanvasColumn[]",
            "doc": ""
          },
          {
            "name": "rows",
            "optional": false,
            "type": "TableCanvasRow[]",
            "doc": "The rows. The agent changes only the cells it's asked to, and adds or removes rows only when asked."
          },
          {
            "name": "selected",
            "optional": true,
            "type": "string[]",
            "doc": "Row ids the user selected. The agent reads them as \"these rows\"."
          },
          {
            "name": "skipped",
            "optional": true,
            "type": "string[]",
            "doc": "Row ids the user excluded. They aren't saved and don't need a fix."
          },
          {
            "name": "noun",
            "optional": true,
            "type": "[string, string]",
            "doc": "What a row is, singular and plural. Default: [\"row\", \"rows\"]."
          },
          {
            "name": "commitLabel",
            "optional": true,
            "type": "string",
            "doc": "The commit button. {n} is the number of rows that go. Default: \"Import {n} rows\"."
          },
          {
            "name": "committed",
            "optional": true,
            "type": "TableCanvasReceipt",
            "doc": "Set by the canvas after actions.commit succeeds. A reopened canvas shows the receipt."
          }
        ],
        "TableCanvasColumn": [
          {
            "name": "id",
            "optional": false,
            "type": "string",
            "doc": "The key of this column in each row."
          },
          {
            "name": "label",
            "optional": false,
            "type": "string",
            "doc": "Header text."
          },
          {
            "name": "type",
            "optional": true,
            "type": "\"text\" | \"email\" | \"tel\" | \"url\" | \"number\" | \"select\"",
            "doc": "How a cell is edited and checked. Default: text."
          },
          {
            "name": "required",
            "optional": true,
            "type": "boolean",
            "doc": "An empty cell needs a fix."
          },
          {
            "name": "unique",
            "optional": true,
            "type": "boolean",
            "doc": "Two rows with the same value (case ignored) both need a fix, as for email."
          },
          {
            "name": "options",
            "optional": true,
            "type": "string[]",
            "doc": "The choices of a select column. Any other value needs a fix."
          },
          {
            "name": "width",
            "optional": true,
            "type": "number",
            "doc": "Width in px. Default: by type, 110 to 230."
          },
          {
            "name": "icon",
            "optional": true,
            "type": "IconName",
            "doc": "The header icon. Default: by type."
          }
        ],
        "TableCanvasRow": [
          {
            "name": "id",
            "optional": false,
            "type": "string",
            "doc": "Stable id. The agent keeps it, so the canvas can mark the cells it changed."
          }
        ],
        "TableCanvasActions": [
          {
            "name": "commit()",
            "optional": true,
            "type": "(rows: TableCanvasRow[]) => Promise<{ id?: string; url?: string } | void>",
            "doc": "Saves the rows through your app: every row except the excluded ones, all valid. Throw to keep the table and show why."
          },
          {
            "name": "onChange()",
            "optional": true,
            "type": "(state: TableCanvasState) => void",
            "doc": "Called each time the table is shared with the agent (debounced). Keep a draft in your app here."
          },
          {
            "name": "finish()",
            "optional": true,
            "type": "() => void",
            "doc": "The receipt's button. Default: close the canvas."
          }
        ]
      },
      "files": [
        {
          "label": "Hosted action",
          "role": "hosted-action",
          "path": {
            "ts": "agent/actions/review_import/index.ts",
            "js": "agent/actions/review_import/index.js"
          },
          "url": {
            "ts": "/ui-catalog/files/ts/usage/table-canvas.hosted.ts",
            "js": "/ui-catalog/files/js/usage/table-canvas.hosted.js"
          }
        },
        {
          "label": "In-page handler",
          "role": "in-page-handler",
          "path": {
            "ts": null,
            "js": null
          },
          "url": {
            "ts": "/ui-catalog/files/ts/usage/table-canvas.canvas.ts",
            "js": "/ui-catalog/files/js/usage/table-canvas.canvas.js"
          }
        },
        {
          "label": "table-canvas",
          "role": "template",
          "path": {
            "ts": "agent/ui/table-canvas.ts",
            "js": "agent/ui/table-canvas.js"
          },
          "url": {
            "ts": "/ui-catalog/files/ts/table-canvas.ts",
            "js": "/ui-catalog/files/js/table-canvas.js"
          }
        },
        {
          "label": "fs-kit",
          "role": "shared",
          "path": {
            "ts": "agent/ui/fs-kit.ts",
            "js": "agent/ui/fs-kit.js"
          },
          "url": {
            "ts": "/ui-catalog/files/ts/fs-kit.ts",
            "js": "/ui-catalog/files/js/fs-kit.js"
          }
        }
      ]
    },
    {
      "id": "code-canvas",
      "title": "Code editor",
      "group": "Canvas",
      "surface": "canvas",
      "kind": "interactive",
      "mobile": "fallback-card",
      "summary": "A code editor beside the chat for a query, a formula or a JSON payload the user and the agent write together. It highlights and checks the code as it changes, marks the lines the agent edits, and runs a preview through your app.",
      "whenToUse": "A query, a formula, a script or a config the user and the agent write together: a SQL report, a filter formula, a webhook payload. The agent writes it into the editor, keeps it valid, and the user runs a preview before your app saves it.",
      "whenNotToUse": "A snippet the agent shows once and the user copies (a chat message with a code block). Settings with fixed choices (form canvas). Mobile: the canvas isn't available; use the snippet card (mountMobile).",
      "states": [
        {
          "kind": "loading",
          "when": "While execute loads the saved query, or the agent's first draft, into the editor. The skeleton has the editor's shape."
        },
        {
          "kind": "empty",
          "when": "There's no code to show yet, for example a saved query that was deleted. The agent offers to write one."
        },
        {
          "kind": "error",
          "when": "execute couldn't load the query or the schema. Nothing changed; Try again loads it in place."
        }
      ],
      "facts": {
        "Kind": "Canvas · CODE · EDIT_MODE",
        "Agent waits": "No",
        "Mobile": "No canvas: a snippet card"
      },
      "page": "/ui-catalog/code-canvas/",
      "markdown": "/ui-catalog/code-canvas.md",
      "reports": [
        {
          "call": "canvas.setState({ code })",
          "gets": "Canvas state",
          "when": "600 ms after the user stops typing, and on blur. The agent edits the same field and sends it whole."
        },
        {
          "call": "canvas.setState({ lastRun })",
          "gets": "Canvas state",
          "when": "After each run: ok, the row count or the error, so the agent can fix what failed."
        },
        {
          "call": "displayed()",
          "gets": "FUNCTION_TOOL_DISPLAYED",
          "when": "Mobile snippet card: as soon as it shows."
        }
      ],
      "data": {
        "CodeCanvasState": [
          {
            "name": "canvasTitle",
            "optional": true,
            "type": "string",
            "doc": "The canvas header (setTitle, up to 80 characters). Default: title."
          },
          {
            "name": "title",
            "optional": false,
            "type": "string",
            "doc": "What the code does, e.g. \"Churned accounts last quarter\"."
          },
          {
            "name": "intro",
            "optional": true,
            "type": "string",
            "doc": "One line under the title."
          },
          {
            "name": "language",
            "optional": false,
            "type": "CodeLanguage",
            "doc": "Highlighting and the built-in check: sql, json, formula or text."
          },
          {
            "name": "code",
            "optional": false,
            "type": "string",
            "doc": "The code. The user and the agent both write here; the agent sends it whole and keeps it valid."
          },
          {
            "name": "runLabel",
            "optional": true,
            "type": "string",
            "doc": "The Run button. Default: \"Run\"."
          },
          {
            "name": "lastRun",
            "optional": true,
            "type": "CodeCanvasRun",
            "doc": "Set by the canvas after each run, so the agent sees whether it worked."
          }
        ],
        "CodeCanvasRun": [
          {
            "name": "ok",
            "optional": false,
            "type": "boolean",
            "doc": "Whether it ran."
          },
          {
            "name": "at",
            "optional": false,
            "type": "string",
            "doc": "When (ISO 8601)."
          },
          {
            "name": "rows",
            "optional": true,
            "type": "number",
            "doc": "Rows returned."
          },
          {
            "name": "error",
            "optional": true,
            "type": "string",
            "doc": "What failed, as your run() threw it."
          }
        ],
        "CodeCanvasResult": [
          {
            "name": "columns",
            "optional": true,
            "type": "string[]",
            "doc": "Column names."
          },
          {
            "name": "rows",
            "optional": true,
            "type": "(string | number | boolean | null)[][]",
            "doc": "Up to about 50 rows; one value per column."
          },
          {
            "name": "output",
            "optional": true,
            "type": "string",
            "doc": "Plain output instead of rows, e.g. a webhook's response."
          },
          {
            "name": "note",
            "optional": true,
            "type": "string",
            "doc": "A note beside the result, e.g. \"First 50 of 1,204 rows\"."
          }
        ],
        "CodeCanvasProblem": [
          {
            "name": "message",
            "optional": false,
            "type": "string",
            "doc": "What to fix, in plain words."
          },
          {
            "name": "line",
            "optional": true,
            "type": "number",
            "doc": "1-based line."
          }
        ],
        "CodeCanvasActions": [
          {
            "name": "run()",
            "optional": true,
            "type": "(code: string, language: CodeLanguage) => Promise<CodeCanvasResult>",
            "doc": "Runs a preview through your app. Throw to show the error; put \"line N\" in the message to point at a line."
          },
          {
            "name": "validate()",
            "optional": true,
            "type": "(code: string, language: CodeLanguage) => CodeCanvasProblem | null | Promise<CodeCanvasProblem | null>",
            "doc": "Your own check (a parser, a dry run). Return null when it's valid. Default: the built-in check for the language."
          },
          {
            "name": "save()",
            "optional": true,
            "type": "(code: string) => Promise<void>",
            "doc": "Saves the code in your app, e.g. as a saved report. Shows a Save button. Throw to show why it wasn't saved."
          },
          {
            "name": "onChange()",
            "optional": true,
            "type": "(state: CodeCanvasState) => void",
            "doc": "Called each time the code is shared with the agent (debounced)."
          }
        ]
      },
      "files": [
        {
          "label": "Hosted action",
          "role": "hosted-action",
          "path": {
            "ts": "agent/actions/write_report_query/index.ts",
            "js": "agent/actions/write_report_query/index.js"
          },
          "url": {
            "ts": "/ui-catalog/files/ts/usage/code-canvas.hosted.ts",
            "js": "/ui-catalog/files/js/usage/code-canvas.hosted.js"
          }
        },
        {
          "label": "In-page handler",
          "role": "in-page-handler",
          "path": {
            "ts": null,
            "js": null
          },
          "url": {
            "ts": "/ui-catalog/files/ts/usage/code-canvas.canvas.ts",
            "js": "/ui-catalog/files/js/usage/code-canvas.canvas.js"
          }
        },
        {
          "label": "code-canvas",
          "role": "template",
          "path": {
            "ts": "agent/ui/code-canvas.ts",
            "js": "agent/ui/code-canvas.js"
          },
          "url": {
            "ts": "/ui-catalog/files/ts/code-canvas.ts",
            "js": "/ui-catalog/files/js/code-canvas.js"
          }
        },
        {
          "label": "fs-kit",
          "role": "shared",
          "path": {
            "ts": "agent/ui/fs-kit.ts",
            "js": "agent/ui/fs-kit.js"
          },
          "url": {
            "ts": "/ui-catalog/files/ts/fs-kit.ts",
            "js": "/ui-catalog/files/js/fs-kit.js"
          }
        }
      ]
    },
    {
      "id": "custom-canvas",
      "title": "Custom canvas",
      "group": "Canvas",
      "surface": "canvas",
      "kind": "interactive",
      "mobile": "fallback-card",
      "summary": "A plain starting point for a canvas no typed one fits: a plan, a brief or a runbook built from headings, text, key values, checklists and callouts. The user and the agent edit the same blocks, the agent's changes are marked, and your footer buttons act on the result.",
      "whenToUse": "None of the typed canvases fits: a plan, a brief, a runbook or a review the user and the agent shape together from headings, text, key values, checklists and callouts. The SDK adds no rule for OTHER, so your action's own prompt must say what the agent may change and what it must leave alone.",
      "whenNotToUse": "The content is a form, a table, a document, code or a report: use that canvas, whose type tells the agent how to behave. A one-off answer (a chat card). Mobile: the canvas isn't available; use the card (mountMobile).",
      "states": [
        {
          "kind": "loading",
          "when": "While execute reads what the plan starts from. The skeleton has the canvas's shape: a title, key values, text and a checklist."
        },
        {
          "kind": "empty",
          "when": "There's nothing to build the canvas from, for example a workspace that's already in the target region. Say why, and what the user can do."
        },
        {
          "kind": "error",
          "when": "execute couldn't read what the canvas needs. Nothing changed; Try again loads it in place."
        }
      ],
      "facts": {
        "Kind": "Canvas · OTHER · EDIT_MODE",
        "Agent waits": "No",
        "Agent rules": "Your action's prompt",
        "Mobile": "No canvas: a summary card"
      },
      "page": "/ui-catalog/custom-canvas/",
      "markdown": "/ui-catalog/custom-canvas.md",
      "reports": [
        {
          "call": "canvas.setState({ blocks })",
          "gets": "Canvas state",
          "when": "600 ms after the user stops editing, and when a field loses focus. The agent edits the same blocks by id."
        },
        {
          "call": "actions.onAction(id, state)",
          "gets": "Your app",
          "when": "A footer button. The patch it returns (a new status, say) is drawn and shared."
        },
        {
          "call": "displayed()",
          "gets": "FUNCTION_TOOL_DISPLAYED",
          "when": "Mobile card: as soon as it shows."
        }
      ],
      "data": {
        "CustomCanvasState": [
          {
            "name": "canvasTitle",
            "optional": true,
            "type": "string",
            "doc": "The canvas header (setTitle, up to 80 characters). Default: title."
          },
          {
            "name": "eyebrow",
            "optional": true,
            "type": "string",
            "doc": "A small label above the title, e.g. \"Migration plan\"."
          },
          {
            "name": "title",
            "optional": false,
            "type": "string",
            "doc": ""
          },
          {
            "name": "subtitle",
            "optional": true,
            "type": "string",
            "doc": "One or two lines under the title."
          },
          {
            "name": "status",
            "optional": true,
            "type": "CustomCanvasStatus",
            "doc": "A status pill beside the eyebrow."
          },
          {
            "name": "blocks",
            "optional": false,
            "type": "CustomCanvasBlock[]",
            "doc": "The body, top to bottom. Each block keeps its id when the agent edits it, so the canvas can mark the change."
          },
          {
            "name": "buttons",
            "optional": true,
            "type": "CustomCanvasButton[]",
            "doc": "Footer buttons. Their clicks go to actions.onAction(id); the last primary one is the main action."
          },
          {
            "name": "footnote",
            "optional": true,
            "type": "string",
            "doc": "A line in the footer, e.g. who decides what."
          }
        ],
        "CustomCanvasBlock": [
          {
            "name": "id",
            "optional": false,
            "type": "string",
            "doc": "Stable id."
          },
          {
            "name": "type",
            "optional": false,
            "type": "\"heading\" | \"text\" | \"keyValue\" | \"checklist\" | \"callout\"",
            "doc": "heading, text (paragraphs), keyValue (label and value rows), checklist (items the user ticks), callout (a note with a tone)."
          },
          {
            "name": "text",
            "optional": true,
            "type": "string",
            "doc": "heading, text and callout: the text. A blank line starts a paragraph."
          },
          {
            "name": "items",
            "optional": true,
            "type": "CustomCanvasItem[]",
            "doc": "keyValue and checklist: the rows."
          },
          {
            "name": "tone",
            "optional": true,
            "type": "\"info\" | \"success\" | \"warning\" | \"error\"",
            "doc": "callout: info (default), success, warning or error."
          },
          {
            "name": "editable",
            "optional": true,
            "type": "boolean",
            "doc": "text and keyValue: the user can edit it in place. Checklists are always tickable."
          }
        ],
        "CustomCanvasItem": [
          {
            "name": "id",
            "optional": false,
            "type": "string",
            "doc": "Stable id."
          },
          {
            "name": "label",
            "optional": false,
            "type": "string",
            "doc": ""
          },
          {
            "name": "value",
            "optional": true,
            "type": "string",
            "doc": "keyValue: the value."
          },
          {
            "name": "done",
            "optional": true,
            "type": "boolean",
            "doc": "checklist: ticked."
          },
          {
            "name": "hint",
            "optional": true,
            "type": "string",
            "doc": "A muted line under the label or value."
          }
        ],
        "CustomCanvasButton": [
          {
            "name": "id",
            "optional": false,
            "type": "string",
            "doc": "What actions.onAction receives."
          },
          {
            "name": "label",
            "optional": false,
            "type": "string",
            "doc": ""
          },
          {
            "name": "primary",
            "optional": true,
            "type": "boolean",
            "doc": "The filled button. Default: outlined."
          }
        ],
        "CustomCanvasActions": [
          {
            "name": "onAction()",
            "optional": true,
            "type": "(id: string, state: CustomCanvasState) => Promise<Partial<CustomCanvasState> | void> | Partial<CustomCanvasState> | void",
            "doc": "A footer button was clicked. Return a state patch to apply and share (e.g. a new status). Throw to show why it failed."
          },
          {
            "name": "onChange()",
            "optional": true,
            "type": "(state: CustomCanvasState) => void",
            "doc": "Called each time the state is shared with the agent (debounced)."
          }
        ]
      },
      "files": [
        {
          "label": "Hosted action",
          "role": "hosted-action",
          "path": {
            "ts": "agent/actions/plan_region_move/index.ts",
            "js": "agent/actions/plan_region_move/index.js"
          },
          "url": {
            "ts": "/ui-catalog/files/ts/usage/custom-canvas.hosted.ts",
            "js": "/ui-catalog/files/js/usage/custom-canvas.hosted.js"
          }
        },
        {
          "label": "In-page handler",
          "role": "in-page-handler",
          "path": {
            "ts": null,
            "js": null
          },
          "url": {
            "ts": "/ui-catalog/files/ts/usage/custom-canvas.canvas.ts",
            "js": "/ui-catalog/files/js/usage/custom-canvas.canvas.js"
          }
        },
        {
          "label": "custom-canvas",
          "role": "template",
          "path": {
            "ts": "agent/ui/custom-canvas.ts",
            "js": "agent/ui/custom-canvas.js"
          },
          "url": {
            "ts": "/ui-catalog/files/ts/custom-canvas.ts",
            "js": "/ui-catalog/files/js/custom-canvas.js"
          }
        },
        {
          "label": "fs-kit",
          "role": "shared",
          "path": {
            "ts": "agent/ui/fs-kit.ts",
            "js": "agent/ui/fs-kit.js"
          },
          "url": {
            "ts": "/ui-catalog/files/ts/fs-kit.ts",
            "js": "/ui-catalog/files/js/fs-kit.js"
          }
        }
      ]
    }
  ]
}
