@hef2024/llmasaservice-ui 0.24.3 → 0.24.4

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/dist/index.css CHANGED
@@ -2723,6 +2723,7 @@ button[data-pending=true]::after {
2723
2723
  .ai-chat-message--assistant {
2724
2724
  align-self: flex-start;
2725
2725
  max-width: 100%;
2726
+ width: 100%;
2726
2727
  }
2727
2728
  .ai-chat-message--assistant .ai-chat-message__content {
2728
2729
  background-color: var(--ai-chat-assistant-bg);
@@ -2731,6 +2732,7 @@ button[data-pending=true]::after {
2731
2732
  word-wrap: break-word;
2732
2733
  overflow-wrap: break-word;
2733
2734
  min-width: 0;
2735
+ width: 100%;
2734
2736
  }
2735
2737
  .ai-chat-message__content p {
2736
2738
  margin: 0 0 0.75em 0;
@@ -2941,6 +2943,11 @@ button[data-pending=true]::after {
2941
2943
  gap: 4px;
2942
2944
  color: var(--ai-chat-loading-dot);
2943
2945
  }
2946
+ .ai-chat-loading--inline {
2947
+ margin-top: 6px;
2948
+ font-size: 11px;
2949
+ opacity: 0.9;
2950
+ }
2944
2951
  .ai-chat-loading__dots {
2945
2952
  display: flex;
2946
2953
  gap: 4px;
@@ -2958,6 +2965,138 @@ button[data-pending=true]::after {
2958
2965
  .ai-chat-loading__dot:nth-child(2) {
2959
2966
  animation-delay: -0.16s;
2960
2967
  }
2968
+ .ai-chat-inline-tool-events {
2969
+ margin: 4px 0;
2970
+ display: flex;
2971
+ flex-direction: column;
2972
+ gap: 4px;
2973
+ }
2974
+ .ai-chat-inline-thinking-events {
2975
+ margin: 8px 0;
2976
+ }
2977
+ .ai-chat-inline-tool-events--tail {
2978
+ margin-top: 8px;
2979
+ }
2980
+ .ai-chat-tool-status-row {
2981
+ --tool-row-accent: #3b82f6;
2982
+ --tool-row-bg: #eff6ff;
2983
+ --tool-row-text: #1d4ed8;
2984
+ --tool-row-border: #93c5fd;
2985
+ display: inline-flex;
2986
+ align-items: center;
2987
+ justify-content: flex-start;
2988
+ align-self: flex-start;
2989
+ gap: 6px;
2990
+ max-width: 100%;
2991
+ padding: 3px 8px;
2992
+ border-radius: 999px;
2993
+ border: none;
2994
+ background: transparent;
2995
+ box-shadow: none;
2996
+ font-size: 11px;
2997
+ line-height: 1.2;
2998
+ color: var(--tool-row-text);
2999
+ opacity: 0.86;
3000
+ }
3001
+ .dark-theme .ai-chat-tool-status-row {
3002
+ opacity: 0.9;
3003
+ }
3004
+ .ai-chat-tool-status-row__main {
3005
+ min-width: 0;
3006
+ display: inline-flex;
3007
+ align-items: center;
3008
+ gap: 6px;
3009
+ color: inherit;
3010
+ }
3011
+ .ai-chat-tool-status-row__label {
3012
+ white-space: nowrap;
3013
+ overflow: hidden;
3014
+ text-overflow: ellipsis;
3015
+ font-weight: 500;
3016
+ }
3017
+ .ai-chat-tool-status-row__call-id {
3018
+ font-family:
3019
+ "SF Mono",
3020
+ Monaco,
3021
+ Consolas,
3022
+ monospace;
3023
+ font-size: 10px;
3024
+ opacity: 0.75;
3025
+ }
3026
+ .ai-chat-tool-status-row__actions {
3027
+ display: inline-flex;
3028
+ gap: 4px;
3029
+ flex-shrink: 0;
3030
+ }
3031
+ .ai-chat-tool-status-row__button {
3032
+ height: 18px;
3033
+ min-width: 0;
3034
+ padding: 0 2px;
3035
+ font-size: 10px;
3036
+ font-weight: 500;
3037
+ letter-spacing: 0.01em;
3038
+ border-radius: 4px;
3039
+ border: none;
3040
+ background: transparent;
3041
+ color: inherit;
3042
+ box-shadow: none;
3043
+ text-decoration: underline;
3044
+ text-decoration-thickness: 1px;
3045
+ text-underline-offset: 2px;
3046
+ }
3047
+ .ai-chat-tool-status-row__button:hover {
3048
+ background: rgba(15, 23, 42, 0.08);
3049
+ }
3050
+ .dark-theme .ai-chat-tool-status-row__button {
3051
+ background: transparent;
3052
+ }
3053
+ .dark-theme .ai-chat-tool-status-row__button:hover {
3054
+ background: rgba(148, 163, 184, 0.16);
3055
+ }
3056
+ .ai-chat-tool-status-row--pending {
3057
+ --tool-row-accent: #f59e0b;
3058
+ --tool-row-bg: rgba(245, 158, 11, 0.08);
3059
+ --tool-row-text: #92400e;
3060
+ --tool-row-border: rgba(245, 158, 11, 0.3);
3061
+ }
3062
+ .dark-theme .ai-chat-tool-status-row--pending {
3063
+ --tool-row-bg: rgba(120, 53, 15, 0.25);
3064
+ --tool-row-text: #fcd34d;
3065
+ --tool-row-border: rgba(245, 158, 11, 0.42);
3066
+ }
3067
+ .ai-chat-tool-status-row--running {
3068
+ --tool-row-accent: #38bdf8;
3069
+ --tool-row-bg: rgba(56, 189, 248, 0.08);
3070
+ --tool-row-text: #0e7490;
3071
+ --tool-row-border: rgba(56, 189, 248, 0.32);
3072
+ }
3073
+ .dark-theme .ai-chat-tool-status-row--running {
3074
+ --tool-row-bg: rgba(8, 145, 178, 0.16);
3075
+ --tool-row-text: #7dd3fc;
3076
+ --tool-row-border: rgba(14, 165, 233, 0.42);
3077
+ }
3078
+ .ai-chat-tool-status-row--completed {
3079
+ --tool-row-accent: #34d399;
3080
+ --tool-row-bg: rgba(16, 185, 129, 0.1);
3081
+ --tool-row-text: #047857;
3082
+ --tool-row-border: rgba(16, 185, 129, 0.34);
3083
+ }
3084
+ .dark-theme .ai-chat-tool-status-row--completed {
3085
+ --tool-row-bg: rgba(6, 95, 70, 0.22);
3086
+ --tool-row-text: #86efac;
3087
+ --tool-row-border: rgba(16, 185, 129, 0.42);
3088
+ }
3089
+ .ai-chat-tool-status-row--error {
3090
+ --tool-row-accent: #f87171;
3091
+ --tool-row-bg: rgba(248, 113, 113, 0.1);
3092
+ --tool-row-text: #b91c1c;
3093
+ --tool-row-border: rgba(248, 113, 113, 0.34);
3094
+ }
3095
+ .dark-theme .ai-chat-tool-status-row--error {
3096
+ --tool-row-bg: rgba(127, 29, 29, 0.24);
3097
+ --tool-row-text: #fda4af;
3098
+ --tool-row-border: rgba(248, 113, 113, 0.4);
3099
+ }
2961
3100
  @keyframes ai-chat-dot-bounce {
2962
3101
  0%, 80%, 100% {
2963
3102
  transform: scale(0.6);
@@ -4327,61 +4466,141 @@ button[data-pending=true]::after {
4327
4466
  .dark-theme .ai-chat-email-error-message {
4328
4467
  color: #fca5a5;
4329
4468
  }
4330
- .ai-chat-approve-tools-panel {
4331
- padding: 16px;
4332
- border-top: 1px solid #e5e7eb;
4333
- border-bottom: 1px solid #e5e7eb;
4334
- background: #fef3c7;
4469
+ .ai-chat-tool-tray {
4470
+ display: flex;
4471
+ flex-direction: column;
4472
+ gap: 8px;
4473
+ padding: 0 12px 10px;
4335
4474
  }
4336
- .dark-theme .ai-chat-approve-tools-panel {
4337
- background: #78350f;
4338
- border-top-color: #92400e;
4339
- border-bottom-color: #92400e;
4475
+ .ai-chat-tool-tray-card {
4476
+ width: 100%;
4477
+ border-radius: 12px;
4478
+ border: 1px solid #dbeafe;
4479
+ background: #f8fbff;
4480
+ box-shadow: 0 6px 18px rgba(15, 23, 42, 0.08);
4481
+ padding: 10px 12px;
4482
+ animation: ai-chat-tool-tray-pop 180ms ease-out;
4340
4483
  }
4341
- .ai-chat-approve-tools-header {
4342
- font-size: 14px;
4343
- font-weight: 600;
4344
- color: #92400e;
4345
- margin-bottom: 4px;
4484
+ .dark-theme .ai-chat-tool-tray-card {
4485
+ border-color: #1e3a8a;
4486
+ background: rgba(30, 58, 138, 0.2);
4487
+ box-shadow: 0 8px 20px rgba(2, 6, 23, 0.35);
4346
4488
  }
4347
- .dark-theme .ai-chat-approve-tools-header {
4348
- color: #fef3c7;
4489
+ .ai-chat-tool-tray-card__header {
4490
+ display: flex;
4491
+ align-items: center;
4492
+ justify-content: space-between;
4493
+ gap: 8px;
4349
4494
  }
4350
- .ai-chat-approve-tools-description {
4495
+ .ai-chat-tool-tray-card__title {
4496
+ display: inline-flex;
4497
+ align-items: center;
4498
+ gap: 6px;
4499
+ min-width: 0;
4351
4500
  font-size: 13px;
4352
- color: #78350f;
4353
- margin-bottom: 12px;
4501
+ font-weight: 600;
4502
+ color: #0f172a;
4354
4503
  }
4355
- .dark-theme .ai-chat-approve-tools-description {
4356
- color: #fde68a;
4504
+ .dark-theme .ai-chat-tool-tray-card__title {
4505
+ color: #e2e8f0;
4357
4506
  }
4358
- .ai-chat-approve-tool-item {
4359
- margin-bottom: 12px;
4507
+ .ai-chat-tool-tray-card__badge {
4508
+ border-radius: 999px;
4509
+ padding: 2px 8px;
4510
+ font-size: 10px;
4511
+ font-weight: 700;
4512
+ text-transform: uppercase;
4513
+ letter-spacing: 0.04em;
4514
+ background: #dbeafe;
4515
+ color: #1e3a8a;
4360
4516
  }
4361
- .ai-chat-approve-tool-item:last-child {
4362
- margin-bottom: 0;
4517
+ .dark-theme .ai-chat-tool-tray-card__badge {
4518
+ background: rgba(59, 130, 246, 0.24);
4519
+ color: #bfdbfe;
4363
4520
  }
4364
- .ai-chat-approve-tool-name {
4365
- font-size: 13px;
4366
- font-weight: 600;
4367
- color: #92400e;
4368
- margin-bottom: 6px;
4521
+ .ai-chat-tool-tray-card__message {
4522
+ margin-top: 6px;
4523
+ font-size: 12px;
4524
+ line-height: 1.45;
4525
+ color: #334155;
4526
+ word-break: break-word;
4527
+ }
4528
+ .dark-theme .ai-chat-tool-tray-card__message {
4529
+ color: #cbd5e1;
4530
+ }
4531
+ .ai-chat-tool-tray-card__tool-name {
4369
4532
  font-family:
4370
- "Monaco",
4371
- "Courier New",
4533
+ "SF Mono",
4534
+ Monaco,
4535
+ Consolas,
4372
4536
  monospace;
4537
+ font-weight: 600;
4538
+ color: #0f172a;
4373
4539
  }
4374
- .dark-theme .ai-chat-approve-tool-name {
4375
- color: #fef3c7;
4540
+ .dark-theme .ai-chat-tool-tray-card__tool-name {
4541
+ color: #e2e8f0;
4376
4542
  }
4377
- .ai-chat-approve-tools-buttons {
4543
+ .ai-chat-tool-tray-card__actions {
4544
+ margin-top: 8px;
4378
4545
  display: flex;
4379
4546
  gap: 6px;
4380
4547
  flex-wrap: wrap;
4381
4548
  }
4382
- .ai-chat-approve-tools-button {
4549
+ .ai-chat-tool-tray-card__button {
4383
4550
  flex: 1;
4384
- min-width: 80px;
4551
+ min-width: 84px;
4552
+ }
4553
+ .ai-chat-tool-tray-card--approval {
4554
+ border-color: #fcd34d;
4555
+ background: #fffbeb;
4556
+ }
4557
+ .dark-theme .ai-chat-tool-tray-card--approval {
4558
+ border-color: #f59e0b;
4559
+ background: rgba(120, 53, 15, 0.46);
4560
+ }
4561
+ .ai-chat-tool-tray-card--running {
4562
+ border-color: #7dd3fc;
4563
+ background: #f0f9ff;
4564
+ }
4565
+ .dark-theme .ai-chat-tool-tray-card--running {
4566
+ border-color: #0e7490;
4567
+ background: rgba(8, 145, 178, 0.22);
4568
+ }
4569
+ .ai-chat-tool-tray-card--approved,
4570
+ .ai-chat-tool-tray-card--auto {
4571
+ border-color: #86efac;
4572
+ background: #f0fdf4;
4573
+ }
4574
+ .dark-theme .ai-chat-tool-tray-card--approved,
4575
+ .dark-theme .ai-chat-tool-tray-card--auto {
4576
+ border-color: #22c55e;
4577
+ background: rgba(22, 101, 52, 0.3);
4578
+ }
4579
+ .ai-chat-tool-tray-card--completed {
4580
+ border-color: #34d399;
4581
+ background: #ecfdf5;
4582
+ }
4583
+ .dark-theme .ai-chat-tool-tray-card--completed {
4584
+ border-color: #10b981;
4585
+ background: rgba(6, 95, 70, 0.35);
4586
+ }
4587
+ .ai-chat-tool-tray-card--error {
4588
+ border-color: #fca5a5;
4589
+ background: #fef2f2;
4590
+ }
4591
+ .dark-theme .ai-chat-tool-tray-card--error {
4592
+ border-color: #ef4444;
4593
+ background: rgba(127, 29, 29, 0.4);
4594
+ }
4595
+ @keyframes ai-chat-tool-tray-pop {
4596
+ from {
4597
+ opacity: 0;
4598
+ transform: translateY(16px);
4599
+ }
4600
+ to {
4601
+ opacity: 1;
4602
+ transform: translateY(0);
4603
+ }
4385
4604
  }
4386
4605
  .ai-chat-email-input-message {
4387
4606
  color: #991b1b;
package/dist/index.d.mts CHANGED
@@ -3,6 +3,17 @@ import * as React from 'react';
3
3
  import React__default from 'react';
4
4
  import PrismStyle from 'react-syntax-highlighter';
5
5
 
6
+ type MCPAuthPhase = "list" | "call";
7
+ interface MCPAuthHeaderResolverInput {
8
+ phase: MCPAuthPhase;
9
+ mcpServer: Record<string, unknown>;
10
+ projectId?: string;
11
+ customer?: LLMAsAServiceCustomer;
12
+ toolName?: string;
13
+ toolArgs?: unknown;
14
+ }
15
+ type MCPAuthHeaderResolver = (input: MCPAuthHeaderResolverInput) => Record<string, string> | null | undefined | Promise<Record<string, string> | null | undefined>;
16
+
6
17
  interface ChatPanelProps {
7
18
  project_id: string;
8
19
  initialPrompt?: string;
@@ -71,6 +82,7 @@ interface ChatPanelProps {
71
82
  customerEmailCapturePlaceholder?: string;
72
83
  mcpServers?: [];
73
84
  progressiveActions?: boolean;
85
+ resolveMcpAuthHeaders?: MCPAuthHeaderResolver;
74
86
  }
75
87
  interface ExtraProps$1 extends React__default.HTMLAttributes<HTMLElement> {
76
88
  inline?: boolean;
@@ -127,6 +139,7 @@ interface AgentPanelProps {
127
139
  createConversationOnFirstChat?: boolean;
128
140
  customerEmailCaptureMode?: "HIDE" | "OPTIONAL" | "REQUIRED";
129
141
  customerEmailCapturePlaceholder?: string;
142
+ resolveMcpAuthHeaders?: MCPAuthHeaderResolver;
130
143
  }
131
144
  interface ExtraProps extends React__default.HTMLAttributes<HTMLElement> {
132
145
  inline?: boolean;
@@ -134,15 +147,146 @@ interface ExtraProps extends React__default.HTMLAttributes<HTMLElement> {
134
147
  declare const AgentPanel: React__default.FC<AgentPanelProps & ExtraProps>;
135
148
 
136
149
  /**
137
- * Context section for agent awareness
150
+ * AIChatPanel - A modern chat interface using shadcn-style components
151
+ *
152
+ * This component provides the chat functionality for AIAgentPanel,
153
+ * using consistent shadcn-style UI components.
138
154
  */
139
- interface ContextSectionBase {
155
+
156
+ /**
157
+ * Agent option for the agent selector dropdown
158
+ */
159
+ interface AgentOption {
160
+ value: string;
161
+ label: string;
162
+ description?: string;
163
+ icon?: React__default.ReactNode;
164
+ avatarUrl?: string;
165
+ }
166
+ interface BeforeSendPayload {
167
+ prompt: string;
168
+ conversationId: string | null;
169
+ agentId?: string | null;
170
+ service?: string | null;
171
+ messages: {
172
+ role: string;
173
+ content: string;
174
+ }[];
175
+ }
176
+ type TraceContextMode = 'standard' | 'full';
177
+ interface LocalToolExecutorContext {
178
+ toolName: string;
179
+ callId: string;
180
+ serviceTag: string;
181
+ mcpTool: Record<string, unknown> | null;
182
+ }
183
+ type LocalToolExecutor = (args: Record<string, unknown>, context: LocalToolExecutorContext) => Promise<unknown> | unknown;
184
+ interface AIChatPanelProps {
185
+ project_id: string;
186
+ initialPrompt?: string;
187
+ initialMessage?: string;
188
+ title?: string;
189
+ placeholder?: string;
190
+ hideInitialPrompt?: boolean;
191
+ customer?: LLMAsAServiceCustomer;
192
+ data?: {
193
+ key: string;
194
+ data: string;
195
+ }[];
196
+ thumbsUpClick?: (callId: string) => void;
197
+ thumbsDownClick?: (callId: string) => void;
198
+ theme?: 'light' | 'dark';
199
+ url?: string | null;
200
+ service?: string | null;
201
+ historyChangedCallback?: (history: Record<string, {
202
+ content: string;
203
+ callId: string;
204
+ }>) => void;
205
+ responseCompleteCallback?: (callId: string, prompt: string, response: string) => void;
206
+ onLoadingChange?: (isLoading: boolean) => void;
207
+ promptTemplate?: string;
208
+ actions?: {
209
+ pattern: string;
210
+ type?: string;
211
+ markdown?: string;
212
+ callback?: (match: string, groups: any[]) => void;
213
+ clickCode?: string;
214
+ style?: string;
215
+ }[];
216
+ showNewConversationButton?: boolean;
217
+ followOnQuestions?: string[];
218
+ clearFollowOnQuestionsNextPrompt?: boolean;
219
+ followOnPrompt?: string;
220
+ showPoweredBy?: boolean;
221
+ agent?: string | null;
222
+ conversation?: string | null;
223
+ initialHistory?: Record<string, {
224
+ content: string;
225
+ callId: string;
226
+ }>;
227
+ hideRagContextInPrompt?: boolean;
228
+ createConversationOnFirstChat?: boolean;
229
+ autoApproveTools?: boolean | string[];
230
+ mcpServers?: any[];
231
+ resolveMcpAuthHeaders?: MCPAuthHeaderResolver;
232
+ localToolExecutors?: Record<string, LocalToolExecutor>;
233
+ traceContextMode?: TraceContextMode;
234
+ progressiveActions?: boolean;
235
+ agentOptions?: AgentOption[];
236
+ currentAgentId?: string;
237
+ onAgentChange?: (agentId: string) => void;
238
+ agentsLoading?: boolean;
239
+ contextSections?: ContextSection$1[];
240
+ totalContextTokens?: number;
241
+ maxContextTokens?: number;
242
+ enableContextDetailView?: boolean;
243
+ disabledSectionIds?: Set<string>;
244
+ onToggleSection?: (sectionId: string, enabled: boolean) => void;
245
+ onConversationCreated?: (conversationId: string) => void;
246
+ onBeforeSend?: (payload: BeforeSendPayload) => Promise<void> | void;
247
+ cssUrl?: string;
248
+ markdownClass?: string;
249
+ width?: string;
250
+ height?: string;
251
+ scrollToEnd?: boolean;
252
+ prismStyle?: any;
253
+ showSaveButton?: boolean;
254
+ showEmailButton?: boolean;
255
+ messages?: {
256
+ role: "user" | "assistant";
257
+ content: string;
258
+ }[];
259
+ showCallToAction?: boolean;
260
+ callToActionButtonText?: string;
261
+ callToActionEmailAddress?: string;
262
+ callToActionEmailSubject?: string;
263
+ customerEmailCaptureMode?: "HIDE" | "OPTIONAL" | "REQUIRED";
264
+ customerEmailCapturePlaceholder?: string;
265
+ }
266
+ /**
267
+ * Context section for the context viewer
268
+ */
269
+ interface ContextSection$1 {
140
270
  id: string;
141
271
  title: string;
142
272
  tokens?: number;
143
273
  format?: ContextDataFormat$1;
274
+ data?: Record<string, unknown>;
275
+ rawData?: string;
144
276
  }
145
277
  type ContextDataFormat$1 = 'json' | 'toon' | 'markdown' | 'text';
278
+ declare const _default: React__default.NamedExoticComponent<AIChatPanelProps>;
279
+
280
+ /**
281
+ * Context section for agent awareness
282
+ */
283
+ interface ContextSectionBase {
284
+ id: string;
285
+ title: string;
286
+ tokens?: number;
287
+ format?: ContextDataFormat;
288
+ }
289
+ type ContextDataFormat = 'json' | 'toon' | 'markdown' | 'text';
146
290
  interface ObjectContextSection extends ContextSectionBase {
147
291
  data: Record<string, unknown>;
148
292
  }
@@ -150,13 +294,13 @@ interface RawContextSection extends ContextSectionBase {
150
294
  rawData: string;
151
295
  data?: Record<string, unknown>;
152
296
  }
153
- type ContextSection$1 = ObjectContextSection | RawContextSection;
297
+ type ContextSection = ObjectContextSection | RawContextSection;
154
298
  /**
155
299
  * Agent context passed to the panel
156
300
  */
157
301
  interface AgentContext {
158
302
  route?: string;
159
- sections: ContextSection$1[];
303
+ sections: ContextSection[];
160
304
  totalTokens?: number;
161
305
  }
162
306
  /**
@@ -196,8 +340,8 @@ interface AIAgentPanelProps {
196
340
  apiKey?: string;
197
341
  context?: AgentContext | null;
198
342
  contextDataSources?: Record<string, unknown>;
199
- sharedContextSections?: ContextSection$1[];
200
- pageContextSections?: ContextSection$1[];
343
+ sharedContextSections?: ContextSection[];
344
+ pageContextSections?: ContextSection[];
201
345
  onContextChange?: (context: AgentContext) => void;
202
346
  maxContextTokens?: number;
203
347
  data?: {
@@ -218,6 +362,7 @@ interface AIAgentPanelProps {
218
362
  enableContextDetailView?: boolean;
219
363
  onAgentSwitch?: (fromAgent: string, toAgent: string) => void;
220
364
  onConversationChange?: (conversationId: string) => void;
365
+ onBeforeSend?: (payload: BeforeSendPayload) => Promise<void> | void;
221
366
  historyChangedCallback?: (history: Record<string, {
222
367
  content: string;
223
368
  callId: string;
@@ -262,117 +407,13 @@ interface AIAgentPanelProps {
262
407
  callToActionEmailSubject?: string;
263
408
  customerEmailCaptureMode?: "HIDE" | "OPTIONAL" | "REQUIRED";
264
409
  customerEmailCapturePlaceholder?: string;
410
+ resolveMcpAuthHeaders?: MCPAuthHeaderResolver;
411
+ localToolExecutors?: Record<string, LocalToolExecutor>;
412
+ traceContextMode?: TraceContextMode;
413
+ autoApproveTools?: boolean | string[];
265
414
  }
266
415
  declare const AIAgentPanel: React__default.ForwardRefExoticComponent<AIAgentPanelProps & React__default.RefAttributes<AIAgentPanelHandle>>;
267
416
 
268
- /**
269
- * AIChatPanel - A modern chat interface using shadcn-style components
270
- *
271
- * This component provides the chat functionality for AIAgentPanel,
272
- * using consistent shadcn-style UI components.
273
- */
274
-
275
- /**
276
- * Agent option for the agent selector dropdown
277
- */
278
- interface AgentOption {
279
- value: string;
280
- label: string;
281
- description?: string;
282
- icon?: React__default.ReactNode;
283
- avatarUrl?: string;
284
- }
285
- interface AIChatPanelProps {
286
- project_id: string;
287
- initialPrompt?: string;
288
- initialMessage?: string;
289
- title?: string;
290
- placeholder?: string;
291
- hideInitialPrompt?: boolean;
292
- customer?: LLMAsAServiceCustomer;
293
- data?: {
294
- key: string;
295
- data: string;
296
- }[];
297
- thumbsUpClick?: (callId: string) => void;
298
- thumbsDownClick?: (callId: string) => void;
299
- theme?: 'light' | 'dark';
300
- url?: string | null;
301
- service?: string | null;
302
- historyChangedCallback?: (history: Record<string, {
303
- content: string;
304
- callId: string;
305
- }>) => void;
306
- responseCompleteCallback?: (callId: string, prompt: string, response: string) => void;
307
- onLoadingChange?: (isLoading: boolean) => void;
308
- promptTemplate?: string;
309
- actions?: {
310
- pattern: string;
311
- type?: string;
312
- markdown?: string;
313
- callback?: (match: string, groups: any[]) => void;
314
- clickCode?: string;
315
- style?: string;
316
- }[];
317
- showNewConversationButton?: boolean;
318
- followOnQuestions?: string[];
319
- clearFollowOnQuestionsNextPrompt?: boolean;
320
- followOnPrompt?: string;
321
- showPoweredBy?: boolean;
322
- agent?: string | null;
323
- conversation?: string | null;
324
- initialHistory?: Record<string, {
325
- content: string;
326
- callId: string;
327
- }>;
328
- hideRagContextInPrompt?: boolean;
329
- createConversationOnFirstChat?: boolean;
330
- mcpServers?: any[];
331
- progressiveActions?: boolean;
332
- agentOptions?: AgentOption[];
333
- currentAgentId?: string;
334
- onAgentChange?: (agentId: string) => void;
335
- agentsLoading?: boolean;
336
- contextSections?: ContextSection[];
337
- totalContextTokens?: number;
338
- maxContextTokens?: number;
339
- enableContextDetailView?: boolean;
340
- disabledSectionIds?: Set<string>;
341
- onToggleSection?: (sectionId: string, enabled: boolean) => void;
342
- onConversationCreated?: (conversationId: string) => void;
343
- cssUrl?: string;
344
- markdownClass?: string;
345
- width?: string;
346
- height?: string;
347
- scrollToEnd?: boolean;
348
- prismStyle?: any;
349
- showSaveButton?: boolean;
350
- showEmailButton?: boolean;
351
- messages?: {
352
- role: "user" | "assistant";
353
- content: string;
354
- }[];
355
- showCallToAction?: boolean;
356
- callToActionButtonText?: string;
357
- callToActionEmailAddress?: string;
358
- callToActionEmailSubject?: string;
359
- customerEmailCaptureMode?: "HIDE" | "OPTIONAL" | "REQUIRED";
360
- customerEmailCapturePlaceholder?: string;
361
- }
362
- /**
363
- * Context section for the context viewer
364
- */
365
- interface ContextSection {
366
- id: string;
367
- title: string;
368
- tokens?: number;
369
- format?: ContextDataFormat;
370
- data?: Record<string, unknown>;
371
- rawData?: string;
372
- }
373
- type ContextDataFormat = 'json' | 'toon' | 'markdown' | 'text';
374
- declare const _default: React__default.NamedExoticComponent<AIChatPanelProps>;
375
-
376
417
  /**
377
418
  * Agent metadata returned from the LLMAsAService API
378
419
  */
@@ -411,6 +452,8 @@ interface MCPServer {
411
452
  status: 'active' | 'inactive';
412
453
  executionMode: 'CLIENT' | 'SERVER';
413
454
  url?: string;
455
+ accessToken?: string;
456
+ headers?: Record<string, string>;
414
457
  }
415
458
  interface AgentProfile {
416
459
  status: 'idle' | 'loading' | 'ready' | 'error';
@@ -616,4 +659,4 @@ interface ThinkingBlockProps {
616
659
  */
617
660
  declare const ThinkingBlock: React__default.FC<ThinkingBlockProps>;
618
661
 
619
- export { AIAgentPanel, type AIAgentPanelProps, _default as AIChatPanel, type AIChatPanelProps, type APIConversationSummary, type AgentContext, type AgentMetadata, AgentPanel, type AgentPanelProps, type AgentProfile, Button, type ButtonProps, ChatPanel, type ChatPanelProps, type ContextDataFormat$1 as ContextDataFormat, type ContextSection$1 as ContextSection, type Conversation, type ConversationGroup, Dialog, DialogFooter, type DialogFooterProps, type DialogProps, Input, type InputProps, type MCPServer, type ObjectContextSection, type RawContextSection, ScrollArea, type ScrollAreaProps, Select, type SelectOption, type SelectProps, ThinkingBlock, type ThinkingBlockProps, type ThinkingBlockType, Tooltip, type TooltipProps, WordFadeIn, type WordFadeInProps, useAgentRegistry, useConversationStore };
662
+ export { AIAgentPanel, type AIAgentPanelProps, _default as AIChatPanel, type AIChatPanelProps, type APIConversationSummary, type AgentContext, type AgentMetadata, AgentPanel, type AgentPanelProps, type AgentProfile, Button, type ButtonProps, ChatPanel, type ChatPanelProps, type ContextDataFormat, type ContextSection, type Conversation, type ConversationGroup, Dialog, DialogFooter, type DialogFooterProps, type DialogProps, Input, type InputProps, type MCPAuthHeaderResolver, type MCPAuthHeaderResolverInput, type MCPAuthPhase, type MCPServer, type ObjectContextSection, type RawContextSection, ScrollArea, type ScrollAreaProps, Select, type SelectOption, type SelectProps, ThinkingBlock, type ThinkingBlockProps, type ThinkingBlockType, Tooltip, type TooltipProps, WordFadeIn, type WordFadeInProps, useAgentRegistry, useConversationStore };