hermesbuttons 1.0.0

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,"sources":["../src/index.ts","../src/icons.ts","../src/themes.ts","../src/popup-dialog.ts","../src/hermes-button.ts","../src/hermes-skill-button.ts","../src/structured-data.ts"],"sourcesContent":["export type { Theme, Size, Variant, Shape, HermesButtonOptions, HermesSkillButtonOptions, PopupOptions, ThemeTokens } from './types';\n\nexport { HermesButton, createHermesButton, registerHermesButton } from './hermes-button';\nexport { HermesSkillButton, createHermesSkillButton, registerHermesSkillButton } from './hermes-skill-button';\nexport { HermesPopupDialog, showPopup } from './popup-dialog';\n\nexport { HERMES_ICON, HERMES_SKILL_ICON } from './icons';\nexport { themes, resolveTheme, BRAND_COLOR, ALT_BRAND_COLOR } from './themes';\n\nexport type { ButtonMetadata } from './structured-data';\nexport { discoverButtons, generateStructuredData, injectStructuredData } from './structured-data';\n\nimport { registerHermesButton } from './hermes-button';\nimport { registerHermesSkillButton } from './hermes-skill-button';\n\n/**\n * Manually register all custom elements.\n * Called automatically on import, but exposed for frameworks\n * that need explicit registration timing (Angular, micro-frontends).\n */\nexport function register() {\n registerHermesButton();\n registerHermesSkillButton();\n}\n\nexport type {} from './jsx.d';\n","export const HERMES_ICON = `<svg viewBox=\"0 0 24 24\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\" class=\"hb-icon\">\n <!-- Wing helmet -->\n <path d=\"M12 2C8.5 2 6 4.5 6 7c0 1.5.5 2.8 1.5 3.8L6 14h12l-1.5-3.2C17.5 9.8 18 8.5 18 7c0-2.5-2.5-5-6-5z\" fill=\"currentColor\" opacity=\"0.2\"/>\n <path d=\"M12 2C8.5 2 6 4.5 6 7c0 1.5.5 2.8 1.5 3.8L6 14h12l-1.5-3.2C17.5 9.8 18 8.5 18 7c0-2.5-2.5-5-6-5z\" stroke=\"currentColor\" stroke-width=\"1.5\" fill=\"none\" stroke-linejoin=\"round\"/>\n <!-- Wings -->\n <path d=\"M6 6.5C4.5 5 2 5 2 7s1.5 3 3 3\" stroke=\"currentColor\" stroke-width=\"1.5\" stroke-linecap=\"round\"/>\n <path d=\"M18 6.5C19.5 5 22 5 22 7s-1.5 3-3 3\" stroke=\"currentColor\" stroke-width=\"1.5\" stroke-linecap=\"round\"/>\n <!-- Caduceus staff -->\n <line x1=\"12\" y1=\"14\" x2=\"12\" y2=\"22\" stroke=\"currentColor\" stroke-width=\"1.8\" stroke-linecap=\"round\"/>\n <!-- Snakes -->\n <path d=\"M9.5 16c1.5 1 3.5 1 5 0\" stroke=\"currentColor\" stroke-width=\"1.3\" stroke-linecap=\"round\" fill=\"none\"/>\n <path d=\"M9.5 19c1.5 1 3.5 1 5 0\" stroke=\"currentColor\" stroke-width=\"1.3\" stroke-linecap=\"round\" fill=\"none\"/>\n <!-- Eye -->\n <circle cx=\"12\" cy=\"7.5\" r=\"1.5\" fill=\"currentColor\"/>\n</svg>`;\n\nexport const HERMES_SKILL_ICON = `<svg viewBox=\"0 0 24 24\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\" class=\"hb-icon\">\n <!-- Brain/memory symbol -->\n <path d=\"M12 3C8 3 5 6 5 9c0 2 1 3.5 2 4.5V16a2 2 0 002 2h6a2 2 0 002-2v-2.5c1-1 2-2.5 2-4.5 0-3-3-6-7-6z\" fill=\"currentColor\" opacity=\"0.15\"/>\n <path d=\"M12 3C8 3 5 6 5 9c0 2 1 3.5 2 4.5V16a2 2 0 002 2h6a2 2 0 002-2v-2.5c1-1 2-2.5 2-4.5 0-3-3-6-7-6z\" stroke=\"currentColor\" stroke-width=\"1.5\" fill=\"none\" stroke-linejoin=\"round\"/>\n <!-- Neural connections -->\n <path d=\"M9 9.5c0-1 .5-2 1.5-2.5M15 9.5c0-1-.5-2-1.5-2.5M10.5 11c.5.5 1.5 1 3 0\" stroke=\"currentColor\" stroke-width=\"1.2\" stroke-linecap=\"round\" fill=\"none\"/>\n <!-- Growing roots -->\n <path d=\"M9 18v2M12 18v3M15 18v2\" stroke=\"currentColor\" stroke-width=\"1.5\" stroke-linecap=\"round\"/>\n <!-- Sparkle -->\n <circle cx=\"8\" cy=\"6\" r=\"0.8\" fill=\"currentColor\"/>\n <circle cx=\"16\" cy=\"6\" r=\"0.8\" fill=\"currentColor\"/>\n</svg>`;\n\nexport const COPY_ICON = `<svg viewBox=\"0 0 16 16\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\" class=\"hb-icon-sm\">\n <rect x=\"5\" y=\"5\" width=\"8\" height=\"8\" rx=\"1.5\" stroke=\"currentColor\" stroke-width=\"1.5\" fill=\"none\"/>\n <path d=\"M3 10V3.5A1.5 1.5 0 014.5 2H10\" stroke=\"currentColor\" stroke-width=\"1.5\" stroke-linecap=\"round\"/>\n</svg>`;\n\nexport const CHECK_ICON = `<svg viewBox=\"0 0 16 16\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\" class=\"hb-icon-sm\">\n <path d=\"M3 8.5l3.5 3.5L13 4\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/>\n</svg>`;\n\nexport const DOWNLOAD_ICON = `<svg viewBox=\"0 0 16 16\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\" class=\"hb-icon-sm\">\n <path d=\"M8 2v8m0 0l-3-3m3 3l3-3\" stroke=\"currentColor\" stroke-width=\"1.5\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/>\n <path d=\"M3 12v1.5a1 1 0 001 1h8a1 1 0 001-1V12\" stroke=\"currentColor\" stroke-width=\"1.5\" stroke-linecap=\"round\"/>\n</svg>`;\n\nexport const CLOSE_ICON = `<svg viewBox=\"0 0 16 16\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\" class=\"hb-icon-sm\">\n <path d=\"M4 4l8 8m0-8l-8 8\" stroke=\"currentColor\" stroke-width=\"1.5\" stroke-linecap=\"round\"/>\n</svg>`;\n\nexport const TERMINAL_ICON = `<svg viewBox=\"0 0 16 16\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\" class=\"hb-icon-sm\">\n <rect x=\"1\" y=\"2\" width=\"14\" height=\"12\" rx=\"2\" stroke=\"currentColor\" stroke-width=\"1.5\" fill=\"none\"/>\n <path d=\"M4 6l3 2.5L4 11\" stroke=\"currentColor\" stroke-width=\"1.5\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/>\n <path d=\"M9 11h3\" stroke=\"currentColor\" stroke-width=\"1.5\" stroke-linecap=\"round\"/>\n</svg>`;\n","import type { ThemeTokens, Theme } from './types';\n\nexport const BRAND_COLOR = '#7C3AED';\nexport const BRAND_COLOR_HOVER = '#6D28D9';\nexport const BRAND_COLOR_ACTIVE = '#5B21B6';\n\nexport const ALT_BRAND_COLOR = '#14B8A6';\n\nexport const themes: Record<Exclude<Theme, 'system'>, ThemeTokens> = {\n branded: {\n bg: BRAND_COLOR,\n text: '#FFFFFF',\n border: 'transparent',\n surface: '#FFFFFF',\n surfaceText: '#1A1025',\n muted: '#7C7589',\n primary: BRAND_COLOR,\n primaryText: '#FFFFFF',\n codeBg: '#1A1025',\n codeText: '#F3EEFF',\n },\n 'branded-alt': {\n bg: ALT_BRAND_COLOR,\n text: '#FFFFFF',\n border: 'transparent',\n surface: '#FFFFFF',\n surfaceText: '#1A1025',\n muted: '#7C7589',\n primary: ALT_BRAND_COLOR,\n primaryText: '#FFFFFF',\n codeBg: '#1A1025',\n codeText: '#F3EEFF',\n },\n dark: {\n bg: '#1A1025',\n text: '#F3EEFF',\n border: '#2D2440',\n surface: '#231A35',\n surfaceText: '#F3EEFF',\n muted: '#9F95B0',\n primary: BRAND_COLOR,\n primaryText: '#FFFFFF',\n codeBg: '#0F0A18',\n codeText: '#F3EEFF',\n },\n light: {\n bg: '#FFFFFF',\n text: '#1A1025',\n border: '#E8E0F0',\n surface: '#FAF8FF',\n surfaceText: '#1A1025',\n muted: '#7C7589',\n primary: BRAND_COLOR,\n primaryText: '#FFFFFF',\n codeBg: '#1A1025',\n codeText: '#F3EEFF',\n },\n};\n\nexport function resolveTheme(theme: Theme): ThemeTokens {\n if (theme !== 'system') return themes[theme];\n if (typeof window === 'undefined') return themes.light;\n return window.matchMedia('(prefers-color-scheme: dark)').matches\n ? themes.dark\n : themes.light;\n}\n\nexport function themeToCSS(tokens: ThemeTokens): string {\n return `\n --hb-bg: ${tokens.bg};\n --hb-text: ${tokens.text};\n --hb-border: ${tokens.border};\n --hb-surface: ${tokens.surface};\n --hb-surface-text: ${tokens.surfaceText};\n --hb-muted: ${tokens.muted};\n --hb-primary: ${tokens.primary};\n --hb-primary-text: ${tokens.primaryText};\n --hb-code-bg: ${tokens.codeBg};\n --hb-code-text: ${tokens.codeText};\n `;\n}\n\nexport const SHAPE_MAP = {\n rounded: { sm: '0.375rem', md: '0.5rem', lg: '0.625rem' },\n pill: { sm: '999px', md: '999px', lg: '999px' },\n square: { sm: '0', md: '0', lg: '0' },\n} as const;\n\nexport const SIZE_MAP = {\n sm: { height: '2rem', fontSize: '0.75rem', iconSize: '0.875rem', padding: '0 0.75rem', ccPadding: '0 0.5rem', gap: '0.375rem', radius: '0.375rem' },\n md: { height: '2.5rem', fontSize: '0.875rem', iconSize: '1.125rem', padding: '0 1rem', ccPadding: '0 0.75rem', gap: '0.5rem', radius: '0.5rem' },\n lg: { height: '3rem', fontSize: '1rem', iconSize: '1.375rem', padding: '0 1.25rem', ccPadding: '0 1rem', gap: '0.625rem', radius: '0.625rem' },\n};\n","import type { PopupOptions, ThemeTokens } from './types';\nimport { HERMES_ICON, HERMES_SKILL_ICON, COPY_ICON, CHECK_ICON, CLOSE_ICON } from './icons';\nimport { resolveTheme, themeToCSS, BRAND_COLOR_HOVER } from './themes';\n\nconst POPUP_STYLES = `\n :host {\n position: fixed;\n inset: 0;\n z-index: 999999;\n display: flex;\n align-items: center;\n justify-content: center;\n font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;\n }\n\n * { box-sizing: border-box; margin: 0; padding: 0; }\n\n .hb-backdrop {\n position: absolute;\n inset: 0;\n background: rgba(0, 0, 0, 0.5);\n backdrop-filter: blur(4px);\n -webkit-backdrop-filter: blur(4px);\n animation: hb-fade-in 0.15s ease-out;\n }\n\n .hb-dialog {\n position: relative;\n width: 90%;\n max-width: 460px;\n background: var(--hb-surface);\n color: var(--hb-surface-text);\n border-radius: 16px;\n box-shadow: 0 24px 48px -12px rgba(0, 0, 0, 0.25), 0 0 0 1px var(--hb-border);\n overflow: hidden;\n animation: hb-scale-in 0.2s ease-out;\n }\n\n .hb-dialog-header {\n display: flex;\n align-items: center;\n gap: 12px;\n padding: 20px 24px 16px;\n border-bottom: 1px solid var(--hb-border);\n }\n\n .hb-dialog-header-icon {\n width: 36px;\n height: 36px;\n color: var(--hb-primary);\n flex-shrink: 0;\n }\n\n .hb-dialog-header-text {\n flex: 1;\n min-width: 0;\n }\n\n .hb-dialog-title {\n font-size: 16px;\n font-weight: 600;\n line-height: 1.3;\n color: var(--hb-surface-text);\n }\n\n .hb-dialog-description {\n font-size: 13px;\n color: var(--hb-muted);\n margin-top: 2px;\n line-height: 1.4;\n }\n\n .hb-dialog-close {\n width: 32px;\n height: 32px;\n display: flex;\n align-items: center;\n justify-content: center;\n border: none;\n background: transparent;\n color: var(--hb-muted);\n cursor: pointer;\n border-radius: 8px;\n flex-shrink: 0;\n transition: background 0.15s, color 0.15s;\n }\n\n .hb-dialog-close:hover {\n background: var(--hb-border);\n color: var(--hb-surface-text);\n }\n\n .hb-dialog-close svg { width: 14px; height: 14px; }\n\n .hb-dialog-body { padding: 20px 24px; }\n\n .hb-step {\n display: flex;\n gap: 12px;\n margin-bottom: 16px;\n }\n\n .hb-step:last-child { margin-bottom: 0; }\n\n .hb-step-num {\n width: 24px;\n height: 24px;\n border-radius: 50%;\n background: var(--hb-primary);\n color: var(--hb-primary-text);\n font-size: 12px;\n font-weight: 600;\n display: flex;\n align-items: center;\n justify-content: center;\n flex-shrink: 0;\n margin-top: 1px;\n }\n\n .hb-step-content {\n flex: 1;\n min-width: 0;\n }\n\n .hb-step-label {\n font-size: 13px;\n font-weight: 500;\n color: var(--hb-surface-text);\n margin-bottom: 8px;\n line-height: 1.4;\n }\n\n .hb-code-block {\n display: flex;\n align-items: center;\n background: var(--hb-code-bg);\n color: var(--hb-code-text);\n border-radius: 10px;\n padding: 2px 2px 2px 14px;\n font-family: 'SF Mono', 'Fira Code', 'Cascadia Code', Consolas, 'Liberation Mono', Menlo, monospace;\n font-size: 13px;\n line-height: 1.5;\n gap: 8px;\n overflow: hidden;\n }\n\n .hb-code-text {\n flex: 1;\n overflow-x: auto;\n white-space: nowrap;\n padding: 10px 0;\n scrollbar-width: none;\n }\n\n .hb-code-text::-webkit-scrollbar { display: none; }\n\n .hb-code-prefix {\n color: var(--hb-muted);\n user-select: none;\n margin-right: 6px;\n }\n\n .hb-copy-btn {\n display: flex;\n align-items: center;\n justify-content: center;\n gap: 6px;\n height: 36px;\n min-width: 36px;\n padding: 0 12px;\n border: none;\n background: var(--hb-primary);\n color: var(--hb-primary-text);\n cursor: pointer;\n border-radius: 8px;\n font-family: inherit;\n font-size: 12px;\n font-weight: 500;\n flex-shrink: 0;\n transition: background 0.15s, transform 0.1s;\n white-space: nowrap;\n }\n\n .hb-copy-btn:hover { background: ${BRAND_COLOR_HOVER}; }\n .hb-copy-btn:active { transform: scale(0.96); }\n .hb-copy-btn svg { width: 14px; height: 14px; }\n\n .hb-copy-btn[data-copied=\"true\"] {\n background: #16a34a;\n }\n\n .hb-dialog-footer {\n padding: 16px 24px 20px;\n display: flex;\n flex-direction: column;\n gap: 10px;\n }\n\n .hb-action-btn {\n display: flex;\n align-items: center;\n justify-content: center;\n gap: 8px;\n width: 100%;\n height: 44px;\n border: none;\n background: var(--hb-primary);\n color: var(--hb-primary-text);\n cursor: pointer;\n border-radius: 10px;\n font-family: inherit;\n font-size: 14px;\n font-weight: 600;\n transition: background 0.15s, transform 0.1s;\n }\n\n .hb-action-btn:hover { background: ${BRAND_COLOR_HOVER}; }\n .hb-action-btn:active { transform: scale(0.98); }\n .hb-action-btn svg { width: 16px; height: 16px; }\n\n .hb-hint {\n font-size: 12px;\n color: var(--hb-muted);\n text-align: center;\n line-height: 1.4;\n }\n\n .hb-hint kbd {\n display: inline-block;\n padding: 1px 5px;\n font-family: inherit;\n font-size: 11px;\n background: var(--hb-border);\n border-radius: 4px;\n border: 1px solid var(--hb-border);\n }\n\n @keyframes hb-fade-in {\n from { opacity: 0; }\n to { opacity: 1; }\n }\n\n @keyframes hb-scale-in {\n from { opacity: 0; transform: scale(0.95) translateY(8px); }\n to { opacity: 1; transform: scale(1) translateY(0); }\n }\n\n @media (max-width: 480px) {\n .hb-dialog {\n width: 96%;\n max-width: none;\n border-radius: 14px;\n max-height: 90dvh;\n overflow-y: auto;\n overscroll-behavior: contain;\n }\n\n .hb-dialog-header { padding: 16px 16px 12px; gap: 10px; }\n .hb-dialog-header-icon { width: 28px; height: 28px; }\n .hb-dialog-body { padding: 16px; }\n .hb-dialog-footer { padding: 12px 16px 16px; }\n\n .hb-step { gap: 10px; margin-bottom: 14px; }\n .hb-step-num { width: 22px; height: 22px; font-size: 11px; }\n .hb-step-label { font-size: 12px; margin-bottom: 6px; }\n\n .hb-code-block { font-size: 12px; padding: 2px 2px 2px 10px; border-radius: 8px; }\n .hb-copy-btn { height: 32px; padding: 0 10px; font-size: 11px; border-radius: 6px; }\n .hb-action-btn { height: 40px; font-size: 13px; border-radius: 8px; }\n .hb-hint { font-size: 11px; }\n }\n\n @media (max-width: 360px) {\n .hb-dialog { width: 100%; border-radius: 12px 12px 0 0; align-self: flex-end; }\n .hb-copy-btn span { display: none; }\n .hb-copy-btn { min-width: 32px; padding: 0 8px; }\n }\n\n @supports (padding: env(safe-area-inset-bottom)) {\n .hb-dialog-footer { padding-bottom: calc(20px + env(safe-area-inset-bottom)); }\n }\n`;\n\nexport class HermesPopupDialog extends HTMLElement {\n private _options!: PopupOptions;\n private _mqCleanup: (() => void) | null = null;\n\n constructor() {\n super();\n this.attachShadow({ mode: 'open' });\n }\n\n set options(opts: PopupOptions) {\n this._options = opts;\n this.render();\n }\n\n get options() {\n return this._options;\n }\n\n disconnectedCallback() {\n this._mqCleanup?.();\n this._mqCleanup = null;\n }\n\n private resolvePopupTokens(): ThemeTokens {\n const { theme } = this._options;\n\n if (theme === 'dark' || theme === 'light') return resolveTheme(theme);\n\n const prefersDark = typeof window !== 'undefined'\n && window.matchMedia('(prefers-color-scheme: dark)').matches;\n\n if (theme === 'system') {\n return prefersDark ? resolveTheme('dark') : resolveTheme('light');\n }\n\n const base = prefersDark ? resolveTheme('dark') : resolveTheme('light');\n const brand = resolveTheme(theme);\n return {\n ...base,\n primary: brand.primary,\n primaryText: brand.primaryText,\n };\n }\n\n private render() {\n if (!this.shadowRoot || !this._options) return;\n\n const { variant, title, description, command, fullCommand, skillUrl } = this._options;\n const tokens = this.resolvePopupTokens();\n const icon = variant === 'hermes' ? HERMES_ICON : HERMES_SKILL_ICON;\n\n const isHermesTerminal = variant === 'hermes';\n const displayCommand = fullCommand || command;\n\n this.shadowRoot.innerHTML = `\n <style>${POPUP_STYLES}</style>\n <div style=\"${themeToCSS(tokens)}\">\n <div class=\"hb-backdrop\" data-action=\"close\"></div>\n <div class=\"hb-dialog\" role=\"dialog\" aria-modal=\"true\" aria-labelledby=\"hb-dialog-title\">\n <div class=\"hb-dialog-header\">\n <div class=\"hb-dialog-header-icon\">${icon}</div>\n <div class=\"hb-dialog-header-text\">\n <div class=\"hb-dialog-title\" id=\"hb-dialog-title\">${title}</div>\n ${description ? `<div class=\"hb-dialog-description\">${description}</div>` : ''}\n </div>\n <button class=\"hb-dialog-close\" data-action=\"close\" aria-label=\"Close\">${CLOSE_ICON}</button>\n </div>\n <div class=\"hb-dialog-body\">\n ${isHermesTerminal ? this.renderHermesTerminalBody(displayCommand) : this.renderHermesSkillBody(command, skillUrl)}\n </div>\n <div class=\"hb-dialog-footer\">\n ${isHermesTerminal ? `\n <div class=\"hb-hint\">Press <kbd>⌘</kbd>+<kbd>V</kbd> or <kbd>Ctrl</kbd>+<kbd>V</kbd> in your terminal to run</div>\n ` : `\n <div class=\"hb-hint\">Press <kbd>⌘</kbd>+<kbd>V</kbd> or <kbd>Ctrl</kbd>+<kbd>V</kbd> in your Hermes session to run</div>\n `}\n </div>\n </div>\n </div>\n `;\n\n this.setupListeners();\n this.setupSystemThemeWatch();\n }\n\n private renderHermesTerminalBody(command: string): string {\n return `\n <div class=\"hb-step\">\n <div class=\"hb-step-num\">1</div>\n <div class=\"hb-step-content\">\n <div class=\"hb-step-label\">Copy this command to your clipboard</div>\n <div class=\"hb-code-block\">\n <div class=\"hb-code-text\"><span class=\"hb-code-prefix\">$</span>${this.escapeHtml(command)}</div>\n <button class=\"hb-copy-btn\" data-action=\"copy\" data-command=\"${this.escapeAttr(command)}\">${COPY_ICON}<span>Copy</span></button>\n </div>\n </div>\n </div>\n <div class=\"hb-step\">\n <div class=\"hb-step-num\">2</div>\n <div class=\"hb-step-content\">\n <div class=\"hb-step-label\">Paste and run in your terminal</div>\n </div>\n </div>\n `;\n }\n\n private renderHermesSkillBody(command: string, skillUrl?: string): string {\n let steps = '';\n\n if (skillUrl) {\n const fullPrompt = `Install the skill from ${skillUrl} and run ${command}`;\n steps += `\n <div class=\"hb-step\">\n <div class=\"hb-step-num\">1</div>\n <div class=\"hb-step-content\">\n <div class=\"hb-step-label\">Copy this prompt to your clipboard</div>\n <div class=\"hb-code-block\">\n <div class=\"hb-code-text\">${this.escapeHtml(fullPrompt)}</div>\n <button class=\"hb-copy-btn\" data-action=\"copy\" data-command=\"${this.escapeAttr(fullPrompt)}\">${COPY_ICON}<span>Copy</span></button>\n </div>\n </div>\n </div>\n <div class=\"hb-step\">\n <div class=\"hb-step-num\">2</div>\n <div class=\"hb-step-content\">\n <div class=\"hb-step-label\">Paste into a Hermes session — the agent will fetch the skill and set it up for you</div>\n </div>\n </div>\n `;\n } else {\n steps += `\n <div class=\"hb-step\">\n <div class=\"hb-step-num\">1</div>\n <div class=\"hb-step-content\">\n <div class=\"hb-step-label\">Copy this command to your clipboard</div>\n <div class=\"hb-code-block\">\n <div class=\"hb-code-text\">${this.escapeHtml(command)}</div>\n <button class=\"hb-copy-btn\" data-action=\"copy\" data-command=\"${this.escapeAttr(command)}\">${COPY_ICON}<span>Copy</span></button>\n </div>\n </div>\n </div>\n <div class=\"hb-step\">\n <div class=\"hb-step-num\">2</div>\n <div class=\"hb-step-content\">\n <div class=\"hb-step-label\">Paste and send in your Hermes session</div>\n </div>\n </div>\n `;\n }\n\n return steps;\n }\n\n private setupListeners() {\n if (!this.shadowRoot) return;\n\n this.shadowRoot.addEventListener('click', (e) => {\n const target = (e.target as HTMLElement).closest('[data-action]') as HTMLElement | null;\n if (!target) return;\n\n const action = target.dataset.action;\n\n if (action === 'close') {\n this.close();\n } else if (action === 'copy') {\n const cmd = target.dataset.command || '';\n this.copyToClipboard(cmd, target);\n }\n });\n\n this.shadowRoot.addEventListener('keydown', (e) => {\n if ((e as KeyboardEvent).key === 'Escape') this.close();\n });\n }\n\n private setupSystemThemeWatch() {\n this._mqCleanup?.();\n this._mqCleanup = null;\n\n const theme = this._options.theme;\n const needsWatch = theme === 'system' || theme === 'branded' || theme === 'branded-alt';\n if (!needsWatch || typeof window === 'undefined') return;\n\n const mq = window.matchMedia('(prefers-color-scheme: dark)');\n const handler = () => this.render();\n mq.addEventListener('change', handler);\n this._mqCleanup = () => mq.removeEventListener('change', handler);\n }\n\n private async copyToClipboard(command: string, button: HTMLElement) {\n try {\n await navigator.clipboard.writeText(command);\n const label = button.querySelector('span');\n const iconContainer = button;\n\n button.setAttribute('data-copied', 'true');\n if (label) label.textContent = 'Copied!';\n iconContainer.innerHTML = `${CHECK_ICON}<span>Copied!</span>`;\n\n this._options.onCopy?.(command);\n\n setTimeout(() => {\n button.setAttribute('data-copied', 'false');\n iconContainer.innerHTML = `${COPY_ICON}<span>Copy</span>`;\n }, 2000);\n } catch {\n const textarea = document.createElement('textarea');\n textarea.value = command;\n textarea.style.position = 'fixed';\n textarea.style.opacity = '0';\n document.body.appendChild(textarea);\n textarea.select();\n document.execCommand('copy');\n document.body.removeChild(textarea);\n\n this._options.onCopy?.(command);\n }\n }\n\n close() {\n const dialog = this.shadowRoot?.querySelector('.hb-dialog') as HTMLElement;\n const backdrop = this.shadowRoot?.querySelector('.hb-backdrop') as HTMLElement;\n\n if (dialog) {\n dialog.style.animation = 'hb-scale-in 0.15s ease-in reverse';\n }\n if (backdrop) {\n backdrop.style.animation = 'hb-fade-in 0.15s ease-in reverse';\n }\n\n setTimeout(() => {\n this._options.onClose?.();\n this.remove();\n }, 140);\n }\n\n private escapeHtml(str: string): string {\n const div = document.createElement('div');\n div.textContent = str;\n return div.innerHTML;\n }\n\n private escapeAttr(str: string): string {\n return str.replace(/\"/g, '&quot;').replace(/'/g, '&#39;').replace(/</g, '&lt;').replace(/>/g, '&gt;');\n }\n}\n\nif (typeof customElements !== 'undefined' && !customElements.get('hermes-popup-dialog')) {\n customElements.define('hermes-popup-dialog', HermesPopupDialog);\n}\n\nexport function showPopup(options: PopupOptions): HermesPopupDialog {\n const popup = document.createElement('hermes-popup-dialog') as HermesPopupDialog;\n popup.options = options;\n document.body.appendChild(popup);\n return popup;\n}\n","import type { HermesButtonOptions, Theme, Size, Variant, Shape } from './types';\nimport { HERMES_ICON } from './icons';\nimport { resolveTheme, themeToCSS, SIZE_MAP, SHAPE_MAP, BRAND_COLOR, BRAND_COLOR_HOVER, BRAND_COLOR_ACTIVE } from './themes';\nimport { showPopup } from './popup-dialog';\n\nconst BUTTON_STYLES = `\n :host {\n display: inline-block;\n vertical-align: middle;\n font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;\n -webkit-tap-highlight-color: transparent;\n }\n\n * { box-sizing: border-box; margin: 0; padding: 0; }\n\n .hb-btn {\n display: inline-flex;\n align-items: center;\n gap: var(--hb-gap);\n height: var(--hb-height);\n min-height: 44px;\n padding: var(--hb-padding);\n border: 1.5px solid var(--hb-border);\n background: var(--hb-bg);\n color: var(--hb-text);\n font-family: inherit;\n font-size: var(--hb-font-size);\n font-weight: 600;\n line-height: 1;\n border-radius: var(--hb-radius);\n cursor: pointer;\n user-select: none;\n white-space: nowrap;\n touch-action: manipulation;\n transition: background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease, transform 0.1s ease, color 0.15s ease;\n text-decoration: none;\n -webkit-font-smoothing: antialiased;\n }\n\n @media (pointer: fine) {\n .hb-btn { min-height: unset; }\n }\n\n /* ─── FILLED ─── */\n\n :host([data-variant=\"filled\"][data-theme=\"branded\"]) .hb-btn,\n :host([data-variant=\"filled\"][data-theme=\"branded-alt\"]) .hb-btn {\n box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);\n }\n :host([data-variant=\"filled\"][data-theme=\"branded\"]) .hb-btn:hover {\n background: ${BRAND_COLOR_HOVER};\n box-shadow: 0 2px 8px rgba(124, 58, 237, 0.35);\n }\n :host([data-variant=\"filled\"][data-theme=\"branded\"]) .hb-btn:active {\n background: ${BRAND_COLOR_ACTIVE};\n transform: scale(0.98);\n }\n :host([data-variant=\"filled\"][data-theme=\"branded-alt\"]) .hb-btn:hover {\n background: #0D9488;\n box-shadow: 0 2px 8px rgba(20, 184, 166, 0.35);\n }\n :host([data-variant=\"filled\"][data-theme=\"branded-alt\"]) .hb-btn:active {\n background: #0F766E;\n transform: scale(0.98);\n }\n\n :host([data-variant=\"filled\"][data-theme=\"dark\"]) .hb-btn {\n box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);\n }\n :host([data-variant=\"filled\"][data-theme=\"dark\"]) .hb-btn:hover {\n background: #292524;\n border-color: #57534E;\n box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);\n }\n :host([data-variant=\"filled\"][data-theme=\"dark\"]) .hb-btn:active {\n background: #1C1917;\n transform: scale(0.98);\n }\n\n :host([data-variant=\"filled\"][data-theme=\"light\"]) .hb-btn {\n box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06), 0 0 0 1px rgba(0, 0, 0, 0.04);\n }\n :host([data-variant=\"filled\"][data-theme=\"light\"]) .hb-btn:hover {\n border-color: #D6D3D1;\n box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);\n }\n :host([data-variant=\"filled\"][data-theme=\"light\"]) .hb-btn:active {\n background: #FAFAF9;\n transform: scale(0.98);\n }\n\n /* ─── OUTLINE ─── */\n\n :host([data-variant=\"outline\"][data-theme=\"branded\"]) .hb-btn {\n background: transparent;\n border-color: ${BRAND_COLOR};\n color: ${BRAND_COLOR};\n }\n :host([data-variant=\"outline\"][data-theme=\"branded\"]) .hb-btn:hover {\n background: rgba(124, 58, 237, 0.08);\n box-shadow: 0 2px 8px rgba(124, 58, 237, 0.15);\n }\n :host([data-variant=\"outline\"][data-theme=\"branded\"]) .hb-btn:active {\n background: rgba(124, 58, 237, 0.14);\n transform: scale(0.98);\n }\n\n :host([data-variant=\"outline\"][data-theme=\"branded-alt\"]) .hb-btn {\n background: transparent;\n border-color: #14B8A6;\n color: #14B8A6;\n }\n :host([data-variant=\"outline\"][data-theme=\"branded-alt\"]) .hb-btn:hover {\n background: rgba(20, 184, 166, 0.08);\n box-shadow: 0 2px 8px rgba(20, 184, 166, 0.15);\n }\n :host([data-variant=\"outline\"][data-theme=\"branded-alt\"]) .hb-btn:active {\n background: rgba(20, 184, 166, 0.14);\n transform: scale(0.98);\n }\n\n :host([data-variant=\"outline\"][data-theme=\"dark\"]) .hb-btn {\n background: transparent;\n border-color: #57534E;\n color: #F5F0EB;\n }\n :host([data-variant=\"outline\"][data-theme=\"dark\"]) .hb-btn:hover {\n border-color: ${BRAND_COLOR};\n background: rgba(124, 58, 237, 0.08);\n }\n :host([data-variant=\"outline\"][data-theme=\"dark\"]) .hb-btn:active {\n background: rgba(124, 58, 237, 0.14);\n transform: scale(0.98);\n }\n\n :host([data-variant=\"outline\"][data-theme=\"light\"]) .hb-btn {\n background: transparent;\n border-color: #D6D3D1;\n color: #1C1917;\n }\n :host([data-variant=\"outline\"][data-theme=\"light\"]) .hb-btn:hover {\n border-color: ${BRAND_COLOR};\n background: rgba(124, 58, 237, 0.05);\n }\n :host([data-variant=\"outline\"][data-theme=\"light\"]) .hb-btn:active {\n background: rgba(124, 58, 237, 0.1);\n transform: scale(0.98);\n }\n\n /* ─── GHOST ─── */\n\n :host([data-variant=\"ghost\"]) .hb-btn {\n background: transparent;\n border-color: transparent;\n }\n\n :host([data-variant=\"ghost\"][data-theme=\"branded\"]) .hb-btn {\n color: ${BRAND_COLOR};\n }\n :host([data-variant=\"ghost\"][data-theme=\"branded\"]) .hb-btn:hover {\n background: rgba(124, 58, 237, 0.1);\n }\n :host([data-variant=\"ghost\"][data-theme=\"branded\"]) .hb-btn:active {\n background: rgba(124, 58, 237, 0.16);\n transform: scale(0.98);\n }\n\n :host([data-variant=\"ghost\"][data-theme=\"branded-alt\"]) .hb-btn {\n color: #14B8A6;\n }\n :host([data-variant=\"ghost\"][data-theme=\"branded-alt\"]) .hb-btn:hover {\n background: rgba(20, 184, 166, 0.1);\n }\n :host([data-variant=\"ghost\"][data-theme=\"branded-alt\"]) .hb-btn:active {\n background: rgba(20, 184, 166, 0.16);\n transform: scale(0.98);\n }\n\n :host([data-variant=\"ghost\"][data-theme=\"dark\"]) .hb-btn {\n color: #F5F0EB;\n }\n :host([data-variant=\"ghost\"][data-theme=\"dark\"]) .hb-btn:hover {\n background: rgba(255, 255, 255, 0.06);\n }\n :host([data-variant=\"ghost\"][data-theme=\"dark\"]) .hb-btn:active {\n background: rgba(255, 255, 255, 0.1);\n transform: scale(0.98);\n }\n\n :host([data-variant=\"ghost\"][data-theme=\"light\"]) .hb-btn {\n color: #1C1917;\n }\n :host([data-variant=\"ghost\"][data-theme=\"light\"]) .hb-btn:hover {\n background: rgba(0, 0, 0, 0.04);\n }\n :host([data-variant=\"ghost\"][data-theme=\"light\"]) .hb-btn:active {\n background: rgba(0, 0, 0, 0.08);\n transform: scale(0.98);\n }\n\n /* ─── FOCUS ─── */\n\n .hb-btn:focus-visible {\n outline: 2px solid var(--hb-focus-color, ${BRAND_COLOR});\n outline-offset: 2px;\n }\n\n /* ─── ICON ─── */\n\n .hb-btn-icon {\n width: var(--hb-icon-size);\n height: var(--hb-icon-size);\n flex-shrink: 0;\n display: flex;\n align-items: center;\n justify-content: center;\n }\n\n .hb-btn-icon svg { width: 100%; height: 100%; }\n\n :host([data-variant=\"filled\"][data-theme=\"branded\"]) .hb-btn-icon,\n :host([data-variant=\"filled\"][data-theme=\"branded-alt\"]) .hb-btn-icon {\n color: #FFFFFF;\n --hb-icon-accent: rgba(255,255,255,0.2);\n }\n :host([data-variant=\"filled\"][data-theme=\"dark\"]) .hb-btn-icon {\n color: var(--hb-accent-color, ${BRAND_COLOR});\n }\n :host([data-variant=\"filled\"][data-theme=\"light\"]) .hb-btn-icon {\n color: var(--hb-accent-color, ${BRAND_COLOR});\n }\n\n :host([data-variant=\"outline\"]) .hb-btn-icon,\n :host([data-variant=\"ghost\"]) .hb-btn-icon {\n color: var(--hb-accent-color, ${BRAND_COLOR});\n }\n\n /* ─── LABEL ─── */\n\n .hb-btn-label {\n letter-spacing: -0.01em;\n }\n`;\n\nexport class HermesButton extends HTMLElement {\n static observedAttributes = ['command', 'theme', 'size', 'variant', 'shape', 'popup', 'prompt-flag', 'popup-title', 'popup-description'];\n\n private _options: HermesButtonOptions = {\n command: '',\n theme: 'branded',\n size: 'md',\n variant: 'filled',\n popup: true,\n promptFlag: true,\n };\n\n private _mqCleanup: (() => void) | null = null;\n private _rendered = false;\n\n constructor() {\n super();\n this.attachShadow({ mode: 'open' });\n }\n\n connectedCallback() {\n this.syncFromAttributes();\n this.render();\n this.updateLightDOM();\n }\n\n disconnectedCallback() {\n this._mqCleanup?.();\n this._mqCleanup = null;\n }\n\n attributeChangedCallback() {\n if (!this._rendered) return;\n this.syncFromAttributes();\n this.render();\n this.updateLightDOM();\n }\n\n set options(opts: Partial<HermesButtonOptions>) {\n this._options = { ...this._options, ...opts };\n this.render();\n this.updateLightDOM();\n }\n\n get options() {\n return this._options;\n }\n\n private syncFromAttributes() {\n const command = this.getAttribute('command');\n const theme = this.getAttribute('theme') as Theme | null;\n const size = this.getAttribute('size') as Size | null;\n const variant = this.getAttribute('variant') as Variant | null;\n const shape = this.getAttribute('shape') as Shape | null;\n const popup = this.getAttribute('popup');\n const promptFlag = this.getAttribute('prompt-flag');\n const popupTitle = this.getAttribute('popup-title');\n const popupDescription = this.getAttribute('popup-description');\n\n if (command !== null) this._options.command = command;\n if (theme) this._options.theme = theme;\n if (size) this._options.size = size;\n if (variant) this._options.variant = variant;\n if (shape) this._options.shape = shape;\n if (popup !== null) this._options.popup = popup !== 'false';\n if (promptFlag !== null) this._options.promptFlag = promptFlag !== 'false';\n if (popupTitle !== null) this._options.popupTitle = popupTitle;\n if (popupDescription !== null) this._options.popupDescription = popupDescription;\n }\n\n private updateLightDOM() {\n const { command } = this._options;\n const fullCommand = this.getFullCommand();\n\n this.setAttribute('role', 'button');\n this.setAttribute('tabindex', '0');\n this.setAttribute('aria-label', `Run on Hermes: ${command}`);\n if (this._options.popup !== false) {\n this.setAttribute('aria-haspopup', 'dialog');\n } else {\n this.removeAttribute('aria-haspopup');\n }\n\n let link = this.querySelector('a[data-hb-crawl]') as HTMLAnchorElement | null;\n if (!link) {\n link = document.createElement('a');\n link.setAttribute('data-hb-crawl', '');\n link.setAttribute('aria-hidden', 'true');\n link.style.cssText = 'position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;';\n this.appendChild(link);\n }\n link.href = `https://hermes.ai/run?command=${encodeURIComponent(fullCommand)}`;\n link.textContent = `Run on Hermes: ${command}`;\n link.setAttribute('data-platform', 'hermes');\n link.setAttribute('data-command', command);\n link.setAttribute('data-full-command', fullCommand);\n }\n\n private getResolvedTheme(): Theme {\n return this._options.theme || 'branded';\n }\n\n private getFullCommand(): string {\n const { command, promptFlag } = this._options;\n if (promptFlag === false) return command;\n return `hermes -p \"${command}\"`;\n }\n\n private render() {\n if (!this.shadowRoot) return;\n\n const theme = this.getResolvedTheme();\n const resolvedTheme = theme === 'system' ? (\n typeof window !== 'undefined' && window.matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light'\n ) : theme;\n const variant = this._options.variant || 'filled';\n\n const tokens = resolveTheme(theme);\n const size = this._options.size || 'md';\n const shape = this._options.shape || 'rounded';\n const sizeTokens = SIZE_MAP[size];\n const radius = SHAPE_MAP[shape][size];\n\n this.setAttribute('data-theme', resolvedTheme);\n this.setAttribute('data-variant', variant);\n\n const bgOverride = variant !== 'filled' ? 'transparent' : tokens.bg;\n const borderOverride = variant === 'ghost' ? 'transparent' :\n variant === 'outline' ? tokens.primary : tokens.border;\n const textOverride = variant !== 'filled' ? tokens.primary : tokens.text;\n\n this.shadowRoot.innerHTML = `\n <style>${BUTTON_STYLES}</style>\n <button\n class=\"hb-btn\"\n type=\"button\"\n style=\"\n ${themeToCSS(tokens)}\n --hb-bg: ${bgOverride};\n --hb-border: ${borderOverride};\n --hb-text: ${textOverride};\n --hb-accent-color: ${tokens.primary};\n --hb-focus-color: ${tokens.primary};\n --hb-height: ${sizeTokens.height};\n --hb-font-size: ${sizeTokens.fontSize};\n --hb-icon-size: ${sizeTokens.iconSize};\n --hb-padding: ${sizeTokens.ccPadding};\n --hb-gap: ${sizeTokens.gap};\n --hb-radius: ${radius};\n \"\n aria-label=\"Run on Hermes: ${this._options.command.replace(/\"/g, '&quot;')}\"\n >\n <span class=\"hb-btn-icon\" aria-hidden=\"true\">${HERMES_ICON}</span>\n <span class=\"hb-btn-label\">Run on Hermes</span>\n </button>\n `;\n\n const btn = this.shadowRoot.querySelector('.hb-btn')!;\n btn.addEventListener('click', () => this.handleClick());\n btn.addEventListener('keydown', (e) => {\n if ((e as KeyboardEvent).key === 'Enter' || (e as KeyboardEvent).key === ' ') {\n e.preventDefault();\n this.handleClick();\n }\n });\n this._rendered = true;\n this.setupSystemThemeWatch();\n }\n\n private handleClick() {\n const { popup, command, popupTitle, popupDescription } = this._options;\n const fullCommand = this.getFullCommand();\n\n this.dispatchEvent(new CustomEvent('hb-open', {\n bubbles: true,\n composed: true,\n detail: { command, fullCommand },\n }));\n\n if (popup === false) {\n navigator.clipboard.writeText(fullCommand).then(() => {\n this._options.onCopy?.(fullCommand);\n this.dispatchEvent(new CustomEvent('hb-copy', {\n bubbles: true,\n composed: true,\n detail: { command: fullCommand },\n }));\n });\n return;\n }\n\n showPopup({\n variant: 'hermes',\n theme: this.getResolvedTheme(),\n title: popupTitle || 'Run on Hermes',\n description: popupDescription || 'Execute this command in your terminal to get started with Hermes Agent.',\n command,\n fullCommand,\n onCopy: (cmd: string) => {\n this._options.onCopy?.(cmd);\n this.dispatchEvent(new CustomEvent('hb-copy', {\n bubbles: true,\n composed: true,\n detail: { command: cmd },\n }));\n },\n onClose: () => {\n this.dispatchEvent(new CustomEvent('hb-close', {\n bubbles: true,\n composed: true,\n }));\n },\n });\n }\n\n private setupSystemThemeWatch() {\n this._mqCleanup?.();\n this._mqCleanup = null;\n\n if (this.getResolvedTheme() !== 'system' || typeof window === 'undefined') return;\n\n const mq = window.matchMedia('(prefers-color-scheme: dark)');\n const handler = () => this.render();\n mq.addEventListener('change', handler);\n this._mqCleanup = () => mq.removeEventListener('change', handler);\n }\n}\n\nexport function registerHermesButton(tagName = 'hermes-button') {\n if (typeof customElements === 'undefined') return;\n if (!customElements.get(tagName)) {\n customElements.define(tagName, HermesButton);\n }\n}\n\nregisterHermesButton();\n\nexport function createHermesButton(options: HermesButtonOptions): HermesButton {\n const el = document.createElement('hermes-button') as HermesButton;\n el.options = options;\n return el;\n}\n","import type { HermesSkillButtonOptions, Theme, Size, Variant, Shape } from './types';\nimport { HERMES_SKILL_ICON } from './icons';\nimport { resolveTheme, themeToCSS, SIZE_MAP, SHAPE_MAP, BRAND_COLOR, BRAND_COLOR_HOVER, BRAND_COLOR_ACTIVE } from './themes';\nimport { showPopup } from './popup-dialog';\n\nconst BUTTON_STYLES = `\n :host {\n display: inline-block;\n vertical-align: middle;\n font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;\n -webkit-tap-highlight-color: transparent;\n }\n\n * { box-sizing: border-box; margin: 0; padding: 0; }\n\n .hb-btn {\n display: inline-flex;\n align-items: center;\n gap: var(--hb-gap);\n height: var(--hb-height);\n min-height: 44px;\n padding: var(--hb-padding);\n border: 1.5px solid var(--hb-border);\n background: var(--hb-bg);\n color: var(--hb-text);\n font-family: inherit;\n font-size: var(--hb-font-size);\n font-weight: 600;\n line-height: 1;\n border-radius: var(--hb-radius);\n cursor: pointer;\n user-select: none;\n white-space: nowrap;\n touch-action: manipulation;\n transition: background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease, transform 0.1s ease, color 0.15s ease;\n text-decoration: none;\n -webkit-font-smoothing: antialiased;\n }\n\n @media (pointer: fine) {\n .hb-btn { min-height: unset; }\n }\n\n /* ─── FILLED ─── */\n\n :host([data-variant=\"filled\"][data-theme=\"branded\"]) .hb-btn,\n :host([data-variant=\"filled\"][data-theme=\"branded-alt\"]) .hb-btn {\n box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);\n }\n :host([data-variant=\"filled\"][data-theme=\"branded\"]) .hb-btn:hover {\n background: ${BRAND_COLOR_HOVER};\n box-shadow: 0 2px 8px rgba(124, 58, 237, 0.35);\n }\n :host([data-variant=\"filled\"][data-theme=\"branded\"]) .hb-btn:active {\n background: ${BRAND_COLOR_ACTIVE};\n transform: scale(0.98);\n }\n :host([data-variant=\"filled\"][data-theme=\"branded-alt\"]) .hb-btn:hover {\n background: #0D9488;\n box-shadow: 0 2px 8px rgba(20, 184, 166, 0.35);\n }\n :host([data-variant=\"filled\"][data-theme=\"branded-alt\"]) .hb-btn:active {\n background: #0F766E;\n transform: scale(0.98);\n }\n\n :host([data-variant=\"filled\"][data-theme=\"dark\"]) .hb-btn {\n box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);\n }\n :host([data-variant=\"filled\"][data-theme=\"dark\"]) .hb-btn:hover {\n background: #292524;\n border-color: #57534E;\n box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);\n }\n :host([data-variant=\"filled\"][data-theme=\"dark\"]) .hb-btn:active {\n background: #1C1917;\n transform: scale(0.98);\n }\n\n :host([data-variant=\"filled\"][data-theme=\"light\"]) .hb-btn {\n box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06), 0 0 0 1px rgba(0, 0, 0, 0.04);\n }\n :host([data-variant=\"filled\"][data-theme=\"light\"]) .hb-btn:hover {\n border-color: #D6D3D1;\n box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);\n }\n :host([data-variant=\"filled\"][data-theme=\"light\"]) .hb-btn:active {\n background: #FAFAF9;\n transform: scale(0.98);\n }\n\n /* ─── OUTLINE ─── */\n\n :host([data-variant=\"outline\"][data-theme=\"branded\"]) .hb-btn {\n background: transparent;\n border-color: ${BRAND_COLOR};\n color: ${BRAND_COLOR};\n }\n :host([data-variant=\"outline\"][data-theme=\"branded\"]) .hb-btn:hover {\n background: rgba(124, 58, 237, 0.08);\n box-shadow: 0 2px 8px rgba(124, 58, 237, 0.15);\n }\n :host([data-variant=\"outline\"][data-theme=\"branded\"]) .hb-btn:active {\n background: rgba(124, 58, 237, 0.14);\n transform: scale(0.98);\n }\n\n :host([data-variant=\"outline\"][data-theme=\"branded-alt\"]) .hb-btn {\n background: transparent;\n border-color: #14B8A6;\n color: #14B8A6;\n }\n :host([data-variant=\"outline\"][data-theme=\"branded-alt\"]) .hb-btn:hover {\n background: rgba(20, 184, 166, 0.08);\n box-shadow: 0 2px 8px rgba(20, 184, 166, 0.15);\n }\n :host([data-variant=\"outline\"][data-theme=\"branded-alt\"]) .hb-btn:active {\n background: rgba(20, 184, 166, 0.14);\n transform: scale(0.98);\n }\n\n :host([data-variant=\"outline\"][data-theme=\"dark\"]) .hb-btn {\n background: transparent;\n border-color: #57534E;\n color: #F5F0EB;\n }\n :host([data-variant=\"outline\"][data-theme=\"dark\"]) .hb-btn:hover {\n border-color: ${BRAND_COLOR};\n background: rgba(124, 58, 237, 0.08);\n }\n :host([data-variant=\"outline\"][data-theme=\"dark\"]) .hb-btn:active {\n background: rgba(124, 58, 237, 0.14);\n transform: scale(0.98);\n }\n\n :host([data-variant=\"outline\"][data-theme=\"light\"]) .hb-btn {\n background: transparent;\n border-color: #D6D3D1;\n color: #1C1917;\n }\n :host([data-variant=\"outline\"][data-theme=\"light\"]) .hb-btn:hover {\n border-color: ${BRAND_COLOR};\n background: rgba(124, 58, 237, 0.05);\n }\n :host([data-variant=\"outline\"][data-theme=\"light\"]) .hb-btn:active {\n background: rgba(124, 58, 237, 0.1);\n transform: scale(0.98);\n }\n\n /* ─── GHOST ─── */\n\n :host([data-variant=\"ghost\"]) .hb-btn {\n background: transparent;\n border-color: transparent;\n }\n\n :host([data-variant=\"ghost\"][data-theme=\"branded\"]) .hb-btn {\n color: ${BRAND_COLOR};\n }\n :host([data-variant=\"ghost\"][data-theme=\"branded\"]) .hb-btn:hover {\n background: rgba(124, 58, 237, 0.1);\n }\n :host([data-variant=\"ghost\"][data-theme=\"branded\"]) .hb-btn:active {\n background: rgba(124, 58, 237, 0.16);\n transform: scale(0.98);\n }\n\n :host([data-variant=\"ghost\"][data-theme=\"branded-alt\"]) .hb-btn {\n color: #14B8A6;\n }\n :host([data-variant=\"ghost\"][data-theme=\"branded-alt\"]) .hb-btn:hover {\n background: rgba(20, 184, 166, 0.1);\n }\n :host([data-variant=\"ghost\"][data-theme=\"branded-alt\"]) .hb-btn:active {\n background: rgba(20, 184, 166, 0.16);\n transform: scale(0.98);\n }\n\n :host([data-variant=\"ghost\"][data-theme=\"dark\"]) .hb-btn {\n color: #F5F0EB;\n }\n :host([data-variant=\"ghost\"][data-theme=\"dark\"]) .hb-btn:hover {\n background: rgba(255, 255, 255, 0.06);\n }\n :host([data-variant=\"ghost\"][data-theme=\"dark\"]) .hb-btn:active {\n background: rgba(255, 255, 255, 0.1);\n transform: scale(0.98);\n }\n\n :host([data-variant=\"ghost\"][data-theme=\"light\"]) .hb-btn {\n color: #1C1917;\n }\n :host([data-variant=\"ghost\"][data-theme=\"light\"]) .hb-btn:hover {\n background: rgba(0, 0, 0, 0.04);\n }\n :host([data-variant=\"ghost\"][data-theme=\"light\"]) .hb-btn:active {\n background: rgba(0, 0, 0, 0.08);\n transform: scale(0.98);\n }\n\n /* ─── FOCUS ─── */\n\n .hb-btn:focus-visible {\n outline: 2px solid var(--hb-focus-color, ${BRAND_COLOR});\n outline-offset: 2px;\n }\n\n /* ─── ICON ─── */\n\n .hb-btn-icon {\n width: var(--hb-icon-size);\n height: var(--hb-icon-size);\n flex-shrink: 0;\n display: flex;\n align-items: center;\n justify-content: center;\n }\n\n .hb-btn-icon svg { width: 100%; height: 100%; }\n\n :host([data-variant=\"filled\"][data-theme=\"branded\"]) .hb-btn-icon,\n :host([data-variant=\"filled\"][data-theme=\"branded-alt\"]) .hb-btn-icon {\n color: #FFFFFF;\n --hb-icon-accent: rgba(255,255,255,0.2);\n }\n :host([data-variant=\"filled\"][data-theme=\"dark\"]) .hb-btn-icon {\n color: var(--hb-accent-color, ${BRAND_COLOR});\n }\n :host([data-variant=\"filled\"][data-theme=\"light\"]) .hb-btn-icon {\n color: var(--hb-accent-color, ${BRAND_COLOR});\n }\n\n :host([data-variant=\"outline\"]) .hb-btn-icon,\n :host([data-variant=\"ghost\"]) .hb-btn-icon {\n color: var(--hb-accent-color, ${BRAND_COLOR});\n }\n\n /* ─── LABEL ─── */\n\n .hb-btn-label {\n letter-spacing: -0.01em;\n }\n`;\n\nexport class HermesSkillButton extends HTMLElement {\n static observedAttributes = ['command', 'skill-url', 'theme', 'size', 'variant', 'shape', 'popup', 'popup-title', 'popup-description'];\n\n private _options: HermesSkillButtonOptions = {\n command: '',\n theme: 'branded',\n size: 'md',\n variant: 'filled',\n popup: true,\n };\n\n private _mqCleanup: (() => void) | null = null;\n private _rendered = false;\n\n constructor() {\n super();\n this.attachShadow({ mode: 'open' });\n }\n\n connectedCallback() {\n this.syncFromAttributes();\n this.render();\n this.updateLightDOM();\n }\n\n disconnectedCallback() {\n this._mqCleanup?.();\n this._mqCleanup = null;\n }\n\n attributeChangedCallback() {\n if (!this._rendered) return;\n this.syncFromAttributes();\n this.render();\n this.updateLightDOM();\n }\n\n set options(opts: Partial<HermesSkillButtonOptions>) {\n this._options = { ...this._options, ...opts };\n this.render();\n this.updateLightDOM();\n }\n\n get options() {\n return this._options;\n }\n\n private syncFromAttributes() {\n const command = this.getAttribute('command');\n const skillUrl = this.getAttribute('skill-url');\n const theme = this.getAttribute('theme') as Theme | null;\n const size = this.getAttribute('size') as Size | null;\n const variant = this.getAttribute('variant') as Variant | null;\n const shape = this.getAttribute('shape') as Shape | null;\n const popup = this.getAttribute('popup');\n const popupTitle = this.getAttribute('popup-title');\n const popupDescription = this.getAttribute('popup-description');\n\n if (command !== null) this._options.command = command;\n if (skillUrl !== null) this._options.skillUrl = skillUrl;\n if (theme) this._options.theme = theme;\n if (size) this._options.size = size;\n if (variant) this._options.variant = variant;\n if (shape) this._options.shape = shape;\n if (popup !== null) this._options.popup = popup !== 'false';\n if (popupTitle !== null) this._options.popupTitle = popupTitle;\n if (popupDescription !== null) this._options.popupDescription = popupDescription;\n }\n\n private updateLightDOM() {\n const { command, skillUrl } = this._options;\n\n this.setAttribute('role', 'button');\n this.setAttribute('tabindex', '0');\n this.setAttribute('aria-label', `Run on Hermes Skills: ${command}`);\n if (this._options.popup !== false) {\n this.setAttribute('aria-haspopup', 'dialog');\n } else {\n this.removeAttribute('aria-haspopup');\n }\n\n let link = this.querySelector('a[data-hb-crawl]') as HTMLAnchorElement | null;\n if (!link) {\n link = document.createElement('a');\n link.setAttribute('data-hb-crawl', '');\n link.setAttribute('aria-hidden', 'true');\n link.style.cssText = 'position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;';\n this.appendChild(link);\n }\n link.textContent = `Run on Hermes Skills: ${command}`;\n link.setAttribute('data-platform', 'hermes-skill');\n link.setAttribute('data-command', command);\n if (skillUrl) {\n link.href = skillUrl;\n link.setAttribute('data-skill-url', skillUrl);\n } else {\n link.href = `https://hermes.ai/skills?command=${encodeURIComponent(command)}`;\n link.removeAttribute('data-skill-url');\n }\n }\n\n private getResolvedTheme(): Theme {\n return this._options.theme || 'branded';\n }\n\n private render() {\n if (!this.shadowRoot) return;\n\n const theme = this.getResolvedTheme();\n const resolvedTheme = theme === 'system' ? (\n typeof window !== 'undefined' && window.matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light'\n ) : theme;\n const variant = this._options.variant || 'filled';\n\n const tokens = resolveTheme(theme);\n const size = this._options.size || 'md';\n const shape = this._options.shape || 'rounded';\n const sizeTokens = SIZE_MAP[size];\n const radius = SHAPE_MAP[shape][size];\n\n this.setAttribute('data-theme', resolvedTheme);\n this.setAttribute('data-variant', variant);\n\n const bgOverride = variant !== 'filled' ? 'transparent' : tokens.bg;\n const borderOverride = variant === 'ghost' ? 'transparent' :\n variant === 'outline' ? tokens.primary : tokens.border;\n const textOverride = variant !== 'filled' ? tokens.primary : tokens.text;\n\n this.shadowRoot.innerHTML = `\n <style>${BUTTON_STYLES}</style>\n <button\n class=\"hb-btn\"\n type=\"button\"\n style=\"\n ${themeToCSS(tokens)}\n --hb-bg: ${bgOverride};\n --hb-border: ${borderOverride};\n --hb-text: ${textOverride};\n --hb-accent-color: ${tokens.primary};\n --hb-focus-color: ${tokens.primary};\n --hb-height: ${sizeTokens.height};\n --hb-font-size: ${sizeTokens.fontSize};\n --hb-icon-size: ${sizeTokens.iconSize};\n --hb-padding: ${sizeTokens.padding};\n --hb-gap: ${sizeTokens.gap};\n --hb-radius: ${radius};\n \"\n aria-label=\"Run on Hermes Skills: ${this._options.command.replace(/\"/g, '&quot;')}\"\n >\n <span class=\"hb-btn-icon\" aria-hidden=\"true\">${HERMES_SKILL_ICON}</span>\n <span class=\"hb-btn-label\">Run on Hermes Skills</span>\n </button>\n `;\n\n const btn = this.shadowRoot.querySelector('.hb-btn')!;\n btn.addEventListener('click', () => this.handleClick());\n btn.addEventListener('keydown', (e) => {\n if ((e as KeyboardEvent).key === 'Enter' || (e as KeyboardEvent).key === ' ') {\n e.preventDefault();\n this.handleClick();\n }\n });\n this._rendered = true;\n this.setupSystemThemeWatch();\n }\n\n private handleClick() {\n const { popup, command, skillUrl, popupTitle, popupDescription } = this._options;\n\n this.dispatchEvent(new CustomEvent('hb-open', {\n bubbles: true,\n composed: true,\n detail: { command },\n }));\n\n if (popup === false) {\n navigator.clipboard.writeText(command).then(() => {\n this._options.onCopy?.(command);\n this.dispatchEvent(new CustomEvent('hb-copy', {\n bubbles: true,\n composed: true,\n detail: { command },\n }));\n });\n return;\n }\n\n showPopup({\n variant: 'hermes-skill',\n theme: this.getResolvedTheme(),\n title: popupTitle || 'Run on Hermes Skills',\n description: popupDescription || 'Copy and paste into a Hermes session to get started.',\n command,\n skillUrl,\n onCopy: (cmd) => {\n this._options.onCopy?.(cmd);\n this.dispatchEvent(new CustomEvent('hb-copy', {\n bubbles: true,\n composed: true,\n detail: { command: cmd },\n }));\n },\n onClose: () => {\n this.dispatchEvent(new CustomEvent('hb-close', {\n bubbles: true,\n composed: true,\n }));\n },\n });\n }\n\n private setupSystemThemeWatch() {\n this._mqCleanup?.();\n this._mqCleanup = null;\n\n if (this.getResolvedTheme() !== 'system' || typeof window === 'undefined') return;\n\n const mq = window.matchMedia('(prefers-color-scheme: dark)');\n const handler = () => this.render();\n mq.addEventListener('change', handler);\n this._mqCleanup = () => mq.removeEventListener('change', handler);\n }\n}\n\nexport function registerHermesSkillButton(tagName = 'hermes-skill-button') {\n if (typeof customElements === 'undefined') return;\n if (!customElements.get(tagName)) {\n customElements.define(tagName, HermesSkillButton);\n }\n}\n\nregisterHermesSkillButton();\n\nexport function createHermesSkillButton(options: HermesSkillButtonOptions): HermesSkillButton {\n const el = document.createElement('hermes-skill-button') as HermesSkillButton;\n el.options = options;\n return el;\n}\n","/**\n * Generates JSON-LD structured data for all hermesbuttons on the page.\n *\n * Crawlers and AI agents can use this to discover skills and commands\n * without executing JavaScript — call this after buttons are rendered\n * and inject the result into a <script type=\"application/ld+json\"> tag.\n */\nexport interface ButtonMetadata {\n platform: 'hermes' | 'hermes-skill';\n command: string;\n fullCommand?: string;\n skillUrl?: string;\n}\n\nexport function discoverButtons(): ButtonMetadata[] {\n if (typeof document === 'undefined') return [];\n\n const results: ButtonMetadata[] = [];\n\n document.querySelectorAll('hermes-button').forEach((el) => {\n const command = el.getAttribute('command') || '';\n const promptFlag = el.getAttribute('prompt-flag');\n const usePrompt = promptFlag !== 'false';\n const fullCommand = usePrompt ? `hermes -p \"${command}\"` : command;\n\n results.push({\n platform: 'hermes',\n command,\n fullCommand,\n });\n });\n\n document.querySelectorAll('hermes-skill-button').forEach((el) => {\n const command = el.getAttribute('command') || '';\n const skillUrl = el.getAttribute('skill-url') || undefined;\n\n results.push({\n platform: 'hermes-skill',\n command,\n ...(skillUrl && { skillUrl }),\n });\n });\n\n return results;\n}\n\nexport function generateStructuredData(): object {\n const buttons = discoverButtons();\n if (buttons.length === 0) return {};\n\n const actions = buttons.map((btn) => {\n if (btn.platform === 'hermes') {\n return {\n '@type': 'Action',\n name: `Run on Hermes: ${btn.command}`,\n description: btn.command,\n target: {\n '@type': 'EntryPoint',\n urlTemplate: `https://hermes.ai/run?command=${encodeURIComponent(btn.fullCommand || btn.command)}`,\n actionPlatform: 'https://hermes.ai/run',\n },\n object: {\n '@type': 'SoftwareSourceCode',\n runtimePlatform: 'Hermes Agent',\n text: btn.fullCommand || btn.command,\n },\n };\n }\n\n const entry: Record<string, unknown> = {\n '@type': 'EntryPoint',\n actionPlatform: 'https://hermes.ai/skills',\n };\n if (btn.skillUrl) {\n entry.urlTemplate = btn.skillUrl;\n } else {\n entry.urlTemplate = `https://hermes.ai/skills?command=${encodeURIComponent(btn.command)}`;\n }\n\n const action: Record<string, unknown> = {\n '@type': 'Action',\n name: `Run on Hermes Skills: ${btn.command}`,\n description: btn.command,\n target: entry,\n };\n\n if (btn.skillUrl) {\n action.object = {\n '@type': 'SoftwareApplication',\n name: btn.command,\n downloadUrl: btn.skillUrl,\n applicationCategory: 'AI Skill',\n operatingSystem: 'Hermes Agent',\n };\n }\n\n return action;\n });\n\n return {\n '@context': 'https://schema.org',\n '@type': 'WebPage',\n potentialAction: actions,\n };\n}\n\n/**\n * Injects a <script type=\"application/ld+json\"> tag into the document head\n * with structured data for all hermesbuttons on the page.\n *\n * Call after all buttons have been rendered to the DOM.\n */\nexport function injectStructuredData(): void {\n if (typeof document === 'undefined') return;\n\n const existing = document.querySelector('script[data-hermesbuttons-jsonld]');\n if (existing) existing.remove();\n\n const data = generateStructuredData();\n if (!data || !('potentialAction' in data)) return;\n\n const script = document.createElement('script');\n script.type = 'application/ld+json';\n script.setAttribute('data-hermesbuttons-jsonld', '');\n script.textContent = JSON.stringify(data, null, 2);\n document.head.appendChild(script);\n}\n"],"mappings":"icAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,qBAAAE,EAAA,gBAAAC,EAAA,gBAAAC,EAAA,sBAAAC,EAAA,iBAAAC,EAAA,sBAAAC,EAAA,sBAAAC,EAAA,uBAAAC,EAAA,4BAAAC,EAAA,oBAAAC,EAAA,2BAAAC,EAAA,yBAAAC,EAAA,aAAAC,EAAA,yBAAAC,EAAA,8BAAAC,EAAA,iBAAAC,EAAA,cAAAC,EAAA,WAAAC,ICAO,IAAMC,EAAc;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,QAgBdC,EAAoB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,QAapBC,EAAY;AAAA;AAAA;AAAA,QAKZC,EAAa;AAAA;QASnB,IAAMC,EAAa;AAAA;QCzCn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,OAAO,SAAa,IAAa,OAErC,IAAMC,EAAW,SAAS,cAAc,mCAAmC,EACvEA,GAAUA,EAAS,OAAO,EAE9B,IAAMC,EAAOP,EAAuB,EACpC,GAAI,CAACO,GAAQ,EAAE,oBAAqBA,GAAO,OAE3C,IAAMC,EAAS,SAAS,cAAc,QAAQ,EAC9CA,EAAO,KAAO,sBACdA,EAAO,aAAa,4BAA6B,EAAE,EACnDA,EAAO,YAAc,KAAK,UAAUD,EAAM,KAAM,CAAC,EACjD,SAAS,KAAK,YAAYC,CAAM,CAClC,CN1GO,SAASC,GAAW,CACzBC,EAAqB,EACrBC,EAA0B,CAC5B","names":["index_exports","__export","ALT_BRAND_COLOR","BRAND_COLOR","HERMES_ICON","HERMES_SKILL_ICON","HermesButton","HermesPopupDialog","HermesSkillButton","createHermesButton","createHermesSkillButton","discoverButtons","generateStructuredData","injectStructuredData","register","registerHermesButton","registerHermesSkillButton","resolveTheme","showPopup","themes","HERMES_ICON","HERMES_SKILL_ICON","COPY_ICON","CHECK_ICON","CLOSE_ICON","BRAND_COLOR","BRAND_COLOR_HOVER","BRAND_COLOR_ACTIVE","ALT_BRAND_COLOR","themes","resolveTheme","theme","themeToCSS","tokens","SHAPE_MAP","SIZE_MAP","POPUP_STYLES","BRAND_COLOR_HOVER","HermesPopupDialog","opts","theme","resolveTheme","prefersDark","base","brand","variant","title","description","command","fullCommand","skillUrl","tokens","icon","HERMES_ICON","HERMES_SKILL_ICON","isHermesTerminal","displayCommand","themeToCSS","CLOSE_ICON","COPY_ICON","steps","fullPrompt","e","target","action","cmd","mq","handler","button","label","iconContainer","CHECK_ICON","textarea","dialog","backdrop","str","div","showPopup","options","popup","BUTTON_STYLES","BRAND_COLOR_HOVER","BRAND_COLOR_ACTIVE","BRAND_COLOR","HermesButton","opts","command","theme","size","variant","shape","popup","promptFlag","popupTitle","popupDescription","fullCommand","link","resolvedTheme","tokens","resolveTheme","sizeTokens","SIZE_MAP","radius","SHAPE_MAP","bgOverride","borderOverride","textOverride","themeToCSS","HERMES_ICON","btn","e","showPopup","cmd","mq","handler","registerHermesButton","tagName","createHermesButton","options","el","BUTTON_STYLES","BRAND_COLOR_HOVER","BRAND_COLOR_ACTIVE","BRAND_COLOR","HermesSkillButton","opts","command","skillUrl","theme","size","variant","shape","popup","popupTitle","popupDescription","link","resolvedTheme","tokens","resolveTheme","sizeTokens","SIZE_MAP","radius","SHAPE_MAP","bgOverride","borderOverride","textOverride","themeToCSS","HERMES_SKILL_ICON","btn","e","showPopup","cmd","mq","handler","registerHermesSkillButton","tagName","createHermesSkillButton","options","el","discoverButtons","results","el","command","fullCommand","skillUrl","generateStructuredData","buttons","btn","entry","action","injectStructuredData","existing","data","script","register","registerHermesButton","registerHermesSkillButton"]}