@camstack/addon-export-hap 1.2.90 → 1.2.91
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/hap-export.addon.js +608 -473
- package/dist/hap-export.addon.mjs +608 -473
- package/package.json +1 -1
|
@@ -72,7 +72,7 @@ function carryForward(base, existing, keys) {
|
|
|
72
72
|
return out;
|
|
73
73
|
}
|
|
74
74
|
//#endregion
|
|
75
|
-
//#region ../types/dist/event-category-
|
|
75
|
+
//#region ../types/dist/event-category-CnLqLOKs.mjs
|
|
76
76
|
var EventCategory = /* @__PURE__ */ function(EventCategory) {
|
|
77
77
|
EventCategory["SystemBoot"] = "system.boot";
|
|
78
78
|
EventCategory["SystemAddonsReady"] = "system.addons-ready";
|
|
@@ -267,6 +267,19 @@ var EventCategory = /* @__PURE__ */ function(EventCategory) {
|
|
|
267
267
|
EventCategory["ProcessCrashed"] = "process.crashed";
|
|
268
268
|
EventCategory["ProcessRestartScheduled"] = "process.restart_scheduled";
|
|
269
269
|
EventCategory["ProcessRestarted"] = "process.restarted";
|
|
270
|
+
/**
|
|
271
|
+
* The SET of storage locations changed — one was created, edited, enabled,
|
|
272
|
+
* disabled or deleted through `storage.upsertLocation` / `deleteLocation`.
|
|
273
|
+
*
|
|
274
|
+
* Telemetry, not a transaction (D8/D11): every consumer that re-resolves on
|
|
275
|
+
* it must also converge on its own periodic path, because a dropped event
|
|
276
|
+
* must not leave a node writing to yesterday's disk set forever. It exists
|
|
277
|
+
* because there was NO signal at all — an operator who added a second
|
|
278
|
+
* recordings disk in the admin UI got nothing, and the recorder kept its
|
|
279
|
+
* resolved locations until something else happened to re-resolve them
|
|
280
|
+
* (D387). Payload `StorageLocationsChangedPayload`.
|
|
281
|
+
*/
|
|
282
|
+
EventCategory["StorageLocationsChanged"] = "storage.locations-changed";
|
|
270
283
|
EventCategory["RecordingStarted"] = "recording.started";
|
|
271
284
|
EventCategory["RecordingStopped"] = "recording.stopped";
|
|
272
285
|
EventCategory["RecordingError"] = "recording.error";
|
|
@@ -9190,6 +9203,21 @@ var StorageCleanupJobSchema = object({
|
|
|
9190
9203
|
});
|
|
9191
9204
|
var StorageCleanupStatusInputSchema = object({ jobId: string().optional() });
|
|
9192
9205
|
/**
|
|
9206
|
+
* The one typed state of a storage location. Authoritative Zod schema — the TS
|
|
9207
|
+
* alias below is `z.infer<>` of it, never a second spelling.
|
|
9208
|
+
*/
|
|
9209
|
+
var StorageLocationModeSchema = _enum([
|
|
9210
|
+
"active",
|
|
9211
|
+
"readonly",
|
|
9212
|
+
"drain",
|
|
9213
|
+
"disabled"
|
|
9214
|
+
]);
|
|
9215
|
+
_enum([
|
|
9216
|
+
"normal",
|
|
9217
|
+
"never",
|
|
9218
|
+
"drain"
|
|
9219
|
+
]);
|
|
9220
|
+
/**
|
|
9193
9221
|
* `StorageLocationType` — an addon-declared id that identifies the *kind* of
|
|
9194
9222
|
* storage a location serves. Defined here (not in `capabilities/storage.cap.ts`)
|
|
9195
9223
|
* so the persisted record schema and the consumer-facing cap can both consume it
|
|
@@ -9255,6 +9283,21 @@ var StorageLocationSchema = object({
|
|
|
9255
9283
|
* stops existing rather than being re-derived on every read.
|
|
9256
9284
|
*/
|
|
9257
9285
|
enabled: boolean().optional(),
|
|
9286
|
+
/**
|
|
9287
|
+
* THE state of this location (D385), and the only authority on what may be
|
|
9288
|
+
* written, read or evicted here. Interpreted in exactly one place —
|
|
9289
|
+
* `storage-location-mode.ts` — which also folds the legacy
|
|
9290
|
+
* `enabled` / `config.readOnly` pair into a mode so an old row is never
|
|
9291
|
+
* ambiguous.
|
|
9292
|
+
*
|
|
9293
|
+
* OPTIONAL only for the wire and for rows written before D385: absence is
|
|
9294
|
+
* resolved by `resolveLocationMode`, and the orchestrator stamps every
|
|
9295
|
+
* unstamped row ONCE at hydrate so absence stops existing rather than being
|
|
9296
|
+
* re-derived on every read. `enabled` survives one release as a DERIVED
|
|
9297
|
+
* mirror (`mode === 'active'`); `withLocationMode` is the only writer of
|
|
9298
|
+
* either, so the two cannot disagree.
|
|
9299
|
+
*/
|
|
9300
|
+
mode: StorageLocationModeSchema.optional(),
|
|
9258
9301
|
/** COMPUTED at read time by the orchestrator (statfs of the backing volume
|
|
9259
9302
|
* for node-local locations it can reach) — never persisted, absent when the
|
|
9260
9303
|
* volume is remote/unreachable. The single capacity truth every UI reads. */
|
|
@@ -9262,11 +9305,46 @@ var StorageLocationSchema = object({
|
|
|
9262
9305
|
totalBytes: number(),
|
|
9263
9306
|
availableBytes: number()
|
|
9264
9307
|
}).nullable().optional(),
|
|
9308
|
+
/**
|
|
9309
|
+
* How much of that volume CamStack ITSELF holds on this location (D388) —
|
|
9310
|
+
* COMPUTED at read time from the `storage-occupancy` providers' own figures,
|
|
9311
|
+
* never persisted, never a filesystem walk.
|
|
9312
|
+
*
|
|
9313
|
+
* **ABSENT MEANS UNKNOWN, never zero.** No provider has reported for this
|
|
9314
|
+
* location yet — nobody stores here, the owning addon is down, or the first
|
|
9315
|
+
* refresh has not completed. A UI must omit the segment rather than draw it
|
|
9316
|
+
* at zero, which would claim we occupy nothing (D315). It is an OBJECT and
|
|
9317
|
+
* not a bare number precisely so that a `?? 0` on the consuming side has to
|
|
9318
|
+
* be spelled out loud instead of appearing by accident.
|
|
9319
|
+
*
|
|
9320
|
+
* `measuredAtMs` is the OLDEST contributing measurement, so it is honest
|
|
9321
|
+
* about the whole figure rather than about its freshest part.
|
|
9322
|
+
*/
|
|
9323
|
+
owned: object({
|
|
9324
|
+
bytes: number().int().nonnegative(),
|
|
9325
|
+
measuredAtMs: number().int().nonnegative()
|
|
9326
|
+
}).optional(),
|
|
9265
9327
|
createdAt: number(),
|
|
9266
9328
|
updatedAt: number()
|
|
9267
9329
|
});
|
|
9268
9330
|
object({ isDefault: boolean().optional() });
|
|
9269
9331
|
/**
|
|
9332
|
+
* How far a `drain` has got (D386) — the read a UI renders, and nothing more.
|
|
9333
|
+
*
|
|
9334
|
+
* `estimatedEmptyAtMs` is derived from the growth the ratchet has actually
|
|
9335
|
+
* OBSERVED and is `null` when it has observed none. Never a fabricated date: a
|
|
9336
|
+
* drain with no observed growth has no honest ETA, and inventing one is how an
|
|
9337
|
+
* operator learns not to believe the screen.
|
|
9338
|
+
*/
|
|
9339
|
+
var StorageDrainProgressSchema = object({
|
|
9340
|
+
locationId: string(),
|
|
9341
|
+
startedAtMs: number(),
|
|
9342
|
+
startBytes: number(),
|
|
9343
|
+
bytesRemaining: number(),
|
|
9344
|
+
drained: boolean(),
|
|
9345
|
+
estimatedEmptyAtMs: number().nullable()
|
|
9346
|
+
});
|
|
9347
|
+
/**
|
|
9270
9348
|
* Reference accepted by consumer-facing `api.storage.*` calls.
|
|
9271
9349
|
* Either:
|
|
9272
9350
|
* - a `StorageLocationType` (e.g. `'backups'`) → the sole location of that type
|
|
@@ -22362,7 +22440,7 @@ method(object({
|
|
|
22362
22440
|
}), _void(), {
|
|
22363
22441
|
kind: "mutation",
|
|
22364
22442
|
auth: "admin"
|
|
22365
|
-
}), method(object({ id: string() }), object({
|
|
22443
|
+
}), method(_void(), array(StorageDrainProgressSchema).readonly()), method(object({ id: string() }), object({
|
|
22366
22444
|
ok: boolean(),
|
|
22367
22445
|
error: string().optional()
|
|
22368
22446
|
}), { auth: "admin" }), method(_void(), array(ProviderListEntrySchema).readonly()), method(object({
|
|
@@ -22432,6 +22510,51 @@ method(StorageMigrationInputSchema, StorageMigrationPlanSchema, { auth: "admin"
|
|
|
22432
22510
|
kind: "mutation",
|
|
22433
22511
|
auth: "admin"
|
|
22434
22512
|
}), method(object({}), array(StorageMigrationJobSchema).readonly(), { auth: "admin" });
|
|
22513
|
+
/**
|
|
22514
|
+
* `storage-occupancy` — how many bytes an addon actually HOLDS on a storage
|
|
22515
|
+
* location (D388).
|
|
22516
|
+
*
|
|
22517
|
+
* ## Why this is not `storage-evictable`
|
|
22518
|
+
*
|
|
22519
|
+
* `storage-evictable.getEvictableUsage` looks like the same question and is
|
|
22520
|
+
* not, in two ways that both matter and both bite hardest on the locations an
|
|
22521
|
+
* operator most wants a figure for:
|
|
22522
|
+
*
|
|
22523
|
+
* - it reports the whole eviction DOMAIN, not the location. `recordings:default`
|
|
22524
|
+
* and `recordingsLow:default` deliberately share one root and evict as one
|
|
22525
|
+
* oldest-first pool, so both answer with the SAME combined total. As an
|
|
22526
|
+
* occupancy figure that double-counts the disk.
|
|
22527
|
+
* - it reports ZERO for a location whose eviction policy is `never` (D385) —
|
|
22528
|
+
* a `readonly` or `disabled` disk. Those are exactly the disks an operator
|
|
22529
|
+
* is retiring and staring at.
|
|
22530
|
+
*
|
|
22531
|
+
* So this is its own contract with its own quantity, and the quantity is
|
|
22532
|
+
* OCCUPIED: every byte the addon holds on that location, whether or not it
|
|
22533
|
+
* would ever be willing to delete it. A provider that can only answer
|
|
22534
|
+
* "evictable" must not register here — a number that silently means different
|
|
22535
|
+
* things per class is worse than no number.
|
|
22536
|
+
*
|
|
22537
|
+
* ## Absence is an answer
|
|
22538
|
+
*
|
|
22539
|
+
* A location nobody reports for is UNKNOWN, never zero (D315). The orchestrator
|
|
22540
|
+
* stamps `StorageLocation.owned` only for locations it has a report for, and
|
|
22541
|
+
* the field is an OBJECT rather than a bare number so that a `?? 0` on the
|
|
22542
|
+
* consuming side has to be written out loud instead of appearing by accident.
|
|
22543
|
+
*
|
|
22544
|
+
* `internal: true` — consumed by the orchestrator's `listLocations` stamp, never
|
|
22545
|
+
* a public client surface. Clients read the stamped `StorageLocation.owned`.
|
|
22546
|
+
*/
|
|
22547
|
+
/** One provider's occupancy answer for one location. */
|
|
22548
|
+
var StorageOccupancyReportSchema = object({
|
|
22549
|
+
locationId: string(),
|
|
22550
|
+
/** Bytes this provider holds on THAT location — not its eviction domain, and
|
|
22551
|
+
* not net of what it is willing to delete. */
|
|
22552
|
+
ownedBytes: number().int().nonnegative(),
|
|
22553
|
+
/** When the provider last actually measured this. The orchestrator carries it
|
|
22554
|
+
* through so a UI can say how old the figure is instead of implying "now". */
|
|
22555
|
+
measuredAtMs: number().int().nonnegative()
|
|
22556
|
+
});
|
|
22557
|
+
method(object({ locationIds: array(string()).readonly() }), array(StorageOccupancyReportSchema).readonly(), { auth: "admin" });
|
|
22435
22558
|
var ProviderInfoSchema = discriminatedUnion("shouldSaveDiskSpace", [object({
|
|
22436
22559
|
providerId: string().min(1),
|
|
22437
22560
|
displayName: string().min(1),
|
|
@@ -24071,39 +24194,6 @@ DeviceType.Camera, DeviceType.Sensor, DeviceType.Button, DeviceType.Switch, meth
|
|
|
24071
24194
|
deviceId: number(),
|
|
24072
24195
|
status: BatteryStatusSchema
|
|
24073
24196
|
});
|
|
24074
|
-
/**
|
|
24075
|
-
* Network-link snapshot. Same shape for every provider (a Reolink wifi
|
|
24076
|
-
* camera, a Home Assistant device with a signal-strength sensor, a Tapo
|
|
24077
|
-
* plug): one slice under `device.runtimeState['network-link']`, one badge,
|
|
24078
|
-
* one Home Assistant projection.
|
|
24079
|
-
*/
|
|
24080
|
-
var NetworkLinkStatusSchema = object({
|
|
24081
|
-
/** The link the device is on. `'unknown'` = not read yet, not "no link". */
|
|
24082
|
-
type: _enum([
|
|
24083
|
-
"wifi",
|
|
24084
|
-
"ethernet",
|
|
24085
|
-
"cellular",
|
|
24086
|
-
"unknown"
|
|
24087
|
-
]),
|
|
24088
|
-
/**
|
|
24089
|
-
* Link quality, 0..100 inclusive, normalised by the provider from whatever
|
|
24090
|
-
* the firmware reports (bars, RSSI, a vendor scale). **`null` means NOT
|
|
24091
|
-
* KNOWN or NOT APPLICABLE** — a wired link has no signal, and a wireless
|
|
24092
|
-
* one whose reading has not landed must not be drawn at 0 %. Consumers
|
|
24093
|
-
* SKIP a null rather than coerce it.
|
|
24094
|
-
*/
|
|
24095
|
-
signalPercent: number().min(0).max(100).nullable(),
|
|
24096
|
-
/** Raw received signal strength in dBm, when the firmware reports one. */
|
|
24097
|
-
rssiDbm: number().optional(),
|
|
24098
|
-
/** Network name of a wireless link, when the firmware reports it. */
|
|
24099
|
-
ssid: string().optional(),
|
|
24100
|
-
/** Ms epoch of the last observation. Lets consumers reason about freshness. */
|
|
24101
|
-
lastUpdated: number()
|
|
24102
|
-
});
|
|
24103
|
-
DeviceType.Camera, DeviceType.Sensor, DeviceType.Button, DeviceType.Switch, DeviceType.Light, DeviceType.Lock, DeviceType.Siren, object({
|
|
24104
|
-
deviceId: number(),
|
|
24105
|
-
status: NetworkLinkStatusSchema
|
|
24106
|
-
});
|
|
24107
24197
|
object({
|
|
24108
24198
|
on: boolean(),
|
|
24109
24199
|
/** Ms epoch of the last transition. 0 if never observed. */
|
|
@@ -26501,6 +26591,236 @@ DeviceType.Camera, method(object({
|
|
|
26501
26591
|
detection: NativeDetectionSchema
|
|
26502
26592
|
});
|
|
26503
26593
|
/**
|
|
26594
|
+
* `navigation` — a device-scoped capability that natively expresses the FULL
|
|
26595
|
+
* navigation / action surface of a robot that DRIVES ITSELF and carries an
|
|
26596
|
+
* on-board camera (the Dreame robot-vacuum camera is the first provider).
|
|
26597
|
+
*
|
|
26598
|
+
* Why a NEW cap rather than overloading `ptz`:
|
|
26599
|
+
* - `ptz` moves a *gimbal* on a fixed camera (pan/tilt/zoom of the lens). A
|
|
26600
|
+
* robot vacuum has no gimbal — the whole chassis drives, turns and spins.
|
|
26601
|
+
* The two are different physical models: PTZ is absolute-position + presets,
|
|
26602
|
+
* navigation is momentary drive nudges + discrete robot ACTIONS
|
|
26603
|
+
* (dock / spot-clean / follow-pet / go-to-point / …).
|
|
26604
|
+
* - This cap is the SOURCE OF TRUTH. Two consumers adapt from it rather than
|
|
26605
|
+
* the reverse:
|
|
26606
|
+
* 1. a native CamStack navigation panel (data-driven from `listActions`
|
|
26607
|
+
* / `getOptions`), and
|
|
26608
|
+
* 2. the PTZ surface — a thin adapter mimics `ptz` from `navigation` so a
|
|
26609
|
+
* robot camera shows up in the existing PTZ control path without every
|
|
26610
|
+
* PTZ provider learning about robots. The mapping lives in the adapter,
|
|
26611
|
+
* not here (see the addon design note):
|
|
26612
|
+
* ptz.continuousMove({pan,tilt}) → navigation.move({pan,tilt})
|
|
26613
|
+
* ptz.stop() → navigation.stop()
|
|
26614
|
+
* ptz.goHome() → navigation.runAction('goHome')
|
|
26615
|
+
* ptz.getPresets() → navigation.listActions() (id→preset)
|
|
26616
|
+
* ptz.goToPreset(id) → navigation.runAction(id)
|
|
26617
|
+
*
|
|
26618
|
+
* ## Continuous drive
|
|
26619
|
+
*
|
|
26620
|
+
* `move` is MOMENTARY. Fluid navigation comes from the UI (or the PTZ adapter)
|
|
26621
|
+
* sending `move({pan,tilt})` REPEATEDLY at ~1 Hz while a direction is held, and
|
|
26622
|
+
* one `stop()` on release — exactly like the robot app's remote-drive joystick.
|
|
26623
|
+
* The provider forwards EACH `move` to one drive write; it must NOT debounce or
|
|
26624
|
+
* coalesce them. The UI owns the cadence.
|
|
26625
|
+
*
|
|
26626
|
+
* ## The action dictionary
|
|
26627
|
+
*
|
|
26628
|
+
* The discrete controls (dock / locate / spot-clean / follow / flash / sounds)
|
|
26629
|
+
* are a DATA-DRIVEN dictionary the cap exposes via `listActions()`. Each entry
|
|
26630
|
+
* carries `{ id, kind, label, icon }` (plus `soundId` for sound entries) so the
|
|
26631
|
+
* native panel AND the PTZ mimic render buttons WITHOUT hardcoding a
|
|
26632
|
+
* vendor-specific list. `kind: 'action'` entries are triggered with
|
|
26633
|
+
* `runAction({ actionId })`; `kind: 'sound'` entries with `playSound({ soundId })`
|
|
26634
|
+
* (the entry carries the `soundId` to pass). The general primitives — `move`,
|
|
26635
|
+
* `stop`, `goToPoint` — stay as first-class methods, not dictionary entries.
|
|
26636
|
+
*
|
|
26637
|
+
* NOTE (provider wiring): the first provider (Dreame) drives this with the RAW
|
|
26638
|
+
* `callAction(siid,aiid,in)` / `setProperty({siid,piid,value})` MIoT primitives
|
|
26639
|
+
* that the currently-published `@apocaliss92/nodedreame` already exposes on
|
|
26640
|
+
* every device handle. A future nodedreame publish adds a typed
|
|
26641
|
+
* `DreameCameraController` (drive / playPetSound / spotClean / findPet / …); the
|
|
26642
|
+
* provider can then swap the raw calls for the typed methods with no change to
|
|
26643
|
+
* THIS contract.
|
|
26644
|
+
*/
|
|
26645
|
+
/**
|
|
26646
|
+
* A momentary drive nudge. The robot MOVES (no gimbal) for as long as the caller
|
|
26647
|
+
* keeps sending nudges (~1 Hz); an explicit `stop` (or letting the nudges lapse)
|
|
26648
|
+
* halts it.
|
|
26649
|
+
*
|
|
26650
|
+
* - `pan` — turn: negative = left, positive = right, 0 = straight.
|
|
26651
|
+
* - `tilt` — throttle: positive = forward, negative = spin / turn-around.
|
|
26652
|
+
* - `speed` — optional intensity hint [0, 1]; the provider may scale the drive
|
|
26653
|
+
* vector by it (drivers without proportional drive ignore it).
|
|
26654
|
+
*
|
|
26655
|
+
* `pan` / `tilt` are normalized [-1, 1]. Both optional so a caller can nudge one
|
|
26656
|
+
* axis alone; an all-undefined nudge is a no-op.
|
|
26657
|
+
*/
|
|
26658
|
+
var NavigationMoveCommandSchema = object({
|
|
26659
|
+
pan: number().min(-1).max(1).optional(),
|
|
26660
|
+
tilt: number().min(-1).max(1).optional(),
|
|
26661
|
+
speed: number().min(0).max(1).optional()
|
|
26662
|
+
});
|
|
26663
|
+
/**
|
|
26664
|
+
* The enumerated discrete actions a navigation-capable robot can perform via
|
|
26665
|
+
* `runAction`. This is the CLOSED vocabulary; a given device advertises the
|
|
26666
|
+
* subset it supports through `listActions`. Sounds are NOT here — they go through
|
|
26667
|
+
* `playSound` (see the `sound` dictionary entries).
|
|
26668
|
+
*/
|
|
26669
|
+
var NavigationActionIdSchema = _enum([
|
|
26670
|
+
"goHome",
|
|
26671
|
+
"locate",
|
|
26672
|
+
"spotClean",
|
|
26673
|
+
"findPet",
|
|
26674
|
+
"personFollow",
|
|
26675
|
+
"stop",
|
|
26676
|
+
"startClean",
|
|
26677
|
+
"pauseClean",
|
|
26678
|
+
"dockWash",
|
|
26679
|
+
"autoEmpty",
|
|
26680
|
+
"flashOn",
|
|
26681
|
+
"flashOff"
|
|
26682
|
+
]);
|
|
26683
|
+
/** Whether a dictionary entry is a `runAction` action or a `playSound` sound. */
|
|
26684
|
+
var NavigationEntryKindSchema = _enum(["action", "sound"]);
|
|
26685
|
+
/**
|
|
26686
|
+
* One entry in the navigation action dictionary — the DATA-DRIVEN unit both the
|
|
26687
|
+
* native panel and the PTZ mimic render as a button.
|
|
26688
|
+
*
|
|
26689
|
+
* - `id` — stable id. For `kind:'action'` it is a {@link NavigationActionId}
|
|
26690
|
+
* (pass to `runAction`); for `kind:'sound'` it is a namespaced id
|
|
26691
|
+
* (`sound:meow`) whose `soundId` is passed to `playSound`.
|
|
26692
|
+
* - `icon` — icon HINT (lucide-style name; the UI maps it to its own set).
|
|
26693
|
+
* - `label` — operator-facing English label.
|
|
26694
|
+
* - `soundId` — wire sound id, present only on `kind:'sound'` entries.
|
|
26695
|
+
* - `enabled` — per-device FEATURE FLAG. `listActions` reports it so the UI /
|
|
26696
|
+
* PTZ render ONLY enabled entries. Data-driven: the provider
|
|
26697
|
+
* flips it from config, never by editing code.
|
|
26698
|
+
*/
|
|
26699
|
+
var NavigationActionEntrySchema = object({
|
|
26700
|
+
id: string(),
|
|
26701
|
+
kind: NavigationEntryKindSchema,
|
|
26702
|
+
label: string(),
|
|
26703
|
+
icon: string(),
|
|
26704
|
+
/** Present only on `kind:'sound'` entries — the id to pass to `playSound`. */
|
|
26705
|
+
soundId: number().int().optional(),
|
|
26706
|
+
/** Per-device feature flag — render this entry only when true. */
|
|
26707
|
+
enabled: boolean()
|
|
26708
|
+
});
|
|
26709
|
+
/** Coordinates for `goToPoint` — a point on the robot's live map. */
|
|
26710
|
+
var NavigationPointSchema = object({
|
|
26711
|
+
x: number(),
|
|
26712
|
+
y: number()
|
|
26713
|
+
});
|
|
26714
|
+
/**
|
|
26715
|
+
* Per-device FEATURE-FLAG report for the general (non-dictionary) primitives.
|
|
26716
|
+
* The cap reports which are enabled so the UI / PTZ render only the controls
|
|
26717
|
+
* that are turned on for THIS device. Data-driven: the provider derives these
|
|
26718
|
+
* from config + probe, never hardcoded in the UI. The per-DICTIONARY-entry flags
|
|
26719
|
+
* live on {@link NavigationActionEntrySchema.enabled}; these gate the primitives
|
|
26720
|
+
* that are not dictionary entries.
|
|
26721
|
+
*
|
|
26722
|
+
* - `move` / `stop` — the momentary drive joystick.
|
|
26723
|
+
* - `goToPoint` — send-to-map-coordinate. Ships OFF on Dreame until the
|
|
26724
|
+
* map-coordinate plumbing is wired.
|
|
26725
|
+
* - `runAction` — the discrete action buttons (dictionary `kind:'action'`).
|
|
26726
|
+
* - `playSound` — the sound buttons (dictionary `kind:'sound'`).
|
|
26727
|
+
* - `light` — the on/off fill-light toggle (works anytime).
|
|
26728
|
+
* - `lightMode` — the auto/manual selector + manual level slider (a
|
|
26729
|
+
* camera-service control; needs an active stream).
|
|
26730
|
+
*/
|
|
26731
|
+
var NavigationFeaturesSchema = object({
|
|
26732
|
+
move: boolean(),
|
|
26733
|
+
stop: boolean(),
|
|
26734
|
+
goToPoint: boolean(),
|
|
26735
|
+
runAction: boolean(),
|
|
26736
|
+
playSound: boolean(),
|
|
26737
|
+
light: boolean(),
|
|
26738
|
+
lightMode: boolean()
|
|
26739
|
+
});
|
|
26740
|
+
/** Light mode: `auto` lets the camera choose brightness; `manual` uses `level`. */
|
|
26741
|
+
var NavigationLightModeSchema = _enum(["auto", "manual"]);
|
|
26742
|
+
/**
|
|
26743
|
+
* Live navigation state so the UI can reflect what the robot is doing:
|
|
26744
|
+
* - `mode` — coarse activity (idle / cleaning / following / …).
|
|
26745
|
+
* - `following` — person/pet follow is currently armed.
|
|
26746
|
+
* - `flash` — the on-camera fill light is on.
|
|
26747
|
+
* - `lightMode` — auto vs manual fill-light mode.
|
|
26748
|
+
* - `lightLevel` — manual fill-light level (40..100); meaningful when
|
|
26749
|
+
* `lightMode === 'manual'`.
|
|
26750
|
+
*/
|
|
26751
|
+
var NavigationStatusSchema = object({
|
|
26752
|
+
mode: _enum([
|
|
26753
|
+
"idle",
|
|
26754
|
+
"cleaning",
|
|
26755
|
+
"spot",
|
|
26756
|
+
"following",
|
|
26757
|
+
"goto",
|
|
26758
|
+
"returning",
|
|
26759
|
+
"paused",
|
|
26760
|
+
"unknown"
|
|
26761
|
+
]),
|
|
26762
|
+
following: boolean(),
|
|
26763
|
+
flash: boolean(),
|
|
26764
|
+
lightMode: NavigationLightModeSchema,
|
|
26765
|
+
lightLevel: number().min(40).max(100),
|
|
26766
|
+
/** Ms epoch when the slice was last updated. */
|
|
26767
|
+
lastChangedAt: number()
|
|
26768
|
+
});
|
|
26769
|
+
NavigationStatusSchema.extend({ lastFetchedAt: number() });
|
|
26770
|
+
DeviceType.Camera, method(NavigationMoveCommandSchema.extend({ deviceId: number() }), _void(), { kind: "mutation" }), method(object({ deviceId: number() }), _void(), { kind: "mutation" }), method(NavigationPointSchema.extend({ deviceId: number() }), _void(), { kind: "mutation" }), method(object({ deviceId: number() }), array(NavigationActionEntrySchema)), method(object({
|
|
26771
|
+
deviceId: number(),
|
|
26772
|
+
actionId: NavigationActionIdSchema
|
|
26773
|
+
}), _void(), { kind: "mutation" }), method(object({
|
|
26774
|
+
deviceId: number(),
|
|
26775
|
+
soundId: number().int()
|
|
26776
|
+
}), _void(), { kind: "mutation" }), method(object({
|
|
26777
|
+
deviceId: number(),
|
|
26778
|
+
on: boolean()
|
|
26779
|
+
}), _void(), { kind: "mutation" }), method(object({
|
|
26780
|
+
deviceId: number(),
|
|
26781
|
+
mode: NavigationLightModeSchema,
|
|
26782
|
+
level: number().min(40).max(100).optional()
|
|
26783
|
+
}), _void(), { kind: "mutation" }), method(object({
|
|
26784
|
+
deviceId: number(),
|
|
26785
|
+
level: number().min(40).max(100)
|
|
26786
|
+
}), _void(), { kind: "mutation" }), method(object({ deviceId: number() }), NavigationFeaturesSchema), object({
|
|
26787
|
+
deviceId: number(),
|
|
26788
|
+
status: NavigationStatusSchema
|
|
26789
|
+
});
|
|
26790
|
+
/**
|
|
26791
|
+
* Network-link snapshot. Same shape for every provider (a Reolink wifi
|
|
26792
|
+
* camera, a Home Assistant device with a signal-strength sensor, a Tapo
|
|
26793
|
+
* plug): one slice under `device.runtimeState['network-link']`, one badge,
|
|
26794
|
+
* one Home Assistant projection.
|
|
26795
|
+
*/
|
|
26796
|
+
var NetworkLinkStatusSchema = object({
|
|
26797
|
+
/** The link the device is on. `'unknown'` = not read yet, not "no link". */
|
|
26798
|
+
type: _enum([
|
|
26799
|
+
"wifi",
|
|
26800
|
+
"ethernet",
|
|
26801
|
+
"cellular",
|
|
26802
|
+
"unknown"
|
|
26803
|
+
]),
|
|
26804
|
+
/**
|
|
26805
|
+
* Link quality, 0..100 inclusive, normalised by the provider from whatever
|
|
26806
|
+
* the firmware reports (bars, RSSI, a vendor scale). **`null` means NOT
|
|
26807
|
+
* KNOWN or NOT APPLICABLE** — a wired link has no signal, and a wireless
|
|
26808
|
+
* one whose reading has not landed must not be drawn at 0 %. Consumers
|
|
26809
|
+
* SKIP a null rather than coerce it.
|
|
26810
|
+
*/
|
|
26811
|
+
signalPercent: number().min(0).max(100).nullable(),
|
|
26812
|
+
/** Raw received signal strength in dBm, when the firmware reports one. */
|
|
26813
|
+
rssiDbm: number().optional(),
|
|
26814
|
+
/** Network name of a wireless link, when the firmware reports it. */
|
|
26815
|
+
ssid: string().optional(),
|
|
26816
|
+
/** Ms epoch of the last observation. Lets consumers reason about freshness. */
|
|
26817
|
+
lastUpdated: number()
|
|
26818
|
+
});
|
|
26819
|
+
DeviceType.Camera, DeviceType.Sensor, DeviceType.Button, DeviceType.Switch, DeviceType.Light, DeviceType.Lock, DeviceType.Siren, object({
|
|
26820
|
+
deviceId: number(),
|
|
26821
|
+
status: NetworkLinkStatusSchema
|
|
26822
|
+
});
|
|
26823
|
+
/**
|
|
26504
26824
|
* network-quality — system-scoped singleton capability tracking RTT,
|
|
26505
26825
|
* jitter, and observed/peak bandwidth per device + per client.
|
|
26506
26826
|
*
|
|
@@ -27742,203 +28062,6 @@ DeviceType.Camera, method(object({ deviceId: number() }), PtzAutotrackStatusSche
|
|
|
27742
28062
|
deviceId: number(),
|
|
27743
28063
|
status: PtzAutotrackStatusSchema
|
|
27744
28064
|
});
|
|
27745
|
-
/**
|
|
27746
|
-
* `navigation` — a device-scoped capability that natively expresses the FULL
|
|
27747
|
-
* navigation / action surface of a robot that DRIVES ITSELF and carries an
|
|
27748
|
-
* on-board camera (the Dreame robot-vacuum camera is the first provider).
|
|
27749
|
-
*
|
|
27750
|
-
* Why a NEW cap rather than overloading `ptz`:
|
|
27751
|
-
* - `ptz` moves a *gimbal* on a fixed camera (pan/tilt/zoom of the lens). A
|
|
27752
|
-
* robot vacuum has no gimbal — the whole chassis drives, turns and spins.
|
|
27753
|
-
* The two are different physical models: PTZ is absolute-position + presets,
|
|
27754
|
-
* navigation is momentary drive nudges + discrete robot ACTIONS
|
|
27755
|
-
* (dock / spot-clean / follow-pet / go-to-point / …).
|
|
27756
|
-
* - This cap is the SOURCE OF TRUTH. Two consumers adapt from it rather than
|
|
27757
|
-
* the reverse:
|
|
27758
|
-
* 1. a native CamStack navigation panel (data-driven from `listActions`
|
|
27759
|
-
* / `getOptions`), and
|
|
27760
|
-
* 2. the PTZ surface — a thin adapter mimics `ptz` from `navigation` so a
|
|
27761
|
-
* robot camera shows up in the existing PTZ control path without every
|
|
27762
|
-
* PTZ provider learning about robots. The mapping lives in the adapter,
|
|
27763
|
-
* not here (see the addon design note):
|
|
27764
|
-
* ptz.continuousMove({pan,tilt}) → navigation.move({pan,tilt})
|
|
27765
|
-
* ptz.stop() → navigation.stop()
|
|
27766
|
-
* ptz.goHome() → navigation.runAction('goHome')
|
|
27767
|
-
* ptz.getPresets() → navigation.listActions() (id→preset)
|
|
27768
|
-
* ptz.goToPreset(id) → navigation.runAction(id)
|
|
27769
|
-
*
|
|
27770
|
-
* ## Continuous drive
|
|
27771
|
-
*
|
|
27772
|
-
* `move` is MOMENTARY. Fluid navigation comes from the UI (or the PTZ adapter)
|
|
27773
|
-
* sending `move({pan,tilt})` REPEATEDLY at ~1 Hz while a direction is held, and
|
|
27774
|
-
* one `stop()` on release — exactly like the robot app's remote-drive joystick.
|
|
27775
|
-
* The provider forwards EACH `move` to one drive write; it must NOT debounce or
|
|
27776
|
-
* coalesce them. The UI owns the cadence.
|
|
27777
|
-
*
|
|
27778
|
-
* ## The action dictionary
|
|
27779
|
-
*
|
|
27780
|
-
* The discrete controls (dock / locate / spot-clean / follow / flash / sounds)
|
|
27781
|
-
* are a DATA-DRIVEN dictionary the cap exposes via `listActions()`. Each entry
|
|
27782
|
-
* carries `{ id, kind, label, icon }` (plus `soundId` for sound entries) so the
|
|
27783
|
-
* native panel AND the PTZ mimic render buttons WITHOUT hardcoding a
|
|
27784
|
-
* vendor-specific list. `kind: 'action'` entries are triggered with
|
|
27785
|
-
* `runAction({ actionId })`; `kind: 'sound'` entries with `playSound({ soundId })`
|
|
27786
|
-
* (the entry carries the `soundId` to pass). The general primitives — `move`,
|
|
27787
|
-
* `stop`, `goToPoint` — stay as first-class methods, not dictionary entries.
|
|
27788
|
-
*
|
|
27789
|
-
* NOTE (provider wiring): the first provider (Dreame) drives this with the RAW
|
|
27790
|
-
* `callAction(siid,aiid,in)` / `setProperty({siid,piid,value})` MIoT primitives
|
|
27791
|
-
* that the currently-published `@apocaliss92/nodedreame` already exposes on
|
|
27792
|
-
* every device handle. A future nodedreame publish adds a typed
|
|
27793
|
-
* `DreameCameraController` (drive / playPetSound / spotClean / findPet / …); the
|
|
27794
|
-
* provider can then swap the raw calls for the typed methods with no change to
|
|
27795
|
-
* THIS contract.
|
|
27796
|
-
*/
|
|
27797
|
-
/**
|
|
27798
|
-
* A momentary drive nudge. The robot MOVES (no gimbal) for as long as the caller
|
|
27799
|
-
* keeps sending nudges (~1 Hz); an explicit `stop` (or letting the nudges lapse)
|
|
27800
|
-
* halts it.
|
|
27801
|
-
*
|
|
27802
|
-
* - `pan` — turn: negative = left, positive = right, 0 = straight.
|
|
27803
|
-
* - `tilt` — throttle: positive = forward, negative = spin / turn-around.
|
|
27804
|
-
* - `speed` — optional intensity hint [0, 1]; the provider may scale the drive
|
|
27805
|
-
* vector by it (drivers without proportional drive ignore it).
|
|
27806
|
-
*
|
|
27807
|
-
* `pan` / `tilt` are normalized [-1, 1]. Both optional so a caller can nudge one
|
|
27808
|
-
* axis alone; an all-undefined nudge is a no-op.
|
|
27809
|
-
*/
|
|
27810
|
-
var NavigationMoveCommandSchema = object({
|
|
27811
|
-
pan: number().min(-1).max(1).optional(),
|
|
27812
|
-
tilt: number().min(-1).max(1).optional(),
|
|
27813
|
-
speed: number().min(0).max(1).optional()
|
|
27814
|
-
});
|
|
27815
|
-
/**
|
|
27816
|
-
* The enumerated discrete actions a navigation-capable robot can perform via
|
|
27817
|
-
* `runAction`. This is the CLOSED vocabulary; a given device advertises the
|
|
27818
|
-
* subset it supports through `listActions`. Sounds are NOT here — they go through
|
|
27819
|
-
* `playSound` (see the `sound` dictionary entries).
|
|
27820
|
-
*/
|
|
27821
|
-
var NavigationActionIdSchema = _enum([
|
|
27822
|
-
"goHome",
|
|
27823
|
-
"locate",
|
|
27824
|
-
"spotClean",
|
|
27825
|
-
"findPet",
|
|
27826
|
-
"personFollow",
|
|
27827
|
-
"stop",
|
|
27828
|
-
"startClean",
|
|
27829
|
-
"pauseClean",
|
|
27830
|
-
"dockWash",
|
|
27831
|
-
"autoEmpty",
|
|
27832
|
-
"flashOn",
|
|
27833
|
-
"flashOff"
|
|
27834
|
-
]);
|
|
27835
|
-
/** Whether a dictionary entry is a `runAction` action or a `playSound` sound. */
|
|
27836
|
-
var NavigationEntryKindSchema = _enum(["action", "sound"]);
|
|
27837
|
-
/**
|
|
27838
|
-
* One entry in the navigation action dictionary — the DATA-DRIVEN unit both the
|
|
27839
|
-
* native panel and the PTZ mimic render as a button.
|
|
27840
|
-
*
|
|
27841
|
-
* - `id` — stable id. For `kind:'action'` it is a {@link NavigationActionId}
|
|
27842
|
-
* (pass to `runAction`); for `kind:'sound'` it is a namespaced id
|
|
27843
|
-
* (`sound:meow`) whose `soundId` is passed to `playSound`.
|
|
27844
|
-
* - `icon` — icon HINT (lucide-style name; the UI maps it to its own set).
|
|
27845
|
-
* - `label` — operator-facing English label.
|
|
27846
|
-
* - `soundId` — wire sound id, present only on `kind:'sound'` entries.
|
|
27847
|
-
* - `enabled` — per-device FEATURE FLAG. `listActions` reports it so the UI /
|
|
27848
|
-
* PTZ render ONLY enabled entries. Data-driven: the provider
|
|
27849
|
-
* flips it from config, never by editing code.
|
|
27850
|
-
*/
|
|
27851
|
-
var NavigationActionEntrySchema = object({
|
|
27852
|
-
id: string(),
|
|
27853
|
-
kind: NavigationEntryKindSchema,
|
|
27854
|
-
label: string(),
|
|
27855
|
-
icon: string(),
|
|
27856
|
-
/** Present only on `kind:'sound'` entries — the id to pass to `playSound`. */
|
|
27857
|
-
soundId: number().int().optional(),
|
|
27858
|
-
/** Per-device feature flag — render this entry only when true. */
|
|
27859
|
-
enabled: boolean()
|
|
27860
|
-
});
|
|
27861
|
-
/** Coordinates for `goToPoint` — a point on the robot's live map. */
|
|
27862
|
-
var NavigationPointSchema = object({
|
|
27863
|
-
x: number(),
|
|
27864
|
-
y: number()
|
|
27865
|
-
});
|
|
27866
|
-
/**
|
|
27867
|
-
* Per-device FEATURE-FLAG report for the general (non-dictionary) primitives.
|
|
27868
|
-
* The cap reports which are enabled so the UI / PTZ render only the controls
|
|
27869
|
-
* that are turned on for THIS device. Data-driven: the provider derives these
|
|
27870
|
-
* from config + probe, never hardcoded in the UI. The per-DICTIONARY-entry flags
|
|
27871
|
-
* live on {@link NavigationActionEntrySchema.enabled}; these gate the primitives
|
|
27872
|
-
* that are not dictionary entries.
|
|
27873
|
-
*
|
|
27874
|
-
* - `move` / `stop` — the momentary drive joystick.
|
|
27875
|
-
* - `goToPoint` — send-to-map-coordinate. Ships OFF on Dreame until the
|
|
27876
|
-
* map-coordinate plumbing is wired.
|
|
27877
|
-
* - `runAction` — the discrete action buttons (dictionary `kind:'action'`).
|
|
27878
|
-
* - `playSound` — the sound buttons (dictionary `kind:'sound'`).
|
|
27879
|
-
* - `light` — the on/off fill-light toggle (works anytime).
|
|
27880
|
-
* - `lightMode` — the auto/manual selector + manual level slider (a
|
|
27881
|
-
* camera-service control; needs an active stream).
|
|
27882
|
-
*/
|
|
27883
|
-
var NavigationFeaturesSchema = object({
|
|
27884
|
-
move: boolean(),
|
|
27885
|
-
stop: boolean(),
|
|
27886
|
-
goToPoint: boolean(),
|
|
27887
|
-
runAction: boolean(),
|
|
27888
|
-
playSound: boolean(),
|
|
27889
|
-
light: boolean(),
|
|
27890
|
-
lightMode: boolean()
|
|
27891
|
-
});
|
|
27892
|
-
/** Light mode: `auto` lets the camera choose brightness; `manual` uses `level`. */
|
|
27893
|
-
var NavigationLightModeSchema = _enum(["auto", "manual"]);
|
|
27894
|
-
/**
|
|
27895
|
-
* Live navigation state so the UI can reflect what the robot is doing:
|
|
27896
|
-
* - `mode` — coarse activity (idle / cleaning / following / …).
|
|
27897
|
-
* - `following` — person/pet follow is currently armed.
|
|
27898
|
-
* - `flash` — the on-camera fill light is on.
|
|
27899
|
-
* - `lightMode` — auto vs manual fill-light mode.
|
|
27900
|
-
* - `lightLevel` — manual fill-light level (40..100); meaningful when
|
|
27901
|
-
* `lightMode === 'manual'`.
|
|
27902
|
-
*/
|
|
27903
|
-
var NavigationStatusSchema = object({
|
|
27904
|
-
mode: _enum([
|
|
27905
|
-
"idle",
|
|
27906
|
-
"cleaning",
|
|
27907
|
-
"spot",
|
|
27908
|
-
"following",
|
|
27909
|
-
"goto",
|
|
27910
|
-
"returning",
|
|
27911
|
-
"paused",
|
|
27912
|
-
"unknown"
|
|
27913
|
-
]),
|
|
27914
|
-
following: boolean(),
|
|
27915
|
-
flash: boolean(),
|
|
27916
|
-
lightMode: NavigationLightModeSchema,
|
|
27917
|
-
lightLevel: number().min(40).max(100),
|
|
27918
|
-
/** Ms epoch when the slice was last updated. */
|
|
27919
|
-
lastChangedAt: number()
|
|
27920
|
-
});
|
|
27921
|
-
NavigationStatusSchema.extend({ lastFetchedAt: number() });
|
|
27922
|
-
DeviceType.Camera, method(NavigationMoveCommandSchema.extend({ deviceId: number() }), _void(), { kind: "mutation" }), method(object({ deviceId: number() }), _void(), { kind: "mutation" }), method(NavigationPointSchema.extend({ deviceId: number() }), _void(), { kind: "mutation" }), method(object({ deviceId: number() }), array(NavigationActionEntrySchema)), method(object({
|
|
27923
|
-
deviceId: number(),
|
|
27924
|
-
actionId: NavigationActionIdSchema
|
|
27925
|
-
}), _void(), { kind: "mutation" }), method(object({
|
|
27926
|
-
deviceId: number(),
|
|
27927
|
-
soundId: number().int()
|
|
27928
|
-
}), _void(), { kind: "mutation" }), method(object({
|
|
27929
|
-
deviceId: number(),
|
|
27930
|
-
on: boolean()
|
|
27931
|
-
}), _void(), { kind: "mutation" }), method(object({
|
|
27932
|
-
deviceId: number(),
|
|
27933
|
-
mode: NavigationLightModeSchema,
|
|
27934
|
-
level: number().min(40).max(100).optional()
|
|
27935
|
-
}), _void(), { kind: "mutation" }), method(object({
|
|
27936
|
-
deviceId: number(),
|
|
27937
|
-
level: number().min(40).max(100)
|
|
27938
|
-
}), _void(), { kind: "mutation" }), method(object({ deviceId: number() }), NavigationFeaturesSchema), object({
|
|
27939
|
-
deviceId: number(),
|
|
27940
|
-
status: NavigationStatusSchema
|
|
27941
|
-
});
|
|
27942
28065
|
DeviceType.Camera, DeviceType.Sensor, DeviceType.Switch, method(object({ deviceId: number().int().nonnegative() }), object({ success: literal(true) }), {
|
|
27943
28066
|
kind: "mutation",
|
|
27944
28067
|
auth: "admin"
|
|
@@ -35278,6 +35401,12 @@ Object.freeze({
|
|
|
35278
35401
|
addonId: null,
|
|
35279
35402
|
access: "view"
|
|
35280
35403
|
},
|
|
35404
|
+
"storage.listDrainProgress": {
|
|
35405
|
+
capName: "storage",
|
|
35406
|
+
capScope: "system",
|
|
35407
|
+
addonId: null,
|
|
35408
|
+
access: "view"
|
|
35409
|
+
},
|
|
35281
35410
|
"storage.listLocationDeclarations": {
|
|
35282
35411
|
capName: "storage",
|
|
35283
35412
|
capScope: "system",
|
|
@@ -35422,6 +35551,12 @@ Object.freeze({
|
|
|
35422
35551
|
addonId: null,
|
|
35423
35552
|
access: "view"
|
|
35424
35553
|
},
|
|
35554
|
+
"storageOccupancy.getOccupancy": {
|
|
35555
|
+
capName: "storage-occupancy",
|
|
35556
|
+
capScope: "system",
|
|
35557
|
+
addonId: null,
|
|
35558
|
+
access: "view"
|
|
35559
|
+
},
|
|
35425
35560
|
"storageProvider.abortUpload": {
|
|
35426
35561
|
capName: "storage-provider",
|
|
35427
35562
|
capScope: "system",
|
|
@@ -38802,32 +38937,221 @@ DEFAULT_NATIVE_LEASE_SETTINGS.sceneBudgetMb;
|
|
|
38802
38937
|
DEFAULT_NATIVE_LEASE_SETTINGS.admission;
|
|
38803
38938
|
var MB = 1024 * 1024;
|
|
38804
38939
|
1024 * MB, 3072 * MB;
|
|
38805
|
-
|
|
38806
|
-
|
|
38807
|
-
|
|
38808
|
-
|
|
38809
|
-
|
|
38810
|
-
|
|
38811
|
-
|
|
38812
|
-
|
|
38813
|
-
|
|
38814
|
-
|
|
38815
|
-
|
|
38816
|
-
|
|
38817
|
-
|
|
38818
|
-
|
|
38819
|
-
|
|
38820
|
-
|
|
38821
|
-
|
|
38822
|
-
|
|
38823
|
-
|
|
38824
|
-
|
|
38825
|
-
|
|
38826
|
-
|
|
38827
|
-
|
|
38828
|
-
|
|
38829
|
-
|
|
38830
|
-
|
|
38940
|
+
var DEFAULT_FIRST_UNIT_TIMEOUT_MS = 12e3;
|
|
38941
|
+
/** Heartbeat cadence — ~2 minutes of 4 s fragments. */
|
|
38942
|
+
var FRAGMENT_LOG_EVERY = 30;
|
|
38943
|
+
var Fmp4FragmentChild = class {
|
|
38944
|
+
deps;
|
|
38945
|
+
args;
|
|
38946
|
+
child = null;
|
|
38947
|
+
splitter = new Fmp4BoxSplitter();
|
|
38948
|
+
stopped = false;
|
|
38949
|
+
unitsOut = 0;
|
|
38950
|
+
activeHwAccel = null;
|
|
38951
|
+
constructor(deps, args) {
|
|
38952
|
+
this.deps = deps;
|
|
38953
|
+
this.args = args;
|
|
38954
|
+
}
|
|
38955
|
+
/** Spawn, and resolve once the INIT segment has been cut out of stdout. */
|
|
38956
|
+
async start() {
|
|
38957
|
+
const requested = this.args.invocation.decodeHwAccel;
|
|
38958
|
+
this.activeHwAccel = requested;
|
|
38959
|
+
try {
|
|
38960
|
+
await this.spawnAttempt(requested);
|
|
38961
|
+
return;
|
|
38962
|
+
} catch (err) {
|
|
38963
|
+
if (this.stopped) throw err;
|
|
38964
|
+
if (requested === null || isSoftwareDecode(requested)) throw err;
|
|
38965
|
+
this.deps.logger.warn("fmp4 fragment child: hardware decode produced NO fragment — retrying in SOFTWARE", {
|
|
38966
|
+
tags: { deviceId: this.args.deviceId },
|
|
38967
|
+
meta: {
|
|
38968
|
+
sourceId: this.args.sourceId,
|
|
38969
|
+
decodeHwAccel: requested,
|
|
38970
|
+
error: errMsg$15(err)
|
|
38971
|
+
}
|
|
38972
|
+
});
|
|
38973
|
+
this.killChild();
|
|
38974
|
+
this.splitter = new Fmp4BoxSplitter();
|
|
38975
|
+
this.activeHwAccel = null;
|
|
38976
|
+
await this.spawnAttempt(null);
|
|
38977
|
+
}
|
|
38978
|
+
}
|
|
38979
|
+
/** The backend the child ACTUALLY ran with — `null` for software. */
|
|
38980
|
+
activeDecodeHwAccel() {
|
|
38981
|
+
const value = this.activeHwAccel;
|
|
38982
|
+
return value === null || value === "none" || value === "copy" ? null : value;
|
|
38983
|
+
}
|
|
38984
|
+
/** Kill ffmpeg and end the plane. Idempotent. */
|
|
38985
|
+
async stop() {
|
|
38986
|
+
if (this.stopped) return;
|
|
38987
|
+
this.stopped = true;
|
|
38988
|
+
this.killChild();
|
|
38989
|
+
this.args.plane.end("the fragment child stopped");
|
|
38990
|
+
}
|
|
38991
|
+
spawnAttempt(decodeHwAccel) {
|
|
38992
|
+
const args = buildFfmpegArgs({
|
|
38993
|
+
...this.args.invocation,
|
|
38994
|
+
decodeHwAccel,
|
|
38995
|
+
sink: {
|
|
38996
|
+
kind: "stdout",
|
|
38997
|
+
container: "mp4",
|
|
38998
|
+
fragmentMs: this.args.fragmentMs
|
|
38999
|
+
}
|
|
39000
|
+
});
|
|
39001
|
+
this.deps.logger.info("fmp4 fragment child: spawning ffmpeg", {
|
|
39002
|
+
tags: { deviceId: this.args.deviceId },
|
|
39003
|
+
meta: {
|
|
39004
|
+
sourceId: this.args.sourceId,
|
|
39005
|
+
fragmentMs: this.args.fragmentMs,
|
|
39006
|
+
decodeHwAccel: decodeHwAccel ?? "software",
|
|
39007
|
+
argv: args.join(" ")
|
|
39008
|
+
}
|
|
39009
|
+
});
|
|
39010
|
+
return new Promise((resolve, reject) => {
|
|
39011
|
+
const child = this.deps.spawnFn(this.deps.ffmpegBinaryPath, args, { stdio: [
|
|
39012
|
+
"ignore",
|
|
39013
|
+
"pipe",
|
|
39014
|
+
"pipe"
|
|
39015
|
+
] });
|
|
39016
|
+
this.child = child;
|
|
39017
|
+
let settled = false;
|
|
39018
|
+
/**
|
|
39019
|
+
* This attempt FAILED. Set before the kill, because SIGTERM makes the
|
|
39020
|
+
* child exit and that exit must not be reported as a death: the retry —
|
|
39021
|
+
* or the caller's rejection — already owns what happens next. Without it
|
|
39022
|
+
* the timeout path ends the plane the software retry is about to fill,
|
|
39023
|
+
* and the consumer sees a stream that stopped for no reason. A "which
|
|
39024
|
+
* spawn is current" counter does NOT cover this: the retry has not been
|
|
39025
|
+
* spawned when the kill's exit arrives.
|
|
39026
|
+
*/
|
|
39027
|
+
let failed = false;
|
|
39028
|
+
/**
|
|
39029
|
+
* This attempt is still the live producer: it has not failed (a failure
|
|
39030
|
+
* hands ownership to the retry, or to the caller's rejection) and nothing
|
|
39031
|
+
* has stopped the child. Those two cover every way an attempt stops being
|
|
39032
|
+
* current — `start` only respawns after a rejection.
|
|
39033
|
+
*/
|
|
39034
|
+
const isCurrent = () => !this.stopped && !failed;
|
|
39035
|
+
const timeoutMs = this.deps.firstUnitTimeoutMs ?? DEFAULT_FIRST_UNIT_TIMEOUT_MS;
|
|
39036
|
+
const settle = (fail) => {
|
|
39037
|
+
if (settled) return;
|
|
39038
|
+
settled = true;
|
|
39039
|
+
clearTimeout(timer);
|
|
39040
|
+
if (fail) {
|
|
39041
|
+
failed = true;
|
|
39042
|
+
reject(fail);
|
|
39043
|
+
} else resolve();
|
|
39044
|
+
};
|
|
39045
|
+
const timer = setTimeout(() => {
|
|
39046
|
+
settle(/* @__PURE__ */ new Error(`fmp4 fragment child: no fragment within ${timeoutMs}ms`));
|
|
39047
|
+
this.killChild();
|
|
39048
|
+
}, timeoutMs);
|
|
39049
|
+
timer.unref?.();
|
|
39050
|
+
child.stdout?.on("data", (chunk) => {
|
|
39051
|
+
for (const unit of this.splitter.push(chunk)) {
|
|
39052
|
+
this.unitsOut += 1;
|
|
39053
|
+
this.args.plane.publish(unit);
|
|
39054
|
+
if (unit.kind === "init") {
|
|
39055
|
+
this.deps.logger.info("fmp4 fragment child: INIT segment cut", {
|
|
39056
|
+
tags: { deviceId: this.args.deviceId },
|
|
39057
|
+
meta: {
|
|
39058
|
+
sourceId: this.args.sourceId,
|
|
39059
|
+
bytes: unit.data.length
|
|
39060
|
+
}
|
|
39061
|
+
});
|
|
39062
|
+
settle();
|
|
39063
|
+
} else if (this.unitsOut % FRAGMENT_LOG_EVERY === 0) this.deps.logger.info("fmp4 fragment child: fragments still flowing", {
|
|
39064
|
+
tags: { deviceId: this.args.deviceId },
|
|
39065
|
+
meta: {
|
|
39066
|
+
sourceId: this.args.sourceId,
|
|
39067
|
+
unitsOut: this.unitsOut,
|
|
39068
|
+
bytes: unit.data.length,
|
|
39069
|
+
subscribers: this.args.plane.subscriberCount
|
|
39070
|
+
}
|
|
39071
|
+
});
|
|
39072
|
+
}
|
|
39073
|
+
const fault = this.splitter.fault;
|
|
39074
|
+
if (fault !== null) this.onFault(fault, settled, isCurrent(), settle);
|
|
39075
|
+
});
|
|
39076
|
+
child.stderr?.setEncoding("utf8");
|
|
39077
|
+
child.stderr?.on("data", (line) => {
|
|
39078
|
+
this.deps.logger.debug("fmp4 fragment child ffmpeg", {
|
|
39079
|
+
tags: { deviceId: this.args.deviceId },
|
|
39080
|
+
meta: {
|
|
39081
|
+
sourceId: this.args.sourceId,
|
|
39082
|
+
line: line.trim()
|
|
39083
|
+
}
|
|
39084
|
+
});
|
|
39085
|
+
});
|
|
39086
|
+
child.once("error", (err) => {
|
|
39087
|
+
if (!settled) {
|
|
39088
|
+
settle(err);
|
|
39089
|
+
return;
|
|
39090
|
+
}
|
|
39091
|
+
if (!isCurrent()) return;
|
|
39092
|
+
this.args.plane.end("the fragment child errored");
|
|
39093
|
+
this.deps.onChildExit?.(err);
|
|
39094
|
+
});
|
|
39095
|
+
child.once("exit", (code, signal) => {
|
|
39096
|
+
if (!settled) {
|
|
39097
|
+
settle(/* @__PURE__ */ new Error(`fmp4 fragment child: ffmpeg exited before any fragment (code=${code} signal=${signal})`));
|
|
39098
|
+
return;
|
|
39099
|
+
}
|
|
39100
|
+
if (!isCurrent()) return;
|
|
39101
|
+
const error = /* @__PURE__ */ new Error(`fmp4 fragment child: ffmpeg exited while live (code=${code} signal=${signal})`);
|
|
39102
|
+
this.deps.logger.warn("fmp4 fragment child: ffmpeg exited while live", {
|
|
39103
|
+
tags: { deviceId: this.args.deviceId },
|
|
39104
|
+
meta: {
|
|
39105
|
+
sourceId: this.args.sourceId,
|
|
39106
|
+
code,
|
|
39107
|
+
signal,
|
|
39108
|
+
unitsOut: this.unitsOut
|
|
39109
|
+
}
|
|
39110
|
+
});
|
|
39111
|
+
this.args.plane.end("the fragment child exited");
|
|
39112
|
+
this.deps.onChildExit?.(error);
|
|
39113
|
+
});
|
|
39114
|
+
});
|
|
39115
|
+
}
|
|
39116
|
+
/**
|
|
39117
|
+
* The byte stream stopped being splittable. Not recoverable — the splitter
|
|
39118
|
+
* cannot resynchronise mid-box — so the child is a corpse and every consumer
|
|
39119
|
+
* has to be told, loudly, with the reason.
|
|
39120
|
+
*/
|
|
39121
|
+
onFault(reason, wasLive, current, settle) {
|
|
39122
|
+
const error = /* @__PURE__ */ new Error(`fmp4 fragment child: ${reason}`);
|
|
39123
|
+
this.deps.logger.error("fmp4 fragment child: the ffmpeg output stopped parsing as fMP4", {
|
|
39124
|
+
tags: { deviceId: this.args.deviceId },
|
|
39125
|
+
meta: {
|
|
39126
|
+
sourceId: this.args.sourceId,
|
|
39127
|
+
unitsOut: this.unitsOut,
|
|
39128
|
+
interstitial: this.splitter.discardedInterstitialTypes,
|
|
39129
|
+
reason
|
|
39130
|
+
}
|
|
39131
|
+
});
|
|
39132
|
+
this.killChild();
|
|
39133
|
+
settle(error);
|
|
39134
|
+
if (wasLive && current) {
|
|
39135
|
+
this.args.plane.end("the fragment child produced unsplittable output");
|
|
39136
|
+
this.deps.onChildExit?.(error);
|
|
39137
|
+
}
|
|
39138
|
+
}
|
|
39139
|
+
killChild() {
|
|
39140
|
+
const child = this.child;
|
|
39141
|
+
this.child = null;
|
|
39142
|
+
if (child && !child.killed) try {
|
|
39143
|
+
child.kill("SIGTERM");
|
|
39144
|
+
} catch (err) {
|
|
39145
|
+
this.deps.logger.warn("fmp4 fragment child: kill error", {
|
|
39146
|
+
tags: { deviceId: this.args.deviceId },
|
|
39147
|
+
meta: {
|
|
39148
|
+
sourceId: this.args.sourceId,
|
|
39149
|
+
error: errMsg$15(err)
|
|
39150
|
+
}
|
|
39151
|
+
});
|
|
39152
|
+
}
|
|
39153
|
+
}
|
|
39154
|
+
};
|
|
38831
39155
|
/**
|
|
38832
39156
|
* Fmp4FragmentPlane — a SUBSCRIBABLE fragmented-MP4 plane, fed by one
|
|
38833
39157
|
* {@link import('./fmp4-box-splitter.js').Fmp4BoxSplitter}.
|
|
@@ -39113,221 +39437,32 @@ var Fmp4FragmentPlane = class {
|
|
|
39113
39437
|
}
|
|
39114
39438
|
}
|
|
39115
39439
|
};
|
|
39116
|
-
|
|
39117
|
-
|
|
39118
|
-
|
|
39119
|
-
|
|
39120
|
-
|
|
39121
|
-
|
|
39122
|
-
|
|
39123
|
-
|
|
39124
|
-
|
|
39125
|
-
|
|
39126
|
-
|
|
39127
|
-
|
|
39128
|
-
|
|
39129
|
-
|
|
39130
|
-
|
|
39131
|
-
|
|
39132
|
-
|
|
39133
|
-
|
|
39134
|
-
|
|
39135
|
-
|
|
39136
|
-
|
|
39137
|
-
|
|
39138
|
-
|
|
39139
|
-
|
|
39140
|
-
|
|
39141
|
-
|
|
39142
|
-
tags: { deviceId: this.args.deviceId },
|
|
39143
|
-
meta: {
|
|
39144
|
-
sourceId: this.args.sourceId,
|
|
39145
|
-
decodeHwAccel: requested,
|
|
39146
|
-
error: errMsg$15(err)
|
|
39147
|
-
}
|
|
39148
|
-
});
|
|
39149
|
-
this.killChild();
|
|
39150
|
-
this.splitter = new Fmp4BoxSplitter();
|
|
39151
|
-
this.activeHwAccel = null;
|
|
39152
|
-
await this.spawnAttempt(null);
|
|
39153
|
-
}
|
|
39154
|
-
}
|
|
39155
|
-
/** The backend the child ACTUALLY ran with — `null` for software. */
|
|
39156
|
-
activeDecodeHwAccel() {
|
|
39157
|
-
const value = this.activeHwAccel;
|
|
39158
|
-
return value === null || value === "none" || value === "copy" ? null : value;
|
|
39159
|
-
}
|
|
39160
|
-
/** Kill ffmpeg and end the plane. Idempotent. */
|
|
39161
|
-
async stop() {
|
|
39162
|
-
if (this.stopped) return;
|
|
39163
|
-
this.stopped = true;
|
|
39164
|
-
this.killChild();
|
|
39165
|
-
this.args.plane.end("the fragment child stopped");
|
|
39166
|
-
}
|
|
39167
|
-
spawnAttempt(decodeHwAccel) {
|
|
39168
|
-
const args = buildFfmpegArgs({
|
|
39169
|
-
...this.args.invocation,
|
|
39170
|
-
decodeHwAccel,
|
|
39171
|
-
sink: {
|
|
39172
|
-
kind: "stdout",
|
|
39173
|
-
container: "mp4",
|
|
39174
|
-
fragmentMs: this.args.fragmentMs
|
|
39175
|
-
}
|
|
39176
|
-
});
|
|
39177
|
-
this.deps.logger.info("fmp4 fragment child: spawning ffmpeg", {
|
|
39178
|
-
tags: { deviceId: this.args.deviceId },
|
|
39179
|
-
meta: {
|
|
39180
|
-
sourceId: this.args.sourceId,
|
|
39181
|
-
fragmentMs: this.args.fragmentMs,
|
|
39182
|
-
decodeHwAccel: decodeHwAccel ?? "software",
|
|
39183
|
-
argv: args.join(" ")
|
|
39184
|
-
}
|
|
39185
|
-
});
|
|
39186
|
-
return new Promise((resolve, reject) => {
|
|
39187
|
-
const child = this.deps.spawnFn(this.deps.ffmpegBinaryPath, args, { stdio: [
|
|
39188
|
-
"ignore",
|
|
39189
|
-
"pipe",
|
|
39190
|
-
"pipe"
|
|
39191
|
-
] });
|
|
39192
|
-
this.child = child;
|
|
39193
|
-
let settled = false;
|
|
39194
|
-
/**
|
|
39195
|
-
* This attempt FAILED. Set before the kill, because SIGTERM makes the
|
|
39196
|
-
* child exit and that exit must not be reported as a death: the retry —
|
|
39197
|
-
* or the caller's rejection — already owns what happens next. Without it
|
|
39198
|
-
* the timeout path ends the plane the software retry is about to fill,
|
|
39199
|
-
* and the consumer sees a stream that stopped for no reason. A "which
|
|
39200
|
-
* spawn is current" counter does NOT cover this: the retry has not been
|
|
39201
|
-
* spawned when the kill's exit arrives.
|
|
39202
|
-
*/
|
|
39203
|
-
let failed = false;
|
|
39204
|
-
/**
|
|
39205
|
-
* This attempt is still the live producer: it has not failed (a failure
|
|
39206
|
-
* hands ownership to the retry, or to the caller's rejection) and nothing
|
|
39207
|
-
* has stopped the child. Those two cover every way an attempt stops being
|
|
39208
|
-
* current — `start` only respawns after a rejection.
|
|
39209
|
-
*/
|
|
39210
|
-
const isCurrent = () => !this.stopped && !failed;
|
|
39211
|
-
const timeoutMs = this.deps.firstUnitTimeoutMs ?? DEFAULT_FIRST_UNIT_TIMEOUT_MS;
|
|
39212
|
-
const settle = (fail) => {
|
|
39213
|
-
if (settled) return;
|
|
39214
|
-
settled = true;
|
|
39215
|
-
clearTimeout(timer);
|
|
39216
|
-
if (fail) {
|
|
39217
|
-
failed = true;
|
|
39218
|
-
reject(fail);
|
|
39219
|
-
} else resolve();
|
|
39220
|
-
};
|
|
39221
|
-
const timer = setTimeout(() => {
|
|
39222
|
-
settle(/* @__PURE__ */ new Error(`fmp4 fragment child: no fragment within ${timeoutMs}ms`));
|
|
39223
|
-
this.killChild();
|
|
39224
|
-
}, timeoutMs);
|
|
39225
|
-
timer.unref?.();
|
|
39226
|
-
child.stdout?.on("data", (chunk) => {
|
|
39227
|
-
for (const unit of this.splitter.push(chunk)) {
|
|
39228
|
-
this.unitsOut += 1;
|
|
39229
|
-
this.args.plane.publish(unit);
|
|
39230
|
-
if (unit.kind === "init") {
|
|
39231
|
-
this.deps.logger.info("fmp4 fragment child: INIT segment cut", {
|
|
39232
|
-
tags: { deviceId: this.args.deviceId },
|
|
39233
|
-
meta: {
|
|
39234
|
-
sourceId: this.args.sourceId,
|
|
39235
|
-
bytes: unit.data.length
|
|
39236
|
-
}
|
|
39237
|
-
});
|
|
39238
|
-
settle();
|
|
39239
|
-
} else if (this.unitsOut % FRAGMENT_LOG_EVERY === 0) this.deps.logger.info("fmp4 fragment child: fragments still flowing", {
|
|
39240
|
-
tags: { deviceId: this.args.deviceId },
|
|
39241
|
-
meta: {
|
|
39242
|
-
sourceId: this.args.sourceId,
|
|
39243
|
-
unitsOut: this.unitsOut,
|
|
39244
|
-
bytes: unit.data.length,
|
|
39245
|
-
subscribers: this.args.plane.subscriberCount
|
|
39246
|
-
}
|
|
39247
|
-
});
|
|
39248
|
-
}
|
|
39249
|
-
const fault = this.splitter.fault;
|
|
39250
|
-
if (fault !== null) this.onFault(fault, settled, isCurrent(), settle);
|
|
39251
|
-
});
|
|
39252
|
-
child.stderr?.setEncoding("utf8");
|
|
39253
|
-
child.stderr?.on("data", (line) => {
|
|
39254
|
-
this.deps.logger.debug("fmp4 fragment child ffmpeg", {
|
|
39255
|
-
tags: { deviceId: this.args.deviceId },
|
|
39256
|
-
meta: {
|
|
39257
|
-
sourceId: this.args.sourceId,
|
|
39258
|
-
line: line.trim()
|
|
39259
|
-
}
|
|
39260
|
-
});
|
|
39261
|
-
});
|
|
39262
|
-
child.once("error", (err) => {
|
|
39263
|
-
if (!settled) {
|
|
39264
|
-
settle(err);
|
|
39265
|
-
return;
|
|
39266
|
-
}
|
|
39267
|
-
if (!isCurrent()) return;
|
|
39268
|
-
this.args.plane.end("the fragment child errored");
|
|
39269
|
-
this.deps.onChildExit?.(err);
|
|
39270
|
-
});
|
|
39271
|
-
child.once("exit", (code, signal) => {
|
|
39272
|
-
if (!settled) {
|
|
39273
|
-
settle(/* @__PURE__ */ new Error(`fmp4 fragment child: ffmpeg exited before any fragment (code=${code} signal=${signal})`));
|
|
39274
|
-
return;
|
|
39275
|
-
}
|
|
39276
|
-
if (!isCurrent()) return;
|
|
39277
|
-
const error = /* @__PURE__ */ new Error(`fmp4 fragment child: ffmpeg exited while live (code=${code} signal=${signal})`);
|
|
39278
|
-
this.deps.logger.warn("fmp4 fragment child: ffmpeg exited while live", {
|
|
39279
|
-
tags: { deviceId: this.args.deviceId },
|
|
39280
|
-
meta: {
|
|
39281
|
-
sourceId: this.args.sourceId,
|
|
39282
|
-
code,
|
|
39283
|
-
signal,
|
|
39284
|
-
unitsOut: this.unitsOut
|
|
39285
|
-
}
|
|
39286
|
-
});
|
|
39287
|
-
this.args.plane.end("the fragment child exited");
|
|
39288
|
-
this.deps.onChildExit?.(error);
|
|
39289
|
-
});
|
|
39290
|
-
});
|
|
39291
|
-
}
|
|
39292
|
-
/**
|
|
39293
|
-
* The byte stream stopped being splittable. Not recoverable — the splitter
|
|
39294
|
-
* cannot resynchronise mid-box — so the child is a corpse and every consumer
|
|
39295
|
-
* has to be told, loudly, with the reason.
|
|
39296
|
-
*/
|
|
39297
|
-
onFault(reason, wasLive, current, settle) {
|
|
39298
|
-
const error = /* @__PURE__ */ new Error(`fmp4 fragment child: ${reason}`);
|
|
39299
|
-
this.deps.logger.error("fmp4 fragment child: the ffmpeg output stopped parsing as fMP4", {
|
|
39300
|
-
tags: { deviceId: this.args.deviceId },
|
|
39301
|
-
meta: {
|
|
39302
|
-
sourceId: this.args.sourceId,
|
|
39303
|
-
unitsOut: this.unitsOut,
|
|
39304
|
-
interstitial: this.splitter.discardedInterstitialTypes,
|
|
39305
|
-
reason
|
|
39306
|
-
}
|
|
39307
|
-
});
|
|
39308
|
-
this.killChild();
|
|
39309
|
-
settle(error);
|
|
39310
|
-
if (wasLive && current) {
|
|
39311
|
-
this.args.plane.end("the fragment child produced unsplittable output");
|
|
39312
|
-
this.deps.onChildExit?.(error);
|
|
39313
|
-
}
|
|
39314
|
-
}
|
|
39315
|
-
killChild() {
|
|
39316
|
-
const child = this.child;
|
|
39317
|
-
this.child = null;
|
|
39318
|
-
if (child && !child.killed) try {
|
|
39319
|
-
child.kill("SIGTERM");
|
|
39320
|
-
} catch (err) {
|
|
39321
|
-
this.deps.logger.warn("fmp4 fragment child: kill error", {
|
|
39322
|
-
tags: { deviceId: this.args.deviceId },
|
|
39323
|
-
meta: {
|
|
39324
|
-
sourceId: this.args.sourceId,
|
|
39325
|
-
error: errMsg$15(err)
|
|
39326
|
-
}
|
|
39327
|
-
});
|
|
39328
|
-
}
|
|
39329
|
-
}
|
|
39330
|
-
};
|
|
39440
|
+
/**
|
|
39441
|
+
* Compute the stable 64-char lowercase-hex fingerprint of a device's
|
|
39442
|
+
* export-relevant shape. Two structurally-equal shapes (any feature order,
|
|
39443
|
+
* any duplicates, any deviceId) hash identically.
|
|
39444
|
+
*/
|
|
39445
|
+
function canonicalDeviceFingerprint(shape) {
|
|
39446
|
+
const features = [...new Set(shape.features)].toSorted();
|
|
39447
|
+
return canonicalHash({
|
|
39448
|
+
deviceType: shape.deviceType,
|
|
39449
|
+
features
|
|
39450
|
+
});
|
|
39451
|
+
}
|
|
39452
|
+
/**
|
|
39453
|
+
* Resolve the fingerprint an exporter should feed into `diffExportTargets`
|
|
39454
|
+
* for one device this cycle.
|
|
39455
|
+
*
|
|
39456
|
+
* When a device is NOT yet probe-ready, carry forward its last-advertised
|
|
39457
|
+
* (persisted) fingerprint so it nets to NO CHANGE in `diffExportTargets`
|
|
39458
|
+
* (neither update nor remove) — never advertise a partial mid-probe shape. A
|
|
39459
|
+
* brand-new un-probed device with no persisted entry falls back to `fresh` so
|
|
39460
|
+
* it can advertise once.
|
|
39461
|
+
*/
|
|
39462
|
+
function resolveExportFingerprint(input) {
|
|
39463
|
+
if (input.ready) return input.fresh;
|
|
39464
|
+
return input.persisted ?? input.fresh;
|
|
39465
|
+
}
|
|
39331
39466
|
//#endregion
|
|
39332
39467
|
//#region ../../node_modules/tslib/tslib.es6.mjs
|
|
39333
39468
|
var tslib_es6_exports = /* @__PURE__ */ __exportAll({
|