@kite-copilot/chat-panel 0.1.2 → 0.2.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.
- package/README.md +186 -9
- package/dist/auto.cjs +3535 -0
- package/dist/auto.d.cts +60 -0
- package/dist/auto.d.ts +60 -0
- package/dist/auto.js +23 -0
- package/dist/chunk-DN7P5ZFR.js +3547 -0
- package/dist/createKiteChat-C67AkIPX.d.cts +168 -0
- package/dist/createKiteChat-C67AkIPX.d.ts +168 -0
- package/dist/embed.global.js +20 -22
- package/dist/index.cjs +3597 -0
- package/dist/index.d.cts +179 -0
- package/dist/index.d.ts +90 -287
- package/dist/index.js +61 -2737
- package/dist/styles.css +1 -1
- package/package.json +34 -23
- package/dist/index.d.mts +0 -376
- package/dist/index.js.map +0 -1
- package/dist/index.mjs +0 -2692
- package/dist/index.mjs.map +0 -1
package/dist/index.d.mts
DELETED
|
@@ -1,376 +0,0 @@
|
|
|
1
|
-
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
-
import * as React from 'react';
|
|
3
|
-
import * as class_variance_authority_types from 'class-variance-authority/types';
|
|
4
|
-
import { VariantProps } from 'class-variance-authority';
|
|
5
|
-
import * as ScrollAreaPrimitive from '@radix-ui/react-scroll-area';
|
|
6
|
-
import { ClassValue } from 'clsx';
|
|
7
|
-
|
|
8
|
-
/**
|
|
9
|
-
* @kite-copilot/chat-panel - Type Definitions
|
|
10
|
-
*
|
|
11
|
-
* All types are exported for consumers who want strict typing.
|
|
12
|
-
* Page and SettingsTab are kept as string unions for flexibility.
|
|
13
|
-
*/
|
|
14
|
-
type Page = string;
|
|
15
|
-
type SettingsTab = string;
|
|
16
|
-
interface NavigationTarget {
|
|
17
|
-
page: Page;
|
|
18
|
-
subtab?: SettingsTab;
|
|
19
|
-
}
|
|
20
|
-
type ActionType = "updateCompanyInfo" | "addApiKey" | "addCustomer" | "enable2FA" | "disable2FA" | "changePassword" | "revokeSession" | "toggleNotification" | "connectIntegration" | "disconnectIntegration" | "addPaymentMethod" | "removePaymentMethod" | "deleteApiKey" | "addWebhook" | "updateCurrency" | "updateTimezone" | "refundPayment" | "createSubscription" | "exportCertificate" | "toggleBlockRule" | "enableBlockRule" | "disableBlockRule" | string;
|
|
21
|
-
interface CompanyInfoData {
|
|
22
|
-
companyName?: string;
|
|
23
|
-
email?: string;
|
|
24
|
-
address?: string;
|
|
25
|
-
phone?: string;
|
|
26
|
-
website?: string;
|
|
27
|
-
}
|
|
28
|
-
interface ApiKeyData {
|
|
29
|
-
name?: string;
|
|
30
|
-
keyId?: string;
|
|
31
|
-
}
|
|
32
|
-
interface CustomerData {
|
|
33
|
-
name?: string;
|
|
34
|
-
email?: string;
|
|
35
|
-
location?: string;
|
|
36
|
-
subscription?: "Starter" | "Professional" | "Enterprise" | string;
|
|
37
|
-
}
|
|
38
|
-
interface PasswordData {
|
|
39
|
-
currentPassword?: string;
|
|
40
|
-
newPassword?: string;
|
|
41
|
-
confirmPassword?: string;
|
|
42
|
-
}
|
|
43
|
-
interface NotificationData {
|
|
44
|
-
notificationType?: "paymentReceived" | "paymentFailed" | "invoicePaid" | "monthlySummary" | "productUpdates" | string;
|
|
45
|
-
enabled?: boolean;
|
|
46
|
-
}
|
|
47
|
-
interface IntegrationData {
|
|
48
|
-
integrationName?: "Slack" | "Zapier" | "Webhook" | string;
|
|
49
|
-
}
|
|
50
|
-
interface SessionData {
|
|
51
|
-
sessionId?: string;
|
|
52
|
-
device?: string;
|
|
53
|
-
}
|
|
54
|
-
interface PaymentMethodData {
|
|
55
|
-
cardNumber?: string;
|
|
56
|
-
expiryDate?: string;
|
|
57
|
-
}
|
|
58
|
-
interface WebhookData {
|
|
59
|
-
url?: string;
|
|
60
|
-
name?: string;
|
|
61
|
-
}
|
|
62
|
-
interface CurrencyData {
|
|
63
|
-
currency?: "USD" | "EUR" | "GBP" | "JPY" | string;
|
|
64
|
-
}
|
|
65
|
-
interface TimezoneData {
|
|
66
|
-
timezone?: "America/Los_Angeles" | "America/New_York" | "Europe/London" | "Asia/Tokyo" | string;
|
|
67
|
-
}
|
|
68
|
-
interface RefundData {
|
|
69
|
-
transactionId?: string;
|
|
70
|
-
customer?: string;
|
|
71
|
-
amount?: string;
|
|
72
|
-
reason?: string;
|
|
73
|
-
}
|
|
74
|
-
interface SubscriptionData {
|
|
75
|
-
customerEmail?: string;
|
|
76
|
-
customerId?: string;
|
|
77
|
-
plan?: "Starter" | "Professional" | "Enterprise" | string;
|
|
78
|
-
billingCycle?: "monthly" | "yearly" | string;
|
|
79
|
-
}
|
|
80
|
-
interface CertificateData {
|
|
81
|
-
format?: "pdf" | "json" | string;
|
|
82
|
-
}
|
|
83
|
-
interface BlockRuleData {
|
|
84
|
-
ruleId?: string;
|
|
85
|
-
ruleName?: string;
|
|
86
|
-
disabled?: boolean;
|
|
87
|
-
}
|
|
88
|
-
type ActionData = CompanyInfoData | ApiKeyData | CustomerData | PasswordData | NotificationData | IntegrationData | SessionData | PaymentMethodData | WebhookData | CurrencyData | TimezoneData | RefundData | SubscriptionData | CertificateData | BlockRuleData | Record<string, unknown>;
|
|
89
|
-
interface LinkItem {
|
|
90
|
-
label: string;
|
|
91
|
-
href: string;
|
|
92
|
-
}
|
|
93
|
-
interface FollowupOption {
|
|
94
|
-
id: string;
|
|
95
|
-
label: string;
|
|
96
|
-
}
|
|
97
|
-
interface StructuredData {
|
|
98
|
-
type: "subscription" | "subscriptions" | "customer" | "customers" | "transactions" | "transaction" | "dashboard_stats" | "top_customers" | "api_keys" | "sessions" | string;
|
|
99
|
-
data: unknown;
|
|
100
|
-
}
|
|
101
|
-
interface CsvPreviewData {
|
|
102
|
-
rowCount: number;
|
|
103
|
-
columns: string[];
|
|
104
|
-
sampleRows: Record<string, string>[];
|
|
105
|
-
fileName: string;
|
|
106
|
-
}
|
|
107
|
-
interface BulkOperationResult {
|
|
108
|
-
row: number;
|
|
109
|
-
success: boolean;
|
|
110
|
-
error?: string;
|
|
111
|
-
data?: Record<string, unknown>;
|
|
112
|
-
}
|
|
113
|
-
interface BulkSummary {
|
|
114
|
-
total: number;
|
|
115
|
-
successes: number;
|
|
116
|
-
failures: BulkOperationResult[];
|
|
117
|
-
suggestedAction?: string;
|
|
118
|
-
navigationPage?: {
|
|
119
|
-
page: Page;
|
|
120
|
-
subtab?: SettingsTab;
|
|
121
|
-
};
|
|
122
|
-
}
|
|
123
|
-
type MessageKind = "text" | "searchSummary" | "guideStep" | "guideComplete" | "navigationAction" | "actionForm" | "bulkPreview" | "bulkProgress" | "bulkSummary";
|
|
124
|
-
interface Message {
|
|
125
|
-
id: number;
|
|
126
|
-
role: "user" | "assistant";
|
|
127
|
-
kind?: MessageKind;
|
|
128
|
-
content?: string;
|
|
129
|
-
title?: string;
|
|
130
|
-
links?: LinkItem[];
|
|
131
|
-
navigationTarget?: NavigationTarget;
|
|
132
|
-
actionType?: ActionType;
|
|
133
|
-
actionData?: ActionData;
|
|
134
|
-
isSubmitted?: boolean;
|
|
135
|
-
guideStepIndex?: number;
|
|
136
|
-
isNotificationMessage?: boolean;
|
|
137
|
-
csvData?: CsvPreviewData;
|
|
138
|
-
suggestedAction?: string;
|
|
139
|
-
bulkProgress?: {
|
|
140
|
-
processed: number;
|
|
141
|
-
total: number;
|
|
142
|
-
successes: number;
|
|
143
|
-
failures: number;
|
|
144
|
-
};
|
|
145
|
-
bulkSummary?: BulkSummary;
|
|
146
|
-
bulkSessionId?: string;
|
|
147
|
-
followups?: FollowupOption[];
|
|
148
|
-
followupSelected?: boolean;
|
|
149
|
-
structuredData?: StructuredData;
|
|
150
|
-
}
|
|
151
|
-
interface CursorTarget {
|
|
152
|
-
selector: string;
|
|
153
|
-
offset?: {
|
|
154
|
-
x: number;
|
|
155
|
-
y: number;
|
|
156
|
-
};
|
|
157
|
-
onClick?: boolean;
|
|
158
|
-
}
|
|
159
|
-
interface GuideStep {
|
|
160
|
-
text: string;
|
|
161
|
-
navigation?: NavigationTarget;
|
|
162
|
-
cursorTarget?: CursorTarget;
|
|
163
|
-
}
|
|
164
|
-
interface GuideWithSteps {
|
|
165
|
-
id: string;
|
|
166
|
-
title: string;
|
|
167
|
-
steps: GuideStep[];
|
|
168
|
-
}
|
|
169
|
-
interface Topic {
|
|
170
|
-
id: string;
|
|
171
|
-
label: string;
|
|
172
|
-
prompt: string;
|
|
173
|
-
}
|
|
174
|
-
interface Folder {
|
|
175
|
-
id: string;
|
|
176
|
-
title: string;
|
|
177
|
-
topics: Topic[];
|
|
178
|
-
}
|
|
179
|
-
interface ChatPanelConfig {
|
|
180
|
-
/** User ID of the end user querying the chat panel */
|
|
181
|
-
userId: string;
|
|
182
|
-
/** Organization ID the user belongs to */
|
|
183
|
-
orgId: string;
|
|
184
|
-
/** URL of the agent backend (optional - defaults to built-in URL, use for dev/testing only) */
|
|
185
|
-
agentUrl?: string;
|
|
186
|
-
/** Theme preference */
|
|
187
|
-
theme?: "light" | "dark" | "system";
|
|
188
|
-
/** Position of the chat panel */
|
|
189
|
-
position?: "bottom-right" | "bottom-left" | "custom";
|
|
190
|
-
/** Custom guides to show in the chat panel */
|
|
191
|
-
guides?: Record<string, GuideWithSteps>;
|
|
192
|
-
/** Custom help topic folders for the landing page */
|
|
193
|
-
folders?: Folder[];
|
|
194
|
-
/** Default folders if none provided */
|
|
195
|
-
showDefaultFolders?: boolean;
|
|
196
|
-
/** Enable/disable guide cursor animation */
|
|
197
|
-
enableGuideCursor?: boolean;
|
|
198
|
-
/** Custom class name for the chat panel container */
|
|
199
|
-
className?: string;
|
|
200
|
-
}
|
|
201
|
-
interface ChatActionCompleteEvent {
|
|
202
|
-
actionType: ActionType;
|
|
203
|
-
data: ActionData;
|
|
204
|
-
success?: boolean;
|
|
205
|
-
}
|
|
206
|
-
interface AgentActionCompleteEvent {
|
|
207
|
-
result: {
|
|
208
|
-
bulk?: boolean;
|
|
209
|
-
total?: number;
|
|
210
|
-
successes?: number;
|
|
211
|
-
[key: string]: unknown;
|
|
212
|
-
};
|
|
213
|
-
}
|
|
214
|
-
interface ChatPanelProps {
|
|
215
|
-
/** Current page the user is on (for context) */
|
|
216
|
-
currentPage?: string;
|
|
217
|
-
/** Callback when navigation is requested */
|
|
218
|
-
onNavigate?: (page: string, subtab?: string) => void;
|
|
219
|
-
/** Callback when an action is completed */
|
|
220
|
-
onActionComplete?: (actionType: ActionType, data: ActionData) => void;
|
|
221
|
-
/** Callback when agent executes an action */
|
|
222
|
-
onAgentAction?: (event: AgentActionCompleteEvent) => void;
|
|
223
|
-
/** Callback when back button is pressed */
|
|
224
|
-
onBack?: () => void;
|
|
225
|
-
/** Override configuration (otherwise uses context) */
|
|
226
|
-
config?: ChatPanelConfig;
|
|
227
|
-
}
|
|
228
|
-
interface Subscription {
|
|
229
|
-
id: string;
|
|
230
|
-
customer_id: string;
|
|
231
|
-
customer_email?: string;
|
|
232
|
-
plan: "Starter" | "Professional" | "Enterprise" | string;
|
|
233
|
-
status: string;
|
|
234
|
-
billing_cycle: string;
|
|
235
|
-
amount: number;
|
|
236
|
-
currency: string;
|
|
237
|
-
current_period_start: string;
|
|
238
|
-
current_period_end: string;
|
|
239
|
-
created_at: string;
|
|
240
|
-
}
|
|
241
|
-
interface Customer {
|
|
242
|
-
id: number;
|
|
243
|
-
name: string;
|
|
244
|
-
email: string;
|
|
245
|
-
status: "active" | "inactive" | string;
|
|
246
|
-
revenue: string;
|
|
247
|
-
joinDate: string;
|
|
248
|
-
subscription: "Starter" | "Professional" | "Enterprise" | string;
|
|
249
|
-
location: string;
|
|
250
|
-
}
|
|
251
|
-
interface Transaction {
|
|
252
|
-
id: number;
|
|
253
|
-
customer: string;
|
|
254
|
-
email: string;
|
|
255
|
-
amount: string;
|
|
256
|
-
status: "paid" | "failed" | "pending" | "refunded" | string;
|
|
257
|
-
date: string;
|
|
258
|
-
decline_reason?: string;
|
|
259
|
-
blocked_by_rule?: string;
|
|
260
|
-
}
|
|
261
|
-
interface ApiKey {
|
|
262
|
-
name: string;
|
|
263
|
-
key: string;
|
|
264
|
-
lastUsed: string;
|
|
265
|
-
}
|
|
266
|
-
interface Session {
|
|
267
|
-
device: string;
|
|
268
|
-
location: string;
|
|
269
|
-
time: string;
|
|
270
|
-
}
|
|
271
|
-
interface DashboardStats {
|
|
272
|
-
revenue?: {
|
|
273
|
-
total: number;
|
|
274
|
-
change: number;
|
|
275
|
-
};
|
|
276
|
-
subscriptions?: {
|
|
277
|
-
active: number;
|
|
278
|
-
total: number;
|
|
279
|
-
};
|
|
280
|
-
customers?: {
|
|
281
|
-
total: number;
|
|
282
|
-
new: number;
|
|
283
|
-
};
|
|
284
|
-
transactions?: {
|
|
285
|
-
successful: number;
|
|
286
|
-
failed: number;
|
|
287
|
-
};
|
|
288
|
-
}
|
|
289
|
-
|
|
290
|
-
declare function ChatPanel({ onBack, onNavigate, onActionComplete, onAgentAction, currentPage, config: propConfig, }: ChatPanelProps): react_jsx_runtime.JSX.Element;
|
|
291
|
-
|
|
292
|
-
declare const defaultFolders: Folder[];
|
|
293
|
-
declare const defaultGuides: Record<string, GuideWithSteps>;
|
|
294
|
-
declare const defaultConfig: ChatPanelConfig;
|
|
295
|
-
interface ChatPanelContextValue {
|
|
296
|
-
config: ChatPanelConfig;
|
|
297
|
-
userId: string;
|
|
298
|
-
orgId: string;
|
|
299
|
-
agentUrl: string;
|
|
300
|
-
folders: Folder[];
|
|
301
|
-
guides: Record<string, GuideWithSteps>;
|
|
302
|
-
theme: "light" | "dark" | "system";
|
|
303
|
-
position: "bottom-right" | "bottom-left" | "custom";
|
|
304
|
-
enableGuideCursor: boolean;
|
|
305
|
-
}
|
|
306
|
-
interface ChatPanelProviderProps {
|
|
307
|
-
children: React.ReactNode;
|
|
308
|
-
config: ChatPanelConfig;
|
|
309
|
-
}
|
|
310
|
-
declare function ChatPanelProvider({ children, config }: ChatPanelProviderProps): react_jsx_runtime.JSX.Element;
|
|
311
|
-
declare function useChatPanelConfig(): ChatPanelContextValue;
|
|
312
|
-
|
|
313
|
-
type ActivityPhase = "thinking" | "searching" | "executing" | "responding";
|
|
314
|
-
type ProgressStep = {
|
|
315
|
-
message: string;
|
|
316
|
-
completed: boolean;
|
|
317
|
-
};
|
|
318
|
-
declare function AssistantActivity({ phase, progressSteps }: {
|
|
319
|
-
phase: ActivityPhase;
|
|
320
|
-
progressSteps?: ProgressStep[];
|
|
321
|
-
}): react_jsx_runtime.JSX.Element;
|
|
322
|
-
|
|
323
|
-
declare function AssistantSearchSummary({ title, links, }: {
|
|
324
|
-
title: string;
|
|
325
|
-
links: LinkItem[];
|
|
326
|
-
}): react_jsx_runtime.JSX.Element;
|
|
327
|
-
|
|
328
|
-
interface GuideCursorProps {
|
|
329
|
-
x: number;
|
|
330
|
-
y: number;
|
|
331
|
-
visible: boolean;
|
|
332
|
-
onClick?: boolean;
|
|
333
|
-
}
|
|
334
|
-
declare function GuideCursor({ x, y, visible, onClick }: GuideCursorProps): react_jsx_runtime.JSX.Element;
|
|
335
|
-
|
|
336
|
-
declare function DataRenderer({ type, data }: {
|
|
337
|
-
type: string;
|
|
338
|
-
data: unknown;
|
|
339
|
-
}): react_jsx_runtime.JSX.Element | null;
|
|
340
|
-
|
|
341
|
-
declare const buttonVariants: (props?: ({
|
|
342
|
-
variant?: "link" | "default" | "destructive" | "outline" | "secondary" | "ghost" | null | undefined;
|
|
343
|
-
size?: "default" | "sm" | "lg" | "icon" | "icon-sm" | "icon-lg" | null | undefined;
|
|
344
|
-
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
345
|
-
declare function Button({ className, variant, size, asChild, ...props }: React.ComponentProps<"button"> & VariantProps<typeof buttonVariants> & {
|
|
346
|
-
asChild?: boolean;
|
|
347
|
-
}): react_jsx_runtime.JSX.Element;
|
|
348
|
-
|
|
349
|
-
declare function Input({ className, type, ...props }: React.ComponentProps<"input">): react_jsx_runtime.JSX.Element;
|
|
350
|
-
|
|
351
|
-
declare const ScrollArea: React.ForwardRefExoticComponent<Omit<ScrollAreaPrimitive.ScrollAreaProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
352
|
-
declare function ScrollBar({ className, orientation, ...props }: React.ComponentProps<typeof ScrollAreaPrimitive.ScrollAreaScrollbar>): react_jsx_runtime.JSX.Element;
|
|
353
|
-
|
|
354
|
-
declare function Card({ className, ...props }: React.ComponentProps<"div">): react_jsx_runtime.JSX.Element;
|
|
355
|
-
declare function CardHeader({ className, ...props }: React.ComponentProps<"div">): react_jsx_runtime.JSX.Element;
|
|
356
|
-
declare function CardTitle({ className, ...props }: React.ComponentProps<"div">): react_jsx_runtime.JSX.Element;
|
|
357
|
-
declare function CardDescription({ className, ...props }: React.ComponentProps<"div">): react_jsx_runtime.JSX.Element;
|
|
358
|
-
declare function CardAction({ className, ...props }: React.ComponentProps<"div">): react_jsx_runtime.JSX.Element;
|
|
359
|
-
declare function CardContent({ className, ...props }: React.ComponentProps<"div">): react_jsx_runtime.JSX.Element;
|
|
360
|
-
declare function CardFooter({ className, ...props }: React.ComponentProps<"div">): react_jsx_runtime.JSX.Element;
|
|
361
|
-
|
|
362
|
-
declare function useGuideCursor(): {
|
|
363
|
-
cursorState: {
|
|
364
|
-
x: number;
|
|
365
|
-
y: number;
|
|
366
|
-
visible: boolean;
|
|
367
|
-
onClick: boolean;
|
|
368
|
-
};
|
|
369
|
-
moveTo: (target: CursorTarget) => void;
|
|
370
|
-
hide: () => void;
|
|
371
|
-
show: () => void;
|
|
372
|
-
};
|
|
373
|
-
|
|
374
|
-
declare function cn(...inputs: ClassValue[]): string;
|
|
375
|
-
|
|
376
|
-
export { type ActionData, type ActionType, type AgentActionCompleteEvent, type ApiKey, type ApiKeyData, AssistantActivity, AssistantSearchSummary, type BlockRuleData, type BulkOperationResult, type BulkSummary, Button, Card, CardAction, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, type CertificateData, type ChatActionCompleteEvent, ChatPanel, type ChatPanelConfig, type ChatPanelProps, ChatPanelProvider, type CompanyInfoData, type CsvPreviewData, type CurrencyData, type CursorTarget, type Customer, type CustomerData, type DashboardStats, DataRenderer, type Folder, type FollowupOption, GuideCursor, type GuideStep, type GuideWithSteps, Input, type IntegrationData, type LinkItem, type Message, type MessageKind, type NavigationTarget, type NotificationData, type Page, type PasswordData, type PaymentMethodData, type RefundData, ScrollArea, ScrollBar, type Session, type SessionData, type SettingsTab, type StructuredData, type Subscription, type SubscriptionData, type TimezoneData, type Topic, type Transaction, type WebhookData, buttonVariants, cn, defaultConfig, defaultFolders, defaultGuides, useChatPanelConfig, useGuideCursor };
|