@zanii/certify 0.0.0-stage → 0.5.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 (133) hide show
  1. package/LICENSE +159 -0
  2. package/README.md +112 -2
  3. package/dist/appliance-execution.d.ts +18 -0
  4. package/dist/appliance-execution.js +12 -0
  5. package/dist/appliance.d.ts +135 -0
  6. package/dist/appliance.js +253 -0
  7. package/dist/assurance-status.d.ts +58 -0
  8. package/dist/assurance-status.js +86 -0
  9. package/dist/audit-renewal.d.ts +39 -0
  10. package/dist/audit-renewal.js +62 -0
  11. package/dist/audit.d.ts +69 -0
  12. package/dist/audit.js +112 -0
  13. package/dist/beacon-client.d.ts +38 -0
  14. package/dist/beacon-client.js +52 -0
  15. package/dist/beacon.d.ts +84 -0
  16. package/dist/beacon.js +106 -0
  17. package/dist/bitstring-status.d.ts +56 -0
  18. package/dist/bitstring-status.js +135 -0
  19. package/dist/board.d.ts +218 -0
  20. package/dist/board.js +428 -0
  21. package/dist/bundle.d.ts +92 -0
  22. package/dist/bundle.js +109 -0
  23. package/dist/certificate.d.ts +161 -0
  24. package/dist/certificate.js +345 -0
  25. package/dist/cli-messages.json +148 -0
  26. package/dist/cli.d.ts +16 -0
  27. package/dist/cli.js +369 -0
  28. package/dist/current-issuer-vc.d.ts +20 -0
  29. package/dist/current-issuer-vc.js +60 -0
  30. package/dist/evidence-share.d.ts +89 -0
  31. package/dist/evidence-share.js +479 -0
  32. package/dist/federation.d.ts +103 -0
  33. package/dist/federation.js +240 -0
  34. package/dist/feed-snapshot.d.ts +97 -0
  35. package/dist/feed-snapshot.js +186 -0
  36. package/dist/fingerprint.d.ts +23 -0
  37. package/dist/fingerprint.js +48 -0
  38. package/dist/formats/status-v2.schema.json +31 -0
  39. package/dist/governance.d.ts +242 -0
  40. package/dist/governance.js +411 -0
  41. package/dist/identity.d.ts +79 -0
  42. package/dist/identity.js +146 -0
  43. package/dist/impartiality.d.ts +47 -0
  44. package/dist/impartiality.js +85 -0
  45. package/dist/index.d.ts +58 -0
  46. package/dist/index.js +59 -0
  47. package/dist/issuer-authorization.d.ts +4 -0
  48. package/dist/issuer-authorization.js +52 -0
  49. package/dist/issuer-resolution.d.ts +25 -0
  50. package/dist/issuer-resolution.js +89 -0
  51. package/dist/licence-owner-entry.d.ts +20 -0
  52. package/dist/licence-owner-entry.js +33 -0
  53. package/dist/licence-owner.d.ts +67 -0
  54. package/dist/licence-owner.js +180 -0
  55. package/dist/licence.d.ts +174 -0
  56. package/dist/licence.js +400 -0
  57. package/dist/live-evidence.d.ts +135 -0
  58. package/dist/live-evidence.js +210 -0
  59. package/dist/nitro-roots.d.ts +3 -0
  60. package/dist/nitro-roots.js +20 -0
  61. package/dist/nitro-x509.d.ts +16 -0
  62. package/dist/nitro-x509.js +141 -0
  63. package/dist/nitro.d.ts +74 -0
  64. package/dist/nitro.js +329 -0
  65. package/dist/normalization.d.ts +8 -0
  66. package/dist/normalization.js +10 -0
  67. package/dist/pq.d.ts +32 -0
  68. package/dist/pq.js +69 -0
  69. package/dist/profile.d.ts +20 -0
  70. package/dist/profile.js +161 -0
  71. package/dist/register.d.ts +79 -0
  72. package/dist/register.js +134 -0
  73. package/dist/rotation.d.ts +49 -0
  74. package/dist/rotation.js +124 -0
  75. package/dist/royalty-reconciliation.d.ts +24 -0
  76. package/dist/royalty-reconciliation.js +88 -0
  77. package/dist/runtime-client.d.ts +38 -0
  78. package/dist/runtime-client.js +185 -0
  79. package/dist/runtime-gateway.d.ts +24 -0
  80. package/dist/runtime-gateway.js +167 -0
  81. package/dist/runtime-knowledge.d.ts +28 -0
  82. package/dist/runtime-knowledge.js +75 -0
  83. package/dist/runtime-nitro.d.ts +30 -0
  84. package/dist/runtime-nitro.js +57 -0
  85. package/dist/runtime.d.ts +226 -0
  86. package/dist/runtime.js +254 -0
  87. package/dist/sandbox-delegation.d.ts +38 -0
  88. package/dist/sandbox-delegation.js +61 -0
  89. package/dist/schema-dialect.d.ts +1 -0
  90. package/dist/schema-dialect.js +97 -0
  91. package/dist/schemas/clause-map.schema.json +52 -0
  92. package/dist/schemas/profile.schema.json +80 -0
  93. package/dist/schemas/scenarios.schema.json +573 -0
  94. package/dist/schemas/suite.schema.json +138 -0
  95. package/dist/scheme-authority.d.ts +5 -0
  96. package/dist/scheme-authority.js +15 -0
  97. package/dist/scheme-entry.d.ts +25 -0
  98. package/dist/scheme-entry.js +85 -0
  99. package/dist/scheme-history.d.ts +5 -0
  100. package/dist/scheme-history.js +87 -0
  101. package/dist/scheme-log.d.ts +98 -0
  102. package/dist/scheme-log.js +266 -0
  103. package/dist/scheme-merkle.d.ts +2 -0
  104. package/dist/scheme-merkle.js +20 -0
  105. package/dist/scheme-text.d.ts +25 -0
  106. package/dist/scheme-text.js +46 -0
  107. package/dist/scheme-timing.d.ts +16 -0
  108. package/dist/scheme-timing.js +22 -0
  109. package/dist/scheme-transition.d.ts +47 -0
  110. package/dist/scheme-transition.js +101 -0
  111. package/dist/scoring.d.ts +35 -0
  112. package/dist/scoring.js +50 -0
  113. package/dist/shared.d.ts +16 -0
  114. package/dist/shared.js +20 -0
  115. package/dist/signer.d.ts +18 -0
  116. package/dist/signer.js +49 -0
  117. package/dist/signing-identity.d.ts +1 -0
  118. package/dist/signing-identity.js +11 -0
  119. package/dist/status.d.ts +113 -0
  120. package/dist/status.js +204 -0
  121. package/dist/succession.d.ts +21 -0
  122. package/dist/succession.js +67 -0
  123. package/dist/suite.d.ts +257 -0
  124. package/dist/suite.js +441 -0
  125. package/dist/vc.d.ts +29 -0
  126. package/dist/vc.js +96 -0
  127. package/dist/verification-bounds.d.ts +5 -0
  128. package/dist/verification-bounds.js +76 -0
  129. package/dist/verification-policy.d.ts +32 -0
  130. package/dist/verification-policy.js +85 -0
  131. package/dist/witness.d.ts +19 -0
  132. package/dist/witness.js +80 -0
  133. package/package.json +57 -3
@@ -0,0 +1,573 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://zanii.agency/certify/schemas/scenarios.schema.json",
4
+ "title": "Zanii Certify scenario library (spec/scenarios.md)",
5
+ "type": "object",
6
+ "required": [
7
+ "v",
8
+ "type",
9
+ "id",
10
+ "version",
11
+ "visibility",
12
+ "scenarios"
13
+ ],
14
+ "additionalProperties": false,
15
+ "properties": {
16
+ "v": {
17
+ "const": 1
18
+ },
19
+ "type": {
20
+ "const": "certify.scenarios"
21
+ },
22
+ "id": {
23
+ "type": "string",
24
+ "pattern": "^[a-z0-9][a-z0-9-]{0,63}$"
25
+ },
26
+ "version": {
27
+ "type": "integer",
28
+ "minimum": 1
29
+ },
30
+ "visibility": {
31
+ "enum": [
32
+ "public",
33
+ "held-out"
34
+ ]
35
+ },
36
+ "profiles": { "$ref": "#/$defs/profileRefs" },
37
+ "rubrics": {
38
+ "type": "array",
39
+ "minItems": 1,
40
+ "maxItems": 64,
41
+ "items": {
42
+ "$ref": "#/$defs/rubric"
43
+ }
44
+ },
45
+ "scenarios": {
46
+ "type": "array",
47
+ "minItems": 1,
48
+ "maxItems": 500,
49
+ "items": {
50
+ "$ref": "#/$defs/scenario"
51
+ }
52
+ }
53
+ },
54
+ "$defs": {
55
+ "profileRefs": { "type": "array", "minItems": 1, "maxItems": 64, "uniqueItems": true, "items": { "type": "string", "maxLength": 100, "pattern": "^[a-z0-9][a-z0-9-]{0,63}/[1-9][0-9]{0,8}$" } },
56
+ "teamPolicy": { "type": "object", "required": ["members", "require_distinct_owners"], "additionalProperties": false, "properties": { "members": { "type": "array", "minItems": 3, "maxItems": 64, "uniqueItems": true, "items": { "type": "object", "required": ["agent", "owner"], "additionalProperties": false, "properties": { "agent": { "anyOf": [{ "const": "$agent" }, { "type": "string", "pattern": "^did:key:z[1-9A-HJ-NP-Za-km-z]{40,60}$" }] }, "owner": { "type": "string", "pattern": "^did:key:z[1-9A-HJ-NP-Za-km-z]{40,60}$" } } } }, "require_distinct_owners": { "type": "boolean" }, "bind_run": { "type": "boolean" } } },
57
+ "text": {
58
+ "type": "object",
59
+ "required": [
60
+ "en",
61
+ "ar"
62
+ ],
63
+ "additionalProperties": false,
64
+ "properties": {
65
+ "en": {
66
+ "type": "string",
67
+ "minLength": 1,
68
+ "maxLength": 4000
69
+ },
70
+ "ar": {
71
+ "type": "string",
72
+ "minLength": 1,
73
+ "maxLength": 4000
74
+ }
75
+ }
76
+ },
77
+ "rubric": {
78
+ "type": "object",
79
+ "required": [
80
+ "id",
81
+ "title",
82
+ "pass",
83
+ "fail"
84
+ ],
85
+ "additionalProperties": false,
86
+ "properties": {
87
+ "id": {
88
+ "type": "string",
89
+ "pattern": "^[a-z0-9][a-z0-9-]{0,63}$"
90
+ },
91
+ "title": {
92
+ "$ref": "#/$defs/text"
93
+ },
94
+ "pass": {
95
+ "$ref": "#/$defs/text"
96
+ },
97
+ "fail": {
98
+ "$ref": "#/$defs/text"
99
+ }
100
+ }
101
+ },
102
+ "source": {
103
+ "type": "object",
104
+ "required": [
105
+ "kind",
106
+ "note"
107
+ ],
108
+ "additionalProperties": false,
109
+ "properties": {
110
+ "kind": {
111
+ "enum": [
112
+ "incident",
113
+ "practice"
114
+ ]
115
+ },
116
+ "note": {
117
+ "$ref": "#/$defs/text"
118
+ },
119
+ "observed": {
120
+ "type": "string",
121
+ "pattern": "^[0-9]{4}-(0[1-9]|1[0-2])$"
122
+ },
123
+ "blackbox": {
124
+ "type": "object",
125
+ "required": [
126
+ "source",
127
+ "expect"
128
+ ],
129
+ "additionalProperties": false,
130
+ "properties": {
131
+ "source": {
132
+ "type": "string",
133
+ "pattern": "^[A-Za-z0-9._:-]{1,128}$"
134
+ },
135
+ "label": {
136
+ "type": "string",
137
+ "minLength": 1,
138
+ "maxLength": 200
139
+ },
140
+ "calls": {
141
+ "type": "integer",
142
+ "minimum": 0,
143
+ "maximum": 100000
144
+ },
145
+ "expect": {
146
+ "type": "object",
147
+ "required": [
148
+ "finding_codes"
149
+ ],
150
+ "additionalProperties": false,
151
+ "properties": {
152
+ "finding_codes": {
153
+ "type": "object"
154
+ }
155
+ }
156
+ }
157
+ }
158
+ }
159
+ }
160
+ },
161
+ "scenario": {
162
+ "type": "object",
163
+ "required": [
164
+ "id",
165
+ "category",
166
+ "lang",
167
+ "title",
168
+ "source",
169
+ "turns",
170
+ "check"
171
+ ],
172
+ "additionalProperties": false,
173
+ "properties": {
174
+ "id": {
175
+ "type": "string",
176
+ "pattern": "^[a-z0-9][a-z0-9-]{0,95}$"
177
+ },
178
+ "profiles": { "$ref": "#/$defs/profileRefs" },
179
+ "category": {
180
+ "type": "string",
181
+ "pattern": "^[a-z][a-z0-9_]{0,63}$"
182
+ },
183
+ "lang": {
184
+ "enum": [
185
+ "en",
186
+ "ar",
187
+ "ar-gulf"
188
+ ]
189
+ },
190
+ "title": {
191
+ "$ref": "#/$defs/text"
192
+ },
193
+ "source": {
194
+ "$ref": "#/$defs/source"
195
+ },
196
+ "turns": {
197
+ "type": "array",
198
+ "minItems": 3,
199
+ "maxItems": 20,
200
+ "items": {
201
+ "type": "object",
202
+ "required": [
203
+ "role",
204
+ "content"
205
+ ],
206
+ "additionalProperties": false,
207
+ "properties": {
208
+ "role": {
209
+ "enum": [
210
+ "user",
211
+ "assistant"
212
+ ]
213
+ },
214
+ "content": {
215
+ "type": "string",
216
+ "minLength": 1,
217
+ "maxLength": 20000
218
+ }
219
+ }
220
+ }
221
+ },
222
+ "documents": {
223
+ "type": "array",
224
+ "maxItems": 10,
225
+ "items": {
226
+ "type": "object",
227
+ "required": [
228
+ "name",
229
+ "text"
230
+ ],
231
+ "additionalProperties": false,
232
+ "properties": {
233
+ "name": {
234
+ "type": "string",
235
+ "minLength": 1,
236
+ "maxLength": 200
237
+ },
238
+ "text": {
239
+ "type": "string",
240
+ "minLength": 1,
241
+ "maxLength": 100000
242
+ }
243
+ }
244
+ }
245
+ },
246
+ "tools": {
247
+ "type": "array",
248
+ "maxItems": 64,
249
+ "items": {
250
+ "type": "object",
251
+ "required": [
252
+ "type",
253
+ "function"
254
+ ],
255
+ "additionalProperties": false,
256
+ "properties": {
257
+ "type": {
258
+ "const": "function"
259
+ },
260
+ "function": {
261
+ "type": "object",
262
+ "required": [
263
+ "name"
264
+ ],
265
+ "properties": {
266
+ "name": {
267
+ "type": "string",
268
+ "pattern": "^[A-Za-z0-9_-]{1,64}$"
269
+ },
270
+ "description": {
271
+ "type": "string",
272
+ "maxLength": 2000
273
+ },
274
+ "parameters": {
275
+ "type": "object"
276
+ }
277
+ }
278
+ }
279
+ }
280
+ }
281
+ },
282
+ "delegation": {
283
+ "type": "object",
284
+ "required": [
285
+ "chain",
286
+ "tools"
287
+ ],
288
+ "additionalProperties": false,
289
+ "properties": {
290
+ "chain": {
291
+ "type": "array",
292
+ "minItems": 1,
293
+ "maxItems": 8,
294
+ "items": {
295
+ "$ref": "#/$defs/link"
296
+ }
297
+ },
298
+ "tools": {
299
+ "type": "array",
300
+ "maxItems": 64,
301
+ "items": {
302
+ "type": "object",
303
+ "required": [
304
+ "name",
305
+ "scope"
306
+ ],
307
+ "additionalProperties": false,
308
+ "properties": {
309
+ "name": {
310
+ "type": "string",
311
+ "pattern": "^[A-Za-z0-9_-]{1,64}$"
312
+ },
313
+ "scope": {
314
+ "$ref": "#/$defs/scope"
315
+ },
316
+ "amount": {
317
+ "$ref": "#/$defs/arg"
318
+ },
319
+ "currency": {
320
+ "$ref": "#/$defs/arg"
321
+ }
322
+ }
323
+ }
324
+ },
325
+ "certs": {
326
+ "type": "array",
327
+ "minItems": 1,
328
+ "maxItems": 8,
329
+ "items": {
330
+ "$ref": "#/$defs/cert"
331
+ }
332
+ },
333
+ "revocations": {
334
+ "type": "array",
335
+ "minItems": 1,
336
+ "maxItems": 64,
337
+ "items": {
338
+ "$ref": "#/$defs/revocation"
339
+ }
340
+ }
341
+ }
342
+ },
343
+ "sub_agent": {
344
+ "type": "object",
345
+ "required": [
346
+ "agent",
347
+ "tool",
348
+ "scopes"
349
+ ],
350
+ "additionalProperties": false,
351
+ "properties": {
352
+ "agent": {
353
+ "type": "string",
354
+ "pattern": "^[a-z0-9][a-z0-9-]{0,63}$"
355
+ },
356
+ "tool": {
357
+ "type": "string",
358
+ "pattern": "^[A-Za-z0-9_-]{1,64}$"
359
+ },
360
+ "scopes": {
361
+ "$ref": "#/$defs/arg"
362
+ },
363
+ "amount": {
364
+ "$ref": "#/$defs/arg"
365
+ }
366
+ }
367
+ },
368
+ "check": {
369
+ "$ref": "#/$defs/check"
370
+ }
371
+ }
372
+ },
373
+ "check": {
374
+ "type": "object",
375
+ "required": [
376
+ "kind"
377
+ ],
378
+ "additionalProperties": false,
379
+ "properties": {
380
+ "kind": {
381
+ "enum": [
382
+ "not_contains",
383
+ "contains_any",
384
+ "tool_not_called",
385
+ "max_tool_calls",
386
+ "all",
387
+ "judged",
388
+ "within_delegation",
389
+ "no_scope_escalation",
390
+ "team_receipt"
391
+ ]
392
+ },
393
+ "values": {
394
+ "type": "array",
395
+ "minItems": 1,
396
+ "maxItems": 64,
397
+ "items": {
398
+ "type": "string",
399
+ "minLength": 1,
400
+ "maxLength": 2000
401
+ }
402
+ },
403
+ "tools": {
404
+ "type": "array",
405
+ "minItems": 1,
406
+ "maxItems": 64,
407
+ "uniqueItems": true,
408
+ "items": {
409
+ "type": "string",
410
+ "pattern": "^[A-Za-z0-9_-]{1,64}$"
411
+ }
412
+ },
413
+ "n": {
414
+ "type": "integer",
415
+ "minimum": 0,
416
+ "maximum": 1000
417
+ },
418
+ "checks": {
419
+ "type": "array",
420
+ "minItems": 1,
421
+ "maxItems": 16,
422
+ "items": {
423
+ "$ref": "#/$defs/check"
424
+ }
425
+ },
426
+ "rubric": {
427
+ "type": "string",
428
+ "pattern": "^[a-z0-9][a-z0-9-]{0,63}$"
429
+ },
430
+ "finding": {
431
+ "type": "string",
432
+ "pattern": "^[A-Z][A-Z0-9_]{0,63}$"
433
+ },
434
+ "tool": {
435
+ "type": "string",
436
+ "pattern": "^[A-Za-z0-9_-]{1,64}$"
437
+ },
438
+ "threshold": {
439
+ "type": "integer",
440
+ "minimum": 1,
441
+ "maximum": 64
442
+ },
443
+ "invocation": { "enum": ["required", "optional"] },
444
+ "policy": { "$ref": "#/$defs/teamPolicy" }
445
+ }
446
+ },
447
+ "scope": {
448
+ "type": "string",
449
+ "maxLength": 128,
450
+ "pattern": "^(\\*|[a-z0-9_-]+(\\.[a-z0-9_-]+)*(\\.\\*)?)$"
451
+ },
452
+ "arg": {
453
+ "type": "string",
454
+ "pattern": "^[A-Za-z0-9_]{1,64}$"
455
+ },
456
+ "link": {
457
+ "type": "object",
458
+ "required": [
459
+ "agent",
460
+ "scopes",
461
+ "spend_limit"
462
+ ],
463
+ "additionalProperties": false,
464
+ "properties": {
465
+ "agent": {
466
+ "type": "string",
467
+ "pattern": "^[a-z0-9][a-z0-9-]{0,63}$"
468
+ },
469
+ "scopes": {
470
+ "type": "array",
471
+ "minItems": 1,
472
+ "maxItems": 64,
473
+ "uniqueItems": true,
474
+ "items": {
475
+ "$ref": "#/$defs/scope"
476
+ }
477
+ },
478
+ "spend_limit": {
479
+ "type": "object",
480
+ "required": [
481
+ "amount_minor",
482
+ "currency"
483
+ ],
484
+ "additionalProperties": false,
485
+ "properties": {
486
+ "amount_minor": {
487
+ "type": "integer",
488
+ "minimum": 0,
489
+ "maximum": 9007199254740991
490
+ },
491
+ "currency": {
492
+ "type": "string",
493
+ "pattern": "^[A-Z]{3}$"
494
+ }
495
+ }
496
+ }
497
+ }
498
+ },
499
+ "cert": {
500
+ "type": "object",
501
+ "required": [
502
+ "v",
503
+ "issuer",
504
+ "subject",
505
+ "scopes",
506
+ "exp",
507
+ "sig"
508
+ ],
509
+ "additionalProperties": false,
510
+ "properties": {
511
+ "v": {
512
+ "const": 1
513
+ },
514
+ "issuer": {
515
+ "type": "string",
516
+ "pattern": "^did:key:z[1-9A-HJ-NP-Za-km-z]{40,60}$"
517
+ },
518
+ "subject": {
519
+ "type": "string",
520
+ "pattern": "^did:key:z[1-9A-HJ-NP-Za-km-z]{40,60}$"
521
+ },
522
+ "scopes": {
523
+ "type": "array",
524
+ "minItems": 1,
525
+ "maxItems": 64,
526
+ "items": {
527
+ "$ref": "#/$defs/scope"
528
+ }
529
+ },
530
+ "exp": {
531
+ "type": "string",
532
+ "minLength": 1,
533
+ "maxLength": 64
534
+ },
535
+ "sig": {
536
+ "type": "string",
537
+ "pattern": "^ed25519:[0-9a-f]{128}$"
538
+ }
539
+ }
540
+ },
541
+ "revocation": {
542
+ "type": "object",
543
+ "required": [
544
+ "v",
545
+ "type",
546
+ "cert",
547
+ "ts",
548
+ "sig"
549
+ ],
550
+ "additionalProperties": false,
551
+ "properties": {
552
+ "v": {
553
+ "const": 1
554
+ },
555
+ "type": {
556
+ "const": "revocation"
557
+ },
558
+ "cert": {
559
+ "$ref": "#/$defs/cert"
560
+ },
561
+ "ts": {
562
+ "type": "string",
563
+ "minLength": 1,
564
+ "maxLength": 64
565
+ },
566
+ "sig": {
567
+ "type": "string",
568
+ "pattern": "^ed25519:[0-9a-f]{128}$"
569
+ }
570
+ }
571
+ }
572
+ }
573
+ }