@camstack/addon-export-hap 1.2.89 → 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.
@@ -84,7 +84,7 @@ function carryForward(base, existing, keys) {
84
84
  return out;
85
85
  }
86
86
  //#endregion
87
- //#region ../types/dist/event-category-zAv7pMUz.mjs
87
+ //#region ../types/dist/event-category-CnLqLOKs.mjs
88
88
  var EventCategory = /* @__PURE__ */ function(EventCategory) {
89
89
  EventCategory["SystemBoot"] = "system.boot";
90
90
  EventCategory["SystemAddonsReady"] = "system.addons-ready";
@@ -279,6 +279,19 @@ var EventCategory = /* @__PURE__ */ function(EventCategory) {
279
279
  EventCategory["ProcessCrashed"] = "process.crashed";
280
280
  EventCategory["ProcessRestartScheduled"] = "process.restart_scheduled";
281
281
  EventCategory["ProcessRestarted"] = "process.restarted";
282
+ /**
283
+ * The SET of storage locations changed — one was created, edited, enabled,
284
+ * disabled or deleted through `storage.upsertLocation` / `deleteLocation`.
285
+ *
286
+ * Telemetry, not a transaction (D8/D11): every consumer that re-resolves on
287
+ * it must also converge on its own periodic path, because a dropped event
288
+ * must not leave a node writing to yesterday's disk set forever. It exists
289
+ * because there was NO signal at all — an operator who added a second
290
+ * recordings disk in the admin UI got nothing, and the recorder kept its
291
+ * resolved locations until something else happened to re-resolve them
292
+ * (D387). Payload `StorageLocationsChangedPayload`.
293
+ */
294
+ EventCategory["StorageLocationsChanged"] = "storage.locations-changed";
282
295
  EventCategory["RecordingStarted"] = "recording.started";
283
296
  EventCategory["RecordingStopped"] = "recording.stopped";
284
297
  EventCategory["RecordingError"] = "recording.error";
@@ -8281,111 +8294,6 @@ var CameraSwitchGroupSchema = object({
8281
8294
  fetchedAt: number()
8282
8295
  });
8283
8296
  /**
8284
- * Per-component log CHANNELS — the gate a hot path consults, and the registry
8285
- * an addon declares its channels in.
8286
- *
8287
- * ## Two axes, deliberately separated
8288
- *
8289
- * - **DECLARATION** — which channels exist. Only the addon knows:
8290
- * `stream-broker` knows webrtc/ICE/RTP, `provider-reolink` knows
8291
- * baichuan/handshake. A hand-wired central list rots at the first addition,
8292
- * and rots silently. So a channel is declared where it is consulted, and the
8293
- * `log-channels` capability enumerates the declarations.
8294
- * - **VALUE** — at which level, for which scope, until when. That stays ONE
8295
- * thing: the logging settings document on the `system` cap. Two authorities
8296
- * over the values is the exact defect
8297
- * `docs/design/plans/2026-08-26-logging-per-componente.md` was written to
8298
- * remove; re-introducing it from the cure side would be grotesque.
8299
- *
8300
- * Nothing in this file reads a clock, an env var or a store. The registry is
8301
- * a MIRROR: it is moved only by {@link LogChannelRegistry.apply}, called off
8302
- * the hot path with a value somebody actually read, and by
8303
- * {@link LogChannelRegistry.tick}, called on a timer. A store read that fails
8304
- * never reaches here, so it can neither disarm an armed channel nor arm a
8305
- * disarmed one (D49).
8306
- *
8307
- * ## The canonical call shape
8308
- *
8309
- * ```ts
8310
- * if (CH_RTP.on && CH_RTP.wants(deviceId)) {
8311
- * CH_RTP.log(logger, 'rtp subscriber added', { tags: { deviceId }, meta: { ssrc } })
8312
- * }
8313
- * ```
8314
- *
8315
- * `on` is a plain boolean FIELD — never a getter — and it is the FIRST thing
8316
- * read. Disarmed, a call site costs one load and one branch, and the `extras`
8317
- * object literal is never constructed because it lives inside the branch. It
8318
- * is the same shape already proven in production at `stream-broker.ts:1650`,
8319
- * and the same discipline `LoggingGate.allowsDestination` uses for the
8320
- * destination floor (measured at 1.93 ns/call when off).
8321
- *
8322
- * ## Why a channel emits at `info`
8323
- *
8324
- * `loki-logging.addon.ts` pins the destination default at `info` and
8325
- * `loki-destination.ts` drops everything below it, so a line emitted at
8326
- * `debug` never reaches Loki and the hub's in-memory ring only holds ~35
8327
- * minutes. A diagnostic that cannot be read an hour later is worse than no
8328
- * diagnostic, because it looks done. {@link LogChannelGate.log} therefore
8329
- * emits at the channel's declared level, whose schema floor is `info`.
8330
- */
8331
- /**
8332
- * The level a channel writes at once armed.
8333
- *
8334
- * `debug` is absent ON PURPOSE and not by omission: below `info` the line does
8335
- * not leave the process for Loki, and the whole point of arming a channel is
8336
- * to read it later.
8337
- */
8338
- var LogChannelLevelSchema = _enum([
8339
- "info",
8340
- "warn",
8341
- "error"
8342
- ]);
8343
- /**
8344
- * What an addon declares about one channel. No value, no state — a
8345
- * declaration is inert.
8346
- */
8347
- var LogChannelDescriptorSchema = object({
8348
- /**
8349
- * Dotted `area.thing`, unique across the workspace. `area` is conventionally
8350
- * the addon's short name so an operator reading a channel list can tell who
8351
- * owns it without a second lookup.
8352
- */
8353
- name: string().min(3).regex(/^[a-z0-9-]+(\.[a-z0-9-]+)+$/, "a channel name is dotted lower-kebab, e.g. area.thing"),
8354
- /** One sentence: what the operator will SEE after arming it. */
8355
- description: string().min(1),
8356
- /** The level its lines are emitted at. Never below `info`. */
8357
- defaultLevel: LogChannelLevelSchema,
8358
- /**
8359
- * Whether this channel can be narrowed to a camera.
8360
- *
8361
- * `true` is a PROMISE with two halves, and both must hold: the gate is
8362
- * consulted with the numeric device id, AND every line the channel admits
8363
- * carries `tags: { deviceId }` with that same numeric id. The second half is
8364
- * what makes `| json | deviceId="617"` work in Loki — `loki-payload.ts`
8365
- * keeps `deviceId` out of the stream labels for cardinality, so the tag in
8366
- * the body is the only way to filter.
8367
- *
8368
- * A channel whose lines carry the device only in `meta` (or not at all) is
8369
- * declared `false`. Declaring it `true` anyway would be a lie the UI repeats:
8370
- * the operator narrows to one camera, sees nothing, and concludes the code
8371
- * path was never taken.
8372
- */
8373
- perDevice: boolean()
8374
- });
8375
- /**
8376
- * An armed window over one channel, as the document hands it to a mirror.
8377
- *
8378
- * A window is a DEADLINE, never a flag (ADR-0244): a channel somebody forgot
8379
- * expires by itself, which is the one failure a boolean cannot avoid.
8380
- */
8381
- var LogChannelWindowSchema = object({
8382
- channel: string().min(1),
8383
- /** Epoch ms the window closes at. */
8384
- armedUntilMs: number(),
8385
- /** `null` = every camera. A non-empty list narrows to those numeric ids. */
8386
- deviceIds: array(number().int()).readonly().nullable()
8387
- });
8388
- /**
8389
8297
  * Ops-log — the durable, append-only operations audit shared by the
8390
8298
  * recordings and events management surfaces.
8391
8299
  *
@@ -9307,6 +9215,21 @@ var StorageCleanupJobSchema = object({
9307
9215
  });
9308
9216
  var StorageCleanupStatusInputSchema = object({ jobId: string().optional() });
9309
9217
  /**
9218
+ * The one typed state of a storage location. Authoritative Zod schema — the TS
9219
+ * alias below is `z.infer<>` of it, never a second spelling.
9220
+ */
9221
+ var StorageLocationModeSchema = _enum([
9222
+ "active",
9223
+ "readonly",
9224
+ "drain",
9225
+ "disabled"
9226
+ ]);
9227
+ _enum([
9228
+ "normal",
9229
+ "never",
9230
+ "drain"
9231
+ ]);
9232
+ /**
9310
9233
  * `StorageLocationType` — an addon-declared id that identifies the *kind* of
9311
9234
  * storage a location serves. Defined here (not in `capabilities/storage.cap.ts`)
9312
9235
  * so the persisted record schema and the consumer-facing cap can both consume it
@@ -9331,8 +9254,11 @@ var StorageLocationTypeSchema = string().regex(/^[a-z][a-zA-Z0-9-]*$/);
9331
9254
  * `STORAGE_LOCATION_CARDINALITY` map has been removed.
9332
9255
  *
9333
9256
  * `id` is a stable namespaced string of the form `<type>:<slug>`.
9334
- * The default location for a type uses `id === <type>:default` by
9335
- * convention (the bare type ref like `'backups'` resolves to it).
9257
+ * The seed names its first instance `<type>:default` — a NAME, not a flag.
9258
+ * There is no default location any more (D383): `enabled` is the whole write
9259
+ * model, and a bare type ref resolves to the sole location of the type, or —
9260
+ * transitionally, only while legacy NULL-stamped rows exist — to the row whose
9261
+ * slug is `default`.
9336
9262
  *
9337
9263
  * `isSystem` is a legacy persisted flag. Seed still creates the initial
9338
9264
  * `<type>:default` locations; the flag is no longer a lock, a badge, or a
@@ -9353,23 +9279,37 @@ var StorageLocationSchema = object({
9353
9279
  * flag at upsert time, not here (the schema is provider-agnostic).
9354
9280
  */
9355
9281
  nodeId: string().optional(),
9356
- isDefault: boolean().default(false),
9357
9282
  isSystem: boolean().default(false),
9358
9283
  /**
9359
- * Operator opt-in: whether consumers that BALANCE across several locations
9360
- * of a type may write here. Recordings reads it today; event media and
9361
- * backups are the next consumers, which is why the flag lives on the
9362
- * location rather than in any one addon's store — nothing has to be
9363
- * extended to add the next consumer.
9284
+ * THE write switch, and the only one (D383). `enabled: true` means every
9285
+ * consumer that chooses a write target for this type may write here, and all
9286
+ * enabled locations of a type are used TOGETHER; `false` means read-only —
9287
+ * still read, still played back, still age-swept, still drained, never
9288
+ * written.
9364
9289
  *
9365
- * OPTIONAL, and ABSENT MEANS ACTIVE. Every location persisted before the
9366
- * flag existed reads back with no flag and keeps working exactly as before;
9367
- * that is the whole compat story, and it is why no migration ships with it.
9368
- * A newly CREATED sibling is stamped `false` by the orchestrator (creating a
9369
- * disk must not silently start writing to it); the default of a type is
9370
- * always stamped `true`.
9290
+ * OPTIONAL only for the wire: an upsert that omits it means "leave what is
9291
+ * stored" on an update and "born inert unless it is the first location of its
9292
+ * type" on a create. On a PERSISTED row absence is legacy and it means
9293
+ * enabled — {@link isLocationEnabled} is the one place that says so, and the
9294
+ * orchestrator stamps every flagless row `true` once at hydrate so absence
9295
+ * stops existing rather than being re-derived on every read.
9371
9296
  */
9372
9297
  enabled: boolean().optional(),
9298
+ /**
9299
+ * THE state of this location (D385), and the only authority on what may be
9300
+ * written, read or evicted here. Interpreted in exactly one place —
9301
+ * `storage-location-mode.ts` — which also folds the legacy
9302
+ * `enabled` / `config.readOnly` pair into a mode so an old row is never
9303
+ * ambiguous.
9304
+ *
9305
+ * OPTIONAL only for the wire and for rows written before D385: absence is
9306
+ * resolved by `resolveLocationMode`, and the orchestrator stamps every
9307
+ * unstamped row ONCE at hydrate so absence stops existing rather than being
9308
+ * re-derived on every read. `enabled` survives one release as a DERIVED
9309
+ * mirror (`mode === 'active'`); `withLocationMode` is the only writer of
9310
+ * either, so the two cannot disagree.
9311
+ */
9312
+ mode: StorageLocationModeSchema.optional(),
9373
9313
  /** COMPUTED at read time by the orchestrator (statfs of the backing volume
9374
9314
  * for node-local locations it can reach) — never persisted, absent when the
9375
9315
  * volume is remote/unreachable. The single capacity truth every UI reads. */
@@ -9377,13 +9317,50 @@ var StorageLocationSchema = object({
9377
9317
  totalBytes: number(),
9378
9318
  availableBytes: number()
9379
9319
  }).nullable().optional(),
9320
+ /**
9321
+ * How much of that volume CamStack ITSELF holds on this location (D388) —
9322
+ * COMPUTED at read time from the `storage-occupancy` providers' own figures,
9323
+ * never persisted, never a filesystem walk.
9324
+ *
9325
+ * **ABSENT MEANS UNKNOWN, never zero.** No provider has reported for this
9326
+ * location yet — nobody stores here, the owning addon is down, or the first
9327
+ * refresh has not completed. A UI must omit the segment rather than draw it
9328
+ * at zero, which would claim we occupy nothing (D315). It is an OBJECT and
9329
+ * not a bare number precisely so that a `?? 0` on the consuming side has to
9330
+ * be spelled out loud instead of appearing by accident.
9331
+ *
9332
+ * `measuredAtMs` is the OLDEST contributing measurement, so it is honest
9333
+ * about the whole figure rather than about its freshest part.
9334
+ */
9335
+ owned: object({
9336
+ bytes: number().int().nonnegative(),
9337
+ measuredAtMs: number().int().nonnegative()
9338
+ }).optional(),
9380
9339
  createdAt: number(),
9381
9340
  updatedAt: number()
9382
9341
  });
9342
+ object({ isDefault: boolean().optional() });
9343
+ /**
9344
+ * How far a `drain` has got (D386) — the read a UI renders, and nothing more.
9345
+ *
9346
+ * `estimatedEmptyAtMs` is derived from the growth the ratchet has actually
9347
+ * OBSERVED and is `null` when it has observed none. Never a fabricated date: a
9348
+ * drain with no observed growth has no honest ETA, and inventing one is how an
9349
+ * operator learns not to believe the screen.
9350
+ */
9351
+ var StorageDrainProgressSchema = object({
9352
+ locationId: string(),
9353
+ startedAtMs: number(),
9354
+ startBytes: number(),
9355
+ bytesRemaining: number(),
9356
+ drained: boolean(),
9357
+ estimatedEmptyAtMs: number().nullable()
9358
+ });
9383
9359
  /**
9384
9360
  * Reference accepted by consumer-facing `api.storage.*` calls.
9385
9361
  * Either:
9386
- * - a `StorageLocationType` (e.g. `'backups'`) → orchestrator resolves to the default of that type
9362
+ * - a `StorageLocationType` (e.g. `'backups'`) → the sole location of that type
9363
+ * (transitionally, the `<type>:default`-slugged row when several exist)
9387
9364
  * - a fully-qualified id (e.g. `'backups:nas-01'`) → addresses a specific instance
9388
9365
  *
9389
9366
  * The orchestrator's `resolveRef(ref)` handles both cases.
@@ -9559,6 +9536,111 @@ var DecoderSessionConfigSchema = object({
9559
9536
  */
9560
9537
  debug: boolean().optional()
9561
9538
  });
9539
+ /**
9540
+ * Per-component log CHANNELS — the gate a hot path consults, and the registry
9541
+ * an addon declares its channels in.
9542
+ *
9543
+ * ## Two axes, deliberately separated
9544
+ *
9545
+ * - **DECLARATION** — which channels exist. Only the addon knows:
9546
+ * `stream-broker` knows webrtc/ICE/RTP, `provider-reolink` knows
9547
+ * baichuan/handshake. A hand-wired central list rots at the first addition,
9548
+ * and rots silently. So a channel is declared where it is consulted, and the
9549
+ * `log-channels` capability enumerates the declarations.
9550
+ * - **VALUE** — at which level, for which scope, until when. That stays ONE
9551
+ * thing: the logging settings document on the `system` cap. Two authorities
9552
+ * over the values is the exact defect
9553
+ * `docs/design/plans/2026-08-26-logging-per-componente.md` was written to
9554
+ * remove; re-introducing it from the cure side would be grotesque.
9555
+ *
9556
+ * Nothing in this file reads a clock, an env var or a store. The registry is
9557
+ * a MIRROR: it is moved only by {@link LogChannelRegistry.apply}, called off
9558
+ * the hot path with a value somebody actually read, and by
9559
+ * {@link LogChannelRegistry.tick}, called on a timer. A store read that fails
9560
+ * never reaches here, so it can neither disarm an armed channel nor arm a
9561
+ * disarmed one (D49).
9562
+ *
9563
+ * ## The canonical call shape
9564
+ *
9565
+ * ```ts
9566
+ * if (CH_RTP.on && CH_RTP.wants(deviceId)) {
9567
+ * CH_RTP.log(logger, 'rtp subscriber added', { tags: { deviceId }, meta: { ssrc } })
9568
+ * }
9569
+ * ```
9570
+ *
9571
+ * `on` is a plain boolean FIELD — never a getter — and it is the FIRST thing
9572
+ * read. Disarmed, a call site costs one load and one branch, and the `extras`
9573
+ * object literal is never constructed because it lives inside the branch. It
9574
+ * is the same shape already proven in production at `stream-broker.ts:1650`,
9575
+ * and the same discipline `LoggingGate.allowsDestination` uses for the
9576
+ * destination floor (measured at 1.93 ns/call when off).
9577
+ *
9578
+ * ## Why a channel emits at `info`
9579
+ *
9580
+ * `loki-logging.addon.ts` pins the destination default at `info` and
9581
+ * `loki-destination.ts` drops everything below it, so a line emitted at
9582
+ * `debug` never reaches Loki and the hub's in-memory ring only holds ~35
9583
+ * minutes. A diagnostic that cannot be read an hour later is worse than no
9584
+ * diagnostic, because it looks done. {@link LogChannelGate.log} therefore
9585
+ * emits at the channel's declared level, whose schema floor is `info`.
9586
+ */
9587
+ /**
9588
+ * The level a channel writes at once armed.
9589
+ *
9590
+ * `debug` is absent ON PURPOSE and not by omission: below `info` the line does
9591
+ * not leave the process for Loki, and the whole point of arming a channel is
9592
+ * to read it later.
9593
+ */
9594
+ var LogChannelLevelSchema = _enum([
9595
+ "info",
9596
+ "warn",
9597
+ "error"
9598
+ ]);
9599
+ /**
9600
+ * What an addon declares about one channel. No value, no state — a
9601
+ * declaration is inert.
9602
+ */
9603
+ var LogChannelDescriptorSchema = object({
9604
+ /**
9605
+ * Dotted `area.thing`, unique across the workspace. `area` is conventionally
9606
+ * the addon's short name so an operator reading a channel list can tell who
9607
+ * owns it without a second lookup.
9608
+ */
9609
+ name: string().min(3).regex(/^[a-z0-9-]+(\.[a-z0-9-]+)+$/, "a channel name is dotted lower-kebab, e.g. area.thing"),
9610
+ /** One sentence: what the operator will SEE after arming it. */
9611
+ description: string().min(1),
9612
+ /** The level its lines are emitted at. Never below `info`. */
9613
+ defaultLevel: LogChannelLevelSchema,
9614
+ /**
9615
+ * Whether this channel can be narrowed to a camera.
9616
+ *
9617
+ * `true` is a PROMISE with two halves, and both must hold: the gate is
9618
+ * consulted with the numeric device id, AND every line the channel admits
9619
+ * carries `tags: { deviceId }` with that same numeric id. The second half is
9620
+ * what makes `| json | deviceId="617"` work in Loki — `loki-payload.ts`
9621
+ * keeps `deviceId` out of the stream labels for cardinality, so the tag in
9622
+ * the body is the only way to filter.
9623
+ *
9624
+ * A channel whose lines carry the device only in `meta` (or not at all) is
9625
+ * declared `false`. Declaring it `true` anyway would be a lie the UI repeats:
9626
+ * the operator narrows to one camera, sees nothing, and concludes the code
9627
+ * path was never taken.
9628
+ */
9629
+ perDevice: boolean()
9630
+ });
9631
+ /**
9632
+ * An armed window over one channel, as the document hands it to a mirror.
9633
+ *
9634
+ * A window is a DEADLINE, never a flag (ADR-0244): a channel somebody forgot
9635
+ * expires by itself, which is the one failure a boolean cannot avoid.
9636
+ */
9637
+ var LogChannelWindowSchema = object({
9638
+ channel: string().min(1),
9639
+ /** Epoch ms the window closes at. */
9640
+ armedUntilMs: number(),
9641
+ /** `null` = every camera. A non-empty list narrows to those numeric ids. */
9642
+ deviceIds: array(number().int()).readonly().nullable()
9643
+ });
9562
9644
  function pickPreferredRtspEntry(entries, pref, deviceId, options = {}) {
9563
9645
  if (entries.length === 0) return null;
9564
9646
  const prefix = `${deviceId}/`;
@@ -22358,7 +22440,7 @@ method(object({
22358
22440
  downloadId: string(),
22359
22441
  offset: number(),
22360
22442
  length: number()
22361
- }), _instanceof(Uint8Array)), method(object({ downloadId: string() }), _void(), { kind: "mutation" }), method(object({ type: StorageLocationTypeSchema.optional() }), array(StorageLocationSchema).readonly()), method(object({ type: StorageLocationTypeSchema }), StorageLocationSchema.nullable()), method(_void(), array(StorageLocationDeclarationSchema).readonly()), method(StorageLocationSchema.omit({
22443
+ }), _instanceof(Uint8Array)), method(object({ downloadId: string() }), _void(), { kind: "mutation" }), method(object({ type: StorageLocationTypeSchema.optional() }), array(StorageLocationSchema).readonly()), method(_void(), array(StorageLocationDeclarationSchema).readonly()), method(StorageLocationSchema.omit({
22362
22444
  createdAt: true,
22363
22445
  updatedAt: true
22364
22446
  }), StorageLocationSchema, {
@@ -22370,7 +22452,7 @@ method(object({
22370
22452
  }), _void(), {
22371
22453
  kind: "mutation",
22372
22454
  auth: "admin"
22373
- }), method(object({ id: string() }), object({
22455
+ }), method(_void(), array(StorageDrainProgressSchema).readonly()), method(object({ id: string() }), object({
22374
22456
  ok: boolean(),
22375
22457
  error: string().optional()
22376
22458
  }), { auth: "admin" }), method(_void(), array(ProviderListEntrySchema).readonly()), method(object({
@@ -22440,6 +22522,51 @@ method(StorageMigrationInputSchema, StorageMigrationPlanSchema, { auth: "admin"
22440
22522
  kind: "mutation",
22441
22523
  auth: "admin"
22442
22524
  }), method(object({}), array(StorageMigrationJobSchema).readonly(), { auth: "admin" });
22525
+ /**
22526
+ * `storage-occupancy` — how many bytes an addon actually HOLDS on a storage
22527
+ * location (D388).
22528
+ *
22529
+ * ## Why this is not `storage-evictable`
22530
+ *
22531
+ * `storage-evictable.getEvictableUsage` looks like the same question and is
22532
+ * not, in two ways that both matter and both bite hardest on the locations an
22533
+ * operator most wants a figure for:
22534
+ *
22535
+ * - it reports the whole eviction DOMAIN, not the location. `recordings:default`
22536
+ * and `recordingsLow:default` deliberately share one root and evict as one
22537
+ * oldest-first pool, so both answer with the SAME combined total. As an
22538
+ * occupancy figure that double-counts the disk.
22539
+ * - it reports ZERO for a location whose eviction policy is `never` (D385) —
22540
+ * a `readonly` or `disabled` disk. Those are exactly the disks an operator
22541
+ * is retiring and staring at.
22542
+ *
22543
+ * So this is its own contract with its own quantity, and the quantity is
22544
+ * OCCUPIED: every byte the addon holds on that location, whether or not it
22545
+ * would ever be willing to delete it. A provider that can only answer
22546
+ * "evictable" must not register here — a number that silently means different
22547
+ * things per class is worse than no number.
22548
+ *
22549
+ * ## Absence is an answer
22550
+ *
22551
+ * A location nobody reports for is UNKNOWN, never zero (D315). The orchestrator
22552
+ * stamps `StorageLocation.owned` only for locations it has a report for, and
22553
+ * the field is an OBJECT rather than a bare number so that a `?? 0` on the
22554
+ * consuming side has to be written out loud instead of appearing by accident.
22555
+ *
22556
+ * `internal: true` — consumed by the orchestrator's `listLocations` stamp, never
22557
+ * a public client surface. Clients read the stamped `StorageLocation.owned`.
22558
+ */
22559
+ /** One provider's occupancy answer for one location. */
22560
+ var StorageOccupancyReportSchema = object({
22561
+ locationId: string(),
22562
+ /** Bytes this provider holds on THAT location — not its eviction domain, and
22563
+ * not net of what it is willing to delete. */
22564
+ ownedBytes: number().int().nonnegative(),
22565
+ /** When the provider last actually measured this. The orchestrator carries it
22566
+ * through so a UI can say how old the figure is instead of implying "now". */
22567
+ measuredAtMs: number().int().nonnegative()
22568
+ });
22569
+ method(object({ locationIds: array(string()).readonly() }), array(StorageOccupancyReportSchema).readonly(), { auth: "admin" });
22443
22570
  var ProviderInfoSchema = discriminatedUnion("shouldSaveDiskSpace", [object({
22444
22571
  providerId: string().min(1),
22445
22572
  displayName: string().min(1),
@@ -24079,39 +24206,6 @@ DeviceType.Camera, DeviceType.Sensor, DeviceType.Button, DeviceType.Switch, meth
24079
24206
  deviceId: number(),
24080
24207
  status: BatteryStatusSchema
24081
24208
  });
24082
- /**
24083
- * Network-link snapshot. Same shape for every provider (a Reolink wifi
24084
- * camera, a Home Assistant device with a signal-strength sensor, a Tapo
24085
- * plug): one slice under `device.runtimeState['network-link']`, one badge,
24086
- * one Home Assistant projection.
24087
- */
24088
- var NetworkLinkStatusSchema = object({
24089
- /** The link the device is on. `'unknown'` = not read yet, not "no link". */
24090
- type: _enum([
24091
- "wifi",
24092
- "ethernet",
24093
- "cellular",
24094
- "unknown"
24095
- ]),
24096
- /**
24097
- * Link quality, 0..100 inclusive, normalised by the provider from whatever
24098
- * the firmware reports (bars, RSSI, a vendor scale). **`null` means NOT
24099
- * KNOWN or NOT APPLICABLE** — a wired link has no signal, and a wireless
24100
- * one whose reading has not landed must not be drawn at 0 %. Consumers
24101
- * SKIP a null rather than coerce it.
24102
- */
24103
- signalPercent: number().min(0).max(100).nullable(),
24104
- /** Raw received signal strength in dBm, when the firmware reports one. */
24105
- rssiDbm: number().optional(),
24106
- /** Network name of a wireless link, when the firmware reports it. */
24107
- ssid: string().optional(),
24108
- /** Ms epoch of the last observation. Lets consumers reason about freshness. */
24109
- lastUpdated: number()
24110
- });
24111
- DeviceType.Camera, DeviceType.Sensor, DeviceType.Button, DeviceType.Switch, DeviceType.Light, DeviceType.Lock, DeviceType.Siren, object({
24112
- deviceId: number(),
24113
- status: NetworkLinkStatusSchema
24114
- });
24115
24209
  object({
24116
24210
  on: boolean(),
24117
24211
  /** Ms epoch of the last transition. 0 if never observed. */
@@ -26509,6 +26603,236 @@ DeviceType.Camera, method(object({
26509
26603
  detection: NativeDetectionSchema
26510
26604
  });
26511
26605
  /**
26606
+ * `navigation` — a device-scoped capability that natively expresses the FULL
26607
+ * navigation / action surface of a robot that DRIVES ITSELF and carries an
26608
+ * on-board camera (the Dreame robot-vacuum camera is the first provider).
26609
+ *
26610
+ * Why a NEW cap rather than overloading `ptz`:
26611
+ * - `ptz` moves a *gimbal* on a fixed camera (pan/tilt/zoom of the lens). A
26612
+ * robot vacuum has no gimbal — the whole chassis drives, turns and spins.
26613
+ * The two are different physical models: PTZ is absolute-position + presets,
26614
+ * navigation is momentary drive nudges + discrete robot ACTIONS
26615
+ * (dock / spot-clean / follow-pet / go-to-point / …).
26616
+ * - This cap is the SOURCE OF TRUTH. Two consumers adapt from it rather than
26617
+ * the reverse:
26618
+ * 1. a native CamStack navigation panel (data-driven from `listActions`
26619
+ * / `getOptions`), and
26620
+ * 2. the PTZ surface — a thin adapter mimics `ptz` from `navigation` so a
26621
+ * robot camera shows up in the existing PTZ control path without every
26622
+ * PTZ provider learning about robots. The mapping lives in the adapter,
26623
+ * not here (see the addon design note):
26624
+ * ptz.continuousMove({pan,tilt}) → navigation.move({pan,tilt})
26625
+ * ptz.stop() → navigation.stop()
26626
+ * ptz.goHome() → navigation.runAction('goHome')
26627
+ * ptz.getPresets() → navigation.listActions() (id→preset)
26628
+ * ptz.goToPreset(id) → navigation.runAction(id)
26629
+ *
26630
+ * ## Continuous drive
26631
+ *
26632
+ * `move` is MOMENTARY. Fluid navigation comes from the UI (or the PTZ adapter)
26633
+ * sending `move({pan,tilt})` REPEATEDLY at ~1 Hz while a direction is held, and
26634
+ * one `stop()` on release — exactly like the robot app's remote-drive joystick.
26635
+ * The provider forwards EACH `move` to one drive write; it must NOT debounce or
26636
+ * coalesce them. The UI owns the cadence.
26637
+ *
26638
+ * ## The action dictionary
26639
+ *
26640
+ * The discrete controls (dock / locate / spot-clean / follow / flash / sounds)
26641
+ * are a DATA-DRIVEN dictionary the cap exposes via `listActions()`. Each entry
26642
+ * carries `{ id, kind, label, icon }` (plus `soundId` for sound entries) so the
26643
+ * native panel AND the PTZ mimic render buttons WITHOUT hardcoding a
26644
+ * vendor-specific list. `kind: 'action'` entries are triggered with
26645
+ * `runAction({ actionId })`; `kind: 'sound'` entries with `playSound({ soundId })`
26646
+ * (the entry carries the `soundId` to pass). The general primitives — `move`,
26647
+ * `stop`, `goToPoint` — stay as first-class methods, not dictionary entries.
26648
+ *
26649
+ * NOTE (provider wiring): the first provider (Dreame) drives this with the RAW
26650
+ * `callAction(siid,aiid,in)` / `setProperty({siid,piid,value})` MIoT primitives
26651
+ * that the currently-published `@apocaliss92/nodedreame` already exposes on
26652
+ * every device handle. A future nodedreame publish adds a typed
26653
+ * `DreameCameraController` (drive / playPetSound / spotClean / findPet / …); the
26654
+ * provider can then swap the raw calls for the typed methods with no change to
26655
+ * THIS contract.
26656
+ */
26657
+ /**
26658
+ * A momentary drive nudge. The robot MOVES (no gimbal) for as long as the caller
26659
+ * keeps sending nudges (~1 Hz); an explicit `stop` (or letting the nudges lapse)
26660
+ * halts it.
26661
+ *
26662
+ * - `pan` — turn: negative = left, positive = right, 0 = straight.
26663
+ * - `tilt` — throttle: positive = forward, negative = spin / turn-around.
26664
+ * - `speed` — optional intensity hint [0, 1]; the provider may scale the drive
26665
+ * vector by it (drivers without proportional drive ignore it).
26666
+ *
26667
+ * `pan` / `tilt` are normalized [-1, 1]. Both optional so a caller can nudge one
26668
+ * axis alone; an all-undefined nudge is a no-op.
26669
+ */
26670
+ var NavigationMoveCommandSchema = object({
26671
+ pan: number().min(-1).max(1).optional(),
26672
+ tilt: number().min(-1).max(1).optional(),
26673
+ speed: number().min(0).max(1).optional()
26674
+ });
26675
+ /**
26676
+ * The enumerated discrete actions a navigation-capable robot can perform via
26677
+ * `runAction`. This is the CLOSED vocabulary; a given device advertises the
26678
+ * subset it supports through `listActions`. Sounds are NOT here — they go through
26679
+ * `playSound` (see the `sound` dictionary entries).
26680
+ */
26681
+ var NavigationActionIdSchema = _enum([
26682
+ "goHome",
26683
+ "locate",
26684
+ "spotClean",
26685
+ "findPet",
26686
+ "personFollow",
26687
+ "stop",
26688
+ "startClean",
26689
+ "pauseClean",
26690
+ "dockWash",
26691
+ "autoEmpty",
26692
+ "flashOn",
26693
+ "flashOff"
26694
+ ]);
26695
+ /** Whether a dictionary entry is a `runAction` action or a `playSound` sound. */
26696
+ var NavigationEntryKindSchema = _enum(["action", "sound"]);
26697
+ /**
26698
+ * One entry in the navigation action dictionary — the DATA-DRIVEN unit both the
26699
+ * native panel and the PTZ mimic render as a button.
26700
+ *
26701
+ * - `id` — stable id. For `kind:'action'` it is a {@link NavigationActionId}
26702
+ * (pass to `runAction`); for `kind:'sound'` it is a namespaced id
26703
+ * (`sound:meow`) whose `soundId` is passed to `playSound`.
26704
+ * - `icon` — icon HINT (lucide-style name; the UI maps it to its own set).
26705
+ * - `label` — operator-facing English label.
26706
+ * - `soundId` — wire sound id, present only on `kind:'sound'` entries.
26707
+ * - `enabled` — per-device FEATURE FLAG. `listActions` reports it so the UI /
26708
+ * PTZ render ONLY enabled entries. Data-driven: the provider
26709
+ * flips it from config, never by editing code.
26710
+ */
26711
+ var NavigationActionEntrySchema = object({
26712
+ id: string(),
26713
+ kind: NavigationEntryKindSchema,
26714
+ label: string(),
26715
+ icon: string(),
26716
+ /** Present only on `kind:'sound'` entries — the id to pass to `playSound`. */
26717
+ soundId: number().int().optional(),
26718
+ /** Per-device feature flag — render this entry only when true. */
26719
+ enabled: boolean()
26720
+ });
26721
+ /** Coordinates for `goToPoint` — a point on the robot's live map. */
26722
+ var NavigationPointSchema = object({
26723
+ x: number(),
26724
+ y: number()
26725
+ });
26726
+ /**
26727
+ * Per-device FEATURE-FLAG report for the general (non-dictionary) primitives.
26728
+ * The cap reports which are enabled so the UI / PTZ render only the controls
26729
+ * that are turned on for THIS device. Data-driven: the provider derives these
26730
+ * from config + probe, never hardcoded in the UI. The per-DICTIONARY-entry flags
26731
+ * live on {@link NavigationActionEntrySchema.enabled}; these gate the primitives
26732
+ * that are not dictionary entries.
26733
+ *
26734
+ * - `move` / `stop` — the momentary drive joystick.
26735
+ * - `goToPoint` — send-to-map-coordinate. Ships OFF on Dreame until the
26736
+ * map-coordinate plumbing is wired.
26737
+ * - `runAction` — the discrete action buttons (dictionary `kind:'action'`).
26738
+ * - `playSound` — the sound buttons (dictionary `kind:'sound'`).
26739
+ * - `light` — the on/off fill-light toggle (works anytime).
26740
+ * - `lightMode` — the auto/manual selector + manual level slider (a
26741
+ * camera-service control; needs an active stream).
26742
+ */
26743
+ var NavigationFeaturesSchema = object({
26744
+ move: boolean(),
26745
+ stop: boolean(),
26746
+ goToPoint: boolean(),
26747
+ runAction: boolean(),
26748
+ playSound: boolean(),
26749
+ light: boolean(),
26750
+ lightMode: boolean()
26751
+ });
26752
+ /** Light mode: `auto` lets the camera choose brightness; `manual` uses `level`. */
26753
+ var NavigationLightModeSchema = _enum(["auto", "manual"]);
26754
+ /**
26755
+ * Live navigation state so the UI can reflect what the robot is doing:
26756
+ * - `mode` — coarse activity (idle / cleaning / following / …).
26757
+ * - `following` — person/pet follow is currently armed.
26758
+ * - `flash` — the on-camera fill light is on.
26759
+ * - `lightMode` — auto vs manual fill-light mode.
26760
+ * - `lightLevel` — manual fill-light level (40..100); meaningful when
26761
+ * `lightMode === 'manual'`.
26762
+ */
26763
+ var NavigationStatusSchema = object({
26764
+ mode: _enum([
26765
+ "idle",
26766
+ "cleaning",
26767
+ "spot",
26768
+ "following",
26769
+ "goto",
26770
+ "returning",
26771
+ "paused",
26772
+ "unknown"
26773
+ ]),
26774
+ following: boolean(),
26775
+ flash: boolean(),
26776
+ lightMode: NavigationLightModeSchema,
26777
+ lightLevel: number().min(40).max(100),
26778
+ /** Ms epoch when the slice was last updated. */
26779
+ lastChangedAt: number()
26780
+ });
26781
+ NavigationStatusSchema.extend({ lastFetchedAt: number() });
26782
+ 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({
26783
+ deviceId: number(),
26784
+ actionId: NavigationActionIdSchema
26785
+ }), _void(), { kind: "mutation" }), method(object({
26786
+ deviceId: number(),
26787
+ soundId: number().int()
26788
+ }), _void(), { kind: "mutation" }), method(object({
26789
+ deviceId: number(),
26790
+ on: boolean()
26791
+ }), _void(), { kind: "mutation" }), method(object({
26792
+ deviceId: number(),
26793
+ mode: NavigationLightModeSchema,
26794
+ level: number().min(40).max(100).optional()
26795
+ }), _void(), { kind: "mutation" }), method(object({
26796
+ deviceId: number(),
26797
+ level: number().min(40).max(100)
26798
+ }), _void(), { kind: "mutation" }), method(object({ deviceId: number() }), NavigationFeaturesSchema), object({
26799
+ deviceId: number(),
26800
+ status: NavigationStatusSchema
26801
+ });
26802
+ /**
26803
+ * Network-link snapshot. Same shape for every provider (a Reolink wifi
26804
+ * camera, a Home Assistant device with a signal-strength sensor, a Tapo
26805
+ * plug): one slice under `device.runtimeState['network-link']`, one badge,
26806
+ * one Home Assistant projection.
26807
+ */
26808
+ var NetworkLinkStatusSchema = object({
26809
+ /** The link the device is on. `'unknown'` = not read yet, not "no link". */
26810
+ type: _enum([
26811
+ "wifi",
26812
+ "ethernet",
26813
+ "cellular",
26814
+ "unknown"
26815
+ ]),
26816
+ /**
26817
+ * Link quality, 0..100 inclusive, normalised by the provider from whatever
26818
+ * the firmware reports (bars, RSSI, a vendor scale). **`null` means NOT
26819
+ * KNOWN or NOT APPLICABLE** — a wired link has no signal, and a wireless
26820
+ * one whose reading has not landed must not be drawn at 0 %. Consumers
26821
+ * SKIP a null rather than coerce it.
26822
+ */
26823
+ signalPercent: number().min(0).max(100).nullable(),
26824
+ /** Raw received signal strength in dBm, when the firmware reports one. */
26825
+ rssiDbm: number().optional(),
26826
+ /** Network name of a wireless link, when the firmware reports it. */
26827
+ ssid: string().optional(),
26828
+ /** Ms epoch of the last observation. Lets consumers reason about freshness. */
26829
+ lastUpdated: number()
26830
+ });
26831
+ DeviceType.Camera, DeviceType.Sensor, DeviceType.Button, DeviceType.Switch, DeviceType.Light, DeviceType.Lock, DeviceType.Siren, object({
26832
+ deviceId: number(),
26833
+ status: NetworkLinkStatusSchema
26834
+ });
26835
+ /**
26512
26836
  * network-quality — system-scoped singleton capability tracking RTT,
26513
26837
  * jitter, and observed/peak bandwidth per device + per client.
26514
26838
  *
@@ -27750,203 +28074,6 @@ DeviceType.Camera, method(object({ deviceId: number() }), PtzAutotrackStatusSche
27750
28074
  deviceId: number(),
27751
28075
  status: PtzAutotrackStatusSchema
27752
28076
  });
27753
- /**
27754
- * `navigation` — a device-scoped capability that natively expresses the FULL
27755
- * navigation / action surface of a robot that DRIVES ITSELF and carries an
27756
- * on-board camera (the Dreame robot-vacuum camera is the first provider).
27757
- *
27758
- * Why a NEW cap rather than overloading `ptz`:
27759
- * - `ptz` moves a *gimbal* on a fixed camera (pan/tilt/zoom of the lens). A
27760
- * robot vacuum has no gimbal — the whole chassis drives, turns and spins.
27761
- * The two are different physical models: PTZ is absolute-position + presets,
27762
- * navigation is momentary drive nudges + discrete robot ACTIONS
27763
- * (dock / spot-clean / follow-pet / go-to-point / …).
27764
- * - This cap is the SOURCE OF TRUTH. Two consumers adapt from it rather than
27765
- * the reverse:
27766
- * 1. a native CamStack navigation panel (data-driven from `listActions`
27767
- * / `getOptions`), and
27768
- * 2. the PTZ surface — a thin adapter mimics `ptz` from `navigation` so a
27769
- * robot camera shows up in the existing PTZ control path without every
27770
- * PTZ provider learning about robots. The mapping lives in the adapter,
27771
- * not here (see the addon design note):
27772
- * ptz.continuousMove({pan,tilt}) → navigation.move({pan,tilt})
27773
- * ptz.stop() → navigation.stop()
27774
- * ptz.goHome() → navigation.runAction('goHome')
27775
- * ptz.getPresets() → navigation.listActions() (id→preset)
27776
- * ptz.goToPreset(id) → navigation.runAction(id)
27777
- *
27778
- * ## Continuous drive
27779
- *
27780
- * `move` is MOMENTARY. Fluid navigation comes from the UI (or the PTZ adapter)
27781
- * sending `move({pan,tilt})` REPEATEDLY at ~1 Hz while a direction is held, and
27782
- * one `stop()` on release — exactly like the robot app's remote-drive joystick.
27783
- * The provider forwards EACH `move` to one drive write; it must NOT debounce or
27784
- * coalesce them. The UI owns the cadence.
27785
- *
27786
- * ## The action dictionary
27787
- *
27788
- * The discrete controls (dock / locate / spot-clean / follow / flash / sounds)
27789
- * are a DATA-DRIVEN dictionary the cap exposes via `listActions()`. Each entry
27790
- * carries `{ id, kind, label, icon }` (plus `soundId` for sound entries) so the
27791
- * native panel AND the PTZ mimic render buttons WITHOUT hardcoding a
27792
- * vendor-specific list. `kind: 'action'` entries are triggered with
27793
- * `runAction({ actionId })`; `kind: 'sound'` entries with `playSound({ soundId })`
27794
- * (the entry carries the `soundId` to pass). The general primitives — `move`,
27795
- * `stop`, `goToPoint` — stay as first-class methods, not dictionary entries.
27796
- *
27797
- * NOTE (provider wiring): the first provider (Dreame) drives this with the RAW
27798
- * `callAction(siid,aiid,in)` / `setProperty({siid,piid,value})` MIoT primitives
27799
- * that the currently-published `@apocaliss92/nodedreame` already exposes on
27800
- * every device handle. A future nodedreame publish adds a typed
27801
- * `DreameCameraController` (drive / playPetSound / spotClean / findPet / …); the
27802
- * provider can then swap the raw calls for the typed methods with no change to
27803
- * THIS contract.
27804
- */
27805
- /**
27806
- * A momentary drive nudge. The robot MOVES (no gimbal) for as long as the caller
27807
- * keeps sending nudges (~1 Hz); an explicit `stop` (or letting the nudges lapse)
27808
- * halts it.
27809
- *
27810
- * - `pan` — turn: negative = left, positive = right, 0 = straight.
27811
- * - `tilt` — throttle: positive = forward, negative = spin / turn-around.
27812
- * - `speed` — optional intensity hint [0, 1]; the provider may scale the drive
27813
- * vector by it (drivers without proportional drive ignore it).
27814
- *
27815
- * `pan` / `tilt` are normalized [-1, 1]. Both optional so a caller can nudge one
27816
- * axis alone; an all-undefined nudge is a no-op.
27817
- */
27818
- var NavigationMoveCommandSchema = object({
27819
- pan: number().min(-1).max(1).optional(),
27820
- tilt: number().min(-1).max(1).optional(),
27821
- speed: number().min(0).max(1).optional()
27822
- });
27823
- /**
27824
- * The enumerated discrete actions a navigation-capable robot can perform via
27825
- * `runAction`. This is the CLOSED vocabulary; a given device advertises the
27826
- * subset it supports through `listActions`. Sounds are NOT here — they go through
27827
- * `playSound` (see the `sound` dictionary entries).
27828
- */
27829
- var NavigationActionIdSchema = _enum([
27830
- "goHome",
27831
- "locate",
27832
- "spotClean",
27833
- "findPet",
27834
- "personFollow",
27835
- "stop",
27836
- "startClean",
27837
- "pauseClean",
27838
- "dockWash",
27839
- "autoEmpty",
27840
- "flashOn",
27841
- "flashOff"
27842
- ]);
27843
- /** Whether a dictionary entry is a `runAction` action or a `playSound` sound. */
27844
- var NavigationEntryKindSchema = _enum(["action", "sound"]);
27845
- /**
27846
- * One entry in the navigation action dictionary — the DATA-DRIVEN unit both the
27847
- * native panel and the PTZ mimic render as a button.
27848
- *
27849
- * - `id` — stable id. For `kind:'action'` it is a {@link NavigationActionId}
27850
- * (pass to `runAction`); for `kind:'sound'` it is a namespaced id
27851
- * (`sound:meow`) whose `soundId` is passed to `playSound`.
27852
- * - `icon` — icon HINT (lucide-style name; the UI maps it to its own set).
27853
- * - `label` — operator-facing English label.
27854
- * - `soundId` — wire sound id, present only on `kind:'sound'` entries.
27855
- * - `enabled` — per-device FEATURE FLAG. `listActions` reports it so the UI /
27856
- * PTZ render ONLY enabled entries. Data-driven: the provider
27857
- * flips it from config, never by editing code.
27858
- */
27859
- var NavigationActionEntrySchema = object({
27860
- id: string(),
27861
- kind: NavigationEntryKindSchema,
27862
- label: string(),
27863
- icon: string(),
27864
- /** Present only on `kind:'sound'` entries — the id to pass to `playSound`. */
27865
- soundId: number().int().optional(),
27866
- /** Per-device feature flag — render this entry only when true. */
27867
- enabled: boolean()
27868
- });
27869
- /** Coordinates for `goToPoint` — a point on the robot's live map. */
27870
- var NavigationPointSchema = object({
27871
- x: number(),
27872
- y: number()
27873
- });
27874
- /**
27875
- * Per-device FEATURE-FLAG report for the general (non-dictionary) primitives.
27876
- * The cap reports which are enabled so the UI / PTZ render only the controls
27877
- * that are turned on for THIS device. Data-driven: the provider derives these
27878
- * from config + probe, never hardcoded in the UI. The per-DICTIONARY-entry flags
27879
- * live on {@link NavigationActionEntrySchema.enabled}; these gate the primitives
27880
- * that are not dictionary entries.
27881
- *
27882
- * - `move` / `stop` — the momentary drive joystick.
27883
- * - `goToPoint` — send-to-map-coordinate. Ships OFF on Dreame until the
27884
- * map-coordinate plumbing is wired.
27885
- * - `runAction` — the discrete action buttons (dictionary `kind:'action'`).
27886
- * - `playSound` — the sound buttons (dictionary `kind:'sound'`).
27887
- * - `light` — the on/off fill-light toggle (works anytime).
27888
- * - `lightMode` — the auto/manual selector + manual level slider (a
27889
- * camera-service control; needs an active stream).
27890
- */
27891
- var NavigationFeaturesSchema = object({
27892
- move: boolean(),
27893
- stop: boolean(),
27894
- goToPoint: boolean(),
27895
- runAction: boolean(),
27896
- playSound: boolean(),
27897
- light: boolean(),
27898
- lightMode: boolean()
27899
- });
27900
- /** Light mode: `auto` lets the camera choose brightness; `manual` uses `level`. */
27901
- var NavigationLightModeSchema = _enum(["auto", "manual"]);
27902
- /**
27903
- * Live navigation state so the UI can reflect what the robot is doing:
27904
- * - `mode` — coarse activity (idle / cleaning / following / …).
27905
- * - `following` — person/pet follow is currently armed.
27906
- * - `flash` — the on-camera fill light is on.
27907
- * - `lightMode` — auto vs manual fill-light mode.
27908
- * - `lightLevel` — manual fill-light level (40..100); meaningful when
27909
- * `lightMode === 'manual'`.
27910
- */
27911
- var NavigationStatusSchema = object({
27912
- mode: _enum([
27913
- "idle",
27914
- "cleaning",
27915
- "spot",
27916
- "following",
27917
- "goto",
27918
- "returning",
27919
- "paused",
27920
- "unknown"
27921
- ]),
27922
- following: boolean(),
27923
- flash: boolean(),
27924
- lightMode: NavigationLightModeSchema,
27925
- lightLevel: number().min(40).max(100),
27926
- /** Ms epoch when the slice was last updated. */
27927
- lastChangedAt: number()
27928
- });
27929
- NavigationStatusSchema.extend({ lastFetchedAt: number() });
27930
- 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({
27931
- deviceId: number(),
27932
- actionId: NavigationActionIdSchema
27933
- }), _void(), { kind: "mutation" }), method(object({
27934
- deviceId: number(),
27935
- soundId: number().int()
27936
- }), _void(), { kind: "mutation" }), method(object({
27937
- deviceId: number(),
27938
- on: boolean()
27939
- }), _void(), { kind: "mutation" }), method(object({
27940
- deviceId: number(),
27941
- mode: NavigationLightModeSchema,
27942
- level: number().min(40).max(100).optional()
27943
- }), _void(), { kind: "mutation" }), method(object({
27944
- deviceId: number(),
27945
- level: number().min(40).max(100)
27946
- }), _void(), { kind: "mutation" }), method(object({ deviceId: number() }), NavigationFeaturesSchema), object({
27947
- deviceId: number(),
27948
- status: NavigationStatusSchema
27949
- });
27950
28077
  DeviceType.Camera, DeviceType.Sensor, DeviceType.Switch, method(object({ deviceId: number().int().nonnegative() }), object({ success: literal(true) }), {
27951
28078
  kind: "mutation",
27952
28079
  auth: "admin"
@@ -35280,13 +35407,13 @@ Object.freeze({
35280
35407
  addonId: null,
35281
35408
  access: "view"
35282
35409
  },
35283
- "storage.getDefaultLocation": {
35410
+ "storage.list": {
35284
35411
  capName: "storage",
35285
35412
  capScope: "system",
35286
35413
  addonId: null,
35287
35414
  access: "view"
35288
35415
  },
35289
- "storage.list": {
35416
+ "storage.listDrainProgress": {
35290
35417
  capName: "storage",
35291
35418
  capScope: "system",
35292
35419
  addonId: null,
@@ -35436,6 +35563,12 @@ Object.freeze({
35436
35563
  addonId: null,
35437
35564
  access: "view"
35438
35565
  },
35566
+ "storageOccupancy.getOccupancy": {
35567
+ capName: "storage-occupancy",
35568
+ capScope: "system",
35569
+ addonId: null,
35570
+ access: "view"
35571
+ },
35439
35572
  "storageProvider.abortUpload": {
35440
35573
  capName: "storage-provider",
35441
35574
  capScope: "system",
@@ -38816,32 +38949,221 @@ DEFAULT_NATIVE_LEASE_SETTINGS.sceneBudgetMb;
38816
38949
  DEFAULT_NATIVE_LEASE_SETTINGS.admission;
38817
38950
  var MB = 1024 * 1024;
38818
38951
  1024 * MB, 3072 * MB;
38819
- /**
38820
- * Compute the stable 64-char lowercase-hex fingerprint of a device's
38821
- * export-relevant shape. Two structurally-equal shapes (any feature order,
38822
- * any duplicates, any deviceId) hash identically.
38823
- */
38824
- function canonicalDeviceFingerprint(shape) {
38825
- const features = [...new Set(shape.features)].toSorted();
38826
- return canonicalHash({
38827
- deviceType: shape.deviceType,
38828
- features
38829
- });
38830
- }
38831
- /**
38832
- * Resolve the fingerprint an exporter should feed into `diffExportTargets`
38833
- * for one device this cycle.
38834
- *
38835
- * When a device is NOT yet probe-ready, carry forward its last-advertised
38836
- * (persisted) fingerprint so it nets to NO CHANGE in `diffExportTargets`
38837
- * (neither update nor remove) — never advertise a partial mid-probe shape. A
38838
- * brand-new un-probed device with no persisted entry falls back to `fresh` so
38839
- * it can advertise once.
38840
- */
38841
- function resolveExportFingerprint(input) {
38842
- if (input.ready) return input.fresh;
38843
- return input.persisted ?? input.fresh;
38844
- }
38952
+ var DEFAULT_FIRST_UNIT_TIMEOUT_MS = 12e3;
38953
+ /** Heartbeat cadence — ~2 minutes of 4 s fragments. */
38954
+ var FRAGMENT_LOG_EVERY = 30;
38955
+ var Fmp4FragmentChild = class {
38956
+ deps;
38957
+ args;
38958
+ child = null;
38959
+ splitter = new Fmp4BoxSplitter();
38960
+ stopped = false;
38961
+ unitsOut = 0;
38962
+ activeHwAccel = null;
38963
+ constructor(deps, args) {
38964
+ this.deps = deps;
38965
+ this.args = args;
38966
+ }
38967
+ /** Spawn, and resolve once the INIT segment has been cut out of stdout. */
38968
+ async start() {
38969
+ const requested = this.args.invocation.decodeHwAccel;
38970
+ this.activeHwAccel = requested;
38971
+ try {
38972
+ await this.spawnAttempt(requested);
38973
+ return;
38974
+ } catch (err) {
38975
+ if (this.stopped) throw err;
38976
+ if (requested === null || isSoftwareDecode(requested)) throw err;
38977
+ this.deps.logger.warn("fmp4 fragment child: hardware decode produced NO fragment — retrying in SOFTWARE", {
38978
+ tags: { deviceId: this.args.deviceId },
38979
+ meta: {
38980
+ sourceId: this.args.sourceId,
38981
+ decodeHwAccel: requested,
38982
+ error: errMsg$15(err)
38983
+ }
38984
+ });
38985
+ this.killChild();
38986
+ this.splitter = new Fmp4BoxSplitter();
38987
+ this.activeHwAccel = null;
38988
+ await this.spawnAttempt(null);
38989
+ }
38990
+ }
38991
+ /** The backend the child ACTUALLY ran with — `null` for software. */
38992
+ activeDecodeHwAccel() {
38993
+ const value = this.activeHwAccel;
38994
+ return value === null || value === "none" || value === "copy" ? null : value;
38995
+ }
38996
+ /** Kill ffmpeg and end the plane. Idempotent. */
38997
+ async stop() {
38998
+ if (this.stopped) return;
38999
+ this.stopped = true;
39000
+ this.killChild();
39001
+ this.args.plane.end("the fragment child stopped");
39002
+ }
39003
+ spawnAttempt(decodeHwAccel) {
39004
+ const args = buildFfmpegArgs({
39005
+ ...this.args.invocation,
39006
+ decodeHwAccel,
39007
+ sink: {
39008
+ kind: "stdout",
39009
+ container: "mp4",
39010
+ fragmentMs: this.args.fragmentMs
39011
+ }
39012
+ });
39013
+ this.deps.logger.info("fmp4 fragment child: spawning ffmpeg", {
39014
+ tags: { deviceId: this.args.deviceId },
39015
+ meta: {
39016
+ sourceId: this.args.sourceId,
39017
+ fragmentMs: this.args.fragmentMs,
39018
+ decodeHwAccel: decodeHwAccel ?? "software",
39019
+ argv: args.join(" ")
39020
+ }
39021
+ });
39022
+ return new Promise((resolve, reject) => {
39023
+ const child = this.deps.spawnFn(this.deps.ffmpegBinaryPath, args, { stdio: [
39024
+ "ignore",
39025
+ "pipe",
39026
+ "pipe"
39027
+ ] });
39028
+ this.child = child;
39029
+ let settled = false;
39030
+ /**
39031
+ * This attempt FAILED. Set before the kill, because SIGTERM makes the
39032
+ * child exit and that exit must not be reported as a death: the retry —
39033
+ * or the caller's rejection — already owns what happens next. Without it
39034
+ * the timeout path ends the plane the software retry is about to fill,
39035
+ * and the consumer sees a stream that stopped for no reason. A "which
39036
+ * spawn is current" counter does NOT cover this: the retry has not been
39037
+ * spawned when the kill's exit arrives.
39038
+ */
39039
+ let failed = false;
39040
+ /**
39041
+ * This attempt is still the live producer: it has not failed (a failure
39042
+ * hands ownership to the retry, or to the caller's rejection) and nothing
39043
+ * has stopped the child. Those two cover every way an attempt stops being
39044
+ * current — `start` only respawns after a rejection.
39045
+ */
39046
+ const isCurrent = () => !this.stopped && !failed;
39047
+ const timeoutMs = this.deps.firstUnitTimeoutMs ?? DEFAULT_FIRST_UNIT_TIMEOUT_MS;
39048
+ const settle = (fail) => {
39049
+ if (settled) return;
39050
+ settled = true;
39051
+ clearTimeout(timer);
39052
+ if (fail) {
39053
+ failed = true;
39054
+ reject(fail);
39055
+ } else resolve();
39056
+ };
39057
+ const timer = setTimeout(() => {
39058
+ settle(/* @__PURE__ */ new Error(`fmp4 fragment child: no fragment within ${timeoutMs}ms`));
39059
+ this.killChild();
39060
+ }, timeoutMs);
39061
+ timer.unref?.();
39062
+ child.stdout?.on("data", (chunk) => {
39063
+ for (const unit of this.splitter.push(chunk)) {
39064
+ this.unitsOut += 1;
39065
+ this.args.plane.publish(unit);
39066
+ if (unit.kind === "init") {
39067
+ this.deps.logger.info("fmp4 fragment child: INIT segment cut", {
39068
+ tags: { deviceId: this.args.deviceId },
39069
+ meta: {
39070
+ sourceId: this.args.sourceId,
39071
+ bytes: unit.data.length
39072
+ }
39073
+ });
39074
+ settle();
39075
+ } else if (this.unitsOut % FRAGMENT_LOG_EVERY === 0) this.deps.logger.info("fmp4 fragment child: fragments still flowing", {
39076
+ tags: { deviceId: this.args.deviceId },
39077
+ meta: {
39078
+ sourceId: this.args.sourceId,
39079
+ unitsOut: this.unitsOut,
39080
+ bytes: unit.data.length,
39081
+ subscribers: this.args.plane.subscriberCount
39082
+ }
39083
+ });
39084
+ }
39085
+ const fault = this.splitter.fault;
39086
+ if (fault !== null) this.onFault(fault, settled, isCurrent(), settle);
39087
+ });
39088
+ child.stderr?.setEncoding("utf8");
39089
+ child.stderr?.on("data", (line) => {
39090
+ this.deps.logger.debug("fmp4 fragment child ffmpeg", {
39091
+ tags: { deviceId: this.args.deviceId },
39092
+ meta: {
39093
+ sourceId: this.args.sourceId,
39094
+ line: line.trim()
39095
+ }
39096
+ });
39097
+ });
39098
+ child.once("error", (err) => {
39099
+ if (!settled) {
39100
+ settle(err);
39101
+ return;
39102
+ }
39103
+ if (!isCurrent()) return;
39104
+ this.args.plane.end("the fragment child errored");
39105
+ this.deps.onChildExit?.(err);
39106
+ });
39107
+ child.once("exit", (code, signal) => {
39108
+ if (!settled) {
39109
+ settle(/* @__PURE__ */ new Error(`fmp4 fragment child: ffmpeg exited before any fragment (code=${code} signal=${signal})`));
39110
+ return;
39111
+ }
39112
+ if (!isCurrent()) return;
39113
+ const error = /* @__PURE__ */ new Error(`fmp4 fragment child: ffmpeg exited while live (code=${code} signal=${signal})`);
39114
+ this.deps.logger.warn("fmp4 fragment child: ffmpeg exited while live", {
39115
+ tags: { deviceId: this.args.deviceId },
39116
+ meta: {
39117
+ sourceId: this.args.sourceId,
39118
+ code,
39119
+ signal,
39120
+ unitsOut: this.unitsOut
39121
+ }
39122
+ });
39123
+ this.args.plane.end("the fragment child exited");
39124
+ this.deps.onChildExit?.(error);
39125
+ });
39126
+ });
39127
+ }
39128
+ /**
39129
+ * The byte stream stopped being splittable. Not recoverable — the splitter
39130
+ * cannot resynchronise mid-box — so the child is a corpse and every consumer
39131
+ * has to be told, loudly, with the reason.
39132
+ */
39133
+ onFault(reason, wasLive, current, settle) {
39134
+ const error = /* @__PURE__ */ new Error(`fmp4 fragment child: ${reason}`);
39135
+ this.deps.logger.error("fmp4 fragment child: the ffmpeg output stopped parsing as fMP4", {
39136
+ tags: { deviceId: this.args.deviceId },
39137
+ meta: {
39138
+ sourceId: this.args.sourceId,
39139
+ unitsOut: this.unitsOut,
39140
+ interstitial: this.splitter.discardedInterstitialTypes,
39141
+ reason
39142
+ }
39143
+ });
39144
+ this.killChild();
39145
+ settle(error);
39146
+ if (wasLive && current) {
39147
+ this.args.plane.end("the fragment child produced unsplittable output");
39148
+ this.deps.onChildExit?.(error);
39149
+ }
39150
+ }
39151
+ killChild() {
39152
+ const child = this.child;
39153
+ this.child = null;
39154
+ if (child && !child.killed) try {
39155
+ child.kill("SIGTERM");
39156
+ } catch (err) {
39157
+ this.deps.logger.warn("fmp4 fragment child: kill error", {
39158
+ tags: { deviceId: this.args.deviceId },
39159
+ meta: {
39160
+ sourceId: this.args.sourceId,
39161
+ error: errMsg$15(err)
39162
+ }
39163
+ });
39164
+ }
39165
+ }
39166
+ };
38845
39167
  /**
38846
39168
  * Fmp4FragmentPlane — a SUBSCRIBABLE fragmented-MP4 plane, fed by one
38847
39169
  * {@link import('./fmp4-box-splitter.js').Fmp4BoxSplitter}.
@@ -39127,221 +39449,32 @@ var Fmp4FragmentPlane = class {
39127
39449
  }
39128
39450
  }
39129
39451
  };
39130
- var DEFAULT_FIRST_UNIT_TIMEOUT_MS = 12e3;
39131
- /** Heartbeat cadence — ~2 minutes of 4 s fragments. */
39132
- var FRAGMENT_LOG_EVERY = 30;
39133
- var Fmp4FragmentChild = class {
39134
- deps;
39135
- args;
39136
- child = null;
39137
- splitter = new Fmp4BoxSplitter();
39138
- stopped = false;
39139
- unitsOut = 0;
39140
- activeHwAccel = null;
39141
- constructor(deps, args) {
39142
- this.deps = deps;
39143
- this.args = args;
39144
- }
39145
- /** Spawn, and resolve once the INIT segment has been cut out of stdout. */
39146
- async start() {
39147
- const requested = this.args.invocation.decodeHwAccel;
39148
- this.activeHwAccel = requested;
39149
- try {
39150
- await this.spawnAttempt(requested);
39151
- return;
39152
- } catch (err) {
39153
- if (this.stopped) throw err;
39154
- if (requested === null || isSoftwareDecode(requested)) throw err;
39155
- this.deps.logger.warn("fmp4 fragment child: hardware decode produced NO fragment — retrying in SOFTWARE", {
39156
- tags: { deviceId: this.args.deviceId },
39157
- meta: {
39158
- sourceId: this.args.sourceId,
39159
- decodeHwAccel: requested,
39160
- error: errMsg$15(err)
39161
- }
39162
- });
39163
- this.killChild();
39164
- this.splitter = new Fmp4BoxSplitter();
39165
- this.activeHwAccel = null;
39166
- await this.spawnAttempt(null);
39167
- }
39168
- }
39169
- /** The backend the child ACTUALLY ran with — `null` for software. */
39170
- activeDecodeHwAccel() {
39171
- const value = this.activeHwAccel;
39172
- return value === null || value === "none" || value === "copy" ? null : value;
39173
- }
39174
- /** Kill ffmpeg and end the plane. Idempotent. */
39175
- async stop() {
39176
- if (this.stopped) return;
39177
- this.stopped = true;
39178
- this.killChild();
39179
- this.args.plane.end("the fragment child stopped");
39180
- }
39181
- spawnAttempt(decodeHwAccel) {
39182
- const args = buildFfmpegArgs({
39183
- ...this.args.invocation,
39184
- decodeHwAccel,
39185
- sink: {
39186
- kind: "stdout",
39187
- container: "mp4",
39188
- fragmentMs: this.args.fragmentMs
39189
- }
39190
- });
39191
- this.deps.logger.info("fmp4 fragment child: spawning ffmpeg", {
39192
- tags: { deviceId: this.args.deviceId },
39193
- meta: {
39194
- sourceId: this.args.sourceId,
39195
- fragmentMs: this.args.fragmentMs,
39196
- decodeHwAccel: decodeHwAccel ?? "software",
39197
- argv: args.join(" ")
39198
- }
39199
- });
39200
- return new Promise((resolve, reject) => {
39201
- const child = this.deps.spawnFn(this.deps.ffmpegBinaryPath, args, { stdio: [
39202
- "ignore",
39203
- "pipe",
39204
- "pipe"
39205
- ] });
39206
- this.child = child;
39207
- let settled = false;
39208
- /**
39209
- * This attempt FAILED. Set before the kill, because SIGTERM makes the
39210
- * child exit and that exit must not be reported as a death: the retry —
39211
- * or the caller's rejection — already owns what happens next. Without it
39212
- * the timeout path ends the plane the software retry is about to fill,
39213
- * and the consumer sees a stream that stopped for no reason. A "which
39214
- * spawn is current" counter does NOT cover this: the retry has not been
39215
- * spawned when the kill's exit arrives.
39216
- */
39217
- let failed = false;
39218
- /**
39219
- * This attempt is still the live producer: it has not failed (a failure
39220
- * hands ownership to the retry, or to the caller's rejection) and nothing
39221
- * has stopped the child. Those two cover every way an attempt stops being
39222
- * current — `start` only respawns after a rejection.
39223
- */
39224
- const isCurrent = () => !this.stopped && !failed;
39225
- const timeoutMs = this.deps.firstUnitTimeoutMs ?? DEFAULT_FIRST_UNIT_TIMEOUT_MS;
39226
- const settle = (fail) => {
39227
- if (settled) return;
39228
- settled = true;
39229
- clearTimeout(timer);
39230
- if (fail) {
39231
- failed = true;
39232
- reject(fail);
39233
- } else resolve();
39234
- };
39235
- const timer = setTimeout(() => {
39236
- settle(/* @__PURE__ */ new Error(`fmp4 fragment child: no fragment within ${timeoutMs}ms`));
39237
- this.killChild();
39238
- }, timeoutMs);
39239
- timer.unref?.();
39240
- child.stdout?.on("data", (chunk) => {
39241
- for (const unit of this.splitter.push(chunk)) {
39242
- this.unitsOut += 1;
39243
- this.args.plane.publish(unit);
39244
- if (unit.kind === "init") {
39245
- this.deps.logger.info("fmp4 fragment child: INIT segment cut", {
39246
- tags: { deviceId: this.args.deviceId },
39247
- meta: {
39248
- sourceId: this.args.sourceId,
39249
- bytes: unit.data.length
39250
- }
39251
- });
39252
- settle();
39253
- } else if (this.unitsOut % FRAGMENT_LOG_EVERY === 0) this.deps.logger.info("fmp4 fragment child: fragments still flowing", {
39254
- tags: { deviceId: this.args.deviceId },
39255
- meta: {
39256
- sourceId: this.args.sourceId,
39257
- unitsOut: this.unitsOut,
39258
- bytes: unit.data.length,
39259
- subscribers: this.args.plane.subscriberCount
39260
- }
39261
- });
39262
- }
39263
- const fault = this.splitter.fault;
39264
- if (fault !== null) this.onFault(fault, settled, isCurrent(), settle);
39265
- });
39266
- child.stderr?.setEncoding("utf8");
39267
- child.stderr?.on("data", (line) => {
39268
- this.deps.logger.debug("fmp4 fragment child ffmpeg", {
39269
- tags: { deviceId: this.args.deviceId },
39270
- meta: {
39271
- sourceId: this.args.sourceId,
39272
- line: line.trim()
39273
- }
39274
- });
39275
- });
39276
- child.once("error", (err) => {
39277
- if (!settled) {
39278
- settle(err);
39279
- return;
39280
- }
39281
- if (!isCurrent()) return;
39282
- this.args.plane.end("the fragment child errored");
39283
- this.deps.onChildExit?.(err);
39284
- });
39285
- child.once("exit", (code, signal) => {
39286
- if (!settled) {
39287
- settle(/* @__PURE__ */ new Error(`fmp4 fragment child: ffmpeg exited before any fragment (code=${code} signal=${signal})`));
39288
- return;
39289
- }
39290
- if (!isCurrent()) return;
39291
- const error = /* @__PURE__ */ new Error(`fmp4 fragment child: ffmpeg exited while live (code=${code} signal=${signal})`);
39292
- this.deps.logger.warn("fmp4 fragment child: ffmpeg exited while live", {
39293
- tags: { deviceId: this.args.deviceId },
39294
- meta: {
39295
- sourceId: this.args.sourceId,
39296
- code,
39297
- signal,
39298
- unitsOut: this.unitsOut
39299
- }
39300
- });
39301
- this.args.plane.end("the fragment child exited");
39302
- this.deps.onChildExit?.(error);
39303
- });
39304
- });
39305
- }
39306
- /**
39307
- * The byte stream stopped being splittable. Not recoverable — the splitter
39308
- * cannot resynchronise mid-box — so the child is a corpse and every consumer
39309
- * has to be told, loudly, with the reason.
39310
- */
39311
- onFault(reason, wasLive, current, settle) {
39312
- const error = /* @__PURE__ */ new Error(`fmp4 fragment child: ${reason}`);
39313
- this.deps.logger.error("fmp4 fragment child: the ffmpeg output stopped parsing as fMP4", {
39314
- tags: { deviceId: this.args.deviceId },
39315
- meta: {
39316
- sourceId: this.args.sourceId,
39317
- unitsOut: this.unitsOut,
39318
- interstitial: this.splitter.discardedInterstitialTypes,
39319
- reason
39320
- }
39321
- });
39322
- this.killChild();
39323
- settle(error);
39324
- if (wasLive && current) {
39325
- this.args.plane.end("the fragment child produced unsplittable output");
39326
- this.deps.onChildExit?.(error);
39327
- }
39328
- }
39329
- killChild() {
39330
- const child = this.child;
39331
- this.child = null;
39332
- if (child && !child.killed) try {
39333
- child.kill("SIGTERM");
39334
- } catch (err) {
39335
- this.deps.logger.warn("fmp4 fragment child: kill error", {
39336
- tags: { deviceId: this.args.deviceId },
39337
- meta: {
39338
- sourceId: this.args.sourceId,
39339
- error: errMsg$15(err)
39340
- }
39341
- });
39342
- }
39343
- }
39344
- };
39452
+ /**
39453
+ * Compute the stable 64-char lowercase-hex fingerprint of a device's
39454
+ * export-relevant shape. Two structurally-equal shapes (any feature order,
39455
+ * any duplicates, any deviceId) hash identically.
39456
+ */
39457
+ function canonicalDeviceFingerprint(shape) {
39458
+ const features = [...new Set(shape.features)].toSorted();
39459
+ return canonicalHash({
39460
+ deviceType: shape.deviceType,
39461
+ features
39462
+ });
39463
+ }
39464
+ /**
39465
+ * Resolve the fingerprint an exporter should feed into `diffExportTargets`
39466
+ * for one device this cycle.
39467
+ *
39468
+ * When a device is NOT yet probe-ready, carry forward its last-advertised
39469
+ * (persisted) fingerprint so it nets to NO CHANGE in `diffExportTargets`
39470
+ * (neither update nor remove) — never advertise a partial mid-probe shape. A
39471
+ * brand-new un-probed device with no persisted entry falls back to `fresh` so
39472
+ * it can advertise once.
39473
+ */
39474
+ function resolveExportFingerprint(input) {
39475
+ if (input.ready) return input.fresh;
39476
+ return input.persisted ?? input.fresh;
39477
+ }
39345
39478
  //#endregion
39346
39479
  //#region ../../node_modules/tslib/tslib.es6.mjs
39347
39480
  var tslib_es6_exports = /* @__PURE__ */ __exportAll({