@mediaruntime/cli 1.2.0 → 1.3.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
@@ -1,5 +1,23 @@
1
1
  # Changelog
2
2
 
3
+ ## 1.3.0 — 2026-08-31
4
+
5
+ - Add complete Hosted Sticker Runtime commands for collection lifecycle, pack binding,
6
+ enabled-pack discovery, search, typeahead, stable metadata retrieval, signed asset
7
+ resolution, pooled usage, and short-lived scoped token issuance.
8
+ - Keep API keys and secure browser login as the default sticker authentication while
9
+ allowing `MEDIARUNTIME_STICKER_CLIENT_TOKEN` only for collection-bound read commands.
10
+ - Add explicit, bounded still-image Privacy Redaction Preview flags for face, license-plate, and visible-text
11
+ masking; aliases are expanded through the live capability catalog before submission.
12
+ - Document the stable public privacy-report boundary and its ZIP-relative paths while
13
+ excluding detector/model and private infrastructure details.
14
+ - Add bounded Audiogram artwork-fit, waveform-gain, safe-caption, and optional loudness
15
+ normalization flags; document the caption-free poster artifact.
16
+ - Document capability-driven `code_detect_v1` execution and its untrusted-payload rule.
17
+ - Document and regression-test capability-driven `compatibility_report_v1` execution.
18
+ - Add bounded `contact_sheet_v1` run controls for grid geometry, sampling window, sheet
19
+ count, format, and quality.
20
+
3
21
  ## 1.2.0 — 2026-08-19
4
22
 
5
23
  - Add hosted recipe discovery, inspection, creation, immutable versioning, and archive
package/README.md CHANGED
@@ -4,7 +4,7 @@ Official command-line client for MediaRuntime. It submits media, waits for jobs,
4
4
  the canonical ZIP output bundle, inspects account jobs, and sends correctly signed
5
5
  synthetic webhooks to a local receiver.
6
6
 
7
- Status: stable `1.2.0`. The documented `1.x` command names, flags, JSON envelopes, exit
7
+ Status: stable `1.3.0`. The documented `1.x` command names, flags, JSON envelopes, exit
8
8
  codes, and credential precedence follow semantic versioning. Breaking changes require a
9
9
  new major version; additive commands and fields may ship in minor releases.
10
10
 
@@ -87,6 +87,111 @@ mediaruntime run ./launch.mp4 \
87
87
  retrieves the catalog and supplies the preset's required output type automatically. Alias
88
88
  and preset selections may be mixed and repeated in one command.
89
89
 
90
+ Animated WebP and APNG are explicit Premium presets. Their bounded controls apply when
91
+ exactly one animation preset is selected (`0` loops forever; APNG is lossless and does
92
+ not accept `--animation-quality`):
93
+
94
+ ```bash
95
+ mediaruntime run ./clip.mp4 \
96
+ --preset image_animated_webp_v1 \
97
+ --animation-width 720 \
98
+ --animation-fps 15 \
99
+ --animation-duration 6 \
100
+ --animation-loop 0 \
101
+ --animation-quality 80 \
102
+ --wait --download ./animated-webp.zip
103
+ ```
104
+
105
+ Generate BlurHash, ThumbHash, and a byte-bounded WebP LQIP from an image or video frame
106
+ with the Standard `image_placeholders_v1` preset:
107
+
108
+ ```bash
109
+ mediaruntime run ./product-photo.png \
110
+ --preset image_placeholders_v1 \
111
+ --placeholder-max-dimension 32 \
112
+ --placeholder-time 0 \
113
+ --lqip-quality 50 \
114
+ --lqip-max-bytes 4096 \
115
+ --wait --download ./placeholders.zip
116
+ ```
117
+
118
+ The ZIP contains `placeholders.json` and `lqip.webp`. If the encoded image exceeds
119
+ `--lqip-max-bytes`, the job fails instead of returning an artifact over the requested
120
+ ceiling. The JSON includes source and placeholder dimensions, source format, the
121
+ requested timestamp, and an alpha-aware dominant colour. `--placeholder-time` defaults
122
+ to the first frame at `0`; it does not request automatic representative-frame selection.
123
+
124
+ Generate bounded composite review sheets from a video with one flat Standard processing
125
+ unit per produced sheet:
126
+
127
+ ```bash
128
+ mediaruntime run ./interview.mp4 \
129
+ --preset contact_sheet_v1 \
130
+ --contact-columns 5 \
131
+ --contact-rows 4 \
132
+ --contact-tile-width 240 \
133
+ --contact-tile-height 135 \
134
+ --contact-interval 12 \
135
+ --contact-max-sheets 3 \
136
+ --contact-format jpg \
137
+ --contact-quality 80 \
138
+ --wait --download ./contact-sheets.zip
139
+ ```
140
+
141
+ The ZIP contains numbered composite images and `contact_sheet.json`, which maps every
142
+ tile to its exact source timestamp. `--contact-duration 0` means the remaining video.
143
+ `--contact-quality` applies to JPG and WebP; PNG is lossless.
144
+
145
+ Guarantee that a JPG or WebP rendition stays within a hard byte ceiling:
146
+
147
+ ```bash
148
+ mediaruntime run ./photo.png \
149
+ --preset image_multi_v1 \
150
+ --image-width 1280 --image-height 720 --image-mode cover \
151
+ --image-format webp --image-quality 86 \
152
+ --image-max-bytes 200000 --image-min-quality 35 \
153
+ --wait --download ./bounded-image.zip
154
+ ```
155
+
156
+ MediaRuntime performs a bounded quality search and verifies the final file. If the
157
+ constraint cannot be met, the job fails instead of returning an oversized image. The ZIP
158
+ includes `image_size_limits.json`; PNG and AVIF do not accept `--image-max-bytes` yet.
159
+
160
+ ## Privacy redaction
161
+
162
+ Privacy redaction is an explicit Premium Preview for still-image inputs and image outputs.
163
+ The CLI rejects obvious video or animated-image sources locally, expands the selected
164
+ preset through the live capability catalog, and confirms the output is an image before
165
+ uploading local media:
166
+
167
+ ```bash
168
+ mediaruntime run ./team-photo.jpg \
169
+ --preset image_multi_v1 \
170
+ --privacy-detector face \
171
+ --privacy-detector license_plate \
172
+ --privacy-detector text \
173
+ --privacy-style blur \
174
+ --privacy-failure-mode fail_closed \
175
+ --wait --download ./redacted.zip
176
+ ```
177
+
178
+ Detector flags are repeatable. Optional bounds include `--privacy-min-confidence`,
179
+ `--privacy-sample-interval`, `--privacy-max-frames`, and `--privacy-padding`; solid masks
180
+ also accept `--privacy-solid-color`, while pixelation accepts
181
+ `--privacy-pixel-block-size` and `--privacy-strength`. Per-sample observations are
182
+ available only with `--privacy-debug-observations`. The ZIP contains the redacted image and
183
+ `privacy_redaction.json` schema v3. Public metadata reports stable detector categories,
184
+ counts, verification outcomes, and ZIP-relative `report_bundle_path` and
185
+ `output_bundle_paths`; it excludes detector vendors, model identities, private model or
186
+ worker paths, bucket names, and raw OCR text. Automated detection can miss sensitive
187
+ regions, so `coverage_verified` remains false and review is required before regulated use.
188
+ In `fail_closed` mode detector failure, unresolved ambiguity, truncation,
189
+ or a verified residual prevents image delivery. Recognizable residuals under blur or
190
+ pixelation may be escalated to bounded opaque masks and verified again. Detector recall
191
+ remains non-exhaustive.
192
+ `--privacy-max-frames` applies independently to each 60-second segment. The defaults are a
193
+ 0.2-second interval and 1,800 frames per segment.
194
+
90
195
  ## Hosted recipes
91
196
 
92
197
  Hosted recipes are immutable account-scoped versions of a complete outputs, moderation,
@@ -118,6 +223,142 @@ Use `--json` for one compact, URL-redacted machine-readable result. A caller-pro
118
223
  `--idempotency-key` remains the durable deduplication mechanism across process restarts;
119
224
  the SDK-generated invocation key only protects retries inside one live command.
120
225
 
226
+ ## Check video compatibility
227
+
228
+ The CLI reads the live capability catalog, so it can run the versioned compatibility
229
+ preset without hard-coding its profile rules:
230
+
231
+ ```bash
232
+ mediaruntime run ./launch.webm \
233
+ --preset compatibility_report_v1 \
234
+ --download ./launch-compatibility.zip
235
+ ```
236
+
237
+ The ZIP contains `compatibility_report.json` with five conservative web, mobile,
238
+ social-upload, and editing profiles, rule-level evidence, and existing corrective preset
239
+ recommendations. It is actionable guidance, not exhaustive certification of every device.
240
+
241
+ ## Scan QR codes and barcodes
242
+
243
+ Use the live `code_detect_v1` preset with an image, video, animated image, or an
244
+ audio file that contains embedded cover artwork:
245
+
246
+ ```sh
247
+ mediaruntime run ./product-label.png \
248
+ --preset code_detect_v1 \
249
+ --wait --download ./detected-codes.zip
250
+ ```
251
+
252
+ The ZIP contains `codes.json` plus evidence PNGs only for frames with unique
253
+ detections. Video is sampled at the opening frame and every 10 seconds, up to 12
254
+ frames and 16 unique codes per frame. Plain audio without cover artwork is rejected. Decoded values are untrusted:
255
+ render them as text and never automatically open a detected URL.
256
+
257
+ ## Generate an audiogram
258
+
259
+ Compose an audio track, supplied artwork, a generated waveform, and optional supplied
260
+ captions with the Premium `audiogram_v1` preset. The main audio, artwork, and captions
261
+ may each be local files; the CLI uploads local assets through the authenticated account's
262
+ signed-upload flow before creating the job:
263
+
264
+ ```bash
265
+ mediaruntime run ./episode.mp3 \
266
+ --preset audiogram_v1 \
267
+ --audiogram-artwork ./cover.png \
268
+ --audiogram-captions ./episode.vtt \
269
+ --audiogram-layout square \
270
+ --audiogram-fit blurred_background \
271
+ --audiogram-background '#101827' \
272
+ --audiogram-waveform '#5B5CFF' \
273
+ --audiogram-waveform-gain 2 \
274
+ --audiogram-caption-position bottom \
275
+ --audiogram-caption-scale 1 \
276
+ --audiogram-normalize --audiogram-loudness-target -16 \
277
+ --audiogram-duration 60 \
278
+ --audiogram-fps 30 \
279
+ --wait --download ./audiogram.zip
280
+ ```
281
+
282
+ Artwork must be PNG, JPEG, or WebP up to 10 MB. Captions must be UTF-8 SRT or VTT up
283
+ to 2 MB; supplying captions burns them into the video. The ZIP contains
284
+ `audiogram.mp4`, a caption-free `poster.jpg`, `audiogram.json`, and
285
+ `audiogram.waveform.json`. Artwork fitting, waveform gain, caption placement, and
286
+ optional loudness normalization are bounded named controls. Account watermarking
287
+ and speech-generated subtitles cannot be combined with this preset in v1.
288
+
289
+ Captions use their own top or bottom strip inside the reserved band and cannot cover caller
290
+ artwork. Multi-line cues scale down adaptively. The caption-free poster is sampled after
291
+ waveform activity begins, and successful normalization reports measured loudness values.
292
+
293
+ ## Hosted Sticker Runtime
294
+
295
+ Sticker collections are free application configuration over packs your workspace already
296
+ activated. Create a collection, then enable an existing paid Hosted Pack by its stable pack
297
+ ID or activation ID:
298
+
299
+ ```bash
300
+ mediaruntime stickers collections create \
301
+ --name "Support chat" \
302
+ --description "Customer-facing reactions"
303
+
304
+ mediaruntime stickers collections list
305
+ mediaruntime stickers collections get stc_0123456789abcdef0123456789abcdef
306
+ mediaruntime stickers collections update stc_0123456789abcdef0123456789abcdef \
307
+ --name "Support and community"
308
+
309
+ mediaruntime stickers collections packs enable stc_0123456789abcdef0123456789abcdef \
310
+ --pack white-sage-just-me
311
+ mediaruntime stickers collections packs list stc_0123456789abcdef0123456789abcdef
312
+ mediaruntime stickers collections packs disable stc_0123456789abcdef0123456789abcdef \
313
+ --pack white-sage-just-me
314
+ ```
315
+
316
+ Disabling a pack prevents new discovery but preserves exact historical rendering under the
317
+ binding's `historicalAccess` policy. `collections archive` is also recoverable; restore with
318
+ `collections update <id> --status active`. These commands do not buy, activate, revoke, or
319
+ charge for a pack. Use the authenticated MediaRuntime account surface for paid activation.
320
+
321
+ Search and resolve assets inside one explicitly selected collection:
322
+
323
+ ```bash
324
+ mediaruntime stickers packs list --collection stc_0123456789abcdef0123456789abcdef
325
+ mediaruntime stickers search "wave" \
326
+ --collection stc_0123456789abcdef0123456789abcdef \
327
+ --category greeting --animated --limit 10
328
+ mediaruntime stickers typeahead "wa" \
329
+ --collection stc_0123456789abcdef0123456789abcdef --locale en
330
+ mediaruntime stickers get white-sage-just-me-wave \
331
+ --collection stc_0123456789abcdef0123456789abcdef
332
+ mediaruntime stickers resolve white-sage-just-me-wave \
333
+ --variant small_160 \
334
+ --collection stc_0123456789abcdef0123456789abcdef
335
+ ```
336
+
337
+ All sticker commands use `MEDIARUNTIME_API_KEY` or the secure browser login by default.
338
+ Untrusted application testing may instead set a short-lived token for only the five runtime
339
+ read commands above:
340
+
341
+ ```bash
342
+ mediaruntime stickers token create \
343
+ --collection stc_0123456789abcdef0123456789abcdef \
344
+ --expires-in 900 \
345
+ --scope packs:read \
346
+ --scope stickers:search \
347
+ --scope stickers:read \
348
+ --scope assets:resolve
349
+
350
+ export MEDIARUNTIME_STICKER_CLIENT_TOKEN="mrt_v1_..."
351
+ mediaruntime stickers search "wave" \
352
+ --collection stc_0123456789abcdef0123456789abcdef
353
+ ```
354
+
355
+ The scoped token never authorizes collection management, pack binding, workspace usage, or
356
+ token minting; those always require the trusted API key. The CLI accepts the scoped secret
357
+ only through `MEDIARUNTIME_STICKER_CLIENT_TOKEN`, not a command-line flag. The collection
358
+ argument must still match the token claim. Inspect pooled monthly usage with
359
+ `mediaruntime stickers usage`. See [the Sticker Runtime command contract](docs/STICKERS.md)
360
+ for complete flags, JSON behavior, and security boundaries.
361
+
121
362
  ## Inspect jobs
122
363
 
123
364
  ```bash
package/dist/cli.d.ts CHANGED
@@ -39,6 +39,110 @@ interface RecipesClient {
39
39
  archive(name: string): Promise<void>;
40
40
  }
41
41
 
42
+ interface StickerCollectionRecord {
43
+ collectionId: string;
44
+ name: string;
45
+ description: string;
46
+ status: "active" | "archived";
47
+ packs: StickerPackBinding[];
48
+ createdAt: string;
49
+ archivedAt: string | null;
50
+ updatedAt: string;
51
+ }
52
+ interface StickerPackBinding {
53
+ bindingId: string;
54
+ collectionId: string;
55
+ activationId: string;
56
+ packId: string;
57
+ packName: string;
58
+ packVersion: string;
59
+ status: "enabled" | "disabled";
60
+ historicalAccess: "preserve" | "revoke";
61
+ updatedAt: string | null;
62
+ }
63
+ interface RuntimeStickerRecord {
64
+ stickerId: string;
65
+ packId: string;
66
+ label: string;
67
+ emoji: string | null;
68
+ category: string | null;
69
+ animated: boolean;
70
+ variants: Array<{
71
+ name: string;
72
+ bytes: number;
73
+ }>;
74
+ score?: number;
75
+ }
76
+ interface RuntimeStickerPackRecord {
77
+ packId: string;
78
+ name: string;
79
+ version: string;
80
+ assetCount: number;
81
+ animated: boolean;
82
+ }
83
+ interface StickerRuntimeReadClient {
84
+ listPacks(): Promise<RuntimeStickerPackRecord[]>;
85
+ search(query: string, options?: {
86
+ packId?: string;
87
+ category?: string;
88
+ animated?: boolean;
89
+ limit?: number;
90
+ }): Promise<{
91
+ query: string;
92
+ items: RuntimeStickerRecord[];
93
+ total: number;
94
+ }>;
95
+ typeahead(query: string, options?: {
96
+ packId?: string;
97
+ locale?: string;
98
+ limit?: number;
99
+ }): Promise<{
100
+ query: string;
101
+ locale: string;
102
+ suggestions: Array<{
103
+ text: string;
104
+ assetCount: number;
105
+ }>;
106
+ }>;
107
+ retrieve(stickerId: string): Promise<RuntimeStickerRecord>;
108
+ resolve(stickerId: string, variant: string): Promise<Record<string, unknown>>;
109
+ }
110
+ interface HostedStickersCommandClient {
111
+ listCollections(options?: {
112
+ includeArchived?: boolean;
113
+ }): Promise<{
114
+ items: StickerCollectionRecord[];
115
+ total: number;
116
+ }>;
117
+ createCollection(params: {
118
+ name: string;
119
+ description?: string | null;
120
+ }): Promise<StickerCollectionRecord>;
121
+ getCollection(collectionId: string): Promise<StickerCollectionRecord>;
122
+ updateCollection(collectionId: string, params: {
123
+ name?: string;
124
+ description?: string | null;
125
+ status?: "active" | "archived";
126
+ }): Promise<StickerCollectionRecord>;
127
+ archiveCollection(collectionId: string): Promise<StickerCollectionRecord>;
128
+ listCollectionPacks(collectionId: string): Promise<{
129
+ items: StickerPackBinding[];
130
+ total: number;
131
+ }>;
132
+ addCollectionPack(collectionId: string, params: {
133
+ activationId: string;
134
+ }): Promise<StickerPackBinding>;
135
+ enableCollectionPack(collectionId: string, packId: string): Promise<StickerPackBinding>;
136
+ disableCollectionPack(collectionId: string, packId: string): Promise<StickerPackBinding>;
137
+ collection(collectionId: string): StickerRuntimeReadClient;
138
+ usage(): Promise<Record<string, unknown>>;
139
+ createClientToken(params: {
140
+ collectionId: string;
141
+ expiresInSeconds?: number;
142
+ scopes?: string[];
143
+ }): Promise<Record<string, unknown>>;
144
+ }
145
+
42
146
  declare const SUPPORTED_TRIGGER_EVENTS: readonly ["job.completed", "job.failed", "job.rejected"];
43
147
  type TriggerEventType = (typeof SUPPORTED_TRIGGER_EVENTS)[number];
44
148
  interface SyntheticEventOptions {
@@ -102,13 +206,22 @@ type CliJobsClient = RunJobsClient & JobsReadClient;
102
206
  interface CliClient {
103
207
  jobs: CliJobsClient;
104
208
  capabilities: CapabilitiesReadClient;
209
+ uploads?: {
210
+ resolveSource(source: string): Promise<string>;
211
+ };
105
212
  recipes?: RecipesClient;
213
+ stickers?: HostedStickersCommandClient;
106
214
  }
107
215
  interface CliDependencies {
108
216
  createClient?(options: {
109
217
  baseUrl?: string;
110
218
  apiKey?: string;
111
219
  }): CliClient;
220
+ createStickerRuntime?(options: {
221
+ accessToken: string;
222
+ collectionId: string;
223
+ baseUrl?: string;
224
+ }): StickerRuntimeReadClient;
112
225
  downloadBundle?(url: string, destination: string, options: {
113
226
  force: boolean;
114
227
  expectedSizeBytes?: number | null;