@marketrix.ai/widget 3.8.448 → 3.8.453
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/ProgressLine.d.ts +0 -3
- package/dist/src/components/navigation/MessengerShell.d.ts +1 -1
- package/dist/src/components/views/ChatView.d.ts +1 -1
- package/dist/src/context/ChatContext.d.ts +1 -1
- package/dist/src/design-system/component-tokens.d.ts +0 -9
- package/dist/src/design-system/layers.d.ts +0 -3
- package/dist/src/hooks/useScreenShare.d.ts +1 -4
- package/dist/src/hooks/useWidget.d.ts +1 -1
- package/dist/src/sdk/contract.d.ts +2 -2
- package/dist/src/sdk/contracts/entities.d.ts +0 -2171
- package/dist/src/sdk/contracts/widget.d.ts +5 -5
- package/dist/src/sdk/index.d.ts +2 -7
- package/dist/src/services/BrowserToolService.d.ts +2 -11
- package/dist/src/services/ChatService.d.ts +0 -4
- package/dist/src/services/ChatSessionManager.d.ts +1 -3
- package/dist/src/services/ConfigManager.d.ts +0 -3
- package/dist/src/services/DomService.d.ts +1 -25
- package/dist/src/services/ShowModeService.d.ts +0 -3
- package/dist/src/services/StorageService.d.ts +1 -3
- package/dist/src/services/StreamClient.d.ts +0 -2
- package/dist/src/types/index.d.ts +0 -3
- package/dist/src/utils/chat.d.ts +3 -2
- package/dist/widget.mjs +60 -61
- package/dist/widget.mjs.map +1 -1
- package/package.json +10 -12
- package/dist/src/types/browserTools.d.ts +0 -11
- package/dist/src/utils/logger.d.ts +0 -6
|
@@ -243,10 +243,10 @@ export declare const WidgetEventSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
243
243
|
type: z.ZodLiteral<"task/status">;
|
|
244
244
|
status: z.ZodEnum<{
|
|
245
245
|
running: "running";
|
|
246
|
-
has_question: "has_question";
|
|
247
246
|
completed: "completed";
|
|
248
247
|
failed: "failed";
|
|
249
248
|
stopped: "stopped";
|
|
249
|
+
has_question: "has_question";
|
|
250
250
|
}>;
|
|
251
251
|
message: z.ZodOptional<z.ZodString>;
|
|
252
252
|
task_id: z.ZodOptional<z.ZodString>;
|
|
@@ -735,7 +735,7 @@ export declare const widgetStream: import("@orpc/contract").ContractProcedureBui
|
|
|
735
735
|
error: string;
|
|
736
736
|
} | {
|
|
737
737
|
type: "task/status";
|
|
738
|
-
status: "running" | "
|
|
738
|
+
status: "running" | "completed" | "failed" | "stopped" | "has_question";
|
|
739
739
|
message?: string | undefined;
|
|
740
740
|
task_id?: string | undefined;
|
|
741
741
|
timestamp?: number | undefined;
|
|
@@ -766,7 +766,7 @@ export declare const widgetStream: import("@orpc/contract").ContractProcedureBui
|
|
|
766
766
|
error: string;
|
|
767
767
|
} | {
|
|
768
768
|
type: "task/status";
|
|
769
|
-
status: "running" | "
|
|
769
|
+
status: "running" | "completed" | "failed" | "stopped" | "has_question";
|
|
770
770
|
message?: string | undefined;
|
|
771
771
|
task_id?: string | undefined;
|
|
772
772
|
timestamp?: number | undefined;
|
|
@@ -1255,7 +1255,7 @@ export declare const widgetRoutes: {
|
|
|
1255
1255
|
error: string;
|
|
1256
1256
|
} | {
|
|
1257
1257
|
type: "task/status";
|
|
1258
|
-
status: "running" | "
|
|
1258
|
+
status: "running" | "completed" | "failed" | "stopped" | "has_question";
|
|
1259
1259
|
message?: string | undefined;
|
|
1260
1260
|
task_id?: string | undefined;
|
|
1261
1261
|
timestamp?: number | undefined;
|
|
@@ -1286,7 +1286,7 @@ export declare const widgetRoutes: {
|
|
|
1286
1286
|
error: string;
|
|
1287
1287
|
} | {
|
|
1288
1288
|
type: "task/status";
|
|
1289
|
-
status: "running" | "
|
|
1289
|
+
status: "running" | "completed" | "failed" | "stopped" | "has_question";
|
|
1290
1290
|
message?: string | undefined;
|
|
1291
1291
|
task_id?: string | undefined;
|
|
1292
1292
|
timestamp?: number | undefined;
|
package/dist/src/sdk/index.d.ts
CHANGED
|
@@ -429,7 +429,7 @@ export declare const sdk: {
|
|
|
429
429
|
error: string;
|
|
430
430
|
} | {
|
|
431
431
|
type: "task/status";
|
|
432
|
-
status: "running" | "
|
|
432
|
+
status: "running" | "completed" | "failed" | "stopped" | "has_question";
|
|
433
433
|
message?: string | undefined;
|
|
434
434
|
task_id?: string | undefined;
|
|
435
435
|
timestamp?: number | undefined;
|
|
@@ -460,7 +460,7 @@ export declare const sdk: {
|
|
|
460
460
|
error: string;
|
|
461
461
|
} | {
|
|
462
462
|
type: "task/status";
|
|
463
|
-
status: "running" | "
|
|
463
|
+
status: "running" | "completed" | "failed" | "stopped" | "has_question";
|
|
464
464
|
message?: string | undefined;
|
|
465
465
|
task_id?: string | undefined;
|
|
466
466
|
timestamp?: number | undefined;
|
|
@@ -472,11 +472,6 @@ export declare const sdk: {
|
|
|
472
472
|
mode?: "show" | "do" | undefined;
|
|
473
473
|
explanation?: string | undefined;
|
|
474
474
|
}, unknown, void>>, Record<never, never>>;
|
|
475
|
-
} & {
|
|
476
|
-
setAuthToken: (token: string) => void;
|
|
477
|
-
clearAuthToken: () => void;
|
|
478
|
-
getAuthToken: () => string | null;
|
|
479
|
-
configure: (apiUrl: string) => void;
|
|
480
475
|
};
|
|
481
476
|
export { WidgetSettingsDataSchema } from './contracts/entities';
|
|
482
477
|
export { WidgetEventSchema } from './contracts/widget';
|
|
@@ -16,9 +16,6 @@ export interface DropdownOptionsData {
|
|
|
16
16
|
text: string;
|
|
17
17
|
}>;
|
|
18
18
|
}
|
|
19
|
-
export interface ElementsData {
|
|
20
|
-
elements: unknown[];
|
|
21
|
-
}
|
|
22
19
|
export interface ToolExecutionResult<T = TextData> {
|
|
23
20
|
success: boolean;
|
|
24
21
|
data: T;
|
|
@@ -63,9 +60,6 @@ export interface UploadFileParams {
|
|
|
63
60
|
index: number;
|
|
64
61
|
path: string;
|
|
65
62
|
}
|
|
66
|
-
export interface SwitchTabParams {
|
|
67
|
-
tab_id: string;
|
|
68
|
-
}
|
|
69
63
|
export interface DoneParams {
|
|
70
64
|
success: boolean;
|
|
71
65
|
message?: string;
|
|
@@ -79,9 +73,6 @@ export interface ExtractParams {
|
|
|
79
73
|
start_from_char?: number;
|
|
80
74
|
}
|
|
81
75
|
export declare class BrowserToolService {
|
|
82
|
-
private static instance;
|
|
83
|
-
private constructor();
|
|
84
|
-
static getInstance(): BrowserToolService;
|
|
85
76
|
executeTool(browserToolName: string, args: Record<string, unknown>, mode?: string, explanation?: string): Promise<ToolExecutionResult<unknown>>;
|
|
86
77
|
private requiresHighlight;
|
|
87
78
|
private navigate;
|
|
@@ -98,12 +89,12 @@ export declare class BrowserToolService {
|
|
|
98
89
|
private sendKeys;
|
|
99
90
|
/** Programmatic KeyboardEvents aren't "trusted", so manually reproduce each key's expected behavior. */
|
|
100
91
|
private simulateKeyAction;
|
|
92
|
+
/** Native value setter so React/Vue controlled inputs pick up the change. */
|
|
93
|
+
private setValueAndCaret;
|
|
101
94
|
private uploadFile;
|
|
102
95
|
private closeTab;
|
|
103
|
-
private switchTab;
|
|
104
96
|
private done;
|
|
105
97
|
private getHtml;
|
|
106
|
-
private getInteractableElements;
|
|
107
98
|
private getScreenshot;
|
|
108
99
|
}
|
|
109
100
|
export declare const browserToolService: BrowserToolService;
|
|
@@ -9,11 +9,8 @@ export interface ChatSnapshot {
|
|
|
9
9
|
isLoading: boolean;
|
|
10
10
|
}
|
|
11
11
|
export declare class ChatService {
|
|
12
|
-
private static instance;
|
|
13
12
|
private chatId;
|
|
14
13
|
initError: Error | null;
|
|
15
|
-
private constructor();
|
|
16
|
-
static getInstance(): ChatService;
|
|
17
14
|
initialize(chatId: string | null): void;
|
|
18
15
|
createInitialContext(chatId: string): void;
|
|
19
16
|
getInitError(): Error | null;
|
|
@@ -25,5 +22,4 @@ export declare function createUserMessage(content: string, mode?: InstructionTyp
|
|
|
25
22
|
export declare function createAgentMessage(content: string, mode?: InstructionType, messageId?: string, idPrefix?: string): ChatMessage;
|
|
26
23
|
export declare function createSystemMessage(content: string, mode?: InstructionType, sender?: 'user' | 'agent', idPrefix?: string): ChatMessage;
|
|
27
24
|
export declare function createScreenAccessRequestMessage(mode?: InstructionType): ChatMessage;
|
|
28
|
-
export declare function createStartedScreenshareMessage(mode?: InstructionType): ChatMessage;
|
|
29
25
|
export declare function createScreenshareMessage(stream: MediaStream, mode?: InstructionType): ChatMessage;
|
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
declare class ChatSessionManager {
|
|
2
|
-
private static instance;
|
|
3
2
|
private chatId;
|
|
4
3
|
private initializationPromise;
|
|
5
|
-
|
|
6
|
-
static getInstance(): ChatSessionManager;
|
|
4
|
+
constructor();
|
|
7
5
|
getChatId(): string | null;
|
|
8
6
|
/** Promise-based lock: concurrent callers all await the same creation promise. */
|
|
9
7
|
getOrCreateChatId(): Promise<string>;
|
|
@@ -1,10 +1,7 @@
|
|
|
1
1
|
import type { WidgetSettingsData } from '../sdk';
|
|
2
2
|
import type { MarketrixConfig } from '../types';
|
|
3
3
|
export declare class ConfigManager {
|
|
4
|
-
private static instance;
|
|
5
4
|
private config;
|
|
6
|
-
private constructor();
|
|
7
|
-
static getInstance(): ConfigManager;
|
|
8
5
|
loadConfig(): MarketrixConfig;
|
|
9
6
|
saveConfig(config: MarketrixConfig): void;
|
|
10
7
|
getConfig(): MarketrixConfig | null;
|
|
@@ -10,27 +10,17 @@ export interface ElementFingerprint {
|
|
|
10
10
|
selector: string;
|
|
11
11
|
indexVersion: number;
|
|
12
12
|
}
|
|
13
|
-
export interface
|
|
14
|
-
isValid: boolean;
|
|
15
|
-
mismatchReason?: 'element_removed' | 'element_changed';
|
|
16
|
-
}
|
|
17
|
-
export interface ElementLookupResult {
|
|
13
|
+
export interface ValidatedElementResult {
|
|
18
14
|
element: HTMLElement | null;
|
|
19
15
|
error?: string;
|
|
20
16
|
}
|
|
21
|
-
export interface ValidatedElementResult extends ElementLookupResult {
|
|
22
|
-
validation: ValidationResult;
|
|
23
|
-
}
|
|
24
17
|
export declare class DomService {
|
|
25
|
-
private static instance;
|
|
26
18
|
private elementMap;
|
|
27
19
|
private elementToSequence;
|
|
28
20
|
private selectorMap;
|
|
29
21
|
private fingerprintMap;
|
|
30
22
|
private indexingInProgress;
|
|
31
23
|
private indexVersion;
|
|
32
|
-
private constructor();
|
|
33
|
-
static getInstance(): DomService;
|
|
34
24
|
private generateSelector;
|
|
35
25
|
private generateFingerprint;
|
|
36
26
|
private matchesFingerprint;
|
|
@@ -40,24 +30,10 @@ export declare class DomService {
|
|
|
40
30
|
private isStackingContext;
|
|
41
31
|
private calculateGlobalZOrder;
|
|
42
32
|
getSnapshotHtml(): string;
|
|
43
|
-
getInteractableElements(): Array<{
|
|
44
|
-
index: number;
|
|
45
|
-
fingerprint: ElementFingerprint;
|
|
46
|
-
coords: {
|
|
47
|
-
x: number;
|
|
48
|
-
y: number;
|
|
49
|
-
w: number;
|
|
50
|
-
h: number;
|
|
51
|
-
z: number;
|
|
52
|
-
};
|
|
53
|
-
cssClasses: string[];
|
|
54
|
-
}>;
|
|
55
33
|
getSequenceForElement(element: Element): number | undefined;
|
|
56
34
|
clearIndex(): void;
|
|
57
35
|
private checkInteractability;
|
|
58
36
|
checkElementInteractable(element: HTMLElement, index: number): string | null;
|
|
59
|
-
getElementByIndex(index: number): ElementLookupResult;
|
|
60
|
-
/** Prefer this over the looser getElementByIndex — it also fingerprint-checks the index. */
|
|
61
37
|
getValidatedElement(index: number): ValidatedElementResult;
|
|
62
38
|
}
|
|
63
39
|
export declare const domService: DomService;
|
|
@@ -5,7 +5,6 @@ export interface ShowModeOptions {
|
|
|
5
5
|
isClickAction?: boolean;
|
|
6
6
|
}
|
|
7
7
|
export declare class ShowModeService {
|
|
8
|
-
private static instance;
|
|
9
8
|
private currentPopup;
|
|
10
9
|
private currentHighlight;
|
|
11
10
|
private currentElement;
|
|
@@ -19,8 +18,6 @@ export declare class ShowModeService {
|
|
|
19
18
|
private rafId;
|
|
20
19
|
private mutationObserver;
|
|
21
20
|
private visibilityCheckInterval;
|
|
22
|
-
private constructor();
|
|
23
|
-
static getInstance(): ShowModeService;
|
|
24
21
|
showToolAction(options: ShowModeOptions): Promise<boolean>;
|
|
25
22
|
cleanup(): void;
|
|
26
23
|
private createHighlight;
|
|
@@ -15,10 +15,8 @@ export interface MarketrixChatContext {
|
|
|
15
15
|
timestamp: number;
|
|
16
16
|
}
|
|
17
17
|
declare class StorageService {
|
|
18
|
-
private static instance;
|
|
19
18
|
private context;
|
|
20
|
-
|
|
21
|
-
static getInstance(): StorageService;
|
|
19
|
+
constructor();
|
|
22
20
|
private loadContext;
|
|
23
21
|
private saveContext;
|
|
24
22
|
getContext(): MarketrixChatContext;
|
|
@@ -4,7 +4,6 @@ export interface StreamClientCallbacks {
|
|
|
4
4
|
onStatusChange?: (status: StreamStatus) => void;
|
|
5
5
|
onMessage?: (event: WidgetEvent) => void;
|
|
6
6
|
onError?: (error: Error) => void;
|
|
7
|
-
onRegistered?: (applicationId: number | undefined) => void;
|
|
8
7
|
}
|
|
9
8
|
export declare class StreamClient {
|
|
10
9
|
private static instance;
|
|
@@ -26,7 +25,6 @@ export declare class StreamClient {
|
|
|
26
25
|
static getInstance(): StreamClient;
|
|
27
26
|
addCallbacks(callbacks: StreamClientCallbacks): void;
|
|
28
27
|
removeCallbacks(callbacks: StreamClientCallbacks): void;
|
|
29
|
-
getStatus(): StreamStatus;
|
|
30
28
|
isConnected(): boolean;
|
|
31
29
|
waitUntilRegistered(): Promise<void>;
|
|
32
30
|
connect(chatId: string, config?: {
|
|
@@ -33,8 +33,6 @@ export interface MessagePart {
|
|
|
33
33
|
content: string;
|
|
34
34
|
status?: 'in_progress' | 'completed' | 'failed' | 'stopped';
|
|
35
35
|
browserToolName?: string;
|
|
36
|
-
hideIcon?: boolean;
|
|
37
|
-
textStyle?: 'default' | 'muted';
|
|
38
36
|
/** chat/delta fragments accumulate into this part; the final chat/response replaces it. */
|
|
39
37
|
streaming?: boolean;
|
|
40
38
|
}
|
|
@@ -82,4 +80,3 @@ export interface MarketrixWidgetProps {
|
|
|
82
80
|
mtxKey?: string;
|
|
83
81
|
mtxApiHost?: string;
|
|
84
82
|
}
|
|
85
|
-
export { BROWSER_TOOLS } from './browserTools';
|
package/dist/src/utils/chat.d.ts
CHANGED
|
@@ -15,8 +15,9 @@ export declare function findMessageForProgress(options: FindMessageOptions): {
|
|
|
15
15
|
} | null;
|
|
16
16
|
export declare const WAIT_FOR_USER_TOOLS: Set<string>;
|
|
17
17
|
export declare function addProgressLine(message: ChatMessage, browserToolName: string, explanation: string): ChatMessage;
|
|
18
|
-
export declare function markProgressLineComplete(message: ChatMessage
|
|
18
|
+
export declare function markProgressLineComplete(message: ChatMessage): ChatMessage;
|
|
19
19
|
export declare function markProgressLineFailed(message: ChatMessage, browserToolName: string, error: string): ChatMessage;
|
|
20
20
|
export declare function updateThinkingMarker(message: ChatMessage, isTaskRunning: boolean, currentMode: 'show' | 'tell' | 'do', isWaitingForUser?: boolean): ChatMessage;
|
|
21
|
-
|
|
21
|
+
/** Tool id -> the phrase shown in the activity log. Also the allowlist of tools the agent may call. */
|
|
22
|
+
export declare const BROWSER_TOOLS: Map<string, string>;
|
|
22
23
|
export declare function getFriendlyToolName(browserToolName: string): string;
|