agent-first-data 0.26.2 → 0.28.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 +2 -2
- package/assets/cli-help-v2.schema.json +115 -0
- package/assets/cli-spec-v1.schema.json +334 -0
- package/assets/protocol-v1.schema.json +140 -29
- package/dist/cli.d.ts +3 -22
- package/dist/cli.js +7 -109
- package/dist/format.d.ts +27 -9
- package/dist/format.js +189 -66
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/package.json +3 -3
- package/assets/cli-help-v1.schema.json +0 -227
package/README.md
CHANGED
|
@@ -17,7 +17,7 @@ console.log(render(event.toJSON(), "json"));
|
|
|
17
17
|
console.log(render(event.toJSON(), "plain"));
|
|
18
18
|
```
|
|
19
19
|
|
|
20
|
-
Useful names use TypeScript casing: `render`, `outputOptionsForPolicy`, `redactedValue`, `redactUrlSecrets`, `redactArgv`, `normalizeUtcOffset`, `isValidRfc3339Date`, `isValidRfc3339Time`, `isValidRfc3339`, `isValidBcp47`, `decodeProtocolEvent`, `cliParseOutput`, `cliParseLogFilters`, `buildCliError`,
|
|
20
|
+
Useful names use TypeScript casing: `render`, `outputOptionsForPolicy`, `redactedValue`, `redactUrlSecrets`, `redactArgv`, `normalizeUtcOffset`, `isValidRfc3339Date`, `isValidRfc3339Time`, `isValidRfc3339`, `isValidBcp47`, `decodeProtocolEvent`, `cliParseOutput`, `cliParseLogFilters`, `buildCliError`, and `buildCliVersion`.
|
|
21
21
|
|
|
22
22
|
## Behavior Notes
|
|
23
23
|
|
|
@@ -26,7 +26,7 @@ Useful names use TypeScript casing: `render`, `outputOptionsForPolicy`, `redacte
|
|
|
26
26
|
- YAML keeps original keys and values (structure-preserving, like JSON), sorting keys by UTF-16 code unit order and quoting/escaping unsafe keys and string scalars. Plain strips formatting suffixes, formats values, sorts the same way, and renders nested objects/arrays as canonical JSON.
|
|
27
27
|
- Logging records use `kind:"log"` with a nested `log` payload and a separate `level` field, so error-level logs are not terminal protocol errors.
|
|
28
28
|
- `buildCliError(message, hint?)` returns a strict-ready CLI error with `error.retryable:false` and `trace:{}`.
|
|
29
|
-
-
|
|
29
|
+
- Do not add a raw version/help pre-parser. Until the TypeScript `CliSpec` compiler lands, applications should keep lifecycle parsing in their own parser rather than claim AFDATA closed-world help compatibility.
|
|
30
30
|
|
|
31
31
|
## Reference
|
|
32
32
|
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "https://agentfirstkit.org/schemas/agent-first-data/cli-help-v2.schema.json",
|
|
4
|
+
"title": "AFDATA CLI help v2 event",
|
|
5
|
+
"description": "One command's complete invocation help, carried by an AFDATA result event. Domain outcomes, side effects, and runtime error catalogs remain in the owning tool's documentation.",
|
|
6
|
+
"type": "object",
|
|
7
|
+
"required": [
|
|
8
|
+
"kind",
|
|
9
|
+
"result",
|
|
10
|
+
"trace"
|
|
11
|
+
],
|
|
12
|
+
"additionalProperties": false,
|
|
13
|
+
"properties": {
|
|
14
|
+
"kind": {
|
|
15
|
+
"const": "result"
|
|
16
|
+
},
|
|
17
|
+
"result": {
|
|
18
|
+
"type": "object",
|
|
19
|
+
"required": [
|
|
20
|
+
"code",
|
|
21
|
+
"help"
|
|
22
|
+
],
|
|
23
|
+
"additionalProperties": false,
|
|
24
|
+
"properties": {
|
|
25
|
+
"code": {
|
|
26
|
+
"const": "help"
|
|
27
|
+
},
|
|
28
|
+
"help": {
|
|
29
|
+
"$ref": "#/$defs/help"
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
},
|
|
33
|
+
"trace": {
|
|
34
|
+
"type": "object"
|
|
35
|
+
}
|
|
36
|
+
},
|
|
37
|
+
"$defs": {
|
|
38
|
+
"oneLine": {
|
|
39
|
+
"type": "string",
|
|
40
|
+
"minLength": 1,
|
|
41
|
+
"pattern": "^[^\\n\\r]+$"
|
|
42
|
+
},
|
|
43
|
+
"nonEmptyStringMap": {
|
|
44
|
+
"type": "object",
|
|
45
|
+
"minProperties": 1,
|
|
46
|
+
"additionalProperties": {
|
|
47
|
+
"type": "string",
|
|
48
|
+
"minLength": 1
|
|
49
|
+
}
|
|
50
|
+
},
|
|
51
|
+
"help": {
|
|
52
|
+
"type": "object",
|
|
53
|
+
"required": [
|
|
54
|
+
"schema",
|
|
55
|
+
"command_path"
|
|
56
|
+
],
|
|
57
|
+
"additionalProperties": false,
|
|
58
|
+
"properties": {
|
|
59
|
+
"schema": {
|
|
60
|
+
"const": "cli-help-v2"
|
|
61
|
+
},
|
|
62
|
+
"command_path": {
|
|
63
|
+
"$ref": "#/$defs/oneLine"
|
|
64
|
+
},
|
|
65
|
+
"about": {
|
|
66
|
+
"$ref": "#/$defs/oneLine"
|
|
67
|
+
},
|
|
68
|
+
"shapes": {
|
|
69
|
+
"type": "array",
|
|
70
|
+
"minItems": 1,
|
|
71
|
+
"items": {
|
|
72
|
+
"$ref": "#/$defs/shape"
|
|
73
|
+
},
|
|
74
|
+
"description": "Every legal shape of this command, each complete. Help answers in one round trip; a second level could only pay off by omitting the optional arguments, which would then be undiscoverable."
|
|
75
|
+
},
|
|
76
|
+
"subcommands": {
|
|
77
|
+
"type": "array",
|
|
78
|
+
"minItems": 1,
|
|
79
|
+
"items": {
|
|
80
|
+
"$ref": "#/$defs/oneLine"
|
|
81
|
+
}
|
|
82
|
+
},
|
|
83
|
+
"notes": {
|
|
84
|
+
"$ref": "#/$defs/nonEmptyStringMap",
|
|
85
|
+
"description": "Argument meanings. Arguments belong to the command rather than to one shape, so they are stated once."
|
|
86
|
+
},
|
|
87
|
+
"defaults": {
|
|
88
|
+
"type": "object",
|
|
89
|
+
"minProperties": 1,
|
|
90
|
+
"additionalProperties": true
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
},
|
|
94
|
+
"shape": {
|
|
95
|
+
"type": "object",
|
|
96
|
+
"required": [
|
|
97
|
+
"id",
|
|
98
|
+
"usage"
|
|
99
|
+
],
|
|
100
|
+
"additionalProperties": false,
|
|
101
|
+
"properties": {
|
|
102
|
+
"id": {
|
|
103
|
+
"$ref": "#/$defs/oneLine"
|
|
104
|
+
},
|
|
105
|
+
"about": {
|
|
106
|
+
"$ref": "#/$defs/oneLine",
|
|
107
|
+
"description": "How this shape differs from its siblings. Absent when the command has only one shape, because its own description already covers it."
|
|
108
|
+
},
|
|
109
|
+
"usage": {
|
|
110
|
+
"$ref": "#/$defs/oneLine"
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
}
|
|
@@ -0,0 +1,334 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "https://agentfirstkit.org/schemas/agent-first-data/cli-spec-v1.schema.json",
|
|
4
|
+
"title": "AFDATA closed-world CLI spec v1",
|
|
5
|
+
"type": "object",
|
|
6
|
+
"required": [
|
|
7
|
+
"schema",
|
|
8
|
+
"name",
|
|
9
|
+
"version",
|
|
10
|
+
"lifecycle_output",
|
|
11
|
+
"commands"
|
|
12
|
+
],
|
|
13
|
+
"additionalProperties": false,
|
|
14
|
+
"properties": {
|
|
15
|
+
"schema": {
|
|
16
|
+
"const": "cli-spec-v1"
|
|
17
|
+
},
|
|
18
|
+
"name": {
|
|
19
|
+
"$ref": "#/$defs/nonEmpty"
|
|
20
|
+
},
|
|
21
|
+
"version": {
|
|
22
|
+
"$ref": "#/$defs/nonEmpty"
|
|
23
|
+
},
|
|
24
|
+
"display_name": {
|
|
25
|
+
"$ref": "#/$defs/nonEmpty",
|
|
26
|
+
"description": "Human-facing product name, distinct from the binary identity in `name`."
|
|
27
|
+
},
|
|
28
|
+
"build": {
|
|
29
|
+
"$ref": "#/$defs/nonEmpty",
|
|
30
|
+
"description": "Opaque build identifier, such as a git commit SHA. Its meaning is the host's."
|
|
31
|
+
},
|
|
32
|
+
"about": {
|
|
33
|
+
"$ref": "#/$defs/nonEmpty"
|
|
34
|
+
},
|
|
35
|
+
"lifecycle_output": {
|
|
36
|
+
"$ref": "#/$defs/output"
|
|
37
|
+
},
|
|
38
|
+
"commands": {
|
|
39
|
+
"type": "array",
|
|
40
|
+
"minItems": 1,
|
|
41
|
+
"items": {
|
|
42
|
+
"$ref": "#/$defs/command"
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
},
|
|
46
|
+
"$defs": {
|
|
47
|
+
"nonEmpty": {
|
|
48
|
+
"type": "string",
|
|
49
|
+
"minLength": 1
|
|
50
|
+
},
|
|
51
|
+
"argumentId": {
|
|
52
|
+
"type": "string",
|
|
53
|
+
"pattern": "^[a-z][a-z0-9_]*$"
|
|
54
|
+
},
|
|
55
|
+
"command": {
|
|
56
|
+
"type": "object",
|
|
57
|
+
"required": [
|
|
58
|
+
"command_path",
|
|
59
|
+
"arguments",
|
|
60
|
+
"combinations"
|
|
61
|
+
],
|
|
62
|
+
"additionalProperties": false,
|
|
63
|
+
"properties": {
|
|
64
|
+
"command_path": {
|
|
65
|
+
"type": "array",
|
|
66
|
+
"items": {
|
|
67
|
+
"type": "string",
|
|
68
|
+
"pattern": "^[a-z0-9][a-z0-9-]*$"
|
|
69
|
+
}
|
|
70
|
+
},
|
|
71
|
+
"about": {
|
|
72
|
+
"$ref": "#/$defs/nonEmpty"
|
|
73
|
+
},
|
|
74
|
+
"arguments": {
|
|
75
|
+
"type": "array",
|
|
76
|
+
"items": {
|
|
77
|
+
"$ref": "#/$defs/argument"
|
|
78
|
+
}
|
|
79
|
+
},
|
|
80
|
+
"combinations": {
|
|
81
|
+
"type": "array",
|
|
82
|
+
"items": {
|
|
83
|
+
"$ref": "#/$defs/combination"
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
},
|
|
88
|
+
"argument": {
|
|
89
|
+
"type": "object",
|
|
90
|
+
"required": [
|
|
91
|
+
"argument_id",
|
|
92
|
+
"syntax",
|
|
93
|
+
"value_type"
|
|
94
|
+
],
|
|
95
|
+
"additionalProperties": false,
|
|
96
|
+
"properties": {
|
|
97
|
+
"argument_id": {
|
|
98
|
+
"$ref": "#/$defs/argumentId"
|
|
99
|
+
},
|
|
100
|
+
"syntax": {
|
|
101
|
+
"oneOf": [
|
|
102
|
+
{
|
|
103
|
+
"type": "object",
|
|
104
|
+
"required": [
|
|
105
|
+
"kind",
|
|
106
|
+
"name"
|
|
107
|
+
],
|
|
108
|
+
"additionalProperties": false,
|
|
109
|
+
"properties": {
|
|
110
|
+
"kind": {
|
|
111
|
+
"const": "long"
|
|
112
|
+
},
|
|
113
|
+
"name": {
|
|
114
|
+
"type": "string",
|
|
115
|
+
"pattern": "^--[a-z0-9][a-z0-9-]*$"
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
},
|
|
119
|
+
{
|
|
120
|
+
"type": "object",
|
|
121
|
+
"required": [
|
|
122
|
+
"kind",
|
|
123
|
+
"index"
|
|
124
|
+
],
|
|
125
|
+
"additionalProperties": false,
|
|
126
|
+
"properties": {
|
|
127
|
+
"kind": {
|
|
128
|
+
"const": "positional"
|
|
129
|
+
},
|
|
130
|
+
"index": {
|
|
131
|
+
"type": "integer",
|
|
132
|
+
"minimum": 0
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
]
|
|
137
|
+
},
|
|
138
|
+
"value_type": {
|
|
139
|
+
"enum": [
|
|
140
|
+
"flag",
|
|
141
|
+
"string",
|
|
142
|
+
"i64",
|
|
143
|
+
"finite_f64",
|
|
144
|
+
"enum",
|
|
145
|
+
"json"
|
|
146
|
+
]
|
|
147
|
+
},
|
|
148
|
+
"value_name": {
|
|
149
|
+
"$ref": "#/$defs/nonEmpty"
|
|
150
|
+
},
|
|
151
|
+
"enum_values": {
|
|
152
|
+
"type": "array",
|
|
153
|
+
"minItems": 1,
|
|
154
|
+
"uniqueItems": true,
|
|
155
|
+
"items": {
|
|
156
|
+
"$ref": "#/$defs/nonEmpty"
|
|
157
|
+
}
|
|
158
|
+
},
|
|
159
|
+
"default": true,
|
|
160
|
+
"repeatable": {
|
|
161
|
+
"const": true
|
|
162
|
+
},
|
|
163
|
+
"sensitive": {
|
|
164
|
+
"type": "boolean",
|
|
165
|
+
"description": "This argument's value must never be echoed back in help, errors, or logs."
|
|
166
|
+
},
|
|
167
|
+
"about": {
|
|
168
|
+
"$ref": "#/$defs/nonEmpty"
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
},
|
|
172
|
+
"combination": {
|
|
173
|
+
"type": "object",
|
|
174
|
+
"required": [
|
|
175
|
+
"combination_id",
|
|
176
|
+
"action_id",
|
|
177
|
+
"output"
|
|
178
|
+
],
|
|
179
|
+
"additionalProperties": false,
|
|
180
|
+
"properties": {
|
|
181
|
+
"combination_id": {
|
|
182
|
+
"$ref": "#/$defs/nonEmpty"
|
|
183
|
+
},
|
|
184
|
+
"action_id": {
|
|
185
|
+
"$ref": "#/$defs/nonEmpty"
|
|
186
|
+
},
|
|
187
|
+
"about": {
|
|
188
|
+
"$ref": "#/$defs/nonEmpty"
|
|
189
|
+
},
|
|
190
|
+
"fixed": {
|
|
191
|
+
"type": "object",
|
|
192
|
+
"additionalProperties": {
|
|
193
|
+
"oneOf": [
|
|
194
|
+
{
|
|
195
|
+
"$ref": "#/$defs/nonEmpty"
|
|
196
|
+
},
|
|
197
|
+
{
|
|
198
|
+
"type": "object",
|
|
199
|
+
"required": [
|
|
200
|
+
"one_of"
|
|
201
|
+
],
|
|
202
|
+
"additionalProperties": false,
|
|
203
|
+
"properties": {
|
|
204
|
+
"one_of": {
|
|
205
|
+
"type": "array",
|
|
206
|
+
"minItems": 1,
|
|
207
|
+
"uniqueItems": true,
|
|
208
|
+
"items": {
|
|
209
|
+
"$ref": "#/$defs/nonEmpty"
|
|
210
|
+
}
|
|
211
|
+
}
|
|
212
|
+
}
|
|
213
|
+
}
|
|
214
|
+
]
|
|
215
|
+
}
|
|
216
|
+
},
|
|
217
|
+
"required": {
|
|
218
|
+
"type": "array",
|
|
219
|
+
"minItems": 1,
|
|
220
|
+
"uniqueItems": true,
|
|
221
|
+
"items": {
|
|
222
|
+
"$ref": "#/$defs/argumentId"
|
|
223
|
+
}
|
|
224
|
+
},
|
|
225
|
+
"optional": {
|
|
226
|
+
"type": "array",
|
|
227
|
+
"minItems": 1,
|
|
228
|
+
"uniqueItems": true,
|
|
229
|
+
"items": {
|
|
230
|
+
"$ref": "#/$defs/argumentId"
|
|
231
|
+
}
|
|
232
|
+
},
|
|
233
|
+
"output": {
|
|
234
|
+
"$ref": "#/$defs/output"
|
|
235
|
+
}
|
|
236
|
+
}
|
|
237
|
+
},
|
|
238
|
+
"fileSinks": {
|
|
239
|
+
"type": "array",
|
|
240
|
+
"uniqueItems": true,
|
|
241
|
+
"items": {
|
|
242
|
+
"enum": [
|
|
243
|
+
"stdout",
|
|
244
|
+
"stderr"
|
|
245
|
+
]
|
|
246
|
+
}
|
|
247
|
+
},
|
|
248
|
+
"output": {
|
|
249
|
+
"oneOf": [
|
|
250
|
+
{
|
|
251
|
+
"type": "object",
|
|
252
|
+
"required": [
|
|
253
|
+
"kind",
|
|
254
|
+
"file_sinks"
|
|
255
|
+
],
|
|
256
|
+
"additionalProperties": false,
|
|
257
|
+
"properties": {
|
|
258
|
+
"kind": {
|
|
259
|
+
"const": "raw"
|
|
260
|
+
},
|
|
261
|
+
"file_sinks": {
|
|
262
|
+
"$ref": "#/$defs/fileSinks"
|
|
263
|
+
}
|
|
264
|
+
}
|
|
265
|
+
},
|
|
266
|
+
{
|
|
267
|
+
"type": "object",
|
|
268
|
+
"required": [
|
|
269
|
+
"kind",
|
|
270
|
+
"lifecycle",
|
|
271
|
+
"formats",
|
|
272
|
+
"destinations",
|
|
273
|
+
"default_format",
|
|
274
|
+
"default_destination",
|
|
275
|
+
"file_sinks"
|
|
276
|
+
],
|
|
277
|
+
"additionalProperties": false,
|
|
278
|
+
"properties": {
|
|
279
|
+
"kind": {
|
|
280
|
+
"const": "protocol"
|
|
281
|
+
},
|
|
282
|
+
"lifecycle": {
|
|
283
|
+
"enum": [
|
|
284
|
+
"finite",
|
|
285
|
+
"stream"
|
|
286
|
+
]
|
|
287
|
+
},
|
|
288
|
+
"formats": {
|
|
289
|
+
"type": "array",
|
|
290
|
+
"minItems": 1,
|
|
291
|
+
"uniqueItems": true,
|
|
292
|
+
"items": {
|
|
293
|
+
"enum": [
|
|
294
|
+
"json",
|
|
295
|
+
"yaml",
|
|
296
|
+
"plain"
|
|
297
|
+
]
|
|
298
|
+
}
|
|
299
|
+
},
|
|
300
|
+
"destinations": {
|
|
301
|
+
"type": "array",
|
|
302
|
+
"minItems": 1,
|
|
303
|
+
"uniqueItems": true,
|
|
304
|
+
"items": {
|
|
305
|
+
"enum": [
|
|
306
|
+
"split",
|
|
307
|
+
"stdout",
|
|
308
|
+
"stderr"
|
|
309
|
+
]
|
|
310
|
+
}
|
|
311
|
+
},
|
|
312
|
+
"default_format": {
|
|
313
|
+
"enum": [
|
|
314
|
+
"json",
|
|
315
|
+
"yaml",
|
|
316
|
+
"plain"
|
|
317
|
+
]
|
|
318
|
+
},
|
|
319
|
+
"default_destination": {
|
|
320
|
+
"enum": [
|
|
321
|
+
"split",
|
|
322
|
+
"stdout",
|
|
323
|
+
"stderr"
|
|
324
|
+
]
|
|
325
|
+
},
|
|
326
|
+
"file_sinks": {
|
|
327
|
+
"$ref": "#/$defs/fileSinks"
|
|
328
|
+
}
|
|
329
|
+
}
|
|
330
|
+
}
|
|
331
|
+
]
|
|
332
|
+
}
|
|
333
|
+
}
|
|
334
|
+
}
|
|
@@ -1,67 +1,178 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
3
|
"$id": "https://agentfirstkit.org/schemas/agent-first-data/protocol-v1.schema.json",
|
|
4
|
-
"title": "Agent-First Data Protocol v1 Event",
|
|
5
|
-
"
|
|
6
|
-
"
|
|
7
|
-
{"$ref": "#/$defs/resultEvent"},
|
|
8
|
-
{"$ref": "#/$defs/errorEvent"},
|
|
9
|
-
{"$ref": "#/$defs/progressEvent"},
|
|
10
|
-
{"$ref": "#/$defs/logEvent"}
|
|
11
|
-
],
|
|
4
|
+
"title": "Agent-First Data Protocol v1 Event (base profile)",
|
|
5
|
+
"description": "One protocol v1 event. The document root is the BASE profile: the mandatory MUST rules only — envelope shape and error payload requirements. Validate against the root unless you are claiming strict conformance; rejecting a base-conformant event is a false negative. The STRICT profile is `#/$defs/strictEvent`: it additionally requires the two recommendations (an object `trace` on every event, a boolean `error.retryable`). Stream lifecycle — (log | progress)* then exactly one result | error — is not expressible per event; validate a whole stream with `afdata validate` or `validate_protocol_stream`.",
|
|
6
|
+
"$ref": "#/$defs/event",
|
|
12
7
|
"$defs": {
|
|
8
|
+
"event": {
|
|
9
|
+
"title": "Protocol v1 event, base profile",
|
|
10
|
+
"description": "Top-level fields are closed: `kind`, the payload field whose name equals `kind`, and an optional `trace`.",
|
|
11
|
+
"type": "object",
|
|
12
|
+
"oneOf": [
|
|
13
|
+
{
|
|
14
|
+
"$ref": "#/$defs/resultEvent"
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
"$ref": "#/$defs/errorEvent"
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
"$ref": "#/$defs/progressEvent"
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
"$ref": "#/$defs/logEvent"
|
|
24
|
+
}
|
|
25
|
+
]
|
|
26
|
+
},
|
|
27
|
+
"strictEvent": {
|
|
28
|
+
"title": "Protocol v1 event, strict profile",
|
|
29
|
+
"description": "The base profile plus the recommendations of the spec's `Validation profiles` section. Equivalent to `validate_protocol_event(event, strict = true)`.",
|
|
30
|
+
"allOf": [
|
|
31
|
+
{
|
|
32
|
+
"$ref": "#/$defs/event"
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
"$ref": "#/$defs/strictRecommendations"
|
|
36
|
+
}
|
|
37
|
+
]
|
|
38
|
+
},
|
|
39
|
+
"strictRecommendations": {
|
|
40
|
+
"description": "What the strict profile adds on top of the base profile, and nothing else.",
|
|
41
|
+
"type": "object",
|
|
42
|
+
"required": [
|
|
43
|
+
"trace"
|
|
44
|
+
],
|
|
45
|
+
"properties": {
|
|
46
|
+
"trace": {
|
|
47
|
+
"$ref": "#/$defs/trace"
|
|
48
|
+
}
|
|
49
|
+
},
|
|
50
|
+
"if": {
|
|
51
|
+
"type": "object",
|
|
52
|
+
"properties": {
|
|
53
|
+
"kind": {
|
|
54
|
+
"const": "error"
|
|
55
|
+
}
|
|
56
|
+
},
|
|
57
|
+
"required": [
|
|
58
|
+
"kind"
|
|
59
|
+
]
|
|
60
|
+
},
|
|
61
|
+
"then": {
|
|
62
|
+
"properties": {
|
|
63
|
+
"error": {
|
|
64
|
+
"type": "object",
|
|
65
|
+
"required": [
|
|
66
|
+
"retryable"
|
|
67
|
+
],
|
|
68
|
+
"properties": {
|
|
69
|
+
"retryable": {
|
|
70
|
+
"type": "boolean"
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
},
|
|
13
77
|
"trace": {
|
|
78
|
+
"description": "Execution context. Recommended on every event, required by the strict profile. Its fields are owned by the emitting tool.",
|
|
14
79
|
"type": "object"
|
|
15
80
|
},
|
|
16
81
|
"resultEvent": {
|
|
17
82
|
"type": "object",
|
|
18
83
|
"properties": {
|
|
19
|
-
"kind": {
|
|
84
|
+
"kind": {
|
|
85
|
+
"const": "result"
|
|
86
|
+
},
|
|
20
87
|
"result": true,
|
|
21
|
-
"trace": {
|
|
88
|
+
"trace": {
|
|
89
|
+
"$ref": "#/$defs/trace"
|
|
90
|
+
}
|
|
22
91
|
},
|
|
23
|
-
"required": [
|
|
92
|
+
"required": [
|
|
93
|
+
"kind",
|
|
94
|
+
"result"
|
|
95
|
+
],
|
|
24
96
|
"additionalProperties": false
|
|
25
97
|
},
|
|
26
98
|
"errorEvent": {
|
|
27
99
|
"type": "object",
|
|
28
100
|
"properties": {
|
|
29
|
-
"kind": {
|
|
101
|
+
"kind": {
|
|
102
|
+
"const": "error"
|
|
103
|
+
},
|
|
30
104
|
"error": {
|
|
31
|
-
"
|
|
32
|
-
"properties": {
|
|
33
|
-
"code": {"type": "string", "minLength": 1},
|
|
34
|
-
"message": {"type": "string", "minLength": 1},
|
|
35
|
-
"retryable": {"type": "boolean"},
|
|
36
|
-
"hint": {"type": "string"}
|
|
37
|
-
},
|
|
38
|
-
"required": ["code", "message", "retryable"],
|
|
39
|
-
"additionalProperties": true
|
|
105
|
+
"$ref": "#/$defs/errorPayload"
|
|
40
106
|
},
|
|
41
|
-
"trace": {
|
|
107
|
+
"trace": {
|
|
108
|
+
"$ref": "#/$defs/trace"
|
|
109
|
+
}
|
|
42
110
|
},
|
|
43
|
-
"required": [
|
|
111
|
+
"required": [
|
|
112
|
+
"kind",
|
|
113
|
+
"error"
|
|
114
|
+
],
|
|
44
115
|
"additionalProperties": false
|
|
45
116
|
},
|
|
46
117
|
"progressEvent": {
|
|
47
118
|
"type": "object",
|
|
48
119
|
"properties": {
|
|
49
|
-
"kind": {
|
|
120
|
+
"kind": {
|
|
121
|
+
"const": "progress"
|
|
122
|
+
},
|
|
50
123
|
"progress": true,
|
|
51
|
-
"trace": {
|
|
124
|
+
"trace": {
|
|
125
|
+
"$ref": "#/$defs/trace"
|
|
126
|
+
}
|
|
52
127
|
},
|
|
53
|
-
"required": [
|
|
128
|
+
"required": [
|
|
129
|
+
"kind",
|
|
130
|
+
"progress"
|
|
131
|
+
],
|
|
54
132
|
"additionalProperties": false
|
|
55
133
|
},
|
|
56
134
|
"logEvent": {
|
|
57
135
|
"type": "object",
|
|
58
136
|
"properties": {
|
|
59
|
-
"kind": {
|
|
137
|
+
"kind": {
|
|
138
|
+
"const": "log"
|
|
139
|
+
},
|
|
60
140
|
"log": true,
|
|
61
|
-
"trace": {
|
|
141
|
+
"trace": {
|
|
142
|
+
"$ref": "#/$defs/trace"
|
|
143
|
+
}
|
|
62
144
|
},
|
|
63
|
-
"required": [
|
|
145
|
+
"required": [
|
|
146
|
+
"kind",
|
|
147
|
+
"log"
|
|
148
|
+
],
|
|
64
149
|
"additionalProperties": false
|
|
150
|
+
},
|
|
151
|
+
"errorPayload": {
|
|
152
|
+
"description": "Extension fields go directly on this object; there is no `details` wrapper.",
|
|
153
|
+
"type": "object",
|
|
154
|
+
"properties": {
|
|
155
|
+
"code": {
|
|
156
|
+
"type": "string",
|
|
157
|
+
"minLength": 1
|
|
158
|
+
},
|
|
159
|
+
"message": {
|
|
160
|
+
"type": "string",
|
|
161
|
+
"minLength": 1
|
|
162
|
+
},
|
|
163
|
+
"hint": {
|
|
164
|
+
"description": "Actionable remediation. Omit it when there is none.",
|
|
165
|
+
"type": "string"
|
|
166
|
+
},
|
|
167
|
+
"retryable": {
|
|
168
|
+
"description": "Whether retrying the same call can succeed. Recommended, and left unconstrained by the base profile — the strict profile (`#/$defs/strictEvent`) requires it and requires a boolean."
|
|
169
|
+
}
|
|
170
|
+
},
|
|
171
|
+
"required": [
|
|
172
|
+
"code",
|
|
173
|
+
"message"
|
|
174
|
+
],
|
|
175
|
+
"additionalProperties": true
|
|
65
176
|
}
|
|
66
177
|
}
|
|
67
178
|
}
|