@mhome/app-facade-protocol 1.187.0 → 1.190.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/README.md CHANGED
@@ -373,3 +373,5 @@ unassignment may share one request. Both operations validate the entire batch
373
373
  and commit atomically at the Room owner; a rejected batch has no partial writes.
374
374
  There is no separate single-create or remove-membership Facade.
375
375
  See [Room batch writes](contract/room-writes-v1.md).
376
+
377
+ Automation start/stop receipts follow [the control contract](contract/automation-control-v1.md).
@@ -0,0 +1,18 @@
1
+ # Automation control receipts
2
+
3
+ `/app/automation/start` and `/app/automation/stop` return a control receipt, not a
4
+ promise that a Task Flow is still running or that all actions completed.
5
+
6
+ After the control manager explicitly accepts the control, `accepted` is true.
7
+ A successful post-control observation has `stateStatus: known` and boolean
8
+ `enabled` and `running`. A failed observation has `stateStatus: unknown` and omits
9
+ both flags. Both receipts return Facade `success`; unknown adds the structured
10
+ warning `AUTOMATION_STATE_UNAVAILABLE` scoped to the Automation ID.
11
+
12
+ Input, authority, prerequisite and control failures remain errors. A transport
13
+ failure without a receipt never establishes acceptance. Do not catch those failures
14
+ as unknown observations. Never replay control to repair an observation failure.
15
+ Full/Essential preserve the receipt discriminator and warnings. Clients may issue
16
+ an independent status read; they must not turn unknown into false or retry a start.
17
+
18
+ This operation-specific state does not add a Facade status or a response mode.
@@ -8,6 +8,7 @@ Full and Essential use the same business read scope; UI requests Full.
8
8
  | --- | --- | --- |
9
9
  | `/app/presentation/automation/names/get` | `{ids}`: one or more selected, trimmed/deduplicated IDs | `{automations: {id: label}}`. Missing IDs omitted. Selected definition metadata only; no source downloads, parsing, state, history or graph reads. |
10
10
  | `/app/presentation/automation/list` | `{type: "RECURRING" \| "TASK_FLOW"}` | `{automations}`: current-type regular user programs, with labels, runnable/last-execution/expiry metadata, enabled/running/blocked, last-run `timestamp`, status timestamps and tags. No temporary-program, Group, Widget, snapshot, graph or authored-source expansion. |
11
+ | `/app/presentation/automation/group-candidates/list` | `{}` | `{candidates:[{entityId,name}]}`: runnable regular Recurring programs eligible for Automation Groups. Uses the same eligibility predicate as membership validation; excludes temporary, generated and Group IDs. Reads stored metadata only, without source, runtime state or history. UI displays the returned candidates without rebuilding eligibility. |
11
12
  | `/app/presentation/automation/overview/get` | `{automationId}`: nonblank, trimmed | `{id,name,type,enabled,runnable,lastExecution,blocked,saveIncomplete?,widgets}`. Selected metadata, status, cloud quota display state and owned Widget configuration/current values. No source, graph traversal, running history or snapshots. Missing definition is not-found. |
12
13
  | `/app/presentation/automation/placements/get` | `{automationId}`: nonblank, trimmed | `{canvases:[{id,name,containsAutomation}]}`. Matches both owned Widget-to-Card relations and dedicated Automation Cards by `meta.automationId`, against Canvas leaf IDs including composition members. Backends read current-Space Card records to resolve these business references; responses contain only Canvas labels and membership flags. Retains existing default-canvas initialization when the Space has none. |
13
14
 
@@ -40,7 +41,7 @@ The frontend loads only the active list type, caches visited types within the
40
41
  active Space, applies realtime events to loaded rows, and invalidates inactive
41
42
  caches on incomplete updates or reconnect. Unloaded tab counts are unknown,
42
43
  not zero. Overview and placements are separate on-demand reads. Snapshot panels
43
- continue using `/app/automation/snapshot/list` only when opened.
44
+ continue using `/app/automation/snapshot/list` only when opened. This endpoint returns the newest 100 saved version summaries in both Full and Essential, never executable source or restore configuration. Rollback loads the selected source internally; backup/sync retain independent complete readers.
44
45
 
45
46
  Automation detail includes `runnable` from its already-loaded definition; Group
46
47
  entries omit it. Automation status exposes the current revision's `lastExecution`, when known,
@@ -124,3 +125,5 @@ internal context/condition evaluation and wait setup/cleanup may remain generic.
124
125
  unclassified fatal runtime fault must not reuse a prior handled action's reason.
125
126
  Old generated Plans can remain generic until normal regeneration; no automatic
126
127
  migration is required. The summary is independent of diagnostic-log retention.
128
+
129
+ Selected definition detail parses saved YAML only when its declared metadata is required. Failed optional parsing preserves the known definition and source/hash, attaches an ID-scoped problem, and omits unknown inputVars/descriptionTemplate. Corrupt stored JSON is not an empty source or capability list; strict dependent operations fail rather than rewriting fabricated values. No derived-metadata cache or extra database fields are required.
@@ -21,8 +21,8 @@ emit standard Markdown links using the `meow:` URI scheme:
21
21
  [label](meow://<kind>?<query>)
22
22
  ```
23
23
 
24
- No new producer may emit `<MeowEntity>`, `<MeowAutomation>`, `<MeowWidget>`, or
25
- `<MeowShortcutSuggestion>` XML tags.
24
+ DeepLinks are the only supported chat reference syntax. XML object tags and
25
+ shortcut tags are neither emitted nor interpreted by consumers.
26
26
 
27
27
  | `kind` | Canonical format | Required query params | Optional query params | Scope |
28
28
  | --- | --- | --- | --- | --- |
@@ -30,7 +30,7 @@ No new producer may emit `<MeowEntity>`, `<MeowAutomation>`, `<MeowWidget>`, or
30
30
  | `automation` | `[label](meow://automation?id=<ID>)` | `id` | — | Regular/temporary automations and automation groups |
31
31
  | `widget` | `[label](meow://widget?type=<T>&id=<ID>)` | `type`, `id` | `automation` | Global and automation-owned widgets (aliases `data`, `button`, `circadian` normalize to `basic.widget.*`) |
32
32
  | `route` | `[label](meow://route?url=<base64url>)` | `url` | — | In-app relative path (decoded path must start with `/` and not `//`) |
33
- | `shortcut` | `[prompt](meow://shortcut?phrase=<P>)` | `phrase` | — | Replaces `<MeowShortcutSuggestion>`; interactive shortcut creation prompt |
33
+ | `shortcut` | `[prompt](meow://shortcut?phrase=<P>)` | `phrase` | — | Interactive shortcut creation prompt |
34
34
  | `suggestion` | `[label](meow://suggestion?id=<ID>)` | `id` | — | Reserved for Suggestion references |
35
35
 
36
36
  ## Encoding and decoding rules
@@ -79,24 +79,6 @@ operation targets) separate syntax recognition from business decoding:
79
79
  and a bounded single-line balanced-parenthesis fallback outside code spans
80
80
  and code blocks if a model omits `%20` in `meow://shortcut?phrase=...`.
81
81
 
82
- ## Legacy XML read-only compatibility
83
-
84
- Persisted historical messages and legacy clipboard payloads may contain:
85
-
86
- - `<MeowEntity type="..." name="..." id="..." ...></MeowEntity>`
87
- - `<MeowAutomation id="..." name="..."></MeowAutomation>`
88
- - `<MeowWidget type="..." id="..." name="..." [automation="..."]></MeowWidget>`
89
- - `<MeowShortcutSuggestion shortcut="...">prompt</MeowShortcutSuggestion>`
90
-
91
- Consumers retain read-only parsing compatibility for these historical forms:
92
-
93
- - Decode XML attribute values with HTML entity decoding **once**; do not
94
- percent-decode legacy XML `id` values.
95
- - Treat legacy `name` attributes strictly as plain text (never re-interpret as
96
- HTML or nested Markdown links/actions).
97
- - Never fall back to raw `id` when `name` is empty; use the safe generic kind
98
- label.
99
-
100
82
  ## Per-surface capability matrix
101
83
 
102
84
  | Surface | Supported actionable kinds | Unsupported / unknown `meow://` kinds |
@@ -132,11 +114,7 @@ Outside fenced code blocks, indented code blocks, and inline code spans:
132
114
  Artifact images `![alt](meow-artifact://...)` are untouched.
133
115
  4. External links (`http://`, `https://`, `mailto:`, `tg://`) and all code
134
116
  blocks/inline code spans remain verbatim.
135
- 5. Legacy `<MeowShortcutSuggestion ...>inner</MeowShortcutSuggestion>` projects
136
- to trimmed `inner`.
137
- 6. Legacy `<MeowEntity|MeowAutomation|MeowWidget ...>` projects to HTML-decoded
138
- `name` (or safe generic kind fallback, never exposing `id`).
139
- 7. Projection is idempotent: `project(project(text)) == project(text)`.
117
+ 5. Projection is idempotent: `project(project(text)) == project(text)`.
140
118
 
141
119
  Defense in depth: provider link formatters (such as Telegram HTML and Telegram
142
120
  MarkdownV2) only emit clickable link markup for external schemes (`http://`,
@@ -43,7 +43,12 @@ retry is introduced. Required evidence for a dependent mutation remains required
43
43
  projection fails; the Group's capabilities and Blueprint IDs remain unknown.
44
44
  - Automation detail uses `items: [{requestedId, found, reason?, automation?,
45
45
  problem?}]`, not an uncorrelated automations array. The list endpoint retains
46
- its automations summaries array. Source/internal program ID rejection remains
46
+ its automations summaries array. Automation definitions use the entire Automation
47
+ as the failure boundary: unreadable source, capabilities or exposed declarations
48
+ make that selected item unavailable, with no partial Automation object. Other
49
+ selected Automations remain independent. Tags are an explicit lightweight filter
50
+ exception and may degrade to an empty array. Full/Essential keep the same outcome.
51
+ Source/internal program ID rejection remains
47
52
  request validation; known user program and Automation Group lookups are isolated.
48
53
 
49
54
  - Device and Entity state retain ordered items when a selected Group or observation
@@ -85,8 +85,17 @@ adapters, separate from the shared definition/state/history contracts.
85
85
  batch. No observations, history, related automations or suggestions are loaded.
86
86
 
87
87
  `twin` contains `entityId`, `entityType`, `integration`, `capabilities`,
88
- `blueprintIds`, `attributes`, `available`, and optional `problem`. Attributes use canonical data capability IDs as
88
+ `visibleCapabilities`, `blueprintIds`, `attributes`, `available`, and optional `problem`. Attributes use canonical data capability IDs as
89
89
  keys and preserve typed JSON values, including units, false, zero and empty arrays.
90
+ `capabilities` retains complete callable support, including shadowed dependencies.
91
+ `visibleCapabilities` is the authoritative presentation subset computed from schema
92
+ shadow declarations. Use it to select visible actions and default media entrypoints;
93
+ use complete support to validate their helper operations and input transports. An
94
+ empty visible list is meaningful and must never fall back to the complete list.
95
+ Both lists come from the same Twin projection. Clients do not infer replacement
96
+ from Provider names or capability priorities. Explicit calls are not redirected by
97
+ shadow. Projection changes use the existing entity-update refresh path below.
98
+
90
99
  Only immutable entity-only data is cached here; mutable or parameterized data is
91
100
  invoked explicitly when needed. These reads never fetch providers. A missing key
92
101
  means no cached value is available, not a null/empty result. Group `available` is
@@ -278,8 +278,8 @@
278
278
  },
279
279
  {
280
280
  "id": "code_blocks_and_inline_code_preserved",
281
- "input": "Use `[Lamp](meow://entity?type=basic.device.Device&id=d1)` or ``<MeowEntity id=\"x\" name=\"Y\"></MeowEntity>``.\n\n```md\n[Lamp](meow://entity?type=basic.device.Device&id=d1)\n<MeowShortcutSuggestion shortcut=\"s\">keep</MeowShortcutSuggestion>\n```\n\n [Indented](meow://automation?id=a1)\n\nReal [Lamp](meow://entity?type=basic.device.Device&id=d1).",
282
- "expected": "Use `[Lamp](meow://entity?type=basic.device.Device&id=d1)` or ``<MeowEntity id=\"x\" name=\"Y\"></MeowEntity>``.\n\n```md\n[Lamp](meow://entity?type=basic.device.Device&id=d1)\n<MeowShortcutSuggestion shortcut=\"s\">keep</MeowShortcutSuggestion>\n```\n\n [Indented](meow://automation?id=a1)\n\nReal Lamp."
281
+ "input": "Use `[Lamp](meow://entity?type=basic.device.Device&id=d1)` or ``<example name=\"Y\"></example>``.\n\n```md\n[Lamp](meow://entity?type=basic.device.Device&id=d1)\n<example>keep</example>\n```\n\n [Indented](meow://automation?id=a1)\n\nReal [Lamp](meow://entity?type=basic.device.Device&id=d1).",
282
+ "expected": "Use `[Lamp](meow://entity?type=basic.device.Device&id=d1)` or ``<example name=\"Y\"></example>``.\n\n```md\n[Lamp](meow://entity?type=basic.device.Device&id=d1)\n<example>keep</example>\n```\n\n [Indented](meow://automation?id=a1)\n\nReal Lamp."
283
283
  },
284
284
  {
285
285
  "id": "unclosed_backtick_does_not_suppress_projection",
@@ -287,8 +287,8 @@
287
287
  "expected": "Note ` unclosed backtick then Lamp."
288
288
  },
289
289
  {
290
- "id": "legacy_xml_tags_and_multiline_shortcut",
291
- "input": "Checked <MeowEntity type=\"basic.device.Device\" name=\"Kitchen &amp; Bar\" id=\"secret_1\"></MeowEntity>, <MeowAutomation id=\"secret_2\" name=\"\"></MeowAutomation>, <MeowWidget type=\"basic.widget.DataWidget\" id=\"secret_3\" name=\"Temp\"/>.\n<MeowShortcutSuggestion shortcut=\"weather\">\nWant a shortcut\nfor weather?\n</MeowShortcutSuggestion>",
290
+ "id": "multiline_shortcut_label",
291
+ "input": "Checked [Kitchen & Bar](meow://entity?type=basic.device.Device&id=secret_1), [](meow://automation?id=secret_2), [Temp](meow://widget?type=basic.widget.DataWidget&id=secret_3).\n[Want a shortcut\nfor weather?](meow://shortcut?phrase=weather)",
292
292
  "expected": "Checked Kitchen & Bar, automation, Temp.\nWant a shortcut\nfor weather?"
293
293
  },
294
294
  {
@@ -300,6 +300,26 @@
300
300
  "id": "opaque_id_special_chars",
301
301
  "input": "Fixed [Sensor](meow://entity?type=basic.device.Device&id=p%3Aa%26b%25c+d%281%29).",
302
302
  "expected": "Fixed Sensor."
303
+ },
304
+ {
305
+ "id": "unicode_before_final_definition_lf",
306
+ "input": "# 灯\n[r]: meow://automation?id=a1",
307
+ "expected": "# 灯"
308
+ },
309
+ {
310
+ "id": "emoji_before_final_definition_lf",
311
+ "input": "# 😀\n[r]: meow://automation?id=a1",
312
+ "expected": "# 😀"
313
+ },
314
+ {
315
+ "id": "unicode_before_final_definition_crlf",
316
+ "input": "# 灯\r\n[r]: meow://automation?id=a1",
317
+ "expected": "# 灯"
318
+ },
319
+ {
320
+ "id": "unicode_definition_with_final_newline",
321
+ "input": "# 灯\n[r]: meow://automation?id=a1\n",
322
+ "expected": "# 灯\n"
303
323
  }
304
324
  ]
305
325
  }
@@ -430,9 +430,6 @@
430
430
  "snapshotId": "v1",
431
431
  "createdAt": 90,
432
432
  "description": "Prior behavior",
433
- "script": {
434
- "script": "private"
435
- },
436
433
  "automationType": "TASK_FLOW"
437
434
  }
438
435
  ]
@@ -4006,13 +4003,17 @@
4006
4003
  "data": {
4007
4004
  "automationId": "a",
4008
4005
  "enabled": true,
4009
- "running": false
4006
+ "running": false,
4007
+ "accepted": true,
4008
+ "stateStatus": "known"
4010
4009
  },
4011
4010
  "status": "success",
4012
4011
  "essential": {
4013
4012
  "automationId": "a",
4014
4013
  "enabled": true,
4015
- "running": false
4014
+ "running": false,
4015
+ "accepted": true,
4016
+ "stateStatus": "known"
4016
4017
  }
4017
4018
  },
4018
4019
  {
@@ -4030,13 +4031,17 @@
4030
4031
  "data": {
4031
4032
  "automationId": "a",
4032
4033
  "enabled": false,
4033
- "running": false
4034
+ "running": false,
4035
+ "accepted": true,
4036
+ "stateStatus": "known"
4034
4037
  },
4035
4038
  "status": "success",
4036
4039
  "essential": {
4037
4040
  "automationId": "a",
4038
4041
  "enabled": false,
4039
- "running": false
4042
+ "running": false,
4043
+ "accepted": true,
4044
+ "stateStatus": "known"
4040
4045
  }
4041
4046
  },
4042
4047
  {
@@ -7035,5 +7040,35 @@
7035
7040
  }
7036
7041
  ]
7037
7042
  }
7043
+ },
7044
+ {
7045
+ "name": "/app/automation/start accepted with unavailable observation",
7046
+ "target": "/app/automation/start",
7047
+ "data": {
7048
+ "automationId": "a",
7049
+ "accepted": true,
7050
+ "stateStatus": "unknown"
7051
+ },
7052
+ "status": "success",
7053
+ "essential": {
7054
+ "automationId": "a",
7055
+ "accepted": true,
7056
+ "stateStatus": "unknown"
7057
+ }
7058
+ },
7059
+ {
7060
+ "name": "/app/automation/stop accepted with unavailable observation",
7061
+ "target": "/app/automation/stop",
7062
+ "data": {
7063
+ "automationId": "a",
7064
+ "accepted": true,
7065
+ "stateStatus": "unknown"
7066
+ },
7067
+ "status": "success",
7068
+ "essential": {
7069
+ "automationId": "a",
7070
+ "accepted": true,
7071
+ "stateStatus": "unknown"
7072
+ }
7038
7073
  }
7039
7074
  ]
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "manifest": "mhome.app-facade.v1",
3
- "contractVersion": "1.187.0",
3
+ "contractVersion": "1.190.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",
@@ -354,6 +354,7 @@
354
354
  "uiRequestTargets": [
355
355
  "/app/presentation/automation/names/get",
356
356
  "/app/presentation/automation/list",
357
+ "/app/presentation/automation/group-candidates/list",
357
358
  "/app/presentation/automation/overview/get",
358
359
  "/app/presentation/automation/placements/get",
359
360
  "/app/presentation/automation/summaries/get",
@@ -1,5 +1,5 @@
1
1
  {
2
- "contractVersion": "1.187.0",
2
+ "contractVersion": "1.190.0",
3
3
  "operations": {
4
4
  "/app/agent/context/get": "spaceRead",
5
5
  "/app/agent/conversation/get": "spaceRead",
@@ -242,6 +242,7 @@
242
242
  "/app/presentation/automation/generated/enable": "spaceWrite",
243
243
  "/app/presentation/automation/generated/run": "spaceWrite",
244
244
  "/app/presentation/automation/list": "spaceRead",
245
+ "/app/presentation/automation/group-candidates/list": "spaceRead",
245
246
  "/app/presentation/automation/names/get": "spaceRead",
246
247
  "/app/presentation/automation/overview/cancel": "spaceWrite",
247
248
  "/app/presentation/automation/overview/config/provide": "spaceWrite",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "manifest": "mhome.host-provision.targets.v1",
3
- "contractVersion": "1.187.0",
3
+ "contractVersion": "1.190.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.187.0",
3
+ "contractVersion": "1.190.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.187.0",
3
+ "contractVersion": "1.190.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.187.0",
3
+ "contractVersion": "1.190.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.187.0",
3
+ "contractVersion": "1.190.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.187.0",
3
+ "version": "1.190.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.187.0",
3
+ "contractVersion": "1.190.0",
4
4
  "manifest": "manifest/app-facade.v1.json",
5
5
  "schemas": {
6
6
  "dashboardCardAuthoring": "schema/dashboard-card-authoring.v1.schema.json",
@@ -43,6 +43,15 @@
43
43
  "type": "string",
44
44
  "pattern": "\\S"
45
45
  },
46
+ "accepted": {
47
+ "const": true
48
+ },
49
+ "stateStatus": {
50
+ "enum": [
51
+ "known",
52
+ "unknown"
53
+ ]
54
+ },
46
55
  "enabled": {
47
56
  "type": "boolean"
48
57
  },
@@ -52,8 +61,42 @@
52
61
  },
53
62
  "required": [
54
63
  "automationId",
55
- "enabled",
56
- "running"
64
+ "accepted",
65
+ "stateStatus"
66
+ ],
67
+ "oneOf": [
68
+ {
69
+ "properties": {
70
+ "stateStatus": {
71
+ "const": "known"
72
+ }
73
+ },
74
+ "required": [
75
+ "enabled",
76
+ "running"
77
+ ]
78
+ },
79
+ {
80
+ "properties": {
81
+ "stateStatus": {
82
+ "const": "unknown"
83
+ }
84
+ },
85
+ "not": {
86
+ "anyOf": [
87
+ {
88
+ "required": [
89
+ "enabled"
90
+ ]
91
+ },
92
+ {
93
+ "required": [
94
+ "running"
95
+ ]
96
+ }
97
+ ]
98
+ }
99
+ }
57
100
  ]
58
101
  },
59
102
  "renameInput": {