@laplace.live/persona-sdk 1.18.0 → 1.20.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/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/dist/values/hotkeys.d.ts +33 -0
- package/dist/values/hotkeys.js +36 -0
- package/dist/values/model-movement.d.ts +29 -0
- package/dist/values/model-movement.js +44 -0
- package/dist/wire/events.d.ts +10 -0
- package/dist/wire/events.js +1 -0
- package/dist/wire/methods.d.ts +28 -0
- package/dist/wire/methods.js +2 -0
- package/dist/wire/schemas/requests.d.ts +8 -0
- package/dist/wire/schemas/requests.js +7 -1
- package/dist/wire/types.d.ts +11 -3
- package/dist/wire/types.js +2 -0
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -17,6 +17,7 @@ export * from './values/limits.ts';
|
|
|
17
17
|
export * from './values/lipsync.ts';
|
|
18
18
|
export * from './values/locale.ts';
|
|
19
19
|
export * from './values/model-info.ts';
|
|
20
|
+
export * from './values/model-movement.ts';
|
|
20
21
|
export * from './values/mouse.ts';
|
|
21
22
|
export * from './values/scene-transition.ts';
|
|
22
23
|
export * from './values/stage-info.ts';
|
package/dist/index.js
CHANGED
|
@@ -19,6 +19,7 @@ export * from "./values/limits.js";
|
|
|
19
19
|
export * from "./values/lipsync.js";
|
|
20
20
|
export * from "./values/locale.js";
|
|
21
21
|
export * from "./values/model-info.js";
|
|
22
|
+
export * from "./values/model-movement.js";
|
|
22
23
|
export * from "./values/mouse.js";
|
|
23
24
|
export * from "./values/scene-transition.js";
|
|
24
25
|
export * from "./values/stage-info.js";
|
package/dist/values/hotkeys.d.ts
CHANGED
|
@@ -9,6 +9,17 @@ export declare function hasCommandModifier(accelerator: string | null): boolean;
|
|
|
9
9
|
export declare function canRunInBackground(accelerator: string | null): boolean;
|
|
10
10
|
/** True when a model hotkey is meant to fire while Persona sits in the background — what main registers on, and what the globe shows. */
|
|
11
11
|
export declare function hotkeyRunsInBackground(h: Hotkey): boolean;
|
|
12
|
+
/**
|
|
13
|
+
* Why a `hold` hotkey toggles instead of holding, or null when it can hold. A combo registered with
|
|
14
|
+
* the OS reaches Persona as a press alone — Electron reports no key-up for it — and one registration
|
|
15
|
+
* serves every hotkey on the combo: `'own'` when this hotkey asks for the background itself,
|
|
16
|
+
* `'shared'` when only another one on its combo does, which `registered` (main's list) alone can tell.
|
|
17
|
+
*/
|
|
18
|
+
export declare function holdBlockedBy(h: Pick<Hotkey, 'hold' | 'global' | 'accelerator'>, registered: boolean): 'own' | 'shared' | null;
|
|
19
|
+
/** VTS's editor limits for a hotkey's fade and auto-off times, in seconds; healing clamps API input to them. */
|
|
20
|
+
export declare const HOTKEY_FADE_SECONDS_MAX = 2;
|
|
21
|
+
export declare const HOTKEY_DEACTIVATE_SECONDS_MIN = 0.1;
|
|
22
|
+
export declare const HOTKEY_DEACTIVATE_SECONDS_MAX = 3600;
|
|
12
23
|
/** Automations are enabled unless explicitly paused. */
|
|
13
24
|
export declare function automationEnabled(s: {
|
|
14
25
|
enabled?: boolean;
|
|
@@ -27,3 +38,25 @@ export declare function automationBindable<T extends {
|
|
|
27
38
|
export declare function duplicateAccelerators(bindings: readonly {
|
|
28
39
|
accelerator: string | null;
|
|
29
40
|
}[]): Set<string>;
|
|
41
|
+
/** The slice of a scene model item the ordering reads; a full `SceneModelItem` comes back as itself. */
|
|
42
|
+
interface HotkeyModelLike {
|
|
43
|
+
kind: 'model';
|
|
44
|
+
instanceId: string;
|
|
45
|
+
ref: {
|
|
46
|
+
id: string;
|
|
47
|
+
};
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* The models whose hotkeys are live — every model in the scene, the primary first, one per model id
|
|
51
|
+
* (a model on two layers lists once). The desktop fires all of them, VTS-style, and every shortcut
|
|
52
|
+
* list shows them in this order; `hotkey.list`/`hotkey.trigger` take each one's `ref.id` as `modelId`.
|
|
53
|
+
* Generic over the item union so a scene document and the desktop's loaded runtimes both infer.
|
|
54
|
+
*/
|
|
55
|
+
export declare function hotkeyModels<T extends HotkeyModelLike | {
|
|
56
|
+
kind: 'object';
|
|
57
|
+
instanceId: string;
|
|
58
|
+
}>(scene: {
|
|
59
|
+
items: readonly T[];
|
|
60
|
+
primaryInstanceId: string | null;
|
|
61
|
+
}): Extract<T, HotkeyModelLike>[];
|
|
62
|
+
export {};
|
package/dist/values/hotkeys.js
CHANGED
|
@@ -25,6 +25,23 @@ export function canRunInBackground(accelerator) {
|
|
|
25
25
|
export function hotkeyRunsInBackground(h) {
|
|
26
26
|
return h.global && h.active && h.action !== null && canRunInBackground(h.accelerator);
|
|
27
27
|
}
|
|
28
|
+
/**
|
|
29
|
+
* Why a `hold` hotkey toggles instead of holding, or null when it can hold. A combo registered with
|
|
30
|
+
* the OS reaches Persona as a press alone — Electron reports no key-up for it — and one registration
|
|
31
|
+
* serves every hotkey on the combo: `'own'` when this hotkey asks for the background itself,
|
|
32
|
+
* `'shared'` when only another one on its combo does, which `registered` (main's list) alone can tell.
|
|
33
|
+
*/
|
|
34
|
+
export function holdBlockedBy(h, registered) {
|
|
35
|
+
if (h.hold !== true)
|
|
36
|
+
return null;
|
|
37
|
+
if (h.global && hasCommandModifier(h.accelerator))
|
|
38
|
+
return 'own';
|
|
39
|
+
return registered ? 'shared' : null;
|
|
40
|
+
}
|
|
41
|
+
/** VTS's editor limits for a hotkey's fade and auto-off times, in seconds; healing clamps API input to them. */
|
|
42
|
+
export const HOTKEY_FADE_SECONDS_MAX = 2;
|
|
43
|
+
export const HOTKEY_DEACTIVATE_SECONDS_MIN = 0.1;
|
|
44
|
+
export const HOTKEY_DEACTIVATE_SECONDS_MAX = 3600;
|
|
28
45
|
/** Automations are enabled unless explicitly paused. */
|
|
29
46
|
export function automationEnabled(s) {
|
|
30
47
|
return s.enabled !== false;
|
|
@@ -49,3 +66,22 @@ export function duplicateAccelerators(bindings) {
|
|
|
49
66
|
}
|
|
50
67
|
return dupes;
|
|
51
68
|
}
|
|
69
|
+
/**
|
|
70
|
+
* The models whose hotkeys are live — every model in the scene, the primary first, one per model id
|
|
71
|
+
* (a model on two layers lists once). The desktop fires all of them, VTS-style, and every shortcut
|
|
72
|
+
* list shows them in this order; `hotkey.list`/`hotkey.trigger` take each one's `ref.id` as `modelId`.
|
|
73
|
+
* Generic over the item union so a scene document and the desktop's loaded runtimes both infer.
|
|
74
|
+
*/
|
|
75
|
+
export function hotkeyModels(scene) {
|
|
76
|
+
const models = scene.items.filter((i) => i.kind === 'model');
|
|
77
|
+
const primary = models.find(i => i.instanceId === scene.primaryInstanceId);
|
|
78
|
+
const out = [];
|
|
79
|
+
const seen = new Set();
|
|
80
|
+
for (const item of primary ? [primary, ...models] : models) {
|
|
81
|
+
if (seen.has(item.ref.id))
|
|
82
|
+
continue;
|
|
83
|
+
seen.add(item.ref.id);
|
|
84
|
+
out.push(item);
|
|
85
|
+
}
|
|
86
|
+
return out;
|
|
87
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* VTube Studio's Movement Config: how far tracked face position slides (`x`, `y`) and scales (`z`)
|
|
3
|
+
* a whole Live2D model. It moves the model itself and never writes a parameter, so it stacks with
|
|
4
|
+
* a rig that binds `FacePositionZ` to a parameter of its own. Amounts are signed — a negative one
|
|
5
|
+
* inverts its axis, 0 switches it off.
|
|
6
|
+
*/
|
|
7
|
+
export interface ModelMovementConfig {
|
|
8
|
+
enabled: boolean;
|
|
9
|
+
x: number;
|
|
10
|
+
y: number;
|
|
11
|
+
z: number;
|
|
12
|
+
/** Smoothing levels 0–100, read once when the model loads; file-only, as in VTS. */
|
|
13
|
+
smoothingX: number;
|
|
14
|
+
smoothingY: number;
|
|
15
|
+
smoothingZ: number;
|
|
16
|
+
}
|
|
17
|
+
/** VTS's slider limit (`MAX_MOVEMENT`): an edited amount is a whole number within ±20. */
|
|
18
|
+
export declare const MODEL_MOVEMENT_MAX = 20;
|
|
19
|
+
/** VTS's `ModelPositionMovement` field initializers — a model nobody configured moves by default. */
|
|
20
|
+
export declare const DEFAULT_MODEL_MOVEMENT: Readonly<ModelMovementConfig>;
|
|
21
|
+
/**
|
|
22
|
+
* A stored or relayed configuration, read per field over the defaults. Amounts are taken as
|
|
23
|
+
* written: VTS clamps its sliders to ±20, never what a file holds.
|
|
24
|
+
*/
|
|
25
|
+
export declare function healModelMovement(raw: unknown): ModelMovementConfig;
|
|
26
|
+
/** What the Movement Config editor changes; a file's smoothing levels are left as they are. */
|
|
27
|
+
export type ModelMovementEdit = Partial<Pick<ModelMovementConfig, 'enabled' | 'x' | 'y' | 'z'>>;
|
|
28
|
+
/** An edit healed to the editor's limits; an absent or unusable field is dropped, not defaulted. */
|
|
29
|
+
export declare function healModelMovementEdit(raw: unknown): ModelMovementEdit;
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { finiteOr, isFiniteNumber, isRecord } from "./guards.js";
|
|
2
|
+
import { clamp } from "./limits.js";
|
|
3
|
+
/** VTS's slider limit (`MAX_MOVEMENT`): an edited amount is a whole number within ±20. */
|
|
4
|
+
export const MODEL_MOVEMENT_MAX = 20;
|
|
5
|
+
/** VTS's `ModelPositionMovement` field initializers — a model nobody configured moves by default. */
|
|
6
|
+
export const DEFAULT_MODEL_MOVEMENT = {
|
|
7
|
+
enabled: true,
|
|
8
|
+
x: 6,
|
|
9
|
+
y: 8,
|
|
10
|
+
z: 11,
|
|
11
|
+
smoothingX: 10,
|
|
12
|
+
smoothingY: 10,
|
|
13
|
+
smoothingZ: 10,
|
|
14
|
+
};
|
|
15
|
+
/**
|
|
16
|
+
* A stored or relayed configuration, read per field over the defaults. Amounts are taken as
|
|
17
|
+
* written: VTS clamps its sliders to ±20, never what a file holds.
|
|
18
|
+
*/
|
|
19
|
+
export function healModelMovement(raw) {
|
|
20
|
+
const r = isRecord(raw) ? raw : {};
|
|
21
|
+
const d = DEFAULT_MODEL_MOVEMENT;
|
|
22
|
+
return {
|
|
23
|
+
enabled: typeof r.enabled === 'boolean' ? r.enabled : d.enabled,
|
|
24
|
+
x: finiteOr(r.x, d.x),
|
|
25
|
+
y: finiteOr(r.y, d.y),
|
|
26
|
+
z: finiteOr(r.z, d.z),
|
|
27
|
+
smoothingX: finiteOr(r.smoothingX, d.smoothingX),
|
|
28
|
+
smoothingY: finiteOr(r.smoothingY, d.smoothingY),
|
|
29
|
+
smoothingZ: finiteOr(r.smoothingZ, d.smoothingZ),
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
/** An edit healed to the editor's limits; an absent or unusable field is dropped, not defaulted. */
|
|
33
|
+
export function healModelMovementEdit(raw) {
|
|
34
|
+
const r = isRecord(raw) ? raw : {};
|
|
35
|
+
const edit = {};
|
|
36
|
+
if (typeof r.enabled === 'boolean')
|
|
37
|
+
edit.enabled = r.enabled;
|
|
38
|
+
for (const axis of ['x', 'y', 'z']) {
|
|
39
|
+
const v = r[axis];
|
|
40
|
+
if (isFiniteNumber(v))
|
|
41
|
+
edit[axis] = clamp(Math.round(v), -MODEL_MOVEMENT_MAX, MODEL_MOVEMENT_MAX);
|
|
42
|
+
}
|
|
43
|
+
return edit;
|
|
44
|
+
}
|
package/dist/wire/events.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { ModelMovementConfig } from '../values/model-movement.ts';
|
|
1
2
|
import type { AutomationInfo, ExpressionPersistence, HotkeyState, ModelFormat, PoseStatus, SceneState, Settings, TrackingStatus } from './types.ts';
|
|
2
3
|
/** Every push event a session can subscribe to, with its payload. */
|
|
3
4
|
export interface EventMap {
|
|
@@ -6,6 +7,10 @@ export interface EventMap {
|
|
|
6
7
|
'settings.changed': {
|
|
7
8
|
settings: Settings;
|
|
8
9
|
};
|
|
10
|
+
/**
|
|
11
|
+
* One model's live hotkey set changed — every model on stage has one, and a model that just left the
|
|
12
|
+
* stage arrives empty. Older hosts sent `modelId: null` for an empty stage instead.
|
|
13
|
+
*/
|
|
9
14
|
'hotkey.state': {
|
|
10
15
|
modelId: string | null;
|
|
11
16
|
config: HotkeyState;
|
|
@@ -66,6 +71,11 @@ export interface EventMap {
|
|
|
66
71
|
modelId: string;
|
|
67
72
|
persistence: ExpressionPersistence;
|
|
68
73
|
};
|
|
74
|
+
/** A model's Movement Config changed, from any editor; every instance of the model follows it. */
|
|
75
|
+
'model.movement': {
|
|
76
|
+
modelId: string;
|
|
77
|
+
movement: ModelMovementConfig;
|
|
78
|
+
};
|
|
69
79
|
}
|
|
70
80
|
export type EventName = keyof EventMap;
|
|
71
81
|
export type EventData<E extends EventName = EventName> = EventMap[E];
|
package/dist/wire/events.js
CHANGED
package/dist/wire/methods.d.ts
CHANGED
|
@@ -2,6 +2,7 @@ import type { Binding, BindingEditorData, BindingLiveValues } from '../values/bi
|
|
|
2
2
|
import type { ControllerMovementConfig, ControllerState } from '../values/controller.ts';
|
|
3
3
|
import type { SpawnTransition } from '../values/item-transition.ts';
|
|
4
4
|
import type { LipSyncCalibrationCommand, LipSyncConfig, LipSyncMode, LipSyncState } from '../values/lipsync.ts';
|
|
5
|
+
import type { ModelMovementConfig, ModelMovementEdit } from '../values/model-movement.ts';
|
|
5
6
|
import type { SceneInspection } from '../values/stage-info.ts';
|
|
6
7
|
import type { EventName } from './events.ts';
|
|
7
8
|
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';
|
|
@@ -340,6 +341,8 @@ export interface HotkeySetRequest {
|
|
|
340
341
|
export type HotkeySetResponse = HotkeyState;
|
|
341
342
|
export interface HotkeyTriggerRequest {
|
|
342
343
|
hotkeyId: string;
|
|
344
|
+
/** The model that owns the hotkey — every model on stage has a live set; defaults to the primary. */
|
|
345
|
+
modelId?: string;
|
|
343
346
|
}
|
|
344
347
|
export type HotkeyTriggerResponse = EmptyResponse;
|
|
345
348
|
export type AutomationListRequest = EmptyRequest;
|
|
@@ -631,6 +634,23 @@ export interface BindingOverrideRequest extends BindingTarget {
|
|
|
631
634
|
value: number | null;
|
|
632
635
|
}
|
|
633
636
|
export type BindingOverrideResponse = EmptyResponse;
|
|
637
|
+
/** `modelId` defaults to the primary model's; movement is Live2D-only. */
|
|
638
|
+
export interface ModelGetMovementRequest {
|
|
639
|
+
modelId?: string;
|
|
640
|
+
}
|
|
641
|
+
export interface ModelGetMovementResponse {
|
|
642
|
+
movement: ModelMovementConfig;
|
|
643
|
+
}
|
|
644
|
+
export interface ModelSetMovementRequest {
|
|
645
|
+
modelId?: string;
|
|
646
|
+
movement: ModelMovementEdit;
|
|
647
|
+
}
|
|
648
|
+
export interface ModelSetMovementResponse {
|
|
649
|
+
/** The configuration now moving the model, whether or not it reached the file. */
|
|
650
|
+
movement: ModelMovementConfig;
|
|
651
|
+
/** False when nothing reached the file: a refused write (read-only, unreadable), or no usable field. */
|
|
652
|
+
saved: boolean;
|
|
653
|
+
}
|
|
634
654
|
export interface InstanceSetBreathRequest {
|
|
635
655
|
instanceId: string;
|
|
636
656
|
breath?: boolean;
|
|
@@ -972,6 +992,14 @@ export interface MethodMap {
|
|
|
972
992
|
request: ModelRegisterRequest;
|
|
973
993
|
response: ModelRegisterResponse;
|
|
974
994
|
};
|
|
995
|
+
'model.getMovement': {
|
|
996
|
+
request: ModelGetMovementRequest;
|
|
997
|
+
response: ModelGetMovementResponse;
|
|
998
|
+
};
|
|
999
|
+
'model.setMovement': {
|
|
1000
|
+
request: ModelSetMovementRequest;
|
|
1001
|
+
response: ModelSetMovementResponse;
|
|
1002
|
+
};
|
|
975
1003
|
'asset.register': {
|
|
976
1004
|
request: AssetRegisterRequest;
|
|
977
1005
|
response: AssetRegisterResponse;
|
package/dist/wire/methods.js
CHANGED
|
@@ -163,6 +163,7 @@ export declare const requestSchemas: {
|
|
|
163
163
|
}, z.core.$strip>;
|
|
164
164
|
'hotkey.trigger': z.ZodObject<{
|
|
165
165
|
hotkeyId: z.ZodString;
|
|
166
|
+
modelId: z.ZodOptional<z.ZodString>;
|
|
166
167
|
}, z.core.$strip>;
|
|
167
168
|
'automation.run': z.ZodObject<{
|
|
168
169
|
automationId: z.ZodString;
|
|
@@ -215,6 +216,13 @@ export declare const requestSchemas: {
|
|
|
215
216
|
'model.register': z.ZodObject<{
|
|
216
217
|
path: z.ZodString;
|
|
217
218
|
}, z.core.$strip>;
|
|
219
|
+
'model.getMovement': z.ZodObject<{
|
|
220
|
+
modelId: z.ZodOptional<z.ZodString>;
|
|
221
|
+
}, z.core.$strip>;
|
|
222
|
+
'model.setMovement': z.ZodObject<{
|
|
223
|
+
modelId: z.ZodOptional<z.ZodString>;
|
|
224
|
+
movement: z.ZodCustom<Partial<Pick<import("../../index.ts").ModelMovementConfig, "enabled" | "x" | "y" | "z">>, Partial<Pick<import("../../index.ts").ModelMovementConfig, "enabled" | "x" | "y" | "z">>>;
|
|
225
|
+
}, z.core.$strip>;
|
|
218
226
|
'asset.register': z.ZodObject<{
|
|
219
227
|
path: z.ZodString;
|
|
220
228
|
want: z.ZodOptional<z.ZodEnum<{
|
|
@@ -107,7 +107,7 @@ export const requestSchemas = {
|
|
|
107
107
|
modelId: nonEmpty.optional(),
|
|
108
108
|
config: z.custom(isRecord, 'config must be a hotkey config'),
|
|
109
109
|
}),
|
|
110
|
-
'hotkey.trigger': z.object({ hotkeyId: nonEmpty }),
|
|
110
|
+
'hotkey.trigger': z.object({ hotkeyId: nonEmpty, modelId: nonEmpty.optional() }),
|
|
111
111
|
'automation.run': z.object({ automationId: nonEmpty }),
|
|
112
112
|
'tracking.addSource': z.object({
|
|
113
113
|
// Straight off the kind registry, for the same reason as ASSET_KINDS below: a schema
|
|
@@ -128,6 +128,12 @@ export const requestSchemas = {
|
|
|
128
128
|
}),
|
|
129
129
|
'tracking.removeSource': z.object({ id: nonEmpty }),
|
|
130
130
|
'model.register': z.object({ path: nonEmpty }),
|
|
131
|
+
'model.getMovement': z.object({ modelId: nonEmpty.optional() }),
|
|
132
|
+
// Healed by the host like the desktop editor's own edits, so only the shape is checked here.
|
|
133
|
+
'model.setMovement': z.object({
|
|
134
|
+
modelId: nonEmpty.optional(),
|
|
135
|
+
movement: z.custom(isRecord, 'movement must be an object'),
|
|
136
|
+
}),
|
|
131
137
|
// Straight off ASSET_KINDS: a kind added there has to reach the wire gate too, or
|
|
132
138
|
// `want` answers invalid-params for a kind the registry already knows how to take.
|
|
133
139
|
'asset.register': z.object({ path: nonEmpty, want: z.enum(ASSET_KINDS).optional() }),
|
package/dist/wire/types.d.ts
CHANGED
|
@@ -1011,7 +1011,7 @@ export interface Scene {
|
|
|
1011
1011
|
name: string;
|
|
1012
1012
|
/** Models and objects in one list; array order = z-order (bottom to top) within each space. */
|
|
1013
1013
|
items: SceneItem[];
|
|
1014
|
-
/**
|
|
1014
|
+
/** The default hotkey target and the default instance for model-scoped methods. null only when `items` holds no model. */
|
|
1015
1015
|
primaryInstanceId: string | null;
|
|
1016
1016
|
background: SceneBackground;
|
|
1017
1017
|
vrmCamera: SceneCamera;
|
|
@@ -1041,7 +1041,7 @@ export interface ScenePatch {
|
|
|
1041
1041
|
* App-level features a client gates on (never version-sniff): `hello` and
|
|
1042
1042
|
* `app.info` report them — the per-app mirror of {@link InstanceRuntime.capabilities}.
|
|
1043
1043
|
*/
|
|
1044
|
-
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", "stage-capture"];
|
|
1044
|
+
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", "stage-capture", "model-movement"];
|
|
1045
1045
|
export type AppCapability = (typeof APP_CAPABILITIES)[number];
|
|
1046
1046
|
export declare function isAppCapability(v: unknown): v is AppCapability;
|
|
1047
1047
|
/** What a loaded model instance can do; absent capabilities answer `unsupported-for-format`. */
|
|
@@ -1115,13 +1115,21 @@ export interface Hotkey {
|
|
|
1115
1115
|
accelerator: string | null;
|
|
1116
1116
|
global: boolean;
|
|
1117
1117
|
active: boolean;
|
|
1118
|
+
/** Expression: on only while the combo is held down (VTS `DeactivateAfterKeyUp`). Default false. */
|
|
1119
|
+
hold?: boolean;
|
|
1120
|
+
/** Fade time in seconds, in and out, of the expression or motion; null uses the file's own. 0–2. */
|
|
1121
|
+
fadeSeconds?: number | null;
|
|
1122
|
+
/** Expression: switches itself off after this many seconds. Motion: plays at most this long. null is off. 0.1–3600. */
|
|
1123
|
+
deactivateAfterSeconds?: number | null;
|
|
1124
|
+
/** Motion: holds its last frame until the hotkey fires again (VTS `StopsOnLastFrame`). Default false. */
|
|
1125
|
+
stopsOnLastFrame?: boolean;
|
|
1118
1126
|
}
|
|
1119
1127
|
export interface HotkeyConfig {
|
|
1120
1128
|
keyboardEnabled: boolean;
|
|
1121
1129
|
hotkeys: Hotkey[];
|
|
1122
1130
|
}
|
|
1123
1131
|
export interface HotkeyState extends HotkeyConfig {
|
|
1124
|
-
/** Hotkey ids currently registered with the OS (
|
|
1132
|
+
/** Hotkey ids currently registered with the OS (models on stage only). */
|
|
1125
1133
|
registered: string[];
|
|
1126
1134
|
}
|
|
1127
1135
|
/** Action kinds an app automation can carry today; servers may send kinds newer than this list. */
|
package/dist/wire/types.js
CHANGED
|
@@ -53,6 +53,8 @@ export const APP_CAPABILITIES = [
|
|
|
53
53
|
'motion-stop',
|
|
54
54
|
/** `stage.capture`. */
|
|
55
55
|
'stage-capture',
|
|
56
|
+
/** `model.getMovement` / `model.setMovement` and the `model.movement` event. */
|
|
57
|
+
'model-movement',
|
|
56
58
|
];
|
|
57
59
|
export function isAppCapability(v) {
|
|
58
60
|
return isOneOf(v, APP_CAPABILITIES);
|