@wrongstack/plugins 0.284.1 → 0.286.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 (263) hide show
  1. package/README.md +18 -14
  2. package/dist/accessibility-auditor/index.d.ts +38 -0
  3. package/dist/accessibility-auditor/index.d.ts.map +1 -0
  4. package/dist/accessibility-auditor.d.ts +2 -40
  5. package/dist/accessibility-auditor.js +10 -15
  6. package/dist/agent-handoff/index.d.ts +35 -0
  7. package/dist/agent-handoff/index.d.ts.map +1 -0
  8. package/dist/agent-handoff.d.ts +2 -37
  9. package/dist/agent-handoff.js +3 -2
  10. package/dist/api-compatibility-gate/index.d.ts +36 -0
  11. package/dist/api-compatibility-gate/index.d.ts.map +1 -0
  12. package/dist/api-compatibility-gate.d.ts +2 -38
  13. package/dist/api-compatibility-gate.js +6 -6
  14. package/dist/auto-doc/index.d.ts +20 -0
  15. package/dist/auto-doc/index.d.ts.map +1 -0
  16. package/dist/auto-doc.d.ts +2 -22
  17. package/dist/auto-doc.js +5 -5
  18. package/dist/auto-escalate/index.d.ts +43 -0
  19. package/dist/auto-escalate/index.d.ts.map +1 -0
  20. package/dist/auto-escalate.d.ts +2 -45
  21. package/dist/auto-escalate.js +5 -2
  22. package/dist/auto-i18n-extractor/index.d.ts +34 -0
  23. package/dist/auto-i18n-extractor/index.d.ts.map +1 -0
  24. package/dist/auto-i18n-extractor.d.ts +2 -36
  25. package/dist/auto-i18n-extractor.js +6 -7
  26. package/dist/branch-guard/index.d.ts +32 -0
  27. package/dist/branch-guard/index.d.ts.map +1 -0
  28. package/dist/branch-guard.d.ts +2 -34
  29. package/dist/branch-guard.js +4 -4
  30. package/dist/catalog.d.ts +39 -0
  31. package/dist/catalog.d.ts.map +1 -0
  32. package/dist/changelog-writer/index.d.ts +71 -0
  33. package/dist/changelog-writer/index.d.ts.map +1 -0
  34. package/dist/changelog-writer.d.ts +2 -73
  35. package/dist/changelog-writer.js +9 -5
  36. package/dist/checkpoint/index.d.ts +53 -0
  37. package/dist/checkpoint/index.d.ts.map +1 -0
  38. package/dist/checkpoint.d.ts +2 -55
  39. package/dist/checkpoint.js +6 -6
  40. package/dist/code-metrics/index.d.ts +29 -0
  41. package/dist/code-metrics/index.d.ts.map +1 -0
  42. package/dist/code-metrics.d.ts +2 -31
  43. package/dist/code-metrics.js +13 -15
  44. package/dist/commit-validator/index.d.ts +31 -0
  45. package/dist/commit-validator/index.d.ts.map +1 -0
  46. package/dist/commit-validator.d.ts +2 -33
  47. package/dist/commit-validator.js +5 -3
  48. package/dist/config-validator/index.d.ts +46 -0
  49. package/dist/config-validator/index.d.ts.map +1 -0
  50. package/dist/config-validator.d.ts +2 -48
  51. package/dist/config-validator.js +8 -4
  52. package/dist/context-pins/index.d.ts +43 -0
  53. package/dist/context-pins/index.d.ts.map +1 -0
  54. package/dist/context-pins.d.ts +2 -45
  55. package/dist/context-pins.js +5 -5
  56. package/dist/cost-tracker/index.d.ts +51 -0
  57. package/dist/cost-tracker/index.d.ts.map +1 -0
  58. package/dist/cost-tracker.d.ts +2 -53
  59. package/dist/cost-tracker.js +4 -4
  60. package/dist/cron/index.d.ts +12 -0
  61. package/dist/cron/index.d.ts.map +1 -0
  62. package/dist/cron.d.ts +2 -14
  63. package/dist/cron.js +3 -2
  64. package/dist/dead-code-detector/index.d.ts +32 -0
  65. package/dist/dead-code-detector/index.d.ts.map +1 -0
  66. package/dist/dead-code-detector.d.ts +2 -34
  67. package/dist/dead-code-detector.js +8 -9
  68. package/dist/dep-guard/index.d.ts +63 -0
  69. package/dist/dep-guard/index.d.ts.map +1 -0
  70. package/dist/dep-guard.d.ts +2 -65
  71. package/dist/dep-guard.js +6 -2
  72. package/dist/dependency-vulnerability-gate/index.d.ts +33 -0
  73. package/dist/dependency-vulnerability-gate/index.d.ts.map +1 -0
  74. package/dist/dependency-vulnerability-gate.d.ts +2 -35
  75. package/dist/dependency-vulnerability-gate.js +5 -5
  76. package/dist/diff-summary/index.d.ts +34 -0
  77. package/dist/diff-summary/index.d.ts.map +1 -0
  78. package/dist/diff-summary.d.ts +2 -36
  79. package/dist/diff-summary.js +5 -5
  80. package/dist/doc-sync-guard/index.d.ts +31 -0
  81. package/dist/doc-sync-guard/index.d.ts.map +1 -0
  82. package/dist/doc-sync-guard.d.ts +2 -33
  83. package/dist/doc-sync-guard.js +4 -4
  84. package/dist/duplicate-code-detector/index.d.ts +31 -0
  85. package/dist/duplicate-code-detector/index.d.ts.map +1 -0
  86. package/dist/duplicate-code-detector.d.ts +2 -33
  87. package/dist/duplicate-code-detector.js +5 -5
  88. package/dist/error-lens/index.d.ts +65 -0
  89. package/dist/error-lens/index.d.ts.map +1 -0
  90. package/dist/error-lens.d.ts +2 -67
  91. package/dist/error-lens.js +5 -2
  92. package/dist/feature-flag-tracker/index.d.ts +36 -0
  93. package/dist/feature-flag-tracker/index.d.ts.map +1 -0
  94. package/dist/feature-flag-tracker.d.ts +2 -38
  95. package/dist/feature-flag-tracker.js +6 -7
  96. package/dist/file-watcher/index.d.ts +12 -0
  97. package/dist/file-watcher/index.d.ts.map +1 -0
  98. package/dist/file-watcher.d.ts +2 -14
  99. package/dist/file-watcher.js +7 -7
  100. package/dist/format-on-save/index.d.ts +33 -0
  101. package/dist/format-on-save/index.d.ts.map +1 -0
  102. package/dist/format-on-save.d.ts +2 -35
  103. package/dist/format-on-save.js +6 -6
  104. package/dist/git-autocommit/index.d.ts +15 -0
  105. package/dist/git-autocommit/index.d.ts.map +1 -0
  106. package/dist/git-autocommit.d.ts +2 -17
  107. package/dist/git-autocommit.js +5 -5
  108. package/dist/import-organizer/index.d.ts +50 -0
  109. package/dist/import-organizer/index.d.ts.map +1 -0
  110. package/dist/import-organizer.d.ts +2 -52
  111. package/dist/import-organizer.js +6 -6
  112. package/dist/index.d.ts +186 -64
  113. package/dist/index.d.ts.map +1 -0
  114. package/dist/index.js +992 -454
  115. package/dist/injection-shield/index.d.ts +47 -0
  116. package/dist/injection-shield/index.d.ts.map +1 -0
  117. package/dist/injection-shield.d.ts +2 -49
  118. package/dist/injection-shield.js +4 -2
  119. package/dist/interface-contract-guard/index.d.ts +35 -0
  120. package/dist/interface-contract-guard/index.d.ts.map +1 -0
  121. package/dist/interface-contract-guard.d.ts +2 -37
  122. package/dist/interface-contract-guard.js +6 -7
  123. package/dist/knowledge-graph/index.d.ts +43 -0
  124. package/dist/knowledge-graph/index.d.ts.map +1 -0
  125. package/dist/knowledge-graph.d.ts +2 -45
  126. package/dist/knowledge-graph.js +5 -5
  127. package/dist/license-audit-gate/index.d.ts +32 -0
  128. package/dist/license-audit-gate/index.d.ts.map +1 -0
  129. package/dist/license-audit-gate.d.ts +2 -34
  130. package/dist/license-audit-gate.js +6 -7
  131. package/dist/lint-gate/index.d.ts +31 -0
  132. package/dist/lint-gate/index.d.ts.map +1 -0
  133. package/dist/lint-gate.d.ts +2 -33
  134. package/dist/lint-gate.js +7 -7
  135. package/dist/llm-cache/index.d.ts +54 -0
  136. package/dist/llm-cache/index.d.ts.map +1 -0
  137. package/dist/llm-cache.d.ts +2 -56
  138. package/dist/llm-cache.js +6 -4
  139. package/dist/loop-breaker/index.d.ts +4 -0
  140. package/dist/loop-breaker/index.d.ts.map +1 -0
  141. package/dist/loop-breaker.d.ts +2 -5
  142. package/dist/loop-breaker.js +4 -4
  143. package/dist/migration-planner/index.d.ts +28 -0
  144. package/dist/migration-planner/index.d.ts.map +1 -0
  145. package/dist/migration-planner.d.ts +2 -30
  146. package/dist/migration-planner.js +5 -5
  147. package/dist/model-router/index.d.ts +67 -0
  148. package/dist/model-router/index.d.ts.map +1 -0
  149. package/dist/model-router.d.ts +2 -69
  150. package/dist/model-router.js +5 -2
  151. package/dist/notify-hub/index.d.ts +43 -0
  152. package/dist/notify-hub/index.d.ts.map +1 -0
  153. package/dist/notify-hub.d.ts +2 -45
  154. package/dist/notify-hub.js +3 -2
  155. package/dist/path-guard/index.d.ts +52 -0
  156. package/dist/path-guard/index.d.ts.map +1 -0
  157. package/dist/path-guard.d.ts +2 -54
  158. package/dist/path-guard.js +5 -2
  159. package/dist/performance-regression-gate/index.d.ts +31 -0
  160. package/dist/performance-regression-gate/index.d.ts.map +1 -0
  161. package/dist/performance-regression-gate.d.ts +2 -33
  162. package/dist/performance-regression-gate.js +5 -5
  163. package/dist/plugin-stack-observer/index.d.ts +33 -0
  164. package/dist/plugin-stack-observer/index.d.ts.map +1 -0
  165. package/dist/plugin-stack-observer.d.ts +2 -35
  166. package/dist/plugin-stack-observer.js +3 -2
  167. package/dist/pr-drafter/index.d.ts +33 -0
  168. package/dist/pr-drafter/index.d.ts.map +1 -0
  169. package/dist/pr-drafter.d.ts +2 -35
  170. package/dist/pr-drafter.js +6 -6
  171. package/dist/prompt-firewall/index.d.ts +55 -0
  172. package/dist/prompt-firewall/index.d.ts.map +1 -0
  173. package/dist/prompt-firewall.d.ts +2 -57
  174. package/dist/prompt-firewall.js +5 -2
  175. package/dist/refactor-suggester/index.d.ts +36 -0
  176. package/dist/refactor-suggester/index.d.ts.map +1 -0
  177. package/dist/refactor-suggester.d.ts +2 -38
  178. package/dist/refactor-suggester.js +16 -17
  179. package/dist/release-notes-generator/index.d.ts +25 -0
  180. package/dist/release-notes-generator/index.d.ts.map +1 -0
  181. package/dist/release-notes-generator.d.ts +2 -27
  182. package/dist/release-notes-generator.js +28 -10
  183. package/dist/runtime/index.d.ts +124 -0
  184. package/dist/runtime/index.d.ts.map +1 -0
  185. package/dist/runtime.d.ts +1 -0
  186. package/dist/runtime.js +216 -0
  187. package/dist/schema-evolution-guard/index.d.ts +40 -0
  188. package/dist/schema-evolution-guard/index.d.ts.map +1 -0
  189. package/dist/schema-evolution-guard.d.ts +2 -42
  190. package/dist/schema-evolution-guard.js +5 -5
  191. package/dist/secret-scanner/index.d.ts +32 -0
  192. package/dist/secret-scanner/index.d.ts.map +1 -0
  193. package/dist/secret-scanner.d.ts +2 -34
  194. package/dist/secret-scanner.js +3 -2
  195. package/dist/security-hotspot-scanner/index.d.ts +28 -0
  196. package/dist/security-hotspot-scanner/index.d.ts.map +1 -0
  197. package/dist/security-hotspot-scanner.d.ts +2 -30
  198. package/dist/security-hotspot-scanner.js +6 -6
  199. package/dist/semantic-search-indexer/index.d.ts +36 -0
  200. package/dist/semantic-search-indexer/index.d.ts.map +1 -0
  201. package/dist/semantic-search-indexer.d.ts +2 -38
  202. package/dist/semantic-search-indexer.js +22 -6
  203. package/dist/semver-bump/index.d.ts +24 -0
  204. package/dist/semver-bump/index.d.ts.map +1 -0
  205. package/dist/semver-bump.d.ts +2 -26
  206. package/dist/semver-bump.js +10 -8
  207. package/dist/session-recap/index.d.ts +48 -0
  208. package/dist/session-recap/index.d.ts.map +1 -0
  209. package/dist/session-recap.d.ts +2 -50
  210. package/dist/session-recap.js +6 -4
  211. package/dist/shell-check/index.d.ts +14 -0
  212. package/dist/shell-check/index.d.ts.map +1 -0
  213. package/dist/shell-check.d.ts +2 -16
  214. package/dist/shell-check.js +6 -6
  215. package/dist/smart-rename/index.d.ts +24 -0
  216. package/dist/smart-rename/index.d.ts.map +1 -0
  217. package/dist/smart-rename.d.ts +2 -26
  218. package/dist/smart-rename.js +5 -5
  219. package/dist/spec-linker/index.d.ts +49 -0
  220. package/dist/spec-linker/index.d.ts.map +1 -0
  221. package/dist/spec-linker.d.ts +2 -51
  222. package/dist/spec-linker.js +20086 -244
  223. package/dist/template-engine/index.d.ts +13 -0
  224. package/dist/template-engine/index.d.ts.map +1 -0
  225. package/dist/template-engine.d.ts +2 -15
  226. package/dist/template-engine.js +7 -7
  227. package/dist/test-coverage-gate/index.d.ts +35 -0
  228. package/dist/test-coverage-gate/index.d.ts.map +1 -0
  229. package/dist/test-coverage-gate.d.ts +2 -37
  230. package/dist/test-coverage-gate.js +5 -5
  231. package/dist/test-flake-detector/index.d.ts +25 -0
  232. package/dist/test-flake-detector/index.d.ts.map +1 -0
  233. package/dist/test-flake-detector.d.ts +2 -27
  234. package/dist/test-flake-detector.js +98 -13
  235. package/dist/test-generator/index.d.ts +30 -0
  236. package/dist/test-generator/index.d.ts.map +1 -0
  237. package/dist/test-generator.d.ts +2 -32
  238. package/dist/test-generator.js +19 -20
  239. package/dist/test-runner-gate/index.d.ts +35 -0
  240. package/dist/test-runner-gate/index.d.ts.map +1 -0
  241. package/dist/test-runner-gate.d.ts +2 -37
  242. package/dist/test-runner-gate.js +6 -6
  243. package/dist/todo-listener/index.d.ts +35 -0
  244. package/dist/todo-listener/index.d.ts.map +1 -0
  245. package/dist/todo-listener.d.ts +2 -37
  246. package/dist/todo-listener.js +3 -2
  247. package/dist/todo-tracker/index.d.ts +4 -0
  248. package/dist/todo-tracker/index.d.ts.map +1 -0
  249. package/dist/todo-tracker.d.ts +2 -5
  250. package/dist/todo-tracker.js +5 -5
  251. package/dist/token-budget/index.d.ts +38 -0
  252. package/dist/token-budget/index.d.ts.map +1 -0
  253. package/dist/token-budget.d.ts +2 -40
  254. package/dist/token-budget.js +3 -2
  255. package/dist/token-throttle/index.d.ts +52 -0
  256. package/dist/token-throttle/index.d.ts.map +1 -0
  257. package/dist/token-throttle.d.ts +2 -54
  258. package/dist/token-throttle.js +6 -2
  259. package/dist/type-gate/index.d.ts +35 -0
  260. package/dist/type-gate/index.d.ts.map +1 -0
  261. package/dist/type-gate.d.ts +2 -37
  262. package/dist/type-gate.js +236 -43
  263. package/package.json +10 -7
@@ -1,35 +1,2 @@
1
- import { Plugin } from '@wrongstack/core';
2
-
3
- /**
4
- * plugin-stack-observer — observability over the providerRunner wrap stack.
5
- *
6
- * Several official plugins (llm-cache, model-router, prompt-firewall,
7
- * token-throttle) register `AgentExtension.wrapProviderRunner` to
8
- * intercept every provider call. The runtime composes them in
9
- * registration order — but until now there was no way for an operator
10
- * (or the LLM itself) to see WHICH wraps are active in what order.
11
- *
12
- * Each wrap plugin emits `customEvent('provider.wrap:loaded', …)` on
13
- * setup. This plugin subscribes via `onPattern('provider.wrap:loaded')`
14
- * and:
15
- *
16
- * 1. Builds an in-memory stack (preserves emission order)
17
- * 2. Registers a system-prompt contributor that, when any wraps are
18
- * present, emits a compact one-line block listing them. The LLM
19
- * sees who is wrapping what, in registration order — making the
20
- * stack visible without /diag round-trips.
21
- *
22
- * Disabled by default (enabled=false) because not every user wants
23
- * the LLM to be aware of the wrap stack. The plugin_stack tool is
24
- * always registered so operators can read the stack at runtime
25
- * regardless of the contributor setting.
26
- *
27
- * Tools registered:
28
- * - plugin_stack_status : Read the active wrap stack + load order
29
- *
30
- * @public
31
- */
32
-
33
- declare const PLUGIN: Plugin;
34
-
35
- export { PLUGIN as default };
1
+ export * from './plugin-stack-observer/index.js';
2
+ export { default } from './plugin-stack-observer/index.js';
@@ -134,5 +134,6 @@ function readConfig(raw) {
134
134
  };
135
135
  }
136
136
  var plugin_stack_observer_default = PLUGIN;
137
-
138
- export { plugin_stack_observer_default as default };
137
+ export {
138
+ plugin_stack_observer_default as default
139
+ };
@@ -0,0 +1,33 @@
1
+ /**
2
+ * pr-drafter plugin — collects work done during a session and drafts a
3
+ * pull-request description.
4
+ *
5
+ * As the session runs, the plugin listens to:
6
+ * - `tool.completed` events for `git_autocommit` (records commit messages)
7
+ * - `tool.completed` events for `write`/`edit` (records changed files)
8
+ * - `provider.response` events (records model usage)
9
+ *
10
+ * On `Stop` it composes a markdown PR body and writes it to a configurable
11
+ * file (default: `.wrongstack/PR_DRAFT.md`). A `pr_draft` tool lets the
12
+ * agent request the draft on demand.
13
+ *
14
+ * Config (`config.extensions['pr-drafter']`):
15
+ *
16
+ * ```jsonc
17
+ * {
18
+ * "enabled": true,
19
+ * "outputPath": ".wrongstack/PR_DRAFT.md",
20
+ * "writeOnStop": true,
21
+ * "includeDiff": true,
22
+ * "includeCommits": true,
23
+ * "includeFiles": true,
24
+ * "aiSummary": false
25
+ * }
26
+ * ```
27
+ *
28
+ * @public
29
+ */
30
+ import type { Plugin } from '@wrongstack/core';
31
+ declare const plugin: Plugin;
32
+ export default plugin;
33
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/pr-drafter/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AAKH,OAAO,KAAK,EAAE,MAAM,EAAa,MAAM,kBAAkB,CAAC;AA4M1D,QAAA,MAAM,MAAM,EAAE,MAyNb,CAAC;eAEa,MAAM"}
@@ -1,35 +1,2 @@
1
- import { Plugin } from '@wrongstack/core';
2
-
3
- /**
4
- * pr-drafter plugin — collects work done during a session and drafts a
5
- * pull-request description.
6
- *
7
- * As the session runs, the plugin listens to:
8
- * - `tool.completed` events for `git_autocommit` (records commit messages)
9
- * - `tool.completed` events for `write`/`edit` (records changed files)
10
- * - `provider.response` events (records model usage)
11
- *
12
- * On `Stop` it composes a markdown PR body and writes it to a configurable
13
- * file (default: `.wrongstack/PR_DRAFT.md`). A `pr_draft` tool lets the
14
- * agent request the draft on demand.
15
- *
16
- * Config (`config.extensions['pr-drafter']`):
17
- *
18
- * ```jsonc
19
- * {
20
- * "enabled": true,
21
- * "outputPath": ".wrongstack/PR_DRAFT.md",
22
- * "writeOnStop": true,
23
- * "includeDiff": true,
24
- * "includeCommits": true,
25
- * "includeFiles": true,
26
- * "aiSummary": false
27
- * }
28
- * ```
29
- *
30
- * @public
31
- */
32
-
33
- declare const plugin: Plugin;
34
-
35
- export { plugin as default };
1
+ export * from './pr-drafter/index.js';
2
+ export { default } from './pr-drafter/index.js';
@@ -1,8 +1,7 @@
1
- import { execFileSync } from 'child_process';
2
- import { mkdirSync, writeFileSync } from 'fs';
3
- import { dirname, resolve, isAbsolute, relative } from 'path';
4
-
5
1
  // src/pr-drafter/index.ts
2
+ import { execFileSync } from "node:child_process";
3
+ import { mkdirSync, writeFileSync } from "node:fs";
4
+ import { dirname, isAbsolute, relative, resolve } from "node:path";
6
5
  var API_VERSION = "^0.1.10";
7
6
  var state = {
8
7
  commits: [],
@@ -330,5 +329,6 @@ var plugin = {
330
329
  }
331
330
  };
332
331
  var pr_drafter_default = plugin;
333
-
334
- export { pr_drafter_default as default };
332
+ export {
333
+ pr_drafter_default as default
334
+ };
@@ -0,0 +1,55 @@
1
+ /**
2
+ * prompt-firewall plugin — inspects and redacts secrets on the provider
3
+ * wire, before context leaves for the LLM API and as it returns.
4
+ *
5
+ * Distinct from `secret-scanner` (which guards the TOOL boundary): this
6
+ * sits on `AgentExtension.wrapProviderRunner`, so it sees the FULL
7
+ * request that is about to be sent to a third-party LLM provider —
8
+ * regardless of how a secret entered the conversation. It scans the
9
+ * outgoing request's system + message text for high-confidence
10
+ * credential patterns and, depending on `mode`:
11
+ *
12
+ * - `warn` (default) — logs + counts + emits a `prompt-firewall:leak`
13
+ * event; the request goes through unchanged
14
+ * - `redact` — replaces each match with `[REDACTED:<kind>]` in a CLONE
15
+ * of the request before sending, and also redacts secrets echoed back
16
+ * in the response
17
+ * - `block` — throws before the request is sent (the agent's error
18
+ * path surfaces it), so the secret never reaches the provider
19
+ *
20
+ * Safety posture: opt-in — loads inert until
21
+ * `config.extensions['prompt-firewall'].enabled = true`. `warn` is the
22
+ * default so it can never corrupt context until you deliberately choose
23
+ * `redact`/`block`.
24
+ *
25
+ * Config (`config.extensions['prompt-firewall']`):
26
+ *
27
+ * ```jsonc
28
+ * {
29
+ * "enabled": false,
30
+ * "mode": "warn", // "warn" | "redact" | "block"
31
+ * "scanResponse": true, // redact secrets echoed back (redact mode)
32
+ * "allow": [] // regex source strings to exempt (false positives)
33
+ * }
34
+ * ```
35
+ *
36
+ * Tools:
37
+ * - `prompt_firewall_status` — mode, pattern names, detection counters
38
+ *
39
+ * @public
40
+ */
41
+ import type { Plugin } from '@wrongstack/core';
42
+ export interface Detection {
43
+ kind: string;
44
+ count: number;
45
+ }
46
+ /** Detect secret matches in text. Returns per-kind counts (no values). */
47
+ export declare function detectSecrets(text: string, allow: RegExp[]): Detection[];
48
+ /** Redact secret matches in text, replacing each with `[REDACTED:<kind>]`. */
49
+ export declare function redactSecrets(text: string, allow: RegExp[]): {
50
+ text: string;
51
+ redactions: number;
52
+ };
53
+ declare const plugin: Plugin;
54
+ export default plugin;
55
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/prompt-firewall/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuCG;AACH,OAAO,KAAK,EAAE,MAAM,EAAa,MAAM,kBAAkB,CAAC;AA+B1D,MAAM,WAAW,SAAS;IACxB,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;CACf;AAED,0EAA0E;AAC1E,wBAAgB,aAAa,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,GAAG,SAAS,EAAE,CAcxE;AAED,8EAA8E;AAC9E,wBAAgB,aAAa,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,GAAG;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,UAAU,EAAE,MAAM,CAAA;CAAE,CAWjG;AA6GD,QAAA,MAAM,MAAM,EAAE,MAkNb,CAAC;eAEa,MAAM"}
@@ -1,57 +1,2 @@
1
- import { Plugin } from '@wrongstack/core';
2
-
3
- /**
4
- * prompt-firewall plugin — inspects and redacts secrets on the provider
5
- * wire, before context leaves for the LLM API and as it returns.
6
- *
7
- * Distinct from `secret-scanner` (which guards the TOOL boundary): this
8
- * sits on `AgentExtension.wrapProviderRunner`, so it sees the FULL
9
- * request that is about to be sent to a third-party LLM provider —
10
- * regardless of how a secret entered the conversation. It scans the
11
- * outgoing request's system + message text for high-confidence
12
- * credential patterns and, depending on `mode`:
13
- *
14
- * - `warn` (default) — logs + counts + emits a `prompt-firewall:leak`
15
- * event; the request goes through unchanged
16
- * - `redact` — replaces each match with `[REDACTED:<kind>]` in a CLONE
17
- * of the request before sending, and also redacts secrets echoed back
18
- * in the response
19
- * - `block` — throws before the request is sent (the agent's error
20
- * path surfaces it), so the secret never reaches the provider
21
- *
22
- * Safety posture: opt-in — loads inert until
23
- * `config.extensions['prompt-firewall'].enabled = true`. `warn` is the
24
- * default so it can never corrupt context until you deliberately choose
25
- * `redact`/`block`.
26
- *
27
- * Config (`config.extensions['prompt-firewall']`):
28
- *
29
- * ```jsonc
30
- * {
31
- * "enabled": false,
32
- * "mode": "warn", // "warn" | "redact" | "block"
33
- * "scanResponse": true, // redact secrets echoed back (redact mode)
34
- * "allow": [] // regex source strings to exempt (false positives)
35
- * }
36
- * ```
37
- *
38
- * Tools:
39
- * - `prompt_firewall_status` — mode, pattern names, detection counters
40
- *
41
- * @public
42
- */
43
-
44
- interface Detection {
45
- kind: string;
46
- count: number;
47
- }
48
- /** Detect secret matches in text. Returns per-kind counts (no values). */
49
- declare function detectSecrets(text: string, allow: RegExp[]): Detection[];
50
- /** Redact secret matches in text, replacing each with `[REDACTED:<kind>]`. */
51
- declare function redactSecrets(text: string, allow: RegExp[]): {
52
- text: string;
53
- redactions: number;
54
- };
55
- declare const plugin: Plugin;
56
-
57
- export { type Detection, plugin as default, detectSecrets, redactSecrets };
1
+ export * from './prompt-firewall/index.js';
2
+ export { default } from './prompt-firewall/index.js';
@@ -291,5 +291,8 @@ var plugin = {
291
291
  }
292
292
  };
293
293
  var prompt_firewall_default = plugin;
294
-
295
- export { prompt_firewall_default as default, detectSecrets, redactSecrets };
294
+ export {
295
+ prompt_firewall_default as default,
296
+ detectSecrets,
297
+ redactSecrets
298
+ };
@@ -0,0 +1,36 @@
1
+ /**
2
+ * refactor-suggester plugin — regex-based smell detector that suggests
3
+ * refactoring opportunities in source files.
4
+ *
5
+ * Tools registered:
6
+ * - suggest_refactors : Scan a file or directory for smells.
7
+ * - refactor_status : Report config + counters.
8
+ *
9
+ * Hooks registered:
10
+ * - PostToolUse with matcher `write|edit` to source files, injecting
11
+ * suggestions for the changed file.
12
+ *
13
+ * Config (`config.extensions['refactor-suggester']`):
14
+ *
15
+ * ```jsonc
16
+ * {
17
+ * "enabled": true,
18
+ * "extensions": [".ts", ".tsx", ".js", ".jsx"],
19
+ * "maxSuggestions": 20,
20
+ * "rules": { "longFunctionLines": 50, "maxParams": 5, "maxNesting": 3 }
21
+ * }
22
+ * ```
23
+ *
24
+ * @public
25
+ */
26
+ import type { Plugin } from '@wrongstack/core';
27
+ export type SmellType = 'long-function' | 'deep-nesting' | 'many-parameters' | 'magic-number' | 'console-log';
28
+ export interface RefactorSuggestion {
29
+ file: string;
30
+ line: number;
31
+ type: SmellType;
32
+ message: string;
33
+ }
34
+ declare const plugin: Plugin;
35
+ export default plugin;
36
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/refactor-suggester/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AAIH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAQ/C,MAAM,MAAM,SAAS,GACjB,eAAe,GACf,cAAc,GACd,iBAAiB,GACjB,cAAc,GACd,aAAa,CAAC;AAElB,MAAM,WAAW,kBAAkB;IACjC,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,SAAS,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;CACjB;AAgRD,QAAA,MAAM,MAAM,EAAE,MA4Nb,CAAC;eAEa,MAAM"}
@@ -1,38 +1,2 @@
1
- import { Plugin } from '@wrongstack/core';
2
-
3
- /**
4
- * refactor-suggester plugin — regex-based smell detector that suggests
5
- * refactoring opportunities in source files.
6
- *
7
- * Tools registered:
8
- * - suggest_refactors : Scan a file or directory for smells.
9
- * - refactor_status : Report config + counters.
10
- *
11
- * Hooks registered:
12
- * - PostToolUse with matcher `write|edit` to source files, injecting
13
- * suggestions for the changed file.
14
- *
15
- * Config (`config.extensions['refactor-suggester']`):
16
- *
17
- * ```jsonc
18
- * {
19
- * "enabled": true,
20
- * "extensions": [".ts", ".tsx", ".js", ".jsx"],
21
- * "maxSuggestions": 20,
22
- * "rules": { "longFunctionLines": 50, "maxParams": 5, "maxNesting": 3 }
23
- * }
24
- * ```
25
- *
26
- * @public
27
- */
28
-
29
- type SmellType = 'long-function' | 'deep-nesting' | 'many-parameters' | 'magic-number' | 'console-log';
30
- interface RefactorSuggestion {
31
- file: string;
32
- line: number;
33
- type: SmellType;
34
- message: string;
35
- }
36
- declare const plugin: Plugin;
37
-
38
- export { type RefactorSuggestion, type SmellType, plugin as default };
1
+ export * from './refactor-suggester/index.js';
2
+ export { default } from './refactor-suggester/index.js';
@@ -1,7 +1,6 @@
1
- import { readFileSync, existsSync, statSync, readdirSync } from 'fs';
2
- import { resolve, isAbsolute, relative, extname } from 'path';
3
-
4
1
  // src/refactor-suggester/index.ts
2
+ import { existsSync, readFileSync, readdirSync, statSync } from "node:fs";
3
+ import { extname, isAbsolute, relative, resolve } from "node:path";
5
4
  var API_VERSION = "^0.1.10";
6
5
  var state = {
7
6
  scanCount: 0,
@@ -105,21 +104,20 @@ function detectSmells(filePath, content, rules) {
105
104
  const lines = content.split(/\r?\n/);
106
105
  const stripped = content.replace(/\/\/.*$/gm, "").replace(/\/\*[\s\S]*?\*\//g, " ");
107
106
  const functionLikeRe = /(?:export\s+)?(?:async\s+)?(?:function\s+)?([A-Za-z_$][A-Za-z0-9_$]*)\s*\(([^)]*)\)\s*\{/g;
108
- let m;
109
107
  functionLikeRe.lastIndex = 0;
110
- while ((m = functionLikeRe.exec(stripped)) !== null) {
111
- const name = m[1];
112
- const paramsRaw = m[2];
108
+ for (const match of stripped.matchAll(functionLikeRe)) {
109
+ const name = match[1];
110
+ const paramsRaw = match[2];
113
111
  const params = paramsRaw.split(",").map((s) => s.trim()).filter((s) => s.length > 0);
114
112
  if (params.length > rules.maxParams) {
115
113
  suggestions.push({
116
114
  file: relativePath(filePath),
117
- line: content.slice(0, m.index).split(/\r?\n/).length,
115
+ line: content.slice(0, match.index).split(/\r?\n/).length,
118
116
  type: "many-parameters",
119
117
  message: `${name} has ${params.length} parameters (limit ${rules.maxParams})`
120
118
  });
121
119
  }
122
- const bodyStart = m.index + m[0].length;
120
+ const bodyStart = match.index + match[0].length;
123
121
  let depth = 1;
124
122
  let lineEnd = bodyStart;
125
123
  for (let i = bodyStart; i < stripped.length && depth > 0; i++) {
@@ -132,7 +130,7 @@ function detectSmells(filePath, content, rules) {
132
130
  if (bodyLines > rules.longFunctionLines) {
133
131
  suggestions.push({
134
132
  file: relativePath(filePath),
135
- line: content.slice(0, m.index).split(/\r?\n/).length,
133
+ line: content.slice(0, match.index).split(/\r?\n/).length,
136
134
  type: "long-function",
137
135
  message: `${name} spans ~${bodyLines} lines (limit ${rules.longFunctionLines})`
138
136
  });
@@ -163,15 +161,15 @@ function detectSmells(filePath, content, rules) {
163
161
  const magicRe = /\b-?\d+(?:\.\d+)?\b/g;
164
162
  const allowed = /* @__PURE__ */ new Set(["0", "1", "-1", "2"]);
165
163
  magicRe.lastIndex = 0;
166
- while ((m = magicRe.exec(content)) !== null) {
167
- const match = m[0];
164
+ for (const magicNumberMatch of content.matchAll(magicRe)) {
165
+ const match = magicNumberMatch[0];
168
166
  if (allowed.has(match)) continue;
169
- const before = content[m.index - 1];
170
- const after = content[m.index + match.length];
167
+ const before = content[magicNumberMatch.index - 1];
168
+ const after = content[magicNumberMatch.index + match.length];
171
169
  if (before === "[" && after === "]") continue;
172
170
  suggestions.push({
173
171
  file: relativePath(filePath),
174
- line: content.slice(0, m.index).split(/\r?\n/).length,
172
+ line: content.slice(0, magicNumberMatch.index).split(/\r?\n/).length,
175
173
  type: "magic-number",
176
174
  message: `magic number ${match} should be a named constant`
177
175
  });
@@ -378,5 +376,6 @@ var plugin = {
378
376
  }
379
377
  };
380
378
  var refactor_suggester_default = plugin;
381
-
382
- export { refactor_suggester_default as default };
379
+ export {
380
+ refactor_suggester_default as default
381
+ };
@@ -0,0 +1,25 @@
1
+ /**
2
+ * release-notes-generator plugin — generates grouped release notes from git
3
+ * history using conventional-commit parsing.
4
+ *
5
+ * Tool registered:
6
+ * - generate_release_notes : Produce grouped notes between two refs.
7
+ *
8
+ * No hooks are registered.
9
+ *
10
+ * Config (`config.extensions['release-notes-generator']`):
11
+ *
12
+ * ```jsonc
13
+ * {
14
+ * "enabled": true,
15
+ * "includeScope": true,
16
+ * "defaultFrom": "latest-tag"
17
+ * }
18
+ * ```
19
+ *
20
+ * @public
21
+ */
22
+ import type { Plugin } from '@wrongstack/core';
23
+ declare const plugin: Plugin;
24
+ export default plugin;
25
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/release-notes-generator/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAGH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAmL/C,QAAA,MAAM,MAAM,EAAE,MA+Gb,CAAC;eAEa,MAAM"}
@@ -1,27 +1,2 @@
1
- import { Plugin } from '@wrongstack/core';
2
-
3
- /**
4
- * release-notes-generator plugin — generates grouped release notes from git
5
- * history using conventional-commit parsing.
6
- *
7
- * Tool registered:
8
- * - generate_release_notes : Produce grouped notes between two refs.
9
- *
10
- * No hooks are registered.
11
- *
12
- * Config (`config.extensions['release-notes-generator']`):
13
- *
14
- * ```jsonc
15
- * {
16
- * "enabled": true,
17
- * "includeScope": true,
18
- * "defaultFrom": "latest-tag"
19
- * }
20
- * ```
21
- *
22
- * @public
23
- */
24
-
25
- declare const plugin: Plugin;
26
-
27
- export { plugin as default };
1
+ export * from './release-notes-generator/index.js';
2
+ export { default } from './release-notes-generator/index.js';
@@ -1,6 +1,5 @@
1
- import { execSync } from 'child_process';
2
-
3
1
  // src/release-notes-generator/index.ts
2
+ import { execFileSync } from "node:child_process";
4
3
  var API_VERSION = "^0.1.10";
5
4
  var state = {
6
5
  generateCount: 0,
@@ -41,23 +40,41 @@ function formatCommit(c, includeScope) {
41
40
  line += ` ${c.description}`;
42
41
  return line;
43
42
  }
43
+ var GIT_OPTIONS = {
44
+ encoding: "utf-8",
45
+ stdio: ["pipe", "pipe", "ignore"],
46
+ shell: false
47
+ };
44
48
  function resolveFromRef(defaultFrom, inputFrom) {
45
49
  if (inputFrom) return inputFrom;
46
50
  if (defaultFrom === "latest-tag") {
47
51
  try {
48
- return execSync("git describe --tags --abbrev=0", { encoding: "utf-8", stdio: ["pipe", "pipe", "ignore"] }).trim();
52
+ return execFileSync("git", ["describe", "--tags", "--abbrev=0"], GIT_OPTIONS).trim();
49
53
  } catch {
50
54
  return "";
51
55
  }
52
56
  }
53
57
  return defaultFrom;
54
58
  }
59
+ function resolveCommit(ref) {
60
+ const resolved = execFileSync(
61
+ "git",
62
+ ["rev-parse", "--verify", "--end-of-options", `${ref}^{commit}`],
63
+ GIT_OPTIONS
64
+ ).trim();
65
+ if (!/^[0-9a-f]{40,64}$/i.test(resolved)) {
66
+ throw new Error(`git returned an invalid commit id for ref ${JSON.stringify(ref)}`);
67
+ }
68
+ return resolved;
69
+ }
55
70
  function getCommits(from, to) {
56
- const range = from ? `${from}..${to}` : to;
57
- const output = execSync(`git log --pretty=format:'%H%x09%s' ${range}`, {
58
- encoding: "utf-8",
59
- stdio: ["pipe", "pipe", "ignore"]
60
- });
71
+ const toCommit = resolveCommit(to);
72
+ const range = from ? `${resolveCommit(from)}..${toCommit}` : toCommit;
73
+ const output = execFileSync(
74
+ "git",
75
+ ["log", "--pretty=format:%H%x09%s", "--end-of-options", range],
76
+ GIT_OPTIONS
77
+ );
61
78
  if (!output.trim()) return [];
62
79
  const commits = [];
63
80
  for (const line of output.split(/\r?\n/)) {
@@ -205,5 +222,6 @@ var plugin = {
205
222
  }
206
223
  };
207
224
  var release_notes_generator_default = plugin;
208
-
209
- export { release_notes_generator_default as default };
225
+ export {
226
+ release_notes_generator_default as default
227
+ };