@marketrix.ai/widget 3.8.134 → 3.8.136

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 SimulationStatusIconProps {
3
+ status: 'ongoing' | 'done' | 'failed' | 'stopped';
4
+ }
5
+ export declare const SimulationStatusIcon: React.FC<SimulationStatusIconProps>;
6
+ export {};
@@ -6,7 +6,7 @@ export interface MessengerShellProps {
6
6
  isMinimized: boolean;
7
7
  messages: ChatMessage[];
8
8
  currentMode: InstructionType;
9
- isTaskRunning?: boolean;
9
+ isSimulationRunning?: 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
- isTaskRunning?: boolean;
8
+ isSimulationRunning?: 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;
@@ -12,9 +12,9 @@ import type { UIStateActions } from './UIStateContext';
12
12
  * (open/minimized/mode/loading/error) stays separate — a genuinely different
13
13
  * concern.
14
14
  */
15
- export interface TaskState {
16
- activeTaskId: string | null;
17
- isTaskRunning: boolean;
15
+ export interface SimulationState {
16
+ activeSimulationId: string | null;
17
+ isSimulationRunning: boolean;
18
18
  }
19
19
  export interface ChatState {
20
20
  messages: ChatMessage[];
@@ -27,18 +27,18 @@ export interface ChatActions {
27
27
  clearMessages: () => void;
28
28
  sendMessage: (content: string, mode?: InstructionType, applicationId?: number, question?: string, skipUserMessage?: boolean) => Promise<void>;
29
29
  }
30
- export interface TaskActions {
30
+ export interface SimulationActions {
31
31
  setTaskState: (payload: {
32
- activeTaskId: string | null;
33
- isTaskRunning: boolean;
32
+ activeSimulationId: string | null;
33
+ isSimulationRunning: boolean;
34
34
  }) => void;
35
35
  stopTask: () => Promise<void>;
36
36
  }
37
37
  interface ConversationContextType {
38
38
  chatState: ChatState;
39
39
  chatActions: ChatActions;
40
- taskState: TaskState;
41
- taskActions: TaskActions;
40
+ taskState: SimulationState;
41
+ taskActions: SimulationActions;
42
42
  }
43
43
  interface ConversationProviderProps {
44
44
  children: React.ReactNode;
@@ -49,7 +49,7 @@ interface ConversationProviderProps {
49
49
  uiActions: Pick<UIStateActions, 'setLoading' | 'setAgentAvailable' | 'setError'>;
50
50
  /** One-time hydrated snapshot to seed the store (messages + task) on mount. */
51
51
  initialMessages?: ChatMessage[];
52
- initialTask?: TaskState;
52
+ initialTask?: SimulationState;
53
53
  }
54
54
  export declare const ConversationProvider: React.FC<ConversationProviderProps>;
55
55
  export declare const useConversationContext: () => ConversationContextType;
@@ -10,13 +10,13 @@
10
10
  */
11
11
  import type { WidgetEvent } from '../sdk';
12
12
  import type { ChatMessage, InstructionType } from '../types';
13
- export interface SseTaskState {
14
- activeTaskId: string | null;
15
- isTaskRunning: boolean;
13
+ export interface SseSimulationState {
14
+ activeSimulationId: string | null;
15
+ isSimulationRunning: boolean;
16
16
  }
17
17
  export interface SseState {
18
18
  messages: ChatMessage[];
19
- task: SseTaskState;
19
+ task: SseSimulationState;
20
20
  }
21
21
  /** Side effects the wiring layer must run after applying a reduced state. */
22
22
  export type SseEffect = {
@@ -29,9 +29,6 @@ export type SseEffect = {
29
29
  } | {
30
30
  type: 'setLoading';
31
31
  value: boolean;
32
- } | {
33
- type: 'activateApiTask';
34
- taskId: string;
35
32
  };
36
33
  export interface ReduceResult {
37
34
  state: SseState;
@@ -13,8 +13,8 @@ interface UseWidgetActions {
13
13
  setError: (error: string | undefined) => void;
14
14
  clearError: () => void;
15
15
  setTaskState: (payload: {
16
- activeTaskId: string | null;
17
- isTaskRunning: boolean;
16
+ activeSimulationId: string | null;
17
+ isSimulationRunning: boolean;
18
18
  }) => void;
19
19
  addMessage: (message: ChatMessage) => void;
20
20
  updateMessage: (messageId: string, updates: Partial<ChatMessage>) => void;
@@ -381,7 +381,6 @@ export declare const widgetContract: {
381
381
  type: "chat/response";
382
382
  request_id: string;
383
383
  text: string;
384
- task_id?: string | undefined;
385
384
  } | {
386
385
  type: "chat/error";
387
386
  request_id: string;
@@ -412,7 +411,6 @@ export declare const widgetContract: {
412
411
  type: "chat/response";
413
412
  request_id: string;
414
413
  text: string;
415
- task_id?: string | undefined;
416
414
  } | {
417
415
  type: "chat/error";
418
416
  request_id: string;
@@ -47,17 +47,6 @@ export declare const listOf: <T extends z.ZodTypeAny>(schema: T) => z.ZodObject<
47
47
  items: z.ZodArray<T>;
48
48
  count: z.ZodNumber;
49
49
  }, z.core.$strip>;
50
- /** Value types in QA test case version diffs */
51
- export declare const DiffValueSchema: z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodArray<z.ZodString>, z.ZodNull]>;
52
- export declare const ContextRefSchema: z.ZodObject<{
53
- type: z.ZodEnum<{
54
- doc: "doc";
55
- sim: "sim";
56
- session: "session";
57
- }>;
58
- id: z.ZodString;
59
- label: z.ZodString;
60
- }, z.core.$strip>;
61
50
  export declare const SuccessSchema: z.ZodObject<{
62
51
  success: z.ZodLiteral<true>;
63
52
  }, z.core.$strip>;
@@ -104,7 +93,7 @@ export declare const GraphSectionSchema: z.ZodObject<{
104
93
  }, z.core.$loose>;
105
94
  /**
106
95
  * Graph node schema - unique page state observed during simulation.
107
- * Matches agent's PageNode model (perception/graph.py).
96
+ * Matches agent's PageNode model (knowledge/graph.py).
108
97
  * Uses passthrough() because the agent model may evolve faster than the schema.
109
98
  */
110
99
  export declare const GraphNodeSchema: z.ZodObject<{
@@ -179,65 +179,6 @@ export declare const VIEWPORT_DIMENSIONS: Record<ViewportName, {
179
179
  width: number;
180
180
  height: number;
181
181
  }>;
182
- export declare const QAProcessResponseSchema: z.ZodObject<{
183
- ultimate_goal: z.ZodString;
184
- test_cases: z.ZodArray<z.ZodObject<{
185
- test_title: z.ZodString;
186
- test_objective: z.ZodString;
187
- test_steps: z.ZodArray<z.ZodString>;
188
- expected_outcome: z.ZodString;
189
- priority: z.ZodEnum<{
190
- Low: "Low";
191
- Medium: "Medium";
192
- High: "High";
193
- }>;
194
- }, z.core.$strip>>;
195
- summary: z.ZodObject<{
196
- total_tests: z.ZodNumber;
197
- high_priority: z.ZodNumber;
198
- medium_priority: z.ZodNumber;
199
- low_priority: z.ZodNumber;
200
- estimated_time_minutes: z.ZodNumber;
201
- }, z.core.$strip>;
202
- }, z.core.$strip>;
203
- export declare const TaskDependencySchema: z.ZodObject<{
204
- task_id: z.ZodString;
205
- condition: z.ZodOptional<z.ZodEnum<{
206
- pass: "pass";
207
- }>>;
208
- }, z.core.$strip>;
209
- export type TaskDependency = z.infer<typeof TaskDependencySchema>;
210
- /**
211
- * A single task within a simulation. Direct simulations have 1 task (the prompt).
212
- * QA simulations have N tasks (one per test case).
213
- */
214
- export declare const SimulationTaskEntrySchema: z.ZodObject<{
215
- task_id: z.ZodString;
216
- title: z.ZodString;
217
- instructions: z.ZodString;
218
- status: z.ZodEnum<{
219
- running: "running";
220
- has_question: "has_question";
221
- failed: "failed";
222
- stopped: "stopped";
223
- pending: "pending";
224
- passed: "passed";
225
- skipped: "skipped";
226
- }>;
227
- error_message: z.ZodOptional<z.ZodNullable<z.ZodString>>;
228
- started_at: z.ZodOptional<z.ZodNullable<z.ZodString>>;
229
- completed_at: z.ZodOptional<z.ZodNullable<z.ZodString>>;
230
- order_index: z.ZodDefault<z.ZodNumber>;
231
- tab_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
232
- step_count: z.ZodDefault<z.ZodNumber>;
233
- blocked_by: z.ZodDefault<z.ZodArray<z.ZodObject<{
234
- task_id: z.ZodString;
235
- condition: z.ZodOptional<z.ZodEnum<{
236
- pass: "pass";
237
- }>>;
238
- }, z.core.$strip>>>;
239
- }, z.core.$strip>;
240
- export type SimulationTaskEntry = z.infer<typeof SimulationTaskEntrySchema>;
241
182
  export declare const SentimentSchema: z.ZodEnum<{
242
183
  positive: "positive";
243
184
  neutral: "neutral";
@@ -253,14 +194,6 @@ export declare const StepReactionSchema: z.ZodObject<{
253
194
  negative: "negative";
254
195
  }>>;
255
196
  }, z.core.$strip>;
256
- export declare const JourneyReactionSchema: z.ZodObject<{
257
- reaction: z.ZodString;
258
- sentiment: z.ZodEnum<{
259
- positive: "positive";
260
- neutral: "neutral";
261
- negative: "negative";
262
- }>;
263
- }, z.core.$strip>;
264
197
  export declare const PersonaSimReactionEntitySchema: z.ZodObject<{
265
198
  id: z.ZodNumber;
266
199
  run_id: z.ZodNullable<z.ZodNumber>;
@@ -328,32 +261,9 @@ export declare const SimulationEntitySchema: z.ZodObject<{
328
261
  }>>;
329
262
  graph_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
330
263
  source_metadata: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
331
- tasks: z.ZodOptional<z.ZodArray<z.ZodObject<{
332
- task_id: z.ZodString;
333
- title: z.ZodString;
334
- instructions: z.ZodString;
335
- status: z.ZodEnum<{
336
- running: "running";
337
- has_question: "has_question";
338
- failed: "failed";
339
- stopped: "stopped";
340
- pending: "pending";
341
- passed: "passed";
342
- skipped: "skipped";
343
- }>;
344
- error_message: z.ZodOptional<z.ZodNullable<z.ZodString>>;
345
- started_at: z.ZodOptional<z.ZodNullable<z.ZodString>>;
346
- completed_at: z.ZodOptional<z.ZodNullable<z.ZodString>>;
347
- order_index: z.ZodDefault<z.ZodNumber>;
348
- tab_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
349
- step_count: z.ZodDefault<z.ZodNumber>;
350
- blocked_by: z.ZodDefault<z.ZodArray<z.ZodObject<{
351
- task_id: z.ZodString;
352
- condition: z.ZodOptional<z.ZodEnum<{
353
- pass: "pass";
354
- }>>;
355
- }, z.core.$strip>>>;
356
- }, z.core.$strip>>>;
264
+ step_count: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
265
+ started_at: z.ZodOptional<z.ZodNullable<z.ZodString>>;
266
+ completed_at: z.ZodOptional<z.ZodNullable<z.ZodString>>;
357
267
  graph_status: z.ZodOptional<z.ZodEnum<{
358
268
  completed: "completed";
359
269
  failed: "failed";
@@ -776,7 +686,6 @@ export declare const SuggestedSimulationSchema: z.ZodObject<{
776
686
  description: z.ZodString;
777
687
  selected: z.ZodBoolean;
778
688
  simulation_id: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
779
- task_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
780
689
  status: z.ZodOptional<z.ZodNullable<z.ZodEnum<{
781
690
  queued: "queued";
782
691
  running: "running";
@@ -358,7 +358,6 @@ export declare const WidgetEventSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
358
358
  type: z.ZodLiteral<"chat/response">;
359
359
  request_id: z.ZodString;
360
360
  text: z.ZodString;
361
- task_id: z.ZodOptional<z.ZodString>;
362
361
  }, z.core.$strip>, z.ZodObject<{
363
362
  type: z.ZodLiteral<"chat/error">;
364
363
  request_id: z.ZodString;
@@ -843,7 +842,6 @@ export declare const widgetStream: import("@orpc/contract").ContractProcedureBui
843
842
  type: "chat/response";
844
843
  request_id: string;
845
844
  text: string;
846
- task_id?: string | undefined;
847
845
  } | {
848
846
  type: "chat/error";
849
847
  request_id: string;
@@ -874,7 +872,6 @@ export declare const widgetStream: import("@orpc/contract").ContractProcedureBui
874
872
  type: "chat/response";
875
873
  request_id: string;
876
874
  text: string;
877
- task_id?: string | undefined;
878
875
  } | {
879
876
  type: "chat/error";
880
877
  request_id: string;
@@ -1353,7 +1350,6 @@ export declare const widgetRoutes: {
1353
1350
  type: "chat/response";
1354
1351
  request_id: string;
1355
1352
  text: string;
1356
- task_id?: string | undefined;
1357
1353
  } | {
1358
1354
  type: "chat/error";
1359
1355
  request_id: string;
@@ -1384,7 +1380,6 @@ export declare const widgetRoutes: {
1384
1380
  type: "chat/response";
1385
1381
  request_id: string;
1386
1382
  text: string;
1387
- task_id?: string | undefined;
1388
1383
  } | {
1389
1384
  type: "chat/error";
1390
1385
  request_id: string;
@@ -386,7 +386,6 @@ export declare const sdk: {
386
386
  type: "chat/response";
387
387
  request_id: string;
388
388
  text: string;
389
- task_id?: string | undefined;
390
389
  } | {
391
390
  type: "chat/error";
392
391
  request_id: string;
@@ -417,7 +416,6 @@ export declare const sdk: {
417
416
  type: "chat/response";
418
417
  request_id: string;
419
418
  text: string;
420
- task_id?: string | undefined;
421
419
  } | {
422
420
  type: "chat/error";
423
421
  request_id: string;
@@ -6,8 +6,8 @@ import type { ChatMessage, InstructionType } from '../types';
6
6
  */
7
7
  export interface ChatSnapshot {
8
8
  messages: ChatMessage[];
9
- isTaskRunning: boolean;
10
- activeTaskId: string | null;
9
+ isSimulationRunning: boolean;
10
+ activeSimulationId: string | null;
11
11
  currentMode: InstructionType;
12
12
  isOpen: boolean;
13
13
  isMinimized: boolean;
@@ -25,8 +25,8 @@ type StoredMessage = Omit<ChatMessage, 'videoStream' | 'timestamp'> & {
25
25
  export interface MarketrixChatContext {
26
26
  chat_id: string | null;
27
27
  messages: StoredMessage[];
28
- isTaskRunning: boolean;
29
- activeTaskId: string | null;
28
+ isSimulationRunning: boolean;
29
+ activeSimulationId: string | null;
30
30
  currentMode: InstructionType;
31
31
  isOpen: boolean;
32
32
  isMinimized: boolean;
@@ -62,8 +62,8 @@ declare class StorageService {
62
62
  setChatId(chatId: string | null): void;
63
63
  getMessages(): StoredMessage[];
64
64
  setMessages(messages: StoredMessage[]): void;
65
- getChatState(): Pick<MarketrixChatContext, 'isTaskRunning' | 'activeTaskId' | 'currentMode' | 'isOpen' | 'isMinimized' | 'isLoading'>;
66
- setChatState(state: Partial<Pick<MarketrixChatContext, 'isTaskRunning' | 'activeTaskId' | 'currentMode' | 'isOpen' | 'isMinimized' | 'isLoading'>>): void;
65
+ getChatState(): Pick<MarketrixChatContext, 'isSimulationRunning' | 'activeSimulationId' | 'currentMode' | 'isOpen' | 'isMinimized' | 'isLoading'>;
66
+ setChatState(state: Partial<Pick<MarketrixChatContext, 'isSimulationRunning' | 'activeSimulationId' | 'currentMode' | 'isOpen' | 'isMinimized' | 'isLoading'>>): void;
67
67
  getConfig(): MarketrixConfig | null;
68
68
  setConfig(config: MarketrixConfig | null): void;
69
69
  clear(): void;
@@ -46,7 +46,7 @@ export interface ChatMessage {
46
46
  isPlaceholder?: boolean;
47
47
  placeholderState?: 'thinking' | 'waiting-for-user';
48
48
  parts?: MessagePart[];
49
- taskStatus?: 'ongoing' | 'done' | 'failed' | 'stopped';
49
+ simulationStatus?: 'ongoing' | 'done' | 'failed' | 'stopped';
50
50
  }
51
51
  export interface MessagePart {
52
52
  type: 'text' | 'progress';
@@ -65,8 +65,8 @@ export interface WidgetState {
65
65
  currentMode: InstructionType;
66
66
  agentAvailable: boolean;
67
67
  error?: string;
68
- activeTaskId: string | null;
69
- isTaskRunning: boolean;
68
+ activeSimulationId: string | null;
69
+ isSimulationRunning: boolean;
70
70
  activeView: WidgetView;
71
71
  }
72
72
  export interface SendMessageRequest {
@@ -18,7 +18,7 @@ export declare function addThinkingMarker(content: string): string;
18
18
  */
19
19
  export interface FindMessageOptions {
20
20
  messages: ChatMessage[];
21
- isTaskRunning: boolean;
21
+ isSimulationRunning: boolean;
22
22
  currentMode: InstructionType;
23
23
  requireContent?: boolean;
24
24
  }
@@ -47,7 +47,7 @@ export declare const WAIT_FOR_USER_TOOLS: Set<string>;
47
47
  export declare function addProgressLine(message: ChatMessage, toolName: string, explanation: string): ChatMessage;
48
48
  export declare function markProgressLineComplete(message: ChatMessage, toolName?: string): ChatMessage;
49
49
  export declare function markProgressLineFailed(message: ChatMessage, toolName: string, error: string): ChatMessage;
50
- export declare function updateThinkingMarker(message: ChatMessage, isTaskRunning: boolean, currentMode: 'show' | 'tell' | 'do', isWaitingForUser?: boolean): ChatMessage;
50
+ export declare function updateThinkingMarker(message: ChatMessage, isSimulationRunning: boolean, currentMode: 'show' | 'tell' | 'do', isWaitingForUser?: boolean): ChatMessage;
51
51
  /**
52
52
  * Tool Name Mapping — derived from BROWSER_TOOLS (single source of truth).
53
53
  * Provides friendly display names for technical tool names.