@touchcastllc/napster-companion-api-dev 2.1.0-alpha.1 → 2.1.0-alpha.3
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/README.md +24 -6
- package/lib/constants/events.d.ts +2 -1
- package/lib/index.d.ts +6 -2
- package/lib/index.esm.js +1 -1
- package/lib/index.js +1 -1
- package/lib/index.standalone.js +1 -1
- package/lib/persistence/index.d.ts +9 -0
- package/lib/types/index.d.ts +18 -18
- package/lib/utils/tabStartGuard.d.ts +16 -0
- package/package.json +1 -1
|
@@ -63,6 +63,15 @@ export interface PersistenceController {
|
|
|
63
63
|
* whatever it had underneath.
|
|
64
64
|
*/
|
|
65
65
|
end(): boolean;
|
|
66
|
+
/**
|
|
67
|
+
* Session over, but no reload owed for it (a failed token, a dropped connection, the
|
|
68
|
+
* widget being disposed): reveal the page in place while the frame still shows the
|
|
69
|
+
* page the tab is on; once the visitor has navigated inside the frame, leave like
|
|
70
|
+
* `end()` — a top-level load of the frame's page — because revealing would show the
|
|
71
|
+
* page they started on under the url of the one they moved to (CA-1250). Returns
|
|
72
|
+
* `true` if it navigated.
|
|
73
|
+
*/
|
|
74
|
+
unwrap(): boolean;
|
|
66
75
|
/** Remove the iframe + listeners WITHOUT navigating (for a full teardown/destroy). */
|
|
67
76
|
teardown(): void;
|
|
68
77
|
}
|
package/lib/types/index.d.ts
CHANGED
|
@@ -116,7 +116,11 @@ export type FunctionCallOutputCommand = {
|
|
|
116
116
|
type: DataChannelMessageType.FUNCTION_CALL_OUTPUT;
|
|
117
117
|
data: FunctionCallOutputData;
|
|
118
118
|
};
|
|
119
|
-
|
|
119
|
+
/** Restarts the server's idle timer; the agent is told nothing (CA-1203). */
|
|
120
|
+
export type ResetInactivityTimeoutCommand = {
|
|
121
|
+
type: DataChannelMessageType.RESET_INACTIVITY_TIMEOUT;
|
|
122
|
+
};
|
|
123
|
+
export type DataChannelCommand = SendMessageCommand | CancelCommand | SetSettingsCommand | StartVideoCommand | StopVideoCommand | FunctionCallOutputCommand | ResetInactivityTimeoutCommand;
|
|
120
124
|
export declare const maxInactiveTimeoutDuration = 180000;
|
|
121
125
|
export declare const defaultCountdownDuration = 30;
|
|
122
126
|
/**
|
|
@@ -222,15 +226,6 @@ export interface FeatureConfig {
|
|
|
222
226
|
controls?: {
|
|
223
227
|
enabled: boolean;
|
|
224
228
|
};
|
|
225
|
-
/** Face tracking feature. When enabled, opens the user's camera and runs
|
|
226
|
-
* real-time face mesh detection via TensorFlow.js + MediaPipe. */
|
|
227
|
-
faceTracking?: {
|
|
228
|
-
enabled: boolean;
|
|
229
|
-
/** Detection rate in FPS. Default 15, max 30. */
|
|
230
|
-
fps?: number;
|
|
231
|
-
/** Mouth opening ratio threshold. Default 0.015. */
|
|
232
|
-
talkingThreshold?: number;
|
|
233
|
-
};
|
|
234
229
|
/** The "big card" placeholder (blurred companion photo + spinner) shown
|
|
235
230
|
* behind the entry/loading/permission-pending/permission-blocked states,
|
|
236
231
|
* and the zoom-in grow animation played when the session becomes ready.
|
|
@@ -244,6 +239,19 @@ export interface FeatureConfig {
|
|
|
244
239
|
enabled: boolean;
|
|
245
240
|
};
|
|
246
241
|
}
|
|
242
|
+
/**
|
|
243
|
+
* Face tracking is not part of the public API (CA-1149): nothing here is
|
|
244
|
+
* exported from the package, `FeatureConfig` has no `faceTracking` key and
|
|
245
|
+
* the instance has no start/stop methods. The service stays in the source
|
|
246
|
+
* tree, reachable only from the SDK's own private methods.
|
|
247
|
+
*/
|
|
248
|
+
export interface FaceTrackingFeatureConfig {
|
|
249
|
+
enabled: boolean;
|
|
250
|
+
/** Detection rate in FPS. Default 15, max 30. */
|
|
251
|
+
fps?: number;
|
|
252
|
+
/** Mouth opening ratio threshold. Default 0.015. */
|
|
253
|
+
talkingThreshold?: number;
|
|
254
|
+
}
|
|
247
255
|
/**
|
|
248
256
|
* Configuration for the face tracking service.
|
|
249
257
|
*/
|
|
@@ -608,12 +616,8 @@ export interface NapsterCompanionApiConfig {
|
|
|
608
616
|
onDestroy?: () => void;
|
|
609
617
|
/** Called whenever feature configuration is changed at runtime. */
|
|
610
618
|
onFeaturesUpdate?: (features: FeatureConfig) => void;
|
|
611
|
-
/** Called on each face tracking detection frame with face data (or null if no face detected). */
|
|
612
|
-
onFaceTrackingData?: (data: FaceTrackingData | null) => void;
|
|
613
619
|
/** Called when the screen share state changes (started or stopped). */
|
|
614
620
|
onScreenShareStateChange?: (isSharing: boolean) => void;
|
|
615
|
-
/** Called when a face tracking error occurs (camera denied, model load failure, etc.). */
|
|
616
|
-
onFaceTrackingError?: (error: Error) => void;
|
|
617
621
|
}
|
|
618
622
|
/**
|
|
619
623
|
* Public instance returned by `init`. Use these methods to control the
|
|
@@ -670,10 +674,6 @@ export interface NapsterCompanionApiInstance {
|
|
|
670
674
|
readonly isScreenSharing: boolean;
|
|
671
675
|
/** Whether screen sharing is supported by the browser and enabled in config. */
|
|
672
676
|
readonly isScreenShareSupported: boolean;
|
|
673
|
-
/** Start face tracking (opens camera, loads model, begins detection loop). */
|
|
674
|
-
startFaceTracking: () => Promise<void>;
|
|
675
|
-
/** Stop face tracking (pauses detection, stops camera; model stays loaded for fast restart). */
|
|
676
|
-
stopFaceTracking: () => void;
|
|
677
677
|
/** Mute the avatar's audio output. */
|
|
678
678
|
muteAudio: () => void;
|
|
679
679
|
/** Unmute the avatar's audio output. */
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Keeps Tab inside the widget after a click on empty space in it (CA-1141,
|
|
3
|
+
* tester's comment).
|
|
4
|
+
*
|
|
5
|
+
* Firefox starts sequential focus navigation from the selection, not from
|
|
6
|
+
* the clicked point, and a click on empty space snaps the selection into the
|
|
7
|
+
* nearest leaf, which next to the control bar is a button's icon. A click
|
|
8
|
+
* under the bar put it in "End session", the last button on the page, so the
|
|
9
|
+
* next Tab left the page for the browser's tab strip; a click above it
|
|
10
|
+
* skipped "Mute sound". Chrome and Safari start from the clicked node, where
|
|
11
|
+
* no button holds the selection, so this never acts there.
|
|
12
|
+
*
|
|
13
|
+
* The selection is moved to the start of the button's control group, or just
|
|
14
|
+
* before a button that has none, so Tab reaches the first control.
|
|
15
|
+
*/
|
|
16
|
+
export declare function guardTabStart(root: HTMLElement): void;
|