@ai-matrx/capture 0.4.2 → 0.5.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/CHANGELOG.md CHANGED
@@ -80,3 +80,50 @@ Deliberately not copied from the app this borrows its shape from: fixed duration
80
80
  ## 0.4.2 — 2026-08-30
81
81
 
82
82
  - Release-only correction: ships the same verified 0.4.1 code with its synchronized workspace lockfile so the canonical frozen-lockfile publisher can install and publish reproducibly.
83
+
84
+ ## 0.4.3 — 2026-08-30
85
+
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.
@@ -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 };