@marketrix.ai/widget 3.8.240 → 3.8.243

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,6 @@
1
+ import React from 'react';
2
+ interface TaskStatusIconProps {
3
+ status: 'ongoing' | 'done' | 'failed' | 'stopped';
4
+ }
5
+ export declare const TaskStatusIcon: React.FC<TaskStatusIconProps>;
6
+ export {};
@@ -6,7 +6,7 @@ export interface MessengerShellProps {
6
6
  isMinimized: boolean;
7
7
  messages: ChatMessage[];
8
8
  currentMode: InstructionType;
9
- isSimulationRunning?: boolean;
9
+ isTaskRunning?: boolean;
10
10
  activeView: WidgetView;
11
11
  onClose: () => void;
12
12
  onSendMessage: (message: string, mode?: InstructionType, applicationId?: number, question?: string, skipUserMessage?: boolean) => void;
@@ -5,7 +5,7 @@ export interface ChatViewProps {
5
5
  config: MarketrixConfig;
6
6
  messages: ChatMessage[];
7
7
  currentMode: InstructionType;
8
- isSimulationRunning?: boolean;
8
+ isTaskRunning?: boolean;
9
9
  onSendMessage: (message: string, mode?: InstructionType, applicationId?: number, question?: string, skipUserMessage?: boolean) => void;
10
10
  onSetMode: (mode: InstructionType) => void;
11
11
  onAddMessage: (message: ChatMessage) => void;
@@ -2,8 +2,8 @@ import React from 'react';
2
2
  import type { ChatMessage, InstructionType } from '../types';
3
3
  import type { UIStateActions } from './UIStateContext';
4
4
  export interface SimulationState {
5
- activeSimulationId: string | null;
6
- isSimulationRunning: boolean;
5
+ activeTaskId: string | null;
6
+ isTaskRunning: boolean;
7
7
  }
8
8
  export interface ChatState {
9
9
  messages: ChatMessage[];
@@ -18,8 +18,8 @@ export interface ChatActions {
18
18
  }
19
19
  export interface SimulationActions {
20
20
  setTaskState: (payload: {
21
- activeSimulationId: string | null;
22
- isSimulationRunning: boolean;
21
+ activeTaskId: string | null;
22
+ isTaskRunning: boolean;
23
23
  }) => void;
24
24
  stopTask: () => Promise<void>;
25
25
  }
@@ -1,8 +1,8 @@
1
1
  import type { WidgetEvent } from '../sdk';
2
2
  import type { ChatMessage, InstructionType } from '../types';
3
3
  export interface SseSimulationState {
4
- activeSimulationId: string | null;
5
- isSimulationRunning: boolean;
4
+ activeTaskId: string | null;
5
+ isTaskRunning: boolean;
6
6
  }
7
7
  export interface SseState {
8
8
  messages: ChatMessage[];
@@ -13,8 +13,8 @@ interface UseWidgetActions {
13
13
  setError: (error: string | undefined) => void;
14
14
  clearError: () => void;
15
15
  setTaskState: (payload: {
16
- activeSimulationId: string | null;
17
- isSimulationRunning: boolean;
16
+ activeTaskId: string | null;
17
+ isTaskRunning: boolean;
18
18
  }) => void;
19
19
  addMessage: (message: ChatMessage) => void;
20
20
  updateMessage: (messageId: string, updates: Partial<ChatMessage>) => void;
@@ -147,7 +147,7 @@ export declare const StepReactionSchema: z.ZodObject<{
147
147
  negative: "negative";
148
148
  }>;
149
149
  }, z.core.$strip>;
150
- export declare const SimPersonaReactionEntitySchema: z.ZodObject<{
150
+ export declare const SimulationReactionEntitySchema: z.ZodObject<{
151
151
  id: z.ZodNumber;
152
152
  run_id: z.ZodNullable<z.ZodNumber>;
153
153
  persona_id: z.ZodNullable<z.ZodNumber>;
@@ -1,4 +1,4 @@
1
- import type { MarketrixConfig, MessageDispatchRequest, MessageDispatchResponse } from '../types';
1
+ import type { MarketrixConfig, MessageDispatchRequest } from '../types';
2
2
  export declare class ApiService {
3
3
  private config;
4
4
  constructor(config: MarketrixConfig);
@@ -7,6 +7,6 @@ export declare class ApiService {
7
7
  private getUserId;
8
8
  logWidgetQuestion(question: string, mode: string): Promise<void>;
9
9
  /** Fire-and-forget send over the typed stream; the reply arrives asynchronously as a chat/response event. */
10
- messageDispatch(request: MessageDispatchRequest): Promise<MessageDispatchResponse>;
10
+ messageDispatch(request: MessageDispatchRequest): Promise<void>;
11
11
  updateConfig(newConfig: Partial<MarketrixConfig>): void;
12
12
  }
@@ -2,8 +2,8 @@ import type { ChatMessage, InstructionType } from '../types';
2
2
  /** Widget state persisted to / restored from localStorage; React context is the runtime source of truth. */
3
3
  export interface ChatSnapshot {
4
4
  messages: ChatMessage[];
5
- isSimulationRunning: boolean;
6
- activeSimulationId: string | null;
5
+ isTaskRunning: boolean;
6
+ activeTaskId: string | null;
7
7
  currentMode: InstructionType;
8
8
  isOpen: boolean;
9
9
  isMinimized: boolean;
@@ -13,8 +13,8 @@ type StoredMessage = Omit<ChatMessage, 'videoStream' | 'timestamp'> & {
13
13
  export interface MarketrixChatContext {
14
14
  chat_id: string | null;
15
15
  messages: StoredMessage[];
16
- isSimulationRunning: boolean;
17
- activeSimulationId: string | null;
16
+ isTaskRunning: boolean;
17
+ activeTaskId: string | null;
18
18
  currentMode: InstructionType;
19
19
  isOpen: boolean;
20
20
  isMinimized: boolean;
@@ -39,8 +39,8 @@ declare class StorageService {
39
39
  setChatId(chatId: string | null): void;
40
40
  getMessages(): StoredMessage[];
41
41
  setMessages(messages: StoredMessage[]): void;
42
- getChatState(): Pick<MarketrixChatContext, 'isSimulationRunning' | 'activeSimulationId' | 'currentMode' | 'isOpen' | 'isMinimized' | 'isLoading'>;
43
- setChatState(state: Partial<Pick<MarketrixChatContext, 'isSimulationRunning' | 'activeSimulationId' | 'currentMode' | 'isOpen' | 'isMinimized' | 'isLoading'>>): void;
42
+ getChatState(): Pick<MarketrixChatContext, 'isTaskRunning' | 'activeTaskId' | 'currentMode' | 'isOpen' | 'isMinimized' | 'isLoading'>;
43
+ setChatState(state: Partial<Pick<MarketrixChatContext, 'isTaskRunning' | 'activeTaskId' | 'currentMode' | 'isOpen' | 'isMinimized' | 'isLoading'>>): void;
44
44
  getConfig(): MarketrixConfig | null;
45
45
  setConfig(config: MarketrixConfig | null): void;
46
46
  clear(): void;
@@ -6,5 +6,5 @@ export declare class WidgetService {
6
6
  constructor(mtxId?: string, mtxKey?: string, mtxApp?: number);
7
7
  /** Default settings merged with the matched widget's settings; null with no credentials (preview mode). */
8
8
  widgetSettingsGet(): Promise<WidgetData | null>;
9
- getWidgetSettings(widget: WidgetData): WidgetSettingsData | null;
9
+ getSettings(widget: WidgetData): WidgetSettingsData | null;
10
10
  }
@@ -30,7 +30,7 @@ export interface ChatMessage {
30
30
  isPlaceholder?: boolean;
31
31
  placeholderState?: 'thinking' | 'waiting-for-user';
32
32
  parts?: MessagePart[];
33
- simulationStatus?: 'ongoing' | 'done' | 'failed' | 'stopped';
33
+ taskStatus?: 'ongoing' | 'done' | 'failed' | 'stopped';
34
34
  }
35
35
  export interface MessagePart {
36
36
  type: 'text' | 'progress';
@@ -52,26 +52,15 @@ export interface WidgetState {
52
52
  currentMode: InstructionType;
53
53
  agentAvailable: boolean;
54
54
  error?: string;
55
- activeSimulationId: string | null;
56
- isSimulationRunning: boolean;
55
+ activeTaskId: string | null;
56
+ isTaskRunning: boolean;
57
57
  activeView: WidgetView;
58
58
  }
59
59
  export interface MessageDispatchRequest {
60
60
  message?: string;
61
61
  mode?: InstructionType;
62
- mtxId?: string;
63
- mtxKey?: string;
64
- application_id?: number;
65
- question?: string;
66
62
  requestId?: string;
67
63
  }
68
- export interface MessageDispatchResponse {
69
- messageId: string;
70
- response: string;
71
- mode: InstructionType;
72
- timestamp: Date;
73
- task_id?: string;
74
- }
75
64
  export type WidgetPosition = WidgetSettingsData['widget_position'];
76
65
  export type AddWidgetConfig = ({
77
66
  settings: WidgetSettingsData;
@@ -5,7 +5,7 @@ export declare function hasThinkingMarker(content: string): boolean;
5
5
  export declare function addThinkingMarker(content: string): string;
6
6
  export interface FindMessageOptions {
7
7
  messages: ChatMessage[];
8
- isSimulationRunning: boolean;
8
+ isTaskRunning: boolean;
9
9
  currentMode: InstructionType;
10
10
  requireContent?: boolean;
11
11
  }
@@ -17,6 +17,6 @@ export declare const WAIT_FOR_USER_TOOLS: Set<string>;
17
17
  export declare function addProgressLine(message: ChatMessage, browserToolName: string, explanation: string): ChatMessage;
18
18
  export declare function markProgressLineComplete(message: ChatMessage, browserToolName?: string): ChatMessage;
19
19
  export declare function markProgressLineFailed(message: ChatMessage, browserToolName: string, error: string): ChatMessage;
20
- export declare function updateThinkingMarker(message: ChatMessage, isSimulationRunning: boolean, currentMode: 'show' | 'tell' | 'do', isWaitingForUser?: boolean): ChatMessage;
20
+ export declare function updateThinkingMarker(message: ChatMessage, isTaskRunning: boolean, currentMode: 'show' | 'tell' | 'do', isWaitingForUser?: boolean): ChatMessage;
21
21
  export declare const TOOL_NAME_MAPPING: Record<string, string>;
22
22
  export declare function getFriendlyToolName(browserToolName: string): string;