@rayvision/ai-chat 0.0.1 → 0.0.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.
Files changed (40) hide show
  1. package/README.md +2 -2
  2. package/dist/index.d.ts +7 -427
  3. package/dist/index.js +45 -16461
  4. package/dist/index.mjs +9462 -12203
  5. package/dist/src/ai-chat.d.ts +4 -0
  6. package/dist/src/components/attachment-image-modal.d.ts +9 -0
  7. package/dist/src/components/chat-composer.d.ts +17 -0
  8. package/dist/src/components/chat-header.d.ts +10 -0
  9. package/dist/src/components/chat-launcher.d.ts +9 -0
  10. package/dist/src/components/chat-messages.d.ts +14 -0
  11. package/dist/src/components/chat-toast.d.ts +9 -0
  12. package/dist/src/components/message-bubble.d.ts +10 -0
  13. package/dist/src/components/modal.d.ts +11 -0
  14. package/dist/src/components/panel.d.ts +3 -0
  15. package/dist/src/components/popover.d.ts +11 -0
  16. package/dist/src/components/portal.d.ts +10 -0
  17. package/dist/src/components/tooltip.d.ts +11 -0
  18. package/dist/src/context/ai-chat-ui-context.d.ts +20 -0
  19. package/dist/src/controller/ai-chat-controller.d.ts +2 -0
  20. package/dist/src/hooks/use-ai-chat-layout.d.ts +10 -0
  21. package/dist/src/i18n/attachment-error-messages.d.ts +2 -0
  22. package/dist/src/i18n/index.d.ts +5 -0
  23. package/dist/src/i18n/messages.en.d.ts +62 -0
  24. package/dist/src/i18n/messages.zh.d.ts +62 -0
  25. package/dist/src/i18n/phase-labels.d.ts +10 -0
  26. package/dist/src/i18n/types.d.ts +1 -0
  27. package/dist/src/markdown/render.d.ts +3 -0
  28. package/dist/src/services/customer-v1/attachments/client.d.ts +9 -0
  29. package/dist/src/services/customer-v1/client.d.ts +9 -0
  30. package/dist/src/services/customer-v1/error.d.ts +3 -0
  31. package/dist/src/services/customer-v1/protocol.d.ts +112 -0
  32. package/dist/src/services/customer-v1/sse-parser.d.ts +2 -0
  33. package/dist/src/store/ai-chat-store.d.ts +41 -0
  34. package/dist/src/theme/global-style.d.ts +24 -0
  35. package/dist/src/theme/panel-style.d.ts +6 -0
  36. package/dist/src/types.d.ts +301 -0
  37. package/dist/src/utils/build-chat-content.d.ts +5 -0
  38. package/dist/src/utils/copy-text.d.ts +1 -0
  39. package/dist/src/utils/format-chat-file-error.d.ts +3 -0
  40. package/package.json +3 -3
@@ -0,0 +1,4 @@
1
+ /// <reference types="react" />
2
+ import type { AIChatMountOptions, AIChatMountResult, AIChatProps } from './types';
3
+ export declare function mountAIChat(target: HTMLElement, options?: AIChatMountOptions): AIChatMountResult;
4
+ export declare function AIChat(props: AIChatProps): JSX.Element | null;
@@ -0,0 +1,9 @@
1
+ /// <reference types="react" />
2
+ interface AttachmentImageModalProps {
3
+ open: boolean;
4
+ imageUrl: string | null;
5
+ anchor?: Node | null;
6
+ onClose(): void;
7
+ }
8
+ export declare function AttachmentImageModal({ open, imageUrl, anchor, onClose, }: AttachmentImageModalProps): JSX.Element | null;
9
+ export {};
@@ -0,0 +1,17 @@
1
+ /// <reference types="react" />
2
+ import { type PendingAttachment } from '../types';
3
+ interface ChatComposerProps {
4
+ attachments: PendingAttachment[];
5
+ draft: string;
6
+ busy: boolean;
7
+ accept: string;
8
+ attachmentsAvailable: boolean;
9
+ onDraftChange(value: string): void;
10
+ onPaste(event: React.ClipboardEvent<HTMLTextAreaElement>): void;
11
+ onFiles(files: File[]): void;
12
+ onRemoveAttachment(id: string): void;
13
+ onSubmit(): void;
14
+ onCancel(): void;
15
+ }
16
+ export declare function ChatComposer({ attachments, draft, busy, accept, attachmentsAvailable, onDraftChange, onPaste, onFiles, onRemoveAttachment, onSubmit, onCancel, }: ChatComposerProps): JSX.Element;
17
+ export {};
@@ -0,0 +1,10 @@
1
+ /// <reference types="react" />
2
+ interface ChatHeaderProps {
3
+ isWelcome: boolean;
4
+ onNewChat(): void;
5
+ onShare(): void;
6
+ shareDisabled?: boolean;
7
+ onCollapse(): void;
8
+ }
9
+ export declare function ChatHeader({ isWelcome, onNewChat, onShare, shareDisabled, onCollapse, }: ChatHeaderProps): JSX.Element;
10
+ export {};
@@ -0,0 +1,9 @@
1
+ import { type CSSProperties } from 'react';
2
+ import type { AIChatPanelProps } from '../types';
3
+ export declare function AIChatLauncher({ controller, disabled, className, onPositionChange, style, }: {
4
+ controller: AIChatPanelProps['controller'];
5
+ disabled?: boolean;
6
+ className?: string;
7
+ onPositionChange?: (left: number, top: number) => void;
8
+ style?: CSSProperties;
9
+ }): JSX.Element;
@@ -0,0 +1,14 @@
1
+ /// <reference types="react" />
2
+ import type { ChatMessage, Citation, SuggestedQuestion } from '../types';
3
+ interface ChatMessagesProps {
4
+ messages: ChatMessage[];
5
+ phase: string | null;
6
+ dragging: boolean;
7
+ suggestedQuestions: SuggestedQuestion[];
8
+ onSuggestedQuestion(question: SuggestedQuestion): void;
9
+ onCitationClick?(messageId: string, citationId: string): Promise<Citation | undefined>;
10
+ onRetry?(): void;
11
+ onFeedback?(messageId: string, rating: 'like' | 'dislike' | null, comment?: string): Promise<void>;
12
+ }
13
+ export declare function ChatMessages({ messages, phase, dragging, suggestedQuestions, onSuggestedQuestion, onCitationClick, onRetry, onFeedback, }: ChatMessagesProps): JSX.Element;
14
+ export {};
@@ -0,0 +1,9 @@
1
+ /// <reference types="react" />
2
+ import type { ChatToast } from '../types';
3
+ interface ChatToastProps {
4
+ toast: ChatToast | null;
5
+ duration?: number;
6
+ onClose(): void;
7
+ }
8
+ export declare function AIChatToast({ toast, duration, onClose, }: ChatToastProps): JSX.Element | null;
9
+ export {};
@@ -0,0 +1,10 @@
1
+ /// <reference types="react" />
2
+ import { type ChatFeedbackRating, type ChatMessage, type Citation } from '../types';
3
+ interface MessageBubbleProps {
4
+ message: ChatMessage;
5
+ onCitationClick?: (messageId: string, citationId: string) => Promise<Citation | undefined>;
6
+ onRetry?: () => void;
7
+ onFeedback?: (messageId: string, rating: ChatFeedbackRating | null, comment?: string) => Promise<void>;
8
+ }
9
+ export declare const MessageBubble: import("react").NamedExoticComponent<MessageBubbleProps>;
10
+ export {};
@@ -0,0 +1,11 @@
1
+ import type { ReactNode } from 'react';
2
+ import { type AIChatPortalContainer } from './portal';
3
+ export interface AIChatModalProps {
4
+ open: boolean;
5
+ children: ReactNode;
6
+ anchor?: Node | null;
7
+ container?: AIChatPortalContainer | null;
8
+ className?: string;
9
+ onClose?(): void;
10
+ }
11
+ export declare function AIChatModal({ open, children, anchor, container, className, onClose, }: AIChatModalProps): JSX.Element | null;
@@ -0,0 +1,3 @@
1
+ /// <reference types="react" />
2
+ import type { AIChatInternalPanelProps } from '../types';
3
+ export declare function AIChatPanel({ controller, adapter, language, panelStyle, onResizeStart, }: AIChatInternalPanelProps): JSX.Element | null;
@@ -0,0 +1,11 @@
1
+ import { type ReactNode } from 'react';
2
+ import { type AIChatPortalContainer } from './portal';
3
+ export interface AIChatPopoverProps {
4
+ open: boolean;
5
+ anchor?: HTMLElement | null;
6
+ children: ReactNode;
7
+ container?: AIChatPortalContainer | null;
8
+ className?: string;
9
+ onClose?(): void;
10
+ }
11
+ export declare function AIChatPopover({ open, anchor, children, container, className, onClose, }: AIChatPopoverProps): JSX.Element | null;
@@ -0,0 +1,10 @@
1
+ import type { ReactNode } from 'react';
2
+ export type AIChatPortalContainer = Element | DocumentFragment;
3
+ export declare function resolveAIChatPortalContainer(anchor: Node | null | undefined): AIChatPortalContainer | null;
4
+ interface AIChatPortalProps {
5
+ anchor?: Node | null;
6
+ container?: AIChatPortalContainer | null;
7
+ children: ReactNode;
8
+ }
9
+ export declare function AIChatPortal({ anchor, container, children, }: AIChatPortalProps): JSX.Element | null;
10
+ export {};
@@ -0,0 +1,11 @@
1
+ import type { CSSProperties, ReactNode } from 'react';
2
+ import { type AIChatPortalContainer } from './portal';
3
+ export interface AIChatTooltipProps {
4
+ open: boolean;
5
+ children: ReactNode;
6
+ anchor?: Node | null;
7
+ container?: AIChatPortalContainer | null;
8
+ className?: string;
9
+ style?: CSSProperties;
10
+ }
11
+ export declare function AIChatTooltip({ open, children, anchor, container, className, style, }: AIChatTooltipProps): JSX.Element | null;
@@ -0,0 +1,20 @@
1
+ import { type ReactNode } from 'react';
2
+ import type { AIChatMessages } from '../i18n';
3
+ import type { AIChatLanguage, AIChatTheme } from '../types';
4
+ interface AIChatUIContextValue {
5
+ labels: AIChatMessages;
6
+ language: AIChatLanguage;
7
+ theme: AIChatTheme;
8
+ toggleTheme: () => void;
9
+ }
10
+ export declare function AIChatUIProvider({ labels, language, theme, toggleTheme, children, }: {
11
+ labels: AIChatMessages;
12
+ language: AIChatLanguage;
13
+ theme: AIChatTheme;
14
+ toggleTheme: () => void;
15
+ children: ReactNode;
16
+ }): JSX.Element;
17
+ export declare function useAIChatUI(): AIChatUIContextValue;
18
+ export declare function useAIChatMessages(): Pick<AIChatUIContextValue, 'labels' | 'language'>;
19
+ export declare function useAIChatTheme(): Pick<AIChatUIContextValue, 'theme' | 'toggleTheme'>;
20
+ export {};
@@ -0,0 +1,2 @@
1
+ import type { AIChatController, AIChatControllerOptions } from '../types';
2
+ export declare function createAIChatController(options?: AIChatControllerOptions): AIChatController;
@@ -0,0 +1,10 @@
1
+ import { type CSSProperties, type PointerEvent } from 'react';
2
+ type ResizeEdge = 'left' | 'top' | 'right' | 'bottom';
3
+ interface AIChatLayout {
4
+ launcherStyle: CSSProperties;
5
+ panelStyle?: CSSProperties;
6
+ onPositionChange: (left: number, top: number) => void;
7
+ onResizeStart: (edge: ResizeEdge, event: PointerEvent) => void;
8
+ }
9
+ export declare function useAIChatLayout(enabled: boolean): AIChatLayout;
10
+ export {};
@@ -0,0 +1,2 @@
1
+ import type { AIChatLanguage } from './types';
2
+ export declare function getAttachmentErrorMessage(language: AIChatLanguage, errorCode: string): string;
@@ -0,0 +1,5 @@
1
+ import { ZH_MESSAGES } from './messages.zh';
2
+ import type { AIChatLanguage } from './types';
3
+ export type AIChatMessages = typeof ZH_MESSAGES;
4
+ export declare function getMessages(language: AIChatLanguage): AIChatMessages;
5
+ export { getPhaseLabel } from './phase-labels';
@@ -0,0 +1,62 @@
1
+ export declare const EN_MESSAGES: {
2
+ title: string;
3
+ openAssistant: string;
4
+ welcome: string;
5
+ welcomeDescription: string;
6
+ placeholder: string;
7
+ send: string;
8
+ stop: string;
9
+ newChat: string;
10
+ collapse: string;
11
+ citations: (count: number) => string;
12
+ expandCitations: string;
13
+ collapseCitations: string;
14
+ share: string;
15
+ sharing: string;
16
+ shareCopied: string;
17
+ shareFailed: string;
18
+ attach: string;
19
+ removeAttachment: string;
20
+ emptyInput: string;
21
+ dropFiles: string;
22
+ copied: string;
23
+ copyFailed: string;
24
+ copy: string;
25
+ humanSupport: string;
26
+ like: string;
27
+ dislike: string;
28
+ feedbackTitle: string;
29
+ feedbackSubmit: string;
30
+ feedbackThanks: string;
31
+ feedbackFailed: string;
32
+ closeFeedback: string;
33
+ feedbackOtherPlaceholder: string;
34
+ feedbackUnprofessional: string;
35
+ feedbackUnresolved: string;
36
+ feedbackMisunderstood: string;
37
+ feedbackSlow: string;
38
+ feedbackOther: string;
39
+ attachment: string;
40
+ fileLimitExceeded: (maxCount: number | string) => string;
41
+ fileTooLarge: (fileName: number | string) => string;
42
+ unsupportedFile: (fileName: number | string) => string;
43
+ attachmentError: (errorCode: string) => string;
44
+ processing: string;
45
+ syncing: string;
46
+ loading: string;
47
+ retry: string;
48
+ knowledgeBusy: string;
49
+ requestFailed: string;
50
+ darkMode: string;
51
+ lightMode: string;
52
+ previewImage: string;
53
+ closeImagePreview: string;
54
+ closeCitation: string;
55
+ assistantName: string;
56
+ citationCategoryPath: string;
57
+ citationPublishedAt: string;
58
+ citationUpdatedAt: string;
59
+ citationContentVersion: string;
60
+ attachmentUploaded: string;
61
+ disclaimer: string;
62
+ };
@@ -0,0 +1,62 @@
1
+ export declare const ZH_MESSAGES: {
2
+ title: string;
3
+ openAssistant: string;
4
+ welcome: string;
5
+ welcomeDescription: string;
6
+ placeholder: string;
7
+ send: string;
8
+ stop: string;
9
+ newChat: string;
10
+ collapse: string;
11
+ citations: (count: number) => string;
12
+ expandCitations: string;
13
+ collapseCitations: string;
14
+ share: string;
15
+ sharing: string;
16
+ shareCopied: string;
17
+ shareFailed: string;
18
+ attach: string;
19
+ removeAttachment: string;
20
+ emptyInput: string;
21
+ dropFiles: string;
22
+ copied: string;
23
+ copyFailed: string;
24
+ copy: string;
25
+ humanSupport: string;
26
+ like: string;
27
+ dislike: string;
28
+ feedbackTitle: string;
29
+ feedbackSubmit: string;
30
+ feedbackThanks: string;
31
+ feedbackFailed: string;
32
+ closeFeedback: string;
33
+ feedbackOtherPlaceholder: string;
34
+ feedbackUnprofessional: string;
35
+ feedbackUnresolved: string;
36
+ feedbackMisunderstood: string;
37
+ feedbackSlow: string;
38
+ feedbackOther: string;
39
+ attachment: string;
40
+ fileLimitExceeded: (maxCount: number | string) => string;
41
+ fileTooLarge: (fileName: number | string) => string;
42
+ unsupportedFile: (fileName: number | string) => string;
43
+ attachmentError: (errorCode: string) => string;
44
+ processing: string;
45
+ syncing: string;
46
+ loading: string;
47
+ retry: string;
48
+ knowledgeBusy: string;
49
+ requestFailed: string;
50
+ darkMode: string;
51
+ lightMode: string;
52
+ previewImage: string;
53
+ closeImagePreview: string;
54
+ closeCitation: string;
55
+ assistantName: string;
56
+ citationCategoryPath: string;
57
+ citationPublishedAt: string;
58
+ citationUpdatedAt: string;
59
+ citationContentVersion: string;
60
+ attachmentUploaded: string;
61
+ disclaimer: string;
62
+ };
@@ -0,0 +1,10 @@
1
+ import type { AIChatLanguage } from './types';
2
+ export declare const CHAT_PHASE: {
3
+ readonly PROCESSING: "processing";
4
+ readonly SEARCHING: "searching";
5
+ readonly READING: "reading";
6
+ readonly RESPONDING: "responding";
7
+ readonly FINALIZING: "finalizing";
8
+ };
9
+ export type ChatPhase = (typeof CHAT_PHASE)[keyof typeof CHAT_PHASE];
10
+ export declare function getPhaseLabel(language: AIChatLanguage, phase: string): string | null;
@@ -0,0 +1 @@
1
+ export type AIChatLanguage = 'zh' | 'en';
@@ -0,0 +1,3 @@
1
+ /// <reference types="react" />
2
+ import type { ChatMarkdownProps } from '../types';
3
+ export declare function ChatMarkdown({ children, className, onImageClick }: ChatMarkdownProps): JSX.Element;
@@ -0,0 +1,9 @@
1
+ import type { Attachment, AttachmentOptions, GatewayError } from '../../../types';
2
+ export interface AttachmentClient {
3
+ getOptions(): Promise<AttachmentOptions>;
4
+ upload(file: File, clientUploadId: string): Promise<Attachment>;
5
+ getContent(attachmentId: string, download?: boolean): Promise<Blob>;
6
+ delete(attachmentId: string): Promise<void>;
7
+ }
8
+ export declare function createAttachmentClient(baseUrl: string): AttachmentClient;
9
+ export declare function isGatewayError(value: unknown): value is GatewayError;
@@ -0,0 +1,9 @@
1
+ import type { ChatAdapter, ConversationItem, Attachment, AttachmentOptions } from '../../types';
2
+ export interface CustomerV1ChatAdapterOptions {
3
+ baseUrl?: string;
4
+ shareOrigin?: string;
5
+ module?: string;
6
+ knowledgeScope?: 'public';
7
+ }
8
+ export declare function createCustomerV1ChatAdapter(options?: CustomerV1ChatAdapterOptions): ChatAdapter;
9
+ export type { Attachment, AttachmentOptions, ConversationItem };
@@ -0,0 +1,3 @@
1
+ import type { GatewayError } from '../../types';
2
+ export declare function readGatewayError(response: Response): Promise<GatewayError>;
3
+ export declare function gatewayErrorMessage(error: GatewayError): string;
@@ -0,0 +1,112 @@
1
+ import type { Attachment, AttachmentOptions, ChatFeedback, Citation, ConversationItem, GatewayError, GatewayErrorCode, SuggestedQuestion } from '../../types';
2
+ export declare const GATEWAY_SSE_EVENT: {
3
+ readonly RUN_STARTED: "run.started";
4
+ readonly RUN_PROGRESS: "run.progress";
5
+ readonly ANSWER_DELTA: "answer.delta";
6
+ readonly ANSWER_SNAPSHOT: "answer.snapshot";
7
+ readonly CITATION_ADDED: "citation.added";
8
+ readonly RUN_COMPLETED: "run.completed";
9
+ readonly RUN_NO_EVIDENCE: "run.no_evidence";
10
+ readonly RUN_FAILED: "run.failed";
11
+ readonly TERMINAL: "terminal";
12
+ };
13
+ export type GatewaySseEventName = (typeof GATEWAY_SSE_EVENT)[keyof typeof GATEWAY_SSE_EVENT];
14
+ export declare const GATEWAY_RUN_STATUS: {
15
+ readonly QUEUED: "queued";
16
+ readonly RUNNING: "running";
17
+ readonly COMPLETED: "completed";
18
+ readonly NO_EVIDENCE: "no_evidence";
19
+ };
20
+ export type GatewayRunStatus = (typeof GATEWAY_RUN_STATUS)[keyof typeof GATEWAY_RUN_STATUS] | string;
21
+ export interface FreeQueryRequest {
22
+ query?: string;
23
+ attachment_ids?: string[];
24
+ client_message_id: string;
25
+ conversation_id?: string;
26
+ module?: string;
27
+ knowledge_scope?: 'public';
28
+ }
29
+ export interface SuggestedQuestionRequest {
30
+ suggested_question_id: string;
31
+ suggested_question_version: number;
32
+ attachment_ids?: string[];
33
+ client_message_id: string;
34
+ conversation_id?: string;
35
+ module?: string;
36
+ knowledge_scope?: 'public';
37
+ }
38
+ export interface RunReadRequest {
39
+ run_id: string;
40
+ }
41
+ export type ChatStreamRequest = FreeQueryRequest | SuggestedQuestionRequest | RunReadRequest;
42
+ export interface RunStartedEvent {
43
+ conversation_id: string;
44
+ run_id: string;
45
+ request_id: string;
46
+ sequence: number;
47
+ }
48
+ export interface RunProgressEvent {
49
+ run_id: string;
50
+ phase: string;
51
+ progress_sequence: number;
52
+ }
53
+ export interface AnswerDeltaEvent {
54
+ run_id: string;
55
+ sequence: number;
56
+ text: string;
57
+ }
58
+ export interface AnswerSnapshotEvent {
59
+ run_id: string;
60
+ sequence: number;
61
+ answer: string;
62
+ status: GatewayRunStatus;
63
+ citations: Citation[];
64
+ }
65
+ export interface RunTerminalEvent {
66
+ run_id?: string;
67
+ conversation_id?: string;
68
+ sequence?: number;
69
+ status: GatewayRunStatus;
70
+ answer?: string;
71
+ citations?: Citation[];
72
+ error_code: GatewayErrorCode;
73
+ message?: string;
74
+ retry_after?: number;
75
+ }
76
+ export interface GatewaySseEvent {
77
+ id?: string;
78
+ event: GatewaySseEventName;
79
+ data: unknown;
80
+ }
81
+ export interface ConversationResponse {
82
+ request_id: string;
83
+ conversation_id: string;
84
+ items: ConversationItem[];
85
+ }
86
+ export interface ShareConversationResponse {
87
+ request_id: string;
88
+ conversation_id: string;
89
+ }
90
+ export interface SuggestedQuestionsResponse {
91
+ module: string;
92
+ items: SuggestedQuestion[];
93
+ }
94
+ export type AttachmentOptionsResponse = AttachmentOptions;
95
+ export interface AttachmentResponse {
96
+ request_id: string;
97
+ attachment: Attachment;
98
+ }
99
+ export interface CitationResponse {
100
+ request_id: string;
101
+ status: string;
102
+ citations: Citation[];
103
+ }
104
+ export interface FeedbackResponse {
105
+ request_id: string;
106
+ run_id: string;
107
+ feedback: ChatFeedback | null;
108
+ }
109
+ export type ErrorPayload = Partial<GatewayError> & {
110
+ error_code?: string;
111
+ status?: string;
112
+ };
@@ -0,0 +1,2 @@
1
+ import type { GatewaySseEvent } from './protocol';
2
+ export declare function parseSseStream(response: Response): AsyncGenerator<GatewaySseEvent>;
@@ -0,0 +1,41 @@
1
+ import type { StoreApi, UseBoundStore } from 'zustand';
2
+ import type { AttachmentOptions, AttachmentPolicy, ChatFileError, ChatMessage, ChatToast, GatewayError, PendingAttachment, SuggestedQuestion } from '../types';
3
+ export declare const DEFAULT_ATTACHMENT_POLICY: AttachmentPolicy;
4
+ export interface AIChatStoreState {
5
+ open: boolean;
6
+ restoring: boolean;
7
+ messages: ChatMessage[];
8
+ busy: boolean;
9
+ draft: string;
10
+ attachments: PendingAttachment[];
11
+ attachmentError: ChatFileError | GatewayError | null;
12
+ toast: ChatToast | null;
13
+ attachmentPolicy: AttachmentPolicy;
14
+ attachmentOptions: AttachmentOptions | null;
15
+ suggestedQuestions: SuggestedQuestion[];
16
+ conversationId: string | null;
17
+ activeRunId: string | null;
18
+ phase: string | null;
19
+ toggle(show?: boolean): void;
20
+ setMessages(messages: ChatMessage[]): void;
21
+ updateMessages(update: (current: ChatMessage[]) => ChatMessage[]): void;
22
+ setBusy(busy: boolean): void;
23
+ setRestoring(restoring: boolean): void;
24
+ setDraft(draft: string): void;
25
+ clearMessages(): void;
26
+ clearDraft(): void;
27
+ resetComposer(): void;
28
+ setAttachmentOptions(options: AttachmentOptions): void;
29
+ setSuggestedQuestions(items: SuggestedQuestion[]): void;
30
+ setConversation(conversationId: string | null, runId?: string | null): void;
31
+ setPhase(phase: string | null): void;
32
+ setAttachmentState(id: string, update: Partial<PendingAttachment>): void;
33
+ setAttachmentError(error: ChatFileError | GatewayError | null): void;
34
+ showToast(toast: ChatToast): void;
35
+ clearToast(): void;
36
+ addAttachment(attachment: PendingAttachment): void;
37
+ removeAttachmentLocal(id: string): void;
38
+ clearAttachments(): void;
39
+ }
40
+ export type AIChatStore = UseBoundStore<StoreApi<AIChatStoreState>>;
41
+ export declare function createAIChatStore(defaultOpen?: boolean): AIChatStore;
@@ -0,0 +1,24 @@
1
+ export declare const CHAT_TOKENS: {
2
+ readonly '--rb-chat-ink': "#182027";
3
+ readonly '--rb-chat-muted': "#71808a";
4
+ readonly '--rb-chat-line': "#e8edf0";
5
+ readonly '--rb-chat-surface': "#ffffff";
6
+ readonly '--rb-chat-soft': "#f6f8f9";
7
+ readonly '--rb-chat-accent': "#19c47a";
8
+ readonly '--rb-chat-accent-strong': "#0ca866";
9
+ readonly '--rb-chat-accent-pale': "#e8faf2";
10
+ readonly '--rb-chat-shadow': "0 24px 70px rgba(23,44,54,.2), 0 4px 14px rgba(23,44,54,.08)";
11
+ };
12
+ export declare const CHAT_DARK_TOKENS: {
13
+ readonly '--rb-chat-ink': "#f1f5f7";
14
+ readonly '--rb-chat-muted': "#9aa8b0";
15
+ readonly '--rb-chat-line': "#34434b";
16
+ readonly '--rb-chat-surface': "#1f2b31";
17
+ readonly '--rb-chat-soft': "#2b3941";
18
+ readonly '--rb-chat-accent': "#21d783";
19
+ readonly '--rb-chat-accent-strong': "#13cb75";
20
+ readonly '--rb-chat-accent-pale': "#173b2d";
21
+ readonly '--rb-chat-shadow': "0 24px 60px rgba(0, 0, 0, .42)";
22
+ };
23
+ export declare function buildStyleText(): string;
24
+ export declare function injectStyles(root: ShadowRoot | HTMLElement): HTMLStyleElement;
@@ -0,0 +1,6 @@
1
+ /**
2
+ * CSS remains in real stylesheets for IDE completion and class-to-selector navigation.
3
+ * The bundled text is injected into the chat Shadow DOM at runtime.
4
+ */
5
+ export declare const CHAT_PANEL_STYLES: string;
6
+ export declare function getChatPanelStyles(): string;