glirastes 0.3.0 → 0.3.1
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/CHANGELOG.md +63 -0
- package/README.md +146 -9
- package/codegen/package.json +5 -0
- package/dist/cjs/codegen/asset-sync.d.ts +20 -0
- package/dist/cjs/codegen/asset-sync.js +28 -0
- package/dist/cjs/codegen/coverage.d.ts +66 -0
- package/dist/cjs/codegen/coverage.js +408 -0
- package/dist/cjs/codegen/endpoint-scanner.d.ts +16 -0
- package/dist/cjs/codegen/endpoint-scanner.js +197 -0
- package/dist/cjs/codegen/format.d.ts +17 -0
- package/dist/cjs/codegen/format.js +34 -0
- package/dist/cjs/codegen/fs-utils.d.ts +45 -0
- package/dist/cjs/codegen/fs-utils.js +165 -0
- package/dist/cjs/codegen/index.d.ts +13 -0
- package/dist/cjs/codegen/index.js +33 -0
- package/dist/cjs/codegen/mcp-generator.d.ts +50 -0
- package/dist/cjs/codegen/mcp-generator.js +803 -0
- package/dist/cjs/codegen/module-generator.d.ts +11 -0
- package/dist/cjs/codegen/module-generator.js +353 -0
- package/dist/cjs/codegen/nestjs-scanner.d.ts +43 -0
- package/dist/cjs/codegen/nestjs-scanner.js +241 -0
- package/dist/cjs/codegen/output-recommender.d.ts +23 -0
- package/dist/cjs/codegen/output-recommender.js +33 -0
- package/dist/cjs/codegen/scaffolder.d.ts +36 -0
- package/dist/cjs/codegen/scaffolder.js +262 -0
- package/dist/cjs/codegen/skill-generator.d.ts +49 -0
- package/dist/cjs/codegen/skill-generator.js +967 -0
- package/dist/cjs/codegen/types.d.ts +52 -0
- package/dist/cjs/codegen/types.js +16 -0
- package/dist/cjs/codegen/ui-scanner.d.ts +24 -0
- package/dist/cjs/codegen/ui-scanner.js +202 -0
- package/dist/cjs/codegen/validator.d.ts +35 -0
- package/dist/cjs/codegen/validator.js +292 -0
- package/dist/cjs/index.d.ts +1 -0
- package/dist/cjs/index.js +23 -0
- package/dist/cjs/openapi/index.d.ts +78 -0
- package/dist/cjs/openapi/index.js +347 -0
- package/dist/cjs/package.json +1 -0
- package/dist/cjs/react/audio-worklet-processor.d.ts +16 -0
- package/dist/cjs/react/audio-worklet-processor.js +27 -0
- package/dist/cjs/react/bridges/rest-session-bridge.d.ts +113 -0
- package/dist/cjs/react/bridges/rest-session-bridge.js +209 -0
- package/dist/cjs/react/components/ai-chat-panel.d.ts +12 -0
- package/dist/cjs/react/components/ai-chat-panel.js +67 -0
- package/dist/cjs/react/components/ai-trigger-button.d.ts +2 -0
- package/dist/cjs/react/components/ai-trigger-button.js +239 -0
- package/dist/cjs/react/components/approval-card.d.ts +9 -0
- package/dist/cjs/react/components/approval-card.js +24 -0
- package/dist/cjs/react/components/bulk-approval-card.d.ts +9 -0
- package/dist/cjs/react/components/bulk-approval-card.js +36 -0
- package/dist/cjs/react/components/chat-input.d.ts +10 -0
- package/dist/cjs/react/components/chat-input.js +60 -0
- package/dist/cjs/react/components/chat-window.d.ts +2 -0
- package/dist/cjs/react/components/chat-window.js +134 -0
- package/dist/cjs/react/components/confirm-dialog.d.ts +32 -0
- package/dist/cjs/react/components/confirm-dialog.js +48 -0
- package/dist/cjs/react/components/floating-chat-ui.d.ts +90 -0
- package/dist/cjs/react/components/floating-chat-ui.js +163 -0
- package/dist/cjs/react/components/mention-chip.d.ts +16 -0
- package/dist/cjs/react/components/mention-chip.js +42 -0
- package/dist/cjs/react/components/mention-input.d.ts +8 -0
- package/dist/cjs/react/components/mention-input.js +117 -0
- package/dist/cjs/react/components/message-bubble.d.ts +11 -0
- package/dist/cjs/react/components/message-bubble.js +171 -0
- package/dist/cjs/react/components/message-list.d.ts +8 -0
- package/dist/cjs/react/components/message-list.js +52 -0
- package/dist/cjs/react/components/pipeline-timeline.d.ts +7 -0
- package/dist/cjs/react/components/pipeline-timeline.js +72 -0
- package/dist/cjs/react/components/recording-bar.d.ts +2 -0
- package/dist/cjs/react/components/recording-bar.js +81 -0
- package/dist/cjs/react/components/recording-controls.d.ts +18 -0
- package/dist/cjs/react/components/recording-controls.js +38 -0
- package/dist/cjs/react/components/rich-mention-input.d.ts +2 -0
- package/dist/cjs/react/components/rich-mention-input.js +571 -0
- package/dist/cjs/react/components/session-switcher.d.ts +14 -0
- package/dist/cjs/react/components/session-switcher.js +133 -0
- package/dist/cjs/react/components/suggestion-bar.d.ts +9 -0
- package/dist/cjs/react/components/suggestion-bar.js +47 -0
- package/dist/cjs/react/components/suggestion-chip.d.ts +9 -0
- package/dist/cjs/react/components/suggestion-chip.js +14 -0
- package/dist/cjs/react/components/voice-input-addon.d.ts +13 -0
- package/dist/cjs/react/components/voice-input-addon.js +31 -0
- package/dist/cjs/react/components/voice-input-button.d.ts +2 -0
- package/dist/cjs/react/components/voice-input-button.js +55 -0
- package/dist/cjs/react/components/wavesurfer-loader.d.ts +5 -0
- package/dist/cjs/react/components/wavesurfer-loader.js +36 -0
- package/dist/cjs/react/hooks/use-ai-chat.d.ts +22 -0
- package/dist/cjs/react/hooks/use-ai-chat.js +51 -0
- package/dist/cjs/react/hooks/use-approvals.d.ts +23 -0
- package/dist/cjs/react/hooks/use-approvals.js +63 -0
- package/dist/cjs/react/hooks/use-deepgram-transcription.d.ts +2 -0
- package/dist/cjs/react/hooks/use-deepgram-transcription.js +329 -0
- package/dist/cjs/react/hooks/use-drag-resize-panel.d.ts +48 -0
- package/dist/cjs/react/hooks/use-drag-resize-panel.js +308 -0
- package/dist/cjs/react/hooks/use-draggable-position.d.ts +25 -0
- package/dist/cjs/react/hooks/use-draggable-position.js +134 -0
- package/dist/cjs/react/hooks/use-keyboard-shortcut.d.ts +20 -0
- package/dist/cjs/react/hooks/use-keyboard-shortcut.js +93 -0
- package/dist/cjs/react/hooks/use-mentions.d.ts +23 -0
- package/dist/cjs/react/hooks/use-mentions.js +42 -0
- package/dist/cjs/react/hooks/use-suggestions.d.ts +22 -0
- package/dist/cjs/react/hooks/use-suggestions.js +39 -0
- package/dist/cjs/react/index.d.ts +43 -0
- package/dist/cjs/react/index.js +111 -0
- package/dist/cjs/react/provider/ai-chat-provider.d.ts +45 -0
- package/dist/cjs/react/provider/ai-chat-provider.js +1024 -0
- package/dist/cjs/react/provider/chat-context.d.ts +84 -0
- package/dist/cjs/react/provider/chat-context.js +13 -0
- package/dist/cjs/react/template.d.ts +84 -0
- package/dist/cjs/react/template.js +90 -0
- package/dist/cjs/react/themes.d.ts +24 -0
- package/dist/cjs/react/themes.js +273 -0
- package/dist/cjs/react/transports/langgraph/index.d.ts +2 -0
- package/dist/cjs/react/transports/langgraph/index.js +8 -0
- package/dist/cjs/react/transports/langgraph/langgraph-ai-chat.d.ts +62 -0
- package/dist/cjs/react/transports/langgraph/langgraph-ai-chat.js +94 -0
- package/dist/cjs/react/transports/langgraph.d.ts +71 -0
- package/dist/cjs/react/transports/langgraph.js +369 -0
- package/dist/cjs/react/transports/vercel/index.d.ts +2 -0
- package/dist/cjs/react/transports/vercel/index.js +8 -0
- package/dist/cjs/react/transports/vercel/vercel-ai-chat.d.ts +49 -0
- package/dist/cjs/react/transports/vercel/vercel-ai-chat.js +81 -0
- package/dist/cjs/react/transports/vercel.d.ts +30 -0
- package/dist/cjs/react/transports/vercel.js +69 -0
- package/dist/cjs/react/types.d.ts +760 -0
- package/dist/cjs/react/types.js +2 -0
- package/dist/cjs/react/ui.d.ts +73 -0
- package/dist/cjs/react/ui.js +183 -0
- package/dist/cjs/react/utils/create-approval-description.d.ts +53 -0
- package/dist/cjs/react/utils/create-approval-description.js +122 -0
- package/dist/cjs/react/utils/create-tool-result-handler.d.ts +90 -0
- package/dist/cjs/react/utils/create-tool-result-handler.js +168 -0
- package/dist/cjs/react/utils/mention-markup.d.ts +13 -0
- package/dist/cjs/react/utils/mention-markup.js +117 -0
- package/dist/cjs/react/utils/merge-pipeline-steps.d.ts +19 -0
- package/dist/cjs/react/utils/merge-pipeline-steps.js +81 -0
- package/dist/cjs/react/utils/sanitize-stored-messages.d.ts +23 -0
- package/dist/cjs/react/utils/sanitize-stored-messages.js +52 -0
- package/dist/cjs/server/adapters/nestjs/chat/ai-chat-auth.guard.d.ts +10 -0
- package/dist/cjs/server/adapters/nestjs/chat/ai-chat-auth.guard.js +42 -0
- package/dist/cjs/server/adapters/nestjs/chat/ai-chat-module-options.interface.d.ts +32 -0
- package/dist/cjs/server/adapters/nestjs/chat/ai-chat-module-options.interface.js +4 -0
- package/dist/cjs/server/adapters/nestjs/chat/ai-chat.controller.d.ts +11 -0
- package/dist/cjs/server/adapters/nestjs/chat/ai-chat.controller.js +80 -0
- package/dist/cjs/server/adapters/nestjs/chat/ai-chat.module.d.ts +9 -0
- package/dist/cjs/server/adapters/nestjs/chat/ai-chat.module.js +119 -0
- package/dist/cjs/server/adapters/nestjs/chat/ai-chat.service.d.ts +13 -0
- package/dist/cjs/server/adapters/nestjs/chat/ai-chat.service.js +131 -0
- package/dist/cjs/server/adapters/nestjs/chat/dto/ai-chat-request.dto.d.ts +7 -0
- package/dist/cjs/server/adapters/nestjs/chat/dto/ai-chat-request.dto.js +52 -0
- package/dist/cjs/server/adapters/nestjs/chat/dto/chat-message-part.dto.d.ts +19 -0
- package/dist/cjs/server/adapters/nestjs/chat/dto/chat-message-part.dto.js +108 -0
- package/dist/cjs/server/adapters/nestjs/chat/dto/chat-message.dto.d.ts +8 -0
- package/dist/cjs/server/adapters/nestjs/chat/dto/chat-message.dto.js +59 -0
- package/dist/cjs/server/adapters/nestjs/chat/dto/index.d.ts +3 -0
- package/dist/cjs/server/adapters/nestjs/chat/dto/index.js +9 -0
- package/dist/cjs/server/adapters/nestjs/chat/index.d.ts +3 -0
- package/dist/cjs/server/adapters/nestjs/chat/index.js +9 -0
- package/dist/cjs/server/adapters/nestjs/chat/speech-stream.gateway.d.ts +4 -0
- package/dist/cjs/server/adapters/nestjs/chat/speech-stream.gateway.js +73 -0
- package/dist/cjs/server/adapters/nestjs/chat/ws-loader.d.ts +5 -0
- package/dist/cjs/server/adapters/nestjs/chat/ws-loader.js +72 -0
- package/dist/cjs/server/adapters/nestjs/decorators/ai-module.decorator.d.ts +6 -0
- package/dist/cjs/server/adapters/nestjs/decorators/ai-module.decorator.js +13 -0
- package/dist/cjs/server/adapters/nestjs/decorators/ai-param.decorator.d.ts +5 -0
- package/dist/cjs/server/adapters/nestjs/decorators/ai-param.decorator.js +15 -0
- package/dist/cjs/server/adapters/nestjs/decorators/ai-tool.decorator.d.ts +6 -0
- package/dist/cjs/server/adapters/nestjs/decorators/ai-tool.decorator.js +22 -0
- package/dist/cjs/server/adapters/nestjs/decorators/constants.d.ts +4 -0
- package/dist/cjs/server/adapters/nestjs/decorators/constants.js +7 -0
- package/dist/cjs/server/adapters/nestjs/index.d.ts +14 -0
- package/dist/cjs/server/adapters/nestjs/index.js +42 -0
- package/dist/cjs/server/adapters/nestjs/metadata.d.ts +39 -0
- package/dist/cjs/server/adapters/nestjs/metadata.js +36 -0
- package/dist/cjs/server/adapters/nestjs/module/ai-tools-explorer.service.d.ts +36 -0
- package/dist/cjs/server/adapters/nestjs/module/ai-tools-explorer.service.js +159 -0
- package/dist/cjs/server/adapters/nestjs/module/ai-tools.module.d.ts +37 -0
- package/dist/cjs/server/adapters/nestjs/module/ai-tools.module.js +44 -0
- package/dist/cjs/server/adapters/nestjs/module/ai-tools.service.d.ts +28 -0
- package/dist/cjs/server/adapters/nestjs/module/ai-tools.service.js +41 -0
- package/dist/cjs/server/adapters/nestjs/scanner/nestjs-scanner.d.ts +16 -0
- package/dist/cjs/server/adapters/nestjs/scanner/nestjs-scanner.js +117 -0
- package/dist/cjs/server/adapters/nestjs/scanner/schema-builder.d.ts +26 -0
- package/dist/cjs/server/adapters/nestjs/scanner/schema-builder.js +259 -0
- package/dist/cjs/server/adapters/nestjs/swagger.d.ts +7 -0
- package/dist/cjs/server/adapters/nestjs/swagger.js +39 -0
- package/dist/cjs/server/adapters/nextjs/context-helpers.d.ts +22 -0
- package/dist/cjs/server/adapters/nextjs/context-helpers.js +60 -0
- package/dist/cjs/server/adapters/nextjs/create-ai-chat-handler.d.ts +94 -0
- package/dist/cjs/server/adapters/nextjs/create-ai-chat-handler.js +965 -0
- package/dist/cjs/server/adapters/nextjs/filter-fallback-error.d.ts +11 -0
- package/dist/cjs/server/adapters/nextjs/filter-fallback-error.js +41 -0
- package/dist/cjs/server/adapters/nextjs/index.d.ts +8 -0
- package/dist/cjs/server/adapters/nextjs/index.js +22 -0
- package/dist/cjs/server/adapters/nextjs/prepare-model-messages.d.ts +58 -0
- package/dist/cjs/server/adapters/nextjs/prepare-model-messages.js +114 -0
- package/dist/cjs/server/adapters/nextjs/sanitize-model-messages.d.ts +64 -0
- package/dist/cjs/server/adapters/nextjs/sanitize-model-messages.js +489 -0
- package/dist/cjs/server/adapters/nextjs/server-action-helper.d.ts +7 -0
- package/dist/cjs/server/adapters/nextjs/server-action-helper.js +40 -0
- package/dist/cjs/server/adapters/nextjs/types.d.ts +246 -0
- package/dist/cjs/server/adapters/nextjs/types.js +2 -0
- package/dist/cjs/server/adapters/nextjs/with-ai-tool.d.ts +9 -0
- package/dist/cjs/server/adapters/nextjs/with-ai-tool.js +12 -0
- package/dist/cjs/server/core/followup-tool.d.ts +9 -0
- package/dist/cjs/server/core/followup-tool.js +82 -0
- package/dist/cjs/server/core/index.d.ts +139 -0
- package/dist/cjs/server/core/index.js +818 -0
- package/dist/cjs/server/core/intent-classifier.d.ts +94 -0
- package/dist/cjs/server/core/intent-classifier.js +324 -0
- package/dist/cjs/server/core/model-selector.d.ts +12 -0
- package/dist/cjs/server/core/model-selector.js +48 -0
- package/dist/cjs/server/core/module-router.d.ts +14 -0
- package/dist/cjs/server/core/module-router.js +110 -0
- package/dist/cjs/server/core/zod-compact.d.ts +18 -0
- package/dist/cjs/server/core/zod-compact.js +129 -0
- package/dist/cjs/server/index.d.ts +6 -0
- package/dist/cjs/server/index.js +28 -0
- package/dist/cjs/server/lancer/cache.d.ts +9 -0
- package/dist/cjs/server/lancer/cache.js +33 -0
- package/dist/cjs/server/lancer/client.d.ts +2 -0
- package/dist/cjs/server/lancer/client.js +279 -0
- package/dist/cjs/server/lancer/errors.d.ts +13 -0
- package/dist/cjs/server/lancer/errors.js +21 -0
- package/dist/cjs/server/lancer/index.d.ts +3 -0
- package/dist/cjs/server/lancer/index.js +7 -0
- package/dist/cjs/server/lancer/telemetry-buffer.d.ts +15 -0
- package/dist/cjs/server/lancer/telemetry-buffer.js +64 -0
- package/dist/cjs/server/lancer/types.d.ts +201 -0
- package/dist/cjs/server/lancer/types.js +5 -0
- package/dist/cjs/server/pii-shield/aegis-detector.d.ts +26 -0
- package/dist/cjs/server/pii-shield/aegis-detector.js +26 -0
- package/dist/cjs/server/pii-shield/create-pii-shield.d.ts +2 -0
- package/dist/cjs/server/pii-shield/create-pii-shield.js +191 -0
- package/dist/cjs/server/pii-shield/deep-walk.d.ts +1 -0
- package/dist/cjs/server/pii-shield/deep-walk.js +19 -0
- package/dist/cjs/server/pii-shield/fake-data.d.ts +5 -0
- package/dist/cjs/server/pii-shield/fake-data.js +170 -0
- package/dist/cjs/server/pii-shield/index.d.ts +4 -0
- package/dist/cjs/server/pii-shield/index.js +9 -0
- package/dist/cjs/server/pii-shield/leakage.d.ts +1 -0
- package/dist/cjs/server/pii-shield/leakage.js +15 -0
- package/dist/cjs/server/pii-shield/session-mapping.d.ts +12 -0
- package/dist/cjs/server/pii-shield/session-mapping.js +70 -0
- package/dist/cjs/server/pipeline.d.ts +26 -0
- package/dist/cjs/server/pipeline.js +127 -0
- package/dist/cjs/server/testing/approvals.d.ts +11 -0
- package/dist/cjs/server/testing/approvals.js +41 -0
- package/dist/cjs/server/testing/combination.d.ts +3 -0
- package/dist/cjs/server/testing/combination.js +83 -0
- package/dist/cjs/server/testing/create-test-suite.d.ts +29 -0
- package/dist/cjs/server/testing/create-test-suite.js +81 -0
- package/dist/cjs/server/testing/edge-cases.d.ts +8 -0
- package/dist/cjs/server/testing/edge-cases.js +277 -0
- package/dist/cjs/server/testing/guardrails.d.ts +14 -0
- package/dist/cjs/server/testing/guardrails.js +152 -0
- package/dist/cjs/server/testing/helpers.d.ts +14 -0
- package/dist/cjs/server/testing/helpers.js +119 -0
- package/dist/cjs/server/testing/index.d.ts +12 -0
- package/dist/cjs/server/testing/index.js +37 -0
- package/dist/cjs/server/testing/mock-executor.d.ts +8 -0
- package/dist/cjs/server/testing/mock-executor.js +40 -0
- package/dist/cjs/server/testing/regression.d.ts +7 -0
- package/dist/cjs/server/testing/regression.js +27 -0
- package/dist/cjs/server/testing/routing.d.ts +12 -0
- package/dist/cjs/server/testing/routing.js +63 -0
- package/dist/cjs/server/testing/schema-consistency.d.ts +6 -0
- package/dist/cjs/server/testing/schema-consistency.js +56 -0
- package/dist/cjs/server/testing/smoke.d.ts +11 -0
- package/dist/cjs/server/testing/smoke.js +64 -0
- package/dist/cjs/server/testing/types.d.ts +156 -0
- package/dist/cjs/server/testing/types.js +2 -0
- package/dist/cjs/types.d.ts +696 -0
- package/dist/cjs/types.js +91 -0
- package/dist/cli/commands/install-skills.d.ts +17 -0
- package/dist/cli/commands/install-skills.js +185 -0
- package/dist/cli/commands/install-skills.js.map +1 -0
- package/dist/cli/index.js +25 -0
- package/dist/cli/index.js.map +1 -1
- package/dist/react/components/ai-trigger-button.js +4 -6
- package/dist/react/components/ai-trigger-button.js.map +1 -1
- package/dist/react/components/recording-bar.js +4 -6
- package/dist/react/components/recording-bar.js.map +1 -1
- package/dist/react/components/wavesurfer-loader.d.ts +5 -0
- package/dist/react/components/wavesurfer-loader.js +34 -0
- package/dist/react/components/wavesurfer-loader.js.map +1 -0
- package/dist/server/adapters/nestjs/chat/ai-chat.module.d.ts +1 -1
- package/dist/server/adapters/nestjs/chat/ai-chat.module.js +3 -2
- package/dist/server/adapters/nestjs/chat/ai-chat.module.js.map +1 -1
- package/dist/server/adapters/nestjs/chat/speech-stream.gateway.d.ts +1 -1
- package/dist/server/adapters/nestjs/chat/speech-stream.gateway.js +10 -8
- package/dist/server/adapters/nestjs/chat/speech-stream.gateway.js.map +1 -1
- package/dist/server/adapters/nestjs/chat/ws-loader.d.ts +5 -0
- package/dist/server/adapters/nestjs/chat/ws-loader.js +37 -0
- package/dist/server/adapters/nestjs/chat/ws-loader.js.map +1 -0
- package/openapi/package.json +5 -0
- package/package.json +59 -16
- package/react/langgraph/package.json +5 -0
- package/react/package.json +5 -0
- package/react/vercel/package.json +5 -0
- package/server/nestjs/package.json +5 -0
- package/server/nextjs/package.json +5 -0
- package/server/package.json +5 -0
- package/server/testing/package.json +5 -0
- package/skills/README.md +107 -0
- package/skills/building-glirastes-chat-ui/SKILL.md +378 -0
- package/skills/integrating-glirastes-nestjs/SKILL.md +346 -0
- package/skills/integrating-glirastes-nextjs/SKILL.md +306 -0
- package/skills/integrating-glirastes-nextjs-with-nestjs-backend/SKILL.md +359 -0
- package/skills/maintaining-glirastes-tools/SKILL.md +463 -0
|
@@ -0,0 +1,378 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: building-glirastes-chat-ui
|
|
3
|
+
description: Customizing the Glirastes chat UI — VercelAiChat / LangGraphAiChat, AiChatProvider + AiChatPanel composition, theming, mentions, voice input, approval cards, ChatWindow portal, useAiClientAction. Use when going beyond the zero-config chat widget.
|
|
4
|
+
version: 1.0.0
|
|
5
|
+
tags:
|
|
6
|
+
- glirastes
|
|
7
|
+
- react
|
|
8
|
+
- chat-ui
|
|
9
|
+
- components
|
|
10
|
+
triggers:
|
|
11
|
+
- chat panel
|
|
12
|
+
- chat window
|
|
13
|
+
- VercelAiChat
|
|
14
|
+
- LangGraphAiChat
|
|
15
|
+
- AiChatProvider
|
|
16
|
+
- AiChatPanel
|
|
17
|
+
- useAiChat
|
|
18
|
+
- useAiClientAction
|
|
19
|
+
- chat theming
|
|
20
|
+
- chat mentions
|
|
21
|
+
- voice input
|
|
22
|
+
- approval card
|
|
23
|
+
- suggestion chips
|
|
24
|
+
- pipeline timeline
|
|
25
|
+
---
|
|
26
|
+
|
|
27
|
+
# Building the Glirastes Chat UI
|
|
28
|
+
|
|
29
|
+
> **Scope:** customizing the chat UI beyond `<VercelAiChat endpoint="/api/chat" />`. For the initial integration (install, wire the route, drop the widget), see [integrating-glirastes-nextjs](../integrating-glirastes-nextjs/SKILL.md) or [integrating-glirastes-nestjs](../integrating-glirastes-nestjs/SKILL.md).
|
|
30
|
+
|
|
31
|
+
## Component map
|
|
32
|
+
|
|
33
|
+
```
|
|
34
|
+
AiChatProvider (state + transport + config)
|
|
35
|
+
└─ AiChatPanel (the panel layout — header, body, input)
|
|
36
|
+
├─ MessageList → MessageBubble (text, mentions, tool results, approvals, pipeline timeline)
|
|
37
|
+
├─ SuggestionBar (Pro: contextual followup chips)
|
|
38
|
+
└─ ChatInput / RichMentionInput (input box)
|
|
39
|
+
└─ VoiceInputAddon (optional: live waveform + STT)
|
|
40
|
+
|
|
41
|
+
VercelAiChat = AiChatProvider + ChatWindow (floating, draggable, resizable) + AiTriggerButton (the floating launcher)
|
|
42
|
+
LangGraphAiChat = same shape but talks LangGraph instead of Vercel AI SDK
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
`<VercelAiChat />` is the zero-config wrapper. For full control, drop down to `AiChatProvider` + `AiChatPanel`.
|
|
46
|
+
|
|
47
|
+
## Three integration levels
|
|
48
|
+
|
|
49
|
+
### Level 1 — VercelAiChat (zero config)
|
|
50
|
+
|
|
51
|
+
```tsx
|
|
52
|
+
'use client';
|
|
53
|
+
import { VercelAiChat } from 'glirastes/react/vercel';
|
|
54
|
+
import 'glirastes/react/styles.css';
|
|
55
|
+
|
|
56
|
+
export function ChatWidget() {
|
|
57
|
+
return <VercelAiChat endpoint="/api/chat" />;
|
|
58
|
+
}
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
This gives you the floating trigger button (bottom-right), draggable+resizable chat window, message rendering, mentions, voice input, approval cards. Everything wired up. ~80% of apps stop here.
|
|
62
|
+
|
|
63
|
+
### Level 2 — VercelAiChat with props
|
|
64
|
+
|
|
65
|
+
`VercelAiChat` (and `LangGraphAiChat`) accept layout + behaviour props:
|
|
66
|
+
|
|
67
|
+
```tsx
|
|
68
|
+
<VercelAiChat
|
|
69
|
+
endpoint="/api/chat"
|
|
70
|
+
headers={() => ({ Authorization: `Bearer ${getToken()}` })}
|
|
71
|
+
bodyExtras={() => ({ tenantId: getTenantId() })}
|
|
72
|
+
title="Assistant"
|
|
73
|
+
defaultOpen={false}
|
|
74
|
+
draggable
|
|
75
|
+
resizable
|
|
76
|
+
size={{ width: 400, height: 640 }}
|
|
77
|
+
hideTriggerWhenOpen
|
|
78
|
+
shortcut={{ key: 'k', meta: true }}
|
|
79
|
+
showMic={true}
|
|
80
|
+
showClearButton
|
|
81
|
+
confirmClear
|
|
82
|
+
showSessionSwitcher
|
|
83
|
+
welcomeMessage="Hi! Ask me about your tasks."
|
|
84
|
+
triggerIcon={<MyCustomIcon />}
|
|
85
|
+
headerActions={<MySettingsButton />}
|
|
86
|
+
sessions={{ storage: 'localStorage', maxHistory: 30 }}
|
|
87
|
+
autoResumeOnApproval
|
|
88
|
+
/>
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
Highlights:
|
|
92
|
+
|
|
93
|
+
| Prop | What it does |
|
|
94
|
+
|---|---|
|
|
95
|
+
| `headers` | Function returning request headers — refreshed on every request, ideal for JWT |
|
|
96
|
+
| `bodyExtras` | Extra fields merged into the chat request body — tenant ID, locale, etc. |
|
|
97
|
+
| `shortcut` | Keyboard shortcut to toggle the chat (e.g. `⌘K`) |
|
|
98
|
+
| `showMic` | Voice input toggle. Set `false` to drop `wavesurfer.js` from the bundle entirely |
|
|
99
|
+
| `sessions` | Multi-session history — switches between conversations, persists across reloads |
|
|
100
|
+
| `autoResumeOnApproval` | After an approval card is approved, the LLM continues without manual nudge |
|
|
101
|
+
|
|
102
|
+
### Level 3 — AiChatProvider + AiChatPanel (full control)
|
|
103
|
+
|
|
104
|
+
When you need a non-floating layout (sidebar, full-page, embedded), compose manually:
|
|
105
|
+
|
|
106
|
+
```tsx
|
|
107
|
+
'use client';
|
|
108
|
+
import { AiChatProvider, AiChatPanel, useAiChat } from 'glirastes/react';
|
|
109
|
+
import { useVercelAiChatTransport } from 'glirastes/react/vercel';
|
|
110
|
+
|
|
111
|
+
export function FullPageChat() {
|
|
112
|
+
const transport = useVercelAiChatTransport({
|
|
113
|
+
endpoint: '/api/chat',
|
|
114
|
+
headers: () => ({ Authorization: `Bearer ${getToken()}` }),
|
|
115
|
+
});
|
|
116
|
+
|
|
117
|
+
return (
|
|
118
|
+
<AiChatProvider transport={transport}>
|
|
119
|
+
<div className="h-full flex">
|
|
120
|
+
<Sidebar />
|
|
121
|
+
<AiChatPanel className="flex-1" />
|
|
122
|
+
</div>
|
|
123
|
+
</AiChatProvider>
|
|
124
|
+
);
|
|
125
|
+
}
|
|
126
|
+
```
|
|
127
|
+
|
|
128
|
+
Inside any descendant of `AiChatProvider`, `useAiChat()` exposes the full state — messages, sending, current pipeline state, etc. Useful when you want to render messages elsewhere or add custom controls.
|
|
129
|
+
|
|
130
|
+
## UI Action Bus — frontend reactions to tool results
|
|
131
|
+
|
|
132
|
+
Tool results that carry a `uiAction` payload (from `uiPattern` or `uiActionOnSuccess`) are dispatched through `UiActionBus`. Register handlers anywhere in the component tree:
|
|
133
|
+
|
|
134
|
+
```tsx
|
|
135
|
+
'use client';
|
|
136
|
+
import { useAiClientAction } from 'glirastes/react';
|
|
137
|
+
import { useRouter } from 'next/navigation';
|
|
138
|
+
import { toast } from 'sonner';
|
|
139
|
+
|
|
140
|
+
export function TaskList() {
|
|
141
|
+
const router = useRouter();
|
|
142
|
+
|
|
143
|
+
// Open the detail view when the LLM picks a task
|
|
144
|
+
useAiClientAction('task-details.open', (payload) => {
|
|
145
|
+
router.push(`/tasks/${payload?.taskId}`);
|
|
146
|
+
});
|
|
147
|
+
|
|
148
|
+
// Refresh the list after a mutation
|
|
149
|
+
useAiClientAction('tasks.refresh', () => {
|
|
150
|
+
queryClient.invalidateQueries({ queryKey: ['tasks'] });
|
|
151
|
+
});
|
|
152
|
+
|
|
153
|
+
// Open a custom dialog
|
|
154
|
+
useAiClientAction('task-create-dialog.open', () => {
|
|
155
|
+
setCreateDialogOpen(true);
|
|
156
|
+
});
|
|
157
|
+
|
|
158
|
+
return /* ... */;
|
|
159
|
+
}
|
|
160
|
+
```
|
|
161
|
+
|
|
162
|
+
Action IDs follow conventions derived from `uiPattern`:
|
|
163
|
+
|
|
164
|
+
| `uiPattern.type` | Derived action ID |
|
|
165
|
+
|---|---|
|
|
166
|
+
| `open-detail`, `entity: 'task'` | `task-details.open` |
|
|
167
|
+
| `open-dialog`, `dialog: 'create-task'` | `task-create-dialog.open` |
|
|
168
|
+
| `refresh`, `target: 'tasks'` | `tasks.refresh` |
|
|
169
|
+
| `toast` | dispatched directly to your toast lib via the SDK's toast handler config |
|
|
170
|
+
|
|
171
|
+
For raw `uiActionOnSuccess: { type: 'run-client-action', actionId: 'X' }` you choose any string for `actionId`.
|
|
172
|
+
|
|
173
|
+
`glirastes coverage` reports any action ID declared in tools but not handled (or vice versa).
|
|
174
|
+
|
|
175
|
+
## Approval cards
|
|
176
|
+
|
|
177
|
+
Mutations with `needsApproval: true` (default for POST/PATCH/PUT/DELETE) render an approval card before executing. The default card shows:
|
|
178
|
+
|
|
179
|
+
- Tool name and description
|
|
180
|
+
- Input parameters
|
|
181
|
+
- Approve / Cancel buttons
|
|
182
|
+
|
|
183
|
+
Customize per-tool with optional `approvalCard` config:
|
|
184
|
+
|
|
185
|
+
```ts
|
|
186
|
+
defineEndpointTool({
|
|
187
|
+
// ...
|
|
188
|
+
approvalCard: {
|
|
189
|
+
title: 'Create task',
|
|
190
|
+
description: (input) => `Create task "${input.title}"?`,
|
|
191
|
+
severity: 'info', // or 'warning' | 'danger' for destructive ops
|
|
192
|
+
},
|
|
193
|
+
})
|
|
194
|
+
```
|
|
195
|
+
|
|
196
|
+
For full UI control, pass a custom component to `AiChatProvider`:
|
|
197
|
+
|
|
198
|
+
```tsx
|
|
199
|
+
<AiChatProvider
|
|
200
|
+
components={{ ApprovalCard: MyCustomApprovalCard }}
|
|
201
|
+
>
|
|
202
|
+
...
|
|
203
|
+
</AiChatProvider>
|
|
204
|
+
```
|
|
205
|
+
|
|
206
|
+
## Mentions (`@user`, `#tag`)
|
|
207
|
+
|
|
208
|
+
Mentions let users reference entities the LLM can resolve to IDs. Configure on the provider or on `VercelAiChat`:
|
|
209
|
+
|
|
210
|
+
```tsx
|
|
211
|
+
<VercelAiChat
|
|
212
|
+
endpoint="/api/chat"
|
|
213
|
+
mentions={{
|
|
214
|
+
triggers: {
|
|
215
|
+
'@': {
|
|
216
|
+
label: 'User',
|
|
217
|
+
search: async (query) => {
|
|
218
|
+
const users = await fetch(`/api/users/search?q=${query}`).then(r => r.json());
|
|
219
|
+
return users.map(u => ({ id: u.id, label: u.name, hint: u.email }));
|
|
220
|
+
},
|
|
221
|
+
},
|
|
222
|
+
'#': {
|
|
223
|
+
label: 'Tag',
|
|
224
|
+
search: async (query) => fetch(`/api/tags?q=${query}`).then(r => r.json()),
|
|
225
|
+
},
|
|
226
|
+
},
|
|
227
|
+
}}
|
|
228
|
+
/>
|
|
229
|
+
```
|
|
230
|
+
|
|
231
|
+
Mentions in the input get serialized into the user message — your tools see structured references the LLM can pass back as IDs:
|
|
232
|
+
|
|
233
|
+
```
|
|
234
|
+
Input: "assign @Alice the task #urgent"
|
|
235
|
+
Wire: "assign user_123 the task with tag tag_456"
|
|
236
|
+
```
|
|
237
|
+
|
|
238
|
+
## Theming
|
|
239
|
+
|
|
240
|
+
The chat UI is styled with a small token system. Override at the provider level:
|
|
241
|
+
|
|
242
|
+
```tsx
|
|
243
|
+
<VercelAiChat
|
|
244
|
+
endpoint="/api/chat"
|
|
245
|
+
theme={{
|
|
246
|
+
colors: {
|
|
247
|
+
primary: '#6366f1',
|
|
248
|
+
background: '#0a0a0a',
|
|
249
|
+
foreground: '#ffffff',
|
|
250
|
+
muted: '#262626',
|
|
251
|
+
border: '#404040',
|
|
252
|
+
},
|
|
253
|
+
radius: '12px',
|
|
254
|
+
fontFamily: 'Inter, sans-serif',
|
|
255
|
+
}}
|
|
256
|
+
/>
|
|
257
|
+
```
|
|
258
|
+
|
|
259
|
+
For deeper customization, swap the default `glirastes/react/styles.css` for your own:
|
|
260
|
+
|
|
261
|
+
1. Don't import `glirastes/react/styles.css`
|
|
262
|
+
2. Inspect the DOM (every component has stable `data-*` attributes) — e.g. `[data-glirastes='chat-panel']`, `[data-part='message-bubble']`
|
|
263
|
+
3. Write your own CSS targeting those selectors
|
|
264
|
+
|
|
265
|
+
## Voice input (Deepgram speech-to-text)
|
|
266
|
+
|
|
267
|
+
The trigger button has a built-in mic mode. When the user holds the mic:
|
|
268
|
+
|
|
269
|
+
1. Browser captures audio
|
|
270
|
+
2. `wavesurfer.js` renders a live waveform
|
|
271
|
+
3. Audio frames stream to your backend's `/api/ai/speech-stream` WebSocket
|
|
272
|
+
4. Backend proxies to Deepgram, streams transcriptions back
|
|
273
|
+
5. On release, the final transcript becomes the chat input
|
|
274
|
+
|
|
275
|
+
**Frontend setup:**
|
|
276
|
+
|
|
277
|
+
```bash
|
|
278
|
+
npm install wavesurfer.js
|
|
279
|
+
```
|
|
280
|
+
|
|
281
|
+
```tsx
|
|
282
|
+
<VercelAiChat
|
|
283
|
+
endpoint="/api/chat"
|
|
284
|
+
showMic={true}
|
|
285
|
+
voiceInput={{
|
|
286
|
+
websocketUrl: '/api/ai/speech-stream',
|
|
287
|
+
language: 'en', // or 'de', etc.
|
|
288
|
+
}}
|
|
289
|
+
/>
|
|
290
|
+
```
|
|
291
|
+
|
|
292
|
+
**Backend setup:** see [integrating-glirastes-nestjs](../integrating-glirastes-nestjs/SKILL.md) → "Speech-to-text WebSocket". For Next.js standalone, you need a separate WebSocket server — Next.js Route Handlers don't support WS natively.
|
|
293
|
+
|
|
294
|
+
If you don't want voice input at all, set `showMic={false}` and skip installing `wavesurfer.js`. The components are tree-shaken.
|
|
295
|
+
|
|
296
|
+
### Content Security Policy and `wavesurfer.js`
|
|
297
|
+
|
|
298
|
+
The optional-peer loader for `wavesurfer.js` uses `new Function('s', 'return import(s)')` to hide the specifier from bundlers (so apps that don't install the peer don't fail to build). This requires `script-src 'unsafe-eval'` in your CSP.
|
|
299
|
+
|
|
300
|
+
If your deployment forbids `unsafe-eval` **and** you want voice input, install `wavesurfer.js` unconditionally:
|
|
301
|
+
|
|
302
|
+
```bash
|
|
303
|
+
npm install wavesurfer.js
|
|
304
|
+
```
|
|
305
|
+
|
|
306
|
+
With the peer present at install time, the bundler resolves the static path successfully and the runtime trick is bypassed entirely. Strict-CSP environments without voice can stay on `showMic={false}` and never need `wavesurfer.js`.
|
|
307
|
+
|
|
308
|
+
## ChatWindow — portal, draggable, resizable
|
|
309
|
+
|
|
310
|
+
`VercelAiChat` already wraps the panel in a `ChatWindow`. If you compose manually, you can use the window separately:
|
|
311
|
+
|
|
312
|
+
```tsx
|
|
313
|
+
import { ChatWindow, AiChatPanel } from 'glirastes/react';
|
|
314
|
+
|
|
315
|
+
<ChatWindow
|
|
316
|
+
open={open}
|
|
317
|
+
onOpenChange={setOpen}
|
|
318
|
+
draggable
|
|
319
|
+
resizable
|
|
320
|
+
size={{ width: 400, height: 640 }}
|
|
321
|
+
defaultPosition={{ x: 'right', y: 'bottom', offset: 24 }}
|
|
322
|
+
>
|
|
323
|
+
<AiChatPanel />
|
|
324
|
+
</ChatWindow>
|
|
325
|
+
```
|
|
326
|
+
|
|
327
|
+
The window portals to `document.body` by default — no z-index fights with your app shell.
|
|
328
|
+
|
|
329
|
+
## Sessions (multi-conversation)
|
|
330
|
+
|
|
331
|
+
Enable conversation history with the `sessions` prop:
|
|
332
|
+
|
|
333
|
+
```tsx
|
|
334
|
+
<VercelAiChat
|
|
335
|
+
endpoint="/api/chat"
|
|
336
|
+
sessions={{
|
|
337
|
+
storage: 'localStorage', // or a custom adapter implementing { load, save, clear }
|
|
338
|
+
maxHistory: 30,
|
|
339
|
+
onCreate: (session) => trackEvent('chat:new-session'),
|
|
340
|
+
}}
|
|
341
|
+
showSessionSwitcher
|
|
342
|
+
/>
|
|
343
|
+
```
|
|
344
|
+
|
|
345
|
+
A session switcher renders in the header (with `showSessionSwitcher`); users can name, switch, or delete sessions. Custom adapters let you persist server-side instead of localStorage.
|
|
346
|
+
|
|
347
|
+
## Pipeline timeline (Pro)
|
|
348
|
+
|
|
349
|
+
When `GLIRASTES_API_KEY` is set, the chat shows per-request pipeline steps inline (intent classification, guardrails, tool calls, model selection):
|
|
350
|
+
|
|
351
|
+
```
|
|
352
|
+
↳ Intent: task_query (0.94)
|
|
353
|
+
↳ Tools available: 3
|
|
354
|
+
↳ Model: gpt-4o-mini
|
|
355
|
+
↳ Tool call: list_tasks (124ms)
|
|
356
|
+
```
|
|
357
|
+
|
|
358
|
+
No setup beyond having the key — the timeline auto-renders inside the message bubble of the corresponding assistant turn.
|
|
359
|
+
|
|
360
|
+
## Common pitfalls
|
|
361
|
+
|
|
362
|
+
| Symptom | Cause | Fix |
|
|
363
|
+
|---|---|---|
|
|
364
|
+
| Widget unstyled | `styles.css` not imported | Add `import 'glirastes/react/styles.css'` near the root |
|
|
365
|
+
| Floating button overlaps a sticky footer | Default position bottom-right | Pass `defaultPosition={{ x: 'right', y: 'bottom', offset: 80 }}` |
|
|
366
|
+
| `useAiClientAction` doesn't fire | Component not mounted when the action arrives | Mount the handler in a layout that's always rendered |
|
|
367
|
+
| Mentions search runs on every keystroke | No debounce | Wrap your `search` fn with `lodash.debounce` (300ms typical) |
|
|
368
|
+
| Voice input fails silently | WebSocket URL wrong / `DEEPGRAM_API_KEY` missing | Check browser DevTools → WS frame; check backend logs |
|
|
369
|
+
| Approval card not shown for a mutation | Tool sets `needsApproval: false` explicitly | Either remove the override or set `autoApproveTools` per-user |
|
|
370
|
+
| Approval card shown for a benign GET | Tool overrides `needsApproval: true` | GETs default to `false` — drop the override |
|
|
371
|
+
| Multiple chat instances on the page | Mounted `<VercelAiChat />` more than once | Render exactly one in your root layout |
|
|
372
|
+
| Bundle includes `wavesurfer.js` despite `showMic={false}` | Direct import of voice components elsewhere | Remove any `import` from `glirastes/react/components/recording-bar` etc. |
|
|
373
|
+
|
|
374
|
+
## What this skill does NOT cover
|
|
375
|
+
|
|
376
|
+
- **Initial integration** (install, route handler, widget mount) — see [integrating-glirastes-nextjs](../integrating-glirastes-nextjs/SKILL.md) or [integrating-glirastes-nestjs](../integrating-glirastes-nestjs/SKILL.md)
|
|
377
|
+
- **Tool authoring** (`uiPattern` / `uiActionOnSuccess` semantics, `actionId` derivation, approval flag) — see [maintaining-glirastes-tools](../maintaining-glirastes-tools/SKILL.md)
|
|
378
|
+
- **LangGraph transport differences** — replace `useVercelAiChatTransport` / `VercelAiChat` with `useLangGraphAiChatTransport` / `LangGraphAiChat`; everything else in this skill applies unchanged
|