@hef2024/llmasaservice-ui 0.25.2 → 0.26.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/dist/index.d.ts CHANGED
@@ -173,6 +173,46 @@ interface BeforeSendPayload {
173
173
  content: string;
174
174
  }[];
175
175
  }
176
+ type CompactionAction = 'none' | 'compacted' | 'fallback_window';
177
+ interface CompactionTokenUsage {
178
+ projectedBefore: number;
179
+ projectedAfter: number;
180
+ warnThreshold: number;
181
+ compactThreshold: number;
182
+ targetThreshold: number;
183
+ }
184
+ interface CompactContextInput {
185
+ prompt: string;
186
+ conversationId: string | null;
187
+ agentId?: string | null;
188
+ service?: string | null;
189
+ messages: {
190
+ role: string;
191
+ content: string;
192
+ }[];
193
+ data: {
194
+ key: string;
195
+ data: string;
196
+ }[];
197
+ maxContextTokens: number;
198
+ totalContextTokens: number;
199
+ warnRatio: number;
200
+ compactRatio: number;
201
+ targetRatio: number;
202
+ preserveTurns: number;
203
+ projectedTokens: CompactionTokenUsage;
204
+ }
205
+ interface CompactContextResult {
206
+ action: CompactionAction;
207
+ prompt: string;
208
+ messages: {
209
+ role: string;
210
+ content: string;
211
+ }[];
212
+ warning?: string | null;
213
+ tokenUsage?: Partial<CompactionTokenUsage> | null;
214
+ metadata?: Record<string, unknown> | null;
215
+ }
176
216
  type TraceContextMode = 'standard' | 'full';
177
217
  interface LocalToolExecutorContext {
178
218
  toolName: string;
@@ -269,6 +309,8 @@ interface AIChatPanelProps {
269
309
  onToggleSection?: (sectionId: string, enabled: boolean) => void;
270
310
  onConversationCreated?: (conversationId: string) => void;
271
311
  onBeforeSend?: (payload: BeforeSendPayload) => Promise<void> | void;
312
+ compactContext?: (input: CompactContextInput) => Promise<CompactContextResult> | CompactContextResult;
313
+ compactionPreserveTurns?: number;
272
314
  cssUrl?: string;
273
315
  markdownClass?: string;
274
316
  width?: string;
@@ -288,6 +330,7 @@ interface AIChatPanelProps {
288
330
  customerEmailCaptureMode?: "HIDE" | "OPTIONAL" | "REQUIRED";
289
331
  customerEmailCapturePlaceholder?: string;
290
332
  toolStatusLabelFormatter?: ToolStatusLabelFormatter;
333
+ composerAgentModeControl?: ComposerAgentModeControl;
291
334
  }
292
335
  /**
293
336
  * Context section for the context viewer
@@ -300,6 +343,13 @@ interface ContextSection$1 {
300
343
  data?: Record<string, unknown>;
301
344
  rawData?: string;
302
345
  }
346
+ interface ComposerAgentModeControl {
347
+ active?: boolean;
348
+ disabled?: boolean;
349
+ label?: string;
350
+ title?: string;
351
+ onActivate?: () => void;
352
+ }
303
353
  type ContextDataFormat$1 = 'json' | 'toon' | 'markdown' | 'text';
304
354
  declare const _default: React__default.NamedExoticComponent<AIChatPanelProps>;
305
355
 
@@ -341,6 +391,19 @@ interface APIConversationSummary {
341
391
  agentId?: string;
342
392
  messageCount?: number;
343
393
  }
394
+ /**
395
+ * Active conversation state for multi-conversation support
396
+ */
397
+ interface ActiveConversation {
398
+ conversationId: string;
399
+ stableKey: string;
400
+ agentId: string;
401
+ history: Record<string, AIChatHistoryEntry>;
402
+ transcriptLoaded: boolean;
403
+ isLoading: boolean;
404
+ title: string;
405
+ conversationInitialPrompt?: string;
406
+ }
344
407
  /**
345
408
  * Agent configuration with optional local overrides
346
409
  */
@@ -389,6 +452,8 @@ interface AIAgentPanelProps {
389
452
  onAgentSwitch?: (fromAgent: string, toAgent: string) => void;
390
453
  onConversationChange?: (conversationId: string) => void;
391
454
  onBeforeSend?: (payload: BeforeSendPayload) => Promise<void> | void;
455
+ compactContext?: (input: CompactContextInput) => Promise<CompactContextResult> | CompactContextResult;
456
+ compactionPreserveTurns?: number;
392
457
  historyChangedCallback?: (history: Record<string, AIChatHistoryEntry>) => void;
393
458
  responseCompleteCallback?: (callId: string, prompt: string, response: string) => void;
394
459
  thumbsUpClick?: (callId: string) => void;
@@ -411,6 +476,7 @@ interface AIAgentPanelProps {
411
476
  followOnQuestions?: string[];
412
477
  followOnPrompt?: string;
413
478
  historyListLimit?: number;
479
+ conversationSubtitleResolver?: (conversationId: string, conversation?: APIConversationSummary | ActiveConversation) => string | null | undefined;
414
480
  showConversationHistory?: boolean;
415
481
  cssUrl?: string;
416
482
  markdownClass?: string;
@@ -435,6 +501,7 @@ interface AIAgentPanelProps {
435
501
  traceContextMode?: TraceContextMode;
436
502
  autoApproveTools?: boolean | string[];
437
503
  toolStatusLabelFormatter?: ToolStatusLabelFormatter;
504
+ composerAgentModeControl?: ComposerAgentModeControl;
438
505
  }
439
506
  declare const AIAgentPanel: React__default.ForwardRefExoticComponent<AIAgentPanelProps & React__default.RefAttributes<AIAgentPanelHandle>>;
440
507
 
@@ -683,4 +750,4 @@ interface ThinkingBlockProps {
683
750
  */
684
751
  declare const ThinkingBlock: React__default.FC<ThinkingBlockProps>;
685
752
 
686
- export { AIAgentPanel, type AIAgentPanelProps, type AIChatHistoryEntry, _default as AIChatPanel, type AIChatPanelProps, type APIConversationSummary, type AgentContext, type AgentMetadata, AgentPanel, type AgentPanelProps, type AgentProfile, type ArtifactBlockType, 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 PlanningStep, type PlanningStepStatus, type RawContextSection, type ResponseArtifactBlock, ScrollArea, type ScrollAreaProps, Select, type SelectOption, type SelectProps, ThinkingBlock, type ThinkingBlockProps, type ThinkingBlockType, type ToolCallStatus, type ToolStatusLabelFormatter, type ToolStatusLabelFormatterInput, Tooltip, type TooltipProps, WordFadeIn, type WordFadeInProps, useAgentRegistry, useConversationStore };
753
+ export { AIAgentPanel, type AIAgentPanelProps, type AIChatHistoryEntry, _default as AIChatPanel, type AIChatPanelProps, type APIConversationSummary, type AgentContext, type AgentMetadata, AgentPanel, type AgentPanelProps, type AgentProfile, type ArtifactBlockType, Button, type ButtonProps, ChatPanel, type ChatPanelProps, type CompactContextInput, type CompactContextResult, type CompactionAction, type CompactionTokenUsage, type ComposerAgentModeControl, 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 PlanningStep, type PlanningStepStatus, type RawContextSection, type ResponseArtifactBlock, ScrollArea, type ScrollAreaProps, Select, type SelectOption, type SelectProps, ThinkingBlock, type ThinkingBlockProps, type ThinkingBlockType, type ToolCallStatus, type ToolStatusLabelFormatter, type ToolStatusLabelFormatterInput, Tooltip, type TooltipProps, WordFadeIn, type WordFadeInProps, useAgentRegistry, useConversationStore };