@livelayer/react 0.23.5 → 0.25.0
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/index.d.ts +77 -0
- package/dist/index.js +4 -3
- package/dist/index.mjs +2834 -2138
- package/package.json +2 -1
package/dist/index.d.ts
CHANGED
|
@@ -82,6 +82,15 @@ export declare interface AgentInfo {
|
|
|
82
82
|
* does the work).
|
|
83
83
|
*/
|
|
84
84
|
autoPageContext?: boolean;
|
|
85
|
+
/**
|
|
86
|
+
* When true, hide the "Powered by LiveLayer" badge for this agent — set
|
|
87
|
+
* server-side for premium / white-label customers (e.g. derived from the
|
|
88
|
+
* owning organization's plan). The widget folds this into
|
|
89
|
+
* `branding.hideBranding`.
|
|
90
|
+
*/
|
|
91
|
+
hideBranding?: boolean;
|
|
92
|
+
/** Page-vision capture config served by the agent-info endpoint (0.25.0+). */
|
|
93
|
+
pageVision?: PageVisionClientConfig | null;
|
|
85
94
|
}
|
|
86
95
|
|
|
87
96
|
export declare interface AgentInfoHandle {
|
|
@@ -393,6 +402,15 @@ export declare interface AvatarWidgetProps {
|
|
|
393
402
|
* "read_page" — request_page_context + request_routes
|
|
394
403
|
*/
|
|
395
404
|
capabilities?: AgentCapability[];
|
|
405
|
+
/**
|
|
406
|
+
* Page vision: capture page screenshots for the agent at flow start /
|
|
407
|
+
* route change / step change. Defaults to the server-side config from
|
|
408
|
+
* the agent-info endpoint; pass null to force-disable on this host.
|
|
409
|
+
* NOTE: must be referentially stable across renders — an inline object
|
|
410
|
+
* literal rebuilds the capture controller every render and silently
|
|
411
|
+
* disables dedup/republish. Prefer the server config or a useMemo/const.
|
|
412
|
+
*/
|
|
413
|
+
pageVision?: PageVisionClientConfig | null;
|
|
396
414
|
onConnect?: () => void;
|
|
397
415
|
onDisconnect?: () => void;
|
|
398
416
|
onTranscript?: (entries: TranscriptEntry[]) => void;
|
|
@@ -459,6 +477,12 @@ export declare interface BrandingConfig {
|
|
|
459
477
|
accentColor?: string;
|
|
460
478
|
backgroundColor?: string;
|
|
461
479
|
textColor?: string;
|
|
480
|
+
/**
|
|
481
|
+
* Hide the "Powered by LiveLayer" badge (premium / white-label). The host may
|
|
482
|
+
* set this directly, or it's folded in from the server-derived
|
|
483
|
+
* `AgentInfo.hideBranding` (e.g. the owning org's plan) — see AvatarWidget.
|
|
484
|
+
*/
|
|
485
|
+
hideBranding?: boolean;
|
|
462
486
|
}
|
|
463
487
|
|
|
464
488
|
export declare interface CameraStateHandle {
|
|
@@ -479,6 +503,8 @@ export declare interface CameraStateHandle {
|
|
|
479
503
|
clearError: () => void;
|
|
480
504
|
}
|
|
481
505
|
|
|
506
|
+
export declare type CaptureReason = "flow_start" | "route_change" | "step_change";
|
|
507
|
+
|
|
482
508
|
export { clearFieldRegistry }
|
|
483
509
|
|
|
484
510
|
export declare function clearPageContextCache(): void;
|
|
@@ -919,6 +945,26 @@ export declare interface PageContext {
|
|
|
919
945
|
flow?: FlowContext;
|
|
920
946
|
}
|
|
921
947
|
|
|
948
|
+
export declare interface PageVisionClientConfig {
|
|
949
|
+
enabled: boolean;
|
|
950
|
+
captureOn: CaptureReason[];
|
|
951
|
+
maxWidth: number;
|
|
952
|
+
jpegQuality: number;
|
|
953
|
+
upload: PageVisionUploadConfig;
|
|
954
|
+
}
|
|
955
|
+
|
|
956
|
+
/**
|
|
957
|
+
* Direct-to-Supabase Storage upload over plain fetch — no supabase-js in
|
|
958
|
+
* the widget bundle. Keys are random UUIDs (unguessable; spec §5) and the
|
|
959
|
+
* bucket has an hourly server-side purge, so the public URL is a
|
|
960
|
+
* short-lived, signed-ish link.
|
|
961
|
+
*/
|
|
962
|
+
declare interface PageVisionUploadConfig {
|
|
963
|
+
supabaseUrl: string;
|
|
964
|
+
anonKey: string;
|
|
965
|
+
bucket: string;
|
|
966
|
+
}
|
|
967
|
+
|
|
922
968
|
declare interface Props {
|
|
923
969
|
children: ReactNode;
|
|
924
970
|
/** Callback fired when an error is caught. Useful for telemetry. */
|
|
@@ -1107,6 +1153,37 @@ export declare function useMediaDevices(): MediaDevicesHandle;
|
|
|
1107
1153
|
|
|
1108
1154
|
export declare function useMicrophoneState(opts?: MicrophoneStateOptions): MicrophoneStateHandle;
|
|
1109
1155
|
|
|
1156
|
+
/**
|
|
1157
|
+
* Fires page captures on session connect (flow_start), route change, and
|
|
1158
|
+
* flow step change. Captures wait one animation frame (so the new view
|
|
1159
|
+
* has painted) plus an idle slot (so the html-to-image clone pass doesn't
|
|
1160
|
+
* jank the transition). All real logic lives in PageVisionController.
|
|
1161
|
+
*/
|
|
1162
|
+
export declare function usePageVision(args: UsePageVisionArgs): void;
|
|
1163
|
+
|
|
1164
|
+
declare interface UsePageVisionArgs {
|
|
1165
|
+
/**
|
|
1166
|
+
* Page-vision config from agent info (null/undefined until fetched).
|
|
1167
|
+
* Must be referentially stable across renders — an inline literal
|
|
1168
|
+
* rebuilds the controller every render and silently kills dedup and
|
|
1169
|
+
* republishLast.
|
|
1170
|
+
*/
|
|
1171
|
+
config: PageVisionClientConfig | null | undefined;
|
|
1172
|
+
connected: boolean;
|
|
1173
|
+
pathname: string;
|
|
1174
|
+
/** Latest flow.currentStep the widget observed (multi-step forms). */
|
|
1175
|
+
currentStep: number | undefined;
|
|
1176
|
+
publishData: (payload: Record<string, unknown>) => void;
|
|
1177
|
+
/**
|
|
1178
|
+
* Carry-forward 1: becomes true once the agent is ready to receive
|
|
1179
|
+
* messages (first listening/speaking state). On the first false→true
|
|
1180
|
+
* transition of each connect cycle, republishLast() is called so the
|
|
1181
|
+
* worker receives the flow_start envelope even if its listener
|
|
1182
|
+
* registered after the original publish.
|
|
1183
|
+
*/
|
|
1184
|
+
agentReady: boolean;
|
|
1185
|
+
}
|
|
1186
|
+
|
|
1110
1187
|
/**
|
|
1111
1188
|
* Returns the current pathname, reactive to SPA navigation.
|
|
1112
1189
|
* Pass `controlledPathname` to skip internal detection (recommended for
|