@mhome/core-protocol 1.53.0 → 1.59.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -5,6 +5,11 @@ provider runtimes. Public `/app/*` contracts belong to
5
5
  `mhome-app-facade-api`; this crate owns internal MWS, authentication, LLM,
6
6
  Messaging normalization, Node runtime, and Storage contracts.
7
7
 
8
+ Plugin management uses the [generic transport contract](contract/plugin-management-v1.md).
9
+ This package distributes shared Node wire contracts, including Matter and Camera
10
+ management schemas; each Plugin owns their execution. App consumers use the
11
+ opaque Plugin Facade envelope, and Core does not aggregate these inventories.
12
+
8
13
  `messaging::IngressRedeem` carries a parsed identity code and a dedicated
9
14
  `IdentityRedemptionContext`: event ID, receiving address, sender and optional
10
15
  conversation display name. Redemption is independent of normalized message
@@ -191,6 +196,10 @@ of a completed result or timeout error; it never grants the callee more executio
191
196
  time. Existing domain-owned lifetimes (streams, subscriptions, long batch jobs)
192
197
  and implementation-specific step timeouts are not replaced by a default request
193
198
  budget. New shared operations need an explicit catalog entry and selector tests.
199
+ `hubMigration` gives an accepted migration worker up to ten minutes, including drain
200
+ and transfer. Starting a migration and querying its status remain ordinary requests.
201
+ Expiry fails the attempt; it does not prove that source requests drained or reopen
202
+ the Space. Explicit retries replace uncommitted snapshots and finish committed ownership.
194
203
 
195
204
  `execution_budget::Budgeted<T>` adds optional `executionBudget: { remainingMs }`
196
205
  metadata alongside an object envelope's existing fields. Bridge uses it on MWS
@@ -0,0 +1,69 @@
1
+ # Plugin management transport
2
+
3
+ Business management runs in the selected Plugin. Core authenticates the caller,
4
+ resolves the exact current-Space binding, enforces the connected Node's declared
5
+ `appAccess`, and forwards `/app/plugin/{nodeType}/{route}` to
6
+ `/{nodeType}/app/{route}`. Input is `{nodeId, version, payload}`; the Node receives
7
+ `{version, payload}`. The App Facade's successful data is
8
+ `{nodeId, nodeType, version, data}`. Consumers validate identity and version before
9
+ reading the business `data`. Business payloads are never Integration inventories
10
+ or Twin entity IDs merely because a field is named `devices`.
11
+
12
+ ## Preparation
13
+
14
+ A Plugin can implement a read-only `/{nodeType}/app/{route}/prepare` handler with
15
+ its own `appAccess` declaration at least as restrictive as execution. The request
16
+ uses the same version and original payload. Its runtime response data is
17
+ `{preview:{title,message,details},payload:{...}}`. `payload` is the concrete
18
+ business command with any revision or resource-set preconditions; `details` is
19
+ safe public confirmation content. Neither may contain credentials.
20
+
21
+ Core stores both but exposes only the public preview, adding the trusted Node ID
22
+ to its details. Commit revalidates authority and binding, repeats preparation,
23
+ and rejects changed previews or execution payloads. It then replaces only the
24
+ original request's payload. Target, Node ID, version and approval identity remain
25
+ Core-owned. The Plugin checks its preconditions atomically with the mutation.
26
+ There is no guarantee of exactly-once external effects. Existing platform-owned
27
+ LLM and AudioBridge previews retain their adapters.
28
+
29
+ ## Management events
30
+
31
+ A bound Node may publish `/node/app/event` with
32
+ `{version:"v1",event:"inventory/changed",data:{...}}`. Event names consist of
33
+ nonempty lowercase alphanumeric, underscore or hyphen segments separated by `/`,
34
+ up to 256 bytes. Core derives tenant, Space, Node ID and Node type from the
35
+ authenticated session and publishes `/app/plugin/event` to that Space with
36
+ `{nodeId,nodeType,version,event,data}`. A Node cannot supply another publisher's
37
+ identity or choose a platform event target. Consumers filter publisher identity
38
+ and Space. This is an observation; capability subscriptions retain their separate
39
+ protocol and delivery ledger.
40
+
41
+ ## Business contract ownership and discovery
42
+
43
+ Plugin-owned JSON contracts live with their implementations, independently of
44
+ Foundation packages. The official Camera, Matter and Mac sources are
45
+ `mhome-ai/integration`, under `plugins/<id>/contract.json`. Their business payloads,
46
+ operation identifiers and fixtures are not published in Foundation. LLM and Storage
47
+ platform backend contracts and canonical capability schemas remain platform-owned.
48
+
49
+ A signed release can reference business contracts under
50
+ `nodeMetadata.plugin.businessContracts`: each reference contains `id`, `version`
51
+ (contract SemVer), `sha256` (exact JSON bytes), package-relative `path`, and implemented
52
+ `operations`. Native packages carry the referenced JSON; firmware can embed the
53
+ reference and retain the pinned JSON in its source distribution.
54
+
55
+ The authenticated Node description may advertise `details.businessContracts`, with
56
+ `id`, `version`, `sha256` and its actual supported `operations`. This is descriptive,
57
+ not an authorization grant. `routes` and `appAccess` still control availability and
58
+ permission. The Plugin detail Facade projects public `api.businessContracts` and
59
+ `api.appAccess` from that session, never arbitrary runtime details. `api: null`
60
+ means offline/loading/unavailable; a null `businessContracts` means this older
61
+ implementation has no advertisement. Neither is an empty supported set.
62
+
63
+ Clients pin the business contract's identity and compatible major, and check
64
+ operation availability separately. An implementation may support a subset. A
65
+ schema/document move does not change wire version, payload shape or permissions.
66
+ Consumers tolerate additive response fields. New requests must not send fields
67
+ or operations that the selected implementation has not advertised support for;
68
+ unknown enum variants require an explicit fallback or a new major. Legacy strict
69
+ readers do not become compatible simply because this rule was documented.
@@ -21,5 +21,7 @@
21
21
  {"target":"/dispatch/app/integration/entity/refresh","payload":{},"operation":"entityRefresh","totalMs":85000,"lionWaitMs":90000},
22
22
  {"target":"/dispatch/agent/app/integration/entity/refresh","payload":{},"operation":"entityRefresh","totalMs":85000,"lionWaitMs":90000},
23
23
  {"target":"/bridge/automation/parse","payload":{"script":{"scripts":{"lighting":"source"}}},"operation":"scriptValidation","totalMs":205000,"lionWaitMs":230000},
24
- {"target":"/bridge/automation/format","payload":{"script":{"scripts":{"lighting":"source"}}},"operation":"scriptValidation","totalMs":205000,"lionWaitMs":230000}
24
+ {"target":"/bridge/automation/format","payload":{"script":{"scripts":{"lighting":"source"}}},"operation":"scriptValidation","totalMs":205000,"lionWaitMs":230000},
25
+ {"target":"/dispatch/hub/revoke/start","payload":{},"operation":"hubMigration","totalMs":600000},
26
+ {"target":"/bridge/hub/revoke/dataUploaded","payload":{},"operation":"hubMigration","totalMs":600000}
25
27
  ]
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "manifest": "mhome.core.v1",
3
- "contractVersion": "1.53.0",
3
+ "contractVersion": "1.59.0",
4
4
  "protocols": {
5
5
  "agentGateway": {
6
6
  "submitTarget": "/agent/submit",
@@ -10,6 +10,9 @@
10
10
  "completeTarget": "/llm/complete"
11
11
  },
12
12
  "node": {
13
+ "managementEventTarget": "/node/app/event",
14
+ "managementEventAppTarget": "/app/plugin/event",
15
+ "managementContract": "contract/plugin-management-v1.md",
13
16
  "settingsChangedTarget": "/node/settings/changed",
14
17
  "statusContract": "mhome.node.status.v1",
15
18
  "runtimeVersion": "v1",
@@ -24,27 +27,6 @@
24
27
  "metadataSchema": "schema/node-metadata.v1.schema.json",
25
28
  "metadataContract": "contract/node-metadata-v1.md"
26
29
  },
27
- "cameraPlugin": {
28
- "version": "v1",
29
- "nodeType": "camera",
30
- "appTargetPrefix": "/app/plugin/camera/",
31
- "runtimeTargetPrefix": "/camera/app/",
32
- "managementSchema": "schema/camera-plugin-management.v1.schema.json",
33
- "routes": {
34
- "deviceList": "device/list",
35
- "managementSnapshot": "management/snapshot",
36
- "deviceSettingsGet": "device/settings/get",
37
- "deviceSettingsUpdate": "device/settings/update",
38
- "providerList": "provider/list",
39
- "connectionList": "connection/list",
40
- "connectionDetail": "connection/detail",
41
- "connectionDisconnect": "connection/disconnect"
42
- },
43
- "flows": {
44
- "connectionCreate": "connection.create",
45
- "connectionReconfigure": "connection.reconfigure"
46
- }
47
- },
48
30
  "audioBridgePlugin": {
49
31
  "version": "v1",
50
32
  "nodeType": "audiobridge",
@@ -69,10 +51,10 @@
69
51
  "commandsSchema": "schema/messaging-commands.v1.schema.json"
70
52
  },
71
53
  "storage": {
72
- "version": "storage.v2"
54
+ "version": "storage.v1"
73
55
  },
74
56
  "hostDelivery": {
75
- "externalProtocolVersion": 24,
57
+ "externalProtocolVersion": 25,
76
58
  "requestKind": "deliveryRequested",
77
59
  "connectionControlKind": "connectionControlRequested",
78
60
  "acceptanceBoundaries": [
@@ -2,6 +2,7 @@
2
2
  "manifest": "mhome.operation-timeouts.v1",
3
3
  "operations": {
4
4
  "coreRequest": { "totalMs": 60000, "description": "Default Core request execution." },
5
+ "hubMigration": { "totalMs": 600000, "description": "One accepted Hub migration attempt, including drain and transfer; ordinary start/status requests retain their request budget." },
5
6
  "eventProcessing": { "totalMs": 60000, "description": "One Automation event delivery and its execution slice, including admission and preparation; durable waits are separate." },
6
7
  "entityRefresh": { "totalMs": 85000, "description": "Integration entity refresh including source loading and response preparation." },
7
8
  "harnessSessionOpen": { "totalMs": 150000, "description": "Harness session initialization." },
@@ -24,6 +25,6 @@
24
25
  "storedScriptSave": ["/automation/snapshot/rollback", "/app/automation/snapshot/rollback", "/automation/overview/save", "/automation/copy", "/automation/enroll"],
25
26
  "sourceScriptSave": ["/automation/save", "/app/automation/save"],
26
27
  "sourceScriptValidation": ["/app/automation/verify", "/bridge/automation/parse", "/bridge/automation/format", "/bridge/automation/verify", "/automation/format", "/bridge/automation/compile", "/bridge/agent/automation/compile"],
27
- "ordinaryOverrides": { "/app/integration/entity/refresh": "entityRefresh", "/harness/test/session/open": "harnessSessionOpen" }
28
+ "ordinaryOverrides": { "/hub/revoke/start": "hubMigration", "/bridge/hub/revoke/dataUploaded": "hubMigration", "/app/integration/entity/refresh": "entityRefresh", "/harness/test/session/open": "harnessSessionOpen" }
28
29
  }
29
30
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mhome/core-protocol",
3
- "version": "1.53.0",
3
+ "version": "1.59.0",
4
4
  "description": "Build-time protocol artifacts for mhome.core",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -37,7 +37,6 @@
37
37
  "./fixtures/*": "./fixtures/*"
38
38
  },
39
39
  "publishConfig": {
40
- "access": "public",
41
- "provenance": true
40
+ "access": "public"
42
41
  }
43
42
  }
package/protocol.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "protocol": "mhome.core",
3
- "contractVersion": "1.53.0",
3
+ "contractVersion": "1.59.0",
4
4
  "manifest": "manifest/core.v1.json",
5
5
  "schemas": {
6
6
  "hostManagementRequest": "schema/host-management-request.v1.schema.json",
@@ -8,13 +8,12 @@
8
8
  "normalizedInbound": "schema/normalized-inbound.v4.schema.json",
9
9
  "messagingCommands": "schema/messaging-commands.v1.schema.json",
10
10
  "interactionFlowNode": "schema/interaction-flow-node.v1.schema.json",
11
- "cameraPluginManagement": "schema/camera-plugin-management.v1.schema.json"
11
+ "pluginManagement": "schema/plugin-management.v1.schema.json"
12
12
  },
13
13
  "fixtures": {
14
14
  "normalizedInbound": "fixtures/normalized-inbound.conformance.json",
15
15
  "messagingCommands": "fixtures/messaging-commands.conformance.json",
16
16
  "interactionFlowNode": "fixtures/interaction-flow-node.conformance.json",
17
- "cameraPluginManagement": "fixtures/camera-plugin-management.conformance.json",
18
17
  "recipientId": "fixtures/recipient-id.conformance.json"
19
18
  }
20
19
  }
@@ -0,0 +1,27 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://mhome.ai/schema/core/plugin-management.v1.schema.json",
4
+ "$defs": {
5
+ "preparedOperation": {
6
+ "type": "object", "additionalProperties": false,
7
+ "required": ["preview", "payload"],
8
+ "properties": {
9
+ "preview": {
10
+ "type": "object", "additionalProperties": false,
11
+ "required": ["title", "message", "details"],
12
+ "properties": {"title":{"type":"string","minLength":1},"message":{"type":"string"},"details":{"type":"object"}}
13
+ },
14
+ "payload": {"type":"object"}
15
+ }
16
+ },
17
+ "event": {
18
+ "type":"object", "additionalProperties":false,
19
+ "required":["version","event","data"],
20
+ "properties": {
21
+ "version":{"const":"v1"},
22
+ "event":{"type":"string","maxLength":256,"pattern":"^[a-z0-9_-]+(/[a-z0-9_-]+)*$"},
23
+ "data":{}
24
+ }
25
+ }
26
+ }
27
+ }
@@ -1,365 +0,0 @@
1
- {
2
- "valid": [
3
- {
4
- "name": "empty request",
5
- "value": {}
6
- },
7
- {
8
- "name": "device request",
9
- "value": {
10
- "deviceId": "camera-1"
11
- }
12
- },
13
- {
14
- "name": "watch set request",
15
- "value": {
16
- "deviceId": "camera-1",
17
- "settings": {
18
- "watchMode": "auto"
19
- }
20
- }
21
- },
22
- {
23
- "name": "management snapshot",
24
- "value": {
25
- "providers": [
26
- {
27
- "id": "onvif",
28
- "displayName": "ONVIF",
29
- "description": "ONVIF cameras",
30
- "supportsMultipleCameras": true
31
- }
32
- ],
33
- "devices": [
34
- {
35
- "id": "camera-1",
36
- "name": "Front Door",
37
- "capabilities": [
38
- "state.cameraMotion"
39
- ],
40
- "health": "ready",
41
- "connectionId": "connection-1",
42
- "resolutionStatus": "ready"
43
- }
44
- ],
45
- "onlineStates": [
46
- {
47
- "id": "camera-1",
48
- "state": "online",
49
- "observedAt": 1767225600,
50
- "source": "onvif"
51
- }
52
- ],
53
- "connections": [],
54
- "cameraSettings": [
55
- {
56
- "deviceId": "camera-1",
57
- "revision": 1,
58
- "settings": {
59
- "watchMode": "off",
60
- "objectDetectionMode": "off",
61
- "personDetectionMode": "off",
62
- "recordMode": "off",
63
- "preRollSeconds": 8,
64
- "postRollSeconds": 15
65
- }
66
- }
67
- ]
68
- }
69
- },
70
- {
71
- "name": "device list",
72
- "value": {
73
- "devices": [],
74
- "onlineStates": []
75
- }
76
- },
77
- {
78
- "name": "device mutation",
79
- "value": {
80
- "deviceIds": [
81
- "camera-1"
82
- ],
83
- "changed": true,
84
- "connectionId": "connection-1"
85
- }
86
- },
87
- {
88
- "name": "watch response",
89
- "value": {
90
- "deviceId": "camera-1",
91
- "revision": 1,
92
- "settings": {
93
- "watchMode": "off",
94
- "objectDetectionMode": "off",
95
- "personDetectionMode": "off",
96
- "recordMode": "off",
97
- "preRollSeconds": 8,
98
- "postRollSeconds": 15
99
- }
100
- }
101
- },
102
- {
103
- "name": "operation error",
104
- "value": {
105
- "ok": false,
106
- "reason": "CAMERA_OPERATION_FAILED",
107
- "detail": "failed"
108
- }
109
- },
110
- {
111
- "name": "connection-detail-request",
112
- "value": {
113
- "connectionId": "ha-1"
114
- }
115
- },
116
- {
117
- "name": "connected-empty-ha",
118
- "value": {
119
- "providers": [],
120
- "connections": [
121
- {
122
- "id": "ha-1",
123
- "name": "http://homeassistant.local:8123",
124
- "deviceCount": 0,
125
- "provider": "home_assistant",
126
- "revision": 1
127
- }
128
- ],
129
- "devices": [],
130
- "onlineStates": [],
131
- "cameraSettings": []
132
- }
133
- },
134
- {
135
- "name": "recording without preroll or postroll",
136
- "value": {
137
- "deviceId": "camera-1",
138
- "settings": {
139
- "preRollSeconds": 0,
140
- "postRollSeconds": 0
141
- }
142
- }
143
- },
144
- {
145
- "name": "recording retention limits",
146
- "value": {
147
- "deviceId": "camera-1",
148
- "settings": {
149
- "preRollSeconds": 120,
150
- "postRollSeconds": 300
151
- }
152
- }
153
- },
154
- {
155
- "name": "update only preroll",
156
- "value": {
157
- "deviceId": "camera-1",
158
- "settings": {
159
- "preRollSeconds": 60
160
- }
161
- }
162
- },
163
- {
164
- "name": "update only postroll",
165
- "value": {
166
- "deviceId": "camera-1",
167
- "settings": {
168
- "postRollSeconds": 30
169
- }
170
- }
171
- }
172
- ],
173
- "invalid": [
174
- {
175
- "name": "watch mutation missing enabled",
176
- "value": {
177
- "deviceId": "camera-1",
178
- "unexpected": true
179
- }
180
- },
181
- {
182
- "name": "unknown health",
183
- "value": {
184
- "providers": [],
185
- "devices": [
186
- {
187
- "id": "camera-1",
188
- "name": "Front",
189
- "capabilities": [],
190
- "health": "unknown",
191
- "connectionId": "connection-1",
192
- "resolutionStatus": "ready"
193
- }
194
- ],
195
- "onlineStates": [],
196
- "connections": [],
197
- "cameraSettings": []
198
- }
199
- },
200
- {
201
- "name": "device leaks internal field",
202
- "value": {
203
- "devices": [
204
- {
205
- "id": "camera-1",
206
- "name": "Front Door",
207
- "capabilities": [],
208
- "health": "ready",
209
- "sourceUid": "secret",
210
- "connectionId": "connection-1",
211
- "resolutionStatus": "ready"
212
- }
213
- ],
214
- "onlineStates": []
215
- }
216
- },
217
- {
218
- "name": "empty patch",
219
- "value": {
220
- "deviceId": "camera-1",
221
- "settings": {}
222
- }
223
- },
224
- {
225
- "name": "invalid mode",
226
- "value": {
227
- "deviceId": "camera-1",
228
- "settings": {
229
- "watchMode": "on"
230
- }
231
- }
232
- },
233
- {
234
- "name": "preRollSeconds null",
235
- "value": {
236
- "deviceId": "camera-1",
237
- "settings": {
238
- "preRollSeconds": null
239
- }
240
- }
241
- },
242
- {
243
- "name": "preRollSeconds negative",
244
- "value": {
245
- "deviceId": "camera-1",
246
- "settings": {
247
- "preRollSeconds": -1
248
- }
249
- }
250
- },
251
- {
252
- "name": "preRollSeconds fractional",
253
- "value": {
254
- "deviceId": "camera-1",
255
- "settings": {
256
- "preRollSeconds": 1.5
257
- }
258
- }
259
- },
260
- {
261
- "name": "preRollSeconds string",
262
- "value": {
263
- "deviceId": "camera-1",
264
- "settings": {
265
- "preRollSeconds": "15"
266
- }
267
- }
268
- },
269
- {
270
- "name": "preRollSeconds above limit",
271
- "value": {
272
- "deviceId": "camera-1",
273
- "settings": {
274
- "preRollSeconds": 121
275
- }
276
- }
277
- },
278
- {
279
- "name": "settings snapshot missing preRollSeconds",
280
- "value": {
281
- "deviceId": "camera-1",
282
- "revision": 1,
283
- "settings": {
284
- "watchMode": "off",
285
- "objectDetectionMode": "off",
286
- "personDetectionMode": "off",
287
- "recordMode": "off",
288
- "postRollSeconds": 15
289
- }
290
- }
291
- },
292
- {
293
- "name": "postRollSeconds null",
294
- "value": {
295
- "deviceId": "camera-1",
296
- "settings": {
297
- "postRollSeconds": null
298
- }
299
- }
300
- },
301
- {
302
- "name": "postRollSeconds negative",
303
- "value": {
304
- "deviceId": "camera-1",
305
- "settings": {
306
- "postRollSeconds": -1
307
- }
308
- }
309
- },
310
- {
311
- "name": "postRollSeconds fractional",
312
- "value": {
313
- "deviceId": "camera-1",
314
- "settings": {
315
- "postRollSeconds": 1.5
316
- }
317
- }
318
- },
319
- {
320
- "name": "postRollSeconds string",
321
- "value": {
322
- "deviceId": "camera-1",
323
- "settings": {
324
- "postRollSeconds": "15"
325
- }
326
- }
327
- },
328
- {
329
- "name": "postRollSeconds above limit",
330
- "value": {
331
- "deviceId": "camera-1",
332
- "settings": {
333
- "postRollSeconds": 301
334
- }
335
- }
336
- },
337
- {
338
- "name": "settings snapshot missing postRollSeconds",
339
- "value": {
340
- "deviceId": "camera-1",
341
- "revision": 1,
342
- "settings": {
343
- "watchMode": "off",
344
- "objectDetectionMode": "off",
345
- "personDetectionMode": "off",
346
- "recordMode": "off",
347
- "preRollSeconds": 8
348
- }
349
- }
350
- },
351
- {
352
- "name": "old source request",
353
- "value": {
354
- "sourceId": "ha-1"
355
- }
356
- },
357
- {
358
- "name": "disconnect without valid revision",
359
- "value": {
360
- "connectionId": "connection-1",
361
- "expectedRevision": 0
362
- }
363
- }
364
- ]
365
- }
@@ -1,559 +0,0 @@
1
- {
2
- "$schema": "https://json-schema.org/draft/2020-12/schema",
3
- "$id": "https://mhome.ai/schema/camera-plugin-management.v1.schema.json",
4
- "title": "Camera Plugin management values",
5
- "oneOf": [
6
- {
7
- "$ref": "#/$defs/emptyRequest"
8
- },
9
- {
10
- "$ref": "#/$defs/deviceIdRequest"
11
- },
12
- {
13
- "$ref": "#/$defs/deviceSettingsUpdateRequest"
14
- },
15
- {
16
- "$ref": "#/$defs/managementSnapshot"
17
- },
18
- {
19
- "$ref": "#/$defs/deviceListResponse"
20
- },
21
- {
22
- "$ref": "#/$defs/connectionMutationResponse"
23
- },
24
- {
25
- "$ref": "#/$defs/deviceSettingsResponse"
26
- },
27
- {
28
- "$ref": "#/$defs/errorResponse"
29
- },
30
- {
31
- "$ref": "#/$defs/connectionIdRequest"
32
- },
33
- {
34
- "$ref": "#/$defs/connectionDisconnectRequest"
35
- },
36
- {
37
- "$ref": "#/$defs/connectionListResponse"
38
- },
39
- {
40
- "$ref": "#/$defs/providerListResponse"
41
- },
42
- {
43
- "$ref": "#/$defs/connectionDetailResponse"
44
- }
45
- ],
46
- "$defs": {
47
- "emptyRequest": {
48
- "type": "object",
49
- "additionalProperties": false
50
- },
51
- "deviceIdRequest": {
52
- "type": "object",
53
- "required": [
54
- "deviceId"
55
- ],
56
- "properties": {
57
- "deviceId": {
58
- "type": "string",
59
- "minLength": 1
60
- }
61
- },
62
- "additionalProperties": false
63
- },
64
- "providerCatalogItem": {
65
- "type": "object",
66
- "required": [
67
- "id",
68
- "displayName",
69
- "description",
70
- "supportsMultipleCameras"
71
- ],
72
- "properties": {
73
- "id": {
74
- "type": "string",
75
- "minLength": 1
76
- },
77
- "displayName": {
78
- "type": "string",
79
- "minLength": 1
80
- },
81
- "description": {
82
- "type": "string"
83
- },
84
- "supportsMultipleCameras": {
85
- "type": "boolean"
86
- }
87
- },
88
- "additionalProperties": false
89
- },
90
- "cameraDevice": {
91
- "type": "object",
92
- "required": [
93
- "id",
94
- "name",
95
- "capabilities",
96
- "health",
97
- "connectionId",
98
- "resolutionStatus"
99
- ],
100
- "properties": {
101
- "id": {
102
- "type": "string",
103
- "minLength": 1
104
- },
105
- "name": {
106
- "type": "string",
107
- "minLength": 1
108
- },
109
- "manufacturerName": {
110
- "type": "string",
111
- "minLength": 1
112
- },
113
- "capabilities": {
114
- "type": "array",
115
- "items": {
116
- "type": "string",
117
- "minLength": 1
118
- },
119
- "uniqueItems": true
120
- },
121
- "health": {
122
- "enum": [
123
- "applying",
124
- "ready",
125
- "degraded",
126
- "error"
127
- ]
128
- },
129
- "lastError": {
130
- "type": "string",
131
- "minLength": 1
132
- },
133
- "connectionId": {
134
- "type": "string",
135
- "minLength": 1
136
- },
137
- "resolutionStatus": {
138
- "enum": [
139
- "unresolved",
140
- "ready",
141
- "failed"
142
- ]
143
- }
144
- },
145
- "additionalProperties": false
146
- },
147
- "onlineStateObservation": {
148
- "type": "object",
149
- "required": [
150
- "id",
151
- "state"
152
- ],
153
- "properties": {
154
- "id": {
155
- "type": "string",
156
- "minLength": 1
157
- },
158
- "state": {
159
- "enum": [
160
- "online",
161
- "offline"
162
- ]
163
- },
164
- "observedAt": {
165
- "type": "integer"
166
- },
167
- "source": {
168
- "type": "string",
169
- "minLength": 1
170
- },
171
- "reason": {
172
- "type": "string",
173
- "minLength": 1
174
- }
175
- },
176
- "additionalProperties": false
177
- },
178
- "managementSnapshot": {
179
- "type": "object",
180
- "required": [
181
- "providers",
182
- "devices",
183
- "onlineStates",
184
- "cameraSettings",
185
- "connections"
186
- ],
187
- "properties": {
188
- "providers": {
189
- "type": "array",
190
- "items": {
191
- "$ref": "#/$defs/providerCatalogItem"
192
- }
193
- },
194
- "devices": {
195
- "type": "array",
196
- "items": {
197
- "$ref": "#/$defs/cameraDevice"
198
- }
199
- },
200
- "onlineStates": {
201
- "type": "array",
202
- "items": {
203
- "$ref": "#/$defs/onlineStateObservation"
204
- }
205
- },
206
- "connections": {
207
- "type": "array",
208
- "items": {
209
- "$ref": "#/$defs/cameraConnection"
210
- }
211
- },
212
- "cameraSettings": {
213
- "type": "array",
214
- "items": {
215
- "$ref": "#/$defs/deviceSettingsResponse"
216
- }
217
- }
218
- },
219
- "additionalProperties": false
220
- },
221
- "deviceListResponse": {
222
- "type": "object",
223
- "required": [
224
- "devices",
225
- "onlineStates"
226
- ],
227
- "properties": {
228
- "devices": {
229
- "type": "array",
230
- "items": {
231
- "$ref": "#/$defs/cameraDevice"
232
- }
233
- },
234
- "onlineStates": {
235
- "type": "array",
236
- "items": {
237
- "$ref": "#/$defs/onlineStateObservation"
238
- }
239
- }
240
- },
241
- "additionalProperties": false
242
- },
243
- "connectionMutationResponse": {
244
- "type": "object",
245
- "required": [
246
- "deviceIds",
247
- "changed",
248
- "connectionId"
249
- ],
250
- "properties": {
251
- "deviceIds": {
252
- "type": "array",
253
- "items": {
254
- "type": "string",
255
- "minLength": 1
256
- },
257
- "uniqueItems": true
258
- },
259
- "changed": {
260
- "type": "boolean"
261
- },
262
- "connectionId": {
263
- "type": "string",
264
- "minLength": 1
265
- }
266
- },
267
- "additionalProperties": false
268
- },
269
- "errorResponse": {
270
- "type": "object",
271
- "required": [
272
- "ok",
273
- "reason",
274
- "detail"
275
- ],
276
- "properties": {
277
- "ok": {
278
- "const": false
279
- },
280
- "reason": {
281
- "type": "string",
282
- "minLength": 1
283
- },
284
- "detail": {
285
- "type": "string",
286
- "minLength": 1
287
- }
288
- },
289
- "additionalProperties": false
290
- },
291
- "connectionIdRequest": {
292
- "type": "object",
293
- "required": [
294
- "connectionId"
295
- ],
296
- "properties": {
297
- "connectionId": {
298
- "type": "string",
299
- "minLength": 1
300
- }
301
- },
302
- "additionalProperties": false
303
- },
304
- "cameraConnection": {
305
- "type": "object",
306
- "required": [
307
- "id",
308
- "name",
309
- "deviceCount",
310
- "provider",
311
- "revision"
312
- ],
313
- "properties": {
314
- "id": {
315
- "type": "string",
316
- "minLength": 1
317
- },
318
- "name": {
319
- "type": "string",
320
- "minLength": 1
321
- },
322
- "deviceCount": {
323
- "type": "integer",
324
- "minimum": 0
325
- },
326
- "lastError": {
327
- "type": [
328
- "string",
329
- "null"
330
- ]
331
- },
332
- "lastRefreshedAt": {
333
- "type": [
334
- "string",
335
- "null"
336
- ]
337
- },
338
- "provider": {
339
- "type": "string",
340
- "minLength": 1
341
- },
342
- "revision": {
343
- "type": "integer",
344
- "minimum": 1
345
- }
346
- },
347
- "additionalProperties": false
348
- },
349
- "cameraSettings": {
350
- "type": "object",
351
- "properties": {
352
- "watchMode": {
353
- "enum": [
354
- "off",
355
- "auto"
356
- ]
357
- },
358
- "objectDetectionMode": {
359
- "enum": [
360
- "off",
361
- "auto"
362
- ]
363
- },
364
- "personDetectionMode": {
365
- "enum": [
366
- "off",
367
- "auto"
368
- ]
369
- },
370
- "recordMode": {
371
- "enum": [
372
- "off",
373
- "event"
374
- ]
375
- },
376
- "preRollSeconds": {
377
- "type": "integer",
378
- "minimum": 0,
379
- "maximum": 120
380
- },
381
- "postRollSeconds": {
382
- "type": "integer",
383
- "minimum": 0,
384
- "maximum": 300
385
- }
386
- },
387
- "additionalProperties": false,
388
- "required": [
389
- "watchMode",
390
- "objectDetectionMode",
391
- "personDetectionMode",
392
- "recordMode",
393
- "preRollSeconds",
394
- "postRollSeconds"
395
- ]
396
- },
397
- "cameraSettingsPatch": {
398
- "type": "object",
399
- "properties": {
400
- "watchMode": {
401
- "enum": [
402
- "off",
403
- "auto"
404
- ]
405
- },
406
- "objectDetectionMode": {
407
- "enum": [
408
- "off",
409
- "auto"
410
- ]
411
- },
412
- "personDetectionMode": {
413
- "enum": [
414
- "off",
415
- "auto"
416
- ]
417
- },
418
- "recordMode": {
419
- "enum": [
420
- "off",
421
- "event"
422
- ]
423
- },
424
- "preRollSeconds": {
425
- "type": "integer",
426
- "minimum": 0,
427
- "maximum": 120
428
- },
429
- "postRollSeconds": {
430
- "type": "integer",
431
- "minimum": 0,
432
- "maximum": 300
433
- }
434
- },
435
- "additionalProperties": false,
436
- "minProperties": 1
437
- },
438
- "deviceSettingsUpdateRequest": {
439
- "type": "object",
440
- "required": [
441
- "deviceId",
442
- "settings"
443
- ],
444
- "properties": {
445
- "deviceId": {
446
- "type": "string",
447
- "minLength": 1
448
- },
449
- "settings": {
450
- "$ref": "#/$defs/cameraSettingsPatch"
451
- }
452
- },
453
- "additionalProperties": false
454
- },
455
- "deviceSettingsResponse": {
456
- "type": "object",
457
- "required": [
458
- "deviceId",
459
- "revision",
460
- "settings"
461
- ],
462
- "properties": {
463
- "deviceId": {
464
- "type": "string",
465
- "minLength": 1
466
- },
467
- "revision": {
468
- "type": "integer",
469
- "minimum": 0
470
- },
471
- "settings": {
472
- "$ref": "#/$defs/cameraSettings"
473
- }
474
- },
475
- "additionalProperties": false
476
- },
477
- "connectionDisconnectRequest": {
478
- "type": "object",
479
- "required": [
480
- "connectionId",
481
- "expectedRevision"
482
- ],
483
- "properties": {
484
- "connectionId": {
485
- "type": "string",
486
- "minLength": 1
487
- },
488
- "expectedRevision": {
489
- "type": "integer",
490
- "minimum": 1
491
- },
492
- "expectedDeviceIds": {
493
- "type": "array",
494
- "items": {
495
- "type": "string"
496
- },
497
- "uniqueItems": true
498
- }
499
- },
500
- "additionalProperties": false
501
- },
502
- "connectionListResponse": {
503
- "type": "object",
504
- "required": [
505
- "connections"
506
- ],
507
- "properties": {
508
- "connections": {
509
- "type": "array",
510
- "items": {
511
- "$ref": "#/$defs/cameraConnection"
512
- }
513
- }
514
- },
515
- "additionalProperties": false
516
- },
517
- "providerListResponse": {
518
- "type": "object",
519
- "required": [
520
- "providers"
521
- ],
522
- "properties": {
523
- "providers": {
524
- "type": "array",
525
- "items": {
526
- "$ref": "#/$defs/providerCatalogItem"
527
- }
528
- }
529
- },
530
- "additionalProperties": false
531
- },
532
- "connectionDetailResponse": {
533
- "type": "object",
534
- "required": [
535
- "connection",
536
- "devices"
537
- ],
538
- "properties": {
539
- "connection": {
540
- "anyOf": [
541
- {
542
- "$ref": "#/$defs/cameraConnection"
543
- },
544
- {
545
- "type": "null"
546
- }
547
- ]
548
- },
549
- "devices": {
550
- "type": "array",
551
- "items": {
552
- "$ref": "#/$defs/cameraDevice"
553
- }
554
- }
555
- },
556
- "additionalProperties": false
557
- }
558
- }
559
- }