@mhome/app-facade-protocol 1.4.0 → 1.5.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 +6 -0
- package/manifest/app-facade.v1.json +7 -1
- package/manifest/routing.v1.json +5 -3
- package/manifest/targets.v1.json +1 -1
- package/package.json +1 -1
- package/protocol.json +3 -2
- package/schema/topology.v1.schema.json +182 -0
package/README.md
CHANGED
|
@@ -28,6 +28,12 @@ its complete referenced value is available and which visible inputs can make
|
|
|
28
28
|
it stale, so clients can resolve it reactively without learning handlers or
|
|
29
29
|
the hidden graph.
|
|
30
30
|
|
|
31
|
+
`topology` exposes the Hub-owned Space network projection. Stable Host, Hub,
|
|
32
|
+
Node, AppClient, and Cloud identities are separate from current transport
|
|
33
|
+
sessions. Durable relations remain present while disconnected and carry an
|
|
34
|
+
explicit observation state so clients can distinguish expected topology from
|
|
35
|
+
the currently observed path.
|
|
36
|
+
|
|
31
37
|
## Routing contract
|
|
32
38
|
|
|
33
39
|
`manifest/routing.v1.json` is the canonical client-side routing policy for the
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"manifest": "mhome.app-facade.v1",
|
|
3
|
-
"contractVersion": "1.
|
|
3
|
+
"contractVersion": "1.5.0",
|
|
4
4
|
"callSchema": "schema/facade-call.v1.schema.json",
|
|
5
5
|
"routing": "manifest/routing.v1.json",
|
|
6
6
|
"routingSchema": "schema/routing.v1.schema.json",
|
|
@@ -36,6 +36,12 @@
|
|
|
36
36
|
"requestTargets": ["/app/runtime/status/list"],
|
|
37
37
|
"eventTargets": ["/app/runtime/status/changed"]
|
|
38
38
|
},
|
|
39
|
+
"topology": {
|
|
40
|
+
"contract": "mhome.space.topology.v1",
|
|
41
|
+
"schema": "schema/topology.v1.schema.json",
|
|
42
|
+
"requestTargets": ["/app/topology/get"],
|
|
43
|
+
"eventTargets": ["/app/topology/changed"]
|
|
44
|
+
},
|
|
39
45
|
"interactionFlow": {
|
|
40
46
|
"schema": "schema/interaction-flow-app.v1.schema.json",
|
|
41
47
|
"requestTargets": [
|
package/manifest/routing.v1.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"manifest": "mhome.app-facade.routing.v1",
|
|
3
|
-
"contractVersion": "1.
|
|
3
|
+
"contractVersion": "1.5.0",
|
|
4
4
|
"targetPrefix": "/app/",
|
|
5
5
|
"default": {
|
|
6
6
|
"execution": "scopeMode",
|
|
@@ -29,7 +29,8 @@
|
|
|
29
29
|
"/app/plugin/",
|
|
30
30
|
"/app/interaction-flow/",
|
|
31
31
|
"/app/object-storage/",
|
|
32
|
-
"/app/runtime/"
|
|
32
|
+
"/app/runtime/",
|
|
33
|
+
"/app/topology/"
|
|
33
34
|
],
|
|
34
35
|
"requestPlacementPrefixes": [
|
|
35
36
|
"/app/messaging/"
|
|
@@ -43,7 +44,8 @@
|
|
|
43
44
|
"/app/object-storage/folders/get",
|
|
44
45
|
"/app/object-storage/folders/update",
|
|
45
46
|
"/app/object-storage/folders/list",
|
|
46
|
-
"/app/object-storage/settings/update"
|
|
47
|
+
"/app/object-storage/settings/update",
|
|
48
|
+
"/app/topology/get"
|
|
47
49
|
]
|
|
48
50
|
}
|
|
49
51
|
}
|
package/manifest/targets.v1.json
CHANGED
package/package.json
CHANGED
package/protocol.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"protocol": "mhome.app-facade",
|
|
3
|
-
"contractVersion": "1.
|
|
3
|
+
"contractVersion": "1.5.0",
|
|
4
4
|
"manifest": "manifest/app-facade.v1.json",
|
|
5
5
|
"schemas": {
|
|
6
6
|
"call": "schema/facade-call.v1.schema.json",
|
|
@@ -8,7 +8,8 @@
|
|
|
8
8
|
"interactionFlow": "schema/interaction-flow-app.v1.schema.json",
|
|
9
9
|
"routing": "schema/routing.v1.schema.json",
|
|
10
10
|
"hubState": "schema/hub-state.v1.schema.json",
|
|
11
|
-
"localHubState": "schema/local-hub-state.v1.schema.json"
|
|
11
|
+
"localHubState": "schema/local-hub-state.v1.schema.json",
|
|
12
|
+
"topology": "schema/topology.v1.schema.json"
|
|
12
13
|
},
|
|
13
14
|
"fixtures": {
|
|
14
15
|
"valid": "fixtures",
|
|
@@ -0,0 +1,182 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "https://mhome.ai/schema/space-topology.v1.schema.json",
|
|
4
|
+
"title": "mHome Space Topology",
|
|
5
|
+
"type": "object",
|
|
6
|
+
"additionalProperties": false,
|
|
7
|
+
"required": [
|
|
8
|
+
"contract",
|
|
9
|
+
"scopeId",
|
|
10
|
+
"generation",
|
|
11
|
+
"revision",
|
|
12
|
+
"observedAtMs",
|
|
13
|
+
"entities",
|
|
14
|
+
"edges"
|
|
15
|
+
],
|
|
16
|
+
"properties": {
|
|
17
|
+
"contract": { "const": "mhome.space.topology.v1" },
|
|
18
|
+
"scopeId": { "type": "string", "minLength": 1 },
|
|
19
|
+
"generation": { "type": "string", "minLength": 1 },
|
|
20
|
+
"revision": { "type": "integer", "minimum": 0 },
|
|
21
|
+
"observedAtMs": { "type": "integer", "minimum": 0 },
|
|
22
|
+
"entities": {
|
|
23
|
+
"type": "array",
|
|
24
|
+
"items": { "$ref": "#/$defs/entity" }
|
|
25
|
+
},
|
|
26
|
+
"edges": {
|
|
27
|
+
"type": "array",
|
|
28
|
+
"items": { "$ref": "#/$defs/edge" }
|
|
29
|
+
}
|
|
30
|
+
},
|
|
31
|
+
"$defs": {
|
|
32
|
+
"baseEntity": {
|
|
33
|
+
"type": "object",
|
|
34
|
+
"required": ["id", "kind", "displayName"],
|
|
35
|
+
"properties": {
|
|
36
|
+
"id": { "type": "string", "minLength": 1 },
|
|
37
|
+
"kind": { "type": "string" },
|
|
38
|
+
"displayName": { "type": "string", "minLength": 1 }
|
|
39
|
+
}
|
|
40
|
+
},
|
|
41
|
+
"entity": {
|
|
42
|
+
"oneOf": [
|
|
43
|
+
{
|
|
44
|
+
"allOf": [
|
|
45
|
+
{ "$ref": "#/$defs/baseEntity" },
|
|
46
|
+
{
|
|
47
|
+
"type": "object",
|
|
48
|
+
"additionalProperties": false,
|
|
49
|
+
"required": ["id", "kind", "hostId", "displayName"],
|
|
50
|
+
"properties": {
|
|
51
|
+
"id": { "type": "string" },
|
|
52
|
+
"kind": { "const": "host" },
|
|
53
|
+
"hostId": { "type": "string", "minLength": 1 },
|
|
54
|
+
"displayName": { "type": "string", "minLength": 1 }
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
]
|
|
58
|
+
},
|
|
59
|
+
{
|
|
60
|
+
"type": "object",
|
|
61
|
+
"additionalProperties": false,
|
|
62
|
+
"required": ["id", "kind", "hubId", "hostId", "displayName"],
|
|
63
|
+
"properties": {
|
|
64
|
+
"id": { "type": "string", "minLength": 1 },
|
|
65
|
+
"kind": { "const": "hub" },
|
|
66
|
+
"hubId": { "type": "string", "minLength": 1 },
|
|
67
|
+
"hostId": { "type": "string", "minLength": 1 },
|
|
68
|
+
"displayName": { "type": "string", "minLength": 1 }
|
|
69
|
+
}
|
|
70
|
+
},
|
|
71
|
+
{
|
|
72
|
+
"type": "object",
|
|
73
|
+
"additionalProperties": false,
|
|
74
|
+
"required": [
|
|
75
|
+
"id",
|
|
76
|
+
"kind",
|
|
77
|
+
"nodeId",
|
|
78
|
+
"nodeType",
|
|
79
|
+
"hostId",
|
|
80
|
+
"displayName",
|
|
81
|
+
"bindingState",
|
|
82
|
+
"runtime"
|
|
83
|
+
],
|
|
84
|
+
"properties": {
|
|
85
|
+
"id": { "type": "string", "minLength": 1 },
|
|
86
|
+
"kind": { "const": "node" },
|
|
87
|
+
"nodeId": { "type": "string", "minLength": 1 },
|
|
88
|
+
"nodeType": { "type": "string", "minLength": 1 },
|
|
89
|
+
"hostId": { "type": "string", "minLength": 1 },
|
|
90
|
+
"displayName": { "type": "string", "minLength": 1 },
|
|
91
|
+
"bindingState": { "type": "string", "minLength": 1 },
|
|
92
|
+
"runtime": { "$ref": "#/$defs/runtime" }
|
|
93
|
+
}
|
|
94
|
+
},
|
|
95
|
+
{
|
|
96
|
+
"type": "object",
|
|
97
|
+
"additionalProperties": false,
|
|
98
|
+
"required": [
|
|
99
|
+
"id",
|
|
100
|
+
"kind",
|
|
101
|
+
"appClientId",
|
|
102
|
+
"source",
|
|
103
|
+
"deviceType",
|
|
104
|
+
"displayName",
|
|
105
|
+
"isCurrent",
|
|
106
|
+
"hasLocalCredential"
|
|
107
|
+
],
|
|
108
|
+
"properties": {
|
|
109
|
+
"id": { "type": "string", "minLength": 1 },
|
|
110
|
+
"kind": { "const": "client" },
|
|
111
|
+
"appClientId": { "type": "string", "minLength": 1 },
|
|
112
|
+
"curClientId": { "type": "string", "minLength": 1 },
|
|
113
|
+
"source": { "type": "string" },
|
|
114
|
+
"deviceType": { "type": "string" },
|
|
115
|
+
"displayName": { "type": "string", "minLength": 1 },
|
|
116
|
+
"isCurrent": { "type": "boolean" },
|
|
117
|
+
"routeKind": {
|
|
118
|
+
"enum": ["localDirect", "cloudBridgeShadow"]
|
|
119
|
+
},
|
|
120
|
+
"hasLocalCredential": { "type": "boolean" }
|
|
121
|
+
}
|
|
122
|
+
},
|
|
123
|
+
{
|
|
124
|
+
"type": "object",
|
|
125
|
+
"additionalProperties": false,
|
|
126
|
+
"required": ["id", "kind", "displayName"],
|
|
127
|
+
"properties": {
|
|
128
|
+
"id": { "const": "cloud:primary" },
|
|
129
|
+
"kind": { "const": "cloud" },
|
|
130
|
+
"displayName": { "type": "string", "minLength": 1 }
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
]
|
|
134
|
+
},
|
|
135
|
+
"runtime": {
|
|
136
|
+
"type": "object",
|
|
137
|
+
"additionalProperties": false,
|
|
138
|
+
"required": ["state"],
|
|
139
|
+
"properties": {
|
|
140
|
+
"state": { "enum": ["healthy", "degraded", "offline", "unknown"] },
|
|
141
|
+
"reason": { "type": "string" },
|
|
142
|
+
"updatedAtMs": { "type": "integer", "minimum": 0 }
|
|
143
|
+
}
|
|
144
|
+
},
|
|
145
|
+
"edge": {
|
|
146
|
+
"type": "object",
|
|
147
|
+
"additionalProperties": false,
|
|
148
|
+
"required": [
|
|
149
|
+
"id",
|
|
150
|
+
"source",
|
|
151
|
+
"target",
|
|
152
|
+
"relation",
|
|
153
|
+
"basis",
|
|
154
|
+
"durability",
|
|
155
|
+
"observation"
|
|
156
|
+
],
|
|
157
|
+
"properties": {
|
|
158
|
+
"id": { "type": "string", "minLength": 1 },
|
|
159
|
+
"source": { "type": "string", "minLength": 1 },
|
|
160
|
+
"target": { "type": "string", "minLength": 1 },
|
|
161
|
+
"relation": {
|
|
162
|
+
"enum": ["hub-cloud", "node-hub", "client-hub", "client-cloud"]
|
|
163
|
+
},
|
|
164
|
+
"basis": {
|
|
165
|
+
"enum": ["hubCommission", "nodeBinding", "localCredential", "liveRoute"]
|
|
166
|
+
},
|
|
167
|
+
"durability": { "enum": ["durable", "ephemeral"] },
|
|
168
|
+
"observation": { "$ref": "#/$defs/observation" }
|
|
169
|
+
}
|
|
170
|
+
},
|
|
171
|
+
"observation": {
|
|
172
|
+
"type": "object",
|
|
173
|
+
"additionalProperties": false,
|
|
174
|
+
"required": ["state", "observedAtMs"],
|
|
175
|
+
"properties": {
|
|
176
|
+
"state": { "enum": ["connected", "disconnected", "unknown"] },
|
|
177
|
+
"observedAtMs": { "type": "integer", "minimum": 0 },
|
|
178
|
+
"reason": { "type": "string" }
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
}
|
|
182
|
+
}
|