macwarden 1.0.1 → 1.1.1

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 (76) hide show
  1. package/CHANGELOG.md +82 -0
  2. package/README.md +24 -8
  3. package/SECURITY.md +2 -2
  4. package/dist/bin.js +7 -1
  5. package/dist/bounded-file.js +1 -0
  6. package/dist/cancellation.js +1 -1
  7. package/dist/caveat-address.js +1 -1
  8. package/dist/cli.js +1 -1
  9. package/dist/commands/attenuate.js +1 -1
  10. package/dist/commands/bake/allocate.js +1 -1
  11. package/dist/commands/bake/index.js +1 -1
  12. package/dist/commands/bake/out-errors.js +1 -0
  13. package/dist/commands/bake/write-out.js +1 -1
  14. package/dist/commands/handlers.js +1 -1
  15. package/dist/commands/inspect.js +1 -1
  16. package/dist/commands/inventory.js +1 -1
  17. package/dist/commands/recommend.js +1 -1
  18. package/dist/commands/respond.js +1 -1
  19. package/dist/commands/revoke.js +1 -1
  20. package/dist/commands/rotate.js +1 -1
  21. package/dist/commands/scan.js +1 -1
  22. package/dist/commands/verify.js +1 -0
  23. package/dist/commands/watch.js +1 -1
  24. package/dist/credential-recognition.js +1 -1
  25. package/dist/decode/index.js +1 -1
  26. package/dist/decode/recognition.js +1 -1
  27. package/dist/environment.js +1 -1
  28. package/dist/errors.js +1 -1
  29. package/dist/grade/index.js +1 -1
  30. package/dist/grouped-runs.js +1 -1
  31. package/dist/input/index.js +1 -1
  32. package/dist/input/lndconnect.js +1 -1
  33. package/dist/instant.js +1 -0
  34. package/dist/lnd/grpc.js +1 -1
  35. package/dist/lnd/index.js +1 -1
  36. package/dist/lnd/middleware-proto.js +1 -1
  37. package/dist/lnd/tls-identity.js +1 -0
  38. package/dist/online.js +1 -1
  39. package/dist/output/index.js +1 -1
  40. package/dist/output/scan-formats.js +1 -1
  41. package/dist/process-error-context.js +1 -1
  42. package/dist/protected-path.js +1 -1
  43. package/dist/registry/index.js +1 -1
  44. package/dist/registry/process-domain.js +1 -1
  45. package/dist/report/access-review.js +1 -1
  46. package/dist/root-key-id.js +1 -0
  47. package/dist/runtime.js +3401 -947
  48. package/dist/scan/agent-configs.js +1 -1
  49. package/dist/scan/git-history.js +1 -1
  50. package/dist/scan/ignore.js +1 -1
  51. package/dist/scan/index.js +1 -1
  52. package/dist/scan/mcp-context.js +1 -1
  53. package/dist/scan/nwc-match.js +1 -1
  54. package/dist/scan/patterns.js +1 -1
  55. package/dist/scan/redact.js +1 -1
  56. package/dist/secret.js +1 -1
  57. package/dist/version.js +1 -1
  58. package/dist/watch/alert-throttle.js +1 -1
  59. package/dist/watch/alert.js +1 -1
  60. package/dist/watch/canary.js +1 -1
  61. package/dist/watch/output-queue.js +1 -1
  62. package/dist/watch/usage.js +1 -1
  63. package/package.json +2 -2
  64. package/schemas/output/attenuate.schema.json +30 -1
  65. package/schemas/output/bake.schema.json +28 -1
  66. package/schemas/output/inspect.schema.json +9 -2
  67. package/schemas/output/inventory.schema.json +63 -2
  68. package/schemas/output/macwarden.schema.json +329 -0
  69. package/schemas/output/recommend.schema.json +498 -0
  70. package/schemas/output/respond.schema.json +28 -1
  71. package/schemas/output/revoke.schema.json +28 -1
  72. package/schemas/output/rotate.schema.json +28 -1
  73. package/schemas/output/scan.schema.json +10 -3
  74. package/schemas/output/verify.schema.json +579 -0
  75. package/schemas/output/watch-event.schema.json +232 -0
  76. package/schemas/output/watch.schema.json +404 -0
@@ -1 +1 @@
1
- export {api37_agentConfigCandidates as agentConfigCandidates, api37_discoverAgentConfigs as discoverAgentConfigs, api37_defaultAgentConfigEnvironment as defaultAgentConfigEnvironment} from "../runtime.js";
1
+ export {api43_agentConfigCandidates as agentConfigCandidates, api43_discoverAgentConfigs as discoverAgentConfigs, api43_defaultAgentConfigEnvironment as defaultAgentConfigEnvironment} from "../runtime.js";
@@ -1 +1 @@
1
- export {api38_nonLocalPath as nonLocalPath, api38_locateRepository as locateRepository, api38_gitEnvironment as gitEnvironment, api38_assertWorkTree as assertWorkTree, api38_isShallowRepository as isShallowRepository, api38_historyEntries as historyEntries, api38_blobSizes as blobSizes, api38_readBlobs as readBlobs, api38_GitHistoryError as GitHistoryError, api38_MODE_REGULAR as MODE_REGULAR, api38_MODE_SYMLINK as MODE_SYMLINK, api38_MODE_OTHER as MODE_OTHER, api38_GIT_IDLE_TIMEOUT_MS as GIT_IDLE_TIMEOUT_MS, api38_MAX_HISTORY_ENTRIES as MAX_HISTORY_ENTRIES, api38_PINNED_CONFIG as PINNED_CONFIG} from "../runtime.js";
1
+ export {api44_nonLocalPath as nonLocalPath, api44_locateRepository as locateRepository, api44_gitEnvironment as gitEnvironment, api44_assertWorkTree as assertWorkTree, api44_isShallowRepository as isShallowRepository, api44_historyEntries as historyEntries, api44_blobSizes as blobSizes, api44_readBlobs as readBlobs, api44_GitHistoryError as GitHistoryError, api44_MODE_REGULAR as MODE_REGULAR, api44_MODE_SYMLINK as MODE_SYMLINK, api44_MODE_OTHER as MODE_OTHER, api44_GIT_IDLE_TIMEOUT_MS as GIT_IDLE_TIMEOUT_MS, api44_MAX_HISTORY_ENTRIES as MAX_HISTORY_ENTRIES, api44_PINNED_CONFIG as PINNED_CONFIG, api44_PREFLIGHT_LIMITS as PREFLIGHT_LIMITS} from "../runtime.js";
@@ -1 +1 @@
1
- export {api39_parseIgnoreFile as parseIgnoreFile, api39_IgnoreFileError as IgnoreFileError} from "../runtime.js";
1
+ export {api45_parseIgnoreFile as parseIgnoreFile, api45_IgnoreFileError as IgnoreFileError} from "../runtime.js";
@@ -1 +1 @@
1
- export {api40_readBounded as readBounded, api40_scan as scan, api40_IgnoreFileError as IgnoreFileError, api40_GitHistoryError as GitHistoryError, api40_FINDINGS_LIMIT as FINDINGS_LIMIT, api40_ALSO_AT_EXAMPLES as ALSO_AT_EXAMPLES, api40_HISTORY_DEDUP_WORK_LIMIT as HISTORY_DEDUP_WORK_LIMIT, api40_FindingsLimitError as FindingsLimitError, api40_SCAN_CONCURRENCY as SCAN_CONCURRENCY} from "../runtime.js";
1
+ export {api46_scan as scan, api46_IgnoreFileError as IgnoreFileError, api46_GitHistoryError as GitHistoryError, api46_CANDIDATE_LIMIT as CANDIDATE_LIMIT, api46_FINDINGS_LIMIT as FINDINGS_LIMIT, api46_ALSO_AT_EXAMPLES as ALSO_AT_EXAMPLES, api46_HISTORY_DEDUP_WORK_LIMIT as HISTORY_DEDUP_WORK_LIMIT, api46_FindingsLimitError as FindingsLimitError, api46_SCAN_CONCURRENCY as SCAN_CONCURRENCY, api46_readBounded as readBounded, api46_SCAN_OPEN_FLAGS as SCAN_OPEN_FLAGS} from "../runtime.js";
@@ -1 +1 @@
1
- export {api41_mcpServerStringSpans as mcpServerStringSpans, api41_withinSpans as withinSpans} from "../runtime.js";
1
+ export {api47_mcpServerStringSpans as mcpServerStringSpans, api47_withinSpans as withinSpans, api47_MAX_DEPTH as MAX_DEPTH} from "../runtime.js";
@@ -1 +1 @@
1
- export {api42_nwcMatches as nwcMatches} from "../runtime.js";
1
+ export {api48_nwcMatches as nwcMatches, api48_replaceNwc as replaceNwc, api48_nwcUnescaped as nwcUnescaped} from "../runtime.js";
@@ -1 +1 @@
1
- export {api43_macaroonHex as macaroonHex, api43_macaroonBase64 as macaroonBase64, api43_lndconnect as lndconnect, api43_nwc as nwc} from "../runtime.js";
1
+ export {api49_macaroonHex as macaroonHex, api49_macaroonBase64 as macaroonBase64, api49_lndconnect as lndconnect, api49_nwc as nwc} from "../runtime.js";
@@ -1 +1 @@
1
- export {api44_redactDecoded as redactDecoded, api44_redactPath as redactPath, api44_collectNwcSecrets as collectNwcSecrets, api44_knownSecretRedactor as knownSecretRedactor, api44_redactKnownSecrets as redactKnownSecrets} from "../runtime.js";
1
+ export {api50_redactDecoded as redactDecoded, api50_redactPath as redactPath, api50_collectNwcSecrets as collectNwcSecrets, api50_knownSecretRedactor as knownSecretRedactor, api50_redactKnownSecrets as redactKnownSecrets} from "../runtime.js";
package/dist/secret.js CHANGED
@@ -1 +1 @@
1
- export {api45_Secret as Secret} from "./runtime.js";
1
+ export {api51_Secret as Secret} from "./runtime.js";
package/dist/version.js CHANGED
@@ -1 +1 @@
1
- export {api46_macwardenVersion as macwardenVersion} from "./runtime.js";
1
+ export {api52_macwardenVersion as macwardenVersion} from "./runtime.js";
@@ -1 +1 @@
1
- export {api47_createAlertThrottle as createAlertThrottle, api47_createAlertRunner as createAlertRunner, api47_ALERT_WINDOW_MS as ALERT_WINDOW_MS, api47_MAX_TRACKED_CANARIES as MAX_TRACKED_CANARIES} from "../runtime.js";
1
+ export {api53_createAlertThrottle as createAlertThrottle, api53_createAlertRunner as createAlertRunner, api53_ALERT_WINDOW_MS as ALERT_WINDOW_MS, api53_MAX_TRACKED_CANARIES as MAX_TRACKED_CANARIES} from "../runtime.js";
@@ -1 +1 @@
1
- export {api48_reapAlertGroups as reapAlertGroups, api48_runAlertCommand as runAlertCommand, api48_ALERT_TIMEOUT_MS as ALERT_TIMEOUT_MS, api48_ALERT_KILL_MS as ALERT_KILL_MS, api48_ALERT_GRACE_MS as ALERT_GRACE_MS} from "../runtime.js";
1
+ export {api54_reapAlertGroups as reapAlertGroups, api54_alertCleanupDone as alertCleanupDone, api54_runAlertCommand as runAlertCommand, api54_ALERT_TIMEOUT_MS as ALERT_TIMEOUT_MS, api54_ALERT_KILL_MS as ALERT_KILL_MS, api54_ALERT_GRACE_MS as ALERT_GRACE_MS, api54_ALERT_CLEANUP_MS as ALERT_CLEANUP_MS} from "../runtime.js";
@@ -1 +1 @@
1
- export {api49_canaryConfigPath as canaryConfigPath, api49_newCaveatName as newCaveatName, api49_newCondition as newCondition, api49_canaryCondition as canaryCondition, api49_readCanaryConfig as readCanaryConfig, api49_ensureCanaryConfig as ensureCanaryConfig, api49_canaryEntries as canaryEntries, api49_isCanary as isCanary} from "../runtime.js";
1
+ export {api55_canaryConfigPath as canaryConfigPath, api55_newCaveatName as newCaveatName, api55_newCondition as newCondition, api55_canaryCondition as canaryCondition, api55_readCanaryConfig as readCanaryConfig, api55_ensureCanaryConfig as ensureCanaryConfig, api55_canaryEntries as canaryEntries, api55_isCanary as isCanary, api55_CANARY_FILE_LIMIT as CANARY_FILE_LIMIT} from "../runtime.js";
@@ -1 +1 @@
1
- export {api50_retryable as retryable, api50_fdWriter as fdWriter, api50_createOutputQueue as createOutputQueue, api50_OUTPUT_LIMIT_BYTES as OUTPUT_LIMIT_BYTES} from "../runtime.js";
1
+ export {api56_retryable as retryable, api56_fdWriter as fdWriter, api56_createOutputQueue as createOutputQueue, api56_OUTPUT_LIMIT_BYTES as OUTPUT_LIMIT_BYTES} from "../runtime.js";
@@ -1 +1 @@
1
- export {api51_usagePath as usagePath, api51_readUsage as readUsage, api51_writeUsage as writeUsage, api51_USAGE_LIMIT as USAGE_LIMIT, api51_CANARY_LIMIT as CANARY_LIMIT, api51_COVERAGE_LIMIT as COVERAGE_LIMIT, api51_UsageFileError as UsageFileError, api51_UsageStore as UsageStore} from "../runtime.js";
1
+ export {api57_usagePath as usagePath, api57_readUsage as readUsage, api57_writeUsage as writeUsage, api57_USAGE_LIMIT as USAGE_LIMIT, api57_CANARY_LIMIT as CANARY_LIMIT, api57_COVERAGE_LIMIT as COVERAGE_LIMIT, api57_SPAN_LIMIT as SPAN_LIMIT, api57_USAGE_FILE_LIMIT as USAGE_FILE_LIMIT, api57_UsageFileError as UsageFileError, api57_UsageStore as UsageStore} from "../runtime.js";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "macwarden",
3
- "version": "1.0.1",
3
+ "version": "1.1.1",
4
4
  "description": "Lightning credential hygiene for LND: inspect, scan (incl. git history), inventory, bake, revoke, rotate and attenuate macaroons",
5
5
  "keywords": [
6
6
  "lightning",
@@ -38,7 +38,7 @@
38
38
  "provenance": true
39
39
  },
40
40
  "engines": {
41
- "node": ">=22.12.0"
41
+ "node": "^22.23.2 || ^24.18.1 || >=26.5.1"
42
42
  },
43
43
  "license": "MIT",
44
44
  "scripts": {
@@ -36,6 +36,9 @@
36
36
  },
37
37
  {
38
38
  "$ref": "#/$defs/result"
39
+ },
40
+ {
41
+ "$ref": "#/$defs/help"
39
42
  }
40
43
  ]
41
44
  },
@@ -65,7 +68,14 @@
65
68
  "then": {
66
69
  "properties": {
67
70
  "result": {
68
- "$ref": "#/$defs/result"
71
+ "oneOf": [
72
+ {
73
+ "$ref": "#/$defs/result"
74
+ },
75
+ {
76
+ "$ref": "#/$defs/help"
77
+ }
78
+ ]
69
79
  },
70
80
  "error": {
71
81
  "type": "null"
@@ -332,12 +342,31 @@
332
342
  "root-key-0",
333
343
  "trailing-bytes",
334
344
  "bad-time-before",
345
+ "identifier-exceeds-bounds",
346
+ "caveats-exceed-bounds",
335
347
  "unassessed-uri",
336
348
  "unassessed-permission",
337
349
  "no-permissions",
338
350
  "preimage-exposure"
339
351
  ]
340
352
  },
353
+ "help": {
354
+ "type": "object",
355
+ "additionalProperties": false,
356
+ "required": [
357
+ "usage"
358
+ ],
359
+ "properties": {
360
+ "usage": {
361
+ "type": "array",
362
+ "minItems": 1,
363
+ "items": {
364
+ "type": "string",
365
+ "pattern": "^macwarden attenuate "
366
+ }
367
+ }
368
+ }
369
+ },
341
370
  "result": {
342
371
  "type": "object",
343
372
  "additionalProperties": false,
@@ -36,6 +36,9 @@
36
36
  },
37
37
  {
38
38
  "$ref": "#/$defs/result"
39
+ },
40
+ {
41
+ "$ref": "#/$defs/help"
39
42
  }
40
43
  ]
41
44
  },
@@ -65,7 +68,14 @@
65
68
  "then": {
66
69
  "properties": {
67
70
  "result": {
68
- "$ref": "#/$defs/result"
71
+ "oneOf": [
72
+ {
73
+ "$ref": "#/$defs/result"
74
+ },
75
+ {
76
+ "$ref": "#/$defs/help"
77
+ }
78
+ ]
69
79
  },
70
80
  "error": {
71
81
  "type": "null"
@@ -285,6 +295,23 @@
285
295
  }
286
296
  ]
287
297
  },
298
+ "help": {
299
+ "type": "object",
300
+ "additionalProperties": false,
301
+ "required": [
302
+ "usage"
303
+ ],
304
+ "properties": {
305
+ "usage": {
306
+ "type": "array",
307
+ "minItems": 1,
308
+ "items": {
309
+ "type": "string",
310
+ "pattern": "^macwarden bake "
311
+ }
312
+ }
313
+ }
314
+ },
288
315
  "result": {
289
316
  "oneOf": [
290
317
  {
@@ -15,7 +15,7 @@
15
15
  "uniqueItems": true
16
16
  },
17
17
  "result": {
18
- "oneOf": [{ "type": "null" }, { "$ref": "#/$defs/result" }, { "$ref": "#/$defs/nwcResult" }]
18
+ "oneOf": [{ "type": "null" }, { "$ref": "#/$defs/result" }, { "$ref": "#/$defs/nwcResult" }, { "$ref": "#/$defs/help" }]
19
19
  },
20
20
  "error": {
21
21
  "oneOf": [{ "type": "null" }, { "$ref": "#/$defs/error" }]
@@ -26,7 +26,7 @@
26
26
  "if": { "properties": { "ok": { "const": true } }, "required": ["ok"] },
27
27
  "then": {
28
28
  "properties": {
29
- "result": { "oneOf": [{ "$ref": "#/$defs/result" }, { "$ref": "#/$defs/nwcResult" }] },
29
+ "result": { "oneOf": [{ "$ref": "#/$defs/result" }, { "$ref": "#/$defs/nwcResult" }, { "$ref": "#/$defs/help" }] },
30
30
  "error": { "type": "null" }
31
31
  }
32
32
  },
@@ -39,6 +39,11 @@
39
39
  }
40
40
  ],
41
41
  "$defs": {
42
+ "help": {
43
+ "description": "macwarden inspect --help --json: the command synopsis lines (SPEC.md, Output > Help).",
44
+ "type": "object", "additionalProperties": false, "required": ["usage"],
45
+ "properties": { "usage": { "type": "array", "minItems": 1, "items": { "type": "string", "pattern": "^macwarden inspect " } } }
46
+ },
42
47
  "error": {
43
48
  "type": "object",
44
49
  "additionalProperties": false,
@@ -98,6 +103,8 @@
98
103
  "root-key-0",
99
104
  "trailing-bytes",
100
105
  "bad-time-before",
106
+ "identifier-exceeds-bounds",
107
+ "caveats-exceed-bounds",
101
108
  "unassessed-uri",
102
109
  "unassessed-permission",
103
110
  "no-permissions",
@@ -36,6 +36,9 @@
36
36
  },
37
37
  {
38
38
  "$ref": "#/$defs/result"
39
+ },
40
+ {
41
+ "$ref": "#/$defs/help"
39
42
  }
40
43
  ]
41
44
  },
@@ -65,7 +68,14 @@
65
68
  "then": {
66
69
  "properties": {
67
70
  "result": {
68
- "$ref": "#/$defs/result"
71
+ "oneOf": [
72
+ {
73
+ "$ref": "#/$defs/result"
74
+ },
75
+ {
76
+ "$ref": "#/$defs/help"
77
+ }
78
+ ]
69
79
  },
70
80
  "error": {
71
81
  "type": "null"
@@ -285,6 +295,23 @@
285
295
  }
286
296
  ]
287
297
  },
298
+ "help": {
299
+ "type": "object",
300
+ "additionalProperties": false,
301
+ "required": [
302
+ "usage"
303
+ ],
304
+ "properties": {
305
+ "usage": {
306
+ "type": "array",
307
+ "minItems": 1,
308
+ "items": {
309
+ "type": "string",
310
+ "pattern": "^macwarden inventory "
311
+ }
312
+ }
313
+ }
314
+ },
288
315
  "result": {
289
316
  "type": "object",
290
317
  "additionalProperties": false,
@@ -555,7 +582,8 @@
555
582
  "credentials",
556
583
  "totals",
557
584
  "controls",
558
- "signOff"
585
+ "signOff",
586
+ "limitations"
559
587
  ],
560
588
  "properties": {
561
589
  "schema": {
@@ -616,6 +644,7 @@
616
644
  "replacedBy",
617
645
  "lastUsed",
618
646
  "calls",
647
+ "canary",
619
648
  "flags"
620
649
  ],
621
650
  "properties": {
@@ -709,6 +738,34 @@
709
738
  ],
710
739
  "minimum": 0
711
740
  },
741
+ "canary": {
742
+ "oneOf": [
743
+ {
744
+ "type": "null"
745
+ },
746
+ {
747
+ "type": "object",
748
+ "additionalProperties": false,
749
+ "required": [
750
+ "uses",
751
+ "firstUse",
752
+ "lastUse"
753
+ ],
754
+ "properties": {
755
+ "uses": {
756
+ "type": "integer",
757
+ "minimum": 1
758
+ },
759
+ "firstUse": {
760
+ "type": "string"
761
+ },
762
+ "lastUse": {
763
+ "type": "string"
764
+ }
765
+ }
766
+ }
767
+ ]
768
+ },
712
769
  "flags": {
713
770
  "type": "array",
714
771
  "uniqueItems": true,
@@ -866,6 +923,10 @@
866
923
  "type": "null"
867
924
  }
868
925
  }
926
+ },
927
+ "limitations": {
928
+ "type": "string",
929
+ "minLength": 1
869
930
  }
870
931
  }
871
932
  }
@@ -0,0 +1,329 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://github.com/ZilverZtream/macwarden/blob/main/schemas/output/macwarden.schema.json",
4
+ "title": "macwarden --json output without a command",
5
+ "description": "Normative source: SPEC.md, Output > Help and --json. `macwarden --help --json` (ok: true, the general usage lines and every command with its summary), or a usage error before any command is known (ok: false, exit 2, step null).",
6
+ "type": "object",
7
+ "additionalProperties": false,
8
+ "required": [
9
+ "schema",
10
+ "command",
11
+ "ok",
12
+ "warnings",
13
+ "result",
14
+ "error"
15
+ ],
16
+ "properties": {
17
+ "schema": {
18
+ "const": 1
19
+ },
20
+ "command": {
21
+ "const": null
22
+ },
23
+ "ok": {
24
+ "type": "boolean"
25
+ },
26
+ "warnings": {
27
+ "type": "array",
28
+ "items": {
29
+ "$ref": "#/$defs/warning"
30
+ }
31
+ },
32
+ "result": {
33
+ "oneOf": [
34
+ {
35
+ "type": "null"
36
+ },
37
+ {
38
+ "$ref": "#/$defs/result"
39
+ }
40
+ ]
41
+ },
42
+ "error": {
43
+ "oneOf": [
44
+ {
45
+ "type": "null"
46
+ },
47
+ {
48
+ "$ref": "#/$defs/error"
49
+ }
50
+ ]
51
+ }
52
+ },
53
+ "allOf": [
54
+ {
55
+ "if": {
56
+ "properties": {
57
+ "ok": {
58
+ "const": true
59
+ }
60
+ },
61
+ "required": [
62
+ "ok"
63
+ ]
64
+ },
65
+ "then": {
66
+ "properties": {
67
+ "result": {
68
+ "$ref": "#/$defs/result"
69
+ },
70
+ "error": {
71
+ "type": "null"
72
+ }
73
+ }
74
+ },
75
+ "else": {
76
+ "properties": {
77
+ "result": {
78
+ "type": "null"
79
+ },
80
+ "error": {
81
+ "$ref": "#/$defs/error"
82
+ }
83
+ }
84
+ }
85
+ }
86
+ ],
87
+ "$defs": {
88
+ "error": {
89
+ "type": "object",
90
+ "additionalProperties": false,
91
+ "required": [
92
+ "code",
93
+ "step",
94
+ "message"
95
+ ],
96
+ "properties": {
97
+ "code": {
98
+ "type": "integer",
99
+ "minimum": 1,
100
+ "maximum": 8
101
+ },
102
+ "step": {
103
+ "type": [
104
+ "string",
105
+ "null"
106
+ ],
107
+ "minLength": 1
108
+ },
109
+ "message": {
110
+ "type": "string",
111
+ "minLength": 1
112
+ }
113
+ }
114
+ },
115
+ "warning": {
116
+ "oneOf": [
117
+ {
118
+ "type": "string",
119
+ "minLength": 1
120
+ },
121
+ {
122
+ "type": "object",
123
+ "additionalProperties": false,
124
+ "required": [
125
+ "code",
126
+ "message"
127
+ ],
128
+ "properties": {
129
+ "code": {
130
+ "type": "string",
131
+ "minLength": 1
132
+ },
133
+ "message": {
134
+ "type": "string"
135
+ }
136
+ }
137
+ }
138
+ ]
139
+ },
140
+ "rootKeyId": {
141
+ "type": "string",
142
+ "pattern": "^(0|[1-9][0-9]{0,19})$",
143
+ "description": "uint64 as a canonical decimal string (range up to 18446744073709551615 is enforced by the decoder)."
144
+ },
145
+ "grade": {
146
+ "enum": [
147
+ "ADMIN",
148
+ "SPEND",
149
+ "OPERATE",
150
+ "RECEIVE",
151
+ "READ",
152
+ "UNASSESSED"
153
+ ]
154
+ },
155
+ "registryEntry": {
156
+ "type": "object",
157
+ "required": [
158
+ "nodePubkey",
159
+ "label",
160
+ "rootKeyId",
161
+ "permissions",
162
+ "caveats",
163
+ "grade",
164
+ "fingerprint",
165
+ "outPath",
166
+ "createdAt",
167
+ "verified",
168
+ "status",
169
+ "revokedAt",
170
+ "revokeEvidence",
171
+ "replaces",
172
+ "replacedBy"
173
+ ],
174
+ "additionalProperties": false,
175
+ "properties": {
176
+ "nodePubkey": {
177
+ "type": "string",
178
+ "pattern": "^0[23][0-9a-fA-F]{64}$"
179
+ },
180
+ "label": {
181
+ "type": [
182
+ "string",
183
+ "null"
184
+ ],
185
+ "pattern": "^[A-Za-z][A-Za-z0-9._-]{0,63}$"
186
+ },
187
+ "rootKeyId": {
188
+ "type": "string",
189
+ "pattern": "^(0|[1-9][0-9]*)$"
190
+ },
191
+ "permissions": {
192
+ "type": "array",
193
+ "items": {
194
+ "type": "string"
195
+ }
196
+ },
197
+ "caveats": {
198
+ "type": "array",
199
+ "items": {
200
+ "type": "object"
201
+ }
202
+ },
203
+ "grade": {
204
+ "enum": [
205
+ "ADMIN",
206
+ "SPEND",
207
+ "OPERATE",
208
+ "RECEIVE",
209
+ "READ",
210
+ "UNASSESSED"
211
+ ]
212
+ },
213
+ "fingerprint": {
214
+ "type": [
215
+ "string",
216
+ "null"
217
+ ],
218
+ "pattern": "^fp:[0-9a-f]{16}$"
219
+ },
220
+ "outPath": {
221
+ "type": [
222
+ "string",
223
+ "null"
224
+ ]
225
+ },
226
+ "createdAt": {
227
+ "type": "string"
228
+ },
229
+ "verified": {
230
+ "type": "boolean"
231
+ },
232
+ "status": {
233
+ "enum": [
234
+ "active",
235
+ "revoked"
236
+ ]
237
+ },
238
+ "revokedAt": {
239
+ "type": [
240
+ "string",
241
+ "null"
242
+ ]
243
+ },
244
+ "revokeEvidence": {
245
+ "enum": [
246
+ "rejected",
247
+ "by-id-only",
248
+ null
249
+ ]
250
+ },
251
+ "replaces": {
252
+ "type": [
253
+ "string",
254
+ "null"
255
+ ],
256
+ "pattern": "^(0|[1-9][0-9]*)$"
257
+ },
258
+ "replacedBy": {
259
+ "type": [
260
+ "string",
261
+ "null"
262
+ ],
263
+ "pattern": "^(0|[1-9][0-9]*)$"
264
+ }
265
+ },
266
+ "allOf": [
267
+ {
268
+ "if": {
269
+ "properties": {
270
+ "fingerprint": {
271
+ "type": "null"
272
+ }
273
+ }
274
+ },
275
+ "then": {
276
+ "properties": {
277
+ "verified": {
278
+ "const": false
279
+ },
280
+ "outPath": {
281
+ "type": "null"
282
+ }
283
+ }
284
+ }
285
+ }
286
+ ]
287
+ },
288
+ "result": {
289
+ "type": "object",
290
+ "additionalProperties": false,
291
+ "required": [
292
+ "usage",
293
+ "commands"
294
+ ],
295
+ "properties": {
296
+ "usage": {
297
+ "type": "array",
298
+ "minItems": 1,
299
+ "items": {
300
+ "type": "string",
301
+ "pattern": "^macwarden "
302
+ }
303
+ },
304
+ "commands": {
305
+ "type": "array",
306
+ "minItems": 1,
307
+ "items": {
308
+ "type": "object",
309
+ "additionalProperties": false,
310
+ "required": [
311
+ "name",
312
+ "summary"
313
+ ],
314
+ "properties": {
315
+ "name": {
316
+ "type": "string",
317
+ "pattern": "^[a-z]+$"
318
+ },
319
+ "summary": {
320
+ "type": "string",
321
+ "minLength": 1
322
+ }
323
+ }
324
+ }
325
+ }
326
+ }
327
+ }
328
+ }
329
+ }