@afncdelacru/brady-chat 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,82 @@
1
+ import * as react_jsx_runtime from 'react/jsx-runtime';
2
+ import React, { ReactNode } from 'react';
3
+
4
+ type ChatWorkflowType = 'free' | 'info-request' | 'leadership-call' | 'personalized-overview-request' | 'earnings-mode' | 'profit-mode';
5
+ type ModeType = 'none' | 'earnings' | 'profit';
6
+ type ModeStep = 'initial' | 'volume' | 'comp' | 'economics' | 'calculator' | 'complete';
7
+ interface ChatMessage {
8
+ type: 'user' | 'brady' | 'form';
9
+ text?: string;
10
+ component?: ReactNode;
11
+ }
12
+ interface ModeData {
13
+ volume?: number;
14
+ comp?: number;
15
+ margin?: number;
16
+ grossProfit?: number;
17
+ opEx?: number;
18
+ volumeMultiplier?: number;
19
+ }
20
+ interface BradyChatContextType {
21
+ workflowType: ChatWorkflowType;
22
+ messages: ChatMessage[];
23
+ startWorkflow: (workflow: ChatWorkflowType) => void;
24
+ addMessage: (message: ChatMessage) => void;
25
+ setWorkflow: (workflow: ChatWorkflowType) => void;
26
+ resetChat: () => void;
27
+ activeMode: ModeType;
28
+ modeStep: ModeStep;
29
+ modeData: ModeData;
30
+ activateMode: (mode: ModeType) => void;
31
+ setModeStep: (step: ModeStep) => void;
32
+ updateModeData: (data: Partial<ModeData>) => void;
33
+ resetMode: () => void;
34
+ calculatorOpen: boolean;
35
+ setCalculatorOpen: (open: boolean) => void;
36
+ isHidden: boolean;
37
+ setIsHidden: React.Dispatch<React.SetStateAction<boolean>>;
38
+ hideBradyForModal: () => void;
39
+ restoreBradyAfterModal: () => void;
40
+ }
41
+ declare function BradyChatProvider({ children }: {
42
+ children: ReactNode;
43
+ }): react_jsx_runtime.JSX.Element;
44
+ declare function useBradyChat(): BradyChatContextType;
45
+
46
+ type ModeVariant = 'loan-officer' | 'branch-manager';
47
+ interface EnhancedBradyChatProps {
48
+ /**
49
+ * Controls whether the mode toggle uses Earnings (LO) or Profit (branch manager) language.
50
+ * Defaults to 'loan-officer'.
51
+ */
52
+ modeVariant?: ModeVariant;
53
+ /**
54
+ * Avatar image URL for Brady.
55
+ * Typically you pass something like `/bradyIcon.png` from your app's public assets.
56
+ */
57
+ avatarSrc: string;
58
+ }
59
+ declare function EnhancedBradyChat({ modeVariant, avatarSrc }: EnhancedBradyChatProps): react_jsx_runtime.JSX.Element;
60
+
61
+ declare const DEFAULT_BRADY_API_KEY = "za2345DDDzXycXKHJvVj80TIsPgooB7iNbwcS9KLzoeaOljlXmJQQJ99BJAC4f1cMXJ3w3AAAAACOGQzXz";
62
+ interface BradyMessage {
63
+ role: 'user' | 'assistant' | 'system';
64
+ content: string;
65
+ }
66
+ interface BradyChatRequest {
67
+ messages: BradyMessage[];
68
+ }
69
+ interface BradyChatResponse {
70
+ role: string;
71
+ type: string;
72
+ content: string;
73
+ suggestionLink?: {
74
+ text: string;
75
+ prompt: string;
76
+ }[];
77
+ }
78
+ declare function sendBradyPrompt(messages: BradyMessage[], apiKey?: string): Promise<BradyChatResponse>;
79
+
80
+ declare function checkBradyHealth(): Promise<boolean>;
81
+
82
+ export { BradyChatProvider, type BradyChatRequest, type BradyChatResponse, type BradyMessage, type ChatMessage, type ChatWorkflowType, DEFAULT_BRADY_API_KEY, EnhancedBradyChat, type EnhancedBradyChatProps, type ModeStep, type ModeType, checkBradyHealth, sendBradyPrompt, useBradyChat };
@@ -0,0 +1,82 @@
1
+ import * as react_jsx_runtime from 'react/jsx-runtime';
2
+ import React, { ReactNode } from 'react';
3
+
4
+ type ChatWorkflowType = 'free' | 'info-request' | 'leadership-call' | 'personalized-overview-request' | 'earnings-mode' | 'profit-mode';
5
+ type ModeType = 'none' | 'earnings' | 'profit';
6
+ type ModeStep = 'initial' | 'volume' | 'comp' | 'economics' | 'calculator' | 'complete';
7
+ interface ChatMessage {
8
+ type: 'user' | 'brady' | 'form';
9
+ text?: string;
10
+ component?: ReactNode;
11
+ }
12
+ interface ModeData {
13
+ volume?: number;
14
+ comp?: number;
15
+ margin?: number;
16
+ grossProfit?: number;
17
+ opEx?: number;
18
+ volumeMultiplier?: number;
19
+ }
20
+ interface BradyChatContextType {
21
+ workflowType: ChatWorkflowType;
22
+ messages: ChatMessage[];
23
+ startWorkflow: (workflow: ChatWorkflowType) => void;
24
+ addMessage: (message: ChatMessage) => void;
25
+ setWorkflow: (workflow: ChatWorkflowType) => void;
26
+ resetChat: () => void;
27
+ activeMode: ModeType;
28
+ modeStep: ModeStep;
29
+ modeData: ModeData;
30
+ activateMode: (mode: ModeType) => void;
31
+ setModeStep: (step: ModeStep) => void;
32
+ updateModeData: (data: Partial<ModeData>) => void;
33
+ resetMode: () => void;
34
+ calculatorOpen: boolean;
35
+ setCalculatorOpen: (open: boolean) => void;
36
+ isHidden: boolean;
37
+ setIsHidden: React.Dispatch<React.SetStateAction<boolean>>;
38
+ hideBradyForModal: () => void;
39
+ restoreBradyAfterModal: () => void;
40
+ }
41
+ declare function BradyChatProvider({ children }: {
42
+ children: ReactNode;
43
+ }): react_jsx_runtime.JSX.Element;
44
+ declare function useBradyChat(): BradyChatContextType;
45
+
46
+ type ModeVariant = 'loan-officer' | 'branch-manager';
47
+ interface EnhancedBradyChatProps {
48
+ /**
49
+ * Controls whether the mode toggle uses Earnings (LO) or Profit (branch manager) language.
50
+ * Defaults to 'loan-officer'.
51
+ */
52
+ modeVariant?: ModeVariant;
53
+ /**
54
+ * Avatar image URL for Brady.
55
+ * Typically you pass something like `/bradyIcon.png` from your app's public assets.
56
+ */
57
+ avatarSrc: string;
58
+ }
59
+ declare function EnhancedBradyChat({ modeVariant, avatarSrc }: EnhancedBradyChatProps): react_jsx_runtime.JSX.Element;
60
+
61
+ declare const DEFAULT_BRADY_API_KEY = "za2345DDDzXycXKHJvVj80TIsPgooB7iNbwcS9KLzoeaOljlXmJQQJ99BJAC4f1cMXJ3w3AAAAACOGQzXz";
62
+ interface BradyMessage {
63
+ role: 'user' | 'assistant' | 'system';
64
+ content: string;
65
+ }
66
+ interface BradyChatRequest {
67
+ messages: BradyMessage[];
68
+ }
69
+ interface BradyChatResponse {
70
+ role: string;
71
+ type: string;
72
+ content: string;
73
+ suggestionLink?: {
74
+ text: string;
75
+ prompt: string;
76
+ }[];
77
+ }
78
+ declare function sendBradyPrompt(messages: BradyMessage[], apiKey?: string): Promise<BradyChatResponse>;
79
+
80
+ declare function checkBradyHealth(): Promise<boolean>;
81
+
82
+ export { BradyChatProvider, type BradyChatRequest, type BradyChatResponse, type BradyMessage, type ChatMessage, type ChatWorkflowType, DEFAULT_BRADY_API_KEY, EnhancedBradyChat, type EnhancedBradyChatProps, type ModeStep, type ModeType, checkBradyHealth, sendBradyPrompt, useBradyChat };