@camstack/types 1.1.21 → 1.1.22

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-DaQgDq90.js");
2
+ const require_sleep = require("./sleep-B8cp-HUn.js");
3
3
  const require_err_msg = require("./err-msg-COpsHMw2.js");
4
4
  let zod = require("zod");
5
5
  //#region src/health/wiring-health.ts
@@ -6959,7 +6959,8 @@ var motionDetectionCapability = {
6959
6959
  methods: {
6960
6960
  analyze: require_sleep.method(zod.z.object({
6961
6961
  deviceId: zod.z.number(),
6962
- frame: FrameInputSchema
6962
+ frame: FrameInputSchema.optional(),
6963
+ frameHandle: require_sleep.FrameHandleSchema.optional()
6963
6964
  }), MotionAnalysisResultSchema, { kind: "mutation" }),
6964
6965
  removeCamera: require_sleep.method(zod.z.object({ deviceId: zod.z.number() }), zod.z.void(), { kind: "mutation" }),
6965
6966
  reset: require_sleep.method(zod.z.void(), zod.z.void(), { kind: "mutation" })
@@ -7277,11 +7278,20 @@ var pipelineExecutorCapability = {
7277
7278
  * legacy call shape used by existing benchmark code; once all
7278
7279
  * callers pass it explicitly we make it required.
7279
7280
  *
7280
- * Exactly one of `frame`, `imageBase64`, `referenceImage` must be
7281
- * provided:
7281
+ * Exactly one of `frame`, `frameHandle`, `imageBase64`,
7282
+ * `referenceImage` must be provided:
7282
7283
  * - `frame`: runtime dispatch path (runner → decoded broker frame).
7283
7284
  * Carries the raw buffer, dimensions, and format; the executor
7284
7285
  * uses it directly without base64 round-tripping.
7286
+ * - `frameHandle` (CB5): a zero-pixel shm `FrameHandle` for the SAME
7287
+ * decoded frame. Both runner and executor are hub-local processes
7288
+ * sharing `/dev/shm`, so the executor maps the named segment and
7289
+ * reads the pixels back zero-copy — eliminating the ~1.2MB
7290
+ * re-serialisation over UDS/MsgPack the `frame` path pays per call.
7291
+ * High-risk: the FrameRing is a latest-wins seqlock with no
7292
+ * refcount, so a recycled slot yields a null read; the executor
7293
+ * then degrades to an empty result and the runner ships pixels via
7294
+ * `frame` as the fallback (queue-depth gated on the runner side).
7285
7295
  * - `imageBase64`: one-shot test path (benchmark ImageTab).
7286
7296
  * - `referenceImage`: named file from the reference-image store.
7287
7297
  */
@@ -7289,6 +7299,12 @@ var pipelineExecutorCapability = {
7289
7299
  engine: PipelineEngineChoiceSchema.optional(),
7290
7300
  steps: zod.z.array(PipelineStepInputSchema).min(1),
7291
7301
  frame: FrameInputSchema.optional(),
7302
+ /**
7303
+ * CB5 shm passthrough — a `FrameHandle` naming the same ring slot
7304
+ * the decoded pixels live in. One more member of the one-of
7305
+ * frame/frameHandle/image/imageBase64/referenceImage group.
7306
+ */
7307
+ frameHandle: require_sleep.FrameHandleSchema.optional(),
7292
7308
  imageBase64: zod.z.string().optional(),
7293
7309
  /**
7294
7310
  * Binary JPEG bytes — preferred over `imageBase64` on internal
@@ -8452,6 +8468,191 @@ var numericSensorCapability = {
8452
8468
  runtimeState: NumericSensorStatusSchema
8453
8469
  };
8454
8470
  //#endregion
8471
+ //#region src/capabilities/pet-feeder.cap.ts
8472
+ /**
8473
+ * PetKit pet-feeder cap. Models the control + telemetry surface of a
8474
+ * cloud-connected smart feeder (Fresh Element / Mini / D3 / D4 / D4S
8475
+ * Gemini / D4H / D4SH) as a single coherent slice — bowl food level,
8476
+ * battery, desiccant life, feeding state + the four persisted settings
8477
+ * (child-lock / indicator-light / feed-sound / volume).
8478
+ *
8479
+ * Sources: native PetKit (`nodepetkit` `FeederDevice`). Reusable by any
8480
+ * feeder integration that speaks the same food/desiccant/hopper surface.
8481
+ *
8482
+ * `kind: 'poll'` — PetKit exposes only a cloud REST API (no push
8483
+ * channel), so the provider refreshes the slice on a poll interval and
8484
+ * eagerly after every command.
8485
+ *
8486
+ * Dual-hopper feeders (D4S/D4SH) split the bowl into two independent
8487
+ * hoppers. `isDualHopper` gates the two-hopper UI; `food1`/`food2` carry
8488
+ * the per-hopper levels (both `null` on single-hopper models, where
8489
+ * `foodLevel` is the single reading). The manual-feed portion honours the
8490
+ * PetKit hardware range 4–200 g in 1 g steps.
8491
+ *
8492
+ * Device status is exposed both raw and decoded, mirroring PetKit's HA
8493
+ * integration (RobertD502/py-petkit-api). `status` is the connectivity /
8494
+ * power enum (`normal` / `offline` / `on_batteries`); `error` is the
8495
+ * decoded human-readable fault message (null / `no_error` = healthy);
8496
+ * `errorCode` keeps the raw device integer (0 / null = no error) so a
8497
+ * provider that only has the numeric code stays lossless. A provider maps
8498
+ * the library's fields onto these; any it cannot determine stays `null`.
8499
+ */
8500
+ /** PetKit manual-feed portion bounds (grams). Mirrors the HA `manual_feed`
8501
+ * number entity (min 4, max 200, step 1, device_class weight). */
8502
+ var PET_FEEDER_MANUAL_FEED_MIN = 4;
8503
+ var PET_FEEDER_MANUAL_FEED_MAX = 200;
8504
+ /**
8505
+ * Feeder connectivity / power status — mirrors the HA petkit device-status
8506
+ * enum: `normal` (online, mains), `offline` (not reaching PetKit cloud),
8507
+ * `on_batteries` (running on battery backup). `null` until first reported.
8508
+ */
8509
+ var PetFeederDeviceStatusSchema = zod.z.enum([
8510
+ "normal",
8511
+ "offline",
8512
+ "on_batteries"
8513
+ ]);
8514
+ var gramsPortion = zod.z.number().int().min(4).max(200);
8515
+ var PetFeederStatusSchema = zod.z.object({
8516
+ /** Food currently in the bowl (grams). Null when the device has not
8517
+ * reported a reading yet. On dual-hopper models this is the combined
8518
+ * bowl reading; per-hopper levels live in `food1`/`food2`. */
8519
+ foodLevel: zod.z.number().nullable(),
8520
+ /** Hopper-1 food level (grams) on dual-hopper feeders; null on
8521
+ * single-hopper models. */
8522
+ food1: zod.z.number().nullable(),
8523
+ /** Hopper-2 food level (grams) on dual-hopper feeders; null on
8524
+ * single-hopper models. */
8525
+ food2: zod.z.number().nullable(),
8526
+ /** Derived low-food flag — mirrors the HA `food_level` binary_sensor
8527
+ * (`device_class: problem`, on = low). True when the bowl is empty /
8528
+ * below the feeder's low threshold. */
8529
+ lowFood: zod.z.boolean(),
8530
+ /** Battery charge 0..100 (%). Null on mains-powered models or when the
8531
+ * device has no battery reading. */
8532
+ batteryPower: zod.z.number().min(0).max(100).nullable(),
8533
+ /** Days of desiccant life remaining. Null when the model has no
8534
+ * desiccant sensor. */
8535
+ desiccantLeftDays: zod.z.number().nullable(),
8536
+ /** True while a feed is in progress. */
8537
+ feeding: zod.z.boolean(),
8538
+ /** Decoded connectivity / power status (HA petkit device-status enum).
8539
+ * Null until the device has reported a status. */
8540
+ status: PetFeederDeviceStatusSchema.nullable(),
8541
+ /** Decoded human-readable fault message. Null (or the device's `no_error`
8542
+ * sentinel) means healthy; a non-null string is an active fault. Pairs
8543
+ * with `errorCode` for consumers that want the raw integer. */
8544
+ error: zod.z.string().nullable(),
8545
+ /** Raw device error code (0 / null = no error). */
8546
+ errorCode: zod.z.number().nullable(),
8547
+ /** True for D4S/D4SH dual-hopper hardware — gates the per-hopper UI. */
8548
+ isDualHopper: zod.z.boolean(),
8549
+ /** Child-lock (manual-lock) setting — buttons on the unit are disabled. */
8550
+ childLock: zod.z.boolean(),
8551
+ /** Front indicator-light setting. */
8552
+ indicatorLight: zod.z.boolean(),
8553
+ /** Play a chime when dispensing. */
8554
+ feedSound: zod.z.boolean(),
8555
+ /** Speaker / prompt volume level (device-scaled integer). */
8556
+ volume: zod.z.number(),
8557
+ /** Ms epoch when the slice was last refreshed from the cloud. */
8558
+ lastFetchedAt: zod.z.number()
8559
+ });
8560
+ var petFeederCapability = {
8561
+ name: "pet-feeder",
8562
+ scope: "device",
8563
+ deviceNative: true,
8564
+ mode: "singleton",
8565
+ deviceTypes: [require_sleep.DeviceType.PetFeeder],
8566
+ methods: {
8567
+ /**
8568
+ * Dispense food now. Single-hopper feeders take `grams`; dual-hopper
8569
+ * feeders (D4S/D4SH) accept `hopper1`/`hopper2` to target one or both
8570
+ * hoppers. All portions honour the 4–200 g hardware range. At least
8571
+ * one of the three must be present — the provider rejects an empty
8572
+ * request.
8573
+ */
8574
+ feed: require_sleep.method(zod.z.object({
8575
+ deviceId: zod.z.number().int().nonnegative(),
8576
+ grams: gramsPortion.optional(),
8577
+ hopper1: gramsPortion.optional(),
8578
+ hopper2: gramsPortion.optional()
8579
+ }), zod.z.void(), {
8580
+ kind: "mutation",
8581
+ auth: "admin"
8582
+ }),
8583
+ /** Cancel an in-progress manual feed. */
8584
+ cancelFeed: require_sleep.method(zod.z.object({ deviceId: zod.z.number().int().nonnegative() }), zod.z.void(), {
8585
+ kind: "mutation",
8586
+ auth: "admin"
8587
+ }),
8588
+ /** Reset the desiccant "days remaining" counter after replacing it. */
8589
+ resetDesiccant: require_sleep.method(zod.z.object({ deviceId: zod.z.number().int().nonnegative() }), zod.z.void(), {
8590
+ kind: "mutation",
8591
+ auth: "admin"
8592
+ }),
8593
+ /** Mark a hopper as refilled (D4H/D4S/D4SH). */
8594
+ markFoodReplenished: require_sleep.method(zod.z.object({ deviceId: zod.z.number().int().nonnegative() }), zod.z.void(), {
8595
+ kind: "mutation",
8596
+ auth: "admin"
8597
+ }),
8598
+ /** Call the pet with the recorded prompt (D3). */
8599
+ callPet: require_sleep.method(zod.z.object({ deviceId: zod.z.number().int().nonnegative() }), zod.z.void(), {
8600
+ kind: "mutation",
8601
+ auth: "admin"
8602
+ }),
8603
+ /** Play a stored sound by id (D3 / D4H / D4SH). */
8604
+ playSound: require_sleep.method(zod.z.object({
8605
+ deviceId: zod.z.number().int().nonnegative(),
8606
+ soundId: zod.z.number().int().nonnegative()
8607
+ }), zod.z.void(), {
8608
+ kind: "mutation",
8609
+ auth: "admin"
8610
+ }),
8611
+ /** Toggle the child-lock (manual-lock) setting. */
8612
+ setChildLock: require_sleep.method(zod.z.object({
8613
+ deviceId: zod.z.number().int().nonnegative(),
8614
+ on: zod.z.boolean()
8615
+ }), zod.z.void(), {
8616
+ kind: "mutation",
8617
+ auth: "admin"
8618
+ }),
8619
+ /** Toggle the front indicator light. */
8620
+ setIndicatorLight: require_sleep.method(zod.z.object({
8621
+ deviceId: zod.z.number().int().nonnegative(),
8622
+ on: zod.z.boolean()
8623
+ }), zod.z.void(), {
8624
+ kind: "mutation",
8625
+ auth: "admin"
8626
+ }),
8627
+ /** Toggle the dispense chime. */
8628
+ setFeedSound: require_sleep.method(zod.z.object({
8629
+ deviceId: zod.z.number().int().nonnegative(),
8630
+ on: zod.z.boolean()
8631
+ }), zod.z.void(), {
8632
+ kind: "mutation",
8633
+ auth: "admin"
8634
+ }),
8635
+ /** Set the speaker / prompt volume level. */
8636
+ setVolume: require_sleep.method(zod.z.object({
8637
+ deviceId: zod.z.number().int().nonnegative(),
8638
+ level: zod.z.number().int().nonnegative()
8639
+ }), zod.z.void(), {
8640
+ kind: "mutation",
8641
+ auth: "admin"
8642
+ })
8643
+ },
8644
+ status: {
8645
+ schema: PetFeederStatusSchema,
8646
+ kind: "poll"
8647
+ },
8648
+ /**
8649
+ * Runtime-state slice — mirrored by the kernel. UI feeder cards read
8650
+ * the full slice via `device.state.petFeeder.value` and refresh on
8651
+ * every poll without re-querying the provider.
8652
+ */
8653
+ runtimeState: PetFeederStatusSchema
8654
+ };
8655
+ //#endregion
8455
8656
  //#region src/capabilities/power-meter.cap.ts
8456
8657
  /**
8457
8658
  * Multi-metric electrical meter. One slice can carry any combination
@@ -9908,6 +10109,7 @@ var DEVICE_LOCAL_STATE_CAPS = {
9908
10109
  nativeObjectDetection: nativeObjectDetectionCapability,
9909
10110
  notifier: notifierCapability,
9910
10111
  numericSensor: numericSensorCapability,
10112
+ petFeeder: petFeederCapability,
9911
10113
  powerMeter: powerMeterCapability,
9912
10114
  presence: presenceCapability,
9913
10115
  pressureSensor: pressureSensorCapability,
@@ -14077,11 +14279,13 @@ var decoderCapability = {
14077
14279
  }), zod.z.void()),
14078
14280
  pullFrames: require_sleep.method(zod.z.object({
14079
14281
  sessionId: zod.z.string(),
14080
- maxCount: zod.z.number().default(1)
14282
+ maxCount: zod.z.number().default(1),
14283
+ waitMs: zod.z.number().optional()
14081
14284
  }), zod.z.array(require_sleep.DecodedFrameSchema)),
14082
14285
  pullHandles: require_sleep.method(zod.z.object({
14083
14286
  sessionId: zod.z.string(),
14084
- maxCount: zod.z.number().default(1)
14287
+ maxCount: zod.z.number().default(1),
14288
+ waitMs: zod.z.number().optional()
14085
14289
  }), zod.z.array(require_sleep.FrameHandleSchema)),
14086
14290
  getFrame: require_sleep.method(zod.z.object({ handle: require_sleep.FrameHandleSchema }), require_sleep.DecodedFrameSchema.nullable()),
14087
14291
  getShmStats: require_sleep.method(zod.z.object({ sessionId: zod.z.string() }), ShmRingStatsSchema.nullable()),
@@ -20609,7 +20813,10 @@ var HwAccelBackendInputSchema = zod.z.enum([
20609
20813
  "webgpu",
20610
20814
  "none"
20611
20815
  ]).nullable().optional();
20612
- var HwAccelResolutionSchema = zod.z.object({ preferred: zod.z.array(zod.z.string()).readonly() });
20816
+ var HwAccelResolutionSchema = zod.z.object({
20817
+ preferred: zod.z.array(zod.z.string()).readonly(),
20818
+ rationale: zod.z.string()
20819
+ });
20613
20820
  var HardwareEncoderIdSchema = zod.z.enum([
20614
20821
  "h264_videotoolbox",
20615
20822
  "hevc_videotoolbox",
@@ -20723,10 +20930,7 @@ var platformProbeCapability = {
20723
20930
  getCapabilities: require_sleep.method(zod.z.void(), PlatformCapabilitiesSchema),
20724
20931
  getHardware: require_sleep.method(zod.z.void(), HardwareInfoSchema),
20725
20932
  resolveInferenceConfig: require_sleep.method(zod.z.object({ requirements: zod.z.array(ModelRequirementSchema).readonly() }), ResolvedInferenceConfigSchema),
20726
- resolveHwAccel: require_sleep.method(zod.z.object({
20727
- prefer: HwAccelBackendInputSchema,
20728
- nodeId: zod.z.string().optional()
20729
- }), HwAccelResolutionSchema),
20933
+ resolveHwAccel: require_sleep.method(zod.z.object({ prefer: HwAccelBackendInputSchema }), HwAccelResolutionSchema),
20730
20934
  /**
20731
20935
  * Hardware-encoder probe — see Task #185. Cached after first call.
20732
20936
  */
@@ -21828,6 +22032,7 @@ var CAPABILITY_NAMES = {
21828
22032
  numericSensor: "numeric-sensor",
21829
22033
  oauthIntegration: "oauth-integration",
21830
22034
  osd: "osd",
22035
+ petFeeder: "pet-feeder",
21831
22036
  pipelineAnalytics: "pipeline-analytics",
21832
22037
  pipelineExecutor: "pipeline-executor",
21833
22038
  pipelineOrchestrator: "pipeline-orchestrator",
@@ -22228,6 +22433,10 @@ var CAPABILITY_ROUTER_KEYS = [
22228
22433
  key: "osd",
22229
22434
  name: "osd"
22230
22435
  },
22436
+ {
22437
+ key: "petFeeder",
22438
+ name: "pet-feeder"
22439
+ },
22231
22440
  {
22232
22441
  key: "pipelineAnalytics",
22233
22442
  name: "pipeline-analytics"
@@ -22522,6 +22731,7 @@ var ALL_CAPABILITY_DEFINITIONS = [
22522
22731
  numericSensorCapability,
22523
22732
  oauthIntegrationCapability,
22524
22733
  osdCapability,
22734
+ petFeederCapability,
22525
22735
  pipelineAnalyticsCapability,
22526
22736
  pipelineExecutorCapability,
22527
22737
  pipelineOrchestratorCapability,
@@ -22624,6 +22834,7 @@ var CAP_NAMES_WITH_STATUS = [
22624
22834
  "notifier",
22625
22835
  "numeric-sensor",
22626
22836
  "osd",
22837
+ "pet-feeder",
22627
22838
  "power-meter",
22628
22839
  "presence",
22629
22840
  "pressure-sensor",
@@ -25090,6 +25301,66 @@ var METHOD_ACCESS_MAP = Object.freeze({
25090
25301
  addonId: null,
25091
25302
  access: "create"
25092
25303
  },
25304
+ "petFeeder.callPet": {
25305
+ capName: "pet-feeder",
25306
+ capScope: "device",
25307
+ addonId: null,
25308
+ access: "create"
25309
+ },
25310
+ "petFeeder.cancelFeed": {
25311
+ capName: "pet-feeder",
25312
+ capScope: "device",
25313
+ addonId: null,
25314
+ access: "create"
25315
+ },
25316
+ "petFeeder.feed": {
25317
+ capName: "pet-feeder",
25318
+ capScope: "device",
25319
+ addonId: null,
25320
+ access: "create"
25321
+ },
25322
+ "petFeeder.markFoodReplenished": {
25323
+ capName: "pet-feeder",
25324
+ capScope: "device",
25325
+ addonId: null,
25326
+ access: "create"
25327
+ },
25328
+ "petFeeder.playSound": {
25329
+ capName: "pet-feeder",
25330
+ capScope: "device",
25331
+ addonId: null,
25332
+ access: "create"
25333
+ },
25334
+ "petFeeder.resetDesiccant": {
25335
+ capName: "pet-feeder",
25336
+ capScope: "device",
25337
+ addonId: null,
25338
+ access: "delete"
25339
+ },
25340
+ "petFeeder.setChildLock": {
25341
+ capName: "pet-feeder",
25342
+ capScope: "device",
25343
+ addonId: null,
25344
+ access: "create"
25345
+ },
25346
+ "petFeeder.setFeedSound": {
25347
+ capName: "pet-feeder",
25348
+ capScope: "device",
25349
+ addonId: null,
25350
+ access: "create"
25351
+ },
25352
+ "petFeeder.setIndicatorLight": {
25353
+ capName: "pet-feeder",
25354
+ capScope: "device",
25355
+ addonId: null,
25356
+ access: "create"
25357
+ },
25358
+ "petFeeder.setVolume": {
25359
+ capName: "pet-feeder",
25360
+ capScope: "device",
25361
+ addonId: null,
25362
+ access: "create"
25363
+ },
25093
25364
  "pipelineAnalytics.clearTracks": {
25094
25365
  capName: "pipeline-analytics",
25095
25366
  capScope: "device",
@@ -27082,6 +27353,7 @@ var KNOWN_CAP_NAMES = [
27082
27353
  "notifier",
27083
27354
  "oauth-integration",
27084
27355
  "osd",
27356
+ "pet-feeder",
27085
27357
  "pipeline-analytics",
27086
27358
  "pipeline-executor",
27087
27359
  "pipeline-orchestrator",
@@ -27157,6 +27429,7 @@ var DEVICE_CAP_NAMES = [
27157
27429
  "native-object-detection",
27158
27430
  "notifier",
27159
27431
  "osd",
27432
+ "pet-feeder",
27160
27433
  "pipeline-analytics",
27161
27434
  "privacy-mask",
27162
27435
  "ptz",
@@ -28123,6 +28396,8 @@ exports.OsdOverlayPatchSchema = OsdOverlayPatchSchema;
28123
28396
  exports.OsdOverlaySchema = OsdOverlaySchema;
28124
28397
  exports.OsdPositionEnum = OsdPositionEnum;
28125
28398
  exports.OsdStatusSchema = OsdStatusSchema;
28399
+ exports.PET_FEEDER_MANUAL_FEED_MAX = PET_FEEDER_MANUAL_FEED_MAX;
28400
+ exports.PET_FEEDER_MANUAL_FEED_MIN = PET_FEEDER_MANUAL_FEED_MIN;
28126
28401
  exports.PIPELINE_FLOW_CAPABILITY_NAMES = PIPELINE_FLOW_CAPABILITY_NAMES;
28127
28402
  exports.PIPELINE_OWNER_CAPABILITY_NAMES = PIPELINE_OWNER_CAPABILITY_NAMES;
28128
28403
  exports.PROVIDER_KIND_CAP_NAMES = PROVIDER_KIND_CAP_NAMES;
@@ -28132,6 +28407,7 @@ exports.PackageVersionInfoSchema = PackageVersionInfoSchema;
28132
28407
  exports.PasskeySummarySchema = PasskeySummarySchema;
28133
28408
  exports.PcmSampleFormatSchema = PcmSampleFormatSchema;
28134
28409
  exports.PerScopeBreakdownSchema = PerScopeBreakdownSchema;
28410
+ exports.PetFeederStatusSchema = PetFeederStatusSchema;
28135
28411
  exports.PickStreamPreferencesSchema = PickStreamPreferencesSchema;
28136
28412
  exports.PickStreamRequirementsSchema = PickStreamRequirementsSchema;
28137
28413
  exports.PickedCamStreamSchema = PickedCamStreamSchema;
@@ -28487,6 +28763,7 @@ exports.parseJsonUnknown = require_sleep.parseJsonUnknown;
28487
28763
  exports.parseProfileBrokerId = require_sleep.parseProfileBrokerId;
28488
28764
  exports.parseStreamParamsFormPatch = parseStreamParamsFormPatch;
28489
28765
  exports.pendingFrameworkSwapSchema = pendingFrameworkSwapSchema;
28766
+ exports.petFeederCapability = petFeederCapability;
28490
28767
  exports.pickPreferredRtspEntry = pickPreferredRtspEntry;
28491
28768
  exports.pipelineAnalyticsCapability = pipelineAnalyticsCapability;
28492
28769
  exports.pipelineExecutorCapability = pipelineExecutorCapability;