@laplace.live/persona-sdk 1.23.1 → 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 +77 -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 +71 -116
- package/dist/wire/types.js +68 -9
- package/package.json +2 -2
- package/dist/client/legacy-kinds.d.ts +0 -2
package/dist/wire/envelope.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { isRecord } from "../values/guards.js";
|
|
2
2
|
import { isApiErrorCode } from "./errors.js";
|
|
3
3
|
import { isEventName } from "./events.js";
|
|
4
|
-
import { isAppCapability } from "./types.js";
|
|
4
|
+
import { canonicalAppCapability, isAppCapability } from "./types.js";
|
|
5
5
|
/**
|
|
6
6
|
* Parse one inbound client frame. Returns the request, or an error code telling
|
|
7
7
|
* the server what to answer: `parse-error` for junk bytes, `invalid-request`
|
|
@@ -47,8 +47,11 @@ export function parseServerMessage(raw) {
|
|
|
47
47
|
const { name, version, platform } = v.app;
|
|
48
48
|
if (typeof name !== 'string' || typeof version !== 'string' || typeof platform !== 'string')
|
|
49
49
|
return null;
|
|
50
|
-
// Tolerant both ways: absent on older servers, unknown names from newer ones dropped.
|
|
51
|
-
|
|
50
|
+
// Tolerant both ways: absent on older servers, unknown names from newer ones dropped. Old names fold
|
|
51
|
+
// into their replacements, which a newer server also lists.
|
|
52
|
+
const names = Array.isArray(v.app.capabilities) ? v.app.capabilities : [];
|
|
53
|
+
const folded = names.map(n => (typeof n === 'string' ? canonicalAppCapability(n) : n));
|
|
54
|
+
const capabilities = [...new Set(folded.filter(isAppCapability))];
|
|
52
55
|
return { kind: 'hello', protocol: v.protocol, app: { name, version, platform, capabilities } };
|
|
53
56
|
}
|
|
54
57
|
case 'response':
|
package/dist/wire/methods.d.ts
CHANGED
|
@@ -4,8 +4,9 @@ import type { SpawnTransition } from '../values/item-transition.ts';
|
|
|
4
4
|
import type { LipSyncCalibrationCommand, LipSyncConfig, LipSyncMode, LipSyncState } from '../values/lipsync.ts';
|
|
5
5
|
import type { ModelMovementConfig, ModelMovementEdit } from '../values/model-movement.ts';
|
|
6
6
|
import type { SceneInspection } from '../values/stage-info.ts';
|
|
7
|
+
import type { AppInfo } from './envelope.ts';
|
|
7
8
|
import type { EventName } from './events.ts';
|
|
8
|
-
import type { AnchorOption,
|
|
9
|
+
import type { AnchorOption, AssetKind, AssetRef, Attach, AttachHeadAngle, AutomationInfo, BindingInput, ChannelBindings, Expression, ExpressionPersistence, FontFamilyInfo, 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, SceneModelItem, ScenePatch, SceneState, ScreenPlacement, Settings, SettingsPatch, TrackingLostBehavior, TrackingSourceConfig, TrackingSourceId, TrackingSourceKind, TrackingStatus, VrmPlacement } from './types.ts';
|
|
9
10
|
/** Marker for methods that take no parameters; the client lets you omit the argument. */
|
|
10
11
|
export type EmptyRequest = Record<never, never>;
|
|
11
12
|
/** Marker for methods whose success response carries no data. */
|
|
@@ -85,7 +86,10 @@ export interface InstanceSetVisibleRequest {
|
|
|
85
86
|
visible: boolean;
|
|
86
87
|
}
|
|
87
88
|
export type InstanceSetVisibleResponse = EmptyResponse;
|
|
88
|
-
/**
|
|
89
|
+
/**
|
|
90
|
+
* Edits one model or object's source effects; gate on the `layer-effects` app capability, and a `2d`
|
|
91
|
+
* object on `layer-effects-2d`.
|
|
92
|
+
*/
|
|
89
93
|
export interface InstanceSetEffectsRequest {
|
|
90
94
|
instanceId: string;
|
|
91
95
|
effects: LayerEffectsPatch;
|
|
@@ -96,13 +100,12 @@ export interface InstanceSetEffectsResponse {
|
|
|
96
100
|
effects: LayerEffects;
|
|
97
101
|
effectLayers: LayerEffectKey[];
|
|
98
102
|
}
|
|
99
|
-
/**
|
|
100
|
-
|
|
103
|
+
/**
|
|
104
|
+
* The channels' source bindings (`ChannelBindings`). Omitted fields keep their binding;
|
|
105
|
+
* null stops tracking that channel for this instance.
|
|
106
|
+
*/
|
|
107
|
+
export interface InstanceSetTrackingSourcesRequest extends Partial<ChannelBindings>, Partial<Pick<SceneModelItem, 'handTrackingMode'>> {
|
|
101
108
|
instanceId: string;
|
|
102
|
-
faceSourceId?: string | null;
|
|
103
|
-
poseSourceId?: string | null;
|
|
104
|
-
handSourceId?: string | null;
|
|
105
|
-
handTrackingMode?: HandTrackingMode;
|
|
106
109
|
}
|
|
107
110
|
export type InstanceSetTrackingSourcesResponse = EmptyResponse;
|
|
108
111
|
export interface InstanceSetControllerMovementRequest {
|
|
@@ -173,7 +176,7 @@ export interface InstanceSetIdleRequest {
|
|
|
173
176
|
idleClip?: string;
|
|
174
177
|
/** Live2D only: a motion file from `motion.list`, or null for the model's `Idle` group. */
|
|
175
178
|
idleMotion?: string | null;
|
|
176
|
-
/** The `tracking-lost` app capability carries these three. */
|
|
179
|
+
/** The `idle-tracking-lost` app capability carries these three. */
|
|
177
180
|
trackingLostBehavior?: TrackingLostBehavior;
|
|
178
181
|
/** Live2D only: a motion file from `motion.list`, or null for none. */
|
|
179
182
|
trackingLostMotion?: string | null;
|
|
@@ -215,7 +218,7 @@ export interface ObjectSetContentRequest {
|
|
|
215
218
|
content: ObjectContent;
|
|
216
219
|
}
|
|
217
220
|
export type ObjectSetContentResponse = EmptyResponse;
|
|
218
|
-
/** A `text` object's text alone, under `text
|
|
221
|
+
/** A `text` object's text alone, under `object-text`. */
|
|
219
222
|
export interface ObjectSetTextRequest {
|
|
220
223
|
instanceId: string;
|
|
221
224
|
/** Null drops a transient text, showing the saved one again. */
|
|
@@ -526,13 +529,9 @@ export interface StageCaptureResponse {
|
|
|
526
529
|
height: number;
|
|
527
530
|
}
|
|
528
531
|
export type AppInfoRequest = EmptyRequest;
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
version: string;
|
|
532
|
-
platform: string;
|
|
532
|
+
/** What `hello` carries, the app identity plus its protocol version. */
|
|
533
|
+
export interface AppInfoResponse extends AppInfo {
|
|
533
534
|
protocol: number;
|
|
534
|
-
/** Same list `hello` carries; gate features on it, never on `version`. */
|
|
535
|
-
capabilities: AppCapability[];
|
|
536
535
|
}
|
|
537
536
|
export type AppLocalAddressesRequest = EmptyRequest;
|
|
538
537
|
export interface AppLocalAddressesResponse {
|
|
@@ -662,7 +661,7 @@ export interface ModelSetMovementRequest {
|
|
|
662
661
|
export interface ModelSetMovementResponse {
|
|
663
662
|
/** The configuration now moving the model, whether or not it reached the file. */
|
|
664
663
|
movement: ModelMovementConfig;
|
|
665
|
-
/** False when
|
|
664
|
+
/** False when any part missed its file — a refused write (read-only, unreadable) — or no field was usable. */
|
|
666
665
|
saved: boolean;
|
|
667
666
|
}
|
|
668
667
|
export interface InstanceSetBreathRequest {
|
package/dist/wire/protocol.d.ts
CHANGED
|
@@ -7,6 +7,8 @@ export declare const DEFAULT_API_PORT = 25034;
|
|
|
7
7
|
export declare const DEFAULT_API_HOST = "127.0.0.1";
|
|
8
8
|
/** Scene activation waits for asset preparation before committing the new scene. */
|
|
9
9
|
export declare const SCENE_ACTIVATION_TIMEOUT_MS = 120000;
|
|
10
|
+
/** How long a caller waits for `method`'s answer: scene activation prepares assets first, the rest get `fallbackMs`. */
|
|
11
|
+
export declare function requestTimeoutMs(method: string, fallbackMs: number): number;
|
|
10
12
|
/** Server close code: the session's API key was revoked. Terminal — the client must not redial. */
|
|
11
13
|
export declare const CLOSE_KEY_REVOKED = 4001;
|
|
12
14
|
/** Server close code: the user disconnected this session from Persona's settings. Terminal — the client must not redial. */
|
package/dist/wire/protocol.js
CHANGED
|
@@ -6,6 +6,10 @@ export const DEFAULT_API_PORT = 25034;
|
|
|
6
6
|
export const DEFAULT_API_HOST = '127.0.0.1';
|
|
7
7
|
/** Scene activation waits for asset preparation before committing the new scene. */
|
|
8
8
|
export const SCENE_ACTIVATION_TIMEOUT_MS = 120_000;
|
|
9
|
+
/** How long a caller waits for `method`'s answer: scene activation prepares assets first, the rest get `fallbackMs`. */
|
|
10
|
+
export function requestTimeoutMs(method, fallbackMs) {
|
|
11
|
+
return method === 'scene.activate' ? SCENE_ACTIVATION_TIMEOUT_MS : fallbackMs;
|
|
12
|
+
}
|
|
9
13
|
/** Server close code: the session's API key was revoked. Terminal — the client must not redial. */
|
|
10
14
|
export const CLOSE_KEY_REVOKED = 4001;
|
|
11
15
|
/** Server close code: the user disconnected this session from Persona's settings. Terminal — the client must not redial. */
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type * as z from 'zod';
|
|
2
|
+
/**
|
|
3
|
+
* A `z.object` shape naming every key of `T`, optional ones included. `satisfies` it so a field added
|
|
4
|
+
* to `T` fails to compile until the schema takes it — `z.object` strips the keys it does not name.
|
|
5
|
+
*/
|
|
6
|
+
export type Fields<T> = {
|
|
7
|
+
[K in keyof T]-?: z.ZodType;
|
|
8
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -170,12 +170,12 @@ export declare const requestSchemas: {
|
|
|
170
170
|
}, z.core.$strip>;
|
|
171
171
|
'tracking.addSource': z.ZodObject<{
|
|
172
172
|
kind: z.ZodEnum<{
|
|
173
|
+
mediapipe: "mediapipe";
|
|
173
174
|
"persona-ios": "persona-ios";
|
|
174
175
|
ifacialmocap: "ifacialmocap";
|
|
175
176
|
"vts-ios": "vts-ios";
|
|
176
177
|
vmc: "vmc";
|
|
177
178
|
mocopi: "mocopi";
|
|
178
|
-
mediapipe: "mediapipe";
|
|
179
179
|
}>;
|
|
180
180
|
name: z.ZodOptional<z.ZodString>;
|
|
181
181
|
phoneIp: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
@@ -221,7 +221,7 @@ export declare const requestSchemas: {
|
|
|
221
221
|
}, z.core.$strip>;
|
|
222
222
|
'model.setMovement': z.ZodObject<{
|
|
223
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">>>;
|
|
224
|
+
movement: z.ZodCustom<Partial<Pick<import("../../index.ts").ModelMovementConfig, "enabled" | "x" | "y" | "z" | "pivot">>, Partial<Pick<import("../../index.ts").ModelMovementConfig, "enabled" | "x" | "y" | "z" | "pivot">>>;
|
|
225
225
|
}, z.core.$strip>;
|
|
226
226
|
'asset.register': z.ZodObject<{
|
|
227
227
|
path: z.ZodString;
|
|
@@ -2,7 +2,7 @@ import * as z from 'zod';
|
|
|
2
2
|
import { CONTROLLER_DEAD_ZONE_MAX } from "../../values/controller.js";
|
|
3
3
|
import { isRecord } from "../../values/guards.js";
|
|
4
4
|
import { ITEM_TRANSITION_STYLES, LEGACY_DITHER_STYLE } from "../../values/item-transition.js";
|
|
5
|
-
import { OBJECT_ADD_MANY_MAX, SCENE_COLOR_RE, SPEECH_URL_MAX_LENGTH, STAGE_CAPTURE_EDGE_MAX, STAGE_CAPTURE_EDGE_MIN, STORAGE_KEY_MAX_LENGTH, STORAGE_VALUE_MAX_LENGTH, } from "../../values/limits.js";
|
|
5
|
+
import { OBJECT_ADD_MANY_MAX, SCENE_COLOR_RE, SESSION_NAME_MAX_LENGTH, SPEECH_URL_MAX_LENGTH, STAGE_CAPTURE_EDGE_MAX, STAGE_CAPTURE_EDGE_MIN, STORAGE_KEY_MAX_LENGTH, STORAGE_VALUE_MAX_LENGTH, } from "../../values/limits.js";
|
|
6
6
|
import { LIP_SYNC_CALIBRATION_ACTIONS, LIP_SYNC_MODES, LIP_SYNC_PHONEMES, } from "../../values/lipsync.js";
|
|
7
7
|
import { SCENE_TRANSITION_DURATION_MAX_MS, SCENE_TRANSITION_DURATION_MIN_MS, SCENE_TRANSITION_FADE_DEFAULT_MS, SCENE_TRANSITION_SWITCH_POINT_MAX, SCENE_TRANSITION_SWITCH_POINT_MIN, SCENE_TRANSITION_TYPES, } from "../../values/scene-transition.js";
|
|
8
8
|
import { ASSET_KINDS, INJECT_TARGET_TYPES, POSE_SOURCE_IDS, TRACKING_SOURCE_IDS, TRACKING_SOURCE_KINDS, } from "../types.js";
|
|
@@ -68,20 +68,35 @@ const objectAdd = z.object({
|
|
|
68
68
|
place3d: z.custom(isRecord, 'place3d must be an object').optional(),
|
|
69
69
|
});
|
|
70
70
|
const stageVector = z.object({ x: z.number(), y: z.number(), z: z.number() });
|
|
71
|
+
// Each object schema `satisfies Fields<…>` of its request, so an optional field the interface gains
|
|
72
|
+
// fails to compile here instead of being stripped before the executor sees it.
|
|
71
73
|
export const requestSchemas = {
|
|
72
74
|
'lipSync.state': z.object({}),
|
|
73
75
|
'lipSync.configure': lipSyncPatch,
|
|
74
76
|
'lipSync.restart': z.object({}),
|
|
75
77
|
'lipSync.calibrate': lipSyncCalibration,
|
|
76
|
-
'instance.setLipSync': z.object({
|
|
77
|
-
|
|
78
|
-
|
|
78
|
+
'instance.setLipSync': z.object({
|
|
79
|
+
instanceId: nonEmpty.optional(),
|
|
80
|
+
mode: z.enum(LIP_SYNC_MODES),
|
|
81
|
+
}),
|
|
82
|
+
'registry.thumbnail': z.object({
|
|
83
|
+
kind: z.enum(['model', 'asset']),
|
|
84
|
+
id: nonEmpty,
|
|
85
|
+
}),
|
|
86
|
+
'controller.rename': z.object({
|
|
87
|
+
slot: z.number().int().positive(),
|
|
88
|
+
name: z.string(),
|
|
89
|
+
}),
|
|
79
90
|
'controller.setDeadZone': z.object({
|
|
80
91
|
slot: z.number().int().positive(),
|
|
81
92
|
deadZone: z.number().min(0).max(CONTROLLER_DEAD_ZONE_MAX),
|
|
82
93
|
}),
|
|
83
|
-
'controller.remove': z.object({
|
|
84
|
-
|
|
94
|
+
'controller.remove': z.object({
|
|
95
|
+
slot: z.number().int().positive(),
|
|
96
|
+
}),
|
|
97
|
+
'controller.assign': z.object({
|
|
98
|
+
slot: z.number().int().positive().nullable(),
|
|
99
|
+
}),
|
|
85
100
|
'scene.get': z.object({ sceneId: nonEmpty.optional() }),
|
|
86
101
|
'scene.activate': z.object({ sceneId: nonEmpty }),
|
|
87
102
|
'scene.duplicate': z.object({ sceneId: nonEmpty }),
|
|
@@ -90,24 +105,44 @@ export const requestSchemas = {
|
|
|
90
105
|
'scene.setLightFollowCamera': z.object({
|
|
91
106
|
lightId: nonEmpty,
|
|
92
107
|
followCamera: z.boolean(),
|
|
93
|
-
options: z
|
|
108
|
+
options: z
|
|
109
|
+
.object({
|
|
110
|
+
position: z.boolean(),
|
|
111
|
+
rotation: z.boolean(),
|
|
112
|
+
distance: z.boolean(),
|
|
113
|
+
})
|
|
114
|
+
.partial()
|
|
115
|
+
.optional(),
|
|
94
116
|
}),
|
|
95
117
|
'instance.add': z.object({ modelId: nonEmpty }),
|
|
96
|
-
'instance.setModel': z.object({
|
|
118
|
+
'instance.setModel': z.object({
|
|
119
|
+
instanceId: nonEmpty,
|
|
120
|
+
modelId: nonEmpty,
|
|
121
|
+
}),
|
|
97
122
|
'object.add': objectAdd,
|
|
98
|
-
'object.addMany': z.object({
|
|
123
|
+
'object.addMany': z.object({
|
|
124
|
+
objects: z.array(objectAdd).min(1).max(OBJECT_ADD_MANY_MAX),
|
|
125
|
+
}),
|
|
99
126
|
'object.setContent': z.object({
|
|
100
127
|
instanceId: nonEmpty,
|
|
101
128
|
content: z.custom(isRecord, 'content must be an object'),
|
|
102
129
|
}),
|
|
103
|
-
'expression.getPersistence': z.object({
|
|
104
|
-
|
|
130
|
+
'expression.getPersistence': z.object({
|
|
131
|
+
modelId: nonEmpty.optional(),
|
|
132
|
+
}),
|
|
133
|
+
'expression.setPersistence': z.object({
|
|
134
|
+
modelId: nonEmpty.optional(),
|
|
135
|
+
enabled: z.boolean(),
|
|
136
|
+
}),
|
|
105
137
|
'hotkey.list': z.object({ modelId: nonEmpty.optional() }),
|
|
106
138
|
'hotkey.set': z.object({
|
|
107
139
|
modelId: nonEmpty.optional(),
|
|
108
140
|
config: z.custom(isRecord, 'config must be a hotkey config'),
|
|
109
141
|
}),
|
|
110
|
-
'hotkey.trigger': z.object({
|
|
142
|
+
'hotkey.trigger': z.object({
|
|
143
|
+
hotkeyId: nonEmpty,
|
|
144
|
+
modelId: nonEmpty.optional(),
|
|
145
|
+
}),
|
|
111
146
|
'automation.run': z.object({ automationId: nonEmpty }),
|
|
112
147
|
'tracking.addSource': z.object({
|
|
113
148
|
// Straight off the kind registry, for the same reason as ASSET_KINDS below: a schema
|
|
@@ -128,7 +163,9 @@ export const requestSchemas = {
|
|
|
128
163
|
}),
|
|
129
164
|
'tracking.removeSource': z.object({ id: nonEmpty }),
|
|
130
165
|
'model.register': z.object({ path: nonEmpty }),
|
|
131
|
-
'model.getMovement': z.object({
|
|
166
|
+
'model.getMovement': z.object({
|
|
167
|
+
modelId: nonEmpty.optional(),
|
|
168
|
+
}),
|
|
132
169
|
// Healed by the host like the desktop editor's own edits, so only the shape is checked here.
|
|
133
170
|
'model.setMovement': z.object({
|
|
134
171
|
modelId: nonEmpty.optional(),
|
|
@@ -136,15 +173,20 @@ export const requestSchemas = {
|
|
|
136
173
|
}),
|
|
137
174
|
// Straight off ASSET_KINDS: a kind added there has to reach the wire gate too, or
|
|
138
175
|
// `want` answers invalid-params for a kind the registry already knows how to take.
|
|
139
|
-
'asset.register': z.object({
|
|
176
|
+
'asset.register': z.object({
|
|
177
|
+
path: nonEmpty,
|
|
178
|
+
want: z.enum(ASSET_KINDS).optional(),
|
|
179
|
+
}),
|
|
140
180
|
'settings.patch': z.object({ settings: SettingsPatchSchema }),
|
|
141
181
|
'tracking.setEnabled': z.object({ enabled: z.boolean() }),
|
|
142
|
-
'tracking.setSource': z.object({
|
|
182
|
+
'tracking.setSource': z.object({
|
|
183
|
+
source: z.enum(TRACKING_SOURCE_IDS),
|
|
184
|
+
}),
|
|
143
185
|
'pose.setEnabled': z.object({ enabled: z.boolean() }),
|
|
144
186
|
'pose.setSource': z.object({ source: z.enum(POSE_SOURCE_IDS) }),
|
|
145
187
|
'pose.setPort': z.object({ port: PortSchema }),
|
|
146
188
|
'session.identify': z.object({
|
|
147
|
-
name: z.string().trim().min(1).max(
|
|
189
|
+
name: z.string().trim().min(1).max(SESSION_NAME_MAX_LENGTH),
|
|
148
190
|
version: z.string().max(32).optional(),
|
|
149
191
|
developer: z.string().max(64).optional(),
|
|
150
192
|
}),
|
|
@@ -181,10 +223,18 @@ export const requestSchemas = {
|
|
|
181
223
|
'stage.capture': z.object({
|
|
182
224
|
maxEdge: z.number().int().min(STAGE_CAPTURE_EDGE_MIN).max(STAGE_CAPTURE_EDGE_MAX).optional(),
|
|
183
225
|
}),
|
|
184
|
-
'events.subscribe': z.object({
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
'
|
|
226
|
+
'events.subscribe': z.object({
|
|
227
|
+
events: z.array(lenientEventNameSchema).min(1),
|
|
228
|
+
}),
|
|
229
|
+
'events.unsubscribe': z.object({
|
|
230
|
+
events: z.array(lenientEventNameSchema).optional(),
|
|
231
|
+
}),
|
|
232
|
+
'param.inject': z.object({
|
|
233
|
+
entries: z.array(InjectEntrySchema).min(1),
|
|
234
|
+
}),
|
|
235
|
+
'param.release': z.object({
|
|
236
|
+
targets: z.array(InjectTargetSchema).optional(),
|
|
237
|
+
}),
|
|
188
238
|
};
|
|
189
239
|
/**
|
|
190
240
|
* Validate one request's params against its method schema. Methods without a
|
|
@@ -56,12 +56,12 @@ export declare const MediaPipeConfigSchema: z.ZodObject<{
|
|
|
56
56
|
export declare const TrackingSourceConfigSchema: z.ZodObject<{
|
|
57
57
|
id: z.ZodString;
|
|
58
58
|
kind: z.ZodEnum<{
|
|
59
|
+
mediapipe: "mediapipe";
|
|
59
60
|
"persona-ios": "persona-ios";
|
|
60
61
|
ifacialmocap: "ifacialmocap";
|
|
61
62
|
"vts-ios": "vts-ios";
|
|
62
63
|
vmc: "vmc";
|
|
63
64
|
mocopi: "mocopi";
|
|
64
|
-
mediapipe: "mediapipe";
|
|
65
65
|
}>;
|
|
66
66
|
name: z.ZodString;
|
|
67
67
|
enabled: z.ZodBoolean;
|
|
@@ -123,12 +123,12 @@ export declare const TrackingSettingsSchema: z.ZodObject<{
|
|
|
123
123
|
sources: z.ZodArray<z.ZodObject<{
|
|
124
124
|
id: z.ZodString;
|
|
125
125
|
kind: z.ZodEnum<{
|
|
126
|
+
mediapipe: "mediapipe";
|
|
126
127
|
"persona-ios": "persona-ios";
|
|
127
128
|
ifacialmocap: "ifacialmocap";
|
|
128
129
|
"vts-ios": "vts-ios";
|
|
129
130
|
vmc: "vmc";
|
|
130
131
|
mocopi: "mocopi";
|
|
131
|
-
mediapipe: "mediapipe";
|
|
132
132
|
}>;
|
|
133
133
|
name: z.ZodString;
|
|
134
134
|
enabled: z.ZodBoolean;
|
|
@@ -209,12 +209,12 @@ export declare const SettingsSchema: z.ZodObject<{
|
|
|
209
209
|
sources: z.ZodArray<z.ZodObject<{
|
|
210
210
|
id: z.ZodString;
|
|
211
211
|
kind: z.ZodEnum<{
|
|
212
|
+
mediapipe: "mediapipe";
|
|
212
213
|
"persona-ios": "persona-ios";
|
|
213
214
|
ifacialmocap: "ifacialmocap";
|
|
214
215
|
"vts-ios": "vts-ios";
|
|
215
216
|
vmc: "vmc";
|
|
216
217
|
mocopi: "mocopi";
|
|
217
|
-
mediapipe: "mediapipe";
|
|
218
218
|
}>;
|
|
219
219
|
name: z.ZodString;
|
|
220
220
|
enabled: z.ZodBoolean;
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import * as z from 'zod';
|
|
2
2
|
import { CONTROLLER_DEAD_ZONE_MAX } from "../../values/controller.js";
|
|
3
3
|
import { LIP_SYNC_GAIN_MAX, LIP_SYNC_MAX_SAMPLES, LIP_SYNC_MFCC_COEFFICIENTS, LIP_SYNC_MIN_SAMPLES, LIP_SYNC_NOISE_GATE_MIN, LIP_SYNC_PHONEMES, LIP_SYNC_SMOOTHING_MAX, } from "../../values/lipsync.js";
|
|
4
|
-
import {
|
|
4
|
+
import { LANGUAGE_SETTINGS, THEME_SETTINGS } from "../../values/locale.js";
|
|
5
5
|
import { EFFECTS_QUALITY_LEVELS, MEDIAPIPE_DELEGATES, POSE_SOURCE_IDS, TRACKING_SOURCE_IDS, TRACKING_SOURCE_KINDS, } from "../types.js";
|
|
6
6
|
/** Shared field definitions; parsing validates values without adding defaults or healing them. */
|
|
7
7
|
export const PortSchema = z.number().int().min(1).max(65535).describe('Network port, from 1 through 65535.');
|
|
8
8
|
export const EffectsQualitySchema = z.enum(EFFECTS_QUALITY_LEVELS).describe('Scene and layer effects quality tier.');
|
|
9
9
|
export const LanguageSettingSchema = z
|
|
10
|
-
.enum(
|
|
10
|
+
.enum(LANGUAGE_SETTINGS)
|
|
11
11
|
.describe('Interface language, or system to follow the operating system.');
|
|
12
12
|
export const ThemeSettingSchema = z
|
|
13
|
-
.enum(
|
|
13
|
+
.enum(THEME_SETTINGS)
|
|
14
14
|
.describe('Interface appearance, or system to follow the operating system.');
|
|
15
15
|
/** Microphone configuration shared by desktop persistence and the plugin API. */
|
|
16
16
|
export const LipSyncConfigSchema = z.object({
|