@mhome/app-facade-protocol 1.137.2 → 1.139.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.
@@ -0,0 +1,37 @@
1
+ # Create Widgets and add them to a Canvas
2
+
3
+ `/app/dashboard/card/widget/create` is a direct, Space-write operation executed by
4
+ the backend that owns the Space. Dashboard clients call it directly. It takes a destination Canvas, a title, and one
5
+ or more ordered Data or Button Widget definitions. A definition uses the
6
+ corresponding standalone create fields, with no existing Widget ID. Dry runs
7
+ are unsupported.
8
+
9
+ ```json
10
+ {
11
+ "canvasId": "canvas-home",
12
+ "title": "Evening",
13
+ "widgets": [
14
+ {"type": "button", "definition": {"displayName": "Evening", "label": "Run"}},
15
+ {"type": "data", "definition": {"displayName": "Target", "dataType": "Number", "repeated": false}}
16
+ ]
17
+ }
18
+ ```
19
+
20
+ Validate the definitions, destination, and prospective card before writing.
21
+ Create the Widgets in order, stopping at the first failed or unconfirmed write.
22
+ Publish a single Card in the Canvas only after all Widgets and Card references
23
+ are ready. Any Widget whose creation is confirmed remains available as an ordinary
24
+ Space resource. To place existing Widgets, use `/app/dashboard/card/add` with
25
+ `source.kind: "widget"` and their existing IDs.
26
+
27
+ Success returns `data: {spaceId, canvasId, createdWidgetIds, cardId}`.
28
+ If at least one Widget was created and the entire operation did not complete,
29
+ return `partial` with `data: {spaceId, canvasId, createdWidgetIds, issue}`.
30
+ The issue identifies `stage` (`widget` or `card`), `outcome` (`notCommitted` or
31
+ `unconfirmed`), and the zero-based `widgetIndex` for a Widget write. A rejected
32
+ operation before any confirmed creation is an error. If the first write fails or is
33
+ unconfirmed, the error uses `TEMPORARY_UNAVAILABLE` with the issue in `error.details`.
34
+ Full and Essential retain the same facts. Essential renders the receipt as YAML.
35
+
36
+ Notification failures do not undo a confirmed write. After an unconfirmed
37
+ response, read Dashboard and Widget state before creating anything again.
@@ -85,8 +85,8 @@ Fallback characteristic UUIDs: the standard endpoints as for pods, `host-info`
85
85
  ```
86
86
 
87
87
  `productId` is optional. `onboardingRequired` reports whether this Host still
88
- awaits its first claim. `networkOnline` reports current LAN readiness. Both
89
- are optional for older Hosts. A securely paired Host with `networkOnline: true`
88
+ awaits its first claim and is required. `networkOnline` reports current LAN
89
+ readiness. A securely paired Host with `networkOnline: true`
90
90
  and `onboardingRequired: true` can finish without resubmitting Wi-Fi. `finish`
91
91
  issues a fresh first-claim token after checking authoritative Host ownership.
92
92
  Already claimed Hosts never issue a new first-claim token.
@@ -102,7 +102,8 @@ Fallback characteristic UUIDs: the standard endpoints as for pods, `host-info`
102
102
  established and the Host is not recovering an unfinished claim on a working
103
103
  network. Refusal keeps the current setup session open. The Client reports
104
104
  completion only after a positive receipt, with a valid token when the secured
105
- Host information indicated that first claim was pending.
105
+ Host information indicated that first claim was pending. A receipt that
106
+ unexpectedly carries a token for an already claimed Host also fails.
106
107
  `finish` ends the central's setup session. Without it, the Host disconnects the
107
108
  central 30 seconds after a successful join; the commissioner retries `finish`
108
109
  within that window. Network readiness and mDNS announcement do not establish
@@ -120,11 +121,12 @@ and stop at `result_count` or on an empty page. This also works with ESP-IDF
120
121
  devices, which return exactly the requested entries (commissioners ask for at
121
122
  most 4 at a time).
122
123
 
123
- `prov-config` status reports `connected` with the IPv4 address once the Host is
124
- on the LAN (the address may be empty when the Host has none yet); `connection_failed` with `auth_error` or `network_not_found` when
125
- the join failed. After a failed join the commissioner sends `prov-ctrl` reset
126
- before the next `set_config`. In a re-provision window the previous network
127
- stays saved until the new one connects.
124
+ `prov-config` status reports `connected` with the IPv4 address after the Host
125
+ 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
127
+ to reactivate the previous one. `connection_failed` may distinguish
128
+ `auth_error` or `network_not_found`. After a failed join the commissioner sends
129
+ `prov-ctrl` reset before the next `set_config`.
128
130
 
129
131
  ## 4. Native Client targets
130
132
 
@@ -161,9 +163,12 @@ Session states, in order: `connecting`, `awaiting_code`, `securing`,
161
163
  `timed_out`, `cancelled`; transitional `cancelling`. `completed` carries `host`, the reported `addresses`
162
164
  (IPv4 only, possibly empty) and `claimToken` from the `finish` response; the
163
165
  commissioner sends `finish` (up to 3 times while the secure session lasts)
164
- before reporting it. `claimToken` is absent when `finish` could not be
165
- delivered, in a re-provision window.
166
- No other state carries `claimToken`.
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`.
167
172
 
168
173
  The first claim (TOFU) after BLE provisioning must include the returned token.
169
174
  Native `host.claim` passes it to `POST /v1/auth/claim`, alongside the environment,
@@ -194,13 +199,14 @@ The schema is `schema/host-provision.v1.schema.json`.
194
199
  setup after restart, keeping saved Wi-Fi. Network readiness is not ownership.
195
200
  An existing local claim, including one awaiting cloud confirmation, must never
196
201
  reopen first-claim authority. An unreadable ownership store refuses recovery.
197
- - Re-provision window: opened from the Host's local interface (display settings
198
- or `meowhostd provision open`). Mutating local provisioning commands (`open`,
202
+ - Re-provision window: opened on the target Host with `meow host provision open`.
203
+ The CLI talks directly to the Host's local control socket, without a Client
204
+ daemon. Mutating local provisioning commands (`open`,
199
205
  `close`, `factory-reset`) require root or membership in the `meow-admin`
200
206
  group (checked with the peer credentials of the local control socket); status
201
- stays readable by the same user. The command help says to use `sudo`. Wi-Fi only; Host identity, owners and services
202
- are kept. Closes after a successful join, on `meowhostd provision close`, or
203
- after 10 minutes.
207
+ is available with `meow host provision status`.
208
+ Host identity, owners and services are kept. The window closes after a
209
+ successful join, on `meow host provision close`, or after 10 minutes.
204
210
  - Factory reset: from the local interface (`meowhostd factory-reset`). Stops
205
211
  services, forgets saved Wi-Fi on BLE provisioning appliances, erases owners,
206
212
  the Host security store and bootstrap key, and returns to first provisioning.
@@ -52,7 +52,10 @@ visible Card `presents` a resource, and generated Automation `implements` Device
52
52
  Generated program references are not editable user programs. Existing Managers and
53
53
  indexes own these relationships; this read introduces no graph database or traversal.
54
54
  It returns IDs, not recursively expanded definitions, scripts, names or runtime data.
55
- Hidden Device render anchors are not public Card references.
55
+ Public Card references require committed membership in a Dashboard Canvas or Pod Deck.
56
+ Card bodies and relations can be written before placement. The graph only exposes
57
+ them after placement. Hidden Device render anchors still supply generated Automation
58
+ relationships.
56
59
 
57
60
  Full uses the standard `{status, data}` result with structured business data. Essential
58
61
  uses the same envelope with YAML `data`; timestamps are presented in the Home timezone.
@@ -5,7 +5,7 @@ policy. They are not Agent/CLI/MCP tools. Inputs reject unknown fields.
5
5
 
6
6
  | Target | Input | Business output and read boundary |
7
7
  | --- | --- | --- |
8
- | `/app/presentation/widget/list` | Required `{type: "data" \| "button" \| "circadian"}` | `{items, automationNames}`. Reads only that type's Widget table. Global standalone Widgets, defaults and Automation-owned parameters are included; card interiors, Twin and weather internals are excluded. Owner labels use one selected metadata batch, only for returned Automation owners. No script, relation, history or all-type reads. |
8
+ | `/app/presentation/widget/list` | Required `{type: "data" \| "button" \| "circadian"}` | `{items, automationNames}`. Reads only that type's Widget table. Global standalone Widgets, defaults and Automation-owned parameters are included. Active card interiors, Twin and weather internals are excluded. Pending Data, Button and Circadian Widgets eligible for manual deletion are included for cleanup, regardless of their usual visibility. Owner labels use one selected metadata batch, only for returned Automation owners. No script, relation, history or all-type reads. |
9
9
  | `/app/presentation/widget/names/get` | `{ids}`: 1–100 selected, trimmed, deduplicated IDs | `{names: {id: displayName}}`. Missing/blank names omitted. Only selected Widget rows; no legacy `name` fallback. |
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
 
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "manifest": "mhome.app-facade.v1",
3
- "contractVersion": "1.137.2",
3
+ "contractVersion": "1.139.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",
@@ -492,6 +492,10 @@
492
492
  "/app/wave/refresh"
493
493
  ]
494
494
  },
495
+ "dashboardWidgetCardCreate": {
496
+ "contract": "contract/dashboard-widget-card-create-v1.md",
497
+ "requestTargets": ["/app/dashboard/card/widget/create"]
498
+ },
495
499
  "dashboardComposition": {
496
500
  "layoutSchema": "schema/canvas-layout.v1.schema.json",
497
501
  "commandSchema": "schema/dashboard-composition.v1.schema.json",
@@ -1,5 +1,5 @@
1
1
  {
2
- "contractVersion": "1.137.2",
2
+ "contractVersion": "1.139.0",
3
3
  "operations": {
4
4
  "/app/agent/context/get": "spaceRead",
5
5
  "/app/agent/credit/usage": "spaceRead",
@@ -80,6 +80,7 @@
80
80
  "/app/dashboard/card/list": "spaceRead",
81
81
  "/app/dashboard/card/main-view/update": "spaceWrite",
82
82
  "/app/dashboard/card/move": "spaceWrite",
83
+ "/app/dashboard/card/widget/create": "spaceWrite",
83
84
  "/app/developer/contracts/export": "spaceRead",
84
85
  "/app/developer/contracts/list": "spaceRead",
85
86
  "/app/device/activity/recent/list": "spaceRead",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "manifest": "mhome.host-provision.targets.v1",
3
- "contractVersion": "1.137.2",
3
+ "contractVersion": "1.139.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.137.2",
3
+ "contractVersion": "1.139.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.137.2",
3
+ "contractVersion": "1.139.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.137.2",
3
+ "contractVersion": "1.139.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.137.2",
3
+ "contractVersion": "1.139.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.137.2",
3
+ "version": "1.139.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.137.2",
3
+ "contractVersion": "1.139.0",
4
4
  "manifest": "manifest/app-facade.v1.json",
5
5
  "schemas": {
6
6
  "storage": "schema/storage.v1.schema.json",