@camstack/types 1.2.59 → 1.2.61
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/capabilities/index.d.ts +1 -1
- package/dist/capabilities/pipeline-orchestrator.cap.d.ts +18 -0
- package/dist/capabilities/recording-export.cap.d.ts +159 -0
- package/dist/capabilities/snapshot.cap.d.ts +18 -14
- package/dist/device/declared-device.d.ts +12 -0
- package/dist/generated/addon-api.d.ts +7 -0
- package/dist/generated/method-access-map.d.ts +1 -1
- package/dist/generated/system-proxy.d.ts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +283 -23
- package/dist/index.mjs +277 -24
- package/dist/interfaces/camera-switches.d.ts +66 -2
- package/dist/notification/timelapse-rule.d.ts +14 -0
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -695,8 +695,31 @@ var DEFAULT_RETENTION = {
|
|
|
695
695
|
//#endregion
|
|
696
696
|
//#region src/interfaces/camera-switches.ts
|
|
697
697
|
/**
|
|
698
|
-
* Per-camera FUNCTION SWITCHES
|
|
699
|
-
*
|
|
698
|
+
* Per-camera FUNCTION SWITCHES.
|
|
699
|
+
*
|
|
700
|
+
* ## The aggregate group is being withdrawn — the BADGE is not (D113)
|
|
701
|
+
*
|
|
702
|
+
* This file shipped as "the one coherent on/off surface over the pipeline
|
|
703
|
+
* functions an operator thinks in terms of". The operator's verdict on
|
|
704
|
+
* 2026-08-12 was that the coherent surface bought complexity and no clarity:
|
|
705
|
+
* every function already had a settings page of its own, and a second place to
|
|
706
|
+
* turn it off is a second place to look. Each switch is going back to its own
|
|
707
|
+
* component's original options — detection to the detection-pipeline wrapper
|
|
708
|
+
* binding, audio analysis to its own, recording to `RecordingConfig.enabled`
|
|
709
|
+
* (which was always first-class; the switch was a veneer over
|
|
710
|
+
* `recording.setDeviceConfig`), notifications to a notification-center
|
|
711
|
+
* per-device setting, the two camera planes to their own components.
|
|
712
|
+
*
|
|
713
|
+
* What survives is {@link composeSwitchedOff}: `CameraStatus.switchedOff`, the
|
|
714
|
+
* thing that lets a status surface say DISABLED instead of BROKEN, recomposed
|
|
715
|
+
* straight from the authorities with no group in the middle. That rule was
|
|
716
|
+
* never about a control panel.
|
|
717
|
+
*
|
|
718
|
+
* Everything else here — {@link CAMERA_SWITCH_CATALOG}, {@link CameraSwitch},
|
|
719
|
+
* {@link deriveCameraSwitches}, the `pipelineOrchestrator.getCameraSwitches` /
|
|
720
|
+
* `setCameraSwitch` pair — is a COMPATIBILITY surface for as long as deployed
|
|
721
|
+
* viewers (v1.0.305) and the admin UI still call it. It is deleted when they
|
|
722
|
+
* stop; nothing new may be built on it.
|
|
700
723
|
*
|
|
701
724
|
* ## This file adds no state
|
|
702
725
|
*
|
|
@@ -1120,6 +1143,42 @@ function deriveCameraSwitches(input) {
|
|
|
1120
1143
|
function switchedOffIds(switches) {
|
|
1121
1144
|
return switches.filter((s) => CAMERA_SWITCH_CATALOG[s.id].countsAsSwitchedOff && s.available && !s.enabled).map((s) => s.id);
|
|
1122
1145
|
}
|
|
1146
|
+
/**
|
|
1147
|
+
* Compose the `switchedOff` badge STRAIGHT from the authorities (D113).
|
|
1148
|
+
*
|
|
1149
|
+
* This is the half of this file that outlives the switch group.
|
|
1150
|
+
* {@link deriveCameraSwitches} exists to paint a control panel — labels, cost
|
|
1151
|
+
* lines, `available`/`unavailableReason` — and that panel is being dismantled:
|
|
1152
|
+
* each function is going back to its own component's settings. The BADGE is
|
|
1153
|
+
* not: "a switched-off camera must read as DISABLED, not broken" is a rule
|
|
1154
|
+
* about status, not about a control group, and it survives every surface change
|
|
1155
|
+
* underneath it.
|
|
1156
|
+
*
|
|
1157
|
+
* So the badge gets its own entry point over the same authority reads, and the
|
|
1158
|
+
* caller that only needs the badge never builds eight labelled rows to throw
|
|
1159
|
+
* seven of them away.
|
|
1160
|
+
*
|
|
1161
|
+
* `privacy-mask` appears in NEITHER list, whichever way it is sitting and
|
|
1162
|
+
* whether or not it could be read — its ON means "the mask is obscuring video",
|
|
1163
|
+
* not "this function works" ({@link CameraSwitchDescriptor.countsAsSwitchedOff}).
|
|
1164
|
+
* Counting it unreadable would be its own bug: the mask cannot contribute to
|
|
1165
|
+
* the badge, so failing to read it cannot make the badge incomplete.
|
|
1166
|
+
*/
|
|
1167
|
+
function composeSwitchedOff(input) {
|
|
1168
|
+
const switchedOff = [];
|
|
1169
|
+
const unreadable = [];
|
|
1170
|
+
for (const id of CAMERA_SWITCH_ORDER) {
|
|
1171
|
+
const descriptor = CAMERA_SWITCH_CATALOG[id];
|
|
1172
|
+
if (!descriptor.countsAsSwitchedOff) continue;
|
|
1173
|
+
const state = resolveState(descriptor, input);
|
|
1174
|
+
if (state.unavailableReason === "source-unreachable") unreadable.push(id);
|
|
1175
|
+
else if (state.available && !state.enabled) switchedOff.push(id);
|
|
1176
|
+
}
|
|
1177
|
+
return {
|
|
1178
|
+
switchedOff,
|
|
1179
|
+
unreadable
|
|
1180
|
+
};
|
|
1181
|
+
}
|
|
1123
1182
|
//#endregion
|
|
1124
1183
|
//#region src/interfaces/device-capabilities/camera.ts
|
|
1125
1184
|
/** Friendly display labels for stream quality IDs. */
|
|
@@ -16813,9 +16872,16 @@ var CameraStatusSchema = zod.z.object({
|
|
|
16813
16872
|
audio: CameraAudioStatusSchema.nullable(),
|
|
16814
16873
|
recording: CameraRecordingStatusSchema.nullable(),
|
|
16815
16874
|
/**
|
|
16816
|
-
* Per-camera
|
|
16875
|
+
* Per-camera functions an OPERATOR has turned off
|
|
16817
16876
|
* ([D61](../../../../docs/decisions/adr-0067.md)).
|
|
16818
16877
|
*
|
|
16878
|
+
* Composed from the AUTHORITIES themselves — the wrapper bindings,
|
|
16879
|
+
* `RecordingConfig.enabled`, the notification mute, the broker's audio
|
|
16880
|
+
* policy, the camera's own microphone — via `composeSwitchedOff`, not from
|
|
16881
|
+
* the deprecated `getCameraSwitches` group ([D113](../../../../docs/decisions/adr-0113.md)).
|
|
16882
|
+
* The badge outlives the control panel: the panel was a convenience, this is
|
|
16883
|
+
* the difference between a camera being off and a camera being dead.
|
|
16884
|
+
*
|
|
16819
16885
|
* This is the difference between DISABLED and BROKEN. A camera whose
|
|
16820
16886
|
* `detection` block reports zero fps and whose `switchedOff` contains
|
|
16821
16887
|
* `'object-detection'` was switched off by a person; the same camera with an
|
|
@@ -17254,6 +17320,10 @@ var pipelineOrchestratorCapability = {
|
|
|
17254
17320
|
agentNodeId: zod.z.string().optional()
|
|
17255
17321
|
}), CameraPipelineConfigSchema),
|
|
17256
17322
|
/**
|
|
17323
|
+
* @deprecated The aggregate switch group is being withdrawn
|
|
17324
|
+
* ([D113](../../../../docs/decisions/adr-0113.md)). Build nothing new on
|
|
17325
|
+
* this pair; read the authority directly.
|
|
17326
|
+
*
|
|
17257
17327
|
* The whole per-camera function switch group, DERIVED — never a stored
|
|
17258
17328
|
* list ([D61](../../../../docs/decisions/adr-0067.md)).
|
|
17259
17329
|
*
|
|
@@ -17267,9 +17337,23 @@ var pipelineOrchestratorCapability = {
|
|
|
17267
17337
|
* `auth: 'view'` deliberately — a NON-admin must be able to see that a
|
|
17268
17338
|
* camera is quiet because somebody switched it off. Only the mutation is
|
|
17269
17339
|
* admin-gated.
|
|
17340
|
+
*
|
|
17341
|
+
* **Removal plan.** It stays and it KEEPS WORKING while shipped viewers
|
|
17342
|
+
* (v1.0.305) and the admin UI still call it — removing it now is a broken
|
|
17343
|
+
* app on a device nobody can redeploy from here. It is served by a thin
|
|
17344
|
+
* shim over the same authorities (`camera-switch-service.ts`), so the
|
|
17345
|
+
* behaviour of the pair is the behaviour of the authorities by
|
|
17346
|
+
* construction. It is deleted once every surface reaches its own
|
|
17347
|
+
* component's options and the last caller is gone. Nothing on this server
|
|
17348
|
+
* reads it: `CameraStatus.switchedOff` is composed from the authorities
|
|
17349
|
+
* directly via `composeSwitchedOff`.
|
|
17270
17350
|
*/
|
|
17271
17351
|
getCameraSwitches: require_sleep.method(zod.z.object({ deviceId: zod.z.number() }), CameraSwitchGroupSchema),
|
|
17272
17352
|
/**
|
|
17353
|
+
* @deprecated See {@link getCameraSwitches}. Write the authority — the
|
|
17354
|
+
* wrapper binding, `RecordingConfig.enabled`, the notification mute — not
|
|
17355
|
+
* this ([D113](../../../../docs/decisions/adr-0113.md)).
|
|
17356
|
+
*
|
|
17273
17357
|
* Flip ONE switch, routed to its existing authority.
|
|
17274
17358
|
*
|
|
17275
17359
|
* Never writes a parallel map: `recording` patches `RecordingConfig.enabled`
|
|
@@ -17815,24 +17899,28 @@ var snapshotCapability = {
|
|
|
17815
17899
|
*
|
|
17816
17900
|
* `getSnapshotOverview` is cache-only by contract: it answers from whatever
|
|
17817
17901
|
* the wrapper happens to hold and never captures. Under D93 the client
|
|
17818
|
-
* versions its image URL on that answer, and an image REQUEST
|
|
17819
|
-
*
|
|
17820
|
-
*
|
|
17821
|
-
*
|
|
17822
|
-
*
|
|
17823
|
-
*
|
|
17824
|
-
*
|
|
17825
|
-
*
|
|
17902
|
+
* versions its image URL on that answer, and an image REQUEST was the only
|
|
17903
|
+
* demand signal. Both of those are satisfiable by the client's own image
|
|
17904
|
+
* cache — `expo-image` is URL-keyed and never revalidates — so a URL painted
|
|
17905
|
+
* in a previous session comes off disk with no network, no demand, and no
|
|
17906
|
+
* capture. Measured on the live hub: reopening after two minutes idle
|
|
17907
|
+
* painted 15 of 16 tiles at **168 s old** with zero HTTP requests, and the
|
|
17908
|
+
* fleet only recovered because a later poll happened to observe a different
|
|
17909
|
+
* identity.
|
|
17826
17910
|
*
|
|
17827
17911
|
* ## The two properties that fix it
|
|
17828
17912
|
*
|
|
17829
17913
|
* **It is an RPC, so no client cache can answer it.** The demand signal
|
|
17830
|
-
* always reaches the wrapper. This method therefore
|
|
17831
|
-
*
|
|
17832
|
-
*
|
|
17833
|
-
*
|
|
17834
|
-
*
|
|
17835
|
-
*
|
|
17914
|
+
* always reaches the wrapper. This method therefore CAPTURES, where
|
|
17915
|
+
* `getSnapshotOverview` must never (D93) — the distinction is not "one is
|
|
17916
|
+
* newer" but that the overview poll is app-wide (a capturing overview would
|
|
17917
|
+
* dial every camera on the install) while this is called by a rendered
|
|
17918
|
+
* surface naming the tiles it is actually painting, at the width it is
|
|
17919
|
+
* painting them.
|
|
17920
|
+
*
|
|
17921
|
+
* Since 2026-08-11 this is the ONLY thing that refreshes a snapshot: the
|
|
17922
|
+
* server-side keep-warm loop was removed (operator directive — on-demand,
|
|
17923
|
+
* always), so a camera nobody is looking at costs nothing at all.
|
|
17836
17924
|
*
|
|
17837
17925
|
* **It waits, briefly and boundedly, for the capture it triggered.** The
|
|
17838
17926
|
* returned `capturedAt` is the frame the link will serve, not the frame the
|
|
@@ -25809,10 +25897,52 @@ var recordingCapability = {
|
|
|
25809
25897
|
*/
|
|
25810
25898
|
/** Playback-speed multiplier for the render (1 = realtime). */
|
|
25811
25899
|
var ExportSpeedSchema = zod.z.number().min(.25).max(32);
|
|
25900
|
+
/**
|
|
25901
|
+
* One dense interval, in SECONDS FROM THE EXPORT'S OWN `fromMs`.
|
|
25902
|
+
*
|
|
25903
|
+
* Relative and not absolute epoch on purpose: the renderer's frame-select
|
|
25904
|
+
* expression sees ffmpeg's `t`, which starts at 0 for the export's source
|
|
25905
|
+
* playlist. Handing it absolute epochs would make every call site responsible
|
|
25906
|
+
* for the same subtraction, and the one that forgot would emit a filter that
|
|
25907
|
+
* selects nothing — silently, as a uniform timelapse.
|
|
25908
|
+
*/
|
|
25909
|
+
var ExportDenseRangeSchema = zod.z.object({
|
|
25910
|
+
fromSec: zod.z.number().nonnegative(),
|
|
25911
|
+
toSec: zod.z.number().nonnegative()
|
|
25912
|
+
}).refine((r) => r.toSec > r.fromSec, { message: "dense range must have toSec > fromSec" });
|
|
25913
|
+
/**
|
|
25914
|
+
* Hard ceiling on dense ranges in ONE render.
|
|
25915
|
+
*
|
|
25916
|
+
* The ranges become terms of a single ffmpeg `select` expression, so the count
|
|
25917
|
+
* is the length of a command-line argument. The producer (the timelapse
|
|
25918
|
+
* scheduler) coalesces and then falls back to the base cadence alone rather
|
|
25919
|
+
* than trimming — a truncated range list is a video that quietly omits the
|
|
25920
|
+
* evening.
|
|
25921
|
+
*/
|
|
25922
|
+
var EXPORT_DENSE_MAX_RANGES = 200;
|
|
25923
|
+
/**
|
|
25924
|
+
* Dense-interval overlay for a timelapse: sample at `dense.everyMs` INSIDE the
|
|
25925
|
+
* listed ranges and at the base `everyMs` everywhere else.
|
|
25926
|
+
*
|
|
25927
|
+
* `everyMs` must be strictly smaller than the base cadence — a dense rate that
|
|
25928
|
+
* is not denser renders a uniform timelapse the operator believes is two-rate.
|
|
25929
|
+
*/
|
|
25930
|
+
var ExportDenseSchema = zod.z.object({
|
|
25931
|
+
everyMs: zod.z.number().int().positive(),
|
|
25932
|
+
ranges: zod.z.array(ExportDenseRangeSchema).min(1).max(200)
|
|
25933
|
+
});
|
|
25812
25934
|
/** Timelapse cadence — sample one source frame per `everyMs`, output at `outputFps`. */
|
|
25813
25935
|
var ExportTimelapseSchema = zod.z.object({
|
|
25814
25936
|
everyMs: zod.z.number().int().positive(),
|
|
25815
|
-
outputFps: zod.z.number().int().min(1).max(60).optional()
|
|
25937
|
+
outputFps: zod.z.number().int().min(1).max(60).optional(),
|
|
25938
|
+
/** Optional second, FASTER rate over the intervals that matter. */
|
|
25939
|
+
dense: ExportDenseSchema.optional()
|
|
25940
|
+
}).superRefine((v, ctx) => {
|
|
25941
|
+
if (v.dense !== void 0 && v.dense.everyMs >= v.everyMs) ctx.addIssue({
|
|
25942
|
+
code: zod.z.ZodIssueCode.custom,
|
|
25943
|
+
message: "dense.everyMs must be strictly smaller than the base everyMs",
|
|
25944
|
+
path: ["dense", "everyMs"]
|
|
25945
|
+
});
|
|
25816
25946
|
});
|
|
25817
25947
|
/**
|
|
25818
25948
|
* Render options. `speed` and `timelapse` are mutually exclusive. `includeAudio`
|
|
@@ -25870,6 +26000,38 @@ var ExportDownloadSchema = zod.z.object({
|
|
|
25870
26000
|
url: zod.z.string(),
|
|
25871
26001
|
endpoints: zod.z.array(zod.z.string())
|
|
25872
26002
|
});
|
|
26003
|
+
/**
|
|
26004
|
+
* Hard ceiling on ONE {@link recordingExportCapability} byte read — 50 MiB.
|
|
26005
|
+
*
|
|
26006
|
+
* Two independent reasons land on the same number, which is why it is this one
|
|
26007
|
+
* and not a rounder guess:
|
|
26008
|
+
*
|
|
26009
|
+
* - **Nobody would accept more.** The roomiest byte cap any notifier backend
|
|
26010
|
+
* declares is telegram's 50 MiB, and the degrade engine DROPS an over-cap
|
|
26011
|
+
* attachment outright rather than degrading it to a link. Bytes above this
|
|
26012
|
+
* are read, encoded and moved to be thrown away at the last step.
|
|
26013
|
+
* - **The envelope is unary.** A base64 payload is held whole, ~1.33× its
|
|
26014
|
+
* size, in the provider AND in the caller — on a hub this repo has already
|
|
26015
|
+
* OOM'd once (D9/D18). A bounded on-demand read at human speed is the shape
|
|
26016
|
+
* those records permit; an unbounded one is the shape they forbid.
|
|
26017
|
+
*
|
|
26018
|
+
* Above it the provider REFUSES with a log line rather than truncating: half a
|
|
26019
|
+
* video is worse than a notification that says there is no attachment.
|
|
26020
|
+
*/
|
|
26021
|
+
var RECORDING_EXPORT_MAX_READ_BYTES = 50 * 1024 * 1024;
|
|
26022
|
+
/**
|
|
26023
|
+
* A finished export's bytes, inline.
|
|
26024
|
+
*
|
|
26025
|
+
* `bytes` is the DECODED length — the number the caller bounds and logs
|
|
26026
|
+
* against, so nobody has to infer it from the base64 length.
|
|
26027
|
+
*/
|
|
26028
|
+
var ExportBytesSchema = zod.z.object({
|
|
26029
|
+
base64: zod.z.string(),
|
|
26030
|
+
contentType: zod.z.string(),
|
|
26031
|
+
/** Suggested filename, extension included. */
|
|
26032
|
+
name: zod.z.string(),
|
|
26033
|
+
bytes: zod.z.number().int().nonnegative()
|
|
26034
|
+
});
|
|
25873
26035
|
var recordingExportCapability = {
|
|
25874
26036
|
name: "recordingExport",
|
|
25875
26037
|
scope: "system",
|
|
@@ -25909,6 +26071,27 @@ var recordingExportCapability = {
|
|
|
25909
26071
|
getDownloadUrl: require_sleep.method(zod.z.object({ exportId: zod.z.string() }), ExportDownloadSchema, {
|
|
25910
26072
|
kind: "query",
|
|
25911
26073
|
auth: "protected"
|
|
26074
|
+
}),
|
|
26075
|
+
/**
|
|
26076
|
+
* The finished file's BYTES, base64, for a caller that must republish them
|
|
26077
|
+
* somewhere a session-less fetcher can reach.
|
|
26078
|
+
*
|
|
26079
|
+
* `getDownloadUrl` is the right answer for a human: the download route is
|
|
26080
|
+
* served `access: 'authenticated'`, which a browser satisfies and a
|
|
26081
|
+
* notifier BACKEND does not. It answers a RELATIVE path, so it is not even
|
|
26082
|
+
* a URL an outside fetcher could try. This method exists for the one case
|
|
26083
|
+
* that needs the other thing — a scheduled timelapse whose video has to
|
|
26084
|
+
* become a public attachment on the notification artifact plane.
|
|
26085
|
+
*
|
|
26086
|
+
* Deliberately narrow: `ready` only (a queued, rendering, failed, expired
|
|
26087
|
+
* or deleted export has no file, and answering "0 bytes" for one is how a
|
|
26088
|
+
* caller ships an empty attachment), still inside its lifetime, and under
|
|
26089
|
+
* {@link RECORDING_EXPORT_MAX_READ_BYTES}. Every refusal throws with the
|
|
26090
|
+
* reason — none of them is silent.
|
|
26091
|
+
*/
|
|
26092
|
+
readExportBytes: require_sleep.method(zod.z.object({ exportId: zod.z.string() }), ExportBytesSchema, {
|
|
26093
|
+
kind: "query",
|
|
26094
|
+
auth: "protected"
|
|
25912
26095
|
})
|
|
25913
26096
|
}
|
|
25914
26097
|
};
|
|
@@ -29148,9 +29331,10 @@ var DeclaredDevices = class {
|
|
|
29148
29331
|
}
|
|
29149
29332
|
const integrationId = spec.integrationId ?? await this.ensureIntegration(spec.integrationName);
|
|
29150
29333
|
const index = await this.readIndex();
|
|
29334
|
+
const live = await this.readLiveByStableId();
|
|
29151
29335
|
const outcomes = [];
|
|
29152
29336
|
for (const declaration of spec.devices) {
|
|
29153
|
-
const outcome = await this.applyDeclaration(declaration, integrationId, index);
|
|
29337
|
+
const outcome = await this.applyDeclaration(declaration, integrationId, index, live);
|
|
29154
29338
|
if (outcome !== null) outcomes.push(outcome);
|
|
29155
29339
|
}
|
|
29156
29340
|
return {
|
|
@@ -29196,6 +29380,26 @@ var DeclaredDevices = class {
|
|
|
29196
29380
|
return new Map(rows.map((row) => [row.stableId, row]));
|
|
29197
29381
|
}
|
|
29198
29382
|
/**
|
|
29383
|
+
* Devices this kernel already has CONSTRUCTED, by stableId.
|
|
29384
|
+
*
|
|
29385
|
+
* Distinct from {@link readIndex}, and the distinction is the bug: the index
|
|
29386
|
+
* is persisted rows, this is live objects. A row without an object must be
|
|
29387
|
+
* adopted; an object must be left exactly as it is.
|
|
29388
|
+
*
|
|
29389
|
+
* Failure is non-fatal and deliberately so — an empty map degrades to the
|
|
29390
|
+
* previous behaviour (attempt the adopt) rather than skipping a device that
|
|
29391
|
+
* genuinely needs bringing up.
|
|
29392
|
+
*/
|
|
29393
|
+
async readLiveByStableId() {
|
|
29394
|
+
try {
|
|
29395
|
+
const devices = await this.ports.devices.getAll();
|
|
29396
|
+
return new Map(devices.map((device) => [device.stableId, device]));
|
|
29397
|
+
} catch (err) {
|
|
29398
|
+
this.ports.logger.warn("could not read live devices — falling back to adopt-by-row", { meta: { error: err instanceof Error ? err.message : String(err) } });
|
|
29399
|
+
return /* @__PURE__ */ new Map();
|
|
29400
|
+
}
|
|
29401
|
+
}
|
|
29402
|
+
/**
|
|
29199
29403
|
* One declaration: adopt what exists, create what does not.
|
|
29200
29404
|
*
|
|
29201
29405
|
* The create branch is the destructive one — it seeds `initialMeta`, and
|
|
@@ -29204,8 +29408,15 @@ var DeclaredDevices = class {
|
|
|
29204
29408
|
* the declared name over the operator's rename. D49: that branch needs a
|
|
29205
29409
|
* second read to agree.
|
|
29206
29410
|
*/
|
|
29207
|
-
async applyDeclaration(declaration, integrationId, index) {
|
|
29411
|
+
async applyDeclaration(declaration, integrationId, index, live) {
|
|
29208
29412
|
try {
|
|
29413
|
+
const alreadyLive = live.get(declaration.stableId);
|
|
29414
|
+
if (alreadyLive !== void 0) return {
|
|
29415
|
+
stableId: declaration.stableId,
|
|
29416
|
+
deviceId: alreadyLive.id,
|
|
29417
|
+
device: alreadyLive,
|
|
29418
|
+
created: false
|
|
29419
|
+
};
|
|
29209
29420
|
let existing = index.get(declaration.stableId);
|
|
29210
29421
|
if (existing === void 0) {
|
|
29211
29422
|
existing = (await this.readIndex()).get(declaration.stableId);
|
|
@@ -35774,6 +35985,12 @@ var METHOD_ACCESS_MAP = Object.freeze({
|
|
|
35774
35985
|
addonId: null,
|
|
35775
35986
|
access: "view"
|
|
35776
35987
|
},
|
|
35988
|
+
"recordingExport.readExportBytes": {
|
|
35989
|
+
capName: "recordingExport",
|
|
35990
|
+
capScope: "system",
|
|
35991
|
+
addonId: null,
|
|
35992
|
+
access: "view"
|
|
35993
|
+
},
|
|
35777
35994
|
"sceneMonitor.captureReference": {
|
|
35778
35995
|
capName: "scene-monitor",
|
|
35779
35996
|
capScope: "device",
|
|
@@ -37905,7 +38122,8 @@ function createSystemProxy(api) {
|
|
|
37905
38122
|
getExport: (input) => dispatch("recordingExport", "getExport", "query", input),
|
|
37906
38123
|
cancelExport: (input) => dispatch("recordingExport", "cancelExport", "mutation", input),
|
|
37907
38124
|
deleteExport: (input) => dispatch("recordingExport", "deleteExport", "mutation", input),
|
|
37908
|
-
getDownloadUrl: (input) => dispatch("recordingExport", "getDownloadUrl", "query", input)
|
|
38125
|
+
getDownloadUrl: (input) => dispatch("recordingExport", "getDownloadUrl", "query", input),
|
|
38126
|
+
readExportBytes: (input) => dispatch("recordingExport", "readExportBytes", "query", input)
|
|
37909
38127
|
},
|
|
37910
38128
|
serverManagement: {
|
|
37911
38129
|
getServerPackageStatus: (input) => dispatch("serverManagement", "getServerPackageStatus", "query", input),
|
|
@@ -38522,15 +38740,50 @@ var TimelapseRuleSchema = TimelapseRuleInputSchema.extend({
|
|
|
38522
38740
|
*/
|
|
38523
38741
|
ownerUserId: zod.z.string().optional(),
|
|
38524
38742
|
/**
|
|
38525
|
-
* Epoch-ms of the
|
|
38526
|
-
*
|
|
38743
|
+
* Epoch-ms of the NEWEST successful generation across every camera of this
|
|
38744
|
+
* rule. What a UI shows, and the compatibility floor for
|
|
38745
|
+
* {@link readTimelapseGeneratedAt}. Absent = never generated.
|
|
38527
38746
|
*/
|
|
38528
38747
|
lastGeneratedAt: zod.z.number().optional(),
|
|
38748
|
+
/**
|
|
38749
|
+
* PER-CAMERA generation state, keyed by `String(deviceId)` — the
|
|
38750
|
+
* re-generation guard's real durable state.
|
|
38751
|
+
*
|
|
38752
|
+
* One rule covers several cameras and each renders its own video, so a rule
|
|
38753
|
+
* -wide stamp is wrong in the direction that DESTROYS work: camera A
|
|
38754
|
+
* succeeding at 06:05 tells camera B, whose render failed, that it is
|
|
38755
|
+
* already done — and B's night is gone for good, because the window will not
|
|
38756
|
+
* come back.
|
|
38757
|
+
*
|
|
38758
|
+
* ADDITIVE, so the migration is free: a row written before this field simply
|
|
38759
|
+
* has no map, and {@link readTimelapseGeneratedAt} falls back to
|
|
38760
|
+
* {@link TimelapseRuleSchema.shape.lastGeneratedAt}. Reading an old row as
|
|
38761
|
+
* "never generated" would re-render and re-notify every camera of every rule
|
|
38762
|
+
* once, on the deploy that shipped the map.
|
|
38763
|
+
*/
|
|
38764
|
+
generatedByDevice: zod.z.record(zod.z.string(), zod.z.number()).optional(),
|
|
38529
38765
|
/** userId of the caller who created the rule (server-stamped). */
|
|
38530
38766
|
createdBy: zod.z.string(),
|
|
38531
38767
|
createdAt: zod.z.number(),
|
|
38532
38768
|
updatedAt: zod.z.number()
|
|
38533
38769
|
});
|
|
38770
|
+
/**
|
|
38771
|
+
* The last successful generation for ONE camera of a rule, epoch-ms.
|
|
38772
|
+
*
|
|
38773
|
+
* The per-device map wins; a rule with no map falls back to the rule-wide
|
|
38774
|
+
* `lastGeneratedAt` (the compatible-migration path — see
|
|
38775
|
+
* {@link TimelapseRuleSchema}); a rule with neither returns 0, which every
|
|
38776
|
+
* guard reads as "never generated".
|
|
38777
|
+
*
|
|
38778
|
+
* Read through this helper and never off the field directly: the fallback is
|
|
38779
|
+
* the whole migration, and a call site that forgot it would re-render an
|
|
38780
|
+
* entire rule set once.
|
|
38781
|
+
*/
|
|
38782
|
+
function readTimelapseGeneratedAt(rule, deviceId) {
|
|
38783
|
+
const map = rule.generatedByDevice;
|
|
38784
|
+
if (map !== void 0) return map[String(deviceId)] ?? 0;
|
|
38785
|
+
return rule.lastGeneratedAt ?? 0;
|
|
38786
|
+
}
|
|
38534
38787
|
//#endregion
|
|
38535
38788
|
//#region src/pipeline/detail-crop.ts
|
|
38536
38789
|
/**
|
|
@@ -40534,6 +40787,7 @@ exports.EVENTFUL_CAP_NAMES = EVENTFUL_CAP_NAMES;
|
|
|
40534
40787
|
exports.EVENT_KIND_BY_CAP = EVENT_KIND_BY_CAP;
|
|
40535
40788
|
exports.EVENT_PAD_MS = EVENT_PAD_MS;
|
|
40536
40789
|
exports.EVENT_TAXONOMY = EVENT_TAXONOMY;
|
|
40790
|
+
exports.EXPORT_DENSE_MAX_RANGES = EXPORT_DENSE_MAX_RANGES;
|
|
40537
40791
|
exports.EXPRESSION_BUILTINS = EXPRESSION_BUILTINS;
|
|
40538
40792
|
exports.EXPRESSION_BUILTIN_NAMES = EXPRESSION_BUILTIN_NAMES;
|
|
40539
40793
|
exports.EXPRESSION_COMPILE_CACHE_CAPACITY = EXPRESSION_COMPILE_CACHE_CAPACITY;
|
|
@@ -40565,6 +40819,9 @@ exports.EventMediaCoverageSchema = EventMediaCoverageSchema;
|
|
|
40565
40819
|
exports.EventMediaKindSchema = EventMediaKindSchema;
|
|
40566
40820
|
exports.EventMediaProductionSchema = EventMediaProductionSchema;
|
|
40567
40821
|
exports.EventSourceType = require_enums.EventSourceType$1;
|
|
40822
|
+
exports.ExportBytesSchema = ExportBytesSchema;
|
|
40823
|
+
exports.ExportDenseRangeSchema = ExportDenseRangeSchema;
|
|
40824
|
+
exports.ExportDenseSchema = ExportDenseSchema;
|
|
40568
40825
|
exports.ExportDownloadSchema = ExportDownloadSchema;
|
|
40569
40826
|
exports.ExportOptionsSchema = ExportOptionsSchema;
|
|
40570
40827
|
exports.ExportRecordSchema = ExportRecordSchema;
|
|
@@ -40863,6 +41120,7 @@ exports.REACHABILITY_FAILURES_TO_OFFLINE = REACHABILITY_FAILURES_TO_OFFLINE;
|
|
|
40863
41120
|
exports.REACHABILITY_POLL_INTERVAL_MS = REACHABILITY_POLL_INTERVAL_MS;
|
|
40864
41121
|
exports.REACHABILITY_PROBE_TIMEOUT_MS = REACHABILITY_PROBE_TIMEOUT_MS;
|
|
40865
41122
|
exports.RECOGNITION_TYPES = RECOGNITION_TYPES;
|
|
41123
|
+
exports.RECORDING_EXPORT_MAX_READ_BYTES = RECORDING_EXPORT_MAX_READ_BYTES;
|
|
40866
41124
|
exports.RESERVED_BINDING_NAMES = RESERVED_BINDING_NAMES;
|
|
40867
41125
|
exports.RUNTIME_DEFAULTS = RUNTIME_DEFAULTS;
|
|
40868
41126
|
exports.RUNTIME_TO_FORMAT = RUNTIME_TO_FORMAT;
|
|
@@ -41169,6 +41427,7 @@ exports.colorCapability = colorCapability;
|
|
|
41169
41427
|
exports.colorForKind = colorForKind;
|
|
41170
41428
|
exports.compileExpression = compileExpression;
|
|
41171
41429
|
exports.compileExpressionSafe = compileExpressionSafe;
|
|
41430
|
+
exports.composeSwitchedOff = composeSwitchedOff;
|
|
41172
41431
|
exports.conditionDepth = conditionDepth;
|
|
41173
41432
|
exports.connectionTestCapability = connectionTestCapability;
|
|
41174
41433
|
exports.connectivityCapability = connectivityCapability;
|
|
@@ -41365,6 +41624,7 @@ exports.readDetailCropConvention = readDetailCropConvention;
|
|
|
41365
41624
|
exports.readDeviceStateFrom = readDeviceStateFrom;
|
|
41366
41625
|
exports.readNativeLeaseOverride = readNativeLeaseOverride;
|
|
41367
41626
|
exports.readNodePin = require_sleep.readNodePin;
|
|
41627
|
+
exports.readTimelapseGeneratedAt = readTimelapseGeneratedAt;
|
|
41368
41628
|
exports.readinessKey = require_sleep.readinessKey;
|
|
41369
41629
|
exports.rebootCapability = rebootCapability;
|
|
41370
41630
|
exports.recordingCapability = recordingCapability;
|