@camstack/addon-agent-ui 1.2.234 → 1.2.236

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/addon.js CHANGED
@@ -5388,7 +5388,7 @@ var ZodIssueCode = {
5388
5388
  var ZodFirstPartyTypeKind;
5389
5389
  ZodFirstPartyTypeKind || (ZodFirstPartyTypeKind = {});
5390
5390
  //#endregion
5391
- //#region ../types/dist/sleep-DAX0-2v9.mjs
5391
+ //#region ../types/dist/sleep-DRqxtc0C.mjs
5392
5392
  /**
5393
5393
  * The audio chunk plane's byte format, and the ONE expansion from a coded
5394
5394
  * window to float samples (D455).
@@ -8174,8 +8174,12 @@ method(object({ deviceId: number() }), array(StreamSourceEntrySchema)), method(o
8174
8174
  kind: "mutation",
8175
8175
  auth: "admin"
8176
8176
  }), method(object({ deviceId: number() }), unknown().nullable()), method(object({ deviceId: number() }), RawStateResultSchema.nullable(), { auth: "protected" });
8177
+ object({
8178
+ code: string().regex(/^[a-z][a-z0-9-]*(\.[a-z0-9-]+)+$/),
8179
+ params: record(string(), union([string(), number()])).optional()
8180
+ });
8177
8181
  //#endregion
8178
- //#region ../types/dist/err-msg-DX6i_MY4.mjs
8182
+ //#region ../types/dist/err-msg-DLerKiVO.mjs
8179
8183
  var DeviceType = /* @__PURE__ */ function(DeviceType) {
8180
8184
  DeviceType["Camera"] = "camera";
8181
8185
  DeviceType["Hub"] = "hub";
@@ -8425,6 +8429,22 @@ var DeviceRole = /* @__PURE__ */ function(DeviceRole) {
8425
8429
  DeviceRole["Nightvision"] = "nightvision";
8426
8430
  DeviceRole["PrivacyMask"] = "privacy-mask";
8427
8431
  DeviceRole["Doorbell"] = "doorbell";
8432
+ /** Interior blind / shade / roller blind. HA `device_class: blind|shade`. */
8433
+ DeviceRole["CoverBlind"] = "cover-blind";
8434
+ /** Exterior roller shutter. HA `device_class: shutter`; Homematic BROLL. */
8435
+ DeviceRole["CoverShutter"] = "cover-shutter";
8436
+ /** Exterior awning. HA `device_class: awning`. */
8437
+ DeviceRole["CoverAwning"] = "cover-awning";
8438
+ /** Curtain / drape. HA `device_class: curtain`. */
8439
+ DeviceRole["CoverCurtain"] = "cover-curtain";
8440
+ /** Garage door. HA `device_class: garage`. A security actuator: exports gate it. */
8441
+ DeviceRole["CoverGarage"] = "cover-garage";
8442
+ /** Gate. HA `device_class: gate`. A security actuator: exports gate it. */
8443
+ DeviceRole["CoverGate"] = "cover-gate";
8444
+ /** Door. HA `device_class: door`. A security actuator: exports gate it. */
8445
+ DeviceRole["CoverDoor"] = "cover-door";
8446
+ /** Window. HA `device_class: window`. */
8447
+ DeviceRole["CoverWindow"] = "cover-window";
8428
8448
  /** Virtual HA toggle (input_boolean.*) — distinguishable from a
8429
8449
  * real Switch device for UI rendering / export adapters. */
8430
8450
  DeviceRole["BinaryHelper"] = "binary-helper";
@@ -8495,7 +8515,7 @@ var DeviceRole = /* @__PURE__ */ function(DeviceRole) {
8495
8515
  return DeviceRole;
8496
8516
  }({});
8497
8517
  //#endregion
8498
- //#region ../types/dist/composition-C-WpVYTX.mjs
8518
+ //#region ../types/dist/composition-EQ9Ok0Ee.mjs
8499
8519
  /**
8500
8520
  * The ffmpeg build every CamStack node downloads, per platform and arch.
8501
8521
  *
@@ -12172,6 +12192,8 @@ var ConvertResultSchema = object({
12172
12192
  })).readonly()
12173
12193
  });
12174
12194
  _enum(["new-session", "step-up"]);
12195
+ /** The languages the hub's app landing pages are written in (D858). */
12196
+ var AppPageLangSchema = _enum(["en", "it"]);
12175
12197
  /** How a native app starts one login method (D858), as `auth.listLoginMethods` reports it. */
12176
12198
  var AppLoginPathSchema = discriminatedUnion("kind", [object({ kind: literal("native") }), object({
12177
12199
  kind: literal("browser"),
@@ -12668,7 +12690,9 @@ var ConfigTabDeclarationSchema = object({
12668
12690
  var ConfigSectionWithValuesSchema = object({
12669
12691
  id: string(),
12670
12692
  title: string(),
12693
+ titleKey: string().optional(),
12671
12694
  description: string().optional(),
12695
+ descriptionKey: string().optional(),
12672
12696
  style: _enum(["card", "accordion"]).optional(),
12673
12697
  defaultCollapsed: boolean().optional(),
12674
12698
  columns: union([
@@ -15894,6 +15918,9 @@ method(object({
15894
15918
  }), method(object({ refs: RefListSchema }), KeychainResolveResultSchema, { auth: "admin" }), method(object({ refs: RefListSchema }), object({ deleted: number().int() }), {
15895
15919
  kind: "mutation",
15896
15920
  auth: "admin"
15921
+ }), method(object({ deviceId: number().int() }), object({ refs: array(string()).readonly() }), {
15922
+ kind: "mutation",
15923
+ auth: "admin"
15897
15924
  }), method(object({}), array(KeychainSecretMetaSchema).readonly(), { auth: "admin" }), method(object({}), KeychainStateSchema, { auth: "admin" });
15898
15925
  /**
15899
15926
  * device-history — the ONE mechanism for numeric history (D850).
@@ -37297,6 +37324,38 @@ var DeviceRegisterPayloadSchema = object({
37297
37324
  * omits it and the keyword backstop applies. */
37298
37325
  secretConfigPaths: array(string()).optional()
37299
37326
  });
37327
+ /** One deleted device, kept by device-manager so an addon that missed the
37328
+ * deletion can still learn of it (D865). Written by the delete path ONLY. */
37329
+ var DeviceTombstoneSchema = object({
37330
+ deviceId: number().int().positive(),
37331
+ /** Epoch ms the device was deleted. */
37332
+ deletedAt: number(),
37333
+ /** The addon that owned the device when it was deleted. */
37334
+ providerAddonId: string()
37335
+ });
37336
+ /** Data held for one device that device-manager no longer knows. */
37337
+ var OrphanDeviceDataSchema = object({
37338
+ deviceId: number().int().positive(),
37339
+ /** Rows/files per store (`<addonId>:<store>`). */
37340
+ stores: record(string(), number().int().nonnegative())
37341
+ });
37342
+ var CleanupDeletedDevicesResultSchema = object({
37343
+ /**
37344
+ * `skipped` — the absence check could not be trusted (a device-list read
37345
+ * failed or the two reads disagreed); nothing was listed or deleted.
37346
+ * `dry-run` — `devices` is what a confirmed run would delete.
37347
+ * `cleaned` — `devices` is what was deleted.
37348
+ */
37349
+ status: _enum([
37350
+ "skipped",
37351
+ "dry-run",
37352
+ "cleaned"
37353
+ ]),
37354
+ reason: string().nullable(),
37355
+ devices: array(OrphanDeviceDataSchema),
37356
+ /** Implementers that could not be asked (their stores are not in `devices`). */
37357
+ unreachable: array(string())
37358
+ });
37300
37359
  var DeviceRemovePayloadSchema = object({ deviceId: number() });
37301
37360
  var DevicePersistConfigPayloadSchema = object({
37302
37361
  deviceId: number(),
@@ -37535,6 +37594,9 @@ method(object({
37535
37594
  }), method(object({ deviceId: number() }), object({ success: literal(true) }), {
37536
37595
  kind: "mutation",
37537
37596
  auth: "admin"
37597
+ }), method(object({ sinceMs: number() }), array(DeviceTombstoneSchema).readonly(), { auth: "admin" }), method(object({ confirm: boolean() }), CleanupDeletedDevicesResultSchema, {
37598
+ kind: "mutation",
37599
+ auth: "admin"
37538
37600
  }), method(object({ integrationId: string() }), object({ removed: number() }), {
37539
37601
  kind: "mutation",
37540
37602
  auth: "admin"
@@ -37997,6 +38059,72 @@ method(object({
37997
38059
  auth: "admin"
37998
38060
  });
37999
38061
  /**
38062
+ * `device-removal-hook` — the reliable way an addon learns a device was DELETED,
38063
+ * so it can delete what it keeps for that device (D865).
38064
+ *
38065
+ * ## Why an event was not enough
38066
+ *
38067
+ * `DeviceUnregistered` is telemetry and may be dropped (D8, D11). An addon that
38068
+ * hung its per-device clean-up on it left durable garbage whenever the event was
38069
+ * lost, the addon was down, or it was restarting at that moment — footage,
38070
+ * analytics rows and settings of device 4483 outlived the device. Loss of this
38071
+ * signal corrupts durable state, so it travels by RPC with a recorded fact
38072
+ * behind it (D8: "if loss would corrupt durable state, use RPC plus a reconcile").
38073
+ *
38074
+ * ## The three pieces
38075
+ *
38076
+ * 1. device-manager records a TOMBSTONE per deleted device
38077
+ * (`deviceManager.listDeletedSince`). The tombstone is written by the delete
38078
+ * path only — a device that is unregistered, offline or whose provider is
38079
+ * restarting is NOT deleted and gets none.
38080
+ * 2. After a delete, device-manager calls `onDeviceRemoved` on EVERY provider of
38081
+ * this collection, one by one, with bounded retries, logged.
38082
+ * 3. An implementer that was down asks `deviceManager.listDeletedSince` at start
38083
+ * (and periodically) and runs its own `onDeviceRemoved` for each tombstone it
38084
+ * may have missed. Reconcile is driven by tombstones, never by "the device is
38085
+ * not in the current list": a failed or partial list read must not destroy data.
38086
+ *
38087
+ * ## Contract for an implementer
38088
+ *
38089
+ * - **Idempotent.** It is called again by a retry, by a reconcile and by the
38090
+ * admin cleanup of data that predates tombstones. A device with nothing left
38091
+ * answers zero counts.
38092
+ * - **One key per store** in `counts`, deleted rows/files per store, so the log
38093
+ * line and the admin dry run can say where the data was.
38094
+ * - **Training datasets are NOT device data** and are never deleted by a hook.
38095
+ * - **Per-device SETTINGS are not hooked.** Configuration lives in the standard
38096
+ * per-device store (`ctx.settings.*DeviceStore`), which device-manager clears
38097
+ * for every addon centrally at delete time. This hook is for device DATA
38098
+ * that is not settings: footage, event media, analytics rows, history.
38099
+ * - A provider that cannot tell is allowed to throw; the caller retries it.
38100
+ *
38101
+ * `listDeviceData` is the read side of the admin "Clean data of deleted devices"
38102
+ * action: which device ids this addon holds data for, and how much per store. It
38103
+ * never deletes. device-manager decides which of those ids are absent from the
38104
+ * fleet, from TWO consistent reads of the device list (D49).
38105
+ */
38106
+ /** What a hook is told about the deletion. */
38107
+ var DeviceRemovedInputSchema = object({
38108
+ deviceId: number().int().positive(),
38109
+ /** Epoch ms the device was deleted (the tombstone's `deletedAt`). */
38110
+ deletedAt: number(),
38111
+ /** The addon that owned the device, as device-manager last knew it. */
38112
+ providerAddonId: string()
38113
+ });
38114
+ /** Rows/files/refs deleted, per store this implementer owns. */
38115
+ var DeviceRemovedResultSchema = object({ counts: record(string(), number().int().nonnegative()) });
38116
+ /** One (store, device) pair an implementer holds data for. */
38117
+ var DeviceDataEntrySchema = object({
38118
+ store: string(),
38119
+ deviceId: number().int().positive(),
38120
+ /** Rows (or files) held for the device in the store. */
38121
+ count: number().int().nonnegative()
38122
+ });
38123
+ method(DeviceRemovedInputSchema, DeviceRemovedResultSchema, {
38124
+ kind: "mutation",
38125
+ auth: "admin"
38126
+ }), method(_void(), array(DeviceDataEntrySchema).readonly(), { auth: "admin" });
38127
+ /**
38000
38128
  * `failure-contribution` — the capability an addon reports its OWN losses
38001
38129
  * through, per camera, with the denominator attached. It stores nothing.
38002
38130
  *
@@ -49557,7 +49685,9 @@ var SsoBridgeClaimsSchema = object({
49557
49685
  codeChallenge: string(),
49558
49686
  state: string(),
49559
49687
  purpose: _enum(["new-session", "step-up"]),
49560
- redirect: string()
49688
+ redirect: string(),
49689
+ /** The page language the app asked for (D858); the confirm page speaks it. */
49690
+ lang: _enum(["en", "it"]).optional()
49561
49691
  }).optional()
49562
49692
  });
49563
49693
  method(object({
@@ -58921,6 +59051,21 @@ DeviceType.Switch, DeviceType.Siren, DeviceType.Light, method(object({
58921
59051
  on: boolean(),
58922
59052
  lastChangedAt: number()
58923
59053
  });
59054
+ /** C0 controls, DEL and the C1 range: none of them belongs in a name. */
59055
+ function hasControlCharacter(value) {
59056
+ for (const char of value) {
59057
+ const code = char.codePointAt(0) ?? 0;
59058
+ if (code <= 31 || code >= 127 && code <= 159) return true;
59059
+ }
59060
+ return false;
59061
+ }
59062
+ string().transform((value) => value.trim()).pipe(string().min(1, "The server name cannot be empty").max(48, `The server name is at most 48 characters`).refine((value) => !hasControlCharacter(value), { message: "The server name cannot contain control characters" }));
59063
+ /** What every reader gets: the name to show, and whether the hub chose it itself. */
59064
+ var ServerNameInfoSchema = object({
59065
+ name: string(),
59066
+ /** `true` when nobody named the hub: `name` is the machine hostname. */
59067
+ isDefault: boolean()
59068
+ });
58924
59069
  /**
58925
59070
  * system — system-scoped singleton capability exposing hub-level
58926
59071
  * health, feature flags, network interface enumeration, and the
@@ -58950,6 +59095,12 @@ var FeatureManifestSchema = object({
58950
59095
  backup: boolean(),
58951
59096
  repl: boolean()
58952
59097
  });
59098
+ /**
59099
+ * `system.info`: the feature flags plus the hub's human name (D861). The name is
59100
+ * `{ name, isDefault }` — `isDefault: true` means nobody named the hub and `name`
59101
+ * is the machine hostname.
59102
+ */
59103
+ var SystemInfoSchema = FeatureManifestSchema.extend({ serverName: ServerNameInfoSchema });
58953
59104
  var HealthStatusSchema = object({
58954
59105
  status: literal("ok"),
58955
59106
  uptime: number()
@@ -59422,7 +59573,7 @@ var LoggingSettingsStateSchema = object({
59422
59573
  opsLogRetentionDays: number().int().min(0),
59423
59574
  persisted: boolean()
59424
59575
  });
59425
- method(_void(), FeatureManifestSchema), method(_void(), HealthStatusSchema), method(_void(), FeatureManifestSchema), method(_void(), array(NetworkAddressSchema).readonly()), method(_void(), unknown().nullable(), { auth: "admin" }), method(record(string(), unknown()), _null(), {
59576
+ method(_void(), SystemInfoSchema), method(_void(), HealthStatusSchema), method(_void(), FeatureManifestSchema), method(_void(), array(NetworkAddressSchema).readonly()), method(_void(), unknown().nullable(), { auth: "admin" }), method(record(string(), unknown()), _null(), {
59426
59577
  kind: "mutation",
59427
59578
  auth: "admin"
59428
59579
  }), method(_void(), _void(), {
@@ -62473,6 +62624,12 @@ Object.freeze({
62473
62624
  addonId: null,
62474
62625
  access: "create"
62475
62626
  },
62627
+ "deviceManager.cleanupDeletedDevicesData": {
62628
+ capName: "device-manager",
62629
+ capScope: "system",
62630
+ addonId: null,
62631
+ access: "create"
62632
+ },
62476
62633
  "deviceManager.createDevice": {
62477
62634
  capName: "device-manager",
62478
62635
  capScope: "system",
@@ -62653,6 +62810,12 @@ Object.freeze({
62653
62810
  addonId: null,
62654
62811
  access: "view"
62655
62812
  },
62813
+ "deviceManager.listDeletedSince": {
62814
+ capName: "device-manager",
62815
+ capScope: "system",
62816
+ addonId: null,
62817
+ access: "view"
62818
+ },
62656
62819
  "deviceManager.listDeviceIdsByCaps": {
62657
62820
  capName: "device-manager",
62658
62821
  capScope: "system",
@@ -63061,6 +63224,18 @@ Object.freeze({
63061
63224
  addonId: null,
63062
63225
  access: "create"
63063
63226
  },
63227
+ "deviceRemovalHook.listDeviceData": {
63228
+ capName: "device-removal-hook",
63229
+ capScope: "system",
63230
+ addonId: null,
63231
+ access: "view"
63232
+ },
63233
+ "deviceRemovalHook.onDeviceRemoved": {
63234
+ capName: "device-removal-hook",
63235
+ capScope: "system",
63236
+ addonId: null,
63237
+ access: "create"
63238
+ },
63064
63239
  "deviceState.claimFields": {
63065
63240
  capName: "device-state",
63066
63241
  capScope: "system",
@@ -63493,6 +63668,12 @@ Object.freeze({
63493
63668
  addonId: null,
63494
63669
  access: "delete"
63495
63670
  },
63671
+ "keychain.deleteDeviceScope": {
63672
+ capName: "keychain",
63673
+ capScope: "system",
63674
+ addonId: null,
63675
+ access: "delete"
63676
+ },
63496
63677
  "keychain.getState": {
63497
63678
  capName: "keychain",
63498
63679
  capScope: "system",
@@ -69505,6 +69686,11 @@ Object.freeze({
69505
69686
  form: "single",
69506
69687
  optional: false
69507
69688
  }],
69689
+ "deviceRemovalHook.onDeviceRemoved": [{
69690
+ name: "deviceId",
69691
+ form: "single",
69692
+ optional: false
69693
+ }],
69508
69694
  "deviceState.claimFields": [{
69509
69695
  name: "deviceId",
69510
69696
  form: "single",
@@ -69694,6 +69880,11 @@ Object.freeze({
69694
69880
  form: "single",
69695
69881
  optional: false
69696
69882
  }],
69883
+ "keychain.deleteDeviceScope": [{
69884
+ name: "deviceId",
69885
+ form: "single",
69886
+ optional: false
69887
+ }],
69697
69888
  "lawnMowerControl.dock": [{
69698
69889
  name: "deviceId",
69699
69890
  form: "single",
@@ -72042,6 +72233,8 @@ new Set([
72042
72233
  "audio-tools",
72043
72234
  "audio-silence"
72044
72235
  ]);
72236
+ AppPageLangSchema.options;
72237
+ record(string().min(1), string());
72045
72238
  /**
72046
72239
  * TimelapseRule — the STANDALONE scheduled timelapse producer's rule model.
72047
72240
  *
@@ -72477,7 +72670,7 @@ var AgentUIAddon = class extends BaseAddon {
72477
72670
  capability: adminUiCapability,
72478
72671
  provider: {
72479
72672
  getStaticDir: async () => ({ staticDir: path.resolve(__dirname) }),
72480
- getVersion: async () => ({ version: "1.2.234" })
72673
+ getVersion: async () => ({ version: "1.2.236" })
72481
72674
  }
72482
72675
  }];
72483
72676
  }