@camstack/server 1.2.808 → 1.2.810

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 (87) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/package.json +42 -7
  3. package/system/dist/{agent-https-DS4b0ucn.mjs → agent-https-B5cYxyQW.mjs} +1 -1
  4. package/system/dist/{agent-https-CuChFRA2.js → agent-https-C0QE8tXs.js} +1 -1
  5. package/system/dist/builtins/addon-pages-aggregator/addon-pages-aggregator.addon.js +1 -1
  6. package/system/dist/builtins/addon-pages-aggregator/addon-pages-aggregator.addon.mjs +1 -1
  7. package/system/dist/builtins/addon-widgets-aggregator/addon-widgets-aggregator.addon.js +1 -1
  8. package/system/dist/builtins/addon-widgets-aggregator/addon-widgets-aggregator.addon.mjs +1 -1
  9. package/system/dist/builtins/alerts/alerts.addon.js +1 -1
  10. package/system/dist/builtins/alerts/alerts.addon.mjs +1 -1
  11. package/system/dist/builtins/autotrack/index.js +1 -1
  12. package/system/dist/builtins/autotrack/index.mjs +1 -1
  13. package/system/dist/builtins/backup-orchestrator/backup-orchestrator.addon.js +2 -2
  14. package/system/dist/builtins/backup-orchestrator/backup-orchestrator.addon.mjs +2 -2
  15. package/system/dist/builtins/backup-orchestrator/destination-policy.d.ts +1 -1
  16. package/system/dist/builtins/calendars/calendars.addon.js +1 -1
  17. package/system/dist/builtins/calendars/calendars.addon.mjs +1 -1
  18. package/system/dist/builtins/camera-grid/index.js +1 -1
  19. package/system/dist/builtins/camera-grid/index.mjs +1 -1
  20. package/system/dist/builtins/composer/composer.addon.js +3 -3
  21. package/system/dist/builtins/composer/composer.addon.mjs +3 -3
  22. package/system/dist/builtins/console-logging/index.js +1 -1
  23. package/system/dist/builtins/console-logging/index.mjs +1 -1
  24. package/system/dist/builtins/core-blocks/core-blocks.addon.js +3 -3
  25. package/system/dist/builtins/core-blocks/core-blocks.addon.mjs +3 -3
  26. package/system/dist/builtins/device-history/device-history.addon.js +2 -2
  27. package/system/dist/builtins/device-history/device-history.addon.mjs +2 -2
  28. package/system/dist/builtins/device-manager/device-manager.addon.js +1 -1
  29. package/system/dist/builtins/device-manager/device-manager.addon.mjs +1 -1
  30. package/system/dist/builtins/hub-forwarder/index.js +1 -1
  31. package/system/dist/builtins/hub-forwarder/index.mjs +1 -1
  32. package/system/dist/builtins/keychain/index.js +4 -4
  33. package/system/dist/builtins/keychain/index.mjs +4 -4
  34. package/system/dist/builtins/liveness-monitor/liveness-monitor.addon.js +1 -1
  35. package/system/dist/builtins/liveness-monitor/liveness-monitor.addon.mjs +1 -1
  36. package/system/dist/builtins/local-auth/local-auth.addon.js +2 -2
  37. package/system/dist/builtins/local-auth/local-auth.addon.mjs +2 -2
  38. package/system/dist/builtins/local-network/local-network.addon.js +2 -2
  39. package/system/dist/builtins/local-network/local-network.addon.mjs +2 -2
  40. package/system/dist/builtins/loki-logging/index.js +8 -2
  41. package/system/dist/builtins/loki-logging/index.mjs +8 -2
  42. package/system/dist/builtins/native-metrics/native-metrics.addon.js +1 -1
  43. package/system/dist/builtins/native-metrics/native-metrics.addon.mjs +1 -1
  44. package/system/dist/builtins/platform-probe/index.js +1 -1
  45. package/system/dist/builtins/platform-probe/index.mjs +1 -1
  46. package/system/dist/builtins/record-entries/index.js +1 -1
  47. package/system/dist/builtins/record-entries/index.mjs +1 -1
  48. package/system/dist/builtins/remote-access-orchestrator/remote-access-orchestrator.addon.js +1 -1
  49. package/system/dist/builtins/remote-access-orchestrator/remote-access-orchestrator.addon.mjs +1 -1
  50. package/system/dist/builtins/snapshot/index.js +1 -1
  51. package/system/dist/builtins/snapshot/index.mjs +1 -1
  52. package/system/dist/builtins/sqlite-storage/filesystem-storage.addon.js +1 -1
  53. package/system/dist/builtins/sqlite-storage/filesystem-storage.addon.mjs +1 -1
  54. package/system/dist/builtins/sqlite-storage/index.js +1 -1
  55. package/system/dist/builtins/sqlite-storage/index.mjs +1 -1
  56. package/system/dist/builtins/sqlite-storage/sqlite-settings.addon.js +3 -3
  57. package/system/dist/builtins/sqlite-storage/sqlite-settings.addon.mjs +3 -3
  58. package/system/dist/builtins/storage-orchestrator/location-store.d.ts +0 -6
  59. package/system/dist/builtins/storage-orchestrator/storage-orchestrator.addon.js +1 -1
  60. package/system/dist/builtins/storage-orchestrator/storage-orchestrator.addon.mjs +1 -1
  61. package/system/dist/builtins/system-config/system-config.addon.js +3 -3
  62. package/system/dist/builtins/system-config/system-config.addon.mjs +3 -3
  63. package/system/dist/builtins/winston-logging/index.js +1 -1
  64. package/system/dist/builtins/winston-logging/index.mjs +1 -1
  65. package/system/dist/{capture-engine-CnVIcnyN.mjs → capture-engine-Ci4GwgjQ.mjs} +1 -1
  66. package/system/dist/{capture-engine-Byc5Fkp0.js → capture-engine-DHvJXvuV.js} +1 -1
  67. package/system/dist/{composition-sources-BxK6ttP9.js → composition-sources-B-WY9L7z.js} +1 -1
  68. package/system/dist/{composition-sources-BhM6G9QT.mjs → composition-sources-CXJ0SzYJ.mjs} +1 -1
  69. package/system/dist/{constants-Bf1PEHRU.mjs → constants-DAuOjW5K.mjs} +1 -1
  70. package/system/dist/{constants--xo6Q-KA.js → constants-DnJ2vuC7.js} +1 -1
  71. package/system/dist/{device-ca-Uq5KGFSq.js → device-ca-BRpXm-B0.js} +1 -1
  72. package/system/dist/{device-ca-Do0-HV_h.mjs → device-ca-D0HejZGK.mjs} +1 -1
  73. package/system/dist/{dist-CogtCQxu.mjs → dist-BLxWQm_m.mjs} +56 -10
  74. package/system/dist/{dist-2SHQaxaS.js → dist-DZQowBDF.js} +56 -10
  75. package/system/dist/file-host-worker.js +1 -1
  76. package/system/dist/file-host-worker.mjs +1 -1
  77. package/system/dist/{hub-mdns-ciao-aFHCKrif.mjs → hub-mdns-ciao-BJx5WmFx.mjs} +2 -2
  78. package/system/dist/{hub-mdns-ciao-DqPrLiYH.js → hub-mdns-ciao-ClSuN_QT.js} +2 -2
  79. package/system/dist/index.js +8 -8
  80. package/system/dist/index.mjs +8 -8
  81. package/system/dist/{legacy-integration-rows-door-Bz8rivxI.js → legacy-integration-rows-door-BiNKE2zW.js} +1 -1
  82. package/system/dist/{legacy-integration-rows-door-CiuxDLoc.mjs → legacy-integration-rows-door-CN84_M7B.mjs} +1 -1
  83. package/system/dist/{restore-archive-D-3wmHDq.js → restore-archive-Co1yYMV3.js} +1 -1
  84. package/system/dist/{restore-archive-D_191hoC.mjs → restore-archive-gLW5oc1w.mjs} +1 -1
  85. package/system/dist/{wal-maintenance-BTR55y--.js → wal-maintenance-BQaIM_cY.js} +0 -0
  86. package/system/dist/{wal-maintenance-jrhYTCn2.mjs → wal-maintenance-Zji_8sLK.mjs} +0 -0
  87. package/system/package.json +1 -1
@@ -1,5 +1,5 @@
1
1
  import { o as __toESM, r as __exportAll } from "../../chunk-CNf5ZN-e.mjs";
2
- import { Ic as EventCategory, Ki as platformProbeCapability, Ko as BaseAddon, Pc as errMsg, Sr as enumerateInferenceDevices, Ta as scoreRuntimes, Ws as emitReadiness, zi as parseAcceleratorFactsJson } from "../../dist-CogtCQxu.mjs";
2
+ import { Ic as EventCategory, Ki as platformProbeCapability, Ko as BaseAddon, Pc as errMsg, Sr as enumerateInferenceDevices, Ta as scoreRuntimes, Ws as emitReadiness, zi as parseAcceleratorFactsJson } from "../../dist-BLxWQm_m.mjs";
3
3
  import { n as detectCoralAccelerator, r as nodeCoralFs } from "../../coral-accelerators-DBlgWB8k.mjs";
4
4
  import * as fs$1 from "node:fs";
5
5
  import * as path$1 from "node:path";
@@ -3,7 +3,7 @@ Object.defineProperties(exports, {
3
3
  [Symbol.toStringTag]: { value: "Module" }
4
4
  });
5
5
  require("../../chunk-Cek0wNdY.js");
6
- const require_dist = require("../../dist-2SHQaxaS.js");
6
+ const require_dist = require("../../dist-DZQowBDF.js");
7
7
  let zod = require("zod");
8
8
  let node_crypto = require("node:crypto");
9
9
  //#region src/builtins/record-entries/entries-service.ts
@@ -1,4 +1,4 @@
1
- import { Ko as BaseAddon, Ts as UnknownRecordKindError, ns as InvalidRecordError, ta as recordEntriesCapability, wc as secretViewsOf } from "../../dist-CogtCQxu.mjs";
1
+ import { Ko as BaseAddon, Ts as UnknownRecordKindError, ns as InvalidRecordError, ta as recordEntriesCapability, wc as secretViewsOf } from "../../dist-BLxWQm_m.mjs";
2
2
  import { z } from "zod";
3
3
  import { randomUUID } from "node:crypto";
4
4
  //#region src/builtins/record-entries/entries-service.ts
@@ -3,7 +3,7 @@ Object.defineProperties(exports, {
3
3
  [Symbol.toStringTag]: { value: "Module" }
4
4
  });
5
5
  require("../../chunk-Cek0wNdY.js");
6
- const require_dist = require("../../dist-2SHQaxaS.js");
6
+ const require_dist = require("../../dist-DZQowBDF.js");
7
7
  let zod = require("zod");
8
8
  //#region src/builtins/remote-access-orchestrator/enabled-providers-reconcile.ts
9
9
  /**
@@ -1,4 +1,4 @@
1
- import { Ic as EventCategory, Ko as BaseAddon } from "../../dist-CogtCQxu.mjs";
1
+ import { Ic as EventCategory, Ko as BaseAddon } from "../../dist-BLxWQm_m.mjs";
2
2
  import { z } from "zod";
3
3
  //#region src/builtins/remote-access-orchestrator/enabled-providers-reconcile.ts
4
4
  /**
@@ -3,7 +3,7 @@ Object.defineProperties(exports, {
3
3
  [Symbol.toStringTag]: { value: "Module" }
4
4
  });
5
5
  const require_chunk = require("../../chunk-Cek0wNdY.js");
6
- const require_dist = require("../../dist-2SHQaxaS.js");
6
+ const require_dist = require("../../dist-DZQowBDF.js");
7
7
  const require_snapshot_courtesy = require("../../snapshot-courtesy-D_C5-nC0.js");
8
8
  let zod = require("zod");
9
9
  let node_crypto = require("node:crypto");
@@ -1,4 +1,4 @@
1
- import { En as batteryCapability, Ha as streamQualityLabel, Ic as EventCategory, Ko as BaseAddon, Na as snapshotCapability, Nc as DeviceType, Pc as errMsg, Si as memoizePinnedFfmpeg, Tn as bareAddonId, dc as nodePin, dr as deriveBatteryPresence, g as BatteryStatusSchema, jc as DeviceFeature } from "../../dist-CogtCQxu.mjs";
1
+ import { En as batteryCapability, Ha as streamQualityLabel, Ic as EventCategory, Ko as BaseAddon, Na as snapshotCapability, Nc as DeviceType, Pc as errMsg, Si as memoizePinnedFfmpeg, Tn as bareAddonId, dc as nodePin, dr as deriveBatteryPresence, g as BatteryStatusSchema, jc as DeviceFeature } from "../../dist-BLxWQm_m.mjs";
2
2
  import { i as renderCourtesyOverlayJpeg, n as courtesyCacheKey, r as renderCourtesyJpeg } from "../../snapshot-courtesy-CyFs1M3I.mjs";
3
3
  import { z } from "zod";
4
4
  import { randomUUID } from "node:crypto";
@@ -3,7 +3,7 @@ Object.defineProperties(exports, {
3
3
  [Symbol.toStringTag]: { value: "Module" }
4
4
  });
5
5
  const require_chunk = require("../../chunk-Cek0wNdY.js");
6
- const require_dist = require("../../dist-2SHQaxaS.js");
6
+ const require_dist = require("../../dist-DZQowBDF.js");
7
7
  let node_crypto = require("node:crypto");
8
8
  let node_fs = require("node:fs");
9
9
  node_fs = require_chunk.__toESM(node_fs);
@@ -1,4 +1,4 @@
1
- import { Ba as storageProviderCapability, Fr as filesystemBrowseCapability, Ko as BaseAddon } from "../../dist-CogtCQxu.mjs";
1
+ import { Ba as storageProviderCapability, Fr as filesystemBrowseCapability, Ko as BaseAddon } from "../../dist-BLxWQm_m.mjs";
2
2
  import { randomUUID } from "node:crypto";
3
3
  import * as fs$1 from "node:fs";
4
4
  import * as path$1 from "node:path";
@@ -4,7 +4,7 @@ Object.defineProperties(exports, {
4
4
  });
5
5
  require("../../chunk-Cek0wNdY.js");
6
6
  const require_builtins_sqlite_storage_filesystem_storage_addon = require("./filesystem-storage.addon.js");
7
- const require_wal_maintenance = require("../../wal-maintenance-BTR55y--.js");
7
+ const require_wal_maintenance = require("../../wal-maintenance-BQaIM_cY.js");
8
8
  const require_builtins_sqlite_storage_sqlite_settings_addon = require("./sqlite-settings.addon.js");
9
9
  //#region src/builtins/sqlite-storage/config-store.ts
10
10
  var ConfigStore = class {
@@ -1,5 +1,5 @@
1
1
  import { FilesystemStorageAddon, t as FilesystemStorageProvider } from "./filesystem-storage.addon.mjs";
2
- import { B as SQLITE_ENGINE_STORM_WALL_SHARE, F as SQLITE_MMAP_FLOOR_BYTES, G as SqliteOpProfiler, H as SQLITE_PROFILE_REPORT_INTERVAL_MS, I as SQLITE_PAGE_CACHE_CEILING_KIB, K as sqliteEngineStorm, L as SQLITE_PAGE_CACHE_FLOOR_KIB, N as SQLITE_JOURNAL_SIZE_LIMIT_BYTES, P as SQLITE_MMAP_CEILING_BYTES, R as sqliteMmapSizeFor, U as SQLITE_PROFILE_TOP_N, V as SQLITE_PROFILE_REPORT_FLOOR_MS, W as SQLITE_SLOW_CALL_MS, a as WalMaintenance, i as WAL_MAINTENANCE_INTERVAL_MS, l as SqliteSettingsBackend, n as WAL_HIGH_WATER_BYTES, r as WAL_IDLE_QUIET_MS, t as WAL_CHECKPOINT_BUSY_TIMEOUT_MS, z as sqlitePageCacheKibFor } from "../../wal-maintenance-jrhYTCn2.mjs";
2
+ import { B as SQLITE_ENGINE_STORM_WALL_SHARE, F as SQLITE_MMAP_FLOOR_BYTES, G as SqliteOpProfiler, H as SQLITE_PROFILE_REPORT_INTERVAL_MS, I as SQLITE_PAGE_CACHE_CEILING_KIB, K as sqliteEngineStorm, L as SQLITE_PAGE_CACHE_FLOOR_KIB, N as SQLITE_JOURNAL_SIZE_LIMIT_BYTES, P as SQLITE_MMAP_CEILING_BYTES, R as sqliteMmapSizeFor, U as SQLITE_PROFILE_TOP_N, V as SQLITE_PROFILE_REPORT_FLOOR_MS, W as SQLITE_SLOW_CALL_MS, a as WalMaintenance, i as WAL_MAINTENANCE_INTERVAL_MS, l as SqliteSettingsBackend, n as WAL_HIGH_WATER_BYTES, r as WAL_IDLE_QUIET_MS, t as WAL_CHECKPOINT_BUSY_TIMEOUT_MS, z as sqlitePageCacheKibFor } from "../../wal-maintenance-Zji_8sLK.mjs";
3
3
  import { SqliteSettingsAddon } from "./sqlite-settings.addon.mjs";
4
4
  //#region src/builtins/sqlite-storage/config-store.ts
5
5
  var ConfigStore = class {
@@ -3,12 +3,12 @@ Object.defineProperties(exports, {
3
3
  [Symbol.toStringTag]: { value: "Module" }
4
4
  });
5
5
  const require_chunk = require("../../chunk-Cek0wNdY.js");
6
- const require_dist = require("../../dist-2SHQaxaS.js");
6
+ const require_dist = require("../../dist-DZQowBDF.js");
7
7
  const require_retired_settings_keys = require("../../retired-settings-keys-C8nOOr5H.js");
8
- const require_wal_maintenance = require("../../wal-maintenance-BTR55y--.js");
8
+ const require_wal_maintenance = require("../../wal-maintenance-BQaIM_cY.js");
9
9
  const require_sqlite_snapshot_protocol = require("../../sqlite-snapshot-protocol-B9OndqZv.js");
10
10
  const require_wal_checkpoint_policy = require("../../wal-checkpoint-policy-d2z2qPqx.js");
11
- const require_legacy_integration_rows_door = require("../../legacy-integration-rows-door-Bz8rivxI.js");
11
+ const require_legacy_integration_rows_door = require("../../legacy-integration-rows-door-BiNKE2zW.js");
12
12
  let zod = require("zod");
13
13
  let node_crypto = require("node:crypto");
14
14
  let node_fs = require("node:fs");
@@ -1,9 +1,9 @@
1
- import { Bs as defineCustomActions, Cs as TransactRefusedError, Ct as MIGRATION_API_V1_METHODS, F as DATABASE_SNAPSHOT_TIMEOUT_MS, Fs as collectSecretMarkerRefs, I as DATA_STORE_DATABASES, Ia as storageAdminCapability, Ic as EventCategory, Ko as BaseAddon, Ln as catalogueIssues, N as DATABASE_SNAPSHOT_PARTIAL_SUFFIX, Ot as MigrationMetaSchema, P as DATABASE_SNAPSHOT_SUFFIX, Pc as errMsg$1, Qo as DeclarationRefusedError, Ri as orderMigrations, Rs as customAction, Ti as migrationsCapability, Tn as bareAddonId, Ts as UnknownRecordKindError, _a as resolveRunnerId, ar as dataStoreProviderCapability, fs as RUNTIME_DEFAULTS, gs as RecordKindDeclarationSchema, ls as RECORD_SWEEP_INTERVAL_MS, na as recordsCapability, ns as InvalidRecordError, oo as vectorStoreCapability, or as databaseSnapshotCapability, pc as normalizeSecretOwner, rs as NoCallerError } from "../../dist-CogtCQxu.mjs";
1
+ import { Bs as defineCustomActions, Cs as TransactRefusedError, Ct as MIGRATION_API_V1_METHODS, F as DATABASE_SNAPSHOT_TIMEOUT_MS, Fs as collectSecretMarkerRefs, I as DATA_STORE_DATABASES, Ia as storageAdminCapability, Ic as EventCategory, Ko as BaseAddon, Ln as catalogueIssues, N as DATABASE_SNAPSHOT_PARTIAL_SUFFIX, Ot as MigrationMetaSchema, P as DATABASE_SNAPSHOT_SUFFIX, Pc as errMsg$1, Qo as DeclarationRefusedError, Ri as orderMigrations, Rs as customAction, Ti as migrationsCapability, Tn as bareAddonId, Ts as UnknownRecordKindError, _a as resolveRunnerId, ar as dataStoreProviderCapability, fs as RUNTIME_DEFAULTS, gs as RecordKindDeclarationSchema, ls as RECORD_SWEEP_INTERVAL_MS, na as recordsCapability, ns as InvalidRecordError, oo as vectorStoreCapability, or as databaseSnapshotCapability, pc as normalizeSecretOwner, rs as NoCallerError } from "../../dist-BLxWQm_m.mjs";
2
2
  import { r as retiredKeyStoreOf, t as purgeRetiredSettingsKeys } from "../../retired-settings-keys-u6xQA6r7.mjs";
3
- import { A as callRecords, D as RecordsEngine, E as databaseOfStore, M as controlTargetOf, O as callControl, T as trustResult, _ as rehydrateError, a as WalMaintenance, b as collectTransferables, c as vectorProviderOfOwnedFile, d as callMigrate, f as migrateTargetOf, g as DuplicatePlacementError, h as DatabaseBusyError, j as callVector, k as callData, l as SqliteSettingsBackend, m as CrossDatabaseTransactError, o as createVectorIndex, p as CollectionPlacementError, s as vectorProviderOf, u as HUB_MIGRATIONS, x as isFileHostMessage } from "../../wal-maintenance-jrhYTCn2.mjs";
3
+ import { A as callRecords, D as RecordsEngine, E as databaseOfStore, M as controlTargetOf, O as callControl, T as trustResult, _ as rehydrateError, a as WalMaintenance, b as collectTransferables, c as vectorProviderOfOwnedFile, d as callMigrate, f as migrateTargetOf, g as DuplicatePlacementError, h as DatabaseBusyError, j as callVector, k as callData, l as SqliteSettingsBackend, m as CrossDatabaseTransactError, o as createVectorIndex, p as CollectionPlacementError, s as vectorProviderOf, u as HUB_MIGRATIONS, x as isFileHostMessage } from "../../wal-maintenance-Zji_8sLK.mjs";
4
4
  import { r as isSnapshotWorkerMessage } from "../../sqlite-snapshot-protocol-2QaTouWV.mjs";
5
5
  import { a as isWorkerMessage, t as WAL_CHECKPOINT_LARGE_PASS_FRAMES } from "../../wal-checkpoint-policy-BahrTtyD.mjs";
6
- import { a as patchLegacyIntegrationRows, i as legacyIntegrationAddonId, n as clearLegacyIntegrationRows, o as readLegacyIntegrationRows, r as deleteLegacyIntegrationRowKeys } from "../../legacy-integration-rows-door-CiuxDLoc.mjs";
6
+ import { a as patchLegacyIntegrationRows, i as legacyIntegrationAddonId, n as clearLegacyIntegrationRows, o as readLegacyIntegrationRows, r as deleteLegacyIntegrationRowKeys } from "../../legacy-integration-rows-door-CN84_M7B.mjs";
7
7
  import { createRequire } from "node:module";
8
8
  import { z } from "zod";
9
9
  import { randomUUID } from "node:crypto";
@@ -47,12 +47,6 @@ export interface ILocationStore {
47
47
  unmarkTypeSeeded?(type: string): Promise<void>;
48
48
  }
49
49
  /**
50
- * The keychain scope collection a storage location's secret fields are filed
51
- * under (`row/storage_locations/<id>`). The table it was named for is gone; the
52
- * string stays because existing secret markers point at it.
53
- */
54
- export declare const STORAGE_LOCATIONS_SECRET_SCOPE = "storage_locations";
55
- /**
56
50
  * Credentials a save carries, by config key, until the store writes the row: a value sets the
57
51
  * credential, `null` removes it. The service persists without waiting (`upsert` is fire and
58
52
  * forget), so the plaintext cannot ride on the location itself; it is staged here, one shot per
@@ -3,7 +3,7 @@ Object.defineProperties(exports, {
3
3
  [Symbol.toStringTag]: { value: "Module" }
4
4
  });
5
5
  const require_chunk = require("../../chunk-Cek0wNdY.js");
6
- const require_dist = require("../../dist-2SHQaxaS.js");
6
+ const require_dist = require("../../dist-DZQowBDF.js");
7
7
  const require_read_all_rows$1 = require("../../read-all-rows-CVoO1ONM.js");
8
8
  let zod = require("zod");
9
9
  let node_crypto = require("node:crypto");
@@ -1,4 +1,4 @@
1
- import { Bs as defineCustomActions, Dc as toSecretFieldView, Di as modeMayWrite, Dr as evictionPolicyOfLocation, Ea as settingsStoreCapability, Ei as modeForSwitch, Ga as switchStateOfMode, Hs as defineRecordKinds, Ic as EventCategory, Jt as STORAGE_LOCATION_MODES, Ko as BaseAddon, La as storageCapability, Ms as buildSecretRef, Ns as collectSecretConfigKeys, Ra as storageMigrationCapability, Rs as customAction, Ur as integrationInstancesCapability, ac as isSecretMarker, bc as resolveSecretMarkers, cc as makeSecretMarker, ci as legacyModeOf, ei as isLocationEnabled, fc as normalizeNodeId, gc as parseSecretRef, ic as isSecretFieldView, in as StorageMigrationJobSchema, nn as StorageLocationModeSchema, pa as resolveLocationMode, rc as isSecretClear, rn as StorageLocationTypeSchema, tn as StorageCleanupJobSchema, uo as withLocationMode, us as REDACTED_SECRET, vc as recordSecretRef, vi as mayReadLocation, xt as LegacyStorageLocationDefaultSchema, yi as mayWriteToLocation, zr as gbToBytes, zs as defineAddonMigrations } from "../../dist-CogtCQxu.mjs";
1
+ import { Bs as defineCustomActions, Dc as toSecretFieldView, Di as modeMayWrite, Dr as evictionPolicyOfLocation, Ea as settingsStoreCapability, Ei as modeForSwitch, Ga as switchStateOfMode, Hs as defineRecordKinds, Ic as EventCategory, Jt as STORAGE_LOCATION_MODES, Ko as BaseAddon, La as storageCapability, Ms as buildSecretRef, Ns as collectSecretConfigKeys, Ra as storageMigrationCapability, Rs as customAction, Ur as integrationInstancesCapability, ac as isSecretMarker, bc as resolveSecretMarkers, cc as makeSecretMarker, ci as legacyModeOf, ei as isLocationEnabled, fc as normalizeNodeId, gc as parseSecretRef, ic as isSecretFieldView, in as StorageMigrationJobSchema, nn as StorageLocationModeSchema, pa as resolveLocationMode, rc as isSecretClear, rn as StorageLocationTypeSchema, tn as StorageCleanupJobSchema, uo as withLocationMode, us as REDACTED_SECRET, vc as recordSecretRef, vi as mayReadLocation, xt as LegacyStorageLocationDefaultSchema, yi as mayWriteToLocation, zr as gbToBytes, zs as defineAddonMigrations } from "../../dist-BLxWQm_m.mjs";
2
2
  import { t as require_read_all_rows } from "../../read-all-rows-TaPqdWNF.mjs";
3
3
  import { z } from "zod";
4
4
  import { randomUUID } from "node:crypto";
@@ -3,11 +3,11 @@ Object.defineProperties(exports, {
3
3
  [Symbol.toStringTag]: { value: "Module" }
4
4
  });
5
5
  const require_chunk = require("../../chunk-Cek0wNdY.js");
6
- const require_dist = require("../../dist-2SHQaxaS.js");
6
+ const require_dist = require("../../dist-DZQowBDF.js");
7
7
  const require_safe_buffer$1 = require("../../safe-buffer-D3aoa-7X.js");
8
8
  const require_x509_es = require("../../x509.es-WtnRNyYS.js");
9
- const require_agent_https = require("../../agent-https-CuChFRA2.js");
10
- const require_constants$8 = require("../../constants--xo6Q-KA.js");
9
+ const require_agent_https = require("../../agent-https-C0QE8tXs.js");
10
+ const require_constants$8 = require("../../constants-DnJ2vuC7.js");
11
11
  const require_src$1 = require("../../src-CnAqG6EF.js");
12
12
  let zod = require("zod");
13
13
  let node_crypto = require("node:crypto");
@@ -1,9 +1,9 @@
1
1
  import { a as __toCommonJS, i as __require, n as __esmMin, o as __toESM, r as __exportAll, t as __commonJSMin } from "../../chunk-CNf5ZN-e.mjs";
2
- import { $t as ServerNameSchema, Aa as shortHostname, Bs as defineCustomActions, Ko as BaseAddon, Pc as errMsg, Rs as customAction, Xs as hydrateSchema } from "../../dist-CogtCQxu.mjs";
2
+ import { $t as ServerNameSchema, Aa as shortHostname, Bs as defineCustomActions, Ko as BaseAddon, Pc as errMsg, Rs as customAction, Xs as hydrateSchema } from "../../dist-BLxWQm_m.mjs";
3
3
  import { t as require_safe_buffer } from "../../safe-buffer-B1OjL1I9.mjs";
4
4
  import { C as backdatedNotBefore, S as withUtcTimeEncoding, a as KeyUsageFlags, c as Pkcs10CertificateRequest, d as SubjectKeyIdentifierExtension, f as X509Certificate$1, l as Pkcs10CertificateRequestGenerator, m as cryptoProvider, n as BasicConstraintsExtension, o as KeyUsagesExtension, p as X509CertificateGenerator, r as ExtendedKeyUsageExtension, s as PemConverter, t as AuthorityKeyIdentifierExtension } from "../../x509.es-BRiJgOvu.mjs";
5
- import { B as setProcessAgentHttpsNames, I as AGENT_HTTPS_NAMES_COLLECTION, L as AGENT_HTTPS_NAMES_COLUMNS, M as isLocalOnlyHostname, R as AgentHttpsNames, V as systemConfigRecordKinds, u as isPrivateAddress, z as getProcessAgentHttpsNames } from "../../agent-https-DS4b0ucn.mjs";
6
- import { a as MESH_CA_KEY_REF, c as SERVER_AUTH_OID, i as MESH_CA_FIELD, n as DEFAULT_HUB_TLS_TCP_PORT, o as MESH_CA_SETTINGS_KEY, r as MESH_CA_COMMON_NAME, s as MESH_CA_VALIDITY_DAYS, t as CLIENT_AUTH_OID } from "../../constants-Bf1PEHRU.mjs";
5
+ import { B as setProcessAgentHttpsNames, I as AGENT_HTTPS_NAMES_COLLECTION, L as AGENT_HTTPS_NAMES_COLUMNS, M as isLocalOnlyHostname, R as AgentHttpsNames, V as systemConfigRecordKinds, u as isPrivateAddress, z as getProcessAgentHttpsNames } from "../../agent-https-B5cYxyQW.mjs";
6
+ import { a as MESH_CA_KEY_REF, c as SERVER_AUTH_OID, i as MESH_CA_FIELD, n as DEFAULT_HUB_TLS_TCP_PORT, o as MESH_CA_SETTINGS_KEY, r as MESH_CA_COMMON_NAME, s as MESH_CA_VALIDITY_DAYS, t as CLIENT_AUTH_OID } from "../../constants-DAuOjW5K.mjs";
7
7
  import { t as require_src } from "../../src-hG4grMU4.mjs";
8
8
  import { z } from "zod";
9
9
  import { X509Certificate, createHash, createPrivateKey, randomBytes, randomInt, sign, timingSafeEqual, verify, webcrypto } from "node:crypto";
@@ -3,7 +3,7 @@ Object.defineProperties(exports, {
3
3
  [Symbol.toStringTag]: { value: "Module" }
4
4
  });
5
5
  const require_chunk = require("../../chunk-Cek0wNdY.js");
6
- const require_dist = require("../../dist-2SHQaxaS.js");
6
+ const require_dist = require("../../dist-DZQowBDF.js");
7
7
  const require_formatter = require("../../formatter-xbxeV4GD.js");
8
8
  const require_log_file_read_protocol = require("../../log-file-read-protocol-DSV_vQRb.js");
9
9
  let node_path = require("node:path");
@@ -1,4 +1,4 @@
1
- import { Ko as BaseAddon, Yi as preconditionOf, hi as logDestinationCapability, zs as defineAddonMigrations } from "../../dist-CogtCQxu.mjs";
1
+ import { Ko as BaseAddon, Yi as preconditionOf, hi as logDestinationCapability, zs as defineAddonMigrations } from "../../dist-BLxWQm_m.mjs";
2
2
  import { t as formatLogLine } from "../../formatter-DkYZ4LXp.mjs";
3
3
  import { a as LogFileIndexStore, i as serveRead, n as isFromReader, t as CancelBook } from "../../log-file-read-protocol-hTaAsYlX.mjs";
4
4
  import { createRequire } from "node:module";
@@ -1,4 +1,4 @@
1
- import { Js as historyItemFieldPath, Nc as DeviceType, ts as HISTORY_DEFAULT_MIN_INTERVAL_MS } from "./dist-CogtCQxu.mjs";
1
+ import { Js as historyItemFieldPath, Nc as DeviceType, ts as HISTORY_DEFAULT_MIN_INTERVAL_MS } from "./dist-BLxWQm_m.mjs";
2
2
  //#region src/builtins/device-history/store/series-registry.ts
3
3
  function subjectIdOf(subject) {
4
4
  return subject.kind === "device" ? `d:${subject.deviceId}` : `n:${subject.nodeId}`;
@@ -1,4 +1,4 @@
1
- const require_dist = require("./dist-2SHQaxaS.js");
1
+ const require_dist = require("./dist-DZQowBDF.js");
2
2
  //#region src/builtins/device-history/store/series-registry.ts
3
3
  function subjectIdOf(subject) {
4
4
  return subject.kind === "device" ? `d:${subject.deviceId}` : `n:${subject.nodeId}`;
@@ -1,4 +1,4 @@
1
- const require_dist = require("./dist-2SHQaxaS.js");
1
+ const require_dist = require("./dist-DZQowBDF.js");
2
2
  //#region src/builtins/shared/device-state-changed.ts
3
3
  /** Structural narrowing helper for untrusted bus payloads. */
4
4
  function isRecord(value) {
@@ -1,4 +1,4 @@
1
- import { Oo as compositionSourceKey, Pc as errMsg } from "./dist-CogtCQxu.mjs";
1
+ import { Oo as compositionSourceKey, Pc as errMsg } from "./dist-BLxWQm_m.mjs";
2
2
  //#region src/builtins/shared/device-state-changed.ts
3
3
  /** Structural narrowing helper for untrusted bus payloads. */
4
4
  function isRecord(value) {
@@ -1,4 +1,4 @@
1
- import { Ms as buildSecretRef } from "./dist-CogtCQxu.mjs";
1
+ import { Ms as buildSecretRef } from "./dist-BLxWQm_m.mjs";
2
2
  /** `secret://system/global/meshCaKey` — EC P-256 PKCS#8 PEM of the hub mesh CA. */
3
3
  var MESH_CA_KEY_REF = buildSecretRef({
4
4
  owner: "system",
@@ -1,5 +1,5 @@
1
1
  /** `secret://system/global/meshCaKey` — EC P-256 PKCS#8 PEM of the hub mesh CA. */
2
- var MESH_CA_KEY_REF = require("./dist-2SHQaxaS.js").buildSecretRef({
2
+ var MESH_CA_KEY_REF = require("./dist-DZQowBDF.js").buildSecretRef({
3
3
  owner: "system",
4
4
  scope: { kind: "global" },
5
5
  fieldPath: "meshCaKey"
@@ -1,4 +1,4 @@
1
- const require_dist = require("./dist-2SHQaxaS.js");
1
+ const require_dist = require("./dist-DZQowBDF.js");
2
2
  const require_x509_es = require("./x509.es-WtnRNyYS.js");
3
3
  let node_crypto = require("node:crypto");
4
4
  //#region src/auth/jwt-signing-key.ts
@@ -1,4 +1,4 @@
1
- import { G as DEVICE_SAN_USER_PREFIX, Ms as buildSecretRef, W as DEVICE_SAN_CREDENTIAL_PREFIX } from "./dist-CogtCQxu.mjs";
1
+ import { G as DEVICE_SAN_USER_PREFIX, Ms as buildSecretRef, W as DEVICE_SAN_CREDENTIAL_PREFIX } from "./dist-BLxWQm_m.mjs";
2
2
  import { C as backdatedNotBefore, S as withUtcTimeEncoding, a as KeyUsageFlags, d as SubjectKeyIdentifierExtension, f as X509Certificate$1, m as cryptoProvider, n as BasicConstraintsExtension, o as KeyUsagesExtension, p as X509CertificateGenerator, r as ExtendedKeyUsageExtension, s as PemConverter, t as AuthorityKeyIdentifierExtension, u as SubjectAlternativeNameExtension } from "./x509.es-BRiJgOvu.mjs";
3
3
  import { X509Certificate, createPublicKey, randomBytes, verify, webcrypto } from "node:crypto";
4
4
  //#region src/auth/jwt-signing-key.ts
@@ -1204,7 +1204,7 @@ var DeviceRole = /* @__PURE__ */ function(DeviceRole) {
1204
1204
  return DeviceRole;
1205
1205
  }({});
1206
1206
  //#endregion
1207
- //#region ../types/dist/sleep-7El4r5Bl.mjs
1207
+ //#region ../types/dist/sleep-CGPZyzB5.mjs
1208
1208
  /**
1209
1209
  * The audio chunk plane's byte format, and the ONE expansion from a coded
1210
1210
  * window to float samples (D455).
@@ -2587,6 +2587,7 @@ var RecordIntegrationInstances = class {
2587
2587
  this.secretKeys = topLevelSecretKeys(kind.declaration.secretPaths);
2588
2588
  this.secretMaps = secretMapKeys(kind.declaration.secretPaths);
2589
2589
  this.nameField = kind.declaration.entry?.nameField ?? "name";
2590
+ if (hooks.kindOf === void 0 && hooks.description.kinds.length !== 1) throw new Error(`record kind '${kind.name}': describe().kinds has ${hooks.description.kinds.length} entries, so kindOf is required to say which one an instance is`);
2590
2591
  }
2591
2592
  /**
2592
2593
  * One instance read for the addon's own runtime; null when absent. When the keychain is
@@ -2628,10 +2629,21 @@ var RecordIntegrationInstances = class {
2628
2629
  }
2629
2630
  return out;
2630
2631
  }
2632
+ /** The kind an instance body is of: the provider's `kindOf`, else its one declared kind. */
2633
+ kindOfBody(body) {
2634
+ if (this.hooks.kindOf !== void 0) {
2635
+ const id = this.hooks.kindOf(body);
2636
+ if (!this.hooks.description.kinds.some((declared) => declared.id === id)) throw new Error(`record kind '${this.kind.name}': kindOf returned '${id}', which describe().kinds does not declare (D1013)`);
2637
+ return id;
2638
+ }
2639
+ const only = this.hooks.description.kinds[0];
2640
+ if (only === void 0) throw new Error(`record kind '${this.kind.name}' declares no kinds`);
2641
+ return only.id;
2642
+ }
2631
2643
  viewOf(record) {
2632
2644
  const shown = secretViewsOf(this.records.owner, this.kind.name, record.id, this.kind.declaration, record.data);
2633
2645
  const rawName = record.data[this.nameField];
2634
- const kind = this.hooks.kindOf?.(record.data);
2646
+ const kind = this.kindOfBody(record.data);
2635
2647
  const health = this.hooks.health?.(record.data, record.id);
2636
2648
  return {
2637
2649
  id: record.id,
@@ -2639,7 +2651,7 @@ var RecordIntegrationInstances = class {
2639
2651
  configured: this.hooks.configured(record.data),
2640
2652
  enabled: isInstanceEnabled(record.data),
2641
2653
  formValues: shown,
2642
- ...kind !== void 0 ? { kind } : {},
2654
+ kind,
2643
2655
  ...health?.status !== void 0 ? { status: health.status } : {},
2644
2656
  ...health?.lastCheckedAt !== void 0 ? { lastCheckedAt: health.lastCheckedAt } : {}
2645
2657
  };
@@ -52426,6 +52438,11 @@ var CAP_CUSTOMIZE_CATALOG = {
52426
52438
  defaultThreshold: 5,
52427
52439
  defaultStartDwellMs: 3e4,
52428
52440
  defaultStopDwellMs: 18e4,
52441
+ deviceTypeDefaults: { [DeviceType.MediaPlayer]: {
52442
+ startDwellMs: 1e4,
52443
+ stopDwellMs: 1e4,
52444
+ minSamples: 1
52445
+ } },
52429
52446
  thresholdUnit: "W"
52430
52447
  }]
52431
52448
  }
@@ -62989,10 +63006,11 @@ var IntegrationInstanceDescriptionSchema = z.object({
62989
63006
  /** True when `testInstance` really probes the remote. */
62990
63007
  canTest: z.boolean(),
62991
63008
  /**
62992
- * The kinds an instance can be of. Absent or one entry: nothing to choose; more than one: the
62993
- * Add flow asks which first and sends it as `createInstance.kind`.
63009
+ * The kinds an instance can be of (D1013 rule 1), each naming its `functionCap`. One entry:
63010
+ * nothing to choose; more than one: the Add flow asks which first and sends it as
63011
+ * `createInstance.kind`. Never empty: every instance belongs to exactly one kind.
62994
63012
  */
62995
- kinds: z.array(IntegrationInstanceKindSchema).optional(),
63013
+ kinds: z.array(IntegrationInstanceKindSchema).min(1),
62996
63014
  /**
62997
63015
  * The provider accepts `createInstance.id` for an id that once existed (an adopted id, because
62998
63016
  * devices carry it). The UI then offers "restore under its old id" on Add. Absent means no.
@@ -63028,8 +63046,8 @@ var IntegrationInstanceSchema = z.object({
63028
63046
  * the body is the one store, `setInstanceEnabled` the one writer (epic #440, step 3).
63029
63047
  */
63030
63048
  enabled: z.boolean().optional(),
63031
- /** The kind of this instance (one of `describe().kinds[].id`), when the provider has kinds. */
63032
- kind: z.string().optional(),
63049
+ /** The kind of this instance: exactly one of `describe().kinds[].id` (D1013 rule 2). */
63050
+ kind: z.string().min(1),
63033
63051
  /** Values for the instance form; a secret is a `SecretFieldView`, never text. */
63034
63052
  formValues: z.record(z.string(), z.unknown()),
63035
63053
  status: IntegrationInstanceStatusSchema.optional(),
@@ -85727,6 +85745,31 @@ var remoteLayoutComponentsCapability = {
85727
85745
  };
85728
85746
  var RUNNING_POWER_START_DELAY_MS = 3e4;
85729
85747
  var RUNNING_POWER_STOP_DELAY_MS = 18e4;
85748
+ /** What every type without its own row starts from. */
85749
+ var RUNNING_POWER_GLOBAL_DEFAULTS = {
85750
+ startDwellMs: RUNNING_POWER_START_DELAY_MS,
85751
+ stopDwellMs: RUNNING_POWER_STOP_DELAY_MS,
85752
+ minSamples: 2
85753
+ };
85754
+ /**
85755
+ * Per-type overrides of the dwell defaults. A media player draws power the
85756
+ * moment it is on and stops drawing the moment it is off, so it needs neither
85757
+ * a long dwell nor a second sample. A type absent here keeps the global values.
85758
+ */
85759
+ var RUNNING_POWER_DEFAULTS_BY_TYPE = { [DeviceType.MediaPlayer]: {
85760
+ startDwellMs: 1e4,
85761
+ stopDwellMs: 1e4,
85762
+ minSamples: 1
85763
+ } };
85764
+ /** True when the type has its own row, so its numbers are stated rather than inherited. */
85765
+ function hasOwnRunningPowerDefaults(deviceType) {
85766
+ return deviceType !== void 0 && RUNNING_POWER_DEFAULTS_BY_TYPE[deviceType] !== void 0;
85767
+ }
85768
+ /** The only place a running-power dwell default is resolved for a device type. */
85769
+ function runningPowerDefaultsFor(deviceType) {
85770
+ if (deviceType === void 0) return RUNNING_POWER_GLOBAL_DEFAULTS;
85771
+ return RUNNING_POWER_DEFAULTS_BY_TYPE[deviceType] ?? RUNNING_POWER_GLOBAL_DEFAULTS;
85772
+ }
85730
85773
  var RunningStateSourceSchema = z.enum(["native", "assigned"]);
85731
85774
  var RunningStateStatusSchema = z.object({
85732
85775
  /** null = unknown — never coerced to false (D393). */
@@ -85819,6 +85862,7 @@ var runningStateCapability = {
85819
85862
  defaultThreshold: 5,
85820
85863
  defaultStartDwellMs: RUNNING_POWER_START_DELAY_MS,
85821
85864
  defaultStopDwellMs: RUNNING_POWER_STOP_DELAY_MS,
85865
+ deviceTypeDefaults: RUNNING_POWER_DEFAULTS_BY_TYPE,
85822
85866
  thresholdUnit: "W"
85823
85867
  }]
85824
85868
  }
@@ -93640,6 +93684,7 @@ var THRESHOLD_GRID_W = [
93640
93684
  function proposeRunningThreshold(series) {
93641
93685
  const segments = toSegments(series);
93642
93686
  const spanMs = segments.length === 0 ? 0 : series.to - (segments[0]?.start ?? series.to);
93687
+ const fallbackDefaults = runningPowerDefaultsFor(series.deviceType);
93643
93688
  const insufficient = (reason, runsFound) => ({
93644
93689
  state: "insufficient",
93645
93690
  reason,
@@ -93652,8 +93697,9 @@ function proposeRunningThreshold(series) {
93652
93697
  kind: "threshold",
93653
93698
  comparison: "gte",
93654
93699
  threshold: 5,
93655
- startDwellMs: RUNNING_POWER_START_DELAY_MS,
93656
- stopDwellMs: RUNNING_POWER_STOP_DELAY_MS
93700
+ startDwellMs: fallbackDefaults.startDwellMs,
93701
+ stopDwellMs: fallbackDefaults.stopDwellMs,
93702
+ ...hasOwnRunningPowerDefaults(series.deviceType) ? { minSamples: fallbackDefaults.minSamples } : {}
93657
93703
  }
93658
93704
  });
93659
93705
  if (series.truncated) return insufficient("truncated", 0);
@@ -1204,7 +1204,7 @@ var DeviceRole = /* @__PURE__ */ function(DeviceRole) {
1204
1204
  return DeviceRole;
1205
1205
  }({});
1206
1206
  //#endregion
1207
- //#region ../types/dist/sleep-7El4r5Bl.mjs
1207
+ //#region ../types/dist/sleep-CGPZyzB5.mjs
1208
1208
  /**
1209
1209
  * The audio chunk plane's byte format, and the ONE expansion from a coded
1210
1210
  * window to float samples (D455).
@@ -2587,6 +2587,7 @@ var RecordIntegrationInstances = class {
2587
2587
  this.secretKeys = topLevelSecretKeys(kind.declaration.secretPaths);
2588
2588
  this.secretMaps = secretMapKeys(kind.declaration.secretPaths);
2589
2589
  this.nameField = kind.declaration.entry?.nameField ?? "name";
2590
+ if (hooks.kindOf === void 0 && hooks.description.kinds.length !== 1) throw new Error(`record kind '${kind.name}': describe().kinds has ${hooks.description.kinds.length} entries, so kindOf is required to say which one an instance is`);
2590
2591
  }
2591
2592
  /**
2592
2593
  * One instance read for the addon's own runtime; null when absent. When the keychain is
@@ -2628,10 +2629,21 @@ var RecordIntegrationInstances = class {
2628
2629
  }
2629
2630
  return out;
2630
2631
  }
2632
+ /** The kind an instance body is of: the provider's `kindOf`, else its one declared kind. */
2633
+ kindOfBody(body) {
2634
+ if (this.hooks.kindOf !== void 0) {
2635
+ const id = this.hooks.kindOf(body);
2636
+ if (!this.hooks.description.kinds.some((declared) => declared.id === id)) throw new Error(`record kind '${this.kind.name}': kindOf returned '${id}', which describe().kinds does not declare (D1013)`);
2637
+ return id;
2638
+ }
2639
+ const only = this.hooks.description.kinds[0];
2640
+ if (only === void 0) throw new Error(`record kind '${this.kind.name}' declares no kinds`);
2641
+ return only.id;
2642
+ }
2631
2643
  viewOf(record) {
2632
2644
  const shown = secretViewsOf(this.records.owner, this.kind.name, record.id, this.kind.declaration, record.data);
2633
2645
  const rawName = record.data[this.nameField];
2634
- const kind = this.hooks.kindOf?.(record.data);
2646
+ const kind = this.kindOfBody(record.data);
2635
2647
  const health = this.hooks.health?.(record.data, record.id);
2636
2648
  return {
2637
2649
  id: record.id,
@@ -2639,7 +2651,7 @@ var RecordIntegrationInstances = class {
2639
2651
  configured: this.hooks.configured(record.data),
2640
2652
  enabled: isInstanceEnabled(record.data),
2641
2653
  formValues: shown,
2642
- ...kind !== void 0 ? { kind } : {},
2654
+ kind,
2643
2655
  ...health?.status !== void 0 ? { status: health.status } : {},
2644
2656
  ...health?.lastCheckedAt !== void 0 ? { lastCheckedAt: health.lastCheckedAt } : {}
2645
2657
  };
@@ -52426,6 +52438,11 @@ var CAP_CUSTOMIZE_CATALOG = {
52426
52438
  defaultThreshold: 5,
52427
52439
  defaultStartDwellMs: 3e4,
52428
52440
  defaultStopDwellMs: 18e4,
52441
+ deviceTypeDefaults: { [DeviceType.MediaPlayer]: {
52442
+ startDwellMs: 1e4,
52443
+ stopDwellMs: 1e4,
52444
+ minSamples: 1
52445
+ } },
52429
52446
  thresholdUnit: "W"
52430
52447
  }]
52431
52448
  }
@@ -62989,10 +63006,11 @@ var IntegrationInstanceDescriptionSchema = zod.z.object({
62989
63006
  /** True when `testInstance` really probes the remote. */
62990
63007
  canTest: zod.z.boolean(),
62991
63008
  /**
62992
- * The kinds an instance can be of. Absent or one entry: nothing to choose; more than one: the
62993
- * Add flow asks which first and sends it as `createInstance.kind`.
63009
+ * The kinds an instance can be of (D1013 rule 1), each naming its `functionCap`. One entry:
63010
+ * nothing to choose; more than one: the Add flow asks which first and sends it as
63011
+ * `createInstance.kind`. Never empty: every instance belongs to exactly one kind.
62994
63012
  */
62995
- kinds: zod.z.array(IntegrationInstanceKindSchema).optional(),
63013
+ kinds: zod.z.array(IntegrationInstanceKindSchema).min(1),
62996
63014
  /**
62997
63015
  * The provider accepts `createInstance.id` for an id that once existed (an adopted id, because
62998
63016
  * devices carry it). The UI then offers "restore under its old id" on Add. Absent means no.
@@ -63028,8 +63046,8 @@ var IntegrationInstanceSchema = zod.z.object({
63028
63046
  * the body is the one store, `setInstanceEnabled` the one writer (epic #440, step 3).
63029
63047
  */
63030
63048
  enabled: zod.z.boolean().optional(),
63031
- /** The kind of this instance (one of `describe().kinds[].id`), when the provider has kinds. */
63032
- kind: zod.z.string().optional(),
63049
+ /** The kind of this instance: exactly one of `describe().kinds[].id` (D1013 rule 2). */
63050
+ kind: zod.z.string().min(1),
63033
63051
  /** Values for the instance form; a secret is a `SecretFieldView`, never text. */
63034
63052
  formValues: zod.z.record(zod.z.string(), zod.z.unknown()),
63035
63053
  status: IntegrationInstanceStatusSchema.optional(),
@@ -85727,6 +85745,31 @@ var remoteLayoutComponentsCapability = {
85727
85745
  };
85728
85746
  var RUNNING_POWER_START_DELAY_MS = 3e4;
85729
85747
  var RUNNING_POWER_STOP_DELAY_MS = 18e4;
85748
+ /** What every type without its own row starts from. */
85749
+ var RUNNING_POWER_GLOBAL_DEFAULTS = {
85750
+ startDwellMs: RUNNING_POWER_START_DELAY_MS,
85751
+ stopDwellMs: RUNNING_POWER_STOP_DELAY_MS,
85752
+ minSamples: 2
85753
+ };
85754
+ /**
85755
+ * Per-type overrides of the dwell defaults. A media player draws power the
85756
+ * moment it is on and stops drawing the moment it is off, so it needs neither
85757
+ * a long dwell nor a second sample. A type absent here keeps the global values.
85758
+ */
85759
+ var RUNNING_POWER_DEFAULTS_BY_TYPE = { [DeviceType.MediaPlayer]: {
85760
+ startDwellMs: 1e4,
85761
+ stopDwellMs: 1e4,
85762
+ minSamples: 1
85763
+ } };
85764
+ /** True when the type has its own row, so its numbers are stated rather than inherited. */
85765
+ function hasOwnRunningPowerDefaults(deviceType) {
85766
+ return deviceType !== void 0 && RUNNING_POWER_DEFAULTS_BY_TYPE[deviceType] !== void 0;
85767
+ }
85768
+ /** The only place a running-power dwell default is resolved for a device type. */
85769
+ function runningPowerDefaultsFor(deviceType) {
85770
+ if (deviceType === void 0) return RUNNING_POWER_GLOBAL_DEFAULTS;
85771
+ return RUNNING_POWER_DEFAULTS_BY_TYPE[deviceType] ?? RUNNING_POWER_GLOBAL_DEFAULTS;
85772
+ }
85730
85773
  var RunningStateSourceSchema = zod.z.enum(["native", "assigned"]);
85731
85774
  var RunningStateStatusSchema = zod.z.object({
85732
85775
  /** null = unknown — never coerced to false (D393). */
@@ -85819,6 +85862,7 @@ var runningStateCapability = {
85819
85862
  defaultThreshold: 5,
85820
85863
  defaultStartDwellMs: RUNNING_POWER_START_DELAY_MS,
85821
85864
  defaultStopDwellMs: RUNNING_POWER_STOP_DELAY_MS,
85865
+ deviceTypeDefaults: RUNNING_POWER_DEFAULTS_BY_TYPE,
85822
85866
  thresholdUnit: "W"
85823
85867
  }]
85824
85868
  }
@@ -93640,6 +93684,7 @@ var THRESHOLD_GRID_W = [
93640
93684
  function proposeRunningThreshold(series) {
93641
93685
  const segments = toSegments(series);
93642
93686
  const spanMs = segments.length === 0 ? 0 : series.to - (segments[0]?.start ?? series.to);
93687
+ const fallbackDefaults = runningPowerDefaultsFor(series.deviceType);
93643
93688
  const insufficient = (reason, runsFound) => ({
93644
93689
  state: "insufficient",
93645
93690
  reason,
@@ -93652,8 +93697,9 @@ function proposeRunningThreshold(series) {
93652
93697
  kind: "threshold",
93653
93698
  comparison: "gte",
93654
93699
  threshold: 5,
93655
- startDwellMs: RUNNING_POWER_START_DELAY_MS,
93656
- stopDwellMs: RUNNING_POWER_STOP_DELAY_MS
93700
+ startDwellMs: fallbackDefaults.startDwellMs,
93701
+ stopDwellMs: fallbackDefaults.stopDwellMs,
93702
+ ...hasOwnRunningPowerDefaults(series.deviceType) ? { minSamples: fallbackDefaults.minSamples } : {}
93657
93703
  }
93658
93704
  });
93659
93705
  if (series.truncated) return insufficient("truncated", 0);
@@ -1,5 +1,5 @@
1
1
  require("./chunk-Cek0wNdY.js");
2
- const require_wal_maintenance = require("./wal-maintenance-BTR55y--.js");
2
+ const require_wal_maintenance = require("./wal-maintenance-BQaIM_cY.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 { A as callRecords, C as isFileHostWorkerData, D as RecordsEngine, M as controlTargetOf, O as callControl, S as isFileHostRequest, a as WalMaintenance, b as collectTransferables, d as callMigrate, f as migrateTargetOf, j as callVector, k as callData, l as SqliteSettingsBackend, o as createVectorIndex, s as vectorProviderOf, u as HUB_MIGRATIONS, v as serializeError, w as trustInput } from "./wal-maintenance-jrhYTCn2.mjs";
1
+ import { A as callRecords, C as isFileHostWorkerData, D as RecordsEngine, M as controlTargetOf, O as callControl, S as isFileHostRequest, a as WalMaintenance, b as collectTransferables, d as callMigrate, f as migrateTargetOf, j as callVector, k as callData, l as SqliteSettingsBackend, o as createVectorIndex, s as vectorProviderOf, u as HUB_MIGRATIONS, v as serializeError, w as trustInput } from "./wal-maintenance-Zji_8sLK.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 { kc as userError } from "./dist-CogtCQxu.mjs";
2
+ import { kc as userError } from "./dist-BLxWQm_m.mjs";
3
3
  import { f as X509Certificate$1 } from "./x509.es-BRiJgOvu.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-DS4b0ucn.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-B5cYxyQW.mjs";
5
5
  import { X509Certificate, createPrivateKey } from "node:crypto";
6
6
  import { writeOwnerOnlyFileSync } from "@camstack/types/node";
7
7
  import { copyFileSync, existsSync, mkdirSync, readFileSync, renameSync, rmSync, writeFileSync } from "node:fs";
@@ -1,7 +1,7 @@
1
1
  const require_chunk = require("./chunk-Cek0wNdY.js");
2
- const require_dist = require("./dist-2SHQaxaS.js");
2
+ const require_dist = require("./dist-DZQowBDF.js");
3
3
  const require_x509_es = require("./x509.es-WtnRNyYS.js");
4
- const require_agent_https = require("./agent-https-CuChFRA2.js");
4
+ const require_agent_https = require("./agent-https-C0QE8tXs.js");
5
5
  let node_crypto = require("node:crypto");
6
6
  let _camstack_types_node = require("@camstack/types/node");
7
7
  let node_fs = require("node:fs");