@mhome/app-facade-protocol 1.138.0 → 1.140.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/contract/dashboard-widget-card-create-v1.md +37 -0
- package/contract/pod-commissioning-v1.md +7 -4
- package/contract/resource-read-v1.md +4 -1
- package/manifest/app-facade.v1.json +5 -1
- package/manifest/authorization.v1.json +2 -1
- package/manifest/host-provision-targets.v1.json +1 -1
- package/manifest/hub-targets.v1.json +1 -1
- package/manifest/pod-targets.v1.json +1 -1
- package/manifest/routing.v1.json +1 -1
- package/manifest/targets.v1.json +1 -1
- package/package.json +1 -1
- package/protocol.json +1 -1
|
@@ -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.
|
|
@@ -324,7 +324,7 @@ never show these values or `message` verbatim.
|
|
|
324
324
|
| `/local/pod/commission/code` | `{"sessionId","code"}` | session snapshot |
|
|
325
325
|
| `/local/pod/commission/wifi` | `{"sessionId","ssid","password"?,"enrollment"?}` | session snapshot |
|
|
326
326
|
| `/local/pod/commission/wifi/scan` | `{"sessionId"}` | session snapshot |
|
|
327
|
-
| `/local/pod/commission/authorize` | `{"sessionId","spaceId"}` | session snapshot |
|
|
327
|
+
| `/local/pod/commission/authorize` | `{"sessionId","spaceId","clientMode","firstHub"?}` | session snapshot |
|
|
328
328
|
| `/local/pod/commission/status` | `{}` | `{"session": snapshot or null}` |
|
|
329
329
|
| `/local/pod/bluetooth/settings` | `{}` | `{"opened"}` |
|
|
330
330
|
|
|
@@ -353,9 +353,12 @@ only after receiving a setup target or when in its authorized reprovision
|
|
|
353
353
|
window. It verifies a selected Hub from the new Wi-Fi before committing the
|
|
354
354
|
network. The Client later authorizes the exact enrollment selected before the
|
|
355
355
|
trial and rejects a credential from a different Hub.
|
|
356
|
-
`bootstrap`
|
|
357
|
-
|
|
358
|
-
|
|
356
|
+
`bootstrap` requires explicit `firstHub: true` and a verified product with an
|
|
357
|
+
embedded dependent Host. The selected Space must have no existing Hub or
|
|
358
|
+
pending Hub transition. For BLE, include the flag in `enrollment` before sending
|
|
359
|
+
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.
|
|
359
362
|
|
|
360
363
|
Discovery is shared by every MeowLink device kind: each candidate carries
|
|
361
364
|
`kind` (`pod` or `host`). `/local/pod/commission/start` accepts only `pod`
|
|
@@ -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
|
-
|
|
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.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"manifest": "mhome.app-facade.v1",
|
|
3
|
-
"contractVersion": "1.
|
|
3
|
+
"contractVersion": "1.140.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.
|
|
2
|
+
"contractVersion": "1.140.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",
|
package/manifest/routing.v1.json
CHANGED
package/manifest/targets.v1.json
CHANGED
package/package.json
CHANGED