@mhome/app-facade-protocol 1.183.1 → 1.187.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-presentation-v1.md +24 -12
- package/contract/automation-v1.md +2 -1
- package/contract/chat-reference-v1.md +150 -0
- package/contract/entity-extensions-v1.md +125 -32
- package/contract/reference-presentation-v1.md +3 -2
- package/contract/resource-read-v1.md +21 -9
- package/contract/suggestion-v1.md +22 -5
- package/fixtures/automation-failure-codes.json +215 -0
- package/fixtures/chat-reference-projection.conformance.json +305 -0
- package/fixtures/suggestion.conformance.json +165 -0
- package/fixtures/suggestion.migration.json +9 -0
- package/manifest/app-facade.v1.json +5 -3
- package/manifest/authorization.v1.json +4 -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/routing.v1.json +1 -1
- package/manifest/targets.v1.json +1 -1
- package/package.json +1 -1
- package/protocol.json +1 -1
- package/schema/automation-presentation.v1.schema.json +1 -1
- package/schema/suggestion.v1.schema.json +68 -0
|
@@ -0,0 +1,215 @@
|
|
|
1
|
+
{
|
|
2
|
+
"source": "foundation/crates/app-facade-api/fixtures/automation-failure-codes.json",
|
|
3
|
+
"cases": [
|
|
4
|
+
{
|
|
5
|
+
"stage": "automationAdmission",
|
|
6
|
+
"code": "SUPPRESSED",
|
|
7
|
+
"summaryCode": "SUPPRESSED",
|
|
8
|
+
"label": "Last execution suppressed"
|
|
9
|
+
},
|
|
10
|
+
{
|
|
11
|
+
"stage": "execution",
|
|
12
|
+
"code": "SUPPRESSED",
|
|
13
|
+
"summaryCode": "STEP_SUPPRESSED",
|
|
14
|
+
"label": "Last execution failed: action suppressed"
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
"stage": "execution",
|
|
18
|
+
"code": "DEADLINE_EXCEEDED",
|
|
19
|
+
"summaryCode": "DEADLINE_EXCEEDED",
|
|
20
|
+
"label": "Last execution timed out"
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
"stage": "execution",
|
|
24
|
+
"code": "UNREACHABLE",
|
|
25
|
+
"summaryCode": "UNREACHABLE",
|
|
26
|
+
"label": "Last execution failed: connection unavailable"
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
"stage": "execution",
|
|
30
|
+
"code": "WS_CONNECTION_LOST",
|
|
31
|
+
"summaryCode": "WS_CONNECTION_LOST",
|
|
32
|
+
"label": "Last execution failed: connection lost"
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
"stage": "execution",
|
|
36
|
+
"code": "UNAUTHENTICATED",
|
|
37
|
+
"summaryCode": "UNAUTHENTICATED",
|
|
38
|
+
"label": "Last execution failed: sign-in required"
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
"stage": "execution",
|
|
42
|
+
"code": "SESSION_EXPIRED",
|
|
43
|
+
"summaryCode": "SESSION_EXPIRED",
|
|
44
|
+
"label": "Last execution failed: sign-in required"
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
"stage": "execution",
|
|
48
|
+
"code": "UNAUTHORIZED",
|
|
49
|
+
"summaryCode": "UNAUTHORIZED",
|
|
50
|
+
"label": "Last execution failed: permission denied"
|
|
51
|
+
},
|
|
52
|
+
{
|
|
53
|
+
"stage": "execution",
|
|
54
|
+
"code": "HUB_REVOKED",
|
|
55
|
+
"summaryCode": "HUB_REVOKED",
|
|
56
|
+
"label": "Last execution failed: permission denied"
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
"stage": "execution",
|
|
60
|
+
"code": "PHONE_PROVIDER_REVOKED",
|
|
61
|
+
"summaryCode": "PHONE_PROVIDER_REVOKED",
|
|
62
|
+
"label": "Last execution failed: permission denied"
|
|
63
|
+
},
|
|
64
|
+
{
|
|
65
|
+
"stage": "execution",
|
|
66
|
+
"code": "UNSUPPORTED",
|
|
67
|
+
"summaryCode": "UNSUPPORTED",
|
|
68
|
+
"label": "Last execution failed: unsupported operation"
|
|
69
|
+
},
|
|
70
|
+
{
|
|
71
|
+
"stage": "execution",
|
|
72
|
+
"code": "FUNCTION_NO_IMPL",
|
|
73
|
+
"summaryCode": "FUNCTION_NO_IMPL",
|
|
74
|
+
"label": "Last execution failed: unsupported operation"
|
|
75
|
+
},
|
|
76
|
+
{
|
|
77
|
+
"stage": "execution",
|
|
78
|
+
"code": "PRECONDITION_FAIL",
|
|
79
|
+
"summaryCode": "PRECONDITION_FAIL",
|
|
80
|
+
"label": "Last execution failed: requirements not met"
|
|
81
|
+
},
|
|
82
|
+
{
|
|
83
|
+
"stage": "execution",
|
|
84
|
+
"code": "SETUP_SUPERSEDED",
|
|
85
|
+
"summaryCode": "SETUP_SUPERSEDED",
|
|
86
|
+
"label": "Last execution failed: requirements not met"
|
|
87
|
+
},
|
|
88
|
+
{
|
|
89
|
+
"stage": "execution",
|
|
90
|
+
"code": "CONFLICT",
|
|
91
|
+
"summaryCode": "CONFLICT",
|
|
92
|
+
"label": "Last execution failed: requirements not met"
|
|
93
|
+
},
|
|
94
|
+
{
|
|
95
|
+
"stage": "execution",
|
|
96
|
+
"code": "RATE_LIMIT",
|
|
97
|
+
"summaryCode": "RATE_LIMIT",
|
|
98
|
+
"label": "Last execution failed: rate limited"
|
|
99
|
+
},
|
|
100
|
+
{
|
|
101
|
+
"stage": "execution",
|
|
102
|
+
"code": "NOT_FOUND",
|
|
103
|
+
"summaryCode": "NOT_FOUND",
|
|
104
|
+
"label": "Last execution failed: resource not found"
|
|
105
|
+
},
|
|
106
|
+
{
|
|
107
|
+
"stage": "execution",
|
|
108
|
+
"code": "ALREADY_EXISTS",
|
|
109
|
+
"summaryCode": "ALREADY_EXISTS",
|
|
110
|
+
"label": "Last execution failed: resource already exists"
|
|
111
|
+
},
|
|
112
|
+
{
|
|
113
|
+
"stage": "execution",
|
|
114
|
+
"code": "BAD_REQUEST",
|
|
115
|
+
"summaryCode": "BAD_REQUEST",
|
|
116
|
+
"label": "Last execution failed: invalid input"
|
|
117
|
+
},
|
|
118
|
+
{
|
|
119
|
+
"stage": "execution",
|
|
120
|
+
"code": "INVALID_WIDGET_DEFINITION",
|
|
121
|
+
"summaryCode": "INVALID_WIDGET_DEFINITION",
|
|
122
|
+
"label": "Last execution failed: invalid input"
|
|
123
|
+
},
|
|
124
|
+
{
|
|
125
|
+
"stage": "execution",
|
|
126
|
+
"code": "TEMPORARY_UNAVAILABLE",
|
|
127
|
+
"summaryCode": "TEMPORARY_UNAVAILABLE",
|
|
128
|
+
"label": "Last execution failed: temporarily unavailable"
|
|
129
|
+
},
|
|
130
|
+
{
|
|
131
|
+
"stage": "execution",
|
|
132
|
+
"code": "RESOURCE_LOCKED",
|
|
133
|
+
"summaryCode": "RESOURCE_LOCKED",
|
|
134
|
+
"label": "Last execution failed: resource busy"
|
|
135
|
+
},
|
|
136
|
+
{
|
|
137
|
+
"stage": "execution",
|
|
138
|
+
"code": "ERROR_LOCK",
|
|
139
|
+
"summaryCode": "ERROR_LOCK",
|
|
140
|
+
"label": "Last execution failed: resource busy"
|
|
141
|
+
},
|
|
142
|
+
{
|
|
143
|
+
"stage": "execution",
|
|
144
|
+
"code": "BILL_TOKEN_EXCEED",
|
|
145
|
+
"summaryCode": "BILL_TOKEN_EXCEED",
|
|
146
|
+
"label": "Last execution failed: usage limit reached"
|
|
147
|
+
},
|
|
148
|
+
{
|
|
149
|
+
"stage": "execution",
|
|
150
|
+
"code": "BILL_AUTOMATION_EXCEED",
|
|
151
|
+
"summaryCode": "BILL_AUTOMATION_EXCEED",
|
|
152
|
+
"label": "Last execution failed: usage limit reached"
|
|
153
|
+
},
|
|
154
|
+
{
|
|
155
|
+
"stage": "execution",
|
|
156
|
+
"code": "SCRIPT_ERROR",
|
|
157
|
+
"summaryCode": "SCRIPT_ERROR",
|
|
158
|
+
"label": "Last execution failed: script error"
|
|
159
|
+
},
|
|
160
|
+
{
|
|
161
|
+
"stage": "execution",
|
|
162
|
+
"code": "SCRIPT_RUNTIME_ERROR",
|
|
163
|
+
"summaryCode": "SCRIPT_RUNTIME_ERROR",
|
|
164
|
+
"label": "Last execution failed: script error"
|
|
165
|
+
},
|
|
166
|
+
{
|
|
167
|
+
"stage": "execution",
|
|
168
|
+
"code": "SCRIPT_INVALID_OUTPUT",
|
|
169
|
+
"summaryCode": "SCRIPT_INVALID_OUTPUT",
|
|
170
|
+
"label": "Last execution failed: script error"
|
|
171
|
+
},
|
|
172
|
+
{
|
|
173
|
+
"stage": "execution",
|
|
174
|
+
"code": "INVALID_SCRIPT",
|
|
175
|
+
"summaryCode": "INVALID_SCRIPT",
|
|
176
|
+
"label": "Last execution failed: script error"
|
|
177
|
+
},
|
|
178
|
+
{
|
|
179
|
+
"stage": "execution",
|
|
180
|
+
"code": "SCRIPT_RUNTIME_UNAVAILABLE",
|
|
181
|
+
"summaryCode": "SCRIPT_RUNTIME_UNAVAILABLE",
|
|
182
|
+
"label": "Last execution failed: script runtime unavailable"
|
|
183
|
+
},
|
|
184
|
+
{
|
|
185
|
+
"stage": "execution",
|
|
186
|
+
"code": "UNKNOWN",
|
|
187
|
+
"summaryCode": null,
|
|
188
|
+
"label": "Last execution failed"
|
|
189
|
+
},
|
|
190
|
+
{
|
|
191
|
+
"stage": "execution",
|
|
192
|
+
"code": "INTERNAL",
|
|
193
|
+
"summaryCode": null,
|
|
194
|
+
"label": "Last execution failed"
|
|
195
|
+
},
|
|
196
|
+
{
|
|
197
|
+
"stage": "execution",
|
|
198
|
+
"code": "EXECUTION_FAILED",
|
|
199
|
+
"summaryCode": null,
|
|
200
|
+
"label": "Last execution failed"
|
|
201
|
+
},
|
|
202
|
+
{
|
|
203
|
+
"stage": "execution",
|
|
204
|
+
"code": "RUNTIME_ERROR",
|
|
205
|
+
"summaryCode": null,
|
|
206
|
+
"label": "Last execution failed"
|
|
207
|
+
},
|
|
208
|
+
{
|
|
209
|
+
"stage": "execution",
|
|
210
|
+
"code": "FUTURE_CODE",
|
|
211
|
+
"summaryCode": null,
|
|
212
|
+
"label": "Last execution failed"
|
|
213
|
+
}
|
|
214
|
+
]
|
|
215
|
+
}
|
|
@@ -0,0 +1,305 @@
|
|
|
1
|
+
{
|
|
2
|
+
"schemaVersion": 1,
|
|
3
|
+
"contract": "chat-reference-v1",
|
|
4
|
+
"parseHrefCases": [
|
|
5
|
+
{
|
|
6
|
+
"id": "entity_device",
|
|
7
|
+
"href": "meow://entity?type=basic.device.Device&id=dev_123",
|
|
8
|
+
"expected": {
|
|
9
|
+
"kind": "entity",
|
|
10
|
+
"type": "basic.device.Device",
|
|
11
|
+
"id": "dev_123"
|
|
12
|
+
}
|
|
13
|
+
},
|
|
14
|
+
{
|
|
15
|
+
"id": "entity_group",
|
|
16
|
+
"href": "meow://entity?type=basic.device.Device&id=g%3Aoffice-lights",
|
|
17
|
+
"expected": {
|
|
18
|
+
"kind": "entity",
|
|
19
|
+
"type": "basic.device.Device",
|
|
20
|
+
"id": "g:office-lights"
|
|
21
|
+
}
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
"id": "entity_opaque_id_special_chars_and_bare_plus",
|
|
25
|
+
"href": "meow://entity?type=basic.device.Device&id=provider%3Aa%26b%25c+d%2Be%281%29",
|
|
26
|
+
"expected": {
|
|
27
|
+
"kind": "entity",
|
|
28
|
+
"type": "basic.device.Device",
|
|
29
|
+
"id": "provider:a&b%c+d+e(1)"
|
|
30
|
+
}
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
"id": "automation_basic",
|
|
34
|
+
"href": "meow://automation?id=auto_456",
|
|
35
|
+
"expected": {
|
|
36
|
+
"kind": "automation",
|
|
37
|
+
"id": "auto_456"
|
|
38
|
+
}
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
"id": "widget_with_automation_and_alias",
|
|
42
|
+
"href": "meow://widget?type=data&id=w_1&automation=auto_9",
|
|
43
|
+
"expected": {
|
|
44
|
+
"kind": "widget",
|
|
45
|
+
"type": "basic.widget.DataWidget",
|
|
46
|
+
"id": "w_1",
|
|
47
|
+
"automationId": "auto_9"
|
|
48
|
+
}
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
"id": "route_relative",
|
|
52
|
+
"href": "meow://route?url=L25vdw",
|
|
53
|
+
"expected": {
|
|
54
|
+
"kind": "route",
|
|
55
|
+
"path": "/now"
|
|
56
|
+
}
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
"id": "shortcut_percent_encoded_with_placeholder",
|
|
60
|
+
"href": "meow://shortcut?phrase=Office%20lights%20to%20brightness%20%7B%7BNumber%7D%7D",
|
|
61
|
+
"expected": {
|
|
62
|
+
"kind": "shortcut",
|
|
63
|
+
"phrase": "Office lights to brightness {{Number}}"
|
|
64
|
+
}
|
|
65
|
+
},
|
|
66
|
+
{
|
|
67
|
+
"id": "shortcut_preserves_bare_plus",
|
|
68
|
+
"href": "meow://shortcut?phrase=AC+1%20degree",
|
|
69
|
+
"expected": {
|
|
70
|
+
"kind": "shortcut",
|
|
71
|
+
"phrase": "AC+1 degree"
|
|
72
|
+
}
|
|
73
|
+
},
|
|
74
|
+
{
|
|
75
|
+
"id": "suggestion_basic",
|
|
76
|
+
"href": "meow://suggestion?id=sug_789",
|
|
77
|
+
"expected": {
|
|
78
|
+
"kind": "suggestion",
|
|
79
|
+
"id": "sug_789"
|
|
80
|
+
}
|
|
81
|
+
},
|
|
82
|
+
{
|
|
83
|
+
"id": "reject_non_meow_scheme",
|
|
84
|
+
"href": "https://example.com/entity?type=basic.device.Device&id=1",
|
|
85
|
+
"expected": null
|
|
86
|
+
},
|
|
87
|
+
{
|
|
88
|
+
"id": "reject_unknown_kind",
|
|
89
|
+
"href": "meow://unknown?id=1",
|
|
90
|
+
"expected": null
|
|
91
|
+
},
|
|
92
|
+
{
|
|
93
|
+
"id": "reject_entity_missing_type",
|
|
94
|
+
"href": "meow://entity?id=dev_1",
|
|
95
|
+
"expected": null
|
|
96
|
+
},
|
|
97
|
+
{
|
|
98
|
+
"id": "reject_duplicate_param",
|
|
99
|
+
"href": "meow://automation?id=a1&id=a2",
|
|
100
|
+
"expected": null
|
|
101
|
+
},
|
|
102
|
+
{
|
|
103
|
+
"id": "reject_userinfo",
|
|
104
|
+
"href": "meow://user@automation?id=a1",
|
|
105
|
+
"expected": null
|
|
106
|
+
},
|
|
107
|
+
{
|
|
108
|
+
"id": "reject_port",
|
|
109
|
+
"href": "meow://automation:8080?id=a1",
|
|
110
|
+
"expected": null
|
|
111
|
+
},
|
|
112
|
+
{
|
|
113
|
+
"id": "reject_extra_path",
|
|
114
|
+
"href": "meow://automation/extra?id=a1",
|
|
115
|
+
"expected": null
|
|
116
|
+
},
|
|
117
|
+
{
|
|
118
|
+
"id": "reject_fragment",
|
|
119
|
+
"href": "meow://automation?id=a1#sec",
|
|
120
|
+
"expected": null
|
|
121
|
+
},
|
|
122
|
+
{
|
|
123
|
+
"id": "reject_malformed_percent",
|
|
124
|
+
"href": "meow://automation?id=%ZZ",
|
|
125
|
+
"expected": null
|
|
126
|
+
},
|
|
127
|
+
{
|
|
128
|
+
"id": "reject_route_protocol_relative",
|
|
129
|
+
"href": "meow://route?url=Ly9ldmlsLmNvbQ",
|
|
130
|
+
"expected": null
|
|
131
|
+
}
|
|
132
|
+
],
|
|
133
|
+
"serializeCases": [
|
|
134
|
+
{
|
|
135
|
+
"id": "serialize_entity_with_special_chars",
|
|
136
|
+
"input": {
|
|
137
|
+
"kind": "entity",
|
|
138
|
+
"type": "basic.device.Device",
|
|
139
|
+
"id": "p:a&b%c+d(1)",
|
|
140
|
+
"label": "Lamp [1]\nDesk"
|
|
141
|
+
},
|
|
142
|
+
"expected": "[Lamp \\[1\\] Desk](meow://entity?type=basic.device.Device&id=p%3Aa%26b%25c%2Bd%281%29)"
|
|
143
|
+
},
|
|
144
|
+
{
|
|
145
|
+
"id": "serialize_entity_empty_label_never_exposes_id",
|
|
146
|
+
"input": {
|
|
147
|
+
"kind": "entity",
|
|
148
|
+
"type": "basic.device.Device",
|
|
149
|
+
"id": "secret_dev_id",
|
|
150
|
+
"label": ""
|
|
151
|
+
},
|
|
152
|
+
"expected": "[device](meow://entity?type=basic.device.Device&id=secret_dev_id)"
|
|
153
|
+
},
|
|
154
|
+
{
|
|
155
|
+
"id": "serialize_automation",
|
|
156
|
+
"input": {
|
|
157
|
+
"kind": "automation",
|
|
158
|
+
"id": "auto_1",
|
|
159
|
+
"label": "Good Night"
|
|
160
|
+
},
|
|
161
|
+
"expected": "[Good Night](meow://automation?id=auto_1)"
|
|
162
|
+
},
|
|
163
|
+
{
|
|
164
|
+
"id": "serialize_widget_with_automation",
|
|
165
|
+
"input": {
|
|
166
|
+
"kind": "widget",
|
|
167
|
+
"type": "basic.widget.ButtonWidget",
|
|
168
|
+
"id": "w_1",
|
|
169
|
+
"automationId": "auto_1",
|
|
170
|
+
"label": "Evening Lights"
|
|
171
|
+
},
|
|
172
|
+
"expected": "[Evening Lights](meow://widget?type=basic.widget.ButtonWidget&id=w_1&automation=auto_1)"
|
|
173
|
+
},
|
|
174
|
+
{
|
|
175
|
+
"id": "serialize_shortcut_phrase",
|
|
176
|
+
"input": {
|
|
177
|
+
"kind": "shortcut",
|
|
178
|
+
"phrase": "Office lights to brightness {{Number}}",
|
|
179
|
+
"label": "Want to set up a shortcut?"
|
|
180
|
+
},
|
|
181
|
+
"expected": "[Want to set up a shortcut?](meow://shortcut?phrase=Office%20lights%20to%20brightness%20%7B%7BNumber%7D%7D)"
|
|
182
|
+
},
|
|
183
|
+
{
|
|
184
|
+
"id": "serialize_suggestion",
|
|
185
|
+
"input": {
|
|
186
|
+
"kind": "suggestion",
|
|
187
|
+
"id": "sug_42",
|
|
188
|
+
"label": "Turn off forgotten hallway light"
|
|
189
|
+
},
|
|
190
|
+
"expected": "[Turn off forgotten hallway light](meow://suggestion?id=sug_42)"
|
|
191
|
+
}
|
|
192
|
+
],
|
|
193
|
+
"projectionCases": [
|
|
194
|
+
{
|
|
195
|
+
"id": "inline_entity_device",
|
|
196
|
+
"input": "Turned on [Living Room Lamp](meow://entity?type=basic.device.Device&id=dev_1).",
|
|
197
|
+
"expected": "Turned on Living Room Lamp."
|
|
198
|
+
},
|
|
199
|
+
{
|
|
200
|
+
"id": "inline_group",
|
|
201
|
+
"input": "Dimmed [Office Lights](meow://entity?type=basic.device.Device&id=g%3Aoffice-1).",
|
|
202
|
+
"expected": "Dimmed Office Lights."
|
|
203
|
+
},
|
|
204
|
+
{
|
|
205
|
+
"id": "inline_automation",
|
|
206
|
+
"input": "Updated [Night Mode](meow://automation?id=auto_123).",
|
|
207
|
+
"expected": "Updated Night Mode."
|
|
208
|
+
},
|
|
209
|
+
{
|
|
210
|
+
"id": "inline_widget",
|
|
211
|
+
"input": "Added [Brightness](meow://widget?type=basic.widget.DataWidget&id=w_1&automation=auto_1).",
|
|
212
|
+
"expected": "Added Brightness."
|
|
213
|
+
},
|
|
214
|
+
{
|
|
215
|
+
"id": "inline_route",
|
|
216
|
+
"input": "Open [Now](meow://route?url=L25vdw) to inspect.",
|
|
217
|
+
"expected": "Open Now to inspect."
|
|
218
|
+
},
|
|
219
|
+
{
|
|
220
|
+
"id": "inline_suggestion",
|
|
221
|
+
"input": "Review [Evening Lights Suggestion](meow://suggestion?id=sug_1).",
|
|
222
|
+
"expected": "Review Evening Lights Suggestion."
|
|
223
|
+
},
|
|
224
|
+
{
|
|
225
|
+
"id": "inline_shortcut_encoded",
|
|
226
|
+
"input": "It's 72°F. [Want to set up a shortcut?](meow://shortcut?phrase=Office%20lights%20to%20brightness%20%7B%7BNumber%7D%7D)",
|
|
227
|
+
"expected": "It's 72°F. Want to set up a shortcut?"
|
|
228
|
+
},
|
|
229
|
+
{
|
|
230
|
+
"id": "inline_shortcut_angle_brackets",
|
|
231
|
+
"input": "Done. [Set up a shortcut?](<meow://shortcut?phrase=Office lights to brightness {{Number}}>)",
|
|
232
|
+
"expected": "Done. Set up a shortcut?"
|
|
233
|
+
},
|
|
234
|
+
{
|
|
235
|
+
"id": "inline_shortcut_unencoded_spaces_fallback",
|
|
236
|
+
"input": "Done. [Set up a shortcut?](meow://shortcut?phrase=Office lights to brightness {{Number}})",
|
|
237
|
+
"expected": "Done. Set up a shortcut?"
|
|
238
|
+
},
|
|
239
|
+
{
|
|
240
|
+
"id": "nested_markdown_and_unicode_in_label",
|
|
241
|
+
"input": "Check [**客厅灯** _主灯_](meow://entity?type=basic.device.Device&id=d1) ✅",
|
|
242
|
+
"expected": "Check **客厅灯** _主灯_ ✅"
|
|
243
|
+
},
|
|
244
|
+
{
|
|
245
|
+
"id": "escaped_brackets_in_label",
|
|
246
|
+
"input": "Opened [Lamp \\[1\\]](meow://entity?type=basic.device.Device&id=d1).",
|
|
247
|
+
"expected": "Opened Lamp \\[1\\]."
|
|
248
|
+
},
|
|
249
|
+
{
|
|
250
|
+
"id": "unknown_or_invalid_meow_still_strips_target",
|
|
251
|
+
"input": "See [My Object](meow://future_kind?id=secret_999) and [Broken](meow://entity?id=missing_type).",
|
|
252
|
+
"expected": "See My Object and Broken."
|
|
253
|
+
},
|
|
254
|
+
{
|
|
255
|
+
"id": "empty_label_uses_safe_kind_fallback",
|
|
256
|
+
"input": "Check [](meow://automation?id=secret_auto) and [](meow://entity?type=basic.device.Device&id=secret_dev).",
|
|
257
|
+
"expected": "Check automation and device."
|
|
258
|
+
},
|
|
259
|
+
{
|
|
260
|
+
"id": "autolink_never_leaks_internal_uri",
|
|
261
|
+
"input": "Open <meow://entity?type=basic.device.Device&id=secret_id> and <meow://automation?id=secret_2>.",
|
|
262
|
+
"expected": "Open device and automation."
|
|
263
|
+
},
|
|
264
|
+
{
|
|
265
|
+
"id": "internal_image_degrades_artifact_image_preserved",
|
|
266
|
+
"input": " and ",
|
|
267
|
+
"expected": "Lamp and "
|
|
268
|
+
},
|
|
269
|
+
{
|
|
270
|
+
"id": "external_links_preserved",
|
|
271
|
+
"input": "See [Docs](https://example.com/a?b=1&c=2) and [Mail](mailto:hi@example.com) with [Lamp](meow://entity?type=basic.device.Device&id=d1).",
|
|
272
|
+
"expected": "See [Docs](https://example.com/a?b=1&c=2) and [Mail](mailto:hi@example.com) with Lamp."
|
|
273
|
+
},
|
|
274
|
+
{
|
|
275
|
+
"id": "reference_style_link_and_definition",
|
|
276
|
+
"input": "Toggle [Lamp][r] and [Docs][ext].\n\n[r]: meow://entity?type=basic.device.Device&id=secret_1\n[ext]: https://example.com",
|
|
277
|
+
"expected": "Toggle Lamp and [Docs][ext].\n\n[ext]: https://example.com"
|
|
278
|
+
},
|
|
279
|
+
{
|
|
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."
|
|
283
|
+
},
|
|
284
|
+
{
|
|
285
|
+
"id": "unclosed_backtick_does_not_suppress_projection",
|
|
286
|
+
"input": "Note ` unclosed backtick then [Lamp](meow://entity?type=basic.device.Device&id=d1).",
|
|
287
|
+
"expected": "Note ` unclosed backtick then Lamp."
|
|
288
|
+
},
|
|
289
|
+
{
|
|
290
|
+
"id": "legacy_xml_tags_and_multiline_shortcut",
|
|
291
|
+
"input": "Checked <MeowEntity type=\"basic.device.Device\" name=\"Kitchen & 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>",
|
|
292
|
+
"expected": "Checked Kitchen & Bar, automation, Temp.\nWant a shortcut\nfor weather?"
|
|
293
|
+
},
|
|
294
|
+
{
|
|
295
|
+
"id": "crlf_line_endings_preserved",
|
|
296
|
+
"input": "Line 1 [Lamp](meow://entity?type=basic.device.Device&id=d1)\r\nLine 2 [Night](meow://automation?id=a1)",
|
|
297
|
+
"expected": "Line 1 Lamp\r\nLine 2 Night"
|
|
298
|
+
},
|
|
299
|
+
{
|
|
300
|
+
"id": "opaque_id_special_chars",
|
|
301
|
+
"input": "Fixed [Sensor](meow://entity?type=basic.device.Device&id=p%3Aa%26b%25c+d%281%29).",
|
|
302
|
+
"expected": "Fixed Sensor."
|
|
303
|
+
}
|
|
304
|
+
]
|
|
305
|
+
}
|
|
@@ -768,6 +768,72 @@
|
|
|
768
768
|
"resourceIds": {}
|
|
769
769
|
}
|
|
770
770
|
}
|
|
771
|
+
},
|
|
772
|
+
{
|
|
773
|
+
"name": "space audience",
|
|
774
|
+
"type": "SuggestionAudience",
|
|
775
|
+
"value": {
|
|
776
|
+
"kind": "space"
|
|
777
|
+
}
|
|
778
|
+
},
|
|
779
|
+
{
|
|
780
|
+
"name": "users audience",
|
|
781
|
+
"type": "SuggestionAudience",
|
|
782
|
+
"value": {
|
|
783
|
+
"kind": "users",
|
|
784
|
+
"userIds": [
|
|
785
|
+
"fixture-alice",
|
|
786
|
+
"fixture-bob"
|
|
787
|
+
]
|
|
788
|
+
}
|
|
789
|
+
},
|
|
790
|
+
{
|
|
791
|
+
"name": "targeted user automation draft",
|
|
792
|
+
"type": "AutomationDraft",
|
|
793
|
+
"value": {
|
|
794
|
+
"type": "AUTOMATION",
|
|
795
|
+
"operation": "CREATE",
|
|
796
|
+
"title": "Desk reminder",
|
|
797
|
+
"summary": "Remind Alice when the desk lamp stays on late",
|
|
798
|
+
"reasons": [
|
|
799
|
+
"Alice repeatedly turned off her study desk lamp after midnight"
|
|
800
|
+
],
|
|
801
|
+
"evidence": [
|
|
802
|
+
{
|
|
803
|
+
"sourceType": "BEHAVIOR",
|
|
804
|
+
"sourceId": "fixture-operation-2",
|
|
805
|
+
"occurredAt": 1200,
|
|
806
|
+
"excerpt": "Alice turned off Desk Lamp at 00:15"
|
|
807
|
+
}
|
|
808
|
+
],
|
|
809
|
+
"audience": {
|
|
810
|
+
"kind": "users",
|
|
811
|
+
"userIds": [
|
|
812
|
+
"fixture-alice"
|
|
813
|
+
]
|
|
814
|
+
},
|
|
815
|
+
"request": "Turn off Alice's desk lamp after midnight"
|
|
816
|
+
}
|
|
817
|
+
},
|
|
818
|
+
{
|
|
819
|
+
"name": "targeted user suggestion summary",
|
|
820
|
+
"type": "SuggestionSummary",
|
|
821
|
+
"value": {
|
|
822
|
+
"id": "fixture-suggestion-2",
|
|
823
|
+
"type": "AUTOMATION",
|
|
824
|
+
"version": 1,
|
|
825
|
+
"title": "Desk reminder",
|
|
826
|
+
"summary": "Remind Alice when the desk lamp stays on late",
|
|
827
|
+
"audience": {
|
|
828
|
+
"kind": "users",
|
|
829
|
+
"userIds": [
|
|
830
|
+
"fixture-alice"
|
|
831
|
+
]
|
|
832
|
+
},
|
|
833
|
+
"status": "PENDING",
|
|
834
|
+
"createdAt": 2000,
|
|
835
|
+
"updatedAt": 2000
|
|
836
|
+
}
|
|
771
837
|
}
|
|
772
838
|
],
|
|
773
839
|
"invalid": [
|
|
@@ -1545,6 +1611,105 @@
|
|
|
1545
1611
|
"feedback": "already done"
|
|
1546
1612
|
}
|
|
1547
1613
|
}
|
|
1614
|
+
},
|
|
1615
|
+
{
|
|
1616
|
+
"name": "users audience rejects empty userIds",
|
|
1617
|
+
"type": "SuggestionAudience",
|
|
1618
|
+
"value": {
|
|
1619
|
+
"kind": "users",
|
|
1620
|
+
"userIds": []
|
|
1621
|
+
}
|
|
1622
|
+
},
|
|
1623
|
+
{
|
|
1624
|
+
"name": "users audience rejects blank userId",
|
|
1625
|
+
"type": "SuggestionAudience",
|
|
1626
|
+
"value": {
|
|
1627
|
+
"kind": "users",
|
|
1628
|
+
"userIds": [
|
|
1629
|
+
" "
|
|
1630
|
+
]
|
|
1631
|
+
}
|
|
1632
|
+
},
|
|
1633
|
+
{
|
|
1634
|
+
"name": "users audience rejects duplicate userIds",
|
|
1635
|
+
"type": "SuggestionAudience",
|
|
1636
|
+
"value": {
|
|
1637
|
+
"kind": "users",
|
|
1638
|
+
"userIds": [
|
|
1639
|
+
"fixture-alice",
|
|
1640
|
+
"fixture-alice"
|
|
1641
|
+
]
|
|
1642
|
+
}
|
|
1643
|
+
},
|
|
1644
|
+
{
|
|
1645
|
+
"name": "space audience rejects userIds",
|
|
1646
|
+
"type": "SuggestionAudience",
|
|
1647
|
+
"value": {
|
|
1648
|
+
"kind": "space",
|
|
1649
|
+
"userIds": [
|
|
1650
|
+
"fixture-alice"
|
|
1651
|
+
]
|
|
1652
|
+
}
|
|
1653
|
+
},
|
|
1654
|
+
{
|
|
1655
|
+
"name": "audience rejects unknown kind",
|
|
1656
|
+
"type": "SuggestionAudience",
|
|
1657
|
+
"value": {
|
|
1658
|
+
"kind": "everyone"
|
|
1659
|
+
}
|
|
1660
|
+
},
|
|
1661
|
+
{
|
|
1662
|
+
"name": "draft rejects null audience",
|
|
1663
|
+
"type": "AutomationDraft",
|
|
1664
|
+
"value": {
|
|
1665
|
+
"type": "AUTOMATION",
|
|
1666
|
+
"operation": "CREATE",
|
|
1667
|
+
"title": "Evening lighting",
|
|
1668
|
+
"summary": "Suggest a lower evening brightness",
|
|
1669
|
+
"reasons": [
|
|
1670
|
+
"Observed manual adjustments"
|
|
1671
|
+
],
|
|
1672
|
+
"evidence": [
|
|
1673
|
+
{
|
|
1674
|
+
"sourceType": "BEHAVIOR",
|
|
1675
|
+
"sourceId": "fixture-operation-1",
|
|
1676
|
+
"occurredAt": 1000,
|
|
1677
|
+
"excerpt": "Brightness 30"
|
|
1678
|
+
}
|
|
1679
|
+
],
|
|
1680
|
+
"audience": null,
|
|
1681
|
+
"request": "Use lower evening brightness"
|
|
1682
|
+
}
|
|
1683
|
+
},
|
|
1684
|
+
{
|
|
1685
|
+
"name": "summary rejects empty users audience",
|
|
1686
|
+
"type": "SuggestionSummary",
|
|
1687
|
+
"value": {
|
|
1688
|
+
"id": "fixture-suggestion-2",
|
|
1689
|
+
"type": "AUTOMATION",
|
|
1690
|
+
"version": 1,
|
|
1691
|
+
"title": "Desk reminder",
|
|
1692
|
+
"summary": "Remind Alice when the desk lamp stays on late",
|
|
1693
|
+
"audience": {
|
|
1694
|
+
"kind": "users",
|
|
1695
|
+
"userIds": []
|
|
1696
|
+
},
|
|
1697
|
+
"status": "PENDING",
|
|
1698
|
+
"createdAt": 2000,
|
|
1699
|
+
"updatedAt": 2000
|
|
1700
|
+
}
|
|
1701
|
+
},
|
|
1702
|
+
{
|
|
1703
|
+
"name": "generate input rejects audience field",
|
|
1704
|
+
"type": "GenerateInput",
|
|
1705
|
+
"value": {
|
|
1706
|
+
"audience": {
|
|
1707
|
+
"kind": "users",
|
|
1708
|
+
"userIds": [
|
|
1709
|
+
"fixture-alice"
|
|
1710
|
+
]
|
|
1711
|
+
}
|
|
1712
|
+
}
|
|
1548
1713
|
}
|
|
1549
1714
|
]
|
|
1550
1715
|
}
|