@marketrix.ai/widget 3.8.136 → 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/context/{ConversationContext.d.ts → ChatContext.d.ts} +7 -7
- package/dist/src/context/WidgetProviders.d.ts +2 -2
- package/dist/src/context/sseReducer.d.ts +3 -3
- package/dist/src/hooks/useWidget.d.ts +2 -2
- package/dist/src/index.d.ts +2 -2
- package/dist/src/sdk/contract.d.ts +16 -16
- 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/entities.d.ts +21 -36
- package/dist/src/sdk/contracts/widget.d.ts +21 -21
- package/dist/src/sdk/index.d.ts +16 -16
- 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/{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 +1 -1
- 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 +3 -3
- package/dist/src/utils/chat.d.ts +5 -5
- package/dist/widget.mjs +27 -27
- package/dist/widget.mjs.map +1 -1
- package/package.json +1 -1
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<{
|
|
@@ -398,8 +398,8 @@ export declare const sdk: {
|
|
|
398
398
|
timestamp?: number | undefined;
|
|
399
399
|
} | {
|
|
400
400
|
type: "tool/call";
|
|
401
|
-
|
|
402
|
-
|
|
401
|
+
tool_call_id: string;
|
|
402
|
+
browser_tool: string;
|
|
403
403
|
args: Record<string, unknown>;
|
|
404
404
|
mode?: "show" | "do" | undefined;
|
|
405
405
|
explanation?: string | undefined;
|
|
@@ -428,8 +428,8 @@ export declare const sdk: {
|
|
|
428
428
|
timestamp?: number | undefined;
|
|
429
429
|
} | {
|
|
430
430
|
type: "tool/call";
|
|
431
|
-
|
|
432
|
-
|
|
431
|
+
tool_call_id: string;
|
|
432
|
+
browser_tool: string;
|
|
433
433
|
args: Record<string, unknown>;
|
|
434
434
|
mode?: "show" | "do" | undefined;
|
|
435
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;
|
|
@@ -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.
|
|
@@ -57,7 +57,7 @@ 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[];
|
|
@@ -9,7 +9,7 @@ export declare class WidgetService {
|
|
|
9
9
|
* Always returns default settings merged with existing widget settings if found
|
|
10
10
|
* Returns null if no credentials provided (for preview mode)
|
|
11
11
|
*/
|
|
12
|
-
|
|
12
|
+
widgetSettingsGet(): Promise<WidgetData | null>;
|
|
13
13
|
/**
|
|
14
14
|
* Get widget settings from widget data
|
|
15
15
|
* Settings are always objects (current API format)
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* Browser Use Tools - widget tool registry.
|
|
3
3
|
*
|
|
4
4
|
* IMPORTANT: This file is the single source of truth for widget tool metadata.
|
|
5
|
-
* ALLOWED_TOOLS in
|
|
5
|
+
* ALLOWED_TOOLS in ChatContext.tsx and TOOL_NAME_MAPPING in chat.ts are
|
|
6
6
|
* derived from BROWSER_TOOLS below.
|
|
7
7
|
*/
|
|
8
8
|
interface BrowserToolMetadata {
|
|
@@ -52,7 +52,7 @@ export interface MessagePart {
|
|
|
52
52
|
type: 'text' | 'progress';
|
|
53
53
|
content: string;
|
|
54
54
|
status?: 'in_progress' | 'completed' | 'failed' | 'stopped';
|
|
55
|
-
|
|
55
|
+
browserToolName?: string;
|
|
56
56
|
hideIcon?: boolean;
|
|
57
57
|
textStyle?: 'default' | 'muted';
|
|
58
58
|
}
|
|
@@ -69,7 +69,7 @@ export interface WidgetState {
|
|
|
69
69
|
isSimulationRunning: boolean;
|
|
70
70
|
activeView: WidgetView;
|
|
71
71
|
}
|
|
72
|
-
export interface
|
|
72
|
+
export interface MessageDispatchRequest {
|
|
73
73
|
message?: string;
|
|
74
74
|
mode?: InstructionType;
|
|
75
75
|
mtxId?: string;
|
|
@@ -78,7 +78,7 @@ export interface SendMessageRequest {
|
|
|
78
78
|
question?: string;
|
|
79
79
|
requestId?: string;
|
|
80
80
|
}
|
|
81
|
-
export interface
|
|
81
|
+
export interface MessageDispatchResponse {
|
|
82
82
|
messageId: string;
|
|
83
83
|
response: string;
|
|
84
84
|
mode: InstructionType;
|
package/dist/src/utils/chat.d.ts
CHANGED
|
@@ -41,12 +41,12 @@ export declare function findMessageForProgress(options: FindMessageOptions): {
|
|
|
41
41
|
/**
|
|
42
42
|
* Tools that, in `show` mode, pause for the user to perform the action
|
|
43
43
|
* themselves (DOM-mutating "mouse and keyboard" actions, minus `scroll`).
|
|
44
|
-
* Also the set that requires element highlighting in
|
|
44
|
+
* Also the set that requires element highlighting in BrowserToolService.
|
|
45
45
|
*/
|
|
46
46
|
export declare const WAIT_FOR_USER_TOOLS: Set<string>;
|
|
47
|
-
export declare function addProgressLine(message: ChatMessage,
|
|
48
|
-
export declare function markProgressLineComplete(message: ChatMessage,
|
|
49
|
-
export declare function markProgressLineFailed(message: ChatMessage,
|
|
47
|
+
export declare function addProgressLine(message: ChatMessage, browserToolName: string, explanation: string): ChatMessage;
|
|
48
|
+
export declare function markProgressLineComplete(message: ChatMessage, browserToolName?: string): ChatMessage;
|
|
49
|
+
export declare function markProgressLineFailed(message: ChatMessage, browserToolName: string, error: string): ChatMessage;
|
|
50
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).
|
|
@@ -57,4 +57,4 @@ export declare const TOOL_NAME_MAPPING: Record<string, string>;
|
|
|
57
57
|
* Get a friendly display name for a tool
|
|
58
58
|
* Converts snake_case to Title Case if no mapping exists
|
|
59
59
|
*/
|
|
60
|
-
export declare function getFriendlyToolName(
|
|
60
|
+
export declare function getFriendlyToolName(browserToolName: string): string;
|