@camstack/types 1.2.593 → 1.2.595

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 (52) hide show
  1. package/CHANGELOG.md +25 -0
  2. package/dist/addon.d.ts +1 -0
  3. package/dist/addon.js +157 -156
  4. package/dist/addon.mjs +4 -4
  5. package/dist/capabilities/composer.cap.d.ts +9 -0
  6. package/dist/capabilities/core-blocks.cap.d.ts +64 -0
  7. package/dist/capabilities/device-manager.cap.d.ts +681 -48
  8. package/dist/capabilities/index.d.ts +1 -1
  9. package/dist/capabilities/platform-probe.cap.d.ts +28 -0
  10. package/dist/capabilities/power-meter.cap.d.ts +16 -5
  11. package/dist/capabilities/power-source.cap.d.ts +10 -0
  12. package/dist/client.js +10 -1
  13. package/dist/client.mjs +10 -1
  14. package/dist/{composed-stable-id-BNTaDZEh.mjs → composed-stable-id-DIeNz933.mjs} +3 -0
  15. package/dist/{composed-stable-id-BdeYe5dD.js → composed-stable-id-DkF5-kuf.js} +3 -0
  16. package/dist/composition/composition-report.d.ts +3 -0
  17. package/dist/composition/composition.d.ts +14 -0
  18. package/dist/composition/power-source-link.d.ts +8 -0
  19. package/dist/device/base-device.d.ts +8 -0
  20. package/dist/device/device-icon.d.ts +1 -0
  21. package/dist/device/device-management.d.ts +4 -0
  22. package/dist/device/device-type.d.ts +4 -1
  23. package/dist/device/hero/hero-look.d.ts +1 -0
  24. package/dist/device/hero/hero-scene.d.ts +1 -0
  25. package/dist/device/identity-links.d.ts +310 -0
  26. package/dist/device/index.d.ts +2 -0
  27. package/dist/device/state-refresh.d.ts +15 -1
  28. package/dist/enums/event-category.d.ts +14 -0
  29. package/dist/enums.js +1 -1
  30. package/dist/enums.mjs +1 -1
  31. package/dist/{event-category-CY27-fF0.mjs → event-category-7P4A3bYA.mjs} +14 -0
  32. package/dist/{event-category-BKxXXxnV.js → event-category-CMA0-jGW.js} +14 -0
  33. package/dist/generated/addon-api.d.ts +35 -0
  34. package/dist/generated/addon-cap-facts.d.ts +1 -1
  35. package/dist/generated/customize-catalog.d.ts +4 -4
  36. package/dist/generated/device-proxy.d.ts +1 -1
  37. package/dist/generated/method-access-map.d.ts +1 -1
  38. package/dist/generated/method-device-selectors.d.ts +2 -2
  39. package/dist/generated/system-proxy.d.ts +1 -1
  40. package/dist/{implemented-methods-BarLh7tc.js → implemented-methods-DnfgAfI6.js} +17 -2
  41. package/dist/{implemented-methods-k3KProJd.mjs → implemented-methods-wFScvZ40.mjs} +12 -3
  42. package/dist/index.d.ts +5 -2
  43. package/dist/index.js +4204 -4224
  44. package/dist/index.mjs +348 -389
  45. package/dist/inference/runtime-capabilities.d.ts +13 -2
  46. package/dist/interfaces/addon.d.ts +3 -1
  47. package/dist/interfaces/platform.d.ts +32 -0
  48. package/dist/node.js +2 -2
  49. package/dist/node.mjs +2 -2
  50. package/dist/{sleep-DO-ayTnk.mjs → runtime-capabilities-Bgt5QBvO.mjs} +403 -3
  51. package/dist/{sleep-BOK28JE0.js → runtime-capabilities-wOKNm9iz.js} +498 -2
  52. package/package.json +1 -1
@@ -0,0 +1,310 @@
1
+ /**
2
+ * Identity links (planning#594, D1063): a RELATION between two devices of
3
+ * different integrations, decided from the identifiers their providers declared
4
+ * (D1059) — never from location, never from a name.
5
+ *
6
+ * A link is not a merge: both devices keep their provider, their id and their
7
+ * bindings. What a link adds to one of them is a Customize feature, stamped
8
+ * with the link's id (`CompositionFieldsFeature.contributedBy`), so the
9
+ * operator's switch for it is the feature's own `enabled` (D62, D676) and the
10
+ * link record never holds a second copy of it.
11
+ *
12
+ * | Kind | Sides | Evidence |
13
+ * | ------------- | -------------------------------------------- | ---------------------------------------- |
14
+ * | `same-device` | two views of ONE object, unordered | `identifiers` ↔ `identifiers` |
15
+ * | `poe-power` | `a` = the PoE port, `b` = the device it feeds | port `attachedIdentifiers` ↔ `identifiers` |
16
+ *
17
+ * The row id names the two sides by `<addonId>/<stableId>`, so a link survives
18
+ * a device re-registered under a new numeric id. A symmetric kind sorts its two
19
+ * refs; a directional kind keeps `a` as the attaching side.
20
+ */
21
+ import { z } from 'zod';
22
+ import { DeviceRole } from './device-type.js';
23
+ export declare const IDENTITY_LINK_KIND_NAMES: readonly ['same-device', 'poe-power'];
24
+ export declare const IdentityLinkKindSchema: z.ZodEnum<{
25
+ "poe-power": "poe-power";
26
+ "same-device": "same-device";
27
+ }>;
28
+ export type IdentityLinkKind = z.infer<typeof IdentityLinkKindSchema>;
29
+ /**
30
+ * - `proposed` — one strong key matched: waits for the operator;
31
+ * - `linked` — confirmed by the operator, or auto-linked on strong evidence;
32
+ * - `dismissed` — the operator said no (or unlinked): sticky, never re-proposed.
33
+ */
34
+ export declare const IdentityLinkStateSchema: z.ZodEnum<{
35
+ dismissed: "dismissed";
36
+ linked: "linked";
37
+ proposed: "proposed";
38
+ }>;
39
+ export type IdentityLinkState = z.infer<typeof IdentityLinkStateSchema>;
40
+ /** Who decided the current state: the matcher (`auto`) or the operator. */
41
+ export declare const IdentityLinkOriginSchema: z.ZodEnum<{
42
+ auto: "auto";
43
+ operator: "operator";
44
+ }>;
45
+ export type IdentityLinkOrigin = z.infer<typeof IdentityLinkOriginSchema>;
46
+ /** One side: the device ref that survives re-registration, plus its current numeric id. */
47
+ export declare const IdentityLinkSideSchema: z.ZodObject<{
48
+ addonId: z.ZodString;
49
+ stableId: z.ZodString;
50
+ deviceId: z.ZodNumber;
51
+ }, z.core.$strip>;
52
+ export type IdentityLinkSide = z.infer<typeof IdentityLinkSideSchema>;
53
+ /** The stored body of one `identity-links` record. */
54
+ export declare const IdentityLinkBodySchema: z.ZodObject<{
55
+ kind: z.ZodEnum<{
56
+ "poe-power": "poe-power";
57
+ "same-device": "same-device";
58
+ }>;
59
+ a: z.ZodObject<{
60
+ addonId: z.ZodString;
61
+ stableId: z.ZodString;
62
+ deviceId: z.ZodNumber;
63
+ }, z.core.$strip>;
64
+ b: z.ZodObject<{
65
+ addonId: z.ZodString;
66
+ stableId: z.ZodString;
67
+ deviceId: z.ZodNumber;
68
+ }, z.core.$strip>;
69
+ state: z.ZodEnum<{
70
+ dismissed: "dismissed";
71
+ linked: "linked";
72
+ proposed: "proposed";
73
+ }>;
74
+ origin: z.ZodEnum<{
75
+ auto: "auto";
76
+ operator: "operator";
77
+ }>;
78
+ evidence: z.ZodReadonly<z.ZodArray<z.ZodObject<{
79
+ key: z.ZodEnum<{
80
+ hostname: "hostname";
81
+ ip: "ip";
82
+ mac: "mac";
83
+ "machine-uuid": "machine-uuid";
84
+ serial: "serial";
85
+ "vendor-uid": "vendor-uid";
86
+ }>;
87
+ value: z.ZodString;
88
+ }, z.core.$strip>>>;
89
+ evidenceGone: z.ZodOptional<z.ZodLiteral<true>>;
90
+ createdAt: z.ZodNumber;
91
+ decidedAt: z.ZodOptional<z.ZodNumber>;
92
+ }, z.core.$strip>;
93
+ export type IdentityLinkBody = z.infer<typeof IdentityLinkBodySchema>;
94
+ export declare const IdentityLinkSchema: z.ZodObject<{
95
+ kind: z.ZodEnum<{
96
+ "poe-power": "poe-power";
97
+ "same-device": "same-device";
98
+ }>;
99
+ a: z.ZodObject<{
100
+ addonId: z.ZodString;
101
+ stableId: z.ZodString;
102
+ deviceId: z.ZodNumber;
103
+ }, z.core.$strip>;
104
+ b: z.ZodObject<{
105
+ addonId: z.ZodString;
106
+ stableId: z.ZodString;
107
+ deviceId: z.ZodNumber;
108
+ }, z.core.$strip>;
109
+ state: z.ZodEnum<{
110
+ dismissed: "dismissed";
111
+ linked: "linked";
112
+ proposed: "proposed";
113
+ }>;
114
+ origin: z.ZodEnum<{
115
+ auto: "auto";
116
+ operator: "operator";
117
+ }>;
118
+ evidence: z.ZodReadonly<z.ZodArray<z.ZodObject<{
119
+ key: z.ZodEnum<{
120
+ hostname: "hostname";
121
+ ip: "ip";
122
+ mac: "mac";
123
+ "machine-uuid": "machine-uuid";
124
+ serial: "serial";
125
+ "vendor-uid": "vendor-uid";
126
+ }>;
127
+ value: z.ZodString;
128
+ }, z.core.$strip>>>;
129
+ evidenceGone: z.ZodOptional<z.ZodLiteral<true>>;
130
+ createdAt: z.ZodNumber;
131
+ decidedAt: z.ZodOptional<z.ZodNumber>;
132
+ id: z.ZodString;
133
+ }, z.core.$strip>;
134
+ export type IdentityLink = z.infer<typeof IdentityLinkSchema>;
135
+ /** A device ref as a link id names it. */
136
+ export interface IdentityLinkRef {
137
+ readonly addonId: string;
138
+ readonly stableId: string;
139
+ }
140
+ /** One Customize feature a link kind adds to one of its sides. */
141
+ export interface IdentityLinkContribution {
142
+ /** The cap whose Customize target is filled. */
143
+ readonly cap: string;
144
+ /** The scalar target of that cap. */
145
+ readonly targetId: string;
146
+ /** The side that RECEIVES the feature. */
147
+ readonly host: 'a' | 'b';
148
+ /** The side the feature reads from. */
149
+ readonly source: 'a' | 'b';
150
+ /** What it reads on the source side. */
151
+ readonly sourceCap: string;
152
+ readonly sourceField: string;
153
+ }
154
+ export interface IdentityLinkKindSpec {
155
+ /** A directional kind keeps `a` as the attaching side; a symmetric one sorts its refs. */
156
+ readonly directional: boolean;
157
+ /** The role the attaching side (`a`) must have; `null` when any device may attach. */
158
+ readonly attachingRole: DeviceRole | null;
159
+ /** What a `linked` link of this kind adds, by default. */
160
+ readonly contributions: readonly IdentityLinkContribution[];
161
+ }
162
+ /** The one table of link kinds. */
163
+ export declare const IDENTITY_LINK_KINDS: Readonly<Record<IdentityLinkKind, IdentityLinkKindSpec>>;
164
+ /** Why a pair cannot be a link of a kind; `null` when it can. */
165
+ export type IdentityLinkSidesRefusal = 'attaching-side-role';
166
+ /** Whether the attaching side of `kind` may be a device of `aRole`. */
167
+ export declare function identityLinkSidesRefusal(kind: IdentityLinkKind, aRole: string | null | undefined): IdentityLinkSidesRefusal | null;
168
+ /**
169
+ * The record id of a link: `<kind>:<refA>|<refB>`. A symmetric kind sorts the
170
+ * two refs, so either order names one row; a directional kind keeps `a` first.
171
+ */
172
+ export declare function identityLinkId(kind: IdentityLinkKind, a: IdentityLinkRef, b: IdentityLinkRef): string;
173
+ /**
174
+ * The answer of `device-manager.listIdentityLinks`. `not-loaded` until the
175
+ * links have been read — never an empty list (D315).
176
+ */
177
+ export declare const IdentityLinksReadSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
178
+ status: z.ZodLiteral<"not-loaded">;
179
+ reason: z.ZodString;
180
+ }, z.core.$strip>, z.ZodObject<{
181
+ status: z.ZodLiteral<"answered">;
182
+ links: z.ZodReadonly<z.ZodArray<z.ZodObject<{
183
+ kind: z.ZodEnum<{
184
+ "poe-power": "poe-power";
185
+ "same-device": "same-device";
186
+ }>;
187
+ a: z.ZodObject<{
188
+ addonId: z.ZodString;
189
+ stableId: z.ZodString;
190
+ deviceId: z.ZodNumber;
191
+ }, z.core.$strip>;
192
+ b: z.ZodObject<{
193
+ addonId: z.ZodString;
194
+ stableId: z.ZodString;
195
+ deviceId: z.ZodNumber;
196
+ }, z.core.$strip>;
197
+ state: z.ZodEnum<{
198
+ dismissed: "dismissed";
199
+ linked: "linked";
200
+ proposed: "proposed";
201
+ }>;
202
+ origin: z.ZodEnum<{
203
+ auto: "auto";
204
+ operator: "operator";
205
+ }>;
206
+ evidence: z.ZodReadonly<z.ZodArray<z.ZodObject<{
207
+ key: z.ZodEnum<{
208
+ hostname: "hostname";
209
+ ip: "ip";
210
+ mac: "mac";
211
+ "machine-uuid": "machine-uuid";
212
+ serial: "serial";
213
+ "vendor-uid": "vendor-uid";
214
+ }>;
215
+ value: z.ZodString;
216
+ }, z.core.$strip>>>;
217
+ evidenceGone: z.ZodOptional<z.ZodLiteral<true>>;
218
+ createdAt: z.ZodNumber;
219
+ decidedAt: z.ZodOptional<z.ZodNumber>;
220
+ id: z.ZodString;
221
+ }, z.core.$strip>>>;
222
+ }, z.core.$strip>], "status">;
223
+ export type IdentityLinksRead = z.infer<typeof IdentityLinksReadSchema>;
224
+ /** Why an operator decision on a link was refused. */
225
+ export declare const IdentityLinkDecisionRefusalSchema: z.ZodEnum<{
226
+ "not-loaded": "not-loaded";
227
+ "unknown-link": "unknown-link";
228
+ "wrong-state": "wrong-state";
229
+ }>;
230
+ export type IdentityLinkDecisionRefusal = z.infer<typeof IdentityLinkDecisionRefusalSchema>;
231
+ /** The answer of `confirmIdentityLink` / `dismissIdentityLink` / `unlinkIdentity`. */
232
+ export declare const IdentityLinkDecisionSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
233
+ ok: z.ZodLiteral<true>;
234
+ link: z.ZodObject<{
235
+ kind: z.ZodEnum<{
236
+ "poe-power": "poe-power";
237
+ "same-device": "same-device";
238
+ }>;
239
+ a: z.ZodObject<{
240
+ addonId: z.ZodString;
241
+ stableId: z.ZodString;
242
+ deviceId: z.ZodNumber;
243
+ }, z.core.$strip>;
244
+ b: z.ZodObject<{
245
+ addonId: z.ZodString;
246
+ stableId: z.ZodString;
247
+ deviceId: z.ZodNumber;
248
+ }, z.core.$strip>;
249
+ state: z.ZodEnum<{
250
+ dismissed: "dismissed";
251
+ linked: "linked";
252
+ proposed: "proposed";
253
+ }>;
254
+ origin: z.ZodEnum<{
255
+ auto: "auto";
256
+ operator: "operator";
257
+ }>;
258
+ evidence: z.ZodReadonly<z.ZodArray<z.ZodObject<{
259
+ key: z.ZodEnum<{
260
+ hostname: "hostname";
261
+ ip: "ip";
262
+ mac: "mac";
263
+ "machine-uuid": "machine-uuid";
264
+ serial: "serial";
265
+ "vendor-uid": "vendor-uid";
266
+ }>;
267
+ value: z.ZodString;
268
+ }, z.core.$strip>>>;
269
+ evidenceGone: z.ZodOptional<z.ZodLiteral<true>>;
270
+ createdAt: z.ZodNumber;
271
+ decidedAt: z.ZodOptional<z.ZodNumber>;
272
+ id: z.ZodString;
273
+ }, z.core.$strip>;
274
+ }, z.core.$strip>, z.ZodObject<{
275
+ ok: z.ZodLiteral<false>;
276
+ reason: z.ZodEnum<{
277
+ "not-loaded": "not-loaded";
278
+ "unknown-link": "unknown-link";
279
+ "wrong-state": "wrong-state";
280
+ }>;
281
+ message: z.ZodString;
282
+ }, z.core.$strip>], "ok">;
283
+ export type IdentityLinkDecision = z.infer<typeof IdentityLinkDecisionSchema>;
284
+ /** Why a link was lost. */
285
+ export declare const IdentityLinkLostReasonSchema: z.ZodEnum<{
286
+ "device-removed": "device-removed";
287
+ "evidence-gone": "evidence-gone";
288
+ "operator-unlinked": "operator-unlinked";
289
+ }>;
290
+ export type IdentityLinkLostReason = z.infer<typeof IdentityLinkLostReasonSchema>;
291
+ /** The payload of `identity-link.created` / `identity-link.lost` (telemetry; the record is the truth). */
292
+ export declare const IdentityLinkEventPayloadSchema: z.ZodObject<{
293
+ linkId: z.ZodString;
294
+ kind: z.ZodEnum<{
295
+ "poe-power": "poe-power";
296
+ "same-device": "same-device";
297
+ }>;
298
+ aDeviceId: z.ZodNumber;
299
+ bDeviceId: z.ZodNumber;
300
+ origin: z.ZodEnum<{
301
+ auto: "auto";
302
+ operator: "operator";
303
+ }>;
304
+ reason: z.ZodOptional<z.ZodEnum<{
305
+ "device-removed": "device-removed";
306
+ "evidence-gone": "evidence-gone";
307
+ "operator-unlinked": "operator-unlinked";
308
+ }>>;
309
+ }, z.core.$strip>;
310
+ export type IdentityLinkEventPayload = z.infer<typeof IdentityLinkEventPayloadSchema>;
@@ -20,6 +20,8 @@ export { declareDeviceIdentifiers } from './declare-identifiers.js';
20
20
  export type { DeclareIdentifiersDeps, DeclareIdentifiersOptions, DeclareIdentifiersOutcome, DeclareIdentifiersResult, IdentifiersWriter, SetIdentifiersInput, } from './declare-identifiers.js';
21
21
  export { IdentityCandidateDeviceSchema, IdentityCandidatePairSchema, IdentityCandidatesSchema, IdentityConfidenceSchema, IdentityMatchedKeySchema, } from './device-identity-candidates.js';
22
22
  export type { IdentityCandidateDevice, IdentityCandidatePair, IdentityCandidates, IdentityConfidence, IdentityMatchedKey, } from './device-identity-candidates.js';
23
+ export { IDENTITY_LINK_KIND_NAMES, IDENTITY_LINK_KINDS, IdentityLinkBodySchema, IdentityLinkDecisionRefusalSchema, IdentityLinkDecisionSchema, IdentityLinkEventPayloadSchema, IdentityLinkKindSchema, IdentityLinkLostReasonSchema, IdentityLinkOriginSchema, IdentityLinkSchema, IdentityLinkSideSchema, IdentityLinkStateSchema, IdentityLinksReadSchema, identityLinkId, identityLinkSidesRefusal, } from './identity-links.js';
24
+ export type { IdentityLink, IdentityLinkBody, IdentityLinkContribution, IdentityLinkDecision, IdentityLinkDecisionRefusal, IdentityLinkEventPayload, IdentityLinkKind, IdentityLinkKindSpec, IdentityLinkLostReason, IdentityLinkOrigin, IdentityLinkRef, IdentityLinkSide, IdentityLinkSidesRefusal, IdentityLinkState, IdentityLinksRead, } from './identity-links.js';
23
25
  export type { DeviceProfile, DeviceProfileDefaults, DeviceProfileMatch, PipelinePhaseMode, } from './device-profile.js';
24
26
  export { BATTERY_DEVICE_PROFILE, DEVICE_PROFILES, deviceMatchesProfile, resolveDeviceProfile, } from './device-profile.js';
25
27
  export type { IDeviceRuntimeState, Snapshot as RuntimeStateSnapshot, } from './device-runtime-state.js';
@@ -45,7 +45,21 @@ export declare const StateRefreshPolicySchema: z.ZodObject<{
45
45
  export type StateRefreshPolicy = z.infer<typeof StateRefreshPolicySchema>;
46
46
  /** The cadence the core runs a policy at: the declared minimum, slowed (never sped up) by the setting. */
47
47
  export declare function effectiveRefreshIntervalMs(policy: StateRefreshPolicy): number;
48
- /** The burst after a command on a read (non-push) device: offsets from the command, in ms. */
48
+ /** The first reads after a command on a read (non-push) device: offsets from the command, in ms. */
49
49
  export declare const COMMAND_BURST_OFFSETS_MS: readonly number[];
50
+ /** After the first reads, a pending hold is re-read this often. */
51
+ export declare const COMMAND_BURST_STEP_MS = 10000;
52
+ /** The last read of a hold lands this long before it expires. */
53
+ export declare const COMMAND_BURST_TAIL_MS = 2000;
54
+ /**
55
+ * The reads after a command on a read device, for a hold that lasts `holdMs`
56
+ * more: {@link COMMAND_BURST_OFFSETS_MS}, then one every
57
+ * {@link COMMAND_BURST_STEP_MS}, then a last one {@link COMMAND_BURST_TAIL_MS}
58
+ * before the hold expires. A slow cloud is re-read for the whole hold, not
59
+ * only at the start. Offsets are in ms from now, ascending, all below `holdMs`.
60
+ */
61
+ /** The least gap between the last stepped read and the tail read. */
62
+ export declare const COMMAND_BURST_MIN_GAP_MS = 1000;
63
+ export declare function commandBurstOffsets(holdMs: number): readonly number[];
50
64
  /** How long the core waits for a push device to confirm a command before reading it once. */
51
65
  export declare const PUSH_CONFIRM_WINDOW_MS = 2500;
@@ -228,6 +228,20 @@ export declare enum EventCategory {
228
228
  * dropped) — consumers MUST also gate on the device record's `probed` flag.
229
229
  */
230
230
  DeviceReady = "device.ready",
231
+ /**
232
+ * An identity link (D1063) became `linked` — auto on strong evidence or
233
+ * confirmed by the operator — or a confirmed link's evidence came back. Telemetry: the `identity-links` record is the
234
+ * truth, and core-blocks reconciles its contributions from it as well.
235
+ * Payload: `IdentityLinkEventPayload`.
236
+ */
237
+ IdentityLinkCreated = "identity-link.created",
238
+ /**
239
+ * A `linked` identity link stopped acting: its evidence is gone (an auto link
240
+ * is deleted; an operator-confirmed one stays `linked`, flagged
241
+ * `evidenceGone`, and no longer acts), a side was removed, or the operator
242
+ * unlinked it. Payload: `IdentityLinkEventPayload` with `reason`.
243
+ */
244
+ IdentityLinkLost = "identity-link.lost",
231
245
  IntegrationEnabled = "integration.enabled",
232
246
  IntegrationDisabled = "integration.disabled",
233
247
  IntegrationDeleted = "integration.deleted",
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-BKxXXxnV.js");
2
+ const require_event_category = require("./event-category-CMA0-jGW.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-CY27-fF0.mjs";
1
+ import { t as EventCategory } from "./event-category-7P4A3bYA.mjs";
2
2
  //#region src/enums/event-source-type.ts
3
3
  var EventSourceType = /* @__PURE__ */ function(EventSourceType) {
4
4
  EventSourceType["Addon"] = "addon";
@@ -229,6 +229,20 @@ var EventCategory = /* @__PURE__ */ function(EventCategory) {
229
229
  * dropped) — consumers MUST also gate on the device record's `probed` flag.
230
230
  */
231
231
  EventCategory["DeviceReady"] = "device.ready";
232
+ /**
233
+ * An identity link (D1063) became `linked` — auto on strong evidence or
234
+ * confirmed by the operator — or a confirmed link's evidence came back. Telemetry: the `identity-links` record is the
235
+ * truth, and core-blocks reconciles its contributions from it as well.
236
+ * Payload: `IdentityLinkEventPayload`.
237
+ */
238
+ EventCategory["IdentityLinkCreated"] = "identity-link.created";
239
+ /**
240
+ * A `linked` identity link stopped acting: its evidence is gone (an auto link
241
+ * is deleted; an operator-confirmed one stays `linked`, flagged
242
+ * `evidenceGone`, and no longer acts), a side was removed, or the operator
243
+ * unlinked it. Payload: `IdentityLinkEventPayload` with `reason`.
244
+ */
245
+ EventCategory["IdentityLinkLost"] = "identity-link.lost";
232
246
  EventCategory["IntegrationEnabled"] = "integration.enabled";
233
247
  EventCategory["IntegrationDisabled"] = "integration.disabled";
234
248
  EventCategory["IntegrationDeleted"] = "integration.deleted";
@@ -229,6 +229,20 @@ var EventCategory = /* @__PURE__ */ function(EventCategory) {
229
229
  * dropped) — consumers MUST also gate on the device record's `probed` flag.
230
230
  */
231
231
  EventCategory["DeviceReady"] = "device.ready";
232
+ /**
233
+ * An identity link (D1063) became `linked` — auto on strong evidence or
234
+ * confirmed by the operator — or a confirmed link's evidence came back. Telemetry: the `identity-links` record is the
235
+ * truth, and core-blocks reconciles its contributions from it as well.
236
+ * Payload: `IdentityLinkEventPayload`.
237
+ */
238
+ EventCategory["IdentityLinkCreated"] = "identity-link.created";
239
+ /**
240
+ * A `linked` identity link stopped acting: its evidence is gone (an auto link
241
+ * is deleted; an operator-confirmed one stays `linked`, flagged
242
+ * `evidenceGone`, and no longer acts), a side was removed, or the operator
243
+ * unlinked it. Payload: `IdentityLinkEventPayload` with `reason`.
244
+ */
245
+ EventCategory["IdentityLinkLost"] = "identity-link.lost";
232
246
  EventCategory["IntegrationEnabled"] = "integration.enabled";
233
247
  EventCategory["IntegrationDisabled"] = "integration.disabled";
234
248
  EventCategory["IntegrationDeleted"] = "integration.deleted";
@@ -2836,6 +2836,41 @@ export type AppRouter = TrpcCoreRouter<{
2836
2836
  output: z.infer<typeof deviceManagerCapability.methods.listIdentityCandidates.output>;
2837
2837
  meta: object;
2838
2838
  }>;
2839
+ setAttachedIdentifiers: TRPCMutationProcedure<{
2840
+ input: {
2841
+ [x: string]: unknown;
2842
+ } & z.input<typeof deviceManagerCapability.methods.setAttachedIdentifiers.input>;
2843
+ output: z.infer<typeof deviceManagerCapability.methods.setAttachedIdentifiers.output>;
2844
+ meta: object;
2845
+ }>;
2846
+ listIdentityLinks: TRPCQueryProcedure<{
2847
+ input: {
2848
+ [x: string]: unknown;
2849
+ } & z.input<typeof deviceManagerCapability.methods.listIdentityLinks.input>;
2850
+ output: z.infer<typeof deviceManagerCapability.methods.listIdentityLinks.output>;
2851
+ meta: object;
2852
+ }>;
2853
+ confirmIdentityLink: TRPCMutationProcedure<{
2854
+ input: {
2855
+ [x: string]: unknown;
2856
+ } & z.input<typeof deviceManagerCapability.methods.confirmIdentityLink.input>;
2857
+ output: z.infer<typeof deviceManagerCapability.methods.confirmIdentityLink.output>;
2858
+ meta: object;
2859
+ }>;
2860
+ dismissIdentityLink: TRPCMutationProcedure<{
2861
+ input: {
2862
+ [x: string]: unknown;
2863
+ } & z.input<typeof deviceManagerCapability.methods.dismissIdentityLink.input>;
2864
+ output: z.infer<typeof deviceManagerCapability.methods.dismissIdentityLink.output>;
2865
+ meta: object;
2866
+ }>;
2867
+ unlinkIdentity: TRPCMutationProcedure<{
2868
+ input: {
2869
+ [x: string]: unknown;
2870
+ } & z.input<typeof deviceManagerCapability.methods.unlinkIdentity.input>;
2871
+ output: z.infer<typeof deviceManagerCapability.methods.unlinkIdentity.output>;
2872
+ meta: object;
2873
+ }>;
2839
2874
  listLocations: TRPCQueryProcedure<{
2840
2875
  input: {
2841
2876
  nodeId?: string | undefined;
@@ -5,7 +5,7 @@
5
5
  * `ALL_CAPABILITY_DEFINITIONS` (the whole Zod schema graph, ~+100 MB heap per
6
6
  * runner). See docs/decisions/adr-0028.md.
7
7
  *
8
- * Coverage: 1 advance-derived caps, 89 caps with 475 state leaves, 15 caps with a declared method timeout.
8
+ * Coverage: 1 advance-derived caps, 89 caps with 476 state leaves, 15 caps with a declared method timeout.
9
9
  */
10
10
  /** A bindable scalar in a capability's runtime state. */
11
11
  export interface CapStateLeaf {
@@ -564,7 +564,7 @@ export declare const CAP_CUSTOMIZE_CATALOG: {
564
564
  readonly targets: readonly [{
565
565
  readonly id: 'power';
566
566
  readonly cardinality: 'scalar';
567
- readonly deviceTypes: readonly [DeviceType.Switch, DeviceType.Light, DeviceType.Fan, DeviceType.Climate, DeviceType.Humidifier, DeviceType.WaterHeater, DeviceType.MediaPlayer, DeviceType.Washer, DeviceType.Dryer, DeviceType.Dishwasher, DeviceType.Vacuum, DeviceType.LawnMower, DeviceType.PetFeeder];
567
+ readonly deviceTypes: readonly [DeviceType.Switch, DeviceType.Light, DeviceType.Fan, DeviceType.Climate, DeviceType.Humidifier, DeviceType.WaterHeater, DeviceType.MediaPlayer, DeviceType.Washer, DeviceType.Dryer, DeviceType.Dishwasher, DeviceType.Vacuum, DeviceType.LawnMower, DeviceType.PetFeeder, DeviceType.Workload];
568
568
  readonly apply: 'add';
569
569
  readonly vocabularyCap: 'power-meter';
570
570
  readonly vocabularyStateField: 'power';
@@ -591,7 +591,7 @@ export declare const CAP_CUSTOMIZE_CATALOG: {
591
591
  }, {
592
592
  readonly id: 'energy';
593
593
  readonly cardinality: 'scalar';
594
- readonly deviceTypes: readonly [DeviceType.Switch, DeviceType.Light, DeviceType.Fan, DeviceType.Climate, DeviceType.Humidifier, DeviceType.WaterHeater, DeviceType.MediaPlayer, DeviceType.Washer, DeviceType.Dryer, DeviceType.Dishwasher, DeviceType.Vacuum, DeviceType.LawnMower, DeviceType.PetFeeder];
594
+ readonly deviceTypes: readonly [DeviceType.Switch, DeviceType.Light, DeviceType.Fan, DeviceType.Climate, DeviceType.Humidifier, DeviceType.WaterHeater, DeviceType.MediaPlayer, DeviceType.Washer, DeviceType.Dryer, DeviceType.Dishwasher, DeviceType.Vacuum, DeviceType.LawnMower, DeviceType.PetFeeder, DeviceType.Workload];
595
595
  readonly apply: 'add';
596
596
  readonly vocabularyCap: 'power-meter';
597
597
  readonly vocabularyStateField: 'energy';
@@ -618,7 +618,7 @@ export declare const CAP_CUSTOMIZE_CATALOG: {
618
618
  }, {
619
619
  readonly id: 'voltage';
620
620
  readonly cardinality: 'scalar';
621
- readonly deviceTypes: readonly [DeviceType.Switch, DeviceType.Light, DeviceType.Fan, DeviceType.Climate, DeviceType.Humidifier, DeviceType.WaterHeater, DeviceType.MediaPlayer, DeviceType.Washer, DeviceType.Dryer, DeviceType.Dishwasher, DeviceType.Vacuum, DeviceType.LawnMower, DeviceType.PetFeeder];
621
+ readonly deviceTypes: readonly [DeviceType.Switch, DeviceType.Light, DeviceType.Fan, DeviceType.Climate, DeviceType.Humidifier, DeviceType.WaterHeater, DeviceType.MediaPlayer, DeviceType.Washer, DeviceType.Dryer, DeviceType.Dishwasher, DeviceType.Vacuum, DeviceType.LawnMower, DeviceType.PetFeeder, DeviceType.Workload];
622
622
  readonly apply: 'add';
623
623
  readonly vocabularyCap: 'power-meter';
624
624
  readonly vocabularyStateField: 'voltage';
@@ -645,7 +645,7 @@ export declare const CAP_CUSTOMIZE_CATALOG: {
645
645
  }, {
646
646
  readonly id: 'current';
647
647
  readonly cardinality: 'scalar';
648
- readonly deviceTypes: readonly [DeviceType.Switch, DeviceType.Light, DeviceType.Fan, DeviceType.Climate, DeviceType.Humidifier, DeviceType.WaterHeater, DeviceType.MediaPlayer, DeviceType.Washer, DeviceType.Dryer, DeviceType.Dishwasher, DeviceType.Vacuum, DeviceType.LawnMower, DeviceType.PetFeeder];
648
+ readonly deviceTypes: readonly [DeviceType.Switch, DeviceType.Light, DeviceType.Fan, DeviceType.Climate, DeviceType.Humidifier, DeviceType.WaterHeater, DeviceType.MediaPlayer, DeviceType.Washer, DeviceType.Dryer, DeviceType.Dishwasher, DeviceType.Vacuum, DeviceType.LawnMower, DeviceType.PetFeeder, DeviceType.Workload];
649
649
  readonly apply: 'add';
650
650
  readonly vocabularyCap: 'power-meter';
651
651
  readonly vocabularyStateField: 'current';
@@ -366,7 +366,7 @@ export interface DeviceProxy {
366
366
  readonly deviceAdoption: Pick<InferDeviceProxyCap<typeof deviceAdoptionCapability>, 'getStatus'>;
367
367
  readonly deviceExport: Pick<InferDeviceProxyCap<typeof deviceExportCapability>, 'getDeviceSettingsContribution' | 'getDeviceLiveContribution' | 'applyDeviceSettingsPatch'>;
368
368
  readonly deviceHistory: Pick<InferDeviceProxyCap<typeof deviceHistoryCapability>, 'listSeries' | 'query' | 'getDeviceEnabled' | 'setDeviceEnabled' | 'deleteSeriesRange'>;
369
- readonly deviceManager: Pick<InferDeviceProxyCap<typeof deviceManagerCapability>, 'loadConfig' | 'loadRuntimeState' | 'loadMeta' | 'setName' | 'setAlias' | 'setLocation' | 'setTags' | 'setType' | 'setIntegrationId' | 'setLinkDeviceId' | 'setPrimaryChildEntityId' | 'setChildLayout' | 'setPrimaryChildPreference' | 'setDisplay' | 'getWireableFields' | 'setRole' | 'applyInitialMeta' | 'setMetadata' | 'setIdentifiers' | 'setDisabled' | 'getDevice' | 'getLinkedDevices' | 'getStreamSources' | 'getConfigSchema' | 'getSettingsSchema' | 'updateConfig' | 'enable' | 'disable' | 'remove' | 'getStreamProfileMap' | 'setStreamProfileMap' | 'probeStreams' | 'getBindings' | 'setWrapperActive' | 'getWrapperActivation' | 'getDeviceSettingsAggregate' | 'getDeviceLiveInfoAggregate' | 'getDeviceAggregate' | 'runDeviceAction' | 'updateDeviceField' | 'updateDeviceFieldsBatch' | 'testField' | 'getDeviceStatusAggregate'>;
369
+ readonly deviceManager: Pick<InferDeviceProxyCap<typeof deviceManagerCapability>, 'loadConfig' | 'loadRuntimeState' | 'loadMeta' | 'setName' | 'setAlias' | 'setLocation' | 'setTags' | 'setType' | 'setIntegrationId' | 'setLinkDeviceId' | 'setPrimaryChildEntityId' | 'setChildLayout' | 'setPrimaryChildPreference' | 'setDisplay' | 'getWireableFields' | 'setRole' | 'applyInitialMeta' | 'setMetadata' | 'setIdentifiers' | 'setAttachedIdentifiers' | 'listIdentityLinks' | 'setDisabled' | 'getDevice' | 'getLinkedDevices' | 'getStreamSources' | 'getConfigSchema' | 'getSettingsSchema' | 'updateConfig' | 'enable' | 'disable' | 'remove' | 'getStreamProfileMap' | 'setStreamProfileMap' | 'probeStreams' | 'getBindings' | 'setWrapperActive' | 'getWrapperActivation' | 'getDeviceSettingsAggregate' | 'getDeviceLiveInfoAggregate' | 'getDeviceAggregate' | 'runDeviceAction' | 'updateDeviceField' | 'updateDeviceFieldsBatch' | 'testField' | 'getDeviceStatusAggregate'>;
370
370
  readonly deviceState: Pick<InferDeviceProxyCap<typeof deviceStateCapability>, 'getSnapshot' | 'getCapSlice' | 'setCapSlice' | 'claimFields' | 'patchOwnedFields' | 'releaseClaim' | 'getNativeCapSlice'>;
371
371
  readonly faceGallery: Pick<InferDeviceProxyCap<typeof faceGalleryCapability>, 'listRecentFaces' | 'getFaceByTrack'>;
372
372
  readonly networkQuality: Pick<InferDeviceProxyCap<typeof networkQualityCapability>, 'getDeviceStats' | 'reportClientStats'>;
@@ -6,7 +6,7 @@
6
6
  * scope+access check inside `protectedProcedure` (see
7
7
  * `server/backend/src/api/trpc/trpc.middleware.ts`).
8
8
  *
9
- * Coverage: 1524 method paths across 214 capabilities.
9
+ * Coverage: 1529 method paths across 214 capabilities.
10
10
  */
11
11
  import type { MethodRole } from '../auth/viewer-access.js';
12
12
  import type { CapabilityMethodAccess } from '../capabilities/capability-definition.js';
@@ -6,8 +6,8 @@
6
6
  * system-scope cap that takes a deviceId was previously never device-filtered
7
7
  * — see the generator header).
8
8
  *
9
- * Coverage: 645 methods carry a device reference, of which
10
- * 199 are on SYSTEM-scope caps.
9
+ * Coverage: 647 methods carry a device reference, of which
10
+ * 201 are on SYSTEM-scope caps.
11
11
  *
12
12
  * Top-level fields, number arrays, and one-level arrays of objects carrying
13
13
  * a numeric device field (targets[].deviceId) are all mapped; the matcher
@@ -94,7 +94,7 @@ export interface SystemProxy {
94
94
  readonly deviceCredentials: Pick<InferProvider<typeof deviceCredentialsCapability>, 'listDeviceCredentials' | 'startEnrollment' | 'revokeDeviceCredential' | 'getDeviceCertificateSettings' | 'setDeviceCertificateSettings' | 'deleteDeviceCredential' | 'getDeviceCaStatus' | 'renameDeviceCredential'>;
95
95
  readonly deviceExport: Pick<InferProvider<typeof deviceExportCapability>, 'getStatus' | 'listInstances' | 'listSupportedDeviceKinds' | 'listExposedDevices' | 'exposeDevice' | 'unexposeDevice' | 'setExposedName' | 'listSupportedEntityKinds' | 'listExposedEntities' | 'exposeEntity' | 'unexposeEntity'>;
96
96
  readonly deviceHistory: Pick<InferProvider<typeof deviceHistoryCapability>, 'listNodeSeries' | 'queryNode' | 'queryMany' | 'declareSeries' | 'record' | 'recordBuckets' | 'getStatus' | 'listOrphanSeries' | 'deleteOrphanSeries'>;
97
- readonly deviceManager: Pick<InferProvider<typeof deviceManagerCapability>, 'allocateDeviceId' | 'migrateDevice' | 'registerDevice' | 'removeDevice' | 'persistConfig' | 'renderDeviceTemplates' | 'checkDeviceTemplates' | 'getRoleDisplayDefaults' | 'setRoleDisplayDefaults' | 'listIdentityCandidates' | 'listLocations' | 'addLocation' | 'removeLocation' | 'renameLocation' | 'listLocationIcons' | 'setLocationIcon' | 'listLocationDescriptions' | 'setLocationDescription' | 'listSiteZones' | 'setSiteZone' | 'removeSiteZone' | 'renameSiteZone' | 'setLocationZone' | 'listPersistedByAddon' | 'listAll' | 'search' | 'getChildren' | 'getChildrenBatch' | 'getLinkedDevicesBatch' | 'listDeletedSince' | 'cleanupDeletedDevicesData' | 'removeByIntegration' | 'getBindingsBatch' | 'getAllBindings' | 'listDeviceIdsByCaps' | 'listWrappersForCap' | 'listBindableCapsForDeviceType' | 'discoverDevices' | 'adoptDevice' | 'getCreationSchema' | 'createDevice' | 'testCreationField' | 'adoptionListCandidateFilters' | 'adoptionListCandidates' | 'adoptionRefresh' | 'adoptionAdopt' | 'adoptionRelease' | 'adoptionStartJob' | 'adoptionListJobs' | 'adoptionCancelJob' | 'adoptionResync' | 'discoveryProviders' | 'discoverAllProviders' | 'discoverProvider' | 'listDiscoveryProposals' | 'dismissDiscoveryProposal' | 'reportDiscoveryObservations' | 'runDiscoverySweep' | 'providerCreationType' | 'providerDiscoveryParamsSchema' | 'getDeviceStatusAggregateBatch'>;
97
+ readonly deviceManager: Pick<InferProvider<typeof deviceManagerCapability>, 'allocateDeviceId' | 'migrateDevice' | 'registerDevice' | 'removeDevice' | 'persistConfig' | 'renderDeviceTemplates' | 'checkDeviceTemplates' | 'getRoleDisplayDefaults' | 'setRoleDisplayDefaults' | 'listIdentityCandidates' | 'confirmIdentityLink' | 'dismissIdentityLink' | 'unlinkIdentity' | 'listLocations' | 'addLocation' | 'removeLocation' | 'renameLocation' | 'listLocationIcons' | 'setLocationIcon' | 'listLocationDescriptions' | 'setLocationDescription' | 'listSiteZones' | 'setSiteZone' | 'removeSiteZone' | 'renameSiteZone' | 'setLocationZone' | 'listPersistedByAddon' | 'listAll' | 'search' | 'getChildren' | 'getChildrenBatch' | 'getLinkedDevicesBatch' | 'listDeletedSince' | 'cleanupDeletedDevicesData' | 'removeByIntegration' | 'getBindingsBatch' | 'getAllBindings' | 'listDeviceIdsByCaps' | 'listWrappersForCap' | 'listBindableCapsForDeviceType' | 'discoverDevices' | 'adoptDevice' | 'getCreationSchema' | 'createDevice' | 'testCreationField' | 'adoptionListCandidateFilters' | 'adoptionListCandidates' | 'adoptionRefresh' | 'adoptionAdopt' | 'adoptionRelease' | 'adoptionStartJob' | 'adoptionListJobs' | 'adoptionCancelJob' | 'adoptionResync' | 'discoveryProviders' | 'discoverAllProviders' | 'discoverProvider' | 'listDiscoveryProposals' | 'dismissDiscoveryProposal' | 'reportDiscoveryObservations' | 'runDiscoverySweep' | 'providerCreationType' | 'providerDiscoveryParamsSchema' | 'getDeviceStatusAggregateBatch'>;
98
98
  readonly deviceProvider: Pick<InferProvider<typeof deviceProviderCapability>, 'start' | 'stop' | 'getStatus' | 'getDevices' | 'reloadDevice' | 'supportsDiscovery' | 'discoverDevices' | 'getDiscoveryModes' | 'classifyDiscoveryHits' | 'getDiscoveryParamsSchema' | 'getManualCreationType' | 'adoptDiscoveredDevice' | 'supportsManualCreation' | 'getChildCreationSchema' | 'createDevice' | 'testCreationField'>;
99
99
  readonly deviceState: Pick<InferProvider<typeof deviceStateCapability>, 'getAllSnapshots' | 'listClaims'>;
100
100
  readonly displayPalette: Pick<InferProvider<typeof displayPaletteCapability>, 'getPalette' | 'listPresets' | 'setPalette'>;
@@ -1,4 +1,4 @@
1
- const require_composed_stable_id = require("./composed-stable-id-BdeYe5dD.js");
1
+ const require_composed_stable_id = require("./composed-stable-id-DkF5-kuf.js");
2
2
  let zod = require("zod");
3
3
  let node_crypto = require("node:crypto");
4
4
  //#region src/ffmpeg/invocation.ts
@@ -3441,6 +3441,8 @@ var CompositionItemEntrySchema = zod.z.object({
3441
3441
  */
3442
3442
  reset: CompositionForwardCommandSchema.optional()
3443
3443
  });
3444
+ /** Which identity link added a feature (D1063). */
3445
+ var CompositionContributedBySchema = zod.z.object({ linkId: zod.z.string().min(1) });
3444
3446
  var CompositionFieldsFeatureSchema = zod.z.object({
3445
3447
  kind: zod.z.literal("fields"),
3446
3448
  cap: zod.z.string().min(1),
@@ -3452,7 +3454,14 @@ var CompositionFieldsFeatureSchema = zod.z.object({
3452
3454
  */
3453
3455
  items: zod.z.record(zod.z.string().regex(COMPOSITION_ITEM_KEY_RE), CompositionItemEntrySchema).refine((items) => Object.keys(items).length <= 16, { message: `at most 16 items` }).optional(),
3454
3456
  /** Method name → what serves it. Only a BUILT capability takes commands (D967). */
3455
- commands: zod.z.record(zod.z.string().min(1), CompositionCommandTargetSchema).optional()
3457
+ commands: zod.z.record(zod.z.string().min(1), CompositionCommandTargetSchema).optional(),
3458
+ /**
3459
+ * Provenance only (D1063): the identity link that added this feature. The
3460
+ * source ref stays in `fields`; `enabled` stays the operator's switch. An
3461
+ * operator edit of the source drops the stamp and the feature becomes the
3462
+ * operator's; a lost link removes only stamped features.
3463
+ */
3464
+ contributedBy: CompositionContributedBySchema.optional()
3456
3465
  });
3457
3466
  /** RESERVED for slice 3: a media / data-plane cap, whole, from one source. */
3458
3467
  var CompositionPassthroughFeatureSchema = zod.z.object({
@@ -3723,6 +3732,12 @@ Object.defineProperty(exports, "CompositionCommandTargetSchema", {
3723
3732
  return CompositionCommandTargetSchema;
3724
3733
  }
3725
3734
  });
3735
+ Object.defineProperty(exports, "CompositionContributedBySchema", {
3736
+ enumerable: true,
3737
+ get: function() {
3738
+ return CompositionContributedBySchema;
3739
+ }
3740
+ });
3726
3741
  Object.defineProperty(exports, "CompositionExistingTargetSchema", {
3727
3742
  enumerable: true,
3728
3743
  get: function() {