@asiyst/sdk 0.1.23 → 0.1.27
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 +846 -182
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +57 -10
- package/dist/index.d.ts +57 -10
- package/dist/index.js +846 -182
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -93,6 +93,18 @@ interface AsiystEventMap {
|
|
|
93
93
|
reason: string;
|
|
94
94
|
status?: string;
|
|
95
95
|
};
|
|
96
|
+
"asiyst:config:updated": {
|
|
97
|
+
config: ProjectConfig;
|
|
98
|
+
previousVersion?: number;
|
|
99
|
+
};
|
|
100
|
+
"asiyst:animation:played": {
|
|
101
|
+
name: string;
|
|
102
|
+
intent?: string;
|
|
103
|
+
};
|
|
104
|
+
"asiyst:animation:error": {
|
|
105
|
+
name: string;
|
|
106
|
+
error: string;
|
|
107
|
+
};
|
|
96
108
|
"asiyst:error": {
|
|
97
109
|
code: string;
|
|
98
110
|
message: string;
|
|
@@ -269,6 +281,8 @@ declare const Asiyst: {
|
|
|
269
281
|
open(): void;
|
|
270
282
|
close(): void;
|
|
271
283
|
getConfig(): ProjectConfig;
|
|
284
|
+
reloadConfig(): Promise<ProjectConfig>;
|
|
285
|
+
updateConfig(partial: Partial<ProjectConfig>): Promise<void>;
|
|
272
286
|
getConnectionStatus(): "connected" | "disconnected" | "offline";
|
|
273
287
|
getVerificationStatus(): "connected" | "inactive" | "not_detected" | "error";
|
|
274
288
|
isRuntimeConnected(): boolean;
|
|
@@ -281,6 +295,9 @@ declare const Asiyst: {
|
|
|
281
295
|
speak(message: string): void;
|
|
282
296
|
think(): void;
|
|
283
297
|
celebrate(): void;
|
|
298
|
+
playAnimation(nameOrIntent: string, options?: {
|
|
299
|
+
loopMode?: string;
|
|
300
|
+
}): boolean;
|
|
284
301
|
setPosition(x: number, y: number): void;
|
|
285
302
|
};
|
|
286
303
|
task: {
|
|
@@ -443,10 +460,13 @@ type LoadedAvatarAsset = LoadedFbxAsset | LoadedGlbAsset | LoadedImageAsset | Lo
|
|
|
443
460
|
declare class AssetLoader {
|
|
444
461
|
private inFlightController;
|
|
445
462
|
private readonly createdObjectUrls;
|
|
463
|
+
private readonly inFlightLoads;
|
|
464
|
+
private readonly cachedAssets;
|
|
446
465
|
load(assetUrl: string, options?: {
|
|
447
466
|
signal?: AbortSignal;
|
|
448
467
|
timeoutMs?: number;
|
|
449
468
|
}): Promise<LoadedAvatarAsset>;
|
|
469
|
+
private performLoad;
|
|
450
470
|
isFbxBuffer(buffer: ArrayBuffer): boolean;
|
|
451
471
|
parseFbxHeader(buffer: ArrayBuffer): {
|
|
452
472
|
isBinary: boolean;
|
|
@@ -483,24 +503,36 @@ interface FbxRenderMetrics {
|
|
|
483
503
|
vertexCount: number;
|
|
484
504
|
animationCount: number;
|
|
485
505
|
}
|
|
506
|
+
interface FbxMountOptions {
|
|
507
|
+
accentColor?: string;
|
|
508
|
+
config?: ProjectConfig;
|
|
509
|
+
width?: number;
|
|
510
|
+
height?: number;
|
|
511
|
+
}
|
|
486
512
|
declare class FbxRenderer {
|
|
487
513
|
private canvas;
|
|
488
514
|
private renderer;
|
|
489
515
|
private scene;
|
|
490
516
|
private camera;
|
|
491
517
|
private modelRoot;
|
|
518
|
+
private rawObject;
|
|
492
519
|
private mixer;
|
|
520
|
+
private allAnimations;
|
|
521
|
+
private readonly animationMetadataList;
|
|
522
|
+
private readonly assetLoader;
|
|
523
|
+
private currentAction;
|
|
493
524
|
private animFrameId;
|
|
494
525
|
private lastTime;
|
|
495
526
|
private facing;
|
|
496
527
|
private currentPose;
|
|
497
528
|
private initialRenderCompleted;
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
config?: ProjectConfig;
|
|
501
|
-
}): Promise<FbxRenderMetrics>;
|
|
529
|
+
private resizeListener?;
|
|
530
|
+
mount(container: HTMLElement, asset: LoadedFbxAsset | LoadedGlbAsset, options?: FbxMountOptions): Promise<FbxRenderMetrics>;
|
|
502
531
|
setFacing(direction: "left" | "right"): void;
|
|
503
532
|
setPose(pose: AvatarPose): void;
|
|
533
|
+
loadExternalAnimations(animations: AvatarAnimation[]): Promise<void>;
|
|
534
|
+
retargetClip(clip: THREE.AnimationClip, targetObject: THREE.Object3D): THREE.AnimationClip | null;
|
|
535
|
+
playAnimation(nameOrIntent: string, loopMode?: string, crossFadeDuration?: number): boolean;
|
|
504
536
|
isRendered(): boolean;
|
|
505
537
|
validateGeometry(rawObject: THREE.Object3D): {
|
|
506
538
|
meshCount: number;
|
|
@@ -509,6 +541,10 @@ declare class FbxRenderer {
|
|
|
509
541
|
getCanvas(): HTMLCanvasElement | null;
|
|
510
542
|
private startLoop;
|
|
511
543
|
destroy(): void;
|
|
544
|
+
handleResize(): void;
|
|
545
|
+
getCamera(): THREE.PerspectiveCamera | null;
|
|
546
|
+
getModelRoot(): THREE.Group | null;
|
|
547
|
+
getMixer(): THREE.AnimationMixer | null;
|
|
512
548
|
}
|
|
513
549
|
|
|
514
550
|
type AvatarRenderState = "idle" | "loading" | "ready" | "error";
|
|
@@ -517,13 +553,19 @@ declare class CssAvatarRenderer implements AvatarRenderer {
|
|
|
517
553
|
private figure;
|
|
518
554
|
private viewport;
|
|
519
555
|
private bubble;
|
|
520
|
-
private
|
|
556
|
+
private nameTagEl;
|
|
557
|
+
private nameTextEl;
|
|
558
|
+
private statusTextEl;
|
|
559
|
+
private chatActionBtn;
|
|
521
560
|
private size;
|
|
522
561
|
private hidden;
|
|
523
562
|
private facing;
|
|
524
563
|
private pose;
|
|
525
564
|
private accentColor;
|
|
526
565
|
private avatarName;
|
|
566
|
+
private isPanelOpen;
|
|
567
|
+
private has3dAssetConfigured;
|
|
568
|
+
onOpenChat?: () => void;
|
|
527
569
|
private readonly assetLoader;
|
|
528
570
|
private fbxRenderer;
|
|
529
571
|
private renderState;
|
|
@@ -536,6 +578,7 @@ declare class CssAvatarRenderer implements AvatarRenderer {
|
|
|
536
578
|
mount(container: HTMLElement, config: ProjectConfig): void;
|
|
537
579
|
unmount(): void;
|
|
538
580
|
applyConfig(config: ProjectConfig): void;
|
|
581
|
+
setPanelOpen(open: boolean): void;
|
|
539
582
|
loadAsset(config: ProjectConfig): Promise<boolean>;
|
|
540
583
|
private renderLoader;
|
|
541
584
|
private renderLoadedAsset;
|
|
@@ -543,24 +586,28 @@ declare class CssAvatarRenderer implements AvatarRenderer {
|
|
|
543
586
|
setPosition(x: number, y: number, animate: boolean): void;
|
|
544
587
|
setFacing(direction: "left" | "right"): void;
|
|
545
588
|
setPose(pose: AvatarPose): void;
|
|
546
|
-
private syncTransform;
|
|
547
589
|
setSpeech(text: string | null): void;
|
|
548
590
|
getSize(): {
|
|
549
591
|
width: number;
|
|
550
592
|
height: number;
|
|
551
593
|
};
|
|
594
|
+
playAnimation(nameOrIntent: string, loopMode?: string): boolean;
|
|
552
595
|
setHidden(hidden: boolean): void;
|
|
553
596
|
isHidden(): boolean;
|
|
554
|
-
|
|
555
|
-
getViewport(): HTMLElement | undefined;
|
|
597
|
+
getRenderState(): AvatarRenderState;
|
|
556
598
|
isAssetLoaded(): boolean;
|
|
557
|
-
|
|
599
|
+
getViewport(): HTMLElement | undefined;
|
|
600
|
+
isFallback(): boolean;
|
|
558
601
|
isFallbackActive(): boolean;
|
|
559
|
-
|
|
602
|
+
isRendered(): boolean;
|
|
560
603
|
getLoadedFormat(): string | undefined;
|
|
561
604
|
getAssetUrl(): string | undefined;
|
|
562
605
|
getLastError(): string | undefined;
|
|
563
606
|
getMetrics(): FbxRenderMetrics | undefined;
|
|
607
|
+
getFigure(): HTMLElement | undefined;
|
|
608
|
+
getFbxRenderer(): FbxRenderer | null;
|
|
609
|
+
getChatActionBtn(): HTMLButtonElement | undefined;
|
|
610
|
+
getNameTag(): HTMLElement | undefined;
|
|
564
611
|
}
|
|
565
612
|
|
|
566
613
|
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
|
@@ -93,6 +93,18 @@ interface AsiystEventMap {
|
|
|
93
93
|
reason: string;
|
|
94
94
|
status?: string;
|
|
95
95
|
};
|
|
96
|
+
"asiyst:config:updated": {
|
|
97
|
+
config: ProjectConfig;
|
|
98
|
+
previousVersion?: number;
|
|
99
|
+
};
|
|
100
|
+
"asiyst:animation:played": {
|
|
101
|
+
name: string;
|
|
102
|
+
intent?: string;
|
|
103
|
+
};
|
|
104
|
+
"asiyst:animation:error": {
|
|
105
|
+
name: string;
|
|
106
|
+
error: string;
|
|
107
|
+
};
|
|
96
108
|
"asiyst:error": {
|
|
97
109
|
code: string;
|
|
98
110
|
message: string;
|
|
@@ -269,6 +281,8 @@ declare const Asiyst: {
|
|
|
269
281
|
open(): void;
|
|
270
282
|
close(): void;
|
|
271
283
|
getConfig(): ProjectConfig;
|
|
284
|
+
reloadConfig(): Promise<ProjectConfig>;
|
|
285
|
+
updateConfig(partial: Partial<ProjectConfig>): Promise<void>;
|
|
272
286
|
getConnectionStatus(): "connected" | "disconnected" | "offline";
|
|
273
287
|
getVerificationStatus(): "connected" | "inactive" | "not_detected" | "error";
|
|
274
288
|
isRuntimeConnected(): boolean;
|
|
@@ -281,6 +295,9 @@ declare const Asiyst: {
|
|
|
281
295
|
speak(message: string): void;
|
|
282
296
|
think(): void;
|
|
283
297
|
celebrate(): void;
|
|
298
|
+
playAnimation(nameOrIntent: string, options?: {
|
|
299
|
+
loopMode?: string;
|
|
300
|
+
}): boolean;
|
|
284
301
|
setPosition(x: number, y: number): void;
|
|
285
302
|
};
|
|
286
303
|
task: {
|
|
@@ -443,10 +460,13 @@ type LoadedAvatarAsset = LoadedFbxAsset | LoadedGlbAsset | LoadedImageAsset | Lo
|
|
|
443
460
|
declare class AssetLoader {
|
|
444
461
|
private inFlightController;
|
|
445
462
|
private readonly createdObjectUrls;
|
|
463
|
+
private readonly inFlightLoads;
|
|
464
|
+
private readonly cachedAssets;
|
|
446
465
|
load(assetUrl: string, options?: {
|
|
447
466
|
signal?: AbortSignal;
|
|
448
467
|
timeoutMs?: number;
|
|
449
468
|
}): Promise<LoadedAvatarAsset>;
|
|
469
|
+
private performLoad;
|
|
450
470
|
isFbxBuffer(buffer: ArrayBuffer): boolean;
|
|
451
471
|
parseFbxHeader(buffer: ArrayBuffer): {
|
|
452
472
|
isBinary: boolean;
|
|
@@ -483,24 +503,36 @@ interface FbxRenderMetrics {
|
|
|
483
503
|
vertexCount: number;
|
|
484
504
|
animationCount: number;
|
|
485
505
|
}
|
|
506
|
+
interface FbxMountOptions {
|
|
507
|
+
accentColor?: string;
|
|
508
|
+
config?: ProjectConfig;
|
|
509
|
+
width?: number;
|
|
510
|
+
height?: number;
|
|
511
|
+
}
|
|
486
512
|
declare class FbxRenderer {
|
|
487
513
|
private canvas;
|
|
488
514
|
private renderer;
|
|
489
515
|
private scene;
|
|
490
516
|
private camera;
|
|
491
517
|
private modelRoot;
|
|
518
|
+
private rawObject;
|
|
492
519
|
private mixer;
|
|
520
|
+
private allAnimations;
|
|
521
|
+
private readonly animationMetadataList;
|
|
522
|
+
private readonly assetLoader;
|
|
523
|
+
private currentAction;
|
|
493
524
|
private animFrameId;
|
|
494
525
|
private lastTime;
|
|
495
526
|
private facing;
|
|
496
527
|
private currentPose;
|
|
497
528
|
private initialRenderCompleted;
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
config?: ProjectConfig;
|
|
501
|
-
}): Promise<FbxRenderMetrics>;
|
|
529
|
+
private resizeListener?;
|
|
530
|
+
mount(container: HTMLElement, asset: LoadedFbxAsset | LoadedGlbAsset, options?: FbxMountOptions): Promise<FbxRenderMetrics>;
|
|
502
531
|
setFacing(direction: "left" | "right"): void;
|
|
503
532
|
setPose(pose: AvatarPose): void;
|
|
533
|
+
loadExternalAnimations(animations: AvatarAnimation[]): Promise<void>;
|
|
534
|
+
retargetClip(clip: THREE.AnimationClip, targetObject: THREE.Object3D): THREE.AnimationClip | null;
|
|
535
|
+
playAnimation(nameOrIntent: string, loopMode?: string, crossFadeDuration?: number): boolean;
|
|
504
536
|
isRendered(): boolean;
|
|
505
537
|
validateGeometry(rawObject: THREE.Object3D): {
|
|
506
538
|
meshCount: number;
|
|
@@ -509,6 +541,10 @@ declare class FbxRenderer {
|
|
|
509
541
|
getCanvas(): HTMLCanvasElement | null;
|
|
510
542
|
private startLoop;
|
|
511
543
|
destroy(): void;
|
|
544
|
+
handleResize(): void;
|
|
545
|
+
getCamera(): THREE.PerspectiveCamera | null;
|
|
546
|
+
getModelRoot(): THREE.Group | null;
|
|
547
|
+
getMixer(): THREE.AnimationMixer | null;
|
|
512
548
|
}
|
|
513
549
|
|
|
514
550
|
type AvatarRenderState = "idle" | "loading" | "ready" | "error";
|
|
@@ -517,13 +553,19 @@ declare class CssAvatarRenderer implements AvatarRenderer {
|
|
|
517
553
|
private figure;
|
|
518
554
|
private viewport;
|
|
519
555
|
private bubble;
|
|
520
|
-
private
|
|
556
|
+
private nameTagEl;
|
|
557
|
+
private nameTextEl;
|
|
558
|
+
private statusTextEl;
|
|
559
|
+
private chatActionBtn;
|
|
521
560
|
private size;
|
|
522
561
|
private hidden;
|
|
523
562
|
private facing;
|
|
524
563
|
private pose;
|
|
525
564
|
private accentColor;
|
|
526
565
|
private avatarName;
|
|
566
|
+
private isPanelOpen;
|
|
567
|
+
private has3dAssetConfigured;
|
|
568
|
+
onOpenChat?: () => void;
|
|
527
569
|
private readonly assetLoader;
|
|
528
570
|
private fbxRenderer;
|
|
529
571
|
private renderState;
|
|
@@ -536,6 +578,7 @@ declare class CssAvatarRenderer implements AvatarRenderer {
|
|
|
536
578
|
mount(container: HTMLElement, config: ProjectConfig): void;
|
|
537
579
|
unmount(): void;
|
|
538
580
|
applyConfig(config: ProjectConfig): void;
|
|
581
|
+
setPanelOpen(open: boolean): void;
|
|
539
582
|
loadAsset(config: ProjectConfig): Promise<boolean>;
|
|
540
583
|
private renderLoader;
|
|
541
584
|
private renderLoadedAsset;
|
|
@@ -543,24 +586,28 @@ declare class CssAvatarRenderer implements AvatarRenderer {
|
|
|
543
586
|
setPosition(x: number, y: number, animate: boolean): void;
|
|
544
587
|
setFacing(direction: "left" | "right"): void;
|
|
545
588
|
setPose(pose: AvatarPose): void;
|
|
546
|
-
private syncTransform;
|
|
547
589
|
setSpeech(text: string | null): void;
|
|
548
590
|
getSize(): {
|
|
549
591
|
width: number;
|
|
550
592
|
height: number;
|
|
551
593
|
};
|
|
594
|
+
playAnimation(nameOrIntent: string, loopMode?: string): boolean;
|
|
552
595
|
setHidden(hidden: boolean): void;
|
|
553
596
|
isHidden(): boolean;
|
|
554
|
-
|
|
555
|
-
getViewport(): HTMLElement | undefined;
|
|
597
|
+
getRenderState(): AvatarRenderState;
|
|
556
598
|
isAssetLoaded(): boolean;
|
|
557
|
-
|
|
599
|
+
getViewport(): HTMLElement | undefined;
|
|
600
|
+
isFallback(): boolean;
|
|
558
601
|
isFallbackActive(): boolean;
|
|
559
|
-
|
|
602
|
+
isRendered(): boolean;
|
|
560
603
|
getLoadedFormat(): string | undefined;
|
|
561
604
|
getAssetUrl(): string | undefined;
|
|
562
605
|
getLastError(): string | undefined;
|
|
563
606
|
getMetrics(): FbxRenderMetrics | undefined;
|
|
607
|
+
getFigure(): HTMLElement | undefined;
|
|
608
|
+
getFbxRenderer(): FbxRenderer | null;
|
|
609
|
+
getChatActionBtn(): HTMLButtonElement | undefined;
|
|
610
|
+
getNameTag(): HTMLElement | undefined;
|
|
564
611
|
}
|
|
565
612
|
|
|
566
613
|
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 };
|