@mhome/app-facade-protocol 1.3.0 → 1.4.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 +7 -0
- package/fixtures/hub-state.configured.json +17 -0
- package/fixtures/hub-state.revoked.json +15 -0
- package/fixtures/local-hub-state.configured.json +22 -0
- package/manifest/app-facade.v1.json +6 -1
- package/manifest/hub-targets.v1.json +20 -0
- package/manifest/routing.v1.json +4 -1
- package/manifest/targets.v1.json +1 -1
- package/package.json +1 -1
- package/protocol.json +4 -2
- package/schema/hub-state.v1.schema.json +89 -0
- package/schema/local-hub-state.v1.schema.json +65 -0
package/README.md
CHANGED
|
@@ -3,6 +3,13 @@
|
|
|
3
3
|
Canonical public protocol shared by MeowLink clients, MeowCore, the CLI,
|
|
4
4
|
Agents, and cloud adapters.
|
|
5
5
|
|
|
6
|
+
The package also carries the explicitly private `/local/*` native-daemon
|
|
7
|
+
extension. `/app/*` is portable and may be routed according to the public
|
|
8
|
+
routing manifest. `/local/*` is an exact allowlist for the current MeowLink
|
|
9
|
+
native client process and must never be forwarded to cloud, Hub, or Host
|
|
10
|
+
connections. Hub `/app/*` calls are direct-only `FacadeCall`s; Hub `/local/*`
|
|
11
|
+
calls carry the domain input directly and never use the public envelope.
|
|
12
|
+
|
|
6
13
|
Every `/app/*` request uses the strict `FacadeCall` envelope. Invocation
|
|
7
14
|
metadata lives in `control`; the domain request lives in `input`. The crate
|
|
8
15
|
owns public targets, request/response/event schemas, and stable operation
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
{
|
|
2
|
+
"scopeId": "scope-1",
|
|
3
|
+
"configured": true,
|
|
4
|
+
"hub": {
|
|
5
|
+
"id": "hub-1",
|
|
6
|
+
"name": "Home Hub",
|
|
7
|
+
"type": "local",
|
|
8
|
+
"hostId": "host-1",
|
|
9
|
+
"isTest": false,
|
|
10
|
+
"status": "ready",
|
|
11
|
+
"cloud": {
|
|
12
|
+
"connectionStatus": "connected",
|
|
13
|
+
"lastConnectedAt": 1700000000000,
|
|
14
|
+
"firmwareVersion": "1.0.0"
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
{
|
|
2
|
+
"scopeId": "scope-1",
|
|
3
|
+
"configured": false,
|
|
4
|
+
"operation": {
|
|
5
|
+
"kind": "REMOVE",
|
|
6
|
+
"state": "RUNNING",
|
|
7
|
+
"phase": "CLEARING_LOCAL_DATA",
|
|
8
|
+
"startedAt": 1700000000000,
|
|
9
|
+
"hubId": "hub-old"
|
|
10
|
+
},
|
|
11
|
+
"revocation": {
|
|
12
|
+
"hubId": "hub-old",
|
|
13
|
+
"revocationId": "revoke-1"
|
|
14
|
+
}
|
|
15
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
{
|
|
2
|
+
"scopeId": "scope-1",
|
|
3
|
+
"configured": true,
|
|
4
|
+
"hub": {
|
|
5
|
+
"id": "hub-1",
|
|
6
|
+
"name": "Home Hub",
|
|
7
|
+
"type": "local",
|
|
8
|
+
"hostId": "host-1",
|
|
9
|
+
"isTest": false,
|
|
10
|
+
"status": "ready",
|
|
11
|
+
"cloud": {
|
|
12
|
+
"connectionStatus": "connected"
|
|
13
|
+
},
|
|
14
|
+
"local": {
|
|
15
|
+
"discovered": true,
|
|
16
|
+
"connected": true,
|
|
17
|
+
"connectionStatus": "connected",
|
|
18
|
+
"hostName": "Living Room Mac",
|
|
19
|
+
"version": "1.0.0"
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
}
|
|
@@ -1,10 +1,15 @@
|
|
|
1
1
|
{
|
|
2
2
|
"manifest": "mhome.app-facade.v1",
|
|
3
|
-
"contractVersion": "1.
|
|
3
|
+
"contractVersion": "1.4.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",
|
|
7
7
|
"domains": {
|
|
8
|
+
"hub": {
|
|
9
|
+
"targets": "manifest/hub-targets.v1.json",
|
|
10
|
+
"cloudStateTarget": "/app/hub/get",
|
|
11
|
+
"nativeCompositeTarget": "/local/hub/get"
|
|
12
|
+
},
|
|
8
13
|
"messaging": {
|
|
9
14
|
"targets": "manifest/targets.v1.json"
|
|
10
15
|
},
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
{
|
|
2
|
+
"manifest": "mhome.hub.targets.v1",
|
|
3
|
+
"contractVersion": "1.0.0",
|
|
4
|
+
"appTargets": [
|
|
5
|
+
"/app/hub/get",
|
|
6
|
+
"/app/hub/remove",
|
|
7
|
+
"/app/hub/cache/clear"
|
|
8
|
+
],
|
|
9
|
+
"localTargets": [
|
|
10
|
+
"/local/hub/get",
|
|
11
|
+
"/local/hub/candidates",
|
|
12
|
+
"/local/hub/add/start",
|
|
13
|
+
"/local/hub/add/confirm",
|
|
14
|
+
"/local/hub/add/status",
|
|
15
|
+
"/local/hub/add/cancel"
|
|
16
|
+
],
|
|
17
|
+
"appInvocationModes": ["direct"],
|
|
18
|
+
"localPayload": "domainInput",
|
|
19
|
+
"localForwardable": false
|
|
20
|
+
}
|
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.4.0",
|
|
4
4
|
"targetPrefix": "/app/",
|
|
5
5
|
"default": {
|
|
6
6
|
"execution": "scopeMode",
|
|
@@ -16,6 +16,9 @@
|
|
|
16
16
|
"cloudTargets": [
|
|
17
17
|
"/app/agent/context/get",
|
|
18
18
|
"/app/credit/record",
|
|
19
|
+
"/app/hub/cache/clear",
|
|
20
|
+
"/app/hub/get",
|
|
21
|
+
"/app/hub/remove",
|
|
19
22
|
"/app/system/feedback/submit",
|
|
20
23
|
"/app/timeline/entity/latest/list"
|
|
21
24
|
],
|
package/manifest/targets.v1.json
CHANGED
package/package.json
CHANGED
package/protocol.json
CHANGED
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"protocol": "mhome.app-facade",
|
|
3
|
-
"contractVersion": "1.
|
|
3
|
+
"contractVersion": "1.4.0",
|
|
4
4
|
"manifest": "manifest/app-facade.v1.json",
|
|
5
5
|
"schemas": {
|
|
6
6
|
"call": "schema/facade-call.v1.schema.json",
|
|
7
7
|
"frame": "schema/messaging-frame.v3.schema.json",
|
|
8
8
|
"interactionFlow": "schema/interaction-flow-app.v1.schema.json",
|
|
9
|
-
"routing": "schema/routing.v1.schema.json"
|
|
9
|
+
"routing": "schema/routing.v1.schema.json",
|
|
10
|
+
"hubState": "schema/hub-state.v1.schema.json",
|
|
11
|
+
"localHubState": "schema/local-hub-state.v1.schema.json"
|
|
10
12
|
},
|
|
11
13
|
"fixtures": {
|
|
12
14
|
"valid": "fixtures",
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "https://schemas.mhome.ai/app-facade/hub-state.v1.schema.json",
|
|
4
|
+
"title": "Authoritative cloud Hub lifecycle state",
|
|
5
|
+
"type": "object",
|
|
6
|
+
"additionalProperties": false,
|
|
7
|
+
"required": ["scopeId", "configured"],
|
|
8
|
+
"properties": {
|
|
9
|
+
"scopeId": { "type": "string", "minLength": 1 },
|
|
10
|
+
"configured": { "type": "boolean" },
|
|
11
|
+
"hub": { "$ref": "#/$defs/hub" },
|
|
12
|
+
"operation": { "$ref": "#/$defs/operation" },
|
|
13
|
+
"revocation": { "$ref": "#/$defs/revocation" }
|
|
14
|
+
},
|
|
15
|
+
"allOf": [
|
|
16
|
+
{
|
|
17
|
+
"if": { "properties": { "configured": { "const": true } }, "required": ["configured"] },
|
|
18
|
+
"then": { "required": ["hub"] },
|
|
19
|
+
"else": { "not": { "required": ["hub"] } }
|
|
20
|
+
}
|
|
21
|
+
],
|
|
22
|
+
"$defs": {
|
|
23
|
+
"hub": {
|
|
24
|
+
"type": "object",
|
|
25
|
+
"additionalProperties": false,
|
|
26
|
+
"required": ["id", "type", "hostId", "isTest", "status", "cloud"],
|
|
27
|
+
"properties": {
|
|
28
|
+
"id": { "type": "string", "minLength": 1 },
|
|
29
|
+
"name": { "type": "string" },
|
|
30
|
+
"type": { "type": "string", "minLength": 1 },
|
|
31
|
+
"hostId": { "type": "string", "minLength": 1 },
|
|
32
|
+
"isTest": { "type": "boolean" },
|
|
33
|
+
"status": { "type": "string", "minLength": 1 },
|
|
34
|
+
"cloud": {
|
|
35
|
+
"type": "object",
|
|
36
|
+
"additionalProperties": false,
|
|
37
|
+
"properties": {
|
|
38
|
+
"connectionStatus": { "type": "string" },
|
|
39
|
+
"lastConnectedAt": { "type": "integer" },
|
|
40
|
+
"firmwareVersion": { "type": "string" }
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
},
|
|
45
|
+
"operation": {
|
|
46
|
+
"type": "object",
|
|
47
|
+
"additionalProperties": false,
|
|
48
|
+
"required": ["kind", "state", "phase", "startedAt"],
|
|
49
|
+
"properties": {
|
|
50
|
+
"kind": { "enum": ["SETUP", "REMOVE"] },
|
|
51
|
+
"state": { "enum": ["RUNNING", "FAILED"] },
|
|
52
|
+
"phase": {
|
|
53
|
+
"enum": [
|
|
54
|
+
"WAITING_FOR_HUB",
|
|
55
|
+
"PREPARING_DATA",
|
|
56
|
+
"SYNCING_DATA",
|
|
57
|
+
"BACKING_UP_DATA",
|
|
58
|
+
"FENCING_CLOUD",
|
|
59
|
+
"CLEARING_LOCAL_DATA",
|
|
60
|
+
"FINALIZING",
|
|
61
|
+
"CLEANING_UP"
|
|
62
|
+
]
|
|
63
|
+
},
|
|
64
|
+
"startedAt": { "type": "integer" },
|
|
65
|
+
"expiresAt": { "type": "integer" },
|
|
66
|
+
"hostId": { "type": "string" },
|
|
67
|
+
"hubId": { "type": "string" },
|
|
68
|
+
"failure": {
|
|
69
|
+
"type": "object",
|
|
70
|
+
"additionalProperties": false,
|
|
71
|
+
"required": ["reason"],
|
|
72
|
+
"properties": {
|
|
73
|
+
"reason": { "type": "string", "minLength": 1 },
|
|
74
|
+
"at": { "type": "integer" }
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
},
|
|
79
|
+
"revocation": {
|
|
80
|
+
"type": "object",
|
|
81
|
+
"additionalProperties": false,
|
|
82
|
+
"required": ["hubId", "revocationId"],
|
|
83
|
+
"properties": {
|
|
84
|
+
"hubId": { "type": "string", "minLength": 1 },
|
|
85
|
+
"revocationId": { "type": "string", "minLength": 1 }
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "https://schemas.mhome.ai/app-facade/local-hub-state.v1.schema.json",
|
|
4
|
+
"title": "Native-client composite Hub state",
|
|
5
|
+
"type": "object",
|
|
6
|
+
"additionalProperties": false,
|
|
7
|
+
"required": ["scopeId", "configured"],
|
|
8
|
+
"properties": {
|
|
9
|
+
"scopeId": { "type": "string", "minLength": 1 },
|
|
10
|
+
"configured": { "type": "boolean" },
|
|
11
|
+
"hub": { "$ref": "#/$defs/localHub" },
|
|
12
|
+
"operation": { "$ref": "hub-state.v1.schema.json#/$defs/operation" },
|
|
13
|
+
"revocation": { "$ref": "hub-state.v1.schema.json#/$defs/revocation" },
|
|
14
|
+
"pairing": {
|
|
15
|
+
"type": "object",
|
|
16
|
+
"additionalProperties": false,
|
|
17
|
+
"required": ["sessionId", "state", "phase", "startedAt", "expiresAt"],
|
|
18
|
+
"properties": {
|
|
19
|
+
"sessionId": { "type": "string", "minLength": 1 },
|
|
20
|
+
"state": { "type": "string", "minLength": 1 },
|
|
21
|
+
"phase": { "type": "string", "minLength": 1 },
|
|
22
|
+
"startedAt": { "type": "integer" },
|
|
23
|
+
"expiresAt": { "type": "integer" },
|
|
24
|
+
"hostId": { "type": "string" },
|
|
25
|
+
"hubId": { "type": "string" },
|
|
26
|
+
"failure": { "$ref": "hub-state.v1.schema.json#/$defs/operation/properties/failure" }
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
},
|
|
30
|
+
"allOf": [
|
|
31
|
+
{
|
|
32
|
+
"if": { "properties": { "configured": { "const": true } }, "required": ["configured"] },
|
|
33
|
+
"then": { "required": ["hub"] },
|
|
34
|
+
"else": { "not": { "required": ["hub"] } }
|
|
35
|
+
}
|
|
36
|
+
],
|
|
37
|
+
"$defs": {
|
|
38
|
+
"localHub": {
|
|
39
|
+
"type": "object",
|
|
40
|
+
"additionalProperties": false,
|
|
41
|
+
"required": ["id", "type", "hostId", "isTest", "status", "cloud", "local"],
|
|
42
|
+
"properties": {
|
|
43
|
+
"id": { "type": "string", "minLength": 1 },
|
|
44
|
+
"name": { "type": "string" },
|
|
45
|
+
"type": { "type": "string", "minLength": 1 },
|
|
46
|
+
"hostId": { "type": "string", "minLength": 1 },
|
|
47
|
+
"isTest": { "type": "boolean" },
|
|
48
|
+
"status": { "type": "string", "minLength": 1 },
|
|
49
|
+
"cloud": { "$ref": "hub-state.v1.schema.json#/$defs/hub/properties/cloud" },
|
|
50
|
+
"local": {
|
|
51
|
+
"type": "object",
|
|
52
|
+
"additionalProperties": false,
|
|
53
|
+
"required": ["discovered", "connected"],
|
|
54
|
+
"properties": {
|
|
55
|
+
"discovered": { "type": "boolean" },
|
|
56
|
+
"connected": { "type": "boolean" },
|
|
57
|
+
"connectionStatus": { "type": "string" },
|
|
58
|
+
"hostName": { "type": "string" },
|
|
59
|
+
"version": { "type": "string" }
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
}
|