@camstack/system 1.2.179 → 1.2.180

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.
Files changed (64) hide show
  1. package/dist/addon-runner.js +1 -1
  2. package/dist/addon-runner.mjs +1 -1
  3. package/dist/builtins/addon-pages-aggregator/addon-pages-aggregator.addon.js +1 -1
  4. package/dist/builtins/addon-pages-aggregator/addon-pages-aggregator.addon.mjs +1 -1
  5. package/dist/builtins/addon-widgets-aggregator/addon-widgets-aggregator.addon.js +1 -1
  6. package/dist/builtins/addon-widgets-aggregator/addon-widgets-aggregator.addon.mjs +1 -1
  7. package/dist/builtins/alerts/alerts.addon.js +1 -1
  8. package/dist/builtins/alerts/alerts.addon.mjs +1 -1
  9. package/dist/builtins/backup-orchestrator/backup-orchestrator.addon.d.ts +56 -10
  10. package/dist/builtins/backup-orchestrator/backup-orchestrator.addon.js +657 -62
  11. package/dist/builtins/backup-orchestrator/backup-orchestrator.addon.mjs +658 -63
  12. package/dist/builtins/backup-orchestrator/run-queue.d.ts +103 -0
  13. package/dist/builtins/backup-orchestrator/staging-paths.d.ts +36 -0
  14. package/dist/builtins/console-logging/index.js +1 -1
  15. package/dist/builtins/console-logging/index.mjs +1 -1
  16. package/dist/builtins/core-blocks/core-blocks.addon.js +1 -1
  17. package/dist/builtins/core-blocks/core-blocks.addon.mjs +1 -1
  18. package/dist/builtins/device-manager/device-manager.addon.js +146 -5
  19. package/dist/builtins/device-manager/device-manager.addon.mjs +146 -5
  20. package/dist/builtins/device-manager/device-meta-actions.d.ts +1 -1
  21. package/dist/builtins/device-manager/migrate-device.d.ts +33 -0
  22. package/dist/builtins/device-manager/migrate-hardware-state.d.ts +24 -0
  23. package/dist/builtins/doorbell/virtual-doorbell.addon.js +1 -1
  24. package/dist/builtins/doorbell/virtual-doorbell.addon.mjs +1 -1
  25. package/dist/builtins/hub-forwarder/index.js +1 -1
  26. package/dist/builtins/hub-forwarder/index.mjs +1 -1
  27. package/dist/builtins/liveness-monitor/liveness-monitor.addon.js +1 -1
  28. package/dist/builtins/liveness-monitor/liveness-monitor.addon.mjs +1 -1
  29. package/dist/builtins/local-auth/local-auth.addon.js +1 -1
  30. package/dist/builtins/local-auth/local-auth.addon.mjs +1 -1
  31. package/dist/builtins/local-network/local-network.addon.js +1 -1
  32. package/dist/builtins/local-network/local-network.addon.mjs +1 -1
  33. package/dist/builtins/loki-logging/index.js +1 -1
  34. package/dist/builtins/loki-logging/index.mjs +1 -1
  35. package/dist/builtins/native-metrics/native-metrics.addon.js +1 -1
  36. package/dist/builtins/native-metrics/native-metrics.addon.mjs +1 -1
  37. package/dist/builtins/platform-probe/index.js +1 -1
  38. package/dist/builtins/platform-probe/index.mjs +1 -1
  39. package/dist/builtins/remote-access-orchestrator/remote-access-orchestrator.addon.js +1 -1
  40. package/dist/builtins/remote-access-orchestrator/remote-access-orchestrator.addon.mjs +1 -1
  41. package/dist/builtins/snapshot/index.js +1 -1
  42. package/dist/builtins/snapshot/index.mjs +1 -1
  43. package/dist/builtins/sqlite-storage/filesystem-storage.addon.js +1 -1
  44. package/dist/builtins/sqlite-storage/filesystem-storage.addon.mjs +1 -1
  45. package/dist/builtins/sqlite-storage/sqlite-settings.addon.js +0 -0
  46. package/dist/builtins/sqlite-storage/sqlite-settings.addon.mjs +0 -0
  47. package/dist/builtins/storage-orchestrator/storage-orchestrator.addon.js +1 -1
  48. package/dist/builtins/storage-orchestrator/storage-orchestrator.addon.mjs +1 -1
  49. package/dist/builtins/system-backup/system-backup.service.d.ts +55 -2
  50. package/dist/builtins/system-config/system-config.addon.js +1 -1
  51. package/dist/builtins/system-config/system-config.addon.mjs +1 -1
  52. package/dist/builtins/winston-logging/index.js +1 -1
  53. package/dist/builtins/winston-logging/index.mjs +1 -1
  54. package/dist/{dist-L_39vRmH.mjs → dist-DqNTelT4.mjs} +167 -1
  55. package/dist/{dist-C7qWwrK1.js → dist-TEwQZL3g.js} +167 -1
  56. package/dist/index.js +530 -2
  57. package/dist/index.mjs +533 -5
  58. package/dist/kernel/addon-installer.d.ts +69 -0
  59. package/dist/kernel/deps/closure-dedupe.d.ts +105 -0
  60. package/dist/{manifest-system-deps-PAIfmNun.js → manifest-system-deps-BVIr3MYJ.js} +1 -1
  61. package/dist/{manifest-system-deps-CMOGc5nC.mjs → manifest-system-deps-Ci-jhrxY.mjs} +1 -1
  62. package/dist/{retired-settings-keys-CnbKAxmX.mjs → retired-settings-keys-CeSITpIX.mjs} +1 -1
  63. package/dist/{retired-settings-keys-3soU9pfP.js → retired-settings-keys-DauPtbFR.js} +1 -1
  64. package/package.json +1 -1
@@ -7164,6 +7164,89 @@ var LocationStatSchema = zod.z.object({
7164
7164
  fileCount: zod.z.number(),
7165
7165
  present: zod.z.boolean()
7166
7166
  });
7167
+ /** Lifecycle of a backup run. Terminal states: succeeded / failed / cancelled. */
7168
+ var BackupRunStateSchema = zod.z.enum([
7169
+ "queued",
7170
+ "running",
7171
+ "succeeded",
7172
+ "failed",
7173
+ "cancelled"
7174
+ ]);
7175
+ /**
7176
+ * Where a running backup currently is. `queued` before it starts,
7177
+ * `building` while the tar.gz is being staged, `uploading` during the
7178
+ * per-destination fan-out, `done` once terminal.
7179
+ */
7180
+ var BackupRunPhaseSchema = zod.z.enum([
7181
+ "queued",
7182
+ "building",
7183
+ "uploading",
7184
+ "done"
7185
+ ]);
7186
+ /**
7187
+ * Observable state of one backup run — readable WHILE it runs via
7188
+ * `backup.listRuns`. This is what makes the execution queue and
7189
+ * `backup.cancel` usable: the 2026-09-04 incident (two concurrent
7190
+ * multi-GB builds, staging 5.1 GB → 18 GB, load 62) was only
7191
+ * diagnosable with `du` because nothing reported that runs existed or
7192
+ * how large the staged archive had grown.
7193
+ */
7194
+ var BackupRunSchema = zod.z.object({
7195
+ /** Stable run id — the handle `backup.cancel` takes. */
7196
+ id: zod.z.string(),
7197
+ state: BackupRunStateSchema,
7198
+ phase: BackupRunPhaseSchema,
7199
+ /**
7200
+ * Resolved destination location ids. Empty while queued (targets are
7201
+ * resolved when the run starts, against the then-current policies).
7202
+ */
7203
+ destinationIds: zod.z.array(zod.z.string()).readonly(),
7204
+ label: zod.z.string().optional(),
7205
+ /** ms-epoch when the run was submitted (trigger call / schedule fire). */
7206
+ requestedAt: zod.z.number(),
7207
+ /** ms-epoch when the run left the queue and started building. */
7208
+ startedAt: zod.z.number().optional(),
7209
+ /** ms-epoch when the run reached a terminal state. */
7210
+ finishedAt: zod.z.number().optional(),
7211
+ /** Compressed bytes of the staging archive written so far. */
7212
+ stagedBytes: zod.z.number(),
7213
+ /** Final staged archive size, once the build phase completes. */
7214
+ archiveSizeBytes: zod.z.number().optional(),
7215
+ /** Bytes pushed to the destination currently uploading. */
7216
+ uploadedBytes: zod.z.number(),
7217
+ /** Destinations where the archive fully landed (uploaded + indexed). */
7218
+ completedDestinationIds: zod.z.array(zod.z.string()).readonly(),
7219
+ /** Destinations that failed during the fan-out. */
7220
+ failedDestinationIds: zod.z.array(zod.z.string()).readonly(),
7221
+ /** Failure message when `state === 'failed'`. */
7222
+ error: zod.z.string().optional(),
7223
+ /**
7224
+ * 1-based place in the execution queue — 1 = runs next. Present only
7225
+ * while `state === 'queued'`. Stamped by the orchestrator from the
7226
+ * queue's OWN pending order, never derived from timestamps, so the
7227
+ * UI cannot show an order the executor will not honour.
7228
+ */
7229
+ queuePosition: zod.z.number().int().min(1).optional()
7230
+ });
7231
+ /**
7232
+ * Result of `backup.trigger`. The call still resolves when the run
7233
+ * terminates (compat with schedule-driven runs and the admin UI), but
7234
+ * it now names the run and says whether it had to WAIT: a trigger that
7235
+ * arrives while another run is in flight is enqueued (or joined onto
7236
+ * an identical already-queued run), never started concurrently.
7237
+ */
7238
+ var BackupTriggerResultSchema = zod.z.object({
7239
+ /** The run this trigger mapped to — poll it via `listRuns`, stop it via `cancel`. */
7240
+ runId: zod.z.string(),
7241
+ /** True when the run waited behind an in-flight run instead of starting immediately. */
7242
+ queued: zod.z.boolean(),
7243
+ /** True when this trigger was coalesced onto an identical already-queued run. */
7244
+ joined: zod.z.boolean(),
7245
+ /** True when the run was cancelled before completing every destination. */
7246
+ cancelled: zod.z.boolean(),
7247
+ /** One entry per destination the archive landed at (partial on cancel). */
7248
+ entries: zod.z.array(BackupEntrySchema).readonly()
7249
+ });
7167
7250
  /**
7168
7251
  * A backup schedule — the N:M "entry" that binds one cron cadence to a
7169
7252
  * SET of destination locations. Supersedes the per-location cron on
@@ -7221,6 +7304,11 @@ var backupCapability = {
7221
7304
  * Trigger a backup. Without `destinations` the orchestrator fans
7222
7305
  * out to every destination flagged as enabled in the routing
7223
7306
  * config; with it, only the listed addons receive the archive.
7307
+ *
7308
+ * At most ONE backup run executes at a time — the source tree and
7309
+ * the staging disk are shared by every run, so a second trigger
7310
+ * while one is in flight is enqueued (or joined onto an identical
7311
+ * queued run) and the result says so. See D342.
7224
7312
  */
7225
7313
  trigger: method(zod.z.object({
7226
7314
  /** Subset of registered `backup-destination` addon ids to write to. */
@@ -7234,7 +7322,30 @@ var backupCapability = {
7234
7322
  * retention (manual runs).
7235
7323
  */
7236
7324
  retentionCount: zod.z.number().int().min(1).max(1e3).optional()
7237
- }).optional(), zod.z.array(BackupEntrySchema).readonly(), {
7325
+ }).optional(), BackupTriggerResultSchema, {
7326
+ kind: "mutation",
7327
+ auth: "admin"
7328
+ }),
7329
+ /**
7330
+ * Every run the orchestrator knows about, in EXECUTION order: the
7331
+ * running run first, then queued runs in the exact order they will
7332
+ * execute (each with `queuePosition`, 1 = next), then the bounded
7333
+ * finished history newest-first. Only one run executes at a time
7334
+ * (D342) — the queued section IS the line. Each run carries live
7335
+ * phase + byte counters so a runaway build is visible in seconds,
7336
+ * not via `du`.
7337
+ */
7338
+ listRuns: method(zod.z.void(), zod.z.array(BackupRunSchema).readonly(), { auth: "admin" }),
7339
+ /**
7340
+ * Stop a backup run. Mirrors `storage-migration.cancel` semantics:
7341
+ * id in, `{ cancelled }` out — `false` when the run is unknown or
7342
+ * already terminal. A QUEUED run is removed before it ever starts;
7343
+ * the RUNNING run has its tar/upload stream actually aborted, the
7344
+ * half-written staging archive is deleted, and the in-flight
7345
+ * destination upload is aborted server-side (partial discarded).
7346
+ * Destinations that already completed keep their archive.
7347
+ */
7348
+ cancel: method(zod.z.object({ runId: zod.z.string() }), zod.z.object({ cancelled: zod.z.boolean() }), {
7238
7349
  kind: "mutation",
7239
7350
  auth: "admin"
7240
7351
  }),
@@ -8112,6 +8223,38 @@ var streamBrokerCapability = {
8112
8223
  auth: "admin"
8113
8224
  }),
8114
8225
  /**
8226
+ * The HARDWARE behind a device number was replaced
8227
+ * (`deviceManager.migrateDevice`). Forget every piece of broker state that
8228
+ * described the old box, so the next catalog pull derives everything from
8229
+ * the camera that is actually there:
8230
+ *
8231
+ * - every `derived:*` stream definition — a derived is authored against a
8232
+ * specific profile layout, and against the wrong hardware its feeder
8233
+ * respawns forever (observed at attempt 2732 on the live hub,
8234
+ * 2026-09-01);
8235
+ * - the profile-slot assignment entry, PURGED (not unassigned — unassign
8236
+ * marks the slot manual, which would pin the stale choice instead of
8237
+ * letting `computeInitialAssignment` re-derive it);
8238
+ * - the probe snapshots (`<deviceId>/…` — probed codec/resolution of the
8239
+ * old hardware);
8240
+ * - the persisted RTSP token rows for the device's brokers (keyed
8241
+ * `<deviceId>/<camStreamId>`; the stream ids change with the hardware,
8242
+ * so the rows are dead URLs).
8243
+ *
8244
+ * An RPC, deliberately — an event is telemetry and may be dropped (D8),
8245
+ * and a dropped forget leaves a feeder respawning against a stream that
8246
+ * does not exist.
8247
+ */
8248
+ forgetDeviceHardware: method(zod.z.object({ deviceId: zod.z.number().int().nonnegative() }), zod.z.object({
8249
+ derivedStreamsDeleted: zod.z.array(zod.z.string()).readonly(),
8250
+ assignmentsPurged: zod.z.boolean(),
8251
+ probeSnapshotsDropped: zod.z.number().int().nonnegative(),
8252
+ rtspTokenRowsDeleted: zod.z.number().int().nonnegative()
8253
+ }), {
8254
+ kind: "mutation",
8255
+ auth: "admin"
8256
+ }),
8257
+ /**
8115
8258
  * Render a short GIF or MP4 from the broker's PRE-BUFFER around an instant.
8116
8259
  *
8117
8260
  * The pre-buffer is the only source that already holds the seconds BEFORE
@@ -34933,6 +35076,12 @@ var METHOD_ACCESS_MAP = Object.freeze({
34933
35076
  addonId: null,
34934
35077
  access: "create"
34935
35078
  },
35079
+ "backup.cancel": {
35080
+ capName: "backup",
35081
+ capScope: "system",
35082
+ addonId: null,
35083
+ access: "create"
35084
+ },
34936
35085
  "backup.delete": {
34937
35086
  capName: "backup",
34938
35087
  capScope: "system",
@@ -34975,6 +35124,12 @@ var METHOD_ACCESS_MAP = Object.freeze({
34975
35124
  addonId: null,
34976
35125
  access: "view"
34977
35126
  },
35127
+ "backup.listRuns": {
35128
+ capName: "backup",
35129
+ capScope: "system",
35130
+ addonId: null,
35131
+ access: "view"
35132
+ },
34978
35133
  "backup.listSchedules": {
34979
35134
  capName: "backup",
34980
35135
  capScope: "system",
@@ -39541,6 +39696,12 @@ var METHOD_ACCESS_MAP = Object.freeze({
39541
39696
  addonId: null,
39542
39697
  access: "create"
39543
39698
  },
39699
+ "streamBroker.forgetDeviceHardware": {
39700
+ capName: "stream-broker",
39701
+ capScope: "system",
39702
+ addonId: null,
39703
+ access: "delete"
39704
+ },
39544
39705
  "streamBroker.getAllRtspEntries": {
39545
39706
  capName: "stream-broker",
39546
39707
  capScope: "system",
@@ -41999,6 +42160,11 @@ Object.freeze({
41999
42160
  form: "single",
42000
42161
  optional: false
42001
42162
  }],
42163
+ "streamBroker.forgetDeviceHardware": [{
42164
+ name: "deviceId",
42165
+ form: "single",
42166
+ optional: false
42167
+ }],
42002
42168
  "streamBroker.getDeviceAudioMute": [{
42003
42169
  name: "deviceId",
42004
42170
  form: "single",