@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.
- package/dist/addon.js +1 -1
- package/dist/addon.mjs +1 -1
- package/dist/capabilities/battery.cap.d.ts +6 -0
- package/dist/capabilities/capability-definition.d.ts +39 -0
- package/dist/capabilities/consumables.cap.d.ts +35 -0
- package/dist/capabilities/device-manager.cap.d.ts +396 -15
- package/dist/capabilities/index.d.ts +1 -1
- package/dist/capabilities/pipeline-orchestrator.cap.d.ts +7 -3
- package/dist/device/device-binding.d.ts +9 -3
- package/dist/device/device-management.d.ts +87 -6
- package/dist/device/index.d.ts +2 -2
- package/dist/device/schema-fields.d.ts +13 -0
- package/dist/expression/ast.d.ts +56 -0
- package/dist/expression/builtins.d.ts +19 -0
- package/dist/expression/compile.d.ts +17 -0
- package/dist/expression/errors.d.ts +16 -0
- package/dist/expression/evaluator.d.ts +14 -0
- package/dist/expression/index.d.ts +25 -0
- package/dist/expression/limits.d.ts +30 -0
- package/dist/expression/link-expression.d.ts +44 -0
- package/dist/expression/parser.d.ts +12 -0
- package/dist/expression/tokenizer.d.ts +38 -0
- package/dist/generated/addon-api.d.ts +452 -4
- package/dist/generated/device-proxy.d.ts +1 -1
- package/dist/generated/method-access-map.d.ts +1 -1
- package/dist/generated/system-proxy.d.ts +1 -1
- package/dist/index.d.ts +5 -2
- package/dist/index.js +1342 -20
- package/dist/index.mjs +1313 -21
- package/dist/interfaces/agent.d.ts +21 -0
- package/dist/{sleep-MHm--th-.mjs → sleep-BO1nweKv.mjs} +1 -0
- package/dist/{sleep-BabrCASa.js → sleep-DaQgDq90.js} +1 -0
- package/dist/units/convert.d.ts +49 -0
- package/dist/units/index.d.ts +8 -0
- package/dist/units/unit-table.d.ts +270 -0
- 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-
|
|
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-
|
|
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<{
|