@clegra/sdk 0.0.0-stage → 0.1.0-next.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.
Files changed (81) hide show
  1. package/CHANGELOG.md +152 -0
  2. package/LICENSE +21 -0
  3. package/NOTICE.md +25 -0
  4. package/README.md +258 -2
  5. package/dist/spec/kinds.json +211 -0
  6. package/dist/spec/schema/clegra.schema.json +1249 -0
  7. package/dist/spec/src/cli.d.ts +2 -0
  8. package/dist/spec/src/cli.js +21 -0
  9. package/dist/spec/src/cli.js.map +1 -0
  10. package/dist/spec/src/conformance.d.ts +34 -0
  11. package/dist/spec/src/conformance.js +703 -0
  12. package/dist/spec/src/conformance.js.map +1 -0
  13. package/dist/spec/src/init/index.d.ts +31 -0
  14. package/dist/spec/src/init/index.js +151 -0
  15. package/dist/spec/src/init/index.js.map +1 -0
  16. package/dist/spec/src/init/next-config.d.ts +19 -0
  17. package/dist/spec/src/init/next-config.js +77 -0
  18. package/dist/spec/src/init/next-config.js.map +1 -0
  19. package/dist/spec/src/init/project.d.ts +44 -0
  20. package/dist/spec/src/init/project.js +141 -0
  21. package/dist/spec/src/init/project.js.map +1 -0
  22. package/dist/spec/src/init/templates.d.ts +20 -0
  23. package/dist/spec/src/init/templates.js +166 -0
  24. package/dist/spec/src/init/templates.js.map +1 -0
  25. package/dist/spec/src/init/ui.d.ts +30 -0
  26. package/dist/spec/src/init/ui.js +82 -0
  27. package/dist/spec/src/init/ui.js.map +1 -0
  28. package/dist/spec/src/kinds.d.ts +89 -0
  29. package/dist/spec/src/kinds.js +319 -0
  30. package/dist/spec/src/kinds.js.map +1 -0
  31. package/dist/spec/src/protocol.d.ts +50 -0
  32. package/dist/spec/src/protocol.js +52 -0
  33. package/dist/spec/src/protocol.js.map +1 -0
  34. package/dist/spec/src/rules.d.ts +132 -0
  35. package/dist/spec/src/rules.js +282 -0
  36. package/dist/spec/src/rules.js.map +1 -0
  37. package/dist/src/auth.d.ts +371 -0
  38. package/dist/src/auth.js +964 -0
  39. package/dist/src/auth.js.map +1 -0
  40. package/dist/src/define.d.ts +249 -0
  41. package/dist/src/define.js +83 -0
  42. package/dist/src/define.js.map +1 -0
  43. package/dist/src/embed.d.ts +98 -0
  44. package/dist/src/embed.js +256 -0
  45. package/dist/src/embed.js.map +1 -0
  46. package/dist/src/index.d.ts +11 -0
  47. package/dist/src/index.js +11 -0
  48. package/dist/src/index.js.map +1 -0
  49. package/dist/src/labels.d.ts +10 -0
  50. package/dist/src/labels.js +22 -0
  51. package/dist/src/labels.js.map +1 -0
  52. package/dist/src/manifest.d.ts +499 -0
  53. package/dist/src/manifest.js +188 -0
  54. package/dist/src/manifest.js.map +1 -0
  55. package/dist/src/meaning.d.ts +64 -0
  56. package/dist/src/meaning.js +116 -0
  57. package/dist/src/meaning.js.map +1 -0
  58. package/dist/src/next/index.d.ts +101 -0
  59. package/dist/src/next/index.js +187 -0
  60. package/dist/src/next/index.js.map +1 -0
  61. package/dist/src/node.d.ts +14 -0
  62. package/dist/src/node.js +64 -0
  63. package/dist/src/node.js.map +1 -0
  64. package/dist/src/server.d.ts +229 -0
  65. package/dist/src/server.js +2256 -0
  66. package/dist/src/server.js.map +1 -0
  67. package/dist/src/store.d.ts +129 -0
  68. package/dist/src/store.js +213 -0
  69. package/dist/src/store.js.map +1 -0
  70. package/dist/src/testing.d.ts +133 -0
  71. package/dist/src/testing.js +81 -0
  72. package/dist/src/testing.js.map +1 -0
  73. package/dist/src/types.d.ts +352 -0
  74. package/dist/src/types.js +2 -0
  75. package/dist/src/types.js.map +1 -0
  76. package/dist/src/view.d.ts +35 -0
  77. package/dist/src/view.js +442 -0
  78. package/dist/src/view.js.map +1 -0
  79. package/docs/quickstart.md +350 -0
  80. package/docs/spec.md +997 -0
  81. package/package.json +89 -4
@@ -0,0 +1,1249 @@
1
+ {
2
+ "$id": "urn:clegra:manifest:1.0",
3
+ "title": "Clegra app manifest 1.0",
4
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
5
+ "type": "object",
6
+ "properties": {
7
+ "specVersion": {
8
+ "type": "string",
9
+ "const": "1.0"
10
+ },
11
+ "name": {
12
+ "type": "string",
13
+ "pattern": "^[a-z][a-z0-9-]{1,39}$"
14
+ },
15
+ "title": {
16
+ "type": "object",
17
+ "propertyNames": {
18
+ "type": "string"
19
+ },
20
+ "additionalProperties": {
21
+ "type": "string"
22
+ },
23
+ "description": "A label per locale (BCP 47 → text)"
24
+ },
25
+ "version": {
26
+ "type": "string"
27
+ },
28
+ "description": {
29
+ "type": "object",
30
+ "propertyNames": {
31
+ "type": "string"
32
+ },
33
+ "additionalProperties": {
34
+ "type": "string"
35
+ },
36
+ "description": "A label per locale (BCP 47 → text)"
37
+ },
38
+ "icons": {
39
+ "type": "array",
40
+ "items": {
41
+ "type": "object",
42
+ "properties": {
43
+ "src": {
44
+ "type": "string"
45
+ },
46
+ "mimeType": {
47
+ "type": "string"
48
+ },
49
+ "sizes": {
50
+ "type": "array",
51
+ "items": {
52
+ "type": "string"
53
+ }
54
+ }
55
+ },
56
+ "required": [
57
+ "src"
58
+ ],
59
+ "additionalProperties": false
60
+ }
61
+ },
62
+ "publisher": {
63
+ "description": "Who publishes the app: a claim that grants nothing; a store or host may verify it by the address's domain",
64
+ "type": "object",
65
+ "properties": {
66
+ "name": {
67
+ "type": "string",
68
+ "minLength": 1,
69
+ "maxLength": 100
70
+ },
71
+ "url": {
72
+ "type": "string",
73
+ "maxLength": 300,
74
+ "description": "The publisher's web address: an absolute https URL"
75
+ }
76
+ },
77
+ "required": [
78
+ "name",
79
+ "url"
80
+ ],
81
+ "additionalProperties": false
82
+ },
83
+ "locale": {
84
+ "type": "string"
85
+ },
86
+ "mcp": {
87
+ "type": "object",
88
+ "properties": {
89
+ "url": {
90
+ "type": "string"
91
+ }
92
+ },
93
+ "required": [
94
+ "url"
95
+ ],
96
+ "additionalProperties": false,
97
+ "description": "The MCP endpoint (Streamable HTTP), relative to the manifest"
98
+ },
99
+ "auth": {
100
+ "type": "object",
101
+ "properties": {
102
+ "resource": {
103
+ "description": "The app's public MCP address: the only token audience it accepts. A host installs the app from this address or not at all",
104
+ "type": "string"
105
+ },
106
+ "authorizationServers": {
107
+ "type": "array",
108
+ "items": {
109
+ "type": "string"
110
+ }
111
+ }
112
+ },
113
+ "required": [
114
+ "authorizationServers"
115
+ ],
116
+ "additionalProperties": false,
117
+ "description": "MCP authorization: the server's own address (the token audience) and who issues tokens"
118
+ },
119
+ "view": {
120
+ "type": "string",
121
+ "description": "The generated ui:// view for lists, records, dashboards and fragments"
122
+ },
123
+ "resolveTool": {
124
+ "type": "string",
125
+ "description": "Hosts resolve record and fragment URIs with this tool"
126
+ },
127
+ "embed": {
128
+ "description": "Same-site url pages, framed by hosts with a sign-in ticket",
129
+ "type": "object",
130
+ "properties": {
131
+ "tool": {
132
+ "type": "object",
133
+ "properties": {
134
+ "name": {
135
+ "type": "string",
136
+ "description": "The MCP tool"
137
+ },
138
+ "plain": {
139
+ "type": "boolean",
140
+ "description": "Listed to plain MCP clients"
141
+ }
142
+ },
143
+ "required": [
144
+ "name",
145
+ "plain"
146
+ ],
147
+ "additionalProperties": false,
148
+ "description": "The tool a host asks for an embed ticket with (spec §5.1)"
149
+ },
150
+ "path": {
151
+ "type": "string",
152
+ "description": "Where the embed pages live; tickets are posted to <path>/_ticket"
153
+ },
154
+ "frameAncestors": {
155
+ "minItems": 1,
156
+ "type": "array",
157
+ "items": {
158
+ "type": "string"
159
+ },
160
+ "description": "The hosts that may frame the embed pages (CSP frame-ancestors sources)"
161
+ }
162
+ },
163
+ "required": [
164
+ "tool",
165
+ "path",
166
+ "frameAncestors"
167
+ ],
168
+ "additionalProperties": false
169
+ },
170
+ "searchTool": {
171
+ "type": "string"
172
+ },
173
+ "kinds": {
174
+ "description": "The namespaced kinds (with a dot) this app defines (spec §3.1)",
175
+ "type": "object",
176
+ "propertyNames": {
177
+ "type": "string"
178
+ },
179
+ "additionalProperties": {
180
+ "type": "object",
181
+ "properties": {
182
+ "label": {
183
+ "type": "object",
184
+ "propertyNames": {
185
+ "type": "string"
186
+ },
187
+ "additionalProperties": {
188
+ "type": "string"
189
+ },
190
+ "description": "A label per locale (BCP 47 → text)"
191
+ },
192
+ "properties": {
193
+ "type": "object",
194
+ "propertyNames": {
195
+ "type": "string"
196
+ },
197
+ "additionalProperties": {
198
+ "type": "object",
199
+ "properties": {
200
+ "type": {
201
+ "type": "string",
202
+ "enum": [
203
+ "string",
204
+ "number",
205
+ "boolean",
206
+ "date",
207
+ "address",
208
+ "money"
209
+ ]
210
+ },
211
+ "many": {
212
+ "type": "boolean"
213
+ },
214
+ "key": {
215
+ "type": "boolean"
216
+ }
217
+ },
218
+ "required": [
219
+ "type"
220
+ ],
221
+ "additionalProperties": false
222
+ }
223
+ }
224
+ },
225
+ "required": [
226
+ "label",
227
+ "properties"
228
+ ],
229
+ "additionalProperties": false
230
+ }
231
+ },
232
+ "entities": {
233
+ "type": "array",
234
+ "items": {
235
+ "type": "object",
236
+ "properties": {
237
+ "name": {
238
+ "type": "string",
239
+ "pattern": "^[a-z][a-z0-9_]{0,39}$"
240
+ },
241
+ "label": {
242
+ "type": "object",
243
+ "propertyNames": {
244
+ "type": "string"
245
+ },
246
+ "additionalProperties": {
247
+ "type": "string"
248
+ },
249
+ "description": "A label per locale (BCP 47 → text)"
250
+ },
251
+ "plural": {
252
+ "type": "object",
253
+ "propertyNames": {
254
+ "type": "string"
255
+ },
256
+ "additionalProperties": {
257
+ "type": "string"
258
+ },
259
+ "description": "A label per locale (BCP 47 → text)"
260
+ },
261
+ "description": {
262
+ "type": "object",
263
+ "propertyNames": {
264
+ "type": "string"
265
+ },
266
+ "additionalProperties": {
267
+ "type": "string"
268
+ },
269
+ "description": "A label per locale (BCP 47 → text)"
270
+ },
271
+ "icon": {
272
+ "type": "string"
273
+ },
274
+ "kind": {
275
+ "description": "What the entity is (spec §3.1): a kind, or one per record by an enum field",
276
+ "anyOf": [
277
+ {
278
+ "type": "string"
279
+ },
280
+ {
281
+ "type": "object",
282
+ "properties": {
283
+ "by": {
284
+ "type": "string",
285
+ "description": "A required enum field"
286
+ },
287
+ "map": {
288
+ "type": "object",
289
+ "propertyNames": {
290
+ "type": "string"
291
+ },
292
+ "additionalProperties": {
293
+ "type": "string"
294
+ },
295
+ "description": "A kind for each of its values"
296
+ }
297
+ },
298
+ "required": [
299
+ "by",
300
+ "map"
301
+ ],
302
+ "additionalProperties": false
303
+ }
304
+ ]
305
+ },
306
+ "permission": {
307
+ "type": "string"
308
+ },
309
+ "schema": {
310
+ "type": "object",
311
+ "propertyNames": {
312
+ "type": "string"
313
+ },
314
+ "additionalProperties": {},
315
+ "description": "A JSON Schema (draft 2020-12)"
316
+ },
317
+ "fields": {
318
+ "type": "array",
319
+ "items": {
320
+ "type": "object",
321
+ "properties": {
322
+ "name": {
323
+ "type": "string"
324
+ },
325
+ "type": {
326
+ "type": "string",
327
+ "enum": [
328
+ "string",
329
+ "number",
330
+ "integer",
331
+ "boolean",
332
+ "array",
333
+ "object"
334
+ ]
335
+ },
336
+ "required": {
337
+ "type": "boolean"
338
+ },
339
+ "enum": {
340
+ "type": "array",
341
+ "items": {
342
+ "type": "string"
343
+ }
344
+ },
345
+ "role": {
346
+ "type": "string",
347
+ "enum": [
348
+ "title",
349
+ "subtitle",
350
+ "status",
351
+ "amount",
352
+ "date",
353
+ "person"
354
+ ]
355
+ },
356
+ "label": {
357
+ "type": "object",
358
+ "propertyNames": {
359
+ "type": "string"
360
+ },
361
+ "additionalProperties": {
362
+ "type": "string"
363
+ },
364
+ "description": "A label per locale (BCP 47 → text)"
365
+ },
366
+ "as": {
367
+ "description": "The property of the entity's kind this field holds (spec §3.1)",
368
+ "type": "string"
369
+ },
370
+ "ref": {
371
+ "anyOf": [
372
+ {
373
+ "type": "string",
374
+ "description": "An entity of this app: the field holds one of its record ids"
375
+ },
376
+ {
377
+ "type": "object",
378
+ "properties": {
379
+ "kind": {
380
+ "type": "string"
381
+ }
382
+ },
383
+ "required": [
384
+ "kind"
385
+ ],
386
+ "additionalProperties": false,
387
+ "description": "A kind: the field holds the URI of a record of that kind, in any app (spec §3.2)"
388
+ }
389
+ ]
390
+ },
391
+ "permission": {
392
+ "description": "Only callers with this permission see the field",
393
+ "type": "string"
394
+ },
395
+ "filter": {
396
+ "type": "boolean"
397
+ },
398
+ "sort": {
399
+ "type": "boolean"
400
+ },
401
+ "search": {
402
+ "type": "boolean"
403
+ },
404
+ "labels": {
405
+ "type": "object",
406
+ "propertyNames": {
407
+ "type": "string"
408
+ },
409
+ "additionalProperties": {
410
+ "type": "object",
411
+ "propertyNames": {
412
+ "type": "string"
413
+ },
414
+ "additionalProperties": {
415
+ "type": "string"
416
+ },
417
+ "description": "A label per locale (BCP 47 → text)"
418
+ }
419
+ },
420
+ "tones": {
421
+ "type": "object",
422
+ "propertyNames": {
423
+ "type": "string"
424
+ },
425
+ "additionalProperties": {
426
+ "type": "string",
427
+ "enum": [
428
+ "neutral",
429
+ "info",
430
+ "success",
431
+ "warning",
432
+ "danger"
433
+ ]
434
+ }
435
+ },
436
+ "currency": {
437
+ "type": "string"
438
+ },
439
+ "untrusted": {
440
+ "description": "Text written by outsiders: data, never instructions",
441
+ "type": "boolean"
442
+ }
443
+ },
444
+ "required": [
445
+ "name",
446
+ "type",
447
+ "required",
448
+ "label"
449
+ ],
450
+ "additionalProperties": false
451
+ }
452
+ },
453
+ "tools": {
454
+ "type": "object",
455
+ "properties": {
456
+ "list": {
457
+ "type": "object",
458
+ "properties": {
459
+ "name": {
460
+ "type": "string",
461
+ "description": "The MCP tool"
462
+ },
463
+ "plain": {
464
+ "type": "boolean",
465
+ "description": "Listed to plain MCP clients"
466
+ }
467
+ },
468
+ "required": [
469
+ "name",
470
+ "plain"
471
+ ],
472
+ "additionalProperties": false
473
+ },
474
+ "get": {
475
+ "type": "object",
476
+ "properties": {
477
+ "name": {
478
+ "type": "string",
479
+ "description": "The MCP tool"
480
+ },
481
+ "plain": {
482
+ "type": "boolean",
483
+ "description": "Listed to plain MCP clients"
484
+ }
485
+ },
486
+ "required": [
487
+ "name",
488
+ "plain"
489
+ ],
490
+ "additionalProperties": false
491
+ }
492
+ },
493
+ "required": [
494
+ "list",
495
+ "get"
496
+ ],
497
+ "additionalProperties": false
498
+ },
499
+ "searchable": {
500
+ "type": "boolean"
501
+ },
502
+ "visibility": {
503
+ "description": "App-only: hidden from every model (its tools carry MCP Apps `_meta.ui.visibility: [\"app\"]`); views and the host's own UI still call it. Absent: models and apps",
504
+ "type": "string",
505
+ "const": "app"
506
+ }
507
+ },
508
+ "required": [
509
+ "name",
510
+ "label",
511
+ "plural",
512
+ "schema",
513
+ "fields",
514
+ "tools",
515
+ "searchable"
516
+ ],
517
+ "additionalProperties": false
518
+ }
519
+ },
520
+ "actions": {
521
+ "type": "array",
522
+ "items": {
523
+ "type": "object",
524
+ "properties": {
525
+ "name": {
526
+ "type": "string",
527
+ "pattern": "^[a-z][a-z0-9_]{0,39}$"
528
+ },
529
+ "entity": {
530
+ "description": "Set: the action works on one record; its tool takes `id`",
531
+ "type": "string"
532
+ },
533
+ "title": {
534
+ "type": "object",
535
+ "propertyNames": {
536
+ "type": "string"
537
+ },
538
+ "additionalProperties": {
539
+ "type": "string"
540
+ },
541
+ "description": "A label per locale (BCP 47 → text)"
542
+ },
543
+ "description": {
544
+ "type": "object",
545
+ "propertyNames": {
546
+ "type": "string"
547
+ },
548
+ "additionalProperties": {
549
+ "type": "string"
550
+ },
551
+ "description": "A label per locale (BCP 47 → text)"
552
+ },
553
+ "icon": {
554
+ "type": "string"
555
+ },
556
+ "input": {
557
+ "type": "object",
558
+ "propertyNames": {
559
+ "type": "string"
560
+ },
561
+ "additionalProperties": {},
562
+ "description": "A JSON Schema (draft 2020-12)"
563
+ },
564
+ "readOnly": {
565
+ "type": "boolean"
566
+ },
567
+ "confirm": {
568
+ "type": "string",
569
+ "enum": [
570
+ "always",
571
+ "optional",
572
+ "never"
573
+ ]
574
+ },
575
+ "permission": {
576
+ "type": "string"
577
+ },
578
+ "tool": {
579
+ "type": "object",
580
+ "properties": {
581
+ "name": {
582
+ "type": "string",
583
+ "description": "The MCP tool"
584
+ },
585
+ "plain": {
586
+ "type": "boolean",
587
+ "description": "Listed to plain MCP clients"
588
+ }
589
+ },
590
+ "required": [
591
+ "name",
592
+ "plain"
593
+ ],
594
+ "additionalProperties": false
595
+ },
596
+ "visibility": {
597
+ "description": "App-only: hidden from every model (its tools carry MCP Apps `_meta.ui.visibility: [\"app\"]`); views and the host's own UI still call it. Absent: models and apps",
598
+ "type": "string",
599
+ "const": "app"
600
+ },
601
+ "targets": {
602
+ "maxItems": 4,
603
+ "type": "array",
604
+ "items": {
605
+ "type": "object",
606
+ "properties": {
607
+ "target": {
608
+ "type": "string",
609
+ "pattern": "^(mail\\.message|record:[a-z][a-z0-9-]*(\\.[a-z][a-z0-9-]*)*)$",
610
+ "description": "What the action is offered on: `mail.message`, or `record:<kind>` (a published kind or a namespaced one)"
611
+ },
612
+ "needs": {
613
+ "type": "array",
614
+ "items": {
615
+ "type": "string"
616
+ },
617
+ "description": "The target's fields the action may receive (only these, ever); `uri` and, for records, `title` are always available"
618
+ },
619
+ "input": {
620
+ "description": "A template of the action's input: string values may hold `{field}` / `{field.sub}` placeholders naming `uri`, `title` or a needed field",
621
+ "type": "object",
622
+ "propertyNames": {
623
+ "type": "string"
624
+ },
625
+ "additionalProperties": {}
626
+ },
627
+ "label": {
628
+ "description": "The item's words (default the action's title), at most 40 characters per locale",
629
+ "type": "object",
630
+ "propertyNames": {
631
+ "type": "string"
632
+ },
633
+ "additionalProperties": {
634
+ "type": "string"
635
+ }
636
+ }
637
+ },
638
+ "required": [
639
+ "target",
640
+ "needs"
641
+ ],
642
+ "additionalProperties": false,
643
+ "description": "Where a host offers a global action on something of another app"
644
+ }
645
+ },
646
+ "later": {
647
+ "description": "«Approve now, act later»: the confirmed call is stored and runs at `at`, within `window` minutes",
648
+ "type": "object",
649
+ "properties": {
650
+ "at": {
651
+ "type": "string",
652
+ "description": "A required date-time input property: when the action runs"
653
+ },
654
+ "window": {
655
+ "type": "integer",
656
+ "minimum": 10,
657
+ "maximum": 10080,
658
+ "description": "Minutes after `at` the run may still start"
659
+ }
660
+ },
661
+ "required": [
662
+ "at",
663
+ "window"
664
+ ],
665
+ "additionalProperties": false
666
+ }
667
+ },
668
+ "required": [
669
+ "name",
670
+ "title",
671
+ "input",
672
+ "readOnly",
673
+ "confirm",
674
+ "tool"
675
+ ],
676
+ "additionalProperties": false
677
+ }
678
+ },
679
+ "pages": {
680
+ "type": "array",
681
+ "items": {
682
+ "type": "object",
683
+ "properties": {
684
+ "name": {
685
+ "type": "string",
686
+ "pattern": "^[a-z][a-z0-9_]{0,39}$"
687
+ },
688
+ "kind": {
689
+ "type": "string",
690
+ "enum": [
691
+ "list",
692
+ "record",
693
+ "dashboard",
694
+ "custom"
695
+ ]
696
+ },
697
+ "title": {
698
+ "type": "object",
699
+ "propertyNames": {
700
+ "type": "string"
701
+ },
702
+ "additionalProperties": {
703
+ "type": "string"
704
+ },
705
+ "description": "A label per locale (BCP 47 → text)"
706
+ },
707
+ "icon": {
708
+ "type": "string"
709
+ },
710
+ "permission": {
711
+ "type": "string"
712
+ },
713
+ "params": {
714
+ "type": "object",
715
+ "propertyNames": {
716
+ "type": "string"
717
+ },
718
+ "additionalProperties": {},
719
+ "description": "A JSON Schema (draft 2020-12)"
720
+ },
721
+ "entity": {
722
+ "type": "string"
723
+ },
724
+ "columns": {
725
+ "type": "array",
726
+ "items": {
727
+ "type": "string"
728
+ }
729
+ },
730
+ "sections": {
731
+ "type": "array",
732
+ "items": {
733
+ "type": "object",
734
+ "properties": {
735
+ "title": {
736
+ "type": "object",
737
+ "propertyNames": {
738
+ "type": "string"
739
+ },
740
+ "additionalProperties": {
741
+ "type": "string"
742
+ },
743
+ "description": "A label per locale (BCP 47 → text)"
744
+ },
745
+ "fields": {
746
+ "type": "array",
747
+ "items": {
748
+ "type": "string"
749
+ }
750
+ }
751
+ },
752
+ "required": [
753
+ "title",
754
+ "fields"
755
+ ],
756
+ "additionalProperties": false
757
+ }
758
+ },
759
+ "tool": {
760
+ "type": "object",
761
+ "properties": {
762
+ "name": {
763
+ "type": "string",
764
+ "description": "The MCP tool"
765
+ },
766
+ "plain": {
767
+ "type": "boolean",
768
+ "description": "Listed to plain MCP clients"
769
+ }
770
+ },
771
+ "required": [
772
+ "name",
773
+ "plain"
774
+ ],
775
+ "additionalProperties": false,
776
+ "description": "What opens the page with its params (record pages: the entity's get tool)"
777
+ },
778
+ "view": {
779
+ "description": "The ui:// view that draws it when the host doesn't draw it natively (dashboard, custom, or an override)",
780
+ "type": "string"
781
+ },
782
+ "url": {
783
+ "description": "custom: the developer's own site, shown in an isolated frame",
784
+ "type": "string"
785
+ },
786
+ "derived": {
787
+ "type": "boolean"
788
+ },
789
+ "actions": {
790
+ "description": "Global actions offered on the page, in order: the first is the page's primary. Page params prefill the inputs of the same name",
791
+ "maxItems": 8,
792
+ "type": "array",
793
+ "items": {
794
+ "type": "string"
795
+ }
796
+ },
797
+ "badge": {
798
+ "description": "A `stat` fragment type without required params: its data.value is the page's count in the navigation",
799
+ "type": "string"
800
+ }
801
+ },
802
+ "required": [
803
+ "name",
804
+ "kind",
805
+ "title",
806
+ "params",
807
+ "tool"
808
+ ],
809
+ "additionalProperties": false
810
+ }
811
+ },
812
+ "fragments": {
813
+ "type": "array",
814
+ "items": {
815
+ "type": "object",
816
+ "properties": {
817
+ "type": {
818
+ "type": "string",
819
+ "pattern": "^[a-z][a-z0-9_]{0,39}$"
820
+ },
821
+ "title": {
822
+ "type": "object",
823
+ "propertyNames": {
824
+ "type": "string"
825
+ },
826
+ "additionalProperties": {
827
+ "type": "string"
828
+ },
829
+ "description": "A label per locale (BCP 47 → text)"
830
+ },
831
+ "description": {
832
+ "type": "object",
833
+ "propertyNames": {
834
+ "type": "string"
835
+ },
836
+ "additionalProperties": {
837
+ "type": "string"
838
+ },
839
+ "description": "A label per locale (BCP 47 → text)"
840
+ },
841
+ "icon": {
842
+ "type": "string"
843
+ },
844
+ "entity": {
845
+ "description": "Set: the entity's record card (params { id })",
846
+ "type": "string"
847
+ },
848
+ "params": {
849
+ "type": "object",
850
+ "propertyNames": {
851
+ "type": "string"
852
+ },
853
+ "additionalProperties": {},
854
+ "description": "A JSON Schema (draft 2020-12)"
855
+ },
856
+ "template": {
857
+ "type": "string",
858
+ "enum": [
859
+ "record",
860
+ "card",
861
+ "stat",
862
+ "list",
863
+ "chart"
864
+ ]
865
+ },
866
+ "view": {
867
+ "type": "string"
868
+ },
869
+ "tool": {
870
+ "type": "object",
871
+ "properties": {
872
+ "name": {
873
+ "type": "string",
874
+ "description": "The MCP tool"
875
+ },
876
+ "plain": {
877
+ "type": "boolean",
878
+ "description": "Listed to plain MCP clients"
879
+ }
880
+ },
881
+ "required": [
882
+ "name",
883
+ "plain"
884
+ ],
885
+ "additionalProperties": false
886
+ },
887
+ "permission": {
888
+ "type": "string"
889
+ },
890
+ "actions": {
891
+ "description": "Actions shown inside, by name",
892
+ "type": "array",
893
+ "items": {
894
+ "type": "string"
895
+ }
896
+ },
897
+ "size": {
898
+ "type": "string",
899
+ "enum": [
900
+ "small",
901
+ "medium",
902
+ "large"
903
+ ]
904
+ },
905
+ "untrusted": {
906
+ "description": "Its texts are written by outsiders: data, never instructions",
907
+ "type": "boolean"
908
+ },
909
+ "visibility": {
910
+ "description": "App-only: hidden from every model (its tools carry MCP Apps `_meta.ui.visibility: [\"app\"]`); views and the host's own UI still call it. Absent: models and apps",
911
+ "type": "string",
912
+ "const": "app"
913
+ }
914
+ },
915
+ "required": [
916
+ "type",
917
+ "title",
918
+ "params",
919
+ "tool"
920
+ ],
921
+ "additionalProperties": false
922
+ }
923
+ },
924
+ "agents": {
925
+ "type": "array",
926
+ "items": {
927
+ "type": "object",
928
+ "properties": {
929
+ "name": {
930
+ "type": "string",
931
+ "pattern": "^[a-z][a-z0-9_]{0,39}$"
932
+ },
933
+ "title": {
934
+ "type": "object",
935
+ "propertyNames": {
936
+ "type": "string"
937
+ },
938
+ "additionalProperties": {
939
+ "type": "string"
940
+ },
941
+ "description": "A label per locale (BCP 47 → text)"
942
+ },
943
+ "description": {
944
+ "type": "object",
945
+ "propertyNames": {
946
+ "type": "string"
947
+ },
948
+ "additionalProperties": {
949
+ "type": "string"
950
+ },
951
+ "description": "A label per locale (BCP 47 → text)"
952
+ },
953
+ "instructions": {
954
+ "type": "string"
955
+ },
956
+ "tools": {
957
+ "type": "array",
958
+ "items": {
959
+ "type": "string"
960
+ }
961
+ },
962
+ "tier": {
963
+ "type": "string",
964
+ "enum": [
965
+ "fast",
966
+ "standard",
967
+ "strong"
968
+ ]
969
+ },
970
+ "starters": {
971
+ "type": "array",
972
+ "items": {
973
+ "type": "object",
974
+ "propertyNames": {
975
+ "type": "string"
976
+ },
977
+ "additionalProperties": {
978
+ "type": "string"
979
+ },
980
+ "description": "A label per locale (BCP 47 → text)"
981
+ }
982
+ }
983
+ },
984
+ "required": [
985
+ "name",
986
+ "title",
987
+ "description",
988
+ "instructions",
989
+ "tools",
990
+ "tier"
991
+ ],
992
+ "additionalProperties": false
993
+ }
994
+ },
995
+ "permissions": {
996
+ "type": "array",
997
+ "items": {
998
+ "type": "object",
999
+ "properties": {
1000
+ "id": {
1001
+ "type": "string"
1002
+ },
1003
+ "label": {
1004
+ "type": "object",
1005
+ "propertyNames": {
1006
+ "type": "string"
1007
+ },
1008
+ "additionalProperties": {
1009
+ "type": "string"
1010
+ },
1011
+ "description": "A label per locale (BCP 47 → text)"
1012
+ },
1013
+ "description": {
1014
+ "type": "object",
1015
+ "propertyNames": {
1016
+ "type": "string"
1017
+ },
1018
+ "additionalProperties": {
1019
+ "type": "string"
1020
+ },
1021
+ "description": "A label per locale (BCP 47 → text)"
1022
+ },
1023
+ "default": {
1024
+ "type": "boolean"
1025
+ }
1026
+ },
1027
+ "required": [
1028
+ "id",
1029
+ "label",
1030
+ "default"
1031
+ ],
1032
+ "additionalProperties": false
1033
+ }
1034
+ },
1035
+ "settings": {
1036
+ "type": "array",
1037
+ "items": {
1038
+ "type": "object",
1039
+ "properties": {
1040
+ "id": {
1041
+ "type": "string",
1042
+ "pattern": "^[a-z][a-z0-9_]{1,39}$"
1043
+ },
1044
+ "label": {
1045
+ "type": "object",
1046
+ "propertyNames": {
1047
+ "type": "string"
1048
+ },
1049
+ "additionalProperties": {
1050
+ "type": "string"
1051
+ },
1052
+ "description": "A label per locale (BCP 47 → text)"
1053
+ },
1054
+ "description": {
1055
+ "type": "object",
1056
+ "propertyNames": {
1057
+ "type": "string"
1058
+ },
1059
+ "additionalProperties": {
1060
+ "type": "string"
1061
+ },
1062
+ "description": "A label per locale (BCP 47 → text)"
1063
+ },
1064
+ "type": {
1065
+ "type": "string",
1066
+ "enum": [
1067
+ "text",
1068
+ "number",
1069
+ "boolean"
1070
+ ]
1071
+ },
1072
+ "required": {
1073
+ "type": "boolean"
1074
+ },
1075
+ "default": {
1076
+ "type": [
1077
+ "string",
1078
+ "number",
1079
+ "boolean"
1080
+ ]
1081
+ }
1082
+ },
1083
+ "required": [
1084
+ "id",
1085
+ "label",
1086
+ "type",
1087
+ "required"
1088
+ ],
1089
+ "additionalProperties": false
1090
+ }
1091
+ },
1092
+ "nav": {
1093
+ "type": "array",
1094
+ "items": {
1095
+ "type": "object",
1096
+ "properties": {
1097
+ "section": {
1098
+ "type": "object",
1099
+ "propertyNames": {
1100
+ "type": "string"
1101
+ },
1102
+ "additionalProperties": {
1103
+ "type": "string"
1104
+ },
1105
+ "description": "A label per locale (BCP 47 → text)"
1106
+ },
1107
+ "pages": {
1108
+ "minItems": 1,
1109
+ "type": "array",
1110
+ "items": {
1111
+ "type": "string"
1112
+ }
1113
+ }
1114
+ },
1115
+ "required": [
1116
+ "pages"
1117
+ ],
1118
+ "additionalProperties": false
1119
+ },
1120
+ "description": "The app's navigation: sections of pages (no record pages, each page at most once). Absent: every non-record page, ungrouped, in declaration order"
1121
+ },
1122
+ "schedules": {
1123
+ "description": "Actions a workspace host runs as the installation, with no person; the SDK adds `clegra_later` for later runs",
1124
+ "maxItems": 11,
1125
+ "type": "array",
1126
+ "items": {
1127
+ "type": "object",
1128
+ "properties": {
1129
+ "name": {
1130
+ "type": "string",
1131
+ "pattern": "^[a-z][a-z0-9_]{0,39}$"
1132
+ },
1133
+ "action": {
1134
+ "description": "The global action run (absent on the SDK's own `clegra_later`)",
1135
+ "type": "string"
1136
+ },
1137
+ "tool": {
1138
+ "type": "string",
1139
+ "description": "The tool the host calls as the installation, with `_meta.clegra.schedule` = name"
1140
+ },
1141
+ "every": {
1142
+ "type": "integer",
1143
+ "minimum": 5,
1144
+ "maximum": 1440,
1145
+ "description": "Minutes between runs, per installation"
1146
+ },
1147
+ "maxSeconds": {
1148
+ "type": "integer",
1149
+ "minimum": 1,
1150
+ "maximum": 300,
1151
+ "description": "How long a run may take"
1152
+ }
1153
+ },
1154
+ "required": [
1155
+ "name",
1156
+ "tool",
1157
+ "every",
1158
+ "maxSeconds"
1159
+ ],
1160
+ "additionalProperties": false
1161
+ }
1162
+ },
1163
+ "notifications": {
1164
+ "description": "The notification types the app sends; without them its notifications are untyped",
1165
+ "type": "array",
1166
+ "items": {
1167
+ "type": "object",
1168
+ "properties": {
1169
+ "type": {
1170
+ "type": "string",
1171
+ "pattern": "^[a-z][a-z0-9_]{0,39}$"
1172
+ },
1173
+ "label": {
1174
+ "type": "object",
1175
+ "propertyNames": {
1176
+ "type": "string"
1177
+ },
1178
+ "additionalProperties": {
1179
+ "type": "string"
1180
+ },
1181
+ "description": "A label per locale (BCP 47 → text)"
1182
+ },
1183
+ "description": {
1184
+ "type": "object",
1185
+ "propertyNames": {
1186
+ "type": "string"
1187
+ },
1188
+ "additionalProperties": {
1189
+ "type": "string"
1190
+ },
1191
+ "description": "A label per locale (BCP 47 → text)"
1192
+ },
1193
+ "default": {
1194
+ "type": "boolean",
1195
+ "description": "false: off until the person turns it on"
1196
+ },
1197
+ "permission": {
1198
+ "description": "Only holders of this permission receive it",
1199
+ "type": "string"
1200
+ }
1201
+ },
1202
+ "required": [
1203
+ "type",
1204
+ "label",
1205
+ "default"
1206
+ ],
1207
+ "additionalProperties": false
1208
+ }
1209
+ },
1210
+ "lifecycle": {
1211
+ "type": "object",
1212
+ "properties": {
1213
+ "installation": {
1214
+ "type": "string",
1215
+ "const": "clegra_installation"
1216
+ },
1217
+ "export": {
1218
+ "type": "string",
1219
+ "const": "clegra_export"
1220
+ },
1221
+ "delete": {
1222
+ "type": "string",
1223
+ "const": "clegra_delete"
1224
+ }
1225
+ },
1226
+ "additionalProperties": false,
1227
+ "description": "The app-only tools a workspace host calls as the installation: told of enable/disable/uninstall, export the tenant's data, delete it"
1228
+ }
1229
+ },
1230
+ "required": [
1231
+ "specVersion",
1232
+ "name",
1233
+ "title",
1234
+ "version",
1235
+ "locale",
1236
+ "mcp",
1237
+ "auth",
1238
+ "view",
1239
+ "resolveTool",
1240
+ "entities",
1241
+ "actions",
1242
+ "pages",
1243
+ "fragments",
1244
+ "agents",
1245
+ "permissions",
1246
+ "settings"
1247
+ ],
1248
+ "additionalProperties": false
1249
+ }