@mhome/app-facade-protocol 1.134.0 → 1.137.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.
@@ -72,6 +72,13 @@ also uses metadata rather than downloading authored source.
72
72
  | `/app/presentation/automation/generated/disable` | `{automationId}` | Existing AutomationStatus after disabling. |
73
73
  | `/app/presentation/automation/generated/run` | `{automationId,timezone?,locationSymbol?}` | Canonical acknowledgement without data. Forces the existing stored generated program's threads, including Recurring programs. Runtime execution remains asynchronous. |
74
74
 
75
+ If the first Overview save fails after recording a pending creation, the Full
76
+ error has code `PRECONDITION_FAIL` and details
77
+ `{automationId, pendingOperation: "create"}`. The returned ID can be passed to
78
+ `/app/automation/delete` even when the definition is absent. A failure before
79
+ that marker is recorded preserves the original error and the existing editing
80
+ session. Start a fresh template session for a new creation.
81
+
75
82
  Generated control accepts only stored `P-`, `S-`, `G-` program IDs. It does not
76
83
  rename generated programs, control Group entities, or widen public user-program
77
84
  start/stop. Actor and Client come from trusted ingress, never arbitrary sideData.
@@ -98,6 +98,11 @@ Fallback characteristic UUIDs: the standard endpoints as for pods, `host-info`
98
98
  checking that the Host is still unclaimed. Repeated `finish` requests in the
99
99
  same session return the same token. A claimed Host's re-provision window
100
100
  carries no first-claim token.
101
+ - `finish` returns `{"ok":false}` when the requested network has not been
102
+ established and the Host is not recovering an unfinished claim on a working
103
+ network. Refusal keeps the current setup session open. The Client reports
104
+ completion only after a positive receipt, with a valid token when the secured
105
+ Host information indicated that first claim was pending.
101
106
  `finish` ends the central's setup session. Without it, the Host disconnects the
102
107
  central 30 seconds after a successful join; the commissioner retries `finish`
103
108
  within that window. Network readiness and mDNS announcement do not establish
@@ -9,8 +9,9 @@ call the `/local/pod/*` targets of their native Client.
9
9
  Network provisioning and activation are separate transactions. BLE provisions
10
10
  Wi-Fi; Ethernet and already-connected Wi-Fi skip it. Every initialization then
11
11
  uses a direct native Client ↔ Pod LAN security-2 session. No Core relay is used.
12
- The commissioner explicitly chooses `clientMode: "user" | "space"` during
13
- `/local/pod/commission/authorize`. User mode uses the personal Pod credential.
12
+ The commissioner selects `clientMode: "user" | "space"` before submitting
13
+ initial BLE Wi-Fi credentials or in the LAN session for an already-networked Pod.
14
+ User mode uses the personal Pod credential.
14
15
  Space mode uses a local Core credential signed by Lion; it carries no user
15
16
  identity and has no cloud access/refresh token. Changing mode requires reset.
16
17
 
@@ -159,10 +160,13 @@ Activation error codes: `time_sync_failed`, `cloud_unreachable`,
159
160
  `local_hub_unavailable`, `refresh_rejected`, `auth_rejected`, `storage_failed` (the final commit, or in a
160
161
  Wi-Fi change window saving the new network, failed).
161
162
 
162
- The Pod commits Wi-Fi immediately after a successful join, before any credential
163
- issuance. Activation commits only identity/binding data. Failed activation,
164
- disconnection, code expiry and reboot preserve the successfully saved network.
165
- A failed join rolls back only the incomplete network change.
163
+ The Pod joins using temporary Wi-Fi settings. For a Space with an existing Hub,
164
+ it locates and proves the selected Hub's identity through the new Wi-Fi interface
165
+ within 30 seconds of receiving an IP address, then commits the network. Personal
166
+ Pods commit on IP readiness. A failed join or proof clears the trial and keeps
167
+ any previously stored network. Activation happens afterward and commits only
168
+ identity and binding data. Activation failure, disconnection, code expiry and
169
+ reboot preserve the committed network.
166
170
 
167
171
  ### LAN discovery and channel
168
172
 
@@ -189,8 +193,8 @@ A failed join rolls back only the incomplete network change.
189
193
  ## 4. Pod state machine
190
194
 
191
195
  ```text
192
- no network -> BLE secure -> join -> save Wi-Fi -> network ready
193
- Ethernet / saved Wi-Fi ------------------------> network ready
196
+ no network -> BLE secure -> join -> verify selected Hub if required -> save Wi-Fi
197
+ Ethernet / saved Wi-Fi ------------------------------------------> network ready
194
198
  network ready -> advertise init -> LAN secure -> authorize -> activate -> save identity
195
199
  join failure -> end attempt; start Wi-Fi setup again
196
200
  activation failure -> end attempt; keep network and init advertisement
@@ -214,8 +218,9 @@ Runtime states after commit:
214
218
  the new one connects. `pod-info` reports `"mode":"reprovision"` and
215
219
  `wifiConfigured: false`, and only the Wi-Fi endpoints and `pod-credential`
216
220
  `status` and `finish` are accepted (`deliver` answers `wrong_state`). After
217
- `prov-config` apply the pod joins the new network, saves it, and reports
218
- `commissioned`, or `failed` with `storage_failed` if saving failed; it then
221
+ `prov-config` apply the Pod joins the new network, validates its stored Hub for
222
+ Space mode, saves the network and reports `commissioned`. It reports `failed`
223
+ with `wifi_hub_unverified` when the Hub proof fails or `storage_failed` if saving fails. It then
219
224
  restarts on `finish`, 30 seconds later, or at the end of the window. A failed
220
225
  join or an expired window restarts with the previous network.
221
226
  - `needs_recommission`: logout, or refresh rejected because the credential was
@@ -306,17 +311,18 @@ never show these values or `message` verbatim.
306
311
  | `not_signed_in` | no signed-in MeowLink account |
307
312
  | `space_not_offered` | the Space is not among those offered, or the account has no Space |
308
313
  | `cloud_unreachable_for_device` | the cloud address is loopback |
314
+ | `unknown_lease` | the discovery lease expired or was stopped |
309
315
  | `busy` | the native Client cannot take the request now; retry |
310
316
 
311
317
  | Target | Request | Response |
312
318
  | --- | --- | --- |
313
- | `/local/pod/discovery/start` | `{}` | `{"leaseId","expiresAtMs"}`, 30 s lease |
319
+ | `/local/pod/discovery/start` | `{"transport":"lan"|"ble"}` | `{"leaseId","expiresAtMs"}`, 30 s lease |
314
320
  | `/local/pod/discovery/renew` | `{"leaseId"}` | `{"leaseId","expiresAtMs"}` |
315
321
  | `/local/pod/discovery/stop` | `{"leaseId"}` | `{}` |
316
322
  | `/local/pod/discovery/list` | `{}` | discovery snapshot |
317
323
  | `/local/pod/commission/start` | `{"candidateId"}` | session snapshot |
318
324
  | `/local/pod/commission/code` | `{"sessionId","code"}` | session snapshot |
319
- | `/local/pod/commission/wifi` | `{"sessionId","ssid","password"?}` | session snapshot |
325
+ | `/local/pod/commission/wifi` | `{"sessionId","ssid","password"?,"enrollment"?}` | session snapshot |
320
326
  | `/local/pod/commission/wifi/scan` | `{"sessionId"}` | session snapshot |
321
327
  | `/local/pod/commission/authorize` | `{"sessionId","spaceId"}` | session snapshot |
322
328
  | `/local/pod/commission/status` | `{}` | `{"session": snapshot or null}` |
@@ -327,6 +333,30 @@ current adapter state (enable Bluetooth or Location, or the app's permission
327
333
  page) and answers whether it did; a platform without such a page answers
328
334
  `{"opened":false}`.
329
335
 
336
+ The lease activates only its selected transport. Renew keeps that transport and
337
+ returns `unknown_lease` if the lease was stopped or expired. A LAN lease does
338
+ not request Bluetooth permission. BLE discovery uses the current Client's radio.
339
+ Snapshots may contain both transports when several callers hold leases. A running
340
+ Pod setup may continue LAN browsing to complete a handoff.
341
+
342
+ Initial BLE Wi-Fi setup requires `enrollment: {spaceId, clientMode}`. An
343
+ already-bound Pod changing Wi-Fi uses the stored authorization and omits it.
344
+ An already-networked Pod selects its authorization in the LAN session.
345
+
346
+ Before submitting the Wi-Fi settings, the Client sends `pod-info` the secured
347
+ `{"op":"prepareWifi","mode":"user"|"space"|"bootstrap"}` record. A `space`
348
+ record also carries `hub`, an ordered array of seven strings: Hub ID, tenant ID,
349
+ Space ID, Hub P-256 X/Y and Host TLS P-256 X/Y. The Client obtains this identity
350
+ from the published Space Hub and the Hub identity service. No application
351
+ credential is sent in the BLE network phase. The device accepts Wi-Fi apply
352
+ only after receiving a setup target or when in its authorized reprovision
353
+ window. It verifies a selected Hub from the new Wi-Fi before committing the
354
+ network. The Client later authorizes the exact enrollment selected before the
355
+ trial and rejects a credential from a different Hub.
356
+ `bootstrap` is reserved for a verified product with an embedded dependent Host
357
+ when the selected Space has no existing Hub or pending Hub transition. A
358
+ standalone Pod rejects that mode.
359
+
330
360
  Discovery is shared by every MeowLink device kind: each candidate carries
331
361
  `kind` (`pod` or `host`). `/local/pod/commission/start` accepts only `pod`
332
362
  candidates; Host candidates go to `/local/host/provision/*`.
@@ -354,9 +384,11 @@ Wi-Fi-only session. From `reading_info` on, its snapshots carry
354
384
  joins it polls `pod-credential` `status` (still `joining_wifi`) until the pod
355
385
  reports `commissioned`, then records `completed` and sends `finish`. No
356
386
  authorization prompt is shown, no credential is issued and `completed` carries
357
- no `podId`; the pod keeps its existing credential and Space. A pod that reports
387
+ no `podId`; the pod keeps its existing credential and Space. After obtaining an
388
+ IP, a Space Pod has 30 seconds to verify its pinned Hub through the trial Wi-Fi
389
+ interface. On failure it discards the attempted network. A pod that reports
358
390
  `failed` ends the session with `wifi_failed` carrying the pod's code (for
359
- example `storage_failed`) in `detail`. UIs show such a session as changing the
391
+ example `wifi_hub_unverified` or `storage_failed`) in `detail`. UIs show such a session as changing the
360
392
  pod's Wi-Fi rather than adding a pod.
361
393
 
362
394
  Session states, in order: `connecting`, `awaiting_code`, `securing`,
@@ -1,13 +1,18 @@
1
- # Native Wave LAN admission
1
+ # Native Wave admission
2
2
 
3
3
  These Hub-routed App Facades require current-Space Manage access and an active
4
4
  local Hub. They do not make Wave devices Hosts, Nodes or Plugins. No device URL,
5
5
  Space/Hub selector, grant, certificate or private key is an input/output.
6
6
 
7
- - `/app/wave/discover`: `{}` -> `{candidates:[{candidateId,deviceId,proof,purpose}]}`.
8
- Core browses `_meow-wave._tcp.local.` and identifies bounded LAN candidates.
7
+ - `/app/wave/discover`: `{transport:"lan"|"ble"}` ->
8
+ `{candidates:[{candidateId,deviceId,proof,purpose}]}`.
9
+ LAN discovery browses `_meow-wave._tcp.local.`; it never invokes BLE Relay.
10
+ BLE discovery searches only bound relays for pure BLE operation. It does not
11
+ discover unconfigured Wi-Fi devices for network setup. The caller selects
12
+ exactly one transport; there is no implicit discovery or fallback.
9
13
  Results are untrusted location hints, scoped to this caller, Space and Hub
10
- generation, expiring after two minutes. They never grant operation authority.
14
+ generation and transport, expiring after two minutes. They never grant operation
15
+ authority.
11
16
  - `/app/wave/pair`: `{candidateId,pin?}` -> AdmissionResult below. This is a direct
12
17
  authenticated App interaction; Agent/MCP/cloud delegation cannot submit PINs.
13
18
  PIN6 is required when the selected device requires it. Omitting it is allowed
@@ -10,7 +10,8 @@ policy. They are not Agent/CLI/MCP tools. Inputs reject unknown fields.
10
10
  | `/app/presentation/widget/defaults/get` | `{}` | `{items, automationNames:{}}`. Preserves the existing default Widget lookup and lazy initialization, then reads the selected Data Widgets. |
11
11
 
12
12
  Rows carry ID, revision, displayName, description, source/baseId, global, tag,
13
- current value, and type-specific control configuration. Circadian rows contain
13
+ current value, and type-specific control configuration. `pendingDeletion: true`
14
+ identifies a Widget whose deletion can be completed through the delete Facade. Circadian rows contain
14
15
  only `curve`, `curvePreview` (active curve's UI points), current/next values and
15
16
  `nextTimestamp`; they omit complete schedules, location and internal state.
16
17
  Complete configuration uses `/app/widget/detail/get`; runtime uses
@@ -40,5 +40,12 @@ Create/configuration responses retain action, widgetId, type and displayName.
40
40
  to preserve its previous deletion behavior. This migration does not change the
41
41
  shared safe=true protection for Widgets referenced by Automations.
42
42
 
43
+ After validation, deletion marks each Widget before removing its associated
44
+ resources. A pending Widget remains readable and rejects controls, edits and
45
+ new Automation or Dashboard references. Its list/detail projections carry
46
+ `pendingDeletion: true`. Call the same delete endpoint with the original IDs
47
+ to finish the operation. Missing IDs are already complete. A validation failure
48
+ leaves unstarted Widgets available.
49
+
43
50
  All legacy public /widget/* request Controllers are retired. /widget/reportUpdate
44
51
  is a push event and internal /dispatch/widget/* operations retain their own roles.
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "manifest": "mhome.app-facade.v1",
3
- "contractVersion": "1.134.0",
3
+ "contractVersion": "1.137.2",
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.134.0",
2
+ "contractVersion": "1.137.2",
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.134.0",
3
+ "contractVersion": "1.137.2",
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.134.0",
3
+ "contractVersion": "1.137.2",
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.134.0",
3
+ "contractVersion": "1.137.2",
4
4
  "contract": "contract/pod-commissioning-v1.md",
5
5
  "localTargets": [
6
6
  "/local/pod/discovery/start",
@@ -87,6 +87,7 @@
87
87
  "not_commissionable",
88
88
  "wrong_kind",
89
89
  "unknown_session",
90
+ "unknown_lease",
90
91
  "wrong_state",
91
92
  "invalid_code",
92
93
  "invalid_wifi",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "manifest": "mhome.app-facade.routing.v1",
3
- "contractVersion": "1.134.0",
3
+ "contractVersion": "1.137.2",
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.134.0",
3
+ "contractVersion": "1.137.2",
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.134.0",
3
+ "version": "1.137.2",
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.134.0",
3
+ "contractVersion": "1.137.2",
4
4
  "manifest": "manifest/app-facade.v1.json",
5
5
  "schemas": {
6
6
  "storage": "schema/storage.v1.schema.json",
@@ -101,6 +101,15 @@
101
101
  }
102
102
  }
103
103
  },
104
+ "enrollment": {
105
+ "type": "object",
106
+ "additionalProperties": false,
107
+ "required": ["spaceId", "clientMode"],
108
+ "properties": {
109
+ "spaceId": { "type": "string", "minLength": 1 },
110
+ "clientMode": { "enum": ["user", "space"] }
111
+ }
112
+ },
104
113
  "authorization": {
105
114
  "type": "object",
106
115
  "additionalProperties": false,
@@ -374,6 +383,14 @@
374
383
  "authorization"
375
384
  ]
376
385
  },
386
+ {
387
+ "properties": {
388
+ "enrollment": {}
389
+ },
390
+ "required": [
391
+ "enrollment"
392
+ ]
393
+ },
377
394
  {
378
395
  "properties": {
379
396
  "clientMode": {}
@@ -14,12 +14,18 @@
14
14
  "candidates": { "type": "array", "items": { "$ref": "#/$defs/candidate" } }
15
15
  },
16
16
  "$defs": {
17
+ "startRequest": {
18
+ "type": "object",
19
+ "additionalProperties": false,
20
+ "required": ["transport"],
21
+ "properties": { "transport": { "enum": ["lan", "ble"] } }
22
+ },
17
23
  "adapter": {
18
24
  "type": "object",
19
25
  "additionalProperties": false,
20
26
  "required": ["state"],
21
27
  "properties": {
22
- "state": { "enum": ["ready", "poweredOff", "denied", "unavailable"] },
28
+ "state": { "enum": ["ready", "poweredOff", "unsupported", "permissionRequired", "denied", "initializing", "locationDisabled", "unavailable"] },
23
29
  "message": { "type": "string" }
24
30
  }
25
31
  },