@pose-tracker/react-native-pose-estimation-light 0.3.2 → 0.3.3

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 CHANGED
@@ -36,10 +36,10 @@ package stays tiny.
36
36
  download at session start.
37
37
  **Choose light** when app install / OTA size matters and devices are online.
38
38
 
39
- Full comparison: [LIGHT_SDK.md](docs/LIGHT_SDK.md).
39
+ Full comparison: [LIGHT_SDK.md](../../docs/LIGHT_SDK.md).
40
40
 
41
41
  **Agents:** shared UX/API/bugfixes → mirror to offline (or ask first). See
42
- [`DUAL_SDK_CHANGES.md`](docs/DUAL_SDK_CHANGES.md).
42
+ [`DUAL_SDK_CHANGES.md`](../../docs/DUAL_SDK_CHANGES.md).
43
43
 
44
44
  ## Install
45
45
 
@@ -54,10 +54,10 @@ npx expo install react-native-webview expo-camera
54
54
  > **Offline sibling:** [`@pose-tracker/react-native-pose-estimation`](https://www.npmjs.com/package/@pose-tracker/react-native-pose-estimation)
55
55
 
56
56
  **Required:** host app must declare camera permissions — see
57
- [PERMISSIONS.md](docs/PERMISSIONS.md).
57
+ [PERMISSIONS.md](../../docs/PERMISSIONS.md).
58
58
 
59
59
  **Media inputs (v0.2):** camera (default), uploaded video, still image — host
60
- picks the file. See [MEDIA_SOURCES.md](docs/MEDIA_SOURCES.md) and
60
+ picks the file. See [MEDIA_SOURCES.md](../../docs/MEDIA_SOURCES.md) and
61
61
  https://docs.posetracker.com/media-sources.
62
62
 
63
63
  ## Quick start (keypoints — needs network, no API key)
@@ -144,11 +144,11 @@ Same contract as the offline SDK / web tracking URL:
144
144
 
145
145
  | Doc | Topic |
146
146
  |-----|--------|
147
- | [LIGHT_SDK.md](docs/LIGHT_SDK.md) | Offline vs light, sizes, model URL |
148
- | [PERMISSIONS.md](docs/PERMISSIONS.md) | Camera permission setup (required) |
149
- | [PRELOAD.md](docs/PRELOAD.md) | Preload / warm-up / lifecycle |
150
- | [FEATURES.md](docs/FEATURES.md) | Plan gating, watermark, loading text |
151
- | [EVENTS.md](docs/EVENTS.md) | Typed events + classic `onMessage` |
147
+ | [LIGHT_SDK.md](../../docs/LIGHT_SDK.md) | Offline vs light, sizes, model URL |
148
+ | [PERMISSIONS.md](../../docs/PERMISSIONS.md) | Camera permission setup (required) |
149
+ | [PRELOAD.md](../../docs/PRELOAD.md) | Preload / warm-up / lifecycle |
150
+ | [FEATURES.md](../../docs/FEATURES.md) | Plan gating, watermark, loading text |
151
+ | [EVENTS.md](../../docs/EVENTS.md) | Typed events + classic `onMessage` |
152
152
 
153
153
  ## FAQ
154
154
 
@@ -8,7 +8,7 @@
8
8
  */
9
9
  export type EngineChannel = 'v3' | 'v4';
10
10
  /** Wellness ids with no V3 FSM. */
11
- export declare const V4_ONLY_EXERCISE_IDS: readonly ["shoulder_roll", "shoulder_deep_breath", "chair_forward_fold", "chair_side_stretch"];
11
+ export declare const V4_ONLY_EXERCISE_IDS: readonly ["shoulder_roll", "shoulder_deep_breath", "chair_forward_fold", "chair_side_stretch", "back_flexibility_test"];
12
12
  /** Existing jump handlers — not V4 JSON. */
13
13
  export declare const JUMP_EXERCISE_IDS: readonly ["jump_analysis", "air_time_jump"];
14
14
  export declare const PRODUCTION_SQUAT_IDS: readonly ["squat", "face_squat"];
@@ -12,6 +12,7 @@ exports.V4_ONLY_EXERCISE_IDS = [
12
12
  'shoulder_deep_breath',
13
13
  'chair_forward_fold',
14
14
  'chair_side_stretch',
15
+ 'back_flexibility_test',
15
16
  ];
16
17
  /** Existing jump handlers — not V4 JSON. */
17
18
  exports.JUMP_EXERCISE_IDS = ['jump_analysis', 'air_time_jump'];
@@ -116,6 +116,7 @@ function toClassicNativeMessage(event) {
116
116
  ...(event.referenceScore != null
117
117
  ? { reference_score: { overallScore: event.referenceScore } }
118
118
  : {}),
119
+ ...(event.analysis != null ? { analysis: event.analysis } : {}),
119
120
  timestampMs: event.timestampMs,
120
121
  };
121
122
  case 'posture':
@@ -160,6 +161,8 @@ function toClassicNativeMessage(event) {
160
161
  grade: event.grade,
161
162
  history: event.history,
162
163
  durationMs: event.durationMs,
164
+ ...(event.disclaimer != null ? { disclaimer: event.disclaimer } : {}),
165
+ ...(event.method != null ? { method: event.method } : {}),
163
166
  timestampMs: event.timestampMs,
164
167
  };
165
168
  // Custom jump exercises: the classic contract already uses these exact
@@ -1,2 +1,2 @@
1
1
  /** AUTO-GENERATED by scripts/sync-sdk-version.mjs — do not edit. */
2
- export declare const SDK_VERSION = "0.3.2";
2
+ export declare const SDK_VERSION = "0.3.3";
package/lib/sdkVersion.js CHANGED
@@ -2,4 +2,4 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.SDK_VERSION = void 0;
4
4
  /** AUTO-GENERATED by scripts/sync-sdk-version.mjs — do not edit. */
5
- exports.SDK_VERSION = '0.3.2';
5
+ exports.SDK_VERSION = '0.3.3';
@@ -111,7 +111,7 @@ export interface AnglesEvent {
111
111
  * Letter grade for a 0–100 form score (GitBook / Front BaseExercise):
112
112
  * A ≥ 90, B ≥ 80, C ≥ 70, D ≥ 60, F < 60.
113
113
  */
114
- export type FormGrade = 'A' | 'B' | 'C' | 'D' | 'F';
114
+ export type FormGrade = 'A' | 'B' | 'C' | 'D' | 'E' | 'F';
115
115
  /** Valid `minGrade` filter values (F is not a valid minGrade config). */
116
116
  export type MinGrade = 'A' | 'B' | 'C' | 'D';
117
117
  /**
@@ -125,6 +125,30 @@ export interface CounterFormScore {
125
125
  average: number;
126
126
  grade: FormGrade;
127
127
  }
128
+ /**
129
+ * Per-rep report for a physical test (back flexibility). Present only when the
130
+ * movement declares `report`. Disclaimer stays in this object, not in `interpretation.text`.
131
+ */
132
+ export interface MovementAnalysis {
133
+ opinion?: boolean;
134
+ method?: string;
135
+ disclaimer?: string;
136
+ peaks?: Record<string, number>;
137
+ camera?: {
138
+ placement?: string;
139
+ bias?: number;
140
+ ratio?: number;
141
+ };
142
+ ankle_above_sole?: number;
143
+ knee_locked?: boolean;
144
+ leg_straight?: boolean;
145
+ shank_vertical?: boolean;
146
+ interpretation?: {
147
+ tone: 'strong' | 'partial' | 'limited';
148
+ title: string;
149
+ text: string;
150
+ };
151
+ }
128
152
  export interface CounterEvent {
129
153
  type: 'counter';
130
154
  count: number;
@@ -136,6 +160,8 @@ export interface CounterEvent {
136
160
  formScore?: CounterFormScore;
137
161
  /** Similarity score vs. reference movement for the last rep, when a reference is active. */
138
162
  referenceScore?: number;
163
+ /** Physical-test report: peaks, camera, flags, interpretation, disclaimer. */
164
+ analysis?: MovementAnalysis;
139
165
  timestampMs: number;
140
166
  }
141
167
  export interface PostureEvent {
@@ -209,6 +235,7 @@ export interface RepSummary {
209
235
  formScore: number;
210
236
  durationMs: number;
211
237
  referenceScore?: number;
238
+ analysis?: MovementAnalysis;
212
239
  }
213
240
  export interface ExerciseSummaryEvent {
214
241
  type: 'exercise_summary';
@@ -219,6 +246,9 @@ export interface ExerciseSummaryEvent {
219
246
  grade: FormGrade;
220
247
  history: RepSummary[];
221
248
  durationMs: number;
249
+ /** Set when the movement emits a report. Kept out of interpretation text. */
250
+ disclaimer?: string;
251
+ method?: string;
222
252
  timestampMs: number;
223
253
  }
224
254
  export interface VisibleHipsInfo {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pose-tracker/react-native-pose-estimation-light",
3
- "version": "0.3.2",
3
+ "version": "0.3.3",
4
4
  "description": "Human pose estimation SDK for React Native (light / online) — MoveNet Lightning via CDN + model URL each session, no bundled weights. iOS & Android (Expo Go). Optional API-key exercise engine.",
5
5
  "main": "lib/index.js",
6
6
  "types": "lib/index.d.ts",
@@ -14,6 +14,7 @@ export const V4_ONLY_EXERCISE_IDS = [
14
14
  'shoulder_deep_breath',
15
15
  'chair_forward_fold',
16
16
  'chair_side_stretch',
17
+ 'back_flexibility_test',
17
18
  ] as const;
18
19
 
19
20
  /** Existing jump handlers — not V4 JSON. */
@@ -129,6 +129,7 @@ export function toClassicNativeMessage(
129
129
  ...(event.referenceScore != null
130
130
  ? { reference_score: { overallScore: event.referenceScore } }
131
131
  : {}),
132
+ ...(event.analysis != null ? { analysis: event.analysis } : {}),
132
133
  timestampMs: event.timestampMs,
133
134
  };
134
135
  case 'posture':
@@ -173,6 +174,8 @@ export function toClassicNativeMessage(
173
174
  grade: event.grade,
174
175
  history: event.history,
175
176
  durationMs: event.durationMs,
177
+ ...(event.disclaimer != null ? { disclaimer: event.disclaimer } : {}),
178
+ ...(event.method != null ? { method: event.method } : {}),
176
179
  timestampMs: event.timestampMs,
177
180
  };
178
181
  // Custom jump exercises: the classic contract already uses these exact
package/src/sdkVersion.ts CHANGED
@@ -1,2 +1,2 @@
1
1
  /** AUTO-GENERATED by scripts/sync-sdk-version.mjs — do not edit. */
2
- export const SDK_VERSION = '0.3.2';
2
+ export const SDK_VERSION = '0.3.3';
@@ -149,7 +149,7 @@ export interface AnglesEvent {
149
149
  * Letter grade for a 0–100 form score (GitBook / Front BaseExercise):
150
150
  * A ≥ 90, B ≥ 80, C ≥ 70, D ≥ 60, F &lt; 60.
151
151
  */
152
- export type FormGrade = 'A' | 'B' | 'C' | 'D' | 'F';
152
+ export type FormGrade = 'A' | 'B' | 'C' | 'D' | 'E' | 'F';
153
153
 
154
154
  /** Valid `minGrade` filter values (F is not a valid minGrade config). */
155
155
  export type MinGrade = 'A' | 'B' | 'C' | 'D';
@@ -166,6 +166,23 @@ export interface CounterFormScore {
166
166
  grade: FormGrade;
167
167
  }
168
168
 
169
+ /**
170
+ * Per-rep report for a physical test (back flexibility). Present only when the
171
+ * movement declares `report`. Disclaimer stays in this object, not in `interpretation.text`.
172
+ */
173
+ export interface MovementAnalysis {
174
+ opinion?: boolean;
175
+ method?: string;
176
+ disclaimer?: string;
177
+ peaks?: Record<string, number>;
178
+ camera?: { placement?: string; bias?: number; ratio?: number };
179
+ ankle_above_sole?: number;
180
+ knee_locked?: boolean;
181
+ leg_straight?: boolean;
182
+ shank_vertical?: boolean;
183
+ interpretation?: { tone: 'strong' | 'partial' | 'limited'; title: string; text: string };
184
+ }
185
+
169
186
  export interface CounterEvent {
170
187
  type: 'counter';
171
188
  count: number;
@@ -177,6 +194,8 @@ export interface CounterEvent {
177
194
  formScore?: CounterFormScore;
178
195
  /** Similarity score vs. reference movement for the last rep, when a reference is active. */
179
196
  referenceScore?: number;
197
+ /** Physical-test report: peaks, camera, flags, interpretation, disclaimer. */
198
+ analysis?: MovementAnalysis;
180
199
  timestampMs: number;
181
200
  }
182
201
 
@@ -253,6 +272,7 @@ export interface RepSummary {
253
272
  formScore: number;
254
273
  durationMs: number;
255
274
  referenceScore?: number;
275
+ analysis?: MovementAnalysis;
256
276
  }
257
277
 
258
278
  export interface ExerciseSummaryEvent {
@@ -264,6 +284,9 @@ export interface ExerciseSummaryEvent {
264
284
  grade: FormGrade;
265
285
  history: RepSummary[];
266
286
  durationMs: number;
287
+ /** Set when the movement emits a report. Kept out of interpretation text. */
288
+ disclaimer?: string;
289
+ method?: string;
267
290
  timestampMs: number;
268
291
  }
269
292