@camstack/system 1.2.465 → 1.2.467

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 (91) hide show
  1. package/dist/addon-runner.js +1 -0
  2. package/dist/addon-runner.mjs +1 -0
  3. package/dist/addon-utils.mjs +1 -1
  4. package/dist/{agent-https-CzA1AmyI.js → agent-https-DJ8OzQOr.js} +1 -1
  5. package/dist/{agent-https-CPJ7FTs0.mjs → agent-https-DR1wmhYY.mjs} +1 -1
  6. package/dist/builtins/addon-pages-aggregator/addon-pages-aggregator.addon.js +1 -1
  7. package/dist/builtins/addon-pages-aggregator/addon-pages-aggregator.addon.mjs +4 -4
  8. package/dist/builtins/addon-widgets-aggregator/addon-widgets-aggregator.addon.js +1 -1
  9. package/dist/builtins/addon-widgets-aggregator/addon-widgets-aggregator.addon.mjs +5 -5
  10. package/dist/builtins/alerts/alerts.addon.js +1 -1
  11. package/dist/builtins/alerts/alerts.addon.mjs +1 -1
  12. package/dist/builtins/autotrack/index.js +1 -1
  13. package/dist/builtins/autotrack/index.mjs +1 -1
  14. package/dist/builtins/backup-orchestrator/backup-orchestrator.addon.js +2 -2
  15. package/dist/builtins/backup-orchestrator/backup-orchestrator.addon.mjs +5 -5
  16. package/dist/builtins/calendars/calendars.addon.js +1 -1
  17. package/dist/builtins/calendars/calendars.addon.mjs +1 -1
  18. package/dist/builtins/camera-grid/index.js +1 -1
  19. package/dist/builtins/camera-grid/index.mjs +1 -1
  20. package/dist/builtins/composer/composer.addon.js +2 -2
  21. package/dist/builtins/composer/composer.addon.mjs +2 -2
  22. package/dist/builtins/console-logging/index.js +1 -1
  23. package/dist/builtins/console-logging/index.mjs +1 -1
  24. package/dist/builtins/core-blocks/core-blocks.addon.js +2 -2
  25. package/dist/builtins/core-blocks/core-blocks.addon.mjs +2 -2
  26. package/dist/builtins/device-history/device-history.addon.js +1 -1
  27. package/dist/builtins/device-history/device-history.addon.mjs +1 -1
  28. package/dist/builtins/device-manager/device-manager.addon.js +1 -1
  29. package/dist/builtins/device-manager/device-manager.addon.mjs +1 -1
  30. package/dist/builtins/hub-forwarder/index.js +1 -1
  31. package/dist/builtins/hub-forwarder/index.mjs +1 -1
  32. package/dist/builtins/keychain/index.js +3 -3
  33. package/dist/builtins/keychain/index.mjs +3 -3
  34. package/dist/builtins/liveness-monitor/liveness-monitor.addon.js +1 -1
  35. package/dist/builtins/liveness-monitor/liveness-monitor.addon.mjs +1 -1
  36. package/dist/builtins/local-auth/auth-schema.d.ts +0 -2
  37. package/dist/builtins/local-auth/local-auth.addon.d.ts +0 -1
  38. package/dist/builtins/local-auth/local-auth.addon.js +23 -178
  39. package/dist/builtins/local-auth/local-auth.addon.mjs +27 -181
  40. package/dist/builtins/local-auth/record-kinds.d.ts +1 -6
  41. package/dist/builtins/local-network/local-network.addon.js +2 -2
  42. package/dist/builtins/local-network/local-network.addon.mjs +2 -2
  43. package/dist/builtins/loki-logging/index.js +1 -1
  44. package/dist/builtins/loki-logging/index.mjs +1 -1
  45. package/dist/builtins/native-metrics/native-metrics.addon.js +1 -1
  46. package/dist/builtins/native-metrics/native-metrics.addon.mjs +10 -10
  47. package/dist/builtins/platform-probe/index.js +1 -1
  48. package/dist/builtins/platform-probe/index.mjs +8 -8
  49. package/dist/builtins/record-entries/index.js +1 -1
  50. package/dist/builtins/record-entries/index.mjs +1 -1
  51. package/dist/builtins/remote-access-orchestrator/remote-access-orchestrator.addon.js +1 -1
  52. package/dist/builtins/remote-access-orchestrator/remote-access-orchestrator.addon.mjs +1 -1
  53. package/dist/builtins/snapshot/index.js +1 -1
  54. package/dist/builtins/snapshot/index.mjs +1 -1
  55. package/dist/builtins/sqlite-storage/filesystem-storage.addon.js +1 -1
  56. package/dist/builtins/sqlite-storage/filesystem-storage.addon.mjs +20 -20
  57. package/dist/builtins/sqlite-storage/index.js +1 -1
  58. package/dist/builtins/sqlite-storage/index.mjs +1 -1
  59. package/dist/builtins/sqlite-storage/records/records-engine.d.ts +11 -0
  60. package/dist/builtins/sqlite-storage/records/records-provider.d.ts +7 -2
  61. package/dist/builtins/sqlite-storage/sqlite-settings.addon.js +25 -15
  62. package/dist/builtins/sqlite-storage/sqlite-settings.addon.mjs +25 -15
  63. package/dist/builtins/storage-orchestrator/storage-orchestrator.addon.js +1 -1
  64. package/dist/builtins/storage-orchestrator/storage-orchestrator.addon.mjs +1 -1
  65. package/dist/builtins/system-config/system-config.addon.js +3 -3
  66. package/dist/builtins/system-config/system-config.addon.mjs +115 -115
  67. package/dist/builtins/winston-logging/index.js +1 -1
  68. package/dist/builtins/winston-logging/index.mjs +1 -1
  69. package/dist/{composition-sources-BG0E76VO.js → composition-sources-5rpWQhA1.js} +1 -1
  70. package/dist/{composition-sources-CqRsEC0a.mjs → composition-sources-Qto-S6MA.mjs} +1 -1
  71. package/dist/{constants-CmGw1liQ.mjs → constants-BWli8Cju.mjs} +1 -1
  72. package/dist/{constants-BYJ4ni7h.js → constants-CuO3rcw4.js} +1 -1
  73. package/dist/{coral-accelerators-Qhn5TOYZ.mjs → coral-accelerators-D_S1Fo5h.mjs} +5 -5
  74. package/dist/{custom-action-registry-DZSCLBuT.mjs → custom-action-registry-BGYDjTqY.mjs} +37 -37
  75. package/dist/{device-ca-CQcB6yfj.mjs → device-ca-C5cLlah1.mjs} +1 -1
  76. package/dist/{device-ca-B-Txwl4W.js → device-ca-CGcaSheI.js} +1 -1
  77. package/dist/{dist-CR7idLer.mjs → dist-BpUtAgqR.mjs} +158 -72
  78. package/dist/{dist-Dwi4JA96.js → dist-l6zKmHEb.js} +175 -77
  79. package/dist/file-host-worker.js +1 -1
  80. package/dist/file-host-worker.mjs +1 -1
  81. package/dist/{hub-mdns-ciao-BlLwL65g.mjs → hub-mdns-ciao-0KWDyIMD.mjs} +2 -2
  82. package/dist/{hub-mdns-ciao-3qdHbtyp.js → hub-mdns-ciao-CIno_SNn.js} +2 -2
  83. package/dist/index.d.ts +0 -2
  84. package/dist/index.js +8 -8
  85. package/dist/index.mjs +228 -227
  86. package/dist/{restore-archive-D1uxP8Eb.js → restore-archive-B71JI-sP.js} +1 -1
  87. package/dist/{restore-archive-BYL7E5af.mjs → restore-archive-DKxAZ9pI.mjs} +94 -94
  88. package/dist/{wal-maintenance-BQlvAduo.js → wal-maintenance-B6LSQ_OZ.js} +0 -0
  89. package/dist/{wal-maintenance-BDQT7TIi.mjs → wal-maintenance-BXYwFecW.mjs} +0 -0
  90. package/package.json +1 -1
  91. package/dist/auth/api-key-manager.d.ts +0 -19
@@ -1,6 +1,6 @@
1
1
  let zod = require("zod");
2
2
  require("node:crypto");
3
- //#region ../types/dist/event-category-7pZEBmVg.mjs
3
+ //#region ../types/dist/event-category-BfJwUd2S.mjs
4
4
  var EventCategory = /* @__PURE__ */ function(EventCategory) {
5
5
  EventCategory["SystemBoot"] = "system.boot";
6
6
  EventCategory["SystemAddonsReady"] = "system.addons-ready";
@@ -317,6 +317,15 @@ var EventCategory = /* @__PURE__ */ function(EventCategory) {
317
317
  */
318
318
  EventCategory["PipelineDetectionBlind"] = "pipeline.detection-blind";
319
319
  /**
320
+ * A camera's motion source has fired constantly with no subject for an hour
321
+ * (motion duty or session count over the bar, zero detections) — it is not
322
+ * blind, its motion zones or sensitivity want tuning (D907). Paired with
323
+ * {@link PipelineMotionCalm}.
324
+ */
325
+ EventCategory["PipelineMotionNoisy"] = "pipeline.motion-noisy";
326
+ /** The recovery edge of {@link PipelineMotionNoisy}: the motion fell back, or a detection arrived. */
327
+ EventCategory["PipelineMotionCalm"] = "pipeline.motion-calm";
328
+ /**
320
329
  * Per-camera pipeline config was mutated by the orchestrator
321
330
  * (3-level settings change via `setAgentAddonDefaults` /
322
331
  * `setCameraStepToggle` / `setCameraPipelineForAgent` or a
@@ -753,7 +762,7 @@ var EventCategory = /* @__PURE__ */ function(EventCategory) {
753
762
  return EventCategory;
754
763
  }({});
755
764
  //#endregion
756
- //#region ../types/dist/sleep-CueztlR1.mjs
765
+ //#region ../types/dist/sleep-DJFUfKvA.mjs
757
766
  /**
758
767
  * The audio chunk plane's byte format, and the ONE expansion from a coded
759
768
  * window to float samples (D455).
@@ -3412,6 +3421,17 @@ var BatchTooLargeError = class extends RecordsError {
3412
3421
  this.name = "BatchTooLargeError";
3413
3422
  }
3414
3423
  };
3424
+ /**
3425
+ * A `transact` the engine refuses before touching a row: an op on a kind the
3426
+ * caller did not declare in ONE file and ONE `transactFamily`. The detail names
3427
+ * which rule (`cross-file`, `cross-family`, `no-family`); it is never a silent split.
3428
+ */
3429
+ var TransactRefusedError = class extends RecordsError {
3430
+ constructor(detail) {
3431
+ super("transact-refused", detail);
3432
+ this.name = "TransactRefusedError";
3433
+ }
3434
+ };
3415
3435
  function defOf(schema) {
3416
3436
  const zodBag = Reflect.get(schema, "_zod");
3417
3437
  if (typeof zodBag !== "object" || zodBag === null) return {};
@@ -3646,8 +3666,7 @@ var EntryDescriptorSchema = zod.z.object({
3646
3666
  /** JSON Schema of the entry body; `secret: true` marks a password field. */
3647
3667
  fields: zod.z.record(zod.z.string(), zod.z.unknown())
3648
3668
  }).strict();
3649
- /** What crosses the wire and sits in the engine's catalog: JSON only, no Zod. */
3650
- var RecordKindDeclarationSchema = zod.z.object({
3669
+ var RecordKindDeclarationShape = zod.z.object({
3651
3670
  database: zod.z.enum(RECORD_DATABASES).default("settings"),
3652
3671
  class: zod.z.enum(RECORD_CLASSES),
3653
3672
  writeTrigger: zod.z.string().min(1),
@@ -3665,18 +3684,18 @@ var RecordKindDeclarationSchema = zod.z.object({
3665
3684
  secretPaths: zod.z.array(zod.z.string().min(1)).default([]),
3666
3685
  /** The id key of each array that carries a secret (`{ headers: 'name' }`). */
3667
3686
  secretArrayKeys: zod.z.record(zod.z.string(), zod.z.string()).default({}),
3668
- /**
3669
- * RETIRED (D900): the legacy table a kind adopted from during the records
3670
- * migration. Nothing declares it any more and nothing reads it; the schema
3671
- * still ACCEPTS it because the catalog rows the migration wrote carry it
3672
- * (an orphaned kind is never redeclared) and an addon built before the
3673
- * removal still sends it. Never set it.
3674
- */
3675
- adoptsFrom: zod.z.string().min(1).optional(),
3676
3687
  /** Kinds that must agree through `transact` sit in one file under one family name. */
3677
3688
  transactFamily: zod.z.string().min(1).optional(),
3678
3689
  entry: EntryDescriptorSchema.optional()
3679
- }).strict();
3690
+ });
3691
+ /** What crosses the wire from an addon: JSON only, no Zod. An unknown key is refused. */
3692
+ var RecordKindDeclarationSchema = RecordKindDeclarationShape.strict();
3693
+ /**
3694
+ * A declaration as the engine's catalog stored it: an unknown key is DROPPED,
3695
+ * because a row written by an older engine must never stop records from
3696
+ * starting. Only for rows read back from the catalog, never for input.
3697
+ */
3698
+ var StoredRecordKindDeclarationSchema = RecordKindDeclarationShape;
3680
3699
  /** The kind names: lower-case, dash separated, short enough for an index name. */
3681
3700
  var RecordKindNameSchema = zod.z.string().regex(/^[a-z][a-z0-9-]{0,47}$/);
3682
3701
  /** Cross-field rules a declaration must satisfy. Throws {@link DeclarationRefusedError}. */
@@ -3762,6 +3781,23 @@ function defineRecordKinds(specs) {
3762
3781
  }
3763
3782
  return out;
3764
3783
  }
3784
+ /**
3785
+ * The scope rule of `transact`, shared by the engine, the provider and the
3786
+ * in-memory records so they cannot disagree: every op's kind sits in ONE
3787
+ * database file, and when more than one kind is involved they all name the
3788
+ * SAME `transactFamily`. A refusal names the rule; nothing is split silently.
3789
+ */
3790
+ /** Throws {@link TransactRefusedError} unless the kinds may share one transaction. */
3791
+ function assertTransactScope(members) {
3792
+ const byKind = /* @__PURE__ */ new Map();
3793
+ for (const m of members) byKind.set(m.kind, m);
3794
+ const kinds = [...byKind.values()];
3795
+ if (new Set(kinds.map((m) => m.declaration.database)).size > 1) throw new TransactRefusedError(`cross-file: the ops span more than one database file (${kinds.map((m) => `${m.kind}@${m.declaration.database}`).join(", ")}); a transaction lives in ONE file`);
3796
+ if (kinds.length <= 1) return;
3797
+ const missing = kinds.filter((m) => m.declaration.transactFamily === void 0);
3798
+ if (missing.length > 0) throw new TransactRefusedError(`no-family: ${missing.map((m) => m.kind).join(", ")} declare no transactFamily; kinds that must agree through transact share one`);
3799
+ if (new Set(kinds.map((m) => m.declaration.transactFamily)).size > 1) throw new TransactRefusedError(`cross-family: the ops span more than one transactFamily (${kinds.map((m) => `${m.kind}=${String(m.declaration.transactFamily)}`).join(", ")})`);
3800
+ }
3765
3801
  /** Shared Zod schemas used across streaming capabilities. */
3766
3802
  var CamProfileSchema = zod.z.enum([
3767
3803
  "high",
@@ -10561,17 +10597,6 @@ var UserRecordSchema = zod.z.object({
10561
10597
  createdAt: zod.z.number(),
10562
10598
  updatedAt: zod.z.number()
10563
10599
  });
10564
- var ApiKeyRecordSchema = zod.z.object({
10565
- id: zod.z.string(),
10566
- label: zod.z.string(),
10567
- isAdmin: zod.z.boolean().default(false),
10568
- allowedProviders: AllowedProviderSchema,
10569
- allowedDevices: AllowedDevicesSchema,
10570
- tokenHash: zod.z.string(),
10571
- tokenPrefix: zod.z.string(),
10572
- createdAt: zod.z.number(),
10573
- lastUsedAt: zod.z.number().optional()
10574
- });
10575
10600
  var ScopedTokenSchema = zod.z.object({
10576
10601
  id: zod.z.string(),
10577
10602
  userId: zod.z.string(),
@@ -17215,16 +17240,36 @@ var RecordKindStateSchema = zod.z.enum([
17215
17240
  var DeclareKindResultSchema = zod.z.object({
17216
17241
  kindId: zod.z.number().int(),
17217
17242
  state: RecordKindStateSchema,
17218
- createdIndexes: zod.z.array(zod.z.string()),
17219
- /**
17220
- * RETIRED (D900): always `null`. It carried the records-migration boot guard;
17221
- * it stays on the wire, null, because an addon built before the removal reads
17222
- * an ABSENT field as "adoption pending" and refuses to start.
17223
- */
17224
- adoptionPending: zod.z.null()
17243
+ createdIndexes: zod.z.array(zod.z.string())
17225
17244
  });
17226
17245
  /** Keychain refs a write released (the old marker is gone from the row): the owner deletes the values. */
17227
17246
  var SecretRefsList = zod.z.array(zod.z.string());
17247
+ /**
17248
+ * One op of a `transact`: the single-row writes, each on a kind of the caller.
17249
+ * All ops of one call share ONE database file and ONE `transactFamily`.
17250
+ */
17251
+ var RecordTransactOpSchema = zod.z.discriminatedUnion("op", [
17252
+ zod.z.object({
17253
+ op: zod.z.literal("put"),
17254
+ kind: RecordKindNameSchema,
17255
+ record: RecordInputSchema,
17256
+ ifRev: zod.z.number().int().min(0).optional()
17257
+ }),
17258
+ zod.z.object({
17259
+ op: zod.z.literal("patch"),
17260
+ kind: RecordKindNameSchema,
17261
+ id: RecordIdSchema,
17262
+ data: RecordBodySchema,
17263
+ at: zod.z.number().int().nullable().optional(),
17264
+ expiresAt: zod.z.number().int().nullable().optional(),
17265
+ ifRev: zod.z.number().int().min(1).optional()
17266
+ }),
17267
+ zod.z.object({
17268
+ op: zod.z.literal("delete"),
17269
+ kind: RecordKindNameSchema,
17270
+ id: RecordIdSchema
17271
+ })
17272
+ ]);
17228
17273
  var RecordSecretRefsSchema = zod.z.record(zod.z.string(), zod.z.record(zod.z.string(), zod.z.string()));
17229
17274
  var recordsCapability = {
17230
17275
  name: "records",
@@ -17356,6 +17401,22 @@ var recordsCapability = {
17356
17401
  kind: "mutation",
17357
17402
  auth: "admin"
17358
17403
  }),
17404
+ /**
17405
+ * Several single-row writes (put / patch / delete) in ONE SQLite transaction:
17406
+ * all land or none does. Every op's kind must sit in one file and share one
17407
+ * `transactFamily` (`records/transact-refused` otherwise). Results are in op order.
17408
+ */
17409
+ transact: method(zod.z.object({ ops: zod.z.array(RecordTransactOpSchema).min(1).max(RECORD_BATCH_MAX) }), zod.z.object({
17410
+ results: zod.z.array(zod.z.object({
17411
+ rev: zod.z.number().int().nullable(),
17412
+ deleted: zod.z.boolean()
17413
+ })),
17414
+ releasedRefs: SecretRefsList,
17415
+ secretRefs: SecretRefsList
17416
+ }), {
17417
+ kind: "mutation",
17418
+ auth: "admin"
17419
+ }),
17359
17420
  /** The D865 hook body: every kind of this addon declared `deviceRemoval: 'delete'`. */
17360
17421
  deleteDevice: method(zod.z.object({
17361
17422
  deviceId: zod.z.number().int(),
@@ -44990,9 +45051,13 @@ var NcSystemEventKindSchema = zod.z.enum([
44990
45051
  "node-updating",
44991
45052
  "node-inference-unavailable",
44992
45053
  "detection-blind",
45054
+ "motion-noisy",
45055
+ "motion-calm",
44993
45056
  "recording-stalled",
44994
45057
  "recording-healthy",
44995
45058
  "recording-degraded",
45059
+ "device-attention-required",
45060
+ "device-attention-resolved",
44996
45061
  "storage-location-low",
44997
45062
  "storage-location-critical",
44998
45063
  "storage-location-ok",
@@ -51804,7 +51869,6 @@ var RecommendationReasonSchema = zod.z.discriminatedUnion("kind", [
51804
51869
  modelId: zod.z.string()
51805
51870
  }),
51806
51871
  zod.z.object({ kind: zod.z.literal("cpu-device") }),
51807
- zod.z.object({ kind: zod.z.literal("coral-untouched") }),
51808
51872
  zod.z.object({ kind: zod.z.literal("device-disabled") }),
51809
51873
  zod.z.object({ kind: zod.z.literal("device-unavailable") }),
51810
51874
  zod.z.object({ kind: zod.z.literal("node-offline") }),
@@ -51902,11 +51966,6 @@ var AutoTuneWarningSchema = zod.z.discriminatedUnion("kind", [
51902
51966
  kind: zod.z.literal("detector-store-unreadable"),
51903
51967
  error: zod.z.string()
51904
51968
  }),
51905
- zod.z.object({
51906
- kind: zod.z.literal("coral-enabled"),
51907
- nodeId: zod.z.string(),
51908
- deviceKey: zod.z.string()
51909
- }),
51910
51969
  zod.z.object({
51911
51970
  kind: zod.z.literal("custom-pin-kept"),
51912
51971
  nodeId: zod.z.string(),
@@ -61570,6 +61629,16 @@ var DishwasherStatusSchema = zod.z.object({
61570
61629
  powerState: zod.z.string().nullable(),
61571
61630
  saltLevel: DishwasherConsumableLevelSchema.nullable(),
61572
61631
  rinseAidLevel: DishwasherConsumableLevelSchema.nullable(),
61632
+ /**
61633
+ * True while the appliance asks for its filter to be cleaned (smart-filter, filter-system or
61634
+ * combined care-and-filter reminder raised); false when every such reminder reads clear; null
61635
+ * when none is reported. A cleared reminder is not an unknown one.
61636
+ */
61637
+ filterCleaningDue: zod.z.boolean().nullable(),
61638
+ /** True while the machine-care (descaling / cleaning-program) reminder is raised; false when clear; null when not reported. */
61639
+ machineCareDue: zod.z.boolean().nullable(),
61640
+ /** Program runs left before the machine-care reminder is due; null when the appliance does not say. */
61641
+ machineCareRemainingRuns: zod.z.number().int().nonnegative().nullable(),
61573
61642
  /** Option states: null when the appliance does not expose the option or has not said. */
61574
61643
  halfLoad: zod.z.boolean().nullable(),
61575
61644
  hygienePlus: zod.z.boolean().nullable(),
@@ -71712,16 +71781,6 @@ var UpdateUserInputSchema = zod.z.object({
71712
71781
  allowedDevices: zod.z.record(zod.z.string(), zod.z.union([zod.z.array(zod.z.string()), zod.z.literal("*")])).optional(),
71713
71782
  scopes: zod.z.array(TokenScopeSchema).optional()
71714
71783
  });
71715
- var ApiKeySummarySchema = zod.z.object({
71716
- id: zod.z.string(),
71717
- label: zod.z.string(),
71718
- isAdmin: zod.z.boolean().default(false),
71719
- allowedProviders: zod.z.union([zod.z.array(zod.z.string()), zod.z.literal("*")]).optional(),
71720
- allowedDevices: zod.z.record(zod.z.string(), zod.z.union([zod.z.array(zod.z.string()), zod.z.literal("*")])).optional(),
71721
- tokenPrefix: zod.z.string(),
71722
- createdAt: zod.z.number(),
71723
- lastUsedAt: zod.z.number().optional()
71724
- });
71725
71784
  var OauthSessionSummarySchema = zod.z.object({
71726
71785
  id: zod.z.string(),
71727
71786
  userId: zod.z.string(),
@@ -71743,8 +71802,7 @@ var TotpStatusSchema = zod.z.object({
71743
71802
  confirmedAt: zod.z.number().nullable()
71744
71803
  });
71745
71804
  /**
71746
- * user-management — singleton capability for user accounts and the
71747
- * legacy API-key rows.
71805
+ * user-management — singleton capability for user accounts.
71748
71806
  *
71749
71807
  * v2 model: every method gated by `auth: 'admin'`. Admin-only delegation
71750
71808
  * — the subset check on `setUserScopes` is moot
@@ -71812,12 +71870,6 @@ var userManagementCapability = {
71812
71870
  kind: "mutation",
71813
71871
  access: "view"
71814
71872
  }),
71815
- listApiKeys: method(zod.z.void(), zod.z.array(ApiKeySummarySchema), { auth: "admin" }),
71816
- revokeApiKey: method(zod.z.object({ id: zod.z.string() }), zod.z.object({ success: zod.z.literal(true) }), {
71817
- kind: "mutation",
71818
- auth: "admin",
71819
- access: "delete"
71820
- }),
71821
71873
  setupTotp: method(zod.z.object({ userId: zod.z.string() }), TotpSetupResultSchema, {
71822
71874
  kind: "mutation",
71823
71875
  auth: "admin",
@@ -81671,6 +81723,12 @@ var METHOD_ACCESS_MAP = Object.freeze({
81671
81723
  addonId: null,
81672
81724
  access: "view"
81673
81725
  },
81726
+ "records.transact": {
81727
+ capName: "records",
81728
+ capScope: "system",
81729
+ addonId: null,
81730
+ access: "create"
81731
+ },
81674
81732
  "sceneMonitor.captureReference": {
81675
81733
  capName: "scene-monitor",
81676
81734
  capScope: "device",
@@ -83003,12 +83061,6 @@ var METHOD_ACCESS_MAP = Object.freeze({
83003
83061
  addonId: null,
83004
83062
  access: "view"
83005
83063
  },
83006
- "userManagement.listApiKeys": {
83007
- capName: "user-management",
83008
- capScope: "system",
83009
- addonId: null,
83010
- access: "view"
83011
- },
83012
83064
  "userManagement.listExternalIdentities": {
83013
83065
  capName: "user-management",
83014
83066
  capScope: "system",
@@ -83063,12 +83115,6 @@ var METHOD_ACCESS_MAP = Object.freeze({
83063
83115
  addonId: null,
83064
83116
  access: "create"
83065
83117
  },
83066
- "userManagement.revokeApiKey": {
83067
- capName: "user-management",
83068
- capScope: "system",
83069
- addonId: null,
83070
- access: "delete"
83071
- },
83072
83118
  "userManagement.revokeOauthSession": {
83073
83119
  capName: "user-management",
83074
83120
  capScope: "system",
@@ -87384,9 +87430,13 @@ new Map(Object.entries({
87384
87430
  "stream-online": "device-events",
87385
87431
  "stream-offline": "device-events",
87386
87432
  "detection-blind": "device-events",
87433
+ "motion-noisy": "device-events",
87434
+ "motion-calm": "device-events",
87387
87435
  "recording-stalled": "device-events",
87388
87436
  "recording-healthy": "device-events",
87389
87437
  "recording-degraded": "device-events",
87438
+ "device-attention-required": "device-events",
87439
+ "device-attention-resolved": "device-events",
87390
87440
  "node-online": "system",
87391
87441
  "node-offline": "system",
87392
87442
  "node-restarting": "system",
@@ -87469,6 +87519,12 @@ var NC_SYSTEM_EVENT_KIND_GROUP_SPECS = [
87469
87519
  label: "Detecting nothing",
87470
87520
  kinds: ["detection-blind"]
87471
87521
  },
87522
+ {
87523
+ id: "motion-noise",
87524
+ family: "device-events",
87525
+ label: "Motion without a subject",
87526
+ kinds: ["motion-noisy", "motion-calm"]
87527
+ },
87472
87528
  {
87473
87529
  id: "recording",
87474
87530
  family: "device-events",
@@ -87479,6 +87535,12 @@ var NC_SYSTEM_EVENT_KIND_GROUP_SPECS = [
87479
87535
  "recording-degraded"
87480
87536
  ]
87481
87537
  },
87538
+ {
87539
+ id: "device-attention",
87540
+ family: "device-events",
87541
+ label: "Needs attention",
87542
+ kinds: ["device-attention-required", "device-attention-resolved"]
87543
+ },
87482
87544
  {
87483
87545
  id: "nodes",
87484
87546
  family: "system",
@@ -87660,6 +87722,7 @@ var ALERT_EPISODE = [
87660
87722
  "alert-error",
87661
87723
  "alert-critical-resolved"
87662
87724
  ];
87725
+ var DEVICE_ATTENTION = ["device-attention-required", "device-attention-resolved"];
87663
87726
  var UPDATES = [
87664
87727
  "addon-update-available",
87665
87728
  "server-update-available",
@@ -87689,9 +87752,12 @@ var DEVICE_EVENTS = [
87689
87752
  "stream-online",
87690
87753
  "stream-offline",
87691
87754
  "detection-blind",
87755
+ "motion-noisy",
87756
+ "motion-calm",
87692
87757
  "recording-stalled",
87693
87758
  "recording-healthy",
87694
87759
  "recording-degraded",
87760
+ ...DEVICE_ATTENTION,
87695
87761
  ...ALARM
87696
87762
  ];
87697
87763
  /** Every kind a summary may speak about — the two summarisable families. */
@@ -87859,7 +87925,9 @@ var STATE_SUMMARY_VARS = [
87859
87925
  [...RULE_TEXT],
87860
87926
  [...RULE_TEXT],
87861
87927
  [...RULE_TEXT],
87862
- ([...RULE_TEXT], [...ALERT_EPISODE]),
87928
+ [...RULE_TEXT],
87929
+ [...RULE_TEXT],
87930
+ ([...RULE_TEXT], [...DEVICE_ATTENTION, ...ALERT_EPISODE]),
87863
87931
  [...RULE_TEXT],
87864
87932
  [...RULE_TEXT],
87865
87933
  [...RULE_TEXT],
@@ -87881,11 +87949,11 @@ var STATE_SUMMARY_VARS = [
87881
87949
  [...RULE_TEXT],
87882
87950
  [...RULE_TEXT],
87883
87951
  [...RULE_TEXT],
87952
+ ([...RULE_TEXT], [...DEVICE_ATTENTION, ...ALERT_EPISODE]),
87884
87953
  ([...RULE_TEXT], [...ALERT_EPISODE]),
87954
+ ([...RULE_TEXT], [...DEVICE_ATTENTION, ...ALERT_EPISODE]),
87885
87955
  ([...RULE_TEXT], [...ALERT_EPISODE]),
87886
- ([...RULE_TEXT], [...ALERT_EPISODE]),
87887
- ([...RULE_TEXT], [...ALERT_EPISODE]),
87888
- ([...RULE_TEXT], [...ALERT_EPISODE]),
87956
+ ([...RULE_TEXT], [...DEVICE_ATTENTION, ...ALERT_EPISODE]),
87889
87957
  [...RULE_TEXT],
87890
87958
  [...RULE_TEXT],
87891
87959
  [...RULE_TEXT],
@@ -87961,6 +88029,15 @@ new Map([
87961
88029
  snapshotLabel: "Tanks low or full now",
87962
88030
  snapshotSection: "tanks"
87963
88031
  },
88032
+ {
88033
+ id: "motion-noise",
88034
+ family: "device-events",
88035
+ label: "Motion without a subject (constant / calm again)",
88036
+ bad: ["motion-noisy"],
88037
+ recovery: ["motion-calm"],
88038
+ snapshotLabel: "Cameras with constant motion now",
88039
+ snapshotSection: null
88040
+ },
87964
88041
  {
87965
88042
  id: "recording-health",
87966
88043
  family: "device-events",
@@ -87970,6 +88047,15 @@ new Map([
87970
88047
  snapshotLabel: "Recordings stalled now",
87971
88048
  snapshotSection: null
87972
88049
  },
88050
+ {
88051
+ id: "device-attention",
88052
+ family: "device-events",
88053
+ label: "Device needs attention (raised / resolved)",
88054
+ bad: ["device-attention-required"],
88055
+ recovery: ["device-attention-resolved"],
88056
+ snapshotLabel: "Devices needing attention now",
88057
+ snapshotSection: null
88058
+ },
87973
88059
  {
87974
88060
  id: "node-connectivity",
87975
88061
  family: "system",
@@ -88945,12 +89031,6 @@ Object.defineProperty(exports, "AlertSchema", {
88945
89031
  return AlertSchema;
88946
89032
  }
88947
89033
  });
88948
- Object.defineProperty(exports, "ApiKeyRecordSchema", {
88949
- enumerable: true,
88950
- get: function() {
88951
- return ApiKeyRecordSchema;
88952
- }
88953
- });
88954
89034
  Object.defineProperty(exports, "BaseAddon", {
88955
89035
  enumerable: true,
88956
89036
  get: function() {
@@ -89521,12 +89601,24 @@ Object.defineProperty(exports, "StorageMigrationJobSchema", {
89521
89601
  return StorageMigrationJobSchema;
89522
89602
  }
89523
89603
  });
89604
+ Object.defineProperty(exports, "StoredRecordKindDeclarationSchema", {
89605
+ enumerable: true,
89606
+ get: function() {
89607
+ return StoredRecordKindDeclarationSchema;
89608
+ }
89609
+ });
89524
89610
  Object.defineProperty(exports, "TokenScopeSchema", {
89525
89611
  enumerable: true,
89526
89612
  get: function() {
89527
89613
  return TokenScopeSchema;
89528
89614
  }
89529
89615
  });
89616
+ Object.defineProperty(exports, "TransactRefusedError", {
89617
+ enumerable: true,
89618
+ get: function() {
89619
+ return TransactRefusedError;
89620
+ }
89621
+ });
89530
89622
  Object.defineProperty(exports, "UNATTRIBUTED_BUCKET_KEY", {
89531
89623
  enumerable: true,
89532
89624
  get: function() {
@@ -89617,6 +89709,12 @@ Object.defineProperty(exports, "asString", {
89617
89709
  return asString$1;
89618
89710
  }
89619
89711
  });
89712
+ Object.defineProperty(exports, "assertTransactScope", {
89713
+ enumerable: true,
89714
+ get: function() {
89715
+ return assertTransactScope;
89716
+ }
89717
+ });
89620
89718
  Object.defineProperty(exports, "assertValidDeclaration", {
89621
89719
  enumerable: true,
89622
89720
  get: function() {
@@ -1,5 +1,5 @@
1
1
  require("./chunk-Cek0wNdY.js");
2
- const require_wal_maintenance = require("./wal-maintenance-BQlvAduo.js");
2
+ const require_wal_maintenance = require("./wal-maintenance-B6LSQ_OZ.js");
3
3
  let node_worker_threads = require("node:worker_threads");
4
4
  //#region src/builtins/sqlite-storage/file-host-worker.ts
5
5
  /**
@@ -1,4 +1,4 @@
1
- import { C as RecordsEngine, D as callVector, E as callRecords, O as controlTargetOf, T as callData, _ as collectTransferables, a as WalMaintenance, b as isFileHostWorkerData, h as serializeError, l as SqliteSettingsBackend, o as createVectorIndex, s as vectorProviderOf, w as callControl, x as trustInput, y as isFileHostRequest } from "./wal-maintenance-BDQT7TIi.mjs";
1
+ import { C as RecordsEngine, D as callVector, E as callRecords, O as controlTargetOf, T as callData, _ as collectTransferables, a as WalMaintenance, b as isFileHostWorkerData, h as serializeError, l as SqliteSettingsBackend, o as createVectorIndex, s as vectorProviderOf, w as callControl, x as trustInput, y as isFileHostRequest } from "./wal-maintenance-BXYwFecW.mjs";
2
2
  import { parentPort, threadId, workerData } from "node:worker_threads";
3
3
  //#region src/builtins/sqlite-storage/file-host-worker.ts
4
4
  /**
@@ -1,7 +1,7 @@
1
1
  import { o as __toESM } from "./chunk-CNf5ZN-e.mjs";
2
- import { xa as userError } from "./dist-CR7idLer.mjs";
2
+ import { Ca as userError } from "./dist-BpUtAgqR.mjs";
3
3
  import { f as X509Certificate$1 } from "./x509.es-DK__ETIe.mjs";
4
- import { D as reasonRequiresNewCa, E as evaluateExistingCert, F as readNameConstraints, N as permitsIdentity, _ as issueLeaf, b as collectCertIdentity, g as generateCa, j as isConstrainedCa, v as loadCa, y as localCaCommonName } from "./agent-https-CPJ7FTs0.mjs";
4
+ import { D as reasonRequiresNewCa, E as evaluateExistingCert, F as readNameConstraints, N as permitsIdentity, _ as issueLeaf, b as collectCertIdentity, g as generateCa, j as isConstrainedCa, v as loadCa, y as localCaCommonName } from "./agent-https-DR1wmhYY.mjs";
5
5
  import { X509Certificate, createPrivateKey } from "node:crypto";
6
6
  import { writeOwnerOnlyFileSync } from "@camstack/types/node";
7
7
  import { mkdir, writeFile } from "node:fs/promises";
@@ -1,7 +1,7 @@
1
1
  const require_chunk = require("./chunk-Cek0wNdY.js");
2
- const require_dist = require("./dist-Dwi4JA96.js");
2
+ const require_dist = require("./dist-l6zKmHEb.js");
3
3
  const require_x509_es = require("./x509.es-C4cOo48M.js");
4
- const require_agent_https = require("./agent-https-CzA1AmyI.js");
4
+ const require_agent_https = require("./agent-https-DJ8OzQOr.js");
5
5
  let node_crypto = require("node:crypto");
6
6
  let _camstack_types_node = require("@camstack/types/node");
7
7
  let node_fs_promises = require("node:fs/promises");
package/dist/index.d.ts CHANGED
@@ -4,8 +4,6 @@ export { buildBinaryPath, downloadBinary, ensureBinary, ensureFfmpeg, ensurePyth
4
4
  export type { DirectCallerOptions } from "./addon/addon-api-factory.js";
5
5
  export { AddonApiFactory } from "./addon/addon-api-factory.js";
6
6
  export { AddonRouteRegistry } from "./addon-routes/addon-route-registry.js";
7
- export type { ApiKeyRecord, ApiKeyStorageAccess } from "./auth/api-key-manager.js";
8
- export { ApiKeyManager } from "./auth/api-key-manager.js";
9
7
  export type { AuthConfigReader, ReauthClaims, TokenPayload } from "./auth/auth-manager.js";
10
8
  export { AuthManager } from "./auth/auth-manager.js";
11
9
  export { scopesAllowAddon, scopesAllowDeviceCap } from "./auth/scope-matcher.js";
package/dist/index.js CHANGED
@@ -1,8 +1,8 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
2
  const require_chunk = require("./chunk-Cek0wNdY.js");
3
- const require_dist = require("./dist-Dwi4JA96.js");
3
+ const require_dist = require("./dist-l6zKmHEb.js");
4
+ const require_device_ca = require("./device-ca-CGcaSheI.js");
4
5
  const require_read_all_rows$1 = require("./read-all-rows-CVoO1ONM.js");
5
- const require_device_ca = require("./device-ca-B-Txwl4W.js");
6
6
  const require_builtins_alerts_alerts_addon = require("./builtins/alerts/alerts.addon.js");
7
7
  require("./builtins/alerts/index.js");
8
8
  const require_builtins_calendars_calendars_addon = require("./builtins/calendars/calendars.addon.js");
@@ -26,21 +26,21 @@ const require_builtins_loki_logging_index = require("./builtins/loki-logging/ind
26
26
  const require_builtins_native_metrics_native_metrics_addon = require("./builtins/native-metrics/native-metrics.addon.js");
27
27
  const require_builtins_device_history_device_history_addon = require("./builtins/device-history/device-history.addon.js");
28
28
  const require_builtins_sqlite_storage_filesystem_storage_addon = require("./builtins/sqlite-storage/filesystem-storage.addon.js");
29
- const require_wal_maintenance = require("./wal-maintenance-BQlvAduo.js");
29
+ const require_wal_maintenance = require("./wal-maintenance-B6LSQ_OZ.js");
30
30
  const require_builtins_sqlite_storage_sqlite_settings_addon = require("./builtins/sqlite-storage/sqlite-settings.addon.js");
31
31
  const require_builtins_sqlite_storage_index = require("./builtins/sqlite-storage/index.js");
32
32
  const require_builtins_storage_orchestrator_storage_orchestrator_addon = require("./builtins/storage-orchestrator/storage-orchestrator.addon.js");
33
33
  require("./builtins/storage-orchestrator/index.js");
34
- const require_agent_https = require("./agent-https-CzA1AmyI.js");
35
- const require_constants = require("./constants-BYJ4ni7h.js");
34
+ const require_agent_https = require("./agent-https-DJ8OzQOr.js");
35
+ const require_constants = require("./constants-CuO3rcw4.js");
36
36
  const require_builtins_system_config_system_config_addon = require("./builtins/system-config/system-config.addon.js");
37
37
  require("./builtins/system-config/index.js");
38
38
  const require_builtins_winston_logging_index = require("./builtins/winston-logging/index.js");
39
39
  const require_custom_action_registry = require("./custom-action-registry-MRyes5j0.js");
40
- const require_hub_mdns_ciao = require("./hub-mdns-ciao-3qdHbtyp.js");
40
+ const require_hub_mdns_ciao = require("./hub-mdns-ciao-CIno_SNn.js");
41
41
  const require_platform_key_source = require("./platform-key-source-Di7HrlGR.js");
42
42
  const require_resource_monitor = require("./resource-monitor-mio9dSCT.js");
43
- const require_restore_archive = require("./restore-archive-D1uxP8Eb.js");
43
+ const require_restore_archive = require("./restore-archive-B71JI-sP.js");
44
44
  const require_coral_accelerators = require("./coral-accelerators-oUXmmbc2.js");
45
45
  let zod = require("zod");
46
46
  let node_crypto = require("node:crypto");
@@ -15951,6 +15951,7 @@ function recordsTransportOf(api) {
15951
15951
  histogram: (input) => r.histogram.query(input),
15952
15952
  aggregate: (input) => r.aggregate.query(input),
15953
15953
  deleteWhere: (input) => r.deleteWhere.mutate(input),
15954
+ transact: (input) => r.transact.mutate(input),
15954
15955
  deleteDevice: (input) => r.deleteDevice.mutate(input),
15955
15956
  allocateId: (input) => r.allocateId.mutate(input)
15956
15957
  };
@@ -27572,7 +27573,6 @@ exports.AgentMdnsAdvertiser = AgentMdnsAdvertiser;
27572
27573
  exports.AgentMeshIdentityGate = AgentMeshIdentityGate;
27573
27574
  exports.AgentPairing = require_builtins_system_config_system_config_addon.AgentPairing;
27574
27575
  exports.AlertCenterAddon = require_builtins_alerts_alerts_addon.AlertCenterAddon;
27575
- exports.ApiKeyManager = require_builtins_local_auth_local_auth_addon.ApiKeyManager;
27576
27576
  exports.AuthAuditLog = require_builtins_local_auth_local_auth_addon.AuthAuditLog;
27577
27577
  exports.AuthManager = require_builtins_local_auth_local_auth_addon.AuthManager;
27578
27578
  exports.BackupDecryptError = require_restore_archive.BackupDecryptError;