@mhome/core-protocol 1.3.1 → 1.4.2
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.
|
@@ -1,27 +1,25 @@
|
|
|
1
1
|
{
|
|
2
2
|
"valid": [
|
|
3
3
|
{ "name": "empty request", "value": {} },
|
|
4
|
-
{ "name": "
|
|
5
|
-
{ "name": "watch status request", "value": { "deviceId": "camera-1" } },
|
|
4
|
+
{ "name": "device request", "value": { "deviceId": "camera-1" } },
|
|
6
5
|
{ "name": "watch set request", "value": { "deviceId": "camera-1", "enabled": true } },
|
|
7
6
|
{
|
|
8
7
|
"name": "management snapshot",
|
|
9
8
|
"value": {
|
|
10
9
|
"providers": [{ "id": "onvif", "displayName": "ONVIF", "description": "ONVIF cameras", "supportsMultipleCameras": true }],
|
|
11
|
-
"
|
|
12
|
-
"devices": [{ "id": "camera-1", "providerProfileId": "provider-1", "providerNativeId": "front-door", "name": "Front Door", "capabilities": ["state.cameraMotion"] }],
|
|
10
|
+
"devices": [{ "id": "camera-1", "name": "Front Door", "capabilities": ["state.cameraMotion"], "health": "ready" }],
|
|
13
11
|
"onlineStates": [{ "id": "camera-1", "state": "online", "observedAt": 1767225600, "source": "onvif" }],
|
|
14
12
|
"watchStates": [{ "ok": true, "deviceId": "camera-1", "enabled": false }]
|
|
15
13
|
}
|
|
16
14
|
},
|
|
17
15
|
{ "name": "device list", "value": { "devices": [], "onlineStates": [] } },
|
|
18
|
-
{ "name": "
|
|
16
|
+
{ "name": "device mutation", "value": { "deviceIds": ["camera-1"], "changed": true } },
|
|
19
17
|
{ "name": "watch response", "value": { "ok": true, "deviceId": "camera-1", "enabled": true } },
|
|
20
18
|
{ "name": "operation error", "value": { "ok": false, "reason": "CAMERA_OPERATION_FAILED", "detail": "failed" } }
|
|
21
19
|
],
|
|
22
20
|
"invalid": [
|
|
23
21
|
{ "name": "watch mutation missing enabled", "value": { "deviceId": "camera-1", "unexpected": true } },
|
|
24
|
-
{ "name": "unknown health", "value": { "providers": [], "
|
|
25
|
-
{ "name": "device leaks internal field", "value": { "devices": [{ "id": "camera-1", "
|
|
22
|
+
{ "name": "unknown health", "value": { "providers": [], "devices": [{ "id": "camera-1", "name": "Front", "capabilities": [], "health": "unknown" }], "onlineStates": [], "watchStates": [] } },
|
|
23
|
+
{ "name": "device leaks internal field", "value": { "devices": [{ "id": "camera-1", "name": "Front Door", "capabilities": [], "health": "ready", "sourceUid": "secret" }], "onlineStates": [] } }
|
|
26
24
|
]
|
|
27
25
|
}
|
package/manifest/core.v1.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"manifest": "mhome.core.v1",
|
|
3
|
-
"contractVersion": "1.
|
|
3
|
+
"contractVersion": "1.4.2",
|
|
4
4
|
"protocols": {
|
|
5
5
|
"llm": {
|
|
6
6
|
"completeTarget": "/llm/complete"
|
|
@@ -23,16 +23,34 @@
|
|
|
23
23
|
"routes": {
|
|
24
24
|
"deviceList": "device/list",
|
|
25
25
|
"managementSnapshot": "management/snapshot",
|
|
26
|
-
"
|
|
27
|
-
"providerRemove": "provider/remove",
|
|
26
|
+
"deviceRemove": "device/remove",
|
|
28
27
|
"watchStatus": "watch/status",
|
|
29
28
|
"watchSet": "watch/set"
|
|
30
29
|
},
|
|
31
30
|
"flows": {
|
|
32
|
-
"
|
|
33
|
-
"providerEdit": "provider.edit"
|
|
31
|
+
"deviceAdd": "device.add"
|
|
34
32
|
}
|
|
35
33
|
},
|
|
34
|
+
"audioBridgePlugin": {
|
|
35
|
+
"version": "v1",
|
|
36
|
+
"nodeType": "audiobridge",
|
|
37
|
+
"appTargetPrefix": "/app/plugin/audiobridge/",
|
|
38
|
+
"runtimeTargetPrefix": "/audiobridge/app/",
|
|
39
|
+
"routes": {
|
|
40
|
+
"deviceSnapshot": "device/snapshot",
|
|
41
|
+
"deviceRefresh": "device/refresh",
|
|
42
|
+
"devicePair": "device/pair",
|
|
43
|
+
"deviceUnpair": "device/unpair",
|
|
44
|
+
"deviceTest": "device/test",
|
|
45
|
+
"deviceListenSet": "device/listen",
|
|
46
|
+
"smartSpeakerSnapshot": "smart-speaker/snapshot",
|
|
47
|
+
"smartSpeakerCreate": "smart-speaker/create",
|
|
48
|
+
"smartSpeakerUpdate": "smart-speaker/update",
|
|
49
|
+
"smartSpeakerRemove": "smart-speaker/remove"
|
|
50
|
+
},
|
|
51
|
+
"agentAudioSubmitTarget": "/app/agent/audio/submit",
|
|
52
|
+
"agentReplyTarget": "/audiobridge/agent/reply"
|
|
53
|
+
},
|
|
36
54
|
"messaging": {
|
|
37
55
|
"normalizedInboundSchema": "schema/normalized-inbound.v4.schema.json",
|
|
38
56
|
"commandsSchema": "schema/messaging-commands.v1.schema.json"
|
package/package.json
CHANGED
package/protocol.json
CHANGED
|
@@ -4,27 +4,17 @@
|
|
|
4
4
|
"title": "Camera Plugin management values",
|
|
5
5
|
"oneOf": [
|
|
6
6
|
{ "$ref": "#/$defs/emptyRequest" },
|
|
7
|
-
{ "$ref": "#/$defs/
|
|
8
|
-
{ "$ref": "#/$defs/watchStatusRequest" },
|
|
7
|
+
{ "$ref": "#/$defs/deviceIdRequest" },
|
|
9
8
|
{ "$ref": "#/$defs/watchSetRequest" },
|
|
10
9
|
{ "$ref": "#/$defs/managementSnapshot" },
|
|
11
10
|
{ "$ref": "#/$defs/deviceListResponse" },
|
|
12
|
-
{ "$ref": "#/$defs/
|
|
11
|
+
{ "$ref": "#/$defs/deviceMutationResponse" },
|
|
13
12
|
{ "$ref": "#/$defs/watchControlResponse" },
|
|
14
13
|
{ "$ref": "#/$defs/errorResponse" }
|
|
15
14
|
],
|
|
16
15
|
"$defs": {
|
|
17
|
-
"emptyRequest": {
|
|
18
|
-
|
|
19
|
-
"additionalProperties": false
|
|
20
|
-
},
|
|
21
|
-
"providerProfileIdRequest": {
|
|
22
|
-
"type": "object",
|
|
23
|
-
"required": ["profileId"],
|
|
24
|
-
"properties": { "profileId": { "type": "string", "minLength": 1 } },
|
|
25
|
-
"additionalProperties": false
|
|
26
|
-
},
|
|
27
|
-
"watchStatusRequest": {
|
|
16
|
+
"emptyRequest": { "type": "object", "additionalProperties": false },
|
|
17
|
+
"deviceIdRequest": {
|
|
28
18
|
"type": "object",
|
|
29
19
|
"required": ["deviceId"],
|
|
30
20
|
"properties": { "deviceId": { "type": "string", "minLength": 1 } },
|
|
@@ -50,36 +40,20 @@
|
|
|
50
40
|
},
|
|
51
41
|
"additionalProperties": false
|
|
52
42
|
},
|
|
53
|
-
"providerProfile": {
|
|
54
|
-
"type": "object",
|
|
55
|
-
"required": ["id", "providerType", "displayName", "health", "cameraCount", "createdAt", "updatedAt"],
|
|
56
|
-
"properties": {
|
|
57
|
-
"id": { "type": "string", "minLength": 1 },
|
|
58
|
-
"providerType": { "type": "string", "minLength": 1 },
|
|
59
|
-
"displayName": { "type": "string", "minLength": 1 },
|
|
60
|
-
"health": { "enum": ["applying", "ready", "degraded", "error"] },
|
|
61
|
-
"lastError": { "type": "string" },
|
|
62
|
-
"cameraCount": { "type": "integer", "minimum": 0 },
|
|
63
|
-
"createdAt": { "type": "string", "minLength": 1 },
|
|
64
|
-
"updatedAt": { "type": "string", "minLength": 1 },
|
|
65
|
-
"lastRefreshedAt": { "type": "string", "minLength": 1 }
|
|
66
|
-
},
|
|
67
|
-
"additionalProperties": false
|
|
68
|
-
},
|
|
69
43
|
"cameraDevice": {
|
|
70
44
|
"type": "object",
|
|
71
|
-
"required": ["id", "
|
|
45
|
+
"required": ["id", "name", "capabilities", "health"],
|
|
72
46
|
"properties": {
|
|
73
47
|
"id": { "type": "string", "minLength": 1 },
|
|
74
|
-
"providerProfileId": { "type": "string", "minLength": 1 },
|
|
75
|
-
"providerNativeId": { "type": "string", "minLength": 1 },
|
|
76
48
|
"name": { "type": "string", "minLength": 1 },
|
|
77
49
|
"manufacturerName": { "type": "string", "minLength": 1 },
|
|
78
50
|
"capabilities": {
|
|
79
51
|
"type": "array",
|
|
80
52
|
"items": { "type": "string", "minLength": 1 },
|
|
81
53
|
"uniqueItems": true
|
|
82
|
-
}
|
|
54
|
+
},
|
|
55
|
+
"health": { "enum": ["applying", "ready", "degraded", "error"] },
|
|
56
|
+
"lastError": { "type": "string", "minLength": 1 }
|
|
83
57
|
},
|
|
84
58
|
"additionalProperties": false
|
|
85
59
|
},
|
|
@@ -107,10 +81,9 @@
|
|
|
107
81
|
},
|
|
108
82
|
"managementSnapshot": {
|
|
109
83
|
"type": "object",
|
|
110
|
-
"required": ["providers", "
|
|
84
|
+
"required": ["providers", "devices", "onlineStates", "watchStates"],
|
|
111
85
|
"properties": {
|
|
112
86
|
"providers": { "type": "array", "items": { "$ref": "#/$defs/providerCatalogItem" } },
|
|
113
|
-
"profiles": { "type": "array", "items": { "$ref": "#/$defs/providerProfile" } },
|
|
114
87
|
"devices": { "type": "array", "items": { "$ref": "#/$defs/cameraDevice" } },
|
|
115
88
|
"onlineStates": { "type": "array", "items": { "$ref": "#/$defs/onlineStateObservation" } },
|
|
116
89
|
"watchStates": { "type": "array", "items": { "$ref": "#/$defs/watchControlResponse" } }
|
|
@@ -126,11 +99,10 @@
|
|
|
126
99
|
},
|
|
127
100
|
"additionalProperties": false
|
|
128
101
|
},
|
|
129
|
-
"
|
|
102
|
+
"deviceMutationResponse": {
|
|
130
103
|
"type": "object",
|
|
131
|
-
"required": ["
|
|
104
|
+
"required": ["deviceIds", "changed"],
|
|
132
105
|
"properties": {
|
|
133
|
-
"profileId": { "type": "string", "minLength": 1 },
|
|
134
106
|
"deviceIds": {
|
|
135
107
|
"type": "array",
|
|
136
108
|
"items": { "type": "string", "minLength": 1 },
|