@guidekit/vanilla 0.1.0-beta.1 → 0.1.0-beta.2
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.
- package/LICENSE +21 -0
- package/dist/index.cjs +1 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.global.js +1432 -797
- package/dist/index.global.js.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/package.json +34 -11
package/dist/index.js
CHANGED
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/index.ts"],"sourcesContent":["// ---------------------------------------------------------------------------\n// @guidekit/vanilla — Non-React IIFE bundle for script-tag integration\n// ---------------------------------------------------------------------------\n//\n// Provides an imperative API for using GuideKit without React. Users include\n// the script via a <script> tag and interact with the global `GuideKit` object.\n//\n// Usage:\n// <script src=\"https://cdn.jsdelivr.net/npm/@guidekit/vanilla/dist/index.global.js\"></script>\n// <script>\n// GuideKit.init({\n// llm: { provider: 'gemini', apiKey: '...' },\n// agent: { name: 'Guide', greeting: 'Hello!' },\n// });\n// </script>\n// ---------------------------------------------------------------------------\n\nimport { GuideKitCore } from '@guidekit/core';\nimport type {\n GuideKitCoreOptions,\n AgentState,\n GuideKitEvent,\n GuideKitErrorType,\n PageModel,\n HealthCheckResult,\n I18nStrings,\n} from '@guidekit/core';\n\n// ---------------------------------------------------------------------------\n// Widget DOM (lightweight, no React — plain DOM manipulation)\n// ---------------------------------------------------------------------------\n\nconst WIDGET_CSS = /* css */ `\n :host {\n --gk-primary: #6366f1;\n --gk-primary-hover: #4f46e5;\n --gk-bg: #ffffff;\n --gk-bg-secondary: #f8fafc;\n --gk-text: #1e293b;\n --gk-text-secondary: #64748b;\n --gk-border: #e2e8f0;\n --gk-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);\n --gk-radius: 16px;\n --gk-fab-size: 56px;\n --gk-panel-width: 380px;\n --gk-panel-height: 520px;\n --gk-font: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;\n all: initial;\n font-family: var(--gk-font);\n position: fixed;\n z-index: 2147483647;\n bottom: 24px;\n right: 24px;\n }\n @media (prefers-reduced-motion: reduce) {\n *, *::before, *::after {\n animation-duration: 0.01ms !important;\n transition-duration: 0.01ms !important;\n }\n }\n .gk-fab {\n width: var(--gk-fab-size);\n height: var(--gk-fab-size);\n border-radius: 50%;\n border: none;\n background: var(--gk-primary);\n color: #fff;\n cursor: pointer;\n display: flex;\n align-items: center;\n justify-content: center;\n box-shadow: 0 4px 16px rgba(99, 102, 241, 0.35);\n transition: transform 0.2s ease, box-shadow 0.2s ease;\n outline: none;\n }\n .gk-fab:hover {\n background: var(--gk-primary-hover);\n transform: scale(1.05);\n }\n .gk-fab:focus-visible {\n outline: 2px solid var(--gk-primary);\n outline-offset: 3px;\n }\n .gk-fab svg { width: 24px; height: 24px; fill: currentColor; }\n .gk-panel {\n position: absolute;\n bottom: calc(var(--gk-fab-size) + 16px);\n right: 0;\n width: var(--gk-panel-width);\n height: var(--gk-panel-height);\n background: var(--gk-bg);\n border-radius: var(--gk-radius);\n box-shadow: var(--gk-shadow);\n display: flex;\n flex-direction: column;\n overflow: hidden;\n opacity: 0;\n transform: translateY(12px) scale(0.95);\n pointer-events: none;\n transition: opacity 0.2s ease, transform 0.2s ease;\n }\n .gk-panel.gk-open {\n opacity: 1;\n transform: translateY(0) scale(1);\n pointer-events: auto;\n }\n .gk-header {\n display: flex;\n align-items: center;\n justify-content: space-between;\n padding: 16px 20px;\n border-bottom: 1px solid var(--gk-border);\n flex-shrink: 0;\n }\n .gk-header-title {\n font-size: 15px;\n font-weight: 600;\n color: var(--gk-text);\n margin: 0;\n }\n .gk-close-btn {\n width: 28px; height: 28px; border-radius: 8px;\n border: none; background: transparent; color: var(--gk-text-secondary);\n cursor: pointer; display: flex; align-items: center; justify-content: center;\n outline: none;\n }\n .gk-close-btn:hover { background: var(--gk-bg-secondary); color: var(--gk-text); }\n .gk-close-btn:focus-visible { outline: 2px solid var(--gk-primary); outline-offset: -2px; }\n .gk-close-btn svg { width: 16px; height: 16px; fill: currentColor; }\n .gk-transcript {\n flex: 1; overflow-y: auto; padding: 16px 20px;\n display: flex; flex-direction: column; gap: 12px; scroll-behavior: smooth;\n }\n .gk-empty {\n flex: 1; display: flex; flex-direction: column; align-items: center;\n justify-content: center; color: var(--gk-text-secondary); text-align: center;\n padding: 32px 16px; font-size: 13px;\n }\n .gk-msg {\n max-width: 85%; padding: 10px 14px; border-radius: 12px;\n font-size: 14px; line-height: 1.5; word-wrap: break-word; white-space: pre-wrap;\n }\n .gk-msg-user {\n align-self: flex-end; background: var(--gk-primary);\n color: #fff; border-bottom-right-radius: 4px;\n }\n .gk-msg-assistant {\n align-self: flex-start; background: var(--gk-bg-secondary);\n color: var(--gk-text); border-bottom-left-radius: 4px;\n }\n .gk-dots {\n align-self: flex-start; display: flex; gap: 4px; padding: 12px 16px;\n }\n .gk-dot {\n width: 6px; height: 6px; border-radius: 50%; background: var(--gk-text-secondary);\n animation: gk-bounce 1.4s ease-in-out infinite;\n }\n .gk-dot:nth-child(2) { animation-delay: 0.16s; }\n .gk-dot:nth-child(3) { animation-delay: 0.32s; }\n @keyframes gk-bounce {\n 0%, 80%, 100% { transform: translateY(0); }\n 40% { transform: translateY(-6px); }\n }\n .gk-input-area {\n display: flex; align-items: flex-end; gap: 8px;\n padding: 12px 16px; border-top: 1px solid var(--gk-border); flex-shrink: 0;\n }\n .gk-input {\n flex: 1; min-height: 40px; max-height: 120px; padding: 8px 14px;\n border: 1px solid var(--gk-border); border-radius: 12px;\n background: var(--gk-bg); color: var(--gk-text);\n font-family: var(--gk-font); font-size: 14px; line-height: 1.5;\n resize: none; outline: none;\n }\n .gk-input:focus { border-color: var(--gk-primary); box-shadow: 0 0 0 3px rgba(99,102,241,0.15); }\n .gk-send-btn {\n width: 40px; height: 40px; border-radius: 12px; border: none;\n background: var(--gk-primary); color: #fff; cursor: pointer;\n display: flex; align-items: center; justify-content: center; flex-shrink: 0;\n outline: none;\n }\n .gk-send-btn:hover:not(:disabled) { background: var(--gk-primary-hover); }\n .gk-send-btn:disabled { opacity: 0.5; cursor: not-allowed; }\n .gk-send-btn:focus-visible { outline: 2px solid var(--gk-primary); outline-offset: 3px; }\n .gk-send-btn svg { width: 18px; height: 18px; fill: currentColor; }\n @media (hover: none) and (pointer: coarse), (max-width: 768px) {\n :host { bottom: 16px !important; right: 16px !important; }\n .gk-panel {\n position: fixed; bottom: 0; left: 0; right: 0;\n width: 100%; height: 70vh; max-height: 70vh;\n border-radius: var(--gk-radius) var(--gk-radius) 0 0;\n transform: translateY(100%);\n padding-bottom: env(safe-area-inset-bottom, 0px);\n }\n .gk-panel.gk-open { transform: translateY(0); }\n .gk-send-btn, .gk-close-btn { min-width: 44px; min-height: 44px; }\n .gk-input-area { padding-bottom: calc(12px + env(safe-area-inset-bottom, 0px)); }\n }\n @media (forced-colors: active) {\n .gk-fab, .gk-send-btn { border: 2px solid ButtonText; }\n .gk-panel { border: 1px solid ButtonText; }\n }\n`;\n\nconst SVG_CHAT = '<svg viewBox=\"0 0 24 24\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M20 2H4c-1.1 0-2 .9-2 2v18l4-4h14c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2zm0 14H5.17L4 17.17V4h16v12z\"/><path d=\"M7 9h10v2H7zm0-3h10v2H7z\"/></svg>';\nconst SVG_CLOSE = '<svg viewBox=\"0 0 24 24\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z\"/></svg>';\nconst SVG_SEND = '<svg viewBox=\"0 0 24 24\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M2.01 21L23 12 2.01 3 2 10l15 2-15 2z\"/></svg>';\n\n// ---------------------------------------------------------------------------\n// VanillaWidget — renders and manages the chat widget without React\n// ---------------------------------------------------------------------------\n\nclass VanillaWidget {\n private host: HTMLDivElement;\n private shadow: ShadowRoot;\n private panel!: HTMLDivElement;\n private transcript!: HTMLDivElement;\n private emptyState!: HTMLDivElement;\n private dotsEl!: HTMLDivElement;\n private input!: HTMLTextAreaElement;\n private sendBtn!: HTMLButtonElement;\n private fab!: HTMLButtonElement;\n private isOpen = false;\n private isSending = false;\n private core: GuideKitCore;\n\n constructor(core: GuideKitCore) {\n this.core = core;\n\n // Create Shadow DOM host\n this.host = document.createElement('div');\n this.host.id = 'guidekit-widget';\n this.host.style.cssText =\n 'position:fixed;z-index:2147483647;bottom:24px;right:24px;margin:0;padding:0;border:none;background:none;';\n document.body.appendChild(this.host);\n\n this.shadow = this.host.attachShadow({ mode: 'open' });\n\n // Inject styles\n const style = document.createElement('style');\n style.textContent = WIDGET_CSS;\n this.shadow.appendChild(style);\n\n this.buildDOM();\n this.bindEvents();\n }\n\n private buildDOM(): void {\n // Panel\n this.panel = document.createElement('div');\n this.panel.className = 'gk-panel';\n this.panel.setAttribute('role', 'dialog');\n this.panel.setAttribute('aria-label', 'GuideKit Assistant');\n this.panel.setAttribute('aria-hidden', 'true');\n\n // Header\n const header = document.createElement('div');\n header.className = 'gk-header';\n\n const title = document.createElement('div');\n title.className = 'gk-header-title';\n title.textContent = this.t('widgetTitle');\n header.appendChild(title);\n\n const closeBtn = document.createElement('button');\n closeBtn.className = 'gk-close-btn';\n closeBtn.setAttribute('aria-label', this.t('closePanel'));\n closeBtn.innerHTML = SVG_CLOSE;\n closeBtn.addEventListener('click', () => this.togglePanel(false));\n header.appendChild(closeBtn);\n\n this.panel.appendChild(header);\n\n // Transcript\n this.transcript = document.createElement('div');\n this.transcript.className = 'gk-transcript';\n this.transcript.setAttribute('role', 'log');\n this.transcript.setAttribute('aria-live', 'polite');\n\n this.emptyState = document.createElement('div');\n this.emptyState.className = 'gk-empty';\n this.emptyState.textContent = this.t('emptyStateMessage');\n this.transcript.appendChild(this.emptyState);\n\n // Dots indicator (hidden by default)\n this.dotsEl = document.createElement('div');\n this.dotsEl.className = 'gk-dots';\n this.dotsEl.setAttribute('role', 'status');\n this.dotsEl.setAttribute('aria-label', 'Processing');\n this.dotsEl.style.display = 'none';\n for (let i = 0; i < 3; i++) {\n const dot = document.createElement('div');\n dot.className = 'gk-dot';\n this.dotsEl.appendChild(dot);\n }\n this.transcript.appendChild(this.dotsEl);\n\n this.panel.appendChild(this.transcript);\n\n // Input area\n const inputArea = document.createElement('div');\n inputArea.className = 'gk-input-area';\n\n this.input = document.createElement('textarea');\n this.input.className = 'gk-input';\n this.input.placeholder = this.t('inputPlaceholder');\n this.input.setAttribute('aria-label', this.t('sendMessage'));\n this.input.rows = 1;\n inputArea.appendChild(this.input);\n\n this.sendBtn = document.createElement('button');\n this.sendBtn.className = 'gk-send-btn';\n this.sendBtn.setAttribute('aria-label', this.t('sendMessage'));\n this.sendBtn.innerHTML = SVG_SEND;\n inputArea.appendChild(this.sendBtn);\n\n this.panel.appendChild(inputArea);\n this.shadow.appendChild(this.panel);\n\n // FAB\n this.fab = document.createElement('button');\n this.fab.className = 'gk-fab';\n this.fab.setAttribute('aria-label', this.t('openAssistant'));\n this.fab.setAttribute('aria-expanded', 'false');\n this.fab.setAttribute('aria-haspopup', 'dialog');\n this.fab.innerHTML = SVG_CHAT;\n this.shadow.appendChild(this.fab);\n }\n\n private bindEvents(): void {\n this.fab.addEventListener('click', () => this.togglePanel(!this.isOpen));\n\n this.sendBtn.addEventListener('click', () => this.handleSend());\n\n this.input.addEventListener('keydown', (e) => {\n if (e.key === 'Enter' && !e.shiftKey) {\n e.preventDefault();\n this.handleSend();\n }\n if (e.key === 'Escape') {\n this.togglePanel(false);\n this.fab.focus();\n }\n });\n }\n\n private togglePanel(open: boolean): void {\n this.isOpen = open;\n if (open) {\n this.panel.classList.add('gk-open');\n this.panel.setAttribute('aria-hidden', 'false');\n this.fab.setAttribute('aria-expanded', 'true');\n this.fab.innerHTML = SVG_CLOSE;\n this.fab.setAttribute('aria-label', this.t('closeAssistant'));\n setTimeout(() => this.input.focus(), 100);\n } else {\n this.panel.classList.remove('gk-open');\n this.panel.setAttribute('aria-hidden', 'true');\n this.fab.setAttribute('aria-expanded', 'false');\n this.fab.innerHTML = SVG_CHAT;\n this.fab.setAttribute('aria-label', this.t('openAssistant'));\n }\n }\n\n private async handleSend(): Promise<void> {\n const text = this.input.value.trim();\n if (!text || this.isSending) return;\n\n this.isSending = true;\n\n // Hide empty state\n this.emptyState.style.display = 'none';\n\n // Add user message\n this.addMessage('user', text);\n this.input.value = '';\n\n // Show processing dots\n this.dotsEl.style.display = 'flex';\n this.scrollToBottom();\n\n try {\n const response = await this.core.sendText(text);\n this.dotsEl.style.display = 'none';\n this.addMessage('assistant', response);\n } catch (err) {\n this.dotsEl.style.display = 'none';\n const msg = err instanceof Error ? err.message : 'Something went wrong.';\n this.addMessage('assistant', `Error: ${msg}`);\n } finally {\n this.isSending = false;\n }\n }\n\n private addMessage(role: 'user' | 'assistant', content: string): void {\n const el = document.createElement('div');\n el.className = `gk-msg gk-msg-${role}`;\n el.textContent = content;\n // Insert before the dots element\n this.transcript.insertBefore(el, this.dotsEl);\n this.scrollToBottom();\n }\n\n private scrollToBottom(): void {\n this.transcript.scrollTop = this.transcript.scrollHeight;\n }\n\n private t(key: string): string {\n try {\n return this.core.i18n.t(key as keyof I18nStrings) ?? key;\n } catch {\n return key;\n }\n }\n\n destroy(): void {\n this.host.remove();\n }\n}\n\n// ---------------------------------------------------------------------------\n// GuideKitVanilla — imperative wrapper around GuideKitCore\n// ---------------------------------------------------------------------------\n\nexport interface GuideKitVanillaOptions {\n tokenEndpoint?: string;\n stt?: GuideKitCoreOptions['stt'];\n tts?: GuideKitCoreOptions['tts'];\n llm?: GuideKitCoreOptions['llm'];\n agent?: GuideKitCoreOptions['agent'];\n contentMap?: GuideKitCoreOptions['contentMap'];\n options?: GuideKitCoreOptions['options'];\n instanceId?: string;\n rootElement?: HTMLElement;\n /** Disable the built-in widget UI (for headless use). */\n headless?: boolean;\n onError?: (error: GuideKitErrorType) => void;\n onEvent?: (event: GuideKitEvent) => void;\n onReady?: () => void;\n}\n\n/** Singleton state */\nlet _core: GuideKitCore | null = null;\nlet _widget: VanillaWidget | null = null;\nlet _initialized = false;\n\n/**\n * Initialize GuideKit. Must be called before any other methods.\n * Idempotent — calling multiple times is safe (returns existing instance).\n */\nexport async function init(options: GuideKitVanillaOptions): Promise<void> {\n if (_initialized && _core) return;\n\n _core = new GuideKitCore({\n tokenEndpoint: options.tokenEndpoint,\n stt: options.stt,\n tts: options.tts,\n llm: options.llm,\n agent: options.agent,\n contentMap: options.contentMap,\n options: options.options,\n instanceId: options.instanceId,\n rootElement: options.rootElement,\n onError: options.onError,\n onEvent: options.onEvent,\n onReady: options.onReady,\n });\n\n await _core.init();\n\n // Create widget unless headless\n if (!options.headless) {\n _widget = new VanillaWidget(_core);\n }\n\n _initialized = true;\n}\n\n/**\n * Send a text message to the assistant. Returns the response.\n */\nexport async function sendText(message: string): Promise<string> {\n assertInitialized();\n return _core!.sendText(message);\n}\n\n/**\n * Highlight an element on the page.\n */\nexport function highlight(params: {\n sectionId?: string;\n selector?: string;\n tooltip?: string;\n position?: 'top' | 'bottom' | 'left' | 'right' | 'auto';\n}): boolean {\n assertInitialized();\n return _core!.highlight(params);\n}\n\n/** Dismiss the current spotlight highlight. */\nexport function dismissHighlight(): void {\n assertInitialized();\n _core!.dismissHighlight();\n}\n\n/** Smooth scroll to a section by ID. */\nexport function scrollToSection(sectionId: string, offset?: number): void {\n assertInitialized();\n _core!.scrollToSection(sectionId, offset);\n}\n\n/** Start a guided tour. */\nexport function startTour(sectionIds: string[], mode?: 'auto' | 'manual'): void {\n assertInitialized();\n _core!.startTour(sectionIds, mode);\n}\n\n/** Stop the current tour. */\nexport function stopTour(): void {\n assertInitialized();\n _core!.stopTour();\n}\n\n/** Navigate to a URL (same-origin only). */\nexport async function navigate(href: string): Promise<boolean> {\n assertInitialized();\n return _core!.navigate(href);\n}\n\n/** Set developer page context for the LLM. */\nexport function setPageContext(context: Record<string, unknown>): void {\n assertInitialized();\n _core!.setPageContext(context);\n}\n\n/** Register a custom action the LLM can invoke. */\nexport function registerAction(\n actionId: string,\n action: {\n description: string;\n parameters: Record<string, unknown>;\n handler: (params: Record<string, unknown>) => Promise<unknown>;\n },\n): void {\n assertInitialized();\n _core!.registerAction(actionId, action);\n}\n\n/** Start voice input. */\nexport async function startListening(): Promise<void> {\n assertInitialized();\n await _core!.startListening();\n}\n\n/** Stop voice input. */\nexport function stopListening(): void {\n assertInitialized();\n _core!.stopListening();\n}\n\n/** Get current agent state. */\nexport function getAgentState(): AgentState {\n assertInitialized();\n return _core!.agentState;\n}\n\n/** Get current page model. */\nexport function getPageModel(): PageModel | null {\n assertInitialized();\n return _core!.pageModel;\n}\n\n/** Whether the SDK is ready. */\nexport function isReady(): boolean {\n return _core?.isReady ?? false;\n}\n\n/** Get/set quiet mode. */\nexport function getQuietMode(): boolean {\n assertInitialized();\n return _core!.quietMode;\n}\n\nexport function setQuietMode(value: boolean): void {\n assertInitialized();\n _core!.quietMode = value;\n}\n\n/** Check health of all connected services. */\nexport async function checkHealth(): Promise<HealthCheckResult> {\n assertInitialized();\n return _core!.checkHealth();\n}\n\n/** Destroy the instance and clean up. */\nexport async function destroy(): Promise<void> {\n if (_widget) {\n _widget.destroy();\n _widget = null;\n }\n if (_core) {\n await _core.destroy();\n _core = null;\n }\n _initialized = false;\n}\n\n/** Get the underlying GuideKitCore instance (escape hatch). */\nexport function getCore(): GuideKitCore | null {\n return _core;\n}\n\n// ---------------------------------------------------------------------------\n// Internal\n// ---------------------------------------------------------------------------\n\nfunction assertInitialized(): void {\n if (!_core || !_initialized) {\n throw new Error(\n 'GuideKit not initialized. Call GuideKit.init({...}) first.',\n );\n }\n}\n\n// ---------------------------------------------------------------------------\n// Version\n// ---------------------------------------------------------------------------\n\nexport const VERSION = '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AACjD,oBAAkB;AAClB,QAAO,YAAY;AACrB;AAGA,eAAsB,cAA0C;AAC9D,oBAAkB;AAClB,SAAO,MAAO,YAAY;AAC5B;AAGA,eAAsB,UAAyB;AAC7C,MAAI,SAAS;AACX,YAAQ,QAAQ;AAChB,cAAU;AAAA,EACZ;AACA,MAAI,OAAO;AACT,UAAM,MAAM,QAAQ;AACpB,YAAQ;AAAA,EACV;AACA,iBAAe;AACjB;AAGO,SAAS,UAA+B;AAC7C,SAAO;AACT;AAMA,SAAS,oBAA0B;AACjC,MAAI,CAAC,SAAS,CAAC,cAAc;AAC3B,UAAM,IAAI;AAAA,MACR;AAAA,IACF;AAAA,EACF;AACF;AAMO,IAAM,UAAU;","names":[]}
|
|
1
|
+
{"version":3,"sources":["../src/index.ts"],"sourcesContent":["// ---------------------------------------------------------------------------\n// @guidekit/vanilla — Non-React IIFE bundle for script-tag integration\n// ---------------------------------------------------------------------------\n//\n// Provides an imperative API for using GuideKit without React. Users include\n// the script via a <script> tag and interact with the global `GuideKit` object.\n//\n// Usage:\n// <script src=\"https://cdn.jsdelivr.net/npm/@guidekit/vanilla/dist/index.global.js\"></script>\n// <script>\n// GuideKit.init({\n// llm: { provider: 'gemini', apiKey: '...' },\n// agent: { name: 'Guide', greeting: 'Hello!' },\n// });\n// </script>\n// ---------------------------------------------------------------------------\n\nimport { GuideKitCore } from '@guidekit/core';\nimport type {\n GuideKitCoreOptions,\n AgentState,\n GuideKitEvent,\n GuideKitErrorType,\n PageModel,\n HealthCheckResult,\n I18nStrings,\n} from '@guidekit/core';\n\n// ---------------------------------------------------------------------------\n// Widget DOM (lightweight, no React — plain DOM manipulation)\n// ---------------------------------------------------------------------------\n\nconst WIDGET_CSS = /* css */ `\n :host {\n --gk-primary: #6366f1;\n --gk-primary-hover: #4f46e5;\n --gk-bg: #ffffff;\n --gk-bg-secondary: #f8fafc;\n --gk-text: #1e293b;\n --gk-text-secondary: #64748b;\n --gk-border: #e2e8f0;\n --gk-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);\n --gk-radius: 16px;\n --gk-fab-size: 56px;\n --gk-panel-width: 380px;\n --gk-panel-height: 520px;\n --gk-font: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;\n all: initial;\n font-family: var(--gk-font);\n position: fixed;\n z-index: 2147483647;\n bottom: 24px;\n right: 24px;\n }\n @media (prefers-reduced-motion: reduce) {\n *, *::before, *::after {\n animation-duration: 0.01ms !important;\n transition-duration: 0.01ms !important;\n }\n }\n .gk-fab {\n width: var(--gk-fab-size);\n height: var(--gk-fab-size);\n border-radius: 50%;\n border: none;\n background: var(--gk-primary);\n color: #fff;\n cursor: pointer;\n display: flex;\n align-items: center;\n justify-content: center;\n box-shadow: 0 4px 16px rgba(99, 102, 241, 0.35);\n transition: transform 0.2s ease, box-shadow 0.2s ease;\n outline: none;\n }\n .gk-fab:hover {\n background: var(--gk-primary-hover);\n transform: scale(1.05);\n }\n .gk-fab:focus-visible {\n outline: 2px solid var(--gk-primary);\n outline-offset: 3px;\n }\n .gk-fab svg { width: 24px; height: 24px; fill: currentColor; }\n .gk-panel {\n position: absolute;\n bottom: calc(var(--gk-fab-size) + 16px);\n right: 0;\n width: var(--gk-panel-width);\n height: var(--gk-panel-height);\n background: var(--gk-bg);\n border-radius: var(--gk-radius);\n box-shadow: var(--gk-shadow);\n display: flex;\n flex-direction: column;\n overflow: hidden;\n opacity: 0;\n transform: translateY(12px) scale(0.95);\n pointer-events: none;\n transition: opacity 0.2s ease, transform 0.2s ease;\n }\n .gk-panel.gk-open {\n opacity: 1;\n transform: translateY(0) scale(1);\n pointer-events: auto;\n }\n .gk-header {\n display: flex;\n align-items: center;\n justify-content: space-between;\n padding: 16px 20px;\n border-bottom: 1px solid var(--gk-border);\n flex-shrink: 0;\n }\n .gk-header-title {\n font-size: 15px;\n font-weight: 600;\n color: var(--gk-text);\n margin: 0;\n }\n .gk-close-btn {\n width: 28px; height: 28px; border-radius: 8px;\n border: none; background: transparent; color: var(--gk-text-secondary);\n cursor: pointer; display: flex; align-items: center; justify-content: center;\n outline: none;\n }\n .gk-close-btn:hover { background: var(--gk-bg-secondary); color: var(--gk-text); }\n .gk-close-btn:focus-visible { outline: 2px solid var(--gk-primary); outline-offset: -2px; }\n .gk-close-btn svg { width: 16px; height: 16px; fill: currentColor; }\n .gk-transcript {\n flex: 1; overflow-y: auto; padding: 16px 20px;\n display: flex; flex-direction: column; gap: 12px; scroll-behavior: smooth;\n }\n .gk-empty {\n flex: 1; display: flex; flex-direction: column; align-items: center;\n justify-content: center; color: var(--gk-text-secondary); text-align: center;\n padding: 32px 16px; font-size: 13px;\n }\n .gk-msg {\n max-width: 85%; padding: 10px 14px; border-radius: 12px;\n font-size: 14px; line-height: 1.5; word-wrap: break-word; white-space: pre-wrap;\n }\n .gk-msg-user {\n align-self: flex-end; background: var(--gk-primary);\n color: #fff; border-bottom-right-radius: 4px;\n }\n .gk-msg-assistant {\n align-self: flex-start; background: var(--gk-bg-secondary);\n color: var(--gk-text); border-bottom-left-radius: 4px;\n }\n .gk-dots {\n align-self: flex-start; display: flex; gap: 4px; padding: 12px 16px;\n }\n .gk-dot {\n width: 6px; height: 6px; border-radius: 50%; background: var(--gk-text-secondary);\n animation: gk-bounce 1.4s ease-in-out infinite;\n }\n .gk-dot:nth-child(2) { animation-delay: 0.16s; }\n .gk-dot:nth-child(3) { animation-delay: 0.32s; }\n @keyframes gk-bounce {\n 0%, 80%, 100% { transform: translateY(0); }\n 40% { transform: translateY(-6px); }\n }\n .gk-input-area {\n display: flex; align-items: flex-end; gap: 8px;\n padding: 12px 16px; border-top: 1px solid var(--gk-border); flex-shrink: 0;\n }\n .gk-input {\n flex: 1; min-height: 40px; max-height: 120px; padding: 8px 14px;\n border: 1px solid var(--gk-border); border-radius: 12px;\n background: var(--gk-bg); color: var(--gk-text);\n font-family: var(--gk-font); font-size: 14px; line-height: 1.5;\n resize: none; outline: none;\n }\n .gk-input:focus { border-color: var(--gk-primary); box-shadow: 0 0 0 3px rgba(99,102,241,0.15); }\n .gk-send-btn {\n width: 40px; height: 40px; border-radius: 12px; border: none;\n background: var(--gk-primary); color: #fff; cursor: pointer;\n display: flex; align-items: center; justify-content: center; flex-shrink: 0;\n outline: none;\n }\n .gk-send-btn:hover:not(:disabled) { background: var(--gk-primary-hover); }\n .gk-send-btn:disabled { opacity: 0.5; cursor: not-allowed; }\n .gk-send-btn:focus-visible { outline: 2px solid var(--gk-primary); outline-offset: 3px; }\n .gk-send-btn svg { width: 18px; height: 18px; fill: currentColor; }\n @media (hover: none) and (pointer: coarse), (max-width: 768px) {\n :host { bottom: 16px !important; right: 16px !important; }\n .gk-panel {\n position: fixed; bottom: 0; left: 0; right: 0;\n width: 100%; height: 70vh; max-height: 70vh;\n border-radius: var(--gk-radius) var(--gk-radius) 0 0;\n transform: translateY(100%);\n padding-bottom: env(safe-area-inset-bottom, 0px);\n }\n .gk-panel.gk-open { transform: translateY(0); }\n .gk-send-btn, .gk-close-btn { min-width: 44px; min-height: 44px; }\n .gk-input-area { padding-bottom: calc(12px + env(safe-area-inset-bottom, 0px)); }\n }\n @media (forced-colors: active) {\n .gk-fab, .gk-send-btn { border: 2px solid ButtonText; }\n .gk-panel { border: 1px solid ButtonText; }\n }\n`;\n\nconst SVG_CHAT = '<svg viewBox=\"0 0 24 24\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M20 2H4c-1.1 0-2 .9-2 2v18l4-4h14c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2zm0 14H5.17L4 17.17V4h16v12z\"/><path d=\"M7 9h10v2H7zm0-3h10v2H7z\"/></svg>';\nconst SVG_CLOSE = '<svg viewBox=\"0 0 24 24\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z\"/></svg>';\nconst SVG_SEND = '<svg viewBox=\"0 0 24 24\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M2.01 21L23 12 2.01 3 2 10l15 2-15 2z\"/></svg>';\n\n// ---------------------------------------------------------------------------\n// VanillaWidget — renders and manages the chat widget without React\n// ---------------------------------------------------------------------------\n\nclass VanillaWidget {\n private host: HTMLDivElement;\n private shadow: ShadowRoot;\n private panel!: HTMLDivElement;\n private transcript!: HTMLDivElement;\n private emptyState!: HTMLDivElement;\n private dotsEl!: HTMLDivElement;\n private input!: HTMLTextAreaElement;\n private sendBtn!: HTMLButtonElement;\n private fab!: HTMLButtonElement;\n private isOpen = false;\n private isSending = false;\n private core: GuideKitCore;\n\n constructor(core: GuideKitCore) {\n this.core = core;\n\n // Create Shadow DOM host\n this.host = document.createElement('div');\n this.host.id = 'guidekit-widget';\n this.host.style.cssText =\n 'position:fixed;z-index:2147483647;bottom:24px;right:24px;margin:0;padding:0;border:none;background:none;';\n document.body.appendChild(this.host);\n\n this.shadow = this.host.attachShadow({ mode: 'open' });\n\n // Inject styles\n const style = document.createElement('style');\n style.textContent = WIDGET_CSS;\n this.shadow.appendChild(style);\n\n this.buildDOM();\n this.bindEvents();\n }\n\n private buildDOM(): void {\n // Panel\n this.panel = document.createElement('div');\n this.panel.className = 'gk-panel';\n this.panel.setAttribute('role', 'dialog');\n this.panel.setAttribute('aria-label', 'GuideKit Assistant');\n this.panel.setAttribute('aria-hidden', 'true');\n\n // Header\n const header = document.createElement('div');\n header.className = 'gk-header';\n\n const title = document.createElement('div');\n title.className = 'gk-header-title';\n title.textContent = this.t('widgetTitle');\n header.appendChild(title);\n\n const closeBtn = document.createElement('button');\n closeBtn.className = 'gk-close-btn';\n closeBtn.setAttribute('aria-label', this.t('closePanel'));\n closeBtn.innerHTML = SVG_CLOSE;\n closeBtn.addEventListener('click', () => this.togglePanel(false));\n header.appendChild(closeBtn);\n\n this.panel.appendChild(header);\n\n // Transcript\n this.transcript = document.createElement('div');\n this.transcript.className = 'gk-transcript';\n this.transcript.setAttribute('role', 'log');\n this.transcript.setAttribute('aria-live', 'polite');\n\n this.emptyState = document.createElement('div');\n this.emptyState.className = 'gk-empty';\n this.emptyState.textContent = this.t('emptyStateMessage');\n this.transcript.appendChild(this.emptyState);\n\n // Dots indicator (hidden by default)\n this.dotsEl = document.createElement('div');\n this.dotsEl.className = 'gk-dots';\n this.dotsEl.setAttribute('role', 'status');\n this.dotsEl.setAttribute('aria-label', 'Processing');\n this.dotsEl.style.display = 'none';\n for (let i = 0; i < 3; i++) {\n const dot = document.createElement('div');\n dot.className = 'gk-dot';\n this.dotsEl.appendChild(dot);\n }\n this.transcript.appendChild(this.dotsEl);\n\n this.panel.appendChild(this.transcript);\n\n // Input area\n const inputArea = document.createElement('div');\n inputArea.className = 'gk-input-area';\n\n this.input = document.createElement('textarea');\n this.input.className = 'gk-input';\n this.input.placeholder = this.t('inputPlaceholder');\n this.input.setAttribute('aria-label', this.t('sendMessage'));\n this.input.rows = 1;\n inputArea.appendChild(this.input);\n\n this.sendBtn = document.createElement('button');\n this.sendBtn.className = 'gk-send-btn';\n this.sendBtn.setAttribute('aria-label', this.t('sendMessage'));\n this.sendBtn.innerHTML = SVG_SEND;\n inputArea.appendChild(this.sendBtn);\n\n this.panel.appendChild(inputArea);\n this.shadow.appendChild(this.panel);\n\n // FAB\n this.fab = document.createElement('button');\n this.fab.className = 'gk-fab';\n this.fab.setAttribute('aria-label', this.t('openAssistant'));\n this.fab.setAttribute('aria-expanded', 'false');\n this.fab.setAttribute('aria-haspopup', 'dialog');\n this.fab.innerHTML = SVG_CHAT;\n this.shadow.appendChild(this.fab);\n }\n\n private bindEvents(): void {\n this.fab.addEventListener('click', () => this.togglePanel(!this.isOpen));\n\n this.sendBtn.addEventListener('click', () => this.handleSend());\n\n this.input.addEventListener('keydown', (e) => {\n if (e.key === 'Enter' && !e.shiftKey) {\n e.preventDefault();\n this.handleSend();\n }\n if (e.key === 'Escape') {\n this.togglePanel(false);\n this.fab.focus();\n }\n });\n }\n\n private togglePanel(open: boolean): void {\n this.isOpen = open;\n if (open) {\n this.panel.classList.add('gk-open');\n this.panel.setAttribute('aria-hidden', 'false');\n this.fab.setAttribute('aria-expanded', 'true');\n this.fab.innerHTML = SVG_CLOSE;\n this.fab.setAttribute('aria-label', this.t('closeAssistant'));\n setTimeout(() => this.input.focus(), 100);\n } else {\n this.panel.classList.remove('gk-open');\n this.panel.setAttribute('aria-hidden', 'true');\n this.fab.setAttribute('aria-expanded', 'false');\n this.fab.innerHTML = SVG_CHAT;\n this.fab.setAttribute('aria-label', this.t('openAssistant'));\n }\n }\n\n private async handleSend(): Promise<void> {\n const text = this.input.value.trim();\n if (!text || this.isSending) return;\n\n this.isSending = true;\n\n // Hide empty state\n this.emptyState.style.display = 'none';\n\n // Add user message\n this.addMessage('user', text);\n this.input.value = '';\n\n // Show processing dots\n this.dotsEl.style.display = 'flex';\n this.scrollToBottom();\n\n try {\n const response = await this.core.sendText(text);\n this.dotsEl.style.display = 'none';\n this.addMessage('assistant', response);\n } catch (err) {\n this.dotsEl.style.display = 'none';\n const msg = err instanceof Error ? err.message : 'Something went wrong.';\n this.addMessage('assistant', `Error: ${msg}`);\n } finally {\n this.isSending = false;\n }\n }\n\n private addMessage(role: 'user' | 'assistant', content: string): void {\n const el = document.createElement('div');\n el.className = `gk-msg gk-msg-${role}`;\n el.textContent = content;\n // Insert before the dots element\n this.transcript.insertBefore(el, this.dotsEl);\n this.scrollToBottom();\n }\n\n private scrollToBottom(): void {\n this.transcript.scrollTop = this.transcript.scrollHeight;\n }\n\n private t(key: string): string {\n try {\n return this.core.i18n.t(key as keyof I18nStrings) ?? key;\n } catch {\n return key;\n }\n }\n\n destroy(): void {\n this.host.remove();\n }\n}\n\n// ---------------------------------------------------------------------------\n// GuideKitVanilla — imperative wrapper around GuideKitCore\n// ---------------------------------------------------------------------------\n\nexport interface GuideKitVanillaOptions {\n tokenEndpoint?: string;\n stt?: GuideKitCoreOptions['stt'];\n tts?: GuideKitCoreOptions['tts'];\n llm?: GuideKitCoreOptions['llm'];\n agent?: GuideKitCoreOptions['agent'];\n contentMap?: GuideKitCoreOptions['contentMap'];\n options?: GuideKitCoreOptions['options'];\n instanceId?: string;\n rootElement?: HTMLElement;\n /** Disable the built-in widget UI (for headless use). */\n headless?: boolean;\n onError?: (error: GuideKitErrorType) => void;\n onEvent?: (event: GuideKitEvent) => void;\n onReady?: () => void;\n}\n\n/** Singleton state */\nlet _core: GuideKitCore | null = null;\nlet _widget: VanillaWidget | null = null;\nlet _initialized = false;\n\n/**\n * Initialize GuideKit. Must be called before any other methods.\n * Idempotent — calling multiple times is safe (returns existing instance).\n */\nexport async function init(options: GuideKitVanillaOptions): Promise<void> {\n if (_initialized && _core) return;\n\n _core = new GuideKitCore({\n tokenEndpoint: options.tokenEndpoint,\n stt: options.stt,\n tts: options.tts,\n llm: options.llm,\n agent: options.agent,\n contentMap: options.contentMap,\n options: options.options,\n instanceId: options.instanceId,\n rootElement: options.rootElement,\n onError: options.onError,\n onEvent: options.onEvent,\n onReady: options.onReady,\n });\n\n await _core.init();\n\n // Create widget unless headless\n if (!options.headless) {\n _widget = new VanillaWidget(_core);\n }\n\n _initialized = true;\n}\n\n/**\n * Send a text message to the assistant. Returns the response.\n */\nexport async function sendText(message: string): Promise<string> {\n assertInitialized();\n return _core!.sendText(message);\n}\n\n/**\n * Highlight an element on the page.\n */\nexport function highlight(params: {\n sectionId?: string;\n selector?: string;\n tooltip?: string;\n position?: 'top' | 'bottom' | 'left' | 'right' | 'auto';\n}): boolean {\n assertInitialized();\n return _core!.highlight(params);\n}\n\n/** Dismiss the current spotlight highlight. */\nexport function dismissHighlight(): void {\n assertInitialized();\n _core!.dismissHighlight();\n}\n\n/** Smooth scroll to a section by ID. */\nexport function scrollToSection(sectionId: string, offset?: number): void {\n assertInitialized();\n _core!.scrollToSection(sectionId, offset);\n}\n\n/** Start a guided tour. */\nexport function startTour(sectionIds: string[], mode?: 'auto' | 'manual'): void {\n assertInitialized();\n _core!.startTour(sectionIds, mode);\n}\n\n/** Stop the current tour. */\nexport function stopTour(): void {\n assertInitialized();\n _core!.stopTour();\n}\n\n/** Navigate to a URL (same-origin only). */\nexport async function navigate(href: string): Promise<boolean> {\n assertInitialized();\n return _core!.navigate(href);\n}\n\n/** Set developer page context for the LLM. */\nexport function setPageContext(context: Record<string, unknown>): void {\n assertInitialized();\n _core!.setPageContext(context);\n}\n\n/** Register a custom action the LLM can invoke. */\nexport function registerAction(\n actionId: string,\n action: {\n description: string;\n parameters: Record<string, unknown>;\n handler: (params: Record<string, unknown>) => Promise<unknown>;\n },\n): void {\n assertInitialized();\n _core!.registerAction(actionId, action);\n}\n\n/** Start voice input. */\nexport async function startListening(): Promise<void> {\n assertInitialized();\n await _core!.startListening();\n}\n\n/** Stop voice input. */\nexport function stopListening(): void {\n assertInitialized();\n _core!.stopListening();\n}\n\n/** Get current agent state. */\nexport function getAgentState(): AgentState {\n assertInitialized();\n return _core!.agentState;\n}\n\n/** Get current page model. */\nexport function getPageModel(): PageModel | null {\n assertInitialized();\n return _core!.pageModel;\n}\n\n/** Whether the SDK is ready. */\nexport function isReady(): boolean {\n return _core?.isReady ?? false;\n}\n\n/** Get/set quiet mode. */\nexport function getQuietMode(): boolean {\n assertInitialized();\n return _core!.quietMode;\n}\n\nexport function setQuietMode(value: boolean): void {\n assertInitialized();\n _core!.quietMode = value;\n}\n\n/** Check health of all connected services. */\nexport async function checkHealth(): Promise<HealthCheckResult> {\n assertInitialized();\n return _core!.checkHealth();\n}\n\n/** Destroy the instance and clean up. */\nexport async function destroy(): Promise<void> {\n if (_widget) {\n _widget.destroy();\n _widget = null;\n }\n if (_core) {\n await _core.destroy();\n _core = null;\n }\n _initialized = false;\n}\n\n/** Get the underlying GuideKitCore instance (escape hatch). */\nexport function getCore(): GuideKitCore | null {\n return _core;\n}\n\n// ---------------------------------------------------------------------------\n// Internal\n// ---------------------------------------------------------------------------\n\nfunction assertInitialized(): void {\n if (!_core || !_initialized) {\n throw new Error(\n 'GuideKit not initialized. Call GuideKit.init({...}) first.',\n );\n }\n}\n\n// ---------------------------------------------------------------------------\n// Version\n// ---------------------------------------------------------------------------\n\nexport const VERSION = '0.1.0-beta.2';\n"],"mappings":";AAiBA,SAAS,oBAAoB;AAe7B,IAAM;AAAA;AAAA,EAAuB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AA4K7B,IAAM,WAAW;AACjB,IAAM,YAAY;AAClB,IAAM,WAAW;AA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;AACtC,oBAAkB;AAClB,SAAO,MAAO;AAChB;AAEO,SAAS,aAAa,OAAsB;AACjD,oBAAkB;AAClB,QAAO,YAAY;AACrB;AAGA,eAAsB,cAA0C;AAC9D,oBAAkB;AAClB,SAAO,MAAO,YAAY;AAC5B;AAGA,eAAsB,UAAyB;AAC7C,MAAI,SAAS;AACX,YAAQ,QAAQ;AAChB,cAAU;AAAA,EACZ;AACA,MAAI,OAAO;AACT,UAAM,MAAM,QAAQ;AACpB,YAAQ;AAAA,EACV;AACA,iBAAe;AACjB;AAGO,SAAS,UAA+B;AAC7C,SAAO;AACT;AAMA,SAAS,oBAA0B;AACjC,MAAI,CAAC,SAAS,CAAC,cAAc;AAC3B,UAAM,IAAI;AAAA,MACR;AAAA,IACF;AAAA,EACF;AACF;AAMO,IAAM,UAAU;","names":[]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@guidekit/vanilla",
|
|
3
|
-
"version": "0.1.0-beta.
|
|
3
|
+
"version": "0.1.0-beta.2",
|
|
4
4
|
"description": "Vanilla JS bundle for GuideKit SDK — script-tag integration",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.cjs",
|
|
@@ -19,22 +19,45 @@
|
|
|
19
19
|
},
|
|
20
20
|
"files": [
|
|
21
21
|
"dist",
|
|
22
|
-
"
|
|
22
|
+
"LICENSE",
|
|
23
23
|
"README.md"
|
|
24
24
|
],
|
|
25
|
-
"scripts": {
|
|
26
|
-
"build": "tsup",
|
|
27
|
-
"dev": "tsup --watch",
|
|
28
|
-
"typecheck": "tsc --noEmit",
|
|
29
|
-
"clean": "rm -rf dist"
|
|
30
|
-
},
|
|
31
25
|
"dependencies": {
|
|
32
|
-
"@guidekit/core": "
|
|
26
|
+
"@guidekit/core": "^0.1.0-beta.2"
|
|
33
27
|
},
|
|
34
28
|
"devDependencies": {
|
|
35
29
|
"typescript": "^5.7.0",
|
|
36
30
|
"tsup": "^8.4.0"
|
|
37
31
|
},
|
|
38
32
|
"sideEffects": false,
|
|
39
|
-
"license": "MIT"
|
|
40
|
-
|
|
33
|
+
"license": "MIT",
|
|
34
|
+
"author": "Riazul Islam",
|
|
35
|
+
"keywords": [
|
|
36
|
+
"guidekit",
|
|
37
|
+
"vanilla",
|
|
38
|
+
"javascript",
|
|
39
|
+
"sdk",
|
|
40
|
+
"ai",
|
|
41
|
+
"widget",
|
|
42
|
+
"script-tag",
|
|
43
|
+
"assistant"
|
|
44
|
+
],
|
|
45
|
+
"engines": {
|
|
46
|
+
"node": ">=18"
|
|
47
|
+
},
|
|
48
|
+
"repository": {
|
|
49
|
+
"type": "git",
|
|
50
|
+
"url": "https://github.com/riaz37/guidekit.git",
|
|
51
|
+
"directory": "packages/vanilla"
|
|
52
|
+
},
|
|
53
|
+
"homepage": "https://github.com/riaz37/guidekit#readme",
|
|
54
|
+
"bugs": {
|
|
55
|
+
"url": "https://github.com/riaz37/guidekit/issues"
|
|
56
|
+
},
|
|
57
|
+
"scripts": {
|
|
58
|
+
"build": "tsup",
|
|
59
|
+
"dev": "tsup --watch",
|
|
60
|
+
"typecheck": "tsc --noEmit",
|
|
61
|
+
"clean": "rm -rf dist"
|
|
62
|
+
}
|
|
63
|
+
}
|