@vibesdotdev/security 0.0.0-stage → 1.0.0-rc.5

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 (342) hide show
  1. package/LICENSE +18 -0
  2. package/README.md +109 -2
  3. package/dist/cli/index.d.ts +2 -0
  4. package/dist/cli/index.d.ts.map +1 -0
  5. package/dist/cli/index.js +2 -0
  6. package/dist/cli/index.js.map +1 -0
  7. package/dist/cli/plugin.d.ts +15 -0
  8. package/dist/cli/plugin.d.ts.map +1 -0
  9. package/dist/cli/plugin.js +25 -0
  10. package/dist/cli/plugin.js.map +1 -0
  11. package/dist/cli/read-lockfile.d.ts +4 -0
  12. package/dist/cli/read-lockfile.d.ts.map +1 -0
  13. package/dist/cli/read-lockfile.js +74 -0
  14. package/dist/cli/read-lockfile.js.map +1 -0
  15. package/dist/cli/report-output.d.ts +20 -0
  16. package/dist/cli/report-output.d.ts.map +1 -0
  17. package/dist/cli/report-output.js +27 -0
  18. package/dist/cli/report-output.js.map +1 -0
  19. package/dist/cli/shield.cli-group.descriptor.d.ts +9 -0
  20. package/dist/cli/shield.cli-group.descriptor.d.ts.map +1 -0
  21. package/dist/cli/shield.cli-group.descriptor.js +16 -0
  22. package/dist/cli/shield.cli-group.descriptor.js.map +1 -0
  23. package/dist/cli/shield.deps.cli-group.descriptor.d.ts +9 -0
  24. package/dist/cli/shield.deps.cli-group.descriptor.d.ts.map +1 -0
  25. package/dist/cli/shield.deps.cli-group.descriptor.js +17 -0
  26. package/dist/cli/shield.deps.cli-group.descriptor.js.map +1 -0
  27. package/dist/cli/shield.deps.gate.descriptor.d.ts +10 -0
  28. package/dist/cli/shield.deps.gate.descriptor.d.ts.map +1 -0
  29. package/dist/cli/shield.deps.gate.descriptor.js +25 -0
  30. package/dist/cli/shield.deps.gate.descriptor.js.map +1 -0
  31. package/dist/cli/shield.deps.gate.impl.consumer.d.ts +18 -0
  32. package/dist/cli/shield.deps.gate.impl.consumer.d.ts.map +1 -0
  33. package/dist/cli/shield.deps.gate.impl.consumer.js +42 -0
  34. package/dist/cli/shield.deps.gate.impl.consumer.js.map +1 -0
  35. package/dist/cli/shield.deps.scan.descriptor.d.ts +10 -0
  36. package/dist/cli/shield.deps.scan.descriptor.d.ts.map +1 -0
  37. package/dist/cli/shield.deps.scan.descriptor.js +25 -0
  38. package/dist/cli/shield.deps.scan.descriptor.js.map +1 -0
  39. package/dist/cli/shield.deps.scan.impl.consumer.d.ts +16 -0
  40. package/dist/cli/shield.deps.scan.impl.consumer.d.ts.map +1 -0
  41. package/dist/cli/shield.deps.scan.impl.consumer.js +35 -0
  42. package/dist/cli/shield.deps.scan.impl.consumer.js.map +1 -0
  43. package/dist/helpers/constant-time.d.ts +18 -0
  44. package/dist/helpers/constant-time.d.ts.map +1 -0
  45. package/dist/helpers/constant-time.js +49 -0
  46. package/dist/helpers/constant-time.js.map +1 -0
  47. package/dist/helpers/filename-sanitizer.d.ts +2 -0
  48. package/dist/helpers/filename-sanitizer.d.ts.map +1 -0
  49. package/dist/helpers/filename-sanitizer.js +18 -0
  50. package/dist/helpers/filename-sanitizer.js.map +1 -0
  51. package/dist/helpers/forwardable-auth-headers.d.ts +8 -0
  52. package/dist/helpers/forwardable-auth-headers.d.ts.map +1 -0
  53. package/dist/helpers/forwardable-auth-headers.js +44 -0
  54. package/dist/helpers/forwardable-auth-headers.js.map +1 -0
  55. package/dist/helpers/index.d.ts +7 -0
  56. package/dist/helpers/index.d.ts.map +1 -0
  57. package/dist/helpers/index.js +7 -0
  58. package/dist/helpers/index.js.map +1 -0
  59. package/dist/helpers/ip-range.d.ts +3 -0
  60. package/dist/helpers/ip-range.d.ts.map +1 -0
  61. package/dist/helpers/ip-range.js +55 -0
  62. package/dist/helpers/ip-range.js.map +1 -0
  63. package/dist/helpers/mime-classifier.d.ts +3 -0
  64. package/dist/helpers/mime-classifier.d.ts.map +1 -0
  65. package/dist/helpers/mime-classifier.js +29 -0
  66. package/dist/helpers/mime-classifier.js.map +1 -0
  67. package/dist/helpers/pattern-matcher.d.ts +13 -0
  68. package/dist/helpers/pattern-matcher.d.ts.map +1 -0
  69. package/dist/helpers/pattern-matcher.js +29 -0
  70. package/dist/helpers/pattern-matcher.js.map +1 -0
  71. package/dist/implementations/cli-types.d.ts +2 -0
  72. package/dist/implementations/cli-types.d.ts.map +1 -0
  73. package/dist/implementations/cli-types.js +2 -0
  74. package/dist/implementations/cli-types.js.map +1 -0
  75. package/dist/implementations/encryption.d.ts +21 -0
  76. package/dist/implementations/encryption.d.ts.map +1 -0
  77. package/dist/implementations/encryption.js +154 -0
  78. package/dist/implementations/encryption.js.map +1 -0
  79. package/dist/implementations/errors.d.ts +17 -0
  80. package/dist/implementations/errors.d.ts.map +1 -0
  81. package/dist/implementations/errors.js +23 -0
  82. package/dist/implementations/errors.js.map +1 -0
  83. package/dist/implementations/keys.d.ts +24 -0
  84. package/dist/implementations/keys.d.ts.map +1 -0
  85. package/dist/implementations/keys.js +114 -0
  86. package/dist/implementations/keys.js.map +1 -0
  87. package/dist/implementations/redaction-admission.d.ts +24 -0
  88. package/dist/implementations/redaction-admission.d.ts.map +1 -0
  89. package/dist/implementations/redaction-admission.js +44 -0
  90. package/dist/implementations/redaction-admission.js.map +1 -0
  91. package/dist/implementations/redaction.d.ts +32 -0
  92. package/dist/implementations/redaction.d.ts.map +1 -0
  93. package/dist/implementations/redaction.js +47 -0
  94. package/dist/implementations/redaction.js.map +1 -0
  95. package/dist/implementations/redactor.inprocess.impl.d.ts +30 -0
  96. package/dist/implementations/redactor.inprocess.impl.d.ts.map +1 -0
  97. package/dist/implementations/redactor.inprocess.impl.js +26 -0
  98. package/dist/implementations/redactor.inprocess.impl.js.map +1 -0
  99. package/dist/implementations/redactor.subprocess.impl.d.ts +25 -0
  100. package/dist/implementations/redactor.subprocess.impl.d.ts.map +1 -0
  101. package/dist/implementations/redactor.subprocess.impl.js +42 -0
  102. package/dist/implementations/redactor.subprocess.impl.js.map +1 -0
  103. package/dist/implementations/scanner.impl.d.ts +7 -0
  104. package/dist/implementations/scanner.impl.d.ts.map +1 -0
  105. package/dist/implementations/scanner.impl.js +166 -0
  106. package/dist/implementations/scanner.impl.js.map +1 -0
  107. package/dist/index.d.ts +18 -0
  108. package/dist/index.d.ts.map +1 -0
  109. package/dist/index.js +11 -0
  110. package/dist/index.js.map +1 -0
  111. package/dist/kinds/auditor.kind.d.ts +31 -0
  112. package/dist/kinds/auditor.kind.d.ts.map +1 -0
  113. package/dist/kinds/auditor.kind.js +48 -0
  114. package/dist/kinds/auditor.kind.js.map +1 -0
  115. package/dist/kinds/dep-scanner.kind.d.ts +27 -0
  116. package/dist/kinds/dep-scanner.kind.d.ts.map +1 -0
  117. package/dist/kinds/dep-scanner.kind.js +29 -0
  118. package/dist/kinds/dep-scanner.kind.js.map +1 -0
  119. package/dist/kinds/freshness-policy.kind.d.ts +34 -0
  120. package/dist/kinds/freshness-policy.kind.d.ts.map +1 -0
  121. package/dist/kinds/freshness-policy.kind.js +47 -0
  122. package/dist/kinds/freshness-policy.kind.js.map +1 -0
  123. package/dist/kinds/index.d.ts +9 -0
  124. package/dist/kinds/index.d.ts.map +1 -0
  125. package/dist/kinds/index.js +9 -0
  126. package/dist/kinds/index.js.map +1 -0
  127. package/dist/kinds/ioc-feed.kind.d.ts +35 -0
  128. package/dist/kinds/ioc-feed.kind.d.ts.map +1 -0
  129. package/dist/kinds/ioc-feed.kind.js +36 -0
  130. package/dist/kinds/ioc-feed.kind.js.map +1 -0
  131. package/dist/kinds/policy.kind.d.ts +42 -0
  132. package/dist/kinds/policy.kind.d.ts.map +1 -0
  133. package/dist/kinds/policy.kind.js +23 -0
  134. package/dist/kinds/policy.kind.js.map +1 -0
  135. package/dist/kinds/redactor.kind.d.ts +30 -0
  136. package/dist/kinds/redactor.kind.d.ts.map +1 -0
  137. package/dist/kinds/redactor.kind.js +25 -0
  138. package/dist/kinds/redactor.kind.js.map +1 -0
  139. package/dist/kinds/scanner.kind.d.ts +35 -0
  140. package/dist/kinds/scanner.kind.d.ts.map +1 -0
  141. package/dist/kinds/scanner.kind.js +26 -0
  142. package/dist/kinds/scanner.kind.js.map +1 -0
  143. package/dist/schemas/AuditEvent.d.ts +30 -0
  144. package/dist/schemas/AuditEvent.d.ts.map +1 -0
  145. package/dist/schemas/AuditEvent.js +17 -0
  146. package/dist/schemas/AuditEvent.js.map +1 -0
  147. package/dist/schemas/RedactionRule.d.ts +16 -0
  148. package/dist/schemas/RedactionRule.d.ts.map +1 -0
  149. package/dist/schemas/RedactionRule.js +10 -0
  150. package/dist/schemas/RedactionRule.js.map +1 -0
  151. package/dist/schemas/SecurityPolicy.d.ts +21 -0
  152. package/dist/schemas/SecurityPolicy.d.ts.map +1 -0
  153. package/dist/schemas/SecurityPolicy.js +9 -0
  154. package/dist/schemas/SecurityPolicy.js.map +1 -0
  155. package/dist/schemas/ThreatReport.d.ts +25 -0
  156. package/dist/schemas/ThreatReport.d.ts.map +1 -0
  157. package/dist/schemas/ThreatReport.js +14 -0
  158. package/dist/schemas/ThreatReport.js.map +1 -0
  159. package/dist/schemas/contracts/auditor.d.ts +68 -0
  160. package/dist/schemas/contracts/auditor.d.ts.map +1 -0
  161. package/dist/schemas/contracts/auditor.js +13 -0
  162. package/dist/schemas/contracts/auditor.js.map +1 -0
  163. package/dist/schemas/contracts/card.d.ts +106 -0
  164. package/dist/schemas/contracts/card.d.ts.map +1 -0
  165. package/dist/schemas/contracts/card.js +73 -0
  166. package/dist/schemas/contracts/card.js.map +1 -0
  167. package/dist/schemas/contracts/dep-scanner.d.ts +91 -0
  168. package/dist/schemas/contracts/dep-scanner.d.ts.map +1 -0
  169. package/dist/schemas/contracts/dep-scanner.js +27 -0
  170. package/dist/schemas/contracts/dep-scanner.js.map +1 -0
  171. package/dist/schemas/contracts/freshness-policy.d.ts +99 -0
  172. package/dist/schemas/contracts/freshness-policy.d.ts.map +1 -0
  173. package/dist/schemas/contracts/freshness-policy.js +31 -0
  174. package/dist/schemas/contracts/freshness-policy.js.map +1 -0
  175. package/dist/schemas/contracts/ioc-feed.d.ts +85 -0
  176. package/dist/schemas/contracts/ioc-feed.d.ts.map +1 -0
  177. package/dist/schemas/contracts/ioc-feed.js +28 -0
  178. package/dist/schemas/contracts/ioc-feed.js.map +1 -0
  179. package/dist/schemas/contracts/misc.d.ts +11 -0
  180. package/dist/schemas/contracts/misc.d.ts.map +1 -0
  181. package/dist/schemas/contracts/misc.js +4 -0
  182. package/dist/schemas/contracts/misc.js.map +1 -0
  183. package/dist/schemas/contracts/policy.d.ts +93 -0
  184. package/dist/schemas/contracts/policy.d.ts.map +1 -0
  185. package/dist/schemas/contracts/policy.js +25 -0
  186. package/dist/schemas/contracts/policy.js.map +1 -0
  187. package/dist/schemas/contracts/redactor.d.ts +99 -0
  188. package/dist/schemas/contracts/redactor.d.ts.map +1 -0
  189. package/dist/schemas/contracts/redactor.js +34 -0
  190. package/dist/schemas/contracts/redactor.js.map +1 -0
  191. package/dist/schemas/contracts/scanner.d.ts +112 -0
  192. package/dist/schemas/contracts/scanner.d.ts.map +1 -0
  193. package/dist/schemas/contracts/scanner.js +40 -0
  194. package/dist/schemas/contracts/scanner.js.map +1 -0
  195. package/dist/schemas/contracts/widget.d.ts +19 -0
  196. package/dist/schemas/contracts/widget.d.ts.map +1 -0
  197. package/dist/schemas/contracts/widget.js +10 -0
  198. package/dist/schemas/contracts/widget.js.map +1 -0
  199. package/dist/schemas/encryption.d.ts +25 -0
  200. package/dist/schemas/encryption.d.ts.map +1 -0
  201. package/dist/schemas/encryption.js +35 -0
  202. package/dist/schemas/encryption.js.map +1 -0
  203. package/dist/schemas/index.d.ts +6 -0
  204. package/dist/schemas/index.d.ts.map +1 -0
  205. package/dist/schemas/index.js +6 -0
  206. package/dist/schemas/index.js.map +1 -0
  207. package/dist/schemas/policy.d.ts +2 -0
  208. package/dist/schemas/policy.d.ts.map +1 -0
  209. package/dist/schemas/policy.js +2 -0
  210. package/dist/schemas/policy.js.map +1 -0
  211. package/dist/schemas/redactor.d.ts +2 -0
  212. package/dist/schemas/redactor.d.ts.map +1 -0
  213. package/dist/schemas/redactor.js +2 -0
  214. package/dist/schemas/redactor.js.map +1 -0
  215. package/dist/schemas/report-event.d.ts +29 -0
  216. package/dist/schemas/report-event.d.ts.map +1 -0
  217. package/dist/schemas/report-event.js +19 -0
  218. package/dist/schemas/report-event.js.map +1 -0
  219. package/dist/schemas/scanner.d.ts +2 -0
  220. package/dist/schemas/scanner.d.ts.map +1 -0
  221. package/dist/schemas/scanner.js +2 -0
  222. package/dist/schemas/scanner.js.map +1 -0
  223. package/dist/security-client/index.d.ts +3 -0
  224. package/dist/security-client/index.d.ts.map +1 -0
  225. package/dist/security-client/index.js +2 -0
  226. package/dist/security-client/index.js.map +1 -0
  227. package/dist/security-client/security-client.d.ts +34 -0
  228. package/dist/security-client/security-client.d.ts.map +1 -0
  229. package/dist/security-client/security-client.js +54 -0
  230. package/dist/security-client/security-client.js.map +1 -0
  231. package/dist/security.consumer.plugin.d.ts +3 -0
  232. package/dist/security.consumer.plugin.d.ts.map +1 -0
  233. package/dist/security.consumer.plugin.js +28 -0
  234. package/dist/security.consumer.plugin.js.map +1 -0
  235. package/dist/security.plugin.d.ts +16 -0
  236. package/dist/security.plugin.d.ts.map +1 -0
  237. package/dist/security.plugin.js +78 -0
  238. package/dist/security.plugin.js.map +1 -0
  239. package/dist/svelte/index.d.ts +3 -0
  240. package/dist/svelte/index.d.ts.map +1 -0
  241. package/dist/svelte/index.js +2 -0
  242. package/dist/svelte/security-svelte.plugin.d.ts +5 -0
  243. package/dist/svelte/security-svelte.plugin.d.ts.map +1 -0
  244. package/dist/svelte/security-svelte.plugin.js +49 -0
  245. package/dist/svelte/styles.css +8 -0
  246. package/dist/svelte/tool-widgets/SecurityToolCard.svelte +140 -0
  247. package/dist/svelte/tool-widgets/SecurityToolCard.svelte.d.ts +5 -0
  248. package/dist/svelte/tool-widgets/SecurityToolCard.svelte.d.ts.map +1 -0
  249. package/dist/svelte/tool-widgets/index.d.ts +2 -0
  250. package/dist/svelte/tool-widgets/index.d.ts.map +1 -0
  251. package/dist/svelte/tool-widgets/index.js +6 -0
  252. package/dist/tools/check-policy/check-policy.descriptor.d.ts +37 -0
  253. package/dist/tools/check-policy/check-policy.descriptor.d.ts.map +1 -0
  254. package/dist/tools/check-policy/check-policy.descriptor.js +21 -0
  255. package/dist/tools/check-policy/check-policy.descriptor.js.map +1 -0
  256. package/dist/tools/check-policy/check-policy.impl.consumer.d.ts +7 -0
  257. package/dist/tools/check-policy/check-policy.impl.consumer.d.ts.map +1 -0
  258. package/dist/tools/check-policy/check-policy.impl.consumer.js +21 -0
  259. package/dist/tools/check-policy/check-policy.impl.consumer.js.map +1 -0
  260. package/dist/tools/check-policy/index.d.ts +3 -0
  261. package/dist/tools/check-policy/index.d.ts.map +1 -0
  262. package/dist/tools/check-policy/index.js +2 -0
  263. package/dist/tools/check-policy/index.js.map +1 -0
  264. package/dist/tools/check-policy/schemas.d.ts +23 -0
  265. package/dist/tools/check-policy/schemas.d.ts.map +1 -0
  266. package/dist/tools/check-policy/schemas.js +13 -0
  267. package/dist/tools/check-policy/schemas.js.map +1 -0
  268. package/dist/tools/index.d.ts +10 -0
  269. package/dist/tools/index.d.ts.map +1 -0
  270. package/dist/tools/index.js +6 -0
  271. package/dist/tools/index.js.map +1 -0
  272. package/dist/tools/redact-output/index.d.ts +3 -0
  273. package/dist/tools/redact-output/index.d.ts.map +1 -0
  274. package/dist/tools/redact-output/index.js +2 -0
  275. package/dist/tools/redact-output/index.js.map +1 -0
  276. package/dist/tools/redact-output/redact-output.descriptor.d.ts +42 -0
  277. package/dist/tools/redact-output/redact-output.descriptor.d.ts.map +1 -0
  278. package/dist/tools/redact-output/redact-output.descriptor.js +21 -0
  279. package/dist/tools/redact-output/redact-output.descriptor.js.map +1 -0
  280. package/dist/tools/redact-output/redact-output.impl.consumer.d.ts +7 -0
  281. package/dist/tools/redact-output/redact-output.impl.consumer.d.ts.map +1 -0
  282. package/dist/tools/redact-output/redact-output.impl.consumer.js +18 -0
  283. package/dist/tools/redact-output/redact-output.impl.consumer.js.map +1 -0
  284. package/dist/tools/redact-output/schemas.d.ts +28 -0
  285. package/dist/tools/redact-output/schemas.d.ts.map +1 -0
  286. package/dist/tools/redact-output/schemas.js +13 -0
  287. package/dist/tools/redact-output/schemas.js.map +1 -0
  288. package/dist/tools/report-event/index.d.ts +3 -0
  289. package/dist/tools/report-event/index.d.ts.map +1 -0
  290. package/dist/tools/report-event/index.js +2 -0
  291. package/dist/tools/report-event/index.js.map +1 -0
  292. package/dist/tools/report-event/report-event.descriptor.d.ts +43 -0
  293. package/dist/tools/report-event/report-event.descriptor.d.ts.map +1 -0
  294. package/dist/tools/report-event/report-event.descriptor.js +21 -0
  295. package/dist/tools/report-event/report-event.descriptor.js.map +1 -0
  296. package/dist/tools/report-event/report-event.impl.consumer.d.ts +24 -0
  297. package/dist/tools/report-event/report-event.impl.consumer.d.ts.map +1 -0
  298. package/dist/tools/report-event/report-event.impl.consumer.js +61 -0
  299. package/dist/tools/report-event/report-event.impl.consumer.js.map +1 -0
  300. package/dist/tools/report-event/schemas.d.ts +2 -0
  301. package/dist/tools/report-event/schemas.d.ts.map +1 -0
  302. package/dist/tools/report-event/schemas.js +3 -0
  303. package/dist/tools/report-event/schemas.js.map +1 -0
  304. package/dist/tools/scan-input/index.d.ts +3 -0
  305. package/dist/tools/scan-input/index.d.ts.map +1 -0
  306. package/dist/tools/scan-input/index.js +2 -0
  307. package/dist/tools/scan-input/index.js.map +1 -0
  308. package/dist/tools/scan-input/scan-input.descriptor.d.ts +49 -0
  309. package/dist/tools/scan-input/scan-input.descriptor.d.ts.map +1 -0
  310. package/dist/tools/scan-input/scan-input.descriptor.js +21 -0
  311. package/dist/tools/scan-input/scan-input.descriptor.js.map +1 -0
  312. package/dist/tools/scan-input/scan-input.impl.consumer.d.ts +7 -0
  313. package/dist/tools/scan-input/scan-input.impl.consumer.d.ts.map +1 -0
  314. package/dist/tools/scan-input/scan-input.impl.consumer.js +22 -0
  315. package/dist/tools/scan-input/scan-input.impl.consumer.js.map +1 -0
  316. package/dist/tools/scan-input/schemas.d.ts +36 -0
  317. package/dist/tools/scan-input/schemas.d.ts.map +1 -0
  318. package/dist/tools/scan-input/schemas.js +15 -0
  319. package/dist/tools/scan-input/schemas.js.map +1 -0
  320. package/dist/tools/security-tool-card.d.ts +13 -0
  321. package/dist/tools/security-tool-card.d.ts.map +1 -0
  322. package/dist/tools/security-tool-card.js +171 -0
  323. package/dist/tools/security-tool-card.js.map +1 -0
  324. package/dist/tools/security.docs.descriptor.d.ts +17 -0
  325. package/dist/tools/security.docs.descriptor.d.ts.map +1 -0
  326. package/dist/tools/security.docs.descriptor.js +49 -0
  327. package/dist/tools/security.docs.descriptor.js.map +1 -0
  328. package/dist/tui/index.d.ts +2 -0
  329. package/dist/tui/index.d.ts.map +1 -0
  330. package/dist/tui/index.js +2 -0
  331. package/dist/tui/index.js.map +1 -0
  332. package/dist/tui/security-tui.plugin.d.ts +3 -0
  333. package/dist/tui/security-tui.plugin.d.ts.map +1 -0
  334. package/dist/tui/security-tui.plugin.js +31 -0
  335. package/dist/tui/security-tui.plugin.js.map +1 -0
  336. package/dist/tui/tool-widgets/SecurityToolWidget.impl.consumer.d.ts +5 -0
  337. package/dist/tui/tool-widgets/SecurityToolWidget.impl.consumer.d.ts.map +1 -0
  338. package/dist/tui/tool-widgets/SecurityToolWidget.impl.consumer.js +37 -0
  339. package/dist/tui/tool-widgets/SecurityToolWidget.impl.consumer.js.map +1 -0
  340. package/docs/host-boundary.md +186 -0
  341. package/docs/scanner-work.md +29 -0
  342. package/package.json +245 -4
package/LICENSE ADDED
@@ -0,0 +1,18 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 VIBES DEV LLC
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and
6
+ associated documentation files (the "Software"), to deal in the Software without restriction, including
7
+ without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8
+ copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the
9
+ following conditions:
10
+
11
+ The above copyright notice and this permission notice shall be included in all copies or substantial
12
+ portions of the Software.
13
+
14
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT
15
+ LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO
16
+ EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
17
+ IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
18
+ USE OR OTHER DEALINGS IN THE SOFTWARE.
package/README.md CHANGED
@@ -1,3 +1,110 @@
1
- # Temporary Holding Version
1
+ # @vibesdotdev/security
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ Runtime security assessment: secret, PII and prompt-injection scanning, output
4
+ redaction, policy evaluation, audit emission, and Shield dependency reports.
5
+ Licensed under MIT.
6
+
7
+ Install `@vibesdotdev/security` with its Kernel, CLI, Paths, and Filesystem peers.
8
+ Hosts compose the universal plugin for security kinds and descriptors, then add
9
+ only the slices their scope supports:
10
+
11
+ - Consumer tool hosts: compose `securityPlugin` from `./plugin`,
12
+ `securityConsumerPlugin` from `./consumer.plugin`, and the Tools owner.
13
+ - Shield CLI hosts: compose `securityPlugin`, `securityCliPlugin` from
14
+ `./cli/plugin`, and the CLI owner. The CLI slice supplies both dependency
15
+ commands without requiring the consumer tool slice.
16
+ - Browser and cloud hosts: compose `./plugin`; tool execution belongs to a
17
+ consumer host. Svelte and TUI result cards use `./svelte/plugin` and
18
+ `./tui/plugin` respectively and do not compose tool or CLI execution.
19
+
20
+ The package's hand-owned `vibes.config.ts` composes all five slices for its
21
+ consumer workspace; browser and cloud hosts still select only their supported
22
+ slices. The unit-config generator preserves that explicit workspace block.
23
+
24
+ All paths above are subpaths of `@vibesdotdev/security`. Existing `./tools`,
25
+ `./cli`, kind, schema and surface imports remain available.
26
+
27
+ ```ts
28
+ import { securityPlugin } from '@vibesdotdev/security/plugin';
29
+
30
+ await runtime.registerPlugin(securityPlugin);
31
+ const scanner = await runtime.query('security/scanner').resolve();
32
+ const report = await scanner.scan('ignore previous instructions');
33
+ ```
34
+
35
+ The plugin lazily registers built-in scanning and redaction. Direct scanner
36
+ resolution, as above, selects one enabled implementation. The `security.scan-input`
37
+ tool aggregates all enabled scanners through `resolveAll()`. Runtime selection
38
+ chooses the redactor. Policy and auditor descriptors come from the host. An absent policy denies and reports
39
+ that no engine is available. Dependency scanning currently returns an honest
40
+ `unknown` verdict; it has no shipped advisory feed.
41
+
42
+ The universal plugin registers the semantic `SecurityClient` as
43
+ `runtime/client` id `security`. Activate it through the kernel client owner:
44
+
45
+ ```ts
46
+ import { getVibesClient, tryGetVibesClient } from '@vibesdotdev/kernel/client';
47
+ import type { SecurityClient } from '@vibesdotdev/security';
48
+
49
+ const security = await getVibesClient<SecurityClient>('security', runtime);
50
+ await security.emit(event);
51
+ const events = await security.queryAuditEvents({ actor: 'agent', limit: 20 });
52
+ const active = tryGetVibesClient<SecurityClient>('security', runtime);
53
+ ```
54
+
55
+ The kernel reuses the client within its runtime. Synchronous access returns
56
+ undefined before activation. Each operation resolves the enabled auditor using
57
+ the kind's selection contract; direct `security/auditor` calls share that sink.
58
+ The client owns no audit store. Host-composed sinks own persistence; the
59
+ descriptor-only auditor keeps state within its runtime.
60
+
61
+ Events and query options use `AuditEventSchema` and `AuditQueryOptionsSchema`.
62
+ Malformed arguments reject with ZodError before auditor resolution. With no
63
+ enabled auditor, both operations throw CapabilityError code `UNAVAILABLE`,
64
+ reason `security-auditor-unavailable`. Loader and sink failures propagate.
65
+ The report-event tool retains its separate operational `recorded:false` contract.
66
+ Its canonical input/output schemas live in `./schemas/report-event`; the existing
67
+ tool schema module re-exports the same contracts. Malformed envelopes reject
68
+ before sink resolution or failure logging.
69
+
70
+ Direct built-in scans and tools cap content at 262,144 UTF-16 units. Omitted,
71
+ empty and partial call options preserve configured categories; explicit undefined
72
+ also preserves omission. Built-in scans, descriptor-only defaults and scan-input
73
+ tools reject null, non-object options and mistyped known fields with the canonical
74
+ ZodError. Invalid content, freshness timestamps and dependency reports reject
75
+ through their owning schemas.
76
+ Freshness allowlists apply only after timestamp validation.
77
+
78
+ Descriptor-only IOC feeds reject sync, query and getStatus with CapabilityError
79
+ code UNAVAILABLE and reason ioc-feed-unavailable. Compose a real IOC feed
80
+ implementation; the default cannot establish synchronization, status or absence
81
+ of indicators.
82
+
83
+ Descriptor-only redactors validate string content and optional RedactionRuleSchema
84
+ rules before returning unchanged content, empty matches and redactorAvailable:false.
85
+ Omitted and undefined rules are valid; null, non-array rules and malformed fields
86
+ reject with ZodError. This admission does not execute patterns or require an
87
+ execution host; built-in content and rule-count limits belong to built-in matching.
88
+
89
+ Built-in redaction preserves literal replacements and original match
90
+ coordinates. Cloud and browser runtimes redact in-process with a candidate-span
91
+ budget; consumer hardware selects the subprocess implementation, which needs the
92
+ runtime's supervised execution provider and Node command discovery to enforce a
93
+ one-second deadline for arbitrary regex patterns.
94
+
95
+ Synchronous AES-256-GCM compatibility APIs remain at the root and
96
+ `@vibesdotdev/security/encryption`. Their names, formats, storage AAD, explicit
97
+ keys, base-specific keys and persistent-key behavior are retained. Their host
98
+ migration remains unfinished: crypto and synchronous key-file access still use
99
+ the established Node APIs. The current packed.test.ts is an in-process source
100
+ contract test: it checks selected export-map keys, docs presence, a key round
101
+ trip, helper behavior and plugin ids. It does not build, pack, extract,
102
+ install, inspect Node/type export conditions or resolve extracted widgets.
103
+ Historical artifact receipts and failures are identified in
104
+ [host boundary evidence](docs/host-boundary.md). Passing source tests do not
105
+ close the host migration or prove distributed-artifact correctness.
106
+
107
+ See [SPEC.md](SPEC.md) for composition, span ordering, entrypoints, typed
108
+ refusals and the outstanding owner boundary. Run `bun run check`,
109
+ `bun run test`, and `bun run build` from this package. Tests are included in
110
+ typechecking; emitted packages exclude test code.
@@ -0,0 +1,2 @@
1
+ export type { CLIGroupAssetDescriptor, CLICommandAssetDescriptor } from '../implementations/cli-types.ts';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/cli/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,uBAAuB,EAAE,yBAAyB,EAAE,MAAM,iCAAiC,CAAC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/cli/index.ts"],"names":[],"mappings":""}
@@ -0,0 +1,15 @@
1
+ /**
2
+ * The security CLI plugin: the Shield dependency command implementations
3
+ * (`shield.deps.scan`, `shield.deps.gate`).
4
+ *
5
+ * Compose this beside `securityPlugin` (from `@vibesdotdev/security/plugin`)
6
+ * on CLI hosts. The descriptors stay in the universal plugin so command
7
+ * discovery works from any scope; the `*.impl.consumer.ts` implementations
8
+ * (which read host disks and lockfiles) live only here, because a runtime
9
+ * `scope` tag stops runtime resolution but not static bundler traversal —
10
+ * inline loaders would ship the CLI implementations into Worker/browser
11
+ * bundles.
12
+ */
13
+ export declare const securityCliPlugin: import("@vibesdotdev/kernel").RuntimePlugin;
14
+ export default securityCliPlugin;
15
+ //# sourceMappingURL=plugin.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../../src/cli/plugin.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,iBAAiB,6CAc5B,CAAC;AAEH,eAAe,iBAAiB,CAAC"}
@@ -0,0 +1,25 @@
1
+ import { createRuntimePlugin, loader } from '@vibesdotdev/kernel/factory';
2
+ /**
3
+ * The security CLI plugin: the Shield dependency command implementations
4
+ * (`shield.deps.scan`, `shield.deps.gate`).
5
+ *
6
+ * Compose this beside `securityPlugin` (from `@vibesdotdev/security/plugin`)
7
+ * on CLI hosts. The descriptors stay in the universal plugin so command
8
+ * discovery works from any scope; the `*.impl.consumer.ts` implementations
9
+ * (which read host disks and lockfiles) live only here, because a runtime
10
+ * `scope` tag stops runtime resolution but not static bundler traversal —
11
+ * inline loaders would ship the CLI implementations into Worker/browser
12
+ * bundles.
13
+ */
14
+ export const securityCliPlugin = createRuntimePlugin({
15
+ id: 'security.cli',
16
+ name: 'Security — Shield CLI',
17
+ description: 'Shield dependency command implementations (shield.deps.scan, shield.deps.gate). Compose beside the universal security plugin on CLI hosts; Worker and browser bundles never import this slice.',
18
+ dependencies: ['security'],
19
+ loaders: [
20
+ loader('shield.deps.scan', { kind: 'cli/command', scope: 'consumer' }, () => import("./shield.deps.scan.impl.consumer.js")),
21
+ loader('shield.deps.gate', { kind: 'cli/command', scope: 'consumer' }, () => import("./shield.deps.gate.impl.consumer.js")),
22
+ ],
23
+ });
24
+ export default securityCliPlugin;
25
+ //# sourceMappingURL=plugin.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"plugin.js","sourceRoot":"","sources":["../../src/cli/plugin.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,EAAE,MAAM,6BAA6B,CAAC;AAE1E;;;;;;;;;;;GAWG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAAG,mBAAmB,CAAC;IACpD,EAAE,EAAE,cAAc;IAClB,IAAI,EAAE,uBAAuB;IAC7B,WAAW,EACV,gMAAgM;IACjM,YAAY,EAAE,CAAC,UAAU,CAAC;IAC1B,OAAO,EAAE;QACR,MAAM,CAAC,kBAAkB,EAAE,EAAE,IAAI,EAAE,aAAa,EAAE,KAAK,EAAE,UAAU,EAAE,EAAE,GAAG,EAAE,CAC3E,MAAM,CAAC,qCAAqC,CAAC,CAC7C;QACD,MAAM,CAAC,kBAAkB,EAAE,EAAE,IAAI,EAAE,aAAa,EAAE,KAAK,EAAE,UAAU,EAAE,EAAE,GAAG,EAAE,CAC3E,MAAM,CAAC,qCAAqC,CAAC,CAC7C;KACD;CACD,CAAC,CAAC;AAEH,eAAe,iBAAiB,CAAC"}
@@ -0,0 +1,4 @@
1
+ import { type RuntimeRef } from '@vibesdotdev/kernel';
2
+ /** The text of the lockfile at `path`, read through the runtime's host-disk adapter. */
3
+ export declare function readLockfile(runtime: RuntimeRef, path: string): Promise<string>;
4
+ //# sourceMappingURL=read-lockfile.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"read-lockfile.d.ts","sourceRoot":"","sources":["../../src/cli/read-lockfile.ts"],"names":[],"mappings":"AAkBA,OAAO,EAIN,KAAK,UAAU,EACf,MAAM,qBAAqB,CAAC;AA+B7B,wFAAwF;AACxF,wBAAsB,YAAY,CAAC,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAsBrF"}
@@ -0,0 +1,74 @@
1
+ import { FileSystemAdapterDescriptorSchema } from '@vibesdotdev/filesystem';
2
+ /**
3
+ * Read the lockfile a `shield deps` command was pointed at, through the
4
+ * runtime's host-disk `filesystem/adapter`.
5
+ *
6
+ * The filesystem owner validates its descriptors and resolves the adapter. The
7
+ * adapter chosen is an enabled, non-cloud adapter that can read: the disk the
8
+ * user's path lives on. A relative path resolves as the host resolves it.
9
+ *
10
+ * Every failure is a typed `CapabilityError` carrying its cause:
11
+ * - no such adapter, or one that does not load:
12
+ * UNAVAILABLE `shield-filesystem-unavailable`;
13
+ * - the file is absent: NOT_FOUND `shield-lockfile-missing`;
14
+ * - any other read failure (an adapter without `readFile` included):
15
+ * UNAVAILABLE `shield-lockfile-unreadable`.
16
+ */
17
+ import * as z from 'zod/v4';
18
+ import { CapabilityError, CaughtFailureSchema } from '@vibesdotdev/kernel';
19
+ const ErrnoSchema = z.object({ code: z.string() });
20
+ /** A caught failure that carries an errno code (`ENOENT`, `EACCES`, …). */
21
+ function hasErrnoCode(failure) {
22
+ return failure instanceof Error && ErrnoSchema.safeParse(failure).success;
23
+ }
24
+ function filesystemUnavailable(message, cause) {
25
+ return new CapabilityError(message, 'UNAVAILABLE', {
26
+ reason: 'shield-filesystem-unavailable',
27
+ retryable: false,
28
+ cause
29
+ });
30
+ }
31
+ async function resolveReader(runtime) {
32
+ if (!runtime.hasKind('filesystem/adapter'))
33
+ throw filesystemUnavailable('No filesystem adapter is registered.');
34
+ const query = runtime.query('filesystem/adapter')
35
+ .enabled()
36
+ .filter(descriptor => {
37
+ const parsed = FileSystemAdapterDescriptorSchema.parse(descriptor);
38
+ return parsed.cloudNative !== true && parsed.capabilities.includes('read');
39
+ });
40
+ if (query.descriptors().length === 0)
41
+ throw filesystemUnavailable('No readable host-disk filesystem adapter is registered.');
42
+ try {
43
+ return await query.resolve();
44
+ }
45
+ catch (error) {
46
+ throw filesystemUnavailable('The host-disk filesystem adapter did not load.', CaughtFailureSchema.parse(error));
47
+ }
48
+ }
49
+ /** The text of the lockfile at `path`, read through the runtime's host-disk adapter. */
50
+ export async function readLockfile(runtime, path) {
51
+ const reader = await resolveReader(runtime);
52
+ let content;
53
+ try {
54
+ content = await reader.readFile(path, 'utf8');
55
+ }
56
+ catch (error) {
57
+ const failure = CaughtFailureSchema.parse(error);
58
+ if (hasErrnoCode(failure) && failure.code === 'ENOENT') {
59
+ throw new CapabilityError(`The lockfile ${path} does not exist.`, 'NOT_FOUND', {
60
+ reason: 'shield-lockfile-missing',
61
+ details: { path },
62
+ cause: failure
63
+ });
64
+ }
65
+ throw new CapabilityError(`The lockfile ${path} could not be read.`, 'UNAVAILABLE', {
66
+ reason: 'shield-lockfile-unreadable',
67
+ retryable: false,
68
+ details: { path, code: hasErrnoCode(failure) ? failure.code : null },
69
+ cause: failure
70
+ });
71
+ }
72
+ return content instanceof Uint8Array ? new TextDecoder().decode(content) : content;
73
+ }
74
+ //# sourceMappingURL=read-lockfile.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"read-lockfile.js","sourceRoot":"","sources":["../../src/cli/read-lockfile.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iCAAiC,EAAqE,MAAM,yBAAyB,CAAC;AAC/I;;;;;;;;;;;;;;GAcG;AAEH,OAAO,KAAK,CAAC,MAAM,QAAQ,CAAC;AAC5B,OAAO,EACN,eAAe,EACf,mBAAmB,EAGnB,MAAM,qBAAqB,CAAC;AAE7B,MAAM,WAAW,GAAG,CAAC,CAAC,MAAM,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC;AAEnD,2EAA2E;AAC3E,SAAS,YAAY,CAAC,OAAsB;IAC3C,OAAO,OAAO,YAAY,KAAK,IAAI,WAAW,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC,OAAO,CAAC;AAC3E,CAAC;AAED,SAAS,qBAAqB,CAAC,OAAe,EAAE,KAAqB;IACpE,OAAO,IAAI,eAAe,CAAC,OAAO,EAAE,aAAa,EAAE;QAClD,MAAM,EAAE,+BAA+B;QACvC,SAAS,EAAE,KAAK;QAChB,KAAK;KACL,CAAC,CAAC;AACJ,CAAC;AAED,KAAK,UAAU,aAAa,CAAC,OAAmB;IAC/C,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,oBAAoB,CAAC;QAAE,MAAM,qBAAqB,CAAC,sCAAsC,CAAC,CAAC;IAChH,MAAM,KAAK,GAAG,OAAO,CAAC,KAAK,CAA0D,oBAAoB,CAAC;SACxG,OAAO,EAAE;SACT,MAAM,CAAC,UAAU,CAAC,EAAE;QACpB,MAAM,MAAM,GAAG,iCAAiC,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC;QACnE,OAAO,MAAM,CAAC,WAAW,KAAK,IAAI,IAAI,MAAM,CAAC,YAAY,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;IAC5E,CAAC,CAAC,CAAC;IACJ,IAAI,KAAK,CAAC,WAAW,EAAE,CAAC,MAAM,KAAK,CAAC;QAAE,MAAM,qBAAqB,CAAC,yDAAyD,CAAC,CAAC;IAC7H,IAAI,CAAC;QAAC,OAAO,MAAM,KAAK,CAAC,OAAO,EAAE,CAAC;IAAC,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACpD,MAAM,qBAAqB,CAAC,gDAAgD,EAAE,mBAAmB,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC;IACjH,CAAC;AACF,CAAC;AAED,wFAAwF;AACxF,MAAM,CAAC,KAAK,UAAU,YAAY,CAAC,OAAmB,EAAE,IAAY;IACnE,MAAM,MAAM,GAAG,MAAM,aAAa,CAAC,OAAO,CAAC,CAAC;IAC5C,IAAI,OAA4B,CAAC;IACjC,IAAI,CAAC;QACJ,OAAO,GAAG,MAAM,MAAM,CAAC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;IAC/C,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QAChB,MAAM,OAAO,GAAG,mBAAmB,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;QACjD,IAAI,YAAY,CAAC,OAAO,CAAC,IAAI,OAAO,CAAC,IAAI,KAAK,QAAQ,EAAE,CAAC;YACxD,MAAM,IAAI,eAAe,CAAC,gBAAgB,IAAI,kBAAkB,EAAE,WAAW,EAAE;gBAC9E,MAAM,EAAE,yBAAyB;gBACjC,OAAO,EAAE,EAAE,IAAI,EAAE;gBACjB,KAAK,EAAE,OAAO;aACd,CAAC,CAAC;QACJ,CAAC;QACD,MAAM,IAAI,eAAe,CAAC,gBAAgB,IAAI,qBAAqB,EAAE,aAAa,EAAE;YACnF,MAAM,EAAE,4BAA4B;YACpC,SAAS,EAAE,KAAK;YAChB,OAAO,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE,YAAY,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,EAAE;YACpE,KAAK,EAAE,OAAO;SACd,CAAC,CAAC;IACJ,CAAC;IACD,OAAO,OAAO,YAAY,UAAU,CAAC,CAAC,CAAC,IAAI,WAAW,EAAE,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC;AACpF,CAAC"}
@@ -0,0 +1,20 @@
1
+ /**
2
+ * Where `shield deps` puts its output.
3
+ *
4
+ * Both the report and the diagnostics go through the runtime's host text
5
+ * output (`runtime/stdio`), so a command run under a host that captures or
6
+ * redirects output gets all of it, and the command impls carry no `process.*`
7
+ * of their own. The report is the invocation's one JSON document, written with
8
+ * `writeJson` so the CLI surface can tell that it has been emitted.
9
+ *
10
+ * A host that offers no text output refuses `UNAVAILABLE` `stdio-unavailable`,
11
+ * and that refusal is allowed to surface: a command that cannot report anything
12
+ * has not succeeded quietly, it has failed where it can be seen.
13
+ */
14
+ import { type RuntimeRef } from '@vibesdotdev/kernel';
15
+ import { type DepScanReport } from '../kinds/dep-scanner.kind.ts';
16
+ /** Write the `DepScanReport` as the invocation's JSON document on stdout. */
17
+ export declare function writeDepScanReport(runtime: RuntimeRef, report: DepScanReport): Promise<DepScanReport>;
18
+ /** Write one diagnostic line on the runtime's stderr. */
19
+ export declare function writeDiagnostic(runtime: RuntimeRef, message: string): Promise<void>;
20
+ //# sourceMappingURL=report-output.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"report-output.d.ts","sourceRoot":"","sources":["../../src/cli/report-output.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AACH,OAAO,EAAmB,KAAK,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAEvE,OAAO,EAAuB,KAAK,aAAa,EAAE,MAAM,8BAA8B,CAAC;AAEvF,6EAA6E;AAC7E,wBAAsB,kBAAkB,CAAC,OAAO,EAAE,UAAU,EAAE,MAAM,EAAE,aAAa,GAAG,OAAO,CAAC,aAAa,CAAC,CAI3G;AAED,yDAAyD;AACzD,wBAAsB,eAAe,CAAC,OAAO,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAEzF"}
@@ -0,0 +1,27 @@
1
+ /**
2
+ * Where `shield deps` puts its output.
3
+ *
4
+ * Both the report and the diagnostics go through the runtime's host text
5
+ * output (`runtime/stdio`), so a command run under a host that captures or
6
+ * redirects output gets all of it, and the command impls carry no `process.*`
7
+ * of their own. The report is the invocation's one JSON document, written with
8
+ * `writeJson` so the CLI surface can tell that it has been emitted.
9
+ *
10
+ * A host that offers no text output refuses `UNAVAILABLE` `stdio-unavailable`,
11
+ * and that refusal is allowed to surface: a command that cannot report anything
12
+ * has not succeeded quietly, it has failed where it can be seen.
13
+ */
14
+ import { getRuntimeStdio } from '@vibesdotdev/kernel';
15
+ import { writeJson } from '@vibesdotdev/cli/output';
16
+ import { DepScanReportSchema } from "../kinds/dep-scanner.kind.js";
17
+ /** Write the `DepScanReport` as the invocation's JSON document on stdout. */
18
+ export async function writeDepScanReport(runtime, report) {
19
+ const parsed = DepScanReportSchema.parse(report);
20
+ await writeJson(runtime, parsed, { pretty: true });
21
+ return parsed;
22
+ }
23
+ /** Write one diagnostic line on the runtime's stderr. */
24
+ export async function writeDiagnostic(runtime, message) {
25
+ (await getRuntimeStdio(runtime)).write('stderr', `${message}\n`);
26
+ }
27
+ //# sourceMappingURL=report-output.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"report-output.js","sourceRoot":"","sources":["../../src/cli/report-output.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AACH,OAAO,EAAE,eAAe,EAAmB,MAAM,qBAAqB,CAAC;AACvE,OAAO,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AACpD,OAAO,EAAE,mBAAmB,EAAsB,MAAM,8BAA8B,CAAC;AAEvF,6EAA6E;AAC7E,MAAM,CAAC,KAAK,UAAU,kBAAkB,CAAC,OAAmB,EAAE,MAAqB;IAClF,MAAM,MAAM,GAAG,mBAAmB,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;IACjD,MAAM,SAAS,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC;IACnD,OAAO,MAAM,CAAC;AACf,CAAC;AAED,yDAAyD;AACzD,MAAM,CAAC,KAAK,UAAU,eAAe,CAAC,OAAmB,EAAE,OAAe;IACzE,CAAC,MAAM,eAAe,CAAC,OAAO,CAAC,CAAC,CAAC,KAAK,CAAC,QAAQ,EAAE,GAAG,OAAO,IAAI,CAAC,CAAC;AAClE,CAAC"}
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Shield CLI Group Descriptor
3
+ *
4
+ * Root group for the `shield` command suite bundled by apps/shield-cli.
5
+ */
6
+ import type { CLIGroupAssetDescriptor } from '../implementations/cli-types.ts';
7
+ declare const descriptor: CLIGroupAssetDescriptor;
8
+ export default descriptor;
9
+ //# sourceMappingURL=shield.cli-group.descriptor.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"shield.cli-group.descriptor.d.ts","sourceRoot":"","sources":["../../src/cli/shield.cli-group.descriptor.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,iCAAiC,CAAC;AAE/E,QAAA,MAAM,UAAU,EAAE,uBAQjB,CAAC;AAEF,eAAe,UAAU,CAAC"}
@@ -0,0 +1,16 @@
1
+ /**
2
+ * Shield CLI Group Descriptor
3
+ *
4
+ * Root group for the `shield` command suite bundled by apps/shield-cli.
5
+ */
6
+ const descriptor = {
7
+ kind: 'cli/group',
8
+ id: 'shield',
9
+ name: 'shield',
10
+ description: 'Security shield — dependency scanning and policy gates',
11
+ surfaces: ['cli'],
12
+ hardware: ['consumer'],
13
+ enabled: true,
14
+ };
15
+ export default descriptor;
16
+ //# sourceMappingURL=shield.cli-group.descriptor.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"shield.cli-group.descriptor.js","sourceRoot":"","sources":["../../src/cli/shield.cli-group.descriptor.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAIH,MAAM,UAAU,GAA4B;IAC3C,IAAI,EAAE,WAAW;IACjB,EAAE,EAAE,QAAQ;IACZ,IAAI,EAAE,QAAQ;IACd,WAAW,EAAE,wDAAwD;IACrE,QAAQ,EAAE,CAAC,KAAK,CAAC;IACjB,QAAQ,EAAE,CAAC,UAAU,CAAC;IACtB,OAAO,EAAE,IAAI;CACb,CAAC;AAEF,eAAe,UAAU,CAAC"}
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Shield Deps CLI Group Descriptor
3
+ *
4
+ * Subgroup for dependency-scanning commands (`shield deps scan|gate`).
5
+ */
6
+ import type { CLIGroupAssetDescriptor } from '../implementations/cli-types.ts';
7
+ declare const descriptor: CLIGroupAssetDescriptor;
8
+ export default descriptor;
9
+ //# sourceMappingURL=shield.deps.cli-group.descriptor.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"shield.deps.cli-group.descriptor.d.ts","sourceRoot":"","sources":["../../src/cli/shield.deps.cli-group.descriptor.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,iCAAiC,CAAC;AAE/E,QAAA,MAAM,UAAU,EAAE,uBASjB,CAAC;AAEF,eAAe,UAAU,CAAC"}
@@ -0,0 +1,17 @@
1
+ /**
2
+ * Shield Deps CLI Group Descriptor
3
+ *
4
+ * Subgroup for dependency-scanning commands (`shield deps scan|gate`).
5
+ */
6
+ const descriptor = {
7
+ kind: 'cli/group',
8
+ id: 'shield.deps',
9
+ name: 'deps',
10
+ description: 'Scan and gate dependencies against known compromises',
11
+ parent: 'shield',
12
+ surfaces: ['cli'],
13
+ hardware: ['consumer'],
14
+ enabled: true,
15
+ };
16
+ export default descriptor;
17
+ //# sourceMappingURL=shield.deps.cli-group.descriptor.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"shield.deps.cli-group.descriptor.js","sourceRoot":"","sources":["../../src/cli/shield.deps.cli-group.descriptor.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAIH,MAAM,UAAU,GAA4B;IAC3C,IAAI,EAAE,WAAW;IACjB,EAAE,EAAE,aAAa;IACjB,IAAI,EAAE,MAAM;IACZ,WAAW,EAAE,sDAAsD;IACnE,MAAM,EAAE,QAAQ;IAChB,QAAQ,EAAE,CAAC,KAAK,CAAC;IACjB,QAAQ,EAAE,CAAC,UAAU,CAAC;IACtB,OAAO,EAAE,IAAI;CACb,CAAC;AAEF,eAAe,UAAU,CAAC"}
@@ -0,0 +1,10 @@
1
+ /**
2
+ * Shield Deps Gate CLI Command Descriptor
3
+ *
4
+ * `shield deps gate <path>` — scan a lockfile and exit non-zero unless the
5
+ * verdict is `clean` (for use in CI gates).
6
+ */
7
+ import type { CLICommandAssetDescriptor } from '../implementations/cli-types.ts';
8
+ declare const descriptor: CLICommandAssetDescriptor;
9
+ export default descriptor;
10
+ //# sourceMappingURL=shield.deps.gate.descriptor.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"shield.deps.gate.descriptor.d.ts","sourceRoot":"","sources":["../../src/cli/shield.deps.gate.descriptor.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,iCAAiC,CAAC;AAEjF,QAAA,MAAM,UAAU,EAAE,yBAkBjB,CAAC;AAEF,eAAe,UAAU,CAAC"}
@@ -0,0 +1,25 @@
1
+ /**
2
+ * Shield Deps Gate CLI Command Descriptor
3
+ *
4
+ * `shield deps gate <path>` — scan a lockfile and exit non-zero unless the
5
+ * verdict is `clean` (for use in CI gates).
6
+ */
7
+ const descriptor = {
8
+ kind: 'cli/command',
9
+ id: 'shield.deps.gate',
10
+ name: 'gate',
11
+ description: 'Exit non-zero if a scan finds compromise or stale versions',
12
+ group: 'shield.deps',
13
+ arguments: [
14
+ {
15
+ name: 'path',
16
+ description: 'Path to the lockfile / dependency manifest to scan',
17
+ required: true,
18
+ },
19
+ ],
20
+ surfaces: ['cli'],
21
+ hardware: ['consumer'],
22
+ enabled: true,
23
+ };
24
+ export default descriptor;
25
+ //# sourceMappingURL=shield.deps.gate.descriptor.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"shield.deps.gate.descriptor.js","sourceRoot":"","sources":["../../src/cli/shield.deps.gate.descriptor.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAIH,MAAM,UAAU,GAA8B;IAC7C,IAAI,EAAE,aAAa;IACnB,EAAE,EAAE,kBAAkB;IACtB,IAAI,EAAE,MAAM;IACZ,WAAW,EAAE,4DAA4D;IACzE,KAAK,EAAE,aAAa;IAEpB,SAAS,EAAE;QACV;YACC,IAAI,EAAE,MAAM;YACZ,WAAW,EAAE,oDAAoD;YACjE,QAAQ,EAAE,IAAI;SACd;KACD;IAED,QAAQ,EAAE,CAAC,KAAK,CAAC;IACjB,QAAQ,EAAE,CAAC,UAAU,CAAC;IACtB,OAAO,EAAE,IAAI;CACb,CAAC;AAEF,eAAe,UAAU,CAAC"}
@@ -0,0 +1,18 @@
1
+ /**
2
+ * Shield Deps Gate CLI Command Implementation (consumer)
3
+ *
4
+ * Resolves the registered `security/dep-scanner` service, scans the given
5
+ * lockfile, and exits non-zero unless the verdict is `clean`. Suitable as a
6
+ * CI gate — a `compromised` or `unknown` verdict fails the build.
7
+ *
8
+ * The JSON report is always written before the exit is requested, so the CLI
9
+ * surface can drain it: a hard `process.exit` truncated reports in CI. Output
10
+ * goes through the handed runtime's host text output (see
11
+ * `./report-output.ts`).
12
+ */
13
+ import type { CommandContext } from '@vibesdotdev/cli';
14
+ declare const _default: {
15
+ execute(args: Record<string, string | boolean | undefined>, opts: Record<string, string | boolean | undefined>, context: Pick<CommandContext, "runtime">): Promise<void>;
16
+ };
17
+ export default _default;
18
+ //# sourceMappingURL=shield.deps.gate.impl.consumer.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"shield.deps.gate.impl.consumer.d.ts","sourceRoot":"","sources":["../../src/cli/shield.deps.gate.impl.consumer.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAIH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;;kBAMlC,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,GAAG,SAAS,CAAC,QAAQ,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,GAAG,SAAS,CAAC,WAAW,IAAI,CAAC,cAAc,EAAE,SAAS,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC;;AAD/K,wBA2BE"}
@@ -0,0 +1,42 @@
1
+ /**
2
+ * Shield Deps Gate CLI Command Implementation (consumer)
3
+ *
4
+ * Resolves the registered `security/dep-scanner` service, scans the given
5
+ * lockfile, and exits non-zero unless the verdict is `clean`. Suitable as a
6
+ * CI gate — a `compromised` or `unknown` verdict fails the build.
7
+ *
8
+ * The JSON report is always written before the exit is requested, so the CLI
9
+ * surface can drain it: a hard `process.exit` truncated reports in CI. Output
10
+ * goes through the handed runtime's host text output (see
11
+ * `./report-output.ts`).
12
+ */
13
+ import * as z from 'zod/v4';
14
+ import { requestCLIExit } from '@vibesdotdev/cli/providers';
15
+ import { readLockfile } from "./read-lockfile.js";
16
+ import { writeDepScanReport, writeDiagnostic } from "./report-output.js";
17
+ export default {
18
+ async execute(args, opts, context) {
19
+ const parsedPath = z.string().min(1).safeParse(args.path);
20
+ const { runtime } = context;
21
+ if (!parsedPath.success) {
22
+ await writeDiagnostic(runtime, 'shield deps gate: missing required <path> argument');
23
+ requestCLIExit(2);
24
+ return;
25
+ }
26
+ const path = parsedPath.data;
27
+ if (!runtime.hasKind('security/dep-scanner') || runtime.query('security/dep-scanner').enabled().descriptors().length === 0) {
28
+ await writeDiagnostic(runtime, 'shield deps gate: no dep scanner registered');
29
+ requestCLIExit(2);
30
+ return;
31
+ }
32
+ const scanner = await runtime.query('security/dep-scanner').enabled().resolve();
33
+ const manifest = await readLockfile(runtime, path);
34
+ const report = await writeDepScanReport(runtime, await scanner.scan(manifest));
35
+ if (report.verdict !== 'clean') {
36
+ await writeDiagnostic(runtime, `shield deps gate: verdict='${report.verdict}' — gate failed`);
37
+ requestCLIExit(1);
38
+ }
39
+ // Clean: return normally (exit 0) so the JSON report fully drains.
40
+ },
41
+ };
42
+ //# sourceMappingURL=shield.deps.gate.impl.consumer.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"shield.deps.gate.impl.consumer.js","sourceRoot":"","sources":["../../src/cli/shield.deps.gate.impl.consumer.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,KAAK,CAAC,MAAM,QAAQ,CAAC;AAC5B,OAAO,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AAE5D,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAE,kBAAkB,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAGzE,eAAe;IACd,KAAK,CAAC,OAAO,CAAC,IAAkD,EAAE,IAAkD,EAAE,OAAwC;QAC7J,MAAM,UAAU,GAAG,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAC1D,MAAM,EAAE,OAAO,EAAE,GAAG,OAAO,CAAC;QAC5B,IAAI,CAAC,UAAU,CAAC,OAAO,EAAE,CAAC;YACzB,MAAM,eAAe,CAAC,OAAO,EAAE,oDAAoD,CAAC,CAAC;YACrF,cAAc,CAAC,CAAC,CAAC,CAAC;YAClB,OAAO;QACR,CAAC;QACD,MAAM,IAAI,GAAG,UAAU,CAAC,IAAI,CAAC;QAE7B,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,sBAAsB,CAAC,IAAI,OAAO,CAAC,KAAK,CAAC,sBAAsB,CAAC,CAAC,OAAO,EAAE,CAAC,WAAW,EAAE,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;YAC5H,MAAM,eAAe,CAAC,OAAO,EAAE,6CAA6C,CAAC,CAAC;YAC9E,cAAc,CAAC,CAAC,CAAC,CAAC;YAClB,OAAO;QACR,CAAC;QAED,MAAM,OAAO,GAAG,MAAM,OAAO,CAAC,KAAK,CAA0C,sBAAsB,CAAC,CAAC,OAAO,EAAE,CAAC,OAAO,EAAE,CAAC;QACzH,MAAM,QAAQ,GAAG,MAAM,YAAY,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC;QACnD,MAAM,MAAM,GAAG,MAAM,kBAAkB,CAAC,OAAO,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC;QAE/E,IAAI,MAAM,CAAC,OAAO,KAAK,OAAO,EAAE,CAAC;YAChC,MAAM,eAAe,CAAC,OAAO,EAAE,8BAA8B,MAAM,CAAC,OAAO,iBAAiB,CAAC,CAAC;YAC9F,cAAc,CAAC,CAAC,CAAC,CAAC;QACnB,CAAC;QACD,mEAAmE;IACpE,CAAC;CACD,CAAC"}
@@ -0,0 +1,10 @@
1
+ /**
2
+ * Shield Deps Scan CLI Command Descriptor
3
+ *
4
+ * `shield deps scan <path>` — scan a lockfile for compromised dependencies
5
+ * and emit the DepScanReport as JSON.
6
+ */
7
+ import type { CLICommandAssetDescriptor } from '../implementations/cli-types.ts';
8
+ declare const descriptor: CLICommandAssetDescriptor;
9
+ export default descriptor;
10
+ //# sourceMappingURL=shield.deps.scan.descriptor.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"shield.deps.scan.descriptor.d.ts","sourceRoot":"","sources":["../../src/cli/shield.deps.scan.descriptor.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,iCAAiC,CAAC;AAEjF,QAAA,MAAM,UAAU,EAAE,yBAkBjB,CAAC;AAEF,eAAe,UAAU,CAAC"}
@@ -0,0 +1,25 @@
1
+ /**
2
+ * Shield Deps Scan CLI Command Descriptor
3
+ *
4
+ * `shield deps scan <path>` — scan a lockfile for compromised dependencies
5
+ * and emit the DepScanReport as JSON.
6
+ */
7
+ const descriptor = {
8
+ kind: 'cli/command',
9
+ id: 'shield.deps.scan',
10
+ name: 'scan',
11
+ description: 'Scan a lockfile for compromised dependencies',
12
+ group: 'shield.deps',
13
+ arguments: [
14
+ {
15
+ name: 'path',
16
+ description: 'Path to the lockfile / dependency manifest to scan',
17
+ required: true,
18
+ },
19
+ ],
20
+ surfaces: ['cli'],
21
+ hardware: ['consumer'],
22
+ enabled: true,
23
+ };
24
+ export default descriptor;
25
+ //# sourceMappingURL=shield.deps.scan.descriptor.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"shield.deps.scan.descriptor.js","sourceRoot":"","sources":["../../src/cli/shield.deps.scan.descriptor.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAIH,MAAM,UAAU,GAA8B;IAC7C,IAAI,EAAE,aAAa;IACnB,EAAE,EAAE,kBAAkB;IACtB,IAAI,EAAE,MAAM;IACZ,WAAW,EAAE,8CAA8C;IAC3D,KAAK,EAAE,aAAa;IAEpB,SAAS,EAAE;QACV;YACC,IAAI,EAAE,MAAM;YACZ,WAAW,EAAE,oDAAoD;YACjE,QAAQ,EAAE,IAAI;SACd;KACD;IAED,QAAQ,EAAE,CAAC,KAAK,CAAC;IACjB,QAAQ,EAAE,CAAC,UAAU,CAAC;IACtB,OAAO,EAAE,IAAI;CACb,CAAC;AAEF,eAAe,UAAU,CAAC"}
@@ -0,0 +1,16 @@
1
+ /**
2
+ * Shield Deps Scan CLI Command Implementation (consumer)
3
+ *
4
+ * Resolves the registered `security/dep-scanner` service, scans the given
5
+ * lockfile, and prints the DepScanReport as JSON.
6
+ *
7
+ * Output and diagnostics go through the handed runtime's host text output (see
8
+ * `./report-output.ts`), and the exit code is requested rather than taken, so a
9
+ * CI gate's stdout is never truncated.
10
+ */
11
+ import type { CommandContext } from '@vibesdotdev/cli';
12
+ declare const _default: {
13
+ execute(args: Record<string, string | boolean | undefined>, opts: Record<string, string | boolean | undefined>, context: Pick<CommandContext, "runtime">): Promise<void>;
14
+ };
15
+ export default _default;
16
+ //# sourceMappingURL=shield.deps.scan.impl.consumer.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"shield.deps.scan.impl.consumer.d.ts","sourceRoot":"","sources":["../../src/cli/shield.deps.scan.impl.consumer.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAIH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;;kBAMlC,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,GAAG,SAAS,CAAC,QAAQ,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,GAAG,SAAS,CAAC,WAAW,IAAI,CAAC,cAAc,EAAE,SAAS,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC;;AAD/K,wBAqBE"}