@heroui/agent 0.2.0-beta.11 → 0.2.0-beta.13

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1181,7 +1181,9 @@ declare const clientToolsSchema: z.ZodArray<z.ZodObject<{
1181
1181
  type ClientToolManifestEntry = z.infer<typeof clientToolManifestEntrySchema>;
1182
1182
 
1183
1183
  declare const HEROUI_AGENT_PROTOCOL_VERSION: 6;
1184
- declare const HEROUI_AGENT_SDK_VERSION: "0.2.0-beta.11";
1184
+ declare const HEROUI_AGENT_SDK_VERSION: "0.2.0-beta.13";
1185
+ /** Production Agent API origin used when hosts omit `_api.baseUrl` / `apiBaseUrl`. */
1186
+ declare const HEROUI_AGENT_API_BASE_URL: "https://api.heroui.pro";
1185
1187
 
1186
1188
  /** Browser event emitted when protocol-v6 runtime latency checkpoints arrive. */
1187
1189
  declare const HEROUI_AGENT_RUNTIME_TIMING_EVENT: "heroui-agent:runtime-timing";
@@ -1285,7 +1287,7 @@ type AgentMessage = UIMessage<unknown, AgentDataTypes>;
1285
1287
  * `./models.schema`, which only server and contract consumers need.
1286
1288
  */
1287
1289
  /** Model ids the hosted agent accepts from the browser picker. */
1288
- declare const AGENT_MODEL_IDS: readonly ["moonshotai/Kimi-K3", "openai/gpt-5.6-luna", "openai/gpt-5.6-terra", "openai/gpt-5.6-sol", "google/gemini-3.6-flash", "anthropic/claude-sonnet-5", "anthropic/claude-opus-4.8"];
1290
+ declare const AGENT_MODEL_IDS: readonly ["moonshotai/Kimi-K3", "openai/gpt-5.6-luna", "openai/gpt-5.6-terra", "openai/gpt-5.6-sol", "google/gemini-3.7-flash", "anthropic/claude-sonnet-5", "anthropic/claude-opus-4.8"];
1289
1291
  type AgentModelId = (typeof AGENT_MODEL_IDS)[number];
1290
1292
  /**
1291
1293
  * Retired ids mapped to their replacement. Model ids are a public part of the
@@ -1305,11 +1307,11 @@ type AgentModelOption = {
1305
1307
  tier: AgentModelTier;
1306
1308
  };
1307
1309
  /**
1308
- * Recommended default selected when the optional picker first opens. Luna
1310
+ * Recommended default selected when the optional picker first opens. Gemini 3.7 Flash
1309
1311
  * matches the hosted runtime's baked-in default (`DEFAULT_CHAT_MODEL_IDS.herouiAgent`),
1310
1312
  * so what users see in the picker is what actually runs by default.
1311
1313
  */
1312
- declare const DEFAULT_AGENT_PICKER_MODEL_ID = "openai/gpt-5.6-luna";
1314
+ declare const DEFAULT_AGENT_PICKER_MODEL_ID = "google/gemini-3.7-flash";
1313
1315
  /**
1314
1316
  * Small, tool-capable model catalog for HeroUI Agent. These ids are the
1315
1317
  * server-side allowlist as well as the browser picker source of truth.
@@ -1340,8 +1342,8 @@ declare const AGENT_MODEL_OPTIONS: readonly [{
1340
1342
  readonly tier: "complex";
1341
1343
  }, {
1342
1344
  readonly description: "Fast multimodal analysis with a large context window";
1343
- readonly id: "google/gemini-3.6-flash";
1344
- readonly label: "Gemini 3.6 Flash";
1345
+ readonly id: "google/gemini-3.7-flash";
1346
+ readonly label: "Gemini 3.7 Flash";
1345
1347
  readonly provider: "Google";
1346
1348
  readonly tier: "light";
1347
1349
  }, {
@@ -1376,7 +1378,7 @@ declare const agentModelIdSchema: z.ZodPipe<z.ZodTransform<unknown, unknown>, z.
1376
1378
  "openai/gpt-5.6-luna": "openai/gpt-5.6-luna";
1377
1379
  "openai/gpt-5.6-terra": "openai/gpt-5.6-terra";
1378
1380
  "openai/gpt-5.6-sol": "openai/gpt-5.6-sol";
1379
- "google/gemini-3.6-flash": "google/gemini-3.6-flash";
1381
+ "google/gemini-3.7-flash": "google/gemini-3.7-flash";
1380
1382
  "anthropic/claude-sonnet-5": "anthropic/claude-sonnet-5";
1381
1383
  "anthropic/claude-opus-4.8": "anthropic/claude-opus-4.8";
1382
1384
  }>>;
@@ -1644,4 +1646,4 @@ type HeroUIAgentEmbedEventName = HeroUIAgentEmbedEvent["event"];
1644
1646
  type HeroUIAgentEmbedEventProperties = z.infer<typeof heroUIAgentEmbedEventPropertiesSchema>;
1645
1647
  type HeroUIAgentTurnErrorCode = z.infer<typeof heroUIAgentTurnErrorCodeSchema>;
1646
1648
 
1647
- export { AGENT_MODEL_IDS, AGENT_MODEL_OPTIONS, AGENT_UI_CATALOG, AGENT_UI_CONTAINER_KINDS, AGENT_UI_KIND_NAMES, AGENT_UI_KIND_SCHEMAS, AGENT_UI_LAYOUT_LEAF_KINDS, AGENT_UI_PRIMITIVE_KINDS, type AccordionComponent, type ActionGroupComponent, type ActionToolCall, type ActionVariant, type AgentActivityPhase, type AgentDataTypes, type AgentIconName, type AgentMessage, type AgentModelId, type AgentModelOption, type AgentModelTier, type AgentRemoteConfig, type AgentRemoteThemeColor, type AgentRuntimeTiming, type AgentRuntimeTimingEventDetail, type AgentSource, type AgentTurnAdmissionStatus, type AgentTurnAdmissionStatusRequest, type AgentTurnAdmissionStatusResponse, type AgentTurnAdmittedFrame, type AgentUIAmount, type AgentUICatalogEntry, type AgentUICatalogGroup, type AgentUIComponent, type AgentUIContainerComponent, type AgentUIImage, type AgentUILayoutLeafComponent, type AgentUILeafComponent, type AgentUINode, type AgentUIPrimitiveComponent, type AgentUIRenderable, type AgentUIRenderableKind, type AnalyticalLeafComponent, type AreaChartComponent, type BadgeComponent, type BarChartComponent, type ButtonComponent, COMPOSED_UI_MAX_DEPTH, COMPOSED_UI_MAX_NODES, type CalloutComponent, type CandlestickChartComponent, type CardComponent, type CardComponentVariant, type CartesianComponent, type CartesianRange, type CartesianSeries, type ChannelMessageComponent, type ChartColor, type ClientToolManifestEntry, type CodeBlockComponent, type ColComponent, type ComparisonListComponent, type ComponentActionSpec, type ComponentBase, type ComposedChartComponent, type ComposedChartSeries, type CreateEventComponent, DEFAULT_AGENT_PICKER_MODEL_ID, type DashboardComponent, type DataTableComponent, type Datum, type DiagramComponent, type DividerComponent, type DonutChartComponent, type EnableNotificationComponent, type EventSessionComponent, type FlightTrackerComponent, type FollowupComponent, type FormComponent, type FormDateRange, type FormField, type FunnelChartComponent, type GaugeChartComponent, type GridComponent, HEROUI_AGENT_ATTACHMENT_ACCEPT, HEROUI_AGENT_ATTACHMENT_CONTENT_TYPES, HEROUI_AGENT_ATTACHMENT_EXTENSION_BY_CONTENT_TYPE, HEROUI_AGENT_ATTACHMENT_MAX_BYTES, HEROUI_AGENT_EMBED_EVENT_NAMES, HEROUI_AGENT_EMBED_EVENT_SOURCES, HEROUI_AGENT_FEEDBACK_REASONS, HEROUI_AGENT_MAX_ATTACHMENTS, HEROUI_AGENT_PROTOCOL_VERSION, HEROUI_AGENT_REMOTE_CONFIG_VERSION, HEROUI_AGENT_RUNTIME_TIMING_EVENT, HEROUI_AGENT_SDK_VERSION, HEROUI_AGENT_TEXT_ATTACHMENT_CONTENT_TYPES, HEROUI_AGENT_TURN_ADMISSION_STATUS_MAX_IDS, HEROUI_AGENT_TURN_ADMISSION_STATUS_METHOD, HEROUI_AGENT_TURN_ADMITTED_FRAME_TYPE, HEROUI_AGENT_TURN_ERROR_CODES, type HeadingComponent, type HeatmapComponent, type HeroUIAgentAttachmentContentType, type HeroUIAgentEmbedEvent, type HeroUIAgentEmbedEventName, type HeroUIAgentEmbedEventProperties, type HeroUIAgentTurnErrorCode, type IconComponent, type ImageComponent, type ItemCardComponent, type ItemCardGroupComponent, type ItemCardVariant, type KpiGridComponent, LEGACY_AGENT_MODEL_IDS, type LayoutAlign, type LayoutGap, type LayoutJustify, type LineChartComponent, type ListBlockComponent, type ListComponent, MAX_CLIENT_TOOLS, MAX_CLIENT_TOOLS_BYTES, type MapComponent, type MapCoordinate, type MapLocation, type MapLocationAction, type MeterListComponent, type MeterTone, type MetricGridComponent, type NumberFormat, type PieChartComponent, type PlayerCardComponent, type PlaylistComponent, type ProductCardComponent, type ProductCardItem, type ProductCardPrice, type ProductCardRating, type ProductSignalsComponent, type ProgressComponent, type PurchaseCompleteComponent, type PurchaseItemsComponent, RESERVED_AGENT_TOOL_NAMES, RESERVED_AGENT_TOOL_PREFIX, type RadarChartComponent, type RadialChartComponent, type RatingComponent, type RecordCardComponent, type RecordCardLayout, type RecordCardTone, type RideStatusComponent, type RowComponent, type SankeyChartComponent, type ScatterChartComponent, type SpacerComponent, type StepStatus, type StepsComponent, type SunburstChartComponent, type SunburstNode, type SwitchGroupComponent, type TabsComponent, type TagListComponent, type TextComponent, type ToggleGroupComponent, type ViewEventComponent, type WeatherCondition, type WeatherCurrentComponent, type WeatherForecastComponent, type WeatherUnit, accordionComponentSchema, actionGroupComponentSchema, agentIconNames, agentIconSchema, agentModelIdSchema, agentSourceSchema, agentSourcesSchema, agentUIComponentSchema, agentUILeafComponentSchema, agentUINodeSchema, agentUIRenderableSchema, analyticalLeafComponentSchema, areaChartComponentSchema, badgeComponentSchema, barChartComponentSchema, buttonComponentSchema, calloutComponentSchema, candlestickChartComponentSchema, cardComponentSchema, cardComponentVariantSchema, channelMessageComponentSchema, chartColorSchema, clientToolManifestEntrySchema, clientToolsSchema, codeBlockComponentSchema, colComponentSchema, comparisonListComponentSchema, composeUIInputSchema, composedChartComponentSchema, composedUIComponentSchema, createEventComponentSchema, dashboardComponentSchema, dataTableComponentSchema, diagramComponentSchema, dividerComponentSchema, donutChartComponentSchema, enableNotificationComponentSchema, eventSessionComponentSchema, flightTrackerComponentSchema, followupComponentSchema, formComponentSchema, funnelChartComponentSchema, gaugeChartComponentSchema, getAgentModelTier, getAgentUIContainerChildren, gridComponentSchema, headingComponentSchema, heatmapComponentSchema, heroUIAgentEmbedEventPropertiesSchema, heroUIAgentEmbedEventSchema, heroUIAgentTurnErrorCodeSchema, iconComponentSchema, imageComponentSchema, isAgentModelId, isAgentUIContainerComponent, isAgentUILayoutLeafComponent, isAgentUIPrimitiveComponent, isHeroUIAgentAttachmentContentType, itemCardComponentSchema, itemCardGroupComponentSchema, kpiGridComponentSchema, lineChartComponentSchema, listBlockComponentSchema, listComponentSchema, mapComponentSchema, meterListComponentSchema, metricGridComponentSchema, numberFormatSchema, parseAgentRemoteConfig, pieChartComponentSchema, playerCardComponentSchema, playlistComponentSchema, productCardComponentSchema, productSignalsComponentSchema, progressComponentSchema, purchaseCompleteComponentSchema, purchaseItemsComponentSchema, radarChartComponentSchema, radialChartComponentSchema, ratingComponentSchema, recordCardComponentSchema, recordCardLayoutSchema, renderAgentUICatalogPrompt, renderComponentInputSchema, resolveAgentModelId, rideStatusComponentSchema, rowComponentSchema, sankeyChartComponentSchema, scatterChartComponentSchema, spacerComponentSchema, stepsComponentSchema, sunburstChartComponentSchema, switchGroupComponentSchema, tabsComponentSchema, tagListComponentSchema, textComponentSchema, toggleGroupComponentSchema, viewEventComponentSchema, weatherConditionSchema, weatherConditions, weatherCurrentComponentSchema, weatherForecastComponentSchema };
1649
+ export { AGENT_MODEL_IDS, AGENT_MODEL_OPTIONS, AGENT_UI_CATALOG, AGENT_UI_CONTAINER_KINDS, AGENT_UI_KIND_NAMES, AGENT_UI_KIND_SCHEMAS, AGENT_UI_LAYOUT_LEAF_KINDS, AGENT_UI_PRIMITIVE_KINDS, type AccordionComponent, type ActionGroupComponent, type ActionToolCall, type ActionVariant, type AgentActivityPhase, type AgentDataTypes, type AgentIconName, type AgentMessage, type AgentModelId, type AgentModelOption, type AgentModelTier, type AgentRemoteConfig, type AgentRemoteThemeColor, type AgentRuntimeTiming, type AgentRuntimeTimingEventDetail, type AgentSource, type AgentTurnAdmissionStatus, type AgentTurnAdmissionStatusRequest, type AgentTurnAdmissionStatusResponse, type AgentTurnAdmittedFrame, type AgentUIAmount, type AgentUICatalogEntry, type AgentUICatalogGroup, type AgentUIComponent, type AgentUIContainerComponent, type AgentUIImage, type AgentUILayoutLeafComponent, type AgentUILeafComponent, type AgentUINode, type AgentUIPrimitiveComponent, type AgentUIRenderable, type AgentUIRenderableKind, type AnalyticalLeafComponent, type AreaChartComponent, type BadgeComponent, type BarChartComponent, type ButtonComponent, COMPOSED_UI_MAX_DEPTH, COMPOSED_UI_MAX_NODES, type CalloutComponent, type CandlestickChartComponent, type CardComponent, type CardComponentVariant, type CartesianComponent, type CartesianRange, type CartesianSeries, type ChannelMessageComponent, type ChartColor, type ClientToolManifestEntry, type CodeBlockComponent, type ColComponent, type ComparisonListComponent, type ComponentActionSpec, type ComponentBase, type ComposedChartComponent, type ComposedChartSeries, type CreateEventComponent, DEFAULT_AGENT_PICKER_MODEL_ID, type DashboardComponent, type DataTableComponent, type Datum, type DiagramComponent, type DividerComponent, type DonutChartComponent, type EnableNotificationComponent, type EventSessionComponent, type FlightTrackerComponent, type FollowupComponent, type FormComponent, type FormDateRange, type FormField, type FunnelChartComponent, type GaugeChartComponent, type GridComponent, HEROUI_AGENT_API_BASE_URL, HEROUI_AGENT_ATTACHMENT_ACCEPT, HEROUI_AGENT_ATTACHMENT_CONTENT_TYPES, HEROUI_AGENT_ATTACHMENT_EXTENSION_BY_CONTENT_TYPE, HEROUI_AGENT_ATTACHMENT_MAX_BYTES, HEROUI_AGENT_EMBED_EVENT_NAMES, HEROUI_AGENT_EMBED_EVENT_SOURCES, HEROUI_AGENT_FEEDBACK_REASONS, HEROUI_AGENT_MAX_ATTACHMENTS, HEROUI_AGENT_PROTOCOL_VERSION, HEROUI_AGENT_REMOTE_CONFIG_VERSION, HEROUI_AGENT_RUNTIME_TIMING_EVENT, HEROUI_AGENT_SDK_VERSION, HEROUI_AGENT_TEXT_ATTACHMENT_CONTENT_TYPES, HEROUI_AGENT_TURN_ADMISSION_STATUS_MAX_IDS, HEROUI_AGENT_TURN_ADMISSION_STATUS_METHOD, HEROUI_AGENT_TURN_ADMITTED_FRAME_TYPE, HEROUI_AGENT_TURN_ERROR_CODES, type HeadingComponent, type HeatmapComponent, type HeroUIAgentAttachmentContentType, type HeroUIAgentEmbedEvent, type HeroUIAgentEmbedEventName, type HeroUIAgentEmbedEventProperties, type HeroUIAgentTurnErrorCode, type IconComponent, type ImageComponent, type ItemCardComponent, type ItemCardGroupComponent, type ItemCardVariant, type KpiGridComponent, LEGACY_AGENT_MODEL_IDS, type LayoutAlign, type LayoutGap, type LayoutJustify, type LineChartComponent, type ListBlockComponent, type ListComponent, MAX_CLIENT_TOOLS, MAX_CLIENT_TOOLS_BYTES, type MapComponent, type MapCoordinate, type MapLocation, type MapLocationAction, type MeterListComponent, type MeterTone, type MetricGridComponent, type NumberFormat, type PieChartComponent, type PlayerCardComponent, type PlaylistComponent, type ProductCardComponent, type ProductCardItem, type ProductCardPrice, type ProductCardRating, type ProductSignalsComponent, type ProgressComponent, type PurchaseCompleteComponent, type PurchaseItemsComponent, RESERVED_AGENT_TOOL_NAMES, RESERVED_AGENT_TOOL_PREFIX, type RadarChartComponent, type RadialChartComponent, type RatingComponent, type RecordCardComponent, type RecordCardLayout, type RecordCardTone, type RideStatusComponent, type RowComponent, type SankeyChartComponent, type ScatterChartComponent, type SpacerComponent, type StepStatus, type StepsComponent, type SunburstChartComponent, type SunburstNode, type SwitchGroupComponent, type TabsComponent, type TagListComponent, type TextComponent, type ToggleGroupComponent, type ViewEventComponent, type WeatherCondition, type WeatherCurrentComponent, type WeatherForecastComponent, type WeatherUnit, accordionComponentSchema, actionGroupComponentSchema, agentIconNames, agentIconSchema, agentModelIdSchema, agentSourceSchema, agentSourcesSchema, agentUIComponentSchema, agentUILeafComponentSchema, agentUINodeSchema, agentUIRenderableSchema, analyticalLeafComponentSchema, areaChartComponentSchema, badgeComponentSchema, barChartComponentSchema, buttonComponentSchema, calloutComponentSchema, candlestickChartComponentSchema, cardComponentSchema, cardComponentVariantSchema, channelMessageComponentSchema, chartColorSchema, clientToolManifestEntrySchema, clientToolsSchema, codeBlockComponentSchema, colComponentSchema, comparisonListComponentSchema, composeUIInputSchema, composedChartComponentSchema, composedUIComponentSchema, createEventComponentSchema, dashboardComponentSchema, dataTableComponentSchema, diagramComponentSchema, dividerComponentSchema, donutChartComponentSchema, enableNotificationComponentSchema, eventSessionComponentSchema, flightTrackerComponentSchema, followupComponentSchema, formComponentSchema, funnelChartComponentSchema, gaugeChartComponentSchema, getAgentModelTier, getAgentUIContainerChildren, gridComponentSchema, headingComponentSchema, heatmapComponentSchema, heroUIAgentEmbedEventPropertiesSchema, heroUIAgentEmbedEventSchema, heroUIAgentTurnErrorCodeSchema, iconComponentSchema, imageComponentSchema, isAgentModelId, isAgentUIContainerComponent, isAgentUILayoutLeafComponent, isAgentUIPrimitiveComponent, isHeroUIAgentAttachmentContentType, itemCardComponentSchema, itemCardGroupComponentSchema, kpiGridComponentSchema, lineChartComponentSchema, listBlockComponentSchema, listComponentSchema, mapComponentSchema, meterListComponentSchema, metricGridComponentSchema, numberFormatSchema, parseAgentRemoteConfig, pieChartComponentSchema, playerCardComponentSchema, playlistComponentSchema, productCardComponentSchema, productSignalsComponentSchema, progressComponentSchema, purchaseCompleteComponentSchema, purchaseItemsComponentSchema, radarChartComponentSchema, radialChartComponentSchema, ratingComponentSchema, recordCardComponentSchema, recordCardLayoutSchema, renderAgentUICatalogPrompt, renderComponentInputSchema, resolveAgentModelId, rideStatusComponentSchema, rowComponentSchema, sankeyChartComponentSchema, scatterChartComponentSchema, spacerComponentSchema, stepsComponentSchema, sunburstChartComponentSchema, switchGroupComponentSchema, tabsComponentSchema, tagListComponentSchema, textComponentSchema, toggleGroupComponentSchema, viewEventComponentSchema, weatherConditionSchema, weatherConditions, weatherCurrentComponentSchema, weatherForecastComponentSchema };
package/dist/contracts.js CHANGED
@@ -1,2 +1,2 @@
1
- var vo=5,wo=10485760,ht={"application/json":"json","application/pdf":"pdf","image/gif":"gif","image/jpeg":"jpg","image/png":"png","image/webp":"webp","text/csv":"csv","text/markdown":"md","text/plain":"txt","text/tab-separated-values":"tsv"},he=Object.freeze(Object.keys(ht)),_o=he.join(","),ft=new Set(he),Eo=new Set(["application/json","text/csv","text/markdown","text/plain","text/tab-separated-values"]);function fe(t){return ft.has(t.trim().toLowerCase())}var ye=1,u=Symbol("invalid");function D(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)}function v(t){if(t!==void 0)return typeof t=="string"?t:u}function _(t){if(t!==void 0)return typeof t=="boolean"?t:u}function Y(t){if(t!==void 0)return typeof t=="number"&&Number.isFinite(t)?t:u}function z(t){return n=>{if(n!==void 0)return typeof n=="string"&&t.includes(n)?n:u}}function Ce(t){if(t===void 0)return;if(typeof t=="string")return t;if(!D(t))return u;let n=v(t.dark),a=v(t.light);return n===u||a===u?u:{...n===void 0?{}:{dark:n},...a===void 0?{}:{light:a}}}function yt(t){if(t===void 0)return;if(!D(t))return u;let n={};for(let[a,i]of Object.entries(t)){if(typeof i!="string")return u;n[a]=i}return n}function Ct(t){if(t!==void 0)return!Array.isArray(t)||t.some(n=>typeof n!="string")?u:t}function x(t,n){if(t===void 0||!D(t))return u;let a={};for(let[i,l]of Object.entries(n)){let d=l(t[i]);if(d===u)return u;d!==void 0&&(a[i]=d)}return a}function U(t){return t===u?void 0:t}var bt=["accent","background","foreground","overlay","surface","surfaceSecondary","tooltip"];function xt(t){return x(t,{launcher:n=>n===void 0?void 0:x(n,{background:Ce,icon:v,position:z(["bottom-left","bottom-right"]),style:yt}),panel:n=>n===void 0?void 0:x(n,{expandable:_,expanded:_,initialHeight:a=>a===void 0||typeof a=="string"?a:Y(a),initialWidth:a=>a===void 0||typeof a=="string"?a:Y(a)}),theme:n=>n===void 0?void 0:x(n,{colorScheme:z(["dark","light","system"]),colors:a=>a===void 0?void 0:x(a,Object.fromEntries(bt.map(i=>[i,Ce]))),designTheme:z(["base","brutalism","glass","mouve"]),radius:z(["pill","round","sharp","soft"]),typography:a=>a===void 0?void 0:x(a,{baseSize:Y,fontFamily:v})}),viewMode:z(["floating","sidebar"])})}function At(t){return x(t,{attachments:n=>{if(n===void 0||n===!1)return n;if(!Array.isArray(n))return u;let a=n.filter(i=>typeof i=="string"&&fe(i));return a.length===n.length?a:u},defaultModel:v,dictation:_,disclaimer:n=>n===!1?!1:v(n),modelPicker:_,placeholder:v})}function kt(t){return x(t,{animated:n=>{if(n===void 0||n===!1)return n;if(!D(n))return u;let a=z(["blurIn","fadeIn","slideUp"])(n.animation);return a===u||a===void 0?u:{...n,animation:a}},caret:n=>n===!1?!1:z(["block","circle"])(n)})}function It(t){if(t===void 0||t===!1)return t;if(!Array.isArray(t))return u;let n=["copy","feedback","retry"],a=t.filter(i=>typeof i=="string"&&n.includes(i));return a.length===t.length?a:u}function Uo(t){if(!D(t)||t.version!==ye)return null;let n=t.revision;if(typeof n!="string"||!n)return null;let a=U(xt(t.appearance)),i=U(x(t.capabilities,{imageSearch:_,newsSearch:_,webSearch:_})),l=U(At(t.composer)),d=U(kt(t.markdown)),f=U(x(t.permissions,{defaultMode:z(["ask","auto","full"]),showPicker:_})),h=U(It(t.responseActions)),R=U(x(t.startScreen,{greeting:v,promptShortcuts:_,prompts:Ct})),b=U(x(t.webfont,{familyName:S=>typeof S=="string"&&S?S:u,fontFaceUrl:v,stylesheetUrl:v}));return{...a?{appearance:a}:{},...i?{capabilities:i}:{},...l?{composer:l}:{},...d?{markdown:d}:{},...f?{permissions:f}:{},...h===void 0?{}:{responseActions:h},...R?{startScreen:R}:{},...b?{webfont:b}:{},revision:n,version:ye}}var be={accordion:"display-information","action-group":"actions","area-chart":"data-visualization","bar-chart":"data-visualization",callout:"display-information","candlestick-chart":"data-visualization","channel-message":"display-information","code-block":"display-information","comparison-list":"data-visualization","composed-chart":"data-visualization","create-event":"display-information","data-table":"data-visualization",diagram:"display-information","donut-chart":"data-visualization","enable-notification":"display-information","event-session":"display-information","flight-tracker":"display-information",followup:"actions",form:"form-elements","funnel-chart":"data-visualization","gauge-chart":"data-visualization",heatmap:"data-visualization",image:"display-information","kpi-grid":"data-visualization","line-chart":"data-visualization",list:"display-information","list-block":"display-information",map:"display-information","meter-list":"data-visualization","metric-grid":"data-visualization","pie-chart":"data-visualization","player-card":"display-information",playlist:"display-information","product-card":"display-information","product-signals":"data-visualization","purchase-complete":"display-information","purchase-items":"display-information","radar-chart":"data-visualization","radial-chart":"data-visualization","record-card":"display-information","ride-status":"display-information","sankey-chart":"data-visualization","scatter-chart":"data-visualization",steps:"display-information","sunburst-chart":"data-visualization","switch-group":"form-elements",tabs:"display-information","tag-list":"display-information",text:"display-information","toggle-group":"form-elements","view-event":"display-information","weather-current":"display-information","weather-forecast":"display-information"};import{z as e}from"zod";function xe(t){return{maximum:t.max??(t.format?.style==="percent"?1:100),minimum:t.min??0}}var Tt=["activity","alert","briefcase","calendar","chart","check","clock","code","credit-card","database","device-desktop","device-mobile","document","dollar","flag","globe","heart","home","info","lightning","location","mail","percent","person","question","receipt","rocket","route","search","shopping-bag","speedometer","star","tag","target","users"],St=["clear","partly-cloudy","cloudy","fog","drizzle","rain","snow","thunderstorm","windy","unknown"],vt=e.string().trim().min(1).max(120),r=e.string().trim().min(1).max(320),M=e.string().trim().min(1).max(1e4),c=e.string().trim().min(1).max(80),m=e.string().trim().min(1).max(100),G=e.string().regex(/^\d{4}-\d{2}-\d{2}$/),W=e.string().regex(/^(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d)?$/),wt=e.union([e.string().max(500),e.number(),e.boolean(),e.null()]),O=e.record(e.string().max(80),wt),s=e.object({description:r.optional(),id:m,title:vt}),ee=e.enum(["outline","plain","surface","surface-secondary","surface-tertiary","widget"]).describe("Card hierarchy: surface for the primary standalone group; surface-secondary for supporting information; surface-tertiary for one featured or emphasized group; outline for equal peers and comparisons; plain for a structural section already separated by surrounding layout; widget for a compact interactive group with actions or controls."),_t=e.enum(["compact","details","media"]).describe("Record information layout: details for a full labeled fact set; compact for a brief summary or repeated peer cards; media for an image-led product, place, person, or event and only when an image is available."),C=e.discriminatedUnion("style",[e.object({compact:e.boolean().optional(),style:e.literal("number")}),e.object({maximumFractionDigits:e.number().int().min(0).max(4).optional(),style:e.literal("percent")}),e.object({compact:e.boolean().optional(),currency:e.string().regex(/^[A-Z]{3}$/),style:e.literal("currency")})]),w=e.enum(["accent","chart-1","chart-2","chart-3","chart-4","chart-5","danger","default","success","warning"]),Ie=e.record(e.string().trim().min(1).max(80),w).refine(t=>Object.keys(t).length<=50,"At most 50 category colors are allowed"),ne=e.object({color:w.optional(),dataKey:c,format:C.optional(),label:r}),Et=ne.extend({axis:e.enum(["left","right"]).optional(),stacked:e.boolean().optional(),type:e.enum(["area","bar","line"])}),Nt=e.object({id:m,label:r,maxItems:e.number().int().min(1).max(200).optional()}),H=s.extend({data:e.array(O).min(1).max(200),defaultRangeId:m.optional(),ranges:e.array(Nt).min(2).max(8).optional(),series:e.array(ne).min(1).max(5),showSummary:e.boolean().optional(),xKey:c}),q=s.extend({colors:Ie.optional(),data:e.array(O).min(1).max(50),format:C.optional(),labelKey:c,valueKey:c}),Rt=s.extend({colors:Ie.optional(),data:e.array(O).min(1).max(200),format:C.optional(),groupKey:c.optional(),kind:e.literal("scatter-chart"),labelKey:c.optional(),sizeKey:c.optional(),xKey:c,yKey:c}),Ut=s.extend({color:w.optional(),data:e.array(O).min(1).max(400),format:C.optional(),kind:e.literal("heatmap"),valueKey:c,xKey:c,yKey:c}),zt=H.extend({baseline:e.number().finite().optional(),kind:e.literal("line-chart"),mode:e.enum(["live","profit-loss","standard"]).optional(),negativeColor:w.optional(),positiveColor:w.optional(),windowSize:e.number().int().min(2).max(200).optional()}).superRefine((t,n)=>{(t.mode==="live"||t.mode==="profit-loss")&&t.series.length!==1&&n.addIssue({code:"custom",message:`${t.mode} line charts require exactly one series`,path:["series"]})}),Ot=s.extend({closeKey:c,data:e.array(O).min(1).max(200),downColor:w.optional(),format:C.optional(),highKey:c,kind:e.literal("candlestick-chart"),lowKey:c,openKey:c,upColor:w.optional(),xKey:c}).superRefine((t,n)=>{for(let[a,i]of t.data.entries()){let l=i[t.openKey],d=i[t.highKey],f=i[t.lowKey],h=i[t.closeKey];if([l,d,f,h].some(ge=>typeof ge!="number"||!Number.isFinite(ge))){n.addIssue({code:"custom",message:"Every candlestick row needs finite open, high, low, and close values",path:["data",a]});continue}let b=l,S=d,K=f,ue=h;(K>Math.min(b,ue)||S<Math.max(b,ue)||K>S)&&n.addIssue({code:"custom",message:"Candlestick low/high values must contain the open and close values",path:["data",a]})}}),Lt=q.extend({data:e.array(O).min(2).max(20),kind:e.literal("funnel-chart"),orientation:e.enum(["horizontal","vertical"]).optional(),showPercentages:e.boolean().optional()}).superRefine((t,n)=>{let a=t.data.map((i,l)=>{let d=i[t.valueKey];return typeof d!="number"||!Number.isFinite(d)||d<0?(n.addIssue({code:"custom",message:"Every funnel stage needs a finite, non-negative value",path:["data",l,t.valueKey]}),0):d});a.some(i=>i>0)||n.addIssue({code:"custom",message:"A funnel needs at least one stage above zero",path:["data"]}),(a[0]??0)<=0&&n.addIssue({code:"custom",message:"A funnel's first stage must be above zero",path:["data",0,t.valueKey]});for(let i=1;i<a.length;i+=1)(a[i]??0)>(a[i-1]??0)&&n.addIssue({code:"custom",message:"Funnel stages must not increase",path:["data",i,t.valueKey]})}),Mt=s.extend({color:w.optional(),format:C.optional(),kind:e.literal("gauge-chart"),label:r,max:e.number().finite().optional(),min:e.number().finite().optional(),notches:e.number().int().min(6).max(60).optional(),orientation:e.enum(["arc","linear"]).optional(),value:e.number().finite()}).superRefine((t,n)=>{let{maximum:a,minimum:i}=xe(t);a<=i?n.addIssue({code:"custom",message:"Gauge max must be greater than min",path:["max"]}):(t.value<i||t.value>a)&&n.addIssue({code:"custom",message:"Gauge value must be within its min/max range",path:["value"]})}),Te=e.lazy(()=>e.object({children:e.array(Te).min(1).max(12).optional(),color:w.optional(),id:m,label:r,value:e.number().finite().positive().optional()}).superRefine((t,n)=>{t.children?.length&&t.value!==void 0&&n.addIssue({code:"custom",message:"Sunburst branch values are derived from their children",path:["value"]}),!t.children?.length&&t.value===void 0&&n.addIssue({code:"custom",message:"Every sunburst leaf needs a positive value",path:["value"]})})),Gt=s.extend({data:Te,format:C.optional(),kind:e.literal("sunburst-chart")}).superRefine((t,n)=>{let a=new Set,i=0,l=0,d=(f,h)=>{i+=1,l=Math.max(l,h),a.has(f.id)&&n.addIssue({code:"custom",message:`Duplicate sunburst node id "${f.id}"`}),a.add(f.id),f.children?.forEach(R=>d(R,h+1))};t.data.children?.length||n.addIssue({code:"custom",message:"A sunburst root needs at least one child",path:["data","children"]}),d(t.data,0),i>60&&n.addIssue({code:"custom",message:"Sunburst charts allow at most 60 nodes"}),l>4&&n.addIssue({code:"custom",message:"Sunburst charts allow at most four nested levels"})}),Z=e.object({label:r,value:c}),jt=e.object({end:G,start:G}).refine(t=>t.start<=t.end,"The start date must not be after the end date"),A={description:r.optional(),label:r,name:c,required:e.boolean().optional()},Bt=e.discriminatedUnion("kind",[e.object({...A,defaultValue:e.string().max(500).optional(),inputType:e.enum(["email","number","password","search","tel","text","url"]).optional(),kind:e.literal("input"),placeholder:e.string().max(160).optional()}),e.object({...A,defaultValue:e.string().max(2e3).optional(),kind:e.literal("textarea"),placeholder:e.string().max(160).optional(),rows:e.number().int().min(2).max(12).optional()}),e.object({...A,defaultValue:c.optional(),kind:e.literal("select"),options:e.array(Z).min(1).max(30),placeholder:e.string().max(160).optional()}),e.object({...A,defaultValue:c.optional(),kind:e.literal("radio-group"),options:e.array(Z).min(1).max(12),placeholder:e.string().max(160).optional()}),e.object({...A,defaultValue:e.array(c).max(20).optional(),kind:e.literal("checkbox-group"),options:e.array(Z).min(1).max(20)}),e.object({...A,defaultValue:e.array(c).max(50).optional(),kind:e.literal("combobox"),options:e.array(Z.extend({description:e.string().trim().min(1).max(120).optional()})).min(1).max(200).describe("Prefer this over select once there are more options than someone would scan \u2014 it filters as they type. Values must be unique."),placeholder:e.string().max(160).optional(),selectionMode:e.enum(["multiple","single"]).optional()}).superRefine((t,n)=>{let a=new Set(t.options.map(i=>i.value));a.size!==t.options.length&&n.addIssue({code:"custom",message:"Combobox option values must be unique",path:["options"]}),(t.selectionMode??"single")==="single"&&(t.defaultValue?.length??0)>1&&n.addIssue({code:"custom",message:"A single-selection combobox takes at most one default value",path:["defaultValue"]}),t.defaultValue?.some(i=>!a.has(i))&&n.addIssue({code:"custom",message:"Every combobox default value must be one of the options",path:["defaultValue"]})}),e.object({...A,defaultValue:e.number().optional(),kind:e.literal("slider"),max:e.number(),min:e.number(),step:e.number().positive().optional()}),e.object({...A,defaultValue:e.number().optional(),format:C.optional(),kind:e.literal("number"),max:e.number().optional(),min:e.number().optional(),placeholder:e.string().max(160).optional(),step:e.number().positive().optional()}),e.object({...A,defaultValue:e.boolean().optional(),kind:e.literal("switch")}),e.object({...A,defaultValue:G.optional(),kind:e.literal("date-picker"),max:G.optional(),min:G.optional()}),e.object({...A,defaultValue:jt.optional(),kind:e.literal("date-range-picker"),max:G.optional(),min:G.optional()}),e.object({...A,defaultValue:W.optional(),hourCycle:e.union([e.literal(12),e.literal(24)]).optional(),kind:e.literal("time-field"),max:W.optional(),min:W.optional()})]),oe=e.enum(["danger","outline","primary","secondary","tertiary"]),N=e.enum(Tt),Se=e.object({arguments:e.record(e.string().max(80),e.unknown()).refine(t=>JSON.stringify(t).length<=4096,"Tool call arguments must serialize to at most 4KB of JSON"),name:e.string().regex(/^[a-zA-Z][a-zA-Z0-9_-]{0,63}$/)}),y=e.object({id:m,label:r,prompt:e.string().trim().min(1).max(2e3).optional(),toolCall:Se.optional(),variant:oe.optional()}),ve=e.object({latitude:e.number().finite().min(-85.051129).max(85.051129),longitude:e.number().finite().min(-180).max(180)}),te=e.string().trim().min(1).max(2e3).refine(t=>{try{let n=new URL(t);return["http:","https:"].includes(n.protocol)&&!n.username&&!n.password}catch{return!1}},{message:"URL must use HTTP or HTTPS and cannot include credentials"}),Dt=e.string().trim().min(1).max(2e3).refine(t=>{try{let n=new URL(t);return["http:","https:","mailto:","tel:"].includes(n.protocol)&&!n.username&&!n.password}catch{return!1}},{message:"Link must use HTTP, HTTPS, mailto, or tel and cannot include credentials"}),F={id:m,label:r,variant:oe.optional()},Pt=e.string().trim().min(5).max(2e3).refine(t=>/^tel:\+?[0-9().\-\s]+$/.test(t)&&/\d/.test(t.slice(4)),"Phone links must use the tel: scheme and contain a phone number"),Vt=e.discriminatedUnion("kind",[e.object({...F,href:Pt,kind:e.literal("call")}),e.object({...F,href:te,kind:e.literal("directions")}),e.object({...F,href:Dt,kind:e.literal("other")}),e.object({...F,href:te,kind:e.literal("website")})]),Kt=ve.extend({actions:e.array(Vt).max(4).optional(),address:r.optional(),category:e.string().trim().min(1).max(100).optional(),id:m,images:e.array(e.object({alt:r,src:te})).max(4).optional().describe("Prefer one representative image per location when a trusted tool or web image search returns one. The first image becomes the result-card thumbnail; initials are the fallback."),notes:e.string().trim().min(1).max(2e3).optional(),rating:e.number().finite().min(0).max(5).optional(),relevance:e.number().finite().min(0).max(1).optional(),reviewCount:e.number().int().nonnegative().max(1e9).optional(),title:r}),P=e.string().trim().min(1).max(2e3).refine(t=>{if(t.startsWith("/"))return!t.startsWith("//");try{let n=new URL(t);return["http:","https:"].includes(n.protocol)&&!n.username&&!n.password}catch{return!1}},{message:"Image sources must be HTTP(S) URLs or root-relative paths"}),I=e.object({alt:r,src:P.refine(t=>!t.split(/[?#]/,1)[0]?.toLowerCase().endsWith(".svg"),"Response-composition images must be raster images")}),ae=e.string().regex(/^[A-Z]{3}$/),Zt=e.object({amount:e.number().finite().nonnegative().max(1e9),currency:ae}),X=e.enum(St),Ae=e.enum(["celsius","fahrenheit"]),ke=e.object({label:r,status:r.optional(),time:e.string().trim().min(1).max(80)}),j=e.enum(["accent","danger","default","muted","success","warning"]),Ft=e.object({actions:e.array(y).max(3).optional(),badge:e.object({label:r,tone:j.optional()}).optional(),description:r.optional(),id:m,image:e.object({alt:r,src:P}),meta:e.string().trim().min(1).max(160).optional(),name:r,price:e.object({amount:e.number().finite().nonnegative().max(1e9),currency:ae.optional()}),rating:e.object({count:e.number().int().nonnegative().max(1e9).optional(),value:e.number().finite().min(0).max(5)}).optional()}),Ht=e.enum(["accent","danger","default","success","warning"]),qt=e.object({description:r.optional(),format:C.optional(),id:m,label:r,max:e.number().optional(),min:e.number().optional(),tone:Ht.optional(),value:e.number()}).superRefine((t,n)=>{let a=t.min??0,i=t.max??(t.format?.style==="percent"?1:100);i<=a&&n.addIssue({code:"custom",message:"Meter max must be greater than min"}),(t.value<a||t.value>i)&&n.addIssue({code:"custom",message:"Meter value must be within its min/max range"})}),o={accordion:s.extend({kind:e.literal("accordion"),sections:e.array(e.object({content:M,defaultOpen:e.boolean().optional(),id:m,title:r})).min(1).max(12)}),actions:s.extend({actions:e.array(y).min(1).max(8),kind:e.literal("action-group"),orientation:e.enum(["horizontal","vertical"]).optional()}),area:H.extend({kind:e.literal("area-chart"),stacked:e.boolean().optional()}),bar:H.extend({kind:e.literal("bar-chart"),layout:e.enum(["horizontal","vertical"]).optional(),stacked:e.boolean().optional()}),callout:s.extend({content:M,icon:N.optional(),kind:e.literal("callout"),tone:e.enum(["accent","danger","neutral","success","warning"]).optional()}),candlestick:Ot,channelMessage:s.extend({attachments:e.array(e.object({id:m,image:I.optional(),name:r})).max(8).optional(),author:e.object({image:I.optional(),name:r}),channel:r,content:M,kind:e.literal("channel-message"),timestamp:e.string().trim().min(1).max(80)}),code:s.extend({code:e.string().min(1).max(2e4),kind:e.literal("code-block"),language:e.string().trim().max(40).optional()}),comparison:s.extend({items:e.array(e.object({change:e.number().optional(),format:C.optional(),label:r,note:e.string().trim().max(180).optional(),value:e.number()})).min(1).max(12),kind:e.literal("comparison-list")}),composed:H.extend({kind:e.literal("composed-chart"),series:e.array(Et).min(2).max(5)}),createEvent:s.extend({actions:e.array(y).max(2).optional(),date:e.object({day:e.number().int().min(1).max(31),weekday:e.string().trim().min(1).max(20)}),events:e.array(e.object({id:m,status:e.enum(["existing","proposed"]).optional(),time:e.string().trim().min(1).max(80),title:r,tone:j.optional()})).min(1).max(12),kind:e.literal("create-event")}),diagram:s.extend({chart:e.string().trim().min(1).max(4e3).describe('Mermaid source. Pick the diagram type from the relationship: "flowchart LR" for a process or decision path, "sequenceDiagram" for an exchange between parties over time, "erDiagram" for how records relate, "stateDiagram-v2" for the states something moves between. Example: "flowchart LR\\n A[Order placed] --> B{In stock?}\\n B -- yes --> C[Ship]\\n B -- no --> D[Backorder]". Never include HTML, script tags, or click directives.'),kind:e.literal("diagram")}).superRefine((t,n)=>{/<\s*script|javascript:|^\s*click\s+\S/im.test(t.chart)&&n.addIssue({code:"custom",message:"Diagram source cannot contain HTML, script URLs, or click directives",path:["chart"]})}),donut:q.extend({kind:e.literal("donut-chart")}),enableNotification:s.extend({actions:e.tuple([y,y]),kind:e.literal("enable-notification")}),eventSession:s.extend({action:y.optional(),eyebrow:e.string().trim().min(1).max(100).optional(),kind:e.literal("event-session"),location:r,speakers:e.array(e.object({image:I.optional(),name:r,role:r})).max(8),time:e.string().trim().min(1).max(80)}),flightTracker:s.extend({airline:e.object({logo:I.optional(),name:r}),date:e.string().trim().min(1).max(80),destination:ke,flightNumber:e.string().trim().min(1).max(40),kind:e.literal("flight-tracker"),origin:ke,progress:e.number().finite().min(0).max(100).optional()}),followup:s.extend({kind:e.literal("followup"),prompts:e.array(e.object({id:m,label:r,prompt:M})).min(1).max(8)}),form:s.extend({actions:e.array(y).min(1).max(4),fields:e.array(Bt).min(1).max(20),kind:e.literal("form")}),funnel:Lt,gauge:Mt,heatmap:Ut,image:s.extend({images:e.array(e.object({alt:r,aspectRatio:e.enum(["landscape","portrait","square","wide"]).optional(),caption:r.optional(),src:P})).min(1).max(6),kind:e.literal("image"),variant:e.enum(["grid","horizontal"]).optional().describe("Use horizontal for a swipeable gallery in narrow chat interfaces.")}),kpiGrid:s.extend({kind:e.literal("kpi-grid"),metrics:e.array(e.object({change:e.number().optional(),color:w.optional(),format:C.optional(),icon:N.optional(),label:r,trend:e.array(e.number().finite()).min(2).max(60).describe("The values behind this KPI, oldest to newest, drawn as a sparkline. The last point should agree with value."),value:e.number()})).min(1).max(4)}),line:zt,list:s.extend({items:e.array(e.object({checked:e.boolean().optional(),children:e.array(r).max(8).optional(),id:m,text:r})).min(1).max(30),kind:e.literal("list"),style:e.enum(["bulleted","checklist","numbered"]).optional()}),listBlock:s.extend({items:e.array(e.object({description:r.optional(),icon:N.optional(),id:m,imageAlt:r.optional(),imageUrl:P.optional(),meta:e.string().trim().max(100).optional(),rating:e.number().min(0).max(5).optional(),title:r})).min(1).max(20),kind:e.literal("list-block")}),map:s.extend({initialLocationId:m.optional(),kind:e.literal("map"),locations:e.array(Kt).min(1).max(12),viewport:e.object({center:ve,zoom:e.number().int().min(1).max(18)}).optional()}).superRefine((t,n)=>{let a=new Set;for(let[i,l]of t.locations.entries()){a.has(l.id)&&n.addIssue({code:"custom",message:`Duplicate map location id "${l.id}"`,path:["locations",i,"id"]}),a.add(l.id);let d=new Set;for(let[f,h]of(l.actions??[]).entries())d.has(h.id)&&n.addIssue({code:"custom",message:`Duplicate action id "${h.id}" for map location "${l.id}"`,path:["locations",i,"actions",f,"id"]}),d.add(h.id)}t.initialLocationId&&!a.has(t.initialLocationId)&&n.addIssue({code:"custom",message:"The initial map location must reference one of the locations",path:["initialLocationId"]})}).describe("A ranked, map-synchronized set of places or professionals. Coordinates and listing facts must come from tools or user data; never invent them."),meterList:s.extend({items:e.array(qt).min(1).max(8),kind:e.literal("meter-list")}),metricGrid:s.extend({kind:e.literal("metric-grid"),metrics:e.array(e.object({change:e.number().optional(),format:C.optional(),icon:N.optional(),label:r,value:e.number()})).min(1).max(4)}),pie:q.extend({kind:e.literal("pie-chart")}),playerCard:s.extend({backgroundImage:I.optional(),jerseyNumber:e.string().trim().min(1).max(20).optional(),kind:e.literal("player-card"),playerName:r,stats:e.array(e.object({label:e.string().trim().min(1).max(40),value:e.union([e.string().trim().min(1).max(80),e.number().finite()])})).min(1).max(8)}),playlist:s.extend({actions:e.array(y).max(2).optional(),cover:I.optional(),kind:e.literal("playlist"),tracks:e.array(e.object({action:y.optional(),artist:r,id:m,image:I.optional(),title:r})).min(1).max(20)}),productCard:s.extend({actions:e.array(y).max(3).optional(),kind:e.literal("product-card"),products:e.array(Ft).min(1).max(8),variant:ee.optional()}).superRefine((t,n)=>{let a=new Set;for(let[i,l]of t.products.entries())a.has(l.id)&&n.addIssue({code:"custom",message:`Duplicate product id "${l.id}"`,path:["products",i,"id"]}),a.add(l.id)}).describe("A commerce product presentation: one product renders an image-led spotlight, several render a store-style grid. Product facts (id, name, image, price, rating, availability) must come from tools or user data; never invent them."),purchaseComplete:s.extend({action:y.optional(),details:e.array(e.object({label:r,value:r})).max(8),kind:e.literal("purchase-complete"),paid:Zt.optional(),product:e.object({description:r.optional(),image:I.optional(),name:r})}),purchaseItems:s.extend({actions:e.array(y).max(3).optional(),currency:ae,items:e.array(e.object({description:r.optional(),id:m,image:I.optional(),name:r,price:e.number().finite().nonnegative().max(1e9).optional(),quantity:e.number().int().positive().max(1e4).optional()})).min(1).max(20),kind:e.literal("purchase-items"),totals:e.array(e.object({amount:e.number().finite().nonnegative().max(1e9),emphasis:e.boolean().optional(),label:r})).min(1).max(8)}),radar:s.extend({angleKey:c,data:e.array(O).min(3).max(50),kind:e.literal("radar-chart"),series:e.array(ne).min(1).max(5)}),radial:q.extend({endAngle:e.number().min(-360).max(360).optional(),kind:e.literal("radial-chart"),maxValue:e.number().positive().optional(),startAngle:e.number().min(-360).max(360).optional()}),recordCard:s.extend({actions:e.array(y).max(4).optional(),eyebrow:e.string().trim().max(100).optional(),fields:e.array(e.object({icon:N.optional(),label:r,tone:j.optional(),value:e.string().trim().min(1).max(500)})).max(12),image:e.object({alt:r,src:P}).optional(),kind:e.literal("record-card"),layout:_t.optional(),status:e.object({label:r,tone:j.optional()}).optional(),variant:ee.optional()}).superRefine((t,n)=>{t.layout==="media"&&!t.image&&n.addIssue({code:"custom",message:"The media record layout requires an image",path:["image"]}),t.layout==="compact"&&t.fields.length>4&&n.addIssue({code:"custom",message:"The compact record layout supports at most four fields",path:["fields"]})}),rideStatus:s.extend({driver:e.object({image:I.optional(),name:r}),eta:e.string().trim().min(1).max(80),kind:e.literal("ride-status"),pickup:r}),sankey:s.extend({format:C.optional(),kind:e.literal("sankey-chart"),links:e.array(e.object({source:m,target:m,value:e.number().positive()})).min(1).max(100),nodes:e.array(e.object({id:m,label:r})).min(2).max(40)}),scatter:Rt,steps:s.extend({kind:e.literal("steps"),steps:e.array(e.object({content:r.optional(),icon:N.optional(),id:m,image:I.optional().describe("A representative raster image for this step. Prefer this over icon for place itineraries when a trusted image URL is available."),meta:e.string().trim().max(100).optional(),progress:e.number().min(0).max(100).optional(),status:e.enum(["blocked","cancelled","completed","failed","in-progress","pending","complete","current","upcoming"]).optional(),timestamp:e.string().trim().max(100).optional(),title:r})).min(1).max(12),variant:e.enum(["steps","timeline"]).optional()}),sunburst:Gt,switches:s.extend({items:e.array(e.object({defaultSelected:e.boolean().optional(),description:r.optional(),id:m,label:r})).min(1).max(20),kind:e.literal("switch-group")}),table:s.extend({columns:e.array(e.object({format:C.optional(),key:c,label:r})).min(1).max(12),filterable:e.boolean().optional(),kind:e.literal("data-table"),rows:e.array(O).max(200),variant:e.enum(["primary","secondary"]).optional()}),tabs:s.extend({defaultValue:m.optional(),kind:e.literal("tabs"),tabs:e.array(e.union([e.object({children:e.never().optional(),content:M,id:m,label:r}),e.object({children:e.array(e.lazy(()=>le)).min(1).max(12),content:e.never().optional(),id:m,label:r})])).min(1).max(10),variant:e.enum(["primary","secondary"]).optional()}),tags:s.extend({kind:e.literal("tag-list"),tags:e.array(r).min(1).max(30)}),text:s.extend({content:M,kind:e.literal("text"),variant:e.enum(["card","clear"]).optional()}),toggles:s.extend({defaultValue:e.array(m).max(12).optional(),items:e.array(e.object({id:m,label:r})).min(1).max(12),kind:e.literal("toggle-group"),selectionMode:e.enum(["multiple","single"]).optional()}),viewEvent:s.extend({date:e.string().trim().min(1).max(80),kind:e.literal("view-event"),time:e.string().trim().min(1).max(80),tone:j.optional()}),weatherCurrent:s.extend({condition:X,details:e.array(e.object({label:r,value:r})).max(6).optional(),kind:e.literal("weather-current"),location:r,temperature:e.number().finite().min(-150).max(150),unit:Ae}),weatherForecast:s.extend({condition:X,forecast:e.array(e.object({condition:X,label:e.string().trim().min(1).max(40),temperature:e.number().finite().min(-150).max(150)})).min(2).max(10),high:e.number().finite().min(-150).max(150),kind:e.literal("weather-forecast"),location:r,low:e.number().finite().min(-150).max(150),unit:Ae})},$t=o.metricGrid,Yt=o.kpiGrid,Wt=o.line,Xt=o.area,Jt=o.bar,Qt=o.composed,en=o.pie,tn=o.donut,nn=o.radar,on=o.radial,an=o.sankey,rn=o.scatter,sn=o.heatmap,ln=o.candlestick,pn=o.funnel,mn=o.gauge,cn=o.sunburst,dn=o.table,un=o.comparison,gn=o.meterList,hn=o.form,fn=o.text,yn=o.callout,Cn=o.image,bn=o.map,xn=o.tags,An=o.list,kn=o.listBlock,In=o.accordion,Tn=o.steps,Sn=o.code,vn=o.diagram,jo=o.tabs.superRefine(st),wn=o.actions,_n=o.followup,En=o.switches,Nn=o.toggles,Rn=o.recordCard,Un=o.productCard,zn=o.flightTracker,On=o.createEvent,Ln=o.playlist,Mn=o.rideStatus,Gn=o.purchaseItems,jn=o.channelMessage,Bn=o.purchaseComplete,Dn=o.playerCard,Pn=o.viewEvent,Vn=o.eventSession,Kn=o.enableNotification,Zn=o.weatherForecast,Fn=o.weatherCurrent,Hn=e.discriminatedUnion("kind",[o.metricGrid,o.kpiGrid,o.line,o.area,o.bar,o.composed,o.pie,o.donut,o.radar,o.radial,o.sankey,o.scatter,o.heatmap,o.candlestick,o.funnel,o.gauge,o.sunburst,o.table,o.comparison,o.meterList]),we=s.extend({defaultValue:m.optional(),kind:e.literal("product-signals"),tabs:e.array(e.object({component:Hn,id:m,label:r})).min(2).max(4)}),qn=we.superRefine((t,n)=>{let a=new Set;for(let[i,l]of t.tabs.entries())a.has(l.id)&&n.addIssue({code:"custom",message:`Duplicate product signal tab id "${l.id}"`,path:["tabs",i,"id"]}),a.add(l.id);t.defaultValue&&!a.has(t.defaultValue)&&n.addIssue({code:"custom",message:"The default product signal must reference one of the tabs",path:["defaultValue"]})}),$n=e.discriminatedUnion("kind",[o.metricGrid,o.kpiGrid,o.line,o.area,o.bar,o.composed,o.pie,o.donut,o.radar,o.radial,o.sankey,o.scatter,o.heatmap,o.candlestick,o.funnel,o.gauge,o.sunburst,o.table,o.comparison,o.meterList,o.form,o.text,o.callout,o.image,o.map,o.tags,o.list,o.listBlock,o.accordion,o.steps,o.code,o.diagram,o.tabs,o.actions,o.followup,o.switches,o.toggles,o.recordCard,o.productCard,o.flightTracker,o.createEvent,o.playlist,o.rideStatus,o.purchaseItems,o.channelMessage,o.purchaseComplete,o.playerCard,o.viewEvent,o.eventSession,o.enableNotification,o.weatherForecast,o.weatherCurrent]);function Yn(t){if(!t)return;let n=new Set;for(let a of t){if(n.has(a.id))return a.id;n.add(a.id)}}var re=e.union([$n,qn]).superRefine((t,n)=>{let a=[];switch(t.kind){case"channel-message":a.push({items:t.attachments,path:"attachments"});break;case"create-event":a.push({items:t.events,path:"events"}),a.push({items:t.actions,path:"actions"});break;case"enable-notification":a.push({items:t.actions,path:"actions"});break;case"playlist":a.push({items:t.tracks,path:"tracks"}),a.push({items:t.actions,path:"actions"});break;case"purchase-items":a.push({items:t.items,path:"items"}),a.push({items:t.actions,path:"actions"});break;case"tabs":{st(t,n);break}default:break}for(let i of a){let l=Yn(i.items);l&&n.addIssue({code:"custom",message:`Duplicate ${i.path} id "${l}"`,path:[i.path]})}}),_e=s.extend({children:e.array(re).min(1).max(4),kind:e.literal("dashboard"),layout:e.enum(["chart-table","grid","metrics-chart","stack"])}),Wn=_e,Ee=e.union([re,Wn]),Bo=e.object({component:Ee}),J=6,B=48,Ne=new Set(["card","col","grid","item-card","item-card-group","row"]),Re=new Set(["divider","spacer"]),Ue=new Set(["badge","button","heading","icon","progress","rating"]),ze=Ne,Oe=Re,Le=Ue;function Me(t){return Ne.has(t.kind)}function Ge(t){return t.kind==="item-card"?[...t.left??[],...t.middle,...t.right??[]]:t.children}function Do(t){return Re.has(t.kind)}function Po(t){return Ue.has(t.kind)}var T=e.object({id:m}),ie=e.enum(["lg","md","none","sm"]),je=e.enum(["center","end","start","stretch"]),Be=e.enum(["between","center","end","start"]),$=e.array(e.lazy(()=>le)).min(1).max(B),De=T.extend({kind:e.literal("spacer"),size:e.enum(["auto","lg","md","sm"]).optional()}),Pe=T.extend({kind:e.literal("divider")}),Ve=T.extend({icon:N.optional(),kind:e.literal("heading"),level:e.union([e.literal(1),e.literal(2),e.literal(3),e.literal(4)]).optional(),text:r}),Ke=T.extend({icon:N.optional(),kind:e.literal("button"),label:r,prompt:e.string().trim().min(1).max(2e3).optional(),toolCall:Se.optional(),variant:oe.optional()}).refine(t=>!!(t.prompt??t.toolCall),{message:"Buttons need a prompt or a toolCall to do something when pressed"}),Ze=T.extend({kind:e.literal("badge"),label:r,tone:j.optional(),variant:e.enum(["soft","solid"]).optional()}),Fe=T.extend({kind:e.literal("icon"),name:N,size:e.enum(["lg","md","sm"]).optional(),tone:j.optional()}),He=T.extend({count:e.number().int().nonnegative().max(1e9).optional(),kind:e.literal("rating"),value:e.number().finite().min(0).max(5)}),qe=T.extend({kind:e.literal("progress"),label:r.optional(),value:e.number().finite().min(0).max(100)}),$e=e.enum(["default","outline","secondary","tertiary","transparent"]),Q=e.lazy(()=>le),Ye=s.extend({action:y.optional().describe("Makes the whole row pressable. Omit when a slot contains its own button or other interactive control."),isDisabled:e.boolean().optional(),isSelected:e.boolean().optional(),kind:e.literal("item-card"),left:e.array(Q).min(1).max(4).optional().describe("Leading slot. Prefer one icon node or a compact visual."),middle:e.array(Q).min(1).max(8).describe("Primary flexible slot. Prefer a level-4 heading followed by a clear text node for a title and description."),right:e.array(Q).min(1).max(4).optional().describe("Trailing slot. Prefer a badge, short value, icon, or button."),variant:$e.optional()}),Xn=new Set(["accordion","action-group","button","followup","form","map","switch-group","tabs","toggle-group"]);function We(t){for(let n of t)if(Xn.has(n.kind)||Me(n)&&We(Ge(n)))return!0;return!1}var se=Ye.superRefine((t,n)=>{t.action&&We([...t.left??[],...t.middle,...t.right??[]])&&n.addIssue({code:"custom",message:"A pressable item-card cannot contain buttons or other interactive descendants. Remove action from the card or move the nested control outside it."})}),Xe=s.extend({children:e.array(se).min(1).max(12),columns:e.union([e.literal(2),e.literal(3)]).optional(),kind:e.literal("item-card-group"),layout:e.enum(["grid","list"]).optional(),showHeader:e.boolean().optional(),variant:$e.optional()}),Je=Xe.superRefine((t,n)=>{t.columns&&t.layout!=="grid"&&n.addIssue({code:"custom",message:"Item-card group columns only apply when layout is grid.",path:["columns"]})}),Qe=T.extend({align:je.optional(),children:$,gap:ie.optional(),justify:Be.optional(),kind:e.literal("row")}),et=T.extend({align:je.optional(),children:$,gap:ie.optional(),justify:Be.optional(),kind:e.literal("col")}),tt=T.extend({children:$,columns:e.union([e.literal(1),e.literal(2),e.literal(3),e.literal(4)]),gap:ie.optional(),kind:e.literal("grid")}),nt=s.extend({children:$,kind:e.literal("card"),variant:ee.optional()}),ot=Qe,at=et,rt=tt,it=nt,le=e.union([re,De,Pe,Ve,Ke,Ze,Fe,He,qe,ot,at,rt,it,se,Je]);function Jn(t,n){to(t,n)}function Qn(t,n){let a=t.tabs.flatMap(i=>i.children??[]);a.length!==0&&lt(a,n,t.id,2,1)}function st(t,n){let a=new Set;for(let[i,l]of t.tabs.entries())a.has(l.id)&&n.addIssue({code:"custom",message:`Duplicate tab id "${l.id}"`,path:["tabs",i,"id"]}),a.add(l.id);t.defaultValue&&!a.has(t.defaultValue)&&n.addIssue({code:"custom",message:"The default tab must reference one of the tabs",path:["defaultValue"]}),Qn(t,n)}function eo(t){return Me(t)?Ge(t):t.kind==="tabs"?t.tabs.flatMap(n=>n.children??[]):[]}function lt(t,n,a,i=1,l=0){let d=new Set,f=l,h=l>0?i-1:0;a&&d.add(a);let R=(b,S)=>{if(f+=1,h=Math.max(h,S),d.has(b.id)&&n.addIssue({code:"custom",message:`Duplicate component id "${b.id}" in the composed UI tree. Every node needs a unique id.`}),d.add(b.id),!(S>J))for(let K of eo(b))R(K,S+1)};for(let b of t)R(b,i);h>J&&n.addIssue({code:"custom",message:`Composed UI trees can nest at most ${J} levels deep.`}),f>B&&n.addIssue({code:"custom",message:`Composed UI trees can contain at most ${B} components.`})}function to(t,n){lt([t],n)}var pt=e.union([ot,at,rt,it,se,Je]).superRefine(Jn),Vo=e.union([Ee,pt]),Ko=e.object({component:pt}),E=t=>e.array(e.unknown()).min(1).max(t).describe("Child nodes. Each is any catalog component; look its kind up separately."),Zo={accordion:In,"action-group":wn,"area-chart":Xt,badge:Ze,"bar-chart":Jt,button:Ke,callout:yn,"candlestick-chart":ln,card:nt.extend({children:E(B)}),"channel-message":jn,"code-block":Sn,col:et.extend({children:E(B)}),"comparison-list":un,"composed-chart":Qt,"create-event":On,dashboard:_e.extend({children:E(4)}),"data-table":dn,diagram:vn,divider:Pe,"donut-chart":tn,"enable-notification":Kn,"event-session":Vn,"flight-tracker":zn,followup:_n,form:hn,"funnel-chart":pn,"gauge-chart":mn,grid:tt.extend({children:E(B)}),heading:Ve,heatmap:sn,icon:Fe,image:Cn,"item-card":Ye.extend({left:E(4).optional().describe("Leading slot nodes."),middle:E(8).describe("Primary flexible slot nodes."),right:E(4).optional().describe("Trailing slot nodes.")}),"item-card-group":Xe.extend({children:e.array(e.unknown()).min(1).max(12).describe("One to twelve item-card children. Look up item-card for each child's schema.")}),"kpi-grid":Yt,"line-chart":Wt,list:An,"list-block":kn,map:bn,"meter-list":gn,"metric-grid":$t,"pie-chart":en,"player-card":Dn,playlist:Ln,"product-card":Un,"product-signals":we.extend({tabs:e.array(e.object({component:e.unknown().describe("One analytical component: metric-grid, kpi-grid, any chart, data-table, comparison-list, or meter-list. Look its kind up separately."),id:m,label:r})).min(2).max(4)}),progress:qe,"purchase-complete":Bn,"purchase-items":Gn,"radar-chart":nn,"radial-chart":on,rating:He,"record-card":Rn,"ride-status":Mn,row:Qe.extend({children:E(B)}),"sankey-chart":an,"scatter-chart":rn,spacer:De,steps:Tn,"sunburst-chart":cn,"switch-group":En,tabs:s.extend({defaultValue:m.optional(),kind:e.literal("tabs"),tabs:e.array(e.union([e.object({content:M,id:m,label:r}),e.object({children:E(12).describe("Rich panel nodes rendered as one vertical stack. Look up every child kind separately."),id:m,label:r})])).min(1).max(10),variant:e.enum(["primary","secondary"]).optional()}),"tag-list":xn,text:fn,"toggle-group":Nn,"view-event":Pn,"weather-current":Fn,"weather-forecast":Zn};var ct={accordion:"collapsible sections of longer prose","action-group":"buttons that send prompts or call client tools","area-chart":"one continuous time series with a filled trend",badge:"a small toned status label","bar-chart":"ranked or categorical comparison, horizontal layout for rankings",button:"one action with a prompt or client-tool call",callout:"one short toned notice: info, success, warning, or danger","candlestick-chart":"open-high-low-close price movement over ordered periods",card:"titled surface grouping related children","channel-message":"a quoted workspace message with author and attachments","code-block":"a syntax-highlighted snippet",col:"stacks children vertically","comparison-list":"labeled values with change deltas, no axes","composed-chart":"two to five mixed area/bar/line series, optional dual axis","create-event":"a proposed calendar slot beside surrounding events",dashboard:"up to four analytical children in a fixed layout","data-table":"exact values in filterable rows and columns",diagram:"a flowchart, sequence, ER, or state diagram from Mermaid source, for processes and relationships prose cannot show",divider:"a rule between sections","donut-chart":"proportions of a whole with a hollow center","enable-notification":"a binary notification opt-in with two actions","event-session":"a conference session with time, location, and speakers","flight-tracker":"a flight's route, times, and live progress",followup:"suggested next prompts the user can send",form:"input fields with submit actions","funnel-chart":"drop-off through ordered conversion or pipeline stages","gauge-chart":"one bounded value against its minimum and maximum",grid:"one to four equal columns of peers",heading:"a section title, levels one to four",heatmap:"two-dimensional intensity across x and y",icon:"one semantic glyph from the icon vocabulary",image:"one to six real image URLs with captions in a grid or horizontal chat gallery","item-card":"one compact three-slot row with composable left, middle, and right content","item-card-group":"one to twelve related item-card rows in a list or grid","kpi-grid":"up to four headline KPIs, each with a sparkline of its own history","line-chart":"overlapping series, a live signal, or one series split around a baseline",list:"bulleted, numbered, or checklist items with optional children","list-block":"richer rows with title, description, meta, rating, icon, or image",map:"ranked places pinned by exact latitude and longitude","meter-list":"bounded quantities such as quota, utilization, or budget","metric-grid":"up to four headline KPIs with no history to plot","pie-chart":"proportions of a whole","player-card":"an athlete with jersey, portrait, and stat lines",playlist:"a track collection with cover and per-track actions","product-card":"purchasable items with image, price, rating, availability","product-signals":"two to four related analytical views in tabs",progress:"a zero to one hundred percentage bar","purchase-complete":"confirmation after a successful transaction","purchase-items":"a cart or order summary with line items and totals","radar-chart":"multivariate comparison across three or more axes","radial-chart":"compact circular measure",rating:"a zero to five star score with optional count","record-card":"one entity's labeled facts, layouts details/compact/media","ride-status":"pickup ETA and driver for a ride in progress",row:"places complementary children side by side","sankey-chart":"flow volumes between source and target nodes","scatter-chart":"correlation between two numeric fields, optional grouping",spacer:"a gap between siblings",steps:"task progress or a chronological timeline, up to twelve entries","sunburst-chart":"hierarchical part-to-whole values across nested levels","switch-group":"toggleable boolean preferences",tabs:"parallel text or rich multi-component sections behind labeled tabs","tag-list":"short keyword chips",text:"explanatory markdown prose","toggle-group":"single or multiple choice from short options","view-event":"one calendar event's date, time, and tone","weather-current":"current conditions in one location","weather-forecast":"multi-day or future conditions with highs and lows"},no={actions:"actions","data-visualization":"data","display-information":"display","form-elements":"forms"};function oo(t){return t==="dashboard"||ze.has(t)?"containers":Oe.has(t)?"layout":Le.has(t)?"primitives":no[be[t]]??"display"}var mt=Object.fromEntries(Object.entries(ct).map(([t,n])=>[t,{group:oo(t),summary:n}])),pe=Object.keys(ct).sort(),ao=[["containers","Containers"],["layout","Layout"],["primitives","Primitives"],["data","Data"],["display","Content"],["actions","Actions"],["forms","Forms"]];function $o(){return ao.map(([n,a])=>{let i=pe.filter(l=>mt[l].group===n).map(l=>`${l} \u2014 ${mt[l].summary}`);return`${a}: ${i.join("; ")}.`}).join(`
2
- `)}import{z as L}from"zod";var ro=["callMcpTool","composeUI","executeSandbox","getComponentSchema","renderComponent","searchKnowledge","searchMcpTools","searchWeb"],io="mcp_",so=20,lo=16*1024,po=L.object({description:L.string().trim().min(1).max(1e3),inputSchema:L.record(L.string(),L.unknown()),name:L.string().regex(/^[a-zA-Z][a-zA-Z0-9_-]{0,63}$/).refine(t=>!ro.includes(t)&&!t.toLowerCase().startsWith(io),"Client tool name is reserved by the HeroUI Agent runtime"),needsApproval:L.boolean().optional()}),Xo=L.array(po).max(so).superRefine((t,n)=>{let a=new Set;for(let i of t)a.has(i.name)&&n.addIssue({code:"custom",message:`Duplicate client tool name: ${i.name}`}),a.add(i.name);new TextEncoder().encode(JSON.stringify(t)).byteLength>lo&&n.addIssue({code:"custom",message:"Client tool manifest exceeds 16KB"})});import{z as p}from"zod";var V=6,dt="0.2.0-beta.11";var mo=p.enum(["light","dark","system"]),co=p.enum(["outline","plain","surface","surface-secondary"]),uo=new Set(["[object object]","0","anonymous","distinct_id","distinctid","email","false","guest","id","nan","none","not_authenticated","null","true","undefined"]),me=p.string().trim().min(1).max(200).refine(t=>!uo.has(t.toLowerCase()),{message:"Identity id is reserved"}),go=p.discriminatedUnion("type",[p.object({id:me,type:p.literal("anonymous")}),p.object({id:me,type:p.literal("user")})]),ho=p.object({avatarUrl:p.string().trim().pipe(p.url()).optional(),email:p.string().trim().max(320).pipe(p.email()).optional(),name:p.string().trim().max(120).optional()}),na=p.object({anonymousId:me.optional(),identity:go,profile:ho.optional()}),oa=p.object({expiresAt:p.number().int().positive(),token:p.string().trim().min(1)}),aa=p.object({agentId:p.string().trim().min(1).max(100),apiKeyId:p.string().trim().min(1).max(100),aud:p.literal("heroui-agent"),exp:p.number().int().positive(),iat:p.number().int().positive(),iss:p.literal("https://api.heroui.com"),jti:p.uuid(),protocolVersion:p.literal(6),sub:p.string().trim().min(1).max(200)}),ra={embed:"embed",preview:"preview"},ia=p.object({agentId:p.string(),minimumProtocolVersion:p.literal(6),name:p.string().trim().min(1).max(120),protocolVersion:p.literal(6),sdkVersion:p.string().default(dt),suggestedPrompts:p.array(p.string().trim().min(1).max(160)).max(5),surfaceVariant:co.default("plain"),theme:mo});import{z as k}from"zod";var ut=k.object({excerpt:k.string().trim().min(1).max(2e3).optional(),locator:k.string().trim().min(1).max(160).optional(),sourceId:k.string().trim().min(1).max(120)}),fo=k.string().trim().max(2048).refine(t=>{try{return["http:","https:"].includes(new URL(t).protocol)}catch{return!1}}),yo=k.union([ut.extend({sourceType:k.literal("document"),title:k.string().trim().min(1).max(200)}),ut.extend({sourceType:k.literal("url").optional(),title:k.string().trim().min(1).max(200).optional(),url:fo})]),pa=k.object({items:k.array(yo).min(1).max(16)});var ce=["moonshotai/Kimi-K3","openai/gpt-5.6-luna","openai/gpt-5.6-terra","openai/gpt-5.6-sol","google/gemini-3.6-flash","anthropic/claude-sonnet-5","anthropic/claude-opus-4.8"],Co={"google/gemini-3.5-flash":"google/gemini-3.6-flash"};function de(t){return Co[t]??t}var ca="openai/gpt-5.6-luna",bo=[{description:"Flagship model for coding, reasoning, and knowledge work",id:"moonshotai/Kimi-K3",label:"Kimi K3",provider:"Moonshot AI",tier:"light"},{description:"Fast answers and lightweight agent workflows",id:"openai/gpt-5.6-luna",label:"GPT-5.6 Luna",provider:"OpenAI",tier:"light"},{description:"Balanced reasoning for everyday agent tasks",id:"openai/gpt-5.6-terra",label:"GPT-5.6 Terra",provider:"OpenAI",tier:"codegen"},{description:"Deep reasoning for complex, multi-step analysis",id:"openai/gpt-5.6-sol",label:"GPT-5.6 Sol",provider:"OpenAI",tier:"complex"},{description:"Fast multimodal analysis with a large context window",id:"google/gemini-3.6-flash",label:"Gemini 3.6 Flash",provider:"Google",tier:"light"},{description:"Strong agentic reasoning and polished UI decisions",id:"anthropic/claude-sonnet-5",label:"Claude Sonnet 5",provider:"Anthropic",tier:"codegen"},{description:"Highest-capability Claude for difficult research and analysis",id:"anthropic/claude-opus-4.8",label:"Claude Opus 4.8",provider:"Anthropic",tier:"complex"}],xo=new Set(ce);function da(t){return typeof t=="string"&&xo.has(t)}function ua(t){let n=t?de(t):void 0;return bo.find(a=>a.id===n)?.tier??"light"}import{z as gt}from"zod";var ya=gt.preprocess(t=>typeof t=="string"?de(t):t,gt.enum(ce));var ba="heroui-agent:runtime-timing",xa="heroui_agent_turn_admitted",Aa="getTurnAdmissionStatuses",ka=50;import{z as g}from"zod";var Ao=["action_approved","action_declined","component_copy","component_export","component_followup","component_rendered","component_submit","component_tool","embed_loaded","failure","feedback_down","feedback_up","first_chunk","first_feedback_paint","first_server_content_paint","first_text_paint","message_copied","message_sent","opened","reconnected","retry","stopped","turn_completed","turn_stalled"],ko=["client-inactivity-watchdog","cloudflare-chat","message-send-failed","stream-error"],Io=["did_not_follow_instructions","incomplete","incorrect","not_relevant","other","unclear"],To=["client_stopped","conversation_deleted","provider_error","provider_rate_limited","provider_timeout","turn_deadline_exceeded","turn_stalled","unknown"],So=g.object({actionId:g.string().trim().min(1).max(256).optional(),componentId:g.string().trim().min(1).max(256).optional(),componentType:g.enum(pe).optional(),feedbackComment:g.string().trim().max(1e3).optional(),feedbackCommentLength:g.number().int().min(0).max(1e3).optional(),feedbackReasons:g.array(g.enum(Io)).max(6).optional(),format:g.enum(["csv","json","png","svg","text"]).optional(),hasFeedbackComment:g.boolean().optional(),hasToolName:g.boolean().optional(),latencyMs:g.number().finite().min(0).max(1800*1e3).optional(),latencyOrigin:g.literal("user_submit").optional(),messageId:g.string().trim().min(1).max(256).optional(),protocolVersion:g.literal(6).optional(),sdkVersion:g.string().trim().min(1).max(80).optional(),source:g.enum(ko).optional(),toolName:g.string().trim().min(1).max(160).optional()}).strict(),va=g.object({conversationId:g.string().uuid(),event:g.enum(Ao),properties:So.default({})}).strict(),wa=g.enum(To);export{ra as AGENT_CONVERSATION_SOURCE,ce as AGENT_MODEL_IDS,bo as AGENT_MODEL_OPTIONS,mt as AGENT_UI_CATALOG,ze as AGENT_UI_CONTAINER_KINDS,pe as AGENT_UI_KIND_NAMES,Zo as AGENT_UI_KIND_SCHEMAS,Oe as AGENT_UI_LAYOUT_LEAF_KINDS,Le as AGENT_UI_PRIMITIVE_KINDS,J as COMPOSED_UI_MAX_DEPTH,B as COMPOSED_UI_MAX_NODES,ca as DEFAULT_AGENT_PICKER_MODEL_ID,_o as HEROUI_AGENT_ATTACHMENT_ACCEPT,he as HEROUI_AGENT_ATTACHMENT_CONTENT_TYPES,ht as HEROUI_AGENT_ATTACHMENT_EXTENSION_BY_CONTENT_TYPE,wo as HEROUI_AGENT_ATTACHMENT_MAX_BYTES,Ao as HEROUI_AGENT_EMBED_EVENT_NAMES,ko as HEROUI_AGENT_EMBED_EVENT_SOURCES,Io as HEROUI_AGENT_FEEDBACK_REASONS,vo as HEROUI_AGENT_MAX_ATTACHMENTS,V as HEROUI_AGENT_PROTOCOL_VERSION,ye as HEROUI_AGENT_REMOTE_CONFIG_VERSION,ba as HEROUI_AGENT_RUNTIME_TIMING_EVENT,dt as HEROUI_AGENT_SDK_VERSION,Eo as HEROUI_AGENT_TEXT_ATTACHMENT_CONTENT_TYPES,ka as HEROUI_AGENT_TURN_ADMISSION_STATUS_MAX_IDS,Aa as HEROUI_AGENT_TURN_ADMISSION_STATUS_METHOD,xa as HEROUI_AGENT_TURN_ADMITTED_FRAME_TYPE,To as HEROUI_AGENT_TURN_ERROR_CODES,Co as LEGACY_AGENT_MODEL_IDS,so as MAX_CLIENT_TOOLS,lo as MAX_CLIENT_TOOLS_BYTES,ro as RESERVED_AGENT_TOOL_NAMES,io as RESERVED_AGENT_TOOL_PREFIX,In as accordionComponentSchema,wn as actionGroupComponentSchema,go as agentAuthIdentitySchema,ho as agentAuthProfileSchema,oa as agentAuthTokenSchema,Tt as agentIconNames,N as agentIconSchema,me as agentIdentityIdSchema,ya as agentModelIdSchema,ia as agentProjectConfigSchema,yo as agentSourceSchema,pa as agentSourcesSchema,co as agentSurfaceVariantSchema,mo as agentThemeSchema,aa as agentTokenClaimsSchema,Ee as agentUIComponentSchema,re as agentUILeafComponentSchema,le as agentUINodeSchema,Vo as agentUIRenderableSchema,Hn as analyticalLeafComponentSchema,Xt as areaChartComponentSchema,Ze as badgeComponentSchema,Jt as barChartComponentSchema,Ke as buttonComponentSchema,yn as calloutComponentSchema,ln as candlestickChartComponentSchema,it as cardComponentSchema,ee as cardComponentVariantSchema,jn as channelMessageComponentSchema,w as chartColorSchema,po as clientToolManifestEntrySchema,Xo as clientToolsSchema,Sn as codeBlockComponentSchema,at as colComponentSchema,un as comparisonListComponentSchema,Ko as composeUIInputSchema,Qt as composedChartComponentSchema,pt as composedUIComponentSchema,na as createAgentAuthTokenRequestSchema,On as createEventComponentSchema,Wn as dashboardComponentSchema,dn as dataTableComponentSchema,vn as diagramComponentSchema,Pe as dividerComponentSchema,tn as donutChartComponentSchema,Kn as enableNotificationComponentSchema,Vn as eventSessionComponentSchema,zn as flightTrackerComponentSchema,_n as followupComponentSchema,hn as formComponentSchema,pn as funnelChartComponentSchema,mn as gaugeChartComponentSchema,ua as getAgentModelTier,Ge as getAgentUIContainerChildren,rt as gridComponentSchema,Ve as headingComponentSchema,sn as heatmapComponentSchema,So as heroUIAgentEmbedEventPropertiesSchema,va as heroUIAgentEmbedEventSchema,wa as heroUIAgentTurnErrorCodeSchema,Fe as iconComponentSchema,Cn as imageComponentSchema,da as isAgentModelId,Me as isAgentUIContainerComponent,Do as isAgentUILayoutLeafComponent,Po as isAgentUIPrimitiveComponent,fe as isHeroUIAgentAttachmentContentType,se as itemCardComponentSchema,Je as itemCardGroupComponentSchema,Yt as kpiGridComponentSchema,Wt as lineChartComponentSchema,kn as listBlockComponentSchema,An as listComponentSchema,bn as mapComponentSchema,gn as meterListComponentSchema,$t as metricGridComponentSchema,C as numberFormatSchema,Uo as parseAgentRemoteConfig,en as pieChartComponentSchema,Dn as playerCardComponentSchema,Ln as playlistComponentSchema,Un as productCardComponentSchema,qn as productSignalsComponentSchema,qe as progressComponentSchema,Bn as purchaseCompleteComponentSchema,Gn as purchaseItemsComponentSchema,nn as radarChartComponentSchema,on as radialChartComponentSchema,He as ratingComponentSchema,Rn as recordCardComponentSchema,_t as recordCardLayoutSchema,$o as renderAgentUICatalogPrompt,Bo as renderComponentInputSchema,de as resolveAgentModelId,Mn as rideStatusComponentSchema,ot as rowComponentSchema,an as sankeyChartComponentSchema,rn as scatterChartComponentSchema,De as spacerComponentSchema,Tn as stepsComponentSchema,cn as sunburstChartComponentSchema,En as switchGroupComponentSchema,jo as tabsComponentSchema,xn as tagListComponentSchema,fn as textComponentSchema,Nn as toggleGroupComponentSchema,Pn as viewEventComponentSchema,X as weatherConditionSchema,St as weatherConditions,Fn as weatherCurrentComponentSchema,Zn as weatherForecastComponentSchema};
1
+ var vo=5,wo=10485760,ht={"application/json":"json","application/pdf":"pdf","image/gif":"gif","image/jpeg":"jpg","image/png":"png","image/webp":"webp","text/csv":"csv","text/markdown":"md","text/plain":"txt","text/tab-separated-values":"tsv"},he=Object.freeze(Object.keys(ht)),_o=he.join(","),ft=new Set(he),Eo=new Set(["application/json","text/csv","text/markdown","text/plain","text/tab-separated-values"]);function fe(t){return ft.has(t.trim().toLowerCase())}var ye=1,u=Symbol("invalid");function D(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)}function v(t){if(t!==void 0)return typeof t=="string"?t:u}function _(t){if(t!==void 0)return typeof t=="boolean"?t:u}function Y(t){if(t!==void 0)return typeof t=="number"&&Number.isFinite(t)?t:u}function z(t){return n=>{if(n!==void 0)return typeof n=="string"&&t.includes(n)?n:u}}function Ce(t){if(t===void 0)return;if(typeof t=="string")return t;if(!D(t))return u;let n=v(t.dark),a=v(t.light);return n===u||a===u?u:{...n===void 0?{}:{dark:n},...a===void 0?{}:{light:a}}}function yt(t){if(t===void 0)return;if(!D(t))return u;let n={};for(let[a,i]of Object.entries(t)){if(typeof i!="string")return u;n[a]=i}return n}function Ct(t){if(t!==void 0)return!Array.isArray(t)||t.some(n=>typeof n!="string")?u:t}function x(t,n){if(t===void 0||!D(t))return u;let a={};for(let[i,l]of Object.entries(n)){let d=l(t[i]);if(d===u)return u;d!==void 0&&(a[i]=d)}return a}function U(t){return t===u?void 0:t}var bt=["accent","background","foreground","overlay","surface","surfaceSecondary","tooltip"];function xt(t){return x(t,{launcher:n=>n===void 0?void 0:x(n,{background:Ce,icon:v,position:z(["bottom-left","bottom-right"]),style:yt}),panel:n=>n===void 0?void 0:x(n,{expandable:_,expanded:_,initialHeight:a=>a===void 0||typeof a=="string"?a:Y(a),initialWidth:a=>a===void 0||typeof a=="string"?a:Y(a)}),theme:n=>n===void 0?void 0:x(n,{colorScheme:z(["dark","light","system"]),colors:a=>a===void 0?void 0:x(a,Object.fromEntries(bt.map(i=>[i,Ce]))),designTheme:z(["base","brutalism","glass","mouve"]),radius:z(["pill","round","sharp","soft"]),typography:a=>a===void 0?void 0:x(a,{baseSize:Y,fontFamily:v})}),viewMode:z(["floating","sidebar"])})}function At(t){return x(t,{attachments:n=>{if(n===void 0||n===!1)return n;if(!Array.isArray(n))return u;let a=n.filter(i=>typeof i=="string"&&fe(i));return a.length===n.length?a:u},defaultModel:v,dictation:_,disclaimer:n=>n===!1?!1:v(n),modelPicker:_,placeholder:v})}function kt(t){return x(t,{animated:n=>{if(n===void 0||n===!1)return n;if(!D(n))return u;let a=z(["blurIn","fadeIn","slideUp"])(n.animation);return a===u||a===void 0?u:{...n,animation:a}},caret:n=>n===!1?!1:z(["block","circle"])(n)})}function It(t){if(t===void 0||t===!1)return t;if(!Array.isArray(t))return u;let n=["copy","feedback","retry"],a=t.filter(i=>typeof i=="string"&&n.includes(i));return a.length===t.length?a:u}function Uo(t){if(!D(t)||t.version!==ye)return null;let n=t.revision;if(typeof n!="string"||!n)return null;let a=U(xt(t.appearance)),i=U(x(t.capabilities,{imageSearch:_,newsSearch:_,webSearch:_})),l=U(At(t.composer)),d=U(kt(t.markdown)),f=U(x(t.permissions,{defaultMode:z(["ask","auto","full"]),showPicker:_})),h=U(It(t.responseActions)),R=U(x(t.startScreen,{greeting:v,promptShortcuts:_,prompts:Ct})),b=U(x(t.webfont,{familyName:S=>typeof S=="string"&&S?S:u,fontFaceUrl:v,stylesheetUrl:v}));return{...a?{appearance:a}:{},...i?{capabilities:i}:{},...l?{composer:l}:{},...d?{markdown:d}:{},...f?{permissions:f}:{},...h===void 0?{}:{responseActions:h},...R?{startScreen:R}:{},...b?{webfont:b}:{},revision:n,version:ye}}var be={accordion:"display-information","action-group":"actions","area-chart":"data-visualization","bar-chart":"data-visualization",callout:"display-information","candlestick-chart":"data-visualization","channel-message":"display-information","code-block":"display-information","comparison-list":"data-visualization","composed-chart":"data-visualization","create-event":"display-information","data-table":"data-visualization",diagram:"display-information","donut-chart":"data-visualization","enable-notification":"display-information","event-session":"display-information","flight-tracker":"display-information",followup:"actions",form:"form-elements","funnel-chart":"data-visualization","gauge-chart":"data-visualization",heatmap:"data-visualization",image:"display-information","kpi-grid":"data-visualization","line-chart":"data-visualization",list:"display-information","list-block":"display-information",map:"display-information","meter-list":"data-visualization","metric-grid":"data-visualization","pie-chart":"data-visualization","player-card":"display-information",playlist:"display-information","product-card":"display-information","product-signals":"data-visualization","purchase-complete":"display-information","purchase-items":"display-information","radar-chart":"data-visualization","radial-chart":"data-visualization","record-card":"display-information","ride-status":"display-information","sankey-chart":"data-visualization","scatter-chart":"data-visualization",steps:"display-information","sunburst-chart":"data-visualization","switch-group":"form-elements",tabs:"display-information","tag-list":"display-information",text:"display-information","toggle-group":"form-elements","view-event":"display-information","weather-current":"display-information","weather-forecast":"display-information"};import{z as e}from"zod";function xe(t){return{maximum:t.max??(t.format?.style==="percent"?1:100),minimum:t.min??0}}var Tt=["activity","alert","briefcase","calendar","chart","check","clock","code","credit-card","database","device-desktop","device-mobile","document","dollar","flag","globe","heart","home","info","lightning","location","mail","percent","person","question","receipt","rocket","route","search","shopping-bag","speedometer","star","tag","target","users"],St=["clear","partly-cloudy","cloudy","fog","drizzle","rain","snow","thunderstorm","windy","unknown"],vt=e.string().trim().min(1).max(120),r=e.string().trim().min(1).max(320),G=e.string().trim().min(1).max(1e4),c=e.string().trim().min(1).max(80),m=e.string().trim().min(1).max(100),M=e.string().regex(/^\d{4}-\d{2}-\d{2}$/),W=e.string().regex(/^(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d)?$/),wt=e.union([e.string().max(500),e.number(),e.boolean(),e.null()]),O=e.record(e.string().max(80),wt),s=e.object({description:r.optional(),id:m,title:vt}),ee=e.enum(["outline","plain","surface","surface-secondary","surface-tertiary","widget"]).describe("Card hierarchy: surface for the primary standalone group; surface-secondary for supporting information; surface-tertiary for one featured or emphasized group; outline for equal peers and comparisons; plain for a structural section already separated by surrounding layout; widget for a compact interactive group with actions or controls."),_t=e.enum(["compact","details","media"]).describe("Record information layout: details for a full labeled fact set; compact for a brief summary or repeated peer cards; media for an image-led product, place, person, or event and only when an image is available."),C=e.discriminatedUnion("style",[e.object({compact:e.boolean().optional(),style:e.literal("number")}),e.object({maximumFractionDigits:e.number().int().min(0).max(4).optional(),style:e.literal("percent")}),e.object({compact:e.boolean().optional(),currency:e.string().regex(/^[A-Z]{3}$/),style:e.literal("currency")})]),w=e.enum(["accent","chart-1","chart-2","chart-3","chart-4","chart-5","danger","default","success","warning"]),Ie=e.record(e.string().trim().min(1).max(80),w).refine(t=>Object.keys(t).length<=50,"At most 50 category colors are allowed"),ne=e.object({color:w.optional(),dataKey:c,format:C.optional(),label:r}),Et=ne.extend({axis:e.enum(["left","right"]).optional(),stacked:e.boolean().optional(),type:e.enum(["area","bar","line"])}),Nt=e.object({id:m,label:r,maxItems:e.number().int().min(1).max(200).optional()}),H=s.extend({data:e.array(O).min(1).max(200),defaultRangeId:m.optional(),ranges:e.array(Nt).min(2).max(8).optional(),series:e.array(ne).min(1).max(5),showSummary:e.boolean().optional(),xKey:c}),q=s.extend({colors:Ie.optional(),data:e.array(O).min(1).max(50),format:C.optional(),labelKey:c,valueKey:c}),Rt=s.extend({colors:Ie.optional(),data:e.array(O).min(1).max(200),format:C.optional(),groupKey:c.optional(),kind:e.literal("scatter-chart"),labelKey:c.optional(),sizeKey:c.optional(),xKey:c,yKey:c}),Ut=s.extend({color:w.optional(),data:e.array(O).min(1).max(400),format:C.optional(),kind:e.literal("heatmap"),valueKey:c,xKey:c,yKey:c}),zt=H.extend({baseline:e.number().finite().optional(),kind:e.literal("line-chart"),mode:e.enum(["live","profit-loss","standard"]).optional(),negativeColor:w.optional(),positiveColor:w.optional(),windowSize:e.number().int().min(2).max(200).optional()}).superRefine((t,n)=>{(t.mode==="live"||t.mode==="profit-loss")&&t.series.length!==1&&n.addIssue({code:"custom",message:`${t.mode} line charts require exactly one series`,path:["series"]})}),Ot=s.extend({closeKey:c,data:e.array(O).min(1).max(200),downColor:w.optional(),format:C.optional(),highKey:c,kind:e.literal("candlestick-chart"),lowKey:c,openKey:c,upColor:w.optional(),xKey:c}).superRefine((t,n)=>{for(let[a,i]of t.data.entries()){let l=i[t.openKey],d=i[t.highKey],f=i[t.lowKey],h=i[t.closeKey];if([l,d,f,h].some(ge=>typeof ge!="number"||!Number.isFinite(ge))){n.addIssue({code:"custom",message:"Every candlestick row needs finite open, high, low, and close values",path:["data",a]});continue}let b=l,S=d,K=f,ue=h;(K>Math.min(b,ue)||S<Math.max(b,ue)||K>S)&&n.addIssue({code:"custom",message:"Candlestick low/high values must contain the open and close values",path:["data",a]})}}),Lt=q.extend({data:e.array(O).min(2).max(20),kind:e.literal("funnel-chart"),orientation:e.enum(["horizontal","vertical"]).optional(),showPercentages:e.boolean().optional()}).superRefine((t,n)=>{let a=t.data.map((i,l)=>{let d=i[t.valueKey];return typeof d!="number"||!Number.isFinite(d)||d<0?(n.addIssue({code:"custom",message:"Every funnel stage needs a finite, non-negative value",path:["data",l,t.valueKey]}),0):d});a.some(i=>i>0)||n.addIssue({code:"custom",message:"A funnel needs at least one stage above zero",path:["data"]}),(a[0]??0)<=0&&n.addIssue({code:"custom",message:"A funnel's first stage must be above zero",path:["data",0,t.valueKey]});for(let i=1;i<a.length;i+=1)(a[i]??0)>(a[i-1]??0)&&n.addIssue({code:"custom",message:"Funnel stages must not increase",path:["data",i,t.valueKey]})}),Gt=s.extend({color:w.optional(),format:C.optional(),kind:e.literal("gauge-chart"),label:r,max:e.number().finite().optional(),min:e.number().finite().optional(),notches:e.number().int().min(6).max(60).optional(),orientation:e.enum(["arc","linear"]).optional(),value:e.number().finite()}).superRefine((t,n)=>{let{maximum:a,minimum:i}=xe(t);a<=i?n.addIssue({code:"custom",message:"Gauge max must be greater than min",path:["max"]}):(t.value<i||t.value>a)&&n.addIssue({code:"custom",message:"Gauge value must be within its min/max range",path:["value"]})}),Te=e.lazy(()=>e.object({children:e.array(Te).min(1).max(12).optional(),color:w.optional(),id:m,label:r,value:e.number().finite().positive().optional()}).superRefine((t,n)=>{t.children?.length&&t.value!==void 0&&n.addIssue({code:"custom",message:"Sunburst branch values are derived from their children",path:["value"]}),!t.children?.length&&t.value===void 0&&n.addIssue({code:"custom",message:"Every sunburst leaf needs a positive value",path:["value"]})})),Mt=s.extend({data:Te,format:C.optional(),kind:e.literal("sunburst-chart")}).superRefine((t,n)=>{let a=new Set,i=0,l=0,d=(f,h)=>{i+=1,l=Math.max(l,h),a.has(f.id)&&n.addIssue({code:"custom",message:`Duplicate sunburst node id "${f.id}"`}),a.add(f.id),f.children?.forEach(R=>d(R,h+1))};t.data.children?.length||n.addIssue({code:"custom",message:"A sunburst root needs at least one child",path:["data","children"]}),d(t.data,0),i>60&&n.addIssue({code:"custom",message:"Sunburst charts allow at most 60 nodes"}),l>4&&n.addIssue({code:"custom",message:"Sunburst charts allow at most four nested levels"})}),Z=e.object({label:r,value:c}),jt=e.object({end:M,start:M}).refine(t=>t.start<=t.end,"The start date must not be after the end date"),A={description:r.optional(),label:r,name:c,required:e.boolean().optional()},Bt=e.discriminatedUnion("kind",[e.object({...A,defaultValue:e.string().max(500).optional(),inputType:e.enum(["email","number","password","search","tel","text","url"]).optional(),kind:e.literal("input"),placeholder:e.string().max(160).optional()}),e.object({...A,defaultValue:e.string().max(2e3).optional(),kind:e.literal("textarea"),placeholder:e.string().max(160).optional(),rows:e.number().int().min(2).max(12).optional()}),e.object({...A,defaultValue:c.optional(),kind:e.literal("select"),options:e.array(Z).min(1).max(30),placeholder:e.string().max(160).optional()}),e.object({...A,defaultValue:c.optional(),kind:e.literal("radio-group"),options:e.array(Z).min(1).max(12),placeholder:e.string().max(160).optional()}),e.object({...A,defaultValue:e.array(c).max(20).optional(),kind:e.literal("checkbox-group"),options:e.array(Z).min(1).max(20)}),e.object({...A,defaultValue:e.array(c).max(50).optional(),kind:e.literal("combobox"),options:e.array(Z.extend({description:e.string().trim().min(1).max(120).optional()})).min(1).max(200).describe("Prefer this over select once there are more options than someone would scan \u2014 it filters as they type. Values must be unique."),placeholder:e.string().max(160).optional(),selectionMode:e.enum(["multiple","single"]).optional()}).superRefine((t,n)=>{let a=new Set(t.options.map(i=>i.value));a.size!==t.options.length&&n.addIssue({code:"custom",message:"Combobox option values must be unique",path:["options"]}),(t.selectionMode??"single")==="single"&&(t.defaultValue?.length??0)>1&&n.addIssue({code:"custom",message:"A single-selection combobox takes at most one default value",path:["defaultValue"]}),t.defaultValue?.some(i=>!a.has(i))&&n.addIssue({code:"custom",message:"Every combobox default value must be one of the options",path:["defaultValue"]})}),e.object({...A,defaultValue:e.number().optional(),kind:e.literal("slider"),max:e.number(),min:e.number(),step:e.number().positive().optional()}),e.object({...A,defaultValue:e.number().optional(),format:C.optional(),kind:e.literal("number"),max:e.number().optional(),min:e.number().optional(),placeholder:e.string().max(160).optional(),step:e.number().positive().optional()}),e.object({...A,defaultValue:e.boolean().optional(),kind:e.literal("switch")}),e.object({...A,defaultValue:M.optional(),kind:e.literal("date-picker"),max:M.optional(),min:M.optional()}),e.object({...A,defaultValue:jt.optional(),kind:e.literal("date-range-picker"),max:M.optional(),min:M.optional()}),e.object({...A,defaultValue:W.optional(),hourCycle:e.union([e.literal(12),e.literal(24)]).optional(),kind:e.literal("time-field"),max:W.optional(),min:W.optional()})]),oe=e.enum(["danger","outline","primary","secondary","tertiary"]),N=e.enum(Tt),Se=e.object({arguments:e.record(e.string().max(80),e.unknown()).refine(t=>JSON.stringify(t).length<=4096,"Tool call arguments must serialize to at most 4KB of JSON"),name:e.string().regex(/^[a-zA-Z][a-zA-Z0-9_-]{0,63}$/)}),y=e.object({id:m,label:r,prompt:e.string().trim().min(1).max(2e3).optional(),toolCall:Se.optional(),variant:oe.optional()}),ve=e.object({latitude:e.number().finite().min(-85.051129).max(85.051129),longitude:e.number().finite().min(-180).max(180)}),te=e.string().trim().min(1).max(2e3).refine(t=>{try{let n=new URL(t);return["http:","https:"].includes(n.protocol)&&!n.username&&!n.password}catch{return!1}},{message:"URL must use HTTP or HTTPS and cannot include credentials"}),Dt=e.string().trim().min(1).max(2e3).refine(t=>{try{let n=new URL(t);return["http:","https:","mailto:","tel:"].includes(n.protocol)&&!n.username&&!n.password}catch{return!1}},{message:"Link must use HTTP, HTTPS, mailto, or tel and cannot include credentials"}),F={id:m,label:r,variant:oe.optional()},Pt=e.string().trim().min(5).max(2e3).refine(t=>/^tel:\+?[0-9().\-\s]+$/.test(t)&&/\d/.test(t.slice(4)),"Phone links must use the tel: scheme and contain a phone number"),Vt=e.discriminatedUnion("kind",[e.object({...F,href:Pt,kind:e.literal("call")}),e.object({...F,href:te,kind:e.literal("directions")}),e.object({...F,href:Dt,kind:e.literal("other")}),e.object({...F,href:te,kind:e.literal("website")})]),Kt=ve.extend({actions:e.array(Vt).max(4).optional(),address:r.optional(),category:e.string().trim().min(1).max(100).optional(),id:m,images:e.array(e.object({alt:r,src:te})).max(4).optional().describe("Prefer one representative image per location when a trusted tool or web image search returns one. The first image becomes the result-card thumbnail; initials are the fallback."),notes:e.string().trim().min(1).max(2e3).optional(),rating:e.number().finite().min(0).max(5).optional(),relevance:e.number().finite().min(0).max(1).optional(),reviewCount:e.number().int().nonnegative().max(1e9).optional(),title:r}),P=e.string().trim().min(1).max(2e3).refine(t=>{if(t.startsWith("/"))return!t.startsWith("//");try{let n=new URL(t);return["http:","https:"].includes(n.protocol)&&!n.username&&!n.password}catch{return!1}},{message:"Image sources must be HTTP(S) URLs or root-relative paths"}),I=e.object({alt:r,src:P.refine(t=>!t.split(/[?#]/,1)[0]?.toLowerCase().endsWith(".svg"),"Response-composition images must be raster images")}),ae=e.string().regex(/^[A-Z]{3}$/),Zt=e.object({amount:e.number().finite().nonnegative().max(1e9),currency:ae}),X=e.enum(St),Ae=e.enum(["celsius","fahrenheit"]),ke=e.object({label:r,status:r.optional(),time:e.string().trim().min(1).max(80)}),j=e.enum(["accent","danger","default","muted","success","warning"]),Ft=e.object({actions:e.array(y).max(3).optional(),badge:e.object({label:r,tone:j.optional()}).optional(),description:r.optional(),id:m,image:e.object({alt:r,src:P}),meta:e.string().trim().min(1).max(160).optional(),name:r,price:e.object({amount:e.number().finite().nonnegative().max(1e9),currency:ae.optional()}),rating:e.object({count:e.number().int().nonnegative().max(1e9).optional(),value:e.number().finite().min(0).max(5)}).optional()}),Ht=e.enum(["accent","danger","default","success","warning"]),qt=e.object({description:r.optional(),format:C.optional(),id:m,label:r,max:e.number().optional(),min:e.number().optional(),tone:Ht.optional(),value:e.number()}).superRefine((t,n)=>{let a=t.min??0,i=t.max??(t.format?.style==="percent"?1:100);i<=a&&n.addIssue({code:"custom",message:"Meter max must be greater than min"}),(t.value<a||t.value>i)&&n.addIssue({code:"custom",message:"Meter value must be within its min/max range"})}),o={accordion:s.extend({kind:e.literal("accordion"),sections:e.array(e.object({content:G,defaultOpen:e.boolean().optional(),id:m,title:r})).min(1).max(12)}),actions:s.extend({actions:e.array(y).min(1).max(8),kind:e.literal("action-group"),orientation:e.enum(["horizontal","vertical"]).optional()}),area:H.extend({kind:e.literal("area-chart"),stacked:e.boolean().optional()}),bar:H.extend({kind:e.literal("bar-chart"),layout:e.enum(["horizontal","vertical"]).optional(),stacked:e.boolean().optional()}),callout:s.extend({content:G,icon:N.optional(),kind:e.literal("callout"),tone:e.enum(["accent","danger","neutral","success","warning"]).optional()}),candlestick:Ot,channelMessage:s.extend({attachments:e.array(e.object({id:m,image:I.optional(),name:r})).max(8).optional(),author:e.object({image:I.optional(),name:r}),channel:r,content:G,kind:e.literal("channel-message"),timestamp:e.string().trim().min(1).max(80)}),code:s.extend({code:e.string().min(1).max(2e4),kind:e.literal("code-block"),language:e.string().trim().max(40).optional()}),comparison:s.extend({items:e.array(e.object({change:e.number().optional(),format:C.optional(),label:r,note:e.string().trim().max(180).optional(),value:e.number()})).min(1).max(12),kind:e.literal("comparison-list")}),composed:H.extend({kind:e.literal("composed-chart"),series:e.array(Et).min(2).max(5)}),createEvent:s.extend({actions:e.array(y).max(2).optional(),date:e.object({day:e.number().int().min(1).max(31),weekday:e.string().trim().min(1).max(20)}),events:e.array(e.object({id:m,status:e.enum(["existing","proposed"]).optional(),time:e.string().trim().min(1).max(80),title:r,tone:j.optional()})).min(1).max(12),kind:e.literal("create-event")}),diagram:s.extend({chart:e.string().trim().min(1).max(4e3).describe('Mermaid source. Pick the diagram type from the relationship: "flowchart LR" for a process or decision path, "sequenceDiagram" for an exchange between parties over time, "erDiagram" for how records relate, "stateDiagram-v2" for the states something moves between. Example: "flowchart LR\\n A[Order placed] --> B{In stock?}\\n B -- yes --> C[Ship]\\n B -- no --> D[Backorder]". Never include HTML, script tags, or click directives.'),kind:e.literal("diagram")}).superRefine((t,n)=>{/<\s*script|javascript:|^\s*click\s+\S/im.test(t.chart)&&n.addIssue({code:"custom",message:"Diagram source cannot contain HTML, script URLs, or click directives",path:["chart"]})}),donut:q.extend({kind:e.literal("donut-chart")}),enableNotification:s.extend({actions:e.tuple([y,y]),kind:e.literal("enable-notification")}),eventSession:s.extend({action:y.optional(),eyebrow:e.string().trim().min(1).max(100).optional(),kind:e.literal("event-session"),location:r,speakers:e.array(e.object({image:I.optional(),name:r,role:r})).max(8),time:e.string().trim().min(1).max(80)}),flightTracker:s.extend({airline:e.object({logo:I.optional(),name:r}),date:e.string().trim().min(1).max(80),destination:ke,flightNumber:e.string().trim().min(1).max(40),kind:e.literal("flight-tracker"),origin:ke,progress:e.number().finite().min(0).max(100).optional()}),followup:s.extend({kind:e.literal("followup"),prompts:e.array(e.object({id:m,label:r,prompt:G})).min(1).max(8)}),form:s.extend({actions:e.array(y).min(1).max(4),fields:e.array(Bt).min(1).max(20),kind:e.literal("form")}),funnel:Lt,gauge:Gt,heatmap:Ut,image:s.extend({images:e.array(e.object({alt:r,aspectRatio:e.enum(["landscape","portrait","square","wide"]).optional(),caption:r.optional(),src:P})).min(1).max(6),kind:e.literal("image"),variant:e.enum(["grid","horizontal"]).optional().describe("Use horizontal for a swipeable gallery in narrow chat interfaces.")}),kpiGrid:s.extend({kind:e.literal("kpi-grid"),metrics:e.array(e.object({change:e.number().optional(),color:w.optional(),format:C.optional(),icon:N.optional(),label:r,trend:e.array(e.number().finite()).min(2).max(60).describe("The values behind this KPI, oldest to newest, drawn as a sparkline. The last point should agree with value."),value:e.number()})).min(1).max(4)}),line:zt,list:s.extend({items:e.array(e.object({checked:e.boolean().optional(),children:e.array(r).max(8).optional(),id:m,text:r})).min(1).max(30),kind:e.literal("list"),style:e.enum(["bulleted","checklist","numbered"]).optional()}),listBlock:s.extend({items:e.array(e.object({description:r.optional(),icon:N.optional(),id:m,imageAlt:r.optional(),imageUrl:P.optional(),meta:e.string().trim().max(100).optional(),rating:e.number().min(0).max(5).optional(),title:r})).min(1).max(20),kind:e.literal("list-block")}),map:s.extend({initialLocationId:m.optional(),kind:e.literal("map"),locations:e.array(Kt).min(1).max(12),viewport:e.object({center:ve,zoom:e.number().int().min(1).max(18)}).optional()}).superRefine((t,n)=>{let a=new Set;for(let[i,l]of t.locations.entries()){a.has(l.id)&&n.addIssue({code:"custom",message:`Duplicate map location id "${l.id}"`,path:["locations",i,"id"]}),a.add(l.id);let d=new Set;for(let[f,h]of(l.actions??[]).entries())d.has(h.id)&&n.addIssue({code:"custom",message:`Duplicate action id "${h.id}" for map location "${l.id}"`,path:["locations",i,"actions",f,"id"]}),d.add(h.id)}t.initialLocationId&&!a.has(t.initialLocationId)&&n.addIssue({code:"custom",message:"The initial map location must reference one of the locations",path:["initialLocationId"]})}).describe("A ranked, map-synchronized set of places or professionals. Coordinates and listing facts must come from tools or user data; never invent them."),meterList:s.extend({items:e.array(qt).min(1).max(8),kind:e.literal("meter-list")}),metricGrid:s.extend({kind:e.literal("metric-grid"),metrics:e.array(e.object({change:e.number().optional(),format:C.optional(),icon:N.optional(),label:r,value:e.number()})).min(1).max(4)}),pie:q.extend({kind:e.literal("pie-chart")}),playerCard:s.extend({backgroundImage:I.optional(),jerseyNumber:e.string().trim().min(1).max(20).optional(),kind:e.literal("player-card"),playerName:r,stats:e.array(e.object({label:e.string().trim().min(1).max(40),value:e.union([e.string().trim().min(1).max(80),e.number().finite()])})).min(1).max(8)}),playlist:s.extend({actions:e.array(y).max(2).optional(),cover:I.optional(),kind:e.literal("playlist"),tracks:e.array(e.object({action:y.optional(),artist:r,id:m,image:I.optional(),title:r})).min(1).max(20)}),productCard:s.extend({actions:e.array(y).max(3).optional(),kind:e.literal("product-card"),products:e.array(Ft).min(1).max(8),variant:ee.optional()}).superRefine((t,n)=>{let a=new Set;for(let[i,l]of t.products.entries())a.has(l.id)&&n.addIssue({code:"custom",message:`Duplicate product id "${l.id}"`,path:["products",i,"id"]}),a.add(l.id)}).describe("A commerce product presentation: one product renders an image-led spotlight, several render a store-style grid. Product facts (id, name, image, price, rating, availability) must come from tools or user data; never invent them."),purchaseComplete:s.extend({action:y.optional(),details:e.array(e.object({label:r,value:r})).max(8),kind:e.literal("purchase-complete"),paid:Zt.optional(),product:e.object({description:r.optional(),image:I.optional(),name:r})}),purchaseItems:s.extend({actions:e.array(y).max(3).optional(),currency:ae,items:e.array(e.object({description:r.optional(),id:m,image:I.optional(),name:r,price:e.number().finite().nonnegative().max(1e9).optional(),quantity:e.number().int().positive().max(1e4).optional()})).min(1).max(20),kind:e.literal("purchase-items"),totals:e.array(e.object({amount:e.number().finite().nonnegative().max(1e9),emphasis:e.boolean().optional(),label:r})).min(1).max(8)}),radar:s.extend({angleKey:c,data:e.array(O).min(3).max(50),kind:e.literal("radar-chart"),series:e.array(ne).min(1).max(5)}),radial:q.extend({endAngle:e.number().min(-360).max(360).optional(),kind:e.literal("radial-chart"),maxValue:e.number().positive().optional(),startAngle:e.number().min(-360).max(360).optional()}),recordCard:s.extend({actions:e.array(y).max(4).optional(),eyebrow:e.string().trim().max(100).optional(),fields:e.array(e.object({icon:N.optional(),label:r,tone:j.optional(),value:e.string().trim().min(1).max(500)})).max(12),image:e.object({alt:r,src:P}).optional(),kind:e.literal("record-card"),layout:_t.optional(),status:e.object({label:r,tone:j.optional()}).optional(),variant:ee.optional()}).superRefine((t,n)=>{t.layout==="media"&&!t.image&&n.addIssue({code:"custom",message:"The media record layout requires an image",path:["image"]}),t.layout==="compact"&&t.fields.length>4&&n.addIssue({code:"custom",message:"The compact record layout supports at most four fields",path:["fields"]})}),rideStatus:s.extend({driver:e.object({image:I.optional(),name:r}),eta:e.string().trim().min(1).max(80),kind:e.literal("ride-status"),pickup:r}),sankey:s.extend({format:C.optional(),kind:e.literal("sankey-chart"),links:e.array(e.object({source:m,target:m,value:e.number().positive()})).min(1).max(100),nodes:e.array(e.object({id:m,label:r})).min(2).max(40)}),scatter:Rt,steps:s.extend({kind:e.literal("steps"),steps:e.array(e.object({content:r.optional(),icon:N.optional(),id:m,image:I.optional().describe("A representative raster image for this step. Prefer this over icon for place itineraries when a trusted image URL is available."),meta:e.string().trim().max(100).optional(),progress:e.number().min(0).max(100).optional(),status:e.enum(["blocked","cancelled","completed","failed","in-progress","pending","complete","current","upcoming"]).optional(),timestamp:e.string().trim().max(100).optional(),title:r})).min(1).max(12),variant:e.enum(["steps","timeline"]).optional()}),sunburst:Mt,switches:s.extend({items:e.array(e.object({defaultSelected:e.boolean().optional(),description:r.optional(),id:m,label:r})).min(1).max(20),kind:e.literal("switch-group")}),table:s.extend({columns:e.array(e.object({format:C.optional(),key:c,label:r})).min(1).max(12),filterable:e.boolean().optional(),kind:e.literal("data-table"),rows:e.array(O).max(200),variant:e.enum(["primary","secondary"]).optional()}),tabs:s.extend({defaultValue:m.optional(),kind:e.literal("tabs"),tabs:e.array(e.union([e.object({children:e.never().optional(),content:G,id:m,label:r}),e.object({children:e.array(e.lazy(()=>le)).min(1).max(12),content:e.never().optional(),id:m,label:r})])).min(1).max(10),variant:e.enum(["primary","secondary"]).optional()}),tags:s.extend({kind:e.literal("tag-list"),tags:e.array(r).min(1).max(30)}),text:s.extend({content:G,kind:e.literal("text"),variant:e.enum(["card","clear"]).optional()}),toggles:s.extend({defaultValue:e.array(m).max(12).optional(),items:e.array(e.object({id:m,label:r})).min(1).max(12),kind:e.literal("toggle-group"),selectionMode:e.enum(["multiple","single"]).optional()}),viewEvent:s.extend({date:e.string().trim().min(1).max(80),kind:e.literal("view-event"),time:e.string().trim().min(1).max(80),tone:j.optional()}),weatherCurrent:s.extend({condition:X,details:e.array(e.object({label:r,value:r})).max(6).optional(),kind:e.literal("weather-current"),location:r,temperature:e.number().finite().min(-150).max(150),unit:Ae}),weatherForecast:s.extend({condition:X,forecast:e.array(e.object({condition:X,label:e.string().trim().min(1).max(40),temperature:e.number().finite().min(-150).max(150)})).min(2).max(10),high:e.number().finite().min(-150).max(150),kind:e.literal("weather-forecast"),location:r,low:e.number().finite().min(-150).max(150),unit:Ae})},$t=o.metricGrid,Yt=o.kpiGrid,Wt=o.line,Xt=o.area,Jt=o.bar,Qt=o.composed,en=o.pie,tn=o.donut,nn=o.radar,on=o.radial,an=o.sankey,rn=o.scatter,sn=o.heatmap,ln=o.candlestick,pn=o.funnel,mn=o.gauge,cn=o.sunburst,dn=o.table,un=o.comparison,gn=o.meterList,hn=o.form,fn=o.text,yn=o.callout,Cn=o.image,bn=o.map,xn=o.tags,An=o.list,kn=o.listBlock,In=o.accordion,Tn=o.steps,Sn=o.code,vn=o.diagram,jo=o.tabs.superRefine(st),wn=o.actions,_n=o.followup,En=o.switches,Nn=o.toggles,Rn=o.recordCard,Un=o.productCard,zn=o.flightTracker,On=o.createEvent,Ln=o.playlist,Gn=o.rideStatus,Mn=o.purchaseItems,jn=o.channelMessage,Bn=o.purchaseComplete,Dn=o.playerCard,Pn=o.viewEvent,Vn=o.eventSession,Kn=o.enableNotification,Zn=o.weatherForecast,Fn=o.weatherCurrent,Hn=e.discriminatedUnion("kind",[o.metricGrid,o.kpiGrid,o.line,o.area,o.bar,o.composed,o.pie,o.donut,o.radar,o.radial,o.sankey,o.scatter,o.heatmap,o.candlestick,o.funnel,o.gauge,o.sunburst,o.table,o.comparison,o.meterList]),we=s.extend({defaultValue:m.optional(),kind:e.literal("product-signals"),tabs:e.array(e.object({component:Hn,id:m,label:r})).min(2).max(4)}),qn=we.superRefine((t,n)=>{let a=new Set;for(let[i,l]of t.tabs.entries())a.has(l.id)&&n.addIssue({code:"custom",message:`Duplicate product signal tab id "${l.id}"`,path:["tabs",i,"id"]}),a.add(l.id);t.defaultValue&&!a.has(t.defaultValue)&&n.addIssue({code:"custom",message:"The default product signal must reference one of the tabs",path:["defaultValue"]})}),$n=e.discriminatedUnion("kind",[o.metricGrid,o.kpiGrid,o.line,o.area,o.bar,o.composed,o.pie,o.donut,o.radar,o.radial,o.sankey,o.scatter,o.heatmap,o.candlestick,o.funnel,o.gauge,o.sunburst,o.table,o.comparison,o.meterList,o.form,o.text,o.callout,o.image,o.map,o.tags,o.list,o.listBlock,o.accordion,o.steps,o.code,o.diagram,o.tabs,o.actions,o.followup,o.switches,o.toggles,o.recordCard,o.productCard,o.flightTracker,o.createEvent,o.playlist,o.rideStatus,o.purchaseItems,o.channelMessage,o.purchaseComplete,o.playerCard,o.viewEvent,o.eventSession,o.enableNotification,o.weatherForecast,o.weatherCurrent]);function Yn(t){if(!t)return;let n=new Set;for(let a of t){if(n.has(a.id))return a.id;n.add(a.id)}}var re=e.union([$n,qn]).superRefine((t,n)=>{let a=[];switch(t.kind){case"channel-message":a.push({items:t.attachments,path:"attachments"});break;case"create-event":a.push({items:t.events,path:"events"}),a.push({items:t.actions,path:"actions"});break;case"enable-notification":a.push({items:t.actions,path:"actions"});break;case"playlist":a.push({items:t.tracks,path:"tracks"}),a.push({items:t.actions,path:"actions"});break;case"purchase-items":a.push({items:t.items,path:"items"}),a.push({items:t.actions,path:"actions"});break;case"tabs":{st(t,n);break}default:break}for(let i of a){let l=Yn(i.items);l&&n.addIssue({code:"custom",message:`Duplicate ${i.path} id "${l}"`,path:[i.path]})}}),_e=s.extend({children:e.array(re).min(1).max(4),kind:e.literal("dashboard"),layout:e.enum(["chart-table","grid","metrics-chart","stack"])}),Wn=_e,Ee=e.union([re,Wn]),Bo=e.object({component:Ee}),J=6,B=48,Ne=new Set(["card","col","grid","item-card","item-card-group","row"]),Re=new Set(["divider","spacer"]),Ue=new Set(["badge","button","heading","icon","progress","rating"]),ze=Ne,Oe=Re,Le=Ue;function Ge(t){return Ne.has(t.kind)}function Me(t){return t.kind==="item-card"?[...t.left??[],...t.middle,...t.right??[]]:t.children}function Do(t){return Re.has(t.kind)}function Po(t){return Ue.has(t.kind)}var T=e.object({id:m}),ie=e.enum(["lg","md","none","sm"]),je=e.enum(["center","end","start","stretch"]),Be=e.enum(["between","center","end","start"]),$=e.array(e.lazy(()=>le)).min(1).max(B),De=T.extend({kind:e.literal("spacer"),size:e.enum(["auto","lg","md","sm"]).optional()}),Pe=T.extend({kind:e.literal("divider")}),Ve=T.extend({icon:N.optional(),kind:e.literal("heading"),level:e.union([e.literal(1),e.literal(2),e.literal(3),e.literal(4)]).optional(),text:r}),Ke=T.extend({icon:N.optional(),kind:e.literal("button"),label:r,prompt:e.string().trim().min(1).max(2e3).optional(),toolCall:Se.optional(),variant:oe.optional()}).refine(t=>!!(t.prompt??t.toolCall),{message:"Buttons need a prompt or a toolCall to do something when pressed"}),Ze=T.extend({kind:e.literal("badge"),label:r,tone:j.optional(),variant:e.enum(["soft","solid"]).optional()}),Fe=T.extend({kind:e.literal("icon"),name:N,size:e.enum(["lg","md","sm"]).optional(),tone:j.optional()}),He=T.extend({count:e.number().int().nonnegative().max(1e9).optional(),kind:e.literal("rating"),value:e.number().finite().min(0).max(5)}),qe=T.extend({kind:e.literal("progress"),label:r.optional(),value:e.number().finite().min(0).max(100)}),$e=e.enum(["default","outline","secondary","tertiary","transparent"]),Q=e.lazy(()=>le),Ye=s.extend({action:y.optional().describe("Makes the whole row pressable. Omit when a slot contains its own button or other interactive control."),isDisabled:e.boolean().optional(),isSelected:e.boolean().optional(),kind:e.literal("item-card"),left:e.array(Q).min(1).max(4).optional().describe("Leading slot. Prefer one icon node or a compact visual."),middle:e.array(Q).min(1).max(8).describe("Primary flexible slot. Prefer a level-4 heading followed by a clear text node for a title and description."),right:e.array(Q).min(1).max(4).optional().describe("Trailing slot. Prefer a badge, short value, icon, or button."),variant:$e.optional()}),Xn=new Set(["accordion","action-group","button","followup","form","map","switch-group","tabs","toggle-group"]);function We(t){for(let n of t)if(Xn.has(n.kind)||Ge(n)&&We(Me(n)))return!0;return!1}var se=Ye.superRefine((t,n)=>{t.action&&We([...t.left??[],...t.middle,...t.right??[]])&&n.addIssue({code:"custom",message:"A pressable item-card cannot contain buttons or other interactive descendants. Remove action from the card or move the nested control outside it."})}),Xe=s.extend({children:e.array(se).min(1).max(12),columns:e.union([e.literal(2),e.literal(3)]).optional(),kind:e.literal("item-card-group"),layout:e.enum(["grid","list"]).optional(),showHeader:e.boolean().optional(),variant:$e.optional()}),Je=Xe.superRefine((t,n)=>{t.columns&&t.layout!=="grid"&&n.addIssue({code:"custom",message:"Item-card group columns only apply when layout is grid.",path:["columns"]})}),Qe=T.extend({align:je.optional(),children:$,gap:ie.optional(),justify:Be.optional(),kind:e.literal("row")}),et=T.extend({align:je.optional(),children:$,gap:ie.optional(),justify:Be.optional(),kind:e.literal("col")}),tt=T.extend({children:$,columns:e.union([e.literal(1),e.literal(2),e.literal(3),e.literal(4)]),gap:ie.optional(),kind:e.literal("grid")}),nt=s.extend({children:$,kind:e.literal("card"),variant:ee.optional()}),ot=Qe,at=et,rt=tt,it=nt,le=e.union([re,De,Pe,Ve,Ke,Ze,Fe,He,qe,ot,at,rt,it,se,Je]);function Jn(t,n){to(t,n)}function Qn(t,n){let a=t.tabs.flatMap(i=>i.children??[]);a.length!==0&&lt(a,n,t.id,2,1)}function st(t,n){let a=new Set;for(let[i,l]of t.tabs.entries())a.has(l.id)&&n.addIssue({code:"custom",message:`Duplicate tab id "${l.id}"`,path:["tabs",i,"id"]}),a.add(l.id);t.defaultValue&&!a.has(t.defaultValue)&&n.addIssue({code:"custom",message:"The default tab must reference one of the tabs",path:["defaultValue"]}),Qn(t,n)}function eo(t){return Ge(t)?Me(t):t.kind==="tabs"?t.tabs.flatMap(n=>n.children??[]):[]}function lt(t,n,a,i=1,l=0){let d=new Set,f=l,h=l>0?i-1:0;a&&d.add(a);let R=(b,S)=>{if(f+=1,h=Math.max(h,S),d.has(b.id)&&n.addIssue({code:"custom",message:`Duplicate component id "${b.id}" in the composed UI tree. Every node needs a unique id.`}),d.add(b.id),!(S>J))for(let K of eo(b))R(K,S+1)};for(let b of t)R(b,i);h>J&&n.addIssue({code:"custom",message:`Composed UI trees can nest at most ${J} levels deep.`}),f>B&&n.addIssue({code:"custom",message:`Composed UI trees can contain at most ${B} components.`})}function to(t,n){lt([t],n)}var pt=e.union([ot,at,rt,it,se,Je]).superRefine(Jn),Vo=e.union([Ee,pt]),Ko=e.object({component:pt}),E=t=>e.array(e.unknown()).min(1).max(t).describe("Child nodes. Each is any catalog component; look its kind up separately."),Zo={accordion:In,"action-group":wn,"area-chart":Xt,badge:Ze,"bar-chart":Jt,button:Ke,callout:yn,"candlestick-chart":ln,card:nt.extend({children:E(B)}),"channel-message":jn,"code-block":Sn,col:et.extend({children:E(B)}),"comparison-list":un,"composed-chart":Qt,"create-event":On,dashboard:_e.extend({children:E(4)}),"data-table":dn,diagram:vn,divider:Pe,"donut-chart":tn,"enable-notification":Kn,"event-session":Vn,"flight-tracker":zn,followup:_n,form:hn,"funnel-chart":pn,"gauge-chart":mn,grid:tt.extend({children:E(B)}),heading:Ve,heatmap:sn,icon:Fe,image:Cn,"item-card":Ye.extend({left:E(4).optional().describe("Leading slot nodes."),middle:E(8).describe("Primary flexible slot nodes."),right:E(4).optional().describe("Trailing slot nodes.")}),"item-card-group":Xe.extend({children:e.array(e.unknown()).min(1).max(12).describe("One to twelve item-card children. Look up item-card for each child's schema.")}),"kpi-grid":Yt,"line-chart":Wt,list:An,"list-block":kn,map:bn,"meter-list":gn,"metric-grid":$t,"pie-chart":en,"player-card":Dn,playlist:Ln,"product-card":Un,"product-signals":we.extend({tabs:e.array(e.object({component:e.unknown().describe("One analytical component: metric-grid, kpi-grid, any chart, data-table, comparison-list, or meter-list. Look its kind up separately."),id:m,label:r})).min(2).max(4)}),progress:qe,"purchase-complete":Bn,"purchase-items":Mn,"radar-chart":nn,"radial-chart":on,rating:He,"record-card":Rn,"ride-status":Gn,row:Qe.extend({children:E(B)}),"sankey-chart":an,"scatter-chart":rn,spacer:De,steps:Tn,"sunburst-chart":cn,"switch-group":En,tabs:s.extend({defaultValue:m.optional(),kind:e.literal("tabs"),tabs:e.array(e.union([e.object({content:G,id:m,label:r}),e.object({children:E(12).describe("Rich panel nodes rendered as one vertical stack. Look up every child kind separately."),id:m,label:r})])).min(1).max(10),variant:e.enum(["primary","secondary"]).optional()}),"tag-list":xn,text:fn,"toggle-group":Nn,"view-event":Pn,"weather-current":Fn,"weather-forecast":Zn};var ct={accordion:"collapsible sections of longer prose","action-group":"buttons that send prompts or call client tools","area-chart":"one continuous time series with a filled trend",badge:"a small toned status label","bar-chart":"ranked or categorical comparison, horizontal layout for rankings",button:"one action with a prompt or client-tool call",callout:"one short toned notice: info, success, warning, or danger","candlestick-chart":"open-high-low-close price movement over ordered periods",card:"titled surface grouping related children","channel-message":"a quoted workspace message with author and attachments","code-block":"a syntax-highlighted snippet",col:"stacks children vertically","comparison-list":"labeled values with change deltas, no axes","composed-chart":"two to five mixed area/bar/line series, optional dual axis","create-event":"a proposed calendar slot beside surrounding events",dashboard:"up to four analytical children in a fixed layout","data-table":"exact values in filterable rows and columns",diagram:"a flowchart, sequence, ER, or state diagram from Mermaid source, for processes and relationships prose cannot show",divider:"a rule between sections","donut-chart":"proportions of a whole with a hollow center","enable-notification":"a binary notification opt-in with two actions","event-session":"a conference session with time, location, and speakers","flight-tracker":"a flight's route, times, and live progress",followup:"suggested next prompts the user can send",form:"input fields with submit actions","funnel-chart":"drop-off through ordered conversion or pipeline stages","gauge-chart":"one bounded value against its minimum and maximum",grid:"one to four equal columns of peers",heading:"a section title, levels one to four",heatmap:"two-dimensional intensity across x and y",icon:"one semantic glyph from the icon vocabulary",image:"one to six real image URLs with captions in a grid or horizontal chat gallery","item-card":"one compact three-slot row with composable left, middle, and right content","item-card-group":"one to twelve related item-card rows in a list or grid","kpi-grid":"up to four headline KPIs, each with a sparkline of its own history","line-chart":"overlapping series, a live signal, or one series split around a baseline",list:"bulleted, numbered, or checklist items with optional children","list-block":"richer rows with title, description, meta, rating, icon, or image",map:"ranked places pinned by exact latitude and longitude","meter-list":"bounded quantities such as quota, utilization, or budget","metric-grid":"up to four headline KPIs with no history to plot","pie-chart":"proportions of a whole","player-card":"an athlete with jersey, portrait, and stat lines",playlist:"a track collection with cover and per-track actions","product-card":"purchasable items with image, price, rating, availability","product-signals":"two to four related analytical views in tabs",progress:"a zero to one hundred percentage bar","purchase-complete":"confirmation after a successful transaction","purchase-items":"a cart or order summary with line items and totals","radar-chart":"multivariate comparison across three or more axes","radial-chart":"compact circular measure",rating:"a zero to five star score with optional count","record-card":"one entity's labeled facts, layouts details/compact/media","ride-status":"pickup ETA and driver for a ride in progress",row:"places complementary children side by side","sankey-chart":"flow volumes between source and target nodes","scatter-chart":"correlation between two numeric fields, optional grouping",spacer:"a gap between siblings",steps:"task progress or a chronological timeline, up to twelve entries","sunburst-chart":"hierarchical part-to-whole values across nested levels","switch-group":"toggleable boolean preferences",tabs:"parallel text or rich multi-component sections behind labeled tabs","tag-list":"short keyword chips",text:"explanatory markdown prose","toggle-group":"single or multiple choice from short options","view-event":"one calendar event's date, time, and tone","weather-current":"current conditions in one location","weather-forecast":"multi-day or future conditions with highs and lows"},no={actions:"actions","data-visualization":"data","display-information":"display","form-elements":"forms"};function oo(t){return t==="dashboard"||ze.has(t)?"containers":Oe.has(t)?"layout":Le.has(t)?"primitives":no[be[t]]??"display"}var mt=Object.fromEntries(Object.entries(ct).map(([t,n])=>[t,{group:oo(t),summary:n}])),pe=Object.keys(ct).sort(),ao=[["containers","Containers"],["layout","Layout"],["primitives","Primitives"],["data","Data"],["display","Content"],["actions","Actions"],["forms","Forms"]];function $o(){return ao.map(([n,a])=>{let i=pe.filter(l=>mt[l].group===n).map(l=>`${l} \u2014 ${mt[l].summary}`);return`${a}: ${i.join("; ")}.`}).join(`
2
+ `)}import{z as L}from"zod";var ro=["callMcpTool","composeUI","executeSandbox","getComponentSchema","renderComponent","searchKnowledge","searchMcpTools","searchWeb"],io="mcp_",so=20,lo=16*1024,po=L.object({description:L.string().trim().min(1).max(1e3),inputSchema:L.record(L.string(),L.unknown()),name:L.string().regex(/^[a-zA-Z][a-zA-Z0-9_-]{0,63}$/).refine(t=>!ro.includes(t)&&!t.toLowerCase().startsWith(io),"Client tool name is reserved by the HeroUI Agent runtime"),needsApproval:L.boolean().optional()}),Xo=L.array(po).max(so).superRefine((t,n)=>{let a=new Set;for(let i of t)a.has(i.name)&&n.addIssue({code:"custom",message:`Duplicate client tool name: ${i.name}`}),a.add(i.name);new TextEncoder().encode(JSON.stringify(t)).byteLength>lo&&n.addIssue({code:"custom",message:"Client tool manifest exceeds 16KB"})});import{z as p}from"zod";var V=6,dt="0.2.0-beta.13",Qo="https://api.heroui.pro";var mo=p.enum(["light","dark","system"]),co=p.enum(["outline","plain","surface","surface-secondary"]),uo=new Set(["[object object]","0","anonymous","distinct_id","distinctid","email","false","guest","id","nan","none","not_authenticated","null","true","undefined"]),me=p.string().trim().min(1).max(200).refine(t=>!uo.has(t.toLowerCase()),{message:"Identity id is reserved"}),go=p.discriminatedUnion("type",[p.object({id:me,type:p.literal("anonymous")}),p.object({id:me,type:p.literal("user")})]),ho=p.object({avatarUrl:p.string().trim().pipe(p.url()).optional(),email:p.string().trim().max(320).pipe(p.email()).optional(),name:p.string().trim().max(120).optional()}),oa=p.object({anonymousId:me.optional(),identity:go,profile:ho.optional()}),aa=p.object({expiresAt:p.number().int().positive(),token:p.string().trim().min(1)}),ra=p.object({agentId:p.string().trim().min(1).max(100),apiKeyId:p.string().trim().min(1).max(100),aud:p.literal("heroui-agent"),exp:p.number().int().positive(),iat:p.number().int().positive(),iss:p.literal("https://api.heroui.com"),jti:p.uuid(),protocolVersion:p.literal(6),sub:p.string().trim().min(1).max(200)}),ia={embed:"embed",preview:"preview"},sa=p.object({agentId:p.string(),minimumProtocolVersion:p.literal(6),name:p.string().trim().min(1).max(120),protocolVersion:p.literal(6),sdkVersion:p.string().default(dt),suggestedPrompts:p.array(p.string().trim().min(1).max(160)).max(5),surfaceVariant:co.default("plain"),theme:mo});import{z as k}from"zod";var ut=k.object({excerpt:k.string().trim().min(1).max(2e3).optional(),locator:k.string().trim().min(1).max(160).optional(),sourceId:k.string().trim().min(1).max(120)}),fo=k.string().trim().max(2048).refine(t=>{try{return["http:","https:"].includes(new URL(t).protocol)}catch{return!1}}),yo=k.union([ut.extend({sourceType:k.literal("document"),title:k.string().trim().min(1).max(200)}),ut.extend({sourceType:k.literal("url").optional(),title:k.string().trim().min(1).max(200).optional(),url:fo})]),ma=k.object({items:k.array(yo).min(1).max(16)});var ce=["moonshotai/Kimi-K3","openai/gpt-5.6-luna","openai/gpt-5.6-terra","openai/gpt-5.6-sol","google/gemini-3.7-flash","anthropic/claude-sonnet-5","anthropic/claude-opus-4.8"],Co={"google/gemini-3.5-flash":"google/gemini-3.7-flash","google/gemini-3.6-flash":"google/gemini-3.7-flash"};function de(t){return Co[t]??t}var da="google/gemini-3.7-flash",bo=[{description:"Flagship model for coding, reasoning, and knowledge work",id:"moonshotai/Kimi-K3",label:"Kimi K3",provider:"Moonshot AI",tier:"light"},{description:"Fast answers and lightweight agent workflows",id:"openai/gpt-5.6-luna",label:"GPT-5.6 Luna",provider:"OpenAI",tier:"light"},{description:"Balanced reasoning for everyday agent tasks",id:"openai/gpt-5.6-terra",label:"GPT-5.6 Terra",provider:"OpenAI",tier:"codegen"},{description:"Deep reasoning for complex, multi-step analysis",id:"openai/gpt-5.6-sol",label:"GPT-5.6 Sol",provider:"OpenAI",tier:"complex"},{description:"Fast multimodal analysis with a large context window",id:"google/gemini-3.7-flash",label:"Gemini 3.7 Flash",provider:"Google",tier:"light"},{description:"Strong agentic reasoning and polished UI decisions",id:"anthropic/claude-sonnet-5",label:"Claude Sonnet 5",provider:"Anthropic",tier:"codegen"},{description:"Highest-capability Claude for difficult research and analysis",id:"anthropic/claude-opus-4.8",label:"Claude Opus 4.8",provider:"Anthropic",tier:"complex"}],xo=new Set(ce);function ua(t){return typeof t=="string"&&xo.has(t)}function ga(t){let n=t?de(t):void 0;return bo.find(a=>a.id===n)?.tier??"light"}import{z as gt}from"zod";var Ca=gt.preprocess(t=>typeof t=="string"?de(t):t,gt.enum(ce));var xa="heroui-agent:runtime-timing",Aa="heroui_agent_turn_admitted",ka="getTurnAdmissionStatuses",Ia=50;import{z as g}from"zod";var Ao=["action_approved","action_declined","component_copy","component_export","component_followup","component_rendered","component_submit","component_tool","embed_loaded","failure","feedback_down","feedback_up","first_chunk","first_feedback_paint","first_server_content_paint","first_text_paint","message_copied","message_sent","opened","reconnected","retry","stopped","turn_completed","turn_stalled"],ko=["client-inactivity-watchdog","cloudflare-chat","message-send-failed","stream-error"],Io=["did_not_follow_instructions","incomplete","incorrect","not_relevant","other","unclear"],To=["client_stopped","conversation_deleted","provider_error","provider_rate_limited","provider_timeout","turn_deadline_exceeded","turn_stalled","unknown"],So=g.object({actionId:g.string().trim().min(1).max(256).optional(),componentId:g.string().trim().min(1).max(256).optional(),componentType:g.enum(pe).optional(),feedbackComment:g.string().trim().max(1e3).optional(),feedbackCommentLength:g.number().int().min(0).max(1e3).optional(),feedbackReasons:g.array(g.enum(Io)).max(6).optional(),format:g.enum(["csv","json","png","svg","text"]).optional(),hasFeedbackComment:g.boolean().optional(),hasToolName:g.boolean().optional(),latencyMs:g.number().finite().min(0).max(1800*1e3).optional(),latencyOrigin:g.literal("user_submit").optional(),messageId:g.string().trim().min(1).max(256).optional(),protocolVersion:g.literal(6).optional(),sdkVersion:g.string().trim().min(1).max(80).optional(),source:g.enum(ko).optional(),toolName:g.string().trim().min(1).max(160).optional()}).strict(),wa=g.object({conversationId:g.string().uuid(),event:g.enum(Ao),properties:So.default({})}).strict(),_a=g.enum(To);export{ia as AGENT_CONVERSATION_SOURCE,ce as AGENT_MODEL_IDS,bo as AGENT_MODEL_OPTIONS,mt as AGENT_UI_CATALOG,ze as AGENT_UI_CONTAINER_KINDS,pe as AGENT_UI_KIND_NAMES,Zo as AGENT_UI_KIND_SCHEMAS,Oe as AGENT_UI_LAYOUT_LEAF_KINDS,Le as AGENT_UI_PRIMITIVE_KINDS,J as COMPOSED_UI_MAX_DEPTH,B as COMPOSED_UI_MAX_NODES,da as DEFAULT_AGENT_PICKER_MODEL_ID,Qo as HEROUI_AGENT_API_BASE_URL,_o as HEROUI_AGENT_ATTACHMENT_ACCEPT,he as HEROUI_AGENT_ATTACHMENT_CONTENT_TYPES,ht as HEROUI_AGENT_ATTACHMENT_EXTENSION_BY_CONTENT_TYPE,wo as HEROUI_AGENT_ATTACHMENT_MAX_BYTES,Ao as HEROUI_AGENT_EMBED_EVENT_NAMES,ko as HEROUI_AGENT_EMBED_EVENT_SOURCES,Io as HEROUI_AGENT_FEEDBACK_REASONS,vo as HEROUI_AGENT_MAX_ATTACHMENTS,V as HEROUI_AGENT_PROTOCOL_VERSION,ye as HEROUI_AGENT_REMOTE_CONFIG_VERSION,xa as HEROUI_AGENT_RUNTIME_TIMING_EVENT,dt as HEROUI_AGENT_SDK_VERSION,Eo as HEROUI_AGENT_TEXT_ATTACHMENT_CONTENT_TYPES,Ia as HEROUI_AGENT_TURN_ADMISSION_STATUS_MAX_IDS,ka as HEROUI_AGENT_TURN_ADMISSION_STATUS_METHOD,Aa as HEROUI_AGENT_TURN_ADMITTED_FRAME_TYPE,To as HEROUI_AGENT_TURN_ERROR_CODES,Co as LEGACY_AGENT_MODEL_IDS,so as MAX_CLIENT_TOOLS,lo as MAX_CLIENT_TOOLS_BYTES,ro as RESERVED_AGENT_TOOL_NAMES,io as RESERVED_AGENT_TOOL_PREFIX,In as accordionComponentSchema,wn as actionGroupComponentSchema,go as agentAuthIdentitySchema,ho as agentAuthProfileSchema,aa as agentAuthTokenSchema,Tt as agentIconNames,N as agentIconSchema,me as agentIdentityIdSchema,Ca as agentModelIdSchema,sa as agentProjectConfigSchema,yo as agentSourceSchema,ma as agentSourcesSchema,co as agentSurfaceVariantSchema,mo as agentThemeSchema,ra as agentTokenClaimsSchema,Ee as agentUIComponentSchema,re as agentUILeafComponentSchema,le as agentUINodeSchema,Vo as agentUIRenderableSchema,Hn as analyticalLeafComponentSchema,Xt as areaChartComponentSchema,Ze as badgeComponentSchema,Jt as barChartComponentSchema,Ke as buttonComponentSchema,yn as calloutComponentSchema,ln as candlestickChartComponentSchema,it as cardComponentSchema,ee as cardComponentVariantSchema,jn as channelMessageComponentSchema,w as chartColorSchema,po as clientToolManifestEntrySchema,Xo as clientToolsSchema,Sn as codeBlockComponentSchema,at as colComponentSchema,un as comparisonListComponentSchema,Ko as composeUIInputSchema,Qt as composedChartComponentSchema,pt as composedUIComponentSchema,oa as createAgentAuthTokenRequestSchema,On as createEventComponentSchema,Wn as dashboardComponentSchema,dn as dataTableComponentSchema,vn as diagramComponentSchema,Pe as dividerComponentSchema,tn as donutChartComponentSchema,Kn as enableNotificationComponentSchema,Vn as eventSessionComponentSchema,zn as flightTrackerComponentSchema,_n as followupComponentSchema,hn as formComponentSchema,pn as funnelChartComponentSchema,mn as gaugeChartComponentSchema,ga as getAgentModelTier,Me as getAgentUIContainerChildren,rt as gridComponentSchema,Ve as headingComponentSchema,sn as heatmapComponentSchema,So as heroUIAgentEmbedEventPropertiesSchema,wa as heroUIAgentEmbedEventSchema,_a as heroUIAgentTurnErrorCodeSchema,Fe as iconComponentSchema,Cn as imageComponentSchema,ua as isAgentModelId,Ge as isAgentUIContainerComponent,Do as isAgentUILayoutLeafComponent,Po as isAgentUIPrimitiveComponent,fe as isHeroUIAgentAttachmentContentType,se as itemCardComponentSchema,Je as itemCardGroupComponentSchema,Yt as kpiGridComponentSchema,Wt as lineChartComponentSchema,kn as listBlockComponentSchema,An as listComponentSchema,bn as mapComponentSchema,gn as meterListComponentSchema,$t as metricGridComponentSchema,C as numberFormatSchema,Uo as parseAgentRemoteConfig,en as pieChartComponentSchema,Dn as playerCardComponentSchema,Ln as playlistComponentSchema,Un as productCardComponentSchema,qn as productSignalsComponentSchema,qe as progressComponentSchema,Bn as purchaseCompleteComponentSchema,Mn as purchaseItemsComponentSchema,nn as radarChartComponentSchema,on as radialChartComponentSchema,He as ratingComponentSchema,Rn as recordCardComponentSchema,_t as recordCardLayoutSchema,$o as renderAgentUICatalogPrompt,Bo as renderComponentInputSchema,de as resolveAgentModelId,Gn as rideStatusComponentSchema,ot as rowComponentSchema,an as sankeyChartComponentSchema,rn as scatterChartComponentSchema,De as spacerComponentSchema,Tn as stepsComponentSchema,cn as sunburstChartComponentSchema,En as switchGroupComponentSchema,jo as tabsComponentSchema,xn as tagListComponentSchema,fn as textComponentSchema,Nn as toggleGroupComponentSchema,Pn as viewEventComponentSchema,X as weatherConditionSchema,St as weatherConditions,Fn as weatherCurrentComponentSchema,Zn as weatherForecastComponentSchema};