@camstack/server 1.2.944 → 1.2.946

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 (66) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/dist/api/trpc/generated-cap-mounts.js +18 -1
  3. package/dist/api/trpc/generated-cap-routers.js +2596 -2559
  4. package/package.json +9 -17
  5. package/system/assets/apps-aggregator/icon.svg +5 -0
  6. package/system/dist/{action-index-Dz9rd1qa.js → action-index-Bcnb-jyg.js} +8 -0
  7. package/system/dist/{action-index-DpYmsOKh.mjs → action-index-DwPHO2nz.mjs} +8 -0
  8. package/system/dist/apps.cap-Bqb9NpYx.mjs +130 -0
  9. package/system/dist/apps.cap-CLjgnuUe.js +141 -0
  10. package/system/dist/builtins/alerts/alerts.addon.js +2 -2
  11. package/system/dist/builtins/alerts/alerts.addon.mjs +2 -2
  12. package/system/dist/builtins/apps-aggregator/aggregate-apps.d.ts +24 -0
  13. package/system/dist/builtins/apps-aggregator/apps-aggregator.addon.d.ts +16 -0
  14. package/system/dist/builtins/apps-aggregator/apps-aggregator.addon.js +109 -0
  15. package/system/dist/builtins/apps-aggregator/apps-aggregator.addon.mjs +103 -0
  16. package/system/dist/builtins/apps-aggregator/index.d.ts +1 -0
  17. package/system/dist/builtins/apps-aggregator/index.js +8 -0
  18. package/system/dist/builtins/apps-aggregator/index.mjs +2 -0
  19. package/system/dist/builtins/camera-grid/index.js +1 -1
  20. package/system/dist/builtins/camera-grid/index.mjs +1 -1
  21. package/system/dist/builtins/composer/composer.addon.js +4 -4
  22. package/system/dist/builtins/composer/composer.addon.mjs +4 -4
  23. package/system/dist/builtins/core-blocks/core-blocks.addon.js +68 -23
  24. package/system/dist/builtins/core-blocks/core-blocks.addon.mjs +68 -23
  25. package/system/dist/builtins/core-blocks/timed-run/timed-run-service.d.ts +19 -2
  26. package/system/dist/builtins/device-history/device-history.addon.js +1 -1
  27. package/system/dist/builtins/device-history/device-history.addon.mjs +1 -1
  28. package/system/dist/builtins/device-manager/device-manager.addon.js +31 -9
  29. package/system/dist/builtins/device-manager/device-manager.addon.mjs +31 -9
  30. package/system/dist/builtins/keychain/index.js +1 -1
  31. package/system/dist/builtins/keychain/index.mjs +1 -1
  32. package/system/dist/builtins/local-auth/local-auth.addon.js +1 -1
  33. package/system/dist/builtins/local-auth/local-auth.addon.mjs +1 -1
  34. package/system/dist/builtins/sqlite-storage/index.js +1 -1
  35. package/system/dist/builtins/sqlite-storage/index.mjs +1 -1
  36. package/system/dist/builtins/sqlite-storage/sqlite-settings.addon.js +1 -1
  37. package/system/dist/builtins/sqlite-storage/sqlite-settings.addon.mjs +1 -1
  38. package/system/dist/builtins/system-config/system-config.addon.js +1 -1
  39. package/system/dist/builtins/system-config/system-config.addon.mjs +1 -1
  40. package/system/dist/{command-catalog-CI0tu1Nt.js → command-catalog-A_ONlLfF.js} +1 -1
  41. package/system/dist/{command-catalog-zwlIA3T5.mjs → command-catalog-CZDlLhxO.mjs} +1 -1
  42. package/system/dist/{compile-SpeAhaZ6.js → compile-BpAtMSvc.js} +1 -1
  43. package/system/dist/{compile-OBMHlqD-.mjs → compile-DPGk4aRg.mjs} +1 -1
  44. package/system/dist/{composition-sources-CXxXfh1z.mjs → composition-sources-D5bWS3nC.mjs} +2 -2
  45. package/system/dist/{composition-sources-DNgSItK-.js → composition-sources-hmri4Cu4.js} +2 -2
  46. package/system/dist/{core-blocks.cap-BHEok4VO.js → core-blocks.cap-9xvotd_3.js} +3 -3
  47. package/system/dist/{core-blocks.cap-CPgZRcpj.mjs → core-blocks.cap-C6REo0Dd.mjs} +3 -3
  48. package/system/dist/{device-kind-C37Ra2wd.mjs → device-kind-B6G_HfgC.mjs} +19 -2
  49. package/system/dist/{device-kind-FMhJg8uC.js → device-kind-B7ESmha7.js} +24 -1
  50. package/system/dist/file-host-worker.js +1 -1
  51. package/system/dist/file-host-worker.mjs +1 -1
  52. package/system/dist/index.js +4 -4
  53. package/system/dist/index.mjs +4 -4
  54. package/system/dist/{named-entity-store-DFwLij9c.js → named-entity-store-CzJ28TsK.js} +2 -2
  55. package/system/dist/{named-entity-store-DOnyyFFf.mjs → named-entity-store-DJxyweoS.mjs} +2 -2
  56. package/system/dist/{record-kinds-BV8Gcpsx.js → record-kinds-DP2-HG3W.js} +1 -1
  57. package/system/dist/{record-kinds-BD2xv4Pd.mjs → record-kinds-WosKAa-D.mjs} +1 -1
  58. package/system/dist/{rename-composition-block-Cx3X8QSm.js → rename-composition-block--abG_xyW.js} +31 -36
  59. package/system/dist/{rename-composition-block-C3QQ9UUE.mjs → rename-composition-block-kmkoIx0R.mjs} +31 -36
  60. package/system/dist/{user-management.cap-4IEUCSdL.mjs → user-management.cap-C3eqqVdz.mjs} +1 -1
  61. package/system/dist/{user-management.cap-DV9Jfsj3.js → user-management.cap-D4r3UKtG.js} +1 -1
  62. package/system/dist/{wal-maintenance-CkPfVApC.js → wal-maintenance-CZKvoKfx.js} +0 -0
  63. package/system/dist/{wal-maintenance-u84_1sVl.mjs → wal-maintenance-WLoThDXX.mjs} +0 -0
  64. package/system/package.json +16 -1
  65. /package/system/dist/{constants-Ba3FTIHl.js → constants-Ba3FTIHl2.js} +0 -0
  66. /package/system/dist/{constants-DB4piTD5.mjs → constants-DB4piTD52.mjs} +0 -0
@@ -16,17 +16,18 @@ import { y as StorageMigrationLeaseInputSchema } from "./relocate-CoZZTui1.mjs";
16
16
  import { n as storageCapability, t as storageMigrationCapability } from "./storage-migration.cap-Ciw84XPm.mjs";
17
17
  import { a as TagsFieldSchema, d as IconKeySchema, n as TagIdsFieldSchema, r as TagNameSchema, t as TagColorIdSchema } from "./tag-DU8pm9Bi.mjs";
18
18
  import { r as MODEL_FORMATS, t as platformProbeCapability } from "./platform-probe.cap-DzZ7xUfS.mjs";
19
- import { a as authProviderCapability, c as TokenScopeSchema, i as deviceCredentialsCapability, r as ssoBridgeCapability, t as userManagementCapability } from "./user-management.cap-4IEUCSdL.mjs";
19
+ import { a as authProviderCapability, c as TokenScopeSchema, i as deviceCredentialsCapability, r as ssoBridgeCapability, t as userManagementCapability } from "./user-management.cap-C3eqqVdz.mjs";
20
20
  import { n as DeviceRole, r as DeviceType } from "./device-type-TUGqGmaI.mjs";
21
21
  import { d as AppLoginPathSchema } from "./device-certificate-Cddm4Idn.mjs";
22
- import { $t as EventVocabularyEntrySchema, A as MediaPlayerStatusSchema, At as TemplateEventValueSchema, B as isRemoteCustomKey, Dt as TemplateActionValueSchema, F as irSourceProblem, G as IrNativeFormatSchema, Gt as QuantityUnitError, H as isRemoteWidgetRole, I as remoteSourceSteps, Jt as paramMeta, K as IrTimingsSchema, Kt as convertQuantityInput, M as REMOTE_STEP_DELAY_MAX_MS, Mt as AutomationWhenSchema, N as RemoteSourceSchema, Nt as EVENT_LEAF_ID_RE, Ot as TemplateDeviceStateValueSchema, Qt as unwrapSchema, R as RemoteRoleSchema, V as isRemoteRole, W as IrNativeCodeSchema, Xt as enumerateItemArrayFields, Yt as paramMetaOf, Zt as enumerateSchemaFields, bt as AutomationRecipeSchema, c as coreBlocksCapability, dt as SchedulerConflictSchema, et as CompositionBlockStateSchema, gt as SchedulerStatusSchema, ht as SchedulerSchema, it as AutomationRunTraceSchema, j as mediaPlayerCapability, jt as TemplateTimeWindowValueSchema, kt as TemplateEntriesValueSchema, mt as SchedulerPreviewSchema, pt as SchedulerInputSchema, q as TransmitSettingsSchema, qt as isQuantityValue, rt as AutomationRunOutcomeSchema, tt as CompositionRunStatusSchema, ut as LOCAL_DATE_PATTERN, vt as ActionStepSchema, w as powerSourceCapability, yt as AutomationBranchStepSchema, z as customKeyOfRole } from "./core-blocks.cap-CPgZRcpj.mjs";
23
- import { a as findVocabAction, s as vocabCall } from "./action-index-DpYmsOKh.mjs";
22
+ import { $t as EventVocabularyEntrySchema, A as MediaPlayerStatusSchema, At as TemplateEventValueSchema, B as isRemoteCustomKey, Dt as TemplateActionValueSchema, F as irSourceProblem, G as IrNativeFormatSchema, Gt as QuantityUnitError, H as isRemoteWidgetRole, I as remoteSourceSteps, Jt as paramMeta, K as IrTimingsSchema, Kt as convertQuantityInput, M as REMOTE_STEP_DELAY_MAX_MS, Mt as AutomationWhenSchema, N as RemoteSourceSchema, Nt as EVENT_LEAF_ID_RE, Ot as TemplateDeviceStateValueSchema, Qt as unwrapSchema, R as RemoteRoleSchema, V as isRemoteRole, W as IrNativeCodeSchema, Xt as enumerateItemArrayFields, Yt as paramMetaOf, Zt as enumerateSchemaFields, bt as AutomationRecipeSchema, c as coreBlocksCapability, dt as SchedulerConflictSchema, et as CompositionBlockStateSchema, gt as SchedulerStatusSchema, ht as SchedulerSchema, it as AutomationRunTraceSchema, j as mediaPlayerCapability, jt as TemplateTimeWindowValueSchema, kt as TemplateEntriesValueSchema, mt as SchedulerPreviewSchema, pt as SchedulerInputSchema, q as TransmitSettingsSchema, qt as isQuantityValue, rt as AutomationRunOutcomeSchema, tt as CompositionRunStatusSchema, ut as LOCAL_DATE_PATTERN, vt as ActionStepSchema, w as powerSourceCapability, yt as AutomationBranchStepSchema, z as customKeyOfRole } from "./core-blocks.cap-C6REo0Dd.mjs";
23
+ import { a as findVocabAction, s as vocabCall } from "./action-index-DwPHO2nz.mjs";
24
24
  import { i as addonSettingsCapability, o as unitDimension, s as unitsForDimension } from "./addon-settings.cap-CHpmuaQG.mjs";
25
- import { F as COMPOSED_DEVICE_STABLE_ID_PREFIX, S as CompositionSchema, it as alertsCapability, v as COMPOSER_ADDON_ID } from "./compile-OBMHlqD-.mjs";
25
+ import { F as COMPOSED_DEVICE_STABLE_ID_PREFIX, S as CompositionSchema, it as alertsCapability, v as COMPOSER_ADDON_ID } from "./compile-DPGk4aRg.mjs";
26
26
  import { a as normalizeUnit } from "./source-info-DGB7SdB_.mjs";
27
27
  import { t } from "./l10n-Bu6aUvSY.mjs";
28
28
  import { t as addonPagesCapability } from "./addon-pages.cap-BLNN6ypr.mjs";
29
29
  import { n as WidgetRemoteSchema, r as addonWidgetsSourceCapability, t as addonWidgetsCapability } from "./addon-widgets.cap-BbmWMzIH.mjs";
30
+ import { n as appSourceCapability, t as appsCapability } from "./apps.cap-Bqb9NpYx.mjs";
30
31
  import { a as databaseSnapshotCapability } from "./database-snapshot.cap-a3lSf4hl.mjs";
31
32
  import { n as backupCapability, t as storageOccupancyCapability } from "./storage-occupancy.cap-B-wbMPmx.mjs";
32
33
  import { n as calendarsCapability, r as calendarSourceCapability } from "./calendars.cap-DQc6Q6qS.mjs";
@@ -12493,42 +12494,34 @@ function switchRunLimitOf(deviceType, role) {
12493
12494
  * boot a deadline already past sends the off once (a failed off is logged, never
12494
12495
  * retried in a loop - D49); a future one is re-armed.
12495
12496
  *
12496
- * What a device may be run for, and for how long at most, is per device type
12497
- * and role ({@link timedRunLimitOf}): the maximum is a safety bound, not a preference,
12498
- * so a request above it is REFUSED with a typed reason, never clamped.
12497
+ * It is offered on EVERY device that has a `switch` (and on a pet fountain, which
12498
+ * switches its pump): the binding rule is `bindsWhenDeviceHas: ['switch']` (D1097).
12499
+ * What a device may be run for, and for how long at most, is the one table of
12500
+ * `switchRunLimitOf` by device type and role ({@link timedRunLimitOf}): the maximum
12501
+ * is a safety bound, not a preference, so a request above it is REFUSED with a
12502
+ * typed reason, never clamped.
12499
12503
  */
12500
12504
  var TimedRunUnitSchema = /* @__PURE__ */ z.enum(["s", "min"]);
12501
- /** A plug-in heater (switch + `switch-heater`): up to 3 h, in minutes. */
12502
- var TIMED_RUN_HEATER_LIMIT = {
12503
- actuator: "switch",
12504
- maxSeconds: SWITCH_RUN_HEATER_LIMIT.maxSeconds,
12505
- unit: "min",
12506
- quickRunDefault: SWITCH_RUN_HEATER_LIMIT.quickRunSeconds / 60
12507
- };
12508
- /** A pet fountain's pump: up to 5 min, in seconds. */
12509
- var TIMED_RUN_PET_FOUNTAIN_LIMIT = {
12510
- actuator: "pet-fountain",
12511
- maxSeconds: SWITCH_RUN_PET_FOUNTAIN_LIMIT.maxSeconds,
12512
- unit: "s",
12513
- quickRunDefault: SWITCH_RUN_PET_FOUNTAIN_LIMIT.quickRunSeconds
12514
- };
12515
12505
  /**
12516
- * The device types `timed-run` may be offered on. A `switch` is narrowed by
12517
- * role ({@link TIMED_RUN_DEVICE_ROLES}): only a plug-in heater runs on a timer.
12518
- */
12519
- var TIMED_RUN_DEVICE_TYPES = [DeviceType.Switch, DeviceType.PetFountain];
12520
- /** The roles that make a device of these types timed-run-able (D1033). */
12521
- var TIMED_RUN_DEVICE_ROLES = { [DeviceType.Switch]: [DeviceRole.SwitchHeater] };
12522
- /**
12523
- * The longest run of a device, by its type AND role (D1033): a `switch` is a
12524
- * heater only with role `switch-heater`, a pet fountain always is what it is.
12525
- * `null` - the device is not offered `timed-run`.
12506
+ * The timed-run limit of ANY device the cap is bound to: the numbers come from
12507
+ * the one table (`switchRunLimitOf`), the unit and the actuator from the type.
12508
+ * A pet fountain runs its pump and thinks in seconds; every other device is
12509
+ * switched through `switch.setState` and thinks in minutes.
12526
12510
  */
12527
12511
  function timedRunLimitOf(deviceType, role) {
12528
12512
  const limit = switchRunLimitOf(deviceType, role);
12529
- if (deviceType === DeviceType.PetFountain && limit === SWITCH_RUN_PET_FOUNTAIN_LIMIT) return TIMED_RUN_PET_FOUNTAIN_LIMIT;
12530
- if (deviceType === DeviceType.Switch && role === DeviceRole.SwitchHeater && limit === SWITCH_RUN_HEATER_LIMIT) return TIMED_RUN_HEATER_LIMIT;
12531
- return null;
12513
+ if (deviceType === DeviceType.PetFountain) return {
12514
+ actuator: "pet-fountain",
12515
+ maxSeconds: limit.maxSeconds,
12516
+ unit: "s",
12517
+ quickRunDefault: limit.quickRunSeconds
12518
+ };
12519
+ return {
12520
+ actuator: "switch",
12521
+ maxSeconds: limit.maxSeconds,
12522
+ unit: "min",
12523
+ quickRunDefault: limit.quickRunSeconds / 60
12524
+ };
12532
12525
  }
12533
12526
  var MS_PER_SECOND = 1e3;
12534
12527
  var MS_PER_MINUTE = 6e4;
@@ -12609,8 +12602,8 @@ var timedRunCapability = {
12609
12602
  mode: "singleton",
12610
12603
  kind: "wrapper",
12611
12604
  defaultActive: true,
12612
- deviceTypes: TIMED_RUN_DEVICE_TYPES,
12613
- deviceRoles: TIMED_RUN_DEVICE_ROLES,
12605
+ deviceTypes: [DeviceType.PetFountain],
12606
+ bindsWhenDeviceHas: ["switch"],
12614
12607
  deviceConfig: { ui: {
12615
12608
  kind: "derived-form",
12616
12609
  builderId: "timed-run",
@@ -33986,6 +33979,8 @@ var ALL_CAPABILITY_DEFINITIONS = [
33986
33979
  alarmPanelCapability,
33987
33980
  alertsCapability,
33988
33981
  ambientLightSensorCapability,
33982
+ appSourceCapability,
33983
+ appsCapability,
33989
33984
  audioAnalysisCapability,
33990
33985
  audioAnalyzerCapability,
33991
33986
  audioCodecCapability,
@@ -1,7 +1,7 @@
1
1
  import { c as method } from "./capability-definition-C1TLUVJR.mjs";
2
2
  import { t as NOT_A_DEVICE } from "./system-reasons-CYj4qwyS.mjs";
3
3
  import { r as DeviceType } from "./device-type-TUGqGmaI.mjs";
4
- import { t as canonicalStoredDeviceType } from "./device-kind-C37Ra2wd.mjs";
4
+ import { t as canonicalStoredDeviceType } from "./device-kind-B6G_HfgC.mjs";
5
5
  import { a as DeviceCredentialSchema, o as DeviceCredentialStatusSchema, s as StartEnrollmentOutputSchema } from "./device-certificate-Cddm4Idn.mjs";
6
6
  import { n as RawSecretMigrationReportSchema, t as RawSecretMigrationInputSchema } from "./raw-secret-migration-iv88mLoc.mjs";
7
7
  import { z } from "zod";
@@ -1,7 +1,7 @@
1
1
  const require_capability_definition = require("./capability-definition-BEVd01Xj.js");
2
2
  const require_system_reasons = require("./system-reasons-Be_k1W8g.js");
3
3
  const require_device_type = require("./device-type-Cnc0NiSX.js");
4
- const require_device_kind = require("./device-kind-FMhJg8uC.js");
4
+ const require_device_kind = require("./device-kind-B7ESmha7.js");
5
5
  const require_device_certificate = require("./device-certificate-CguVACQO.js");
6
6
  const require_raw_secret_migration = require("./raw-secret-migration-DxuBFtvi.js");
7
7
  let zod = require("zod");
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@camstack/server",
3
- "version": "1.2.944",
3
+ "version": "1.2.946",
4
4
  "description": "CamStack builtins — shipped inside @camstack/server (generated, do not edit)",
5
5
  "license": "MIT",
6
6
  "camstack": {
@@ -365,6 +365,21 @@
365
365
  }
366
366
  ]
367
367
  },
368
+ {
369
+ "id": "apps-aggregator",
370
+ "category": "system",
371
+ "name": "Apps Aggregator",
372
+ "icon": "assets/apps-aggregator/icon.svg",
373
+ "color": "#4f46e5",
374
+ "description": "Hub-only singleton that aggregates `app-source` (collection) providers and emits the role-filtered `apps.listApps` surface the viewer shell reads.",
375
+ "entry": "./dist/builtins/apps-aggregator/index.js",
376
+ "protected": true,
377
+ "capabilities": [
378
+ {
379
+ "name": "apps"
380
+ }
381
+ ]
382
+ },
368
383
  {
369
384
  "id": "addon-widgets-aggregator",
370
385
  "category": "system",