@mhome/app-facade-protocol 1.156.0 → 1.158.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/automation-v1.md +15 -5
- package/contract/suggestion-v1.md +32 -3
- package/fixtures/presentation/cases.json +10 -4
- package/fixtures/recording.conformance.json +89 -0
- package/fixtures/suggestion.conformance.json +132 -0
- package/fixtures/suggestion.migration.json +155 -0
- package/manifest/app-facade.v1.json +12 -2
- package/manifest/authorization.v1.json +10 -2
- 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/presentation-times.v1.json +38 -1
- package/manifest/recording.v1.json +44 -0
- package/manifest/routing.v1.json +1 -1
- package/manifest/targets.v1.json +1 -1
- package/package.json +1 -1
- package/protocol.json +1 -1
- package/schema/suggestion.v1.schema.json +21 -0
|
@@ -60,8 +60,18 @@ An already absent and cleaned definition is a completed delete target.
|
|
|
60
60
|
completed before the stop request keeps its actual outcome; ordinary success
|
|
61
61
|
may already have discarded its details. Already performed effects are not undone.
|
|
62
62
|
A started external call without a result is uncertain, not a confirmed failure.
|
|
63
|
-
- `/app/automation/diagnostic/get` takes `{automationId}` and
|
|
64
|
-
|
|
63
|
+
- `/app/automation/diagnostic/get` takes `{automationId, cursor?, limit?}` and returns
|
|
64
|
+
`{diagnostics, nextCursor}`. The default page size is 50, with a maximum of 100.
|
|
65
|
+
Follow `nextCursor` until absent, including when a filtered page is empty.
|
|
66
|
+
Cursors are opaque and bound to the authorized Space and Automation. Metadata
|
|
67
|
+
is ordered by availability (or capture time for active records), newest first.
|
|
68
|
+
Bodies are read separately; expired records are unavailable even before physical cleanup.
|
|
69
|
+
Terminal metadata includes `availableAt` and `expiresAt`. Retain failed/interrupted,
|
|
70
|
+
DEBUG and explicitly stopped/captured executions for 24 hours on cloud and 72 hours
|
|
71
|
+
locally, from the first completed publication. Reads and retries do not extend expiry.
|
|
72
|
+
Active captures and pending terminal publication are protected. Ordinary successful
|
|
73
|
+
runs create no run-history event and retain no completed execution detail; their
|
|
74
|
+
checkpoint objects are reclaimed asynchronously. Last-run state remains separate.
|
|
65
75
|
- `/app/automation/diagnostic/read` takes the execution identity and optional
|
|
66
76
|
`cursor`, and returns `{logs, nextCursor}`. Follow the opaque cursor for older
|
|
67
77
|
events. Pages contain up to 100 events with a target size of 256 KiB; a single
|
|
@@ -77,9 +87,9 @@ storage uses epoch milliseconds; Essential renders timestamps in Home time witho
|
|
|
77
87
|
changing stored instants. Agent fetches source through the standard source interface;
|
|
78
88
|
execution records never duplicate the original Plan or source.
|
|
79
89
|
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
90
|
+
Execution records follow the time-based retention above, with no retained-count cap.
|
|
91
|
+
Management events and last-run state remain separate; ordinary completed runs do not
|
|
92
|
+
append activity history. Checkpoints persist only new immutable JSONL segments and a
|
|
83
93
|
constant-size head reference, plus runtime memory. An empty segment is not written.
|
|
84
94
|
The Plan is fetched by automation/thread and must match the run's revision; a missing
|
|
85
95
|
or changed Plan ends the old run. Generation and ownership checks still apply.
|
|
@@ -202,7 +202,7 @@ The following are contract declarations, not a current support inventory.
|
|
|
202
202
|
| `/app/suggestion/handle` | `HandleInput`: ID, expected version, declared action | Canonical business result, also stored in the resolution |
|
|
203
203
|
| `/app/suggestion/feedback` | `FeedbackInput`: ID, expected version, `DISMISS`, optional comment | Updated Suggestion summary on completed success |
|
|
204
204
|
| `/app/suggestion/settings/get` | Empty input | `SuggestionSettings` |
|
|
205
|
-
| `/app/suggestion/settings/save` | `
|
|
205
|
+
| `/app/suggestion/settings/save` | `SaveSettingsInput`: one or both of `enabled`, `intervalMinutes` | Complete saved `SuggestionSettings` |
|
|
206
206
|
|
|
207
207
|
An explicit unknown or no-longer-retained run ID returns `NOT_FOUND`; it must not
|
|
208
208
|
silently return an unrelated run. Lists are bounded and omit script bundles,
|
|
@@ -210,9 +210,18 @@ evidence and resolutions; detail reads return the saved complete content.
|
|
|
210
210
|
Business errors/partial or unknown outcomes use the canonical Facade result;
|
|
211
211
|
marking handling finished must not replace that result with `success`.
|
|
212
212
|
|
|
213
|
-
Settings belong to the authorized Space. Absent storage defaults to `enabled: true
|
|
213
|
+
Settings belong to the authorized Space. Absent storage defaults to `enabled: true`
|
|
214
|
+
and `intervalMinutes: 360` (six hours). The interval is a positive integer number
|
|
215
|
+
of minutes, bounded by the shared unsigned 32-bit field. Save updates only supplied
|
|
216
|
+
fields at the backend; omitted fields retain their value, and empty changes or
|
|
217
|
+
null values are rejected. Existing enabled-only calls remain valid. Stored settings
|
|
218
|
+
from before interval configuration use the same six-hour default.
|
|
214
219
|
The switch controls periodic generation only; explicit authorized generation remains
|
|
215
|
-
available. The UI places
|
|
220
|
+
available. The UI places these controls in a separate Agent Suggestion Settings page.
|
|
221
|
+
Automatic intervals are measured from the previous admitted automatic start,
|
|
222
|
+
regardless of completion time or outcome. Explicit runs never reset that clock.
|
|
223
|
+
This is an interval, not a calendar schedule or a promise of an exact next start.
|
|
224
|
+
Turning it off
|
|
216
225
|
prevents future periodic admissions; it does not delete results or replay/cancel
|
|
217
226
|
an admitted run. Settings follow the Space migration/deletion boundary. This adds
|
|
218
227
|
no per-Suggestion timer, follow-up task or separate scheduler per output type.
|
|
@@ -224,3 +233,23 @@ The execution identity has a separate shared corpus in conversation-api.
|
|
|
224
233
|
These tests cover shape, multiple types, complete bundles, backend-field rejection,
|
|
225
234
|
status invariants and payment selection. They do not prove runtime authorization,
|
|
226
235
|
script compilation, billing settlement, persistence or local/cloud integration.
|
|
236
|
+
|
|
237
|
+
## Space migration
|
|
238
|
+
|
|
239
|
+
The `suggestion/data` DataSync category transfers portable values, not storage keys:
|
|
240
|
+
`SETTINGS` carries `tenantId`, `spaceId` and settings; `STATE` carries that owner,
|
|
241
|
+
`current` (run, trusted invocation, optional focus and observed usage), and optional
|
|
242
|
+
`contextSummary`; `SUGGESTION` carries `tenantId` and the full typed `item`, whose
|
|
243
|
+
`spaceId` supplies its Space owner. The shared `suggestion.migration.json` fixture
|
|
244
|
+
covers disabled settings, retained context, complete source bundles and a partial
|
|
245
|
+
handling receipt. Internal dispatch bindings, object addresses and handling claims
|
|
246
|
+
are never transferred.
|
|
247
|
+
|
|
248
|
+
Existing Space migration fencing owns the handoff. An active run or unfinished
|
|
249
|
+
handling claim cannot be exported as a portable snapshot. Validate every incoming
|
|
250
|
+
record, exact bundle ownership, duplicate singleton/item identities, registered
|
|
251
|
+
content and terminal run state before replacing any category. Import preserves
|
|
252
|
+
IDs, versions, timestamps and business outcomes; it does not generate, apply or
|
|
253
|
+
replay Suggestions. Cloud content uploads precede metadata replacement. A failed
|
|
254
|
+
migration follows the existing lifecycle's explicit retry, with no Suggestion-specific
|
|
255
|
+
retry service or cross-store transaction.
|
|
@@ -353,9 +353,12 @@
|
|
|
353
353
|
"revision": 3,
|
|
354
354
|
"startedAt": 90,
|
|
355
355
|
"finishedAt": 100,
|
|
356
|
-
"captured": false
|
|
356
|
+
"captured": false,
|
|
357
|
+
"availableAt": 100,
|
|
358
|
+
"expiresAt": 86400100
|
|
357
359
|
}
|
|
358
|
-
]
|
|
360
|
+
],
|
|
361
|
+
"nextCursor": null
|
|
359
362
|
},
|
|
360
363
|
"essential": {
|
|
361
364
|
"diagnostics": [
|
|
@@ -376,9 +379,12 @@
|
|
|
376
379
|
"revision": 3,
|
|
377
380
|
"startedAt": "1970-01-01 00:00:00.090 +00:00 (UTC)",
|
|
378
381
|
"finishedAt": "1970-01-01 00:00:00.100 +00:00 (UTC)",
|
|
379
|
-
"captured": false
|
|
382
|
+
"captured": false,
|
|
383
|
+
"availableAt": "1970-01-01 00:00:00.100 +00:00 (UTC)",
|
|
384
|
+
"expiresAt": "1970-01-02 00:00:00.100 +00:00 (UTC)"
|
|
380
385
|
}
|
|
381
|
-
]
|
|
386
|
+
],
|
|
387
|
+
"nextCursor": null
|
|
382
388
|
}
|
|
383
389
|
},
|
|
384
390
|
{
|
|
@@ -1581,5 +1581,94 @@
|
|
|
1581
1581
|
},
|
|
1582
1582
|
"status": "success"
|
|
1583
1583
|
}
|
|
1584
|
+
},
|
|
1585
|
+
{
|
|
1586
|
+
"target": "/app/suggestion/generate",
|
|
1587
|
+
"input": {
|
|
1588
|
+
"focus": "private household detail"
|
|
1589
|
+
},
|
|
1590
|
+
"outcome": {
|
|
1591
|
+
"status": "success",
|
|
1592
|
+
"data": {
|
|
1593
|
+
"accepted": true,
|
|
1594
|
+
"run": {
|
|
1595
|
+
"runId": "run",
|
|
1596
|
+
"status": "RUNNING"
|
|
1597
|
+
}
|
|
1598
|
+
}
|
|
1599
|
+
},
|
|
1600
|
+
"expected": {
|
|
1601
|
+
"event": "suggestion.generate",
|
|
1602
|
+
"accepted": true,
|
|
1603
|
+
"run": {
|
|
1604
|
+
"runId": "run",
|
|
1605
|
+
"status": "RUNNING"
|
|
1606
|
+
},
|
|
1607
|
+
"status": "success"
|
|
1608
|
+
}
|
|
1609
|
+
},
|
|
1610
|
+
{
|
|
1611
|
+
"target": "/app/suggestion/handle",
|
|
1612
|
+
"input": {
|
|
1613
|
+
"suggestionId": "s",
|
|
1614
|
+
"expectedVersion": 1,
|
|
1615
|
+
"action": "APPLY"
|
|
1616
|
+
},
|
|
1617
|
+
"outcome": {
|
|
1618
|
+
"status": "partial",
|
|
1619
|
+
"data": {
|
|
1620
|
+
"automationId": "a",
|
|
1621
|
+
"enabled": false
|
|
1622
|
+
}
|
|
1623
|
+
},
|
|
1624
|
+
"expected": {
|
|
1625
|
+
"event": "suggestion.handle",
|
|
1626
|
+
"suggestionId": "s",
|
|
1627
|
+
"expectedVersion": 1,
|
|
1628
|
+
"action": "APPLY",
|
|
1629
|
+
"automationId": "a",
|
|
1630
|
+
"enabled": false,
|
|
1631
|
+
"status": "partial"
|
|
1632
|
+
}
|
|
1633
|
+
},
|
|
1634
|
+
{
|
|
1635
|
+
"target": "/app/suggestion/feedback",
|
|
1636
|
+
"input": {
|
|
1637
|
+
"suggestionId": "s",
|
|
1638
|
+
"expectedVersion": 1,
|
|
1639
|
+
"decision": "DISMISS",
|
|
1640
|
+
"comment": "private"
|
|
1641
|
+
},
|
|
1642
|
+
"outcome": {
|
|
1643
|
+
"status": "success",
|
|
1644
|
+
"data": {
|
|
1645
|
+
"id": "s",
|
|
1646
|
+
"status": "DISMISSED"
|
|
1647
|
+
}
|
|
1648
|
+
},
|
|
1649
|
+
"expected": {
|
|
1650
|
+
"event": "suggestion.dismiss",
|
|
1651
|
+
"suggestionId": "s",
|
|
1652
|
+
"expectedVersion": 1,
|
|
1653
|
+
"id": "s",
|
|
1654
|
+
"status": "success"
|
|
1655
|
+
}
|
|
1656
|
+
},
|
|
1657
|
+
{
|
|
1658
|
+
"target": "/app/suggestion/settings/save",
|
|
1659
|
+
"input": {
|
|
1660
|
+
"enabled": false
|
|
1661
|
+
},
|
|
1662
|
+
"outcome": {
|
|
1663
|
+
"status": "success",
|
|
1664
|
+
"data": {
|
|
1665
|
+
"enabled": false
|
|
1666
|
+
}
|
|
1667
|
+
},
|
|
1668
|
+
"expected": {
|
|
1669
|
+
"event": "suggestion.settings",
|
|
1670
|
+
"enabled": false,
|
|
1671
|
+
"status": "success"
|
|
1672
|
+
}
|
|
1584
1673
|
}
|
|
1585
1674
|
]
|
|
@@ -747,6 +747,36 @@
|
|
|
747
747
|
"value": {
|
|
748
748
|
"enabled": false
|
|
749
749
|
}
|
|
750
|
+
},
|
|
751
|
+
{
|
|
752
|
+
"name": "partial settings update {'enabled': False}",
|
|
753
|
+
"type": "SaveSettingsInput",
|
|
754
|
+
"value": {
|
|
755
|
+
"enabled": false
|
|
756
|
+
}
|
|
757
|
+
},
|
|
758
|
+
{
|
|
759
|
+
"name": "partial settings update {'intervalMinutes': 60}",
|
|
760
|
+
"type": "SaveSettingsInput",
|
|
761
|
+
"value": {
|
|
762
|
+
"intervalMinutes": 60
|
|
763
|
+
}
|
|
764
|
+
},
|
|
765
|
+
{
|
|
766
|
+
"name": "partial settings update {'enabled': True, 'intervalMinutes': 360}",
|
|
767
|
+
"type": "SaveSettingsInput",
|
|
768
|
+
"value": {
|
|
769
|
+
"enabled": true,
|
|
770
|
+
"intervalMinutes": 360
|
|
771
|
+
}
|
|
772
|
+
},
|
|
773
|
+
{
|
|
774
|
+
"name": "stored interval",
|
|
775
|
+
"type": "SuggestionSettings",
|
|
776
|
+
"value": {
|
|
777
|
+
"enabled": false,
|
|
778
|
+
"intervalMinutes": 90
|
|
779
|
+
}
|
|
750
780
|
}
|
|
751
781
|
],
|
|
752
782
|
"invalid": [
|
|
@@ -1437,6 +1467,108 @@
|
|
|
1437
1467
|
"updatedAt": 3000,
|
|
1438
1468
|
"outcome": "unknown"
|
|
1439
1469
|
}
|
|
1470
|
+
},
|
|
1471
|
+
{
|
|
1472
|
+
"name": "invalid settings update {}",
|
|
1473
|
+
"type": "SaveSettingsInput",
|
|
1474
|
+
"value": {}
|
|
1475
|
+
},
|
|
1476
|
+
{
|
|
1477
|
+
"name": "invalid settings update {'enabled': None}",
|
|
1478
|
+
"type": "SaveSettingsInput",
|
|
1479
|
+
"value": {
|
|
1480
|
+
"enabled": null
|
|
1481
|
+
}
|
|
1482
|
+
},
|
|
1483
|
+
{
|
|
1484
|
+
"name": "invalid settings update {'intervalMinutes': None}",
|
|
1485
|
+
"type": "SaveSettingsInput",
|
|
1486
|
+
"value": {
|
|
1487
|
+
"intervalMinutes": null
|
|
1488
|
+
}
|
|
1489
|
+
},
|
|
1490
|
+
{
|
|
1491
|
+
"name": "invalid settings update {'intervalMinutes': 0}",
|
|
1492
|
+
"type": "SaveSettingsInput",
|
|
1493
|
+
"value": {
|
|
1494
|
+
"intervalMinutes": 0
|
|
1495
|
+
}
|
|
1496
|
+
},
|
|
1497
|
+
{
|
|
1498
|
+
"name": "invalid settings update {'intervalMinutes': -1}",
|
|
1499
|
+
"type": "SaveSettingsInput",
|
|
1500
|
+
"value": {
|
|
1501
|
+
"intervalMinutes": -1
|
|
1502
|
+
}
|
|
1503
|
+
},
|
|
1504
|
+
{
|
|
1505
|
+
"name": "invalid settings update {'intervalMinutes': 1.5}",
|
|
1506
|
+
"type": "SaveSettingsInput",
|
|
1507
|
+
"value": {
|
|
1508
|
+
"intervalMinutes": 1.5
|
|
1509
|
+
}
|
|
1510
|
+
},
|
|
1511
|
+
{
|
|
1512
|
+
"name": "invalid settings update {'intervalMinutes': 4294967296}",
|
|
1513
|
+
"type": "SaveSettingsInput",
|
|
1514
|
+
"value": {
|
|
1515
|
+
"intervalMinutes": 4294967296
|
|
1516
|
+
}
|
|
1517
|
+
},
|
|
1518
|
+
{
|
|
1519
|
+
"name": "invalid settings update {'intervalMinutes': '360'}",
|
|
1520
|
+
"type": "SaveSettingsInput",
|
|
1521
|
+
"value": {
|
|
1522
|
+
"intervalMinutes": "360"
|
|
1523
|
+
}
|
|
1524
|
+
},
|
|
1525
|
+
{
|
|
1526
|
+
"name": "invalid settings update {'enabled': True, 'spaceId': 'other'}",
|
|
1527
|
+
"type": "SaveSettingsInput",
|
|
1528
|
+
"value": {
|
|
1529
|
+
"enabled": true,
|
|
1530
|
+
"spaceId": "other"
|
|
1531
|
+
}
|
|
1532
|
+
},
|
|
1533
|
+
{
|
|
1534
|
+
"name": "invalid stored interval 0",
|
|
1535
|
+
"type": "SuggestionSettings",
|
|
1536
|
+
"value": {
|
|
1537
|
+
"enabled": true,
|
|
1538
|
+
"intervalMinutes": 0
|
|
1539
|
+
}
|
|
1540
|
+
},
|
|
1541
|
+
{
|
|
1542
|
+
"name": "invalid stored interval -1",
|
|
1543
|
+
"type": "SuggestionSettings",
|
|
1544
|
+
"value": {
|
|
1545
|
+
"enabled": true,
|
|
1546
|
+
"intervalMinutes": -1
|
|
1547
|
+
}
|
|
1548
|
+
},
|
|
1549
|
+
{
|
|
1550
|
+
"name": "invalid stored interval 1.5",
|
|
1551
|
+
"type": "SuggestionSettings",
|
|
1552
|
+
"value": {
|
|
1553
|
+
"enabled": true,
|
|
1554
|
+
"intervalMinutes": 1.5
|
|
1555
|
+
}
|
|
1556
|
+
},
|
|
1557
|
+
{
|
|
1558
|
+
"name": "invalid stored interval 4294967296",
|
|
1559
|
+
"type": "SuggestionSettings",
|
|
1560
|
+
"value": {
|
|
1561
|
+
"enabled": true,
|
|
1562
|
+
"intervalMinutes": 4294967296
|
|
1563
|
+
}
|
|
1564
|
+
},
|
|
1565
|
+
{
|
|
1566
|
+
"name": "invalid stored interval None",
|
|
1567
|
+
"type": "SuggestionSettings",
|
|
1568
|
+
"value": {
|
|
1569
|
+
"enabled": true,
|
|
1570
|
+
"intervalMinutes": null
|
|
1571
|
+
}
|
|
1440
1572
|
}
|
|
1441
1573
|
]
|
|
1442
1574
|
}
|
|
@@ -0,0 +1,155 @@
|
|
|
1
|
+
[
|
|
2
|
+
{
|
|
3
|
+
"kind": "SETTINGS",
|
|
4
|
+
"tenantId": "tenant",
|
|
5
|
+
"spaceId": "space",
|
|
6
|
+
"settings": {
|
|
7
|
+
"enabled": false,
|
|
8
|
+
"intervalMinutes": 90
|
|
9
|
+
}
|
|
10
|
+
},
|
|
11
|
+
{
|
|
12
|
+
"kind": "STATE",
|
|
13
|
+
"tenantId": "tenant",
|
|
14
|
+
"spaceId": "space",
|
|
15
|
+
"current": {
|
|
16
|
+
"run": {
|
|
17
|
+
"runId": "run",
|
|
18
|
+
"status": "SUCCEEDED",
|
|
19
|
+
"startedAt": 1000,
|
|
20
|
+
"finishedAt": 2500,
|
|
21
|
+
"suggestionIds": [
|
|
22
|
+
"pending",
|
|
23
|
+
"resolved"
|
|
24
|
+
]
|
|
25
|
+
},
|
|
26
|
+
"invocation": {
|
|
27
|
+
"space": {
|
|
28
|
+
"tenant_id": "tenant",
|
|
29
|
+
"space_id": "space"
|
|
30
|
+
},
|
|
31
|
+
"runId": "run",
|
|
32
|
+
"operationId": "generate",
|
|
33
|
+
"trigger": {
|
|
34
|
+
"type": "EXPLICIT",
|
|
35
|
+
"userId": "alice"
|
|
36
|
+
},
|
|
37
|
+
"deadlineUnixMs": 9000
|
|
38
|
+
},
|
|
39
|
+
"focus": null,
|
|
40
|
+
"usage": {
|
|
41
|
+
"model_requests": 0,
|
|
42
|
+
"reported_model_requests": 0,
|
|
43
|
+
"input_tokens": 0,
|
|
44
|
+
"output_tokens": 0,
|
|
45
|
+
"cached_input_tokens": null,
|
|
46
|
+
"reasoning_output_tokens": null,
|
|
47
|
+
"peak_input_tokens": 0,
|
|
48
|
+
"credits": null,
|
|
49
|
+
"tool_calls": 0,
|
|
50
|
+
"window_truncations": 0,
|
|
51
|
+
"trimmed_messages": 0
|
|
52
|
+
}
|
|
53
|
+
},
|
|
54
|
+
"contextSummary": "Previous successful review"
|
|
55
|
+
},
|
|
56
|
+
{
|
|
57
|
+
"kind": "SUGGESTION",
|
|
58
|
+
"tenantId": "tenant",
|
|
59
|
+
"item": {
|
|
60
|
+
"type": "AUTOMATION",
|
|
61
|
+
"operation": "CREATE",
|
|
62
|
+
"title": "Evening lighting",
|
|
63
|
+
"summary": "Suggest a lower evening brightness",
|
|
64
|
+
"reasons": [
|
|
65
|
+
"Observed manual adjustments after the evening routine"
|
|
66
|
+
],
|
|
67
|
+
"evidence": [
|
|
68
|
+
{
|
|
69
|
+
"sourceType": "BEHAVIOR",
|
|
70
|
+
"sourceId": "fixture-operation-1",
|
|
71
|
+
"occurredAt": 1000,
|
|
72
|
+
"excerpt": "The user selected brightness 30 after brightness 80"
|
|
73
|
+
}
|
|
74
|
+
],
|
|
75
|
+
"script": {
|
|
76
|
+
"script": "name: Contract fixture\ntask: []\n",
|
|
77
|
+
"scripts": {
|
|
78
|
+
"lighting": "// Fixture source bundle\n",
|
|
79
|
+
"empty": ""
|
|
80
|
+
},
|
|
81
|
+
"sdkVersion": "test-sdk-1",
|
|
82
|
+
"parseResults": []
|
|
83
|
+
},
|
|
84
|
+
"id": "pending",
|
|
85
|
+
"spaceId": "space",
|
|
86
|
+
"runId": "run",
|
|
87
|
+
"version": 1,
|
|
88
|
+
"status": "PENDING",
|
|
89
|
+
"createdAt": 2000,
|
|
90
|
+
"updatedAt": 2000
|
|
91
|
+
}
|
|
92
|
+
},
|
|
93
|
+
{
|
|
94
|
+
"kind": "SUGGESTION",
|
|
95
|
+
"tenantId": "tenant",
|
|
96
|
+
"item": {
|
|
97
|
+
"type": "AUTOMATION",
|
|
98
|
+
"operation": "CREATE",
|
|
99
|
+
"title": "Evening lighting",
|
|
100
|
+
"summary": "Suggest a lower evening brightness",
|
|
101
|
+
"reasons": [
|
|
102
|
+
"Observed manual adjustments after the evening routine"
|
|
103
|
+
],
|
|
104
|
+
"evidence": [
|
|
105
|
+
{
|
|
106
|
+
"sourceType": "BEHAVIOR",
|
|
107
|
+
"sourceId": "fixture-operation-1",
|
|
108
|
+
"occurredAt": 1000,
|
|
109
|
+
"excerpt": "The user selected brightness 30 after brightness 80"
|
|
110
|
+
}
|
|
111
|
+
],
|
|
112
|
+
"script": {
|
|
113
|
+
"script": "name: Contract fixture\ntask: []\n",
|
|
114
|
+
"scripts": {
|
|
115
|
+
"lighting": "// Fixture source bundle\n",
|
|
116
|
+
"empty": ""
|
|
117
|
+
},
|
|
118
|
+
"sdkVersion": "test-sdk-1",
|
|
119
|
+
"parseResults": []
|
|
120
|
+
},
|
|
121
|
+
"id": "resolved",
|
|
122
|
+
"spaceId": "space",
|
|
123
|
+
"runId": "run",
|
|
124
|
+
"version": 1,
|
|
125
|
+
"status": "RESOLVED",
|
|
126
|
+
"createdAt": 2000,
|
|
127
|
+
"updatedAt": 3000,
|
|
128
|
+
"resolution": {
|
|
129
|
+
"action": "APPLY",
|
|
130
|
+
"operationId": "fixture-apply",
|
|
131
|
+
"handledAt": 3000,
|
|
132
|
+
"actor": {
|
|
133
|
+
"kind": "user",
|
|
134
|
+
"userId": "fixture-user"
|
|
135
|
+
},
|
|
136
|
+
"resourceIds": {
|
|
137
|
+
"automationId": "fixture-automation"
|
|
138
|
+
},
|
|
139
|
+
"result": {
|
|
140
|
+
"status": "partial",
|
|
141
|
+
"data": {
|
|
142
|
+
"automationId": "fixture-automation",
|
|
143
|
+
"saved": true
|
|
144
|
+
},
|
|
145
|
+
"warnings": [
|
|
146
|
+
{
|
|
147
|
+
"code": "ENABLE_FAILED",
|
|
148
|
+
"message": "Saved, but enabling failed"
|
|
149
|
+
}
|
|
150
|
+
]
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
]
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"manifest": "mhome.app-facade.v1",
|
|
3
|
-
"contractVersion": "1.
|
|
3
|
+
"contractVersion": "1.158.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",
|
|
@@ -535,7 +535,17 @@
|
|
|
535
535
|
},
|
|
536
536
|
"suggestion": {
|
|
537
537
|
"schema": "schema/suggestion.v1.schema.json",
|
|
538
|
-
"contract": "contract/suggestion-v1.md"
|
|
538
|
+
"contract": "contract/suggestion-v1.md",
|
|
539
|
+
"requestTargets": [
|
|
540
|
+
"/app/suggestion/generate",
|
|
541
|
+
"/app/suggestion/generation/get",
|
|
542
|
+
"/app/suggestion/list",
|
|
543
|
+
"/app/suggestion/detail/get",
|
|
544
|
+
"/app/suggestion/handle",
|
|
545
|
+
"/app/suggestion/feedback",
|
|
546
|
+
"/app/suggestion/settings/get",
|
|
547
|
+
"/app/suggestion/settings/save"
|
|
548
|
+
]
|
|
539
549
|
}
|
|
540
550
|
},
|
|
541
551
|
"authorization": "manifest/authorization.v1.json",
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"contractVersion": "1.
|
|
2
|
+
"contractVersion": "1.158.0",
|
|
3
3
|
"operations": {
|
|
4
4
|
"/app/agent/context/get": "spaceRead",
|
|
5
5
|
"/app/agent/conversation/get": "spaceRead",
|
|
@@ -382,7 +382,15 @@
|
|
|
382
382
|
"/app/wave/discover": "spaceManage",
|
|
383
383
|
"/app/wave/list": "spaceManage",
|
|
384
384
|
"/app/wave/refresh": "spaceManage",
|
|
385
|
-
"/app/wave/remove": "spaceManage"
|
|
385
|
+
"/app/wave/remove": "spaceManage",
|
|
386
|
+
"/app/suggestion/detail/get": "spaceRead",
|
|
387
|
+
"/app/suggestion/feedback": "spaceWrite",
|
|
388
|
+
"/app/suggestion/generate": "spaceWrite",
|
|
389
|
+
"/app/suggestion/generation/get": "spaceRead",
|
|
390
|
+
"/app/suggestion/handle": "spaceWrite",
|
|
391
|
+
"/app/suggestion/list": "spaceRead",
|
|
392
|
+
"/app/suggestion/settings/get": "spaceRead",
|
|
393
|
+
"/app/suggestion/settings/save": "spaceWrite"
|
|
386
394
|
},
|
|
387
395
|
"nodePrefix": "/app/plugin/",
|
|
388
396
|
"serviceOperations": [
|
|
@@ -52,7 +52,9 @@
|
|
|
52
52
|
"ms": [
|
|
53
53
|
"diagnostics.*.timestamp",
|
|
54
54
|
"diagnostics.*.startedAt",
|
|
55
|
-
"diagnostics.*.finishedAt"
|
|
55
|
+
"diagnostics.*.finishedAt",
|
|
56
|
+
"diagnostics.*.availableAt",
|
|
57
|
+
"diagnostics.*.expiresAt"
|
|
56
58
|
]
|
|
57
59
|
},
|
|
58
60
|
"/app/group/list": {
|
|
@@ -509,5 +511,40 @@
|
|
|
509
511
|
"results.*.items.*.latest.event.timestamp",
|
|
510
512
|
"results.*.items.*.latest.log.timestamp"
|
|
511
513
|
]
|
|
514
|
+
},
|
|
515
|
+
"/app/suggestion/generate": {
|
|
516
|
+
"ms": [
|
|
517
|
+
"run.startedAt",
|
|
518
|
+
"run.finishedAt"
|
|
519
|
+
]
|
|
520
|
+
},
|
|
521
|
+
"/app/suggestion/generation/get": {
|
|
522
|
+
"ms": [
|
|
523
|
+
"run.startedAt",
|
|
524
|
+
"run.finishedAt"
|
|
525
|
+
]
|
|
526
|
+
},
|
|
527
|
+
"/app/suggestion/list": {
|
|
528
|
+
"ms": [
|
|
529
|
+
"items.*.createdAt",
|
|
530
|
+
"items.*.updatedAt",
|
|
531
|
+
"items.*.expiresAt"
|
|
532
|
+
]
|
|
533
|
+
},
|
|
534
|
+
"/app/suggestion/detail/get": {
|
|
535
|
+
"ms": [
|
|
536
|
+
"createdAt",
|
|
537
|
+
"updatedAt",
|
|
538
|
+
"expiresAt",
|
|
539
|
+
"evidence.*.occurredAt",
|
|
540
|
+
"resolution.handledAt"
|
|
541
|
+
]
|
|
542
|
+
},
|
|
543
|
+
"/app/suggestion/feedback": {
|
|
544
|
+
"ms": [
|
|
545
|
+
"createdAt",
|
|
546
|
+
"updatedAt",
|
|
547
|
+
"expiresAt"
|
|
548
|
+
]
|
|
512
549
|
}
|
|
513
550
|
}
|
|
@@ -232,6 +232,50 @@
|
|
|
232
232
|
],
|
|
233
233
|
"output": [],
|
|
234
234
|
"hook": "circadianDelete"
|
|
235
|
+
},
|
|
236
|
+
{
|
|
237
|
+
"target": "/app/suggestion/generate",
|
|
238
|
+
"event": "suggestion.generate",
|
|
239
|
+
"input": [],
|
|
240
|
+
"output": [
|
|
241
|
+
"accepted",
|
|
242
|
+
"run"
|
|
243
|
+
]
|
|
244
|
+
},
|
|
245
|
+
{
|
|
246
|
+
"target": "/app/suggestion/handle",
|
|
247
|
+
"event": "suggestion.handle",
|
|
248
|
+
"input": [
|
|
249
|
+
"suggestionId",
|
|
250
|
+
"expectedVersion",
|
|
251
|
+
"action"
|
|
252
|
+
],
|
|
253
|
+
"output": [
|
|
254
|
+
"automationId",
|
|
255
|
+
"enabled"
|
|
256
|
+
]
|
|
257
|
+
},
|
|
258
|
+
{
|
|
259
|
+
"target": "/app/suggestion/feedback",
|
|
260
|
+
"event": "suggestion.dismiss",
|
|
261
|
+
"input": [
|
|
262
|
+
"suggestionId",
|
|
263
|
+
"expectedVersion"
|
|
264
|
+
],
|
|
265
|
+
"output": [
|
|
266
|
+
"id",
|
|
267
|
+
"status"
|
|
268
|
+
]
|
|
269
|
+
},
|
|
270
|
+
{
|
|
271
|
+
"target": "/app/suggestion/settings/save",
|
|
272
|
+
"event": "suggestion.settings",
|
|
273
|
+
"input": [
|
|
274
|
+
"enabled"
|
|
275
|
+
],
|
|
276
|
+
"output": [
|
|
277
|
+
"enabled"
|
|
278
|
+
]
|
|
235
279
|
}
|
|
236
280
|
],
|
|
237
281
|
"deviceCommands": {
|
package/manifest/routing.v1.json
CHANGED
package/manifest/targets.v1.json
CHANGED
package/package.json
CHANGED
package/protocol.json
CHANGED
|
@@ -1340,12 +1340,33 @@
|
|
|
1340
1340
|
"enabled": {
|
|
1341
1341
|
"type": "boolean",
|
|
1342
1342
|
"default": true
|
|
1343
|
+
},
|
|
1344
|
+
"intervalMinutes": {
|
|
1345
|
+
"type": "integer",
|
|
1346
|
+
"minimum": 1,
|
|
1347
|
+
"maximum": 4294967295,
|
|
1348
|
+
"default": 360
|
|
1343
1349
|
}
|
|
1344
1350
|
},
|
|
1345
1351
|
"required": [
|
|
1346
1352
|
"enabled"
|
|
1347
1353
|
],
|
|
1348
1354
|
"additionalProperties": false
|
|
1355
|
+
},
|
|
1356
|
+
"SaveSettingsInput": {
|
|
1357
|
+
"type": "object",
|
|
1358
|
+
"properties": {
|
|
1359
|
+
"enabled": {
|
|
1360
|
+
"type": "boolean"
|
|
1361
|
+
},
|
|
1362
|
+
"intervalMinutes": {
|
|
1363
|
+
"type": "integer",
|
|
1364
|
+
"minimum": 1,
|
|
1365
|
+
"maximum": 4294967295
|
|
1366
|
+
}
|
|
1367
|
+
},
|
|
1368
|
+
"minProperties": 1,
|
|
1369
|
+
"additionalProperties": false
|
|
1349
1370
|
}
|
|
1350
1371
|
}
|
|
1351
1372
|
}
|