@marketrix.ai/widget 3.8.117 → 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.
- package/dist/src/components/chat/SimulationStatusIcon.d.ts +6 -0
- package/dist/src/components/navigation/MessengerShell.d.ts +1 -1
- package/dist/src/components/views/ChatView.d.ts +1 -1
- package/dist/src/context/ConversationContext.d.ts +9 -9
- package/dist/src/context/sseReducer.d.ts +4 -7
- package/dist/src/hooks/useWidget.d.ts +2 -2
- package/dist/src/sdk/contract.d.ts +2 -4
- package/dist/src/sdk/contracts/common.d.ts +1 -12
- package/dist/src/sdk/contracts/entities.d.ts +132 -109
- package/dist/src/sdk/contracts/widget.d.ts +6 -11
- package/dist/src/sdk/index.d.ts +2 -4
- package/dist/src/services/ChatService.d.ts +2 -2
- package/dist/src/services/StorageService.d.ts +4 -4
- package/dist/src/types/index.d.ts +3 -3
- package/dist/src/utils/chat.d.ts +2 -2
- package/dist/widget.mjs +62 -62
- package/dist/widget.mjs.map +1 -1
- package/package.json +7 -7
- package/dist/src/components/chat/TaskStatusIcon.d.ts +0 -6
|
@@ -6,7 +6,7 @@ export interface MessengerShellProps {
|
|
|
6
6
|
isMinimized: boolean;
|
|
7
7
|
messages: ChatMessage[];
|
|
8
8
|
currentMode: InstructionType;
|
|
9
|
-
|
|
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
|
-
|
|
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
|
|
16
|
-
|
|
17
|
-
|
|
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
|
|
30
|
+
export interface SimulationActions {
|
|
31
31
|
setTaskState: (payload: {
|
|
32
|
-
|
|
33
|
-
|
|
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:
|
|
41
|
-
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?:
|
|
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
|
|
14
|
-
|
|
15
|
-
|
|
13
|
+
export interface SseSimulationState {
|
|
14
|
+
activeSimulationId: string | null;
|
|
15
|
+
isSimulationRunning: boolean;
|
|
16
16
|
}
|
|
17
17
|
export interface SseState {
|
|
18
18
|
messages: ChatMessage[];
|
|
19
|
-
task:
|
|
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
|
-
|
|
17
|
-
|
|
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,14 +381,13 @@ 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;
|
|
388
387
|
error: string;
|
|
389
388
|
} | {
|
|
390
389
|
type: "task/status";
|
|
391
|
-
status: "
|
|
390
|
+
status: "running" | "has_question" | "completed" | "failed" | "stopped";
|
|
392
391
|
message?: string | undefined;
|
|
393
392
|
task_id?: string | undefined;
|
|
394
393
|
timestamp?: number | undefined;
|
|
@@ -412,14 +411,13 @@ 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;
|
|
419
417
|
error: string;
|
|
420
418
|
} | {
|
|
421
419
|
type: "task/status";
|
|
422
|
-
status: "
|
|
420
|
+
status: "running" | "has_question" | "completed" | "failed" | "stopped";
|
|
423
421
|
message?: string | undefined;
|
|
424
422
|
task_id?: string | undefined;
|
|
425
423
|
timestamp?: number | undefined;
|
|
@@ -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 (
|
|
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<{
|
|
@@ -16,20 +16,13 @@ export declare const KnowledgeSourceSchema: z.ZodEnum<{
|
|
|
16
16
|
research: "research";
|
|
17
17
|
}>;
|
|
18
18
|
export type KnowledgeSource = z.infer<typeof KnowledgeSourceSchema>;
|
|
19
|
-
export declare const QAFlowStatusSchema: z.ZodEnum<{
|
|
20
|
-
pending: "pending";
|
|
21
|
-
processing: "processing";
|
|
22
|
-
waiting_review: "waiting_review";
|
|
23
|
-
completed: "completed";
|
|
24
|
-
failed: "failed";
|
|
25
|
-
}>;
|
|
26
19
|
export declare const SimulationStatusSchema: z.ZodEnum<{
|
|
27
|
-
completed: "completed";
|
|
28
|
-
failed: "failed";
|
|
29
20
|
queued: "queued";
|
|
30
21
|
running: "running";
|
|
31
22
|
creating_knowledge: "creating_knowledge";
|
|
32
23
|
has_question: "has_question";
|
|
24
|
+
completed: "completed";
|
|
25
|
+
failed: "failed";
|
|
33
26
|
stopped: "stopped";
|
|
34
27
|
}>;
|
|
35
28
|
export type SimulationStatus = z.infer<typeof SimulationStatusSchema>;
|
|
@@ -39,9 +32,9 @@ export type SimulationStatus = z.infer<typeof SimulationStatusSchema>;
|
|
|
39
32
|
* `simulation/graph-updated` app event.
|
|
40
33
|
*/
|
|
41
34
|
export declare const GraphStatusSchema: z.ZodEnum<{
|
|
42
|
-
pending: "pending";
|
|
43
35
|
completed: "completed";
|
|
44
36
|
failed: "failed";
|
|
37
|
+
pending: "pending";
|
|
45
38
|
generating: "generating";
|
|
46
39
|
}>;
|
|
47
40
|
export declare const ApplicationTypeSchema: z.ZodEnum<{
|
|
@@ -172,74 +165,68 @@ export declare const KnowledgeEntitySchema: z.ZodObject<{
|
|
|
172
165
|
}, z.core.$strip>;
|
|
173
166
|
export type KnowledgeData = z.infer<typeof KnowledgeEntitySchema>;
|
|
174
167
|
/**
|
|
175
|
-
*
|
|
176
|
-
*
|
|
168
|
+
* Device viewport — the only device dimension (Chrome-only). A simulation runs at exactly
|
|
169
|
+
* one viewport; selecting N viewports fans out into N simulations (one per viewport).
|
|
170
|
+
* Defined here (the widget/root import closure) so SSE + simulation + qa contracts can share it.
|
|
177
171
|
*/
|
|
178
|
-
export declare const
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
172
|
+
export declare const ViewportNameSchema: z.ZodEnum<{
|
|
173
|
+
desktop: "desktop";
|
|
174
|
+
tablet: "tablet";
|
|
175
|
+
mobile: "mobile";
|
|
182
176
|
}>;
|
|
183
|
-
export type
|
|
184
|
-
export declare const
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
low_priority: z.ZodNumber;
|
|
202
|
-
estimated_time_minutes: z.ZodNumber;
|
|
203
|
-
}, z.core.$strip>;
|
|
204
|
-
}, z.core.$strip>;
|
|
205
|
-
export declare const TaskDependencySchema: z.ZodObject<{
|
|
206
|
-
task_id: z.ZodString;
|
|
207
|
-
condition: z.ZodOptional<z.ZodEnum<{
|
|
208
|
-
pass: "pass";
|
|
177
|
+
export type ViewportName = z.infer<typeof ViewportNameSchema>;
|
|
178
|
+
export declare const VIEWPORT_DIMENSIONS: Record<ViewportName, {
|
|
179
|
+
width: number;
|
|
180
|
+
height: number;
|
|
181
|
+
}>;
|
|
182
|
+
export declare const SentimentSchema: z.ZodEnum<{
|
|
183
|
+
positive: "positive";
|
|
184
|
+
neutral: "neutral";
|
|
185
|
+
negative: "negative";
|
|
186
|
+
}>;
|
|
187
|
+
export declare const StepReactionSchema: z.ZodObject<{
|
|
188
|
+
step_index: z.ZodNumber;
|
|
189
|
+
screenshot_ref: z.ZodNullable<z.ZodString>;
|
|
190
|
+
reaction: z.ZodString;
|
|
191
|
+
sentiment: z.ZodNullable<z.ZodEnum<{
|
|
192
|
+
positive: "positive";
|
|
193
|
+
neutral: "neutral";
|
|
194
|
+
negative: "negative";
|
|
209
195
|
}>>;
|
|
210
196
|
}, z.core.$strip>;
|
|
211
|
-
export
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
197
|
+
export declare const PersonaSimReactionEntitySchema: z.ZodObject<{
|
|
198
|
+
id: z.ZodNumber;
|
|
199
|
+
run_id: z.ZodNullable<z.ZodNumber>;
|
|
200
|
+
persona_id: z.ZodNullable<z.ZodNumber>;
|
|
201
|
+
user_index: z.ZodNullable<z.ZodNumber>;
|
|
202
|
+
simulation_id: z.ZodNullable<z.ZodNumber>;
|
|
203
|
+
study_variant_id: z.ZodNullable<z.ZodNumber>;
|
|
204
|
+
journey_reaction: z.ZodNullable<z.ZodString>;
|
|
205
|
+
journey_sentiment: z.ZodNullable<z.ZodEnum<{
|
|
206
|
+
positive: "positive";
|
|
207
|
+
neutral: "neutral";
|
|
208
|
+
negative: "negative";
|
|
209
|
+
}>>;
|
|
220
210
|
status: z.ZodEnum<{
|
|
221
|
-
|
|
211
|
+
completed: "completed";
|
|
222
212
|
failed: "failed";
|
|
223
|
-
|
|
224
|
-
has_question: "has_question";
|
|
225
|
-
stopped: "stopped";
|
|
226
|
-
passed: "passed";
|
|
227
|
-
skipped: "skipped";
|
|
213
|
+
pending: "pending";
|
|
228
214
|
}>;
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
condition: z.ZodOptional<z.ZodEnum<{
|
|
238
|
-
pass: "pass";
|
|
215
|
+
step_reactions: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
216
|
+
step_index: z.ZodNumber;
|
|
217
|
+
screenshot_ref: z.ZodNullable<z.ZodString>;
|
|
218
|
+
reaction: z.ZodString;
|
|
219
|
+
sentiment: z.ZodNullable<z.ZodEnum<{
|
|
220
|
+
positive: "positive";
|
|
221
|
+
neutral: "neutral";
|
|
222
|
+
negative: "negative";
|
|
239
223
|
}>>;
|
|
240
224
|
}, z.core.$strip>>>;
|
|
225
|
+
question_answers: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
226
|
+
study_question_id: z.ZodNumber;
|
|
227
|
+
answer: z.ZodString;
|
|
228
|
+
}, z.core.$strip>>>;
|
|
241
229
|
}, z.core.$strip>;
|
|
242
|
-
export type SimulationTaskEntry = z.infer<typeof SimulationTaskEntrySchema>;
|
|
243
230
|
export declare const SimulationEntitySchema: z.ZodObject<{
|
|
244
231
|
id: z.ZodOptional<z.ZodNumber>;
|
|
245
232
|
created_at: z.ZodOptional<z.ZodCoercedDate<unknown>>;
|
|
@@ -248,17 +235,25 @@ export declare const SimulationEntitySchema: z.ZodObject<{
|
|
|
248
235
|
job_id: z.ZodString;
|
|
249
236
|
browser_session_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
250
237
|
status: z.ZodEnum<{
|
|
251
|
-
completed: "completed";
|
|
252
|
-
failed: "failed";
|
|
253
238
|
queued: "queued";
|
|
254
239
|
running: "running";
|
|
255
240
|
creating_knowledge: "creating_knowledge";
|
|
256
241
|
has_question: "has_question";
|
|
242
|
+
completed: "completed";
|
|
243
|
+
failed: "failed";
|
|
257
244
|
stopped: "stopped";
|
|
258
245
|
}>;
|
|
259
246
|
status_message: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
260
247
|
path: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
261
248
|
instructions: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
249
|
+
name: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
250
|
+
type: z.ZodOptional<z.ZodNullable<z.ZodEnum<{
|
|
251
|
+
direct: "direct";
|
|
252
|
+
uxr: "uxr";
|
|
253
|
+
survey: "survey";
|
|
254
|
+
ab: "ab";
|
|
255
|
+
qa: "qa";
|
|
256
|
+
}>>>;
|
|
262
257
|
pinned: z.ZodOptional<z.ZodBoolean>;
|
|
263
258
|
source: z.ZodOptional<z.ZodEnum<{
|
|
264
259
|
direct: "direct";
|
|
@@ -266,44 +261,63 @@ export declare const SimulationEntitySchema: z.ZodObject<{
|
|
|
266
261
|
}>>;
|
|
267
262
|
graph_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
268
263
|
source_metadata: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
instructions: z.ZodString;
|
|
273
|
-
status: z.ZodEnum<{
|
|
274
|
-
pending: "pending";
|
|
275
|
-
failed: "failed";
|
|
276
|
-
running: "running";
|
|
277
|
-
has_question: "has_question";
|
|
278
|
-
stopped: "stopped";
|
|
279
|
-
passed: "passed";
|
|
280
|
-
skipped: "skipped";
|
|
281
|
-
}>;
|
|
282
|
-
error_message: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
283
|
-
started_at: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
284
|
-
completed_at: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
285
|
-
order_index: z.ZodDefault<z.ZodNumber>;
|
|
286
|
-
tab_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
287
|
-
step_count: z.ZodDefault<z.ZodNumber>;
|
|
288
|
-
blocked_by: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
289
|
-
task_id: z.ZodString;
|
|
290
|
-
condition: z.ZodOptional<z.ZodEnum<{
|
|
291
|
-
pass: "pass";
|
|
292
|
-
}>>;
|
|
293
|
-
}, z.core.$strip>>>;
|
|
294
|
-
}, 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>>;
|
|
295
267
|
graph_status: z.ZodOptional<z.ZodEnum<{
|
|
296
|
-
pending: "pending";
|
|
297
268
|
completed: "completed";
|
|
298
269
|
failed: "failed";
|
|
270
|
+
pending: "pending";
|
|
299
271
|
generating: "generating";
|
|
300
272
|
}>>;
|
|
301
273
|
graph_steps_processed: z.ZodOptional<z.ZodNumber>;
|
|
302
274
|
graph_steps_total: z.ZodOptional<z.ZodNumber>;
|
|
303
275
|
graph_error: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
304
276
|
created_by_user_id: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
305
|
-
persona_id: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
306
277
|
has_question: z.ZodOptional<z.ZodBoolean>;
|
|
278
|
+
participants: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
279
|
+
persona_id: z.ZodNumber;
|
|
280
|
+
user_count: z.ZodNumber;
|
|
281
|
+
}, z.core.$strip>>>;
|
|
282
|
+
reactions: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
283
|
+
id: z.ZodNumber;
|
|
284
|
+
run_id: z.ZodNullable<z.ZodNumber>;
|
|
285
|
+
persona_id: z.ZodNullable<z.ZodNumber>;
|
|
286
|
+
user_index: z.ZodNullable<z.ZodNumber>;
|
|
287
|
+
simulation_id: z.ZodNullable<z.ZodNumber>;
|
|
288
|
+
study_variant_id: z.ZodNullable<z.ZodNumber>;
|
|
289
|
+
journey_reaction: z.ZodNullable<z.ZodString>;
|
|
290
|
+
journey_sentiment: z.ZodNullable<z.ZodEnum<{
|
|
291
|
+
positive: "positive";
|
|
292
|
+
neutral: "neutral";
|
|
293
|
+
negative: "negative";
|
|
294
|
+
}>>;
|
|
295
|
+
status: z.ZodEnum<{
|
|
296
|
+
completed: "completed";
|
|
297
|
+
failed: "failed";
|
|
298
|
+
pending: "pending";
|
|
299
|
+
}>;
|
|
300
|
+
step_reactions: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
301
|
+
step_index: z.ZodNumber;
|
|
302
|
+
screenshot_ref: z.ZodNullable<z.ZodString>;
|
|
303
|
+
reaction: z.ZodString;
|
|
304
|
+
sentiment: z.ZodNullable<z.ZodEnum<{
|
|
305
|
+
positive: "positive";
|
|
306
|
+
neutral: "neutral";
|
|
307
|
+
negative: "negative";
|
|
308
|
+
}>>;
|
|
309
|
+
}, z.core.$strip>>>;
|
|
310
|
+
question_answers: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
311
|
+
study_question_id: z.ZodNumber;
|
|
312
|
+
answer: z.ZodString;
|
|
313
|
+
}, z.core.$strip>>>;
|
|
314
|
+
}, z.core.$strip>>>;
|
|
315
|
+
driver_persona_id: z.ZodDefault<z.ZodNullable<z.ZodNumber>>;
|
|
316
|
+
viewport: z.ZodDefault<z.ZodEnum<{
|
|
317
|
+
desktop: "desktop";
|
|
318
|
+
tablet: "tablet";
|
|
319
|
+
mobile: "mobile";
|
|
320
|
+
}>>;
|
|
307
321
|
}, z.core.$strip>;
|
|
308
322
|
export type SimulationData = z.infer<typeof SimulationEntitySchema>;
|
|
309
323
|
export declare const ApplicationEntitySchema: z.ZodObject<{
|
|
@@ -481,21 +495,31 @@ export declare const StateTriggerEntitySchema: z.ZodObject<{
|
|
|
481
495
|
}, z.core.$strip>;
|
|
482
496
|
export type StateTriggerData = z.infer<typeof StateTriggerEntitySchema>;
|
|
483
497
|
/**
|
|
484
|
-
* QA run
|
|
485
|
-
*
|
|
486
|
-
*
|
|
487
|
-
*
|
|
488
|
-
* Canonical wire vocabulary; `deriveQARunStats` returns `'running'` directly.
|
|
489
|
-
* `'pending'` is the empty-task initial state.
|
|
498
|
+
* QA run status — first-class TEXT+CHECK column on qa_run (no longer derived).
|
|
499
|
+
* `synthesizing` = all sims terminal but per-journey verdicts still completing (QA has no
|
|
500
|
+
* run-level rollup like studies). Canonical wire vocabulary.
|
|
490
501
|
*/
|
|
491
502
|
export declare const QARunStatusSchema: z.ZodEnum<{
|
|
492
|
-
|
|
503
|
+
running: "running";
|
|
493
504
|
completed: "completed";
|
|
494
505
|
failed: "failed";
|
|
495
|
-
running: "running";
|
|
496
506
|
stopped: "stopped";
|
|
507
|
+
synthesizing: "synthesizing";
|
|
497
508
|
}>;
|
|
498
509
|
export type QARunStatus = z.infer<typeof QARunStatusSchema>;
|
|
510
|
+
/** QA verdict per (run, persona, journey, viewport) — DATA-derived by the api from qa_verdict; NOT a wire status. */
|
|
511
|
+
export declare const QARunVerdictStatusSchema: z.ZodEnum<{
|
|
512
|
+
failed: "failed";
|
|
513
|
+
passed: "passed";
|
|
514
|
+
indecisive: "indecisive";
|
|
515
|
+
}>;
|
|
516
|
+
export type QARunVerdictStatus = z.infer<typeof QARunVerdictStatusSchema>;
|
|
517
|
+
/** A human resolution of an indecisive verdict — resolves to a decision, so no `indecisive`. */
|
|
518
|
+
export declare const HumanRulingSchema: z.ZodEnum<{
|
|
519
|
+
failed: "failed";
|
|
520
|
+
passed: "passed";
|
|
521
|
+
}>;
|
|
522
|
+
export type HumanRuling = z.infer<typeof HumanRulingSchema>;
|
|
499
523
|
export declare const ActionLogTypeSchema: z.ZodEnum<{
|
|
500
524
|
user_login: "user_login";
|
|
501
525
|
url_visit: "url_visit";
|
|
@@ -662,14 +686,13 @@ export declare const SuggestedSimulationSchema: z.ZodObject<{
|
|
|
662
686
|
description: z.ZodString;
|
|
663
687
|
selected: z.ZodBoolean;
|
|
664
688
|
simulation_id: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
665
|
-
task_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
666
689
|
status: z.ZodOptional<z.ZodNullable<z.ZodEnum<{
|
|
667
|
-
completed: "completed";
|
|
668
|
-
failed: "failed";
|
|
669
690
|
queued: "queued";
|
|
670
691
|
running: "running";
|
|
671
692
|
creating_knowledge: "creating_knowledge";
|
|
672
693
|
has_question: "has_question";
|
|
694
|
+
completed: "completed";
|
|
695
|
+
failed: "failed";
|
|
673
696
|
stopped: "stopped";
|
|
674
697
|
}>>>;
|
|
675
698
|
}, z.core.$strip>;
|
|
@@ -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;
|
|
@@ -366,10 +365,10 @@ export declare const WidgetEventSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
366
365
|
}, z.core.$strip>, z.ZodObject<{
|
|
367
366
|
type: z.ZodLiteral<"task/status">;
|
|
368
367
|
status: z.ZodEnum<{
|
|
369
|
-
completed: "completed";
|
|
370
|
-
failed: "failed";
|
|
371
368
|
running: "running";
|
|
372
369
|
has_question: "has_question";
|
|
370
|
+
completed: "completed";
|
|
371
|
+
failed: "failed";
|
|
373
372
|
stopped: "stopped";
|
|
374
373
|
}>;
|
|
375
374
|
message: z.ZodOptional<z.ZodString>;
|
|
@@ -843,14 +842,13 @@ 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;
|
|
850
848
|
error: string;
|
|
851
849
|
} | {
|
|
852
850
|
type: "task/status";
|
|
853
|
-
status: "
|
|
851
|
+
status: "running" | "has_question" | "completed" | "failed" | "stopped";
|
|
854
852
|
message?: string | undefined;
|
|
855
853
|
task_id?: string | undefined;
|
|
856
854
|
timestamp?: number | undefined;
|
|
@@ -874,14 +872,13 @@ 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;
|
|
881
878
|
error: string;
|
|
882
879
|
} | {
|
|
883
880
|
type: "task/status";
|
|
884
|
-
status: "
|
|
881
|
+
status: "running" | "has_question" | "completed" | "failed" | "stopped";
|
|
885
882
|
message?: string | undefined;
|
|
886
883
|
task_id?: string | undefined;
|
|
887
884
|
timestamp?: number | undefined;
|
|
@@ -1353,14 +1350,13 @@ 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;
|
|
1360
1356
|
error: string;
|
|
1361
1357
|
} | {
|
|
1362
1358
|
type: "task/status";
|
|
1363
|
-
status: "
|
|
1359
|
+
status: "running" | "has_question" | "completed" | "failed" | "stopped";
|
|
1364
1360
|
message?: string | undefined;
|
|
1365
1361
|
task_id?: string | undefined;
|
|
1366
1362
|
timestamp?: number | undefined;
|
|
@@ -1384,14 +1380,13 @@ 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;
|
|
1391
1386
|
error: string;
|
|
1392
1387
|
} | {
|
|
1393
1388
|
type: "task/status";
|
|
1394
|
-
status: "
|
|
1389
|
+
status: "running" | "has_question" | "completed" | "failed" | "stopped";
|
|
1395
1390
|
message?: string | undefined;
|
|
1396
1391
|
task_id?: string | undefined;
|
|
1397
1392
|
timestamp?: number | undefined;
|
package/dist/src/sdk/index.d.ts
CHANGED
|
@@ -386,14 +386,13 @@ 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;
|
|
393
392
|
error: string;
|
|
394
393
|
} | {
|
|
395
394
|
type: "task/status";
|
|
396
|
-
status: "
|
|
395
|
+
status: "running" | "has_question" | "completed" | "failed" | "stopped";
|
|
397
396
|
message?: string | undefined;
|
|
398
397
|
task_id?: string | undefined;
|
|
399
398
|
timestamp?: number | undefined;
|
|
@@ -417,14 +416,13 @@ 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;
|
|
424
422
|
error: string;
|
|
425
423
|
} | {
|
|
426
424
|
type: "task/status";
|
|
427
|
-
status: "
|
|
425
|
+
status: "running" | "has_question" | "completed" | "failed" | "stopped";
|
|
428
426
|
message?: string | undefined;
|
|
429
427
|
task_id?: string | undefined;
|
|
430
428
|
timestamp?: number | undefined;
|
|
@@ -6,8 +6,8 @@ import type { ChatMessage, InstructionType } from '../types';
|
|
|
6
6
|
*/
|
|
7
7
|
export interface ChatSnapshot {
|
|
8
8
|
messages: ChatMessage[];
|
|
9
|
-
|
|
10
|
-
|
|
9
|
+
isSimulationRunning: boolean;
|
|
10
|
+
activeSimulationId: string | null;
|
|
11
11
|
currentMode: InstructionType;
|
|
12
12
|
isOpen: boolean;
|
|
13
13
|
isMinimized: boolean;
|