@cybedefend/vibedefend 1.8.3 → 1.9.0

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 (320) hide show
  1. package/README.md +135 -16
  2. package/dist/clients/antigravity.js +30 -6
  3. package/dist/clients/antigravity.js.map +1 -1
  4. package/dist/clients/claude-code.js +209 -17
  5. package/dist/clients/claude-code.js.map +1 -1
  6. package/dist/clients/codex.js +171 -11
  7. package/dist/clients/codex.js.map +1 -1
  8. package/dist/clients/cursor.js +149 -9
  9. package/dist/clients/cursor.js.map +1 -1
  10. package/dist/clients/dependency-check-wiring.js +24 -0
  11. package/dist/clients/dependency-check-wiring.js.map +1 -0
  12. package/dist/clients/opencode-plugin.js +905 -0
  13. package/dist/clients/opencode-plugin.js.map +1 -0
  14. package/dist/clients/opencode.js +653 -0
  15. package/dist/clients/opencode.js.map +1 -0
  16. package/dist/clients/registry.js +2 -0
  17. package/dist/clients/registry.js.map +1 -1
  18. package/dist/clients/vscode.js +106 -12
  19. package/dist/clients/vscode.js.map +1 -1
  20. package/dist/clients/windsurf.js +9 -1
  21. package/dist/clients/windsurf.js.map +1 -1
  22. package/dist/commands/mcp/index.js +11 -0
  23. package/dist/commands/mcp/index.js.map +1 -1
  24. package/dist/config.js +3 -0
  25. package/dist/config.js.map +1 -1
  26. package/dist/diagnostics.js +22 -3
  27. package/dist/diagnostics.js.map +1 -1
  28. package/dist/doctor.js +26 -1
  29. package/dist/doctor.js.map +1 -1
  30. package/dist/guards-evaluator/command-analysis.js +347 -86
  31. package/dist/guards-evaluator/command-analysis.js.map +1 -1
  32. package/dist/guards-evaluator/command-view.js +116 -16
  33. package/dist/guards-evaluator/command-view.js.map +1 -1
  34. package/dist/guards-evaluator/evaluate.js +185 -41
  35. package/dist/guards-evaluator/evaluate.js.map +1 -1
  36. package/dist/guards-evaluator/file-reads.js +202 -0
  37. package/dist/guards-evaluator/file-reads.js.map +1 -0
  38. package/dist/guards-evaluator/index.js +1 -1
  39. package/dist/guards-evaluator/index.js.map +1 -1
  40. package/dist/guards-evaluator/inline-danger.js +299 -0
  41. package/dist/guards-evaluator/inline-danger.js.map +1 -0
  42. package/dist/guards-evaluator/normalize.js +1186 -55
  43. package/dist/guards-evaluator/normalize.js.map +1 -1
  44. package/dist/guards-evaluator/regex.js +91 -4
  45. package/dist/guards-evaluator/regex.js.map +1 -1
  46. package/dist/guards-evaluator/shell-files.js +587 -0
  47. package/dist/guards-evaluator/shell-files.js.map +1 -0
  48. package/dist/guards-evaluator/triage.js +32 -2
  49. package/dist/guards-evaluator/triage.js.map +1 -1
  50. package/dist/hook-runner.js +25598 -5432
  51. package/dist/hooks/install.js +8 -3
  52. package/dist/hooks/install.js.map +1 -1
  53. package/dist/hooks/runtime/antigravity-session.js +109 -50
  54. package/dist/hooks/runtime/antigravity-session.js.map +1 -1
  55. package/dist/hooks/runtime/apply-patch.js +92 -0
  56. package/dist/hooks/runtime/apply-patch.js.map +1 -0
  57. package/dist/hooks/runtime/caller-gate.js +27 -0
  58. package/dist/hooks/runtime/caller-gate.js.map +1 -0
  59. package/dist/hooks/runtime/code-mode.js +259 -0
  60. package/dist/hooks/runtime/code-mode.js.map +1 -0
  61. package/dist/hooks/runtime/dependency-check/api.js +179 -0
  62. package/dist/hooks/runtime/dependency-check/api.js.map +1 -0
  63. package/dist/hooks/runtime/dependency-check/capabilities.js +99 -0
  64. package/dist/hooks/runtime/dependency-check/capabilities.js.map +1 -0
  65. package/dist/hooks/runtime/dependency-check/checked-packages.js +48 -0
  66. package/dist/hooks/runtime/dependency-check/checked-packages.js.map +1 -0
  67. package/dist/hooks/runtime/dependency-check/commands/cwd.js +154 -0
  68. package/dist/hooks/runtime/dependency-check/commands/cwd.js.map +1 -0
  69. package/dist/hooks/runtime/dependency-check/commands/env.js +99 -0
  70. package/dist/hooks/runtime/dependency-check/commands/env.js.map +1 -0
  71. package/dist/hooks/runtime/dependency-check/commands/flags.js +164 -0
  72. package/dist/hooks/runtime/dependency-check/commands/flags.js.map +1 -0
  73. package/dist/hooks/runtime/dependency-check/commands/managers.js +418 -0
  74. package/dist/hooks/runtime/dependency-check/commands/managers.js.map +1 -0
  75. package/dist/hooks/runtime/dependency-check/commands/peel.js +111 -0
  76. package/dist/hooks/runtime/dependency-check/commands/peel.js.map +1 -0
  77. package/dist/hooks/runtime/dependency-check/commands/shell.js +217 -0
  78. package/dist/hooks/runtime/dependency-check/commands/shell.js.map +1 -0
  79. package/dist/hooks/runtime/dependency-check/commands/types.js +4 -0
  80. package/dist/hooks/runtime/dependency-check/commands/types.js.map +1 -0
  81. package/dist/hooks/runtime/dependency-check/commands.js +34 -0
  82. package/dist/hooks/runtime/dependency-check/commands.js.map +1 -0
  83. package/dist/hooks/runtime/dependency-check/deadlines.js +69 -0
  84. package/dist/hooks/runtime/dependency-check/deadlines.js.map +1 -0
  85. package/dist/hooks/runtime/dependency-check/dispatch.js +344 -0
  86. package/dist/hooks/runtime/dependency-check/dispatch.js.map +1 -0
  87. package/dist/hooks/runtime/dependency-check/entering.js +63 -0
  88. package/dist/hooks/runtime/dependency-check/entering.js.map +1 -0
  89. package/dist/hooks/runtime/dependency-check/exec-cache.js +36 -0
  90. package/dist/hooks/runtime/dependency-check/exec-cache.js.map +1 -0
  91. package/dist/hooks/runtime/dependency-check/git-blob.js +116 -0
  92. package/dist/hooks/runtime/dependency-check/git-blob.js.map +1 -0
  93. package/dist/hooks/runtime/dependency-check/hook.js +418 -0
  94. package/dist/hooks/runtime/dependency-check/hook.js.map +1 -0
  95. package/dist/hooks/runtime/dependency-check/local-store.js +74 -0
  96. package/dist/hooks/runtime/dependency-check/local-store.js.map +1 -0
  97. package/dist/hooks/runtime/dependency-check/lockfile-walk.js +89 -0
  98. package/dist/hooks/runtime/dependency-check/lockfile-walk.js.map +1 -0
  99. package/dist/hooks/runtime/dependency-check/lockfiles/bun.js +153 -0
  100. package/dist/hooks/runtime/dependency-check/lockfiles/bun.js.map +1 -0
  101. package/dist/hooks/runtime/dependency-check/lockfiles/by-name.js +46 -0
  102. package/dist/hooks/runtime/dependency-check/lockfiles/by-name.js.map +1 -0
  103. package/dist/hooks/runtime/dependency-check/lockfiles/cargo.js +91 -0
  104. package/dist/hooks/runtime/dependency-check/lockfiles/cargo.js.map +1 -0
  105. package/dist/hooks/runtime/dependency-check/lockfiles/composer.js +98 -0
  106. package/dist/hooks/runtime/dependency-check/lockfiles/composer.js.map +1 -0
  107. package/dist/hooks/runtime/dependency-check/lockfiles/gemfile.js +88 -0
  108. package/dist/hooks/runtime/dependency-check/lockfiles/gemfile.js.map +1 -0
  109. package/dist/hooks/runtime/dependency-check/lockfiles/go-mod.js +154 -0
  110. package/dist/hooks/runtime/dependency-check/lockfiles/go-mod.js.map +1 -0
  111. package/dist/hooks/runtime/dependency-check/lockfiles/gradle-lockfile.js +27 -0
  112. package/dist/hooks/runtime/dependency-check/lockfiles/gradle-lockfile.js.map +1 -0
  113. package/dist/hooks/runtime/dependency-check/lockfiles/graph.js +131 -0
  114. package/dist/hooks/runtime/dependency-check/lockfiles/graph.js.map +1 -0
  115. package/dist/hooks/runtime/dependency-check/lockfiles/npm.js +107 -0
  116. package/dist/hooks/runtime/dependency-check/lockfiles/npm.js.map +1 -0
  117. package/dist/hooks/runtime/dependency-check/lockfiles/nuget-packages-lock.js +60 -0
  118. package/dist/hooks/runtime/dependency-check/lockfiles/nuget-packages-lock.js.map +1 -0
  119. package/dist/hooks/runtime/dependency-check/lockfiles/pins.js +105 -0
  120. package/dist/hooks/runtime/dependency-check/lockfiles/pins.js.map +1 -0
  121. package/dist/hooks/runtime/dependency-check/lockfiles/pip-report.js +34 -0
  122. package/dist/hooks/runtime/dependency-check/lockfiles/pip-report.js.map +1 -0
  123. package/dist/hooks/runtime/dependency-check/lockfiles/pnpm.js +109 -0
  124. package/dist/hooks/runtime/dependency-check/lockfiles/pnpm.js.map +1 -0
  125. package/dist/hooks/runtime/dependency-check/lockfiles/poetry.js +105 -0
  126. package/dist/hooks/runtime/dependency-check/lockfiles/poetry.js.map +1 -0
  127. package/dist/hooks/runtime/dependency-check/lockfiles/uv.js +181 -0
  128. package/dist/hooks/runtime/dependency-check/lockfiles/uv.js.map +1 -0
  129. package/dist/hooks/runtime/dependency-check/lockfiles/yaml.js +319 -0
  130. package/dist/hooks/runtime/dependency-check/lockfiles/yaml.js.map +1 -0
  131. package/dist/hooks/runtime/dependency-check/lockfiles/yarn-berry.js +71 -0
  132. package/dist/hooks/runtime/dependency-check/lockfiles/yarn-berry.js.map +1 -0
  133. package/dist/hooks/runtime/dependency-check/lockfiles/yarn1.js +144 -0
  134. package/dist/hooks/runtime/dependency-check/lockfiles/yarn1.js.map +1 -0
  135. package/dist/hooks/runtime/dependency-check/manifests/apply.js +110 -0
  136. package/dist/hooks/runtime/dependency-check/manifests/apply.js.map +1 -0
  137. package/dist/hooks/runtime/dependency-check/manifests/diff.js +127 -0
  138. package/dist/hooks/runtime/dependency-check/manifests/diff.js.map +1 -0
  139. package/dist/hooks/runtime/dependency-check/manifests/edit.js +259 -0
  140. package/dist/hooks/runtime/dependency-check/manifests/edit.js.map +1 -0
  141. package/dist/hooks/runtime/dependency-check/manifests/json.js +109 -0
  142. package/dist/hooks/runtime/dependency-check/manifests/json.js.map +1 -0
  143. package/dist/hooks/runtime/dependency-check/manifests/kind.js +40 -0
  144. package/dist/hooks/runtime/dependency-check/manifests/kind.js.map +1 -0
  145. package/dist/hooks/runtime/dependency-check/manifests/patch.js +179 -0
  146. package/dist/hooks/runtime/dependency-check/manifests/patch.js.map +1 -0
  147. package/dist/hooks/runtime/dependency-check/manifests/text.js +665 -0
  148. package/dist/hooks/runtime/dependency-check/manifests/text.js.map +1 -0
  149. package/dist/hooks/runtime/dependency-check/manifests/toml.js +350 -0
  150. package/dist/hooks/runtime/dependency-check/manifests/toml.js.map +1 -0
  151. package/dist/hooks/runtime/dependency-check/manifests.js +14 -0
  152. package/dist/hooks/runtime/dependency-check/manifests.js.map +1 -0
  153. package/dist/hooks/runtime/dependency-check/messages.js +270 -0
  154. package/dist/hooks/runtime/dependency-check/messages.js.map +1 -0
  155. package/dist/hooks/runtime/dependency-check/net-baseline.js +157 -0
  156. package/dist/hooks/runtime/dependency-check/net-baseline.js.map +1 -0
  157. package/dist/hooks/runtime/dependency-check/net-state.js +70 -0
  158. package/dist/hooks/runtime/dependency-check/net-state.js.map +1 -0
  159. package/dist/hooks/runtime/dependency-check/pending-forces.js +54 -0
  160. package/dist/hooks/runtime/dependency-check/pending-forces.js.map +1 -0
  161. package/dist/hooks/runtime/dependency-check/post-tool-use.js +108 -0
  162. package/dist/hooks/runtime/dependency-check/post-tool-use.js.map +1 -0
  163. package/dist/hooks/runtime/dependency-check/ranges.js +369 -0
  164. package/dist/hooks/runtime/dependency-check/ranges.js.map +1 -0
  165. package/dist/hooks/runtime/dependency-check/requirement-files.js +144 -0
  166. package/dist/hooks/runtime/dependency-check/requirement-files.js.map +1 -0
  167. package/dist/hooks/runtime/dependency-check/resolvers/bun.js +38 -0
  168. package/dist/hooks/runtime/dependency-check/resolvers/bun.js.map +1 -0
  169. package/dist/hooks/runtime/dependency-check/resolvers/bundler.js +218 -0
  170. package/dist/hooks/runtime/dependency-check/resolvers/bundler.js.map +1 -0
  171. package/dist/hooks/runtime/dependency-check/resolvers/cargo.js +303 -0
  172. package/dist/hooks/runtime/dependency-check/resolvers/cargo.js.map +1 -0
  173. package/dist/hooks/runtime/dependency-check/resolvers/composer.js +250 -0
  174. package/dist/hooks/runtime/dependency-check/resolvers/composer.js.map +1 -0
  175. package/dist/hooks/runtime/dependency-check/resolvers/config-files.js +27 -0
  176. package/dist/hooks/runtime/dependency-check/resolvers/config-files.js.map +1 -0
  177. package/dist/hooks/runtime/dependency-check/resolvers/direct-only-registry.js +409 -0
  178. package/dist/hooks/runtime/dependency-check/resolvers/direct-only-registry.js.map +1 -0
  179. package/dist/hooks/runtime/dependency-check/resolvers/direct-only.js +290 -0
  180. package/dist/hooks/runtime/dependency-check/resolvers/direct-only.js.map +1 -0
  181. package/dist/hooks/runtime/dependency-check/resolvers/gem.js +89 -0
  182. package/dist/hooks/runtime/dependency-check/resolvers/gem.js.map +1 -0
  183. package/dist/hooks/runtime/dependency-check/resolvers/go.js +313 -0
  184. package/dist/hooks/runtime/dependency-check/resolvers/go.js.map +1 -0
  185. package/dist/hooks/runtime/dependency-check/resolvers/npm.js +81 -0
  186. package/dist/hooks/runtime/dependency-check/resolvers/npm.js.map +1 -0
  187. package/dist/hooks/runtime/dependency-check/resolvers/pip.js +229 -0
  188. package/dist/hooks/runtime/dependency-check/resolvers/pip.js.map +1 -0
  189. package/dist/hooks/runtime/dependency-check/resolvers/pipx.js +8 -0
  190. package/dist/hooks/runtime/dependency-check/resolvers/pipx.js.map +1 -0
  191. package/dist/hooks/runtime/dependency-check/resolvers/pnpm.js +68 -0
  192. package/dist/hooks/runtime/dependency-check/resolvers/pnpm.js.map +1 -0
  193. package/dist/hooks/runtime/dependency-check/resolvers/poetry.js +70 -0
  194. package/dist/hooks/runtime/dependency-check/resolvers/poetry.js.map +1 -0
  195. package/dist/hooks/runtime/dependency-check/resolvers/project.js +208 -0
  196. package/dist/hooks/runtime/dependency-check/resolvers/project.js.map +1 -0
  197. package/dist/hooks/runtime/dependency-check/resolvers/python-index.js +270 -0
  198. package/dist/hooks/runtime/dependency-check/resolvers/python-index.js.map +1 -0
  199. package/dist/hooks/runtime/dependency-check/resolvers/python.js +229 -0
  200. package/dist/hooks/runtime/dependency-check/resolvers/python.js.map +1 -0
  201. package/dist/hooks/runtime/dependency-check/resolvers/registry.js +221 -0
  202. package/dist/hooks/runtime/dependency-check/resolvers/registry.js.map +1 -0
  203. package/dist/hooks/runtime/dependency-check/resolvers/shared.js +440 -0
  204. package/dist/hooks/runtime/dependency-check/resolvers/shared.js.map +1 -0
  205. package/dist/hooks/runtime/dependency-check/resolvers/tree.js +131 -0
  206. package/dist/hooks/runtime/dependency-check/resolvers/tree.js.map +1 -0
  207. package/dist/hooks/runtime/dependency-check/resolvers/uv.js +433 -0
  208. package/dist/hooks/runtime/dependency-check/resolvers/uv.js.map +1 -0
  209. package/dist/hooks/runtime/dependency-check/resolvers/xml-lite.js +132 -0
  210. package/dist/hooks/runtime/dependency-check/resolvers/xml-lite.js.map +1 -0
  211. package/dist/hooks/runtime/dependency-check/resolvers/yarn-berry.js +106 -0
  212. package/dist/hooks/runtime/dependency-check/resolvers/yarn-berry.js.map +1 -0
  213. package/dist/hooks/runtime/dependency-check/sandbox.js +328 -0
  214. package/dist/hooks/runtime/dependency-check/sandbox.js.map +1 -0
  215. package/dist/hooks/runtime/dependency-check/specs.js +171 -0
  216. package/dist/hooks/runtime/dependency-check/specs.js.map +1 -0
  217. package/dist/hooks/runtime/dependency-check/static-view.js +90 -0
  218. package/dist/hooks/runtime/dependency-check/static-view.js.map +1 -0
  219. package/dist/hooks/runtime/dependency-check/stop-net.js +278 -0
  220. package/dist/hooks/runtime/dependency-check/stop-net.js.map +1 -0
  221. package/dist/hooks/runtime/dependency-check/stop-wiring.js +94 -0
  222. package/dist/hooks/runtime/dependency-check/stop-wiring.js.map +1 -0
  223. package/dist/hooks/runtime/dependency-check/tool-call.js +130 -0
  224. package/dist/hooks/runtime/dependency-check/tool-call.js.map +1 -0
  225. package/dist/hooks/runtime/dependency-check/types.js +96 -0
  226. package/dist/hooks/runtime/dependency-check/types.js.map +1 -0
  227. package/dist/hooks/runtime/emit.js +240 -52
  228. package/dist/hooks/runtime/emit.js.map +1 -1
  229. package/dist/hooks/runtime/exit-deadlock-guard.js +24 -8
  230. package/dist/hooks/runtime/exit-deadlock-guard.js.map +1 -1
  231. package/dist/hooks/runtime/fetch-rules.js +78 -29
  232. package/dist/hooks/runtime/fetch-rules.js.map +1 -1
  233. package/dist/hooks/runtime/grep-include.js +228 -0
  234. package/dist/hooks/runtime/grep-include.js.map +1 -0
  235. package/dist/hooks/runtime/pre-compact.js +1 -1
  236. package/dist/hooks/runtime/pre-compact.js.map +1 -1
  237. package/dist/hooks/runtime/pre-invocation.js +3 -3
  238. package/dist/hooks/runtime/pre-invocation.js.map +1 -1
  239. package/dist/hooks/runtime/repo-registry.js +72 -0
  240. package/dist/hooks/runtime/repo-registry.js.map +1 -0
  241. package/dist/hooks/runtime/repo-scope.js +75 -0
  242. package/dist/hooks/runtime/repo-scope.js.map +1 -0
  243. package/dist/hooks/runtime/resolve.js +11 -2
  244. package/dist/hooks/runtime/resolve.js.map +1 -1
  245. package/dist/hooks/runtime/runner-args.js +17 -2
  246. package/dist/hooks/runtime/runner-args.js.map +1 -1
  247. package/dist/hooks/runtime/script-resolve.js +21 -5
  248. package/dist/hooks/runtime/script-resolve.js.map +1 -1
  249. package/dist/hooks/runtime/session-activation.js +71 -18
  250. package/dist/hooks/runtime/session-activation.js.map +1 -1
  251. package/dist/hooks/runtime/session-review.js +136 -66
  252. package/dist/hooks/runtime/session-review.js.map +1 -1
  253. package/dist/hooks/runtime/session-start.js +68 -13
  254. package/dist/hooks/runtime/session-start.js.map +1 -1
  255. package/dist/hooks/runtime/session-writes.js +11 -5
  256. package/dist/hooks/runtime/session-writes.js.map +1 -1
  257. package/dist/hooks/runtime/shell-writes.js +7 -88
  258. package/dist/hooks/runtime/shell-writes.js.map +1 -1
  259. package/dist/hooks/runtime/sniff.js +227 -2
  260. package/dist/hooks/runtime/sniff.js.map +1 -1
  261. package/dist/hooks/runtime/target-resolve.js +32 -17
  262. package/dist/hooks/runtime/target-resolve.js.map +1 -1
  263. package/dist/hooks/runtime/unmapped-tools.js +77 -1
  264. package/dist/hooks/runtime/unmapped-tools.js.map +1 -1
  265. package/dist/hooks/runtime/user-prompt-submit.js +1 -1
  266. package/dist/hooks/runtime/user-prompt-submit.js.map +1 -1
  267. package/dist/hooks/runtime/work-dir.js +3 -0
  268. package/dist/hooks/runtime/work-dir.js.map +1 -1
  269. package/dist/hooks/shim.js +27 -20
  270. package/dist/hooks/shim.js.map +1 -1
  271. package/dist/index.js +40 -3
  272. package/dist/index.js.map +1 -1
  273. package/dist/install-scope.js +12 -0
  274. package/dist/install-scope.js.map +1 -0
  275. package/dist/install.js +188 -78
  276. package/dist/install.js.map +1 -1
  277. package/dist/link.js +55 -5
  278. package/dist/link.js.map +1 -1
  279. package/dist/mcp/config/hook.js +25 -0
  280. package/dist/mcp/config/hook.js.map +1 -1
  281. package/dist/org.js +3 -1
  282. package/dist/org.js.map +1 -1
  283. package/dist/prompts.js +96 -12
  284. package/dist/prompts.js.map +1 -1
  285. package/dist/refresh-hooks.js +67 -15
  286. package/dist/refresh-hooks.js.map +1 -1
  287. package/dist/repo/exclude-block.js +112 -0
  288. package/dist/repo/exclude-block.js.map +1 -0
  289. package/dist/repo/footer.js +93 -0
  290. package/dist/repo/footer.js.map +1 -0
  291. package/dist/repo/git-repo.js +77 -0
  292. package/dist/repo/git-repo.js.map +1 -0
  293. package/dist/repo/guarded-write.js +45 -0
  294. package/dist/repo/guarded-write.js.map +1 -0
  295. package/dist/repo/install-repo.js +508 -0
  296. package/dist/repo/install-repo.js.map +1 -0
  297. package/dist/repo/machine-wiring.js +122 -0
  298. package/dist/repo/machine-wiring.js.map +1 -0
  299. package/dist/repo/mcp-json.js +57 -0
  300. package/dist/repo/mcp-json.js.map +1 -0
  301. package/dist/repo/registry.js +53 -0
  302. package/dist/repo/registry.js.map +1 -0
  303. package/dist/repo/repo-mode-guard.js +83 -0
  304. package/dist/repo/repo-mode-guard.js.map +1 -0
  305. package/dist/repo/repo-setups.js +123 -0
  306. package/dist/repo/repo-setups.js.map +1 -0
  307. package/dist/repo/repo-status.js +283 -0
  308. package/dist/repo/repo-status.js.map +1 -0
  309. package/dist/repo/uninstall-repo.js +56 -0
  310. package/dist/repo/uninstall-repo.js.map +1 -0
  311. package/dist/repo/unsupported.js +14 -0
  312. package/dist/repo/unsupported.js.map +1 -0
  313. package/dist/shim.js +9 -7
  314. package/dist/status.js +53 -11
  315. package/dist/status.js.map +1 -1
  316. package/dist/uninstall.js +51 -3
  317. package/dist/uninstall.js.map +1 -1
  318. package/dist/update.js +6 -1
  319. package/dist/update.js.map +1 -1
  320. package/package.json +5 -2
@@ -0,0 +1,94 @@
1
+ /**
2
+ * The Stop hook's side of the net (E10): the production collaborators of
3
+ * `lockfilesNet`, the time it may take, and the opt-out. `session-review.ts`
4
+ * calls `stopNetSection` once and appends what it returns to its one
5
+ * emission. SessionStart calls `takeNetBaseline`, the session's starting
6
+ * point the net compares with (`net-baseline.ts`).
7
+ */
8
+ import { homedir } from 'node:os';
9
+ import { makeUsageNotifier } from '../usage-block.js';
10
+ import { resolveTokenWithRefresh } from '../resolve.js';
11
+ import { checkDependencies } from './api.js';
12
+ import { makeCheckedPackages } from './checked-packages.js';
13
+ import { BASELINE_BUDGET_MS, baselineOf, makeNetBaselines } from './net-baseline.js';
14
+ import { makeNetState } from './net-state.js';
15
+ import { stopNetBudgetMs } from './deadlines.js';
16
+ import { findRepoRoot } from './git-blob.js';
17
+ import { lockfilesNet } from './stop-net.js';
18
+ /** Production deps; `overrides` replaces any of them (tests). */
19
+ export function productionNetDeps(ctx, overrides = {}) {
20
+ const env = process.env;
21
+ const target = async () => {
22
+ const project = await ctx.getProject();
23
+ if (!project.projectId)
24
+ return { kind: 'no_project' };
25
+ const token = await resolveTokenWithRefresh(ctx.config.region.mcpName);
26
+ if (!token)
27
+ return { kind: 'not_signed_in' };
28
+ return {
29
+ kind: 'ready',
30
+ projectId: project.projectId,
31
+ apiBase: env.CYBEDEFEND_API_BASE ?? project.apiBase ?? ctx.config.region.apiBase,
32
+ token,
33
+ };
34
+ };
35
+ return {
36
+ now: ctx.now ?? Date.now,
37
+ home: homedir(),
38
+ env,
39
+ execPath: process.execPath,
40
+ platform: process.platform,
41
+ client: ctx.client,
42
+ target,
43
+ check: (o) => checkDependencies(o),
44
+ checkedPackages: makeCheckedPackages(),
45
+ netState: makeNetState(),
46
+ netBaselines: makeNetBaselines(),
47
+ // The sentence reaches the agent through the Stop message, never stderr alone.
48
+ usageNotifier: makeUsageNotifier({ write: () => undefined }),
49
+ ...overrides,
50
+ };
51
+ }
52
+ /**
53
+ * The net's section for this Stop, or null. Nothing at all (no walk, no git,
54
+ * no call) under `hooks.enablePackageCheck === false`, and outside a git
55
+ * repository. Never throws.
56
+ */
57
+ export async function stopNetSection(ctx, overrides = {}) {
58
+ try {
59
+ if (ctx.config.hooks?.enablePackageCheck === false)
60
+ return null;
61
+ const repoRoot = findRepoRoot(ctx.folder);
62
+ if (repoRoot === null)
63
+ return null;
64
+ const deps = productionNetDeps(ctx, overrides);
65
+ return await lockfilesNet({
66
+ repoRoot,
67
+ sessionId: ctx.sessionId,
68
+ deadlineMs: stopNetBudgetMs(ctx.client, ctx.startedAt, deps.now()),
69
+ deps,
70
+ });
71
+ }
72
+ catch {
73
+ return null;
74
+ }
75
+ }
76
+ /**
77
+ * The session's starting point, taken by SessionStart once per session: the
78
+ * packages each lockfile of the folder's repository holds (names and
79
+ * versions). Nothing outside a git repository. Bounded in time, never throws.
80
+ */
81
+ export function takeNetBaseline(sessionId, folder, store = makeNetBaselines()) {
82
+ try {
83
+ if (sessionId === '')
84
+ return;
85
+ const repoRoot = findRepoRoot(folder);
86
+ if (repoRoot === null)
87
+ return;
88
+ store.keep(sessionId, repoRoot, () => baselineOf(repoRoot, { deadlineMs: BASELINE_BUDGET_MS }));
89
+ }
90
+ catch {
91
+ /* without a baseline the net compares with HEAD */
92
+ }
93
+ }
94
+ //# sourceMappingURL=stop-wiring.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"stop-wiring.js","sourceRoot":"","sources":["../../../../src/hooks/runtime/dependency-check/stop-wiring.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAGlC,OAAO,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AACtD,OAAO,EAAE,uBAAuB,EAAE,MAAM,eAAe,CAAC;AACxD,OAAO,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC;AAC7C,OAAO,EAAE,mBAAmB,EAAE,MAAM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AI;YAAE,OAAO;QAC9B,KAAK,CAAC,IAAI,CAAC,SAAS,EAAE,QAAQ,EAAE,GAAG,EAAE,CAAC,UAAU,CAAC,QAAQ,EAAE,EAAE,UAAU,EAAE,kBAAkB,EAAE,CAAC,CAAC,CAAC;IAClG,CAAC;IAAC,MAAM,CAAC;QACP,mDAAmD;IACrD,CAAC;AACH,CAAC"}
@@ -0,0 +1,130 @@
1
+ /**
2
+ * What the agent's tool call is, for the dependency check: a shell command
3
+ * (its text and the directory it starts in), or an edit of manifests (each
4
+ * file's path and format). Anything else is not the check's business.
5
+ *
6
+ * `mayAddPackages` is the fast exit: it reads the event alone, before any
7
+ * configuration, credential or file, and says no to a shell command that
8
+ * names no package manager and to an edit of any other file. It is a
9
+ * superset of what the command reader (`commands.ts`) recognises: a word is
10
+ * looked for with quotes and backslashes taken out (`n''pm` is `npm` to the
11
+ * shell), case-insensitively, after any path.
12
+ */
13
+ import { isAbsolute, resolve } from 'node:path';
14
+ import { sessionFolderOf } from '../session-activation.js';
15
+ import { contentAfterEdit, directChanges, directChangesFromPatch, manifestKindOf, splitPatchByFile, } from './manifests.js';
16
+ import { contentAfterPatch } from './manifests/apply.js';
17
+ /** A package manager's name as a word: what every command `commands.ts` reads starts with. */
18
+ const MANAGER_WORD_RE = /(?:^|[^A-Za-z0-9_.-])(?:npm|npx|pnpm|pnpx|yarn|bunx?|pip\d*(?:\.\d+)?|pipx|python\d*(?:\.\d+)?|py|uvx?|poetry|cargo|go|composer|bundle|gem|dotnet|dart|flutter)(?![A-Za-z0-9_.-])/i;
19
+ /** Whether a shell command may hold a package manager command. */
20
+ export function namesManager(command) {
21
+ return MANAGER_WORD_RE.test(command.replace(/['"\\]/g, ''));
22
+ }
23
+ const EDIT_TOOLS = new Set(['Write', 'Edit', 'MultiEdit']);
24
+ /** Shell tools sniff does not read as `Bash` (Codex's argv form, other names). */
25
+ const SHELL_TOOL_RE = /^(?:bash|shell|local_shell|run_command|run_terminal_cmd|exec)$/i;
26
+ const asObject = (v) => typeof v === 'object' && v !== null && !Array.isArray(v) ? v : null;
27
+ /** An argv as one command line, each argument quoted when it needs to be. */
28
+ function argvLine(argv) {
29
+ return argv.map((a) => (/^[A-Za-z0-9_./=:@%+,-]+$/.test(a) ? a : `'${a.replace(/'/g, "'\\''")}'`)).join(' ');
30
+ }
31
+ /** The shell command of the call, or null when it is not a shell call. */
32
+ export function shellCommandOf(event) {
33
+ if (event.toolName === 'Bash' && event.newContent !== '')
34
+ return event.newContent;
35
+ const tool = typeof event.raw.tool_name === 'string' ? event.raw.tool_name : event.toolName;
36
+ if (!SHELL_TOOL_RE.test(tool))
37
+ return null;
38
+ const c = asObject(event.raw.tool_input)?.command;
39
+ if (typeof c === 'string')
40
+ return c;
41
+ if (Array.isArray(c) && c.length > 0 && c.every((x) => typeof x === 'string'))
42
+ return argvLine(c);
43
+ return null;
44
+ }
45
+ /** The manifest paths an edit names, as written (relative ones unresolved). */
46
+ function namedPaths(event) {
47
+ if (EDIT_TOOLS.has(event.toolName))
48
+ return event.filePath === '' ? [] : [{ path: event.filePath }];
49
+ if (event.toolName !== 'apply_patch' || event.newContent === '')
50
+ return [];
51
+ return splitPatchByFile(event.newContent)
52
+ .filter((f) => f.op !== 'delete')
53
+ .map((f) => ({ path: f.path !== '' ? f.path : event.filePath, patch: f }))
54
+ .filter((f) => f.path !== '');
55
+ }
56
+ /** The fast exit: false for a call that can add no package. Reads the event only. */
57
+ export function mayAddPackages(event) {
58
+ const command = shellCommandOf(event);
59
+ if (command !== null)
60
+ return namesManager(command);
61
+ return namedPaths(event).some((f) => manifestKindOf(f.path) !== null);
62
+ }
63
+ /** Where a shell command starts: the client's own field, else the session's folder. */
64
+ function shellCwdOf(event, env) {
65
+ const folder = () => sessionFolderOf(event.raw, event.client, env);
66
+ let own;
67
+ if (event.client === 'windsurf')
68
+ own = asObject(event.raw.tool_info)?.cwd;
69
+ if (event.client === 'antigravity')
70
+ own = asObject(asObject(event.raw.toolCall)?.args)?.Cwd;
71
+ if (typeof own === 'string' && own !== '')
72
+ return isAbsolute(own) ? resolve(own) : resolve(folder(), own);
73
+ return folder();
74
+ }
75
+ /** The call as the check reads it, or null when it can add no package. */
76
+ export function readToolCall(event, env = process.env) {
77
+ if (!mayAddPackages(event))
78
+ return null;
79
+ const command = shellCommandOf(event);
80
+ if (command !== null)
81
+ return { kind: 'shell', command, cwd: shellCwdOf(event, env) };
82
+ const cwd = sessionFolderOf(event.raw, event.client, env);
83
+ const files = [];
84
+ for (const f of namedPaths(event)) {
85
+ const path = isAbsolute(f.path) ? resolve(f.path) : resolve(cwd, f.path);
86
+ const kind = manifestKindOf(path);
87
+ if (kind === null || files.some((x) => x.path === path))
88
+ continue;
89
+ files.push(f.patch ? { path, kind, patch: f.patch } : { path, kind });
90
+ }
91
+ return files.length > 0 ? { kind: 'edit', cwd, files } : null;
92
+ }
93
+ const changesSomething = (c) => c.specs.length > 0 || c.notVerified.length > 0;
94
+ /**
95
+ * The manifest edits to check: each file's content after the edit and what
96
+ * it adds or changes. An edit that cannot land (its `old_string` is not in
97
+ * the file) or that changes no dependency gives nothing. A patch that cannot
98
+ * be applied to the file here is read from its hunks alone (`contentKnown`
99
+ * false: its content is the file as it is now).
100
+ */
101
+ export function editTriggers(event, call, readText) {
102
+ const out = [];
103
+ for (const f of call.files) {
104
+ const current = readText(f.path);
105
+ let content;
106
+ let changes;
107
+ let contentKnown = true;
108
+ if (f.patch) {
109
+ content = contentAfterPatch(current, f.patch);
110
+ if (content !== null)
111
+ changes = directChanges(f.kind, current, content);
112
+ else {
113
+ changes = directChangesFromPatch(f.kind, event.newContent, f.path, call.cwd);
114
+ content = current ?? '';
115
+ contentKnown = false;
116
+ }
117
+ }
118
+ else {
119
+ content = contentAfterEdit(event, current);
120
+ if (content === null)
121
+ continue;
122
+ changes = directChanges(f.kind, current, content);
123
+ }
124
+ if (!changesSomething(changes))
125
+ continue;
126
+ out.push({ trigger: { kind: 'edit', path: f.path, manifestKind: f.kind, content, changes }, contentKnown });
127
+ }
128
+ return out;
129
+ }
130
+ //# sourceMappingURL=tool-call.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tool-call.js","sourceRoot":"","sources":["../../../../src/hooks/runtime/dependency-check/tool-call.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AACH,OAAO,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEhD,OAAO,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;AAE3D,OAAO,EACL,gBAAgB,EAChB,aAAa,EACb,sBAAsB,EACtB,cAAc,EACd,gBAAgB,GAEjB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAiCzD,8FAA8F;AAC9F,MAAM,eAAe,GACnB,oLAAoL,CAAC;AAEvL,kEAAkE;AAClE,MAAM,UAAU,YAAY,CAAC,OAAe;IAC1C,OAAO,eAAe,CAAC,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,SAAS,EAAE,EAAE,CAAC,CAAC,CAAC;AAC9D,CAAC;AAED,MAAM,UAAU,GAAG,IAAI,GAAG,CAAC,CAAC,OAAO,EAAE,MAAM,EAAE,WAAW,CAAC,CAAC,CAAC;AAC3D,kFAAkF;AAClF,MAAM,aAAa,GAAG,iEAAiE,CAAC;AAExF,MAAM,QAAQ,GAAG,CAAC,CAAU,EAAkC,EAAE,CAC9D,OAAO,CAAC,KAAK,QAAQ,IAAI,CAAC,KAAK,IAAI,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,CAAE,CAA6B,CAAC,CAAC,CAAC,IAAI,CAAC;AAEnG,6EAA6E;AAC7E,SAAS,QAAQ,CAAC,IAAc;IAC9B,OAAO,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,0BAA0B,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAA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K,CAAC,UAAU,EAAE,CAAC,CAAC,IAAI,EAAE,IAAI,CAAC,GAAG,CAAC,CAAC;gBAC7E,OAAO,GAAG,OAAO,IAAI,EAAE,CAAC;gBACxB,YAAY,GAAG,KAAK,CAAC;YACvB,CAAC;QACH,CAAC;aAAM,CAAC;YACN,OAAO,GAAG,gBAAgB,CAAC,KAAK,EAAE,OAAO,CAAC,CAAC;YAC3C,IAAI,OAAO,KAAK,IAAI;gBAAE,SAAS;YAC/B,OAAO,GAAG,aAAa,CAAC,CAAC,CAAC,IAAI,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC;QACpD,CAAC;QACD,IAAI,CAAC,gBAAgB,CAAC,OAAO,CAAC;YAAE,SAAS;QACzC,GAAG,CAAC,IAAI,CAAC,EAAE,OAAO,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC,IAAI,EAAE,YAAY,EAAE,CAAC,CAAC,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,EAAE,YAAY,EAAE,CAAC,CAAC;IAC9G,CAAC;IACD,OAAO,GAAG,CAAC;AACb,CAAC"}
@@ -0,0 +1,96 @@
1
+ /** OSV's ecosystem names: a closed list. */
2
+ export const ECOSYSTEMS = [
3
+ 'npm',
4
+ 'PyPI',
5
+ 'crates.io',
6
+ 'Go',
7
+ 'Packagist',
8
+ 'RubyGems',
9
+ 'Maven',
10
+ 'NuGet',
11
+ 'Pub',
12
+ 'Hex',
13
+ ];
14
+ export const MANAGER_IDS = [
15
+ 'npm',
16
+ 'pnpm',
17
+ 'yarn',
18
+ 'yarn1',
19
+ 'bun',
20
+ 'pip',
21
+ 'uv',
22
+ 'poetry',
23
+ 'pipx',
24
+ 'cargo',
25
+ 'go',
26
+ 'composer',
27
+ 'bundler',
28
+ 'gem',
29
+ 'dotnet',
30
+ 'maven',
31
+ 'gradle',
32
+ 'dart',
33
+ 'mix',
34
+ ];
35
+ export const TRIGGERS = ['add', 'edit', 'exec', 'lockfile'];
36
+ export const RESOLUTIONS = ['full', 'direct_only'];
37
+ /** Bounds enforced by the gateway DTO. */
38
+ export const DEPENDENCY_CHECK_MAX_PACKAGES = 5000;
39
+ export const NAME_MAX = 256;
40
+ export const NPM_NAME_MAX = 214;
41
+ export const VERSION_MAX = 128;
42
+ export const VIA_MAX = 256;
43
+ /** `codingAgent`, at most 100 characters (the gateway DTO's bound). */
44
+ export const CODING_AGENT_MAX = 100;
45
+ /**
46
+ * Why a package, or a tree, was not verified: a closed list. `custom_registry`
47
+ * is a registry named on the command line (the tree is not resolved against
48
+ * the default one); `workspace_too_large`, more workspace manifests than a
49
+ * resolution copies; `include_not_followed`, a file a requirements file
50
+ * includes (`-r`, `-c`), which is never read.
51
+ */
52
+ export const NOT_VERIFIED_REASONS = [
53
+ 'git_or_url',
54
+ 'source_only',
55
+ 'version_range',
56
+ 'resolution_failed',
57
+ 'resolution_timeout',
58
+ 'manager_missing',
59
+ 'project_code',
60
+ 'custom_registry',
61
+ 'workspace_too_large',
62
+ 'include_not_followed',
63
+ ];
64
+ /** Every key a body, and a package of it, can carry. */
65
+ export const CHECK_BODY_KEYS = [
66
+ 'trigger',
67
+ 'resolution',
68
+ 'codingAgent',
69
+ 'packages',
70
+ ];
71
+ export const CHECKED_PACKAGE_KEYS = [
72
+ 'ecosystem',
73
+ 'name',
74
+ 'version',
75
+ 'direct',
76
+ 'via',
77
+ 'publicRegistry',
78
+ ];
79
+ /** The manifest formats an edit can change (`manifestKindOf`). */
80
+ export const MANIFEST_KINDS = [
81
+ 'package.json',
82
+ 'requirements*.txt',
83
+ 'pyproject.toml',
84
+ 'Pipfile',
85
+ 'Cargo.toml',
86
+ 'go.mod',
87
+ 'composer.json',
88
+ 'Gemfile',
89
+ '*.gemspec',
90
+ 'pom.xml',
91
+ 'build.gradle',
92
+ '*.csproj',
93
+ 'pubspec.yaml',
94
+ 'mix.exs',
95
+ ];
96
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types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