@mhome/app-facade-protocol 1.138.0 → 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.
@@ -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.
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "manifest": "mhome.app-facade.v1",
3
- "contractVersion": "1.138.0",
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.138.0",
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.138.0",
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.138.0",
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.138.0",
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.138.0",
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.138.0",
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.138.0",
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.138.0",
3
+ "contractVersion": "1.139.0",
4
4
  "manifest": "manifest/app-facade.v1.json",
5
5
  "schemas": {
6
6
  "storage": "schema/storage.v1.schema.json",