@laplace.live/persona-sdk 0.18.1 → 1.1.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 +4 -2
- package/dist/client/client.d.ts +1 -1
- package/dist/index.d.ts +9 -1
- package/dist/index.js +9 -1
- package/dist/values/bindings.d.ts +43 -0
- package/dist/values/bindings.js +1 -0
- package/dist/values/controller.d.ts +109 -0
- package/dist/values/controller.js +167 -0
- package/dist/values/curve.d.ts +5 -8
- package/dist/values/curve.js +16 -7
- package/dist/values/edit-history.d.ts +21 -0
- package/dist/values/edit-history.js +62 -0
- package/dist/values/effect-schema.d.ts +72 -12
- package/dist/values/effect-schema.js +279 -67
- package/dist/values/gltf-extensions.d.ts +20 -0
- package/dist/values/gltf-extensions.js +68 -0
- package/dist/values/guards.d.ts +2 -0
- package/dist/values/guards.js +5 -0
- package/dist/values/hands.d.ts +53 -0
- package/dist/values/hands.js +89 -0
- package/dist/values/hotkeys.d.ts +6 -0
- package/dist/values/hotkeys.js +11 -0
- package/dist/values/labels.d.ts +2 -0
- package/dist/values/labels.js +5 -1
- package/dist/values/limits.d.ts +19 -0
- package/dist/values/limits.js +27 -0
- package/dist/values/lipsync.d.ts +106 -0
- package/dist/values/lipsync.js +120 -0
- package/dist/values/locale.d.ts +2 -0
- package/dist/values/model-info.d.ts +66 -0
- package/dist/values/model-info.js +1 -0
- package/dist/values/stage-info.d.ts +27 -0
- package/dist/values/stage-info.js +1 -0
- package/dist/values/vrm-bindings.d.ts +14 -0
- package/dist/values/vrm-bindings.js +20 -0
- package/dist/wire/events.d.ts +1 -1
- package/dist/wire/methods.d.ts +210 -5
- package/dist/wire/protocol.d.ts +1 -1
- package/dist/wire/protocol.js +1 -1
- package/dist/wire/schemas.d.ts +116 -2
- package/dist/wire/schemas.js +40 -0
- package/dist/wire/types.d.ts +294 -131
- package/dist/wire/types.js +90 -12
- package/package.json +3 -17
- package/dist/effects.d.ts +0 -79
- package/dist/effects.js +0 -6
- package/dist/values/custom-effect.d.ts +0 -44
- package/dist/values/custom-effect.js +0 -136
package/dist/wire/methods.d.ts
CHANGED
|
@@ -1,5 +1,9 @@
|
|
|
1
|
+
import type { Binding, BindingEditorData } from '../values/bindings.ts';
|
|
2
|
+
import type { ControllerMovementConfig, ControllerState } from '../values/controller.ts';
|
|
3
|
+
import type { LipSyncCalibrationCommand, LipSyncConfig, LipSyncMode, LipSyncState } from '../values/lipsync.ts';
|
|
4
|
+
import type { SceneInspection } from '../values/stage-info.ts';
|
|
1
5
|
import type { EventName } from './events.ts';
|
|
2
|
-
import type { AnchorOption, AppCapability, AssetKind, AssetRef, Attach, AttachHeadAngle, Expression, ExpressionPersistence, HotkeyConfig, HotkeyState, InjectEntry, InjectTarget, InstanceRuntime, JsonValue, ModelInfo, ModelRef, MotionGroup, MToonTuning, ObjectContent, ObjectLightOverride, ObjectSpace, Place2D, Place3D, PlayingMotion, PoseSourceId, PoseStatus, Scene, SceneItem, ScenePatch, SceneState, ScreenPlacement, Settings, SettingsPatch, ShortcutInfo, TrackingSourceConfig, TrackingSourceId, TrackingSourceKind, TrackingStatus, VrmPlacement } from './types.ts';
|
|
6
|
+
import type { AnchorOption, AppCapability, AssetKind, AssetRef, Attach, AttachHeadAngle, 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, ScenePatch, SceneState, ScreenPlacement, Settings, SettingsPatch, ShortcutInfo, TrackingSourceConfig, TrackingSourceId, TrackingSourceKind, TrackingStatus, VrmPlacement } from './types.ts';
|
|
3
7
|
/** Marker for methods that take no parameters; the client lets you omit the argument. */
|
|
4
8
|
export type EmptyRequest = Record<never, never>;
|
|
5
9
|
/** Marker for methods whose success response carries no data. */
|
|
@@ -73,13 +77,48 @@ export interface InstanceSetVisibleRequest {
|
|
|
73
77
|
visible: boolean;
|
|
74
78
|
}
|
|
75
79
|
export type InstanceSetVisibleResponse = EmptyResponse;
|
|
80
|
+
/** Edits one model or object's source effects; gate on the `layer-effects` app capability. */
|
|
81
|
+
export interface InstanceSetEffectsRequest {
|
|
82
|
+
instanceId: string;
|
|
83
|
+
effects: LayerEffectsPatch;
|
|
84
|
+
/** Replaces the added-effect list; omitted preserves it. Enabled effects always appear. */
|
|
85
|
+
effectLayers?: LayerEffectKey[];
|
|
86
|
+
}
|
|
87
|
+
export interface InstanceSetEffectsResponse {
|
|
88
|
+
effects: LayerEffects;
|
|
89
|
+
effectLayers: LayerEffectKey[];
|
|
90
|
+
}
|
|
76
91
|
/** Omitted fields keep their binding; null stops tracking that channel for this instance. */
|
|
77
92
|
export interface InstanceSetTrackingSourcesRequest {
|
|
78
93
|
instanceId: string;
|
|
79
94
|
faceSourceId?: string | null;
|
|
80
95
|
poseSourceId?: string | null;
|
|
96
|
+
handSourceId?: string | null;
|
|
97
|
+
handTrackingMode?: HandTrackingMode;
|
|
81
98
|
}
|
|
82
99
|
export type InstanceSetTrackingSourcesResponse = EmptyResponse;
|
|
100
|
+
export interface InstanceSetControllerMovementRequest {
|
|
101
|
+
instanceId: string;
|
|
102
|
+
movement: Partial<ControllerMovementConfig>;
|
|
103
|
+
}
|
|
104
|
+
export interface InstanceSetControllerMovementResponse {
|
|
105
|
+
movement: ControllerMovementConfig;
|
|
106
|
+
}
|
|
107
|
+
export interface InstanceSetLipSyncRequest {
|
|
108
|
+
instanceId?: string;
|
|
109
|
+
mode: LipSyncMode;
|
|
110
|
+
}
|
|
111
|
+
export interface InstanceSetLipSyncResponse {
|
|
112
|
+
mode: LipSyncMode;
|
|
113
|
+
}
|
|
114
|
+
export type LipSyncStateRequest = EmptyRequest;
|
|
115
|
+
export type LipSyncStateResponse = LipSyncState;
|
|
116
|
+
export type LipSyncConfigureRequest = Partial<LipSyncConfig>;
|
|
117
|
+
export type LipSyncConfigureResponse = LipSyncConfig;
|
|
118
|
+
export type LipSyncRestartRequest = EmptyRequest;
|
|
119
|
+
export type LipSyncRestartResponse = EmptyResponse;
|
|
120
|
+
export type LipSyncCalibrateRequest = LipSyncCalibrationCommand;
|
|
121
|
+
export type LipSyncCalibrateResponse = LipSyncState;
|
|
83
122
|
export interface InstanceReorderRequest {
|
|
84
123
|
/** Full z-order within the scene; ids not listed keep their relative order at the end. */
|
|
85
124
|
orderedInstanceIds: string[];
|
|
@@ -301,6 +340,7 @@ export interface SettingsPatchResponse {
|
|
|
301
340
|
settings: Settings;
|
|
302
341
|
}
|
|
303
342
|
export interface TrackingSetEnabledRequest {
|
|
343
|
+
/** Enables network face sources; webcam tracking is controlled by its source's enabled flag. */
|
|
304
344
|
enabled: boolean;
|
|
305
345
|
}
|
|
306
346
|
export type TrackingSetEnabledResponse = EmptyResponse;
|
|
@@ -309,13 +349,14 @@ export interface TrackingSetSourceRequest {
|
|
|
309
349
|
}
|
|
310
350
|
export type TrackingSetSourceResponse = EmptyResponse;
|
|
311
351
|
export interface PoseSetEnabledRequest {
|
|
352
|
+
/** Enables network body sources; webcam tracking is controlled by its source's enabled flag. */
|
|
312
353
|
enabled: boolean;
|
|
313
354
|
}
|
|
314
355
|
export type PoseSetEnabledResponse = EmptyResponse;
|
|
315
356
|
export interface PoseSetSourceRequest {
|
|
316
357
|
source: PoseSourceId;
|
|
317
358
|
}
|
|
318
|
-
/** Switching protocol resets the port to that source's default; the response reports it. */
|
|
359
|
+
/** Switching protocol resets the port to that source's next free default; the response reports it. */
|
|
319
360
|
export interface PoseSetSourceResponse {
|
|
320
361
|
port: number;
|
|
321
362
|
}
|
|
@@ -328,8 +369,12 @@ export interface TrackingAddSourceRequest {
|
|
|
328
369
|
name?: string;
|
|
329
370
|
/** Face kinds: pin to a device IP. */
|
|
330
371
|
phoneIp?: string | null;
|
|
331
|
-
/**
|
|
372
|
+
/**
|
|
373
|
+
* vmc / mocopi: the UDP port to listen on, default the next free port from 39539 / 12351.
|
|
374
|
+
* ifacialmocap: the receive port, default 49983 (set the phone's Send Port to match).
|
|
375
|
+
*/
|
|
332
376
|
port?: number;
|
|
377
|
+
mediapipe?: Partial<MediaPipeConfig>;
|
|
333
378
|
}
|
|
334
379
|
export interface TrackingAddSourceResponse {
|
|
335
380
|
source: TrackingSourceConfig;
|
|
@@ -340,6 +385,7 @@ export interface TrackingUpdateSourceRequest {
|
|
|
340
385
|
enabled?: boolean;
|
|
341
386
|
phoneIp?: string | null;
|
|
342
387
|
port?: number;
|
|
388
|
+
mediapipe?: Partial<MediaPipeConfig>;
|
|
343
389
|
}
|
|
344
390
|
export interface TrackingUpdateSourceResponse {
|
|
345
391
|
source: TrackingSourceConfig;
|
|
@@ -350,7 +396,9 @@ export interface TrackingRemoveSourceRequest {
|
|
|
350
396
|
export type TrackingRemoveSourceResponse = EmptyResponse;
|
|
351
397
|
export type TrackingStatusRequest = EmptyRequest;
|
|
352
398
|
export interface TrackingStatusResponse {
|
|
399
|
+
/** Aggregate network face status. Webcam activity is reported in sources. */
|
|
353
400
|
tracking: TrackingStatus;
|
|
401
|
+
/** Aggregate network body status. Webcam activity is reported in sources. */
|
|
354
402
|
pose: PoseStatus;
|
|
355
403
|
/** Per-source status by {@link TrackingSourceConfig.id}. */
|
|
356
404
|
sources: Record<string, TrackingStatus>;
|
|
@@ -440,11 +488,160 @@ export interface ParamReleaseRequest {
|
|
|
440
488
|
targets?: InjectTarget[];
|
|
441
489
|
}
|
|
442
490
|
export type ParamReleaseResponse = EmptyResponse;
|
|
491
|
+
export type ControllerStateRequest = EmptyRequest;
|
|
492
|
+
export type ControllerStateResponse = ControllerState;
|
|
493
|
+
export interface ControllerRenameRequest {
|
|
494
|
+
slot: number;
|
|
495
|
+
name: string;
|
|
496
|
+
}
|
|
497
|
+
export type ControllerRenameResponse = EmptyResponse;
|
|
498
|
+
export interface ControllerSetDeadZoneRequest {
|
|
499
|
+
slot: number;
|
|
500
|
+
/** Radial stick dead zone, 0..0.5. */
|
|
501
|
+
deadZone: number;
|
|
502
|
+
}
|
|
503
|
+
export type ControllerSetDeadZoneResponse = EmptyResponse;
|
|
504
|
+
export interface ControllerRemoveRequest {
|
|
505
|
+
slot: number;
|
|
506
|
+
}
|
|
507
|
+
export type ControllerRemoveResponse = EmptyResponse;
|
|
508
|
+
export interface ControllerAssignRequest {
|
|
509
|
+
slot: number | null;
|
|
510
|
+
}
|
|
511
|
+
export type ControllerAssignResponse = EmptyResponse;
|
|
512
|
+
export interface BindingTarget {
|
|
513
|
+
instanceId: string;
|
|
514
|
+
modelId: string;
|
|
515
|
+
}
|
|
516
|
+
export type BindingGetRequest = BindingTarget;
|
|
517
|
+
export type BindingReleaseRequest = BindingTarget;
|
|
518
|
+
export type BindingReleaseResponse = EmptyResponse;
|
|
519
|
+
export interface BindingGetResponse {
|
|
520
|
+
data: BindingEditorData | null;
|
|
521
|
+
}
|
|
522
|
+
export interface BindingPreviewRequest extends BindingTarget {
|
|
523
|
+
connections: Binding[];
|
|
524
|
+
}
|
|
525
|
+
export type BindingPreviewResponse = EmptyResponse;
|
|
526
|
+
export type BindingSetRequest = BindingPreviewRequest;
|
|
527
|
+
export interface BindingSetResponse {
|
|
528
|
+
saved: boolean;
|
|
529
|
+
}
|
|
530
|
+
export type BindingInputsRequest = BindingTarget;
|
|
531
|
+
export interface BindingInputsResponse {
|
|
532
|
+
inputs: Partial<Record<BindingInput, number>>;
|
|
533
|
+
}
|
|
534
|
+
export interface BindingOverrideRequest extends BindingTarget {
|
|
535
|
+
input: BindingInput;
|
|
536
|
+
value: number | null;
|
|
537
|
+
}
|
|
538
|
+
export type BindingOverrideResponse = EmptyResponse;
|
|
539
|
+
export interface InstanceSetBreathRequest {
|
|
540
|
+
instanceId: string;
|
|
541
|
+
breath?: boolean;
|
|
542
|
+
breathDepth?: number;
|
|
543
|
+
}
|
|
544
|
+
export type InstanceSetBreathResponse = EmptyResponse;
|
|
545
|
+
/** A small image preview for a registered id; never a path or arbitrary file request. */
|
|
546
|
+
export interface RegistryThumbnailRequest {
|
|
547
|
+
kind: 'model' | 'asset';
|
|
548
|
+
id: string;
|
|
549
|
+
}
|
|
550
|
+
export interface RegistryThumbnailResponse {
|
|
551
|
+
dataUrl: string | null;
|
|
552
|
+
}
|
|
553
|
+
export type SceneInspectRequest = EmptyRequest;
|
|
554
|
+
export type SceneInspectResponse = SceneInspection;
|
|
555
|
+
export interface MotionPlayAssetRequest {
|
|
556
|
+
instanceId: string;
|
|
557
|
+
assetId: string;
|
|
558
|
+
}
|
|
559
|
+
export type MotionPlayAssetResponse = EmptyResponse;
|
|
443
560
|
/**
|
|
444
561
|
* The full request surface: method → request/response. Model-scoped methods take
|
|
445
562
|
* an optional `instanceId` defaulting to the scene's primary model instance.
|
|
446
563
|
*/
|
|
447
564
|
export interface MethodMap {
|
|
565
|
+
'registry.thumbnail': {
|
|
566
|
+
request: RegistryThumbnailRequest;
|
|
567
|
+
response: RegistryThumbnailResponse;
|
|
568
|
+
};
|
|
569
|
+
'scene.inspect': {
|
|
570
|
+
request: SceneInspectRequest;
|
|
571
|
+
response: SceneInspectResponse;
|
|
572
|
+
};
|
|
573
|
+
'motion.playAsset': {
|
|
574
|
+
request: MotionPlayAssetRequest;
|
|
575
|
+
response: MotionPlayAssetResponse;
|
|
576
|
+
};
|
|
577
|
+
'binding.release': {
|
|
578
|
+
request: BindingReleaseRequest;
|
|
579
|
+
response: BindingReleaseResponse;
|
|
580
|
+
};
|
|
581
|
+
'binding.get': {
|
|
582
|
+
request: BindingGetRequest;
|
|
583
|
+
response: BindingGetResponse;
|
|
584
|
+
};
|
|
585
|
+
'binding.preview': {
|
|
586
|
+
request: BindingPreviewRequest;
|
|
587
|
+
response: BindingPreviewResponse;
|
|
588
|
+
};
|
|
589
|
+
'binding.set': {
|
|
590
|
+
request: BindingSetRequest;
|
|
591
|
+
response: BindingSetResponse;
|
|
592
|
+
};
|
|
593
|
+
'binding.inputs': {
|
|
594
|
+
request: BindingInputsRequest;
|
|
595
|
+
response: BindingInputsResponse;
|
|
596
|
+
};
|
|
597
|
+
'binding.override': {
|
|
598
|
+
request: BindingOverrideRequest;
|
|
599
|
+
response: BindingOverrideResponse;
|
|
600
|
+
};
|
|
601
|
+
'instance.setBreath': {
|
|
602
|
+
request: InstanceSetBreathRequest;
|
|
603
|
+
response: InstanceSetBreathResponse;
|
|
604
|
+
};
|
|
605
|
+
'instance.setLipSync': {
|
|
606
|
+
request: InstanceSetLipSyncRequest;
|
|
607
|
+
response: InstanceSetLipSyncResponse;
|
|
608
|
+
};
|
|
609
|
+
'lipSync.state': {
|
|
610
|
+
request: LipSyncStateRequest;
|
|
611
|
+
response: LipSyncStateResponse;
|
|
612
|
+
};
|
|
613
|
+
'lipSync.configure': {
|
|
614
|
+
request: LipSyncConfigureRequest;
|
|
615
|
+
response: LipSyncConfigureResponse;
|
|
616
|
+
};
|
|
617
|
+
'lipSync.restart': {
|
|
618
|
+
request: LipSyncRestartRequest;
|
|
619
|
+
response: LipSyncRestartResponse;
|
|
620
|
+
};
|
|
621
|
+
'lipSync.calibrate': {
|
|
622
|
+
request: LipSyncCalibrateRequest;
|
|
623
|
+
response: LipSyncCalibrateResponse;
|
|
624
|
+
};
|
|
625
|
+
'controller.state': {
|
|
626
|
+
request: ControllerStateRequest;
|
|
627
|
+
response: ControllerStateResponse;
|
|
628
|
+
};
|
|
629
|
+
'controller.rename': {
|
|
630
|
+
request: ControllerRenameRequest;
|
|
631
|
+
response: ControllerRenameResponse;
|
|
632
|
+
};
|
|
633
|
+
'controller.setDeadZone': {
|
|
634
|
+
request: ControllerSetDeadZoneRequest;
|
|
635
|
+
response: ControllerSetDeadZoneResponse;
|
|
636
|
+
};
|
|
637
|
+
'controller.remove': {
|
|
638
|
+
request: ControllerRemoveRequest;
|
|
639
|
+
response: ControllerRemoveResponse;
|
|
640
|
+
};
|
|
641
|
+
'controller.assign': {
|
|
642
|
+
request: ControllerAssignRequest;
|
|
643
|
+
response: ControllerAssignResponse;
|
|
644
|
+
};
|
|
448
645
|
'scene.list': {
|
|
449
646
|
request: SceneListRequest;
|
|
450
647
|
response: SceneListResponse;
|
|
@@ -508,11 +705,19 @@ export interface MethodMap {
|
|
|
508
705
|
request: InstanceSetVisibleRequest;
|
|
509
706
|
response: InstanceSetVisibleResponse;
|
|
510
707
|
};
|
|
708
|
+
'instance.setEffects': {
|
|
709
|
+
request: InstanceSetEffectsRequest;
|
|
710
|
+
response: InstanceSetEffectsResponse;
|
|
711
|
+
};
|
|
511
712
|
/** Bind this instance's face/pose channels to tracking sources (null stops tracking that channel). */
|
|
512
713
|
'instance.setTrackingSources': {
|
|
513
714
|
request: InstanceSetTrackingSourcesRequest;
|
|
514
715
|
response: InstanceSetTrackingSourcesResponse;
|
|
515
716
|
};
|
|
717
|
+
'instance.setControllerMovement': {
|
|
718
|
+
request: InstanceSetControllerMovementRequest;
|
|
719
|
+
response: InstanceSetControllerMovementResponse;
|
|
720
|
+
};
|
|
516
721
|
'instance.reorder': {
|
|
517
722
|
request: InstanceReorderRequest;
|
|
518
723
|
response: InstanceReorderResponse;
|
|
@@ -696,12 +901,12 @@ export interface MethodMap {
|
|
|
696
901
|
request: PoseSetEnabledRequest;
|
|
697
902
|
response: PoseSetEnabledResponse;
|
|
698
903
|
};
|
|
699
|
-
/** Legacy: operates on the first
|
|
904
|
+
/** Legacy: operates on the first body source. Prefer the tracking.* source CRUD. */
|
|
700
905
|
'pose.setSource': {
|
|
701
906
|
request: PoseSetSourceRequest;
|
|
702
907
|
response: PoseSetSourceResponse;
|
|
703
908
|
};
|
|
704
|
-
/** Legacy: sets the first
|
|
909
|
+
/** Legacy: sets the first body source's port. */
|
|
705
910
|
'pose.setPort': {
|
|
706
911
|
request: PoseSetPortRequest;
|
|
707
912
|
response: PoseSetPortResponse;
|
package/dist/wire/protocol.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { InjectTarget } from './types.ts';
|
|
2
2
|
/** Bumped on breaking wire changes; the server reports it in `hello` and clients warn on mismatch. */
|
|
3
|
-
export declare const PROTOCOL_VERSION =
|
|
3
|
+
export declare const PROTOCOL_VERSION = 2;
|
|
4
4
|
/** Default port the Persona API server listens on (user-configurable in the app). */
|
|
5
5
|
export declare const DEFAULT_API_PORT = 25034;
|
|
6
6
|
/** Default host clients dial: the server binds loopback unless LAN is opted in. */
|
package/dist/wire/protocol.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/** Bumped on breaking wire changes; the server reports it in `hello` and clients warn on mismatch. */
|
|
2
|
-
export const PROTOCOL_VERSION =
|
|
2
|
+
export const PROTOCOL_VERSION = 2;
|
|
3
3
|
/** Default port the Persona API server listens on (user-configurable in the app). */
|
|
4
4
|
export const DEFAULT_API_PORT = 25034;
|
|
5
5
|
/** Default host clients dial: the server binds loopback unless LAN is opted in. */
|
package/dist/wire/schemas.d.ts
CHANGED
|
@@ -22,6 +22,16 @@ export declare const InjectEntrySchema: z.ZodObject<{
|
|
|
22
22
|
weight: z.ZodOptional<z.ZodNumber>;
|
|
23
23
|
}, z.core.$strip>;
|
|
24
24
|
export declare const SettingsPatchSchema: z.ZodObject<{
|
|
25
|
+
lipSync: z.ZodOptional<z.ZodObject<{
|
|
26
|
+
enabled: z.ZodOptional<z.ZodBoolean>;
|
|
27
|
+
deviceId: z.ZodOptional<z.ZodString>;
|
|
28
|
+
gain: z.ZodOptional<z.ZodNumber>;
|
|
29
|
+
noiseGate: z.ZodOptional<z.ZodNumber>;
|
|
30
|
+
smoothing: z.ZodOptional<z.ZodNumber>;
|
|
31
|
+
}, z.core.$strip>>;
|
|
32
|
+
controller: z.ZodOptional<z.ZodObject<{
|
|
33
|
+
enabled: z.ZodOptional<z.ZodBoolean>;
|
|
34
|
+
}, z.core.$strip>>;
|
|
25
35
|
window: z.ZodOptional<z.ZodObject<{
|
|
26
36
|
alwaysOnTop: z.ZodOptional<z.ZodBoolean>;
|
|
27
37
|
}, z.core.$strip>>;
|
|
@@ -37,9 +47,71 @@ export declare const SettingsPatchSchema: z.ZodObject<{
|
|
|
37
47
|
medium: "medium";
|
|
38
48
|
high: "high";
|
|
39
49
|
}>>;
|
|
50
|
+
renderScale: z.ZodOptional<z.ZodNumber>;
|
|
51
|
+
live2dEngine: z.ZodOptional<z.ZodEnum<{
|
|
52
|
+
pixi: "pixi";
|
|
53
|
+
three: "three";
|
|
54
|
+
}>>;
|
|
40
55
|
}, z.core.$strip>>;
|
|
41
56
|
}, z.core.$strip>;
|
|
42
57
|
export declare const requestSchemas: {
|
|
58
|
+
'lipSync.state': z.ZodObject<{}, z.core.$strip>;
|
|
59
|
+
'lipSync.configure': z.ZodObject<{
|
|
60
|
+
enabled: z.ZodOptional<z.ZodBoolean>;
|
|
61
|
+
deviceId: z.ZodOptional<z.ZodString>;
|
|
62
|
+
gain: z.ZodOptional<z.ZodNumber>;
|
|
63
|
+
noiseGate: z.ZodOptional<z.ZodNumber>;
|
|
64
|
+
smoothing: z.ZodOptional<z.ZodNumber>;
|
|
65
|
+
}, z.core.$strip>;
|
|
66
|
+
'lipSync.restart': z.ZodObject<{}, z.core.$strip>;
|
|
67
|
+
'lipSync.calibrate': z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
68
|
+
action: z.ZodEnum<{
|
|
69
|
+
start: "start";
|
|
70
|
+
cancel: "cancel";
|
|
71
|
+
preview: "preview";
|
|
72
|
+
save: "save";
|
|
73
|
+
reset: "reset";
|
|
74
|
+
}>;
|
|
75
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
76
|
+
action: z.ZodLiteral<"record">;
|
|
77
|
+
phoneme: z.ZodEnum<{
|
|
78
|
+
A: "A";
|
|
79
|
+
I: "I";
|
|
80
|
+
U: "U";
|
|
81
|
+
E: "E";
|
|
82
|
+
O: "O";
|
|
83
|
+
S: "S";
|
|
84
|
+
}>;
|
|
85
|
+
}, z.core.$strip>], "action">;
|
|
86
|
+
'instance.setLipSync': z.ZodObject<{
|
|
87
|
+
instanceId: z.ZodOptional<z.ZodString>;
|
|
88
|
+
mode: z.ZodEnum<{
|
|
89
|
+
off: "off";
|
|
90
|
+
always: "always";
|
|
91
|
+
"when-untracked": "when-untracked";
|
|
92
|
+
}>;
|
|
93
|
+
}, z.core.$strip>;
|
|
94
|
+
'registry.thumbnail': z.ZodObject<{
|
|
95
|
+
kind: z.ZodEnum<{
|
|
96
|
+
model: "model";
|
|
97
|
+
asset: "asset";
|
|
98
|
+
}>;
|
|
99
|
+
id: z.ZodString;
|
|
100
|
+
}, z.core.$strip>;
|
|
101
|
+
'controller.rename': z.ZodObject<{
|
|
102
|
+
slot: z.ZodNumber;
|
|
103
|
+
name: z.ZodString;
|
|
104
|
+
}, z.core.$strip>;
|
|
105
|
+
'controller.setDeadZone': z.ZodObject<{
|
|
106
|
+
slot: z.ZodNumber;
|
|
107
|
+
deadZone: z.ZodNumber;
|
|
108
|
+
}, z.core.$strip>;
|
|
109
|
+
'controller.remove': z.ZodObject<{
|
|
110
|
+
slot: z.ZodNumber;
|
|
111
|
+
}, z.core.$strip>;
|
|
112
|
+
'controller.assign': z.ZodObject<{
|
|
113
|
+
slot: z.ZodNullable<z.ZodNumber>;
|
|
114
|
+
}, z.core.$strip>;
|
|
43
115
|
'scene.get': z.ZodObject<{
|
|
44
116
|
sceneId: z.ZodOptional<z.ZodString>;
|
|
45
117
|
}, z.core.$strip>;
|
|
@@ -97,13 +169,27 @@ export declare const requestSchemas: {
|
|
|
97
169
|
}, z.core.$strip>;
|
|
98
170
|
'tracking.addSource': z.ZodObject<{
|
|
99
171
|
kind: z.ZodEnum<{
|
|
100
|
-
"
|
|
172
|
+
"persona-ios": "persona-ios";
|
|
101
173
|
ifacialmocap: "ifacialmocap";
|
|
174
|
+
"vts-ios": "vts-ios";
|
|
102
175
|
vmc: "vmc";
|
|
176
|
+
mocopi: "mocopi";
|
|
177
|
+
mediapipe: "mediapipe";
|
|
103
178
|
}>;
|
|
104
179
|
name: z.ZodOptional<z.ZodString>;
|
|
105
180
|
phoneIp: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
106
181
|
port: z.ZodOptional<z.ZodNumber>;
|
|
182
|
+
mediapipe: z.ZodOptional<z.ZodObject<{
|
|
183
|
+
deviceId: z.ZodOptional<z.ZodString>;
|
|
184
|
+
mirror: z.ZodOptional<z.ZodBoolean>;
|
|
185
|
+
face: z.ZodOptional<z.ZodBoolean>;
|
|
186
|
+
hands: z.ZodOptional<z.ZodBoolean>;
|
|
187
|
+
body: z.ZodOptional<z.ZodBoolean>;
|
|
188
|
+
delegate: z.ZodOptional<z.ZodEnum<{
|
|
189
|
+
CPU: "CPU";
|
|
190
|
+
GPU: "GPU";
|
|
191
|
+
}>>;
|
|
192
|
+
}, z.core.$strip>>;
|
|
107
193
|
}, z.core.$strip>;
|
|
108
194
|
'tracking.updateSource': z.ZodObject<{
|
|
109
195
|
id: z.ZodString;
|
|
@@ -111,6 +197,17 @@ export declare const requestSchemas: {
|
|
|
111
197
|
enabled: z.ZodOptional<z.ZodBoolean>;
|
|
112
198
|
phoneIp: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
113
199
|
port: z.ZodOptional<z.ZodNumber>;
|
|
200
|
+
mediapipe: z.ZodOptional<z.ZodObject<{
|
|
201
|
+
deviceId: z.ZodOptional<z.ZodString>;
|
|
202
|
+
mirror: z.ZodOptional<z.ZodBoolean>;
|
|
203
|
+
face: z.ZodOptional<z.ZodBoolean>;
|
|
204
|
+
hands: z.ZodOptional<z.ZodBoolean>;
|
|
205
|
+
body: z.ZodOptional<z.ZodBoolean>;
|
|
206
|
+
delegate: z.ZodOptional<z.ZodEnum<{
|
|
207
|
+
CPU: "CPU";
|
|
208
|
+
GPU: "GPU";
|
|
209
|
+
}>>;
|
|
210
|
+
}, z.core.$strip>>;
|
|
114
211
|
}, z.core.$strip>;
|
|
115
212
|
'tracking.removeSource': z.ZodObject<{
|
|
116
213
|
id: z.ZodString;
|
|
@@ -132,6 +229,16 @@ export declare const requestSchemas: {
|
|
|
132
229
|
}, z.core.$strip>;
|
|
133
230
|
'settings.patch': z.ZodObject<{
|
|
134
231
|
settings: z.ZodObject<{
|
|
232
|
+
lipSync: z.ZodOptional<z.ZodObject<{
|
|
233
|
+
enabled: z.ZodOptional<z.ZodBoolean>;
|
|
234
|
+
deviceId: z.ZodOptional<z.ZodString>;
|
|
235
|
+
gain: z.ZodOptional<z.ZodNumber>;
|
|
236
|
+
noiseGate: z.ZodOptional<z.ZodNumber>;
|
|
237
|
+
smoothing: z.ZodOptional<z.ZodNumber>;
|
|
238
|
+
}, z.core.$strip>>;
|
|
239
|
+
controller: z.ZodOptional<z.ZodObject<{
|
|
240
|
+
enabled: z.ZodOptional<z.ZodBoolean>;
|
|
241
|
+
}, z.core.$strip>>;
|
|
135
242
|
window: z.ZodOptional<z.ZodObject<{
|
|
136
243
|
alwaysOnTop: z.ZodOptional<z.ZodBoolean>;
|
|
137
244
|
}, z.core.$strip>>;
|
|
@@ -147,6 +254,11 @@ export declare const requestSchemas: {
|
|
|
147
254
|
medium: "medium";
|
|
148
255
|
high: "high";
|
|
149
256
|
}>>;
|
|
257
|
+
renderScale: z.ZodOptional<z.ZodNumber>;
|
|
258
|
+
live2dEngine: z.ZodOptional<z.ZodEnum<{
|
|
259
|
+
pixi: "pixi";
|
|
260
|
+
three: "three";
|
|
261
|
+
}>>;
|
|
150
262
|
}, z.core.$strip>>;
|
|
151
263
|
}, z.core.$strip>;
|
|
152
264
|
}, z.core.$strip>;
|
|
@@ -155,8 +267,9 @@ export declare const requestSchemas: {
|
|
|
155
267
|
}, z.core.$strip>;
|
|
156
268
|
'tracking.setSource': z.ZodObject<{
|
|
157
269
|
source: z.ZodEnum<{
|
|
158
|
-
"
|
|
270
|
+
"persona-ios": "persona-ios";
|
|
159
271
|
ifacialmocap: "ifacialmocap";
|
|
272
|
+
"vts-ios": "vts-ios";
|
|
160
273
|
}>;
|
|
161
274
|
}, z.core.$strip>;
|
|
162
275
|
'pose.setEnabled': z.ZodObject<{
|
|
@@ -165,6 +278,7 @@ export declare const requestSchemas: {
|
|
|
165
278
|
'pose.setSource': z.ZodObject<{
|
|
166
279
|
source: z.ZodEnum<{
|
|
167
280
|
vmc: "vmc";
|
|
281
|
+
mocopi: "mocopi";
|
|
168
282
|
}>;
|
|
169
283
|
}, z.core.$strip>;
|
|
170
284
|
'pose.setPort': z.ZodObject<{
|
package/dist/wire/schemas.js
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import * as z from 'zod';
|
|
2
|
+
import { CONTROLLER_DEAD_ZONE_MAX } from "../values/controller.js";
|
|
2
3
|
import { isRecord } from "../values/guards.js";
|
|
3
4
|
import { SPEECH_URL_MAX_LENGTH, STORAGE_KEY_MAX_LENGTH, STORAGE_VALUE_MAX_LENGTH } from "../values/limits.js";
|
|
5
|
+
import { LIP_SYNC_CALIBRATION_ACTIONS, LIP_SYNC_GAIN_MAX, LIP_SYNC_MODES, LIP_SYNC_NOISE_GATE_MIN, LIP_SYNC_PHONEMES, LIP_SYNC_SMOOTHING_MAX, } from "../values/lipsync.js";
|
|
4
6
|
import { ASSET_KINDS, POSE_SOURCE_IDS, TRACKING_SOURCE_IDS, TRACKING_SOURCE_KINDS } from "./types.js";
|
|
5
7
|
// Runtime validation for the request side of the wire. Schemas exist for the
|
|
6
8
|
// methods whose params the app's main process consumes directly; methods without
|
|
@@ -9,6 +11,25 @@ import { ASSET_KINDS, POSE_SOURCE_IDS, TRACKING_SOURCE_IDS, TRACKING_SOURCE_KIND
|
|
|
9
11
|
// the app heals them into shape server-side.
|
|
10
12
|
const nonEmpty = z.string().min(1);
|
|
11
13
|
const port = z.number().int().min(1).max(65535);
|
|
14
|
+
const lipSyncCalibration = z.discriminatedUnion('action', [
|
|
15
|
+
z.object({ action: z.enum(LIP_SYNC_CALIBRATION_ACTIONS) }),
|
|
16
|
+
z.object({ action: z.literal('record'), phoneme: z.enum(LIP_SYNC_PHONEMES) }),
|
|
17
|
+
]);
|
|
18
|
+
const lipSyncPatch = z.object({
|
|
19
|
+
enabled: z.boolean().optional(),
|
|
20
|
+
deviceId: z.string().optional(),
|
|
21
|
+
gain: z.number().min(0).max(LIP_SYNC_GAIN_MAX).optional(),
|
|
22
|
+
noiseGate: z.number().min(LIP_SYNC_NOISE_GATE_MIN).max(0).optional(),
|
|
23
|
+
smoothing: z.number().min(0).max(LIP_SYNC_SMOOTHING_MAX).optional(),
|
|
24
|
+
});
|
|
25
|
+
const mediapipePatch = z.object({
|
|
26
|
+
deviceId: z.string().optional(),
|
|
27
|
+
mirror: z.boolean().optional(),
|
|
28
|
+
face: z.boolean().optional(),
|
|
29
|
+
hands: z.boolean().optional(),
|
|
30
|
+
body: z.boolean().optional(),
|
|
31
|
+
delegate: z.enum(['CPU', 'GPU']).optional(),
|
|
32
|
+
});
|
|
12
33
|
export const InjectTargetSchema = z.object({
|
|
13
34
|
type: z.enum(['input', 'live2d-param', 'vrm-expression']),
|
|
14
35
|
id: nonEmpty,
|
|
@@ -19,6 +40,8 @@ export const InjectEntrySchema = InjectTargetSchema.extend({
|
|
|
19
40
|
weight: z.number().min(0).max(1).optional(),
|
|
20
41
|
});
|
|
21
42
|
export const SettingsPatchSchema = z.object({
|
|
43
|
+
lipSync: lipSyncPatch.optional(),
|
|
44
|
+
controller: z.object({ enabled: z.boolean().optional() }).optional(),
|
|
22
45
|
window: z.object({ alwaysOnTop: z.boolean().optional() }).optional(),
|
|
23
46
|
ui: z.object({ trayVisible: z.boolean().optional() }).optional(),
|
|
24
47
|
performance: z
|
|
@@ -27,6 +50,8 @@ export const SettingsPatchSchema = z.object({
|
|
|
27
50
|
fpsLimit: z.number().optional(),
|
|
28
51
|
selectionOutline: z.boolean().optional(),
|
|
29
52
|
effectsQuality: z.enum(['high', 'medium', 'low']).optional(),
|
|
53
|
+
renderScale: z.number().optional(),
|
|
54
|
+
live2dEngine: z.enum(['pixi', 'three']).optional(),
|
|
30
55
|
})
|
|
31
56
|
.optional(),
|
|
32
57
|
});
|
|
@@ -52,6 +77,19 @@ const speechUrl = z
|
|
|
52
77
|
}
|
|
53
78
|
}, 'url must be http(s) or data:audio/*');
|
|
54
79
|
export const requestSchemas = {
|
|
80
|
+
'lipSync.state': z.object({}),
|
|
81
|
+
'lipSync.configure': lipSyncPatch,
|
|
82
|
+
'lipSync.restart': z.object({}),
|
|
83
|
+
'lipSync.calibrate': lipSyncCalibration,
|
|
84
|
+
'instance.setLipSync': z.object({ instanceId: nonEmpty.optional(), mode: z.enum(LIP_SYNC_MODES) }),
|
|
85
|
+
'registry.thumbnail': z.object({ kind: z.enum(['model', 'asset']), id: nonEmpty }),
|
|
86
|
+
'controller.rename': z.object({ slot: z.number().int().positive(), name: z.string() }),
|
|
87
|
+
'controller.setDeadZone': z.object({
|
|
88
|
+
slot: z.number().int().positive(),
|
|
89
|
+
deadZone: z.number().min(0).max(CONTROLLER_DEAD_ZONE_MAX),
|
|
90
|
+
}),
|
|
91
|
+
'controller.remove': z.object({ slot: z.number().int().positive() }),
|
|
92
|
+
'controller.assign': z.object({ slot: z.number().int().positive().nullable() }),
|
|
55
93
|
'scene.get': z.object({ sceneId: nonEmpty.optional() }),
|
|
56
94
|
'scene.activate': z.object({ sceneId: nonEmpty }),
|
|
57
95
|
'scene.duplicate': z.object({ sceneId: nonEmpty }),
|
|
@@ -84,6 +122,7 @@ export const requestSchemas = {
|
|
|
84
122
|
name: z.string().optional(),
|
|
85
123
|
phoneIp: nonEmpty.nullable().optional(),
|
|
86
124
|
port: port.optional(),
|
|
125
|
+
mediapipe: mediapipePatch.optional(),
|
|
87
126
|
}),
|
|
88
127
|
'tracking.updateSource': z.object({
|
|
89
128
|
id: nonEmpty,
|
|
@@ -91,6 +130,7 @@ export const requestSchemas = {
|
|
|
91
130
|
enabled: z.boolean().optional(),
|
|
92
131
|
phoneIp: nonEmpty.nullable().optional(),
|
|
93
132
|
port: port.optional(),
|
|
133
|
+
mediapipe: mediapipePatch.optional(),
|
|
94
134
|
}),
|
|
95
135
|
'tracking.removeSource': z.object({ id: nonEmpty }),
|
|
96
136
|
'model.register': z.object({ path: nonEmpty }),
|