@camstack/addon-pipeline 1.2.273 → 1.2.275
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/dist/audio-analyzer/index.js +2 -2
- package/dist/audio-analyzer/index.mjs +2 -2
- package/dist/{default-detection-model-9Solpn0K.js → default-detection-model-6lCvep7n.js} +1 -1
- package/dist/{default-detection-model-DCFaNnYd.mjs → default-detection-model-dQSwHHfx.mjs} +1 -1
- package/dist/detection-pipeline/index.js +4 -4
- package/dist/detection-pipeline/index.mjs +4 -4
- package/dist/{dist-BRT-qKlE.mjs → dist-C1pCVJk7.mjs} +621 -117
- package/dist/{dist-DRDzfOnl.js → dist-NYjn7hkE.js} +674 -116
- package/dist/motion-wasm/index.js +1 -1
- package/dist/motion-wasm/index.mjs +1 -1
- package/dist/{node-Dwu66ZR4.mjs → node--UY0iepi.mjs} +1 -1
- package/dist/{node-BmTPPuIg.js → node-CVYY8a4y.js} +1 -1
- package/dist/pipeline-runner/index.js +3 -3
- package/dist/pipeline-runner/index.mjs +3 -3
- package/dist/{process-memory-Cx4oDFz9.mjs → process-memory-BQOfL3Ig.mjs} +1 -1
- package/dist/{process-memory-BTwHfysZ.js → process-memory-DDvuSEMJ.js} +1 -1
- package/dist/recorder/index.js +1063 -35
- package/dist/recorder/index.mjs +1063 -35
- package/dist/{segment-demux-js-BKvYCad_.mjs → segment-demux-js-B0_aAzN0.mjs} +1 -1
- package/dist/{segment-demux-js--ePyI476.js → segment-demux-js-DVupBBc4.js} +1 -1
- package/dist/stream-broker/_stub.js +2 -2
- package/dist/stream-broker/{_virtual_mf-localSharedImportMap___mfe_internal__addon_stream_broker_widgets-shbmpL8E.mjs → _virtual_mf-localSharedImportMap___mfe_internal__addon_stream_broker_widgets-BrNGbvkl.mjs} +2 -2
- package/dist/stream-broker/_virtual_mf___mfe_internal__addon_stream_broker_widgets__loadShare___mf_0_camstack_mf_1_types__loadShare__.js-BV2tQ1w3.mjs +26 -0
- package/dist/stream-broker/{_virtual_mf___mfe_internal__addon_stream_broker_widgets__loadShare___mf_0_camstack_mf_1_ui_mf_2_library__loadShare__.js-C8RTK6nJ.mjs → _virtual_mf___mfe_internal__addon_stream_broker_widgets__loadShare___mf_0_camstack_mf_1_ui_mf_2_library__loadShare__.js-BnLVuoDg.mjs} +1 -1
- package/dist/stream-broker/demux-worker-child.js +1 -1
- package/dist/stream-broker/demux-worker-child.mjs +1 -1
- package/dist/stream-broker/{hostInit-CtVYKCNe.mjs → hostInit-CSJt3rp0.mjs} +2 -2
- package/dist/stream-broker/index.js +526 -69
- package/dist/stream-broker/index.mjs +526 -69
- package/dist/stream-broker/remoteEntry.js +1 -1
- package/package.json +5 -1
- package/dist/stream-broker/_virtual_mf___mfe_internal__addon_stream_broker_widgets__loadShare___mf_0_camstack_mf_1_types__loadShare__.js-C_SEu7AC.mjs +0 -26
|
@@ -5360,7 +5360,7 @@ var ZodIssueCode = {
|
|
|
5360
5360
|
var ZodFirstPartyTypeKind;
|
|
5361
5361
|
ZodFirstPartyTypeKind || (ZodFirstPartyTypeKind = {});
|
|
5362
5362
|
//#endregion
|
|
5363
|
-
//#region ../types/dist/sleep-
|
|
5363
|
+
//#region ../types/dist/sleep-BVhJDJka.mjs
|
|
5364
5364
|
/**
|
|
5365
5365
|
* The audio chunk plane's byte format, and the ONE expansion from a coded
|
|
5366
5366
|
* window to float samples (D455).
|
|
@@ -5592,12 +5592,6 @@ Object.fromEntries([
|
|
|
5592
5592
|
icon: "circle-dot",
|
|
5593
5593
|
order: 40
|
|
5594
5594
|
},
|
|
5595
|
-
{
|
|
5596
|
-
id: "clips",
|
|
5597
|
-
label: "Clips",
|
|
5598
|
-
icon: "clapperboard",
|
|
5599
|
-
order: 41
|
|
5600
|
-
},
|
|
5601
5595
|
{
|
|
5602
5596
|
id: "engine",
|
|
5603
5597
|
label: "Inference Engine",
|
|
@@ -7108,6 +7102,18 @@ function systemMethod(input, output, options) {
|
|
|
7108
7102
|
systemOnly: true
|
|
7109
7103
|
};
|
|
7110
7104
|
}
|
|
7105
|
+
/**
|
|
7106
|
+
* A method a SOURCE of a collection cap may legitimately not serve — OPTIONAL
|
|
7107
|
+
* on `InferProvider`. The `providerOptional: true` literal is what
|
|
7108
|
+
* `InferProvider` keys on; see {@link CapabilityMethodSchema.providerOptional}
|
|
7109
|
+
* for when this is the honest answer and when it is a soft stub.
|
|
7110
|
+
*/
|
|
7111
|
+
function optionalMethod(input, output, options) {
|
|
7112
|
+
return {
|
|
7113
|
+
...method(input, output, options),
|
|
7114
|
+
providerOptional: true
|
|
7115
|
+
};
|
|
7116
|
+
}
|
|
7111
7117
|
/** Shorthand to define an event schema */
|
|
7112
7118
|
function event(data) {
|
|
7113
7119
|
return { data };
|
|
@@ -8347,6 +8353,8 @@ var EVENT_OWNER_TYPES = [
|
|
|
8347
8353
|
* nothing failing until a caller asked.
|
|
8348
8354
|
*/
|
|
8349
8355
|
var EventOwnerTypeSchema = _enum(EVENT_OWNER_TYPES);
|
|
8356
|
+
/** The same list as a Zod enum, for the cap input that carries it. */
|
|
8357
|
+
var MediaPresenceOwnerKindSchema = _enum([...EVENT_OWNER_TYPES, "track"]);
|
|
8350
8358
|
new Set(EVENT_OWNER_TYPES);
|
|
8351
8359
|
var EncodeProfileSchema = object({
|
|
8352
8360
|
video: object({
|
|
@@ -9327,6 +9335,24 @@ var DetectionCatalogClassMapSchema = object({
|
|
|
9327
9335
|
preserveOriginal: boolean()
|
|
9328
9336
|
});
|
|
9329
9337
|
/**
|
|
9338
|
+
* THE canonical event-clip pad: the time window a single-timestamp analytics
|
|
9339
|
+
* event expands to when joined with footage (clip window = `[timestamp - preMs,
|
|
9340
|
+
* timestamp + postMs]`). Matches the admin-ui clip window (−5s/+10s).
|
|
9341
|
+
*
|
|
9342
|
+
* Every consumer derives from this ONE constant so event↔footage boundaries
|
|
9343
|
+
* agree everywhere (C1): today that is the `videoclips` default provider
|
|
9344
|
+
* (addon-post-analysis), which pads its clip windows with it. The recorder used
|
|
9345
|
+
* to pad in-RAM playback markers with it too; those markers had no reader
|
|
9346
|
+
* anywhere in the repo and were deleted on 2026-08-29.
|
|
9347
|
+
*
|
|
9348
|
+
* NOTE: this is a UI/JOIN convention, NOT the `events`-band keep/discard gate —
|
|
9349
|
+
* that uses the per-device `preBufferSec`/`postBufferSec` config.
|
|
9350
|
+
*/
|
|
9351
|
+
var EVENT_PAD_MS = {
|
|
9352
|
+
preMs: 5e3,
|
|
9353
|
+
postMs: 1e4
|
|
9354
|
+
};
|
|
9355
|
+
/**
|
|
9330
9356
|
* Numeric day-of-week: 0 = Sunday … 6 = Saturday (matches `Date.getDay`).
|
|
9331
9357
|
* Named `RecordingWeekday` to avoid collision with the string-union
|
|
9332
9358
|
* `Weekday` exported from `interfaces/timezones.ts`.
|
|
@@ -9543,7 +9569,20 @@ function stripRetiredBandPreBufferSec(config) {
|
|
|
9543
9569
|
strippedBands
|
|
9544
9570
|
};
|
|
9545
9571
|
}
|
|
9546
|
-
|
|
9572
|
+
/**
|
|
9573
|
+
* Adjacent recorded ranges closer than this belong to the SAME videoclip visit.
|
|
9574
|
+
*
|
|
9575
|
+
* This is NOT the recorder calendar merge (`RANGE_MERGE_GAP_MS = 5s`). That
|
|
9576
|
+
* threshold is for the timeline bar, which must show exact holes — including
|
|
9577
|
+
* the ~8s GOP/keyframe rolls measured on events-mode cameras (dispensa 1438,
|
|
9578
|
+
* 2026-08-16). A videoclip is the events-mode keep-window (writer session),
|
|
9579
|
+
* whose idle bound is `postBufferSec`. Using that default (30s) glues those
|
|
9580
|
+
* intra-visit holes without joining visits hours apart.
|
|
9581
|
+
*
|
|
9582
|
+
* Segments stay the source of truth on disk (`startMs-durMs-bytes.m4s`); a
|
|
9583
|
+
* visit is derived, not a second copy of the files.
|
|
9584
|
+
*/
|
|
9585
|
+
var VISIT_MERGE_GAP_MS = DEFAULT_EVENTS_BAND_BUFFER_SEC.postBufferSec * 1e3;
|
|
9547
9586
|
/**
|
|
9548
9587
|
* Per-device retention overrides. Every field is optional; an unset or `0`
|
|
9549
9588
|
* value inherits the node-wide recorder default. Only footage-lifetime limits
|
|
@@ -16442,8 +16481,6 @@ method(object({
|
|
|
16442
16481
|
deviceId: number(),
|
|
16443
16482
|
capName: string(),
|
|
16444
16483
|
wrapperAddonId: string(),
|
|
16445
|
-
/** The `ClipSource.source` id to toggle. Absent = all of the addon's. */
|
|
16446
|
-
sourceId: string().optional(),
|
|
16447
16484
|
active: boolean()
|
|
16448
16485
|
}), _void(), {
|
|
16449
16486
|
kind: "mutation",
|
|
@@ -23935,7 +23972,11 @@ DeviceType.Camera, method(object({ deviceId: number() }), array(TrackSchema).rea
|
|
|
23935
23972
|
ownerType: EventOwnerTypeSchema,
|
|
23936
23973
|
eventId: number().int(),
|
|
23937
23974
|
deviceId: number()
|
|
23938
|
-
}), array(MediaFileInfoSchema).readonly()), method(
|
|
23975
|
+
}), array(MediaFileInfoSchema).readonly()), method(object({
|
|
23976
|
+
deviceId: number(),
|
|
23977
|
+
ownerKind: MediaPresenceOwnerKindSchema,
|
|
23978
|
+
ownerIds: array(string()).max(5e3)
|
|
23979
|
+
}), array(string()).readonly()), method(SearchObjectEventsInput, array(ScoredObjectEventSchema).readonly()), method(object({}), WipeObjectEmbeddingsResultSchema, {
|
|
23939
23980
|
kind: "mutation",
|
|
23940
23981
|
auth: "admin"
|
|
23941
23982
|
}), method(RebuildObjectEmbeddingsInput, RebuildObjectEmbeddingsResultSchema, {
|
|
@@ -27163,6 +27204,18 @@ method(VectorDeclareIndexInputSchema, _void(), {
|
|
|
27163
27204
|
kind: "mutation",
|
|
27164
27205
|
auth: "admin"
|
|
27165
27206
|
}), method(VectorStatsInputSchema, VectorStatsResultSchema, { auth: "admin" });
|
|
27207
|
+
_enum([
|
|
27208
|
+
"queue-full",
|
|
27209
|
+
"camera-backoff",
|
|
27210
|
+
"sleeping",
|
|
27211
|
+
"camera-refused",
|
|
27212
|
+
"no-keyframe",
|
|
27213
|
+
"no-catalog-row",
|
|
27214
|
+
"unsupported",
|
|
27215
|
+
"unknown-device",
|
|
27216
|
+
"uid-missing"
|
|
27217
|
+
]);
|
|
27218
|
+
_enum(["deferred", "final"]);
|
|
27166
27219
|
var ClipSchema = object({
|
|
27167
27220
|
/** Opaque, provider-namespaced id. The default provider encodes the time
|
|
27168
27221
|
* window so `getClipPlayback` is self-contained (no event re-query). */
|
|
@@ -27313,7 +27366,25 @@ var ClipSchema = object({
|
|
|
27313
27366
|
*/
|
|
27314
27367
|
playable: boolean().optional(),
|
|
27315
27368
|
/** Why {@link playable} is false, verbatim (`no-file-for-window`). */
|
|
27316
|
-
unplayableReason: string().optional()
|
|
27369
|
+
unplayableReason: string().optional(),
|
|
27370
|
+
/**
|
|
27371
|
+
* This clip is STILL BEING WRITTEN, so {@link ClipSchema.timeRange}`.endMs`
|
|
27372
|
+
* is not its end.
|
|
27373
|
+
*
|
|
27374
|
+
* Absent — the common case — means the row is closed and its `endMs` is the
|
|
27375
|
+
* end of the recording. Present and `true` means the source told us the file
|
|
27376
|
+
* has no end yet, and the `endMs` we carry is whatever the camera's index
|
|
27377
|
+
* entry happened to hold: on a Reolink E1 Outdoor PoE (592, measured
|
|
27378
|
+
* 2026-09-20) the newest file `…_192927_000000_…_0.mp4` reported an `endTime`
|
|
27379
|
+
* of 19:29:56 and STILL reported it eight minutes later, while the file went
|
|
27380
|
+
* on growing. A surface that drew 29 s there was lying about a clip that
|
|
27381
|
+
* plays for minutes, on the one row the operator looks at first.
|
|
27382
|
+
*
|
|
27383
|
+
* `endMs` is deliberately still a number: it is the best bound anything has
|
|
27384
|
+
* for a mint window or a byte fetch, and every consumer already requires it.
|
|
27385
|
+
* This flag says what it is WORTH, and a duration is not drawn from it.
|
|
27386
|
+
*/
|
|
27387
|
+
inProgress: boolean().optional()
|
|
27317
27388
|
});
|
|
27318
27389
|
var ClipPlaybackSchema = object({
|
|
27319
27390
|
/**
|
|
@@ -27359,6 +27430,59 @@ var ClipPlaybackSchema = object({
|
|
|
27359
27430
|
* which days it asked for and got nothing — "no clips" would be a lie about a
|
|
27360
27431
|
* card that is full of them.
|
|
27361
27432
|
*/
|
|
27433
|
+
/**
|
|
27434
|
+
* The operator's authorisation to WAKE a sleeping camera for one clip read.
|
|
27435
|
+
*
|
|
27436
|
+
* ONE value, absent by default, and it is a `force`-shaped operator signal in
|
|
27437
|
+
* exactly the sense `snapshot-wake-gate.ts` uses the word: *"`snapshot.getSnapshot`'s
|
|
27438
|
+
* `force` flag, and nothing else… a background caller must never set it…
|
|
27439
|
+
* Stale but honest beats woken"*. A scheduler, a retry, a reconcile and a
|
|
27440
|
+
* prefetch never set it; a surface sets it only behind the same confirm the
|
|
27441
|
+
* "Wake and refresh" gesture uses, and it is refused below 15 % battery
|
|
27442
|
+
* exactly as that gesture is.
|
|
27443
|
+
*
|
|
27444
|
+
* The gate is decided BEFORE `getApi()`, because on UDP the login IS the wake
|
|
27445
|
+
* (D549) — a read that opened a session and then checked would have woken the
|
|
27446
|
+
* camera to find out it was not allowed to.
|
|
27447
|
+
*
|
|
27448
|
+
* **One authorised yes is one wake.** `next-natural` — take the clip the next
|
|
27449
|
+
* time the camera is awake for its own reasons — is deliberately not a member:
|
|
27450
|
+
* it was proposed, it is free on the battery, and the operator declined it on
|
|
27451
|
+
* 2026-09-20 (*"Quando un export viene richiesto si sveglia la camera."*,
|
|
27452
|
+
* D558 "Considered and not taken").
|
|
27453
|
+
*/
|
|
27454
|
+
var ClipWakeSchema = _enum(["authorised"]);
|
|
27455
|
+
/**
|
|
27456
|
+
* A clip's finished bytes, inline — the twin of `recordingExport.readExportBytes`.
|
|
27457
|
+
*
|
|
27458
|
+
* `bytes` is the DECODED length, so nobody infers it from the base64 length,
|
|
27459
|
+
* and `served` says which twin the caller actually got.
|
|
27460
|
+
*/
|
|
27461
|
+
var ClipBytesSchema = object({
|
|
27462
|
+
base64: string(),
|
|
27463
|
+
contentType: string(),
|
|
27464
|
+
/** Suggested filename, extension included. */
|
|
27465
|
+
name: string(),
|
|
27466
|
+
bytes: number().int().nonnegative(),
|
|
27467
|
+
/**
|
|
27468
|
+
* Which twin was actually served — the same contract
|
|
27469
|
+
* {@link ClipPlaybackSchema.served} carries, and REQUIRED here because the
|
|
27470
|
+
* export record persists it: a row read a week later must say the same thing
|
|
27471
|
+
* the panel said at the moment of the tap. A missing main twin is never
|
|
27472
|
+
* served silently as if it were the asked-for quality (D549 15).
|
|
27473
|
+
*/
|
|
27474
|
+
served: CamProfileSchema,
|
|
27475
|
+
/**
|
|
27476
|
+
* The DECODED duration of the delivered file, when the fetch measured one.
|
|
27477
|
+
*
|
|
27478
|
+
* A clip fetch verifies its own completion against the catalog row and
|
|
27479
|
+
* retries a materially short pass (D568); this is that measurement, carried
|
|
27480
|
+
* so a consumer can say the same thing rather than re-deriving it. Absent
|
|
27481
|
+
* when the producer did not measure — never zero, which would say the file
|
|
27482
|
+
* is empty.
|
|
27483
|
+
*/
|
|
27484
|
+
durationMs: number().positive().optional()
|
|
27485
|
+
});
|
|
27362
27486
|
var ClipSourceAvailabilitySchema = object({
|
|
27363
27487
|
state: _enum([
|
|
27364
27488
|
"ok",
|
|
@@ -27396,99 +27520,205 @@ var ClipSourceSchema = object({
|
|
|
27396
27520
|
* alternative — a `native:reolink:* → provider-reolink` table inside the
|
|
27397
27521
|
* widget — is a second authority on provider identity living in the one
|
|
27398
27522
|
* package with no business knowing it, wrong the day a third source appears
|
|
27399
|
-
* (D557). One addon may serve SEVERAL sources
|
|
27400
|
-
*
|
|
27401
|
-
*
|
|
27402
|
-
*
|
|
27523
|
+
* (D557). One addon may serve SEVERAL sources, which is why the per-device
|
|
27524
|
+
* switch is keyed by SOURCE and not by this (D555) — `addon-provider-reolink`
|
|
27525
|
+
* served a hub child two of them until the two views were measured to be one
|
|
27526
|
+
* store read twice (D555) and then read ONE way (D565).
|
|
27403
27527
|
*
|
|
27404
27528
|
* Optional for version skew only. The collection dispatcher stamps it from
|
|
27405
27529
|
* the registry, so a row that travelled through the fan-out carries the
|
|
27406
27530
|
* authoritative id whatever the provider filled in.
|
|
27407
27531
|
*/
|
|
27408
27532
|
addonId: string().optional(),
|
|
27409
|
-
|
|
27410
|
-
* Which API this source resolved to FOR THIS CAMERA, when it has a choice.
|
|
27411
|
-
*
|
|
27412
|
-
* A source may cover one store through more than one surface — the Reolink
|
|
27413
|
-
* provider reads a hub child through the parent's event log and a standalone
|
|
27414
|
-
* through its own file list, because that is what each camera answers. The
|
|
27415
|
-
* CHOICE is the provider's, made from what the camera is, and is never a row
|
|
27416
|
-
* the operator has to understand; but it is REPORTED, because a source that
|
|
27417
|
-
* silently reads a different API on two cameras and then behaves differently
|
|
27418
|
-
* is the thing nobody can debug later. Absent when the source has only one
|
|
27419
|
-
* way to read its store.
|
|
27420
|
-
*/
|
|
27421
|
-
via: string().optional(),
|
|
27422
|
-
availability: ClipSourceAvailabilitySchema,
|
|
27423
|
-
/**
|
|
27424
|
-
* The operator switched this source OFF for this camera.
|
|
27425
|
-
*
|
|
27426
|
-
* Deliberately NOT a member of {@link ClipSourceAvailabilitySchema}'s
|
|
27427
|
-
* vocabulary. That enum models what the source CAN do — a sleeping camera, an
|
|
27428
|
-
* unmounted card, an index that disagrees with its own calendar — and a
|
|
27429
|
-
* switched-off source could answer perfectly well; the operator decided it
|
|
27430
|
-
* should not. Folding the choice in is how `disabled` and `broken` stop being
|
|
27431
|
-
* distinguishable, which is the D62 rule this repo has already paid for twice:
|
|
27432
|
-
* an off switch is REPORTED off (`CameraStatus.switchedOff`, the same word),
|
|
27433
|
-
* and disabled must never look like broken. It is also what lets every
|
|
27434
|
-
* exhaustive consumer of the availability enum keep compiling.
|
|
27435
|
-
*
|
|
27436
|
-
* A switched-off source contributes NO clips (`listClips` never calls it) and
|
|
27437
|
-
* its row carries no `catalogAsOf`: nothing confirms a catalog it is not
|
|
27438
|
-
* allowed to serve, and a frozen age that can only grow draws a stalling
|
|
27439
|
-
* source rather than an off switch.
|
|
27440
|
-
*
|
|
27441
|
-
* The row survives BECAUSE it is the control the operator switches the source
|
|
27442
|
-
* back on from — D554 decision 4's rule ("a source that cannot answer
|
|
27443
|
-
* produces a ROW, not an absence") applied to the one case D556 carved out of
|
|
27444
|
-
* it, and D557's own kept property ("a source is never hidden, only its
|
|
27445
|
-
* rows"). Absent means on.
|
|
27446
|
-
*
|
|
27447
|
-
* A provider never sets this — like {@link ClipSourceSchema.addonId} it is
|
|
27448
|
-
* stamped by the collection dispatcher, which holds the registry's projection
|
|
27449
|
-
* of the persisted authority (D556) and is the only place that knows it.
|
|
27450
|
-
*/
|
|
27451
|
-
switchedOff: boolean().optional()
|
|
27533
|
+
availability: ClipSourceAvailabilitySchema
|
|
27452
27534
|
});
|
|
27453
|
-
|
|
27454
|
-
|
|
27455
|
-
|
|
27456
|
-
|
|
27457
|
-
|
|
27458
|
-
|
|
27459
|
-
|
|
27460
|
-
*
|
|
27461
|
-
*
|
|
27462
|
-
|
|
27463
|
-
* nothing is hidden (D554 3). A provider with one source ignores it.
|
|
27464
|
-
*/
|
|
27465
|
-
sources: array(string()).optional()
|
|
27466
|
-
}), array(ClipSchema).readonly(), {
|
|
27467
|
-
kind: "query",
|
|
27468
|
-
auth: "protected"
|
|
27469
|
-
}), method(object({ deviceId: number() }), array(ClipSourceSchema).readonly(), {
|
|
27470
|
-
kind: "query",
|
|
27471
|
-
auth: "protected"
|
|
27472
|
-
}), method(object({
|
|
27473
|
-
deviceId: number(),
|
|
27474
|
-
clipId: string(),
|
|
27535
|
+
var videoclipsCapability = {
|
|
27536
|
+
name: "videoclips",
|
|
27537
|
+
scope: "device",
|
|
27538
|
+
mode: "collection",
|
|
27539
|
+
kind: "wrapper",
|
|
27540
|
+
defaultActive: true,
|
|
27541
|
+
/** A clip is a window over a camera's footage — the cap is meaningless on a
|
|
27542
|
+
* sensor, a button or an event emitter, and the `defaultActive` auto-bind
|
|
27543
|
+
* reads this to decide which devices it may claim. */
|
|
27544
|
+
deviceTypes: [DeviceType.Camera],
|
|
27475
27545
|
/**
|
|
27476
|
-
*
|
|
27477
|
-
*
|
|
27478
|
-
*
|
|
27479
|
-
*
|
|
27480
|
-
*
|
|
27481
|
-
*
|
|
27482
|
-
*
|
|
27483
|
-
*
|
|
27484
|
-
*
|
|
27485
|
-
*
|
|
27486
|
-
|
|
27487
|
-
|
|
27488
|
-
|
|
27489
|
-
|
|
27490
|
-
|
|
27491
|
-
|
|
27546
|
+
* The Clips section of a camera's device details is FRAMEWORK-DERIVED (D14):
|
|
27547
|
+
* the aggregator turns this declaration into the `type:'widget'` section and
|
|
27548
|
+
* `DeviceDetail.tsx` is never edited. `videoclips` is the first WRAPPER cap
|
|
27549
|
+
* to declare one — every previous `host/` widget cap is `deviceNative` — so
|
|
27550
|
+
* `device-config-widget-wrapped-binding.spec.ts` pins that a `kind:'wrapped'`
|
|
27551
|
+
* binding entry derives the same section a native one does.
|
|
27552
|
+
*
|
|
27553
|
+
* **It is a SECTION of the Recording tab, at the end of it — not a tab of
|
|
27554
|
+
* its own.** It shipped as a `clips` top-tab and the operator rejected the
|
|
27555
|
+
* placement: *"utilizzerei la stessa tab recordings, lì abbiamo già tutto il
|
|
27556
|
+
* necessario, una nuova sezione alla fine per le clips"*. The Recording tab
|
|
27557
|
+
* already holds the recorder's panel, the schedule bands and the unified
|
|
27558
|
+
* retention policy; footage the camera itself holds is the same question,
|
|
27559
|
+
* asked of a different store. `order: 100` puts it after all of them with
|
|
27560
|
+
* room left in front. The `clips` entry in `WELL_KNOWN_TABS` went with it —
|
|
27561
|
+
* a well-known id nobody declares is an invitation to mint the tab again.
|
|
27562
|
+
*
|
|
27563
|
+
* `topTab` stays: the browser owns a pane (a day's tiles, a source list and
|
|
27564
|
+
* a player) and the Config tab's inner bar has no room for one. The widget
|
|
27565
|
+
* itself is `host/clips-browser` in ui-library's `HOST_WIDGETS`, and because
|
|
27566
|
+
* the admin Recordings page renders every `location:'top-tab'` +
|
|
27567
|
+
* `tab:'recording'` section behind its camera picker
|
|
27568
|
+
* (`CameraRecordingSettingsSection`), this declaration lands the section on
|
|
27569
|
+
* BOTH surfaces with no second wiring.
|
|
27570
|
+
*/
|
|
27571
|
+
deviceConfig: { ui: {
|
|
27572
|
+
kind: "widget",
|
|
27573
|
+
widgetId: "host/clips-browser",
|
|
27574
|
+
tab: "recording",
|
|
27575
|
+
topTab: true,
|
|
27576
|
+
label: "Clips",
|
|
27577
|
+
order: 100
|
|
27578
|
+
} },
|
|
27579
|
+
methods: {
|
|
27580
|
+
listClips: method(object({
|
|
27581
|
+
deviceId: number(),
|
|
27582
|
+
since: number(),
|
|
27583
|
+
until: number(),
|
|
27584
|
+
limit: number().int().positive().optional(),
|
|
27585
|
+
/**
|
|
27586
|
+
* WHICH provider to ask — the `addonId` a {@link ClipSourceSchema} row
|
|
27587
|
+
* carries, never a source id and never a list. **Required** (D554 amended).
|
|
27588
|
+
*
|
|
27589
|
+
* A provider the device is not bound to is refused by name rather than
|
|
27590
|
+
* answered by another one (D552's `rejectUnresolvedAddonPin` rule).
|
|
27591
|
+
*
|
|
27592
|
+
* It was optional, documented as "absent means the device's BOUND
|
|
27593
|
+
* provider, which is CamStack on every camera". No code implemented
|
|
27594
|
+
* that. Measured on the live hub 2026-09-20 — device 592, bound to
|
|
27595
|
+
* `recorder` AND `provider-reolink` — a bare call with `limit: 3`
|
|
27596
|
+
* answered SIX rows, three from each source, merged newest-first:
|
|
27597
|
+
* `device-collection-dispatch.ts` simply left the fan-out un-narrowed,
|
|
27598
|
+
* so absence bought the union this method exists not to be, and
|
|
27599
|
+
* `limit` meant `limit × sources`.
|
|
27600
|
+
*
|
|
27601
|
+
* There is nothing to restore the default to. `getBindings` answers a
|
|
27602
|
+
* collection cap with a DERIVED, PLURAL set (D554 amended, step 0);
|
|
27603
|
+
* `setWrapperActive` — the singleton authority that could name one —
|
|
27604
|
+
* throws for a collection cap by design. Naming CamStack here instead
|
|
27605
|
+
* would privilege one addon by id inside a surface whose premise is
|
|
27606
|
+
* that sources are peers, and would be wrong on the first camera with
|
|
27607
|
+
* no recorder binding. So absence is REFUSED, in the schema, where the
|
|
27608
|
+
* generated types make it unomittable rather than merely discouraged.
|
|
27609
|
+
*
|
|
27610
|
+
* The default belongs to the SURFACE, which has the `listSources` rows
|
|
27611
|
+
* and can say which one it picked (D569 § 1–3; the viewer already
|
|
27612
|
+
* always sends this).
|
|
27613
|
+
*
|
|
27614
|
+
* It replaced `sources?: string[]`, a VIEW filter over source ids that
|
|
27615
|
+
* assumed the answer was a fan-out over everything a camera has. The
|
|
27616
|
+
* operator settled otherwise on 2026-09-20 — *"l'utilizzatore è uno
|
|
27617
|
+
* solo"* — so the list is asked of one provider at a time and there is
|
|
27618
|
+
* nothing to filter out of it.
|
|
27619
|
+
*/
|
|
27620
|
+
provider: string().min(1)
|
|
27621
|
+
}), array(ClipSchema).readonly(), {
|
|
27622
|
+
kind: "query",
|
|
27623
|
+
auth: "protected"
|
|
27624
|
+
}),
|
|
27625
|
+
/**
|
|
27626
|
+
* The sources this camera has, WITH the reason any of them cannot answer.
|
|
27627
|
+
*
|
|
27628
|
+
* Asked separately from `listClips` because an empty clip list is
|
|
27629
|
+
* ambiguous and this is the only place the ambiguity is resolved: every
|
|
27630
|
+
* bound provider contributes its own rows, and a provider that could not
|
|
27631
|
+
* be reached at all still produces one row saying so. A surface that draws
|
|
27632
|
+
* "no clips" without reading this is drawing a guess.
|
|
27633
|
+
*/
|
|
27634
|
+
listSources: method(object({ deviceId: number() }), array(ClipSourceSchema).readonly(), {
|
|
27635
|
+
kind: "query",
|
|
27636
|
+
auth: "protected"
|
|
27637
|
+
}),
|
|
27638
|
+
getClipPlayback: method(object({
|
|
27639
|
+
deviceId: number(),
|
|
27640
|
+
clipId: string(),
|
|
27641
|
+
/**
|
|
27642
|
+
* Which twin to serve, on the ONE quality scale the system already has
|
|
27643
|
+
* (`CamProfileSchema`). `low | mid` → the sub file, `high` → the main
|
|
27644
|
+
* twin; both ids are already on the row so this never re-searches the
|
|
27645
|
+
* camera. Absent means the provider's own default (the sub file, which
|
|
27646
|
+
* every source is measured to hold).
|
|
27647
|
+
*
|
|
27648
|
+
* `auto` is deliberately NOT accepted here: a stored file has no
|
|
27649
|
+
* broker session, so the adaptive tier cannot be resolved for it. The
|
|
27650
|
+
* viewer resolves `auto` to a profile the same way live does, before
|
|
27651
|
+
* it calls (D549 15).
|
|
27652
|
+
*/
|
|
27653
|
+
profile: CamProfileSchema.optional()
|
|
27654
|
+
}), ClipPlaybackSchema, {
|
|
27655
|
+
kind: "query",
|
|
27656
|
+
auth: "protected"
|
|
27657
|
+
}),
|
|
27658
|
+
/**
|
|
27659
|
+
* This clip's BYTES, base64, bounded — the by-handle read a clip EXPORT
|
|
27660
|
+
* pulls once (D558).
|
|
27661
|
+
*
|
|
27662
|
+
* `getClipPlayback` is the right answer for a player: it hands back a URL
|
|
27663
|
+
* on a plane the hub serves `access:'authenticated'`, which a browser and a
|
|
27664
|
+
* viewer session satisfy. It is the wrong answer for another ADDON. There
|
|
27665
|
+
* is no addon→addon byte transport in this framework — `AddonDataPlane`
|
|
27666
|
+
* only lets an addon SERVE, on `127.0.0.1` behind a per-listener secret
|
|
27667
|
+
* only the hub may present — so a recorder that wants a camera's clip
|
|
27668
|
+
* cannot fetch that URL. This method is the one seam that exists for it,
|
|
27669
|
+
* and it is deliberately the same shape (and the same bound) as
|
|
27670
|
+
* `recordingExport.readExportBytes`, which exists for the mirror-image
|
|
27671
|
+
* reason.
|
|
27672
|
+
*
|
|
27673
|
+
* Routing needs no `provider` pin: the id is source-prefixed and
|
|
27674
|
+
* self-contained, so `device-collection-dispatch.ts` rule 3 hands the call
|
|
27675
|
+
* to the source that claims it — and an id nobody claims is REFUSED rather
|
|
27676
|
+
* than answered by another source.
|
|
27677
|
+
*
|
|
27678
|
+
* The producer reuses the fetch path it already has, completion rules
|
|
27679
|
+
* included: a clip is taken by cmd 5 and finished on a short idle window
|
|
27680
|
+
* whose result is PROVED against the catalog row's own span, retried once
|
|
27681
|
+
* when it comes up materially short, and served-and-named when it is still
|
|
27682
|
+
* short (D568). A second fetch with different completion rules is exactly
|
|
27683
|
+
* the second authority D558 refuses to create.
|
|
27684
|
+
*
|
|
27685
|
+
* Every refusal THROWS with its reason and none of them is silent — the
|
|
27686
|
+
* sleep gate (decided before `getApi()`, liftable only by
|
|
27687
|
+
* {@link ClipWakeSchema}), a catalog row nobody claims, a clip with no
|
|
27688
|
+
* bytes behind it, a mux that failed, and the size bound. The caller turns
|
|
27689
|
+
* that reason into an operator-facing one; a truncated file is never an
|
|
27690
|
+
* answer.
|
|
27691
|
+
*/
|
|
27692
|
+
readClipBytes: optionalMethod(object({
|
|
27693
|
+
deviceId: number(),
|
|
27694
|
+
clipId: string().min(1),
|
|
27695
|
+
/**
|
|
27696
|
+
* Which twin to fetch, on the mapping D549 15 already fixed:
|
|
27697
|
+
* `low | mid` → the sub file, `high` → the main twin. `auto` is not
|
|
27698
|
+
* accepted here for the same reason it is not accepted by
|
|
27699
|
+
* `getClipPlayback` — a stored file has no broker session, so the
|
|
27700
|
+
* adaptive tier cannot be resolved for it.
|
|
27701
|
+
*/
|
|
27702
|
+
profile: CamProfileSchema.optional(),
|
|
27703
|
+
/**
|
|
27704
|
+
* The CALLER's byte bound, so an over-size clip is refused before it is
|
|
27705
|
+
* read and encoded rather than after. Capped by
|
|
27706
|
+
* {@link VIDEOCLIPS_MAX_READ_BYTES} whatever is passed; absent means
|
|
27707
|
+
* that ceiling.
|
|
27708
|
+
*/
|
|
27709
|
+
maxBytes: number().int().positive().optional(),
|
|
27710
|
+
/**
|
|
27711
|
+
* The operator's authorisation to wake a sleeping camera for this
|
|
27712
|
+
* read. Absent — the default — means a sleeping standalone battery
|
|
27713
|
+
* camera is REFUSED by name, before any session is opened.
|
|
27714
|
+
*/
|
|
27715
|
+
wake: ClipWakeSchema.optional()
|
|
27716
|
+
}), ClipBytesSchema, {
|
|
27717
|
+
kind: "query",
|
|
27718
|
+
auth: "protected"
|
|
27719
|
+
})
|
|
27720
|
+
}
|
|
27721
|
+
};
|
|
27492
27722
|
/**
|
|
27493
27723
|
* Optional client-side hints sent at session creation to help the provider
|
|
27494
27724
|
* pick the best native source. All fields optional — a viewer that knows
|
|
@@ -33779,13 +34009,101 @@ var ExportStateSchema = _enum([
|
|
|
33779
34009
|
"expired",
|
|
33780
34010
|
"deleted"
|
|
33781
34011
|
]);
|
|
33782
|
-
/**
|
|
34012
|
+
/**
|
|
34013
|
+
* WHAT an export is — the authority, as opposed to the four top-level fields
|
|
34014
|
+
* the Library sorts and labels on (D558 § 2.2).
|
|
34015
|
+
*
|
|
34016
|
+
* Read it through {@link exportSubjectOf}, never off the record directly: the
|
|
34017
|
+
* field is optional for the history rows written before it existed, and that
|
|
34018
|
+
* absence has exactly one interpreter.
|
|
34019
|
+
*/
|
|
34020
|
+
var ExportSubjectSchema = discriminatedUnion("kind", [object({
|
|
34021
|
+
kind: literal("footage"),
|
|
34022
|
+
deviceId: number(),
|
|
34023
|
+
profiles: array(string()).min(1),
|
|
34024
|
+
fromMs: number(),
|
|
34025
|
+
toMs: number()
|
|
34026
|
+
}), object({
|
|
34027
|
+
kind: literal("clip"),
|
|
34028
|
+
deviceId: number(),
|
|
34029
|
+
provider: string().min(1),
|
|
34030
|
+
source: string().min(1),
|
|
34031
|
+
sourceLabel: string().min(1),
|
|
34032
|
+
clipId: string().min(1),
|
|
34033
|
+
/**
|
|
34034
|
+
* WHERE IN THE CATALOG to confirm this clip — the day window the surface was
|
|
34035
|
+
* already listing when the operator picked the segment.
|
|
34036
|
+
*
|
|
34037
|
+
* It is **not** a time range control and it never becomes one: the record's
|
|
34038
|
+
* `fromMs`/`toMs` come from the catalog ROW and from nothing a caller
|
|
34039
|
+
* supplied (D558 § 5.4.3), and a window that does not contain the clip is a
|
|
34040
|
+
* `catalog-miss`, not a silently wider search. It exists because
|
|
34041
|
+
* `videoclips.listClips` takes `since`/`until` and has no by-handle twin:
|
|
34042
|
+
* the catalog check D558 asks for is literally that call, and a call needs a
|
|
34043
|
+
* window. The surface has one — `ClipsBrowser`'s `dayWindow`, one local
|
|
34044
|
+
* wall-clock day, which is also the only width measured to be cheap (one
|
|
34045
|
+
* day on 592 lists 171 clips in 712 ms, a busy day 546 in 2.0 s; twenty days
|
|
34046
|
+
* of one child's events took 3.6–5.4 s).
|
|
34047
|
+
*/
|
|
34048
|
+
catalogWindow: object({
|
|
34049
|
+
sinceMs: number(),
|
|
34050
|
+
untilMs: number()
|
|
34051
|
+
}),
|
|
34052
|
+
profile: _enum([
|
|
34053
|
+
"high",
|
|
34054
|
+
"mid",
|
|
34055
|
+
"low"
|
|
34056
|
+
]),
|
|
34057
|
+
/**
|
|
34058
|
+
* The operator's authorisation to wake a sleeping camera for this export.
|
|
34059
|
+
* ONE definition, in the cap that owns the clip read ({@link ClipWakeSchema}),
|
|
34060
|
+
* because the gate that honours it is the clip provider's sleep gate — a
|
|
34061
|
+
* second enum here would be a second contract. Absent by default; never
|
|
34062
|
+
* settable by a scheduler or a retry.
|
|
34063
|
+
*
|
|
34064
|
+
* **One authorised yes is ONE wake.** A failed clip export is retried only by
|
|
34065
|
+
* an operator act that asks again; a queued job that outlived its wake fails
|
|
34066
|
+
* with a reason rather than waking on its turn; and this subject carries
|
|
34067
|
+
* exactly one profile precisely so one tap is never two fetches (D558 § 5.2).
|
|
34068
|
+
*/
|
|
34069
|
+
wake: ClipWakeSchema.optional()
|
|
34070
|
+
})]);
|
|
34071
|
+
/**
|
|
34072
|
+
* One export job / history row.
|
|
34073
|
+
*
|
|
34074
|
+
* **`subject` is the AUTHORITY on what was exported. `deviceId`, `profile`,
|
|
34075
|
+
* `fromMs` and `toMs` are its PROJECTION** — kept top-level because the whole
|
|
34076
|
+
* Library sorts and labels on them (`library-items.ts` orders an export by
|
|
34077
|
+
* `fromMs`; `export-format.ts` draws `rangeLabel` from the pair), and a row
|
|
34078
|
+
* that did not fill them would sort under the epoch and render a blank range.
|
|
34079
|
+
* Write to the subject and read from the projection and the two will disagree;
|
|
34080
|
+
* the projection is derived at creation and never edited afterwards.
|
|
34081
|
+
*
|
|
34082
|
+
* And they mean DIFFERENT FACTS for the two kinds, which is the part a reader
|
|
34083
|
+
* who knows only the recording export will get wrong:
|
|
34084
|
+
*
|
|
34085
|
+
* | field | `kind:'footage'` | `kind:'clip'` |
|
|
34086
|
+
* | --- | --- | --- |
|
|
34087
|
+
* | `fromMs`/`toMs` | the stretch the operator ASKED for | the camera's own boundaries, always `clip.timeRange`, never anything a caller supplied |
|
|
34088
|
+
* | `profile` | the stream rendered | the twin actually SERVED (`subject.profile` is the one asked for) |
|
|
34089
|
+
*
|
|
34090
|
+
* Same type, different fact — the shape this repo keeps getting wrong (D385's
|
|
34091
|
+
* two authorities, D224's second copy).
|
|
34092
|
+
*/
|
|
33783
34093
|
var ExportRecordSchema = object({
|
|
33784
34094
|
id: string(),
|
|
33785
34095
|
deviceId: number(),
|
|
33786
34096
|
profile: string(),
|
|
33787
34097
|
fromMs: number(),
|
|
33788
34098
|
toMs: number(),
|
|
34099
|
+
/**
|
|
34100
|
+
* What this export IS. Optional ONLY for the rows written before D558: the
|
|
34101
|
+
* store parses every row through this schema on every read, so a required
|
|
34102
|
+
* field would make the export AUDIT — which is the whole reason rows survive
|
|
34103
|
+
* file deletion — unreadable in one release. Absence means `footage`, and
|
|
34104
|
+
* {@link exportSubjectOf} is the one place that says so.
|
|
34105
|
+
*/
|
|
34106
|
+
subject: ExportSubjectSchema.optional(),
|
|
33789
34107
|
options: ExportOptionsSchema,
|
|
33790
34108
|
state: ExportStateSchema,
|
|
33791
34109
|
/** 0–100 while rendering; null otherwise. */
|
|
@@ -33802,6 +34120,49 @@ var ExportRecordSchema = object({
|
|
|
33802
34120
|
/** Failure reason when state is 'failed'; null otherwise. */
|
|
33803
34121
|
error: string().nullable()
|
|
33804
34122
|
});
|
|
34123
|
+
/**
|
|
34124
|
+
* Every way a clip export can fail, as a TOKEN — never prose.
|
|
34125
|
+
*
|
|
34126
|
+
* A branch that accepts work and produces nothing is the branch this repo
|
|
34127
|
+
* keeps losing work in (D391), and a clip export has five places to lose it
|
|
34128
|
+
* that a recording export does not have. The token is what a surface may key
|
|
34129
|
+
* a table on; the PROSE — the camera's own words, the source's verbatim
|
|
34130
|
+
* refusal — travels with it, in the same `ExportRecord.error` string, after a
|
|
34131
|
+
* `: `. Two separate things in one field because the field is one field:
|
|
34132
|
+
* `ClipStillRefusalCodeSchema` split them across two HTTP headers for the same
|
|
34133
|
+
* reason, and the surface that keyed on the whole header rendered every
|
|
34134
|
+
* refusal on this fleet as `Refused: <prose>`.
|
|
34135
|
+
*
|
|
34136
|
+
* Compose with {@link clipExportFailure}, read back with
|
|
34137
|
+
* {@link clipExportFailureOf}. Never hand-spell the separator.
|
|
34138
|
+
*/
|
|
34139
|
+
var ClipExportFailureSchema = _enum([
|
|
34140
|
+
"catalog-miss",
|
|
34141
|
+
"catalog-unreachable",
|
|
34142
|
+
"no-file-for-window",
|
|
34143
|
+
"clip-in-progress",
|
|
34144
|
+
"unsupported-option",
|
|
34145
|
+
"sleeping",
|
|
34146
|
+
"camera-refused",
|
|
34147
|
+
"fetch-failed",
|
|
34148
|
+
"too-large-to-transfer",
|
|
34149
|
+
"wake-expired"
|
|
34150
|
+
]);
|
|
34151
|
+
/** `<token>: <prose>` — the ONE composition of a clip export's failure string. */
|
|
34152
|
+
function clipExportFailure(code, detail) {
|
|
34153
|
+
return detail.length > 0 ? `${code}: ${detail}` : code;
|
|
34154
|
+
}
|
|
34155
|
+
/**
|
|
34156
|
+
* The token out of an {@link ExportRecord.error}, or null when the string did
|
|
34157
|
+
* not come from {@link clipExportFailure} (every footage failure, and every
|
|
34158
|
+
* error thrown by something that never heard of this vocabulary).
|
|
34159
|
+
*/
|
|
34160
|
+
function clipExportFailureOf(error) {
|
|
34161
|
+
if (error === null) return null;
|
|
34162
|
+
const head = error.split(":", 1)[0] ?? "";
|
|
34163
|
+
const parsed = ClipExportFailureSchema.safeParse(head.trim());
|
|
34164
|
+
return parsed.success ? parsed.data : null;
|
|
34165
|
+
}
|
|
33805
34166
|
/** Candidate download URLs (LAN first, then operator extra hosts). */
|
|
33806
34167
|
var ExportDownloadSchema = object({
|
|
33807
34168
|
url: string(),
|
|
@@ -33839,29 +34200,150 @@ var ExportBytesSchema = object({
|
|
|
33839
34200
|
name: string(),
|
|
33840
34201
|
bytes: number().int().nonnegative()
|
|
33841
34202
|
});
|
|
34203
|
+
/** Canonical `profiles[]`, falling back to the legacy singular `profile`. */
|
|
34204
|
+
function resolveExportProfiles(input) {
|
|
34205
|
+
if (input.profiles !== void 0 && input.profiles.length > 0) return [...input.profiles];
|
|
34206
|
+
if (typeof input.profile === "string" && input.profile.length > 0) return [input.profile];
|
|
34207
|
+
return [];
|
|
34208
|
+
}
|
|
34209
|
+
/**
|
|
34210
|
+
* `createExport` input — ONE object carrying an optional {@link ExportSubject},
|
|
34211
|
+
* never a union of two inputs.
|
|
34212
|
+
*
|
|
34213
|
+
* It has to be a ZodObject: generated routers call `.input.loose()` so the
|
|
34214
|
+
* out-of-band `nodeId` selector survives the wire parse, and `.loose()` is a
|
|
34215
|
+
* ZodObject method a `z.discriminatedUnion` does not have. That is why the
|
|
34216
|
+
* discriminant sits one level down, in `subject`, and why
|
|
34217
|
+
* {@link resolveCreateExportSubject} — not a `z.preprocess` wrapper, which
|
|
34218
|
+
* would have produced a schema with no `.loose()` — is the one reading of a
|
|
34219
|
+
* legacy flat input as a subject.
|
|
34220
|
+
*
|
|
34221
|
+
* **`deviceId` stays REQUIRED at the top level**, for both kinds, and a clip
|
|
34222
|
+
* subject naming a different one is REFUSED. Not symmetry: `METHOD_DEVICE_SELECTORS`
|
|
34223
|
+
* (generated) maps top-level fields and one-level object arrays, so per-device
|
|
34224
|
+
* scope enforcement in `scope-access.ts` reads THIS field and cannot see
|
|
34225
|
+
* `subject.deviceId`. A deviceId that lived only in the subject would let a
|
|
34226
|
+
* principal scoped to one camera create an export — and, on the clip path, a
|
|
34227
|
+
* WAKE — for another.
|
|
34228
|
+
*
|
|
34229
|
+
* **A clip carries no time range**, and one supplied alongside a clip subject
|
|
34230
|
+
* is refused rather than ignored: there is no drag on this path and nothing to
|
|
34231
|
+
* normalise (D558 § 5.4.3). The record's `fromMs`/`toMs` come from the clip's
|
|
34232
|
+
* own `timeRange` and from nowhere else.
|
|
34233
|
+
*/
|
|
34234
|
+
var CreateExportInputSchema = object({
|
|
34235
|
+
deviceId: number(),
|
|
34236
|
+
/** @deprecated Prefer `profiles`. Kept so timelapse/notifiers keep working. */
|
|
34237
|
+
profile: string().optional(),
|
|
34238
|
+
profiles: array(string()).min(1).optional(),
|
|
34239
|
+
/** Footage only — a clip's boundaries are the camera's. */
|
|
34240
|
+
fromMs: number().optional(),
|
|
34241
|
+
toMs: number().optional(),
|
|
34242
|
+
/** What to export. Absent means the legacy flat footage request. */
|
|
34243
|
+
subject: ExportSubjectSchema.optional(),
|
|
34244
|
+
options: ExportOptionsSchema
|
|
34245
|
+
}).superRefine((v, ctx) => {
|
|
34246
|
+
if (v.subject?.kind === "clip") {
|
|
34247
|
+
if (v.subject.deviceId !== v.deviceId) ctx.addIssue({
|
|
34248
|
+
code: ZodIssueCode.custom,
|
|
34249
|
+
message: `subject.deviceId (${v.subject.deviceId}) must equal deviceId (${v.deviceId}) — the top-level field is what per-device scope enforcement reads`,
|
|
34250
|
+
path: ["subject", "deviceId"]
|
|
34251
|
+
});
|
|
34252
|
+
if (v.fromMs !== void 0 || v.toMs !== void 0) ctx.addIssue({
|
|
34253
|
+
code: ZodIssueCode.custom,
|
|
34254
|
+
message: "a clip export asks for no time range: the camera chose the boundaries and they are read from the catalog row",
|
|
34255
|
+
path: ["fromMs"]
|
|
34256
|
+
});
|
|
34257
|
+
return;
|
|
34258
|
+
}
|
|
34259
|
+
if (v.subject?.kind === "footage" && v.subject.deviceId !== v.deviceId) ctx.addIssue({
|
|
34260
|
+
code: ZodIssueCode.custom,
|
|
34261
|
+
message: `subject.deviceId (${v.subject.deviceId}) must equal deviceId (${v.deviceId})`,
|
|
34262
|
+
path: ["subject", "deviceId"]
|
|
34263
|
+
});
|
|
34264
|
+
const fromMs = v.subject?.kind === "footage" ? v.subject.fromMs : v.fromMs;
|
|
34265
|
+
const toMs = v.subject?.kind === "footage" ? v.subject.toMs : v.toMs;
|
|
34266
|
+
if (typeof fromMs !== "number" || typeof toMs !== "number") ctx.addIssue({
|
|
34267
|
+
code: ZodIssueCode.custom,
|
|
34268
|
+
message: "a footage export needs fromMs and toMs",
|
|
34269
|
+
path: ["fromMs"]
|
|
34270
|
+
});
|
|
34271
|
+
if ((v.subject?.kind === "footage" ? [...v.subject.profiles] : resolveExportProfiles(v)).length < 1) ctx.addIssue({
|
|
34272
|
+
code: ZodIssueCode.custom,
|
|
34273
|
+
message: "pass profiles[] (min 1) or legacy profile",
|
|
34274
|
+
path: ["profiles"]
|
|
34275
|
+
});
|
|
34276
|
+
});
|
|
34277
|
+
/**
|
|
34278
|
+
* The ONE reading of a `createExport` input as a {@link ExportSubject}.
|
|
34279
|
+
*
|
|
34280
|
+
* Every consumer goes through this: a provider that branched on
|
|
34281
|
+
* `input.subject !== undefined` in one place and on `input.fromMs` in another
|
|
34282
|
+
* would be two authorities on what was asked for, which is how the flat fields
|
|
34283
|
+
* and the subject drift apart.
|
|
34284
|
+
*
|
|
34285
|
+
* Throws on a footage input with no range — an input that parsed cannot reach
|
|
34286
|
+
* that, and a caller that skipped the parse gets a named refusal rather than
|
|
34287
|
+
* `NaN` boundaries on a durable row.
|
|
34288
|
+
*/
|
|
34289
|
+
function resolveCreateExportSubject(input) {
|
|
34290
|
+
if (input.subject !== void 0) return input.subject;
|
|
34291
|
+
const profiles = resolveExportProfiles(input);
|
|
34292
|
+
if (typeof input.fromMs !== "number" || typeof input.toMs !== "number") throw new Error("recording-export: a footage export needs fromMs and toMs");
|
|
34293
|
+
return {
|
|
34294
|
+
kind: "footage",
|
|
34295
|
+
deviceId: input.deviceId,
|
|
34296
|
+
profiles,
|
|
34297
|
+
fromMs: input.fromMs,
|
|
34298
|
+
toMs: input.toMs
|
|
34299
|
+
};
|
|
34300
|
+
}
|
|
34301
|
+
/**
|
|
34302
|
+
* The ONE interpreter of a stored row's subject.
|
|
34303
|
+
*
|
|
34304
|
+
* `ExportRecord.subject` is optional for exactly one reason — the history rows
|
|
34305
|
+
* written before D558 — and "absent means footage, built from the projection"
|
|
34306
|
+
* is a statement that must live in one place. Anything that reads
|
|
34307
|
+
* `rec.subject` directly and falls back inline is the second authority.
|
|
34308
|
+
*/
|
|
34309
|
+
function exportSubjectOf(rec) {
|
|
34310
|
+
if (rec.subject !== void 0) return rec.subject;
|
|
34311
|
+
return {
|
|
34312
|
+
kind: "footage",
|
|
34313
|
+
deviceId: rec.deviceId,
|
|
34314
|
+
profiles: [rec.profile],
|
|
34315
|
+
fromMs: rec.fromMs,
|
|
34316
|
+
toMs: rec.toMs
|
|
34317
|
+
};
|
|
34318
|
+
}
|
|
33842
34319
|
var recordingExportCapability = {
|
|
33843
34320
|
name: "recording-export",
|
|
33844
34321
|
scope: "system",
|
|
33845
34322
|
mode: "singleton",
|
|
33846
34323
|
methods: {
|
|
33847
|
-
/**
|
|
33848
|
-
*
|
|
33849
|
-
*
|
|
33850
|
-
|
|
33851
|
-
|
|
33852
|
-
|
|
33853
|
-
|
|
33854
|
-
|
|
33855
|
-
|
|
33856
|
-
|
|
33857
|
-
|
|
33858
|
-
|
|
33859
|
-
|
|
33860
|
-
|
|
33861
|
-
|
|
33862
|
-
|
|
33863
|
-
|
|
33864
|
-
|
|
34324
|
+
/**
|
|
34325
|
+
* Queue an export of {@link ExportSubjectSchema}.
|
|
34326
|
+
*
|
|
34327
|
+
* `kind:'footage'` — a render of `[fromMs,toMs)` for `deviceId`/`profiles`
|
|
34328
|
+
* (legacy flat input, singular `profile` included, still accepted and
|
|
34329
|
+
* rewritten). Fails fast when no footage covers the range. One job per
|
|
34330
|
+
* profile; **returns the first queued record and the others are reachable
|
|
34331
|
+
* only through `listExports`** — a defect named in D558 § 6.3 and the
|
|
34332
|
+
* reason a clip subject carries exactly ONE profile.
|
|
34333
|
+
*
|
|
34334
|
+
* `kind:'clip'` — a finished file the camera holds, validated against the
|
|
34335
|
+
* device's clip CATALOG (`videoclips.listClips`, at the subject's
|
|
34336
|
+
* `provider`) instead of the recording index, and fetched once by handle
|
|
34337
|
+
* under a bound. Its `fromMs`/`toMs` come from the catalog row and from
|
|
34338
|
+
* nowhere else; a caller supplying a range is refused.
|
|
34339
|
+
*
|
|
34340
|
+
* A clip export reuses the six {@link ExportStateSchema} members and adds
|
|
34341
|
+
* none: the viewer maps an unknown state string to `failed`, so a seventh
|
|
34342
|
+
* member renders every live export — of both kinds — as FAILED on every
|
|
34343
|
+
* installed app (D558 § 6.1, pinned by `export-state-members.spec.ts`).
|
|
34344
|
+
* `subject.kind` is what tells a surface what `rendering` means.
|
|
34345
|
+
*/
|
|
34346
|
+
createExport: method(CreateExportInputSchema, ExportRecordSchema, {
|
|
33865
34347
|
kind: "mutation",
|
|
33866
34348
|
auth: "protected"
|
|
33867
34349
|
}),
|
|
@@ -39469,6 +39951,12 @@ Object.freeze({
|
|
|
39469
39951
|
addonId: null,
|
|
39470
39952
|
access: "view"
|
|
39471
39953
|
},
|
|
39954
|
+
"pipelineAnalytics.ownersWithMedia": {
|
|
39955
|
+
capName: "pipeline-analytics",
|
|
39956
|
+
capScope: "device",
|
|
39957
|
+
addonId: null,
|
|
39958
|
+
access: "view"
|
|
39959
|
+
},
|
|
39472
39960
|
"pipelineAnalytics.pauseForStorageMigration": {
|
|
39473
39961
|
capName: "pipeline-analytics",
|
|
39474
39962
|
capScope: "device",
|
|
@@ -42067,6 +42555,12 @@ Object.freeze({
|
|
|
42067
42555
|
addonId: null,
|
|
42068
42556
|
access: "view"
|
|
42069
42557
|
},
|
|
42558
|
+
"videoclips.readClipBytes": {
|
|
42559
|
+
capName: "videoclips",
|
|
42560
|
+
capScope: "device",
|
|
42561
|
+
addonId: null,
|
|
42562
|
+
access: "view"
|
|
42563
|
+
},
|
|
42070
42564
|
"viewerUi.getStaticDir": {
|
|
42071
42565
|
capName: "viewer-ui",
|
|
42072
42566
|
capScope: "system",
|
|
@@ -43369,6 +43863,11 @@ Object.freeze({
|
|
|
43369
43863
|
form: "single",
|
|
43370
43864
|
optional: false
|
|
43371
43865
|
}],
|
|
43866
|
+
"pipelineAnalytics.ownersWithMedia": [{
|
|
43867
|
+
name: "deviceId",
|
|
43868
|
+
form: "single",
|
|
43869
|
+
optional: false
|
|
43870
|
+
}],
|
|
43372
43871
|
"pipelineAnalytics.proposeRetrainAnnotations": [{
|
|
43373
43872
|
name: "deviceId",
|
|
43374
43873
|
form: "single",
|
|
@@ -44080,6 +44579,11 @@ Object.freeze({
|
|
|
44080
44579
|
form: "single",
|
|
44081
44580
|
optional: false
|
|
44082
44581
|
}],
|
|
44582
|
+
"videoclips.readClipBytes": [{
|
|
44583
|
+
name: "deviceId",
|
|
44584
|
+
form: "single",
|
|
44585
|
+
optional: false
|
|
44586
|
+
}],
|
|
44083
44587
|
"waterHeater.setAway": [{
|
|
44084
44588
|
name: "deviceId",
|
|
44085
44589
|
form: "single",
|
|
@@ -45899,6 +46403,12 @@ Object.defineProperty(exports, "COCO_TO_MACRO", {
|
|
|
45899
46403
|
return COCO_TO_MACRO;
|
|
45900
46404
|
}
|
|
45901
46405
|
});
|
|
46406
|
+
Object.defineProperty(exports, "CamProfileSchema", {
|
|
46407
|
+
enumerable: true,
|
|
46408
|
+
get: function() {
|
|
46409
|
+
return CamProfileSchema;
|
|
46410
|
+
}
|
|
46411
|
+
});
|
|
45902
46412
|
Object.defineProperty(exports, "DEFAULT_AUDIO_ANALYZER_CONFIG", {
|
|
45903
46413
|
enumerable: true,
|
|
45904
46414
|
get: function() {
|
|
@@ -45959,6 +46469,18 @@ Object.defineProperty(exports, "DeviceType", {
|
|
|
45959
46469
|
return DeviceType;
|
|
45960
46470
|
}
|
|
45961
46471
|
});
|
|
46472
|
+
Object.defineProperty(exports, "EVENT_OWNER_TYPES", {
|
|
46473
|
+
enumerable: true,
|
|
46474
|
+
get: function() {
|
|
46475
|
+
return EVENT_OWNER_TYPES;
|
|
46476
|
+
}
|
|
46477
|
+
});
|
|
46478
|
+
Object.defineProperty(exports, "EVENT_PAD_MS", {
|
|
46479
|
+
enumerable: true,
|
|
46480
|
+
get: function() {
|
|
46481
|
+
return EVENT_PAD_MS;
|
|
46482
|
+
}
|
|
46483
|
+
});
|
|
45962
46484
|
Object.defineProperty(exports, "EncodeProfileSchema", {
|
|
45963
46485
|
enumerable: true,
|
|
45964
46486
|
get: function() {
|
|
@@ -46067,6 +46589,12 @@ Object.defineProperty(exports, "RingBuffer", {
|
|
|
46067
46589
|
return RingBuffer;
|
|
46068
46590
|
}
|
|
46069
46591
|
});
|
|
46592
|
+
Object.defineProperty(exports, "VISIT_MERGE_GAP_MS", {
|
|
46593
|
+
enumerable: true,
|
|
46594
|
+
get: function() {
|
|
46595
|
+
return VISIT_MERGE_GAP_MS;
|
|
46596
|
+
}
|
|
46597
|
+
});
|
|
46070
46598
|
Object.defineProperty(exports, "YAMNET_TO_MACRO", {
|
|
46071
46599
|
enumerable: true,
|
|
46072
46600
|
get: function() {
|
|
@@ -46139,6 +46667,18 @@ Object.defineProperty(exports, "cameraStreamsCapability", {
|
|
|
46139
46667
|
return cameraStreamsCapability;
|
|
46140
46668
|
}
|
|
46141
46669
|
});
|
|
46670
|
+
Object.defineProperty(exports, "clipExportFailure", {
|
|
46671
|
+
enumerable: true,
|
|
46672
|
+
get: function() {
|
|
46673
|
+
return clipExportFailure;
|
|
46674
|
+
}
|
|
46675
|
+
});
|
|
46676
|
+
Object.defineProperty(exports, "clipExportFailureOf", {
|
|
46677
|
+
enumerable: true,
|
|
46678
|
+
get: function() {
|
|
46679
|
+
return clipExportFailureOf;
|
|
46680
|
+
}
|
|
46681
|
+
});
|
|
46142
46682
|
Object.defineProperty(exports, "createEvent", {
|
|
46143
46683
|
enumerable: true,
|
|
46144
46684
|
get: function() {
|
|
@@ -46265,6 +46805,12 @@ Object.defineProperty(exports, "expandAudioChunkToF32le", {
|
|
|
46265
46805
|
return expandAudioChunkToF32le;
|
|
46266
46806
|
}
|
|
46267
46807
|
});
|
|
46808
|
+
Object.defineProperty(exports, "exportSubjectOf", {
|
|
46809
|
+
enumerable: true,
|
|
46810
|
+
get: function() {
|
|
46811
|
+
return exportSubjectOf;
|
|
46812
|
+
}
|
|
46813
|
+
});
|
|
46268
46814
|
Object.defineProperty(exports, "failureContributionCapability", {
|
|
46269
46815
|
enumerable: true,
|
|
46270
46816
|
get: function() {
|
|
@@ -46517,6 +47063,12 @@ Object.defineProperty(exports, "resolveClusterStepModelId", {
|
|
|
46517
47063
|
return resolveClusterStepModelId;
|
|
46518
47064
|
}
|
|
46519
47065
|
});
|
|
47066
|
+
Object.defineProperty(exports, "resolveCreateExportSubject", {
|
|
47067
|
+
enumerable: true,
|
|
47068
|
+
get: function() {
|
|
47069
|
+
return resolveCreateExportSubject;
|
|
47070
|
+
}
|
|
47071
|
+
});
|
|
46520
47072
|
Object.defineProperty(exports, "resolveEgressDecodeHwAccel", {
|
|
46521
47073
|
enumerable: true,
|
|
46522
47074
|
get: function() {
|
|
@@ -46601,6 +47153,12 @@ Object.defineProperty(exports, "union", {
|
|
|
46601
47153
|
return union;
|
|
46602
47154
|
}
|
|
46603
47155
|
});
|
|
47156
|
+
Object.defineProperty(exports, "videoclipsCapability", {
|
|
47157
|
+
enumerable: true,
|
|
47158
|
+
get: function() {
|
|
47159
|
+
return videoclipsCapability;
|
|
47160
|
+
}
|
|
47161
|
+
});
|
|
46604
47162
|
Object.defineProperty(exports, "webrtcSessionCapability", {
|
|
46605
47163
|
enumerable: true,
|
|
46606
47164
|
get: function() {
|