@camstack/types 1.1.19 → 1.1.21

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 (36) hide show
  1. package/dist/addon.js +1 -1
  2. package/dist/addon.mjs +1 -1
  3. package/dist/capabilities/battery.cap.d.ts +6 -0
  4. package/dist/capabilities/capability-definition.d.ts +39 -0
  5. package/dist/capabilities/consumables.cap.d.ts +35 -0
  6. package/dist/capabilities/device-manager.cap.d.ts +396 -15
  7. package/dist/capabilities/index.d.ts +1 -1
  8. package/dist/capabilities/pipeline-orchestrator.cap.d.ts +7 -3
  9. package/dist/device/device-binding.d.ts +9 -3
  10. package/dist/device/device-management.d.ts +87 -6
  11. package/dist/device/index.d.ts +2 -2
  12. package/dist/device/schema-fields.d.ts +13 -0
  13. package/dist/expression/ast.d.ts +56 -0
  14. package/dist/expression/builtins.d.ts +19 -0
  15. package/dist/expression/compile.d.ts +17 -0
  16. package/dist/expression/errors.d.ts +16 -0
  17. package/dist/expression/evaluator.d.ts +14 -0
  18. package/dist/expression/index.d.ts +25 -0
  19. package/dist/expression/limits.d.ts +30 -0
  20. package/dist/expression/link-expression.d.ts +44 -0
  21. package/dist/expression/parser.d.ts +12 -0
  22. package/dist/expression/tokenizer.d.ts +38 -0
  23. package/dist/generated/addon-api.d.ts +452 -4
  24. package/dist/generated/device-proxy.d.ts +1 -1
  25. package/dist/generated/method-access-map.d.ts +1 -1
  26. package/dist/generated/system-proxy.d.ts +1 -1
  27. package/dist/index.d.ts +5 -2
  28. package/dist/index.js +1342 -20
  29. package/dist/index.mjs +1313 -21
  30. package/dist/interfaces/agent.d.ts +21 -0
  31. package/dist/{sleep-MHm--th-.mjs → sleep-BO1nweKv.mjs} +1 -0
  32. package/dist/{sleep-BabrCASa.js → sleep-DaQgDq90.js} +1 -0
  33. package/dist/units/convert.d.ts +49 -0
  34. package/dist/units/index.d.ts +8 -0
  35. package/dist/units/unit-table.d.ts +270 -0
  36. package/package.json +1 -1
package/dist/addon.js CHANGED
@@ -1,5 +1,5 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
- const require_sleep = require("./sleep-BabrCASa.js");
2
+ const require_sleep = require("./sleep-DaQgDq90.js");
3
3
  const require_err_msg = require("./err-msg-COpsHMw2.js");
4
4
  exports.BaseAddon = require_sleep.BaseAddon;
5
5
  exports.DATAPLANE_SECRET_HEADER = require_sleep.DATAPLANE_SECRET_HEADER;
package/dist/addon.mjs CHANGED
@@ -1,3 +1,3 @@
1
- import { A as ReadinessRegistry, C as asJsonObject, O as parseJsonUnknown, P as scopeKey, T as asString, a as adminUiCapability, b as DeviceType, gt as DisposerChain, ht as EventCategory, i as deviceOpsCapability, j as ReadinessTimeoutError, k as DATAPLANE_SECRET_HEADER, o as createDeviceProxy, ot as BaseAddon, p as expandCapMethods, st as normalizeAddonInitResult, t as sleep, ut as emitReadiness } from "./sleep-MHm--th-.mjs";
1
+ import { A as ReadinessRegistry, C as asJsonObject, O as parseJsonUnknown, P as scopeKey, T as asString, a as adminUiCapability, b as DeviceType, gt as DisposerChain, ht as EventCategory, i as deviceOpsCapability, j as ReadinessTimeoutError, k as DATAPLANE_SECRET_HEADER, o as createDeviceProxy, ot as BaseAddon, p as expandCapMethods, st as normalizeAddonInitResult, t as sleep, ut as emitReadiness } from "./sleep-BO1nweKv.mjs";
2
2
  import { t as errMsg } from "./err-msg-IQTHeDzc.mjs";
3
3
  export { BaseAddon, DATAPLANE_SECRET_HEADER, DeviceType, DisposerChain, EventCategory, ReadinessRegistry, ReadinessTimeoutError, adminUiCapability, asJsonObject, asString, createDeviceProxy, deviceOpsCapability, emitReadiness, errMsg, expandCapMethods, normalizeAddonInitResult, parseJsonUnknown, scopeKey, sleep };
@@ -88,6 +88,12 @@ export declare const batteryCapability: {
88
88
  binary: z.ZodOptional<z.ZodBoolean>;
89
89
  }, z.core.$strip>;
90
90
  readonly kind: "push";
91
+ readonly empty: {
92
+ readonly percentage: 0;
93
+ readonly charging: "none";
94
+ readonly sleeping: false;
95
+ readonly lastUpdated: 0;
96
+ };
91
97
  };
92
98
  /**
93
99
  * Runtime-state slice — every provider that registers this cap
@@ -67,10 +67,49 @@ export interface CapabilityEventSchema<TData extends z.ZodType = z.ZodType> {
67
67
  readonly data: TData;
68
68
  }
69
69
  export type CapabilityStatusKind = 'push' | 'poll' | 'command-driven';
70
+ /**
71
+ * Declares that a cap's status is an ITEM-ARRAY wiring target: the status
72
+ * holds an array of keyed items (`consumables.items`) that device-links can
73
+ * populate per item via `DeviceLink.target.itemKey`. Links sharing an
74
+ * `itemKey` are grouped into ONE item: the merge seeds a new item from
75
+ * `emptyItem` (with `keyField` — and `labelField` when declared — set to the
76
+ * itemKey), overlays each link's per-item `fieldPath`, validates the item
77
+ * against `itemSchema`, then upserts it into the array by `keyField`.
78
+ */
79
+ export interface CapabilityStatusItemArray {
80
+ /** Dot-path from the status root to the array field (e.g. 'items'). */
81
+ readonly path: string;
82
+ /** Item field carrying the stable per-item key (e.g. 'key'). */
83
+ readonly keyField: string;
84
+ /** Optional item field defaulted to the itemKey when a NEW item is seeded
85
+ * and no link overlays it (e.g. 'label' — schemas often require it
86
+ * non-empty). Existing items keep their value. */
87
+ readonly labelField?: string;
88
+ /** Zod schema of ONE array item — the per-item validation gate (a bad
89
+ * item is skipped without discarding the other items). */
90
+ readonly itemSchema: z.ZodType;
91
+ /** Seed for a NEW item created from links; `keyField`/`labelField` are
92
+ * overwritten with the itemKey, links overlay the rest. Must produce an
93
+ * `itemSchema`-valid item once seeded. */
94
+ readonly emptyItem: Readonly<Record<string, unknown>>;
95
+ }
70
96
  export interface CapabilityStatusSchema<TStatus extends z.ZodType = z.ZodType> {
71
97
  readonly schema: TStatus;
72
98
  /** Documentation hint on update cadence — used by the aggregator and UI. */
73
99
  readonly kind?: CapabilityStatusKind;
100
+ /**
101
+ * Default status used as the merge BASE when a device-link *synthesizes*
102
+ * this cap (no native provider). Required-but-unlinked fields (enums,
103
+ * timestamps) come from here so the synthesized status validates against
104
+ * `schema`. Omit for caps that are never synthesize targets.
105
+ */
106
+ readonly empty?: z.infer<TStatus>;
107
+ /**
108
+ * Item-array wiring descriptor — set when the status holds an array of
109
+ * keyed items that device-links populate per item (`itemKey` grouping).
110
+ * See {@link CapabilityStatusItemArray}. Omit for scalar-only caps.
111
+ */
112
+ readonly itemArray?: CapabilityStatusItemArray;
74
113
  }
75
114
  /** How a contribution's component is resolved by the renderer. */
76
115
  export type UiContributionKind = 'remote';
@@ -84,6 +84,41 @@ export declare const consumablesCapability: {
84
84
  lastChangedAt: z.ZodNumber;
85
85
  }, z.core.$strip>;
86
86
  readonly kind: "push";
87
+ readonly empty: {
88
+ items: {
89
+ key: string;
90
+ label: string;
91
+ level: number | null;
92
+ status: "replace" | "ok" | null;
93
+ lastResetAt: number | null;
94
+ resettable: boolean;
95
+ }[];
96
+ lastChangedAt: number;
97
+ };
98
+ readonly itemArray: {
99
+ readonly path: "items";
100
+ readonly keyField: "key";
101
+ readonly labelField: "label";
102
+ readonly itemSchema: z.ZodObject<{
103
+ key: z.ZodString;
104
+ label: z.ZodString;
105
+ level: z.ZodNullable<z.ZodNumber>;
106
+ status: z.ZodNullable<z.ZodEnum<{
107
+ replace: "replace";
108
+ ok: "ok";
109
+ }>>;
110
+ lastResetAt: z.ZodNullable<z.ZodNumber>;
111
+ resettable: z.ZodBoolean;
112
+ }, z.core.$strip>;
113
+ readonly emptyItem: {
114
+ key: string;
115
+ label: string;
116
+ level: number | null;
117
+ status: "replace" | "ok" | null;
118
+ lastResetAt: number | null;
119
+ resettable: boolean;
120
+ };
121
+ };
87
122
  };
88
123
  readonly runtimeState: z.ZodObject<{
89
124
  items: z.ZodArray<z.ZodObject<{