@camstack/types 1.2.549 → 1.2.550

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.
@@ -5,15 +5,20 @@ import { DeviceType } from '../device/device-type.js';
5
5
  * Generic stateless event emitter. Installed on a `DeviceType.EventEmitter`
6
6
  * device. Carries the device's EXACT declared event vocabulary verbatim
7
7
  * (NO normalization). Two shapes:
8
- * - structured source (HA `event.*` entity) → `eventTypes` is the fixed
9
- * declared vocabulary (e.g. ['press_short','press_long',...]).
10
- * - generic/legacy source (HA bus events, e.g. zha_event) → `eventTypes`
8
+ * - structured source (HA `event.*` entity) → `vocabulary` is the fixed
9
+ * declared set (e.g. press_short, press_long, …).
10
+ * - generic/legacy source (HA bus events, e.g. zha_event) → `vocabulary`
11
11
  * is [] (open) and `lastEvent.data` carries the complex payload.
12
+ * `vocabulary` (D1044) names each event for a person and types it for a
13
+ * rule; `eventTypes` is its list of native tokens, kept for older readers.
14
+ * A fire names the part of the device it came from in `sourceId` when the
15
+ * vocabulary declares sources (a remote's buttons).
12
16
  * `seq` is monotonic so two identical events still produce distinct slice writes.
13
17
  */
14
18
  export declare const EventFireSchema: z.ZodObject<{
15
19
  deviceId: z.ZodNumber;
16
20
  eventType: z.ZodString;
21
+ sourceId: z.ZodOptional<z.ZodString>;
17
22
  data: z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
18
23
  timestamp: z.ZodNumber;
19
24
  seq: z.ZodNumber;
@@ -21,9 +26,39 @@ export declare const EventFireSchema: z.ZodObject<{
21
26
  export type EventFire = z.infer<typeof EventFireSchema>;
22
27
  export declare const EventEmitterStatusSchema: z.ZodObject<{
23
28
  eventTypes: z.ZodArray<z.ZodString>;
29
+ vocabulary: z.ZodDefault<z.ZodArray<z.ZodObject<{
30
+ id: z.ZodString;
31
+ source: z.ZodOptional<z.ZodObject<{
32
+ id: z.ZodString;
33
+ label: z.ZodString;
34
+ }, z.core.$strip>>;
35
+ label: z.ZodString;
36
+ description: z.ZodOptional<z.ZodString>;
37
+ kind: z.ZodOptional<z.ZodEnum<{
38
+ "double-press": "double-press";
39
+ "long-press": "long-press";
40
+ "long-press-start": "long-press-start";
41
+ other: "other";
42
+ press: "press";
43
+ release: "release";
44
+ repeat: "repeat";
45
+ }>>;
46
+ payload: z.ZodOptional<z.ZodArray<z.ZodObject<{
47
+ path: z.ZodString;
48
+ kind: z.ZodEnum<{
49
+ boolean: "boolean";
50
+ enum: "enum";
51
+ number: "number";
52
+ string: "string";
53
+ }>;
54
+ enumValues: z.ZodOptional<z.ZodArray<z.ZodString>>;
55
+ label: z.ZodOptional<z.ZodString>;
56
+ }, z.core.$strip>>>;
57
+ }, z.core.$strip>>>;
24
58
  lastEvent: z.ZodNullable<z.ZodObject<{
25
59
  deviceId: z.ZodNumber;
26
60
  eventType: z.ZodString;
61
+ sourceId: z.ZodOptional<z.ZodString>;
27
62
  data: z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
28
63
  timestamp: z.ZodNumber;
29
64
  seq: z.ZodNumber;
@@ -43,6 +78,7 @@ export declare const eventEmitterCapability: {
43
78
  readonly data: z.ZodObject<{
44
79
  deviceId: z.ZodNumber;
45
80
  eventType: z.ZodString;
81
+ sourceId: z.ZodOptional<z.ZodString>;
46
82
  data: z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
47
83
  timestamp: z.ZodNumber;
48
84
  seq: z.ZodNumber;
@@ -52,9 +88,39 @@ export declare const eventEmitterCapability: {
52
88
  readonly status: {
53
89
  readonly schema: z.ZodObject<{
54
90
  eventTypes: z.ZodArray<z.ZodString>;
91
+ vocabulary: z.ZodDefault<z.ZodArray<z.ZodObject<{
92
+ id: z.ZodString;
93
+ source: z.ZodOptional<z.ZodObject<{
94
+ id: z.ZodString;
95
+ label: z.ZodString;
96
+ }, z.core.$strip>>;
97
+ label: z.ZodString;
98
+ description: z.ZodOptional<z.ZodString>;
99
+ kind: z.ZodOptional<z.ZodEnum<{
100
+ "double-press": "double-press";
101
+ "long-press": "long-press";
102
+ "long-press-start": "long-press-start";
103
+ other: "other";
104
+ press: "press";
105
+ release: "release";
106
+ repeat: "repeat";
107
+ }>>;
108
+ payload: z.ZodOptional<z.ZodArray<z.ZodObject<{
109
+ path: z.ZodString;
110
+ kind: z.ZodEnum<{
111
+ boolean: "boolean";
112
+ enum: "enum";
113
+ number: "number";
114
+ string: "string";
115
+ }>;
116
+ enumValues: z.ZodOptional<z.ZodArray<z.ZodString>>;
117
+ label: z.ZodOptional<z.ZodString>;
118
+ }, z.core.$strip>>>;
119
+ }, z.core.$strip>>>;
55
120
  lastEvent: z.ZodNullable<z.ZodObject<{
56
121
  deviceId: z.ZodNumber;
57
122
  eventType: z.ZodString;
123
+ sourceId: z.ZodOptional<z.ZodString>;
58
124
  data: z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
59
125
  timestamp: z.ZodNumber;
60
126
  seq: z.ZodNumber;
@@ -65,9 +131,39 @@ export declare const eventEmitterCapability: {
65
131
  };
66
132
  readonly runtimeState: z.ZodObject<{
67
133
  eventTypes: z.ZodArray<z.ZodString>;
134
+ vocabulary: z.ZodDefault<z.ZodArray<z.ZodObject<{
135
+ id: z.ZodString;
136
+ source: z.ZodOptional<z.ZodObject<{
137
+ id: z.ZodString;
138
+ label: z.ZodString;
139
+ }, z.core.$strip>>;
140
+ label: z.ZodString;
141
+ description: z.ZodOptional<z.ZodString>;
142
+ kind: z.ZodOptional<z.ZodEnum<{
143
+ "double-press": "double-press";
144
+ "long-press": "long-press";
145
+ "long-press-start": "long-press-start";
146
+ other: "other";
147
+ press: "press";
148
+ release: "release";
149
+ repeat: "repeat";
150
+ }>>;
151
+ payload: z.ZodOptional<z.ZodArray<z.ZodObject<{
152
+ path: z.ZodString;
153
+ kind: z.ZodEnum<{
154
+ boolean: "boolean";
155
+ enum: "enum";
156
+ number: "number";
157
+ string: "string";
158
+ }>;
159
+ enumValues: z.ZodOptional<z.ZodArray<z.ZodString>>;
160
+ label: z.ZodOptional<z.ZodString>;
161
+ }, z.core.$strip>>>;
162
+ }, z.core.$strip>>>;
68
163
  lastEvent: z.ZodNullable<z.ZodObject<{
69
164
  deviceId: z.ZodNumber;
70
165
  eventType: z.ZodString;
166
+ sourceId: z.ZodOptional<z.ZodString>;
71
167
  data: z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
72
168
  timestamp: z.ZodNumber;
73
169
  seq: z.ZodNumber;
@@ -0,0 +1,99 @@
1
+ import { z } from 'zod';
2
+ /**
3
+ * The declared vocabulary of an `event-emitter` device (D1044): what the
4
+ * device can fire, named for a person and typed for a rule.
5
+ *
6
+ * `id` is the native token, verbatim. `kind` is the meaning shared by every
7
+ * integration, so "any long press" can be asked without knowing a vendor's
8
+ * token. A device with several buttons declares one entry per button and
9
+ * token: an entry is identified by its token AND its source.
10
+ */
11
+ /** The cross-integration meaning of an event. */
12
+ export declare const EVENT_VOCABULARY_KINDS: readonly ['press', 'long-press', 'long-press-start', 'release', 'repeat', 'double-press', 'other'];
13
+ export declare const EventVocabularyKindSchema: z.ZodEnum<{
14
+ "double-press": "double-press";
15
+ "long-press": "long-press";
16
+ "long-press-start": "long-press-start";
17
+ other: "other";
18
+ press: "press";
19
+ release: "release";
20
+ repeat: "repeat";
21
+ }>;
22
+ export type EventVocabularyKind = z.infer<typeof EventVocabularyKindSchema>;
23
+ /** The part of the device an event comes from: a button, a channel. */
24
+ export declare const EventVocabularySourceSchema: z.ZodObject<{
25
+ id: z.ZodString;
26
+ label: z.ZodString;
27
+ }, z.core.$strip>;
28
+ export type EventVocabularySource = z.infer<typeof EventVocabularySourceSchema>;
29
+ /** One scalar field of an event's `data`, by dotted path. */
30
+ export declare const EventVocabularyFieldSchema: z.ZodObject<{
31
+ path: z.ZodString;
32
+ kind: z.ZodEnum<{
33
+ boolean: "boolean";
34
+ enum: "enum";
35
+ number: "number";
36
+ string: "string";
37
+ }>;
38
+ enumValues: z.ZodOptional<z.ZodArray<z.ZodString>>;
39
+ label: z.ZodOptional<z.ZodString>;
40
+ }, z.core.$strip>;
41
+ export type EventVocabularyField = z.infer<typeof EventVocabularyFieldSchema>;
42
+ export declare const EventVocabularyEntrySchema: z.ZodObject<{
43
+ id: z.ZodString;
44
+ source: z.ZodOptional<z.ZodObject<{
45
+ id: z.ZodString;
46
+ label: z.ZodString;
47
+ }, z.core.$strip>>;
48
+ label: z.ZodString;
49
+ description: z.ZodOptional<z.ZodString>;
50
+ kind: z.ZodOptional<z.ZodEnum<{
51
+ "double-press": "double-press";
52
+ "long-press": "long-press";
53
+ "long-press-start": "long-press-start";
54
+ other: "other";
55
+ press: "press";
56
+ release: "release";
57
+ repeat: "repeat";
58
+ }>>;
59
+ payload: z.ZodOptional<z.ZodArray<z.ZodObject<{
60
+ path: z.ZodString;
61
+ kind: z.ZodEnum<{
62
+ boolean: "boolean";
63
+ enum: "enum";
64
+ number: "number";
65
+ string: "string";
66
+ }>;
67
+ enumValues: z.ZodOptional<z.ZodArray<z.ZodString>>;
68
+ label: z.ZodOptional<z.ZodString>;
69
+ }, z.core.$strip>>>;
70
+ }, z.core.$strip>;
71
+ export type EventVocabularyEntry = z.infer<typeof EventVocabularyEntrySchema>;
72
+ /**
73
+ * A status as a reader may meet it. `vocabulary` is absent on a status
74
+ * written by a provider older than the field.
75
+ */
76
+ export interface EventVocabularyCarrier {
77
+ readonly eventTypes: readonly string[];
78
+ readonly vocabulary?: readonly EventVocabularyEntry[];
79
+ }
80
+ /**
81
+ * The vocabulary of a source that declares tokens and nothing else: one
82
+ * entry per token, labelled with the token itself.
83
+ */
84
+ export declare function plainEventVocabulary(eventTypes: readonly string[]): EventVocabularyEntry[];
85
+ /**
86
+ * The vocabulary of a source that declares tokens only, read by convention:
87
+ * a readable label, and the shared kind when the token is one many
88
+ * integrations use for a button. The token itself is kept verbatim.
89
+ */
90
+ export declare function conventionalEventVocabulary(eventTypes: readonly string[]): EventVocabularyEntry[];
91
+ /** The native tokens of a vocabulary, each once, in declaration order. */
92
+ export declare function eventTypesOfVocabulary(vocabulary: readonly EventVocabularyEntry[]): string[];
93
+ /**
94
+ * The vocabulary to show and match against. A status with none declared
95
+ * answers with its plain tokens, so an older provider is still usable.
96
+ */
97
+ export declare function readEventVocabulary(status: EventVocabularyCarrier): readonly EventVocabularyEntry[];
98
+ /** The entry a fire belongs to: same token, same source (or both without one). */
99
+ export declare function findVocabularyEntry(vocabulary: readonly EventVocabularyEntry[], eventType: string, sourceId?: string): EventVocabularyEntry | undefined;
@@ -199,6 +199,7 @@ export { type DishwasherAccess, DishwasherAccessSchema, type DishwasherAvailabil
199
199
  export { DOORBELL_RISE_DEBOUNCE_MS, type DoorbellPressEvent, DoorbellPressEventSchema, type DoorbellStatus, DoorbellStatusSchema, doorbellCapability, type IDoorbellProvider, } from './doorbell.cap.js';
200
200
  export { type EnumSensorDateTimeFormat, EnumSensorDateTimeFormatSchema, type EnumSensorStatus, EnumSensorStatusSchema, enumSensorCapability, type IEnumSensorProvider, } from './enum-sensor.cap.js';
201
201
  export { type EventEmitterStatus, EventEmitterStatusSchema, type EventFire, EventFireSchema, eventEmitterCapability, type IEventEmitterProvider, } from './event-emitter.cap.js';
202
+ export { EVENT_VOCABULARY_KINDS, type EventVocabularyCarrier, type EventVocabularyEntry, EventVocabularyEntrySchema, type EventVocabularyField, EventVocabularyFieldSchema, type EventVocabularyKind, EventVocabularyKindSchema, type EventVocabularySource, EventVocabularySourceSchema, conventionalEventVocabulary, eventTypesOfVocabulary, findVocabularyEntry, plainEventVocabulary, readEventVocabulary, } from './event-vocabulary.js';
202
203
  export { type FaceCluster, type FaceInfo, type FaceSortDirection, type FaceSortField, faceGalleryCapability, type Identity, type IdentitySampleAudit, type IdentitySampleAuditRow, type IdentitySampleInfo, type IFaceGalleryProvider, type ListRecentFacesInput, type SuggestFaceClustersInput, } from './face-gallery.cap.js';
203
204
  export { anyAxisOscillating, FAN_OSCILLATION_AXES, FAN_OSCILLATION_AXIS_LIMITS, FAN_OSCILLATION_AXIS_REFUSALS, FAN_OSCILLATION_AXIS_SETTABLE, fanAxisPath, type FanControlStatus, FanControlStatusSchema, type FanDirection, FanDirectionSchema, type FanOscillationAxes, FanOscillationAxesSchema, type FanOscillationAxis, type FanOscillationAxisField, FanOscillationAxisFieldSchema, type FanOscillationAxisLimit, type FanOscillationAxisName, FanOscillationAxisNameSchema, type FanOscillationAxisRefusal, FanOscillationAxisRefusalSchema, type FanOscillationAxisResult, FanOscillationAxisResultSchema, FanOscillationAxisSchema, fanControlCapability, type IFanControlProvider, type SetOscillationAxisInput, SetOscillationAxisInputSchema, } from './fan-control.cap.js';
204
205
  export { type FeatureProbeStatus, FeatureProbeStatusSchema, featureProbeCapability, type IFeatureProbeProvider, } from './feature-probe.cap.js';
@@ -133,6 +133,10 @@ declare const OauthIntegrationDescriptorSchema: z.ZodObject<{
133
133
  requiresPkce: z.ZodOptional<z.ZodBoolean>;
134
134
  hubUrl: z.ZodOptional<z.ZodString>;
135
135
  refreshTokenTtlSec: z.ZodOptional<z.ZodUnion<readonly [z.ZodNumber, z.ZodLiteral<"never">]>>;
136
+ instances: z.ZodOptional<z.ZodArray<z.ZodObject<{
137
+ id: z.ZodString;
138
+ displayName: z.ZodString;
139
+ }, z.core.$strip>>>;
136
140
  }, z.core.$strip>;
137
141
  export declare const oauthIntegrationCapability: {
138
142
  readonly name: 'oauth-integration';
@@ -205,6 +209,10 @@ export declare const oauthIntegrationCapability: {
205
209
  requiresPkce: z.ZodOptional<z.ZodBoolean>;
206
210
  hubUrl: z.ZodOptional<z.ZodString>;
207
211
  refreshTokenTtlSec: z.ZodOptional<z.ZodUnion<readonly [z.ZodNumber, z.ZodLiteral<"never">]>>;
212
+ instances: z.ZodOptional<z.ZodArray<z.ZodObject<{
213
+ id: z.ZodString;
214
+ displayName: z.ZodString;
215
+ }, z.core.$strip>>>;
208
216
  }, z.core.$strip>, import("./capability-definition.js").CapabilityMethodKind>;
209
217
  };
210
218
  };
@@ -1491,184 +1491,7 @@ export declare const schedulersCapability: {
1491
1491
  readonly getTraces: import("./capability-definition.js").CapabilityMethodSchema<z.ZodObject<{
1492
1492
  schedulerId: z.ZodString;
1493
1493
  }, z.core.$strip>, z.ZodObject<{
1494
- traces: z.ZodArray<z.ZodObject<{
1495
- runId: z.ZodString;
1496
- startedAt: z.ZodNumber;
1497
- endedAt: z.ZodNumber;
1498
- trigger: z.ZodObject<{
1499
- kind: z.ZodString;
1500
- path: z.ZodOptional<z.ZodString>;
1501
- outcome: z.ZodEnum<{
1502
- fail: "fail";
1503
- pass: "pass";
1504
- }>;
1505
- reason: z.ZodString;
1506
- vars: z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull, z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>]>>;
1507
- hold: z.ZodOptional<z.ZodObject<{
1508
- phase: z.ZodEnum<{
1509
- cancelled: "cancelled";
1510
- fired: "fired";
1511
- pending: "pending";
1512
- reseeded: "reseeded";
1513
- }>;
1514
- ms: z.ZodNumber;
1515
- mode: z.ZodEnum<{
1516
- held: "held";
1517
- stable: "stable";
1518
- }>;
1519
- since: z.ZodOptional<z.ZodNumber>;
1520
- deadline: z.ZodOptional<z.ZodNumber>;
1521
- }, z.core.$strip>>;
1522
- }, z.core.$strip>;
1523
- conditions: z.ZodArray<z.ZodObject<{
1524
- path: z.ZodString;
1525
- kind: z.ZodEnum<{
1526
- all: "all";
1527
- any: "any";
1528
- condition: "condition";
1529
- detection: "detection";
1530
- "device-becomes": "device-becomes";
1531
- "device-event": "device-event";
1532
- "device-is": "device-is";
1533
- expression: "expression";
1534
- interval: "interval";
1535
- manual: "manual";
1536
- not: "not";
1537
- schedule: "schedule";
1538
- stationary: "stationary";
1539
- "stationary-present": "stationary-present";
1540
- "time-is": "time-is";
1541
- "triggered-by": "triggered-by";
1542
- }>;
1543
- outcome: z.ZodEnum<{
1544
- fail: "fail";
1545
- "not-evaluated": "not-evaluated";
1546
- pass: "pass";
1547
- }>;
1548
- reason: z.ZodString;
1549
- deviceId: z.ZodOptional<z.ZodNumber>;
1550
- cap: z.ZodOptional<z.ZodString>;
1551
- fieldPath: z.ZodOptional<z.ZodString>;
1552
- operator: z.ZodOptional<z.ZodString>;
1553
- expected: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull, z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>]>>;
1554
- observed: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull, z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>]>>;
1555
- }, z.core.$strip>>;
1556
- verdict: z.ZodOptional<z.ZodObject<{
1557
- mode: z.ZodDiscriminatedUnion<[z.ZodObject<{
1558
- mode: z.ZodLiteral<"single">;
1559
- }, z.core.$strip>, z.ZodObject<{
1560
- mode: z.ZodLiteral<"restart">;
1561
- }, z.core.$strip>, z.ZodObject<{
1562
- mode: z.ZodLiteral<"queued">;
1563
- max: z.ZodNumber;
1564
- }, z.core.$strip>, z.ZodObject<{
1565
- mode: z.ZodLiteral<"parallel">;
1566
- max: z.ZodNumber;
1567
- }, z.core.$strip>, z.ZodObject<{
1568
- mode: z.ZodLiteral<"cooldown">;
1569
- minutes: z.ZodNumber;
1570
- }, z.core.$strip>], "mode">;
1571
- decision: z.ZodEnum<{
1572
- bypass: "bypass";
1573
- cooldown: "cooldown";
1574
- drop: "drop";
1575
- queued: "queued";
1576
- restart: "restart";
1577
- run: "run";
1578
- }>;
1579
- reason: z.ZodString;
1580
- }, z.core.$strip>>;
1581
- steps: z.ZodArray<z.ZodObject<{
1582
- path: z.ZodString;
1583
- kind: z.ZodString;
1584
- cap: z.ZodOptional<z.ZodString>;
1585
- method: z.ZodOptional<z.ZodString>;
1586
- actionId: z.ZodOptional<z.ZodString>;
1587
- deviceId: z.ZodOptional<z.ZodNumber>;
1588
- devices: z.ZodOptional<z.ZodArray<z.ZodObject<{
1589
- deviceId: z.ZodNumber;
1590
- outcome: z.ZodEnum<{
1591
- error: "error";
1592
- ok: "ok";
1593
- }>;
1594
- message: z.ZodOptional<z.ZodString>;
1595
- }, z.core.$strip>>>;
1596
- startedAt: z.ZodOptional<z.ZodNumber>;
1597
- endedAt: z.ZodOptional<z.ZodNumber>;
1598
- args: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull, z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>]>>>;
1599
- templates: z.ZodOptional<z.ZodArray<z.ZodString>>;
1600
- condition: z.ZodOptional<z.ZodEnum<{
1601
- false: "false";
1602
- true: "true";
1603
- unknown: "unknown";
1604
- }>>;
1605
- conditionReason: z.ZodOptional<z.ZodString>;
1606
- outcome: z.ZodEnum<{
1607
- empty: "empty";
1608
- error: "error";
1609
- "not-run": "not-run";
1610
- ok: "ok";
1611
- skipped: "skipped";
1612
- }>;
1613
- message: z.ZodOptional<z.ZodString>;
1614
- else: z.ZodOptional<z.ZodArray<z.ZodObject<{
1615
- path: z.ZodString;
1616
- kind: z.ZodString;
1617
- cap: z.ZodOptional<z.ZodString>;
1618
- method: z.ZodOptional<z.ZodString>;
1619
- actionId: z.ZodOptional<z.ZodString>;
1620
- deviceId: z.ZodOptional<z.ZodNumber>;
1621
- devices: z.ZodOptional<z.ZodArray<z.ZodObject<{
1622
- deviceId: z.ZodNumber;
1623
- outcome: z.ZodEnum<{
1624
- error: "error";
1625
- ok: "ok";
1626
- }>;
1627
- message: z.ZodOptional<z.ZodString>;
1628
- }, z.core.$strip>>>;
1629
- startedAt: z.ZodOptional<z.ZodNumber>;
1630
- endedAt: z.ZodOptional<z.ZodNumber>;
1631
- args: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull, z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>]>>>;
1632
- templates: z.ZodOptional<z.ZodArray<z.ZodString>>;
1633
- condition: z.ZodOptional<z.ZodEnum<{
1634
- false: "false";
1635
- true: "true";
1636
- unknown: "unknown";
1637
- }>>;
1638
- conditionReason: z.ZodOptional<z.ZodString>;
1639
- outcome: z.ZodEnum<{
1640
- empty: "empty";
1641
- error: "error";
1642
- "not-run": "not-run";
1643
- ok: "ok";
1644
- skipped: "skipped";
1645
- }>;
1646
- message: z.ZodOptional<z.ZodString>;
1647
- }, z.core.$strip>>>;
1648
- }, z.core.$strip>>;
1649
- outcome: z.ZodEnum<{
1650
- aborted: "aborted";
1651
- failed: "failed";
1652
- ran: "ran";
1653
- "skipped-conditions": "skipped-conditions";
1654
- "skipped-cooldown": "skipped-cooldown";
1655
- "skipped-overlap": "skipped-overlap";
1656
- "skipped-trigger": "skipped-trigger";
1657
- }>;
1658
- repeat: z.ZodNumber;
1659
- lastAt: z.ZodNumber;
1660
- scheduler: z.ZodOptional<z.ZodEnum<{
1661
- "condition-false": "condition-false";
1662
- done: "done";
1663
- failed: "failed";
1664
- "gave-up": "gave-up";
1665
- held: "held";
1666
- inactive: "inactive";
1667
- missed: "missed";
1668
- overridden: "overridden";
1669
- "suspended-manual": "suspended-manual";
1670
- }>>;
1671
- }, z.core.$strip>>;
1494
+ traces: z.ZodArray<z.ZodType<import("../index.js").AutomationRunTrace, unknown, z.core.$ZodTypeInternals<import("../index.js").AutomationRunTrace, unknown>>>;
1672
1495
  }, z.core.$strip>, import("./capability-definition.js").CapabilityMethodKind>;
1673
1496
  };
1674
1497
  };
@@ -72,6 +72,7 @@ declare const SsoBridgeClaimsSchema: z.ZodObject<{
72
72
  }, z.core.$strip>], "type">>>>;
73
73
  redirectUri: z.ZodOptional<z.ZodString>;
74
74
  integrationId: z.ZodOptional<z.ZodString>;
75
+ instanceId: z.ZodOptional<z.ZodString>;
75
76
  jti: z.ZodOptional<z.ZodString>;
76
77
  codeChallenge: z.ZodOptional<z.ZodString>;
77
78
  sessionId: z.ZodOptional<z.ZodString>;
@@ -172,6 +173,7 @@ export declare const ssoBridgeCapability: {
172
173
  }, z.core.$strip>], "type">>>>;
173
174
  redirectUri: z.ZodOptional<z.ZodString>;
174
175
  integrationId: z.ZodOptional<z.ZodString>;
176
+ instanceId: z.ZodOptional<z.ZodString>;
175
177
  jti: z.ZodOptional<z.ZodString>;
176
178
  codeChallenge: z.ZodOptional<z.ZodString>;
177
179
  sessionId: z.ZodOptional<z.ZodString>;
@@ -257,6 +259,7 @@ export declare const ssoBridgeCapability: {
257
259
  }, z.core.$strip>], "type">>>>;
258
260
  redirectUri: z.ZodOptional<z.ZodString>;
259
261
  integrationId: z.ZodOptional<z.ZodString>;
262
+ instanceId: z.ZodOptional<z.ZodString>;
260
263
  jti: z.ZodOptional<z.ZodString>;
261
264
  codeChallenge: z.ZodOptional<z.ZodString>;
262
265
  sessionId: z.ZodOptional<z.ZodString>;
@@ -202,6 +202,7 @@ declare const OauthSessionSummarySchema: z.ZodObject<{
202
202
  userId: z.ZodString;
203
203
  username: z.ZodString;
204
204
  integrationId: z.ZodString;
205
+ instanceId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
205
206
  scopes: z.ZodArray<z.ZodPreprocess<z.ZodDiscriminatedUnion<[z.ZodObject<{
206
207
  type: z.ZodLiteral<"category">;
207
208
  target: z.ZodEnum<{
@@ -750,6 +751,7 @@ export declare const userManagementCapability: {
750
751
  }, z.core.$strip>, "mutation">;
751
752
  readonly oauthIssueCode: import("./capability-definition.js").CapabilityMethodSchema<z.ZodObject<{
752
753
  integrationId: z.ZodString;
754
+ instanceId: z.ZodOptional<z.ZodString>;
753
755
  userId: z.ZodString;
754
756
  username: z.ZodString;
755
757
  scopes: z.ZodArray<z.ZodPreprocess<z.ZodDiscriminatedUnion<[z.ZodObject<{
@@ -876,6 +878,7 @@ export declare const userManagementCapability: {
876
878
  }>>;
877
879
  includeLinked: z.ZodOptional<z.ZodBoolean>;
878
880
  }, z.core.$strip>], "type">>>;
881
+ instanceId: z.ZodOptional<z.ZodString>;
879
882
  }, z.core.$strip>>, import("./capability-definition.js").CapabilityMethodKind>;
880
883
  readonly listExternalIdentities: import("./capability-definition.js").CapabilityMethodSchema<z.ZodObject<{
881
884
  userId: z.ZodString;
@@ -908,6 +911,7 @@ export declare const userManagementCapability: {
908
911
  userId: z.ZodString;
909
912
  username: z.ZodString;
910
913
  integrationId: z.ZodString;
914
+ instanceId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
911
915
  scopes: z.ZodArray<z.ZodPreprocess<z.ZodDiscriminatedUnion<[z.ZodObject<{
912
916
  type: z.ZodLiteral<"category">;
913
917
  target: z.ZodEnum<{
@@ -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, 82 caps with 386 state leaves, 15 caps with a declared method timeout.
8
+ * Coverage: 1 advance-derived caps, 82 caps with 387 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 {
package/dist/index.d.ts CHANGED
@@ -13,6 +13,7 @@ export { compareVersions, describeUnmet, MinVersionSchema, minimumOf, PackageReq
13
13
  export type { PackageRequires, RequiredAddonUpdate, RunningVersions, RunningWrapper, UnmetRequirement, WrapperRequirementKind, } from './addon/package-requires.js';
14
14
  export type { AddonRouteInvokeRequest, AddonRouteReplyEnvelope, } from './addon/build-addon-route-provider.js';
15
15
  export { buildAddonRouteProvider } from './addon/build-addon-route-provider.js';
16
+ export { isAddonInstanceId, oauthLinkInstanceId, oauthLinkServesInstance, type OauthLinkInstance, } from './addon/addon-instance.js';
16
17
  export type { BuildSessionLostAlertInput, IntegrationSessionBinding, IntegrationSessionReporterOptions, IntegrationSessionSink, SessionAlertAction, SessionHealthAlertsPort, SessionHealthTrackerOptions, SessionLossReason, SessionLostInfo, } from './addon/session-health.js';
17
18
  export { buildSessionLostAlert, DEFAULT_SESSION_LOST_DEBOUNCE_MS, IntegrationSessionReporter, SESSION_LOST_ALERT_CATEGORY, SessionHealthTracker, sessionLostAlertId, } from './addon/session-health.js';
18
19
  export type { InstanceChange, RecordIntegrationInstancesHooks, ResolvedInstance, ResolvedSecretsState, } from './addon/record-integration-instances.js';
@@ -191,8 +192,8 @@ export { APP_FLOW_DEFAULT_REDIRECT, APP_FLOW_REFUSAL_MESSAGES, APP_FLOW_STATE_PR
191
192
  export { SSO_STATE_COOKIE, SSO_STATE_COOKIE_MAX_AGE_SEC } from './auth/sso-state.js';
192
193
  export { buildDeviceEnrollmentLink, buildDeviceSignatureMessage, type CompleteEnrollmentInput, CompleteEnrollmentInputSchema, type CompleteEnrollmentOutput, CompleteEnrollmentOutputSchema, DEVICE_CERT_RENEW_WINDOW_DAYS, DEVICE_CERT_SIGNATURE, DEVICE_CERT_VALIDITY_DAYS, DEVICE_ENROLLMENT_TTL_MS, DEVICE_NONCE_TTL_MS, DEVICE_SAN_CREDENTIAL_PREFIX, DEVICE_SAN_USER_PREFIX, DEVICE_SIGNATURE_MESSAGE_VERSION, type DeviceCertificateLoginMethod, DeviceCertificateLoginMethodSchema, type DeviceChallenge, DeviceChallengeSchema, type DeviceCredential, DeviceCredentialSchema, type DeviceCredentialStatus, DeviceCredentialStatusSchema, type DevicePlatform, DevicePlatformSchema, type DeviceProofInput, DeviceProofInputSchema, type CompleteEnrollmentResult, CompleteEnrollmentResultSchema, DEFINITIVE_DEVICE_REFUSALS, DEVICE_DEFINITIVE_REFUSALS_BEFORE_DELETE, DEVICE_REFRESH_REFUSAL_PREFIX, deviceRefusalFromMessage, type DeviceChallengeResult, DeviceChallengeResultSchema, DeviceEnrollProofSchema, type DeviceRefusal, type DeviceRefusalReason, DeviceRefusalReasonSchema, DeviceRefusalSchema, type DeviceRevoker, type EnrollSelfInput, EnrollSelfInputSchema, formatDeviceRevoker, isDefinitiveDeviceRefusal, type RenewDeviceCertificateResult, RenewDeviceCertificateResultSchema, type RevokeOwnDeviceCertificateResult, RevokeOwnDeviceCertificateResultSchema, type DeviceSignaturePurpose, DeviceSignaturePurposeSchema, type RenewDeviceCertificateOutput, RenewDeviceCertificateOutputSchema, type StartEnrollmentOutput, StartEnrollmentOutputSchema, parseDeviceEnrollmentLink, } from './auth/device-certificate.js';
193
194
  export { advertisedHubOrigins, claimedRequestOrigins, normalizeOrigin, pickRequestOrigin, type RequestHeaders, requestMountPrefix, } from './auth/request-origin.js';
194
- export type { ActionStep, AutomationAction, AutomationAll, AutomationAny, AutomationCapStep, AutomationConditionOperator, AutomationConditionTraceNode, AutomationEventLeaf, AutomationLeaf, AutomationNot, AutomationStateLeaf, AutomationWhen, DetectionLabelSource, DetectionLeaf, DetectionSubject, DeviceBecomesLeaf, BecomesDeps, BecomesEffect, BecomesOperator, BecomesSpec, DeviceIsLeaf, ExpressionLeaf, TimeIsLeaf, TriggeredByLeaf, IdentifiedEventLeaf, WhenSiteIssue, HoldMode, HoldReading, HoldSpec, HoldTrace, IdentityLabel, LegacyAutomationRecipe, NormalizedCapStep, StepDeviceTrace, LegacyCondition, LegacyTrigger, PlateLabel, StationaryLeaf, StationaryPresentLeaf, SubClassLabel, SubjectObservation, SubjectVerdict, AutomationRecipe, AutomationRunMode, AutomationRunOutcome, AutomationRunTrace, AutomationRunVerdict, AutomationStateDoc, AutomationStepTrace, AutomationTriggerTrace, ConditionEvaluation, ConditionReader, DetectionDecision, DetectionTrigger, DetectionVars, GenerateAutomationBlockInput, MirrorRefreshFetchers, RunTrigger, MirrorRefreshReport, MirrorSource, StationaryChangedInput, StationaryDecision, StationaryTrigger, StationaryVars, TraceNodeOutcome, TraceValue, TrackLifecycleInput, TriggerVariable, } from './automation/index.js';
195
- export { ActionStepSchema, AutomationActionSchema, AutomationCapStepSchema, AutomationWaitStepSchema, EMPTY_AUTOMATION_STATE, mergeSkipTraces, AutomationConditionOperatorSchema, AutomationConditionTraceNodeSchema, AutomationRecipeSchema, AutomationWhenSchema, CurrentAutomationRecipeSchema, DETECTION_LABEL_SOURCES, DetectionSubjectSchema, LegacyAutomationRecipeSchema, LegacyConditionSchema, LegacyTriggerSchema, MAX_TRACE_ARG_LENGTH, MAX_STEP_DEVICE_OUTCOMES, MAX_TRACE_ARGS, MAX_WHEN_DEPTH, normalizeCapStep, normalizeStepTargets, StepDeviceTraceSchema, MAX_WHEN_LEAVES, REDACTED_ARG, StationarySubjectSchema, anySubjectMatches, buildStepArgsTrace, collectWhenMirrorSources, convertLegacyCondition, convertLegacyRecipe, convertLegacyWhen, countWhenLeaves, describeSubject, evaluateWhenTree, eventLeafIdAt, identifiedEventLeaves, hasTriggeredByLeaves, triggeredByIssue, EVENT_LEAF_ID_RE, TRIGGERED_BY_MAX_IDS, recipeSiteIssues, stepGuardSiteIssues, whenSiteIssues, forEachLeaf, BecomesOperatorSchema, BecomesWatch, HoldCore, HoldSpecSchema, HoldTraceSchema, HoldTracker, describeHold, describeHoldMs, hasEventLeaves, hasHoldLeaves, hasTimeLeaves, nextTimeBoundaryInMs, holdOf, observeHoldLeaves, isEventLeaf, isLeaf, subClassesOf, subjectFromClassName, subjectMatches, validateWhenTree, whenDepth, AutomationRunModeSchema, AutomationRunOutcomeSchema, AutomationRunTraceSchema, AutomationRunVerdictSchema, AutomationStateDocSchema, AutomationStepTraceSchema, AutomationTriggerTraceSchema, appendTrace, buildTriggerTrace, collectMirrorSources, ConditionMirror, stableIdKey, stableIdMapOf, DEFAULT_TRACE_KEEP, DetectionTriggerFilter, detectionClassMatches, evaluateConditionTree, evaluateStationaryTrigger, generateAutomationBlock, isSkippedTrace, MAX_CONDITION_DEPTH, MAX_CONDITION_LEAVES, MAX_TRACE_KEEP, RunGate, skipSignature, TraceNodeOutcomeSchema, TraceValueSchema, triggerLeafVariables, triggerVariablesOf, validateRecipeBounds, } from './automation/index.js';
195
+ export type { ActionStep, AutomationAction, AutomationAll, AutomationAny, AutomationCapStep, AutomationConditionOperator, AutomationConditionTraceNode, AutomationEventLeaf, AutomationLeaf, AutomationNot, AutomationStateLeaf, AutomationWhen, DetectionLabelSource, DetectionLeaf, DetectionSubject, DeviceBecomesLeaf, BecomesDeps, BecomesEffect, BecomesOperator, BecomesSpec, DeviceIsLeaf, ExpressionLeaf, TimeIsLeaf, TriggeredByLeaf, IdentifiedEventLeaf, WhenSiteIssue, HoldMode, HoldReading, HoldSpec, HoldTrace, IdentityLabel, LegacyAutomationRecipe, AutomationBodyStep, AutomationBranchStep, AutomationRecipeInput, AutomationChooseStep, AutomationWaitUntilStep, AutomationParallelStep, AutomationRepeatLoop, AutomationRepeatStep, AutomationSetStep, StepConditionRef, AutomationStopStep, NormalizedCapStep, StepDeviceTrace, LegacyCondition, LegacyTrigger, PlateLabel, StationaryLeaf, StationaryPresentLeaf, SubClassLabel, SubjectObservation, SubjectVerdict, AutomationRecipe, AutomationRunMode, AutomationRunOutcome, AutomationRunTrace, AutomationRunVerdict, AutomationStateDoc, AutomationStepTrace, NestedStepTrace, AutomationTriggerTrace, ConditionEvaluation, ConditionReader, DetectionDecision, DetectionTrigger, DetectionVars, GenerateAutomationBlockInput, MirrorRefreshFetchers, RunTrigger, MirrorRefreshReport, MirrorSource, StationaryChangedInput, StationaryDecision, StationaryTrigger, StationaryVars, TraceNodeOutcome, TraceValue, TrackLifecycleInput, TriggerVariable, } from './automation/index.js';
196
+ export { ActionStepSchema, AutomationActionSchema, AutomationCapStepSchema, AutomationWaitStepSchema, AutomationChooseStepSchema, AutomationWaitUntilStepSchema, AutomationParallelStepSchema, AutomationRepeatLoopSchema, AutomationRepeatStepSchema, AutomationSetStepSchema, CHOOSE_BRANCHES_MAX, WAIT_UNTIL_TIMEOUT_MAX_S, PARALLEL_STEPS_MAX, REPEAT_COUNT_MAX, REPEAT_DEVICES_MAX, REPEAT_ITEM_VAR, REPEAT_ITERATIONS_MAX, REPEAT_STEPS_MAX, STEP_NEST_MAX, PARALLEL_STEPS_MIN, nestedStepsOf, stepConditionsOf, AutomationStopStepSchema, RESERVED_RUN_VARS, SET_VAR_NAME_RE, SET_VAR_VALUE_MAX, SET_VARS_MAX, STOP_REASON_MAX, stepGuardOf, WAIT_MAX_SECONDS, EMPTY_AUTOMATION_STATE, mergeSkipTraces, AutomationConditionOperatorSchema, AutomationConditionTraceNodeSchema, AutomationRecipeSchema, AutomationWhenSchema, CurrentAutomationRecipeSchema, DETECTION_LABEL_SOURCES, DetectionSubjectSchema, LegacyAutomationRecipeSchema, LegacyConditionSchema, LegacyTriggerSchema, MAX_TRACE_ARG_LENGTH, MAX_STEP_DEVICE_OUTCOMES, MAX_TRACE_ARGS, MAX_WHEN_DEPTH, normalizeCapStep, normalizeStepTargets, StepDeviceTraceSchema, MAX_WHEN_LEAVES, REDACTED_ARG, StationarySubjectSchema, anySubjectMatches, buildStepArgsTrace, collectWhenMirrorSources, convertLegacyCondition, convertLegacyRecipe, convertLegacyWhen, countWhenLeaves, describeSubject, evaluateWhenTree, eventLeafIdAt, identifiedEventLeaves, hasTriggeredByLeaves, triggeredByIssue, EVENT_LEAF_ID_RE, TRIGGERED_BY_MAX_IDS, recipeSiteIssues, stepGuardSiteIssues, whenSiteIssues, forEachLeaf, BecomesOperatorSchema, BecomesWatch, HoldCore, HoldSpecSchema, HoldTraceSchema, HoldTracker, describeHold, describeHoldMs, hasEventLeaves, hasHoldLeaves, hasTimeLeaves, nextTimeBoundaryInMs, holdOf, observeHoldLeaves, isEventLeaf, isLeaf, subClassesOf, subjectFromClassName, subjectMatches, validateWhenTree, whenDepth, AutomationRunModeSchema, AutomationRunOutcomeSchema, AutomationRunTraceSchema, AutomationRunVerdictSchema, AutomationStateDocSchema, AutomationStepTraceSchema, AutomationTriggerTraceSchema, appendTrace, buildTriggerTrace, collectMirrorSources, ConditionMirror, stableIdKey, stableIdMapOf, DEFAULT_TRACE_KEEP, DetectionTriggerFilter, detectionClassMatches, evaluateConditionTree, evaluateStationaryTrigger, generateAutomationBlock, isSkippedTrace, MAX_CONDITION_DEPTH, MAX_CONDITION_LEAVES, MAX_TRACE_KEEP, RunGate, skipSignature, TraceNodeOutcomeSchema, TraceValueSchema, triggerLeafVariables, triggerVariablesOf, validateRecipeBounds, } from './automation/index.js';
196
197
  export { UnitWarningSchema, capUnitResolver, normalizeActionUnits, normalizeConditionUnits, normalizeRecipeUnits, prepareRecipeUnits, } from './automation/index.js';
197
198
  export type { PreparedRecipe, UnitResolver, UnitWarning, UnitsNormalized, } from './automation/index.js';
198
199
  export * from './automation/action.js';
@@ -201,6 +202,7 @@ export * from './automation/leaf-catalog.js';
201
202
  export * from './automation/scheduler.js';
202
203
  export * from './automation/step-condition.js';
203
204
  export * from './automation/step-runner.js';
205
+ export * from './automation/wait-until.js';
204
206
  export * from './automation/export-entities.js';
205
207
  export * from './automation/draft/index.js';
206
208
  export * from './cap-call-context.js';