@mhome/app-facade-protocol 1.171.1 → 1.173.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
@@ -159,10 +159,10 @@ Room uses one `/app/room/list` read. Every Room has `roomId`, `roomName`,
159
159
  Membership IDs include Device groups without expanding their members or state.
160
160
 
161
161
  Room writes use `/app/room/create`, `/rename`, `/delete`, `/reorder`,
162
- `/devices/move`, and `/devices/remove` under the same `/app/room` prefix.
162
+ `/devices/move` under the same `/app/room` prefix.
163
163
  Reorder accepts every current Room ID exactly once in the desired order.
164
- Moves require a destination for each unique member ID; removal explicitly unassigns
165
- members. Repeating a move or removal is a successful no-op. Deleting a Room
164
+ Moves require an explicit destination for each unique member ID; null unassigns
165
+ members. Repeating an assignment or unassignment is a successful no-op. Deleting a Room
166
166
  unassigns its members without deleting Devices or Device groups. Only deletion
167
167
  supports the prepared confirmation flow; other writes execute directly.
168
168
  Room write inputs use their declared fields and JSON string IDs/names; legacy fields
@@ -363,3 +363,13 @@ The caller keeps the original business arguments separately for a status request
363
363
  Neither arguments nor form values/credentials are copied into the receipt.
364
364
  A successful status query does not imply business completion. Accepted input must
365
365
  be inspected with the original invocation; never replay a write to obtain a result.
366
+
367
+ Room creation accepts `{roomNames: ["Kitchen", "Bedroom"]}` (1–99 names) and
368
+ returns `{rooms: [...]}` in input order, including IDs, names, order and membership.
369
+ A single Room uses a one-element array. `/app/room/devices/move` accepts one entry
370
+ per Device or Device group: `{deviceId, toRoomId}`. `toRoomId` is required: a
371
+ nonempty Room ID assigns it, explicit `null` unassigns it. Assignment and
372
+ unassignment may share one request. Both operations validate the entire batch
373
+ and commit atomically at the Room owner; a rejected batch has no partial writes.
374
+ There is no separate single-create or remove-membership Facade.
375
+ See [Room batch writes](contract/room-writes-v1.md).
@@ -102,3 +102,13 @@ disable alone preserve it. Out-of-order reports cannot replace a newer result.
102
102
  The small activity summary is independent of detailed diagnostic retention and does
103
103
  not add an activity-history row. Suppression follows the existing runtime outcome;
104
104
  there is no separate suppressed terminal state. The durable `corrupted` flag is removed.
105
+
106
+ `lastExecution.failureCode` is optional. `FAILED` with `failureCode: SUPPRESSED`
107
+ means the whole Automation execution was blocked by its entry/resume suppression
108
+ gate. UI may render this as "Suppressed" without changing the outcome. An internal
109
+ command/member failure never supplies this classification, even when its own error
110
+ code is SUPPRESSED. Internal errors are not aggregated into this reason. A resume
111
+ gate may block a run after earlier actions have completed; the reason describes
112
+ that gate's rejection, not whether any prior action succeeded. Rule-store/evaluation
113
+ failures, older summaries and unknown reasons retain the ordinary outcome label.
114
+ The marker uses the existing summary independently of diagnostic-log retention.
@@ -151,3 +151,13 @@ disable alone preserve it. Out-of-order reports cannot replace a newer result.
151
151
  The small activity summary is independent of detailed diagnostic retention and does
152
152
  not add an activity-history row. Suppression follows the existing runtime outcome;
153
153
  there is no separate suppressed terminal state. The durable `corrupted` flag is removed.
154
+
155
+ `lastExecution.failureCode` is optional. `FAILED` with `failureCode: SUPPRESSED`
156
+ means the whole Automation execution was blocked by its entry/resume suppression
157
+ gate. UI may render this as "Suppressed" without changing the outcome. An internal
158
+ command/member failure never supplies this classification, even when its own error
159
+ code is SUPPRESSED. Internal errors are not aggregated into this reason. A resume
160
+ gate may block a run after earlier actions have completed; the reason describes
161
+ that gate's rejection, not whether any prior action succeeded. Rule-store/evaluation
162
+ failures, older summaries and unknown reasons retain the ordinary outcome label.
163
+ The marker uses the existing summary independently of diagnostic-log retention.
@@ -0,0 +1,36 @@
1
+ # Room batch writes
2
+
3
+ `/app/room/create` accepts only `{roomNames: string[]}`. Tenant and Space come
4
+ from authenticated context. Supply 1–99 nonblank names; names are trimmed and
5
+ compared case-insensitively against the batch and current Rooms. Duplicate or
6
+ existing names reject the entire batch. The response is `{rooms: RoomInfo[]}`
7
+ in input order. Each RoomInfo contains `roomId`, `roomName`, `index`,
8
+ `deviceCount` and `deviceIds`. New Rooms follow the highest current index.
9
+ One Room uses the same one-element array and result shape.
10
+
11
+ `/app/room/devices/move` accepts `{entries: [{deviceId, toRoomId}]}`. IDs are
12
+ nonempty and unique after trimming. Each entry must explicitly contain
13
+ `toRoomId`: a nonblank string assigns the Device or Device group to that Room;
14
+ `null` removes its Room assignment. Missing, blank and nonstring destinations
15
+ are invalid. Assignment and unassignment can be mixed in one request. Assigning
16
+ a Group does not assign its members. Removing an assignment may clean stale
17
+ references without requiring that Device still exist.
18
+
19
+ Both use the Room owner's existing lock, revision check and database transaction.
20
+ Validate the complete request before persisting any change. Retry only definite
21
+ revision conflicts with the same created identities and the latest snapshot;
22
+ never turn an uncertain commit into an automatic business retry. A validation
23
+ error or definite transaction failure leaves all previous Room rows unchanged.
24
+ Cloud transactions retain the existing maximum of 99 changed Room records plus
25
+ the revision record. No client-side splitting or fallback to individual writes.
26
+
27
+ Move returns `moved`, `unchanged` and `notMoved` arrays. They preserve input order
28
+ within each partition. Null destinations omit `toRoomId` and `toRoomName` in
29
+ results; `moved` includes changed unassignments, and `unchanged` includes IDs
30
+ already unassigned. Current atomic execution has no per-item rejected writes:
31
+ `notMoved` is empty on success, and rejection returns an ordinary error.
32
+ Full retains the business DTO. Essential serializes the same write-result fields
33
+ to YAML. CLI, Agent, MCP and UI do not rebuild business outcomes.
34
+
35
+ The old singular `roomName` creation input and `/app/room/devices/remove` route
36
+ are removed. There is no compatibility dispatch, schema or client alias.
@@ -9,7 +9,7 @@ separately. Existing conversation and Now Attention protocols are unchanged.
9
9
 
10
10
  - Foundation owns these DTOs, strict schemas and shared conformance fixtures.
11
11
  - Agent owns SuggestionGenerator: prompts, allowed read/validation tools,
12
- analysis, type-specific generation and validation. Automation is the first
12
+ analysis, natural-language intent and adoption-time draft generation. Automation is the first
13
13
  production content type, not a restriction of the common framework.
14
14
  - The backend responsible for a Space (Core or Lion) owns admission, budgets,
15
15
  authorization, persistence, run completion, feedback and business handlers.
@@ -34,6 +34,7 @@ chat surfaces and threads. Its trigger selects payment attribution:
34
34
  | Trigger | Payer | Result owner |
35
35
  | --- | --- | --- |
36
36
  | `EXPLICIT`, verified requesting `userId` | That user | The Space |
37
+ | `ADOPTION`, verified `principal` | Requesting User, or the current owner for a Space principal | The Space |
37
38
  | `SCHEDULED` | Current Space owner, resolved by the billing adapter | The Space |
38
39
 
39
40
  For example, if owner Alice and member Bob share a Space, a periodic run bills
@@ -53,7 +54,7 @@ Space access. Shape validation cannot substitute for those checks.
53
54
  ## Cloud transport
54
55
 
55
56
  The existing authenticated execution envelope has a `suggestion` family with
56
- `generate`, `read`, `completed`, `failed` and `cancel` messages. Each carries the
57
+ `generate`, `adopt`, `read`, `completed`, `failed` and `cancel` messages. Each carries the
57
58
  trusted Suggestion invocation and existing dispatch/session binding, without
58
59
  inventing a conversation identity. `generate` freezes the collected input, facts
59
60
  and model plan. `completed` carries registered result documents, candidate
@@ -104,23 +105,28 @@ spell out that set because JavaScript `\s` treats NEXT LINE and BOM differently.
104
105
 
105
106
  ## Automation content
106
107
 
107
- `AUTOMATION` adds `operation`, `automationId`, `baseScriptHash` and `script`.
108
+ `AUTOMATION` adds `operation`, `request`, optional `automationId` and optional
109
+ `relatedAutomationIds`. `request` describes the proposed behavior in natural language.
110
+ CREATE has no target ID; UPDATE names the existing Automation. No script or source
111
+ hash is generated or stored in the proposal.
108
112
 
109
- - `CREATE` has no existing Automation ID or base hash.
110
- - `UPDATE` requires both the existing ID and the hash of its source at generation.
111
- - `script` preserves the complete existing AutomationScript object: main `script`,
112
- auxiliary `scripts`, optional `sdkVersion` and optional `parseResults`.
113
- - The final source bundle must pass the existing Automation verifier before the
114
- Suggestion is published. Nonempty source or model-supplied parse results do not
115
- constitute verification. No Automation is saved/enabled during generation.
116
- - Applying an update checks the base hash within the existing editing boundary.
117
- It must not overwrite an intervening user change after a separate stale check.
113
+ Adoption uses a separately authorized `ADOPTION` invocation and the current Chat
114
+ model mapping, frozen at start. It reads current Automation source, generates and
115
+ verifies an ephemeral draft through the existing read-only workflow. The host saves
116
+ that draft; UPDATE checks the hash read during this adoption inside the editor's
117
+ atomic write boundary. An earlier change since discovery does not reject adoption;
118
+ a change during generation must not be overwritten. Background discovery continues
119
+ to use the Suggestion model and its own schedule/context watermark.
118
120
 
119
121
  The first Automation handler declares `APPLY`: a newly created Automation is
120
122
  saved and enabled; an update preserves the existing Automation's enabled or
121
123
  stopped state within the editing boundary. A deliberately stopped Automation must
122
124
  not be re-enabled by applying an update. UI labels state the resulting action.
123
- Handling is one-shot. After an admitted action ends, its Suggestion is `RESOLVED`
125
+ Handling is one-shot. Admission returns `PROCESSING`; the detail and list show the
126
+ processing state until its durable receipt settles. The bounded owner survives caller
127
+ disconnection. Duplicate clicks do not start another generation or write. During
128
+ PROCESSING, resolution identifies the admitted operation and has no final result.
129
+ No queue, replay or recovery worker is introduced. After an admitted action ends, its Suggestion is `RESOLVED`
124
130
  regardless of success, partial success, failure or an unknown write outcome. For
125
131
  example, saving the new Automation and failing to enable it records a `partial`
126
132
  result with its Automation ID and the enable failure. The UI says what succeeded
@@ -129,9 +135,9 @@ pending Suggestion, retry button, recovery task or compensation workflow.
129
135
  Enabling a new task-flow Automation does not mean executing its task immediately.
130
136
 
131
137
  Other type handlers declare their own actions. The common framework does not
132
- equate acceptance with enabling or running a resource. UI opens the already
133
- generated source without a new model call; handling may revalidate against
134
- current resources and supported SDK rules.
138
+ equate acceptance with enabling or running a resource. The UI shows the intent
139
+ and reasons. Adoption generates and validates source against current resources
140
+ and supported SDK rules before the host applies it.
135
141
 
136
142
  ## Run and result semantics
137
143
 
@@ -139,8 +145,9 @@ One Space has at most one active run. A duplicate admission returns that run wit
139
145
  `accepted: false`; its focus is not incorporated and its payer is not substituted.
140
146
  The host owns `SuggestionRun` status and measured model usage. The generator
141
147
  returns drafts and an optional bounded context summary, never a success claim or
142
- its own accounting. Analysis, script generation and bounded repair share one
143
- run budget: model calls, prompt/output size, tool results and deadline.
148
+ its own accounting. Discovery analysis and reads share a bounded run budget.
149
+ Each adoption has a separate bounded generation and repair budget; it does not
150
+ alter the discovery run, watermark, context summary or periodic clock.
144
151
 
145
152
  | Status | Meaning |
146
153
  | --- | --- |
@@ -158,9 +165,10 @@ unbounded run log, a retry service or catch-up runs for every missed period.
158
165
 
159
166
  ## Suggestion lifecycle and handling
160
167
 
161
- `PENDING` means available for review, `RESOLVED` means one-shot handling has ended,
168
+ `PENDING` means available for review, `PROCESSING` means adoption is in progress,
169
+ `RESOLVED` means one-shot handling has ended,
162
170
  `DISMISSED` records rejection, and `EXPIRED` means no longer applicable.
163
- Resolved/dismissed records require a backend resolution. Pending/expired records
171
+ Processing/resolved/dismissed records require a backend resolution. Pending/expired records
164
172
  have none. Resolution records the action, existing operation ID, time, canonical
165
173
  actor, resulting resource IDs/feedback, and the full canonical `FacadeResponse`
166
174
  in `result`. Handling lifecycle and business outcome are independent: `RESOLVED`
@@ -205,7 +213,7 @@ The following are contract declarations, not a current support inventory.
205
213
  | `/app/suggestion/settings/save` | `SaveSettingsInput`: one or both of `enabled`, `intervalMinutes` | Complete saved `SuggestionSettings` |
206
214
 
207
215
  An explicit unknown or no-longer-retained run ID returns `NOT_FOUND`; it must not
208
- silently return an unrelated run. Lists are bounded and omit script bundles,
216
+ silently return an unrelated run. Lists are bounded and omit full evidence,
209
217
  evidence and resolutions; detail reads return the saved complete content.
210
218
  Business errors/partial or unknown outcomes use the canonical Facade result;
211
219
  marking handling finished must not replace that result with `success`.
@@ -247,7 +255,7 @@ owner and `schedule` (`SuggestionScheduleState`); `STATE` carries that owner,
247
255
  `current` (run, trusted invocation, optional focus and observed usage), and optional
248
256
  `contextSummary`; `SUGGESTION` carries `tenantId` and the full typed `item`, whose
249
257
  `spaceId` supplies its Space owner. The shared `suggestion.migration.json` fixture
250
- covers disabled settings, retained context, complete source bundles and a partial
258
+ covers disabled settings, retained context, structured intents and a partial
251
259
  handling receipt. Internal dispatch bindings, object addresses and handling claims
252
260
  are never transferred.
253
261
 
@@ -20,15 +20,7 @@
20
20
  "excerpt": "The user selected brightness 30 after brightness 80"
21
21
  }
22
22
  ],
23
- "script": {
24
- "script": "name: Contract fixture\ntask: []\n",
25
- "scripts": {
26
- "lighting": "// Fixture source bundle\n",
27
- "empty": ""
28
- },
29
- "sdkVersion": "test-sdk-1",
30
- "parseResults": []
31
- }
23
+ "request": "Use lower evening brightness"
32
24
  }
33
25
  },
34
26
  {
@@ -50,17 +42,8 @@
50
42
  "excerpt": "The user selected brightness 30 after brightness 80"
51
43
  }
52
44
  ],
53
- "script": {
54
- "script": "name: Contract fixture\ntask: []\n",
55
- "scripts": {
56
- "lighting": "// Fixture source bundle\n",
57
- "empty": ""
58
- },
59
- "sdkVersion": "test-sdk-1",
60
- "parseResults": []
61
- },
62
45
  "automationId": "fixture-automation",
63
- "baseScriptHash": "fixture-source-hash"
46
+ "request": "Use lower evening brightness"
64
47
  }
65
48
  },
66
49
  {
@@ -82,22 +65,14 @@
82
65
  "excerpt": "The user selected brightness 30 after brightness 80"
83
66
  }
84
67
  ],
85
- "script": {
86
- "script": "name: Contract fixture\ntask: []\n",
87
- "scripts": {
88
- "lighting": "// Fixture source bundle\n",
89
- "empty": ""
90
- },
91
- "sdkVersion": "test-sdk-1",
92
- "parseResults": []
93
- },
94
68
  "id": "fixture-suggestion-1",
95
69
  "spaceId": "fixture-space",
96
70
  "runId": "fixture-run",
97
71
  "version": 1,
98
72
  "status": "PENDING",
99
73
  "createdAt": 2000,
100
- "updatedAt": 2000
74
+ "updatedAt": 2000,
75
+ "request": "Use lower evening brightness"
101
76
  }
102
77
  },
103
78
  {
@@ -119,15 +94,6 @@
119
94
  "excerpt": "The user selected brightness 30 after brightness 80"
120
95
  }
121
96
  ],
122
- "script": {
123
- "script": "name: Contract fixture\ntask: []\n",
124
- "scripts": {
125
- "lighting": "// Fixture source bundle\n",
126
- "empty": ""
127
- },
128
- "sdkVersion": "test-sdk-1",
129
- "parseResults": []
130
- },
131
97
  "id": "fixture-suggestion-1",
132
98
  "spaceId": "fixture-space",
133
99
  "runId": "fixture-run",
@@ -146,7 +112,8 @@
146
112
  "resourceIds": {
147
113
  "automationId": "fixture-automation"
148
114
  }
149
- }
115
+ },
116
+ "request": "Use lower evening brightness"
150
117
  }
151
118
  },
152
119
  {
@@ -198,15 +165,7 @@
198
165
  "excerpt": "The user selected brightness 30 after brightness 80"
199
166
  }
200
167
  ],
201
- "script": {
202
- "script": "name: Contract fixture\ntask: []\n",
203
- "scripts": {
204
- "lighting": "// Fixture source bundle\n",
205
- "empty": ""
206
- },
207
- "sdkVersion": "test-sdk-1",
208
- "parseResults": []
209
- }
168
+ "request": "Use lower evening brightness"
210
169
  },
211
170
  {
212
171
  "type": "INFORMATION",
@@ -357,16 +316,8 @@
357
316
  "excerpt": "The user selected brightness 30 after brightness 80"
358
317
  }
359
318
  ],
360
- "script": {
361
- "script": "name: Contract fixture\ntask: []\n",
362
- "scripts": {
363
- "lighting": "// Fixture source bundle\n",
364
- "empty": ""
365
- },
366
- "sdkVersion": "test-sdk-1",
367
- "parseResults": []
368
- },
369
- "expiresAt": null
319
+ "expiresAt": null,
320
+ "request": "Use lower evening brightness"
370
321
  }
371
322
  },
372
323
  {
@@ -420,7 +371,7 @@
420
371
  "value": {
421
372
  "type": "AUTOMATION",
422
373
  "operation": "CREATE",
423
- "title": "\ufeff",
374
+ "title": "",
424
375
  "summary": "Suggest a lower evening brightness",
425
376
  "reasons": [
426
377
  "Observed manual adjustments after the evening routine"
@@ -433,15 +384,7 @@
433
384
  "excerpt": "The user selected brightness 30 after brightness 80"
434
385
  }
435
386
  ],
436
- "script": {
437
- "script": "name: Contract fixture\ntask: []\n",
438
- "scripts": {
439
- "lighting": "// Fixture source bundle\n",
440
- "empty": ""
441
- },
442
- "sdkVersion": "test-sdk-1",
443
- "parseResults": []
444
- }
387
+ "request": "Use lower evening brightness"
445
388
  }
446
389
  },
447
390
  {
@@ -463,15 +406,6 @@
463
406
  "excerpt": "The user selected brightness 30 after brightness 80"
464
407
  }
465
408
  ],
466
- "script": {
467
- "script": "name: Contract fixture\ntask: []\n",
468
- "scripts": {
469
- "lighting": "// Fixture source bundle\n",
470
- "empty": ""
471
- },
472
- "sdkVersion": "test-sdk-1",
473
- "parseResults": []
474
- },
475
409
  "id": "fixture-suggestion-1",
476
410
  "spaceId": "fixture-space",
477
411
  "runId": "fixture-run",
@@ -497,7 +431,8 @@
497
431
  "enabled": true
498
432
  }
499
433
  }
500
- }
434
+ },
435
+ "request": "Use lower evening brightness"
501
436
  }
502
437
  },
503
438
  {
@@ -534,15 +469,6 @@
534
469
  "excerpt": "The user selected brightness 30 after brightness 80"
535
470
  }
536
471
  ],
537
- "script": {
538
- "script": "name: Contract fixture\ntask: []\n",
539
- "scripts": {
540
- "lighting": "// Fixture source bundle\n",
541
- "empty": ""
542
- },
543
- "sdkVersion": "test-sdk-1",
544
- "parseResults": []
545
- },
546
472
  "id": "fixture-suggestion-1",
547
473
  "spaceId": "fixture-space",
548
474
  "runId": "fixture-run",
@@ -574,7 +500,8 @@
574
500
  }
575
501
  ]
576
502
  }
577
- }
503
+ },
504
+ "request": "Use lower evening brightness"
578
505
  }
579
506
  },
580
507
  {
@@ -611,15 +538,6 @@
611
538
  "excerpt": "The user selected brightness 30 after brightness 80"
612
539
  }
613
540
  ],
614
- "script": {
615
- "script": "name: Contract fixture\ntask: []\n",
616
- "scripts": {
617
- "lighting": "// Fixture source bundle\n",
618
- "empty": ""
619
- },
620
- "sdkVersion": "test-sdk-1",
621
- "parseResults": []
622
- },
623
541
  "id": "fixture-suggestion-1",
624
542
  "spaceId": "fixture-space",
625
543
  "runId": "fixture-run",
@@ -645,7 +563,8 @@
645
563
  "message": "Script validation failed"
646
564
  }
647
565
  }
648
- }
566
+ },
567
+ "request": "Use lower evening brightness"
649
568
  }
650
569
  },
651
570
  {
@@ -682,15 +601,6 @@
682
601
  "excerpt": "The user selected brightness 30 after brightness 80"
683
602
  }
684
603
  ],
685
- "script": {
686
- "script": "name: Contract fixture\ntask: []\n",
687
- "scripts": {
688
- "lighting": "// Fixture source bundle\n",
689
- "empty": ""
690
- },
691
- "sdkVersion": "test-sdk-1",
692
- "parseResults": []
693
- },
694
604
  "id": "fixture-suggestion-1",
695
605
  "spaceId": "fixture-space",
696
606
  "runId": "fixture-run",
@@ -716,7 +626,8 @@
716
626
  "message": "The write outcome is unknown"
717
627
  }
718
628
  }
719
- }
629
+ },
630
+ "request": "Use lower evening brightness"
720
631
  }
721
632
  },
722
633
  {
@@ -777,6 +688,47 @@
777
688
  "enabled": false,
778
689
  "intervalMinutes": 90
779
690
  }
691
+ },
692
+ {
693
+ "name": "processing adoption",
694
+ "type": "AutomationSuggestion",
695
+ "value": {
696
+ "type": "AUTOMATION",
697
+ "operation": "CREATE",
698
+ "title": "Evening lighting",
699
+ "summary": "Suggest a lower evening brightness",
700
+ "reasons": [
701
+ "Observed manual adjustments after the evening routine"
702
+ ],
703
+ "evidence": [
704
+ {
705
+ "sourceType": "BEHAVIOR",
706
+ "sourceId": "fixture-operation-1",
707
+ "occurredAt": 1000,
708
+ "excerpt": "The user selected brightness 30 after brightness 80"
709
+ }
710
+ ],
711
+ "id": "fixture-suggestion-1",
712
+ "spaceId": "fixture-space",
713
+ "runId": "fixture-run",
714
+ "version": 1,
715
+ "status": "PROCESSING",
716
+ "createdAt": 2000,
717
+ "updatedAt": 3000,
718
+ "resolution": {
719
+ "action": "SAVE",
720
+ "operationId": "fixture-apply",
721
+ "handledAt": 3000,
722
+ "actor": {
723
+ "kind": "user",
724
+ "userId": "fixture-user"
725
+ },
726
+ "resourceIds": {
727
+ "automationId": "fixture-automation"
728
+ }
729
+ },
730
+ "request": "Use lower evening brightness"
731
+ }
780
732
  }
781
733
  ],
782
734
  "invalid": [
@@ -799,16 +751,8 @@
799
751
  "excerpt": "The user selected brightness 30 after brightness 80"
800
752
  }
801
753
  ],
802
- "script": {
803
- "script": "name: Contract fixture\ntask: []\n",
804
- "scripts": {
805
- "lighting": "// Fixture source bundle\n",
806
- "empty": ""
807
- },
808
- "sdkVersion": "test-sdk-1",
809
- "parseResults": []
810
- },
811
- "spaceId": "forged"
754
+ "spaceId": "forged",
755
+ "request": "Use lower evening brightness"
812
756
  }
813
757
  },
814
758
  {
@@ -858,15 +802,7 @@
858
802
  "excerpt": "The user selected brightness 30 after brightness 80"
859
803
  }
860
804
  ],
861
- "script": {
862
- "script": "name: Contract fixture\ntask: []\n",
863
- "scripts": {
864
- "lighting": "// Fixture source bundle\n",
865
- "empty": ""
866
- },
867
- "sdkVersion": "test-sdk-1",
868
- "parseResults": []
869
- }
805
+ "request": "Use lower evening brightness"
870
806
  }
871
807
  },
872
808
  {
@@ -888,13 +824,11 @@
888
824
  "excerpt": "The user selected brightness 30 after brightness 80"
889
825
  }
890
826
  ],
891
- "script": {
892
- "script": " "
893
- }
827
+ "request": ""
894
828
  }
895
829
  },
896
830
  {
897
- "name": "unknown source field",
831
+ "name": "proposal cannot supply generated source",
898
832
  "type": "AutomationDraft",
899
833
  "value": {
900
834
  "type": "AUTOMATION",
@@ -912,15 +846,9 @@
912
846
  "excerpt": "The user selected brightness 30 after brightness 80"
913
847
  }
914
848
  ],
849
+ "request": "Use lower evening brightness",
915
850
  "script": {
916
- "script": "name: Contract fixture\ntask: []\n",
917
- "scripts": {
918
- "lighting": "// Fixture source bundle\n",
919
- "empty": ""
920
- },
921
- "sdkVersion": "test-sdk-1",
922
- "parseResults": [],
923
- "unsafeExecute": true
851
+ "script": "not allowed"
924
852
  }
925
853
  }
926
854
  },
@@ -943,20 +871,12 @@
943
871
  "excerpt": "The user selected brightness 30 after brightness 80"
944
872
  }
945
873
  ],
946
- "script": {
947
- "script": "name: Contract fixture\ntask: []\n",
948
- "scripts": {
949
- "lighting": "// Fixture source bundle\n",
950
- "empty": ""
951
- },
952
- "sdkVersion": "test-sdk-1",
953
- "parseResults": []
954
- },
955
- "automationId": "old"
874
+ "automationId": "old",
875
+ "request": "Use lower evening brightness"
956
876
  }
957
877
  },
958
878
  {
959
- "name": "UPDATE lacks source guard",
879
+ "name": "UPDATE lacks target",
960
880
  "type": "AutomationDraft",
961
881
  "value": {
962
882
  "type": "AUTOMATION",
@@ -974,16 +894,7 @@
974
894
  "excerpt": "The user selected brightness 30 after brightness 80"
975
895
  }
976
896
  ],
977
- "script": {
978
- "script": "name: Contract fixture\ntask: []\n",
979
- "scripts": {
980
- "lighting": "// Fixture source bundle\n",
981
- "empty": ""
982
- },
983
- "sdkVersion": "test-sdk-1",
984
- "parseResults": []
985
- },
986
- "automationId": "old"
897
+ "request": "Use lower evening brightness"
987
898
  }
988
899
  },
989
900
  {
@@ -1033,22 +944,14 @@
1033
944
  "excerpt": "The user selected brightness 30 after brightness 80"
1034
945
  }
1035
946
  ],
1036
- "script": {
1037
- "script": "name: Contract fixture\ntask: []\n",
1038
- "scripts": {
1039
- "lighting": "// Fixture source bundle\n",
1040
- "empty": ""
1041
- },
1042
- "sdkVersion": "test-sdk-1",
1043
- "parseResults": []
1044
- },
1045
947
  "id": "fixture-suggestion-1",
1046
948
  "spaceId": "fixture-space",
1047
949
  "runId": "fixture-run",
1048
950
  "version": 1,
1049
951
  "status": "RESOLVED",
1050
952
  "createdAt": 2000,
1051
- "updatedAt": 2000
953
+ "updatedAt": 2000,
954
+ "request": "Use lower evening brightness"
1052
955
  }
1053
956
  },
1054
957
  {
@@ -1070,15 +973,6 @@
1070
973
  "excerpt": "The user selected brightness 30 after brightness 80"
1071
974
  }
1072
975
  ],
1073
- "script": {
1074
- "script": "name: Contract fixture\ntask: []\n",
1075
- "scripts": {
1076
- "lighting": "// Fixture source bundle\n",
1077
- "empty": ""
1078
- },
1079
- "sdkVersion": "test-sdk-1",
1080
- "parseResults": []
1081
- },
1082
976
  "id": "fixture-suggestion-1",
1083
977
  "spaceId": "fixture-space",
1084
978
  "runId": "fixture-run",
@@ -1097,7 +991,8 @@
1097
991
  "resourceIds": {
1098
992
  "automationId": "fixture-automation"
1099
993
  }
1100
- }
994
+ },
995
+ "request": "Use lower evening brightness"
1101
996
  }
1102
997
  },
1103
998
  {
@@ -1119,22 +1014,14 @@
1119
1014
  "excerpt": "The user selected brightness 30 after brightness 80"
1120
1015
  }
1121
1016
  ],
1122
- "script": {
1123
- "script": "name: Contract fixture\ntask: []\n",
1124
- "scripts": {
1125
- "lighting": "// Fixture source bundle\n",
1126
- "empty": ""
1127
- },
1128
- "sdkVersion": "test-sdk-1",
1129
- "parseResults": []
1130
- },
1131
1017
  "id": "fixture-suggestion-1",
1132
1018
  "spaceId": "fixture-space",
1133
1019
  "runId": "fixture-run",
1134
1020
  "version": 9007199254740992,
1135
1021
  "status": "PENDING",
1136
1022
  "createdAt": 2000,
1137
- "updatedAt": 2000
1023
+ "updatedAt": 2000,
1024
+ "request": "Use lower evening brightness"
1138
1025
  }
1139
1026
  },
1140
1027
  {
@@ -1252,7 +1139,7 @@
1252
1139
  "value": {
1253
1140
  "type": "AUTOMATION",
1254
1141
  "operation": "CREATE",
1255
- "title": "\u0085",
1142
+ "title": "…",
1256
1143
  "summary": "Suggest a lower evening brightness",
1257
1144
  "reasons": [
1258
1145
  "Observed manual adjustments after the evening routine"
@@ -1265,15 +1152,7 @@
1265
1152
  "excerpt": "The user selected brightness 30 after brightness 80"
1266
1153
  }
1267
1154
  ],
1268
- "script": {
1269
- "script": "name: Contract fixture\ntask: []\n",
1270
- "scripts": {
1271
- "lighting": "// Fixture source bundle\n",
1272
- "empty": ""
1273
- },
1274
- "sdkVersion": "test-sdk-1",
1275
- "parseResults": []
1276
- }
1155
+ "request": "Use lower evening brightness"
1277
1156
  }
1278
1157
  },
1279
1158
  {
@@ -1315,15 +1194,6 @@
1315
1194
  "excerpt": "The user selected brightness 30 after brightness 80"
1316
1195
  }
1317
1196
  ],
1318
- "script": {
1319
- "script": "name: Contract fixture\ntask: []\n",
1320
- "scripts": {
1321
- "lighting": "// Fixture source bundle\n",
1322
- "empty": ""
1323
- },
1324
- "sdkVersion": "test-sdk-1",
1325
- "parseResults": []
1326
- },
1327
1197
  "id": "fixture-suggestion-1",
1328
1198
  "spaceId": "fixture-space",
1329
1199
  "runId": "fixture-run",
@@ -1345,7 +1215,8 @@
1345
1215
  "result": {
1346
1216
  "status": "partial"
1347
1217
  }
1348
- }
1218
+ },
1219
+ "request": "Use lower evening brightness"
1349
1220
  }
1350
1221
  },
1351
1222
  {
@@ -1367,15 +1238,6 @@
1367
1238
  "excerpt": "The user selected brightness 30 after brightness 80"
1368
1239
  }
1369
1240
  ],
1370
- "script": {
1371
- "script": "name: Contract fixture\ntask: []\n",
1372
- "scripts": {
1373
- "lighting": "// Fixture source bundle\n",
1374
- "empty": ""
1375
- },
1376
- "sdkVersion": "test-sdk-1",
1377
- "parseResults": []
1378
- },
1379
1241
  "id": "fixture-suggestion-1",
1380
1242
  "spaceId": "fixture-space",
1381
1243
  "runId": "fixture-run",
@@ -1397,7 +1259,8 @@
1397
1259
  "result": {
1398
1260
  "status": "unknown"
1399
1261
  }
1400
- }
1262
+ },
1263
+ "request": "Use lower evening brightness"
1401
1264
  }
1402
1265
  },
1403
1266
  {
@@ -1419,15 +1282,6 @@
1419
1282
  "excerpt": "The user selected brightness 30 after brightness 80"
1420
1283
  }
1421
1284
  ],
1422
- "script": {
1423
- "script": "name: Contract fixture\ntask: []\n",
1424
- "scripts": {
1425
- "lighting": "// Fixture source bundle\n",
1426
- "empty": ""
1427
- },
1428
- "sdkVersion": "test-sdk-1",
1429
- "parseResults": []
1430
- },
1431
1285
  "id": "fixture-suggestion-1",
1432
1286
  "spaceId": "fixture-space",
1433
1287
  "runId": "fixture-run",
@@ -1450,7 +1304,8 @@
1450
1304
  "status": "success",
1451
1305
  "retry": true
1452
1306
  }
1453
- }
1307
+ },
1308
+ "request": "Use lower evening brightness"
1454
1309
  }
1455
1310
  },
1456
1311
  {
@@ -80,22 +80,14 @@
80
80
  "excerpt": "The user selected brightness 30 after brightness 80"
81
81
  }
82
82
  ],
83
- "script": {
84
- "script": "name: Contract fixture\ntask: []\n",
85
- "scripts": {
86
- "lighting": "// Fixture source bundle\n",
87
- "empty": ""
88
- },
89
- "sdkVersion": "test-sdk-1",
90
- "parseResults": []
91
- },
92
83
  "id": "pending",
93
84
  "spaceId": "space",
94
85
  "runId": "run",
95
86
  "version": 1,
96
87
  "status": "PENDING",
97
88
  "createdAt": 2000,
98
- "updatedAt": 2000
89
+ "updatedAt": 2000,
90
+ "request": "Use lower evening brightness"
99
91
  }
100
92
  },
101
93
  {
@@ -117,15 +109,6 @@
117
109
  "excerpt": "The user selected brightness 30 after brightness 80"
118
110
  }
119
111
  ],
120
- "script": {
121
- "script": "name: Contract fixture\ntask: []\n",
122
- "scripts": {
123
- "lighting": "// Fixture source bundle\n",
124
- "empty": ""
125
- },
126
- "sdkVersion": "test-sdk-1",
127
- "parseResults": []
128
- },
129
112
  "id": "resolved",
130
113
  "spaceId": "space",
131
114
  "runId": "run",
@@ -157,7 +140,8 @@
157
140
  }
158
141
  ]
159
142
  }
160
- }
143
+ },
144
+ "request": "Use lower evening brightness"
161
145
  }
162
146
  }
163
147
  ]
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "manifest": "mhome.app-facade.v1",
3
- "contractVersion": "1.171.1",
3
+ "contractVersion": "1.173.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",
@@ -1,5 +1,5 @@
1
1
  {
2
- "contractVersion": "1.171.1",
2
+ "contractVersion": "1.173.1",
3
3
  "operations": {
4
4
  "/app/agent/context/get": "spaceRead",
5
5
  "/app/agent/conversation/get": "spaceRead",
@@ -267,7 +267,6 @@
267
267
  "/app/room/create": "spaceWrite",
268
268
  "/app/room/delete": "spaceWrite",
269
269
  "/app/room/devices/move": "spaceWrite",
270
- "/app/room/devices/remove": "spaceWrite",
271
270
  "/app/room/list": "spaceRead",
272
271
  "/app/room/rename": "spaceWrite",
273
272
  "/app/room/reorder": "spaceWrite",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "manifest": "mhome.host-provision.targets.v1",
3
- "contractVersion": "1.171.1",
3
+ "contractVersion": "1.173.1",
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.171.1",
3
+ "contractVersion": "1.173.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.171.1",
3
+ "contractVersion": "1.173.1",
4
4
  "contract": "contract/pod-commissioning-v1.md",
5
5
  "localTargets": [
6
6
  "/local/pod/discovery/start",
@@ -251,6 +251,9 @@
251
251
  "action"
252
252
  ],
253
253
  "output": [
254
+ "suggestionId",
255
+ "status",
256
+ "operationId",
254
257
  "automationId",
255
258
  "previousStatus",
256
259
  "restoreIssue"
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "manifest": "mhome.app-facade.routing.v1",
3
- "contractVersion": "1.171.1",
3
+ "contractVersion": "1.173.1",
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.171.1",
3
+ "contractVersion": "1.173.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.171.1",
3
+ "version": "1.173.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.171.1",
3
+ "contractVersion": "1.173.1",
4
4
  "manifest": "manifest/app-facade.v1.json",
5
5
  "schemas": {
6
6
  "dashboardCardAuthoring": "schema/dashboard-card-authoring.v1.schema.json",
@@ -679,6 +679,13 @@
679
679
  "INTERRUPTED",
680
680
  "CANCELLED"
681
681
  ]
682
+ },
683
+ "failureCode": {
684
+ "type": [
685
+ "string",
686
+ "null"
687
+ ],
688
+ "description": "SUPPRESSED only when the whole Automation was blocked on entry/resume; absent otherwise."
682
689
  }
683
690
  }
684
691
  }
@@ -297,6 +297,7 @@
297
297
  "status": {
298
298
  "enum": [
299
299
  "PENDING",
300
+ "PROCESSING",
300
301
  "RESOLVED",
301
302
  "DISMISSED",
302
303
  "EXPIRED"
@@ -344,6 +345,7 @@
344
345
  "properties": {
345
346
  "status": {
346
347
  "enum": [
348
+ "PROCESSING",
347
349
  "RESOLVED",
348
350
  "DISMISSED"
349
351
  ]
@@ -434,19 +436,16 @@
434
436
  }
435
437
  ]
436
438
  },
437
- "baseScriptHash": {
438
- "anyOf": [
439
- {
440
- "type": "string",
441
- "pattern": "[^\\u0009-\\u000D\\u0020\\u0085\\u00A0\\u1680\\u2000-\\u200A\\u2028\\u2029\\u202F\\u205F\\u3000]"
442
- },
443
- {
444
- "type": "null"
445
- }
446
- ]
439
+ "request": {
440
+ "type": "string",
441
+ "pattern": "[^\\u0009-\\u000D\\u0020\\u0085\\u00A0\\u1680\\u2000-\\u200A\\u2028\\u2029\\u202F\\u205F\\u3000]"
447
442
  },
448
- "script": {
449
- "$ref": "#/$defs/AutomationScript"
443
+ "relatedAutomationIds": {
444
+ "type": "array",
445
+ "items": {
446
+ "type": "string",
447
+ "pattern": "[^\\u0009-\\u000D\\u0020\\u0085\\u00A0\\u1680\\u2000-\\u200A\\u2028\\u2029\\u202F\\u205F\\u3000]"
448
+ }
450
449
  }
451
450
  },
452
451
  "required": [
@@ -456,7 +455,7 @@
456
455
  "reasons",
457
456
  "evidence",
458
457
  "operation",
459
- "script"
458
+ "request"
460
459
  ],
461
460
  "additionalProperties": false,
462
461
  "allOf": [
@@ -474,17 +473,12 @@
474
473
  },
475
474
  "then": {
476
475
  "required": [
477
- "automationId",
478
- "baseScriptHash"
476
+ "automationId"
479
477
  ],
480
478
  "properties": {
481
479
  "automationId": {
482
480
  "type": "string",
483
481
  "pattern": "[^\\u0009-\\u000D\\u0020\\u0085\\u00A0\\u1680\\u2000-\\u200A\\u2028\\u2029\\u202F\\u205F\\u3000]"
484
- },
485
- "baseScriptHash": {
486
- "type": "string",
487
- "pattern": "[^\\u0009-\\u000D\\u0020\\u0085\\u00A0\\u1680\\u2000-\\u200A\\u2028\\u2029\\u202F\\u205F\\u3000]"
488
482
  }
489
483
  },
490
484
  "type": "object"
@@ -493,9 +487,6 @@
493
487
  "properties": {
494
488
  "automationId": {
495
489
  "type": "null"
496
- },
497
- "baseScriptHash": {
498
- "type": "null"
499
490
  }
500
491
  },
501
492
  "type": "object"
@@ -561,20 +552,6 @@
561
552
  }
562
553
  ]
563
554
  },
564
- "baseScriptHash": {
565
- "anyOf": [
566
- {
567
- "type": "string",
568
- "pattern": "[^\\u0009-\\u000D\\u0020\\u0085\\u00A0\\u1680\\u2000-\\u200A\\u2028\\u2029\\u202F\\u205F\\u3000]"
569
- },
570
- {
571
- "type": "null"
572
- }
573
- ]
574
- },
575
- "script": {
576
- "$ref": "#/$defs/AutomationScript"
577
- },
578
555
  "id": {
579
556
  "type": "string",
580
557
  "pattern": "[^\\u0009-\\u000D\\u0020\\u0085\\u00A0\\u1680\\u2000-\\u200A\\u2028\\u2029\\u202F\\u205F\\u3000]"
@@ -595,6 +572,7 @@
595
572
  "status": {
596
573
  "enum": [
597
574
  "PENDING",
575
+ "PROCESSING",
598
576
  "RESOLVED",
599
577
  "DISMISSED",
600
578
  "EXPIRED"
@@ -619,6 +597,17 @@
619
597
  "type": "null"
620
598
  }
621
599
  ]
600
+ },
601
+ "request": {
602
+ "type": "string",
603
+ "pattern": "[^\\u0009-\\u000D\\u0020\\u0085\\u00A0\\u1680\\u2000-\\u200A\\u2028\\u2029\\u202F\\u205F\\u3000]"
604
+ },
605
+ "relatedAutomationIds": {
606
+ "type": "array",
607
+ "items": {
608
+ "type": "string",
609
+ "pattern": "[^\\u0009-\\u000D\\u0020\\u0085\\u00A0\\u1680\\u2000-\\u200A\\u2028\\u2029\\u202F\\u205F\\u3000]"
610
+ }
622
611
  }
623
612
  },
624
613
  "required": [
@@ -635,7 +624,7 @@
635
624
  "createdAt",
636
625
  "updatedAt",
637
626
  "operation",
638
- "script"
627
+ "request"
639
628
  ],
640
629
  "additionalProperties": false,
641
630
  "allOf": [
@@ -653,17 +642,12 @@
653
642
  },
654
643
  "then": {
655
644
  "required": [
656
- "automationId",
657
- "baseScriptHash"
645
+ "automationId"
658
646
  ],
659
647
  "properties": {
660
648
  "automationId": {
661
649
  "type": "string",
662
650
  "pattern": "[^\\u0009-\\u000D\\u0020\\u0085\\u00A0\\u1680\\u2000-\\u200A\\u2028\\u2029\\u202F\\u205F\\u3000]"
663
- },
664
- "baseScriptHash": {
665
- "type": "string",
666
- "pattern": "[^\\u0009-\\u000D\\u0020\\u0085\\u00A0\\u1680\\u2000-\\u200A\\u2028\\u2029\\u202F\\u205F\\u3000]"
667
651
  }
668
652
  },
669
653
  "type": "object"
@@ -672,9 +656,6 @@
672
656
  "properties": {
673
657
  "automationId": {
674
658
  "type": "null"
675
- },
676
- "baseScriptHash": {
677
- "type": "null"
678
659
  }
679
660
  },
680
661
  "type": "object"
@@ -685,6 +666,7 @@
685
666
  "properties": {
686
667
  "status": {
687
668
  "enum": [
669
+ "PROCESSING",
688
670
  "RESOLVED",
689
671
  "DISMISSED"
690
672
  ]
@@ -821,6 +803,7 @@
821
803
  "items": {
822
804
  "enum": [
823
805
  "PENDING",
806
+ "PROCESSING",
824
807
  "RESOLVED",
825
808
  "DISMISSED",
826
809
  "EXPIRED"
@@ -875,6 +858,7 @@
875
858
  "status": {
876
859
  "enum": [
877
860
  "PENDING",
861
+ "PROCESSING",
878
862
  "RESOLVED",
879
863
  "DISMISSED",
880
864
  "EXPIRED"