@laplace.live/persona-sdk 1.13.0 → 1.15.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/dist/values/labels.d.ts +5 -0
- package/dist/values/labels.js +8 -0
- package/dist/values/limits.d.ts +2 -0
- package/dist/values/limits.js +2 -0
- package/dist/wire/events.d.ts +2 -0
- package/dist/wire/methods.d.ts +25 -1
- package/dist/wire/types.d.ts +27 -2
- package/dist/wire/types.js +6 -0
- package/package.json +1 -1
package/dist/values/labels.d.ts
CHANGED
|
@@ -7,6 +7,11 @@ export declare function fileBasename(path: string): string;
|
|
|
7
7
|
* so the basename is the only identifier there is.
|
|
8
8
|
*/
|
|
9
9
|
export declare function motionLabel(file: string): string;
|
|
10
|
+
/**
|
|
11
|
+
* Label for one motion of a group: the group alone when the file just repeats it (a VRM clip
|
|
12
|
+
* group named for its file, or a loose VTS file whose group is its basename), else both.
|
|
13
|
+
*/
|
|
14
|
+
export declare function motionSlotLabel(group: string, file: string): string;
|
|
10
15
|
/** Playable entries of a `MotionGroup` with their authored indices; an empty string is a missing file and keeps its slot. */
|
|
11
16
|
export declare function motionSlots(files: readonly string[]): {
|
|
12
17
|
file: string;
|
package/dist/values/labels.js
CHANGED
|
@@ -13,6 +13,14 @@ export function motionLabel(file) {
|
|
|
13
13
|
const base = fileBasename(file);
|
|
14
14
|
return base.replace(/\.motion3\.json$|\.exp3\.json$|\.vrma$|\.json$/i, '') || base;
|
|
15
15
|
}
|
|
16
|
+
/**
|
|
17
|
+
* Label for one motion of a group: the group alone when the file just repeats it (a VRM clip
|
|
18
|
+
* group named for its file, or a loose VTS file whose group is its basename), else both.
|
|
19
|
+
*/
|
|
20
|
+
export function motionSlotLabel(group, file) {
|
|
21
|
+
const name = motionLabel(file);
|
|
22
|
+
return group === file || name === group ? group : `${group} · ${name}`;
|
|
23
|
+
}
|
|
16
24
|
/** Playable entries of a `MotionGroup` with their authored indices; an empty string is a missing file and keeps its slot. */
|
|
17
25
|
export function motionSlots(files) {
|
|
18
26
|
return files.flatMap((file, index) => (file === '' ? [] : [{ file, index }]));
|
package/dist/values/limits.d.ts
CHANGED
|
@@ -81,6 +81,8 @@ export interface CameraDistanceLimits {
|
|
|
81
81
|
export declare function cameraDistanceLimits(env: Pick<SceneEnvironment, 'modelAssetId' | 'modelPlace'>, setRadius: number | null): CameraDistanceLimits;
|
|
82
82
|
/** ×2 doubles Cubism's own breath amplitude — past that the head sway reads as a nod, not a breath. */
|
|
83
83
|
export declare const BREATH_DEPTH_MAX = 2;
|
|
84
|
+
/** Seconds; a minute without a face is well past any dropout worth waiting out. */
|
|
85
|
+
export declare const TRACKING_LOST_DELAY_MAX = 60;
|
|
84
86
|
export declare const MTOON_NORMAL_SCALE_MAX = 2;
|
|
85
87
|
export declare const MTOON_RIM_MAX = 2;
|
|
86
88
|
/** ×0 flattens the Fresnel to a flood fill, ×4 tightens a default power-5 rim to a hairline. */
|
package/dist/values/limits.js
CHANGED
|
@@ -112,6 +112,8 @@ export function cameraDistanceLimits(env, setRadius) {
|
|
|
112
112
|
}
|
|
113
113
|
/** ×2 doubles Cubism's own breath amplitude — past that the head sway reads as a nod, not a breath. */
|
|
114
114
|
export const BREATH_DEPTH_MAX = 2;
|
|
115
|
+
/** Seconds; a minute without a face is well past any dropout worth waiting out. */
|
|
116
|
+
export const TRACKING_LOST_DELAY_MAX = 60;
|
|
115
117
|
export const MTOON_NORMAL_SCALE_MAX = 2;
|
|
116
118
|
export const MTOON_RIM_MAX = 2;
|
|
117
119
|
/** ×0 flattens the Fresnel to a flood fill, ×4 tightens a default power-5 rim to a hairline. */
|
package/dist/wire/events.d.ts
CHANGED
|
@@ -31,10 +31,12 @@ export interface EventMap {
|
|
|
31
31
|
active: string[];
|
|
32
32
|
weights?: Record<string, number>;
|
|
33
33
|
};
|
|
34
|
+
/** `oneShot`: the motion outranks the idle, so `motion.stop` would end it; hosts with `motion-stop` send it. */
|
|
34
35
|
'motion.started': {
|
|
35
36
|
instanceId: string;
|
|
36
37
|
group: string;
|
|
37
38
|
index: number;
|
|
39
|
+
oneShot?: boolean;
|
|
38
40
|
};
|
|
39
41
|
'motion.ended': {
|
|
40
42
|
instanceId: string;
|
package/dist/wire/methods.d.ts
CHANGED
|
@@ -4,7 +4,7 @@ import type { SpawnTransition } from '../values/item-transition.ts';
|
|
|
4
4
|
import type { LipSyncCalibrationCommand, LipSyncConfig, LipSyncMode, LipSyncState } from '../values/lipsync.ts';
|
|
5
5
|
import type { SceneInspection } from '../values/stage-info.ts';
|
|
6
6
|
import type { EventName } from './events.ts';
|
|
7
|
-
import type { AnchorOption, AppCapability, AssetKind, AssetRef, Attach, AttachHeadAngle, AutomationInfo, BindingInput, Expression, ExpressionPersistence, HandTrackingMode, HotkeyConfig, HotkeyState, InjectEntry, InjectTarget, InstanceRuntime, JsonValue, LayerEffectKey, LayerEffects, LayerEffectsPatch, MediaPipeConfig, ModelInfo, ModelRef, MotionGroup, MToonTuning, ObjectContent, ObjectLightOverride, ObjectSpace, Place2D, Place3D, PlayingMotion, PoseSourceId, PoseStatus, Scene, SceneItem, SceneLight, SceneLightCameraFollowOptions, ScenePatch, SceneState, ScreenPlacement, Settings, SettingsPatch, TrackingSourceConfig, TrackingSourceId, TrackingSourceKind, TrackingStatus, VrmPlacement } from './types.ts';
|
|
7
|
+
import type { AnchorOption, AppCapability, AssetKind, AssetRef, Attach, AttachHeadAngle, AutomationInfo, BindingInput, Expression, ExpressionPersistence, HandTrackingMode, HotkeyConfig, HotkeyState, InjectEntry, InjectTarget, InstanceRuntime, JsonValue, LayerEffectKey, LayerEffects, LayerEffectsPatch, MediaPipeConfig, ModelInfo, ModelRef, MotionGroup, MToonTuning, ObjectContent, ObjectLightOverride, ObjectSpace, Place2D, Place3D, PlayingMotion, PoseSourceId, PoseStatus, Scene, SceneItem, SceneLight, SceneLightCameraFollowOptions, ScenePatch, SceneState, ScreenPlacement, Settings, SettingsPatch, TrackingLostBehavior, TrackingSourceConfig, TrackingSourceId, TrackingSourceKind, TrackingStatus, VrmPlacement } from './types.ts';
|
|
8
8
|
/** Marker for methods that take no parameters; the client lets you omit the argument. */
|
|
9
9
|
export type EmptyRequest = Record<never, never>;
|
|
10
10
|
/** Marker for methods whose success response carries no data. */
|
|
@@ -157,7 +157,16 @@ export type InstanceSetMToonResponse = EmptyResponse;
|
|
|
157
157
|
export interface InstanceSetIdleRequest {
|
|
158
158
|
instanceId?: string;
|
|
159
159
|
idleAnimation?: boolean;
|
|
160
|
+
/** VRM only. */
|
|
160
161
|
idleClip?: string;
|
|
162
|
+
/** Live2D only: a motion file from `motion.list`, or null for the model's `Idle` group. */
|
|
163
|
+
idleMotion?: string | null;
|
|
164
|
+
/** The `tracking-lost` app capability carries these three. */
|
|
165
|
+
trackingLostBehavior?: TrackingLostBehavior;
|
|
166
|
+
/** Live2D only: a motion file from `motion.list`, or null for none. */
|
|
167
|
+
trackingLostMotion?: string | null;
|
|
168
|
+
/** Seconds, 0 to `TRACKING_LOST_DELAY_MAX`. */
|
|
169
|
+
trackingLostDelay?: number;
|
|
161
170
|
}
|
|
162
171
|
export type InstanceSetIdleResponse = EmptyResponse;
|
|
163
172
|
export interface InstanceInfoRequest {
|
|
@@ -283,6 +292,16 @@ export interface MotionPlayingRequest {
|
|
|
283
292
|
}
|
|
284
293
|
export interface MotionPlayingResponse {
|
|
285
294
|
playing: PlayingMotion | null;
|
|
295
|
+
/** `playing` outranks the idle — what `motion.stop` ends. Absent on hosts without `motion-stop`. */
|
|
296
|
+
oneShot?: boolean;
|
|
297
|
+
}
|
|
298
|
+
/** Fade the running motion out and let the idle resume; the idle itself is left alone. */
|
|
299
|
+
export interface MotionStopRequest {
|
|
300
|
+
instanceId?: string;
|
|
301
|
+
}
|
|
302
|
+
export interface MotionStopResponse {
|
|
303
|
+
/** A motion above the idle was playing and is now fading out. */
|
|
304
|
+
stopped: boolean;
|
|
286
305
|
}
|
|
287
306
|
/** Play a clip with lip-sync. One utterance per model: a new play supersedes the current one. */
|
|
288
307
|
export interface SpeechPlayRequest {
|
|
@@ -875,6 +894,11 @@ export interface MethodMap {
|
|
|
875
894
|
request: MotionPlayingRequest;
|
|
876
895
|
response: MotionPlayingResponse;
|
|
877
896
|
};
|
|
897
|
+
/** Needs the `motion-stop` app capability. */
|
|
898
|
+
'motion.stop': {
|
|
899
|
+
request: MotionStopRequest;
|
|
900
|
+
response: MotionStopResponse;
|
|
901
|
+
};
|
|
878
902
|
/**
|
|
879
903
|
* Lip-synced audio on models advertising the `speech` capability. The response means
|
|
880
904
|
* playback started (else `invalid-state`); `speech.started`/`speech.ended` bracket it.
|
package/dist/wire/types.d.ts
CHANGED
|
@@ -167,8 +167,28 @@ export interface SceneModelItem {
|
|
|
167
167
|
controllerMovement: ControllerMovementConfig;
|
|
168
168
|
live2d: ScreenPlacement;
|
|
169
169
|
vrm: VrmPlacement;
|
|
170
|
+
/** Whether the idle base animation plays: VRM loops `idleClip`, Live2D `idleMotion`. */
|
|
170
171
|
idleAnimation: boolean;
|
|
172
|
+
/** VRM: a bundled `.vrma` filename or `asset:<id>`. Kept while the instance shows a Live2D model. */
|
|
171
173
|
idleClip: string;
|
|
174
|
+
/**
|
|
175
|
+
* Live2D: a motion file the model lists (as `motion.list` names it), looped beneath every
|
|
176
|
+
* other motion, or null for the model's own `Idle` group at random. A file the model no
|
|
177
|
+
* longer lists degrades to that group. Kept while the instance shows a VRM.
|
|
178
|
+
*/
|
|
179
|
+
idleMotion: string | null;
|
|
180
|
+
/**
|
|
181
|
+
* What the tracked parameters do while the face is lost: keep the last pose until it is
|
|
182
|
+
* found again (`hold`), or ease back to the idle over ~0.3 s and return the same way (`idle`).
|
|
183
|
+
*/
|
|
184
|
+
trackingLostBehavior: TrackingLostBehavior;
|
|
185
|
+
/**
|
|
186
|
+
* Live2D: a listed motion that replaces the idle once the face has been lost for
|
|
187
|
+
* `trackingLostDelay` seconds, until it is found again; null keeps the idle playing.
|
|
188
|
+
*/
|
|
189
|
+
trackingLostMotion: string | null;
|
|
190
|
+
/** Seconds without a face before `trackingLostMotion` takes over. */
|
|
191
|
+
trackingLostDelay: number;
|
|
172
192
|
/**
|
|
173
193
|
* Live2D only: the engine's built-in idle breath. Beyond `ParamBreath` it also sways
|
|
174
194
|
* `ParamAngle*`/`ParamBodyAngleX`, so a rig whose head ranges are tuned tightly may want it off.
|
|
@@ -985,11 +1005,13 @@ export interface ScenePatch {
|
|
|
985
1005
|
* App-level features a client gates on (never version-sniff): `hello` and
|
|
986
1006
|
* `app.info` report them — the per-app mirror of {@link InstanceRuntime.capabilities}.
|
|
987
1007
|
*/
|
|
988
|
-
export declare const APP_CAPABILITIES: readonly ["storage", "speech", "automations", "controllers", "model-editing", "asset-inspection", "layer-effects", "scene-transitions", "area-lights", "spot-lights", "camera-follow-lights", "shadow-filters", "environment-map-model", "spawn"];
|
|
1008
|
+
export declare const APP_CAPABILITIES: readonly ["storage", "speech", "automations", "controllers", "model-editing", "asset-inspection", "layer-effects", "scene-transitions", "area-lights", "spot-lights", "camera-follow-lights", "shadow-filters", "environment-map-model", "spawn", "tracking-lost", "motion-stop"];
|
|
989
1009
|
export type AppCapability = (typeof APP_CAPABILITIES)[number];
|
|
990
1010
|
export declare function isAppCapability(v: unknown): v is AppCapability;
|
|
991
1011
|
/** What a loaded model instance can do; absent capabilities answer `unsupported-for-format`. */
|
|
992
|
-
export type InstanceCapability = 'motions' | 'expressions' | 'placement-2d' | 'placement-3d' | 'mtoon' | 'idle-clips'
|
|
1012
|
+
export type InstanceCapability = 'motions' | 'expressions' | 'placement-2d' | 'placement-3d' | 'mtoon' | 'idle-clips'
|
|
1013
|
+
/** `instance.setIdle` with `idleMotion`: one of the model's motions loops as its idle. Live2D only. */
|
|
1014
|
+
| 'idle-motions' | 'pose' | 'live2d-params'
|
|
993
1015
|
/** `instance.setBreath`; the idle breathing loop is Cubism's, so VRM lacks it. */
|
|
994
1016
|
| 'breath'
|
|
995
1017
|
/** `expression.setWeight`; Cubism expressions carry no user-settable weight, so Live2D lacks it. */
|
|
@@ -1115,6 +1137,9 @@ export declare const TRACKING_CHANNEL_FIELDS: {
|
|
|
1115
1137
|
};
|
|
1116
1138
|
export declare const TRACKING_CHANNELS: readonly TrackingChannel[];
|
|
1117
1139
|
export declare const HAND_TRACKING_MODES: readonly ["arms", "fingers"];
|
|
1140
|
+
/** How the face drivers react to a dropout; see `SceneModelInstance.trackingLostBehavior`. */
|
|
1141
|
+
export declare const TRACKING_LOST_BEHAVIORS: readonly ["hold", "idle"];
|
|
1142
|
+
export type TrackingLostBehavior = (typeof TRACKING_LOST_BEHAVIORS)[number];
|
|
1118
1143
|
export type HandTrackingMode = (typeof HAND_TRACKING_MODES)[number];
|
|
1119
1144
|
export declare function isHandTrackingMode(v: unknown): v is HandTrackingMode;
|
|
1120
1145
|
export declare const MEDIAPIPE_DELEGATES: readonly ["CPU", "GPU"];
|
package/dist/wire/types.js
CHANGED
|
@@ -47,6 +47,10 @@ export const APP_CAPABILITIES = [
|
|
|
47
47
|
'shadow-filters',
|
|
48
48
|
'environment-map-model',
|
|
49
49
|
'spawn',
|
|
50
|
+
/** `instance.setIdle` takes `trackingLostBehavior`, `trackingLostMotion` and `trackingLostDelay`. */
|
|
51
|
+
'tracking-lost',
|
|
52
|
+
/** `motion.stop`; `motion.playing` and `motion.started` carry `oneShot`. */
|
|
53
|
+
'motion-stop',
|
|
50
54
|
];
|
|
51
55
|
export function isAppCapability(v) {
|
|
52
56
|
return isOneOf(v, APP_CAPABILITIES);
|
|
@@ -92,6 +96,8 @@ export const TRACKING_CHANNEL_FIELDS = {
|
|
|
92
96
|
};
|
|
93
97
|
export const TRACKING_CHANNELS = keysOf(TRACKING_CHANNEL_FIELDS);
|
|
94
98
|
export const HAND_TRACKING_MODES = ['arms', 'fingers'];
|
|
99
|
+
/** How the face drivers react to a dropout; see `SceneModelInstance.trackingLostBehavior`. */
|
|
100
|
+
export const TRACKING_LOST_BEHAVIORS = ['hold', 'idle'];
|
|
95
101
|
export function isHandTrackingMode(v) {
|
|
96
102
|
return isOneOf(v, HAND_TRACKING_MODES);
|
|
97
103
|
}
|