@marketrix.ai/widget 3.8.471 → 3.8.472
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/blocks/ChatInput.d.ts +4 -3
- package/dist/src/context/sseReducer.d.ts +5 -4
- package/dist/src/design-system/layers.d.ts +2 -1
- package/dist/src/hooks/useScreenShare.d.ts +4 -3
- package/dist/src/services/BrowserToolService.d.ts +0 -1
- package/dist/src/services/ChatService.d.ts +0 -1
- package/dist/src/services/DomService.d.ts +1 -1
- package/dist/src/services/StorageService.d.ts +1 -3
- package/dist/src/services/WidgetService.d.ts +2 -1
- package/dist/src/types/index.d.ts +0 -3
- package/dist/src/utils/chat.d.ts +1 -2
- package/dist/src/utils/dom.d.ts +1 -0
- package/dist/widget.mjs +56 -56
- package/dist/widget.mjs.map +1 -1
- package/package.json +1 -1
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
+
import type { InstructionType } from '../../types';
|
|
2
3
|
import type { IconName } from '../base/icons';
|
|
3
4
|
export interface ChatInputMode {
|
|
4
|
-
id:
|
|
5
|
+
id: InstructionType;
|
|
5
6
|
icon: IconName;
|
|
6
7
|
label: string;
|
|
7
8
|
}
|
|
@@ -10,8 +11,8 @@ export interface ChatInputProps {
|
|
|
10
11
|
onChange: (value: string) => void;
|
|
11
12
|
onSubmit: () => void;
|
|
12
13
|
modes?: ChatInputMode[];
|
|
13
|
-
activeMode?:
|
|
14
|
-
onModeChange?: (mode:
|
|
14
|
+
activeMode?: InstructionType;
|
|
15
|
+
onModeChange?: (mode: InstructionType) => void;
|
|
15
16
|
disabled?: boolean;
|
|
16
17
|
taskRunning?: boolean;
|
|
17
18
|
onStop?: () => void;
|
|
@@ -37,10 +37,11 @@ export declare function reduceError(state: SseState, messageId: string, text: st
|
|
|
37
37
|
/** The transport gave up, so no id-bearing event is coming for whatever is still pending. */
|
|
38
38
|
export declare function reduceTransportFailure(state: SseState, text: string): SseState;
|
|
39
39
|
/**
|
|
40
|
-
*
|
|
41
|
-
*
|
|
42
|
-
*
|
|
43
|
-
* it failed, so without this the bubble sits on "thinking" and the composer
|
|
40
|
+
* The stream can stay healthy (no `StreamGaveUpError`) while a single dispatch's reply never arrives —
|
|
41
|
+
* a dropped correlation, a silent backend failure before it ever acknowledges the request, or a reload
|
|
42
|
+
* into the gap where the api has no tab to push to. `reduceTransportFailure` cannot see that, since
|
|
43
|
+
* nothing told the transport it failed, so without this the bubble sits on "thinking" and the composer
|
|
44
|
+
* stays disabled forever.
|
|
44
45
|
*
|
|
45
46
|
* Only fires on a message that received ZERO signs of life — still `thinking` with no progress line
|
|
46
47
|
* and no streamed text. A `do`/`show` task that is genuinely still running has already advanced past
|
|
@@ -18,11 +18,12 @@ export interface UseScreenShareOptions {
|
|
|
18
18
|
}
|
|
19
19
|
export interface UseScreenShareReturn {
|
|
20
20
|
isScreenSharing: boolean;
|
|
21
|
+
isAwaitingScreenAccess: boolean;
|
|
21
22
|
showScreenAccessDialog: boolean;
|
|
22
23
|
handleScreenAccessDialogAllow: () => Promise<void>;
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
24
|
+
handleScreenAccessDialogDismiss: () => void;
|
|
25
|
+
handleScreenAccessRequestAllow: () => Promise<void>;
|
|
26
|
+
handleScreenAccessRequestDeny: () => void;
|
|
26
27
|
requestScreenAccess: (mode: InstructionType) => void;
|
|
27
28
|
}
|
|
28
29
|
export declare function useScreenShare({ onScreenSharingChange, onStartScreenShareRef, onStopScreenShareRef, onAddMessage, onUpdateMessage, onRemoveMessage, onSendMessage, pendingMessage, setPendingMessage, }: UseScreenShareOptions): UseScreenShareReturn;
|
|
@@ -5,7 +5,7 @@ export interface ValidatedElementResult {
|
|
|
5
5
|
export declare class DomService {
|
|
6
6
|
private index;
|
|
7
7
|
private elementToSequence;
|
|
8
|
-
private
|
|
8
|
+
private generateAnchoredSelector;
|
|
9
9
|
private staleReason;
|
|
10
10
|
private indexInteractableElements;
|
|
11
11
|
/** `data-id` is the whole contract: the agent parses the snapshot for `[data-id]` and reads nothing else off it. */
|
|
@@ -2,8 +2,6 @@ import type { ChatMessage, InstructionType, MarketrixConfig } from '../types';
|
|
|
2
2
|
export type StoredMessage = Omit<ChatMessage, 'videoStream' | 'timestamp'> & {
|
|
3
3
|
timestamp: string;
|
|
4
4
|
};
|
|
5
|
-
/** The durable half of the widget's React state. `isLoading` is deliberately absent — restoring it would
|
|
6
|
-
* leave the FAB glowing for a request that died with the previous page. */
|
|
7
5
|
export interface ChatSnapshot {
|
|
8
6
|
messages: ChatMessage[];
|
|
9
7
|
isTaskRunning: boolean;
|
|
@@ -29,7 +27,7 @@ declare class StorageService {
|
|
|
29
27
|
getChatId(): string | null;
|
|
30
28
|
setChatId(chatId: string): void;
|
|
31
29
|
getCredentialedConfig(): CredentialedConfig | null;
|
|
32
|
-
setConfig(config:
|
|
30
|
+
setConfig(config: CredentialedConfig): void;
|
|
33
31
|
}
|
|
34
32
|
export declare const storageService: StorageService;
|
|
35
33
|
export {};
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { type WidgetSettingsData } from '../sdk';
|
|
2
2
|
import type { MarketrixConfig } from '../types';
|
|
3
|
+
import type { CredentialedConfig } from './StorageService';
|
|
3
4
|
export declare function createConfigFromSettings(widgetSettings: WidgetSettingsData, baseConfig?: Partial<MarketrixConfig>): MarketrixConfig;
|
|
4
5
|
/** Per-tenant scope for browser-local keys: the credential id, else the application id. */
|
|
5
6
|
export declare function tenantScope(config: MarketrixConfig): string;
|
|
6
|
-
export declare function loadWidgetConfig(config: MarketrixConfig): Promise<
|
|
7
|
+
export declare function loadWidgetConfig(config: MarketrixConfig): Promise<CredentialedConfig>;
|
package/dist/src/utils/chat.d.ts
CHANGED
|
@@ -12,9 +12,8 @@ export declare function findMessageForProgress({ messages, isTaskRunning, curren
|
|
|
12
12
|
message: ChatMessage;
|
|
13
13
|
} | null;
|
|
14
14
|
export declare const WAIT_FOR_USER_TOOLS: Set<string>;
|
|
15
|
-
export declare function filterCancellationText(content: string): string;
|
|
16
15
|
export declare function addProgressLine(message: ChatMessage, browserToolName: string, explanation: string): ChatMessage;
|
|
17
|
-
export declare const markProgressLineComplete: (message: ChatMessage) => ChatMessage;
|
|
16
|
+
export declare const markProgressLineComplete: (message: ChatMessage, browserToolName: string) => ChatMessage;
|
|
18
17
|
export declare function markProgressLineFailed(message: ChatMessage, browserToolName: string, error: string): ChatMessage;
|
|
19
18
|
/** Tool id -> the phrase shown in the activity log. Also the allowlist of tools the agent may call. */
|
|
20
19
|
export declare const BROWSER_TOOLS: Map<string, string>;
|
package/dist/src/utils/dom.d.ts
CHANGED