@wrongstack/plugins 0.284.0 → 0.285.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 +5 -5
  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 +5 -5
  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 +5 -5
  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 +5 -5
  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 +5 -5
  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 +946 -394
  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 +5 -5
  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 +5 -5
  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 +5 -5
  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 +5 -5
  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 +20100 -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 +5 -5
  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
@@ -0,0 +1,13 @@
1
+ /**
2
+ * template-engine plugin — File template expansion with variable substitution.
3
+ *
4
+ * Tools registered:
5
+ * - template_expand: Expand a template string with variables
6
+ * - template_render: Read a template file and expand it
7
+ * - template_create: Save a named template to the plugin store
8
+ * - template_list: List all saved templates
9
+ */
10
+ import type { Plugin } from '@wrongstack/core';
11
+ declare const plugin: Plugin;
12
+ export default plugin;
13
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/template-engine/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAqH/C,QAAA,MAAM,MAAM,EAAE,MA+Sb,CAAC;eAEa,MAAM"}
@@ -1,15 +1,2 @@
1
- import { Plugin } from '@wrongstack/core';
2
-
3
- /**
4
- * template-engine plugin — File template expansion with variable substitution.
5
- *
6
- * Tools registered:
7
- * - template_expand: Expand a template string with variables
8
- * - template_render: Read a template file and expand it
9
- * - template_create: Save a named template to the plugin store
10
- * - template_list: List all saved templates
11
- */
12
-
13
- declare const plugin: Plugin;
14
-
15
- export { plugin as default };
1
+ export * from './template-engine/index.js';
2
+ export { default } from './template-engine/index.js';
@@ -1,6 +1,5 @@
1
- import { isAbsolute } from 'path';
2
-
3
1
  // src/template-engine/index.ts
2
+ import { isAbsolute } from "node:path";
4
3
  var API_VERSION = "^0.1.10";
5
4
  var templates = /* @__PURE__ */ new Map();
6
5
  function expandTemplate(template, variables) {
@@ -120,7 +119,7 @@ var plugin = {
120
119
  if (output_path) {
121
120
  const pathError = validateRelativeTemplatePath("output_path", output_path);
122
121
  if (pathError) return { ok: false, error: pathError };
123
- const { writeFileSync } = await import('fs');
122
+ const { writeFileSync } = await import("node:fs");
124
123
  writeFileSync(output_path, result, "utf-8");
125
124
  return {
126
125
  ok: true,
@@ -174,7 +173,7 @@ var plugin = {
174
173
  }
175
174
  let content;
176
175
  try {
177
- const { readFileSync } = await import('fs');
176
+ const { readFileSync } = await import("node:fs");
178
177
  content = readFileSync(template_path, "utf-8");
179
178
  } catch (err) {
180
179
  return { ok: false, error: `Could not read template file: ${err}` };
@@ -188,7 +187,7 @@ var plugin = {
188
187
  if (output_path) {
189
188
  const pathError = validateRelativeTemplatePath("output_path", output_path);
190
189
  if (pathError) return { ok: false, error: pathError };
191
- const { writeFileSync } = await import('fs');
190
+ const { writeFileSync } = await import("node:fs");
192
191
  writeFileSync(output_path, result, "utf-8");
193
192
  return {
194
193
  ok: true,
@@ -306,5 +305,6 @@ var plugin = {
306
305
  }
307
306
  };
308
307
  var template_engine_default = plugin;
309
-
310
- export { template_engine_default as default };
308
+ export {
309
+ template_engine_default as default
310
+ };
@@ -0,0 +1,35 @@
1
+ /**
2
+ * test-coverage-gate plugin — PostToolUse hook that watches for test
3
+ * coverage regressions after source-file edits.
4
+ *
5
+ * The plugin reads a coverage summary (e.g. `coverage/coverage-summary.json`
6
+ * produced by c8/vitest/istanbul) after each `write`/`edit` to a source
7
+ * file, compares it to the previous snapshot, and warns/block when the
8
+ * overall coverage drops below a configured threshold or when a single
9
+ * edited file loses coverage.
10
+ *
11
+ * Tools registered:
12
+ * - coverage_gate_status : Show config + per-session counters + last diff.
13
+ *
14
+ * Hooks registered:
15
+ * - PostToolUse with matcher `write|edit`.
16
+ *
17
+ * Config (`config.extensions['test-coverage-gate']`):
18
+ *
19
+ * ```jsonc
20
+ * {
21
+ * "enabled": true,
22
+ * "coveragePath": "coverage/coverage-summary.json",
23
+ * "threshold": 80.0, // minimum overall percent
24
+ * "mode": "warn", // "warn" | "block"
25
+ * "deltaThreshold": 1.0, // warn/block when coverage drops by >= this percent
26
+ * "runOnChange": [".ts", ".tsx", ".js", ".jsx"]
27
+ * }
28
+ * ```
29
+ *
30
+ * @public
31
+ */
32
+ import type { Plugin } from '@wrongstack/core';
33
+ declare const plugin: Plugin;
34
+ export default plugin;
35
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/test-coverage-gate/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AAIH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAkI/C,QAAA,MAAM,MAAM,EAAE,MAyOb,CAAC;eAEa,MAAM"}
@@ -1,37 +1,2 @@
1
- import { Plugin } from '@wrongstack/core';
2
-
3
- /**
4
- * test-coverage-gate plugin — PostToolUse hook that watches for test
5
- * coverage regressions after source-file edits.
6
- *
7
- * The plugin reads a coverage summary (e.g. `coverage/coverage-summary.json`
8
- * produced by c8/vitest/istanbul) after each `write`/`edit` to a source
9
- * file, compares it to the previous snapshot, and warns/block when the
10
- * overall coverage drops below a configured threshold or when a single
11
- * edited file loses coverage.
12
- *
13
- * Tools registered:
14
- * - coverage_gate_status : Show config + per-session counters + last diff.
15
- *
16
- * Hooks registered:
17
- * - PostToolUse with matcher `write|edit`.
18
- *
19
- * Config (`config.extensions['test-coverage-gate']`):
20
- *
21
- * ```jsonc
22
- * {
23
- * "enabled": true,
24
- * "coveragePath": "coverage/coverage-summary.json",
25
- * "threshold": 80.0, // minimum overall percent
26
- * "mode": "warn", // "warn" | "block"
27
- * "deltaThreshold": 1.0, // warn/block when coverage drops by >= this percent
28
- * "runOnChange": [".ts", ".tsx", ".js", ".jsx"]
29
- * }
30
- * ```
31
- *
32
- * @public
33
- */
34
-
35
- declare const plugin: Plugin;
36
-
37
- export { plugin as default };
1
+ export * from './test-coverage-gate/index.js';
2
+ export { default } from './test-coverage-gate/index.js';
@@ -1,7 +1,6 @@
1
- import { readFileSync } from 'fs';
2
- import { isAbsolute, resolve, relative } from 'path';
3
-
4
1
  // src/test-coverage-gate/index.ts
2
+ import { readFileSync } from "node:fs";
3
+ import { isAbsolute, relative, resolve } from "node:path";
5
4
  var API_VERSION = "^0.1.10";
6
5
  var state = {
7
6
  invocationCount: 0,
@@ -259,5 +258,6 @@ var plugin = {
259
258
  }
260
259
  };
261
260
  var test_coverage_gate_default = plugin;
262
-
263
- export { test_coverage_gate_default as default };
261
+ export {
262
+ test_coverage_gate_default as default
263
+ };
@@ -0,0 +1,25 @@
1
+ /**
2
+ * test-flake-detector plugin — runs a test command multiple times and reports
3
+ * tests that fail non-deterministically (flaky tests).
4
+ *
5
+ * Tools registered:
6
+ * - `flake_detect` : run a test command N times and identify flaky tests
7
+ * - `flake_status` : show config + per-session counters
8
+ *
9
+ * Config (`config.extensions['test-flake-detector']`):
10
+ *
11
+ * ```jsonc
12
+ * {
13
+ * "enabled": true,
14
+ * "defaultCommand": "npx vitest run", // used when flake_detect.command is omitted
15
+ * "maxRuns": 20, // hard upper bound for runs param
16
+ * "timeoutMs": 120000 // per-run timeout
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/test-flake-detector/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAMH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AA2P/C,QAAA,MAAM,MAAM,EAAE,MA6Nb,CAAC;eAEa,MAAM"}
@@ -1,27 +1,2 @@
1
- import { Plugin } from '@wrongstack/core';
2
-
3
- /**
4
- * test-flake-detector plugin — runs a test command multiple times and reports
5
- * tests that fail non-deterministically (flaky tests).
6
- *
7
- * Tools registered:
8
- * - `flake_detect` : run a test command N times and identify flaky tests
9
- * - `flake_status` : show config + per-session counters
10
- *
11
- * Config (`config.extensions['test-flake-detector']`):
12
- *
13
- * ```jsonc
14
- * {
15
- * "enabled": true,
16
- * "defaultCommand": "npx vitest run", // used when flake_detect.command is omitted
17
- * "maxRuns": 20, // hard upper bound for runs param
18
- * "timeoutMs": 120000 // per-run timeout
19
- * }
20
- * ```
21
- *
22
- * @public
23
- */
24
-
25
- declare const plugin: Plugin;
26
-
27
- export { plugin as default };
1
+ export * from './test-flake-detector/index.js';
2
+ export { default } from './test-flake-detector/index.js';
@@ -1,6 +1,8 @@
1
- import { execSync } from 'child_process';
2
-
3
1
  // src/test-flake-detector/index.ts
2
+ import { execFileSync } from "node:child_process";
3
+ import { readFileSync } from "node:fs";
4
+ import { createRequire } from "node:module";
5
+ import { dirname, isAbsolute, relative, resolve } from "node:path";
4
6
  var API_VERSION = "^0.1.10";
5
7
  var state = {
6
8
  invocationCount: 0,
@@ -60,19 +62,95 @@ function parseTestOutput(output) {
60
62
  }
61
63
  return { passed, failed };
62
64
  }
63
- function buildCommand(baseCommand, testPattern) {
64
- const trimmedBase = baseCommand.trim();
65
- if (!testPattern) return trimmedBase;
66
- if (trimmedBase.includes(testPattern)) return trimmedBase;
67
- return `${trimmedBase} ${testPattern}`;
65
+ var TEST_RUNNERS = /* @__PURE__ */ new Set(["vitest", "jest", "mocha"]);
66
+ var ALLOWED_RUNNER_FLAGS = /* @__PURE__ */ new Set([
67
+ "run",
68
+ "--run",
69
+ "--runInBand",
70
+ "--passWithNoTests",
71
+ "--reporter=verbose",
72
+ "--reporter=default"
73
+ ]);
74
+ function withinProject(p) {
75
+ if (p.length === 0 || p.length > 4096 || p.startsWith("-")) return false;
76
+ const root = resolve(process.cwd());
77
+ const resolved = isAbsolute(p) ? resolve(p) : resolve(root, p);
78
+ const rel = relative(root, resolved);
79
+ return rel === "" || !rel.startsWith("..") && !isAbsolute(rel);
80
+ }
81
+ function isInside(parent, child) {
82
+ if (parent === child) return true;
83
+ const rel = relative(parent, child);
84
+ return rel !== "" && !rel.startsWith("..") && !isAbsolute(rel);
85
+ }
86
+ function tokenizeCommand(command) {
87
+ const trimmed = command.trim();
88
+ if (!trimmed || /["'`;&|<>\r\n]/.test(trimmed)) return null;
89
+ return trimmed.split(/\s+/).filter(Boolean);
90
+ }
91
+ function resolveTestCommand(baseCommand, testPattern) {
92
+ const tokens = tokenizeCommand(baseCommand);
93
+ if (!tokens) return null;
94
+ let runner;
95
+ let runnerArgs;
96
+ const [head, second, third, ...rest] = tokens;
97
+ if (TEST_RUNNERS.has(head ?? "")) {
98
+ runner = head;
99
+ runnerArgs = tokens.slice(1);
100
+ } else if (head === "npx" && TEST_RUNNERS.has(second ?? "")) {
101
+ runner = second;
102
+ runnerArgs = tokens.slice(2);
103
+ } else if (head === "pnpm" && (second === "exec" || second === "dlx") && TEST_RUNNERS.has(third ?? "")) {
104
+ runner = third;
105
+ runnerArgs = rest;
106
+ } else if (head === "pnpm" && TEST_RUNNERS.has(second ?? "")) {
107
+ runner = second;
108
+ runnerArgs = tokens.slice(2);
109
+ } else if (head === "npm" && second === "exec" && TEST_RUNNERS.has(third ?? "")) {
110
+ runner = third;
111
+ runnerArgs = rest;
112
+ } else if (head === "yarn" && TEST_RUNNERS.has(second ?? "")) {
113
+ runner = second;
114
+ runnerArgs = tokens.slice(2);
115
+ } else {
116
+ return null;
117
+ }
118
+ if (runnerArgs.some((arg) => !ALLOWED_RUNNER_FLAGS.has(arg))) return null;
119
+ let resolvedEntry;
120
+ try {
121
+ const requireFromProject = createRequire(resolve(process.cwd(), "package.json"));
122
+ const packagePath = requireFromProject.resolve(`${runner}/package.json`);
123
+ const packageJson = JSON.parse(readFileSync(packagePath, "utf8"));
124
+ const relativeBin = typeof packageJson.bin === "string" ? packageJson.bin : packageJson.bin?.[runner] ?? Object.values(packageJson.bin ?? {})[0];
125
+ if (!relativeBin) return null;
126
+ const packageDir = dirname(packagePath);
127
+ const candidate = resolve(packageDir, relativeBin);
128
+ if (isAbsolute(relativeBin) || !isInside(packageDir, candidate)) {
129
+ return null;
130
+ }
131
+ resolvedEntry = candidate;
132
+ } catch {
133
+ return null;
134
+ }
135
+ const args = [resolvedEntry, ...runnerArgs];
136
+ if (testPattern) {
137
+ if (!withinProject(testPattern)) return null;
138
+ args.push(testPattern);
139
+ }
140
+ return {
141
+ cmd: process.execPath,
142
+ args,
143
+ display: [...tokens, ...testPattern ? [testPattern] : []].join(" ")
144
+ };
68
145
  }
69
146
  function runOnce(command, timeoutMs) {
70
147
  try {
71
- const output = execSync(command, {
148
+ const output = execFileSync(command.cmd, command.args, {
72
149
  encoding: "utf-8",
73
150
  timeout: timeoutMs,
74
151
  cwd: process.cwd(),
75
- stdio: ["pipe", "pipe", "pipe"]
152
+ stdio: ["pipe", "pipe", "pipe"],
153
+ shell: false
76
154
  });
77
155
  return { output };
78
156
  } catch (err) {
@@ -157,10 +235,16 @@ var plugin = {
157
235
  return { ok: false, error: "test-flake-detector is disabled" };
158
236
  }
159
237
  const requestedRuns = typeof input.runs === "number" && input.runs >= 1 ? Math.min(Math.floor(input.runs), cfg.maxRuns) : 5;
160
- const command = buildCommand(
238
+ const command = resolveTestCommand(
161
239
  typeof input.command === "string" && input.command.trim().length > 0 ? input.command : cfg.defaultCommand,
162
240
  input.testPattern
163
241
  );
242
+ if (!command) {
243
+ return {
244
+ ok: false,
245
+ error: "Unsupported test command or unsafe testPattern. Use vitest, jest, or mocha through a supported package runner, and keep patterns inside the project."
246
+ };
247
+ }
164
248
  state.invocationCount += 1;
165
249
  const start = Date.now();
166
250
  const records = /* @__PURE__ */ new Map();
@@ -202,7 +286,7 @@ var plugin = {
202
286
  };
203
287
  return {
204
288
  ok: true,
205
- command,
289
+ command: command.display,
206
290
  runsRequested: requestedRuns,
207
291
  runsCompleted,
208
292
  durationMs,
@@ -270,5 +354,6 @@ var plugin = {
270
354
  }
271
355
  };
272
356
  var test_flake_detector_default = plugin;
273
-
274
- export { test_flake_detector_default as default };
357
+ export {
358
+ test_flake_detector_default as default
359
+ };
@@ -0,0 +1,30 @@
1
+ /**
2
+ * test-generator plugin — generates a Vitest test skeleton from a source file
3
+ * using regex-based export detection.
4
+ *
5
+ * Tool registered:
6
+ * - generate_unit_tests : Read a source file and return a test file skeleton.
7
+ *
8
+ * No hooks are registered.
9
+ *
10
+ * Config (`config.extensions['test-generator']`):
11
+ *
12
+ * ```jsonc
13
+ * {
14
+ * "enabled": true,
15
+ * "framework": "vitest",
16
+ * "testSuffix": ".test",
17
+ * "includeImports": true
18
+ * }
19
+ * ```
20
+ *
21
+ * @public
22
+ */
23
+ import type { Plugin } from '@wrongstack/core';
24
+ export interface DetectedExport {
25
+ name: string;
26
+ kind: 'function' | 'arrow' | 'class' | 'named';
27
+ }
28
+ declare const plugin: Plugin;
29
+ export default plugin;
30
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/test-generator/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAIH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AA4E/C,MAAM,WAAW,cAAc;IAC7B,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,UAAU,GAAG,OAAO,GAAG,OAAO,GAAG,OAAO,CAAC;CAChD;AAyHD,QAAA,MAAM,MAAM,EAAE,MAuHb,CAAC;eAEa,MAAM"}
@@ -1,32 +1,2 @@
1
- import { Plugin } from '@wrongstack/core';
2
-
3
- /**
4
- * test-generator plugin — generates a Vitest test skeleton from a source file
5
- * using regex-based export detection.
6
- *
7
- * Tool registered:
8
- * - generate_unit_tests : Read a source file and return a test file skeleton.
9
- *
10
- * No hooks are registered.
11
- *
12
- * Config (`config.extensions['test-generator']`):
13
- *
14
- * ```jsonc
15
- * {
16
- * "enabled": true,
17
- * "framework": "vitest",
18
- * "testSuffix": ".test",
19
- * "includeImports": true
20
- * }
21
- * ```
22
- *
23
- * @public
24
- */
25
-
26
- interface DetectedExport {
27
- name: string;
28
- kind: 'function' | 'arrow' | 'class' | 'named';
29
- }
30
- declare const plugin: Plugin;
31
-
32
- export { type DetectedExport, plugin as default };
1
+ export * from './test-generator/index.js';
2
+ export { default } from './test-generator/index.js';
@@ -1,7 +1,6 @@
1
- import { readFileSync } from 'fs';
2
- import { resolve, isAbsolute, relative } from 'path';
3
-
4
1
  // src/test-generator/index.ts
2
+ import { readFileSync } from "node:fs";
3
+ import { isAbsolute, relative, resolve } from "node:path";
5
4
  var API_VERSION = "^0.1.10";
6
5
  var state = {
7
6
  generateCount: 0,
@@ -239,5 +238,6 @@ var plugin = {
239
238
  }
240
239
  };
241
240
  var test_generator_default = plugin;
242
-
243
- export { test_generator_default as default };
241
+ export {
242
+ test_generator_default as default
243
+ };
@@ -0,0 +1,35 @@
1
+ /**
2
+ * test-runner-gate plugin — PostToolUse hook that runs the relevant
3
+ * test file after every `write` or `edit` to a source file.
4
+ *
5
+ * Tools registered:
6
+ * - test_gate_status : Show config + per-session counters.
7
+ *
8
+ * Hooks registered:
9
+ * - PostToolUse with matcher `write|edit`. After the tool completes,
10
+ * maps the changed source file to its test file (using configurable
11
+ * patterns), runs `vitest run <test-file>` and injects the result
12
+ * as `additionalContext`.
13
+ *
14
+ * Config (`config.extensions['test-runner-gate']`):
15
+ *
16
+ * ```jsonc
17
+ * {
18
+ * "enabled": true,
19
+ * "command": "npx vitest run", // base test command
20
+ * "timeoutMs": 30000, // test process timeout
21
+ * "testFilePatterns": [ // how to derive test path from source
22
+ * "src/{path}.test.ts", // co-located: src/foo.ts → src/foo.test.ts
23
+ * "tests/{name}.test.ts", // mirror dir: src/foo.ts → tests/foo.test.ts
24
+ * "tests/{name}-exec.test.ts" // exec variant
25
+ * ],
26
+ * "injectOnPass": false // inject context when tests pass too?
27
+ * }
28
+ * ```
29
+ *
30
+ * @public
31
+ */
32
+ import type { Plugin } from '@wrongstack/core';
33
+ declare const plugin: Plugin;
34
+ export default plugin;
35
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/test-runner-gate/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AAKH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAmc/C,QAAA,MAAM,MAAM,EAAE,MA+Tb,CAAC;eAEa,MAAM"}
@@ -1,37 +1,2 @@
1
- import { Plugin } from '@wrongstack/core';
2
-
3
- /**
4
- * test-runner-gate plugin — PostToolUse hook that runs the relevant
5
- * test file after every `write` or `edit` to a source file.
6
- *
7
- * Tools registered:
8
- * - test_gate_status : Show config + per-session counters.
9
- *
10
- * Hooks registered:
11
- * - PostToolUse with matcher `write|edit`. After the tool completes,
12
- * maps the changed source file to its test file (using configurable
13
- * patterns), runs `vitest run <test-file>` and injects the result
14
- * as `additionalContext`.
15
- *
16
- * Config (`config.extensions['test-runner-gate']`):
17
- *
18
- * ```jsonc
19
- * {
20
- * "enabled": true,
21
- * "command": "npx vitest run", // base test command
22
- * "timeoutMs": 30000, // test process timeout
23
- * "testFilePatterns": [ // how to derive test path from source
24
- * "src/{path}.test.ts", // co-located: src/foo.ts → src/foo.test.ts
25
- * "tests/{name}.test.ts", // mirror dir: src/foo.ts → tests/foo.test.ts
26
- * "tests/{name}-exec.test.ts" // exec variant
27
- * ],
28
- * "injectOnPass": false // inject context when tests pass too?
29
- * }
30
- * ```
31
- *
32
- * @public
33
- */
34
-
35
- declare const plugin: Plugin;
36
-
37
- export { plugin as default };
1
+ export * from './test-runner-gate/index.js';
2
+ export { default } from './test-runner-gate/index.js';
@@ -1,8 +1,7 @@
1
- import { execSync, execFileSync } from 'child_process';
2
- import { existsSync } from 'fs';
3
- import { isAbsolute, resolve, relative, basename, dirname, join } from 'path';
4
-
5
1
  // src/test-runner-gate/index.ts
2
+ import { execFileSync, execSync } from "node:child_process";
3
+ import { existsSync } from "node:fs";
4
+ import { basename, dirname, isAbsolute, join, relative, resolve } from "node:path";
6
5
  var API_VERSION = "^0.1.10";
7
6
  var state = {
8
7
  invocationCount: 0,
@@ -484,5 +483,6 @@ Fix the failing tests or revert the change if it broke something.`
484
483
  }
485
484
  };
486
485
  var test_runner_gate_default = plugin;
487
-
488
- export { test_runner_gate_default as default };
486
+ export {
487
+ test_runner_gate_default as default
488
+ };
@@ -0,0 +1,35 @@
1
+ /**
2
+ * todo-listener plugin — PostToolUse hook on the `todo` tool that
3
+ * broadcasts a structured status update to the project mailbox.
4
+ *
5
+ * When the agent (or any plugin) calls the built-in `todo` tool, the
6
+ * full todo list is replaced in `ctx.todos`. The hook fires after the
7
+ * tool completes, reads the new state, and posts a compact summary
8
+ * to the project mailbox so that other agents in the same project
9
+ * (terminals, WebUIs, shadow agents) can see what this agent is
10
+ * working on in real time.
11
+ *
12
+ * Use cases:
13
+ * - Multi-agent fleets where a coordinator should know which
14
+ * sub-agent is working on which item
15
+ * - Long-running sessions where a user opens a second terminal and
16
+ * wants to see the in-progress plan
17
+ * - Shadow agents that audit progress across the project
18
+ *
19
+ * Config (`config.extensions['todo-listener']`):
20
+ *
21
+ * ```jsonc
22
+ * {
23
+ * "enabled": false,
24
+ * "subjectPrefix": "todo: ",
25
+ * "broadcastOnChange": true,
26
+ * "cooldownMs": 30000
27
+ * }
28
+ * ```
29
+ *
30
+ * @public
31
+ */
32
+ import type { Plugin } from '@wrongstack/core';
33
+ declare const plugin: Plugin;
34
+ export default plugin;
35
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/todo-listener/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AACH,OAAO,KAAK,EAAE,MAAM,EAAY,MAAM,kBAAkB,CAAC;AAoGzD,QAAA,MAAM,MAAM,EAAE,MAqNb,CAAC;eAEa,MAAM"}
@@ -1,37 +1,2 @@
1
- import { Plugin } from '@wrongstack/core';
2
-
3
- /**
4
- * todo-listener plugin — PostToolUse hook on the `todo` tool that
5
- * broadcasts a structured status update to the project mailbox.
6
- *
7
- * When the agent (or any plugin) calls the built-in `todo` tool, the
8
- * full todo list is replaced in `ctx.todos`. The hook fires after the
9
- * tool completes, reads the new state, and posts a compact summary
10
- * to the project mailbox so that other agents in the same project
11
- * (terminals, WebUIs, shadow agents) can see what this agent is
12
- * working on in real time.
13
- *
14
- * Use cases:
15
- * - Multi-agent fleets where a coordinator should know which
16
- * sub-agent is working on which item
17
- * - Long-running sessions where a user opens a second terminal and
18
- * wants to see the in-progress plan
19
- * - Shadow agents that audit progress across the project
20
- *
21
- * Config (`config.extensions['todo-listener']`):
22
- *
23
- * ```jsonc
24
- * {
25
- * "enabled": false,
26
- * "subjectPrefix": "todo: ",
27
- * "broadcastOnChange": true,
28
- * "cooldownMs": 30000
29
- * }
30
- * ```
31
- *
32
- * @public
33
- */
34
-
35
- declare const plugin: Plugin;
36
-
37
- export { plugin as default };
1
+ export * from './todo-listener/index.js';
2
+ export { default } from './todo-listener/index.js';
@@ -212,5 +212,6 @@ var plugin = {
212
212
  }
213
213
  };
214
214
  var todo_listener_default = plugin;
215
-
216
- export { todo_listener_default as default };
215
+ export {
216
+ todo_listener_default as default
217
+ };