@aether-stack-dev/client-sdk 1.2.5 → 1.3.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/README.md +82 -2
- package/dist/avatar/VRMAvatar.d.ts +32 -11
- package/dist/avatar/compatibility.d.ts +12 -0
- package/dist/avatar/environment.d.ts +6 -0
- package/dist/avatar/index.d.ts +1 -1
- package/dist/avatar/postProcessing.d.ts +20 -0
- package/dist/react/index.d.ts +2 -1
- package/dist/react.esm.js +3780 -81
- package/dist/react.js +3779 -80
- package/package.json +3 -2
- package/dist/AnalyticsCollector.d.ts +0 -62
- package/dist/BillingMonitor.d.ts +0 -36
- package/dist/ConnectionStateManager.d.ts +0 -49
- package/dist/MediaManager.d.ts +0 -21
- package/dist/PerformanceMonitor.d.ts +0 -33
- package/dist/SecurityLogger.d.ts +0 -26
- package/dist/SessionManager.d.ts +0 -20
- package/dist/UsageTracker.d.ts +0 -21
package/README.md
CHANGED
|
@@ -148,13 +148,47 @@ AStack supports custom VRM characters. Any VRM model with ARKit blendshapes will
|
|
|
148
148
|
| Prop | Type | Default | Description |
|
|
149
149
|
|------|------|---------|-------------|
|
|
150
150
|
| `blendshapes` | `number[]` | **required** | 52 ARKit blendshape values |
|
|
151
|
-
| `modelUrl` | `string` |
|
|
151
|
+
| `modelUrl` | `string` | Supabase-hosted VRM | URL of the VRM model |
|
|
152
152
|
| `blendshapeMap` | `Record<string, string>` | — | Custom blendshape name mapping (ARKit → model) |
|
|
153
|
+
| `expressionOverrides` | `Record<string, number>` | — | Manual VRM expression values (0–1) |
|
|
153
154
|
| `onModelLoad` | `(report: ModelCompatibilityReport) => void` | — | Callback with compatibility report after load |
|
|
154
155
|
| `maxModelSize` | `number` | `31457280` (30MB) | Max model file size in bytes (0 to disable) |
|
|
155
156
|
| `width` | `number` | `400` | Canvas width |
|
|
156
157
|
| `height` | `number` | `400` | Canvas height |
|
|
157
|
-
| `backgroundColor` | `number` | `
|
|
158
|
+
| `backgroundColor` | `number \| null` | `0xffffff` | Background color, or null for transparent |
|
|
159
|
+
| `cameraPosition` | `[number, number, number]` | `[0, 1.4, 1.2]` | Camera position in world space |
|
|
160
|
+
| `cameraTarget` | `[number, number, number]` | `[0, 1.3, 0]` | Camera look-at target |
|
|
161
|
+
| `cameraFov` | `number` | `30` | Camera field of view (degrees) |
|
|
162
|
+
| `lightIntensity` | `number` | `1` | Multiplier for all scene lights |
|
|
163
|
+
| `idleAnimationUrl` | `string` | — | URL of a .vrma animation clip for idle loop |
|
|
164
|
+
| `postProcessing` | `PostProcessingConfig` | — | Post-processing effects (bloom, ao, dof) |
|
|
165
|
+
| `environmentUrl` | `string` | — | URL of an .hdr environment map |
|
|
166
|
+
| `environmentIntensity` | `number` | `1` | HDRI lighting intensity |
|
|
167
|
+
| `environmentBlur` | `number` | `0` | HDRI background blur |
|
|
168
|
+
| `environmentZoom` | `number` | `1` | HDRI background zoom level |
|
|
169
|
+
| `onEnvironmentLoad` | `() => void` | — | Callback when HDRI environment finishes loading |
|
|
170
|
+
| `animationSpeed` | `number` | `1` | Playback speed multiplier for idle animation clip |
|
|
171
|
+
| `animationWeight` | `number` | `1` | Blend weight for idle animation clip (0–1) |
|
|
172
|
+
| `animationCrossfade` | `number` | `0.5` | Crossfade duration (seconds) when switching animations |
|
|
173
|
+
| `orbitAngle` | `number` | — | Camera azimuth angle (radians) for orbit control |
|
|
174
|
+
| `orbitElevation` | `number` | — | Camera elevation angle (radians) for orbit control |
|
|
175
|
+
| `avatarRotation` | `number` | — | Avatar Y-axis rotation (radians) |
|
|
176
|
+
| `onOrbitChange` | `(angle: number, elevation: number) => void` | — | Callback when camera orbit changes |
|
|
177
|
+
| `features` | `VRMAvatarFeatures` | — | Feature toggles (see below) |
|
|
178
|
+
|
|
179
|
+
### VRMAvatarFeatures
|
|
180
|
+
|
|
181
|
+
Control which built-in behaviors are active:
|
|
182
|
+
|
|
183
|
+
```typescript
|
|
184
|
+
interface VRMAvatarFeatures {
|
|
185
|
+
idleAnimation?: boolean; // Subtle breathing/swaying (default: true)
|
|
186
|
+
microExpressions?: boolean; // Random blinks, smiles, brow raises (default: true)
|
|
187
|
+
springBones?: boolean; // Hair/clothing physics simulation (default: true)
|
|
188
|
+
postProcessing?: PostProcessingConfig;
|
|
189
|
+
expressionPresets?: boolean; // VRM expression preset support (default: true)
|
|
190
|
+
}
|
|
191
|
+
```
|
|
158
192
|
|
|
159
193
|
### Custom Model URL
|
|
160
194
|
|
|
@@ -176,6 +210,20 @@ import { VROID_BLENDSHAPE_MAP } from '@aether-stack-dev/client-sdk';
|
|
|
176
210
|
<VRMAvatar blendshapes={blendshapes} blendshapeMap={{ jawOpen: 'mouth_open', eyeBlinkLeft: 'blink_L' }} />
|
|
177
211
|
```
|
|
178
212
|
|
|
213
|
+
### Advanced Rendering
|
|
214
|
+
|
|
215
|
+
VRMAvatar supports expression presets, animation clips, HDRI environments, post-processing (bloom, ambient occlusion, depth of field), and camera control. See the [Rendering Features documentation](https://astack.dev/docs/characters/rendering) for full details and examples.
|
|
216
|
+
|
|
217
|
+
```typescript
|
|
218
|
+
<VRMAvatar
|
|
219
|
+
blendshapes={blendshapes}
|
|
220
|
+
expressionOverrides={{ happy: 0.5 }}
|
|
221
|
+
idleAnimationUrl="https://cdn.example.com/idle.vrma"
|
|
222
|
+
environmentUrl="https://cdn.example.com/studio.hdr"
|
|
223
|
+
postProcessing={{ bloom: 0.3, ao: 0.5, dof: true }}
|
|
224
|
+
/>
|
|
225
|
+
```
|
|
226
|
+
|
|
179
227
|
### Compatibility Report
|
|
180
228
|
|
|
181
229
|
```typescript
|
|
@@ -209,6 +257,38 @@ const { blendshapes, characterConfig } = useAStackCSR({
|
|
|
209
257
|
|
|
210
258
|
See the [full character documentation](https://astack.dev/docs/characters) for VRM requirements, ecosystem links, and integration guides.
|
|
211
259
|
|
|
260
|
+
## Exports
|
|
261
|
+
|
|
262
|
+
### Types
|
|
263
|
+
|
|
264
|
+
| Export | Description |
|
|
265
|
+
|--------|-------------|
|
|
266
|
+
| `AStackCSRConfig` | Constructor config interface |
|
|
267
|
+
| `AStackCSREvents` | Event name/payload map |
|
|
268
|
+
| `CallStatus` | `'idle' \| 'starting' \| 'active' \| 'stopping' \| 'error'` |
|
|
269
|
+
| `VRMAvatarProps` | VRMAvatar component props (react subpath) |
|
|
270
|
+
| `VRMAvatarFeatures` | Feature toggle interface (react subpath) |
|
|
271
|
+
| `ModelCompatibilityReport` | Model load report (react subpath) |
|
|
272
|
+
| `PostProcessingConfig` | Post-processing config (react subpath) |
|
|
273
|
+
| `ARKitBlendshapeName` | Union of 52 ARKit blendshape name strings |
|
|
274
|
+
| `AudioChunk` | Audio player chunk interface |
|
|
275
|
+
| `AudioPlayerEvents` | Audio player event map |
|
|
276
|
+
| `CharacterConfig` | Character config from useAStackCSR (react subpath) |
|
|
277
|
+
| `UseAStackCSROptions` | Hook options (react subpath) |
|
|
278
|
+
| `UseAStackCSRReturn` | Hook return type (react subpath) |
|
|
279
|
+
| `AStackError` | Error class with error code |
|
|
280
|
+
| `ErrorCodes` | Error code constants |
|
|
281
|
+
|
|
282
|
+
### Constants
|
|
283
|
+
|
|
284
|
+
| Export | Description |
|
|
285
|
+
|--------|-------------|
|
|
286
|
+
| `ARKIT_BLENDSHAPES` | Array of 52 ARKit blendshape name strings |
|
|
287
|
+
| `BLENDSHAPE_COUNT` | `52` |
|
|
288
|
+
| `CRITICAL_BLENDSHAPES` | `['jawOpen', 'eyeBlinkLeft', 'eyeBlinkRight']` |
|
|
289
|
+
| `DEFAULT_BLENDSHAPE_MAP` | Identity map (ARKit name → same name) |
|
|
290
|
+
| `VROID_BLENDSHAPE_MAP` | VRoid Studio naming preset (react subpath) |
|
|
291
|
+
|
|
212
292
|
## License
|
|
213
293
|
|
|
214
294
|
MIT
|
|
@@ -1,22 +1,43 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
1
|
+
import { type ModelCompatibilityReport } from './compatibility';
|
|
2
|
+
import { type PostProcessingConfig } from './postProcessing';
|
|
3
|
+
export type { ModelCompatibilityReport } from './compatibility';
|
|
4
|
+
export type { PostProcessingConfig } from './postProcessing';
|
|
5
|
+
export interface VRMAvatarFeatures {
|
|
6
|
+
idleAnimation?: boolean;
|
|
7
|
+
microExpressions?: boolean;
|
|
8
|
+
springBones?: boolean;
|
|
9
|
+
postProcessing?: PostProcessingConfig;
|
|
10
|
+
expressionPresets?: boolean;
|
|
10
11
|
}
|
|
11
12
|
export interface VRMAvatarProps {
|
|
12
13
|
blendshapes: number[];
|
|
13
14
|
width?: number;
|
|
14
15
|
height?: number;
|
|
15
16
|
modelUrl?: string;
|
|
16
|
-
backgroundColor?: number;
|
|
17
|
+
backgroundColor?: number | null;
|
|
17
18
|
blendshapeMap?: Record<string, string>;
|
|
19
|
+
expressionOverrides?: Record<string, number>;
|
|
18
20
|
onModelLoad?: (report: ModelCompatibilityReport) => void;
|
|
19
21
|
maxModelSize?: number;
|
|
22
|
+
cameraPosition?: [number, number, number];
|
|
23
|
+
cameraTarget?: [number, number, number];
|
|
24
|
+
cameraFov?: number;
|
|
25
|
+
lightIntensity?: number;
|
|
26
|
+
idleAnimationUrl?: string;
|
|
27
|
+
animationSpeed?: number;
|
|
28
|
+
animationWeight?: number;
|
|
29
|
+
animationCrossfade?: number;
|
|
30
|
+
postProcessing?: PostProcessingConfig;
|
|
31
|
+
environmentUrl?: string;
|
|
32
|
+
environmentIntensity?: number;
|
|
33
|
+
environmentBlur?: number;
|
|
34
|
+
environmentZoom?: number;
|
|
35
|
+
onEnvironmentLoad?: () => void;
|
|
36
|
+
features?: VRMAvatarFeatures;
|
|
37
|
+
orbitAngle?: number;
|
|
38
|
+
orbitElevation?: number;
|
|
39
|
+
avatarRotation?: number;
|
|
40
|
+
onOrbitChange?: (angle: number, elevation: number) => void;
|
|
20
41
|
}
|
|
21
|
-
export declare function VRMAvatar({ blendshapes, width, height, modelUrl, backgroundColor, blendshapeMap, onModelLoad, maxModelSize, }: VRMAvatarProps): import("react/jsx-runtime").JSX.Element;
|
|
42
|
+
export declare function VRMAvatar({ blendshapes, width, height, modelUrl, backgroundColor, blendshapeMap, expressionOverrides, onModelLoad, maxModelSize, cameraPosition, cameraTarget, cameraFov, lightIntensity, idleAnimationUrl, animationSpeed, animationWeight, animationCrossfade, postProcessing, environmentUrl, environmentIntensity, environmentBlur, environmentZoom, onEnvironmentLoad, features, orbitAngle, orbitElevation, avatarRotation, onOrbitChange, }: VRMAvatarProps): import("react/jsx-runtime").JSX.Element;
|
|
22
43
|
export default VRMAvatar;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { VRM } from '@pixiv/three-vrm';
|
|
2
|
+
export interface ModelCompatibilityReport {
|
|
3
|
+
supported: number;
|
|
4
|
+
missing: string[];
|
|
5
|
+
warnings: string[];
|
|
6
|
+
modelStats: {
|
|
7
|
+
vertexCount: number;
|
|
8
|
+
textureCount: number;
|
|
9
|
+
morphTargetCount: number;
|
|
10
|
+
};
|
|
11
|
+
}
|
|
12
|
+
export declare function buildCompatibilityReport(vrm: VRM): ModelCompatibilityReport;
|
package/dist/avatar/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
export { VRMAvatar } from './VRMAvatar';
|
|
2
|
-
export type { VRMAvatarProps, ModelCompatibilityReport } from './VRMAvatar';
|
|
2
|
+
export type { VRMAvatarProps, VRMAvatarFeatures, ModelCompatibilityReport, PostProcessingConfig } from './VRMAvatar';
|
|
3
3
|
export { ARKIT_BLENDSHAPES, BLENDSHAPE_COUNT, CRITICAL_BLENDSHAPES, DEFAULT_BLENDSHAPE_MAP, VROID_BLENDSHAPE_MAP, } from './constants';
|
|
4
4
|
export type { ARKitBlendshapeName } from './constants';
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import * as THREE from 'three';
|
|
2
|
+
import { EffectComposer } from 'three/examples/jsm/postprocessing/EffectComposer.js';
|
|
3
|
+
export interface PostProcessingConfig {
|
|
4
|
+
bloom?: number;
|
|
5
|
+
ao?: number;
|
|
6
|
+
dof?: boolean;
|
|
7
|
+
}
|
|
8
|
+
export interface PostProcessingPipeline {
|
|
9
|
+
composer: EffectComposer;
|
|
10
|
+
dispose: () => void;
|
|
11
|
+
setSize: (w: number, h: number) => void;
|
|
12
|
+
}
|
|
13
|
+
export declare function createPostProcessing(renderer: THREE.WebGLRenderer, scene: THREE.Scene, camera: THREE.PerspectiveCamera, config: PostProcessingConfig, width: number, height: number): PostProcessingPipeline;
|
|
14
|
+
export declare class FpsMonitor {
|
|
15
|
+
private samples;
|
|
16
|
+
private lastTime;
|
|
17
|
+
disabled: boolean;
|
|
18
|
+
tick(time: number): void;
|
|
19
|
+
reset(): void;
|
|
20
|
+
}
|
package/dist/react/index.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
export { useAStackCSR } from './useAStackCSR';
|
|
2
2
|
export type { UseAStackCSROptions, UseAStackCSRReturn, CharacterConfig } from './useAStackCSR';
|
|
3
3
|
export { VRMAvatar } from '../avatar/VRMAvatar';
|
|
4
|
-
export type { VRMAvatarProps, ModelCompatibilityReport } from '../avatar/VRMAvatar';
|
|
4
|
+
export type { VRMAvatarProps, VRMAvatarFeatures, ModelCompatibilityReport, PostProcessingConfig } from '../avatar/VRMAvatar';
|
|
5
|
+
export { VROID_BLENDSHAPE_MAP } from '../avatar/constants';
|