@mizen-labs/cli 0.0.0-stage → 0.1.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/schema/v1.json ADDED
@@ -0,0 +1,684 @@
1
+ {
2
+ "$schema": "http://json-schema.org/draft-07/schema#",
3
+ "$id": "urn:mizen:cli:output:v1",
4
+ "title": "Mizen CLI output, schema version 1",
5
+ "description": "One complete --json response. The envelope is fixed; payloads permit additive fields. Results go to stdout. Errors go to stderr as one line. Doctor and init can print a result envelope with exit code 1 when a check or install fails.",
6
+ "oneOf": [
7
+ {
8
+ "$ref": "#/definitions/HelpOutput"
9
+ },
10
+ {
11
+ "$ref": "#/definitions/VersionOutput"
12
+ },
13
+ {
14
+ "$ref": "#/definitions/SearchOutput"
15
+ },
16
+ {
17
+ "$ref": "#/definitions/InfoOutput"
18
+ },
19
+ {
20
+ "$ref": "#/definitions/DoctorOutput"
21
+ },
22
+ {
23
+ "$ref": "#/definitions/InitOutput"
24
+ },
25
+ {
26
+ "$ref": "#/definitions/ErrorOutput"
27
+ }
28
+ ],
29
+ "definitions": {
30
+ "ApiProperty": {
31
+ "type": "object",
32
+ "properties": {
33
+ "defaultValue": {
34
+ "type": "string"
35
+ },
36
+ "description": {
37
+ "type": "string"
38
+ },
39
+ "name": {
40
+ "type": "string"
41
+ },
42
+ "type": {
43
+ "type": "string"
44
+ }
45
+ },
46
+ "required": ["defaultValue", "description", "name", "type"]
47
+ },
48
+ "ComponentSummary": {
49
+ "type": "object",
50
+ "properties": {
51
+ "category": {
52
+ "type": "string"
53
+ },
54
+ "description": {
55
+ "type": "string"
56
+ },
57
+ "entryPoint": {
58
+ "type": "string"
59
+ },
60
+ "name": {
61
+ "type": "string"
62
+ },
63
+ "slug": {
64
+ "type": "string"
65
+ },
66
+ "status": {
67
+ "type": "string"
68
+ }
69
+ },
70
+ "required": [
71
+ "category",
72
+ "description",
73
+ "entryPoint",
74
+ "name",
75
+ "slug",
76
+ "status"
77
+ ]
78
+ },
79
+ "Component": {
80
+ "type": "object",
81
+ "properties": {
82
+ "category": {
83
+ "type": "string"
84
+ },
85
+ "description": {
86
+ "type": "string"
87
+ },
88
+ "entryPoint": {
89
+ "type": "string"
90
+ },
91
+ "name": {
92
+ "type": "string"
93
+ },
94
+ "slug": {
95
+ "type": "string"
96
+ },
97
+ "status": {
98
+ "type": "string"
99
+ },
100
+ "api": {
101
+ "type": "array",
102
+ "items": {
103
+ "$ref": "#/definitions/ApiProperty"
104
+ }
105
+ },
106
+ "documentationPath": {
107
+ "type": "string"
108
+ },
109
+ "guidance": {
110
+ "type": "object",
111
+ "properties": {
112
+ "boundaries": {
113
+ "type": "array",
114
+ "items": {
115
+ "type": "string"
116
+ }
117
+ },
118
+ "recommendations": {
119
+ "type": "array",
120
+ "items": {
121
+ "type": "string"
122
+ }
123
+ }
124
+ },
125
+ "required": ["boundaries", "recommendations"]
126
+ },
127
+ "apiSections": {
128
+ "type": "array",
129
+ "items": {
130
+ "type": "object",
131
+ "properties": {
132
+ "name": {
133
+ "type": "string"
134
+ },
135
+ "description": {
136
+ "type": "string"
137
+ },
138
+ "properties": {
139
+ "type": "array",
140
+ "items": {
141
+ "$ref": "#/definitions/ApiProperty"
142
+ }
143
+ }
144
+ },
145
+ "required": ["name", "description", "properties"]
146
+ }
147
+ },
148
+ "usageSections": {
149
+ "type": "array",
150
+ "items": {
151
+ "type": "object",
152
+ "properties": {
153
+ "code": {
154
+ "type": "string"
155
+ },
156
+ "description": {
157
+ "type": "string"
158
+ },
159
+ "id": {
160
+ "type": "string"
161
+ },
162
+ "title": {
163
+ "type": "string"
164
+ }
165
+ },
166
+ "required": ["code", "description", "id", "title"]
167
+ }
168
+ },
169
+ "contract": {
170
+ "type": "object"
171
+ }
172
+ },
173
+ "required": [
174
+ "category",
175
+ "description",
176
+ "entryPoint",
177
+ "name",
178
+ "slug",
179
+ "status",
180
+ "api",
181
+ "documentationPath",
182
+ "guidance"
183
+ ]
184
+ },
185
+ "Diagnostic": {
186
+ "type": "object",
187
+ "properties": {
188
+ "evidence": {
189
+ "type": "array",
190
+ "items": {
191
+ "type": "string"
192
+ }
193
+ },
194
+ "id": {
195
+ "type": "string",
196
+ "minLength": 1
197
+ },
198
+ "message": {
199
+ "type": "string"
200
+ },
201
+ "packageManager": {
202
+ "type": "string"
203
+ },
204
+ "repair": {
205
+ "type": "string"
206
+ },
207
+ "status": {
208
+ "type": "string",
209
+ "enum": ["pass", "error", "unverified"]
210
+ },
211
+ "project": {
212
+ "type": ["string", "null"]
213
+ }
214
+ },
215
+ "required": ["evidence", "id", "message", "status"]
216
+ },
217
+ "DoctorResult": {
218
+ "type": "object",
219
+ "properties": {
220
+ "diagnostics": {
221
+ "type": "array",
222
+ "items": {
223
+ "$ref": "#/definitions/Diagnostic"
224
+ }
225
+ },
226
+ "project": {
227
+ "type": ["string", "null"]
228
+ },
229
+ "status": {
230
+ "type": "string",
231
+ "enum": ["healthy", "incomplete", "failed"]
232
+ },
233
+ "summary": {
234
+ "type": "object",
235
+ "properties": {
236
+ "errors": {
237
+ "type": "integer",
238
+ "minimum": 0
239
+ },
240
+ "passed": {
241
+ "type": "integer",
242
+ "minimum": 0
243
+ },
244
+ "unverified": {
245
+ "type": "integer",
246
+ "minimum": 0
247
+ }
248
+ },
249
+ "required": ["errors", "passed", "unverified"]
250
+ },
251
+ "framework": {
252
+ "type": "string",
253
+ "enum": ["next", "start", "vite", "unknown"]
254
+ },
255
+ "uiVersion": {
256
+ "type": ["string", "null"]
257
+ },
258
+ "workspace": {
259
+ "anyOf": [
260
+ {
261
+ "type": "object",
262
+ "properties": {
263
+ "kind": {
264
+ "enum": ["npm", "pnpm"],
265
+ "type": "string"
266
+ },
267
+ "patterns": {
268
+ "type": "array",
269
+ "items": {
270
+ "type": "string"
271
+ }
272
+ },
273
+ "source": {
274
+ "type": "string"
275
+ }
276
+ },
277
+ "required": ["kind", "patterns", "source"]
278
+ },
279
+ {
280
+ "type": "null"
281
+ }
282
+ ]
283
+ },
284
+ "apps": {
285
+ "type": "array",
286
+ "items": {
287
+ "$ref": "#/definitions/WorkspaceApp"
288
+ }
289
+ },
290
+ "skipped": {
291
+ "type": "array",
292
+ "items": {
293
+ "type": "object",
294
+ "properties": {
295
+ "name": {
296
+ "type": ["string", "null"]
297
+ },
298
+ "path": {
299
+ "type": "string"
300
+ },
301
+ "project": {
302
+ "type": "string"
303
+ },
304
+ "reason": {
305
+ "type": "string"
306
+ },
307
+ "status": {
308
+ "type": "string",
309
+ "enum": ["skipped", "unverified"]
310
+ }
311
+ },
312
+ "required": ["name", "path", "project", "reason", "status"]
313
+ }
314
+ }
315
+ },
316
+ "required": ["diagnostics", "project", "status", "summary"],
317
+ "dependencies": {
318
+ "workspace": ["apps", "skipped"],
319
+ "apps": ["workspace", "skipped"],
320
+ "skipped": ["workspace", "apps"]
321
+ }
322
+ },
323
+ "FileEdit": {
324
+ "type": "object",
325
+ "properties": {
326
+ "after": {
327
+ "type": "string"
328
+ },
329
+ "before": {
330
+ "type": ["string", "null"]
331
+ },
332
+ "diff": {
333
+ "type": "string"
334
+ },
335
+ "path": {
336
+ "type": "string"
337
+ }
338
+ },
339
+ "required": ["after", "before", "diff", "path"]
340
+ },
341
+ "Install": {
342
+ "type": "object",
343
+ "properties": {
344
+ "archive": {
345
+ "anyOf": [
346
+ {
347
+ "type": "object",
348
+ "properties": {
349
+ "path": {
350
+ "type": "string"
351
+ },
352
+ "sha256": {
353
+ "type": "string",
354
+ "pattern": "^[a-f0-9]{64}$"
355
+ }
356
+ },
357
+ "required": ["path", "sha256"]
358
+ },
359
+ {
360
+ "type": "null"
361
+ }
362
+ ]
363
+ },
364
+ "args": {
365
+ "type": "array",
366
+ "items": {
367
+ "type": "string"
368
+ }
369
+ },
370
+ "command": {
371
+ "type": "string",
372
+ "enum": ["npm", "pnpm"]
373
+ },
374
+ "packages": {
375
+ "type": "array",
376
+ "items": {
377
+ "type": "string"
378
+ }
379
+ }
380
+ },
381
+ "required": ["archive", "args", "command", "packages"]
382
+ },
383
+ "InitPlan": {
384
+ "type": "object",
385
+ "properties": {
386
+ "edits": {
387
+ "type": "array",
388
+ "items": {
389
+ "$ref": "#/definitions/FileEdit"
390
+ }
391
+ },
392
+ "framework": {
393
+ "type": "string",
394
+ "enum": ["next", "start", "vite"]
395
+ },
396
+ "inputs": {
397
+ "type": "array",
398
+ "items": {
399
+ "type": "object",
400
+ "properties": {
401
+ "path": {
402
+ "type": "string"
403
+ },
404
+ "before": {
405
+ "type": ["string", "null"]
406
+ }
407
+ },
408
+ "required": ["path", "before"]
409
+ }
410
+ },
411
+ "install": {
412
+ "anyOf": [
413
+ {
414
+ "$ref": "#/definitions/Install"
415
+ },
416
+ {
417
+ "type": "null"
418
+ }
419
+ ]
420
+ },
421
+ "manifestBefore": {
422
+ "type": "string"
423
+ },
424
+ "project": {
425
+ "type": "string"
426
+ },
427
+ "uiVersion": {
428
+ "type": "string"
429
+ }
430
+ },
431
+ "required": [
432
+ "edits",
433
+ "framework",
434
+ "install",
435
+ "manifestBefore",
436
+ "project",
437
+ "uiVersion"
438
+ ]
439
+ },
440
+ "InitResult": {
441
+ "type": "object",
442
+ "properties": {
443
+ "message": {
444
+ "type": "string"
445
+ },
446
+ "plan": {
447
+ "$ref": "#/definitions/InitPlan"
448
+ },
449
+ "status": {
450
+ "type": "string",
451
+ "enum": [
452
+ "planned",
453
+ "unchanged",
454
+ "applied",
455
+ "install-failed",
456
+ "verification-failed"
457
+ ]
458
+ },
459
+ "verification": {
460
+ "anyOf": [
461
+ {
462
+ "$ref": "#/definitions/DoctorResult"
463
+ },
464
+ {
465
+ "type": "null"
466
+ }
467
+ ]
468
+ }
469
+ },
470
+ "required": ["message", "plan", "status", "verification"]
471
+ },
472
+ "HelpOutput": {
473
+ "type": "object",
474
+ "properties": {
475
+ "schemaVersion": {
476
+ "const": 1
477
+ },
478
+ "command": {
479
+ "const": "help"
480
+ },
481
+ "data": {
482
+ "type": "object",
483
+ "properties": {
484
+ "usage": {
485
+ "type": "string",
486
+ "minLength": 1
487
+ }
488
+ },
489
+ "required": ["usage"]
490
+ }
491
+ },
492
+ "required": ["schemaVersion", "command", "data"],
493
+ "additionalProperties": false
494
+ },
495
+ "VersionOutput": {
496
+ "type": "object",
497
+ "properties": {
498
+ "schemaVersion": {
499
+ "const": 1
500
+ },
501
+ "command": {
502
+ "const": "version"
503
+ },
504
+ "data": {
505
+ "type": "object",
506
+ "properties": {
507
+ "version": {
508
+ "type": "string",
509
+ "minLength": 1
510
+ }
511
+ },
512
+ "required": ["version"]
513
+ }
514
+ },
515
+ "required": ["schemaVersion", "command", "data"],
516
+ "additionalProperties": false
517
+ },
518
+ "SearchOutput": {
519
+ "type": "object",
520
+ "properties": {
521
+ "schemaVersion": {
522
+ "const": 1
523
+ },
524
+ "command": {
525
+ "const": "search"
526
+ },
527
+ "data": {
528
+ "type": "object",
529
+ "properties": {
530
+ "components": {
531
+ "type": "array",
532
+ "items": {
533
+ "$ref": "#/definitions/ComponentSummary"
534
+ }
535
+ },
536
+ "query": {
537
+ "type": "string"
538
+ },
539
+ "uiVersion": {
540
+ "type": "string"
541
+ }
542
+ },
543
+ "required": ["components", "query", "uiVersion"]
544
+ }
545
+ },
546
+ "required": ["schemaVersion", "command", "data"],
547
+ "additionalProperties": false
548
+ },
549
+ "InfoOutput": {
550
+ "type": "object",
551
+ "properties": {
552
+ "schemaVersion": {
553
+ "const": 1
554
+ },
555
+ "command": {
556
+ "const": "info"
557
+ },
558
+ "data": {
559
+ "type": "object",
560
+ "properties": {
561
+ "component": {
562
+ "$ref": "#/definitions/Component"
563
+ },
564
+ "uiVersion": {
565
+ "type": "string"
566
+ }
567
+ },
568
+ "required": ["component", "uiVersion"]
569
+ }
570
+ },
571
+ "required": ["schemaVersion", "command", "data"],
572
+ "additionalProperties": false
573
+ },
574
+ "DoctorOutput": {
575
+ "type": "object",
576
+ "properties": {
577
+ "schemaVersion": {
578
+ "const": 1
579
+ },
580
+ "command": {
581
+ "const": "doctor"
582
+ },
583
+ "data": {
584
+ "$ref": "#/definitions/DoctorResult"
585
+ }
586
+ },
587
+ "required": ["schemaVersion", "command", "data"],
588
+ "additionalProperties": false
589
+ },
590
+ "InitOutput": {
591
+ "type": "object",
592
+ "properties": {
593
+ "schemaVersion": {
594
+ "const": 1
595
+ },
596
+ "command": {
597
+ "const": "init"
598
+ },
599
+ "data": {
600
+ "$ref": "#/definitions/InitResult"
601
+ }
602
+ },
603
+ "required": ["schemaVersion", "command", "data"],
604
+ "additionalProperties": false
605
+ },
606
+ "ErrorOutput": {
607
+ "type": "object",
608
+ "description": "Printed as one line on stderr; stdout stays empty. The exit code is 2 for usage and missing input, 1 for other failures.",
609
+ "properties": {
610
+ "schemaVersion": {
611
+ "const": 1
612
+ },
613
+ "error": {
614
+ "type": "object",
615
+ "properties": {
616
+ "reason": {
617
+ "type": "string",
618
+ "enum": [
619
+ "internal_error",
620
+ "invalid_arguments",
621
+ "unknown_option",
622
+ "unknown_command",
623
+ "missing_name",
624
+ "not_found",
625
+ "project_not_found",
626
+ "conflict",
627
+ "recovery_required"
628
+ ]
629
+ },
630
+ "message": {
631
+ "type": "string",
632
+ "description": "The human headline. Read reason, never parse this."
633
+ },
634
+ "next": {
635
+ "type": "array",
636
+ "items": {
637
+ "type": "object",
638
+ "properties": {
639
+ "argv": {
640
+ "type": "array",
641
+ "items": {
642
+ "type": "string"
643
+ }
644
+ },
645
+ "command": {
646
+ "type": "string"
647
+ }
648
+ },
649
+ "required": ["argv", "command"],
650
+ "additionalProperties": false
651
+ }
652
+ },
653
+ "data": {
654
+ "type": "object"
655
+ }
656
+ },
657
+ "required": ["reason", "message"],
658
+ "additionalProperties": false
659
+ }
660
+ },
661
+ "required": ["schemaVersion", "error"],
662
+ "additionalProperties": false
663
+ },
664
+ "WorkspaceApp": {
665
+ "allOf": [
666
+ {
667
+ "$ref": "#/definitions/DoctorResult"
668
+ },
669
+ {
670
+ "type": "object",
671
+ "properties": {
672
+ "name": {
673
+ "type": ["string", "null"]
674
+ },
675
+ "path": {
676
+ "type": "string"
677
+ }
678
+ },
679
+ "required": ["name", "path"]
680
+ }
681
+ ]
682
+ }
683
+ }
684
+ }