@marketrix.ai/widget 3.8.134 → 3.8.137
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 → ChatContext.d.ts} +16 -16
- package/dist/src/context/WidgetProviders.d.ts +2 -2
- package/dist/src/context/sseReducer.d.ts +7 -10
- package/dist/src/hooks/useWidget.d.ts +4 -4
- package/dist/src/index.d.ts +2 -2
- package/dist/src/sdk/contract.d.ts +16 -18
- package/dist/src/sdk/contracts/activityLog.d.ts +32 -32
- package/dist/src/sdk/contracts/application.d.ts +2 -2
- package/dist/src/sdk/contracts/common.d.ts +1 -12
- package/dist/src/sdk/contracts/entities.d.ts +24 -130
- package/dist/src/sdk/contracts/widget.d.ts +21 -26
- package/dist/src/sdk/index.d.ts +16 -18
- package/dist/src/services/ApiService.d.ts +2 -2
- package/dist/src/services/{ToolService.d.ts → BrowserToolService.d.ts} +4 -4
- package/dist/src/services/ChatService.d.ts +2 -2
- package/dist/src/services/{SessionManager.d.ts → ChatSessionManager.d.ts} +3 -3
- package/dist/src/services/DomService.d.ts +1 -1
- package/dist/src/services/{SessionRecorder.d.ts → RrwebSessionRecorder.d.ts} +3 -3
- package/dist/src/services/ShowModeService.d.ts +1 -1
- package/dist/src/services/StorageService.d.ts +5 -5
- package/dist/src/services/WidgetService.d.ts +1 -1
- package/dist/src/types/browserTools.d.ts +1 -1
- package/dist/src/types/index.d.ts +6 -6
- package/dist/src/utils/chat.d.ts +7 -7
- 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
|
@@ -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,15 +194,7 @@ export declare const StepReactionSchema: z.ZodObject<{
|
|
|
253
194
|
negative: "negative";
|
|
254
195
|
}>>;
|
|
255
196
|
}, z.core.$strip>;
|
|
256
|
-
export declare const
|
|
257
|
-
reaction: z.ZodString;
|
|
258
|
-
sentiment: z.ZodEnum<{
|
|
259
|
-
positive: "positive";
|
|
260
|
-
neutral: "neutral";
|
|
261
|
-
negative: "negative";
|
|
262
|
-
}>;
|
|
263
|
-
}, z.core.$strip>;
|
|
264
|
-
export declare const PersonaSimReactionEntitySchema: z.ZodObject<{
|
|
197
|
+
export declare const SimPersonaReactionEntitySchema: z.ZodObject<{
|
|
265
198
|
id: z.ZodNumber;
|
|
266
199
|
run_id: z.ZodNullable<z.ZodNumber>;
|
|
267
200
|
persona_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
|
-
|
|
332
|
-
|
|
333
|
-
|
|
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";
|
|
@@ -594,7 +504,7 @@ export declare const QARunStatusSchema: z.ZodEnum<{
|
|
|
594
504
|
completed: "completed";
|
|
595
505
|
failed: "failed";
|
|
596
506
|
stopped: "stopped";
|
|
597
|
-
|
|
507
|
+
finalizing: "finalizing";
|
|
598
508
|
}>;
|
|
599
509
|
export type QARunStatus = z.infer<typeof QARunStatusSchema>;
|
|
600
510
|
/** QA verdict per (run, persona, journey, viewport) — DATA-derived by the api from qa_verdict; NOT a wire status. */
|
|
@@ -610,7 +520,7 @@ export declare const HumanRulingSchema: z.ZodEnum<{
|
|
|
610
520
|
passed: "passed";
|
|
611
521
|
}>;
|
|
612
522
|
export type HumanRuling = z.infer<typeof HumanRulingSchema>;
|
|
613
|
-
export declare const
|
|
523
|
+
export declare const ActivityLogTypeSchema: z.ZodEnum<{
|
|
614
524
|
user_login: "user_login";
|
|
615
525
|
url_visit: "url_visit";
|
|
616
526
|
update_workspace: "update_workspace";
|
|
@@ -632,14 +542,14 @@ export declare const ActionLogTypeSchema: z.ZodEnum<{
|
|
|
632
542
|
widget_question: "widget_question";
|
|
633
543
|
qa_run_started: "qa_run_started";
|
|
634
544
|
start_simulation: "start_simulation";
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
545
|
+
create_workflow: "create_workflow";
|
|
546
|
+
update_workflow: "update_workflow";
|
|
547
|
+
delete_workflow: "delete_workflow";
|
|
548
|
+
toggle_workflow: "toggle_workflow";
|
|
639
549
|
slack_command: "slack_command";
|
|
640
550
|
}>;
|
|
641
|
-
export type
|
|
642
|
-
export declare const
|
|
551
|
+
export type ActivityLogType = z.infer<typeof ActivityLogTypeSchema>;
|
|
552
|
+
export declare const ActivityLogMetadataSchema: z.ZodObject<{
|
|
643
553
|
details: z.ZodOptional<z.ZodString>;
|
|
644
554
|
id: z.ZodOptional<z.ZodNumber>;
|
|
645
555
|
type: z.ZodOptional<z.ZodString>;
|
|
@@ -657,8 +567,8 @@ export declare const ActionLogMetadataSchema: z.ZodObject<{
|
|
|
657
567
|
widget_type: z.ZodOptional<z.ZodString>;
|
|
658
568
|
created_by: z.ZodOptional<z.ZodNumber>;
|
|
659
569
|
}, z.core.$loose>;
|
|
660
|
-
export type
|
|
661
|
-
export declare const
|
|
570
|
+
export type ActivityLogMetadataData = z.infer<typeof ActivityLogMetadataSchema>;
|
|
571
|
+
export declare const ActivityLogEntitySchema: z.ZodObject<{
|
|
662
572
|
id: z.ZodOptional<z.ZodNumber>;
|
|
663
573
|
created_at: z.ZodOptional<z.ZodCoercedDate<unknown>>;
|
|
664
574
|
updated_at: z.ZodOptional<z.ZodCoercedDate<unknown>>;
|
|
@@ -686,10 +596,10 @@ export declare const ActionLogEntitySchema: z.ZodObject<{
|
|
|
686
596
|
widget_question: "widget_question";
|
|
687
597
|
qa_run_started: "qa_run_started";
|
|
688
598
|
start_simulation: "start_simulation";
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
599
|
+
create_workflow: "create_workflow";
|
|
600
|
+
update_workflow: "update_workflow";
|
|
601
|
+
delete_workflow: "delete_workflow";
|
|
602
|
+
toggle_workflow: "toggle_workflow";
|
|
693
603
|
slack_command: "slack_command";
|
|
694
604
|
}>;
|
|
695
605
|
metadata: z.ZodOptional<z.ZodObject<{
|
|
@@ -711,8 +621,8 @@ export declare const ActionLogEntitySchema: z.ZodObject<{
|
|
|
711
621
|
created_by: z.ZodOptional<z.ZodNumber>;
|
|
712
622
|
}, z.core.$loose>>;
|
|
713
623
|
}, z.core.$strip>;
|
|
714
|
-
export type
|
|
715
|
-
export declare const
|
|
624
|
+
export type ActivityLogData = z.infer<typeof ActivityLogEntitySchema>;
|
|
625
|
+
export declare const ActivityLogCreateSchema: z.ZodObject<{
|
|
716
626
|
id: z.ZodOptional<z.ZodOptional<z.ZodNumber>>;
|
|
717
627
|
created_at: z.ZodOptional<z.ZodOptional<z.ZodCoercedDate<unknown>>>;
|
|
718
628
|
updated_at: z.ZodOptional<z.ZodOptional<z.ZodCoercedDate<unknown>>>;
|
|
@@ -758,10 +668,10 @@ export declare const ActionLogCreateSchema: z.ZodObject<{
|
|
|
758
668
|
widget_question: "widget_question";
|
|
759
669
|
qa_run_started: "qa_run_started";
|
|
760
670
|
start_simulation: "start_simulation";
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
671
|
+
create_workflow: "create_workflow";
|
|
672
|
+
update_workflow: "update_workflow";
|
|
673
|
+
delete_workflow: "delete_workflow";
|
|
674
|
+
toggle_workflow: "toggle_workflow";
|
|
765
675
|
slack_command: "slack_command";
|
|
766
676
|
}>;
|
|
767
677
|
}, z.core.$strip>;
|
|
@@ -772,19 +682,3 @@ export declare const UserQuotaSchema: z.ZodObject<{
|
|
|
772
682
|
remaining: z.ZodNumber;
|
|
773
683
|
}, z.core.$strip>;
|
|
774
684
|
export type UserQuotaData = z.infer<typeof UserQuotaSchema>;
|
|
775
|
-
export declare const SuggestedSimulationSchema: z.ZodObject<{
|
|
776
|
-
description: z.ZodString;
|
|
777
|
-
selected: z.ZodBoolean;
|
|
778
|
-
simulation_id: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
779
|
-
task_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
780
|
-
status: z.ZodOptional<z.ZodNullable<z.ZodEnum<{
|
|
781
|
-
queued: "queued";
|
|
782
|
-
running: "running";
|
|
783
|
-
creating_knowledge: "creating_knowledge";
|
|
784
|
-
has_question: "has_question";
|
|
785
|
-
completed: "completed";
|
|
786
|
-
failed: "failed";
|
|
787
|
-
stopped: "stopped";
|
|
788
|
-
}>>>;
|
|
789
|
-
}, z.core.$strip>;
|
|
790
|
-
export type SuggestedSimulation = z.infer<typeof SuggestedSimulationSchema>;
|
|
@@ -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;
|
|
@@ -377,8 +376,8 @@ export declare const WidgetEventSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
377
376
|
timestamp: z.ZodOptional<z.ZodNumber>;
|
|
378
377
|
}, z.core.$strip>, z.ZodObject<{
|
|
379
378
|
type: z.ZodLiteral<"tool/call">;
|
|
380
|
-
|
|
381
|
-
|
|
379
|
+
tool_call_id: z.ZodString;
|
|
380
|
+
browser_tool: z.ZodString;
|
|
382
381
|
args: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
383
382
|
mode: z.ZodOptional<z.ZodEnum<{
|
|
384
383
|
show: "show";
|
|
@@ -406,7 +405,7 @@ export declare const WidgetCommandSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
406
405
|
task_id: z.ZodOptional<z.ZodString>;
|
|
407
406
|
}, z.core.$strip>, z.ZodObject<{
|
|
408
407
|
type: z.ZodLiteral<"tool/response">;
|
|
409
|
-
|
|
408
|
+
tool_call_id: z.ZodString;
|
|
410
409
|
success: z.ZodBoolean;
|
|
411
410
|
data: z.ZodOptional<z.ZodString>;
|
|
412
411
|
error: z.ZodOptional<z.ZodString>;
|
|
@@ -415,7 +414,7 @@ export declare const WidgetCommandSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
415
414
|
type: z.ZodLiteral<"ping">;
|
|
416
415
|
}, z.core.$strip>, z.ZodObject<{
|
|
417
416
|
type: z.ZodLiteral<"rrweb/metadata">;
|
|
418
|
-
|
|
417
|
+
rrweb_session_id: z.ZodString;
|
|
419
418
|
chat_id: z.ZodString;
|
|
420
419
|
application_id: z.ZodNumber;
|
|
421
420
|
url: z.ZodOptional<z.ZodString>;
|
|
@@ -427,7 +426,7 @@ export declare const WidgetCommandSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
427
426
|
}, z.core.$strip>>;
|
|
428
427
|
}, z.core.$strip>, z.ZodObject<{
|
|
429
428
|
type: z.ZodLiteral<"rrweb/events">;
|
|
430
|
-
|
|
429
|
+
rrweb_session_id: z.ZodString;
|
|
431
430
|
events: z.ZodArray<z.ZodUnknown>;
|
|
432
431
|
}, z.core.$strip>], "type">;
|
|
433
432
|
export type WidgetCommand = z.infer<typeof WidgetCommandSchema>;
|
|
@@ -639,7 +638,7 @@ export declare const widgetSearch: import("@orpc/contract").ContractProcedureBui
|
|
|
639
638
|
limit: z.ZodNumber;
|
|
640
639
|
offset: z.ZodNumber;
|
|
641
640
|
}, z.core.$strip>, Record<never, never>, Record<never, never>>;
|
|
642
|
-
export declare const
|
|
641
|
+
export declare const widgetDefaultGet: import("@orpc/contract").ContractProcedureBuilderWithInputOutput<z.ZodObject<{
|
|
643
642
|
type: z.ZodEnum<{
|
|
644
643
|
widget: "widget";
|
|
645
644
|
}>;
|
|
@@ -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;
|
|
@@ -856,8 +854,8 @@ export declare const widgetStream: import("@orpc/contract").ContractProcedureBui
|
|
|
856
854
|
timestamp?: number | undefined;
|
|
857
855
|
} | {
|
|
858
856
|
type: "tool/call";
|
|
859
|
-
|
|
860
|
-
|
|
857
|
+
tool_call_id: string;
|
|
858
|
+
browser_tool: string;
|
|
861
859
|
args: Record<string, unknown>;
|
|
862
860
|
mode?: "show" | "do" | undefined;
|
|
863
861
|
explanation?: string | undefined;
|
|
@@ -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;
|
|
@@ -887,8 +884,8 @@ export declare const widgetStream: import("@orpc/contract").ContractProcedureBui
|
|
|
887
884
|
timestamp?: number | undefined;
|
|
888
885
|
} | {
|
|
889
886
|
type: "tool/call";
|
|
890
|
-
|
|
891
|
-
|
|
887
|
+
tool_call_id: string;
|
|
888
|
+
browser_tool: string;
|
|
892
889
|
args: Record<string, unknown>;
|
|
893
890
|
mode?: "show" | "do" | undefined;
|
|
894
891
|
explanation?: string | undefined;
|
|
@@ -913,7 +910,7 @@ export declare const widgetMessage: import("@orpc/contract").ContractProcedureBu
|
|
|
913
910
|
task_id: z.ZodOptional<z.ZodString>;
|
|
914
911
|
}, z.core.$strip>, z.ZodObject<{
|
|
915
912
|
type: z.ZodLiteral<"tool/response">;
|
|
916
|
-
|
|
913
|
+
tool_call_id: z.ZodString;
|
|
917
914
|
success: z.ZodBoolean;
|
|
918
915
|
data: z.ZodOptional<z.ZodString>;
|
|
919
916
|
error: z.ZodOptional<z.ZodString>;
|
|
@@ -922,7 +919,7 @@ export declare const widgetMessage: import("@orpc/contract").ContractProcedureBu
|
|
|
922
919
|
type: z.ZodLiteral<"ping">;
|
|
923
920
|
}, z.core.$strip>, z.ZodObject<{
|
|
924
921
|
type: z.ZodLiteral<"rrweb/metadata">;
|
|
925
|
-
|
|
922
|
+
rrweb_session_id: z.ZodString;
|
|
926
923
|
chat_id: z.ZodString;
|
|
927
924
|
application_id: z.ZodNumber;
|
|
928
925
|
url: z.ZodOptional<z.ZodString>;
|
|
@@ -934,7 +931,7 @@ export declare const widgetMessage: import("@orpc/contract").ContractProcedureBu
|
|
|
934
931
|
}, z.core.$strip>>;
|
|
935
932
|
}, z.core.$strip>, z.ZodObject<{
|
|
936
933
|
type: z.ZodLiteral<"rrweb/events">;
|
|
937
|
-
|
|
934
|
+
rrweb_session_id: z.ZodString;
|
|
938
935
|
events: z.ZodArray<z.ZodUnknown>;
|
|
939
936
|
}, z.core.$strip>], "type">;
|
|
940
937
|
}, z.core.$strip>, z.ZodObject<{
|
|
@@ -1149,7 +1146,7 @@ export declare const widgetRoutes: {
|
|
|
1149
1146
|
limit: z.ZodNumber;
|
|
1150
1147
|
offset: z.ZodNumber;
|
|
1151
1148
|
}, z.core.$strip>, Record<never, never>, Record<never, never>>;
|
|
1152
|
-
|
|
1149
|
+
widgetDefaultGet: import("@orpc/contract").ContractProcedureBuilderWithInputOutput<z.ZodObject<{
|
|
1153
1150
|
type: z.ZodEnum<{
|
|
1154
1151
|
widget: "widget";
|
|
1155
1152
|
}>;
|
|
@@ -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;
|
|
@@ -1366,8 +1362,8 @@ export declare const widgetRoutes: {
|
|
|
1366
1362
|
timestamp?: number | undefined;
|
|
1367
1363
|
} | {
|
|
1368
1364
|
type: "tool/call";
|
|
1369
|
-
|
|
1370
|
-
|
|
1365
|
+
tool_call_id: string;
|
|
1366
|
+
browser_tool: string;
|
|
1371
1367
|
args: Record<string, unknown>;
|
|
1372
1368
|
mode?: "show" | "do" | undefined;
|
|
1373
1369
|
explanation?: string | undefined;
|
|
@@ -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;
|
|
@@ -1397,8 +1392,8 @@ export declare const widgetRoutes: {
|
|
|
1397
1392
|
timestamp?: number | undefined;
|
|
1398
1393
|
} | {
|
|
1399
1394
|
type: "tool/call";
|
|
1400
|
-
|
|
1401
|
-
|
|
1395
|
+
tool_call_id: string;
|
|
1396
|
+
browser_tool: string;
|
|
1402
1397
|
args: Record<string, unknown>;
|
|
1403
1398
|
mode?: "show" | "do" | undefined;
|
|
1404
1399
|
explanation?: string | undefined;
|
|
@@ -1423,7 +1418,7 @@ export declare const widgetRoutes: {
|
|
|
1423
1418
|
task_id: z.ZodOptional<z.ZodString>;
|
|
1424
1419
|
}, z.core.$strip>, z.ZodObject<{
|
|
1425
1420
|
type: z.ZodLiteral<"tool/response">;
|
|
1426
|
-
|
|
1421
|
+
tool_call_id: z.ZodString;
|
|
1427
1422
|
success: z.ZodBoolean;
|
|
1428
1423
|
data: z.ZodOptional<z.ZodString>;
|
|
1429
1424
|
error: z.ZodOptional<z.ZodString>;
|
|
@@ -1432,7 +1427,7 @@ export declare const widgetRoutes: {
|
|
|
1432
1427
|
type: z.ZodLiteral<"ping">;
|
|
1433
1428
|
}, z.core.$strip>, z.ZodObject<{
|
|
1434
1429
|
type: z.ZodLiteral<"rrweb/metadata">;
|
|
1435
|
-
|
|
1430
|
+
rrweb_session_id: z.ZodString;
|
|
1436
1431
|
chat_id: z.ZodString;
|
|
1437
1432
|
application_id: z.ZodNumber;
|
|
1438
1433
|
url: z.ZodOptional<z.ZodString>;
|
|
@@ -1444,7 +1439,7 @@ export declare const widgetRoutes: {
|
|
|
1444
1439
|
}, z.core.$strip>>;
|
|
1445
1440
|
}, z.core.$strip>, z.ZodObject<{
|
|
1446
1441
|
type: z.ZodLiteral<"rrweb/events">;
|
|
1447
|
-
|
|
1442
|
+
rrweb_session_id: z.ZodString;
|
|
1448
1443
|
events: z.ZodArray<z.ZodUnknown>;
|
|
1449
1444
|
}, z.core.$strip>], "type">;
|
|
1450
1445
|
}, z.core.$strip>, z.ZodObject<{
|
package/dist/src/sdk/index.d.ts
CHANGED
|
@@ -50,10 +50,10 @@ export declare const sdk: {
|
|
|
50
50
|
widget_question: "widget_question";
|
|
51
51
|
qa_run_started: "qa_run_started";
|
|
52
52
|
start_simulation: "start_simulation";
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
53
|
+
create_workflow: "create_workflow";
|
|
54
|
+
update_workflow: "update_workflow";
|
|
55
|
+
delete_workflow: "delete_workflow";
|
|
56
|
+
toggle_workflow: "toggle_workflow";
|
|
57
57
|
slack_command: "slack_command";
|
|
58
58
|
}>;
|
|
59
59
|
}, import("zod/v4/core").$strip>, import("zod").ZodObject<{
|
|
@@ -84,10 +84,10 @@ export declare const sdk: {
|
|
|
84
84
|
widget_question: "widget_question";
|
|
85
85
|
qa_run_started: "qa_run_started";
|
|
86
86
|
start_simulation: "start_simulation";
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
87
|
+
create_workflow: "create_workflow";
|
|
88
|
+
update_workflow: "update_workflow";
|
|
89
|
+
delete_workflow: "delete_workflow";
|
|
90
|
+
toggle_workflow: "toggle_workflow";
|
|
91
91
|
slack_command: "slack_command";
|
|
92
92
|
}>;
|
|
93
93
|
metadata: import("zod").ZodOptional<import("zod").ZodObject<{
|
|
@@ -192,7 +192,7 @@ export declare const sdk: {
|
|
|
192
192
|
}, import("zod/v4/core").$strip>>;
|
|
193
193
|
}, import("zod/v4/core").$strip>, Record<never, never>>;
|
|
194
194
|
chatCreate: import("@orpc/contract").ContractProcedureClient<Record<never, never>, import("@orpc/contract").Schema<unknown, unknown>, import("zod").ZodString, Record<never, never>>;
|
|
195
|
-
|
|
195
|
+
widgetDefaultGet: import("@orpc/contract").ContractProcedureClient<Record<never, never>, import("zod").ZodObject<{
|
|
196
196
|
type: import("zod").ZodEnum<{
|
|
197
197
|
widget: "widget";
|
|
198
198
|
}>;
|
|
@@ -341,7 +341,7 @@ export declare const sdk: {
|
|
|
341
341
|
task_id: import("zod").ZodOptional<import("zod").ZodString>;
|
|
342
342
|
}, import("zod/v4/core").$strip>, import("zod").ZodObject<{
|
|
343
343
|
type: import("zod").ZodLiteral<"tool/response">;
|
|
344
|
-
|
|
344
|
+
tool_call_id: import("zod").ZodString;
|
|
345
345
|
success: import("zod").ZodBoolean;
|
|
346
346
|
data: import("zod").ZodOptional<import("zod").ZodString>;
|
|
347
347
|
error: import("zod").ZodOptional<import("zod").ZodString>;
|
|
@@ -350,7 +350,7 @@ export declare const sdk: {
|
|
|
350
350
|
type: import("zod").ZodLiteral<"ping">;
|
|
351
351
|
}, import("zod/v4/core").$strip>, import("zod").ZodObject<{
|
|
352
352
|
type: import("zod").ZodLiteral<"rrweb/metadata">;
|
|
353
|
-
|
|
353
|
+
rrweb_session_id: import("zod").ZodString;
|
|
354
354
|
chat_id: import("zod").ZodString;
|
|
355
355
|
application_id: import("zod").ZodNumber;
|
|
356
356
|
url: import("zod").ZodOptional<import("zod").ZodString>;
|
|
@@ -362,7 +362,7 @@ export declare const sdk: {
|
|
|
362
362
|
}, import("zod/v4/core").$strip>>;
|
|
363
363
|
}, import("zod/v4/core").$strip>, import("zod").ZodObject<{
|
|
364
364
|
type: import("zod").ZodLiteral<"rrweb/events">;
|
|
365
|
-
|
|
365
|
+
rrweb_session_id: import("zod").ZodString;
|
|
366
366
|
events: import("zod").ZodArray<import("zod").ZodUnknown>;
|
|
367
367
|
}, import("zod/v4/core").$strip>], "type">;
|
|
368
368
|
}, import("zod/v4/core").$strip>, import("zod").ZodObject<{
|
|
@@ -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;
|
|
@@ -399,8 +398,8 @@ export declare const sdk: {
|
|
|
399
398
|
timestamp?: number | undefined;
|
|
400
399
|
} | {
|
|
401
400
|
type: "tool/call";
|
|
402
|
-
|
|
403
|
-
|
|
401
|
+
tool_call_id: string;
|
|
402
|
+
browser_tool: string;
|
|
404
403
|
args: Record<string, unknown>;
|
|
405
404
|
mode?: "show" | "do" | undefined;
|
|
406
405
|
explanation?: string | undefined;
|
|
@@ -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;
|
|
@@ -430,8 +428,8 @@ export declare const sdk: {
|
|
|
430
428
|
timestamp?: number | undefined;
|
|
431
429
|
} | {
|
|
432
430
|
type: "tool/call";
|
|
433
|
-
|
|
434
|
-
|
|
431
|
+
tool_call_id: string;
|
|
432
|
+
browser_tool: string;
|
|
435
433
|
args: Record<string, unknown>;
|
|
436
434
|
mode?: "show" | "do" | undefined;
|
|
437
435
|
explanation?: string | undefined;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { MarketrixConfig,
|
|
1
|
+
import type { MarketrixConfig, MessageDispatchRequest, MessageDispatchResponse } from '../types';
|
|
2
2
|
export declare class ApiService {
|
|
3
3
|
private config;
|
|
4
4
|
constructor(config: MarketrixConfig);
|
|
@@ -12,7 +12,7 @@ export declare class ApiService {
|
|
|
12
12
|
* Send a message via the typed stream (fire-and-forget).
|
|
13
13
|
* The actual response arrives asynchronously as a chat/response stream event.
|
|
14
14
|
*/
|
|
15
|
-
|
|
15
|
+
messageDispatch(request: MessageDispatchRequest): Promise<MessageDispatchResponse>;
|
|
16
16
|
/**
|
|
17
17
|
* Update configuration
|
|
18
18
|
*/
|
|
@@ -78,11 +78,11 @@ export interface ExtractParams {
|
|
|
78
78
|
extract_links?: boolean;
|
|
79
79
|
start_from_char?: number;
|
|
80
80
|
}
|
|
81
|
-
export declare class
|
|
81
|
+
export declare class BrowserToolService {
|
|
82
82
|
private static instance;
|
|
83
83
|
private constructor();
|
|
84
|
-
static getInstance():
|
|
85
|
-
executeTool(
|
|
84
|
+
static getInstance(): BrowserToolService;
|
|
85
|
+
executeTool(browserToolName: string, args: Record<string, unknown>, mode?: string, explanation?: string): Promise<ToolExecutionResult<unknown>>;
|
|
86
86
|
private requiresHighlight;
|
|
87
87
|
private navigate;
|
|
88
88
|
private search;
|
|
@@ -110,4 +110,4 @@ export declare class ToolService {
|
|
|
110
110
|
private getInteractableElements;
|
|
111
111
|
private getScreenshot;
|
|
112
112
|
}
|
|
113
|
-
export declare const
|
|
113
|
+
export declare const browserToolService: BrowserToolService;
|
|
@@ -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;
|
|
@@ -4,12 +4,12 @@
|
|
|
4
4
|
* Centralized chat ID management with promise-based locking to prevent
|
|
5
5
|
* concurrent chat ID creation. Ensures only one chat ID is created per session.
|
|
6
6
|
*/
|
|
7
|
-
declare class
|
|
7
|
+
declare class ChatSessionManager {
|
|
8
8
|
private static instance;
|
|
9
9
|
private chatId;
|
|
10
10
|
private initializationPromise;
|
|
11
11
|
private constructor();
|
|
12
|
-
static getInstance():
|
|
12
|
+
static getInstance(): ChatSessionManager;
|
|
13
13
|
getChatId(): string | null;
|
|
14
14
|
/**
|
|
15
15
|
* Get or create chat ID with promise-based locking
|
|
@@ -23,5 +23,5 @@ declare class SessionManager {
|
|
|
23
23
|
private getStoredChatId;
|
|
24
24
|
private storeChatId;
|
|
25
25
|
}
|
|
26
|
-
export declare const
|
|
26
|
+
export declare const chatSessionManager: ChatSessionManager;
|
|
27
27
|
export {};
|
|
@@ -86,7 +86,7 @@ export declare class DomService {
|
|
|
86
86
|
getElementByIndex(index: number): ElementLookupResult;
|
|
87
87
|
/**
|
|
88
88
|
* Get an element by index with validation.
|
|
89
|
-
* This is the main entry point for
|
|
89
|
+
* This is the main entry point for BrowserToolService to use.
|
|
90
90
|
* It validates the element matches its fingerprint and attempts recovery if not.
|
|
91
91
|
* Returns element only if it's interactable.
|
|
92
92
|
*/
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
2
|
+
* RrwebSessionRecorder manages real-time RRWeb session recording,
|
|
3
3
|
* sending batched events to the API via HTTP POST (widget message endpoint).
|
|
4
4
|
*/
|
|
5
|
-
export declare class
|
|
5
|
+
export declare class RrwebSessionRecorder {
|
|
6
6
|
private eventQueue;
|
|
7
7
|
private estimatedQueueBytes;
|
|
8
8
|
private sessionId;
|
|
@@ -17,7 +17,7 @@ export declare class SessionRecorder {
|
|
|
17
17
|
private consecutiveFailures;
|
|
18
18
|
private isFlushing;
|
|
19
19
|
constructor(chatId: string, applicationId: number);
|
|
20
|
-
private
|
|
20
|
+
private metadataEmit;
|
|
21
21
|
private bufferEvent;
|
|
22
22
|
/**
|
|
23
23
|
* Flush buffered events via POST.
|
|
@@ -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
|
-
|
|
29
|
-
|
|
28
|
+
isSimulationRunning: boolean;
|
|
29
|
+
activeSimulationId: string | null;
|
|
30
30
|
currentMode: InstructionType;
|
|
31
31
|
isOpen: boolean;
|
|
32
32
|
isMinimized: boolean;
|
|
@@ -57,13 +57,13 @@ declare class StorageService {
|
|
|
57
57
|
getChatId(): string | null;
|
|
58
58
|
/**
|
|
59
59
|
* Set chat_id in both localStorage and window.name.
|
|
60
|
-
* Dispatches a 'marketrix:chatid' event so other services (e.g.
|
|
60
|
+
* Dispatches a 'marketrix:chatid' event so other services (e.g. RrwebSessionRecorder) can react.
|
|
61
61
|
*/
|
|
62
62
|
setChatId(chatId: string | null): void;
|
|
63
63
|
getMessages(): StoredMessage[];
|
|
64
64
|
setMessages(messages: StoredMessage[]): void;
|
|
65
|
-
getChatState(): Pick<MarketrixChatContext, '
|
|
66
|
-
setChatState(state: Partial<Pick<MarketrixChatContext, '
|
|
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;
|