@asiyst/sdk 0.1.28 → 0.1.29
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.cjs +275 -87
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +44 -2
- package/dist/index.d.ts +44 -2
- package/dist/index.js +275 -88
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -1,5 +1,42 @@
|
|
|
1
1
|
import * as THREE from 'three';
|
|
2
2
|
|
|
3
|
+
interface AvatarLoadingTimestamps {
|
|
4
|
+
sdkInit: number;
|
|
5
|
+
containerCreated: number;
|
|
6
|
+
configRetrieved: number;
|
|
7
|
+
assetRequestStart: number;
|
|
8
|
+
assetDownloadComplete: number;
|
|
9
|
+
parseAndDecodeComplete: number;
|
|
10
|
+
sceneInitComplete: number;
|
|
11
|
+
firstRenderedFrame: number;
|
|
12
|
+
firstVisibleCorrectlyFramed: number;
|
|
13
|
+
}
|
|
14
|
+
interface AvatarPerformanceMetrics {
|
|
15
|
+
timestamps: AvatarLoadingTimestamps;
|
|
16
|
+
durations: {
|
|
17
|
+
configRetrievalMs: number;
|
|
18
|
+
downloadDurationMs: number;
|
|
19
|
+
parseDurationMs: number;
|
|
20
|
+
sceneInitDurationMs: number;
|
|
21
|
+
firstRenderDurationMs: number;
|
|
22
|
+
timeToFirstVisibleMs: number;
|
|
23
|
+
};
|
|
24
|
+
asset: {
|
|
25
|
+
format?: string;
|
|
26
|
+
byteSize?: number;
|
|
27
|
+
meshCount?: number;
|
|
28
|
+
vertexCount?: number;
|
|
29
|
+
animationCount?: number;
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
declare class AvatarMetricsTracker {
|
|
33
|
+
private readonly timestamps;
|
|
34
|
+
private assetInfo;
|
|
35
|
+
record<K extends keyof AvatarLoadingTimestamps>(step: K, timestamp?: number): void;
|
|
36
|
+
setAssetInfo(info: Partial<AvatarPerformanceMetrics["asset"]>): void;
|
|
37
|
+
getMetrics(): AvatarPerformanceMetrics | null;
|
|
38
|
+
}
|
|
39
|
+
|
|
3
40
|
interface AsiystEventMap {
|
|
4
41
|
"asiyst:initialized": {
|
|
5
42
|
projectId: string;
|
|
@@ -286,6 +323,7 @@ declare const Asiyst: {
|
|
|
286
323
|
getConnectionStatus(): "connected" | "disconnected" | "offline";
|
|
287
324
|
getVerificationStatus(): "connected" | "inactive" | "not_detected" | "error";
|
|
288
325
|
isRuntimeConnected(): boolean;
|
|
326
|
+
getAvatarPerformanceMetrics(): AvatarPerformanceMetrics | null;
|
|
289
327
|
avatar: {
|
|
290
328
|
show(): void;
|
|
291
329
|
hide(): void;
|
|
@@ -508,6 +546,7 @@ interface FbxMountOptions {
|
|
|
508
546
|
config?: ProjectConfig;
|
|
509
547
|
width?: number;
|
|
510
548
|
height?: number;
|
|
549
|
+
metricsTracker?: AvatarMetricsTracker;
|
|
511
550
|
}
|
|
512
551
|
declare class FbxRenderer {
|
|
513
552
|
private canvas;
|
|
@@ -527,6 +566,7 @@ declare class FbxRenderer {
|
|
|
527
566
|
private currentPose;
|
|
528
567
|
private initialRenderCompleted;
|
|
529
568
|
private resizeListener?;
|
|
569
|
+
private baseScale;
|
|
530
570
|
mount(container: HTMLElement, asset: LoadedFbxAsset | LoadedGlbAsset, options?: FbxMountOptions): Promise<FbxRenderMetrics>;
|
|
531
571
|
setFacing(direction: "left" | "right"): void;
|
|
532
572
|
setPose(pose: AvatarPose): void;
|
|
@@ -576,11 +616,13 @@ declare class CssAvatarRenderer implements AvatarRenderer {
|
|
|
576
616
|
private activeAssetUrl;
|
|
577
617
|
private lastErrorMessage;
|
|
578
618
|
private renderMetrics;
|
|
619
|
+
private metricsTracker?;
|
|
620
|
+
setMetricsTracker(tracker: AvatarMetricsTracker): void;
|
|
579
621
|
mount(container: HTMLElement, config: ProjectConfig): void;
|
|
580
622
|
unmount(): void;
|
|
581
623
|
applyConfig(config: ProjectConfig): void;
|
|
582
624
|
setPanelOpen(open: boolean): void;
|
|
583
|
-
loadAsset(config: ProjectConfig): Promise<boolean>;
|
|
625
|
+
loadAsset(config: ProjectConfig, metricsTracker?: AvatarMetricsTracker): Promise<boolean>;
|
|
584
626
|
renderLoader(): void;
|
|
585
627
|
private renderLoadedAsset;
|
|
586
628
|
private renderFallback;
|
|
@@ -611,4 +653,4 @@ declare class CssAvatarRenderer implements AvatarRenderer {
|
|
|
611
653
|
getNameTag(): HTMLElement | undefined;
|
|
612
654
|
}
|
|
613
655
|
|
|
614
|
-
export { type ActionKind, ActionNotAllowedError, Asiyst, AsiystError, type AsiystEventMap, type AsiystEventName, AssetLoader, type AssistantMode, AuthenticationError, type AvatarAnimation, type AvatarBranding, ConfigurationError, CssAvatarRenderer, FbxRenderer, type HighlightStyle, type InitOptions, InitializationError, type MappedElement, NetworkError, type ProjectConfig, SDK_VERSION, type TargetInput, TargetNotFoundError, type TargetRef, type TaskDefinition, TaskExecutionError, TaskStatus, type TaskStep, type WebsiteMapSnapshot, type WorkflowDefinition, anchorToViewport, canNavigateTo, canTransition, computeAvatarDestination, evaluateActionPermission, fallbackConfig, isActionAllowed, isSafeSelector, normalizeProjectConfig, sanitizeText, validateInitOptions, validateWebsiteDomain };
|
|
656
|
+
export { type ActionKind, ActionNotAllowedError, Asiyst, AsiystError, type AsiystEventMap, type AsiystEventName, AssetLoader, type AssistantMode, AuthenticationError, type AvatarAnimation, type AvatarBranding, type AvatarLoadingTimestamps, AvatarMetricsTracker, type AvatarPerformanceMetrics, ConfigurationError, CssAvatarRenderer, FbxRenderer, type HighlightStyle, type InitOptions, InitializationError, type MappedElement, NetworkError, type ProjectConfig, SDK_VERSION, type TargetInput, TargetNotFoundError, type TargetRef, type TaskDefinition, TaskExecutionError, TaskStatus, type TaskStep, type WebsiteMapSnapshot, type WorkflowDefinition, anchorToViewport, canNavigateTo, canTransition, computeAvatarDestination, evaluateActionPermission, fallbackConfig, isActionAllowed, isSafeSelector, normalizeProjectConfig, sanitizeText, validateInitOptions, validateWebsiteDomain };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,42 @@
|
|
|
1
1
|
import * as THREE from 'three';
|
|
2
2
|
|
|
3
|
+
interface AvatarLoadingTimestamps {
|
|
4
|
+
sdkInit: number;
|
|
5
|
+
containerCreated: number;
|
|
6
|
+
configRetrieved: number;
|
|
7
|
+
assetRequestStart: number;
|
|
8
|
+
assetDownloadComplete: number;
|
|
9
|
+
parseAndDecodeComplete: number;
|
|
10
|
+
sceneInitComplete: number;
|
|
11
|
+
firstRenderedFrame: number;
|
|
12
|
+
firstVisibleCorrectlyFramed: number;
|
|
13
|
+
}
|
|
14
|
+
interface AvatarPerformanceMetrics {
|
|
15
|
+
timestamps: AvatarLoadingTimestamps;
|
|
16
|
+
durations: {
|
|
17
|
+
configRetrievalMs: number;
|
|
18
|
+
downloadDurationMs: number;
|
|
19
|
+
parseDurationMs: number;
|
|
20
|
+
sceneInitDurationMs: number;
|
|
21
|
+
firstRenderDurationMs: number;
|
|
22
|
+
timeToFirstVisibleMs: number;
|
|
23
|
+
};
|
|
24
|
+
asset: {
|
|
25
|
+
format?: string;
|
|
26
|
+
byteSize?: number;
|
|
27
|
+
meshCount?: number;
|
|
28
|
+
vertexCount?: number;
|
|
29
|
+
animationCount?: number;
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
declare class AvatarMetricsTracker {
|
|
33
|
+
private readonly timestamps;
|
|
34
|
+
private assetInfo;
|
|
35
|
+
record<K extends keyof AvatarLoadingTimestamps>(step: K, timestamp?: number): void;
|
|
36
|
+
setAssetInfo(info: Partial<AvatarPerformanceMetrics["asset"]>): void;
|
|
37
|
+
getMetrics(): AvatarPerformanceMetrics | null;
|
|
38
|
+
}
|
|
39
|
+
|
|
3
40
|
interface AsiystEventMap {
|
|
4
41
|
"asiyst:initialized": {
|
|
5
42
|
projectId: string;
|
|
@@ -286,6 +323,7 @@ declare const Asiyst: {
|
|
|
286
323
|
getConnectionStatus(): "connected" | "disconnected" | "offline";
|
|
287
324
|
getVerificationStatus(): "connected" | "inactive" | "not_detected" | "error";
|
|
288
325
|
isRuntimeConnected(): boolean;
|
|
326
|
+
getAvatarPerformanceMetrics(): AvatarPerformanceMetrics | null;
|
|
289
327
|
avatar: {
|
|
290
328
|
show(): void;
|
|
291
329
|
hide(): void;
|
|
@@ -508,6 +546,7 @@ interface FbxMountOptions {
|
|
|
508
546
|
config?: ProjectConfig;
|
|
509
547
|
width?: number;
|
|
510
548
|
height?: number;
|
|
549
|
+
metricsTracker?: AvatarMetricsTracker;
|
|
511
550
|
}
|
|
512
551
|
declare class FbxRenderer {
|
|
513
552
|
private canvas;
|
|
@@ -527,6 +566,7 @@ declare class FbxRenderer {
|
|
|
527
566
|
private currentPose;
|
|
528
567
|
private initialRenderCompleted;
|
|
529
568
|
private resizeListener?;
|
|
569
|
+
private baseScale;
|
|
530
570
|
mount(container: HTMLElement, asset: LoadedFbxAsset | LoadedGlbAsset, options?: FbxMountOptions): Promise<FbxRenderMetrics>;
|
|
531
571
|
setFacing(direction: "left" | "right"): void;
|
|
532
572
|
setPose(pose: AvatarPose): void;
|
|
@@ -576,11 +616,13 @@ declare class CssAvatarRenderer implements AvatarRenderer {
|
|
|
576
616
|
private activeAssetUrl;
|
|
577
617
|
private lastErrorMessage;
|
|
578
618
|
private renderMetrics;
|
|
619
|
+
private metricsTracker?;
|
|
620
|
+
setMetricsTracker(tracker: AvatarMetricsTracker): void;
|
|
579
621
|
mount(container: HTMLElement, config: ProjectConfig): void;
|
|
580
622
|
unmount(): void;
|
|
581
623
|
applyConfig(config: ProjectConfig): void;
|
|
582
624
|
setPanelOpen(open: boolean): void;
|
|
583
|
-
loadAsset(config: ProjectConfig): Promise<boolean>;
|
|
625
|
+
loadAsset(config: ProjectConfig, metricsTracker?: AvatarMetricsTracker): Promise<boolean>;
|
|
584
626
|
renderLoader(): void;
|
|
585
627
|
private renderLoadedAsset;
|
|
586
628
|
private renderFallback;
|
|
@@ -611,4 +653,4 @@ declare class CssAvatarRenderer implements AvatarRenderer {
|
|
|
611
653
|
getNameTag(): HTMLElement | undefined;
|
|
612
654
|
}
|
|
613
655
|
|
|
614
|
-
export { type ActionKind, ActionNotAllowedError, Asiyst, AsiystError, type AsiystEventMap, type AsiystEventName, AssetLoader, type AssistantMode, AuthenticationError, type AvatarAnimation, type AvatarBranding, ConfigurationError, CssAvatarRenderer, FbxRenderer, type HighlightStyle, type InitOptions, InitializationError, type MappedElement, NetworkError, type ProjectConfig, SDK_VERSION, type TargetInput, TargetNotFoundError, type TargetRef, type TaskDefinition, TaskExecutionError, TaskStatus, type TaskStep, type WebsiteMapSnapshot, type WorkflowDefinition, anchorToViewport, canNavigateTo, canTransition, computeAvatarDestination, evaluateActionPermission, fallbackConfig, isActionAllowed, isSafeSelector, normalizeProjectConfig, sanitizeText, validateInitOptions, validateWebsiteDomain };
|
|
656
|
+
export { type ActionKind, ActionNotAllowedError, Asiyst, AsiystError, type AsiystEventMap, type AsiystEventName, AssetLoader, type AssistantMode, AuthenticationError, type AvatarAnimation, type AvatarBranding, type AvatarLoadingTimestamps, AvatarMetricsTracker, type AvatarPerformanceMetrics, ConfigurationError, CssAvatarRenderer, FbxRenderer, type HighlightStyle, type InitOptions, InitializationError, type MappedElement, NetworkError, type ProjectConfig, SDK_VERSION, type TargetInput, TargetNotFoundError, type TargetRef, type TaskDefinition, TaskExecutionError, TaskStatus, type TaskStep, type WebsiteMapSnapshot, type WorkflowDefinition, anchorToViewport, canNavigateTo, canTransition, computeAvatarDestination, evaluateActionPermission, fallbackConfig, isActionAllowed, isSafeSelector, normalizeProjectConfig, sanitizeText, validateInitOptions, validateWebsiteDomain };
|