@kubohiroya/turbowarp-camera-source 0.6.0 → 0.8.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.ja.md +51 -3
- package/README.md +174 -11
- package/dist/calibration/adaptation.d.ts +64 -0
- package/dist/calibration/adaptation.d.ts.map +1 -0
- package/dist/calibration/adaptation.js +111 -0
- package/dist/calibration/adaptation.js.map +1 -0
- package/dist/calibration/compatibility.d.ts +44 -0
- package/dist/calibration/compatibility.d.ts.map +1 -0
- package/dist/calibration/compatibility.js +95 -0
- package/dist/calibration/compatibility.js.map +1 -0
- package/dist/calibration/conditions.d.ts +67 -0
- package/dist/calibration/conditions.d.ts.map +1 -0
- package/dist/calibration/conditions.js +61 -0
- package/dist/calibration/conditions.js.map +1 -0
- package/dist/calibration/types.d.ts +135 -0
- package/dist/calibration/types.d.ts.map +1 -0
- package/dist/calibration/types.js +13 -0
- package/dist/calibration/types.js.map +1 -0
- package/dist/camera-source.js +1174 -44
- package/dist/extension-manifest.json +119 -3
- package/dist/flip.d.ts +24 -0
- package/dist/flip.d.ts.map +1 -0
- package/dist/flip.js +33 -0
- package/dist/flip.js.map +1 -0
- package/dist/runtime-capability.d.ts +70 -0
- package/dist/runtime-capability.d.ts.map +1 -0
- package/dist/runtime-capability.js +26 -0
- package/dist/runtime-capability.js.map +1 -0
- package/dist/runtime.d.ts +111 -0
- package/dist/runtime.d.ts.map +1 -0
- package/dist/runtime.js +63 -0
- package/dist/runtime.js.map +1 -0
- package/package.json +27 -19
- package/schemas/camera-intrinsics-v1.json +346 -0
- package/schemas/extension-manifest.schema.json +49 -0
|
@@ -2,6 +2,26 @@
|
|
|
2
2
|
"formatVersion": 1,
|
|
3
3
|
"id": "kubohiroyacamerasource",
|
|
4
4
|
"blocks": [
|
|
5
|
+
{
|
|
6
|
+
"opcode": "cameraConditionsGeneration",
|
|
7
|
+
"blockType": "REPORTER",
|
|
8
|
+
"arguments": [
|
|
9
|
+
{
|
|
10
|
+
"id": "CAMERA_ID",
|
|
11
|
+
"type": "STRING"
|
|
12
|
+
}
|
|
13
|
+
]
|
|
14
|
+
},
|
|
15
|
+
{
|
|
16
|
+
"opcode": "cameraConditionsJson",
|
|
17
|
+
"blockType": "REPORTER",
|
|
18
|
+
"arguments": [
|
|
19
|
+
{
|
|
20
|
+
"id": "CAMERA_ID",
|
|
21
|
+
"type": "STRING"
|
|
22
|
+
}
|
|
23
|
+
]
|
|
24
|
+
},
|
|
5
25
|
{
|
|
6
26
|
"opcode": "cameraDeviceCount",
|
|
7
27
|
"blockType": "REPORTER",
|
|
@@ -87,6 +107,86 @@
|
|
|
87
107
|
}
|
|
88
108
|
]
|
|
89
109
|
},
|
|
110
|
+
{
|
|
111
|
+
"opcode": "cameraProfileAdaptation",
|
|
112
|
+
"blockType": "REPORTER",
|
|
113
|
+
"arguments": [
|
|
114
|
+
{
|
|
115
|
+
"id": "CAMERA_ID",
|
|
116
|
+
"type": "STRING"
|
|
117
|
+
}
|
|
118
|
+
]
|
|
119
|
+
},
|
|
120
|
+
{
|
|
121
|
+
"opcode": "cameraProfileCompatibility",
|
|
122
|
+
"blockType": "REPORTER",
|
|
123
|
+
"arguments": [
|
|
124
|
+
{
|
|
125
|
+
"id": "CAMERA_ID",
|
|
126
|
+
"type": "STRING"
|
|
127
|
+
}
|
|
128
|
+
]
|
|
129
|
+
},
|
|
130
|
+
{
|
|
131
|
+
"opcode": "cameraProfileCompatibilityDetail",
|
|
132
|
+
"blockType": "REPORTER",
|
|
133
|
+
"arguments": [
|
|
134
|
+
{
|
|
135
|
+
"id": "CAMERA_ID",
|
|
136
|
+
"type": "STRING"
|
|
137
|
+
}
|
|
138
|
+
]
|
|
139
|
+
},
|
|
140
|
+
{
|
|
141
|
+
"opcode": "cameraProfileError",
|
|
142
|
+
"blockType": "REPORTER",
|
|
143
|
+
"arguments": []
|
|
144
|
+
},
|
|
145
|
+
{
|
|
146
|
+
"opcode": "cameraProfileErrorDetail",
|
|
147
|
+
"blockType": "REPORTER",
|
|
148
|
+
"arguments": []
|
|
149
|
+
},
|
|
150
|
+
{
|
|
151
|
+
"opcode": "cameraProfileIntrinsicsJson",
|
|
152
|
+
"blockType": "REPORTER",
|
|
153
|
+
"arguments": [
|
|
154
|
+
{
|
|
155
|
+
"id": "CAMERA_ID",
|
|
156
|
+
"type": "STRING"
|
|
157
|
+
}
|
|
158
|
+
]
|
|
159
|
+
},
|
|
160
|
+
{
|
|
161
|
+
"opcode": "cameraProfileJson",
|
|
162
|
+
"blockType": "REPORTER",
|
|
163
|
+
"arguments": [
|
|
164
|
+
{
|
|
165
|
+
"id": "CAMERA_ID",
|
|
166
|
+
"type": "STRING"
|
|
167
|
+
}
|
|
168
|
+
]
|
|
169
|
+
},
|
|
170
|
+
{
|
|
171
|
+
"opcode": "cameraProfileRegistered",
|
|
172
|
+
"blockType": "BOOLEAN",
|
|
173
|
+
"arguments": [
|
|
174
|
+
{
|
|
175
|
+
"id": "CAMERA_ID",
|
|
176
|
+
"type": "STRING"
|
|
177
|
+
}
|
|
178
|
+
]
|
|
179
|
+
},
|
|
180
|
+
{
|
|
181
|
+
"opcode": "forgetCameraProfile",
|
|
182
|
+
"blockType": "COMMAND",
|
|
183
|
+
"arguments": [
|
|
184
|
+
{
|
|
185
|
+
"id": "CAMERA_ID",
|
|
186
|
+
"type": "STRING"
|
|
187
|
+
}
|
|
188
|
+
]
|
|
189
|
+
},
|
|
90
190
|
{
|
|
91
191
|
"opcode": "hideCameraPreview",
|
|
92
192
|
"blockType": "COMMAND",
|
|
@@ -112,6 +212,16 @@
|
|
|
112
212
|
"blockType": "COMMAND",
|
|
113
213
|
"arguments": []
|
|
114
214
|
},
|
|
215
|
+
{
|
|
216
|
+
"opcode": "registerCameraProfile",
|
|
217
|
+
"blockType": "COMMAND",
|
|
218
|
+
"arguments": [
|
|
219
|
+
{
|
|
220
|
+
"id": "PROFILE_JSON",
|
|
221
|
+
"type": "STRING"
|
|
222
|
+
}
|
|
223
|
+
]
|
|
224
|
+
},
|
|
115
225
|
{
|
|
116
226
|
"opcode": "showCameraPreview",
|
|
117
227
|
"blockType": "COMMAND",
|
|
@@ -121,8 +231,9 @@
|
|
|
121
231
|
"type": "STRING"
|
|
122
232
|
},
|
|
123
233
|
{
|
|
124
|
-
"id": "
|
|
125
|
-
"type": "STRING"
|
|
234
|
+
"id": "PREVIEW_FLIP",
|
|
235
|
+
"type": "STRING",
|
|
236
|
+
"menu": "flips"
|
|
126
237
|
}
|
|
127
238
|
]
|
|
128
239
|
},
|
|
@@ -151,5 +262,10 @@
|
|
|
151
262
|
]
|
|
152
263
|
}
|
|
153
264
|
],
|
|
154
|
-
"menus": [
|
|
265
|
+
"menus": [
|
|
266
|
+
{
|
|
267
|
+
"id": "flips",
|
|
268
|
+
"acceptReporters": true
|
|
269
|
+
}
|
|
270
|
+
]
|
|
155
271
|
}
|
package/dist/flip.d.ts
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Helpers over the published `Flip` vocabulary.
|
|
3
|
+
*
|
|
4
|
+
* The type itself lives in the runtime contract, because consumers read it off a frame source and
|
|
5
|
+
* should not be re-declaring it. What stays here is the reasoning a caller needs and the small
|
|
6
|
+
* operations the extension performs on it.
|
|
7
|
+
*
|
|
8
|
+
* The vocabulary replaced a `mirrored: boolean`, which could not say which axis, and on a frame
|
|
9
|
+
* source could not say whether it described the pixels or the way they were being shown. Those are
|
|
10
|
+
* different facts with different consequences: a consumer that reads a display choice as a pixel
|
|
11
|
+
* state feeds flipped coordinates into a solve, and the pose it gets back is a left-right
|
|
12
|
+
* reflection whose reprojection error stays small.
|
|
13
|
+
*/
|
|
14
|
+
import type { Flip } from './runtime.js';
|
|
15
|
+
export type { Flip };
|
|
16
|
+
export declare const FLIPS: readonly Flip[];
|
|
17
|
+
export declare function isFlip(value: unknown): value is Flip;
|
|
18
|
+
/** Reads a flip, accepting the boolean the older API used for left-right. */
|
|
19
|
+
export declare function toFlip(value: unknown, fallback?: Flip): Flip;
|
|
20
|
+
export declare function flipsHorizontally(flip: Flip): boolean;
|
|
21
|
+
export declare function flipsVertically(flip: Flip): boolean;
|
|
22
|
+
/** Combines two flips; flipping the same axis twice returns it to none. */
|
|
23
|
+
export declare function combineFlips(left: Flip, right: Flip): Flip;
|
|
24
|
+
//# sourceMappingURL=flip.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"flip.d.ts","sourceRoot":"","sources":["../src/flip.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AACH,OAAO,KAAK,EAAC,IAAI,EAAC,MAAM,cAAc,CAAC;AAEvC,YAAY,EAAC,IAAI,EAAC,CAAC;AAEnB,eAAO,MAAM,KAAK,EAAE,SAAS,IAAI,EAA+C,CAAC;AAEjF,wBAAgB,MAAM,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,IAAI,CAEpD;AAED,6EAA6E;AAC7E,wBAAgB,MAAM,CAAC,KAAK,EAAE,OAAO,EAAE,QAAQ,GAAE,IAAa,GAAG,IAAI,CAKpE;AAED,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,IAAI,GAAG,OAAO,CAErD;AAED,wBAAgB,eAAe,CAAC,IAAI,EAAE,IAAI,GAAG,OAAO,CAEnD;AAED,2EAA2E;AAC3E,wBAAgB,YAAY,CAAC,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,GAAG,IAAI,CAO1D"}
|
package/dist/flip.js
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
export const FLIPS = ['none', 'horizontal', 'vertical', 'both'];
|
|
2
|
+
export function isFlip(value) {
|
|
3
|
+
return typeof value === 'string' && FLIPS.includes(value);
|
|
4
|
+
}
|
|
5
|
+
/** Reads a flip, accepting the boolean the older API used for left-right. */
|
|
6
|
+
export function toFlip(value, fallback = 'none') {
|
|
7
|
+
if (isFlip(value))
|
|
8
|
+
return value;
|
|
9
|
+
if (value === true)
|
|
10
|
+
return 'horizontal';
|
|
11
|
+
if (value === false)
|
|
12
|
+
return 'none';
|
|
13
|
+
return fallback;
|
|
14
|
+
}
|
|
15
|
+
export function flipsHorizontally(flip) {
|
|
16
|
+
return flip === 'horizontal' || flip === 'both';
|
|
17
|
+
}
|
|
18
|
+
export function flipsVertically(flip) {
|
|
19
|
+
return flip === 'vertical' || flip === 'both';
|
|
20
|
+
}
|
|
21
|
+
/** Combines two flips; flipping the same axis twice returns it to none. */
|
|
22
|
+
export function combineFlips(left, right) {
|
|
23
|
+
const horizontal = flipsHorizontally(left) !== flipsHorizontally(right);
|
|
24
|
+
const vertical = flipsVertically(left) !== flipsVertically(right);
|
|
25
|
+
if (horizontal && vertical)
|
|
26
|
+
return 'both';
|
|
27
|
+
if (horizontal)
|
|
28
|
+
return 'horizontal';
|
|
29
|
+
if (vertical)
|
|
30
|
+
return 'vertical';
|
|
31
|
+
return 'none';
|
|
32
|
+
}
|
|
33
|
+
//# sourceMappingURL=flip.js.map
|
package/dist/flip.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"flip.js","sourceRoot":"","sources":["../src/flip.ts"],"names":[],"mappings":"AAiBA,MAAM,CAAC,MAAM,KAAK,GAAoB,CAAC,MAAM,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,CAAC,CAAC;AAEjF,MAAM,UAAU,MAAM,CAAC,KAAc;IACnC,OAAO,OAAO,KAAK,KAAK,QAAQ,IAAK,KAA2B,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;AACnF,CAAC;AAED,6EAA6E;AAC7E,MAAM,UAAU,MAAM,CAAC,KAAc,EAAE,WAAiB,MAAM;IAC5D,IAAI,MAAM,CAAC,KAAK,CAAC;QAAE,OAAO,KAAK,CAAC;IAChC,IAAI,KAAK,KAAK,IAAI;QAAE,OAAO,YAAY,CAAC;IACxC,IAAI,KAAK,KAAK,KAAK;QAAE,OAAO,MAAM,CAAC;IACnC,OAAO,QAAQ,CAAC;AAClB,CAAC;AAED,MAAM,UAAU,iBAAiB,CAAC,IAAU;IAC1C,OAAO,IAAI,KAAK,YAAY,IAAI,IAAI,KAAK,MAAM,CAAC;AAClD,CAAC;AAED,MAAM,UAAU,eAAe,CAAC,IAAU;IACxC,OAAO,IAAI,KAAK,UAAU,IAAI,IAAI,KAAK,MAAM,CAAC;AAChD,CAAC;AAED,2EAA2E;AAC3E,MAAM,UAAU,YAAY,CAAC,IAAU,EAAE,KAAW;IAClD,MAAM,UAAU,GAAG,iBAAiB,CAAC,IAAI,CAAC,KAAK,iBAAiB,CAAC,KAAK,CAAC,CAAC;IACxE,MAAM,QAAQ,GAAG,eAAe,CAAC,IAAI,CAAC,KAAK,eAAe,CAAC,KAAK,CAAC,CAAC;IAClE,IAAI,UAAU,IAAI,QAAQ;QAAE,OAAO,MAAM,CAAC;IAC1C,IAAI,UAAU;QAAE,OAAO,YAAY,CAAC;IACpC,IAAI,QAAQ;QAAE,OAAO,UAAU,CAAC;IAChC,OAAO,MAAM,CAAC;AAChB,CAAC"}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* What other extensions may use without going through blocks.
|
|
3
|
+
*
|
|
4
|
+
* Published under a versioned key rather than as the extension object itself,
|
|
5
|
+
* so a consumer states the contract it was written against and is refused
|
|
6
|
+
* clearly instead of finding a method missing at the worst moment.
|
|
7
|
+
*/
|
|
8
|
+
import type { ProfileAdaptation, UsableIntrinsics } from './calibration/adaptation.js';
|
|
9
|
+
import type { CompatibilityReport } from './calibration/compatibility.js';
|
|
10
|
+
import type { CameraConditions } from './calibration/conditions.js';
|
|
11
|
+
import type { CameraIntrinsicProfileV1, ProfileResult } from './calibration/types.js';
|
|
12
|
+
export { cameraSourceCapabilityKey as runtimeCapabilityKey, cameraSourceCapabilityVersion as runtimeCapabilityVersion } from './runtime.js';
|
|
13
|
+
declare const runtimeCapabilityVersion: 1;
|
|
14
|
+
export interface CameraProfileView {
|
|
15
|
+
/** The document as stored. For showing an operator or writing back out, not for projecting with. */
|
|
16
|
+
readonly profile: CameraIntrinsicProfileV1;
|
|
17
|
+
readonly compatibility: CompatibilityReport;
|
|
18
|
+
/** How the stored numbers would be re-expressed for this frame size, whether or not they may be used. */
|
|
19
|
+
readonly adaptation: ProfileAdaptation;
|
|
20
|
+
/**
|
|
21
|
+
* The numbers that may be used, absent when none may be.
|
|
22
|
+
*
|
|
23
|
+
* A consumer that reaches for `profile.intrinsics` or `adaptation.intrinsics` instead is reading
|
|
24
|
+
* past the question of whether this calibration belongs to this camera, and the wrong answer does
|
|
25
|
+
* not look wrong: it projects, and returns geometry that reads as a slightly different pose.
|
|
26
|
+
*/
|
|
27
|
+
readonly usable?: UsableIntrinsics;
|
|
28
|
+
}
|
|
29
|
+
export interface CameraSourceCapabilityV1 {
|
|
30
|
+
readonly version: typeof runtimeCapabilityVersion;
|
|
31
|
+
requireVersion(version: number): CameraSourceCapabilityV1;
|
|
32
|
+
/** Stores a profile document, whatever produced it. */
|
|
33
|
+
registerProfile(document: unknown): ProfileResult;
|
|
34
|
+
forgetProfile(cameraId: string): boolean;
|
|
35
|
+
profileFor(cameraId: string): CameraIntrinsicProfileV1 | undefined;
|
|
36
|
+
calibratedCameras(): string[];
|
|
37
|
+
/**
|
|
38
|
+
* The profile judged against how the camera is configured right now.
|
|
39
|
+
*
|
|
40
|
+
* Absent when the camera has never been calibrated. That is an ordinary state and not a failure:
|
|
41
|
+
* reporting it as one would leave every consumer deciding which failures are real, and the safe
|
|
42
|
+
* reading of a failure is to stop, which is the wrong response to "nobody has calibrated this
|
|
43
|
+
* camera yet".
|
|
44
|
+
*/
|
|
45
|
+
assessProfile(cameraId: string): CameraProfileView | undefined;
|
|
46
|
+
/**
|
|
47
|
+
* The intrinsics to project the current frames with, or undefined when there are none to use.
|
|
48
|
+
*
|
|
49
|
+
* The short way to ask the only question a consumer usually has. `assessProfile` answers the same
|
|
50
|
+
* thing in its `usable` member, alongside the reasons.
|
|
51
|
+
*/
|
|
52
|
+
intrinsicsFor(cameraId: string): UsableIntrinsics | undefined;
|
|
53
|
+
/**
|
|
54
|
+
* What the track reports about itself, read only.
|
|
55
|
+
*
|
|
56
|
+
* Reading, never setting. Changing a shared camera's configuration from one
|
|
57
|
+
* consumer would silently change what every other consumer is recording.
|
|
58
|
+
*/
|
|
59
|
+
conditionsFor(cameraId: string): CameraConditions;
|
|
60
|
+
/**
|
|
61
|
+
* Increments whenever something that affects the geometry changes.
|
|
62
|
+
*
|
|
63
|
+
* A consumer holding a result derived from a profile can compare one integer
|
|
64
|
+
* instead of re-checking every condition, and knows to discard what it cached
|
|
65
|
+
* when the number moves.
|
|
66
|
+
*/
|
|
67
|
+
conditionsGeneration(cameraId: string): number;
|
|
68
|
+
}
|
|
69
|
+
export declare function createRuntimeCapability(host: Omit<CameraSourceCapabilityV1, 'version' | 'requireVersion'>): CameraSourceCapabilityV1;
|
|
70
|
+
//# sourceMappingURL=runtime-capability.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"runtime-capability.d.ts","sourceRoot":"","sources":["../src/runtime-capability.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,OAAO,KAAK,EAAC,iBAAiB,EAAE,gBAAgB,EAAC,MAAM,6BAA6B,CAAC;AACrF,OAAO,KAAK,EAAC,mBAAmB,EAAC,MAAM,gCAAgC,CAAC;AACxE,OAAO,KAAK,EAAC,gBAAgB,EAAC,MAAM,6BAA6B,CAAC;AAClE,OAAO,KAAK,EAAC,wBAAwB,EAAE,aAAa,EAAC,MAAM,wBAAwB,CAAC;AAIpF,OAAO,EACL,yBAAyB,IAAI,oBAAoB,EACjD,6BAA6B,IAAI,wBAAwB,EAC1D,MAAM,cAAc,CAAC;AAItB,QAAA,MAAM,wBAAwB,GAAgC,CAAC;AAE/D,MAAM,WAAW,iBAAiB;IAChC,oGAAoG;IACpG,QAAQ,CAAC,OAAO,EAAE,wBAAwB,CAAC;IAC3C,QAAQ,CAAC,aAAa,EAAE,mBAAmB,CAAC;IAC5C,yGAAyG;IACzG,QAAQ,CAAC,UAAU,EAAE,iBAAiB,CAAC;IACvC;;;;;;OAMG;IACH,QAAQ,CAAC,MAAM,CAAC,EAAE,gBAAgB,CAAC;CACpC;AAED,MAAM,WAAW,wBAAwB;IACvC,QAAQ,CAAC,OAAO,EAAE,OAAO,wBAAwB,CAAC;IAClD,cAAc,CAAC,OAAO,EAAE,MAAM,GAAG,wBAAwB,CAAC;IAC1D,uDAAuD;IACvD,eAAe,CAAC,QAAQ,EAAE,OAAO,GAAG,aAAa,CAAC;IAClD,aAAa,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC;IACzC,UAAU,CAAC,QAAQ,EAAE,MAAM,GAAG,wBAAwB,GAAG,SAAS,CAAC;IACnE,iBAAiB,IAAI,MAAM,EAAE,CAAC;IAC9B;;;;;;;OAOG;IACH,aAAa,CAAC,QAAQ,EAAE,MAAM,GAAG,iBAAiB,GAAG,SAAS,CAAC;IAC/D;;;;;OAKG;IACH,aAAa,CAAC,QAAQ,EAAE,MAAM,GAAG,gBAAgB,GAAG,SAAS,CAAC;IAC9D;;;;;OAKG;IACH,aAAa,CAAC,QAAQ,EAAE,MAAM,GAAG,gBAAgB,CAAC;IAClD;;;;;;OAMG;IACH,oBAAoB,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,CAAC;CAChD;AAED,wBAAgB,uBAAuB,CACrC,IAAI,EAAE,IAAI,CAAC,wBAAwB,EAAE,SAAS,GAAG,gBAAgB,CAAC,GACjE,wBAAwB,CAqB1B"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
// Defined in the published entry rather than here, so the name a consumer imports and the name this
|
|
2
|
+
// extension publishes under cannot drift apart into two string literals that agree by inspection.
|
|
3
|
+
export { cameraSourceCapabilityKey as runtimeCapabilityKey, cameraSourceCapabilityVersion as runtimeCapabilityVersion } from './runtime.js';
|
|
4
|
+
import { cameraSourceCapabilityVersion } from './runtime.js';
|
|
5
|
+
const runtimeCapabilityVersion = cameraSourceCapabilityVersion;
|
|
6
|
+
export function createRuntimeCapability(host) {
|
|
7
|
+
const capability = {
|
|
8
|
+
version: runtimeCapabilityVersion,
|
|
9
|
+
requireVersion(version) {
|
|
10
|
+
if (version !== runtimeCapabilityVersion) {
|
|
11
|
+
throw new Error(`Unsupported Camera Source runtime capability version: ${version}; this build provides ${runtimeCapabilityVersion}.`);
|
|
12
|
+
}
|
|
13
|
+
return capability;
|
|
14
|
+
},
|
|
15
|
+
registerProfile: (document) => host.registerProfile(document),
|
|
16
|
+
forgetProfile: (cameraId) => host.forgetProfile(cameraId),
|
|
17
|
+
profileFor: (cameraId) => host.profileFor(cameraId),
|
|
18
|
+
calibratedCameras: () => host.calibratedCameras(),
|
|
19
|
+
assessProfile: (cameraId) => host.assessProfile(cameraId),
|
|
20
|
+
intrinsicsFor: (cameraId) => host.intrinsicsFor(cameraId),
|
|
21
|
+
conditionsFor: (cameraId) => host.conditionsFor(cameraId),
|
|
22
|
+
conditionsGeneration: (cameraId) => host.conditionsGeneration(cameraId)
|
|
23
|
+
};
|
|
24
|
+
return Object.freeze(capability);
|
|
25
|
+
}
|
|
26
|
+
//# sourceMappingURL=runtime-capability.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"runtime-capability.js","sourceRoot":"","sources":["../src/runtime-capability.ts"],"names":[],"mappings":"AAYA,oGAAoG;AACpG,kGAAkG;AAClG,OAAO,EACL,yBAAyB,IAAI,oBAAoB,EACjD,6BAA6B,IAAI,wBAAwB,EAC1D,MAAM,cAAc,CAAC;AAEtB,OAAO,EAAC,6BAA6B,EAAC,MAAM,cAAc,CAAC;AAE3D,MAAM,wBAAwB,GAAG,6BAA6B,CAAC;AA2D/D,MAAM,UAAU,uBAAuB,CACrC,IAAkE;IAElE,MAAM,UAAU,GAA6B;QAC3C,OAAO,EAAE,wBAAwB;QACjC,cAAc,CAAC,OAAO;YACpB,IAAI,OAAO,KAAK,wBAAwB,EAAE,CAAC;gBACzC,MAAM,IAAI,KAAK,CACb,yDAAyD,OAAO,yBAAyB,wBAAwB,GAAG,CACrH,CAAC;YACJ,CAAC;YACD,OAAO,UAAU,CAAC;QACpB,CAAC;QACD,eAAe,EAAE,CAAC,QAAQ,EAAE,EAAE,CAAC,IAAI,CAAC,eAAe,CAAC,QAAQ,CAAC;QAC7D,aAAa,EAAE,CAAC,QAAQ,EAAE,EAAE,CAAC,IAAI,CAAC,aAAa,CAAC,QAAQ,CAAC;QACzD,UAAU,EAAE,CAAC,QAAQ,EAAE,EAAE,CAAC,IAAI,CAAC,UAAU,CAAC,QAAQ,CAAC;QACnD,iBAAiB,EAAE,GAAG,EAAE,CAAC,IAAI,CAAC,iBAAiB,EAAE;QACjD,aAAa,EAAE,CAAC,QAAQ,EAAE,EAAE,CAAC,IAAI,CAAC,aAAa,CAAC,QAAQ,CAAC;QACzD,aAAa,EAAE,CAAC,QAAQ,EAAE,EAAE,CAAC,IAAI,CAAC,aAAa,CAAC,QAAQ,CAAC;QACzD,aAAa,EAAE,CAAC,QAAQ,EAAE,EAAE,CAAC,IAAI,CAAC,aAAa,CAAC,QAAQ,CAAC;QACzD,oBAAoB,EAAE,CAAC,QAAQ,EAAE,EAAE,CAAC,IAAI,CAAC,oBAAoB,CAAC,QAAQ,CAAC;KACxE,CAAC;IACF,OAAO,MAAM,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC;AACnC,CAAC"}
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The contract other extensions use to share a camera with this one.
|
|
3
|
+
*
|
|
4
|
+
* Published as its own entry point so a consumer states what it expects instead of re-declaring it.
|
|
5
|
+
* A hand-written copy of an interface compiles perfectly against nothing: when the shape here
|
|
6
|
+
* changes, the copy keeps type-checking in its own repository and fails at runtime in a browser,
|
|
7
|
+
* which is the worst order to find out. Importing these declarations moves that failure to the
|
|
8
|
+
* consumer's build.
|
|
9
|
+
*
|
|
10
|
+
* This module holds no logic and pulls in none of the extension, so importing it costs a consumer
|
|
11
|
+
* nothing at runtime beyond the three constants below.
|
|
12
|
+
*/
|
|
13
|
+
/** The extension ID, as it appears in block opcodes and in a project's extension list. */
|
|
14
|
+
export declare const cameraSourceExtensionId = "kubohiroyacamerasource";
|
|
15
|
+
/**
|
|
16
|
+
* Where the extension instance puts itself on the VM runtime.
|
|
17
|
+
*
|
|
18
|
+
* Present as soon as the extension is registered. Absent means Camera Source is not loaded, which a
|
|
19
|
+
* consumer has to handle whatever else it does.
|
|
20
|
+
*/
|
|
21
|
+
export declare const cameraSourceRuntimeKey = "ext_kubohiroyacamerasource";
|
|
22
|
+
/**
|
|
23
|
+
* Where the versioned capability sits, when the build publishing it has that path enabled.
|
|
24
|
+
*
|
|
25
|
+
* Separate from `cameraSourceRuntimeKey` on purpose. The extension key is present as soon as Camera
|
|
26
|
+
* Source is registered; this one appears only when the calibration profile contract is switched on.
|
|
27
|
+
* A consumer can therefore tell "not loaded" from "loaded, and not offering profiles", and neither
|
|
28
|
+
* has to be reported as the other.
|
|
29
|
+
*/
|
|
30
|
+
export declare const cameraSourceCapabilityKey = "kubohiroyaCameraSourceCapability";
|
|
31
|
+
/** The capability version this build implements. `requireVersion` refuses any other. */
|
|
32
|
+
export declare const cameraSourceCapabilityVersion: 1;
|
|
33
|
+
/**
|
|
34
|
+
* Which way an image has been turned over.
|
|
35
|
+
*
|
|
36
|
+
* `horizontal` is the left-right mirror, matching `cv::flip` with a flip code of 1, ffmpeg's
|
|
37
|
+
* `hflip` and CSS `scaleX(-1)`. Rotation is deliberately not folded in: a portrait capture is a
|
|
38
|
+
* rotation and not a flip, and once both exist their order matters.
|
|
39
|
+
*/
|
|
40
|
+
export type Flip = 'none' | 'horizontal' | 'vertical' | 'both';
|
|
41
|
+
export interface CameraAcquireOptions {
|
|
42
|
+
/** Free text naming the caller. Appears in diagnostics; never used to decide anything. */
|
|
43
|
+
owner?: string;
|
|
44
|
+
/** The role name of the stream, such as `pose` or `qr`. Callers naming the same one share it. */
|
|
45
|
+
cameraId?: string;
|
|
46
|
+
deviceId?: string;
|
|
47
|
+
video?: MediaTrackConstraints | boolean;
|
|
48
|
+
/** How this consumer wants the stage preview drawn. Only meaningful together with `preview`. */
|
|
49
|
+
previewFlip?: Flip;
|
|
50
|
+
preview?: boolean;
|
|
51
|
+
}
|
|
52
|
+
export interface CameraFrameSource {
|
|
53
|
+
readonly kind: 'video';
|
|
54
|
+
readonly element: HTMLVideoElement;
|
|
55
|
+
readonly width: number;
|
|
56
|
+
readonly height: number;
|
|
57
|
+
/**
|
|
58
|
+
* How the stage preview is being drawn, which says nothing about the pixels.
|
|
59
|
+
*
|
|
60
|
+
* The frames behind it are always the ones the camera captured: drawing a preview turned over is
|
|
61
|
+
* a rendering transform and never reaches them. A consumer that reads this as a statement about
|
|
62
|
+
* the image and flips its coordinates to compensate feeds a solve reflected input, and the pose
|
|
63
|
+
* that comes back is a left-right reflection whose reprojection error stays small.
|
|
64
|
+
*
|
|
65
|
+
* Read it when drawing something that sits next to the preview and should match it.
|
|
66
|
+
*/
|
|
67
|
+
readonly previewFlip: Flip;
|
|
68
|
+
readonly deviceId: string;
|
|
69
|
+
}
|
|
70
|
+
export interface CameraLease {
|
|
71
|
+
getFrameSource(): CameraFrameSource;
|
|
72
|
+
release(): Promise<void>;
|
|
73
|
+
}
|
|
74
|
+
/**
|
|
75
|
+
* What `Scratch.vm.runtime[cameraSourceRuntimeKey]` offers.
|
|
76
|
+
*
|
|
77
|
+
* Only the members a sharing consumer needs are named here. The extension instance carries its
|
|
78
|
+
* block methods as well, but those are the block surface and not a contract between extensions.
|
|
79
|
+
*/
|
|
80
|
+
export interface CameraSourceRuntime {
|
|
81
|
+
acquireCamera(options?: CameraAcquireOptions): Promise<CameraLease>;
|
|
82
|
+
}
|
|
83
|
+
/**
|
|
84
|
+
* The profile contract, re-exported so a consumer states it rather than restating it.
|
|
85
|
+
*
|
|
86
|
+
* These are declarations only and cost a consumer nothing at run time. They are published because a
|
|
87
|
+
* hand-written copy is checked against nothing: `turbowarp-camera-calibration` wrote its own copy of
|
|
88
|
+
* the registry, named a method this extension does not have, and every attempt to publish a profile
|
|
89
|
+
* failed for a reason unrelated to the message it produced. Its type-check passed throughout.
|
|
90
|
+
*/
|
|
91
|
+
export type { CameraProfileView, CameraSourceCapabilityV1 } from './runtime-capability.js';
|
|
92
|
+
export type { CalibrationCapture, CalibrationDeviceHint, CalibrationImage, CalibrationQuality, CameraDistortion, CameraIntrinsicProfileV1, CameraIntrinsics, CameraModel, DistortionModel, ProfileError, ProfileErrorCode, ProfileResult } from './calibration/types.js';
|
|
93
|
+
export type { AdaptationCode, AdaptationState, ProfileAdaptation, UsableIntrinsics } from './calibration/adaptation.js';
|
|
94
|
+
export type { CompatibilityCode, CompatibilityFinding, CompatibilityReport, CompatibilityState, FindingState } from './calibration/compatibility.js';
|
|
95
|
+
export type { CameraConditions } from './calibration/conditions.js';
|
|
96
|
+
import type { CameraSourceCapabilityV1 } from './runtime-capability.js';
|
|
97
|
+
/** Narrows a runtime value to the Camera Source surface, so a missing extension reads as absent. */
|
|
98
|
+
export declare function readCameraSourceRuntime(runtime: unknown): CameraSourceRuntime | undefined;
|
|
99
|
+
/**
|
|
100
|
+
* Narrows a runtime value to the profile capability, or reports it as unavailable.
|
|
101
|
+
*
|
|
102
|
+
* Undefined means one of two things a consumer usually handles the same way: Camera Source is not
|
|
103
|
+
* loaded, or it is loaded with the profile contract switched off. `readCameraSourceRuntime` is what
|
|
104
|
+
* separates them when the difference matters -- a consumer that can still share a camera but cannot
|
|
105
|
+
* ask about calibration should say that, rather than reporting the extension as missing.
|
|
106
|
+
*
|
|
107
|
+
* A version this build does not implement is a third thing again, and not an absence: the capability
|
|
108
|
+
* is returned, and `requireVersion` refuses out loud when asked for a version it cannot honour.
|
|
109
|
+
*/
|
|
110
|
+
export declare function readCameraSourceCapability(runtime: unknown): CameraSourceCapabilityV1 | undefined;
|
|
111
|
+
//# sourceMappingURL=runtime.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"runtime.d.ts","sourceRoot":"","sources":["../src/runtime.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,0FAA0F;AAC1F,eAAO,MAAM,uBAAuB,2BAA2B,CAAC;AAEhE;;;;;GAKG;AACH,eAAO,MAAM,sBAAsB,+BAA+B,CAAC;AAEnE;;;;;;;GAOG;AACH,eAAO,MAAM,yBAAyB,qCAAqC,CAAC;AAE5E,wFAAwF;AACxF,eAAO,MAAM,6BAA6B,EAAG,CAAU,CAAC;AAExD;;;;;;GAMG;AACH,MAAM,MAAM,IAAI,GAAG,MAAM,GAAG,YAAY,GAAG,UAAU,GAAG,MAAM,CAAC;AAE/D,MAAM,WAAW,oBAAoB;IACnC,0FAA0F;IAC1F,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,iGAAiG;IACjG,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,KAAK,CAAC,EAAE,qBAAqB,GAAG,OAAO,CAAC;IACxC,gGAAgG;IAChG,WAAW,CAAC,EAAE,IAAI,CAAC;IACnB,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAED,MAAM,WAAW,iBAAiB;IAChC,QAAQ,CAAC,IAAI,EAAE,OAAO,CAAC;IACvB,QAAQ,CAAC,OAAO,EAAE,gBAAgB,CAAC;IACnC,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB;;;;;;;;;OASG;IACH,QAAQ,CAAC,WAAW,EAAE,IAAI,CAAC;IAC3B,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;CAC3B;AAED,MAAM,WAAW,WAAW;IAC1B,cAAc,IAAI,iBAAiB,CAAC;IACpC,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;CAC1B;AAED;;;;;GAKG;AACH,MAAM,WAAW,mBAAmB;IAClC,aAAa,CAAC,OAAO,CAAC,EAAE,oBAAoB,GAAG,OAAO,CAAC,WAAW,CAAC,CAAC;CACrE;AAED;;;;;;;GAOG;AACH,YAAY,EACV,iBAAiB,EACjB,wBAAwB,EACzB,MAAM,yBAAyB,CAAC;AAEjC,YAAY,EACV,kBAAkB,EAClB,qBAAqB,EACrB,gBAAgB,EAChB,kBAAkB,EAClB,gBAAgB,EAChB,wBAAwB,EACxB,gBAAgB,EAChB,WAAW,EACX,eAAe,EACf,YAAY,EACZ,gBAAgB,EAChB,aAAa,EACd,MAAM,wBAAwB,CAAC;AAEhC,YAAY,EACV,cAAc,EACd,eAAe,EACf,iBAAiB,EACjB,gBAAgB,EACjB,MAAM,6BAA6B,CAAC;AAErC,YAAY,EACV,iBAAiB,EACjB,oBAAoB,EACpB,mBAAmB,EACnB,kBAAkB,EAClB,YAAY,EACb,MAAM,gCAAgC,CAAC;AAExC,YAAY,EAAC,gBAAgB,EAAC,MAAM,6BAA6B,CAAC;AAElE,OAAO,KAAK,EAAC,wBAAwB,EAAC,MAAM,yBAAyB,CAAC;AAEtE,oGAAoG;AACpG,wBAAgB,uBAAuB,CAAC,OAAO,EAAE,OAAO,GAAG,mBAAmB,GAAG,SAAS,CAMzF;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,0BAA0B,CACxC,OAAO,EAAE,OAAO,GACf,wBAAwB,GAAG,SAAS,CAMtC"}
|
package/dist/runtime.js
ADDED
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The contract other extensions use to share a camera with this one.
|
|
3
|
+
*
|
|
4
|
+
* Published as its own entry point so a consumer states what it expects instead of re-declaring it.
|
|
5
|
+
* A hand-written copy of an interface compiles perfectly against nothing: when the shape here
|
|
6
|
+
* changes, the copy keeps type-checking in its own repository and fails at runtime in a browser,
|
|
7
|
+
* which is the worst order to find out. Importing these declarations moves that failure to the
|
|
8
|
+
* consumer's build.
|
|
9
|
+
*
|
|
10
|
+
* This module holds no logic and pulls in none of the extension, so importing it costs a consumer
|
|
11
|
+
* nothing at runtime beyond the three constants below.
|
|
12
|
+
*/
|
|
13
|
+
/** The extension ID, as it appears in block opcodes and in a project's extension list. */
|
|
14
|
+
export const cameraSourceExtensionId = 'kubohiroyacamerasource';
|
|
15
|
+
/**
|
|
16
|
+
* Where the extension instance puts itself on the VM runtime.
|
|
17
|
+
*
|
|
18
|
+
* Present as soon as the extension is registered. Absent means Camera Source is not loaded, which a
|
|
19
|
+
* consumer has to handle whatever else it does.
|
|
20
|
+
*/
|
|
21
|
+
export const cameraSourceRuntimeKey = 'ext_kubohiroyacamerasource';
|
|
22
|
+
/**
|
|
23
|
+
* Where the versioned capability sits, when the build publishing it has that path enabled.
|
|
24
|
+
*
|
|
25
|
+
* Separate from `cameraSourceRuntimeKey` on purpose. The extension key is present as soon as Camera
|
|
26
|
+
* Source is registered; this one appears only when the calibration profile contract is switched on.
|
|
27
|
+
* A consumer can therefore tell "not loaded" from "loaded, and not offering profiles", and neither
|
|
28
|
+
* has to be reported as the other.
|
|
29
|
+
*/
|
|
30
|
+
export const cameraSourceCapabilityKey = 'kubohiroyaCameraSourceCapability';
|
|
31
|
+
/** The capability version this build implements. `requireVersion` refuses any other. */
|
|
32
|
+
export const cameraSourceCapabilityVersion = 1;
|
|
33
|
+
/** Narrows a runtime value to the Camera Source surface, so a missing extension reads as absent. */
|
|
34
|
+
export function readCameraSourceRuntime(runtime) {
|
|
35
|
+
if (typeof runtime !== 'object' || runtime === null)
|
|
36
|
+
return undefined;
|
|
37
|
+
const candidate = runtime[cameraSourceRuntimeKey];
|
|
38
|
+
if (typeof candidate !== 'object' || candidate === null)
|
|
39
|
+
return undefined;
|
|
40
|
+
const { acquireCamera } = candidate;
|
|
41
|
+
return typeof acquireCamera === 'function' ? candidate : undefined;
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* Narrows a runtime value to the profile capability, or reports it as unavailable.
|
|
45
|
+
*
|
|
46
|
+
* Undefined means one of two things a consumer usually handles the same way: Camera Source is not
|
|
47
|
+
* loaded, or it is loaded with the profile contract switched off. `readCameraSourceRuntime` is what
|
|
48
|
+
* separates them when the difference matters -- a consumer that can still share a camera but cannot
|
|
49
|
+
* ask about calibration should say that, rather than reporting the extension as missing.
|
|
50
|
+
*
|
|
51
|
+
* A version this build does not implement is a third thing again, and not an absence: the capability
|
|
52
|
+
* is returned, and `requireVersion` refuses out loud when asked for a version it cannot honour.
|
|
53
|
+
*/
|
|
54
|
+
export function readCameraSourceCapability(runtime) {
|
|
55
|
+
if (typeof runtime !== 'object' || runtime === null)
|
|
56
|
+
return undefined;
|
|
57
|
+
const candidate = runtime[cameraSourceCapabilityKey];
|
|
58
|
+
if (typeof candidate !== 'object' || candidate === null)
|
|
59
|
+
return undefined;
|
|
60
|
+
const { requireVersion } = candidate;
|
|
61
|
+
return typeof requireVersion === 'function' ? candidate : undefined;
|
|
62
|
+
}
|
|
63
|
+
//# sourceMappingURL=runtime.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"runtime.js","sourceRoot":"","sources":["../src/runtime.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,0FAA0F;AAC1F,MAAM,CAAC,MAAM,uBAAuB,GAAG,wBAAwB,CAAC;AAEhE;;;;;GAKG;AACH,MAAM,CAAC,MAAM,sBAAsB,GAAG,4BAA4B,CAAC;AAEnE;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,yBAAyB,GAAG,kCAAkC,CAAC;AAE5E,wFAAwF;AACxF,MAAM,CAAC,MAAM,6BAA6B,GAAG,CAAU,CAAC;AAwGxD,oGAAoG;AACpG,MAAM,UAAU,uBAAuB,CAAC,OAAgB;IACtD,IAAI,OAAO,OAAO,KAAK,QAAQ,IAAI,OAAO,KAAK,IAAI;QAAE,OAAO,SAAS,CAAC;IACtE,MAAM,SAAS,GAAI,OAAmC,CAAC,sBAAsB,CAAC,CAAC;IAC/E,IAAI,OAAO,SAAS,KAAK,QAAQ,IAAI,SAAS,KAAK,IAAI;QAAE,OAAO,SAAS,CAAC;IAC1E,MAAM,EAAC,aAAa,EAAC,GAAG,SAAsC,CAAC;IAC/D,OAAO,OAAO,aAAa,KAAK,UAAU,CAAC,CAAC,CAAE,SAAiC,CAAC,CAAC,CAAC,SAAS,CAAC;AAC9F,CAAC;AAED;;;;;;;;;;GAUG;AACH,MAAM,UAAU,0BAA0B,CACxC,OAAgB;IAEhB,IAAI,OAAO,OAAO,KAAK,QAAQ,IAAI,OAAO,KAAK,IAAI;QAAE,OAAO,SAAS,CAAC;IACtE,MAAM,SAAS,GAAI,OAAmC,CAAC,yBAAyB,CAAC,CAAC;IAClF,IAAI,OAAO,SAAS,KAAK,QAAQ,IAAI,SAAS,KAAK,IAAI;QAAE,OAAO,SAAS,CAAC;IAC1E,MAAM,EAAC,cAAc,EAAC,GAAG,SAAuC,CAAC;IACjE,OAAO,OAAO,cAAc,KAAK,UAAU,CAAC,CAAC,CAAE,SAAsC,CAAC,CAAC,CAAC,SAAS,CAAC;AACpG,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kubohiroya/turbowarp-camera-source",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.8.0",
|
|
4
4
|
"author": "Hiroya Kubo <hiroya@cuc.ac.jp>",
|
|
5
5
|
"description": "A TurboWarp capability extension for sharing one MediaDevices camera stream across extensions.",
|
|
6
6
|
"type": "module",
|
|
@@ -15,10 +15,15 @@
|
|
|
15
15
|
},
|
|
16
16
|
"exports": {
|
|
17
17
|
"./camera-source.js": "./dist/camera-source.js",
|
|
18
|
+
"./runtime": {
|
|
19
|
+
"types": "./dist/runtime.d.ts",
|
|
20
|
+
"import": "./dist/runtime.js"
|
|
21
|
+
},
|
|
18
22
|
"./package.json": "./package.json"
|
|
19
23
|
},
|
|
20
24
|
"files": [
|
|
21
25
|
"dist/",
|
|
26
|
+
"schemas/",
|
|
22
27
|
"README.md",
|
|
23
28
|
"README.ja.md",
|
|
24
29
|
"LICENSE"
|
|
@@ -29,13 +34,32 @@
|
|
|
29
34
|
"access": "public",
|
|
30
35
|
"registry": "https://registry.npmjs.org/"
|
|
31
36
|
},
|
|
37
|
+
"packageManager": "pnpm@11.18.0",
|
|
32
38
|
"engines": {
|
|
33
39
|
"node": ">=22.18.0"
|
|
34
40
|
},
|
|
41
|
+
"scripts": {
|
|
42
|
+
"dev": "vite build --watch",
|
|
43
|
+
"typecheck": "tsc --noEmit",
|
|
44
|
+
"build": "vite build && tsc -p tsconfig.lib.json",
|
|
45
|
+
"lint": "eslint src tests vite.config.ts",
|
|
46
|
+
"format": "eslint src tests vite.config.ts --fix",
|
|
47
|
+
"test": "vitest run",
|
|
48
|
+
"docs": "node scripts/generate-readme.ts",
|
|
49
|
+
"docs:check": "pnpm run docs && git diff --exit-code -- README.md README.ja.md",
|
|
50
|
+
"docs:pages:check": "node scripts/check-pages.ts",
|
|
51
|
+
"repo:check": "node scripts/check-repo.ts",
|
|
52
|
+
"pack:check": "npm pack --dry-run --ignore-scripts",
|
|
53
|
+
"release:check": "pnpm publish --dry-run --access public --no-git-checks",
|
|
54
|
+
"check": "pnpm run typecheck && pnpm run lint && pnpm run test && pnpm run docs:check && pnpm run docs:pages:check && pnpm run check:dist && pnpm run repo:check && pnpm run pack:check",
|
|
55
|
+
"check:dist": "pnpm run build && node scripts/check-dist.ts",
|
|
56
|
+
"prepack": "pnpm run check"
|
|
57
|
+
},
|
|
35
58
|
"devDependencies": {
|
|
36
59
|
"@eslint/js": "^9.39.5",
|
|
37
60
|
"@kubohiroya/vite-plugin-turbowarp-extension": "0.4.0",
|
|
38
61
|
"@types/node": "^24.13.3",
|
|
62
|
+
"ajv": "^8.20.0",
|
|
39
63
|
"eslint": "^9.39.5",
|
|
40
64
|
"typescript": "^5.9.3",
|
|
41
65
|
"typescript-eslint": "^8.66.0",
|
|
@@ -49,21 +73,5 @@
|
|
|
49
73
|
"camera",
|
|
50
74
|
"media-devices",
|
|
51
75
|
"getusermedia"
|
|
52
|
-
]
|
|
53
|
-
|
|
54
|
-
"dev": "vite build --watch",
|
|
55
|
-
"typecheck": "tsc --noEmit",
|
|
56
|
-
"build": "vite build",
|
|
57
|
-
"lint": "eslint src tests vite.config.ts",
|
|
58
|
-
"format": "eslint src tests vite.config.ts --fix",
|
|
59
|
-
"test": "vitest run",
|
|
60
|
-
"docs": "node scripts/generate-readme.ts",
|
|
61
|
-
"docs:check": "pnpm run docs && git diff --exit-code -- README.md",
|
|
62
|
-
"docs:pages:check": "node scripts/check-pages.ts",
|
|
63
|
-
"repo:check": "node scripts/check-repo.ts",
|
|
64
|
-
"pack:check": "npm pack --dry-run --ignore-scripts",
|
|
65
|
-
"release:check": "pnpm publish --dry-run --access public --no-git-checks",
|
|
66
|
-
"check": "pnpm run typecheck && pnpm run lint && pnpm run test && pnpm run docs:check && pnpm run docs:pages:check && pnpm run check:dist && pnpm run repo:check && pnpm run pack:check",
|
|
67
|
-
"check:dist": "pnpm run build && node scripts/check-dist.ts"
|
|
68
|
-
}
|
|
69
|
-
}
|
|
76
|
+
]
|
|
77
|
+
}
|