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
@@ -0,0 +1,498 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://github.com/ZilverZtream/macwarden/blob/main/schemas/output/recommend.schema.json",
4
+ "title": "macwarden recommend --json output",
5
+ "description": "Normative source: SPEC.md, Commands > 9. recommend. A recommendation only; commands is empty whenever the evidence does not support narrowing.",
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": "recommend"
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
+ "$ref": "#/$defs/help"
42
+ }
43
+ ]
44
+ },
45
+ "error": {
46
+ "oneOf": [
47
+ {
48
+ "type": "null"
49
+ },
50
+ {
51
+ "$ref": "#/$defs/error"
52
+ }
53
+ ]
54
+ }
55
+ },
56
+ "allOf": [
57
+ {
58
+ "if": {
59
+ "properties": {
60
+ "ok": {
61
+ "const": true
62
+ }
63
+ },
64
+ "required": [
65
+ "ok"
66
+ ]
67
+ },
68
+ "then": {
69
+ "properties": {
70
+ "result": {
71
+ "oneOf": [
72
+ {
73
+ "$ref": "#/$defs/result"
74
+ },
75
+ {
76
+ "$ref": "#/$defs/help"
77
+ }
78
+ ]
79
+ },
80
+ "error": {
81
+ "type": "null"
82
+ }
83
+ }
84
+ },
85
+ "else": {
86
+ "properties": {
87
+ "result": {
88
+ "type": "null"
89
+ },
90
+ "error": {
91
+ "$ref": "#/$defs/error"
92
+ }
93
+ }
94
+ }
95
+ }
96
+ ],
97
+ "$defs": {
98
+ "error": {
99
+ "type": "object",
100
+ "additionalProperties": false,
101
+ "required": [
102
+ "code",
103
+ "step",
104
+ "message"
105
+ ],
106
+ "properties": {
107
+ "code": {
108
+ "type": "integer",
109
+ "minimum": 1,
110
+ "maximum": 8
111
+ },
112
+ "step": {
113
+ "type": [
114
+ "string",
115
+ "null"
116
+ ],
117
+ "minLength": 1
118
+ },
119
+ "message": {
120
+ "type": "string",
121
+ "minLength": 1
122
+ }
123
+ }
124
+ },
125
+ "warning": {
126
+ "oneOf": [
127
+ {
128
+ "type": "string",
129
+ "minLength": 1
130
+ },
131
+ {
132
+ "type": "object",
133
+ "additionalProperties": false,
134
+ "required": [
135
+ "code",
136
+ "message"
137
+ ],
138
+ "properties": {
139
+ "code": {
140
+ "type": "string",
141
+ "minLength": 1
142
+ },
143
+ "message": {
144
+ "type": "string"
145
+ }
146
+ }
147
+ }
148
+ ]
149
+ },
150
+ "rootKeyId": {
151
+ "type": "string",
152
+ "pattern": "^(0|[1-9][0-9]{0,19})$",
153
+ "description": "uint64 as a canonical decimal string (range up to 18446744073709551615 is enforced by the decoder)."
154
+ },
155
+ "grade": {
156
+ "enum": [
157
+ "ADMIN",
158
+ "SPEND",
159
+ "OPERATE",
160
+ "RECEIVE",
161
+ "READ",
162
+ "UNASSESSED"
163
+ ]
164
+ },
165
+ "registryEntry": {
166
+ "type": "object",
167
+ "required": [
168
+ "nodePubkey",
169
+ "label",
170
+ "rootKeyId",
171
+ "permissions",
172
+ "caveats",
173
+ "grade",
174
+ "fingerprint",
175
+ "outPath",
176
+ "createdAt",
177
+ "verified",
178
+ "status",
179
+ "revokedAt",
180
+ "revokeEvidence",
181
+ "replaces",
182
+ "replacedBy"
183
+ ],
184
+ "additionalProperties": false,
185
+ "properties": {
186
+ "nodePubkey": {
187
+ "type": "string",
188
+ "pattern": "^0[23][0-9a-fA-F]{64}$"
189
+ },
190
+ "label": {
191
+ "type": [
192
+ "string",
193
+ "null"
194
+ ],
195
+ "pattern": "^[A-Za-z][A-Za-z0-9._-]{0,63}$"
196
+ },
197
+ "rootKeyId": {
198
+ "type": "string",
199
+ "pattern": "^(0|[1-9][0-9]*)$"
200
+ },
201
+ "permissions": {
202
+ "type": "array",
203
+ "items": {
204
+ "type": "string"
205
+ }
206
+ },
207
+ "caveats": {
208
+ "type": "array",
209
+ "items": {
210
+ "type": "object"
211
+ }
212
+ },
213
+ "grade": {
214
+ "enum": [
215
+ "ADMIN",
216
+ "SPEND",
217
+ "OPERATE",
218
+ "RECEIVE",
219
+ "READ",
220
+ "UNASSESSED"
221
+ ]
222
+ },
223
+ "fingerprint": {
224
+ "type": [
225
+ "string",
226
+ "null"
227
+ ],
228
+ "pattern": "^fp:[0-9a-f]{16}$"
229
+ },
230
+ "outPath": {
231
+ "type": [
232
+ "string",
233
+ "null"
234
+ ]
235
+ },
236
+ "createdAt": {
237
+ "type": "string"
238
+ },
239
+ "verified": {
240
+ "type": "boolean"
241
+ },
242
+ "status": {
243
+ "enum": [
244
+ "active",
245
+ "revoked"
246
+ ]
247
+ },
248
+ "revokedAt": {
249
+ "type": [
250
+ "string",
251
+ "null"
252
+ ]
253
+ },
254
+ "revokeEvidence": {
255
+ "enum": [
256
+ "rejected",
257
+ "by-id-only",
258
+ null
259
+ ]
260
+ },
261
+ "replaces": {
262
+ "type": [
263
+ "string",
264
+ "null"
265
+ ],
266
+ "pattern": "^(0|[1-9][0-9]*)$"
267
+ },
268
+ "replacedBy": {
269
+ "type": [
270
+ "string",
271
+ "null"
272
+ ],
273
+ "pattern": "^(0|[1-9][0-9]*)$"
274
+ }
275
+ },
276
+ "allOf": [
277
+ {
278
+ "if": {
279
+ "properties": {
280
+ "fingerprint": {
281
+ "type": "null"
282
+ }
283
+ }
284
+ },
285
+ "then": {
286
+ "properties": {
287
+ "verified": {
288
+ "const": false
289
+ },
290
+ "outPath": {
291
+ "type": "null"
292
+ }
293
+ }
294
+ }
295
+ }
296
+ ]
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 recommend "
311
+ }
312
+ }
313
+ }
314
+ },
315
+ "result": {
316
+ "type": "object",
317
+ "additionalProperties": false,
318
+ "required": [
319
+ "node",
320
+ "selector",
321
+ "label",
322
+ "rootKeyId",
323
+ "credentials",
324
+ "observed",
325
+ "unmapped",
326
+ "recommended",
327
+ "recommendedUris",
328
+ "current",
329
+ "unneeded",
330
+ "observation",
331
+ "commands"
332
+ ],
333
+ "properties": {
334
+ "node": {
335
+ "type": "string",
336
+ "pattern": "^0[23][0-9a-fA-F]{64}$"
337
+ },
338
+ "selector": {
339
+ "type": "string",
340
+ "minLength": 1
341
+ },
342
+ "label": {
343
+ "type": [
344
+ "string",
345
+ "null"
346
+ ]
347
+ },
348
+ "rootKeyId": {
349
+ "oneOf": [
350
+ {
351
+ "type": "null"
352
+ },
353
+ {
354
+ "$ref": "#/$defs/rootKeyId"
355
+ }
356
+ ]
357
+ },
358
+ "credentials": {
359
+ "type": "array",
360
+ "uniqueItems": true,
361
+ "items": {
362
+ "type": "string",
363
+ "pattern": "^id:[0-9a-f]{16}$"
364
+ }
365
+ },
366
+ "observed": {
367
+ "type": "array",
368
+ "items": {
369
+ "type": "object",
370
+ "additionalProperties": false,
371
+ "required": [
372
+ "method",
373
+ "calls",
374
+ "lastUsed",
375
+ "permissions"
376
+ ],
377
+ "properties": {
378
+ "method": {
379
+ "type": "string"
380
+ },
381
+ "calls": {
382
+ "type": "integer",
383
+ "minimum": 0
384
+ },
385
+ "lastUsed": {
386
+ "type": "string"
387
+ },
388
+ "permissions": {
389
+ "type": "array",
390
+ "uniqueItems": true,
391
+ "items": {
392
+ "type": "string"
393
+ }
394
+ }
395
+ }
396
+ }
397
+ },
398
+ "unmapped": {
399
+ "type": "array",
400
+ "uniqueItems": true,
401
+ "items": {
402
+ "type": "string"
403
+ }
404
+ },
405
+ "recommended": {
406
+ "type": "array",
407
+ "uniqueItems": true,
408
+ "items": {
409
+ "type": "string"
410
+ }
411
+ },
412
+ "recommendedUris": {
413
+ "type": "array",
414
+ "uniqueItems": true,
415
+ "items": {
416
+ "type": "string",
417
+ "pattern": "^uri:"
418
+ }
419
+ },
420
+ "current": {
421
+ "oneOf": [
422
+ {
423
+ "type": "null"
424
+ },
425
+ {
426
+ "type": "array",
427
+ "uniqueItems": true,
428
+ "items": {
429
+ "type": "string"
430
+ }
431
+ }
432
+ ]
433
+ },
434
+ "unneeded": {
435
+ "type": "array",
436
+ "uniqueItems": true,
437
+ "items": {
438
+ "type": "string"
439
+ }
440
+ },
441
+ "observation": {
442
+ "type": "object",
443
+ "additionalProperties": false,
444
+ "required": [
445
+ "seconds",
446
+ "since",
447
+ "until",
448
+ "sessions",
449
+ "short",
450
+ "accepted"
451
+ ],
452
+ "properties": {
453
+ "seconds": {
454
+ "oneOf": [
455
+ {
456
+ "type": "null"
457
+ },
458
+ {
459
+ "type": "integer",
460
+ "minimum": 0
461
+ }
462
+ ]
463
+ },
464
+ "since": {
465
+ "type": [
466
+ "string",
467
+ "null"
468
+ ]
469
+ },
470
+ "until": {
471
+ "type": [
472
+ "string",
473
+ "null"
474
+ ]
475
+ },
476
+ "sessions": {
477
+ "type": "integer",
478
+ "minimum": 0
479
+ },
480
+ "short": {
481
+ "type": "boolean"
482
+ },
483
+ "accepted": {
484
+ "type": "boolean"
485
+ }
486
+ }
487
+ },
488
+ "commands": {
489
+ "type": "array",
490
+ "items": {
491
+ "type": "string",
492
+ "minLength": 1
493
+ }
494
+ }
495
+ }
496
+ }
497
+ }
498
+ }
@@ -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"
@@ -431,6 +441,23 @@
431
441
  }
432
442
  }
433
443
  },
444
+ "help": {
445
+ "type": "object",
446
+ "additionalProperties": false,
447
+ "required": [
448
+ "usage"
449
+ ],
450
+ "properties": {
451
+ "usage": {
452
+ "type": "array",
453
+ "minItems": 1,
454
+ "items": {
455
+ "type": "string",
456
+ "pattern": "^macwarden respond "
457
+ }
458
+ }
459
+ }
460
+ },
434
461
  "result": {
435
462
  "type": "object",
436
463
  "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 revoke "
311
+ }
312
+ }
313
+ }
314
+ },
288
315
  "result": {
289
316
  "oneOf": [
290
317
  {
@@ -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 rotate "
311
+ }
312
+ }
313
+ }
314
+ },
288
315
  "result": {
289
316
  "oneOf": [
290
317
  {
@@ -14,7 +14,7 @@
14
14
  "type": "array", "maxItems": 1, "items": { "const": "shallow-history" }
15
15
  },
16
16
  "result": {
17
- "oneOf": [{ "type": "null" }, { "$ref": "#/$defs/result" }]
17
+ "oneOf": [{ "type": "null" }, { "$ref": "#/$defs/result" }, { "$ref": "#/$defs/help" }]
18
18
  },
19
19
  "error": {
20
20
  "oneOf": [{ "type": "null" }, { "$ref": "#/$defs/error" }]
@@ -25,7 +25,7 @@
25
25
  "if": { "properties": { "ok": { "const": true } }, "required": ["ok"] },
26
26
  "then": {
27
27
  "properties": {
28
- "result": { "$ref": "#/$defs/result" },
28
+ "result": { "oneOf": [{ "$ref": "#/$defs/result" }, { "$ref": "#/$defs/help" }] },
29
29
  "error": { "type": "null" }
30
30
  }
31
31
  },
@@ -38,6 +38,11 @@
38
38
  }
39
39
  ],
40
40
  "$defs": {
41
+ "help": {
42
+ "description": "macwarden scan --help --json: the command synopsis lines (SPEC.md, Output > Help).",
43
+ "type": "object", "additionalProperties": false, "required": ["usage"],
44
+ "properties": { "usage": { "type": "array", "minItems": 1, "items": { "type": "string", "pattern": "^macwarden scan " } } }
45
+ },
41
46
  "agentLocation": {
42
47
  "type": "object",
43
48
  "additionalProperties": false,
@@ -80,6 +85,8 @@
80
85
  "root-key-0",
81
86
  "trailing-bytes",
82
87
  "bad-time-before",
88
+ "identifier-exceeds-bounds",
89
+ "caveats-exceed-bounds",
83
90
  "unassessed-uri",
84
91
  "unassessed-permission",
85
92
  "no-permissions",
@@ -144,7 +151,7 @@
144
151
  },
145
152
  "context": { "description": "Only when the credential is a string value inside an MCP server entry of a JSON config (an AI agent configuration).", "const": "mcp-config" },
146
153
  "alsoAt": {
147
- "description": "Only with --git-history: the same file content was also added at other paths. One finding stands for all of them: count is how many other paths, paths lists up to five.",
154
+ "description": "With --git-history (a finding with commit): the same file content was also added at other paths. On a work-tree finding (no commit): the same file is also reachable under other hard-link names within the same path argument. One finding stands for all of them: count is how many other paths, paths lists up to five.",
148
155
  "type": "object",
149
156
  "additionalProperties": false,
150
157
  "required": ["count", "paths"],