@camstack/types 1.2.267 → 1.2.269

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 (69) hide show
  1. package/dist/addon.js +4 -4
  2. package/dist/addon.mjs +3 -3
  3. package/dist/capabilities/battery.cap.d.ts +17 -2
  4. package/dist/capabilities/capability-definition.d.ts +30 -1
  5. package/dist/capabilities/composer.cap.d.ts +105 -0
  6. package/dist/capabilities/consumables.cap.d.ts +79 -0
  7. package/dist/capabilities/core-blocks.cap.d.ts +1213 -104
  8. package/dist/capabilities/device-extension.cap.d.ts +12 -13
  9. package/dist/capabilities/device-manager.cap.d.ts +4 -4
  10. package/dist/capabilities/device-state.cap.d.ts +186 -2
  11. package/dist/capabilities/doorbell.cap.d.ts +4 -0
  12. package/dist/capabilities/index.d.ts +3 -3
  13. package/dist/capabilities/media-player.cap.d.ts +4 -4
  14. package/dist/capabilities/recording-archive.cap.d.ts +3 -3
  15. package/dist/catalogs/sensor-active-state.d.ts +25 -1
  16. package/dist/composition/composition-events.d.ts +42 -0
  17. package/dist/composition/composition-graph.d.ts +42 -9
  18. package/dist/composition/composition-items.d.ts +25 -0
  19. package/dist/composition/composition-report.d.ts +115 -12
  20. package/dist/composition/composition.d.ts +162 -3
  21. package/dist/composition/customization-name.d.ts +6 -0
  22. package/dist/composition/evaluate-field.d.ts +20 -0
  23. package/dist/composition/examples.d.ts +33 -0
  24. package/dist/composition/expression-kinds.d.ts +1 -0
  25. package/dist/composition/field-kinds.d.ts +42 -0
  26. package/dist/composition/index.d.ts +2 -0
  27. package/dist/composition/plan-result.d.ts +18 -0
  28. package/dist/composition/state-fields.d.ts +6 -0
  29. package/dist/composition/validate-composition.d.ts +44 -9
  30. package/dist/composition-BAH3n-zq.js +2582 -0
  31. package/dist/composition-D5BQywfe.mjs +2055 -0
  32. package/dist/device/device-context.d.ts +9 -0
  33. package/dist/device/device-runtime-state.d.ts +15 -1
  34. package/dist/device/index.d.ts +1 -1
  35. package/dist/device-extension/slot-descriptor.d.ts +8 -11
  36. package/dist/device-extension/slot-provider.d.ts +0 -2
  37. package/dist/enums/event-category.d.ts +25 -0
  38. package/dist/enums.js +1 -1
  39. package/dist/enums.mjs +1 -1
  40. package/dist/err-msg-DX6i_MY4.mjs +339 -0
  41. package/dist/err-msg-Dx2Kor0g.js +368 -0
  42. package/dist/{event-category-BVDXG4tB.mjs → event-category-C5xZWqz6.mjs} +31 -1
  43. package/dist/{event-category-BVfsrBYA.js → event-category-MbnB-6AN.js} +48 -0
  44. package/dist/expression/ast.d.ts +2 -0
  45. package/dist/expression/builtins.d.ts +9 -0
  46. package/dist/expression/evaluator.d.ts +8 -2
  47. package/dist/expression/expression-source.d.ts +26 -4
  48. package/dist/expression/index.d.ts +6 -6
  49. package/dist/generated/addon-api.d.ts +42 -0
  50. package/dist/generated/device-proxy.d.ts +1 -1
  51. package/dist/generated/method-access-map.d.ts +1 -1
  52. package/dist/generated/method-device-selectors.d.ts +2 -2
  53. package/dist/generated/system-proxy.d.ts +2 -2
  54. package/dist/index.d.ts +7 -6
  55. package/dist/index.js +1687 -1833
  56. package/dist/index.mjs +1359 -1550
  57. package/dist/interfaces/kernel-abstractions.d.ts +16 -0
  58. package/dist/interfaces/recording-config.d.ts +3 -3
  59. package/dist/interfaces/status-overlay.d.ts +42 -0
  60. package/dist/node.d.ts +1 -0
  61. package/dist/node.js +29 -8
  62. package/dist/node.mjs +23 -3
  63. package/dist/{sleep-8K9gue-H.js → sleep-Bg0IB7gg.js} +10 -367
  64. package/dist/{sleep-DC-wdyeS.mjs → sleep-E6eD4yQS.mjs} +11 -344
  65. package/package.json +1 -1
  66. package/dist/canonical-hash-CPK2Dy60.mjs +0 -715
  67. package/dist/canonical-hash-CSE4ioRi.js +0 -792
  68. package/dist/err-msg-COpsHMw2.js +0 -18
  69. package/dist/err-msg-IQTHeDzc.mjs +0 -13
package/dist/addon.js CHANGED
@@ -1,7 +1,7 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
- const require_sleep = require("./sleep-8K9gue-H.js");
3
- const require_event_category = require("./event-category-BVfsrBYA.js");
4
- const require_err_msg = require("./err-msg-COpsHMw2.js");
2
+ const require_sleep = require("./sleep-Bg0IB7gg.js");
3
+ const require_event_category = require("./event-category-MbnB-6AN.js");
4
+ const require_err_msg = require("./err-msg-Dx2Kor0g.js");
5
5
  //#region src/generated/cap-input-defaults.ts
6
6
  /**
7
7
  * AUTO-GENERATED by scripts/generate-cap-input-defaults.ts — DO NOT EDIT.
@@ -388,7 +388,7 @@ exports.COLLECTION_ARRAY_METHODS = COLLECTION_ARRAY_METHODS;
388
388
  exports.DATAPLANE_SECRET_HEADER = require_sleep.DATAPLANE_SECRET_HEADER;
389
389
  exports.DEVICE_CHILDREN_BATCH_MAX = require_sleep.DEVICE_CHILDREN_BATCH_MAX;
390
390
  exports.DEVICE_SCOPED_CAPS = require_sleep.DEVICE_SCOPED_CAPS;
391
- exports.DeviceType = require_sleep.DeviceType;
391
+ exports.DeviceType = require_err_msg.DeviceType;
392
392
  exports.DisposerChain = require_sleep.DisposerChain;
393
393
  exports.EventCategory = require_event_category.EventCategory;
394
394
  exports.PEER_BYTES_CHUNK_BYTES = require_sleep.PEER_BYTES_CHUNK_BYTES;
package/dist/addon.mjs CHANGED
@@ -1,6 +1,6 @@
1
- import { A as DeviceType, At as DATAPLANE_SECRET_HEADER, Dt as PEER_BYTES_STALL_MS, Et as PEER_BYTES_MAX_OUTSTANDING, G as readNodePin, J as ReadinessTimeoutError, L as expandCapMethods, Mt as DisposerChain, Nt as BaseAddon, Ot as PEER_BYTES_TICKET_TTL_MS, Pt as normalizeAddonInitResult, Rt as emitReadiness, S as DEVICE_CHILDREN_BATCH_MAX, T as describeCustomActions, Tt as PEER_BYTES_CHUNK_BYTES, W as nodePin, Z as scopeKey, a as asJsonObject, b as deviceOpsCapability, d as BOOT_RECOVERY_BACKOFF_MS, f as DEVICE_SCOPED_CAPS, h as createEventBusSliceSource, j as adminUiCapability, m as createDeviceProxy, p as isDeviceScopedCap, q as ReadinessRegistry, s as asString, t as sleep, u as parseJsonUnknown, x as viewerUiCapability } from "./sleep-DC-wdyeS.mjs";
2
- import { t as EventCategory } from "./event-category-BVDXG4tB.mjs";
3
- import { t as errMsg } from "./err-msg-IQTHeDzc.mjs";
1
+ import { At as normalizeAddonInitResult, B as nodePin, Ct as PEER_BYTES_STALL_MS, D as adminUiCapability, Et as DATAPLANE_SECRET_HEADER, N as expandCapMethods, Ot as DisposerChain, Pt as emitReadiness, S as DEVICE_CHILDREN_BATCH_MAX, St as PEER_BYTES_MAX_OUTSTANDING, T as describeCustomActions, U as ReadinessRegistry, V as readNodePin, W as ReadinessTimeoutError, a as asJsonObject, b as deviceOpsCapability, d as BOOT_RECOVERY_BACKOFF_MS, f as DEVICE_SCOPED_CAPS, h as createEventBusSliceSource, kt as BaseAddon, m as createDeviceProxy, p as isDeviceScopedCap, q as scopeKey, s as asString, t as sleep, u as parseJsonUnknown, wt as PEER_BYTES_TICKET_TTL_MS, x as viewerUiCapability, xt as PEER_BYTES_CHUNK_BYTES } from "./sleep-E6eD4yQS.mjs";
2
+ import { t as EventCategory } from "./event-category-C5xZWqz6.mjs";
3
+ import { a as DeviceType, t as errMsg } from "./err-msg-DX6i_MY4.mjs";
4
4
  //#region src/generated/cap-input-defaults.ts
5
5
  /**
6
6
  * AUTO-GENERATED by scripts/generate-cap-input-defaults.ts — DO NOT EDIT.
@@ -27,7 +27,7 @@ export declare const batteryCapability: {
27
27
  readonly scope: "device";
28
28
  readonly deviceNative: true;
29
29
  readonly mode: "singleton";
30
- readonly deviceTypes: readonly [DeviceType.Camera, DeviceType.Sensor, DeviceType.Button, DeviceType.Switch];
30
+ readonly deviceTypes: readonly [DeviceType.Camera, DeviceType.Sensor, DeviceType.Button, DeviceType.Switch, DeviceType.PetFeeder, DeviceType.Container];
31
31
  readonly methods: {
32
32
  /**
33
33
  * Explicitly wake the camera from low-power sleep ahead of a
@@ -53,6 +53,21 @@ export declare const batteryCapability: {
53
53
  durationMs: z.ZodNumber;
54
54
  }, z.core.$strip>, "mutation">;
55
55
  };
56
+ /**
57
+ * A composed provider (battery ADDED to a pet feeder or container that has
58
+ * no wake surface) answers `wakeForStream` with the same "unavailable"
59
+ * result the contract already defines above: "Returns `awoke: false` when
60
+ * … the cap surface is unavailable." (D663).
61
+ */
62
+ readonly composedMethods: {
63
+ readonly wakeForStream: {
64
+ readonly kind: "answer";
65
+ readonly value: {
66
+ readonly awoke: false;
67
+ readonly durationMs: 0;
68
+ };
69
+ };
70
+ };
56
71
  readonly events: {
57
72
  /**
58
73
  * Emitted whenever the cached status changes (firmware push OR
@@ -95,7 +110,7 @@ export declare const batteryCapability: {
95
110
  }, z.core.$strip>;
96
111
  readonly kind: "push";
97
112
  readonly empty: {
98
- readonly percentage: 0;
113
+ readonly percentage: null;
99
114
  readonly charging: "unknown";
100
115
  readonly sleeping: false;
101
116
  readonly lastUpdated: 0;
@@ -145,9 +145,16 @@ export interface CapabilityMethodSchema<TInput extends z.ZodType = z.ZodType, TO
145
145
  */
146
146
  readonly caller?: CapabilityMethodCaller;
147
147
  }
148
- /** Schema for a capability event (emitted to EventBus) */
148
+ export declare const CapabilityEventFromStateSchema: z.ZodObject<{
149
+ field: z.ZodString;
150
+ on: z.ZodLiteral<"advance">;
151
+ }, z.core.$strip>;
152
+ export type CapabilityEventFromState = z.infer<typeof CapabilityEventFromStateSchema>;
153
+ /** Schema for a capability event (emitted to EventBus). */
149
154
  export interface CapabilityEventSchema<TData extends z.ZodType = z.ZodType> {
150
155
  readonly data: TData;
156
+ /** A strict numeric state advance derives this one-shot event (D670). */
157
+ readonly fromState?: CapabilityEventFromState;
151
158
  }
152
159
  export type CapabilityStatusKind = 'push' | 'poll' | 'command-driven';
153
160
  /**
@@ -370,6 +377,20 @@ export interface DeviceConfigSpec {
370
377
  export type RuntimeStateDurability = 'session' | 'restored';
371
378
  /** The default applied to a `runtimeState` cap that declares no `durability`. */
372
379
  export declare const DEFAULT_RUNTIME_STATE_DURABILITY: RuntimeStateDurability;
380
+ /**
381
+ * How a COMPOSED provider answers a method it cannot forward yet (D663). A
382
+ * composition that ADDS a cap to a device serves this cap's methods from here
383
+ * until `forward` arrives (slice 3). A cap with a served method that is NOT
384
+ * listed stays uncomposable (`has-commands`). Only an answer the cap's own
385
+ * contract already defines as "not available" belongs here.
386
+ */
387
+ export type ComposedMethodAnswer = {
388
+ readonly kind: 'refuse';
389
+ readonly reason: string;
390
+ } | {
391
+ readonly kind: 'answer';
392
+ readonly value: unknown;
393
+ };
373
394
  /**
374
395
  * Full definition of a capability — the single source of truth for the
375
396
  * functional contract (methods + events).
@@ -426,6 +447,14 @@ export interface CapabilityDefinition<TName extends string = string, TMethods ex
426
447
  * from `scope:'device'` SYSTEM caps (zones/recording/motion/events) whose
427
448
  * single provider dispatches on deviceId internally. Default: undefined/false. */
428
449
  readonly deviceNative?: boolean;
450
+ /**
451
+ * How a COMPOSED provider answers a method it cannot forward yet (D663). A
452
+ * composition that ADDS a cap to a device serves this cap's methods from
453
+ * here until `forward` arrives (slice 3). A cap with a served method that
454
+ * is NOT listed stays uncomposable (`has-commands`). Only an answer the
455
+ * cap's own contract already defines as "not available" belongs here.
456
+ */
457
+ readonly composedMethods?: Readonly<Record<string, ComposedMethodAnswer>>;
429
458
  /** Method definitions: name → { input, output } Zod schemas */
430
459
  readonly methods: TMethods;
431
460
  /** Event definitions: name → { data } Zod schema (optional) */
@@ -29,6 +29,7 @@ export declare const ComposerBlockSchema: z.ZodObject<{
29
29
  features: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
30
30
  kind: z.ZodLiteral<"fields">;
31
31
  cap: z.ZodString;
32
+ enabled: z.ZodOptional<z.ZodBoolean>;
32
33
  fields: z.ZodRecord<z.ZodString, z.ZodDiscriminatedUnion<[z.ZodObject<{
33
34
  source: z.ZodObject<{
34
35
  addonId: z.ZodString;
@@ -56,6 +57,36 @@ export declare const ComposerBlockSchema: z.ZodObject<{
56
57
  kind: z.ZodLiteral<"code">;
57
58
  code: z.ZodString;
58
59
  }, z.core.$strip>], "kind">>;
60
+ items: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
61
+ label: z.ZodString;
62
+ fields: z.ZodRecord<z.ZodString, z.ZodDiscriminatedUnion<[z.ZodObject<{
63
+ source: z.ZodObject<{
64
+ addonId: z.ZodString;
65
+ stableId: z.ZodString;
66
+ }, z.core.$strip>;
67
+ cap: z.ZodString;
68
+ fieldPath: z.ZodString;
69
+ kind: z.ZodLiteral<"from">;
70
+ }, z.core.$strip>, z.ZodObject<{
71
+ kind: z.ZodLiteral<"expression">;
72
+ expr: z.ZodString;
73
+ bindings: z.ZodRecord<z.ZodString, z.ZodDiscriminatedUnion<[z.ZodObject<{
74
+ source: z.ZodObject<{
75
+ addonId: z.ZodString;
76
+ stableId: z.ZodString;
77
+ }, z.core.$strip>;
78
+ cap: z.ZodString;
79
+ fieldPath: z.ZodString;
80
+ kind: z.ZodLiteral<"from">;
81
+ }, z.core.$strip>, z.ZodObject<{
82
+ kind: z.ZodLiteral<"literal">;
83
+ value: z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull]>;
84
+ }, z.core.$strip>], "kind">>;
85
+ }, z.core.$strip>, z.ZodObject<{
86
+ kind: z.ZodLiteral<"code">;
87
+ code: z.ZodString;
88
+ }, z.core.$strip>], "kind">>;
89
+ }, z.core.$strip>>>;
59
90
  commands: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodDiscriminatedUnion<[z.ZodObject<{
60
91
  kind: z.ZodLiteral<"forward">;
61
92
  source: z.ZodObject<{
@@ -71,6 +102,7 @@ export declare const ComposerBlockSchema: z.ZodObject<{
71
102
  }, z.core.$strip>, z.ZodObject<{
72
103
  kind: z.ZodLiteral<"passthrough">;
73
104
  cap: z.ZodString;
105
+ enabled: z.ZodOptional<z.ZodBoolean>;
74
106
  source: z.ZodObject<{
75
107
  addonId: z.ZodString;
76
108
  stableId: z.ZodString;
@@ -114,6 +146,7 @@ export declare const ComposerApplyInputSchema: z.ZodObject<{
114
146
  features: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
115
147
  kind: z.ZodLiteral<"fields">;
116
148
  cap: z.ZodString;
149
+ enabled: z.ZodOptional<z.ZodBoolean>;
117
150
  fields: z.ZodRecord<z.ZodString, z.ZodDiscriminatedUnion<[z.ZodObject<{
118
151
  source: z.ZodObject<{
119
152
  addonId: z.ZodString;
@@ -141,6 +174,36 @@ export declare const ComposerApplyInputSchema: z.ZodObject<{
141
174
  kind: z.ZodLiteral<"code">;
142
175
  code: z.ZodString;
143
176
  }, z.core.$strip>], "kind">>;
177
+ items: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
178
+ label: z.ZodString;
179
+ fields: z.ZodRecord<z.ZodString, z.ZodDiscriminatedUnion<[z.ZodObject<{
180
+ source: z.ZodObject<{
181
+ addonId: z.ZodString;
182
+ stableId: z.ZodString;
183
+ }, z.core.$strip>;
184
+ cap: z.ZodString;
185
+ fieldPath: z.ZodString;
186
+ kind: z.ZodLiteral<"from">;
187
+ }, z.core.$strip>, z.ZodObject<{
188
+ kind: z.ZodLiteral<"expression">;
189
+ expr: z.ZodString;
190
+ bindings: z.ZodRecord<z.ZodString, z.ZodDiscriminatedUnion<[z.ZodObject<{
191
+ source: z.ZodObject<{
192
+ addonId: z.ZodString;
193
+ stableId: z.ZodString;
194
+ }, z.core.$strip>;
195
+ cap: z.ZodString;
196
+ fieldPath: z.ZodString;
197
+ kind: z.ZodLiteral<"from">;
198
+ }, z.core.$strip>, z.ZodObject<{
199
+ kind: z.ZodLiteral<"literal">;
200
+ value: z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull]>;
201
+ }, z.core.$strip>], "kind">>;
202
+ }, z.core.$strip>, z.ZodObject<{
203
+ kind: z.ZodLiteral<"code">;
204
+ code: z.ZodString;
205
+ }, z.core.$strip>], "kind">>;
206
+ }, z.core.$strip>>>;
144
207
  commands: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodDiscriminatedUnion<[z.ZodObject<{
145
208
  kind: z.ZodLiteral<"forward">;
146
209
  source: z.ZodObject<{
@@ -156,6 +219,7 @@ export declare const ComposerApplyInputSchema: z.ZodObject<{
156
219
  }, z.core.$strip>, z.ZodObject<{
157
220
  kind: z.ZodLiteral<"passthrough">;
158
221
  cap: z.ZodString;
222
+ enabled: z.ZodOptional<z.ZodBoolean>;
159
223
  source: z.ZodObject<{
160
224
  addonId: z.ZodString;
161
225
  stableId: z.ZodString;
@@ -178,6 +242,7 @@ export declare const ComposerBlockVerdictSchema: z.ZodObject<{
178
242
  failed: "failed";
179
243
  stopped: "stopped";
180
244
  starting: "starting";
245
+ degraded: "degraded";
181
246
  }>;
182
247
  reason: z.ZodOptional<z.ZodString>;
183
248
  }, z.core.$strip>;
@@ -190,6 +255,7 @@ export declare const ComposerApplyResultSchema: z.ZodObject<{
190
255
  failed: "failed";
191
256
  stopped: "stopped";
192
257
  starting: "starting";
258
+ degraded: "degraded";
193
259
  }>;
194
260
  reason: z.ZodOptional<z.ZodString>;
195
261
  }, z.core.$strip>>;
@@ -229,6 +295,7 @@ export declare const composerCapability: {
229
295
  features: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
230
296
  kind: z.ZodLiteral<"fields">;
231
297
  cap: z.ZodString;
298
+ enabled: z.ZodOptional<z.ZodBoolean>;
232
299
  fields: z.ZodRecord<z.ZodString, z.ZodDiscriminatedUnion<[z.ZodObject<{
233
300
  source: z.ZodObject<{
234
301
  addonId: z.ZodString;
@@ -256,6 +323,36 @@ export declare const composerCapability: {
256
323
  kind: z.ZodLiteral<"code">;
257
324
  code: z.ZodString;
258
325
  }, z.core.$strip>], "kind">>;
326
+ items: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
327
+ label: z.ZodString;
328
+ fields: z.ZodRecord<z.ZodString, z.ZodDiscriminatedUnion<[z.ZodObject<{
329
+ source: z.ZodObject<{
330
+ addonId: z.ZodString;
331
+ stableId: z.ZodString;
332
+ }, z.core.$strip>;
333
+ cap: z.ZodString;
334
+ fieldPath: z.ZodString;
335
+ kind: z.ZodLiteral<"from">;
336
+ }, z.core.$strip>, z.ZodObject<{
337
+ kind: z.ZodLiteral<"expression">;
338
+ expr: z.ZodString;
339
+ bindings: z.ZodRecord<z.ZodString, z.ZodDiscriminatedUnion<[z.ZodObject<{
340
+ source: z.ZodObject<{
341
+ addonId: z.ZodString;
342
+ stableId: z.ZodString;
343
+ }, z.core.$strip>;
344
+ cap: z.ZodString;
345
+ fieldPath: z.ZodString;
346
+ kind: z.ZodLiteral<"from">;
347
+ }, z.core.$strip>, z.ZodObject<{
348
+ kind: z.ZodLiteral<"literal">;
349
+ value: z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull]>;
350
+ }, z.core.$strip>], "kind">>;
351
+ }, z.core.$strip>, z.ZodObject<{
352
+ kind: z.ZodLiteral<"code">;
353
+ code: z.ZodString;
354
+ }, z.core.$strip>], "kind">>;
355
+ }, z.core.$strip>>>;
259
356
  commands: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodDiscriminatedUnion<[z.ZodObject<{
260
357
  kind: z.ZodLiteral<"forward">;
261
358
  source: z.ZodObject<{
@@ -271,6 +368,7 @@ export declare const composerCapability: {
271
368
  }, z.core.$strip>, z.ZodObject<{
272
369
  kind: z.ZodLiteral<"passthrough">;
273
370
  cap: z.ZodString;
371
+ enabled: z.ZodOptional<z.ZodBoolean>;
274
372
  source: z.ZodObject<{
275
373
  addonId: z.ZodString;
276
374
  stableId: z.ZodString;
@@ -292,6 +390,7 @@ export declare const composerCapability: {
292
390
  failed: "failed";
293
391
  stopped: "stopped";
294
392
  starting: "starting";
393
+ degraded: "degraded";
295
394
  }>;
296
395
  reason: z.ZodOptional<z.ZodString>;
297
396
  }, z.core.$strip>>;
@@ -308,11 +407,17 @@ export declare const composerCapability: {
308
407
  failed: "failed";
309
408
  stopped: "stopped";
310
409
  starting: "starting";
410
+ degraded: "degraded";
311
411
  }>;
312
412
  reason: z.ZodOptional<z.ZodString>;
313
413
  fields: z.ZodArray<z.ZodObject<{
314
414
  cap: z.ZodString;
315
415
  path: z.ZodString;
416
+ item: z.ZodOptional<z.ZodObject<{
417
+ arrayPath: z.ZodString;
418
+ key: z.ZodString;
419
+ label: z.ZodString;
420
+ }, z.core.$strip>>;
316
421
  state: z.ZodEnum<{
317
422
  unavailable: "unavailable";
318
423
  fresh: "fresh";
@@ -13,6 +13,25 @@ import { DeviceType } from '../device/device-type.js';
13
13
  * provider populates it by guessing (no HA inference). The UI renders a
14
14
  * "No consumables reported" placeholder when `items` is empty.
15
15
  */
16
+ /** Units a remaining-life counter is reported in. Closed: the panel renders
17
+ * each. */
18
+ export declare const ConsumableRemainingUnitSchema: z.ZodEnum<{
19
+ cycles: "cycles";
20
+ days: "days";
21
+ hours: "hours";
22
+ }>;
23
+ export type ConsumableRemainingUnit = z.infer<typeof ConsumableRemainingUnitSchema>;
24
+ /** Remaining life as a COUNT, not a percentage (the PetKit desiccant reports
25
+ * days). `value` null = unknown (D393). */
26
+ export declare const ConsumableRemainingSchema: z.ZodObject<{
27
+ value: z.ZodNullable<z.ZodNumber>;
28
+ unit: z.ZodEnum<{
29
+ cycles: "cycles";
30
+ days: "days";
31
+ hours: "hours";
32
+ }>;
33
+ }, z.core.$strip>;
34
+ export type ConsumableRemaining = z.infer<typeof ConsumableRemainingSchema>;
16
35
  /** A single consumable item. Either a continuous `level` (remaining
17
36
  * life %) or a discrete `status` may be known — both may be null when a
18
37
  * provider only knows the item exists. `level` and `status` are not
@@ -27,6 +46,14 @@ export declare const ConsumableItemSchema: z.ZodObject<{
27
46
  }>>;
28
47
  lastResetAt: z.ZodNullable<z.ZodNumber>;
29
48
  resettable: z.ZodBoolean;
49
+ remaining: z.ZodOptional<z.ZodObject<{
50
+ value: z.ZodNullable<z.ZodNumber>;
51
+ unit: z.ZodEnum<{
52
+ cycles: "cycles";
53
+ days: "days";
54
+ hours: "hours";
55
+ }>;
56
+ }, z.core.$strip>>;
30
57
  }, z.core.$strip>;
31
58
  export declare const ConsumablesStatusSchema: z.ZodObject<{
32
59
  items: z.ZodArray<z.ZodObject<{
@@ -39,6 +66,14 @@ export declare const ConsumablesStatusSchema: z.ZodObject<{
39
66
  }>>;
40
67
  lastResetAt: z.ZodNullable<z.ZodNumber>;
41
68
  resettable: z.ZodBoolean;
69
+ remaining: z.ZodOptional<z.ZodObject<{
70
+ value: z.ZodNullable<z.ZodNumber>;
71
+ unit: z.ZodEnum<{
72
+ cycles: "cycles";
73
+ days: "days";
74
+ hours: "hours";
75
+ }>;
76
+ }, z.core.$strip>>;
42
77
  }, z.core.$strip>>;
43
78
  lastChangedAt: z.ZodNumber;
44
79
  }, z.core.$strip>;
@@ -68,6 +103,18 @@ export declare const consumablesCapability: {
68
103
  key: z.ZodString;
69
104
  }, z.core.$strip>, z.ZodVoid, "mutation">;
70
105
  };
106
+ /**
107
+ * A composed consumable (item added to a device with no native consumables
108
+ * provider) refuses `reset` by name: "Only meaningful when the item's
109
+ * `resettable` is true" — a composed item is never resettable until
110
+ * commands (`forward`) arrive in slice 3 (D663).
111
+ */
112
+ readonly composedMethods: {
113
+ readonly reset: {
114
+ readonly kind: "refuse";
115
+ readonly reason: "a composed consumable is not resettable until commands (forward) arrive — slice 3";
116
+ };
117
+ };
71
118
  readonly status: {
72
119
  readonly schema: z.ZodObject<{
73
120
  items: z.ZodArray<z.ZodObject<{
@@ -80,6 +127,14 @@ export declare const consumablesCapability: {
80
127
  }>>;
81
128
  lastResetAt: z.ZodNullable<z.ZodNumber>;
82
129
  resettable: z.ZodBoolean;
130
+ remaining: z.ZodOptional<z.ZodObject<{
131
+ value: z.ZodNullable<z.ZodNumber>;
132
+ unit: z.ZodEnum<{
133
+ cycles: "cycles";
134
+ days: "days";
135
+ hours: "hours";
136
+ }>;
137
+ }, z.core.$strip>>;
83
138
  }, z.core.$strip>>;
84
139
  lastChangedAt: z.ZodNumber;
85
140
  }, z.core.$strip>;
@@ -92,6 +147,10 @@ export declare const consumablesCapability: {
92
147
  status: "replace" | "ok" | null;
93
148
  lastResetAt: number | null;
94
149
  resettable: boolean;
150
+ remaining?: {
151
+ value: number | null;
152
+ unit: "cycles" | "days" | "hours";
153
+ } | undefined;
95
154
  }[];
96
155
  lastChangedAt: number;
97
156
  };
@@ -109,6 +168,14 @@ export declare const consumablesCapability: {
109
168
  }>>;
110
169
  lastResetAt: z.ZodNullable<z.ZodNumber>;
111
170
  resettable: z.ZodBoolean;
171
+ remaining: z.ZodOptional<z.ZodObject<{
172
+ value: z.ZodNullable<z.ZodNumber>;
173
+ unit: z.ZodEnum<{
174
+ cycles: "cycles";
175
+ days: "days";
176
+ hours: "hours";
177
+ }>;
178
+ }, z.core.$strip>>;
112
179
  }, z.core.$strip>;
113
180
  readonly emptyItem: {
114
181
  key: string;
@@ -117,6 +184,10 @@ export declare const consumablesCapability: {
117
184
  status: "replace" | "ok" | null;
118
185
  lastResetAt: number | null;
119
186
  resettable: boolean;
187
+ remaining?: {
188
+ value: number | null;
189
+ unit: "cycles" | "days" | "hours";
190
+ } | undefined;
120
191
  };
121
192
  };
122
193
  };
@@ -131,6 +202,14 @@ export declare const consumablesCapability: {
131
202
  }>>;
132
203
  lastResetAt: z.ZodNullable<z.ZodNumber>;
133
204
  resettable: z.ZodBoolean;
205
+ remaining: z.ZodOptional<z.ZodObject<{
206
+ value: z.ZodNullable<z.ZodNumber>;
207
+ unit: z.ZodEnum<{
208
+ cycles: "cycles";
209
+ days: "days";
210
+ hours: "hours";
211
+ }>;
212
+ }, z.core.$strip>>;
134
213
  }, z.core.$strip>>;
135
214
  lastChangedAt: z.ZodNumber;
136
215
  lastFetchedAt: z.ZodNumber;