@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
@@ -0,0 +1,54 @@
1
+ import { AuditEventSchema, AuditQueryOptionsSchema } from "../schemas/AuditEvent.js";
2
+ import { CapabilityError } from '@vibesdotdev/kernel';
3
+ import { BaseRuntimeClient } from '@vibesdotdev/kernel/client';
4
+ /**
5
+ * The semantic security client: audit emission and querying through the
6
+ * runtime-selected `security/auditor`.
7
+ *
8
+ * The client owns no audit state and no second store — every operation
9
+ * resolves the selected auditor through `runtime.query('security/auditor')`,
10
+ * so descriptor selection, the in-memory default and composed sinks keep
11
+ * their existing ownership. Resolve it through the kernel client owner:
12
+ *
13
+ * ```ts
14
+ * import { getVibesClient } from '@vibesdotdev/kernel/client';
15
+ * const security = await getVibesClient<SecurityClient>('security', runtime);
16
+ * await security.emit(event);
17
+ * const events = await security.queryAuditEvents({ actor: 'agent' });
18
+ * ```
19
+ *
20
+ * Absence is a typed refusal, not a silent skip: when no auditor is
21
+ * registered, `emit` and `queryAuditEvents` fail with CapabilityError code
22
+ * `UNAVAILABLE` and reason `security-auditor-unavailable`.
23
+ */
24
+ export class SecurityClient extends BaseRuntimeClient {
25
+ constructor(descriptor = { id: 'security', kind: 'runtime/client' }, context, runtime) {
26
+ super(descriptor, context, runtime);
27
+ }
28
+ async auditor() {
29
+ const selected = await this.runtime
30
+ .query('security/auditor')
31
+ .enabled()
32
+ .select();
33
+ if (!selected) {
34
+ throw new CapabilityError('No security auditor is registered.', 'UNAVAILABLE', {
35
+ reason: 'security-auditor-unavailable'
36
+ });
37
+ }
38
+ return selected.impl;
39
+ }
40
+ /** Record one audit event with the selected security/auditor. */
41
+ async emit(event) {
42
+ const admitted = AuditEventSchema.parse(event);
43
+ const auditor = await this.auditor();
44
+ await auditor.emit(admitted);
45
+ }
46
+ /** Query recorded audit events with the selected security/auditor. */
47
+ async queryAuditEvents(options = {}) {
48
+ const admitted = AuditQueryOptionsSchema.parse(options);
49
+ const auditor = await this.auditor();
50
+ return auditor.query(admitted);
51
+ }
52
+ }
53
+ export default SecurityClient;
54
+ //# sourceMappingURL=security-client.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"security-client.js","sourceRoot":"","sources":["../../src/security-client/security-client.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,uBAAuB,EAAE,MAAM,0BAA0B,CAAC;AACrF,OAAO,EAAE,eAAe,EAAqB,MAAM,qBAAqB,CAAC;AACzE,OAAO,EAAE,iBAAiB,EAAgC,MAAM,4BAA4B,CAAC;AAS7F;;;;;;;;;;;;;;;;;;;GAmBG;AACH,MAAM,OAAO,cAAe,SAAQ,iBAAiB;IACpD,YACC,aAAsC,EAAE,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE,gBAAgB,EAAE,EAChF,OAAqB,EACrB,OAAsB;QAEtB,KAAK,CAAC,UAAU,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC;IACrC,CAAC;IAEO,KAAK,CAAC,OAAO;QACpB,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,OAAO;aACjC,KAAK,CAAoD,kBAAkB,CAAC;aAC5E,OAAO,EAAE;aACT,MAAM,EAAE,CAAC;QAEX,IAAI,CAAC,QAAQ,EAAE,CAAC;YACf,MAAM,IAAI,eAAe,CAAC,oCAAoC,EAAE,aAAa,EAAE;gBAC9E,MAAM,EAAE,8BAA8B;aACtC,CAAC,CAAC;QACJ,CAAC;QAED,OAAO,QAAQ,CAAC,IAAI,CAAC;IACtB,CAAC;IAED,iEAAiE;IACjE,KAAK,CAAC,IAAI,CAAC,KAAiB;QAC3B,MAAM,QAAQ,GAAG,gBAAgB,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;QAC/C,MAAM,OAAO,GAAG,MAAM,IAAI,CAAC,OAAO,EAAE,CAAC;QACrC,MAAM,OAAO,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;IAC9B,CAAC;IAED,sEAAsE;IACtE,KAAK,CAAC,gBAAgB,CAAC,UAA6B,EAAE;QACrD,MAAM,QAAQ,GAAG,uBAAuB,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;QACxD,MAAM,OAAO,GAAG,MAAM,IAAI,CAAC,OAAO,EAAE,CAAC;QACrC,OAAO,OAAO,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC;IAChC,CAAC;CACD;AAED,eAAe,cAAc,CAAC"}
@@ -0,0 +1,3 @@
1
+ export declare const securityConsumerPlugin: import("@vibesdotdev/kernel").RuntimePlugin;
2
+ export default securityConsumerPlugin;
3
+ //# sourceMappingURL=security.consumer.plugin.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"security.consumer.plugin.d.ts","sourceRoot":"","sources":["../src/security.consumer.plugin.ts"],"names":[],"mappings":"AAgBA,eAAO,MAAM,sBAAsB,6CAoBjC,CAAC;AAEH,eAAe,sBAAsB,CAAC"}
@@ -0,0 +1,28 @@
1
+ import { createRuntimePlugin, loader } from '@vibesdotdev/kernel/factory';
2
+ /**
3
+ * The security consumer plugin: the four AI tool implementations
4
+ * (`security.scan-input`, `security.redact-output`, `security.check-policy`,
5
+ * `security.report-event`) as `tools/tool` loaders.
6
+ *
7
+ * Compose this beside `securityPlugin` (from `@vibesdotdev/security/plugin`)
8
+ * on consumer surfaces that expose the Tools owner. It must never be imported
9
+ * by the universal plugin: a runtime `scope` tag stops runtime resolution but
10
+ * not static bundler traversal, so an inline consumer loader would ship this
11
+ * code into every cloud Worker and browser bundle that composes security.
12
+ * Cloud and browser hosts compose the universal plugin alone.
13
+ */
14
+ const SECURITY_TOOL_CONSUMER = { kind: 'tools/tool', scope: 'consumer' };
15
+ export const securityConsumerPlugin = createRuntimePlugin({
16
+ id: 'security.consumer',
17
+ name: 'Security — consumer tools',
18
+ description: 'Consumer-scope implementations for the four security AI tools. Compose beside the universal security plugin on consumer surfaces; cloud and browser bundles never import this slice.',
19
+ dependencies: ['security'],
20
+ loaders: [
21
+ loader('security.scan-input', SECURITY_TOOL_CONSUMER, () => import("./tools/scan-input/scan-input.impl.consumer.js")),
22
+ loader('security.redact-output', SECURITY_TOOL_CONSUMER, () => import("./tools/redact-output/redact-output.impl.consumer.js")),
23
+ loader('security.check-policy', SECURITY_TOOL_CONSUMER, () => import("./tools/check-policy/check-policy.impl.consumer.js")),
24
+ loader('security.report-event', SECURITY_TOOL_CONSUMER, () => import("./tools/report-event/report-event.impl.consumer.js")),
25
+ ],
26
+ });
27
+ export default securityConsumerPlugin;
28
+ //# sourceMappingURL=security.consumer.plugin.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"security.consumer.plugin.js","sourceRoot":"","sources":["../src/security.consumer.plugin.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,EAAE,MAAM,6BAA6B,CAAC;AAE1E;;;;;;;;;;;GAWG;AACH,MAAM,sBAAsB,GAAG,EAAE,IAAI,EAAE,YAAY,EAAE,KAAK,EAAE,UAAU,EAAW,CAAC;AAElF,MAAM,CAAC,MAAM,sBAAsB,GAAG,mBAAmB,CAAC;IACzD,EAAE,EAAE,mBAAmB;IACvB,IAAI,EAAE,2BAA2B;IACjC,WAAW,EACV,sLAAsL;IACvL,YAAY,EAAE,CAAC,UAAU,CAAC;IAC1B,OAAO,EAAE;QACR,MAAM,CAAC,qBAAqB,EAAE,sBAAsB,EAAE,GAAG,EAAE,CAC1D,MAAM,CAAC,gDAAgD,CAAC,CACxD;QACD,MAAM,CAAC,wBAAwB,EAAE,sBAAsB,EAAE,GAAG,EAAE,CAC7D,MAAM,CAAC,sDAAsD,CAAC,CAC9D;QACD,MAAM,CAAC,uBAAuB,EAAE,sBAAsB,EAAE,GAAG,EAAE,CAC5D,MAAM,CAAC,oDAAoD,CAAC,CAC5D;QACD,MAAM,CAAC,uBAAuB,EAAE,sBAAsB,EAAE,GAAG,EAAE,CAC5D,MAAM,CAAC,oDAAoD,CAAC,CAC5D;KACD;CACD,CAAC,CAAC;AAEH,eAAe,sBAAsB,CAAC"}
@@ -0,0 +1,16 @@
1
+ /**
2
+ * The universal security plugin: kinds, tool and Shield descriptors, the
3
+ * semantic SecurityClient and the lazy built-in scanner/redactor loaders.
4
+ *
5
+ * Scope purity: this plugin is composed into cloud workers and browsers, so it
6
+ * carries no `*.impl.consumer.*` or CLI implementation loader inline — a
7
+ * runtime `scope` tag does not stop static bundler traversal. The four
8
+ * consumer tool implementations live in `./consumer.plugin.ts`
9
+ * (`securityConsumerPlugin`), and the Shield command implementations live in
10
+ * `./cli/plugin` (`securityCliPlugin`). Hosts compose those slices for the
11
+ * surfaces their scope supports. The universal plugin does not load Svelte or
12
+ * TUI either; those are separate surface plugins.
13
+ */
14
+ export declare const securityPlugin: import("@vibesdotdev/kernel").RuntimePlugin;
15
+ export default securityPlugin;
16
+ //# sourceMappingURL=security.plugin.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"security.plugin.d.ts","sourceRoot":"","sources":["../src/security.plugin.ts"],"names":[],"mappings":"AA0CA;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,cAAc,6CAqCzB,CAAC;AAEH,eAAe,cAAc,CAAC"}
@@ -0,0 +1,78 @@
1
+ import securityDocsDescriptor from "./tools/security.docs.descriptor.js";
2
+ import { createRuntimePlugin, loader } from '@vibesdotdev/kernel/factory';
3
+ import { securityScannerKind, securityRedactorKind, securityPolicyKind, securityAuditorKind, securityDepScannerKind, securityIOCFeedKind, securityFreshnessPolicyKind, } from "./kinds/index.js";
4
+ import { scanInputDescriptor, redactOutputDescriptor, checkPolicyDescriptor, reportEventDescriptor, } from "./tools/index.js";
5
+ import shieldGroupDescriptor from "./cli/shield.cli-group.descriptor.js";
6
+ import shieldDepsGroupDescriptor from "./cli/shield.deps.cli-group.descriptor.js";
7
+ import shieldDepsScanDescriptor from "./cli/shield.deps.scan.descriptor.js";
8
+ import shieldDepsGateDescriptor from "./cli/shield.deps.gate.descriptor.js";
9
+ /**
10
+ * Built-in dep-scanner descriptor.
11
+ *
12
+ * Registered by securityPlugin so that `runtime.query('security/dep-scanner').resolve()`
13
+ * succeeds and the CLI commands in `./cli` can operate. The kind's `defaultImplementation`
14
+ * (DefaultDepScannerService) handles resolution; it returns `verdict: 'unknown'` when no
15
+ * real scanner is wired — an honest response that the gate command treats as non-clean.
16
+ *
17
+ * Migration debt: replace with a real impl (e.g. wrapping `bun audit`) once available.
18
+ */
19
+ const builtinDepScannerDescriptor = {
20
+ kind: 'security/dep-scanner',
21
+ id: 'security.dep-scanner.builtin',
22
+ name: 'Built-in Dependency Scanner (stub)',
23
+ description: 'Default dep-scanner — returns verdict:unknown until a real impl is registered.',
24
+ enabled: true,
25
+ tags: ['builtin', 'stub'],
26
+ };
27
+ /**
28
+ * The universal security plugin: kinds, tool and Shield descriptors, the
29
+ * semantic SecurityClient and the lazy built-in scanner/redactor loaders.
30
+ *
31
+ * Scope purity: this plugin is composed into cloud workers and browsers, so it
32
+ * carries no `*.impl.consumer.*` or CLI implementation loader inline — a
33
+ * runtime `scope` tag does not stop static bundler traversal. The four
34
+ * consumer tool implementations live in `./consumer.plugin.ts`
35
+ * (`securityConsumerPlugin`), and the Shield command implementations live in
36
+ * `./cli/plugin` (`securityCliPlugin`). Hosts compose those slices for the
37
+ * surfaces their scope supports. The universal plugin does not load Svelte or
38
+ * TUI either; those are separate surface plugins.
39
+ */
40
+ export const securityPlugin = createRuntimePlugin({
41
+ id: 'security',
42
+ name: 'Security',
43
+ description: 'Security domain runtime — kinds: security/scanner, security/redactor, security/policy, security/auditor, security/dep-scanner, security/ioc-feed, security/freshness-policy. Registers the semantic SecurityClient; ships AI tool descriptors; built-in scanner and redactor are lazy implementations; policies and auditors are composed by consumers. Consumer tool and Shield CLI implementations live in the ./consumer.plugin and ./cli/plugin slices.',
44
+ dependencies: [],
45
+ kinds: [securityScannerKind, securityRedactorKind, securityPolicyKind, securityAuditorKind, securityDepScannerKind, securityIOCFeedKind, securityFreshnessPolicyKind],
46
+ descriptors: [
47
+ securityDocsDescriptor,
48
+ scanInputDescriptor,
49
+ redactOutputDescriptor,
50
+ checkPolicyDescriptor,
51
+ reportEventDescriptor,
52
+ builtinDepScannerDescriptor,
53
+ { kind: 'security/scanner', id: 'security.scanner.builtin', name: 'Built-in Scanner', enabled: true },
54
+ { kind: 'security/redactor', id: 'security.redactor.builtin', name: 'Built-in Redactor', enabled: true, tags: ['builtin'] },
55
+ shieldGroupDescriptor,
56
+ shieldDepsGroupDescriptor,
57
+ shieldDepsScanDescriptor,
58
+ shieldDepsGateDescriptor,
59
+ // The runtime-owned semantic security client, resolved through the
60
+ // kernel client APIs as id `security`.
61
+ { kind: 'runtime/client', id: 'security', name: 'Security Client', description: 'Semantic security client: audit emission and querying through the selected security/auditor' }
62
+ ],
63
+ loaders: [
64
+ loader('security.scanner.builtin', { kind: 'security/scanner' }, () => import("./implementations/scanner.impl.js")),
65
+ // One built-in redactor, two hardware implementations chosen by the
66
+ // kernel's scope resolution: the in-process redactor serves every
67
+ // runtime (cloud Workers, browsers, undeclared hardware); on consumer
68
+ // hardware the more specific subprocess redactor wins, adding a
69
+ // preemptive deadline for caller-supplied patterns.
70
+ loader('security.redactor.builtin', { kind: 'security/redactor' }, () => import("./implementations/redactor.inprocess.impl.js")),
71
+ loader('security.redactor.builtin', { kind: 'security/redactor', scope: 'consumer' }, () => import("./implementations/redactor.subprocess.impl.js")),
72
+ loader('security', { kind: 'runtime/client' }, async () => ({
73
+ impl: (await import("./security-client/security-client.js")).SecurityClient
74
+ }))
75
+ ],
76
+ });
77
+ export default securityPlugin;
78
+ //# sourceMappingURL=security.plugin.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"security.plugin.js","sourceRoot":"","sources":["../src/security.plugin.ts"],"names":[],"mappings":"AAAA,OAAO,sBAAsB,MAAM,qCAAqC,CAAC;AACzE,OAAO,EAAE,mBAAmB,EAAE,MAAM,EAAE,MAAM,6BAA6B,CAAC;AAE1E,OAAO,EACN,mBAAmB,EACnB,oBAAoB,EACpB,kBAAkB,EAClB,mBAAmB,EACnB,sBAAsB,EACtB,mBAAmB,EACnB,2BAA2B,GAC3B,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EACN,mBAAmB,EACnB,sBAAsB,EACtB,qBAAqB,EACrB,qBAAqB,GACrB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,qBAAqB,MAAM,sCAAsC,CAAC;AACzE,OAAO,yBAAyB,MAAM,2CAA2C,CAAC;AAClF,OAAO,wBAAwB,MAAM,sCAAsC,CAAC;AAC5E,OAAO,wBAAwB,MAAM,sCAAsC,CAAC;AAE5E;;;;;;;;;GASG;AACH,MAAM,2BAA2B,GAAG;IACnC,IAAI,EAAE,sBAA+B;IACrC,EAAE,EAAE,8BAA8B;IAClC,IAAI,EAAE,oCAAoC;IAC1C,WAAW,EAAE,gFAAgF;IAC7F,OAAO,EAAE,IAAI;IACb,IAAI,EAAE,CAAC,SAAS,EAAE,MAAM,CAAC;CACzB,CAAC;AAEF;;;;;;;;;;;;GAYG;AACH,MAAM,CAAC,MAAM,cAAc,GAAG,mBAAmB,CAAC;IACjD,EAAE,EAAE,UAAU;IACd,IAAI,EAAE,UAAU;IAChB,WAAW,EACV,6bAA6b;IAC9b,YAAY,EAAE,EAAE;IAChB,KAAK,EAAE,CAAC,mBAAmB,EAAE,oBAAoB,EAAE,kBAAkB,EAAE,mBAAmB,EAAE,sBAAsB,EAAE,mBAAmB,EAAE,2BAA2B,CAAC;IACrK,WAAW,EAAE;QACZ,sBAAsB;QACtB,mBAAmB;QACnB,sBAAsB;QACtB,qBAAqB;QACrB,qBAAqB;QACrB,2BAA2B;QAC3B,EAAE,IAAI,EAAE,kBAAkB,EAAE,EAAE,EAAE,0BAA0B,EAAE,IAAI,EAAE,kBAAkB,EAAE,OAAO,EAAE,IAAI,EAAE;QACrG,EAAE,IAAI,EAAE,mBAAmB,EAAE,EAAE,EAAE,2BAA2B,EAAE,IAAI,EAAE,mBAAmB,EAAE,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,SAAS,CAAC,EAAE;QAC3H,qBAAqB;QACrB,yBAAyB;QACzB,wBAAwB;QACxB,wBAAwB;QACxB,mEAAmE;QACnE,uCAAuC;QACvC,EAAE,IAAI,EAAE,gBAAgB,EAAE,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE,iBAAiB,EAAE,WAAW,EAAE,6FAA6F,EAAE;KAC/K;IACD,OAAO,EAAE;QACR,MAAM,CAAC,0BAA0B,EAAE,EAAE,IAAI,EAAE,kBAAkB,EAAE,EAAE,GAAG,EAAE,CAAC,MAAM,CAAC,mCAAmC,CAAC,CAAC;QACnH,oEAAoE;QACpE,kEAAkE;QAClE,sEAAsE;QACtE,gEAAgE;QAChE,oDAAoD;QACpD,MAAM,CAAC,2BAA2B,EAAE,EAAE,IAAI,EAAE,mBAAmB,EAAE,EAAE,GAAG,EAAE,CAAC,MAAM,CAAC,8CAA8C,CAAC,CAAC;QAChI,MAAM,CAAC,2BAA2B,EAAE,EAAE,IAAI,EAAE,mBAAmB,EAAE,KAAK,EAAE,UAAU,EAAE,EAAE,GAAG,EAAE,CAAC,MAAM,CAAC,+CAA+C,CAAC,CAAC;QACpJ,MAAM,CAAC,UAAU,EAAE,EAAE,IAAI,EAAE,gBAAgB,EAAE,EAAE,KAAK,IAAI,EAAE,CAAC,CAAC;YAC3D,IAAI,EAAE,CAAC,MAAM,MAAM,CAAC,sCAAsC,CAAC,CAAC,CAAC,cAAc;SAC3E,CAAC,CAAC;KACH;CACD,CAAC,CAAC;AAEH,eAAe,cAAc,CAAC"}
@@ -0,0 +1,3 @@
1
+ export { default as SecurityToolCard } from './tool-widgets/SecurityToolCard.svelte';
2
+ export { default as securitySveltePlugin } from './security-svelte.plugin.ts';
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/svelte/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,gBAAgB,EAAE,MAAM,wCAAwC,CAAC;AACrF,OAAO,EAAE,OAAO,IAAI,oBAAoB,EAAE,MAAM,6BAA6B,CAAC"}
@@ -0,0 +1,2 @@
1
+ export { default as SecurityToolCard } from './tool-widgets/SecurityToolCard.svelte';
2
+ export { default as securitySveltePlugin } from "./security-svelte.plugin.js";
@@ -0,0 +1,5 @@
1
+ /** Settles after every widget registration this module queued so far (none when Kit is absent). */
2
+ export declare function toolWidgetsRegistered(): Promise<void>;
3
+ export declare const securitySveltePlugin: import("@vibesdotdev/kernel").RuntimePlugin;
4
+ export default securitySveltePlugin;
5
+ //# sourceMappingURL=security-svelte.plugin.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"security-svelte.plugin.d.ts","sourceRoot":"","sources":["../../src/svelte/security-svelte.plugin.ts"],"names":[],"mappings":"AA0BA,mGAAmG;AACnG,wBAAgB,qBAAqB,IAAI,OAAO,CAAC,IAAI,CAAC,CAErD;AAQD,eAAO,MAAM,oBAAoB,6CAiB/B,CAAC;AAEH,eAAe,oBAAoB,CAAC"}
@@ -0,0 +1,49 @@
1
+ import { createRuntimeImplementation, createRuntimePlugin, loader, settle } from '@vibesdotdev/kernel';
2
+ import { SECURITY_TOOL_IDS } from "../tools/index.js";
3
+ const loadSecurityToolCard = () => import('./tool-widgets/SecurityToolCard.svelte');
4
+ const widgets = SECURITY_TOOL_IDS.map((toolId) => ({
5
+ id: `${toolId}.svelte-widget`,
6
+ kind: 'tools/ui',
7
+ name: `${toolId} Svelte Widget`,
8
+ description: `Designed Kit card for ${toolId} (policy name, allow/deny, event type).`,
9
+ surfaces: ['web'],
10
+ role: 'widget',
11
+ targetToolId: toolId,
12
+ tags: ['security', 'widget'],
13
+ enabled: true
14
+ }));
15
+ // Kit's widget registry loads lazily: a top-level await here would suspend every importer and,
16
+ // inside a module cycle, let WebKit run a dependent before this module's bindings exist.
17
+ const kitToolWidgets = settle(() => import('@vibesdotdev/kit/components/tool-widgets'));
18
+ function registerKitToolWidget(...args) {
19
+ void kitToolWidgets.then((kit) => {
20
+ if (kit.ok)
21
+ kit.value.registerToolWidget(...args);
22
+ });
23
+ }
24
+ /** Settles after every widget registration this module queued so far (none when Kit is absent). */
25
+ export function toolWidgetsRegistered() {
26
+ return kitToolWidgets.then(() => undefined);
27
+ }
28
+ if (registerKitToolWidget) {
29
+ for (const toolId of SECURITY_TOOL_IDS) {
30
+ registerKitToolWidget(toolId, loadSecurityToolCard);
31
+ }
32
+ }
33
+ export const securitySveltePlugin = createRuntimePlugin({
34
+ id: '@vibesdotdev/security/svelte',
35
+ name: 'Security Svelte',
36
+ description: 'Security-owned Svelte tool-result cards registered as tools/ui.',
37
+ dependencies: [],
38
+ descriptors: widgets,
39
+ loaders: widgets.map((descriptor) => loader(descriptor.id, { kind: 'tools/ui', scope: 'browser' }, async () => {
40
+ registerKitToolWidget?.(descriptor.targetToolId, loadSecurityToolCard);
41
+ const module = await loadSecurityToolCard();
42
+ return createRuntimeImplementation({
43
+ kind: 'tools/ui',
44
+ id: descriptor.id,
45
+ implementation: { web: { component: module.default } }
46
+ });
47
+ }))
48
+ });
49
+ export default securitySveltePlugin;
@@ -0,0 +1,8 @@
1
+ /*
2
+ * Tailwind v4 source declaration for consumers — mirrors @vibesdotdev/kit's
3
+ * styles.css pattern. Apps that @import this file get this package's
4
+ * components scanned by their Tailwind build, so utility classes used only
5
+ * inside these components are emitted in the app's CSS bundle (Tailwind
6
+ * never scans node_modules). Paths resolve relative to this file.
7
+ */
8
+ @source "./";
@@ -0,0 +1,140 @@
1
+ <script lang="ts">
2
+ /**
3
+ * Family card for security.check-policy, security.scan-input,
4
+ * security.redact-output, and security.report-event. Surfaces policy name,
5
+ * allow/deny, and event type from the live tool schemas.
6
+ */
7
+ import { Badge } from '@vibesdotdev/kit/components/ui/badge';
8
+ import { Icon } from '@vibesdotdev/kit/components/icon';
9
+ import {
10
+ ToolCard,
11
+ ToolCardBody,
12
+ type ToolWidgetProps
13
+ } from '@vibesdotdev/kit/components/tool-widgets';
14
+ import {
15
+ decisionTone,
16
+ securityToolCardModel,
17
+ securityToolCardRows,
18
+ type SecurityToolCardTone
19
+ } from '@vibesdotdev/security/tools';
20
+
21
+ let { tool, compact = false }: ToolWidgetProps = $props();
22
+
23
+ const model = $derived(
24
+ securityToolCardModel({
25
+ name: tool.name,
26
+ input: tool.input,
27
+ output: tool.output,
28
+ error: tool.error
29
+ })
30
+ );
31
+ const rows = $derived(securityToolCardRows(model));
32
+
33
+ const BADGE_VARIANT = {
34
+ default: 'secondary',
35
+ success: 'success',
36
+ danger: 'destructive',
37
+ warning: 'warning',
38
+ muted: 'outline'
39
+ } satisfies Record<
40
+ SecurityToolCardTone,
41
+ 'secondary' | 'destructive' | 'success' | 'warning' | 'outline'
42
+ >;
43
+
44
+ function severityVariant(severity: string): 'outline' | 'warning' | 'destructive' {
45
+ switch (severity) {
46
+ case 'critical':
47
+ case 'high':
48
+ return 'destructive';
49
+ case 'medium':
50
+ return 'warning';
51
+ default:
52
+ return 'outline';
53
+ }
54
+ }
55
+ </script>
56
+
57
+ <ToolCard {tool} {compact} title={model.title} icon={model.icon} defaultOpen={model.defaultOpen}>
58
+ {#snippet children()}
59
+ <ToolCardBody {compact}>
60
+ <div class="flex flex-wrap items-center gap-1.5">
61
+ {#if model.decisionLabel}
62
+ <Badge variant={BADGE_VARIANT[decisionTone(model.decision)]} class="text-caption">
63
+ {model.decisionLabel}
64
+ </Badge>
65
+ {/if}
66
+ {#if model.policyName}
67
+ <span class="truncate font-mono text-caption text-muted-foreground"
68
+ >{model.policyName}</span
69
+ >
70
+ {/if}
71
+ {#if model.eventType}
72
+ <Badge variant="secondary" class="text-caption">{model.eventType}</Badge>
73
+ {/if}
74
+ {#if model.recorded !== null}
75
+ <Badge variant={model.recorded ? 'success' : 'destructive'} class="text-caption">
76
+ {model.recorded ? 'Recorded' : 'Not recorded'}
77
+ </Badge>
78
+ {/if}
79
+ {#if model.matchCount !== null}
80
+ <Badge variant="outline" class="text-caption">
81
+ {model.matchCount === 1 ? '1 match' : `${model.matchCount} matches`}
82
+ </Badge>
83
+ {/if}
84
+ </div>
85
+
86
+ {#if rows.length}
87
+ <dl class="space-y-0.5">
88
+ {#each rows as row (row.label)}
89
+ <div class="flex min-w-0 items-baseline gap-2">
90
+ <dt class="shrink-0 text-caption text-muted-foreground">{row.label}</dt>
91
+ <dd
92
+ class={[
93
+ 'min-w-0 truncate',
94
+ row.tone === 'danger' && 'text-destructive',
95
+ row.tone === 'muted' && 'text-muted-foreground'
96
+ ]}
97
+ >
98
+ {row.value}
99
+ </dd>
100
+ </div>
101
+ {/each}
102
+ </dl>
103
+ {/if}
104
+
105
+ {#if model.threats.length}
106
+ <ul class="space-y-1">
107
+ {#each model.threats.slice(0, 5) as threat, index (`${threat.kind}-${index}`)}
108
+ <li class="flex min-w-0 items-start gap-1.5">
109
+ <Badge
110
+ variant={severityVariant(threat.severity)}
111
+ class="mt-0.5 shrink-0 text-caption"
112
+ >
113
+ {threat.severity}
114
+ </Badge>
115
+ <div class="min-w-0">
116
+ <span class="font-medium">{threat.kind.replaceAll('_', ' ')}</span>
117
+ {#if threat.description}
118
+ <span class="block text-caption text-muted-foreground">{threat.description}</span>
119
+ {/if}
120
+ </div>
121
+ </li>
122
+ {/each}
123
+ </ul>
124
+ {/if}
125
+
126
+ {#if model.redactedPreview}
127
+ <p class="line-clamp-4 whitespace-pre-wrap text-muted-foreground">
128
+ {model.redactedPreview}
129
+ </p>
130
+ {/if}
131
+
132
+ {#if !rows.length && !model.threats.length && !model.redactedPreview && !tool.error}
133
+ <p class="flex items-center gap-1.5 text-muted-foreground italic">
134
+ <Icon icon="lucide:loader-circle" class="size-3" />
135
+ Waiting for result…
136
+ </p>
137
+ {/if}
138
+ </ToolCardBody>
139
+ {/snippet}
140
+ </ToolCard>
@@ -0,0 +1,5 @@
1
+ import { type ToolWidgetProps } from '@vibesdotdev/kit/components/tool-widgets';
2
+ declare const SecurityToolCard: import("svelte").Component<ToolWidgetProps, {}, "">;
3
+ type SecurityToolCard = ReturnType<typeof SecurityToolCard>;
4
+ export default SecurityToolCard;
5
+ //# sourceMappingURL=SecurityToolCard.svelte.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SecurityToolCard.svelte.d.ts","sourceRoot":"","sources":["../../../src/svelte/tool-widgets/SecurityToolCard.svelte.ts"],"names":[],"mappings":"AAUA,OAAO,EAGL,KAAK,eAAe,EACpB,MAAM,0CAA0C,CAAC;AAmInD,QAAA,MAAM,gBAAgB,qDAAwC,CAAC;AAC/D,KAAK,gBAAgB,GAAG,UAAU,CAAC,OAAO,gBAAgB,CAAC,CAAC;AAC5D,eAAe,gBAAgB,CAAC"}
@@ -0,0 +1,2 @@
1
+ export { default as SecurityToolCard } from './SecurityToolCard.svelte';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/svelte/tool-widgets/index.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,OAAO,IAAI,gBAAgB,EAAE,MAAM,2BAA2B,CAAC"}
@@ -0,0 +1,6 @@
1
+ import { registerToolWidget } from '@vibesdotdev/kit/components/tool-widgets';
2
+ import { SECURITY_TOOL_IDS } from '@vibesdotdev/security/tools';
3
+ for (const toolId of SECURITY_TOOL_IDS) {
4
+ registerToolWidget(toolId, () => import('./SecurityToolCard.svelte'));
5
+ }
6
+ export { default as SecurityToolCard } from './SecurityToolCard.svelte';
@@ -0,0 +1,37 @@
1
+ declare const _default: {
2
+ kind: "tools/tool";
3
+ id: string;
4
+ name: string;
5
+ description: string;
6
+ mcpDescription: string;
7
+ category: string;
8
+ subcategory: string;
9
+ hardware: string[];
10
+ purpose: string[];
11
+ tags: string[];
12
+ safety: string;
13
+ requiresApproval: boolean;
14
+ schemas: {
15
+ input: import("zod/v4").ZodObject<{
16
+ policyId: import("zod/v4").ZodOptional<import("zod/v4").ZodString>;
17
+ context: import("zod/v4").ZodOptional<import("zod/v4").ZodObject<{
18
+ actor: import("zod/v4").ZodOptional<import("zod/v4").ZodString>;
19
+ action: import("zod/v4").ZodOptional<import("zod/v4").ZodString>;
20
+ resource: import("zod/v4").ZodOptional<import("zod/v4").ZodString>;
21
+ metadata: import("zod/v4").ZodOptional<import("zod/v4").ZodRecord<import("zod/v4").ZodString, import("zod/v4").ZodUnknown>>;
22
+ }, import("zod/v4/core").$strip>>;
23
+ }, import("zod/v4/core").$strip>;
24
+ output: import("zod/v4").ZodObject<{
25
+ outcome: import("zod/v4").ZodEnum<{
26
+ allow: "allow";
27
+ deny: "deny";
28
+ review: "review";
29
+ }>;
30
+ policyId: import("zod/v4").ZodString;
31
+ reason: import("zod/v4").ZodOptional<import("zod/v4").ZodString>;
32
+ engineAvailable: import("zod/v4").ZodBoolean;
33
+ }, import("zod/v4/core").$strip>;
34
+ };
35
+ };
36
+ export default _default;
37
+ //# sourceMappingURL=check-policy.descriptor.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"check-policy.descriptor.d.ts","sourceRoot":"","sources":["../../../src/tools/check-policy/check-policy.descriptor.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAGA,wBAkBG"}
@@ -0,0 +1,21 @@
1
+ import { createRuntimeAsset } from '@vibesdotdev/kernel/factory';
2
+ import { CheckPolicyInputSchema, CheckPolicyOutputSchema } from "./schemas.js";
3
+ export default createRuntimeAsset({
4
+ kind: 'tools/tool',
5
+ id: 'security.check-policy',
6
+ name: 'Check Security Policy',
7
+ description: 'Evaluate a context against registered security policies to determine if an action is allowed, denied, or requires review.',
8
+ mcpDescription: 'Check security policy. Ex: {policyId,context}; returns allow, deny, or review.',
9
+ category: 'security',
10
+ subcategory: 'policy',
11
+ hardware: ['consumer', 'cloud'],
12
+ purpose: ['direct', 'worker', 'agent'],
13
+ tags: ['security', 'policy', 'evaluation', 'access-control'],
14
+ safety: 'read',
15
+ requiresApproval: false,
16
+ schemas: {
17
+ input: CheckPolicyInputSchema,
18
+ output: CheckPolicyOutputSchema,
19
+ },
20
+ });
21
+ //# sourceMappingURL=check-policy.descriptor.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"check-policy.descriptor.js","sourceRoot":"","sources":["../../../src/tools/check-policy/check-policy.descriptor.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,6BAA6B,CAAC;AACjE,OAAO,EAAE,sBAAsB,EAAE,uBAAuB,EAAE,MAAM,cAAc,CAAC;AAE/E,eAAe,kBAAkB,CAAC;IACjC,IAAI,EAAE,YAAY;IAClB,EAAE,EAAE,uBAAuB;IAC3B,IAAI,EAAE,uBAAuB;IAC7B,WAAW,EAAE,2HAA2H;IACxI,cAAc,EACb,gFAAgF;IACjF,QAAQ,EAAE,UAAU;IACpB,WAAW,EAAE,QAAQ;IACrB,QAAQ,EAAE,CAAC,UAAU,EAAE,OAAO,CAAC;IAC/B,OAAO,EAAE,CAAC,QAAQ,EAAE,QAAQ,EAAE,OAAO,CAAC;IACtC,IAAI,EAAE,CAAC,UAAU,EAAE,QAAQ,EAAE,YAAY,EAAE,gBAAgB,CAAC;IAC5D,MAAM,EAAE,MAAM;IACd,gBAAgB,EAAE,KAAK;IACvB,OAAO,EAAE;QACR,KAAK,EAAE,sBAAsB;QAC7B,MAAM,EAAE,uBAAuB;KAC/B;CACD,CAAC,CAAC"}
@@ -0,0 +1,7 @@
1
+ import type { ToolCallContext, VibesRuntime } from '@vibesdotdev/kernel';
2
+ import { type CheckPolicyInput, type CheckPolicyOutput } from './schemas.ts';
3
+ declare const _default: {
4
+ execute(input: CheckPolicyInput, runtime: VibesRuntime, _ctx: ToolCallContext): Promise<CheckPolicyOutput>;
5
+ };
6
+ export default _default;
7
+ //# sourceMappingURL=check-policy.impl.consumer.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"check-policy.impl.consumer.d.ts","sourceRoot":"","sources":["../../../src/tools/check-policy/check-policy.impl.consumer.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,eAAe,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAEzE,OAAO,EAA0B,KAAK,gBAAgB,EAAE,KAAK,iBAAiB,EAAE,MAAM,cAAc,CAAC;;mBAG/E,gBAAgB,WAAW,YAAY,QAAQ,eAAe,GAAG,OAAO,CAAC,iBAAiB,CAAC;;AADjH,wBAeE"}
@@ -0,0 +1,21 @@
1
+ import { PolicyOutcomeSchema } from "../../schemas/contracts/policy.js";
2
+ import { CheckPolicyInputSchema } from "./schemas.js";
3
+ export default {
4
+ async execute(input, runtime, _ctx) {
5
+ const parsed = CheckPolicyInputSchema.parse(input);
6
+ const absent = {
7
+ outcome: 'deny', policyId: parsed.policyId ?? 'default',
8
+ reason: 'No policy implementation registered — fail-closed behavior', engineAvailable: false
9
+ };
10
+ if (!runtime.hasKind('security/policy'))
11
+ return absent;
12
+ let query = runtime.query('security/policy').enabled();
13
+ if (parsed.policyId !== undefined)
14
+ query = query.withId(parsed.policyId);
15
+ if (query.descriptors().length === 0)
16
+ return absent;
17
+ const policy = await query.resolve();
18
+ return { outcome: PolicyOutcomeSchema.parse(await policy.evaluate(parsed.context ?? {})), policyId: policy.descriptor.id, engineAvailable: true };
19
+ }
20
+ };
21
+ //# sourceMappingURL=check-policy.impl.consumer.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"check-policy.impl.consumer.js","sourceRoot":"","sources":["../../../src/tools/check-policy/check-policy.impl.consumer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,mCAAmC,CAAC;AAGxE,OAAO,EAAE,sBAAsB,EAAiD,MAAM,cAAc,CAAC;AAErG,eAAe;IACd,KAAK,CAAC,OAAO,CAAC,KAAuB,EAAE,OAAqB,EAAE,IAAqB;QAClF,MAAM,MAAM,GAAG,sBAAsB,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;QACnD,MAAM,MAAM,GAAsB;YACjC,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,CAAC,QAAQ,IAAI,SAAS;YACvD,MAAM,EAAE,4DAA4D,EAAE,eAAe,EAAE,KAAK;SAC5F,CAAC;QACF,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,iBAAiB,CAAC;YAAE,OAAO,MAAM,CAAC;QACvD,IAAI,KAAK,GAAG,OAAO,CAAC,KAAK,CAAkD,iBAAiB,CAAC,CAAC,OAAO,EAAE,CAAC;QACxG,IAAI,MAAM,CAAC,QAAQ,KAAK,SAAS;YAAE,KAAK,GAAG,KAAK,CAAC,MAAM,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC;QACzE,IAAI,KAAK,CAAC,WAAW,EAAE,CAAC,MAAM,KAAK,CAAC;YAAE,OAAO,MAAM,CAAC;QAEpD,MAAM,MAAM,GAAG,MAAM,KAAK,CAAC,OAAO,EAAE,CAAC;QACrC,OAAO,EAAE,OAAO,EAAE,mBAAmB,CAAC,KAAK,CAAC,MAAM,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC,OAAO,IAAI,EAAE,CAAC,CAAC,EAAE,QAAQ,EAAE,MAAM,CAAC,UAAU,CAAC,EAAE,EAAE,eAAe,EAAE,IAAI,EAAE,CAAC;IACnJ,CAAC;CACD,CAAC"}
@@ -0,0 +1,3 @@
1
+ export { default } from './check-policy.descriptor.ts';
2
+ export type { CheckPolicyInput, CheckPolicyOutput } from './schemas.ts';
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/tools/check-policy/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,8BAA8B,CAAC;AACvD,YAAY,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAC"}
@@ -0,0 +1,2 @@
1
+ export { default } from "./check-policy.descriptor.js";
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/tools/check-policy/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,8BAA8B,CAAC"}
@@ -0,0 +1,23 @@
1
+ import * as z from 'zod/v4';
2
+ export declare const CheckPolicyInputSchema: z.ZodObject<{
3
+ policyId: z.ZodOptional<z.ZodString>;
4
+ context: z.ZodOptional<z.ZodObject<{
5
+ actor: z.ZodOptional<z.ZodString>;
6
+ action: z.ZodOptional<z.ZodString>;
7
+ resource: z.ZodOptional<z.ZodString>;
8
+ metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
9
+ }, z.core.$strip>>;
10
+ }, z.core.$strip>;
11
+ export type CheckPolicyInput = z.infer<typeof CheckPolicyInputSchema>;
12
+ export declare const CheckPolicyOutputSchema: z.ZodObject<{
13
+ outcome: z.ZodEnum<{
14
+ allow: "allow";
15
+ deny: "deny";
16
+ review: "review";
17
+ }>;
18
+ policyId: z.ZodString;
19
+ reason: z.ZodOptional<z.ZodString>;
20
+ engineAvailable: z.ZodBoolean;
21
+ }, z.core.$strip>;
22
+ export type CheckPolicyOutput = z.infer<typeof CheckPolicyOutputSchema>;
23
+ //# sourceMappingURL=schemas.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"schemas.d.ts","sourceRoot":"","sources":["../../../src/tools/check-policy/schemas.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,CAAC,MAAM,QAAQ,CAAC;AAE5B,eAAO,MAAM,sBAAsB;;;;;;;;iBAGjC,CAAC;AAEH,MAAM,MAAM,gBAAgB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,sBAAsB,CAAC,CAAC;AAEtE,eAAO,MAAM,uBAAuB;;;;;;;;;iBAKlC,CAAC;AAEH,MAAM,MAAM,iBAAiB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,uBAAuB,CAAC,CAAC"}
@@ -0,0 +1,13 @@
1
+ import { PolicyEvaluationContextSchema, PolicyOutcomeSchema } from "../../schemas/policy.js";
2
+ import * as z from 'zod/v4';
3
+ export const CheckPolicyInputSchema = z.object({
4
+ policyId: z.string().optional().describe('Policy ID to check against (optional — uses default if not provided)'),
5
+ context: PolicyEvaluationContextSchema.optional(),
6
+ });
7
+ export const CheckPolicyOutputSchema = z.object({
8
+ outcome: PolicyOutcomeSchema.describe('Policy evaluation outcome'),
9
+ policyId: z.string().describe('ID of the policy that produced this outcome'),
10
+ reason: z.string().optional().describe('Human-readable reason for the outcome'),
11
+ engineAvailable: z.boolean().describe('Whether a policy engine is actually registered (if false, this is fail-closed behavior)'),
12
+ });
13
+ //# sourceMappingURL=schemas.js.map