@mhome/core-protocol 1.2.1 → 1.3.1

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,6 +5,11 @@
5
5
  "requestFields": ["version", "payload"],
6
6
  "responseFields": ["version", "data"]
7
7
  },
8
+ "status": {
9
+ "contract": "mhome.node.status.v1",
10
+ "queryTarget": "/status",
11
+ "changedTarget": "/status/changed"
12
+ },
8
13
  "settings": {
9
14
  "changedTarget": "/node/settings/changed",
10
15
  "routes": ["settings/status", "settings/update", "settings/revert", "settings/retry"]
@@ -12,6 +17,7 @@
12
17
  "llm": {
13
18
  "runtimeTargetPrefix": "/llm/app/",
14
19
  "completeTarget": "/llm/complete",
20
+ "ttsSynthesizeTarget": "/llm/tts",
15
21
  "modelImportUploadPathPrefix": "/llm/model/import/upload"
16
22
  },
17
23
  "audioBridge": {
@@ -0,0 +1,27 @@
1
+ {
2
+ "valid": [
3
+ { "name": "empty request", "value": {} },
4
+ { "name": "provider request", "value": { "profileId": "provider-1" } },
5
+ { "name": "watch status request", "value": { "deviceId": "camera-1" } },
6
+ { "name": "watch set request", "value": { "deviceId": "camera-1", "enabled": true } },
7
+ {
8
+ "name": "management snapshot",
9
+ "value": {
10
+ "providers": [{ "id": "onvif", "displayName": "ONVIF", "description": "ONVIF cameras", "supportsMultipleCameras": true }],
11
+ "profiles": [{ "id": "provider-1", "providerType": "onvif", "displayName": "Home", "health": "ready", "cameraCount": 1, "createdAt": "2026-01-01T00:00:00Z", "updatedAt": "2026-01-01T00:00:00Z" }],
12
+ "devices": [{ "id": "camera-1", "providerProfileId": "provider-1", "providerNativeId": "front-door", "name": "Front Door", "capabilities": ["state.cameraMotion"] }],
13
+ "onlineStates": [{ "id": "camera-1", "state": "online", "observedAt": 1767225600, "source": "onvif" }],
14
+ "watchStates": [{ "ok": true, "deviceId": "camera-1", "enabled": false }]
15
+ }
16
+ },
17
+ { "name": "device list", "value": { "devices": [], "onlineStates": [] } },
18
+ { "name": "provider mutation", "value": { "profileId": "provider-1", "deviceIds": ["camera-1"], "changed": true } },
19
+ { "name": "watch response", "value": { "ok": true, "deviceId": "camera-1", "enabled": true } },
20
+ { "name": "operation error", "value": { "ok": false, "reason": "CAMERA_OPERATION_FAILED", "detail": "failed" } }
21
+ ],
22
+ "invalid": [
23
+ { "name": "watch mutation missing enabled", "value": { "deviceId": "camera-1", "unexpected": true } },
24
+ { "name": "unknown health", "value": { "providers": [], "profiles": [{ "id": "provider-1", "providerType": "onvif", "displayName": "Home", "health": "unknown", "cameraCount": 0, "createdAt": "now", "updatedAt": "now" }], "devices": [], "onlineStates": [], "watchStates": [] } },
25
+ { "name": "device leaks internal field", "value": { "devices": [{ "id": "camera-1", "providerProfileId": "provider-1", "providerNativeId": "front-door", "name": "Front Door", "capabilities": [], "supportsLocalAnalytics": true }], "onlineStates": [] } }
26
+ ]
27
+ }
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "manifest": "mhome.core.v1",
3
- "contractVersion": "1.2.1",
3
+ "contractVersion": "1.3.1",
4
4
  "protocols": {
5
5
  "llm": {
6
6
  "completeTarget": "/llm/complete"
@@ -14,6 +14,25 @@
14
14
  "interactionFlowExecuteTarget": "/{nodeType}/interaction-flow/execute",
15
15
  "interactionFlowCloseTarget": "/{nodeType}/interaction-flow/close"
16
16
  },
17
+ "cameraPlugin": {
18
+ "version": "v1",
19
+ "nodeType": "camera",
20
+ "appTargetPrefix": "/app/plugin/camera/",
21
+ "runtimeTargetPrefix": "/camera/app/",
22
+ "managementSchema": "schema/camera-plugin-management.v1.schema.json",
23
+ "routes": {
24
+ "deviceList": "device/list",
25
+ "managementSnapshot": "management/snapshot",
26
+ "providerRefresh": "provider/refresh",
27
+ "providerRemove": "provider/remove",
28
+ "watchStatus": "watch/status",
29
+ "watchSet": "watch/set"
30
+ },
31
+ "flows": {
32
+ "providerAdd": "provider.add",
33
+ "providerEdit": "provider.edit"
34
+ }
35
+ },
17
36
  "messaging": {
18
37
  "normalizedInboundSchema": "schema/normalized-inbound.v4.schema.json",
19
38
  "commandsSchema": "schema/messaging-commands.v1.schema.json"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mhome/core-protocol",
3
- "version": "1.2.1",
3
+ "version": "1.3.1",
4
4
  "description": "Build-time protocol artifacts for mhome.core",
5
5
  "license": "MIT",
6
6
  "repository": {
package/protocol.json CHANGED
@@ -1,15 +1,17 @@
1
1
  {
2
2
  "protocol": "mhome.core",
3
- "contractVersion": "1.2.1",
3
+ "contractVersion": "1.3.1",
4
4
  "manifest": "manifest/core.v1.json",
5
5
  "schemas": {
6
6
  "normalizedInbound": "schema/normalized-inbound.v4.schema.json",
7
7
  "messagingCommands": "schema/messaging-commands.v1.schema.json",
8
- "interactionFlowNode": "schema/interaction-flow-node.v1.schema.json"
8
+ "interactionFlowNode": "schema/interaction-flow-node.v1.schema.json",
9
+ "cameraPluginManagement": "schema/camera-plugin-management.v1.schema.json"
9
10
  },
10
11
  "fixtures": {
11
12
  "normalizedInbound": "fixtures/normalized-inbound.conformance.json",
12
13
  "messagingCommands": "fixtures/messaging-commands.conformance.json",
13
- "interactionFlowNode": "fixtures/interaction-flow-node.conformance.json"
14
+ "interactionFlowNode": "fixtures/interaction-flow-node.conformance.json",
15
+ "cameraPluginManagement": "fixtures/camera-plugin-management.conformance.json"
14
16
  }
15
17
  }
@@ -0,0 +1,154 @@
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
+ { "$ref": "#/$defs/emptyRequest" },
7
+ { "$ref": "#/$defs/providerProfileIdRequest" },
8
+ { "$ref": "#/$defs/watchStatusRequest" },
9
+ { "$ref": "#/$defs/watchSetRequest" },
10
+ { "$ref": "#/$defs/managementSnapshot" },
11
+ { "$ref": "#/$defs/deviceListResponse" },
12
+ { "$ref": "#/$defs/providerMutationResponse" },
13
+ { "$ref": "#/$defs/watchControlResponse" },
14
+ { "$ref": "#/$defs/errorResponse" }
15
+ ],
16
+ "$defs": {
17
+ "emptyRequest": {
18
+ "type": "object",
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": {
28
+ "type": "object",
29
+ "required": ["deviceId"],
30
+ "properties": { "deviceId": { "type": "string", "minLength": 1 } },
31
+ "additionalProperties": false
32
+ },
33
+ "watchSetRequest": {
34
+ "type": "object",
35
+ "required": ["deviceId", "enabled"],
36
+ "properties": {
37
+ "deviceId": { "type": "string", "minLength": 1 },
38
+ "enabled": { "type": "boolean" }
39
+ },
40
+ "additionalProperties": false
41
+ },
42
+ "providerCatalogItem": {
43
+ "type": "object",
44
+ "required": ["id", "displayName", "description", "supportsMultipleCameras"],
45
+ "properties": {
46
+ "id": { "type": "string", "minLength": 1 },
47
+ "displayName": { "type": "string", "minLength": 1 },
48
+ "description": { "type": "string" },
49
+ "supportsMultipleCameras": { "type": "boolean" }
50
+ },
51
+ "additionalProperties": false
52
+ },
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
+ "cameraDevice": {
70
+ "type": "object",
71
+ "required": ["id", "providerProfileId", "providerNativeId", "name", "capabilities"],
72
+ "properties": {
73
+ "id": { "type": "string", "minLength": 1 },
74
+ "providerProfileId": { "type": "string", "minLength": 1 },
75
+ "providerNativeId": { "type": "string", "minLength": 1 },
76
+ "name": { "type": "string", "minLength": 1 },
77
+ "manufacturerName": { "type": "string", "minLength": 1 },
78
+ "capabilities": {
79
+ "type": "array",
80
+ "items": { "type": "string", "minLength": 1 },
81
+ "uniqueItems": true
82
+ }
83
+ },
84
+ "additionalProperties": false
85
+ },
86
+ "onlineStateObservation": {
87
+ "type": "object",
88
+ "required": ["id", "state"],
89
+ "properties": {
90
+ "id": { "type": "string", "minLength": 1 },
91
+ "state": { "enum": ["online", "offline"] },
92
+ "observedAt": { "type": "integer" },
93
+ "source": { "type": "string", "minLength": 1 },
94
+ "reason": { "type": "string", "minLength": 1 }
95
+ },
96
+ "additionalProperties": false
97
+ },
98
+ "watchControlResponse": {
99
+ "type": "object",
100
+ "required": ["ok", "deviceId", "enabled"],
101
+ "properties": {
102
+ "ok": { "type": "boolean" },
103
+ "deviceId": { "type": "string", "minLength": 1 },
104
+ "enabled": { "type": "boolean" }
105
+ },
106
+ "additionalProperties": false
107
+ },
108
+ "managementSnapshot": {
109
+ "type": "object",
110
+ "required": ["providers", "profiles", "devices", "onlineStates", "watchStates"],
111
+ "properties": {
112
+ "providers": { "type": "array", "items": { "$ref": "#/$defs/providerCatalogItem" } },
113
+ "profiles": { "type": "array", "items": { "$ref": "#/$defs/providerProfile" } },
114
+ "devices": { "type": "array", "items": { "$ref": "#/$defs/cameraDevice" } },
115
+ "onlineStates": { "type": "array", "items": { "$ref": "#/$defs/onlineStateObservation" } },
116
+ "watchStates": { "type": "array", "items": { "$ref": "#/$defs/watchControlResponse" } }
117
+ },
118
+ "additionalProperties": false
119
+ },
120
+ "deviceListResponse": {
121
+ "type": "object",
122
+ "required": ["devices", "onlineStates"],
123
+ "properties": {
124
+ "devices": { "type": "array", "items": { "$ref": "#/$defs/cameraDevice" } },
125
+ "onlineStates": { "type": "array", "items": { "$ref": "#/$defs/onlineStateObservation" } }
126
+ },
127
+ "additionalProperties": false
128
+ },
129
+ "providerMutationResponse": {
130
+ "type": "object",
131
+ "required": ["profileId", "deviceIds", "changed"],
132
+ "properties": {
133
+ "profileId": { "type": "string", "minLength": 1 },
134
+ "deviceIds": {
135
+ "type": "array",
136
+ "items": { "type": "string", "minLength": 1 },
137
+ "uniqueItems": true
138
+ },
139
+ "changed": { "type": "boolean" }
140
+ },
141
+ "additionalProperties": false
142
+ },
143
+ "errorResponse": {
144
+ "type": "object",
145
+ "required": ["ok", "reason", "detail"],
146
+ "properties": {
147
+ "ok": { "const": false },
148
+ "reason": { "type": "string", "minLength": 1 },
149
+ "detail": { "type": "string", "minLength": 1 }
150
+ },
151
+ "additionalProperties": false
152
+ }
153
+ }
154
+ }