@laplace.live/persona-sdk 1.24.0 → 1.25.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 +10 -10
- package/dist/client/client.js +5 -6
- package/dist/client/legacy-names.d.ts +2 -0
- package/dist/client/{legacy-kinds.js → legacy-names.js} +12 -3
- package/dist/client/node.d.ts +13 -0
- package/dist/client/node.js +29 -0
- package/dist/client/scene-hotkeys.d.ts +16 -0
- package/dist/client/scene-hotkeys.js +17 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.js +3 -0
- package/dist/values/bindings.d.ts +40 -15
- package/dist/values/controller.d.ts +9 -6
- package/dist/values/effect-schema.d.ts +26 -0
- package/dist/values/effect-schema.js +76 -91
- package/dist/values/hotkey-targets.d.ts +10 -3
- package/dist/values/hotkey-targets.js +20 -0
- package/dist/values/hotkeys.d.ts +9 -1
- package/dist/values/hotkeys.js +11 -0
- package/dist/values/labels.js +1 -0
- package/dist/values/limits.d.ts +96 -8
- package/dist/values/limits.js +109 -1
- package/dist/values/lipsync.d.ts +7 -8
- package/dist/values/locale.d.ts +4 -1
- package/dist/values/locale.js +4 -0
- package/dist/values/model-movement.d.ts +19 -4
- package/dist/values/model-movement.js +17 -4
- package/dist/values/volumetric-lighting.d.ts +1 -1
- package/dist/values/volumetric-lighting.js +1 -1
- package/dist/wire/envelope.js +6 -3
- package/dist/wire/methods.d.ts +16 -17
- package/dist/wire/protocol.d.ts +2 -0
- package/dist/wire/protocol.js +4 -0
- package/dist/wire/schemas/fields.d.ts +8 -0
- package/dist/wire/schemas/fields.js +1 -0
- package/dist/wire/schemas/requests.d.ts +2 -2
- package/dist/wire/schemas/requests.js +70 -20
- package/dist/wire/schemas/settings.d.ts +3 -3
- package/dist/wire/schemas/settings.js +3 -3
- package/dist/wire/types.d.ts +68 -115
- package/dist/wire/types.js +68 -9
- package/package.json +2 -2
- package/dist/client/legacy-kinds.d.ts +0 -2
package/dist/wire/types.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type * as z from 'zod';
|
|
2
|
-
import type { EFFECT_BLEND_MODES, EFFECT_SCOPES } from '../values/effect-schema.ts';
|
|
2
|
+
import type { BLOOM_MODES, BLUR_MODES, BloomColorSlot, COLOR_SHIFT_BANDS, COLOR_WHEELS_MODES, EFFECT_BLEND_MODES, EFFECT_SCOPES, EFFECTS_QUALITY_LEVELS, FLARE_MODES, FLARE_RAYS_MODES, GRADIENT_TYPES, LEVEL_CHANNELS, RIM_MODES, SelectColorsSlot } from '../values/effect-schema.ts';
|
|
3
3
|
import type { ItemTransition } from '../values/item-transition.ts';
|
|
4
4
|
import type { SCENE_TRANSITION_TYPES } from '../values/scene-transition.ts';
|
|
5
5
|
import type { SettingsPatchSchema, SettingsSchema } from './schemas/settings.ts';
|
|
@@ -9,9 +9,11 @@ import { type HandInputName } from '../values/hands.ts';
|
|
|
9
9
|
import { type LipSyncMode, type VoiceInputName } from '../values/lipsync.ts';
|
|
10
10
|
import { type MouseInputName } from '../values/mouse.ts';
|
|
11
11
|
import { type TimeInputName } from '../values/time.ts';
|
|
12
|
-
export
|
|
12
|
+
export declare const MODEL_FORMATS: readonly ["live2d", "vrm"];
|
|
13
|
+
export type ModelFormat = (typeof MODEL_FORMATS)[number];
|
|
14
|
+
export declare const CONTENT_ORIGINS: readonly ["bundled", "user"];
|
|
13
15
|
/** Where an item came from: shipped with the app, or added by the user. */
|
|
14
|
-
export type ContentOrigin =
|
|
16
|
+
export type ContentOrigin = (typeof CONTENT_ORIGINS)[number];
|
|
15
17
|
/**
|
|
16
18
|
* How a registered file is labelled. Wider than an object's content kinds: `.hdr` is only
|
|
17
19
|
* ever an environment map, and a `.vmd` splits by content — `cameraMotion` for one that
|
|
@@ -55,6 +57,8 @@ export interface ModelRef extends ContentRef {
|
|
|
55
57
|
* without one. Only `model.list` fills it: absent on scene item refs, `model.register`'s answer, and older hosts.
|
|
56
58
|
*/
|
|
57
59
|
vtubeFile?: string | null;
|
|
60
|
+
/** False once the entry file is gone from disk, like {@link AssetRef.exists}; filled like {@link ModelRef.vtubeFile}. */
|
|
61
|
+
exists?: boolean;
|
|
58
62
|
}
|
|
59
63
|
/** A registered object-source file. `exists` is false once the file is gone from disk. */
|
|
60
64
|
export interface AssetRef extends ContentRef {
|
|
@@ -215,7 +219,8 @@ export interface SceneModelItem {
|
|
|
215
219
|
}
|
|
216
220
|
export declare const OBJECT_SPACES: readonly ["2d", "3d"];
|
|
217
221
|
export type ObjectSpace = (typeof OBJECT_SPACES)[number];
|
|
218
|
-
export
|
|
222
|
+
export declare const CAPTURE_KINDS: readonly ["display", "window"];
|
|
223
|
+
export type CaptureKind = (typeof CAPTURE_KINDS)[number];
|
|
219
224
|
export declare const TEXT_ALIGNS: readonly ["left", "center", "right", "justify"];
|
|
220
225
|
export type TextAlign = (typeof TEXT_ALIGNS)[number];
|
|
221
226
|
/** `baseline` is the first line's baseline — Blender's Top Base-Line. */
|
|
@@ -487,7 +492,8 @@ export interface SceneObjectItem {
|
|
|
487
492
|
}
|
|
488
493
|
/** Anything the stage renders. Array order in {@link Scene.items} is z-order within each space. */
|
|
489
494
|
export type SceneItem = SceneModelItem | SceneObjectItem;
|
|
490
|
-
export
|
|
495
|
+
export declare const BACKGROUND_MODES: readonly ["transparent", "color", "image"];
|
|
496
|
+
export type BackgroundMode = (typeof BACKGROUND_MODES)[number];
|
|
491
497
|
/** `imageAssetId` names a registered asset; an id this app cannot resolve renders transparent. */
|
|
492
498
|
export interface SceneBackground {
|
|
493
499
|
mode: BackgroundMode;
|
|
@@ -607,6 +613,8 @@ export interface SceneCameraHandheld {
|
|
|
607
613
|
/** 0–2; 1 sways at the authored pace. */
|
|
608
614
|
speed: number;
|
|
609
615
|
}
|
|
616
|
+
export declare const CAMERA_PROJECTIONS: readonly ["perspective", "orthographic"];
|
|
617
|
+
export type CameraProjection = (typeof CAMERA_PROJECTIONS)[number];
|
|
610
618
|
/** Scene-level VRM camera. `orbit: null` = never framed — the first VRM load frames it from model height. */
|
|
611
619
|
export interface SceneCamera {
|
|
612
620
|
orbit: OrbitTransform | null;
|
|
@@ -615,7 +623,7 @@ export interface SceneCamera {
|
|
|
615
623
|
/** Rotation about camera-local +Z in radians; absent on older hosts, default 0. */
|
|
616
624
|
roll?: number;
|
|
617
625
|
/** Absent on older hosts; defaults to perspective. */
|
|
618
|
-
projection?:
|
|
626
|
+
projection?: CameraProjection;
|
|
619
627
|
/**
|
|
620
628
|
* A `cameraMotion` asset driving the camera, or null for the user's own orbit. While one
|
|
621
629
|
* is set it overrides the framing every frame without writing it back.
|
|
@@ -678,7 +686,7 @@ export interface SceneLight {
|
|
|
678
686
|
type: SceneLightType;
|
|
679
687
|
/** Mutes illumination and shadows. Defaults to true; omitted by hosts without light toggles. */
|
|
680
688
|
enabled?: boolean;
|
|
681
|
-
/** Camera-relative placement and angles; defaults to false. Gate editing on `camera-follow
|
|
689
|
+
/** Camera-relative placement and angles; defaults to false. Gate editing on `light-camera-follow`; ambient ignores it. */
|
|
682
690
|
followCamera?: boolean;
|
|
683
691
|
/** Independent camera components; omitted means all true. */
|
|
684
692
|
followCameraOptions?: SceneLightCameraFollowOptions;
|
|
@@ -710,7 +718,7 @@ export interface SceneLight {
|
|
|
710
718
|
shadowQuality: ShadowQuality;
|
|
711
719
|
/** PCF disk radius in shadow-map texels; retained while PCSS is selected. */
|
|
712
720
|
shadowRadius: number;
|
|
713
|
-
/** Per-light filter; defaults to PCF. Gate editing on the `shadow-
|
|
721
|
+
/** Per-light filter; defaults to PCF. Gate editing on the `light-shadow-filter` app capability. */
|
|
714
722
|
shadowFilter?: ShadowFilter;
|
|
715
723
|
/** PCSS source diameter: degrees for directional lights, metres for point/spot; 0–10, default 0.1. */
|
|
716
724
|
shadowSourceSize?: number;
|
|
@@ -735,11 +743,15 @@ export interface SceneVolumetricLighting {
|
|
|
735
743
|
speed: number;
|
|
736
744
|
}
|
|
737
745
|
/** Display transform applied after the scene renders. `none` keeps colors exactly as authored. */
|
|
738
|
-
export
|
|
746
|
+
export declare const SCENE_TONE_MAPPINGS: readonly ["none", "neutral", "aces", "agx"];
|
|
747
|
+
export type SceneToneMapping = (typeof SCENE_TONE_MAPPINGS)[number];
|
|
748
|
+
export type BloomMode = (typeof BLOOM_MODES)[number];
|
|
749
|
+
/** An effect's color slots, `color1` up, each with its `Enabled` switch. */
|
|
750
|
+
type ColorSlots<Slot extends number> = Record<`color${Slot}`, string> & Record<`color${Slot}Enabled`, boolean>;
|
|
739
751
|
/** Highlight glow in normal, streak, or star mode; color selection applies only to layer effects. */
|
|
740
|
-
export interface SceneBloom {
|
|
752
|
+
export interface SceneBloom extends ColorSlots<BloomColorSlot> {
|
|
741
753
|
enabled: boolean;
|
|
742
|
-
mode:
|
|
754
|
+
mode: BloomMode;
|
|
743
755
|
/** The glow's brightness multiplier, as Warudo's; 0 adds no glow. */
|
|
744
756
|
intensity: number;
|
|
745
757
|
/** Gamma-space brightness a channel must pass; squared into linear light, as Warudo's. */
|
|
@@ -756,16 +768,6 @@ export interface SceneBloom {
|
|
|
756
768
|
invertColors: boolean;
|
|
757
769
|
/** Shared saturation/brightness tolerance; hue tolerance is fixed at 0.03. */
|
|
758
770
|
colorTolerance: number;
|
|
759
|
-
color1: string;
|
|
760
|
-
color2: string;
|
|
761
|
-
color3: string;
|
|
762
|
-
color4: string;
|
|
763
|
-
color5: string;
|
|
764
|
-
color1Enabled: boolean;
|
|
765
|
-
color2Enabled: boolean;
|
|
766
|
-
color3Enabled: boolean;
|
|
767
|
-
color4Enabled: boolean;
|
|
768
|
-
color5Enabled: boolean;
|
|
769
771
|
}
|
|
770
772
|
/**
|
|
771
773
|
* Cinematic soft-focus veil (Shoost's diffusion, a Kino bloom variant): the
|
|
@@ -799,34 +801,19 @@ export interface SceneColorGrade {
|
|
|
799
801
|
/** White balance along green↔magenta, −100..100 — the axis `temperature` leaves alone. */
|
|
800
802
|
tint: number;
|
|
801
803
|
}
|
|
804
|
+
/** A Levels color channel, suffixing its copy of every {@link LevelParam}. */
|
|
805
|
+
export type LevelChannel = (typeof LEVEL_CHANNELS)[number];
|
|
806
|
+
/** One channel's levels; the master set carries no suffix. */
|
|
807
|
+
export type LevelParam = 'inputBlack' | 'inputWhite' | 'inputGamma' | 'outputBlack' | 'outputWhite';
|
|
802
808
|
/** Master and per-channel input/output levels; RGB channels run before master levels. */
|
|
803
|
-
export interface EffectLevels {
|
|
809
|
+
export interface EffectLevels extends Record<`${LevelParam}${'' | LevelChannel}`, number> {
|
|
804
810
|
enabled: boolean;
|
|
805
|
-
inputBlack: number;
|
|
806
|
-
inputWhite: number;
|
|
807
|
-
inputGamma: number;
|
|
808
|
-
outputBlack: number;
|
|
809
|
-
outputWhite: number;
|
|
810
|
-
inputBlackR: number;
|
|
811
|
-
inputWhiteR: number;
|
|
812
|
-
inputGammaR: number;
|
|
813
|
-
outputBlackR: number;
|
|
814
|
-
outputWhiteR: number;
|
|
815
|
-
inputBlackG: number;
|
|
816
|
-
inputWhiteG: number;
|
|
817
|
-
inputGammaG: number;
|
|
818
|
-
outputBlackG: number;
|
|
819
|
-
outputWhiteG: number;
|
|
820
|
-
inputBlackB: number;
|
|
821
|
-
inputWhiteB: number;
|
|
822
|
-
inputGammaB: number;
|
|
823
|
-
outputBlackB: number;
|
|
824
|
-
outputWhiteB: number;
|
|
825
811
|
}
|
|
812
|
+
export type ColorWheelsMode = (typeof COLOR_WHEELS_MODES)[number];
|
|
826
813
|
/** Color wheels in lift/gamma/gain or shadows/midtones/highlights mode. */
|
|
827
814
|
export interface EffectColorWheels {
|
|
828
815
|
enabled: boolean;
|
|
829
|
-
mode:
|
|
816
|
+
mode: ColorWheelsMode;
|
|
830
817
|
lift: number;
|
|
831
818
|
liftColor: string;
|
|
832
819
|
gamma: number;
|
|
@@ -842,36 +829,16 @@ export interface EffectColorWheels {
|
|
|
842
829
|
shadowLimit: number;
|
|
843
830
|
highlightLimit: number;
|
|
844
831
|
}
|
|
845
|
-
/**
|
|
846
|
-
export
|
|
832
|
+
/** A Color Shift hue band, suffixing its copy of every {@link ColorShiftParam}. */
|
|
833
|
+
export type ColorShiftBand = (typeof COLOR_SHIFT_BANDS)[number];
|
|
834
|
+
/** One hue band's offsets. */
|
|
835
|
+
export type ColorShiftParam = 'hue' | 'saturation' | 'luminance' | 'luminanceSaturation';
|
|
836
|
+
/** Per-band offsets; hue offsets are degrees, other offsets are -1..1. */
|
|
837
|
+
export interface EffectColorShift extends Record<`${ColorShiftParam}${ColorShiftBand}`, number> {
|
|
847
838
|
enabled: boolean;
|
|
848
|
-
hueRed: number;
|
|
849
|
-
saturationRed: number;
|
|
850
|
-
luminanceRed: number;
|
|
851
|
-
luminanceSaturationRed: number;
|
|
852
|
-
hueYellow: number;
|
|
853
|
-
saturationYellow: number;
|
|
854
|
-
luminanceYellow: number;
|
|
855
|
-
luminanceSaturationYellow: number;
|
|
856
|
-
hueGreen: number;
|
|
857
|
-
saturationGreen: number;
|
|
858
|
-
luminanceGreen: number;
|
|
859
|
-
luminanceSaturationGreen: number;
|
|
860
|
-
hueCyan: number;
|
|
861
|
-
saturationCyan: number;
|
|
862
|
-
luminanceCyan: number;
|
|
863
|
-
luminanceSaturationCyan: number;
|
|
864
|
-
hueBlue: number;
|
|
865
|
-
saturationBlue: number;
|
|
866
|
-
luminanceBlue: number;
|
|
867
|
-
luminanceSaturationBlue: number;
|
|
868
|
-
hueMagenta: number;
|
|
869
|
-
saturationMagenta: number;
|
|
870
|
-
luminanceMagenta: number;
|
|
871
|
-
luminanceSaturationMagenta: number;
|
|
872
839
|
}
|
|
873
840
|
/** Preserve selected colors while adjusting saturation outside their HSV ranges. */
|
|
874
|
-
export interface EffectSelectColors {
|
|
841
|
+
export interface EffectSelectColors extends ColorSlots<SelectColorsSlot> {
|
|
875
842
|
enabled: boolean;
|
|
876
843
|
invert: boolean;
|
|
877
844
|
/** Hue distance in turns around the color wheel. */
|
|
@@ -881,32 +848,13 @@ export interface EffectSelectColors {
|
|
|
881
848
|
/** Saturation offset outside the selection; -1 makes it monochrome. */
|
|
882
849
|
saturation: number;
|
|
883
850
|
blend: number;
|
|
884
|
-
color1: string;
|
|
885
|
-
color1Enabled: boolean;
|
|
886
|
-
color2: string;
|
|
887
|
-
color2Enabled: boolean;
|
|
888
|
-
color3: string;
|
|
889
|
-
color3Enabled: boolean;
|
|
890
|
-
color4: string;
|
|
891
|
-
color4Enabled: boolean;
|
|
892
|
-
color5: string;
|
|
893
|
-
color5Enabled: boolean;
|
|
894
|
-
color6: string;
|
|
895
|
-
color6Enabled: boolean;
|
|
896
|
-
color7: string;
|
|
897
|
-
color7Enabled: boolean;
|
|
898
|
-
color8: string;
|
|
899
|
-
color8Enabled: boolean;
|
|
900
|
-
color9: string;
|
|
901
|
-
color9Enabled: boolean;
|
|
902
|
-
color10: string;
|
|
903
|
-
color10Enabled: boolean;
|
|
904
851
|
}
|
|
852
|
+
export type BlurMode = (typeof BLUR_MODES)[number];
|
|
905
853
|
/** Gaussian or disk-shaped bokeh blur in output pixels. */
|
|
906
854
|
export interface EffectBlur {
|
|
907
855
|
enabled: boolean;
|
|
908
856
|
radius: number;
|
|
909
|
-
mode:
|
|
857
|
+
mode: BlurMode;
|
|
910
858
|
highQuality: boolean;
|
|
911
859
|
}
|
|
912
860
|
/**
|
|
@@ -1013,10 +961,11 @@ export interface SceneDroplets {
|
|
|
1013
961
|
}
|
|
1014
962
|
/** Shoost's blend modes, as Gradient offers them. */
|
|
1015
963
|
export type EffectBlendMode = (typeof EFFECT_BLEND_MODES)[number];
|
|
964
|
+
export type GradientType = (typeof GRADIENT_TYPES)[number];
|
|
1016
965
|
/** Solid, linear, or radial color overlay in scene or source coordinates. */
|
|
1017
966
|
export interface EffectGradient {
|
|
1018
967
|
enabled: boolean;
|
|
1019
|
-
type:
|
|
968
|
+
type: GradientType;
|
|
1020
969
|
blendMode: EffectBlendMode;
|
|
1021
970
|
/** Foreground color (hex). */
|
|
1022
971
|
color: string;
|
|
@@ -1036,10 +985,12 @@ export interface EffectGradient {
|
|
|
1036
985
|
scaleY: number;
|
|
1037
986
|
opacity: number;
|
|
1038
987
|
}
|
|
988
|
+
export type FlareMode = (typeof FLARE_MODES)[number];
|
|
989
|
+
export type FlareRaysMode = (typeof FLARE_RAYS_MODES)[number];
|
|
1039
990
|
/** Directional screen-space light with an independent monitor glow. */
|
|
1040
991
|
export interface SceneFlare {
|
|
1041
992
|
enabled: boolean;
|
|
1042
|
-
mode:
|
|
993
|
+
mode: FlareMode;
|
|
1043
994
|
/** Light color (hex). */
|
|
1044
995
|
color: string;
|
|
1045
996
|
intensity: number;
|
|
@@ -1048,17 +999,18 @@ export interface SceneFlare {
|
|
|
1048
999
|
angle: number;
|
|
1049
1000
|
glowOpacity: number;
|
|
1050
1001
|
rays: boolean;
|
|
1051
|
-
raysMode:
|
|
1002
|
+
raysMode: FlareRaysMode;
|
|
1052
1003
|
/** Particle-ray color (hex). */
|
|
1053
1004
|
raysColor: string;
|
|
1054
1005
|
raysScale: number;
|
|
1055
1006
|
raysIntensity: number;
|
|
1056
1007
|
raysOpacity: number;
|
|
1057
1008
|
}
|
|
1009
|
+
export type RimMode = (typeof RIM_MODES)[number];
|
|
1058
1010
|
/** Directional silhouette light, added like VTube Studio's backlight; optionally sharpened or two-sided. */
|
|
1059
1011
|
export interface SceneRim {
|
|
1060
1012
|
enabled: boolean;
|
|
1061
|
-
mode:
|
|
1013
|
+
mode: RimMode;
|
|
1062
1014
|
/** Rim tint (hex). */
|
|
1063
1015
|
color: string;
|
|
1064
1016
|
/** Normalized rim width, 0..1. */
|
|
@@ -1072,7 +1024,7 @@ export interface SceneRim {
|
|
|
1072
1024
|
/** Solid silhouette border; quality sets how closely it follows fine detail. */
|
|
1073
1025
|
export interface SceneOutline {
|
|
1074
1026
|
enabled: boolean;
|
|
1075
|
-
quality:
|
|
1027
|
+
quality: EffectsQuality;
|
|
1076
1028
|
/** Outline color (hex). */
|
|
1077
1029
|
color: string;
|
|
1078
1030
|
/** Normalized border thickness, 0..1. */
|
|
@@ -1312,29 +1264,21 @@ export interface ScenePatch {
|
|
|
1312
1264
|
/**
|
|
1313
1265
|
* App-level features a client gates on (never version-sniff): `hello` and
|
|
1314
1266
|
* `app.info` report them — the per-app mirror of {@link InstanceRuntime.capabilities}.
|
|
1267
|
+
* Each name leads with what it extends (`light-spot`, `object-text`), as action kinds do.
|
|
1315
1268
|
*/
|
|
1316
|
-
export declare const APP_CAPABILITIES: readonly ["storage", "speech", "automations", "controllers", "model-editing", "asset-inspection", "layer-effects", "scene-transitions", "area
|
|
1269
|
+
export declare const APP_CAPABILITIES: readonly ["storage", "speech", "automations", "controllers", "model-editing", "asset-inspection", "layer-effects", "scene-transitions", "light-area", "light-spot", "light-camera-follow", "light-shadow-filter", "environment-map-model", "stage-spawn", "idle-tracking-lost", "motion-stop", "stage-capture", "model-movement", "object-pin-depth", "object-text", "camera-follow", "camera-aim", "camera-focus", "camera-handheld", "object-video-sound", "object-chroma-key", "model-movement-pivot", "layer-effects-2d"];
|
|
1317
1270
|
export type AppCapability = (typeof APP_CAPABILITIES)[number];
|
|
1318
1271
|
export declare function isAppCapability(v: unknown): v is AppCapability;
|
|
1319
|
-
/** What a loaded model instance can do; absent capabilities answer `unsupported-for-format`. */
|
|
1320
|
-
export type InstanceCapability = 'motions' | 'expressions' | 'placement-2d' | 'placement-3d' | 'mtoon' | 'idle-clips'
|
|
1321
|
-
/** `instance.setIdle` with `idleMotion`: one of the model's motions loops as its idle. Live2D only. */
|
|
1322
|
-
| 'idle-motions' | 'pose' | 'live2d-params'
|
|
1323
|
-
/** `instance.setBreath`; the idle breathing loop is Cubism's, so VRM lacks it. */
|
|
1324
|
-
| 'breath'
|
|
1325
|
-
/** `expression.setWeight`; Cubism expressions carry no user-settable weight, so Live2D lacks it. */
|
|
1326
|
-
| 'expression-weights'
|
|
1327
1272
|
/**
|
|
1328
|
-
*
|
|
1329
|
-
* the
|
|
1273
|
+
* Old app capability names, each mapped to its category-first replacement. Hosts still list them for
|
|
1274
|
+
* clients from before the rename; the SDK client folds them into the new names on receipt.
|
|
1330
1275
|
*/
|
|
1331
|
-
|
|
1332
|
-
/**
|
|
1333
|
-
|
|
1334
|
-
|
|
1335
|
-
|
|
1336
|
-
|
|
1337
|
-
| 'post-fx';
|
|
1276
|
+
export declare const LEGACY_APP_CAPABILITIES: ReadonlyMap<string, AppCapability>;
|
|
1277
|
+
/** The current name of an app capability; names that were never renamed, known or not, pass through. */
|
|
1278
|
+
export declare function canonicalAppCapability(name: string): string;
|
|
1279
|
+
/** What a loaded model instance can do; absent capabilities answer `unsupported-for-format`. */
|
|
1280
|
+
export declare const INSTANCE_CAPABILITIES: readonly ["motions", "expressions", "placement-2d", "placement-3d", "mtoon", "idle-clips", "idle-motions", "pose", "live2d-params", "breath", "expression-weights", "speech", "post-fx"];
|
|
1281
|
+
export type InstanceCapability = (typeof INSTANCE_CAPABILITIES)[number];
|
|
1338
1282
|
export interface InstanceRuntime {
|
|
1339
1283
|
instanceId: string;
|
|
1340
1284
|
kind: 'model' | 'object';
|
|
@@ -1378,14 +1322,20 @@ export interface AnchorOption {
|
|
|
1378
1322
|
}
|
|
1379
1323
|
export type { ModelInfo } from '../values/model-info.ts';
|
|
1380
1324
|
export interface Hotkey {
|
|
1325
|
+
/** VTS `HotkeyID`: 32 lowercase hex chars when Persona mints it. */
|
|
1381
1326
|
id: string;
|
|
1382
1327
|
name: string;
|
|
1383
1328
|
/** The VTS `Action` string verbatim; `action` is null when Persona cannot run it. */
|
|
1384
1329
|
vtsAction: string;
|
|
1330
|
+
/** Derived from `vtsAction`; `hotkey.set` ignores the value a client sends. */
|
|
1385
1331
|
action: 'expression-toggle' | 'motion-play' | 'expression-clear' | 'model-load' | null;
|
|
1332
|
+
/** A `hotkeyTargets` file, or the model's for model-load (see `modelMatchesFile`); empty for expression-clear. */
|
|
1386
1333
|
file: string;
|
|
1334
|
+
/** Keyboard accelerator or `Controller*` combo; null when the stored triggers are unsupported. */
|
|
1387
1335
|
accelerator: string | null;
|
|
1336
|
+
/** VTS `IsGlobal`: the user's intent, independent of whether registration succeeded. */
|
|
1388
1337
|
global: boolean;
|
|
1338
|
+
/** VTS `IsActive`; an inactive hotkey never fires. */
|
|
1389
1339
|
active: boolean;
|
|
1390
1340
|
/** Expression: on only while the combo is held down (VTS `DeactivateAfterKeyUp`). Default false. */
|
|
1391
1341
|
hold?: boolean;
|
|
@@ -1397,6 +1347,7 @@ export interface Hotkey {
|
|
|
1397
1347
|
stopsOnLastFrame?: boolean;
|
|
1398
1348
|
}
|
|
1399
1349
|
export interface HotkeyConfig {
|
|
1350
|
+
/** The model's master switch (VTS `HotkeySettings.UseKeyboardHotkeys`). */
|
|
1400
1351
|
keyboardEnabled: boolean;
|
|
1401
1352
|
hotkeys: Hotkey[];
|
|
1402
1353
|
}
|
|
@@ -1469,6 +1420,8 @@ export declare const TRACKING_CHANNEL_FIELDS: {
|
|
|
1469
1420
|
readonly hands: "handSourceId";
|
|
1470
1421
|
};
|
|
1471
1422
|
export declare const TRACKING_CHANNELS: readonly TrackingChannel[];
|
|
1423
|
+
/** A model item's source binding for each channel, the fields {@link TRACKING_CHANNEL_FIELDS} names. */
|
|
1424
|
+
export type ChannelBindings = Pick<SceneModelItem, (typeof TRACKING_CHANNEL_FIELDS)[TrackingChannel]>;
|
|
1472
1425
|
export declare const HAND_TRACKING_MODES: readonly ["arms", "fingers"];
|
|
1473
1426
|
/** How the face drivers react to a dropout; see `SceneModelInstance.trackingLostBehavior`. */
|
|
1474
1427
|
export declare const TRACKING_LOST_BEHAVIORS: readonly ["hold", "idle"];
|
|
@@ -1534,7 +1487,7 @@ export declare function sourceChannelEnabled(source: TrackingSourceConfig, chann
|
|
|
1534
1487
|
* share one socket per port (frames demux by phone); every other pairing EADDRINUSEs a listener.
|
|
1535
1488
|
*/
|
|
1536
1489
|
export declare function trackingPortTaken(sources: readonly TrackingSourceConfig[], kind: TrackingSourceKind, port: number, excludeId?: string): boolean;
|
|
1537
|
-
export
|
|
1490
|
+
export { EFFECTS_QUALITY_LEVELS } from '../values/effect-schema.ts';
|
|
1538
1491
|
export type EffectsQuality = (typeof EFFECTS_QUALITY_LEVELS)[number];
|
|
1539
1492
|
/**
|
|
1540
1493
|
* Accepted values for `performance.fpsLimit`; 0 = unlimited. Anything else is snapped
|
package/dist/wire/types.js
CHANGED
|
@@ -8,6 +8,8 @@ import { HAND_INPUT_NAMES, HAND_INPUT_RANGES } from "../values/hands.js";
|
|
|
8
8
|
import { VOICE_INPUT_NAMES, VOICE_INPUT_RANGES } from "../values/lipsync.js";
|
|
9
9
|
import { MOUSE_INPUT_NAMES, MOUSE_INPUT_RANGES } from "../values/mouse.js";
|
|
10
10
|
import { TIME_INPUT_NAMES, TIME_INPUT_RANGES } from "../values/time.js";
|
|
11
|
+
export const MODEL_FORMATS = ['live2d', 'vrm'];
|
|
12
|
+
export const CONTENT_ORIGINS = ['bundled', 'user'];
|
|
11
13
|
/**
|
|
12
14
|
* How a registered file is labelled. Wider than an object's content kinds: `.hdr` is only
|
|
13
15
|
* ever an environment map, and a `.vmd` splits by content — `cameraMotion` for one that
|
|
@@ -30,18 +32,22 @@ export function isAssetKind(v) {
|
|
|
30
32
|
}
|
|
31
33
|
// ---- Objects -------------------------------------------------------------------
|
|
32
34
|
export const OBJECT_SPACES = ['2d', '3d'];
|
|
35
|
+
export const CAPTURE_KINDS = ['display', 'window'];
|
|
33
36
|
export const TEXT_ALIGNS = ['left', 'center', 'right', 'justify'];
|
|
34
37
|
/** `baseline` is the first line's baseline — Blender's Top Base-Line. */
|
|
35
38
|
export const TEXT_VERTICAL_ALIGNS = ['top', 'middle', 'baseline', 'bottom'];
|
|
36
39
|
/** Blender's text-box overflow: spill past the box, shrink to fit it, or drop the lines that don't fit. */
|
|
37
40
|
export const TEXT_OVERFLOWS = ['overflow', 'scale', 'truncate'];
|
|
38
41
|
export const TEXT_STROKE_JOINS = ['round', 'miter', 'bevel'];
|
|
42
|
+
// ---- Scene sections ------------------------------------------------------------
|
|
43
|
+
export const BACKGROUND_MODES = ['transparent', 'color', 'image'];
|
|
39
44
|
/**
|
|
40
45
|
* How a following camera turns with its anchor — Warudo's Transposer binding modes. `world` follows
|
|
41
46
|
* position only; `yaw`, `yaw-pitch` and `full` also turn with it (Lock To Target With World Up, No Roll,
|
|
42
47
|
* and Lock To Target); `lazy` trails it, turning only as it passes (Simple Follow With World Up).
|
|
43
48
|
*/
|
|
44
49
|
export const CAMERA_FOLLOW_BINDINGS = ['world', 'yaw', 'yaw-pitch', 'full', 'lazy'];
|
|
50
|
+
export const CAMERA_PROJECTIONS = ['perspective', 'orthographic'];
|
|
45
51
|
export const SCENE_LIGHT_TYPES = ['directional', 'point', 'ambient', 'area', 'spot'];
|
|
46
52
|
/**
|
|
47
53
|
* Per-light shadow tier. `off` is the old `castShadow: false`; the rest raise
|
|
@@ -50,10 +56,13 @@ export const SCENE_LIGHT_TYPES = ['directional', 'point', 'ambient', 'area', 'sp
|
|
|
50
56
|
*/
|
|
51
57
|
export const SHADOW_QUALITY_LEVELS = ['off', 'low', 'medium', 'high', 'ultra'];
|
|
52
58
|
export const SHADOW_FILTERS = ['pcf', 'pcss'];
|
|
59
|
+
/** Display transform applied after the scene renders. `none` keeps colors exactly as authored. */
|
|
60
|
+
export const SCENE_TONE_MAPPINGS = ['none', 'neutral', 'aces', 'agx'];
|
|
53
61
|
// ---- Runtime state -------------------------------------------------------------
|
|
54
62
|
/**
|
|
55
63
|
* App-level features a client gates on (never version-sniff): `hello` and
|
|
56
64
|
* `app.info` report them — the per-app mirror of {@link InstanceRuntime.capabilities}.
|
|
65
|
+
* Each name leads with what it extends (`light-spot`, `object-text`), as action kinds do.
|
|
57
66
|
*/
|
|
58
67
|
export const APP_CAPABILITIES = [
|
|
59
68
|
'storage',
|
|
@@ -64,14 +73,14 @@ export const APP_CAPABILITIES = [
|
|
|
64
73
|
'asset-inspection',
|
|
65
74
|
'layer-effects',
|
|
66
75
|
'scene-transitions',
|
|
67
|
-
'area
|
|
68
|
-
'spot
|
|
69
|
-
'camera-follow
|
|
70
|
-
'shadow-
|
|
76
|
+
'light-area',
|
|
77
|
+
'light-spot',
|
|
78
|
+
'light-camera-follow',
|
|
79
|
+
'light-shadow-filter',
|
|
71
80
|
'environment-map-model',
|
|
72
|
-
'spawn',
|
|
81
|
+
'stage-spawn',
|
|
73
82
|
/** `instance.setIdle` takes `trackingLostBehavior`, `trackingLostMotion` and `trackingLostDelay`. */
|
|
74
|
-
'tracking-lost',
|
|
83
|
+
'idle-tracking-lost',
|
|
75
84
|
/** `motion.stop`; `motion.playing` and `motion.started` carry `oneShot`. */
|
|
76
85
|
'motion-stop',
|
|
77
86
|
/** `stage.capture`. */
|
|
@@ -84,7 +93,7 @@ export const APP_CAPABILITIES = [
|
|
|
84
93
|
*/
|
|
85
94
|
'object-pin-depth',
|
|
86
95
|
/** `text` object content and `fonts.list`. */
|
|
87
|
-
'text
|
|
96
|
+
'object-text',
|
|
88
97
|
/** `SceneCamera.follow`. */
|
|
89
98
|
'camera-follow',
|
|
90
99
|
/** `SceneCamera.aim`. */
|
|
@@ -94,13 +103,63 @@ export const APP_CAPABILITIES = [
|
|
|
94
103
|
/** `SceneCamera.handheld`. */
|
|
95
104
|
'camera-handheld',
|
|
96
105
|
/** `object.setContent` edits a video's `loop`, `muted` and `volume` in place; its sound follows the output device. */
|
|
97
|
-
'video-sound',
|
|
106
|
+
'object-video-sound',
|
|
98
107
|
/** Image, video and webpage content takes `chromaKey`, which `object.setContent` edits in place. */
|
|
99
108
|
'object-chroma-key',
|
|
109
|
+
/** `ModelMovementConfig.pivot`, which `model.setMovement` edits. */
|
|
110
|
+
'model-movement-pivot',
|
|
111
|
+
/** `instance.setEffects` takes objects in `2d` space too; older hosts answer `unsupported-for-format`. */
|
|
112
|
+
'layer-effects-2d',
|
|
100
113
|
];
|
|
101
114
|
export function isAppCapability(v) {
|
|
102
115
|
return isOneOf(v, APP_CAPABILITIES);
|
|
103
116
|
}
|
|
117
|
+
/**
|
|
118
|
+
* Old app capability names, each mapped to its category-first replacement. Hosts still list them for
|
|
119
|
+
* clients from before the rename; the SDK client folds them into the new names on receipt.
|
|
120
|
+
*/
|
|
121
|
+
export const LEGACY_APP_CAPABILITIES = new Map([
|
|
122
|
+
['area-lights', 'light-area'],
|
|
123
|
+
['spot-lights', 'light-spot'],
|
|
124
|
+
['camera-follow-lights', 'light-camera-follow'],
|
|
125
|
+
['shadow-filters', 'light-shadow-filter'],
|
|
126
|
+
['spawn', 'stage-spawn'],
|
|
127
|
+
['tracking-lost', 'idle-tracking-lost'],
|
|
128
|
+
['text-objects', 'object-text'],
|
|
129
|
+
['video-sound', 'object-video-sound'],
|
|
130
|
+
]);
|
|
131
|
+
/** The current name of an app capability; names that were never renamed, known or not, pass through. */
|
|
132
|
+
export function canonicalAppCapability(name) {
|
|
133
|
+
return LEGACY_APP_CAPABILITIES.get(name) ?? name;
|
|
134
|
+
}
|
|
135
|
+
/** What a loaded model instance can do; absent capabilities answer `unsupported-for-format`. */
|
|
136
|
+
export const INSTANCE_CAPABILITIES = [
|
|
137
|
+
'motions',
|
|
138
|
+
'expressions',
|
|
139
|
+
'placement-2d',
|
|
140
|
+
'placement-3d',
|
|
141
|
+
'mtoon',
|
|
142
|
+
'idle-clips',
|
|
143
|
+
/** `instance.setIdle` with `idleMotion`: one of the model's motions loops as its idle. Live2D only. */
|
|
144
|
+
'idle-motions',
|
|
145
|
+
'pose',
|
|
146
|
+
'live2d-params',
|
|
147
|
+
/** `instance.setBreath`; the idle breathing loop is Cubism's, so VRM lacks it. */
|
|
148
|
+
'breath',
|
|
149
|
+
/** `expression.setWeight`; Cubism expressions carry no user-settable weight, so Live2D lacks it. */
|
|
150
|
+
'expression-weights',
|
|
151
|
+
/**
|
|
152
|
+
* `speech.play` lip-sync. Loaded Live2D models only; 0.53 and earlier hosts also omit it under
|
|
153
|
+
* the Pixi engine, so gate on the runtime, not the format.
|
|
154
|
+
*/
|
|
155
|
+
'speech',
|
|
156
|
+
/**
|
|
157
|
+
* Draws through the 3D post chain, so the scene's look rows (tone mapping, exposure, LUT)
|
|
158
|
+
* reach it. Every model; 0.53 and earlier hosts omit it on Pixi-engine Live2D, so read it off
|
|
159
|
+
* the runtime rather than the format.
|
|
160
|
+
*/
|
|
161
|
+
'post-fx',
|
|
162
|
+
];
|
|
104
163
|
// ---- App automations --------------------------------------------------------------
|
|
105
164
|
/** Action kinds an app automation can carry today; servers may send kinds newer than this list. */
|
|
106
165
|
export const AUTOMATION_ACTION_KINDS = [
|
|
@@ -220,7 +279,7 @@ export function sourceChannelEnabled(source, channel, masters) {
|
|
|
220
279
|
export function trackingPortTaken(sources, kind, port, excludeId) {
|
|
221
280
|
return sources.some(s => s.id !== excludeId && s.port === port && !(s.kind === 'ifacialmocap' && kind === 'ifacialmocap'));
|
|
222
281
|
}
|
|
223
|
-
export
|
|
282
|
+
export { EFFECTS_QUALITY_LEVELS } from "../values/effect-schema.js";
|
|
224
283
|
/**
|
|
225
284
|
* Accepted values for `performance.fpsLimit`; 0 = unlimited. Anything else is snapped
|
|
226
285
|
* to the nearest preset by the app, so a picker offering other values would lie.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@laplace.live/persona-sdk",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.25.0",
|
|
4
4
|
"description": "TypeScript SDK and wire schema for the LAPLACE Persona plugin API",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
"devDependencies": {
|
|
29
29
|
"rimraf": "^6.1.3",
|
|
30
30
|
"typescript": "~6.0.3",
|
|
31
|
-
"vitest": "^5.0.
|
|
31
|
+
"vitest": "^5.0.3"
|
|
32
32
|
},
|
|
33
33
|
"engines": {
|
|
34
34
|
"node": ">=24"
|