@mhome/app-facade-protocol 1.154.0 → 1.155.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 +41 -0
- package/fixtures/presentation/cases.json +72 -30
- package/manifest/app-facade.v1.json +5 -1
- package/manifest/authorization.v1.json +4 -1
- 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 +3 -2
- 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.v1.schema.json +92 -0
|
@@ -44,3 +44,44 @@ calls and prepared commits, in Full and Essential presentation.
|
|
|
44
44
|
A partially deleted definition remains available for deletion with the same ID.
|
|
45
45
|
Existing cleanup steps tolerate resources already removed by an earlier attempt.
|
|
46
46
|
An already absent and cleaned definition is a completed delete target.
|
|
47
|
+
|
|
48
|
+
## Single execution control and evidence
|
|
49
|
+
|
|
50
|
+
- `/app/automation/instance/list` takes `{automationId}` and returns
|
|
51
|
+
`{instances: [{threadId, instanceId, revision, phase, startedAt}]}`. Only active
|
|
52
|
+
runs are listed, oldest start first. `phase` is `EXECUTING`, `WAITING`, `QUEUEING`
|
|
53
|
+
or `STOPPING`. Full times are epoch milliseconds; Essential uses Home time.
|
|
54
|
+
- `/app/automation/instance/stop` takes `{automationId, threadId, instanceId}`.
|
|
55
|
+
It fences that instance, captures its execution facts durably, and closes it.
|
|
56
|
+
It leaves other instances and future recurring triggers enabled. The response
|
|
57
|
+
is `{automationId, threadId, instanceId, state, outcome}`. `STOPPING` means the
|
|
58
|
+
executing worker has not completed capture; repeat the same request to observe
|
|
59
|
+
completion. `FINISHED` reports the authoritative terminal outcome. A run that
|
|
60
|
+
completed before the stop request keeps its actual outcome; ordinary success
|
|
61
|
+
may already have discarded its details. Already performed effects are not undone.
|
|
62
|
+
A started external call without a result is uncertain, not a confirmed failure.
|
|
63
|
+
- `/app/automation/diagnostic/get` takes `{automationId}` and lists retained
|
|
64
|
+
execution metadata across all threads, newest first. Bodies are read separately.
|
|
65
|
+
- `/app/automation/diagnostic/read` takes the execution identity and optional
|
|
66
|
+
`cursor`, and returns `{logs, nextCursor}`. Follow the opaque cursor for older
|
|
67
|
+
events. Pages contain up to 100 events with a target size of 256 KiB; a single
|
|
68
|
+
larger event is returned intact. Pagination never removes stored content.
|
|
69
|
+
Missing or damaged bodies produce an error; they are never represented as an
|
|
70
|
+
empty successful page.
|
|
71
|
+
|
|
72
|
+
Events contain `sequence`, `timestamp`, `kind`, `operationId`, `level`, `message`
|
|
73
|
+
and `details`. Ordinary events describe actual action/read requests, their results,
|
|
74
|
+
and scheduled waits. Paired events share an operation ID. Schema-declared sensitive
|
|
75
|
+
request fields are excluded. DEBUG adds internal compiler/interpreter flow. JSONL
|
|
76
|
+
storage uses epoch milliseconds; Essential renders timestamps in Home time without
|
|
77
|
+
changing stored instants. Agent fetches source through the standard source interface;
|
|
78
|
+
execution records never duplicate the original Plan or source.
|
|
79
|
+
|
|
80
|
+
Normal success discards details. Failures/interruption, DEBUG and explicit capture
|
|
81
|
+
retain at most ten instances per thread across revisions. Activity summaries have
|
|
82
|
+
separate retention. Checkpoints persist only new immutable JSONL segments and a
|
|
83
|
+
constant-size head reference, plus runtime memory. An empty segment is not written.
|
|
84
|
+
The Plan is fetched by automation/thread and must match the run's revision; a missing
|
|
85
|
+
or changed Plan ends the old run. Generation and ownership checks still apply.
|
|
86
|
+
A process crash can lose events since its last checkpoint. Explicit stop confirms
|
|
87
|
+
completion only after available evidence has been saved, before checkpoint cleanup.
|
|
@@ -342,11 +342,9 @@
|
|
|
342
342
|
"threadId": 0,
|
|
343
343
|
"instanceId": "run",
|
|
344
344
|
"timestamp": 100,
|
|
345
|
-
"status": "
|
|
345
|
+
"status": "FAILED",
|
|
346
346
|
"reportMode": "STD",
|
|
347
347
|
"logCount": 2,
|
|
348
|
-
"omittedLogs": 1,
|
|
349
|
-
"truncated": true,
|
|
350
348
|
"logsMissing": false,
|
|
351
349
|
"failure": {
|
|
352
350
|
"message": "device unavailable",
|
|
@@ -355,18 +353,7 @@
|
|
|
355
353
|
"revision": 3,
|
|
356
354
|
"startedAt": 90,
|
|
357
355
|
"finishedAt": 100,
|
|
358
|
-
"
|
|
359
|
-
{
|
|
360
|
-
"level": "INFO",
|
|
361
|
-
"message": "Invoked device",
|
|
362
|
-
"timestamp": 100
|
|
363
|
-
},
|
|
364
|
-
{
|
|
365
|
-
"level": "ERROR",
|
|
366
|
-
"message": "Timed out",
|
|
367
|
-
"timestamp": 100
|
|
368
|
-
}
|
|
369
|
-
]
|
|
356
|
+
"captured": false
|
|
370
357
|
}
|
|
371
358
|
]
|
|
372
359
|
},
|
|
@@ -378,11 +365,9 @@
|
|
|
378
365
|
"threadId": 0,
|
|
379
366
|
"instanceId": "run",
|
|
380
367
|
"timestamp": "1970-01-01 00:00:00.100 +00:00 (UTC)",
|
|
381
|
-
"status": "
|
|
368
|
+
"status": "FAILED",
|
|
382
369
|
"reportMode": "STD",
|
|
383
370
|
"logCount": 2,
|
|
384
|
-
"omittedLogs": 1,
|
|
385
|
-
"truncated": true,
|
|
386
371
|
"logsMissing": false,
|
|
387
372
|
"failure": {
|
|
388
373
|
"message": "device unavailable",
|
|
@@ -391,18 +376,7 @@
|
|
|
391
376
|
"revision": 3,
|
|
392
377
|
"startedAt": "1970-01-01 00:00:00.090 +00:00 (UTC)",
|
|
393
378
|
"finishedAt": "1970-01-01 00:00:00.100 +00:00 (UTC)",
|
|
394
|
-
"
|
|
395
|
-
{
|
|
396
|
-
"level": "INFO",
|
|
397
|
-
"message": "Invoked device",
|
|
398
|
-
"timestamp": "1970-01-01 00:00:00.100 +00:00 (UTC)"
|
|
399
|
-
},
|
|
400
|
-
{
|
|
401
|
-
"level": "ERROR",
|
|
402
|
-
"message": "Timed out",
|
|
403
|
-
"timestamp": "1970-01-01 00:00:00.100 +00:00 (UTC)"
|
|
404
|
-
}
|
|
405
|
-
]
|
|
379
|
+
"captured": false
|
|
406
380
|
}
|
|
407
381
|
]
|
|
408
382
|
}
|
|
@@ -5041,5 +5015,73 @@
|
|
|
5041
5015
|
}
|
|
5042
5016
|
},
|
|
5043
5017
|
"code": "OPERATION_FAILED"
|
|
5018
|
+
},
|
|
5019
|
+
{
|
|
5020
|
+
"name": "automation-diagnostic-read",
|
|
5021
|
+
"target": "/app/automation/diagnostic/read",
|
|
5022
|
+
"timezone": "Asia/Shanghai",
|
|
5023
|
+
"status": "success",
|
|
5024
|
+
"data": {
|
|
5025
|
+
"logs": [
|
|
5026
|
+
{
|
|
5027
|
+
"sequence": 1,
|
|
5028
|
+
"kind": "wait.started",
|
|
5029
|
+
"operationId": "visit-1",
|
|
5030
|
+
"level": "INFO",
|
|
5031
|
+
"message": "Waiting",
|
|
5032
|
+
"timestamp": 100,
|
|
5033
|
+
"details": {
|
|
5034
|
+
"dueAt": 1200100,
|
|
5035
|
+
"taskId": 3
|
|
5036
|
+
}
|
|
5037
|
+
}
|
|
5038
|
+
],
|
|
5039
|
+
"nextCursor": "opaque"
|
|
5040
|
+
},
|
|
5041
|
+
"essential": {
|
|
5042
|
+
"logs": [
|
|
5043
|
+
{
|
|
5044
|
+
"sequence": 1,
|
|
5045
|
+
"kind": "wait.started",
|
|
5046
|
+
"operationId": "visit-1",
|
|
5047
|
+
"level": "INFO",
|
|
5048
|
+
"message": "Waiting",
|
|
5049
|
+
"timestamp": "1970-01-01 08:00:00.100 +08:00 (Asia/Shanghai)",
|
|
5050
|
+
"details": {
|
|
5051
|
+
"dueAt": "1970-01-01 08:20:00.100 +08:00 (Asia/Shanghai)",
|
|
5052
|
+
"taskId": 3
|
|
5053
|
+
}
|
|
5054
|
+
}
|
|
5055
|
+
],
|
|
5056
|
+
"nextCursor": "opaque"
|
|
5057
|
+
}
|
|
5058
|
+
},
|
|
5059
|
+
{
|
|
5060
|
+
"name": "automation-instance-list",
|
|
5061
|
+
"target": "/app/automation/instance/list",
|
|
5062
|
+
"timezone": "Asia/Shanghai",
|
|
5063
|
+
"status": "success",
|
|
5064
|
+
"data": {
|
|
5065
|
+
"instances": [
|
|
5066
|
+
{
|
|
5067
|
+
"threadId": 0,
|
|
5068
|
+
"instanceId": "run",
|
|
5069
|
+
"revision": 3,
|
|
5070
|
+
"phase": "STOPPING",
|
|
5071
|
+
"startedAt": 100
|
|
5072
|
+
}
|
|
5073
|
+
]
|
|
5074
|
+
},
|
|
5075
|
+
"essential": {
|
|
5076
|
+
"instances": [
|
|
5077
|
+
{
|
|
5078
|
+
"threadId": 0,
|
|
5079
|
+
"instanceId": "run",
|
|
5080
|
+
"revision": 3,
|
|
5081
|
+
"phase": "STOPPING",
|
|
5082
|
+
"startedAt": "1970-01-01 08:00:00.100 +08:00 (Asia/Shanghai)"
|
|
5083
|
+
}
|
|
5084
|
+
]
|
|
5085
|
+
}
|
|
5044
5086
|
}
|
|
5045
5087
|
]
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"manifest": "mhome.app-facade.v1",
|
|
3
|
-
"contractVersion": "1.
|
|
3
|
+
"contractVersion": "1.155.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",
|
|
@@ -395,6 +395,10 @@
|
|
|
395
395
|
"requestTargets": [
|
|
396
396
|
"/app/automation/start",
|
|
397
397
|
"/app/automation/stop",
|
|
398
|
+
"/app/automation/instance/stop",
|
|
399
|
+
"/app/automation/instance/list",
|
|
400
|
+
"/app/automation/diagnostic/get",
|
|
401
|
+
"/app/automation/diagnostic/read",
|
|
398
402
|
"/app/automation/rename",
|
|
399
403
|
"/app/automation/description/update"
|
|
400
404
|
]
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"contractVersion": "1.
|
|
2
|
+
"contractVersion": "1.155.0",
|
|
3
3
|
"operations": {
|
|
4
4
|
"/app/agent/context/get": "spaceRead",
|
|
5
5
|
"/app/agent/conversation/get": "spaceRead",
|
|
@@ -39,6 +39,9 @@
|
|
|
39
39
|
"/app/automation/description/update": "spaceWrite",
|
|
40
40
|
"/app/automation/detail/get": "spaceRead",
|
|
41
41
|
"/app/automation/diagnostic/get": "spaceRead",
|
|
42
|
+
"/app/automation/diagnostic/read": "spaceRead",
|
|
43
|
+
"/app/automation/instance/stop": "spaceWrite",
|
|
44
|
+
"/app/automation/instance/list": "spaceRead",
|
|
42
45
|
"/app/automation/list": "spaceRead",
|
|
43
46
|
"/app/automation/rename": "spaceWrite",
|
|
44
47
|
"/app/automation/save": "spaceWrite",
|
|
@@ -46,12 +46,13 @@
|
|
|
46
46
|
"schedules.*.timestamp"
|
|
47
47
|
]
|
|
48
48
|
},
|
|
49
|
+
"/app/automation/instance/list": { "ms": ["instances.*.startedAt"] },
|
|
50
|
+
"/app/automation/diagnostic/read": { "ms": ["logs.*.timestamp", "logs.*.details.dueAt"] },
|
|
49
51
|
"/app/automation/diagnostic/get": {
|
|
50
52
|
"ms": [
|
|
51
53
|
"diagnostics.*.timestamp",
|
|
52
54
|
"diagnostics.*.startedAt",
|
|
53
|
-
"diagnostics.*.finishedAt"
|
|
54
|
-
"diagnostics.*.logs.*.timestamp"
|
|
55
|
+
"diagnostics.*.finishedAt"
|
|
55
56
|
]
|
|
56
57
|
},
|
|
57
58
|
"/app/group/list": {
|
package/manifest/routing.v1.json
CHANGED
package/manifest/targets.v1.json
CHANGED
package/package.json
CHANGED
package/protocol.json
CHANGED
|
@@ -137,6 +137,98 @@
|
|
|
137
137
|
}
|
|
138
138
|
}
|
|
139
139
|
]
|
|
140
|
+
},
|
|
141
|
+
"instanceInput": {
|
|
142
|
+
"type": "object",
|
|
143
|
+
"additionalProperties": false,
|
|
144
|
+
"properties": {
|
|
145
|
+
"automationId": {
|
|
146
|
+
"type": "string",
|
|
147
|
+
"pattern": "\\S"
|
|
148
|
+
},
|
|
149
|
+
"threadId": {
|
|
150
|
+
"type": "integer",
|
|
151
|
+
"minimum": 0
|
|
152
|
+
},
|
|
153
|
+
"instanceId": {
|
|
154
|
+
"type": "string",
|
|
155
|
+
"pattern": "\\S"
|
|
156
|
+
}
|
|
157
|
+
},
|
|
158
|
+
"required": [
|
|
159
|
+
"automationId",
|
|
160
|
+
"threadId",
|
|
161
|
+
"instanceId"
|
|
162
|
+
]
|
|
163
|
+
},
|
|
164
|
+
"diagnosticReadInput": {
|
|
165
|
+
"type": "object",
|
|
166
|
+
"additionalProperties": false,
|
|
167
|
+
"properties": {
|
|
168
|
+
"automationId": {
|
|
169
|
+
"type": "string",
|
|
170
|
+
"pattern": "\\S"
|
|
171
|
+
},
|
|
172
|
+
"threadId": {
|
|
173
|
+
"type": "integer",
|
|
174
|
+
"minimum": 0
|
|
175
|
+
},
|
|
176
|
+
"instanceId": {
|
|
177
|
+
"type": "string",
|
|
178
|
+
"pattern": "\\S"
|
|
179
|
+
},
|
|
180
|
+
"cursor": {
|
|
181
|
+
"type": [
|
|
182
|
+
"string",
|
|
183
|
+
"null"
|
|
184
|
+
]
|
|
185
|
+
}
|
|
186
|
+
},
|
|
187
|
+
"required": [
|
|
188
|
+
"automationId",
|
|
189
|
+
"threadId",
|
|
190
|
+
"instanceId"
|
|
191
|
+
]
|
|
192
|
+
},
|
|
193
|
+
"instanceStopOutput": {
|
|
194
|
+
"type": "object",
|
|
195
|
+
"additionalProperties": false,
|
|
196
|
+
"properties": {
|
|
197
|
+
"automationId": {
|
|
198
|
+
"type": "string",
|
|
199
|
+
"pattern": "\\S"
|
|
200
|
+
},
|
|
201
|
+
"threadId": {
|
|
202
|
+
"type": "integer",
|
|
203
|
+
"minimum": 0
|
|
204
|
+
},
|
|
205
|
+
"instanceId": {
|
|
206
|
+
"type": "string",
|
|
207
|
+
"pattern": "\\S"
|
|
208
|
+
},
|
|
209
|
+
"state": {
|
|
210
|
+
"enum": [
|
|
211
|
+
"STOPPING",
|
|
212
|
+
"FINISHED"
|
|
213
|
+
]
|
|
214
|
+
},
|
|
215
|
+
"outcome": {
|
|
216
|
+
"enum": [
|
|
217
|
+
null,
|
|
218
|
+
"SUCCEEDED",
|
|
219
|
+
"FAILED",
|
|
220
|
+
"CANCELLED",
|
|
221
|
+
"INTERRUPTED"
|
|
222
|
+
]
|
|
223
|
+
}
|
|
224
|
+
},
|
|
225
|
+
"required": [
|
|
226
|
+
"automationId",
|
|
227
|
+
"threadId",
|
|
228
|
+
"instanceId",
|
|
229
|
+
"state",
|
|
230
|
+
"outcome"
|
|
231
|
+
]
|
|
140
232
|
}
|
|
141
233
|
}
|
|
142
234
|
}
|