@marketrix.ai/widget 3.8.427 → 3.8.441
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/loader.js +1 -2
- package/dist/src/context/sseReducer.d.ts +0 -1
- package/dist/src/sdk/contracts/common.d.ts +0 -20
- package/dist/src/sdk/contracts/entities.d.ts +12 -14
- package/dist/src/services/ChatService.d.ts +0 -3
- package/dist/src/services/ConfigManager.d.ts +0 -1
- package/dist/src/services/DomService.d.ts +1 -3
- package/dist/src/services/ScreenShareService.d.ts +0 -1
- package/dist/src/services/StorageService.d.ts +0 -2
- package/dist/src/services/ValidationService.d.ts +1 -1
- package/dist/src/services/WidgetService.d.ts +1 -1
- package/dist/src/types/index.d.ts +1 -2
- package/dist/src/utils/widgetPositioning.d.ts +0 -1
- package/dist/widget.mjs +21 -21
- package/dist/widget.mjs.map +1 -1
- package/package.json +2 -2
package/dist/loader.js
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
//
|
|
2
|
-
// and passes through every mtx-* attribute. MUST sit in <head> before any <script type="module">.
|
|
1
|
+
// Must sit in <head> before any <script type="module"> — it defines the importmap they resolve against.
|
|
3
2
|
(function () {
|
|
4
3
|
var existing = {};
|
|
5
4
|
var oldMap = document.querySelector('script[type="importmap"]');
|
|
@@ -31,19 +31,13 @@ export declare const PaginationSchema: z.ZodObject<{
|
|
|
31
31
|
limit: z.ZodDefault<z.ZodOptional<z.ZodCoercedNumber<unknown>>>;
|
|
32
32
|
offset: z.ZodDefault<z.ZodOptional<z.ZodCoercedNumber<unknown>>>;
|
|
33
33
|
}, z.core.$strip>;
|
|
34
|
-
/**
|
|
35
|
-
* Query-string boolean. NOT `z.coerce.boolean()` — that is `Boolean(val)`, so `Boolean('false') === true`
|
|
36
|
-
* and `?enabled=false` would match enabled rows. `.optional()` is outermost so the object key stays omittable.
|
|
37
|
-
*/
|
|
38
34
|
export declare const booleanQueryParam: z.ZodOptional<z.ZodPipe<z.ZodUnion<readonly [z.ZodBoolean, z.ZodString]>, z.ZodTransform<boolean | undefined, string | boolean>>>;
|
|
39
|
-
/** Paginated list for unbounded queries */
|
|
40
35
|
export declare const paginatedListOf: <T extends z.ZodTypeAny>(schema: T) => z.ZodObject<{
|
|
41
36
|
items: z.ZodArray<T>;
|
|
42
37
|
total: z.ZodNumber;
|
|
43
38
|
limit: z.ZodNumber;
|
|
44
39
|
offset: z.ZodNumber;
|
|
45
40
|
}, z.core.$strip>;
|
|
46
|
-
/** Simple list for bounded results (scoped to parent entity) */
|
|
47
41
|
export declare const listOf: <T extends z.ZodTypeAny>(schema: T) => z.ZodObject<{
|
|
48
42
|
items: z.ZodArray<T>;
|
|
49
43
|
count: z.ZodNumber;
|
|
@@ -55,20 +49,11 @@ export declare const SuccessWithMessageSchema: z.ZodObject<{
|
|
|
55
49
|
success: z.ZodLiteral<true>;
|
|
56
50
|
message: z.ZodString;
|
|
57
51
|
}, z.core.$strip>;
|
|
58
|
-
/**
|
|
59
|
-
* One tool_call recorded inside a SimulationStep — the underlying browser_op
|
|
60
|
-
* invocation that contributed to the step's action.
|
|
61
|
-
*/
|
|
62
52
|
export declare const ToolCallRecordSchema: z.ZodObject<{
|
|
63
53
|
name: z.ZodString;
|
|
64
54
|
params: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
65
55
|
result: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
66
56
|
}, z.core.$strip>;
|
|
67
|
-
/**
|
|
68
|
-
* Slack incoming-webhook URL validator — shared by the workspace update path
|
|
69
|
-
* and the slack-test endpoint so both surface a 400 BAD_REQUEST for the same
|
|
70
|
-
* malformed input.
|
|
71
|
-
*/
|
|
72
57
|
export declare const SlackWebhookUrlSchema: z.ZodString;
|
|
73
58
|
export declare const GraphEdgeSchema: z.ZodObject<{
|
|
74
59
|
start: z.ZodString;
|
|
@@ -85,11 +70,6 @@ export declare const GraphSectionSchema: z.ZodObject<{
|
|
|
85
70
|
screenshot: z.ZodDefault<z.ZodString>;
|
|
86
71
|
embedding: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodNumber>>>;
|
|
87
72
|
}, z.core.$loose>;
|
|
88
|
-
/**
|
|
89
|
-
* Graph node schema - unique page state observed during simulation.
|
|
90
|
-
* Matches agent's PageNode model (knowledge/graph.py).
|
|
91
|
-
* Uses passthrough() because the agent model may evolve faster than the schema.
|
|
92
|
-
*/
|
|
93
73
|
export declare const GraphNodeSchema: z.ZodObject<{
|
|
94
74
|
id: z.ZodString;
|
|
95
75
|
title: z.ZodString;
|
|
@@ -24,10 +24,6 @@ export declare const SimulationStatusSchema: z.ZodEnum<{
|
|
|
24
24
|
stopped: "stopped";
|
|
25
25
|
}>;
|
|
26
26
|
export type SimulationStatus = z.infer<typeof SimulationStatusSchema>;
|
|
27
|
-
/**
|
|
28
|
-
* Graph generation lifecycle status on a simulation row. Values written by
|
|
29
|
-
* `graphDispatch.ts` and `simulationHooks.ts`.
|
|
30
|
-
*/
|
|
31
27
|
export declare const GraphStatusSchema: z.ZodEnum<{
|
|
32
28
|
completed: "completed";
|
|
33
29
|
failed: "failed";
|
|
@@ -50,10 +46,9 @@ export declare const InstructionTypeSchema: z.ZodEnum<{
|
|
|
50
46
|
}>;
|
|
51
47
|
export type InstructionType = z.infer<typeof InstructionTypeSchema>;
|
|
52
48
|
/**
|
|
53
|
-
* The workspace role vocabulary — `admin` administers
|
|
54
|
-
*
|
|
55
|
-
*
|
|
56
|
-
* `workspace.ts` already imports from this file.
|
|
49
|
+
* The workspace role vocabulary — `admin` administers, `member` does not. One spelling everywhere:
|
|
50
|
+
* DB enum, this contract, the dashboard, and the WorkOS role slug. Declared here (not `workspace.ts`)
|
|
51
|
+
* because `UserEntitySchema` needs it and `workspace.ts` already imports from this file.
|
|
57
52
|
*/
|
|
58
53
|
export declare const WorkspaceMemberRoleSchema: z.ZodEnum<{
|
|
59
54
|
admin: "admin";
|
|
@@ -153,15 +148,19 @@ export declare const PersonaFileEntitySchema: z.ZodObject<{
|
|
|
153
148
|
}, z.core.$strip>;
|
|
154
149
|
export type PersonaFileData = z.infer<typeof PersonaFileEntitySchema>;
|
|
155
150
|
/**
|
|
156
|
-
* Device viewport — the only device dimension (Chrome-only). A simulation runs at exactly
|
|
157
|
-
*
|
|
158
|
-
*
|
|
151
|
+
* Device viewport — the only device dimension (Chrome-only). A simulation runs at exactly one
|
|
152
|
+
* viewport; selecting N viewports fans out into N simulations. Defined here so SSE + simulation +
|
|
153
|
+
* qa contracts can share it.
|
|
159
154
|
*/
|
|
160
155
|
export declare const ViewportNameSchema: z.ZodEnum<{
|
|
161
156
|
desktop: "desktop";
|
|
162
157
|
tablet: "tablet";
|
|
163
158
|
mobile: "mobile";
|
|
164
159
|
}>;
|
|
160
|
+
export declare const QARunCellSchema: z.ZodObject<{
|
|
161
|
+
journey_id: z.ZodNumber;
|
|
162
|
+
persona_id: z.ZodNumber;
|
|
163
|
+
}, z.core.$strip>;
|
|
165
164
|
export type ViewportName = z.infer<typeof ViewportNameSchema>;
|
|
166
165
|
export declare const VIEWPORT_DIMENSIONS: Record<ViewportName, {
|
|
167
166
|
width: number;
|
|
@@ -485,9 +484,8 @@ export declare const StateTriggerEntitySchema: z.ZodObject<{
|
|
|
485
484
|
}, z.core.$strip>;
|
|
486
485
|
export type StateTriggerData = z.infer<typeof StateTriggerEntitySchema>;
|
|
487
486
|
/**
|
|
488
|
-
* Run status —
|
|
489
|
-
*
|
|
490
|
-
* Canonical wire vocabulary shared by QA runs and study runs.
|
|
487
|
+
* Run status — TEXT+CHECK column on qa_run and study_run. `finalizing` = all sims terminal but the
|
|
488
|
+
* run-level fold still completing. Canonical wire vocabulary shared by QA runs and study runs.
|
|
491
489
|
*/
|
|
492
490
|
export declare const RunStatusSchema: z.ZodEnum<{
|
|
493
491
|
created: "created";
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import type { ChatMessage, InstructionType } from '../types';
|
|
2
|
-
/** Widget state persisted to / restored from localStorage; React context is the runtime source of truth. */
|
|
3
2
|
export interface ChatSnapshot {
|
|
4
3
|
messages: ChatMessage[];
|
|
5
4
|
isTaskRunning: boolean;
|
|
@@ -9,7 +8,6 @@ export interface ChatSnapshot {
|
|
|
9
8
|
isMinimized: boolean;
|
|
10
9
|
isLoading: boolean;
|
|
11
10
|
}
|
|
12
|
-
/** localStorage read/write lifecycle for the widget chat context: `persist(snapshot)` from an effect, `restore()` once on mount. */
|
|
13
11
|
export declare class ChatService {
|
|
14
12
|
private static instance;
|
|
15
13
|
private chatId;
|
|
@@ -20,7 +18,6 @@ export declare class ChatService {
|
|
|
20
18
|
createInitialContext(chatId: string): void;
|
|
21
19
|
getInitError(): Error | null;
|
|
22
20
|
restore(): ChatSnapshot;
|
|
23
|
-
/** No-op until a chatId is known. */
|
|
24
21
|
persist(snapshot: ChatSnapshot): void;
|
|
25
22
|
}
|
|
26
23
|
export declare const chatService: ChatService;
|
|
@@ -12,5 +12,4 @@ export declare class ConfigManager {
|
|
|
12
12
|
shouldShowWidget(): boolean;
|
|
13
13
|
}
|
|
14
14
|
export declare const configManager: ConfigManager;
|
|
15
|
-
/** API settings (defaults included) override the base config. */
|
|
16
15
|
export declare function createConfigFromSettings(widgetSettings: WidgetSettingsData, baseConfig?: Partial<MarketrixConfig>): MarketrixConfig;
|
|
@@ -39,7 +39,6 @@ export declare class DomService {
|
|
|
39
39
|
private getElementCoordinates;
|
|
40
40
|
private isStackingContext;
|
|
41
41
|
private calculateGlobalZOrder;
|
|
42
|
-
/** Re-index the live DOM and return an HTML snapshot with data-id attributes injected. */
|
|
43
42
|
getSnapshotHtml(): string;
|
|
44
43
|
getInteractableElements(): Array<{
|
|
45
44
|
index: number;
|
|
@@ -56,10 +55,9 @@ export declare class DomService {
|
|
|
56
55
|
getSequenceForElement(element: Element): number | undefined;
|
|
57
56
|
clearIndex(): void;
|
|
58
57
|
private checkInteractability;
|
|
59
|
-
/** Public interactability check for ShowModeService. */
|
|
60
58
|
checkElementInteractable(element: HTMLElement, index: number): string | null;
|
|
61
59
|
getElementByIndex(index: number): ElementLookupResult;
|
|
62
|
-
/**
|
|
60
|
+
/** Prefer this over the looser getElementByIndex — it also fingerprint-checks the index. */
|
|
63
61
|
getValidatedElement(index: number): ValidatedElementResult;
|
|
64
62
|
}
|
|
65
63
|
export declare const domService: DomService;
|
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
/** Unified widget localStorage (key `marketrix_chat_context`). */
|
|
2
1
|
import type { ChatMessage, InstructionType, MarketrixConfig } from '../types';
|
|
3
|
-
/** Serializable ChatMessage: timestamp as string, no videoStream. */
|
|
4
2
|
type StoredMessage = Omit<ChatMessage, 'videoStream' | 'timestamp'> & {
|
|
5
3
|
timestamp: string;
|
|
6
4
|
};
|
|
@@ -6,5 +6,5 @@ export interface WidgetValidationResult {
|
|
|
6
6
|
widget?: WidgetData;
|
|
7
7
|
application?: ApplicationData;
|
|
8
8
|
}
|
|
9
|
-
/**
|
|
9
|
+
/** mtxId + mtxKey are mandatory: an application id is a guessable integer, so keyless mode authenticated nothing while granting full agent access under the workspace. */
|
|
10
10
|
export declare function validateConfig(config: MarketrixConfig): Promise<WidgetValidationResult>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { type WidgetData, type WidgetSettingsData } from '../sdk';
|
|
2
2
|
export declare function getWidgetSettings(widget: WidgetData): WidgetSettingsData | null;
|
|
3
|
-
/**
|
|
3
|
+
/** Null without credentials — that is the dashboard preview, which has none. */
|
|
4
4
|
export declare function fetchWidgetSettings(mtxId?: string, mtxKey?: string): Promise<WidgetData | null>;
|
|
@@ -35,8 +35,7 @@ export interface MessagePart {
|
|
|
35
35
|
browserToolName?: string;
|
|
36
36
|
hideIcon?: boolean;
|
|
37
37
|
textStyle?: 'default' | 'muted';
|
|
38
|
-
/**
|
|
39
|
-
* chat/response replaces it. */
|
|
38
|
+
/** chat/delta fragments accumulate into this part; the final chat/response replaces it. */
|
|
40
39
|
streaming?: boolean;
|
|
41
40
|
}
|
|
42
41
|
export type WidgetView = 'home' | 'chat';
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import type React from 'react';
|
|
2
2
|
import type { WidgetPosition } from '../types';
|
|
3
3
|
export declare const getPositionClasses: (position: WidgetPosition) => string;
|
|
4
|
-
/** Anchored to the same corner as the launcher button. */
|
|
5
4
|
export declare const getPanelPositionStyle: (position: WidgetPosition) => React.CSSProperties;
|
|
6
5
|
export declare const getAnchorTopLeft: (position: WidgetPosition, vw: number, vh: number, w: number, h: number) => {
|
|
7
6
|
x: number;
|