@asiyst/sdk 0.1.22 → 0.1.25
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 +632 -207
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +42 -10
- package/dist/index.d.ts +42 -10
- package/dist/index.js +632 -207
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -82,6 +82,17 @@ interface AsiystEventMap {
|
|
|
82
82
|
"asiyst:conversation:closed": {
|
|
83
83
|
conversationId: string;
|
|
84
84
|
};
|
|
85
|
+
"asiyst:runtime:connected": {
|
|
86
|
+
projectId: string;
|
|
87
|
+
status: "connected" | "verified";
|
|
88
|
+
environment?: string;
|
|
89
|
+
origin?: string;
|
|
90
|
+
};
|
|
91
|
+
"asiyst:runtime:disconnected": {
|
|
92
|
+
projectId: string;
|
|
93
|
+
reason: string;
|
|
94
|
+
status?: string;
|
|
95
|
+
};
|
|
85
96
|
"asiyst:error": {
|
|
86
97
|
code: string;
|
|
87
98
|
message: string;
|
|
@@ -107,6 +118,7 @@ interface InitOptions {
|
|
|
107
118
|
avatarId?: string;
|
|
108
119
|
position?: AnchorPosition;
|
|
109
120
|
apiBaseUrl?: string;
|
|
121
|
+
environment?: "production" | "development" | "preview";
|
|
110
122
|
mode?: AssistantMode;
|
|
111
123
|
allowedActions?: ActionKind[];
|
|
112
124
|
observeHistory?: boolean;
|
|
@@ -259,6 +271,7 @@ declare const Asiyst: {
|
|
|
259
271
|
getConfig(): ProjectConfig;
|
|
260
272
|
getConnectionStatus(): "connected" | "disconnected" | "offline";
|
|
261
273
|
getVerificationStatus(): "connected" | "inactive" | "not_detected" | "error";
|
|
274
|
+
isRuntimeConnected(): boolean;
|
|
262
275
|
avatar: {
|
|
263
276
|
show(): void;
|
|
264
277
|
hide(): void;
|
|
@@ -470,6 +483,12 @@ interface FbxRenderMetrics {
|
|
|
470
483
|
vertexCount: number;
|
|
471
484
|
animationCount: number;
|
|
472
485
|
}
|
|
486
|
+
interface FbxMountOptions {
|
|
487
|
+
accentColor?: string;
|
|
488
|
+
config?: ProjectConfig;
|
|
489
|
+
width?: number;
|
|
490
|
+
height?: number;
|
|
491
|
+
}
|
|
473
492
|
declare class FbxRenderer {
|
|
474
493
|
private canvas;
|
|
475
494
|
private renderer;
|
|
@@ -477,15 +496,15 @@ declare class FbxRenderer {
|
|
|
477
496
|
private camera;
|
|
478
497
|
private modelRoot;
|
|
479
498
|
private mixer;
|
|
499
|
+
private allAnimations;
|
|
500
|
+
private currentAction;
|
|
480
501
|
private animFrameId;
|
|
481
502
|
private lastTime;
|
|
482
503
|
private facing;
|
|
483
504
|
private currentPose;
|
|
484
505
|
private initialRenderCompleted;
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
config?: ProjectConfig;
|
|
488
|
-
}): Promise<FbxRenderMetrics>;
|
|
506
|
+
private resizeListener?;
|
|
507
|
+
mount(container: HTMLElement, asset: LoadedFbxAsset | LoadedGlbAsset, options?: FbxMountOptions): Promise<FbxRenderMetrics>;
|
|
489
508
|
setFacing(direction: "left" | "right"): void;
|
|
490
509
|
setPose(pose: AvatarPose): void;
|
|
491
510
|
isRendered(): boolean;
|
|
@@ -496,6 +515,10 @@ declare class FbxRenderer {
|
|
|
496
515
|
getCanvas(): HTMLCanvasElement | null;
|
|
497
516
|
private startLoop;
|
|
498
517
|
destroy(): void;
|
|
518
|
+
handleResize(): void;
|
|
519
|
+
getCamera(): THREE.PerspectiveCamera | null;
|
|
520
|
+
getModelRoot(): THREE.Group | null;
|
|
521
|
+
getMixer(): THREE.AnimationMixer | null;
|
|
499
522
|
}
|
|
500
523
|
|
|
501
524
|
type AvatarRenderState = "idle" | "loading" | "ready" | "error";
|
|
@@ -504,13 +527,18 @@ declare class CssAvatarRenderer implements AvatarRenderer {
|
|
|
504
527
|
private figure;
|
|
505
528
|
private viewport;
|
|
506
529
|
private bubble;
|
|
507
|
-
private
|
|
530
|
+
private nameTagEl;
|
|
531
|
+
private nameTextEl;
|
|
532
|
+
private statusTextEl;
|
|
533
|
+
private chatActionBtn;
|
|
508
534
|
private size;
|
|
509
535
|
private hidden;
|
|
510
536
|
private facing;
|
|
511
537
|
private pose;
|
|
512
538
|
private accentColor;
|
|
513
539
|
private avatarName;
|
|
540
|
+
private isPanelOpen;
|
|
541
|
+
onOpenChat?: () => void;
|
|
514
542
|
private readonly assetLoader;
|
|
515
543
|
private fbxRenderer;
|
|
516
544
|
private renderState;
|
|
@@ -523,6 +551,7 @@ declare class CssAvatarRenderer implements AvatarRenderer {
|
|
|
523
551
|
mount(container: HTMLElement, config: ProjectConfig): void;
|
|
524
552
|
unmount(): void;
|
|
525
553
|
applyConfig(config: ProjectConfig): void;
|
|
554
|
+
setPanelOpen(open: boolean): void;
|
|
526
555
|
loadAsset(config: ProjectConfig): Promise<boolean>;
|
|
527
556
|
private renderLoader;
|
|
528
557
|
private renderLoadedAsset;
|
|
@@ -530,7 +559,6 @@ declare class CssAvatarRenderer implements AvatarRenderer {
|
|
|
530
559
|
setPosition(x: number, y: number, animate: boolean): void;
|
|
531
560
|
setFacing(direction: "left" | "right"): void;
|
|
532
561
|
setPose(pose: AvatarPose): void;
|
|
533
|
-
private syncTransform;
|
|
534
562
|
setSpeech(text: string | null): void;
|
|
535
563
|
getSize(): {
|
|
536
564
|
width: number;
|
|
@@ -538,16 +566,20 @@ declare class CssAvatarRenderer implements AvatarRenderer {
|
|
|
538
566
|
};
|
|
539
567
|
setHidden(hidden: boolean): void;
|
|
540
568
|
isHidden(): boolean;
|
|
541
|
-
|
|
542
|
-
getViewport(): HTMLElement | undefined;
|
|
569
|
+
getRenderState(): AvatarRenderState;
|
|
543
570
|
isAssetLoaded(): boolean;
|
|
544
|
-
|
|
571
|
+
getViewport(): HTMLElement | undefined;
|
|
572
|
+
isFallback(): boolean;
|
|
545
573
|
isFallbackActive(): boolean;
|
|
546
|
-
|
|
574
|
+
isRendered(): boolean;
|
|
547
575
|
getLoadedFormat(): string | undefined;
|
|
548
576
|
getAssetUrl(): string | undefined;
|
|
549
577
|
getLastError(): string | undefined;
|
|
550
578
|
getMetrics(): FbxRenderMetrics | undefined;
|
|
579
|
+
getFigure(): HTMLElement | undefined;
|
|
580
|
+
getFbxRenderer(): FbxRenderer | null;
|
|
581
|
+
getChatActionBtn(): HTMLButtonElement | undefined;
|
|
582
|
+
getNameTag(): HTMLElement | undefined;
|
|
551
583
|
}
|
|
552
584
|
|
|
553
585
|
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 };
|
package/dist/index.d.ts
CHANGED
|
@@ -82,6 +82,17 @@ interface AsiystEventMap {
|
|
|
82
82
|
"asiyst:conversation:closed": {
|
|
83
83
|
conversationId: string;
|
|
84
84
|
};
|
|
85
|
+
"asiyst:runtime:connected": {
|
|
86
|
+
projectId: string;
|
|
87
|
+
status: "connected" | "verified";
|
|
88
|
+
environment?: string;
|
|
89
|
+
origin?: string;
|
|
90
|
+
};
|
|
91
|
+
"asiyst:runtime:disconnected": {
|
|
92
|
+
projectId: string;
|
|
93
|
+
reason: string;
|
|
94
|
+
status?: string;
|
|
95
|
+
};
|
|
85
96
|
"asiyst:error": {
|
|
86
97
|
code: string;
|
|
87
98
|
message: string;
|
|
@@ -107,6 +118,7 @@ interface InitOptions {
|
|
|
107
118
|
avatarId?: string;
|
|
108
119
|
position?: AnchorPosition;
|
|
109
120
|
apiBaseUrl?: string;
|
|
121
|
+
environment?: "production" | "development" | "preview";
|
|
110
122
|
mode?: AssistantMode;
|
|
111
123
|
allowedActions?: ActionKind[];
|
|
112
124
|
observeHistory?: boolean;
|
|
@@ -259,6 +271,7 @@ declare const Asiyst: {
|
|
|
259
271
|
getConfig(): ProjectConfig;
|
|
260
272
|
getConnectionStatus(): "connected" | "disconnected" | "offline";
|
|
261
273
|
getVerificationStatus(): "connected" | "inactive" | "not_detected" | "error";
|
|
274
|
+
isRuntimeConnected(): boolean;
|
|
262
275
|
avatar: {
|
|
263
276
|
show(): void;
|
|
264
277
|
hide(): void;
|
|
@@ -470,6 +483,12 @@ interface FbxRenderMetrics {
|
|
|
470
483
|
vertexCount: number;
|
|
471
484
|
animationCount: number;
|
|
472
485
|
}
|
|
486
|
+
interface FbxMountOptions {
|
|
487
|
+
accentColor?: string;
|
|
488
|
+
config?: ProjectConfig;
|
|
489
|
+
width?: number;
|
|
490
|
+
height?: number;
|
|
491
|
+
}
|
|
473
492
|
declare class FbxRenderer {
|
|
474
493
|
private canvas;
|
|
475
494
|
private renderer;
|
|
@@ -477,15 +496,15 @@ declare class FbxRenderer {
|
|
|
477
496
|
private camera;
|
|
478
497
|
private modelRoot;
|
|
479
498
|
private mixer;
|
|
499
|
+
private allAnimations;
|
|
500
|
+
private currentAction;
|
|
480
501
|
private animFrameId;
|
|
481
502
|
private lastTime;
|
|
482
503
|
private facing;
|
|
483
504
|
private currentPose;
|
|
484
505
|
private initialRenderCompleted;
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
config?: ProjectConfig;
|
|
488
|
-
}): Promise<FbxRenderMetrics>;
|
|
506
|
+
private resizeListener?;
|
|
507
|
+
mount(container: HTMLElement, asset: LoadedFbxAsset | LoadedGlbAsset, options?: FbxMountOptions): Promise<FbxRenderMetrics>;
|
|
489
508
|
setFacing(direction: "left" | "right"): void;
|
|
490
509
|
setPose(pose: AvatarPose): void;
|
|
491
510
|
isRendered(): boolean;
|
|
@@ -496,6 +515,10 @@ declare class FbxRenderer {
|
|
|
496
515
|
getCanvas(): HTMLCanvasElement | null;
|
|
497
516
|
private startLoop;
|
|
498
517
|
destroy(): void;
|
|
518
|
+
handleResize(): void;
|
|
519
|
+
getCamera(): THREE.PerspectiveCamera | null;
|
|
520
|
+
getModelRoot(): THREE.Group | null;
|
|
521
|
+
getMixer(): THREE.AnimationMixer | null;
|
|
499
522
|
}
|
|
500
523
|
|
|
501
524
|
type AvatarRenderState = "idle" | "loading" | "ready" | "error";
|
|
@@ -504,13 +527,18 @@ declare class CssAvatarRenderer implements AvatarRenderer {
|
|
|
504
527
|
private figure;
|
|
505
528
|
private viewport;
|
|
506
529
|
private bubble;
|
|
507
|
-
private
|
|
530
|
+
private nameTagEl;
|
|
531
|
+
private nameTextEl;
|
|
532
|
+
private statusTextEl;
|
|
533
|
+
private chatActionBtn;
|
|
508
534
|
private size;
|
|
509
535
|
private hidden;
|
|
510
536
|
private facing;
|
|
511
537
|
private pose;
|
|
512
538
|
private accentColor;
|
|
513
539
|
private avatarName;
|
|
540
|
+
private isPanelOpen;
|
|
541
|
+
onOpenChat?: () => void;
|
|
514
542
|
private readonly assetLoader;
|
|
515
543
|
private fbxRenderer;
|
|
516
544
|
private renderState;
|
|
@@ -523,6 +551,7 @@ declare class CssAvatarRenderer implements AvatarRenderer {
|
|
|
523
551
|
mount(container: HTMLElement, config: ProjectConfig): void;
|
|
524
552
|
unmount(): void;
|
|
525
553
|
applyConfig(config: ProjectConfig): void;
|
|
554
|
+
setPanelOpen(open: boolean): void;
|
|
526
555
|
loadAsset(config: ProjectConfig): Promise<boolean>;
|
|
527
556
|
private renderLoader;
|
|
528
557
|
private renderLoadedAsset;
|
|
@@ -530,7 +559,6 @@ declare class CssAvatarRenderer implements AvatarRenderer {
|
|
|
530
559
|
setPosition(x: number, y: number, animate: boolean): void;
|
|
531
560
|
setFacing(direction: "left" | "right"): void;
|
|
532
561
|
setPose(pose: AvatarPose): void;
|
|
533
|
-
private syncTransform;
|
|
534
562
|
setSpeech(text: string | null): void;
|
|
535
563
|
getSize(): {
|
|
536
564
|
width: number;
|
|
@@ -538,16 +566,20 @@ declare class CssAvatarRenderer implements AvatarRenderer {
|
|
|
538
566
|
};
|
|
539
567
|
setHidden(hidden: boolean): void;
|
|
540
568
|
isHidden(): boolean;
|
|
541
|
-
|
|
542
|
-
getViewport(): HTMLElement | undefined;
|
|
569
|
+
getRenderState(): AvatarRenderState;
|
|
543
570
|
isAssetLoaded(): boolean;
|
|
544
|
-
|
|
571
|
+
getViewport(): HTMLElement | undefined;
|
|
572
|
+
isFallback(): boolean;
|
|
545
573
|
isFallbackActive(): boolean;
|
|
546
|
-
|
|
574
|
+
isRendered(): boolean;
|
|
547
575
|
getLoadedFormat(): string | undefined;
|
|
548
576
|
getAssetUrl(): string | undefined;
|
|
549
577
|
getLastError(): string | undefined;
|
|
550
578
|
getMetrics(): FbxRenderMetrics | undefined;
|
|
579
|
+
getFigure(): HTMLElement | undefined;
|
|
580
|
+
getFbxRenderer(): FbxRenderer | null;
|
|
581
|
+
getChatActionBtn(): HTMLButtonElement | undefined;
|
|
582
|
+
getNameTag(): HTMLElement | undefined;
|
|
551
583
|
}
|
|
552
584
|
|
|
553
585
|
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 };
|