clawsec 0.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (361) hide show
  1. package/README.md +560 -0
  2. package/dist/bin/clawsec.d.ts +7 -0
  3. package/dist/bin/clawsec.d.ts.map +1 -0
  4. package/dist/bin/clawsec.js +12 -0
  5. package/dist/bin/clawsec.js.map +1 -0
  6. package/dist/src/actions/block.d.ts +22 -0
  7. package/dist/src/actions/block.d.ts.map +1 -0
  8. package/dist/src/actions/block.js +83 -0
  9. package/dist/src/actions/block.js.map +1 -0
  10. package/dist/src/actions/confirm.d.ts +35 -0
  11. package/dist/src/actions/confirm.d.ts.map +1 -0
  12. package/dist/src/actions/confirm.js +156 -0
  13. package/dist/src/actions/confirm.js.map +1 -0
  14. package/dist/src/actions/executor.d.ts +64 -0
  15. package/dist/src/actions/executor.d.ts.map +1 -0
  16. package/dist/src/actions/executor.js +114 -0
  17. package/dist/src/actions/executor.js.map +1 -0
  18. package/dist/src/actions/index.d.ts +13 -0
  19. package/dist/src/actions/index.d.ts.map +1 -0
  20. package/dist/src/actions/index.js +15 -0
  21. package/dist/src/actions/index.js.map +1 -0
  22. package/dist/src/actions/log.d.ts +19 -0
  23. package/dist/src/actions/log.d.ts.map +1 -0
  24. package/dist/src/actions/log.js +63 -0
  25. package/dist/src/actions/log.js.map +1 -0
  26. package/dist/src/actions/types.d.ts +85 -0
  27. package/dist/src/actions/types.d.ts.map +1 -0
  28. package/dist/src/actions/types.js +78 -0
  29. package/dist/src/actions/types.js.map +1 -0
  30. package/dist/src/actions/warn.d.ts +22 -0
  31. package/dist/src/actions/warn.d.ts.map +1 -0
  32. package/dist/src/actions/warn.js +84 -0
  33. package/dist/src/actions/warn.js.map +1 -0
  34. package/dist/src/approval/agent-confirm.d.ts +104 -0
  35. package/dist/src/approval/agent-confirm.d.ts.map +1 -0
  36. package/dist/src/approval/agent-confirm.js +173 -0
  37. package/dist/src/approval/agent-confirm.js.map +1 -0
  38. package/dist/src/approval/index.d.ts +14 -0
  39. package/dist/src/approval/index.d.ts.map +1 -0
  40. package/dist/src/approval/index.js +9 -0
  41. package/dist/src/approval/index.js.map +1 -0
  42. package/dist/src/approval/native.d.ts +56 -0
  43. package/dist/src/approval/native.d.ts.map +1 -0
  44. package/dist/src/approval/native.js +196 -0
  45. package/dist/src/approval/native.js.map +1 -0
  46. package/dist/src/approval/store.d.ts +88 -0
  47. package/dist/src/approval/store.d.ts.map +1 -0
  48. package/dist/src/approval/store.js +192 -0
  49. package/dist/src/approval/store.js.map +1 -0
  50. package/dist/src/approval/types.d.ts +119 -0
  51. package/dist/src/approval/types.d.ts.map +1 -0
  52. package/dist/src/approval/types.js +6 -0
  53. package/dist/src/approval/types.js.map +1 -0
  54. package/dist/src/approval/webhook.d.ts +170 -0
  55. package/dist/src/approval/webhook.d.ts.map +1 -0
  56. package/dist/src/approval/webhook.js +362 -0
  57. package/dist/src/approval/webhook.js.map +1 -0
  58. package/dist/src/cli/commands/audit.d.ts +43 -0
  59. package/dist/src/cli/commands/audit.d.ts.map +1 -0
  60. package/dist/src/cli/commands/audit.js +115 -0
  61. package/dist/src/cli/commands/audit.js.map +1 -0
  62. package/dist/src/cli/commands/feedback.d.ts +27 -0
  63. package/dist/src/cli/commands/feedback.d.ts.map +1 -0
  64. package/dist/src/cli/commands/feedback.js +228 -0
  65. package/dist/src/cli/commands/feedback.js.map +1 -0
  66. package/dist/src/cli/commands/index.d.ts +11 -0
  67. package/dist/src/cli/commands/index.d.ts.map +1 -0
  68. package/dist/src/cli/commands/index.js +13 -0
  69. package/dist/src/cli/commands/index.js.map +1 -0
  70. package/dist/src/cli/commands/status.d.ts +20 -0
  71. package/dist/src/cli/commands/status.d.ts.map +1 -0
  72. package/dist/src/cli/commands/status.js +122 -0
  73. package/dist/src/cli/commands/status.js.map +1 -0
  74. package/dist/src/cli/commands/test.d.ts +23 -0
  75. package/dist/src/cli/commands/test.d.ts.map +1 -0
  76. package/dist/src/cli/commands/test.js +134 -0
  77. package/dist/src/cli/commands/test.js.map +1 -0
  78. package/dist/src/cli/commands/types.d.ts +81 -0
  79. package/dist/src/cli/commands/types.d.ts.map +1 -0
  80. package/dist/src/cli/commands/types.js +6 -0
  81. package/dist/src/cli/commands/types.js.map +1 -0
  82. package/dist/src/cli/index.d.ts +17 -0
  83. package/dist/src/cli/index.d.ts.map +1 -0
  84. package/dist/src/cli/index.js +267 -0
  85. package/dist/src/cli/index.js.map +1 -0
  86. package/dist/src/config/defaults.d.ts +20 -0
  87. package/dist/src/config/defaults.d.ts.map +1 -0
  88. package/dist/src/config/defaults.js +123 -0
  89. package/dist/src/config/defaults.js.map +1 -0
  90. package/dist/src/config/index.d.ts +8 -0
  91. package/dist/src/config/index.d.ts.map +1 -0
  92. package/dist/src/config/index.js +41 -0
  93. package/dist/src/config/index.js.map +1 -0
  94. package/dist/src/config/loader.d.ts +99 -0
  95. package/dist/src/config/loader.d.ts.map +1 -0
  96. package/dist/src/config/loader.js +242 -0
  97. package/dist/src/config/loader.js.map +1 -0
  98. package/dist/src/config/schema.d.ts +627 -0
  99. package/dist/src/config/schema.d.ts.map +1 -0
  100. package/dist/src/config/schema.js +585 -0
  101. package/dist/src/config/schema.js.map +1 -0
  102. package/dist/src/detectors/destructive/cloud-detector.d.ts +51 -0
  103. package/dist/src/detectors/destructive/cloud-detector.d.ts.map +1 -0
  104. package/dist/src/detectors/destructive/cloud-detector.js +556 -0
  105. package/dist/src/detectors/destructive/cloud-detector.js.map +1 -0
  106. package/dist/src/detectors/destructive/code-detector.d.ts +59 -0
  107. package/dist/src/detectors/destructive/code-detector.d.ts.map +1 -0
  108. package/dist/src/detectors/destructive/code-detector.js +558 -0
  109. package/dist/src/detectors/destructive/code-detector.js.map +1 -0
  110. package/dist/src/detectors/destructive/index.d.ts +54 -0
  111. package/dist/src/detectors/destructive/index.d.ts.map +1 -0
  112. package/dist/src/detectors/destructive/index.js +168 -0
  113. package/dist/src/detectors/destructive/index.js.map +1 -0
  114. package/dist/src/detectors/destructive/shell-detector.d.ts +43 -0
  115. package/dist/src/detectors/destructive/shell-detector.d.ts.map +1 -0
  116. package/dist/src/detectors/destructive/shell-detector.js +302 -0
  117. package/dist/src/detectors/destructive/shell-detector.js.map +1 -0
  118. package/dist/src/detectors/destructive/types.d.ts +143 -0
  119. package/dist/src/detectors/destructive/types.d.ts.map +1 -0
  120. package/dist/src/detectors/destructive/types.js +6 -0
  121. package/dist/src/detectors/destructive/types.js.map +1 -0
  122. package/dist/src/detectors/exfiltration/cloud-detector.d.ts +51 -0
  123. package/dist/src/detectors/exfiltration/cloud-detector.d.ts.map +1 -0
  124. package/dist/src/detectors/exfiltration/cloud-detector.js +427 -0
  125. package/dist/src/detectors/exfiltration/cloud-detector.js.map +1 -0
  126. package/dist/src/detectors/exfiltration/http-detector.d.ts +47 -0
  127. package/dist/src/detectors/exfiltration/http-detector.d.ts.map +1 -0
  128. package/dist/src/detectors/exfiltration/http-detector.js +429 -0
  129. package/dist/src/detectors/exfiltration/http-detector.js.map +1 -0
  130. package/dist/src/detectors/exfiltration/index.d.ts +44 -0
  131. package/dist/src/detectors/exfiltration/index.d.ts.map +1 -0
  132. package/dist/src/detectors/exfiltration/index.js +118 -0
  133. package/dist/src/detectors/exfiltration/index.js.map +1 -0
  134. package/dist/src/detectors/exfiltration/network-detector.d.ts +55 -0
  135. package/dist/src/detectors/exfiltration/network-detector.d.ts.map +1 -0
  136. package/dist/src/detectors/exfiltration/network-detector.js +504 -0
  137. package/dist/src/detectors/exfiltration/network-detector.js.map +1 -0
  138. package/dist/src/detectors/exfiltration/types.d.ts +139 -0
  139. package/dist/src/detectors/exfiltration/types.d.ts.map +1 -0
  140. package/dist/src/detectors/exfiltration/types.js +6 -0
  141. package/dist/src/detectors/exfiltration/types.js.map +1 -0
  142. package/dist/src/detectors/purchase/domain-detector.d.ts +44 -0
  143. package/dist/src/detectors/purchase/domain-detector.d.ts.map +1 -0
  144. package/dist/src/detectors/purchase/domain-detector.js +296 -0
  145. package/dist/src/detectors/purchase/domain-detector.js.map +1 -0
  146. package/dist/src/detectors/purchase/form-detector.d.ts +27 -0
  147. package/dist/src/detectors/purchase/form-detector.d.ts.map +1 -0
  148. package/dist/src/detectors/purchase/form-detector.js +344 -0
  149. package/dist/src/detectors/purchase/form-detector.js.map +1 -0
  150. package/dist/src/detectors/purchase/index.d.ts +65 -0
  151. package/dist/src/detectors/purchase/index.d.ts.map +1 -0
  152. package/dist/src/detectors/purchase/index.js +216 -0
  153. package/dist/src/detectors/purchase/index.js.map +1 -0
  154. package/dist/src/detectors/purchase/spend-tracker.d.ts +132 -0
  155. package/dist/src/detectors/purchase/spend-tracker.d.ts.map +1 -0
  156. package/dist/src/detectors/purchase/spend-tracker.js +313 -0
  157. package/dist/src/detectors/purchase/spend-tracker.js.map +1 -0
  158. package/dist/src/detectors/purchase/types.d.ts +139 -0
  159. package/dist/src/detectors/purchase/types.d.ts.map +1 -0
  160. package/dist/src/detectors/purchase/types.js +6 -0
  161. package/dist/src/detectors/purchase/types.js.map +1 -0
  162. package/dist/src/detectors/purchase/url-detector.d.ts +31 -0
  163. package/dist/src/detectors/purchase/url-detector.d.ts.map +1 -0
  164. package/dist/src/detectors/purchase/url-detector.js +292 -0
  165. package/dist/src/detectors/purchase/url-detector.js.map +1 -0
  166. package/dist/src/detectors/secrets/api-key-detector.d.ts +30 -0
  167. package/dist/src/detectors/secrets/api-key-detector.d.ts.map +1 -0
  168. package/dist/src/detectors/secrets/api-key-detector.js +297 -0
  169. package/dist/src/detectors/secrets/api-key-detector.js.map +1 -0
  170. package/dist/src/detectors/secrets/index.d.ts +43 -0
  171. package/dist/src/detectors/secrets/index.d.ts.map +1 -0
  172. package/dist/src/detectors/secrets/index.js +261 -0
  173. package/dist/src/detectors/secrets/index.js.map +1 -0
  174. package/dist/src/detectors/secrets/pii-detector.d.ts +54 -0
  175. package/dist/src/detectors/secrets/pii-detector.d.ts.map +1 -0
  176. package/dist/src/detectors/secrets/pii-detector.js +286 -0
  177. package/dist/src/detectors/secrets/pii-detector.js.map +1 -0
  178. package/dist/src/detectors/secrets/token-detector.d.ts +51 -0
  179. package/dist/src/detectors/secrets/token-detector.d.ts.map +1 -0
  180. package/dist/src/detectors/secrets/token-detector.js +233 -0
  181. package/dist/src/detectors/secrets/token-detector.js.map +1 -0
  182. package/dist/src/detectors/secrets/types.d.ts +157 -0
  183. package/dist/src/detectors/secrets/types.d.ts.map +1 -0
  184. package/dist/src/detectors/secrets/types.js +6 -0
  185. package/dist/src/detectors/secrets/types.js.map +1 -0
  186. package/dist/src/detectors/website/category-detector.d.ts +22 -0
  187. package/dist/src/detectors/website/category-detector.d.ts.map +1 -0
  188. package/dist/src/detectors/website/category-detector.js +162 -0
  189. package/dist/src/detectors/website/category-detector.js.map +1 -0
  190. package/dist/src/detectors/website/index.d.ts +53 -0
  191. package/dist/src/detectors/website/index.d.ts.map +1 -0
  192. package/dist/src/detectors/website/index.js +232 -0
  193. package/dist/src/detectors/website/index.js.map +1 -0
  194. package/dist/src/detectors/website/pattern-matcher.d.ts +33 -0
  195. package/dist/src/detectors/website/pattern-matcher.d.ts.map +1 -0
  196. package/dist/src/detectors/website/pattern-matcher.js +121 -0
  197. package/dist/src/detectors/website/pattern-matcher.js.map +1 -0
  198. package/dist/src/detectors/website/types.d.ts +105 -0
  199. package/dist/src/detectors/website/types.d.ts.map +1 -0
  200. package/dist/src/detectors/website/types.js +6 -0
  201. package/dist/src/detectors/website/types.js.map +1 -0
  202. package/dist/src/engine/analyzer.d.ts +87 -0
  203. package/dist/src/engine/analyzer.d.ts.map +1 -0
  204. package/dist/src/engine/analyzer.js +427 -0
  205. package/dist/src/engine/analyzer.js.map +1 -0
  206. package/dist/src/engine/cache.d.ts +80 -0
  207. package/dist/src/engine/cache.d.ts.map +1 -0
  208. package/dist/src/engine/cache.js +167 -0
  209. package/dist/src/engine/cache.js.map +1 -0
  210. package/dist/src/engine/index.d.ts +11 -0
  211. package/dist/src/engine/index.d.ts.map +1 -0
  212. package/dist/src/engine/index.js +11 -0
  213. package/dist/src/engine/index.js.map +1 -0
  214. package/dist/src/engine/llm-client.d.ts +210 -0
  215. package/dist/src/engine/llm-client.d.ts.map +1 -0
  216. package/dist/src/engine/llm-client.js +506 -0
  217. package/dist/src/engine/llm-client.js.map +1 -0
  218. package/dist/src/engine/types.d.ts +163 -0
  219. package/dist/src/engine/types.d.ts.map +1 -0
  220. package/dist/src/engine/types.js +21 -0
  221. package/dist/src/engine/types.js.map +1 -0
  222. package/dist/src/feedback/index.d.ts +9 -0
  223. package/dist/src/feedback/index.d.ts.map +1 -0
  224. package/dist/src/feedback/index.js +8 -0
  225. package/dist/src/feedback/index.js.map +1 -0
  226. package/dist/src/feedback/learner.d.ts +222 -0
  227. package/dist/src/feedback/learner.d.ts.map +1 -0
  228. package/dist/src/feedback/learner.js +401 -0
  229. package/dist/src/feedback/learner.js.map +1 -0
  230. package/dist/src/feedback/store.d.ts +113 -0
  231. package/dist/src/feedback/store.d.ts.map +1 -0
  232. package/dist/src/feedback/store.js +228 -0
  233. package/dist/src/feedback/store.js.map +1 -0
  234. package/dist/src/feedback/types.d.ts +126 -0
  235. package/dist/src/feedback/types.d.ts.map +1 -0
  236. package/dist/src/feedback/types.js +6 -0
  237. package/dist/src/feedback/types.js.map +1 -0
  238. package/dist/src/hooks/before-agent-start/handler.d.ts +37 -0
  239. package/dist/src/hooks/before-agent-start/handler.d.ts.map +1 -0
  240. package/dist/src/hooks/before-agent-start/handler.js +109 -0
  241. package/dist/src/hooks/before-agent-start/handler.js.map +1 -0
  242. package/dist/src/hooks/before-agent-start/index.d.ts +8 -0
  243. package/dist/src/hooks/before-agent-start/index.d.ts.map +1 -0
  244. package/dist/src/hooks/before-agent-start/index.js +7 -0
  245. package/dist/src/hooks/before-agent-start/index.js.map +1 -0
  246. package/dist/src/hooks/before-agent-start/prompts.d.ts +48 -0
  247. package/dist/src/hooks/before-agent-start/prompts.d.ts.map +1 -0
  248. package/dist/src/hooks/before-agent-start/prompts.js +103 -0
  249. package/dist/src/hooks/before-agent-start/prompts.js.map +1 -0
  250. package/dist/src/hooks/before-tool-call/handler.d.ts +42 -0
  251. package/dist/src/hooks/before-tool-call/handler.d.ts.map +1 -0
  252. package/dist/src/hooks/before-tool-call/handler.js +226 -0
  253. package/dist/src/hooks/before-tool-call/handler.js.map +1 -0
  254. package/dist/src/hooks/before-tool-call/index.d.ts +7 -0
  255. package/dist/src/hooks/before-tool-call/index.d.ts.map +1 -0
  256. package/dist/src/hooks/before-tool-call/index.js +6 -0
  257. package/dist/src/hooks/before-tool-call/index.js.map +1 -0
  258. package/dist/src/hooks/tool-result-persist/filter.d.ts +72 -0
  259. package/dist/src/hooks/tool-result-persist/filter.d.ts.map +1 -0
  260. package/dist/src/hooks/tool-result-persist/filter.js +305 -0
  261. package/dist/src/hooks/tool-result-persist/filter.js.map +1 -0
  262. package/dist/src/hooks/tool-result-persist/handler.d.ts +49 -0
  263. package/dist/src/hooks/tool-result-persist/handler.d.ts.map +1 -0
  264. package/dist/src/hooks/tool-result-persist/handler.js +217 -0
  265. package/dist/src/hooks/tool-result-persist/handler.js.map +1 -0
  266. package/dist/src/hooks/tool-result-persist/index.d.ts +11 -0
  267. package/dist/src/hooks/tool-result-persist/index.d.ts.map +1 -0
  268. package/dist/src/hooks/tool-result-persist/index.js +11 -0
  269. package/dist/src/hooks/tool-result-persist/index.js.map +1 -0
  270. package/dist/src/index.d.ts +256 -0
  271. package/dist/src/index.d.ts.map +1 -0
  272. package/dist/src/index.js +222 -0
  273. package/dist/src/index.js.map +1 -0
  274. package/dist/src/notifications/discord.d.ts +10 -0
  275. package/dist/src/notifications/discord.d.ts.map +1 -0
  276. package/dist/src/notifications/discord.js +218 -0
  277. package/dist/src/notifications/discord.js.map +1 -0
  278. package/dist/src/notifications/index.d.ts +37 -0
  279. package/dist/src/notifications/index.d.ts.map +1 -0
  280. package/dist/src/notifications/index.js +68 -0
  281. package/dist/src/notifications/index.js.map +1 -0
  282. package/dist/src/notifications/slack.d.ts +10 -0
  283. package/dist/src/notifications/slack.d.ts.map +1 -0
  284. package/dist/src/notifications/slack.js +218 -0
  285. package/dist/src/notifications/slack.js.map +1 -0
  286. package/dist/src/notifications/telegram.d.ts +10 -0
  287. package/dist/src/notifications/telegram.d.ts.map +1 -0
  288. package/dist/src/notifications/telegram.js +242 -0
  289. package/dist/src/notifications/telegram.js.map +1 -0
  290. package/dist/src/notifications/types.d.ts +119 -0
  291. package/dist/src/notifications/types.d.ts.map +1 -0
  292. package/dist/src/notifications/types.js +6 -0
  293. package/dist/src/notifications/types.js.map +1 -0
  294. package/dist/src/proxy/index.d.ts +8 -0
  295. package/dist/src/proxy/index.d.ts.map +1 -0
  296. package/dist/src/proxy/index.js +9 -0
  297. package/dist/src/proxy/index.js.map +1 -0
  298. package/dist/src/proxy/middleware.d.ts +55 -0
  299. package/dist/src/proxy/middleware.d.ts.map +1 -0
  300. package/dist/src/proxy/middleware.js +215 -0
  301. package/dist/src/proxy/middleware.js.map +1 -0
  302. package/dist/src/proxy/server.d.ts +57 -0
  303. package/dist/src/proxy/server.d.ts.map +1 -0
  304. package/dist/src/proxy/server.js +298 -0
  305. package/dist/src/proxy/server.js.map +1 -0
  306. package/dist/src/proxy/types.d.ts +136 -0
  307. package/dist/src/proxy/types.d.ts.map +1 -0
  308. package/dist/src/proxy/types.js +6 -0
  309. package/dist/src/proxy/types.js.map +1 -0
  310. package/dist/src/sanitization/index.d.ts +10 -0
  311. package/dist/src/sanitization/index.d.ts.map +1 -0
  312. package/dist/src/sanitization/index.js +9 -0
  313. package/dist/src/sanitization/index.js.map +1 -0
  314. package/dist/src/sanitization/patterns.d.ts +51 -0
  315. package/dist/src/sanitization/patterns.d.ts.map +1 -0
  316. package/dist/src/sanitization/patterns.js +266 -0
  317. package/dist/src/sanitization/patterns.js.map +1 -0
  318. package/dist/src/sanitization/scanner.d.ts +29 -0
  319. package/dist/src/sanitization/scanner.d.ts.map +1 -0
  320. package/dist/src/sanitization/scanner.js +328 -0
  321. package/dist/src/sanitization/scanner.js.map +1 -0
  322. package/dist/src/sanitization/types.d.ts +57 -0
  323. package/dist/src/sanitization/types.d.ts.map +1 -0
  324. package/dist/src/sanitization/types.js +5 -0
  325. package/dist/src/sanitization/types.js.map +1 -0
  326. package/openclaw.plugin.json +114 -0
  327. package/package.json +63 -0
  328. package/rules/builtin/README.md +139 -0
  329. package/rules/builtin/ai-services.yaml +70 -0
  330. package/rules/builtin/api-keys.yaml +64 -0
  331. package/rules/builtin/authentication.yaml +56 -0
  332. package/rules/builtin/aws-security.yaml +57 -0
  333. package/rules/builtin/azure-security.yaml +58 -0
  334. package/rules/builtin/cicd-security.yaml +64 -0
  335. package/rules/builtin/cloud-storage.yaml +64 -0
  336. package/rules/builtin/container-registry.yaml +55 -0
  337. package/rules/builtin/crypto-wallets.yaml +71 -0
  338. package/rules/builtin/database-nosql.yaml +58 -0
  339. package/rules/builtin/database-sql.yaml +62 -0
  340. package/rules/builtin/development-env.yaml +67 -0
  341. package/rules/builtin/docker.yaml +57 -0
  342. package/rules/builtin/filesystem.yaml +71 -0
  343. package/rules/builtin/financial-pci.yaml +61 -0
  344. package/rules/builtin/gcp-security.yaml +57 -0
  345. package/rules/builtin/git-operations.yaml +68 -0
  346. package/rules/builtin/healthcare-hipaa.yaml +64 -0
  347. package/rules/builtin/kubernetes.yaml +60 -0
  348. package/rules/builtin/messaging-services.yaml +53 -0
  349. package/rules/builtin/minimal.yaml +47 -0
  350. package/rules/builtin/mobile-development.yaml +61 -0
  351. package/rules/builtin/monitoring.yaml +63 -0
  352. package/rules/builtin/network-security.yaml +57 -0
  353. package/rules/builtin/package-managers.yaml +74 -0
  354. package/rules/builtin/payment-processing.yaml +66 -0
  355. package/rules/builtin/pii-protection.yaml +48 -0
  356. package/rules/builtin/production-strict.yaml +55 -0
  357. package/rules/builtin/secrets-management.yaml +63 -0
  358. package/rules/builtin/serverless.yaml +74 -0
  359. package/rules/builtin/ssh-security.yaml +66 -0
  360. package/rules/builtin/terraform.yaml +51 -0
  361. package/rules/builtin/web-security.yaml +62 -0
package/README.md ADDED
@@ -0,0 +1,560 @@
1
+ # Clawsec
2
+
3
+ > Security plugin for OpenClaw.ai that prevents AI agents from taking dangerous actions.
4
+
5
+ [![Tests](https://img.shields.io/badge/tests-1258%20passing-brightgreen)]()
6
+ [![TypeScript](https://img.shields.io/badge/TypeScript-5.3-blue)]()
7
+ [![License](https://img.shields.io/badge/license-MIT-green)]()
8
+
9
+ ## Overview
10
+
11
+ Clawsec is a comprehensive security plugin that protects against:
12
+
13
+ - **Purchase Protection** - Blocks unauthorized purchases with spend limits
14
+ - **Website Control** - Allowlist/blocklist for URL access
15
+ - **Destructive Commands** - Detects dangerous shell, cloud, and code patterns
16
+ - **Secrets/PII Detection** - Finds API keys, tokens, and personal data
17
+ - **Data Exfiltration** - Prevents unauthorized data transfer
18
+ - **Prompt Injection** - Scans tool outputs for injection attempts
19
+
20
+ ## Features
21
+
22
+ - **Hybrid Detection** - Fast pattern matching (~5ms) with optional LLM analysis
23
+ - **Multi-Channel Approval** - Native, agent-confirm, and webhook options
24
+ - **Real-time Notifications** - Slack, Discord, and Telegram alerts
25
+ - **30+ Pre-built Rules** - Ready-to-use templates for common scenarios
26
+ - **User Feedback Loop** - Improve detection with false positive/negative reporting
27
+ - **Dual Distribution** - OpenClaw plugin or standalone proxy mode
28
+
29
+ ## Quick Start
30
+
31
+ ### Installation
32
+
33
+ #### Via npm (recommended)
34
+
35
+ ```bash
36
+ npm install clawsec
37
+ ```
38
+
39
+ #### Via OpenClaw CLI
40
+
41
+ ```bash
42
+ # Install from npm registry
43
+ openclaw plugins install clawsec
44
+
45
+ # Or install locally during development
46
+ openclaw plugins install -l ./
47
+ ```
48
+
49
+ ### Verify Installation
50
+
51
+ ```bash
52
+ # List installed plugins
53
+ openclaw plugins list
54
+
55
+ # Check plugin info
56
+ openclaw plugins info clawsec
57
+
58
+ # Run plugin diagnostics
59
+ openclaw plugins doctor
60
+ ```
61
+
62
+ ### Basic Configuration
63
+
64
+ Create `clawsec.yaml` in your project root:
65
+
66
+ ```yaml
67
+ version: "1.0"
68
+
69
+ global:
70
+ enabled: true
71
+ logLevel: info
72
+
73
+ rules:
74
+ purchase:
75
+ enabled: true
76
+ severity: critical
77
+ action: block
78
+ spendLimits:
79
+ perTransaction: 100
80
+ daily: 500
81
+
82
+ destructive:
83
+ enabled: true
84
+ severity: critical
85
+ action: confirm
86
+
87
+ secrets:
88
+ enabled: true
89
+ severity: critical
90
+ action: block
91
+ ```
92
+
93
+ ### OpenClaw Plugin Usage
94
+
95
+ ```typescript
96
+ import clawsec from 'clawsec';
97
+
98
+ // Register with OpenClaw
99
+ openClaw.registerPlugin(clawsec);
100
+ ```
101
+
102
+ ### OpenClaw Configuration
103
+
104
+ Configure Clawsec via OpenClaw's plugin settings:
105
+
106
+ ```yaml
107
+ # openclaw.config.yaml
108
+ plugins:
109
+ clawsec:
110
+ enabled: true
111
+ configPath: "./clawsec.yaml"
112
+ logLevel: "info"
113
+ ```
114
+
115
+ Or use environment variables:
116
+
117
+ ```bash
118
+ export OPENCLAW_PLUGIN_CLAWSEC_ENABLED=true
119
+ export OPENCLAW_PLUGIN_CLAWSEC_CONFIG_PATH="./clawsec.yaml"
120
+ export OPENCLAW_PLUGIN_CLAWSEC_LOG_LEVEL="info"
121
+ ```
122
+
123
+ ### Standalone Proxy Mode
124
+
125
+ ```bash
126
+ # Start the proxy server
127
+ npx clawsec serve --port 8080
128
+
129
+ # Configure your agent to use the proxy
130
+ CLAWSEC_PROXY=http://localhost:8080
131
+ ```
132
+
133
+ ## Configuration
134
+
135
+ ### Global Settings
136
+
137
+ ```yaml
138
+ global:
139
+ enabled: true # Enable/disable the plugin
140
+ logLevel: info # debug, info, warn, error
141
+
142
+ llm:
143
+ enabled: true # Enable LLM-based detection
144
+ model: null # Use OpenClaw's configured model
145
+ ```
146
+
147
+ ### Purchase Protection
148
+
149
+ ```yaml
150
+ rules:
151
+ purchase:
152
+ enabled: true
153
+ severity: critical
154
+ action: block # block, confirm, warn, log
155
+ spendLimits:
156
+ perTransaction: 100 # Maximum per transaction
157
+ daily: 500 # Maximum daily total
158
+ domains:
159
+ mode: blocklist # blocklist or allowlist
160
+ blocklist:
161
+ - "*.amazon.com"
162
+ - "*.stripe.com"
163
+ - "paypal.com"
164
+ ```
165
+
166
+ ### Website Control
167
+
168
+ ```yaml
169
+ rules:
170
+ website:
171
+ enabled: true
172
+ mode: blocklist # blocklist or allowlist
173
+ severity: high
174
+ action: block
175
+ blocklist:
176
+ - "*.malware.com"
177
+ - "phishing-*.com"
178
+ allowlist:
179
+ - "github.com"
180
+ - "stackoverflow.com"
181
+ ```
182
+
183
+ ### Destructive Commands
184
+
185
+ ```yaml
186
+ rules:
187
+ destructive:
188
+ enabled: true
189
+ severity: critical
190
+ action: confirm
191
+ shell:
192
+ enabled: true # rm -rf, mkfs, dd, etc.
193
+ cloud:
194
+ enabled: true # AWS, GCP, Azure delete operations
195
+ code:
196
+ enabled: true # shutil.rmtree, fs.rm, etc.
197
+ ```
198
+
199
+ ### Secrets Detection
200
+
201
+ ```yaml
202
+ rules:
203
+ secrets:
204
+ enabled: true
205
+ severity: critical
206
+ action: block
207
+ # Detects: API keys, tokens, passwords, PII
208
+ ```
209
+
210
+ ### Data Exfiltration
211
+
212
+ ```yaml
213
+ rules:
214
+ exfiltration:
215
+ enabled: true
216
+ severity: high
217
+ action: block
218
+ # Detects: curl POST, wget uploads, netcat, etc.
219
+ ```
220
+
221
+ ### Output Sanitization
222
+
223
+ ```yaml
224
+ rules:
225
+ sanitization:
226
+ enabled: true
227
+ severity: high
228
+ action: block
229
+ minConfidence: 0.5
230
+ redactMatches: false # true to redact instead of block
231
+ categories:
232
+ instructionOverride: true
233
+ systemLeak: true
234
+ jailbreak: true
235
+ encodedPayload: true
236
+ ```
237
+
238
+ ### Approval Flow
239
+
240
+ ```yaml
241
+ approval:
242
+ native:
243
+ enabled: true
244
+ timeout: 300 # 5 minutes
245
+
246
+ agentConfirm:
247
+ enabled: true
248
+ parameterName: "_clawsec_confirm"
249
+
250
+ webhook:
251
+ enabled: false
252
+ url: "https://api.example.com/approve"
253
+ timeout: 30
254
+ headers:
255
+ Authorization: "Bearer ${WEBHOOK_TOKEN}"
256
+ ```
257
+
258
+ ### Notifications
259
+
260
+ ```yaml
261
+ notifications:
262
+ slack:
263
+ enabled: true
264
+ webhookUrl: "${SLACK_WEBHOOK_URL}"
265
+ channel: "#security-alerts"
266
+ minSeverity: high
267
+
268
+ discord:
269
+ enabled: true
270
+ webhookUrl: "${DISCORD_WEBHOOK_URL}"
271
+ minSeverity: critical
272
+
273
+ telegram:
274
+ enabled: true
275
+ botToken: "${TELEGRAM_BOT_TOKEN}"
276
+ chatId: "${TELEGRAM_CHAT_ID}"
277
+ parseMode: HTML
278
+ ```
279
+
280
+ ## Pre-built Rule Templates
281
+
282
+ Use our 30+ built-in templates for common scenarios:
283
+
284
+ | Category | Templates |
285
+ |----------|-----------|
286
+ | Cloud Providers | `aws-security`, `gcp-security`, `azure-security` |
287
+ | Infrastructure | `kubernetes`, `docker`, `terraform`, `serverless` |
288
+ | Development | `git-operations`, `cicd-security`, `package-managers` |
289
+ | Databases | `database-sql`, `database-nosql`, `cloud-storage` |
290
+ | Secrets | `api-keys`, `authentication`, `secrets-management` |
291
+ | Compliance | `pii-protection`, `healthcare-hipaa`, `financial-pci` |
292
+ | Environment | `minimal`, `development-env`, `production-strict` |
293
+
294
+ ```yaml
295
+ # Extend from a built-in template
296
+ extends:
297
+ - builtin/aws-security
298
+ - builtin/pii-protection
299
+
300
+ # Override specific settings
301
+ rules:
302
+ purchase:
303
+ spendLimits:
304
+ perTransaction: 200
305
+ ```
306
+
307
+ ## CLI Commands
308
+
309
+ ```bash
310
+ # Check plugin status
311
+ npx clawsec status
312
+
313
+ # Test configuration
314
+ npx clawsec test
315
+
316
+ # View audit log
317
+ npx clawsec audit --since "1 hour ago"
318
+
319
+ # Report false positive
320
+ npx clawsec feedback --false-positive <event-id>
321
+
322
+ # Report false negative
323
+ npx clawsec feedback --false-negative "description of what was missed"
324
+ ```
325
+
326
+ ## API Reference
327
+
328
+ ### Hooks
329
+
330
+ Clawsec registers three hooks with OpenClaw:
331
+
332
+ #### `before-tool-call`
333
+
334
+ Intercepts tool calls before execution:
335
+
336
+ ```typescript
337
+ interface BeforeToolCallResult {
338
+ allow: boolean;
339
+ modifiedInput?: Record<string, unknown>;
340
+ blockMessage?: string;
341
+ metadata?: {
342
+ category?: ThreatCategory;
343
+ severity?: Severity;
344
+ rule?: string;
345
+ reason?: string;
346
+ };
347
+ }
348
+ ```
349
+
350
+ #### `before-agent-start`
351
+
352
+ Injects security context into system prompts:
353
+
354
+ ```typescript
355
+ interface BeforeAgentStartResult {
356
+ systemPromptAddition?: string;
357
+ modifiedConfig?: Record<string, unknown>;
358
+ }
359
+ ```
360
+
361
+ #### `tool-result-persist`
362
+
363
+ Filters sensitive data from tool outputs:
364
+
365
+ ```typescript
366
+ interface ToolResultPersistResult {
367
+ allow: boolean;
368
+ filteredOutput?: unknown;
369
+ redactions?: Array<{
370
+ type: string;
371
+ description: string;
372
+ }>;
373
+ }
374
+ ```
375
+
376
+ ### Detectors
377
+
378
+ Access detectors programmatically:
379
+
380
+ ```typescript
381
+ import {
382
+ createPurchaseDetector,
383
+ createWebsiteDetector,
384
+ createDestructiveDetector,
385
+ createSecretsDetector,
386
+ createExfiltrationDetector
387
+ } from 'clawsec/detectors';
388
+
389
+ const detector = createSecretsDetector(config);
390
+ const results = await detector.detectAll({
391
+ toolName: 'Read',
392
+ toolInput: { file_path: '/etc/passwd' },
393
+ toolOutput: fileContents,
394
+ });
395
+ ```
396
+
397
+ ### Notifications
398
+
399
+ Send custom notifications:
400
+
401
+ ```typescript
402
+ import { createNotificationManager, createSecurityEvent } from 'clawsec/notifications';
403
+
404
+ const manager = createNotificationManager({
405
+ slack: { enabled: true, webhookUrl: '...' },
406
+ });
407
+
408
+ const event = createSecurityEvent({
409
+ category: 'custom',
410
+ severity: 'high',
411
+ toolName: 'CustomTool',
412
+ reason: 'Custom security event',
413
+ action: 'blocked',
414
+ });
415
+
416
+ await manager.notify(event);
417
+ ```
418
+
419
+ ## Detection Patterns
420
+
421
+ ### Destructive Commands
422
+
423
+ ```
424
+ Shell: rm -rf, mkfs, dd of=/dev/, DROP DATABASE, TRUNCATE
425
+ Cloud: aws ec2 terminate, gcloud delete, kubectl delete ns
426
+ Git: push --force, reset --hard, clean -f
427
+ Code: shutil.rmtree(), fs.rm(recursive), os.RemoveAll()
428
+ ```
429
+
430
+ ### Secrets Detection
431
+
432
+ ```
433
+ API Keys: sk-..., AKIA..., gho_..., xoxb-...
434
+ Tokens: Bearer ..., eyJ... (JWT), session_...
435
+ Credentials: password=, secret=, api_key=
436
+ PII: SSN (xxx-xx-xxxx), Credit Cards (Luhn validation)
437
+ ```
438
+
439
+ ### Prompt Injection
440
+
441
+ ```
442
+ Override: "ignore previous", "new instructions", "system:"
443
+ Leakage: "your system prompt", "initial instructions"
444
+ Jailbreak: "DAN mode", "developer mode", "pretend you are"
445
+ Encoded: Base64, hex, unicode escape sequences
446
+ ```
447
+
448
+ ## Approval Flow
449
+
450
+ ```
451
+ Detection ─┬─► block ──────────► REJECT (no approval possible)
452
+
453
+ ├─► confirm ────────► 3 approval paths:
454
+ │ ├── Native: /approve <id>
455
+ │ ├── Agent-confirm: retry with _clawsec_confirm
456
+ │ └── Webhook: external system
457
+
458
+ ├─► warn ───────────► ALLOW (log warning)
459
+
460
+ └─► log ────────────► ALLOW (silent audit)
461
+ ```
462
+
463
+ ## Architecture
464
+
465
+ ```
466
+ ┌─────────────────────────────────────────────────────────────┐
467
+ │ CLAWSEC PLUGIN │
468
+ ├─────────────────────────────────────────────────────────────┤
469
+ │ │
470
+ │ Tool Call ──► Pattern Matching (≤5ms) ──┬─► BLOCK/ALLOW │
471
+ │ │ │
472
+ │ ambiguous ───────────┘ │
473
+ │ │ │
474
+ │ ▼ │
475
+ │ LLM Analysis (~500ms) ──► BLOCK/CONFIRM │
476
+ │ │
477
+ └─────────────────────────────────────────────────────────────┘
478
+ ```
479
+
480
+ ## Development
481
+
482
+ ### Building
483
+
484
+ ```bash
485
+ npm install
486
+ npm run build
487
+ ```
488
+
489
+ ### Testing
490
+
491
+ ```bash
492
+ npm test # Run all tests
493
+ npm run test:watch # Watch mode
494
+ npm run test:coverage # Coverage report
495
+ ```
496
+
497
+ ### Project Structure
498
+
499
+ ```
500
+ clawsec/
501
+ ├── src/
502
+ │ ├── index.ts # Plugin entry point
503
+ │ ├── config/ # Configuration handling
504
+ │ ├── detectors/ # Detection modules
505
+ │ │ ├── purchase/ # Domain + intent detection
506
+ │ │ ├── website/ # URL allowlist/blocklist
507
+ │ │ ├── destructive/ # Shell, code, cloud patterns
508
+ │ │ ├── secrets/ # API keys, tokens, PII
509
+ │ │ └── exfiltration/ # Data exfiltration detection
510
+ │ ├── engine/ # Hybrid detection engine
511
+ │ ├── actions/ # Block, confirm, warn, log
512
+ │ ├── approval/ # Approval flow handlers
513
+ │ ├── hooks/ # OpenClaw hook handlers
514
+ │ ├── sanitization/ # Output sanitization
515
+ │ ├── notifications/ # Slack, Discord, Telegram
516
+ │ ├── feedback/ # User feedback system
517
+ │ ├── proxy/ # Standalone proxy mode
518
+ │ └── cli/ # CLI commands
519
+ ├── rules/builtin/ # Pre-built rule templates
520
+ └── tests/ # Test files
521
+ ```
522
+
523
+ ## Troubleshooting
524
+
525
+ ### Common Issues
526
+
527
+ **Plugin not blocking expected threats:**
528
+ - Check `enabled: true` in config
529
+ - Verify severity threshold matches
530
+ - Review audit log with `npx clawsec audit`
531
+
532
+ **False positives:**
533
+ - Report with `npx clawsec feedback --false-positive <id>`
534
+ - Adjust `minConfidence` in config
535
+ - Use allowlist for known-safe patterns
536
+
537
+ **Notifications not sending:**
538
+ - Verify webhook URLs are correct
539
+ - Check `minSeverity` filter
540
+ - Test with `npx clawsec test notifications`
541
+
542
+ **Performance issues:**
543
+ - Disable LLM analysis if not needed
544
+ - Use `log` action for low-severity rules
545
+ - Increase `minConfidence` threshold
546
+
547
+ ## Contributing
548
+
549
+ 1. Fork the repository
550
+ 2. Create a feature branch
551
+ 3. Write tests for new functionality
552
+ 4. Submit a pull request
553
+
554
+ ## License
555
+
556
+ MIT
557
+
558
+ ## Credits
559
+
560
+ Built by the Clawsec team. Inspired by ClawGuardian and the need for comprehensive AI agent security.
@@ -0,0 +1,7 @@
1
+ #!/usr/bin/env node
2
+ /**
3
+ * Clawsec CLI Executable
4
+ * Entry point for the clawsec command line tool
5
+ */
6
+ export {};
7
+ //# sourceMappingURL=clawsec.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"clawsec.d.ts","sourceRoot":"","sources":["../../bin/clawsec.ts"],"names":[],"mappings":";AACA;;;GAGG"}
@@ -0,0 +1,12 @@
1
+ #!/usr/bin/env node
2
+ /**
3
+ * Clawsec CLI Executable
4
+ * Entry point for the clawsec command line tool
5
+ */
6
+ import { main } from '../src/cli/index.js';
7
+ // Run the CLI
8
+ main().catch((error) => {
9
+ console.error('Fatal error:', error);
10
+ process.exit(1);
11
+ });
12
+ //# sourceMappingURL=clawsec.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"clawsec.js","sourceRoot":"","sources":["../../bin/clawsec.ts"],"names":[],"mappings":";AACA;;;GAGG;AAEH,OAAO,EAAE,IAAI,EAAE,MAAM,qBAAqB,CAAC;AAE3C,cAAc;AACd,IAAI,EAAE,CAAC,KAAK,CAAC,CAAC,KAAK,EAAE,EAAE;IACrB,OAAO,CAAC,KAAK,CAAC,cAAc,EAAE,KAAK,CAAC,CAAC;IACrC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAClB,CAAC,CAAC,CAAC"}
@@ -0,0 +1,22 @@
1
+ /**
2
+ * Block Action Handler
3
+ * Handles blocking tool calls when critical threats are detected
4
+ */
5
+ import type { ActionContext, ActionHandler, ActionResult, ActionLogger } from './types.js';
6
+ /**
7
+ * Generate a clear message explaining why the action was blocked
8
+ */
9
+ export declare function generateBlockMessage(context: ActionContext): string;
10
+ /**
11
+ * Block action handler implementation
12
+ */
13
+ export declare class BlockHandler implements ActionHandler {
14
+ private logger;
15
+ constructor(logger?: ActionLogger);
16
+ execute(context: ActionContext): Promise<ActionResult>;
17
+ }
18
+ /**
19
+ * Create a block action handler with the given logger
20
+ */
21
+ export declare function createBlockHandler(logger?: ActionLogger): BlockHandler;
22
+ //# sourceMappingURL=block.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"block.d.ts","sourceRoot":"","sources":["../../../src/actions/block.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,aAAa,EAAE,aAAa,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAwB3F;;GAEG;AACH,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,aAAa,GAAG,MAAM,CA2BnE;AAED;;GAEG;AACH,qBAAa,YAAa,YAAW,aAAa;IAChD,OAAO,CAAC,MAAM,CAAe;gBAEjB,MAAM,GAAE,YAAyB;IAIvC,OAAO,CAAC,OAAO,EAAE,aAAa,GAAG,OAAO,CAAC,YAAY,CAAC;CAmB7D;AAED;;GAEG;AACH,wBAAgB,kBAAkB,CAAC,MAAM,CAAC,EAAE,YAAY,GAAG,YAAY,CAEtE"}
@@ -0,0 +1,83 @@
1
+ /**
2
+ * Block Action Handler
3
+ * Handles blocking tool calls when critical threats are detected
4
+ */
5
+ import { noOpLogger } from './types.js';
6
+ /**
7
+ * Format a severity level for display
8
+ */
9
+ function formatSeverity(severity) {
10
+ return severity.toUpperCase();
11
+ }
12
+ /**
13
+ * Format a threat category for display
14
+ */
15
+ function formatCategory(category) {
16
+ const categoryNames = {
17
+ purchase: 'Purchase/Payment',
18
+ website: 'Malicious Website',
19
+ destructive: 'Destructive Command',
20
+ secrets: 'Secrets/PII Exposure',
21
+ exfiltration: 'Data Exfiltration',
22
+ };
23
+ return categoryNames[category] || category;
24
+ }
25
+ /**
26
+ * Generate a clear message explaining why the action was blocked
27
+ */
28
+ export function generateBlockMessage(context) {
29
+ const { analysis, toolCall } = context;
30
+ const { primaryDetection, detections } = analysis;
31
+ if (!primaryDetection) {
32
+ return `Action blocked: ${toolCall.toolName} was blocked by security policy.`;
33
+ }
34
+ const category = formatCategory(primaryDetection.category);
35
+ const severity = formatSeverity(primaryDetection.severity);
36
+ const reason = primaryDetection.reason;
37
+ let message = `[${severity}] ${category} detected - Action blocked\n`;
38
+ message += `Tool: ${toolCall.toolName}\n`;
39
+ message += `Reason: ${reason}`;
40
+ // Include additional detections if any
41
+ if (detections.length > 1) {
42
+ message += `\n\nAdditional detections (${detections.length - 1}):`;
43
+ for (const detection of detections) {
44
+ if (detection !== primaryDetection) {
45
+ message += `\n- ${formatCategory(detection.category)}: ${detection.reason}`;
46
+ }
47
+ }
48
+ }
49
+ return message;
50
+ }
51
+ /**
52
+ * Block action handler implementation
53
+ */
54
+ export class BlockHandler {
55
+ logger;
56
+ constructor(logger = noOpLogger) {
57
+ this.logger = logger;
58
+ }
59
+ async execute(context) {
60
+ const { analysis, toolCall } = context;
61
+ const message = generateBlockMessage(context);
62
+ // Log the block event
63
+ this.logger.warn('Action blocked', {
64
+ toolName: toolCall.toolName,
65
+ category: analysis.primaryDetection?.category,
66
+ severity: analysis.primaryDetection?.severity,
67
+ reason: analysis.primaryDetection?.reason,
68
+ detectionCount: analysis.detections.length,
69
+ });
70
+ return {
71
+ allowed: false,
72
+ message,
73
+ logged: true,
74
+ };
75
+ }
76
+ }
77
+ /**
78
+ * Create a block action handler with the given logger
79
+ */
80
+ export function createBlockHandler(logger) {
81
+ return new BlockHandler(logger);
82
+ }
83
+ //# sourceMappingURL=block.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"block.js","sourceRoot":"","sources":["../../../src/actions/block.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAExC;;GAEG;AACH,SAAS,cAAc,CAAC,QAAgB;IACtC,OAAO,QAAQ,CAAC,WAAW,EAAE,CAAC;AAChC,CAAC;AAED;;GAEG;AACH,SAAS,cAAc,CAAC,QAAgB;IACtC,MAAM,aAAa,GAA2B;QAC5C,QAAQ,EAAE,kBAAkB;QAC5B,OAAO,EAAE,mBAAmB;QAC5B,WAAW,EAAE,qBAAqB;QAClC,OAAO,EAAE,sBAAsB;QAC/B,YAAY,EAAE,mBAAmB;KAClC,CAAC;IACF,OAAO,aAAa,CAAC,QAAQ,CAAC,IAAI,QAAQ,CAAC;AAC7C,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,oBAAoB,CAAC,OAAsB;IACzD,MAAM,EAAE,QAAQ,EAAE,QAAQ,EAAE,GAAG,OAAO,CAAC;IACvC,MAAM,EAAE,gBAAgB,EAAE,UAAU,EAAE,GAAG,QAAQ,CAAC;IAElD,IAAI,CAAC,gBAAgB,EAAE,CAAC;QACtB,OAAO,mBAAmB,QAAQ,CAAC,QAAQ,kCAAkC,CAAC;IAChF,CAAC;IAED,MAAM,QAAQ,GAAG,cAAc,CAAC,gBAAgB,CAAC,QAAQ,CAAC,CAAC;IAC3D,MAAM,QAAQ,GAAG,cAAc,CAAC,gBAAgB,CAAC,QAAQ,CAAC,CAAC;IAC3D,MAAM,MAAM,GAAG,gBAAgB,CAAC,MAAM,CAAC;IAEvC,IAAI,OAAO,GAAG,IAAI,QAAQ,KAAK,QAAQ,8BAA8B,CAAC;IACtE,OAAO,IAAI,SAAS,QAAQ,CAAC,QAAQ,IAAI,CAAC;IAC1C,OAAO,IAAI,WAAW,MAAM,EAAE,CAAC;IAE/B,uCAAuC;IACvC,IAAI,UAAU,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QAC1B,OAAO,IAAI,8BAA8B,UAAU,CAAC,MAAM,GAAG,CAAC,IAAI,CAAC;QACnE,KAAK,MAAM,SAAS,IAAI,UAAU,EAAE,CAAC;YACnC,IAAI,SAAS,KAAK,gBAAgB,EAAE,CAAC;gBACnC,OAAO,IAAI,OAAO,cAAc,CAAC,SAAS,CAAC,QAAQ,CAAC,KAAK,SAAS,CAAC,MAAM,EAAE,CAAC;YAC9E,CAAC;QACH,CAAC;IACH,CAAC;IAED,OAAO,OAAO,CAAC;AACjB,CAAC;AAED;;GAEG;AACH,MAAM,OAAO,YAAY;IACf,MAAM,CAAe;IAE7B,YAAY,SAAuB,UAAU;QAC3C,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;IACvB,CAAC;IAED,KAAK,CAAC,OAAO,CAAC,OAAsB;QAClC,MAAM,EAAE,QAAQ,EAAE,QAAQ,EAAE,GAAG,OAAO,CAAC;QACvC,MAAM,OAAO,GAAG,oBAAoB,CAAC,OAAO,CAAC,CAAC;QAE9C,sBAAsB;QACtB,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,gBAAgB,EAAE;YACjC,QAAQ,EAAE,QAAQ,CAAC,QAAQ;YAC3B,QAAQ,EAAE,QAAQ,CAAC,gBAAgB,EAAE,QAAQ;YAC7C,QAAQ,EAAE,QAAQ,CAAC,gBAAgB,EAAE,QAAQ;YAC7C,MAAM,EAAE,QAAQ,CAAC,gBAAgB,EAAE,MAAM;YACzC,cAAc,EAAE,QAAQ,CAAC,UAAU,CAAC,MAAM;SAC3C,CAAC,CAAC;QAEH,OAAO;YACL,OAAO,EAAE,KAAK;YACd,OAAO;YACP,MAAM,EAAE,IAAI;SACb,CAAC;IACJ,CAAC;CACF;AAED;;GAEG;AACH,MAAM,UAAU,kBAAkB,CAAC,MAAqB;IACtD,OAAO,IAAI,YAAY,CAAC,MAAM,CAAC,CAAC;AAClC,CAAC"}