@laplace.live/persona-sdk 1.12.0 → 1.13.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 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/mouse.ts';
20
21
  export * from './values/scene-transition.ts';
21
22
  export * from './values/stage-info.ts';
22
23
  export * from './values/terms.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/mouse.js";
22
23
  export * from "./values/scene-transition.js";
23
24
  export * from "./values/stage-info.js";
24
25
  export * from "./values/terms.js";
@@ -1,3 +1,4 @@
1
+ import type { BindingInput } from '../wire/types.ts';
1
2
  import type { Curve } from './curve.ts';
2
3
  import type { BindingTerm } from './terms.ts';
3
4
  /** A saved input-to-parameter rule shared by the rig editor and plugin API. */
@@ -21,6 +22,13 @@ export interface BindableParameter {
21
22
  max: number;
22
23
  default: number;
23
24
  }
25
+ /** The editor's live readout, polled as one sample. */
26
+ export interface BindingLiveValues {
27
+ /** What each tracking input reads right now; empty while nothing is measured. */
28
+ inputs: Partial<Record<BindingInput, number>>;
29
+ /** What each bound parameter reads on the model right now, by output id; empty for a host that cannot read it back. */
30
+ outputs: Record<string, number>;
31
+ }
24
32
  /** Metadata read from a rig's display and physics sidecars. */
25
33
  export interface BindingEditorData {
26
34
  connections: Binding[];
@@ -0,0 +1,12 @@
1
+ /**
2
+ * The OS cursor as a tracking input, in VTS's own names and span: −1..1 across the display the
3
+ * cursor is on, x growing rightward and y growing upward like `FacePositionY`.
4
+ */
5
+ export declare const MOUSE_INPUT_RANGES: {
6
+ readonly MousePositionX: readonly [-1, 1];
7
+ readonly MousePositionY: readonly [-1, 1];
8
+ };
9
+ export declare const MOUSE_INPUT_NAMES: readonly MouseInputName[];
10
+ export type MouseInputName = keyof typeof MOUSE_INPUT_RANGES;
11
+ export type MouseInputs = Partial<Record<MouseInputName, number>>;
12
+ export declare function isMouseInputName(v: string): v is MouseInputName;
@@ -0,0 +1,14 @@
1
+ import { keysOf } from "./guards.js";
2
+ /**
3
+ * The OS cursor as a tracking input, in VTS's own names and span: −1..1 across the display the
4
+ * cursor is on, x growing rightward and y growing upward like `FacePositionY`.
5
+ */
6
+ export const MOUSE_INPUT_RANGES = {
7
+ MousePositionX: [-1, 1],
8
+ MousePositionY: [-1, 1],
9
+ };
10
+ export const MOUSE_INPUT_NAMES = keysOf(MOUSE_INPUT_RANGES);
11
+ const MOUSE_INPUT_SET = new Set(MOUSE_INPUT_NAMES);
12
+ export function isMouseInputName(v) {
13
+ return MOUSE_INPUT_SET.has(v);
14
+ }
@@ -1,4 +1,4 @@
1
- import type { Binding, BindingEditorData } from '../values/bindings.ts';
1
+ import type { Binding, BindingEditorData, BindingLiveValues } from '../values/bindings.ts';
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';
@@ -581,9 +581,7 @@ export interface BindingSetResponse {
581
581
  saved: boolean;
582
582
  }
583
583
  export type BindingInputsRequest = BindingTarget;
584
- export interface BindingInputsResponse {
585
- inputs: Partial<Record<BindingInput, number>>;
586
- }
584
+ export type BindingInputsResponse = BindingLiveValues;
587
585
  export interface BindingOverrideRequest extends BindingTarget {
588
586
  input: BindingInput;
589
587
  value: number | null;
@@ -7,6 +7,7 @@ import { type ArkitInputName } from '../values/arkit.ts';
7
7
  import { type BaseControllerInputName, type ControllerInputName, type ControllerMovementConfig } from '../values/controller.ts';
8
8
  import { type HandInputName } from '../values/hands.ts';
9
9
  import { type LipSyncMode, type VoiceInputName } from '../values/lipsync.ts';
10
+ import { type MouseInputName } from '../values/mouse.ts';
10
11
  export type ModelFormat = 'live2d' | 'vrm';
11
12
  /** Where an item came from: shipped with the app, or added by the user. */
12
13
  export type ContentOrigin = 'bundled' | 'user';
@@ -1226,11 +1227,12 @@ declare const VTS_INPUT_RANGES: {
1226
1227
  };
1227
1228
  type VtsInputName = keyof typeof VTS_INPUT_RANGES;
1228
1229
  /**
1229
- * Default input vocabulary: face and hand inputs, raw ARKit channels and controller profile 1.
1230
- * Additional controller profile ids are accepted by isInputName without appearing in this list.
1230
+ * Default input vocabulary: face, hand and cursor inputs, raw ARKit channels and controller
1231
+ * profile 1. Additional controller profile ids are accepted by isInputName without appearing
1232
+ * in this list.
1231
1233
  */
1232
- export declare const INPUT_NAMES: readonly (VtsInputName | HandInputName | VoiceInputName | ArkitInputName | BaseControllerInputName)[];
1233
- export type InputName = VtsInputName | HandInputName | VoiceInputName | ArkitInputName | ControllerInputName;
1234
+ export declare const INPUT_NAMES: readonly (VtsInputName | HandInputName | VoiceInputName | MouseInputName | ArkitInputName | BaseControllerInputName)[];
1235
+ export type InputName = VtsInputName | HandInputName | VoiceInputName | MouseInputName | ArkitInputName | ControllerInputName;
1234
1236
  /** Whether an untrusted string names a tracking input — the guard every wire boundary needs. */
1235
1237
  export declare function isInputName(v: string): v is InputName;
1236
1238
  /**
@@ -1258,7 +1260,7 @@ export declare function arkitTwinOf(input: InputName): BindingInput;
1258
1260
  * Default inputs' natural spans. Use getInputRange for a dynamically numbered controller input.
1259
1261
  * Head angles are degrees; the rest are unitless.
1260
1262
  */
1261
- export declare const INPUT_RANGES: Record<VtsInputName | HandInputName | VoiceInputName | ArkitInputName | BaseControllerInputName, readonly [number, number]>;
1263
+ export declare const INPUT_RANGES: Record<VtsInputName | HandInputName | VoiceInputName | MouseInputName | ArkitInputName | BaseControllerInputName, readonly [number, number]>;
1262
1264
  /** Natural span of any valid input, including dynamically numbered controller profiles. */
1263
1265
  export declare function getInputRange(name: InputName): readonly [number, number];
1264
1266
  /**
@@ -6,6 +6,7 @@ import { BASE_CONTROLLER_INPUT_NAMES, BASE_CONTROLLER_INPUT_RANGES, controllerIn
6
6
  import { isOneOf, keysOf } from "../values/guards.js";
7
7
  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
+ import { MOUSE_INPUT_NAMES, MOUSE_INPUT_RANGES } from "../values/mouse.js";
9
10
  /**
10
11
  * How a registered file is labelled. Wider than an object's content kinds: `.hdr` is only
11
12
  * ever an environment map, and a `.vmd` splits by content — `cameraMotion` for one that
@@ -185,13 +186,15 @@ const VTS_INPUT_RANGES = {
185
186
  /** VTS's input vocabulary, plus `JawOpen` — the derived half of {@link INPUT_NAMES}. */
186
187
  const VTS_INPUT_NAMES = keysOf(VTS_INPUT_RANGES);
187
188
  /**
188
- * Default input vocabulary: face and hand inputs, raw ARKit channels and controller profile 1.
189
- * Additional controller profile ids are accepted by isInputName without appearing in this list.
189
+ * Default input vocabulary: face, hand and cursor inputs, raw ARKit channels and controller
190
+ * profile 1. Additional controller profile ids are accepted by isInputName without appearing
191
+ * in this list.
190
192
  */
191
193
  export const INPUT_NAMES = [
192
194
  ...VTS_INPUT_NAMES,
193
195
  ...VOICE_INPUT_NAMES,
194
196
  ...HAND_INPUT_NAMES,
197
+ ...MOUSE_INPUT_NAMES,
195
198
  ...ARKIT_INPUT_NAMES,
196
199
  ...BASE_CONTROLLER_INPUT_NAMES,
197
200
  ];
@@ -231,6 +234,7 @@ export const INPUT_RANGES = {
231
234
  ...VTS_INPUT_RANGES,
232
235
  ...VOICE_INPUT_RANGES,
233
236
  ...HAND_INPUT_RANGES,
237
+ ...MOUSE_INPUT_RANGES,
234
238
  ...BASE_CONTROLLER_INPUT_RANGES,
235
239
  // `fromEntries` widens the key type back to `string`; the annotation above is what keeps
236
240
  // this exhaustive, and it fails to typecheck if a name ever lacks a range.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@laplace.live/persona-sdk",
3
- "version": "1.12.0",
3
+ "version": "1.13.0",
4
4
  "description": "TypeScript SDK and wire schema for the LAPLACE Persona plugin API",
5
5
  "license": "MIT",
6
6
  "type": "module",