@ai-matrx/capture 0.4.3 → 0.5.1
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/CHANGELOG.md +65 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +9 -1
- package/dist/index.d.ts +9 -1
- package/dist/react.cjs +674 -98
- package/dist/react.cjs.map +1 -1
- package/dist/react.d.cts +265 -4
- package/dist/react.d.ts +265 -4
- package/dist/react.js +675 -105
- package/dist/react.js.map +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -84,3 +84,68 @@ Deliberately not copied from the app this borrows its shape from: fixed duration
|
|
|
84
84
|
## 0.4.3 — 2026-08-30
|
|
85
85
|
|
|
86
86
|
- Filmstrip video tiles paint their first frame on iOS (`#t=0.01` media fragment) — a `preload="metadata"` tile rendered black.
|
|
87
|
+
|
|
88
|
+
## 0.5.0 — 2026-08-30
|
|
89
|
+
|
|
90
|
+
**The C22/C23 retrofit: the hard parts move INTO the package** (all-inclusive-retrofit capture row). matrx-frontend's host adapter carried 415 lines of camera orchestration the package's default engine lacked, plus a 206-line cloud-library sheet. Absorbed:
|
|
91
|
+
|
|
92
|
+
- **Production default engine** (`useDefaultCaptureEngine`, rewritten):
|
|
93
|
+
permission pre-check (known-denied → `blocked` without hammering gUM);
|
|
94
|
+
the COMBINED camera+mic prompt (one browser prompt for both permissions,
|
|
95
|
+
audio banked in the warm-mic manager, combined denial retried ONCE
|
|
96
|
+
video-only so a mic denial never takes the camera down); REAL device flip
|
|
97
|
+
(cycles `videoinput` deviceIds, hidden + guarded while recording); camera
|
|
98
|
+
track-health with one bounded reacquire on OS interruption; monotonic
|
|
99
|
+
recording clock; one-capture-at-a-time shutter guard; 120 ms `flash` flag;
|
|
100
|
+
loud shutter failures via the `onError` sink; mic discipline on recording
|
|
101
|
+
(warm acquire → clone → stop only clones → release exactly once). Returns
|
|
102
|
+
`DefaultCaptureEngine` (engine + `flash` + `capturePhotoWith`).
|
|
103
|
+
- **`src/engine/warm-mic.ts`** — the warm microphone manager, ported VERBATIM
|
|
104
|
+
from the proven matrx-frontend `micStream` (short keepalive, refcount,
|
|
105
|
+
coalesced in-flight, pagehide backstop, `adoptWarmAudioStream` banking) with
|
|
106
|
+
ALL FOUR iOS-Safari recovery branches: `ended` / `muted` / `unmuted` /
|
|
107
|
+
`permission-revoked` — each reported loudly on the interruption channel.
|
|
108
|
+
State on a `globalThis` `Symbol.for` slot (dual ESM/CJS graph safe).
|
|
109
|
+
- **`src/engine/permissions.ts`** — `queryCameraPermission` / `queryMicPermission`
|
|
110
|
+
pre-checks, `shouldCombineMicPrompt`, and `classifyCameraBlockReason` (the
|
|
111
|
+
ONE NotAllowedError/SecurityError branch — hosts import it instead of
|
|
112
|
+
re-implementing it).
|
|
113
|
+
- **`src/engine/crop.ts`** — `cropBlobToAspect` (the ONE full-sensor
|
|
114
|
+
center-crop) + `nextCameraDevice` (the shared flip-cycling algorithm).
|
|
115
|
+
- **`CloudLibrarySheet`** — the recents-thumb destination absorbed as a
|
|
116
|
+
package component over injected data (`CaptureCloudLibraryItem[]`,
|
|
117
|
+
host-supplied thumbnail nodes, `onOpenItem` navigation, optional v3
|
|
118
|
+
in-library Upload door). Chrome identical to the host original; two new
|
|
119
|
+
C19 inlined glyphs (upload, image-off).
|
|
120
|
+
- **Laws amended DELIBERATELY**: law 2's header records why the pre-C23
|
|
121
|
+
"no getUserMedia" wording changed (the ban outside `src/engine/` survives);
|
|
122
|
+
new law 6 is the forcing function — the warm-mic manager must carry all
|
|
123
|
+
four recovery branches and the engine must pre-check + combine prompts +
|
|
124
|
+
use the warm-mic manager, or the build fails.
|
|
125
|
+
|
|
126
|
+
The injected-engine seam is unchanged: hosts with their own cross-feature
|
|
127
|
+
media runtime (matrx-frontend's lease manager) still inject a
|
|
128
|
+
`CaptureCameraEngine`; their adapters now import the package's crop /
|
|
129
|
+
classification / flip helpers instead of carrying twins.
|
|
130
|
+
|
|
131
|
+
### Consumer action (C28)
|
|
132
|
+
|
|
133
|
+
- **Host engine adapters**: delete local copies of the aspect crop, the
|
|
134
|
+
NotAllowedError/SecurityError classification, and the flip-cycling
|
|
135
|
+
algorithm — import `cropBlobToAspect`, `classifyCameraBlockReason`,
|
|
136
|
+
`nextCameraDevice`, `PHOTO_JPEG_QUALITY` from `@ai-matrx/capture/react`.
|
|
137
|
+
Any remaining adapter line must be lease-runtime identity wiring with a
|
|
138
|
+
C22 justification. (matrx-frontend: done same-session.)
|
|
139
|
+
- **Host cloud-library sheets**: replace bespoke tiled-gallery chrome with
|
|
140
|
+
the package `CloudLibrarySheet` — the host supplies
|
|
141
|
+
`items: CaptureCloudLibraryItem[]` (own thumbnail nodes), `loading`,
|
|
142
|
+
`onOpenItem`, optional `onUpload` (v3 in-library door). (matrx-frontend:
|
|
143
|
+
host copy collapsed to a data wrapper, consumer props unchanged.)
|
|
144
|
+
- **Runtime-less hosts**: adopt the rewritten `useDefaultCaptureEngine`
|
|
145
|
+
(now returns `DefaultCaptureEngine` = engine + `flash` +
|
|
146
|
+
`capturePhotoWith`; new options `mode`, `fileNamePrefix`, `onError`).
|
|
147
|
+
No breaking signature change — existing options still work.
|
|
148
|
+
- **`DefaultEngineOptions` behavior delta**: video capture callbacks now
|
|
149
|
+
fire with warm-mic-managed audio and the combined permission prompt;
|
|
150
|
+
hosts that suppressed their own double-prompt workarounds can delete
|
|
151
|
+
them.
|
package/dist/index.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/index.ts"],"sourcesContent":["/**\n * @ai-matrx/capture — root entry: TYPES ONLY, RSC-safe (no \"use client\").\n *\n * THE CLOUD LAW: cloud integration is WHAT this system does, not an option.\n * `CameraCapture` (from `@ai-matrx/capture/react`) requires a\n * `CaptureCloudPort`; the host injects HOW it is fulfilled, never WHETHER.\n */\n\nexport type {\n CaptureAspect,\n CaptureCameraEngine,\n CaptureCameraMode,\n CaptureCameraSlots,\n CaptureCameraV3Slots,\n CaptureCloudPort,\n CaptureOptionTile,\n CaptureRailAction,\n CaptureTimerSetting,\n} from \"./types\";\n"],"mappings":";;;;;;;;;;;;;;;;AAAA;AAAA;","names":[]}
|
|
1
|
+
{"version":3,"sources":["../src/index.ts"],"sourcesContent":["/**\n * @ai-matrx/capture — root entry: TYPES ONLY, RSC-safe (no \"use client\").\n *\n * THE CLOUD LAW: cloud integration is WHAT this system does, not an option.\n * `CameraCapture` (from `@ai-matrx/capture/react`) requires a\n * `CaptureCloudPort`; the host injects HOW it is fulfilled, never WHETHER.\n */\n\nexport type {\n CaptureAspect,\n CaptureCameraEngine,\n CaptureCameraMode,\n CaptureCameraSlots,\n CaptureCameraV3Slots,\n CaptureCloudLibraryItem,\n CaptureCloudPort,\n CaptureOptionTile,\n CaptureRailAction,\n CaptureTimerSetting,\n} from \"./types\";\n"],"mappings":";;;;;;;;;;;;;;;;AAAA;AAAA;","names":[]}
|
package/dist/index.d.cts
CHANGED
|
@@ -39,6 +39,14 @@ interface CaptureCloudPort {
|
|
|
39
39
|
/** Opens the host's cloud media library (tiled gallery). */
|
|
40
40
|
onOpenLibrary: () => void;
|
|
41
41
|
}
|
|
42
|
+
/** One media item in the cloud library sheet. The host supplies the
|
|
43
|
+
* thumbnail NODE (its own resolver/auth) — the package never fetches. */
|
|
44
|
+
interface CaptureCloudLibraryItem {
|
|
45
|
+
id: string;
|
|
46
|
+
fileName: string;
|
|
47
|
+
kind: "image" | "video";
|
|
48
|
+
thumbnail: React.ReactNode;
|
|
49
|
+
}
|
|
42
50
|
/**
|
|
43
51
|
* The engine port — everything the chrome needs from the host's camera
|
|
44
52
|
* runtime. The host owns lease acquisition/release, capture and recording;
|
|
@@ -163,4 +171,4 @@ interface CaptureCameraV3Slots {
|
|
|
163
171
|
overlays?: React.ReactNode;
|
|
164
172
|
}
|
|
165
173
|
|
|
166
|
-
export type { CaptureAspect, CaptureCameraEngine, CaptureCameraMode, CaptureCameraSlots, CaptureCameraV3Slots, CaptureCloudPort, CaptureOptionTile, CaptureRailAction, CaptureTimerSetting };
|
|
174
|
+
export type { CaptureAspect, CaptureCameraEngine, CaptureCameraMode, CaptureCameraSlots, CaptureCameraV3Slots, CaptureCloudLibraryItem, CaptureCloudPort, CaptureOptionTile, CaptureRailAction, CaptureTimerSetting };
|
package/dist/index.d.ts
CHANGED
|
@@ -39,6 +39,14 @@ interface CaptureCloudPort {
|
|
|
39
39
|
/** Opens the host's cloud media library (tiled gallery). */
|
|
40
40
|
onOpenLibrary: () => void;
|
|
41
41
|
}
|
|
42
|
+
/** One media item in the cloud library sheet. The host supplies the
|
|
43
|
+
* thumbnail NODE (its own resolver/auth) — the package never fetches. */
|
|
44
|
+
interface CaptureCloudLibraryItem {
|
|
45
|
+
id: string;
|
|
46
|
+
fileName: string;
|
|
47
|
+
kind: "image" | "video";
|
|
48
|
+
thumbnail: React.ReactNode;
|
|
49
|
+
}
|
|
42
50
|
/**
|
|
43
51
|
* The engine port — everything the chrome needs from the host's camera
|
|
44
52
|
* runtime. The host owns lease acquisition/release, capture and recording;
|
|
@@ -163,4 +171,4 @@ interface CaptureCameraV3Slots {
|
|
|
163
171
|
overlays?: React.ReactNode;
|
|
164
172
|
}
|
|
165
173
|
|
|
166
|
-
export type { CaptureAspect, CaptureCameraEngine, CaptureCameraMode, CaptureCameraSlots, CaptureCameraV3Slots, CaptureCloudPort, CaptureOptionTile, CaptureRailAction, CaptureTimerSetting };
|
|
174
|
+
export type { CaptureAspect, CaptureCameraEngine, CaptureCameraMode, CaptureCameraSlots, CaptureCameraV3Slots, CaptureCloudLibraryItem, CaptureCloudPort, CaptureOptionTile, CaptureRailAction, CaptureTimerSetting };
|