@camstack/types 1.2.402 → 1.2.404

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 (57) hide show
  1. package/dist/addon.js +2 -2
  2. package/dist/addon.mjs +2 -2
  3. package/dist/auth/credential-scope.d.ts +23 -3
  4. package/dist/auth/viewer-access.d.ts +112 -0
  5. package/dist/capabilities/capability-definition.d.ts +14 -0
  6. package/dist/capabilities/face-gallery.cap.d.ts +3 -0
  7. package/dist/capabilities/index.d.ts +3 -3
  8. package/dist/capabilities/pipeline-analytics.cap.d.ts +82 -0
  9. package/dist/capabilities/pipeline-executor.cap.d.ts +0 -64
  10. package/dist/capabilities/pipeline-orchestrator.cap.d.ts +32 -124
  11. package/dist/capabilities/plate-gallery.cap.d.ts +3 -0
  12. package/dist/capabilities/scene-monitor.cap.d.ts +3 -0
  13. package/dist/capabilities/training.cap.d.ts +91 -71
  14. package/dist/capabilities/user-management.cap.d.ts +108 -18
  15. package/dist/client.js +9 -8
  16. package/dist/client.mjs +9 -8
  17. package/dist/clips/clip-event-labels.d.ts +96 -0
  18. package/dist/device/cap-vocabulary/entries/actuators.d.ts +5 -0
  19. package/dist/device/cap-vocabulary/entries/appliances.d.ts +5 -0
  20. package/dist/device/cap-vocabulary/entries/camera.d.ts +5 -0
  21. package/dist/device/cap-vocabulary/entries/sensors.d.ts +5 -0
  22. package/dist/device/cap-vocabulary/entries/system.d.ts +8 -0
  23. package/dist/device/cap-vocabulary/index.d.ts +9 -0
  24. package/dist/device/cap-vocabulary/l10n.d.ts +7 -0
  25. package/dist/device/cap-vocabulary/resolve.d.ts +100 -0
  26. package/dist/device/cap-vocabulary/templates.d.ts +11 -0
  27. package/dist/device/cap-vocabulary/types.d.ts +398 -0
  28. package/dist/device/cap-vocabulary/vocabulary.d.ts +5 -0
  29. package/dist/device/device-do-actions.d.ts +8 -2
  30. package/dist/enums/event-category.d.ts +2 -3
  31. package/dist/enums.js +1 -1
  32. package/dist/enums.mjs +1 -1
  33. package/dist/{event-category-7AwNbPjm.js → event-category-CXrwjC3e.js} +2 -3
  34. package/dist/{event-category-BfJwUd2S.mjs → event-category-fDPduoeC.mjs} +2 -3
  35. package/dist/generated/addon-api.d.ts +52 -56
  36. package/dist/generated/device-proxy.d.ts +1 -1
  37. package/dist/generated/method-access-map.d.ts +4 -1
  38. package/dist/generated/method-device-selectors.d.ts +2 -2
  39. package/dist/generated/system-proxy.d.ts +3 -3
  40. package/dist/index.d.ts +8 -3
  41. package/dist/index.js +7406 -2133
  42. package/dist/index.mjs +7372 -2132
  43. package/dist/interfaces/api-responses.d.ts +1 -1
  44. package/dist/interfaces/auth.d.ts +2 -2
  45. package/dist/interfaces/birth-decision-ledger.d.ts +20 -0
  46. package/dist/interfaces/pipeline-executor-capability.d.ts +2 -8
  47. package/dist/pipeline/auto-tune/plan-schemas.d.ts +8 -80
  48. package/dist/pipeline/step-settings-layers.d.ts +7 -8
  49. package/dist/schemas/auth-records.d.ts +77 -13
  50. package/dist/schemas/device-selector.d.ts +23 -4
  51. package/dist/{sleep-DVovpDRU.js → sleep-BKS4OPMo.js} +2 -4
  52. package/dist/{sleep-CUp20JkO.mjs → sleep-CHIEEJkY.mjs} +2 -4
  53. package/dist/types/agent-pipeline-settings.d.ts +37 -70
  54. package/dist/types/camera-pipeline.d.ts +2 -2
  55. package/dist/types/detection.d.ts +19 -0
  56. package/dist/types/pipeline-step.d.ts +0 -16
  57. package/package.json +1 -1
@@ -0,0 +1,100 @@
1
+ /**
2
+ * Resolve a DEVICE's vocabulary from the cap map (D920): the actions it can be
3
+ * made to do and the triggers it can be watched for, phrased, with the
4
+ * device-type / role wording applied.
5
+ *
6
+ * Walks the device's bindings (D12) and reads only the cap NAME of each entry
7
+ * — never the binding kind (D13): a wrapped cap and a native one speak the
8
+ * same words. System caps and caps the map does not know contribute nothing.
9
+ * The order is the map's order, so a picker draws the same device the same way.
10
+ */
11
+ import type { CapabilityMethodAccess } from '../../capabilities/capability-definition.js';
12
+ import type { EventCategory } from '../../enums/event-category.js';
13
+ import type { DeviceBinding, DeviceBindingEntry } from '../device-binding.js';
14
+ import type { L10n, LooseDynamicOffer, LooseVocabOpenArg, VocabIcon, VocabLocale } from './types.js';
15
+ /** A device's caps, however the caller holds them. */
16
+ export type VocabBindingsInput = DeviceBinding | readonly DeviceBindingEntry[] | readonly string[];
17
+ /** One action a device can be made to do — the wire is `{ cap, method, args }`. */
18
+ export interface ResolvedVocabAction {
19
+ readonly id: string;
20
+ readonly cap: string;
21
+ readonly method: string;
22
+ readonly label: L10n;
23
+ readonly phrase: L10n;
24
+ readonly icon: VocabIcon;
25
+ /** Baked args — sent as they are. */
26
+ readonly args: Readonly<Record<string, unknown>>;
27
+ /** Args the operator fills, each with how to offer its values. */
28
+ readonly openArgs: readonly LooseVocabOpenArg[];
29
+ /** The method's access tier (METHOD_ACCESS_MAP). */
30
+ readonly access: CapabilityMethodAccess;
31
+ }
32
+ interface ResolvedTriggerBase {
33
+ readonly id: string;
34
+ readonly cap: string;
35
+ readonly label: L10n;
36
+ readonly icon: VocabIcon;
37
+ }
38
+ /** A true/false field. `…For` phrases carry `{minutes}`. */
39
+ export interface ResolvedBooleanTrigger extends ResolvedTriggerBase {
40
+ readonly kind: 'boolean';
41
+ readonly field: string;
42
+ readonly whenTrue: L10n;
43
+ readonly whenFalse: L10n;
44
+ readonly whenTrueFor: L10n;
45
+ readonly whenFalseFor: L10n;
46
+ }
47
+ /** A number: phrases carry `{threshold}` / `{delta}`. */
48
+ export interface ResolvedNumericTrigger extends ResolvedTriggerBase {
49
+ readonly kind: 'numeric';
50
+ readonly field: string;
51
+ readonly unit: string | null;
52
+ /** Status field holding the device's own unit, when it states one. */
53
+ readonly unitField: string | null;
54
+ readonly above: L10n;
55
+ readonly below: L10n;
56
+ readonly changesBy: L10n;
57
+ }
58
+ /** One value of an enum trigger, phrased. */
59
+ export interface ResolvedEnumValue {
60
+ readonly value: string;
61
+ readonly label: L10n;
62
+ readonly phrase: L10n;
63
+ readonly phraseFor: L10n;
64
+ }
65
+ /** A closed set of states. */
66
+ export interface ResolvedEnumTrigger extends ResolvedTriggerBase {
67
+ readonly kind: 'enum';
68
+ readonly field: string;
69
+ readonly values: readonly ResolvedEnumValue[];
70
+ }
71
+ /** A free value: phrases carry `{value}`. */
72
+ export interface ResolvedValueTrigger extends ResolvedTriggerBase {
73
+ readonly kind: 'value';
74
+ readonly field: string;
75
+ readonly phrase: L10n;
76
+ readonly phraseFor: L10n;
77
+ readonly offer: LooseDynamicOffer | null;
78
+ }
79
+ /** A bus event the device emits. */
80
+ export interface ResolvedEventTrigger extends ResolvedTriggerBase {
81
+ readonly kind: 'event';
82
+ readonly category: EventCategory;
83
+ readonly phrase: L10n;
84
+ }
85
+ /** Anything a device can be watched for. */
86
+ export type ResolvedVocabTrigger = ResolvedBooleanTrigger | ResolvedNumericTrigger | ResolvedEnumTrigger | ResolvedValueTrigger | ResolvedEventTrigger;
87
+ /** Fill `{name}` placeholders from `values`; an unknown one stays visible. */
88
+ export declare function renderVocabPhrase(phrase: L10n, locale: VocabLocale, values: Readonly<Record<string, string>>): string;
89
+ /**
90
+ * The actions a device can be made to do, phrased for its type and role.
91
+ * An action whose method is no longer routable (absent from
92
+ * METHOD_ACCESS_MAP, or a read) is dropped.
93
+ */
94
+ export declare function actionsForDevice(bindings: VocabBindingsInput, deviceType?: string, role?: string | null): readonly ResolvedVocabAction[];
95
+ /**
96
+ * The triggers a device can be watched for — its state fields, then the bus
97
+ * events it emits — phrased for its type and role.
98
+ */
99
+ export declare function triggersForDevice(bindings: VocabBindingsInput, deviceType?: string, role?: string | null): readonly ResolvedVocabTrigger[];
100
+ export {};
@@ -0,0 +1,11 @@
1
+ import type { L10n } from './types.js';
2
+ /** Placeholders: `{quantity}` (with its article), `{device}`, `{threshold}`, `{delta}`. */
3
+ export declare const NUMERIC_ABOVE: L10n;
4
+ export declare const NUMERIC_BELOW: L10n;
5
+ export declare const NUMERIC_CHANGES_BY: L10n;
6
+ /** Placeholders: `{device}`, `{value}` (the value's label). */
7
+ export declare const BECOMES: L10n;
8
+ /** Placeholders: `{trigger}` (a whole trigger phrase), `{minutes}`. */
9
+ export declare const HELD_FOR: L10n;
10
+ /** Every frame, for the completeness test. */
11
+ export declare const VOCAB_TEMPLATES: Readonly<Record<string, L10n>>;
@@ -0,0 +1,398 @@
1
+ /**
2
+ * The SHAPE of the cap vocabulary (D920): what an operator can make a device
3
+ * DO, and what a device can be WATCHED for, phrased for humans — keyed by
4
+ * capability name, typed against the capability definitions themselves.
5
+ *
6
+ * Every key type here is DERIVED from the cap registry
7
+ * (`generated/capability-router-map.ts`, imported as a TYPE only — no runtime
8
+ * cost, no Zod graph in a browser bundle): a method, status field or event
9
+ * name that does not exist on the cap is a TypeScript error, and so is a
10
+ * missing cap. `scripts/check-cap-vocabulary.ts` checks what a type cannot:
11
+ * that every operate method is phrased or excused, that offered values agree
12
+ * with the method's Zod input, that every placeholder has an arg, and that
13
+ * every label carries both languages.
14
+ *
15
+ * Translations live INLINE (`{ en, it }`) next to the entry they translate —
16
+ * one source, so a new action cannot ship in one language.
17
+ */
18
+ import type { z } from 'zod';
19
+ import type * as CapRegistry from '../../generated/capability-router-map.js';
20
+ import type { EventCategory } from '../../enums/event-category.js';
21
+ import type { ICON_KEYS } from '../icon-catalog.generated.js';
22
+ import type { DeviceRole, DeviceType } from '../device-type.js';
23
+ /** One catalog icon key (lucide id) — the same vocabulary as `IconKey`. */
24
+ export type VocabIcon = (typeof ICON_KEYS)[number];
25
+ /** A human string in every language the map carries. */
26
+ export interface L10n {
27
+ readonly en: string;
28
+ readonly it: string;
29
+ }
30
+ /** A language the vocabulary is written in. */
31
+ export type VocabLocale = keyof L10n;
32
+ type CapRegistryModule = typeof CapRegistry;
33
+ /** The minimal structural shape that tells a cap definition export apart. */
34
+ interface CapDefinitionLike {
35
+ readonly name: string;
36
+ readonly scope: 'system' | 'device';
37
+ readonly methods: object;
38
+ }
39
+ /** Cap name → its definition TYPE, for every cap the registry exports. */
40
+ export type CapDefinitionsByName = {
41
+ readonly [K in keyof CapRegistryModule as CapRegistryModule[K] extends CapDefinitionLike ? CapRegistryModule[K]['name'] : never]: CapRegistryModule[K];
42
+ };
43
+ /** Every capability name. */
44
+ export type VocabCapName = keyof CapDefinitionsByName & string;
45
+ type CapDef<C extends VocabCapName> = CapDefinitionsByName[C];
46
+ /** Device-scoped cap names (the ones a device's vocabulary is made of). */
47
+ export type DeviceVocabCapName = {
48
+ [C in VocabCapName]: CapDef<C>['scope'] extends 'device' ? C : never;
49
+ }[VocabCapName];
50
+ /** System-scoped cap names (never part of a device's vocabulary). */
51
+ export type SystemVocabCapName = Exclude<VocabCapName, DeviceVocabCapName>;
52
+ /** A method name declared by cap `C`. */
53
+ export type CapMethodName<C extends VocabCapName> = keyof CapDef<C>['methods'] & string;
54
+ type MethodSchemaOf<C extends VocabCapName, M extends CapMethodName<C>> = CapDef<C>['methods'][M];
55
+ type MethodInputOf<C extends VocabCapName, M extends CapMethodName<C>> = MethodSchemaOf<C, M> extends {
56
+ readonly input: infer I extends z.ZodType;
57
+ } ? z.input<I> : never;
58
+ /** The operator-supplied part of a method input (`deviceId` is the target). */
59
+ export type ActionArgs<C extends VocabCapName, M extends CapMethodName<C>> = MethodInputOf<C, M> extends object ? Omit<MethodInputOf<C, M>, 'deviceId'> : Record<never, never>;
60
+ /** A key of {@link ActionArgs}. */
61
+ export type ActionArgKey<C extends VocabCapName, M extends CapMethodName<C>> = keyof ActionArgs<C, M> & string;
62
+ type StatusOf<C extends VocabCapName> = CapDef<C> extends {
63
+ readonly status: {
64
+ readonly schema: infer S extends z.ZodType;
65
+ };
66
+ } ? z.output<S> : CapDef<C> extends {
67
+ readonly runtimeState: infer R extends z.ZodType;
68
+ } ? z.output<R> : never;
69
+ /** A top-level status field of cap `C`. */
70
+ export type CapStatusField<C extends VocabCapName> = [StatusOf<C>] extends [never] ? never : keyof StatusOf<C> & string;
71
+ /** An event name declared by cap `C`. */
72
+ export type CapEventName<C extends VocabCapName> = CapDef<C> extends {
73
+ readonly events: infer E;
74
+ } ? keyof E & string : never;
75
+ /** One choice of a closed set, with its label. */
76
+ export interface VocabChoice {
77
+ readonly value: string | number;
78
+ readonly label: L10n;
79
+ }
80
+ /** A closed set — every value MUST be one the method's Zod input accepts. */
81
+ export interface EnumOffer {
82
+ readonly kind: 'enum';
83
+ readonly values: readonly VocabChoice[];
84
+ }
85
+ /** A number, within the Zod input's bounds. `unit` is a display suffix. */
86
+ export interface NumberOffer {
87
+ readonly kind: 'number';
88
+ readonly min?: number;
89
+ readonly max?: number;
90
+ readonly step?: number;
91
+ readonly unit?: string;
92
+ }
93
+ /** Free text. */
94
+ export interface TextOffer {
95
+ readonly kind: 'text';
96
+ /** True for a secret the UI should mask (a PIN code). */
97
+ readonly secret?: boolean;
98
+ }
99
+ /** A yes/no. */
100
+ export interface BooleanOffer {
101
+ readonly kind: 'boolean';
102
+ }
103
+ /**
104
+ * Values the DEVICE knows, read at authoring time from the same cap:
105
+ * a status field holding a list, or a read method returning one.
106
+ * `valueKey` / `labelKey` pick the fields of an object item (omit both for a
107
+ * list of strings); `where` keeps only items whose field equals a value.
108
+ */
109
+ export type DynamicOffer<C extends VocabCapName> = {
110
+ readonly kind: 'dynamic';
111
+ readonly from: 'status';
112
+ readonly field: CapStatusField<C>;
113
+ readonly valueKey?: string;
114
+ readonly labelKey?: string;
115
+ readonly where?: {
116
+ readonly key: string;
117
+ readonly equals: string | number | boolean;
118
+ };
119
+ /** The type of the value the method takes (default string). */
120
+ readonly valueKind?: 'string' | 'number';
121
+ } | {
122
+ readonly kind: 'dynamic';
123
+ readonly from: 'method';
124
+ readonly method: CapMethodName<C>;
125
+ readonly valueKey?: string;
126
+ readonly labelKey?: string;
127
+ readonly where?: {
128
+ readonly key: string;
129
+ readonly equals: string | number | boolean;
130
+ };
131
+ readonly valueKind?: 'string' | 'number';
132
+ };
133
+ /** How the authoring UI offers a value for an open arg. */
134
+ export type VocabOffer<C extends VocabCapName> = EnumOffer | NumberOffer | TextOffer | BooleanOffer | DynamicOffer<C>;
135
+ /** An arg the operator fills after picking the action. */
136
+ export interface VocabOpenArg<C extends VocabCapName, K extends string> {
137
+ readonly key: K;
138
+ readonly label: L10n;
139
+ readonly offer: VocabOffer<C>;
140
+ /** The method accepts the call without it. */
141
+ readonly optional?: boolean;
142
+ }
143
+ /** One operator-facing action: a cap method call with a phrase. */
144
+ export interface VocabActionFor<C extends VocabCapName, M extends CapMethodName<C>> {
145
+ /** Stable id — persisted by pickers as a select value (`switch.on`). */
146
+ readonly id: string;
147
+ readonly method: M;
148
+ /** Short label for a picker ("Turn on"). */
149
+ readonly label: L10n;
150
+ /**
151
+ * The sentence ("Turn on {device}", "Move {device} to {presetId}").
152
+ * Placeholders: `{device}` and any open or fixed arg key.
153
+ */
154
+ readonly phrase: L10n;
155
+ readonly icon: VocabIcon;
156
+ /** Args baked into the action — never asked. */
157
+ readonly args?: Partial<ActionArgs<C, M>>;
158
+ /** Args the operator fills. */
159
+ readonly openArgs?: readonly VocabOpenArg<C, ActionArgKey<C, M>>[];
160
+ }
161
+ /** Any action of cap `C`, discriminated by `method`. */
162
+ export type VocabAction<C extends VocabCapName> = {
163
+ [M in CapMethodName<C>]: VocabActionFor<C, M>;
164
+ }[CapMethodName<C>];
165
+ /** A true/false field: one phrase per edge. */
166
+ export interface BooleanStateTrigger<C extends VocabCapName> {
167
+ readonly kind: 'boolean';
168
+ readonly field: CapStatusField<C>;
169
+ /** What the field is ("Contact", "Motion") — a picker label. */
170
+ readonly label: L10n;
171
+ readonly whenTrue: L10n;
172
+ readonly whenFalse: L10n;
173
+ readonly icon: VocabIcon;
174
+ }
175
+ /** A number: rises above / falls below / changes by, with a unit. */
176
+ export interface NumericStateTrigger<C extends VocabCapName> {
177
+ readonly kind: 'numeric';
178
+ readonly field: CapStatusField<C>;
179
+ /** The quantity WITH its article, as it reads in a sentence ("the temperature" / "la temperatura"). */
180
+ readonly quantity: L10n;
181
+ readonly label: L10n;
182
+ /** Display unit; omit when the device states it (see `unitField`). */
183
+ readonly unit?: string;
184
+ /** A status field carrying the device's own unit (`numeric-sensor.unit`). */
185
+ readonly unitField?: CapStatusField<C>;
186
+ readonly icon: VocabIcon;
187
+ }
188
+ /** One value of an enum field, with how "becomes" reads for it. */
189
+ export interface EnumStateValue {
190
+ readonly value: string;
191
+ readonly label: L10n;
192
+ /** Override of the default "When {device} changes to {value}". */
193
+ readonly phrase?: L10n;
194
+ }
195
+ /** A closed set of states. */
196
+ export interface EnumStateTrigger<C extends VocabCapName> {
197
+ readonly kind: 'enum';
198
+ readonly field: CapStatusField<C>;
199
+ readonly label: L10n;
200
+ readonly values: readonly EnumStateValue[];
201
+ readonly icon: VocabIcon;
202
+ }
203
+ /** A free string the device reports (a presence zone, an enum sensor's state). */
204
+ export interface ValueStateTrigger<C extends VocabCapName> {
205
+ readonly kind: 'value';
206
+ readonly field: CapStatusField<C>;
207
+ readonly label: L10n;
208
+ /** Where known values come from, when the device lists them. */
209
+ readonly offer?: DynamicOffer<C>;
210
+ /** Override of the default "When {device} changes to {value}". */
211
+ readonly phrase?: L10n;
212
+ readonly icon: VocabIcon;
213
+ }
214
+ /** A state field worth triggering on. */
215
+ export type VocabStateTrigger<C extends VocabCapName> = BooleanStateTrigger<C> | NumericStateTrigger<C> | EnumStateTrigger<C> | ValueStateTrigger<C>;
216
+ /** A bus event the device emits, phrased ("When {device} rings"). */
217
+ export interface VocabEventTrigger {
218
+ readonly category: EventCategory;
219
+ readonly label: L10n;
220
+ readonly phrase: L10n;
221
+ readonly icon: VocabIcon;
222
+ }
223
+ /** A declared cap event that is not an automation trigger, and why. */
224
+ export interface VocabEventExcused {
225
+ readonly notOperatorFacing: string;
226
+ }
227
+ /** Re-wording of one action for a kind of device. */
228
+ export interface VocabActionWording {
229
+ readonly label?: L10n;
230
+ readonly phrase?: L10n;
231
+ readonly icon?: VocabIcon;
232
+ }
233
+ /** Re-wording of one state trigger for a kind of device. */
234
+ export interface VocabStateWording {
235
+ readonly label?: L10n;
236
+ readonly whenTrue?: L10n;
237
+ readonly whenFalse?: L10n;
238
+ readonly quantity?: L10n;
239
+ readonly icon?: VocabIcon;
240
+ }
241
+ /** Wording that differs for a device type or role (a switch that is a siren). */
242
+ export interface VocabWording<C extends VocabCapName> {
243
+ /** Keyed by action id. */
244
+ readonly actions?: Readonly<Record<string, VocabActionWording>>;
245
+ readonly state?: {
246
+ readonly [F in CapStatusField<C>]?: VocabStateWording;
247
+ };
248
+ }
249
+ /** Overrides, keyed in the same map: a role beats a type. */
250
+ export interface VocabOverrides<C extends VocabCapName> {
251
+ readonly byType?: {
252
+ readonly [T in DeviceType]?: VocabWording<C>;
253
+ };
254
+ readonly byRole?: {
255
+ readonly [R in DeviceRole]?: VocabWording<C>;
256
+ };
257
+ }
258
+ type DeviceEventsBlock<C extends VocabCapName> = [CapEventName<C>] extends [never] ? {
259
+ readonly events?: undefined;
260
+ } : {
261
+ /** EVERY declared cap event: a trigger, or an excuse. */
262
+ readonly events: {
263
+ readonly [E in CapEventName<C>]: VocabEventTrigger | VocabEventExcused;
264
+ };
265
+ };
266
+ /** The vocabulary of a device-scoped cap. */
267
+ export type DeviceCapVocabulary<C extends VocabCapName> = {
268
+ readonly scope: 'device';
269
+ /** What the cap is, for grouping ("Switch" / "Interruttore"). */
270
+ readonly noun: L10n;
271
+ readonly actions?: readonly VocabAction<C>[];
272
+ /** Operate methods deliberately NOT offered, with the reason. */
273
+ readonly notOperatorFacing?: {
274
+ readonly [M in CapMethodName<C>]?: string;
275
+ };
276
+ readonly state?: readonly VocabStateTrigger<C>[];
277
+ /** Bus events the cap's devices emit with no declared cap event behind them. */
278
+ readonly extraEvents?: readonly VocabEventTrigger[];
279
+ readonly overrides?: VocabOverrides<C>;
280
+ } & DeviceEventsBlock<C>;
281
+ /** A system-scoped cap: never a device's vocabulary, and why. */
282
+ export interface SystemCapVocabulary {
283
+ readonly scope: 'system';
284
+ readonly notOperatorFacing: string;
285
+ }
286
+ /** The entry a cap must have. */
287
+ export type CapVocabularyEntry<C extends VocabCapName> = CapDef<C>['scope'] extends 'device' ? DeviceCapVocabulary<C> : SystemCapVocabulary;
288
+ /** The complete map: one entry per cap, no more, no fewer. */
289
+ export type CapVocabularyMap = {
290
+ readonly [C in VocabCapName]: CapVocabularyEntry<C>;
291
+ };
292
+ /** A slice of the map, for files that hold a family of caps. */
293
+ export type CapVocabularySlice<K extends VocabCapName> = {
294
+ readonly [C in K]: CapVocabularyEntry<C>;
295
+ };
296
+ /** A dynamic offer with no cap-specific key type. */
297
+ export type LooseDynamicOffer = {
298
+ readonly kind: 'dynamic';
299
+ readonly from: 'status';
300
+ readonly field: string;
301
+ readonly valueKey?: string;
302
+ readonly labelKey?: string;
303
+ readonly where?: {
304
+ readonly key: string;
305
+ readonly equals: string | number | boolean;
306
+ };
307
+ readonly valueKind?: 'string' | 'number';
308
+ } | {
309
+ readonly kind: 'dynamic';
310
+ readonly from: 'method';
311
+ readonly method: string;
312
+ readonly valueKey?: string;
313
+ readonly labelKey?: string;
314
+ readonly where?: {
315
+ readonly key: string;
316
+ readonly equals: string | number | boolean;
317
+ };
318
+ readonly valueKind?: 'string' | 'number';
319
+ };
320
+ /** An offer as a consumer reads it. */
321
+ export type LooseVocabOffer = EnumOffer | NumberOffer | TextOffer | BooleanOffer | LooseDynamicOffer;
322
+ /** An open arg as a consumer reads it, with no cap-specific key type. */
323
+ export interface LooseVocabOpenArg {
324
+ readonly key: string;
325
+ readonly label: L10n;
326
+ readonly offer: LooseVocabOffer;
327
+ readonly optional?: boolean;
328
+ }
329
+ /** An action as a consumer reads it. */
330
+ export interface LooseVocabAction {
331
+ readonly id: string;
332
+ readonly method: string;
333
+ readonly label: L10n;
334
+ readonly phrase: L10n;
335
+ readonly icon: VocabIcon;
336
+ readonly args?: Readonly<Record<string, unknown>>;
337
+ readonly openArgs?: readonly LooseVocabOpenArg[];
338
+ }
339
+ /** A boolean state trigger, string-keyed. */
340
+ export interface LooseBooleanStateTrigger {
341
+ readonly kind: 'boolean';
342
+ readonly field: string;
343
+ readonly label: L10n;
344
+ readonly whenTrue: L10n;
345
+ readonly whenFalse: L10n;
346
+ readonly icon: VocabIcon;
347
+ }
348
+ /** A numeric state trigger, string-keyed. */
349
+ export interface LooseNumericStateTrigger {
350
+ readonly kind: 'numeric';
351
+ readonly field: string;
352
+ readonly quantity: L10n;
353
+ readonly label: L10n;
354
+ readonly unit?: string;
355
+ readonly unitField?: string;
356
+ readonly icon: VocabIcon;
357
+ }
358
+ /** An enum state trigger, string-keyed. */
359
+ export interface LooseEnumStateTrigger {
360
+ readonly kind: 'enum';
361
+ readonly field: string;
362
+ readonly label: L10n;
363
+ readonly values: readonly EnumStateValue[];
364
+ readonly icon: VocabIcon;
365
+ }
366
+ /** A free-value state trigger, string-keyed. */
367
+ export interface LooseValueStateTrigger {
368
+ readonly kind: 'value';
369
+ readonly field: string;
370
+ readonly label: L10n;
371
+ readonly offer?: LooseDynamicOffer;
372
+ readonly phrase?: L10n;
373
+ readonly icon: VocabIcon;
374
+ }
375
+ /** A state trigger as a consumer reads it. */
376
+ export type LooseVocabStateTrigger = LooseBooleanStateTrigger | LooseNumericStateTrigger | LooseEnumStateTrigger | LooseValueStateTrigger;
377
+ /** Wording overrides as a consumer reads them. */
378
+ export interface LooseVocabWording {
379
+ readonly actions?: Readonly<Record<string, VocabActionWording>>;
380
+ readonly state?: Readonly<Record<string, VocabStateWording | undefined>>;
381
+ }
382
+ /** Overrides as a consumer reads them. */
383
+ export interface LooseVocabOverrides {
384
+ readonly byType?: Readonly<Record<string, LooseVocabWording | undefined>>;
385
+ readonly byRole?: Readonly<Record<string, LooseVocabWording | undefined>>;
386
+ }
387
+ /** Any entry of the map, string-keyed. */
388
+ export interface LooseCapVocabularyEntry {
389
+ readonly scope: 'device' | 'system';
390
+ readonly noun?: L10n;
391
+ readonly actions?: readonly LooseVocabAction[];
392
+ readonly notOperatorFacing?: string | Readonly<Record<string, string | undefined>>;
393
+ readonly state?: readonly LooseVocabStateTrigger[];
394
+ readonly events?: Readonly<Record<string, VocabEventTrigger | VocabEventExcused>>;
395
+ readonly extraEvents?: readonly VocabEventTrigger[];
396
+ readonly overrides?: LooseVocabOverrides;
397
+ }
398
+ export {};
@@ -0,0 +1,5 @@
1
+ import type { CapVocabularyMap, LooseCapVocabularyEntry } from './types.js';
2
+ /** Every capability's vocabulary, keyed by cap name. */
3
+ export declare const CAP_VOCABULARY: CapVocabularyMap;
4
+ /** The same map, read by a string cap name (a binding names caps as strings). */
5
+ export declare const CAP_VOCABULARY_BY_NAME: Readonly<Record<string, LooseCapVocabularyEntry>>;
@@ -1,9 +1,14 @@
1
+ import type { LooseVocabOffer } from './cap-vocabulary/types.js';
1
2
  import { DeviceType } from './device-type.js';
2
3
  /** An arg the authoring UI collects (not baked into the catalogue entry). */
3
4
  export interface DeviceDoOpenArg {
4
5
  readonly key: string;
5
6
  readonly label: string;
6
7
  readonly kind: 'string' | 'number';
8
+ /** How the vocabulary says to offer values (enum, range, the device's own list). */
9
+ readonly offer?: LooseVocabOffer;
10
+ /** The method accepts the call without it. */
11
+ readonly optional?: boolean;
7
12
  }
8
13
  /** One operator-facing action that becomes a cap method call. */
9
14
  export interface DeviceDoAction {
@@ -22,8 +27,9 @@ export interface DeviceDoAction {
22
27
  readonly openArgs?: readonly DeviceDoOpenArg[];
23
28
  }
24
29
  /**
25
- * The curated catalogue. Order is the order the select draws.
26
- * Args are baked in so the authoring UI never asks for JSON for these.
30
+ * The catalogue: every device-cap action of the vocabulary, in the
31
+ * vocabulary's order (the order the select draws). Args are baked in so the
32
+ * authoring UI never asks for JSON for these.
27
33
  */
28
34
  export declare const DEVICE_DO_ACTIONS: readonly DeviceDoAction[];
29
35
  /** True when METHOD_ACCESS_MAP still exposes this cap.method as actuatable. */
@@ -324,9 +324,8 @@ export declare enum EventCategory {
324
324
  PipelineMotionCalm = "pipeline.motion-calm",
325
325
  /**
326
326
  * Per-camera pipeline config was mutated by the orchestrator
327
- * (3-level settings change via `setAgentAddonDefaults` /
328
- * `setCameraStepToggle` / `setCameraPipelineForAgent` or a
329
- * pipeline-scoped `applyDeviceSettingsPatch`). Orchestrator
327
+ * (a settings change via `setAgentInferenceDevices` /
328
+ * `setCameraStepToggle` / `setCameraStepSettings`). Orchestrator
330
329
  * subscribes to its own emission to hot-reload the assigned runner
331
330
  * via `attachCamera` so the next frame executes against the new
332
331
  * engine/steps without waiting for a rebalance or the next
package/dist/enums.js CHANGED
@@ -1,5 +1,5 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
- const require_event_category = require("./event-category-7AwNbPjm.js");
2
+ const require_event_category = require("./event-category-CXrwjC3e.js");
3
3
  //#region src/enums/event-source-type.ts
4
4
  var EventSourceType = /* @__PURE__ */ function(EventSourceType) {
5
5
  EventSourceType["Addon"] = "addon";
package/dist/enums.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import { t as EventCategory } from "./event-category-BfJwUd2S.mjs";
1
+ import { t as EventCategory } from "./event-category-fDPduoeC.mjs";
2
2
  //#region src/enums/event-source-type.ts
3
3
  var EventSourceType = /* @__PURE__ */ function(EventSourceType) {
4
4
  EventSourceType["Addon"] = "addon";
@@ -325,9 +325,8 @@ var EventCategory = /* @__PURE__ */ function(EventCategory) {
325
325
  EventCategory["PipelineMotionCalm"] = "pipeline.motion-calm";
326
326
  /**
327
327
  * Per-camera pipeline config was mutated by the orchestrator
328
- * (3-level settings change via `setAgentAddonDefaults` /
329
- * `setCameraStepToggle` / `setCameraPipelineForAgent` or a
330
- * pipeline-scoped `applyDeviceSettingsPatch`). Orchestrator
328
+ * (a settings change via `setAgentInferenceDevices` /
329
+ * `setCameraStepToggle` / `setCameraStepSettings`). Orchestrator
331
330
  * subscribes to its own emission to hot-reload the assigned runner
332
331
  * via `attachCamera` so the next frame executes against the new
333
332
  * engine/steps without waiting for a rebalance or the next
@@ -325,9 +325,8 @@ var EventCategory = /* @__PURE__ */ function(EventCategory) {
325
325
  EventCategory["PipelineMotionCalm"] = "pipeline.motion-calm";
326
326
  /**
327
327
  * Per-camera pipeline config was mutated by the orchestrator
328
- * (3-level settings change via `setAgentAddonDefaults` /
329
- * `setCameraStepToggle` / `setCameraPipelineForAgent` or a
330
- * pipeline-scoped `applyDeviceSettingsPatch`). Orchestrator
328
+ * (a settings change via `setAgentInferenceDevices` /
329
+ * `setCameraStepToggle` / `setCameraStepSettings`). Orchestrator
331
330
  * subscribes to its own emission to hot-reload the assigned runner
332
331
  * via `attachCamera` so the next frame executes against the new
333
332
  * engine/steps without waiting for a rebalance or the next