@bmx-labs/chat-widget 0.0.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.
Files changed (57) hide show
  1. package/LICENSE +661 -0
  2. package/README.md +90 -0
  3. package/dist/adapters/AnthropicAdapter.d.ts +16 -0
  4. package/dist/adapters/ContextAdapter.d.ts +19 -0
  5. package/dist/adapters/CustomAPIAdapter.d.ts +20 -0
  6. package/dist/adapters/KnowledgeBaseAdapter.d.ts +20 -0
  7. package/dist/adapters/MockAdapter.d.ts +6 -0
  8. package/dist/adapters/MorphexAdapter.d.ts +16 -0
  9. package/dist/adapters/OpenAIAdapter.d.ts +17 -0
  10. package/dist/adapters/RAGAdapter.d.ts +29 -0
  11. package/dist/adapters/RestRAGAdapter.d.ts +9 -0
  12. package/dist/adapters/TestAdapter.d.ts +6 -0
  13. package/dist/adapters/context/ContextAdapter.d.ts +19 -0
  14. package/dist/adapters/context/KnowledgeBaseAdapter.d.ts +20 -0
  15. package/dist/adapters/context/MorphexAdapter.d.ts +16 -0
  16. package/dist/adapters/context/PineconeRAGAdapter.d.ts +40 -0
  17. package/dist/adapters/context/RAGAdapter.d.ts +29 -0
  18. package/dist/adapters/context/index.d.ts +2 -0
  19. package/dist/adapters/index.d.ts +2 -0
  20. package/dist/adapters/mock.d.ts +2 -0
  21. package/dist/adapters/rest.d.ts +7 -0
  22. package/dist/components/BmxChatBot.d.ts +2 -0
  23. package/dist/components/LazyComponents.d.ts +3 -0
  24. package/dist/components/Orb.d.ts +8 -0
  25. package/dist/components/OrbButton.d.ts +10 -0
  26. package/dist/components/SimpleIridescence.d.ts +8 -0
  27. package/dist/components/SimpleOrb.d.ts +8 -0
  28. package/dist/components/chat/ChatButton.d.ts +10 -0
  29. package/dist/components/chat/ChatHeader.d.ts +7 -0
  30. package/dist/components/chat/ChatInput.d.ts +11 -0
  31. package/dist/components/chat/ChatPanel.d.ts +24 -0
  32. package/dist/components/chat/SettingsPanel.d.ts +12 -0
  33. package/dist/components/markdown/index.d.ts +3 -0
  34. package/dist/components/message/AssistantMessage.d.ts +6 -0
  35. package/dist/components/message/MessageItem.d.ts +6 -0
  36. package/dist/components/message/MessageList.d.ts +7 -0
  37. package/dist/components/message/TypingIndicator.d.ts +1 -0
  38. package/dist/components/message/UserMessage.d.ts +6 -0
  39. package/dist/components/ogl/DarkVeil.d.ts +11 -0
  40. package/dist/components/ogl/Iridescence.d.ts +8 -0
  41. package/dist/components/ogl/Orb.d.ts +8 -0
  42. package/dist/components/ogl/OrbButton.d.ts +10 -0
  43. package/dist/data/morphexData.d.ts +7 -0
  44. package/dist/framer.js +1 -0
  45. package/dist/index.d.ts +3 -0
  46. package/dist/index.js +1 -0
  47. package/dist/index.js.map +1 -0
  48. package/dist/ogl.js +1 -0
  49. package/dist/styles.css +1 -0
  50. package/dist/styles.css.map +1 -0
  51. package/dist/styles.js +0 -0
  52. package/dist/styles.js.map +1 -0
  53. package/dist/types.d.ts +30 -0
  54. package/dist/utils/format.d.ts +7 -0
  55. package/dist/utils/logger.d.ts +43 -0
  56. package/dist/vendors.js +1 -0
  57. package/package.json +78 -0
package/README.md ADDED
@@ -0,0 +1,90 @@
1
+ # @bmx-labs/chat-widget
2
+
3
+ A reusable chat AI widget for React/Next.js apps. Fixed bottom-right with highest stacking order, pluggable backend adapter.
4
+
5
+ ## Install
6
+
7
+ ```bash
8
+ npm i @bmx-labs/chat-widget react react-dom
9
+ ```
10
+
11
+ ## Usage
12
+
13
+ ```tsx
14
+ import React from "react";
15
+ import { BmxChatBot } from "@bmx-labs/chat-widget";
16
+ import { PineconeRAGAdapter } from "@bmx-labs/chat-widget/adapters/context";
17
+
18
+ export default function App() {
19
+ // Frontend-only RAG adapter: embeds query with OpenAI, retrieves topK from Pinecone,
20
+ // builds a system prompt, then calls OpenAI chat to generate the answer.
21
+ const api = new PineconeRAGAdapter({
22
+ openAIApiKey: process.env.NEXT_PUBLIC_OPENAI_API_KEY!,
23
+ pineconeApiKey: process.env.NEXT_PUBLIC_PINECONE_API_KEY!,
24
+ pineconeIndexUrl: process.env.NEXT_PUBLIC_PINECONE_HOST!,
25
+ chatModel: "gpt-4o-mini",
26
+ });
27
+
28
+ return <BmxChatBot api={api} projectId="<your_project_id>" />;
29
+ }
30
+ ```
31
+
32
+ - The widget is rendered via a portal to `document.body` with a very high `z-index`.
33
+ - Provide your own API route at `/api/ai` that proxies to your LLM provider. Do not expose secrets in the browser.
34
+
35
+ ### Adapters
36
+
37
+ - `PineconeRAGAdapter` – Frontend RAG: OpenAI embeddings → Pinecone vector search → OpenAI chat.
38
+ - `createMockAdapter(delayMs?)` – Echo responses for local dev.
39
+
40
+ ### PineconeRAGAdapter Config
41
+
42
+ ```ts
43
+ type PineconeRAGAdapterConfig = {
44
+ openAIApiKey: string;
45
+ pineconeApiKey: string;
46
+ pineconeIndexUrl: string; // e.g. https://bmx-xxxx.svc.region.pinecone.io
47
+ namespace?: string; // default: 'bmx-docs'
48
+ topK?: number; // default: 4
49
+ chatModel?: string; // default: gpt-4o-mini
50
+ embeddingModel?: string; // default: text-embedding-3-large
51
+ openAIBaseURL?: string; // default: https://api.openai.com/v1
52
+ enableStreaming?: boolean; // not yet used
53
+ maxContextTokens?: number; // default: 2000
54
+ minScoreThreshold?: number; // default: 0.3
55
+ debug?: boolean; // default: false
56
+ };
57
+ ```
58
+
59
+ ### BmxChatBot Props
60
+
61
+ - `api` (required): adapter implementing `sendMessage(history, input, options)`
62
+ - `projectId`
63
+ - `zIndex` (optional): override default
64
+ - `storage` (optional): `'local' | 'none'` (default `'local'`)
65
+ - `storageKey` (optional)
66
+ - `placeholder`, `title` (optional)
67
+
68
+ ## Development
69
+
70
+ ```bash
71
+ npm install
72
+ npm run build
73
+ npm run dev
74
+ ```
75
+
76
+ ### GitHub Actions (Publish on tag)
77
+
78
+ 1. Create an npm token and add it as `NPM_TOKEN` in GitHub repository secrets.
79
+ 2. Push a tag to trigger publish:
80
+
81
+ ```bash
82
+ git tag v0.1.1
83
+ git push --tags
84
+ ```
85
+
86
+ The workflow at `.github/workflows/publish.yml` will build and publish to npm.
87
+
88
+ ## License
89
+
90
+ This project is licensed as **GNU AGPLv3**.
@@ -0,0 +1,16 @@
1
+ import type { BmxChatApiAdapter, ChatMessage } from "../types";
2
+ interface AnthropicAdapterConfig {
3
+ apiKey: string;
4
+ model?: string;
5
+ baseURL?: string;
6
+ }
7
+ export declare class AnthropicAdapter implements BmxChatApiAdapter {
8
+ private apiKey;
9
+ private model;
10
+ private baseURL;
11
+ constructor(config: AnthropicAdapterConfig);
12
+ sendMessage(history: ChatMessage[], input: string, options?: {
13
+ signal?: AbortSignal;
14
+ }): Promise<ChatMessage>;
15
+ }
16
+ export {};
@@ -0,0 +1,19 @@
1
+ import type { BmxChatApiAdapter, ChatMessage } from "../types";
2
+ export interface ContextAdapterConfig {
3
+ apiKey: string;
4
+ model?: string;
5
+ baseURL?: string;
6
+ contextData?: string;
7
+ contextPrompt?: string;
8
+ }
9
+ export declare class ContextAdapter implements BmxChatApiAdapter {
10
+ private apiKey;
11
+ private model;
12
+ private baseURL;
13
+ private contextData;
14
+ private contextPrompt;
15
+ constructor(config: ContextAdapterConfig);
16
+ sendMessage(history: ChatMessage[], input: string, options?: {
17
+ signal?: AbortSignal;
18
+ }): Promise<ChatMessage>;
19
+ }
@@ -0,0 +1,20 @@
1
+ import type { BmxChatApiAdapter, ChatMessage } from "../types";
2
+ interface CustomAPIAdapterConfig {
3
+ endpoint: string;
4
+ apiKey?: string;
5
+ headers?: Record<string, string>;
6
+ transformRequest?: (history: ChatMessage[], input: string) => any;
7
+ transformResponse?: (response: any) => string;
8
+ }
9
+ export declare class CustomAPIAdapter implements BmxChatApiAdapter {
10
+ private endpoint;
11
+ private apiKey?;
12
+ private headers;
13
+ private transformRequest;
14
+ private transformResponse;
15
+ constructor(config: CustomAPIAdapterConfig);
16
+ sendMessage(history: ChatMessage[], input: string, options?: {
17
+ signal?: AbortSignal;
18
+ }): Promise<ChatMessage>;
19
+ }
20
+ export {};
@@ -0,0 +1,20 @@
1
+ import type { BmxChatApiAdapter, ChatMessage } from "../types";
2
+ export interface KnowledgeBaseAdapterConfig {
3
+ apiKey: string;
4
+ model?: string;
5
+ baseURL?: string;
6
+ knowledgeBase: Record<string, string>;
7
+ maxContextLength?: number;
8
+ }
9
+ export declare class KnowledgeBaseAdapter implements BmxChatApiAdapter {
10
+ private apiKey;
11
+ private model;
12
+ private baseURL;
13
+ private knowledgeBase;
14
+ private maxContextLength;
15
+ constructor(config: KnowledgeBaseAdapterConfig);
16
+ private findRelevantKnowledge;
17
+ sendMessage(history: ChatMessage[], input: string, options?: {
18
+ signal?: AbortSignal;
19
+ }): Promise<ChatMessage>;
20
+ }
@@ -0,0 +1,6 @@
1
+ import type { BmxChatApiAdapter, ChatMessage } from "../types";
2
+ export declare class MockAdapter implements BmxChatApiAdapter {
3
+ sendMessage(history: ChatMessage[], input: string, options?: {
4
+ signal?: AbortSignal;
5
+ }): Promise<ChatMessage>;
6
+ }
@@ -0,0 +1,16 @@
1
+ import type { BmxChatApiAdapter, ChatMessage } from "../types";
2
+ export type OpenAIModel = "gpt-4o-mini" | "gpt-4o" | "gpt-4-turbo" | "gpt-3.5-turbo" | "gpt-4" | "o1-mini" | "o1-preview";
3
+ export interface MorphexAdapterConfig {
4
+ apiKey: string;
5
+ model?: OpenAIModel;
6
+ baseURL?: string;
7
+ }
8
+ export declare class MorphexAdapter implements BmxChatApiAdapter {
9
+ private apiKey;
10
+ private model;
11
+ private baseURL;
12
+ constructor(config: MorphexAdapterConfig);
13
+ sendMessage(history: ChatMessage[], input: string, options?: {
14
+ signal?: AbortSignal;
15
+ }): Promise<ChatMessage>;
16
+ }
@@ -0,0 +1,17 @@
1
+ import type { BmxChatApiAdapter, ChatMessage } from "../types";
2
+ export type OpenAIModel = "gpt-4o-mini" | "gpt-4o" | "gpt-4-turbo" | "gpt-3.5-turbo" | "gpt-4" | "o1-mini" | "o1-preview";
3
+ interface OpenAIAdapterConfig {
4
+ apiKey: string;
5
+ model?: OpenAIModel;
6
+ baseURL?: string;
7
+ }
8
+ export declare class OpenAIAdapter implements BmxChatApiAdapter {
9
+ private apiKey;
10
+ private model;
11
+ private baseURL;
12
+ constructor(config: OpenAIAdapterConfig);
13
+ sendMessage(history: ChatMessage[], input: string, options?: {
14
+ signal?: AbortSignal;
15
+ }): Promise<ChatMessage>;
16
+ }
17
+ export {};
@@ -0,0 +1,29 @@
1
+ import type { BmxChatApiAdapter, ChatMessage } from "../types";
2
+ export interface Document {
3
+ id: string;
4
+ content: string;
5
+ metadata?: Record<string, any>;
6
+ }
7
+ export interface RAGAdapterConfig {
8
+ apiKey: string;
9
+ model?: string;
10
+ baseURL?: string;
11
+ documents: Document[];
12
+ chunkSize?: number;
13
+ topK?: number;
14
+ }
15
+ export declare class RAGAdapter implements BmxChatApiAdapter {
16
+ private apiKey;
17
+ private model;
18
+ private baseURL;
19
+ private documents;
20
+ private chunkSize;
21
+ private topK;
22
+ constructor(config: RAGAdapterConfig);
23
+ private chunkText;
24
+ private simpleSimilarity;
25
+ private retrieveRelevantChunks;
26
+ sendMessage(history: ChatMessage[], input: string, options?: {
27
+ signal?: AbortSignal;
28
+ }): Promise<ChatMessage>;
29
+ }
@@ -0,0 +1,9 @@
1
+ import type { BmxChatApiAdapter, ChatMessage } from "../types";
2
+ export interface RestRAGAdapterConfig {
3
+ baseURL?: string;
4
+ }
5
+ export declare class RestRAGAdapter implements BmxChatApiAdapter {
6
+ private baseURL;
7
+ constructor(config?: RestRAGAdapterConfig);
8
+ sendMessage(history: ChatMessage[], input: string): Promise<ChatMessage>;
9
+ }
@@ -0,0 +1,6 @@
1
+ import type { BmxChatApiAdapter, ChatMessage } from "../types";
2
+ export declare class TestAdapter implements BmxChatApiAdapter {
3
+ sendMessage(history: ChatMessage[], input: string, options?: {
4
+ signal?: AbortSignal;
5
+ }): Promise<ChatMessage>;
6
+ }
@@ -0,0 +1,19 @@
1
+ import type { BmxChatApiAdapter, ChatMessage } from "../../types";
2
+ export interface ContextAdapterConfig {
3
+ apiKey: string;
4
+ model?: string;
5
+ baseURL?: string;
6
+ contextData?: string;
7
+ contextPrompt?: string;
8
+ }
9
+ export declare class ContextAdapter implements BmxChatApiAdapter {
10
+ private apiKey;
11
+ private model;
12
+ private baseURL;
13
+ private contextData;
14
+ private contextPrompt;
15
+ constructor(config: ContextAdapterConfig);
16
+ sendMessage(history: ChatMessage[], input: string, options?: {
17
+ signal?: AbortSignal;
18
+ }): Promise<ChatMessage>;
19
+ }
@@ -0,0 +1,20 @@
1
+ import type { BmxChatApiAdapter, ChatMessage } from "../../types";
2
+ export interface KnowledgeBaseAdapterConfig {
3
+ apiKey: string;
4
+ model?: string;
5
+ baseURL?: string;
6
+ knowledgeBase: Record<string, string>;
7
+ maxContextLength?: number;
8
+ }
9
+ export declare class KnowledgeBaseAdapter implements BmxChatApiAdapter {
10
+ private apiKey;
11
+ private model;
12
+ private baseURL;
13
+ private knowledgeBase;
14
+ private maxContextLength;
15
+ constructor(config: KnowledgeBaseAdapterConfig);
16
+ private findRelevantKnowledge;
17
+ sendMessage(history: ChatMessage[], input: string, options?: {
18
+ signal?: AbortSignal;
19
+ }): Promise<ChatMessage>;
20
+ }
@@ -0,0 +1,16 @@
1
+ import type { BmxChatApiAdapter, ChatMessage } from "../../types";
2
+ export type OpenAIModel = "gpt-4o-mini" | "gpt-4o" | "gpt-4-turbo" | "gpt-3.5-turbo" | "gpt-4" | "o1-mini" | "o1-preview";
3
+ export interface MorphexAdapterConfig {
4
+ apiKey: string;
5
+ model?: OpenAIModel;
6
+ baseURL?: string;
7
+ }
8
+ export declare class MorphexAdapter implements BmxChatApiAdapter {
9
+ private apiKey;
10
+ private model;
11
+ private baseURL;
12
+ constructor(config: MorphexAdapterConfig);
13
+ sendMessage(history: ChatMessage[], input: string, options?: {
14
+ signal?: AbortSignal;
15
+ }): Promise<ChatMessage>;
16
+ }
@@ -0,0 +1,40 @@
1
+ import type { BmxChatApiAdapter, ChatMessage } from "../../types";
2
+ export interface PineconeRAGAdapterConfig {
3
+ openAIApiKey: string;
4
+ pineconeApiKey: string;
5
+ /** Example: https://myindex-abc123.svc.us-east1-aws.pinecone.io */
6
+ pineconeIndexUrl: string;
7
+ namespace?: string;
8
+ topK?: number;
9
+ chatModel?: string;
10
+ embeddingModel?: string;
11
+ openAIBaseURL?: string;
12
+ enableStreaming?: boolean;
13
+ maxContextTokens?: number;
14
+ minScoreThreshold?: number;
15
+ debug?: boolean;
16
+ }
17
+ export declare class PineconeRAGAdapter implements BmxChatApiAdapter {
18
+ private openAIApiKey;
19
+ private pineconeApiKey;
20
+ private pineconeIndexUrl;
21
+ private namespace;
22
+ private topK;
23
+ private chatModel;
24
+ private embeddingModel;
25
+ private openAIBaseURL;
26
+ private enableStreaming;
27
+ private maxContextTokens;
28
+ private minScoreThreshold;
29
+ private logger;
30
+ constructor(cfg: PineconeRAGAdapterConfig);
31
+ private embed;
32
+ private queryPinecone;
33
+ private preprocessQuery;
34
+ private estimateTokens;
35
+ private truncateContext;
36
+ private buildSystemPrompt;
37
+ sendMessage(history: ChatMessage[], input: string, options?: {
38
+ signal?: AbortSignal;
39
+ }): Promise<ChatMessage>;
40
+ }
@@ -0,0 +1,29 @@
1
+ import type { BmxChatApiAdapter, ChatMessage } from "../../types";
2
+ export interface Document {
3
+ id: string;
4
+ content: string;
5
+ metadata?: Record<string, any>;
6
+ }
7
+ export interface RAGAdapterConfig {
8
+ apiKey: string;
9
+ model?: string;
10
+ baseURL?: string;
11
+ documents: Document[];
12
+ chunkSize?: number;
13
+ topK?: number;
14
+ }
15
+ export declare class RAGAdapter implements BmxChatApiAdapter {
16
+ private apiKey;
17
+ private model;
18
+ private baseURL;
19
+ private documents;
20
+ private chunkSize;
21
+ private topK;
22
+ constructor(config: RAGAdapterConfig);
23
+ private chunkText;
24
+ private simpleSimilarity;
25
+ private retrieveRelevantChunks;
26
+ sendMessage(history: ChatMessage[], input: string, options?: {
27
+ signal?: AbortSignal;
28
+ }): Promise<ChatMessage>;
29
+ }
@@ -0,0 +1,2 @@
1
+ export { MorphexAdapter } from "./MorphexAdapter";
2
+ export { PineconeRAGAdapter } from "./PineconeRAGAdapter";
@@ -0,0 +1,2 @@
1
+ export { createMockAdapter } from "./mock";
2
+ export { MorphexAdapter, PineconeRAGAdapter } from "./context";
@@ -0,0 +1,2 @@
1
+ import type { BmxChatApiAdapter } from "../types";
2
+ export declare function createMockAdapter(delayMs?: number): BmxChatApiAdapter;
@@ -0,0 +1,7 @@
1
+ import type { BmxChatApiAdapter } from "../types";
2
+ export interface RestAdapterOptions {
3
+ baseUrl: string;
4
+ path?: string;
5
+ headers?: Record<string, string>;
6
+ }
7
+ export declare function createRestApiAdapter(options: RestAdapterOptions): BmxChatApiAdapter;
@@ -0,0 +1,2 @@
1
+ import type { BmxChatBotProps } from "../types";
2
+ export declare function BmxChatBot({ api, projectId, zIndex, storage, storageKey, placeholder, title, children, }: BmxChatBotProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,3 @@
1
+ export declare const LazyOrb: import("react").LazyExoticComponent<typeof import("./ogl/Orb").default>;
2
+ export declare const LazyIridescence: import("react").LazyExoticComponent<typeof import("./ogl/Iridescence").default>;
3
+ export declare const LazyReactMarkdown: import("react").LazyExoticComponent<typeof import("react-markdown").default>;
@@ -0,0 +1,8 @@
1
+ interface OrbProps {
2
+ hue?: number;
3
+ hoverIntensity?: number;
4
+ rotateOnHover?: boolean;
5
+ forceHoverState?: boolean;
6
+ }
7
+ export default function Orb({ hue, hoverIntensity, rotateOnHover, forceHoverState, }: OrbProps): import("react/jsx-runtime").JSX.Element;
8
+ export {};
@@ -0,0 +1,10 @@
1
+ interface OrbButtonProps {
2
+ open: boolean;
3
+ onClick: () => void;
4
+ hue?: number;
5
+ hoverIntensity?: number;
6
+ rotateOnHover?: boolean;
7
+ forceHoverState?: boolean;
8
+ }
9
+ export declare function OrbButton({ open, onClick, hue, hoverIntensity, rotateOnHover, forceHoverState, }: OrbButtonProps): import("react/jsx-runtime").JSX.Element;
10
+ export {};
@@ -0,0 +1,8 @@
1
+ interface SimpleIridescenceProps {
2
+ color?: [number, number, number];
3
+ mouseReact?: boolean;
4
+ amplitude?: number;
5
+ speed?: number;
6
+ }
7
+ export declare function SimpleIridescence({ color, mouseReact, amplitude, speed, }: SimpleIridescenceProps): import("react/jsx-runtime").JSX.Element;
8
+ export {};
@@ -0,0 +1,8 @@
1
+ interface SimpleOrbProps {
2
+ hue?: number;
3
+ hoverIntensity?: number;
4
+ rotateOnHover?: boolean;
5
+ forceHoverState?: boolean;
6
+ }
7
+ export declare function SimpleOrb({ hue, hoverIntensity, rotateOnHover, forceHoverState, }: SimpleOrbProps): import("react/jsx-runtime").JSX.Element;
8
+ export {};
@@ -0,0 +1,10 @@
1
+ interface ChatButtonProps {
2
+ open: boolean;
3
+ onClick: () => void;
4
+ hue?: number;
5
+ hoverIntensity?: number;
6
+ rotateOnHover?: boolean;
7
+ forceHoverState?: boolean;
8
+ }
9
+ export declare function ChatButton({ open, onClick, hue, hoverIntensity, rotateOnHover, forceHoverState }: ChatButtonProps): import("react/jsx-runtime").JSX.Element;
10
+ export {};
@@ -0,0 +1,7 @@
1
+ interface ChatHeaderProps {
2
+ title: string;
3
+ onClose: () => void;
4
+ onSettings: () => void;
5
+ }
6
+ export declare function ChatHeader({ title, onClose, onSettings }: ChatHeaderProps): import("react/jsx-runtime").JSX.Element;
7
+ export {};
@@ -0,0 +1,11 @@
1
+ import type { KeyboardEvent } from "react";
2
+ interface ChatInputProps {
3
+ input: string;
4
+ setInput: (value: string) => void;
5
+ onKeyDown: (e: KeyboardEvent<HTMLTextAreaElement>) => void;
6
+ onSend: () => void;
7
+ placeholder: string;
8
+ sending: boolean;
9
+ }
10
+ export declare function ChatInput({ input, setInput, onKeyDown, onSend, placeholder, sending, }: ChatInputProps): import("react/jsx-runtime").JSX.Element;
11
+ export {};
@@ -0,0 +1,24 @@
1
+ import type { ChatMessage } from "../../types";
2
+ import type { KeyboardEvent } from "react";
3
+ interface ChatPanelProps {
4
+ title: string;
5
+ messages: ChatMessage[];
6
+ input: string;
7
+ setInput: (value: string) => void;
8
+ onKeyDown: (e: KeyboardEvent<HTMLTextAreaElement>) => void;
9
+ onSend: () => void;
10
+ onClose: () => void;
11
+ placeholder: string;
12
+ sending: boolean;
13
+ showSettings: boolean;
14
+ onToggleSettings: () => void;
15
+ onClearHistory: () => void;
16
+ hue: number;
17
+ onHueChange: (hue: number) => void;
18
+ hoverIntensity: number;
19
+ onHoverIntensityChange: (intensity: number) => void;
20
+ rotateOnHover: boolean;
21
+ onRotateOnHoverChange: (rotate: boolean) => void;
22
+ }
23
+ export declare function ChatPanel({ title, messages, input, setInput, onKeyDown, onSend, onClose, placeholder, sending, showSettings, onToggleSettings, onClearHistory, hue, onHueChange, hoverIntensity, onHoverIntensityChange, rotateOnHover, onRotateOnHoverChange, }: ChatPanelProps): import("react/jsx-runtime").JSX.Element;
24
+ export {};
@@ -0,0 +1,12 @@
1
+ interface SettingsPanelProps {
2
+ onClose: () => void;
3
+ onClearHistory: () => void;
4
+ hue: number;
5
+ onHueChange: (hue: number) => void;
6
+ hoverIntensity: number;
7
+ onHoverIntensityChange: (intensity: number) => void;
8
+ rotateOnHover: boolean;
9
+ onRotateOnHoverChange: (rotate: boolean) => void;
10
+ }
11
+ export declare function SettingsPanel({ onClose, onClearHistory, hue, onHueChange, hoverIntensity, onHoverIntensityChange, rotateOnHover, onRotateOnHoverChange, }: SettingsPanelProps): import("react/jsx-runtime").JSX.Element;
12
+ export {};
@@ -0,0 +1,3 @@
1
+ import { Components } from "react-markdown";
2
+ export declare const components: Components;
3
+ export default components;
@@ -0,0 +1,6 @@
1
+ interface AssistantMessageProps {
2
+ content: string;
3
+ createdAt?: number;
4
+ }
5
+ export declare function AssistantMessage({ content, createdAt, }: AssistantMessageProps): import("react/jsx-runtime").JSX.Element;
6
+ export {};
@@ -0,0 +1,6 @@
1
+ import type { ChatMessage } from "../../types";
2
+ interface MessageItemProps {
3
+ message: ChatMessage;
4
+ }
5
+ export declare function MessageItem({ message }: MessageItemProps): import("react/jsx-runtime").JSX.Element;
6
+ export {};
@@ -0,0 +1,7 @@
1
+ import type { ChatMessage } from "../../types";
2
+ interface MessageListProps {
3
+ messages: ChatMessage[];
4
+ sending?: boolean;
5
+ }
6
+ export declare function MessageList({ messages, sending }: MessageListProps): import("react/jsx-runtime").JSX.Element;
7
+ export {};
@@ -0,0 +1 @@
1
+ export declare function TypingIndicator(): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,6 @@
1
+ interface UserMessageProps {
2
+ content: string;
3
+ createdAt?: number;
4
+ }
5
+ export declare function UserMessage({ content, createdAt }: UserMessageProps): import("react/jsx-runtime").JSX.Element;
6
+ export {};
@@ -0,0 +1,11 @@
1
+ type Props = {
2
+ hueShift?: number;
3
+ noiseIntensity?: number;
4
+ scanlineIntensity?: number;
5
+ speed?: number;
6
+ scanlineFrequency?: number;
7
+ warpAmount?: number;
8
+ resolutionScale?: number;
9
+ };
10
+ export default function DarkVeil({ hueShift, noiseIntensity, scanlineIntensity, speed, scanlineFrequency, warpAmount, resolutionScale, }: Props): import("react/jsx-runtime").JSX.Element;
11
+ export {};
@@ -0,0 +1,8 @@
1
+ interface IridescenceProps {
2
+ color?: [number, number, number];
3
+ speed?: number;
4
+ amplitude?: number;
5
+ mouseReact?: boolean;
6
+ }
7
+ export default function Iridescence({ color, speed, amplitude, mouseReact, ...rest }: IridescenceProps): import("react/jsx-runtime").JSX.Element;
8
+ export {};
@@ -0,0 +1,8 @@
1
+ interface OrbProps {
2
+ hue?: number;
3
+ hoverIntensity?: number;
4
+ rotateOnHover?: boolean;
5
+ forceHoverState?: boolean;
6
+ }
7
+ export default function Orb({ hue, hoverIntensity, rotateOnHover, forceHoverState, }: OrbProps): import("react/jsx-runtime").JSX.Element;
8
+ export {};
@@ -0,0 +1,10 @@
1
+ interface OrbButtonProps {
2
+ open: boolean;
3
+ onClick: () => void;
4
+ hue?: number;
5
+ hoverIntensity?: number;
6
+ rotateOnHover?: boolean;
7
+ forceHoverState?: boolean;
8
+ }
9
+ export declare function OrbButton({ open, onClick, hue, hoverIntensity, rotateOnHover, forceHoverState, }: OrbButtonProps): import("react/jsx-runtime").JSX.Element;
10
+ export {};
@@ -0,0 +1,7 @@
1
+ /**
2
+ * Comprehensive Morphex BMX Data
3
+ * This constant contains all the latest information about Morphex BMX
4
+ * for use in the chat bot's context
5
+ */
6
+ export declare const MORPHEX_BMX_DATA = "\n# Morphex BMX - Complete Information Guide\n\n## Overview\nBMX is a DeFi ecosystem designed to address a core challenge for long-term users and liquidity providers: the reliance on speculative trading cycles and temporary, unsustainable incentive programs. The protocol provides an alternative design for long-term holding, built on the principle of capturing real fees from a wide range of activities and routing them back to users without inflationary token emissions.\n\n## Catalyst Ahead\n- **DeliSwap Launch**: Long awaited launch of DeliSwap, a Base-native DEX built on Uniswap v4 hooks. Highly innovative design.\n- **Fee Cycling**: 100% of fees cycle back into BMX (97% auto-swapped, 3% to stakers). Even if routed through other aggregators, DeliSwap still captures backend fees.\n\n## Team, Tokenomics, Backing / Sentiment\n**Unique Backing**: One and only project after Aero where Coinbase market bought half a million $ worth of tokens onchain at 20% below current price.\n\n**Team**: Ex-Coinbase by Coinbase people, strong praise/support from Moonwell founder, Jesse etc.\n\n**Tokenomics**:\n- All tokens are unlocked\n- Only 16% in active circulation:\n - 70% are staked\n - 10% are in the treasury (according to the docs)\n - 4% are held by Coinbase Ventures, won't be sold anytime soon\n- ~2.7M Total supply, 700k tokens Circ.\n- At current prices that's just ~$4M effective mcap.\n- Project has Zero inflation, only buybacks announced recently\n\n## Platform Architecture\nThe ecosystem's architecture is centered around wBLT, an auto-compounding liquidity token comprised of blue-chip assets like BTC, ETH, and USDC. wBLT is designed to capture fees generated not only by BMX's native products but also from broader onchain activity, such as swaps routed through major DEX aggregators.\n\n## Core Products\n\n### 1. wBLT (Wrapped BMX Liquidity Token)\n- **Composition**: Blue-chip assets (cbBTC, ETH, USDC)\n- **Features**: Auto-compounding, transferable vault token\n- **APR**: Historical annualized APR around 60% (future rates may vary)\n- **Use Cases**: \n - High-quality collateral for platforms like Morpho\n - Useful pairing asset on DEXes\n - Auto-fee-accruing version of BLT\n\n### 2. BMX Classic\n- **Type**: Spot and margin trading platform based on GMX-v1\n- **Focus**: Capital efficiency and low fees\n- **Settlement**: All trades settled against singular liquidity pool (BLT)\n- **Liquidity**: Users can provide liquidity with any whitelisted asset\n\n### 3. BMX Freestyle\n- **Type**: Intent-based trading platform\n- **Features**: Low fees, access to over 250 trading markets\n- **Technology**: Powered by SYMMIO protocol\n- **Leverage**: Up to 60x leverage available\n\n### 4. Carousel (formerly Based MediaX)\n- **Type**: Non-fungible asset (NFA) exchange\n- **Features**: \n - Scan listings from all major NFT platforms\n - Save 50%+ on standard fees (0.25%)\n - Access auctions and randomized \"Carousel\" style listings\n - Earn or post incentives permissionlessly\n\n### 5. Deli Swap (Coming Soon)\n- **Type**: Base-native DEX built on Uniswap v4 hooks\n- **Architecture**: Non-custodial, decentralized, permissionless\n- **Features**: \n - Built on Uniswap V4 with hooks\n - wBLT base pairs in v1\n - 100% of fees distributed to BMX ecosystem\n - Static pool fees for v1, dynamic fees for v2\n\n## Fee Distribution System\n**Protocol Accrued Fee Allocation (BIP-20)**:\n- **Classic**: 80% to BLT, 20% to BMX Staking Safety Module (vote-directed)\n- **Freestyle**: 40% to BLT, 60% to BMX Staking Safety Module (vote-directed)\n- **Carousel**: 40% to BLT, 60% to BMX Staking Safety Module (vote-directed)\n- **Deli Swap**: 97% to LPs as BMX, 3% to BMX Staking Safety Module (vote-directed)\n\n## BMX Staking System\n**Staking Benefits**:\n- No lock up period\n- Receive multiplier points (100% APR)\n- Accrued fees routed as wETH\n- Available on Base, Mode, and Sonic\n\n**Multiplier Points (MPs)**:\n- Accrue at 100% APR on staked balance\n- Boost formula: Boost = MP / BMX\n- Unstaking burns MPs (encourages long-term staking)\n- Non-transferable and supply-neutral\n\n## Tokenomics & Distribution\n**Total Supply**: 2.85M BMX (after burns)\n**Allocation**:\n- **Treasury**: 322.61K BMX (10%)\n- **Team**: 419.39K BMX (13%)\n- **MPX Claimable Airdrop**: 600K BMX as oBMX (18.5%) - No Longer Active\n- **Initial Seed Liquidity**: 80.65K BMX (2.5%)\n\n**Recent Burns**: 179,688 BMX burned (bought back with treasury wBLT) as of June 15, 2024.\n\n## Technical Specifications\n**Networks**: Base, Mode, Sonic\n**Oracles**: Chainlink (onchain) and Pyth (offchain)\n**Governance**: Gas-free, off-chain voting via Snapshot\n**Security**: Multi-sig governed, audited contracts\n\n## Recent Developments\n- **Token Burns**: Over 5 million BMX tokens burned, valued at over $8 million\n- **Freestyle Launch**: New decentralized perpetual trading engine with 60x leverage\n- **wBLT Introduction**: Wrapped, composable, multi-use token with auto-fee-accruing\n- **DeliSwap Development**: Base-native DEX on Uniswap v4 hooks\n\n## Community & Resources\n- **Website**: https://morphex.trade\n- **Documentation**: https://docs.morphex.trade\n- **Discord**: https://discord.com/invite/morphex\n- **Warpcast**: https://warpcast.com/~/channel/morphex\n- **GitHub**: https://github.com/morphex\n- **Snapshot**: https://snapshot.box/#/s:bmxonbase.eth\n\n## Key Innovations\n1. **Vault-First Approach**: Automated fee-processing vaults\n2. **Composability**: wBLT enables multiple use cases\n3. **Capital Efficiency**: Eliminates competition between trading and native token liquidity\n4. **Zero Emissions**: No inflationary token emissions\n5. **Real Fee Capture**: Powered by actual protocol cash flow\n\n## Risk Management\n- **Counterparty Risk**: BLT is counterparty to traders\n- **Smart Contract Risk**: Standard DeFi protocol risks\n- **Asset Risk**: Exposure to bridged tokens and volatile assets\n- **Liquidation Risk**: Positions can be liquidated if margin insufficient\n\n## Getting Started\n1. Visit https://morphex.trade\n2. Connect wallet to Base/Mode/Sonic\n3. Choose product (Classic, Freestyle, Carousel)\n4. Deposit collateral and start trading\n5. Stake BMX for governance and fee accrual\n\nThis comprehensive guide covers all aspects of the BMX ecosystem including platform architecture, products, tokenomics, staking, and recent developments.\n";
7
+ export default MORPHEX_BMX_DATA;