@camstack/types 1.2.544 → 1.2.545

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
- const require_sleep = require("./sleep-CiqzUHwB.js");
2
+ const require_sleep = require("./sleep-vzHEmsrO.js");
3
3
  const require_event_category = require("./event-category-BC4RRerT.js");
4
4
  const require_composed_stable_id = require("./composed-stable-id-DrGLxjVF.js");
5
5
  const require_implemented_methods = require("./implemented-methods-8AU92riC.js");
@@ -46252,7 +46252,7 @@ async function runFanOut(calls, invoke) {
46252
46252
  //#region src/generated/history-catalog.ts
46253
46253
  /**
46254
46254
  * Cap history catalog, projected from every `*.cap.ts` `history` block.
46255
- * 44 caps with series (87 series), 37 caps answered `'none'`.
46255
+ * 44 caps with series (89 series), 36 caps answered `'none'`.
46256
46256
  * Field keys are `runtimeState` paths (`a.b` into fixed objects only).
46257
46257
  */
46258
46258
  var HISTORY_CATALOG = {
@@ -46528,6 +46528,8 @@ var HISTORY_CATALOG = {
46528
46528
  minIntervalMs: 3e4
46529
46529
  } },
46530
46530
  "pet-feeder": {
46531
+ "feeding": { kind: "boolean" },
46532
+ "eating": { kind: "boolean" },
46531
46533
  "foodLevel": { kind: "gauge" },
46532
46534
  "bowlFood": { kind: "gauge" },
46533
46535
  "food1": { kind: "gauge" },
@@ -46736,7 +46738,6 @@ var HISTORY_NONE_CAPS = [
46736
46738
  "color",
46737
46739
  "control",
46738
46740
  "day-night",
46739
- "device-discovery",
46740
46741
  "doorbell",
46741
46742
  "event-emitter",
46742
46743
  "feature-probe",
@@ -49577,29 +49578,37 @@ var deviceAdminLinkCapability = {
49577
49578
  getAdminLink: require_sleep.method(zod.z.object({ deviceId: zod.z.number().int().nonnegative() }), DeviceAdminLinkSchema.nullable(), { auth: "admin" }) }
49578
49579
  };
49579
49580
  //#endregion
49580
- //#region src/capabilities/device-discovery.cap.ts
49581
- /**
49582
- * device-discovery — device-scoped capability for parents that host /
49583
- * enumerate child devices (Reolink Hub / NVR, ONVIF gateway, future
49584
- * integrations). The parent advertises a list of discoverable children,
49585
- * and the operator promotes a subset to real devices via `adoptDevice`.
49586
- * Child lifecycle (kernel device create/remove, parent reference) is
49587
- * owned by the framework so a single shared `<DiscoveryPanel />` can
49588
- * drive any integration.
49589
- *
49590
- * Boundaries:
49591
- * - The cap exposes ENUMERATION + ADOPT/RELEASE only. The protocol
49592
- * used to discover children (CGI poll, mDNS, push from hub, ...)
49593
- * is the integration's business; results land in `runtimeState`
49594
- * so the panel can render without a fresh round-trip.
49595
- * - `childNativeId` is integration-defined and must be stable across
49596
- * reboots so re-discovery doesn't duplicate adopted children.
49597
- * - `adoptDevice` returns the new `deviceId` so the UI can navigate
49598
- * directly to the freshly-created child's settings page.
49599
- */
49600
- /**
49601
- * Status enum for a discovered device. Mirrors the Reolink simpleEvent
49602
- * lifecycle (`online` / `sleeping` / `offline`) — generic enough for
49581
+ //#region src/capabilities/device-adoption.cap.ts
49582
+ /**
49583
+ * `device-adoption` — generic discovery + adoption surface,
49584
+ * system-scoped collection (one provider per integration addon), routed
49585
+ * by explicit `{ addonId }` on direct `deviceAdoption.*` calls — the same
49586
+ * pin model as `connection-test`. The admin UI keeps using
49587
+ * `deviceManager.adoption*` (which already threads `addonId`). The de-HA-ified
49588
+ * successor to `ha-discovery`:
49589
+ * keyed by `integrationId` (the addon resolves integrationId → broker
49590
+ * internally) rather than a connection-specific `brokerId`, and it
49591
+ * OWNS the shared `DiscoveredChildDevice` candidate type
49592
+ * (declared below) so a single shared adoption modal renders any integration's
49593
+ * candidate tree.
49594
+ *
49595
+ * UI flow (Integrations page → integration detail):
49596
+ * 1. `listCandidates({integrationId, page, pageSize, filter})` →
49597
+ * paginated candidate list, each row collapsed.
49598
+ * 2. User expands a row → `getCandidate({integrationId,
49599
+ * childNativeId})` returns the single candidate (with its nested
49600
+ * `children`) for the accordion render.
49601
+ * 3. User clicks "Adopt" on one or more candidates →
49602
+ * `adopt({integrationId, childNativeIds, perCandidate?})`
49603
+ * materialises one parent CamStack device per candidate plus its
49604
+ * accessory children. `perCandidate[childNativeId]` carries an
49605
+ * optional display-name override + a `hiddenChildIds` pre-hide set
49606
+ * (the parent's `accessories.hiddenChildIds` gates UI visibility).
49607
+ * 4. User clicks "Release" → `release({integrationId, camDeviceId})`
49608
+ * removes the parent + every child from the kernel registry.
49609
+ */
49610
+ /**
49611
+ * Status enum for a discovered device. Generic enough for
49603
49612
  * battery cams, awake cams, and unreachable cams alike.
49604
49613
  */
49605
49614
  var DiscoveredChildStatusSchema = zod.z.enum([
@@ -49616,12 +49625,12 @@ var DiscoveredChildDeviceSchema = zod.z.lazy(() => zod.z.object({
49616
49625
  /** DeviceType the child should be created with on adopt. */
49617
49626
  type: zod.z.enum(require_composed_stable_id.DeviceType),
49618
49627
  status: DiscoveredChildStatusSchema,
49619
- /** Free-form integration-specific metadata surfaced in the panel. */
49628
+ /** Free-form integration-specific metadata surfaced in the adoption modal. */
49620
49629
  metadata: zod.z.object({
49621
49630
  model: zod.z.string().optional(),
49622
49631
  serialNumber: zod.z.string().optional(),
49623
49632
  uid: zod.z.string().optional(),
49624
- /** Reolink: 0-based channel index inside the parent NVR/Hub. */
49633
+ /** Reolink: 0-based channel index inside the parent NVR. */
49625
49634
  rtspChannel: zod.z.number().int().nonnegative().optional(),
49626
49635
  isBattery: zod.z.boolean().optional(),
49627
49636
  isDoorbell: zod.z.boolean().optional(),
@@ -49637,139 +49646,24 @@ var DiscoveredChildDeviceSchema = zod.z.lazy(() => zod.z.object({
49637
49646
  }).default({}),
49638
49647
  /**
49639
49648
  * `true` when the framework already created a child device for this
49640
- * `childNativeId` under the current parent. The panel uses it to
49649
+ * `childNativeId` under the current parent. The adoption modal uses it to
49641
49650
  * gate the Add/Remove button and surface the existing `deviceId`.
49642
49651
  */
49643
49652
  alreadyAdopted: zod.z.boolean(),
49644
49653
  /** When `alreadyAdopted=true`, the framework-assigned child device id. */
49645
49654
  adoptedDeviceId: zod.z.number().int().nonnegative().nullable(),
49646
- /** Capability names the candidate advertises — integrations populate, Hubs omit. */
49655
+ /** Capability names the candidate advertises — integrations populate, flat enumerations omit. */
49647
49656
  capabilities: zod.z.array(zod.z.string()).readonly().optional(),
49648
- /** Feature flags the candidate advertises — integrations populate, Hubs omit. */
49657
+ /** Feature flags the candidate advertises — integrations populate, flat enumerations omit. */
49649
49658
  features: zod.z.array(zod.z.string()).readonly().optional(),
49650
49659
  /** Upstream-system identity + rendering hints for the candidate. */
49651
49660
  sourceInfo: SourceInfoSchema.optional(),
49652
- /** Nested entity-children for accordion preview — integrations populate, Hubs omit. */
49661
+ /** Nested entity-children for accordion preview — integrations populate, flat enumerations omit. */
49653
49662
  children: zod.z.array(DiscoveredChildDeviceSchema).readonly().optional(),
49654
49663
  /** `childNativeId` of the gateway candidate in the same list this device sits behind. */
49655
49664
  parentStableId: zod.z.string().optional()
49656
49665
  }));
49657
49666
  /**
49658
- * Status block — populated by the integration after each
49659
- * `refreshDiscovery` (or push-driven update). The runtime-state slice
49660
- * is what the panel reads via the per-device proxy; `getStatus`
49661
- * returns the same payload via the codegen'd auto-injection.
49662
- */
49663
- var DeviceDiscoveryStatusSchema = zod.z.object({
49664
- discovered: zod.z.array(DiscoveredChildDeviceSchema),
49665
- /** Wall-clock ms of the last successful enumeration. */
49666
- lastDiscoveryAt: zod.z.number().int().nonnegative().nullable(),
49667
- /** Last error surfaced from the source (rendered as a banner). */
49668
- lastError: zod.z.string().nullable()
49669
- });
49670
- var deviceDiscoveryCapability = {
49671
- name: "device-discovery",
49672
- scope: "device",
49673
- deviceNative: true,
49674
- mode: "singleton",
49675
- deviceTypes: [require_composed_stable_id.DeviceType.Hub],
49676
- status: {
49677
- schema: DeviceDiscoveryStatusSchema,
49678
- kind: "poll"
49679
- },
49680
- runtimeState: DeviceDiscoveryStatusSchema.extend({ lastFetchedAt: zod.z.number().int().nonnegative() }),
49681
- /**
49682
- * Runtime-state durability: **session** — 5.7 KB of scan output on the largest device, fully re-derivable by re-scanning.
49683
- *
49684
- * See `RuntimeStateDurability`. Enforced by
49685
- * `scripts/check-runtime-state-durability.ts`.
49686
- */
49687
- durability: "session",
49688
- /**
49689
- * History (D850): none — inventory.
49690
- */
49691
- history: "none",
49692
- methods: {
49693
- /**
49694
- * Snapshot of the current `discovered` list. Returns the
49695
- * runtime-state cache — call `refreshDiscovery` first if a
49696
- * fresh round-trip to the source is required.
49697
- */
49698
- listDiscovered: require_sleep.method(zod.z.object({ deviceId: zod.z.number().int().nonnegative() }), zod.z.array(DiscoveredChildDeviceSchema).readonly()),
49699
- /**
49700
- * Force the integration to re-enumerate and update the
49701
- * runtime-state slice. Returns the freshly-enumerated list (also
49702
- * available via `listDiscovered` post-call).
49703
- */
49704
- refreshDiscovery: require_sleep.method(zod.z.object({ deviceId: zod.z.number().int().nonnegative() }), zod.z.array(DiscoveredChildDeviceSchema).readonly(), {
49705
- kind: "mutation",
49706
- auth: "admin"
49707
- }),
49708
- /**
49709
- * Promote a discovered entry to a real child device. The framework
49710
- * creates the child via `kernel.devices.create()` with
49711
- * `parentDeviceId = parent.id` and seeds the child's config from
49712
- * `childInitialConfig` (driver-defined; usually carries channel +
49713
- * uid + parent reference). Returns the kernel-assigned numeric id.
49714
- */
49715
- adoptDevice: require_sleep.method(zod.z.object({
49716
- deviceId: zod.z.number().int().nonnegative(),
49717
- childNativeId: zod.z.string(),
49718
- /** Optional override for the child's display name. */
49719
- name: zod.z.string().optional()
49720
- }), zod.z.object({
49721
- deviceId: zod.z.number().int().nonnegative(),
49722
- stableId: zod.z.string()
49723
- }), {
49724
- kind: "mutation",
49725
- auth: "admin"
49726
- }),
49727
- /**
49728
- * Inverse of `adoptDevice`: removes the child device from the
49729
- * kernel registry. The discovered entry remains in the
49730
- * enumeration (status updates resume) so the operator can re-adopt
49731
- * it later without a fresh refresh.
49732
- */
49733
- releaseDevice: require_sleep.method(zod.z.object({
49734
- deviceId: zod.z.number().int().nonnegative(),
49735
- childDeviceId: zod.z.number().int().nonnegative()
49736
- }), zod.z.void(), {
49737
- kind: "mutation",
49738
- auth: "admin"
49739
- })
49740
- }
49741
- };
49742
- //#endregion
49743
- //#region src/capabilities/device-adoption.cap.ts
49744
- /**
49745
- * `device-adoption` — generic discovery + adoption surface,
49746
- * system-scoped collection (one provider per integration addon), routed
49747
- * by explicit `{ addonId }` on direct `deviceAdoption.*` calls — the same
49748
- * pin model as `connection-test`. The admin UI keeps using
49749
- * `deviceManager.adoption*` (which already threads `addonId`). The de-HA-ified
49750
- * successor to `ha-discovery`:
49751
- * keyed by `integrationId` (the addon resolves integrationId → broker
49752
- * internally) rather than a connection-specific `brokerId`, and it
49753
- * REUSES the shared `DiscoveredChildDevice` candidate type from
49754
- * `device-discovery.cap.ts` so a single shared adoption panel renders
49755
- * any integration's candidate tree.
49756
- *
49757
- * UI flow (Integrations page → integration detail):
49758
- * 1. `listCandidates({integrationId, page, pageSize, filter})` →
49759
- * paginated candidate list, each row collapsed.
49760
- * 2. User expands a row → `getCandidate({integrationId,
49761
- * childNativeId})` returns the single candidate (with its nested
49762
- * `children`) for the accordion render.
49763
- * 3. User clicks "Adopt" on one or more candidates →
49764
- * `adopt({integrationId, childNativeIds, perCandidate?})`
49765
- * materialises one parent CamStack device per candidate plus its
49766
- * accessory children. `perCandidate[childNativeId]` carries an
49767
- * optional display-name override + a `hiddenChildIds` pre-hide set
49768
- * (the parent's `accessories.hiddenChildIds` gates UI visibility).
49769
- * 4. User clicks "Release" → `release({integrationId, camDeviceId})`
49770
- * removes the parent + every child from the kernel registry.
49771
- */
49772
- /**
49773
49667
  * Provider-declared discovery *granularity* filter (the keystone of the
49774
49668
  * single-entity-import design). A provider advertises which discovery
49775
49669
  * granularities it supports via `listCandidateFilters`; the operator picks
@@ -76435,9 +76329,13 @@ var petFeederCapability = {
76435
76329
  */
76436
76330
  durability: "session",
76437
76331
  /**
76438
- * History (D850): recorded series.
76332
+ * History (D850): recorded series. `feeding` / `eating` are the meals the
76333
+ * device hero's "Meals" button names — change-only booleans, so a dispense
76334
+ * or a pet at the bowl is one span on the history.
76439
76335
  */
76440
76336
  history: { fields: {
76337
+ feeding: { kind: "boolean" },
76338
+ eating: { kind: "boolean" },
76441
76339
  foodLevel: { kind: "gauge" },
76442
76340
  bowlFood: { kind: "gauge" },
76443
76341
  food1: { kind: "gauge" },
@@ -91469,7 +91367,6 @@ var CAPABILITY_NAMES = {
91469
91367
  deviceAdminLink: "device-admin-link",
91470
91368
  deviceAdoption: "device-adoption",
91471
91369
  deviceCredentials: "device-credentials",
91472
- deviceDiscovery: "device-discovery",
91473
91370
  deviceExport: "device-export",
91474
91371
  deviceExtension: "device-extension",
91475
91372
  deviceHistory: "device-history",
@@ -91840,10 +91737,6 @@ var CAPABILITY_ROUTER_KEYS = [
91840
91737
  key: "deviceCredentials",
91841
91738
  name: "device-credentials"
91842
91739
  },
91843
- {
91844
- key: "deviceDiscovery",
91845
- name: "device-discovery"
91846
- },
91847
91740
  {
91848
91741
  key: "deviceExport",
91849
91742
  name: "device-export"
@@ -92513,7 +92406,6 @@ var ALL_CAPABILITY_DEFINITIONS = [
92513
92406
  deviceAdminLinkCapability,
92514
92407
  deviceAdoptionCapability,
92515
92408
  deviceCredentialsCapability,
92516
- deviceDiscoveryCapability,
92517
92409
  deviceExportCapability,
92518
92410
  deviceExtensionCapability,
92519
92411
  deviceHistoryCapability,
@@ -100091,7 +99983,6 @@ var DEVICE_LOCAL_STATE_CAPS = {
100091
99983
  control: controlCapability,
100092
99984
  cover: coverCapability,
100093
99985
  dayNight: dayNightCapability,
100094
- deviceDiscovery: deviceDiscoveryCapability,
100095
99986
  deviceStatus: deviceStatusCapability,
100096
99987
  dishwasher: dishwasherCapability,
100097
99988
  doNotDisturb: doNotDisturbCapability,
@@ -106355,7 +106246,6 @@ var HERO_CAP_COVERAGE = {
106355
106246
  "day-night": { none: NOT_A_HERO_FACT },
106356
106247
  "detection-pipeline": { none: NOT_A_HERO_FACT },
106357
106248
  "device-admin-link": { none: NOT_A_HERO_FACT },
106358
- "device-discovery": { none: NOT_A_HERO_FACT },
106359
106249
  "device-extension": { none: NOT_A_HERO_FACT },
106360
106250
  "device-ops": { none: NOT_A_HERO_FACT },
106361
106251
  "device-runs": { none: NOT_A_HERO_FACT },
@@ -108286,41 +108176,6 @@ var METHOD_ACCESS_MAP = Object.freeze({
108286
108176
  access: "create",
108287
108177
  role: "admin"
108288
108178
  },
108289
- "deviceDiscovery.adoptDevice": {
108290
- capName: "device-discovery",
108291
- capScope: "device",
108292
- addonId: null,
108293
- access: "create",
108294
- role: "admin"
108295
- },
108296
- "deviceDiscovery.getStatus": {
108297
- capName: "device-discovery",
108298
- capScope: "device",
108299
- addonId: null,
108300
- access: "view",
108301
- role: "viewer"
108302
- },
108303
- "deviceDiscovery.listDiscovered": {
108304
- capName: "device-discovery",
108305
- capScope: "device",
108306
- addonId: null,
108307
- access: "view",
108308
- role: "viewer"
108309
- },
108310
- "deviceDiscovery.refreshDiscovery": {
108311
- capName: "device-discovery",
108312
- capScope: "device",
108313
- addonId: null,
108314
- access: "create",
108315
- role: "admin"
108316
- },
108317
- "deviceDiscovery.releaseDevice": {
108318
- capName: "device-discovery",
108319
- capScope: "device",
108320
- addonId: null,
108321
- access: "create",
108322
- role: "admin"
108323
- },
108324
108179
  "deviceExport.applyDeviceSettingsPatch": {
108325
108180
  capName: "device-export",
108326
108181
  capScope: "system",
@@ -116904,7 +116759,6 @@ var KNOWN_CAP_NAMES = [
116904
116759
  "device-admin-link",
116905
116760
  "device-adoption",
116906
116761
  "device-credentials",
116907
- "device-discovery",
116908
116762
  "device-export",
116909
116763
  "device-extension",
116910
116764
  "device-history",
@@ -117085,7 +116939,6 @@ var DEVICE_CAP_NAMES = [
117085
116939
  "day-night",
117086
116940
  "detection-pipeline",
117087
116941
  "device-admin-link",
117088
- "device-discovery",
117089
116942
  "device-extension",
117090
116943
  "device-ops",
117091
116944
  "device-runs",
@@ -119178,7 +119031,6 @@ var CAP_NAMES_WITH_STATUS = [
119178
119031
  "cover",
119179
119032
  "day-night",
119180
119033
  "device-adoption",
119181
- "device-discovery",
119182
119034
  "device-export",
119183
119035
  "device-status",
119184
119036
  "dishwasher",
@@ -119675,35 +119527,6 @@ var METHOD_DEVICE_SELECTORS = Object.freeze({
119675
119527
  form: "single",
119676
119528
  optional: false
119677
119529
  }],
119678
- "deviceDiscovery.adoptDevice": [{
119679
- name: "deviceId",
119680
- form: "single",
119681
- optional: false
119682
- }],
119683
- "deviceDiscovery.getStatus": [{
119684
- name: "deviceId",
119685
- form: "single",
119686
- optional: false
119687
- }],
119688
- "deviceDiscovery.listDiscovered": [{
119689
- name: "deviceId",
119690
- form: "single",
119691
- optional: false
119692
- }],
119693
- "deviceDiscovery.refreshDiscovery": [{
119694
- name: "deviceId",
119695
- form: "single",
119696
- optional: false
119697
- }],
119698
- "deviceDiscovery.releaseDevice": [{
119699
- name: "childDeviceId",
119700
- form: "single",
119701
- optional: false
119702
- }, {
119703
- name: "deviceId",
119704
- form: "single",
119705
- optional: false
119706
- }],
119707
119530
  "deviceExport.applyDeviceSettingsPatch": [{
119708
119531
  name: "deviceId",
119709
119532
  form: "single",
@@ -122599,7 +122422,7 @@ function getCapsByProviderKind(kind) {
122599
122422
  //#region src/generated/runtime-state-durability.ts
122600
122423
  /**
122601
122424
  * Per-cap runtime-state policy, projected from every `*.cap.ts` that declares
122602
- * `runtimeState`. 82 caps: 41 `restored`, 41 `session`.
122425
+ * `runtimeState`. 81 caps: 41 `restored`, 40 `session`.
122603
122426
  *
122604
122427
  * A cap absent from this map has no runtime-state slice at all. A cap PRESENT
122605
122428
  * with `durability: 'session'` has one and has decided not to keep it.
@@ -122678,10 +122501,6 @@ var RUNTIME_STATE_POLICY = {
122678
122501
  durability: "restored",
122679
122502
  volatileFields: ["lastFetchedAt"]
122680
122503
  },
122681
- "device-discovery": {
122682
- durability: "session",
122683
- volatileFields: []
122684
- },
122685
122504
  "device-status": {
122686
122505
  durability: "restored",
122687
122506
  volatileFields: ["lastChangedAt"]
@@ -136806,7 +136625,6 @@ exports.DeviceConfig = DeviceConfig;
136806
136625
  exports.DeviceCredentialSchema = DeviceCredentialSchema;
136807
136626
  exports.DeviceCredentialStatusSchema = DeviceCredentialStatusSchema;
136808
136627
  exports.DeviceDataEntrySchema = DeviceDataEntrySchema;
136809
- exports.DeviceDiscoveryStatusSchema = DeviceDiscoveryStatusSchema;
136810
136628
  exports.DeviceEnrollProofSchema = DeviceEnrollProofSchema;
136811
136629
  exports.DeviceExportExposeInputSchema = ExposeInputSchema;
136812
136630
  exports.DeviceExportInstancePinSchema = InstancePinSchema;
@@ -139023,7 +138841,6 @@ exports.deviceAttentionKind = deviceAttentionKind;
139023
138841
  exports.deviceBackendToFormat = deviceBackendToFormat;
139024
138842
  exports.deviceCredentialsCapability = deviceCredentialsCapability;
139025
138843
  exports.deviceCustomAction = require_sleep.deviceCustomAction;
139026
- exports.deviceDiscoveryCapability = deviceDiscoveryCapability;
139027
138844
  exports.deviceDoFamily = deviceDoFamily;
139028
138845
  exports.deviceExportCapability = deviceExportCapability;
139029
138846
  exports.deviceExportStatusInstanceOf = statusInstanceOf;