@mhome/conversation-protocol 5.6.0 → 5.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +25 -0
- package/fixtures/suggestion/conformance.json +204 -0
- package/manifest/targets.v1.json +1 -1
- package/package.json +1 -1
- package/protocol.json +4 -2
- package/schema/execution/suggestion.v1.schema.json +155 -0
package/README.md
CHANGED
|
@@ -45,6 +45,31 @@ Model data is re-exported from `llm-api`; there is one model-message representat
|
|
|
45
45
|
messages intentionally use separate content types and never contain private model continuation.
|
|
46
46
|
Runtime state machines, checkpoint formats, prompts and recovery policy remain in Agent Runtime.
|
|
47
47
|
|
|
48
|
+
### Suggestion execution
|
|
49
|
+
|
|
50
|
+
`SuggestionInvocationContext` declares trusted non-conversation generation with
|
|
51
|
+
a Space, run/operation IDs, trigger and deadline. It never invents a chat thread,
|
|
52
|
+
surface, enrolled Space Client or user actor for scheduled work. Public generate
|
|
53
|
+
input cannot supply this context. Core/Lion admission authenticates and binds it;
|
|
54
|
+
`validate()` only checks shape, not authority.
|
|
55
|
+
|
|
56
|
+
`SuggestionTrigger::Explicit` carries the verified requesting user, who pays for
|
|
57
|
+
that run. `Scheduled` resolves the current Space owner through the existing
|
|
58
|
+
billing adapter. `SuggestionPayer` is a derived reference, not a wire-controlled
|
|
59
|
+
account or an authorization grant. Both kinds produce Space-owned results.
|
|
60
|
+
|
|
61
|
+
The `Llm`, `AppFacade` and `ContextSource` ports accept a context type parameter
|
|
62
|
+
defaulting to the existing `InvocationContext`, preserving ordinary chat adapter
|
|
63
|
+
implementations. Background adapters explicitly use `SuggestionInvocationContext`.
|
|
64
|
+
`ExecutionContext` exposes only shared Space/run/operation metadata and child
|
|
65
|
+
operation derivation; it does not erase the distinct authority contracts. The
|
|
66
|
+
background Facade adapter must restrict access to authorized reads and script
|
|
67
|
+
validation regardless of what the prompt says.
|
|
68
|
+
|
|
69
|
+
`schema/execution/suggestion.v1.schema.json` and its shared conformance fixtures
|
|
70
|
+
define this new context. Existing conversation frames and execution wire payloads
|
|
71
|
+
are unchanged; declaring a context does not dispatch a task or register an RPC.
|
|
72
|
+
|
|
48
73
|
HITL items share one public card contract: `kind` selects approval or user action; `card.type`
|
|
49
74
|
selects trusted frontend presentation and `card.data` retains structured business data. Approval
|
|
50
75
|
responses use approve/reject. User-action responses use continue with required `data` (null when
|
|
@@ -0,0 +1,204 @@
|
|
|
1
|
+
{
|
|
2
|
+
"valid": [
|
|
3
|
+
{
|
|
4
|
+
"name": "scheduled",
|
|
5
|
+
"value": {
|
|
6
|
+
"space": {
|
|
7
|
+
"tenant_id": "tenant-fixture",
|
|
8
|
+
"space_id": "space-fixture"
|
|
9
|
+
},
|
|
10
|
+
"runId": "run-fixture",
|
|
11
|
+
"operationId": "operation-fixture",
|
|
12
|
+
"deadlineUnixMs": 5000,
|
|
13
|
+
"trigger": {
|
|
14
|
+
"type": "SCHEDULED"
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
"name": "explicit member pays",
|
|
20
|
+
"value": {
|
|
21
|
+
"space": {
|
|
22
|
+
"tenant_id": "tenant-fixture",
|
|
23
|
+
"space_id": "space-fixture"
|
|
24
|
+
},
|
|
25
|
+
"runId": "run-fixture",
|
|
26
|
+
"operationId": "operation-fixture",
|
|
27
|
+
"deadlineUnixMs": 5000,
|
|
28
|
+
"trigger": {
|
|
29
|
+
"type": "EXPLICIT",
|
|
30
|
+
"userId": "member-b"
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
"name": "unicode_id_at_limit",
|
|
36
|
+
"value": {
|
|
37
|
+
"space": {
|
|
38
|
+
"tenant_id": "tenant-fixture",
|
|
39
|
+
"space_id": "space-fixture"
|
|
40
|
+
},
|
|
41
|
+
"runId": "猫猫猫猫猫猫猫猫猫猫猫猫猫猫猫猫猫猫猫猫猫猫猫猫猫猫猫猫猫猫猫猫猫猫猫猫猫猫猫猫猫猫猫猫猫猫猫猫猫猫猫猫猫猫猫猫猫猫猫猫猫猫猫猫猫猫猫猫猫猫猫猫猫猫猫猫猫猫猫猫猫猫猫猫猫猫猫猫猫猫猫猫猫猫猫猫猫猫猫猫猫猫猫猫猫猫猫猫猫猫猫猫猫猫猫猫猫猫猫猫猫猫猫猫猫猫猫猫猫猫猫猫猫猫猫猫猫猫猫猫猫猫猫猫猫猫猫猫猫猫猫猫猫猫猫猫猫猫猫猫猫猫猫猫猫猫猫猫猫猫猫猫猫猫猫猫猫猫猫猫猫猫猫猫猫猫猫猫猫猫猫猫猫猫猫猫猫猫猫猫猫猫猫猫猫猫猫猫猫猫猫猫猫猫猫猫猫猫猫猫猫猫猫猫猫猫猫猫猫猫猫猫猫猫猫猫猫猫猫猫猫猫猫猫猫猫猫猫猫猫猫猫猫猫猫猫",
|
|
42
|
+
"operationId": "operation-fixture",
|
|
43
|
+
"deadlineUnixMs": 5000,
|
|
44
|
+
"trigger": {
|
|
45
|
+
"type": "SCHEDULED"
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
"name": "BOM is not identity padding",
|
|
51
|
+
"value": {
|
|
52
|
+
"space": {
|
|
53
|
+
"tenant_id": "tenant-fixture",
|
|
54
|
+
"space_id": "space-fixture"
|
|
55
|
+
},
|
|
56
|
+
"runId": "run-fixture",
|
|
57
|
+
"operationId": "operation-fixture",
|
|
58
|
+
"deadlineUnixMs": 5000,
|
|
59
|
+
"trigger": {
|
|
60
|
+
"type": "SCHEDULED"
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
],
|
|
65
|
+
"invalid": [
|
|
66
|
+
{
|
|
67
|
+
"name": "owner supplied for scheduled",
|
|
68
|
+
"value": {
|
|
69
|
+
"space": {
|
|
70
|
+
"tenant_id": "tenant-fixture",
|
|
71
|
+
"space_id": "space-fixture"
|
|
72
|
+
},
|
|
73
|
+
"runId": "run-fixture",
|
|
74
|
+
"operationId": "operation-fixture",
|
|
75
|
+
"deadlineUnixMs": 5000,
|
|
76
|
+
"trigger": {
|
|
77
|
+
"type": "SCHEDULED",
|
|
78
|
+
"userId": "forged"
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
},
|
|
82
|
+
{
|
|
83
|
+
"name": "explicit lacks user",
|
|
84
|
+
"value": {
|
|
85
|
+
"space": {
|
|
86
|
+
"tenant_id": "tenant-fixture",
|
|
87
|
+
"space_id": "space-fixture"
|
|
88
|
+
},
|
|
89
|
+
"runId": "run-fixture",
|
|
90
|
+
"operationId": "operation-fixture",
|
|
91
|
+
"deadlineUnixMs": 5000,
|
|
92
|
+
"trigger": {
|
|
93
|
+
"type": "EXPLICIT"
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
},
|
|
97
|
+
{
|
|
98
|
+
"name": "missing tenant",
|
|
99
|
+
"value": {
|
|
100
|
+
"space": {
|
|
101
|
+
"space_id": "space-fixture"
|
|
102
|
+
},
|
|
103
|
+
"runId": "run-fixture",
|
|
104
|
+
"operationId": "operation-fixture",
|
|
105
|
+
"deadlineUnixMs": 5000,
|
|
106
|
+
"trigger": {
|
|
107
|
+
"type": "SCHEDULED"
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
},
|
|
111
|
+
{
|
|
112
|
+
"name": "no deadline",
|
|
113
|
+
"value": {
|
|
114
|
+
"space": {
|
|
115
|
+
"tenant_id": "tenant-fixture",
|
|
116
|
+
"space_id": "space-fixture"
|
|
117
|
+
},
|
|
118
|
+
"runId": "run-fixture",
|
|
119
|
+
"operationId": "operation-fixture",
|
|
120
|
+
"deadlineUnixMs": 0,
|
|
121
|
+
"trigger": {
|
|
122
|
+
"type": "SCHEDULED"
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
},
|
|
126
|
+
{
|
|
127
|
+
"name": "oversized deadline",
|
|
128
|
+
"value": {
|
|
129
|
+
"space": {
|
|
130
|
+
"tenant_id": "tenant-fixture",
|
|
131
|
+
"space_id": "space-fixture"
|
|
132
|
+
},
|
|
133
|
+
"runId": "run-fixture",
|
|
134
|
+
"operationId": "operation-fixture",
|
|
135
|
+
"deadlineUnixMs": 9007199254740992,
|
|
136
|
+
"trigger": {
|
|
137
|
+
"type": "SCHEDULED"
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
},
|
|
141
|
+
{
|
|
142
|
+
"name": "no synthetic conversation",
|
|
143
|
+
"value": {
|
|
144
|
+
"space": {
|
|
145
|
+
"tenant_id": "tenant-fixture",
|
|
146
|
+
"space_id": "space-fixture"
|
|
147
|
+
},
|
|
148
|
+
"runId": "run-fixture",
|
|
149
|
+
"operationId": "operation-fixture",
|
|
150
|
+
"deadlineUnixMs": 5000,
|
|
151
|
+
"trigger": {
|
|
152
|
+
"type": "SCHEDULED"
|
|
153
|
+
},
|
|
154
|
+
"threadId": "pretend"
|
|
155
|
+
}
|
|
156
|
+
},
|
|
157
|
+
{
|
|
158
|
+
"name": "no payer override",
|
|
159
|
+
"value": {
|
|
160
|
+
"space": {
|
|
161
|
+
"tenant_id": "tenant-fixture",
|
|
162
|
+
"space_id": "space-fixture"
|
|
163
|
+
},
|
|
164
|
+
"runId": "run-fixture",
|
|
165
|
+
"operationId": "operation-fixture",
|
|
166
|
+
"deadlineUnixMs": 5000,
|
|
167
|
+
"trigger": {
|
|
168
|
+
"type": "SCHEDULED"
|
|
169
|
+
},
|
|
170
|
+
"payer": "owner"
|
|
171
|
+
}
|
|
172
|
+
},
|
|
173
|
+
{
|
|
174
|
+
"name": "no whitespace identity",
|
|
175
|
+
"value": {
|
|
176
|
+
"space": {
|
|
177
|
+
"tenant_id": "tenant-fixture",
|
|
178
|
+
"space_id": "space-fixture"
|
|
179
|
+
},
|
|
180
|
+
"runId": " ",
|
|
181
|
+
"operationId": "operation-fixture",
|
|
182
|
+
"deadlineUnixMs": 5000,
|
|
183
|
+
"trigger": {
|
|
184
|
+
"type": "SCHEDULED"
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
},
|
|
188
|
+
{
|
|
189
|
+
"name": "unicode_id_over_limit",
|
|
190
|
+
"value": {
|
|
191
|
+
"space": {
|
|
192
|
+
"tenant_id": "tenant-fixture",
|
|
193
|
+
"space_id": "space-fixture"
|
|
194
|
+
},
|
|
195
|
+
"runId": "猫猫猫猫猫猫猫猫猫猫猫猫猫猫猫猫猫猫猫猫猫猫猫猫猫猫猫猫猫猫猫猫猫猫猫猫猫猫猫猫猫猫猫猫猫猫猫猫猫猫猫猫猫猫猫猫猫猫猫猫猫猫猫猫猫猫猫猫猫猫猫猫猫猫猫猫猫猫猫猫猫猫猫猫猫猫猫猫猫猫猫猫猫猫猫猫猫猫猫猫猫猫猫猫猫猫猫猫猫猫猫猫猫猫猫猫猫猫猫猫猫猫猫猫猫猫猫猫猫猫猫猫猫猫猫猫猫猫猫猫猫猫猫猫猫猫猫猫猫猫猫猫猫猫猫猫猫猫猫猫猫猫猫猫猫猫猫猫猫猫猫猫猫猫猫猫猫猫猫猫猫猫猫猫猫猫猫猫猫猫猫猫猫猫猫猫猫猫猫猫猫猫猫猫猫猫猫猫猫猫猫猫猫猫猫猫猫猫猫猫猫猫猫猫猫猫猫猫猫猫猫猫猫猫猫猫猫猫猫猫猫猫猫猫猫猫猫猫猫猫猫猫猫猫猫猫猫",
|
|
196
|
+
"operationId": "operation-fixture",
|
|
197
|
+
"deadlineUnixMs": 5000,
|
|
198
|
+
"trigger": {
|
|
199
|
+
"type": "SCHEDULED"
|
|
200
|
+
}
|
|
201
|
+
}
|
|
202
|
+
}
|
|
203
|
+
]
|
|
204
|
+
}
|
package/manifest/targets.v1.json
CHANGED
package/package.json
CHANGED
package/protocol.json
CHANGED
|
@@ -1,14 +1,16 @@
|
|
|
1
1
|
{
|
|
2
2
|
"protocol": "mhome.conversation",
|
|
3
|
-
"contractVersion": "5.
|
|
3
|
+
"contractVersion": "5.7.0",
|
|
4
4
|
"manifest": "manifest/targets.v1.json",
|
|
5
5
|
"schemas": {
|
|
6
6
|
"frame": "schema/conversation-frame.v2.schema.json",
|
|
7
7
|
"execution": "schema/execution/envelope.v1.schema.json",
|
|
8
|
+
"suggestionExecution": "schema/execution/suggestion.v1.schema.json",
|
|
8
9
|
"podTalk": "schema/pod-talk.v1.schema.json"
|
|
9
10
|
},
|
|
10
11
|
"fixtures": {
|
|
11
12
|
"valid": "fixtures",
|
|
12
|
-
"facadeResponse": "fixtures/response/conformance.json"
|
|
13
|
+
"facadeResponse": "fixtures/response/conformance.json",
|
|
14
|
+
"suggestionExecution": "fixtures/suggestion/conformance.json"
|
|
13
15
|
}
|
|
14
16
|
}
|
|
@@ -0,0 +1,155 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "https://mhome.ai/schema/suggestion-execution.v1.schema.json",
|
|
4
|
+
"$comment": "Trusted deployment admission only; not a public generate request. Validation does not authenticate a sender or authorize reads.",
|
|
5
|
+
"$defs": {
|
|
6
|
+
"Space": {
|
|
7
|
+
"type": "object",
|
|
8
|
+
"properties": {
|
|
9
|
+
"tenant_id": {
|
|
10
|
+
"type": "string",
|
|
11
|
+
"minLength": 1,
|
|
12
|
+
"maxLength": 256,
|
|
13
|
+
"allOf": [
|
|
14
|
+
{
|
|
15
|
+
"pattern": "^[^\\u0009-\\u000D\\u0020\\u0085\\u00A0\\u1680\\u2000-\\u200A\\u2028\\u2029\\u202F\\u205F\\u3000](?:[\\s\\S]*[^\\u0009-\\u000D\\u0020\\u0085\\u00A0\\u1680\\u2000-\\u200A\\u2028\\u2029\\u202F\\u205F\\u3000])?$"
|
|
16
|
+
},
|
|
17
|
+
{
|
|
18
|
+
"not": {
|
|
19
|
+
"pattern": "[\\u0000-\\u001f\\u007f-\\u009f]"
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
]
|
|
23
|
+
},
|
|
24
|
+
"space_id": {
|
|
25
|
+
"type": "string",
|
|
26
|
+
"minLength": 1,
|
|
27
|
+
"maxLength": 256,
|
|
28
|
+
"allOf": [
|
|
29
|
+
{
|
|
30
|
+
"pattern": "^[^\\u0009-\\u000D\\u0020\\u0085\\u00A0\\u1680\\u2000-\\u200A\\u2028\\u2029\\u202F\\u205F\\u3000](?:[\\s\\S]*[^\\u0009-\\u000D\\u0020\\u0085\\u00A0\\u1680\\u2000-\\u200A\\u2028\\u2029\\u202F\\u205F\\u3000])?$"
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
"not": {
|
|
34
|
+
"pattern": "[\\u0000-\\u001f\\u007f-\\u009f]"
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
]
|
|
38
|
+
}
|
|
39
|
+
},
|
|
40
|
+
"required": [
|
|
41
|
+
"tenant_id",
|
|
42
|
+
"space_id"
|
|
43
|
+
],
|
|
44
|
+
"additionalProperties": false
|
|
45
|
+
},
|
|
46
|
+
"Trigger": {
|
|
47
|
+
"oneOf": [
|
|
48
|
+
{
|
|
49
|
+
"type": "object",
|
|
50
|
+
"properties": {
|
|
51
|
+
"type": {
|
|
52
|
+
"const": "SCHEDULED"
|
|
53
|
+
}
|
|
54
|
+
},
|
|
55
|
+
"required": [
|
|
56
|
+
"type"
|
|
57
|
+
],
|
|
58
|
+
"additionalProperties": false
|
|
59
|
+
},
|
|
60
|
+
{
|
|
61
|
+
"type": "object",
|
|
62
|
+
"properties": {
|
|
63
|
+
"type": {
|
|
64
|
+
"const": "EXPLICIT"
|
|
65
|
+
},
|
|
66
|
+
"userId": {
|
|
67
|
+
"type": "string",
|
|
68
|
+
"minLength": 1,
|
|
69
|
+
"maxLength": 256,
|
|
70
|
+
"allOf": [
|
|
71
|
+
{
|
|
72
|
+
"pattern": "^[^\\u0009-\\u000D\\u0020\\u0085\\u00A0\\u1680\\u2000-\\u200A\\u2028\\u2029\\u202F\\u205F\\u3000](?:[\\s\\S]*[^\\u0009-\\u000D\\u0020\\u0085\\u00A0\\u1680\\u2000-\\u200A\\u2028\\u2029\\u202F\\u205F\\u3000])?$"
|
|
73
|
+
},
|
|
74
|
+
{
|
|
75
|
+
"not": {
|
|
76
|
+
"pattern": "[\\u0000-\\u001f\\u007f-\\u009f]"
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
]
|
|
80
|
+
}
|
|
81
|
+
},
|
|
82
|
+
"required": [
|
|
83
|
+
"type",
|
|
84
|
+
"userId"
|
|
85
|
+
],
|
|
86
|
+
"additionalProperties": false
|
|
87
|
+
}
|
|
88
|
+
]
|
|
89
|
+
},
|
|
90
|
+
"SuggestionInvocationContext": {
|
|
91
|
+
"type": "object",
|
|
92
|
+
"properties": {
|
|
93
|
+
"space": {
|
|
94
|
+
"$ref": "#/$defs/Space"
|
|
95
|
+
},
|
|
96
|
+
"runId": {
|
|
97
|
+
"type": "string",
|
|
98
|
+
"minLength": 1,
|
|
99
|
+
"maxLength": 256,
|
|
100
|
+
"allOf": [
|
|
101
|
+
{
|
|
102
|
+
"pattern": "^[^\\u0009-\\u000D\\u0020\\u0085\\u00A0\\u1680\\u2000-\\u200A\\u2028\\u2029\\u202F\\u205F\\u3000](?:[\\s\\S]*[^\\u0009-\\u000D\\u0020\\u0085\\u00A0\\u1680\\u2000-\\u200A\\u2028\\u2029\\u202F\\u205F\\u3000])?$"
|
|
103
|
+
},
|
|
104
|
+
{
|
|
105
|
+
"not": {
|
|
106
|
+
"pattern": "[\\u0000-\\u001f\\u007f-\\u009f]"
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
]
|
|
110
|
+
},
|
|
111
|
+
"operationId": {
|
|
112
|
+
"type": "string",
|
|
113
|
+
"minLength": 1,
|
|
114
|
+
"maxLength": 256,
|
|
115
|
+
"allOf": [
|
|
116
|
+
{
|
|
117
|
+
"pattern": "^[^\\u0009-\\u000D\\u0020\\u0085\\u00A0\\u1680\\u2000-\\u200A\\u2028\\u2029\\u202F\\u205F\\u3000](?:[\\s\\S]*[^\\u0009-\\u000D\\u0020\\u0085\\u00A0\\u1680\\u2000-\\u200A\\u2028\\u2029\\u202F\\u205F\\u3000])?$"
|
|
118
|
+
},
|
|
119
|
+
{
|
|
120
|
+
"not": {
|
|
121
|
+
"pattern": "[\\u0000-\\u001f\\u007f-\\u009f]"
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
]
|
|
125
|
+
},
|
|
126
|
+
"trigger": {
|
|
127
|
+
"$ref": "#/$defs/Trigger"
|
|
128
|
+
},
|
|
129
|
+
"deadlineUnixMs": {
|
|
130
|
+
"type": "integer",
|
|
131
|
+
"minimum": 1,
|
|
132
|
+
"maximum": 9007199254740991
|
|
133
|
+
},
|
|
134
|
+
"traceparent": {
|
|
135
|
+
"anyOf": [
|
|
136
|
+
{
|
|
137
|
+
"type": "string"
|
|
138
|
+
},
|
|
139
|
+
{
|
|
140
|
+
"type": "null"
|
|
141
|
+
}
|
|
142
|
+
]
|
|
143
|
+
}
|
|
144
|
+
},
|
|
145
|
+
"required": [
|
|
146
|
+
"space",
|
|
147
|
+
"runId",
|
|
148
|
+
"operationId",
|
|
149
|
+
"trigger",
|
|
150
|
+
"deadlineUnixMs"
|
|
151
|
+
],
|
|
152
|
+
"additionalProperties": false
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
}
|