@camstack/types 1.2.592 → 1.2.594

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 (43) hide show
  1. package/CHANGELOG.md +17 -0
  2. package/dist/addon.js +2 -2
  3. package/dist/addon.mjs +2 -2
  4. package/dist/capabilities/composer.cap.d.ts +9 -0
  5. package/dist/capabilities/core-blocks.cap.d.ts +64 -0
  6. package/dist/capabilities/device-manager.cap.d.ts +681 -48
  7. package/dist/capabilities/device-state-refresh.cap.d.ts +58 -0
  8. package/dist/capabilities/index.d.ts +3 -1
  9. package/dist/capabilities/power-source.cap.d.ts +10 -0
  10. package/dist/client.js +10 -0
  11. package/dist/client.mjs +10 -0
  12. package/dist/composition/composition-report.d.ts +3 -0
  13. package/dist/composition/composition.d.ts +14 -0
  14. package/dist/composition/power-source-link.d.ts +8 -0
  15. package/dist/device/base-device.d.ts +8 -0
  16. package/dist/device/command-hold.d.ts +6 -0
  17. package/dist/device/device-management.d.ts +4 -0
  18. package/dist/device/identity-links.d.ts +310 -0
  19. package/dist/device/index.d.ts +2 -0
  20. package/dist/device/state-refresh.d.ts +51 -0
  21. package/dist/enums/event-category.d.ts +14 -0
  22. package/dist/enums.js +1 -1
  23. package/dist/enums.mjs +1 -1
  24. package/dist/{event-category-CY27-fF0.mjs → event-category-7P4A3bYA.mjs} +14 -0
  25. package/dist/{event-category-BKxXXxnV.js → event-category-CMA0-jGW.js} +14 -0
  26. package/dist/generated/addon-api.d.ts +57 -0
  27. package/dist/generated/cap-vocabulary.d.ts +1 -1
  28. package/dist/generated/capability-router-map.d.ts +5 -2
  29. package/dist/generated/device-proxy.d.ts +3 -1
  30. package/dist/generated/device-scoped-caps.d.ts +1 -1
  31. package/dist/generated/method-access-map.d.ts +1 -1
  32. package/dist/generated/method-device-selectors.d.ts +2 -2
  33. package/dist/generated/system-proxy.d.ts +1 -1
  34. package/dist/{implemented-methods-k3KProJd.mjs → implemented-methods-DXeNAPAS.mjs} +11 -2
  35. package/dist/{implemented-methods-BarLh7tc.js → implemented-methods-Dj_2fX8-.js} +16 -1
  36. package/dist/index.d.ts +3 -0
  37. package/dist/index.js +442 -12
  38. package/dist/index.mjs +416 -13
  39. package/dist/node.js +1 -1
  40. package/dist/node.mjs +1 -1
  41. package/dist/{sleep-D2Ny6tvi.js → sleep-Bgzv_TCG.js} +23 -3
  42. package/dist/{sleep-dgC2VKW4.mjs → sleep-C9eelFbV.mjs} +23 -3
  43. 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';
@@ -0,0 +1,51 @@
1
+ /**
2
+ * Server-driven device state refresh (D1062): the core decides WHEN a device is
3
+ * re-read, the integration only knows HOW.
4
+ *
5
+ * A provider states its policy where it registers the device's
6
+ * `device-state-refresh` cap (`ctx.registerNativeCap(cap, provider, {
7
+ * stateRefresh })`). It reaches the hub by the road the command-hold options
8
+ * take (D1061): written directly in-process, carried on a forked child's cap
9
+ * descriptors otherwise. Plain data, wire-safe.
10
+ */
11
+ import { z } from 'zod';
12
+ /** Why the core asks for a refresh. */
13
+ export declare const StateRefreshReasonSchema: z.ZodEnum<{
14
+ burst: "burst";
15
+ command: "command";
16
+ schedule: "schedule";
17
+ }>;
18
+ export type StateRefreshReason = z.infer<typeof StateRefreshReasonSchema>;
19
+ /**
20
+ * What arrives without asking: `none` (everything is read), `partial` (some
21
+ * fields arrive by push, the rest is read on the schedule), `full` (everything
22
+ * arrives by push — never read on a schedule).
23
+ */
24
+ export declare const StateRefreshPushSchema: z.ZodEnum<{
25
+ full: "full";
26
+ none: "none";
27
+ partial: "partial";
28
+ }>;
29
+ export type StateRefreshPush = z.infer<typeof StateRefreshPushSchema>;
30
+ /** The fastest base cadence the core accepts from any provider. */
31
+ export declare const MIN_STATE_REFRESH_INTERVAL_MS = 1000;
32
+ export declare const StateRefreshPolicySchema: z.ZodObject<{
33
+ integrationId: z.ZodString;
34
+ minIntervalMs: z.ZodNumber;
35
+ intervalMs: z.ZodOptional<z.ZodNumber>;
36
+ batch: z.ZodBoolean;
37
+ push: z.ZodEnum<{
38
+ full: "full";
39
+ none: "none";
40
+ partial: "partial";
41
+ }>;
42
+ heartbeatMs: z.ZodOptional<z.ZodNumber>;
43
+ connectionEpoch: z.ZodOptional<z.ZodNumber>;
44
+ }, z.core.$strip>;
45
+ export type StateRefreshPolicy = z.infer<typeof StateRefreshPolicySchema>;
46
+ /** The cadence the core runs a policy at: the declared minimum, slowed (never sped up) by the setting. */
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. */
49
+ export declare const COMMAND_BURST_OFFSETS_MS: readonly number[];
50
+ /** How long the core waits for a push device to confirm a command before reading it once. */
51
+ 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";
@@ -53,6 +53,7 @@ import type { deviceOpsCapability } from '../capabilities/device-ops.cap.js';
53
53
  import type { deviceProviderCapability } from '../capabilities/device-provider.cap.js';
54
54
  import type { deviceRemovalHookCapability } from '../capabilities/device-removal-hook.cap.js';
55
55
  import type { deviceRunsCapability } from '../capabilities/device-runs.cap.js';
56
+ import type { deviceStateRefreshCapability } from '../capabilities/device-state-refresh.cap.js';
56
57
  import type { deviceStateCapability } from '../capabilities/device-state.cap.js';
57
58
  import type { deviceTransitionsCapability } from '../capabilities/device-transitions.cap.js';
58
59
  import type { dishwasherCapability } from '../capabilities/dishwasher.cap.js';
@@ -2835,6 +2836,41 @@ export type AppRouter = TrpcCoreRouter<{
2835
2836
  output: z.infer<typeof deviceManagerCapability.methods.listIdentityCandidates.output>;
2836
2837
  meta: object;
2837
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
+ }>;
2838
2874
  listLocations: TRPCQueryProcedure<{
2839
2875
  input: {
2840
2876
  nodeId?: string | undefined;
@@ -3660,6 +3696,27 @@ export type AppRouter = TrpcCoreRouter<{
3660
3696
  meta: object;
3661
3697
  }>;
3662
3698
  }>>;
3699
+ deviceStateRefresh: TRPCBuiltRouter<{
3700
+ ctx: TrpcContext;
3701
+ meta: object;
3702
+ errorShape: AugmentedErrorShape;
3703
+ transformer: true;
3704
+ }, TRPCDecorateCreateRouterOptions<{
3705
+ refresh: TRPCMutationProcedure<{
3706
+ input: {
3707
+ [x: string]: unknown;
3708
+ } & z.input<typeof deviceStateRefreshCapability.methods.refresh.input>;
3709
+ output: z.infer<typeof deviceStateRefreshCapability.methods.refresh.output>;
3710
+ meta: object;
3711
+ }>;
3712
+ resubscribe: TRPCMutationProcedure<{
3713
+ input: {
3714
+ [x: string]: unknown;
3715
+ } & z.input<typeof deviceStateRefreshCapability.methods.resubscribe.input>;
3716
+ output: z.infer<typeof deviceStateRefreshCapability.methods.resubscribe.output>;
3717
+ meta: object;
3718
+ }>;
3719
+ }>>;
3663
3720
  deviceStatus: TRPCBuiltRouter<{
3664
3721
  ctx: TrpcContext;
3665
3722
  meta: object;
@@ -1,7 +1,7 @@
1
1
  import type { CapVocabularyMap } from '../device/cap-vocabulary/types.js';
2
2
  /**
3
3
  * THE cap vocabulary (D920), projected from the declarations of every
4
- * `*.cap.ts` (D1050): 213 caps (111 device, 102 system).
4
+ * `*.cap.ts` (D1050): 214 caps (112 device, 102 system).
5
5
  * Device caps in their declared picker order, then system caps by name.
6
6
  */
7
7
  export declare const CAP_VOCABULARY: CapVocabularyMap;
@@ -61,6 +61,7 @@ export { deviceProviderCapability } from '../capabilities/device-provider.cap.js
61
61
  export { deviceRemovalHookCapability } from '../capabilities/device-removal-hook.cap.js';
62
62
  export { deviceRunsCapability } from '../capabilities/device-runs.cap.js';
63
63
  export { deviceStateCapability } from '../capabilities/device-state.cap.js';
64
+ export { deviceStateRefreshCapability } from '../capabilities/device-state-refresh.cap.js';
64
65
  export { deviceStatusCapability } from '../capabilities/device-status.cap.js';
65
66
  export { deviceTransitionsCapability } from '../capabilities/device-transitions.cap.js';
66
67
  export { dishwasherCapability } from '../capabilities/dishwasher.cap.js';
@@ -275,6 +276,7 @@ export declare const CAPABILITY_NAMES: {
275
276
  readonly deviceRemovalHook: 'device-removal-hook';
276
277
  readonly deviceRuns: 'device-runs';
277
278
  readonly deviceState: 'device-state';
279
+ readonly deviceStateRefresh: 'device-state-refresh';
278
280
  readonly deviceStatus: 'device-status';
279
281
  readonly deviceTransitions: 'device-transitions';
280
282
  readonly dishwasher: 'dishwasher';
@@ -502,6 +504,7 @@ export interface CapabilityRouterMap<TRouter = unknown> {
502
504
  readonly deviceRemovalHook: TRouter;
503
505
  readonly deviceRuns: TRouter;
504
506
  readonly deviceState: TRouter;
507
+ readonly deviceStateRefresh: TRouter;
505
508
  readonly deviceStatus: TRouter;
506
509
  readonly deviceTransitions: TRouter;
507
510
  readonly dishwasher: TRouter;
@@ -653,8 +656,8 @@ export interface CapabilityRouterMap<TRouter = unknown> {
653
656
  readonly zoneRules: TRouter;
654
657
  readonly zones: TRouter;
655
658
  }
656
- /** Capability names whose mode is `singleton` (173 caps). */
657
- export declare const SINGLETON_CAPABILITY_NAMES: readonly ['accessories', 'actions', 'addon-pages', 'addon-settings', 'addon-widgets', 'addons', 'admin-ui', 'air-quality-sensor', 'alarm-panel', 'alerts', 'ambient-light-sensor', 'audio-analysis', 'audio-analyzer', 'audio-codec', 'audio-metrics', 'automation-control', 'backup', 'battery', 'binary', 'brightness', 'button', 'calendars', 'camera-credentials', 'camera-grid-layout', 'camera-pipeline-config', 'camera-streams', 'carbon-monoxide', 'climate-control', 'cluster-update', 'color', 'composer', 'connectivity', 'consumables', 'contact', 'control', 'core-blocks', 'cover', 'database-snapshot', 'day-night', 'decoder', 'detection-pipeline', 'device-admin-link', 'device-credentials', 'device-history', 'device-manager', 'device-ops', 'device-runs', 'device-state', 'device-status', 'device-transitions', 'dishwasher', 'display-palette', 'do-not-disturb', 'doorbell', 'energy-system', 'enum-sensor', 'error', 'event-emitter', 'face-gallery', 'fan-control', 'fan-presets', 'feature-probe', 'filesystem-browse', 'flood', 'gas', 'group-active', 'group-commands', 'group-status', 'heat-pump-control', 'heat-pump-status', 'heating-valve', 'hero-layout', 'humidifier', 'humidity-sensor', 'image', 'image-settings', 'integrations', 'intercom', 'ir-transmitter', 'keychain', 'keychain-admin', 'lawn-mower-control', 'llm-runtime', 'local-network', 'lock-control', 'low-power-sleep', 'media-player', 'meter', 'metrics-provider', 'migrations', 'model-convert', 'model-distributor', 'motion', 'motion-detection', 'motion-trigger', 'motion-zones', 'native-object-detection', 'navigation', 'network-link', 'network-quality', 'node-certificates', 'nodes', 'notification-rules', 'notifier', 'numeric-sensor', 'osd', 'osd-manager', 'pet-feeder', 'pet-fountain', 'pipeline-analytics', 'pipeline-executor', 'pipeline-orchestrator', 'pipeline-runner', 'plate-gallery', 'platform-probe', 'power-meter', 'power-source', 'presence', 'pressure-sensor', 'privacy-mask', 'ptz', 'ptz-autotrack', 'pump-cycle', 'reboot', 'record-entries', 'recording-archive', 'recording-export', 'recording-onboard', 'recording-signal', 'records', 'remote', 'resync', 'running-state', 'scene-monitor', 'schedulers', 'script-runner', 'server-management', 'settings-store', 'siren', 'smoke', 'snapshot', 'sso-bridge', 'storage', 'storage-admin', 'storage-migration', 'stream-broker', 'stream-catalog', 'stream-params', 'stream-signals', 'switch', 'system', 'tags', 'tamper', 'temperature-sensor', 'terminal-session', 'timed-run', 'toast', 'training', 'update', 'user-management', 'vacuum-control', 'valve', 'vector-store', 'vibration', 'viewer-ui', 'water-heater', 'weather', 'weather-station', 'webrtc-session', 'workload', 'zone-analytics', 'zone-rules', 'zones'];
659
+ /** Capability names whose mode is `singleton` (174 caps). */
660
+ export declare const SINGLETON_CAPABILITY_NAMES: readonly ['accessories', 'actions', 'addon-pages', 'addon-settings', 'addon-widgets', 'addons', 'admin-ui', 'air-quality-sensor', 'alarm-panel', 'alerts', 'ambient-light-sensor', 'audio-analysis', 'audio-analyzer', 'audio-codec', 'audio-metrics', 'automation-control', 'backup', 'battery', 'binary', 'brightness', 'button', 'calendars', 'camera-credentials', 'camera-grid-layout', 'camera-pipeline-config', 'camera-streams', 'carbon-monoxide', 'climate-control', 'cluster-update', 'color', 'composer', 'connectivity', 'consumables', 'contact', 'control', 'core-blocks', 'cover', 'database-snapshot', 'day-night', 'decoder', 'detection-pipeline', 'device-admin-link', 'device-credentials', 'device-history', 'device-manager', 'device-ops', 'device-runs', 'device-state', 'device-state-refresh', 'device-status', 'device-transitions', 'dishwasher', 'display-palette', 'do-not-disturb', 'doorbell', 'energy-system', 'enum-sensor', 'error', 'event-emitter', 'face-gallery', 'fan-control', 'fan-presets', 'feature-probe', 'filesystem-browse', 'flood', 'gas', 'group-active', 'group-commands', 'group-status', 'heat-pump-control', 'heat-pump-status', 'heating-valve', 'hero-layout', 'humidifier', 'humidity-sensor', 'image', 'image-settings', 'integrations', 'intercom', 'ir-transmitter', 'keychain', 'keychain-admin', 'lawn-mower-control', 'llm-runtime', 'local-network', 'lock-control', 'low-power-sleep', 'media-player', 'meter', 'metrics-provider', 'migrations', 'model-convert', 'model-distributor', 'motion', 'motion-detection', 'motion-trigger', 'motion-zones', 'native-object-detection', 'navigation', 'network-link', 'network-quality', 'node-certificates', 'nodes', 'notification-rules', 'notifier', 'numeric-sensor', 'osd', 'osd-manager', 'pet-feeder', 'pet-fountain', 'pipeline-analytics', 'pipeline-executor', 'pipeline-orchestrator', 'pipeline-runner', 'plate-gallery', 'platform-probe', 'power-meter', 'power-source', 'presence', 'pressure-sensor', 'privacy-mask', 'ptz', 'ptz-autotrack', 'pump-cycle', 'reboot', 'record-entries', 'recording-archive', 'recording-export', 'recording-onboard', 'recording-signal', 'records', 'remote', 'resync', 'running-state', 'scene-monitor', 'schedulers', 'script-runner', 'server-management', 'settings-store', 'siren', 'smoke', 'snapshot', 'sso-bridge', 'storage', 'storage-admin', 'storage-migration', 'stream-broker', 'stream-catalog', 'stream-params', 'stream-signals', 'switch', 'system', 'tags', 'tamper', 'temperature-sensor', 'terminal-session', 'timed-run', 'toast', 'training', 'update', 'user-management', 'vacuum-control', 'valve', 'vector-store', 'vibration', 'viewer-ui', 'water-heater', 'weather', 'weather-station', 'webrtc-session', 'workload', 'zone-analytics', 'zone-rules', 'zones'];
658
661
  /** Union of singleton capability names (literal string union). */
659
662
  export type SingletonCapabilityName = typeof SINGLETON_CAPABILITY_NAMES[number];
660
663
  /** Capability names whose mode is `collection` (40 caps). */
@@ -31,6 +31,7 @@ import type { deviceAdminLinkCapability } from '../capabilities/device-admin-lin
31
31
  import type { deviceExtensionCapability } from '../capabilities/device-extension.cap.js';
32
32
  import type { deviceOpsCapability } from '../capabilities/device-ops.cap.js';
33
33
  import type { deviceRunsCapability } from '../capabilities/device-runs.cap.js';
34
+ import type { deviceStateRefreshCapability } from '../capabilities/device-state-refresh.cap.js';
34
35
  import type { deviceStatusCapability } from '../capabilities/device-status.cap.js';
35
36
  import type { deviceTransitionsCapability } from '../capabilities/device-transitions.cap.js';
36
37
  import type { dishwasherCapability } from '../capabilities/dishwasher.cap.js';
@@ -275,6 +276,7 @@ export interface DeviceProxy {
275
276
  readonly deviceExtension?: InferDeviceProxyCap<typeof deviceExtensionCapability>;
276
277
  readonly deviceOps?: InferDeviceProxyCap<typeof deviceOpsCapability>;
277
278
  readonly deviceRuns?: InferDeviceProxyCap<typeof deviceRunsCapability>;
279
+ readonly deviceStateRefresh?: InferDeviceProxyCap<typeof deviceStateRefreshCapability>;
278
280
  readonly deviceStatus?: InferDeviceProxyCap<typeof deviceStatusCapability>;
279
281
  readonly deviceTransitions?: InferDeviceProxyCap<typeof deviceTransitionsCapability>;
280
282
  readonly dishwasher?: InferDeviceProxyCap<typeof dishwasherCapability>;
@@ -364,7 +366,7 @@ export interface DeviceProxy {
364
366
  readonly deviceAdoption: Pick<InferDeviceProxyCap<typeof deviceAdoptionCapability>, 'getStatus'>;
365
367
  readonly deviceExport: Pick<InferDeviceProxyCap<typeof deviceExportCapability>, 'getDeviceSettingsContribution' | 'getDeviceLiveContribution' | 'applyDeviceSettingsPatch'>;
366
368
  readonly deviceHistory: Pick<InferDeviceProxyCap<typeof deviceHistoryCapability>, 'listSeries' | 'query' | 'getDeviceEnabled' | 'setDeviceEnabled' | 'deleteSeriesRange'>;
367
- 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'>;
368
370
  readonly deviceState: Pick<InferDeviceProxyCap<typeof deviceStateCapability>, 'getSnapshot' | 'getCapSlice' | 'setCapSlice' | 'claimFields' | 'patchOwnedFields' | 'releaseClaim' | 'getNativeCapSlice'>;
369
371
  readonly faceGallery: Pick<InferDeviceProxyCap<typeof faceGalleryCapability>, 'listRecentFaces' | 'getFaceByTrack'>;
370
372
  readonly networkQuality: Pick<InferDeviceProxyCap<typeof networkQualityCapability>, 'getDeviceStats' | 'reportClientStats'>;
@@ -5,7 +5,7 @@
5
5
  * can answer "may a rule actuate this?" without importing the schema barrel
6
6
  * (~144MB RSS per runner, D28).
7
7
  *
8
- * Coverage: 111 device-scoped capabilities.
8
+ * Coverage: 112 device-scoped capabilities.
9
9
  */
10
10
  export declare const DEVICE_SCOPED_CAPS: ReadonlySet<string>;
11
11
  /**
@@ -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: 1522 method paths across 213 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: 643 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