@mhome/app-facade-protocol 1.153.0 → 1.154.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.
@@ -0,0 +1,1213 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://mhome.ai/schema/suggestion.v1.schema.json",
4
+ "$comment": "Generic envelopes validate common fields only. Writers must also validate a registered type; AUTOMATION is the first production type. Timestamps and version are safe JSON integers. Cross-field time and authorization checks remain required.",
5
+ "$defs": {
6
+ "Evidence": {
7
+ "type": "object",
8
+ "properties": {
9
+ "sourceType": {
10
+ "type": "string",
11
+ "pattern": "^[A-Z][A-Z0-9_]*$"
12
+ },
13
+ "sourceId": {
14
+ "type": "string",
15
+ "pattern": "[^\\u0009-\\u000D\\u0020\\u0085\\u00A0\\u1680\\u2000-\\u200A\\u2028\\u2029\\u202F\\u205F\\u3000]"
16
+ },
17
+ "occurredAt": {
18
+ "anyOf": [
19
+ {
20
+ "type": "integer",
21
+ "minimum": 1,
22
+ "maximum": 9007199254740991
23
+ },
24
+ {
25
+ "type": "null"
26
+ }
27
+ ]
28
+ },
29
+ "excerpt": {
30
+ "type": "string",
31
+ "pattern": "[^\\u0009-\\u000D\\u0020\\u0085\\u00A0\\u1680\\u2000-\\u200A\\u2028\\u2029\\u202F\\u205F\\u3000]"
32
+ }
33
+ },
34
+ "required": [
35
+ "sourceType",
36
+ "sourceId",
37
+ "excerpt"
38
+ ],
39
+ "additionalProperties": false
40
+ },
41
+ "AutomationScript": {
42
+ "type": "object",
43
+ "properties": {
44
+ "script": {
45
+ "type": "string",
46
+ "pattern": "[^\\u0009-\\u000D\\u0020\\u0085\\u00A0\\u1680\\u2000-\\u200A\\u2028\\u2029\\u202F\\u205F\\u3000]"
47
+ },
48
+ "scripts": {
49
+ "type": "object",
50
+ "propertyNames": {
51
+ "type": "string",
52
+ "pattern": "[^\\u0009-\\u000D\\u0020\\u0085\\u00A0\\u1680\\u2000-\\u200A\\u2028\\u2029\\u202F\\u205F\\u3000]"
53
+ },
54
+ "additionalProperties": {
55
+ "type": "string"
56
+ }
57
+ },
58
+ "sdkVersion": {
59
+ "anyOf": [
60
+ {
61
+ "type": "string",
62
+ "pattern": "[^\\u0009-\\u000D\\u0020\\u0085\\u00A0\\u1680\\u2000-\\u200A\\u2028\\u2029\\u202F\\u205F\\u3000]"
63
+ },
64
+ {
65
+ "type": "null"
66
+ }
67
+ ]
68
+ },
69
+ "parseResults": {
70
+ "anyOf": [
71
+ {
72
+ "type": "array",
73
+ "items": {}
74
+ },
75
+ {
76
+ "type": "null"
77
+ }
78
+ ]
79
+ }
80
+ },
81
+ "required": [
82
+ "script"
83
+ ],
84
+ "additionalProperties": false
85
+ },
86
+ "Resolution": {
87
+ "type": "object",
88
+ "properties": {
89
+ "action": {
90
+ "type": "string",
91
+ "pattern": "[^\\u0009-\\u000D\\u0020\\u0085\\u00A0\\u1680\\u2000-\\u200A\\u2028\\u2029\\u202F\\u205F\\u3000]"
92
+ },
93
+ "operationId": {
94
+ "type": "string",
95
+ "pattern": "[^\\u0009-\\u000D\\u0020\\u0085\\u00A0\\u1680\\u2000-\\u200A\\u2028\\u2029\\u202F\\u205F\\u3000]"
96
+ },
97
+ "handledAt": {
98
+ "type": "integer",
99
+ "minimum": 1,
100
+ "maximum": 9007199254740991
101
+ },
102
+ "actor": {
103
+ "oneOf": [
104
+ {
105
+ "type": "object",
106
+ "properties": {
107
+ "kind": {
108
+ "const": "user"
109
+ },
110
+ "userId": {
111
+ "type": "string",
112
+ "pattern": "[^\\u0009-\\u000D\\u0020\\u0085\\u00A0\\u1680\\u2000-\\u200A\\u2028\\u2029\\u202F\\u205F\\u3000]"
113
+ }
114
+ },
115
+ "required": [
116
+ "kind",
117
+ "userId"
118
+ ],
119
+ "additionalProperties": false
120
+ },
121
+ {
122
+ "type": "object",
123
+ "properties": {
124
+ "kind": {
125
+ "const": "space"
126
+ },
127
+ "tenantId": {
128
+ "type": "string",
129
+ "pattern": "[^\\u0009-\\u000D\\u0020\\u0085\\u00A0\\u1680\\u2000-\\u200A\\u2028\\u2029\\u202F\\u205F\\u3000]"
130
+ },
131
+ "spaceId": {
132
+ "type": "string",
133
+ "pattern": "[^\\u0009-\\u000D\\u0020\\u0085\\u00A0\\u1680\\u2000-\\u200A\\u2028\\u2029\\u202F\\u205F\\u3000]"
134
+ }
135
+ },
136
+ "required": [
137
+ "kind",
138
+ "tenantId",
139
+ "spaceId"
140
+ ],
141
+ "additionalProperties": false
142
+ }
143
+ ]
144
+ },
145
+ "resourceIds": {
146
+ "type": "object",
147
+ "propertyNames": {
148
+ "type": "string",
149
+ "pattern": "[^\\u0009-\\u000D\\u0020\\u0085\\u00A0\\u1680\\u2000-\\u200A\\u2028\\u2029\\u202F\\u205F\\u3000]"
150
+ },
151
+ "additionalProperties": {
152
+ "type": "string",
153
+ "pattern": "[^\\u0009-\\u000D\\u0020\\u0085\\u00A0\\u1680\\u2000-\\u200A\\u2028\\u2029\\u202F\\u205F\\u3000]"
154
+ }
155
+ },
156
+ "feedback": {
157
+ "anyOf": [
158
+ {
159
+ "type": "string",
160
+ "pattern": "[^\\u0009-\\u000D\\u0020\\u0085\\u00A0\\u1680\\u2000-\\u200A\\u2028\\u2029\\u202F\\u205F\\u3000]"
161
+ },
162
+ {
163
+ "type": "null"
164
+ }
165
+ ]
166
+ }
167
+ },
168
+ "required": [
169
+ "action",
170
+ "operationId",
171
+ "handledAt",
172
+ "actor"
173
+ ],
174
+ "additionalProperties": false
175
+ },
176
+ "SuggestionDraft": {
177
+ "type": "object",
178
+ "properties": {
179
+ "type": {
180
+ "type": "string",
181
+ "pattern": "^[A-Z][A-Z0-9_]*$"
182
+ },
183
+ "title": {
184
+ "type": "string",
185
+ "pattern": "[^\\u0009-\\u000D\\u0020\\u0085\\u00A0\\u1680\\u2000-\\u200A\\u2028\\u2029\\u202F\\u205F\\u3000]"
186
+ },
187
+ "summary": {
188
+ "type": "string",
189
+ "pattern": "[^\\u0009-\\u000D\\u0020\\u0085\\u00A0\\u1680\\u2000-\\u200A\\u2028\\u2029\\u202F\\u205F\\u3000]"
190
+ },
191
+ "reasons": {
192
+ "type": "array",
193
+ "items": {
194
+ "type": "string",
195
+ "pattern": "[^\\u0009-\\u000D\\u0020\\u0085\\u00A0\\u1680\\u2000-\\u200A\\u2028\\u2029\\u202F\\u205F\\u3000]"
196
+ },
197
+ "minItems": 1
198
+ },
199
+ "evidence": {
200
+ "type": "array",
201
+ "items": {
202
+ "$ref": "#/$defs/Evidence"
203
+ },
204
+ "minItems": 1
205
+ },
206
+ "expiresAt": {
207
+ "anyOf": [
208
+ {
209
+ "type": "integer",
210
+ "minimum": 1,
211
+ "maximum": 9007199254740991
212
+ },
213
+ {
214
+ "type": "null"
215
+ }
216
+ ]
217
+ }
218
+ },
219
+ "required": [
220
+ "type",
221
+ "title",
222
+ "summary",
223
+ "reasons",
224
+ "evidence"
225
+ ],
226
+ "additionalProperties": true
227
+ },
228
+ "Suggestion": {
229
+ "type": "object",
230
+ "properties": {
231
+ "type": {
232
+ "type": "string",
233
+ "pattern": "^[A-Z][A-Z0-9_]*$"
234
+ },
235
+ "title": {
236
+ "type": "string",
237
+ "pattern": "[^\\u0009-\\u000D\\u0020\\u0085\\u00A0\\u1680\\u2000-\\u200A\\u2028\\u2029\\u202F\\u205F\\u3000]"
238
+ },
239
+ "summary": {
240
+ "type": "string",
241
+ "pattern": "[^\\u0009-\\u000D\\u0020\\u0085\\u00A0\\u1680\\u2000-\\u200A\\u2028\\u2029\\u202F\\u205F\\u3000]"
242
+ },
243
+ "reasons": {
244
+ "type": "array",
245
+ "items": {
246
+ "type": "string",
247
+ "pattern": "[^\\u0009-\\u000D\\u0020\\u0085\\u00A0\\u1680\\u2000-\\u200A\\u2028\\u2029\\u202F\\u205F\\u3000]"
248
+ },
249
+ "minItems": 1
250
+ },
251
+ "evidence": {
252
+ "type": "array",
253
+ "items": {
254
+ "$ref": "#/$defs/Evidence"
255
+ },
256
+ "minItems": 1
257
+ },
258
+ "expiresAt": {
259
+ "anyOf": [
260
+ {
261
+ "type": "integer",
262
+ "minimum": 1,
263
+ "maximum": 9007199254740991
264
+ },
265
+ {
266
+ "type": "null"
267
+ }
268
+ ]
269
+ },
270
+ "id": {
271
+ "type": "string",
272
+ "pattern": "[^\\u0009-\\u000D\\u0020\\u0085\\u00A0\\u1680\\u2000-\\u200A\\u2028\\u2029\\u202F\\u205F\\u3000]"
273
+ },
274
+ "spaceId": {
275
+ "type": "string",
276
+ "pattern": "[^\\u0009-\\u000D\\u0020\\u0085\\u00A0\\u1680\\u2000-\\u200A\\u2028\\u2029\\u202F\\u205F\\u3000]"
277
+ },
278
+ "runId": {
279
+ "type": "string",
280
+ "pattern": "[^\\u0009-\\u000D\\u0020\\u0085\\u00A0\\u1680\\u2000-\\u200A\\u2028\\u2029\\u202F\\u205F\\u3000]"
281
+ },
282
+ "version": {
283
+ "type": "integer",
284
+ "minimum": 1,
285
+ "maximum": 9007199254740991
286
+ },
287
+ "status": {
288
+ "enum": [
289
+ "PENDING",
290
+ "RESOLVED",
291
+ "DISMISSED",
292
+ "EXPIRED"
293
+ ]
294
+ },
295
+ "createdAt": {
296
+ "type": "integer",
297
+ "minimum": 1,
298
+ "maximum": 9007199254740991
299
+ },
300
+ "updatedAt": {
301
+ "type": "integer",
302
+ "minimum": 1,
303
+ "maximum": 9007199254740991
304
+ },
305
+ "resolution": {
306
+ "anyOf": [
307
+ {
308
+ "$ref": "#/$defs/Resolution"
309
+ },
310
+ {
311
+ "type": "null"
312
+ }
313
+ ]
314
+ }
315
+ },
316
+ "required": [
317
+ "type",
318
+ "title",
319
+ "summary",
320
+ "reasons",
321
+ "evidence",
322
+ "id",
323
+ "spaceId",
324
+ "runId",
325
+ "version",
326
+ "status",
327
+ "createdAt",
328
+ "updatedAt"
329
+ ],
330
+ "additionalProperties": true,
331
+ "allOf": [
332
+ {
333
+ "if": {
334
+ "properties": {
335
+ "status": {
336
+ "enum": [
337
+ "RESOLVED",
338
+ "DISMISSED"
339
+ ]
340
+ }
341
+ },
342
+ "required": [
343
+ "status"
344
+ ],
345
+ "type": "object"
346
+ },
347
+ "then": {
348
+ "required": [
349
+ "resolution"
350
+ ],
351
+ "properties": {
352
+ "resolution": {
353
+ "$ref": "#/$defs/Resolution"
354
+ }
355
+ },
356
+ "type": "object"
357
+ },
358
+ "else": {
359
+ "properties": {
360
+ "resolution": {
361
+ "type": "null"
362
+ }
363
+ },
364
+ "type": "object"
365
+ }
366
+ }
367
+ ]
368
+ },
369
+ "AutomationDraft": {
370
+ "type": "object",
371
+ "properties": {
372
+ "type": {
373
+ "const": "AUTOMATION"
374
+ },
375
+ "title": {
376
+ "type": "string",
377
+ "pattern": "[^\\u0009-\\u000D\\u0020\\u0085\\u00A0\\u1680\\u2000-\\u200A\\u2028\\u2029\\u202F\\u205F\\u3000]"
378
+ },
379
+ "summary": {
380
+ "type": "string",
381
+ "pattern": "[^\\u0009-\\u000D\\u0020\\u0085\\u00A0\\u1680\\u2000-\\u200A\\u2028\\u2029\\u202F\\u205F\\u3000]"
382
+ },
383
+ "reasons": {
384
+ "type": "array",
385
+ "items": {
386
+ "type": "string",
387
+ "pattern": "[^\\u0009-\\u000D\\u0020\\u0085\\u00A0\\u1680\\u2000-\\u200A\\u2028\\u2029\\u202F\\u205F\\u3000]"
388
+ },
389
+ "minItems": 1
390
+ },
391
+ "evidence": {
392
+ "type": "array",
393
+ "items": {
394
+ "$ref": "#/$defs/Evidence"
395
+ },
396
+ "minItems": 1
397
+ },
398
+ "expiresAt": {
399
+ "anyOf": [
400
+ {
401
+ "type": "integer",
402
+ "minimum": 1,
403
+ "maximum": 9007199254740991
404
+ },
405
+ {
406
+ "type": "null"
407
+ }
408
+ ]
409
+ },
410
+ "operation": {
411
+ "enum": [
412
+ "CREATE",
413
+ "UPDATE"
414
+ ]
415
+ },
416
+ "automationId": {
417
+ "anyOf": [
418
+ {
419
+ "type": "string",
420
+ "pattern": "[^\\u0009-\\u000D\\u0020\\u0085\\u00A0\\u1680\\u2000-\\u200A\\u2028\\u2029\\u202F\\u205F\\u3000]"
421
+ },
422
+ {
423
+ "type": "null"
424
+ }
425
+ ]
426
+ },
427
+ "baseScriptHash": {
428
+ "anyOf": [
429
+ {
430
+ "type": "string",
431
+ "pattern": "[^\\u0009-\\u000D\\u0020\\u0085\\u00A0\\u1680\\u2000-\\u200A\\u2028\\u2029\\u202F\\u205F\\u3000]"
432
+ },
433
+ {
434
+ "type": "null"
435
+ }
436
+ ]
437
+ },
438
+ "script": {
439
+ "$ref": "#/$defs/AutomationScript"
440
+ }
441
+ },
442
+ "required": [
443
+ "type",
444
+ "title",
445
+ "summary",
446
+ "reasons",
447
+ "evidence",
448
+ "operation",
449
+ "script"
450
+ ],
451
+ "additionalProperties": false,
452
+ "allOf": [
453
+ {
454
+ "if": {
455
+ "properties": {
456
+ "operation": {
457
+ "const": "UPDATE"
458
+ }
459
+ },
460
+ "required": [
461
+ "operation"
462
+ ],
463
+ "type": "object"
464
+ },
465
+ "then": {
466
+ "required": [
467
+ "automationId",
468
+ "baseScriptHash"
469
+ ],
470
+ "properties": {
471
+ "automationId": {
472
+ "type": "string",
473
+ "pattern": "[^\\u0009-\\u000D\\u0020\\u0085\\u00A0\\u1680\\u2000-\\u200A\\u2028\\u2029\\u202F\\u205F\\u3000]"
474
+ },
475
+ "baseScriptHash": {
476
+ "type": "string",
477
+ "pattern": "[^\\u0009-\\u000D\\u0020\\u0085\\u00A0\\u1680\\u2000-\\u200A\\u2028\\u2029\\u202F\\u205F\\u3000]"
478
+ }
479
+ },
480
+ "type": "object"
481
+ },
482
+ "else": {
483
+ "properties": {
484
+ "automationId": {
485
+ "type": "null"
486
+ },
487
+ "baseScriptHash": {
488
+ "type": "null"
489
+ }
490
+ },
491
+ "type": "object"
492
+ }
493
+ }
494
+ ]
495
+ },
496
+ "AutomationSuggestion": {
497
+ "type": "object",
498
+ "properties": {
499
+ "type": {
500
+ "const": "AUTOMATION"
501
+ },
502
+ "title": {
503
+ "type": "string",
504
+ "pattern": "[^\\u0009-\\u000D\\u0020\\u0085\\u00A0\\u1680\\u2000-\\u200A\\u2028\\u2029\\u202F\\u205F\\u3000]"
505
+ },
506
+ "summary": {
507
+ "type": "string",
508
+ "pattern": "[^\\u0009-\\u000D\\u0020\\u0085\\u00A0\\u1680\\u2000-\\u200A\\u2028\\u2029\\u202F\\u205F\\u3000]"
509
+ },
510
+ "reasons": {
511
+ "type": "array",
512
+ "items": {
513
+ "type": "string",
514
+ "pattern": "[^\\u0009-\\u000D\\u0020\\u0085\\u00A0\\u1680\\u2000-\\u200A\\u2028\\u2029\\u202F\\u205F\\u3000]"
515
+ },
516
+ "minItems": 1
517
+ },
518
+ "evidence": {
519
+ "type": "array",
520
+ "items": {
521
+ "$ref": "#/$defs/Evidence"
522
+ },
523
+ "minItems": 1
524
+ },
525
+ "expiresAt": {
526
+ "anyOf": [
527
+ {
528
+ "type": "integer",
529
+ "minimum": 1,
530
+ "maximum": 9007199254740991
531
+ },
532
+ {
533
+ "type": "null"
534
+ }
535
+ ]
536
+ },
537
+ "operation": {
538
+ "enum": [
539
+ "CREATE",
540
+ "UPDATE"
541
+ ]
542
+ },
543
+ "automationId": {
544
+ "anyOf": [
545
+ {
546
+ "type": "string",
547
+ "pattern": "[^\\u0009-\\u000D\\u0020\\u0085\\u00A0\\u1680\\u2000-\\u200A\\u2028\\u2029\\u202F\\u205F\\u3000]"
548
+ },
549
+ {
550
+ "type": "null"
551
+ }
552
+ ]
553
+ },
554
+ "baseScriptHash": {
555
+ "anyOf": [
556
+ {
557
+ "type": "string",
558
+ "pattern": "[^\\u0009-\\u000D\\u0020\\u0085\\u00A0\\u1680\\u2000-\\u200A\\u2028\\u2029\\u202F\\u205F\\u3000]"
559
+ },
560
+ {
561
+ "type": "null"
562
+ }
563
+ ]
564
+ },
565
+ "script": {
566
+ "$ref": "#/$defs/AutomationScript"
567
+ },
568
+ "id": {
569
+ "type": "string",
570
+ "pattern": "[^\\u0009-\\u000D\\u0020\\u0085\\u00A0\\u1680\\u2000-\\u200A\\u2028\\u2029\\u202F\\u205F\\u3000]"
571
+ },
572
+ "spaceId": {
573
+ "type": "string",
574
+ "pattern": "[^\\u0009-\\u000D\\u0020\\u0085\\u00A0\\u1680\\u2000-\\u200A\\u2028\\u2029\\u202F\\u205F\\u3000]"
575
+ },
576
+ "runId": {
577
+ "type": "string",
578
+ "pattern": "[^\\u0009-\\u000D\\u0020\\u0085\\u00A0\\u1680\\u2000-\\u200A\\u2028\\u2029\\u202F\\u205F\\u3000]"
579
+ },
580
+ "version": {
581
+ "type": "integer",
582
+ "minimum": 1,
583
+ "maximum": 9007199254740991
584
+ },
585
+ "status": {
586
+ "enum": [
587
+ "PENDING",
588
+ "RESOLVED",
589
+ "DISMISSED",
590
+ "EXPIRED"
591
+ ]
592
+ },
593
+ "createdAt": {
594
+ "type": "integer",
595
+ "minimum": 1,
596
+ "maximum": 9007199254740991
597
+ },
598
+ "updatedAt": {
599
+ "type": "integer",
600
+ "minimum": 1,
601
+ "maximum": 9007199254740991
602
+ },
603
+ "resolution": {
604
+ "anyOf": [
605
+ {
606
+ "$ref": "#/$defs/Resolution"
607
+ },
608
+ {
609
+ "type": "null"
610
+ }
611
+ ]
612
+ }
613
+ },
614
+ "required": [
615
+ "type",
616
+ "title",
617
+ "summary",
618
+ "reasons",
619
+ "evidence",
620
+ "id",
621
+ "spaceId",
622
+ "runId",
623
+ "version",
624
+ "status",
625
+ "createdAt",
626
+ "updatedAt",
627
+ "operation",
628
+ "script"
629
+ ],
630
+ "additionalProperties": false,
631
+ "allOf": [
632
+ {
633
+ "if": {
634
+ "properties": {
635
+ "operation": {
636
+ "const": "UPDATE"
637
+ }
638
+ },
639
+ "required": [
640
+ "operation"
641
+ ],
642
+ "type": "object"
643
+ },
644
+ "then": {
645
+ "required": [
646
+ "automationId",
647
+ "baseScriptHash"
648
+ ],
649
+ "properties": {
650
+ "automationId": {
651
+ "type": "string",
652
+ "pattern": "[^\\u0009-\\u000D\\u0020\\u0085\\u00A0\\u1680\\u2000-\\u200A\\u2028\\u2029\\u202F\\u205F\\u3000]"
653
+ },
654
+ "baseScriptHash": {
655
+ "type": "string",
656
+ "pattern": "[^\\u0009-\\u000D\\u0020\\u0085\\u00A0\\u1680\\u2000-\\u200A\\u2028\\u2029\\u202F\\u205F\\u3000]"
657
+ }
658
+ },
659
+ "type": "object"
660
+ },
661
+ "else": {
662
+ "properties": {
663
+ "automationId": {
664
+ "type": "null"
665
+ },
666
+ "baseScriptHash": {
667
+ "type": "null"
668
+ }
669
+ },
670
+ "type": "object"
671
+ }
672
+ },
673
+ {
674
+ "if": {
675
+ "properties": {
676
+ "status": {
677
+ "enum": [
678
+ "RESOLVED",
679
+ "DISMISSED"
680
+ ]
681
+ }
682
+ },
683
+ "required": [
684
+ "status"
685
+ ],
686
+ "type": "object"
687
+ },
688
+ "then": {
689
+ "required": [
690
+ "resolution"
691
+ ],
692
+ "properties": {
693
+ "resolution": {
694
+ "$ref": "#/$defs/Resolution"
695
+ }
696
+ },
697
+ "type": "object"
698
+ },
699
+ "else": {
700
+ "properties": {
701
+ "resolution": {
702
+ "type": "null"
703
+ }
704
+ },
705
+ "type": "object"
706
+ }
707
+ }
708
+ ]
709
+ },
710
+ "GenerateInput": {
711
+ "type": "object",
712
+ "properties": {
713
+ "focus": {
714
+ "anyOf": [
715
+ {
716
+ "type": "string",
717
+ "pattern": "[^\\u0009-\\u000D\\u0020\\u0085\\u00A0\\u1680\\u2000-\\u200A\\u2028\\u2029\\u202F\\u205F\\u3000]"
718
+ },
719
+ {
720
+ "type": "null"
721
+ }
722
+ ]
723
+ }
724
+ },
725
+ "required": [],
726
+ "additionalProperties": false
727
+ },
728
+ "DetailInput": {
729
+ "type": "object",
730
+ "properties": {
731
+ "suggestionId": {
732
+ "type": "string",
733
+ "pattern": "[^\\u0009-\\u000D\\u0020\\u0085\\u00A0\\u1680\\u2000-\\u200A\\u2028\\u2029\\u202F\\u205F\\u3000]"
734
+ }
735
+ },
736
+ "required": [
737
+ "suggestionId"
738
+ ],
739
+ "additionalProperties": false
740
+ },
741
+ "HandleInput": {
742
+ "type": "object",
743
+ "properties": {
744
+ "suggestionId": {
745
+ "type": "string",
746
+ "pattern": "[^\\u0009-\\u000D\\u0020\\u0085\\u00A0\\u1680\\u2000-\\u200A\\u2028\\u2029\\u202F\\u205F\\u3000]"
747
+ },
748
+ "expectedVersion": {
749
+ "type": "integer",
750
+ "minimum": 1,
751
+ "maximum": 9007199254740991
752
+ },
753
+ "action": {
754
+ "type": "string",
755
+ "pattern": "^[A-Z][A-Z0-9_]*$"
756
+ }
757
+ },
758
+ "required": [
759
+ "suggestionId",
760
+ "expectedVersion",
761
+ "action"
762
+ ],
763
+ "additionalProperties": false
764
+ },
765
+ "FeedbackInput": {
766
+ "type": "object",
767
+ "properties": {
768
+ "suggestionId": {
769
+ "type": "string",
770
+ "pattern": "[^\\u0009-\\u000D\\u0020\\u0085\\u00A0\\u1680\\u2000-\\u200A\\u2028\\u2029\\u202F\\u205F\\u3000]"
771
+ },
772
+ "expectedVersion": {
773
+ "type": "integer",
774
+ "minimum": 1,
775
+ "maximum": 9007199254740991
776
+ },
777
+ "decision": {
778
+ "const": "DISMISS"
779
+ },
780
+ "comment": {
781
+ "anyOf": [
782
+ {
783
+ "type": "string",
784
+ "pattern": "[^\\u0009-\\u000D\\u0020\\u0085\\u00A0\\u1680\\u2000-\\u200A\\u2028\\u2029\\u202F\\u205F\\u3000]"
785
+ },
786
+ {
787
+ "type": "null"
788
+ }
789
+ ]
790
+ }
791
+ },
792
+ "required": [
793
+ "suggestionId",
794
+ "expectedVersion",
795
+ "decision"
796
+ ],
797
+ "additionalProperties": false
798
+ },
799
+ "ListInput": {
800
+ "type": "object",
801
+ "properties": {
802
+ "types": {
803
+ "type": "array",
804
+ "items": {
805
+ "type": "string",
806
+ "pattern": "^[A-Z][A-Z0-9_]*$"
807
+ }
808
+ },
809
+ "statuses": {
810
+ "type": "array",
811
+ "items": {
812
+ "enum": [
813
+ "PENDING",
814
+ "RESOLVED",
815
+ "DISMISSED",
816
+ "EXPIRED"
817
+ ]
818
+ }
819
+ },
820
+ "cursor": {
821
+ "anyOf": [
822
+ {
823
+ "type": "string",
824
+ "pattern": "[^\\u0009-\\u000D\\u0020\\u0085\\u00A0\\u1680\\u2000-\\u200A\\u2028\\u2029\\u202F\\u205F\\u3000]"
825
+ },
826
+ {
827
+ "type": "null"
828
+ }
829
+ ]
830
+ },
831
+ "limit": {
832
+ "type": "integer",
833
+ "minimum": 1,
834
+ "maximum": 100,
835
+ "default": 50
836
+ }
837
+ },
838
+ "required": [],
839
+ "additionalProperties": false
840
+ },
841
+ "SuggestionSummary": {
842
+ "type": "object",
843
+ "properties": {
844
+ "id": {
845
+ "type": "string",
846
+ "pattern": "[^\\u0009-\\u000D\\u0020\\u0085\\u00A0\\u1680\\u2000-\\u200A\\u2028\\u2029\\u202F\\u205F\\u3000]"
847
+ },
848
+ "type": {
849
+ "type": "string",
850
+ "pattern": "^[A-Z][A-Z0-9_]*$"
851
+ },
852
+ "version": {
853
+ "type": "integer",
854
+ "minimum": 1,
855
+ "maximum": 9007199254740991
856
+ },
857
+ "title": {
858
+ "type": "string",
859
+ "pattern": "[^\\u0009-\\u000D\\u0020\\u0085\\u00A0\\u1680\\u2000-\\u200A\\u2028\\u2029\\u202F\\u205F\\u3000]"
860
+ },
861
+ "summary": {
862
+ "type": "string",
863
+ "pattern": "[^\\u0009-\\u000D\\u0020\\u0085\\u00A0\\u1680\\u2000-\\u200A\\u2028\\u2029\\u202F\\u205F\\u3000]"
864
+ },
865
+ "status": {
866
+ "enum": [
867
+ "PENDING",
868
+ "RESOLVED",
869
+ "DISMISSED",
870
+ "EXPIRED"
871
+ ]
872
+ },
873
+ "createdAt": {
874
+ "type": "integer",
875
+ "minimum": 1,
876
+ "maximum": 9007199254740991
877
+ },
878
+ "updatedAt": {
879
+ "type": "integer",
880
+ "minimum": 1,
881
+ "maximum": 9007199254740991
882
+ },
883
+ "expiresAt": {
884
+ "anyOf": [
885
+ {
886
+ "type": "integer",
887
+ "minimum": 1,
888
+ "maximum": 9007199254740991
889
+ },
890
+ {
891
+ "type": "null"
892
+ }
893
+ ]
894
+ }
895
+ },
896
+ "required": [
897
+ "id",
898
+ "type",
899
+ "version",
900
+ "title",
901
+ "summary",
902
+ "status",
903
+ "createdAt",
904
+ "updatedAt"
905
+ ],
906
+ "additionalProperties": false
907
+ },
908
+ "ListOutput": {
909
+ "type": "object",
910
+ "properties": {
911
+ "items": {
912
+ "type": "array",
913
+ "items": {
914
+ "$ref": "#/$defs/SuggestionSummary"
915
+ }
916
+ },
917
+ "nextCursor": {
918
+ "anyOf": [
919
+ {
920
+ "type": "string",
921
+ "pattern": "[^\\u0009-\\u000D\\u0020\\u0085\\u00A0\\u1680\\u2000-\\u200A\\u2028\\u2029\\u202F\\u205F\\u3000]"
922
+ },
923
+ {
924
+ "type": "null"
925
+ }
926
+ ]
927
+ }
928
+ },
929
+ "required": [
930
+ "items"
931
+ ],
932
+ "additionalProperties": false
933
+ },
934
+ "GenerationResult": {
935
+ "type": "object",
936
+ "properties": {
937
+ "suggestions": {
938
+ "type": "array",
939
+ "items": {
940
+ "$ref": "#/$defs/SuggestionDraft"
941
+ }
942
+ },
943
+ "contextSummary": {
944
+ "anyOf": [
945
+ {
946
+ "type": "string",
947
+ "pattern": "[^\\u0009-\\u000D\\u0020\\u0085\\u00A0\\u1680\\u2000-\\u200A\\u2028\\u2029\\u202F\\u205F\\u3000]"
948
+ },
949
+ {
950
+ "type": "null"
951
+ }
952
+ ]
953
+ }
954
+ },
955
+ "required": [
956
+ "suggestions"
957
+ ],
958
+ "additionalProperties": false
959
+ },
960
+ "AutomationGenerationResult": {
961
+ "type": "object",
962
+ "properties": {
963
+ "suggestions": {
964
+ "type": "array",
965
+ "items": {
966
+ "$ref": "#/$defs/AutomationDraft"
967
+ }
968
+ },
969
+ "contextSummary": {
970
+ "anyOf": [
971
+ {
972
+ "type": "string",
973
+ "pattern": "[^\\u0009-\\u000D\\u0020\\u0085\\u00A0\\u1680\\u2000-\\u200A\\u2028\\u2029\\u202F\\u205F\\u3000]"
974
+ },
975
+ {
976
+ "type": "null"
977
+ }
978
+ ]
979
+ }
980
+ },
981
+ "required": [
982
+ "suggestions"
983
+ ],
984
+ "additionalProperties": false
985
+ },
986
+ "SuggestionRun": {
987
+ "type": "object",
988
+ "properties": {
989
+ "runId": {
990
+ "type": "string",
991
+ "pattern": "[^\\u0009-\\u000D\\u0020\\u0085\\u00A0\\u1680\\u2000-\\u200A\\u2028\\u2029\\u202F\\u205F\\u3000]"
992
+ },
993
+ "status": {
994
+ "enum": [
995
+ "RUNNING",
996
+ "SUCCEEDED",
997
+ "PARTIAL",
998
+ "FAILED",
999
+ "CANCELLED"
1000
+ ]
1001
+ },
1002
+ "startedAt": {
1003
+ "type": "integer",
1004
+ "minimum": 1,
1005
+ "maximum": 9007199254740991
1006
+ },
1007
+ "finishedAt": {
1008
+ "anyOf": [
1009
+ {
1010
+ "type": "integer",
1011
+ "minimum": 1,
1012
+ "maximum": 9007199254740991
1013
+ },
1014
+ {
1015
+ "type": "null"
1016
+ }
1017
+ ]
1018
+ },
1019
+ "suggestionIds": {
1020
+ "type": "array",
1021
+ "items": {
1022
+ "type": "string",
1023
+ "pattern": "[^\\u0009-\\u000D\\u0020\\u0085\\u00A0\\u1680\\u2000-\\u200A\\u2028\\u2029\\u202F\\u205F\\u3000]"
1024
+ }
1025
+ },
1026
+ "errorCode": {
1027
+ "anyOf": [
1028
+ {
1029
+ "type": "string",
1030
+ "pattern": "[^\\u0009-\\u000D\\u0020\\u0085\\u00A0\\u1680\\u2000-\\u200A\\u2028\\u2029\\u202F\\u205F\\u3000]"
1031
+ },
1032
+ {
1033
+ "type": "null"
1034
+ }
1035
+ ]
1036
+ }
1037
+ },
1038
+ "required": [
1039
+ "runId",
1040
+ "status",
1041
+ "startedAt",
1042
+ "suggestionIds"
1043
+ ],
1044
+ "additionalProperties": false,
1045
+ "allOf": [
1046
+ {
1047
+ "if": {
1048
+ "properties": {
1049
+ "status": {
1050
+ "const": "RUNNING"
1051
+ }
1052
+ },
1053
+ "required": [
1054
+ "status"
1055
+ ],
1056
+ "type": "object"
1057
+ },
1058
+ "then": {
1059
+ "properties": {
1060
+ "finishedAt": {
1061
+ "type": "null"
1062
+ }
1063
+ },
1064
+ "type": "object"
1065
+ },
1066
+ "else": {
1067
+ "required": [
1068
+ "finishedAt"
1069
+ ],
1070
+ "properties": {
1071
+ "finishedAt": {
1072
+ "type": "integer",
1073
+ "minimum": 1,
1074
+ "maximum": 9007199254740991
1075
+ }
1076
+ },
1077
+ "type": "object"
1078
+ }
1079
+ },
1080
+ {
1081
+ "if": {
1082
+ "properties": {
1083
+ "status": {
1084
+ "enum": [
1085
+ "PARTIAL",
1086
+ "FAILED"
1087
+ ]
1088
+ }
1089
+ },
1090
+ "required": [
1091
+ "status"
1092
+ ],
1093
+ "type": "object"
1094
+ },
1095
+ "then": {
1096
+ "required": [
1097
+ "errorCode"
1098
+ ],
1099
+ "properties": {
1100
+ "errorCode": {
1101
+ "type": "string",
1102
+ "pattern": "[^\\u0009-\\u000D\\u0020\\u0085\\u00A0\\u1680\\u2000-\\u200A\\u2028\\u2029\\u202F\\u205F\\u3000]"
1103
+ }
1104
+ },
1105
+ "type": "object"
1106
+ }
1107
+ },
1108
+ {
1109
+ "if": {
1110
+ "properties": {
1111
+ "status": {
1112
+ "enum": [
1113
+ "RUNNING",
1114
+ "SUCCEEDED"
1115
+ ]
1116
+ }
1117
+ },
1118
+ "required": [
1119
+ "status"
1120
+ ],
1121
+ "type": "object"
1122
+ },
1123
+ "then": {
1124
+ "properties": {
1125
+ "errorCode": {
1126
+ "type": "null"
1127
+ }
1128
+ },
1129
+ "type": "object"
1130
+ }
1131
+ },
1132
+ {
1133
+ "if": {
1134
+ "properties": {
1135
+ "status": {
1136
+ "enum": [
1137
+ "RUNNING",
1138
+ "FAILED",
1139
+ "CANCELLED"
1140
+ ]
1141
+ }
1142
+ },
1143
+ "required": [
1144
+ "status"
1145
+ ],
1146
+ "type": "object"
1147
+ },
1148
+ "then": {
1149
+ "properties": {
1150
+ "suggestionIds": {
1151
+ "maxItems": 0,
1152
+ "type": "array"
1153
+ }
1154
+ },
1155
+ "type": "object"
1156
+ }
1157
+ }
1158
+ ]
1159
+ },
1160
+ "GenerateOutput": {
1161
+ "type": "object",
1162
+ "additionalProperties": false,
1163
+ "properties": {
1164
+ "accepted": {
1165
+ "type": "boolean"
1166
+ },
1167
+ "run": {
1168
+ "$ref": "#/$defs/SuggestionRun"
1169
+ }
1170
+ },
1171
+ "required": [
1172
+ "accepted",
1173
+ "run"
1174
+ ]
1175
+ },
1176
+ "GenerationGetInput": {
1177
+ "type": "object",
1178
+ "additionalProperties": false,
1179
+ "properties": {
1180
+ "runId": {
1181
+ "anyOf": [
1182
+ {
1183
+ "type": "string",
1184
+ "pattern": "[^\\u0009-\\u000D\\u0020\\u0085\\u00A0\\u1680\\u2000-\\u200A\\u2028\\u2029\\u202F\\u205F\\u3000]"
1185
+ },
1186
+ {
1187
+ "type": "null"
1188
+ }
1189
+ ]
1190
+ }
1191
+ }
1192
+ },
1193
+ "GenerationGetOutput": {
1194
+ "type": "object",
1195
+ "additionalProperties": false,
1196
+ "properties": {
1197
+ "run": {
1198
+ "anyOf": [
1199
+ {
1200
+ "$ref": "#/$defs/SuggestionRun"
1201
+ },
1202
+ {
1203
+ "type": "null"
1204
+ }
1205
+ ]
1206
+ }
1207
+ },
1208
+ "required": [
1209
+ "run"
1210
+ ]
1211
+ }
1212
+ }
1213
+ }