sunpeak 0.20.28 → 0.20.30

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.
@@ -0,0 +1 @@
1
+ {"version":3,"file":"inspector-B1355aXh.js","names":["r","$Q","Q.union","Q.literal","Q.record","Q.string","Q.undefined","Q.object","Q.boolean","Q.array","Q.number","Q.unknown","Q.never","PQ","UQ","c","LQ","AQ","wQ","l","SQ","eQ","QX","iQ","nQ","rQ","sQ","YX","cQ","XQ","aQ","JX","oQ","tQ","ZX","$X","lQ","XX"],"sources":["../src/lib/default-style-variables.ts","../../../node_modules/.pnpm/clsx@2.1.1/node_modules/clsx/dist/clsx.mjs","../../../node_modules/.pnpm/tailwind-merge@3.6.0/node_modules/tailwind-merge/dist/bundle-mjs.mjs","../src/lib/utils.ts","../src/inspector/hosts.ts","../src/inspector/inspector-types.ts","../src/chatgpt/chatgpt-conversation.tsx","../src/chatgpt/chatgpt-host.ts","../src/claude/claude-conversation.tsx","../src/claude/claude-host.ts","../../../node_modules/.pnpm/@modelcontextprotocol+ext-apps@1.7.2_@modelcontextprotocol+sdk@1.29.0_zod@4.4.3__react-_f5b843da9146ebea748e10ad8dfce46a/node_modules/@modelcontextprotocol/ext-apps/dist/src/app-bridge.js","../src/inspector/mcp-app-host.ts","../src/inspector/mock-openai-runtime.ts","../src/inspector/sandbox-proxy.ts","../src/inspector/inline-helper-script.ts","../src/inspector/iframe-resource.tsx","../src/inspector/use-inspector-state.ts","../src/inspector/inspector-api.ts","../src/inspector/use-mcp-connection.ts","../src/inspector/theme-provider.tsx","../src/inspector/simple-sidebar.tsx","../src/types/simulation.ts","../src/inspector/app-flatten.ts","../src/inspector/inspector.tsx"],"sourcesContent":["/**\n * Default MCP App style variables.\n *\n * Uses CSS light-dark() so a single set of values adapts to the document's\n * color-scheme automatically. These are applied as fallbacks when the host\n * doesn't provide style variables, and host shells use them as a base to\n * override specific entries for their brand palette.\n *\n * @see https://github.com/modelcontextprotocol/ext-apps/blob/main/specification/2026-01-26/apps.mdx#theming\n */\nimport type { McpUiStyles } from '@modelcontextprotocol/ext-apps';\n\nexport const DEFAULT_STYLE_VARIABLES: McpUiStyles = {\n // Background colors\n '--color-background-primary': 'light-dark(#ffffff, #1a1a1a)',\n '--color-background-secondary': 'light-dark(#f5f5f5, #2d2d2d)',\n '--color-background-tertiary': 'light-dark(#e5e5e5, #404040)',\n '--color-background-inverse': 'light-dark(#1a1a1a, #ffffff)',\n '--color-background-ghost': 'light-dark(rgba(255,255,255,0), rgba(26,26,26,0))',\n '--color-background-info': 'light-dark(#eff6ff, #1e3a5f)',\n '--color-background-danger': 'light-dark(#fef2f2, #7f1d1d)',\n '--color-background-success': 'light-dark(#f0fdf4, #14532d)',\n '--color-background-warning': 'light-dark(#fefce8, #713f12)',\n '--color-background-disabled': 'light-dark(rgba(255,255,255,0.5), rgba(26,26,26,0.5))',\n\n // Text colors\n '--color-text-primary': 'light-dark(#1f2937, #f3f4f6)',\n '--color-text-secondary': 'light-dark(#6b7280, #9ca3af)',\n '--color-text-tertiary': 'light-dark(#9ca3af, #6b7280)',\n '--color-text-inverse': 'light-dark(#f3f4f6, #1f2937)',\n '--color-text-ghost': 'light-dark(rgba(107,114,128,0.5), rgba(156,163,175,0.5))',\n '--color-text-info': 'light-dark(#1d4ed8, #60a5fa)',\n '--color-text-danger': 'light-dark(#b91c1c, #f87171)',\n '--color-text-success': 'light-dark(#15803d, #4ade80)',\n '--color-text-warning': 'light-dark(#a16207, #fbbf24)',\n '--color-text-disabled': 'light-dark(rgba(31,41,55,0.5), rgba(243,244,246,0.5))',\n\n // Border colors\n '--color-border-primary': 'light-dark(#e5e7eb, #404040)',\n '--color-border-secondary': 'light-dark(#d1d5db, #525252)',\n '--color-border-tertiary': 'light-dark(#f3f4f6, #374151)',\n '--color-border-inverse': 'light-dark(rgba(255,255,255,0.3), rgba(0,0,0,0.3))',\n '--color-border-ghost': 'light-dark(rgba(229,231,235,0), rgba(64,64,64,0))',\n '--color-border-info': 'light-dark(#93c5fd, #1e40af)',\n '--color-border-danger': 'light-dark(#fca5a5, #991b1b)',\n '--color-border-success': 'light-dark(#86efac, #166534)',\n '--color-border-warning': 'light-dark(#fde047, #854d0e)',\n '--color-border-disabled': 'light-dark(rgba(229,231,235,0.5), rgba(64,64,64,0.5))',\n\n // Ring colors (focus)\n '--color-ring-primary': 'light-dark(#3b82f6, #60a5fa)',\n '--color-ring-secondary': 'light-dark(#6b7280, #9ca3af)',\n '--color-ring-inverse': 'light-dark(#ffffff, #1f2937)',\n '--color-ring-info': 'light-dark(#2563eb, #3b82f6)',\n '--color-ring-danger': 'light-dark(#dc2626, #ef4444)',\n '--color-ring-success': 'light-dark(#16a34a, #22c55e)',\n '--color-ring-warning': 'light-dark(#ca8a04, #eab308)',\n\n // Typography — Family\n '--font-sans': \"system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif\",\n '--font-mono': \"ui-monospace, 'SF Mono', Monaco, 'Cascadia Code', monospace\",\n\n // Typography — Weight\n '--font-weight-normal': '400',\n '--font-weight-medium': '500',\n '--font-weight-semibold': '600',\n '--font-weight-bold': '700',\n\n // Typography — Text Size\n '--font-text-xs-size': '0.75rem',\n '--font-text-sm-size': '0.875rem',\n '--font-text-md-size': '1rem',\n '--font-text-lg-size': '1.125rem',\n\n // Typography — Heading Size\n '--font-heading-xs-size': '0.75rem',\n '--font-heading-sm-size': '0.875rem',\n '--font-heading-md-size': '1rem',\n '--font-heading-lg-size': '1.25rem',\n '--font-heading-xl-size': '1.5rem',\n '--font-heading-2xl-size': '1.875rem',\n '--font-heading-3xl-size': '2.25rem',\n\n // Typography — Text Line Height\n '--font-text-xs-line-height': '1.4',\n '--font-text-sm-line-height': '1.4',\n '--font-text-md-line-height': '1.5',\n '--font-text-lg-line-height': '1.5',\n\n // Typography — Heading Line Height\n '--font-heading-xs-line-height': '1.4',\n '--font-heading-sm-line-height': '1.4',\n '--font-heading-md-line-height': '1.4',\n '--font-heading-lg-line-height': '1.3',\n '--font-heading-xl-line-height': '1.25',\n '--font-heading-2xl-line-height': '1.2',\n '--font-heading-3xl-line-height': '1.1',\n\n // Border radius\n '--border-radius-xs': '2px',\n '--border-radius-sm': '4px',\n '--border-radius-md': '6px',\n '--border-radius-lg': '8px',\n '--border-radius-xl': '12px',\n '--border-radius-full': '9999px',\n\n // Border width\n '--border-width-regular': '1px',\n\n // Shadows\n '--shadow-hairline': '0 1px 2px 0 rgba(0, 0, 0, 0.05)',\n '--shadow-sm': '0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px -1px rgba(0, 0, 0, 0.1)',\n '--shadow-md': '0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1)',\n '--shadow-lg': '0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1)',\n};\n","function r(e){var t,f,n=\"\";if(\"string\"==typeof e||\"number\"==typeof e)n+=e;else if(\"object\"==typeof e)if(Array.isArray(e)){var o=e.length;for(t=0;t<o;t++)e[t]&&(f=r(e[t]))&&(n&&(n+=\" \"),n+=f)}else for(f in e)e[f]&&(n&&(n+=\" \"),n+=f);return n}export function clsx(){for(var e,t,f=0,n=\"\",o=arguments.length;f<o;f++)(e=arguments[f])&&(t=r(e))&&(n&&(n+=\" \"),n+=t);return n}export default clsx;","/**\n * Concatenates two arrays faster than the array spread operator.\n */\nconst concatArrays = (array1, array2) => {\n // Pre-allocate for better V8 optimization\n const combinedArray = new Array(array1.length + array2.length);\n for (let i = 0; i < array1.length; i++) {\n combinedArray[i] = array1[i];\n }\n for (let i = 0; i < array2.length; i++) {\n combinedArray[array1.length + i] = array2[i];\n }\n return combinedArray;\n};\n\n// Factory function ensures consistent object shapes\nconst createClassValidatorObject = (classGroupId, validator) => ({\n classGroupId,\n validator\n});\n// Factory ensures consistent ClassPartObject shape\nconst createClassPartObject = (nextPart = new Map(), validators = null, classGroupId) => ({\n nextPart,\n validators,\n classGroupId\n});\nconst CLASS_PART_SEPARATOR = '-';\nconst EMPTY_CONFLICTS = [];\n// I use two dots here because one dot is used as prefix for class groups in plugins\nconst ARBITRARY_PROPERTY_PREFIX = 'arbitrary..';\nconst createClassGroupUtils = config => {\n const classMap = createClassMap(config);\n const {\n conflictingClassGroups,\n conflictingClassGroupModifiers\n } = config;\n const getClassGroupId = className => {\n if (className.startsWith('[') && className.endsWith(']')) {\n return getGroupIdForArbitraryProperty(className);\n }\n const classParts = className.split(CLASS_PART_SEPARATOR);\n // Classes like `-inset-1` produce an empty string as first classPart. We assume that classes for negative values are used correctly and skip it.\n const startIndex = classParts[0] === '' && classParts.length > 1 ? 1 : 0;\n return getGroupRecursive(classParts, startIndex, classMap);\n };\n const getConflictingClassGroupIds = (classGroupId, hasPostfixModifier) => {\n if (hasPostfixModifier) {\n const modifierConflicts = conflictingClassGroupModifiers[classGroupId];\n const baseConflicts = conflictingClassGroups[classGroupId];\n if (modifierConflicts) {\n if (baseConflicts) {\n // Merge base conflicts with modifier conflicts\n return concatArrays(baseConflicts, modifierConflicts);\n }\n // Only modifier conflicts\n return modifierConflicts;\n }\n // Fall back to without postfix if no modifier conflicts\n return baseConflicts || EMPTY_CONFLICTS;\n }\n return conflictingClassGroups[classGroupId] || EMPTY_CONFLICTS;\n };\n return {\n getClassGroupId,\n getConflictingClassGroupIds\n };\n};\nconst getGroupRecursive = (classParts, startIndex, classPartObject) => {\n const classPathsLength = classParts.length - startIndex;\n if (classPathsLength === 0) {\n return classPartObject.classGroupId;\n }\n const currentClassPart = classParts[startIndex];\n const nextClassPartObject = classPartObject.nextPart.get(currentClassPart);\n if (nextClassPartObject) {\n const result = getGroupRecursive(classParts, startIndex + 1, nextClassPartObject);\n if (result) return result;\n }\n const validators = classPartObject.validators;\n if (validators === null) {\n return undefined;\n }\n // Build classRest string efficiently by joining from startIndex onwards\n const classRest = startIndex === 0 ? classParts.join(CLASS_PART_SEPARATOR) : classParts.slice(startIndex).join(CLASS_PART_SEPARATOR);\n const validatorsLength = validators.length;\n for (let i = 0; i < validatorsLength; i++) {\n const validatorObj = validators[i];\n if (validatorObj.validator(classRest)) {\n return validatorObj.classGroupId;\n }\n }\n return undefined;\n};\n/**\n * Get the class group ID for an arbitrary property.\n *\n * @param className - The class name to get the group ID for. Is expected to be string starting with `[` and ending with `]`.\n */\nconst getGroupIdForArbitraryProperty = className => className.slice(1, -1).indexOf(':') === -1 ? undefined : (() => {\n const content = className.slice(1, -1);\n const colonIndex = content.indexOf(':');\n const property = content.slice(0, colonIndex);\n return property ? ARBITRARY_PROPERTY_PREFIX + property : undefined;\n})();\n/**\n * Exported for testing only\n */\nconst createClassMap = config => {\n const {\n theme,\n classGroups\n } = config;\n return processClassGroups(classGroups, theme);\n};\n// Split into separate functions to maintain monomorphic call sites\nconst processClassGroups = (classGroups, theme) => {\n const classMap = createClassPartObject();\n for (const classGroupId in classGroups) {\n const group = classGroups[classGroupId];\n processClassesRecursively(group, classMap, classGroupId, theme);\n }\n return classMap;\n};\nconst processClassesRecursively = (classGroup, classPartObject, classGroupId, theme) => {\n const len = classGroup.length;\n for (let i = 0; i < len; i++) {\n const classDefinition = classGroup[i];\n processClassDefinition(classDefinition, classPartObject, classGroupId, theme);\n }\n};\n// Split into separate functions for each type to maintain monomorphic call sites\nconst processClassDefinition = (classDefinition, classPartObject, classGroupId, theme) => {\n if (typeof classDefinition === 'string') {\n processStringDefinition(classDefinition, classPartObject, classGroupId);\n return;\n }\n if (typeof classDefinition === 'function') {\n processFunctionDefinition(classDefinition, classPartObject, classGroupId, theme);\n return;\n }\n processObjectDefinition(classDefinition, classPartObject, classGroupId, theme);\n};\nconst processStringDefinition = (classDefinition, classPartObject, classGroupId) => {\n const classPartObjectToEdit = classDefinition === '' ? classPartObject : getPart(classPartObject, classDefinition);\n classPartObjectToEdit.classGroupId = classGroupId;\n};\nconst processFunctionDefinition = (classDefinition, classPartObject, classGroupId, theme) => {\n if (isThemeGetter(classDefinition)) {\n processClassesRecursively(classDefinition(theme), classPartObject, classGroupId, theme);\n return;\n }\n if (classPartObject.validators === null) {\n classPartObject.validators = [];\n }\n classPartObject.validators.push(createClassValidatorObject(classGroupId, classDefinition));\n};\nconst processObjectDefinition = (classDefinition, classPartObject, classGroupId, theme) => {\n const entries = Object.entries(classDefinition);\n const len = entries.length;\n for (let i = 0; i < len; i++) {\n const [key, value] = entries[i];\n processClassesRecursively(value, getPart(classPartObject, key), classGroupId, theme);\n }\n};\nconst getPart = (classPartObject, path) => {\n let current = classPartObject;\n const parts = path.split(CLASS_PART_SEPARATOR);\n const len = parts.length;\n for (let i = 0; i < len; i++) {\n const part = parts[i];\n let next = current.nextPart.get(part);\n if (!next) {\n next = createClassPartObject();\n current.nextPart.set(part, next);\n }\n current = next;\n }\n return current;\n};\n// Type guard maintains monomorphic check\nconst isThemeGetter = func => 'isThemeGetter' in func && func.isThemeGetter === true;\n\n// LRU cache implementation using plain objects for simplicity\nconst createLruCache = maxCacheSize => {\n if (maxCacheSize < 1) {\n return {\n get: () => undefined,\n set: () => {}\n };\n }\n let cacheSize = 0;\n let cache = Object.create(null);\n let previousCache = Object.create(null);\n const update = (key, value) => {\n cache[key] = value;\n cacheSize++;\n if (cacheSize > maxCacheSize) {\n cacheSize = 0;\n previousCache = cache;\n cache = Object.create(null);\n }\n };\n return {\n get(key) {\n let value = cache[key];\n if (value !== undefined) {\n return value;\n }\n if ((value = previousCache[key]) !== undefined) {\n update(key, value);\n return value;\n }\n },\n set(key, value) {\n if (key in cache) {\n cache[key] = value;\n } else {\n update(key, value);\n }\n }\n };\n};\nconst IMPORTANT_MODIFIER = '!';\nconst MODIFIER_SEPARATOR = ':';\nconst EMPTY_MODIFIERS = [];\n// Pre-allocated result object shape for consistency\nconst createResultObject = (modifiers, hasImportantModifier, baseClassName, maybePostfixModifierPosition, isExternal) => ({\n modifiers,\n hasImportantModifier,\n baseClassName,\n maybePostfixModifierPosition,\n isExternal\n});\nconst createParseClassName = config => {\n const {\n prefix,\n experimentalParseClassName\n } = config;\n /**\n * Parse class name into parts.\n *\n * Inspired by `splitAtTopLevelOnly` used in Tailwind CSS\n * @see https://github.com/tailwindlabs/tailwindcss/blob/v3.2.2/src/util/splitAtTopLevelOnly.js\n */\n let parseClassName = className => {\n // Use simple array with push for better performance\n const modifiers = [];\n let bracketDepth = 0;\n let parenDepth = 0;\n let modifierStart = 0;\n let postfixModifierPosition;\n const len = className.length;\n for (let index = 0; index < len; index++) {\n const currentCharacter = className[index];\n if (bracketDepth === 0 && parenDepth === 0) {\n if (currentCharacter === MODIFIER_SEPARATOR) {\n modifiers.push(className.slice(modifierStart, index));\n modifierStart = index + 1;\n continue;\n }\n if (currentCharacter === '/') {\n postfixModifierPosition = index;\n continue;\n }\n }\n if (currentCharacter === '[') bracketDepth++;else if (currentCharacter === ']') bracketDepth--;else if (currentCharacter === '(') parenDepth++;else if (currentCharacter === ')') parenDepth--;\n }\n const baseClassNameWithImportantModifier = modifiers.length === 0 ? className : className.slice(modifierStart);\n // Inline important modifier check\n let baseClassName = baseClassNameWithImportantModifier;\n let hasImportantModifier = false;\n if (baseClassNameWithImportantModifier.endsWith(IMPORTANT_MODIFIER)) {\n baseClassName = baseClassNameWithImportantModifier.slice(0, -1);\n hasImportantModifier = true;\n } else if (\n /**\n * In Tailwind CSS v3 the important modifier was at the start of the base class name. This is still supported for legacy reasons.\n * @see https://github.com/dcastil/tailwind-merge/issues/513#issuecomment-2614029864\n */\n baseClassNameWithImportantModifier.startsWith(IMPORTANT_MODIFIER)) {\n baseClassName = baseClassNameWithImportantModifier.slice(1);\n hasImportantModifier = true;\n }\n const maybePostfixModifierPosition = postfixModifierPosition && postfixModifierPosition > modifierStart ? postfixModifierPosition - modifierStart : undefined;\n return createResultObject(modifiers, hasImportantModifier, baseClassName, maybePostfixModifierPosition);\n };\n if (prefix) {\n const fullPrefix = prefix + MODIFIER_SEPARATOR;\n const parseClassNameOriginal = parseClassName;\n parseClassName = className => className.startsWith(fullPrefix) ? parseClassNameOriginal(className.slice(fullPrefix.length)) : createResultObject(EMPTY_MODIFIERS, false, className, undefined, true);\n }\n if (experimentalParseClassName) {\n const parseClassNameOriginal = parseClassName;\n parseClassName = className => experimentalParseClassName({\n className,\n parseClassName: parseClassNameOriginal\n });\n }\n return parseClassName;\n};\n\n/**\n * Sorts modifiers according to following schema:\n * - Predefined modifiers are sorted alphabetically\n * - When an arbitrary variant appears, it must be preserved which modifiers are before and after it\n */\nconst createSortModifiers = config => {\n // Pre-compute weights for all known modifiers for O(1) comparison\n const modifierWeights = new Map();\n // Assign weights to sensitive modifiers (highest priority, but preserve order)\n config.orderSensitiveModifiers.forEach((mod, index) => {\n modifierWeights.set(mod, 1000000 + index); // High weights for sensitive mods\n });\n return modifiers => {\n const result = [];\n let currentSegment = [];\n // Process modifiers in one pass\n for (let i = 0; i < modifiers.length; i++) {\n const modifier = modifiers[i];\n // Check if modifier is sensitive (starts with '[' or in orderSensitiveModifiers)\n const isArbitrary = modifier[0] === '[';\n const isOrderSensitive = modifierWeights.has(modifier);\n if (isArbitrary || isOrderSensitive) {\n // Sort and flush current segment alphabetically\n if (currentSegment.length > 0) {\n currentSegment.sort();\n result.push(...currentSegment);\n currentSegment = [];\n }\n result.push(modifier);\n } else {\n // Regular modifier - add to current segment for batch sorting\n currentSegment.push(modifier);\n }\n }\n // Sort and add any remaining segment items\n if (currentSegment.length > 0) {\n currentSegment.sort();\n result.push(...currentSegment);\n }\n return result;\n };\n};\nconst createConfigUtils = config => ({\n cache: createLruCache(config.cacheSize),\n parseClassName: createParseClassName(config),\n sortModifiers: createSortModifiers(config),\n postfixLookupClassGroupIds: createPostfixLookupClassGroupIds(config),\n ...createClassGroupUtils(config)\n});\nconst createPostfixLookupClassGroupIds = config => {\n const lookup = Object.create(null);\n const classGroupIds = config.postfixLookupClassGroups;\n if (classGroupIds) {\n for (let i = 0; i < classGroupIds.length; i++) {\n lookup[classGroupIds[i]] = true;\n }\n }\n return lookup;\n};\nconst SPLIT_CLASSES_REGEX = /\\s+/;\nconst mergeClassList = (classList, configUtils) => {\n const {\n parseClassName,\n getClassGroupId,\n getConflictingClassGroupIds,\n sortModifiers,\n postfixLookupClassGroupIds\n } = configUtils;\n /**\n * Set of classGroupIds in following format:\n * `{importantModifier}{variantModifiers}{classGroupId}`\n * @example 'float'\n * @example 'hover:focus:bg-color'\n * @example 'md:!pr'\n */\n const classGroupsInConflict = [];\n const classNames = classList.trim().split(SPLIT_CLASSES_REGEX);\n let result = '';\n for (let index = classNames.length - 1; index >= 0; index -= 1) {\n const originalClassName = classNames[index];\n const {\n isExternal,\n modifiers,\n hasImportantModifier,\n baseClassName,\n maybePostfixModifierPosition\n } = parseClassName(originalClassName);\n if (isExternal) {\n result = originalClassName + (result.length > 0 ? ' ' + result : result);\n continue;\n }\n let hasPostfixModifier = !!maybePostfixModifierPosition;\n let classGroupId;\n if (hasPostfixModifier) {\n const baseClassNameWithoutPostfix = baseClassName.substring(0, maybePostfixModifierPosition);\n classGroupId = getClassGroupId(baseClassNameWithoutPostfix);\n const classGroupIdWithPostfix = classGroupId && postfixLookupClassGroupIds[classGroupId] ? getClassGroupId(baseClassName) : undefined;\n if (classGroupIdWithPostfix && classGroupIdWithPostfix !== classGroupId) {\n classGroupId = classGroupIdWithPostfix;\n hasPostfixModifier = false;\n }\n } else {\n classGroupId = getClassGroupId(baseClassName);\n }\n if (!classGroupId) {\n if (!hasPostfixModifier) {\n // Not a Tailwind class\n result = originalClassName + (result.length > 0 ? ' ' + result : result);\n continue;\n }\n classGroupId = getClassGroupId(baseClassName);\n if (!classGroupId) {\n // Not a Tailwind class\n result = originalClassName + (result.length > 0 ? ' ' + result : result);\n continue;\n }\n hasPostfixModifier = false;\n }\n // Fast path: skip sorting for empty or single modifier\n const variantModifier = modifiers.length === 0 ? '' : modifiers.length === 1 ? modifiers[0] : sortModifiers(modifiers).join(':');\n const modifierId = hasImportantModifier ? variantModifier + IMPORTANT_MODIFIER : variantModifier;\n const classId = modifierId + classGroupId;\n if (classGroupsInConflict.indexOf(classId) > -1) {\n // Tailwind class omitted due to conflict\n continue;\n }\n classGroupsInConflict.push(classId);\n const conflictGroups = getConflictingClassGroupIds(classGroupId, hasPostfixModifier);\n for (let i = 0; i < conflictGroups.length; ++i) {\n const group = conflictGroups[i];\n classGroupsInConflict.push(modifierId + group);\n }\n // Tailwind class not in conflict\n result = originalClassName + (result.length > 0 ? ' ' + result : result);\n }\n return result;\n};\n\n/**\n * The code in this file is copied from https://github.com/lukeed/clsx and modified to suit the needs of tailwind-merge better.\n *\n * Specifically:\n * - Runtime code from https://github.com/lukeed/clsx/blob/v1.2.1/src/index.js\n * - TypeScript types from https://github.com/lukeed/clsx/blob/v1.2.1/clsx.d.ts\n *\n * Original code has MIT license: Copyright (c) Luke Edwards <luke.edwards05@gmail.com> (lukeed.com)\n */\nconst twJoin = (...classLists) => {\n let index = 0;\n let argument;\n let resolvedValue;\n let string = '';\n while (index < classLists.length) {\n if (argument = classLists[index++]) {\n if (resolvedValue = toValue(argument)) {\n string && (string += ' ');\n string += resolvedValue;\n }\n }\n }\n return string;\n};\nconst toValue = mix => {\n // Fast path for strings\n if (typeof mix === 'string') {\n return mix;\n }\n let resolvedValue;\n let string = '';\n for (let k = 0; k < mix.length; k++) {\n if (mix[k]) {\n if (resolvedValue = toValue(mix[k])) {\n string && (string += ' ');\n string += resolvedValue;\n }\n }\n }\n return string;\n};\nconst createTailwindMerge = (createConfigFirst, ...createConfigRest) => {\n let configUtils;\n let cacheGet;\n let cacheSet;\n let functionToCall;\n const initTailwindMerge = classList => {\n const config = createConfigRest.reduce((previousConfig, createConfigCurrent) => createConfigCurrent(previousConfig), createConfigFirst());\n configUtils = createConfigUtils(config);\n cacheGet = configUtils.cache.get;\n cacheSet = configUtils.cache.set;\n functionToCall = tailwindMerge;\n return tailwindMerge(classList);\n };\n const tailwindMerge = classList => {\n const cachedResult = cacheGet(classList);\n if (cachedResult) {\n return cachedResult;\n }\n const result = mergeClassList(classList, configUtils);\n cacheSet(classList, result);\n return result;\n };\n functionToCall = initTailwindMerge;\n return (...args) => functionToCall(twJoin(...args));\n};\nconst fallbackThemeArr = [];\nconst fromTheme = key => {\n const themeGetter = theme => theme[key] || fallbackThemeArr;\n themeGetter.isThemeGetter = true;\n return themeGetter;\n};\nconst arbitraryValueRegex = /^\\[(?:(\\w[\\w-]*):)?(.+)\\]$/i;\nconst arbitraryVariableRegex = /^\\((?:(\\w[\\w-]*):)?(.+)\\)$/i;\nconst fractionRegex = /^\\d+(?:\\.\\d+)?\\/\\d+(?:\\.\\d+)?$/;\nconst tshirtUnitRegex = /^(\\d+(\\.\\d+)?)?(xs|sm|md|lg|xl)$/;\nconst lengthUnitRegex = /\\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\\b(calc|min|max|clamp)\\(.+\\)|^0$/;\nconst colorFunctionRegex = /^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\\(.+\\)$/;\n// Shadow always begins with x and y offset separated by underscore optionally prepended by inset\nconst shadowRegex = /^(inset_)?-?((\\d+)?\\.?(\\d+)[a-z]+|0)_-?((\\d+)?\\.?(\\d+)[a-z]+|0)/;\nconst imageRegex = /^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\\(.+\\)$/;\nconst isFraction = value => fractionRegex.test(value);\nconst isNumber = value => !!value && !Number.isNaN(Number(value));\nconst isInteger = value => !!value && Number.isInteger(Number(value));\nconst isPercent = value => value.endsWith('%') && isNumber(value.slice(0, -1));\nconst isTshirtSize = value => tshirtUnitRegex.test(value);\nconst isAny = () => true;\nconst isLengthOnly = value =>\n// `colorFunctionRegex` check is necessary because color functions can have percentages in them which which would be incorrectly classified as lengths.\n// For example, `hsl(0 0% 0%)` would be classified as a length without this check.\n// I could also use lookbehind assertion in `lengthUnitRegex` but that isn't supported widely enough.\nlengthUnitRegex.test(value) && !colorFunctionRegex.test(value);\nconst isNever = () => false;\nconst isShadow = value => shadowRegex.test(value);\nconst isImage = value => imageRegex.test(value);\nconst isAnyNonArbitrary = value => !isArbitraryValue(value) && !isArbitraryVariable(value);\nconst isNamedContainerQuery = value => value.startsWith('@container') && (value[10] === '/' && value[11] !== undefined || value[11] === 's' && value[16] !== undefined && value.startsWith('-size/', 10) || value[11] === 'n' && value[18] !== undefined && value.startsWith('-normal/', 10));\nconst isArbitrarySize = value => getIsArbitraryValue(value, isLabelSize, isNever);\nconst isArbitraryValue = value => arbitraryValueRegex.test(value);\nconst isArbitraryLength = value => getIsArbitraryValue(value, isLabelLength, isLengthOnly);\nconst isArbitraryNumber = value => getIsArbitraryValue(value, isLabelNumber, isNumber);\nconst isArbitraryWeight = value => getIsArbitraryValue(value, isLabelWeight, isAny);\nconst isArbitraryFamilyName = value => getIsArbitraryValue(value, isLabelFamilyName, isNever);\nconst isArbitraryPosition = value => getIsArbitraryValue(value, isLabelPosition, isNever);\nconst isArbitraryImage = value => getIsArbitraryValue(value, isLabelImage, isImage);\nconst isArbitraryShadow = value => getIsArbitraryValue(value, isLabelShadow, isShadow);\nconst isArbitraryVariable = value => arbitraryVariableRegex.test(value);\nconst isArbitraryVariableLength = value => getIsArbitraryVariable(value, isLabelLength);\nconst isArbitraryVariableFamilyName = value => getIsArbitraryVariable(value, isLabelFamilyName);\nconst isArbitraryVariablePosition = value => getIsArbitraryVariable(value, isLabelPosition);\nconst isArbitraryVariableSize = value => getIsArbitraryVariable(value, isLabelSize);\nconst isArbitraryVariableImage = value => getIsArbitraryVariable(value, isLabelImage);\nconst isArbitraryVariableShadow = value => getIsArbitraryVariable(value, isLabelShadow, true);\nconst isArbitraryVariableWeight = value => getIsArbitraryVariable(value, isLabelWeight, true);\n// Helpers\nconst getIsArbitraryValue = (value, testLabel, testValue) => {\n const result = arbitraryValueRegex.exec(value);\n if (result) {\n if (result[1]) {\n return testLabel(result[1]);\n }\n return testValue(result[2]);\n }\n return false;\n};\nconst getIsArbitraryVariable = (value, testLabel, shouldMatchNoLabel = false) => {\n const result = arbitraryVariableRegex.exec(value);\n if (result) {\n if (result[1]) {\n return testLabel(result[1]);\n }\n return shouldMatchNoLabel;\n }\n return false;\n};\n// Labels\nconst isLabelPosition = label => label === 'position' || label === 'percentage';\nconst isLabelImage = label => label === 'image' || label === 'url';\nconst isLabelSize = label => label === 'length' || label === 'size' || label === 'bg-size';\nconst isLabelLength = label => label === 'length';\nconst isLabelNumber = label => label === 'number';\nconst isLabelFamilyName = label => label === 'family-name';\nconst isLabelWeight = label => label === 'number' || label === 'weight';\nconst isLabelShadow = label => label === 'shadow';\nconst validators = /*#__PURE__*/Object.defineProperty({\n __proto__: null,\n isAny,\n isAnyNonArbitrary,\n isArbitraryFamilyName,\n isArbitraryImage,\n isArbitraryLength,\n isArbitraryNumber,\n isArbitraryPosition,\n isArbitraryShadow,\n isArbitrarySize,\n isArbitraryValue,\n isArbitraryVariable,\n isArbitraryVariableFamilyName,\n isArbitraryVariableImage,\n isArbitraryVariableLength,\n isArbitraryVariablePosition,\n isArbitraryVariableShadow,\n isArbitraryVariableSize,\n isArbitraryVariableWeight,\n isArbitraryWeight,\n isFraction,\n isInteger,\n isNamedContainerQuery,\n isNumber,\n isPercent,\n isTshirtSize\n}, Symbol.toStringTag, {\n value: 'Module'\n});\nconst getDefaultConfig = () => {\n /**\n * Theme getters for theme variable namespaces\n * @see https://tailwindcss.com/docs/theme#theme-variable-namespaces\n */\n /***/\n const themeColor = fromTheme('color');\n const themeFont = fromTheme('font');\n const themeText = fromTheme('text');\n const themeFontWeight = fromTheme('font-weight');\n const themeTracking = fromTheme('tracking');\n const themeLeading = fromTheme('leading');\n const themeBreakpoint = fromTheme('breakpoint');\n const themeContainer = fromTheme('container');\n const themeSpacing = fromTheme('spacing');\n const themeRadius = fromTheme('radius');\n const themeShadow = fromTheme('shadow');\n const themeInsetShadow = fromTheme('inset-shadow');\n const themeTextShadow = fromTheme('text-shadow');\n const themeDropShadow = fromTheme('drop-shadow');\n const themeBlur = fromTheme('blur');\n const themePerspective = fromTheme('perspective');\n const themeAspect = fromTheme('aspect');\n const themeEase = fromTheme('ease');\n const themeAnimate = fromTheme('animate');\n /**\n * Helpers to avoid repeating the same scales\n *\n * We use functions that create a new array every time they're called instead of static arrays.\n * This ensures that users who modify any scale by mutating the array (e.g. with `array.push(element)`) don't accidentally mutate arrays in other parts of the config.\n */\n /***/\n const scaleBreak = () => ['auto', 'avoid', 'all', 'avoid-page', 'page', 'left', 'right', 'column'];\n const scalePosition = () => ['center', 'top', 'bottom', 'left', 'right', 'top-left',\n // Deprecated since Tailwind CSS v4.1.0, see https://github.com/tailwindlabs/tailwindcss/pull/17378\n 'left-top', 'top-right',\n // Deprecated since Tailwind CSS v4.1.0, see https://github.com/tailwindlabs/tailwindcss/pull/17378\n 'right-top', 'bottom-right',\n // Deprecated since Tailwind CSS v4.1.0, see https://github.com/tailwindlabs/tailwindcss/pull/17378\n 'right-bottom', 'bottom-left',\n // Deprecated since Tailwind CSS v4.1.0, see https://github.com/tailwindlabs/tailwindcss/pull/17378\n 'left-bottom'];\n const scalePositionWithArbitrary = () => [...scalePosition(), isArbitraryVariable, isArbitraryValue];\n const scaleOverflow = () => ['auto', 'hidden', 'clip', 'visible', 'scroll'];\n const scaleOverscroll = () => ['auto', 'contain', 'none'];\n const scaleUnambiguousSpacing = () => [isArbitraryVariable, isArbitraryValue, themeSpacing];\n const scaleInset = () => [isFraction, 'full', 'auto', ...scaleUnambiguousSpacing()];\n const scaleGridTemplateColsRows = () => [isInteger, 'none', 'subgrid', isArbitraryVariable, isArbitraryValue];\n const scaleGridColRowStartAndEnd = () => ['auto', {\n span: ['full', isInteger, isArbitraryVariable, isArbitraryValue]\n }, isInteger, isArbitraryVariable, isArbitraryValue];\n const scaleGridColRowStartOrEnd = () => [isInteger, 'auto', isArbitraryVariable, isArbitraryValue];\n const scaleGridAutoColsRows = () => ['auto', 'min', 'max', 'fr', isArbitraryVariable, isArbitraryValue];\n const scaleAlignPrimaryAxis = () => ['start', 'end', 'center', 'between', 'around', 'evenly', 'stretch', 'baseline', 'center-safe', 'end-safe'];\n const scaleAlignSecondaryAxis = () => ['start', 'end', 'center', 'stretch', 'center-safe', 'end-safe'];\n const scaleMargin = () => ['auto', ...scaleUnambiguousSpacing()];\n const scaleSizing = () => [isFraction, 'auto', 'full', 'dvw', 'dvh', 'lvw', 'lvh', 'svw', 'svh', 'min', 'max', 'fit', ...scaleUnambiguousSpacing()];\n const scaleSizingInline = () => [isFraction, 'screen', 'full', 'dvw', 'lvw', 'svw', 'min', 'max', 'fit', ...scaleUnambiguousSpacing()];\n const scaleSizingBlock = () => [isFraction, 'screen', 'full', 'lh', 'dvh', 'lvh', 'svh', 'min', 'max', 'fit', ...scaleUnambiguousSpacing()];\n const scaleColor = () => [themeColor, isArbitraryVariable, isArbitraryValue];\n const scaleBgPosition = () => [...scalePosition(), isArbitraryVariablePosition, isArbitraryPosition, {\n position: [isArbitraryVariable, isArbitraryValue]\n }];\n const scaleBgRepeat = () => ['no-repeat', {\n repeat: ['', 'x', 'y', 'space', 'round']\n }];\n const scaleBgSize = () => ['auto', 'cover', 'contain', isArbitraryVariableSize, isArbitrarySize, {\n size: [isArbitraryVariable, isArbitraryValue]\n }];\n const scaleGradientStopPosition = () => [isPercent, isArbitraryVariableLength, isArbitraryLength];\n const scaleRadius = () => [\n // Deprecated since Tailwind CSS v4.0.0\n '', 'none', 'full', themeRadius, isArbitraryVariable, isArbitraryValue];\n const scaleBorderWidth = () => ['', isNumber, isArbitraryVariableLength, isArbitraryLength];\n const scaleLineStyle = () => ['solid', 'dashed', 'dotted', 'double'];\n const scaleBlendMode = () => ['normal', 'multiply', 'screen', 'overlay', 'darken', 'lighten', 'color-dodge', 'color-burn', 'hard-light', 'soft-light', 'difference', 'exclusion', 'hue', 'saturation', 'color', 'luminosity'];\n const scaleMaskImagePosition = () => [isNumber, isPercent, isArbitraryVariablePosition, isArbitraryPosition];\n const scaleBlur = () => [\n // Deprecated since Tailwind CSS v4.0.0\n '', 'none', themeBlur, isArbitraryVariable, isArbitraryValue];\n const scaleRotate = () => ['none', isNumber, isArbitraryVariable, isArbitraryValue];\n const scaleScale = () => ['none', isNumber, isArbitraryVariable, isArbitraryValue];\n const scaleSkew = () => [isNumber, isArbitraryVariable, isArbitraryValue];\n const scaleTranslate = () => [isFraction, 'full', ...scaleUnambiguousSpacing()];\n return {\n cacheSize: 500,\n theme: {\n animate: ['spin', 'ping', 'pulse', 'bounce'],\n aspect: ['video'],\n blur: [isTshirtSize],\n breakpoint: [isTshirtSize],\n color: [isAny],\n container: [isTshirtSize],\n 'drop-shadow': [isTshirtSize],\n ease: ['in', 'out', 'in-out'],\n font: [isAnyNonArbitrary],\n 'font-weight': ['thin', 'extralight', 'light', 'normal', 'medium', 'semibold', 'bold', 'extrabold', 'black'],\n 'inset-shadow': [isTshirtSize],\n leading: ['none', 'tight', 'snug', 'normal', 'relaxed', 'loose'],\n perspective: ['dramatic', 'near', 'normal', 'midrange', 'distant', 'none'],\n radius: [isTshirtSize],\n shadow: [isTshirtSize],\n spacing: ['px', isNumber],\n text: [isTshirtSize],\n 'text-shadow': [isTshirtSize],\n tracking: ['tighter', 'tight', 'normal', 'wide', 'wider', 'widest']\n },\n classGroups: {\n // --------------\n // --- Layout ---\n // --------------\n /**\n * Aspect Ratio\n * @see https://tailwindcss.com/docs/aspect-ratio\n */\n aspect: [{\n aspect: ['auto', 'square', isFraction, isArbitraryValue, isArbitraryVariable, themeAspect]\n }],\n /**\n * Container\n * @see https://tailwindcss.com/docs/container\n * @deprecated since Tailwind CSS v4.0.0\n */\n container: ['container'],\n /**\n * Container Type\n * @see https://tailwindcss.com/docs/responsive-design#container-queries\n */\n 'container-type': [{\n '@container': ['', 'normal', 'size', isArbitraryVariable, isArbitraryValue]\n }],\n /**\n * Container Name\n * @see https://tailwindcss.com/docs/responsive-design#named-containers\n */\n 'container-named': [isNamedContainerQuery],\n /**\n * Columns\n * @see https://tailwindcss.com/docs/columns\n */\n columns: [{\n columns: [isNumber, isArbitraryValue, isArbitraryVariable, themeContainer]\n }],\n /**\n * Break After\n * @see https://tailwindcss.com/docs/break-after\n */\n 'break-after': [{\n 'break-after': scaleBreak()\n }],\n /**\n * Break Before\n * @see https://tailwindcss.com/docs/break-before\n */\n 'break-before': [{\n 'break-before': scaleBreak()\n }],\n /**\n * Break Inside\n * @see https://tailwindcss.com/docs/break-inside\n */\n 'break-inside': [{\n 'break-inside': ['auto', 'avoid', 'avoid-page', 'avoid-column']\n }],\n /**\n * Box Decoration Break\n * @see https://tailwindcss.com/docs/box-decoration-break\n */\n 'box-decoration': [{\n 'box-decoration': ['slice', 'clone']\n }],\n /**\n * Box Sizing\n * @see https://tailwindcss.com/docs/box-sizing\n */\n box: [{\n box: ['border', 'content']\n }],\n /**\n * Display\n * @see https://tailwindcss.com/docs/display\n */\n display: ['block', 'inline-block', 'inline', 'flex', 'inline-flex', 'table', 'inline-table', 'table-caption', 'table-cell', 'table-column', 'table-column-group', 'table-footer-group', 'table-header-group', 'table-row-group', 'table-row', 'flow-root', 'grid', 'inline-grid', 'contents', 'list-item', 'hidden'],\n /**\n * Screen Reader Only\n * @see https://tailwindcss.com/docs/display#screen-reader-only\n */\n sr: ['sr-only', 'not-sr-only'],\n /**\n * Floats\n * @see https://tailwindcss.com/docs/float\n */\n float: [{\n float: ['right', 'left', 'none', 'start', 'end']\n }],\n /**\n * Clear\n * @see https://tailwindcss.com/docs/clear\n */\n clear: [{\n clear: ['left', 'right', 'both', 'none', 'start', 'end']\n }],\n /**\n * Isolation\n * @see https://tailwindcss.com/docs/isolation\n */\n isolation: ['isolate', 'isolation-auto'],\n /**\n * Object Fit\n * @see https://tailwindcss.com/docs/object-fit\n */\n 'object-fit': [{\n object: ['contain', 'cover', 'fill', 'none', 'scale-down']\n }],\n /**\n * Object Position\n * @see https://tailwindcss.com/docs/object-position\n */\n 'object-position': [{\n object: scalePositionWithArbitrary()\n }],\n /**\n * Overflow\n * @see https://tailwindcss.com/docs/overflow\n */\n overflow: [{\n overflow: scaleOverflow()\n }],\n /**\n * Overflow X\n * @see https://tailwindcss.com/docs/overflow\n */\n 'overflow-x': [{\n 'overflow-x': scaleOverflow()\n }],\n /**\n * Overflow Y\n * @see https://tailwindcss.com/docs/overflow\n */\n 'overflow-y': [{\n 'overflow-y': scaleOverflow()\n }],\n /**\n * Overscroll Behavior\n * @see https://tailwindcss.com/docs/overscroll-behavior\n */\n overscroll: [{\n overscroll: scaleOverscroll()\n }],\n /**\n * Overscroll Behavior X\n * @see https://tailwindcss.com/docs/overscroll-behavior\n */\n 'overscroll-x': [{\n 'overscroll-x': scaleOverscroll()\n }],\n /**\n * Overscroll Behavior Y\n * @see https://tailwindcss.com/docs/overscroll-behavior\n */\n 'overscroll-y': [{\n 'overscroll-y': scaleOverscroll()\n }],\n /**\n * Position\n * @see https://tailwindcss.com/docs/position\n */\n position: ['static', 'fixed', 'absolute', 'relative', 'sticky'],\n /**\n * Inset\n * @see https://tailwindcss.com/docs/top-right-bottom-left\n */\n inset: [{\n inset: scaleInset()\n }],\n /**\n * Inset Inline\n * @see https://tailwindcss.com/docs/top-right-bottom-left\n */\n 'inset-x': [{\n 'inset-x': scaleInset()\n }],\n /**\n * Inset Block\n * @see https://tailwindcss.com/docs/top-right-bottom-left\n */\n 'inset-y': [{\n 'inset-y': scaleInset()\n }],\n /**\n * Inset Inline Start\n * @see https://tailwindcss.com/docs/top-right-bottom-left\n * @todo class group will be renamed to `inset-s` in next major release\n */\n start: [{\n 'inset-s': scaleInset(),\n /**\n * @deprecated since Tailwind CSS v4.2.0 in favor of `inset-s-*` utilities.\n * @see https://github.com/tailwindlabs/tailwindcss/pull/19613\n */\n start: scaleInset()\n }],\n /**\n * Inset Inline End\n * @see https://tailwindcss.com/docs/top-right-bottom-left\n * @todo class group will be renamed to `inset-e` in next major release\n */\n end: [{\n 'inset-e': scaleInset(),\n /**\n * @deprecated since Tailwind CSS v4.2.0 in favor of `inset-e-*` utilities.\n * @see https://github.com/tailwindlabs/tailwindcss/pull/19613\n */\n end: scaleInset()\n }],\n /**\n * Inset Block Start\n * @see https://tailwindcss.com/docs/top-right-bottom-left\n */\n 'inset-bs': [{\n 'inset-bs': scaleInset()\n }],\n /**\n * Inset Block End\n * @see https://tailwindcss.com/docs/top-right-bottom-left\n */\n 'inset-be': [{\n 'inset-be': scaleInset()\n }],\n /**\n * Top\n * @see https://tailwindcss.com/docs/top-right-bottom-left\n */\n top: [{\n top: scaleInset()\n }],\n /**\n * Right\n * @see https://tailwindcss.com/docs/top-right-bottom-left\n */\n right: [{\n right: scaleInset()\n }],\n /**\n * Bottom\n * @see https://tailwindcss.com/docs/top-right-bottom-left\n */\n bottom: [{\n bottom: scaleInset()\n }],\n /**\n * Left\n * @see https://tailwindcss.com/docs/top-right-bottom-left\n */\n left: [{\n left: scaleInset()\n }],\n /**\n * Visibility\n * @see https://tailwindcss.com/docs/visibility\n */\n visibility: ['visible', 'invisible', 'collapse'],\n /**\n * Z-Index\n * @see https://tailwindcss.com/docs/z-index\n */\n z: [{\n z: [isInteger, 'auto', isArbitraryVariable, isArbitraryValue]\n }],\n // ------------------------\n // --- Flexbox and Grid ---\n // ------------------------\n /**\n * Flex Basis\n * @see https://tailwindcss.com/docs/flex-basis\n */\n basis: [{\n basis: [isFraction, 'full', 'auto', themeContainer, ...scaleUnambiguousSpacing()]\n }],\n /**\n * Flex Direction\n * @see https://tailwindcss.com/docs/flex-direction\n */\n 'flex-direction': [{\n flex: ['row', 'row-reverse', 'col', 'col-reverse']\n }],\n /**\n * Flex Wrap\n * @see https://tailwindcss.com/docs/flex-wrap\n */\n 'flex-wrap': [{\n flex: ['nowrap', 'wrap', 'wrap-reverse']\n }],\n /**\n * Flex\n * @see https://tailwindcss.com/docs/flex\n */\n flex: [{\n flex: [isNumber, isFraction, 'auto', 'initial', 'none', isArbitraryValue]\n }],\n /**\n * Flex Grow\n * @see https://tailwindcss.com/docs/flex-grow\n */\n grow: [{\n grow: ['', isNumber, isArbitraryVariable, isArbitraryValue]\n }],\n /**\n * Flex Shrink\n * @see https://tailwindcss.com/docs/flex-shrink\n */\n shrink: [{\n shrink: ['', isNumber, isArbitraryVariable, isArbitraryValue]\n }],\n /**\n * Order\n * @see https://tailwindcss.com/docs/order\n */\n order: [{\n order: [isInteger, 'first', 'last', 'none', isArbitraryVariable, isArbitraryValue]\n }],\n /**\n * Grid Template Columns\n * @see https://tailwindcss.com/docs/grid-template-columns\n */\n 'grid-cols': [{\n 'grid-cols': scaleGridTemplateColsRows()\n }],\n /**\n * Grid Column Start / End\n * @see https://tailwindcss.com/docs/grid-column\n */\n 'col-start-end': [{\n col: scaleGridColRowStartAndEnd()\n }],\n /**\n * Grid Column Start\n * @see https://tailwindcss.com/docs/grid-column\n */\n 'col-start': [{\n 'col-start': scaleGridColRowStartOrEnd()\n }],\n /**\n * Grid Column End\n * @see https://tailwindcss.com/docs/grid-column\n */\n 'col-end': [{\n 'col-end': scaleGridColRowStartOrEnd()\n }],\n /**\n * Grid Template Rows\n * @see https://tailwindcss.com/docs/grid-template-rows\n */\n 'grid-rows': [{\n 'grid-rows': scaleGridTemplateColsRows()\n }],\n /**\n * Grid Row Start / End\n * @see https://tailwindcss.com/docs/grid-row\n */\n 'row-start-end': [{\n row: scaleGridColRowStartAndEnd()\n }],\n /**\n * Grid Row Start\n * @see https://tailwindcss.com/docs/grid-row\n */\n 'row-start': [{\n 'row-start': scaleGridColRowStartOrEnd()\n }],\n /**\n * Grid Row End\n * @see https://tailwindcss.com/docs/grid-row\n */\n 'row-end': [{\n 'row-end': scaleGridColRowStartOrEnd()\n }],\n /**\n * Grid Auto Flow\n * @see https://tailwindcss.com/docs/grid-auto-flow\n */\n 'grid-flow': [{\n 'grid-flow': ['row', 'col', 'dense', 'row-dense', 'col-dense']\n }],\n /**\n * Grid Auto Columns\n * @see https://tailwindcss.com/docs/grid-auto-columns\n */\n 'auto-cols': [{\n 'auto-cols': scaleGridAutoColsRows()\n }],\n /**\n * Grid Auto Rows\n * @see https://tailwindcss.com/docs/grid-auto-rows\n */\n 'auto-rows': [{\n 'auto-rows': scaleGridAutoColsRows()\n }],\n /**\n * Gap\n * @see https://tailwindcss.com/docs/gap\n */\n gap: [{\n gap: scaleUnambiguousSpacing()\n }],\n /**\n * Gap X\n * @see https://tailwindcss.com/docs/gap\n */\n 'gap-x': [{\n 'gap-x': scaleUnambiguousSpacing()\n }],\n /**\n * Gap Y\n * @see https://tailwindcss.com/docs/gap\n */\n 'gap-y': [{\n 'gap-y': scaleUnambiguousSpacing()\n }],\n /**\n * Justify Content\n * @see https://tailwindcss.com/docs/justify-content\n */\n 'justify-content': [{\n justify: [...scaleAlignPrimaryAxis(), 'normal']\n }],\n /**\n * Justify Items\n * @see https://tailwindcss.com/docs/justify-items\n */\n 'justify-items': [{\n 'justify-items': [...scaleAlignSecondaryAxis(), 'normal']\n }],\n /**\n * Justify Self\n * @see https://tailwindcss.com/docs/justify-self\n */\n 'justify-self': [{\n 'justify-self': ['auto', ...scaleAlignSecondaryAxis()]\n }],\n /**\n * Align Content\n * @see https://tailwindcss.com/docs/align-content\n */\n 'align-content': [{\n content: ['normal', ...scaleAlignPrimaryAxis()]\n }],\n /**\n * Align Items\n * @see https://tailwindcss.com/docs/align-items\n */\n 'align-items': [{\n items: [...scaleAlignSecondaryAxis(), {\n baseline: ['', 'last']\n }]\n }],\n /**\n * Align Self\n * @see https://tailwindcss.com/docs/align-self\n */\n 'align-self': [{\n self: ['auto', ...scaleAlignSecondaryAxis(), {\n baseline: ['', 'last']\n }]\n }],\n /**\n * Place Content\n * @see https://tailwindcss.com/docs/place-content\n */\n 'place-content': [{\n 'place-content': scaleAlignPrimaryAxis()\n }],\n /**\n * Place Items\n * @see https://tailwindcss.com/docs/place-items\n */\n 'place-items': [{\n 'place-items': [...scaleAlignSecondaryAxis(), 'baseline']\n }],\n /**\n * Place Self\n * @see https://tailwindcss.com/docs/place-self\n */\n 'place-self': [{\n 'place-self': ['auto', ...scaleAlignSecondaryAxis()]\n }],\n // Spacing\n /**\n * Padding\n * @see https://tailwindcss.com/docs/padding\n */\n p: [{\n p: scaleUnambiguousSpacing()\n }],\n /**\n * Padding Inline\n * @see https://tailwindcss.com/docs/padding\n */\n px: [{\n px: scaleUnambiguousSpacing()\n }],\n /**\n * Padding Block\n * @see https://tailwindcss.com/docs/padding\n */\n py: [{\n py: scaleUnambiguousSpacing()\n }],\n /**\n * Padding Inline Start\n * @see https://tailwindcss.com/docs/padding\n */\n ps: [{\n ps: scaleUnambiguousSpacing()\n }],\n /**\n * Padding Inline End\n * @see https://tailwindcss.com/docs/padding\n */\n pe: [{\n pe: scaleUnambiguousSpacing()\n }],\n /**\n * Padding Block Start\n * @see https://tailwindcss.com/docs/padding\n */\n pbs: [{\n pbs: scaleUnambiguousSpacing()\n }],\n /**\n * Padding Block End\n * @see https://tailwindcss.com/docs/padding\n */\n pbe: [{\n pbe: scaleUnambiguousSpacing()\n }],\n /**\n * Padding Top\n * @see https://tailwindcss.com/docs/padding\n */\n pt: [{\n pt: scaleUnambiguousSpacing()\n }],\n /**\n * Padding Right\n * @see https://tailwindcss.com/docs/padding\n */\n pr: [{\n pr: scaleUnambiguousSpacing()\n }],\n /**\n * Padding Bottom\n * @see https://tailwindcss.com/docs/padding\n */\n pb: [{\n pb: scaleUnambiguousSpacing()\n }],\n /**\n * Padding Left\n * @see https://tailwindcss.com/docs/padding\n */\n pl: [{\n pl: scaleUnambiguousSpacing()\n }],\n /**\n * Margin\n * @see https://tailwindcss.com/docs/margin\n */\n m: [{\n m: scaleMargin()\n }],\n /**\n * Margin Inline\n * @see https://tailwindcss.com/docs/margin\n */\n mx: [{\n mx: scaleMargin()\n }],\n /**\n * Margin Block\n * @see https://tailwindcss.com/docs/margin\n */\n my: [{\n my: scaleMargin()\n }],\n /**\n * Margin Inline Start\n * @see https://tailwindcss.com/docs/margin\n */\n ms: [{\n ms: scaleMargin()\n }],\n /**\n * Margin Inline End\n * @see https://tailwindcss.com/docs/margin\n */\n me: [{\n me: scaleMargin()\n }],\n /**\n * Margin Block Start\n * @see https://tailwindcss.com/docs/margin\n */\n mbs: [{\n mbs: scaleMargin()\n }],\n /**\n * Margin Block End\n * @see https://tailwindcss.com/docs/margin\n */\n mbe: [{\n mbe: scaleMargin()\n }],\n /**\n * Margin Top\n * @see https://tailwindcss.com/docs/margin\n */\n mt: [{\n mt: scaleMargin()\n }],\n /**\n * Margin Right\n * @see https://tailwindcss.com/docs/margin\n */\n mr: [{\n mr: scaleMargin()\n }],\n /**\n * Margin Bottom\n * @see https://tailwindcss.com/docs/margin\n */\n mb: [{\n mb: scaleMargin()\n }],\n /**\n * Margin Left\n * @see https://tailwindcss.com/docs/margin\n */\n ml: [{\n ml: scaleMargin()\n }],\n /**\n * Space Between X\n * @see https://tailwindcss.com/docs/margin#adding-space-between-children\n */\n 'space-x': [{\n 'space-x': scaleUnambiguousSpacing()\n }],\n /**\n * Space Between X Reverse\n * @see https://tailwindcss.com/docs/margin#adding-space-between-children\n */\n 'space-x-reverse': ['space-x-reverse'],\n /**\n * Space Between Y\n * @see https://tailwindcss.com/docs/margin#adding-space-between-children\n */\n 'space-y': [{\n 'space-y': scaleUnambiguousSpacing()\n }],\n /**\n * Space Between Y Reverse\n * @see https://tailwindcss.com/docs/margin#adding-space-between-children\n */\n 'space-y-reverse': ['space-y-reverse'],\n // --------------\n // --- Sizing ---\n // --------------\n /**\n * Size\n * @see https://tailwindcss.com/docs/width#setting-both-width-and-height\n */\n size: [{\n size: scaleSizing()\n }],\n /**\n * Inline Size\n * @see https://tailwindcss.com/docs/width\n */\n 'inline-size': [{\n inline: ['auto', ...scaleSizingInline()]\n }],\n /**\n * Min-Inline Size\n * @see https://tailwindcss.com/docs/min-width\n */\n 'min-inline-size': [{\n 'min-inline': ['auto', ...scaleSizingInline()]\n }],\n /**\n * Max-Inline Size\n * @see https://tailwindcss.com/docs/max-width\n */\n 'max-inline-size': [{\n 'max-inline': ['none', ...scaleSizingInline()]\n }],\n /**\n * Block Size\n * @see https://tailwindcss.com/docs/height\n */\n 'block-size': [{\n block: ['auto', ...scaleSizingBlock()]\n }],\n /**\n * Min-Block Size\n * @see https://tailwindcss.com/docs/min-height\n */\n 'min-block-size': [{\n 'min-block': ['auto', ...scaleSizingBlock()]\n }],\n /**\n * Max-Block Size\n * @see https://tailwindcss.com/docs/max-height\n */\n 'max-block-size': [{\n 'max-block': ['none', ...scaleSizingBlock()]\n }],\n /**\n * Width\n * @see https://tailwindcss.com/docs/width\n */\n w: [{\n w: [themeContainer, 'screen', ...scaleSizing()]\n }],\n /**\n * Min-Width\n * @see https://tailwindcss.com/docs/min-width\n */\n 'min-w': [{\n 'min-w': [themeContainer, 'screen', /** Deprecated. @see https://github.com/tailwindlabs/tailwindcss.com/issues/2027#issuecomment-2620152757 */\n 'none', ...scaleSizing()]\n }],\n /**\n * Max-Width\n * @see https://tailwindcss.com/docs/max-width\n */\n 'max-w': [{\n 'max-w': [themeContainer, 'screen', 'none', /** Deprecated since Tailwind CSS v4.0.0. @see https://github.com/tailwindlabs/tailwindcss.com/issues/2027#issuecomment-2620152757 */\n 'prose', /** Deprecated since Tailwind CSS v4.0.0. @see https://github.com/tailwindlabs/tailwindcss.com/issues/2027#issuecomment-2620152757 */\n {\n screen: [themeBreakpoint]\n }, ...scaleSizing()]\n }],\n /**\n * Height\n * @see https://tailwindcss.com/docs/height\n */\n h: [{\n h: ['screen', 'lh', ...scaleSizing()]\n }],\n /**\n * Min-Height\n * @see https://tailwindcss.com/docs/min-height\n */\n 'min-h': [{\n 'min-h': ['screen', 'lh', 'none', ...scaleSizing()]\n }],\n /**\n * Max-Height\n * @see https://tailwindcss.com/docs/max-height\n */\n 'max-h': [{\n 'max-h': ['screen', 'lh', ...scaleSizing()]\n }],\n // ------------------\n // --- Typography ---\n // ------------------\n /**\n * Font Size\n * @see https://tailwindcss.com/docs/font-size\n */\n 'font-size': [{\n text: ['base', themeText, isArbitraryVariableLength, isArbitraryLength]\n }],\n /**\n * Font Smoothing\n * @see https://tailwindcss.com/docs/font-smoothing\n */\n 'font-smoothing': ['antialiased', 'subpixel-antialiased'],\n /**\n * Font Style\n * @see https://tailwindcss.com/docs/font-style\n */\n 'font-style': ['italic', 'not-italic'],\n /**\n * Font Weight\n * @see https://tailwindcss.com/docs/font-weight\n */\n 'font-weight': [{\n font: [themeFontWeight, isArbitraryVariableWeight, isArbitraryWeight]\n }],\n /**\n * Font Stretch\n * @see https://tailwindcss.com/docs/font-stretch\n */\n 'font-stretch': [{\n 'font-stretch': ['ultra-condensed', 'extra-condensed', 'condensed', 'semi-condensed', 'normal', 'semi-expanded', 'expanded', 'extra-expanded', 'ultra-expanded', isPercent, isArbitraryValue]\n }],\n /**\n * Font Family\n * @see https://tailwindcss.com/docs/font-family\n */\n 'font-family': [{\n font: [isArbitraryVariableFamilyName, isArbitraryFamilyName, themeFont]\n }],\n /**\n * Font Feature Settings\n * @see https://tailwindcss.com/docs/font-feature-settings\n */\n 'font-features': [{\n 'font-features': [isArbitraryValue]\n }],\n /**\n * Font Variant Numeric\n * @see https://tailwindcss.com/docs/font-variant-numeric\n */\n 'fvn-normal': ['normal-nums'],\n /**\n * Font Variant Numeric\n * @see https://tailwindcss.com/docs/font-variant-numeric\n */\n 'fvn-ordinal': ['ordinal'],\n /**\n * Font Variant Numeric\n * @see https://tailwindcss.com/docs/font-variant-numeric\n */\n 'fvn-slashed-zero': ['slashed-zero'],\n /**\n * Font Variant Numeric\n * @see https://tailwindcss.com/docs/font-variant-numeric\n */\n 'fvn-figure': ['lining-nums', 'oldstyle-nums'],\n /**\n * Font Variant Numeric\n * @see https://tailwindcss.com/docs/font-variant-numeric\n */\n 'fvn-spacing': ['proportional-nums', 'tabular-nums'],\n /**\n * Font Variant Numeric\n * @see https://tailwindcss.com/docs/font-variant-numeric\n */\n 'fvn-fraction': ['diagonal-fractions', 'stacked-fractions'],\n /**\n * Letter Spacing\n * @see https://tailwindcss.com/docs/letter-spacing\n */\n tracking: [{\n tracking: [themeTracking, isArbitraryVariable, isArbitraryValue]\n }],\n /**\n * Line Clamp\n * @see https://tailwindcss.com/docs/line-clamp\n */\n 'line-clamp': [{\n 'line-clamp': [isNumber, 'none', isArbitraryVariable, isArbitraryNumber]\n }],\n /**\n * Line Height\n * @see https://tailwindcss.com/docs/line-height\n */\n leading: [{\n leading: [/** Deprecated since Tailwind CSS v4.0.0. @see https://github.com/tailwindlabs/tailwindcss.com/issues/2027#issuecomment-2620152757 */\n themeLeading, ...scaleUnambiguousSpacing()]\n }],\n /**\n * List Style Image\n * @see https://tailwindcss.com/docs/list-style-image\n */\n 'list-image': [{\n 'list-image': ['none', isArbitraryVariable, isArbitraryValue]\n }],\n /**\n * List Style Position\n * @see https://tailwindcss.com/docs/list-style-position\n */\n 'list-style-position': [{\n list: ['inside', 'outside']\n }],\n /**\n * List Style Type\n * @see https://tailwindcss.com/docs/list-style-type\n */\n 'list-style-type': [{\n list: ['disc', 'decimal', 'none', isArbitraryVariable, isArbitraryValue]\n }],\n /**\n * Text Alignment\n * @see https://tailwindcss.com/docs/text-align\n */\n 'text-alignment': [{\n text: ['left', 'center', 'right', 'justify', 'start', 'end']\n }],\n /**\n * Placeholder Color\n * @deprecated since Tailwind CSS v3.0.0\n * @see https://v3.tailwindcss.com/docs/placeholder-color\n */\n 'placeholder-color': [{\n placeholder: scaleColor()\n }],\n /**\n * Text Color\n * @see https://tailwindcss.com/docs/text-color\n */\n 'text-color': [{\n text: scaleColor()\n }],\n /**\n * Text Decoration\n * @see https://tailwindcss.com/docs/text-decoration\n */\n 'text-decoration': ['underline', 'overline', 'line-through', 'no-underline'],\n /**\n * Text Decoration Style\n * @see https://tailwindcss.com/docs/text-decoration-style\n */\n 'text-decoration-style': [{\n decoration: [...scaleLineStyle(), 'wavy']\n }],\n /**\n * Text Decoration Thickness\n * @see https://tailwindcss.com/docs/text-decoration-thickness\n */\n 'text-decoration-thickness': [{\n decoration: [isNumber, 'from-font', 'auto', isArbitraryVariable, isArbitraryLength]\n }],\n /**\n * Text Decoration Color\n * @see https://tailwindcss.com/docs/text-decoration-color\n */\n 'text-decoration-color': [{\n decoration: scaleColor()\n }],\n /**\n * Text Underline Offset\n * @see https://tailwindcss.com/docs/text-underline-offset\n */\n 'underline-offset': [{\n 'underline-offset': [isNumber, 'auto', isArbitraryVariable, isArbitraryValue]\n }],\n /**\n * Text Transform\n * @see https://tailwindcss.com/docs/text-transform\n */\n 'text-transform': ['uppercase', 'lowercase', 'capitalize', 'normal-case'],\n /**\n * Text Overflow\n * @see https://tailwindcss.com/docs/text-overflow\n */\n 'text-overflow': ['truncate', 'text-ellipsis', 'text-clip'],\n /**\n * Text Wrap\n * @see https://tailwindcss.com/docs/text-wrap\n */\n 'text-wrap': [{\n text: ['wrap', 'nowrap', 'balance', 'pretty']\n }],\n /**\n * Text Indent\n * @see https://tailwindcss.com/docs/text-indent\n */\n indent: [{\n indent: scaleUnambiguousSpacing()\n }],\n /**\n * Tab Size\n * @see https://tailwindcss.com/docs/tab-size\n */\n 'tab-size': [{\n tab: [isInteger, isArbitraryVariable, isArbitraryValue]\n }],\n /**\n * Vertical Alignment\n * @see https://tailwindcss.com/docs/vertical-align\n */\n 'vertical-align': [{\n align: ['baseline', 'top', 'middle', 'bottom', 'text-top', 'text-bottom', 'sub', 'super', isArbitraryVariable, isArbitraryValue]\n }],\n /**\n * Whitespace\n * @see https://tailwindcss.com/docs/whitespace\n */\n whitespace: [{\n whitespace: ['normal', 'nowrap', 'pre', 'pre-line', 'pre-wrap', 'break-spaces']\n }],\n /**\n * Word Break\n * @see https://tailwindcss.com/docs/word-break\n */\n break: [{\n break: ['normal', 'words', 'all', 'keep']\n }],\n /**\n * Overflow Wrap\n * @see https://tailwindcss.com/docs/overflow-wrap\n */\n wrap: [{\n wrap: ['break-word', 'anywhere', 'normal']\n }],\n /**\n * Hyphens\n * @see https://tailwindcss.com/docs/hyphens\n */\n hyphens: [{\n hyphens: ['none', 'manual', 'auto']\n }],\n /**\n * Content\n * @see https://tailwindcss.com/docs/content\n */\n content: [{\n content: ['none', isArbitraryVariable, isArbitraryValue]\n }],\n // -------------------\n // --- Backgrounds ---\n // -------------------\n /**\n * Background Attachment\n * @see https://tailwindcss.com/docs/background-attachment\n */\n 'bg-attachment': [{\n bg: ['fixed', 'local', 'scroll']\n }],\n /**\n * Background Clip\n * @see https://tailwindcss.com/docs/background-clip\n */\n 'bg-clip': [{\n 'bg-clip': ['border', 'padding', 'content', 'text']\n }],\n /**\n * Background Origin\n * @see https://tailwindcss.com/docs/background-origin\n */\n 'bg-origin': [{\n 'bg-origin': ['border', 'padding', 'content']\n }],\n /**\n * Background Position\n * @see https://tailwindcss.com/docs/background-position\n */\n 'bg-position': [{\n bg: scaleBgPosition()\n }],\n /**\n * Background Repeat\n * @see https://tailwindcss.com/docs/background-repeat\n */\n 'bg-repeat': [{\n bg: scaleBgRepeat()\n }],\n /**\n * Background Size\n * @see https://tailwindcss.com/docs/background-size\n */\n 'bg-size': [{\n bg: scaleBgSize()\n }],\n /**\n * Background Image\n * @see https://tailwindcss.com/docs/background-image\n */\n 'bg-image': [{\n bg: ['none', {\n linear: [{\n to: ['t', 'tr', 'r', 'br', 'b', 'bl', 'l', 'tl']\n }, isInteger, isArbitraryVariable, isArbitraryValue],\n radial: ['', isArbitraryVariable, isArbitraryValue],\n conic: [isInteger, isArbitraryVariable, isArbitraryValue]\n }, isArbitraryVariableImage, isArbitraryImage]\n }],\n /**\n * Background Color\n * @see https://tailwindcss.com/docs/background-color\n */\n 'bg-color': [{\n bg: scaleColor()\n }],\n /**\n * Gradient Color Stops From Position\n * @see https://tailwindcss.com/docs/gradient-color-stops\n */\n 'gradient-from-pos': [{\n from: scaleGradientStopPosition()\n }],\n /**\n * Gradient Color Stops Via Position\n * @see https://tailwindcss.com/docs/gradient-color-stops\n */\n 'gradient-via-pos': [{\n via: scaleGradientStopPosition()\n }],\n /**\n * Gradient Color Stops To Position\n * @see https://tailwindcss.com/docs/gradient-color-stops\n */\n 'gradient-to-pos': [{\n to: scaleGradientStopPosition()\n }],\n /**\n * Gradient Color Stops From\n * @see https://tailwindcss.com/docs/gradient-color-stops\n */\n 'gradient-from': [{\n from: scaleColor()\n }],\n /**\n * Gradient Color Stops Via\n * @see https://tailwindcss.com/docs/gradient-color-stops\n */\n 'gradient-via': [{\n via: scaleColor()\n }],\n /**\n * Gradient Color Stops To\n * @see https://tailwindcss.com/docs/gradient-color-stops\n */\n 'gradient-to': [{\n to: scaleColor()\n }],\n // ---------------\n // --- Borders ---\n // ---------------\n /**\n * Border Radius\n * @see https://tailwindcss.com/docs/border-radius\n */\n rounded: [{\n rounded: scaleRadius()\n }],\n /**\n * Border Radius Start\n * @see https://tailwindcss.com/docs/border-radius\n */\n 'rounded-s': [{\n 'rounded-s': scaleRadius()\n }],\n /**\n * Border Radius End\n * @see https://tailwindcss.com/docs/border-radius\n */\n 'rounded-e': [{\n 'rounded-e': scaleRadius()\n }],\n /**\n * Border Radius Top\n * @see https://tailwindcss.com/docs/border-radius\n */\n 'rounded-t': [{\n 'rounded-t': scaleRadius()\n }],\n /**\n * Border Radius Right\n * @see https://tailwindcss.com/docs/border-radius\n */\n 'rounded-r': [{\n 'rounded-r': scaleRadius()\n }],\n /**\n * Border Radius Bottom\n * @see https://tailwindcss.com/docs/border-radius\n */\n 'rounded-b': [{\n 'rounded-b': scaleRadius()\n }],\n /**\n * Border Radius Left\n * @see https://tailwindcss.com/docs/border-radius\n */\n 'rounded-l': [{\n 'rounded-l': scaleRadius()\n }],\n /**\n * Border Radius Start Start\n * @see https://tailwindcss.com/docs/border-radius\n */\n 'rounded-ss': [{\n 'rounded-ss': scaleRadius()\n }],\n /**\n * Border Radius Start End\n * @see https://tailwindcss.com/docs/border-radius\n */\n 'rounded-se': [{\n 'rounded-se': scaleRadius()\n }],\n /**\n * Border Radius End End\n * @see https://tailwindcss.com/docs/border-radius\n */\n 'rounded-ee': [{\n 'rounded-ee': scaleRadius()\n }],\n /**\n * Border Radius End Start\n * @see https://tailwindcss.com/docs/border-radius\n */\n 'rounded-es': [{\n 'rounded-es': scaleRadius()\n }],\n /**\n * Border Radius Top Left\n * @see https://tailwindcss.com/docs/border-radius\n */\n 'rounded-tl': [{\n 'rounded-tl': scaleRadius()\n }],\n /**\n * Border Radius Top Right\n * @see https://tailwindcss.com/docs/border-radius\n */\n 'rounded-tr': [{\n 'rounded-tr': scaleRadius()\n }],\n /**\n * Border Radius Bottom Right\n * @see https://tailwindcss.com/docs/border-radius\n */\n 'rounded-br': [{\n 'rounded-br': scaleRadius()\n }],\n /**\n * Border Radius Bottom Left\n * @see https://tailwindcss.com/docs/border-radius\n */\n 'rounded-bl': [{\n 'rounded-bl': scaleRadius()\n }],\n /**\n * Border Width\n * @see https://tailwindcss.com/docs/border-width\n */\n 'border-w': [{\n border: scaleBorderWidth()\n }],\n /**\n * Border Width Inline\n * @see https://tailwindcss.com/docs/border-width\n */\n 'border-w-x': [{\n 'border-x': scaleBorderWidth()\n }],\n /**\n * Border Width Block\n * @see https://tailwindcss.com/docs/border-width\n */\n 'border-w-y': [{\n 'border-y': scaleBorderWidth()\n }],\n /**\n * Border Width Inline Start\n * @see https://tailwindcss.com/docs/border-width\n */\n 'border-w-s': [{\n 'border-s': scaleBorderWidth()\n }],\n /**\n * Border Width Inline End\n * @see https://tailwindcss.com/docs/border-width\n */\n 'border-w-e': [{\n 'border-e': scaleBorderWidth()\n }],\n /**\n * Border Width Block Start\n * @see https://tailwindcss.com/docs/border-width\n */\n 'border-w-bs': [{\n 'border-bs': scaleBorderWidth()\n }],\n /**\n * Border Width Block End\n * @see https://tailwindcss.com/docs/border-width\n */\n 'border-w-be': [{\n 'border-be': scaleBorderWidth()\n }],\n /**\n * Border Width Top\n * @see https://tailwindcss.com/docs/border-width\n */\n 'border-w-t': [{\n 'border-t': scaleBorderWidth()\n }],\n /**\n * Border Width Right\n * @see https://tailwindcss.com/docs/border-width\n */\n 'border-w-r': [{\n 'border-r': scaleBorderWidth()\n }],\n /**\n * Border Width Bottom\n * @see https://tailwindcss.com/docs/border-width\n */\n 'border-w-b': [{\n 'border-b': scaleBorderWidth()\n }],\n /**\n * Border Width Left\n * @see https://tailwindcss.com/docs/border-width\n */\n 'border-w-l': [{\n 'border-l': scaleBorderWidth()\n }],\n /**\n * Divide Width X\n * @see https://tailwindcss.com/docs/border-width#between-children\n */\n 'divide-x': [{\n 'divide-x': scaleBorderWidth()\n }],\n /**\n * Divide Width X Reverse\n * @see https://tailwindcss.com/docs/border-width#between-children\n */\n 'divide-x-reverse': ['divide-x-reverse'],\n /**\n * Divide Width Y\n * @see https://tailwindcss.com/docs/border-width#between-children\n */\n 'divide-y': [{\n 'divide-y': scaleBorderWidth()\n }],\n /**\n * Divide Width Y Reverse\n * @see https://tailwindcss.com/docs/border-width#between-children\n */\n 'divide-y-reverse': ['divide-y-reverse'],\n /**\n * Border Style\n * @see https://tailwindcss.com/docs/border-style\n */\n 'border-style': [{\n border: [...scaleLineStyle(), 'hidden', 'none']\n }],\n /**\n * Divide Style\n * @see https://tailwindcss.com/docs/border-style#setting-the-divider-style\n */\n 'divide-style': [{\n divide: [...scaleLineStyle(), 'hidden', 'none']\n }],\n /**\n * Border Color\n * @see https://tailwindcss.com/docs/border-color\n */\n 'border-color': [{\n border: scaleColor()\n }],\n /**\n * Border Color Inline\n * @see https://tailwindcss.com/docs/border-color\n */\n 'border-color-x': [{\n 'border-x': scaleColor()\n }],\n /**\n * Border Color Block\n * @see https://tailwindcss.com/docs/border-color\n */\n 'border-color-y': [{\n 'border-y': scaleColor()\n }],\n /**\n * Border Color Inline Start\n * @see https://tailwindcss.com/docs/border-color\n */\n 'border-color-s': [{\n 'border-s': scaleColor()\n }],\n /**\n * Border Color Inline End\n * @see https://tailwindcss.com/docs/border-color\n */\n 'border-color-e': [{\n 'border-e': scaleColor()\n }],\n /**\n * Border Color Block Start\n * @see https://tailwindcss.com/docs/border-color\n */\n 'border-color-bs': [{\n 'border-bs': scaleColor()\n }],\n /**\n * Border Color Block End\n * @see https://tailwindcss.com/docs/border-color\n */\n 'border-color-be': [{\n 'border-be': scaleColor()\n }],\n /**\n * Border Color Top\n * @see https://tailwindcss.com/docs/border-color\n */\n 'border-color-t': [{\n 'border-t': scaleColor()\n }],\n /**\n * Border Color Right\n * @see https://tailwindcss.com/docs/border-color\n */\n 'border-color-r': [{\n 'border-r': scaleColor()\n }],\n /**\n * Border Color Bottom\n * @see https://tailwindcss.com/docs/border-color\n */\n 'border-color-b': [{\n 'border-b': scaleColor()\n }],\n /**\n * Border Color Left\n * @see https://tailwindcss.com/docs/border-color\n */\n 'border-color-l': [{\n 'border-l': scaleColor()\n }],\n /**\n * Divide Color\n * @see https://tailwindcss.com/docs/divide-color\n */\n 'divide-color': [{\n divide: scaleColor()\n }],\n /**\n * Outline Style\n * @see https://tailwindcss.com/docs/outline-style\n */\n 'outline-style': [{\n outline: [...scaleLineStyle(), 'none', 'hidden']\n }],\n /**\n * Outline Offset\n * @see https://tailwindcss.com/docs/outline-offset\n */\n 'outline-offset': [{\n 'outline-offset': [isNumber, isArbitraryVariable, isArbitraryValue]\n }],\n /**\n * Outline Width\n * @see https://tailwindcss.com/docs/outline-width\n */\n 'outline-w': [{\n outline: ['', isNumber, isArbitraryVariableLength, isArbitraryLength]\n }],\n /**\n * Outline Color\n * @see https://tailwindcss.com/docs/outline-color\n */\n 'outline-color': [{\n outline: scaleColor()\n }],\n // ---------------\n // --- Effects ---\n // ---------------\n /**\n * Box Shadow\n * @see https://tailwindcss.com/docs/box-shadow\n */\n shadow: [{\n shadow: [\n // Deprecated since Tailwind CSS v4.0.0\n '', 'none', themeShadow, isArbitraryVariableShadow, isArbitraryShadow]\n }],\n /**\n * Box Shadow Color\n * @see https://tailwindcss.com/docs/box-shadow#setting-the-shadow-color\n */\n 'shadow-color': [{\n shadow: scaleColor()\n }],\n /**\n * Inset Box Shadow\n * @see https://tailwindcss.com/docs/box-shadow#adding-an-inset-shadow\n */\n 'inset-shadow': [{\n 'inset-shadow': ['none', themeInsetShadow, isArbitraryVariableShadow, isArbitraryShadow]\n }],\n /**\n * Inset Box Shadow Color\n * @see https://tailwindcss.com/docs/box-shadow#setting-the-inset-shadow-color\n */\n 'inset-shadow-color': [{\n 'inset-shadow': scaleColor()\n }],\n /**\n * Ring Width\n * @see https://tailwindcss.com/docs/box-shadow#adding-a-ring\n */\n 'ring-w': [{\n ring: scaleBorderWidth()\n }],\n /**\n * Ring Width Inset\n * @see https://v3.tailwindcss.com/docs/ring-width#inset-rings\n * @deprecated since Tailwind CSS v4.0.0\n * @see https://github.com/tailwindlabs/tailwindcss/blob/v4.0.0/packages/tailwindcss/src/utilities.ts#L4158\n */\n 'ring-w-inset': ['ring-inset'],\n /**\n * Ring Color\n * @see https://tailwindcss.com/docs/box-shadow#setting-the-ring-color\n */\n 'ring-color': [{\n ring: scaleColor()\n }],\n /**\n * Ring Offset Width\n * @see https://v3.tailwindcss.com/docs/ring-offset-width\n * @deprecated since Tailwind CSS v4.0.0\n * @see https://github.com/tailwindlabs/tailwindcss/blob/v4.0.0/packages/tailwindcss/src/utilities.ts#L4158\n */\n 'ring-offset-w': [{\n 'ring-offset': [isNumber, isArbitraryLength]\n }],\n /**\n * Ring Offset Color\n * @see https://v3.tailwindcss.com/docs/ring-offset-color\n * @deprecated since Tailwind CSS v4.0.0\n * @see https://github.com/tailwindlabs/tailwindcss/blob/v4.0.0/packages/tailwindcss/src/utilities.ts#L4158\n */\n 'ring-offset-color': [{\n 'ring-offset': scaleColor()\n }],\n /**\n * Inset Ring Width\n * @see https://tailwindcss.com/docs/box-shadow#adding-an-inset-ring\n */\n 'inset-ring-w': [{\n 'inset-ring': scaleBorderWidth()\n }],\n /**\n * Inset Ring Color\n * @see https://tailwindcss.com/docs/box-shadow#setting-the-inset-ring-color\n */\n 'inset-ring-color': [{\n 'inset-ring': scaleColor()\n }],\n /**\n * Text Shadow\n * @see https://tailwindcss.com/docs/text-shadow\n */\n 'text-shadow': [{\n 'text-shadow': ['none', themeTextShadow, isArbitraryVariableShadow, isArbitraryShadow]\n }],\n /**\n * Text Shadow Color\n * @see https://tailwindcss.com/docs/text-shadow#setting-the-shadow-color\n */\n 'text-shadow-color': [{\n 'text-shadow': scaleColor()\n }],\n /**\n * Opacity\n * @see https://tailwindcss.com/docs/opacity\n */\n opacity: [{\n opacity: [isNumber, isArbitraryVariable, isArbitraryValue]\n }],\n /**\n * Mix Blend Mode\n * @see https://tailwindcss.com/docs/mix-blend-mode\n */\n 'mix-blend': [{\n 'mix-blend': [...scaleBlendMode(), 'plus-darker', 'plus-lighter']\n }],\n /**\n * Background Blend Mode\n * @see https://tailwindcss.com/docs/background-blend-mode\n */\n 'bg-blend': [{\n 'bg-blend': scaleBlendMode()\n }],\n /**\n * Mask Clip\n * @see https://tailwindcss.com/docs/mask-clip\n */\n 'mask-clip': [{\n 'mask-clip': ['border', 'padding', 'content', 'fill', 'stroke', 'view']\n }, 'mask-no-clip'],\n /**\n * Mask Composite\n * @see https://tailwindcss.com/docs/mask-composite\n */\n 'mask-composite': [{\n mask: ['add', 'subtract', 'intersect', 'exclude']\n }],\n /**\n * Mask Image\n * @see https://tailwindcss.com/docs/mask-image\n */\n 'mask-image-linear-pos': [{\n 'mask-linear': [isNumber]\n }],\n 'mask-image-linear-from-pos': [{\n 'mask-linear-from': scaleMaskImagePosition()\n }],\n 'mask-image-linear-to-pos': [{\n 'mask-linear-to': scaleMaskImagePosition()\n }],\n 'mask-image-linear-from-color': [{\n 'mask-linear-from': scaleColor()\n }],\n 'mask-image-linear-to-color': [{\n 'mask-linear-to': scaleColor()\n }],\n 'mask-image-t-from-pos': [{\n 'mask-t-from': scaleMaskImagePosition()\n }],\n 'mask-image-t-to-pos': [{\n 'mask-t-to': scaleMaskImagePosition()\n }],\n 'mask-image-t-from-color': [{\n 'mask-t-from': scaleColor()\n }],\n 'mask-image-t-to-color': [{\n 'mask-t-to': scaleColor()\n }],\n 'mask-image-r-from-pos': [{\n 'mask-r-from': scaleMaskImagePosition()\n }],\n 'mask-image-r-to-pos': [{\n 'mask-r-to': scaleMaskImagePosition()\n }],\n 'mask-image-r-from-color': [{\n 'mask-r-from': scaleColor()\n }],\n 'mask-image-r-to-color': [{\n 'mask-r-to': scaleColor()\n }],\n 'mask-image-b-from-pos': [{\n 'mask-b-from': scaleMaskImagePosition()\n }],\n 'mask-image-b-to-pos': [{\n 'mask-b-to': scaleMaskImagePosition()\n }],\n 'mask-image-b-from-color': [{\n 'mask-b-from': scaleColor()\n }],\n 'mask-image-b-to-color': [{\n 'mask-b-to': scaleColor()\n }],\n 'mask-image-l-from-pos': [{\n 'mask-l-from': scaleMaskImagePosition()\n }],\n 'mask-image-l-to-pos': [{\n 'mask-l-to': scaleMaskImagePosition()\n }],\n 'mask-image-l-from-color': [{\n 'mask-l-from': scaleColor()\n }],\n 'mask-image-l-to-color': [{\n 'mask-l-to': scaleColor()\n }],\n 'mask-image-x-from-pos': [{\n 'mask-x-from': scaleMaskImagePosition()\n }],\n 'mask-image-x-to-pos': [{\n 'mask-x-to': scaleMaskImagePosition()\n }],\n 'mask-image-x-from-color': [{\n 'mask-x-from': scaleColor()\n }],\n 'mask-image-x-to-color': [{\n 'mask-x-to': scaleColor()\n }],\n 'mask-image-y-from-pos': [{\n 'mask-y-from': scaleMaskImagePosition()\n }],\n 'mask-image-y-to-pos': [{\n 'mask-y-to': scaleMaskImagePosition()\n }],\n 'mask-image-y-from-color': [{\n 'mask-y-from': scaleColor()\n }],\n 'mask-image-y-to-color': [{\n 'mask-y-to': scaleColor()\n }],\n 'mask-image-radial': [{\n 'mask-radial': [isArbitraryVariable, isArbitraryValue]\n }],\n 'mask-image-radial-from-pos': [{\n 'mask-radial-from': scaleMaskImagePosition()\n }],\n 'mask-image-radial-to-pos': [{\n 'mask-radial-to': scaleMaskImagePosition()\n }],\n 'mask-image-radial-from-color': [{\n 'mask-radial-from': scaleColor()\n }],\n 'mask-image-radial-to-color': [{\n 'mask-radial-to': scaleColor()\n }],\n 'mask-image-radial-shape': [{\n 'mask-radial': ['circle', 'ellipse']\n }],\n 'mask-image-radial-size': [{\n 'mask-radial': [{\n closest: ['side', 'corner'],\n farthest: ['side', 'corner']\n }]\n }],\n 'mask-image-radial-pos': [{\n 'mask-radial-at': scalePosition()\n }],\n 'mask-image-conic-pos': [{\n 'mask-conic': [isNumber]\n }],\n 'mask-image-conic-from-pos': [{\n 'mask-conic-from': scaleMaskImagePosition()\n }],\n 'mask-image-conic-to-pos': [{\n 'mask-conic-to': scaleMaskImagePosition()\n }],\n 'mask-image-conic-from-color': [{\n 'mask-conic-from': scaleColor()\n }],\n 'mask-image-conic-to-color': [{\n 'mask-conic-to': scaleColor()\n }],\n /**\n * Mask Mode\n * @see https://tailwindcss.com/docs/mask-mode\n */\n 'mask-mode': [{\n mask: ['alpha', 'luminance', 'match']\n }],\n /**\n * Mask Origin\n * @see https://tailwindcss.com/docs/mask-origin\n */\n 'mask-origin': [{\n 'mask-origin': ['border', 'padding', 'content', 'fill', 'stroke', 'view']\n }],\n /**\n * Mask Position\n * @see https://tailwindcss.com/docs/mask-position\n */\n 'mask-position': [{\n mask: scaleBgPosition()\n }],\n /**\n * Mask Repeat\n * @see https://tailwindcss.com/docs/mask-repeat\n */\n 'mask-repeat': [{\n mask: scaleBgRepeat()\n }],\n /**\n * Mask Size\n * @see https://tailwindcss.com/docs/mask-size\n */\n 'mask-size': [{\n mask: scaleBgSize()\n }],\n /**\n * Mask Type\n * @see https://tailwindcss.com/docs/mask-type\n */\n 'mask-type': [{\n 'mask-type': ['alpha', 'luminance']\n }],\n /**\n * Mask Image\n * @see https://tailwindcss.com/docs/mask-image\n */\n 'mask-image': [{\n mask: ['none', isArbitraryVariable, isArbitraryValue]\n }],\n // ---------------\n // --- Filters ---\n // ---------------\n /**\n * Filter\n * @see https://tailwindcss.com/docs/filter\n */\n filter: [{\n filter: [\n // Deprecated since Tailwind CSS v3.0.0\n '', 'none', isArbitraryVariable, isArbitraryValue]\n }],\n /**\n * Blur\n * @see https://tailwindcss.com/docs/blur\n */\n blur: [{\n blur: scaleBlur()\n }],\n /**\n * Brightness\n * @see https://tailwindcss.com/docs/brightness\n */\n brightness: [{\n brightness: [isNumber, isArbitraryVariable, isArbitraryValue]\n }],\n /**\n * Contrast\n * @see https://tailwindcss.com/docs/contrast\n */\n contrast: [{\n contrast: [isNumber, isArbitraryVariable, isArbitraryValue]\n }],\n /**\n * Drop Shadow\n * @see https://tailwindcss.com/docs/drop-shadow\n */\n 'drop-shadow': [{\n 'drop-shadow': [\n // Deprecated since Tailwind CSS v4.0.0\n '', 'none', themeDropShadow, isArbitraryVariableShadow, isArbitraryShadow]\n }],\n /**\n * Drop Shadow Color\n * @see https://tailwindcss.com/docs/filter-drop-shadow#setting-the-shadow-color\n */\n 'drop-shadow-color': [{\n 'drop-shadow': scaleColor()\n }],\n /**\n * Grayscale\n * @see https://tailwindcss.com/docs/grayscale\n */\n grayscale: [{\n grayscale: ['', isNumber, isArbitraryVariable, isArbitraryValue]\n }],\n /**\n * Hue Rotate\n * @see https://tailwindcss.com/docs/hue-rotate\n */\n 'hue-rotate': [{\n 'hue-rotate': [isNumber, isArbitraryVariable, isArbitraryValue]\n }],\n /**\n * Invert\n * @see https://tailwindcss.com/docs/invert\n */\n invert: [{\n invert: ['', isNumber, isArbitraryVariable, isArbitraryValue]\n }],\n /**\n * Saturate\n * @see https://tailwindcss.com/docs/saturate\n */\n saturate: [{\n saturate: [isNumber, isArbitraryVariable, isArbitraryValue]\n }],\n /**\n * Sepia\n * @see https://tailwindcss.com/docs/sepia\n */\n sepia: [{\n sepia: ['', isNumber, isArbitraryVariable, isArbitraryValue]\n }],\n /**\n * Backdrop Filter\n * @see https://tailwindcss.com/docs/backdrop-filter\n */\n 'backdrop-filter': [{\n 'backdrop-filter': [\n // Deprecated since Tailwind CSS v3.0.0\n '', 'none', isArbitraryVariable, isArbitraryValue]\n }],\n /**\n * Backdrop Blur\n * @see https://tailwindcss.com/docs/backdrop-blur\n */\n 'backdrop-blur': [{\n 'backdrop-blur': scaleBlur()\n }],\n /**\n * Backdrop Brightness\n * @see https://tailwindcss.com/docs/backdrop-brightness\n */\n 'backdrop-brightness': [{\n 'backdrop-brightness': [isNumber, isArbitraryVariable, isArbitraryValue]\n }],\n /**\n * Backdrop Contrast\n * @see https://tailwindcss.com/docs/backdrop-contrast\n */\n 'backdrop-contrast': [{\n 'backdrop-contrast': [isNumber, isArbitraryVariable, isArbitraryValue]\n }],\n /**\n * Backdrop Grayscale\n * @see https://tailwindcss.com/docs/backdrop-grayscale\n */\n 'backdrop-grayscale': [{\n 'backdrop-grayscale': ['', isNumber, isArbitraryVariable, isArbitraryValue]\n }],\n /**\n * Backdrop Hue Rotate\n * @see https://tailwindcss.com/docs/backdrop-hue-rotate\n */\n 'backdrop-hue-rotate': [{\n 'backdrop-hue-rotate': [isNumber, isArbitraryVariable, isArbitraryValue]\n }],\n /**\n * Backdrop Invert\n * @see https://tailwindcss.com/docs/backdrop-invert\n */\n 'backdrop-invert': [{\n 'backdrop-invert': ['', isNumber, isArbitraryVariable, isArbitraryValue]\n }],\n /**\n * Backdrop Opacity\n * @see https://tailwindcss.com/docs/backdrop-opacity\n */\n 'backdrop-opacity': [{\n 'backdrop-opacity': [isNumber, isArbitraryVariable, isArbitraryValue]\n }],\n /**\n * Backdrop Saturate\n * @see https://tailwindcss.com/docs/backdrop-saturate\n */\n 'backdrop-saturate': [{\n 'backdrop-saturate': [isNumber, isArbitraryVariable, isArbitraryValue]\n }],\n /**\n * Backdrop Sepia\n * @see https://tailwindcss.com/docs/backdrop-sepia\n */\n 'backdrop-sepia': [{\n 'backdrop-sepia': ['', isNumber, isArbitraryVariable, isArbitraryValue]\n }],\n // --------------\n // --- Tables ---\n // --------------\n /**\n * Border Collapse\n * @see https://tailwindcss.com/docs/border-collapse\n */\n 'border-collapse': [{\n border: ['collapse', 'separate']\n }],\n /**\n * Border Spacing\n * @see https://tailwindcss.com/docs/border-spacing\n */\n 'border-spacing': [{\n 'border-spacing': scaleUnambiguousSpacing()\n }],\n /**\n * Border Spacing X\n * @see https://tailwindcss.com/docs/border-spacing\n */\n 'border-spacing-x': [{\n 'border-spacing-x': scaleUnambiguousSpacing()\n }],\n /**\n * Border Spacing Y\n * @see https://tailwindcss.com/docs/border-spacing\n */\n 'border-spacing-y': [{\n 'border-spacing-y': scaleUnambiguousSpacing()\n }],\n /**\n * Table Layout\n * @see https://tailwindcss.com/docs/table-layout\n */\n 'table-layout': [{\n table: ['auto', 'fixed']\n }],\n /**\n * Caption Side\n * @see https://tailwindcss.com/docs/caption-side\n */\n caption: [{\n caption: ['top', 'bottom']\n }],\n // ---------------------------------\n // --- Transitions and Animation ---\n // ---------------------------------\n /**\n * Transition Property\n * @see https://tailwindcss.com/docs/transition-property\n */\n transition: [{\n transition: ['', 'all', 'colors', 'opacity', 'shadow', 'transform', 'none', isArbitraryVariable, isArbitraryValue]\n }],\n /**\n * Transition Behavior\n * @see https://tailwindcss.com/docs/transition-behavior\n */\n 'transition-behavior': [{\n transition: ['normal', 'discrete']\n }],\n /**\n * Transition Duration\n * @see https://tailwindcss.com/docs/transition-duration\n */\n duration: [{\n duration: [isNumber, 'initial', isArbitraryVariable, isArbitraryValue]\n }],\n /**\n * Transition Timing Function\n * @see https://tailwindcss.com/docs/transition-timing-function\n */\n ease: [{\n ease: ['linear', 'initial', themeEase, isArbitraryVariable, isArbitraryValue]\n }],\n /**\n * Transition Delay\n * @see https://tailwindcss.com/docs/transition-delay\n */\n delay: [{\n delay: [isNumber, isArbitraryVariable, isArbitraryValue]\n }],\n /**\n * Animation\n * @see https://tailwindcss.com/docs/animation\n */\n animate: [{\n animate: ['none', themeAnimate, isArbitraryVariable, isArbitraryValue]\n }],\n // ------------------\n // --- Transforms ---\n // ------------------\n /**\n * Backface Visibility\n * @see https://tailwindcss.com/docs/backface-visibility\n */\n backface: [{\n backface: ['hidden', 'visible']\n }],\n /**\n * Perspective\n * @see https://tailwindcss.com/docs/perspective\n */\n perspective: [{\n perspective: [themePerspective, isArbitraryVariable, isArbitraryValue]\n }],\n /**\n * Perspective Origin\n * @see https://tailwindcss.com/docs/perspective-origin\n */\n 'perspective-origin': [{\n 'perspective-origin': scalePositionWithArbitrary()\n }],\n /**\n * Rotate\n * @see https://tailwindcss.com/docs/rotate\n */\n rotate: [{\n rotate: scaleRotate()\n }],\n /**\n * Rotate X\n * @see https://tailwindcss.com/docs/rotate\n */\n 'rotate-x': [{\n 'rotate-x': scaleRotate()\n }],\n /**\n * Rotate Y\n * @see https://tailwindcss.com/docs/rotate\n */\n 'rotate-y': [{\n 'rotate-y': scaleRotate()\n }],\n /**\n * Rotate Z\n * @see https://tailwindcss.com/docs/rotate\n */\n 'rotate-z': [{\n 'rotate-z': scaleRotate()\n }],\n /**\n * Scale\n * @see https://tailwindcss.com/docs/scale\n */\n scale: [{\n scale: scaleScale()\n }],\n /**\n * Scale X\n * @see https://tailwindcss.com/docs/scale\n */\n 'scale-x': [{\n 'scale-x': scaleScale()\n }],\n /**\n * Scale Y\n * @see https://tailwindcss.com/docs/scale\n */\n 'scale-y': [{\n 'scale-y': scaleScale()\n }],\n /**\n * Scale Z\n * @see https://tailwindcss.com/docs/scale\n */\n 'scale-z': [{\n 'scale-z': scaleScale()\n }],\n /**\n * Scale 3D\n * @see https://tailwindcss.com/docs/scale\n */\n 'scale-3d': ['scale-3d'],\n /**\n * Skew\n * @see https://tailwindcss.com/docs/skew\n */\n skew: [{\n skew: scaleSkew()\n }],\n /**\n * Skew X\n * @see https://tailwindcss.com/docs/skew\n */\n 'skew-x': [{\n 'skew-x': scaleSkew()\n }],\n /**\n * Skew Y\n * @see https://tailwindcss.com/docs/skew\n */\n 'skew-y': [{\n 'skew-y': scaleSkew()\n }],\n /**\n * Transform\n * @see https://tailwindcss.com/docs/transform\n */\n transform: [{\n transform: [isArbitraryVariable, isArbitraryValue, '', 'none', 'gpu', 'cpu']\n }],\n /**\n * Transform Origin\n * @see https://tailwindcss.com/docs/transform-origin\n */\n 'transform-origin': [{\n origin: scalePositionWithArbitrary()\n }],\n /**\n * Transform Style\n * @see https://tailwindcss.com/docs/transform-style\n */\n 'transform-style': [{\n transform: ['3d', 'flat']\n }],\n /**\n * Translate\n * @see https://tailwindcss.com/docs/translate\n */\n translate: [{\n translate: scaleTranslate()\n }],\n /**\n * Translate X\n * @see https://tailwindcss.com/docs/translate\n */\n 'translate-x': [{\n 'translate-x': scaleTranslate()\n }],\n /**\n * Translate Y\n * @see https://tailwindcss.com/docs/translate\n */\n 'translate-y': [{\n 'translate-y': scaleTranslate()\n }],\n /**\n * Translate Z\n * @see https://tailwindcss.com/docs/translate\n */\n 'translate-z': [{\n 'translate-z': scaleTranslate()\n }],\n /**\n * Translate None\n * @see https://tailwindcss.com/docs/translate\n */\n 'translate-none': ['translate-none'],\n /**\n * Zoom\n * @see https://tailwindcss.com/docs/zoom\n */\n zoom: [{\n zoom: [isInteger, isArbitraryVariable, isArbitraryValue]\n }],\n // ---------------------\n // --- Interactivity ---\n // ---------------------\n /**\n * Accent Color\n * @see https://tailwindcss.com/docs/accent-color\n */\n accent: [{\n accent: scaleColor()\n }],\n /**\n * Appearance\n * @see https://tailwindcss.com/docs/appearance\n */\n appearance: [{\n appearance: ['none', 'auto']\n }],\n /**\n * Caret Color\n * @see https://tailwindcss.com/docs/just-in-time-mode#caret-color-utilities\n */\n 'caret-color': [{\n caret: scaleColor()\n }],\n /**\n * Color Scheme\n * @see https://tailwindcss.com/docs/color-scheme\n */\n 'color-scheme': [{\n scheme: ['normal', 'dark', 'light', 'light-dark', 'only-dark', 'only-light']\n }],\n /**\n * Cursor\n * @see https://tailwindcss.com/docs/cursor\n */\n cursor: [{\n cursor: ['auto', 'default', 'pointer', 'wait', 'text', 'move', 'help', 'not-allowed', 'none', 'context-menu', 'progress', 'cell', 'crosshair', 'vertical-text', 'alias', 'copy', 'no-drop', 'grab', 'grabbing', 'all-scroll', 'col-resize', 'row-resize', 'n-resize', 'e-resize', 's-resize', 'w-resize', 'ne-resize', 'nw-resize', 'se-resize', 'sw-resize', 'ew-resize', 'ns-resize', 'nesw-resize', 'nwse-resize', 'zoom-in', 'zoom-out', isArbitraryVariable, isArbitraryValue]\n }],\n /**\n * Field Sizing\n * @see https://tailwindcss.com/docs/field-sizing\n */\n 'field-sizing': [{\n 'field-sizing': ['fixed', 'content']\n }],\n /**\n * Pointer Events\n * @see https://tailwindcss.com/docs/pointer-events\n */\n 'pointer-events': [{\n 'pointer-events': ['auto', 'none']\n }],\n /**\n * Resize\n * @see https://tailwindcss.com/docs/resize\n */\n resize: [{\n resize: ['none', '', 'y', 'x']\n }],\n /**\n * Scroll Behavior\n * @see https://tailwindcss.com/docs/scroll-behavior\n */\n 'scroll-behavior': [{\n scroll: ['auto', 'smooth']\n }],\n /**\n * Scrollbar Thumb Color\n * @see https://tailwindcss.com/docs/scrollbar-color\n */\n 'scrollbar-thumb-color': [{\n 'scrollbar-thumb': scaleColor()\n }],\n /**\n * Scrollbar Track Color\n * @see https://tailwindcss.com/docs/scrollbar-color\n */\n 'scrollbar-track-color': [{\n 'scrollbar-track': scaleColor()\n }],\n /**\n * Scrollbar Gutter\n * @see https://tailwindcss.com/docs/scrollbar-gutter\n */\n 'scrollbar-gutter': [{\n 'scrollbar-gutter': ['auto', 'stable', 'both']\n }],\n /**\n * Scrollbar Width\n * @see https://tailwindcss.com/docs/scrollbar-width\n */\n 'scrollbar-w': [{\n scrollbar: ['auto', 'thin', 'none']\n }],\n /**\n * Scroll Margin\n * @see https://tailwindcss.com/docs/scroll-margin\n */\n 'scroll-m': [{\n 'scroll-m': scaleUnambiguousSpacing()\n }],\n /**\n * Scroll Margin Inline\n * @see https://tailwindcss.com/docs/scroll-margin\n */\n 'scroll-mx': [{\n 'scroll-mx': scaleUnambiguousSpacing()\n }],\n /**\n * Scroll Margin Block\n * @see https://tailwindcss.com/docs/scroll-margin\n */\n 'scroll-my': [{\n 'scroll-my': scaleUnambiguousSpacing()\n }],\n /**\n * Scroll Margin Inline Start\n * @see https://tailwindcss.com/docs/scroll-margin\n */\n 'scroll-ms': [{\n 'scroll-ms': scaleUnambiguousSpacing()\n }],\n /**\n * Scroll Margin Inline End\n * @see https://tailwindcss.com/docs/scroll-margin\n */\n 'scroll-me': [{\n 'scroll-me': scaleUnambiguousSpacing()\n }],\n /**\n * Scroll Margin Block Start\n * @see https://tailwindcss.com/docs/scroll-margin\n */\n 'scroll-mbs': [{\n 'scroll-mbs': scaleUnambiguousSpacing()\n }],\n /**\n * Scroll Margin Block End\n * @see https://tailwindcss.com/docs/scroll-margin\n */\n 'scroll-mbe': [{\n 'scroll-mbe': scaleUnambiguousSpacing()\n }],\n /**\n * Scroll Margin Top\n * @see https://tailwindcss.com/docs/scroll-margin\n */\n 'scroll-mt': [{\n 'scroll-mt': scaleUnambiguousSpacing()\n }],\n /**\n * Scroll Margin Right\n * @see https://tailwindcss.com/docs/scroll-margin\n */\n 'scroll-mr': [{\n 'scroll-mr': scaleUnambiguousSpacing()\n }],\n /**\n * Scroll Margin Bottom\n * @see https://tailwindcss.com/docs/scroll-margin\n */\n 'scroll-mb': [{\n 'scroll-mb': scaleUnambiguousSpacing()\n }],\n /**\n * Scroll Margin Left\n * @see https://tailwindcss.com/docs/scroll-margin\n */\n 'scroll-ml': [{\n 'scroll-ml': scaleUnambiguousSpacing()\n }],\n /**\n * Scroll Padding\n * @see https://tailwindcss.com/docs/scroll-padding\n */\n 'scroll-p': [{\n 'scroll-p': scaleUnambiguousSpacing()\n }],\n /**\n * Scroll Padding Inline\n * @see https://tailwindcss.com/docs/scroll-padding\n */\n 'scroll-px': [{\n 'scroll-px': scaleUnambiguousSpacing()\n }],\n /**\n * Scroll Padding Block\n * @see https://tailwindcss.com/docs/scroll-padding\n */\n 'scroll-py': [{\n 'scroll-py': scaleUnambiguousSpacing()\n }],\n /**\n * Scroll Padding Inline Start\n * @see https://tailwindcss.com/docs/scroll-padding\n */\n 'scroll-ps': [{\n 'scroll-ps': scaleUnambiguousSpacing()\n }],\n /**\n * Scroll Padding Inline End\n * @see https://tailwindcss.com/docs/scroll-padding\n */\n 'scroll-pe': [{\n 'scroll-pe': scaleUnambiguousSpacing()\n }],\n /**\n * Scroll Padding Block Start\n * @see https://tailwindcss.com/docs/scroll-padding\n */\n 'scroll-pbs': [{\n 'scroll-pbs': scaleUnambiguousSpacing()\n }],\n /**\n * Scroll Padding Block End\n * @see https://tailwindcss.com/docs/scroll-padding\n */\n 'scroll-pbe': [{\n 'scroll-pbe': scaleUnambiguousSpacing()\n }],\n /**\n * Scroll Padding Top\n * @see https://tailwindcss.com/docs/scroll-padding\n */\n 'scroll-pt': [{\n 'scroll-pt': scaleUnambiguousSpacing()\n }],\n /**\n * Scroll Padding Right\n * @see https://tailwindcss.com/docs/scroll-padding\n */\n 'scroll-pr': [{\n 'scroll-pr': scaleUnambiguousSpacing()\n }],\n /**\n * Scroll Padding Bottom\n * @see https://tailwindcss.com/docs/scroll-padding\n */\n 'scroll-pb': [{\n 'scroll-pb': scaleUnambiguousSpacing()\n }],\n /**\n * Scroll Padding Left\n * @see https://tailwindcss.com/docs/scroll-padding\n */\n 'scroll-pl': [{\n 'scroll-pl': scaleUnambiguousSpacing()\n }],\n /**\n * Scroll Snap Align\n * @see https://tailwindcss.com/docs/scroll-snap-align\n */\n 'snap-align': [{\n snap: ['start', 'end', 'center', 'align-none']\n }],\n /**\n * Scroll Snap Stop\n * @see https://tailwindcss.com/docs/scroll-snap-stop\n */\n 'snap-stop': [{\n snap: ['normal', 'always']\n }],\n /**\n * Scroll Snap Type\n * @see https://tailwindcss.com/docs/scroll-snap-type\n */\n 'snap-type': [{\n snap: ['none', 'x', 'y', 'both']\n }],\n /**\n * Scroll Snap Type Strictness\n * @see https://tailwindcss.com/docs/scroll-snap-type\n */\n 'snap-strictness': [{\n snap: ['mandatory', 'proximity']\n }],\n /**\n * Touch Action\n * @see https://tailwindcss.com/docs/touch-action\n */\n touch: [{\n touch: ['auto', 'none', 'manipulation']\n }],\n /**\n * Touch Action X\n * @see https://tailwindcss.com/docs/touch-action\n */\n 'touch-x': [{\n 'touch-pan': ['x', 'left', 'right']\n }],\n /**\n * Touch Action Y\n * @see https://tailwindcss.com/docs/touch-action\n */\n 'touch-y': [{\n 'touch-pan': ['y', 'up', 'down']\n }],\n /**\n * Touch Action Pinch Zoom\n * @see https://tailwindcss.com/docs/touch-action\n */\n 'touch-pz': ['touch-pinch-zoom'],\n /**\n * User Select\n * @see https://tailwindcss.com/docs/user-select\n */\n select: [{\n select: ['none', 'text', 'all', 'auto']\n }],\n /**\n * Will Change\n * @see https://tailwindcss.com/docs/will-change\n */\n 'will-change': [{\n 'will-change': ['auto', 'scroll', 'contents', 'transform', isArbitraryVariable, isArbitraryValue]\n }],\n // -----------\n // --- SVG ---\n // -----------\n /**\n * Fill\n * @see https://tailwindcss.com/docs/fill\n */\n fill: [{\n fill: ['none', ...scaleColor()]\n }],\n /**\n * Stroke Width\n * @see https://tailwindcss.com/docs/stroke-width\n */\n 'stroke-w': [{\n stroke: [isNumber, isArbitraryVariableLength, isArbitraryLength, isArbitraryNumber]\n }],\n /**\n * Stroke\n * @see https://tailwindcss.com/docs/stroke\n */\n stroke: [{\n stroke: ['none', ...scaleColor()]\n }],\n // ---------------------\n // --- Accessibility ---\n // ---------------------\n /**\n * Forced Color Adjust\n * @see https://tailwindcss.com/docs/forced-color-adjust\n */\n 'forced-color-adjust': [{\n 'forced-color-adjust': ['auto', 'none']\n }]\n },\n conflictingClassGroups: {\n 'container-named': ['container-type'],\n overflow: ['overflow-x', 'overflow-y'],\n overscroll: ['overscroll-x', 'overscroll-y'],\n inset: ['inset-x', 'inset-y', 'inset-bs', 'inset-be', 'start', 'end', 'top', 'right', 'bottom', 'left'],\n 'inset-x': ['right', 'left'],\n 'inset-y': ['top', 'bottom'],\n flex: ['basis', 'grow', 'shrink'],\n gap: ['gap-x', 'gap-y'],\n p: ['px', 'py', 'ps', 'pe', 'pbs', 'pbe', 'pt', 'pr', 'pb', 'pl'],\n px: ['pr', 'pl'],\n py: ['pt', 'pb'],\n m: ['mx', 'my', 'ms', 'me', 'mbs', 'mbe', 'mt', 'mr', 'mb', 'ml'],\n mx: ['mr', 'ml'],\n my: ['mt', 'mb'],\n size: ['w', 'h'],\n 'font-size': ['leading'],\n 'fvn-normal': ['fvn-ordinal', 'fvn-slashed-zero', 'fvn-figure', 'fvn-spacing', 'fvn-fraction'],\n 'fvn-ordinal': ['fvn-normal'],\n 'fvn-slashed-zero': ['fvn-normal'],\n 'fvn-figure': ['fvn-normal'],\n 'fvn-spacing': ['fvn-normal'],\n 'fvn-fraction': ['fvn-normal'],\n 'line-clamp': ['display', 'overflow'],\n rounded: ['rounded-s', 'rounded-e', 'rounded-t', 'rounded-r', 'rounded-b', 'rounded-l', 'rounded-ss', 'rounded-se', 'rounded-ee', 'rounded-es', 'rounded-tl', 'rounded-tr', 'rounded-br', 'rounded-bl'],\n 'rounded-s': ['rounded-ss', 'rounded-es'],\n 'rounded-e': ['rounded-se', 'rounded-ee'],\n 'rounded-t': ['rounded-tl', 'rounded-tr'],\n 'rounded-r': ['rounded-tr', 'rounded-br'],\n 'rounded-b': ['rounded-br', 'rounded-bl'],\n 'rounded-l': ['rounded-tl', 'rounded-bl'],\n 'border-spacing': ['border-spacing-x', 'border-spacing-y'],\n 'border-w': ['border-w-x', 'border-w-y', 'border-w-s', 'border-w-e', 'border-w-bs', 'border-w-be', 'border-w-t', 'border-w-r', 'border-w-b', 'border-w-l'],\n 'border-w-x': ['border-w-r', 'border-w-l'],\n 'border-w-y': ['border-w-t', 'border-w-b'],\n 'border-color': ['border-color-x', 'border-color-y', 'border-color-s', 'border-color-e', 'border-color-bs', 'border-color-be', 'border-color-t', 'border-color-r', 'border-color-b', 'border-color-l'],\n 'border-color-x': ['border-color-r', 'border-color-l'],\n 'border-color-y': ['border-color-t', 'border-color-b'],\n translate: ['translate-x', 'translate-y', 'translate-none'],\n 'translate-none': ['translate', 'translate-x', 'translate-y', 'translate-z'],\n 'scroll-m': ['scroll-mx', 'scroll-my', 'scroll-ms', 'scroll-me', 'scroll-mbs', 'scroll-mbe', 'scroll-mt', 'scroll-mr', 'scroll-mb', 'scroll-ml'],\n 'scroll-mx': ['scroll-mr', 'scroll-ml'],\n 'scroll-my': ['scroll-mt', 'scroll-mb'],\n 'scroll-p': ['scroll-px', 'scroll-py', 'scroll-ps', 'scroll-pe', 'scroll-pbs', 'scroll-pbe', 'scroll-pt', 'scroll-pr', 'scroll-pb', 'scroll-pl'],\n 'scroll-px': ['scroll-pr', 'scroll-pl'],\n 'scroll-py': ['scroll-pt', 'scroll-pb'],\n touch: ['touch-x', 'touch-y', 'touch-pz'],\n 'touch-x': ['touch'],\n 'touch-y': ['touch'],\n 'touch-pz': ['touch']\n },\n conflictingClassGroupModifiers: {\n 'font-size': ['leading']\n },\n postfixLookupClassGroups: ['container-type'],\n orderSensitiveModifiers: ['*', '**', 'after', 'backdrop', 'before', 'details-content', 'file', 'first-letter', 'first-line', 'marker', 'placeholder', 'selection']\n };\n};\n\n/**\n * @param baseConfig Config where other config will be merged into. This object will be mutated.\n * @param configExtension Partial config to merge into the `baseConfig`.\n */\nconst mergeConfigs = (baseConfig, {\n cacheSize,\n prefix,\n experimentalParseClassName,\n extend = {},\n override = {}\n}) => {\n overrideProperty(baseConfig, 'cacheSize', cacheSize);\n overrideProperty(baseConfig, 'prefix', prefix);\n overrideProperty(baseConfig, 'experimentalParseClassName', experimentalParseClassName);\n overrideConfigProperties(baseConfig.theme, override.theme);\n overrideConfigProperties(baseConfig.classGroups, override.classGroups);\n overrideConfigProperties(baseConfig.conflictingClassGroups, override.conflictingClassGroups);\n overrideConfigProperties(baseConfig.conflictingClassGroupModifiers, override.conflictingClassGroupModifiers);\n overrideProperty(baseConfig, 'postfixLookupClassGroups', override.postfixLookupClassGroups);\n overrideProperty(baseConfig, 'orderSensitiveModifiers', override.orderSensitiveModifiers);\n mergeConfigProperties(baseConfig.theme, extend.theme);\n mergeConfigProperties(baseConfig.classGroups, extend.classGroups);\n mergeConfigProperties(baseConfig.conflictingClassGroups, extend.conflictingClassGroups);\n mergeConfigProperties(baseConfig.conflictingClassGroupModifiers, extend.conflictingClassGroupModifiers);\n mergeArrayProperties(baseConfig, extend, 'postfixLookupClassGroups');\n mergeArrayProperties(baseConfig, extend, 'orderSensitiveModifiers');\n return baseConfig;\n};\nconst overrideProperty = (baseObject, overrideKey, overrideValue) => {\n if (overrideValue !== undefined) {\n baseObject[overrideKey] = overrideValue;\n }\n};\nconst overrideConfigProperties = (baseObject, overrideObject) => {\n if (overrideObject) {\n for (const key in overrideObject) {\n overrideProperty(baseObject, key, overrideObject[key]);\n }\n }\n};\nconst mergeConfigProperties = (baseObject, mergeObject) => {\n if (mergeObject) {\n for (const key in mergeObject) {\n mergeArrayProperties(baseObject, mergeObject, key);\n }\n }\n};\nconst mergeArrayProperties = (baseObject, mergeObject, key) => {\n const mergeValue = mergeObject[key];\n if (mergeValue !== undefined) {\n baseObject[key] = baseObject[key] ? baseObject[key].concat(mergeValue) : mergeValue;\n }\n};\nconst extendTailwindMerge = (configExtension, ...createConfig) => typeof configExtension === 'function' ? createTailwindMerge(getDefaultConfig, configExtension, ...createConfig) : createTailwindMerge(() => mergeConfigs(getDefaultConfig(), configExtension), ...createConfig);\nconst twMerge = /*#__PURE__*/createTailwindMerge(getDefaultConfig);\nexport { createTailwindMerge, extendTailwindMerge, fromTheme, getDefaultConfig, mergeConfigs, twJoin, twMerge, validators };\n//# sourceMappingURL=bundle-mjs.mjs.map\n","import { type ClassValue, clsx } from 'clsx';\nimport { twMerge } from 'tailwind-merge';\n\nexport function cn(...inputs: ClassValue[]) {\n return twMerge(clsx(inputs));\n}\n\n/**\n * Returns true when `icon` is safe to use as the `src` of an `<img>` rendered\n * inside the inspector chrome. Accepts http(s) URLs and `data:image/*` URIs\n * for raster image types only. SVG data URIs are rejected because they can\n * include `<script>`/event handlers that execute when the document parses\n * the inline document (the `<img>` tag itself does not run scripts in modern\n * browsers, but adjacent <object>/<embed>/<iframe> renders would). Anything\n * else (emoji, plain text, javascript:, file:, etc.) falls through to the\n * text-rendering path that already handles emoji icons.\n */\nexport function isAllowedIconUrl(icon: string): boolean {\n if (icon.startsWith('https://') || icon.startsWith('http://')) return true;\n if (\n icon.startsWith('data:image/png') ||\n icon.startsWith('data:image/jpeg') ||\n icon.startsWith('data:image/gif') ||\n icon.startsWith('data:image/webp')\n ) {\n return true;\n }\n return false;\n}\n","import type {\n McpUiDisplayMode,\n McpUiHostContext,\n McpUiHostCapabilities,\n McpUiStyles,\n} from '@modelcontextprotocol/ext-apps';\nimport type { ScreenWidth } from './inspector-types';\n\ntype Platform = NonNullable<McpUiHostContext['platform']>;\n\n/**\n * Props passed to a host shell (conversation chrome) component.\n * Each host implements a React component matching this interface.\n */\nexport interface HostConversationProps {\n /** The resource content (iframe or children) to render inside the conversation */\n children: React.ReactNode;\n /** Current simulated screen width */\n screenWidth: ScreenWidth;\n /** Current MCP display mode */\n displayMode: McpUiDisplayMode;\n /** Current platform (desktop/mobile/web) */\n platform: Platform;\n /** Callback when the shell requests a display mode change (e.g., close button) */\n onRequestDisplayMode?: (mode: McpUiDisplayMode) => void;\n /** App name for display in conversation chrome */\n appName?: string;\n /** App icon (emoji or URL) for display in conversation chrome */\n appIcon?: string;\n /** User message to show in the conversation (decorative) */\n userMessage?: string;\n /** Optional action element rendered in the conversation header (e.g., Run button in Prod Tools mode) */\n headerAction?: React.ReactNode;\n /**\n * Called when the content container width changes (via ResizeObserver).\n * The inspector uses this to set containerDimensions.maxWidth in hostContext,\n * matching what real hosts report to apps.\n */\n onContentWidthChange?: (width: number) => void;\n}\n\n/** Unique identifier for a host */\nexport type HostId = 'chatgpt' | 'claude' | (string & {});\n\n/**\n * A registered host shell provides the conversation chrome and\n * functional configuration for a specific MCP App host.\n */\nexport interface HostShell {\n /** Unique host identifier */\n id: HostId;\n /** Human-readable name for the sidebar dropdown */\n label: string;\n /** The conversation shell React component */\n Conversation: React.ComponentType<HostConversationProps>;\n /** Apply the host's theme to the document (CSS variables, data attributes, etc.) */\n applyTheme: (theme: 'light' | 'dark') => void;\n /** Host info reported to the app via MCP protocol */\n hostInfo: { name: string; version: string };\n /** Host capabilities reported to the app via MCP protocol */\n hostCapabilities: McpUiHostCapabilities;\n /**\n * User agent string sent to the app via hostContext.userAgent.\n * Real hosts send identifiers like \"chatgpt\" or \"claude\".\n */\n userAgent?: string;\n /**\n * MCP App style variables sent to the app via hostContext.styles.variables.\n * Uses CSS light-dark() values so a single set adapts to theme automatically.\n * The SDK's applyDocumentTheme() sets color-scheme which light-dark() reads.\n * @see McpUiStyleVariableKey from @modelcontextprotocol/ext-apps\n */\n styleVariables?: McpUiStyles;\n /**\n * CSS custom properties for the inspector page chrome (sidebar, conversation area).\n * These are applied to the document root and can override the defaults:\n * --sim-bg-sidebar (fallback: var(--color-background-secondary))\n * --sim-bg-conversation (fallback: var(--color-background-primary))\n *\n * Values should use CSS light-dark() for automatic theme adaptation.\n */\n pageStyles?: Record<string, string>;\n /**\n * Display modes this host supports.\n * The sidebar display mode picker only shows modes in this list.\n * Defaults to ['inline', 'pip', 'fullscreen'] if not specified.\n */\n availableDisplayModes?: McpUiDisplayMode[];\n /**\n * Safe area insets per display mode.\n * When the user switches display modes in the inspector, the safe area\n * is automatically updated to match (unless the user has manually overridden it).\n * Extracted from real hosts via the host-sync tool.\n */\n safeAreaByDisplayMode?: Partial<\n Record<McpUiDisplayMode, { top?: number; bottom?: number; left?: number; right?: number }>\n >;\n /**\n * CSS containing @font-face rules for the host's custom fonts.\n * Injected into the inspector page when this host is active so the\n * conversation chrome can use the same font as the real host.\n */\n fontCss?: string;\n}\n\n// ── Host Shell Registry ──────────────────────────────────────────\n\nconst registry = new Map<HostId, HostShell>();\n\n/** Register a host shell. Idempotent — re-registering with the same id replaces. */\nexport function registerHostShell(shell: HostShell): void {\n registry.set(shell.id, shell);\n}\n\n/** Get a registered host shell by id. */\nexport function getHostShell(id: HostId): HostShell | undefined {\n return registry.get(id);\n}\n\n/** Get all registered host shells, in insertion order. */\nexport function getRegisteredHosts(): HostShell[] {\n return Array.from(registry.values());\n}\n","import { DisplayMode, Theme } from '../types/runtime';\n\nexport type ScreenWidth = 'mobile-s' | 'mobile-l' | 'tablet' | 'full';\n\nexport type InspectorConfig = {\n theme: Theme;\n displayMode: DisplayMode;\n screenWidth: ScreenWidth;\n};\n\nexport const SCREEN_WIDTHS: Record<ScreenWidth, number> = {\n 'mobile-s': 375,\n 'mobile-l': 425,\n tablet: 768,\n full: 1024,\n};\n","import * as React from 'react';\nimport { useEffect, useRef, useCallback } from 'react';\nimport { SCREEN_WIDTHS, type ScreenWidth } from '../inspector/inspector-types';\nimport { isAllowedIconUrl } from '../lib/utils';\nimport type { McpUiDisplayMode, McpUiHostContext } from '@modelcontextprotocol/ext-apps';\n\ntype Platform = NonNullable<McpUiHostContext['platform']>;\n\nfunction CloseIcon({ className }: { className?: string }) {\n return (\n <svg width=\"1em\" height=\"1em\" viewBox=\"0 0 24 24\" fill=\"currentColor\" className={className}>\n <path\n fillRule=\"evenodd\"\n clipRule=\"evenodd\"\n d=\"M5.83071 5.83077C6.33839 5.32309 7.16151 5.32309 7.66919 5.83077L12 10.1615L16.3307 5.83077C16.8384 5.32309 17.6615 5.32309 18.1692 5.83077C18.6769 6.33845 18.6769 7.16157 18.1692 7.66925L13.8384 12L18.1692 16.3308C18.6769 16.8385 18.6769 17.6616 18.1692 18.1693C17.6615 18.6769 16.8384 18.6769 16.3307 18.1693L12 13.8385L7.66919 18.1693C7.16151 18.6769 6.33839 18.6769 5.83071 18.1693C5.32303 17.6616 5.32303 16.8385 5.83071 16.3308L10.1615 12L5.83071 7.66925C5.32303 7.16157 5.32303 6.33845 5.83071 5.83077Z\"\n />\n </svg>\n );\n}\n\ninterface ConversationProps {\n children?: React.ReactNode;\n screenWidth: ScreenWidth;\n displayMode: McpUiDisplayMode;\n platform: Platform;\n onRequestDisplayMode?: (mode: McpUiDisplayMode) => void;\n appName?: string;\n appIcon?: string;\n userMessage?: string;\n /** Optional action element rendered in the conversation header (e.g., Run button) */\n headerAction?: React.ReactNode;\n /** Called when the content container width changes */\n onContentWidthChange?: (width: number) => void;\n}\n\n/**\n * Conversation layout that renders children (iframe) at a stable tree position.\n *\n * All three display modes (inline, pip, fullscreen) share the same React tree\n * shape so that the iframe never unmounts when switching modes, avoiding a\n * white-flash reload.\n *\n * Visual differences are achieved purely with CSS:\n * - **inline**: content in normal document flow\n * - **pip**: content wrapper becomes `position: fixed` floating overlay\n * - **fullscreen**: content wrapper becomes `position: fixed` covering the viewport;\n * fullscreen chrome (header/footer) rendered as a separate fixed overlay\n */\nexport function Conversation({\n children,\n screenWidth,\n displayMode,\n platform,\n onRequestDisplayMode,\n appName = 'Sunpeak',\n appIcon,\n userMessage = 'What have you got for me today?',\n headerAction,\n onContentWidthChange,\n}: ConversationProps) {\n const isDesktop = platform === 'desktop';\n const containerWidth = screenWidth === 'full' ? '100%' : `${SCREEN_WIDTHS[screenWidth]}px`;\n const isFullscreen = displayMode === 'fullscreen';\n const isPip = displayMode === 'pip';\n\n // Measure the content container width and report it via onContentWidthChange.\n const contentRef = useRef<HTMLDivElement>(null);\n const onContentWidthChangeRef = useRef(onContentWidthChange);\n useEffect(() => {\n onContentWidthChangeRef.current = onContentWidthChange;\n });\n\n const setContentRef = useCallback((node: HTMLDivElement | null) => {\n contentRef.current = node;\n }, []);\n\n useEffect(() => {\n const el = contentRef.current;\n if (!el) return;\n const observer = new ResizeObserver((entries) => {\n for (const entry of entries) {\n const width = Math.round(entry.contentBoxSize[0]?.inlineSize ?? entry.contentRect.width);\n if (width > 0) {\n onContentWidthChangeRef.current?.(width);\n }\n }\n });\n observer.observe(el);\n return () => observer.disconnect();\n }, []);\n\n const handleClose = () => onRequestDisplayMode?.('inline');\n\n return (\n <div\n className=\"flex flex-col w-full h-full flex-1 items-center relative\"\n style={{\n transform: 'translate(0)',\n backgroundColor: 'var(--sim-bg-conversation, var(--color-background-primary))',\n color: 'var(--color-text-primary)',\n }}\n >\n {/* ─── Fullscreen chrome overlay ─── */}\n {isFullscreen && (\n <div\n className=\"fixed start-0 end-0 top-0 bottom-0 z-[51] mx-auto flex flex-col pointer-events-none\"\n style={{ maxWidth: containerWidth }}\n >\n <div\n className=\"z-20 flex h-[3.25rem] items-center justify-between p-2 pointer-events-auto\"\n style={{\n backgroundColor: 'var(--sim-bg-conversation, var(--color-background-primary))',\n }}\n >\n <button\n onClick={handleClose}\n aria-label=\"Close\"\n className=\"h-7 w-7 flex items-center justify-center rounded-lg transition-colors hover:opacity-70\"\n type=\"button\"\n >\n <CloseIcon />\n </button>\n {isDesktop && (\n <div className=\"flex items-center justify-center text-base\">{appName}</div>\n )}\n {isDesktop && <div />}\n </div>\n {/* Spacer - pointer events pass through to content below */}\n <div className=\"flex-1\" />\n <footer className=\"relative\">\n {/* Scroll fade mask — ChatGPT uses gradient mask, not backdrop blur */}\n <div\n className=\"absolute inset-x-0 bottom-0 h-full -z-10\"\n style={{\n maskImage: 'linear-gradient(to bottom, transparent 0%, black 50%)',\n WebkitMaskImage: 'linear-gradient(to bottom, transparent 0%, black 50%)',\n backgroundColor: 'var(--sim-bg-conversation, var(--color-background-primary))',\n }}\n />\n <div className=\"max-w-[40rem] min-[1280px]:max-w-[48rem] mx-auto px-4 pt-4 pb-4 pointer-events-auto\">\n <div className=\"relative\">\n <input\n type=\"text\"\n name=\"userInput\"\n disabled\n placeholder=\"Message sunpeak.ai\"\n className=\"w-full rounded-[28px] p-2.5 shadow-sm\"\n style={{\n backgroundColor: 'var(--sim-bg-reply-input, var(--color-background-secondary))',\n color: 'var(--color-text-primary)',\n border: 'none',\n // @ts-expect-error -- corner-shape is a newer CSS property (squircle)\n cornerShape: 'superellipse',\n }}\n />\n </div>\n </div>\n </footer>\n </div>\n )}\n\n {/* ─── Conversation header ─── */}\n {!isFullscreen && (\n <header\n className=\"h-12 flex items-center gap-3 px-4 text-lg sticky top-0 z-40 w-full\"\n style={{\n maxWidth: containerWidth,\n backgroundColor: 'var(--sim-bg-conversation, var(--color-background-primary))',\n }}\n >\n <span>sunpeak.ai</span>\n {headerAction}\n </header>\n )}\n\n {/* ─── Conversation container ─── */}\n <div\n className=\"flex flex-col flex-1 w-full transition-all duration-200 overflow-hidden\"\n style={{ maxWidth: containerWidth }}\n >\n <main className=\"flex-1 overflow-y-auto overflow-x-hidden flex flex-col\">\n {/* User turn - hidden in fullscreen */}\n {!isFullscreen && (\n <article className=\"w-full focus:outline-none\" dir=\"auto\" data-turn=\"user\">\n <h5 className=\"sr-only\">You said:</h5>\n <div className=\"text-base my-auto mx-auto md:pt-8 px-4\">\n <div className=\"max-w-[40rem] min-[1280px]:max-w-[48rem] mx-auto flex-1 relative flex w-full min-w-0 flex-col\">\n <div className=\"flex max-w-full flex-col grow\">\n <div\n data-message-author-role=\"user\"\n className=\"min-h-8 relative flex w-full flex-col items-end gap-2 text-start break-words whitespace-normal\"\n >\n <div className=\"flex w-full flex-col gap-1 empty:hidden items-end\">\n <div\n className=\"relative rounded-[22px] px-4 py-2.5 leading-6 max-w-[70%]\"\n style={{\n backgroundColor:\n 'var(--sim-bg-user-bubble, var(--color-background-tertiary))',\n // @ts-expect-error -- corner-shape is a newer CSS property (squircle)\n cornerShape: 'superellipse',\n }}\n >\n <div className=\"whitespace-pre-wrap\">{userMessage}</div>\n </div>\n </div>\n </div>\n </div>\n </div>\n </div>\n </article>\n )}\n\n {/* Assistant turn — flex-1 so short content still pushes the input to the bottom */}\n <article className=\"w-full focus:outline-none flex-1\" dir=\"auto\" data-turn=\"assistant\">\n <h6 className=\"sr-only\">{appName} said:</h6>\n <div className=\"text-base my-auto mx-auto pb-10 px-4\">\n <div className=\"max-w-[40rem] min-[1280px]:max-w-[48rem] mx-auto flex-1 relative flex w-full min-w-0 flex-col\">\n <div className=\"flex max-w-full flex-col grow\">\n {/* Assistant avatar and name - hidden in fullscreen */}\n {!isFullscreen && (\n <div className=\"flex items-center gap-2 my-3\">\n {appIcon ? (\n isAllowedIconUrl(appIcon) ? (\n <img src={appIcon} alt=\"\" className=\"size-6 rounded-full object-cover\" />\n ) : (\n <div className=\"size-6 flex items-center justify-center text-base\">\n {appIcon}\n </div>\n )\n ) : (\n <div\n className=\"size-6 rounded-full flex items-center justify-center font-medium text-xs text-white\"\n style={{ backgroundColor: '#10a37f' }}\n >\n AI\n </div>\n )}\n <span className=\"font-semibold text-sm\">{appName}</span>\n </div>\n )}\n\n {/* Assistant message content */}\n <div\n data-message-author-role=\"assistant\"\n className=\"min-h-8 relative flex w-full flex-col items-start gap-2 text-start break-words whitespace-normal\"\n >\n <div className=\"flex w-full flex-col gap-1 empty:hidden\">\n {/*\n * ─── CONTENT AREA ───\n * Children (iframe) are always at this tree position.\n * CSS handles visual positioning for each display mode:\n * inline: normal flow (position: relative)\n * pip: floating overlay (position: fixed)\n * fullscreen: viewport takeover (position: fixed)\n */}\n <div\n ref={setContentRef}\n className={\n isPip\n ? 'no-scrollbar @w-xl/main:top-4 fixed start-4 end-4 top-12 z-50 mx-auto max-w-[40rem] lg:max-w-[48rem] sm:start-0 sm:end-0 sm:top-[3.25rem] sm:w-full overflow-visible'\n : isFullscreen\n ? 'no-scrollbar fixed inset-x-0 top-[3.25rem] bottom-0 z-50 mx-auto'\n : 'no-scrollbar relative mb-2 @w-sm/main:w-full mx-0 max-sm:-mx-[1rem] max-sm:w-[100cqw] max-sm:overflow-hidden overflow-visible'\n }\n style={{\n ...(isPip ? { maxHeight: 'calc(50dvh - 38px)' } : {}),\n ...(isFullscreen ? { maxWidth: containerWidth } : {}),\n }}\n >\n {/* PiP close button - keyed so it doesn't shift content's position */}\n {isPip && (\n <button\n key=\"pip-close\"\n onClick={handleClose}\n className=\"absolute -start-2 md:-start-6 -top-1.5 z-10 rounded-full bg-[#3a3a3a] p-1.25 text-white shadow-[0px_0px_0px_1px_var(--color-border-primary),0px_4px_12px_rgba(0,0,0,0.12)] hover:bg-[#6a6a6a]\"\n aria-label=\"Close picture-in-picture\"\n type=\"button\"\n >\n <CloseIcon className=\"h-4 w-4\" />\n </button>\n )}\n <div\n key=\"content\"\n className={\n isPip\n ? 'relative overflow-hidden h-full rounded-2xl sm:rounded-3xl shadow-[0px_0px_0px_1px_var(--color-border-primary),0px_6px_20px_rgba(0,0,0,0.1)] md:-mx-4'\n : 'relative overflow-hidden h-full'\n }\n >\n <div\n className=\"h-full w-full max-w-full\"\n style={{\n ...(isPip\n ? {\n overflow: 'auto',\n backgroundColor: 'var(--color-background-primary)',\n }\n : isFullscreen\n ? {\n overflow: 'auto',\n backgroundColor: 'var(--color-background-primary)',\n }\n : { backgroundColor: 'transparent' }),\n }}\n >\n {children}\n </div>\n </div>\n </div>\n </div>\n </div>\n </div>\n </div>\n </div>\n </article>\n\n {/* Input area - sticky at bottom, content scrolls underneath with blur.\n Hidden in fullscreen since fullscreen chrome has its own footer. */}\n {!isFullscreen && (\n <div className=\"sticky bottom-0 z-10 pointer-events-none\">\n {/* Scroll fade mask — ChatGPT uses gradient mask, not backdrop blur */}\n <div\n className=\"absolute inset-x-0 bottom-0 h-full -z-10\"\n style={{\n maskImage: 'linear-gradient(to bottom, transparent 0%, black 50%)',\n WebkitMaskImage: 'linear-gradient(to bottom, transparent 0%, black 50%)',\n backgroundColor: 'var(--sim-bg-conversation, var(--color-background-primary))',\n }}\n />\n <div className=\"max-w-[40rem] min-[1280px]:max-w-[48rem] mx-auto px-4 pt-4 pb-4 pointer-events-auto\">\n <div className=\"relative\">\n <input\n type=\"text\"\n name=\"userInput\"\n disabled\n placeholder=\"Message sunpeak.ai\"\n className=\"w-full rounded-3xl px-5 py-3 pr-12 shadow-sm\"\n style={{\n backgroundColor:\n 'var(--sim-bg-reply-input, var(--color-background-secondary))',\n color: 'var(--color-text-primary)',\n border: '1px solid var(--color-border-tertiary)',\n }}\n />\n </div>\n </div>\n </div>\n )}\n </main>\n </div>\n </div>\n );\n}\n","import type { McpUiHostCapabilities } from '@modelcontextprotocol/ext-apps';\nimport { registerHostShell } from '../inspector/hosts';\nimport { DEFAULT_STYLE_VARIABLES } from '../inspector/host-styles';\nimport { Conversation } from './chatgpt-conversation';\n\n/**\n * ChatGPT host version info — matches what ChatGPT reports via the MCP protocol.\n * Verified against production ChatGPT on 2026-05-13.\n */\nconst CHATGPT_HOST_INFO = {\n name: 'chatgpt',\n version: '0.0.1',\n};\n\nconst CHATGPT_HOST_CAPABILITIES: McpUiHostCapabilities = {\n openLinks: {},\n serverTools: {},\n serverResources: {},\n logging: {},\n updateModelContext: {},\n message: {},\n sandbox: {\n permissions: {\n microphone: {},\n },\n },\n};\n\n/**\n * Apply ChatGPT-style theming to the document.\n * Sets data-theme attribute and color-scheme for light-dark() CSS support.\n */\nfunction applyChatGPTTheme(theme: 'light' | 'dark'): void {\n document.documentElement.setAttribute('data-theme', theme);\n document.documentElement.style.colorScheme = theme;\n}\n\n/**\n * ChatGPT style variables — matches SDK defaults exactly.\n * Verified against production ChatGPT on 2026-05-13.\n */\nconst CHATGPT_STYLE_VARIABLES = {\n ...DEFAULT_STYLE_VARIABLES,\n};\n\nregisterHostShell({\n id: 'chatgpt',\n label: 'ChatGPT',\n Conversation,\n applyTheme: applyChatGPTTheme,\n hostInfo: CHATGPT_HOST_INFO,\n hostCapabilities: CHATGPT_HOST_CAPABILITIES,\n userAgent: 'chatgpt',\n styleVariables: CHATGPT_STYLE_VARIABLES,\n safeAreaByDisplayMode: {\n inline: {},\n fullscreen: { bottom: 150 },\n pip: {},\n },\n pageStyles: {\n '--sim-bg-sidebar': 'light-dark(#ffffff, #212121)',\n '--sim-bg-conversation': 'light-dark(#ffffff, #212121)',\n '--sim-bg-user-bubble': 'light-dark(rgba(233,233,233,0.5), rgba(50,50,50,0.85))',\n '--sim-bg-reply-input': 'light-dark(#ffffff, #303030)',\n },\n});\n","import * as React from 'react';\nimport { useEffect, useRef, useCallback } from 'react';\nimport { SCREEN_WIDTHS, type ScreenWidth } from '../inspector/inspector-types';\nimport { isAllowedIconUrl } from '../lib/utils';\nimport type { McpUiDisplayMode, McpUiHostContext } from '@modelcontextprotocol/ext-apps';\n\ntype Platform = NonNullable<McpUiHostContext['platform']>;\n\ninterface ClaudeConversationProps {\n children?: React.ReactNode;\n screenWidth: ScreenWidth;\n displayMode: McpUiDisplayMode;\n platform: Platform;\n onRequestDisplayMode?: (mode: McpUiDisplayMode) => void;\n appName?: string;\n appIcon?: string;\n userMessage?: string;\n /** Optional action element rendered in the conversation header (e.g., Run button) */\n headerAction?: React.ReactNode;\n /** Called when the content container width changes */\n onContentWidthChange?: (width: number) => void;\n}\n\nfunction CloseIcon() {\n return (\n <svg width=\"16\" height=\"16\" viewBox=\"0 0 16 16\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <path\n d=\"M12 4L4 12M4 4L12 12\"\n stroke=\"currentColor\"\n strokeWidth=\"1.5\"\n strokeLinecap=\"round\"\n />\n </svg>\n );\n}\n\nfunction BackIcon() {\n return (\n <svg width=\"16\" height=\"16\" viewBox=\"0 0 16 16\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <path\n d=\"M10 3L5 8L10 13\"\n stroke=\"currentColor\"\n strokeWidth=\"1.5\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n />\n </svg>\n );\n}\n\n/**\n * Claude conversation shell — mimics Claude's chat UI chrome.\n *\n * All three display modes (inline, pip, fullscreen) share the same React tree\n * shape so that the iframe never unmounts when switching modes.\n */\nexport function ClaudeConversation({\n children,\n screenWidth,\n displayMode,\n platform,\n onRequestDisplayMode,\n appName = 'Sunpeak',\n appIcon,\n userMessage = 'What have you got for me today?',\n headerAction,\n onContentWidthChange,\n}: ClaudeConversationProps) {\n const isDesktop = platform === 'desktop';\n const containerWidth = screenWidth === 'full' ? '100%' : `${SCREEN_WIDTHS[screenWidth]}px`;\n const isFullscreen = displayMode === 'fullscreen';\n const isPip = displayMode === 'pip';\n\n // Measure the content container width and report it via onContentWidthChange.\n const contentRef = useRef<HTMLDivElement>(null);\n const onContentWidthChangeRef = useRef(onContentWidthChange);\n useEffect(() => {\n onContentWidthChangeRef.current = onContentWidthChange;\n });\n\n const setContentRef = useCallback((node: HTMLDivElement | null) => {\n contentRef.current = node;\n }, []);\n\n useEffect(() => {\n const el = contentRef.current;\n if (!el) return;\n const observer = new ResizeObserver((entries) => {\n for (const entry of entries) {\n const width = Math.round(entry.contentBoxSize[0]?.inlineSize ?? entry.contentRect.width);\n if (width > 0) {\n onContentWidthChangeRef.current?.(width);\n }\n }\n });\n observer.observe(el);\n return () => observer.disconnect();\n }, []);\n\n const handleClose = () => onRequestDisplayMode?.('inline');\n\n return (\n <div\n className=\"flex flex-col w-full h-full flex-1 items-center relative\"\n style={{\n transform: 'translate(0)',\n backgroundColor: 'var(--sim-bg-conversation, var(--color-background-primary))',\n color: 'var(--color-text-primary)',\n fontFamily: 'var(--font-sans)',\n WebkitFontSmoothing: 'antialiased',\n }}\n >\n {/* ─── Fullscreen chrome overlay ─── */}\n {isFullscreen && (\n <div\n className=\"fixed start-0 end-0 top-0 bottom-0 z-[51] mx-auto flex flex-col pointer-events-none\"\n style={{ maxWidth: containerWidth }}\n >\n <div\n className=\"z-10 flex items-center h-12 border-b px-3 pointer-events-auto\"\n style={{\n borderColor: 'var(--color-border-primary)',\n backgroundColor: 'var(--sim-bg-conversation, var(--color-background-primary))',\n }}\n >\n <button\n onClick={handleClose}\n aria-label=\"Back\"\n className=\"h-8 w-8 flex items-center justify-center rounded-lg transition-colors hover:opacity-70\"\n type=\"button\"\n >\n <BackIcon />\n </button>\n <div className=\"flex-1 text-center text-sm font-medium\">{appName}</div>\n {isDesktop && <div className=\"w-8\" />}\n </div>\n <div className=\"flex-1\" />\n <footer\n className=\"pointer-events-auto p-3\"\n style={{\n backgroundColor: 'var(--sim-bg-conversation, var(--color-background-primary))',\n }}\n >\n <div className=\"max-w-[48rem] mx-auto\">\n <div\n className=\"relative rounded-[20px] px-4 py-2.5\"\n style={{\n backgroundColor: 'var(--sim-bg-reply-input, var(--color-background-secondary))',\n boxShadow:\n '0 4px 20px rgba(0, 0, 0, 0.035), 0 0 0 0.5px var(--color-border-tertiary)',\n }}\n >\n <div\n className=\"w-full text-base outline-none opacity-50\"\n style={{\n lineHeight: '1.4',\n color: 'var(--color-text-tertiary)',\n }}\n >\n Reply to sunpeak...\n </div>\n </div>\n </div>\n </footer>\n </div>\n )}\n\n {/* ─── Conversation header ─── */}\n {!isFullscreen && (\n <header\n className=\"h-12 flex items-center gap-3 px-4 text-sm font-medium sticky top-0 z-40 w-full\"\n style={{\n maxWidth: containerWidth,\n backgroundColor: 'var(--sim-bg-conversation, var(--color-background-primary))',\n }}\n >\n <span>sunpeak.ai</span>\n {headerAction}\n </header>\n )}\n\n {/* ─── Conversation container ─── */}\n <div\n className=\"flex flex-col flex-1 w-full transition-all duration-200 overflow-hidden\"\n style={{ maxWidth: containerWidth }}\n >\n <main className=\"flex-1 overflow-y-auto overflow-x-hidden\">\n {/* User turn */}\n {!isFullscreen && (\n <article className=\"w-full\" dir=\"auto\" data-turn=\"user\">\n <div className=\"px-4 py-4\">\n <div className=\"max-w-[48rem] mx-auto flex justify-end\">\n <div\n className=\"inline-flex rounded-xl max-w-[85%] break-words\"\n style={{\n padding: '10px 16px',\n lineHeight: '22.4px',\n fontSize: '16px',\n fontWeight: 430,\n backgroundColor:\n 'var(--sim-bg-user-bubble, var(--color-background-tertiary))',\n }}\n >\n {userMessage}\n </div>\n </div>\n </div>\n </article>\n )}\n\n {/* Assistant turn */}\n <article className=\"w-full\" dir=\"auto\" data-turn=\"assistant\">\n <h6 className=\"sr-only\">{appName} said:</h6>\n <div className=\"px-4 py-2\">\n <div className=\"max-w-[48rem] mx-auto\">\n {/* Claude avatar + name */}\n {!isFullscreen && (\n <div className=\"flex items-center gap-2 mb-3\">\n {appIcon ? (\n isAllowedIconUrl(appIcon) ? (\n <img src={appIcon} alt=\"\" className=\"size-6 rounded-full object-cover\" />\n ) : (\n <div className=\"size-6 flex items-center justify-center text-base\">\n {appIcon}\n </div>\n )\n ) : (\n <div\n className=\"size-6 rounded-full flex items-center justify-center text-xs font-medium text-white\"\n style={{ backgroundColor: '#c55a30' }}\n >\n C\n </div>\n )}\n <span className=\"text-sm font-medium\">{appName}</span>\n </div>\n )}\n\n {/* ─── CONTENT AREA ─── */}\n <div\n ref={setContentRef}\n className={\n isPip\n ? 'fixed start-4 end-4 top-12 z-50 mx-auto max-w-[40rem] lg:max-w-[48rem] sm:start-0 sm:end-0 sm:top-[3rem] sm:w-full overflow-visible'\n : isFullscreen\n ? 'fixed inset-x-0 top-[3rem] bottom-0 z-50 mx-auto'\n : 'relative mb-2 w-full overflow-visible'\n }\n style={{\n ...(isPip ? { maxHeight: '480px' } : {}),\n ...(isFullscreen ? { maxWidth: containerWidth } : {}),\n }}\n >\n {/* PiP close button */}\n {isPip && (\n <button\n key=\"pip-close\"\n onClick={handleClose}\n className=\"absolute -start-2 -top-1.5 z-10 rounded-full p-1.5 text-white shadow-md\"\n style={{ backgroundColor: '#4a4a4a' }}\n aria-label=\"Close picture-in-picture\"\n type=\"button\"\n >\n <CloseIcon />\n </button>\n )}\n <div\n key=\"content\"\n className={\n isPip\n ? 'relative overflow-hidden h-full rounded-2xl shadow-lg'\n : 'relative overflow-hidden h-full'\n }\n >\n <div\n className=\"h-full w-full max-w-full\"\n style={{\n ...(isPip\n ? {\n overflow: 'auto',\n backgroundColor: 'var(--color-background-secondary)',\n }\n : isFullscreen\n ? {\n overflow: 'auto',\n backgroundColor: 'var(--color-background-primary)',\n }\n : { backgroundColor: 'transparent' }),\n }}\n >\n {children}\n </div>\n </div>\n </div>\n </div>\n </div>\n </article>\n </main>\n\n {/* Input area */}\n {!isFullscreen && (\n <footer\n style={{\n backgroundColor: 'var(--sim-bg-conversation, var(--color-background-primary))',\n }}\n >\n <div className=\"max-w-[48rem] mx-auto px-4 py-4\">\n <div\n className=\"relative rounded-[20px] px-4 py-2.5\"\n style={{\n backgroundColor: 'var(--sim-bg-reply-input, var(--color-background-secondary))',\n boxShadow:\n '0 4px 20px rgba(0, 0, 0, 0.035), 0 0 0 0.5px var(--color-border-tertiary)',\n }}\n >\n <div\n className=\"w-full text-base outline-none opacity-50\"\n style={{\n lineHeight: '1.4',\n color: 'var(--color-text-tertiary)',\n }}\n >\n Reply to sunpeak...\n </div>\n </div>\n </div>\n </footer>\n )}\n </div>\n </div>\n );\n}\n","import type { McpUiHostCapabilities } from '@modelcontextprotocol/ext-apps';\nimport { registerHostShell } from '../inspector/hosts';\nimport { DEFAULT_STYLE_VARIABLES } from '../inspector/host-styles';\nimport { ClaudeConversation } from './claude-conversation';\n\n/**\n * Claude host version info — matches what Claude reports via the MCP protocol.\n * Verified against production Claude on 2026-05-13.\n */\nconst CLAUDE_HOST_INFO = {\n name: 'Claude',\n version: '1.0.0',\n};\n\n/**\n * Claude host capabilities — matches what Claude reports via the MCP protocol.\n * Verified against production Claude on 2026-05-13.\n *\n * Notable: Claude supports downloadFile, updateModelContext.image, and\n * message.text. serverTools and serverResources both report listChanged.\n * No sandbox.permissions (no microphone etc.). No PiP display mode.\n */\nconst CLAUDE_HOST_CAPABILITIES: McpUiHostCapabilities = {\n openLinks: {},\n downloadFile: {},\n serverTools: { listChanged: true },\n serverResources: { listChanged: true },\n logging: {},\n updateModelContext: { text: {}, image: {} },\n message: { text: {} },\n sandbox: {},\n};\n\n/**\n * Apply Claude-style theming to the document.\n * Sets data-theme attribute and color-scheme so CSS light-dark() resolves correctly.\n */\nfunction applyClaudeTheme(theme: 'light' | 'dark'): void {\n document.documentElement.setAttribute('data-theme', theme);\n document.documentElement.style.colorScheme = theme;\n}\n\n/**\n * Claude style variable overrides — warm beige/cream palette with Anthropic Sans.\n * Verified against production Claude on 2026-05-13.\n *\n * Only overrides values that differ from DEFAULT_STYLE_VARIABLES.\n * Claude sends all variables via styles.variables using light-dark(rgba()) format.\n */\nconst CLAUDE_STYLE_VARIABLES = {\n ...DEFAULT_STYLE_VARIABLES,\n\n // ── Background colors ──\n '--color-background-primary': 'light-dark(rgba(255, 255, 255, 1), rgba(48, 48, 46, 1))',\n '--color-background-secondary': 'light-dark(rgba(245, 244, 237, 1), rgba(38, 38, 36, 1))',\n '--color-background-tertiary': 'light-dark(rgba(250, 249, 245, 1), rgba(20, 20, 19, 1))',\n '--color-background-inverse': 'light-dark(rgba(20, 20, 19, 1), rgba(250, 249, 245, 1))',\n '--color-background-ghost': 'light-dark(rgba(255, 255, 255, 0), rgba(48, 48, 46, 0))',\n '--color-background-info': 'light-dark(rgba(214, 228, 246, 1), rgba(37, 62, 95, 1))',\n '--color-background-danger': 'light-dark(rgba(247, 236, 236, 1), rgba(96, 42, 40, 1))',\n '--color-background-success': 'light-dark(rgba(233, 241, 220, 1), rgba(27, 70, 20, 1))',\n '--color-background-warning': 'light-dark(rgba(246, 238, 223, 1), rgba(72, 58, 15, 1))',\n '--color-background-disabled': 'light-dark(rgba(255, 255, 255, 0.5), rgba(48, 48, 46, 0.5))',\n\n // ── Text colors ──\n '--color-text-primary': 'light-dark(rgba(20, 20, 19, 1), rgba(250, 249, 245, 1))',\n '--color-text-secondary': 'light-dark(rgba(61, 61, 58, 1), rgba(194, 192, 182, 1))',\n '--color-text-tertiary': 'light-dark(rgba(115, 114, 108, 1), rgba(156, 154, 146, 1))',\n '--color-text-inverse': 'light-dark(rgba(255, 255, 255, 1), rgba(20, 20, 19, 1))',\n '--color-text-ghost': 'light-dark(rgba(115, 114, 108, 0.5), rgba(156, 154, 146, 0.5))',\n '--color-text-info': 'light-dark(rgba(50, 102, 173, 1), rgba(128, 170, 221, 1))',\n '--color-text-danger': 'light-dark(rgba(127, 44, 40, 1), rgba(238, 136, 132, 1))',\n '--color-text-success': 'light-dark(rgba(38, 91, 25, 1), rgba(122, 185, 72, 1))',\n '--color-text-warning': 'light-dark(rgba(90, 72, 21, 1), rgba(209, 160, 65, 1))',\n '--color-text-disabled': 'light-dark(rgba(20, 20, 19, 0.5), rgba(250, 249, 245, 0.5))',\n\n // ── Border colors ──\n '--color-border-primary': 'light-dark(rgba(31, 30, 29, 0.4), rgba(222, 220, 209, 0.4))',\n '--color-border-secondary': 'light-dark(rgba(31, 30, 29, 0.3), rgba(222, 220, 209, 0.3))',\n '--color-border-tertiary': 'light-dark(rgba(31, 30, 29, 0.15), rgba(222, 220, 209, 0.15))',\n '--color-border-inverse': 'light-dark(rgba(255, 255, 255, 0.3), rgba(20, 20, 19, 0.15))',\n '--color-border-ghost': 'light-dark(rgba(31, 30, 29, 0), rgba(222, 220, 209, 0))',\n '--color-border-info': 'light-dark(rgba(70, 130, 213, 1), rgba(70, 130, 213, 1))',\n '--color-border-danger': 'light-dark(rgba(167, 61, 57, 1), rgba(205, 92, 88, 1))',\n '--color-border-success': 'light-dark(rgba(67, 116, 38, 1), rgba(89, 145, 48, 1))',\n '--color-border-warning': 'light-dark(rgba(128, 92, 31, 1), rgba(168, 120, 41, 1))',\n '--color-border-disabled': 'light-dark(rgba(31, 30, 29, 0.1), rgba(222, 220, 209, 0.1))',\n\n // ── Ring colors ──\n '--color-ring-primary': 'light-dark(rgba(20, 20, 19, 0.7), rgba(250, 249, 245, 0.7))',\n '--color-ring-secondary': 'light-dark(rgba(61, 61, 58, 0.7), rgba(194, 192, 182, 0.7))',\n '--color-ring-inverse': 'light-dark(rgba(255, 255, 255, 0.7), rgba(20, 20, 19, 0.7))',\n '--color-ring-info': 'light-dark(rgba(50, 102, 173, 0.5), rgba(128, 170, 221, 0.5))',\n '--color-ring-danger': 'light-dark(rgba(167, 61, 57, 0.5), rgba(205, 92, 88, 0.5))',\n '--color-ring-success': 'light-dark(rgba(67, 116, 38, 0.5), rgba(89, 145, 48, 0.5))',\n '--color-ring-warning': 'light-dark(rgba(128, 92, 31, 0.5), rgba(168, 120, 41, 0.5))',\n\n // ── Typography ──\n '--font-sans': '\"Anthropic Sans\", system-ui, \"Segoe UI\", Roboto, Helvetica, Arial, sans-serif',\n '--font-mono': 'ui-monospace, monospace',\n // Sizes (px, not rem — Claude uses fixed px values)\n '--font-text-xs-size': '12px',\n '--font-text-sm-size': '14px',\n '--font-text-md-size': '16px',\n '--font-text-lg-size': '20px',\n '--font-heading-xs-size': '12px',\n '--font-heading-sm-size': '14px',\n '--font-heading-md-size': '16px',\n '--font-heading-lg-size': '20px',\n '--font-heading-xl-size': '24px',\n '--font-heading-2xl-size': '28px',\n '--font-heading-3xl-size': '36px',\n // Line heights\n '--font-text-md-line-height': '1.4',\n '--font-text-lg-line-height': '1.25',\n '--font-heading-lg-line-height': '1.25',\n '--font-heading-2xl-line-height': '1.1',\n '--font-heading-3xl-line-height': '1',\n\n // ── Border radius (Claude uses slightly larger values) ──\n '--border-radius-xs': '4px',\n '--border-radius-sm': '6px',\n '--border-radius-md': '8px',\n '--border-radius-lg': '10px',\n\n // ── Border width ──\n '--border-width-regular': '0.5px',\n};\n\nregisterHostShell({\n id: 'claude',\n label: 'Claude',\n Conversation: ClaudeConversation,\n applyTheme: applyClaudeTheme,\n hostInfo: CLAUDE_HOST_INFO,\n hostCapabilities: CLAUDE_HOST_CAPABILITIES,\n styleVariables: CLAUDE_STYLE_VARIABLES,\n pageStyles: {\n '--sim-bg-sidebar': 'light-dark(rgb(250, 249, 245), rgb(38, 38, 36))',\n '--sim-bg-conversation': 'light-dark(rgb(250, 249, 245), rgb(38, 38, 36))',\n '--sim-bg-user-bubble': 'light-dark(rgb(240, 238, 230), rgb(20, 20, 19))',\n '--sim-bg-reply-input': 'light-dark(rgb(255, 255, 255), rgb(48, 48, 46))',\n },\n safeAreaByDisplayMode: {\n inline: {},\n fullscreen: { top: 16, right: 16, bottom: 138, left: 16 },\n },\n availableDisplayModes: ['inline', 'fullscreen'],\n fontCss: `@font-face {\n font-family: \"Anthropic Sans\";\n src: url(\"https://assets-proxy.anthropic.com/claude-ai/v2/assets/v1/cc27851ad-CFxw3nG7.woff2\") format(\"woff2\");\n font-weight: 300 800;\n font-style: normal;\n font-display: swap;\n font-feature-settings: \"dlig\" 0;\n}\n@font-face {\n font-family: \"Anthropic Sans\";\n src: url(\"https://assets-proxy.anthropic.com/claude-ai/v2/assets/v1/c9d3a3a49-BI1hrwN4.woff2\") format(\"woff2\");\n font-weight: 300 800;\n font-style: italic;\n font-display: swap;\n font-feature-settings: \"dlig\" 0;\n}`,\n});\n","var ZQ=((X)=>typeof require<\"u\"?require:typeof Proxy<\"u\"?new Proxy(X,{get:(Y,Z)=>(typeof require<\"u\"?require:Y)[Z]}):X)(function(X){if(typeof require<\"u\")return require.apply(this,arguments);throw Error('Dynamic require of \"'+X+'\" is not supported')});import{CallToolRequestSchema as iQ,CallToolResultSchema as XQ,CreateMessageRequestSchema as nQ,ListPromptsRequestSchema as cQ,ListPromptsResultSchema as lQ,ListResourcesRequestSchema as rQ,ListResourcesResultSchema as oQ,ListResourceTemplatesRequestSchema as sQ,ListResourceTemplatesResultSchema as tQ,ListToolsResultSchema as aQ,LoggingMessageNotificationSchema as eQ,PingRequestSchema as QX,PromptListChangedNotificationSchema as XX,ReadResourceRequestSchema as YX,ReadResourceResultSchema as ZX,ResourceListChangedNotificationSchema as $X,ToolListChangedNotificationSchema as JX}from\"@modelcontextprotocol/sdk/types.js\";import{Protocol as $Q}from\"@modelcontextprotocol/sdk/shared/protocol.js\";class _ extends $Q{_registeredMethods=new Set;_eventSlots=new Map;onEventDispatch(X,Y){}_ensureEventSlot(X){let Y=this._eventSlots.get(X);if(!Y){let Z=this.eventSchemas[X];if(!Z)throw Error(`Unknown event: ${String(X)}`);Y={listeners:[]},this._eventSlots.set(X,Y);let $=Z.shape.method.value;this._registeredMethods.add($);let J=Y;super.setNotificationHandler(Z,(K)=>{let D=K.params;this.onEventDispatch(X,D),J.onHandler?.(D);for(let G of[...J.listeners])G(D)})}return Y}setEventHandler(X,Y){let Z=this._ensureEventSlot(X);if(Z.onHandler&&Y)console.warn(`[MCP Apps] on${String(X)} handler replaced. Use addEventListener(\"${String(X)}\", …) to add multiple listeners without replacing.`);Z.onHandler=Y}getEventHandler(X){return this._eventSlots.get(X)?.onHandler}addEventListener(X,Y){this._ensureEventSlot(X).listeners.push(Y)}removeEventListener(X,Y){let Z=this._eventSlots.get(X);if(!Z)return;let $=Z.listeners.indexOf(Y);if($!==-1)Z.listeners.splice($,1)}setRequestHandler=(X,Y)=>{this._assertMethodNotRegistered(X,\"setRequestHandler\"),super.setRequestHandler(X,Y)};setNotificationHandler=(X,Y)=>{this._assertMethodNotRegistered(X,\"setNotificationHandler\"),super.setNotificationHandler(X,Y)};warnIfRequestHandlerReplaced(X,Y,Z){if(Y&&Z)console.warn(`[MCP Apps] ${X} handler replaced. Previous handler will no longer be called.`)}replaceRequestHandler=(X,Y)=>{let Z=X.shape.method.value;this._registeredMethods.add(Z),super.setRequestHandler(X,Y)};_assertMethodNotRegistered(X,Y){let Z=X.shape.method.value;if(this._registeredMethods.has(Z))throw Error(`Handler for \"${Z}\" already registered (via ${Y}). Use addEventListener() to attach multiple listeners, or the on* setter for replace semantics.`);this._registeredMethods.add(Z)}}var j=\"2026-01-26\",JQ=\"ui/open-link\",KQ=\"ui/download-file\",DQ=\"ui/message\",GQ=\"ui/notifications/sandbox-proxy-ready\",NQ=\"ui/notifications/sandbox-resource-ready\",WQ=\"ui/notifications/size-changed\",jQ=\"ui/notifications/tool-input\",V=\"ui/notifications/tool-input-partial\",BQ=\"ui/notifications/tool-result\",_Q=\"ui/notifications/tool-cancelled\",EQ=\"ui/notifications/host-context-changed\",OQ=\"ui/notifications/request-teardown\",zQ=\"ui/resource-teardown\",IQ=\"ui/initialize\",VQ=\"ui/notifications/initialized\",FQ=\"ui/request-display-mode\";import{z as Q}from\"zod/v4\";import{ContentBlockSchema as c,CallToolResultSchema as LQ,EmbeddedResourceSchema as PQ,ImplementationSchema as l,RequestIdSchema as AQ,ResourceLinkSchema as UQ,ToolSchema as wQ}from\"@modelcontextprotocol/sdk/types.js\";var r=Q.union([Q.literal(\"light\"),Q.literal(\"dark\")]).describe(\"Color theme preference for the host environment.\"),B=Q.union([Q.literal(\"inline\"),Q.literal(\"fullscreen\"),Q.literal(\"pip\")]).describe(\"Display mode for UI presentation.\"),HQ=Q.union([Q.literal(\"--color-background-primary\"),Q.literal(\"--color-background-secondary\"),Q.literal(\"--color-background-tertiary\"),Q.literal(\"--color-background-inverse\"),Q.literal(\"--color-background-ghost\"),Q.literal(\"--color-background-info\"),Q.literal(\"--color-background-danger\"),Q.literal(\"--color-background-success\"),Q.literal(\"--color-background-warning\"),Q.literal(\"--color-background-disabled\"),Q.literal(\"--color-text-primary\"),Q.literal(\"--color-text-secondary\"),Q.literal(\"--color-text-tertiary\"),Q.literal(\"--color-text-inverse\"),Q.literal(\"--color-text-ghost\"),Q.literal(\"--color-text-info\"),Q.literal(\"--color-text-danger\"),Q.literal(\"--color-text-success\"),Q.literal(\"--color-text-warning\"),Q.literal(\"--color-text-disabled\"),Q.literal(\"--color-border-primary\"),Q.literal(\"--color-border-secondary\"),Q.literal(\"--color-border-tertiary\"),Q.literal(\"--color-border-inverse\"),Q.literal(\"--color-border-ghost\"),Q.literal(\"--color-border-info\"),Q.literal(\"--color-border-danger\"),Q.literal(\"--color-border-success\"),Q.literal(\"--color-border-warning\"),Q.literal(\"--color-border-disabled\"),Q.literal(\"--color-ring-primary\"),Q.literal(\"--color-ring-secondary\"),Q.literal(\"--color-ring-inverse\"),Q.literal(\"--color-ring-info\"),Q.literal(\"--color-ring-danger\"),Q.literal(\"--color-ring-success\"),Q.literal(\"--color-ring-warning\"),Q.literal(\"--font-sans\"),Q.literal(\"--font-mono\"),Q.literal(\"--font-weight-normal\"),Q.literal(\"--font-weight-medium\"),Q.literal(\"--font-weight-semibold\"),Q.literal(\"--font-weight-bold\"),Q.literal(\"--font-text-xs-size\"),Q.literal(\"--font-text-sm-size\"),Q.literal(\"--font-text-md-size\"),Q.literal(\"--font-text-lg-size\"),Q.literal(\"--font-heading-xs-size\"),Q.literal(\"--font-heading-sm-size\"),Q.literal(\"--font-heading-md-size\"),Q.literal(\"--font-heading-lg-size\"),Q.literal(\"--font-heading-xl-size\"),Q.literal(\"--font-heading-2xl-size\"),Q.literal(\"--font-heading-3xl-size\"),Q.literal(\"--font-text-xs-line-height\"),Q.literal(\"--font-text-sm-line-height\"),Q.literal(\"--font-text-md-line-height\"),Q.literal(\"--font-text-lg-line-height\"),Q.literal(\"--font-heading-xs-line-height\"),Q.literal(\"--font-heading-sm-line-height\"),Q.literal(\"--font-heading-md-line-height\"),Q.literal(\"--font-heading-lg-line-height\"),Q.literal(\"--font-heading-xl-line-height\"),Q.literal(\"--font-heading-2xl-line-height\"),Q.literal(\"--font-heading-3xl-line-height\"),Q.literal(\"--border-radius-xs\"),Q.literal(\"--border-radius-sm\"),Q.literal(\"--border-radius-md\"),Q.literal(\"--border-radius-lg\"),Q.literal(\"--border-radius-xl\"),Q.literal(\"--border-radius-full\"),Q.literal(\"--border-width-regular\"),Q.literal(\"--shadow-hairline\"),Q.literal(\"--shadow-sm\"),Q.literal(\"--shadow-md\"),Q.literal(\"--shadow-lg\")]).describe(\"CSS variable keys available to MCP apps for theming.\"),RQ=Q.record(HQ.describe(`Style variables for theming MCP apps.\n\nIndividual style keys are optional - hosts may provide any subset of these values.\nValues are strings containing CSS values (colors, sizes, font stacks, etc.).\n\nNote: This type uses \\`Record<K, string | undefined>\\` rather than \\`Partial<Record<K, string>>\\`\nfor compatibility with Zod schema generation. Both are functionally equivalent for validation.`),Q.union([Q.string(),Q.undefined()]).describe(`Style variables for theming MCP apps.\n\nIndividual style keys are optional - hosts may provide any subset of these values.\nValues are strings containing CSS values (colors, sizes, font stacks, etc.).\n\nNote: This type uses \\`Record<K, string | undefined>\\` rather than \\`Partial<Record<K, string>>\\`\nfor compatibility with Zod schema generation. Both are functionally equivalent for validation.`)).describe(`Style variables for theming MCP apps.\n\nIndividual style keys are optional - hosts may provide any subset of these values.\nValues are strings containing CSS values (colors, sizes, font stacks, etc.).\n\nNote: This type uses \\`Record<K, string | undefined>\\` rather than \\`Partial<Record<K, string>>\\`\nfor compatibility with Zod schema generation. Both are functionally equivalent for validation.`),L=Q.object({method:Q.literal(\"ui/open-link\"),params:Q.object({url:Q.string().describe(\"URL to open in the host's browser\")})}),P=Q.object({isError:Q.boolean().optional().describe(\"True if the host failed to open the URL (e.g., due to security policy).\")}).passthrough(),A=Q.object({isError:Q.boolean().optional().describe(\"True if the download failed (e.g., user cancelled or host denied).\")}).passthrough(),U=Q.object({isError:Q.boolean().optional().describe(\"True if the host rejected or failed to deliver the message.\")}).passthrough(),w=Q.object({method:Q.literal(\"ui/notifications/sandbox-proxy-ready\"),params:Q.object({})}),O=Q.object({connectDomains:Q.array(Q.string()).optional().describe(`Origins for network requests (fetch/XHR/WebSocket).\n\n- Maps to CSP \\`connect-src\\` directive\n- Empty or omitted → no network connections (secure default)`),resourceDomains:Q.array(Q.string()).optional().describe(\"Origins for static resources (images, scripts, stylesheets, fonts, media).\\n\\n- Maps to CSP `img-src`, `script-src`, `style-src`, `font-src`, `media-src` directives\\n- Wildcard subdomains supported: `https://*.example.com`\\n- Empty or omitted → no network resources (secure default)\"),frameDomains:Q.array(Q.string()).optional().describe(\"Origins for nested iframes.\\n\\n- Maps to CSP `frame-src` directive\\n- Empty or omitted → no nested iframes allowed (`frame-src 'none'`)\"),baseUriDomains:Q.array(Q.string()).optional().describe(\"Allowed base URIs for the document.\\n\\n- Maps to CSP `base-uri` directive\\n- Empty or omitted → only same origin allowed (`base-uri 'self'`)\")}),z=Q.object({camera:Q.object({}).optional().describe(\"Request camera access.\\n\\nMaps to Permission Policy `camera` feature.\"),microphone:Q.object({}).optional().describe(\"Request microphone access.\\n\\nMaps to Permission Policy `microphone` feature.\"),geolocation:Q.object({}).optional().describe(\"Request geolocation access.\\n\\nMaps to Permission Policy `geolocation` feature.\"),clipboardWrite:Q.object({}).optional().describe(\"Request clipboard write access.\\n\\nMaps to Permission Policy `clipboard-write` feature.\")}),H=Q.object({method:Q.literal(\"ui/notifications/size-changed\"),params:Q.object({width:Q.number().optional().describe(\"New width in pixels.\"),height:Q.number().optional().describe(\"New height in pixels.\")})}),R=Q.object({method:Q.literal(\"ui/notifications/tool-input\"),params:Q.object({arguments:Q.record(Q.string(),Q.unknown().describe(\"Complete tool call arguments as key-value pairs.\")).optional().describe(\"Complete tool call arguments as key-value pairs.\")})}),T=Q.object({method:Q.literal(\"ui/notifications/tool-input-partial\"),params:Q.object({arguments:Q.record(Q.string(),Q.unknown().describe(\"Partial tool call arguments (incomplete, may change).\")).optional().describe(\"Partial tool call arguments (incomplete, may change).\")})}),M=Q.object({method:Q.literal(\"ui/notifications/tool-cancelled\"),params:Q.object({reason:Q.string().optional().describe('Optional reason for the cancellation (e.g., \"user action\", \"timeout\").')})}),o=Q.object({fonts:Q.string().optional()}),s=Q.object({variables:RQ.optional().describe(\"CSS variables for theming the app.\"),css:o.optional().describe(\"CSS blocks that apps can inject.\")}),C=Q.object({method:Q.literal(\"ui/resource-teardown\"),params:Q.object({})}),S=Q.record(Q.string(),Q.unknown()),F=Q.object({text:Q.object({}).optional().describe(\"Host supports text content blocks.\"),image:Q.object({}).optional().describe(\"Host supports image content blocks.\"),audio:Q.object({}).optional().describe(\"Host supports audio content blocks.\"),resource:Q.object({}).optional().describe(\"Host supports resource content blocks.\"),resourceLink:Q.object({}).optional().describe(\"Host supports resource link content blocks.\"),structuredContent:Q.object({}).optional().describe(\"Host supports structured content.\")}),q=Q.object({method:Q.literal(\"ui/notifications/request-teardown\"),params:Q.object({}).optional()}),t=Q.object({experimental:Q.object({}).optional().describe(\"Experimental features (structure TBD).\"),openLinks:Q.object({}).optional().describe(\"Host supports opening external URLs.\"),downloadFile:Q.object({}).optional().describe(\"Host supports file downloads via ui/download-file.\"),serverTools:Q.object({listChanged:Q.boolean().optional().describe(\"Host supports tools/list_changed notifications.\")}).optional().describe(\"Host can proxy tool calls to the MCP server.\"),serverResources:Q.object({listChanged:Q.boolean().optional().describe(\"Host supports resources/list_changed notifications.\")}).optional().describe(\"Host can proxy resource reads to the MCP server.\"),logging:Q.object({}).optional().describe(\"Host accepts log messages.\"),sandbox:Q.object({permissions:z.optional().describe(\"Permissions granted by the host (camera, microphone, geolocation).\"),csp:O.optional().describe(\"CSP domains approved by the host.\")}).optional().describe(\"Sandbox configuration applied by the host.\"),updateModelContext:F.optional().describe(\"Host accepts context updates (ui/update-model-context) to be included in the model's context for future turns.\"),message:F.optional().describe(\"Host supports receiving content messages (ui/message) from the view.\"),sampling:Q.object({tools:Q.object({}).optional().describe(\"Host supports tool use via `tools` and `toolChoice` parameters.\")}).optional().describe(\"Host supports LLM sampling (sampling/createMessage) from the view.\\nMirrors the MCP `ClientCapabilities.sampling` shape so hosts can pass it through.\")}),a=Q.object({experimental:Q.object({}).optional().describe(\"Experimental features (structure TBD).\"),tools:Q.object({listChanged:Q.boolean().optional().describe(\"App supports tools/list_changed notifications.\")}).optional().describe(\"App exposes MCP-style tools that the host can call.\"),availableDisplayModes:Q.array(B).optional().describe(\"Display modes the app supports.\")}),y=Q.object({method:Q.literal(\"ui/notifications/initialized\"),params:Q.object({}).optional()}),TQ=Q.object({csp:O.optional().describe(\"Content Security Policy configuration for UI resources.\"),permissions:z.optional().describe(\"Sandbox permissions requested by the UI resource.\"),domain:Q.string().optional().describe(`Dedicated origin for view sandbox.\n\nUseful when views need stable, dedicated origins for OAuth callbacks, CORS policies, or API key allowlists.\n\n**Host-dependent:** The format and validation rules for this field are determined by each host. Servers MUST consult host-specific documentation for the expected domain format. Common patterns include:\n- Hash-based subdomains (e.g., \\`{hash}.claudemcpcontent.com\\`)\n- URL-derived subdomains (e.g., \\`www-example-com.oaiusercontent.com\\`)\n\nIf omitted, host uses default sandbox origin (typically per-conversation).`),prefersBorder:Q.boolean().optional().describe(`Visual boundary preference - true if view prefers a visible border.\n\nBoolean requesting whether a visible border and background is provided by the host. Specifying an explicit value for this is recommended because hosts' defaults may vary.\n\n- \\`true\\`: request visible border + background\n- \\`false\\`: request no visible border + background\n- omitted: host decides border`)}),I=Q.object({method:Q.literal(\"ui/request-display-mode\"),params:Q.object({mode:B.describe(\"The display mode being requested.\")})}),g=Q.object({mode:B.describe(\"The display mode that was actually set. May differ from requested if not supported.\")}).passthrough(),e=Q.union([Q.literal(\"model\"),Q.literal(\"app\")]).describe(\"Tool visibility scope - who can access the tool.\"),MQ=Q.object({resourceUri:Q.string().optional(),visibility:Q.array(e).optional().describe(`Who can access this tool. Default: [\"model\", \"app\"]\n- \"model\": Tool visible to and callable by the agent\n- \"app\": Tool callable by the app from this server only`),csp:Q.never().optional(),permissions:Q.never().optional()}),OX=Q.object({mimeTypes:Q.array(Q.string()).optional().describe('Array of supported MIME types for UI resources.\\nMust include `\"text/html;profile=mcp-app\"` for MCP Apps support.')}),f=Q.object({method:Q.literal(\"ui/download-file\"),params:Q.object({contents:Q.array(Q.union([PQ,UQ])).describe(\"Resource contents to download — embedded (inline data) or linked (host fetches). Uses standard MCP resource types.\")})}),k=Q.object({method:Q.literal(\"ui/message\"),params:Q.object({role:Q.literal(\"user\").describe('Message role, currently only \"user\" is supported.'),content:Q.array(c).describe(\"Message content blocks (text, image, etc.).\")})}),CQ=Q.object({method:Q.literal(\"ui/notifications/sandbox-resource-ready\"),params:Q.object({html:Q.string().describe(\"HTML content to load into the inner iframe.\"),sandbox:Q.string().optional().describe(\"Optional override for the inner iframe's sandbox attribute.\"),csp:O.optional().describe(\"CSP configuration from resource metadata.\"),permissions:z.optional().describe(\"Sandbox permissions from resource metadata.\")})}),v=Q.object({method:Q.literal(\"ui/notifications/tool-result\"),params:LQ.describe(\"Standard MCP tool execution result.\")}),x=Q.object({toolInfo:Q.object({id:AQ.optional().describe(\"JSON-RPC id of the tools/call request.\"),tool:wQ.describe(\"Tool definition including name, inputSchema, etc.\")}).optional().describe(\"Metadata of the tool call that instantiated this App.\"),theme:r.optional().describe(\"Current color theme preference.\"),styles:s.optional().describe(\"Style configuration for theming the app.\"),displayMode:B.optional().describe(\"How the UI is currently displayed.\"),availableDisplayModes:Q.array(B).optional().describe(\"Display modes the host supports.\"),containerDimensions:Q.union([Q.object({height:Q.number().describe(\"Fixed container height in pixels.\")}),Q.object({maxHeight:Q.union([Q.number(),Q.undefined()]).optional().describe(\"Maximum container height in pixels.\")})]).and(Q.union([Q.object({width:Q.number().describe(\"Fixed container width in pixels.\")}),Q.object({maxWidth:Q.union([Q.number(),Q.undefined()]).optional().describe(\"Maximum container width in pixels.\")})])).optional().describe(`Container dimensions. Represents the dimensions of the iframe or other\ncontainer holding the app. Specify either width or maxWidth, and either height or maxHeight.`),locale:Q.string().optional().describe(\"User's language and region preference in BCP 47 format.\"),timeZone:Q.string().optional().describe(\"User's timezone in IANA format.\"),userAgent:Q.string().optional().describe(\"Host application identifier.\"),platform:Q.union([Q.literal(\"web\"),Q.literal(\"desktop\"),Q.literal(\"mobile\")]).optional().describe(\"Platform type for responsive design decisions.\"),deviceCapabilities:Q.object({touch:Q.boolean().optional().describe(\"Whether the device supports touch input.\"),hover:Q.boolean().optional().describe(\"Whether the device supports hover interactions.\")}).optional().describe(\"Device input capabilities.\"),safeAreaInsets:Q.object({top:Q.number().describe(\"Top safe area inset in pixels.\"),right:Q.number().describe(\"Right safe area inset in pixels.\"),bottom:Q.number().describe(\"Bottom safe area inset in pixels.\"),left:Q.number().describe(\"Left safe area inset in pixels.\")}).optional().describe(\"Mobile safe area boundaries in pixels.\")}).passthrough(),b=Q.object({method:Q.literal(\"ui/notifications/host-context-changed\"),params:x.describe(\"Partial context update containing only changed fields.\")}),d=Q.object({method:Q.literal(\"ui/update-model-context\"),params:Q.object({content:Q.array(c).optional().describe(\"Context content blocks (text, image, etc.).\"),structuredContent:Q.record(Q.string(),Q.unknown().describe(\"Structured content for machine-readable context data.\")).optional().describe(\"Structured content for machine-readable context data.\")})}),u=Q.object({method:Q.literal(\"ui/initialize\"),params:Q.object({appInfo:l.describe(\"App identification (name and version).\"),appCapabilities:a.describe(\"Features and capabilities this app provides.\"),protocolVersion:Q.string().describe(\"Protocol version this app supports.\")})}),h=Q.object({protocolVersion:Q.string().describe('Negotiated protocol version string (e.g., \"2025-11-21\").'),hostInfo:l.describe(\"Host application identification and version.\"),hostCapabilities:t.describe(\"Features and capabilities provided by the host.\"),hostContext:x.describe(\"Rich context about the host environment.\")}).passthrough();import{mergeCapabilities as yQ}from\"@modelcontextprotocol/sdk/shared/protocol.js\";import{CallToolRequestSchema as gQ,CallToolResultSchema as fQ,CreateMessageResultSchema as kQ,CreateMessageResultWithToolsSchema as vQ,EmptyResultSchema as xQ,ListResourcesResultSchema as bQ,ListToolsRequestSchema as dQ,PingRequestSchema as uQ,ReadResourceResultSchema as hQ}from\"@modelcontextprotocol/sdk/types.js\";import{JSONRPCMessageSchema as SQ}from\"@modelcontextprotocol/sdk/types.js\";class E{eventTarget;eventSource;messageListener;constructor(X=window.parent,Y){this.eventTarget=X;this.eventSource=Y;this.messageListener=(Z)=>{if(Y&&Z.source!==this.eventSource){console.debug(\"Ignoring message from unknown source\",Z);return}let $=SQ.safeParse(Z.data);if($.success)console.debug(\"Parsed message\",$.data),this.onmessage?.($.data);else if(Z.data?.jsonrpc!==\"2.0\")console.debug(\"Ignoring non-JSON-RPC message\",$.error.message,Z);else console.error(\"Failed to parse message\",$.error.message,Z),this.onerror?.(Error(\"Invalid JSON-RPC message received: \"+$.error.message))}}async start(){window.addEventListener(\"message\",this.messageListener)}async send(X,Y){if(X.method!==V)console.debug(\"Sending message\",X);this.eventTarget.postMessage(X,\"*\")}async close(){window.removeEventListener(\"message\",this.messageListener),this.onclose?.()}onclose;onerror;onmessage;sessionId;setProtocolVersion}var qQ={target:\"draft-2020-12\"};async function m(X,Y){let Z=X[\"~standard\"];if(Z.jsonSchema)return Z.jsonSchema[Y](qQ);if(Z.vendor===\"zod\"){let{z:$}=await import(\"zod/v4\");return $.toJSONSchema(X,{io:Y})}throw Error(`Schema (vendor: ${Z.vendor}) does not implement Standard JSON Schema (~standard.jsonSchema). Use a library that does (zod v4, ArkType, Valibot) or wrap your schema accordingly.`)}async function p(X,Y,Z=\"\"){let $=await X[\"~standard\"].validate(Y);if($.issues){let J=$.issues.map((K)=>{let D=K.path?.map((G)=>typeof G===\"object\"?G.key:G).join(\".\");return D?`${D}: ${K.message}`:K.message}).join(\"; \");throw Error(Z+J)}return $.value}import{z as mQ}from\"zod/v4\";var i=\"ui/resourceUri\",pQ=\"text/html;profile=mcp-app\";class QQ extends _{_appInfo;_capabilities;options;_hostCapabilities;_hostInfo;_hostContext;_registeredTools={};_initializedSent=!1;_assertInitialized(X){if(this._initializedSent)return;let Y=`[ext-apps] App.${X}() called before connect() completed the ui/initialize handshake. Await app.connect() before calling this method, or move data loading to an ontoolresult handler.`;if(this.options?.strict)throw Error(Y);console.warn(`${Y}. This will throw in a future release.`)}eventSchemas={toolinput:R,toolinputpartial:T,toolresult:v,toolcancelled:M,hostcontextchanged:b};static ONE_SHOT_EVENTS=new Set([\"toolinput\",\"toolinputpartial\",\"toolresult\",\"toolcancelled\"]);_everHadListener=new Set;_assertHandlerTiming(X){if(!QQ.ONE_SHOT_EVENTS.has(X)||this._everHadListener.has(X))return;if(this._everHadListener.add(X),!this._initializedSent)return;let Y=`[ext-apps] \"${String(X)}\" handler registered after connect() completed the ui/initialize handshake. The host may have already sent this notification. Register handlers before calling app.connect().`;if(this.options?.strict)throw Error(Y);console.warn(Y)}setEventHandler(X,Y){if(Y)this._assertHandlerTiming(X);super.setEventHandler(X,Y)}addEventListener(X,Y){this._assertHandlerTiming(X),super.addEventListener(X,Y)}onEventDispatch(X,Y){if(X===\"hostcontextchanged\")this._hostContext={...this._hostContext,...Y}}constructor(X,Y={},Z={autoResize:!0}){super(Z);this._appInfo=X;this._capabilities=Y;this.options=Z;if(!Z.allowUnsafeEval)mQ.config({jitless:!0});this.setRequestHandler(uQ,($)=>{return console.log(\"Received ping:\",$.params),{}}),this.setEventHandler(\"hostcontextchanged\",void 0)}registerCapabilities(X){if(this.transport)throw Error(\"Cannot register capabilities after transport is established\");this._capabilities=yQ(this._capabilities,X)}registerTool(X,Y,Z){if(this._registeredTools[X])throw Error(`Tool ${X} is already registered`);let $=this,J=()=>{if($._initializedSent&&$._capabilities.tools?.listChanged)$.sendToolListChanged()},K=Y.inputSchema!==void 0,D={title:Y.title,description:Y.description,inputSchema:Y.inputSchema,outputSchema:Y.outputSchema,annotations:Y.annotations,_meta:Y._meta,enabled:!0,enable(){this.enabled=!0,J()},disable(){this.enabled=!1,J()},update(G){Object.assign(this,G),J()},remove(){if($._registeredTools[X]!==D)return;delete $._registeredTools[X],J()},handler:async(G,N)=>{if(!D.enabled)throw Error(`Tool ${X} is disabled`);let W;if(K){let n=D.inputSchema,YQ=n?await p(n,G??{},`Invalid input for tool ${X}: `):G??{};W=await Z(YQ,N)}else W=await Z(N);if(D.outputSchema&&!W.isError)W.structuredContent=await p(D.outputSchema,W.structuredContent,`Invalid output for tool ${X}: `);return W}};if(this._registeredTools[X]=D,!this._capabilities.tools&&!this.transport)this.registerCapabilities({tools:{listChanged:!0}});return this.ensureToolHandlersInitialized(),J(),D}_toolHandlersInitialized=!1;ensureToolHandlersInitialized(){if(this._toolHandlersInitialized)return;this._toolHandlersInitialized=!0,this.oncalltool=async(X,Y)=>{let Z=this._registeredTools[X.name];if(!Z)throw Error(`Tool ${X.name} not found`);return Z.handler(X.arguments,Y)},this.onlisttools=async(X,Y)=>{return{tools:await Promise.all(Object.entries(this._registeredTools).filter(([$,J])=>J.enabled).map(async([$,J])=>{let K={name:$,title:J.title,description:J.description,inputSchema:J.inputSchema?await m(J.inputSchema,\"input\"):{type:\"object\",properties:{}}};if(J.outputSchema)K.outputSchema=await m(J.outputSchema,\"output\");if(J.annotations)K.annotations=J.annotations;if(J._meta)K._meta=J._meta;return K}))}}}async sendToolListChanged(X={}){this._assertInitialized(\"sendToolListChanged\"),await this.notification({method:\"notifications/tools/list_changed\",params:X})}getHostCapabilities(){return this._hostCapabilities}getHostVersion(){return this._hostInfo}getHostContext(){return this._hostContext}get ontoolinput(){return this.getEventHandler(\"toolinput\")}set ontoolinput(X){this.setEventHandler(\"toolinput\",X)}get ontoolinputpartial(){return this.getEventHandler(\"toolinputpartial\")}set ontoolinputpartial(X){this.setEventHandler(\"toolinputpartial\",X)}get ontoolresult(){return this.getEventHandler(\"toolresult\")}set ontoolresult(X){this.setEventHandler(\"toolresult\",X)}get ontoolcancelled(){return this.getEventHandler(\"toolcancelled\")}set ontoolcancelled(X){this.setEventHandler(\"toolcancelled\",X)}get onhostcontextchanged(){return this.getEventHandler(\"hostcontextchanged\")}set onhostcontextchanged(X){this.setEventHandler(\"hostcontextchanged\",X)}_onteardown;get onteardown(){return this._onteardown}set onteardown(X){this.warnIfRequestHandlerReplaced(\"onteardown\",this._onteardown,X),this._onteardown=X,this.replaceRequestHandler(C,(Y,Z)=>{if(!this._onteardown)throw Error(\"No onteardown handler set\");return this._onteardown(Y.params,Z)})}_oncalltool;get oncalltool(){return this._oncalltool}set oncalltool(X){this.warnIfRequestHandlerReplaced(\"oncalltool\",this._oncalltool,X),this._oncalltool=X,this.replaceRequestHandler(gQ,(Y,Z)=>{if(!this._oncalltool)throw Error(\"No oncalltool handler set\");return this._oncalltool(Y.params,Z)})}_onlisttools;get onlisttools(){return this._onlisttools}set onlisttools(X){this.warnIfRequestHandlerReplaced(\"onlisttools\",this._onlisttools,X),this._onlisttools=X,this.replaceRequestHandler(dQ,(Y,Z)=>{if(!this._onlisttools)throw Error(\"No onlisttools handler set\");return this._onlisttools(Y.params,Z)})}assertCapabilityForMethod(X){switch(X){case\"sampling/createMessage\":if(!this._hostCapabilities?.sampling)throw Error(`Host does not support sampling (required for ${X})`);break}}assertRequestHandlerCapability(X){switch(X){case\"tools/call\":case\"tools/list\":if(!this._capabilities.tools)throw Error(`Client does not support tool capability (required for ${X})`);return;case\"ping\":case\"ui/resource-teardown\":return;default:throw Error(`No handler for method ${X} registered`)}}assertNotificationCapability(X){}assertTaskCapability(X){throw Error(\"Tasks are not supported in MCP Apps\")}assertTaskHandlerCapability(X){throw Error(\"Task handlers are not supported in MCP Apps\")}async callServerTool(X,Y){if(this._assertInitialized(\"callServerTool\"),typeof X===\"string\")throw Error(`callServerTool() expects an object as its first argument, but received a string (\"${X}\"). Did you mean: callServerTool({ name: \"${X}\", arguments: { ... } })?`);return await this.request({method:\"tools/call\",params:X},fQ,{onprogress:()=>{},resetTimeoutOnProgress:!0,...Y})}async readServerResource(X,Y){return this._assertInitialized(\"readServerResource\"),await this.request({method:\"resources/read\",params:X},hQ,Y)}async listServerResources(X,Y){return this._assertInitialized(\"listServerResources\"),await this.request({method:\"resources/list\",params:X},bQ,Y)}async createSamplingMessage(X,Y){this._assertInitialized(\"createSamplingMessage\");let Z=X.tools?vQ:kQ;return await this.request({method:\"sampling/createMessage\",params:X},Z,Y)}sendMessage(X,Y){return this._assertInitialized(\"sendMessage\"),this.request({method:\"ui/message\",params:X},U,Y)}sendLog(X){return this.notification({method:\"notifications/message\",params:X})}updateModelContext(X,Y){return this._assertInitialized(\"updateModelContext\"),this.request({method:\"ui/update-model-context\",params:X},xQ,Y)}openLink(X,Y){return this._assertInitialized(\"openLink\"),this.request({method:\"ui/open-link\",params:X},P,Y)}sendOpenLink=this.openLink;downloadFile(X,Y){return this._assertInitialized(\"downloadFile\"),this.request({method:\"ui/download-file\",params:X},A,Y)}requestTeardown(X={}){return this.notification({method:\"ui/notifications/request-teardown\",params:X})}requestDisplayMode(X,Y){return this._assertInitialized(\"requestDisplayMode\"),this.request({method:\"ui/request-display-mode\",params:X},g,Y)}sendSizeChanged(X){return this.notification({method:\"ui/notifications/size-changed\",params:X})}setupSizeChangedNotifications(){let X=!1,Y=0,Z=0,$=()=>{if(X)return;X=!0,requestAnimationFrame(()=>{X=!1;let K=document.documentElement,D=K.style.height;K.style.height=\"max-content\";let G=Math.ceil(K.getBoundingClientRect().height);K.style.height=D;let N=Math.ceil(window.innerWidth);if(N!==Y||G!==Z)Y=N,Z=G,this.sendSizeChanged({width:N,height:G})})};$();let J=new ResizeObserver($);return J.observe(document.documentElement),J.observe(document.body),()=>J.disconnect()}async connect(X=new E(window.parent,window.parent),Y){if(this.transport)throw Error(\"App is already connected. Call close() before connecting again.\");this._initializedSent=!1,await super.connect(X);try{let Z=await this.request({method:\"ui/initialize\",params:{appCapabilities:this._capabilities,appInfo:this._appInfo,protocolVersion:j}},h,Y);if(Z===void 0)throw Error(`Server sent invalid initialize result: ${Z}`);if(this._hostCapabilities=Z.hostCapabilities,this._hostInfo=Z.hostInfo,this._hostContext=Z.hostContext,await this.notification({method:\"ui/notifications/initialized\"}),this._initializedSent=!0,this.options?.autoResize)this.setupSizeChangedNotifications()}catch(Z){throw this.close(),Z}}}function FZ(X){let Z=X._meta?.ui?.resourceUri;if(Z===void 0)Z=X._meta?.[i];if(typeof Z===\"string\"&&Z.startsWith(\"ui://\"))return Z;else if(Z!==void 0)throw Error(`Invalid UI resource URI: ${JSON.stringify(Z)}`);return}function LZ(X){let Z=X._meta?.ui?.visibility;if(!Z)return!1;if(Z.length===1&&Z[0]===\"model\")return!0;return!1}function PZ(X){let Z=X._meta?.ui?.visibility;if(!Z)return!1;if(Z.length===1&&Z[0]===\"app\")return!0;return!1}function AZ(X){if(!X)return\"\";let Y=[];if(X.camera)Y.push(\"camera\");if(X.microphone)Y.push(\"microphone\");if(X.geolocation)Y.push(\"geolocation\");if(X.clipboardWrite)Y.push(\"clipboard-write\");return Y.join(\"; \")}var KX=[j];class DX extends _{_client;_hostInfo;_capabilities;_appCapabilities;_hostContext={};_appInfo;_initializedReceived=!1;_baseReplaceRequestHandler=this.replaceRequestHandler;replaceRequestHandler=(X,Y)=>{this._baseReplaceRequestHandler(X,(Z,$)=>{if(!this._initializedReceived)console.warn(`[ext-apps] AppBridge received '${Z.method}' before ui/notifications/initialized. The View is calling host methods before completing the handshake; it should await app.connect() first.`);return Y(Z,$)})};eventSchemas={sizechange:H,sandboxready:w,initialized:y,requestteardown:q,loggingmessage:eQ};constructor(X,Y,Z,$){super($);this._client=X;this._hostInfo=Y;this._capabilities=Z;this.addEventListener(\"initialized\",()=>{this._initializedReceived=!0}),this._hostContext=$?.hostContext||{},this.setRequestHandler(u,(J)=>this._oninitialize(J)),this.setRequestHandler(QX,(J,K)=>{return this.onping?.(J.params,K),{}}),this.replaceRequestHandler(I,(J)=>{return{mode:this._hostContext.displayMode??\"inline\"}})}getAppCapabilities(){return this._appCapabilities}getAppVersion(){return this._appInfo}onping;get onsizechange(){return this.getEventHandler(\"sizechange\")}set onsizechange(X){this.setEventHandler(\"sizechange\",X)}get onsandboxready(){return this.getEventHandler(\"sandboxready\")}set onsandboxready(X){this.setEventHandler(\"sandboxready\",X)}get oninitialized(){return this.getEventHandler(\"initialized\")}set oninitialized(X){this.setEventHandler(\"initialized\",X)}_onmessage;get onmessage(){return this._onmessage}set onmessage(X){this.warnIfRequestHandlerReplaced(\"onmessage\",this._onmessage,X),this._onmessage=X,this.replaceRequestHandler(k,async(Y,Z)=>{if(!this._onmessage)throw Error(\"No onmessage handler set\");return this._onmessage(Y.params,Z)})}_onopenlink;get onopenlink(){return this._onopenlink}set onopenlink(X){this.warnIfRequestHandlerReplaced(\"onopenlink\",this._onopenlink,X),this._onopenlink=X,this.replaceRequestHandler(L,async(Y,Z)=>{if(!this._onopenlink)throw Error(\"No onopenlink handler set\");return this._onopenlink(Y.params,Z)})}_ondownloadfile;get ondownloadfile(){return this._ondownloadfile}set ondownloadfile(X){this.warnIfRequestHandlerReplaced(\"ondownloadfile\",this._ondownloadfile,X),this._ondownloadfile=X,this.replaceRequestHandler(f,async(Y,Z)=>{if(!this._ondownloadfile)throw Error(\"No ondownloadfile handler set\");return this._ondownloadfile(Y.params,Z)})}get onrequestteardown(){return this.getEventHandler(\"requestteardown\")}set onrequestteardown(X){this.setEventHandler(\"requestteardown\",X)}_onrequestdisplaymode;get onrequestdisplaymode(){return this._onrequestdisplaymode}set onrequestdisplaymode(X){this.warnIfRequestHandlerReplaced(\"onrequestdisplaymode\",this._onrequestdisplaymode,X),this._onrequestdisplaymode=X,this.replaceRequestHandler(I,async(Y,Z)=>{if(!this._onrequestdisplaymode)throw Error(\"No onrequestdisplaymode handler set\");return this._onrequestdisplaymode(Y.params,Z)})}get onloggingmessage(){return this.getEventHandler(\"loggingmessage\")}set onloggingmessage(X){this.setEventHandler(\"loggingmessage\",X)}_onupdatemodelcontext;get onupdatemodelcontext(){return this._onupdatemodelcontext}set onupdatemodelcontext(X){this.warnIfRequestHandlerReplaced(\"onupdatemodelcontext\",this._onupdatemodelcontext,X),this._onupdatemodelcontext=X,this.replaceRequestHandler(d,async(Y,Z)=>{if(!this._onupdatemodelcontext)throw Error(\"No onupdatemodelcontext handler set\");return this._onupdatemodelcontext(Y.params,Z)})}_oncalltool;get oncalltool(){return this._oncalltool}set oncalltool(X){this.warnIfRequestHandlerReplaced(\"oncalltool\",this._oncalltool,X),this._oncalltool=X,this.replaceRequestHandler(iQ,async(Y,Z)=>{if(!this._oncalltool)throw Error(\"No oncalltool handler set\");return this._oncalltool(Y.params,Z)})}set oncreatesamplingmessage(X){this.setRequestHandler(nQ,async(Y,Z)=>{return X(Y.params,Z)})}sendToolListChanged(X={}){return this.notification({method:\"notifications/tools/list_changed\",params:X})}_onlistresources;get onlistresources(){return this._onlistresources}set onlistresources(X){this.warnIfRequestHandlerReplaced(\"onlistresources\",this._onlistresources,X),this._onlistresources=X,this.replaceRequestHandler(rQ,async(Y,Z)=>{if(!this._onlistresources)throw Error(\"No onlistresources handler set\");return this._onlistresources(Y.params,Z)})}_onlistresourcetemplates;get onlistresourcetemplates(){return this._onlistresourcetemplates}set onlistresourcetemplates(X){this.warnIfRequestHandlerReplaced(\"onlistresourcetemplates\",this._onlistresourcetemplates,X),this._onlistresourcetemplates=X,this.replaceRequestHandler(sQ,async(Y,Z)=>{if(!this._onlistresourcetemplates)throw Error(\"No onlistresourcetemplates handler set\");return this._onlistresourcetemplates(Y.params,Z)})}_onreadresource;get onreadresource(){return this._onreadresource}set onreadresource(X){this.warnIfRequestHandlerReplaced(\"onreadresource\",this._onreadresource,X),this._onreadresource=X,this.replaceRequestHandler(YX,async(Y,Z)=>{if(!this._onreadresource)throw Error(\"No onreadresource handler set\");return this._onreadresource(Y.params,Z)})}sendResourceListChanged(X={}){return this.notification({method:\"notifications/resources/list_changed\",params:X})}_onlistprompts;get onlistprompts(){return this._onlistprompts}set onlistprompts(X){this.warnIfRequestHandlerReplaced(\"onlistprompts\",this._onlistprompts,X),this._onlistprompts=X,this.replaceRequestHandler(cQ,async(Y,Z)=>{if(!this._onlistprompts)throw Error(\"No onlistprompts handler set\");return this._onlistprompts(Y.params,Z)})}sendPromptListChanged(X={}){return this.notification({method:\"notifications/prompts/list_changed\",params:X})}assertCapabilityForMethod(X){}assertRequestHandlerCapability(X){}assertNotificationCapability(X){}assertTaskCapability(X){throw Error(\"Tasks are not supported in MCP Apps\")}assertTaskHandlerCapability(X){throw Error(\"Task handlers are not supported in MCP Apps\")}getCapabilities(){return this._capabilities}async _oninitialize(X){let Y=X.params.protocolVersion;if(this._appInfo!==void 0)console.warn(\"[ext-apps] AppBridge received a second ui/initialize. The View may be double-mounting (e.g. React StrictMode in dev) without closing the previous App instance. Responding normally; the latest appInfo/appCapabilities replace the previous values.\");return this._appCapabilities=X.params.appCapabilities,this._appInfo=X.params.appInfo,{protocolVersion:KX.includes(Y)?Y:j,hostCapabilities:this.getCapabilities(),hostInfo:this._hostInfo,hostContext:this._hostContext}}setHostContext(X){let Y={},Z=!1;for(let $ of Object.keys(X)){let J=this._hostContext[$],K=X[$];if(GX(J,K))continue;Y[$]=K,Z=!0}if(Z)this._hostContext=X,this.sendHostContextChange(Y)}sendHostContextChange(X){return this.notification({method:\"ui/notifications/host-context-changed\",params:X})}sendToolInput(X){return this.notification({method:\"ui/notifications/tool-input\",params:X})}sendToolInputPartial(X){return this.notification({method:\"ui/notifications/tool-input-partial\",params:X})}sendToolResult(X){return this.notification({method:\"ui/notifications/tool-result\",params:X})}sendToolCancelled(X){return this.notification({method:\"ui/notifications/tool-cancelled\",params:X})}sendSandboxResourceReady(X){return this.notification({method:\"ui/notifications/sandbox-resource-ready\",params:X})}teardownResource(X,Y){return this.request({method:\"ui/resource-teardown\",params:X},S,Y)}sendResourceTeardown=this.teardownResource;callTool(X,Y){return this.request({method:\"tools/call\",params:X},XQ,Y)}listTools(X,Y){return this.request({method:\"tools/list\",params:X},aQ,Y)}async connect(X){if(this.transport)throw Error(\"AppBridge is already connected. Call close() before connecting again.\");if(this._initializedReceived=!1,this._client){let Y=this._client.getServerCapabilities();if(!Y)throw Error(\"Client server capabilities not available\");if(Y.tools){if(this.oncalltool=async(Z,$)=>{return this._client.request({method:\"tools/call\",params:Z},XQ,{signal:$.signal})},Y.tools.listChanged)this._client.setNotificationHandler(JX,(Z)=>this.sendToolListChanged(Z.params))}if(Y.resources){if(this.onlistresources=async(Z,$)=>{return this._client.request({method:\"resources/list\",params:Z},oQ,{signal:$.signal})},this.onlistresourcetemplates=async(Z,$)=>{return this._client.request({method:\"resources/templates/list\",params:Z},tQ,{signal:$.signal})},this.onreadresource=async(Z,$)=>{return this._client.request({method:\"resources/read\",params:Z},ZX,{signal:$.signal})},Y.resources.listChanged)this._client.setNotificationHandler($X,(Z)=>this.sendResourceListChanged(Z.params))}if(Y.prompts){if(this.onlistprompts=async(Z,$)=>{return this._client.request({method:\"prompts/list\",params:Z},lQ,{signal:$.signal})},Y.prompts.listChanged)this._client.setNotificationHandler(XX,(Z)=>this.sendPromptListChanged(Z.params))}}return super.connect(X)}}function GX(X,Y){return JSON.stringify(X)===JSON.stringify(Y)}export{LZ as isToolVisibilityModelOnly,PZ as isToolVisibilityAppOnly,FZ as getToolUiResourceUri,AZ as buildAllowAttribute,BQ as TOOL_RESULT_METHOD,V as TOOL_INPUT_PARTIAL_METHOD,jQ as TOOL_INPUT_METHOD,_Q as TOOL_CANCELLED_METHOD,KX as SUPPORTED_PROTOCOL_VERSIONS,WQ as SIZE_CHANGED_METHOD,NQ as SANDBOX_RESOURCE_READY_METHOD,GQ as SANDBOX_PROXY_READY_METHOD,i as RESOURCE_URI_META_KEY,zQ as RESOURCE_TEARDOWN_METHOD,pQ as RESOURCE_MIME_TYPE,OQ as REQUEST_TEARDOWN_METHOD,FQ as REQUEST_DISPLAY_MODE_METHOD,E as PostMessageTransport,JQ as OPEN_LINK_METHOD,d as McpUiUpdateModelContextRequestSchema,e as McpUiToolVisibilitySchema,v as McpUiToolResultNotificationSchema,MQ as McpUiToolMetaSchema,T as McpUiToolInputPartialNotificationSchema,R as McpUiToolInputNotificationSchema,M as McpUiToolCancelledNotificationSchema,r as McpUiThemeSchema,F as McpUiSupportedContentBlockModalitiesSchema,H as McpUiSizeChangedNotificationSchema,CQ as McpUiSandboxResourceReadyNotificationSchema,w as McpUiSandboxProxyReadyNotificationSchema,S as McpUiResourceTeardownResultSchema,C as McpUiResourceTeardownRequestSchema,z as McpUiResourcePermissionsSchema,TQ as McpUiResourceMetaSchema,O as McpUiResourceCspSchema,q as McpUiRequestTeardownNotificationSchema,g as McpUiRequestDisplayModeResultSchema,I as McpUiRequestDisplayModeRequestSchema,P as McpUiOpenLinkResultSchema,L as McpUiOpenLinkRequestSchema,U as McpUiMessageResultSchema,k as McpUiMessageRequestSchema,y as McpUiInitializedNotificationSchema,h as McpUiInitializeResultSchema,u as McpUiInitializeRequestSchema,s as McpUiHostStylesSchema,o as McpUiHostCssSchema,x as McpUiHostContextSchema,b as McpUiHostContextChangedNotificationSchema,t as McpUiHostCapabilitiesSchema,A as McpUiDownloadFileResultSchema,f as McpUiDownloadFileRequestSchema,B as McpUiDisplayModeSchema,a as McpUiAppCapabilitiesSchema,DQ as MESSAGE_METHOD,j as LATEST_PROTOCOL_VERSION,IQ as INITIALIZE_METHOD,VQ as INITIALIZED_METHOD,EQ as HOST_CONTEXT_CHANGED_METHOD,KQ as DOWNLOAD_FILE_METHOD,DX as AppBridge};\n","import {\n AppBridge,\n PostMessageTransport,\n type McpUiHostContext,\n type McpUiDisplayMode,\n type McpUiHostCapabilities,\n type McpUiToolInputNotification,\n type McpUiToolInputPartialNotification,\n type McpUiToolResultNotification,\n type McpUiToolCancelledNotification,\n} from '@modelcontextprotocol/ext-apps/app-bridge';\nimport type {\n CallToolRequest,\n CallToolResult,\n CreateMessageRequest,\n CreateMessageResult,\n CreateMessageResultWithTools,\n LoggingMessageNotification,\n} from '@modelcontextprotocol/sdk/types.js';\n\nconst DEFAULT_HOST_INFO = { name: 'SunpeakInspector', version: '1.0.0' };\n\n/**\n * Debug logger for MCP bridge messages. Uses CSS-formatted console.log in browsers,\n * no-ops during unit tests (Vitest) where the output is just noise.\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nconst debugLog: (...args: any[]) => void =\n typeof process !== 'undefined' && process.env?.VITEST ? () => {} : console.log;\n\nconst DEFAULT_HOST_CAPABILITIES: McpUiHostCapabilities = {\n openLinks: {},\n serverTools: {},\n serverResources: {},\n downloadFile: {},\n logging: {},\n updateModelContext: { text: {} },\n message: { text: {} },\n sandbox: {},\n sampling: { tools: {} },\n};\n\nexport interface McpAppHostOptions {\n hostContext?: McpUiHostContext;\n /** Host info reported to the app via MCP protocol. Defaults to SunpeakInspector. */\n hostInfo?: { name: string; version: string };\n /** Host capabilities reported to the app. Defaults to baseline MCP capabilities. */\n hostCapabilities?: McpUiHostCapabilities;\n onDisplayModeChange?: (mode: McpUiDisplayMode) => void;\n onMessage?: (role: string, content: unknown[]) => void;\n onOpenLink?: (url: string) => void;\n onUpdateModelContext?: (content: unknown[], structuredContent?: unknown) => void;\n onSizeChanged?: (params: { width?: number; height?: number }) => void;\n onLog?: (params: LoggingMessageNotification['params']) => void;\n onCallTool?: (params: CallToolRequest['params']) => CallToolResult | Promise<CallToolResult>;\n onCreateSamplingMessage?: (\n params: CreateMessageRequest['params']\n ) => Promise<CreateMessageResult | CreateMessageResultWithTools>;\n onDownloadFile?: (contents: unknown[]) => void;\n /** Called when the app requests teardown (app-initiated close). */\n onRequestTeardown?: () => void;\n /** Called after the iframe confirms rendering in a new display mode (paint fence resolved). */\n onDisplayModeReady?: (mode: string) => void;\n /**\n * Called when the sandbox proxy signals readiness (double-iframe mode).\n * The host should respond by sending HTML content via sendSandboxResourceReady().\n */\n onSandboxReady?: () => void;\n}\n\n/**\n * MCP Apps host for the Sunpeak inspector.\n * Wraps AppBridge to provide a simpler API for the inspector.\n * Connects to an iframe via PostMessageTransport.\n */\nexport class McpAppHost {\n private bridge: AppBridge;\n private options: McpAppHostOptions;\n private _initialized = false;\n private _contentWindow: Window | null = null;\n private _fenceId = 0;\n private _fenceCleanup: (() => void) | null = null;\n private _prevDisplayMode: string | undefined;\n private _pendingToolInput: McpUiToolInputNotification['params'] | null = null;\n private _pendingToolResult: McpUiToolResultNotification['params'] | null = null;\n private _messageListener: ((event: MessageEvent) => void) | null = null;\n\n constructor(options: McpAppHostOptions = {}) {\n this.options = options;\n this._prevDisplayMode = options.hostContext?.displayMode;\n\n const hostInfo = options.hostInfo ?? DEFAULT_HOST_INFO;\n const hostCapabilities = options.hostCapabilities ?? DEFAULT_HOST_CAPABILITIES;\n this.bridge = new AppBridge(null, hostInfo, hostCapabilities, {\n hostContext: options.hostContext,\n });\n\n this.bridge.oninitialized = () => {\n this._initialized = true;\n\n // Flush any data that was sent before initialization completed\n if (this._pendingToolInput) {\n this.bridge.sendToolInput(this._pendingToolInput);\n this._pendingToolInput = null;\n }\n if (this._pendingToolResult) {\n this.bridge.sendToolResult(this._pendingToolResult);\n this._pendingToolResult = null;\n }\n };\n\n this.bridge.onopenlink = async ({ url }) => {\n if (this.options.onOpenLink) {\n this.options.onOpenLink(url);\n } else {\n // Validate URL scheme to prevent javascript: and data: URLs\n try {\n const parsed = new URL(url);\n if (parsed.protocol !== 'http:' && parsed.protocol !== 'https:') {\n console.warn('[MCP App] openLink blocked non-http(s) URL:', url);\n } else {\n // noopener+noreferrer prevents the new tab from reaching this\n // window via window.opener (Safari does not auto-apply this for\n // same-origin destinations).\n window.open(url, '_blank', 'noopener,noreferrer');\n }\n } catch {\n console.warn('[MCP App] openLink blocked invalid URL:', url);\n }\n }\n const ack = {};\n debugLog(\n `%c[MCP ↓]%c host → app: %copenLink ack`,\n 'color:#f9a8d4',\n 'color:inherit',\n 'color:#93c5fd',\n ack\n );\n return ack;\n };\n\n this.bridge.onmessage = async ({ role, content }) => {\n if (this.options.onMessage) {\n this.options.onMessage(role, content);\n }\n const ack = {};\n debugLog(\n `%c[MCP ↓]%c host → app: %csendMessage ack`,\n 'color:#f9a8d4',\n 'color:inherit',\n 'color:#93c5fd',\n ack\n );\n return ack;\n };\n\n this.bridge.onrequestdisplaymode = async ({ mode }) => {\n this.options.onDisplayModeChange?.(mode);\n const result = { mode };\n debugLog(\n `%c[MCP ↓]%c host → app: %crequestDisplayMode result`,\n 'color:#f9a8d4',\n 'color:inherit',\n 'color:#93c5fd',\n result\n );\n return result;\n };\n\n this.bridge.onupdatemodelcontext = async ({ content, structuredContent }) => {\n this.options.onUpdateModelContext?.(content ?? [], structuredContent);\n const ack = {};\n debugLog(\n `%c[MCP ↓]%c host → app: %cupdateModelContext ack`,\n 'color:#f9a8d4',\n 'color:inherit',\n 'color:#93c5fd',\n ack\n );\n return ack;\n };\n\n this.bridge.onsizechange = (params) => {\n this.options.onSizeChanged?.(params);\n };\n\n this.bridge.onloggingmessage = (params) => {\n if (this.options.onLog) {\n this.options.onLog(params);\n } else {\n // Default: log to console with appropriate level\n const level = params.level ?? 'info';\n const prefix = `[MCP App${params.logger ? ` ${params.logger}` : ''}]`;\n if (\n level === 'error' ||\n level === 'critical' ||\n level === 'alert' ||\n level === 'emergency'\n ) {\n console.error(prefix, params.data);\n } else if (level === 'warning') {\n console.warn(prefix, params.data);\n } else if (level === 'debug') {\n console.debug(prefix, params.data);\n } else {\n console.log(prefix, params.data);\n }\n }\n };\n\n this.bridge.oncalltool = async (params) => {\n let result: CallToolResult;\n if (this.options.onCallTool) {\n result = await this.options.onCallTool(params);\n } else {\n result = {\n content: [\n {\n type: 'text',\n text: `[Inspector] Tool \"${params.name}\" called (no handler configured)`,\n },\n ],\n };\n }\n debugLog(\n `%c[MCP ↓]%c host → app: %ccallServerTool result(${params.name})`,\n 'color:#f9a8d4',\n 'color:inherit',\n 'color:#93c5fd',\n result\n );\n return result;\n };\n\n this.bridge.oncreatesamplingmessage = async (params) => {\n if (this.options.onCreateSamplingMessage) {\n const result = await this.options.onCreateSamplingMessage(params);\n debugLog(\n `%c[MCP ↓]%c host → app: %ccreateSamplingMessage result`,\n 'color:#f9a8d4',\n 'color:inherit',\n 'color:#93c5fd',\n result\n );\n return result;\n }\n const fallback: CreateMessageResult = {\n model: 'inspector-stub',\n stopReason: 'endTurn',\n role: 'assistant',\n content: {\n type: 'text',\n text: '[Inspector] Sampling not configured',\n },\n };\n debugLog(\n `%c[MCP ↓]%c host → app: %ccreateSamplingMessage result (stub)`,\n 'color:#f9a8d4',\n 'color:inherit',\n 'color:#93c5fd',\n fallback\n );\n return fallback;\n };\n\n this.bridge.ondownloadfile = async ({ contents }) => {\n if (this.options.onDownloadFile) {\n this.options.onDownloadFile(contents);\n }\n const ack = {};\n debugLog(\n `%c[MCP ↓]%c host → app: %cdownloadFile ack`,\n 'color:#f9a8d4',\n 'color:inherit',\n 'color:#93c5fd',\n ack\n );\n return ack;\n };\n\n this.bridge.onrequestteardown = () => {\n if (this.options.onRequestTeardown) {\n this.options.onRequestTeardown();\n } else {\n debugLog('[MCP App] requestTeardown (app requested close)');\n }\n };\n\n // Double-iframe sandbox support: when the proxy signals readiness,\n // notify the host so it can deliver the app HTML.\n // The proxy retries the ready signal periodically, so we guard against\n // calling onSandboxReady more than once.\n let sandboxReadyFired = false;\n this.bridge.onsandboxready = () => {\n if (sandboxReadyFired) return;\n sandboxReadyFired = true;\n this.options.onSandboxReady?.();\n };\n }\n\n /**\n * Connect to an iframe's contentWindow.\n */\n async connectToIframe(contentWindow: Window): Promise<void> {\n // Clean up previous listener if reconnecting\n if (this._messageListener) {\n window.removeEventListener('message', this._messageListener);\n }\n\n this._contentWindow = contentWindow;\n\n // Log incoming MCP protocol messages from the app (skip sunpeak internals)\n this._messageListener = (event: MessageEvent) => {\n if (event.source !== contentWindow) return;\n const data = event.data;\n if (!data || typeof data !== 'object') return;\n const method: string | undefined = data.method;\n // Skip sunpeak-internal and sandbox infrastructure messages\n if (method?.startsWith('sunpeak/') || method === 'ui/notifications/sandbox-proxy-ready')\n return;\n const label = method ?? (data.id != null ? `response #${data.id}` : 'unknown');\n debugLog(\n `%c[MCP ↑]%c app → host: %c${label}`,\n 'color:#6ee7b7',\n 'color:inherit',\n 'color:#93c5fd',\n data\n );\n };\n window.addEventListener('message', this._messageListener);\n\n const transport = new PostMessageTransport(contentWindow, contentWindow);\n await this.bridge.connect(transport);\n }\n\n /**\n * Wait for the iframe to process all pending messages and commit its DOM.\n *\n * Uses a postMessage fence: since messages to the same target are delivered\n * in FIFO order, a fence message sent after setHostContext is guaranteed to\n * be processed after the host context change. The iframe's fence responder\n * waits for requestAnimationFrame before acking, ensuring the DOM has been\n * committed for the re-render triggered by the context change.\n *\n * Returns immediately if the iframe is not connected.\n */\n waitForPaint(): Promise<void> {\n const win = this._contentWindow;\n if (!win) return Promise.resolve();\n\n // Cancel any previous pending fence\n this._fenceCleanup?.();\n\n const id = ++this._fenceId;\n\n return new Promise<void>((resolve) => {\n const handler = (event: MessageEvent) => {\n if (event.source !== win) return;\n if (event.data?.method === 'sunpeak/fence-ack' && event.data.params?.fenceId === id) {\n cleanup();\n resolve();\n }\n };\n\n const cleanup = () => {\n window.removeEventListener('message', handler);\n if (this._fenceCleanup === cleanup) {\n this._fenceCleanup = null;\n }\n };\n\n this._fenceCleanup = cleanup;\n window.addEventListener('message', handler);\n\n try {\n // Format as a valid JSON-RPC 2.0 notification so the SDK's\n // PostMessageTransport parses it without error. Unknown notification\n // methods are silently ignored by the bridge.\n const fenceMsg = { jsonrpc: '2.0', method: 'sunpeak/fence', params: { fenceId: id } };\n win.postMessage(fenceMsg, '*');\n } catch {\n // Detached or cross-origin window\n cleanup();\n resolve();\n }\n });\n }\n\n /**\n * Update the host context and notify the connected app.\n * Automatically detects display mode changes and waits for the iframe\n * to commit its DOM before firing onDisplayModeReady.\n */\n setHostContext(context: McpUiHostContext): void {\n debugLog(\n `%c[MCP ↓]%c host → app: %csetHostContext`,\n 'color:#f9a8d4',\n 'color:inherit',\n 'color:#93c5fd',\n context\n );\n this.bridge.setHostContext(context);\n\n const currentMode = context.displayMode;\n if (currentMode && currentMode !== this._prevDisplayMode) {\n this._prevDisplayMode = currentMode;\n const mode = currentMode;\n this.waitForPaint().then(() => {\n this.options.onDisplayModeReady?.(mode);\n });\n }\n }\n\n /**\n * Send tool input to the app.\n * If the app hasn't initialized yet, the input is queued.\n */\n sendToolInput(args: Record<string, unknown>): void {\n const params: McpUiToolInputNotification['params'] = { arguments: args };\n debugLog(\n `%c[MCP ↓]%c host → app: %csendToolInput`,\n 'color:#f9a8d4',\n 'color:inherit',\n 'color:#93c5fd',\n params\n );\n if (this._initialized) {\n this.bridge.sendToolInput(params);\n } else {\n this._pendingToolInput = params;\n }\n }\n\n /**\n * Send tool result to the app.\n * If the app hasn't initialized yet, the result is queued.\n */\n sendToolResult(result: CallToolResult): void {\n debugLog(\n `%c[MCP ↓]%c host → app: %csendToolResult`,\n 'color:#f9a8d4',\n 'color:inherit',\n 'color:#93c5fd',\n result\n );\n if (this._initialized) {\n this.bridge.sendToolResult(result);\n } else {\n this._pendingToolResult = result;\n }\n }\n\n /**\n * Send partial/streaming tool input to the app.\n * Useful for simulating streaming tool arguments.\n */\n sendToolInputPartial(args: Record<string, unknown>): void {\n const params: McpUiToolInputPartialNotification['params'] = { arguments: args };\n debugLog(\n `%c[MCP ↓]%c host → app: %csendToolInputPartial`,\n 'color:#f9a8d4',\n 'color:inherit',\n 'color:#93c5fd',\n params\n );\n if (this._initialized) {\n this.bridge.sendToolInputPartial(params);\n }\n // Don't queue partials - they're only meaningful during streaming\n }\n\n /**\n * Send tool cancellation notification to the app.\n * Simulates user or host cancelling a tool execution.\n */\n sendToolCancelled(reason?: string): void {\n const params: McpUiToolCancelledNotification['params'] = reason ? { reason } : {};\n debugLog(\n `%c[MCP ↓]%c host → app: %csendToolCancelled`,\n 'color:#f9a8d4',\n 'color:inherit',\n 'color:#93c5fd',\n params\n );\n if (this._initialized) {\n this.bridge.sendToolCancelled(params);\n }\n }\n\n /**\n * Send HTML resource to the sandbox proxy for secure loading.\n * Used in the double-iframe architecture after the proxy signals readiness.\n */\n sendSandboxResourceReady(params: { html: string; sandbox?: string }): void {\n this.bridge.sendSandboxResourceReady(params);\n }\n\n /**\n * Send a custom message to the connected iframe (for sandbox proxy commands).\n */\n sendRawMessage(data: unknown): void {\n const win = this._contentWindow;\n if (!win) return;\n try {\n win.postMessage(data, '*');\n } catch {\n // Detached or cross-origin window\n }\n }\n\n /**\n * Close the connection.\n */\n async close(): Promise<void> {\n if (this._messageListener) {\n window.removeEventListener('message', this._messageListener);\n this._messageListener = null;\n }\n this._fenceCleanup?.();\n this._fenceCleanup = null;\n try {\n if (this._initialized) {\n await this.bridge.teardownResource({});\n }\n } catch {\n // Ignore teardown errors\n }\n await this.bridge.close();\n this._initialized = false;\n // Note: _contentWindow is intentionally NOT cleared here.\n // In React strict mode, close() runs asynchronously during the cleanup\n // phase of double-mount, completing after effects have re-run. Clearing\n // _contentWindow would break injectState() and waitForPaint() which\n // use it directly (unlike sendToolResult which goes through the bridge).\n // The reference becomes harmless on real unmount since no code calls\n // methods on a host whose component has been removed from the tree.\n }\n\n /**\n * Debug: Inject state directly into the app's useAppState hook.\n * This bypasses the normal MCP Apps protocol and is intended for\n * inspector testing/debugging only.\n */\n injectState(state: Record<string, unknown>): void {\n const win = this._contentWindow;\n if (!win) return;\n\n try {\n win.postMessage({ jsonrpc: '2.0', method: 'sunpeak/injectState', params: { state } }, '*');\n } catch {\n // Detached or cross-origin window - ignore\n }\n }\n\n /**\n * Update mutable options (callbacks) after construction.\n * Allows the inspector to swap handlers (e.g. onCallTool) without\n * recreating the host and tearing down the iframe connection.\n */\n updateOptions(partial: Partial<McpAppHostOptions>): void {\n Object.assign(this.options, partial);\n }\n\n get initialized(): boolean {\n return this._initialized;\n }\n}\n","/**\n * Mock OpenAI runtime for the inspector.\n *\n * ChatGPT-specific hooks (useUploadFile, useRequestModal, etc.) call\n * `window.openai` directly — they don't use the MCP protocol. When the\n * ChatGPT host is selected in the inspector, we inject this mock into\n * the iframe's window so those hooks work during local development.\n */\n\n/**\n * Inline script that sets up a mock `window.openai` for srcdoc iframes.\n * Embedded in the generated HTML *before* the app's script so that\n * `isChatGPT()` and hooks work from the very first render.\n */\nexport const MOCK_OPENAI_RUNTIME_SCRIPT = [\n 'window.openai={',\n 'uploadFile:function(f){console.log(\"[Inspector] uploadFile:\",f.name);',\n 'return Promise.resolve({fileId:\"sim_file_\"+Date.now()})},',\n 'getFileDownloadUrl:function(p){console.log(\"[Inspector] getFileDownloadUrl:\",p.fileId);',\n 'return Promise.resolve({downloadUrl:\"https://inspector.local/files/\"+p.fileId})},',\n 'requestModal:function(p){console.log(\"[Inspector] requestModal:\",JSON.stringify(p));',\n 'return Promise.resolve()},',\n 'requestCheckout:function(s){console.log(\"[Inspector] requestCheckout:\",JSON.stringify(s));',\n 'return Promise.resolve({id:\"sim_order_\"+Date.now(),checkout_session_id:s.id||\"sim_session\",status:\"completed\"})},',\n 'requestClose:function(){console.log(\"[Inspector] requestClose\")},',\n 'requestDisplayMode:function(p){console.log(\"[Inspector] requestDisplayMode:\",p.mode);',\n 'return Promise.resolve()},',\n 'sendFollowUpMessage:function(p){console.log(\"[Inspector] sendFollowUpMessage:\",p.prompt)},',\n // Reject anything that isn\\'t http(s). javascript:/data:/file: URLs in\n // window.open inherit the opener\\'s origin in some browsers, which would\n // let an untrusted app run script in the inspector\\'s origin. Open with\n // noopener so the popup cannot navigate this window via window.opener.\n 'openExternal:function(p){console.log(\"[Inspector] openExternal:\",p.href);try{var u=new URL(p.href);if(u.protocol!==\"http:\"&&u.protocol!==\"https:\"){console.warn(\"[Inspector] openExternal blocked non-http(s) URL:\",p.href);return}window.open(p.href,\"_blank\",\"noopener,noreferrer\")}catch(e){console.warn(\"[Inspector] openExternal blocked invalid URL:\",p.href)}}',\n '};',\n].join('');\n\n/**\n * Create a mock OpenAI runtime object for direct injection into an\n * iframe's `contentWindow`. Used for src-mode iframes (dev with Vite)\n * where we can't embed inline scripts in the page.\n */\nexport function createMockOpenAIRuntime(): Record<string, (...args: never[]) => unknown> {\n return {\n uploadFile: async (file: File) => {\n console.log('[Inspector] uploadFile:', file.name);\n return { fileId: `sim_file_${Date.now()}` };\n },\n getFileDownloadUrl: async (params: { fileId: string }) => {\n console.log('[Inspector] getFileDownloadUrl:', params.fileId);\n return { downloadUrl: `https://inspector.local/files/${params.fileId}` };\n },\n requestModal: async (params: unknown) => {\n console.log('[Inspector] requestModal:', params);\n },\n requestCheckout: async (session: { id?: string }) => {\n console.log('[Inspector] requestCheckout:', session);\n return {\n id: `sim_order_${Date.now()}`,\n checkout_session_id: session.id || 'sim_session',\n status: 'completed',\n };\n },\n requestClose: () => {\n console.log('[Inspector] requestClose');\n },\n requestDisplayMode: async (params: { mode: string }) => {\n console.log('[Inspector] requestDisplayMode:', params.mode);\n },\n sendFollowUpMessage: (params: { prompt: string }) => {\n console.log('[Inspector] sendFollowUpMessage:', params.prompt);\n },\n openExternal: (params: { href: string }) => {\n console.log('[Inspector] openExternal:', params.href);\n try {\n const url = new URL(params.href);\n if (url.protocol !== 'http:' && url.protocol !== 'https:') {\n console.warn('[Inspector] openExternal blocked non-http(s) URL:', params.href);\n return;\n }\n window.open(params.href, '_blank', 'noopener,noreferrer');\n } catch {\n console.warn('[Inspector] openExternal blocked invalid URL:', params.href);\n }\n },\n };\n}\n","/**\n * Sandbox proxy for the double-iframe architecture.\n *\n * Real hosts (ChatGPT, Claude) use a two-level iframe structure:\n * 1. Outer iframe (sandbox proxy) — acts as a message relay on a separate origin\n * 2. Inner iframe — loads the untrusted app HTML\n *\n * The proxy relays PostMessage between the host (parent) and the app (inner iframe),\n * providing origin isolation and security boundaries.\n *\n * The inspector replicates this architecture so apps are tested under the same\n * iframe nesting they'll encounter in production.\n *\n * Protocol:\n * 1. Host creates outer iframe with proxy HTML (srcdoc)\n * 2. Proxy sends `ui/notifications/sandbox-proxy-ready` to parent\n * 3. Host sends `ui/notifications/sandbox-resource-ready` with { html, sandbox, csp, permissions }\n * OR `sunpeak/sandbox-load-src` with { src } for dev mode\n * 4. Proxy creates inner iframe and loads the content\n * 5. All subsequent messages relay transparently between parent and inner iframe\n */\n\n/**\n * Generate the sandbox proxy HTML.\n *\n * This HTML is loaded into the outer iframe via srcdoc. It:\n * - Signals readiness via `ui/notifications/sandbox-proxy-ready`\n * - Listens for resource content or URL to load into the inner iframe\n * - Relays all PostMessage between parent and inner iframe\n * - Optionally injects platform runtime scripts (e.g., mock window.openai)\n *\n * @param platformScript - Optional JS to inject into the inner iframe before the app loads\n */\nexport function generateSandboxProxyHtml(platformScript?: string): string {\n const escapedPlatformScript = platformScript ? JSON.stringify(platformScript) : 'null';\n // Default to dark — theme is propagated to the app via hostContext PostMessage,\n // not via the proxy HTML. Using dark avoids white flash on load.\n const colorScheme = 'dark';\n\n return `<!DOCTYPE html>\n<html style=\"color-scheme:${colorScheme}\">\n<head>\n<meta name=\"color-scheme\" content=\"${colorScheme}\" />\n<style>\nhtml, body { margin: 0; padding: 0; width: 100%; height: 100%; overflow: hidden; background: transparent; }\niframe { border: none; width: 100%; height: 100%; display: block; }\n</style>\n</head>\n<body>\n<script>\n(function() {\n var innerFrame = null;\n var innerWindow = null;\n var platformScript = ${escapedPlatformScript};\n\n // Relay messages between parent (host) and inner iframe (app)\n window.addEventListener('message', function(event) {\n var data = event.data;\n if (!data || typeof data !== 'object') return;\n\n if (event.source === window.parent) {\n // ── Messages from the host ──\n\n // sandbox-resource-ready: load HTML into inner iframe (scriptSrc/prod mode)\n if (data.method === 'ui/notifications/sandbox-resource-ready' && data.params) {\n createInnerFrame(data.params);\n return;\n }\n\n // sunpeak/sandbox-load-src: load URL into inner iframe (src/dev mode)\n if (data.method === 'sunpeak/sandbox-load-src' && data.params) {\n createInnerFrameWithSrc(data.params);\n return;\n }\n\n // Handle paint fence. Forward to the inner iframe and wait for its ack.\n // If the inner iframe has a fence responder (same-origin, script injected),\n // the ack is deterministic. Otherwise fall back to a 150ms timeout.\n if (data.method === 'sunpeak/fence' && data.params) {\n var fenceId = data.params.fenceId;\n var acked = false;\n var onAck = function(e) {\n if (e.source !== innerWindow) return;\n if (e.data && e.data.method === 'sunpeak/fence-ack' &&\n e.data.params && e.data.params.fenceId === fenceId) {\n acked = true;\n window.removeEventListener('message', onAck);\n window.parent.postMessage(e.data, '*');\n }\n };\n window.addEventListener('message', onAck);\n if (innerWindow) {\n try { innerWindow.postMessage(data, '*'); } catch(e) {}\n }\n setTimeout(function() {\n if (!acked) {\n window.removeEventListener('message', onAck);\n window.parent.postMessage({\n jsonrpc: '2.0',\n method: 'sunpeak/fence-ack',\n params: { fenceId: fenceId }\n }, '*');\n }\n }, 150);\n return;\n }\n\n // Sync color-scheme on the inner iframe element when theme changes.\n // This ensures prefers-color-scheme resolves correctly inside the app.\n // Important: do NOT set color-scheme on the proxy's own document —\n // changing it from the initial 'dark' causes Chrome to re-evaluate\n // the CSS Canvas as opaque white, blocking the host's conversation\n // background from showing through the transparent proxy.\n if (data.method === 'ui/notifications/host-context-changed' && data.params && data.params.theme) {\n if (innerFrame) innerFrame.style.colorScheme = data.params.theme;\n }\n\n // Forward all other messages to the inner iframe\n if (innerWindow) {\n try { innerWindow.postMessage(data, '*'); } catch(e) { /* detached */ }\n }\n } else if (innerWindow && event.source === innerWindow) {\n // ── Messages from the app → forward to host ──\n try { window.parent.postMessage(data, '*'); } catch(e) { /* detached */ }\n }\n });\n\n function createInnerFrame(params) {\n clearInterval(readyInterval);\n if (innerFrame) innerFrame.remove();\n\n innerFrame = document.createElement('iframe');\n innerFrame.sandbox = params.sandbox ||\n 'allow-scripts allow-same-origin allow-forms allow-popups allow-popups-to-escape-sandbox';\n if (params.allow) innerFrame.allow = params.allow;\n document.body.appendChild(innerFrame);\n innerWindow = innerFrame.contentWindow;\n\n // Write HTML content into the inner iframe\n var doc = innerFrame.contentDocument;\n if (doc && params.html) {\n doc.open();\n doc.write(params.html);\n doc.close();\n }\n }\n\n function createInnerFrameWithSrc(params) {\n clearInterval(readyInterval);\n if (innerFrame) innerFrame.remove();\n\n innerFrame = document.createElement('iframe');\n innerFrame.sandbox =\n 'allow-scripts allow-same-origin allow-forms allow-popups allow-popups-to-escape-sandbox';\n if (params.allow) innerFrame.allow = params.allow;\n innerFrame.src = params.src;\n innerFrame.style.height = '100%';\n\n // Set color-scheme on the inner iframe to match the host theme.\n // This ensures prefers-color-scheme resolves correctly inside.\n if (params.theme) {\n innerFrame.style.colorScheme = params.theme;\n }\n\n // After load, inject helpers into the inner iframe\n innerFrame.addEventListener('load', function() {\n innerWindow = innerFrame.contentWindow;\n\n // Inject platform runtime (e.g., mock window.openai for ChatGPT)\n if (platformScript && innerWindow) {\n try {\n var pScript = innerFrame.contentDocument.createElement('script');\n pScript.textContent = platformScript;\n innerFrame.contentDocument.head.appendChild(pScript);\n } catch(e) { /* cross-origin */ }\n }\n\n // Inject paint fence responder\n try {\n var fenceScript = innerFrame.contentDocument.createElement('script');\n fenceScript.setAttribute('data-sunpeak-fence', '');\n fenceScript.textContent = PAINT_FENCE_SCRIPT;\n innerFrame.contentDocument.head.appendChild(fenceScript);\n } catch(e) { /* cross-origin */ }\n\n // Inject background rule\n if (params.theme) {\n try {\n innerFrame.contentDocument.documentElement.style.colorScheme = params.theme;\n var bgStyle = innerFrame.contentDocument.createElement('style');\n bgStyle.setAttribute('data-sunpeak-bg', '');\n bgStyle.textContent = 'html { background-color: var(--color-background-primary, Canvas); }';\n innerFrame.contentDocument.head.appendChild(bgStyle);\n } catch(e) { /* cross-origin */ }\n }\n\n // Inject style variables for immediate rendering\n if (params.styleVars) {\n try {\n var root = innerFrame.contentDocument.documentElement;\n for (var key in params.styleVars) {\n if (params.styleVars[key]) root.style.setProperty(key, params.styleVars[key]);\n }\n } catch(e) { /* cross-origin */ }\n }\n\n // Signal that load is complete — fade in\n innerFrame.style.opacity = '1';\n innerFrame.style.transition = 'opacity 100ms';\n });\n\n // Start hidden for smooth fade-in\n innerFrame.style.opacity = '0';\n document.body.appendChild(innerFrame);\n innerWindow = innerFrame.contentWindow;\n }\n\n // Paint fence responder — same as in iframe-resource.ts\n var PAINT_FENCE_SCRIPT = 'window.addEventListener(\"message\",function(e){' +\n 'if(e.data&&e.data.method===\"sunpeak/fence\"){' +\n 'var fid=e.data.params&&e.data.params.fenceId;' +\n 'requestAnimationFrame(function(){' +\n 'e.source.postMessage({jsonrpc:\"2.0\",method:\"sunpeak/fence-ack\",params:{fenceId:fid}},\"*\");' +\n '});}});';\n\n // Signal to the host that the proxy is ready.\n // The srcdoc is parsed synchronously by the browser, which can race with\n // React's ref callback that sets up the PostMessage listener. To handle\n // this, we send the ready notification repeatedly until the host\n // acknowledges it (by sending content to load). The interval is cleared\n // as soon as we receive any message from the host (createInnerFrame or\n // createInnerFrameWithSrc), or after 10 seconds as a safety limit.\n var readyInterval = setInterval(function() {\n window.parent.postMessage({\n jsonrpc: '2.0',\n method: 'ui/notifications/sandbox-proxy-ready',\n params: {}\n }, '*');\n }, 200);\n // Send the first one immediately (next tick)\n setTimeout(function() {\n window.parent.postMessage({\n jsonrpc: '2.0',\n method: 'ui/notifications/sandbox-proxy-ready',\n params: {}\n }, '*');\n }, 0);\n // Stop retrying after 10 seconds — if the host hasn't responded by then,\n // something else is wrong.\n setTimeout(function() { clearInterval(readyInterval); }, 10000);\n})();\n</script>\n</body>\n</html>`;\n}\n\n/**\n * The mock OpenAI runtime script body for injection into the inner iframe.\n * Re-exported from mock-openai-runtime so the proxy can inject it.\n */\nexport { MOCK_OPENAI_RUNTIME_SCRIPT } from './mock-openai-runtime';\n","/**\n * Inline helper script injected into resource HTML alongside the paint-fence\n * and platform-runtime scripts. It performs the MCP Apps `ui/initialize`\n * handshake on behalf of the resource and exposes a friendly callback API\n * via `window.sunpeak.{onToolInput, onToolInputPartial, onToolResult,\n * onToolCancelled, onHostContextChange}`.\n *\n * This exists so embedders can ship plain HTML resources (e.g. a hardcoded\n * `<html>…</html>` string they pass via `app.resources[].html`) without\n * bundling the MCP Apps SDK. Without this helper, the host buffers tool\n * inputs and results forever — the SDK's initialize gate would never close.\n *\n * Opt-out: resource HTML that already uses the MCP Apps SDK can disable the\n * helper by including `<meta name=\"sunpeak-helper\" content=\"off\">` in its\n * `<head>`. Without the opt-out, the helper and the SDK both send\n * `ui/initialize` and the host bridge logs a (harmless) double-init warning.\n *\n * The helper is intentionally protocol-compatible: from the host's view it\n * looks like a regular MCP Apps client completing the handshake. The host\n * then unbuffers and delivers the queued notifications normally.\n */\n\n// Kept in sync with `LATEST_PROTOCOL_VERSION` in `@modelcontextprotocol/ext-apps`.\n// The drift guard in `sandbox-static.test.ts` doesn't cover this string, so\n// when bumping the ext-apps dependency, search for this constant.\nconst PROTOCOL_VERSION = '2026-01-26';\n\nexport const SUNPEAK_INLINE_HELPER_SCRIPT = `\n(function() {\n if (window.sunpeak) return; // already installed (e.g. parent hot-reload)\n // Opt-out: resource HTML using the real MCP Apps SDK can suppress the\n // helper to avoid sending two ui/initialize requests. Manual lowercase\n // comparison so content=\"off\" / \"OFF\" / \"Off\" all match (the Selectors\n // L4 case-insensitive flag isn't supported in all test environments).\n try {\n var metas = document.querySelectorAll('meta[name=\"sunpeak-helper\"]');\n for (var mi = 0; mi < metas.length; mi++) {\n var contentAttr = metas[mi].getAttribute('content');\n if (contentAttr && contentAttr.toLowerCase() === 'off') return;\n }\n } catch (e) { /* document not ready or querySelector missing */ }\n\n var listeners = {\n toolInput: [],\n toolInputPartial: [],\n toolResult: [],\n toolCancelled: [],\n hostContext: []\n };\n var last = {\n toolInput: undefined,\n toolInputPartial: undefined,\n toolResult: undefined,\n toolCancelled: undefined,\n hostContext: undefined\n };\n function dispatch(channel, value) {\n last[channel] = value;\n // Iterate over a SNAPSHOT — callbacks that unsubscribe themselves\n // mutate the live list, which would skip subsequent callbacks under a\n // for-by-index loop on the original array.\n var list = listeners[channel].slice();\n for (var i = 0; i < list.length; i++) {\n try { list[i](value); } catch (e) { console.error('[sunpeak] callback error:', e); }\n }\n }\n // Map channel names to the public method name for error messages.\n var channelMethodName = {\n toolInput: 'onToolInput',\n toolInputPartial: 'onToolInputPartial',\n toolResult: 'onToolResult',\n toolCancelled: 'onToolCancelled',\n hostContext: 'onHostContextChange'\n };\n function subscribe(channel) {\n return function(cb) {\n if (typeof cb !== 'function') {\n throw new TypeError('window.sunpeak.' + channelMethodName[channel] + ' expects a function');\n }\n listeners[channel].push(cb);\n if (last[channel] !== undefined) {\n try { cb(last[channel]); } catch (e) { console.error('[sunpeak] callback error:', e); }\n }\n return function unsubscribe() {\n var idx = listeners[channel].indexOf(cb);\n if (idx >= 0) listeners[channel].splice(idx, 1);\n };\n };\n }\n\n window.sunpeak = {\n onToolInput: subscribe('toolInput'),\n onToolInputPartial: subscribe('toolInputPartial'),\n onToolResult: subscribe('toolResult'),\n onToolCancelled: subscribe('toolCancelled'),\n onHostContextChange: subscribe('hostContext')\n };\n\n var nextId = 1;\n var pending = {};\n\n function sendRequest(method, params) {\n var id = nextId++;\n return new Promise(function(resolve, reject) {\n pending[id] = { resolve: resolve, reject: reject };\n try {\n window.parent.postMessage({ jsonrpc: '2.0', id: id, method: method, params: params }, '*');\n } catch (e) {\n delete pending[id];\n reject(e);\n }\n });\n }\n function sendNotification(method, params) {\n try {\n window.parent.postMessage({ jsonrpc: '2.0', method: method, params: params || {} }, '*');\n } catch (e) { /* parent detached */ }\n }\n\n window.addEventListener('message', function(ev) {\n // Only trust messages from the actual parent (the sandbox proxy).\n // Without this guard, a sibling iframe in the same browsing context or\n // a browser extension content script could forge JSON-RPC notifications\n // and drive the embedder's onToolResult/onToolInput callbacks with\n // attacker-controlled data.\n if (ev.source !== window.parent) return;\n var msg = ev.data;\n if (!msg || typeof msg !== 'object' || msg.jsonrpc !== '2.0') return;\n if (typeof msg.id !== 'undefined' && pending[msg.id]) {\n var p = pending[msg.id];\n delete pending[msg.id];\n if (msg.error) p.reject(new Error((msg.error && msg.error.message) || 'request error'));\n else p.resolve(msg.result);\n return;\n }\n if (msg.method === 'ui/notifications/tool-input') {\n dispatch('toolInput', (msg.params && msg.params.arguments) || {});\n } else if (msg.method === 'ui/notifications/tool-input-partial') {\n dispatch('toolInputPartial', (msg.params && msg.params.arguments) || {});\n } else if (msg.method === 'ui/notifications/tool-result') {\n // tool-result params are the CallToolResult directly per the spec.\n dispatch('toolResult', msg.params || {});\n } else if (msg.method === 'ui/notifications/tool-cancelled') {\n // Clear cached input / partial / result so a late onToolResult\n // subscriber doesn't get the cancelled-then-stale value replayed.\n // hostContext stays — the environment hasn't changed.\n last.toolInput = undefined;\n last.toolInputPartial = undefined;\n last.toolResult = undefined;\n dispatch('toolCancelled', msg.params || {});\n } else if (msg.method === 'ui/notifications/host-context-changed') {\n dispatch('hostContext', msg.params || {});\n }\n });\n\n sendRequest('ui/initialize', {\n appInfo: { name: 'sunpeak-inline-helper', version: '1.0.0' },\n appCapabilities: {},\n protocolVersion: '${PROTOCOL_VERSION}'\n }).then(function() {\n sendNotification('ui/notifications/initialized');\n }).catch(function(err) {\n console.warn('[sunpeak] ui/initialize failed:', err && err.message);\n });\n})();\n`.trim();\n","import * as React from 'react';\nimport { useEffect, useRef, useMemo, useCallback } from 'react';\nimport { McpAppHost, type McpAppHostOptions } from './mcp-app-host';\nimport { MOCK_OPENAI_RUNTIME_SCRIPT } from './mock-openai-runtime';\nimport { generateSandboxProxyHtml } from './sandbox-proxy';\nimport { SUNPEAK_INLINE_HELPER_SCRIPT } from './inline-helper-script';\nimport type { McpUiHostContext, McpUiResourcePermissions } from '@modelcontextprotocol/ext-apps';\nimport type { CallToolResult } from '@modelcontextprotocol/sdk/types.js';\n\n/**\n * Allowed origins for cross-origin script loading.\n * - Local development: localhost, 127.0.0.1, file://\n * - Production: sunpeak-prod-app-storage.s3.us-east-2.amazonaws.com (serves user scripts)\n */\nconst ALLOWED_SCRIPT_ORIGINS = [\n 'https://sunpeak-prod-app-storage.s3.us-east-2.amazonaws.com',\n 'http://localhost',\n 'https://localhost',\n 'http://127.0.0.1',\n 'https://127.0.0.1',\n];\n\n/**\n * Escapes HTML special characters to prevent XSS via attribute injection.\n */\nfunction escapeHtml(str: string): string {\n return str.replace(/[&<>\"']/g, (c) => {\n const entities: Record<string, string> = {\n '&': '&amp;',\n '<': '&lt;',\n '>': '&gt;',\n '\"': '&quot;',\n \"'\": '&#39;',\n };\n return entities[c] ?? c;\n });\n}\n\n/**\n * Returns true when the inspector itself is running on a loopback hostname.\n * Used to decide whether to honor `localhost`/`127.0.0.1` script URLs supplied\n * by the connected MCP server. When the inspector is hosted on a public domain,\n * a remote MCP server should not be able to coerce the inspector into loading\n * scripts from arbitrary services running on the visitor's machine\n * (e.g. http://127.0.0.1:11434/...).\n */\nfunction isInspectorOnLoopback(): boolean {\n if (typeof window === 'undefined') return true;\n const host = window.location.hostname;\n return host === 'localhost' || host === '127.0.0.1' || host === '[::1]' || host === '::1';\n}\n\n/**\n * Validates that a URL is from an allowed origin.\n * Allows same-origin URLs and URLs from whitelisted domains.\n */\nfunction isAllowedUrl(src: string): boolean {\n if (!src) return false;\n\n // Allow relative paths (same-origin) - must start with / but not //\n if (src.startsWith('/') && !src.startsWith('//')) return true;\n\n // Reject strings that don't look like URLs (no protocol)\n if (!src.includes('://')) return false;\n\n try {\n const url = new URL(src);\n\n // Allow same-origin\n if (url.origin === window.location.origin) return true;\n\n // Allow localhost with any port — but only when the inspector itself is\n // running on loopback. Otherwise a hosted inspector would happily load\n // scripts from the visitor's local machine.\n if ((url.hostname === 'localhost' || url.hostname === '127.0.0.1') && isInspectorOnLoopback()) {\n return true;\n }\n\n // Check against allowed origins (strict origin comparison only)\n return ALLOWED_SCRIPT_ORIGINS.some((allowed) => {\n try {\n return url.origin === new URL(allowed).origin;\n } catch {\n return false;\n }\n });\n } catch {\n return false;\n }\n}\n\n/**\n * Content Security Policy configuration for iframe resources.\n * Matches McpUiResourceCsp from the MCP Apps spec.\n */\nexport interface ResourceCSP {\n /** Domains allowed for fetch/XHR/WebSocket connections */\n connectDomains?: string[];\n /** Domains allowed for scripts, images, styles, fonts */\n resourceDomains?: string[];\n /** Domains allowed for nested iframes */\n frameDomains?: string[];\n /** Domains allowed for the base-uri directive */\n baseUriDomains?: string[];\n}\n\n/**\n * Extract CSP configuration from a resource's _meta.ui.csp field.\n */\nexport function extractResourceCSP(resource: { _meta?: unknown }): ResourceCSP | undefined {\n const meta = resource._meta as Record<string, unknown> | undefined;\n const ui = meta?.ui as { csp?: ResourceCSP } | undefined;\n return ui?.csp;\n}\n\n/**\n * Validates a CSP source entry is a safe origin URL (scheme + host + optional port).\n * Rejects wildcards, CSP keywords, and whitespace that could inject extra directives.\n */\nfunction isValidCspSource(source: string): boolean {\n // Block CSP keywords like 'unsafe-inline', wildcards like *, and whitespace injection\n if (!source || /[\\s;,']/.test(source) || source === '*') return false;\n try {\n const url = new URL(source);\n return (\n url.protocol === 'http:' ||\n url.protocol === 'https:' ||\n url.protocol === 'ws:' ||\n url.protocol === 'wss:'\n );\n } catch {\n return false;\n }\n}\n\n/**\n * Generates a Content Security Policy string.\n */\nfunction generateCSP(csp: ResourceCSP | undefined, scriptSrc: string): string {\n let scriptOrigin = '';\n try {\n scriptOrigin = new URL(scriptSrc, window.location.origin).origin;\n } catch {\n // Invalid URL, skip\n }\n\n // frame-src: default to 'none', but allow declared frame domains\n const frameSources = new Set<string>();\n if (csp?.frameDomains) {\n for (const domain of csp.frameDomains) {\n if (isValidCspSource(domain)) {\n frameSources.add(domain);\n } else {\n console.warn('[IframeResource] Ignoring invalid CSP frame domain:', domain);\n }\n }\n }\n const frameSrc =\n frameSources.size > 0 ? `frame-src ${Array.from(frameSources).join(' ')}` : \"frame-src 'none'\";\n\n // base-uri: default to 'self', but allow declared base-uri domains\n const baseSources = new Set<string>([\"'self'\"]);\n if (csp?.baseUriDomains) {\n for (const domain of csp.baseUriDomains) {\n if (isValidCspSource(domain)) {\n baseSources.add(domain);\n } else {\n console.warn('[IframeResource] Ignoring invalid CSP base-uri domain:', domain);\n }\n }\n }\n\n const directives: string[] = [\n \"default-src 'none'\",\n `script-src 'self' 'unsafe-inline' 'unsafe-eval' blob: ${scriptOrigin}`.trim(),\n `style-src 'self' 'unsafe-inline' ${scriptOrigin}`.trim(),\n frameSrc,\n \"object-src 'none'\",\n \"form-action 'none'\",\n `base-uri ${Array.from(baseSources).join(' ')}`,\n ];\n\n const connectSources = new Set<string>([\"'self'\"]);\n if (scriptOrigin) connectSources.add(scriptOrigin);\n if (csp?.connectDomains) {\n for (const domain of csp.connectDomains) {\n if (isValidCspSource(domain)) {\n connectSources.add(domain);\n } else {\n console.warn('[IframeResource] Ignoring invalid CSP connect domain:', domain);\n }\n }\n }\n directives.push(`connect-src ${Array.from(connectSources).join(' ')}`);\n\n const resourceSources = new Set<string>([\"'self'\", 'data:', 'blob:']);\n if (scriptOrigin) resourceSources.add(scriptOrigin);\n if (csp?.resourceDomains) {\n for (const domain of csp.resourceDomains) {\n if (isValidCspSource(domain)) {\n resourceSources.add(domain);\n } else {\n console.warn('[IframeResource] Ignoring invalid CSP resource domain:', domain);\n }\n }\n }\n const resourceList = Array.from(resourceSources).join(' ');\n directives.push(`img-src ${resourceList}`);\n directives.push(`font-src ${resourceList}`);\n directives.push(`media-src ${resourceList}`);\n\n return directives.join('; ');\n}\n\n/**\n * Paint fence responder script body.\n * Embedded in the generated HTML for scriptSrc mode. The sandbox proxy\n * handles fence injection for src-mode iframes.\n */\nconst PAINT_FENCE_SCRIPT = `window.addEventListener(\"message\",function(e){\nif(e.data&&e.data.method===\"sunpeak/fence\"){\nvar fid=e.data.params&&e.data.params.fenceId;\nrequestAnimationFrame(function(){\ne.source.postMessage({jsonrpc:\"2.0\",method:\"sunpeak/fence-ack\",params:{fenceId:fid}},\"*\");\n});}});`;\n\n/**\n * Inject the paint-fence responder and (optionally) a platform runtime script\n * into a user-provided HTML document. Used for the `html` prop mode where the\n * embedder hands us a complete document from `mcpClient.readResource(...)` and\n * we need to splice in the same infrastructure that the `scriptSrc` wrapper\n * provides. The injection is placed before `</head>` when present, falling\n * back to the start of `<body>` or the document start.\n */\nexport function injectInfraScripts(html: string, platformScript?: string): string {\n const fenceTag = `<script data-sunpeak-fence>${PAINT_FENCE_SCRIPT}</script>`;\n const platformTag = platformScript ? `<script>${platformScript}</script>` : '';\n // Inline MCP Apps SDK shim — completes the initialize handshake on behalf\n // of plain-HTML resources and exposes window.sunpeak.{onToolInput,\n // onToolResult, onHostContextChange}. The helper bails out if the real\n // SDK is already loaded.\n const helperTag = `<script data-sunpeak-helper>${SUNPEAK_INLINE_HELPER_SCRIPT}</script>`;\n const injection = `${platformTag}${fenceTag}${helperTag}`;\n // Tag matching is case-insensitive per the HTML spec. Most apps use the\n // lowercase form, but be tolerant of `</HEAD>` / `<BODY>` so an upstream\n // generator quirk doesn't silently skip the injection.\n const headMatch = html.match(/<\\/head\\s*>/i);\n if (headMatch) {\n return html.replace(headMatch[0], `${injection}${headMatch[0]}`);\n }\n const bodyMatch = html.match(/<body([^>]*)>/i);\n if (bodyMatch) {\n return html.replace(bodyMatch[0], `${bodyMatch[0]}${injection}`);\n }\n return injection + html;\n}\n\n/**\n * Generates HTML wrapper for a script URL.\n * The MCP Apps SDK in the loaded script handles communication via PostMessageTransport.\n */\nfunction generateScriptHtml(\n scriptSrc: string,\n theme: string,\n cspPolicy: string,\n platformScript?: string\n): string {\n const safeScriptSrc = escapeHtml(scriptSrc);\n const safeCsp = escapeHtml(cspPolicy);\n const safeTheme = escapeHtml(theme);\n // Platform runtime script (e.g. mock window.openai) runs before the app\n // script so that isChatGPT() and platform hooks work from first render.\n const platformTag = platformScript ? `\\n <script>${platformScript}</script>` : '';\n return `<!DOCTYPE html>\n<html lang=\"en\" data-theme=\"${safeTheme}\" style=\"color-scheme:${safeTheme};background:Canvas\">\n<head>\n <meta charset=\"UTF-8\" />\n <meta name=\"color-scheme\" content=\"${safeTheme}\" />\n <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\" />\n <meta http-equiv=\"Content-Security-Policy\" content=\"${safeCsp}\" />\n <title>Resource</title>\n <style>\n html {\n /* Use the MCP App background variable once JS sets it, otherwise\n Canvas (the system color that auto-adapts to color-scheme). */\n background-color: var(--color-background-primary, Canvas);\n }\n body, #root {\n margin: 0;\n padding: 0;\n width: 100%;\n background: transparent;\n }\n </style>\n <script>${PAINT_FENCE_SCRIPT}</script>${platformTag}\n</head>\n<body>\n <div id=\"root\"></div>\n <script src=\"${safeScriptSrc}\"></script>\n</body>\n</html>`;\n}\n\n/**\n * Build the iframe `allow` attribute from resource-declared permissions.\n * Maps McpUiResourcePermissions to Permission Policy directives and\n * combines them with inspector baseline permissions.\n */\nfunction buildIframeAllow(permissions: McpUiResourcePermissions | undefined): string {\n const parts: string[] = [\n 'local-network-access *', // Always needed for local dev server access\n ];\n\n // Map spec permissions to their Permission Policy names\n const permMap: [keyof McpUiResourcePermissions, string][] = [\n ['camera', 'camera'],\n ['microphone', 'microphone'],\n ['geolocation', 'geolocation'],\n ['clipboardWrite', 'clipboard-write'],\n ];\n\n for (const [key, directive] of permMap) {\n if (permissions?.[key]) {\n parts.push(directive);\n }\n }\n\n return parts.join('; ');\n}\n\ninterface IframeResourceProps {\n /**\n * URL to an HTML page to load directly in the iframe.\n * Used for dev mode where Vite serves the resource page.\n * Mutually exclusive with scriptSrc.\n */\n src?: string;\n /**\n * URL to a built resource to load in the iframe via srcdoc.\n * Used for production builds where we generate the HTML wrapper.\n * Mutually exclusive with src.\n */\n scriptSrc?: string;\n /**\n * Resource HTML to render directly — typically the string returned by\n * `mcpClient.readResource(...)`. The Inspector hands the HTML to the\n * sandbox proxy via PostMessage; the host page never hosts it at a URL.\n * The Inspector injects its paint-fence responder and (when enabled) the\n * platform runtime script before delivery.\n * Mutually exclusive with src and scriptSrc.\n */\n html?: string;\n /** Initial host context for the MCP Apps bridge */\n hostContext?: McpUiHostContext;\n /** Tool input arguments to send after connection */\n toolInput?: Record<string, unknown>;\n /** Partial/streaming tool input to send as a tool-input-partial notification */\n toolInputPartial?: Record<string, unknown>;\n /** Tool result to send after connection */\n toolResult?: CallToolResult;\n /** Optional callbacks for the MCP Apps host */\n hostOptions?: McpAppHostOptions;\n /** Optional CSP configuration (only used with scriptSrc) */\n csp?: ResourceCSP;\n /** Resource-declared sandbox permissions (camera, microphone, etc.) */\n permissions?: McpUiResourcePermissions;\n /** Whether the host should render a border around the resource */\n prefersBorder?: boolean;\n /** Optional className for the iframe container */\n className?: string;\n /** Optional style for the iframe */\n style?: React.CSSProperties;\n /**\n * Called after the iframe has rendered following a display mode change.\n * The callback receives the display mode that was confirmed.\n * Used by the inspector to hide content during transitions and only\n * reveal it once the app has committed its DOM for the new mode.\n */\n onDisplayModeReady?: (mode: string) => void;\n /**\n * Debug: State to inject directly into the app's useAppState hook.\n * This bypasses the normal MCP Apps protocol and is for inspector testing.\n */\n debugInjectState?: Record<string, unknown> | null;\n /**\n * Whether to inject a mock ChatGPT runtime (window.openai) into the iframe.\n * When true, ChatGPT-specific hooks (useUploadFile, useRequestModal, etc.)\n * and isChatGPT() will work inside the iframe.\n */\n injectOpenAIRuntime?: boolean;\n /**\n * Base URL of the separate-origin sandbox server (e.g., \"http://localhost:24680\").\n * When provided, the outer iframe loads from this server instead of using srcdoc,\n * giving real cross-origin isolation that matches production hosts like ChatGPT.\n * Falls back to srcdoc when not provided (unit tests, embedded usage).\n */\n sandboxUrl?: string;\n}\n\n/**\n * IframeResource renders MCP Apps in an iframe, communicating via the\n * MCP Apps protocol (PostMessageTransport + AppBridge).\n *\n * Supports two modes:\n * - `src`: Load an HTML page directly (dev mode with Vite HMR)\n * - `scriptSrc`: Generate HTML wrapper for a JS file (production builds)\n *\n * The loaded app uses the MCP Apps SDK's useApp() hook which automatically\n * connects via PostMessageTransport to window.parent. The parent side uses\n * McpAppHost (wrapping AppBridge) to communicate.\n */\nexport function IframeResource({\n src,\n scriptSrc,\n html,\n hostContext,\n toolInput,\n toolInputPartial,\n toolResult,\n hostOptions,\n csp,\n permissions,\n prefersBorder,\n className,\n style,\n onDisplayModeReady,\n debugInjectState,\n injectOpenAIRuntime,\n sandboxUrl,\n}: IframeResourceProps) {\n const iframeRef = useRef<HTMLIFrameElement>(null);\n const hostRef = useRef<McpAppHost | null>(null);\n\n // Determine which URL to validate (html mode has no URL — embedder supplies\n // the document body directly).\n const resourceUrl = src ?? scriptSrc;\n\n // Refs for resource data so the stable onSandboxReady callback can access current values\n // Refs for values that the stable onSandboxReady callback needs to access.\n // Without refs, the callback would capture stale values from the initial render.\n const srcRef = useRef(src);\n srcRef.current = src;\n const scriptSrcRef = useRef(scriptSrc);\n scriptSrcRef.current = scriptSrc;\n const htmlRef = useRef(html);\n htmlRef.current = html;\n const cspRef = useRef(csp);\n cspRef.current = csp;\n const hostContextRef = useRef(hostContext);\n hostContextRef.current = hostContext;\n const injectOpenAIRuntimeRef = useRef(injectOpenAIRuntime);\n injectOpenAIRuntimeRef.current = injectOpenAIRuntime;\n const permissionsRef = useRef(permissions);\n permissionsRef.current = permissions;\n\n // Track whether we've received an initial size report\n const hasReceivedSizeRef = useRef(false);\n\n // Track current display mode so the stable onSizeChanged callback can\n // skip auto-resizing in fullscreen (where the host container is fixed).\n const displayModeRef = useRef(hostContext?.displayMode);\n displayModeRef.current = hostContext?.displayMode;\n\n // Remember the last content-driven height so we can restore it when\n // leaving fullscreen (the app won't re-report until content changes).\n const lastContentHeightRef = useRef<number | null>(null);\n\n // Create the MCP Apps host\n const host = useMemo(\n () =>\n new McpAppHost({\n hostContext,\n ...hostOptions,\n onSizeChanged: (params) => {\n hostOptions?.onSizeChanged?.(params);\n if (params.height != null) {\n lastContentHeightRef.current = params.height;\n }\n // Skip auto-resizing in fullscreen mode where the host provides a\n // fixed container — auto-sizing would create a feedback loop with\n // viewport-relative units like dvh. PIP and inline use content-driven sizing.\n if (displayModeRef.current === 'fullscreen') return;\n const iframe = iframeRef.current;\n if (!iframe) return;\n\n // Border-box compensation: if the iframe has borders, add their\n // width/height so the content area matches the reported size.\n // Pattern from ext-apps basic-host reference implementation.\n const style = getComputedStyle(iframe);\n const isBorderBox = style.boxSizing === 'border-box';\n\n const from: Record<string, string> = {};\n const to: Record<string, string> = {};\n\n if (params.width != null) {\n let w = params.width;\n if (isBorderBox) {\n w += parseFloat(style.borderLeftWidth) + parseFloat(style.borderRightWidth);\n }\n // Use min-width with min() to allow responsive growing while\n // respecting the content's minimum width.\n from.minWidth = `${iframe.offsetWidth}px`;\n iframe.style.minWidth = `min(${w}px, 100%)`;\n to.minWidth = `min(${w}px, 100%)`;\n }\n if (params.height != null) {\n hasReceivedSizeRef.current = true;\n let h = params.height;\n if (isBorderBox) {\n h += parseFloat(style.borderTopWidth) + parseFloat(style.borderBottomWidth);\n }\n from.height = `${iframe.offsetHeight}px`;\n iframe.style.height = `${h}px`;\n to.height = `${h}px`;\n }\n\n // Smooth animated transition for size changes.\n if (Object.keys(from).length > 0) {\n iframe.animate([from, to], { duration: 300, easing: 'ease-out' });\n }\n },\n onDisplayModeReady: (mode) => onDisplayModeReady?.(mode),\n onSandboxReady: () => {\n // The sandbox proxy is ready. Deliver the app content.\n const currentSrc = srcRef.current;\n const currentScriptSrc = scriptSrcRef.current;\n const currentHtml = htmlRef.current;\n const currentHost = hostRef.current;\n if (!currentHost) return;\n\n if (currentHtml) {\n // html mode: the embedder handed us a complete HTML document\n // (typically from mcpClient.readResource). Inject the paint-fence\n // responder and (when enabled) the mock platform runtime, then\n // hand the document to the proxy via the existing\n // sandbox-resource-ready protocol.\n const platformScriptStr = injectOpenAIRuntimeRef.current\n ? MOCK_OPENAI_RUNTIME_SCRIPT\n : undefined;\n const finalHtml = injectInfraScripts(currentHtml, platformScriptStr);\n currentHost.sendSandboxResourceReady({\n html: finalHtml,\n sandbox:\n 'allow-scripts allow-same-origin allow-forms allow-popups allow-popups-to-escape-sandbox',\n });\n if (iframeRef.current) {\n iframeRef.current.style.opacity = '1';\n iframeRef.current.style.transition = 'opacity 100ms';\n }\n } else if (currentScriptSrc) {\n // scriptSrc mode (prod): use the official sandbox-resource-ready protocol.\n // Generate the full app HTML and send it to the proxy.\n const absoluteScriptSrc = currentScriptSrc.startsWith('/')\n ? `${window.location.origin}${currentScriptSrc}`\n : currentScriptSrc;\n const cspPolicy = generateCSP(cspRef.current, absoluteScriptSrc);\n const theme = hostContextRef.current?.theme ?? 'dark';\n const platformScriptStr = injectOpenAIRuntimeRef.current\n ? MOCK_OPENAI_RUNTIME_SCRIPT\n : undefined;\n const appHtml = generateScriptHtml(\n absoluteScriptSrc,\n theme,\n cspPolicy,\n platformScriptStr\n );\n\n currentHost.sendSandboxResourceReady({\n html: appHtml,\n sandbox:\n 'allow-scripts allow-same-origin allow-forms allow-popups allow-popups-to-escape-sandbox',\n });\n\n // Fade in the outer iframe\n if (iframeRef.current) {\n iframeRef.current.style.opacity = '1';\n iframeRef.current.style.transition = 'opacity 100ms';\n }\n } else if (currentSrc) {\n // src mode (dev): send the URL to the proxy for inner iframe src loading.\n // This is a inspector-specific extension — the proxy creates an inner iframe\n // with src pointing to the Vite dev server, preserving HMR.\n //\n // When using a separate-origin sandbox server, the src must be absolute\n // (relative paths would resolve against the sandbox origin, not the Vite server).\n const absoluteSrc = currentSrc.startsWith('/')\n ? `${window.location.origin}${currentSrc}`\n : currentSrc;\n const allowAttr = buildIframeAllow(permissionsRef.current);\n currentHost.sendRawMessage({\n jsonrpc: '2.0',\n method: 'sunpeak/sandbox-load-src',\n params: {\n src: absoluteSrc,\n allow: allowAttr,\n theme: hostContextRef.current?.theme,\n styleVars: hostContextRef.current?.styles?.variables,\n },\n });\n }\n },\n }),\n // eslint-disable-next-line react-hooks/exhaustive-deps\n [] // Stable - create once\n );\n hostRef.current = host;\n\n // Connect bridge transport as soon as the iframe element exists in the DOM,\n // before the browser loads the iframe content. For built HTML files with\n // inline scripts (same-origin), React effects inside the iframe can fire\n // before the parent's onLoad event, causing the app's `initialize` request\n // to be lost if the bridge transport isn't listening yet.\n const setIframeRef = useCallback(\n (node: HTMLIFrameElement | null) => {\n iframeRef.current = node;\n if (node?.contentWindow) {\n host.connectToIframe(node.contentWindow);\n }\n },\n [host]\n );\n\n // The outer iframe loads the sandbox proxy HTML. Show it immediately since\n // it's just the proxy shell. The proxy handles inner iframe creation and content.\n const handleLoad = useCallback(() => {\n if (iframeRef.current) {\n iframeRef.current.style.opacity = '1';\n iframeRef.current.style.transition = 'opacity 100ms';\n }\n }, []);\n\n // Sync mutable host options (e.g. onCallTool) into the existing host\n // instance when they change, without recreating the connection.\n useEffect(() => {\n if (hostOptions) {\n host.updateOptions(hostOptions);\n }\n }, [host, hostOptions]);\n\n // Update host context when props change.\n // McpAppHost.setHostContext() internally detects display mode changes\n // and waits for the iframe to commit its DOM before firing onDisplayModeReady.\n useEffect(() => {\n if (hostContext) {\n host.setHostContext(hostContext);\n }\n // In fullscreen the host provides a fixed container, so the iframe\n // should fill it. When leaving fullscreen, restore the last content-driven\n // height so the iframe isn't stuck at 100% or collapsed.\n if (iframeRef.current) {\n if (hostContext?.displayMode === 'fullscreen') {\n iframeRef.current.style.height = '100%';\n } else if (lastContentHeightRef.current != null) {\n iframeRef.current.style.height = `${lastContentHeightRef.current}px`;\n }\n }\n }, [host, hostContext]);\n\n // Send tool input updates\n // Note: Don't check host.initialized here - McpAppHost handles queueing internally\n useEffect(() => {\n if (toolInput) {\n host.sendToolInput(toolInput);\n }\n }, [host, toolInput]);\n\n // Send partial/streaming tool input\n useEffect(() => {\n if (toolInputPartial) {\n host.sendToolInputPartial(toolInputPartial);\n }\n }, [host, toolInputPartial]);\n\n // Send tool result updates\n // Note: Don't check host.initialized here - McpAppHost handles queueing internally\n useEffect(() => {\n if (toolResult) {\n host.sendToolResult(toolResult);\n }\n }, [host, toolResult]);\n\n // Debug: Inject state directly into app's useAppState hook\n useEffect(() => {\n if (debugInjectState != null) {\n host.injectState(debugInjectState);\n }\n }, [host, debugInjectState]);\n\n // Cleanup on unmount\n useEffect(() => {\n return () => {\n hostRef.current?.close();\n };\n }, []);\n\n // Validate URL\n const isValidUrl = useMemo(() => resourceUrl && isAllowedUrl(resourceUrl), [resourceUrl]);\n\n // Build iframe allow attribute from resource permissions\n const allowAttribute = useMemo(() => buildIframeAllow(permissions), [permissions]);\n\n // Border style when resource declares prefersBorder\n const borderStyle: React.CSSProperties = prefersBorder\n ? { border: '1px solid var(--color-border-primary, #e5e7eb)' }\n : { border: 'none' };\n\n // Build sandbox proxy content. When a separate-origin sandbox server is available,\n // use its URL for real cross-origin isolation (matching production hosts).\n // Otherwise fall back to srcdoc with the proxy HTML (for unit tests, embedded use).\n // Build sandbox proxy URL/HTML. These must NOT depend on theme — changing\n // theme should not reload the iframe (which would destroy app state and\n // show a loading flash). Theme is propagated to the app via hostContext\n // through PostMessage, not via iframe src/srcdoc.\n const sandboxSrc = useMemo(() => {\n if (!sandboxUrl) return undefined;\n // Two supported shapes for sandboxUrl:\n // 1. Host root, e.g. \"http://localhost:24680\" — append \"/proxy\" (the\n // CLI dev server convention from `startSandboxServer`).\n // 2. Full URL, e.g. \"https://sandbox.example.com/sandbox-proxy.html\"\n // — use as-is. Embedders hosting the static `dist/sandbox-proxy.html`\n // pass the file's full URL.\n // We treat anything with a path beyond \"/\" as a full URL.\n let url: URL;\n try {\n const parsed = new URL(sandboxUrl);\n const hasPath = parsed.pathname && parsed.pathname !== '/';\n url = hasPath ? parsed : new URL('/proxy', sandboxUrl);\n } catch {\n return undefined;\n }\n // Reject anything that isn't http(s). The URL constructor accepts\n // `javascript:` and `data:` schemes; while modern browsers block\n // `javascript:` in cross-origin iframe src, treating non-http(s) values\n // here as invalid matches the precedent set by the OAuth flow and the\n // mock `openExternal` runtime, and removes a class of footguns.\n if (url.protocol !== 'http:' && url.protocol !== 'https:') {\n console.warn('[IframeResource] Ignoring non-http(s) sandboxUrl:', sandboxUrl);\n return undefined;\n }\n if (injectOpenAIRuntime) url.searchParams.set('platform', 'chatgpt');\n return url.toString();\n }, [sandboxUrl, injectOpenAIRuntime]);\n\n const proxyHtml = useMemo(() => {\n if (sandboxSrc) return undefined;\n const platformScript = injectOpenAIRuntime ? MOCK_OPENAI_RUNTIME_SCRIPT : undefined;\n return generateSandboxProxyHtml(platformScript);\n }, [sandboxSrc, injectOpenAIRuntime]);\n\n const iframeStyle: React.CSSProperties = {\n ...borderStyle,\n background: 'transparent',\n colorScheme: hostContext?.theme === 'light' ? 'light dark' : 'dark light',\n // Start hidden; handleLoad fades in via direct DOM update\n opacity: 0,\n width: '100%',\n // In fullscreen, fill the container immediately. In other modes, use\n // minHeight to prevent collapse while waiting for the app to report size.\n ...(hostContext?.displayMode === 'fullscreen' ? { height: '100%' } : { minHeight: '200px' }),\n ...style,\n };\n\n // Apply containerDimensions constraints as a host-side wrapper so the app\n // reports its natural size via sizechange (no feedback loop) while the\n // inspector visually enforces the configured dimensions.\n //\n // height / maxHeight → clip the iframe vertically with overflow:hidden.\n // Using a wrapper (not SafeArea inside the app) is intentional: if the\n // app were to apply the height constraint internally, sizechange would\n // echo the constrained value back and the host would lock in that size.\n // width / maxWidth → constrain the wrapper's width; the iframe fills 100%.\n //\n // The wrapper div is always rendered (never conditional) so that adding or\n // removing constraints is a style update, not a tree change. Conditionally\n // toggling the wrapper would unmount/remount the iframe mid-handshake,\n // which causes the tool result to never reach the app.\n const dims = hostContext?.containerDimensions;\n const isFullscreenMode = hostContext?.displayMode === 'fullscreen';\n const wrapperStyle: React.CSSProperties = {};\n if (dims && !isFullscreenMode) {\n const h = 'height' in dims ? dims.height : undefined;\n const mh = 'maxHeight' in dims ? dims.maxHeight : undefined;\n const w = 'width' in dims ? dims.width : undefined;\n const mw = 'maxWidth' in dims ? dims.maxWidth : undefined;\n if (h != null) {\n wrapperStyle.height = h;\n wrapperStyle.overflow = 'hidden';\n }\n if (mh != null) {\n wrapperStyle.maxHeight = mh;\n wrapperStyle.overflow = 'hidden';\n }\n if (w != null) wrapperStyle.width = w;\n if (mw != null) wrapperStyle.maxWidth = mw;\n }\n\n // Validate URL for src mode\n if (src && !isValidUrl) {\n console.error('[IframeResource] URL not allowed:', src);\n return <div style={{ color: 'red', padding: 20 }}>Error: URL not allowed: {src}</div>;\n }\n if (scriptSrc && !isValidUrl) {\n console.error('[IframeResource] Script source not allowed:', scriptSrc);\n return <div style={{ color: 'red', padding: 20 }}>Error: Script source not allowed.</div>;\n }\n\n // Both src and scriptSrc modes use the sandbox proxy. The proxy creates\n // the inner iframe after receiving content via onSandboxReady.\n return (\n <div className={className} style={wrapperStyle}>\n <iframe\n ref={setIframeRef}\n onLoad={handleLoad}\n style={iframeStyle}\n title=\"Resource Preview\"\n sandbox=\"allow-scripts allow-same-origin allow-forms allow-popups allow-popups-to-escape-sandbox\"\n allow={allowAttribute}\n src={sandboxSrc ?? undefined}\n srcDoc={sandboxSrc ? undefined : proxyHtml}\n />\n </div>\n );\n}\n\n// Export security helpers for testing\nexport const _testExports = {\n escapeHtml,\n isAllowedUrl,\n isValidCspSource,\n generateCSP,\n generateScriptHtml,\n buildIframeAllow,\n ALLOWED_SCRIPT_ORIGINS,\n};\n","import { useCallback, useEffect, useMemo, useRef, useState } from 'react';\nimport type {\n McpUiHostContext,\n McpUiDisplayMode,\n McpUiTheme,\n McpUiResourcePermissions,\n} from '@modelcontextprotocol/ext-apps';\nimport type { CallToolResult } from '@modelcontextprotocol/sdk/types.js';\nimport type { Simulation } from '../types/simulation';\nimport type { ScreenWidth } from './inspector-types';\nimport type { HostId } from './hosts';\nimport { getHostShell } from './hosts';\nimport { extractResourceCSP, type ResourceCSP } from './iframe-resource';\n\ntype Platform = NonNullable<McpUiHostContext['platform']>;\n\nconst DEFAULT_THEME: McpUiTheme = 'dark';\nconst DEFAULT_DISPLAY_MODE: McpUiDisplayMode = 'inline';\nconst DEFAULT_PLATFORM: Platform = 'desktop';\n\nexport interface UseInspectorStateOptions {\n simulations: Record<string, Simulation>;\n defaultHost?: HostId;\n}\n\nexport interface InspectorState {\n // ── Simulation selection ──\n simulationNames: string[];\n selectedSimulationName: string;\n setSelectedSimulationName: (name: string) => void;\n selectedSim: Simulation | undefined;\n\n // ── Host selection ──\n activeHost: HostId;\n setActiveHost: (host: HostId) => void;\n\n // ── Screen width ──\n screenWidth: ScreenWidth;\n setScreenWidth: (width: ScreenWidth) => void;\n\n // ── Host context ──\n theme: McpUiTheme;\n setTheme: (theme: McpUiTheme) => void;\n displayMode: McpUiDisplayMode;\n setDisplayMode: (mode: McpUiDisplayMode) => void;\n locale: string;\n setLocale: (locale: string) => void;\n containerHeight: number | undefined;\n setContainerHeight: (height: number | undefined) => void;\n containerWidth: number | undefined;\n setContainerWidth: (width: number | undefined) => void;\n containerMaxHeight: number | undefined;\n setContainerMaxHeight: (height: number | undefined) => void;\n containerMaxWidth: number | undefined;\n setContainerMaxWidth: (width: number | undefined) => void;\n platform: Platform;\n setPlatform: (platform: Platform) => void;\n hover: boolean;\n setHover: (hover: boolean) => void;\n touch: boolean;\n setTouch: (touch: boolean) => void;\n safeAreaInsets: { top: number; bottom: number; left: number; right: number };\n setSafeAreaInsets: React.Dispatch<\n React.SetStateAction<{ top: number; bottom: number; left: number; right: number }>\n >;\n timeZone: string;\n setTimeZone: (tz: string) => void;\n // ── Computed host context ──\n hostContext: McpUiHostContext;\n\n // ── Display mode ready callback (for IframeResource paint fence) ──\n handleDisplayModeReady: (mode: string) => void;\n\n // ── Tool data ──\n toolInput: Record<string, unknown>;\n setToolInput: (input: Record<string, unknown>) => void;\n toolResult: CallToolResult | undefined;\n setToolResult: (result: CallToolResult | undefined) => void;\n effectiveToolResult: CallToolResult | undefined;\n\n // ── Model context ──\n modelContext: Record<string, unknown> | null;\n setModelContext: (ctx: Record<string, unknown> | null) => void;\n\n // ── JSON editing state (for sidebar) ──\n toolInputJson: string;\n setToolInputJson: (json: string) => void;\n toolInputError: string;\n setToolInputError: (error: string) => void;\n toolResultJson: string;\n setToolResultJson: (json: string) => void;\n toolResultError: string;\n setToolResultError: (error: string) => void;\n modelContextJson: string;\n setModelContextJson: (json: string) => void;\n modelContextError: string;\n setModelContextError: (error: string) => void;\n editingField: string | null;\n setEditingField: (field: string | null) => void;\n\n // ── JSON helpers ──\n validateJSON: (\n json: string,\n setJson: (value: string) => void,\n setError: (error: string) => void\n ) => void;\n commitJSON: (\n json: string,\n setError: (error: string) => void,\n updateFn: (value: Record<string, unknown> | null) => void\n ) => void;\n\n // ── Content width (from conversation ResizeObserver) ──\n measuredContentWidth: number | undefined;\n handleContentWidthChange: (width: number) => void;\n\n // ── Host callbacks ──\n handleDisplayModeChange: (mode: McpUiDisplayMode) => void;\n handleUpdateModelContext: (content: unknown[], structuredContent?: unknown) => void;\n\n // ── Content props (for IframeResource) ──\n resourceUrl: string | undefined;\n resourceScript: string | undefined;\n resourceHtml: string | undefined;\n csp: ResourceCSP | undefined;\n permissions: McpUiResourcePermissions | undefined;\n prefersBorder: boolean;\n // ── URL param overrides ──\n urlTool: string | undefined;\n urlProdResources: boolean | undefined;\n urlSidebar: boolean | undefined;\n urlDevOverlay: boolean | undefined;\n}\n\n/**\n * Parse URL params for initial inspector values.\n * Supported params:\n * - simulation: simulation name (e.g., 'show-albums')\n * - theme: 'light' | 'dark'\n * - displayMode: 'inline' | 'pip' | 'fullscreen'\n * - locale: e.g., 'en-US'\n * - maxHeight: number (containerDimensions.maxHeight)\n * - maxWidth: number (containerDimensions.maxWidth)\n * - deviceType: 'mobile' | 'tablet' | 'desktop' → maps to platform\n * - hover: 'true' | 'false'\n * - touch: 'true' | 'false'\n * - safeAreaTop, safeAreaBottom, safeAreaLeft, safeAreaRight: number\n * - host: 'chatgpt' | 'claude'\n * - tool: tool name (e.g., 'show-albums') — selects tool without mock data\n * - toolInput: JSON-encoded tool arguments (overrides simulation fixture data)\n * - autoRun: 'true' — call the tool on load when no fixture data exists (set by test fixtures)\n * - prodResources: 'true' | 'false'\n */\nfunction parseUrlParams(): {\n simulation?: string;\n tool?: string;\n toolInput?: Record<string, unknown>;\n theme?: McpUiTheme;\n displayMode?: McpUiDisplayMode;\n locale?: string;\n containerMaxHeight?: number;\n containerMaxWidth?: number;\n platform?: Platform;\n deviceCapabilities?: { hover?: boolean; touch?: boolean };\n safeAreaInsets?: { top: number; bottom: number; left: number; right: number };\n host?: HostId;\n prodResources?: boolean;\n sidebar?: boolean;\n devOverlay?: boolean;\n autoRun?: boolean;\n} {\n if (typeof window === 'undefined') return {};\n\n const params = new URLSearchParams(window.location.search);\n\n const simulation = params.get('simulation') ?? undefined;\n const tool = params.get('tool') ?? undefined;\n const toolInputParam = params.get('toolInput');\n let toolInput: Record<string, unknown> | undefined;\n if (toolInputParam) {\n try {\n toolInput = JSON.parse(toolInputParam);\n } catch {\n // Invalid JSON — ignore, simulation data will be used instead\n }\n }\n const themeRaw = params.get('theme');\n const theme: McpUiTheme | null =\n themeRaw && VALID_THEMES.has(themeRaw as McpUiTheme) ? (themeRaw as McpUiTheme) : null;\n const displayModeRaw = params.get('displayMode');\n const displayMode: McpUiDisplayMode | null =\n displayModeRaw && VALID_DISPLAY_MODES.has(displayModeRaw as McpUiDisplayMode)\n ? (displayModeRaw as McpUiDisplayMode)\n : null;\n const locale = params.get('locale');\n const maxHeightParam = params.get('maxHeight');\n const containerMaxHeight = maxHeightParam ? Number(maxHeightParam) : undefined;\n const maxWidthParam = params.get('maxWidth');\n const containerMaxWidth = maxWidthParam ? Number(maxWidthParam) : undefined;\n const host = (params.get('host') as HostId) ?? undefined;\n\n const prodResourcesParam = params.get('prodResources');\n const prodResources =\n prodResourcesParam === 'true' ? true : prodResourcesParam === 'false' ? false : undefined;\n\n const sidebarParam = params.get('sidebar');\n const sidebar = sidebarParam === 'false' ? false : sidebarParam === 'true' ? true : undefined;\n\n const devOverlayParam = params.get('devOverlay');\n const devOverlay =\n devOverlayParam === 'false' ? false : devOverlayParam === 'true' ? true : undefined;\n\n // Map deviceType param to MCP Apps platform\n const deviceType = params.get('deviceType');\n let platform: Platform | undefined;\n if (deviceType === 'mobile' || deviceType === 'tablet') {\n platform = 'mobile';\n } else if (deviceType === 'desktop') {\n platform = 'desktop';\n }\n\n // Device capabilities\n const hoverParam = params.get('hover');\n const touchParam = params.get('touch');\n const hasCapParams = hoverParam || touchParam;\n const deviceCapabilities = hasCapParams\n ? {\n hover: hoverParam === 'false' ? false : true,\n touch: touchParam === 'true' ? true : false,\n }\n : undefined;\n\n // Safe area insets\n const safeAreaTop = params.get('safeAreaTop');\n const safeAreaBottom = params.get('safeAreaBottom');\n const safeAreaLeft = params.get('safeAreaLeft');\n const safeAreaRight = params.get('safeAreaRight');\n const hasSafeAreaParams = safeAreaTop || safeAreaBottom || safeAreaLeft || safeAreaRight;\n const safeAreaInsets = hasSafeAreaParams\n ? {\n top: safeAreaTop ? Number(safeAreaTop) : 0,\n bottom: safeAreaBottom ? Number(safeAreaBottom) : 0,\n left: safeAreaLeft ? Number(safeAreaLeft) : 0,\n right: safeAreaRight ? Number(safeAreaRight) : 0,\n }\n : undefined;\n\n const autoRun = params.get('autoRun') === 'true' ? true : undefined;\n\n return {\n simulation,\n tool,\n toolInput,\n theme: theme ?? undefined,\n displayMode: displayMode ?? undefined,\n locale: locale ?? undefined,\n containerMaxHeight,\n containerMaxWidth,\n platform,\n deviceCapabilities,\n safeAreaInsets,\n host: host ?? undefined,\n prodResources,\n sidebar,\n devOverlay,\n autoRun,\n };\n}\n\nconst PREFS_KEY = 'sunpeak-inspector-prefs';\n\ninterface StoredPrefs {\n theme?: McpUiTheme;\n locale?: string;\n displayMode?: McpUiDisplayMode;\n containerMaxHeight?: number;\n containerMaxWidth?: number;\n safeAreaInsets?: { top: number; bottom: number; left: number; right: number };\n activeHost?: HostId;\n platform?: Platform;\n hover?: boolean;\n touch?: boolean;\n screenWidth?: ScreenWidth;\n}\n\nconst VALID_THEMES: ReadonlySet<McpUiTheme> = new Set(['light', 'dark']);\nconst VALID_DISPLAY_MODES: ReadonlySet<McpUiDisplayMode> = new Set(['inline', 'pip', 'fullscreen']);\nconst VALID_PLATFORMS: ReadonlySet<Platform> = new Set(['web', 'desktop', 'mobile']);\nconst VALID_SCREEN_WIDTHS: ReadonlySet<ScreenWidth> = new Set([\n 'mobile-s',\n 'mobile-l',\n 'tablet',\n 'full',\n]);\n\n// Validate the parsed JSON one field at a time so a corrupt or stale entry\n// (older sunpeak version, manual edit) can't seed bad values into state.\nfunction sanitizeStoredPrefs(raw: unknown): StoredPrefs {\n if (!raw || typeof raw !== 'object') return {};\n const obj = raw as Record<string, unknown>;\n const prefs: StoredPrefs = {};\n\n if (typeof obj.theme === 'string' && VALID_THEMES.has(obj.theme as McpUiTheme)) {\n prefs.theme = obj.theme as McpUiTheme;\n }\n if (typeof obj.locale === 'string') {\n prefs.locale = obj.locale;\n }\n if (\n typeof obj.displayMode === 'string' &&\n VALID_DISPLAY_MODES.has(obj.displayMode as McpUiDisplayMode)\n ) {\n prefs.displayMode = obj.displayMode as McpUiDisplayMode;\n }\n if (typeof obj.containerMaxHeight === 'number' && Number.isFinite(obj.containerMaxHeight)) {\n prefs.containerMaxHeight = obj.containerMaxHeight;\n }\n if (typeof obj.containerMaxWidth === 'number' && Number.isFinite(obj.containerMaxWidth)) {\n prefs.containerMaxWidth = obj.containerMaxWidth;\n }\n if (obj.safeAreaInsets && typeof obj.safeAreaInsets === 'object') {\n const insets = obj.safeAreaInsets as Record<string, unknown>;\n if (\n typeof insets.top === 'number' &&\n typeof insets.bottom === 'number' &&\n typeof insets.left === 'number' &&\n typeof insets.right === 'number'\n ) {\n prefs.safeAreaInsets = {\n top: insets.top,\n bottom: insets.bottom,\n left: insets.left,\n right: insets.right,\n };\n }\n }\n if (typeof obj.activeHost === 'string') {\n prefs.activeHost = obj.activeHost;\n }\n if (typeof obj.platform === 'string' && VALID_PLATFORMS.has(obj.platform as Platform)) {\n prefs.platform = obj.platform as Platform;\n }\n if (typeof obj.hover === 'boolean') prefs.hover = obj.hover;\n if (typeof obj.touch === 'boolean') prefs.touch = obj.touch;\n if (\n typeof obj.screenWidth === 'string' &&\n VALID_SCREEN_WIDTHS.has(obj.screenWidth as ScreenWidth)\n ) {\n prefs.screenWidth = obj.screenWidth as ScreenWidth;\n }\n\n return prefs;\n}\n\nfunction readStoredPrefs(): StoredPrefs {\n if (typeof window === 'undefined') return {};\n try {\n const raw = localStorage.getItem(PREFS_KEY);\n if (!raw) return {};\n return sanitizeStoredPrefs(JSON.parse(raw));\n } catch {\n return {};\n }\n}\n\nexport function useInspectorState({\n simulations,\n defaultHost = 'chatgpt',\n}: UseInspectorStateOptions): InspectorState {\n // Only list simulations with a UI resource — backend-only tools have nothing to render.\n const simulationNames = Object.keys(simulations)\n .filter((name) => simulations[name].resource)\n .sort((a, b) => {\n const simA = simulations[a];\n const simB = simulations[b];\n const resourceLabelA = (simA.resource!.title as string) || simA.resource!.name;\n const resourceLabelB = (simB.resource!.title as string) || simB.resource!.name;\n const labelA = `${resourceLabelA}: ${(simA.tool.title as string) || simA.tool.name}`;\n const labelB = `${resourceLabelB}: ${(simB.tool.title as string) || simB.tool.name}`;\n return labelA.localeCompare(labelB);\n });\n const urlParams = useMemo(() => parseUrlParams(), []);\n const autoRun = urlParams.autoRun === true;\n const storedPrefs = useMemo(() => (autoRun ? {} : readStoredPrefs()), [autoRun]);\n const [screenWidth, setScreenWidth] = useState<ScreenWidth>(storedPrefs.screenWidth ?? 'full');\n\n const isMobileWidth = (width: ScreenWidth) => width === 'mobile-s' || width === 'mobile-l';\n\n // ── Host selection ──\n const [activeHost, setActiveHost] = useState<HostId>(\n urlParams.host ?? storedPrefs.activeHost ?? defaultHost\n );\n\n // ── Simulation selection ──\n const initialSimulationName = useMemo(() => {\n const defaultName = simulationNames[0] ?? '';\n if (!urlParams.simulation) return defaultName;\n return urlParams.simulation in simulations ? urlParams.simulation : defaultName;\n }, [urlParams.simulation, simulations, simulationNames]);\n\n const [selectedSimulationName, setSelectedSimulationName] =\n useState<string>(initialSimulationName);\n\n const selectedSim = simulations[selectedSimulationName];\n\n // ── Host context state ──\n\n const [theme, setTheme] = useState<McpUiTheme>(\n urlParams.theme ?? storedPrefs.theme ?? DEFAULT_THEME\n );\n const [displayMode, _setDisplayMode] = useState<McpUiDisplayMode>(\n urlParams.displayMode ?? storedPrefs.displayMode ?? DEFAULT_DISPLAY_MODE\n );\n const [locale, setLocale] = useState(urlParams.locale ?? storedPrefs.locale ?? 'en-US');\n const [containerHeight, setContainerHeight] = useState<number | undefined>(undefined);\n const [containerWidth, setContainerWidth] = useState<number | undefined>(undefined);\n const [containerMaxHeight, setContainerMaxHeight] = useState<number | undefined>(\n urlParams.containerMaxHeight ?? storedPrefs.containerMaxHeight\n );\n const [containerMaxWidth, setContainerMaxWidth] = useState<number | undefined>(\n urlParams.containerMaxWidth ?? storedPrefs.containerMaxWidth\n );\n const [platform, setPlatform] = useState<Platform>(\n urlParams.platform ?? storedPrefs.platform ?? DEFAULT_PLATFORM\n );\n const [hover, setHover] = useState(\n urlParams.deviceCapabilities?.hover ?? storedPrefs.hover ?? true\n );\n const [touch, setTouch] = useState(\n urlParams.deviceCapabilities?.touch ?? storedPrefs.touch ?? false\n );\n const [safeAreaInsets, setSafeAreaInsets] = useState(\n urlParams.safeAreaInsets ??\n storedPrefs.safeAreaInsets ?? { top: 0, bottom: 0, left: 0, right: 0 }\n );\n const [timeZone, setTimeZone] = useState(() => Intl.DateTimeFormat().resolvedOptions().timeZone);\n\n // Skip persisting on the first render — only write when the user actually changes something.\n const isFirstRender = useRef(true);\n useEffect(() => {\n if (isFirstRender.current) {\n isFirstRender.current = false;\n return;\n }\n if (autoRun) return;\n try {\n const prefs: StoredPrefs = {\n theme,\n locale,\n displayMode,\n containerMaxHeight,\n containerMaxWidth,\n safeAreaInsets,\n activeHost,\n platform,\n hover,\n touch,\n screenWidth,\n };\n localStorage.setItem(PREFS_KEY, JSON.stringify(prefs));\n } catch {\n // localStorage may be unavailable (private browsing, storage quota) — ignore\n }\n }, [\n autoRun,\n theme,\n locale,\n displayMode,\n containerMaxHeight,\n containerMaxWidth,\n safeAreaInsets,\n activeHost,\n platform,\n hover,\n touch,\n screenWidth,\n ]);\n\n // Content width measured from the conversation component's ResizeObserver.\n // Used as containerDimensions.maxWidth unless the user manually sets one.\n const [measuredContentWidth, setMeasuredContentWidth] = useState<number | undefined>(undefined);\n const handleContentWidthChange = useCallback((width: number) => {\n setMeasuredContentWidth(width);\n }, []);\n\n // Display mode setter that respects mobile width constraints\n const setDisplayMode = (mode: McpUiDisplayMode) => {\n if (isMobileWidth(screenWidth) && mode === 'pip') {\n _setDisplayMode('fullscreen');\n } else {\n _setDisplayMode(mode);\n }\n };\n\n // Callback for IframeResource's onDisplayModeReady (paint fence ack).\n // Currently a no-op — the inspector doesn't need to track the confirmed\n // display mode. Kept as a stable reference to avoid unnecessary re-renders.\n const handleDisplayModeReady = useCallback((_mode: string) => {}, []);\n\n // Build containerDimensions based on the current display mode.\n // Real hosts (ChatGPT) report different shapes per mode:\n // inline: { height: <content height>, maxWidth: <column width> }\n // fullscreen: { height: <viewport height>, width: <viewport width> }\n // pip: { height: <pip height>, maxWidth: <pip max width> }\n //\n // User-set sidebar values always take priority. When not set, we derive\n // values from the measured content width (ResizeObserver) and the\n // browser viewport for fullscreen mode.\n const containerDimensions = useMemo(() => {\n // User-set values always take priority\n if (\n containerHeight != null ||\n containerWidth != null ||\n containerMaxHeight != null ||\n containerMaxWidth != null\n ) {\n return {\n ...(containerHeight != null ? { height: containerHeight } : {}),\n ...(containerWidth != null ? { width: containerWidth } : {}),\n ...(containerMaxHeight != null ? { maxHeight: containerMaxHeight } : {}),\n ...(containerMaxWidth != null ? { maxWidth: containerMaxWidth } : {}),\n };\n }\n\n // Auto-derived dimensions based on display mode\n if (displayMode === 'fullscreen') {\n // Fullscreen: report actual viewport dimensions (width + height, no maxWidth).\n // Use window.innerHeight minus the fullscreen chrome header (52px).\n const h = typeof window !== 'undefined' ? window.innerHeight - 52 : 800;\n const w = measuredContentWidth ?? (typeof window !== 'undefined' ? window.innerWidth : 1280);\n return { height: h, width: w };\n }\n\n if (displayMode === 'pip') {\n // PiP: report maxHeight (not fixed height) — content determines actual height.\n // ChatGPT uses calc(50dvh - 38px): half the viewport minus chrome.\n // Confirmed by extraction at 7 viewport sizes (2026-03-21).\n const viewportH = typeof window !== 'undefined' ? window.innerHeight : 800;\n const pipMaxHeight = Math.round(viewportH * 0.5 - 38);\n return {\n maxHeight: pipMaxHeight,\n ...(measuredContentWidth != null ? { maxWidth: measuredContentWidth } : {}),\n };\n }\n\n // Inline: report maxWidth from the measured content container.\n if (measuredContentWidth != null) {\n return { maxWidth: measuredContentWidth };\n }\n\n return undefined;\n }, [\n containerHeight,\n containerWidth,\n containerMaxHeight,\n containerMaxWidth,\n measuredContentWidth,\n displayMode,\n ]);\n\n const hostContext = useMemo<McpUiHostContext>(\n () => ({\n theme,\n displayMode,\n availableDisplayModes: ['inline', 'pip', 'fullscreen'],\n locale,\n timeZone,\n platform,\n deviceCapabilities: { hover, touch },\n safeAreaInsets,\n ...(containerDimensions ? { containerDimensions } : {}),\n }),\n [\n theme,\n displayMode,\n locale,\n timeZone,\n platform,\n hover,\n touch,\n safeAreaInsets,\n containerDimensions,\n ]\n );\n\n // ── Tool data state ──\n\n const [toolInput, setToolInput] = useState<Record<string, unknown>>(\n () => urlParams.toolInput ?? selectedSim?.toolInput ?? {}\n );\n const [toolResult, setToolResult] = useState<CallToolResult | undefined>(\n () => selectedSim?.toolResult as CallToolResult | undefined\n );\n\n // Editable JSON strings for sidebar\n const [toolInputJson, setToolInputJson] = useState(() => JSON.stringify(toolInput, null, 2));\n const [toolResultJson, setToolResultJson] = useState(() =>\n JSON.stringify(toolResult ?? null, null, 2)\n );\n\n // Model context\n const [modelContextJson, setModelContextJson] = useState<string>('null');\n const [modelContext, setModelContext] = useState<Record<string, unknown> | null>(null);\n\n // Track which field is being edited\n const [editingField, setEditingField] = useState<string | null>(null);\n\n // JSON validation errors\n const [toolInputError, setToolInputError] = useState('');\n const [toolResultError, setToolResultError] = useState('');\n const [modelContextError, setModelContextError] = useState('');\n\n // Reset tool data when simulation changes. URL-provided toolInput takes\n // precedence over the simulation fixture data, allowing tests to pass\n // dynamic arguments to the server.\n useEffect(() => {\n const newInput = urlParams.toolInput ?? selectedSim?.toolInput ?? {};\n const newResult = (selectedSim?.toolResult as CallToolResult | undefined) ?? undefined;\n setToolInput(newInput);\n setToolResult(newResult);\n if (editingField !== 'toolInput') {\n setToolInputJson(JSON.stringify(newInput, null, 2));\n setToolInputError('');\n }\n if (editingField !== 'toolResult') {\n setToolResultJson(JSON.stringify(newResult ?? null, null, 2));\n setToolResultError('');\n }\n if (editingField !== 'modelContext') {\n setModelContextJson('null');\n setModelContext(null);\n setModelContextError('');\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [selectedSimulationName, selectedSim]);\n\n // Disallow PiP on mobile widths\n useEffect(() => {\n if (isMobileWidth(screenWidth) && displayMode === 'pip') {\n _setDisplayMode('fullscreen');\n }\n }, [screenWidth, displayMode]);\n\n // Auto-apply safe area insets when display mode or host changes\n useEffect(() => {\n const shell = getHostShell(activeHost);\n const modeInsets = shell?.safeAreaByDisplayMode?.[displayMode];\n if (modeInsets) {\n setSafeAreaInsets({\n top: modeInsets.top ?? 0,\n bottom: modeInsets.bottom ?? 0,\n left: modeInsets.left ?? 0,\n right: modeInsets.right ?? 0,\n });\n }\n }, [displayMode, activeHost]);\n\n // ── Host callbacks ──\n\n const handleDisplayModeChange = (mode: McpUiDisplayMode) => {\n setDisplayMode(mode);\n };\n\n const handleUpdateModelContext = (content: unknown[], structuredContent?: unknown) => {\n setModelContextJson(JSON.stringify(structuredContent ?? content, null, 2));\n };\n\n // ── JSON helpers ──\n\n const validateJSON = (\n json: string,\n setJson: (value: string) => void,\n setError: (error: string) => void\n ) => {\n setJson(json);\n try {\n if (json.trim() !== '') JSON.parse(json);\n setError('');\n } catch (e) {\n setError(e instanceof Error ? e.message : 'Invalid JSON');\n }\n };\n\n const commitJSON = (\n json: string,\n setError: (error: string) => void,\n updateFn: (value: Record<string, unknown> | null) => void\n ) => {\n try {\n const parsed = json.trim() === '' ? null : JSON.parse(json);\n setError('');\n updateFn(parsed);\n } catch (e) {\n setError(e instanceof Error ? e.message : 'Invalid JSON');\n } finally {\n setEditingField(null);\n }\n };\n\n // ── Content props ──\n\n const effectiveToolResult = useMemo((): CallToolResult | undefined => {\n if (!toolResult && !modelContext) return undefined;\n if (!modelContext) return toolResult;\n\n const baseResult = toolResult ?? { content: [] };\n const baseStructured = (baseResult.structuredContent as Record<string, unknown>) ?? {};\n return {\n ...baseResult,\n structuredContent: { ...baseStructured, ...modelContext },\n };\n }, [toolResult, modelContext]);\n\n const resourceUrl = selectedSim?.resourceUrl;\n const resourceScript = selectedSim?.resourceScript;\n const resourceHtml = selectedSim?.resourceHtml;\n const csp = selectedSim?.resource ? extractResourceCSP(selectedSim.resource) : undefined;\n const resourceMeta = (selectedSim?.resource?._meta as Record<string, unknown> | undefined)?.ui as\n | { permissions?: McpUiResourcePermissions; prefersBorder?: boolean; domain?: string }\n | undefined;\n const permissions = resourceMeta?.permissions;\n const prefersBorder = resourceMeta?.prefersBorder ?? false;\n\n return {\n simulationNames,\n selectedSimulationName,\n setSelectedSimulationName,\n selectedSim,\n\n activeHost,\n setActiveHost,\n\n screenWidth,\n setScreenWidth,\n\n theme,\n setTheme,\n displayMode,\n setDisplayMode,\n locale,\n setLocale,\n containerHeight,\n setContainerHeight,\n containerWidth,\n setContainerWidth,\n containerMaxHeight,\n setContainerMaxHeight,\n containerMaxWidth,\n setContainerMaxWidth,\n platform,\n setPlatform,\n hover,\n setHover,\n touch,\n setTouch,\n safeAreaInsets,\n setSafeAreaInsets,\n timeZone,\n setTimeZone,\n\n hostContext,\n\n handleDisplayModeReady,\n\n toolInput,\n setToolInput,\n toolResult,\n setToolResult,\n effectiveToolResult,\n\n modelContext,\n setModelContext,\n\n toolInputJson,\n setToolInputJson,\n toolInputError,\n setToolInputError,\n toolResultJson,\n setToolResultJson,\n toolResultError,\n setToolResultError,\n modelContextJson,\n setModelContextJson,\n modelContextError,\n setModelContextError,\n editingField,\n setEditingField,\n\n validateJSON,\n commitJSON,\n\n measuredContentWidth,\n handleContentWidthChange,\n\n handleDisplayModeChange,\n handleUpdateModelContext,\n\n resourceUrl,\n resourceScript,\n resourceHtml,\n csp,\n permissions,\n prefersBorder,\n urlTool: urlParams.tool,\n urlProdResources: urlParams.prodResources,\n urlSidebar: urlParams.sidebar,\n urlDevOverlay: urlParams.devOverlay,\n };\n}\n","export function inspectorApiEndpoint(path: string, apiBaseUrl?: string): string {\n if (!apiBaseUrl) return path;\n const base = apiBaseUrl.replace(/\\/+$/, '');\n const suffix = path.startsWith('/') ? path : `/${path}`;\n return `${base}${suffix}`;\n}\n\nexport async function readInspectorJson<T>(res: Response, endpoint: string): Promise<T> {\n const text = await res.text();\n if (!text) return {} as T;\n\n try {\n return JSON.parse(text) as T;\n } catch {\n const contentType = res.headers.get('content-type');\n const preview = text.trim().replace(/\\s+/g, ' ').slice(0, 120);\n const typeHint = contentType ? ` (${contentType})` : '';\n throw new Error(\n `Expected JSON from ${endpoint} but received a non-JSON response${typeHint}: ${preview}`\n );\n }\n}\n\nexport function resolveInspectorResourceUrls<T>(simulations: T, apiBaseUrl?: string): T {\n if (!apiBaseUrl || !simulations || typeof simulations !== 'object') return simulations;\n\n const resolved: Record<string, unknown> = {};\n for (const [key, value] of Object.entries(simulations as Record<string, unknown>)) {\n if (!value || typeof value !== 'object') {\n resolved[key] = value;\n continue;\n }\n\n const sim = value as Record<string, unknown>;\n resolved[key] = {\n ...sim,\n resourceUrl:\n typeof sim.resourceUrl === 'string' && sim.resourceUrl.startsWith('/')\n ? inspectorApiEndpoint(sim.resourceUrl, apiBaseUrl)\n : sim.resourceUrl,\n };\n }\n\n return resolved as T;\n}\n","import { useState, useEffect, useCallback } from 'react';\nimport {\n inspectorApiEndpoint,\n readInspectorJson,\n resolveInspectorResourceUrls,\n} from './inspector-api';\n\nexport type AuthType = 'none' | 'bearer' | 'oauth';\n\nexport interface AuthConfig {\n type: AuthType;\n /** Bearer token (when type === 'bearer') */\n bearerToken?: string;\n}\n\nexport interface McpConnectionState {\n /** Current connection status */\n status: 'disconnected' | 'connecting' | 'connected' | 'error';\n /** Error message if status is 'error' */\n error?: string;\n /** Simulations returned after a successful reconnect (undefined until first reconnect or after a failed reconnect) */\n simulations?: Record<string, unknown>;\n /** True after at least one user-initiated reconnect has been attempted (URL change). */\n hasReconnected: boolean;\n /** Connect to a new MCP server URL. Returns discovered simulations on success. */\n reconnect: (url: string, auth?: AuthConfig) => Promise<void>;\n /** Update connection state after OAuth completes (bypasses /__sunpeak/connect). */\n setConnected: (simulations?: Record<string, unknown>) => void;\n}\n\n/**\n * Hook for managing MCP server connection status via the dev server proxy.\n *\n * On mount (when `initialServerUrl` is provided), verifies the connection is alive\n * by fetching `/__sunpeak/list-tools`. URL changes are handled by the caller\n * via `reconnect()`, which posts to `/__sunpeak/connect`.\n *\n * This split avoids React StrictMode issues: the mount-only health check runs\n * once (or safely twice with cancellation), while explicit `reconnect()` calls\n * are triggered by the Inspector's URL-change effect.\n */\nexport function useMcpConnection(\n initialServerUrl: string | undefined,\n inspectorApiBaseUrl?: string\n): McpConnectionState {\n const [status, setStatus] = useState<McpConnectionState['status']>(\n initialServerUrl ? 'connecting' : 'disconnected'\n );\n const [error, setError] = useState<string | undefined>();\n const [simulations, setSimulations] = useState<Record<string, unknown> | undefined>();\n const [hasReconnected, setHasReconnected] = useState(false);\n\n const reconnect = useCallback(\n async (url: string, auth?: AuthConfig) => {\n setHasReconnected(true);\n setStatus('connecting');\n setError(undefined);\n try {\n const body: Record<string, unknown> = { url };\n if (auth && auth.type !== 'none') {\n body.auth = auth;\n }\n const endpoint = inspectorApiEndpoint('/__sunpeak/connect', inspectorApiBaseUrl);\n const res = await fetch(endpoint, {\n method: 'POST',\n headers: { 'Content-Type': 'application/json' },\n body: JSON.stringify(body),\n });\n if (!res.ok) {\n let message: string | undefined;\n try {\n const json = await readInspectorJson<{ error?: string }>(res, endpoint);\n if (json.error) message = json.error;\n } catch {\n // Response wasn't JSON — fall through to status-based message\n }\n if (!message) {\n if (res.status === 404) {\n message =\n 'Server not found at this URL. Check the URL and make sure the server is running.';\n } else if (res.status >= 500) {\n message = `Server error (${res.status}). Check the MCP server logs for details.`;\n } else {\n message = `Connection failed (${res.status})`;\n }\n }\n throw new Error(message);\n }\n const data = await readInspectorJson<{ simulations?: Record<string, unknown> }>(\n res,\n endpoint\n );\n setStatus('connected');\n setSimulations(resolveInspectorResourceUrls(data.simulations, inspectorApiBaseUrl));\n } catch (err) {\n let message = err instanceof Error ? err.message : String(err);\n // fetch throws TypeError on network failure (server not running, DNS, etc.)\n if (err instanceof TypeError && message === 'Failed to fetch') {\n message = 'Cannot reach MCP server. Is it running?';\n }\n setError(message);\n setStatus('error');\n setSimulations(undefined);\n }\n },\n [inspectorApiBaseUrl]\n );\n\n const setConnected = useCallback(\n (sims?: Record<string, unknown>) => {\n setHasReconnected(true);\n setStatus('connected');\n setError(undefined);\n setSimulations(resolveInspectorResourceUrls(sims, inspectorApiBaseUrl));\n },\n [inspectorApiBaseUrl]\n );\n\n // Initial health check (mount-only). Verifies the connection is alive\n // when the component mounts with a pre-configured server URL.\n // In React StrictMode the first invocation is cancelled; the second runs to completion.\n useEffect(() => {\n if (!initialServerUrl) return;\n let cancelled = false;\n setStatus('connecting');\n (async () => {\n try {\n const endpoint = inspectorApiEndpoint('/__sunpeak/list-tools', inspectorApiBaseUrl);\n const res = await fetch(endpoint);\n if (cancelled) return;\n if (!res.ok) {\n const msg =\n res.status === 404\n ? 'MCP server not reachable. Is it running?'\n : `Health check failed (${res.status}). Check the MCP server logs.`;\n throw new Error(msg);\n }\n setStatus('connected');\n } catch (err) {\n if (cancelled) return;\n setError(err instanceof Error ? err.message : String(err));\n setStatus('error');\n }\n })();\n return () => {\n cancelled = true;\n };\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, []); // Mount-only — URL changes are handled by the caller via reconnect()\n\n return { status, error, simulations, hasReconnected, reconnect, setConnected };\n}\n","import * as React from 'react';\n\ntype Theme = 'light' | 'dark';\n\ntype ThemeProviderProps = {\n children: React.ReactNode;\n defaultTheme?: Theme;\n theme?: Theme;\n /** Custom theme applier. If not provided, falls back to setting data-theme attribute. */\n applyTheme?: (theme: Theme) => void;\n};\n\ntype ThemeProviderState = {\n theme: Theme;\n};\n\nconst ThemeProviderContext = React.createContext<ThemeProviderState | undefined>(undefined);\n\n/**\n * Default theme applier: sets `data-theme` on `document.documentElement`.\n * Kept for callers using `ThemeProvider` outside the bundled `<Inspector />`\n * (e.g. custom-inspector builds composed from this package's primitives).\n * The bundled Inspector overrides this with a no-op applier and applies\n * theme to its own root element, so embedding it inside a host React app\n * leaves the host's document attributes untouched.\n */\nfunction defaultApplyTheme(theme: Theme): void {\n if (typeof document !== 'undefined') {\n document.documentElement.setAttribute('data-theme', theme);\n }\n}\n\nexport function ThemeProvider({\n children,\n defaultTheme = 'light',\n theme: controlledTheme,\n applyTheme,\n ...props\n}: ThemeProviderProps) {\n const [internalTheme] = React.useState<Theme>(defaultTheme);\n\n const theme = controlledTheme ?? internalTheme;\n const applier = applyTheme ?? defaultApplyTheme;\n\n // Apply theme synchronously before paint to avoid FOUC\n React.useLayoutEffect(() => {\n if (typeof window !== 'undefined' && typeof document !== 'undefined') {\n try {\n applier(theme);\n } catch (error) {\n console.warn('Failed to apply document theme:', error);\n }\n }\n }, [theme, applier]);\n\n const value = {\n theme,\n };\n\n return (\n <ThemeProviderContext.Provider {...props} value={value}>\n {children}\n </ThemeProviderContext.Provider>\n );\n}\n\nexport const useThemeContext = () => {\n const context = React.useContext(ThemeProviderContext);\n\n if (context === undefined) throw new Error('useThemeContext must be used within a ThemeProvider');\n\n return context;\n};\n","import * as React from 'react';\nimport { useState } from 'react';\n\ninterface SimpleSidebarProps {\n children: React.ReactNode;\n controls: React.ReactNode;\n /** Optional element rendered right-aligned in the Controls header row */\n headerRight?: React.ReactNode;\n /**\n * Optional ref attached to the outer `.sunpeak-inspector-root` element.\n * The Inspector uses this to scope host theming, CSS variables, and page\n * styles to its own subtree rather than `document.documentElement`.\n */\n rootRef?: React.Ref<HTMLDivElement>;\n /**\n * When true, the sidebar's outer root sizes to its parent (`h-full w-full`)\n * instead of the viewport (`h-screen w-full`). Used by embedders who place\n * the Inspector inside a sized container.\n */\n fillParent?: boolean;\n}\n\nconst DEFAULT_SIDEBAR_WIDTH = 260; // ChatGPT sidebar: 260px (extracted 2026-03-21)\n\nfunction ChevronRightIcon() {\n return (\n <svg width=\"1em\" height=\"1em\" viewBox=\"0 0 24 24\" fill=\"currentColor\">\n <path\n fillRule=\"evenodd\"\n d=\"M8.293 4.293a1 1 0 0 1 1.414 0l7 7a1 1 0 0 1 0 1.414l-7 7a1 1 0 0 1-1.414-1.414L14.586 12 8.293 5.707a1 1 0 0 1 0-1.414Z\"\n clipRule=\"evenodd\"\n />\n </svg>\n );\n}\n\nexport function SimpleSidebar({\n children,\n controls,\n headerRight,\n rootRef,\n fillParent = false,\n}: SimpleSidebarProps) {\n const [isDrawerOpen, setIsDrawerOpen] = React.useState(false);\n const [sidebarWidth, setSidebarWidth] = React.useState(DEFAULT_SIDEBAR_WIDTH);\n const [isResizing, setIsResizing] = React.useState(false);\n\n const handleMouseDown = React.useCallback((e: React.MouseEvent) => {\n e.preventDefault();\n setIsResizing(true);\n }, []);\n\n React.useEffect(() => {\n if (!isResizing) return;\n\n const handleMouseMove = (e: MouseEvent) => {\n const maxWidth = Math.floor(window.innerWidth / 3);\n const newWidth = Math.min(maxWidth, Math.max(DEFAULT_SIDEBAR_WIDTH, e.clientX));\n setSidebarWidth(newWidth);\n };\n\n const handleMouseUp = () => {\n setIsResizing(false);\n };\n\n document.addEventListener('mousemove', handleMouseMove);\n document.addEventListener('mouseup', handleMouseUp);\n\n return () => {\n document.removeEventListener('mousemove', handleMouseMove);\n document.removeEventListener('mouseup', handleMouseUp);\n };\n }, [isResizing]);\n\n return (\n <div\n ref={rootRef}\n className={`sunpeak-inspector-root flex ${\n fillParent ? 'h-full w-full' : 'h-screen w-full'\n } overflow-hidden relative`}\n >\n {/* Resize overlay to capture mouse events during drag */}\n {isResizing && <div className=\"fixed inset-0 z-50 cursor-col-resize\" />}\n\n {/* Mobile drawer overlay */}\n {isDrawerOpen && (\n <div\n className=\"md:hidden fixed inset-0 bg-black/50 z-40 pointer-events-auto\"\n onClick={(e) => {\n if (e.target === e.currentTarget) {\n setIsDrawerOpen(false);\n }\n }}\n />\n )}\n\n {/* Sidebar */}\n <aside\n className={`\n relative flex flex-col bg-sidebar\n md:z-auto\n max-md:fixed max-md:inset-y-0 max-md:left-0 max-md:z-[100]\n max-md:transition-transform max-md:duration-300 max-md:!w-2/3\n ${isDrawerOpen ? 'max-md:translate-x-0' : 'max-md:-translate-x-full'}\n `}\n style={{\n width: sidebarWidth,\n borderRight: '1px solid var(--color-border-primary)',\n }}\n >\n <div className=\"flex-1 overflow-y-auto min-h-0 px-3 pb-3 pt-0\">\n <div className=\"space-y-3\">\n <div>\n <div className=\"flex items-center justify-between sticky top-0 bg-sidebar z-10 py-2\">\n <h2\n className=\"text-xs font-semibold\"\n style={{ color: 'var(--color-text-primary)' }}\n >\n Controls\n </h2>\n <div className=\"flex items-center gap-2\">\n {headerRight}\n {/* Close button for mobile */}\n <button\n onClick={() => setIsDrawerOpen(false)}\n className=\"md:hidden p-1 transition-colors\"\n style={{ color: 'var(--color-text-secondary)' }}\n type=\"button\"\n aria-label=\"Close sidebar\"\n >\n <svg\n width=\"16\"\n height=\"16\"\n viewBox=\"0 0 16 16\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <path\n d=\"M12 4L4 12M4 4L12 12\"\n stroke=\"currentColor\"\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n />\n </svg>\n </button>\n </div>\n </div>\n {controls}\n </div>\n </div>\n </div>\n\n {/* Resize handle */}\n <div\n onMouseDown={handleMouseDown}\n className=\"hidden md:block absolute top-0 right-0 w-1 h-full cursor-col-resize hover:bg-black/10 dark:hover:bg-white/10 active:bg-black/20 dark:active:bg-white/20 transition-colors\"\n />\n </aside>\n\n {/* Main content */}\n <main className=\"flex-1 overflow-auto relative\">\n {/* Mobile drawer toggle button */}\n <button\n onClick={() => setIsDrawerOpen(true)}\n className=\"md:hidden fixed top-18 left-0 z-30 bg-sidebar rounded-r-md p-2 shadow-lg hover:bg-black/5 dark:hover:bg-white/10 transition-colors\"\n style={{\n borderRight: '1px solid var(--color-border-primary)',\n borderTop: '1px solid var(--color-border-primary)',\n borderBottom: '1px solid var(--color-border-primary)',\n }}\n type=\"button\"\n aria-label=\"Open sidebar\"\n >\n <ChevronRightIcon />\n </button>\n {children}\n </main>\n </div>\n );\n}\n\n/* ── Help icon with tooltip ── */\n\nconst DOCS_BASE_URL = 'https://sunpeak.ai/docs';\n\ninterface HelpIconProps {\n tooltip: string;\n docsPath: string;\n}\n\nfunction HelpIcon({ tooltip, docsPath }: HelpIconProps) {\n const [pos, setPos] = React.useState<{ top: number; left: number } | null>(null);\n const ref = React.useRef<HTMLAnchorElement>(null);\n\n const showTooltip = () => {\n const rect = ref.current?.getBoundingClientRect();\n if (rect) {\n setPos({ top: rect.top + rect.height / 2, left: rect.right + 6 });\n }\n };\n\n return (\n <a\n ref={ref}\n href={`${DOCS_BASE_URL}/${docsPath}`}\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n className=\"inline-flex items-center justify-center no-underline flex-shrink-0 transition-colors\"\n style={{\n color: 'var(--color-text-tertiary, var(--color-text-secondary))',\n }}\n onClick={(e) => e.stopPropagation()}\n onMouseEnter={showTooltip}\n onMouseLeave={() => setPos(null)}\n >\n <svg\n width=\"12\"\n height=\"12\"\n viewBox=\"0 0 12 12\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <circle cx=\"6\" cy=\"6\" r=\"5.25\" stroke=\"currentColor\" strokeWidth=\"1\" />\n <text\n x=\"6.25\"\n y=\"8.5\"\n textAnchor=\"middle\"\n fill=\"currentColor\"\n fontSize=\"7.5\"\n fontWeight=\"600\"\n fontFamily=\"system-ui, sans-serif\"\n >\n ?\n </text>\n </svg>\n {pos && (\n <span\n className=\"pointer-events-none fixed whitespace-nowrap rounded px-2 py-1 text-[11px] font-normal leading-tight z-[200]\"\n style={{\n top: pos.top,\n left: pos.left,\n transform: 'translateY(-50%)',\n backgroundColor: 'var(--color-text-primary)',\n color: 'var(--color-background-primary)',\n }}\n >\n {tooltip}\n </span>\n )}\n </a>\n );\n}\n\ninterface SidebarControlProps {\n label: React.ReactNode;\n children: React.ReactNode;\n /** Short tooltip shown on hover of the help icon */\n tooltip?: string;\n /** Docs path appended to https://sunpeak.ai/docs/ */\n docsPath?: string;\n 'data-testid'?: string;\n}\n\nexport function SidebarControl({\n label,\n children,\n tooltip,\n docsPath,\n 'data-testid': testId,\n}: SidebarControlProps) {\n return (\n <div className=\"space-y-1\" data-testid={testId}>\n <span\n className=\"text-[10px] font-medium leading-tight inline-flex items-center gap-1\"\n style={{ color: 'var(--color-text-secondary)' }}\n >\n {label}\n {tooltip && docsPath && <HelpIcon tooltip={tooltip} docsPath={docsPath} />}\n </span>\n {children}\n </div>\n );\n}\n\ninterface SidebarCollapsibleControlProps {\n label: string;\n children: React.ReactNode;\n defaultCollapsed?: boolean;\n /** Short tooltip shown on hover of the help icon */\n tooltip?: string;\n /** Docs path appended to https://sunpeak.ai/docs/ */\n docsPath?: string;\n 'data-testid'?: string;\n}\n\nexport function SidebarCollapsibleControl({\n label,\n children,\n defaultCollapsed = true,\n tooltip,\n docsPath,\n 'data-testid': testId,\n}: SidebarCollapsibleControlProps) {\n const [isCollapsed, setIsCollapsed] = React.useState(defaultCollapsed);\n\n return (\n <div className=\"space-y-1\" data-testid={testId}>\n <button\n onClick={() => setIsCollapsed(!isCollapsed)}\n className=\"w-full flex items-center justify-between text-[10px] font-medium leading-tight transition-colors py-1 cursor-pointer\"\n style={{ color: 'var(--color-text-secondary)' }}\n type=\"button\"\n >\n <span className=\"inline-flex items-center gap-1\">\n {label}\n {tooltip && docsPath && <HelpIcon tooltip={tooltip} docsPath={docsPath} />}\n </span>\n <span className=\"text-[8px]\">{isCollapsed ? '▶' : '▼'}</span>\n </button>\n {!isCollapsed && children}\n </div>\n );\n}\n\n/* ── Shared form element styles ── */\n\nconst formElementStyle: React.CSSProperties = {\n color: 'var(--color-text-primary)',\n backgroundColor: 'var(--color-background-primary)',\n cursor: 'pointer',\n};\n\ninterface SidebarSelectProps {\n value: string;\n onChange: (value: string) => void;\n options: Array<{ value: string; label: string }>;\n placeholder?: string;\n}\n\nexport function SidebarSelect({ value, onChange, options, placeholder }: SidebarSelectProps) {\n return (\n <select\n value={value}\n onChange={(e) => onChange(e.target.value)}\n className=\"w-full h-7 text-xs rounded-full px-2 outline-none appearance-none bg-no-repeat bg-[length:12px] bg-[right_6px_center]\"\n style={{\n ...formElementStyle,\n backgroundImage: `url(\"data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%236b7280'%3e%3cpath d='M4.22 6.22a.75.75 0 0 1 1.06 0L8 8.94l2.72-2.72a.75.75 0 1 1 1.06 1.06l-3.25 3.25a.75.75 0 0 1-1.06 0L4.22 7.28a.75.75 0 0 1 0-1.06Z'/%3e%3c/svg%3e\")`,\n paddingRight: '1.5rem',\n }}\n >\n {placeholder && (\n <option value=\"\" disabled>\n {placeholder}\n </option>\n )}\n {options.map((option) => (\n <option key={option.value} value={option.value}>\n {option.label}\n </option>\n ))}\n </select>\n );\n}\n\ninterface SidebarInputProps {\n value: string;\n onChange: (value: string) => void;\n /** When provided, onChange is only called on blur instead of on every keystroke. */\n applyOnBlur?: boolean;\n placeholder?: string;\n type?: 'text' | 'number' | 'password';\n disabled?: boolean;\n}\n\nexport function SidebarInput({\n value,\n onChange,\n applyOnBlur = false,\n placeholder,\n type = 'text',\n disabled = false,\n}: SidebarInputProps) {\n const [draft, setDraft] = useState(value);\n const [isEditing, setIsEditing] = useState(false);\n const [prevValue, setPrevValue] = useState(value);\n\n // Sync draft when the controlled value changes externally (while not editing).\n // Done during render (not in an effect) to avoid cascading renders.\n if (!isEditing && value !== prevValue) {\n setPrevValue(value);\n setDraft(value);\n }\n\n if (applyOnBlur) {\n return (\n <input\n type={type}\n value={draft}\n onChange={(e) => setDraft(e.target.value)}\n onFocus={() => setIsEditing(true)}\n onBlur={() => {\n setIsEditing(false);\n onChange(draft);\n }}\n onKeyDown={(e) => {\n if (e.key === 'Enter') {\n setIsEditing(false);\n onChange(draft);\n (e.target as HTMLInputElement).blur();\n }\n }}\n placeholder={placeholder}\n disabled={disabled}\n className=\"w-full h-7 text-xs rounded-md px-2 outline-none disabled:opacity-50 disabled:cursor-not-allowed\"\n style={{ ...formElementStyle, cursor: disabled ? undefined : 'text' }}\n />\n );\n }\n\n return (\n <input\n type={type}\n value={value}\n onChange={(e) => onChange(e.target.value)}\n placeholder={placeholder}\n disabled={disabled}\n className=\"w-full h-7 text-xs rounded-md px-2 outline-none disabled:opacity-50 disabled:cursor-not-allowed\"\n style={{ ...formElementStyle, cursor: disabled ? undefined : 'text' }}\n />\n );\n}\n\ninterface SidebarCheckboxProps {\n checked: boolean;\n onChange: (checked: boolean) => void;\n label: string;\n /** Short tooltip shown on hover of the help icon */\n tooltip?: string;\n /** Docs path appended to https://sunpeak.ai/docs/ */\n docsPath?: string;\n}\n\nexport function SidebarCheckbox({\n checked,\n onChange,\n label,\n tooltip,\n docsPath,\n}: SidebarCheckboxProps) {\n const id = React.useId();\n return (\n <div className=\"flex items-center gap-1.5\">\n <input\n id={id}\n type=\"checkbox\"\n checked={checked}\n onChange={(e) => onChange(e.target.checked)}\n className=\"outline-none cursor-pointer\"\n />\n <label\n htmlFor={id}\n className=\"text-[11px] select-none cursor-pointer leading-tight inline-flex items-center gap-1\"\n style={{ color: 'var(--color-text-primary)' }}\n >\n {label}\n {tooltip && docsPath && <HelpIcon tooltip={tooltip} docsPath={docsPath} />}\n </label>\n </div>\n );\n}\n\ninterface SidebarTextareaProps {\n value: string;\n onChange: (value: string) => void;\n onFocus?: () => void;\n onBlur?: () => void;\n placeholder?: string;\n maxRows?: number;\n error?: string;\n 'data-testid'?: string;\n}\n\nexport function SidebarTextarea({\n value,\n onChange,\n onFocus,\n onBlur,\n placeholder,\n maxRows = 8,\n error,\n 'data-testid': testId,\n}: SidebarTextareaProps) {\n const contentRows = value?.split('\\n').length ?? 1;\n const rows = Math.min(contentRows, maxRows);\n\n return (\n <div className=\"space-y-0.5\">\n <textarea\n value={value}\n onChange={(e) => onChange(e.target.value)}\n onFocus={onFocus}\n onBlur={onBlur}\n placeholder={placeholder}\n rows={rows}\n data-testid={testId}\n className=\"w-full text-[10px] font-mono rounded-md px-2 py-1.5 outline-none resize-y\"\n style={{\n ...formElementStyle,\n cursor: 'text',\n whiteSpace: 'pre',\n overflowX: 'auto',\n overflowWrap: 'normal',\n ...(error ? { boxShadow: 'inset 0 0 0 1px var(--color-text-danger, #dc2626)' } : {}),\n }}\n aria-invalid={!!error}\n />\n {error && (\n <div className=\"text-[9px]\" style={{ color: 'var(--color-text-danger, #dc2626)' }}>\n {error}\n </div>\n )}\n </div>\n );\n}\n\ninterface SidebarToggleProps {\n value: string;\n onChange: (value: string) => void;\n options: Array<{ value: string; label: string }>;\n}\n\nexport function SidebarToggle({ value, onChange, options }: SidebarToggleProps) {\n return (\n <div\n className=\"inline-flex w-full rounded-full p-[3px] gap-0.5\"\n style={{ backgroundColor: 'var(--color-background-tertiary)' }}\n role=\"group\"\n aria-label=\"Toggle options\"\n >\n {options.map((option) => {\n const isSelected = value === option.value;\n return (\n <button\n key={option.value}\n onClick={() => onChange(option.value)}\n aria-pressed={isSelected}\n className=\"flex-1 text-[10px] font-medium h-[22px] px-2 rounded-full outline-none transition-all duration-150 cursor-pointer\"\n style={{\n backgroundColor: isSelected ? 'var(--color-background-primary)' : 'transparent',\n color: isSelected ? 'var(--color-text-primary)' : 'var(--color-text-secondary)',\n boxShadow: isSelected ? '0 1px 2px 0 rgba(0,0,0,0.06)' : 'none',\n }}\n type=\"button\"\n >\n {option.label}\n </button>\n );\n })}\n </div>\n );\n}\n","/**\n * Core simulation types for development and testing.\n * These types define how simulations are configured and used in both\n * the dev inspector and MCP server contexts.\n */\n\nimport type { Tool, Resource, CallToolResult } from '@modelcontextprotocol/sdk/types.js';\nimport type { McpUiHostContext } from '@modelcontextprotocol/ext-apps';\n\n/**\n * Mock response for a server tool call within a simulation.\n *\n * Simple form: a single `CallToolResult` always returned.\n * Conditional form: an array of `{ when, result }` entries — the first\n * entry whose `when` keys shallow-match the call arguments wins.\n */\nexport type ServerToolMock =\n | CallToolResult\n | Array<{ when: Record<string, unknown>; result: CallToolResult }>;\n\n/**\n * A simulation packages a component with its example data and metadata.\n * Each simulation represents a complete tool experience in the inspector.\n *\n * Resource rendering options (mutually exclusive):\n * - `resourceUrl`: URL to an HTML page (dev mode with Vite HMR)\n * - `resourceScript`: URL to a built resource file (production builds)\n */\nexport interface Simulation {\n // Unique identifier derived from the simulation filename (e.g., 'show-albums')\n // or a flattener-composed key (`<tool>__<sim>`) in the embedded App path.\n // Must be unique across the whole inspector instance.\n name: string;\n\n // Optional pretty label shown in the sidebar's Simulation dropdown. When\n // omitted, the Inspector falls back to `name`. Used by the embedded App\n // path to show the user's chosen simulation name (e.g. `two-albums`) in\n // place of the internal flattened key (`show_albums__two-albums`).\n displayName?: string;\n\n // URL to an HTML page to load in an iframe (dev mode).\n // The page mounts the resource component and uses SDK's useApp().\n resourceUrl?: string;\n\n // URL to a built resource for iframe rendering (production builds).\n resourceScript?: string;\n\n // Resource HTML as a string — used by the embedding path where the caller\n // hands the Inspector a complete document (typically from\n // `mcpClient.readResource(...)`) and the Inspector forwards it to the\n // sandbox iframe via PostMessage. Mutually exclusive with the URL fields.\n resourceHtml?: string;\n\n userMessage?: string; // Decoration for the inspector, no functional purpose.\n\n // Official Tool type from the MCP SDK, used in ListTools response.\n tool: Tool;\n\n // Official Resource type from the MCP SDK, used in ListResources response.\n // Undefined for tools without a UI.\n resource?: Resource;\n\n // Tool input arguments (the arguments object sent to CallTool).\n toolInput?: Record<string, unknown>;\n\n // Tool result data (the response from CallTool). Matches the full MCP\n // `CallToolResult` shape so structured content, image parts, isError, and\n // _meta all flow through unchanged.\n toolResult?: CallToolResult;\n\n // Initial host context overrides for the simulation.\n hostContext?: Partial<McpUiHostContext>;\n\n /**\n * Mock responses for `callServerTool` calls made by the resource.\n * Keys are tool names; values are either a single result or an array\n * of conditional `{ when, result }` entries for argument-based matching.\n */\n serverTools?: Record<string, ServerToolMock>;\n}\n\n/**\n * Resolve a `ServerToolMock` to a concrete `CallToolResult` given the call arguments.\n *\n * - Simple form (single result): returns it directly.\n * - Conditional form (array of `{ when, result }`): returns the first entry\n * whose `when` keys all shallow-equal the corresponding values in `args`.\n * Falls back to `undefined` if no condition matches.\n */\nexport function resolveServerToolResult(\n mock: ServerToolMock,\n args: Record<string, unknown> | undefined\n): CallToolResult | undefined {\n if (!Array.isArray(mock)) return mock;\n\n for (const entry of mock) {\n const matches = Object.entries(entry.when).every(\n ([key, value]) => args != null && args[key] === value\n );\n if (matches) return entry.result;\n }\n return undefined;\n}\n","/**\n * Convert the public `InspectorApp` shape into the internal flat `Simulation`\n * map the Inspector's existing code already operates on. The hierarchical\n * shape (App → resources + tools → simulations) is just a more ergonomic\n * surface; flattening here means the rest of the component is unchanged.\n *\n * Linkage: each tool's `_meta.openai.outputTemplate` URI selects the matching\n * resource. Tools whose template doesn't resolve to a known resource are\n * skipped — they have no UI to render and would only confuse the sidebar.\n *\n * A tool with no `simulations` still produces one entry so the sidebar has\n * something to select. That entry carries no fixture data, so the Inspector\n * shows the \"Press Run\" empty state and `onCallTool` decides what happens.\n *\n * Naming split — `Simulation.name` vs `Simulation.displayName`:\n *\n * - `name` is the unique internal key used everywhere the Inspector indexes\n * simulations (state, dropdown `value`, the simulations map keys). For the\n * flattened embed path it's `<toolName>__<userSimName>` so two tools can\n * share a simulation name without colliding.\n * - `displayName` is the user-facing label shown in the sidebar's Simulation\n * dropdown. Set to the embedder's raw `sim.name` so users see what they\n * wrote, not the internal composite. Sidebar code falls back to `name`\n * when `displayName` is omitted (the legacy CLI path).\n *\n * Don't collapse these — the URL-param deep-link path (`?simulation=X`) and\n * the rest of the Inspector code rely on `name` being a stable unique key.\n */\nimport type { Resource } from '@modelcontextprotocol/sdk/types.js';\nimport type { Simulation } from '../types/simulation';\nimport type { InspectorApp, InspectorAppResource } from './app-types';\n\n/** Pull the output-template URI off a tool's _meta, if present. */\nfunction getOutputTemplate(toolMeta: unknown): string | undefined {\n if (!toolMeta || typeof toolMeta !== 'object') return undefined;\n const openai = (toolMeta as Record<string, unknown>).openai;\n if (!openai || typeof openai !== 'object') return undefined;\n const template = (openai as Record<string, unknown>).outputTemplate;\n return typeof template === 'string' ? template : undefined;\n}\n\n/** Build an MCP-shaped `Resource` from the embedder's input. Used purely for\n * sidebar metadata (CSP, permissions, prefersBorder); the actual HTML render\n * goes through `resourceHtml` on the resulting Simulation. */\nfunction toMcpResource(r: InspectorAppResource): Resource {\n return {\n uri: r.uri,\n mimeType: r.mimeType ?? 'text/html',\n name: r.uri,\n ...(r._meta ? { _meta: r._meta } : {}),\n } as Resource;\n}\n\n/**\n * Flatten an `InspectorApp` to the `Record<string, Simulation>` shape the\n * Inspector consumes internally. Returns an empty map if `app` is missing.\n */\nexport function flattenAppToSimulations(app: InspectorApp | undefined): Record<string, Simulation> {\n if (!app) return {};\n const result: Record<string, Simulation> = {};\n\n // Index resources by URI so each tool can resolve its output template.\n // Duplicate URIs are almost always typos — warn so the embedder notices\n // (the silent last-write semantics would hide the bug otherwise).\n const resourcesByUri = new Map<string, InspectorAppResource>();\n for (const r of app.resources) {\n if (resourcesByUri.has(r.uri)) {\n console.warn(\n `[Inspector] Duplicate resource URI '${r.uri}' in app.resources — the second entry replaces the first.`\n );\n }\n resourcesByUri.set(r.uri, r);\n }\n\n for (const appTool of app.tools) {\n const uri = getOutputTemplate(appTool.tool._meta);\n if (!uri) continue;\n const resource = resourcesByUri.get(uri);\n if (!resource) continue;\n\n const mcpResource = toMcpResource(resource);\n const sims =\n appTool.simulations && appTool.simulations.length > 0\n ? appTool.simulations\n : [{ name: appTool.tool.name }];\n\n for (const sim of sims) {\n // Compose a key unique across the whole app. Multiple tools may share\n // a resource and multiple sims may share a name across tools; prefix\n // with the tool name to keep keys stable.\n const key = `${appTool.tool.name}__${sim.name}`;\n // Same name twice under one tool is almost always a typo — second\n // would silently replace the first. Warn so the embedder catches it.\n if (key in result) {\n console.warn(\n `[Inspector] Duplicate simulation name '${sim.name}' under tool '${appTool.tool.name}' — the second entry replaces the first.`\n );\n }\n result[key] = {\n name: key,\n // Pretty label for the sidebar. The internal `name` is the unique\n // composite key; the embedder's chosen simulation name surfaces here.\n displayName: sim.name,\n resourceHtml: resource.html,\n userMessage: sim.userMessage,\n tool: appTool.tool,\n resource: mcpResource,\n toolInput: sim.toolInput,\n toolResult: sim.toolResult,\n serverTools: sim.serverTools,\n };\n }\n }\n\n return result;\n}\n","import * as React from 'react';\nimport type {\n McpUiDisplayMode,\n McpUiTheme,\n McpUiHostContext,\n} from '@modelcontextprotocol/ext-apps';\nimport type { CallToolResult } from '@modelcontextprotocol/sdk/types.js';\nimport { useInspectorState } from './use-inspector-state';\nimport { useMcpConnection, type AuthType, type AuthConfig } from './use-mcp-connection';\nimport { IframeResource } from './iframe-resource';\nimport { ThemeProvider } from './theme-provider';\nimport {\n SimpleSidebar,\n SidebarControl,\n SidebarCollapsibleControl,\n SidebarSelect,\n SidebarInput,\n SidebarCheckbox,\n SidebarTextarea,\n SidebarToggle,\n} from './simple-sidebar';\nimport { getHostShell, getRegisteredHosts, type HostId } from './hosts';\nimport { resolveServerToolResult } from '../types/simulation';\nimport type { Simulation } from '../types/simulation';\nimport type { ScreenWidth } from './inspector-types';\nimport type { InspectorApp } from './app-types';\nimport { flattenAppToSimulations } from './app-flatten';\nimport { inspectorApiEndpoint, readInspectorJson } from './inspector-api';\n\n// Register built-in host shells. These imports live here (in the component file)\n// rather than in the barrel index.ts because Rollup code-splitting can separate\n// side-effect imports from barrel exports, letting consumer bundlers tree-shake\n// them. Importing here makes registration part of the Inspector component's\n// dependency graph, which can't be tree-shaken since the component is used.\nimport '../chatgpt/chatgpt-host';\nimport '../claude/claude-host';\n\nconst DOCS_BASE_URL = 'https://sunpeak.ai/docs';\n\nexport interface InspectorProps {\n children?: React.ReactNode;\n /**\n * Hierarchical input for embedding: an MCP App with its resources, tools,\n * and saved simulations. Mirrors the MCP App data model — resources are\n * keyed by URI, and each tool's `_meta.openai.outputTemplate` selects the\n * resource it renders. The Inspector flattens this internally; pass the\n * shape you already have from `listTools` + `listResources` + your fixture\n * store and the component renders it. See `InspectorApp`.\n *\n * Mutually exclusive with `simulations`. When both are provided, `app`\n * wins — `simulations` stays for back-compat with the CLI codepath.\n */\n app?: InspectorApp;\n simulations?: Record<string, Simulation>;\n appName?: string;\n appIcon?: string;\n /** Which host shell to use initially. Defaults to 'chatgpt'. */\n defaultHost?: HostId;\n /** Override callServerTool resolution. When provided, bypasses simulation serverTools mocks. Routes through MCP which returns simulation fixture data for UI tools. */\n onCallTool?: (params: {\n name: string;\n arguments?: Record<string, unknown>;\n }) => Promise<CallToolResult> | CallToolResult;\n /** Direct tool handler call, bypassing MCP server mock data. Falls back to onCallTool if not provided. */\n onCallToolDirect?: (params: {\n name: string;\n arguments?: Record<string, unknown>;\n }) => Promise<CallToolResult> | CallToolResult;\n /** Initial prod-resources mode state. When true, resources load from dist/ instead of HMR. Defaults to false. */\n defaultProdResources?: boolean;\n /** Hide framework-only controls (Prod Resources) in the sidebar. */\n hideInspectorModes?: boolean;\n /**\n * Demo mode for embedding on marketing sites. When true:\n * - Hides Prod Resources checkbox\n * - Disables the MCP Server URL input (shows a static example URL)\n * - Hides the Run button (prevents sending real MCP requests)\n * - Hides connection status indicator\n */\n demoMode?: boolean;\n /**\n * Base URL of the separate-origin sandbox server (e.g., \"http://localhost:24680\").\n * When provided, the outer iframe loads from this URL instead of using srcdoc,\n * giving real cross-origin isolation that matches production hosts.\n */\n sandboxUrl?: string;\n /**\n * MCP server URL. Pre-populates the server URL field in the sidebar and\n * shows connection status. Users can edit this URL at any time to connect\n * to a different server.\n */\n mcpServerUrl?: string;\n /**\n * Base URL for the sunpeak inspector backend endpoints (`/__sunpeak/*`).\n * Defaults to same-origin. Embedders that serve the React Inspector from\n * their own app can point this at a same-origin proxy or hosted inspector\n * backend, for example `/api/sunpeak`.\n */\n inspectorApiBaseUrl?: string;\n}\n\ntype Platform = 'mobile' | 'desktop' | 'web';\n\n/** Info about a unique tool, derived from simulations. */\ninterface ToolInfo {\n tool: Simulation['tool'];\n resource?: Simulation['resource'];\n /** All simulation names for this tool (first entry is the \"base\" for resource URL). */\n simNames: string[];\n /** Simulation names that have fixture data (toolInput, toolResult, or serverTools). */\n fixtureSimNames: string[];\n}\n\n/** Check whether a simulation has user-authored fixture data. */\nfunction hasFixtureData(sim: Simulation): boolean {\n return sim.toolResult != null || sim.toolInput != null || sim.serverTools != null;\n}\n\n// Reference-stable empty default. A destructuring default of `= {}` creates a\n// fresh object on every render — when combined with `useMemo(..., [..., props])`\n// downstream that drives a `useEffect(setState(...), [memo])`, that produces\n// an infinite render loop. Don't reinline this.\nconst EMPTY_SIMULATIONS: Readonly<Record<string, Simulation>> = Object.freeze({});\n\nexport function Inspector({\n children,\n app,\n simulations: initialSimulationsProp = EMPTY_SIMULATIONS,\n appName: appNameProp,\n appIcon: appIconProp,\n defaultHost = 'chatgpt',\n onCallTool,\n onCallToolDirect,\n defaultProdResources = false,\n hideInspectorModes = false,\n demoMode = false,\n sandboxUrl,\n mcpServerUrl,\n inspectorApiBaseUrl,\n}: InspectorProps) {\n // When `app` is provided it drives both the simulation map and the header\n // name/icon. Falling back to the legacy props keeps existing callers working.\n const initialSimulations = React.useMemo(\n () => (app ? flattenAppToSimulations(app) : initialSimulationsProp),\n [app, initialSimulationsProp]\n );\n const appName = app?.name ?? appNameProp ?? 'Sunpeak';\n const appIcon = app?.icon ?? appIconProp;\n // `!!app` (rather than `app !== undefined`) so a slipped-in `null` doesn't\n // flip the inspector into embedded mode while delivering no actual app.\n const isEmbedded = !!app;\n\n // Warn at most once per component instance when both inputs are supplied.\n // Without the ref guard the useEffect dep `initialSimulationsProp` changes\n // reference each parent render (when `simulations` is passed inline), which\n // would cause the warning to spam the console repeatedly.\n const conflictWarnedRef = React.useRef(false);\n React.useEffect(() => {\n if (conflictWarnedRef.current) return;\n if (app && initialSimulationsProp && Object.keys(initialSimulationsProp).length > 0) {\n conflictWarnedRef.current = true;\n console.warn(\n '[Inspector] Both `app` and `simulations` were provided. `app` takes precedence; `simulations` is ignored.'\n );\n }\n }, [app, initialSimulationsProp]);\n // Root element ref — host theming, CSS variables, and page-style overrides\n // are applied here rather than on `document.documentElement`. This keeps the\n // Inspector self-contained when embedded inside another React app: the host\n // page's `<button>`/`<input>`/typography stay untouched, and the inspector's\n // colors/fonts apply only to its own subtree.\n const rootRef = React.useRef<HTMLDivElement | null>(null);\n\n // Simulations can be updated when the user reconnects to a different server.\n const [simulations, setSimulations] = React.useState(initialSimulations);\n // Sync with prop changes (e.g., HMR during development).\n React.useEffect(() => {\n setSimulations(initialSimulations);\n }, [initialSimulations]);\n\n // ── Derive tools from simulations ──\n // Each unique tool name becomes a ToolInfo with all its associated simulations.\n const toolMap = React.useMemo(() => {\n const map = new Map<string, ToolInfo>();\n for (const [simName, sim] of Object.entries(simulations)) {\n if (!sim.resource) continue; // Skip backend-only tools\n const toolName = sim.tool.name;\n if (!map.has(toolName)) {\n map.set(toolName, {\n tool: sim.tool,\n resource: sim.resource,\n simNames: [],\n fixtureSimNames: [],\n });\n }\n const info = map.get(toolName)!;\n info.simNames.push(simName);\n if (hasFixtureData(sim)) {\n info.fixtureSimNames.push(simName);\n }\n }\n return map;\n }, [simulations]);\n\n const toolNames = React.useMemo(\n () =>\n Array.from(toolMap.keys()).sort((a, b) => {\n const infoA = toolMap.get(a)!;\n const infoB = toolMap.get(b)!;\n const labelA = (infoA.tool.title as string | undefined) || a;\n const labelB = (infoB.tool.title as string | undefined) || b;\n return labelA.localeCompare(labelB);\n }),\n [toolMap]\n );\n\n // Parse URL params once for tool/simulation initialization.\n const initUrlParams = React.useMemo(() => {\n if (typeof window === 'undefined')\n return { tool: null, simulation: null, noMockData: false, autoRun: false };\n const params = new URLSearchParams(window.location.search);\n return {\n tool: params.get('tool'),\n simulation: params.get('simulation'),\n noMockData: false,\n // autoRun: test fixtures set this to call the tool immediately on load\n // when no fixture data exists. Interactive users don't set this.\n autoRun: params.get('autoRun') === 'true',\n };\n }, []);\n\n // ── Tool selection ──\n // ?tool=X explicitly selects a tool. ?simulation=X infers the tool from the simulation.\n const [selectedToolName, setSelectedToolName] = React.useState(() => {\n if (initUrlParams.tool && toolMap.has(initUrlParams.tool)) return initUrlParams.tool;\n if (initUrlParams.simulation) {\n for (const [toolName, info] of toolMap) {\n if (info.simNames.includes(initUrlParams.simulation)) return toolName;\n }\n }\n return toolNames[0] ?? '';\n });\n\n // Reset tool selection when tools change (e.g., after reconnect)\n const prevToolNamesRef = React.useRef(toolNames);\n if (prevToolNamesRef.current !== toolNames) {\n prevToolNamesRef.current = toolNames;\n if (toolNames.length > 0 && !toolMap.has(selectedToolName)) {\n setSelectedToolName(toolNames[0]);\n }\n }\n\n const selectedToolInfo = toolMap.get(selectedToolName);\n\n // ── Simulation selection ──\n // null = \"None\" (no mock data, call the real server)\n // string = a specific simulation with fixture data\n // ?tool=X without ?simulation=Y means \"select tool, no mock data\"\n const [activeSimulationName, setActiveSimulationName] = React.useState<string | null>(() => {\n if (!selectedToolInfo) return null;\n if (initUrlParams.noMockData) return null;\n if (initUrlParams.tool && !initUrlParams.simulation) return null;\n // ?simulation=X explicitly selects a simulation (if it exists and has fixture data)\n if (\n initUrlParams.simulation &&\n selectedToolInfo.fixtureSimNames.includes(initUrlParams.simulation)\n ) {\n return initUrlParams.simulation;\n }\n return selectedToolInfo.fixtureSimNames[0] ?? null;\n });\n\n // When tool changes, auto-select first fixture simulation (or null)\n const prevToolNameRef = React.useRef(selectedToolName);\n if (prevToolNameRef.current !== selectedToolName) {\n prevToolNameRef.current = selectedToolName;\n const newInfo = toolMap.get(selectedToolName);\n setActiveSimulationName(newInfo?.fixtureSimNames[0] ?? null);\n }\n\n // The effective simulation name for useInspectorState:\n // - If a fixture simulation is active, use it (for tool input, tool result, resource URL)\n // - Otherwise, use the base simulation for the tool (for resource URL, tool definition)\n const effectiveSimulationName = activeSimulationName ?? selectedToolInfo?.simNames[0] ?? '';\n\n // Derive the current simulation directly from simulations + effectiveSimulationName.\n // This avoids the one-render lag from the useEffect sync to state.selectedSimulationName.\n const currentSim = simulations[effectiveSimulationName];\n\n const state = useInspectorState({ simulations, defaultHost });\n const [serverUrl, setServerUrl] = React.useState(mcpServerUrl ?? '');\n const [authType, setAuthType] = React.useState<AuthType>('none');\n const [bearerToken, setBearerToken] = React.useState('');\n const [oauthScopes, setOauthScopes] = React.useState('');\n const [oauthClientId, setOauthClientId] = React.useState('');\n const [oauthClientSecret, setOauthClientSecret] = React.useState('');\n const [oauthStatus, setOauthStatus] = React.useState<\n 'none' | 'authorizing' | 'authorized' | 'error'\n >('none');\n const [oauthError, setOauthError] = React.useState<string | undefined>();\n\n // useMcpConnection does a mount-only health check for the initial URL.\n // URL changes are handled below via connection.reconnect().\n // In embedded mode (`app` prop) the Inspector never talks to /__sunpeak/*\n // endpoints — connection state lives in the embedding app's MCP client.\n const connection = useMcpConnection(\n isEmbedded ? undefined : mcpServerUrl || undefined,\n inspectorApiBaseUrl\n );\n const [prodResources, setProdResources] = React.useState(\n state.urlProdResources ?? defaultProdResources\n );\n const showSidebar = state.urlSidebar !== false;\n const showDevOverlay = state.urlDevOverlay !== false;\n const [isRunning, setIsRunning] = React.useState(false);\n const [hasRun, setHasRun] = React.useState(false);\n const [showCheck, setShowCheck] = React.useState(false);\n const [serverPreviewGeneration, setServerPreviewGeneration] = React.useState(0);\n const checkTimerRef = React.useRef<ReturnType<typeof setTimeout>>(undefined);\n const oauthCleanupRef = React.useRef<(() => void) | undefined>(undefined);\n\n // Keep useInspectorState's selection in sync with our tool/simulation selection.\n React.useEffect(() => {\n state.setSelectedSimulationName(effectiveSimulationName);\n }, [effectiveSimulationName]); // eslint-disable-line react-hooks/exhaustive-deps\n\n // Build the current auth config for reconnects\n const currentAuthConfig = React.useMemo<AuthConfig | undefined>(() => {\n if (authType === 'bearer' && bearerToken) {\n return { type: 'bearer', bearerToken };\n }\n if (authType === 'oauth') {\n return { type: 'oauth' };\n }\n return undefined;\n }, [authType, bearerToken]);\n\n // Handle URL changes: when the user edits the server URL, reconnect to the new server.\n // The hook's mount-only health check handles the initial URL — this effect handles changes.\n const prevServerUrlRef = React.useRef(serverUrl);\n React.useEffect(() => {\n const urlChanged = serverUrl !== prevServerUrlRef.current;\n prevServerUrlRef.current = serverUrl;\n if (!urlChanged) return;\n if (serverUrl) {\n // Reset OAuth status when URL changes\n setOauthStatus('none');\n setOauthError(undefined);\n if (authType === 'oauth') {\n // Don't auto-connect for OAuth — user must click Authorize\n return;\n }\n connection.reconnect(serverUrl, currentAuthConfig);\n }\n }, [serverUrl, connection.reconnect, authType, currentAuthConfig]); // eslint-disable-line react-hooks/exhaustive-deps\n\n // OAuth flow handler (disabled in demo mode)\n const handleStartOAuth = React.useCallback(async () => {\n if (!serverUrl || demoMode) return;\n setOauthStatus('authorizing');\n setOauthError(undefined);\n\n // Open a blank popup immediately (synchronous, inside the click handler)\n // so browsers treat it as a user-initiated action and don't block it.\n // We'll navigate it to the auth URL after the server responds.\n const popup = window.open(\n 'about:blank',\n `sunpeak-oauth-${Date.now()}`,\n 'width=600,height=700,popup=yes'\n );\n\n try {\n const endpoint = inspectorApiEndpoint('/__sunpeak/oauth/start', inspectorApiBaseUrl);\n const res = await fetch(endpoint, {\n method: 'POST',\n headers: { 'Content-Type': 'application/json' },\n body: JSON.stringify({\n url: serverUrl,\n scope: oauthScopes || undefined,\n clientId: oauthClientId || undefined,\n clientSecret: oauthClientSecret || undefined,\n }),\n });\n const data = await readInspectorJson<{\n error?: string;\n status?: string;\n authUrl?: string;\n simulations?: Record<string, unknown>;\n }>(res, endpoint);\n if (!res.ok) {\n let message = `OAuth start failed (${res.status})`;\n if (data.error) message = data.error;\n throw new Error(message);\n }\n\n if (data.error) {\n popup?.close();\n setOauthError(data.error);\n setOauthStatus('error');\n return;\n }\n\n if (data.status === 'authorized') {\n // Already authorized (tokens were cached)\n popup?.close();\n setOauthStatus('authorized');\n connection.setConnected(data.simulations);\n return;\n }\n\n if (data.status === 'redirect' && data.authUrl) {\n // Defense in depth: refuse to navigate the popup to anything that\n // isn't a real http(s) URL. The server validates this too, but a\n // `javascript:` URL slipping through here would execute attacker\n // code in the inspector's origin (popup inherits opener origin).\n let parsedAuthUrl: URL | null = null;\n try {\n parsedAuthUrl = new URL(data.authUrl);\n } catch {\n // fall through to error below\n }\n if (\n !parsedAuthUrl ||\n (parsedAuthUrl.protocol !== 'http:' && parsedAuthUrl.protocol !== 'https:')\n ) {\n popup?.close();\n setOauthError('OAuth authorization URL is not a valid http(s) URL.');\n setOauthStatus('error');\n return;\n }\n // Navigate the pre-opened popup to the authorization URL.\n // If the popup was blocked, show an error.\n if (!popup || popup.closed) {\n setOauthError('Popup was blocked. Allow popups for this site and try again.');\n setOauthStatus('error');\n return;\n }\n popup.location.href = parsedAuthUrl.toString();\n\n // Listen for the popup's callback via two channels:\n // 1. postMessage — works when window.opener is available\n // 2. BroadcastChannel — fallback for OAuth providers that set\n // Cross-Origin-Opener-Policy (COOP) which nullifies window.opener\n let checkClosed: ReturnType<typeof setInterval>;\n let bc: BroadcastChannel | undefined;\n const cleanup = () => {\n clearInterval(checkClosed);\n window.removeEventListener('message', handleMessage);\n bc?.close();\n oauthCleanupRef.current = undefined;\n };\n // Store cleanup so it runs on unmount if the popup is still open.\n oauthCleanupRef.current?.();\n oauthCleanupRef.current = cleanup;\n const handleOAuthResult = (result: Record<string, unknown>) => {\n cleanup();\n if (result.error) {\n setOauthError((result.errorDescription || result.error) as string);\n setOauthStatus('error');\n } else if (result.success) {\n setOauthStatus('authorized');\n connection.setConnected(result.simulations as Record<string, unknown> | undefined);\n }\n };\n // Channel 1: postMessage (origin-verified)\n const handleMessage = (event: MessageEvent) => {\n if (event.origin !== window.location.origin) return;\n if (event.data?.type !== 'sunpeak-oauth-callback') return;\n handleOAuthResult(event.data);\n };\n window.addEventListener('message', handleMessage);\n // Channel 2: BroadcastChannel (same-origin by spec, no extra check needed)\n if (typeof BroadcastChannel !== 'undefined') {\n bc = new BroadcastChannel('sunpeak-oauth');\n bc.onmessage = (event) => {\n if (event.data?.type !== 'sunpeak-oauth-callback') return;\n handleOAuthResult(event.data);\n };\n }\n\n // Clean up if popup is closed without completing\n checkClosed = setInterval(() => {\n if (popup?.closed) {\n cleanup();\n // Only reset if still authorizing (not yet completed)\n setOauthStatus((prev) => (prev === 'authorizing' ? 'none' : prev));\n }\n }, 500);\n }\n } catch (err) {\n popup?.close();\n setOauthError(err instanceof Error ? err.message : String(err));\n setOauthStatus('error');\n }\n }, [\n serverUrl,\n oauthScopes,\n oauthClientId,\n oauthClientSecret,\n demoMode,\n connection,\n inspectorApiBaseUrl,\n ]);\n\n // When reconnecting to a new server succeeds, update simulations.\n // Only clear on error after a user-initiated reconnect (URL change), not on the\n // initial health check — so prop-based simulations from fixture files survive\n // a server that happens to be unreachable on mount.\n React.useEffect(() => {\n if (connection.simulations) {\n setSimulations(connection.simulations as Record<string, Simulation>);\n setServerPreviewGeneration((generation) => generation + 1);\n } else if (connection.status === 'error' && connection.hasReconnected) {\n setSimulations({});\n }\n }, [connection.simulations, connection.status, connection.hasReconnected]);\n\n // Sync mock data based on the active simulation selection.\n // - \"None\" (null): clear toolResult so the \"Press Run\" empty state shows.\n // - Simulation selected: restore toolResult from the fixture. This handles the\n // case where effectiveSimulationName didn't change (e.g., None → same fixture),\n // so useInspectorState's internal sync wouldn't re-run.\n const { setToolResult, setToolResultJson, setToolResultError } = state;\n React.useEffect(() => {\n if (activeSimulationName === null) {\n setToolResult(undefined);\n setToolResultJson('');\n setToolResultError('');\n } else {\n const sim = simulations[activeSimulationName];\n const result = (sim?.toolResult as CallToolResult | undefined) ?? undefined;\n setToolResult(result);\n setToolResultJson(result ? JSON.stringify(result, null, 2) : '');\n setToolResultError('');\n }\n }, [\n activeSimulationName,\n effectiveSimulationName,\n simulations,\n setToolResult,\n setToolResultJson,\n setToolResultError,\n ]);\n\n // Reset hasRun and timing when tool or simulation changes.\n React.useEffect(() => {\n setHasRun(false);\n }, [effectiveSimulationName]);\n\n // Cleanup timers and OAuth listeners on unmount\n React.useEffect(\n () => () => {\n clearTimeout(checkTimerRef.current);\n oauthCleanupRef.current?.();\n },\n []\n );\n\n // Run button handler: call the real tool handler with current toolInput.\n // Uses currentSim (derived directly from simulations + effectiveSimulationName)\n // rather than state.selectedSim, which lags one render behind due to the\n // useEffect sync from effectiveSimulationName → state.setSelectedSimulationName.\n const handleRun = React.useCallback(async () => {\n const caller = onCallToolDirect ?? onCallTool;\n const sim = simulations[effectiveSimulationName];\n if (!caller || !sim) return;\n const toolName = sim.tool.name;\n setIsRunning(true);\n const startTime = performance.now();\n try {\n const result = await caller({ name: toolName, arguments: state.toolInput });\n const clientMs = Math.round((performance.now() - startTime) * 10) / 10;\n // Prefer server-reported timing (_meta._sunpeak.requestTimeMs) when available,\n // since it measures actual handler execution. Fall back to client round-trip\n // for non-sunpeak servers that don't include server-side timing.\n const resultMeta = (result as Record<string, unknown>)?._meta as\n | Record<string, unknown>\n | undefined;\n const serverMs = (resultMeta?._sunpeak as Record<string, unknown> | undefined)?.requestTimeMs;\n const durationMs = typeof serverMs === 'number' ? serverMs : clientMs;\n const resultWithTiming = {\n ...result,\n _meta: { ...resultMeta, _sunpeak: { requestTimeMs: durationMs } },\n };\n state.setToolResult(resultWithTiming);\n // Strip _sunpeak timing from the display JSON so the textarea shows the\n // clean result the app would receive. The server may include _meta._sunpeak.\n const displayResult = resultMeta?._sunpeak\n ? (() => {\n const { _sunpeak: _, ...cleanMeta } = resultMeta;\n const clean = { ...result } as Record<string, unknown>;\n clean._meta = Object.keys(cleanMeta).length > 0 ? cleanMeta : undefined;\n if (clean._meta === undefined) delete clean._meta;\n return clean;\n })()\n : result;\n state.setToolResultJson(JSON.stringify(displayResult, null, 2));\n state.setToolResultError('');\n setHasRun(true);\n setShowCheck(true);\n clearTimeout(checkTimerRef.current);\n checkTimerRef.current = setTimeout(() => setShowCheck(false), 2000);\n } catch (err) {\n const durationMs = Math.round((performance.now() - startTime) * 10) / 10;\n const message = err instanceof Error ? err.message : String(err);\n state.setToolResult({\n content: [{ type: 'text', text: `Error: ${message}` }],\n isError: true,\n _meta: { _sunpeak: { requestTimeMs: durationMs } },\n });\n state.setToolResultJson(\n JSON.stringify(\n { content: [{ type: 'text', text: `Error: ${message}` }], isError: true },\n null,\n 2\n )\n );\n setHasRun(true);\n } finally {\n setIsRunning(false);\n }\n }, [onCallTool, onCallToolDirect, simulations, effectiveSimulationName, state]);\n\n // Auto-run: when ?autoRun=true is set (by test fixtures) and no fixture data\n // is active, call the tool immediately with the current toolInput. Interactive\n // users don't set this flag, so browsing tools in the sidebar never triggers\n // an automatic server call. Only fires once on mount.\n const autoRunFired = React.useRef(false);\n React.useEffect(() => {\n if (\n initUrlParams.autoRun &&\n !autoRunFired.current &&\n activeSimulationName === null &&\n (onCallTool || onCallToolDirect)\n ) {\n autoRunFired.current = true;\n handleRun();\n }\n }, [initUrlParams.autoRun, activeSimulationName, onCallTool, onCallToolDirect, handleRun]);\n\n // Resolve the active host shell\n const activeShell = getHostShell(state.activeHost);\n const registeredHosts = getRegisteredHosts();\n const ShellConversation = activeShell?.Conversation;\n\n // Merge host style variables, userAgent, and availableDisplayModes into hostContext.\n const hostContext = React.useMemo(() => {\n const styleVars = activeShell?.styleVariables;\n const userAgent = activeShell?.userAgent;\n const ctx = { ...state.hostContext };\n if (styleVars) {\n (ctx as McpUiHostContext).styles = { variables: styleVars };\n }\n if (userAgent) {\n (ctx as McpUiHostContext).userAgent = userAgent;\n }\n if (activeShell?.availableDisplayModes) {\n (ctx as McpUiHostContext).availableDisplayModes = activeShell.availableDisplayModes;\n }\n return ctx as McpUiHostContext;\n }, [state.hostContext, activeShell]);\n\n // Reset display mode to inline if the active host doesn't support it.\n const { displayMode, setDisplayMode } = state;\n React.useEffect(() => {\n const modes = activeShell?.availableDisplayModes;\n if (modes && !modes.includes(displayMode)) {\n setDisplayMode('inline');\n }\n }, [activeShell, displayMode, setDisplayMode]);\n\n // Apply host theming + CSS variables + page styles to the inspector root.\n // Scoped to the root element (not document.documentElement) so the host page\n // is unaffected when the Inspector is embedded inside another React app.\n // Uses useLayoutEffect so values are set BEFORE paint, preventing a flash\n // of stale colors when switching hosts or toggling theme.\n //\n // Both `styleVariables` (--color-* tokens) and `pageStyles` keys are tracked\n // so they can be removed when switching to a host that doesn't define them.\n // Necessary for third-party HostShells; the two built-in shells happen to\n // define the same set of keys so this would otherwise look like it works\n // by overwriting.\n const prevStyleVarKeysRef = React.useRef<string[]>([]);\n const prevPageStyleKeysRef = React.useRef<string[]>([]);\n React.useLayoutEffect(() => {\n const root = rootRef.current;\n if (!root) return;\n\n // Data attributes — `data-theme` drives the Tailwind `dark` variant via\n // the `@custom-variant` rule in globals.css. `color-scheme` is set so\n // `light-dark()` CSS functions resolve correctly inside the subtree.\n root.setAttribute('data-theme', state.theme);\n root.style.colorScheme = state.theme;\n\n // Style variables (e.g. host-specific --color-* tokens).\n for (const key of prevStyleVarKeysRef.current) {\n root.style.removeProperty(key);\n }\n const vars = activeShell?.styleVariables;\n if (vars) {\n const keys: string[] = [];\n for (const [key, value] of Object.entries(vars)) {\n if (value) {\n root.style.setProperty(key, value);\n keys.push(key);\n }\n }\n prevStyleVarKeysRef.current = keys;\n } else {\n prevStyleVarKeysRef.current = [];\n }\n\n // Page-level style overrides.\n for (const key of prevPageStyleKeysRef.current) {\n root.style.removeProperty(key);\n }\n const pageStyles = activeShell?.pageStyles;\n if (pageStyles) {\n const keys: string[] = [];\n for (const [key, value] of Object.entries(pageStyles)) {\n root.style.setProperty(key, value);\n keys.push(key);\n }\n prevPageStyleKeysRef.current = keys;\n } else {\n prevPageStyleKeysRef.current = [];\n }\n }, [activeShell, state.theme]);\n\n // Inject host font CSS (@font-face rules) so the conversation chrome uses\n // the same font as the real host (e.g., Anthropic Sans for Claude).\n // @font-face rules can't be scoped to a subtree, so this is the one\n // document-level injection the Inspector makes. The font itself is only\n // referenced by host shells inside the Inspector subtree, so the host page\n // sees a defined-but-unused @font-face — harmless.\n React.useLayoutEffect(() => {\n const fontCss = activeShell?.fontCss;\n const id = 'sunpeak-host-fonts';\n const existing = document.getElementById(id);\n if (!fontCss) {\n existing?.remove();\n return;\n }\n if (existing) {\n existing.textContent = fontCss;\n } else {\n const style = document.createElement('style');\n style.id = id;\n style.textContent = fontCss;\n document.head.appendChild(style);\n }\n }, [activeShell]);\n\n // Handle callServerTool from the iframe.\n // When a simulation is active: prefer serverTools mocks, fall back to MCP.\n // When \"None\": always use MCP (real handlers).\n // Uses simulations[activeSimulationName] directly rather than state.selectedSim,\n // which lags one render behind due to the useEffect sync.\n const handleCallTool = React.useCallback(\n (params: {\n name: string;\n arguments?: Record<string, unknown>;\n }): CallToolResult | Promise<CallToolResult> => {\n if (activeSimulationName) {\n const activeSim = simulations[activeSimulationName];\n const mock = activeSim?.serverTools?.[params.name];\n if (mock) {\n const result = resolveServerToolResult(mock, params.arguments);\n if (result) return result;\n }\n }\n if (onCallTool) {\n return onCallTool(params);\n }\n return {\n content: [\n {\n type: 'text',\n text: `[Inspector] Tool \"${params.name}\" called — no serverTools mock found in simulation \"${effectiveSimulationName}\".`,\n },\n ],\n };\n },\n [onCallTool, activeSimulationName, simulations, effectiveSimulationName]\n );\n\n // Derive user message for the conversation shell\n const userMessage = currentSim\n ? (currentSim.userMessage ??\n `Call my ${(currentSim.tool.title as string | undefined) || currentSim.tool.name} tool`)\n : undefined;\n\n // ── Prod resources ──\n const prodResourcesPath = React.useMemo(() => {\n if (!prodResources || !state.selectedSim?.resource) return undefined;\n const name = state.selectedSim.resource.name as string;\n return `/dist/${name}/${name}.html`;\n }, [prodResources, state.selectedSim?.resource]);\n\n const [prodResourcesReady, setProdResourcesReady] = React.useState(false);\n const [prodResourcesGeneration, setProdResourcesGeneration] = React.useState(0);\n const prodResourcesWasReady = React.useRef(false);\n React.useEffect(() => {\n if (!prodResourcesPath) {\n setProdResourcesReady(false);\n prodResourcesWasReady.current = false;\n return;\n }\n let cancelled = false;\n let timer: ReturnType<typeof setTimeout>;\n\n const check = async () => {\n let ok = false;\n try {\n const res = await fetch(prodResourcesPath, { method: 'HEAD' });\n ok = res.ok;\n } catch {\n // network error → not ready\n }\n if (cancelled) return;\n if (ok) {\n if (!prodResourcesWasReady.current) {\n setProdResourcesGeneration((g) => g + 1);\n }\n prodResourcesWasReady.current = true;\n setProdResourcesReady(true);\n } else {\n prodResourcesWasReady.current = false;\n setProdResourcesReady(false);\n }\n timer = setTimeout(check, 1000);\n };\n\n check();\n return () => {\n cancelled = true;\n clearTimeout(timer);\n };\n }, [prodResourcesPath]);\n\n const baseResourceUrl =\n (prodResourcesPath && prodResourcesReady ? prodResourcesPath : undefined) ?? state.resourceUrl;\n // Append devOverlay=false to the resource URL so the server can strip the overlay script\n const effectiveResourceUrl =\n baseResourceUrl && !showDevOverlay\n ? `${baseResourceUrl}${baseResourceUrl.includes('?') ? '&' : '?'}devOverlay=false`\n : baseResourceUrl;\n const prodResourcesLoading = !!prodResourcesPath && !prodResourcesReady;\n\n // ── Content rendering ──\n const hasTools = toolNames.length > 0;\n const hasMockData = activeSimulationName !== null && currentSim?.toolResult != null;\n const showEmptyState = !hasMockData && !hasRun;\n let content: React.ReactNode;\n const iframeBg = 'var(--sim-bg-conversation, var(--color-background-primary, transparent))';\n\n if (!hasTools) {\n const isConnected = connection.status === 'connected';\n const isError = connection.status === 'error';\n content = (\n <div\n className=\"h-full w-full flex items-center justify-center\"\n style={{ background: iframeBg }}\n >\n <span\n className=\"text-sm text-center max-w-xs\"\n style={{ color: 'var(--color-text-secondary)' }}\n >\n {isEmbedded\n ? 'No tools with UI resources in this app'\n : isError\n ? 'Could not connect to MCP server'\n : isConnected\n ? 'No tools with UI resources found on this server'\n : serverUrl\n ? 'Connecting\\u2026'\n : 'Enter an MCP server URL to get started'}\n </span>\n </div>\n );\n } else if (showEmptyState) {\n content = (\n <div\n className=\"h-full w-full flex items-center justify-center\"\n style={{ background: iframeBg }}\n >\n <span className=\"text-sm\" style={{ color: 'var(--color-text-secondary)' }}>\n Press <strong>Run</strong> to call the tool\n </span>\n </div>\n );\n } else if (prodResourcesLoading) {\n content = (\n <div\n className=\"h-full w-full flex items-center justify-center\"\n style={{ background: iframeBg }}\n >\n <span className=\"text-sm\" style={{ color: 'var(--color-text-secondary)' }}>\n Building&hellip;\n </span>\n </div>\n );\n } else if (state.resourceHtml) {\n // Embedded path — caller supplied the resource HTML directly (e.g. from\n // `mcpClient.readResource(...)`). The Inspector forwards it to the\n // sandbox iframe via PostMessage; no URL hosting required.\n content = (\n <div className=\"h-full w-full\" style={{ background: iframeBg }}>\n <IframeResource\n key={`${state.activeHost}-${state.selectedSimulationName}-html`}\n html={state.resourceHtml}\n hostContext={hostContext}\n toolInput={state.toolInput}\n toolResult={state.effectiveToolResult}\n hostOptions={{\n hostInfo: activeShell?.hostInfo,\n hostCapabilities: activeShell?.hostCapabilities,\n onDisplayModeChange: state.handleDisplayModeChange,\n onUpdateModelContext: state.handleUpdateModelContext,\n onCallTool: handleCallTool,\n }}\n permissions={state.permissions}\n prefersBorder={state.prefersBorder}\n onDisplayModeReady={state.handleDisplayModeReady}\n debugInjectState={state.modelContext}\n injectOpenAIRuntime={state.activeHost === 'chatgpt'}\n sandboxUrl={sandboxUrl}\n className=\"h-full w-full\"\n />\n </div>\n );\n } else if (effectiveResourceUrl) {\n content = (\n <div className=\"h-full w-full\" style={{ background: iframeBg }}>\n <IframeResource\n key={`${state.activeHost}-${state.selectedSimulationName}-${effectiveResourceUrl}-${prodResources}-${prodResourcesGeneration}-${serverPreviewGeneration}`}\n src={effectiveResourceUrl}\n hostContext={hostContext}\n toolInput={state.toolInput}\n toolResult={state.effectiveToolResult}\n hostOptions={{\n hostInfo: activeShell?.hostInfo,\n hostCapabilities: activeShell?.hostCapabilities,\n onDisplayModeChange: state.handleDisplayModeChange,\n onUpdateModelContext: state.handleUpdateModelContext,\n onCallTool: handleCallTool,\n }}\n permissions={state.permissions}\n prefersBorder={state.prefersBorder}\n onDisplayModeReady={state.handleDisplayModeReady}\n debugInjectState={state.modelContext}\n injectOpenAIRuntime={state.activeHost === 'chatgpt'}\n sandboxUrl={sandboxUrl}\n className=\"h-full w-full\"\n />\n </div>\n );\n } else if (!prodResources && state.resourceScript) {\n content = (\n <div className=\"h-full w-full\" style={{ background: iframeBg }}>\n <IframeResource\n key={`${state.activeHost}-${state.selectedSimulationName}-${state.resourceScript}`}\n scriptSrc={state.resourceScript}\n hostContext={hostContext}\n toolInput={state.toolInput}\n toolResult={state.effectiveToolResult}\n csp={state.csp}\n hostOptions={{\n hostInfo: activeShell?.hostInfo,\n hostCapabilities: activeShell?.hostCapabilities,\n onDisplayModeChange: state.handleDisplayModeChange,\n onUpdateModelContext: state.handleUpdateModelContext,\n onCallTool: handleCallTool,\n }}\n permissions={state.permissions}\n prefersBorder={state.prefersBorder}\n onDisplayModeReady={state.handleDisplayModeReady}\n debugInjectState={state.modelContext}\n injectOpenAIRuntime={state.activeHost === 'chatgpt'}\n sandboxUrl={sandboxUrl}\n className=\"h-full w-full\"\n />\n </div>\n );\n } else {\n content = children;\n }\n\n // Theme is applied to rootRef directly via useLayoutEffect above. Override\n // ThemeProvider's default (which would set data-theme on documentElement)\n // with a no-op so the embed stays scoped to the Inspector's subtree. The\n // ThemeProvider default behavior is preserved for callers using it outside\n // the bundled Inspector.\n const applyTheme = React.useCallback((_theme: 'light' | 'dark') => {\n // intentionally empty — applied via rootRef useLayoutEffect above\n }, []);\n\n // ── Run button (shown in conversation header when no simulation is active) ──\n // Visible when \"None (call server)\" is selected OR when no fixtures exist for the tool.\n // Hidden in demo mode to prevent sending real MCP requests from embedded contexts.\n const runButton =\n !demoMode && onCallTool && currentSim && activeSimulationName === null ? (\n <button\n type=\"button\"\n onClick={handleRun}\n disabled={isRunning}\n className=\"rounded-full px-3 py-1 text-sm font-medium transition-opacity disabled:opacity-40 flex items-center gap-1.5 cursor-pointer\"\n style={{\n backgroundColor: 'var(--color-text-primary)',\n color: 'var(--color-background-primary)',\n }}\n >\n {showCheck ? (\n <svg\n width=\"12\"\n height=\"12\"\n viewBox=\"0 0 12 12\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <path d=\"M2 6L5 9L10 3\" />\n </svg>\n ) : (\n <svg width=\"10\" height=\"12\" viewBox=\"0 0 10 12\" fill=\"currentColor\">\n <path d=\"M0 0L10 6L0 12V0Z\" />\n </svg>\n )}\n Run\n </button>\n ) : undefined;\n\n const conversationContent = ShellConversation ? (\n <ShellConversation\n screenWidth={state.screenWidth}\n displayMode={state.displayMode}\n platform={state.platform}\n onRequestDisplayMode={state.handleDisplayModeChange}\n appName={appName}\n appIcon={appIcon}\n userMessage={userMessage}\n onContentWidthChange={state.handleContentWidthChange}\n headerAction={runButton}\n >\n {content}\n </ShellConversation>\n ) : (\n content\n );\n\n // Embedded mode: fill the parent container instead of the viewport so the\n // host React app can place the Inspector inside a sized region (a sidebar,\n // a modal, a dashboard panel) without it escaping its container.\n const rootSizing = isEmbedded ? 'h-full w-full' : 'h-screen w-screen';\n\n if (!showSidebar) {\n return (\n <ThemeProvider theme={state.theme} applyTheme={applyTheme}>\n <div ref={rootRef} className={`sunpeak-inspector-root flex ${rootSizing}`}>\n {conversationContent}\n </div>\n </ThemeProvider>\n );\n }\n\n return (\n <ThemeProvider theme={state.theme} applyTheme={applyTheme}>\n <SimpleSidebar\n rootRef={rootRef}\n fillParent={isEmbedded}\n controls={\n <div className=\"space-y-1\">\n {/*\n * MCP Server URL + Authentication only appear in the CLI codepath.\n * When `app` is provided (embedded mode), connection and auth are\n * owned by the embedding application's MCP client.\n */}\n {!isEmbedded && (\n <>\n <SidebarControl\n label={\n <span className=\"flex items-center gap-1.5\">\n MCP Server\n {serverUrl && !demoMode && (\n <span\n className=\"inline-block w-2 h-2 rounded-full\"\n data-testid=\"connection-status\"\n style={{\n backgroundColor:\n connection.status === 'connected'\n ? '#22c55e'\n : connection.status === 'connecting'\n ? '#eab308'\n : connection.status === 'error'\n ? '#ef4444'\n : '#6b7280',\n }}\n title={connection.error ?? connection.status}\n />\n )}\n </span>\n }\n tooltip=\"MCP server URL\"\n data-testid=\"server-url\"\n >\n <SidebarInput\n value={demoMode ? 'http://localhost:8000/mcp' : serverUrl}\n onChange={demoMode ? () => {} : setServerUrl}\n applyOnBlur\n placeholder=\"http://localhost:8000/mcp\"\n disabled={demoMode}\n />\n </SidebarControl>\n\n {/* ── Authentication (hidden in demo mode) ── */}\n {!demoMode && (\n <SidebarCollapsibleControl\n key={`auth-${authType === 'none' ? 'none' : 'active'}`}\n label=\"Authentication\"\n defaultCollapsed={authType === 'none'}\n >\n <div className=\"space-y-1\">\n <SidebarSelect\n value={authType}\n onChange={(value) => {\n const newType = value as AuthType;\n setAuthType(newType);\n setOauthStatus('none');\n setOauthError(undefined);\n // Reconnect without auth when switching to \"none\"\n if (newType === 'none' && serverUrl) {\n connection.reconnect(serverUrl);\n }\n }}\n options={[\n { value: 'none', label: 'None' },\n { value: 'bearer', label: 'Bearer Token' },\n { value: 'oauth', label: 'OAuth' },\n ]}\n />\n\n {authType === 'bearer' && (\n <SidebarInput\n type=\"password\"\n value={bearerToken}\n onChange={(value) => {\n setBearerToken(value);\n // Reconnect with the new token when applied\n if (serverUrl && value) {\n connection.reconnect(serverUrl, {\n type: 'bearer',\n bearerToken: value,\n });\n }\n }}\n applyOnBlur\n placeholder=\"Paste your token\"\n />\n )}\n\n {authType === 'oauth' && (\n <div className=\"space-y-1\">\n <SidebarInput\n value={oauthClientId}\n onChange={setOauthClientId}\n applyOnBlur\n placeholder=\"Client ID (optional)\"\n />\n {oauthClientId && (\n <SidebarInput\n type=\"password\"\n value={oauthClientSecret}\n onChange={setOauthClientSecret}\n applyOnBlur\n placeholder=\"Client Secret (optional)\"\n />\n )}\n <SidebarInput\n value={oauthScopes}\n onChange={setOauthScopes}\n applyOnBlur\n placeholder=\"Scopes (optional)\"\n />\n <button\n type=\"button\"\n onClick={handleStartOAuth}\n disabled={!serverUrl || oauthStatus === 'authorizing'}\n className=\"w-full h-7 text-xs rounded-md px-2 transition-colors cursor-pointer disabled:opacity-50 disabled:cursor-not-allowed\"\n style={{\n backgroundColor:\n oauthStatus === 'authorized'\n ? '#22c55e'\n : 'var(--color-text-primary)',\n color: 'var(--color-background-primary)',\n }}\n >\n {oauthStatus === 'authorizing'\n ? 'Authorizing\\u2026'\n : oauthStatus === 'authorized'\n ? 'Authorized'\n : 'Authorize'}\n </button>\n {oauthError && (\n <div\n className=\"text-[9px]\"\n style={{ color: 'var(--color-text-danger, #dc2626)' }}\n >\n {oauthError}\n </div>\n )}\n </div>\n )}\n </div>\n </SidebarCollapsibleControl>\n )}\n </>\n )}\n\n {/* ── Prod Resources (framework mode only, hidden in demo + embedded modes) ── */}\n {!hideInspectorModes && !demoMode && !isEmbedded && (\n <SidebarCheckbox\n checked={prodResources}\n onChange={setProdResources}\n label=\"Prod Resources\"\n tooltip=\"Load resources from dist/ builds instead of HMR\"\n docsPath=\"app-framework/cli/dev#prod-tools-and-prod-resources-flags\"\n />\n )}\n\n {/* ── Tool + Simulation row ── */}\n {hasTools && (\n <div className=\"grid grid-cols-2 gap-2\" data-testid=\"tool-simulation-row\">\n <SidebarControl\n label=\"Tool\"\n tooltip=\"Tool to inspect\"\n docsPath=\"app-framework/cli/dev\"\n data-testid=\"tool-selector\"\n >\n <SidebarSelect\n value={selectedToolName}\n onChange={(value) => setSelectedToolName(value)}\n options={toolNames.map((name) => {\n const info = toolMap.get(name)!;\n return {\n value: name,\n label: (info.tool.title as string | undefined) || name,\n };\n })}\n />\n </SidebarControl>\n <SidebarControl\n label={\n selectedToolInfo && selectedToolInfo.fixtureSimNames.length > 0 ? (\n 'Simulation'\n ) : (\n <a\n href={`${DOCS_BASE_URL}/testing/simulations`}\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n className=\"no-underline transition-colors\"\n style={{ color: 'var(--color-text-secondary)' }}\n onMouseEnter={(e) => {\n (e.target as HTMLElement).style.color = 'var(--color-text-primary)';\n }}\n onMouseLeave={(e) => {\n (e.target as HTMLElement).style.color = 'var(--color-text-secondary)';\n }}\n >\n Simulation\n </a>\n )\n }\n tooltip={\n selectedToolInfo && selectedToolInfo.fixtureSimNames.length > 0\n ? 'Test fixture with mock data'\n : 'Create simulations for faster testing'\n }\n docsPath=\"testing/simulations\"\n data-testid=\"simulation-selector\"\n >\n <SidebarSelect\n value={activeSimulationName ?? '__none__'}\n onChange={(value) =>\n setActiveSimulationName(value === '__none__' ? null : value)\n }\n options={[\n ...(demoMode\n ? []\n : [\n {\n value: '__none__',\n label:\n selectedToolInfo && selectedToolInfo.fixtureSimNames.length > 0\n ? 'None (call server)'\n : 'None',\n },\n ]),\n ...(selectedToolInfo?.fixtureSimNames ?? []).map((simName) => ({\n value: simName,\n // Prefer the user-facing displayName (set by the\n // `app` prop's flattener) over the internal key.\n label: simulations[simName]?.displayName ?? simName,\n })),\n ]}\n />\n </SidebarControl>\n </div>\n )}\n\n {/* ── Host + Width row ── */}\n <div className=\"grid grid-cols-2 gap-2\">\n {registeredHosts.length > 1 && (\n <SidebarControl\n label=\"Host\"\n tooltip=\"Host runtime to simulate\"\n docsPath=\"app-framework/functions/host-detection\"\n >\n <SidebarSelect\n value={state.activeHost}\n onChange={(value) => state.setActiveHost(value as HostId)}\n options={registeredHosts.map((h) => ({\n value: h.id,\n label: h.label,\n }))}\n />\n </SidebarControl>\n )}\n <SidebarControl label=\"Width\" tooltip=\"Chat width\" docsPath=\"testing/inspector\">\n <SidebarSelect\n value={state.screenWidth}\n onChange={(value) => state.setScreenWidth(value as ScreenWidth)}\n options={[\n { value: 'mobile-s', label: 'Mobile S (375px)' },\n { value: 'mobile-l', label: 'Mobile L (425px)' },\n { value: 'tablet', label: 'Tablet (768px)' },\n { value: 'full', label: '100% (Full)' },\n ]}\n />\n </SidebarControl>\n </div>\n\n <SidebarCollapsibleControl\n label=\"Host Context\"\n defaultCollapsed={false}\n tooltip=\"Host-provided environment\"\n docsPath=\"app-framework/hooks/use-host-context\"\n >\n <div className=\"space-y-1\">\n <div className=\"grid grid-cols-[2fr_1fr] gap-2\">\n <SidebarControl\n label=\"Theme\"\n tooltip=\"Host color theme\"\n docsPath=\"app-framework/hooks/use-theme\"\n >\n <SidebarToggle\n value={state.theme}\n onChange={(value) => state.setTheme(value as McpUiTheme)}\n options={[\n { value: 'light', label: 'Light' },\n { value: 'dark', label: 'Dark' },\n ]}\n />\n </SidebarControl>\n\n <SidebarControl\n label=\"Locale\"\n tooltip=\"BCP 47 language tag\"\n docsPath=\"app-framework/hooks/use-locale\"\n >\n <SidebarInput\n applyOnBlur\n value={state.locale}\n onChange={(value) => state.setLocale(value)}\n placeholder=\"en-US\"\n />\n </SidebarControl>\n </div>\n\n <SidebarControl\n label=\"Display Mode\"\n tooltip=\"Host resource rendering paradigm\"\n docsPath=\"app-framework/hooks/use-display-mode\"\n >\n <SidebarToggle\n value={state.displayMode}\n onChange={(value) => state.setDisplayMode(value as McpUiDisplayMode)}\n options={[\n { value: 'inline', label: 'Inline' },\n { value: 'pip', label: 'PiP' },\n { value: 'fullscreen', label: 'Full' },\n ].filter(\n (opt) =>\n !activeShell?.availableDisplayModes ||\n activeShell.availableDisplayModes.includes(opt.value as McpUiDisplayMode)\n )}\n />\n </SidebarControl>\n\n <div className=\"grid grid-cols-7 gap-2\">\n <div className=\"col-span-3\">\n <SidebarControl\n label=\"Platform\"\n tooltip=\"End user device platform\"\n docsPath=\"app-framework/hooks/use-platform\"\n >\n <SidebarSelect\n value={state.platform}\n onChange={(value) => {\n const p = value as Platform;\n state.setPlatform(p);\n if (p === 'mobile') {\n state.setHover(false);\n state.setTouch(true);\n } else if (p === 'desktop') {\n state.setHover(true);\n state.setTouch(false);\n } else {\n state.setHover(true);\n state.setTouch(false);\n }\n }}\n options={[\n { value: 'mobile', label: 'Mobile' },\n { value: 'desktop', label: 'Desktop' },\n { value: 'web', label: 'Web' },\n ]}\n />\n </SidebarControl>\n </div>\n\n <div className=\"col-span-4\">\n <SidebarControl\n label=\"Capabilities\"\n tooltip=\"End user device capabilities\"\n docsPath=\"app-framework/hooks/use-device-capabilities\"\n >\n <div className=\"flex gap-2\">\n <SidebarCheckbox\n checked={state.hover}\n onChange={state.setHover}\n label=\"Hover\"\n />\n <SidebarCheckbox\n checked={state.touch}\n onChange={state.setTouch}\n label=\"Touch\"\n />\n </div>\n </SidebarControl>\n </div>\n </div>\n\n <SidebarControl\n label=\"Time Zone\"\n tooltip=\"End user IANA time zone\"\n docsPath=\"app-framework/hooks/use-time-zone\"\n >\n <SidebarInput\n applyOnBlur\n value={state.timeZone}\n onChange={(value) => state.setTimeZone(value)}\n placeholder=\"e.g. America/New_York\"\n />\n </SidebarControl>\n\n <SidebarControl\n label=\"Container Dimensions\"\n tooltip=\"Host-enforced size constraints (px)\"\n docsPath=\"app-framework/hooks/use-viewport\"\n >\n <div className=\"grid grid-cols-4 gap-1\">\n <SidebarControl label=\"Height\">\n <SidebarInput\n type=\"number\"\n applyOnBlur\n placeholder=\"-\"\n value={state.containerHeight != null ? String(state.containerHeight) : ''}\n onChange={(value) =>\n state.setContainerHeight(value ? Number(value) : undefined)\n }\n />\n </SidebarControl>\n <SidebarControl label=\"Width\">\n <SidebarInput\n type=\"number\"\n applyOnBlur\n placeholder=\"-\"\n value={state.containerWidth != null ? String(state.containerWidth) : ''}\n onChange={(value) =>\n state.setContainerWidth(value ? Number(value) : undefined)\n }\n />\n </SidebarControl>\n <SidebarControl label=\"Max H\">\n <SidebarInput\n type=\"number\"\n applyOnBlur\n placeholder=\"-\"\n value={\n state.containerMaxHeight != null ? String(state.containerMaxHeight) : ''\n }\n onChange={(value) =>\n state.setContainerMaxHeight(value ? Number(value) : undefined)\n }\n />\n </SidebarControl>\n <SidebarControl label=\"Max W\">\n <SidebarInput\n type=\"number\"\n applyOnBlur\n placeholder={\n state.measuredContentWidth != null\n ? String(state.measuredContentWidth)\n : '-'\n }\n value={\n state.containerMaxWidth != null ? String(state.containerMaxWidth) : ''\n }\n onChange={(value) =>\n state.setContainerMaxWidth(value ? Number(value) : undefined)\n }\n />\n </SidebarControl>\n </div>\n </SidebarControl>\n\n <SidebarControl\n label=\"Safe Area Insets\"\n tooltip=\"Device safe area padding (px)\"\n docsPath=\"app-framework/hooks/use-safe-area\"\n >\n <div className=\"grid grid-cols-4 gap-1\">\n <div className=\"flex items-center gap-0.5\">\n <span\n className=\"text-[10px]\"\n style={{ color: 'var(--color-text-secondary)' }}\n >\n &uarr;\n </span>\n <SidebarInput\n type=\"number\"\n applyOnBlur\n placeholder=\"-\"\n value={state.safeAreaInsets.top ? String(state.safeAreaInsets.top) : ''}\n onChange={(value) =>\n state.setSafeAreaInsets((prev) => ({ ...prev, top: Number(value) || 0 }))\n }\n />\n </div>\n <div className=\"flex items-center gap-0.5\">\n <span\n className=\"text-[10px]\"\n style={{ color: 'var(--color-text-secondary)' }}\n >\n &darr;\n </span>\n <SidebarInput\n type=\"number\"\n applyOnBlur\n placeholder=\"-\"\n value={\n state.safeAreaInsets.bottom ? String(state.safeAreaInsets.bottom) : ''\n }\n onChange={(value) =>\n state.setSafeAreaInsets((prev) => ({\n ...prev,\n bottom: Number(value) || 0,\n }))\n }\n />\n </div>\n <div className=\"flex items-center gap-0.5\">\n <span\n className=\"text-[10px]\"\n style={{ color: 'var(--color-text-secondary)' }}\n >\n &larr;\n </span>\n <SidebarInput\n type=\"number\"\n applyOnBlur\n placeholder=\"-\"\n value={state.safeAreaInsets.left ? String(state.safeAreaInsets.left) : ''}\n onChange={(value) =>\n state.setSafeAreaInsets((prev) => ({ ...prev, left: Number(value) || 0 }))\n }\n />\n </div>\n <div className=\"flex items-center gap-0.5\">\n <span\n className=\"text-[10px]\"\n style={{ color: 'var(--color-text-secondary)' }}\n >\n &rarr;\n </span>\n <SidebarInput\n type=\"number\"\n applyOnBlur\n placeholder=\"-\"\n value={state.safeAreaInsets.right ? String(state.safeAreaInsets.right) : ''}\n onChange={(value) =>\n state.setSafeAreaInsets((prev) => ({\n ...prev,\n right: Number(value) || 0,\n }))\n }\n />\n </div>\n </div>\n </SidebarControl>\n </div>\n </SidebarCollapsibleControl>\n\n <SidebarCollapsibleControl\n label=\"App Context\"\n defaultCollapsed\n tooltip=\"App-provided context shared with the model\"\n docsPath=\"app-framework/hooks/use-app-state\"\n >\n <SidebarTextarea\n value={state.modelContextJson}\n onChange={(json) =>\n state.validateJSON(json, state.setModelContextJson, state.setModelContextError)\n }\n onFocus={() => state.setEditingField('modelContext')}\n onBlur={() =>\n state.commitJSON(state.modelContextJson, state.setModelContextError, (parsed) => {\n state.setModelContext(parsed as Record<string, unknown> | null);\n })\n }\n error={state.modelContextError}\n maxRows={8}\n />\n </SidebarCollapsibleControl>\n\n <SidebarCollapsibleControl\n label=\"Tool Input (JSON)\"\n defaultCollapsed={false}\n tooltip=\"Arguments passed to the tool\"\n docsPath=\"app-framework/hooks/use-tool-data\"\n >\n <SidebarTextarea\n value={state.toolInputJson}\n onChange={(json) =>\n state.validateJSON(json, state.setToolInputJson, state.setToolInputError)\n }\n onFocus={() => state.setEditingField('toolInput')}\n onBlur={() =>\n state.commitJSON(state.toolInputJson, state.setToolInputError, (parsed) =>\n state.setToolInput((parsed as Record<string, unknown>) ?? {})\n )\n }\n error={state.toolInputError}\n maxRows={8}\n />\n </SidebarCollapsibleControl>\n\n <SidebarCollapsibleControl\n label=\"Tool Result (JSON)\"\n defaultCollapsed={false}\n tooltip=\"Structured content returned by the tool\"\n docsPath=\"app-framework/hooks/use-tool-data\"\n data-testid=\"tool-result-section\"\n >\n <SidebarTextarea\n value={state.toolResultJson}\n data-testid=\"tool-result-textarea\"\n onChange={(json) =>\n state.validateJSON(json, state.setToolResultJson, state.setToolResultError)\n }\n onFocus={() => state.setEditingField('toolResult')}\n onBlur={() =>\n state.commitJSON(state.toolResultJson, state.setToolResultError, (parsed) => {\n if (parsed === null) {\n state.setToolResult(undefined);\n } else {\n const result = parsed as Record<string, unknown>;\n if ('content' in result || 'structuredContent' in result) {\n state.setToolResult(\n result as import('@modelcontextprotocol/sdk/types.js').CallToolResult\n );\n } else {\n state.setToolResult({ content: [], structuredContent: result });\n }\n }\n })\n }\n error={state.toolResultError}\n maxRows={8}\n />\n </SidebarCollapsibleControl>\n </div>\n }\n >\n {conversationContent}\n </SimpleSidebar>\n {/* Expose tool result as structured data for test fixtures to read.\n This is the authoritative source — test matchers read from here,\n not from sidebar textarea values. Includes `source` so tests can\n distinguish fixture data from real server responses. */}\n <script\n type=\"application/json\"\n id=\"__tool-result\"\n dangerouslySetInnerHTML={{\n __html: JSON.stringify(\n state.toolResult\n ? { ...state.toolResult, source: activeSimulationName ? 'fixture' : 'server' }\n : null\n ).replace(/</g, '\\\\u003c'),\n }}\n />\n </ThemeProvider>\n );\n}\n"],"x_google_ignoreList":[1,2,10],"mappings":";;;;;;AAYA,IAAa,0BAAuC;CAElD,8BAA8B;CAC9B,gCAAgC;CAChC,+BAA+B;CAC/B,8BAA8B;CAC9B,4BAA4B;CAC5B,2BAA2B;CAC3B,6BAA6B;CAC7B,8BAA8B;CAC9B,8BAA8B;CAC9B,+BAA+B;CAG/B,wBAAwB;CACxB,0BAA0B;CAC1B,yBAAyB;CACzB,wBAAwB;CACxB,sBAAsB;CACtB,qBAAqB;CACrB,uBAAuB;CACvB,wBAAwB;CACxB,wBAAwB;CACxB,yBAAyB;CAGzB,0BAA0B;CAC1B,4BAA4B;CAC5B,2BAA2B;CAC3B,0BAA0B;CAC1B,wBAAwB;CACxB,uBAAuB;CACvB,yBAAyB;CACzB,0BAA0B;CAC1B,0BAA0B;CAC1B,2BAA2B;CAG3B,wBAAwB;CACxB,0BAA0B;CAC1B,wBAAwB;CACxB,qBAAqB;CACrB,uBAAuB;CACvB,wBAAwB;CACxB,wBAAwB;CAG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