@mhome/app-facade-protocol 1.141.0 → 1.146.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.
package/README.md CHANGED
@@ -28,6 +28,9 @@ Device-only rendering, online rows and chart series use the
28
28
  See [Agent LLM settings](contract/agent-llm-v1.md) for active-mode reads,
29
29
  independent saved configuration and Provider Operation boundaries.
30
30
 
31
+ See [Group operation state](contract/groups-v1.md) for incomplete application,
32
+ manual reapplication, deletion and name-update outcomes.
33
+
31
34
  ## Business DTO ownership
32
35
 
33
36
  A Facade owns the public business DTO for an operation. Native Agent tools, MCP,
@@ -0,0 +1,46 @@
1
+ # Group operation state
2
+
3
+ A Group owns its definition, derived Twin, generated execution plans and related
4
+ cards. Deleting a Group preserves member resources. Member type is immutable.
5
+
6
+ `applyState` is persisted before changing derived resources. Validation and
7
+ preparation failures preserve the preceding definition. After a definition is
8
+ accepted, interrupted or failed application remains `applying` or `failed` until
9
+ another application succeeds. Controls require `ready` and a matching runtime
10
+ projection revision. `applying` alone does not establish that a worker is active.
11
+
12
+ A saved incomplete creation has a stable Group ID and complete member definition.
13
+ A user may reapply those IDs through `/app/group/members/update` with the current
14
+ revision, or delete the Group. Reusing the original `creationId` and payload also
15
+ preserves identity; it never overwrites later edits of a completed Group.
16
+
17
+ Deletion persists `deleting`, rejects rename/member updates and removes the Group
18
+ record last. Repeating deletion at the retained revision continues cleanup;
19
+ an absent Group succeeds. These operations do not require a background recovery
20
+ worker or a per-step task log. Normal reconciliation after member-source changes
21
+ continues independently.
22
+
23
+ Rename preserves runtime and does not require available members. Its saved name
24
+ and internal `presentationPending` marker are committed together before updating
25
+ Twin/card titles. The marker clears after all title writes succeed. An interrupted
26
+ rename therefore remains visible while ready controls remain usable. Saving the
27
+ current name again repairs titles; a successful full application also settles it.
28
+
29
+ List summaries, details and mutation results expose optional `applicationProblem`.
30
+ An incomplete persisted state yields a problem even when no exception was recorded.
31
+ A ready Group may carry a title problem. Mutation results with a problem are
32
+ `partial`, retaining Group identity, current revision and diagnostics in both
33
+ Full and Essential presentation. Read success means the definition was read;
34
+ inspect its state and problem separately. Member-resolution read failures retain
35
+ the existing `GROUP_MEMBERS_UNAVAILABLE` partial-read contract.
36
+
37
+ Notifications are best effort. A notification failure does not undo successful
38
+ writes. Rename invalidation follows the persisted final outcome. Clients may
39
+ refresh reads and expose user-initiated write retries. Existing member-source
40
+ reconciliation can reapply affected incomplete Groups under its existing rules;
41
+ this contract adds no separate recovery worker.
42
+
43
+ The cloud Group record gains one optional boolean attribute. Primary keys and
44
+ indexes do not change. Core SQLite includes `presentation_pending` in its complete
45
+ baseline; an existing database requires an explicit rebuild under the workspace
46
+ baseline policy. No startup conversion or automatic deletion is performed.
@@ -18,10 +18,18 @@ Business execution follows Space mode, independently of LLM placement:
18
18
  cloud forwarding. Core obtains cloud-owned directory metadata and user grants
19
19
  through the private `/bridge/management/control` endpoint; this endpoint neither
20
20
  dispatches Host commands nor impersonates a Client.
21
- - Cloud Space: cloud executes business through the initiating personal desktop
22
- Client. No other online App is selected. MCP, web and mobile have no such
21
+ - Cloud Space: cloud executes business through the initiating personal Native
22
+ Client (desktop, Android or iOS). No other online App is selected. MCP and web have no such
23
23
  transport and management calls fail if no suitable route exists. List still
24
24
  returns registrations with unavailable observations.
25
+ - No Space: `/app/host/metrics` and `/app/host/permissions/get` execute through
26
+ the authenticated initiating Native Client, using the same Facade DTO and
27
+ caller-selected Full/Essential protocol. Only an Admin Host is accepted; a
28
+ Space Host still requires its Space. The Cloud verifies the current socket
29
+ identity directly because no Space presence index exists yet. It never chooses
30
+ another online Client. These two exceptions are declared by
31
+ `routing.v1.json.unspacedCloudTargets`; with a Space, normal Space-mode routing
32
+ applies. MCP has no Native Client execution route.
25
33
 
26
34
  Host mode, ACL and Space ownership remain authoritative. The private bridge is
27
35
  bound to its authenticated tenant/Space and rechecks personal User read access;
@@ -32,6 +40,20 @@ Public signing endpoints remain Client-only and are not Agent/MCP tools.
32
40
 
33
41
  The private `/app/host/execute` Client request is a fixed management transport,
34
42
  not a capability or public Facade. It accepts no service switch or admin removal.
43
+ Its authenticated Cloud socket, personal User, tenant and explicit `spaceId` must
44
+ match the receiving Client's current membership. UI focus does not select or
45
+ authorize this execution. `inventory` accepts `{}` for a list or `{hostId}` for a
46
+ single target; the Client selects that target before probing devices. `runtime`
47
+ and `permissions` address one explicit Host ID. Private requests never enter the
48
+ WebView event stream. Each exchange remains bound to the initiating login and
49
+ connection attempt; an expired attempt cannot dispatch further work or reply on
50
+ its replacement. A result uses exactly `{value: ...}` or
51
+ `{error: {code, message}}`, keeping business refusal codes intact.
52
+ For an account read, the private request body's `spaceId` is explicitly `null`
53
+ and its envelope has no Space selection. The only admitted forms are `inventory {hostId}`,
54
+ `runtime {hostId,action:"metrics"}` and `permissions {hostId}`. Each receiver
55
+ verifies its current personal user/tenant and the Host's signed Admin mode;
56
+ missing `spaceId`, arbitrary unscoped writes and local Host aliases are rejected.
35
57
  A missing route fails; a mutation is never replayed through another transport.
36
58
  If a cloud entrypoint cannot reach a local Space's Core, list alone may return
37
59
  cloud registrations with unavailable observations and `sourceErrors.hub`.
@@ -3,9 +3,10 @@
3
3
  BLE-capable embedded Linux Hosts get Wi-Fi or recover an unfinished first claim
4
4
  over BLE from a native Client (desktop/CLI Clientd, Android, iOS). Desktop, Docker
5
5
  and Android Hosts use LAN discovery rather than advertising BLE setup.
6
- Provisioning connects the Host to the LAN
7
- and hands the provisioner a one-time claim token; ownership is then established
8
- by the existing Host claim over the LAN, which requires that token (section 4).
6
+ Provisioning connects the Host to the LAN. The Native Client retains the BLE
7
+ claim token privately and, after explicit user confirmation, establishes ownership
8
+ through the existing LAN claim protocol. CLI/UI drive this session protocol;
9
+ they never receive the token or compose the claim and Hub setup themselves.
9
10
 
10
11
  The BLE layer is the one pods use (`pod-commissioning-v1.md` sections 2 and 3):
11
12
  same service UUID, manufacturer data with device kind `2`, protocomm security 2
@@ -79,6 +80,7 @@ Fallback characteristic UUIDs: the standard endpoints as for pods, `host-info`
79
80
  "firmwareVersion": "0.9.0",
80
81
  "fingerprint": "<hex SHA-256 of the bootstrap public key>",
81
82
  "wifiConfigured": false,
83
+ "authorizationMode": "spaceSelf",
82
84
  "onboardingRequired": true,
83
85
  "networkOnline": false
84
86
  }
@@ -86,10 +88,26 @@ Fallback characteristic UUIDs: the standard endpoints as for pods, `host-info`
86
88
 
87
89
  `productId` is optional. `onboardingRequired` reports whether this Host still
88
90
  awaits its first claim and is required. `networkOnline` reports current LAN
89
- readiness. A securely paired Host with `networkOnline: true`
91
+ readiness. `authorizationMode` is the persisted installation role, independent
92
+ of upgrades. A securely paired Admin Host with `networkOnline: true`
90
93
  and `onboardingRequired: true` can finish without resubmitting Wi-Fi. `finish`
91
94
  issues a fresh first-claim token after checking authoritative Host ownership.
92
95
  Already claimed Hosts never issue a new first-claim token.
96
+ - `{"op":"identity"}` → `{"hostId":"…","publicKey":["<P-256 x>","<P-256 y>"]}`.
97
+ The separate encrypted record fits the BLE attribute budget. Native retains
98
+ this key and pins the subsequent LAN TLS connection to it before sending any
99
+ claim token, exchange secret or cloud grant.
100
+ - `{"op":"networkTarget"}` reports `user`, `space` (with claimed Space/Tenant),
101
+ `ownHub`, `firstHub` or `unclaimed`, derived from Host authority and the installed Core's
102
+ durable identity. It does not trust Pod profile caches or caller assertions.
103
+ - `{"op":"prepareWifi","mode":"user|space|bootstrap|bootstrapRecovery|ownHub","hub":[…]?}`
104
+ prepares the network policy in the same secure session before `set_config`.
105
+ Space uses the compact exact Hub identity tuple defined in the Pod contract.
106
+ Only an explicit first-Hub enrollment may request bootstrap; an existing Hub
107
+ is exempt from finding a different Hub only when its own Core identity matches
108
+ its Host claim. Ordinary Space re-provisioning obtains current Hub identity
109
+ online. The Host validates its own role/claim and rejects changed targets while
110
+ joining. A new central cannot reuse the preceding central's target or password.
93
111
  - `{"op":"finish"}` → `{"ok":true,"claimToken":"…"}`. After a successful
94
112
  first-provisioning join, or secure recovery with an already working network,
95
113
  the response carries a claim token: 32 random bytes as 43 unpadded base64url
@@ -123,7 +141,8 @@ most 4 at a time).
123
141
 
124
142
  `prov-config` status reports `connected` with the IPv4 address after the Host
125
143
  has saved the new profile. The Linux backend first activates a temporary
126
- profile. On failure or local cancellation it removes that profile and attempts
144
+ profile, then proves the exact target Hub through that trial interface within
145
+ 30 seconds of obtaining an IP for ordinary Space devices. On failure or local cancellation it removes that profile and attempts
127
146
  to reactivate the previous one. `connection_failed` may distinguish
128
147
  `auth_error` or `network_not_found`. After a failed join the commissioner sends
129
148
  `prov-ctrl` reset before the next `set_config`.
@@ -138,9 +157,10 @@ Candidates come from the shared discovery (`/local/pod/discovery/*`) with
138
157
  | --- | --- | --- |
139
158
  | `/local/host/provision/start` | `{"candidateId"}` | session snapshot |
140
159
  | `/local/host/provision/code` | `{"sessionId","code"}` | session snapshot |
141
- | `/local/host/provision/wifi` | `{"sessionId","ssid","password"?}` | session snapshot |
160
+ | `/local/host/provision/wifi` | `{"sessionId","ssid","password"?,"enrollment"?}` | session snapshot |
142
161
  | `/local/host/provision/wifi/scan` | `{"sessionId"}` | session snapshot |
143
162
  | `/local/host/provision/status` | `{}` | `{"session": snapshot or null}` |
163
+ | `/local/host/provision/authorize` | `{"sessionId"}` | session snapshot |
144
164
  | `/local/host/provision/cancel` | `{"sessionId"}` | session snapshot |
145
165
 
146
166
  Event `/local/host/provision/changed` carries a session snapshot. One session
@@ -158,37 +178,46 @@ returns the same session; a different session ID is rejected. Cancellation durin
158
178
  token form a bounded critical section. Leaving the UI does not cancel a session.
159
179
  There is no renewal endpoint.
160
180
 
161
- Session states, in order: `connecting`, `awaiting_code`, `securing`,
162
- `reading_info`, `awaiting_wifi`, `joining_wifi`, `completed`; terminal `failed`,
163
- `timed_out`, `cancelled`; transitional `cancelling`. `completed` carries `host`, the reported `addresses`
164
- (IPv4 only, possibly empty) and `claimToken` from the `finish` response; the
165
- commissioner sends `finish` (up to 3 times while the secure session lasts)
166
- before reporting it. A missing or refused `finish` is a failed session. The
167
- first-claim handoff includes `claimToken`. A completed Wi-Fi update on an
168
- already claimed Host omits it. An account change can redact the token from a
169
- terminal event, so confirm a tokenless completion through the native status
170
- target before displaying the Wi-Fi update as successful. No other state
171
- carries `claimToken`.
172
-
173
- The first claim (TOFU) after BLE provisioning must include the returned token.
174
- Native `host.claim` passes it to `POST /v1/auth/claim`, alongside the environment,
175
- cloud proof and direct Client exchange secret (`core-api::host::access::ClaimRequest`).
176
- There is no Core-proxied first-claim route. The Host rejects a missing or incorrect
177
- provisioning token with 403 `HOST_CLAIM_TOKEN_REQUIRED`. The token remains valid
178
- until claim succeeds, another setup issues a replacement token, or factory reset.
179
- BLE `completed` confirms the network/handoff step, not Host ownership. The App's
180
- Host onboarding operation waits for explicit ownership confirmation, then claims
181
- over the LAN. It completes only after the existing claim API confirms cloud
182
- registration. It does not install Core or Plugins. Hosts that were not provisioned
183
- over BLE use the ordinary direct LAN claim flow. See the Foundation Host
184
- management authorization contract.
185
-
186
- Error codes are the pod session codes without the credential ones:
187
- `bluetooth_unavailable`, `device_busy`, `disconnected`, `code_rejected` (retry
188
- allowed), `code_locked`, `wifi_auth_failed`, `wifi_not_found`, `wifi_failed`,
189
- `session_timeout`. Retry rules are the pod ones: a rejected code returns to
190
- `awaiting_code`, a failed join to `awaiting_wifi`, each with its error; `failed`
191
- and `timed_out` always carry `error`. `code_locked` is terminal.
181
+ Session states: `connecting` → `awaiting_code` → `securing` → `reading_info`
182
+ → `awaiting_wifi` → `joining_wifi`. A Host that already has an authoritative
183
+ claim completes here; this only changes its network. An unclaimed Host continues
184
+ through `awaiting_authorization` → `authorizing` → `completed`. User confirmation
185
+ calls `/local/host/provision/authorize`. Failure returns to
186
+ `awaiting_authorization` with `issue_failed`; retry is explicit, never an automatic
187
+ repeat of a write whose response may have been lost. The same paired Host key
188
+ and account remain required. Cancellation during `authorizing` is rejected as
189
+ busy, as it is during `joining_wifi`.
190
+
191
+ Space Hosts require an owner Space and explicit `firstHub` enrollment before
192
+ Wi-Fi is sent. Ordinary Space Hosts must verify the existing exact Hub. Explicit
193
+ first-Hub enrollment reuses the durable Hub setup engine after Host claim; the
194
+ result is accepted only for the same BLE-paired Host key and original Client LAN.
195
+ Admin Hosts require no Space. A combined Pod/Host uses the Pod session instead.
196
+
197
+ The Host first-claim token remains private to Native. It is sent with the existing
198
+ LAN `POST /v1/auth/claim` proof and exchange secret. The Host rejects a missing or
199
+ incorrect token with `HOST_CLAIM_TOKEN_REQUIRED`. Its validity ends at successful
200
+ claim, replacement by another secure setup, or factory reset. Repeating the same
201
+ owner's already committed claim reconciles through the ordinary claim contract.
202
+ There is no Core-proxied first-claim route. Hosts already online without BLE use
203
+ the ordinary direct LAN claim operation.
204
+
205
+ The required `result.outcome` is `onboarded` after adding the Host or completing
206
+ first-Hub setup, and `wifiUpdated` after changing an already claimed Host's Wi-Fi.
207
+ It survives status/event reconciliation; callers must not infer the operation
208
+ from the current `host.onboardingRequired` value. `wifiUpdated` never carries a
209
+ `hubId`.
210
+
211
+ Only `completed` carries `result`: `{hostId,outcome,wifiConfigured:true,commissioned:true,
212
+ hubId?}`. `hubId` is present when this operation explicitly established the first
213
+ Hub. `host` and optional reported IPv4 `addresses` remain in the snapshot. No
214
+ public snapshot, event, CLI or UI result contains `claimToken`. Terminal errors
215
+ are `failed` and `timed_out`, both with `error`; cancellation uses `cancelling`
216
+ then `cancelled`. Wrong codes and failed Wi-Fi joins return to their input states.
217
+ The supported errors include `bluetooth_unavailable`, `device_busy`,
218
+ `disconnected`, `code_rejected`, `code_locked`, `wifi_auth_failed`,
219
+ `wifi_not_found`, `wifi_failed`, `lan_unavailable`, `device_mismatch`,
220
+ `issue_failed` and `session_timeout`.
192
221
 
193
222
  The schema is `schema/host-provision.v1.schema.json`.
194
223
 
@@ -211,3 +240,60 @@ The schema is `schema/host-provision.v1.schema.json`.
211
240
  services, forgets saved Wi-Fi on BLE provisioning appliances, erases owners,
212
241
  the Host security store and bootstrap key, and returns to first provisioning.
213
242
  Machine identity and installed software are retained.
243
+
244
+ ## Interrupted first-Hub installation
245
+
246
+ The explicit first-Hub BLE flow records a durable installation intent before
247
+ trying Wi-Fi. Native obtains the securely paired Host identity and calls
248
+ `POST /api/v1/host/first-hub/begin` with `{spaceId, hostId, env, hostPublicKey}`
249
+ under the signed-in Owner. Cloud checks Space ownership and current Hub state,
250
+ returning `{intentId, space: {tenantId, spaceId}}`. The encrypted `prepareWifi`
251
+ bootstrap record carries this object as `firstHub`. It is not a Host claim or
252
+ permission to replace a Hub. Host persists it bound to its own installation key.
253
+
254
+ If Host was claimed to that Space but Core setup was interrupted, the next secure
255
+ `networkTarget` returns `{mode:"firstHub", intentId, spaceId, tenantId}`.
256
+ Native retains this exact Space and gets a fresh online Owner permit with
257
+ `POST /api/v1/host/first-hub/recovery/prepare {spaceId,intentId}`. It sends
258
+ `{op:"prepareWifi",mode:"bootstrapRecovery",firstHub:{intentId,space},authorizationId}`.
259
+ This is a compact private BLE record, not part of the public session snapshot.
260
+
261
+ After trial Wi-Fi obtains an IP, Host signs its current claimed status using the
262
+ permit as `probeId` and calls `/api/v1/host/first-hub/recovery/verify` over its
263
+ configured trusted HTTPS endpoint, bound to the trial Wi-Fi interface. Cloud
264
+ checks the Host signature and key, original Space, current Owner, five-minute
265
+ permit and absence of another Host's Hub/operation. The cloud permit determines
266
+ freshness; a rebooted Host clock does not extend it. Verification shares the
267
+ 30-second post-IP trial deadline. Failure discards the trial and restores the
268
+ previous network; the Host's original claim is retained.
269
+
270
+ A successful recovery enters `awaiting_authorization`, then the existing Hub
271
+ setup engine continues for the same paired Host. It does not submit another Host
272
+ claim. Hub completion closes the cloud intent generation before publication;
273
+ removing that Hub later does not revive the old intent. A local Core identity
274
+ already durably installed uses `ownHub` network change instead. Neither path
275
+ changes the installation role. Reset removes this pending intent with identity
276
+ and ownership, while preserving the installation role.
277
+
278
+ ## Completion and continuation
279
+
280
+ A confirmed Host claim is a completed checkpoint. A failure in first-Hub setup
281
+ must not repeat Host claiming. Native session snapshots update
282
+ `host.onboardingRequired` to false after confirmed claim success and discard the
283
+ claim handoff token. An unknown claim outcome remains unconfirmed until the
284
+ Host/cloud authority protocol resolves it; display text never decides ownership.
285
+
286
+ Cloud Hub `status: ready` confirms migration publication, not local runtime
287
+ readiness. Native `/local/hub/get` adds `hub.local.ready`, which is true only when
288
+ the exact authenticated LAN Hub reports its business request gate open through
289
+ `/app/hub/status` (`data.ready`). A connected socket alone is insufficient.
290
+ Shared Hub setup reports `WAITING_FOR_LOCAL` after cloud commit and completes
291
+ only with both `hub.local.connected` and `hub.local.ready`. Cloud publication and
292
+ local readiness retain separate meanings. A retry after cloud commit continues
293
+ the same Hub rather than reimporting or reclaiming it.
294
+
295
+ Direct LAN Space Host claims must use the same selected-Hub physical-LAN admission
296
+ as BLE commissioning. The native adapter validates the selected Space's published
297
+ Hub, pins its identity and verifies it on the same physical LAN as the Host.
298
+ A cloud Owner grant or the Host's own on-link address alone does not establish
299
+ this condition. First-Hub bootstrap has no existing target Hub to verify.
@@ -41,7 +41,7 @@ Task failure, notification priority and schedule trigger times are not inferred
41
41
  as user-decision facts.
42
42
 
43
43
  Standard device facts currently cover `state.water` (`wet` / `dry`) and
44
- `state.smoke` (`detected` / `clear`). Other readings, including unknown/testing,
44
+ `state.smokeDetector.alarmState` (`detected` / `clear`). Other readings, including unknown/testing,
45
45
  do not create an incident and do not resolve an existing incident. The small
46
46
  retained device projection preserves the episode across restarts and Space
47
47
  execution-mode migration. Its CAS revision is owned by Attention, independent of rebuildable Twin cache
@@ -28,8 +28,10 @@ identity and has no cloud access/refresh token. Changing mode requires reset.
28
28
 
29
29
  ## 2. BLE advertising
30
30
 
31
- Pods advertise only while unprovisioned, while re-commissioning after logout or
32
- credential invalidation, or inside a re-provision window. A commissioned pod does not advertise.
31
+ Pods advertise only while unprovisioned, while a User Pod is re-commissioning
32
+ after logout or credential invalidation, or inside a re-provision window. A
33
+ commissioned pod does not advertise. Space Pods have no personal login/logout
34
+ operation: only factory reset may clear their Space binding.
33
35
 
34
36
  - Service UUID (128-bit, shared by every MeowLink commissionable device):
35
37
  `a17a7ad5-9b2f-4010-9cf0-aa15ac54c40e`.
@@ -134,6 +136,20 @@ confirming connectivity with `prov-config` status. Inside a Wi-Fi change window
134
136
  the response also carries `"mode":"reprovision"` and `wifiConfigured` is false
135
137
  (section 4).
136
138
 
139
+ BLE `pod-info` is the network-phase DTO, not the LAN identity/receipt DTO above.
140
+ It carries `protocol`, `env`, `deviceId`, `model`, `firmwareVersion`,
141
+ `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
144
+ `fingerprint = hex(SHA256(0x04 || x || y))` and `keyId = "p256:" + fingerprint`.
145
+ Coordinates are unpadded base64url. The complete JSON must fit 480 bytes,
146
+ leaving room for the authenticated record in one 512-byte ATT value.
147
+ `dependentHost` identifies a combined product eligible for explicit first-Hub
148
+ network setup; it is not an ownership grant. After the LAN handoff, the Client
149
+ requires the exact same key, device ID, environment and dependent-Host role,
150
+ then verifies the complete product binding and Host proof before authorization.
151
+ No fallback accepts the former full LAN DTO on BLE.
152
+
137
153
  `pod-credential` requests:
138
154
 
139
155
  - `{"op":"deliver","clientMode":"user","podId","loginGrant","spaceId","cloudApi","cloudWs"}` →
@@ -223,12 +239,18 @@ Runtime states after commit:
223
239
  with `wifi_hub_unverified` when the Hub proof fails or `storage_failed` if saving fails. It then
224
240
  restarts on `finish`, 30 seconds later, or at the end of the window. A failed
225
241
  join or an expired window restarts with the previous network.
226
- - `needs_recommission`: logout, or refresh rejected because the credential was
242
+ - `needs_recommission` (User mode only): logout, or refresh rejected because the credential was
227
243
  revoked or the user no longer exists. Credential and local JWTs are erased,
228
244
  Wi-Fi is kept, advertising resumes with the Wi-Fi-configured flag.
229
245
  - `factory_resetting`: purely offline, erase all persisted data including the
230
246
  identity key and cached Hub tokens, reboot to `unprovisioned`. No cloud
231
- request is needed. Logout also clears local credentials without cloud revocation.
247
+ request is needed. User logout also clears local credentials without cloud revocation.
248
+
249
+ User logout keeps network and device preferences, but clears the User session,
250
+ selected Space, account navigation data and per-Hub credentials. A subsequent
251
+ User login obtains a fresh device session. Space mode refuses logout in both UI
252
+ and the native execution/persistence boundary. Network loss or rejected
253
+ authorization never clears its fixed Space binding or permits a different Space.
232
254
 
233
255
  Linux uses its OS time service and ESP uses background SNTP. User login proofs
234
256
  require usable UTC and cloud TLS retains normal CA and date validation. Space
@@ -357,8 +379,13 @@ trial and rejects a credential from a different Hub.
357
379
  embedded dependent Host. The selected Space must have no existing Hub or
358
380
  pending Hub transition. For BLE, include the flag in `enrollment` before sending
359
381
  Wi-Fi and repeat the same intent during authorization. An already-networked
360
- product supplies its intent during authorization. A standalone Pod rejects
361
- first Hub setup.
382
+ product supplies its intent during authorization. A retry may resume an existing
383
+ setup or published Hub only when its Host ID matches the securely paired
384
+ product. Removal, revocation, or another Host's operation blocks that retry.
385
+ The existing Hub setup engine owns continuation; the Client adopts the newly
386
+ published Hub only after checking its Host key, account, explicit Space and
387
+ unchanged local network. UI focus changes do not change this destination.
388
+ A standalone Pod rejects first Hub setup.
362
389
 
363
390
  Discovery is shared by every MeowLink device kind: each candidate carries
364
391
  `kind` (`pod` or `host`). `/local/pod/commission/start` accepts only `pod`
@@ -379,7 +406,16 @@ page does not end setup; returning to it reads `status`. Waiting for user input
379
406
  also counts toward the deadline. Discovery leases still control scanning.
380
407
 
381
408
  Sign-in and Spaces are checked at `start` (`not_signed_in`,
382
- `space_not_offered`) and again when the authorization prompt is built.
409
+ `space_not_offered`) and again when the authorization prompt is built. Every
410
+ Pod/Host setup session belongs to the assisting login generation, including
411
+ Wi-Fi-only sessions. Account replacement ends the old attempt and releases its
412
+ link; status does not expose it to the replacement login, and queued terminal
413
+ notifications contain no old account's authorization or completion data.
414
+
415
+ Personal Pod admission requires the assisting Client and Pod to share the Client's
416
+ physical LAN. The initial UI Space may have an unavailable or remote Hub and
417
+ never imposes that Hub's LAN on the personal login. Space Pod admission continues
418
+ to require the selected Space's exact Hub and same-LAN proof.
383
419
 
384
420
  A pod inside a Wi-Fi change window (`pod-info` `"mode":"reprovision"`) gets a
385
421
  Wi-Fi-only session. From `reading_info` on, its snapshots carry
@@ -394,6 +430,29 @@ interface. On failure it discards the attempted network. A pod that reports
394
430
  example `wifi_hub_unverified` or `storage_failed`) in `detail`. UIs show such a session as changing the
395
431
  pod's Wi-Fi rather than adding a pod.
396
432
 
433
+ For a combined Linux product (`dependentHost: true`), the Native Client is the
434
+ single Security 2 pairing authority on both BLE and LAN. The Host peripheral
435
+ forwards encrypted records over the OS-private Pod socket; the Host owns the
436
+ Wi-Fi trial, verification and rollback. This is not a BLE discovery relay.
437
+ A secured `pod-info` `{"op":"networkTarget"}` read before a Wi-Fi trial returns
438
+ `{"mode":"space","spaceId":"...","tenantId":"..."}` for an ordinary Space
439
+ product, `{"mode":"unclaimed"}` before Host binding, or `{"mode":"ownHub"}` when its installed Core durable identity matches its
440
+ local Host claim. The ordinary product requires the signed-in owner to obtain the
441
+ current Hub identity online and send the `space` preparation record above.
442
+ An own-Hub product accepts `{"op":"prepareWifi","mode":"ownHub"}` only after
443
+ checking the installed Core identity against its local Host claim. It
444
+ changes network without trying to prove LAN membership against itself. Both
445
+ paths retain authorization and issue no new Pod credential.
446
+ The `commissioned` response in this Wi-Fi-only mode confirms the saved network;
447
+ it does not restore a revoked credential. A Linux product that already needs
448
+ reauthorization keeps that state and its existing binding after a network change.
449
+
450
+ The Linux trial binds discovery and the pinned connection to the new Wi-Fi
451
+ interface. It saves the NetworkManager profile only after Hub proof succeeds;
452
+ a failure or cancellation discards the trial and restores the previous profile.
453
+ Its total session polling budget also covers bounded network activation and
454
+ rollback; the Hub proof budget remains 30 seconds after obtaining an IP.
455
+
397
456
  Session states, in order: `connecting`, `awaiting_code`, `securing`,
398
457
  `reading_info`, `awaiting_wifi`, `joining_wifi`, `discovering_lan`,
399
458
  `connecting_lan`, `awaiting_authorization`,
@@ -526,3 +585,21 @@ An older registration for the same device cannot complete a different attempt.
526
585
  active local credential, returning `clientMode: "space"`; this read requires Space
527
586
  MANAGE. A cloud Space has no such local enrollment and returns `registered:false`.
528
587
  Both checks are read-only completion hooks. They do not issue or renew credentials.
588
+
589
+ ### Interrupted combined first Hub
590
+
591
+ A combined product uses the same durable first-Hub network intent and cloud
592
+ recovery permit as [Host provisioning](host-provisioning-v1.md#interrupted-first-hub-installation).
593
+ The secured `pod-info {op:"hostIdentity"}` returns the local Host's
594
+ `{hostId,publicKey:[x,y]}` through OS-private IPC while a network window is open.
595
+ The commissioner retains this identity across BLE-to-LAN handoff and checks it
596
+ against the product's signed binding before any claim or credential delivery.
597
+ The BLE record contains only the public identity and compact intent/permit;
598
+ full Host claim messages and Pod credentials remain on the LAN Security 2 channel.
599
+
600
+ If the Host is already bound and its first-Hub setup is pending, `networkTarget`
601
+ returns `firstHub` with the original intent and Space. Native obtains an online
602
+ Owner permit and submits `bootstrapRecovery`. If no Pod profile has been saved,
603
+ Wi-Fi success continues the defined LAN binding/Hub setup/Pod credential protocol.
604
+ An existing Pod profile keeps the Wi-Fi-only reprovision flow. Neither case
605
+ changes Space or clears the current Host authorization to bypass a failed check.
@@ -17,11 +17,26 @@ Space/Hub selector, grant, certificate or private key is an input/output.
17
17
  Integration and use `/app/integration/connect`. Its constant/input DTO remain
18
18
  readable for older clients; this route cannot enroll a device.
19
19
  - `/app/wave/list`: `{}` -> `{bindings:[{deviceId,grantState}]}`. States are
20
- `candidate` or `committed`; this is authorization bookkeeping, not Device/Twin
21
- inventory, online state or evidence that a candidate committed on the device.
20
+ `candidate`, `committed` or `removing`; this is authorization bookkeeping, not
21
+ Device/Twin inventory, online state or evidence that a candidate committed on the device.
22
22
  - `/app/wave/refresh`: `{deviceId}` -> AdmissionResult. Reconcile the same saved
23
23
  credential, validate full Entity self-description against installed contracts,
24
24
  then use ordinary Twin source synchronization. It cannot open a pairing window.
25
+ - `/app/wave/remove`: `{deviceId,forgetAfterDeviceReset?:boolean}` ->
26
+ `{deviceId,grantState}`. An authenticated App caller with current-Space Manage
27
+ access requests physical grant removal. The optional flag defaults to false.
28
+ `removed` confirms the device revoked the grant and Core cleared the local
29
+ binding. `removing` is a partial outcome retaining an unconfirmed removal.
30
+ Retry can complete while the device still accepts the saved grant. If the
31
+ device already revoked it and its reply was lost, the old credential cannot
32
+ authenticate another attempt, even when the device is reachable. The user
33
+ clears Wave authorization locally on the device, then explicitly confirms
34
+ `forgetAfterDeviceReset:true` to clear this Space's saved binding. A device-wide
35
+ Wave reset also removes its other Space grants. `unbound` means no saved binding
36
+ remains.
37
+ `forgotten` clears its saved local binding without a device revocation reply.
38
+ Clearing a local binding also clears its published inventory. Ordinary
39
+ Integration uninstall remains a separate operation.
25
40
 
26
41
  AdmissionResult is `{deviceId,grantState,inventoryState,entityIds,reason?}`.
27
42
  `inventoryState:ready` means existing inventory synchronization completed;
@@ -229,7 +229,7 @@
229
229
  },
230
230
  {
231
231
  "name": "testing alone does not create smoke incident",
232
- "capabilityId": "basic.device.state.smoke",
232
+ "capabilityId": "basic.device.state.smokeDetector",
233
233
  "observations": [
234
234
  {
235
235
  "sequence": 1,
@@ -243,7 +243,7 @@
243
243
  "sourceUpdatedAt": 1000,
244
244
  "persisted": {
245
245
  "entityId": "sensor",
246
- "capabilityId": "basic.device.state.smoke",
246
+ "capabilityId": "basic.device.state.smokeDetector",
247
247
  "latest": {
248
248
  "sequence": 1,
249
249
  "timestamp": 1000,
@@ -255,7 +255,7 @@
255
255
  },
256
256
  {
257
257
  "name": "smoke testing preserves detected incident",
258
- "capabilityId": "basic.device.state.smoke",
258
+ "capabilityId": "basic.device.state.smokeDetector",
259
259
  "observations": [
260
260
  {
261
261
  "sequence": 1,
@@ -274,7 +274,7 @@
274
274
  "sourceUpdatedAt": 2000,
275
275
  "persisted": {
276
276
  "entityId": "sensor",
277
- "capabilityId": "basic.device.state.smoke",
277
+ "capabilityId": "basic.device.state.smokeDetector",
278
278
  "latest": {
279
279
  "sequence": 2,
280
280
  "timestamp": 2000,
@@ -290,7 +290,7 @@
290
290
  },
291
291
  {
292
292
  "name": "clear ends smoke incident",
293
- "capabilityId": "basic.device.state.smoke",
293
+ "capabilityId": "basic.device.state.smokeDetector",
294
294
  "observations": [
295
295
  {
296
296
  "sequence": 1,
@@ -314,7 +314,7 @@
314
314
  "sourceUpdatedAt": 1000,
315
315
  "persisted": {
316
316
  "entityId": "sensor",
317
- "capabilityId": "basic.device.state.smoke",
317
+ "capabilityId": "basic.device.state.smokeDetector",
318
318
  "latest": {
319
319
  "sequence": 3,
320
320
  "timestamp": 3000,
@@ -192,6 +192,23 @@
192
192
  "lamp-b"
193
193
  ]
194
194
  }
195
+ },
196
+ {
197
+ "definition": "GroupSummary",
198
+ "value": {
199
+ "groupId": "g:11111111-1111-4111-8111-111111111111",
200
+ "name": "Lights",
201
+ "entityType": "basic.device.Device",
202
+ "memberCount": 2,
203
+ "revision": 3,
204
+ "applyState": "ready",
205
+ "createdAt": 1900000000000,
206
+ "updatedAt": 1900000001000,
207
+ "applicationProblem": {
208
+ "code": "GROUP_PRESENTATION_INCOMPLETE",
209
+ "message": "Group name update is incomplete; save the name again"
210
+ }
211
+ }
195
212
  }
196
213
  ],
197
214
  "invalid": [
@@ -20,8 +20,17 @@
20
20
  "productId": "camera",
21
21
  "firmwareVersion": "0.9.0",
22
22
  "fingerprint": "5e6f7a8b0c1d2e3f405162738495a6b7c8d9eaf0123456789abcdef012345678",
23
- "wifiConfigured": false
23
+ "wifiConfigured": false,
24
+ "authorizationMode": "admin",
25
+ "onboardingRequired": false
24
26
  },
25
- "addresses": ["192.168.1.42"],
26
- "claimToken": "q3hX0v2c1mJb9yQe7tL4nK8sP5wR6uA0zD1fG2hI3jM"
27
+ "addresses": [
28
+ "192.168.1.42"
29
+ ],
30
+ "result": {
31
+ "hostId": "host-0f3c9a",
32
+ "wifiConfigured": true,
33
+ "commissioned": true,
34
+ "outcome": "onboarded"
35
+ }
27
36
  }
@@ -16,7 +16,8 @@
16
16
  "connected": true,
17
17
  "connectionStatus": "connected",
18
18
  "hostName": "Living Room Mac",
19
- "version": "1.0.0"
19
+ "version": "1.0.0",
20
+ "ready": true
20
21
  }
21
22
  }
22
23
  }
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "manifest": "mhome.app-facade.v1",
3
- "contractVersion": "1.141.0",
3
+ "contractVersion": "1.146.1",
4
4
  "callSchema": "schema/facade-call.v1.schema.json",
5
5
  "routing": "manifest/routing.v1.json",
6
6
  "routingSchema": "schema/routing.v1.schema.json",
@@ -489,7 +489,8 @@
489
489
  "/app/wave/discover",
490
490
  "/app/wave/pair",
491
491
  "/app/wave/list",
492
- "/app/wave/refresh"
492
+ "/app/wave/refresh",
493
+ "/app/wave/remove"
493
494
  ]
494
495
  },
495
496
  "dashboardWidgetCardCreate": {
@@ -1,5 +1,5 @@
1
1
  {
2
- "contractVersion": "1.141.0",
2
+ "contractVersion": "1.146.1",
3
3
  "operations": {
4
4
  "/app/agent/context/get": "spaceRead",
5
5
  "/app/agent/credit/usage": "spaceRead",
@@ -376,7 +376,8 @@
376
376
  "/app/wave/discover": "spaceManage",
377
377
  "/app/wave/pair": "spaceManage",
378
378
  "/app/wave/list": "spaceManage",
379
- "/app/wave/refresh": "spaceManage"
379
+ "/app/wave/refresh": "spaceManage",
380
+ "/app/wave/remove": "spaceManage"
380
381
  },
381
382
  "nodePrefix": "/app/plugin/",
382
383
  "serviceOperations": [
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "manifest": "mhome.host-provision.targets.v1",
3
- "contractVersion": "1.141.0",
3
+ "contractVersion": "1.146.1",
4
4
  "contract": "contract/host-provisioning-v1.md",
5
5
  "localTargets": [
6
6
  "/local/host/provision/start",
@@ -8,6 +8,7 @@
8
8
  "/local/host/provision/wifi",
9
9
  "/local/host/provision/wifi/scan",
10
10
  "/local/host/provision/status",
11
+ "/local/host/provision/authorize",
11
12
  "/local/host/provision/cancel"
12
13
  ],
13
14
  "eventTargets": [
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "manifest": "mhome.hub.targets.v1",
3
- "contractVersion": "1.141.0",
3
+ "contractVersion": "1.146.1",
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.141.0",
3
+ "contractVersion": "1.146.1",
4
4
  "contract": "contract/pod-commissioning-v1.md",
5
5
  "localTargets": [
6
6
  "/local/pod/discovery/start",
@@ -1,12 +1,16 @@
1
1
  {
2
2
  "manifest": "mhome.app-facade.routing.v1",
3
- "contractVersion": "1.141.0",
3
+ "contractVersion": "1.146.1",
4
4
  "targetPrefix": "/app/",
5
5
  "default": {
6
6
  "execution": "spaceMode"
7
7
  },
8
8
  "matching": "exactBeforePrefix",
9
9
  "placementJsonPointer": "/input/placement",
10
+ "unspacedCloudTargets": [
11
+ "/app/host/metrics",
12
+ "/app/host/permissions/get"
13
+ ],
10
14
  "rules": {
11
15
  "cloudPrefixes": [
12
16
  "/app/space/",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "manifest": "mhome.messaging.targets.v1",
3
- "contractVersion": "1.141.0",
3
+ "contractVersion": "1.146.1",
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.141.0",
3
+ "version": "1.146.1",
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.141.0",
3
+ "contractVersion": "1.146.1",
4
4
  "manifest": "manifest/app-facade.v1.json",
5
5
  "schemas": {
6
6
  "storage": "schema/storage.v1.schema.json",
@@ -171,6 +171,25 @@
171
171
  "updatedAt": {
172
172
  "type": "integer",
173
173
  "minimum": 1
174
+ },
175
+ "applicationProblem": {
176
+ "type": "object",
177
+ "additionalProperties": false,
178
+ "properties": {
179
+ "code": {
180
+ "type": "string",
181
+ "minLength": 1
182
+ },
183
+ "message": {
184
+ "type": "string",
185
+ "minLength": 1
186
+ },
187
+ "details": {}
188
+ },
189
+ "required": [
190
+ "code",
191
+ "message"
192
+ ]
174
193
  }
175
194
  },
176
195
  "required": [
@@ -4,10 +4,22 @@
4
4
  "title": "Native-client Host provisioning session snapshot",
5
5
  "type": "object",
6
6
  "additionalProperties": false,
7
- "required": ["sessionId", "revision", "state", "candidate", "expiresAtMs"],
7
+ "required": [
8
+ "sessionId",
9
+ "revision",
10
+ "state",
11
+ "candidate",
12
+ "expiresAtMs"
13
+ ],
8
14
  "properties": {
9
- "sessionId": { "type": "string", "minLength": 1 },
10
- "revision": { "type": "integer", "minimum": 0 },
15
+ "sessionId": {
16
+ "type": "string",
17
+ "minLength": 1
18
+ },
19
+ "revision": {
20
+ "type": "integer",
21
+ "minimum": 0
22
+ },
11
23
  "state": {
12
24
  "enum": [
13
25
  "connecting",
@@ -16,6 +28,8 @@
16
28
  "reading_info",
17
29
  "awaiting_wifi",
18
30
  "joining_wifi",
31
+ "awaiting_authorization",
32
+ "authorizing",
19
33
  "cancelling",
20
34
  "cancelled",
21
35
  "completed",
@@ -23,19 +37,58 @@
23
37
  "timed_out"
24
38
  ]
25
39
  },
26
- "candidate": { "$ref": "pod-discovery.v1.schema.json#/$defs/candidate" },
27
- "expiresAtMs": { "type": "integer", "minimum": 0 },
40
+ "candidate": {
41
+ "$ref": "pod-discovery.v1.schema.json#/$defs/candidate"
42
+ },
43
+ "expiresAtMs": {
44
+ "type": "integer",
45
+ "minimum": 0
46
+ },
28
47
  "host": {
29
48
  "type": "object",
30
49
  "additionalProperties": false,
31
- "required": ["hostId", "name", "firmwareVersion", "fingerprint", "wifiConfigured"],
50
+ "required": [
51
+ "hostId",
52
+ "name",
53
+ "firmwareVersion",
54
+ "fingerprint",
55
+ "wifiConfigured",
56
+ "authorizationMode",
57
+ "onboardingRequired"
58
+ ],
32
59
  "properties": {
33
- "hostId": { "type": "string", "minLength": 1 },
34
- "name": { "type": "string", "minLength": 1 },
35
- "productId": { "type": "string" },
36
- "firmwareVersion": { "type": "string", "minLength": 1 },
37
- "fingerprint": { "type": "string", "minLength": 1 },
38
- "wifiConfigured": { "type": "boolean" }
60
+ "hostId": {
61
+ "type": "string",
62
+ "minLength": 1
63
+ },
64
+ "name": {
65
+ "type": "string",
66
+ "minLength": 1
67
+ },
68
+ "productId": {
69
+ "type": "string"
70
+ },
71
+ "firmwareVersion": {
72
+ "type": "string",
73
+ "minLength": 1
74
+ },
75
+ "fingerprint": {
76
+ "type": "string",
77
+ "minLength": 1
78
+ },
79
+ "wifiConfigured": {
80
+ "type": "boolean"
81
+ },
82
+ "authorizationMode": {
83
+ "enum": [
84
+ "admin",
85
+ "spaceSelf",
86
+ "spaceDep"
87
+ ]
88
+ },
89
+ "onboardingRequired": {
90
+ "type": "boolean"
91
+ }
39
92
  }
40
93
  },
41
94
  "networks": {
@@ -43,28 +96,46 @@
43
96
  "items": {
44
97
  "type": "object",
45
98
  "additionalProperties": false,
46
- "required": ["ssid", "rssi", "secured"],
99
+ "required": [
100
+ "ssid",
101
+ "rssi",
102
+ "secured"
103
+ ],
47
104
  "properties": {
48
- "ssid": { "type": "string", "minLength": 1 },
49
- "rssi": { "type": "integer" },
50
- "secured": { "type": "boolean" }
105
+ "ssid": {
106
+ "type": "string",
107
+ "minLength": 1
108
+ },
109
+ "rssi": {
110
+ "type": "integer"
111
+ },
112
+ "secured": {
113
+ "type": "boolean"
114
+ }
51
115
  }
52
116
  }
53
117
  },
118
+ "authorization": {
119
+ "$ref": "pod-commission.v1.schema.json#/properties/authorization"
120
+ },
121
+ "enrollment": {
122
+ "$ref": "pod-commission.v1.schema.json#/properties/enrollment"
123
+ },
54
124
  "addresses": {
55
125
  "description": "IPv4 LAN addresses reported by the Host; may be empty",
56
126
  "type": "array",
57
- "items": { "type": "string", "format": "ipv4" }
58
- },
59
- "claimToken": {
60
- "description": "One-time token for the first claim of this Host",
61
- "type": "string",
62
- "pattern": "^[A-Za-z0-9_-]{43}$"
127
+ "items": {
128
+ "type": "string",
129
+ "format": "ipv4"
130
+ }
63
131
  },
64
132
  "error": {
65
133
  "type": "object",
66
134
  "additionalProperties": false,
67
- "required": ["code", "message"],
135
+ "required": [
136
+ "code",
137
+ "message"
138
+ ],
68
139
  "properties": {
69
140
  "code": {
70
141
  "enum": [
@@ -76,48 +147,226 @@
76
147
  "wifi_auth_failed",
77
148
  "wifi_not_found",
78
149
  "wifi_failed",
79
- "session_timeout"
150
+ "lan_unavailable",
151
+ "device_mismatch",
152
+ "session_timeout",
153
+ "issue_failed"
80
154
  ]
81
155
  },
82
- "message": { "type": "string" },
83
- "detail": { "type": "string" }
156
+ "message": {
157
+ "type": "string"
158
+ },
159
+ "detail": {
160
+ "type": "string"
161
+ }
84
162
  }
163
+ },
164
+ "result": {
165
+ "type": "object",
166
+ "additionalProperties": false,
167
+ "required": [
168
+ "hostId",
169
+ "outcome",
170
+ "wifiConfigured",
171
+ "commissioned"
172
+ ],
173
+ "properties": {
174
+ "hostId": {
175
+ "type": "string",
176
+ "minLength": 1
177
+ },
178
+ "wifiConfigured": {
179
+ "const": true
180
+ },
181
+ "commissioned": {
182
+ "const": true
183
+ },
184
+ "hubId": {
185
+ "type": "string",
186
+ "minLength": 1
187
+ },
188
+ "outcome": {
189
+ "enum": [
190
+ "onboarded",
191
+ "wifiUpdated"
192
+ ]
193
+ }
194
+ },
195
+ "allOf": [
196
+ {
197
+ "if": {
198
+ "properties": {
199
+ "outcome": {
200
+ "const": "wifiUpdated"
201
+ }
202
+ }
203
+ },
204
+ "then": {
205
+ "not": {
206
+ "properties": {
207
+ "hubId": {}
208
+ },
209
+ "required": [
210
+ "hubId"
211
+ ]
212
+ }
213
+ }
214
+ }
215
+ ]
85
216
  }
86
217
  },
87
218
  "allOf": [
88
219
  {
89
- "if": { "properties": { "state": { "enum": ["failed", "timed_out"] } } },
90
- "then": { "properties": { "error": {} }, "required": ["error"] }
220
+ "if": {
221
+ "properties": {
222
+ "state": {
223
+ "enum": [
224
+ "failed",
225
+ "timed_out"
226
+ ]
227
+ }
228
+ }
229
+ },
230
+ "then": {
231
+ "properties": {
232
+ "error": {}
233
+ },
234
+ "required": [
235
+ "error"
236
+ ]
237
+ }
91
238
  },
92
239
  {
93
240
  "if": {
94
241
  "properties": {
95
- "state": { "not": { "enum": ["failed", "timed_out", "awaiting_code", "awaiting_wifi"] } }
242
+ "state": {
243
+ "not": {
244
+ "enum": [
245
+ "failed",
246
+ "timed_out",
247
+ "awaiting_code",
248
+ "awaiting_wifi",
249
+ "awaiting_authorization"
250
+ ]
251
+ }
252
+ }
96
253
  }
97
254
  },
98
- "then": { "not": { "properties": { "error": {} }, "required": ["error"] } }
255
+ "then": {
256
+ "not": {
257
+ "properties": {
258
+ "error": {}
259
+ },
260
+ "required": [
261
+ "error"
262
+ ]
263
+ }
264
+ }
99
265
  },
100
266
  {
101
- "if": { "properties": { "state": { "const": "awaiting_code" } }, "required": ["error"] },
102
- "then": { "properties": { "error": { "type": "object", "properties": { "code": { "const": "code_rejected" } } } } }
267
+ "if": {
268
+ "properties": {
269
+ "state": {
270
+ "const": "awaiting_code"
271
+ }
272
+ },
273
+ "required": [
274
+ "error"
275
+ ]
276
+ },
277
+ "then": {
278
+ "properties": {
279
+ "error": {
280
+ "type": "object",
281
+ "properties": {
282
+ "code": {
283
+ "const": "code_rejected"
284
+ }
285
+ }
286
+ }
287
+ }
288
+ }
103
289
  },
104
290
  {
105
- "if": { "properties": { "state": { "const": "awaiting_wifi" } }, "required": ["error"] },
291
+ "if": {
292
+ "properties": {
293
+ "state": {
294
+ "const": "awaiting_wifi"
295
+ }
296
+ },
297
+ "required": [
298
+ "error"
299
+ ]
300
+ },
106
301
  "then": {
107
302
  "properties": {
108
303
  "error": {
109
304
  "type": "object",
110
305
  "properties": {
111
- "code": { "enum": ["wifi_auth_failed", "wifi_not_found", "wifi_failed"] }
306
+ "code": {
307
+ "enum": [
308
+ "wifi_auth_failed",
309
+ "wifi_not_found",
310
+ "wifi_failed"
311
+ ]
312
+ }
112
313
  }
113
314
  }
114
315
  }
115
316
  }
116
317
  },
117
318
  {
118
- "if": { "properties": { "state": { "const": "completed" } } },
119
- "then": { "properties": { "host": {} }, "required": ["host"] },
120
- "else": { "not": { "properties": { "claimToken": {} }, "required": ["claimToken"] } }
319
+ "if": {
320
+ "properties": {
321
+ "state": {
322
+ "const": "completed"
323
+ }
324
+ }
325
+ },
326
+ "then": {
327
+ "properties": {
328
+ "host": {},
329
+ "result": {}
330
+ },
331
+ "required": [
332
+ "host",
333
+ "result"
334
+ ]
335
+ },
336
+ "else": {
337
+ "not": {
338
+ "properties": {
339
+ "result": {}
340
+ },
341
+ "required": [
342
+ "result"
343
+ ]
344
+ }
345
+ }
346
+ },
347
+ {
348
+ "if": {
349
+ "properties": {
350
+ "state": {
351
+ "const": "awaiting_authorization"
352
+ }
353
+ },
354
+ "required": [
355
+ "error"
356
+ ]
357
+ },
358
+ "then": {
359
+ "properties": {
360
+ "error": {
361
+ "type": "object",
362
+ "properties": {
363
+ "code": {
364
+ "const": "issue_failed"
365
+ }
366
+ }
367
+ }
368
+ }
369
+ }
121
370
  }
122
371
  ]
123
372
  }
@@ -54,6 +54,7 @@
54
54
  "properties": {
55
55
  "discovered": { "type": "boolean" },
56
56
  "connected": { "type": "boolean" },
57
+ "ready": { "type": "boolean", "default": false },
57
58
  "connectionStatus": { "type": "string" },
58
59
  "hostName": { "type": "string" },
59
60
  "version": { "type": "string" }
@@ -11,6 +11,7 @@
11
11
  "default",
12
12
  "matching",
13
13
  "placementJsonPointer",
14
+ "unspacedCloudTargets",
14
15
  "rules"
15
16
  ],
16
17
  "properties": {
@@ -42,6 +43,9 @@
42
43
  "placementJsonPointer": {
43
44
  "const": "/input/placement"
44
45
  },
46
+ "unspacedCloudTargets": {
47
+ "$ref": "#/$defs/targetList"
48
+ },
45
49
  "rules": {
46
50
  "type": "object",
47
51
  "additionalProperties": false,