@mhome/app-facade-protocol 1.146.1 → 1.148.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
@@ -31,6 +31,9 @@ independent saved configuration and Provider Operation boundaries.
31
31
  See [Group operation state](contract/groups-v1.md) for incomplete application,
32
32
  manual reapplication, deletion and name-update outcomes.
33
33
 
34
+ See [Messaging route update outcomes](contract/messaging-route-updates.md) for
35
+ committed-route receipts and best-effort cleanup without a persisted pending state.
36
+
34
37
  ## Business DTO ownership
35
38
 
36
39
  A Facade owns the public business DTO for an operation. Native Agent tools, MCP,
@@ -0,0 +1,42 @@
1
+ # Messaging route update outcomes
2
+
3
+ The route is authoritative. Save the new Space/settings before changing derived
4
+ delivery registrations. A rejected save leaves the old registrations and actions
5
+ untouched. Local route changes and old action invalidation share the existing
6
+ SQLite transaction; construct the receipt before committing it.
7
+
8
+ After commit, attempt the current registration and best-effort old-Space action
9
+ cleanup independently. Cloud optional cleanup has a one-second total wait budget. Its
10
+ failure does not fail the update or prevent a later update. Cleanup must not
11
+ invalidate new-Space action sessions. Action handlers still check the current
12
+ route and authorization; provider message/button editing is not a prerequisite
13
+ for saving settings.
14
+
15
+ Retain obsolete AppClient registrations during route changes and cloud route
16
+ removal. They are disposable discovery records, not authorization. An unconditional
17
+ delete by reusable Space/client key could arrive after a later registration and
18
+ remove it. Actual delivery must resolve the authoritative route and check current
19
+ identity, membership or shared grant. Revocation and unlink still change those
20
+ authoritative records; retaining a registration never keeps a revoked route active.
21
+
22
+ Explicit, authorized selection of a revoked personal route creates a fresh active
23
+ binding using the existing binding identity field. Ordinary inbound messages reject
24
+ revoked routes and direct the user to select a Space. Route lists hide explicit
25
+ access denial but report authorization-query failures instead of returning a
26
+ successful empty list.
27
+
28
+ If the current delivery registration fails after commit, `/app/messaging/route/update`
29
+ returns `partial` with the committed `route` and optional `applicationProblem`
30
+ (`MESSAGING_ROUTE_REGISTRATION_FAILED`). Full and Essential retain this outcome and
31
+ warning. Private-chat `/switch` likewise says the Space was selected and explains
32
+ that delivery registration failed. A user may apply settings or switch again.
33
+
34
+ This receipt is transient. It introduces no persisted route state, cleanup task,
35
+ automatic write retry or pending-operation gate. Reads do not retain the failure
36
+ after refresh, and a later update need not clean every historical registration.
37
+
38
+ Clients preserve a known committed receipt even if a subsequent read fails. On an
39
+ unconfirmed/transport failure, reread the actual route without replaying the write.
40
+ Directory indexes discover route IDs; resolve those IDs from the authoritative
41
+ primary rows before displaying their current Space. A response from an abandoned
42
+ UI session must not change the new session or display its mutation result.
@@ -14,6 +14,10 @@ initial BLE Wi-Fi credentials or in the LAN session for an already-networked Pod
14
14
  User mode uses the personal Pod credential.
15
15
  Space mode uses a local Core credential signed by Lion; it carries no user
16
16
  identity and has no cloud access/refresh token. Changing mode requires reset.
17
+ The selected device mode survives User logout and account replacement; only
18
+ factory reset returns a device to the unselected state. Secure device info and
19
+ normal native sessions expose retained `clientMode` before Wi-Fi/authorization;
20
+ callers offer only that mode. This field alone is never a completion receipt.
17
21
 
18
22
  ## 1. Device identity
19
23
 
@@ -123,7 +127,8 @@ and responses are bounded to 64 KiB including encryption overhead.
123
127
  ```
124
128
 
125
129
  `env` must match the native Client runtime (`prod`, `dev`, `e2e`).
126
- `podId` and `clientMode` (`user` or `space`) are included together when activation
130
+ `clientMode` (`user` or `space`) reports the retained mode even after User logout,
131
+ without `podId`. `podId` accompanies `clientMode` when activation
127
132
  is in flight or durably completed. A new session reads both from the secure
128
133
  device response before resuming; a missing or unknown mode fails the attempt.
129
134
  This observes completion without issuing another credential. Native completed
@@ -139,8 +144,8 @@ the response also carries `"mode":"reprovision"` and `wifiConfigured` is false
139
144
  BLE `pod-info` is the network-phase DTO, not the LAN identity/receipt DTO above.
140
145
  It carries `protocol`, `env`, `deviceId`, `model`, `firmwareVersion`,
141
146
  `publicKey: [x, y]`, `wifiConfigured`, `state`, `dependentHost`, and optional
142
- `mode`/`error: {code}`. It never includes `deviceBinding`, `podId`, `clientMode`
143
- or a credential. `publicKey` is the same ES256 P-256 key as LAN: derive
147
+ `clientMode` (retained mode), `mode`/`error: {code}`. It never includes
148
+ `deviceBinding`, `podId` or a credential. `publicKey` is the same ES256 P-256 key as LAN: derive
144
149
  `fingerprint = hex(SHA256(0x04 || x || y))` and `keyId = "p256:" + fingerprint`.
145
150
  Coordinates are unpadded base64url. The complete JSON must fit 480 bytes,
146
151
  leaving room for the authenticated record in one 512-byte ATT value.
@@ -246,7 +251,7 @@ Runtime states after commit:
246
251
  identity key and cached Hub tokens, reboot to `unprovisioned`. No cloud
247
252
  request is needed. User logout also clears local credentials without cloud revocation.
248
253
 
249
- User logout keeps network and device preferences, but clears the User session,
254
+ User logout keeps the selected device mode, network and device preferences, but clears the User session,
250
255
  selected Space, account navigation data and per-Hub credentials. A subsequent
251
256
  User login obtains a fresh device session. Space mode refuses logout in both UI
252
257
  and the native execution/persistence boundary. Network loss or rejected
@@ -0,0 +1,35 @@
1
+ {
2
+ "target": "/app/messaging/route/update",
3
+ "direction": "response",
4
+ "body": {
5
+ "route": {
6
+ "provider": "telegram",
7
+ "placement": "cloud",
8
+ "routeId": "route-1",
9
+ "accountId": "official-bot",
10
+ "conversationId": "chat-1",
11
+ "audience": "personal",
12
+ "externalActorId": "user-1",
13
+ "tenantId": "tenant-1",
14
+ "userId": "mhome-user-1",
15
+ "spaceId": "scope-1",
16
+ "projections": {
17
+ "notification": {
18
+ "enabled": true,
19
+ "levels": [
20
+ "alert",
21
+ "notify"
22
+ ]
23
+ },
24
+ "dialog": {
25
+ "enabled": true
26
+ }
27
+ },
28
+ "providerData": {}
29
+ },
30
+ "applicationProblem": {
31
+ "code": "MESSAGING_ROUTE_REGISTRATION_FAILED",
32
+ "message": "Chat route saved, but delivery registration failed. Apply the settings again."
33
+ }
34
+ }
35
+ }
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "manifest": "mhome.app-facade.v1",
3
- "contractVersion": "1.146.1",
3
+ "contractVersion": "1.148.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",
@@ -1,5 +1,5 @@
1
1
  {
2
- "contractVersion": "1.146.1",
2
+ "contractVersion": "1.148.0",
3
3
  "operations": {
4
4
  "/app/agent/context/get": "spaceRead",
5
5
  "/app/agent/credit/usage": "spaceRead",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "manifest": "mhome.host-provision.targets.v1",
3
- "contractVersion": "1.146.1",
3
+ "contractVersion": "1.148.0",
4
4
  "contract": "contract/host-provisioning-v1.md",
5
5
  "localTargets": [
6
6
  "/local/host/provision/start",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "manifest": "mhome.hub.targets.v1",
3
- "contractVersion": "1.146.1",
3
+ "contractVersion": "1.148.0",
4
4
  "appTargets": [
5
5
  "/app/hub/get",
6
6
  "/app/hub/remove"
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "manifest": "mhome.pod.targets.v1",
3
- "contractVersion": "1.146.1",
3
+ "contractVersion": "1.148.0",
4
4
  "contract": "contract/pod-commissioning-v1.md",
5
5
  "localTargets": [
6
6
  "/local/pod/discovery/start",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "manifest": "mhome.app-facade.routing.v1",
3
- "contractVersion": "1.146.1",
3
+ "contractVersion": "1.148.0",
4
4
  "targetPrefix": "/app/",
5
5
  "default": {
6
6
  "execution": "spaceMode"
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "manifest": "mhome.messaging.targets.v1",
3
- "contractVersion": "1.146.1",
3
+ "contractVersion": "1.148.0",
4
4
  "requestTargets": [
5
5
  "/app/messaging/provider/list",
6
6
  "/app/messaging/provider-account/list",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mhome/app-facade-protocol",
3
- "version": "1.146.1",
3
+ "version": "1.148.0",
4
4
  "description": "Build-time protocol artifacts for mhome.app-facade",
5
5
  "license": "Apache-2.0",
6
6
  "repository": {
package/protocol.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "protocol": "mhome.app-facade",
3
- "contractVersion": "1.146.1",
3
+ "contractVersion": "1.148.0",
4
4
  "manifest": "manifest/app-facade.v1.json",
5
5
  "schemas": {
6
6
  "storage": "schema/storage.v1.schema.json",
@@ -1483,6 +1483,23 @@
1483
1483
  "properties": {
1484
1484
  "route": {
1485
1485
  "$ref": "#/$defs/messagingRoute"
1486
+ },
1487
+ "applicationProblem": {
1488
+ "type": "object",
1489
+ "additionalProperties": false,
1490
+ "required": [
1491
+ "code",
1492
+ "message"
1493
+ ],
1494
+ "properties": {
1495
+ "code": {
1496
+ "type": "string"
1497
+ },
1498
+ "message": {
1499
+ "type": "string"
1500
+ },
1501
+ "details": {}
1502
+ }
1486
1503
  }
1487
1504
  }
1488
1505
  }
@@ -207,6 +207,7 @@
207
207
  }
208
208
  },
209
209
  "clientMode": {
210
+ "description": "Retained device mode during enrollment, including after User logout; required with the completed Pod receipt. Absent for Wi-Fi-only sessions.",
210
211
  "enum": [
211
212
  "user",
212
213
  "space"