@kubohiroya/turbowarp-teachable-machine 3.2.1 → 3.4.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.
@@ -152,6 +152,19 @@ export declare class TMExtension {
152
152
  ensureLibrariesLoaded(): Promise<void>;
153
153
  cleanupCameraResources(): void;
154
154
  startCamera(): Promise<void>;
155
+ /**
156
+ * A lease on the shared camera, or null when Camera Source is not loaded.
157
+ *
158
+ * Camera Source owns the device and decides when a stream stops, which is what lets one camera
159
+ * serve pose recognition and anything else reading frames at the same time. It is a separate
160
+ * TurboWarp extension, and this one is also distributed for standalone URL loading, so its
161
+ * absence is ordinary rather than a failure: the self-acquired path stays for it.
162
+ *
163
+ * One camera id for every visual recognition mode. Opening a second device for a work that
164
+ * recognises both poses and images is not what sharing is for, and `pose` is the role name
165
+ * Camera Source's own documentation uses for this consumer.
166
+ */
167
+ private acquireSharedCamera;
155
168
  stopCamera(): void;
156
169
  isCameraRunning(): any;
157
170
  getCameraMenuItems(): {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kubohiroya/turbowarp-teachable-machine",
3
- "version": "3.2.1",
3
+ "version": "3.4.0",
4
4
  "description": "A TurboWarp extension for recognition using Teachable Machine pose, image, and audio models.",
5
5
  "author": "Hiroya Kubo <hiroya@cuc.ac.jp>",
6
6
  "license": "MPL-2.0",
@@ -43,6 +43,9 @@
43
43
  "registry": "https://registry.npmjs.org/"
44
44
  },
45
45
  "packageManager": "pnpm@11.11.0",
46
+ "engines": {
47
+ "node": ">=22.18.0"
48
+ },
46
49
  "scripts": {
47
50
  "dev": "vite build --watch",
48
51
  "typecheck": "tsc --noEmit",
@@ -50,26 +53,27 @@
50
53
  "build:extension": "vite build",
51
54
  "build:composition": "vite build --config vite.composition.config.ts",
52
55
  "build:runtime": "vite build --config vite.runtime.config.ts",
53
- "build:backends": "vite build --config vite.backend-wasm.config.ts && vite build --config vite.backend-webgpu.config.ts && node scripts/copy-wasm-assets.mjs",
54
- "build:posenet": "vite build --config vite.posenet.config.ts && node scripts/copy-posenet-assets.mjs",
55
- "build:notices": "node scripts/copy-third-party-notices.mjs",
56
+ "build:backends": "vite build --config vite.backend-wasm.config.ts && vite build --config vite.backend-webgpu.config.ts && node scripts/copy-wasm-assets.ts",
57
+ "build:posenet": "vite build --config vite.posenet.config.ts && node scripts/copy-posenet-assets.ts",
58
+ "build:notices": "node scripts/copy-third-party-notices.ts",
56
59
  "build:types": "tsc --project tsconfig.build.json",
57
60
  "types:composition:check": "tsc --project tsconfig.composition-consumer.json",
58
61
  "types:posenet:check": "tsc --project tsconfig.posenet-consumer.json",
59
62
  "test": "vitest run",
60
- "docs": "node scripts/generate-readme.mjs",
63
+ "docs": "node scripts/generate-readme.ts",
61
64
  "docs:check": "npm run docs && git diff --exit-code -- README.md",
62
- "docs:pages:check": "node scripts/check-pages.mjs",
63
- "release:consistency:check": "node scripts/check-release-consistency.mjs",
65
+ "docs:pages:check": "node scripts/check-pages.ts",
66
+ "release:consistency:check": "node scripts/check-release-consistency.ts",
64
67
  "check:dist": "npm run build && git diff --exit-code -- dist",
65
- "archive:check": "node scripts/check-github-archive.mjs",
68
+ "archive:check": "node scripts/check-github-archive.ts",
66
69
  "pack:check": "npm pack --dry-run --ignore-scripts",
67
70
  "release:check": "npm publish --dry-run --access public --tag latest",
68
71
  "check": "npm run typecheck && npm run test && npm run build && npm run types:composition:check && npm run types:posenet:check && npm run docs:check && npm run docs:pages:check && npm run release:consistency:check && npm run check:dist && npm run archive:check && npm run pack:check",
69
72
  "prepack": "npm run build && npm run release:consistency:check"
70
73
  },
71
74
  "devDependencies": {
72
- "@kubohiroya/vite-plugin-turbowarp-extension": "0.1.0",
75
+ "@kubohiroya/turbowarp-camera-source": "0.13.0",
76
+ "@kubohiroya/vite-plugin-turbowarp-extension": "0.4.0",
73
77
  "@teachablemachine/image": "0.8.5",
74
78
  "@teachablemachine/pose": "0.8.6",
75
79
  "@tensorflow-models/posenet": "2.2.2",
@@ -77,8 +81,9 @@
77
81
  "@tensorflow/tfjs": "4.22.0",
78
82
  "@tensorflow/tfjs-backend-wasm": "4.22.0",
79
83
  "@tensorflow/tfjs-backend-webgpu": "4.22.0",
84
+ "@types/node": "^22.20.1",
80
85
  "typescript": "^5.9.3",
81
- "vite": "^7.0.0",
86
+ "vite": "^8.2.2",
82
87
  "vitest": "^4.0.14"
83
88
  },
84
89
  "keywords": [