macwarden 0.0.0-stage → 1.0.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 (72) hide show
  1. package/CHANGELOG.md +75 -0
  2. package/LICENSE +21 -0
  3. package/README.md +185 -2
  4. package/SECURITY.md +104 -0
  5. package/dist/bin.js +15 -0
  6. package/dist/cancellation.js +1 -0
  7. package/dist/caveat-address.js +1 -0
  8. package/dist/cli.js +1 -0
  9. package/dist/command-result.js +1 -0
  10. package/dist/commands/attenuate.js +1 -0
  11. package/dist/commands/bake/allocate.js +1 -0
  12. package/dist/commands/bake/index.js +1 -0
  13. package/dist/commands/bake/write-out.js +1 -0
  14. package/dist/commands/handlers.js +1 -0
  15. package/dist/commands/inspect.js +1 -0
  16. package/dist/commands/inventory.js +1 -0
  17. package/dist/commands/recommend.js +1 -0
  18. package/dist/commands/respond.js +1 -0
  19. package/dist/commands/revoke.js +1 -0
  20. package/dist/commands/rotate.js +1 -0
  21. package/dist/commands/scan.js +1 -0
  22. package/dist/commands/watch.js +1 -0
  23. package/dist/credential-recognition.js +1 -0
  24. package/dist/decode/index.js +1 -0
  25. package/dist/decode/recognition.js +1 -0
  26. package/dist/environment.js +1 -0
  27. package/dist/errors.js +1 -0
  28. package/dist/grade/index.js +1 -0
  29. package/dist/grade/lnd-permissions.json +508 -0
  30. package/dist/grouped-runs.js +1 -0
  31. package/dist/input/index.js +1 -0
  32. package/dist/input/lndconnect.js +1 -0
  33. package/dist/lnd/grpc.js +1 -0
  34. package/dist/lnd/index.js +1 -0
  35. package/dist/lnd/middleware-proto.js +1 -0
  36. package/dist/online.js +1 -0
  37. package/dist/output/index.js +1 -0
  38. package/dist/output/scan-formats.js +1 -0
  39. package/dist/process-error-context.js +1 -0
  40. package/dist/protected-path.js +1 -0
  41. package/dist/registry/index.js +1 -0
  42. package/dist/registry/process-domain.js +1 -0
  43. package/dist/report/access-review.js +1 -0
  44. package/dist/runtime.js +13107 -0
  45. package/dist/scan/agent-configs.js +1 -0
  46. package/dist/scan/git-history.js +1 -0
  47. package/dist/scan/ignore.js +1 -0
  48. package/dist/scan/index.js +1 -0
  49. package/dist/scan/mcp-context.js +1 -0
  50. package/dist/scan/nwc-match.js +1 -0
  51. package/dist/scan/patterns.js +1 -0
  52. package/dist/scan/redact.js +1 -0
  53. package/dist/secret-capability.js +1 -0
  54. package/dist/secret.js +1 -0
  55. package/dist/version.js +1 -0
  56. package/dist/watch/alert-throttle.js +1 -0
  57. package/dist/watch/alert.js +1 -0
  58. package/dist/watch/canary.js +1 -0
  59. package/dist/watch/output-queue.js +1 -0
  60. package/dist/watch/usage.js +1 -0
  61. package/package.json +69 -4
  62. package/rules/gitleaks.toml +30 -0
  63. package/rules/trufflehog.yaml +27 -0
  64. package/schemas/output/attenuate.schema.json +437 -0
  65. package/schemas/output/bake.schema.json +338 -0
  66. package/schemas/output/inspect.schema.json +172 -0
  67. package/schemas/output/inventory.schema.json +895 -0
  68. package/schemas/output/registry-entry.schema.json +28 -0
  69. package/schemas/output/respond.schema.json +620 -0
  70. package/schemas/output/revoke.schema.json +368 -0
  71. package/schemas/output/rotate.schema.json +381 -0
  72. package/schemas/output/scan.schema.json +270 -0
@@ -0,0 +1,338 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://github.com/ZilverZtream/macwarden/blob/main/schemas/output/bake.schema.json",
4
+ "title": "macwarden bake --json output",
5
+ "description": "Normative source: SPEC.md, Commands > 4. bake. A dry run returns the plan; a bake returns the new registry entry.",
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": "bake"
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
+ "oneOf": [
290
+ {
291
+ "type": "object",
292
+ "additionalProperties": false,
293
+ "required": [
294
+ "dryRun",
295
+ "label",
296
+ "permissions",
297
+ "grade",
298
+ "caveats"
299
+ ],
300
+ "properties": {
301
+ "dryRun": {
302
+ "const": true
303
+ },
304
+ "label": {
305
+ "type": [
306
+ "string",
307
+ "null"
308
+ ],
309
+ "pattern": "^[A-Za-z][A-Za-z0-9._-]{0,63}$"
310
+ },
311
+ "grade": {
312
+ "$ref": "#/$defs/grade"
313
+ },
314
+ "permissions": {
315
+ "type": "array",
316
+ "items": {
317
+ "type": "string"
318
+ }
319
+ },
320
+ "caveats": {
321
+ "type": "array",
322
+ "items": {
323
+ "type": "object",
324
+ "required": [
325
+ "type",
326
+ "value"
327
+ ]
328
+ }
329
+ }
330
+ }
331
+ },
332
+ {
333
+ "$ref": "#/$defs/registryEntry"
334
+ }
335
+ ]
336
+ }
337
+ }
338
+ }
@@ -0,0 +1,172 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "title": "macwarden inspect --json output",
4
+ "description": "The single JSON document `macwarden inspect --json` prints to stdout. Normative source: SPEC.md, Global conventions > Output and Commands > 1. inspect. A Nostr Wallet Connect (NIP-47) input yields the nwcResult shape; its connection secret never appears.",
5
+ "type": "object",
6
+ "additionalProperties": false,
7
+ "required": ["schema", "command", "ok", "warnings", "result", "error"],
8
+ "properties": {
9
+ "schema": { "const": 1 },
10
+ "command": { "const": "inspect" },
11
+ "ok": { "type": "boolean" },
12
+ "warnings": {
13
+ "type": "array",
14
+ "items": { "enum": ["unsafe-arg"] },
15
+ "uniqueItems": true
16
+ },
17
+ "result": {
18
+ "oneOf": [{ "type": "null" }, { "$ref": "#/$defs/result" }, { "$ref": "#/$defs/nwcResult" }]
19
+ },
20
+ "error": {
21
+ "oneOf": [{ "type": "null" }, { "$ref": "#/$defs/error" }]
22
+ }
23
+ },
24
+ "allOf": [
25
+ {
26
+ "if": { "properties": { "ok": { "const": true } }, "required": ["ok"] },
27
+ "then": {
28
+ "properties": {
29
+ "result": { "oneOf": [{ "$ref": "#/$defs/result" }, { "$ref": "#/$defs/nwcResult" }] },
30
+ "error": { "type": "null" }
31
+ }
32
+ },
33
+ "else": {
34
+ "properties": {
35
+ "result": { "type": "null" },
36
+ "error": { "$ref": "#/$defs/error" }
37
+ }
38
+ }
39
+ }
40
+ ],
41
+ "$defs": {
42
+ "error": {
43
+ "type": "object",
44
+ "additionalProperties": false,
45
+ "required": ["code", "step", "message"],
46
+ "properties": {
47
+ "code": { "enum": [2, 3, 8] },
48
+ "step": {
49
+ "description": "null for exit 2; the input or decoding stage for exit 3; internal for exit 8.",
50
+ "oneOf": [
51
+ { "type": "null" },
52
+ {
53
+ "enum": [
54
+ "input-read",
55
+ "input-form",
56
+ "v2-header",
57
+ "packet",
58
+ "identifier-version",
59
+ "identifier-proto",
60
+ "identifier-limits",
61
+ "identifier-root-key-id",
62
+ "nwc-uri",
63
+ "nwc-wallet-pubkey",
64
+ "nwc-relay",
65
+ "nwc-secret",
66
+ "nwc-lud16",
67
+ "internal"
68
+ ]
69
+ }
70
+ ]
71
+ },
72
+ "message": { "type": "string" }
73
+ },
74
+ "allOf": [
75
+ {
76
+ "if": { "properties": { "code": { "const": 2 } } },
77
+ "then": { "properties": { "step": { "type": "null" } } }
78
+ },
79
+ {
80
+ "if": { "properties": { "code": { "const": 3 } } },
81
+ "then": { "properties": { "step": { "type": "string", "not": { "const": "internal" } } } }
82
+ },
83
+ {
84
+ "if": { "properties": { "code": { "const": 8 } } },
85
+ "then": { "properties": { "step": { "const": "internal" } } }
86
+ }
87
+ ]
88
+ },
89
+ "rootKeyId": {
90
+ "type": "string",
91
+ "pattern": "^(0|[1-9][0-9]{0,19})$",
92
+ "description": "uint64 as a canonical decimal string (range up to 18446744073709551615 is enforced by the decoder)."
93
+ },
94
+ "fingerprint": { "type": "string", "pattern": "^fp:[0-9a-f]{16}$" },
95
+ "grade": { "enum": ["ADMIN", "SPEND", "OPERATE", "RECEIVE", "READ", "UNASSESSED"] },
96
+ "macaroonWarning": {
97
+ "enum": [
98
+ "root-key-0",
99
+ "trailing-bytes",
100
+ "bad-time-before",
101
+ "unassessed-uri",
102
+ "unassessed-permission",
103
+ "no-permissions",
104
+ "preimage-exposure"
105
+ ]
106
+ },
107
+ "caveat": {
108
+ "type": "object",
109
+ "additionalProperties": false,
110
+ "required": ["type", "value"],
111
+ "properties": {
112
+ "type": { "enum": ["time-before", "ipaddr", "iprange", "lnd-custom", "third-party", "unknown"] },
113
+ "value": { "type": "string" },
114
+ "expired": { "type": "boolean" }
115
+ },
116
+ "if": { "properties": { "type": { "const": "time-before" } } },
117
+ "else": { "properties": { "expired": false } }
118
+ },
119
+ "result": {
120
+ "type": "object",
121
+ "additionalProperties": false,
122
+ "required": [
123
+ "fingerprint",
124
+ "location",
125
+ "rootKeyId",
126
+ "permissions",
127
+ "caveats",
128
+ "grade",
129
+ "reasons",
130
+ "warnings",
131
+ "unassessed",
132
+ "snapshot"
133
+ ],
134
+ "properties": {
135
+ "fingerprint": { "$ref": "#/$defs/fingerprint" },
136
+ "location": { "type": ["string", "null"] },
137
+ "rootKeyId": { "$ref": "#/$defs/rootKeyId" },
138
+ "permissions": { "type": "array", "items": { "type": "string" } },
139
+ "caveats": { "type": "array", "items": { "$ref": "#/$defs/caveat" } },
140
+ "grade": { "$ref": "#/$defs/grade" },
141
+ "reasons": { "type": "array", "items": { "type": "string" }, "uniqueItems": true },
142
+ "warnings": { "type": "array", "items": { "$ref": "#/$defs/macaroonWarning" }, "uniqueItems": true },
143
+ "unassessed": { "type": "array", "items": { "type": "string" }, "uniqueItems": true },
144
+ "snapshot": { "type": "string", "minLength": 1, "description": "LND version the bundled permission snapshot came from, e.g. 0.21.4-beta." }
145
+ },
146
+ "allOf": [
147
+ {
148
+ "if": { "properties": { "grade": { "const": "UNASSESSED" } } },
149
+ "then": { "properties": { "reasons": { "type": "array", "maxItems": 0 } } }
150
+ }
151
+ ]
152
+ },
153
+ "pubkey": { "type": "string", "pattern": "^[0-9a-f]{64}$" },
154
+ "nwcResult": {
155
+ "type": "object",
156
+ "additionalProperties": false,
157
+ "description": "NIP-47 connection facts. The grade is always SPEND: permissions and budget are set by the wallet service and are not visible.",
158
+ "required": ["kind", "fingerprint", "walletPubkey", "clientPubkey", "relays", "lud16", "grade", "reasons", "warnings"],
159
+ "properties": {
160
+ "kind": { "const": "nwc" },
161
+ "fingerprint": { "$ref": "#/$defs/fingerprint" },
162
+ "walletPubkey": { "$ref": "#/$defs/pubkey" },
163
+ "clientPubkey": { "$ref": "#/$defs/pubkey", "description": "x-only secp256k1 public key derived from the connection secret; wallet services list the connection under it." },
164
+ "relays": { "type": "array", "minItems": 1, "maxItems": 64, "items": { "type": "string", "pattern": "^wss?://" } },
165
+ "lud16": { "type": ["string", "null"] },
166
+ "grade": { "const": "SPEND" },
167
+ "reasons": { "type": "array", "minItems": 1, "maxItems": 1, "items": { "const": "nwc-wallet-side-limits" } },
168
+ "warnings": { "type": "array", "items": { "enum": ["relay-details-removed"] }, "uniqueItems": true }
169
+ }
170
+ }
171
+ }
172
+ }